{"messages": [{"role": "user", "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 2.08 mm."}, {"role": "assistant", "content": "```python\n#!/usr/bin/env python3\n# -*- coding: utf-8 -*-\n# Ground-truth 2D engineering drawing for part: 0000_00006012\n# Self-contained: reproduces the three-view DXF via ezdxf, NO FreeCAD needed.\n# Coordinates are A4 page millimetres (scale=0.9413877551020439, page=[297.0, 210.0]).\n# visible edges -> solid (layer OUTLINE); hidden edges -> dashed (layer HIDDEN)\n# dimensions -> real movable DIMENSION entities (text = true mm value)\n# Run: python 0000_00006012_gt.py [out.dxf]\nimport sys\nimport ezdxf\n\nSCALE = 0.9413877551020439\nPAGE = [297.0, 210.0]\n\nVISIBLE_SEGMENTS = [\n (159.301806, 172.049985, 159.301806, 77.91121),\n (159.301806, 77.91121, 111.736951, 77.91121),\n (111.736951, 77.91121, 111.736951, 172.049985),\n (111.736951, 172.049985, 159.301806, 172.049985),\n (159.301806, 61.949985, 159.301806, 63.91121),\n (159.301806, 63.91121, 111.736951, 63.91121),\n (111.736951, 61.949985, 111.736951, 63.91121),\n (159.301806, 61.949985, 111.736951, 61.949985),\n (173.301806, 77.91121, 175.263031, 77.91121),\n (175.263031, 77.91121, 175.263031, 172.049985),\n (173.301806, 172.049985, 175.263031, 172.049985),\n (173.301806, 77.91121, 173.301806, 172.049985)\n]\nVISIBLE_CIRCLES = [\n\n]\nVISIBLE_ARCS = [\n\n]\nHIDDEN_SEGMENTS = [\n\n]\n# (orient, text, p1, p2, base) for linear; (orient, text, center, radius, angle) for diameter\nDIMENSIONS = [\n ('horizontal', '50.5263', (159.3018, 172.05), (111.737, 172.05), (135.5194, 161.05)),\n ('vertical', '100', (159.3018, 77.9112), (159.3018, 172.05), (148.3018, 124.9806)),\n ('horizontal', '2.0833', (173.3018, 77.9112), (175.263, 77.9112), (174.2824, 88.9112))\n]\n\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\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\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,\n angle=(0 if d[0] == \"horizontal\" else 90),\n 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,\n text=text, dimstyle=\"EZDXF\").render()\n\n doc.saveas(out_path)\n\n\nif __name__ == \"__main__\":\n out = sys.argv[1] if len(sys.argv) > 1 else \"0000_00006012_gt.dxf\"\n draw(out)\n print(\"wrote\", out)\n```"}], "images": ["images/0000_00006012.png"], "id": "0000_00006012"} {"messages": [{"role": "user", "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 24.21 mm tall. It is extruded to a thickness of 0.52 mm."}, {"role": "assistant", "content": "```python\n#!/usr/bin/env python3\n# -*- coding: utf-8 -*-\n# Ground-truth 2D engineering drawing for part: 0001_00015335\n# Self-contained: reproduces the three-view DXF via ezdxf, NO FreeCAD needed.\n# Coordinates are A4 page millimetres (scale=1.461786528497414, page=[297.0, 210.0]).\n# visible edges -> solid (layer OUTLINE); hidden edges -> dashed (layer HIDDEN)\n# dimensions -> real movable DIMENSION entities (text = true mm value)\n# Run: python 0001_00015335_gt.py [out.dxf]\nimport sys\nimport ezdxf\n\nSCALE = 1.461786528497414\nPAGE = [297.0, 210.0]\n\nVISIBLE_SEGMENTS = [\n (209.208681, 142.075973, 209.208681, 106.685352),\n (209.208681, 106.685352, 63.030028, 106.685352),\n (63.030028, 106.685352, 63.030028, 142.075973),\n (63.030028, 142.075973, 209.208681, 142.075973),\n (209.208681, 91.924004, 209.208681, 92.685352),\n (209.208681, 92.685352, 63.030028, 92.685352),\n (63.030028, 91.924004, 63.030028, 92.685352),\n (209.208681, 91.924004, 63.030028, 91.924004),\n (223.208681, 106.685352, 223.970028, 106.685352),\n (223.970028, 106.685352, 223.970028, 142.075973),\n (223.208681, 142.075973, 223.970028, 142.075973),\n (223.208681, 106.685352, 223.208681, 142.075973)\n]\nVISIBLE_CIRCLES = [\n\n]\nVISIBLE_ARCS = [\n\n]\nHIDDEN_SEGMENTS = [\n\n]\n# (orient, text, p1, p2, base) for linear; (orient, text, center, radius, angle) for diameter\nDIMENSIONS = [\n ('horizontal', '100', (209.2087, 142.0759), (63.03, 142.0759), (136.1193, 131.0759)),\n ('vertical', '24.2105', (209.2087, 106.6854), (209.2087, 142.0759), (198.2087, 124.3807)),\n ('horizontal', '0.5208', (223.2087, 106.6854), (223.97, 106.6854), (223.5893, 117.6854))\n]\n\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\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\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,\n angle=(0 if d[0] == \"horizontal\" else 90),\n 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,\n text=text, dimstyle=\"EZDXF\").render()\n\n doc.saveas(out_path)\n\n\nif __name__ == \"__main__\":\n out = sys.argv[1] if len(sys.argv) > 1 else \"0001_00015335_gt.dxf\"\n draw(out)\n print(\"wrote\", out)\n```"}], "images": ["images/0001_00015335.png"], "id": "0001_00015335"} {"messages": [{"role": "user", "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.68 mm tall. It is extruded to a thickness of 2.08 mm."}, {"role": "assistant", "content": "```python\n#!/usr/bin/env python3\n# -*- coding: utf-8 -*-\n# Ground-truth 2D engineering drawing for part: 0001_00015648\n# Self-contained: reproduces the three-view DXF via ezdxf, NO FreeCAD needed.\n# Coordinates are A4 page millimetres (scale=1.4394122448979638, page=[297.0, 210.0]).\n# visible edges -> solid (layer OUTLINE); hidden edges -> dashed (layer HIDDEN)\n# dimensions -> real movable DIMENSION entities (text = true mm value)\n# Run: python 0001_00015648_gt.py [out.dxf]\nimport sys\nimport ezdxf\n\nSCALE = 1.4394122448979638\nPAGE = [297.0, 210.0]\n\nVISIBLE_SEGMENTS = [\n (206.97121, 135.348012, 206.97121, 115.650792),\n (206.97121, 115.650792, 63.029985, 115.650792),\n (63.029985, 115.650792, 63.029985, 135.348012),\n (63.029985, 135.348012, 206.97121, 135.348012),\n (206.97121, 98.652016, 206.97121, 101.650792),\n (206.97121, 101.650792, 63.029985, 101.650792),\n (63.029985, 98.652016, 63.029985, 101.650792),\n (206.97121, 98.652016, 63.029985, 98.652016),\n (220.97121, 115.650792, 223.969985, 115.650792),\n (223.969985, 115.650792, 223.969985, 135.348012),\n (220.97121, 135.348012, 223.969985, 135.348012),\n (220.97121, 115.650792, 220.97121, 135.348012)\n]\nVISIBLE_CIRCLES = [\n\n]\nVISIBLE_ARCS = [\n\n]\nHIDDEN_SEGMENTS = [\n\n]\n# (orient, text, p1, p2, base) for linear; (orient, text, center, radius, angle) for diameter\nDIMENSIONS = [\n ('horizontal', '100', (206.9712, 135.348), (63.03, 135.348), (135.0006, 124.348)),\n ('vertical', '13.6842', (206.9712, 115.6508), (206.9712, 135.348), (195.9712, 125.4994)),\n ('horizontal', '2.0833', (220.9712, 115.6508), (223.97, 115.6508), (222.4706, 126.6508))\n]\n\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\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\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,\n angle=(0 if d[0] == \"horizontal\" else 90),\n 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,\n text=text, dimstyle=\"EZDXF\").render()\n\n doc.saveas(out_path)\n\n\nif __name__ == \"__main__\":\n out = sys.argv[1] if len(sys.argv) > 1 else \"0001_00015648_gt.dxf\"\n draw(out)\n print(\"wrote\", out)\n```"}], "images": ["images/0001_00015648.png"], "id": "0001_00015648"} {"messages": [{"role": "user", "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 53.81 mm. The outline includes one or more oblique (angled) edges."}, {"role": "assistant", "content": "```python\n#!/usr/bin/env python3\n# -*- coding: utf-8 -*-\n# Ground-truth 2D engineering drawing for part: 0001_00017961\n# Self-contained: reproduces the three-view DXF via ezdxf, NO FreeCAD needed.\n# Coordinates are A4 page millimetres (scale=0.7159708316415446, page=[297.0, 210.0]).\n# visible edges -> solid (layer OUTLINE); hidden edges -> dashed (layer HIDDEN)\n# dimensions -> real movable DIMENSION entities (text = true mm value)\n# Run: python 0001_00017961_gt.py [out.dxf]\nimport sys\nimport ezdxf\nimport math\n\nSCALE = 0.7159708316415446\nPAGE = [297.0, 210.0]\n\nVISIBLE_SEGMENTS = [\n (152.753217, 114.4762, 152.753217, 163.077479),\n (152.753217, 163.077479, 81.720578, 172.050023),\n (81.720578, 172.050023, 81.720578, 114.4762),\n (81.720578, 114.4762, 152.753217, 114.4762),\n (152.753217, 100.4762, 152.753217, 61.950023),\n (152.753217, 61.950023, 81.720578, 61.950023),\n (81.720578, 100.4762, 81.720578, 61.950023),\n (152.753217, 100.4762, 81.720578, 100.4762),\n (166.753217, 172.050023, 205.279394, 172.050023),\n (205.279394, 172.050023, 205.279394, 114.4762),\n (166.753217, 114.4762, 205.279394, 114.4762),\n (166.753217, 172.050023, 166.753217, 114.4762)\n]\nVISIBLE_CIRCLES = [\n\n]\nVISIBLE_ARCS = [\n\n]\nHIDDEN_SEGMENTS = [\n (166.7532, 123.4487, 205.2794, 123.4487)\n]\n# (orient, text, p1, p2, base) for linear; (orient, text, center, radius, angle) for diameter\nDIMENSIONS = [\n ('horizontal', '99.2116', (81.7206, 114.4762), (152.7532, 114.4762), (117.2369, 125.4762)),\n ('vertical', '67.8816', (152.7532, 114.4762), (152.7532, 163.0775), (141.7532, 138.7768)),\n ('vertical', '80.4136', (81.7206, 172.05), (81.7206, 114.4762), (92.7206, 143.2631)),\n ('aligned', '100', (152.7532, 163.0775), (81.7206, 172.05), (115.8584, 156.6505)),\n ('horizontal', '53.8097', (166.7532, 114.4762), (205.2794, 114.4762), (186.0163, 125.4762))\n]\n\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; _ds.dxf.dimasz = 2.5\n _ds.dxf.dimexe = 1.25; _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\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\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,\n angle=(0 if d[0] == \"horizontal\" else 90),\n 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,\n 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,\n 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,\n text=text, dimstyle=\"EZDXF\").render()\n\n doc.saveas(out_path)\n\n\nif __name__ == \"__main__\":\n out = sys.argv[1] if len(sys.argv) > 1 else \"0001_00017961_gt.dxf\"\n draw(out)\n print(\"wrote\", out)\n```"}], "images": ["images/0001_00017961.png"], "id": "0001_00017961"} {"messages": [{"role": "user", "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 6.77 mm."}, {"role": "assistant", "content": "```python\n#!/usr/bin/env python3\n# -*- coding: utf-8 -*-\n# Ground-truth 2D engineering drawing for part: 0002_00022648\n# Self-contained: reproduces the three-view DXF via ezdxf, NO FreeCAD needed.\n# Coordinates are A4 page millimetres (scale=1.2962094209865884, page=[297.0, 210.0]).\n# visible edges -> solid (layer OUTLINE); hidden edges -> dashed (layer HIDDEN)\n# dimensions -> real movable DIMENSION entities (text = true mm value)\n# Run: python 0002_00022648_gt.py [out.dxf]\nimport sys\nimport ezdxf\n\nSCALE = 1.2962094209865884\nPAGE = [297.0, 210.0]\n\nVISIBLE_SEGMENTS = [\n (196.922265, 172.050029, 196.922265, 84.726447),\n (196.922265, 84.726447, 67.301323, 84.726447),\n (67.301323, 84.726447, 67.301323, 172.050029),\n (67.301323, 172.050029, 196.922265, 172.050029),\n (196.922265, 61.950029, 196.922265, 70.726447),\n (196.922265, 70.726447, 67.301323, 70.726447),\n (67.301323, 61.950029, 67.301323, 70.726447),\n (196.922265, 61.950029, 67.301323, 61.950029),\n (210.922265, 84.726447, 219.698683, 84.726447),\n (219.698683, 84.726447, 219.698683, 172.050029),\n (210.922265, 172.050029, 219.698683, 172.050029),\n (210.922265, 84.726447, 210.922265, 172.050029)\n]\nVISIBLE_CIRCLES = [\n\n]\nVISIBLE_ARCS = [\n\n]\nHIDDEN_SEGMENTS = [\n\n]\n# (orient, text, p1, p2, base) for linear; (orient, text, center, radius, angle) for diameter\nDIMENSIONS = [\n ('horizontal', '100', (196.9223, 172.0501), (67.3013, 172.0501), (132.1118, 161.0501)),\n ('vertical', '67.3684', (196.9223, 84.7264), (196.9223, 172.0501), (185.9223, 128.3882)),\n ('horizontal', '6.7708', (210.9223, 84.7264), (219.6986, 84.7264), (215.3104, 95.7264))\n]\n\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\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\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,\n angle=(0 if d[0] == \"horizontal\" else 90),\n 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,\n text=text, dimstyle=\"EZDXF\").render()\n\n doc.saveas(out_path)\n\n\nif __name__ == \"__main__\":\n out = sys.argv[1] if len(sys.argv) > 1 else \"0002_00022648_gt.dxf\"\n draw(out)\n print(\"wrote\", out)\n```"}], "images": ["images/0002_00022648.png"], "id": "0002_00022648"} {"messages": [{"role": "user", "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 82.11 mm wide and 100 mm tall. It is extruded to a thickness of 45.71 mm."}, {"role": "assistant", "content": "```python\n#!/usr/bin/env python3\n# -*- coding: utf-8 -*-\n# Ground-truth 2D engineering drawing for part: 0002_00024643\n# Self-contained: reproduces the three-view DXF via ezdxf, NO FreeCAD needed.\n# Coordinates are A4 page millimetres (scale=0.6595098039215672, page=[297.0, 210.0]).\n# visible edges -> solid (layer OUTLINE); hidden edges -> dashed (layer HIDDEN)\n# dimensions -> real movable DIMENSION entities (text = true mm value)\n# Run: python 0002_00024643_gt.py [out.dxf]\nimport sys\nimport ezdxf\n\nSCALE = 0.6595098039215672\nPAGE = [297.0, 210.0]\n\nVISIBLE_SEGMENTS = [\n (148.500101, 172.049988, 148.500101, 106.099008),\n (148.500101, 106.099008, 94.350875, 106.099008),\n (94.350875, 106.099008, 94.350875, 172.049988),\n (94.350875, 172.049988, 148.500101, 172.049988),\n (148.500101, 61.949988, 148.500101, 92.099008),\n (148.500101, 92.099008, 94.350875, 92.099008),\n (94.350875, 61.949988, 94.350875, 92.099008),\n (148.500101, 61.949988, 94.350875, 61.949988),\n (162.500101, 106.099008, 192.649121, 106.099008),\n (192.649121, 106.099008, 192.649121, 172.049988),\n (162.500101, 172.049988, 192.649121, 172.049988),\n (162.500101, 106.099008, 162.500101, 172.049988)\n]\nVISIBLE_CIRCLES = [\n\n]\nVISIBLE_ARCS = [\n\n]\nHIDDEN_SEGMENTS = [\n\n]\n# (orient, text, p1, p2, base) for linear; (orient, text, center, radius, angle) for diameter\nDIMENSIONS = [\n ('horizontal', '82.1053', (148.5001, 172.05), (94.3509, 172.05), (121.4255, 161.05)),\n ('vertical', '100', (148.5001, 106.099), (148.5001, 172.05), (137.5001, 139.0745)),\n ('horizontal', '45.7143', (162.5001, 106.099), (192.6491, 106.099), (177.5746, 117.099))\n]\n\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\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\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,\n angle=(0 if d[0] == \"horizontal\" else 90),\n 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,\n text=text, dimstyle=\"EZDXF\").render()\n\n doc.saveas(out_path)\n\n\nif __name__ == \"__main__\":\n out = sys.argv[1] if len(sys.argv) > 1 else \"0002_00024643_gt.dxf\"\n draw(out)\n print(\"wrote\", out)\n```"}], "images": ["images/0002_00024643.png"], "id": "0002_00024643"} {"messages": [{"role": "user", "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 1.43 mm."}, {"role": "assistant", "content": "```python\n#!/usr/bin/env python3\n# -*- coding: utf-8 -*-\n# Ground-truth 2D engineering drawing for part: 0003_00035150\n# Self-contained: reproduces the three-view DXF via ezdxf, NO FreeCAD needed.\n# Coordinates are A4 page millimetres (scale=1.4487042253521332, page=[297.0, 210.0]).\n# visible edges -> solid (layer OUTLINE); hidden edges -> dashed (layer HIDDEN)\n# dimensions -> real movable DIMENSION entities (text = true mm value)\n# Run: python 0003_00035150_gt.py [out.dxf]\nimport sys\nimport ezdxf\n\nSCALE = 1.4487042253521332\nPAGE = [297.0, 210.0]\n\nVISIBLE_SEGMENTS = [\n (207.900409, 156.296255, 207.900409, 93.77323),\n (207.900409, 93.77323, 63.029986, 93.77323),\n (63.029986, 93.77323, 63.029986, 156.296255),\n (63.029986, 156.296255, 207.900409, 156.296255),\n (207.900409, 77.703653, 207.900409, 79.77323),\n (207.900409, 79.77323, 63.029986, 79.77323),\n (63.029986, 77.703653, 63.029986, 79.77323),\n (207.900409, 77.703653, 63.029986, 77.703653),\n (221.900409, 93.77323, 223.969986, 93.77323),\n (223.969986, 93.77323, 223.969986, 156.296255),\n (221.900409, 156.296255, 223.969986, 156.296255),\n (221.900409, 93.77323, 221.900409, 156.296255)\n]\nVISIBLE_CIRCLES = [\n\n]\nVISIBLE_ARCS = [\n\n]\nHIDDEN_SEGMENTS = [\n\n]\n# (orient, text, p1, p2, base) for linear; (orient, text, center, radius, angle) for diameter\nDIMENSIONS = [\n ('horizontal', '100', (207.9004, 156.2963), (63.03, 156.2963), (135.4652, 145.2963)),\n ('vertical', '43.1579', (207.9004, 93.7732), (207.9004, 156.2963), (196.9004, 125.0348)),\n ('horizontal', '1.4286', (221.9004, 93.7732), (223.97, 93.7732), (222.9352, 104.7732))\n]\n\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\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\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,\n angle=(0 if d[0] == \"horizontal\" else 90),\n 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,\n text=text, dimstyle=\"EZDXF\").render()\n\n doc.saveas(out_path)\n\n\nif __name__ == \"__main__\":\n out = sys.argv[1] if len(sys.argv) > 1 else \"0003_00035150_gt.dxf\"\n draw(out)\n print(\"wrote\", out)\n```"}], "images": ["images/0003_00035150.png"], "id": "0003_00035150"} {"messages": [{"role": "user", "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 -55.81 mm."}, {"role": "assistant", "content": "```python\n#!/usr/bin/env python3\n# -*- coding: utf-8 -*-\n# Ground-truth 2D engineering drawing for part: 0003_00036433\n# Self-contained: reproduces the three-view DXF via ezdxf, NO FreeCAD needed.\n# Coordinates are A4 page millimetres (scale=0.9037028084714528, page=[297.0, 210.0]).\n# visible edges -> solid (layer OUTLINE); hidden edges -> dashed (layer HIDDEN)\n# dimensions -> real movable DIMENSION entities (text = true mm value)\n# Run: python 0003_00036433_gt.py [out.dxf]\nimport sys\nimport ezdxf\n\nSCALE = 0.9037028084714528\nPAGE = [297.0, 210.0]\n\nVISIBLE_SEGMENTS = [\n (156.465531, 126.389216, 156.465531, 172.049989),\n (156.465531, 172.049989, 66.09525, 172.049989),\n (66.09525, 172.049989, 66.09525, 126.389216),\n (66.09525, 126.389216, 156.465531, 126.389216),\n (156.465531, 61.949989, 156.465531, 112.389216),\n (66.09525, 61.949989, 66.09525, 112.389216),\n (66.09525, 112.389216, 156.465531, 112.389216),\n (66.09525, 61.949989, 156.465531, 61.949989),\n (170.465531, 172.049989, 220.904757, 172.049989),\n (220.904757, 172.049989, 220.904757, 126.389216),\n (170.465531, 126.389216, 220.904757, 126.389216),\n (170.465531, 172.049989, 170.465531, 126.389216)\n]\nVISIBLE_CIRCLES = [\n\n]\nVISIBLE_ARCS = [\n\n]\nHIDDEN_SEGMENTS = [\n\n]\n# (orient, text, p1, p2, base) for linear; (orient, text, center, radius, angle) for diameter\nDIMENSIONS = [\n ('horizontal', '100', (156.4655, 126.3892), (66.0953, 126.3892), (111.2804, 115.3892)),\n ('vertical', '50.5263', (156.4655, 172.05), (156.4655, 126.3892), (167.4655, 149.2196)),\n ('horizontal', '55.814', (170.4655, 172.05), (220.9048, 172.05), (195.6852, 183.05))\n]\n\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\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\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,\n angle=(0 if d[0] == \"horizontal\" else 90),\n 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,\n text=text, dimstyle=\"EZDXF\").render()\n\n doc.saveas(out_path)\n\n\nif __name__ == \"__main__\":\n out = sys.argv[1] if len(sys.argv) > 1 else \"0003_00036433_gt.dxf\"\n draw(out)\n print(\"wrote\", out)\n```"}], "images": ["images/0003_00036433.png"], "id": "0003_00036433"} {"messages": [{"role": "user", "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 62.11 mm wide and 100 mm tall. It is extruded to a thickness of 1.28 mm."}, {"role": "assistant", "content": "```python\n#!/usr/bin/env python3\n# -*- coding: utf-8 -*-\n# Ground-truth 2D engineering drawing for part: 0003_00038831\n# Self-contained: reproduces the three-view DXF via ezdxf, NO FreeCAD needed.\n# Coordinates are A4 page millimetres (scale=0.9064480519481063, page=[297.0, 210.0]).\n# visible edges -> solid (layer OUTLINE); hidden edges -> dashed (layer HIDDEN)\n# dimensions -> real movable DIMENSION entities (text = true mm value)\n# Run: python 0003_00038831_gt.py [out.dxf]\nimport sys\nimport ezdxf\n\nSCALE = 0.9064480519481063\nPAGE = [297.0, 210.0]\n\nVISIBLE_SEGMENTS = [\n (164.066556, 79.258597, 164.066556, 169.903402),\n (164.066556, 169.903402, 107.771362, 169.903402),\n (107.771362, 169.903402, 107.771362, 79.258597),\n (107.771362, 79.258597, 164.066556, 79.258597),\n (164.066556, 65.258597, 164.066556, 64.096484),\n (107.771362, 65.258597, 107.771362, 64.096484),\n (107.771362, 64.096484, 164.066556, 64.096484),\n (107.771362, 65.258597, 164.066556, 65.258597),\n (179.228669, 169.903402, 178.066556, 169.903402),\n (178.066556, 169.903402, 178.066556, 79.258597),\n (179.228669, 79.258597, 178.066556, 79.258597),\n (179.228669, 169.903402, 179.228669, 79.258597)\n]\nVISIBLE_CIRCLES = [\n\n]\nVISIBLE_ARCS = [\n\n]\nHIDDEN_SEGMENTS = [\n\n]\n# (orient, text, p1, p2, base) for linear; (orient, text, center, radius, angle) for diameter\nDIMENSIONS = [\n ('horizontal', '62.1053', (164.0666, 79.2586), (107.7713, 79.2586), (135.9189, 68.2586)),\n ('vertical', '100', (164.0666, 169.9034), (164.0666, 79.2586), (175.0666, 124.581)),\n ('horizontal', '1.2821', (179.2287, 169.9034), (178.0665, 169.9034), (178.6476, 158.9034))\n]\n\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\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\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,\n angle=(0 if d[0] == \"horizontal\" else 90),\n 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,\n text=text, dimstyle=\"EZDXF\").render()\n\n doc.saveas(out_path)\n\n\nif __name__ == \"__main__\":\n out = sys.argv[1] if len(sys.argv) > 1 else \"0003_00038831_gt.dxf\"\n draw(out)\n print(\"wrote\", out)\n```"}], "images": ["images/0003_00038831.png"], "id": "0003_00038831"} {"messages": [{"role": "user", "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 80 mm wide and 100 mm tall. It is extruded to a thickness of 118.52 mm."}, {"role": "assistant", "content": "```python\n#!/usr/bin/env python3\n# -*- coding: utf-8 -*-\n# Ground-truth 2D engineering drawing for part: 0004_00042418\n# Self-contained: reproduces the three-view DXF via ezdxf, NO FreeCAD needed.\n# Coordinates are A4 page millimetres (scale=0.4397796610169864, page=[297.0, 210.0]).\n# visible edges -> solid (layer OUTLINE); hidden edges -> dashed (layer HIDDEN)\n# dimensions -> real movable DIMENSION entities (text = true mm value)\n# Run: python 0004_00042418_gt.py [out.dxf]\nimport sys\nimport ezdxf\n\nSCALE = 0.4397796610169864\nPAGE = [297.0, 210.0]\n\nVISIBLE_SEGMENTS = [\n (128.030188, 128.07202, 128.030188, 172.049986),\n (128.030188, 172.049986, 92.847815, 172.049986),\n (92.847815, 172.049986, 92.847815, 128.07202),\n (92.847815, 128.07202, 128.030188, 128.07202),\n (128.030188, 114.07202, 128.030188, 61.949986),\n (92.847815, 114.07202, 92.847815, 61.949986),\n (92.847815, 61.949986, 128.030188, 61.949986),\n (92.847815, 114.07202, 128.030188, 114.07202),\n (194.152222, 172.049986, 142.030188, 172.049986),\n (142.030188, 172.049986, 142.030188, 128.07202),\n (194.152222, 128.07202, 142.030188, 128.07202),\n (194.152222, 172.049986, 194.152222, 128.07202)\n]\nVISIBLE_CIRCLES = [\n\n]\nVISIBLE_ARCS = [\n\n]\nHIDDEN_SEGMENTS = [\n\n]\n# (orient, text, p1, p2, base) for linear; (orient, text, center, radius, angle) for diameter\nDIMENSIONS = [\n ('horizontal', '80', (128.0302, 128.072), (92.8478, 128.072), (110.439, 117.072)),\n ('vertical', '100', (128.0302, 172.05), (128.0302, 128.072), (139.0302, 150.061)),\n ('horizontal', '118.519', (194.1522, 172.05), (142.0302, 172.05), (168.0912, 161.05))\n]\n\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\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\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,\n angle=(0 if d[0] == \"horizontal\" else 90),\n 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,\n text=text, dimstyle=\"EZDXF\").render()\n\n doc.saveas(out_path)\n\n\nif __name__ == \"__main__\":\n out = sys.argv[1] if len(sys.argv) > 1 else \"0004_00042418_gt.dxf\"\n draw(out)\n print(\"wrote\", out)\n```"}], "images": ["images/0004_00042418.png"], "id": "0004_00042418"} {"messages": [{"role": "user", "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 4.4 mm."}, {"role": "assistant", "content": "```python\n#!/usr/bin/env python3\n# -*- coding: utf-8 -*-\n# Ground-truth 2D engineering drawing for part: 0004_00045602\n# Self-contained: reproduces the three-view DXF via ezdxf, NO FreeCAD needed.\n# Coordinates are A4 page millimetres (scale=0.920475903614497, page=[297.0, 210.0]).\n# visible edges -> solid (layer OUTLINE); hidden edges -> dashed (layer HIDDEN)\n# dimensions -> real movable DIMENSION entities (text = true mm value)\n# Run: python 0004_00045602_gt.py [out.dxf]\nimport sys\nimport ezdxf\n\nSCALE = 0.920475903614497\nPAGE = [297.0, 210.0]\n\nVISIBLE_SEGMENTS = [\n (180.497596, 172.049994, 180.497596, 80.002404),\n (180.497596, 80.002404, 88.450006, 80.002404),\n (88.450006, 80.002404, 88.450006, 172.049994),\n (88.450006, 172.049994, 180.497596, 172.049994),\n (180.497596, 61.949994, 180.497596, 66.002404),\n (180.497596, 66.002404, 88.450006, 66.002404),\n (88.450006, 61.949994, 88.450006, 66.002404),\n (180.497596, 61.949994, 88.450006, 61.949994),\n (194.497596, 80.002404, 198.550006, 80.002404),\n (198.550006, 80.002404, 198.550006, 172.049994),\n (194.497596, 172.049994, 198.550006, 172.049994),\n (194.497596, 80.002404, 194.497596, 172.049994)\n]\nVISIBLE_CIRCLES = [\n\n]\nVISIBLE_ARCS = [\n\n]\nHIDDEN_SEGMENTS = [\n\n]\n# (orient, text, p1, p2, base) for linear; (orient, text, center, radius, angle) for diameter\nDIMENSIONS = [\n ('horizontal', '100', (180.4976, 172.05), (88.45, 172.05), (134.4738, 161.05)),\n ('vertical', '100', (180.4976, 80.0024), (180.4976, 172.05), (169.4976, 126.0262)),\n ('horizontal', '4.4025', (194.4976, 80.0024), (198.55, 80.0024), (196.5238, 91.0024))\n]\n\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\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\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,\n angle=(0 if d[0] == \"horizontal\" else 90),\n 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,\n text=text, dimstyle=\"EZDXF\").render()\n\n doc.saveas(out_path)\n\n\nif __name__ == \"__main__\":\n out = sys.argv[1] if len(sys.argv) > 1 else \"0004_00045602_gt.dxf\"\n draw(out)\n print(\"wrote\", out)\n```"}], "images": ["images/0004_00045602.png"], "id": "0004_00045602"} {"messages": [{"role": "user", "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 69.89 mm."}, {"role": "assistant", "content": "```python\n#!/usr/bin/env python3\n# -*- coding: utf-8 -*-\n# Ground-truth 2D engineering drawing for part: 0005_00051257\n# Self-contained: reproduces the three-view DXF via ezdxf, NO FreeCAD needed.\n# Coordinates are A4 page millimetres (scale=0.7520314437555644, page=[297.0, 210.0]).\n# visible edges -> solid (layer OUTLINE); hidden edges -> dashed (layer HIDDEN)\n# dimensions -> real movable DIMENSION entities (text = true mm value)\n# Run: python 0005_00051257_gt.py [out.dxf]\nimport sys\nimport ezdxf\n\nSCALE = 0.7520314437555644\nPAGE = [297.0, 210.0]\n\nVISIBLE_SEGMENTS = [\n (147.820901, 172.049978, 147.820901, 128.511315),\n (147.820901, 128.511315, 72.617757, 128.511315),\n (72.617757, 128.511315, 72.617757, 172.049978),\n (72.617757, 172.049978, 147.820901, 172.049978),\n (147.820901, 61.949978, 147.820901, 114.511315),\n (147.820901, 114.511315, 72.617757, 114.511315),\n (72.617757, 61.949978, 72.617757, 114.511315),\n (147.820901, 61.949978, 72.617757, 61.949978),\n (161.820901, 128.511315, 214.382239, 128.511315),\n (214.382239, 128.511315, 214.382239, 172.049978),\n (161.820901, 172.049978, 214.382239, 172.049978),\n (161.820901, 128.511315, 161.820901, 172.049978)\n]\nVISIBLE_CIRCLES = [\n\n]\nVISIBLE_ARCS = [\n\n]\nHIDDEN_SEGMENTS = [\n\n]\n# (orient, text, p1, p2, base) for linear; (orient, text, center, radius, angle) for diameter\nDIMENSIONS = [\n ('horizontal', '100', (147.8209, 172.05), (72.6177, 172.05), (110.2193, 161.05)),\n ('vertical', '57.8947', (147.8209, 128.5113), (147.8209, 172.05), (136.8209, 150.2807)),\n ('horizontal', '69.8925', (161.8209, 128.5113), (214.3823, 128.5113), (188.1016, 139.5113))\n]\n\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\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\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,\n angle=(0 if d[0] == \"horizontal\" else 90),\n 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,\n text=text, dimstyle=\"EZDXF\").render()\n\n doc.saveas(out_path)\n\n\nif __name__ == \"__main__\":\n out = sys.argv[1] if len(sys.argv) > 1 else \"0005_00051257_gt.dxf\"\n draw(out)\n print(\"wrote\", out)\n```"}], "images": ["images/0005_00051257.png"], "id": "0005_00051257"} {"messages": [{"role": "user", "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 4800 mm."}, {"role": "assistant", "content": "```python\n#!/usr/bin/env python3\n# -*- coding: utf-8 -*-\n# Ground-truth 2D engineering drawing for part: 0005_00059670\n# Self-contained: reproduces the three-view DXF via ezdxf, NO FreeCAD needed.\n# Coordinates are A4 page millimetres (scale=0.019612244897959184, page=[297.0, 210.0]).\n# visible edges -> solid (layer OUTLINE); hidden edges -> dashed (layer HIDDEN)\n# dimensions -> real movable DIMENSION entities (text = true mm value)\n# Run: python 0005_00059670_gt.py [out.dxf]\nimport sys\nimport ezdxf\n\nSCALE = 0.019612244897959184\nPAGE = [297.0, 210.0]\n\nVISIBLE_SEGMENTS = [\n (90.41121, 170.088785, 90.41121, 172.05001),\n (90.41121, 172.05001, 88.449985, 172.05001),\n (88.449985, 172.05001, 88.449985, 170.088785),\n (88.449985, 170.088785, 90.41121, 170.088785),\n (90.41121, 156.088785, 90.41121, 61.95001),\n (88.449985, 156.088785, 88.449985, 61.95001),\n (88.449985, 61.95001, 90.41121, 61.95001),\n (88.449985, 156.088785, 90.41121, 156.088785),\n (198.549985, 172.05001, 104.41121, 172.05001),\n (104.41121, 172.05001, 104.41121, 170.088785),\n (198.549985, 170.088785, 104.41121, 170.088785),\n (198.549985, 172.05001, 198.549985, 170.088785)\n]\nVISIBLE_CIRCLES = [\n\n]\nVISIBLE_ARCS = [\n\n]\nHIDDEN_SEGMENTS = [\n\n]\n# (orient, text, p1, p2, base) for linear; (orient, text, center, radius, angle) for diameter\nDIMENSIONS = [\n ('horizontal', '100', (90.4112, 170.0888), (88.45, 170.0888), (89.4306, 159.0888)),\n ('vertical', '100', (90.4112, 172.05), (90.4112, 170.0888), (101.4112, 171.0694)),\n ('horizontal', '4800', (198.55, 172.05), (104.4112, 172.05), (151.4806, 161.05))\n]\n\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\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\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,\n angle=(0 if d[0] == \"horizontal\" else 90),\n 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,\n text=text, dimstyle=\"EZDXF\").render()\n\n doc.saveas(out_path)\n\n\nif __name__ == \"__main__\":\n out = sys.argv[1] if len(sys.argv) > 1 else \"0005_00059670_gt.dxf\"\n draw(out)\n print(\"wrote\", out)\n```"}], "images": ["images/0005_00059670.png"], "id": "0005_00059670"} {"messages": [{"role": "user", "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 38.95 mm tall. It is extruded to a thickness of 0.52 mm."}, {"role": "assistant", "content": "```python\n#!/usr/bin/env python3\n# -*- coding: utf-8 -*-\n# Ground-truth 2D engineering drawing for part: 0006_00062835\n# Self-contained: reproduces the three-view DXF via ezdxf, NO FreeCAD needed.\n# Coordinates are A4 page millimetres (scale=1.0575227272727776, page=[297.0, 210.0]).\n# visible edges -> solid (layer OUTLINE); hidden edges -> dashed (layer HIDDEN)\n# dimensions -> real movable DIMENSION entities (text = true mm value)\n# Run: python 0006_00062835_gt.py [out.dxf]\nimport sys\nimport ezdxf\n\nSCALE = 1.0575227272727776\nPAGE = [297.0, 210.0]\n\nVISIBLE_SEGMENTS = [\n (188.825337, 103.956944, 188.825337, 145.144671),\n (83.073065, 103.956944, 188.825337, 103.956944),\n (188.825337, 145.144671, 83.073065, 145.144671),\n (83.073065, 145.144671, 83.073065, 103.956944),\n (188.825337, 88.855357, 188.825337, 89.956944),\n (83.073065, 88.855357, 83.073065, 89.956944),\n (83.073065, 88.855357, 188.825337, 88.855357),\n (83.073065, 89.956944, 188.825337, 89.956944),\n (202.825337, 103.956944, 203.926923, 103.956944),\n (203.926923, 145.144671, 202.825337, 145.144671),\n (202.825337, 145.144671, 202.825337, 103.956944),\n (203.926923, 145.144671, 203.926923, 103.956944)\n]\nVISIBLE_CIRCLES = [\n\n]\nVISIBLE_ARCS = [\n\n]\nHIDDEN_SEGMENTS = [\n\n]\n# (orient, text, p1, p2, base) for linear; (orient, text, center, radius, angle) for diameter\nDIMENSIONS = [\n ('horizontal', '100', (188.8253, 103.9569), (83.0731, 103.9569), (135.9492, 92.9569)),\n ('vertical', '38.9474', (188.8253, 145.1447), (188.8253, 103.9569), (199.8253, 124.5508)),\n ('horizontal', '1.0417', (203.9269, 145.1447), (202.8254, 145.1447), (203.3761, 134.1447))\n]\n\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\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\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,\n angle=(0 if d[0] == \"horizontal\" else 90),\n 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,\n text=text, dimstyle=\"EZDXF\").render()\n\n doc.saveas(out_path)\n\n\nif __name__ == \"__main__\":\n out = sys.argv[1] if len(sys.argv) > 1 else \"0006_00062835_gt.dxf\"\n draw(out)\n print(\"wrote\", out)\n```"}], "images": ["images/0006_00062835.png"], "id": "0006_00062835"} {"messages": [{"role": "user", "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 46.32 mm tall. It is extruded to a thickness of 25 mm."}, {"role": "assistant", "content": "```python\n#!/usr/bin/env python3\n# -*- coding: utf-8 -*-\n# Ground-truth 2D engineering drawing for part: 0007_00074390\n# Self-contained: reproduces the three-view DXF via ezdxf, NO FreeCAD needed.\n# Coordinates are A4 page millimetres (scale=1.004266187050361, page=[297.0, 210.0]).\n# visible edges -> solid (layer OUTLINE); hidden edges -> dashed (layer HIDDEN)\n# dimensions -> real movable DIMENSION entities (text = true mm value)\n# Run: python 0007_00074390_gt.py [out.dxf]\nimport sys\nimport ezdxf\n\nSCALE = 1.004266187050361\nPAGE = [297.0, 210.0]\n\nVISIBLE_SEGMENTS = [\n (174.159993, 113.296611, 174.159993, 159.809993),\n (174.159993, 159.809993, 73.733374, 159.809993),\n (73.733374, 159.809993, 73.733374, 113.296611),\n (73.733374, 113.296611, 174.159993, 113.296611),\n (174.159993, 99.296611, 174.159993, 74.189957),\n (73.733374, 99.296611, 73.733374, 74.189957),\n (73.733374, 74.189957, 174.159993, 74.189957),\n (73.733374, 99.296611, 174.159993, 99.296611),\n (213.266647, 159.809993, 188.159993, 159.809993),\n (188.159993, 159.809993, 188.159993, 113.296611),\n (213.266647, 113.296611, 188.159993, 113.296611),\n (213.266647, 159.809993, 213.266647, 113.296611)\n]\nVISIBLE_CIRCLES = [\n\n]\nVISIBLE_ARCS = [\n\n]\nHIDDEN_SEGMENTS = [\n\n]\n# (orient, text, p1, p2, base) for linear; (orient, text, center, radius, angle) for diameter\nDIMENSIONS = [\n ('horizontal', '100', (174.16, 113.2966), (73.7334, 113.2966), (123.9467, 102.2966)),\n ('vertical', '46.3158', (174.16, 159.81), (174.16, 113.2966), (185.16, 136.5533)),\n ('horizontal', '25', (213.2666, 159.81), (188.16, 159.81), (200.7133, 148.81))\n]\n\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\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\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,\n angle=(0 if d[0] == \"horizontal\" else 90),\n 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,\n text=text, dimstyle=\"EZDXF\").render()\n\n doc.saveas(out_path)\n\n\nif __name__ == \"__main__\":\n out = sys.argv[1] if len(sys.argv) > 1 else \"0007_00074390_gt.dxf\"\n draw(out)\n print(\"wrote\", out)\n```"}], "images": ["images/0007_00074390.png"], "id": "0007_00074390"} {"messages": [{"role": "user", "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 98.97 mm."}, {"role": "assistant", "content": "```python\n#!/usr/bin/env python3\n# -*- coding: utf-8 -*-\n# Ground-truth 2D engineering drawing for part: 0008_00084290\n# Self-contained: reproduces the three-view DXF via ezdxf, NO FreeCAD needed.\n# Coordinates are A4 page millimetres (scale=0.4829896373057344, page=[297.0, 210.0]).\n# visible edges -> solid (layer OUTLINE); hidden edges -> dashed (layer HIDDEN)\n# dimensions -> real movable DIMENSION entities (text = true mm value)\n# Run: python 0008_00084290_gt.py [out.dxf]\nimport sys\nimport ezdxf\n\nSCALE = 0.4829896373057344\nPAGE = [297.0, 210.0]\n\nVISIBLE_SEGMENTS = [\n (136.494723, 123.751062, 136.494723, 172.050025),\n (136.494723, 172.050025, 88.70417, 172.050025),\n (88.70417, 172.050025, 88.70417, 123.751062),\n (88.70417, 123.751062, 136.494723, 123.751062),\n (136.494723, 109.751062, 136.494723, 61.950025),\n (88.70417, 109.751062, 88.70417, 61.950025),\n (88.70417, 61.950025, 136.494723, 61.950025),\n (88.70417, 109.751062, 136.494723, 109.751062),\n (198.29576, 172.050025, 150.494723, 172.050025),\n (150.494723, 172.050025, 150.494723, 123.751062),\n (198.29576, 123.751062, 150.494723, 123.751062),\n (198.29576, 172.050025, 198.29576, 123.751062)\n]\nVISIBLE_CIRCLES = [\n\n]\nVISIBLE_ARCS = [\n\n]\nHIDDEN_SEGMENTS = [\n\n]\n# (orient, text, p1, p2, base) for linear; (orient, text, center, radius, angle) for diameter\nDIMENSIONS = [\n ('horizontal', '98.9474', (136.4947, 123.7511), (88.7042, 123.7511), (112.5995, 112.7511)),\n ('vertical', '100', (136.4947, 172.05), (136.4947, 123.7511), (147.4947, 147.9005)),\n ('horizontal', '98.9691', (198.2958, 172.05), (150.4947, 172.05), (174.3953, 161.05))\n]\n\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\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\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,\n angle=(0 if d[0] == \"horizontal\" else 90),\n 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,\n text=text, dimstyle=\"EZDXF\").render()\n\n doc.saveas(out_path)\n\n\nif __name__ == \"__main__\":\n out = sys.argv[1] if len(sys.argv) > 1 else \"0008_00084290_gt.dxf\"\n draw(out)\n print(\"wrote\", out)\n```"}], "images": ["images/0008_00084290.png"], "id": "0008_00084290"} {"messages": [{"role": "user", "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 23.16 mm tall. It is extruded to a thickness of 8.57 mm."}, {"role": "assistant", "content": "```python\n#!/usr/bin/env python3\n# -*- coding: utf-8 -*-\n# Ground-truth 2D engineering drawing for part: 0008_00085945\n# Self-contained: reproduces the three-view DXF via ezdxf, NO FreeCAD needed.\n# Coordinates are A4 page millimetres (scale=1.193102564102652, page=[297.0, 210.0]).\n# visible edges -> solid (layer OUTLINE); hidden edges -> dashed (layer HIDDEN)\n# dimensions -> real movable DIMENSION entities (text = true mm value)\n# Run: python 0008_00085945_gt.py [out.dxf]\nimport sys\nimport ezdxf\n\nSCALE = 1.193102564102652\nPAGE = [297.0, 210.0]\n\nVISIBLE_SEGMENTS = [\n (191.041873, 115.298374, 191.041873, 142.928117),\n (191.041873, 142.928117, 71.731616, 142.928117),\n (71.731616, 142.928117, 71.731616, 115.298374),\n (71.731616, 115.298374, 191.041873, 115.298374),\n (191.041873, 101.298374, 191.041873, 91.07178),\n (71.731616, 101.298374, 71.731616, 91.07178),\n (71.731616, 91.07178, 191.041873, 91.07178),\n (71.731616, 101.298374, 191.041873, 101.298374),\n (215.268466, 142.928117, 205.041873, 142.928117),\n (205.041873, 142.928117, 205.041873, 115.298374),\n (215.268466, 115.298374, 205.041873, 115.298374),\n (215.268466, 142.928117, 215.268466, 115.298374)\n]\nVISIBLE_CIRCLES = [\n\n]\nVISIBLE_ARCS = [\n\n]\nHIDDEN_SEGMENTS = [\n\n]\n# (orient, text, p1, p2, base) for linear; (orient, text, center, radius, angle) for diameter\nDIMENSIONS = [\n ('horizontal', '100', (191.0419, 115.2984), (71.7316, 115.2984), (131.3867, 104.2984)),\n ('vertical', '23.1579', (191.0419, 142.9281), (191.0419, 115.2984), (202.0419, 129.1132)),\n ('horizontal', '8.5714', (215.2684, 142.9281), (205.0419, 142.9281), (210.1551, 131.9281))\n]\n\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\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\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,\n angle=(0 if d[0] == \"horizontal\" else 90),\n 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,\n text=text, dimstyle=\"EZDXF\").render()\n\n doc.saveas(out_path)\n\n\nif __name__ == \"__main__\":\n out = sys.argv[1] if len(sys.argv) > 1 else \"0008_00085945_gt.dxf\"\n draw(out)\n print(\"wrote\", out)\n```"}], "images": ["images/0008_00085945.png"], "id": "0008_00085945"} {"messages": [{"role": "user", "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 1600 mm."}, {"role": "assistant", "content": "```python\n#!/usr/bin/env python3\n# -*- coding: utf-8 -*-\n# Ground-truth 2D engineering drawing for part: 0009_00094376\n# Self-contained: reproduces the three-view DXF via ezdxf, NO FreeCAD needed.\n# Coordinates are A4 page millimetres (scale=0.05652941176470588, page=[297.0, 210.0]).\n# visible edges -> solid (layer OUTLINE); hidden edges -> dashed (layer HIDDEN)\n# dimensions -> real movable DIMENSION entities (text = true mm value)\n# Run: python 0009_00094376_gt.py [out.dxf]\nimport sys\nimport ezdxf\n\nSCALE = 0.05652941176470588\nPAGE = [297.0, 210.0]\n\nVISIBLE_SEGMENTS = [\n (94.102916, 172.050025, 94.102916, 166.397084),\n (94.102916, 166.397084, 88.449975, 166.397084),\n (88.449975, 166.397084, 88.449975, 172.050025),\n (88.449975, 172.050025, 94.102916, 172.050025),\n (94.102916, 61.950025, 94.102916, 152.397084),\n (94.102916, 152.397084, 88.449975, 152.397084),\n (88.449975, 61.950025, 88.449975, 152.397084),\n (94.102916, 61.950025, 88.449975, 61.950025),\n (108.102916, 166.397084, 198.549975, 166.397084),\n (198.549975, 166.397084, 198.549975, 172.050025),\n (108.102916, 172.050025, 198.549975, 172.050025),\n (108.102916, 166.397084, 108.102916, 172.050025)\n]\nVISIBLE_CIRCLES = [\n\n]\nVISIBLE_ARCS = [\n\n]\nHIDDEN_SEGMENTS = [\n\n]\n# (orient, text, p1, p2, base) for linear; (orient, text, center, radius, angle) for diameter\nDIMENSIONS = [\n ('horizontal', '100', (94.1029, 172.05), (88.45, 172.05), (91.2765, 161.05)),\n ('vertical', '100', (94.1029, 166.3971), (94.1029, 172.05), (83.1029, 169.2235)),\n ('horizontal', '1600', (108.1029, 166.3971), (198.55, 166.3971), (153.3265, 177.3971))\n]\n\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\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\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,\n angle=(0 if d[0] == \"horizontal\" else 90),\n 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,\n text=text, dimstyle=\"EZDXF\").render()\n\n doc.saveas(out_path)\n\n\nif __name__ == \"__main__\":\n out = sys.argv[1] if len(sys.argv) > 1 else \"0009_00094376_gt.dxf\"\n draw(out)\n print(\"wrote\", out)\n```"}], "images": ["images/0009_00094376.png"], "id": "0009_00094376"} {"messages": [{"role": "user", "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 10.53 mm tall. It is extruded to a thickness of 9.68 mm."}, {"role": "assistant", "content": "```python\n#!/usr/bin/env python3\n# -*- coding: utf-8 -*-\n# Ground-truth 2D engineering drawing for part: 0009_00094942\n# Self-contained: reproduces the three-view DXF via ezdxf, NO FreeCAD needed.\n# Coordinates are A4 page millimetres (scale=1.3397470588235256, page=[297.0, 210.0]).\n# visible edges -> solid (layer OUTLINE); hidden edges -> dashed (layer HIDDEN)\n# dimensions -> real movable DIMENSION entities (text = true mm value)\n# Run: python 0009_00094942_gt.py [out.dxf]\nimport sys\nimport ezdxf\n\nSCALE = 1.3397470588235256\nPAGE = [297.0, 210.0]\n\nVISIBLE_SEGMENTS = [\n (197.004642, 137.534, 197.004642, 123.4314),\n (197.004642, 123.4314, 63.029936, 123.4314),\n (63.029936, 123.4314, 63.029936, 137.534),\n (63.029936, 137.534, 197.004642, 137.534),\n (197.004642, 96.466106, 197.004642, 109.4314),\n (197.004642, 109.4314, 63.029936, 109.4314),\n (63.029936, 96.466106, 63.029936, 109.4314),\n (197.004642, 96.466106, 63.029936, 96.466106),\n (211.004642, 123.4314, 223.969936, 123.4314),\n (223.969936, 123.4314, 223.969936, 137.534),\n (211.004642, 137.534, 223.969936, 137.534),\n (211.004642, 123.4314, 211.004642, 137.534)\n]\nVISIBLE_CIRCLES = [\n\n]\nVISIBLE_ARCS = [\n\n]\nHIDDEN_SEGMENTS = [\n\n]\n# (orient, text, p1, p2, base) for linear; (orient, text, center, radius, angle) for diameter\nDIMENSIONS = [\n ('horizontal', '100', (197.0046, 137.534), (63.0299, 137.534), (130.0173, 126.534)),\n ('vertical', '10.5263', (197.0046, 123.4314), (197.0046, 137.534), (186.0046, 130.4827)),\n ('horizontal', '9.6774', (211.0047, 123.4314), (223.97, 123.4314), (217.4873, 134.4314))\n]\n\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\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\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,\n angle=(0 if d[0] == \"horizontal\" else 90),\n 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,\n text=text, dimstyle=\"EZDXF\").render()\n\n doc.saveas(out_path)\n\n\nif __name__ == \"__main__\":\n out = sys.argv[1] if len(sys.argv) > 1 else \"0009_00094942_gt.dxf\"\n draw(out)\n print(\"wrote\", out)\n```"}], "images": ["images/0009_00094942.png"], "id": "0009_00094942"} {"messages": [{"role": "user", "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 38.54 mm."}, {"role": "assistant", "content": "```python\n#!/usr/bin/env python3\n# -*- coding: utf-8 -*-\n# Ground-truth 2D engineering drawing for part: 0009_00099353\n# Self-contained: reproduces the three-view DXF via ezdxf, NO FreeCAD needed.\n# Coordinates are A4 page millimetres (scale=0.8035500137526361, page=[297.0, 210.0]).\n# visible edges -> solid (layer OUTLINE); hidden edges -> dashed (layer HIDDEN)\n# dimensions -> real movable DIMENSION entities (text = true mm value)\n# Run: python 0009_00099353_gt.py [out.dxf]\nimport sys\nimport ezdxf\n\nSCALE = 0.8035500137526361\nPAGE = [297.0, 210.0]\n\nVISIBLE_SEGMENTS = [\n (161.192409, 172.050026, 161.192409, 106.920183),\n (161.192409, 106.920183, 80.837408, 106.920183),\n (80.837408, 106.920183, 80.837408, 172.050026),\n (80.837408, 172.050026, 161.192409, 172.050026),\n (161.192409, 61.950026, 161.192409, 92.920183),\n (161.192409, 92.920183, 80.837408, 92.920183),\n (80.837408, 61.950026, 80.837408, 92.920183),\n (161.192409, 61.950026, 80.837408, 61.950026),\n (175.192409, 106.920183, 206.162566, 106.920183),\n (206.162566, 106.920183, 206.162566, 172.050026),\n (175.192409, 172.050026, 206.162566, 172.050026),\n (175.192409, 106.920183, 175.192409, 172.050026)\n]\nVISIBLE_CIRCLES = [\n\n]\nVISIBLE_ARCS = [\n\n]\nHIDDEN_SEGMENTS = [\n\n]\n# (orient, text, p1, p2, base) for linear; (orient, text, center, radius, angle) for diameter\nDIMENSIONS = [\n ('horizontal', '100', (161.1924, 172.05), (80.8374, 172.05), (121.0149, 161.05)),\n ('vertical', '81.0526', (161.1924, 106.9202), (161.1924, 172.05), (150.1924, 139.4851)),\n ('horizontal', '38.5417', (175.1924, 106.9202), (206.1626, 106.9202), (190.6775, 117.9202))\n]\n\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\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\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,\n angle=(0 if d[0] == \"horizontal\" else 90),\n 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,\n text=text, dimstyle=\"EZDXF\").render()\n\n doc.saveas(out_path)\n\n\nif __name__ == \"__main__\":\n out = sys.argv[1] if len(sys.argv) > 1 else \"0009_00099353_gt.dxf\"\n draw(out)\n print(\"wrote\", out)\n```"}], "images": ["images/0009_00099353.png"], "id": "0009_00099353"} {"messages": [{"role": "user", "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 10.08 mm."}, {"role": "assistant", "content": "```python\n#!/usr/bin/env python3\n# -*- coding: utf-8 -*-\n# Ground-truth 2D engineering drawing for part: 0009_00099786\n# Self-contained: reproduces the three-view DXF via ezdxf, NO FreeCAD needed.\n# Coordinates are A4 page millimetres (scale=0.8730211267606581, page=[297.0, 210.0]).\n# visible edges -> solid (layer OUTLINE); hidden edges -> dashed (layer HIDDEN)\n# dimensions -> real movable DIMENSION entities (text = true mm value)\n# Run: python 0009_00099786_gt.py [out.dxf]\nimport sys\nimport ezdxf\n\nSCALE = 0.8730211267606581\nPAGE = [297.0, 210.0]\n\nVISIBLE_SEGMENTS = [\n (149.561512, 84.747892, 149.561512, 172.050005),\n (149.561512, 172.050005, 114.640666, 172.050005),\n (114.640666, 172.050005, 114.640666, 84.747892),\n (114.640666, 84.747892, 149.561512, 84.747892),\n (149.561512, 70.747892, 149.561512, 61.950005),\n (114.640666, 70.747892, 114.640666, 61.950005),\n (114.640666, 61.950005, 149.561512, 61.950005),\n (114.640666, 70.747892, 149.561512, 70.747892),\n (172.359399, 172.050005, 163.561512, 172.050005),\n (163.561512, 172.050005, 163.561512, 84.747892),\n (172.359399, 84.747892, 163.561512, 84.747892),\n (172.359399, 172.050005, 172.359399, 84.747892)\n]\nVISIBLE_CIRCLES = [\n\n]\nVISIBLE_ARCS = [\n\n]\nHIDDEN_SEGMENTS = [\n\n]\n# (orient, text, p1, p2, base) for linear; (orient, text, center, radius, angle) for diameter\nDIMENSIONS = [\n ('horizontal', '40', (149.5615, 84.7479), (114.6407, 84.7479), (132.1011, 73.7479)),\n ('vertical', '100', (149.5615, 172.05), (149.5615, 84.7479), (160.5615, 128.3989)),\n ('horizontal', '10.0775', (172.3594, 172.05), (163.5615, 172.05), (167.9604, 161.05))\n]\n\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\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\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,\n angle=(0 if d[0] == \"horizontal\" else 90),\n 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,\n text=text, dimstyle=\"EZDXF\").render()\n\n doc.saveas(out_path)\n\n\nif __name__ == \"__main__\":\n out = sys.argv[1] if len(sys.argv) > 1 else \"0009_00099786_gt.dxf\"\n draw(out)\n print(\"wrote\", out)\n```"}], "images": ["images/0009_00099786.png"], "id": "0009_00099786"} {"messages": [{"role": "user", "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 66.32 mm tall. It is extruded to a thickness of 66.67 mm."}, {"role": "assistant", "content": "```python\n#!/usr/bin/env python3\n# -*- coding: utf-8 -*-\n# Ground-truth 2D engineering drawing for part: 0010_00101521\n# Self-contained: reproduces the three-view DXF via ezdxf, NO FreeCAD needed.\n# Coordinates are A4 page millimetres (scale=0.7226517150396151, page=[297.0, 210.0]).\n# visible edges -> solid (layer OUTLINE); hidden edges -> dashed (layer HIDDEN)\n# dimensions -> real movable DIMENSION entities (text = true mm value)\n# Run: python 0010_00101521_gt.py [out.dxf]\nimport sys\nimport ezdxf\n\nSCALE = 0.7226517150396151\nPAGE = [297.0, 210.0]\n\nVISIBLE_SEGMENTS = [\n (148.544198, 124.126789, 148.544198, 172.050008),\n (148.544198, 172.050008, 76.279027, 172.050008),\n (76.279027, 172.050008, 76.279027, 124.126789),\n (76.279027, 124.126789, 148.544198, 124.126789),\n (148.544198, 110.126789, 148.544198, 61.950008),\n (76.279027, 110.126789, 76.279027, 61.950008),\n (76.279027, 61.950008, 148.544198, 61.950008),\n (76.279027, 110.126789, 148.544198, 110.126789),\n (210.720979, 172.050008, 162.544198, 172.050008),\n (162.544198, 172.050008, 162.544198, 124.126789),\n (210.720979, 124.126789, 162.544198, 124.126789),\n (210.720979, 172.050008, 210.720979, 124.126789)\n]\nVISIBLE_CIRCLES = [\n\n]\nVISIBLE_ARCS = [\n\n]\nHIDDEN_SEGMENTS = [\n\n]\n# (orient, text, p1, p2, base) for linear; (orient, text, center, radius, angle) for diameter\nDIMENSIONS = [\n ('horizontal', '100', (148.5442, 124.1268), (76.279, 124.1268), (112.4116, 113.1268)),\n ('vertical', '66.3158', (148.5442, 172.05), (148.5442, 124.1268), (159.5442, 148.0884)),\n ('horizontal', '66.6667', (210.721, 172.05), (162.5442, 172.05), (186.6326, 161.05))\n]\n\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\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\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,\n angle=(0 if d[0] == \"horizontal\" else 90),\n 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,\n text=text, dimstyle=\"EZDXF\").render()\n\n doc.saveas(out_path)\n\n\nif __name__ == \"__main__\":\n out = sys.argv[1] if len(sys.argv) > 1 else \"0010_00101521_gt.dxf\"\n draw(out)\n print(\"wrote\", out)\n```"}], "images": ["images/0010_00101521.png"], "id": "0010_00101521"} {"messages": [{"role": "user", "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 82.11 mm tall. It is extruded to a thickness of 36.03 mm."}, {"role": "assistant", "content": "```python\n#!/usr/bin/env python3\n# -*- coding: utf-8 -*-\n# Ground-truth 2D engineering drawing for part: 0010_00103543\n# Self-contained: reproduces the three-view DXF via ezdxf, NO FreeCAD needed.\n# Coordinates are A4 page millimetres (scale=0.8068959537572773, page=[297.0, 210.0]).\n# visible edges -> solid (layer OUTLINE); hidden edges -> dashed (layer HIDDEN)\n# dimensions -> real movable DIMENSION entities (text = true mm value)\n# Run: python 0010_00103543_gt.py [out.dxf]\nimport sys\nimport ezdxf\n\nSCALE = 0.8068959537572773\nPAGE = [297.0, 210.0]\n\nVISIBLE_SEGMENTS = [\n (162.308802, 105.410797, 162.308802, 171.661202),\n (162.308802, 171.661202, 81.619206, 171.661202),\n (81.619206, 171.661202, 81.619206, 105.410797),\n (81.619206, 105.410797, 162.308802, 105.410797),\n (162.308802, 91.410797, 162.308802, 62.338811),\n (81.619206, 91.410797, 81.619206, 62.338811),\n (81.619206, 62.338811, 162.308802, 62.338811),\n (81.619206, 91.410797, 162.308802, 91.410797),\n (205.380788, 171.661202, 176.308802, 171.661202),\n (176.308802, 171.661202, 176.308802, 105.410797),\n (205.380788, 105.410797, 176.308802, 105.410797),\n (205.380788, 171.661202, 205.380788, 105.410797)\n]\nVISIBLE_CIRCLES = [\n\n]\nVISIBLE_ARCS = [\n\n]\nHIDDEN_SEGMENTS = [\n\n]\n# (orient, text, p1, p2, base) for linear; (orient, text, center, radius, angle) for diameter\nDIMENSIONS = [\n ('horizontal', '100', (162.3088, 105.4108), (81.6192, 105.4108), (121.964, 94.4108)),\n ('vertical', '82.1053', (162.3088, 171.6612), (162.3088, 105.4108), (173.3088, 138.536)),\n ('horizontal', '36.0294', (205.3808, 171.6612), (176.3088, 171.6612), (190.8448, 160.6612))\n]\n\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\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\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,\n angle=(0 if d[0] == \"horizontal\" else 90),\n 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,\n text=text, dimstyle=\"EZDXF\").render()\n\n doc.saveas(out_path)\n\n\nif __name__ == \"__main__\":\n out = sys.argv[1] if len(sys.argv) > 1 else \"0010_00103543_gt.dxf\"\n draw(out)\n print(\"wrote\", out)\n```"}], "images": ["images/0010_00103543.png"], "id": "0010_00103543"} {"messages": [{"role": "user", "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 -3.78 mm."}, {"role": "assistant", "content": "```python\n#!/usr/bin/env python3\n# -*- coding: utf-8 -*-\n# Ground-truth 2D engineering drawing for part: 0011_00111200\n# Self-contained: reproduces the three-view DXF via ezdxf, NO FreeCAD needed.\n# Coordinates are A4 page millimetres (scale=1.415828124999997, page=[297.0, 210.0]).\n# visible edges -> solid (layer OUTLINE); hidden edges -> dashed (layer HIDDEN)\n# dimensions -> real movable DIMENSION entities (text = true mm value)\n# Run: python 0011_00111200_gt.py [out.dxf]\nimport sys\nimport ezdxf\n\nSCALE = 1.415828124999997\nPAGE = [297.0, 210.0]\n\nVISIBLE_SEGMENTS = [\n (204.612845, 148.28861, 204.612845, 105.068593),\n (204.612845, 105.068593, 63.030033, 105.068593),\n (63.030033, 105.068593, 63.030033, 148.28861),\n (63.030033, 148.28861, 204.612845, 148.28861),\n (204.612845, 91.068593, 204.612845, 85.711406),\n (204.612845, 85.711406, 63.030033, 85.711406),\n (63.030033, 91.068593, 63.030033, 85.711406),\n (204.612845, 91.068593, 63.030033, 91.068593),\n (223.970033, 105.068593, 218.612845, 105.068593),\n (218.612845, 105.068593, 218.612845, 148.28861),\n (223.970033, 148.28861, 218.612845, 148.28861),\n (223.970033, 105.068593, 223.970033, 148.28861)\n]\nVISIBLE_CIRCLES = [\n\n]\nVISIBLE_ARCS = [\n\n]\nHIDDEN_SEGMENTS = [\n\n]\n# (orient, text, p1, p2, base) for linear; (orient, text, center, radius, angle) for diameter\nDIMENSIONS = [\n ('horizontal', '100', (204.6129, 148.2886), (63.03, 148.2886), (133.8214, 137.2886)),\n ('vertical', '30.5263', (204.6129, 105.0686), (204.6129, 148.2886), (193.6129, 126.6786)),\n ('horizontal', '3.7838', (223.97, 105.0686), (218.6128, 105.0686), (221.2914, 94.0686))\n]\n\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\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\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,\n angle=(0 if d[0] == \"horizontal\" else 90),\n 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,\n text=text, dimstyle=\"EZDXF\").render()\n\n doc.saveas(out_path)\n\n\nif __name__ == \"__main__\":\n out = sys.argv[1] if len(sys.argv) > 1 else \"0011_00111200_gt.dxf\"\n draw(out)\n print(\"wrote\", out)\n```"}], "images": ["images/0011_00111200.png"], "id": "0011_00111200"} {"messages": [{"role": "user", "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. It is extruded to a thickness of 2.08 mm."}, {"role": "assistant", "content": "```python\n#!/usr/bin/env python3\n# -*- coding: utf-8 -*-\n# Ground-truth 2D engineering drawing for part: 0011_00113941\n# Self-contained: reproduces the three-view DXF via ezdxf, NO FreeCAD needed.\n# Coordinates are A4 page millimetres (scale=0.9413877551020439, page=[297.0, 210.0]).\n# visible edges -> solid (layer OUTLINE); hidden edges -> dashed (layer HIDDEN)\n# dimensions -> real movable DIMENSION entities (text = true mm value)\n# Run: python 0011_00113941_gt.py [out.dxf]\nimport sys\nimport ezdxf\n\nSCALE = 0.9413877551020439\nPAGE = [297.0, 210.0]\n\nVISIBLE_SEGMENTS = [\n (151.374296, 172.049985, 151.374296, 77.91121),\n (151.374296, 77.91121, 119.664392, 77.91121),\n (119.664392, 77.91121, 119.664392, 172.049985),\n (119.664392, 172.049985, 151.374296, 172.049985),\n (151.374296, 61.949985, 151.374296, 63.91121),\n (151.374296, 63.91121, 119.664392, 63.91121),\n (119.664392, 61.949985, 119.664392, 63.91121),\n (151.374296, 61.949985, 119.664392, 61.949985),\n (165.374296, 77.91121, 167.33552, 77.91121),\n (167.33552, 77.91121, 167.33552, 172.049985),\n (165.374296, 172.049985, 167.33552, 172.049985),\n (165.374296, 77.91121, 165.374296, 172.049985)\n]\nVISIBLE_CIRCLES = [\n\n]\nVISIBLE_ARCS = [\n\n]\nHIDDEN_SEGMENTS = [\n\n]\n# (orient, text, p1, p2, base) for linear; (orient, text, center, radius, angle) for diameter\nDIMENSIONS = [\n ('horizontal', '33.6842', (151.3743, 172.05), (119.6644, 172.05), (135.5194, 161.05)),\n ('vertical', '100', (151.3743, 77.9112), (151.3743, 172.05), (140.3743, 124.9806)),\n ('horizontal', '2.0833', (165.3743, 77.9112), (167.3355, 77.9112), (166.3549, 88.9112))\n]\n\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\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\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,\n angle=(0 if d[0] == \"horizontal\" else 90),\n 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,\n text=text, dimstyle=\"EZDXF\").render()\n\n doc.saveas(out_path)\n\n\nif __name__ == \"__main__\":\n out = sys.argv[1] if len(sys.argv) > 1 else \"0011_00113941_gt.dxf\"\n draw(out)\n print(\"wrote\", out)\n```"}], "images": ["images/0011_00113941.png"], "id": "0011_00113941"} {"messages": [{"role": "user", "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 78.95 mm tall. It is extruded to a thickness of -31.64 mm."}, {"role": "assistant", "content": "```python\n#!/usr/bin/env python3\n# -*- coding: utf-8 -*-\n# Ground-truth 2D engineering drawing for part: 0011_00116176\n# Self-contained: reproduces the three-view DXF via ezdxf, NO FreeCAD needed.\n# Coordinates are A4 page millimetres (scale=0.8211352941176727, page=[297.0, 210.0]).\n# visible edges -> solid (layer OUTLINE); hidden edges -> dashed (layer HIDDEN)\n# dimensions -> real movable DIMENSION entities (text = true mm value)\n# Run: python 0011_00116176_gt.py [out.dxf]\nimport sys\nimport ezdxf\n\nSCALE = 0.8211352941176727\nPAGE = [297.0, 210.0]\n\nVISIBLE_SEGMENTS = [\n (164.567042, 104.576518, 164.567042, 169.402988),\n (164.567042, 169.402988, 82.453512, 169.402988),\n (82.453512, 169.402988, 82.453512, 104.576518),\n (82.453512, 104.576518, 164.567042, 104.576518),\n (164.567042, 64.597096, 164.567042, 90.576518),\n (82.453512, 64.597096, 82.453512, 90.576518),\n (82.453512, 90.576518, 164.567042, 90.576518),\n (82.453512, 64.597096, 164.567042, 64.597096),\n (178.567042, 169.402988, 204.546463, 169.402988),\n (204.546463, 169.402988, 204.546463, 104.576518),\n (178.567042, 104.576518, 204.546463, 104.576518),\n (178.567042, 169.402988, 178.567042, 104.576518)\n]\nVISIBLE_CIRCLES = [\n\n]\nVISIBLE_ARCS = [\n\n]\nHIDDEN_SEGMENTS = [\n\n]\n# (orient, text, p1, p2, base) for linear; (orient, text, center, radius, angle) for diameter\nDIMENSIONS = [\n ('horizontal', '100', (164.567, 104.5765), (82.4535, 104.5765), (123.5103, 93.5765)),\n ('vertical', '78.9474', (164.567, 169.403), (164.567, 104.5765), (175.567, 136.9897)),\n ('horizontal', '31.6384', (178.5671, 169.403), (204.5465, 169.403), (191.5568, 180.403))\n]\n\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\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\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,\n angle=(0 if d[0] == \"horizontal\" else 90),\n 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,\n text=text, dimstyle=\"EZDXF\").render()\n\n doc.saveas(out_path)\n\n\nif __name__ == \"__main__\":\n out = sys.argv[1] if len(sys.argv) > 1 else \"0011_00116176_gt.dxf\"\n draw(out)\n print(\"wrote\", out)\n```"}], "images": ["images/0011_00116176.png"], "id": "0011_00116176"} {"messages": [{"role": "user", "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 16.09 mm."}, {"role": "assistant", "content": "```python\n#!/usr/bin/env python3\n# -*- coding: utf-8 -*-\n# Ground-truth 2D engineering drawing for part: 0011_00116571\n# Self-contained: reproduces the three-view DXF via ezdxf, NO FreeCAD needed.\n# Coordinates are A4 page millimetres (scale=1.26572079207929, page=[297.0, 210.0]).\n# visible edges -> solid (layer OUTLINE); hidden edges -> dashed (layer HIDDEN)\n# dimensions -> real movable DIMENSION entities (text = true mm value)\n# Run: python 0011_00116571_gt.py [out.dxf]\nimport sys\nimport ezdxf\n\nSCALE = 1.26572079207929\nPAGE = [297.0, 210.0]\n\nVISIBLE_SEGMENTS = [\n (189.602112, 144.176479, 189.602112, 124.191414),\n (189.602112, 124.191414, 63.030032, 124.191414),\n (63.030032, 124.191414, 63.030032, 144.176479),\n (63.030032, 144.176479, 189.602112, 144.176479),\n (189.602112, 89.823493, 189.602112, 110.191414),\n (189.602112, 110.191414, 63.030032, 110.191414),\n (63.030032, 89.823493, 63.030032, 110.191414),\n (189.602112, 89.823493, 63.030032, 89.823493),\n (203.602112, 124.191414, 223.970032, 124.191414),\n (223.970032, 124.191414, 223.970032, 144.176479),\n (203.602112, 144.176479, 223.970032, 144.176479),\n (203.602112, 124.191414, 203.602112, 144.176479)\n]\nVISIBLE_CIRCLES = [\n\n]\nVISIBLE_ARCS = [\n\n]\nHIDDEN_SEGMENTS = [\n\n]\n# (orient, text, p1, p2, base) for linear; (orient, text, center, radius, angle) for diameter\nDIMENSIONS = [\n ('horizontal', '100', (189.6021, 144.1765), (63.03, 144.1765), (126.3161, 133.1765)),\n ('vertical', '15.7895', (189.6021, 124.1914), (189.6021, 144.1765), (178.6021, 134.1839)),\n ('horizontal', '16.092', (203.6021, 124.1914), (223.9701, 124.1914), (213.7861, 135.1914))\n]\n\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\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\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,\n angle=(0 if d[0] == \"horizontal\" else 90),\n 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,\n text=text, dimstyle=\"EZDXF\").render()\n\n doc.saveas(out_path)\n\n\nif __name__ == \"__main__\":\n out = sys.argv[1] if len(sys.argv) > 1 else \"0011_00116571_gt.dxf\"\n draw(out)\n print(\"wrote\", out)\n```"}], "images": ["images/0011_00116571.png"], "id": "0011_00116571"} {"messages": [{"role": "user", "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 369.23 mm."}, {"role": "assistant", "content": "```python\n#!/usr/bin/env python3\n# -*- coding: utf-8 -*-\n# Ground-truth 2D engineering drawing for part: 0011_00118906\n# Self-contained: reproduces the three-view DXF via ezdxf, NO FreeCAD needed.\n# Coordinates are A4 page millimetres (scale=0.251661365564043, page=[297.0, 210.0]).\n# visible edges -> solid (layer OUTLINE); hidden edges -> dashed (layer HIDDEN)\n# dimensions -> real movable DIMENSION entities (text = true mm value)\n# Run: python 0011_00118906_gt.py [out.dxf]\nimport sys\nimport ezdxf\n\nSCALE = 0.251661365564043\nPAGE = [297.0, 210.0]\n\nVISIBLE_SEGMENTS = [\n (102.622503, 172.049988, 102.622503, 168.871108),\n (102.622503, 168.871108, 77.456367, 168.871108),\n (77.456367, 168.871108, 77.456367, 172.049988),\n (77.456367, 172.049988, 102.622503, 172.049988),\n (102.622503, 61.949988, 102.622503, 154.871108),\n (102.622503, 154.871108, 77.456367, 154.871108),\n (77.456367, 61.949988, 77.456367, 154.871108),\n (102.622503, 61.949988, 77.456367, 61.949988),\n (116.622503, 168.871108, 209.543623, 168.871108),\n (209.543623, 168.871108, 209.543623, 172.049988),\n (116.622503, 172.049988, 209.543623, 172.049988),\n (116.622503, 168.871108, 116.622503, 172.049988)\n]\nVISIBLE_CIRCLES = [\n\n]\nVISIBLE_ARCS = [\n\n]\nHIDDEN_SEGMENTS = [\n\n]\n# (orient, text, p1, p2, base) for linear; (orient, text, center, radius, angle) for diameter\nDIMENSIONS = [\n ('horizontal', '100', (102.6225, 172.05), (77.4564, 172.05), (90.0394, 161.05)),\n ('vertical', '12.6316', (102.6225, 168.8711), (102.6225, 172.05), (91.6225, 170.4606)),\n ('horizontal', '369.231', (116.6225, 168.8711), (209.5436, 168.8711), (163.0831, 179.8711))\n]\n\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\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\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,\n angle=(0 if d[0] == \"horizontal\" else 90),\n 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,\n text=text, dimstyle=\"EZDXF\").render()\n\n doc.saveas(out_path)\n\n\nif __name__ == \"__main__\":\n out = sys.argv[1] if len(sys.argv) > 1 else \"0011_00118906_gt.dxf\"\n draw(out)\n print(\"wrote\", out)\n```"}], "images": ["images/0011_00118906.png"], "id": "0011_00118906"} {"messages": [{"role": "user", "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 200 mm."}, {"role": "assistant", "content": "```python\n#!/usr/bin/env python3\n# -*- coding: utf-8 -*-\n# Ground-truth 2D engineering drawing for part: 0012_00121861\n# Self-contained: reproduces the three-view DXF via ezdxf, NO FreeCAD needed.\n# Coordinates are A4 page millimetres (scale=0.32033333333333336, page=[297.0, 210.0]).\n# visible edges -> solid (layer OUTLINE); hidden edges -> dashed (layer HIDDEN)\n# dimensions -> real movable DIMENSION entities (text = true mm value)\n# Run: python 0012_00121861_gt.py [out.dxf]\nimport sys\nimport ezdxf\n\nSCALE = 0.32033333333333336\nPAGE = [297.0, 210.0]\n\nVISIBLE_SEGMENTS = [\n (120.483313, 172.05002, 120.483313, 140.016687),\n (120.483313, 140.016687, 88.44998, 140.016687),\n (88.44998, 140.016687, 88.44998, 172.05002),\n (88.44998, 172.05002, 120.483313, 172.05002),\n (120.483313, 61.95002, 120.483313, 126.016687),\n (120.483313, 126.016687, 88.44998, 126.016687),\n (88.44998, 61.95002, 88.44998, 126.016687),\n (120.483313, 61.95002, 88.44998, 61.95002),\n (134.483313, 140.016687, 198.54998, 140.016687),\n (198.54998, 140.016687, 198.54998, 172.05002),\n (134.483313, 172.05002, 198.54998, 172.05002),\n (134.483313, 140.016687, 134.483313, 172.05002)\n]\nVISIBLE_CIRCLES = [\n\n]\nVISIBLE_ARCS = [\n\n]\nHIDDEN_SEGMENTS = [\n\n]\n# (orient, text, p1, p2, base) for linear; (orient, text, center, radius, angle) for diameter\nDIMENSIONS = [\n ('horizontal', '100', (120.4833, 172.05), (88.45, 172.05), (104.4667, 161.05)),\n ('vertical', '100', (120.4833, 140.0167), (120.4833, 172.05), (109.4833, 156.0333)),\n ('horizontal', '200', (134.4833, 140.0167), (198.55, 140.0167), (166.5167, 151.0167))\n]\n\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\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\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,\n angle=(0 if d[0] == \"horizontal\" else 90),\n 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,\n text=text, dimstyle=\"EZDXF\").render()\n\n doc.saveas(out_path)\n\n\nif __name__ == \"__main__\":\n out = sys.argv[1] if len(sys.argv) > 1 else \"0012_00121861_gt.dxf\"\n draw(out)\n print(\"wrote\", out)\n```"}], "images": ["images/0012_00121861.png"], "id": "0012_00121861"} {"messages": [{"role": "user", "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 0.52 mm."}, {"role": "assistant", "content": "```python\n#!/usr/bin/env python3\n# -*- coding: utf-8 -*-\n# Ground-truth 2D engineering drawing for part: 0012_00126167\n# Self-contained: reproduces the three-view DXF via ezdxf, NO FreeCAD needed.\n# Coordinates are A4 page millimetres (scale=0.7346999999999999, page=[297.0, 210.0]).\n# visible edges -> solid (layer OUTLINE); hidden edges -> dashed (layer HIDDEN)\n# dimensions -> real movable DIMENSION entities (text = true mm value)\n# Run: python 0012_00126167_gt.py [out.dxf]\nimport sys\nimport ezdxf\n\nSCALE = 0.7346999999999999\nPAGE = [297.0, 210.0]\n\nVISIBLE_SEGMENTS = [\n (173.043689, 87.4563, 173.043689, 160.9263),\n (173.043689, 160.9263, 99.573689, 160.9263),\n (99.573689, 160.9263, 99.573689, 87.4563),\n (99.573689, 87.4563, 173.043689, 87.4563),\n (173.043689, 73.4563, 173.043689, 73.073644),\n (99.573689, 73.4563, 99.573689, 73.073644),\n (99.573689, 73.073644, 173.043689, 73.073644),\n (99.573689, 73.4563, 173.043689, 73.4563),\n (187.426345, 160.9263, 187.043689, 160.9263),\n (187.043689, 160.9263, 187.043689, 87.4563),\n (187.426345, 87.4563, 187.043689, 87.4563),\n (187.426345, 160.9263, 187.426345, 87.4563)\n]\nVISIBLE_CIRCLES = [\n\n]\nVISIBLE_ARCS = [\n\n]\nHIDDEN_SEGMENTS = [\n\n]\n# (orient, text, p1, p2, base) for linear; (orient, text, center, radius, angle) for diameter\nDIMENSIONS = [\n ('horizontal', '100', (173.0437, 87.4563), (99.5737, 87.4563), (136.3087, 76.4563)),\n ('vertical', '100', (173.0437, 160.9263), (173.0437, 87.4563), (184.0437, 124.1913)),\n ('vertical', '0.5208', (187.4263, 160.9263), (187.0437, 160.9263), (187.235, 149.9263))\n]\n\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\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\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,\n angle=(0 if d[0] == \"horizontal\" else 90),\n 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,\n text=text, dimstyle=\"EZDXF\").render()\n\n doc.saveas(out_path)\n\n\nif __name__ == \"__main__\":\n out = sys.argv[1] if len(sys.argv) > 1 else \"0012_00126167_gt.dxf\"\n draw(out)\n print(\"wrote\", out)\n```"}], "images": ["images/0012_00126167.png"], "id": "0012_00126167"} {"messages": [{"role": "user", "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": "assistant", "content": "```python\n#!/usr/bin/env python3\n# -*- coding: utf-8 -*-\n# Ground-truth 2D engineering drawing for part: 0012_00129654\n# Self-contained: reproduces the three-view DXF via ezdxf, NO FreeCAD needed.\n# Coordinates are A4 page millimetres (scale=0.4805, page=[297.0, 210.0]).\n# visible edges -> solid (layer OUTLINE); hidden edges -> dashed (layer HIDDEN)\n# dimensions -> real movable DIMENSION entities (text = true mm value)\n# Run: python 0012_00129654_gt.py [out.dxf]\nimport sys\nimport ezdxf\n\nSCALE = 0.4805\nPAGE = [297.0, 210.0]\n\nVISIBLE_SEGMENTS = [\n (136.5, 172.05, 136.5, 124.0),\n (136.5, 124.0, 88.45, 124.0),\n (88.45, 124.0, 88.45, 172.05),\n (88.45, 172.05, 136.5, 172.05),\n (136.5, 61.95, 136.5, 110.0),\n (136.5, 110.0, 88.45, 110.0),\n (88.45, 61.95, 88.45, 110.0),\n (136.5, 61.95, 88.45, 61.95),\n (150.5, 124.0, 198.55, 124.0),\n (198.55, 124.0, 198.55, 172.05),\n (150.5, 172.05, 198.55, 172.05),\n (150.5, 124.0, 150.5, 172.05)\n]\nVISIBLE_CIRCLES = [\n\n]\nVISIBLE_ARCS = [\n\n]\nHIDDEN_SEGMENTS = [\n\n]\n# (orient, text, p1, p2, base) for linear; (orient, text, center, radius, angle) for diameter\nDIMENSIONS = [\n ('horizontal', '100', (136.5, 172.05), (88.45, 172.05), (112.475, 161.05)),\n ('vertical', '100', (136.5, 124.0), (136.5, 172.05), (125.5, 148.025)),\n ('horizontal', '100', (150.5, 124.0), (198.55, 124.0), (174.525, 135.0))\n]\n\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\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\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,\n angle=(0 if d[0] == \"horizontal\" else 90),\n 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,\n text=text, dimstyle=\"EZDXF\").render()\n\n doc.saveas(out_path)\n\n\nif __name__ == \"__main__\":\n out = sys.argv[1] if len(sys.argv) > 1 else \"0012_00129654_gt.dxf\"\n draw(out)\n print(\"wrote\", out)\n```"}], "images": ["images/0012_00129654.png"], "id": "0012_00129654"} {"messages": [{"role": "user", "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 23.16 mm tall. It is extruded to a thickness of 1.04 mm."}, {"role": "assistant", "content": "```python\n#!/usr/bin/env python3\n# -*- coding: utf-8 -*-\n# Ground-truth 2D engineering drawing for part: 0013_00131273\n# Self-contained: reproduces the three-view DXF via ezdxf, NO FreeCAD needed.\n# Coordinates are A4 page millimetres (scale=1.4542515463917478, page=[297.0, 210.0]).\n# visible edges -> solid (layer OUTLINE); hidden edges -> dashed (layer HIDDEN)\n# dimensions -> real movable DIMENSION entities (text = true mm value)\n# Run: python 0013_00131273_gt.py [out.dxf]\nimport sys\nimport ezdxf\n\nSCALE = 1.4542515463917478\nPAGE = [297.0, 210.0]\n\nVISIBLE_SEGMENTS = [\n (208.455182, 141.596103, 208.455182, 107.918698),\n (208.455182, 107.918698, 63.030027, 107.918698),\n (63.030027, 107.918698, 63.030027, 141.596103),\n (63.030027, 141.596103, 208.455182, 141.596103),\n (208.455182, 92.403853, 208.455182, 93.918698),\n (208.455182, 93.918698, 63.030027, 93.918698),\n (63.030027, 92.403853, 63.030027, 93.918698),\n (208.455182, 92.403853, 63.030027, 92.403853),\n (222.455182, 107.918698, 223.970027, 107.918698),\n (223.970027, 107.918698, 223.970027, 141.596103),\n (222.455182, 141.596103, 223.970027, 141.596103),\n (222.455182, 107.918698, 222.455182, 141.596103)\n]\nVISIBLE_CIRCLES = [\n\n]\nVISIBLE_ARCS = [\n\n]\nHIDDEN_SEGMENTS = [\n\n]\n# (orient, text, p1, p2, base) for linear; (orient, text, center, radius, angle) for diameter\nDIMENSIONS = [\n ('horizontal', '100', (208.4552, 141.5961), (63.03, 141.5961), (135.7426, 130.5961)),\n ('vertical', '23.1579', (208.4552, 107.9187), (208.4552, 141.5961), (197.4552, 124.7574)),\n ('horizontal', '1.0417', (222.4552, 107.9187), (223.97, 107.9187), (223.2126, 118.9187))\n]\n\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\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\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,\n angle=(0 if d[0] == \"horizontal\" else 90),\n 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,\n text=text, dimstyle=\"EZDXF\").render()\n\n doc.saveas(out_path)\n\n\nif __name__ == \"__main__\":\n out = sys.argv[1] if len(sys.argv) > 1 else \"0013_00131273_gt.dxf\"\n draw(out)\n print(\"wrote\", out)\n```"}], "images": ["images/0013_00131273.png"], "id": "0013_00131273"} {"messages": [{"role": "user", "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": "assistant", "content": "```python\n#!/usr/bin/env python3\n# -*- coding: utf-8 -*-\n# Ground-truth 2D engineering drawing for part: 0013_00131352\n# Self-contained: reproduces the three-view DXF via ezdxf, NO FreeCAD needed.\n# Coordinates are A4 page millimetres (scale=0.48049999999999987, page=[297.0, 210.0]).\n# visible edges -> solid (layer OUTLINE); hidden edges -> dashed (layer HIDDEN)\n# dimensions -> real movable DIMENSION entities (text = true mm value)\n# Run: python 0013_00131352_gt.py [out.dxf]\nimport sys\nimport ezdxf\n\nSCALE = 0.48049999999999987\nPAGE = [297.0, 210.0]\n\nVISIBLE_SEGMENTS = [\n (136.5, 124.0, 136.5, 172.05),\n (88.45, 124.0, 136.5, 124.0),\n (136.5, 172.05, 88.45, 172.05),\n (88.45, 172.05, 88.45, 124.0),\n (136.5, 61.95, 136.5, 110.0),\n (88.45, 61.95, 88.45, 110.0),\n (88.45, 61.95, 136.5, 61.95),\n (88.45, 110.0, 136.5, 110.0),\n (150.5, 124.0, 198.55, 124.0),\n (198.55, 172.05, 150.5, 172.05),\n (150.5, 172.05, 150.5, 124.0),\n (198.55, 172.05, 198.55, 124.0)\n]\nVISIBLE_CIRCLES = [\n\n]\nVISIBLE_ARCS = [\n\n]\nHIDDEN_SEGMENTS = [\n\n]\n# (orient, text, p1, p2, base) for linear; (orient, text, center, radius, angle) for diameter\nDIMENSIONS = [\n ('horizontal', '100', (136.5, 124.0), (88.45, 124.0), (112.475, 113.0)),\n ('vertical', '100', (136.5, 172.05), (136.5, 124.0), (147.5, 148.025)),\n ('horizontal', '100', (198.55, 172.05), (150.5, 172.05), (174.525, 161.05))\n]\n\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\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\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,\n angle=(0 if d[0] == \"horizontal\" else 90),\n 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,\n text=text, dimstyle=\"EZDXF\").render()\n\n doc.saveas(out_path)\n\n\nif __name__ == \"__main__\":\n out = sys.argv[1] if len(sys.argv) > 1 else \"0013_00131352_gt.dxf\"\n draw(out)\n print(\"wrote\", out)\n```"}], "images": ["images/0013_00131352.png"], "id": "0013_00131352"} {"messages": [{"role": "user", "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 43.75 mm."}, {"role": "assistant", "content": "```python\n#!/usr/bin/env python3\n# -*- coding: utf-8 -*-\n# Ground-truth 2D engineering drawing for part: 0013_00133448\n# Self-contained: reproduces the three-view DXF via ezdxf, NO FreeCAD needed.\n# Coordinates are A4 page millimetres (scale=0.8648431024275228, page=[297.0, 210.0]).\n# visible edges -> solid (layer OUTLINE); hidden edges -> dashed (layer HIDDEN)\n# dimensions -> real movable DIMENSION entities (text = true mm value)\n# Run: python 0013_00133448_gt.py [out.dxf]\nimport sys\nimport ezdxf\n\nSCALE = 0.8648431024275228\nPAGE = [297.0, 210.0]\n\nVISIBLE_SEGMENTS = [\n (160.823705, 113.786851, 160.823705, 172.049966),\n (160.823705, 172.049966, 74.339395, 172.049966),\n (74.339395, 172.049966, 74.339395, 113.786851),\n (74.339395, 113.786851, 160.823705, 113.786851),\n (160.823705, 99.786851, 160.823705, 61.949966),\n (74.339395, 99.786851, 74.339395, 61.949966),\n (74.339395, 61.949966, 160.823705, 61.949966),\n (74.339395, 99.786851, 160.823705, 99.786851),\n (212.660591, 172.049966, 174.823705, 172.049966),\n (174.823705, 172.049966, 174.823705, 113.786851),\n (212.660591, 113.786851, 174.823705, 113.786851),\n (212.660591, 172.049966, 212.660591, 113.786851)\n]\nVISIBLE_CIRCLES = [\n\n]\nVISIBLE_ARCS = [\n\n]\nHIDDEN_SEGMENTS = [\n\n]\n# (orient, text, p1, p2, base) for linear; (orient, text, center, radius, angle) for diameter\nDIMENSIONS = [\n ('horizontal', '100', (160.8237, 113.7868), (74.3394, 113.7868), (117.5816, 102.7868)),\n ('vertical', '67.3684', (160.8237, 172.05), (160.8237, 113.7868), (171.8237, 142.9184)),\n ('horizontal', '43.75', (212.6606, 172.05), (174.8237, 172.05), (193.7422, 161.05))\n]\n\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\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\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,\n angle=(0 if d[0] == \"horizontal\" else 90),\n 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,\n text=text, dimstyle=\"EZDXF\").render()\n\n doc.saveas(out_path)\n\n\nif __name__ == \"__main__\":\n out = sys.argv[1] if len(sys.argv) > 1 else \"0013_00133448_gt.dxf\"\n draw(out)\n print(\"wrote\", out)\n```"}], "images": ["images/0013_00133448.png"], "id": "0013_00133448"} {"messages": [{"role": "user", "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 88.42 mm tall. It is extruded to a thickness of 63.64 mm."}, {"role": "assistant", "content": "```python\n#!/usr/bin/env python3\n# -*- coding: utf-8 -*-\n# Ground-truth 2D engineering drawing for part: 0013_00137785\n# Self-contained: reproduces the three-view DXF via ezdxf, NO FreeCAD needed.\n# Coordinates are A4 page millimetres (scale=0.6319981120201574, page=[297.0, 210.0]).\n# visible edges -> solid (layer OUTLINE); hidden edges -> dashed (layer HIDDEN)\n# dimensions -> real movable DIMENSION entities (text = true mm value)\n# Run: python 0013_00137785_gt.py [out.dxf]\nimport sys\nimport ezdxf\n\nSCALE = 0.6319981120201574\nPAGE = [297.0, 210.0]\n\nVISIBLE_SEGMENTS = [\n (147.99089, 116.168077, 147.99089, 172.050015),\n (147.99089, 172.050015, 84.791079, 172.050015),\n (84.791079, 172.050015, 84.791079, 116.168077),\n (84.791079, 116.168077, 147.99089, 116.168077),\n (147.99089, 102.168077, 147.99089, 61.950015),\n (84.791079, 102.168077, 84.791079, 61.950015),\n (84.791079, 61.950015, 147.99089, 61.950015),\n (84.791079, 102.168077, 147.99089, 102.168077),\n (202.208952, 172.050015, 161.99089, 172.050015),\n (161.99089, 172.050015, 161.99089, 116.168077),\n (202.208952, 116.168077, 161.99089, 116.168077),\n (202.208952, 172.050015, 202.208952, 116.168077)\n]\nVISIBLE_CIRCLES = [\n\n]\nVISIBLE_ARCS = [\n\n]\nHIDDEN_SEGMENTS = [\n\n]\n# (orient, text, p1, p2, base) for linear; (orient, text, center, radius, angle) for diameter\nDIMENSIONS = [\n ('horizontal', '100', (147.9909, 116.1681), (84.7911, 116.1681), (116.391, 105.1681)),\n ('vertical', '88.4211', (147.9909, 172.05), (147.9909, 116.1681), (158.9909, 144.109)),\n ('horizontal', '63.6364', (202.2089, 172.05), (161.9909, 172.05), (182.0999, 161.05))\n]\n\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\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\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,\n angle=(0 if d[0] == \"horizontal\" else 90),\n 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,\n text=text, dimstyle=\"EZDXF\").render()\n\n doc.saveas(out_path)\n\n\nif __name__ == \"__main__\":\n out = sys.argv[1] if len(sys.argv) > 1 else \"0013_00137785_gt.dxf\"\n draw(out)\n print(\"wrote\", out)\n```"}], "images": ["images/0013_00137785.png"], "id": "0013_00137785"} {"messages": [{"role": "user", "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 53.68 mm tall. It is extruded to a thickness of 2.08 mm."}, {"role": "assistant", "content": "```python\n#!/usr/bin/env python3\n# -*- coding: utf-8 -*-\n# Ground-truth 2D engineering drawing for part: 0014_00142998\n# Self-contained: reproduces the three-view DXF via ezdxf, NO FreeCAD needed.\n# Coordinates are A4 page millimetres (scale=0.956116438356163, page=[297.0, 210.0]).\n# visible edges -> solid (layer OUTLINE); hidden edges -> dashed (layer HIDDEN)\n# dimensions -> real movable DIMENSION entities (text = true mm value)\n# Run: python 0014_00142998_gt.py [out.dxf]\nimport sys\nimport ezdxf\n\nSCALE = 0.956116438356163\nPAGE = [297.0, 210.0]\n\nVISIBLE_SEGMENTS = [\n (183.309887, 99.331766, 183.309887, 150.660122),\n (183.309887, 150.660122, 87.698243, 150.660122),\n (87.698243, 150.660122, 87.698243, 99.331766),\n (87.698243, 99.331766, 183.309887, 99.331766),\n (183.309887, 85.331766, 183.309887, 83.339857),\n (87.698243, 85.331766, 87.698243, 83.339857),\n (87.698243, 83.339857, 183.309887, 83.339857),\n (87.698243, 85.331766, 183.309887, 85.331766),\n (199.301796, 150.660122, 197.309887, 150.660122),\n (197.309887, 150.660122, 197.309887, 99.331766),\n (199.301796, 99.331766, 197.309887, 99.331766),\n (199.301796, 150.660122, 199.301796, 99.331766)\n]\nVISIBLE_CIRCLES = [\n\n]\nVISIBLE_ARCS = [\n\n]\nHIDDEN_SEGMENTS = [\n\n]\n# (orient, text, p1, p2, base) for linear; (orient, text, center, radius, angle) for diameter\nDIMENSIONS = [\n ('horizontal', '100', (183.3099, 99.3318), (87.6982, 99.3318), (135.504, 88.3318)),\n ('vertical', '53.6842', (183.3099, 150.6601), (183.3099, 99.3318), (194.3099, 124.996)),\n ('horizontal', '2.0833', (199.3018, 150.6601), (197.3099, 150.6601), (198.3058, 139.6601))\n]\n\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\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\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,\n angle=(0 if d[0] == \"horizontal\" else 90),\n 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,\n text=text, dimstyle=\"EZDXF\").render()\n\n doc.saveas(out_path)\n\n\nif __name__ == \"__main__\":\n out = sys.argv[1] if len(sys.argv) > 1 else \"0014_00142998_gt.dxf\"\n draw(out)\n print(\"wrote\", out)\n```"}], "images": ["images/0014_00142998.png"], "id": "0014_00142998"} {"messages": [{"role": "user", "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 4800 mm."}, {"role": "assistant", "content": "```python\n#!/usr/bin/env python3\n# -*- coding: utf-8 -*-\n# Ground-truth 2D engineering drawing for part: 0014_00146324\n# Self-contained: reproduces the three-view DXF via ezdxf, NO FreeCAD needed.\n# Coordinates are A4 page millimetres (scale=0.019612244897959184, page=[297.0, 210.0]).\n# visible edges -> solid (layer OUTLINE); hidden edges -> dashed (layer HIDDEN)\n# dimensions -> real movable DIMENSION entities (text = true mm value)\n# Run: python 0014_00146324_gt.py [out.dxf]\nimport sys\nimport ezdxf\n\nSCALE = 0.019612244897959184\nPAGE = [297.0, 210.0]\n\nVISIBLE_SEGMENTS = [\n (90.41121, 170.088785, 90.41121, 172.05001),\n (90.41121, 172.05001, 88.449985, 172.05001),\n (88.449985, 172.05001, 88.449985, 170.088785),\n (88.449985, 170.088785, 90.41121, 170.088785),\n (90.41121, 156.088785, 90.41121, 61.95001),\n (88.449985, 156.088785, 88.449985, 61.95001),\n (88.449985, 61.95001, 90.41121, 61.95001),\n (88.449985, 156.088785, 90.41121, 156.088785),\n (198.549985, 172.05001, 104.41121, 172.05001),\n (104.41121, 172.05001, 104.41121, 170.088785),\n (198.549985, 170.088785, 104.41121, 170.088785),\n (198.549985, 172.05001, 198.549985, 170.088785)\n]\nVISIBLE_CIRCLES = [\n\n]\nVISIBLE_ARCS = [\n\n]\nHIDDEN_SEGMENTS = [\n\n]\n# (orient, text, p1, p2, base) for linear; (orient, text, center, radius, angle) for diameter\nDIMENSIONS = [\n ('horizontal', '100', (90.4112, 170.0888), (88.45, 170.0888), (89.4306, 159.0888)),\n ('vertical', '100', (90.4112, 172.05), (90.4112, 170.0888), (101.4112, 171.0694)),\n ('horizontal', '4800', (198.55, 172.05), (104.4112, 172.05), (151.4806, 161.05))\n]\n\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\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\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,\n angle=(0 if d[0] == \"horizontal\" else 90),\n 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,\n text=text, dimstyle=\"EZDXF\").render()\n\n doc.saveas(out_path)\n\n\nif __name__ == \"__main__\":\n out = sys.argv[1] if len(sys.argv) > 1 else \"0014_00146324_gt.dxf\"\n draw(out)\n print(\"wrote\", out)\n```"}], "images": ["images/0014_00146324.png"], "id": "0014_00146324"} {"messages": [{"role": "user", "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": "assistant", "content": "```python\n#!/usr/bin/env python3\n# -*- coding: utf-8 -*-\n# Ground-truth 2D engineering drawing for part: 0015_00153334\n# Self-contained: reproduces the three-view DXF via ezdxf, NO FreeCAD needed.\n# Coordinates are A4 page millimetres (scale=0.6406666666666666, page=[297.0, 210.0]).\n# visible edges -> solid (layer OUTLINE); hidden edges -> dashed (layer HIDDEN)\n# dimensions -> real movable DIMENSION entities (text = true mm value)\n# Run: python 0015_00153334_gt.py [out.dxf]\nimport sys\nimport ezdxf\n\nSCALE = 0.6406666666666666\nPAGE = [297.0, 210.0]\n\nVISIBLE_SEGMENTS = [\n (152.516687, 107.98332, 152.516687, 172.049987),\n (152.516687, 172.049987, 88.45002, 172.049987),\n (88.45002, 172.049987, 88.45002, 107.98332),\n (88.45002, 107.98332, 152.516687, 107.98332),\n (152.516687, 93.98332, 152.516687, 61.949987),\n (88.45002, 93.98332, 88.45002, 61.949987),\n (88.45002, 61.949987, 152.516687, 61.949987),\n (88.45002, 93.98332, 152.516687, 93.98332),\n (198.55002, 172.049987, 166.516687, 172.049987),\n (166.516687, 172.049987, 166.516687, 107.98332),\n (198.55002, 107.98332, 166.516687, 107.98332),\n (198.55002, 172.049987, 198.55002, 107.98332)\n]\nVISIBLE_CIRCLES = [\n\n]\nVISIBLE_ARCS = [\n\n]\nHIDDEN_SEGMENTS = [\n\n]\n# (orient, text, p1, p2, base) for linear; (orient, text, center, radius, angle) for diameter\nDIMENSIONS = [\n ('horizontal', '100', (152.5167, 107.9833), (88.45, 107.9833), (120.4833, 96.9833)),\n ('vertical', '100', (152.5167, 172.05), (152.5167, 107.9833), (163.5167, 140.0167)),\n ('horizontal', '50', (198.55, 172.05), (166.5167, 172.05), (182.5333, 161.05))\n]\n\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\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\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,\n angle=(0 if d[0] == \"horizontal\" else 90),\n 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,\n text=text, dimstyle=\"EZDXF\").render()\n\n doc.saveas(out_path)\n\n\nif __name__ == \"__main__\":\n out = sys.argv[1] if len(sys.argv) > 1 else \"0015_00153334_gt.dxf\"\n draw(out)\n print(\"wrote\", out)\n```"}], "images": ["images/0015_00153334.png"], "id": "0015_00153334"} {"messages": [{"role": "user", "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 38.95 mm tall. It is extruded to a thickness of 13.02 mm."}, {"role": "assistant", "content": "```python\n#!/usr/bin/env python3\n# -*- coding: utf-8 -*-\n# Ground-truth 2D engineering drawing for part: 0015_00158791\n# Self-contained: reproduces the three-view DXF via ezdxf, NO FreeCAD needed.\n# Coordinates are A4 page millimetres (scale=1.3001142857142896, page=[297.0, 210.0]).\n# visible edges -> solid (layer OUTLINE); hidden edges -> dashed (layer HIDDEN)\n# dimensions -> real movable DIMENSION entities (text = true mm value)\n# Run: python 0015_00158791_gt.py [out.dxf]\nimport sys\nimport ezdxf\n\nSCALE = 1.3001142857142896\nPAGE = [297.0, 210.0]\n\nVISIBLE_SEGMENTS = [\n (193.041411, 157.782318, 193.041411, 107.146288),\n (193.041411, 107.146288, 63.029983, 107.146288),\n (63.029983, 107.146288, 63.029983, 157.782318),\n (63.029983, 157.782318, 193.041411, 157.782318),\n (193.041411, 76.217717, 193.041411, 93.146288),\n (193.041411, 93.146288, 63.029983, 93.146288),\n (63.029983, 76.217717, 63.029983, 93.146288),\n (193.041411, 76.217717, 63.029983, 76.217717),\n (207.041411, 107.146288, 223.969983, 107.146288),\n (223.969983, 107.146288, 223.969983, 157.782318),\n (207.041411, 157.782318, 223.969983, 157.782318),\n (207.041411, 107.146288, 207.041411, 157.782318)\n]\nVISIBLE_CIRCLES = [\n\n]\nVISIBLE_ARCS = [\n\n]\nHIDDEN_SEGMENTS = [\n\n]\n# (orient, text, p1, p2, base) for linear; (orient, text, center, radius, angle) for diameter\nDIMENSIONS = [\n ('horizontal', '100', (193.0414, 157.7823), (63.03, 157.7823), (128.0357, 146.7823)),\n ('vertical', '38.9474', (193.0414, 107.1463), (193.0414, 157.7823), (182.0414, 132.4643)),\n ('horizontal', '13.0208', (207.0414, 107.1463), (223.97, 107.1463), (215.5057, 118.1463))\n]\n\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\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\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,\n angle=(0 if d[0] == \"horizontal\" else 90),\n 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,\n text=text, dimstyle=\"EZDXF\").render()\n\n doc.saveas(out_path)\n\n\nif __name__ == \"__main__\":\n out = sys.argv[1] if len(sys.argv) > 1 else \"0015_00158791_gt.dxf\"\n draw(out)\n print(\"wrote\", out)\n```"}], "images": ["images/0015_00158791.png"], "id": "0015_00158791"} {"messages": [{"role": "user", "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 82.11 mm tall. It is extruded to a thickness of 64.86 mm."}, {"role": "assistant", "content": "```python\n#!/usr/bin/env python3\n# -*- coding: utf-8 -*-\n# Ground-truth 2D engineering drawing for part: 0016_00160331\n# Self-contained: reproduces the three-view DXF via ezdxf, NO FreeCAD needed.\n# Coordinates are A4 page millimetres (scale=0.6538743708865866, page=[297.0, 210.0]).\n# visible edges -> solid (layer OUTLINE); hidden edges -> dashed (layer HIDDEN)\n# dimensions -> real movable DIMENSION entities (text = true mm value)\n# Run: python 0016_00160331_gt.py [out.dxf]\nimport sys\nimport ezdxf\n\nSCALE = 0.6538743708865866\nPAGE = [297.0, 210.0]\n\nVISIBLE_SEGMENTS = [\n (147.987013, 172.050016, 147.987013, 118.363489),\n (147.987013, 118.363489, 82.599576, 118.363489),\n (82.599576, 118.363489, 82.599576, 172.050016),\n (82.599576, 172.050016, 147.987013, 172.050016),\n (147.987013, 61.950016, 147.987013, 104.363489),\n (147.987013, 104.363489, 82.599576, 104.363489),\n (82.599576, 61.950016, 82.599576, 104.363489),\n (147.987013, 61.950016, 82.599576, 61.950016),\n (161.987013, 118.363489, 204.400486, 118.363489),\n (204.400486, 118.363489, 204.400486, 172.050016),\n (161.987013, 172.050016, 204.400486, 172.050016),\n (161.987013, 118.363489, 161.987013, 172.050016)\n]\nVISIBLE_CIRCLES = [\n\n]\nVISIBLE_ARCS = [\n\n]\nHIDDEN_SEGMENTS = [\n\n]\n# (orient, text, p1, p2, base) for linear; (orient, text, center, radius, angle) for diameter\nDIMENSIONS = [\n ('horizontal', '100', (147.987, 172.05), (82.5996, 172.05), (115.2933, 161.05)),\n ('vertical', '82.1053', (147.987, 118.3635), (147.987, 172.05), (136.987, 145.2067)),\n ('horizontal', '64.8649', (161.987, 118.3635), (204.4005, 118.3635), (183.1937, 129.3635))\n]\n\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\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\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,\n angle=(0 if d[0] == \"horizontal\" else 90),\n 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,\n text=text, dimstyle=\"EZDXF\").render()\n\n doc.saveas(out_path)\n\n\nif __name__ == \"__main__\":\n out = sys.argv[1] if len(sys.argv) > 1 else \"0016_00160331_gt.dxf\"\n draw(out)\n print(\"wrote\", out)\n```"}], "images": ["images/0016_00160331.png"], "id": "0016_00160331"} {"messages": [{"role": "user", "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 9.9 mm."}, {"role": "assistant", "content": "```python\n#!/usr/bin/env python3\n# -*- coding: utf-8 -*-\n# Ground-truth 2D engineering drawing for part: 0016_00166164\n# Self-contained: reproduces the three-view DXF via ezdxf, NO FreeCAD needed.\n# Coordinates are A4 page millimetres (scale=0.874464454976306, page=[297.0, 210.0]).\n# visible edges -> solid (layer OUTLINE); hidden edges -> dashed (layer HIDDEN)\n# dimensions -> real movable DIMENSION entities (text = true mm value)\n# Run: python 0016_00166164_gt.py [out.dxf]\nimport sys\nimport ezdxf\n\nSCALE = 0.874464454976306\nPAGE = [297.0, 210.0]\n\nVISIBLE_SEGMENTS = [\n (149.662485, 172.050027, 149.662485, 84.603582),\n (149.662485, 84.603582, 114.683907, 84.603582),\n (114.683907, 84.603582, 114.683907, 172.050027),\n (114.683907, 172.050027, 149.662485, 172.050027),\n (149.662485, 61.950027, 149.662485, 70.603582),\n (149.662485, 70.603582, 114.683907, 70.603582),\n (114.683907, 61.950027, 114.683907, 70.603582),\n (149.662485, 61.950027, 114.683907, 61.950027),\n (163.662485, 84.603582, 172.316039, 84.603582),\n (172.316039, 84.603582, 172.316039, 172.050027),\n (163.662485, 172.050027, 172.316039, 172.050027),\n (163.662485, 84.603582, 163.662485, 172.050027)\n]\nVISIBLE_CIRCLES = [\n\n]\nVISIBLE_ARCS = [\n\n]\nHIDDEN_SEGMENTS = [\n\n]\n# (orient, text, p1, p2, base) for linear; (orient, text, center, radius, angle) for diameter\nDIMENSIONS = [\n ('horizontal', '40', (149.6625, 172.05), (114.6839, 172.05), (132.1732, 161.05)),\n ('vertical', '100', (149.6625, 84.6036), (149.6625, 172.05), (138.6625, 128.3268)),\n ('horizontal', '9.8958', (163.6625, 84.6036), (172.316, 84.6036), (167.9893, 95.6036))\n]\n\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\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\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,\n angle=(0 if d[0] == \"horizontal\" else 90),\n 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,\n text=text, dimstyle=\"EZDXF\").render()\n\n doc.saveas(out_path)\n\n\nif __name__ == \"__main__\":\n out = sys.argv[1] if len(sys.argv) > 1 else \"0016_00166164_gt.dxf\"\n draw(out)\n print(\"wrote\", out)\n```"}], "images": ["images/0016_00166164.png"], "id": "0016_00166164"} {"messages": [{"role": "user", "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": "assistant", "content": "```python\n#!/usr/bin/env python3\n# -*- coding: utf-8 -*-\n# Ground-truth 2D engineering drawing for part: 0016_00166858\n# Self-contained: reproduces the three-view DXF via ezdxf, NO FreeCAD needed.\n# Coordinates are A4 page millimetres (scale=0.4805, page=[297.0, 210.0]).\n# visible edges -> solid (layer OUTLINE); hidden edges -> dashed (layer HIDDEN)\n# dimensions -> real movable DIMENSION entities (text = true mm value)\n# Run: python 0016_00166858_gt.py [out.dxf]\nimport sys\nimport ezdxf\n\nSCALE = 0.4805\nPAGE = [297.0, 210.0]\n\nVISIBLE_SEGMENTS = [\n (136.5, 172.05, 136.5, 124.0),\n (136.5, 124.0, 88.45, 124.0),\n (88.45, 124.0, 88.45, 172.05),\n (88.45, 172.05, 136.5, 172.05),\n (136.5, 61.95, 136.5, 110.0),\n (136.5, 110.0, 88.45, 110.0),\n (88.45, 61.95, 88.45, 110.0),\n (136.5, 61.95, 88.45, 61.95),\n (150.5, 124.0, 198.55, 124.0),\n (198.55, 124.0, 198.55, 172.05),\n (150.5, 172.05, 198.55, 172.05),\n (150.5, 124.0, 150.5, 172.05)\n]\nVISIBLE_CIRCLES = [\n\n]\nVISIBLE_ARCS = [\n\n]\nHIDDEN_SEGMENTS = [\n\n]\n# (orient, text, p1, p2, base) for linear; (orient, text, center, radius, angle) for diameter\nDIMENSIONS = [\n ('horizontal', '100', (136.5, 172.05), (88.45, 172.05), (112.475, 161.05)),\n ('vertical', '100', (136.5, 124.0), (136.5, 172.05), (125.5, 148.025)),\n ('horizontal', '100', (150.5, 124.0), (198.55, 124.0), (174.525, 135.0))\n]\n\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\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\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,\n angle=(0 if d[0] == \"horizontal\" else 90),\n 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,\n text=text, dimstyle=\"EZDXF\").render()\n\n doc.saveas(out_path)\n\n\nif __name__ == \"__main__\":\n out = sys.argv[1] if len(sys.argv) > 1 else \"0016_00166858_gt.dxf\"\n draw(out)\n print(\"wrote\", out)\n```"}], "images": ["images/0016_00166858.png"], "id": "0016_00166858"} {"messages": [{"role": "user", "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 6.38 mm."}, {"role": "assistant", "content": "```python\n#!/usr/bin/env python3\n# -*- coding: utf-8 -*-\n# Ground-truth 2D engineering drawing for part: 0017_00176814\n# Self-contained: reproduces the three-view DXF via ezdxf, NO FreeCAD needed.\n# Coordinates are A4 page millimetres (scale=1.2002419580420187, page=[297.0, 210.0]).\n# visible edges -> solid (layer OUTLINE); hidden edges -> dashed (layer HIDDEN)\n# dimensions -> real movable DIMENSION entities (text = true mm value)\n# Run: python 0017_00176814_gt.py [out.dxf]\nimport sys\nimport ezdxf\n\nSCALE = 1.2002419580420187\nPAGE = [297.0, 210.0]\n\nVISIBLE_SEGMENTS = [\n (192.681575, 172.050049, 192.681575, 83.611168),\n (192.681575, 83.611168, 72.65738, 83.611168),\n (72.65738, 83.611168, 72.65738, 172.050049),\n (72.65738, 172.050049, 192.681575, 172.050049),\n (192.681575, 61.950049, 192.681575, 69.611168),\n (192.681575, 69.611168, 72.65738, 69.611168),\n (72.65738, 61.950049, 72.65738, 69.611168),\n (192.681575, 61.950049, 72.65738, 61.950049),\n (206.681575, 83.611168, 214.342694, 83.611168),\n (214.342694, 83.611168, 214.342694, 172.050049),\n (206.681575, 172.050049, 214.342694, 172.050049),\n (206.681575, 83.611168, 206.681575, 172.050049)\n]\nVISIBLE_CIRCLES = [\n\n]\nVISIBLE_ARCS = [\n\n]\nHIDDEN_SEGMENTS = [\n\n]\n# (orient, text, p1, p2, base) for linear; (orient, text, center, radius, angle) for diameter\nDIMENSIONS = [\n ('horizontal', '100', (192.6816, 172.05), (72.6574, 172.05), (132.6695, 161.05)),\n ('vertical', '73.6842', (192.6816, 83.6112), (192.6816, 172.05), (181.6816, 127.8306)),\n ('horizontal', '6.383', (206.6815, 83.6112), (214.3427, 83.6112), (210.5121, 94.6112))\n]\n\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\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\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,\n angle=(0 if d[0] == \"horizontal\" else 90),\n 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,\n text=text, dimstyle=\"EZDXF\").render()\n\n doc.saveas(out_path)\n\n\nif __name__ == \"__main__\":\n out = sys.argv[1] if len(sys.argv) > 1 else \"0017_00176814_gt.dxf\"\n draw(out)\n print(\"wrote\", out)\n```"}], "images": ["images/0017_00176814.png"], "id": "0017_00176814"} {"messages": [{"role": "user", "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 1371.43 mm."}, {"role": "assistant", "content": "```python\n#!/usr/bin/env python3\n# -*- coding: utf-8 -*-\n# Ground-truth 2D engineering drawing for part: 0017_00177082\n# Self-contained: reproduces the three-view DXF via ezdxf, NO FreeCAD needed.\n# Coordinates are A4 page millimetres (scale=0.06793504836821584, page=[297.0, 210.0]).\n# visible edges -> solid (layer OUTLINE); hidden edges -> dashed (layer HIDDEN)\n# dimensions -> real movable DIMENSION entities (text = true mm value)\n# Run: python 0017_00177082_gt.py [out.dxf]\nimport sys\nimport ezdxf\n\nSCALE = 0.06793504836821584\nPAGE = [297.0, 210.0]\n\nVISIBLE_SEGMENTS = [\n (93.312708, 172.05002, 93.312708, 169.118087),\n (93.312708, 169.118087, 86.519203, 169.118087),\n (86.519203, 169.118087, 86.519203, 172.05002),\n (86.519203, 172.05002, 93.312708, 172.05002),\n (93.312708, 61.95002, 93.312708, 155.118087),\n (93.312708, 155.118087, 86.519203, 155.118087),\n (86.519203, 61.95002, 86.519203, 155.118087),\n (93.312708, 61.95002, 86.519203, 61.95002),\n (107.312708, 169.118087, 200.480774, 169.118087),\n (200.480774, 169.118087, 200.480774, 172.05002),\n (107.312708, 172.05002, 200.480774, 172.05002),\n (107.312708, 169.118087, 107.312708, 172.05002)\n]\nVISIBLE_CIRCLES = [\n\n]\nVISIBLE_ARCS = [\n\n]\nHIDDEN_SEGMENTS = [\n\n]\n# (orient, text, p1, p2, base) for linear; (orient, text, center, radius, angle) for diameter\nDIMENSIONS = [\n ('horizontal', '100', (93.3127, 172.05), (86.5192, 172.05), (89.916, 161.05)),\n ('vertical', '43.1579', (93.3127, 169.1181), (93.3127, 172.05), (82.3127, 170.584)),\n ('horizontal', '1371.43', (107.3127, 169.1181), (200.4808, 169.1181), (153.8968, 180.1181))\n]\n\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\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\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,\n angle=(0 if d[0] == \"horizontal\" else 90),\n 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,\n text=text, dimstyle=\"EZDXF\").render()\n\n doc.saveas(out_path)\n\n\nif __name__ == \"__main__\":\n out = sys.argv[1] if len(sys.argv) > 1 else \"0017_00177082_gt.dxf\"\n draw(out)\n print(\"wrote\", out)\n```"}], "images": ["images/0017_00177082.png"], "id": "0017_00177082"} {"messages": [{"role": "user", "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 66.32 mm wide and 100 mm tall. It is extruded to a thickness of 16.67 mm."}, {"role": "assistant", "content": "```python\n#!/usr/bin/env python3\n# -*- coding: utf-8 -*-\n# Ground-truth 2D engineering drawing for part: 0018_00181912\n# Self-contained: reproduces the three-view DXF via ezdxf, NO FreeCAD needed.\n# Coordinates are A4 page millimetres (scale=0.8237142857143326, page=[297.0, 210.0]).\n# visible edges -> solid (layer OUTLINE); hidden edges -> dashed (layer HIDDEN)\n# dimensions -> real movable DIMENSION entities (text = true mm value)\n# Run: python 0018_00181912_gt.py [out.dxf]\nimport sys\nimport ezdxf\n\nSCALE = 0.8237142857143326\nPAGE = [297.0, 210.0]\n\nVISIBLE_SEGMENTS = [\n (156.948318, 89.678583, 156.948318, 172.050011),\n (156.948318, 172.050011, 102.323055, 172.050011),\n (102.323055, 172.050011, 102.323055, 89.678583),\n (102.323055, 89.678583, 156.948318, 89.678583),\n (156.948318, 75.678583, 156.948318, 61.950011),\n (102.323055, 75.678583, 102.323055, 61.950011),\n (102.323055, 61.950011, 156.948318, 61.950011),\n (102.323055, 75.678583, 156.948318, 75.678583),\n (184.67689, 172.050011, 170.948318, 172.050011),\n (170.948318, 172.050011, 170.948318, 89.678583),\n (184.67689, 89.678583, 170.948318, 89.678583),\n (184.67689, 172.050011, 184.67689, 89.678583)\n]\nVISIBLE_CIRCLES = [\n\n]\nVISIBLE_ARCS = [\n\n]\nHIDDEN_SEGMENTS = [\n\n]\n# (orient, text, p1, p2, base) for linear; (orient, text, center, radius, angle) for diameter\nDIMENSIONS = [\n ('horizontal', '66.3158', (156.9483, 89.6786), (102.3231, 89.6786), (129.6357, 78.6786)),\n ('vertical', '100', (156.9483, 172.05), (156.9483, 89.6786), (167.9483, 130.8643)),\n ('horizontal', '16.6667', (184.6769, 172.05), (170.9483, 172.05), (177.8126, 161.05))\n]\n\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\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\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,\n angle=(0 if d[0] == \"horizontal\" else 90),\n 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,\n text=text, dimstyle=\"EZDXF\").render()\n\n doc.saveas(out_path)\n\n\nif __name__ == \"__main__\":\n out = sys.argv[1] if len(sys.argv) > 1 else \"0018_00181912_gt.dxf\"\n draw(out)\n print(\"wrote\", out)\n```"}], "images": ["images/0018_00181912.png"], "id": "0018_00181912"} {"messages": [{"role": "user", "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 47.92 mm."}, {"role": "assistant", "content": "```python\n#!/usr/bin/env python3\n# -*- coding: utf-8 -*-\n# Ground-truth 2D engineering drawing for part: 0018_00184817\n# Self-contained: reproduces the three-view DXF via ezdxf, NO FreeCAD needed.\n# Coordinates are A4 page millimetres (scale=0.9933971830985894, page=[297.0, 210.0]).\n# visible edges -> solid (layer OUTLINE); hidden edges -> dashed (layer HIDDEN)\n# dimensions -> real movable DIMENSION entities (text = true mm value)\n# Run: python 0018_00184817_gt.py [out.dxf]\nimport sys\nimport ezdxf\n\nSCALE = 0.9933971830985894\nPAGE = [297.0, 210.0]\n\nVISIBLE_SEGMENTS = [\n (162.369707, 164.008211, 162.369707, 131.592093),\n (162.369707, 131.592093, 63.029989, 131.592093),\n (63.029989, 131.592093, 63.029989, 164.008211),\n (63.029989, 164.008211, 162.369707, 164.008211),\n (162.369707, 69.991811, 162.369707, 117.592093),\n (162.369707, 117.592093, 63.029989, 117.592093),\n (63.029989, 69.991811, 63.029989, 117.592093),\n (162.369707, 69.991811, 63.029989, 69.991811),\n (176.369707, 131.592093, 223.969989, 131.592093),\n (223.969989, 131.592093, 223.969989, 164.008211),\n (176.369707, 164.008211, 223.969989, 164.008211),\n (176.369707, 131.592093, 176.369707, 164.008211)\n]\nVISIBLE_CIRCLES = [\n\n]\nVISIBLE_ARCS = [\n\n]\nHIDDEN_SEGMENTS = [\n\n]\n# (orient, text, p1, p2, base) for linear; (orient, text, center, radius, angle) for diameter\nDIMENSIONS = [\n ('horizontal', '100', (162.3697, 164.0082), (63.03, 164.0082), (112.6999, 153.0082)),\n ('vertical', '32.6316', (162.3697, 131.5921), (162.3697, 164.0082), (151.3697, 147.8001)),\n ('horizontal', '47.9167', (176.3697, 131.5921), (223.97, 131.5921), (200.1699, 142.5921))\n]\n\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\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\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,\n angle=(0 if d[0] == \"horizontal\" else 90),\n 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,\n text=text, dimstyle=\"EZDXF\").render()\n\n doc.saveas(out_path)\n\n\nif __name__ == \"__main__\":\n out = sys.argv[1] if len(sys.argv) > 1 else \"0018_00184817_gt.dxf\"\n draw(out)\n print(\"wrote\", out)\n```"}], "images": ["images/0018_00184817.png"], "id": "0018_00184817"} {"messages": [{"role": "user", "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 65.31 mm."}, {"role": "assistant", "content": "```python\n#!/usr/bin/env python3\n# -*- coding: utf-8 -*-\n# Ground-truth 2D engineering drawing for part: 0018_00184829\n# Self-contained: reproduces the three-view DXF via ezdxf, NO FreeCAD needed.\n# Coordinates are A4 page millimetres (scale=0.7542497049401943, page=[297.0, 210.0]).\n# visible edges -> solid (layer OUTLINE); hidden edges -> dashed (layer HIDDEN)\n# dimensions -> real movable DIMENSION entities (text = true mm value)\n# Run: python 0018_00184829_gt.py [out.dxf]\nimport sys\nimport ezdxf\n\nSCALE = 0.7542497049401943\nPAGE = [297.0, 210.0]\n\nVISIBLE_SEGMENTS = [\n (149.583889, 172.050046, 149.583889, 125.207169),\n (149.583889, 125.207169, 74.158919, 125.207169),\n (74.158919, 125.207169, 74.158919, 172.050046),\n (74.158919, 172.050046, 149.583889, 172.050046),\n (149.583889, 61.950046, 149.583889, 111.207169),\n (149.583889, 111.207169, 74.158919, 111.207169),\n (74.158919, 61.950046, 74.158919, 111.207169),\n (149.583889, 61.950046, 74.158919, 61.950046),\n (163.583889, 125.207169, 212.841013, 125.207169),\n (212.841013, 125.207169, 212.841013, 172.050046),\n (163.583889, 172.050046, 212.841013, 172.050046),\n (163.583889, 125.207169, 163.583889, 172.050046)\n]\nVISIBLE_CIRCLES = [\n\n]\nVISIBLE_ARCS = [\n\n]\nHIDDEN_SEGMENTS = [\n\n]\n# (orient, text, p1, p2, base) for linear; (orient, text, center, radius, angle) for diameter\nDIMENSIONS = [\n ('horizontal', '100', (149.5839, 172.05), (74.1589, 172.05), (111.8714, 161.05)),\n ('vertical', '62.1053', (149.5839, 125.2072), (149.5839, 172.05), (138.5839, 148.6286)),\n ('horizontal', '65.3061', (163.5839, 125.2072), (212.841, 125.2072), (188.2125, 136.2072))\n]\n\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\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\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,\n angle=(0 if d[0] == \"horizontal\" else 90),\n 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,\n text=text, dimstyle=\"EZDXF\").render()\n\n doc.saveas(out_path)\n\n\nif __name__ == \"__main__\":\n out = sys.argv[1] if len(sys.argv) > 1 else \"0018_00184829_gt.dxf\"\n draw(out)\n print(\"wrote\", out)\n```"}], "images": ["images/0018_00184829.png"], "id": "0018_00184829"} {"messages": [{"role": "user", "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 47.37 mm wide and 100 mm tall. It is extruded to a thickness of 6.75 mm."}, {"role": "assistant", "content": "```python\n#!/usr/bin/env python3\n# -*- coding: utf-8 -*-\n# Ground-truth 2D engineering drawing for part: 0019_00198977\n# Self-contained: reproduces the three-view DXF via ezdxf, NO FreeCAD needed.\n# Coordinates are A4 page millimetres (scale=0.9002471264367958, page=[297.0, 210.0]).\n# visible edges -> solid (layer OUTLINE); hidden edges -> dashed (layer HIDDEN)\n# dimensions -> real movable DIMENSION entities (text = true mm value)\n# Run: python 0019_00198977_gt.py [out.dxf]\nimport sys\nimport ezdxf\n\nSCALE = 0.9002471264367958\nPAGE = [297.0, 210.0]\n\nVISIBLE_SEGMENTS = [\n (154.784, 82.025292, 154.784, 172.050005),\n (154.784, 172.050005, 112.140715, 172.050005),\n (112.140715, 172.050005, 112.140715, 82.025292),\n (112.140715, 82.025292, 154.784, 82.025292),\n (154.784, 68.025292, 154.784, 61.950005),\n (112.140715, 68.025292, 112.140715, 61.950005),\n (112.140715, 61.950005, 154.784, 61.950005),\n (112.140715, 68.025292, 154.784, 68.025292),\n (174.859287, 172.050005, 168.784, 172.050005),\n (168.784, 172.050005, 168.784, 82.025292),\n (174.859287, 82.025292, 168.784, 82.025292),\n (174.859287, 172.050005, 174.859287, 82.025292)\n]\nVISIBLE_CIRCLES = [\n\n]\nVISIBLE_ARCS = [\n\n]\nHIDDEN_SEGMENTS = [\n\n]\n# (orient, text, p1, p2, base) for linear; (orient, text, center, radius, angle) for diameter\nDIMENSIONS = [\n ('horizontal', '47.3684', (154.784, 82.0253), (112.1407, 82.0253), (133.4624, 71.0253)),\n ('vertical', '100', (154.784, 172.05), (154.784, 82.0253), (165.784, 127.0376)),\n ('horizontal', '6.7485', (174.8593, 172.05), (168.784, 172.05), (171.8216, 161.05))\n]\n\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\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\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,\n angle=(0 if d[0] == \"horizontal\" else 90),\n 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,\n text=text, dimstyle=\"EZDXF\").render()\n\n doc.saveas(out_path)\n\n\nif __name__ == \"__main__\":\n out = sys.argv[1] if len(sys.argv) > 1 else \"0019_00198977_gt.dxf\"\n draw(out)\n print(\"wrote\", out)\n```"}], "images": ["images/0019_00198977.png"], "id": "0019_00198977"} {"messages": [{"role": "user", "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 17.89 mm tall. It is extruded to a thickness of 1.57 mm."}, {"role": "assistant", "content": "```python\n#!/usr/bin/env python3\n# -*- coding: utf-8 -*-\n# Ground-truth 2D engineering drawing for part: 0019_00199637\n# Self-contained: reproduces the three-view DXF via ezdxf, NO FreeCAD needed.\n# Coordinates are A4 page millimetres (scale=1.2463660714286797, page=[297.0, 210.0]).\n# visible edges -> solid (layer OUTLINE); hidden edges -> dashed (layer HIDDEN)\n# dimensions -> real movable DIMENSION entities (text = true mm value)\n# Run: python 0019_00199637_gt.py [out.dxf]\nimport sys\nimport ezdxf\n\nSCALE = 1.2463660714286797\nPAGE = [297.0, 210.0]\n\nVISIBLE_SEGMENTS = [\n (196.860684, 114.805944, 196.860684, 137.109337),\n (72.224077, 114.805944, 196.860684, 114.805944),\n (196.860684, 137.109337, 72.224077, 137.109337),\n (72.224077, 137.109337, 72.224077, 114.805944),\n (196.860684, 96.890658, 196.860684, 100.805944),\n (72.224077, 96.890658, 72.224077, 100.805944),\n (72.224077, 96.890658, 196.860684, 96.890658),\n (72.224077, 100.805944, 196.860684, 100.805944),\n (210.860684, 114.805944, 214.77597, 114.805944),\n (214.77597, 137.109337, 210.860684, 137.109337),\n (210.860684, 137.109337, 210.860684, 114.805944),\n (214.77597, 137.109337, 214.77597, 114.805944)\n]\nVISIBLE_CIRCLES = [\n\n]\nVISIBLE_ARCS = [\n\n]\nHIDDEN_SEGMENTS = [\n\n]\n# (orient, text, p1, p2, base) for linear; (orient, text, center, radius, angle) for diameter\nDIMENSIONS = [\n ('horizontal', '100', (196.8607, 114.806), (72.2241, 114.806), (134.5424, 103.806)),\n ('vertical', '17.8947', (196.8607, 137.1093), (196.8607, 114.806), (207.8607, 125.9577)),\n ('horizontal', '3.1414', (214.776, 137.1093), (210.8606, 137.1093), (212.8183, 126.1093))\n]\n\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\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\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,\n angle=(0 if d[0] == \"horizontal\" else 90),\n 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,\n text=text, dimstyle=\"EZDXF\").render()\n\n doc.saveas(out_path)\n\n\nif __name__ == \"__main__\":\n out = sys.argv[1] if len(sys.argv) > 1 else \"0019_00199637_gt.dxf\"\n draw(out)\n print(\"wrote\", out)\n```"}], "images": ["images/0019_00199637.png"], "id": "0019_00199637"} {"messages": [{"role": "user", "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 3200 mm."}, {"role": "assistant", "content": "```python\n#!/usr/bin/env python3\n# -*- coding: utf-8 -*-\n# Ground-truth 2D engineering drawing for part: 0020_00201692\n# Self-contained: reproduces the three-view DXF via ezdxf, NO FreeCAD needed.\n# Coordinates are A4 page millimetres (scale=0.029121212121212176, page=[297.0, 210.0]).\n# visible edges -> solid (layer OUTLINE); hidden edges -> dashed (layer HIDDEN)\n# dimensions -> real movable DIMENSION entities (text = true mm value)\n# Run: python 0020_00201692_gt.py [out.dxf]\nimport sys\nimport ezdxf\n\nSCALE = 0.029121212121212176\nPAGE = [297.0, 210.0]\n\nVISIBLE_SEGMENTS = [\n (91.362108, 169.137887, 91.362108, 172.050008),\n (91.362108, 172.050008, 88.449987, 172.050008),\n (88.449987, 172.050008, 88.449987, 169.137887),\n (88.449987, 169.137887, 91.362108, 169.137887),\n (91.362108, 155.137887, 91.362108, 61.950008),\n (88.449987, 155.137887, 88.449987, 61.950008),\n (88.449987, 61.950008, 91.362108, 61.950008),\n (88.449987, 155.137887, 91.362108, 155.137887),\n (198.549987, 172.050008, 105.362108, 172.050008),\n (105.362108, 172.050008, 105.362108, 169.137887),\n (198.549987, 169.137887, 105.362108, 169.137887),\n (198.549987, 172.050008, 198.549987, 169.137887)\n]\nVISIBLE_CIRCLES = [\n\n]\nVISIBLE_ARCS = [\n\n]\nHIDDEN_SEGMENTS = [\n\n]\n# (orient, text, p1, p2, base) for linear; (orient, text, center, radius, angle) for diameter\nDIMENSIONS = [\n ('horizontal', '100', (91.3621, 169.1379), (88.45, 169.1379), (89.9061, 158.1379)),\n ('vertical', '100', (91.3621, 172.05), (91.3621, 169.1379), (102.3621, 170.5939)),\n ('horizontal', '3200', (198.55, 172.05), (105.3621, 172.05), (151.9561, 161.05))\n]\n\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\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\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,\n angle=(0 if d[0] == \"horizontal\" else 90),\n 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,\n text=text, dimstyle=\"EZDXF\").render()\n\n doc.saveas(out_path)\n\n\nif __name__ == \"__main__\":\n out = sys.argv[1] if len(sys.argv) > 1 else \"0020_00201692_gt.dxf\"\n draw(out)\n print(\"wrote\", out)\n```"}], "images": ["images/0020_00201692.png"], "id": "0020_00201692"} {"messages": [{"role": "user", "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 23.76 mm."}, {"role": "assistant", "content": "```python\n#!/usr/bin/env python3\n# -*- coding: utf-8 -*-\n# Ground-truth 2D engineering drawing for part: 0020_00202141\n# Self-contained: reproduces the three-view DXF via ezdxf, NO FreeCAD needed.\n# Coordinates are A4 page millimetres (scale=0.7764880000000235, page=[297.0, 210.0]).\n# visible edges -> solid (layer OUTLINE); hidden edges -> dashed (layer HIDDEN)\n# dimensions -> real movable DIMENSION entities (text = true mm value)\n# Run: python 0020_00202141_gt.py [out.dxf]\nimport sys\nimport ezdxf\n\nSCALE = 0.7764880000000235\nPAGE = [297.0, 210.0]\n\nVISIBLE_SEGMENTS = [\n (146.890916, 94.4012, 146.890916, 172.05),\n (146.890916, 172.05, 107.657838, 172.05),\n (107.657838, 172.05, 107.657838, 94.4012),\n (107.657838, 94.4012, 146.890916, 94.4012),\n (146.890916, 80.4012, 146.890916, 61.95),\n (107.657838, 80.4012, 107.657838, 61.95),\n (107.657838, 61.95, 146.890916, 61.95),\n (107.657838, 80.4012, 146.890916, 80.4012),\n (179.342116, 172.05, 160.890916, 172.05),\n (160.890916, 172.05, 160.890916, 94.4012),\n (179.342116, 94.4012, 160.890916, 94.4012),\n (179.342116, 172.05, 179.342116, 94.4012)\n]\nVISIBLE_CIRCLES = [\n\n]\nVISIBLE_ARCS = [\n\n]\nHIDDEN_SEGMENTS = [\n\n]\n# (orient, text, p1, p2, base) for linear; (orient, text, center, radius, angle) for diameter\nDIMENSIONS = [\n ('horizontal', '50.5263', (146.8909, 94.4012), (107.6579, 94.4012), (127.2744, 83.4012)),\n ('vertical', '100', (146.8909, 172.05), (146.8909, 94.4012), (157.8909, 133.2256)),\n ('horizontal', '23.7624', (179.3421, 172.05), (160.8909, 172.05), (170.1165, 161.05))\n]\n\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\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\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,\n angle=(0 if d[0] == \"horizontal\" else 90),\n 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,\n text=text, dimstyle=\"EZDXF\").render()\n\n doc.saveas(out_path)\n\n\nif __name__ == \"__main__\":\n out = sys.argv[1] if len(sys.argv) > 1 else \"0020_00202141_gt.dxf\"\n draw(out)\n print(\"wrote\", out)\n```"}], "images": ["images/0020_00202141.png"], "id": "0020_00202141"} {"messages": [{"role": "user", "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 61.94 mm."}, {"role": "assistant", "content": "```python\n#!/usr/bin/env python3\n# -*- coding: utf-8 -*-\n# Ground-truth 2D engineering drawing for part: 0020_00207765\n# Self-contained: reproduces the three-view DXF via ezdxf, NO FreeCAD needed.\n# Coordinates are A4 page millimetres (scale=0.9073984063745061, page=[297.0, 210.0]).\n# visible edges -> solid (layer OUTLINE); hidden edges -> dashed (layer HIDDEN)\n# dimensions -> real movable DIMENSION entities (text = true mm value)\n# Run: python 0020_00207765_gt.py [out.dxf]\nimport sys\nimport ezdxf\n\nSCALE = 0.9073984063745061\nPAGE = [297.0, 210.0]\n\nVISIBLE_SEGMENTS = [\n (153.769816, 171.680803, 153.769816, 132.519398),\n (153.769816, 132.519398, 63.029976, 132.519398),\n (63.029976, 132.519398, 63.029976, 171.680803),\n (63.029976, 171.680803, 153.769816, 171.680803),\n (153.769816, 62.319239, 153.769816, 118.519398),\n (153.769816, 118.519398, 63.029976, 118.519398),\n (63.029976, 62.319239, 63.029976, 118.519398),\n (153.769816, 62.319239, 63.029976, 62.319239),\n (167.769816, 132.519398, 223.969976, 132.519398),\n (223.969976, 132.519398, 223.969976, 171.680803),\n (167.769816, 171.680803, 223.969976, 171.680803),\n (167.769816, 132.519398, 167.769816, 171.680803)\n]\nVISIBLE_CIRCLES = [\n\n]\nVISIBLE_ARCS = [\n\n]\nHIDDEN_SEGMENTS = [\n\n]\n# (orient, text, p1, p2, base) for linear; (orient, text, center, radius, angle) for diameter\nDIMENSIONS = [\n ('horizontal', '100', (153.7698, 171.6808), (63.03, 171.6808), (108.3999, 160.6808)),\n ('vertical', '43.1579', (153.7698, 132.5194), (153.7698, 171.6808), (142.7698, 152.1001)),\n ('horizontal', '61.9355', (167.7698, 132.5194), (223.97, 132.5194), (195.8699, 143.5194))\n]\n\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\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\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,\n angle=(0 if d[0] == \"horizontal\" else 90),\n 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,\n 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,\n text=text, dimstyle=\"EZDXF\").render()\n\n doc.saveas(out_path)\n\n\nif __name__ == \"__main__\":\n out = sys.argv[1] if len(sys.argv) > 1 else \"0020_00207765_gt.dxf\"\n draw(out)\n print(\"wrote\", out)\n```"}], "images": ["images/0020_00207765.png"], "id": "0020_00207765"} {"messages": [{"role": "user", "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 69.47 mm wide and 100 mm tall. It is extruded to a thickness of 1.04 mm."}, {"role": "assistant", "content": "```python\n#!/usr/bin/env python3\n# -*- coding: utf-8 -*-\n# Ground-truth 2D engineering drawing for part: 0020_00208312\n# Self-contained: reproduces the three-view DXF via ezdxf, NO FreeCAD needed.\n# Coordinates are A4 page millimetres (scale=0.9510927835051515, page=[297.0, 210.0]).\n# visible edges -> solid (layer OUTLINE); hidden edges -> dashed (layer HIDDEN)\n# dimensions -> real movable DIMENSION entities (text = true mm value)\n# Run: python 0020_00208312_gt.py [out.dxf]\nimport sys\nimport ezdxf\n\nSCALE = 0.9510927835051515\nPAGE = [297.0, 210.0]\n\nVISIBLE_SEGMENTS = [\n (169.04262, 172.049987, 169.04262, 76.940709),\n (169.04262, 76.940709, 102.9667, 76.940709),\n (102.9667, 76.940709, 102.9667, 172.049987),\n (102.9667, 172.049987, 169.04262, 172.049987),\n (169.04262, 61.949987, 169.04262, 62.940709),\n (169.04262, 62.940709, 102.9667, 62.940709),\n (102.9667, 61.949987, 102.9667, 62.940709),\n (169.04262, 61.949987, 102.9667, 61.949987),\n (183.04262, 76.940709, 184.033341, 76.940709),\n (184.033341, 76.940709, 184.033341, 172.049987),\n (183.04262, 172.049987, 184.033341, 172.049987),\n (183.04262, 76.940709, 183.04262, 172.049987)\n]\nVISIBLE_CIRCLES = [\n\n]\nVISIBLE_ARCS = [\n\n]\nHIDDEN_SEGMENTS = [\n\n]\n# (orient, text, p1, p2, base) for linear; (orient, text, center, radius, angle) for diameter\nDIMENSIONS = [\n ('horizontal', '69.4737', (169.0426, 172.05), (102.9667, 172.05), (136.0047, 161.05)),\n ('vertical', '100', (169.0426, 76.9407), (169.0426, 172.05), (158.0426, 124.4954)),\n ('horizontal', '1.0417', (183.0426, 76.9407), (184.0334, 76.9407), (183.538, 87.9407))\n]\n\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\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\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,\n angle=(0 if d[0] == \"horizontal\" else 90),\n 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,\n 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,\n text=text, dimstyle=\"EZDXF\").render()\n\n doc.saveas(out_path)\n\n\nif __name__ == \"__main__\":\n out = sys.argv[1] if len(sys.argv) > 1 else \"0020_00208312_gt.dxf\"\n draw(out)\n print(\"wrote\", out)\n```"}], "images": ["images/0020_00208312.png"], "id": "0020_00208312"} {"messages": [{"role": "user", "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 56.84 mm wide and 100 mm tall. It is extruded to a thickness of 3.12 mm."}, {"role": "assistant", "content": "```python\n#!/usr/bin/env python3\n# -*- coding: utf-8 -*-\n# Ground-truth 2D engineering drawing for part: 0021_00210687\n# Self-contained: reproduces the three-view DXF via ezdxf, NO FreeCAD needed.\n# Coordinates are A4 page millimetres (scale=0.9318787878787876, page=[297.0, 210.0]).\n# visible edges -> solid (layer OUTLINE); hidden edges -> dashed (layer HIDDEN)\n# dimensions -> real movable DIMENSION entities (text = true mm value)\n# Run: python 0021_00210687_gt.py [out.dxf]\nimport sys\nimport ezdxf\n\nSCALE = 0.9318787878787876\nPAGE = [297.0, 210.0]\n\nVISIBLE_SEGMENTS = [\n (161.528906, 78.862113, 161.528906, 172.049992),\n (161.528906, 172.049992, 108.558954, 172.049992),\n (108.558954, 172.049992, 108.558954, 78.862113),\n (108.558954, 78.862113, 161.528906, 78.862113),\n (161.528906, 64.862113, 161.528906, 61.949992),\n (108.558954, 64.862113, 108.558954, 61.949992),\n (108.558954, 61.949992, 161.528906, 61.949992),\n (108.558954, 64.862113, 161.528906, 64.862113),\n (178.441027, 172.049992, 175.528906, 172.049992),\n (175.528906, 172.049992, 175.528906, 78.862113),\n (178.441027, 78.862113, 175.528906, 78.862113),\n (178.441027, 172.049992, 178.441027, 78.862113)\n]\nVISIBLE_CIRCLES = [\n\n]\nVISIBLE_ARCS = [\n\n]\nHIDDEN_SEGMENTS = [\n\n]\n# (orient, text, p1, p2, base) for linear; (orient, text, center, radius, angle) for diameter\nDIMENSIONS = [\n ('horizontal', '56.8421', (161.5289, 78.8621), (108.559, 78.8621), (135.0439, 67.8621)),\n ('vertical', '100', (161.5289, 172.05), (161.5289, 78.8621), (172.5289, 125.4561)),\n ('horizontal', '3.125', (178.441, 172.05), (175.5289, 172.05), (176.985, 161.05))\n]\n\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\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\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,\n angle=(0 if d[0] == \"horizontal\" else 90),\n 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,\n 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,\n text=text, dimstyle=\"EZDXF\").render()\n\n doc.saveas(out_path)\n\n\nif __name__ == \"__main__\":\n out = sys.argv[1] if len(sys.argv) > 1 else \"0021_00210687_gt.dxf\"\n draw(out)\n print(\"wrote\", out)\n```"}], "images": ["images/0021_00210687.png"], "id": "0021_00210687"} {"messages": [{"role": "user", "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 69.47 mm wide and 100 mm tall. It is extruded to a thickness of 1.06 mm."}, {"role": "assistant", "content": "```python\n#!/usr/bin/env python3\n# -*- coding: utf-8 -*-\n# Ground-truth 2D engineering drawing for part: 0021_00210816\n# Self-contained: reproduces the three-view DXF via ezdxf, NO FreeCAD needed.\n# Coordinates are A4 page millimetres (scale=0.9508842105263915, page=[297.0, 210.0]).\n# visible edges -> solid (layer OUTLINE); hidden edges -> dashed (layer HIDDEN)\n# dimensions -> real movable DIMENSION entities (text = true mm value)\n# Run: python 0021_00210816_gt.py [out.dxf]\nimport sys\nimport ezdxf\n\nSCALE = 0.9508842105263915\nPAGE = [297.0, 210.0]\n\nVISIBLE_SEGMENTS = [\n (169.02491, 172.050013, 169.02491, 76.961592),\n (169.02491, 76.961592, 102.963481, 76.961592),\n (102.963481, 76.961592, 102.963481, 172.050013),\n (102.963481, 172.050013, 169.02491, 172.050013),\n (169.02491, 61.950013, 169.02491, 62.961592),\n (169.02491, 62.961592, 102.963481, 62.961592),\n (102.963481, 61.950013, 102.963481, 62.961592),\n (169.02491, 61.950013, 102.963481, 61.950013),\n (183.02491, 76.961592, 184.036489, 76.961592),\n (184.036489, 76.961592, 184.036489, 172.050013),\n (183.02491, 172.050013, 184.036489, 172.050013),\n (183.02491, 76.961592, 183.02491, 172.050013)\n]\nVISIBLE_CIRCLES = [\n\n]\nVISIBLE_ARCS = [\n\n]\nHIDDEN_SEGMENTS = [\n\n]\n# (orient, text, p1, p2, base) for linear; (orient, text, center, radius, angle) for diameter\nDIMENSIONS = [\n ('horizontal', '69.4737', (169.0249, 172.05), (102.9635, 172.05), (135.9942, 161.05)),\n ('vertical', '100', (169.0249, 76.9616), (169.0249, 172.05), (158.0249, 124.5058)),\n ('horizontal', '1.0638', (183.0249, 76.9616), (184.0365, 76.9616), (183.5307, 87.9616))\n]\n\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\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\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,\n angle=(0 if d[0] == \"horizontal\" else 90),\n 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,\n 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,\n text=text, dimstyle=\"EZDXF\").render()\n\n doc.saveas(out_path)\n\n\nif __name__ == \"__main__\":\n out = sys.argv[1] if len(sys.argv) > 1 else \"0021_00210816_gt.dxf\"\n draw(out)\n print(\"wrote\", out)\n```"}], "images": ["images/0021_00210816.png"], "id": "0021_00210816"} {"messages": [{"role": "user", "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 63.16 mm tall. It is extruded to a thickness of 2.08 mm."}, {"role": "assistant", "content": "```python\n#!/usr/bin/env python3\n# -*- coding: utf-8 -*-\n# Ground-truth 2D engineering drawing for part: 0021_00210901\n# Self-contained: reproduces the three-view DXF via ezdxf, NO FreeCAD needed.\n# Coordinates are A4 page millimetres (scale=0.9006000000000004, page=[297.0, 210.0]).\n# visible edges -> solid (layer OUTLINE); hidden edges -> dashed (layer HIDDEN)\n# dimensions -> real movable DIMENSION entities (text = true mm value)\n# Run: python 0021_00210901_gt.py [out.dxf]\nimport sys\nimport ezdxf\n\nSCALE = 0.9006000000000004\nPAGE = [297.0, 210.0]\n\nVISIBLE_SEGMENTS = [\n (180.59189, 96.4981, 180.59189, 153.3781),\n (180.59189, 153.3781, 90.53189, 153.3781),\n (90.53189, 153.3781, 90.53189, 96.4981),\n (90.53189, 96.4981, 180.59189, 96.4981),\n (180.59189, 82.4981, 180.59189, 80.62185),\n (90.53189, 82.4981, 90.53189, 80.62185),\n (90.53189, 80.62185, 180.59189, 80.62185),\n (90.53189, 82.4981, 180.59189, 82.4981),\n (196.46814, 153.3781, 194.59189, 153.3781),\n (194.59189, 153.3781, 194.59189, 96.4981),\n (196.46814, 96.4981, 194.59189, 96.4981),\n (196.46814, 153.3781, 196.46814, 96.4981)\n]\nVISIBLE_CIRCLES = [\n\n]\nVISIBLE_ARCS = [\n\n]\nHIDDEN_SEGMENTS = [\n\n]\n# (orient, text, p1, p2, base) for linear; (orient, text, center, radius, angle) for diameter\nDIMENSIONS = [\n ('horizontal', '100', (180.5919, 96.4981), (90.5319, 96.4981), (135.5619, 85.4981)),\n ('vertical', '63.1579', (180.5919, 153.3781), (180.5919, 96.4981), (191.5919, 124.9381)),\n ('horizontal', '2.0833', (196.4681, 153.3781), (194.5919, 153.3781), (195.53, 142.3781))\n]\n\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\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\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,\n angle=(0 if d[0] == \"horizontal\" else 90),\n 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,\n 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,\n text=text, dimstyle=\"EZDXF\").render()\n\n doc.saveas(out_path)\n\n\nif __name__ == \"__main__\":\n out = sys.argv[1] if len(sys.argv) > 1 else \"0021_00210901_gt.dxf\"\n draw(out)\n print(\"wrote\", out)\n```"}], "images": ["images/0021_00210901.png"], "id": "0021_00210901"} {"messages": [{"role": "user", "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 11.58 mm wide and 100 mm tall. It is extruded to a thickness of 11.02 mm."}, {"role": "assistant", "content": "```python\n#!/usr/bin/env python3\n# -*- coding: utf-8 -*-\n# Ground-truth 2D engineering drawing for part: 0023_00232794\n# Self-contained: reproduces the three-view DXF via ezdxf, NO FreeCAD needed.\n# Coordinates are A4 page millimetres (scale=0.8655815602837043, page=[297.0, 210.0]).\n# visible edges -> solid (layer OUTLINE); hidden edges -> dashed (layer HIDDEN)\n# dimensions -> real movable DIMENSION entities (text = true mm value)\n# Run: python 0023_00232794_gt.py [out.dxf]\nimport sys\nimport ezdxf\n\nSCALE = 0.8655815602837043\nPAGE = [297.0, 210.0]\n\nVISIBLE_SEGMENTS = [\n (136.740316, 172.049974, 136.740316, 85.491818),\n (136.740316, 85.491818, 126.717793, 85.491818),\n (126.717793, 85.491818, 126.717793, 172.049974),\n (126.717793, 172.049974, 136.740316, 172.049974),\n (136.740316, 61.949974, 136.740316, 71.491818),\n (136.740316, 71.491818, 126.717793, 71.491818),\n (126.717793, 61.949974, 126.717793, 71.491818),\n (136.740316, 61.949974, 126.717793, 61.949974),\n (150.740316, 85.491818, 160.28216, 85.491818),\n (160.28216, 85.491818, 160.28216, 172.049974),\n (150.740316, 172.049974, 160.28216, 172.049974),\n (150.740316, 85.491818, 150.740316, 172.049974)\n]\nVISIBLE_CIRCLES = [\n\n]\nVISIBLE_ARCS = [\n\n]\nHIDDEN_SEGMENTS = [\n\n]\n# (orient, text, p1, p2, base) for linear; (orient, text, center, radius, angle) for diameter\nDIMENSIONS = [\n ('horizontal', '11.5789', (136.7403, 172.05), (126.7178, 172.05), (131.7291, 161.05)),\n ('vertical', '100', (136.7403, 85.4918), (136.7403, 172.05), (125.7403, 128.7709)),\n ('horizontal', '11.0236', (150.7403, 85.4918), (160.2822, 85.4918), (155.5113, 96.4918))\n]\n\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\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\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,\n angle=(0 if d[0] == \"horizontal\" else 90),\n 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,\n 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,\n text=text, dimstyle=\"EZDXF\").render()\n\n doc.saveas(out_path)\n\n\nif __name__ == \"__main__\":\n out = sys.argv[1] if len(sys.argv) > 1 else \"0023_00232794_gt.dxf\"\n draw(out)\n print(\"wrote\", out)\n```"}], "images": ["images/0023_00232794.png"], "id": "0023_00232794"} {"messages": [{"role": "user", "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 69.47 mm tall. It is extruded to a thickness of 5.21 mm."}, {"role": "assistant", "content": "```python\n#!/usr/bin/env python3\n# -*- coding: utf-8 -*-\n# Ground-truth 2D engineering drawing for part: 0023_00237137\n# Self-contained: reproduces the three-view DXF via ezdxf, NO FreeCAD needed.\n# Coordinates are A4 page millimetres (scale=1.2867890177653907, page=[297.0, 210.0]).\n# visible edges -> solid (layer OUTLINE); hidden edges -> dashed (layer HIDDEN)\n# dimensions -> real movable DIMENSION entities (text = true mm value)\n# Run: python 0023_00237137_gt.py [out.dxf]\nimport sys\nimport ezdxf\n\nSCALE = 1.2867890177653907\nPAGE = [297.0, 210.0]\n\nVISIBLE_SEGMENTS = [\n (197.488395, 172.049984, 197.488395, 82.65201),\n (197.488395, 82.65201, 68.809493, 82.65201),\n (68.809493, 82.65201, 68.809493, 172.049984),\n (68.809493, 172.049984, 197.488395, 172.049984),\n (197.488395, 61.949984, 197.488395, 68.65201),\n (197.488395, 68.65201, 68.809493, 68.65201),\n (68.809493, 61.949984, 68.809493, 68.65201),\n (197.488395, 61.949984, 68.809493, 61.949984),\n (211.488395, 82.65201, 218.190421, 82.65201),\n (218.190421, 82.65201, 218.190421, 172.049984),\n (211.488395, 172.049984, 218.190421, 172.049984),\n (211.488395, 82.65201, 211.488395, 172.049984)\n]\nVISIBLE_CIRCLES = [\n\n]\nVISIBLE_ARCS = [\n\n]\nHIDDEN_SEGMENTS = [\n\n]\n# (orient, text, p1, p2, base) for linear; (orient, text, center, radius, angle) for diameter\nDIMENSIONS = [\n ('horizontal', '100', (197.4884, 172.05), (68.8095, 172.05), (133.149, 161.05)),\n ('vertical', '69.4737', (197.4884, 82.652), (197.4884, 172.05), (186.4884, 127.351)),\n ('horizontal', '5.2083', (211.4884, 82.652), (218.1904, 82.652), (214.8394, 93.652))\n]\n\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\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\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,\n angle=(0 if d[0] == \"horizontal\" else 90),\n 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,\n 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,\n text=text, dimstyle=\"EZDXF\").render()\n\n doc.saveas(out_path)\n\n\nif __name__ == \"__main__\":\n out = sys.argv[1] if len(sys.argv) > 1 else \"0023_00237137_gt.dxf\"\n draw(out)\n print(\"wrote\", out)\n```"}], "images": ["images/0023_00237137.png"], "id": "0023_00237137"} {"messages": [{"role": "user", "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 66.32 mm wide and 100 mm tall. It is extruded to a thickness of 165.52 mm."}, {"role": "assistant", "content": "```python\n#!/usr/bin/env python3\n# -*- coding: utf-8 -*-\n# Ground-truth 2D engineering drawing for part: 0023_00239444\n# Self-contained: reproduces the three-view DXF via ezdxf, NO FreeCAD needed.\n# Coordinates are A4 page millimetres (scale=0.3619350649350654, page=[297.0, 210.0]).\n# visible edges -> solid (layer OUTLINE); hidden edges -> dashed (layer HIDDEN)\n# dimensions -> real movable DIMENSION entities (text = true mm value)\n# Run: python 0023_00239444_gt.py [out.dxf]\nimport sys\nimport ezdxf\n\nSCALE = 0.3619350649350654\nPAGE = [297.0, 210.0]\n\nVISIBLE_SEGMENTS = [\n (118.547763, 172.050004, 118.547763, 135.856497),\n (118.547763, 135.856497, 94.545754, 135.856497),\n (94.545754, 135.856497, 94.545754, 172.050004),\n (94.545754, 172.050004, 118.547763, 172.050004),\n (118.547763, 61.950004, 118.547763, 121.856497),\n (118.547763, 121.856497, 94.545754, 121.856497),\n (94.545754, 61.950004, 94.545754, 121.856497),\n (118.547763, 61.950004, 94.545754, 61.950004),\n (132.547763, 135.856497, 192.454257, 135.856497),\n (192.454257, 135.856497, 192.454257, 172.050004),\n (132.547763, 172.050004, 192.454257, 172.050004),\n (132.547763, 135.856497, 132.547763, 172.050004)\n]\nVISIBLE_CIRCLES = [\n\n]\nVISIBLE_ARCS = [\n\n]\nHIDDEN_SEGMENTS = [\n\n]\n# (orient, text, p1, p2, base) for linear; (orient, text, center, radius, angle) for diameter\nDIMENSIONS = [\n ('horizontal', '66.3158', (118.5478, 172.05), (94.5457, 172.05), (106.5468, 161.05)),\n ('vertical', '100', (118.5478, 135.8565), (118.5478, 172.05), (107.5478, 153.9532)),\n ('horizontal', '165.517', (132.5478, 135.8565), (192.4542, 135.8565), (162.501, 146.8565))\n]\n\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\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\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,\n angle=(0 if d[0] == \"horizontal\" else 90),\n 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,\n 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,\n text=text, dimstyle=\"EZDXF\").render()\n\n doc.saveas(out_path)\n\n\nif __name__ == \"__main__\":\n out = sys.argv[1] if len(sys.argv) > 1 else \"0023_00239444_gt.dxf\"\n draw(out)\n print(\"wrote\", out)\n```"}], "images": ["images/0023_00239444.png"], "id": "0023_00239444"} {"messages": [{"role": "user", "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 66.32 mm tall. It is extruded to a thickness of 133.33 mm."}, {"role": "assistant", "content": "```python\n#!/usr/bin/env python3\n# -*- coding: utf-8 -*-\n# Ground-truth 2D engineering drawing for part: 0023_00239450\n# Self-contained: reproduces the three-view DXF via ezdxf, NO FreeCAD needed.\n# Coordinates are A4 page millimetres (scale=0.48134446397188907, page=[297.0, 210.0]).\n# visible edges -> solid (layer OUTLINE); hidden edges -> dashed (layer HIDDEN)\n# dimensions -> real movable DIMENSION entities (text = true mm value)\n# Run: python 0023_00239450_gt.py [out.dxf]\nimport sys\nimport ezdxf\n\nSCALE = 0.48134446397188907\nPAGE = [297.0, 210.0]\n\nVISIBLE_SEGMENTS = [\n (128.477577, 172.050023, 128.477577, 140.129285),\n (128.477577, 140.129285, 80.343131, 140.129285),\n (80.343131, 140.129285, 80.343131, 172.050023),\n (80.343131, 172.050023, 128.477577, 172.050023),\n (128.477577, 61.950023, 128.477577, 126.129285),\n (128.477577, 126.129285, 80.343131, 126.129285),\n (80.343131, 61.950023, 80.343131, 126.129285),\n (128.477577, 61.950023, 80.343131, 61.950023),\n (142.477577, 140.129285, 206.656839, 140.129285),\n (206.656839, 140.129285, 206.656839, 172.050023),\n (142.477577, 172.050023, 206.656839, 172.050023),\n (142.477577, 140.129285, 142.477577, 172.050023)\n]\nVISIBLE_CIRCLES = [\n\n]\nVISIBLE_ARCS = [\n\n]\nHIDDEN_SEGMENTS = [\n\n]\n# (orient, text, p1, p2, base) for linear; (orient, text, center, radius, angle) for diameter\nDIMENSIONS = [\n ('horizontal', '100', (128.4776, 172.05), (80.3431, 172.05), (104.4104, 161.05)),\n ('vertical', '66.3158', (128.4776, 140.1293), (128.4776, 172.05), (117.4776, 156.0896)),\n ('horizontal', '133.333', (142.4776, 140.1293), (206.6568, 140.1293), (174.5672, 151.1293))\n]\n\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\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\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,\n angle=(0 if d[0] == \"horizontal\" else 90),\n 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,\n 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,\n text=text, dimstyle=\"EZDXF\").render()\n\n doc.saveas(out_path)\n\n\nif __name__ == \"__main__\":\n out = sys.argv[1] if len(sys.argv) > 1 else \"0023_00239450_gt.dxf\"\n draw(out)\n print(\"wrote\", out)\n```"}], "images": ["images/0023_00239450.png"], "id": "0023_00239450"} {"messages": [{"role": "user", "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 72.63 mm tall. It is extruded to a thickness of 3.12 mm."}, {"role": "assistant", "content": "```python\n#!/usr/bin/env python3\n# -*- coding: utf-8 -*-\n# Ground-truth 2D engineering drawing for part: 0023_00239579\n# Self-contained: reproduces the three-view DXF via ezdxf, NO FreeCAD needed.\n# Coordinates are A4 page millimetres (scale=1.2685366912722607, page=[297.0, 210.0]).\n# visible edges -> solid (layer OUTLINE); hidden edges -> dashed (layer HIDDEN)\n# dimensions -> real movable DIMENSION entities (text = true mm value)\n# Run: python 0023_00239579_gt.py [out.dxf]\nimport sys\nimport ezdxf\n\nSCALE = 1.2685366912722607\nPAGE = [297.0, 210.0]\n\nVISIBLE_SEGMENTS = [\n (197.944718, 172.050014, 197.944718, 79.914191),\n (197.944718, 79.914191, 71.091049, 79.914191),\n (71.091049, 79.914191, 71.091049, 172.050014),\n (71.091049, 172.050014, 197.944718, 172.050014),\n (197.944718, 61.950014, 197.944718, 65.914191),\n (197.944718, 65.914191, 71.091049, 65.914191),\n (71.091049, 61.950014, 71.091049, 65.914191),\n (197.944718, 61.950014, 71.091049, 61.950014),\n (211.944718, 79.914191, 215.908896, 79.914191),\n (215.908896, 79.914191, 215.908896, 172.050014),\n (211.944718, 172.050014, 215.908896, 172.050014),\n (211.944718, 79.914191, 211.944718, 172.050014)\n]\nVISIBLE_CIRCLES = [\n\n]\nVISIBLE_ARCS = [\n\n]\nHIDDEN_SEGMENTS = [\n\n]\n# (orient, text, p1, p2, base) for linear; (orient, text, center, radius, angle) for diameter\nDIMENSIONS = [\n ('horizontal', '100', (197.9447, 172.05), (71.0911, 172.05), (134.5179, 161.05)),\n ('vertical', '72.6316', (197.9447, 79.9142), (197.9447, 172.05), (186.9447, 125.9821)),\n ('horizontal', '3.125', (211.9447, 79.9142), (215.9089, 79.9142), (213.9268, 90.9142))\n]\n\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\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\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,\n angle=(0 if d[0] == \"horizontal\" else 90),\n 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,\n 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,\n text=text, dimstyle=\"EZDXF\").render()\n\n doc.saveas(out_path)\n\n\nif __name__ == \"__main__\":\n out = sys.argv[1] if len(sys.argv) > 1 else \"0023_00239579_gt.dxf\"\n draw(out)\n print(\"wrote\", out)\n```"}], "images": ["images/0023_00239579.png"], "id": "0023_00239579"} {"messages": [{"role": "user", "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 56.52 mm."}, {"role": "assistant", "content": "```python\n#!/usr/bin/env python3\n# -*- coding: utf-8 -*-\n# Ground-truth 2D engineering drawing for part: 0024_00243090\n# Self-contained: reproduces the three-view DXF via ezdxf, NO FreeCAD needed.\n# Coordinates are A4 page millimetres (scale=0.938783333333332, page=[297.0, 210.0]).\n# visible edges -> solid (layer OUTLINE); hidden edges -> dashed (layer HIDDEN)\n# dimensions -> real movable DIMENSION entities (text = true mm value)\n# Run: python 0024_00243090_gt.py [out.dxf]\nimport sys\nimport ezdxf\n\nSCALE = 0.938783333333332\nPAGE = [297.0, 210.0]\n\nVISIBLE_SEGMENTS = [\n (156.908313, 170.788807, 156.908313, 130.272895),\n (156.908313, 130.272895, 63.02998, 130.272895),\n (63.02998, 130.272895, 63.02998, 170.788807),\n (63.02998, 170.788807, 156.908313, 170.788807),\n (156.908313, 63.211228, 156.908313, 116.272895),\n (156.908313, 116.272895, 63.02998, 116.272895),\n (63.02998, 63.211228, 63.02998, 116.272895),\n (156.908313, 63.211228, 63.02998, 63.211228),\n (170.908313, 130.272895, 223.96998, 130.272895),\n (223.96998, 130.272895, 223.96998, 170.788807),\n (170.908313, 170.788807, 223.96998, 170.788807),\n (170.908313, 130.272895, 170.908313, 170.788807)\n]\nVISIBLE_CIRCLES = [\n\n]\nVISIBLE_ARCS = [\n\n]\nHIDDEN_SEGMENTS = [\n\n]\n# (orient, text, p1, p2, base) for linear; (orient, text, center, radius, angle) for diameter\nDIMENSIONS = [\n ('horizontal', '100', (156.9083, 170.7888), (63.03, 170.7888), (109.9692, 159.7888)),\n ('vertical', '43.1579', (156.9083, 130.2729), (156.9083, 170.7888), (145.9083, 150.5308)),\n ('horizontal', '56.5217', (170.9083, 130.2729), (223.97, 130.2729), (197.4391, 141.2729))\n]\n\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\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\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,\n angle=(0 if d[0] == \"horizontal\" else 90),\n 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,\n 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,\n text=text, dimstyle=\"EZDXF\").render()\n\n doc.saveas(out_path)\n\n\nif __name__ == \"__main__\":\n out = sys.argv[1] if len(sys.argv) > 1 else \"0024_00243090_gt.dxf\"\n draw(out)\n print(\"wrote\", out)\n```"}], "images": ["images/0024_00243090.png"], "id": "0024_00243090"} {"messages": [{"role": "user", "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 69.47 mm wide and 100 mm tall. It is extruded to a thickness of 17.18 mm."}, {"role": "assistant", "content": "```python\n#!/usr/bin/env python3\n# -*- coding: utf-8 -*-\n# Ground-truth 2D engineering drawing for part: 0024_00245508\n# Self-contained: reproduces the three-view DXF via ezdxf, NO FreeCAD needed.\n# Coordinates are A4 page millimetres (scale=0.8201204188481847, page=[297.0, 210.0]).\n# visible edges -> solid (layer OUTLINE); hidden edges -> dashed (layer HIDDEN)\n# dimensions -> real movable DIMENSION entities (text = true mm value)\n# Run: python 0024_00245508_gt.py [out.dxf]\nimport sys\nimport ezdxf\n\nSCALE = 0.8201204188481847\nPAGE = [297.0, 210.0]\n\nVISIBLE_SEGMENTS = [\n (157.944466, 172.050025, 157.944466, 90.037983),\n (157.944466, 90.037983, 100.967679, 90.037983),\n (100.967679, 90.037983, 100.967679, 172.050025),\n (100.967679, 172.050025, 157.944466, 172.050025),\n (157.944466, 61.950025, 157.944466, 76.037983),\n (157.944466, 76.037983, 100.967679, 76.037983),\n (100.967679, 61.950025, 100.967679, 76.037983),\n (157.944466, 61.950025, 100.967679, 61.950025),\n (171.944466, 90.037983, 186.032424, 90.037983),\n (186.032424, 90.037983, 186.032424, 172.050025),\n (171.944466, 172.050025, 186.032424, 172.050025),\n (171.944466, 90.037983, 171.944466, 172.050025)\n]\nVISIBLE_CIRCLES = [\n\n]\nVISIBLE_ARCS = [\n\n]\nHIDDEN_SEGMENTS = [\n\n]\n# (orient, text, p1, p2, base) for linear; (orient, text, center, radius, angle) for diameter\nDIMENSIONS = [\n ('horizontal', '69.4737', (157.9445, 172.05), (100.9677, 172.05), (129.4561, 161.05)),\n ('vertical', '100', (157.9445, 90.038), (157.9445, 172.05), (146.9445, 131.044)),\n ('horizontal', '17.1779', (171.9444, 90.038), (186.0324, 90.038), (178.9884, 101.038))\n]\n\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\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\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,\n angle=(0 if d[0] == \"horizontal\" else 90),\n 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,\n 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,\n text=text, dimstyle=\"EZDXF\").render()\n\n doc.saveas(out_path)\n\n\nif __name__ == \"__main__\":\n out = sys.argv[1] if len(sys.argv) > 1 else \"0024_00245508_gt.dxf\"\n draw(out)\n print(\"wrote\", out)\n```"}], "images": ["images/0024_00245508.png"], "id": "0024_00245508"} {"messages": [{"role": "user", "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 19.79 mm."}, {"role": "assistant", "content": "```python\n#!/usr/bin/env python3\n# -*- coding: utf-8 -*-\n# Ground-truth 2D engineering drawing for part: 0024_00246025\n# Self-contained: reproduces the three-view DXF via ezdxf, NO FreeCAD needed.\n# Coordinates are A4 page millimetres (scale=1.2043864229764962, page=[297.0, 210.0]).\n# visible edges -> solid (layer OUTLINE); hidden edges -> dashed (layer HIDDEN)\n# dimensions -> real movable DIMENSION entities (text = true mm value)\n# Run: python 0024_00246025_gt.py [out.dxf]\nimport sys\nimport ezdxf\n\nSCALE = 1.2043864229764962\nPAGE = [297.0, 210.0]\n\nVISIBLE_SEGMENTS = [\n (184.800926, 172.049991, 184.800926, 99.786806),\n (184.800926, 99.786806, 64.362283, 99.786806),\n (64.362283, 99.786806, 64.362283, 172.049991),\n (64.362283, 172.049991, 184.800926, 172.049991),\n (184.800926, 61.949991, 184.800926, 85.786806),\n (184.800926, 85.786806, 64.362283, 85.786806),\n (64.362283, 61.949991, 64.362283, 85.786806),\n (184.800926, 61.949991, 64.362283, 61.949991),\n (198.800926, 99.786806, 222.63774, 99.786806),\n (222.63774, 99.786806, 222.63774, 172.049991),\n (198.800926, 172.049991, 222.63774, 172.049991),\n (198.800926, 99.786806, 198.800926, 172.049991)\n]\nVISIBLE_CIRCLES = [\n\n]\nVISIBLE_ARCS = [\n\n]\nHIDDEN_SEGMENTS = [\n\n]\n# (orient, text, p1, p2, base) for linear; (orient, text, center, radius, angle) for diameter\nDIMENSIONS = [\n ('horizontal', '100', (184.8009, 172.05), (64.3623, 172.05), (124.5816, 161.05)),\n ('vertical', '60', (184.8009, 99.7868), (184.8009, 172.05), (173.8009, 135.9184)),\n ('horizontal', '19.7917', (198.8009, 99.7868), (222.6378, 99.7868), (210.7193, 110.7868))\n]\n\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\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\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,\n angle=(0 if d[0] == \"horizontal\" else 90),\n 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,\n 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,\n text=text, dimstyle=\"EZDXF\").render()\n\n doc.saveas(out_path)\n\n\nif __name__ == \"__main__\":\n out = sys.argv[1] if len(sys.argv) > 1 else \"0024_00246025_gt.dxf\"\n draw(out)\n print(\"wrote\", out)\n```"}], "images": ["images/0024_00246025.png"], "id": "0024_00246025"} {"messages": [{"role": "user", "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 93.68 mm wide and 100 mm tall. It is extruded to a thickness of 50 mm."}, {"role": "assistant", "content": "```python\n#!/usr/bin/env python3\n# -*- coding: utf-8 -*-\n# Ground-truth 2D engineering drawing for part: 0025_00250541\n# Self-contained: reproduces the three-view DXF via ezdxf, NO FreeCAD needed.\n# Coordinates are A4 page millimetres (scale=0.4804999999999999, page=[297.0, 210.0]).\n# visible edges -> solid (layer OUTLINE); hidden edges -> dashed (layer HIDDEN)\n# dimensions -> real movable DIMENSION entities (text = true mm value)\n# Run: python 0025_00250541_gt.py [out.dxf]\nimport sys\nimport ezdxf\n\nSCALE = 0.4804999999999999\nPAGE = [297.0, 210.0]\n\nVISIBLE_SEGMENTS = [\n (134.982613, 124.0, 134.982613, 172.05),\n (89.967349, 124.0, 134.982613, 124.0),\n (134.982613, 172.05, 89.967349, 172.05),\n (89.967349, 172.05, 89.967349, 124.0),\n (134.982613, 61.95, 134.982613, 110.0),\n (89.967349, 61.95, 89.967349, 110.0),\n (89.967349, 61.95, 134.982613, 61.95),\n (89.967349, 110.0, 134.982613, 110.0),\n (148.982613, 124.0, 197.032613, 124.0),\n (197.032613, 172.05, 148.982613, 172.05),\n (148.982613, 172.05, 148.982613, 124.0),\n (197.032613, 172.05, 197.032613, 124.0)\n]\nVISIBLE_CIRCLES = [\n\n]\nVISIBLE_ARCS = [\n\n]\nHIDDEN_SEGMENTS = [\n\n]\n# (orient, text, p1, p2, base) for linear; (orient, text, center, radius, angle) for diameter\nDIMENSIONS = [\n ('horizontal', '93.6842', (134.9826, 124.0), (89.9674, 124.0), (112.475, 113.0)),\n ('vertical', '100', (134.9826, 172.05), (134.9826, 124.0), (145.9826, 148.025)),\n ('horizontal', '100', (197.0326, 172.05), (148.9826, 172.05), (173.0076, 161.05))\n]\n\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\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\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,\n angle=(0 if d[0] == \"horizontal\" else 90),\n 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,\n 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,\n text=text, dimstyle=\"EZDXF\").render()\n\n doc.saveas(out_path)\n\n\nif __name__ == \"__main__\":\n out = sys.argv[1] if len(sys.argv) > 1 else \"0025_00250541_gt.dxf\"\n draw(out)\n print(\"wrote\", out)\n```"}], "images": ["images/0025_00250541.png"], "id": "0025_00250541"} {"messages": [{"role": "user", "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 46.32 mm tall. It is extruded to a thickness of 22.79 mm."}, {"role": "assistant", "content": "```python\n#!/usr/bin/env python3\n# -*- coding: utf-8 -*-\n# Ground-truth 2D engineering drawing for part: 0025_00252485\n# Self-contained: reproduces the three-view DXF via ezdxf, NO FreeCAD needed.\n# Coordinates are A4 page millimetres (scale=1.1966371257485888, page=[297.0, 210.0]).\n# visible edges -> solid (layer OUTLINE); hidden edges -> dashed (layer HIDDEN)\n# dimensions -> real movable DIMENSION entities (text = true mm value)\n# Run: python 0025_00252485_gt.py [out.dxf]\nimport sys\nimport ezdxf\n\nSCALE = 1.1966371257485888\nPAGE = [297.0, 210.0]\n\nVISIBLE_SEGMENTS = [\n (182.693705, 165.349796, 182.693705, 109.926603),\n (182.693705, 109.926603, 63.029992, 109.926603),\n (63.029992, 109.926603, 63.029992, 165.349796),\n (63.029992, 165.349796, 182.693705, 165.349796),\n (182.693705, 68.650315, 182.693705, 95.926603),\n (182.693705, 95.926603, 63.029992, 95.926603),\n (63.029992, 68.650315, 63.029992, 95.926603),\n (182.693705, 68.650315, 63.029992, 68.650315),\n (196.693705, 109.926603, 223.969992, 109.926603),\n (223.969992, 109.926603, 223.969992, 165.349796),\n (196.693705, 165.349796, 223.969992, 165.349796),\n (196.693705, 109.926603, 196.693705, 165.349796)\n]\nVISIBLE_CIRCLES = [\n\n]\nVISIBLE_ARCS = [\n\n]\nHIDDEN_SEGMENTS = [\n\n]\n# (orient, text, p1, p2, base) for linear; (orient, text, center, radius, angle) for diameter\nDIMENSIONS = [\n ('horizontal', '100', (182.6937, 165.3498), (63.03, 165.3498), (122.8619, 154.3498)),\n ('vertical', '46.3158', (182.6937, 109.9266), (182.6937, 165.3498), (171.6937, 137.6382)),\n ('horizontal', '22.7941', (196.6937, 109.9266), (223.97, 109.9266), (210.3318, 120.9266))\n]\n\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\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\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,\n angle=(0 if d[0] == \"horizontal\" else 90),\n 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,\n 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,\n text=text, dimstyle=\"EZDXF\").render()\n\n doc.saveas(out_path)\n\n\nif __name__ == \"__main__\":\n out = sys.argv[1] if len(sys.argv) > 1 else \"0025_00252485_gt.dxf\"\n draw(out)\n print(\"wrote\", out)\n```"}], "images": ["images/0025_00252485.png"], "id": "0025_00252485"} {"messages": [{"role": "user", "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 60 mm."}, {"role": "assistant", "content": "```python\n#!/usr/bin/env python3\n# -*- coding: utf-8 -*-\n# Ground-truth 2D engineering drawing for part: 0026_00260547\n# Self-contained: reproduces the three-view DXF via ezdxf, NO FreeCAD needed.\n# Coordinates are A4 page millimetres (scale=0.600625, page=[297.0, 210.0]).\n# visible edges -> solid (layer OUTLINE); hidden edges -> dashed (layer HIDDEN)\n# dimensions -> real movable DIMENSION entities (text = true mm value)\n# Run: python 0026_00260547_gt.py [out.dxf]\nimport sys\nimport ezdxf\n\nSCALE = 0.600625\nPAGE = [297.0, 210.0]\n\nVISIBLE_SEGMENTS = [\n (148.5125, 172.05, 148.5125, 111.9875),\n (148.5125, 111.9875, 88.45, 111.9875),\n (88.45, 111.9875, 88.45, 172.05),\n (88.45, 172.05, 148.5125, 172.05),\n (148.5125, 61.95, 148.5125, 97.9875),\n (148.5125, 97.9875, 88.45, 97.9875),\n (88.45, 61.95, 88.45, 97.9875),\n (148.5125, 61.95, 88.45, 61.95),\n (162.5125, 111.9875, 198.55, 111.9875),\n (198.55, 111.9875, 198.55, 172.05),\n (162.5125, 172.05, 198.55, 172.05),\n (162.5125, 111.9875, 162.5125, 172.05)\n]\nVISIBLE_CIRCLES = [\n\n]\nVISIBLE_ARCS = [\n\n]\nHIDDEN_SEGMENTS = [\n\n]\n# (orient, text, p1, p2, base) for linear; (orient, text, center, radius, angle) for diameter\nDIMENSIONS = [\n ('horizontal', '100', (148.5125, 172.05), (88.45, 172.05), (118.4812, 161.05)),\n ('vertical', '100', (148.5125, 111.9875), (148.5125, 172.05), (137.5125, 142.0188)),\n ('horizontal', '60', (162.5125, 111.9875), (198.55, 111.9875), (180.5312, 122.9875))\n]\n\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\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\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,\n angle=(0 if d[0] == \"horizontal\" else 90),\n 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,\n 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,\n text=text, dimstyle=\"EZDXF\").render()\n\n doc.saveas(out_path)\n\n\nif __name__ == \"__main__\":\n out = sys.argv[1] if len(sys.argv) > 1 else \"0026_00260547_gt.dxf\"\n draw(out)\n print(\"wrote\", out)\n```"}], "images": ["images/0026_00260547.png"], "id": "0026_00260547"} {"messages": [{"role": "user", "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 3.16 mm wide and 100 mm tall. It is extruded to a thickness of 872.73 mm."}, {"role": "assistant", "content": "```python\n#!/usr/bin/env python3\n# -*- coding: utf-8 -*-\n# Ground-truth 2D engineering drawing for part: 0026_00262425\n# Self-contained: reproduces the three-view DXF via ezdxf, NO FreeCAD needed.\n# Coordinates are A4 page millimetres (scale=0.09879439252337238, page=[297.0, 210.0]).\n# visible edges -> solid (layer OUTLINE); hidden edges -> dashed (layer HIDDEN)\n# dimensions -> real movable DIMENSION entities (text = true mm value)\n# Run: python 0026_00262425_gt.py [out.dxf]\nimport sys\nimport ezdxf\n\nSCALE = 0.09879439252337238\nPAGE = [297.0, 210.0]\n\nVISIBLE_SEGMENTS = [\n (93.545704, 162.170576, 93.545704, 172.050016),\n (93.545704, 172.050016, 93.233722, 172.050016),\n (93.233722, 172.050016, 93.233722, 162.170576),\n (93.233722, 162.170576, 93.545704, 162.170576),\n (93.545704, 148.170576, 93.545704, 61.950016),\n (93.233722, 148.170576, 93.233722, 61.950016),\n (93.233722, 61.950016, 93.545704, 61.950016),\n (93.233722, 148.170576, 93.545704, 148.170576),\n (193.766265, 172.050016, 107.545704, 172.050016),\n (107.545704, 172.050016, 107.545704, 162.170576),\n (193.766265, 162.170576, 107.545704, 162.170576),\n (193.766265, 172.050016, 193.766265, 162.170576)\n]\nVISIBLE_CIRCLES = [\n\n]\nVISIBLE_ARCS = [\n\n]\nHIDDEN_SEGMENTS = [\n\n]\n# (orient, text, p1, p2, base) for linear; (orient, text, center, radius, angle) for diameter\nDIMENSIONS = [\n ('vertical', '3.1579', (93.5457, 162.1706), (93.2337, 162.1706), (93.3897, 151.1706)),\n ('vertical', '100', (93.5457, 172.05), (93.5457, 162.1706), (104.5457, 167.1103)),\n ('horizontal', '872.727', (193.7663, 172.05), (107.5457, 172.05), (150.656, 161.05))\n]\n\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\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\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,\n angle=(0 if d[0] == \"horizontal\" else 90),\n 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,\n 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,\n text=text, dimstyle=\"EZDXF\").render()\n\n doc.saveas(out_path)\n\n\nif __name__ == \"__main__\":\n out = sys.argv[1] if len(sys.argv) > 1 else \"0026_00262425_gt.dxf\"\n draw(out)\n print(\"wrote\", out)\n```"}], "images": ["images/0026_00262425.png"], "id": "0026_00262425"} {"messages": [{"role": "user", "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 10.53 mm wide and 100 mm tall. It is extruded to a thickness of 1.66 mm."}, {"role": "assistant", "content": "```python\n#!/usr/bin/env python3\n# -*- coding: utf-8 -*-\n# Ground-truth 2D engineering drawing for part: 0026_00263264\n# Self-contained: reproduces the three-view DXF via ezdxf, NO FreeCAD needed.\n# Coordinates are A4 page millimetres (scale=0.9453315217392133, page=[297.0, 210.0]).\n# visible edges -> solid (layer OUTLINE); hidden edges -> dashed (layer HIDDEN)\n# dimensions -> real movable DIMENSION entities (text = true mm value)\n# Run: python 0026_00263264_gt.py [out.dxf]\nimport sys\nimport ezdxf\n\nSCALE = 0.9453315217392133\nPAGE = [297.0, 210.0]\n\nVISIBLE_SEGMENTS = [\n (140.692002, 77.516869, 140.692002, 172.050021),\n (140.692002, 172.050021, 130.741144, 172.050021),\n (130.741144, 172.050021, 130.741144, 77.516869),\n (130.741144, 77.516869, 140.692002, 77.516869),\n (140.692002, 63.516869, 140.692002, 61.950021),\n (130.741144, 63.516869, 130.741144, 61.950021),\n (130.741144, 61.950021, 140.692002, 61.950021),\n (130.741144, 63.516869, 140.692002, 63.516869),\n (156.25885, 172.050021, 154.692002, 172.050021),\n (154.692002, 172.050021, 154.692002, 77.516869),\n (156.25885, 77.516869, 154.692002, 77.516869),\n (156.25885, 172.050021, 156.25885, 77.516869)\n]\nVISIBLE_CIRCLES = [\n\n]\nVISIBLE_ARCS = [\n\n]\nHIDDEN_SEGMENTS = [\n\n]\n# (orient, text, p1, p2, base) for linear; (orient, text, center, radius, angle) for diameter\nDIMENSIONS = [\n ('horizontal', '10.5263', (140.692, 77.5169), (130.7411, 77.5169), (135.7165, 66.5169)),\n ('vertical', '100', (140.692, 172.05), (140.692, 77.5169), (151.692, 124.7834)),\n ('horizontal', '1.6575', (156.2589, 172.05), (154.692, 172.05), (155.4754, 161.05))\n]\n\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\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\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,\n angle=(0 if d[0] == \"horizontal\" else 90),\n 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,\n 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,\n text=text, dimstyle=\"EZDXF\").render()\n\n doc.saveas(out_path)\n\n\nif __name__ == \"__main__\":\n out = sys.argv[1] if len(sys.argv) > 1 else \"0026_00263264_gt.dxf\"\n draw(out)\n print(\"wrote\", out)\n```"}], "images": ["images/0026_00263264.png"], "id": "0026_00263264"} {"messages": [{"role": "user", "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 89.47 mm wide and 100 mm tall. It is extruded to a thickness of -19.13 mm."}, {"role": "assistant", "content": "```python\n#!/usr/bin/env python3\n# -*- coding: utf-8 -*-\n# Ground-truth 2D engineering drawing for part: 0026_00263406\n# Self-contained: reproduces the three-view DXF via ezdxf, NO FreeCAD needed.\n# Coordinates are A4 page millimetres (scale=0.8066788321168473, page=[297.0, 210.0]).\n# visible edges -> solid (layer OUTLINE); hidden edges -> dashed (layer HIDDEN)\n# dimensions -> real movable DIMENSION entities (text = true mm value)\n# Run: python 0026_00263406_gt.py [out.dxf]\nimport sys\nimport ezdxf\n\nSCALE = 0.8066788321168473\nPAGE = [297.0, 210.0]\n\nVISIBLE_SEGMENTS = [\n (164.872182, 172.04999, 164.872182, 91.382107),\n (164.872182, 91.382107, 92.695655, 91.382107),\n (92.695655, 91.382107, 92.695655, 172.04999),\n (92.695655, 172.04999, 164.872182, 172.04999),\n (164.872182, 77.382107, 164.872182, 61.94999),\n (164.872182, 61.94999, 92.695655, 61.94999),\n (92.695655, 77.382107, 92.695655, 61.94999),\n (164.872182, 77.382107, 92.695655, 77.382107),\n (194.304299, 91.382107, 178.872182, 91.382107),\n (178.872182, 91.382107, 178.872182, 172.04999),\n (194.304299, 172.04999, 178.872182, 172.04999),\n (194.304299, 91.382107, 194.304299, 172.04999)\n]\nVISIBLE_CIRCLES = [\n\n]\nVISIBLE_ARCS = [\n\n]\nHIDDEN_SEGMENTS = [\n\n]\n# (orient, text, p1, p2, base) for linear; (orient, text, center, radius, angle) for diameter\nDIMENSIONS = [\n ('horizontal', '89.4737', (164.8722, 172.05), (92.6956, 172.05), (128.7839, 161.05)),\n ('vertical', '100', (164.8722, 91.3821), (164.8722, 172.05), (153.8722, 131.716)),\n ('horizontal', '19.1304', (194.3043, 91.3821), (178.8722, 91.3821), (186.5883, 80.3821))\n]\n\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\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\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,\n angle=(0 if d[0] == \"horizontal\" else 90),\n 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,\n 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,\n text=text, dimstyle=\"EZDXF\").render()\n\n doc.saveas(out_path)\n\n\nif __name__ == \"__main__\":\n out = sys.argv[1] if len(sys.argv) > 1 else \"0026_00263406_gt.dxf\"\n draw(out)\n print(\"wrote\", out)\n```"}], "images": ["images/0026_00263406.png"], "id": "0026_00263406"} {"messages": [{"role": "user", "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 50 mm."}, {"role": "assistant", "content": "```python\n#!/usr/bin/env python3\n# -*- coding: utf-8 -*-\n# Ground-truth 2D engineering drawing for part: 0026_00264023\n# Self-contained: reproduces the three-view DXF via ezdxf, NO FreeCAD needed.\n# Coordinates are A4 page millimetres (scale=0.770421940928271, page=[297.0, 210.0]).\n# visible edges -> solid (layer OUTLINE); hidden edges -> dashed (layer HIDDEN)\n# dimensions -> real movable DIMENSION entities (text = true mm value)\n# Run: python 0026_00264023_gt.py [out.dxf]\nimport sys\nimport ezdxf\n\nSCALE = 0.770421940928271\nPAGE = [297.0, 210.0]\n\nVISIBLE_SEGMENTS = [\n (155.760519, 114.471098, 155.760519, 172.050001),\n (155.760519, 172.050001, 78.718325, 172.050001),\n (78.718325, 172.050001, 78.718325, 114.471098),\n (78.718325, 114.471098, 155.760519, 114.471098),\n (155.760519, 100.471098, 155.760519, 61.950001),\n (78.718325, 100.471098, 78.718325, 61.950001),\n (78.718325, 61.950001, 155.760519, 61.950001),\n (78.718325, 100.471098, 155.760519, 100.471098),\n (208.281616, 172.050001, 169.760519, 172.050001),\n (169.760519, 172.050001, 169.760519, 114.471098),\n (208.281616, 114.471098, 169.760519, 114.471098),\n (208.281616, 172.050001, 208.281616, 114.471098)\n]\nVISIBLE_CIRCLES = [\n\n]\nVISIBLE_ARCS = [\n\n]\nHIDDEN_SEGMENTS = [\n\n]\n# (orient, text, p1, p2, base) for linear; (orient, text, center, radius, angle) for diameter\nDIMENSIONS = [\n ('horizontal', '100', (155.7605, 114.4711), (78.7184, 114.4711), (117.2395, 103.4711)),\n ('vertical', '74.7368', (155.7605, 172.05), (155.7605, 114.4711), (166.7605, 143.2606)),\n ('horizontal', '50', (208.2816, 172.05), (169.7605, 172.05), (189.0211, 161.05))\n]\n\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\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\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,\n angle=(0 if d[0] == \"horizontal\" else 90),\n 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,\n 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,\n text=text, dimstyle=\"EZDXF\").render()\n\n doc.saveas(out_path)\n\n\nif __name__ == \"__main__\":\n out = sys.argv[1] if len(sys.argv) > 1 else \"0026_00264023_gt.dxf\"\n draw(out)\n print(\"wrote\", out)\n```"}], "images": ["images/0026_00264023.png"], "id": "0026_00264023"} {"messages": [{"role": "user", "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 82.11 mm tall. It is extruded to a thickness of 27.08 mm."}, {"role": "assistant", "content": "```python\n#!/usr/bin/env python3\n# -*- coding: utf-8 -*-\n# Ground-truth 2D engineering drawing for part: 0026_00264092\n# Self-contained: reproduces the three-view DXF via ezdxf, NO FreeCAD needed.\n# Coordinates are A4 page millimetres (scale=0.8801285398674439, page=[297.0, 210.0]).\n# visible edges -> solid (layer OUTLINE); hidden edges -> dashed (layer HIDDEN)\n# dimensions -> real movable DIMENSION entities (text = true mm value)\n# Run: python 0026_00264092_gt.py [out.dxf]\nimport sys\nimport ezdxf\n\nSCALE = 0.8801285398674439\nPAGE = [297.0, 210.0]\n\nVISIBLE_SEGMENTS = [\n (168.588008, 172.049991, 168.588008, 99.786806),\n (168.588008, 99.786806, 80.575154, 99.786806),\n (80.575154, 99.786806, 80.575154, 172.049991),\n (80.575154, 172.049991, 168.588008, 172.049991),\n (168.588008, 61.949991, 168.588008, 85.786806),\n (168.588008, 85.786806, 80.575154, 85.786806),\n (80.575154, 61.949991, 80.575154, 85.786806),\n (168.588008, 61.949991, 80.575154, 61.949991),\n (182.588008, 99.786806, 206.424822, 99.786806),\n (206.424822, 99.786806, 206.424822, 172.049991),\n (182.588008, 172.049991, 206.424822, 172.049991),\n (182.588008, 99.786806, 182.588008, 172.049991)\n]\nVISIBLE_CIRCLES = [\n\n]\nVISIBLE_ARCS = [\n\n]\nHIDDEN_SEGMENTS = [\n\n]\n# (orient, text, p1, p2, base) for linear; (orient, text, center, radius, angle) for diameter\nDIMENSIONS = [\n ('horizontal', '100', (168.588, 172.05), (80.5752, 172.05), (124.5816, 161.05)),\n ('vertical', '82.1053', (168.588, 99.7868), (168.588, 172.05), (157.588, 135.9184)),\n ('horizontal', '27.0833', (182.588, 99.7868), (206.4248, 99.7868), (194.5064, 110.7868))\n]\n\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\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\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,\n angle=(0 if d[0] == \"horizontal\" else 90),\n 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,\n 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,\n text=text, dimstyle=\"EZDXF\").render()\n\n doc.saveas(out_path)\n\n\nif __name__ == \"__main__\":\n out = sys.argv[1] if len(sys.argv) > 1 else \"0026_00264092_gt.dxf\"\n draw(out)\n print(\"wrote\", out)\n```"}], "images": ["images/0026_00264092.png"], "id": "0026_00264092"} {"messages": [{"role": "user", "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 0.53 mm."}, {"role": "assistant", "content": "```python\n#!/usr/bin/env python3\n# -*- coding: utf-8 -*-\n# Ground-truth 2D engineering drawing for part: 0026_00264842\n# Self-contained: reproduces the three-view DXF via ezdxf, NO FreeCAD needed.\n# Coordinates are A4 page millimetres (scale=0.9559153439153442, page=[297.0, 210.0]).\n# visible edges -> solid (layer OUTLINE); hidden edges -> dashed (layer HIDDEN)\n# dimensions -> real movable DIMENSION entities (text = true mm value)\n# Run: python 0026_00264842_gt.py [out.dxf]\nimport sys\nimport ezdxf\n\nSCALE = 0.9559153439153442\nPAGE = [297.0, 210.0]\n\nVISIBLE_SEGMENTS = [\n (184.041514, 172.050021, 184.041514, 76.458486),\n (184.041514, 76.458486, 88.449979, 76.458486),\n (88.449979, 76.458486, 88.449979, 172.050021),\n (88.449979, 172.050021, 184.041514, 172.050021),\n (184.041514, 61.950021, 184.041514, 62.458486),\n (184.041514, 62.458486, 88.449979, 62.458486),\n (88.449979, 61.950021, 88.449979, 62.458486),\n (184.041514, 61.950021, 88.449979, 61.950021),\n (198.041514, 76.458486, 198.549979, 76.458486),\n (198.549979, 76.458486, 198.549979, 172.050021),\n (198.041514, 172.050021, 198.549979, 172.050021),\n (198.041514, 76.458486, 198.041514, 172.050021)\n]\nVISIBLE_CIRCLES = [\n\n]\nVISIBLE_ARCS = [\n\n]\nHIDDEN_SEGMENTS = [\n\n]\n# (orient, text, p1, p2, base) for linear; (orient, text, center, radius, angle) for diameter\nDIMENSIONS = [\n ('horizontal', '100', (184.0415, 172.05), (88.45, 172.05), (136.2457, 161.05)),\n ('vertical', '100', (184.0415, 76.4585), (184.0415, 172.05), (173.0415, 124.2542)),\n ('horizontal', '0.5319', (198.0415, 76.4585), (198.55, 76.4585), (198.2958, 87.4585))\n]\n\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\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\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,\n angle=(0 if d[0] == \"horizontal\" else 90),\n 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,\n 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,\n text=text, dimstyle=\"EZDXF\").render()\n\n doc.saveas(out_path)\n\n\nif __name__ == \"__main__\":\n out = sys.argv[1] if len(sys.argv) > 1 else \"0026_00264842_gt.dxf\"\n draw(out)\n print(\"wrote\", out)\n```"}], "images": ["images/0026_00264842.png"], "id": "0026_00264842"} {"messages": [{"role": "user", "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 76.84 mm tall. It is extruded to a thickness of -3.65 mm."}, {"role": "assistant", "content": "```python\n#!/usr/bin/env python3\n# -*- coding: utf-8 -*-\n# Ground-truth 2D engineering drawing for part: 0026_00264870\n# Self-contained: reproduces the three-view DXF via ezdxf, NO FreeCAD needed.\n# Coordinates are A4 page millimetres (scale=1.1939677133710715, page=[297.0, 210.0]).\n# visible edges -> solid (layer OUTLINE); hidden edges -> dashed (layer HIDDEN)\n# dimensions -> real movable DIMENSION entities (text = true mm value)\n# Run: python 0026_00264870_gt.py [out.dxf]\nimport sys\nimport ezdxf\n\nSCALE = 1.1939677133710715\nPAGE = [297.0, 210.0]\n\nVISIBLE_SEGMENTS = [\n (194.021893, 172.049996, 194.021893, 80.303003),\n (194.021893, 80.303003, 74.625121, 80.303003),\n (74.625121, 80.303003, 74.625121, 172.049996),\n (74.625121, 172.049996, 194.021893, 172.049996),\n (194.021893, 66.303003, 194.021893, 61.949996),\n (194.021893, 61.949996, 74.625121, 61.949996),\n (74.625121, 66.303003, 74.625121, 61.949996),\n (194.021893, 66.303003, 74.625121, 66.303003),\n (212.3749, 80.303003, 208.021893, 80.303003),\n (208.021893, 80.303003, 208.021893, 172.049996),\n (212.3749, 172.049996, 208.021893, 172.049996),\n (212.3749, 80.303003, 212.3749, 172.049996)\n]\nVISIBLE_CIRCLES = [\n\n]\nVISIBLE_ARCS = [\n\n]\nHIDDEN_SEGMENTS = [\n\n]\n# (orient, text, p1, p2, base) for linear; (orient, text, center, radius, angle) for diameter\nDIMENSIONS = [\n ('horizontal', '100', (194.0219, 172.05), (74.6251, 172.05), (134.3235, 161.05)),\n ('vertical', '76.8421', (194.0219, 80.303), (194.0219, 172.05), (183.0219, 126.1765)),\n ('horizontal', '3.6458', (212.3749, 80.303), (208.0219, 80.303), (210.1984, 69.303))\n]\n\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\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\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,\n angle=(0 if d[0] == \"horizontal\" else 90),\n 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,\n 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,\n text=text, dimstyle=\"EZDXF\").render()\n\n doc.saveas(out_path)\n\n\nif __name__ == \"__main__\":\n out = sys.argv[1] if len(sys.argv) > 1 else \"0026_00264870_gt.dxf\"\n draw(out)\n print(\"wrote\", out)\n```"}], "images": ["images/0026_00264870.png"], "id": "0026_00264870"} {"messages": [{"role": "user", "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 77.08 mm."}, {"role": "assistant", "content": "```python\n#!/usr/bin/env python3\n# -*- coding: utf-8 -*-\n# Ground-truth 2D engineering drawing for part: 0026_00269809\n# Self-contained: reproduces the three-view DXF via ezdxf, NO FreeCAD needed.\n# Coordinates are A4 page millimetres (scale=0.8297788235294133, page=[297.0, 210.0]).\n# visible edges -> solid (layer OUTLINE); hidden edges -> dashed (layer HIDDEN)\n# dimensions -> real movable DIMENSION entities (text = true mm value)\n# Run: python 0026_00269809_gt.py [out.dxf]\nimport sys\nimport ezdxf\n\nSCALE = 0.8297788235294133\nPAGE = [297.0, 210.0]\n\nVISIBLE_SEGMENTS = [\n (146.007893, 171.266499, 146.007893, 140.6957),\n (146.007893, 140.6957, 63.030011, 140.6957),\n (63.030011, 140.6957, 63.030011, 171.266499),\n (63.030011, 171.266499, 146.007893, 171.266499),\n (146.007893, 62.733583, 146.007893, 126.6957),\n (146.007893, 126.6957, 63.030011, 126.6957),\n (63.030011, 62.733583, 63.030011, 126.6957),\n (146.007893, 62.733583, 63.030011, 62.733583),\n (160.007893, 140.6957, 223.970011, 140.6957),\n (223.970011, 140.6957, 223.970011, 171.266499),\n (160.007893, 171.266499, 223.970011, 171.266499),\n (160.007893, 140.6957, 160.007893, 171.266499)\n]\nVISIBLE_CIRCLES = [\n\n]\nVISIBLE_ARCS = [\n\n]\nHIDDEN_SEGMENTS = [\n\n]\n# (orient, text, p1, p2, base) for linear; (orient, text, center, radius, angle) for diameter\nDIMENSIONS = [\n ('horizontal', '100', (146.0079, 171.2665), (63.03, 171.2665), (104.5189, 160.2665)),\n ('vertical', '36.8421', (146.0079, 140.6957), (146.0079, 171.2665), (135.0079, 155.9811)),\n ('horizontal', '77.0833', (160.0079, 140.6957), (223.97, 140.6957), (191.9889, 151.6957))\n]\n\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\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\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,\n angle=(0 if d[0] == \"horizontal\" else 90),\n 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,\n 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,\n text=text, dimstyle=\"EZDXF\").render()\n\n doc.saveas(out_path)\n\n\nif __name__ == \"__main__\":\n out = sys.argv[1] if len(sys.argv) > 1 else \"0026_00269809_gt.dxf\"\n draw(out)\n print(\"wrote\", out)\n```"}], "images": ["images/0026_00269809.png"], "id": "0026_00269809"} {"messages": [{"role": "user", "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 2.08 mm."}, {"role": "assistant", "content": "```python\n#!/usr/bin/env python3\n# -*- coding: utf-8 -*-\n# Ground-truth 2D engineering drawing for part: 0027_00272495\n# Self-contained: reproduces the three-view DXF via ezdxf, NO FreeCAD needed.\n# Coordinates are A4 page millimetres (scale=1.410624000000009, page=[297.0, 210.0]).\n# visible edges -> solid (layer OUTLINE); hidden edges -> dashed (layer HIDDEN)\n# dimensions -> real movable DIMENSION entities (text = true mm value)\n# Run: python 0027_00272495_gt.py [out.dxf]\nimport sys\nimport ezdxf\n\nSCALE = 1.410624000000009\nPAGE = [297.0, 210.0]\n\nVISIBLE_SEGMENTS = [\n (204.0924, 150.696633, 204.0924, 103.180878),\n (63.03, 150.696633, 204.0924, 150.696633),\n (204.0924, 103.180878, 63.03, 103.180878),\n (63.03, 103.180878, 63.03, 150.696633),\n (204.0924, 83.303278, 204.0924, 89.180878),\n (204.0924, 89.180878, 63.03, 89.180878),\n (63.03, 83.303278, 63.03, 89.180878),\n (204.0924, 83.303278, 63.03, 83.303278),\n (223.97, 150.696633, 218.0924, 150.696633),\n (218.0924, 103.180878, 223.97, 103.180878),\n (223.97, 103.180878, 223.97, 150.696633),\n (218.0924, 103.180878, 218.0924, 150.696633)\n]\nVISIBLE_CIRCLES = [\n\n]\nVISIBLE_ARCS = [\n\n]\nHIDDEN_SEGMENTS = [\n\n]\n# (orient, text, p1, p2, base) for linear; (orient, text, center, radius, angle) for diameter\nDIMENSIONS = [\n ('horizontal', '100', (204.0924, 150.6966), (63.03, 150.6966), (133.5612, 139.6966)),\n ('vertical', '33.6842', (204.0924, 103.1809), (204.0924, 150.6966), (193.0924, 126.9387)),\n ('horizontal', '4.1667', (218.0924, 103.1809), (223.97, 103.1809), (221.0312, 114.1809))\n]\n\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\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\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,\n angle=(0 if d[0] == \"horizontal\" else 90),\n 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,\n 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,\n text=text, dimstyle=\"EZDXF\").render()\n\n doc.saveas(out_path)\n\n\nif __name__ == \"__main__\":\n out = sys.argv[1] if len(sys.argv) > 1 else \"0027_00272495_gt.dxf\"\n draw(out)\n print(\"wrote\", out)\n```"}], "images": ["images/0027_00272495.png"], "id": "0027_00272495"} {"messages": [{"role": "user", "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 95.79 mm tall. It is extruded to a thickness of 2.08 mm."}, {"role": "assistant", "content": "```python\n#!/usr/bin/env python3\n# -*- coding: utf-8 -*-\n# Ground-truth 2D engineering drawing for part: 0027_00274553\n# Self-contained: reproduces the three-view DXF via ezdxf, NO FreeCAD needed.\n# Coordinates are A4 page millimetres (scale=0.9818866233475225, page=[297.0, 210.0]).\n# visible edges -> solid (layer OUTLINE); hidden edges -> dashed (layer HIDDEN)\n# dimensions -> real movable DIMENSION entities (text = true mm value)\n# Run: python 0027_00274553_gt.py [out.dxf]\nimport sys\nimport ezdxf\n\nSCALE = 0.9818866233475225\nPAGE = [297.0, 210.0]\n\nVISIBLE_SEGMENTS = [\n (184.571513, 172.050002, 184.571513, 77.995599),\n (184.571513, 77.995599, 86.382851, 77.995599),\n (86.382851, 77.995599, 86.382851, 172.050002),\n (86.382851, 172.050002, 184.571513, 172.050002),\n (184.571513, 61.950002, 184.571513, 63.995599),\n (184.571513, 63.995599, 86.382851, 63.995599),\n (86.382851, 61.950002, 86.382851, 63.995599),\n (184.571513, 61.950002, 86.382851, 61.950002),\n (198.571513, 77.995599, 200.61711, 77.995599),\n (200.61711, 77.995599, 200.61711, 172.050002),\n (198.571513, 172.050002, 200.61711, 172.050002),\n (198.571513, 77.995599, 198.571513, 172.050002)\n]\nVISIBLE_CIRCLES = [\n\n]\nVISIBLE_ARCS = [\n\n]\nHIDDEN_SEGMENTS = [\n\n]\n# (orient, text, p1, p2, base) for linear; (orient, text, center, radius, angle) for diameter\nDIMENSIONS = [\n ('horizontal', '100', (184.5715, 172.05), (86.3829, 172.05), (135.4772, 161.05)),\n ('vertical', '95.7895', (184.5715, 77.9956), (184.5715, 172.05), (173.5715, 125.0228)),\n ('horizontal', '2.0833', (198.5715, 77.9956), (200.6171, 77.9956), (199.5943, 88.9956))\n]\n\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\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\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,\n angle=(0 if d[0] == \"horizontal\" else 90),\n 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,\n 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,\n text=text, dimstyle=\"EZDXF\").render()\n\n doc.saveas(out_path)\n\n\nif __name__ == \"__main__\":\n out = sys.argv[1] if len(sys.argv) > 1 else \"0027_00274553_gt.dxf\"\n draw(out)\n print(\"wrote\", out)\n```"}], "images": ["images/0027_00274553.png"], "id": "0027_00274553"} {"messages": [{"role": "user", "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 95.79 mm tall. It is extruded to a thickness of 2.08 mm."}, {"role": "assistant", "content": "```python\n#!/usr/bin/env python3\n# -*- coding: utf-8 -*-\n# Ground-truth 2D engineering drawing for part: 0027_00274628\n# Self-contained: reproduces the three-view DXF via ezdxf, NO FreeCAD needed.\n# Coordinates are A4 page millimetres (scale=0.9818866233475225, page=[297.0, 210.0]).\n# visible edges -> solid (layer OUTLINE); hidden edges -> dashed (layer HIDDEN)\n# dimensions -> real movable DIMENSION entities (text = true mm value)\n# Run: python 0027_00274628_gt.py [out.dxf]\nimport sys\nimport ezdxf\n\nSCALE = 0.9818866233475225\nPAGE = [297.0, 210.0]\n\nVISIBLE_SEGMENTS = [\n (184.571513, 172.050002, 184.571513, 77.995599),\n (184.571513, 77.995599, 86.382851, 77.995599),\n (86.382851, 77.995599, 86.382851, 172.050002),\n (86.382851, 172.050002, 184.571513, 172.050002),\n (184.571513, 61.950002, 184.571513, 63.995599),\n (184.571513, 63.995599, 86.382851, 63.995599),\n (86.382851, 61.950002, 86.382851, 63.995599),\n (184.571513, 61.950002, 86.382851, 61.950002),\n (198.571513, 77.995599, 200.61711, 77.995599),\n (200.61711, 77.995599, 200.61711, 172.050002),\n (198.571513, 172.050002, 200.61711, 172.050002),\n (198.571513, 77.995599, 198.571513, 172.050002)\n]\nVISIBLE_CIRCLES = [\n\n]\nVISIBLE_ARCS = [\n\n]\nHIDDEN_SEGMENTS = [\n\n]\n# (orient, text, p1, p2, base) for linear; (orient, text, center, radius, angle) for diameter\nDIMENSIONS = [\n ('horizontal', '100', (184.5715, 172.05), (86.3829, 172.05), (135.4772, 161.05)),\n ('vertical', '95.7895', (184.5715, 77.9956), (184.5715, 172.05), (173.5715, 125.0228)),\n ('horizontal', '2.0833', (198.5715, 77.9956), (200.6171, 77.9956), (199.5943, 88.9956))\n]\n\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\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\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,\n angle=(0 if d[0] == \"horizontal\" else 90),\n 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,\n 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,\n text=text, dimstyle=\"EZDXF\").render()\n\n doc.saveas(out_path)\n\n\nif __name__ == \"__main__\":\n out = sys.argv[1] if len(sys.argv) > 1 else \"0027_00274628_gt.dxf\"\n draw(out)\n print(\"wrote\", out)\n```"}], "images": ["images/0027_00274628.png"], "id": "0027_00274628"} {"messages": [{"role": "user", "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 88.89 mm."}, {"role": "assistant", "content": "```python\n#!/usr/bin/env python3\n# -*- coding: utf-8 -*-\n# Ground-truth 2D engineering drawing for part: 0027_00274952\n# Self-contained: reproduces the three-view DXF via ezdxf, NO FreeCAD needed.\n# Coordinates are A4 page millimetres (scale=0.5087647058823527, page=[297.0, 210.0]).\n# visible edges -> solid (layer OUTLINE); hidden edges -> dashed (layer HIDDEN)\n# dimensions -> real movable DIMENSION entities (text = true mm value)\n# Run: python 0027_00274952_gt.py [out.dxf]\nimport sys\nimport ezdxf\n\nSCALE = 0.5087647058823527\nPAGE = [297.0, 210.0]\n\nVISIBLE_SEGMENTS = [\n (133.435504, 172.049982, 133.435504, 121.173512),\n (133.435504, 121.173512, 94.340953, 121.173512),\n (94.340953, 121.173512, 94.340953, 172.049982),\n (94.340953, 172.049982, 133.435504, 172.049982),\n (133.435504, 61.949982, 133.435504, 107.173512),\n (133.435504, 107.173512, 94.340953, 107.173512),\n (94.340953, 61.949982, 94.340953, 107.173512),\n (133.435504, 61.949982, 94.340953, 61.949982),\n (147.435504, 121.173512, 192.659034, 121.173512),\n (192.659034, 121.173512, 192.659034, 172.049982),\n (147.435504, 172.049982, 192.659034, 172.049982),\n (147.435504, 121.173512, 147.435504, 172.049982)\n]\nVISIBLE_CIRCLES = [\n\n]\nVISIBLE_ARCS = [\n\n]\nHIDDEN_SEGMENTS = [\n\n]\n# (orient, text, p1, p2, base) for linear; (orient, text, center, radius, angle) for diameter\nDIMENSIONS = [\n ('horizontal', '76.8421', (133.4355, 172.05), (94.341, 172.05), (113.8882, 161.05)),\n ('vertical', '100', (133.4355, 121.1735), (133.4355, 172.05), (122.4355, 146.6118)),\n ('horizontal', '88.8889', (147.4355, 121.1735), (192.659, 121.1735), (170.0473, 132.1735))\n]\n\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\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\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,\n angle=(0 if d[0] == \"horizontal\" else 90),\n 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,\n 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,\n text=text, dimstyle=\"EZDXF\").render()\n\n doc.saveas(out_path)\n\n\nif __name__ == \"__main__\":\n out = sys.argv[1] if len(sys.argv) > 1 else \"0027_00274952_gt.dxf\"\n draw(out)\n print(\"wrote\", out)\n```"}], "images": ["images/0027_00274952.png"], "id": "0027_00274952"} {"messages": [{"role": "user", "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": "assistant", "content": "```python\n#!/usr/bin/env python3\n# -*- coding: utf-8 -*-\n# Ground-truth 2D engineering drawing for part: 0027_00279648\n# Self-contained: reproduces the three-view DXF via ezdxf, NO FreeCAD needed.\n# Coordinates are A4 page millimetres (scale=0.4805, page=[297.0, 210.0]).\n# visible edges -> solid (layer OUTLINE); hidden edges -> dashed (layer HIDDEN)\n# dimensions -> real movable DIMENSION entities (text = true mm value)\n# Run: python 0027_00279648_gt.py [out.dxf]\nimport sys\nimport ezdxf\n\nSCALE = 0.4805\nPAGE = [297.0, 210.0]\n\nVISIBLE_SEGMENTS = [\n (136.5, 124.0, 136.5, 172.05),\n (136.5, 172.05, 88.45, 172.05),\n (88.45, 172.05, 88.45, 124.0),\n (88.45, 124.0, 136.5, 124.0),\n (136.5, 110.0, 136.5, 61.95),\n (88.45, 110.0, 88.45, 61.95),\n (88.45, 61.95, 136.5, 61.95),\n (88.45, 110.0, 136.5, 110.0),\n (198.55, 172.05, 150.5, 172.05),\n (150.5, 172.05, 150.5, 124.0),\n (198.55, 124.0, 150.5, 124.0),\n (198.55, 172.05, 198.55, 124.0)\n]\nVISIBLE_CIRCLES = [\n\n]\nVISIBLE_ARCS = [\n\n]\nHIDDEN_SEGMENTS = [\n\n]\n# (orient, text, p1, p2, base) for linear; (orient, text, center, radius, angle) for diameter\nDIMENSIONS = [\n ('horizontal', '100', (136.5, 124.0), (88.45, 124.0), (112.475, 113.0)),\n ('vertical', '100', (136.5, 172.05), (136.5, 124.0), (147.5, 148.025)),\n ('horizontal', '100', (198.55, 172.05), (150.5, 172.05), (174.525, 161.05))\n]\n\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\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\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,\n angle=(0 if d[0] == \"horizontal\" else 90),\n 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,\n 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,\n text=text, dimstyle=\"EZDXF\").render()\n\n doc.saveas(out_path)\n\n\nif __name__ == \"__main__\":\n out = sys.argv[1] if len(sys.argv) > 1 else \"0027_00279648_gt.dxf\"\n draw(out)\n print(\"wrote\", out)\n```"}], "images": ["images/0027_00279648.png"], "id": "0027_00279648"} {"messages": [{"role": "user", "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 300 mm."}, {"role": "assistant", "content": "```python\n#!/usr/bin/env python3\n# -*- coding: utf-8 -*-\n# Ground-truth 2D engineering drawing for part: 0028_00281813\n# Self-contained: reproduces the three-view DXF via ezdxf, NO FreeCAD needed.\n# Coordinates are A4 page millimetres (scale=0.24025, page=[297.0, 210.0]).\n# visible edges -> solid (layer OUTLINE); hidden edges -> dashed (layer HIDDEN)\n# dimensions -> real movable DIMENSION entities (text = true mm value)\n# Run: python 0028_00281813_gt.py [out.dxf]\nimport sys\nimport ezdxf\n\nSCALE = 0.24025\nPAGE = [297.0, 210.0]\n\nVISIBLE_SEGMENTS = [\n (112.475, 148.025, 112.475, 172.05),\n (112.475, 172.05, 88.45, 172.05),\n (88.45, 172.05, 88.45, 148.025),\n (88.45, 148.025, 112.475, 148.025),\n (112.475, 134.025, 112.475, 61.95),\n (88.45, 134.025, 88.45, 61.95),\n (88.45, 61.95, 112.475, 61.95),\n (88.45, 134.025, 112.475, 134.025),\n (198.55, 172.05, 126.475, 172.05),\n (126.475, 172.05, 126.475, 148.025),\n (198.55, 148.025, 126.475, 148.025),\n (198.55, 172.05, 198.55, 148.025)\n]\nVISIBLE_CIRCLES = [\n\n]\nVISIBLE_ARCS = [\n\n]\nHIDDEN_SEGMENTS = [\n\n]\n# (orient, text, p1, p2, base) for linear; (orient, text, center, radius, angle) for diameter\nDIMENSIONS = [\n ('horizontal', '100', (112.475, 148.025), (88.45, 148.025), (100.4625, 137.025)),\n ('vertical', '100', (112.475, 172.05), (112.475, 148.025), (123.475, 160.0375)),\n ('horizontal', '300', (198.55, 172.05), (126.475, 172.05), (162.5125, 161.05))\n]\n\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\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\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,\n angle=(0 if d[0] == \"horizontal\" else 90),\n 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,\n 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,\n text=text, dimstyle=\"EZDXF\").render()\n\n doc.saveas(out_path)\n\n\nif __name__ == \"__main__\":\n out = sys.argv[1] if len(sys.argv) > 1 else \"0028_00281813_gt.dxf\"\n draw(out)\n print(\"wrote\", out)\n```"}], "images": ["images/0028_00281813.png"], "id": "0028_00281813"} {"messages": [{"role": "user", "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": "assistant", "content": "```python\n#!/usr/bin/env python3\n# -*- coding: utf-8 -*-\n# Ground-truth 2D engineering drawing for part: 0028_00287283\n# Self-contained: reproduces the three-view DXF via ezdxf, NO FreeCAD needed.\n# Coordinates are A4 page millimetres (scale=0.6406666666666667, page=[297.0, 210.0]).\n# visible edges -> solid (layer OUTLINE); hidden edges -> dashed (layer HIDDEN)\n# dimensions -> real movable DIMENSION entities (text = true mm value)\n# Run: python 0028_00287283_gt.py [out.dxf]\nimport sys\nimport ezdxf\n\nSCALE = 0.6406666666666667\nPAGE = [297.0, 210.0]\n\nVISIBLE_SEGMENTS = [\n (152.516687, 172.04998, 152.516687, 107.983313),\n (152.516687, 107.983313, 88.45002, 107.983313),\n (88.45002, 107.983313, 88.45002, 172.04998),\n (88.45002, 172.04998, 152.516687, 172.04998),\n (152.516687, 61.94998, 152.516687, 93.983313),\n (152.516687, 93.983313, 88.45002, 93.983313),\n (88.45002, 61.94998, 88.45002, 93.983313),\n (152.516687, 61.94998, 88.45002, 61.94998),\n (166.516687, 107.983313, 198.55002, 107.983313),\n (198.55002, 107.983313, 198.55002, 172.04998),\n (166.516687, 172.04998, 198.55002, 172.04998),\n (166.516687, 107.983313, 166.516687, 172.04998)\n]\nVISIBLE_CIRCLES = [\n\n]\nVISIBLE_ARCS = [\n\n]\nHIDDEN_SEGMENTS = [\n\n]\n# (orient, text, p1, p2, base) for linear; (orient, text, center, radius, angle) for diameter\nDIMENSIONS = [\n ('horizontal', '100', (152.5167, 172.05), (88.45, 172.05), (120.4833, 161.05)),\n ('vertical', '100', (152.5167, 107.9833), (152.5167, 172.05), (141.5167, 140.0167)),\n ('horizontal', '50', (166.5167, 107.9833), (198.55, 107.9833), (182.5333, 118.9833))\n]\n\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\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\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,\n angle=(0 if d[0] == \"horizontal\" else 90),\n 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,\n 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,\n text=text, dimstyle=\"EZDXF\").render()\n\n doc.saveas(out_path)\n\n\nif __name__ == \"__main__\":\n out = sys.argv[1] if len(sys.argv) > 1 else \"0028_00287283_gt.dxf\"\n draw(out)\n print(\"wrote\", out)\n```"}], "images": ["images/0028_00287283.png"], "id": "0028_00287283"} {"messages": [{"role": "user", "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 66.32 mm tall. It is extruded to a thickness of -165.52 mm."}, {"role": "assistant", "content": "```python\n#!/usr/bin/env python3\n# -*- coding: utf-8 -*-\n# Ground-truth 2D engineering drawing for part: 0028_00289775\n# Self-contained: reproduces the three-view DXF via ezdxf, NO FreeCAD needed.\n# Coordinates are A4 page millimetres (scale=0.41452246751213495, page=[297.0, 210.0]).\n# visible edges -> solid (layer OUTLINE); hidden edges -> dashed (layer HIDDEN)\n# dimensions -> real movable DIMENSION entities (text = true mm value)\n# Run: python 0028_00289775_gt.py [out.dxf]\nimport sys\nimport ezdxf\n\nSCALE = 0.41452246751213495\nPAGE = [297.0, 210.0]\n\nVISIBLE_SEGMENTS = [\n (122.920806, 144.560609, 122.920806, 172.049994),\n (122.920806, 172.049994, 81.46856, 172.049994),\n (81.46856, 172.049994, 81.46856, 144.560609),\n (81.46856, 144.560609, 122.920806, 144.560609),\n (122.920806, 61.949994, 122.920806, 130.560609),\n (81.46856, 61.949994, 81.46856, 130.560609),\n (81.46856, 130.560609, 122.920806, 130.560609),\n (81.46856, 61.949994, 122.920806, 61.949994),\n (136.920806, 172.049994, 205.531422, 172.049994),\n (205.531422, 172.049994, 205.531422, 144.560609),\n (136.920806, 144.560609, 205.531422, 144.560609),\n (136.920806, 172.049994, 136.920806, 144.560609)\n]\nVISIBLE_CIRCLES = [\n\n]\nVISIBLE_ARCS = [\n\n]\nHIDDEN_SEGMENTS = [\n\n]\n# (orient, text, p1, p2, base) for linear; (orient, text, center, radius, angle) for diameter\nDIMENSIONS = [\n ('horizontal', '100', (122.9208, 144.5606), (81.4686, 144.5606), (102.1947, 133.5606)),\n ('vertical', '66.3158', (122.9208, 172.05), (122.9208, 144.5606), (133.9208, 158.3053)),\n ('horizontal', '165.517', (136.9208, 172.05), (205.5314, 172.05), (171.2261, 183.05))\n]\n\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\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\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,\n angle=(0 if d[0] == \"horizontal\" else 90),\n 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,\n 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,\n text=text, dimstyle=\"EZDXF\").render()\n\n doc.saveas(out_path)\n\n\nif __name__ == \"__main__\":\n out = sys.argv[1] if len(sys.argv) > 1 else \"0028_00289775_gt.dxf\"\n draw(out)\n print(\"wrote\", out)\n```"}], "images": ["images/0028_00289775.png"], "id": "0028_00289775"} {"messages": [{"role": "user", "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 30.21 mm."}, {"role": "assistant", "content": "```python\n#!/usr/bin/env python3\n# -*- coding: utf-8 -*-\n# Ground-truth 2D engineering drawing for part: 0029_00299041\n# Self-contained: reproduces the three-view DXF via ezdxf, NO FreeCAD needed.\n# Coordinates are A4 page millimetres (scale=0.976174825174823, page=[297.0, 210.0]).\n# visible edges -> solid (layer OUTLINE); hidden edges -> dashed (layer HIDDEN)\n# dimensions -> real movable DIMENSION entities (text = true mm value)\n# Run: python 0029_00299041_gt.py [out.dxf]\nimport sys\nimport ezdxf\n\nSCALE = 0.976174825174823\nPAGE = [297.0, 210.0]\n\nVISIBLE_SEGMENTS = [\n (170.564434, 114.08309, 170.564434, 163.405607),\n (170.564434, 163.405607, 72.946951, 163.405607),\n (72.946951, 163.405607, 72.946951, 114.08309),\n (72.946951, 114.08309, 170.564434, 114.08309),\n (170.564434, 100.08309, 170.564434, 70.594475),\n (72.946951, 100.08309, 72.946951, 70.594475),\n (72.946951, 70.594475, 170.564434, 70.594475),\n (72.946951, 100.08309, 170.564434, 100.08309),\n (214.053048, 163.405607, 184.564434, 163.405607),\n (184.564434, 163.405607, 184.564434, 114.08309),\n (214.053048, 114.08309, 184.564434, 114.08309),\n (214.053048, 163.405607, 214.053048, 114.08309)\n]\nVISIBLE_CIRCLES = [\n\n]\nVISIBLE_ARCS = [\n\n]\nHIDDEN_SEGMENTS = [\n\n]\n# (orient, text, p1, p2, base) for linear; (orient, text, center, radius, angle) for diameter\nDIMENSIONS = [\n ('horizontal', '100', (170.5644, 114.0831), (72.947, 114.0831), (121.7557, 103.0831)),\n ('vertical', '50.5263', (170.5644, 163.4056), (170.5644, 114.0831), (181.5644, 138.7443)),\n ('horizontal', '30.2083', (214.053, 163.4056), (184.5645, 163.4056), (199.3088, 152.4056))\n]\n\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\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\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,\n angle=(0 if d[0] == \"horizontal\" else 90),\n 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,\n 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,\n text=text, dimstyle=\"EZDXF\").render()\n\n doc.saveas(out_path)\n\n\nif __name__ == \"__main__\":\n out = sys.argv[1] if len(sys.argv) > 1 else \"0029_00299041_gt.dxf\"\n draw(out)\n print(\"wrote\", out)\n```"}], "images": ["images/0029_00299041.png"], "id": "0029_00299041"} {"messages": [{"role": "user", "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 18.75 mm."}, {"role": "assistant", "content": "```python\n#!/usr/bin/env python3\n# -*- coding: utf-8 -*-\n# Ground-truth 2D engineering drawing for part: 0030_00304393\n# Self-contained: reproduces the three-view DXF via ezdxf, NO FreeCAD needed.\n# Coordinates are A4 page millimetres (scale=0.8562250879249719, page=[297.0, 210.0]).\n# visible edges -> solid (layer OUTLINE); hidden edges -> dashed (layer HIDDEN)\n# dimensions -> real movable DIMENSION entities (text = true mm value)\n# Run: python 0030_00304393_gt.py [out.dxf]\nimport sys\nimport ezdxf\n\nSCALE = 0.8562250879249719\nPAGE = [297.0, 210.0]\n\nVISIBLE_SEGMENTS = [\n (163.257014, 172.049976, 163.257014, 108.058416),\n (77.634505, 172.049976, 163.257014, 172.049976),\n (163.257014, 108.058416, 77.634505, 108.058416),\n (77.634505, 108.058416, 77.634505, 172.049976),\n (163.257014, 61.949976, 163.257014, 94.058416),\n (163.257014, 94.058416, 77.634505, 94.058416),\n (77.634505, 61.949976, 77.634505, 94.058416),\n (163.257014, 61.949976, 77.634505, 61.949976),\n (209.365454, 172.049976, 177.257014, 172.049976),\n (177.257014, 108.058416, 209.365454, 108.058416),\n (209.365454, 108.058416, 209.365454, 172.049976),\n (177.257014, 108.058416, 177.257014, 172.049976)\n]\nVISIBLE_CIRCLES = [\n\n]\nVISIBLE_ARCS = [\n\n]\nHIDDEN_SEGMENTS = [\n\n]\n# (orient, text, p1, p2, base) for linear; (orient, text, center, radius, angle) for diameter\nDIMENSIONS = [\n ('horizontal', '100', (163.257, 172.05), (77.6345, 172.05), (120.4458, 161.05)),\n ('vertical', '74.7368', (163.257, 108.0584), (163.257, 172.05), (152.257, 140.0542)),\n ('horizontal', '37.5', (177.257, 108.0584), (209.3655, 108.0584), (193.3113, 119.0584))\n]\n\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\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\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,\n angle=(0 if d[0] == \"horizontal\" else 90),\n 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,\n 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,\n text=text, dimstyle=\"EZDXF\").render()\n\n doc.saveas(out_path)\n\n\nif __name__ == \"__main__\":\n out = sys.argv[1] if len(sys.argv) > 1 else \"0030_00304393_gt.dxf\"\n draw(out)\n print(\"wrote\", out)\n```"}], "images": ["images/0030_00304393.png"], "id": "0030_00304393"} {"messages": [{"role": "user", "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 25 mm."}, {"role": "assistant", "content": "```python\n#!/usr/bin/env python3\n# -*- coding: utf-8 -*-\n# Ground-truth 2D engineering drawing for part: 0030_00309541\n# Self-contained: reproduces the three-view DXF via ezdxf, NO FreeCAD needed.\n# Coordinates are A4 page millimetres (scale=0.976174825174823, page=[297.0, 210.0]).\n# visible edges -> solid (layer OUTLINE); hidden edges -> dashed (layer HIDDEN)\n# dimensions -> real movable DIMENSION entities (text = true mm value)\n# Run: python 0030_00309541_gt.py [out.dxf]\nimport sys\nimport ezdxf\n\nSCALE = 0.976174825174823\nPAGE = [297.0, 210.0]\n\nVISIBLE_SEGMENTS = [\n (173.106582, 111.54089, 173.106582, 160.863407),\n (173.106582, 160.863407, 75.4891, 160.863407),\n (75.4891, 160.863407, 75.4891, 111.54089),\n (75.4891, 111.54089, 173.106582, 111.54089),\n (173.106582, 97.54089, 173.106582, 73.136519),\n (75.4891, 97.54089, 75.4891, 73.136519),\n (75.4891, 73.136519, 173.106582, 73.136519),\n (75.4891, 97.54089, 173.106582, 97.54089),\n (211.510953, 160.863407, 187.106582, 160.863407),\n (187.106582, 160.863407, 187.106582, 111.54089),\n (211.510953, 111.54089, 187.106582, 111.54089),\n (211.510953, 160.863407, 211.510953, 111.54089)\n]\nVISIBLE_CIRCLES = [\n\n]\nVISIBLE_ARCS = [\n\n]\nHIDDEN_SEGMENTS = [\n\n]\n# (orient, text, p1, p2, base) for linear; (orient, text, center, radius, angle) for diameter\nDIMENSIONS = [\n ('horizontal', '100', (173.1066, 111.5409), (75.4891, 111.5409), (124.2978, 100.5409)),\n ('vertical', '50.5263', (173.1066, 160.8634), (173.1066, 111.5409), (184.1066, 136.2022)),\n ('horizontal', '25', (211.5109, 160.8634), (187.1066, 160.8634), (199.3087, 149.8634))\n]\n\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\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\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,\n angle=(0 if d[0] == \"horizontal\" else 90),\n 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,\n 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,\n text=text, dimstyle=\"EZDXF\").render()\n\n doc.saveas(out_path)\n\n\nif __name__ == \"__main__\":\n out = sys.argv[1] if len(sys.argv) > 1 else \"0030_00309541_gt.dxf\"\n draw(out)\n print(\"wrote\", out)\n```"}], "images": ["images/0030_00309541.png"], "id": "0030_00309541"} {"messages": [{"role": "user", "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 85.26 mm tall. It is extruded to a thickness of 7.29 mm."}, {"role": "assistant", "content": "```python\n#!/usr/bin/env python3\n# -*- coding: utf-8 -*-\n# Ground-truth 2D engineering drawing for part: 0031_00310116\n# Self-contained: reproduces the three-view DXF via ezdxf, NO FreeCAD needed.\n# Coordinates are A4 page millimetres (scale=0.7931420454545575, page=[297.0, 210.0]).\n# visible edges -> solid (layer OUTLINE); hidden edges -> dashed (layer HIDDEN)\n# dimensions -> real movable DIMENSION entities (text = true mm value)\n# Run: python 0031_00310116_gt.py [out.dxf]\nimport sys\nimport ezdxf\n\nSCALE = 0.7931420454545575\nPAGE = [297.0, 210.0]\n\nVISIBLE_SEGMENTS = [\n (173.265415, 93.078743, 173.265415, 160.704538),\n (173.265415, 160.704538, 93.951211, 160.704538),\n (93.951211, 160.704538, 93.951211, 93.078743),\n (93.951211, 93.078743, 173.265415, 93.078743),\n (173.265415, 79.078743, 173.265415, 73.295415),\n (93.951211, 79.078743, 93.951211, 73.295415),\n (93.951211, 73.295415, 173.265415, 73.295415),\n (93.951211, 79.078743, 173.265415, 79.078743),\n (193.048743, 160.704538, 187.265415, 160.704538),\n (187.265415, 160.704538, 187.265415, 93.078743),\n (193.048743, 93.078743, 187.265415, 93.078743),\n (193.048743, 160.704538, 193.048743, 93.078743)\n]\nVISIBLE_CIRCLES = [\n\n]\nVISIBLE_ARCS = [\n\n]\nHIDDEN_SEGMENTS = [\n\n]\n# (orient, text, p1, p2, base) for linear; (orient, text, center, radius, angle) for diameter\nDIMENSIONS = [\n ('horizontal', '100', (173.2654, 93.0788), (93.9512, 93.0788), (133.6083, 82.0788)),\n ('vertical', '85.2632', (173.2654, 160.7045), (173.2654, 93.0788), (184.2654, 126.8917)),\n ('horizontal', '7.2917', (193.0488, 160.7045), (187.2654, 160.7045), (190.1571, 149.7045))\n]\n\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\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\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,\n angle=(0 if d[0] == \"horizontal\" else 90),\n 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,\n 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,\n text=text, dimstyle=\"EZDXF\").render()\n\n doc.saveas(out_path)\n\n\nif __name__ == \"__main__\":\n out = sys.argv[1] if len(sys.argv) > 1 else \"0031_00310116_gt.dxf\"\n draw(out)\n print(\"wrote\", out)\n```"}], "images": ["images/0031_00310116.png"], "id": "0031_00310116"} {"messages": [{"role": "user", "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 25.26 mm tall. It is extruded to a thickness of 50 mm."}, {"role": "assistant", "content": "```python\n#!/usr/bin/env python3\n# -*- coding: utf-8 -*-\n# Ground-truth 2D engineering drawing for part: 0031_00310584\n# Self-contained: reproduces the three-view DXF via ezdxf, NO FreeCAD needed.\n# Coordinates are A4 page millimetres (scale=1.1730504201680656, page=[297.0, 210.0]).\n# visible edges -> solid (layer OUTLINE); hidden edges -> dashed (layer HIDDEN)\n# dimensions -> real movable DIMENSION entities (text = true mm value)\n# Run: python 0031_00310584_gt.py [out.dxf]\nimport sys\nimport ezdxf\n\nSCALE = 1.1730504201680656\nPAGE = [297.0, 210.0]\n\nVISIBLE_SEGMENTS = [\n (165.826284, 138.508725, 165.826284, 168.143683),\n (165.826284, 168.143683, 48.521242, 168.143683),\n (48.521242, 168.143683, 48.521242, 138.508725),\n (48.521242, 138.508725, 165.826284, 138.508725),\n (165.826284, 124.508725, 165.826284, 65.856204),\n (48.521242, 124.508725, 48.521242, 65.856204),\n (48.521242, 65.856204, 165.826284, 65.856204),\n (48.521242, 124.508725, 165.826284, 124.508725),\n (238.478805, 168.143683, 179.826284, 168.143683),\n (179.826284, 168.143683, 179.826284, 138.508725),\n (238.478805, 138.508725, 179.826284, 138.508725),\n (238.478805, 168.143683, 238.478805, 138.508725)\n]\nVISIBLE_CIRCLES = [\n\n]\nVISIBLE_ARCS = [\n\n]\nHIDDEN_SEGMENTS = [\n\n]\n# (orient, text, p1, p2, base) for linear; (orient, text, center, radius, angle) for diameter\nDIMENSIONS = [\n ('horizontal', '100', (165.8263, 138.5087), (48.5212, 138.5087), (107.1737, 127.5087)),\n ('vertical', '25.2632', (165.8263, 168.1437), (165.8263, 138.5087), (176.8263, 153.3262)),\n ('horizontal', '50', (238.4788, 168.1437), (179.8263, 168.1437), (209.1525, 157.1437))\n]\n\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\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\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,\n angle=(0 if d[0] == \"horizontal\" else 90),\n 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,\n 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,\n text=text, dimstyle=\"EZDXF\").render()\n\n doc.saveas(out_path)\n\n\nif __name__ == \"__main__\":\n out = sys.argv[1] if len(sys.argv) > 1 else \"0031_00310584_gt.dxf\"\n draw(out)\n print(\"wrote\", out)\n```"}], "images": ["images/0031_00310584.png"], "id": "0031_00310584"} {"messages": [{"role": "user", "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 15.79 mm wide and 100 mm tall. It is extruded to a thickness of 1.04 mm."}, {"role": "assistant", "content": "```python\n#!/usr/bin/env python3\n# -*- coding: utf-8 -*-\n# Ground-truth 2D engineering drawing for part: 0031_00314261\n# Self-contained: reproduces the three-view DXF via ezdxf, NO FreeCAD needed.\n# Coordinates are A4 page millimetres (scale=0.9510927835051515, page=[297.0, 210.0]).\n# visible edges -> solid (layer OUTLINE); hidden edges -> dashed (layer HIDDEN)\n# dimensions -> real movable DIMENSION entities (text = true mm value)\n# Run: python 0031_00314261_gt.py [out.dxf]\nimport sys\nimport ezdxf\n\nSCALE = 0.9510927835051515\nPAGE = [297.0, 210.0]\n\nVISIBLE_SEGMENTS = [\n (143.513287, 172.049987, 143.513287, 76.940709),\n (143.513287, 76.940709, 128.496032, 76.940709),\n (128.496032, 76.940709, 128.496032, 172.049987),\n (128.496032, 172.049987, 143.513287, 172.049987),\n (143.513287, 61.949987, 143.513287, 62.940709),\n (143.513287, 62.940709, 128.496032, 62.940709),\n (128.496032, 61.949987, 128.496032, 62.940709),\n (143.513287, 61.949987, 128.496032, 61.949987),\n (157.513287, 76.940709, 158.504008, 76.940709),\n (158.504008, 76.940709, 158.504008, 172.049987),\n (157.513287, 172.049987, 158.504008, 172.049987),\n (157.513287, 76.940709, 157.513287, 172.049987)\n]\nVISIBLE_CIRCLES = [\n\n]\nVISIBLE_ARCS = [\n\n]\nHIDDEN_SEGMENTS = [\n\n]\n# (orient, text, p1, p2, base) for linear; (orient, text, center, radius, angle) for diameter\nDIMENSIONS = [\n ('horizontal', '15.7895', (143.5133, 172.05), (128.496, 172.05), (136.0047, 161.05)),\n ('vertical', '100', (143.5133, 76.9407), (143.5133, 172.05), (132.5133, 124.4954)),\n ('horizontal', '1.0417', (157.5133, 76.9407), (158.504, 76.9407), (158.0086, 87.9407))\n]\n\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\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\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,\n angle=(0 if d[0] == \"horizontal\" else 90),\n 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,\n 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,\n text=text, dimstyle=\"EZDXF\").render()\n\n doc.saveas(out_path)\n\n\nif __name__ == \"__main__\":\n out = sys.argv[1] if len(sys.argv) > 1 else \"0031_00314261_gt.dxf\"\n draw(out)\n print(\"wrote\", out)\n```"}], "images": ["images/0031_00314261.png"], "id": "0031_00314261"} {"messages": [{"role": "user", "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 46.32 mm wide and 100 mm tall. It is extruded to a thickness of 21.5 mm."}, {"role": "assistant", "content": "```python\n#!/usr/bin/env python3\n# -*- coding: utf-8 -*-\n# Ground-truth 2D engineering drawing for part: 0031_00314798\n# Self-contained: reproduces the three-view DXF via ezdxf, NO FreeCAD needed.\n# Coordinates are A4 page millimetres (scale=0.7909465020576132, page=[297.0, 210.0]).\n# visible edges -> solid (layer OUTLINE); hidden edges -> dashed (layer HIDDEN)\n# dimensions -> real movable DIMENSION entities (text = true mm value)\n# Run: python 0031_00314798_gt.py [out.dxf]\nimport sys\nimport ezdxf\n\nSCALE = 0.7909465020576132\nPAGE = [297.0, 210.0]\n\nVISIBLE_SEGMENTS = [\n (146.313992, 172.04997, 146.313992, 92.95532),\n (146.313992, 92.95532, 109.680681, 92.95532),\n (109.680681, 92.95532, 109.680681, 172.04997),\n (109.680681, 172.04997, 146.313992, 172.04997),\n (146.313992, 61.94997, 146.313992, 78.95532),\n (146.313992, 78.95532, 109.680681, 78.95532),\n (109.680681, 61.94997, 109.680681, 78.95532),\n (146.313992, 61.94997, 109.680681, 61.94997),\n (160.313992, 92.95532, 177.319342, 92.95532),\n (177.319342, 92.95532, 177.319342, 172.04997),\n (160.313992, 172.04997, 177.319342, 172.04997),\n (160.313992, 92.95532, 160.313992, 172.04997)\n]\nVISIBLE_CIRCLES = [\n\n]\nVISIBLE_ARCS = [\n\n]\nHIDDEN_SEGMENTS = [\n\n]\n# (orient, text, p1, p2, base) for linear; (orient, text, center, radius, angle) for diameter\nDIMENSIONS = [\n ('horizontal', '46.3158', (146.314, 172.05), (109.6807, 172.05), (127.9973, 161.05)),\n ('vertical', '100', (146.314, 92.9553), (146.314, 172.05), (135.314, 132.5027)),\n ('horizontal', '21.5', (160.314, 92.9553), (177.3193, 92.9553), (168.8167, 103.9553))\n]\n\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\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\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,\n angle=(0 if d[0] == \"horizontal\" else 90),\n 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,\n 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,\n text=text, dimstyle=\"EZDXF\").render()\n\n doc.saveas(out_path)\n\n\nif __name__ == \"__main__\":\n out = sys.argv[1] if len(sys.argv) > 1 else \"0031_00314798_gt.dxf\"\n draw(out)\n print(\"wrote\", out)\n```"}], "images": ["images/0031_00314798.png"], "id": "0031_00314798"} {"messages": [{"role": "user", "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 25.26 mm tall. It is extruded to a thickness of 50 mm."}, {"role": "assistant", "content": "```python\n#!/usr/bin/env python3\n# -*- coding: utf-8 -*-\n# Ground-truth 2D engineering drawing for part: 0031_00317546\n# Self-contained: reproduces the three-view DXF via ezdxf, NO FreeCAD needed.\n# Coordinates are A4 page millimetres (scale=1.1730504201680656, page=[297.0, 210.0]).\n# visible edges -> solid (layer OUTLINE); hidden edges -> dashed (layer HIDDEN)\n# dimensions -> real movable DIMENSION entities (text = true mm value)\n# Run: python 0031_00317546_gt.py [out.dxf]\nimport sys\nimport ezdxf\n\nSCALE = 1.1730504201680656\nPAGE = [297.0, 210.0]\n\nVISIBLE_SEGMENTS = [\n (165.826244, 138.508825, 165.826244, 168.143783),\n (165.826244, 168.143783, 48.521202, 168.143783),\n (48.521202, 168.143783, 48.521202, 138.508825),\n (48.521202, 138.508825, 165.826244, 138.508825),\n (165.826244, 124.508825, 165.826244, 65.856304),\n (48.521202, 124.508825, 48.521202, 65.856304),\n (48.521202, 65.856304, 165.826244, 65.856304),\n (48.521202, 124.508825, 165.826244, 124.508825),\n (238.478765, 168.143783, 179.826244, 168.143783),\n (179.826244, 168.143783, 179.826244, 138.508825),\n (238.478765, 138.508825, 179.826244, 138.508825),\n (238.478765, 168.143783, 238.478765, 138.508825)\n]\nVISIBLE_CIRCLES = [\n\n]\nVISIBLE_ARCS = [\n\n]\nHIDDEN_SEGMENTS = [\n\n]\n# (orient, text, p1, p2, base) for linear; (orient, text, center, radius, angle) for diameter\nDIMENSIONS = [\n ('horizontal', '100', (165.8262, 138.5088), (48.5212, 138.5088), (107.1737, 127.5088)),\n ('vertical', '25.2632', (165.8262, 168.1438), (165.8262, 138.5088), (176.8262, 153.3263)),\n ('horizontal', '50', (238.4788, 168.1438), (179.8263, 168.1438), (209.1525, 157.1438))\n]\n\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\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\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,\n angle=(0 if d[0] == \"horizontal\" else 90),\n 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,\n 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,\n text=text, dimstyle=\"EZDXF\").render()\n\n doc.saveas(out_path)\n\n\nif __name__ == \"__main__\":\n out = sys.argv[1] if len(sys.argv) > 1 else \"0031_00317546_gt.dxf\"\n draw(out)\n print(\"wrote\", out)\n```"}], "images": ["images/0031_00317546.png"], "id": "0031_00317546"} {"messages": [{"role": "user", "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 57.29 mm."}, {"role": "assistant", "content": "```python\n#!/usr/bin/env python3\n# -*- coding: utf-8 -*-\n# Ground-truth 2D engineering drawing for part: 0031_00317629\n# Self-contained: reproduces the three-view DXF via ezdxf, NO FreeCAD needed.\n# Coordinates are A4 page millimetres (scale=1.280669724770644, page=[297.0, 210.0]).\n# visible edges -> solid (layer OUTLINE); hidden edges -> dashed (layer HIDDEN)\n# dimensions -> real movable DIMENSION entities (text = true mm value)\n# Run: python 0031_00317629_gt.py [out.dxf]\nimport sys\nimport ezdxf\n\nSCALE = 1.280669724770644\nPAGE = [297.0, 210.0]\n\nVISIBLE_SEGMENTS = [\n (163.847614, 151.249383, 163.847614, 170.122411),\n (163.847614, 170.122411, 35.780641, 170.122411),\n (35.780641, 170.122411, 35.780641, 151.249383),\n (35.780641, 151.249383, 163.847614, 151.249383),\n (163.847614, 137.249383, 163.847614, 63.877681),\n (35.780641, 137.249383, 35.780641, 63.877681),\n (35.780641, 63.877681, 163.847614, 63.877681),\n (35.780641, 137.249383, 163.847614, 137.249383),\n (251.219317, 170.122411, 177.847614, 170.122411),\n (177.847614, 170.122411, 177.847614, 151.249383),\n (251.219317, 151.249383, 177.847614, 151.249383),\n (251.219317, 170.122411, 251.219317, 151.249383)\n]\nVISIBLE_CIRCLES = [\n\n]\nVISIBLE_ARCS = [\n\n]\nHIDDEN_SEGMENTS = [\n\n]\n# (orient, text, p1, p2, base) for linear; (orient, text, center, radius, angle) for diameter\nDIMENSIONS = [\n ('horizontal', '100', (163.8476, 151.2494), (35.7807, 151.2494), (99.8141, 140.2494)),\n ('vertical', '14.7368', (163.8476, 170.1224), (163.8476, 151.2494), (174.8476, 160.6859)),\n ('horizontal', '57.2917', (251.2193, 170.1224), (177.8476, 170.1224), (214.5335, 159.1224))\n]\n\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\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\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,\n angle=(0 if d[0] == \"horizontal\" else 90),\n 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,\n 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,\n text=text, dimstyle=\"EZDXF\").render()\n\n doc.saveas(out_path)\n\n\nif __name__ == \"__main__\":\n out = sys.argv[1] if len(sys.argv) > 1 else \"0031_00317629_gt.dxf\"\n draw(out)\n print(\"wrote\", out)\n```"}], "images": ["images/0031_00317629.png"], "id": "0031_00317629"} {"messages": [{"role": "user", "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": "assistant", "content": "```python\n#!/usr/bin/env python3\n# -*- coding: utf-8 -*-\n# Ground-truth 2D engineering drawing for part: 0031_00319083\n# Self-contained: reproduces the three-view DXF via ezdxf, NO FreeCAD needed.\n# Coordinates are A4 page millimetres (scale=0.6406666666666665, page=[297.0, 210.0]).\n# visible edges -> solid (layer OUTLINE); hidden edges -> dashed (layer HIDDEN)\n# dimensions -> real movable DIMENSION entities (text = true mm value)\n# Run: python 0031_00319083_gt.py [out.dxf]\nimport sys\nimport ezdxf\n\nSCALE = 0.6406666666666665\nPAGE = [297.0, 210.0]\n\nVISIBLE_SEGMENTS = [\n (152.516687, 107.98332, 152.516687, 172.049987),\n (152.516687, 172.049987, 88.45002, 172.049987),\n (88.45002, 172.049987, 88.45002, 107.98332),\n (88.45002, 107.98332, 152.516687, 107.98332),\n (152.516687, 93.98332, 152.516687, 61.949987),\n (88.45002, 93.98332, 88.45002, 61.949987),\n (88.45002, 61.949987, 152.516687, 61.949987),\n (88.45002, 93.98332, 152.516687, 93.98332),\n (198.55002, 172.049987, 166.516687, 172.049987),\n (166.516687, 172.049987, 166.516687, 107.98332),\n (198.55002, 107.98332, 166.516687, 107.98332),\n (198.55002, 172.049987, 198.55002, 107.98332)\n]\nVISIBLE_CIRCLES = [\n\n]\nVISIBLE_ARCS = [\n\n]\nHIDDEN_SEGMENTS = [\n\n]\n# (orient, text, p1, p2, base) for linear; (orient, text, center, radius, angle) for diameter\nDIMENSIONS = [\n ('horizontal', '100', (152.5167, 107.9833), (88.45, 107.9833), (120.4833, 96.9833)),\n ('vertical', '100', (152.5167, 172.05), (152.5167, 107.9833), (163.5167, 140.0167)),\n ('horizontal', '50', (198.55, 172.05), (166.5167, 172.05), (182.5333, 161.05))\n]\n\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\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\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,\n angle=(0 if d[0] == \"horizontal\" else 90),\n 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,\n 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,\n text=text, dimstyle=\"EZDXF\").render()\n\n doc.saveas(out_path)\n\n\nif __name__ == \"__main__\":\n out = sys.argv[1] if len(sys.argv) > 1 else \"0031_00319083_gt.dxf\"\n draw(out)\n print(\"wrote\", out)\n```"}], "images": ["images/0031_00319083.png"], "id": "0031_00319083"} {"messages": [{"role": "user", "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 139.13 mm."}, {"role": "assistant", "content": "```python\n#!/usr/bin/env python3\n# -*- coding: utf-8 -*-\n# Ground-truth 2D engineering drawing for part: 0032_00323430\n# Self-contained: reproduces the three-view DXF via ezdxf, NO FreeCAD needed.\n# Coordinates are A4 page millimetres (scale=0.614476363636386, page=[297.0, 210.0]).\n# visible edges -> solid (layer OUTLINE); hidden edges -> dashed (layer HIDDEN)\n# dimensions -> real movable DIMENSION entities (text = true mm value)\n# Run: python 0032_00323430_gt.py [out.dxf]\nimport sys\nimport ezdxf\n\nSCALE = 0.614476363636386\nPAGE = [297.0, 210.0]\n\nVISIBLE_SEGMENTS = [\n (124.477615, 170.627104, 124.477615, 162.865297),\n (124.477615, 162.865297, 63.029978, 162.865297),\n (63.029978, 162.865297, 63.029978, 170.627104),\n (63.029978, 170.627104, 124.477615, 170.627104),\n (124.477615, 63.372934, 124.477615, 148.865297),\n (124.477615, 148.865297, 63.029978, 148.865297),\n (63.029978, 63.372934, 63.029978, 148.865297),\n (124.477615, 63.372934, 63.029978, 63.372934),\n (138.477615, 162.865297, 223.969978, 162.865297),\n (223.969978, 162.865297, 223.969978, 170.627104),\n (138.477615, 170.627104, 223.969978, 170.627104),\n (138.477615, 162.865297, 138.477615, 170.627104)\n]\nVISIBLE_CIRCLES = [\n\n]\nVISIBLE_ARCS = [\n\n]\nHIDDEN_SEGMENTS = [\n\n]\n# (orient, text, p1, p2, base) for linear; (orient, text, center, radius, angle) for diameter\nDIMENSIONS = [\n ('horizontal', '100', (124.4776, 170.6271), (63.03, 170.6271), (93.7538, 159.6271)),\n ('vertical', '12.6316', (124.4776, 162.8653), (124.4776, 170.6271), (113.4776, 166.7462)),\n ('horizontal', '139.13', (138.4776, 162.8653), (223.97, 162.8653), (181.2238, 173.8653))\n]\n\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\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\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,\n angle=(0 if d[0] == \"horizontal\" else 90),\n 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,\n 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,\n text=text, dimstyle=\"EZDXF\").render()\n\n doc.saveas(out_path)\n\n\nif __name__ == \"__main__\":\n out = sys.argv[1] if len(sys.argv) > 1 else \"0032_00323430_gt.dxf\"\n draw(out)\n print(\"wrote\", out)\n```"}], "images": ["images/0032_00323430.png"], "id": "0032_00323430"} {"messages": [{"role": "user", "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.16 mm."}, {"role": "assistant", "content": "```python\n#!/usr/bin/env python3\n# -*- coding: utf-8 -*-\n# Ground-truth 2D engineering drawing for part: 0032_00324978\n# Self-contained: reproduces the three-view DXF via ezdxf, NO FreeCAD needed.\n# Coordinates are A4 page millimetres (scale=0.7347000000000329, page=[297.0, 210.0]).\n# visible edges -> solid (layer OUTLINE); hidden edges -> dashed (layer HIDDEN)\n# dimensions -> real movable DIMENSION entities (text = true mm value)\n# Run: python 0032_00324978_gt.py [out.dxf]\nimport sys\nimport ezdxf\n\nSCALE = 0.7347000000000329\nPAGE = [297.0, 210.0]\n\nVISIBLE_SEGMENTS = [\n (172.810307, 87.6897, 172.810307, 161.1597),\n (172.810307, 161.1597, 99.340307, 161.1597),\n (99.340307, 161.1597, 99.340307, 87.6897),\n (99.340307, 87.6897, 172.810307, 87.6897),\n (172.810307, 73.6897, 172.810307, 72.840336),\n (99.340307, 73.6897, 99.340307, 72.840336),\n (99.340307, 72.840336, 172.810307, 72.840336),\n (99.340307, 73.6897, 172.810307, 73.6897),\n (187.659671, 161.1597, 186.810307, 161.1597),\n (186.810307, 161.1597, 186.810307, 87.6897),\n (187.659671, 87.6897, 186.810307, 87.6897),\n (187.659671, 161.1597, 187.659671, 87.6897)\n]\nVISIBLE_CIRCLES = [\n\n]\nVISIBLE_ARCS = [\n\n]\nHIDDEN_SEGMENTS = [\n\n]\n# (orient, text, p1, p2, base) for linear; (orient, text, center, radius, angle) for diameter\nDIMENSIONS = [\n ('horizontal', '100', (172.8103, 87.6897), (99.3403, 87.6897), (136.0753, 76.6897)),\n ('vertical', '100', (172.8103, 161.1597), (172.8103, 87.6897), (183.8103, 124.4247)),\n ('horizontal', '1.1561', (187.6597, 161.1597), (186.8103, 161.1597), (187.235, 150.1597))\n]\n\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\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\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,\n angle=(0 if d[0] == \"horizontal\" else 90),\n 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,\n 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,\n text=text, dimstyle=\"EZDXF\").render()\n\n doc.saveas(out_path)\n\n\nif __name__ == \"__main__\":\n out = sys.argv[1] if len(sys.argv) > 1 else \"0032_00324978_gt.dxf\"\n draw(out)\n print(\"wrote\", out)\n```"}], "images": ["images/0032_00324978.png"], "id": "0032_00324978"} {"messages": [{"role": "user", "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 80 mm wide and 100 mm tall. It is extruded to a thickness of 2.08 mm."}, {"role": "assistant", "content": "```python\n#!/usr/bin/env python3\n# -*- coding: utf-8 -*-\n# Ground-truth 2D engineering drawing for part: 0032_00325280\n# Self-contained: reproduces the three-view DXF via ezdxf, NO FreeCAD needed.\n# Coordinates are A4 page millimetres (scale=0.9413877551020439, page=[297.0, 210.0]).\n# visible edges -> solid (layer OUTLINE); hidden edges -> dashed (layer HIDDEN)\n# dimensions -> real movable DIMENSION entities (text = true mm value)\n# Run: python 0032_00325280_gt.py [out.dxf]\nimport sys\nimport ezdxf\n\nSCALE = 0.9413877551020439\nPAGE = [297.0, 210.0]\n\nVISIBLE_SEGMENTS = [\n (173.174899, 172.049985, 173.174899, 77.91121),\n (173.174899, 77.91121, 97.863879, 77.91121),\n (97.863879, 77.91121, 97.863879, 172.049985),\n (97.863879, 172.049985, 173.174899, 172.049985),\n (173.174899, 61.949985, 173.174899, 63.91121),\n (173.174899, 63.91121, 97.863879, 63.91121),\n (97.863879, 61.949985, 97.863879, 63.91121),\n (173.174899, 61.949985, 97.863879, 61.949985),\n (187.174899, 77.91121, 189.136124, 77.91121),\n (189.136124, 77.91121, 189.136124, 172.049985),\n (187.174899, 172.049985, 189.136124, 172.049985),\n (187.174899, 77.91121, 187.174899, 172.049985)\n]\nVISIBLE_CIRCLES = [\n\n]\nVISIBLE_ARCS = [\n\n]\nHIDDEN_SEGMENTS = [\n\n]\n# (orient, text, p1, p2, base) for linear; (orient, text, center, radius, angle) for diameter\nDIMENSIONS = [\n ('horizontal', '80', (173.1749, 172.05), (97.8639, 172.05), (135.5194, 161.05)),\n ('vertical', '100', (173.1749, 77.9112), (173.1749, 172.05), (162.1749, 124.9806)),\n ('horizontal', '2.0833', (187.1749, 77.9112), (189.1361, 77.9112), (188.1555, 88.9112))\n]\n\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\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\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,\n angle=(0 if d[0] == \"horizontal\" else 90),\n 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,\n 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,\n text=text, dimstyle=\"EZDXF\").render()\n\n doc.saveas(out_path)\n\n\nif __name__ == \"__main__\":\n out = sys.argv[1] if len(sys.argv) > 1 else \"0032_00325280_gt.dxf\"\n draw(out)\n print(\"wrote\", out)\n```"}], "images": ["images/0032_00325280.png"], "id": "0032_00325280"} {"messages": [{"role": "user", "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 48.96 mm."}, {"role": "assistant", "content": "```python\n#!/usr/bin/env python3\n# -*- coding: utf-8 -*-\n# Ground-truth 2D engineering drawing for part: 0032_00328159\n# Self-contained: reproduces the three-view DXF via ezdxf, NO FreeCAD needed.\n# Coordinates are A4 page millimetres (scale=0.6451468531468546, page=[297.0, 210.0]).\n# visible edges -> solid (layer OUTLINE); hidden edges -> dashed (layer HIDDEN)\n# dimensions -> real movable DIMENSION entities (text = true mm value)\n# Run: python 0032_00328159_gt.py [out.dxf]\nimport sys\nimport ezdxf\n\nSCALE = 0.6451468531468546\nPAGE = [297.0, 210.0]\n\nVISIBLE_SEGMENTS = [\n (145.494546, 172.049991, 145.494546, 107.535306),\n (145.494546, 107.535306, 95.920103, 107.535306),\n (95.920103, 107.535306, 95.920103, 172.049991),\n (95.920103, 172.049991, 145.494546, 172.049991),\n (145.494546, 61.949991, 145.494546, 93.535306),\n (145.494546, 93.535306, 95.920103, 93.535306),\n (95.920103, 61.949991, 95.920103, 93.535306),\n (145.494546, 61.949991, 95.920103, 61.949991),\n (159.494546, 107.535306, 191.07986, 107.535306),\n (191.07986, 107.535306, 191.07986, 172.049991),\n (159.494546, 172.049991, 191.07986, 172.049991),\n (159.494546, 107.535306, 159.494546, 172.049991)\n]\nVISIBLE_CIRCLES = [\n\n]\nVISIBLE_ARCS = [\n\n]\nHIDDEN_SEGMENTS = [\n\n]\n# (orient, text, p1, p2, base) for linear; (orient, text, center, radius, angle) for diameter\nDIMENSIONS = [\n ('horizontal', '76.8421', (145.4945, 172.05), (95.9201, 172.05), (120.7073, 161.05)),\n ('vertical', '100', (145.4945, 107.5353), (145.4945, 172.05), (134.4945, 139.7927)),\n ('horizontal', '48.9583', (159.4946, 107.5353), (191.0799, 107.5353), (175.2872, 118.5353))\n]\n\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\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\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,\n angle=(0 if d[0] == \"horizontal\" else 90),\n 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,\n 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,\n text=text, dimstyle=\"EZDXF\").render()\n\n doc.saveas(out_path)\n\n\nif __name__ == \"__main__\":\n out = sys.argv[1] if len(sys.argv) > 1 else \"0032_00328159_gt.dxf\"\n draw(out)\n print(\"wrote\", out)\n```"}], "images": ["images/0032_00328159.png"], "id": "0032_00328159"} {"messages": [{"role": "user", "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 94.74 mm wide and 100 mm tall. It is extruded to a thickness of 35.29 mm."}, {"role": "assistant", "content": "```python\n#!/usr/bin/env python3\n# -*- coding: utf-8 -*-\n# Ground-truth 2D engineering drawing for part: 0033_00330643\n# Self-contained: reproduces the three-view DXF via ezdxf, NO FreeCAD needed.\n# Coordinates are A4 page millimetres (scale=0.7103043478261281, page=[297.0, 210.0]).\n# visible edges -> solid (layer OUTLINE); hidden edges -> dashed (layer HIDDEN)\n# dimensions -> real movable DIMENSION entities (text = true mm value)\n# Run: python 0033_00330643_gt.py [out.dxf]\nimport sys\nimport ezdxf\n\nSCALE = 0.7103043478261281\nPAGE = [297.0, 210.0]\n\nVISIBLE_SEGMENTS = [\n (157.611225, 172.050021, 157.611225, 101.019586),\n (157.611225, 101.019586, 90.319234, 101.019586),\n (90.319234, 101.019586, 90.319234, 172.050021),\n (90.319234, 172.050021, 157.611225, 172.050021),\n (157.611225, 61.950021, 157.611225, 87.019586),\n (157.611225, 87.019586, 90.319234, 87.019586),\n (90.319234, 61.950021, 90.319234, 87.019586),\n (157.611225, 61.950021, 90.319234, 61.950021),\n (171.611225, 101.019586, 196.68079, 101.019586),\n (196.68079, 101.019586, 196.68079, 172.050021),\n (171.611225, 172.050021, 196.68079, 172.050021),\n (171.611225, 101.019586, 171.611225, 172.050021)\n]\nVISIBLE_CIRCLES = [\n\n]\nVISIBLE_ARCS = [\n\n]\nHIDDEN_SEGMENTS = [\n\n]\n# (orient, text, p1, p2, base) for linear; (orient, text, center, radius, angle) for diameter\nDIMENSIONS = [\n ('horizontal', '94.7368', (157.6112, 172.05), (90.3193, 172.05), (123.9652, 161.05)),\n ('vertical', '100', (157.6112, 101.0196), (157.6112, 172.05), (146.6112, 136.5348)),\n ('horizontal', '35.2941', (171.6112, 101.0196), (196.6808, 101.0196), (184.146, 112.0196))\n]\n\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\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\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,\n angle=(0 if d[0] == \"horizontal\" else 90),\n 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,\n 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,\n text=text, dimstyle=\"EZDXF\").render()\n\n doc.saveas(out_path)\n\n\nif __name__ == \"__main__\":\n out = sys.argv[1] if len(sys.argv) > 1 else \"0033_00330643_gt.dxf\"\n draw(out)\n print(\"wrote\", out)\n```"}], "images": ["images/0033_00330643.png"], "id": "0033_00330643"} {"messages": [{"role": "user", "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": "assistant", "content": "```python\n#!/usr/bin/env python3\n# -*- coding: utf-8 -*-\n# Ground-truth 2D engineering drawing for part: 0033_00331841\n# Self-contained: reproduces the three-view DXF via ezdxf, NO FreeCAD needed.\n# Coordinates are A4 page millimetres (scale=0.4805000000000144, page=[297.0, 210.0]).\n# visible edges -> solid (layer OUTLINE); hidden edges -> dashed (layer HIDDEN)\n# dimensions -> real movable DIMENSION entities (text = true mm value)\n# Run: python 0033_00331841_gt.py [out.dxf]\nimport sys\nimport ezdxf\n\nSCALE = 0.4805000000000144\nPAGE = [297.0, 210.0]\n\nVISIBLE_SEGMENTS = [\n (136.5, 124.0, 136.5, 172.05),\n (88.45, 124.0, 136.5, 124.0),\n (136.5, 172.05, 88.45, 172.05),\n (88.45, 172.05, 88.45, 124.0),\n (136.5, 110.0, 136.5, 61.95),\n (136.5, 61.95, 88.45, 61.95),\n (88.45, 110.0, 88.45, 61.95),\n (136.5, 110.0, 88.45, 110.0),\n (198.55, 124.0, 150.5, 124.0),\n (150.5, 172.05, 198.55, 172.05),\n (198.55, 172.05, 198.55, 124.0),\n (150.5, 172.05, 150.5, 124.0)\n]\nVISIBLE_CIRCLES = [\n\n]\nVISIBLE_ARCS = [\n\n]\nHIDDEN_SEGMENTS = [\n\n]\n# (orient, text, p1, p2, base) for linear; (orient, text, center, radius, angle) for diameter\nDIMENSIONS = [\n ('horizontal', '100', (136.5, 172.05), (88.45, 172.05), (112.475, 161.05)),\n ('vertical', '100', (136.5, 124.0), (136.5, 172.05), (125.5, 148.025)),\n ('horizontal', '100', (150.5, 124.0), (198.55, 124.0), (174.525, 135.0))\n]\n\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\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\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,\n angle=(0 if d[0] == \"horizontal\" else 90),\n 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,\n 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,\n text=text, dimstyle=\"EZDXF\").render()\n\n doc.saveas(out_path)\n\n\nif __name__ == \"__main__\":\n out = sys.argv[1] if len(sys.argv) > 1 else \"0033_00331841_gt.dxf\"\n draw(out)\n print(\"wrote\", out)\n```"}], "images": ["images/0033_00331841.png"], "id": "0033_00331841"} {"messages": [{"role": "user", "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 4.17 mm."}, {"role": "assistant", "content": "```python\n#!/usr/bin/env python3\n# -*- coding: utf-8 -*-\n# Ground-truth 2D engineering drawing for part: 0034_00345264\n# Self-contained: reproduces the three-view DXF via ezdxf, NO FreeCAD needed.\n# Coordinates are A4 page millimetres (scale=0.922559999999997, page=[297.0, 210.0]).\n# visible edges -> solid (layer OUTLINE); hidden edges -> dashed (layer HIDDEN)\n# dimensions -> real movable DIMENSION entities (text = true mm value)\n# Run: python 0034_00345264_gt.py [out.dxf]\nimport sys\nimport ezdxf\n\nSCALE = 0.922559999999997\nPAGE = [297.0, 210.0]\n\nVISIBLE_SEGMENTS = [\n (157.884792, 172.05, 157.884792, 79.794),\n (157.884792, 79.794, 111.271234, 79.794),\n (111.271234, 79.794, 111.271234, 172.05),\n (111.271234, 172.05, 157.884792, 172.05),\n (157.884792, 61.95, 157.884792, 65.794),\n (157.884792, 65.794, 111.271234, 65.794),\n (111.271234, 61.95, 111.271234, 65.794),\n (157.884792, 61.95, 111.271234, 61.95),\n (171.884792, 79.794, 175.728792, 79.794),\n (175.728792, 79.794, 175.728792, 172.05),\n (171.884792, 172.05, 175.728792, 172.05),\n (171.884792, 79.794, 171.884792, 172.05)\n]\nVISIBLE_CIRCLES = [\n\n]\nVISIBLE_ARCS = [\n\n]\nHIDDEN_SEGMENTS = [\n\n]\n# (orient, text, p1, p2, base) for linear; (orient, text, center, radius, angle) for diameter\nDIMENSIONS = [\n ('horizontal', '50.5263', (157.8848, 172.05), (111.2712, 172.05), (134.578, 161.05)),\n ('vertical', '100', (157.8848, 79.794), (157.8848, 172.05), (146.8848, 125.922)),\n ('horizontal', '4.1667', (171.8848, 79.794), (175.7288, 79.794), (173.8068, 90.794))\n]\n\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\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\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,\n angle=(0 if d[0] == \"horizontal\" else 90),\n 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,\n 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,\n text=text, dimstyle=\"EZDXF\").render()\n\n doc.saveas(out_path)\n\n\nif __name__ == \"__main__\":\n out = sys.argv[1] if len(sys.argv) > 1 else \"0034_00345264_gt.dxf\"\n draw(out)\n print(\"wrote\", out)\n```"}], "images": ["images/0034_00345264.png"], "id": "0034_00345264"} {"messages": [{"role": "user", "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 505.26 mm."}, {"role": "assistant", "content": "```python\n#!/usr/bin/env python3\n# -*- coding: utf-8 -*-\n# Ground-truth 2D engineering drawing for part: 0034_00345527\n# Self-contained: reproduces the three-view DXF via ezdxf, NO FreeCAD needed.\n# Coordinates are A4 page millimetres (scale=0.17290719696970053, page=[297.0, 210.0]).\n# visible edges -> solid (layer OUTLINE); hidden edges -> dashed (layer HIDDEN)\n# dimensions -> real movable DIMENSION entities (text = true mm value)\n# Run: python 0034_00345527_gt.py [out.dxf]\nimport sys\nimport ezdxf\n\nSCALE = 0.17290719696970053\nPAGE = [297.0, 210.0]\n\nVISIBLE_SEGMENTS = [\n (101.463517, 172.049978, 101.463517, 163.313615),\n (101.463517, 163.313615, 84.172797, 163.313615),\n (84.172797, 163.313615, 84.172797, 172.049978),\n (84.172797, 172.049978, 101.463517, 172.049978),\n (101.463517, 61.949978, 101.463517, 149.313615),\n (101.463517, 149.313615, 84.172797, 149.313615),\n (84.172797, 61.949978, 84.172797, 149.313615),\n (101.463517, 61.949978, 84.172797, 61.949978),\n (115.463517, 163.313615, 202.827153, 163.313615),\n (202.827153, 163.313615, 202.827153, 172.049978),\n (115.463517, 172.049978, 202.827153, 172.049978),\n (115.463517, 163.313615, 115.463517, 172.049978)\n]\nVISIBLE_CIRCLES = [\n\n]\nVISIBLE_ARCS = [\n\n]\nHIDDEN_SEGMENTS = [\n\n]\n# (orient, text, p1, p2, base) for linear; (orient, text, center, radius, angle) for diameter\nDIMENSIONS = [\n ('horizontal', '100', (101.4635, 172.05), (84.1728, 172.05), (92.8182, 161.05)),\n ('vertical', '50.5263', (101.4635, 163.3136), (101.4635, 172.05), (90.4635, 167.6818)),\n ('horizontal', '505.263', (115.4635, 163.3136), (202.8272, 163.3136), (159.1454, 174.3136))\n]\n\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\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\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,\n angle=(0 if d[0] == \"horizontal\" else 90),\n 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,\n 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,\n text=text, dimstyle=\"EZDXF\").render()\n\n doc.saveas(out_path)\n\n\nif __name__ == \"__main__\":\n out = sys.argv[1] if len(sys.argv) > 1 else \"0034_00345527_gt.dxf\"\n draw(out)\n print(\"wrote\", out)\n```"}], "images": ["images/0034_00345527.png"], "id": "0034_00345527"} {"messages": [{"role": "user", "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 24.21 mm wide and 100 mm tall. It is extruded to a thickness of 9.9 mm."}, {"role": "assistant", "content": "```python\n#!/usr/bin/env python3\n# -*- coding: utf-8 -*-\n# Ground-truth 2D engineering drawing for part: 0034_00347132\n# Self-contained: reproduces the three-view DXF via ezdxf, NO FreeCAD needed.\n# Coordinates are A4 page millimetres (scale=0.874464454976306, page=[297.0, 210.0]).\n# visible edges -> solid (layer OUTLINE); hidden edges -> dashed (layer HIDDEN)\n# dimensions -> real movable DIMENSION entities (text = true mm value)\n# Run: python 0034_00347132_gt.py [out.dxf]\nimport sys\nimport ezdxf\n\nSCALE = 0.874464454976306\nPAGE = [297.0, 210.0]\n\nVISIBLE_SEGMENTS = [\n (142.758858, 172.050027, 142.758858, 84.603582),\n (142.758858, 84.603582, 121.587613, 84.603582),\n (121.587613, 84.603582, 121.587613, 172.050027),\n (121.587613, 172.050027, 142.758858, 172.050027),\n (142.758858, 61.950027, 142.758858, 70.603582),\n (142.758858, 70.603582, 121.587613, 70.603582),\n (121.587613, 61.950027, 121.587613, 70.603582),\n (142.758858, 61.950027, 121.587613, 61.950027),\n (156.758858, 84.603582, 165.412413, 84.603582),\n (165.412413, 84.603582, 165.412413, 172.050027),\n (156.758858, 172.050027, 165.412413, 172.050027),\n (156.758858, 84.603582, 156.758858, 172.050027)\n]\nVISIBLE_CIRCLES = [\n\n]\nVISIBLE_ARCS = [\n\n]\nHIDDEN_SEGMENTS = [\n\n]\n# (orient, text, p1, p2, base) for linear; (orient, text, center, radius, angle) for diameter\nDIMENSIONS = [\n ('horizontal', '24.2105', (142.7589, 172.05), (121.5876, 172.05), (132.1732, 161.05)),\n ('vertical', '100', (142.7589, 84.6036), (142.7589, 172.05), (131.7589, 128.3268)),\n ('horizontal', '9.8958', (156.7588, 84.6036), (165.4124, 84.6036), (161.0856, 95.6036))\n]\n\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\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\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,\n angle=(0 if d[0] == \"horizontal\" else 90),\n 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,\n 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,\n text=text, dimstyle=\"EZDXF\").render()\n\n doc.saveas(out_path)\n\n\nif __name__ == \"__main__\":\n out = sys.argv[1] if len(sys.argv) > 1 else \"0034_00347132_gt.dxf\"\n draw(out)\n print(\"wrote\", out)\n```"}], "images": ["images/0034_00347132.png"], "id": "0034_00347132"} {"messages": [{"role": "user", "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 12.5 mm."}, {"role": "assistant", "content": "```python\n#!/usr/bin/env python3\n# -*- coding: utf-8 -*-\n# Ground-truth 2D engineering drawing for part: 0034_00348266\n# Self-contained: reproduces the three-view DXF via ezdxf, NO FreeCAD needed.\n# Coordinates are A4 page millimetres (scale=1.3061333333333331, page=[297.0, 210.0]).\n# visible edges -> solid (layer OUTLINE); hidden edges -> dashed (layer HIDDEN)\n# dimensions -> real movable DIMENSION entities (text = true mm value)\n# Run: python 0034_00348266_gt.py [out.dxf]\nimport sys\nimport ezdxf\n\nSCALE = 1.3061333333333331\nPAGE = [297.0, 210.0]\n\nVISIBLE_SEGMENTS = [\n (193.643313, 165.160403, 193.643313, 99.166298),\n (193.643313, 99.166298, 63.02998, 99.166298),\n (63.02998, 99.166298, 63.02998, 165.160403),\n (63.02998, 165.160403, 193.643313, 165.160403),\n (193.643313, 68.839631, 193.643313, 85.166298),\n (193.643313, 85.166298, 63.02998, 85.166298),\n (63.02998, 68.839631, 63.02998, 85.166298),\n (193.643313, 68.839631, 63.02998, 68.839631),\n (207.643313, 99.166298, 223.96998, 99.166298),\n (223.96998, 99.166298, 223.96998, 165.160403),\n (207.643313, 165.160403, 223.96998, 165.160403),\n (207.643313, 99.166298, 207.643313, 165.160403)\n]\nVISIBLE_CIRCLES = [\n\n]\nVISIBLE_ARCS = [\n\n]\nHIDDEN_SEGMENTS = [\n\n]\n# (orient, text, p1, p2, base) for linear; (orient, text, center, radius, angle) for diameter\nDIMENSIONS = [\n ('horizontal', '100', (193.6433, 165.1604), (63.03, 165.1604), (128.3367, 154.1604)),\n ('vertical', '50.5263', (193.6433, 99.1663), (193.6433, 165.1604), (182.6433, 132.1633)),\n ('horizontal', '12.5', (207.6433, 99.1663), (223.97, 99.1663), (215.8067, 110.1663))\n]\n\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\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\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,\n angle=(0 if d[0] == \"horizontal\" else 90),\n 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,\n 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,\n text=text, dimstyle=\"EZDXF\").render()\n\n doc.saveas(out_path)\n\n\nif __name__ == \"__main__\":\n out = sys.argv[1] if len(sys.argv) > 1 else \"0034_00348266_gt.dxf\"\n draw(out)\n print(\"wrote\", out)\n```"}], "images": ["images/0034_00348266.png"], "id": "0034_00348266"} {"messages": [{"role": "user", "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 62.34 mm."}, {"role": "assistant", "content": "```python\n#!/usr/bin/env python3\n# -*- coding: utf-8 -*-\n# Ground-truth 2D engineering drawing for part: 0035_00352103\n# Self-contained: reproduces the three-view DXF via ezdxf, NO FreeCAD needed.\n# Coordinates are A4 page millimetres (scale=0.5919760000000013, page=[297.0, 210.0]).\n# visible edges -> solid (layer OUTLINE); hidden edges -> dashed (layer HIDDEN)\n# dimensions -> real movable DIMENSION entities (text = true mm value)\n# Run: python 0035_00352103_gt.py [out.dxf]\nimport sys\nimport ezdxf\n\nSCALE = 0.5919760000000013\nPAGE = [297.0, 210.0]\n\nVISIBLE_SEGMENTS = [\n (147.6476, 172.05, 147.6476, 112.8524),\n (147.6476, 112.8524, 88.45, 112.8524),\n (88.45, 112.8524, 88.45, 172.05),\n (88.45, 172.05, 147.6476, 172.05),\n (147.6476, 61.95, 147.6476, 98.8524),\n (147.6476, 98.8524, 88.45, 98.8524),\n (88.45, 61.95, 88.45, 98.8524),\n (147.6476, 61.95, 88.45, 61.95),\n (161.6476, 112.8524, 198.55, 112.8524),\n (198.55, 112.8524, 198.55, 172.05),\n (161.6476, 172.05, 198.55, 172.05),\n (161.6476, 112.8524, 161.6476, 172.05)\n]\nVISIBLE_CIRCLES = [\n\n]\nVISIBLE_ARCS = [\n\n]\nHIDDEN_SEGMENTS = [\n\n]\n# (orient, text, p1, p2, base) for linear; (orient, text, center, radius, angle) for diameter\nDIMENSIONS = [\n ('horizontal', '100', (147.6476, 172.05), (88.45, 172.05), (118.0488, 161.05)),\n ('vertical', '100', (147.6476, 112.8524), (147.6476, 172.05), (136.6476, 142.4512)),\n ('horizontal', '62.3377', (161.6476, 112.8524), (198.55, 112.8524), (180.0988, 123.8524))\n]\n\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\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\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,\n angle=(0 if d[0] == \"horizontal\" else 90),\n 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,\n 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,\n text=text, dimstyle=\"EZDXF\").render()\n\n doc.saveas(out_path)\n\n\nif __name__ == \"__main__\":\n out = sys.argv[1] if len(sys.argv) > 1 else \"0035_00352103_gt.dxf\"\n draw(out)\n print(\"wrote\", out)\n```"}], "images": ["images/0035_00352103.png"], "id": "0035_00352103"} {"messages": [{"role": "user", "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 63.16 mm tall. It is extruded to a thickness of 70 mm."}, {"role": "assistant", "content": "```python\n#!/usr/bin/env python3\n# -*- coding: utf-8 -*-\n# Ground-truth 2D engineering drawing for part: 0035_00352519\n# Self-contained: reproduces the three-view DXF via ezdxf, NO FreeCAD needed.\n# Coordinates are A4 page millimetres (scale=0.7216996047430944, page=[297.0, 210.0]).\n# visible edges -> solid (layer OUTLINE); hidden edges -> dashed (layer HIDDEN)\n# dimensions -> real movable DIMENSION entities (text = true mm value)\n# Run: python 0035_00352519_gt.py [out.dxf]\nimport sys\nimport ezdxf\n\nSCALE = 0.7216996047430944\nPAGE = [297.0, 210.0]\n\nVISIBLE_SEGMENTS = [\n (147.325498, 172.050017, 147.325498, 126.468989),\n (147.325498, 126.468989, 75.155537, 126.468989),\n (75.155537, 126.468989, 75.155537, 172.050017),\n (75.155537, 172.050017, 147.325498, 172.050017),\n (147.325498, 61.950017, 147.325498, 112.468989),\n (147.325498, 112.468989, 75.155537, 112.468989),\n (75.155537, 61.950017, 75.155537, 112.468989),\n (147.325498, 61.950017, 75.155537, 61.950017),\n (161.325498, 126.468989, 211.84447, 126.468989),\n (211.84447, 126.468989, 211.84447, 172.050017),\n (161.325498, 172.050017, 211.84447, 172.050017),\n (161.325498, 126.468989, 161.325498, 172.050017)\n]\nVISIBLE_CIRCLES = [\n\n]\nVISIBLE_ARCS = [\n\n]\nHIDDEN_SEGMENTS = [\n\n]\n# (orient, text, p1, p2, base) for linear; (orient, text, center, radius, angle) for diameter\nDIMENSIONS = [\n ('horizontal', '100', (147.3255, 172.05), (75.1555, 172.05), (111.2405, 161.05)),\n ('vertical', '63.1579', (147.3255, 126.469), (147.3255, 172.05), (136.3255, 149.2595)),\n ('horizontal', '70', (161.3255, 126.469), (211.8445, 126.469), (186.585, 137.469))\n]\n\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\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\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,\n angle=(0 if d[0] == \"horizontal\" else 90),\n 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,\n 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,\n text=text, dimstyle=\"EZDXF\").render()\n\n doc.saveas(out_path)\n\n\nif __name__ == \"__main__\":\n out = sys.argv[1] if len(sys.argv) > 1 else \"0035_00352519_gt.dxf\"\n draw(out)\n print(\"wrote\", out)\n```"}], "images": ["images/0035_00352519.png"], "id": "0035_00352519"} {"messages": [{"role": "user", "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 1.04 mm."}, {"role": "assistant", "content": "```python\n#!/usr/bin/env python3\n# -*- coding: utf-8 -*-\n# Ground-truth 2D engineering drawing for part: 0036_00360691\n# Self-contained: reproduces the three-view DXF via ezdxf, NO FreeCAD needed.\n# Coordinates are A4 page millimetres (scale=0.9510927835051514, page=[297.0, 210.0]).\n# visible edges -> solid (layer OUTLINE); hidden edges -> dashed (layer HIDDEN)\n# dimensions -> real movable DIMENSION entities (text = true mm value)\n# Run: python 0036_00360691_gt.py [out.dxf]\nimport sys\nimport ezdxf\n\nSCALE = 0.9510927835051514\nPAGE = [297.0, 210.0]\n\nVISIBLE_SEGMENTS = [\n (137.005796, 76.940713, 137.005796, 172.049991),\n (137.005796, 172.049991, 135.003495, 172.049991),\n (135.003495, 172.049991, 135.003495, 76.940713),\n (135.003495, 76.940713, 137.005796, 76.940713),\n (137.005796, 62.940713, 137.005796, 61.949991),\n (135.003495, 62.940713, 135.003495, 61.949991),\n (135.003495, 61.949991, 137.005796, 61.949991),\n (135.003495, 62.940713, 137.005796, 62.940713),\n (151.996517, 172.049991, 151.005796, 172.049991),\n (151.005796, 172.049991, 151.005796, 76.940713),\n (151.996517, 76.940713, 151.005796, 76.940713),\n (151.996517, 172.049991, 151.996517, 76.940713)\n]\nVISIBLE_CIRCLES = [\n\n]\nVISIBLE_ARCS = [\n\n]\nHIDDEN_SEGMENTS = [\n\n]\n# (orient, text, p1, p2, base) for linear; (orient, text, center, radius, angle) for diameter\nDIMENSIONS = [\n ('horizontal', '2.1053', (137.0058, 76.9407), (135.0035, 76.9407), (136.0047, 65.9407)),\n ('vertical', '100', (137.0058, 172.05), (137.0058, 76.9407), (148.0058, 124.4954)),\n ('horizontal', '1.0417', (151.9965, 172.05), (151.0058, 172.05), (151.5011, 161.05))\n]\n\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\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\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,\n angle=(0 if d[0] == \"horizontal\" else 90),\n 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,\n 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,\n text=text, dimstyle=\"EZDXF\").render()\n\n doc.saveas(out_path)\n\n\nif __name__ == \"__main__\":\n out = sys.argv[1] if len(sys.argv) > 1 else \"0036_00360691_gt.dxf\"\n draw(out)\n print(\"wrote\", out)\n```"}], "images": ["images/0036_00360691.png"], "id": "0036_00360691"} {"messages": [{"role": "user", "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 -137.14 mm."}, {"role": "assistant", "content": "```python\n#!/usr/bin/env python3\n# -*- coding: utf-8 -*-\n# Ground-truth 2D engineering drawing for part: 0036_00360777\n# Self-contained: reproduces the three-view DXF via ezdxf, NO FreeCAD needed.\n# Coordinates are A4 page millimetres (scale=0.40524096385551933, page=[297.0, 210.0]).\n# visible edges -> solid (layer OUTLINE); hidden edges -> dashed (layer HIDDEN)\n# dimensions -> real movable DIMENSION entities (text = true mm value)\n# Run: python 0036_00360777_gt.py [out.dxf]\nimport sys\nimport ezdxf\n\nSCALE = 0.40524096385551933\nPAGE = [297.0, 210.0]\n\nVISIBLE_SEGMENTS = [\n (128.974099, 172.049998, 128.974099, 131.525901),\n (128.974099, 131.525901, 88.450002, 131.525901),\n (88.450002, 131.525901, 88.450002, 172.049998),\n (88.450002, 172.049998, 128.974099, 172.049998),\n (128.974099, 117.525901, 128.974099, 61.949998),\n (128.974099, 61.949998, 88.450002, 61.949998),\n (88.450002, 117.525901, 88.450002, 61.949998),\n (128.974099, 117.525901, 88.450002, 117.525901),\n (198.550002, 131.525901, 142.974099, 131.525901),\n (142.974099, 131.525901, 142.974099, 172.049998),\n (198.550002, 172.049998, 142.974099, 172.049998),\n (198.550002, 131.525901, 198.550002, 172.049998)\n]\nVISIBLE_CIRCLES = [\n\n]\nVISIBLE_ARCS = [\n\n]\nHIDDEN_SEGMENTS = [\n\n]\n# (orient, text, p1, p2, base) for linear; (orient, text, center, radius, angle) for diameter\nDIMENSIONS = [\n ('horizontal', '100', (128.9741, 172.05), (88.45, 172.05), (108.712, 161.05)),\n ('vertical', '100', (128.9741, 131.5259), (128.9741, 172.05), (117.9741, 151.788)),\n ('horizontal', '137.143', (198.55, 131.5259), (142.9741, 131.5259), (170.762, 120.5259))\n]\n\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\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\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,\n angle=(0 if d[0] == \"horizontal\" else 90),\n 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,\n 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,\n text=text, dimstyle=\"EZDXF\").render()\n\n doc.saveas(out_path)\n\n\nif __name__ == \"__main__\":\n out = sys.argv[1] if len(sys.argv) > 1 else \"0036_00360777_gt.dxf\"\n draw(out)\n print(\"wrote\", out)\n```"}], "images": ["images/0036_00360777.png"], "id": "0036_00360777"} {"messages": [{"role": "user", "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": "assistant", "content": "```python\n#!/usr/bin/env python3\n# -*- coding: utf-8 -*-\n# Ground-truth 2D engineering drawing for part: 0036_00361047\n# Self-contained: reproduces the three-view DXF via ezdxf, NO FreeCAD needed.\n# Coordinates are A4 page millimetres (scale=0.19220000000002305, page=[297.0, 210.0]).\n# visible edges -> solid (layer OUTLINE); hidden edges -> dashed (layer HIDDEN)\n# dimensions -> real movable DIMENSION entities (text = true mm value)\n# Run: python 0036_00361047_gt.py [out.dxf]\nimport sys\nimport ezdxf\n\nSCALE = 0.19220000000002305\nPAGE = [297.0, 210.0]\n\nVISIBLE_SEGMENTS = [\n (107.67, 152.83, 107.67, 172.05),\n (107.67, 172.05, 88.45, 172.05),\n (88.45, 172.05, 88.45, 152.83),\n (88.45, 152.83, 107.67, 152.83),\n (107.67, 138.83, 107.67, 61.95),\n (88.45, 138.83, 88.45, 61.95),\n (88.45, 61.95, 107.67, 61.95),\n (88.45, 138.83, 107.67, 138.83),\n (198.55, 172.05, 121.67, 172.05),\n (121.67, 172.05, 121.67, 152.83),\n (198.55, 152.83, 121.67, 152.83),\n (198.55, 172.05, 198.55, 152.83)\n]\nVISIBLE_CIRCLES = [\n\n]\nVISIBLE_ARCS = [\n\n]\nHIDDEN_SEGMENTS = [\n\n]\n# (orient, text, p1, p2, base) for linear; (orient, text, center, radius, angle) for diameter\nDIMENSIONS = [\n ('horizontal', '100', (107.67, 152.83), (88.45, 152.83), (98.06, 141.83)),\n ('vertical', '100', (107.67, 172.05), (107.67, 152.83), (118.67, 162.44)),\n ('horizontal', '400', (198.55, 172.05), (121.67, 172.05), (160.11, 161.05))\n]\n\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\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\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,\n angle=(0 if d[0] == \"horizontal\" else 90),\n 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,\n 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,\n text=text, dimstyle=\"EZDXF\").render()\n\n doc.saveas(out_path)\n\n\nif __name__ == \"__main__\":\n out = sys.argv[1] if len(sys.argv) > 1 else \"0036_00361047_gt.dxf\"\n draw(out)\n print(\"wrote\", out)\n```"}], "images": ["images/0036_00361047.png"], "id": "0036_00361047"} {"messages": [{"role": "user", "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 40 mm."}, {"role": "assistant", "content": "```python\n#!/usr/bin/env python3\n# -*- coding: utf-8 -*-\n# Ground-truth 2D engineering drawing for part: 0036_00361388\n# Self-contained: reproduces the three-view DXF via ezdxf, NO FreeCAD needed.\n# Coordinates are A4 page millimetres (scale=0.9183750000000229, page=[297.0, 210.0]).\n# visible edges -> solid (layer OUTLINE); hidden edges -> dashed (layer HIDDEN)\n# dimensions -> real movable DIMENSION entities (text = true mm value)\n# Run: python 0036_00361388_gt.py [out.dxf]\nimport sys\nimport ezdxf\n\nSCALE = 0.9183750000000229\nPAGE = [297.0, 210.0]\n\nVISIBLE_SEGMENTS = [\n (164.0512, 114.81626, 164.0512, 169.91876),\n (164.0512, 169.91876, 72.2137, 169.91876),\n (72.2137, 169.91876, 72.2137, 114.81626),\n (72.2137, 114.81626, 164.0512, 114.81626),\n (164.0512, 100.81626, 164.0512, 64.08126),\n (72.2137, 100.81626, 72.2137, 64.08126),\n (72.2137, 64.08126, 164.0512, 64.08126),\n (72.2137, 100.81626, 164.0512, 100.81626),\n (214.7862, 169.91876, 178.0512, 169.91876),\n (178.0512, 169.91876, 178.0512, 114.81626),\n (214.7862, 114.81626, 178.0512, 114.81626),\n (214.7862, 169.91876, 214.7862, 114.81626)\n]\nVISIBLE_CIRCLES = [\n\n]\nVISIBLE_ARCS = [\n\n]\nHIDDEN_SEGMENTS = [\n\n]\n# (orient, text, p1, p2, base) for linear; (orient, text, center, radius, angle) for diameter\nDIMENSIONS = [\n ('horizontal', '100', (164.0512, 114.8162), (72.2137, 114.8162), (118.1325, 103.8162)),\n ('vertical', '60', (164.0512, 169.9188), (164.0512, 114.8162), (175.0512, 142.3675)),\n ('horizontal', '40', (214.7862, 169.9188), (178.0512, 169.9188), (196.4187, 158.9188))\n]\n\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\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\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,\n angle=(0 if d[0] == \"horizontal\" else 90),\n 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,\n 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,\n text=text, dimstyle=\"EZDXF\").render()\n\n doc.saveas(out_path)\n\n\nif __name__ == \"__main__\":\n out = sys.argv[1] if len(sys.argv) > 1 else \"0036_00361388_gt.dxf\"\n draw(out)\n print(\"wrote\", out)\n```"}], "images": ["images/0036_00361388.png"], "id": "0036_00361388"} {"messages": [{"role": "user", "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 3.03 mm."}, {"role": "assistant", "content": "```python\n#!/usr/bin/env python3\n# -*- coding: utf-8 -*-\n# Ground-truth 2D engineering drawing for part: 0036_00362167\n# Self-contained: reproduces the three-view DXF via ezdxf, NO FreeCAD needed.\n# Coordinates are A4 page millimetres (scale=0.9327352941176473, page=[297.0, 210.0]).\n# visible edges -> solid (layer OUTLINE); hidden edges -> dashed (layer HIDDEN)\n# dimensions -> real movable DIMENSION entities (text = true mm value)\n# Run: python 0036_00362167_gt.py [out.dxf]\nimport sys\nimport ezdxf\n\nSCALE = 0.9327352941176473\nPAGE = [297.0, 210.0]\n\nVISIBLE_SEGMENTS = [\n (181.723512, 172.050018, 181.723512, 78.776488),\n (181.723512, 78.776488, 88.449982, 78.776488),\n (88.449982, 78.776488, 88.449982, 172.050018),\n (88.449982, 172.050018, 181.723512, 172.050018),\n (181.723512, 61.950018, 181.723512, 64.776488),\n (181.723512, 64.776488, 88.449982, 64.776488),\n (88.449982, 61.950018, 88.449982, 64.776488),\n (181.723512, 61.950018, 88.449982, 61.950018),\n (195.723512, 78.776488, 198.549982, 78.776488),\n (198.549982, 78.776488, 198.549982, 172.050018),\n (195.723512, 172.050018, 198.549982, 172.050018),\n (195.723512, 78.776488, 195.723512, 172.050018)\n]\nVISIBLE_CIRCLES = [\n\n]\nVISIBLE_ARCS = [\n\n]\nHIDDEN_SEGMENTS = [\n\n]\n# (orient, text, p1, p2, base) for linear; (orient, text, center, radius, angle) for diameter\nDIMENSIONS = [\n ('horizontal', '100', (181.7235, 172.05), (88.45, 172.05), (135.0868, 161.05)),\n ('vertical', '100', (181.7235, 78.7765), (181.7235, 172.05), (170.7235, 125.4133)),\n ('horizontal', '3.0303', (195.7235, 78.7765), (198.55, 78.7765), (197.1368, 89.7765))\n]\n\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\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\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,\n angle=(0 if d[0] == \"horizontal\" else 90),\n 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,\n 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,\n text=text, dimstyle=\"EZDXF\").render()\n\n doc.saveas(out_path)\n\n\nif __name__ == \"__main__\":\n out = sys.argv[1] if len(sys.argv) > 1 else \"0036_00362167_gt.dxf\"\n draw(out)\n print(\"wrote\", out)\n```"}], "images": ["images/0036_00362167.png"], "id": "0036_00362167"} {"messages": [{"role": "user", "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": "assistant", "content": "```python\n#!/usr/bin/env python3\n# -*- coding: utf-8 -*-\n# Ground-truth 2D engineering drawing for part: 0036_00369519\n# Self-contained: reproduces the three-view DXF via ezdxf, NO FreeCAD needed.\n# Coordinates are A4 page millimetres (scale=0.48050000000001913, page=[297.0, 210.0]).\n# visible edges -> solid (layer OUTLINE); hidden edges -> dashed (layer HIDDEN)\n# dimensions -> real movable DIMENSION entities (text = true mm value)\n# Run: python 0036_00369519_gt.py [out.dxf]\nimport sys\nimport ezdxf\n\nSCALE = 0.48050000000001913\nPAGE = [297.0, 210.0]\n\nVISIBLE_SEGMENTS = [\n (136.5, 172.05, 136.5, 124.0),\n (136.5, 124.0, 88.45, 124.0),\n (88.45, 124.0, 88.45, 172.05),\n (88.45, 172.05, 136.5, 172.05),\n (136.5, 61.95, 136.5, 110.0),\n (88.45, 61.95, 88.45, 110.0),\n (88.45, 110.0, 136.5, 110.0),\n (88.45, 61.95, 136.5, 61.95),\n (198.55, 124.0, 150.5, 124.0),\n (150.5, 124.0, 150.5, 172.05),\n (198.55, 172.05, 150.5, 172.05),\n (198.55, 124.0, 198.55, 172.05)\n]\nVISIBLE_CIRCLES = [\n\n]\nVISIBLE_ARCS = [\n\n]\nHIDDEN_SEGMENTS = [\n\n]\n# (orient, text, p1, p2, base) for linear; (orient, text, center, radius, angle) for diameter\nDIMENSIONS = [\n ('horizontal', '100', (136.5, 124.0), (88.45, 124.0), (112.475, 113.0)),\n ('vertical', '100', (136.5, 172.05), (136.5, 124.0), (147.5, 148.025)),\n ('horizontal', '100', (198.55, 172.05), (150.5, 172.05), (174.525, 161.05))\n]\n\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\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\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,\n angle=(0 if d[0] == \"horizontal\" else 90),\n 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,\n 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,\n text=text, dimstyle=\"EZDXF\").render()\n\n doc.saveas(out_path)\n\n\nif __name__ == \"__main__\":\n out = sys.argv[1] if len(sys.argv) > 1 else \"0036_00369519_gt.dxf\"\n draw(out)\n print(\"wrote\", out)\n```"}], "images": ["images/0036_00369519.png"], "id": "0036_00369519"} {"messages": [{"role": "user", "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 -1371.43 mm."}, {"role": "assistant", "content": "```python\n#!/usr/bin/env python3\n# -*- coding: utf-8 -*-\n# Ground-truth 2D engineering drawing for part: 0037_00372380\n# Self-contained: reproduces the three-view DXF via ezdxf, NO FreeCAD needed.\n# Coordinates are A4 page millimetres (scale=0.0338040201004924, page=[297.0, 210.0]).\n# visible edges -> solid (layer OUTLINE); hidden edges -> dashed (layer HIDDEN)\n# dimensions -> real movable DIMENSION entities (text = true mm value)\n# Run: python 0037_00372380_gt.py [out.dxf]\nimport sys\nimport ezdxf\n\nSCALE = 0.0338040201004924\nPAGE = [297.0, 210.0]\n\nVISIBLE_SEGMENTS = [\n (91.830401, 168.669599, 91.830401, 172.050001),\n (88.449999, 168.669599, 91.830401, 168.669599),\n (91.830401, 172.050001, 88.449999, 172.050001),\n (88.449999, 172.050001, 88.449999, 168.669599),\n (91.830401, 61.950001, 91.830401, 154.669599),\n (88.449999, 154.669599, 91.830401, 154.669599),\n (88.449999, 61.950001, 91.830401, 61.950001),\n (88.449999, 61.950001, 88.449999, 154.669599),\n (105.830401, 168.669599, 198.549999, 168.669599),\n (198.549999, 172.050001, 105.830401, 172.050001),\n (198.549999, 172.050001, 198.549999, 168.669599),\n (105.830401, 172.050001, 105.830401, 168.669599)\n]\nVISIBLE_CIRCLES = [\n\n]\nVISIBLE_ARCS = [\n\n]\nHIDDEN_SEGMENTS = [\n\n]\n# (orient, text, p1, p2, base) for linear; (orient, text, center, radius, angle) for diameter\nDIMENSIONS = [\n ('horizontal', '100', (91.8304, 168.6696), (88.45, 168.6696), (90.1402, 157.6696)),\n ('vertical', '100', (91.8304, 172.05), (91.8304, 168.6696), (102.8304, 170.3598)),\n ('horizontal', '2742.86', (105.8304, 172.05), (198.55, 172.05), (152.1902, 183.05))\n]\n\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\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\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,\n angle=(0 if d[0] == \"horizontal\" else 90),\n 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,\n 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,\n text=text, dimstyle=\"EZDXF\").render()\n\n doc.saveas(out_path)\n\n\nif __name__ == \"__main__\":\n out = sys.argv[1] if len(sys.argv) > 1 else \"0037_00372380_gt.dxf\"\n draw(out)\n print(\"wrote\", out)\n```"}], "images": ["images/0037_00372380.png"], "id": "0037_00372380"} {"messages": [{"role": "user", "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": "assistant", "content": "```python\n#!/usr/bin/env python3\n# -*- coding: utf-8 -*-\n# Ground-truth 2D engineering drawing for part: 0038_00388103\n# Self-contained: reproduces the three-view DXF via ezdxf, NO FreeCAD needed.\n# Coordinates are A4 page millimetres (scale=0.4805000000000071, page=[297.0, 210.0]).\n# visible edges -> solid (layer OUTLINE); hidden edges -> dashed (layer HIDDEN)\n# dimensions -> real movable DIMENSION entities (text = true mm value)\n# Run: python 0038_00388103_gt.py [out.dxf]\nimport sys\nimport ezdxf\n\nSCALE = 0.4805000000000071\nPAGE = [297.0, 210.0]\n\nVISIBLE_SEGMENTS = [\n (136.5, 172.05, 136.5, 124.0),\n (136.5, 124.0, 88.45, 124.0),\n (88.45, 124.0, 88.45, 172.05),\n (88.45, 172.05, 136.5, 172.05),\n (136.5, 61.95, 136.5, 110.0),\n (88.45, 61.95, 88.45, 110.0),\n (88.45, 110.0, 136.5, 110.0),\n (88.45, 61.95, 136.5, 61.95),\n (198.55, 124.0, 150.5, 124.0),\n (150.5, 124.0, 150.5, 172.05),\n (198.55, 172.05, 150.5, 172.05),\n (198.55, 124.0, 198.55, 172.05)\n]\nVISIBLE_CIRCLES = [\n\n]\nVISIBLE_ARCS = [\n\n]\nHIDDEN_SEGMENTS = [\n\n]\n# (orient, text, p1, p2, base) for linear; (orient, text, center, radius, angle) for diameter\nDIMENSIONS = [\n ('horizontal', '100', (136.5, 124.0), (88.45, 124.0), (112.475, 113.0)),\n ('vertical', '100', (136.5, 172.05), (136.5, 124.0), (147.5, 148.025)),\n ('horizontal', '100', (198.55, 172.05), (150.5, 172.05), (174.525, 161.05))\n]\n\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\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\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,\n angle=(0 if d[0] == \"horizontal\" else 90),\n 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,\n 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,\n text=text, dimstyle=\"EZDXF\").render()\n\n doc.saveas(out_path)\n\n\nif __name__ == \"__main__\":\n out = sys.argv[1] if len(sys.argv) > 1 else \"0038_00388103_gt.dxf\"\n draw(out)\n print(\"wrote\", out)\n```"}], "images": ["images/0038_00388103.png"], "id": "0038_00388103"} {"messages": [{"role": "user", "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 18.95 mm tall. It is extruded to a thickness of 2.08 mm."}, {"role": "assistant", "content": "```python\n#!/usr/bin/env python3\n# -*- coding: utf-8 -*-\n# Ground-truth 2D engineering drawing for part: 0039_00390080\n# Self-contained: reproduces the three-view DXF via ezdxf, NO FreeCAD needed.\n# Coordinates are A4 page millimetres (scale=1.2353362831858368, page=[297.0, 210.0]).\n# visible edges -> solid (layer OUTLINE); hidden edges -> dashed (layer HIDDEN)\n# dimensions -> real movable DIMENSION entities (text = true mm value)\n# Run: python 0039_00390080_gt.py [out.dxf]\nimport sys\nimport ezdxf\n\nSCALE = 1.2353362831858368\nPAGE = [297.0, 210.0]\n\nVISIBLE_SEGMENTS = [\n (196.980002, 113.583617, 196.980002, 136.989989),\n (196.980002, 136.989989, 73.446374, 136.989989),\n (73.446374, 136.989989, 73.446374, 113.583617),\n (73.446374, 113.583617, 196.980002, 113.583617),\n (196.980002, 99.583617, 196.980002, 97.01),\n (73.446374, 99.583617, 73.446374, 97.01),\n (73.446374, 97.01, 196.980002, 97.01),\n (73.446374, 99.583617, 196.980002, 99.583617),\n (213.553619, 136.989989, 210.980002, 136.989989),\n (210.980002, 136.989989, 210.980002, 113.583617),\n (213.553619, 113.583617, 210.980002, 113.583617),\n (213.553619, 136.989989, 213.553619, 113.583617)\n]\nVISIBLE_CIRCLES = [\n\n]\nVISIBLE_ARCS = [\n\n]\nHIDDEN_SEGMENTS = [\n\n]\n# (orient, text, p1, p2, base) for linear; (orient, text, center, radius, angle) for diameter\nDIMENSIONS = [\n ('horizontal', '100', (196.98, 113.5836), (73.4464, 113.5836), (135.2132, 102.5836)),\n ('vertical', '18.9474', (196.98, 136.99), (196.98, 113.5836), (207.98, 125.2868)),\n ('horizontal', '2.0833', (213.5536, 136.99), (210.98, 136.99), (212.2668, 125.99))\n]\n\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\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\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,\n angle=(0 if d[0] == \"horizontal\" else 90),\n 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,\n 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,\n text=text, dimstyle=\"EZDXF\").render()\n\n doc.saveas(out_path)\n\n\nif __name__ == \"__main__\":\n out = sys.argv[1] if len(sys.argv) > 1 else \"0039_00390080_gt.dxf\"\n draw(out)\n print(\"wrote\", out)\n```"}], "images": ["images/0039_00390080.png"], "id": "0039_00390080"} {"messages": [{"role": "user", "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": "assistant", "content": "```python\n#!/usr/bin/env python3\n# -*- coding: utf-8 -*-\n# Ground-truth 2D engineering drawing for part: 0039_00390085\n# Self-contained: reproduces the three-view DXF via ezdxf, NO FreeCAD needed.\n# Coordinates are A4 page millimetres (scale=0.4805, page=[297.0, 210.0]).\n# visible edges -> solid (layer OUTLINE); hidden edges -> dashed (layer HIDDEN)\n# dimensions -> real movable DIMENSION entities (text = true mm value)\n# Run: python 0039_00390085_gt.py [out.dxf]\nimport sys\nimport ezdxf\n\nSCALE = 0.4805\nPAGE = [297.0, 210.0]\n\nVISIBLE_SEGMENTS = [\n (136.5, 172.05, 136.5, 124.0),\n (136.5, 124.0, 88.45, 124.0),\n (88.45, 124.0, 88.45, 172.05),\n (88.45, 172.05, 136.5, 172.05),\n (136.5, 61.95, 136.5, 110.0),\n (136.5, 110.0, 88.45, 110.0),\n (88.45, 61.95, 88.45, 110.0),\n (136.5, 61.95, 88.45, 61.95),\n (150.5, 124.0, 198.55, 124.0),\n (198.55, 124.0, 198.55, 172.05),\n (150.5, 172.05, 198.55, 172.05),\n (150.5, 124.0, 150.5, 172.05)\n]\nVISIBLE_CIRCLES = [\n\n]\nVISIBLE_ARCS = [\n\n]\nHIDDEN_SEGMENTS = [\n\n]\n# (orient, text, p1, p2, base) for linear; (orient, text, center, radius, angle) for diameter\nDIMENSIONS = [\n ('horizontal', '100', (136.5, 172.05), (88.45, 172.05), (112.475, 161.05)),\n ('vertical', '100', (136.5, 124.0), (136.5, 172.05), (125.5, 148.025)),\n ('horizontal', '100', (150.5, 124.0), (198.55, 124.0), (174.525, 135.0))\n]\n\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\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\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,\n angle=(0 if d[0] == \"horizontal\" else 90),\n 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,\n 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,\n text=text, dimstyle=\"EZDXF\").render()\n\n doc.saveas(out_path)\n\n\nif __name__ == \"__main__\":\n out = sys.argv[1] if len(sys.argv) > 1 else \"0039_00390085_gt.dxf\"\n draw(out)\n print(\"wrote\", out)\n```"}], "images": ["images/0039_00390085.png"], "id": "0039_00390085"} {"messages": [{"role": "user", "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 9.64 mm."}, {"role": "assistant", "content": "```python\n#!/usr/bin/env python3\n# -*- coding: utf-8 -*-\n# Ground-truth 2D engineering drawing for part: 0039_00390299\n# Self-contained: reproduces the three-view DXF via ezdxf, NO FreeCAD needed.\n# Coordinates are A4 page millimetres (scale=0.8765164835165273, page=[297.0, 210.0]).\n# visible edges -> solid (layer OUTLINE); hidden edges -> dashed (layer HIDDEN)\n# dimensions -> real movable DIMENSION entities (text = true mm value)\n# Run: python 0039_00390299_gt.py [out.dxf]\nimport sys\nimport ezdxf\n\nSCALE = 0.8765164835165273\nPAGE = [297.0, 210.0]\n\nVISIBLE_SEGMENTS = [\n (154.419399, 172.049969, 154.419399, 84.398321),\n (154.419399, 84.398321, 110.132251, 84.398321),\n (110.132251, 84.398321, 110.132251, 172.049969),\n (110.132251, 172.049969, 154.419399, 172.049969),\n (154.419399, 61.949969, 154.419399, 70.398321),\n (154.419399, 70.398321, 110.132251, 70.398321),\n (110.132251, 61.949969, 110.132251, 70.398321),\n (154.419399, 61.949969, 110.132251, 61.949969),\n (168.419399, 84.398321, 176.867751, 84.398321),\n (176.867751, 84.398321, 176.867751, 172.049969),\n (168.419399, 172.049969, 176.867751, 172.049969),\n (168.419399, 84.398321, 168.419399, 172.049969)\n]\nVISIBLE_CIRCLES = [\n\n]\nVISIBLE_ARCS = [\n\n]\nHIDDEN_SEGMENTS = [\n\n]\n# (orient, text, p1, p2, base) for linear; (orient, text, center, radius, angle) for diameter\nDIMENSIONS = [\n ('horizontal', '50.5263', (154.4194, 172.05), (110.1322, 172.05), (132.2758, 161.05)),\n ('vertical', '100', (154.4194, 84.3983), (154.4194, 172.05), (143.4194, 128.2242)),\n ('horizontal', '9.6386', (168.4194, 84.3983), (176.8678, 84.3983), (172.6436, 95.3983))\n]\n\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\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\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,\n angle=(0 if d[0] == \"horizontal\" else 90),\n 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,\n 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,\n text=text, dimstyle=\"EZDXF\").render()\n\n doc.saveas(out_path)\n\n\nif __name__ == \"__main__\":\n out = sys.argv[1] if len(sys.argv) > 1 else \"0039_00390299_gt.dxf\"\n draw(out)\n print(\"wrote\", out)\n```"}], "images": ["images/0039_00390299.png"], "id": "0039_00390299"} {"messages": [{"role": "user", "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. It is extruded to a thickness of 71.91 mm."}, {"role": "assistant", "content": "```python\n#!/usr/bin/env python3\n# -*- coding: utf-8 -*-\n# Ground-truth 2D engineering drawing for part: 0039_00391480\n# Self-contained: reproduces the three-view DXF via ezdxf, NO FreeCAD needed.\n# Coordinates are A4 page millimetres (scale=0.7525474668889509, page=[297.0, 210.0]).\n# visible edges -> solid (layer OUTLINE); hidden edges -> dashed (layer HIDDEN)\n# dimensions -> real movable DIMENSION entities (text = true mm value)\n# Run: python 0039_00391480_gt.py [out.dxf]\nimport sys\nimport ezdxf\n\nSCALE = 0.7525474668889509\nPAGE = [297.0, 210.0]\n\nVISIBLE_SEGMENTS = [\n (147.069495, 130.065784, 147.069495, 172.050011),\n (147.069495, 172.050011, 71.814748, 172.050011),\n (71.814748, 172.050011, 71.814748, 130.065784),\n (71.814748, 130.065784, 147.069495, 130.065784),\n (147.069495, 116.065784, 147.069495, 61.950011),\n (71.814748, 116.065784, 71.814748, 61.950011),\n (71.814748, 61.950011, 147.069495, 61.950011),\n (71.814748, 116.065784, 147.069495, 116.065784),\n (215.185268, 172.050011, 161.069495, 172.050011),\n (161.069495, 172.050011, 161.069495, 130.065784),\n (215.185268, 130.065784, 161.069495, 130.065784),\n (215.185268, 172.050011, 215.185268, 130.065784)\n]\nVISIBLE_CIRCLES = [\n\n]\nVISIBLE_ARCS = [\n\n]\nHIDDEN_SEGMENTS = [\n\n]\n# (orient, text, p1, p2, base) for linear; (orient, text, center, radius, angle) for diameter\nDIMENSIONS = [\n ('horizontal', '100', (147.0695, 130.0658), (71.8147, 130.0658), (109.4421, 119.0658)),\n ('vertical', '55.7895', (147.0695, 172.05), (147.0695, 130.0658), (158.0695, 151.0579)),\n ('horizontal', '71.9101', (215.1853, 172.05), (161.0695, 172.05), (188.1274, 161.05))\n]\n\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\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\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,\n angle=(0 if d[0] == \"horizontal\" else 90),\n 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,\n 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,\n text=text, dimstyle=\"EZDXF\").render()\n\n doc.saveas(out_path)\n\n\nif __name__ == \"__main__\":\n out = sys.argv[1] if len(sys.argv) > 1 else \"0039_00391480_gt.dxf\"\n draw(out)\n print(\"wrote\", out)\n```"}], "images": ["images/0039_00391480.png"], "id": "0039_00391480"} {"messages": [{"role": "user", "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 18.95 mm tall. It is extruded to a thickness of 1.56 mm."}, {"role": "assistant", "content": "```python\n#!/usr/bin/env python3\n# -*- coding: utf-8 -*-\n# Ground-truth 2D engineering drawing for part: 0039_00393910\n# Self-contained: reproduces the three-view DXF via ezdxf, NO FreeCAD needed.\n# Coordinates are A4 page millimetres (scale=1.235336283185837, page=[297.0, 210.0]).\n# visible edges -> solid (layer OUTLINE); hidden edges -> dashed (layer HIDDEN)\n# dimensions -> real movable DIMENSION entities (text = true mm value)\n# Run: python 0039_00393910_gt.py [out.dxf]\nimport sys\nimport ezdxf\n\nSCALE = 1.235336283185837\nPAGE = [297.0, 210.0]\n\nVISIBLE_SEGMENTS = [\n (197.301703, 113.261917, 197.301703, 136.668289),\n (197.301703, 136.668289, 73.768075, 136.668289),\n (73.768075, 136.668289, 73.768075, 113.261917),\n (73.768075, 113.261917, 197.301703, 113.261917),\n (197.301703, 99.261917, 197.301703, 97.331704),\n (73.768075, 99.261917, 73.768075, 97.331704),\n (73.768075, 97.331704, 197.301703, 97.331704),\n (73.768075, 99.261917, 197.301703, 99.261917),\n (213.231916, 136.668289, 211.301703, 136.668289),\n (211.301703, 136.668289, 211.301703, 113.261917),\n (213.231916, 113.261917, 211.301703, 113.261917),\n (213.231916, 136.668289, 213.231916, 113.261917)\n]\nVISIBLE_CIRCLES = [\n\n]\nVISIBLE_ARCS = [\n\n]\nHIDDEN_SEGMENTS = [\n\n]\n# (orient, text, p1, p2, base) for linear; (orient, text, center, radius, angle) for diameter\nDIMENSIONS = [\n ('horizontal', '100', (197.3017, 113.2619), (73.7681, 113.2619), (135.5349, 102.2619)),\n ('vertical', '18.9474', (197.3017, 136.6683), (197.3017, 113.2619), (208.3017, 124.9651)),\n ('horizontal', '1.5625', (213.2319, 136.6683), (211.3017, 136.6683), (212.2668, 125.6683))\n]\n\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\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\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,\n angle=(0 if d[0] == \"horizontal\" else 90),\n 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,\n 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,\n text=text, dimstyle=\"EZDXF\").render()\n\n doc.saveas(out_path)\n\n\nif __name__ == \"__main__\":\n out = sys.argv[1] if len(sys.argv) > 1 else \"0039_00393910_gt.dxf\"\n draw(out)\n print(\"wrote\", out)\n```"}], "images": ["images/0039_00393910.png"], "id": "0039_00393910"} {"messages": [{"role": "user", "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 6.35 mm."}, {"role": "assistant", "content": "```python\n#!/usr/bin/env python3\n# -*- coding: utf-8 -*-\n# Ground-truth 2D engineering drawing for part: 0039_00395394\n# Self-contained: reproduces the three-view DXF via ezdxf, NO FreeCAD needed.\n# Coordinates are A4 page millimetres (scale=1.303833802816921, page=[297.0, 210.0]).\n# visible edges -> solid (layer OUTLINE); hidden edges -> dashed (layer HIDDEN)\n# dimensions -> real movable DIMENSION entities (text = true mm value)\n# Run: python 0039_00395394_gt.py [out.dxf]\nimport sys\nimport ezdxf\n\nSCALE = 1.303833802816921\nPAGE = [297.0, 210.0]\n\nVISIBLE_SEGMENTS = [\n (193.413332, 151.492691, 193.413332, 113.063906),\n (63.029952, 151.492691, 193.413332, 151.492691),\n (193.413332, 113.063906, 63.029952, 113.063906),\n (63.029952, 113.063906, 63.029952, 151.492691),\n (193.413332, 82.507286, 193.413332, 99.063906),\n (193.413332, 99.063906, 63.029952, 99.063906),\n (63.029952, 82.507286, 63.029952, 99.063906),\n (193.413332, 82.507286, 63.029952, 82.507286),\n (223.969952, 151.492691, 207.413332, 151.492691),\n (207.413332, 113.063906, 223.969952, 113.063906),\n (223.969952, 113.063906, 223.969952, 151.492691),\n (207.413332, 113.063906, 207.413332, 151.492691)\n]\nVISIBLE_CIRCLES = [\n\n]\nVISIBLE_ARCS = [\n\n]\nHIDDEN_SEGMENTS = [\n\n]\n# (orient, text, p1, p2, base) for linear; (orient, text, center, radius, angle) for diameter\nDIMENSIONS = [\n ('horizontal', '100', (193.4133, 151.4927), (63.0299, 151.4927), (128.2216, 140.4927)),\n ('vertical', '29.4737', (193.4133, 113.0639), (193.4133, 151.4927), (182.4133, 132.2783)),\n ('horizontal', '12.6984', (207.4134, 113.0639), (223.97, 113.0639), (215.6917, 124.0639))\n]\n\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\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\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,\n angle=(0 if d[0] == \"horizontal\" else 90),\n 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,\n 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,\n text=text, dimstyle=\"EZDXF\").render()\n\n doc.saveas(out_path)\n\n\nif __name__ == \"__main__\":\n out = sys.argv[1] if len(sys.argv) > 1 else \"0039_00395394_gt.dxf\"\n draw(out)\n print(\"wrote\", out)\n```"}], "images": ["images/0039_00395394.png"], "id": "0039_00395394"} {"messages": [{"role": "user", "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 151.16 mm. The outline includes one or more oblique (angled) edges."}, {"role": "assistant", "content": "```python\n#!/usr/bin/env python3\n# -*- coding: utf-8 -*-\n# Ground-truth 2D engineering drawing for part: 0040_00400516\n# Self-contained: reproduces the three-view DXF via ezdxf, NO FreeCAD needed.\n# Coordinates are A4 page millimetres (scale=0.29682583950492625, page=[297.0, 210.0]).\n# visible edges -> solid (layer OUTLINE); hidden edges -> dashed (layer HIDDEN)\n# dimensions -> real movable DIMENSION entities (text = true mm value)\n# Run: python 0040_00400516_gt.py [out.dxf]\nimport sys\nimport ezdxf\nimport math\n\nSCALE = 0.29682583950492625\nPAGE = [297.0, 210.0]\n\nVISIBLE_SEGMENTS = [\n (99.383901, 172.049999, 128.749156, 172.049999),\n (128.749156, 172.049999, 143.74418, 146.4335),\n (143.74418, 146.4335, 128.749156, 120.817),\n (128.749156, 120.817, 99.383901, 120.817),\n (99.383901, 120.817, 84.388877, 146.4335),\n (84.388877, 146.4335, 99.383901, 172.049999),\n (143.74418, 61.949999, 143.74418, 106.817),\n (143.74418, 106.817, 128.749156, 106.817),\n (128.749156, 61.949999, 128.749156, 106.817),\n (143.74418, 61.949999, 128.749156, 61.949999),\n (128.749156, 106.817, 99.383901, 106.817),\n (99.383901, 61.949999, 99.383901, 106.817),\n (128.749156, 61.949999, 99.383901, 61.949999),\n (99.383901, 106.817, 84.388877, 106.817),\n (84.388877, 61.949999, 84.388877, 106.817),\n (99.383901, 61.949999, 84.388877, 61.949999),\n (157.74418, 172.049999, 202.611182, 172.049999),\n (157.74418, 120.817, 202.611182, 120.817),\n (202.611182, 120.817, 202.611182, 146.4335),\n (157.74418, 146.4335, 202.611182, 146.4335),\n (157.74418, 120.817, 157.74418, 146.4335),\n (202.611182, 146.4335, 202.611182, 172.049999),\n (157.74418, 146.4335, 157.74418, 172.049999)\n]\nVISIBLE_CIRCLES = [\n\n]\nVISIBLE_ARCS = [\n\n]\nHIDDEN_SEGMENTS = [\n\n]\n# (orient, text, p1, p2, base) for linear; (orient, text, center, radius, angle) for diameter\nDIMENSIONS = [\n ('horizontal', '98.9309', (99.3839, 120.817), (128.7491, 120.817), (114.0665, 131.817)),\n ('aligned', '100', (128.7491, 120.817), (143.7441, 146.4335), (126.7535, 139.1822)),\n ('aligned', '100', (143.7441, 146.4335), (128.7491, 172.05), (126.7535, 153.6848)),\n ('aligned', '100', (99.3839, 172.05), (84.3888, 146.4335), (101.3795, 153.6848)),\n ('aligned', '100', (84.3888, 146.4335), (99.3839, 120.817), (101.3795, 139.1822)),\n ('horizontal', '151.156', (157.7442, 146.4335), (202.6112, 146.4335), (180.1777, 157.4335))\n]\n\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; _ds.dxf.dimasz = 2.5\n _ds.dxf.dimexe = 1.25; _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\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\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,\n angle=(0 if d[0] == \"horizontal\" else 90),\n 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,\n 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,\n 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,\n text=text, dimstyle=\"EZDXF\").render()\n\n doc.saveas(out_path)\n\n\nif __name__ == \"__main__\":\n out = sys.argv[1] if len(sys.argv) > 1 else \"0040_00400516_gt.dxf\"\n draw(out)\n print(\"wrote\", out)\n```"}], "images": ["images/0040_00400516.png"], "id": "0040_00400516"} {"messages": [{"role": "user", "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 9.9 mm."}, {"role": "assistant", "content": "```python\n#!/usr/bin/env python3\n# -*- coding: utf-8 -*-\n# Ground-truth 2D engineering drawing for part: 0040_00400728\n# Self-contained: reproduces the three-view DXF via ezdxf, NO FreeCAD needed.\n# Coordinates are A4 page millimetres (scale=0.874464454976306, page=[297.0, 210.0]).\n# visible edges -> solid (layer OUTLINE); hidden edges -> dashed (layer HIDDEN)\n# dimensions -> real movable DIMENSION entities (text = true mm value)\n# Run: python 0040_00400728_gt.py [out.dxf]\nimport sys\nimport ezdxf\n\nSCALE = 0.874464454976306\nPAGE = [297.0, 210.0]\n\nVISIBLE_SEGMENTS = [\n (175.896418, 172.050027, 175.896418, 84.603582),\n (175.896418, 84.603582, 88.449973, 84.603582),\n (88.449973, 84.603582, 88.449973, 172.050027),\n (88.449973, 172.050027, 175.896418, 172.050027),\n (175.896418, 61.950027, 175.896418, 70.603582),\n (175.896418, 70.603582, 88.449973, 70.603582),\n (88.449973, 61.950027, 88.449973, 70.603582),\n (175.896418, 61.950027, 88.449973, 61.950027),\n (189.896418, 84.603582, 198.549973, 84.603582),\n (198.549973, 84.603582, 198.549973, 172.050027),\n (189.896418, 172.050027, 198.549973, 172.050027),\n (189.896418, 84.603582, 189.896418, 172.050027)\n]\nVISIBLE_CIRCLES = [\n\n]\nVISIBLE_ARCS = [\n\n]\nHIDDEN_SEGMENTS = [\n\n]\n# (orient, text, p1, p2, base) for linear; (orient, text, center, radius, angle) for diameter\nDIMENSIONS = [\n ('horizontal', '100', (175.8964, 172.05), (88.45, 172.05), (132.1732, 161.05)),\n ('vertical', '100', (175.8964, 84.6036), (175.8964, 172.05), (164.8964, 128.3268)),\n ('horizontal', '9.8958', (189.8964, 84.6036), (198.55, 84.6036), (194.2232, 95.6036))\n]\n\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\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\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,\n angle=(0 if d[0] == \"horizontal\" else 90),\n 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,\n 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,\n text=text, dimstyle=\"EZDXF\").render()\n\n doc.saveas(out_path)\n\n\nif __name__ == \"__main__\":\n out = sys.argv[1] if len(sys.argv) > 1 else \"0040_00400728_gt.dxf\"\n draw(out)\n print(\"wrote\", out)\n```"}], "images": ["images/0040_00400728.png"], "id": "0040_00400728"} {"messages": [{"role": "user", "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 23.99 mm. The outline includes one or more oblique (angled) edges."}, {"role": "assistant", "content": "```python\n#!/usr/bin/env python3\n# -*- coding: utf-8 -*-\n# Ground-truth 2D engineering drawing for part: 0040_00401317\n# Self-contained: reproduces the three-view DXF via ezdxf, NO FreeCAD needed.\n# Coordinates are A4 page millimetres (scale=0.36414984245298204, page=[297.0, 210.0]).\n# visible edges -> solid (layer OUTLINE); hidden edges -> dashed (layer HIDDEN)\n# dimensions -> real movable DIMENSION entities (text = true mm value)\n# Run: python 0040_00401317_gt.py [out.dxf]\nimport sys\nimport ezdxf\nimport math\n\nSCALE = 0.36414984245298204\nPAGE = [297.0, 210.0]\n\nVISIBLE_SEGMENTS = [\n (114.199259, 172.049982, 150.064331, 172.049982),\n (150.064331, 172.049982, 175.813613, 146.300699),\n (175.813613, 146.300699, 175.813613, 110.435628),\n (175.813613, 110.435628, 150.064331, 84.686345),\n (150.064331, 84.686345, 114.199259, 84.686345),\n (114.199259, 84.686345, 88.449977, 110.435628),\n (88.449977, 110.435628, 88.449977, 146.300699),\n (88.449977, 146.300699, 114.199259, 172.049982),\n (175.813613, 61.949982, 175.813613, 70.686345),\n (175.813613, 70.686345, 150.064331, 70.686345),\n (150.064331, 61.949982, 150.064331, 70.686345),\n (175.813613, 61.949982, 150.064331, 61.949982),\n (150.064331, 70.686345, 114.199259, 70.686345),\n (114.199259, 61.949982, 114.199259, 70.686345),\n (150.064331, 61.949982, 114.199259, 61.949982),\n (114.199259, 70.686345, 88.449977, 70.686345),\n (88.449977, 61.949982, 88.449977, 70.686345),\n (114.199259, 61.949982, 88.449977, 61.949982),\n (189.813613, 172.049982, 198.549977, 172.049982),\n (189.813613, 84.686345, 198.549977, 84.686345),\n (198.549977, 84.686345, 198.549977, 110.435628),\n (189.813613, 110.435628, 198.549977, 110.435628),\n (189.813613, 84.686345, 189.813613, 110.435628),\n (198.549977, 110.435628, 198.549977, 146.300699),\n (189.813613, 146.300699, 198.549977, 146.300699),\n (189.813613, 110.435628, 189.813613, 146.300699),\n (198.549977, 146.300699, 198.549977, 172.049982),\n (189.813613, 146.300699, 189.813613, 172.049982)\n]\nVISIBLE_CIRCLES = [\n\n]\nVISIBLE_ARCS = [\n\n]\nHIDDEN_SEGMENTS = [\n\n]\n# (orient, text, p1, p2, base) for linear; (orient, text, center, radius, angle) for diameter\nDIMENSIONS = [\n ('horizontal', '98.4899', (114.1993, 84.6864), (150.0643, 84.6864), (132.1318, 95.6864)),\n ('vertical', '98.4899', (175.8136, 110.4356), (175.8136, 146.3007), (164.8136, 128.3682)),\n ('aligned', '100', (150.0643, 84.6864), (175.8136, 110.4356), (155.1608, 105.3392)),\n ('aligned', '100', (175.8136, 146.3007), (150.0643, 172.05), (155.1608, 151.3972)),\n ('aligned', '100', (114.1993, 172.05), (88.45, 146.3007), (109.1028, 151.3972)),\n ('aligned', '100', (88.45, 110.4356), (114.1993, 84.6864), (109.1028, 105.3392)),\n ('horizontal', '23.9911', (189.8136, 110.4356), (198.55, 110.4356), (194.1818, 121.4356))\n]\n\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; _ds.dxf.dimasz = 2.5\n _ds.dxf.dimexe = 1.25; _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\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\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,\n angle=(0 if d[0] == \"horizontal\" else 90),\n 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,\n 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,\n 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,\n text=text, dimstyle=\"EZDXF\").render()\n\n doc.saveas(out_path)\n\n\nif __name__ == \"__main__\":\n out = sys.argv[1] if len(sys.argv) > 1 else \"0040_00401317_gt.dxf\"\n draw(out)\n print(\"wrote\", out)\n```"}], "images": ["images/0040_00401317.png"], "id": "0040_00401317"} {"messages": [{"role": "user", "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 124.68 mm."}, {"role": "assistant", "content": "```python\n#!/usr/bin/env python3\n# -*- coding: utf-8 -*-\n# Ground-truth 2D engineering drawing for part: 0040_00402649\n# Self-contained: reproduces the three-view DXF via ezdxf, NO FreeCAD needed.\n# Coordinates are A4 page millimetres (scale=0.2750817843866473, page=[297.0, 210.0]).\n# visible edges -> solid (layer OUTLINE); hidden edges -> dashed (layer HIDDEN)\n# dimensions -> real movable DIMENSION entities (text = true mm value)\n# Run: python 0040_00402649_gt.py [out.dxf]\nimport sys\nimport ezdxf\n\nSCALE = 0.2750817843866473\nPAGE = [297.0, 210.0]\n\nVISIBLE_SEGMENTS = [\n (115.958191, 172.049987, 115.958191, 144.541809),\n (88.450013, 172.049987, 115.958191, 172.049987),\n (115.958191, 144.541809, 88.450013, 144.541809),\n (88.450013, 144.541809, 88.450013, 172.049987),\n (115.958191, 61.949987, 115.958191, 130.541809),\n (115.958191, 130.541809, 88.450013, 130.541809),\n (88.450013, 61.949987, 88.450013, 130.541809),\n (115.958191, 61.949987, 88.450013, 61.949987),\n (198.550013, 172.049987, 129.958191, 172.049987),\n (129.958191, 144.541809, 198.550013, 144.541809),\n (198.550013, 144.541809, 198.550013, 172.049987),\n (129.958191, 144.541809, 129.958191, 172.049987)\n]\nVISIBLE_CIRCLES = [\n\n]\nVISIBLE_ARCS = [\n\n]\nHIDDEN_SEGMENTS = [\n\n]\n# (orient, text, p1, p2, base) for linear; (orient, text, center, radius, angle) for diameter\nDIMENSIONS = [\n ('horizontal', '100', (115.9582, 172.05), (88.45, 172.05), (102.2041, 161.05)),\n ('vertical', '100', (115.9582, 144.5418), (115.9582, 172.05), (104.9582, 158.2959)),\n ('horizontal', '249.351', (129.9582, 144.5418), (198.55, 144.5418), (164.2541, 155.5418))\n]\n\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\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\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,\n angle=(0 if d[0] == \"horizontal\" else 90),\n 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,\n 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,\n text=text, dimstyle=\"EZDXF\").render()\n\n doc.saveas(out_path)\n\n\nif __name__ == \"__main__\":\n out = sys.argv[1] if len(sys.argv) > 1 else \"0040_00402649_gt.dxf\"\n draw(out)\n print(\"wrote\", out)\n```"}], "images": ["images/0040_00402649.png"], "id": "0040_00402649"} {"messages": [{"role": "user", "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 77.89 mm tall. It is extruded to a thickness of 18.23 mm."}, {"role": "assistant", "content": "```python\n#!/usr/bin/env python3\n# -*- coding: utf-8 -*-\n# Ground-truth 2D engineering drawing for part: 0040_00402753\n# Self-contained: reproduces the three-view DXF via ezdxf, NO FreeCAD needed.\n# Coordinates are A4 page millimetres (scale=0.9997513260708372, page=[297.0, 210.0]).\n# visible edges -> solid (layer OUTLINE); hidden edges -> dashed (layer HIDDEN)\n# dimensions -> real movable DIMENSION entities (text = true mm value)\n# Run: python 0040_00402753_gt.py [out.dxf]\nimport sys\nimport ezdxf\n\nSCALE = 0.9997513260708372\nPAGE = [297.0, 210.0]\n\nVISIBLE_SEGMENTS = [\n (177.37522, 172.04998, 177.37522, 94.174613),\n (177.37522, 94.174613, 77.400087, 94.174613),\n (77.400087, 94.174613, 77.400087, 172.04998),\n (77.400087, 172.04998, 177.37522, 172.04998),\n (177.37522, 61.94998, 177.37522, 80.174613),\n (177.37522, 80.174613, 77.400087, 80.174613),\n (77.400087, 61.94998, 77.400087, 80.174613),\n (177.37522, 61.94998, 77.400087, 61.94998),\n (191.37522, 94.174613, 209.599853, 94.174613),\n (209.599853, 94.174613, 209.599853, 172.04998),\n (191.37522, 172.04998, 209.599853, 172.04998),\n (191.37522, 94.174613, 191.37522, 172.04998)\n]\nVISIBLE_CIRCLES = [\n\n]\nVISIBLE_ARCS = [\n\n]\nHIDDEN_SEGMENTS = [\n\n]\n# (orient, text, p1, p2, base) for linear; (orient, text, center, radius, angle) for diameter\nDIMENSIONS = [\n ('horizontal', '100', (177.3752, 172.05), (77.4001, 172.05), (127.3877, 161.05)),\n ('vertical', '77.8947', (177.3752, 94.1746), (177.3752, 172.05), (166.3752, 133.1123)),\n ('horizontal', '18.2292', (191.3752, 94.1746), (209.5999, 94.1746), (200.4876, 105.1746))\n]\n\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\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\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,\n angle=(0 if d[0] == \"horizontal\" else 90),\n 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,\n 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,\n text=text, dimstyle=\"EZDXF\").render()\n\n doc.saveas(out_path)\n\n\nif __name__ == \"__main__\":\n out = sys.argv[1] if len(sys.argv) > 1 else \"0040_00402753_gt.dxf\"\n draw(out)\n print(\"wrote\", out)\n```"}], "images": ["images/0040_00402753.png"], "id": "0040_00402753"} {"messages": [{"role": "user", "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 11.58 mm tall. It is extruded to a thickness of 0.52 mm."}, {"role": "assistant", "content": "```python\n#!/usr/bin/env python3\n# -*- coding: utf-8 -*-\n# Ground-truth 2D engineering drawing for part: 0040_00403411\n# Self-contained: reproduces the three-view DXF via ezdxf, NO FreeCAD needed.\n# Coordinates are A4 page millimetres (scale=1.316915094339623, page=[297.0, 210.0]).\n# visible edges -> solid (layer OUTLINE); hidden edges -> dashed (layer HIDDEN)\n# dimensions -> real movable DIMENSION entities (text = true mm value)\n# Run: python 0040_00403411_gt.py [out.dxf]\nimport sys\nimport ezdxf\n\nSCALE = 1.316915094339623\nPAGE = [297.0, 210.0]\n\nVISIBLE_SEGMENTS = [\n (201.659885, 117.061666, 201.659885, 132.310156),\n (69.968375, 117.061666, 201.659885, 117.061666),\n (201.659885, 132.310156, 69.968375, 132.310156),\n (69.968375, 132.310156, 69.968375, 117.061666),\n (201.659885, 101.689879, 201.659885, 103.061666),\n (69.968375, 101.689879, 69.968375, 103.061666),\n (69.968375, 101.689879, 201.659885, 101.689879),\n (69.968375, 103.061666, 201.659885, 103.061666),\n (215.659885, 117.061666, 217.031671, 117.061666),\n (217.031671, 132.310156, 215.659885, 132.310156),\n (215.659885, 132.310156, 215.659885, 117.061666),\n (217.031671, 132.310156, 217.031671, 117.061666)\n]\nVISIBLE_CIRCLES = [\n\n]\nVISIBLE_ARCS = [\n\n]\nHIDDEN_SEGMENTS = [\n\n]\n# (orient, text, p1, p2, base) for linear; (orient, text, center, radius, angle) for diameter\nDIMENSIONS = [\n ('horizontal', '100', (201.6599, 117.0616), (69.9684, 117.0616), (135.8141, 106.0616)),\n ('vertical', '11.5789', (201.6599, 132.3102), (201.6599, 117.0616), (212.6599, 124.6859)),\n ('horizontal', '1.0417', (217.0316, 132.3102), (215.6599, 132.3102), (216.3458, 121.3102))\n]\n\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\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\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,\n angle=(0 if d[0] == \"horizontal\" else 90),\n 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,\n 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,\n text=text, dimstyle=\"EZDXF\").render()\n\n doc.saveas(out_path)\n\n\nif __name__ == \"__main__\":\n out = sys.argv[1] if len(sys.argv) > 1 else \"0040_00403411_gt.dxf\"\n draw(out)\n print(\"wrote\", out)\n```"}], "images": ["images/0040_00403411.png"], "id": "0040_00403411"} {"messages": [{"role": "user", "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 45.26 mm tall. It is extruded to a thickness of 10.42 mm."}, {"role": "assistant", "content": "```python\n#!/usr/bin/env python3\n# -*- coding: utf-8 -*-\n# Ground-truth 2D engineering drawing for part: 0041_00411904\n# Self-contained: reproduces the three-view DXF via ezdxf, NO FreeCAD needed.\n# Coordinates are A4 page millimetres (scale=1.330777358490562, page=[297.0, 210.0]).\n# visible edges -> solid (layer OUTLINE); hidden edges -> dashed (layer HIDDEN)\n# dimensions -> real movable DIMENSION entities (text = true mm value)\n# Run: python 0041_00411904_gt.py [out.dxf]\nimport sys\nimport ezdxf\n\nSCALE = 1.330777358490562\nPAGE = [297.0, 210.0]\n\nVISIBLE_SEGMENTS = [\n (196.107714, 161.048731, 196.107714, 100.813546),\n (196.107714, 100.813546, 63.029978, 100.813546),\n (63.029978, 100.813546, 63.029978, 161.048731),\n (63.029978, 161.048731, 196.107714, 161.048731),\n (196.107714, 72.951282, 196.107714, 86.813546),\n (196.107714, 86.813546, 63.029978, 86.813546),\n (63.029978, 72.951282, 63.029978, 86.813546),\n (196.107714, 72.951282, 63.029978, 72.951282),\n (210.107714, 100.813546, 223.969978, 100.813546),\n (223.969978, 100.813546, 223.969978, 161.048731),\n (210.107714, 161.048731, 223.969978, 161.048731),\n (210.107714, 100.813546, 210.107714, 161.048731)\n]\nVISIBLE_CIRCLES = [\n\n]\nVISIBLE_ARCS = [\n\n]\nHIDDEN_SEGMENTS = [\n\n]\n# (orient, text, p1, p2, base) for linear; (orient, text, center, radius, angle) for diameter\nDIMENSIONS = [\n ('horizontal', '100', (196.1077, 161.0488), (63.03, 161.0488), (129.5689, 150.0488)),\n ('vertical', '45.2632', (196.1077, 100.8135), (196.1077, 161.0488), (185.1077, 130.9312)),\n ('horizontal', '10.4167', (210.1077, 100.8135), (223.97, 100.8135), (217.0389, 111.8135))\n]\n\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\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\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,\n angle=(0 if d[0] == \"horizontal\" else 90),\n 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,\n 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,\n text=text, dimstyle=\"EZDXF\").render()\n\n doc.saveas(out_path)\n\n\nif __name__ == \"__main__\":\n out = sys.argv[1] if len(sys.argv) > 1 else \"0041_00411904_gt.dxf\"\n draw(out)\n print(\"wrote\", out)\n```"}], "images": ["images/0041_00411904.png"], "id": "0041_00411904"} {"messages": [{"role": "user", "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 29.17 mm."}, {"role": "assistant", "content": "```python\n#!/usr/bin/env python3\n# -*- coding: utf-8 -*-\n# Ground-truth 2D engineering drawing for part: 0041_00411952\n# Self-contained: reproduces the three-view DXF via ezdxf, NO FreeCAD needed.\n# Coordinates are A4 page millimetres (scale=0.7346999999999999, page=[297.0, 210.0]).\n# visible edges -> solid (layer OUTLINE); hidden edges -> dashed (layer HIDDEN)\n# dimensions -> real movable DIMENSION entities (text = true mm value)\n# Run: python 0041_00411952_gt.py [out.dxf]\nimport sys\nimport ezdxf\n\nSCALE = 0.7346999999999999\nPAGE = [297.0, 210.0]\n\nVISIBLE_SEGMENTS = [\n (162.52061, 97.9794, 162.52061, 171.4494),\n (162.52061, 171.4494, 89.05061, 171.4494),\n (89.05061, 171.4494, 89.05061, 97.9794),\n (89.05061, 97.9794, 162.52061, 97.9794),\n (162.52061, 83.9794, 162.52061, 62.55065),\n (89.05061, 83.9794, 89.05061, 62.55065),\n (89.05061, 62.55065, 162.52061, 62.55065),\n (89.05061, 83.9794, 162.52061, 83.9794),\n (197.94936, 171.4494, 176.52061, 171.4494),\n (176.52061, 171.4494, 176.52061, 97.9794),\n (197.94936, 97.9794, 176.52061, 97.9794),\n (197.94936, 171.4494, 197.94936, 97.9794)\n]\nVISIBLE_CIRCLES = [\n\n]\nVISIBLE_ARCS = [\n\n]\nHIDDEN_SEGMENTS = [\n\n]\n# (orient, text, p1, p2, base) for linear; (orient, text, center, radius, angle) for diameter\nDIMENSIONS = [\n ('horizontal', '100', (162.5206, 97.9794), (89.0506, 97.9794), (125.7856, 86.9794)),\n ('vertical', '100', (162.5206, 171.4494), (162.5206, 97.9794), (173.5206, 134.7144)),\n ('horizontal', '29.1667', (197.9494, 171.4494), (176.5206, 171.4494), (187.235, 160.4494))\n]\n\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\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\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,\n angle=(0 if d[0] == \"horizontal\" else 90),\n 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,\n 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,\n text=text, dimstyle=\"EZDXF\").render()\n\n doc.saveas(out_path)\n\n\nif __name__ == \"__main__\":\n out = sys.argv[1] if len(sys.argv) > 1 else \"0041_00411952_gt.dxf\"\n draw(out)\n print(\"wrote\", out)\n```"}], "images": ["images/0041_00411952.png"], "id": "0041_00411952"} {"messages": [{"role": "user", "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 34.38 mm."}, {"role": "assistant", "content": "```python\n#!/usr/bin/env python3\n# -*- coding: utf-8 -*-\n# Ground-truth 2D engineering drawing for part: 0041_00414491\n# Self-contained: reproduces the three-view DXF via ezdxf, NO FreeCAD needed.\n# Coordinates are A4 page millimetres (scale=0.7151627906976745, page=[297.0, 210.0]).\n# visible edges -> solid (layer OUTLINE); hidden edges -> dashed (layer HIDDEN)\n# dimensions -> real movable DIMENSION entities (text = true mm value)\n# Run: python 0041_00414491_gt.py [out.dxf]\nimport sys\nimport ezdxf\n\nSCALE = 0.7151627906976745\nPAGE = [297.0, 210.0]\n\nVISIBLE_SEGMENTS = [\n (147.545052, 100.533713, 147.545052, 172.049992),\n (147.545052, 172.049992, 100.87127, 172.049992),\n (100.87127, 172.049992, 100.87127, 100.533713),\n (100.87127, 100.533713, 147.545052, 100.533713),\n (147.545052, 86.533713, 147.545052, 61.949992),\n (100.87127, 86.533713, 100.87127, 61.949992),\n (100.87127, 61.949992, 147.545052, 61.949992),\n (100.87127, 86.533713, 147.545052, 86.533713),\n (186.128773, 172.049992, 161.545052, 172.049992),\n (161.545052, 172.049992, 161.545052, 100.533713),\n (186.128773, 100.533713, 161.545052, 100.533713),\n (186.128773, 172.049992, 186.128773, 100.533713)\n]\nVISIBLE_CIRCLES = [\n\n]\nVISIBLE_ARCS = [\n\n]\nHIDDEN_SEGMENTS = [\n\n]\n# (orient, text, p1, p2, base) for linear; (orient, text, center, radius, angle) for diameter\nDIMENSIONS = [\n ('horizontal', '65.2632', (147.5451, 100.5337), (100.8712, 100.5337), (124.2082, 89.5337)),\n ('vertical', '100', (147.5451, 172.05), (147.5451, 100.5337), (158.5451, 136.2919)),\n ('horizontal', '34.375', (186.1288, 172.05), (161.545, 172.05), (173.8369, 161.05))\n]\n\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\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\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,\n angle=(0 if d[0] == \"horizontal\" else 90),\n 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,\n 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,\n text=text, dimstyle=\"EZDXF\").render()\n\n doc.saveas(out_path)\n\n\nif __name__ == \"__main__\":\n out = sys.argv[1] if len(sys.argv) > 1 else \"0041_00414491_gt.dxf\"\n draw(out)\n print(\"wrote\", out)\n```"}], "images": ["images/0041_00414491.png"], "id": "0041_00414491"} {"messages": [{"role": "user", "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 -101.05 mm."}, {"role": "assistant", "content": "```python\n#!/usr/bin/env python3\n# -*- coding: utf-8 -*-\n# Ground-truth 2D engineering drawing for part: 0041_00416487\n# Self-contained: reproduces the three-view DXF via ezdxf, NO FreeCAD needed.\n# Coordinates are A4 page millimetres (scale=0.666386861313903, page=[297.0, 210.0]).\n# visible edges -> solid (layer OUTLINE); hidden edges -> dashed (layer HIDDEN)\n# dimensions -> real movable DIMENSION entities (text = true mm value)\n# Run: python 0041_00416487_gt.py [out.dxf]\nimport sys\nimport ezdxf\n\nSCALE = 0.666386861313903\nPAGE = [297.0, 210.0]\n\nVISIBLE_SEGMENTS = [\n (136.149288, 143.290128, 136.149288, 172.049982),\n (136.149288, 172.049982, 69.510602, 172.049982),\n (69.510602, 172.049982, 69.510602, 143.290128),\n (69.510602, 143.290128, 136.149288, 143.290128),\n (136.149288, 61.949982, 136.149288, 129.290128),\n (69.510602, 61.949982, 69.510602, 129.290128),\n (69.510602, 129.290128, 136.149288, 129.290128),\n (69.510602, 61.949982, 136.149288, 61.949982),\n (150.149288, 172.049982, 217.489434, 172.049982),\n (217.489434, 172.049982, 217.489434, 143.290128),\n (150.149288, 143.290128, 217.489434, 143.290128),\n (150.149288, 172.049982, 150.149288, 143.290128)\n]\nVISIBLE_CIRCLES = [\n\n]\nVISIBLE_ARCS = [\n\n]\nHIDDEN_SEGMENTS = [\n\n]\n# (orient, text, p1, p2, base) for linear; (orient, text, center, radius, angle) for diameter\nDIMENSIONS = [\n ('horizontal', '100', (136.1493, 143.2901), (69.5106, 143.2901), (102.8299, 132.2901)),\n ('vertical', '43.1579', (136.1493, 172.05), (136.1493, 143.2901), (147.1493, 157.6701)),\n ('horizontal', '101.053', (150.1493, 172.05), (217.4894, 172.05), (183.8193, 183.05))\n]\n\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\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\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,\n angle=(0 if d[0] == \"horizontal\" else 90),\n 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,\n 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,\n text=text, dimstyle=\"EZDXF\").render()\n\n doc.saveas(out_path)\n\n\nif __name__ == \"__main__\":\n out = sys.argv[1] if len(sys.argv) > 1 else \"0041_00416487_gt.dxf\"\n draw(out)\n print(\"wrote\", out)\n```"}], "images": ["images/0041_00416487.png"], "id": "0041_00416487"} {"messages": [{"role": "user", "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 46.32 mm wide and 100 mm tall. It is extruded to a thickness of -1.04 mm."}, {"role": "assistant", "content": "```python\n#!/usr/bin/env python3\n# -*- coding: utf-8 -*-\n# Ground-truth 2D engineering drawing for part: 0043_00433407\n# Self-contained: reproduces the three-view DXF via ezdxf, NO FreeCAD needed.\n# Coordinates are A4 page millimetres (scale=0.9510927835051515, page=[297.0, 210.0]).\n# visible edges -> solid (layer OUTLINE); hidden edges -> dashed (layer HIDDEN)\n# dimensions -> real movable DIMENSION entities (text = true mm value)\n# Run: python 0043_00433407_gt.py [out.dxf]\nimport sys\nimport ezdxf\n\nSCALE = 0.9510927835051515\nPAGE = [297.0, 210.0]\n\nVISIBLE_SEGMENTS = [\n (158.029958, 172.049987, 158.029958, 76.940709),\n (158.029958, 76.940709, 113.979345, 76.940709),\n (113.979345, 76.940709, 113.979345, 172.049987),\n (113.979345, 172.049987, 158.029958, 172.049987),\n (158.029958, 62.940709, 158.029958, 61.949987),\n (158.029958, 61.949987, 113.979345, 61.949987),\n (113.979345, 62.940709, 113.979345, 61.949987),\n (158.029958, 62.940709, 113.979345, 62.940709),\n (173.02068, 76.940709, 172.029958, 76.940709),\n (172.029958, 76.940709, 172.029958, 172.049987),\n (173.02068, 172.049987, 172.029958, 172.049987),\n (173.02068, 76.940709, 173.02068, 172.049987)\n]\nVISIBLE_CIRCLES = [\n\n]\nVISIBLE_ARCS = [\n\n]\nHIDDEN_SEGMENTS = [\n\n]\n# (orient, text, p1, p2, base) for linear; (orient, text, center, radius, angle) for diameter\nDIMENSIONS = [\n ('horizontal', '46.3158', (158.03, 172.05), (113.9793, 172.05), (136.0046, 161.05)),\n ('vertical', '100', (158.03, 76.9407), (158.03, 172.05), (147.03, 124.4954)),\n ('horizontal', '1.0417', (173.0207, 76.9407), (172.0299, 76.9407), (172.5253, 65.9407))\n]\n\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\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\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,\n angle=(0 if d[0] == \"horizontal\" else 90),\n 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,\n 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,\n text=text, dimstyle=\"EZDXF\").render()\n\n doc.saveas(out_path)\n\n\nif __name__ == \"__main__\":\n out = sys.argv[1] if len(sys.argv) > 1 else \"0043_00433407_gt.dxf\"\n draw(out)\n print(\"wrote\", out)\n```"}], "images": ["images/0043_00433407.png"], "id": "0043_00433407"} {"messages": [{"role": "user", "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. It is extruded to a thickness of 13.54 mm."}, {"role": "assistant", "content": "```python\n#!/usr/bin/env python3\n# -*- coding: utf-8 -*-\n# Ground-truth 2D engineering drawing for part: 0043_00433460\n# Self-contained: reproduces the three-view DXF via ezdxf, NO FreeCAD needed.\n# Coordinates are A4 page millimetres (scale=0.846385321100967, page=[297.0, 210.0]).\n# visible edges -> solid (layer OUTLINE); hidden edges -> dashed (layer HIDDEN)\n# dimensions -> real movable DIMENSION entities (text = true mm value)\n# Run: python 0043_00433460_gt.py [out.dxf]\nimport sys\nimport ezdxf\n\nSCALE = 0.846385321100967\nPAGE = [297.0, 210.0]\n\nVISIBLE_SEGMENTS = [\n (145.024171, 87.411481, 145.024171, 172.050013),\n (145.024171, 172.050013, 116.514349, 172.050013),\n (116.514349, 172.050013, 116.514349, 87.411481),\n (116.514349, 87.411481, 145.024171, 87.411481),\n (145.024171, 73.411481, 145.024171, 61.950013),\n (116.514349, 73.411481, 116.514349, 61.950013),\n (116.514349, 61.950013, 145.024171, 61.950013),\n (116.514349, 73.411481, 145.024171, 73.411481),\n (170.485639, 172.050013, 159.024171, 172.050013),\n (159.024171, 172.050013, 159.024171, 87.411481),\n (170.485639, 87.411481, 159.024171, 87.411481),\n (170.485639, 172.050013, 170.485639, 87.411481)\n]\nVISIBLE_CIRCLES = [\n\n]\nVISIBLE_ARCS = [\n\n]\nHIDDEN_SEGMENTS = [\n\n]\n# (orient, text, p1, p2, base) for linear; (orient, text, center, radius, angle) for diameter\nDIMENSIONS = [\n ('horizontal', '33.6842', (145.0242, 87.4115), (116.5144, 87.4115), (130.7693, 76.4115)),\n ('vertical', '100', (145.0242, 172.05), (145.0242, 87.4115), (156.0242, 129.7307)),\n ('horizontal', '13.5417', (170.4856, 172.05), (159.0241, 172.05), (164.7549, 161.05))\n]\n\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\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\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,\n angle=(0 if d[0] == \"horizontal\" else 90),\n 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,\n 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,\n text=text, dimstyle=\"EZDXF\").render()\n\n doc.saveas(out_path)\n\n\nif __name__ == \"__main__\":\n out = sys.argv[1] if len(sys.argv) > 1 else \"0043_00433460_gt.dxf\"\n draw(out)\n print(\"wrote\", out)\n```"}], "images": ["images/0043_00433460.png"], "id": "0043_00433460"} {"messages": [{"role": "user", "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 23.16 mm tall. It is extruded to a thickness of 1.04 mm."}, {"role": "assistant", "content": "```python\n#!/usr/bin/env python3\n# -*- coding: utf-8 -*-\n# Ground-truth 2D engineering drawing for part: 0043_00435147\n# Self-contained: reproduces the three-view DXF via ezdxf, NO FreeCAD needed.\n# Coordinates are A4 page millimetres (scale=1.4542515463917478, page=[297.0, 210.0]).\n# visible edges -> solid (layer OUTLINE); hidden edges -> dashed (layer HIDDEN)\n# dimensions -> real movable DIMENSION entities (text = true mm value)\n# Run: python 0043_00435147_gt.py [out.dxf]\nimport sys\nimport ezdxf\n\nSCALE = 1.4542515463917478\nPAGE = [297.0, 210.0]\n\nVISIBLE_SEGMENTS = [\n (208.455182, 141.596103, 208.455182, 107.918698),\n (208.455182, 107.918698, 63.030027, 107.918698),\n (63.030027, 107.918698, 63.030027, 141.596103),\n (63.030027, 141.596103, 208.455182, 141.596103),\n (208.455182, 92.403853, 208.455182, 93.918698),\n (208.455182, 93.918698, 63.030027, 93.918698),\n (63.030027, 92.403853, 63.030027, 93.918698),\n (208.455182, 92.403853, 63.030027, 92.403853),\n (222.455182, 107.918698, 223.970027, 107.918698),\n (223.970027, 107.918698, 223.970027, 141.596103),\n (222.455182, 141.596103, 223.970027, 141.596103),\n (222.455182, 107.918698, 222.455182, 141.596103)\n]\nVISIBLE_CIRCLES = [\n\n]\nVISIBLE_ARCS = [\n\n]\nHIDDEN_SEGMENTS = [\n\n]\n# (orient, text, p1, p2, base) for linear; (orient, text, center, radius, angle) for diameter\nDIMENSIONS = [\n ('horizontal', '100', (208.4552, 141.5961), (63.03, 141.5961), (135.7426, 130.5961)),\n ('vertical', '23.1579', (208.4552, 107.9187), (208.4552, 141.5961), (197.4552, 124.7574)),\n ('horizontal', '1.0417', (222.4552, 107.9187), (223.97, 107.9187), (223.2126, 118.9187))\n]\n\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\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\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,\n angle=(0 if d[0] == \"horizontal\" else 90),\n 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,\n 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,\n text=text, dimstyle=\"EZDXF\").render()\n\n doc.saveas(out_path)\n\n\nif __name__ == \"__main__\":\n out = sys.argv[1] if len(sys.argv) > 1 else \"0043_00435147_gt.dxf\"\n draw(out)\n print(\"wrote\", out)\n```"}], "images": ["images/0043_00435147.png"], "id": "0043_00435147"} {"messages": [{"role": "user", "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 4.17 mm."}, {"role": "assistant", "content": "```python\n#!/usr/bin/env python3\n# -*- coding: utf-8 -*-\n# Ground-truth 2D engineering drawing for part: 0044_00445314\n# Self-contained: reproduces the three-view DXF via ezdxf, NO FreeCAD needed.\n# Coordinates are A4 page millimetres (scale=0.9306200000000016, page=[297.0, 210.0]).\n# visible edges -> solid (layer OUTLINE); hidden edges -> dashed (layer HIDDEN)\n# dimensions -> real movable DIMENSION entities (text = true mm value)\n# Run: python 0044_00445314_gt.py [out.dxf]\nimport sys\nimport ezdxf\n\nSCALE = 0.9306200000000016\nPAGE = [297.0, 210.0]\n\nVISIBLE_SEGMENTS = [\n (181.092203, 98.9998, 181.092203, 152.8778),\n (181.092203, 152.8778, 88.030203, 152.8778),\n (88.030203, 152.8778, 88.030203, 98.9998),\n (88.030203, 98.9998, 181.092203, 98.9998),\n (181.092203, 84.9998, 181.092203, 81.122217),\n (88.030203, 84.9998, 88.030203, 81.122217),\n (88.030203, 81.122217, 181.092203, 81.122217),\n (88.030203, 84.9998, 181.092203, 84.9998),\n (198.969787, 152.8778, 195.092203, 152.8778),\n (195.092203, 152.8778, 195.092203, 98.9998),\n (198.969787, 98.9998, 195.092203, 98.9998),\n (198.969787, 152.8778, 198.969787, 98.9998)\n]\nVISIBLE_CIRCLES = [\n\n]\nVISIBLE_ARCS = [\n\n]\nHIDDEN_SEGMENTS = [\n\n]\n# (orient, text, p1, p2, base) for linear; (orient, text, center, radius, angle) for diameter\nDIMENSIONS = [\n ('horizontal', '100', (181.0922, 98.9998), (88.0302, 98.9998), (134.5612, 87.9998)),\n ('vertical', '57.8947', (181.0922, 152.8778), (181.0922, 98.9998), (192.0922, 125.9388)),\n ('horizontal', '4.1667', (198.9698, 152.8778), (195.0922, 152.8778), (197.031, 141.8778))\n]\n\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\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\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,\n angle=(0 if d[0] == \"horizontal\" else 90),\n 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,\n 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,\n text=text, dimstyle=\"EZDXF\").render()\n\n doc.saveas(out_path)\n\n\nif __name__ == \"__main__\":\n out = sys.argv[1] if len(sys.argv) > 1 else \"0044_00445314_gt.dxf\"\n draw(out)\n print(\"wrote\", out)\n```"}], "images": ["images/0044_00445314.png"], "id": "0044_00445314"} {"messages": [{"role": "user", "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": "assistant", "content": "```python\n#!/usr/bin/env python3\n# -*- coding: utf-8 -*-\n# Ground-truth 2D engineering drawing for part: 0044_00446622\n# Self-contained: reproduces the three-view DXF via ezdxf, NO FreeCAD needed.\n# Coordinates are A4 page millimetres (scale=0.1922, page=[297.0, 210.0]).\n# visible edges -> solid (layer OUTLINE); hidden edges -> dashed (layer HIDDEN)\n# dimensions -> real movable DIMENSION entities (text = true mm value)\n# Run: python 0044_00446622_gt.py [out.dxf]\nimport sys\nimport ezdxf\n\nSCALE = 0.1922\nPAGE = [297.0, 210.0]\n\nVISIBLE_SEGMENTS = [\n (107.67, 172.05, 107.67, 152.83),\n (107.67, 152.83, 88.45, 152.83),\n (88.45, 152.83, 88.45, 172.05),\n (88.45, 172.05, 107.67, 172.05),\n (107.67, 61.95, 107.67, 138.83),\n (107.67, 138.83, 88.45, 138.83),\n (88.45, 61.95, 88.45, 138.83),\n (107.67, 61.95, 88.45, 61.95),\n (121.67, 152.83, 198.55, 152.83),\n (198.55, 152.83, 198.55, 172.05),\n (121.67, 172.05, 198.55, 172.05),\n (121.67, 152.83, 121.67, 172.05)\n]\nVISIBLE_CIRCLES = [\n\n]\nVISIBLE_ARCS = [\n\n]\nHIDDEN_SEGMENTS = [\n\n]\n# (orient, text, p1, p2, base) for linear; (orient, text, center, radius, angle) for diameter\nDIMENSIONS = [\n ('horizontal', '100', (107.67, 172.05), (88.45, 172.05), (98.06, 161.05)),\n ('vertical', '100', (107.67, 152.83), (107.67, 172.05), (96.67, 162.44)),\n ('horizontal', '400', (121.67, 152.83), (198.55, 152.83), (160.11, 163.83))\n]\n\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\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\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,\n angle=(0 if d[0] == \"horizontal\" else 90),\n 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,\n 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,\n text=text, dimstyle=\"EZDXF\").render()\n\n doc.saveas(out_path)\n\n\nif __name__ == \"__main__\":\n out = sys.argv[1] if len(sys.argv) > 1 else \"0044_00446622_gt.dxf\"\n draw(out)\n print(\"wrote\", out)\n```"}], "images": ["images/0044_00446622.png"], "id": "0044_00446622"} {"messages": [{"role": "user", "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 11.58 mm tall. It is extruded to a thickness of 48.73 mm."}, {"role": "assistant", "content": "```python\n#!/usr/bin/env python3\n# -*- coding: utf-8 -*-\n# Ground-truth 2D engineering drawing for part: 0045_00453255\n# Self-contained: reproduces the three-view DXF via ezdxf, NO FreeCAD needed.\n# Coordinates are A4 page millimetres (scale=1.316915094339694, page=[297.0, 210.0]).\n# visible edges -> solid (layer OUTLINE); hidden edges -> dashed (layer HIDDEN)\n# dimensions -> real movable DIMENSION entities (text = true mm value)\n# Run: python 0045_00453255_gt.py [out.dxf]\nimport sys\nimport ezdxf\n\nSCALE = 1.316915094339694\nPAGE = [297.0, 210.0]\n\nVISIBLE_SEGMENTS = [\n (170.256367, 148.465146, 170.256367, 163.713636),\n (170.256367, 163.713636, 38.564858, 163.713636),\n (38.564858, 163.713636, 38.564858, 148.465146),\n (38.564858, 148.465146, 170.256367, 148.465146),\n (170.256367, 134.465146, 170.256367, 70.286372),\n (38.564858, 134.465146, 38.564858, 70.286372),\n (38.564858, 70.286372, 170.256367, 70.286372),\n (38.564858, 134.465146, 170.256367, 134.465146),\n (248.435141, 163.713636, 184.256367, 163.713636),\n (184.256367, 163.713636, 184.256367, 148.465146),\n (248.435141, 148.465146, 184.256367, 148.465146),\n (248.435141, 163.713636, 248.435141, 148.465146)\n]\nVISIBLE_CIRCLES = [\n\n]\nVISIBLE_ARCS = [\n\n]\nHIDDEN_SEGMENTS = [\n\n]\n# (orient, text, p1, p2, base) for linear; (orient, text, center, radius, angle) for diameter\nDIMENSIONS = [\n ('horizontal', '100', (170.2564, 148.4652), (38.5649, 148.4652), (104.4106, 137.4652)),\n ('vertical', '11.5789', (170.2564, 163.7136), (170.2564, 148.4652), (181.2564, 156.0894)),\n ('horizontal', '48.7342', (248.4351, 163.7136), (184.2563, 163.7136), (216.3457, 152.7136))\n]\n\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\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\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,\n angle=(0 if d[0] == \"horizontal\" else 90),\n 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,\n 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,\n text=text, dimstyle=\"EZDXF\").render()\n\n doc.saveas(out_path)\n\n\nif __name__ == \"__main__\":\n out = sys.argv[1] if len(sys.argv) > 1 else \"0045_00453255_gt.dxf\"\n draw(out)\n print(\"wrote\", out)\n```"}], "images": ["images/0045_00453255.png"], "id": "0045_00453255"} {"messages": [{"role": "user", "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 1.04 mm."}, {"role": "assistant", "content": "```python\n#!/usr/bin/env python3\n# -*- coding: utf-8 -*-\n# Ground-truth 2D engineering drawing for part: 0045_00455721\n# Self-contained: reproduces the three-view DXF via ezdxf, NO FreeCAD needed.\n# Coordinates are A4 page millimetres (scale=0.9510927835051515, page=[297.0, 210.0]).\n# visible edges -> solid (layer OUTLINE); hidden edges -> dashed (layer HIDDEN)\n# dimensions -> real movable DIMENSION entities (text = true mm value)\n# Run: python 0045_00455721_gt.py [out.dxf]\nimport sys\nimport ezdxf\n\nSCALE = 0.9510927835051515\nPAGE = [297.0, 210.0]\n\nVISIBLE_SEGMENTS = [\n (149.019597, 172.049987, 149.019597, 76.940709),\n (149.019597, 76.940709, 122.989689, 76.940709),\n (122.989689, 76.940709, 122.989689, 172.049987),\n (122.989689, 172.049987, 149.019597, 172.049987),\n (149.019597, 61.949987, 149.019597, 62.940709),\n (149.019597, 62.940709, 122.989689, 62.940709),\n (122.989689, 61.949987, 122.989689, 62.940709),\n (149.019597, 61.949987, 122.989689, 61.949987),\n (163.019597, 76.940709, 164.010319, 76.940709),\n (164.010319, 76.940709, 164.010319, 172.049987),\n (163.019597, 172.049987, 164.010319, 172.049987),\n (163.019597, 76.940709, 163.019597, 172.049987)\n]\nVISIBLE_CIRCLES = [\n\n]\nVISIBLE_ARCS = [\n\n]\nHIDDEN_SEGMENTS = [\n\n]\n# (orient, text, p1, p2, base) for linear; (orient, text, center, radius, angle) for diameter\nDIMENSIONS = [\n ('horizontal', '27.3684', (149.0196, 172.05), (122.9897, 172.05), (136.0046, 161.05)),\n ('vertical', '100', (149.0196, 76.9407), (149.0196, 172.05), (138.0196, 124.4954)),\n ('horizontal', '1.0417', (163.0196, 76.9407), (164.0103, 76.9407), (163.515, 87.9407))\n]\n\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\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\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,\n angle=(0 if d[0] == \"horizontal\" else 90),\n 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,\n 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,\n text=text, dimstyle=\"EZDXF\").render()\n\n doc.saveas(out_path)\n\n\nif __name__ == \"__main__\":\n out = sys.argv[1] if len(sys.argv) > 1 else \"0045_00455721_gt.dxf\"\n draw(out)\n print(\"wrote\", out)\n```"}], "images": ["images/0045_00455721.png"], "id": "0045_00455721"} {"messages": [{"role": "user", "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 17.89 mm wide and 100 mm tall. It is extruded to a thickness of 1.04 mm."}, {"role": "assistant", "content": "```python\n#!/usr/bin/env python3\n# -*- coding: utf-8 -*-\n# Ground-truth 2D engineering drawing for part: 0045_00456759\n# Self-contained: reproduces the three-view DXF via ezdxf, NO FreeCAD needed.\n# Coordinates are A4 page millimetres (scale=0.9510927835051515, page=[297.0, 210.0]).\n# visible edges -> solid (layer OUTLINE); hidden edges -> dashed (layer HIDDEN)\n# dimensions -> real movable DIMENSION entities (text = true mm value)\n# Run: python 0045_00456759_gt.py [out.dxf]\nimport sys\nimport ezdxf\n\nSCALE = 0.9510927835051515\nPAGE = [297.0, 210.0]\n\nVISIBLE_SEGMENTS = [\n (144.514427, 172.049987, 144.514427, 76.940709),\n (144.514427, 76.940709, 127.494872, 76.940709),\n (127.494872, 76.940709, 127.494872, 172.049987),\n (127.494872, 172.049987, 144.514427, 172.049987),\n (144.514427, 61.949987, 144.514427, 62.940709),\n (144.514427, 62.940709, 127.494872, 62.940709),\n (127.494872, 61.949987, 127.494872, 62.940709),\n (144.514427, 61.949987, 127.494872, 61.949987),\n (158.514427, 76.940709, 159.505148, 76.940709),\n (159.505148, 76.940709, 159.505148, 172.049987),\n (158.514427, 172.049987, 159.505148, 172.049987),\n (158.514427, 76.940709, 158.514427, 172.049987)\n]\nVISIBLE_CIRCLES = [\n\n]\nVISIBLE_ARCS = [\n\n]\nHIDDEN_SEGMENTS = [\n\n]\n# (orient, text, p1, p2, base) for linear; (orient, text, center, radius, angle) for diameter\nDIMENSIONS = [\n ('horizontal', '17.8947', (144.5144, 172.05), (127.4949, 172.05), (136.0047, 161.05)),\n ('vertical', '100', (144.5144, 76.9407), (144.5144, 172.05), (133.5144, 124.4954)),\n ('horizontal', '1.0417', (158.5144, 76.9407), (159.5052, 76.9407), (159.0098, 87.9407))\n]\n\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\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\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,\n angle=(0 if d[0] == \"horizontal\" else 90),\n 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,\n 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,\n text=text, dimstyle=\"EZDXF\").render()\n\n doc.saveas(out_path)\n\n\nif __name__ == \"__main__\":\n out = sys.argv[1] if len(sys.argv) > 1 else \"0045_00456759_gt.dxf\"\n draw(out)\n print(\"wrote\", out)\n```"}], "images": ["images/0045_00456759.png"], "id": "0045_00456759"} {"messages": [{"role": "user", "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 66.32 mm wide and 100 mm tall. It is extruded to a thickness of 8.33 mm."}, {"role": "assistant", "content": "```python\n#!/usr/bin/env python3\n# -*- coding: utf-8 -*-\n# Ground-truth 2D engineering drawing for part: 0045_00457056\n# Self-contained: reproduces the three-view DXF via ezdxf, NO FreeCAD needed.\n# Coordinates are A4 page millimetres (scale=0.8870769230769259, page=[297.0, 210.0]).\n# visible edges -> solid (layer OUTLINE); hidden edges -> dashed (layer HIDDEN)\n# dimensions -> real movable DIMENSION entities (text = true mm value)\n# Run: python 0045_00457056_gt.py [out.dxf]\nimport sys\nimport ezdxf\n\nSCALE = 0.8870769230769259\nPAGE = [297.0, 210.0]\n\nVISIBLE_SEGMENTS = [\n (162.21746, 172.049995, 162.21746, 83.342303),\n (162.21746, 83.342303, 103.390253, 83.342303),\n (103.390253, 83.342303, 103.390253, 172.049995),\n (103.390253, 172.049995, 162.21746, 172.049995),\n (162.21746, 61.949995, 162.21746, 69.342303),\n (162.21746, 69.342303, 103.390253, 69.342303),\n (103.390253, 61.949995, 103.390253, 69.342303),\n (162.21746, 61.949995, 103.390253, 61.949995),\n (176.21746, 83.342303, 183.609767, 83.342303),\n (183.609767, 83.342303, 183.609767, 172.049995),\n (176.21746, 172.049995, 183.609767, 172.049995),\n (176.21746, 83.342303, 176.21746, 172.049995)\n]\nVISIBLE_CIRCLES = [\n\n]\nVISIBLE_ARCS = [\n\n]\nHIDDEN_SEGMENTS = [\n\n]\n# (orient, text, p1, p2, base) for linear; (orient, text, center, radius, angle) for diameter\nDIMENSIONS = [\n ('horizontal', '66.3158', (162.2175, 172.05), (103.3903, 172.05), (132.8039, 161.05)),\n ('vertical', '100', (162.2175, 83.3423), (162.2175, 172.05), (151.2175, 127.6962)),\n ('horizontal', '8.3333', (176.2174, 83.3423), (183.6097, 83.3423), (179.9136, 94.3423))\n]\n\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\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\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,\n angle=(0 if d[0] == \"horizontal\" else 90),\n 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,\n 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,\n text=text, dimstyle=\"EZDXF\").render()\n\n doc.saveas(out_path)\n\n\nif __name__ == \"__main__\":\n out = sys.argv[1] if len(sys.argv) > 1 else \"0045_00457056_gt.dxf\"\n draw(out)\n print(\"wrote\", out)\n```"}], "images": ["images/0045_00457056.png"], "id": "0045_00457056"} {"messages": [{"role": "user", "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 25 mm."}, {"role": "assistant", "content": "```python\n#!/usr/bin/env python3\n# -*- coding: utf-8 -*-\n# Ground-truth 2D engineering drawing for part: 0045_00459399\n# Self-contained: reproduces the three-view DXF via ezdxf, NO FreeCAD needed.\n# Coordinates are A4 page millimetres (scale=0.976174825174823, page=[297.0, 210.0]).\n# visible edges -> solid (layer OUTLINE); hidden edges -> dashed (layer HIDDEN)\n# dimensions -> real movable DIMENSION entities (text = true mm value)\n# Run: python 0045_00459399_gt.py [out.dxf]\nimport sys\nimport ezdxf\n\nSCALE = 0.976174825174823\nPAGE = [297.0, 210.0]\n\nVISIBLE_SEGMENTS = [\n (173.106582, 111.54089, 173.106582, 160.863407),\n (173.106582, 160.863407, 75.4891, 160.863407),\n (75.4891, 160.863407, 75.4891, 111.54089),\n (75.4891, 111.54089, 173.106582, 111.54089),\n (173.106582, 97.54089, 173.106582, 73.136519),\n (75.4891, 97.54089, 75.4891, 73.136519),\n (75.4891, 73.136519, 173.106582, 73.136519),\n (75.4891, 97.54089, 173.106582, 97.54089),\n (211.510953, 160.863407, 187.106582, 160.863407),\n (187.106582, 160.863407, 187.106582, 111.54089),\n (211.510953, 111.54089, 187.106582, 111.54089),\n (211.510953, 160.863407, 211.510953, 111.54089)\n]\nVISIBLE_CIRCLES = [\n\n]\nVISIBLE_ARCS = [\n\n]\nHIDDEN_SEGMENTS = [\n\n]\n# (orient, text, p1, p2, base) for linear; (orient, text, center, radius, angle) for diameter\nDIMENSIONS = [\n ('horizontal', '100', (173.1066, 111.5409), (75.4891, 111.5409), (124.2978, 100.5409)),\n ('vertical', '50.5263', (173.1066, 160.8634), (173.1066, 111.5409), (184.1066, 136.2022)),\n ('horizontal', '25', (211.5109, 160.8634), (187.1066, 160.8634), (199.3087, 149.8634))\n]\n\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\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\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,\n angle=(0 if d[0] == \"horizontal\" else 90),\n 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,\n 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,\n text=text, dimstyle=\"EZDXF\").render()\n\n doc.saveas(out_path)\n\n\nif __name__ == \"__main__\":\n out = sys.argv[1] if len(sys.argv) > 1 else \"0045_00459399_gt.dxf\"\n draw(out)\n print(\"wrote\", out)\n```"}], "images": ["images/0045_00459399.png"], "id": "0045_00459399"} {"messages": [{"role": "user", "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 25 mm."}, {"role": "assistant", "content": "```python\n#!/usr/bin/env python3\n# -*- coding: utf-8 -*-\n# Ground-truth 2D engineering drawing for part: 0045_00459434\n# Self-contained: reproduces the three-view DXF via ezdxf, NO FreeCAD needed.\n# Coordinates are A4 page millimetres (scale=0.976174825174823, page=[297.0, 210.0]).\n# visible edges -> solid (layer OUTLINE); hidden edges -> dashed (layer HIDDEN)\n# dimensions -> real movable DIMENSION entities (text = true mm value)\n# Run: python 0045_00459434_gt.py [out.dxf]\nimport sys\nimport ezdxf\n\nSCALE = 0.976174825174823\nPAGE = [297.0, 210.0]\n\nVISIBLE_SEGMENTS = [\n (173.106582, 111.54089, 173.106582, 160.863407),\n (173.106582, 160.863407, 75.4891, 160.863407),\n (75.4891, 160.863407, 75.4891, 111.54089),\n (75.4891, 111.54089, 173.106582, 111.54089),\n (173.106582, 97.54089, 173.106582, 73.136519),\n (75.4891, 97.54089, 75.4891, 73.136519),\n (75.4891, 73.136519, 173.106582, 73.136519),\n (75.4891, 97.54089, 173.106582, 97.54089),\n (211.510953, 160.863407, 187.106582, 160.863407),\n (187.106582, 160.863407, 187.106582, 111.54089),\n (211.510953, 111.54089, 187.106582, 111.54089),\n (211.510953, 160.863407, 211.510953, 111.54089)\n]\nVISIBLE_CIRCLES = [\n\n]\nVISIBLE_ARCS = [\n\n]\nHIDDEN_SEGMENTS = [\n\n]\n# (orient, text, p1, p2, base) for linear; (orient, text, center, radius, angle) for diameter\nDIMENSIONS = [\n ('horizontal', '100', (173.1066, 111.5409), (75.4891, 111.5409), (124.2978, 100.5409)),\n ('vertical', '50.5263', (173.1066, 160.8634), (173.1066, 111.5409), (184.1066, 136.2022)),\n ('horizontal', '25', (211.5109, 160.8634), (187.1066, 160.8634), (199.3087, 149.8634))\n]\n\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\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\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,\n angle=(0 if d[0] == \"horizontal\" else 90),\n 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,\n 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,\n text=text, dimstyle=\"EZDXF\").render()\n\n doc.saveas(out_path)\n\n\nif __name__ == \"__main__\":\n out = sys.argv[1] if len(sys.argv) > 1 else \"0045_00459434_gt.dxf\"\n draw(out)\n print(\"wrote\", out)\n```"}], "images": ["images/0045_00459434.png"], "id": "0045_00459434"} {"messages": [{"role": "user", "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": "assistant", "content": "```python\n#!/usr/bin/env python3\n# -*- coding: utf-8 -*-\n# Ground-truth 2D engineering drawing for part: 0046_00460420\n# Self-contained: reproduces the three-view DXF via ezdxf, NO FreeCAD needed.\n# Coordinates are A4 page millimetres (scale=0.8736363636363637, page=[297.0, 210.0]).\n# visible edges -> solid (layer OUTLINE); hidden edges -> dashed (layer HIDDEN)\n# dimensions -> real movable DIMENSION entities (text = true mm value)\n# Run: python 0046_00460420_gt.py [out.dxf]\nimport sys\nimport ezdxf\n\nSCALE = 0.8736363636363637\nPAGE = [297.0, 210.0]\n\nVISIBLE_SEGMENTS = [\n (158.340904, 172.049989, 158.340904, 119.631807),\n (158.340904, 119.631807, 70.977267, 119.631807),\n (70.977267, 119.631807, 70.977267, 172.049989),\n (70.977267, 172.049989, 158.340904, 172.049989),\n (158.340904, 61.949989, 158.340904, 105.631807),\n (158.340904, 105.631807, 70.977267, 105.631807),\n (70.977267, 61.949989, 70.977267, 105.631807),\n (158.340904, 61.949989, 70.977267, 61.949989),\n (172.340904, 119.631807, 216.022722, 119.631807),\n (216.022722, 119.631807, 216.022722, 172.049989),\n (172.340904, 172.049989, 216.022722, 172.049989),\n (172.340904, 119.631807, 172.340904, 172.049989)\n]\nVISIBLE_CIRCLES = [\n\n]\nVISIBLE_ARCS = [\n\n]\nHIDDEN_SEGMENTS = [\n\n]\n# (orient, text, p1, p2, base) for linear; (orient, text, center, radius, angle) for diameter\nDIMENSIONS = [\n ('horizontal', '100', (158.3409, 172.05), (70.9773, 172.05), (114.6591, 161.05)),\n ('vertical', '60', (158.3409, 119.6318), (158.3409, 172.05), (147.3409, 145.8409)),\n ('horizontal', '50', (172.3409, 119.6318), (216.0227, 119.6318), (194.1818, 130.6318))\n]\n\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\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\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,\n angle=(0 if d[0] == \"horizontal\" else 90),\n 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,\n 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,\n text=text, dimstyle=\"EZDXF\").render()\n\n doc.saveas(out_path)\n\n\nif __name__ == \"__main__\":\n out = sys.argv[1] if len(sys.argv) > 1 else \"0046_00460420_gt.dxf\"\n draw(out)\n print(\"wrote\", out)\n```"}], "images": ["images/0046_00460420.png"], "id": "0046_00460420"} {"messages": [{"role": "user", "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 1.56 mm."}, {"role": "assistant", "content": "```python\n#!/usr/bin/env python3\n# -*- coding: utf-8 -*-\n# Ground-truth 2D engineering drawing for part: 0046_00460919\n# Self-contained: reproduces the three-view DXF via ezdxf, NO FreeCAD needed.\n# Coordinates are A4 page millimetres (scale=1.446793846153846, page=[297.0, 210.0]).\n# visible edges -> solid (layer OUTLINE); hidden edges -> dashed (layer HIDDEN)\n# dimensions -> real movable DIMENSION entities (text = true mm value)\n# Run: python 0046_00460919_gt.py [out.dxf]\nimport sys\nimport ezdxf\n\nSCALE = 1.446793846153846\nPAGE = [297.0, 210.0]\n\nVISIBLE_SEGMENTS = [\n (207.709394, 146.451467, 207.709394, 103.809122),\n (207.709394, 103.809122, 63.030009, 103.809122),\n (63.030009, 103.809122, 63.030009, 146.451467),\n (63.030009, 146.451467, 207.709394, 146.451467),\n (207.709394, 87.548507, 207.709394, 89.809122),\n (207.709394, 89.809122, 63.030009, 89.809122),\n (63.030009, 87.548507, 63.030009, 89.809122),\n (207.709394, 87.548507, 63.030009, 87.548507),\n (221.709394, 103.809122, 223.970009, 103.809122),\n (223.970009, 103.809122, 223.970009, 146.451467),\n (221.709394, 146.451467, 223.970009, 146.451467),\n (221.709394, 103.809122, 221.709394, 146.451467)\n]\nVISIBLE_CIRCLES = [\n\n]\nVISIBLE_ARCS = [\n\n]\nHIDDEN_SEGMENTS = [\n\n]\n# (orient, text, p1, p2, base) for linear; (orient, text, center, radius, angle) for diameter\nDIMENSIONS = [\n ('horizontal', '100', (207.7094, 146.4515), (63.03, 146.4515), (135.3697, 135.4515)),\n ('vertical', '29.4737', (207.7094, 103.8091), (207.7094, 146.4515), (196.7094, 125.1303)),\n ('horizontal', '1.5625', (221.7094, 103.8091), (223.97, 103.8091), (222.8397, 114.8091))\n]\n\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\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\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,\n angle=(0 if d[0] == \"horizontal\" else 90),\n 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,\n 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,\n text=text, dimstyle=\"EZDXF\").render()\n\n doc.saveas(out_path)\n\n\nif __name__ == \"__main__\":\n out = sys.argv[1] if len(sys.argv) > 1 else \"0046_00460919_gt.dxf\"\n draw(out)\n print(\"wrote\", out)\n```"}], "images": ["images/0046_00460919.png"], "id": "0046_00460919"} {"messages": [{"role": "user", "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": "assistant", "content": "```python\n#!/usr/bin/env python3\n# -*- coding: utf-8 -*-\n# Ground-truth 2D engineering drawing for part: 0046_00461813\n# Self-contained: reproduces the three-view DXF via ezdxf, NO FreeCAD needed.\n# Coordinates are A4 page millimetres (scale=0.48049999999999987, page=[297.0, 210.0]).\n# visible edges -> solid (layer OUTLINE); hidden edges -> dashed (layer HIDDEN)\n# dimensions -> real movable DIMENSION entities (text = true mm value)\n# Run: python 0046_00461813_gt.py [out.dxf]\nimport sys\nimport ezdxf\n\nSCALE = 0.48049999999999987\nPAGE = [297.0, 210.0]\n\nVISIBLE_SEGMENTS = [\n (136.5, 124.0, 136.5, 172.05),\n (136.5, 172.05, 88.45, 172.05),\n (88.45, 172.05, 88.45, 124.0),\n (88.45, 124.0, 136.5, 124.0),\n (136.5, 110.0, 136.5, 61.95),\n (88.45, 110.0, 88.45, 61.95),\n (88.45, 61.95, 136.5, 61.95),\n (88.45, 110.0, 136.5, 110.0),\n (198.55, 172.05, 150.5, 172.05),\n (150.5, 172.05, 150.5, 124.0),\n (198.55, 124.0, 150.5, 124.0),\n (198.55, 172.05, 198.55, 124.0)\n]\nVISIBLE_CIRCLES = [\n\n]\nVISIBLE_ARCS = [\n\n]\nHIDDEN_SEGMENTS = [\n\n]\n# (orient, text, p1, p2, base) for linear; (orient, text, center, radius, angle) for diameter\nDIMENSIONS = [\n ('horizontal', '100', (136.5, 124.0), (88.45, 124.0), (112.475, 113.0)),\n ('vertical', '100', (136.5, 172.05), (136.5, 124.0), (147.5, 148.025)),\n ('horizontal', '100', (198.55, 172.05), (150.5, 172.05), (174.525, 161.05))\n]\n\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\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\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,\n angle=(0 if d[0] == \"horizontal\" else 90),\n 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,\n 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,\n text=text, dimstyle=\"EZDXF\").render()\n\n doc.saveas(out_path)\n\n\nif __name__ == \"__main__\":\n out = sys.argv[1] if len(sys.argv) > 1 else \"0046_00461813_gt.dxf\"\n draw(out)\n print(\"wrote\", out)\n```"}], "images": ["images/0046_00461813.png"], "id": "0046_00461813"} {"messages": [{"role": "user", "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 72.63 mm wide and 100 mm tall. It is extruded to a thickness of 4.17 mm."}, {"role": "assistant", "content": "```python\n#!/usr/bin/env python3\n# -*- coding: utf-8 -*-\n# Ground-truth 2D engineering drawing for part: 0046_00462808\n# Self-contained: reproduces the three-view DXF via ezdxf, NO FreeCAD needed.\n# Coordinates are A4 page millimetres (scale=0.8511768292682945, page=[297.0, 210.0]).\n# visible edges -> solid (layer OUTLINE); hidden edges -> dashed (layer HIDDEN)\n# dimensions -> real movable DIMENSION entities (text = true mm value)\n# Run: python 0046_00462808_gt.py [out.dxf]\nimport sys\nimport ezdxf\n\nSCALE = 0.8511768292682945\nPAGE = [297.0, 210.0]\n\nVISIBLE_SEGMENTS = [\n (165.637869, 83.21441, 165.637869, 168.332093),\n (165.637869, 168.332093, 103.815552, 168.332093),\n (103.815552, 168.332093, 103.815552, 83.21441),\n (103.815552, 83.21441, 165.637869, 83.21441),\n (165.637869, 69.21441, 165.637869, 65.66784),\n (103.815552, 69.21441, 103.815552, 65.66784),\n (103.815552, 65.66784, 165.637869, 65.66784),\n (103.815552, 69.21441, 165.637869, 69.21441),\n (183.18444, 168.332093, 179.637869, 168.332093),\n (179.637869, 168.332093, 179.637869, 83.21441),\n (183.18444, 83.21441, 179.637869, 83.21441),\n (183.18444, 168.332093, 183.18444, 83.21441)\n]\nVISIBLE_CIRCLES = [\n\n]\nVISIBLE_ARCS = [\n\n]\nHIDDEN_SEGMENTS = [\n\n]\n# (orient, text, p1, p2, base) for linear; (orient, text, center, radius, angle) for diameter\nDIMENSIONS = [\n ('horizontal', '72.6316', (165.6379, 83.2144), (103.8156, 83.2144), (134.7267, 72.2144)),\n ('vertical', '100', (165.6379, 168.3321), (165.6379, 83.2144), (176.6379, 125.7733)),\n ('horizontal', '4.1667', (183.1844, 168.3321), (179.6378, 168.3321), (181.4111, 157.3321))\n]\n\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\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\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,\n angle=(0 if d[0] == \"horizontal\" else 90),\n 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,\n 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,\n text=text, dimstyle=\"EZDXF\").render()\n\n doc.saveas(out_path)\n\n\nif __name__ == \"__main__\":\n out = sys.argv[1] if len(sys.argv) > 1 else \"0046_00462808_gt.dxf\"\n draw(out)\n print(\"wrote\", out)\n```"}], "images": ["images/0046_00462808.png"], "id": "0046_00462808"} {"messages": [{"role": "user", "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 25 mm."}, {"role": "assistant", "content": "```python\n#!/usr/bin/env python3\n# -*- coding: utf-8 -*-\n# Ground-truth 2D engineering drawing for part: 0046_00463468\n# Self-contained: reproduces the three-view DXF via ezdxf, NO FreeCAD needed.\n# Coordinates are A4 page millimetres (scale=0.7688, page=[297.0, 210.0]).\n# visible edges -> solid (layer OUTLINE); hidden edges -> dashed (layer HIDDEN)\n# dimensions -> real movable DIMENSION entities (text = true mm value)\n# Run: python 0046_00463468_gt.py [out.dxf]\nimport sys\nimport ezdxf\n\nSCALE = 0.7688\nPAGE = [297.0, 210.0]\n\nVISIBLE_SEGMENTS = [\n (165.33, 172.05, 165.33, 95.17),\n (165.33, 95.17, 88.45, 95.17),\n (88.45, 95.17, 88.45, 172.05),\n (88.45, 172.05, 165.33, 172.05),\n (165.33, 61.95, 165.33, 81.17),\n (165.33, 81.17, 88.45, 81.17),\n (88.45, 61.95, 88.45, 81.17),\n (165.33, 61.95, 88.45, 61.95),\n (179.33, 95.17, 198.55, 95.17),\n (198.55, 95.17, 198.55, 172.05),\n (179.33, 172.05, 198.55, 172.05),\n (179.33, 95.17, 179.33, 172.05)\n]\nVISIBLE_CIRCLES = [\n\n]\nVISIBLE_ARCS = [\n\n]\nHIDDEN_SEGMENTS = [\n\n]\n# (orient, text, p1, p2, base) for linear; (orient, text, center, radius, angle) for diameter\nDIMENSIONS = [\n ('horizontal', '100', (165.33, 172.05), (88.45, 172.05), (126.89, 161.05)),\n ('vertical', '100', (165.33, 95.17), (165.33, 172.05), (154.33, 133.61)),\n ('horizontal', '25', (179.33, 95.17), (198.55, 95.17), (188.94, 106.17))\n]\n\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\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\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,\n angle=(0 if d[0] == \"horizontal\" else 90),\n 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,\n 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,\n text=text, dimstyle=\"EZDXF\").render()\n\n doc.saveas(out_path)\n\n\nif __name__ == \"__main__\":\n out = sys.argv[1] if len(sys.argv) > 1 else \"0046_00463468_gt.dxf\"\n draw(out)\n print(\"wrote\", out)\n```"}], "images": ["images/0046_00463468.png"], "id": "0046_00463468"} {"messages": [{"role": "user", "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 27.69 mm."}, {"role": "assistant", "content": "```python\n#!/usr/bin/env python3\n# -*- coding: utf-8 -*-\n# Ground-truth 2D engineering drawing for part: 0046_00463786\n# Self-contained: reproduces the three-view DXF via ezdxf, NO FreeCAD needed.\n# Coordinates are A4 page millimetres (scale=0.752590361446017, page=[297.0, 210.0]).\n# visible edges -> solid (layer OUTLINE); hidden edges -> dashed (layer HIDDEN)\n# dimensions -> real movable DIMENSION entities (text = true mm value)\n# Run: python 0046_00463786_gt.py [out.dxf]\nimport sys\nimport ezdxf\n\nSCALE = 0.752590361446017\nPAGE = [297.0, 210.0]\n\nVISIBLE_SEGMENTS = [\n (154.994813, 172.050022, 154.994813, 96.790986),\n (154.994813, 96.790986, 97.164185, 96.790986),\n (97.164185, 96.790986, 97.164185, 172.050022),\n (97.164185, 172.050022, 154.994813, 172.050022),\n (154.994813, 61.950022, 154.994813, 82.790986),\n (154.994813, 82.790986, 97.164185, 82.790986),\n (97.164185, 61.950022, 97.164185, 82.790986),\n (154.994813, 61.950022, 97.164185, 61.950022),\n (168.994813, 96.790986, 189.835777, 96.790986),\n (189.835777, 96.790986, 189.835777, 172.050022),\n (168.994813, 172.050022, 189.835777, 172.050022),\n (168.994813, 96.790986, 168.994813, 172.050022)\n]\nVISIBLE_CIRCLES = [\n\n]\nVISIBLE_ARCS = [\n\n]\nHIDDEN_SEGMENTS = [\n\n]\n# (orient, text, p1, p2, base) for linear; (orient, text, center, radius, angle) for diameter\nDIMENSIONS = [\n ('horizontal', '76.8421', (154.9948, 172.05), (97.1642, 172.05), (126.0795, 161.05)),\n ('vertical', '100', (154.9948, 96.791), (154.9948, 172.05), (143.9948, 134.4205)),\n ('horizontal', '27.6923', (168.9948, 96.791), (189.8358, 96.791), (179.4153, 107.791))\n]\n\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\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\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,\n angle=(0 if d[0] == \"horizontal\" else 90),\n 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,\n 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,\n text=text, dimstyle=\"EZDXF\").render()\n\n doc.saveas(out_path)\n\n\nif __name__ == \"__main__\":\n out = sys.argv[1] if len(sys.argv) > 1 else \"0046_00463786_gt.dxf\"\n draw(out)\n print(\"wrote\", out)\n```"}], "images": ["images/0046_00463786.png"], "id": "0046_00463786"} {"messages": [{"role": "user", "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 40.23 mm."}, {"role": "assistant", "content": "```python\n#!/usr/bin/env python3\n# -*- coding: utf-8 -*-\n# Ground-truth 2D engineering drawing for part: 0046_00464378\n# Self-contained: reproduces the three-view DXF via ezdxf, NO FreeCAD needed.\n# Coordinates are A4 page millimetres (scale=1.0478508196721554, page=[297.0, 210.0]).\n# visible edges -> solid (layer OUTLINE); hidden edges -> dashed (layer HIDDEN)\n# dimensions -> real movable DIMENSION entities (text = true mm value)\n# Run: python 0046_00464378_gt.py [out.dxf]\nimport sys\nimport ezdxf\n\nSCALE = 1.0478508196721554\nPAGE = [297.0, 210.0]\n\nVISIBLE_SEGMENTS = [\n (167.815093, 171.549525, 167.815093, 118.605483),\n (167.815093, 118.605483, 63.030011, 118.605483),\n (63.030011, 118.605483, 63.030011, 171.549525),\n (63.030011, 171.549525, 167.815093, 171.549525),\n (167.815093, 62.450565, 167.815093, 104.605483),\n (167.815093, 104.605483, 63.030011, 104.605483),\n (63.030011, 62.450565, 63.030011, 104.605483),\n (167.815093, 62.450565, 63.030011, 62.450565),\n (181.815093, 118.605483, 223.970011, 118.605483),\n (223.970011, 118.605483, 223.970011, 171.549525),\n (181.815093, 171.549525, 223.970011, 171.549525),\n (181.815093, 118.605483, 181.815093, 171.549525)\n]\nVISIBLE_CIRCLES = [\n\n]\nVISIBLE_ARCS = [\n\n]\nHIDDEN_SEGMENTS = [\n\n]\n# (orient, text, p1, p2, base) for linear; (orient, text, center, radius, angle) for diameter\nDIMENSIONS = [\n ('horizontal', '100', (167.8151, 171.5495), (63.03, 171.5495), (115.4226, 160.5495)),\n ('vertical', '50.5263', (167.8151, 118.6055), (167.8151, 171.5495), (156.8151, 145.0775)),\n ('horizontal', '40.2299', (181.8151, 118.6055), (223.97, 118.6055), (202.8925, 129.6055))\n]\n\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\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\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,\n angle=(0 if d[0] == \"horizontal\" else 90),\n 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,\n 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,\n text=text, dimstyle=\"EZDXF\").render()\n\n doc.saveas(out_path)\n\n\nif __name__ == \"__main__\":\n out = sys.argv[1] if len(sys.argv) > 1 else \"0046_00464378_gt.dxf\"\n draw(out)\n print(\"wrote\", out)\n```"}], "images": ["images/0046_00464378.png"], "id": "0046_00464378"} {"messages": [{"role": "user", "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.68 mm tall. It is extruded to a thickness of 4.86 mm."}, {"role": "assistant", "content": "```python\n#!/usr/bin/env python3\n# -*- coding: utf-8 -*-\n# Ground-truth 2D engineering drawing for part: 0046_00467811\n# Self-contained: reproduces the three-view DXF via ezdxf, NO FreeCAD needed.\n# Coordinates are A4 page millimetres (scale=1.4012319587629918, page=[297.0, 210.0]).\n# visible edges -> solid (layer OUTLINE); hidden edges -> dashed (layer HIDDEN)\n# dimensions -> real movable DIMENSION entities (text = true mm value)\n# Run: python 0046_00467811_gt.py [out.dxf]\nimport sys\nimport ezdxf\n\nSCALE = 1.4012319587629918\nPAGE = [297.0, 210.0]\n\nVISIBLE_SEGMENTS = [\n (203.153198, 136.995732, 203.153198, 117.820979),\n (203.153198, 117.820979, 63.030002, 117.820979),\n (63.030002, 117.820979, 63.030002, 136.995732),\n (63.030002, 136.995732, 203.153198, 136.995732),\n (203.153198, 97.004175, 203.153198, 103.820979),\n (203.153198, 103.820979, 63.030002, 103.820979),\n (63.030002, 97.004175, 63.030002, 103.820979),\n (203.153198, 97.004175, 63.030002, 97.004175),\n (217.153198, 117.820979, 223.970002, 117.820979),\n (223.970002, 117.820979, 223.970002, 136.995732),\n (217.153198, 136.995732, 223.970002, 136.995732),\n (217.153198, 117.820979, 217.153198, 136.995732)\n]\nVISIBLE_CIRCLES = [\n\n]\nVISIBLE_ARCS = [\n\n]\nHIDDEN_SEGMENTS = [\n\n]\n# (orient, text, p1, p2, base) for linear; (orient, text, center, radius, angle) for diameter\nDIMENSIONS = [\n ('horizontal', '100', (203.1532, 136.9957), (63.03, 136.9957), (133.0916, 125.9957)),\n ('vertical', '13.6842', (203.1532, 117.821), (203.1532, 136.9957), (192.1532, 127.4084)),\n ('horizontal', '4.8649', (217.1532, 117.821), (223.97, 117.821), (220.5616, 128.821))\n]\n\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\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\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,\n angle=(0 if d[0] == \"horizontal\" else 90),\n 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,\n 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,\n text=text, dimstyle=\"EZDXF\").render()\n\n doc.saveas(out_path)\n\n\nif __name__ == \"__main__\":\n out = sys.argv[1] if len(sys.argv) > 1 else \"0046_00467811_gt.dxf\"\n draw(out)\n print(\"wrote\", out)\n```"}], "images": ["images/0046_00467811.png"], "id": "0046_00467811"} {"messages": [{"role": "user", "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 64.58 mm."}, {"role": "assistant", "content": "```python\n#!/usr/bin/env python3\n# -*- coding: utf-8 -*-\n# Ground-truth 2D engineering drawing for part: 0047_00472504\n# Self-contained: reproduces the three-view DXF via ezdxf, NO FreeCAD needed.\n# Coordinates are A4 page millimetres (scale=0.6646685878962688, page=[297.0, 210.0]).\n# visible edges -> solid (layer OUTLINE); hidden edges -> dashed (layer HIDDEN)\n# dimensions -> real movable DIMENSION entities (text = true mm value)\n# Run: python 0047_00472504_gt.py [out.dxf]\nimport sys\nimport ezdxf\n\nSCALE = 0.6646685878962688\nPAGE = [297.0, 210.0]\n\nVISIBLE_SEGMENTS = [\n (148.270189, 118.876508, 148.270189, 172.049995),\n (148.270189, 172.049995, 81.80333, 172.049995),\n (81.80333, 172.049995, 81.80333, 118.876508),\n (81.80333, 118.876508, 148.270189, 118.876508),\n (148.270189, 104.876508, 148.270189, 61.949995),\n (81.80333, 104.876508, 81.80333, 61.949995),\n (81.80333, 61.949995, 148.270189, 61.949995),\n (81.80333, 104.876508, 148.270189, 104.876508),\n (205.196702, 172.049995, 162.270189, 172.049995),\n (162.270189, 172.049995, 162.270189, 118.876508),\n (205.196702, 118.876508, 162.270189, 118.876508),\n (205.196702, 172.049995, 205.196702, 118.876508)\n]\nVISIBLE_CIRCLES = [\n\n]\nVISIBLE_ARCS = [\n\n]\nHIDDEN_SEGMENTS = [\n\n]\n# (orient, text, p1, p2, base) for linear; (orient, text, center, radius, angle) for diameter\nDIMENSIONS = [\n ('horizontal', '100', (148.2702, 118.8765), (81.8033, 118.8765), (115.0367, 107.8765)),\n ('vertical', '80', (148.2702, 172.05), (148.2702, 118.8765), (159.2702, 145.4633)),\n ('horizontal', '64.5833', (205.1967, 172.05), (162.2702, 172.05), (183.7334, 161.05))\n]\n\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\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\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,\n angle=(0 if d[0] == \"horizontal\" else 90),\n 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,\n 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,\n text=text, dimstyle=\"EZDXF\").render()\n\n doc.saveas(out_path)\n\n\nif __name__ == \"__main__\":\n out = sys.argv[1] if len(sys.argv) > 1 else \"0047_00472504_gt.dxf\"\n draw(out)\n print(\"wrote\", out)\n```"}], "images": ["images/0047_00472504.png"], "id": "0047_00472504"} {"messages": [{"role": "user", "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 112.94 mm."}, {"role": "assistant", "content": "```python\n#!/usr/bin/env python3\n# -*- coding: utf-8 -*-\n# Ground-truth 2D engineering drawing for part: 0047_00473593\n# Self-contained: reproduces the three-view DXF via ezdxf, NO FreeCAD needed.\n# Coordinates are A4 page millimetres (scale=0.7987725167272942, page=[297.0, 210.0]).\n# visible edges -> solid (layer OUTLINE); hidden edges -> dashed (layer HIDDEN)\n# dimensions -> real movable DIMENSION entities (text = true mm value)\n# Run: python 0047_00473593_gt.py [out.dxf]\nimport sys\nimport ezdxf\n\nSCALE = 0.7987725167272942\nPAGE = [297.0, 210.0]\n\nVISIBLE_SEGMENTS = [\n (131.331489, 166.164305, 131.331489, 172.049997),\n (131.331489, 172.049997, 51.454237, 172.049997),\n (51.454237, 172.049997, 51.454237, 166.164305),\n (51.454237, 166.164305, 131.331489, 166.164305),\n (131.331489, 152.164305, 131.331489, 61.949997),\n (51.454237, 152.164305, 51.454237, 61.949997),\n (51.454237, 61.949997, 131.331489, 61.949997),\n (51.454237, 152.164305, 131.331489, 152.164305),\n (235.545797, 172.049997, 145.331489, 172.049997),\n (145.331489, 172.049997, 145.331489, 166.164305),\n (235.545797, 166.164305, 145.331489, 166.164305),\n (235.545797, 172.049997, 235.545797, 166.164305)\n]\nVISIBLE_CIRCLES = [\n\n]\nVISIBLE_ARCS = [\n\n]\nHIDDEN_SEGMENTS = [\n\n]\n# (orient, text, p1, p2, base) for linear; (orient, text, center, radius, angle) for diameter\nDIMENSIONS = [\n ('horizontal', '100', (131.3315, 166.1643), (51.4542, 166.1643), (91.3929, 155.1643)),\n ('vertical', '7.3684', (131.3315, 172.05), (131.3315, 166.1643), (142.3315, 169.1071)),\n ('horizontal', '112.941', (235.5458, 172.05), (145.3315, 172.05), (190.4386, 161.05))\n]\n\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\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\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,\n angle=(0 if d[0] == \"horizontal\" else 90),\n 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,\n 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,\n text=text, dimstyle=\"EZDXF\").render()\n\n doc.saveas(out_path)\n\n\nif __name__ == \"__main__\":\n out = sys.argv[1] if len(sys.argv) > 1 else \"0047_00473593_gt.dxf\"\n draw(out)\n print(\"wrote\", out)\n```"}], "images": ["images/0047_00473593.png"], "id": "0047_00473593"} {"messages": [{"role": "user", "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.04 mm."}, {"role": "assistant", "content": "```python\n#!/usr/bin/env python3\n# -*- coding: utf-8 -*-\n# Ground-truth 2D engineering drawing for part: 0047_00477178\n# Self-contained: reproduces the three-view DXF via ezdxf, NO FreeCAD needed.\n# Coordinates are A4 page millimetres (scale=0.9510927835051515, page=[297.0, 210.0]).\n# visible edges -> solid (layer OUTLINE); hidden edges -> dashed (layer HIDDEN)\n# dimensions -> real movable DIMENSION entities (text = true mm value)\n# Run: python 0047_00477178_gt.py [out.dxf]\nimport sys\nimport ezdxf\n\nSCALE = 0.9510927835051515\nPAGE = [297.0, 210.0]\n\nVISIBLE_SEGMENTS = [\n (183.559291, 172.049987, 183.559291, 76.940709),\n (183.559291, 76.940709, 88.450013, 76.940709),\n (88.450013, 76.940709, 88.450013, 172.049987),\n (88.450013, 172.049987, 183.559291, 172.049987),\n (183.559291, 61.949987, 183.559291, 62.940709),\n (183.559291, 62.940709, 88.450013, 62.940709),\n (88.450013, 61.949987, 88.450013, 62.940709),\n (183.559291, 61.949987, 88.450013, 61.949987),\n (197.559291, 76.940709, 198.550013, 76.940709),\n (198.550013, 76.940709, 198.550013, 172.049987),\n (197.559291, 172.049987, 198.550013, 172.049987),\n (197.559291, 76.940709, 197.559291, 172.049987)\n]\nVISIBLE_CIRCLES = [\n\n]\nVISIBLE_ARCS = [\n\n]\nHIDDEN_SEGMENTS = [\n\n]\n# (orient, text, p1, p2, base) for linear; (orient, text, center, radius, angle) for diameter\nDIMENSIONS = [\n ('horizontal', '100', (183.5593, 172.05), (88.45, 172.05), (136.0046, 161.05)),\n ('vertical', '100', (183.5593, 76.9407), (183.5593, 172.05), (172.5593, 124.4954)),\n ('horizontal', '1.0417', (197.5593, 76.9407), (198.55, 76.9407), (198.0547, 87.9407))\n]\n\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\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\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,\n angle=(0 if d[0] == \"horizontal\" else 90),\n 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,\n 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,\n text=text, dimstyle=\"EZDXF\").render()\n\n doc.saveas(out_path)\n\n\nif __name__ == \"__main__\":\n out = sys.argv[1] if len(sys.argv) > 1 else \"0047_00477178_gt.dxf\"\n draw(out)\n print(\"wrote\", out)\n```"}], "images": ["images/0047_00477178.png"], "id": "0047_00477178"} {"messages": [{"role": "user", "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 3.12 mm."}, {"role": "assistant", "content": "```python\n#!/usr/bin/env python3\n# -*- coding: utf-8 -*-\n# Ground-truth 2D engineering drawing for part: 0048_00481103\n# Self-contained: reproduces the three-view DXF via ezdxf, NO FreeCAD needed.\n# Coordinates are A4 page millimetres (scale=1.1416334505666326, page=[297.0, 210.0]).\n# visible edges -> solid (layer OUTLINE); hidden edges -> dashed (layer HIDDEN)\n# dimensions -> real movable DIMENSION entities (text = true mm value)\n# Run: python 0048_00481103_gt.py [out.dxf]\nimport sys\nimport ezdxf\n\nSCALE = 1.1416334505666326\nPAGE = [297.0, 210.0]\n\nVISIBLE_SEGMENTS = [\n (191.797888, 172.049997, 191.797888, 79.517602),\n (191.797888, 79.517602, 77.634543, 79.517602),\n (77.634543, 79.517602, 77.634543, 172.049997),\n (77.634543, 172.049997, 191.797888, 172.049997),\n (191.797888, 61.949997, 191.797888, 65.517602),\n (191.797888, 65.517602, 77.634543, 65.517602),\n (77.634543, 61.949997, 77.634543, 65.517602),\n (191.797888, 61.949997, 77.634543, 61.949997),\n (205.797888, 79.517602, 209.365493, 79.517602),\n (209.365493, 79.517602, 209.365493, 172.049997),\n (205.797888, 172.049997, 209.365493, 172.049997),\n (205.797888, 79.517602, 205.797888, 172.049997)\n]\nVISIBLE_CIRCLES = [\n\n]\nVISIBLE_ARCS = [\n\n]\nHIDDEN_SEGMENTS = [\n\n]\n# (orient, text, p1, p2, base) for linear; (orient, text, center, radius, angle) for diameter\nDIMENSIONS = [\n ('horizontal', '100', (191.7979, 172.05), (77.6345, 172.05), (134.7162, 161.05)),\n ('vertical', '81.0526', (191.7979, 79.5176), (191.7979, 172.05), (180.7979, 125.7838)),\n ('horizontal', '3.125', (205.7979, 79.5176), (209.3655, 79.5176), (207.5817, 90.5176))\n]\n\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\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\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,\n angle=(0 if d[0] == \"horizontal\" else 90),\n 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,\n 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,\n text=text, dimstyle=\"EZDXF\").render()\n\n doc.saveas(out_path)\n\n\nif __name__ == \"__main__\":\n out = sys.argv[1] if len(sys.argv) > 1 else \"0048_00481103_gt.dxf\"\n draw(out)\n print(\"wrote\", out)\n```"}], "images": ["images/0048_00481103.png"], "id": "0048_00481103"} {"messages": [{"role": "user", "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 73.85 mm."}, {"role": "assistant", "content": "```python\n#!/usr/bin/env python3\n# -*- coding: utf-8 -*-\n# Ground-truth 2D engineering drawing for part: 0048_00485023\n# Self-contained: reproduces the three-view DXF via ezdxf, NO FreeCAD needed.\n# Coordinates are A4 page millimetres (scale=0.5527876106194686, page=[297.0, 210.0]).\n# visible edges -> solid (layer OUTLINE); hidden edges -> dashed (layer HIDDEN)\n# dimensions -> real movable DIMENSION entities (text = true mm value)\n# Run: python 0048_00485023_gt.py [out.dxf]\nimport sys\nimport ezdxf\n\nSCALE = 0.5527876106194686\nPAGE = [297.0, 210.0]\n\nVISIBLE_SEGMENTS = [\n (137.037129, 172.049977, 137.037129, 116.771216),\n (137.037129, 116.771216, 95.141647, 116.771216),\n (95.141647, 116.771216, 95.141647, 172.049977),\n (95.141647, 172.049977, 137.037129, 172.049977),\n (137.037129, 61.949977, 137.037129, 102.771216),\n (137.037129, 102.771216, 95.141647, 102.771216),\n (95.141647, 61.949977, 95.141647, 102.771216),\n (137.037129, 61.949977, 95.141647, 61.949977),\n (151.037129, 116.771216, 191.858368, 116.771216),\n (191.858368, 116.771216, 191.858368, 172.049977),\n (151.037129, 172.049977, 191.858368, 172.049977),\n (151.037129, 116.771216, 151.037129, 172.049977)\n]\nVISIBLE_CIRCLES = [\n\n]\nVISIBLE_ARCS = [\n\n]\nHIDDEN_SEGMENTS = [\n\n]\n# (orient, text, p1, p2, base) for linear; (orient, text, center, radius, angle) for diameter\nDIMENSIONS = [\n ('horizontal', '75.7895', (137.0371, 172.05), (95.1417, 172.05), (116.0894, 161.05)),\n ('vertical', '100', (137.0371, 116.7712), (137.0371, 172.05), (126.0371, 144.4106)),\n ('horizontal', '73.8462', (151.0371, 116.7712), (191.8584, 116.7712), (171.4478, 127.7712))\n]\n\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\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\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,\n angle=(0 if d[0] == \"horizontal\" else 90),\n 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,\n 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,\n text=text, dimstyle=\"EZDXF\").render()\n\n doc.saveas(out_path)\n\n\nif __name__ == \"__main__\":\n out = sys.argv[1] if len(sys.argv) > 1 else \"0048_00485023_gt.dxf\"\n draw(out)\n print(\"wrote\", out)\n```"}], "images": ["images/0048_00485023.png"], "id": "0048_00485023"} {"messages": [{"role": "user", "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 37.89 mm wide and 100 mm tall. It is extruded to a thickness of 29.17 mm."}, {"role": "assistant", "content": "```python\n#!/usr/bin/env python3\n# -*- coding: utf-8 -*-\n# Ground-truth 2D engineering drawing for part: 0048_00485776\n# Self-contained: reproduces the three-view DXF via ezdxf, NO FreeCAD needed.\n# Coordinates are A4 page millimetres (scale=0.7440000000000384, page=[297.0, 210.0]).\n# visible edges -> solid (layer OUTLINE); hidden edges -> dashed (layer HIDDEN)\n# dimensions -> real movable DIMENSION entities (text = true mm value)\n# Run: python 0048_00485776_gt.py [out.dxf]\nimport sys\nimport ezdxf\n\nSCALE = 0.7440000000000384\nPAGE = [297.0, 210.0]\n\nVISIBLE_SEGMENTS = [\n (139.746817, 97.65, 139.746817, 172.05),\n (139.746817, 172.05, 111.553133, 172.05),\n (111.553133, 172.05, 111.553133, 97.65),\n (111.553133, 97.65, 139.746817, 97.65),\n (139.746817, 83.65, 139.746817, 61.95),\n (111.553133, 83.65, 111.553133, 61.95),\n (111.553133, 61.95, 139.746817, 61.95),\n (111.553133, 83.65, 139.746817, 83.65),\n (175.446817, 172.05, 153.746817, 172.05),\n (153.746817, 172.05, 153.746817, 97.65),\n (175.446817, 97.65, 153.746817, 97.65),\n (175.446817, 172.05, 175.446817, 97.65)\n]\nVISIBLE_CIRCLES = [\n\n]\nVISIBLE_ARCS = [\n\n]\nHIDDEN_SEGMENTS = [\n\n]\n# (orient, text, p1, p2, base) for linear; (orient, text, center, radius, angle) for diameter\nDIMENSIONS = [\n ('horizontal', '37.8947', (139.7468, 97.65), (111.5532, 97.65), (125.65, 86.65)),\n ('vertical', '100', (139.7468, 172.05), (139.7468, 97.65), (150.7468, 134.85)),\n ('horizontal', '29.1667', (175.4468, 172.05), (153.7468, 172.05), (164.5968, 161.05))\n]\n\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\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\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,\n angle=(0 if d[0] == \"horizontal\" else 90),\n 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,\n 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,\n text=text, dimstyle=\"EZDXF\").render()\n\n doc.saveas(out_path)\n\n\nif __name__ == \"__main__\":\n out = sys.argv[1] if len(sys.argv) > 1 else \"0048_00485776_gt.dxf\"\n draw(out)\n print(\"wrote\", out)\n```"}], "images": ["images/0048_00485776.png"], "id": "0048_00485776"} {"messages": [{"role": "user", "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 45 mm."}, {"role": "assistant", "content": "```python\n#!/usr/bin/env python3\n# -*- coding: utf-8 -*-\n# Ground-truth 2D engineering drawing for part: 0048_00488867\n# Self-contained: reproduces the three-view DXF via ezdxf, NO FreeCAD needed.\n# Coordinates are A4 page millimetres (scale=0.6627586206896551, page=[297.0, 210.0]).\n# visible edges -> solid (layer OUTLINE); hidden edges -> dashed (layer HIDDEN)\n# dimensions -> real movable DIMENSION entities (text = true mm value)\n# Run: python 0048_00488867_gt.py [out.dxf]\nimport sys\nimport ezdxf\n\nSCALE = 0.6627586206896551\nPAGE = [297.0, 210.0]\n\nVISIBLE_SEGMENTS = [\n (145.307705, 105.774123, 145.307705, 172.049985),\n (145.307705, 172.049985, 97.868141, 172.049985),\n (97.868141, 172.049985, 97.868141, 105.774123),\n (97.868141, 105.774123, 145.307705, 105.774123),\n (145.307705, 91.774123, 145.307705, 61.949985),\n (97.868141, 91.774123, 97.868141, 61.949985),\n (97.868141, 61.949985, 145.307705, 61.949985),\n (97.868141, 91.774123, 145.307705, 91.774123),\n (189.131843, 172.049985, 159.307705, 172.049985),\n (159.307705, 172.049985, 159.307705, 105.774123),\n (189.131843, 105.774123, 159.307705, 105.774123),\n (189.131843, 172.049985, 189.131843, 105.774123)\n]\nVISIBLE_CIRCLES = [\n\n]\nVISIBLE_ARCS = [\n\n]\nHIDDEN_SEGMENTS = [\n\n]\n# (orient, text, p1, p2, base) for linear; (orient, text, center, radius, angle) for diameter\nDIMENSIONS = [\n ('horizontal', '71.5789', (145.3077, 105.7741), (97.8681, 105.7741), (121.5879, 94.7741)),\n ('vertical', '100', (145.3077, 172.05), (145.3077, 105.7741), (156.3077, 138.9121)),\n ('horizontal', '45', (189.1319, 172.05), (159.3077, 172.05), (174.2198, 161.05))\n]\n\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\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\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,\n angle=(0 if d[0] == \"horizontal\" else 90),\n 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,\n 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,\n text=text, dimstyle=\"EZDXF\").render()\n\n doc.saveas(out_path)\n\n\nif __name__ == \"__main__\":\n out = sys.argv[1] if len(sys.argv) > 1 else \"0048_00488867_gt.dxf\"\n draw(out)\n print(\"wrote\", out)\n```"}], "images": ["images/0048_00488867.png"], "id": "0048_00488867"} {"messages": [{"role": "user", "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 4.55 mm."}, {"role": "assistant", "content": "```python\n#!/usr/bin/env python3\n# -*- coding: utf-8 -*-\n# Ground-truth 2D engineering drawing for part: 0048_00489373\n# Self-contained: reproduces the three-view DXF via ezdxf, NO FreeCAD needed.\n# Coordinates are A4 page millimetres (scale=0.9192173913043878, page=[297.0, 210.0]).\n# visible edges -> solid (layer OUTLINE); hidden edges -> dashed (layer HIDDEN)\n# dimensions -> real movable DIMENSION entities (text = true mm value)\n# Run: python 0048_00489373_gt.py [out.dxf]\nimport sys\nimport ezdxf\n\nSCALE = 0.9192173913043878\nPAGE = [297.0, 210.0]\n\nVISIBLE_SEGMENTS = [\n (179.887956, 172.050023, 179.887956, 80.128284),\n (179.887956, 80.128284, 88.933814, 80.128284),\n (88.933814, 80.128284, 88.933814, 172.050023),\n (88.933814, 172.050023, 179.887956, 172.050023),\n (179.887956, 61.950023, 179.887956, 66.128284),\n (179.887956, 66.128284, 88.933814, 66.128284),\n (88.933814, 61.950023, 88.933814, 66.128284),\n (179.887956, 61.950023, 88.933814, 61.950023),\n (193.887956, 80.128284, 198.066217, 80.128284),\n (198.066217, 80.128284, 198.066217, 172.050023),\n (193.887956, 172.050023, 198.066217, 172.050023),\n (193.887956, 80.128284, 193.887956, 172.050023)\n]\nVISIBLE_CIRCLES = [\n\n]\nVISIBLE_ARCS = [\n\n]\nHIDDEN_SEGMENTS = [\n\n]\n# (orient, text, p1, p2, base) for linear; (orient, text, center, radius, angle) for diameter\nDIMENSIONS = [\n ('horizontal', '98.9474', (179.888, 172.05), (88.9338, 172.05), (134.4109, 161.05)),\n ('vertical', '100', (179.888, 80.1283), (179.888, 172.05), (168.888, 126.0892)),\n ('horizontal', '4.5455', (193.8879, 80.1283), (198.0662, 80.1283), (195.9771, 91.1283))\n]\n\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\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\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,\n angle=(0 if d[0] == \"horizontal\" else 90),\n 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,\n 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,\n text=text, dimstyle=\"EZDXF\").render()\n\n doc.saveas(out_path)\n\n\nif __name__ == \"__main__\":\n out = sys.argv[1] if len(sys.argv) > 1 else \"0048_00489373_gt.dxf\"\n draw(out)\n print(\"wrote\", out)\n```"}], "images": ["images/0048_00489373.png"], "id": "0048_00489373"} {"messages": [{"role": "user", "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 71.58 mm tall. It is extruded to a thickness of 1.04 mm."}, {"role": "assistant", "content": "```python\n#!/usr/bin/env python3\n# -*- coding: utf-8 -*-\n# Ground-truth 2D engineering drawing for part: 0049_00490101\n# Self-contained: reproduces the three-view DXF via ezdxf, NO FreeCAD needed.\n# Coordinates are A4 page millimetres (scale=1.3233157179525845, page=[297.0, 210.0]).\n# visible edges -> solid (layer OUTLINE); hidden edges -> dashed (layer HIDDEN)\n# dimensions -> real movable DIMENSION entities (text = true mm value)\n# Run: python 0049_00490101_gt.py [out.dxf]\nimport sys\nimport ezdxf\n\nSCALE = 1.3233157179525845\nPAGE = [297.0, 210.0]\n\nVISIBLE_SEGMENTS = [\n (201.976604, 172.049988, 201.976604, 77.328442),\n (201.976604, 77.328442, 69.645032, 77.328442),\n (69.645032, 77.328442, 69.645032, 172.049988),\n (69.645032, 172.049988, 201.976604, 172.049988),\n (201.976604, 61.949988, 201.976604, 63.328442),\n (201.976604, 63.328442, 69.645032, 63.328442),\n (69.645032, 61.949988, 69.645032, 63.328442),\n (201.976604, 61.949988, 69.645032, 61.949988),\n (215.976604, 77.328442, 217.355057, 77.328442),\n (217.355057, 77.328442, 217.355057, 172.049988),\n (215.976604, 172.049988, 217.355057, 172.049988),\n (215.976604, 77.328442, 215.976604, 172.049988)\n]\nVISIBLE_CIRCLES = [\n\n]\nVISIBLE_ARCS = [\n\n]\nHIDDEN_SEGMENTS = [\n\n]\n# (orient, text, p1, p2, base) for linear; (orient, text, center, radius, angle) for diameter\nDIMENSIONS = [\n ('horizontal', '100', (201.9766, 172.0499), (69.645, 172.0499), (135.8108, 161.0499)),\n ('vertical', '71.5789', (201.9766, 77.3285), (201.9766, 172.0499), (190.9766, 124.6892)),\n ('horizontal', '1.0417', (215.9766, 77.3285), (217.3551, 77.3285), (216.6658, 88.3285))\n]\n\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\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\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,\n angle=(0 if d[0] == \"horizontal\" else 90),\n 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,\n 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,\n text=text, dimstyle=\"EZDXF\").render()\n\n doc.saveas(out_path)\n\n\nif __name__ == \"__main__\":\n out = sys.argv[1] if len(sys.argv) > 1 else \"0049_00490101_gt.dxf\"\n draw(out)\n print(\"wrote\", out)\n```"}], "images": ["images/0049_00490101.png"], "id": "0049_00490101"} {"messages": [{"role": "user", "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 1.19 mm."}, {"role": "assistant", "content": "```python\n#!/usr/bin/env python3\n# -*- coding: utf-8 -*-\n# Ground-truth 2D engineering drawing for part: 0049_00490278\n# Self-contained: reproduces the three-view DXF via ezdxf, NO FreeCAD needed.\n# Coordinates are A4 page millimetres (scale=1.4521129411765166, page=[297.0, 210.0]).\n# visible edges -> solid (layer OUTLINE); hidden edges -> dashed (layer HIDDEN)\n# dimensions -> real movable DIMENSION entities (text = true mm value)\n# Run: python 0049_00490278_gt.py [out.dxf]\nimport sys\nimport ezdxf\n\nSCALE = 1.4521129411765166\nPAGE = [297.0, 210.0]\n\nVISIBLE_SEGMENTS = [\n (208.241358, 149.320987, 208.241358, 100.407709),\n (208.241358, 100.407709, 63.030064, 100.407709),\n (63.030064, 100.407709, 63.030064, 149.320987),\n (63.030064, 149.320987, 208.241358, 149.320987),\n (208.241358, 84.679003, 208.241358, 86.407709),\n (208.241358, 86.407709, 63.030064, 86.407709),\n (63.030064, 84.679003, 63.030064, 86.407709),\n (208.241358, 84.679003, 63.030064, 84.679003),\n (222.241358, 100.407709, 223.970064, 100.407709),\n (223.970064, 100.407709, 223.970064, 149.320987),\n (222.241358, 149.320987, 223.970064, 149.320987),\n (222.241358, 100.407709, 222.241358, 149.320987)\n]\nVISIBLE_CIRCLES = [\n\n]\nVISIBLE_ARCS = [\n\n]\nHIDDEN_SEGMENTS = [\n\n]\n# (orient, text, p1, p2, base) for linear; (orient, text, center, radius, angle) for diameter\nDIMENSIONS = [\n ('horizontal', '100', (208.2414, 149.321), (63.0301, 149.321), (135.6357, 138.321)),\n ('vertical', '33.6842', (208.2414, 100.4077), (208.2414, 149.321), (197.2414, 124.8644)),\n ('horizontal', '1.1905', (222.2413, 100.4077), (223.97, 100.4077), (223.1057, 111.4077))\n]\n\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\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\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,\n angle=(0 if d[0] == \"horizontal\" else 90),\n 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,\n 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,\n text=text, dimstyle=\"EZDXF\").render()\n\n doc.saveas(out_path)\n\n\nif __name__ == \"__main__\":\n out = sys.argv[1] if len(sys.argv) > 1 else \"0049_00490278_gt.dxf\"\n draw(out)\n print(\"wrote\", out)\n```"}], "images": ["images/0049_00490278.png"], "id": "0049_00490278"} {"messages": [{"role": "user", "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 100 mm."}, {"role": "assistant", "content": "```python\n#!/usr/bin/env python3\n# -*- coding: utf-8 -*-\n# Ground-truth 2D engineering drawing for part: 0049_00490463\n# Self-contained: reproduces the three-view DXF via ezdxf, NO FreeCAD needed.\n# Coordinates are A4 page millimetres (scale=0.686428571428581, page=[297.0, 210.0]).\n# visible edges -> solid (layer OUTLINE); hidden edges -> dashed (layer HIDDEN)\n# dimensions -> real movable DIMENSION entities (text = true mm value)\n# Run: python 0049_00490463_gt.py [out.dxf]\nimport sys\nimport ezdxf\n\nSCALE = 0.686428571428581\nPAGE = [297.0, 210.0]\n\nVISIBLE_SEGMENTS = [\n (136.50002, 144.592834, 136.50002, 172.049977),\n (136.50002, 172.049977, 67.857163, 172.049977),\n (67.857163, 172.049977, 67.857163, 144.592834),\n (67.857163, 144.592834, 136.50002, 144.592834),\n (136.50002, 130.592834, 136.50002, 61.949977),\n (67.857163, 130.592834, 67.857163, 61.949977),\n (67.857163, 61.949977, 136.50002, 61.949977),\n (67.857163, 130.592834, 136.50002, 130.592834),\n (219.142877, 172.049977, 150.50002, 172.049977),\n (150.50002, 172.049977, 150.50002, 144.592834),\n (219.142877, 144.592834, 150.50002, 144.592834),\n (219.142877, 172.049977, 219.142877, 144.592834)\n]\nVISIBLE_CIRCLES = [\n\n]\nVISIBLE_ARCS = [\n\n]\nHIDDEN_SEGMENTS = [\n\n]\n# (orient, text, p1, p2, base) for linear; (orient, text, center, radius, angle) for diameter\nDIMENSIONS = [\n ('horizontal', '100', (136.5, 144.5928), (67.8572, 144.5928), (102.1786, 133.5928)),\n ('vertical', '40', (136.5, 172.05), (136.5, 144.5928), (147.5, 158.3214)),\n ('horizontal', '100', (219.1429, 172.05), (150.5, 172.05), (184.8214, 161.05))\n]\n\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\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\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,\n angle=(0 if d[0] == \"horizontal\" else 90),\n 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,\n 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,\n text=text, dimstyle=\"EZDXF\").render()\n\n doc.saveas(out_path)\n\n\nif __name__ == \"__main__\":\n out = sys.argv[1] if len(sys.argv) > 1 else \"0049_00490463_gt.dxf\"\n draw(out)\n print(\"wrote\", out)\n```"}], "images": ["images/0049_00490463.png"], "id": "0049_00490463"} {"messages": [{"role": "user", "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": "assistant", "content": "```python\n#!/usr/bin/env python3\n# -*- coding: utf-8 -*-\n# Ground-truth 2D engineering drawing for part: 0049_00490517\n# Self-contained: reproduces the three-view DXF via ezdxf, NO FreeCAD needed.\n# Coordinates are A4 page millimetres (scale=0.4805, page=[297.0, 210.0]).\n# visible edges -> solid (layer OUTLINE); hidden edges -> dashed (layer HIDDEN)\n# dimensions -> real movable DIMENSION entities (text = true mm value)\n# Run: python 0049_00490517_gt.py [out.dxf]\nimport sys\nimport ezdxf\n\nSCALE = 0.4805\nPAGE = [297.0, 210.0]\n\nVISIBLE_SEGMENTS = [\n (136.5, 172.05, 136.5, 124.0),\n (136.5, 124.0, 88.45, 124.0),\n (88.45, 124.0, 88.45, 172.05),\n (88.45, 172.05, 136.5, 172.05),\n (136.5, 61.95, 136.5, 110.0),\n (136.5, 110.0, 88.45, 110.0),\n (88.45, 61.95, 88.45, 110.0),\n (136.5, 61.95, 88.45, 61.95),\n (150.5, 124.0, 198.55, 124.0),\n (198.55, 124.0, 198.55, 172.05),\n (150.5, 172.05, 198.55, 172.05),\n (150.5, 124.0, 150.5, 172.05)\n]\nVISIBLE_CIRCLES = [\n\n]\nVISIBLE_ARCS = [\n\n]\nHIDDEN_SEGMENTS = [\n\n]\n# (orient, text, p1, p2, base) for linear; (orient, text, center, radius, angle) for diameter\nDIMENSIONS = [\n ('horizontal', '100', (136.5, 172.05), (88.45, 172.05), (112.475, 161.05)),\n ('vertical', '100', (136.5, 124.0), (136.5, 172.05), (125.5, 148.025)),\n ('horizontal', '100', (150.5, 124.0), (198.55, 124.0), (174.525, 135.0))\n]\n\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\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\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,\n angle=(0 if d[0] == \"horizontal\" else 90),\n 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,\n 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,\n text=text, dimstyle=\"EZDXF\").render()\n\n doc.saveas(out_path)\n\n\nif __name__ == \"__main__\":\n out = sys.argv[1] if len(sys.argv) > 1 else \"0049_00490517_gt.dxf\"\n draw(out)\n print(\"wrote\", out)\n```"}], "images": ["images/0049_00490517.png"], "id": "0049_00490517"} {"messages": [{"role": "user", "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. It is extruded to a thickness of 2.08 mm."}, {"role": "assistant", "content": "```python\n#!/usr/bin/env python3\n# -*- coding: utf-8 -*-\n# Ground-truth 2D engineering drawing for part: 0049_00495467\n# Self-contained: reproduces the three-view DXF via ezdxf, NO FreeCAD needed.\n# Coordinates are A4 page millimetres (scale=0.9413877551020439, page=[297.0, 210.0]).\n# visible edges -> solid (layer OUTLINE); hidden edges -> dashed (layer HIDDEN)\n# dimensions -> real movable DIMENSION entities (text = true mm value)\n# Run: python 0049_00495467_gt.py [out.dxf]\nimport sys\nimport ezdxf\n\nSCALE = 0.9413877551020439\nPAGE = [297.0, 210.0]\n\nVISIBLE_SEGMENTS = [\n (151.374296, 172.049985, 151.374296, 77.91121),\n (151.374296, 77.91121, 119.664392, 77.91121),\n (119.664392, 77.91121, 119.664392, 172.049985),\n (119.664392, 172.049985, 151.374296, 172.049985),\n (151.374296, 61.949985, 151.374296, 63.91121),\n (151.374296, 63.91121, 119.664392, 63.91121),\n (119.664392, 61.949985, 119.664392, 63.91121),\n (151.374296, 61.949985, 119.664392, 61.949985),\n (165.374296, 77.91121, 167.33552, 77.91121),\n (167.33552, 77.91121, 167.33552, 172.049985),\n (165.374296, 172.049985, 167.33552, 172.049985),\n (165.374296, 77.91121, 165.374296, 172.049985)\n]\nVISIBLE_CIRCLES = [\n\n]\nVISIBLE_ARCS = [\n\n]\nHIDDEN_SEGMENTS = [\n\n]\n# (orient, text, p1, p2, base) for linear; (orient, text, center, radius, angle) for diameter\nDIMENSIONS = [\n ('horizontal', '33.6842', (151.3743, 172.05), (119.6644, 172.05), (135.5194, 161.05)),\n ('vertical', '100', (151.3743, 77.9112), (151.3743, 172.05), (140.3743, 124.9806)),\n ('horizontal', '2.0833', (165.3743, 77.9112), (167.3355, 77.9112), (166.3549, 88.9112))\n]\n\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\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\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,\n angle=(0 if d[0] == \"horizontal\" else 90),\n 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,\n 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,\n text=text, dimstyle=\"EZDXF\").render()\n\n doc.saveas(out_path)\n\n\nif __name__ == \"__main__\":\n out = sys.argv[1] if len(sys.argv) > 1 else \"0049_00495467_gt.dxf\"\n draw(out)\n print(\"wrote\", out)\n```"}], "images": ["images/0049_00495467.png"], "id": "0049_00495467"} {"messages": [{"role": "user", "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 259.46 mm."}, {"role": "assistant", "content": "```python\n#!/usr/bin/env python3\n# -*- coding: utf-8 -*-\n# Ground-truth 2D engineering drawing for part: 0049_00497357\n# Self-contained: reproduces the three-view DXF via ezdxf, NO FreeCAD needed.\n# Coordinates are A4 page millimetres (scale=0.2673458646616619, page=[297.0, 210.0]).\n# visible edges -> solid (layer OUTLINE); hidden edges -> dashed (layer HIDDEN)\n# dimensions -> real movable DIMENSION entities (text = true mm value)\n# Run: python 0049_00497357_gt.py [out.dxf]\nimport sys\nimport ezdxf\n\nSCALE = 0.2673458646616619\nPAGE = [297.0, 210.0]\n\nVISIBLE_SEGMENTS = [\n (115.184595, 172.049992, 115.184595, 145.315405),\n (115.184595, 145.315405, 88.450008, 145.315405),\n (88.450008, 145.315405, 88.450008, 172.049992),\n (88.450008, 172.049992, 115.184595, 172.049992),\n (115.184595, 61.949992, 115.184595, 131.315405),\n (115.184595, 131.315405, 88.450008, 131.315405),\n (88.450008, 61.949992, 88.450008, 131.315405),\n (115.184595, 61.949992, 88.450008, 61.949992),\n (129.184595, 145.315405, 198.550008, 145.315405),\n (198.550008, 145.315405, 198.550008, 172.049992),\n (129.184595, 172.049992, 198.550008, 172.049992),\n (129.184595, 145.315405, 129.184595, 172.049992)\n]\nVISIBLE_CIRCLES = [\n\n]\nVISIBLE_ARCS = [\n\n]\nHIDDEN_SEGMENTS = [\n\n]\n# (orient, text, p1, p2, base) for linear; (orient, text, center, radius, angle) for diameter\nDIMENSIONS = [\n ('horizontal', '100', (115.1846, 172.05), (88.45, 172.05), (101.8173, 161.05)),\n ('vertical', '100', (115.1846, 145.3154), (115.1846, 172.05), (104.1846, 158.6827)),\n ('horizontal', '259.459', (129.1846, 145.3154), (198.55, 145.3154), (163.8673, 156.3154))\n]\n\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\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\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,\n angle=(0 if d[0] == \"horizontal\" else 90),\n 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,\n 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,\n text=text, dimstyle=\"EZDXF\").render()\n\n doc.saveas(out_path)\n\n\nif __name__ == \"__main__\":\n out = sys.argv[1] if len(sys.argv) > 1 else \"0049_00497357_gt.dxf\"\n draw(out)\n print(\"wrote\", out)\n```"}], "images": ["images/0049_00497357.png"], "id": "0049_00497357"} {"messages": [{"role": "user", "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 59.38 mm."}, {"role": "assistant", "content": "```python\n#!/usr/bin/env python3\n# -*- coding: utf-8 -*-\n# Ground-truth 2D engineering drawing for part: 0049_00497369\n# Self-contained: reproduces the three-view DXF via ezdxf, NO FreeCAD needed.\n# Coordinates are A4 page millimetres (scale=0.6029803921568627, page=[297.0, 210.0]).\n# visible edges -> solid (layer OUTLINE); hidden edges -> dashed (layer HIDDEN)\n# dimensions -> real movable DIMENSION entities (text = true mm value)\n# Run: python 0049_00497369_gt.py [out.dxf]\nimport sys\nimport ezdxf\n\nSCALE = 0.6029803921568627\nPAGE = [297.0, 210.0]\n\nVISIBLE_SEGMENTS = [\n (140.179348, 172.050024, 140.179348, 111.751984),\n (140.179348, 111.751984, 97.018646, 111.751984),\n (97.018646, 111.751984, 97.018646, 172.050024),\n (97.018646, 172.050024, 140.179348, 172.050024),\n (140.179348, 61.950024, 140.179348, 97.751984),\n (140.179348, 97.751984, 97.018646, 97.751984),\n (97.018646, 61.950024, 97.018646, 97.751984),\n (140.179348, 61.950024, 97.018646, 61.950024),\n (154.179348, 111.751984, 189.981309, 111.751984),\n (189.981309, 111.751984, 189.981309, 172.050024),\n (154.179348, 172.050024, 189.981309, 172.050024),\n (154.179348, 111.751984, 154.179348, 172.050024)\n]\nVISIBLE_CIRCLES = [\n\n]\nVISIBLE_ARCS = [\n\n]\nHIDDEN_SEGMENTS = [\n\n]\n# (orient, text, p1, p2, base) for linear; (orient, text, center, radius, angle) for diameter\nDIMENSIONS = [\n ('horizontal', '71.5789', (140.1793, 172.05), (97.0187, 172.05), (118.599, 161.05)),\n ('vertical', '100', (140.1793, 111.752), (140.1793, 172.05), (129.1793, 141.901)),\n ('horizontal', '59.375', (154.1794, 111.752), (189.9813, 111.752), (172.0804, 122.752))\n]\n\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\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\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,\n angle=(0 if d[0] == \"horizontal\" else 90),\n 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,\n 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,\n text=text, dimstyle=\"EZDXF\").render()\n\n doc.saveas(out_path)\n\n\nif __name__ == \"__main__\":\n out = sys.argv[1] if len(sys.argv) > 1 else \"0049_00497369_gt.dxf\"\n draw(out)\n print(\"wrote\", out)\n```"}], "images": ["images/0049_00497369.png"], "id": "0049_00497369"} {"messages": [{"role": "user", "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 22.11 mm tall. It is extruded to a thickness of 3.12 mm."}, {"role": "assistant", "content": "```python\n#!/usr/bin/env python3\n# -*- coding: utf-8 -*-\n# Ground-truth 2D engineering drawing for part: 0050_00502833\n# Self-contained: reproduces the three-view DXF via ezdxf, NO FreeCAD needed.\n# Coordinates are A4 page millimetres (scale=1.4248727272727273, page=[297.0, 210.0]).\n# visible edges -> solid (layer OUTLINE); hidden edges -> dashed (layer HIDDEN)\n# dimensions -> real movable DIMENSION entities (text = true mm value)\n# Run: python 0050_00502833_gt.py [out.dxf]\nimport sys\nimport ezdxf\n\nSCALE = 1.4248727272727273\nPAGE = [297.0, 210.0]\n\nVISIBLE_SEGMENTS = [\n (205.517289, 141.974992, 205.517289, 110.477805),\n (205.517289, 110.477805, 63.030016, 110.477805),\n (63.030016, 110.477805, 63.030016, 141.974992),\n (63.030016, 141.974992, 205.517289, 141.974992),\n (205.517289, 92.025078, 205.517289, 96.477805),\n (205.517289, 96.477805, 63.030016, 96.477805),\n (63.030016, 92.025078, 63.030016, 96.477805),\n (205.517289, 92.025078, 63.030016, 92.025078),\n (219.517289, 110.477805, 223.970016, 110.477805),\n (223.970016, 110.477805, 223.970016, 141.974992),\n (219.517289, 141.974992, 223.970016, 141.974992),\n (219.517289, 110.477805, 219.517289, 141.974992)\n]\nVISIBLE_CIRCLES = [\n\n]\nVISIBLE_ARCS = [\n\n]\nHIDDEN_SEGMENTS = [\n\n]\n# (orient, text, p1, p2, base) for linear; (orient, text, center, radius, angle) for diameter\nDIMENSIONS = [\n ('horizontal', '100', (205.5173, 141.975), (63.03, 141.975), (134.2736, 130.975)),\n ('vertical', '22.1053', (205.5173, 110.4778), (205.5173, 141.975), (194.5173, 126.2264)),\n ('horizontal', '3.125', (219.5173, 110.4778), (223.97, 110.4778), (221.7436, 121.4778))\n]\n\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\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\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,\n angle=(0 if d[0] == \"horizontal\" else 90),\n 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,\n 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,\n text=text, dimstyle=\"EZDXF\").render()\n\n doc.saveas(out_path)\n\n\nif __name__ == \"__main__\":\n out = sys.argv[1] if len(sys.argv) > 1 else \"0050_00502833_gt.dxf\"\n draw(out)\n print(\"wrote\", out)\n```"}], "images": ["images/0050_00502833.png"], "id": "0050_00502833"} {"messages": [{"role": "user", "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": "assistant", "content": "```python\n#!/usr/bin/env python3\n# -*- coding: utf-8 -*-\n# Ground-truth 2D engineering drawing for part: 0050_00508977\n# Self-contained: reproduces the three-view DXF via ezdxf, NO FreeCAD needed.\n# Coordinates are A4 page millimetres (scale=0.48049999999999987, page=[297.0, 210.0]).\n# visible edges -> solid (layer OUTLINE); hidden edges -> dashed (layer HIDDEN)\n# dimensions -> real movable DIMENSION entities (text = true mm value)\n# Run: python 0050_00508977_gt.py [out.dxf]\nimport sys\nimport ezdxf\n\nSCALE = 0.48049999999999987\nPAGE = [297.0, 210.0]\n\nVISIBLE_SEGMENTS = [\n (136.5, 124.0, 136.5, 172.05),\n (136.5, 172.05, 88.45, 172.05),\n (88.45, 172.05, 88.45, 124.0),\n (88.45, 124.0, 136.5, 124.0),\n (136.5, 110.0, 136.5, 61.95),\n (88.45, 110.0, 88.45, 61.95),\n (88.45, 61.95, 136.5, 61.95),\n (88.45, 110.0, 136.5, 110.0),\n (198.55, 172.05, 150.5, 172.05),\n (150.5, 172.05, 150.5, 124.0),\n (198.55, 124.0, 150.5, 124.0),\n (198.55, 172.05, 198.55, 124.0)\n]\nVISIBLE_CIRCLES = [\n\n]\nVISIBLE_ARCS = [\n\n]\nHIDDEN_SEGMENTS = [\n\n]\n# (orient, text, p1, p2, base) for linear; (orient, text, center, radius, angle) for diameter\nDIMENSIONS = [\n ('horizontal', '100', (136.5, 124.0), (88.45, 124.0), (112.475, 113.0)),\n ('vertical', '100', (136.5, 172.05), (136.5, 124.0), (147.5, 148.025)),\n ('horizontal', '100', (198.55, 172.05), (150.5, 172.05), (174.525, 161.05))\n]\n\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\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\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,\n angle=(0 if d[0] == \"horizontal\" else 90),\n 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,\n 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,\n text=text, dimstyle=\"EZDXF\").render()\n\n doc.saveas(out_path)\n\n\nif __name__ == \"__main__\":\n out = sys.argv[1] if len(sys.argv) > 1 else \"0050_00508977_gt.dxf\"\n draw(out)\n print(\"wrote\", out)\n```"}], "images": ["images/0050_00508977.png"], "id": "0050_00508977"} {"messages": [{"role": "user", "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 5.26 mm tall. It is extruded to a thickness of 50 mm."}, {"role": "assistant", "content": "```python\n#!/usr/bin/env python3\n# -*- coding: utf-8 -*-\n# Ground-truth 2D engineering drawing for part: 0051_00511376\n# Self-contained: reproduces the three-view DXF via ezdxf, NO FreeCAD needed.\n# Coordinates are A4 page millimetres (scale=0.9129499999999985, page=[297.0, 210.0]).\n# visible edges -> solid (layer OUTLINE); hidden edges -> dashed (layer HIDDEN)\n# dimensions -> real movable DIMENSION entities (text = true mm value)\n# Run: python 0051_00511376_gt.py [out.dxf]\nimport sys\nimport ezdxf\n\nSCALE = 0.9129499999999985\nPAGE = [297.0, 210.0]\n\nVISIBLE_SEGMENTS = [\n (64.651267, 215.295, 64.651267, 124.0),\n (69.456267, 124.0, 69.456267, 215.295),\n (69.456267, 215.295, 64.651267, 215.295),\n (69.456267, 124.0, 64.651267, 124.0),\n (174.751267, 320.59, 83.456267, 320.59),\n (174.751267, 229.295, 83.456267, 229.295),\n (174.751267, 229.295, 174.751267, 320.59),\n (83.456267, 229.295, 83.456267, 320.59)\n]\nVISIBLE_CIRCLES = [\n\n]\nVISIBLE_ARCS = [\n\n]\nHIDDEN_SEGMENTS = [\n\n]\n# (orient, text, p1, p2, base) for linear; (orient, text, center, radius, angle) for diameter\nDIMENSIONS = [\n ('vertical', '100', (69.4563, 124.0), (69.4563, 215.295), (58.4563, 169.6475)),\n ('horizontal', '5.2632', (64.6512, 124.0), (69.4563, 124.0), (67.0537, 135.0)),\n ('vertical', '100', (64.6512, 110.0), (64.6512, 18.705), (75.6512, 64.3525))\n]\n\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\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\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,\n angle=(0 if d[0] == \"horizontal\" else 90),\n 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,\n 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,\n text=text, dimstyle=\"EZDXF\").render()\n\n doc.saveas(out_path)\n\n\nif __name__ == \"__main__\":\n out = sys.argv[1] if len(sys.argv) > 1 else \"0051_00511376_gt.dxf\"\n draw(out)\n print(\"wrote\", out)\n```"}], "images": ["images/0051_00511376.png"], "id": "0051_00511376"} {"messages": [{"role": "user", "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 69.47 mm wide and 100 mm tall. It is extruded to a thickness of 8.61 mm."}, {"role": "assistant", "content": "```python\n#!/usr/bin/env python3\n# -*- coding: utf-8 -*-\n# Ground-truth 2D engineering drawing for part: 0051_00512500\n# Self-contained: reproduces the three-view DXF via ezdxf, NO FreeCAD needed.\n# Coordinates are A4 page millimetres (scale=0.8848231707317546, page=[297.0, 210.0]).\n# visible edges -> solid (layer OUTLINE); hidden edges -> dashed (layer HIDDEN)\n# dimensions -> real movable DIMENSION entities (text = true mm value)\n# Run: python 0051_00512500_gt.py [out.dxf]\nimport sys\nimport ezdxf\n\nSCALE = 0.8848231707317546\nPAGE = [297.0, 210.0]\n\nVISIBLE_SEGMENTS = [\n (163.427109, 172.05001, 163.427109, 83.567693),\n (163.427109, 83.567693, 101.955183, 83.567693),\n (101.955183, 83.567693, 101.955183, 172.05001),\n (101.955183, 172.05001, 163.427109, 172.05001),\n (163.427109, 61.95001, 163.427109, 69.567693),\n (163.427109, 69.567693, 101.955183, 69.567693),\n (101.955183, 61.95001, 101.955183, 69.567693),\n (163.427109, 61.95001, 101.955183, 61.95001),\n (177.427109, 83.567693, 185.044791, 83.567693),\n (185.044791, 83.567693, 185.044791, 172.05001),\n (177.427109, 172.05001, 185.044791, 172.05001),\n (177.427109, 83.567693, 177.427109, 172.05001)\n]\nVISIBLE_CIRCLES = [\n\n]\nVISIBLE_ARCS = [\n\n]\nHIDDEN_SEGMENTS = [\n\n]\n# (orient, text, p1, p2, base) for linear; (orient, text, center, radius, angle) for diameter\nDIMENSIONS = [\n ('horizontal', '69.4737', (163.4271, 172.05), (101.9552, 172.05), (132.6911, 161.05)),\n ('vertical', '100', (163.4271, 83.5677), (163.4271, 172.05), (152.4271, 127.8089)),\n ('horizontal', '8.6093', (177.4271, 83.5677), (185.0448, 83.5677), (181.236, 94.5677))\n]\n\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\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\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,\n angle=(0 if d[0] == \"horizontal\" else 90),\n 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,\n 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,\n text=text, dimstyle=\"EZDXF\").render()\n\n doc.saveas(out_path)\n\n\nif __name__ == \"__main__\":\n out = sys.argv[1] if len(sys.argv) > 1 else \"0051_00512500_gt.dxf\"\n draw(out)\n print(\"wrote\", out)\n```"}], "images": ["images/0051_00512500.png"], "id": "0051_00512500"} {"messages": [{"role": "user", "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 34.88 mm."}, {"role": "assistant", "content": "```python\n#!/usr/bin/env python3\n# -*- coding: utf-8 -*-\n# Ground-truth 2D engineering drawing for part: 0051_00516971\n# Self-contained: reproduces the three-view DXF via ezdxf, NO FreeCAD needed.\n# Coordinates are A4 page millimetres (scale=1.4391030927836, page=[297.0, 210.0]).\n# visible edges -> solid (layer OUTLINE); hidden edges -> dashed (layer HIDDEN)\n# dimensions -> real movable DIMENSION entities (text = true mm value)\n# Run: python 0051_00516971_gt.py [out.dxf]\nimport sys\nimport ezdxf\n\nSCALE = 1.4391030927836\nPAGE = [297.0, 210.0]\n\nVISIBLE_SEGMENTS = [\n (183.354508, 147.585746, 183.354508, 150.615436),\n (183.354508, 150.615436, 39.444198, 150.615436),\n (39.444198, 150.615436, 39.444198, 147.585746),\n (39.444198, 147.585746, 183.354508, 147.585746),\n (183.354508, 133.585746, 183.354508, 83.384475),\n (39.444198, 133.585746, 39.444198, 83.384475),\n (39.444198, 83.384475, 183.354508, 83.384475),\n (39.444198, 133.585746, 183.354508, 133.585746),\n (247.555778, 150.615436, 197.354508, 150.615436),\n (197.354508, 150.615436, 197.354508, 147.585746),\n (247.555778, 147.585746, 197.354508, 147.585746),\n (247.555778, 150.615436, 247.555778, 147.585746)\n]\nVISIBLE_CIRCLES = [\n\n]\nVISIBLE_ARCS = [\n\n]\nHIDDEN_SEGMENTS = [\n\n]\n# (orient, text, p1, p2, base) for linear; (orient, text, center, radius, angle) for diameter\nDIMENSIONS = [\n ('horizontal', '100', (183.3545, 147.5858), (39.4442, 147.5858), (111.3994, 136.5858)),\n ('vertical', '2.1053', (183.3545, 150.6154), (183.3545, 147.5858), (194.3545, 149.1006)),\n ('horizontal', '34.8837', (247.5558, 150.6154), (197.3545, 150.6154), (222.4552, 139.6154))\n]\n\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\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\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,\n angle=(0 if d[0] == \"horizontal\" else 90),\n 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,\n 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,\n text=text, dimstyle=\"EZDXF\").render()\n\n doc.saveas(out_path)\n\n\nif __name__ == \"__main__\":\n out = sys.argv[1] if len(sys.argv) > 1 else \"0051_00516971_gt.dxf\"\n draw(out)\n print(\"wrote\", out)\n```"}], "images": ["images/0051_00516971.png"], "id": "0051_00516971"} {"messages": [{"role": "user", "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 53.68 mm tall. It is extruded to a thickness of 7.46 mm."}, {"role": "assistant", "content": "```python\n#!/usr/bin/env python3\n# -*- coding: utf-8 -*-\n# Ground-truth 2D engineering drawing for part: 0052_00520561\n# Self-contained: reproduces the three-view DXF via ezdxf, NO FreeCAD needed.\n# Coordinates are A4 page millimetres (scale=0.9561164383562065, page=[297.0, 210.0]).\n# visible edges -> solid (layer OUTLINE); hidden edges -> dashed (layer HIDDEN)\n# dimensions -> real movable DIMENSION entities (text = true mm value)\n# Run: python 0052_00520561_gt.py [out.dxf]\nimport sys\nimport ezdxf\n\nSCALE = 0.9561164383562065\nPAGE = [297.0, 210.0]\n\nVISIBLE_SEGMENTS = [\n (180.738189, 101.903426, 180.738189, 153.231782),\n (180.738189, 153.231782, 85.126545, 153.231782),\n (85.126545, 153.231782, 85.126545, 101.903426),\n (85.126545, 101.903426, 180.738189, 101.903426),\n (180.738189, 87.903426, 180.738189, 80.768229),\n (85.126545, 87.903426, 85.126545, 80.768229),\n (85.126545, 80.768229, 180.738189, 80.768229),\n (85.126545, 87.903426, 180.738189, 87.903426),\n (201.873387, 153.231782, 194.738189, 153.231782),\n (194.738189, 153.231782, 194.738189, 101.903426),\n (201.873387, 101.903426, 194.738189, 101.903426),\n (201.873387, 153.231782, 201.873387, 101.903426)\n]\nVISIBLE_CIRCLES = [\n\n]\nVISIBLE_ARCS = [\n\n]\nHIDDEN_SEGMENTS = [\n\n]\n# (orient, text, p1, p2, base) for linear; (orient, text, center, radius, angle) for diameter\nDIMENSIONS = [\n ('horizontal', '100', (180.7382, 101.9034), (85.1265, 101.9034), (132.9324, 90.9034)),\n ('vertical', '53.6842', (180.7382, 153.2318), (180.7382, 101.9034), (191.7382, 127.5676)),\n ('horizontal', '7.4627', (201.8734, 153.2318), (194.7382, 153.2318), (198.3058, 142.2318))\n]\n\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\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\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,\n angle=(0 if d[0] == \"horizontal\" else 90),\n 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,\n 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,\n text=text, dimstyle=\"EZDXF\").render()\n\n doc.saveas(out_path)\n\n\nif __name__ == \"__main__\":\n out = sys.argv[1] if len(sys.argv) > 1 else \"0052_00520561_gt.dxf\"\n draw(out)\n print(\"wrote\", out)\n```"}], "images": ["images/0052_00520561.png"], "id": "0052_00520561"} {"messages": [{"role": "user", "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 1.04 mm."}, {"role": "assistant", "content": "```python\n#!/usr/bin/env python3\n# -*- coding: utf-8 -*-\n# Ground-truth 2D engineering drawing for part: 0052_00527687\n# Self-contained: reproduces the three-view DXF via ezdxf, NO FreeCAD needed.\n# Coordinates are A4 page millimetres (scale=1.0737923076923066, page=[297.0, 210.0]).\n# visible edges -> solid (layer OUTLINE); hidden edges -> dashed (layer HIDDEN)\n# dimensions -> real movable DIMENSION entities (text = true mm value)\n# Run: python 0052_00527687_gt.py [out.dxf]\nimport sys\nimport ezdxf\n\nSCALE = 1.0737923076923066\nPAGE = [297.0, 210.0]\n\nVISIBLE_SEGMENTS = [\n (189.630319, 104.778918, 189.630319, 144.339688),\n (189.630319, 144.339688, 82.251089, 144.339688),\n (82.251089, 144.339688, 82.251089, 104.778918),\n (82.251089, 104.778918, 189.630319, 104.778918),\n (189.630319, 90.778918, 189.630319, 89.660385),\n (82.251089, 90.778918, 82.251089, 89.660385),\n (82.251089, 89.660385, 189.630319, 89.660385),\n (82.251089, 90.778918, 189.630319, 90.778918),\n (204.748853, 144.339688, 203.630319, 144.339688),\n (203.630319, 144.339688, 203.630319, 104.778918),\n (204.748853, 104.778918, 203.630319, 104.778918),\n (204.748853, 144.339688, 204.748853, 104.778918)\n]\nVISIBLE_CIRCLES = [\n\n]\nVISIBLE_ARCS = [\n\n]\nHIDDEN_SEGMENTS = [\n\n]\n# (orient, text, p1, p2, base) for linear; (orient, text, center, radius, angle) for diameter\nDIMENSIONS = [\n ('horizontal', '100', (189.6303, 104.7789), (82.2511, 104.7789), (135.9407, 93.7789)),\n ('vertical', '36.8421', (189.6303, 144.3397), (189.6303, 104.7789), (200.6303, 124.5593)),\n ('horizontal', '1.0417', (204.7489, 144.3397), (203.6303, 144.3397), (204.1896, 133.3397))\n]\n\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\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\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,\n angle=(0 if d[0] == \"horizontal\" else 90),\n 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,\n 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,\n text=text, dimstyle=\"EZDXF\").render()\n\n doc.saveas(out_path)\n\n\nif __name__ == \"__main__\":\n out = sys.argv[1] if len(sys.argv) > 1 else \"0052_00527687_gt.dxf\"\n draw(out)\n print(\"wrote\", out)\n```"}], "images": ["images/0052_00527687.png"], "id": "0052_00527687"} {"messages": [{"role": "user", "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 45.26 mm tall. It is extruded to a thickness of 2.6 mm."}, {"role": "assistant", "content": "```python\n#!/usr/bin/env python3\n# -*- coding: utf-8 -*-\n# Ground-truth 2D engineering drawing for part: 0052_00527948\n# Self-contained: reproduces the three-view DXF via ezdxf, NO FreeCAD needed.\n# Coordinates are A4 page millimetres (scale=1.4321055837563406, page=[297.0, 210.0]).\n# visible edges -> solid (layer OUTLINE); hidden edges -> dashed (layer HIDDEN)\n# dimensions -> real movable DIMENSION entities (text = true mm value)\n# Run: python 0052_00527948_gt.py [out.dxf]\nimport sys\nimport ezdxf\n\nSCALE = 1.4321055837563406\nPAGE = [297.0, 210.0]\n\nVISIBLE_SEGMENTS = [\n (206.240583, 158.275573, 206.240583, 93.453952),\n (206.240583, 93.453952, 63.030025, 93.453952),\n (63.030025, 93.453952, 63.030025, 158.275573),\n (63.030025, 158.275573, 206.240583, 158.275573),\n (206.240583, 75.72451, 206.240583, 79.453952),\n (206.240583, 79.453952, 63.030025, 79.453952),\n (63.030025, 75.72451, 63.030025, 79.453952),\n (206.240583, 75.72451, 63.030025, 75.72451),\n (220.240583, 93.453952, 223.970025, 93.453952),\n (223.970025, 93.453952, 223.970025, 158.275573),\n (220.240583, 158.275573, 223.970025, 158.275573),\n (220.240583, 93.453952, 220.240583, 158.275573)\n]\nVISIBLE_CIRCLES = [\n\n]\nVISIBLE_ARCS = [\n\n]\nHIDDEN_SEGMENTS = [\n\n]\n# (orient, text, p1, p2, base) for linear; (orient, text, center, radius, angle) for diameter\nDIMENSIONS = [\n ('horizontal', '100', (206.2406, 158.2755), (63.03, 158.2755), (134.6353, 147.2755)),\n ('vertical', '45.2632', (206.2406, 93.454), (206.2406, 158.2755), (195.2406, 125.8647)),\n ('horizontal', '2.6042', (220.2406, 93.454), (223.97, 93.454), (222.1053, 104.454))\n]\n\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\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\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,\n angle=(0 if d[0] == \"horizontal\" else 90),\n 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,\n 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,\n text=text, dimstyle=\"EZDXF\").render()\n\n doc.saveas(out_path)\n\n\nif __name__ == \"__main__\":\n out = sys.argv[1] if len(sys.argv) > 1 else \"0052_00527948_gt.dxf\"\n draw(out)\n print(\"wrote\", out)\n```"}], "images": ["images/0052_00527948.png"], "id": "0052_00527948"} {"messages": [{"role": "user", "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": "assistant", "content": "```python\n#!/usr/bin/env python3\n# -*- coding: utf-8 -*-\n# Ground-truth 2D engineering drawing for part: 0052_00528612\n# Self-contained: reproduces the three-view DXF via ezdxf, NO FreeCAD needed.\n# Coordinates are A4 page millimetres (scale=0.4805, page=[297.0, 210.0]).\n# visible edges -> solid (layer OUTLINE); hidden edges -> dashed (layer HIDDEN)\n# dimensions -> real movable DIMENSION entities (text = true mm value)\n# Run: python 0052_00528612_gt.py [out.dxf]\nimport sys\nimport ezdxf\n\nSCALE = 0.4805\nPAGE = [297.0, 210.0]\n\nVISIBLE_SEGMENTS = [\n (136.5, 172.05, 136.5, 124.0),\n (136.5, 124.0, 88.45, 124.0),\n (88.45, 124.0, 88.45, 172.05),\n (88.45, 172.05, 136.5, 172.05),\n (136.5, 61.95, 136.5, 110.0),\n (136.5, 110.0, 88.45, 110.0),\n (88.45, 61.95, 88.45, 110.0),\n (136.5, 61.95, 88.45, 61.95),\n (150.5, 124.0, 198.55, 124.0),\n (198.55, 124.0, 198.55, 172.05),\n (150.5, 172.05, 198.55, 172.05),\n (150.5, 124.0, 150.5, 172.05)\n]\nVISIBLE_CIRCLES = [\n\n]\nVISIBLE_ARCS = [\n\n]\nHIDDEN_SEGMENTS = [\n\n]\n# (orient, text, p1, p2, base) for linear; (orient, text, center, radius, angle) for diameter\nDIMENSIONS = [\n ('horizontal', '100', (136.5, 172.05), (88.45, 172.05), (112.475, 161.05)),\n ('vertical', '100', (136.5, 124.0), (136.5, 172.05), (125.5, 148.025)),\n ('horizontal', '100', (150.5, 124.0), (198.55, 124.0), (174.525, 135.0))\n]\n\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\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\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,\n angle=(0 if d[0] == \"horizontal\" else 90),\n 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,\n 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,\n text=text, dimstyle=\"EZDXF\").render()\n\n doc.saveas(out_path)\n\n\nif __name__ == \"__main__\":\n out = sys.argv[1] if len(sys.argv) > 1 else \"0052_00528612_gt.dxf\"\n draw(out)\n print(\"wrote\", out)\n```"}], "images": ["images/0052_00528612.png"], "id": "0052_00528612"} {"messages": [{"role": "user", "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 67.37 mm wide and 100 mm tall. It is extruded to a thickness of 9.9 mm."}, {"role": "assistant", "content": "```python\n#!/usr/bin/env python3\n# -*- coding: utf-8 -*-\n# Ground-truth 2D engineering drawing for part: 0053_00530120\n# Self-contained: reproduces the three-view DXF via ezdxf, NO FreeCAD needed.\n# Coordinates are A4 page millimetres (scale=0.802226086956526, page=[297.0, 210.0]).\n# visible edges -> solid (layer OUTLINE); hidden edges -> dashed (layer HIDDEN)\n# dimensions -> real movable DIMENSION entities (text = true mm value)\n# Run: python 0053_00530120_gt.py [out.dxf]\nimport sys\nimport ezdxf\n\nSCALE = 0.802226086956526\nPAGE = [297.0, 210.0]\n\nVISIBLE_SEGMENTS = [\n (155.583663, 91.827395, 155.583663, 172.050003),\n (101.538958, 91.827395, 155.583663, 91.827395),\n (155.583663, 172.050003, 101.538958, 172.050003),\n (101.538958, 172.050003, 101.538958, 91.827395),\n (155.583663, 61.950003, 155.583663, 77.827395),\n (101.538958, 61.950003, 101.538958, 77.827395),\n (101.538958, 61.950003, 155.583663, 61.950003),\n (101.538958, 77.827395, 155.583663, 77.827395),\n (169.583663, 91.827395, 185.461054, 91.827395),\n (185.461054, 172.050003, 169.583663, 172.050003),\n (169.583663, 172.050003, 169.583663, 91.827395),\n (185.461054, 172.050003, 185.461054, 91.827395)\n]\nVISIBLE_CIRCLES = [\n\n]\nVISIBLE_ARCS = [\n\n]\nHIDDEN_SEGMENTS = [\n\n]\n# (orient, text, p1, p2, base) for linear; (orient, text, center, radius, angle) for diameter\nDIMENSIONS = [\n ('horizontal', '67.3684', (155.5837, 91.8274), (101.5389, 91.8274), (128.5613, 80.8274)),\n ('vertical', '100', (155.5837, 172.05), (155.5837, 91.8274), (166.5837, 131.9387)),\n ('horizontal', '19.7917', (185.461, 172.05), (169.5837, 172.05), (177.5224, 161.05))\n]\n\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\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\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,\n angle=(0 if d[0] == \"horizontal\" else 90),\n 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,\n 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,\n text=text, dimstyle=\"EZDXF\").render()\n\n doc.saveas(out_path)\n\n\nif __name__ == \"__main__\":\n out = sys.argv[1] if len(sys.argv) > 1 else \"0053_00530120_gt.dxf\"\n draw(out)\n print(\"wrote\", out)\n```"}], "images": ["images/0053_00530120.png"], "id": "0053_00530120"} {"messages": [{"role": "user", "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 77.89 mm tall. It is extruded to a thickness of 18.75 mm."}, {"role": "assistant", "content": "```python\n#!/usr/bin/env python3\n# -*- coding: utf-8 -*-\n# Ground-truth 2D engineering drawing for part: 0053_00536591\n# Self-contained: reproduces the three-view DXF via ezdxf, NO FreeCAD needed.\n# Coordinates are A4 page millimetres (scale=0.8259940828402379, page=[297.0, 210.0]).\n# visible edges -> solid (layer OUTLINE); hidden edges -> dashed (layer HIDDEN)\n# dimensions -> real movable DIMENSION entities (text = true mm value)\n# Run: python 0053_00536591_gt.py [out.dxf]\nimport sys\nimport ezdxf\n\nSCALE = 0.8259940828402379\nPAGE = [297.0, 210.0]\n\nVISIBLE_SEGMENTS = [\n (170.056004, 99.573405, 170.056004, 163.913997),\n (170.056004, 163.913997, 87.456596, 163.913997),\n (87.456596, 163.913997, 87.456596, 99.573405),\n (87.456596, 99.573405, 170.056004, 99.573405),\n (170.056004, 85.573405, 170.056004, 70.086016),\n (87.456596, 85.573405, 87.456596, 70.086016),\n (87.456596, 70.086016, 170.056004, 70.086016),\n (87.456596, 85.573405, 170.056004, 85.573405),\n (199.543393, 163.913997, 184.056004, 163.913997),\n (184.056004, 163.913997, 184.056004, 99.573405),\n (199.543393, 99.573405, 184.056004, 99.573405),\n (199.543393, 163.913997, 199.543393, 99.573405)\n]\nVISIBLE_CIRCLES = [\n\n]\nVISIBLE_ARCS = [\n\n]\nHIDDEN_SEGMENTS = [\n\n]\n# (orient, text, p1, p2, base) for linear; (orient, text, center, radius, angle) for diameter\nDIMENSIONS = [\n ('horizontal', '100', (170.056, 99.5734), (87.4566, 99.5734), (128.7563, 88.5734)),\n ('vertical', '77.8947', (170.056, 163.914), (170.056, 99.5734), (181.056, 131.7437)),\n ('horizontal', '18.75', (199.5434, 163.914), (184.056, 163.914), (191.7997, 152.914))\n]\n\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\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\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,\n angle=(0 if d[0] == \"horizontal\" else 90),\n 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,\n 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,\n text=text, dimstyle=\"EZDXF\").render()\n\n doc.saveas(out_path)\n\n\nif __name__ == \"__main__\":\n out = sys.argv[1] if len(sys.argv) > 1 else \"0053_00536591_gt.dxf\"\n draw(out)\n print(\"wrote\", out)\n```"}], "images": ["images/0053_00536591.png"], "id": "0053_00536591"} {"messages": [{"role": "user", "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 -25 mm."}, {"role": "assistant", "content": "```python\n#!/usr/bin/env python3\n# -*- coding: utf-8 -*-\n# Ground-truth 2D engineering drawing for part: 0053_00538797\n# Self-contained: reproduces the three-view DXF via ezdxf, NO FreeCAD needed.\n# Coordinates are A4 page millimetres (scale=0.8409216867469886, page=[297.0, 210.0]).\n# visible edges -> solid (layer OUTLINE); hidden edges -> dashed (layer HIDDEN)\n# dimensions -> real movable DIMENSION entities (text = true mm value)\n# Run: python 0053_00538797_gt.py [out.dxf]\nimport sys\nimport ezdxf\n\nSCALE = 0.8409216867469886\nPAGE = [297.0, 210.0]\n\nVISIBLE_SEGMENTS = [\n (168.034585, 103.087581, 168.034585, 165.935413),\n (168.034585, 165.935413, 83.942417, 165.935413),\n (83.942417, 165.935413, 83.942417, 103.087581),\n (83.942417, 103.087581, 168.034585, 103.087581),\n (168.034585, 68.064539, 168.034585, 89.087581),\n (83.942417, 68.064539, 83.942417, 89.087581),\n (83.942417, 89.087581, 168.034585, 89.087581),\n (83.942417, 68.064539, 168.034585, 68.064539),\n (182.034585, 165.935413, 203.057627, 165.935413),\n (203.057627, 165.935413, 203.057627, 103.087581),\n (182.034585, 103.087581, 203.057627, 103.087581),\n (182.034585, 165.935413, 182.034585, 103.087581)\n]\nVISIBLE_CIRCLES = [\n\n]\nVISIBLE_ARCS = [\n\n]\nHIDDEN_SEGMENTS = [\n\n]\n# (orient, text, p1, p2, base) for linear; (orient, text, center, radius, angle) for diameter\nDIMENSIONS = [\n ('horizontal', '100', (168.0346, 103.0876), (83.9424, 103.0876), (125.9885, 92.0876)),\n ('vertical', '74.7368', (168.0346, 165.9354), (168.0346, 103.0876), (179.0346, 134.5115)),\n ('horizontal', '25', (182.0346, 165.9354), (203.0576, 165.9354), (192.5461, 176.9354))\n]\n\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\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\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,\n angle=(0 if d[0] == \"horizontal\" else 90),\n 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,\n 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,\n text=text, dimstyle=\"EZDXF\").render()\n\n doc.saveas(out_path)\n\n\nif __name__ == \"__main__\":\n out = sys.argv[1] if len(sys.argv) > 1 else \"0053_00538797_gt.dxf\"\n draw(out)\n print(\"wrote\", out)\n```"}], "images": ["images/0053_00538797.png"], "id": "0053_00538797"} {"messages": [{"role": "user", "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 1600 mm."}, {"role": "assistant", "content": "```python\n#!/usr/bin/env python3\n# -*- coding: utf-8 -*-\n# Ground-truth 2D engineering drawing for part: 0053_00539510\n# Self-contained: reproduces the three-view DXF via ezdxf, NO FreeCAD needed.\n# Coordinates are A4 page millimetres (scale=0.05652941176470611, page=[297.0, 210.0]).\n# visible edges -> solid (layer OUTLINE); hidden edges -> dashed (layer HIDDEN)\n# dimensions -> real movable DIMENSION entities (text = true mm value)\n# Run: python 0053_00539510_gt.py [out.dxf]\nimport sys\nimport ezdxf\n\nSCALE = 0.05652941176470611\nPAGE = [297.0, 210.0]\n\nVISIBLE_SEGMENTS = [\n (92.704593, 166.397075, 92.704593, 172.050016),\n (92.704593, 172.050016, 89.84837, 172.050016),\n (89.84837, 172.050016, 89.84837, 166.397075),\n (89.84837, 166.397075, 92.704593, 166.397075),\n (92.704593, 152.397075, 92.704593, 61.950016),\n (89.84837, 152.397075, 89.84837, 61.950016),\n (89.84837, 61.950016, 92.704593, 61.950016),\n (89.84837, 152.397075, 92.704593, 152.397075),\n (197.151652, 172.050016, 106.704593, 172.050016),\n (106.704593, 172.050016, 106.704593, 166.397075),\n (197.151652, 166.397075, 106.704593, 166.397075),\n (197.151652, 172.050016, 197.151652, 166.397075)\n]\nVISIBLE_CIRCLES = [\n\n]\nVISIBLE_ARCS = [\n\n]\nHIDDEN_SEGMENTS = [\n\n]\n# (orient, text, p1, p2, base) for linear; (orient, text, center, radius, angle) for diameter\nDIMENSIONS = [\n ('horizontal', '50.5263', (92.7046, 166.3971), (89.8484, 166.3971), (91.2765, 155.3971)),\n ('vertical', '100', (92.7046, 172.05), (92.7046, 166.3971), (103.7046, 169.2235)),\n ('horizontal', '1600', (197.1516, 172.05), (106.7046, 172.05), (151.9281, 161.05))\n]\n\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\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\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,\n angle=(0 if d[0] == \"horizontal\" else 90),\n 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,\n 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,\n text=text, dimstyle=\"EZDXF\").render()\n\n doc.saveas(out_path)\n\n\nif __name__ == \"__main__\":\n out = sys.argv[1] if len(sys.argv) > 1 else \"0053_00539510_gt.dxf\"\n draw(out)\n print(\"wrote\", out)\n```"}], "images": ["images/0053_00539510.png"], "id": "0053_00539510"} {"messages": [{"role": "user", "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 69.47 mm tall. It is extruded to a thickness of 2.08 mm."}, {"role": "assistant", "content": "```python\n#!/usr/bin/env python3\n# -*- coding: utf-8 -*-\n# Ground-truth 2D engineering drawing for part: 0053_00539829\n# Self-contained: reproduces the three-view DXF via ezdxf, NO FreeCAD needed.\n# Coordinates are A4 page millimetres (scale=1.3429849831443579, page=[297.0, 210.0]).\n# visible edges -> solid (layer OUTLINE); hidden edges -> dashed (layer HIDDEN)\n# dimensions -> real movable DIMENSION entities (text = true mm value)\n# Run: python 0053_00539829_gt.py [out.dxf]\nimport sys\nimport ezdxf\n\nSCALE = 1.3429849831443579\nPAGE = [297.0, 210.0]\n\nVISIBLE_SEGMENTS = [\n (202.250283, 172.050009, 202.250283, 78.747894),\n (202.250283, 78.747894, 67.951784, 78.747894),\n (67.951784, 78.747894, 67.951784, 172.050009),\n (67.951784, 172.050009, 202.250283, 172.050009),\n (202.250283, 61.950009, 202.250283, 64.747894),\n (202.250283, 64.747894, 67.951784, 64.747894),\n (67.951784, 61.950009, 67.951784, 64.747894),\n (202.250283, 61.950009, 67.951784, 61.950009),\n (216.250283, 78.747894, 219.048168, 78.747894),\n (219.048168, 78.747894, 219.048168, 172.050009),\n (216.250283, 172.050009, 219.048168, 172.050009),\n (216.250283, 78.747894, 216.250283, 172.050009)\n]\nVISIBLE_CIRCLES = [\n\n]\nVISIBLE_ARCS = [\n\n]\nHIDDEN_SEGMENTS = [\n\n]\n# (orient, text, p1, p2, base) for linear; (orient, text, center, radius, angle) for diameter\nDIMENSIONS = [\n ('horizontal', '100', (202.2503, 172.05), (67.9518, 172.05), (135.1011, 161.05)),\n ('vertical', '69.4737', (202.2503, 78.7479), (202.2503, 172.05), (191.2503, 125.399)),\n ('horizontal', '2.0833', (216.2503, 78.7479), (219.0481, 78.7479), (217.6492, 89.7479))\n]\n\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\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\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,\n angle=(0 if d[0] == \"horizontal\" else 90),\n 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,\n 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,\n text=text, dimstyle=\"EZDXF\").render()\n\n doc.saveas(out_path)\n\n\nif __name__ == \"__main__\":\n out = sys.argv[1] if len(sys.argv) > 1 else \"0053_00539829_gt.dxf\"\n draw(out)\n print(\"wrote\", out)\n```"}], "images": ["images/0053_00539829.png"], "id": "0053_00539829"} {"messages": [{"role": "user", "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": "assistant", "content": "```python\n#!/usr/bin/env python3\n# -*- coding: utf-8 -*-\n# Ground-truth 2D engineering drawing for part: 0054_00540269\n# Self-contained: reproduces the three-view DXF via ezdxf, NO FreeCAD needed.\n# Coordinates are A4 page millimetres (scale=0.6414168618267483, page=[297.0, 210.0]).\n# visible edges -> solid (layer OUTLINE); hidden edges -> dashed (layer HIDDEN)\n# dimensions -> real movable DIMENSION entities (text = true mm value)\n# Run: python 0054_00540269_gt.py [out.dxf]\nimport sys\nimport ezdxf\n\nSCALE = 0.6414168618267483\nPAGE = [297.0, 210.0]\n\nVISIBLE_SEGMENTS = [\n (147.190292, 118.711114, 147.190292, 172.04999),\n (147.190292, 172.04999, 83.048606, 172.04999),\n (83.048606, 172.04999, 83.048606, 118.711114),\n (83.048606, 118.711114, 147.190292, 118.711114),\n (147.190292, 104.711114, 147.190292, 61.94999),\n (83.048606, 104.711114, 83.048606, 61.94999),\n (83.048606, 61.94999, 147.190292, 61.94999),\n (83.048606, 104.711114, 147.190292, 104.711114),\n (203.951417, 172.04999, 161.190292, 172.04999),\n (161.190292, 172.04999, 161.190292, 118.711114),\n (203.951417, 118.711114, 161.190292, 118.711114),\n (203.951417, 172.04999, 203.951417, 118.711114)\n]\nVISIBLE_CIRCLES = [\n\n]\nVISIBLE_ARCS = [\n\n]\nHIDDEN_SEGMENTS = [\n\n]\n# (orient, text, p1, p2, base) for linear; (orient, text, center, radius, angle) for diameter\nDIMENSIONS = [\n ('horizontal', '100', (147.1903, 118.7111), (83.0486, 118.7111), (115.1194, 107.7111)),\n ('vertical', '83.1579', (147.1903, 172.05), (147.1903, 118.7111), (158.1903, 145.3806)),\n ('horizontal', '66.6667', (203.9514, 172.05), (161.1903, 172.05), (182.5708, 161.05))\n]\n\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\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\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,\n angle=(0 if d[0] == \"horizontal\" else 90),\n 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,\n 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,\n text=text, dimstyle=\"EZDXF\").render()\n\n doc.saveas(out_path)\n\n\nif __name__ == \"__main__\":\n out = sys.argv[1] if len(sys.argv) > 1 else \"0054_00540269_gt.dxf\"\n draw(out)\n print(\"wrote\", out)\n```"}], "images": ["images/0054_00540269.png"], "id": "0054_00540269"} {"messages": [{"role": "user", "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": "assistant", "content": "```python\n#!/usr/bin/env python3\n# -*- coding: utf-8 -*-\n# Ground-truth 2D engineering drawing for part: 0054_00541172\n# Self-contained: reproduces the three-view DXF via ezdxf, NO FreeCAD needed.\n# Coordinates are A4 page millimetres (scale=0.4805, page=[297.0, 210.0]).\n# visible edges -> solid (layer OUTLINE); hidden edges -> dashed (layer HIDDEN)\n# dimensions -> real movable DIMENSION entities (text = true mm value)\n# Run: python 0054_00541172_gt.py [out.dxf]\nimport sys\nimport ezdxf\n\nSCALE = 0.4805\nPAGE = [297.0, 210.0]\n\nVISIBLE_SEGMENTS = [\n (136.5, 172.05, 136.5, 124.0),\n (136.5, 124.0, 88.45, 124.0),\n (88.45, 124.0, 88.45, 172.05),\n (88.45, 172.05, 136.5, 172.05),\n (136.5, 61.95, 136.5, 110.0),\n (136.5, 110.0, 88.45, 110.0),\n (88.45, 61.95, 88.45, 110.0),\n (136.5, 61.95, 88.45, 61.95),\n (150.5, 124.0, 198.55, 124.0),\n (198.55, 124.0, 198.55, 172.05),\n (150.5, 172.05, 198.55, 172.05),\n (150.5, 124.0, 150.5, 172.05)\n]\nVISIBLE_CIRCLES = [\n\n]\nVISIBLE_ARCS = [\n\n]\nHIDDEN_SEGMENTS = [\n\n]\n# (orient, text, p1, p2, base) for linear; (orient, text, center, radius, angle) for diameter\nDIMENSIONS = [\n ('horizontal', '100', (136.5, 172.05), (88.45, 172.05), (112.475, 161.05)),\n ('vertical', '100', (136.5, 124.0), (136.5, 172.05), (125.5, 148.025)),\n ('horizontal', '100', (150.5, 124.0), (198.55, 124.0), (174.525, 135.0))\n]\n\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\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\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,\n angle=(0 if d[0] == \"horizontal\" else 90),\n 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,\n 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,\n text=text, dimstyle=\"EZDXF\").render()\n\n doc.saveas(out_path)\n\n\nif __name__ == \"__main__\":\n out = sys.argv[1] if len(sys.argv) > 1 else \"0054_00541172_gt.dxf\"\n draw(out)\n print(\"wrote\", out)\n```"}], "images": ["images/0054_00541172.png"], "id": "0054_00541172"} {"messages": [{"role": "user", "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 48.42 mm tall. It is extruded to a thickness of 38.54 mm."}, {"role": "assistant", "content": "```python\n#!/usr/bin/env python3\n# -*- coding: utf-8 -*-\n# Ground-truth 2D engineering drawing for part: 0054_00544291\n# Self-contained: reproduces the three-view DXF via ezdxf, NO FreeCAD needed.\n# Coordinates are A4 page millimetres (scale=0.9900212765957442, page=[297.0, 210.0]).\n# visible edges -> solid (layer OUTLINE); hidden edges -> dashed (layer HIDDEN)\n# dimensions -> real movable DIMENSION entities (text = true mm value)\n# Run: python 0054_00544291_gt.py [out.dxf]\nimport sys\nimport ezdxf\n\nSCALE = 0.9900212765957442\nPAGE = [297.0, 210.0]\n\nVISIBLE_SEGMENTS = [\n (166.922512, 119.109617, 166.922512, 167.047489),\n (166.922512, 167.047489, 67.920384, 167.047489),\n (67.920384, 167.047489, 67.920384, 119.109617),\n (67.920384, 119.109617, 166.922512, 119.109617),\n (166.922512, 105.109617, 166.922512, 66.952547),\n (67.920384, 105.109617, 67.920384, 66.952547),\n (67.920384, 66.952547, 166.922512, 66.952547),\n (67.920384, 105.109617, 166.922512, 105.109617),\n (219.079582, 167.047489, 180.922512, 167.047489),\n (180.922512, 167.047489, 180.922512, 119.109617),\n (219.079582, 119.109617, 180.922512, 119.109617),\n (219.079582, 167.047489, 219.079582, 119.109617)\n]\nVISIBLE_CIRCLES = [\n\n]\nVISIBLE_ARCS = [\n\n]\nHIDDEN_SEGMENTS = [\n\n]\n# (orient, text, p1, p2, base) for linear; (orient, text, center, radius, angle) for diameter\nDIMENSIONS = [\n ('horizontal', '100', (166.9225, 119.1096), (67.9204, 119.1096), (117.4215, 108.1096)),\n ('vertical', '48.4211', (166.9225, 167.0475), (166.9225, 119.1096), (177.9225, 143.0785)),\n ('horizontal', '38.5417', (219.0796, 167.0475), (180.9225, 167.0475), (200.001, 156.0475))\n]\n\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\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\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,\n angle=(0 if d[0] == \"horizontal\" else 90),\n 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,\n 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,\n text=text, dimstyle=\"EZDXF\").render()\n\n doc.saveas(out_path)\n\n\nif __name__ == \"__main__\":\n out = sys.argv[1] if len(sys.argv) > 1 else \"0054_00544291_gt.dxf\"\n draw(out)\n print(\"wrote\", out)\n```"}], "images": ["images/0054_00544291.png"], "id": "0054_00544291"} {"messages": [{"role": "user", "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 2.08 mm."}, {"role": "assistant", "content": "```python\n#!/usr/bin/env python3\n# -*- coding: utf-8 -*-\n# Ground-truth 2D engineering drawing for part: 0054_00549559\n# Self-contained: reproduces the three-view DXF via ezdxf, NO FreeCAD needed.\n# Coordinates are A4 page millimetres (scale=0.9413877551020439, page=[297.0, 210.0]).\n# visible edges -> solid (layer OUTLINE); hidden edges -> dashed (layer HIDDEN)\n# dimensions -> real movable DIMENSION entities (text = true mm value)\n# Run: python 0054_00549559_gt.py [out.dxf]\nimport sys\nimport ezdxf\n\nSCALE = 0.9413877551020439\nPAGE = [297.0, 210.0]\n\nVISIBLE_SEGMENTS = [\n (169.211144, 172.049985, 169.211144, 77.91121),\n (169.211144, 77.91121, 101.827599, 77.91121),\n (101.827599, 77.91121, 101.827599, 172.049985),\n (101.827599, 172.049985, 169.211144, 172.049985),\n (169.211144, 61.949985, 169.211144, 63.91121),\n (169.211144, 63.91121, 101.827599, 63.91121),\n (101.827599, 61.949985, 101.827599, 63.91121),\n (169.211144, 61.949985, 101.827599, 61.949985),\n (183.211144, 77.91121, 185.172369, 77.91121),\n (185.172369, 77.91121, 185.172369, 172.049985),\n (183.211144, 172.049985, 185.172369, 172.049985),\n (183.211144, 77.91121, 183.211144, 172.049985)\n]\nVISIBLE_CIRCLES = [\n\n]\nVISIBLE_ARCS = [\n\n]\nHIDDEN_SEGMENTS = [\n\n]\n# (orient, text, p1, p2, base) for linear; (orient, text, center, radius, angle) for diameter\nDIMENSIONS = [\n ('horizontal', '71.5789', (169.2111, 172.05), (101.8276, 172.05), (135.5194, 161.05)),\n ('vertical', '100', (169.2111, 77.9112), (169.2111, 172.05), (158.2111, 124.9806)),\n ('horizontal', '2.0833', (183.2112, 77.9112), (185.1724, 77.9112), (184.1918, 88.9112))\n]\n\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\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\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,\n angle=(0 if d[0] == \"horizontal\" else 90),\n 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,\n 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,\n text=text, dimstyle=\"EZDXF\").render()\n\n doc.saveas(out_path)\n\n\nif __name__ == \"__main__\":\n out = sys.argv[1] if len(sys.argv) > 1 else \"0054_00549559_gt.dxf\"\n draw(out)\n print(\"wrote\", out)\n```"}], "images": ["images/0054_00549559.png"], "id": "0054_00549559"} {"messages": [{"role": "user", "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 63.16 mm wide and 100 mm tall. It is extruded to a thickness of 75 mm."}, {"role": "assistant", "content": "```python\n#!/usr/bin/env python3\n# -*- coding: utf-8 -*-\n# Ground-truth 2D engineering drawing for part: 0055_00556102\n# Self-contained: reproduces the three-view DXF via ezdxf, NO FreeCAD needed.\n# Coordinates are A4 page millimetres (scale=0.5491428571428572, page=[297.0, 210.0]).\n# visible edges -> solid (layer OUTLINE); hidden edges -> dashed (layer HIDDEN)\n# dimensions -> real movable DIMENSION entities (text = true mm value)\n# Run: python 0055_00556102_gt.py [out.dxf]\nimport sys\nimport ezdxf\n\nSCALE = 0.5491428571428572\nPAGE = [297.0, 210.0]\n\nVISIBLE_SEGMENTS = [\n (133.248498, 172.049991, 133.248498, 117.135706),\n (133.248498, 117.135706, 98.565792, 117.135706),\n (98.565792, 117.135706, 98.565792, 172.049991),\n (98.565792, 172.049991, 133.248498, 172.049991),\n (133.248498, 61.949991, 133.248498, 103.135706),\n (133.248498, 103.135706, 98.565792, 103.135706),\n (98.565792, 61.949991, 98.565792, 103.135706),\n (133.248498, 61.949991, 98.565792, 61.949991),\n (147.248498, 117.135706, 188.434213, 117.135706),\n (188.434213, 117.135706, 188.434213, 172.049991),\n (147.248498, 172.049991, 188.434213, 172.049991),\n (147.248498, 117.135706, 147.248498, 172.049991)\n]\nVISIBLE_CIRCLES = [\n\n]\nVISIBLE_ARCS = [\n\n]\nHIDDEN_SEGMENTS = [\n\n]\n# (orient, text, p1, p2, base) for linear; (orient, text, center, radius, angle) for diameter\nDIMENSIONS = [\n ('horizontal', '63.1579', (133.2485, 172.05), (98.5658, 172.05), (115.9071, 161.05)),\n ('vertical', '100', (133.2485, 117.1357), (133.2485, 172.05), (122.2485, 144.5929)),\n ('horizontal', '75', (147.2485, 117.1357), (188.4342, 117.1357), (167.8414, 128.1357))\n]\n\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\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\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,\n angle=(0 if d[0] == \"horizontal\" else 90),\n 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,\n 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,\n text=text, dimstyle=\"EZDXF\").render()\n\n doc.saveas(out_path)\n\n\nif __name__ == \"__main__\":\n out = sys.argv[1] if len(sys.argv) > 1 else \"0055_00556102_gt.dxf\"\n draw(out)\n print(\"wrote\", out)\n```"}], "images": ["images/0055_00556102.png"], "id": "0055_00556102"} {"messages": [{"role": "user", "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": "assistant", "content": "```python\n#!/usr/bin/env python3\n# -*- coding: utf-8 -*-\n# Ground-truth 2D engineering drawing for part: 0055_00557756\n# Self-contained: reproduces the three-view DXF via ezdxf, NO FreeCAD needed.\n# Coordinates are A4 page millimetres (scale=0.4805000000000071, page=[297.0, 210.0]).\n# visible edges -> solid (layer OUTLINE); hidden edges -> dashed (layer HIDDEN)\n# dimensions -> real movable DIMENSION entities (text = true mm value)\n# Run: python 0055_00557756_gt.py [out.dxf]\nimport sys\nimport ezdxf\n\nSCALE = 0.4805000000000071\nPAGE = [297.0, 210.0]\n\nVISIBLE_SEGMENTS = [\n (136.5, 172.05, 136.5, 124.0),\n (136.5, 124.0, 88.45, 124.0),\n (88.45, 124.0, 88.45, 172.05),\n (88.45, 172.05, 136.5, 172.05),\n (136.5, 61.95, 136.5, 110.0),\n (88.45, 61.95, 88.45, 110.0),\n (88.45, 110.0, 136.5, 110.0),\n (88.45, 61.95, 136.5, 61.95),\n (198.55, 124.0, 150.5, 124.0),\n (150.5, 124.0, 150.5, 172.05),\n (198.55, 172.05, 150.5, 172.05),\n (198.55, 124.0, 198.55, 172.05)\n]\nVISIBLE_CIRCLES = [\n\n]\nVISIBLE_ARCS = [\n\n]\nHIDDEN_SEGMENTS = [\n\n]\n# (orient, text, p1, p2, base) for linear; (orient, text, center, radius, angle) for diameter\nDIMENSIONS = [\n ('horizontal', '100', (136.5, 124.0), (88.45, 124.0), (112.475, 113.0)),\n ('vertical', '100', (136.5, 172.05), (136.5, 124.0), (147.5, 148.025)),\n ('horizontal', '100', (198.55, 172.05), (150.5, 172.05), (174.525, 161.05))\n]\n\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\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\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,\n angle=(0 if d[0] == \"horizontal\" else 90),\n 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,\n 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,\n text=text, dimstyle=\"EZDXF\").render()\n\n doc.saveas(out_path)\n\n\nif __name__ == \"__main__\":\n out = sys.argv[1] if len(sys.argv) > 1 else \"0055_00557756_gt.dxf\"\n draw(out)\n print(\"wrote\", out)\n```"}], "images": ["images/0055_00557756.png"], "id": "0055_00557756"} {"messages": [{"role": "user", "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 93.68 mm wide and 100 mm tall. It is extruded to a thickness of 11.11 mm."}, {"role": "assistant", "content": "```python\n#!/usr/bin/env python3\n# -*- coding: utf-8 -*-\n# Ground-truth 2D engineering drawing for part: 0055_00558372\n# Self-contained: reproduces the three-view DXF via ezdxf, NO FreeCAD needed.\n# Coordinates are A4 page millimetres (scale=0.8649000000000632, page=[297.0, 210.0]).\n# visible edges -> solid (layer OUTLINE); hidden edges -> dashed (layer HIDDEN)\n# dimensions -> real movable DIMENSION entities (text = true mm value)\n# Run: python 0055_00558372_gt.py [out.dxf]\nimport sys\nimport ezdxf\n\nSCALE = 0.8649000000000632\nPAGE = [297.0, 210.0]\n\nVISIBLE_SEGMENTS = [\n (172.208715, 172.05, 172.208715, 85.56),\n (172.208715, 85.56, 91.181241, 85.56),\n (91.181241, 85.56, 91.181241, 172.05),\n (91.181241, 172.05, 172.208715, 172.05),\n (172.208715, 61.95, 172.208715, 71.56),\n (172.208715, 71.56, 91.181241, 71.56),\n (91.181241, 61.95, 91.181241, 71.56),\n (172.208715, 61.95, 91.181241, 61.95),\n (186.208715, 85.56, 195.818715, 85.56),\n (195.818715, 85.56, 195.818715, 172.05),\n (186.208715, 172.05, 195.818715, 172.05),\n (186.208715, 85.56, 186.208715, 172.05)\n]\nVISIBLE_CIRCLES = [\n\n]\nVISIBLE_ARCS = [\n\n]\nHIDDEN_SEGMENTS = [\n\n]\n# (orient, text, p1, p2, base) for linear; (orient, text, center, radius, angle) for diameter\nDIMENSIONS = [\n ('horizontal', '93.6842', (172.2087, 172.05), (91.1813, 172.05), (131.695, 161.05)),\n ('vertical', '100', (172.2087, 85.56), (172.2087, 172.05), (161.2087, 128.805)),\n ('horizontal', '11.1111', (186.2087, 85.56), (195.8187, 85.56), (191.0137, 96.56))\n]\n\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\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\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,\n angle=(0 if d[0] == \"horizontal\" else 90),\n 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,\n 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,\n text=text, dimstyle=\"EZDXF\").render()\n\n doc.saveas(out_path)\n\n\nif __name__ == \"__main__\":\n out = sys.argv[1] if len(sys.argv) > 1 else \"0055_00558372_gt.dxf\"\n draw(out)\n print(\"wrote\", out)\n```"}], "images": ["images/0055_00558372.png"], "id": "0055_00558372"} {"messages": [{"role": "user", "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 12.5 mm."}, {"role": "assistant", "content": "```python\n#!/usr/bin/env python3\n# -*- coding: utf-8 -*-\n# Ground-truth 2D engineering drawing for part: 0055_00558530\n# Self-contained: reproduces the three-view DXF via ezdxf, NO FreeCAD needed.\n# Coordinates are A4 page millimetres (scale=0.8542222222222222, page=[297.0, 210.0]).\n# visible edges -> solid (layer OUTLINE); hidden edges -> dashed (layer HIDDEN)\n# dimensions -> real movable DIMENSION entities (text = true mm value)\n# Run: python 0055_00558530_gt.py [out.dxf]\nimport sys\nimport ezdxf\n\nSCALE = 0.8542222222222222\nPAGE = [297.0, 210.0]\n\nVISIBLE_SEGMENTS = [\n (173.872209, 172.050013, 173.872209, 86.627791),\n (173.872209, 86.627791, 88.449987, 86.627791),\n (88.449987, 86.627791, 88.449987, 172.050013),\n (88.449987, 172.050013, 173.872209, 172.050013),\n (173.872209, 61.950013, 173.872209, 72.627791),\n (173.872209, 72.627791, 88.449987, 72.627791),\n (88.449987, 61.950013, 88.449987, 72.627791),\n (173.872209, 61.950013, 88.449987, 61.950013),\n (187.872209, 86.627791, 198.549987, 86.627791),\n (198.549987, 86.627791, 198.549987, 172.050013),\n (187.872209, 172.050013, 198.549987, 172.050013),\n (187.872209, 86.627791, 187.872209, 172.050013)\n]\nVISIBLE_CIRCLES = [\n\n]\nVISIBLE_ARCS = [\n\n]\nHIDDEN_SEGMENTS = [\n\n]\n# (orient, text, p1, p2, base) for linear; (orient, text, center, radius, angle) for diameter\nDIMENSIONS = [\n ('horizontal', '100', (173.8722, 172.05), (88.45, 172.05), (131.1611, 161.05)),\n ('vertical', '100', (173.8722, 86.6278), (173.8722, 172.05), (162.8722, 129.3389)),\n ('horizontal', '12.5', (187.8722, 86.6278), (198.55, 86.6278), (193.2111, 97.6278))\n]\n\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\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\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,\n angle=(0 if d[0] == \"horizontal\" else 90),\n 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,\n 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,\n text=text, dimstyle=\"EZDXF\").render()\n\n doc.saveas(out_path)\n\n\nif __name__ == \"__main__\":\n out = sys.argv[1] if len(sys.argv) > 1 else \"0055_00558530_gt.dxf\"\n draw(out)\n print(\"wrote\", out)\n```"}], "images": ["images/0055_00558530.png"], "id": "0055_00558530"} {"messages": [{"role": "user", "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 1.56 mm."}, {"role": "assistant", "content": "```python\n#!/usr/bin/env python3\n# -*- coding: utf-8 -*-\n# Ground-truth 2D engineering drawing for part: 0055_00559696\n# Self-contained: reproduces the three-view DXF via ezdxf, NO FreeCAD needed.\n# Coordinates are A4 page millimetres (scale=0.9462153846153847, page=[297.0, 210.0]).\n# visible edges -> solid (layer OUTLINE); hidden edges -> dashed (layer HIDDEN)\n# dimensions -> real movable DIMENSION entities (text = true mm value)\n# Run: python 0055_00559696_gt.py [out.dxf]\nimport sys\nimport ezdxf\n\nSCALE = 0.9462153846153847\nPAGE = [297.0, 210.0]\n\nVISIBLE_SEGMENTS = [\n (159.665143, 172.050023, 159.665143, 77.428485),\n (159.665143, 77.428485, 111.856366, 77.428485),\n (111.856366, 77.428485, 111.856366, 172.050023),\n (111.856366, 172.050023, 159.665143, 172.050023),\n (159.665143, 61.950023, 159.665143, 63.428485),\n (159.665143, 63.428485, 111.856366, 63.428485),\n (111.856366, 61.950023, 111.856366, 63.428485),\n (159.665143, 61.950023, 111.856366, 61.950023),\n (173.665143, 77.428485, 175.143605, 77.428485),\n (175.143605, 77.428485, 175.143605, 172.050023),\n (173.665143, 172.050023, 175.143605, 172.050023),\n (173.665143, 77.428485, 173.665143, 172.050023)\n]\nVISIBLE_CIRCLES = [\n\n]\nVISIBLE_ARCS = [\n\n]\nHIDDEN_SEGMENTS = [\n\n]\n# (orient, text, p1, p2, base) for linear; (orient, text, center, radius, angle) for diameter\nDIMENSIONS = [\n ('horizontal', '50.5263', (159.6651, 172.05), (111.8564, 172.05), (135.7608, 161.05)),\n ('vertical', '100', (159.6651, 77.4285), (159.6651, 172.05), (148.6651, 124.7392)),\n ('horizontal', '1.5625', (173.6652, 77.4285), (175.1436, 77.4285), (174.4044, 88.4285))\n]\n\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\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\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,\n angle=(0 if d[0] == \"horizontal\" else 90),\n 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,\n 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,\n text=text, dimstyle=\"EZDXF\").render()\n\n doc.saveas(out_path)\n\n\nif __name__ == \"__main__\":\n out = sys.argv[1] if len(sys.argv) > 1 else \"0055_00559696_gt.dxf\"\n draw(out)\n print(\"wrote\", out)\n```"}], "images": ["images/0055_00559696.png"], "id": "0055_00559696"} {"messages": [{"role": "user", "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 68.42 mm wide and 100 mm tall. It is extruded to a thickness of 53.75 mm."}, {"role": "assistant", "content": "```python\n#!/usr/bin/env python3\n# -*- coding: utf-8 -*-\n# Ground-truth 2D engineering drawing for part: 0056_00560443\n# Self-contained: reproduces the three-view DXF via ezdxf, NO FreeCAD needed.\n# Coordinates are A4 page millimetres (scale=0.625040650406504, page=[297.0, 210.0]).\n# visible edges -> solid (layer OUTLINE); hidden edges -> dashed (layer HIDDEN)\n# dimensions -> real movable DIMENSION entities (text = true mm value)\n# Run: python 0056_00560443_gt.py [out.dxf]\nimport sys\nimport ezdxf\n\nSCALE = 0.625040650406504\nPAGE = [297.0, 210.0]\n\nVISIBLE_SEGMENTS = [\n (141.085001, 109.545921, 141.085001, 172.049986),\n (141.085001, 172.049986, 98.319062, 172.049986),\n (98.319062, 172.049986, 98.319062, 109.545921),\n (98.319062, 109.545921, 141.085001, 109.545921),\n (141.085001, 95.545921, 141.085001, 61.949986),\n (98.319062, 95.545921, 98.319062, 61.949986),\n (98.319062, 61.949986, 141.085001, 61.949986),\n (98.319062, 95.545921, 141.085001, 95.545921),\n (188.680936, 172.049986, 155.085001, 172.049986),\n (155.085001, 172.049986, 155.085001, 109.545921),\n (188.680936, 109.545921, 155.085001, 109.545921),\n (188.680936, 172.049986, 188.680936, 109.545921)\n]\nVISIBLE_CIRCLES = [\n\n]\nVISIBLE_ARCS = [\n\n]\nHIDDEN_SEGMENTS = [\n\n]\n# (orient, text, p1, p2, base) for linear; (orient, text, center, radius, angle) for diameter\nDIMENSIONS = [\n ('horizontal', '68.4211', (141.085, 109.5459), (98.3191, 109.5459), (119.702, 98.5459)),\n ('vertical', '100', (141.085, 172.05), (141.085, 109.5459), (152.085, 140.798)),\n ('horizontal', '53.75', (188.6809, 172.05), (155.085, 172.05), (171.883, 161.05))\n]\n\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\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\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,\n angle=(0 if d[0] == \"horizontal\" else 90),\n 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,\n 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,\n text=text, dimstyle=\"EZDXF\").render()\n\n doc.saveas(out_path)\n\n\nif __name__ == \"__main__\":\n out = sys.argv[1] if len(sys.argv) > 1 else \"0056_00560443_gt.dxf\"\n draw(out)\n print(\"wrote\", out)\n```"}], "images": ["images/0056_00560443.png"], "id": "0056_00560443"} {"messages": [{"role": "user", "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 88.42 mm wide and 100 mm tall. It is extruded to a thickness of 1.04 mm."}, {"role": "assistant", "content": "```python\n#!/usr/bin/env python3\n# -*- coding: utf-8 -*-\n# Ground-truth 2D engineering drawing for part: 0056_00563825\n# Self-contained: reproduces the three-view DXF via ezdxf, NO FreeCAD needed.\n# Coordinates are A4 page millimetres (scale=0.7798491620111728, page=[297.0, 210.0]).\n# visible edges -> solid (layer OUTLINE); hidden edges -> dashed (layer HIDDEN)\n# dimensions -> real movable DIMENSION entities (text = true mm value)\n# Run: python 0056_00563825_gt.py [out.dxf]\nimport sys\nimport ezdxf\n\nSCALE = 0.7798491620111728\nPAGE = [297.0, 210.0]\n\nVISIBLE_SEGMENTS = [\n (170.1652, 85.81989, 170.1652, 163.804806),\n (101.210116, 85.81989, 170.1652, 85.81989),\n (170.1652, 163.804806, 101.210116, 163.804806),\n (101.210116, 163.804806, 101.210116, 85.81989),\n (170.1652, 70.195205, 170.1652, 71.81989),\n (101.210116, 70.195205, 101.210116, 71.81989),\n (101.210116, 70.195205, 170.1652, 70.195205),\n (101.210116, 71.81989, 170.1652, 71.81989),\n (184.1652, 85.81989, 185.789885, 85.81989),\n (185.789885, 163.804806, 184.1652, 163.804806),\n (184.1652, 163.804806, 184.1652, 85.81989),\n (185.789885, 163.804806, 185.789885, 85.81989)\n]\nVISIBLE_CIRCLES = [\n\n]\nVISIBLE_ARCS = [\n\n]\nHIDDEN_SEGMENTS = [\n\n]\n# (orient, text, p1, p2, base) for linear; (orient, text, center, radius, angle) for diameter\nDIMENSIONS = [\n ('horizontal', '88.4211', (170.1652, 85.8199), (101.2101, 85.8199), (135.6877, 74.8199)),\n ('vertical', '100', (170.1652, 163.8048), (170.1652, 85.8199), (181.1652, 124.8123)),\n ('horizontal', '2.0833', (185.7899, 163.8048), (184.1652, 163.8048), (184.9775, 152.8048))\n]\n\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\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\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,\n angle=(0 if d[0] == \"horizontal\" else 90),\n 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,\n 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,\n text=text, dimstyle=\"EZDXF\").render()\n\n doc.saveas(out_path)\n\n\nif __name__ == \"__main__\":\n out = sys.argv[1] if len(sys.argv) > 1 else \"0056_00563825_gt.dxf\"\n draw(out)\n print(\"wrote\", out)\n```"}], "images": ["images/0056_00563825.png"], "id": "0056_00563825"} {"messages": [{"role": "user", "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 3.16 mm tall. It is extruded to a thickness of 47.92 mm."}, {"role": "assistant", "content": "```python\n#!/usr/bin/env python3\n# -*- coding: utf-8 -*-\n# Ground-truth 2D engineering drawing for part: 0056_00568666\n# Self-contained: reproduces the three-view DXF via ezdxf, NO FreeCAD needed.\n# Coordinates are A4 page millimetres (scale=1.4244183673469384, page=[297.0, 210.0]).\n# visible edges -> solid (layer OUTLINE); hidden edges -> dashed (layer HIDDEN)\n# dimensions -> real movable DIMENSION entities (text = true mm value)\n# Run: python 0056_00568666_gt.py [out.dxf]\nimport sys\nimport ezdxf\n\nSCALE = 1.4244183673469384\nPAGE = [297.0, 210.0]\n\nVISIBLE_SEGMENTS = [\n (173.594211, 155.877622, 173.594211, 160.375785),\n (173.594211, 160.375785, 31.152375, 160.375785),\n (31.152375, 160.375785, 31.152375, 155.877622),\n (31.152375, 155.877622, 173.594211, 155.877622),\n (173.594211, 141.877622, 173.594211, 73.624242),\n (31.152375, 141.877622, 31.152375, 73.624242),\n (31.152375, 73.624242, 173.594211, 73.624242),\n (31.152375, 141.877622, 173.594211, 141.877622),\n (255.847591, 160.375785, 187.594211, 160.375785),\n (187.594211, 160.375785, 187.594211, 155.877622),\n (255.847591, 155.877622, 187.594211, 155.877622),\n (255.847591, 160.375785, 255.847591, 155.877622)\n]\nVISIBLE_CIRCLES = [\n\n]\nVISIBLE_ARCS = [\n\n]\nHIDDEN_SEGMENTS = [\n\n]\n# (orient, text, p1, p2, base) for linear; (orient, text, center, radius, angle) for diameter\nDIMENSIONS = [\n ('horizontal', '100', (173.5942, 155.8776), (31.1524, 155.8776), (102.3733, 144.8776)),\n ('vertical', '3.1579', (173.5942, 160.3758), (173.5942, 155.8776), (184.5942, 158.1267)),\n ('horizontal', '47.9167', (255.8476, 160.3758), (187.5942, 160.3758), (221.7209, 149.3758))\n]\n\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\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\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,\n angle=(0 if d[0] == \"horizontal\" else 90),\n 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,\n 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,\n text=text, dimstyle=\"EZDXF\").render()\n\n doc.saveas(out_path)\n\n\nif __name__ == \"__main__\":\n out = sys.argv[1] if len(sys.argv) > 1 else \"0056_00568666_gt.dxf\"\n draw(out)\n print(\"wrote\", out)\n```"}], "images": ["images/0056_00568666.png"], "id": "0056_00568666"} {"messages": [{"role": "user", "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.04 mm."}, {"role": "assistant", "content": "```python\n#!/usr/bin/env python3\n# -*- coding: utf-8 -*-\n# Ground-truth 2D engineering drawing for part: 0056_00569590\n# Self-contained: reproduces the three-view DXF via ezdxf, NO FreeCAD needed.\n# Coordinates are A4 page millimetres (scale=0.9510927835051515, page=[297.0, 210.0]).\n# visible edges -> solid (layer OUTLINE); hidden edges -> dashed (layer HIDDEN)\n# dimensions -> real movable DIMENSION entities (text = true mm value)\n# Run: python 0056_00569590_gt.py [out.dxf]\nimport sys\nimport ezdxf\n\nSCALE = 0.9510927835051515\nPAGE = [297.0, 210.0]\n\nVISIBLE_SEGMENTS = [\n (183.559291, 172.049987, 183.559291, 76.940709),\n (183.559291, 76.940709, 88.450013, 76.940709),\n (88.450013, 76.940709, 88.450013, 172.049987),\n (88.450013, 172.049987, 183.559291, 172.049987),\n (183.559291, 61.949987, 183.559291, 62.940709),\n (183.559291, 62.940709, 88.450013, 62.940709),\n (88.450013, 61.949987, 88.450013, 62.940709),\n (183.559291, 61.949987, 88.450013, 61.949987),\n (197.559291, 76.940709, 198.550013, 76.940709),\n (198.550013, 76.940709, 198.550013, 172.049987),\n (197.559291, 172.049987, 198.550013, 172.049987),\n (197.559291, 76.940709, 197.559291, 172.049987)\n]\nVISIBLE_CIRCLES = [\n\n]\nVISIBLE_ARCS = [\n\n]\nHIDDEN_SEGMENTS = [\n\n]\n# (orient, text, p1, p2, base) for linear; (orient, text, center, radius, angle) for diameter\nDIMENSIONS = [\n ('horizontal', '100', (183.5593, 172.05), (88.45, 172.05), (136.0046, 161.05)),\n ('vertical', '100', (183.5593, 76.9407), (183.5593, 172.05), (172.5593, 124.4954)),\n ('horizontal', '1.0417', (197.5593, 76.9407), (198.55, 76.9407), (198.0547, 87.9407))\n]\n\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\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\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,\n angle=(0 if d[0] == \"horizontal\" else 90),\n 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,\n 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,\n text=text, dimstyle=\"EZDXF\").render()\n\n doc.saveas(out_path)\n\n\nif __name__ == \"__main__\":\n out = sys.argv[1] if len(sys.argv) > 1 else \"0056_00569590_gt.dxf\"\n draw(out)\n print(\"wrote\", out)\n```"}], "images": ["images/0056_00569590.png"], "id": "0056_00569590"} {"messages": [{"role": "user", "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 29.47 mm wide and 100 mm tall. It is extruded to a thickness of 3200 mm."}, {"role": "assistant", "content": "```python\n#!/usr/bin/env python3\n# -*- coding: utf-8 -*-\n# Ground-truth 2D engineering drawing for part: 0057_00570115\n# Self-contained: reproduces the three-view DXF via ezdxf, NO FreeCAD needed.\n# Coordinates are A4 page millimetres (scale=0.02912121212121212, page=[297.0, 210.0]).\n# visible edges -> solid (layer OUTLINE); hidden edges -> dashed (layer HIDDEN)\n# dimensions -> real movable DIMENSION entities (text = true mm value)\n# Run: python 0057_00570115_gt.py [out.dxf]\nimport sys\nimport ezdxf\n\nSCALE = 0.02912121212121212\nPAGE = [297.0, 210.0]\n\nVISIBLE_SEGMENTS = [\n (90.335206, 169.137887, 90.335206, 172.050008),\n (90.335206, 172.050008, 89.476897, 172.050008),\n (89.476897, 172.050008, 89.476897, 169.137887),\n (89.476897, 169.137887, 90.335206, 169.137887),\n (90.335206, 155.137887, 90.335206, 61.950008),\n (89.476897, 155.137887, 89.476897, 61.950008),\n (89.476897, 61.950008, 90.335206, 61.950008),\n (89.476897, 155.137887, 90.335206, 155.137887),\n (197.523085, 172.050008, 104.335206, 172.050008),\n (104.335206, 172.050008, 104.335206, 169.137887),\n (197.523085, 169.137887, 104.335206, 169.137887),\n (197.523085, 172.050008, 197.523085, 169.137887)\n]\nVISIBLE_CIRCLES = [\n\n]\nVISIBLE_ARCS = [\n\n]\nHIDDEN_SEGMENTS = [\n\n]\n# (orient, text, p1, p2, base) for linear; (orient, text, center, radius, angle) for diameter\nDIMENSIONS = [\n ('horizontal', '29.4737', (90.3352, 169.1379), (89.4769, 169.1379), (89.9061, 158.1379)),\n ('vertical', '100', (90.3352, 172.05), (90.3352, 169.1379), (101.3352, 170.5939)),\n ('horizontal', '3200', (197.5231, 172.05), (104.3352, 172.05), (150.9292, 161.05))\n]\n\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\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\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,\n angle=(0 if d[0] == \"horizontal\" else 90),\n 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,\n 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,\n text=text, dimstyle=\"EZDXF\").render()\n\n doc.saveas(out_path)\n\n\nif __name__ == \"__main__\":\n out = sys.argv[1] if len(sys.argv) > 1 else \"0057_00570115_gt.dxf\"\n draw(out)\n print(\"wrote\", out)\n```"}], "images": ["images/0057_00570115.png"], "id": "0057_00570115"} {"messages": [{"role": "user", "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 23.12 mm."}, {"role": "assistant", "content": "```python\n#!/usr/bin/env python3\n# -*- coding: utf-8 -*-\n# Ground-truth 2D engineering drawing for part: 0057_00570805\n# Self-contained: reproduces the three-view DXF via ezdxf, NO FreeCAD needed.\n# Coordinates are A4 page millimetres (scale=0.9042213889048268, page=[297.0, 210.0]).\n# visible edges -> solid (layer OUTLINE); hidden edges -> dashed (layer HIDDEN)\n# dimensions -> real movable DIMENSION entities (text = true mm value)\n# Run: python 0057_00570805_gt.py [out.dxf]\nimport sys\nimport ezdxf\n\nSCALE = 0.9042213889048268\nPAGE = [297.0, 210.0]\n\nVISIBLE_SEGMENTS = [\n (171.257617, 172.049968, 171.257617, 96.856821),\n (171.257617, 96.856821, 80.835478, 96.856821),\n (80.835478, 96.856821, 80.835478, 172.049968),\n (80.835478, 172.049968, 171.257617, 172.049968),\n (171.257617, 61.949968, 171.257617, 82.856821),\n (171.257617, 82.856821, 80.835478, 82.856821),\n (80.835478, 61.949968, 80.835478, 82.856821),\n (171.257617, 61.949968, 80.835478, 61.949968),\n (185.257617, 96.856821, 206.16447, 96.856821),\n (206.16447, 96.856821, 206.16447, 172.049968),\n (185.257617, 172.049968, 206.16447, 172.049968),\n (185.257617, 96.856821, 185.257617, 172.049968)\n]\nVISIBLE_CIRCLES = [\n\n]\nVISIBLE_ARCS = [\n\n]\nHIDDEN_SEGMENTS = [\n\n]\n# (orient, text, p1, p2, base) for linear; (orient, text, center, radius, angle) for diameter\nDIMENSIONS = [\n ('horizontal', '100', (171.2576, 172.05), (80.8355, 172.05), (126.0465, 161.05)),\n ('vertical', '83.1579', (171.2576, 96.8568), (171.2576, 172.05), (160.2576, 134.4534)),\n ('horizontal', '23.1214', (185.2576, 96.8568), (206.1645, 96.8568), (195.7111, 107.8568))\n]\n\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\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\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,\n angle=(0 if d[0] == \"horizontal\" else 90),\n 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,\n 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,\n text=text, dimstyle=\"EZDXF\").render()\n\n doc.saveas(out_path)\n\n\nif __name__ == \"__main__\":\n out = sys.argv[1] if len(sys.argv) > 1 else \"0057_00570805_gt.dxf\"\n draw(out)\n print(\"wrote\", out)\n```"}], "images": ["images/0057_00570805.png"], "id": "0057_00570805"} {"messages": [{"role": "user", "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 150 mm."}, {"role": "assistant", "content": "```python\n#!/usr/bin/env python3\n# -*- coding: utf-8 -*-\n# Ground-truth 2D engineering drawing for part: 0057_00572002\n# Self-contained: reproduces the three-view DXF via ezdxf, NO FreeCAD needed.\n# Coordinates are A4 page millimetres (scale=0.3844, page=[297.0, 210.0]).\n# visible edges -> solid (layer OUTLINE); hidden edges -> dashed (layer HIDDEN)\n# dimensions -> real movable DIMENSION entities (text = true mm value)\n# Run: python 0057_00572002_gt.py [out.dxf]\nimport sys\nimport ezdxf\n\nSCALE = 0.3844\nPAGE = [297.0, 210.0]\n\nVISIBLE_SEGMENTS = [\n (117.381183, 172.05, 117.381183, 133.61),\n (117.381183, 133.61, 97.958867, 133.61),\n (97.958867, 133.61, 97.958867, 172.05),\n (97.958867, 172.05, 117.381183, 172.05),\n (117.381183, 61.95, 117.381183, 119.61),\n (117.381183, 119.61, 97.958867, 119.61),\n (97.958867, 61.95, 97.958867, 119.61),\n (117.381183, 61.95, 97.958867, 61.95),\n (131.381183, 133.61, 189.041183, 133.61),\n (189.041183, 133.61, 189.041183, 172.05),\n (131.381183, 172.05, 189.041183, 172.05),\n (131.381183, 133.61, 131.381183, 172.05)\n]\nVISIBLE_CIRCLES = [\n\n]\nVISIBLE_ARCS = [\n\n]\nHIDDEN_SEGMENTS = [\n\n]\n# (orient, text, p1, p2, base) for linear; (orient, text, center, radius, angle) for diameter\nDIMENSIONS = [\n ('horizontal', '50.5263', (117.3812, 172.05), (97.9588, 172.05), (107.67, 161.05)),\n ('vertical', '100', (117.3812, 133.61), (117.3812, 172.05), (106.3812, 152.83)),\n ('horizontal', '150', (131.3812, 133.61), (189.0412, 133.61), (160.2112, 144.61))\n]\n\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\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\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,\n angle=(0 if d[0] == \"horizontal\" else 90),\n 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,\n 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,\n text=text, dimstyle=\"EZDXF\").render()\n\n doc.saveas(out_path)\n\n\nif __name__ == \"__main__\":\n out = sys.argv[1] if len(sys.argv) > 1 else \"0057_00572002_gt.dxf\"\n draw(out)\n print(\"wrote\", out)\n```"}], "images": ["images/0057_00572002.png"], "id": "0057_00572002"} {"messages": [{"role": "user", "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 66.32 mm tall. It is extruded to a thickness of 133.33 mm."}, {"role": "assistant", "content": "```python\n#!/usr/bin/env python3\n# -*- coding: utf-8 -*-\n# Ground-truth 2D engineering drawing for part: 0057_00572004\n# Self-contained: reproduces the three-view DXF via ezdxf, NO FreeCAD needed.\n# Coordinates are A4 page millimetres (scale=0.48134446397188907, page=[297.0, 210.0]).\n# visible edges -> solid (layer OUTLINE); hidden edges -> dashed (layer HIDDEN)\n# dimensions -> real movable DIMENSION entities (text = true mm value)\n# Run: python 0057_00572004_gt.py [out.dxf]\nimport sys\nimport ezdxf\n\nSCALE = 0.48134446397188907\nPAGE = [297.0, 210.0]\n\nVISIBLE_SEGMENTS = [\n (128.477577, 172.050023, 128.477577, 140.129285),\n (128.477577, 140.129285, 80.343131, 140.129285),\n (80.343131, 140.129285, 80.343131, 172.050023),\n (80.343131, 172.050023, 128.477577, 172.050023),\n (128.477577, 61.950023, 128.477577, 126.129285),\n (128.477577, 126.129285, 80.343131, 126.129285),\n (80.343131, 61.950023, 80.343131, 126.129285),\n (128.477577, 61.950023, 80.343131, 61.950023),\n (142.477577, 140.129285, 206.656839, 140.129285),\n (206.656839, 140.129285, 206.656839, 172.050023),\n (142.477577, 172.050023, 206.656839, 172.050023),\n (142.477577, 140.129285, 142.477577, 172.050023)\n]\nVISIBLE_CIRCLES = [\n\n]\nVISIBLE_ARCS = [\n\n]\nHIDDEN_SEGMENTS = [\n\n]\n# (orient, text, p1, p2, base) for linear; (orient, text, center, radius, angle) for diameter\nDIMENSIONS = [\n ('horizontal', '100', (128.4776, 172.05), (80.3431, 172.05), (104.4104, 161.05)),\n ('vertical', '66.3158', (128.4776, 140.1293), (128.4776, 172.05), (117.4776, 156.0896)),\n ('horizontal', '133.333', (142.4776, 140.1293), (206.6568, 140.1293), (174.5672, 151.1293))\n]\n\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\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\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,\n angle=(0 if d[0] == \"horizontal\" else 90),\n 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,\n 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,\n text=text, dimstyle=\"EZDXF\").render()\n\n doc.saveas(out_path)\n\n\nif __name__ == \"__main__\":\n out = sys.argv[1] if len(sys.argv) > 1 else \"0057_00572004_gt.dxf\"\n draw(out)\n print(\"wrote\", out)\n```"}], "images": ["images/0057_00572004.png"], "id": "0057_00572004"} {"messages": [{"role": "user", "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 3.75 mm. The outline includes one or more oblique (angled) edges."}, {"role": "assistant", "content": "```python\n#!/usr/bin/env python3\n# -*- coding: utf-8 -*-\n# Ground-truth 2D engineering drawing for part: 0057_00572057\n# Self-contained: reproduces the three-view DXF via ezdxf, NO FreeCAD needed.\n# Coordinates are A4 page millimetres (scale=0.3944022909029373, page=[297.0, 210.0]).\n# visible edges -> solid (layer OUTLINE); hidden edges -> dashed (layer HIDDEN)\n# dimensions -> real movable DIMENSION entities (text = true mm value)\n# Run: python 0057_00572057_gt.py [out.dxf]\nimport sys\nimport ezdxf\nimport math\n\nSCALE = 0.3944022909029373\nPAGE = [297.0, 210.0]\n\nVISIBLE_SEGMENTS = [\n (116.338443, 172.05001, 155.183075, 172.05001),\n (155.183075, 172.05001, 183.071528, 144.161557),\n (183.071528, 144.161557, 183.071528, 105.316925),\n (183.071528, 105.316925, 155.183075, 77.428472),\n (155.183075, 77.428472, 116.338443, 77.428472),\n (116.338443, 77.428472, 88.44999, 105.316925),\n (88.44999, 105.316925, 88.44999, 144.161557),\n (88.44999, 144.161557, 116.338443, 172.05001),\n (183.071528, 61.95001, 183.071528, 63.428472),\n (183.071528, 63.428472, 155.183075, 63.428472),\n (155.183075, 61.95001, 155.183075, 63.428472),\n (183.071528, 61.95001, 155.183075, 61.95001),\n (155.183075, 63.428472, 116.338443, 63.428472),\n (116.338443, 61.95001, 116.338443, 63.428472),\n (155.183075, 61.95001, 116.338443, 61.95001),\n (116.338443, 63.428472, 88.44999, 63.428472),\n (88.44999, 61.95001, 88.44999, 63.428472),\n (116.338443, 61.95001, 88.44999, 61.95001),\n (197.071528, 172.05001, 198.54999, 172.05001),\n (197.071528, 77.428472, 198.54999, 77.428472),\n (198.54999, 77.428472, 198.54999, 105.316925),\n (197.071528, 105.316925, 198.54999, 105.316925),\n (197.071528, 77.428472, 197.071528, 105.316925),\n (198.54999, 105.316925, 198.54999, 144.161557),\n (197.071528, 144.161557, 198.54999, 144.161557),\n (197.071528, 105.316925, 197.071528, 144.161557),\n (198.54999, 144.161557, 198.54999, 172.05001),\n (197.071528, 144.161557, 197.071528, 172.05001)\n]\nVISIBLE_CIRCLES = [\n\n]\nVISIBLE_ARCS = [\n\n]\nHIDDEN_SEGMENTS = [\n\n]\n# (orient, text, p1, p2, base) for linear; (orient, text, center, radius, angle) for diameter\nDIMENSIONS = [\n ('horizontal', '98.4899', (116.3385, 77.4285), (155.1831, 77.4285), (135.7608, 88.4285)),\n ('vertical', '98.4899', (183.0715, 105.3169), (183.0715, 144.1616), (172.0715, 124.7392)),\n ('aligned', '100', (155.1831, 77.4285), (183.0715, 105.3169), (161.3491, 99.1509)),\n ('aligned', '100', (183.0715, 144.1616), (155.1831, 172.05), (161.3491, 150.3276)),\n ('aligned', '100', (116.3385, 172.05), (88.45, 144.1616), (110.1724, 150.3276)),\n ('aligned', '100', (88.45, 105.3169), (116.3385, 77.4285), (110.1724, 99.1509)),\n ('horizontal', '3.7486', (197.0715, 105.3169), (198.55, 105.3169), (197.8108, 116.3169))\n]\n\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; _ds.dxf.dimasz = 2.5\n _ds.dxf.dimexe = 1.25; _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\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\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,\n angle=(0 if d[0] == \"horizontal\" else 90),\n 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,\n 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,\n 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,\n text=text, dimstyle=\"EZDXF\").render()\n\n doc.saveas(out_path)\n\n\nif __name__ == \"__main__\":\n out = sys.argv[1] if len(sys.argv) > 1 else \"0057_00572057_gt.dxf\"\n draw(out)\n print(\"wrote\", out)\n```"}], "images": ["images/0057_00572057.png"], "id": "0057_00572057"} {"messages": [{"role": "user", "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 45.26 mm tall. It is extruded to a thickness of 3.12 mm."}, {"role": "assistant", "content": "```python\n#!/usr/bin/env python3\n# -*- coding: utf-8 -*-\n# Ground-truth 2D engineering drawing for part: 0057_00572594\n# Self-contained: reproduces the three-view DXF via ezdxf, NO FreeCAD needed.\n# Coordinates are A4 page millimetres (scale=1.0115434782609172, page=[297.0, 210.0]).\n# visible edges -> solid (layer OUTLINE); hidden edges -> dashed (layer HIDDEN)\n# dimensions -> real movable DIMENSION entities (text = true mm value)\n# Run: python 0057_00572594_gt.py [out.dxf]\nimport sys\nimport ezdxf\n\nSCALE = 1.0115434782609172\nPAGE = [297.0, 210.0]\n\nVISIBLE_SEGMENTS = [\n (185.496615, 102.687729, 185.496615, 148.473381),\n (185.496615, 148.473381, 84.342267, 148.473381),\n (84.342267, 148.473381, 84.342267, 102.687729),\n (84.342267, 102.687729, 185.496615, 102.687729),\n (185.496615, 88.687729, 185.496615, 85.526655),\n (84.342267, 88.687729, 84.342267, 85.526655),\n (84.342267, 85.526655, 185.496615, 85.526655),\n (84.342267, 88.687729, 185.496615, 88.687729),\n (202.657688, 148.473381, 199.496615, 148.473381),\n (199.496615, 148.473381, 199.496615, 102.687729),\n (202.657688, 102.687729, 199.496615, 102.687729),\n (202.657688, 148.473381, 202.657688, 102.687729)\n]\nVISIBLE_CIRCLES = [\n\n]\nVISIBLE_ARCS = [\n\n]\nHIDDEN_SEGMENTS = [\n\n]\n# (orient, text, p1, p2, base) for linear; (orient, text, center, radius, angle) for diameter\nDIMENSIONS = [\n ('horizontal', '100', (185.4966, 102.6877), (84.3423, 102.6877), (134.9195, 91.6877)),\n ('vertical', '45.2632', (185.4966, 148.4734), (185.4966, 102.6877), (196.4966, 125.5805)),\n ('horizontal', '3.125', (202.6577, 148.4734), (199.4966, 148.4734), (201.0772, 137.4734))\n]\n\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\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\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,\n angle=(0 if d[0] == \"horizontal\" else 90),\n 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,\n 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,\n text=text, dimstyle=\"EZDXF\").render()\n\n doc.saveas(out_path)\n\n\nif __name__ == \"__main__\":\n out = sys.argv[1] if len(sys.argv) > 1 else \"0057_00572594_gt.dxf\"\n draw(out)\n print(\"wrote\", out)\n```"}], "images": ["images/0057_00572594.png"], "id": "0057_00572594"} {"messages": [{"role": "user", "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 92.63 mm tall. It is extruded to a thickness of 2.08 mm."}, {"role": "assistant", "content": "```python\n#!/usr/bin/env python3\n# -*- coding: utf-8 -*-\n# Ground-truth 2D engineering drawing for part: 0057_00573489\n# Self-contained: reproduces the three-view DXF via ezdxf, NO FreeCAD needed.\n# Coordinates are A4 page millimetres (scale=1.014623755498966, page=[297.0, 210.0]).\n# visible edges -> solid (layer OUTLINE); hidden edges -> dashed (layer HIDDEN)\n# dimensions -> real movable DIMENSION entities (text = true mm value)\n# Run: python 0057_00573489_gt.py [out.dxf]\nimport sys\nimport ezdxf\n\nSCALE = 1.014623755498966\nPAGE = [297.0, 210.0]\n\nVISIBLE_SEGMENTS = [\n (186.174295, 172.05, 186.174295, 78.0638),\n (186.174295, 78.0638, 84.71192, 78.0638),\n (84.71192, 78.0638, 84.71192, 172.05),\n (84.71192, 172.05, 186.174295, 172.05),\n (186.174295, 61.95, 186.174295, 64.0638),\n (186.174295, 64.0638, 84.71192, 64.0638),\n (84.71192, 61.95, 84.71192, 64.0638),\n (186.174295, 61.95, 84.71192, 61.95),\n (200.174295, 78.0638, 202.288095, 78.0638),\n (202.288095, 78.0638, 202.288095, 172.05),\n (200.174295, 172.05, 202.288095, 172.05),\n (200.174295, 78.0638, 200.174295, 172.05)\n]\nVISIBLE_CIRCLES = [\n\n]\nVISIBLE_ARCS = [\n\n]\nHIDDEN_SEGMENTS = [\n\n]\n# (orient, text, p1, p2, base) for linear; (orient, text, center, radius, angle) for diameter\nDIMENSIONS = [\n ('horizontal', '100', (186.1743, 172.05), (84.7119, 172.05), (135.4431, 161.05)),\n ('vertical', '92.6316', (186.1743, 78.0638), (186.1743, 172.05), (175.1743, 125.0569)),\n ('horizontal', '2.0833', (200.1743, 78.0638), (202.2881, 78.0638), (201.2312, 89.0638))\n]\n\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\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\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,\n angle=(0 if d[0] == \"horizontal\" else 90),\n 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,\n 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,\n text=text, dimstyle=\"EZDXF\").render()\n\n doc.saveas(out_path)\n\n\nif __name__ == \"__main__\":\n out = sys.argv[1] if len(sys.argv) > 1 else \"0057_00573489_gt.dxf\"\n draw(out)\n print(\"wrote\", out)\n```"}], "images": ["images/0057_00573489.png"], "id": "0057_00573489"} {"messages": [{"role": "user", "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 150 mm."}, {"role": "assistant", "content": "```python\n#!/usr/bin/env python3\n# -*- coding: utf-8 -*-\n# Ground-truth 2D engineering drawing for part: 0057_00575944\n# Self-contained: reproduces the three-view DXF via ezdxf, NO FreeCAD needed.\n# Coordinates are A4 page millimetres (scale=0.3844, page=[297.0, 210.0]).\n# visible edges -> solid (layer OUTLINE); hidden edges -> dashed (layer HIDDEN)\n# dimensions -> real movable DIMENSION entities (text = true mm value)\n# Run: python 0057_00575944_gt.py [out.dxf]\nimport sys\nimport ezdxf\n\nSCALE = 0.3844\nPAGE = [297.0, 210.0]\n\nVISIBLE_SEGMENTS = [\n (117.381183, 172.05, 117.381183, 133.61),\n (117.381183, 133.61, 97.958867, 133.61),\n (97.958867, 133.61, 97.958867, 172.05),\n (97.958867, 172.05, 117.381183, 172.05),\n (117.381183, 61.95, 117.381183, 119.61),\n (117.381183, 119.61, 97.958867, 119.61),\n (97.958867, 61.95, 97.958867, 119.61),\n (117.381183, 61.95, 97.958867, 61.95),\n (131.381183, 133.61, 189.041183, 133.61),\n (189.041183, 133.61, 189.041183, 172.05),\n (131.381183, 172.05, 189.041183, 172.05),\n (131.381183, 133.61, 131.381183, 172.05)\n]\nVISIBLE_CIRCLES = [\n\n]\nVISIBLE_ARCS = [\n\n]\nHIDDEN_SEGMENTS = [\n\n]\n# (orient, text, p1, p2, base) for linear; (orient, text, center, radius, angle) for diameter\nDIMENSIONS = [\n ('horizontal', '50.5263', (117.3812, 172.05), (97.9588, 172.05), (107.67, 161.05)),\n ('vertical', '100', (117.3812, 133.61), (117.3812, 172.05), (106.3812, 152.83)),\n ('horizontal', '150', (131.3812, 133.61), (189.0412, 133.61), (160.2112, 144.61))\n]\n\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\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\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,\n angle=(0 if d[0] == \"horizontal\" else 90),\n 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,\n 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,\n text=text, dimstyle=\"EZDXF\").render()\n\n doc.saveas(out_path)\n\n\nif __name__ == \"__main__\":\n out = sys.argv[1] if len(sys.argv) > 1 else \"0057_00575944_gt.dxf\"\n draw(out)\n print(\"wrote\", out)\n```"}], "images": ["images/0057_00575944.png"], "id": "0057_00575944"} {"messages": [{"role": "user", "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 24.48 mm."}, {"role": "assistant", "content": "```python\n#!/usr/bin/env python3\n# -*- coding: utf-8 -*-\n# Ground-truth 2D engineering drawing for part: 0057_00576599\n# Self-contained: reproduces the three-view DXF via ezdxf, NO FreeCAD needed.\n# Coordinates are A4 page millimetres (scale=1.0821162790697956, page=[297.0, 210.0]).\n# visible edges -> solid (layer OUTLINE); hidden edges -> dashed (layer HIDDEN)\n# dimensions -> real movable DIMENSION entities (text = true mm value)\n# Run: python 0057_00576599_gt.py [out.dxf]\nimport sys\nimport ezdxf\n\nSCALE = 1.0821162790697956\nPAGE = [297.0, 210.0]\n\nVISIBLE_SEGMENTS = [\n (164.116524, 131.125157, 164.116524, 169.853529),\n (55.904896, 131.125157, 164.116524, 131.125157),\n (164.116524, 169.853529, 55.904896, 169.853529),\n (55.904896, 169.853529, 55.904896, 131.125157),\n (164.116524, 64.146547, 164.116524, 117.125157),\n (55.904896, 64.146547, 55.904896, 117.125157),\n (55.904896, 64.146547, 164.116524, 64.146547),\n (55.904896, 117.125157, 164.116524, 117.125157),\n (178.116524, 131.125157, 231.095133, 131.125157),\n (231.095133, 169.853529, 178.116524, 169.853529),\n (178.116524, 169.853529, 178.116524, 131.125157),\n (231.095133, 169.853529, 231.095133, 131.125157)\n]\nVISIBLE_CIRCLES = [\n\n]\nVISIBLE_ARCS = [\n\n]\nHIDDEN_SEGMENTS = [\n\n]\n# (orient, text, p1, p2, base) for linear; (orient, text, center, radius, angle) for diameter\nDIMENSIONS = [\n ('horizontal', '100', (164.1165, 131.1252), (55.9049, 131.1252), (110.0107, 120.1252)),\n ('vertical', '35.7895', (164.1165, 169.8535), (164.1165, 131.1252), (175.1165, 150.4893)),\n ('horizontal', '48.9583', (231.0952, 169.8535), (178.1165, 169.8535), (204.6058, 158.8535))\n]\n\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\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\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,\n angle=(0 if d[0] == \"horizontal\" else 90),\n 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,\n 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,\n text=text, dimstyle=\"EZDXF\").render()\n\n doc.saveas(out_path)\n\n\nif __name__ == \"__main__\":\n out = sys.argv[1] if len(sys.argv) > 1 else \"0057_00576599_gt.dxf\"\n draw(out)\n print(\"wrote\", out)\n```"}], "images": ["images/0057_00576599.png"], "id": "0057_00576599"} {"messages": [{"role": "user", "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 150 mm."}, {"role": "assistant", "content": "```python\n#!/usr/bin/env python3\n# -*- coding: utf-8 -*-\n# Ground-truth 2D engineering drawing for part: 0057_00576608\n# Self-contained: reproduces the three-view DXF via ezdxf, NO FreeCAD needed.\n# Coordinates are A4 page millimetres (scale=0.3844, page=[297.0, 210.0]).\n# visible edges -> solid (layer OUTLINE); hidden edges -> dashed (layer HIDDEN)\n# dimensions -> real movable DIMENSION entities (text = true mm value)\n# Run: python 0057_00576608_gt.py [out.dxf]\nimport sys\nimport ezdxf\n\nSCALE = 0.3844\nPAGE = [297.0, 210.0]\n\nVISIBLE_SEGMENTS = [\n (117.381183, 172.05, 117.381183, 133.61),\n (117.381183, 133.61, 97.958867, 133.61),\n (97.958867, 133.61, 97.958867, 172.05),\n (97.958867, 172.05, 117.381183, 172.05),\n (117.381183, 61.95, 117.381183, 119.61),\n (117.381183, 119.61, 97.958867, 119.61),\n (97.958867, 61.95, 97.958867, 119.61),\n (117.381183, 61.95, 97.958867, 61.95),\n (131.381183, 133.61, 189.041183, 133.61),\n (189.041183, 133.61, 189.041183, 172.05),\n (131.381183, 172.05, 189.041183, 172.05),\n (131.381183, 133.61, 131.381183, 172.05)\n]\nVISIBLE_CIRCLES = [\n\n]\nVISIBLE_ARCS = [\n\n]\nHIDDEN_SEGMENTS = [\n\n]\n# (orient, text, p1, p2, base) for linear; (orient, text, center, radius, angle) for diameter\nDIMENSIONS = [\n ('horizontal', '50.5263', (117.3812, 172.05), (97.9588, 172.05), (107.67, 161.05)),\n ('vertical', '100', (117.3812, 133.61), (117.3812, 172.05), (106.3812, 152.83)),\n ('horizontal', '150', (131.3812, 133.61), (189.0412, 133.61), (160.2112, 144.61))\n]\n\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\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\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,\n angle=(0 if d[0] == \"horizontal\" else 90),\n 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,\n 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,\n text=text, dimstyle=\"EZDXF\").render()\n\n doc.saveas(out_path)\n\n\nif __name__ == \"__main__\":\n out = sys.argv[1] if len(sys.argv) > 1 else \"0057_00576608_gt.dxf\"\n draw(out)\n print(\"wrote\", out)\n```"}], "images": ["images/0057_00576608.png"], "id": "0057_00576608"} {"messages": [{"role": "user", "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 0.52 mm."}, {"role": "assistant", "content": "```python\n#!/usr/bin/env python3\n# -*- coding: utf-8 -*-\n# Ground-truth 2D engineering drawing for part: 0057_00576707\n# Self-contained: reproduces the three-view DXF via ezdxf, NO FreeCAD needed.\n# Coordinates are A4 page millimetres (scale=1.461786528497414, page=[297.0, 210.0]).\n# visible edges -> solid (layer OUTLINE); hidden edges -> dashed (layer HIDDEN)\n# dimensions -> real movable DIMENSION entities (text = true mm value)\n# Run: python 0057_00576707_gt.py [out.dxf]\nimport sys\nimport ezdxf\n\nSCALE = 1.461786528497414\nPAGE = [297.0, 210.0]\n\nVISIBLE_SEGMENTS = [\n (209.208681, 133.612983, 209.208681, 115.148311),\n (209.208681, 115.148311, 63.030028, 115.148311),\n (63.030028, 115.148311, 63.030028, 133.612983),\n (63.030028, 133.612983, 209.208681, 133.612983),\n (209.208681, 100.386964, 209.208681, 101.148311),\n (209.208681, 101.148311, 63.030028, 101.148311),\n (63.030028, 100.386964, 63.030028, 101.148311),\n (209.208681, 100.386964, 63.030028, 100.386964),\n (223.208681, 115.148311, 223.970028, 115.148311),\n (223.970028, 115.148311, 223.970028, 133.612983),\n (223.208681, 133.612983, 223.970028, 133.612983),\n (223.208681, 115.148311, 223.208681, 133.612983)\n]\nVISIBLE_CIRCLES = [\n\n]\nVISIBLE_ARCS = [\n\n]\nHIDDEN_SEGMENTS = [\n\n]\n# (orient, text, p1, p2, base) for linear; (orient, text, center, radius, angle) for diameter\nDIMENSIONS = [\n ('horizontal', '100', (209.2087, 133.613), (63.03, 133.613), (136.1193, 122.613)),\n ('vertical', '12.6316', (209.2087, 115.1483), (209.2087, 133.613), (198.2087, 124.3807)),\n ('horizontal', '0.5208', (223.2087, 115.1483), (223.97, 115.1483), (223.5893, 126.1483))\n]\n\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\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\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,\n angle=(0 if d[0] == \"horizontal\" else 90),\n 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,\n 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,\n text=text, dimstyle=\"EZDXF\").render()\n\n doc.saveas(out_path)\n\n\nif __name__ == \"__main__\":\n out = sys.argv[1] if len(sys.argv) > 1 else \"0057_00576707_gt.dxf\"\n draw(out)\n print(\"wrote\", out)\n```"}], "images": ["images/0057_00576707.png"], "id": "0057_00576707"} {"messages": [{"role": "user", "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": "assistant", "content": "```python\n#!/usr/bin/env python3\n# -*- coding: utf-8 -*-\n# Ground-truth 2D engineering drawing for part: 0057_00576747\n# Self-contained: reproduces the three-view DXF via ezdxf, NO FreeCAD needed.\n# Coordinates are A4 page millimetres (scale=0.4805, page=[297.0, 210.0]).\n# visible edges -> solid (layer OUTLINE); hidden edges -> dashed (layer HIDDEN)\n# dimensions -> real movable DIMENSION entities (text = true mm value)\n# Run: python 0057_00576747_gt.py [out.dxf]\nimport sys\nimport ezdxf\n\nSCALE = 0.4805\nPAGE = [297.0, 210.0]\n\nVISIBLE_SEGMENTS = [\n (184.55, 124.0, 184.55, 172.05),\n (184.55, 172.05, 136.5, 172.05),\n (136.5, 172.05, 136.5, 124.0),\n (136.5, 124.0, 184.55, 124.0),\n (184.55, 110.0, 184.55, 61.95),\n (136.5, 110.0, 136.5, 61.95),\n (136.5, 61.95, 184.55, 61.95),\n (136.5, 110.0, 184.55, 110.0),\n (246.6, 172.05, 198.55, 172.05),\n (198.55, 172.05, 198.55, 124.0),\n (246.6, 124.0, 198.55, 124.0),\n (246.6, 172.05, 246.6, 124.0)\n]\nVISIBLE_CIRCLES = [\n\n]\nVISIBLE_ARCS = [\n\n]\nHIDDEN_SEGMENTS = [\n\n]\n# (orient, text, p1, p2, base) for linear; (orient, text, center, radius, angle) for diameter\nDIMENSIONS = [\n ('horizontal', '100', (136.5, 124.0), (88.45, 124.0), (112.475, 113.0)),\n ('vertical', '100', (136.5, 172.05), (136.5, 124.0), (147.5, 148.025)),\n ('horizontal', '100', (198.55, 172.05), (150.5, 172.05), (174.525, 161.05))\n]\n\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\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\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,\n angle=(0 if d[0] == \"horizontal\" else 90),\n 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,\n 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,\n text=text, dimstyle=\"EZDXF\").render()\n\n doc.saveas(out_path)\n\n\nif __name__ == \"__main__\":\n out = sys.argv[1] if len(sys.argv) > 1 else \"0057_00576747_gt.dxf\"\n draw(out)\n print(\"wrote\", out)\n```"}], "images": ["images/0057_00576747.png"], "id": "0057_00576747"} {"messages": [{"role": "user", "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 46.32 mm wide and 100 mm tall. It is extruded to a thickness of 2.08 mm."}, {"role": "assistant", "content": "```python\n#!/usr/bin/env python3\n# -*- coding: utf-8 -*-\n# Ground-truth 2D engineering drawing for part: 0057_00577617\n# Self-contained: reproduces the three-view DXF via ezdxf, NO FreeCAD needed.\n# Coordinates are A4 page millimetres (scale=0.9413877551020436, page=[297.0, 210.0]).\n# visible edges -> solid (layer OUTLINE); hidden edges -> dashed (layer HIDDEN)\n# dimensions -> real movable DIMENSION entities (text = true mm value)\n# Run: python 0057_00577617_gt.py [out.dxf]\nimport sys\nimport ezdxf\n\nSCALE = 0.9413877551020436\nPAGE = [297.0, 210.0]\n\nVISIBLE_SEGMENTS = [\n (157.319979, 77.911215, 157.319979, 172.04999),\n (157.319979, 172.04999, 113.718861, 172.04999),\n (113.718861, 172.04999, 113.718861, 77.911215),\n (113.718861, 77.911215, 157.319979, 77.911215),\n (157.319979, 63.911215, 157.319979, 61.94999),\n (113.718861, 63.911215, 113.718861, 61.94999),\n (113.718861, 61.94999, 157.319979, 61.94999),\n (113.718861, 63.911215, 157.319979, 63.911215),\n (173.281203, 172.04999, 171.319979, 172.04999),\n (171.319979, 172.04999, 171.319979, 77.911215),\n (173.281203, 77.911215, 171.319979, 77.911215),\n (173.281203, 172.04999, 173.281203, 77.911215)\n]\nVISIBLE_CIRCLES = [\n\n]\nVISIBLE_ARCS = [\n\n]\nHIDDEN_SEGMENTS = [\n\n]\n# (orient, text, p1, p2, base) for linear; (orient, text, center, radius, angle) for diameter\nDIMENSIONS = [\n ('horizontal', '46.3158', (157.32, 77.9112), (113.7188, 77.9112), (135.5194, 66.9112)),\n ('vertical', '100', (157.32, 172.05), (157.32, 77.9112), (168.32, 124.9806)),\n ('horizontal', '2.0833', (173.2812, 172.05), (171.32, 172.05), (172.3006, 161.05))\n]\n\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\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\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,\n angle=(0 if d[0] == \"horizontal\" else 90),\n 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,\n 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,\n text=text, dimstyle=\"EZDXF\").render()\n\n doc.saveas(out_path)\n\n\nif __name__ == \"__main__\":\n out = sys.argv[1] if len(sys.argv) > 1 else \"0057_00577617_gt.dxf\"\n draw(out)\n print(\"wrote\", out)\n```"}], "images": ["images/0057_00577617.png"], "id": "0057_00577617"} {"messages": [{"role": "user", "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 2.08 mm."}, {"role": "assistant", "content": "```python\n#!/usr/bin/env python3\n# -*- coding: utf-8 -*-\n# Ground-truth 2D engineering drawing for part: 0057_00577623\n# Self-contained: reproduces the three-view DXF via ezdxf, NO FreeCAD needed.\n# Coordinates are A4 page millimetres (scale=0.9413877551020436, page=[297.0, 210.0]).\n# visible edges -> solid (layer OUTLINE); hidden edges -> dashed (layer HIDDEN)\n# dimensions -> real movable DIMENSION entities (text = true mm value)\n# Run: python 0057_00577623_gt.py [out.dxf]\nimport sys\nimport ezdxf\n\nSCALE = 0.9413877551020436\nPAGE = [297.0, 210.0]\n\nVISIBLE_SEGMENTS = [\n (159.301806, 77.911215, 159.301806, 172.04999),\n (159.301806, 172.04999, 111.736951, 172.04999),\n (111.736951, 172.04999, 111.736951, 77.911215),\n (111.736951, 77.911215, 159.301806, 77.911215),\n (159.301806, 63.911215, 159.301806, 61.94999),\n (111.736951, 63.911215, 111.736951, 61.94999),\n (111.736951, 61.94999, 159.301806, 61.94999),\n (111.736951, 63.911215, 159.301806, 63.911215),\n (175.263031, 172.04999, 173.301806, 172.04999),\n (173.301806, 172.04999, 173.301806, 77.911215),\n (175.263031, 77.911215, 173.301806, 77.911215),\n (175.263031, 172.04999, 175.263031, 77.911215)\n]\nVISIBLE_CIRCLES = [\n\n]\nVISIBLE_ARCS = [\n\n]\nHIDDEN_SEGMENTS = [\n\n]\n# (orient, text, p1, p2, base) for linear; (orient, text, center, radius, angle) for diameter\nDIMENSIONS = [\n ('horizontal', '50.5263', (159.3018, 77.9112), (111.737, 77.9112), (135.5194, 66.9112)),\n ('vertical', '100', (159.3018, 172.05), (159.3018, 77.9112), (170.3018, 124.9806)),\n ('horizontal', '2.0833', (175.263, 172.05), (173.3018, 172.05), (174.2824, 161.05))\n]\n\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\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\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,\n angle=(0 if d[0] == \"horizontal\" else 90),\n 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,\n 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,\n text=text, dimstyle=\"EZDXF\").render()\n\n doc.saveas(out_path)\n\n\nif __name__ == \"__main__\":\n out = sys.argv[1] if len(sys.argv) > 1 else \"0057_00577623_gt.dxf\"\n draw(out)\n print(\"wrote\", out)\n```"}], "images": ["images/0057_00577623.png"], "id": "0057_00577623"} {"messages": [{"role": "user", "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 66.32 mm wide and 100 mm tall. It is extruded to a thickness of 1.56 mm."}, {"role": "assistant", "content": "```python\n#!/usr/bin/env python3\n# -*- coding: utf-8 -*-\n# Ground-truth 2D engineering drawing for part: 0057_00578973\n# Self-contained: reproduces the three-view DXF via ezdxf, NO FreeCAD needed.\n# Coordinates are A4 page millimetres (scale=0.8835000000000168, page=[297.0, 210.0]).\n# visible edges -> solid (layer OUTLINE); hidden edges -> dashed (layer HIDDEN)\n# dimensions -> real movable DIMENSION entities (text = true mm value)\n# Run: python 0057_00578973_gt.py [out.dxf]\nimport sys\nimport ezdxf\n\nSCALE = 0.8835000000000168\nPAGE = [297.0, 210.0]\n\nVISIBLE_SEGMENTS = [\n (164.414572, 81.2055, 164.414572, 169.5555),\n (105.824573, 81.2055, 164.414572, 81.2055),\n (164.414572, 169.5555, 105.824573, 169.5555),\n (105.824573, 169.5555, 105.824573, 81.2055),\n (164.414572, 64.444562, 164.414572, 67.2055),\n (105.824573, 64.444562, 105.824573, 67.2055),\n (105.824573, 64.444562, 164.414572, 64.444562),\n (105.824573, 67.2055, 164.414572, 67.2055),\n (178.414572, 81.2055, 181.17551, 81.2055),\n (181.17551, 169.5555, 178.414572, 169.5555),\n (178.414572, 169.5555, 178.414572, 81.2055),\n (181.17551, 169.5555, 181.17551, 81.2055)\n]\nVISIBLE_CIRCLES = [\n\n]\nVISIBLE_ARCS = [\n\n]\nHIDDEN_SEGMENTS = [\n\n]\n# (orient, text, p1, p2, base) for linear; (orient, text, center, radius, angle) for diameter\nDIMENSIONS = [\n ('horizontal', '66.3158', (164.4146, 81.2055), (105.8246, 81.2055), (135.1196, 70.2055)),\n ('vertical', '100', (164.4146, 169.5555), (164.4146, 81.2055), (175.4146, 125.3805)),\n ('horizontal', '3.125', (181.1755, 169.5555), (178.4145, 169.5555), (179.795, 158.5555))\n]\n\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\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\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,\n angle=(0 if d[0] == \"horizontal\" else 90),\n 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,\n 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,\n text=text, dimstyle=\"EZDXF\").render()\n\n doc.saveas(out_path)\n\n\nif __name__ == \"__main__\":\n out = sys.argv[1] if len(sys.argv) > 1 else \"0057_00578973_gt.dxf\"\n draw(out)\n print(\"wrote\", out)\n```"}], "images": ["images/0057_00578973.png"], "id": "0057_00578973"} {"messages": [{"role": "user", "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. It is extruded to a thickness of 66.67 mm."}, {"role": "assistant", "content": "```python\n#!/usr/bin/env python3\n# -*- coding: utf-8 -*-\n# Ground-truth 2D engineering drawing for part: 0058_00580205\n# Self-contained: reproduces the three-view DXF via ezdxf, NO FreeCAD needed.\n# Coordinates are A4 page millimetres (scale=0.7847707736390079, page=[297.0, 210.0]).\n# visible edges -> solid (layer OUTLINE); hidden edges -> dashed (layer HIDDEN)\n# dimensions -> real movable DIMENSION entities (text = true mm value)\n# Run: python 0058_00580205_gt.py [out.dxf]\nimport sys\nimport ezdxf\n\nSCALE = 0.7847707736390079\nPAGE = [297.0, 210.0]\n\nVISIBLE_SEGMENTS = [\n (149.579505, 128.268031, 149.579505, 172.049979),\n (149.579505, 172.049979, 71.102428, 172.049979),\n (71.102428, 172.049979, 71.102428, 128.268031),\n (71.102428, 128.268031, 149.579505, 128.268031),\n (149.579505, 114.268031, 149.579505, 61.949979),\n (71.102428, 114.268031, 71.102428, 61.949979),\n (71.102428, 61.949979, 149.579505, 61.949979),\n (71.102428, 114.268031, 149.579505, 114.268031),\n (215.897557, 172.049979, 163.579505, 172.049979),\n (163.579505, 172.049979, 163.579505, 128.268031),\n (215.897557, 128.268031, 163.579505, 128.268031),\n (215.897557, 172.049979, 215.897557, 128.268031)\n]\nVISIBLE_CIRCLES = [\n\n]\nVISIBLE_ARCS = [\n\n]\nHIDDEN_SEGMENTS = [\n\n]\n# (orient, text, p1, p2, base) for linear; (orient, text, center, radius, angle) for diameter\nDIMENSIONS = [\n ('horizontal', '100', (149.5795, 128.268), (71.1024, 128.268), (110.341, 117.268)),\n ('vertical', '55.7895', (149.5795, 172.05), (149.5795, 128.268), (160.5795, 150.159)),\n ('horizontal', '66.6667', (215.8976, 172.05), (163.5795, 172.05), (189.7385, 161.05))\n]\n\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\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\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,\n angle=(0 if d[0] == \"horizontal\" else 90),\n 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,\n 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,\n text=text, dimstyle=\"EZDXF\").render()\n\n doc.saveas(out_path)\n\n\nif __name__ == \"__main__\":\n out = sys.argv[1] if len(sys.argv) > 1 else \"0058_00580205_gt.dxf\"\n draw(out)\n print(\"wrote\", out)\n```"}], "images": ["images/0058_00580205.png"], "id": "0058_00580205"} {"messages": [{"role": "user", "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.27 mm."}, {"role": "assistant", "content": "```python\n#!/usr/bin/env python3\n# -*- coding: utf-8 -*-\n# Ground-truth 2D engineering drawing for part: 0058_00580410\n# Self-contained: reproduces the three-view DXF via ezdxf, NO FreeCAD needed.\n# Coordinates are A4 page millimetres (scale=1.0475626794258963, page=[297.0, 210.0]).\n# visible edges -> solid (layer OUTLINE); hidden edges -> dashed (layer HIDDEN)\n# dimensions -> real movable DIMENSION entities (text = true mm value)\n# Run: python 0058_00580410_gt.py [out.dxf]\nimport sys\nimport ezdxf\n\nSCALE = 1.0475626794258963\nPAGE = [297.0, 210.0]\n\nVISIBLE_SEGMENTS = [\n (167.786247, 166.043104, 167.786247, 124.140597),\n (167.786247, 124.140597, 63.029979, 124.140597),\n (63.029979, 124.140597, 63.029979, 166.043104),\n (63.029979, 166.043104, 167.786247, 166.043104),\n (167.786247, 67.956865, 167.786247, 110.140597),\n (167.786247, 110.140597, 63.029979, 110.140597),\n (63.029979, 67.956865, 63.029979, 110.140597),\n (167.786247, 67.956865, 63.029979, 67.956865),\n (181.786247, 124.140597, 223.969979, 124.140597),\n (223.969979, 124.140597, 223.969979, 166.043104),\n (181.786247, 166.043104, 223.969979, 166.043104),\n (181.786247, 124.140597, 181.786247, 166.043104)\n]\nVISIBLE_CIRCLES = [\n\n]\nVISIBLE_ARCS = [\n\n]\nHIDDEN_SEGMENTS = [\n\n]\n# (orient, text, p1, p2, base) for linear; (orient, text, center, radius, angle) for diameter\nDIMENSIONS = [\n ('horizontal', '100', (167.7862, 166.0431), (63.03, 166.0431), (115.4081, 155.0431)),\n ('vertical', '40', (167.7862, 124.1406), (167.7862, 166.0431), (156.7862, 145.0919)),\n ('horizontal', '40.2685', (181.7863, 124.1406), (223.97, 124.1406), (202.8782, 135.1406))\n]\n\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\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\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,\n angle=(0 if d[0] == \"horizontal\" else 90),\n 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,\n 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,\n text=text, dimstyle=\"EZDXF\").render()\n\n doc.saveas(out_path)\n\n\nif __name__ == \"__main__\":\n out = sys.argv[1] if len(sys.argv) > 1 else \"0058_00580410_gt.dxf\"\n draw(out)\n print(\"wrote\", out)\n```"}], "images": ["images/0058_00580410.png"], "id": "0058_00580410"} {"messages": [{"role": "user", "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 33.68 mm."}, {"role": "assistant", "content": "```python\n#!/usr/bin/env python3\n# -*- coding: utf-8 -*-\n# Ground-truth 2D engineering drawing for part: 0058_00584211\n# Self-contained: reproduces the three-view DXF via ezdxf, NO FreeCAD needed.\n# Coordinates are A4 page millimetres (scale=0.7188582677165665, page=[297.0, 210.0]).\n# visible edges -> solid (layer OUTLINE); hidden edges -> dashed (layer HIDDEN)\n# dimensions -> real movable DIMENSION entities (text = true mm value)\n# Run: python 0058_00584211_gt.py [out.dxf]\nimport sys\nimport ezdxf\n\nSCALE = 0.7188582677165665\nPAGE = [297.0, 210.0]\n\nVISIBLE_SEGMENTS = [\n (160.335811, 100.164184, 160.335811, 172.050011),\n (160.335811, 172.050011, 88.449984, 172.050011),\n (88.449984, 172.050011, 88.449984, 100.164184),\n (88.449984, 100.164184, 160.335811, 100.164184),\n (160.335811, 86.164184, 160.335811, 61.950011),\n (88.449984, 86.164184, 88.449984, 61.950011),\n (88.449984, 61.950011, 160.335811, 61.950011),\n (88.449984, 86.164184, 160.335811, 86.164184),\n (198.549984, 172.050011, 174.335811, 172.050011),\n (174.335811, 172.050011, 174.335811, 100.164184),\n (198.549984, 100.164184, 174.335811, 100.164184),\n (198.549984, 172.050011, 198.549984, 100.164184)\n]\nVISIBLE_CIRCLES = [\n\n]\nVISIBLE_ARCS = [\n\n]\nHIDDEN_SEGMENTS = [\n\n]\n# (orient, text, p1, p2, base) for linear; (orient, text, center, radius, angle) for diameter\nDIMENSIONS = [\n ('horizontal', '100', (160.3358, 100.1642), (88.45, 100.1642), (124.3929, 89.1642)),\n ('vertical', '100', (160.3358, 172.05), (160.3358, 100.1642), (171.3358, 136.1071)),\n ('horizontal', '33.6842', (198.55, 172.05), (174.3358, 172.05), (186.4429, 161.05))\n]\n\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\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\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,\n angle=(0 if d[0] == \"horizontal\" else 90),\n 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,\n 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,\n text=text, dimstyle=\"EZDXF\").render()\n\n doc.saveas(out_path)\n\n\nif __name__ == \"__main__\":\n out = sys.argv[1] if len(sys.argv) > 1 else \"0058_00584211_gt.dxf\"\n draw(out)\n print(\"wrote\", out)\n```"}], "images": ["images/0058_00584211.png"], "id": "0058_00584211"} {"messages": [{"role": "user", "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.04 mm."}, {"role": "assistant", "content": "```python\n#!/usr/bin/env python3\n# -*- coding: utf-8 -*-\n# Ground-truth 2D engineering drawing for part: 0058_00587169\n# Self-contained: reproduces the three-view DXF via ezdxf, NO FreeCAD needed.\n# Coordinates are A4 page millimetres (scale=0.7346999999999999, page=[297.0, 210.0]).\n# visible edges -> solid (layer OUTLINE); hidden edges -> dashed (layer HIDDEN)\n# dimensions -> real movable DIMENSION entities (text = true mm value)\n# Run: python 0058_00587169_gt.py [out.dxf]\nimport sys\nimport ezdxf\n\nSCALE = 0.7346999999999999\nPAGE = [297.0, 210.0]\n\nVISIBLE_SEGMENTS = [\n (172.852317, 87.6477, 172.852317, 161.1177),\n (172.852317, 161.1177, 99.382317, 161.1177),\n (99.382317, 161.1177, 99.382317, 87.6477),\n (99.382317, 87.6477, 172.852317, 87.6477),\n (172.852317, 73.6477, 172.852317, 72.882387),\n (99.382317, 73.6477, 99.382317, 72.882387),\n (99.382317, 72.882387, 172.852317, 72.882387),\n (99.382317, 73.6477, 172.852317, 73.6477),\n (187.61763, 161.1177, 186.852317, 161.1177),\n (186.852317, 161.1177, 186.852317, 87.6477),\n (187.61763, 87.6477, 186.852317, 87.6477),\n (187.61763, 161.1177, 187.61763, 87.6477)\n]\nVISIBLE_CIRCLES = [\n\n]\nVISIBLE_ARCS = [\n\n]\nHIDDEN_SEGMENTS = [\n\n]\n# (orient, text, p1, p2, base) for linear; (orient, text, center, radius, angle) for diameter\nDIMENSIONS = [\n ('horizontal', '100', (172.8523, 87.6477), (99.3823, 87.6477), (136.1173, 76.6477)),\n ('vertical', '100', (172.8523, 161.1177), (172.8523, 87.6477), (183.8523, 124.3827)),\n ('horizontal', '1.0417', (187.6177, 161.1177), (186.8523, 161.1177), (187.235, 150.1177))\n]\n\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\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\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,\n angle=(0 if d[0] == \"horizontal\" else 90),\n 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,\n 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,\n text=text, dimstyle=\"EZDXF\").render()\n\n doc.saveas(out_path)\n\n\nif __name__ == \"__main__\":\n out = sys.argv[1] if len(sys.argv) > 1 else \"0058_00587169_gt.dxf\"\n draw(out)\n print(\"wrote\", out)\n```"}], "images": ["images/0058_00587169.png"], "id": "0058_00587169"} {"messages": [{"role": "user", "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 94.74 mm tall. It is extruded to a thickness of 37.5 mm."}, {"role": "assistant", "content": "```python\n#!/usr/bin/env python3\n# -*- coding: utf-8 -*-\n# Ground-truth 2D engineering drawing for part: 0058_00589558\n# Self-contained: reproduces the three-view DXF via ezdxf, NO FreeCAD needed.\n# Coordinates are A4 page millimetres (scale=0.7267263681592048, page=[297.0, 210.0]).\n# visible edges -> solid (layer OUTLINE); hidden edges -> dashed (layer HIDDEN)\n# dimensions -> real movable DIMENSION entities (text = true mm value)\n# Run: python 0058_00589558_gt.py [out.dxf]\nimport sys\nimport ezdxf\n\nSCALE = 0.7267263681592048\nPAGE = [297.0, 210.0]\n\nVISIBLE_SEGMENTS = [\n (159.2102, 172.049977, 159.2102, 103.202216),\n (159.2102, 103.202216, 86.537563, 103.202216),\n (86.537563, 103.202216, 86.537563, 172.049977),\n (86.537563, 172.049977, 159.2102, 172.049977),\n (159.2102, 61.949977, 159.2102, 89.202216),\n (159.2102, 89.202216, 86.537563, 89.202216),\n (86.537563, 61.949977, 86.537563, 89.202216),\n (159.2102, 61.949977, 86.537563, 61.949977),\n (173.2102, 103.202216, 200.462438, 103.202216),\n (200.462438, 103.202216, 200.462438, 172.049977),\n (173.2102, 172.049977, 200.462438, 172.049977),\n (173.2102, 103.202216, 173.2102, 172.049977)\n]\nVISIBLE_CIRCLES = [\n\n]\nVISIBLE_ARCS = [\n\n]\nHIDDEN_SEGMENTS = [\n\n]\n# (orient, text, p1, p2, base) for linear; (orient, text, center, radius, angle) for diameter\nDIMENSIONS = [\n ('horizontal', '100', (159.2102, 172.05), (86.5376, 172.05), (122.8739, 161.05)),\n ('vertical', '94.7368', (159.2102, 103.2022), (159.2102, 172.05), (148.2102, 137.6261)),\n ('horizontal', '37.5', (173.2102, 103.2022), (200.4624, 103.2022), (186.8363, 114.2022))\n]\n\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\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\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,\n angle=(0 if d[0] == \"horizontal\" else 90),\n 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,\n 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,\n text=text, dimstyle=\"EZDXF\").render()\n\n doc.saveas(out_path)\n\n\nif __name__ == \"__main__\":\n out = sys.argv[1] if len(sys.argv) > 1 else \"0058_00589558_gt.dxf\"\n draw(out)\n print(\"wrote\", out)\n```"}], "images": ["images/0058_00589558.png"], "id": "0058_00589558"} {"messages": [{"role": "user", "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 48.42 mm wide and 100 mm tall. It is extruded to a thickness of 2400 mm."}, {"role": "assistant", "content": "```python\n#!/usr/bin/env python3\n# -*- coding: utf-8 -*-\n# Ground-truth 2D engineering drawing for part: 0059_00591821\n# Self-contained: reproduces the three-view DXF via ezdxf, NO FreeCAD needed.\n# Coordinates are A4 page millimetres (scale=0.03844, page=[297.0, 210.0]).\n# visible edges -> solid (layer OUTLINE); hidden edges -> dashed (layer HIDDEN)\n# dimensions -> real movable DIMENSION entities (text = true mm value)\n# Run: python 0059_00591821_gt.py [out.dxf]\nimport sys\nimport ezdxf\n\nSCALE = 0.03844\nPAGE = [297.0, 210.0]\n\nVISIBLE_SEGMENTS = [\n (91.302681, 168.206, 91.302681, 172.05),\n (91.302681, 172.05, 89.441376, 172.05),\n (89.441376, 172.05, 89.441376, 168.206),\n (89.441376, 168.206, 91.302681, 168.206),\n (91.302681, 154.206, 91.302681, 61.95),\n (89.441376, 154.206, 89.441376, 61.95),\n (89.441376, 61.95, 91.302681, 61.95),\n (89.441376, 154.206, 91.302681, 154.206),\n (197.558681, 172.05, 105.302681, 172.05),\n (105.302681, 172.05, 105.302681, 168.206),\n (197.558681, 168.206, 105.302681, 168.206),\n (197.558681, 172.05, 197.558681, 168.206)\n]\nVISIBLE_CIRCLES = [\n\n]\nVISIBLE_ARCS = [\n\n]\nHIDDEN_SEGMENTS = [\n\n]\n# (orient, text, p1, p2, base) for linear; (orient, text, center, radius, angle) for diameter\nDIMENSIONS = [\n ('horizontal', '48.4211', (91.3027, 168.206), (89.4413, 168.206), (90.372, 157.206)),\n ('vertical', '100', (91.3027, 172.05), (91.3027, 168.206), (102.3027, 170.128)),\n ('horizontal', '2400', (197.5587, 172.05), (105.3027, 172.05), (151.4307, 161.05))\n]\n\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\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\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,\n angle=(0 if d[0] == \"horizontal\" else 90),\n 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,\n 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,\n text=text, dimstyle=\"EZDXF\").render()\n\n doc.saveas(out_path)\n\n\nif __name__ == \"__main__\":\n out = sys.argv[1] if len(sys.argv) > 1 else \"0059_00591821_gt.dxf\"\n draw(out)\n print(\"wrote\", out)\n```"}], "images": ["images/0059_00591821.png"], "id": "0059_00591821"} {"messages": [{"role": "user", "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 49.47 mm tall. It is extruded to a thickness of 2.08 mm."}, {"role": "assistant", "content": "```python\n#!/usr/bin/env python3\n# -*- coding: utf-8 -*-\n# Ground-truth 2D engineering drawing for part: 0059_00595409\n# Self-contained: reproduces the three-view DXF via ezdxf, NO FreeCAD needed.\n# Coordinates are A4 page millimetres (scale=1.4394122448979638, page=[297.0, 210.0]).\n# visible edges -> solid (layer OUTLINE); hidden edges -> dashed (layer HIDDEN)\n# dimensions -> real movable DIMENSION entities (text = true mm value)\n# Run: python 0059_00595409_gt.py [out.dxf]\nimport sys\nimport ezdxf\n\nSCALE = 1.4394122448979638\nPAGE = [297.0, 210.0]\n\nVISIBLE_SEGMENTS = [\n (206.97121, 161.105856, 206.97121, 89.892829),\n (206.97121, 89.892829, 63.029985, 89.892829),\n (63.029985, 89.892829, 63.029985, 161.105856),\n (63.029985, 161.105856, 206.97121, 161.105856),\n (206.97121, 72.894054, 206.97121, 75.892829),\n (206.97121, 75.892829, 63.029985, 75.892829),\n (63.029985, 72.894054, 63.029985, 75.892829),\n (206.97121, 72.894054, 63.029985, 72.894054),\n (220.97121, 89.892829, 223.969985, 89.892829),\n (223.969985, 89.892829, 223.969985, 161.105856),\n (220.97121, 161.105856, 223.969985, 161.105856),\n (220.97121, 89.892829, 220.97121, 161.105856)\n]\nVISIBLE_CIRCLES = [\n\n]\nVISIBLE_ARCS = [\n\n]\nHIDDEN_SEGMENTS = [\n\n]\n# (orient, text, p1, p2, base) for linear; (orient, text, center, radius, angle) for diameter\nDIMENSIONS = [\n ('horizontal', '100', (206.9712, 161.1059), (63.03, 161.1059), (135.0006, 150.1059)),\n ('vertical', '49.4737', (206.9712, 89.8928), (206.9712, 161.1059), (195.9712, 125.4994)),\n ('horizontal', '2.0833', (220.9712, 89.8928), (223.97, 89.8928), (222.4706, 100.8928))\n]\n\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\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\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,\n angle=(0 if d[0] == \"horizontal\" else 90),\n 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,\n 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,\n text=text, dimstyle=\"EZDXF\").render()\n\n doc.saveas(out_path)\n\n\nif __name__ == \"__main__\":\n out = sys.argv[1] if len(sys.argv) > 1 else \"0059_00595409_gt.dxf\"\n draw(out)\n print(\"wrote\", out)\n```"}], "images": ["images/0059_00595409.png"], "id": "0059_00595409"} {"messages": [{"role": "user", "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 21.05 mm wide and 100 mm tall. It is extruded to a thickness of 1.04 mm."}, {"role": "assistant", "content": "```python\n#!/usr/bin/env python3\n# -*- coding: utf-8 -*-\n# Ground-truth 2D engineering drawing for part: 0060_00600393\n# Self-contained: reproduces the three-view DXF via ezdxf, NO FreeCAD needed.\n# Coordinates are A4 page millimetres (scale=0.9510927835051515, page=[297.0, 210.0]).\n# visible edges -> solid (layer OUTLINE); hidden edges -> dashed (layer HIDDEN)\n# dimensions -> real movable DIMENSION entities (text = true mm value)\n# Run: python 0060_00600393_gt.py [out.dxf]\nimport sys\nimport ezdxf\n\nSCALE = 0.9510927835051515\nPAGE = [297.0, 210.0]\n\nVISIBLE_SEGMENTS = [\n (146.016117, 172.049987, 146.016117, 76.940709),\n (146.016117, 76.940709, 125.993111, 76.940709),\n (125.993111, 76.940709, 125.993111, 172.049987),\n (125.993111, 172.049987, 146.016117, 172.049987),\n (146.016117, 61.949987, 146.016117, 62.940709),\n (146.016117, 62.940709, 125.993111, 62.940709),\n (125.993111, 61.949987, 125.993111, 62.940709),\n (146.016117, 61.949987, 125.993111, 61.949987),\n (160.016117, 76.940709, 161.006839, 76.940709),\n (161.006839, 76.940709, 161.006839, 172.049987),\n (160.016117, 172.049987, 161.006839, 172.049987),\n (160.016117, 76.940709, 160.016117, 172.049987)\n]\nVISIBLE_CIRCLES = [\n\n]\nVISIBLE_ARCS = [\n\n]\nHIDDEN_SEGMENTS = [\n\n]\n# (orient, text, p1, p2, base) for linear; (orient, text, center, radius, angle) for diameter\nDIMENSIONS = [\n ('horizontal', '21.0526', (146.0161, 172.05), (125.9931, 172.05), (136.0046, 161.05)),\n ('vertical', '100', (146.0161, 76.9407), (146.0161, 172.05), (135.0161, 124.4954)),\n ('horizontal', '1.0417', (160.0161, 76.9407), (161.0069, 76.9407), (160.5115, 87.9407))\n]\n\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\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\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,\n angle=(0 if d[0] == \"horizontal\" else 90),\n 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,\n 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,\n text=text, dimstyle=\"EZDXF\").render()\n\n doc.saveas(out_path)\n\n\nif __name__ == \"__main__\":\n out = sys.argv[1] if len(sys.argv) > 1 else \"0060_00600393_gt.dxf\"\n draw(out)\n print(\"wrote\", out)\n```"}], "images": ["images/0060_00600393.png"], "id": "0060_00600393"} {"messages": [{"role": "user", "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 66.32 mm tall. It is extruded to a thickness of 20.63 mm."}, {"role": "assistant", "content": "```python\n#!/usr/bin/env python3\n# -*- coding: utf-8 -*-\n# Ground-truth 2D engineering drawing for part: 0060_00606020\n# Self-contained: reproduces the three-view DXF via ezdxf, NO FreeCAD needed.\n# Coordinates are A4 page millimetres (scale=0.8835000000000274, page=[297.0, 210.0]).\n# visible edges -> solid (layer OUTLINE); hidden edges -> dashed (layer HIDDEN)\n# dimensions -> real movable DIMENSION entities (text = true mm value)\n# Run: python 0060_00606020_gt.py [out.dxf]\nimport sys\nimport ezdxf\n\nSCALE = 0.8835000000000274\nPAGE = [297.0, 210.0]\n\nVISIBLE_SEGMENTS = [\n (171.55951, 103.82044, 171.55951, 162.41044),\n (171.55951, 162.41044, 83.20951, 162.41044),\n (83.20951, 162.41044, 83.20951, 103.82044),\n (83.20951, 103.82044, 171.55951, 103.82044),\n (171.55951, 89.82044, 171.55951, 71.589488),\n (83.20951, 89.82044, 83.20951, 71.589488),\n (83.20951, 71.589488, 171.55951, 71.589488),\n (83.20951, 89.82044, 171.55951, 89.82044),\n (203.790462, 162.41044, 185.55951, 162.41044),\n (185.55951, 162.41044, 185.55951, 103.82044),\n (203.790462, 103.82044, 185.55951, 103.82044),\n (203.790462, 162.41044, 203.790462, 103.82044)\n]\nVISIBLE_CIRCLES = [\n\n]\nVISIBLE_ARCS = [\n\n]\nHIDDEN_SEGMENTS = [\n\n]\n# (orient, text, p1, p2, base) for linear; (orient, text, center, radius, angle) for diameter\nDIMENSIONS = [\n ('horizontal', '100', (171.5595, 103.8205), (83.2095, 103.8205), (127.3845, 92.8205)),\n ('vertical', '66.3158', (171.5595, 162.4104), (171.5595, 103.8205), (182.5595, 133.1155)),\n ('horizontal', '20.6349', (203.7905, 162.4104), (185.5595, 162.4104), (194.675, 151.4104))\n]\n\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\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\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,\n angle=(0 if d[0] == \"horizontal\" else 90),\n 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,\n 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,\n text=text, dimstyle=\"EZDXF\").render()\n\n doc.saveas(out_path)\n\n\nif __name__ == \"__main__\":\n out = sys.argv[1] if len(sys.argv) > 1 else \"0060_00606020_gt.dxf\"\n draw(out)\n print(\"wrote\", out)\n```"}], "images": ["images/0060_00606020.png"], "id": "0060_00606020"} {"messages": [{"role": "user", "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 -399.93 mm. The outline includes one or more oblique (angled) edges."}, {"role": "assistant", "content": "```python\n#!/usr/bin/env python3\n# -*- coding: utf-8 -*-\n# Ground-truth 2D engineering drawing for part: 0060_00607776\n# Self-contained: reproduces the three-view DXF via ezdxf, NO FreeCAD needed.\n# Coordinates are A4 page millimetres (scale=0.16784958166075492, page=[297.0, 210.0]).\n# visible edges -> solid (layer OUTLINE); hidden edges -> dashed (layer HIDDEN)\n# dimensions -> real movable DIMENSION entities (text = true mm value)\n# Run: python 0060_00607776_gt.py [out.dxf]\nimport sys\nimport ezdxf\nimport math\n\nSCALE = 0.16784958166075492\nPAGE = [297.0, 210.0]\n\nVISIBLE_SEGMENTS = [\n (94.632888, 143.078654, 111.238403, 143.078654),\n (111.238403, 143.078654, 119.717815, 157.564315),\n (119.717815, 157.564315, 111.238403, 172.049977),\n (111.238403, 172.049977, 94.632888, 172.049977),\n (94.632888, 172.049977, 86.153476, 157.564315),\n (86.153476, 157.564315, 94.632888, 143.078654),\n (94.632888, 61.949977, 94.632888, 129.078654),\n (94.632888, 129.078654, 111.238403, 129.078654),\n (111.238403, 61.949977, 111.238403, 129.078654),\n (94.632888, 61.949977, 111.238403, 61.949977),\n (111.238403, 129.078654, 119.717815, 129.078654),\n (119.717815, 61.949977, 119.717815, 129.078654),\n (111.238403, 61.949977, 119.717815, 61.949977),\n (86.153476, 61.949977, 86.153476, 129.078654),\n (86.153476, 129.078654, 94.632888, 129.078654),\n (86.153476, 61.949977, 94.632888, 61.949977),\n (133.717815, 143.078654, 200.846491, 143.078654),\n (133.717815, 172.049977, 200.846491, 172.049977),\n (200.846491, 172.049977, 200.846491, 157.564315),\n (133.717815, 157.564315, 200.846491, 157.564315),\n (133.717815, 172.049977, 133.717815, 157.564315),\n (200.846491, 157.564315, 200.846491, 143.078654),\n (133.717815, 157.564315, 133.717815, 143.078654)\n]\nVISIBLE_CIRCLES = [\n\n]\nVISIBLE_ARCS = [\n\n]\nHIDDEN_SEGMENTS = [\n\n]\n# (orient, text, p1, p2, base) for linear; (orient, text, center, radius, angle) for diameter\nDIMENSIONS = [\n ('horizontal', '98.9309', (94.6329, 172.05), (111.2384, 172.05), (102.9357, 183.05)),\n ('aligned', '100', (111.2384, 172.05), (119.7178, 157.5643), (124.9713, 170.3641)),\n ('aligned', '100', (119.7178, 157.5643), (111.2384, 143.0787), (124.9713, 144.7645)),\n ('aligned', '100', (94.6329, 143.0787), (86.1535, 157.5643), (80.9, 144.7645)),\n ('aligned', '100', (86.1535, 157.5643), (94.6329, 172.05), (80.9, 170.3641)),\n ('horizontal', '399.933', (133.7178, 157.5643), (200.8465, 157.5643), (167.2822, 168.5643))\n]\n\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; _ds.dxf.dimasz = 2.5\n _ds.dxf.dimexe = 1.25; _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\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\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,\n angle=(0 if d[0] == \"horizontal\" else 90),\n 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,\n 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,\n 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,\n text=text, dimstyle=\"EZDXF\").render()\n\n doc.saveas(out_path)\n\n\nif __name__ == \"__main__\":\n out = sys.argv[1] if len(sys.argv) > 1 else \"0060_00607776_gt.dxf\"\n draw(out)\n print(\"wrote\", out)\n```"}], "images": ["images/0060_00607776.png"], "id": "0060_00607776"} {"messages": [{"role": "user", "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 1.56 mm."}, {"role": "assistant", "content": "```python\n#!/usr/bin/env python3\n# -*- coding: utf-8 -*-\n# Ground-truth 2D engineering drawing for part: 0060_00608272\n# Self-contained: reproduces the three-view DXF via ezdxf, NO FreeCAD needed.\n# Coordinates are A4 page millimetres (scale=0.9462153846153847, page=[297.0, 210.0]).\n# visible edges -> solid (layer OUTLINE); hidden edges -> dashed (layer HIDDEN)\n# dimensions -> real movable DIMENSION entities (text = true mm value)\n# Run: python 0060_00608272_gt.py [out.dxf]\nimport sys\nimport ezdxf\n\nSCALE = 0.9462153846153847\nPAGE = [297.0, 210.0]\n\nVISIBLE_SEGMENTS = [\n (169.625308, 172.050023, 169.625308, 77.428485),\n (169.625308, 77.428485, 101.896207, 77.428485),\n (101.896207, 77.428485, 101.896207, 172.050023),\n (101.896207, 172.050023, 169.625308, 172.050023),\n (169.625308, 61.950023, 169.625308, 63.428485),\n (169.625308, 63.428485, 101.896207, 63.428485),\n (101.896207, 61.950023, 101.896207, 63.428485),\n (169.625308, 61.950023, 101.896207, 61.950023),\n (183.625308, 77.428485, 185.103769, 77.428485),\n (185.103769, 77.428485, 185.103769, 172.050023),\n (183.625308, 172.050023, 185.103769, 172.050023),\n (183.625308, 77.428485, 183.625308, 172.050023)\n]\nVISIBLE_CIRCLES = [\n\n]\nVISIBLE_ARCS = [\n\n]\nHIDDEN_SEGMENTS = [\n\n]\n# (orient, text, p1, p2, base) for linear; (orient, text, center, radius, angle) for diameter\nDIMENSIONS = [\n ('horizontal', '71.5789', (169.6253, 172.05), (101.8962, 172.05), (135.7607, 161.05)),\n ('vertical', '100', (169.6253, 77.4285), (169.6253, 172.05), (158.6253, 124.7392)),\n ('horizontal', '1.5625', (183.6253, 77.4285), (185.1038, 77.4285), (184.3646, 88.4285))\n]\n\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\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\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,\n angle=(0 if d[0] == \"horizontal\" else 90),\n 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,\n 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,\n text=text, dimstyle=\"EZDXF\").render()\n\n doc.saveas(out_path)\n\n\nif __name__ == \"__main__\":\n out = sys.argv[1] if len(sys.argv) > 1 else \"0060_00608272_gt.dxf\"\n draw(out)\n print(\"wrote\", out)\n```"}], "images": ["images/0060_00608272.png"], "id": "0060_00608272"} {"messages": [{"role": "user", "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 9600 mm."}, {"role": "assistant", "content": "```python\n#!/usr/bin/env python3\n# -*- coding: utf-8 -*-\n# Ground-truth 2D engineering drawing for part: 0061_00614648\n# Self-contained: reproduces the three-view DXF via ezdxf, NO FreeCAD needed.\n# Coordinates are A4 page millimetres (scale=0.00990721649484536, page=[297.0, 210.0]).\n# visible edges -> solid (layer OUTLINE); hidden edges -> dashed (layer HIDDEN)\n# dimensions -> real movable DIMENSION entities (text = true mm value)\n# Run: python 0061_00614648_gt.py [out.dxf]\nimport sys\nimport ezdxf\n\nSCALE = 0.00990721649484536\nPAGE = [297.0, 210.0]\n\nVISIBLE_SEGMENTS = [\n (89.440709, 171.059287, 89.440709, 172.050009),\n (89.440709, 172.050009, 88.449987, 172.050009),\n (88.449987, 172.050009, 88.449987, 171.059287),\n (88.449987, 171.059287, 89.440709, 171.059287),\n (89.440709, 157.059287, 89.440709, 61.950009),\n (88.449987, 157.059287, 88.449987, 61.950009),\n (88.449987, 61.950009, 89.440709, 61.950009),\n (88.449987, 157.059287, 89.440709, 157.059287),\n (198.549987, 172.050009, 103.440709, 172.050009),\n (103.440709, 172.050009, 103.440709, 171.059287),\n (198.549987, 171.059287, 103.440709, 171.059287),\n (198.549987, 172.050009, 198.549987, 171.059287)\n]\nVISIBLE_CIRCLES = [\n\n]\nVISIBLE_ARCS = [\n\n]\nHIDDEN_SEGMENTS = [\n\n]\n# (orient, text, p1, p2, base) for linear; (orient, text, center, radius, angle) for diameter\nDIMENSIONS = [\n ('horizontal', '100', (89.4407, 171.0593), (88.45, 171.0593), (88.9454, 160.0593)),\n ('vertical', '100', (89.4407, 172.05), (89.4407, 171.0593), (100.4407, 171.5546)),\n ('horizontal', '9600', (198.55, 172.05), (103.4407, 172.05), (150.9954, 161.05))\n]\n\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\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\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,\n angle=(0 if d[0] == \"horizontal\" else 90),\n 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,\n 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,\n text=text, dimstyle=\"EZDXF\").render()\n\n doc.saveas(out_path)\n\n\nif __name__ == \"__main__\":\n out = sys.argv[1] if len(sys.argv) > 1 else \"0061_00614648_gt.dxf\"\n draw(out)\n print(\"wrote\", out)\n```"}], "images": ["images/0061_00614648.png"], "id": "0061_00614648"} {"messages": [{"role": "user", "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 53.68 mm tall. It is extruded to a thickness of 38.54 mm."}, {"role": "assistant", "content": "```python\n#!/usr/bin/env python3\n# -*- coding: utf-8 -*-\n# Ground-truth 2D engineering drawing for part: 0061_00615898\n# Self-contained: reproduces the three-view DXF via ezdxf, NO FreeCAD needed.\n# Coordinates are A4 page millimetres (scale=1.042006895731819, page=[297.0, 210.0]).\n# visible edges -> solid (layer OUTLINE); hidden edges -> dashed (layer HIDDEN)\n# dimensions -> real movable DIMENSION entities (text = true mm value)\n# Run: python 0061_00615898_gt.py [out.dxf]\nimport sys\nimport ezdxf\nimport math\n\nSCALE = 1.042006895731819\nPAGE = [297.0, 210.0]\n\nVISIBLE_SEGMENTS = [\n (168.520001, 172.050011, 168.520001, 116.110693),\n (168.520001, 116.110693, 64.319312, 116.110693),\n (64.319312, 116.110693, 64.319312, 172.050011),\n (64.319312, 172.050011, 168.520001, 172.050011),\n (168.520001, 61.950011, 168.520001, 102.110693),\n (168.520001, 102.110693, 64.319312, 102.110693),\n (64.319312, 61.950011, 64.319312, 102.110693),\n (168.520001, 61.950011, 64.319312, 61.950011),\n (182.520001, 116.110693, 222.680684, 116.110693),\n (222.680684, 116.110693, 222.680684, 172.050011),\n (182.520001, 172.050011, 222.680684, 172.050011),\n (182.520001, 116.110693, 182.520001, 172.050011)\n]\nVISIBLE_CIRCLES = [\n\n]\nVISIBLE_ARCS = [\n\n]\nHIDDEN_SEGMENTS = [\n\n]\n# (orient, text, p1, p2, base) for linear; (orient, text, center, radius, angle) for diameter\nDIMENSIONS = [\n ('horizontal', '100', (168.52, 172.05), (64.3193, 172.05), (116.4197, 161.05)),\n ('vertical', '53.6842', (168.52, 116.1107), (168.52, 172.05), (157.52, 144.0804)),\n ('horizontal', '38.5417', (182.52, 116.1107), (222.6807, 116.1107), (202.6004, 127.1107))\n]\n\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\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\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,\n angle=(0 if d[0] == \"horizontal\" else 90),\n 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,\n 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,\n 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,\n text=text, dimstyle=\"EZDXF\").render()\n\n doc.saveas(out_path)\n\n\nif __name__ == \"__main__\":\n out = sys.argv[1] if len(sys.argv) > 1 else \"0061_00615898_gt.dxf\"\n draw(out)\n print(\"wrote\", out)\n```"}], "images": ["images/0061_00615898.png"], "id": "0061_00615898"} {"messages": [{"role": "user", "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 66.67 mm."}, {"role": "assistant", "content": "```python\n#!/usr/bin/env python3\n# -*- coding: utf-8 -*-\n# Ground-truth 2D engineering drawing for part: 0061_00617299\n# Self-contained: reproduces the three-view DXF via ezdxf, NO FreeCAD needed.\n# Coordinates are A4 page millimetres (scale=0.7586842105263197, page=[297.0, 210.0]).\n# visible edges -> solid (layer OUTLINE); hidden edges -> dashed (layer HIDDEN)\n# dimensions -> real movable DIMENSION entities (text = true mm value)\n# Run: python 0061_00617299_gt.py [out.dxf]\nimport sys\nimport ezdxf\nimport math\n\nSCALE = 0.7586842105263197\nPAGE = [297.0, 210.0]\n\nVISIBLE_SEGMENTS = [\n (149.144715, 172.050032, 149.144715, 126.528979),\n (149.144715, 126.528979, 73.276294, 126.528979),\n (73.276294, 126.528979, 73.276294, 172.050032),\n (73.276294, 172.050032, 149.144715, 172.050032),\n (149.144715, 61.950032, 149.144715, 112.528979),\n (149.144715, 112.528979, 73.276294, 112.528979),\n (73.276294, 61.950032, 73.276294, 112.528979),\n (149.144715, 61.950032, 73.276294, 61.950032),\n (163.144715, 126.528979, 213.723662, 126.528979),\n (213.723662, 126.528979, 213.723662, 172.050032),\n (163.144715, 172.050032, 213.723662, 172.050032),\n (163.144715, 126.528979, 163.144715, 172.050032)\n]\nVISIBLE_CIRCLES = [\n\n]\nVISIBLE_ARCS = [\n\n]\nHIDDEN_SEGMENTS = [\n\n]\n# (orient, text, p1, p2, base) for linear; (orient, text, center, radius, angle) for diameter\nDIMENSIONS = [\n ('horizontal', '100', (149.1447, 172.05), (73.2763, 172.05), (111.2105, 161.05)),\n ('vertical', '60', (149.1447, 126.529), (149.1447, 172.05), (138.1447, 149.2895)),\n ('horizontal', '66.6667', (163.1447, 126.529), (213.7237, 126.529), (188.4342, 137.529))\n]\n\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\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\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,\n angle=(0 if d[0] == \"horizontal\" else 90),\n 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,\n 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,\n 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,\n text=text, dimstyle=\"EZDXF\").render()\n\n doc.saveas(out_path)\n\n\nif __name__ == \"__main__\":\n out = sys.argv[1] if len(sys.argv) > 1 else \"0061_00617299_gt.dxf\"\n draw(out)\n print(\"wrote\", out)\n```"}], "images": ["images/0061_00617299.png"], "id": "0061_00617299"} {"messages": [{"role": "user", "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 100 mm."}, {"role": "assistant", "content": "```python\n#!/usr/bin/env python3\n# -*- coding: utf-8 -*-\n# Ground-truth 2D engineering drawing for part: 0061_00619089\n# Self-contained: reproduces the three-view DXF via ezdxf, NO FreeCAD needed.\n# Coordinates are A4 page millimetres (scale=0.4805, page=[297.0, 210.0]).\n# visible edges -> solid (layer OUTLINE); hidden edges -> dashed (layer HIDDEN)\n# dimensions -> real movable DIMENSION entities (text = true mm value)\n# Run: python 0061_00619089_gt.py [out.dxf]\nimport sys\nimport ezdxf\nimport math\n\nSCALE = 0.4805\nPAGE = [297.0, 210.0]\n\nVISIBLE_SEGMENTS = [\n (136.247102, 172.05, 136.247102, 124.0),\n (136.247102, 124.0, 88.702892, 124.0),\n (88.702892, 124.0, 88.702892, 172.05),\n (88.702892, 172.05, 136.247102, 172.05),\n (136.247102, 61.95, 136.247102, 110.0),\n (136.247102, 110.0, 88.702892, 110.0),\n (88.702892, 61.95, 88.702892, 110.0),\n (136.247102, 61.95, 88.702892, 61.95),\n (150.247102, 124.0, 198.297102, 124.0),\n (198.297102, 124.0, 198.297102, 172.05),\n (150.247102, 172.05, 198.297102, 172.05),\n (150.247102, 124.0, 150.247102, 172.05)\n]\nVISIBLE_CIRCLES = [\n\n]\nVISIBLE_ARCS = [\n\n]\nHIDDEN_SEGMENTS = [\n\n]\n# (orient, text, p1, p2, base) for linear; (orient, text, center, radius, angle) for diameter\nDIMENSIONS = [\n ('horizontal', '98.9474', (136.2471, 172.05), (88.7029, 172.05), (112.475, 161.05)),\n ('vertical', '100', (136.2471, 124.0), (136.2471, 172.05), (125.2471, 148.025)),\n ('horizontal', '100', (150.2471, 124.0), (198.2971, 124.0), (174.2721, 135.0))\n]\n\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\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\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,\n angle=(0 if d[0] == \"horizontal\" else 90),\n 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,\n 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,\n 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,\n text=text, dimstyle=\"EZDXF\").render()\n\n doc.saveas(out_path)\n\n\nif __name__ == \"__main__\":\n out = sys.argv[1] if len(sys.argv) > 1 else \"0061_00619089_gt.dxf\"\n draw(out)\n print(\"wrote\", out)\n```"}], "images": ["images/0061_00619089.png"], "id": "0061_00619089"} {"messages": [{"role": "user", "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 0.63 mm."}, {"role": "assistant", "content": "```python\n#!/usr/bin/env python3\n# -*- coding: utf-8 -*-\n# Ground-truth 2D engineering drawing for part: 0062_00625008\n# Self-contained: reproduces the three-view DXF via ezdxf, NO FreeCAD needed.\n# Coordinates are A4 page millimetres (scale=1.4602162500000735, page=[297.0, 210.0]).\n# visible edges -> solid (layer OUTLINE); hidden edges -> dashed (layer HIDDEN)\n# dimensions -> real movable DIMENSION entities (text = true mm value)\n# Run: python 0062_00625008_gt.py [out.dxf]\nimport sys\nimport ezdxf\nimport math\n\nSCALE = 1.4602162500000735\nPAGE = [297.0, 210.0]\n\nVISIBLE_SEGMENTS = [\n (209.05159, 168.265645, 209.05159, 80.65267),\n (209.05159, 80.65267, 63.029965, 80.65267),\n (63.029965, 80.65267, 63.029965, 168.265645),\n (63.029965, 168.265645, 209.05159, 168.265645),\n (209.05159, 65.734295, 209.05159, 66.65267),\n (209.05159, 66.65267, 63.029965, 66.65267),\n (63.029965, 65.734295, 63.029965, 66.65267),\n (209.05159, 65.734295, 63.029965, 65.734295),\n (223.05159, 80.65267, 223.969965, 80.65267),\n (223.969965, 80.65267, 223.969965, 168.265645),\n (223.05159, 168.265645, 223.969965, 168.265645),\n (223.05159, 80.65267, 223.05159, 168.265645)\n]\nVISIBLE_CIRCLES = [\n\n]\nVISIBLE_ARCS = [\n\n]\nHIDDEN_SEGMENTS = [\n\n]\n# (orient, text, p1, p2, base) for linear; (orient, text, center, radius, angle) for diameter\nDIMENSIONS = [\n ('horizontal', '100', (209.0516, 168.2656), (63.0299, 168.2656), (136.0408, 157.2656)),\n ('vertical', '60', (209.0516, 80.6527), (209.0516, 168.2656), (198.0516, 124.4592)),\n ('horizontal', '0.6289', (223.0516, 80.6527), (223.97, 80.6527), (223.5108, 91.6527))\n]\n\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\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\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,\n angle=(0 if d[0] == \"horizontal\" else 90),\n 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,\n 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,\n 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,\n text=text, dimstyle=\"EZDXF\").render()\n\n doc.saveas(out_path)\n\n\nif __name__ == \"__main__\":\n out = sys.argv[1] if len(sys.argv) > 1 else \"0062_00625008_gt.dxf\"\n draw(out)\n print(\"wrote\", out)\n```"}], "images": ["images/0062_00625008.png"], "id": "0062_00625008"} {"messages": [{"role": "user", "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 800 mm."}, {"role": "assistant", "content": "```python\n#!/usr/bin/env python3\n# -*- coding: utf-8 -*-\n# Ground-truth 2D engineering drawing for part: 0062_00629939\n# Self-contained: reproduces the three-view DXF via ezdxf, NO FreeCAD needed.\n# Coordinates are A4 page millimetres (scale=0.11615139949109506, page=[297.0, 210.0]).\n# visible edges -> solid (layer OUTLINE); hidden edges -> dashed (layer HIDDEN)\n# dimensions -> real movable DIMENSION entities (text = true mm value)\n# Run: python 0062_00629939_gt.py [out.dxf]\nimport sys\nimport ezdxf\nimport math\n\nSCALE = 0.11615139949109506\nPAGE = [297.0, 210.0]\n\nVISIBLE_SEGMENTS = [\n (95.847004, 168.871112, 95.847004, 172.049992),\n (95.847004, 172.049992, 84.231864, 172.049992),\n (84.231864, 172.049992, 84.231864, 168.871112),\n (84.231864, 168.871112, 95.847004, 168.871112),\n (95.847004, 154.871112, 95.847004, 61.949992),\n (84.231864, 154.871112, 84.231864, 61.949992),\n (84.231864, 61.949992, 95.847004, 61.949992),\n (84.231864, 154.871112, 95.847004, 154.871112),\n (202.768124, 172.049992, 109.847004, 172.049992),\n (109.847004, 172.049992, 109.847004, 168.871112),\n (202.768124, 168.871112, 109.847004, 168.871112),\n (202.768124, 172.049992, 202.768124, 168.871112)\n]\nVISIBLE_CIRCLES = [\n\n]\nVISIBLE_ARCS = [\n\n]\nHIDDEN_SEGMENTS = [\n\n]\n# (orient, text, p1, p2, base) for linear; (orient, text, center, radius, angle) for diameter\nDIMENSIONS = [\n ('horizontal', '100', (95.847, 168.8711), (84.2319, 168.8711), (90.0394, 157.8711)),\n ('vertical', '27.3684', (95.847, 172.05), (95.847, 168.8711), (106.847, 170.4606)),\n ('horizontal', '800', (202.7681, 172.05), (109.847, 172.05), (156.3076, 161.05))\n]\n\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\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\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,\n angle=(0 if d[0] == \"horizontal\" else 90),\n 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,\n 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,\n 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,\n text=text, dimstyle=\"EZDXF\").render()\n\n doc.saveas(out_path)\n\n\nif __name__ == \"__main__\":\n out = sys.argv[1] if len(sys.argv) > 1 else \"0062_00629939_gt.dxf\"\n draw(out)\n print(\"wrote\", out)\n```"}], "images": ["images/0062_00629939.png"], "id": "0062_00629939"} {"messages": [{"role": "user", "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 77.89 mm wide and 100 mm tall. It is extruded to a thickness of 2.08 mm."}, {"role": "assistant", "content": "```python\n#!/usr/bin/env python3\n# -*- coding: utf-8 -*-\n# Ground-truth 2D engineering drawing for part: 0063_00637230\n# Self-contained: reproduces the three-view DXF via ezdxf, NO FreeCAD needed.\n# Coordinates are A4 page millimetres (scale=0.8259940828402655, page=[297.0, 210.0]).\n# visible edges -> solid (layer OUTLINE); hidden edges -> dashed (layer HIDDEN)\n# dimensions -> real movable DIMENSION entities (text = true mm value)\n# Run: python 0063_00637230_gt.py [out.dxf]\nimport sys\nimport ezdxf\nimport math\n\nSCALE = 0.8259940828402655\nPAGE = [297.0, 210.0]\n\nVISIBLE_SEGMENTS = [\n (167.809894, 83.560695, 167.809894, 166.160103),\n (167.809894, 166.160103, 103.469302, 166.160103),\n (103.469302, 166.160103, 103.469302, 83.560695),\n (103.469302, 83.560695, 167.809894, 83.560695),\n (167.809894, 69.560695, 167.809894, 67.839874),\n (103.469302, 69.560695, 103.469302, 67.839874),\n (103.469302, 67.839874, 167.809894, 67.839874),\n (103.469302, 69.560695, 167.809894, 69.560695),\n (183.530715, 166.160103, 181.809894, 166.160103),\n (181.809894, 166.160103, 181.809894, 83.560695),\n (183.530715, 83.560695, 181.809894, 83.560695),\n (183.530715, 166.160103, 183.530715, 83.560695)\n]\nVISIBLE_CIRCLES = [\n\n]\nVISIBLE_ARCS = [\n\n]\nHIDDEN_SEGMENTS = [\n\n]\n# (orient, text, p1, p2, base) for linear; (orient, text, center, radius, angle) for diameter\nDIMENSIONS = [\n ('horizontal', '77.8947', (167.8099, 83.5607), (103.4693, 83.5607), (135.6396, 72.5607)),\n ('vertical', '100', (167.8099, 166.1601), (167.8099, 83.5607), (178.8099, 124.8604)),\n ('horizontal', '2.0833', (183.5307, 166.1601), (181.8099, 166.1601), (182.6703, 155.1601))\n]\n\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\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\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,\n angle=(0 if d[0] == \"horizontal\" else 90),\n 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,\n 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,\n 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,\n text=text, dimstyle=\"EZDXF\").render()\n\n doc.saveas(out_path)\n\n\nif __name__ == \"__main__\":\n out = sys.argv[1] if len(sys.argv) > 1 else \"0063_00637230_gt.dxf\"\n draw(out)\n print(\"wrote\", out)\n```"}], "images": ["images/0063_00637230.png"], "id": "0063_00637230"} {"messages": [{"role": "user", "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 72.63 mm tall. It is extruded to a thickness of 36.46 mm."}, {"role": "assistant", "content": "```python\n#!/usr/bin/env python3\n# -*- coding: utf-8 -*-\n# Ground-truth 2D engineering drawing for part: 0063_00639485\n# Self-contained: reproduces the three-view DXF via ezdxf, NO FreeCAD needed.\n# Coordinates are A4 page millimetres (scale=0.8809247160518706, page=[297.0, 210.0]).\n# visible edges -> solid (layer OUTLINE); hidden edges -> dashed (layer HIDDEN)\n# dimensions -> real movable DIMENSION entities (text = true mm value)\n# Run: python 0063_00639485_gt.py [out.dxf]\nimport sys\nimport ezdxf\nimport math\n\nSCALE = 0.8809247160518706\nPAGE = [297.0, 210.0]\n\nVISIBLE_SEGMENTS = [\n (164.487685, 172.049972, 164.487685, 108.067019),\n (164.487685, 108.067019, 76.395213, 108.067019),\n (76.395213, 108.067019, 76.395213, 172.049972),\n (76.395213, 172.049972, 164.487685, 172.049972),\n (164.487685, 61.949972, 164.487685, 94.067019),\n (164.487685, 94.067019, 76.395213, 94.067019),\n (76.395213, 61.949972, 76.395213, 94.067019),\n (164.487685, 61.949972, 76.395213, 61.949972),\n (178.487685, 108.067019, 210.604732, 108.067019),\n (210.604732, 108.067019, 210.604732, 172.049972),\n (178.487685, 172.049972, 210.604732, 172.049972),\n (178.487685, 108.067019, 178.487685, 172.049972)\n]\nVISIBLE_CIRCLES = [\n\n]\nVISIBLE_ARCS = [\n\n]\nHIDDEN_SEGMENTS = [\n\n]\n# (orient, text, p1, p2, base) for linear; (orient, text, center, radius, angle) for diameter\nDIMENSIONS = [\n ('horizontal', '100', (164.4877, 172.05), (76.3952, 172.05), (120.4415, 161.05)),\n ('vertical', '72.6316', (164.4877, 108.067), (164.4877, 172.05), (153.4877, 140.0585)),\n ('horizontal', '36.4583', (178.4877, 108.067), (210.6047, 108.067), (194.5462, 119.067))\n]\n\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\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\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,\n angle=(0 if d[0] == \"horizontal\" else 90),\n 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,\n 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,\n 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,\n text=text, dimstyle=\"EZDXF\").render()\n\n doc.saveas(out_path)\n\n\nif __name__ == \"__main__\":\n out = sys.argv[1] if len(sys.argv) > 1 else \"0063_00639485_gt.dxf\"\n draw(out)\n print(\"wrote\", out)\n```"}], "images": ["images/0063_00639485.png"], "id": "0063_00639485"} {"messages": [{"role": "user", "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 2.3 mm."}, {"role": "assistant", "content": "```python\n#!/usr/bin/env python3\n# -*- coding: utf-8 -*-\n# Ground-truth 2D engineering drawing for part: 0064_00641825\n# Self-contained: reproduces the three-view DXF via ezdxf, NO FreeCAD needed.\n# Coordinates are A4 page millimetres (scale=1.041738805970152, page=[297.0, 210.0]).\n# visible edges -> solid (layer OUTLINE); hidden edges -> dashed (layer HIDDEN)\n# dimensions -> real movable DIMENSION entities (text = true mm value)\n# Run: python 0064_00641825_gt.py [out.dxf]\nimport sys\nimport ezdxf\nimport math\n\nSCALE = 1.041738805970152\nPAGE = [297.0, 210.0]\n\nVISIBLE_SEGMENTS = [\n (187.389556, 103.814288, 187.389556, 146.580408),\n (187.389556, 146.580408, 83.215675, 146.580408),\n (83.215675, 146.580408, 83.215675, 103.814288),\n (83.215675, 103.814288, 187.389556, 103.814288),\n (187.389556, 89.814288, 187.389556, 87.419487),\n (83.215675, 89.814288, 83.215675, 87.419487),\n (83.215675, 87.419487, 187.389556, 87.419487),\n (83.215675, 89.814288, 187.389556, 89.814288),\n (203.784358, 146.580408, 201.389556, 146.580408),\n (201.389556, 146.580408, 201.389556, 103.814288),\n (203.784358, 103.814288, 201.389556, 103.814288),\n (203.784358, 146.580408, 203.784358, 103.814288)\n]\nVISIBLE_CIRCLES = [\n\n]\nVISIBLE_ARCS = [\n\n]\nHIDDEN_SEGMENTS = [\n\n]\n# (orient, text, p1, p2, base) for linear; (orient, text, center, radius, angle) for diameter\nDIMENSIONS = [\n ('horizontal', '100', (187.3896, 103.8143), (83.2157, 103.8143), (135.3026, 92.8143)),\n ('vertical', '41.0526', (187.3896, 146.5804), (187.3896, 103.8143), (198.3896, 125.1974)),\n ('horizontal', '2.2989', (203.7843, 146.5804), (201.3895, 146.5804), (202.5869, 135.5804))\n]\n\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\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\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,\n angle=(0 if d[0] == \"horizontal\" else 90),\n 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,\n 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,\n 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,\n text=text, dimstyle=\"EZDXF\").render()\n\n doc.saveas(out_path)\n\n\nif __name__ == \"__main__\":\n out = sys.argv[1] if len(sys.argv) > 1 else \"0064_00641825_gt.dxf\"\n draw(out)\n print(\"wrote\", out)\n```"}], "images": ["images/0064_00641825.png"], "id": "0064_00641825"} {"messages": [{"role": "user", "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 124.68 mm."}, {"role": "assistant", "content": "```python\n#!/usr/bin/env python3\n# -*- coding: utf-8 -*-\n# Ground-truth 2D engineering drawing for part: 0064_00645683\n# Self-contained: reproduces the three-view DXF via ezdxf, NO FreeCAD needed.\n# Coordinates are A4 page millimetres (scale=0.4277283236994327, page=[297.0, 210.0]).\n# visible edges -> solid (layer OUTLINE); hidden edges -> dashed (layer HIDDEN)\n# dimensions -> real movable DIMENSION entities (text = true mm value)\n# Run: python 0064_00645683_gt.py [out.dxf]\nimport sys\nimport ezdxf\nimport math\n\nSCALE = 0.4277283236994327\nPAGE = [297.0, 210.0]\n\nVISIBLE_SEGMENTS = [\n (130.997705, 172.049959, 130.997705, 129.277127),\n (130.997705, 129.277127, 88.675113, 129.277127),\n (88.675113, 129.277127, 88.675113, 172.049959),\n (88.675113, 172.049959, 130.997705, 172.049959),\n (130.997705, 61.949959, 130.997705, 115.277127),\n (130.997705, 115.277127, 88.675113, 115.277127),\n (88.675113, 61.949959, 88.675113, 115.277127),\n (130.997705, 61.949959, 88.675113, 61.949959),\n (144.997705, 129.277127, 198.324873, 129.277127),\n (198.324873, 129.277127, 198.324873, 172.049959),\n (144.997705, 172.049959, 198.324873, 172.049959),\n (144.997705, 129.277127, 144.997705, 172.049959)\n]\nVISIBLE_CIRCLES = [\n\n]\nVISIBLE_ARCS = [\n\n]\nHIDDEN_SEGMENTS = [\n\n]\n# (orient, text, p1, p2, base) for linear; (orient, text, center, radius, angle) for diameter\nDIMENSIONS = [\n ('horizontal', '98.9474', (130.9977, 172.05), (88.6751, 172.05), (109.8364, 161.05)),\n ('vertical', '100', (130.9977, 129.2771), (130.9977, 172.05), (119.9977, 150.6636)),\n ('horizontal', '124.675', (144.9977, 129.2771), (198.3249, 129.2771), (171.6613, 140.2771))\n]\n\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\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\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,\n angle=(0 if d[0] == \"horizontal\" else 90),\n 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,\n 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,\n 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,\n text=text, dimstyle=\"EZDXF\").render()\n\n doc.saveas(out_path)\n\n\nif __name__ == \"__main__\":\n out = sys.argv[1] if len(sys.argv) > 1 else \"0064_00645683_gt.dxf\"\n draw(out)\n print(\"wrote\", out)\n```"}], "images": ["images/0064_00645683.png"], "id": "0064_00645683"} {"messages": [{"role": "user", "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 223.26 mm."}, {"role": "assistant", "content": "```python\n#!/usr/bin/env python3\n# -*- coding: utf-8 -*-\n# Ground-truth 2D engineering drawing for part: 0064_00646000\n# Self-contained: reproduces the three-view DXF via ezdxf, NO FreeCAD needed.\n# Coordinates are A4 page millimetres (scale=0.34053478487162664, page=[297.0, 210.0]).\n# visible edges -> solid (layer OUTLINE); hidden edges -> dashed (layer HIDDEN)\n# dimensions -> real movable DIMENSION entities (text = true mm value)\n# Run: python 0064_00646000_gt.py [out.dxf]\nimport sys\nimport ezdxf\nimport math\n\nSCALE = 0.34053478487162664\nPAGE = [297.0, 210.0]\n\nVISIBLE_SEGMENTS = [\n (115.513582, 172.050018, 115.513582, 151.976388),\n (115.513582, 151.976388, 81.460103, 151.976388),\n (81.460103, 151.976388, 81.460103, 172.050018),\n (81.460103, 172.050018, 115.513582, 172.050018),\n (115.513582, 61.950018, 115.513582, 137.976388),\n (115.513582, 137.976388, 81.460103, 137.976388),\n (81.460103, 61.950018, 81.460103, 137.976388),\n (115.513582, 61.950018, 81.460103, 61.950018),\n (129.513582, 151.976388, 205.539952, 151.976388),\n (205.539952, 151.976388, 205.539952, 172.050018),\n (129.513582, 172.050018, 205.539952, 172.050018),\n (129.513582, 151.976388, 129.513582, 172.050018)\n]\nVISIBLE_CIRCLES = [\n\n]\nVISIBLE_ARCS = [\n\n]\nHIDDEN_SEGMENTS = [\n\n]\n# (orient, text, p1, p2, base) for linear; (orient, text, center, radius, angle) for diameter\nDIMENSIONS = [\n ('horizontal', '100', (115.5136, 172.05), (81.4601, 172.05), (98.4868, 161.05)),\n ('vertical', '58.9474', (115.5136, 151.9764), (115.5136, 172.05), (104.5136, 162.0132)),\n ('horizontal', '223.256', (129.5136, 151.9764), (205.5399, 151.9764), (167.5267, 162.9764))\n]\n\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\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\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,\n angle=(0 if d[0] == \"horizontal\" else 90),\n 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,\n 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,\n 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,\n text=text, dimstyle=\"EZDXF\").render()\n\n doc.saveas(out_path)\n\n\nif __name__ == \"__main__\":\n out = sys.argv[1] if len(sys.argv) > 1 else \"0064_00646000_gt.dxf\"\n draw(out)\n print(\"wrote\", out)\n```"}], "images": ["images/0064_00646000.png"], "id": "0064_00646000"} {"messages": [{"role": "user", "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 4.41 mm."}, {"role": "assistant", "content": "```python\n#!/usr/bin/env python3\n# -*- coding: utf-8 -*-\n# Ground-truth 2D engineering drawing for part: 0065_00656733\n# Self-contained: reproduces the three-view DXF via ezdxf, NO FreeCAD needed.\n# Coordinates are A4 page millimetres (scale=1.3194601487779194, page=[297.0, 210.0]).\n# visible edges -> solid (layer OUTLINE); hidden edges -> dashed (layer HIDDEN)\n# dimensions -> real movable DIMENSION entities (text = true mm value)\n# Run: python 0065_00656733_gt.py [out.dxf]\nimport sys\nimport ezdxf\nimport math\n\nSCALE = 1.3194601487779194\nPAGE = [297.0, 210.0]\n\nVISIBLE_SEGMENTS = [\n (199.562413, 172.050031, 199.562413, 81.771179),\n (199.562413, 81.771179, 67.616399, 81.771179),\n (67.616399, 81.771179, 67.616399, 172.050031),\n (67.616399, 172.050031, 199.562413, 172.050031),\n (199.562413, 61.950031, 199.562413, 67.771179),\n (199.562413, 67.771179, 67.616399, 67.771179),\n (67.616399, 61.950031, 67.616399, 67.771179),\n (199.562413, 61.950031, 67.616399, 61.950031),\n (213.562413, 81.771179, 219.383561, 81.771179),\n (219.383561, 81.771179, 219.383561, 172.050031),\n (213.562413, 172.050031, 219.383561, 172.050031),\n (213.562413, 81.771179, 213.562413, 172.050031)\n]\nVISIBLE_CIRCLES = [\n\n]\nVISIBLE_ARCS = [\n\n]\nHIDDEN_SEGMENTS = [\n\n]\n# (orient, text, p1, p2, base) for linear; (orient, text, center, radius, angle) for diameter\nDIMENSIONS = [\n ('horizontal', '100', (199.5624, 172.05), (67.6164, 172.05), (133.5894, 161.05)),\n ('vertical', '68.4211', (199.5624, 81.7712), (199.5624, 172.05), (188.5624, 126.9106)),\n ('horizontal', '4.4118', (213.5624, 81.7712), (219.3836, 81.7712), (216.473, 92.7712))\n]\n\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\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\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,\n angle=(0 if d[0] == \"horizontal\" else 90),\n 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,\n 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,\n 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,\n text=text, dimstyle=\"EZDXF\").render()\n\n doc.saveas(out_path)\n\n\nif __name__ == \"__main__\":\n out = sys.argv[1] if len(sys.argv) > 1 else \"0065_00656733_gt.dxf\"\n draw(out)\n print(\"wrote\", out)\n```"}], "images": ["images/0065_00656733.png"], "id": "0065_00656733"} {"messages": [{"role": "user", "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 2.75 mm."}, {"role": "assistant", "content": "```python\n#!/usr/bin/env python3\n# -*- coding: utf-8 -*-\n# Ground-truth 2D engineering drawing for part: 0065_00657308\n# Self-contained: reproduces the three-view DXF via ezdxf, NO FreeCAD needed.\n# Coordinates are A4 page millimetres (scale=0.8779433962264965, page=[297.0, 210.0]).\n# visible edges -> solid (layer OUTLINE); hidden edges -> dashed (layer HIDDEN)\n# dimensions -> real movable DIMENSION entities (text = true mm value)\n# Run: python 0065_00657308_gt.py [out.dxf]\nimport sys\nimport ezdxf\nimport math\n\nSCALE = 0.8779433962264965\nPAGE = [297.0, 210.0]\n\nVISIBLE_SEGMENTS = [\n (179.191201, 95.633124, 179.191201, 154.778784),\n (179.191201, 154.778784, 91.396862, 154.778784),\n (91.396862, 154.778784, 91.396862, 95.633124),\n (91.396862, 95.633124, 179.191201, 95.633124),\n (179.191201, 81.633124, 179.191201, 79.221191),\n (91.396862, 81.633124, 91.396862, 79.221191),\n (91.396862, 79.221191, 179.191201, 79.221191),\n (91.396862, 81.633124, 179.191201, 81.633124),\n (195.603134, 154.778784, 193.191201, 154.778784),\n (193.191201, 154.778784, 193.191201, 95.633124),\n (195.603134, 95.633124, 193.191201, 95.633124),\n (195.603134, 154.778784, 195.603134, 95.633124)\n]\nVISIBLE_CIRCLES = [\n\n]\nVISIBLE_ARCS = [\n\n]\nHIDDEN_SEGMENTS = [\n\n]\n# (orient, text, p1, p2, base) for linear; (orient, text, center, radius, angle) for diameter\nDIMENSIONS = [\n ('horizontal', '100', (179.1912, 95.6331), (91.3969, 95.6331), (135.2941, 84.6331)),\n ('vertical', '67.3684', (179.1912, 154.7788), (179.1912, 95.6331), (190.1912, 125.206)),\n ('horizontal', '2.7473', (195.6031, 154.7788), (193.1912, 154.7788), (194.3971, 143.7788))\n]\n\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\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\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,\n angle=(0 if d[0] == \"horizontal\" else 90),\n 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,\n 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,\n 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,\n text=text, dimstyle=\"EZDXF\").render()\n\n doc.saveas(out_path)\n\n\nif __name__ == \"__main__\":\n out = sys.argv[1] if len(sys.argv) > 1 else \"0065_00657308_gt.dxf\"\n draw(out)\n print(\"wrote\", out)\n```"}], "images": ["images/0065_00657308.png"], "id": "0065_00657308"} {"messages": [{"role": "user", "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 25.26 mm tall. It is extruded to a thickness of 2.08 mm."}, {"role": "assistant", "content": "```python\n#!/usr/bin/env python3\n# -*- coding: utf-8 -*-\n# Ground-truth 2D engineering drawing for part: 0065_00657595\n# Self-contained: reproduces the three-view DXF via ezdxf, NO FreeCAD needed.\n# Coordinates are A4 page millimetres (scale=1.4394122448979638, page=[297.0, 210.0]).\n# visible edges -> solid (layer OUTLINE); hidden edges -> dashed (layer HIDDEN)\n# dimensions -> real movable DIMENSION entities (text = true mm value)\n# Run: python 0065_00657595_gt.py [out.dxf]\nimport sys\nimport ezdxf\nimport math\n\nSCALE = 1.4394122448979638\nPAGE = [297.0, 210.0]\n\nVISIBLE_SEGMENTS = [\n (206.97121, 143.681439, 206.97121, 107.31734),\n (206.97121, 107.31734, 63.029985, 107.31734),\n (63.029985, 107.31734, 63.029985, 143.681439),\n (63.029985, 143.681439, 206.97121, 143.681439),\n (206.97121, 90.318565, 206.97121, 93.31734),\n (206.97121, 93.31734, 63.029985, 93.31734),\n (63.029985, 90.318565, 63.029985, 93.31734),\n (206.97121, 90.318565, 63.029985, 90.318565),\n (220.97121, 107.31734, 223.969985, 107.31734),\n (223.969985, 107.31734, 223.969985, 143.681439),\n (220.97121, 143.681439, 223.969985, 143.681439),\n (220.97121, 107.31734, 220.97121, 143.681439)\n]\nVISIBLE_CIRCLES = [\n\n]\nVISIBLE_ARCS = [\n\n]\nHIDDEN_SEGMENTS = [\n\n]\n# (orient, text, p1, p2, base) for linear; (orient, text, center, radius, angle) for diameter\nDIMENSIONS = [\n ('horizontal', '100', (206.9712, 143.6815), (63.03, 143.6815), (135.0006, 132.6815)),\n ('vertical', '25.2632', (206.9712, 107.3173), (206.9712, 143.6815), (195.9712, 125.4994)),\n ('horizontal', '2.0833', (220.9712, 107.3173), (223.97, 107.3173), (222.4706, 118.3173))\n]\n\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\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\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,\n angle=(0 if d[0] == \"horizontal\" else 90),\n 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,\n 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,\n 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,\n text=text, dimstyle=\"EZDXF\").render()\n\n doc.saveas(out_path)\n\n\nif __name__ == \"__main__\":\n out = sys.argv[1] if len(sys.argv) > 1 else \"0065_00657595_gt.dxf\"\n draw(out)\n print(\"wrote\", out)\n```"}], "images": ["images/0065_00657595.png"], "id": "0065_00657595"} {"messages": [{"role": "user", "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 1920 mm."}, {"role": "assistant", "content": "```python\n#!/usr/bin/env python3\n# -*- coding: utf-8 -*-\n# Ground-truth 2D engineering drawing for part: 0065_00658349\n# Self-contained: reproduces the three-view DXF via ezdxf, NO FreeCAD needed.\n# Coordinates are A4 page millimetres (scale=0.047574257425742575, page=[297.0, 210.0]).\n# visible edges -> solid (layer OUTLINE); hidden edges -> dashed (layer HIDDEN)\n# dimensions -> real movable DIMENSION entities (text = true mm value)\n# Run: python 0065_00658349_gt.py [out.dxf]\nimport sys\nimport ezdxf\nimport math\n\nSCALE = 0.047574257425742575\nPAGE = [297.0, 210.0]\n\nVISIBLE_SEGMENTS = [\n (92.8068, 172.050015, 92.8068, 167.29259),\n (92.8068, 167.29259, 88.850625, 167.29259),\n (88.850625, 167.29259, 88.850625, 172.050015),\n (88.850625, 172.050015, 92.8068, 172.050015),\n (92.8068, 61.950015, 92.8068, 153.29259),\n (92.8068, 153.29259, 88.850625, 153.29259),\n (88.850625, 61.950015, 88.850625, 153.29259),\n (92.8068, 61.950015, 88.850625, 61.950015),\n (106.8068, 167.29259, 198.149374, 167.29259),\n (198.149374, 167.29259, 198.149374, 172.050015),\n (106.8068, 172.050015, 198.149374, 172.050015),\n (106.8068, 167.29259, 106.8068, 172.050015)\n]\nVISIBLE_CIRCLES = [\n\n]\nVISIBLE_ARCS = [\n\n]\nHIDDEN_SEGMENTS = [\n\n]\n# (orient, text, p1, p2, base) for linear; (orient, text, center, radius, angle) for diameter\nDIMENSIONS = [\n ('horizontal', '83.1579', (92.8068, 172.05), (88.8506, 172.05), (90.8287, 161.05)),\n ('vertical', '100', (92.8068, 167.2926), (92.8068, 172.05), (81.8068, 169.6713)),\n ('horizontal', '1920', (106.8068, 167.2926), (198.1494, 167.2926), (152.4781, 178.2926))\n]\n\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\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\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,\n angle=(0 if d[0] == \"horizontal\" else 90),\n 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,\n 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,\n 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,\n text=text, dimstyle=\"EZDXF\").render()\n\n doc.saveas(out_path)\n\n\nif __name__ == \"__main__\":\n out = sys.argv[1] if len(sys.argv) > 1 else \"0065_00658349_gt.dxf\"\n draw(out)\n print(\"wrote\", out)\n```"}], "images": ["images/0065_00658349.png"], "id": "0065_00658349"} {"messages": [{"role": "user", "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 88.07 mm."}, {"role": "assistant", "content": "```python\n#!/usr/bin/env python3\n# -*- coding: utf-8 -*-\n# Ground-truth 2D engineering drawing for part: 0066_00660868\n# Self-contained: reproduces the three-view DXF via ezdxf, NO FreeCAD needed.\n# Coordinates are A4 page millimetres (scale=0.5109707317073492, page=[297.0, 210.0]).\n# visible edges -> solid (layer OUTLINE); hidden edges -> dashed (layer HIDDEN)\n# dimensions -> real movable DIMENSION entities (text = true mm value)\n# Run: python 0066_00660868_gt.py [out.dxf]\nimport sys\nimport ezdxf\nimport math\n\nSCALE = 0.5109707317073492\nPAGE = [297.0, 210.0]\n\nVISIBLE_SEGMENTS = [\n (139.547089, 120.952956, 139.547089, 172.050029),\n (139.547089, 172.050029, 88.450016, 172.050029),\n (88.450016, 172.050029, 88.450016, 120.952956),\n (88.450016, 120.952956, 139.547089, 120.952956),\n (139.547089, 106.952956, 139.547089, 61.950029),\n (88.450016, 106.952956, 88.450016, 61.950029),\n (88.450016, 61.950029, 139.547089, 61.950029),\n (88.450016, 106.952956, 139.547089, 106.952956),\n (198.550016, 172.050029, 153.547089, 172.050029),\n (153.547089, 172.050029, 153.547089, 120.952956),\n (198.550016, 120.952956, 153.547089, 120.952956),\n (198.550016, 172.050029, 198.550016, 120.952956)\n]\nVISIBLE_CIRCLES = [\n\n]\nVISIBLE_ARCS = [\n\n]\nHIDDEN_SEGMENTS = [\n\n]\n# (orient, text, p1, p2, base) for linear; (orient, text, center, radius, angle) for diameter\nDIMENSIONS = [\n ('horizontal', '100', (139.5471, 120.953), (88.45, 120.953), (113.9985, 109.953)),\n ('vertical', '100', (139.5471, 172.05), (139.5471, 120.953), (150.5471, 146.5015)),\n ('horizontal', '88.0734', (198.55, 172.05), (153.5471, 172.05), (176.0485, 161.05))\n]\n\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\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\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,\n angle=(0 if d[0] == \"horizontal\" else 90),\n 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,\n 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,\n 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,\n text=text, dimstyle=\"EZDXF\").render()\n\n doc.saveas(out_path)\n\n\nif __name__ == \"__main__\":\n out = sys.argv[1] if len(sys.argv) > 1 else \"0066_00660868_gt.dxf\"\n draw(out)\n print(\"wrote\", out)\n```"}], "images": ["images/0066_00660868.png"], "id": "0066_00660868"} {"messages": [{"role": "user", "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 76.84 mm tall. It is extruded to a thickness of 11.7 mm."}, {"role": "assistant", "content": "```python\n#!/usr/bin/env python3\n# -*- coding: utf-8 -*-\n# Ground-truth 2D engineering drawing for part: 0066_00666731\n# Self-contained: reproduces the three-view DXF via ezdxf, NO FreeCAD needed.\n# Coordinates are A4 page millimetres (scale=0.8309107142857419, page=[297.0, 210.0]).\n# visible edges -> solid (layer OUTLINE); hidden edges -> dashed (layer HIDDEN)\n# dimensions -> real movable DIMENSION entities (text = true mm value)\n# Run: python 0066_00666731_gt.py [out.dxf]\nimport sys\nimport ezdxf\nimport math\n\nSCALE = 0.8309107142857419\nPAGE = [297.0, 210.0]\n\nVISIBLE_SEGMENTS = [\n (173.186403, 96.934643, 173.186403, 160.783571),\n (173.186403, 160.783571, 90.095332, 160.783571),\n (90.095332, 160.783571, 90.095332, 96.934643),\n (90.095332, 96.934643, 173.186403, 96.934643),\n (173.186403, 82.934643, 173.186403, 73.216389),\n (90.095332, 82.934643, 90.095332, 73.216389),\n (90.095332, 73.216389, 173.186403, 73.216389),\n (90.095332, 82.934643, 173.186403, 82.934643),\n (196.904657, 160.783571, 187.186403, 160.783571),\n (187.186403, 160.783571, 187.186403, 96.934643),\n (196.904657, 96.934643, 187.186403, 96.934643),\n (196.904657, 160.783571, 196.904657, 96.934643)\n]\nVISIBLE_CIRCLES = [\n\n]\nVISIBLE_ARCS = [\n\n]\nHIDDEN_SEGMENTS = [\n\n]\n# (orient, text, p1, p2, base) for linear; (orient, text, center, radius, angle) for diameter\nDIMENSIONS = [\n ('horizontal', '100', (173.1864, 96.9346), (90.0953, 96.9346), (131.6408, 85.9346)),\n ('vertical', '76.8421', (173.1864, 160.7836), (173.1864, 96.9346), (184.1864, 128.8591)),\n ('horizontal', '11.6959', (196.9047, 160.7836), (187.1864, 160.7836), (192.0455, 149.7836))\n]\n\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\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\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,\n angle=(0 if d[0] == \"horizontal\" else 90),\n 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,\n 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,\n 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,\n text=text, dimstyle=\"EZDXF\").render()\n\n doc.saveas(out_path)\n\n\nif __name__ == \"__main__\":\n out = sys.argv[1] if len(sys.argv) > 1 else \"0066_00666731_gt.dxf\"\n draw(out)\n print(\"wrote\", out)\n```"}], "images": ["images/0066_00666731.png"], "id": "0066_00666731"} {"messages": [{"role": "user", "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.31 mm."}, {"role": "assistant", "content": "```python\n#!/usr/bin/env python3\n# -*- coding: utf-8 -*-\n# Ground-truth 2D engineering drawing for part: 0067_00673490\n# Self-contained: reproduces the three-view DXF via ezdxf, NO FreeCAD needed.\n# Coordinates are A4 page millimetres (scale=0.8711869158878699, page=[297.0, 210.0]).\n# visible edges -> solid (layer OUTLINE); hidden edges -> dashed (layer HIDDEN)\n# dimensions -> real movable DIMENSION entities (text = true mm value)\n# Run: python 0067_00673490_gt.py [out.dxf]\nimport sys\nimport ezdxf\nimport math\n\nSCALE = 0.8711869158878699\nPAGE = [297.0, 210.0]\n\nVISIBLE_SEGMENTS = [\n (175.568697, 172.049995, 175.568697, 84.931303),\n (175.568697, 84.931303, 88.450005, 84.931303),\n (88.450005, 84.931303, 88.450005, 172.049995),\n (88.450005, 172.049995, 175.568697, 172.049995),\n (175.568697, 61.949995, 175.568697, 70.931303),\n (175.568697, 70.931303, 88.450005, 70.931303),\n (88.450005, 61.949995, 88.450005, 70.931303),\n (175.568697, 61.949995, 88.450005, 61.949995),\n (189.568697, 84.931303, 198.550005, 84.931303),\n (198.550005, 84.931303, 198.550005, 172.049995),\n (189.568697, 172.049995, 198.550005, 172.049995),\n (189.568697, 84.931303, 189.568697, 172.049995)\n]\nVISIBLE_CIRCLES = [\n\n]\nVISIBLE_ARCS = [\n\n]\nHIDDEN_SEGMENTS = [\n\n]\n# (orient, text, p1, p2, base) for linear; (orient, text, center, radius, angle) for diameter\nDIMENSIONS = [\n ('horizontal', '100', (175.5687, 172.05), (88.45, 172.05), (132.0094, 161.05)),\n ('vertical', '100', (175.5687, 84.9313), (175.5687, 172.05), (164.5687, 128.4907)),\n ('horizontal', '10.3093', (189.5687, 84.9313), (198.55, 84.9313), (194.0594, 95.9313))\n]\n\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\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\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,\n angle=(0 if d[0] == \"horizontal\" else 90),\n 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,\n 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,\n 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,\n text=text, dimstyle=\"EZDXF\").render()\n\n doc.saveas(out_path)\n\n\nif __name__ == \"__main__\":\n out = sys.argv[1] if len(sys.argv) > 1 else \"0067_00673490_gt.dxf\"\n draw(out)\n print(\"wrote\", out)\n```"}], "images": ["images/0067_00673490.png"], "id": "0067_00673490"} {"messages": [{"role": "user", "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 50 mm."}, {"role": "assistant", "content": "```python\n#!/usr/bin/env python3\n# -*- coding: utf-8 -*-\n# Ground-truth 2D engineering drawing for part: 0067_00674872\n# Self-contained: reproduces the three-view DXF via ezdxf, NO FreeCAD needed.\n# Coordinates are A4 page millimetres (scale=0.6406666666666666, page=[297.0, 210.0]).\n# visible edges -> solid (layer OUTLINE); hidden edges -> dashed (layer HIDDEN)\n# dimensions -> real movable DIMENSION entities (text = true mm value)\n# Run: python 0067_00674872_gt.py [out.dxf]\nimport sys\nimport ezdxf\nimport math\n\nSCALE = 0.6406666666666666\nPAGE = [297.0, 210.0]\n\nVISIBLE_SEGMENTS = [\n (147.121592, 107.98332, 147.121592, 172.049987),\n (147.121592, 172.049987, 93.8451, 172.049987),\n (93.8451, 172.049987, 93.8451, 107.98332),\n (93.8451, 107.98332, 147.121592, 107.98332),\n (147.121592, 93.98332, 147.121592, 61.949987),\n (93.8451, 93.98332, 93.8451, 61.949987),\n (93.8451, 61.949987, 147.121592, 61.949987),\n (93.8451, 93.98332, 147.121592, 93.98332),\n (193.154925, 172.049987, 161.121592, 172.049987),\n (161.121592, 172.049987, 161.121592, 107.98332),\n (193.154925, 107.98332, 161.121592, 107.98332),\n (193.154925, 172.049987, 193.154925, 107.98332)\n]\nVISIBLE_CIRCLES = [\n\n]\nVISIBLE_ARCS = [\n\n]\nHIDDEN_SEGMENTS = [\n\n]\n# (orient, text, p1, p2, base) for linear; (orient, text, center, radius, angle) for diameter\nDIMENSIONS = [\n ('horizontal', '83.1579', (147.1216, 107.9833), (93.8451, 107.9833), (120.4833, 96.9833)),\n ('vertical', '100', (147.1216, 172.05), (147.1216, 107.9833), (158.1216, 140.0167)),\n ('horizontal', '50', (193.1549, 172.05), (161.1216, 172.05), (177.1382, 161.05))\n]\n\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\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\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,\n angle=(0 if d[0] == \"horizontal\" else 90),\n 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,\n 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,\n 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,\n text=text, dimstyle=\"EZDXF\").render()\n\n doc.saveas(out_path)\n\n\nif __name__ == \"__main__\":\n out = sys.argv[1] if len(sys.argv) > 1 else \"0067_00674872_gt.dxf\"\n draw(out)\n print(\"wrote\", out)\n```"}], "images": ["images/0067_00674872.png"], "id": "0067_00674872"} {"messages": [{"role": "user", "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 3.12 mm."}, {"role": "assistant", "content": "```python\n#!/usr/bin/env python3\n# -*- coding: utf-8 -*-\n# Ground-truth 2D engineering drawing for part: 0067_00675528\n# Self-contained: reproduces the three-view DXF via ezdxf, NO FreeCAD needed.\n# Coordinates are A4 page millimetres (scale=0.9318787878787879, page=[297.0, 210.0]).\n# visible edges -> solid (layer OUTLINE); hidden edges -> dashed (layer HIDDEN)\n# dimensions -> real movable DIMENSION entities (text = true mm value)\n# Run: python 0067_00675528_gt.py [out.dxf]\nimport sys\nimport ezdxf\nimport math\n\nSCALE = 0.9318787878787879\nPAGE = [297.0, 210.0]\n\nVISIBLE_SEGMENTS = [\n (181.637892, 172.049987, 181.637892, 78.862108),\n (181.637892, 78.862108, 88.450013, 78.862108),\n (88.450013, 78.862108, 88.450013, 172.049987),\n (88.450013, 172.049987, 181.637892, 172.049987),\n (181.637892, 61.949987, 181.637892, 64.862108),\n (181.637892, 64.862108, 88.450013, 64.862108),\n (88.450013, 61.949987, 88.450013, 64.862108),\n (181.637892, 61.949987, 88.450013, 61.949987),\n (195.637892, 78.862108, 198.550013, 78.862108),\n (198.550013, 78.862108, 198.550013, 172.049987),\n (195.637892, 172.049987, 198.550013, 172.049987),\n (195.637892, 78.862108, 195.637892, 172.049987)\n]\nVISIBLE_CIRCLES = [\n\n]\nVISIBLE_ARCS = [\n\n]\nHIDDEN_SEGMENTS = [\n\n]\n# (orient, text, p1, p2, base) for linear; (orient, text, center, radius, angle) for diameter\nDIMENSIONS = [\n ('horizontal', '100', (181.6379, 172.05), (88.45, 172.05), (135.0439, 161.05)),\n ('vertical', '100', (181.6379, 78.8621), (181.6379, 172.05), (170.6379, 125.4561)),\n ('horizontal', '3.125', (195.6379, 78.8621), (198.55, 78.8621), (197.0939, 89.8621))\n]\n\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\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\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,\n angle=(0 if d[0] == \"horizontal\" else 90),\n 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,\n 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,\n 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,\n text=text, dimstyle=\"EZDXF\").render()\n\n doc.saveas(out_path)\n\n\nif __name__ == \"__main__\":\n out = sys.argv[1] if len(sys.argv) > 1 else \"0067_00675528_gt.dxf\"\n draw(out)\n print(\"wrote\", out)\n```"}], "images": ["images/0067_00675528.png"], "id": "0067_00675528"} {"messages": [{"role": "user", "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 1600 mm."}, {"role": "assistant", "content": "```python\n#!/usr/bin/env python3\n# -*- coding: utf-8 -*-\n# Ground-truth 2D engineering drawing for part: 0067_00678084\n# Self-contained: reproduces the three-view DXF via ezdxf, NO FreeCAD needed.\n# Coordinates are A4 page millimetres (scale=0.029121212121212114, page=[297.0, 210.0]).\n# visible edges -> solid (layer OUTLINE); hidden edges -> dashed (layer HIDDEN)\n# dimensions -> real movable DIMENSION entities (text = true mm value)\n# Run: python 0067_00678084_gt.py [out.dxf]\nimport sys\nimport ezdxf\nimport math\n\nSCALE = 0.029121212121212114\nPAGE = [297.0, 210.0]\n\nVISIBLE_SEGMENTS = [\n (91.362108, 169.137887, 91.362108, 172.050008),\n (88.449987, 169.137887, 91.362108, 169.137887),\n (91.362108, 172.050008, 88.449987, 172.050008),\n (88.449987, 172.050008, 88.449987, 169.137887),\n (91.362108, 61.950008, 91.362108, 155.137887),\n (88.449987, 61.950008, 88.449987, 155.137887),\n (88.449987, 61.950008, 91.362108, 61.950008),\n (88.449987, 155.137887, 91.362108, 155.137887),\n (105.362108, 169.137887, 198.549987, 169.137887),\n (198.549987, 172.050008, 105.362108, 172.050008),\n (105.362108, 172.050008, 105.362108, 169.137887),\n (198.549987, 172.050008, 198.549987, 169.137887)\n]\nVISIBLE_CIRCLES = [\n\n]\nVISIBLE_ARCS = [\n\n]\nHIDDEN_SEGMENTS = [\n\n]\n# (orient, text, p1, p2, base) for linear; (orient, text, center, radius, angle) for diameter\nDIMENSIONS = [\n ('horizontal', '100', (91.3621, 169.1379), (88.45, 169.1379), (89.9061, 158.1379)),\n ('vertical', '100', (91.3621, 172.05), (91.3621, 169.1379), (102.3621, 170.5939)),\n ('horizontal', '3200', (198.55, 172.05), (105.3621, 172.05), (151.9561, 161.05))\n]\n\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\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\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,\n angle=(0 if d[0] == \"horizontal\" else 90),\n 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,\n 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,\n 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,\n text=text, dimstyle=\"EZDXF\").render()\n\n doc.saveas(out_path)\n\n\nif __name__ == \"__main__\":\n out = sys.argv[1] if len(sys.argv) > 1 else \"0067_00678084_gt.dxf\"\n draw(out)\n print(\"wrote\", out)\n```"}], "images": ["images/0067_00678084.png"], "id": "0067_00678084"} {"messages": [{"role": "user", "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 50 mm."}, {"role": "assistant", "content": "```python\n#!/usr/bin/env python3\n# -*- coding: utf-8 -*-\n# Ground-truth 2D engineering drawing for part: 0067_00678974\n# Self-contained: reproduces the three-view DXF via ezdxf, NO FreeCAD needed.\n# Coordinates are A4 page millimetres (scale=0.8820772946859874, page=[297.0, 210.0]).\n# visible edges -> solid (layer OUTLINE); hidden edges -> dashed (layer HIDDEN)\n# dimensions -> real movable DIMENSION entities (text = true mm value)\n# Run: python 0067_00678974_gt.py [out.dxf]\nimport sys\nimport ezdxf\nimport math\n\nSCALE = 0.8820772946859874\nPAGE = [297.0, 210.0]\n\nVISIBLE_SEGMENTS = [\n (158.551913, 172.050021, 158.551913, 120.053886),\n (158.551913, 120.053886, 70.344183, 120.053886),\n (70.344183, 120.053886, 70.344183, 172.050021),\n (70.344183, 172.050021, 158.551913, 172.050021),\n (158.551913, 61.950021, 158.551913, 106.053886),\n (158.551913, 106.053886, 70.344183, 106.053886),\n (70.344183, 61.950021, 70.344183, 106.053886),\n (158.551913, 61.950021, 70.344183, 61.950021),\n (172.551913, 120.053886, 216.655778, 120.053886),\n (216.655778, 120.053886, 216.655778, 172.050021),\n (172.551913, 172.050021, 216.655778, 172.050021),\n (172.551913, 120.053886, 172.551913, 172.050021)\n]\nVISIBLE_CIRCLES = [\n\n]\nVISIBLE_ARCS = [\n\n]\nHIDDEN_SEGMENTS = [\n\n]\n# (orient, text, p1, p2, base) for linear; (orient, text, center, radius, angle) for diameter\nDIMENSIONS = [\n ('horizontal', '100', (158.5519, 172.05), (70.3442, 172.05), (114.4481, 161.05)),\n ('vertical', '58.9474', (158.5519, 120.0539), (158.5519, 172.05), (147.5519, 146.0519)),\n ('horizontal', '50', (172.5519, 120.0539), (216.6558, 120.0539), (194.6039, 131.0539))\n]\n\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\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\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,\n angle=(0 if d[0] == \"horizontal\" else 90),\n 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,\n 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,\n 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,\n text=text, dimstyle=\"EZDXF\").render()\n\n doc.saveas(out_path)\n\n\nif __name__ == \"__main__\":\n out = sys.argv[1] if len(sys.argv) > 1 else \"0067_00678974_gt.dxf\"\n draw(out)\n print(\"wrote\", out)\n```"}], "images": ["images/0067_00678974.png"], "id": "0067_00678974"} {"messages": [{"role": "user", "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 4.17 mm."}, {"role": "assistant", "content": "```python\n#!/usr/bin/env python3\n# -*- coding: utf-8 -*-\n# Ground-truth 2D engineering drawing for part: 0067_00679235\n# Self-contained: reproduces the three-view DXF via ezdxf, NO FreeCAD needed.\n# Coordinates are A4 page millimetres (scale=0.7346999999999999, page=[297.0, 210.0]).\n# visible edges -> solid (layer OUTLINE); hidden edges -> dashed (layer HIDDEN)\n# dimensions -> real movable DIMENSION entities (text = true mm value)\n# Run: python 0067_00679235_gt.py [out.dxf]\nimport sys\nimport ezdxf\nimport math\n\nSCALE = 0.7346999999999999\nPAGE = [297.0, 210.0]\n\nVISIBLE_SEGMENTS = [\n (171.70439, 88.7956, 171.70439, 162.2656),\n (171.70439, 162.2656, 98.23439, 162.2656),\n (98.23439, 162.2656, 98.23439, 88.7956),\n (98.23439, 88.7956, 171.70439, 88.7956),\n (171.70439, 74.7956, 171.70439, 71.73435),\n (98.23439, 74.7956, 98.23439, 71.73435),\n (98.23439, 71.73435, 171.70439, 71.73435),\n (98.23439, 74.7956, 171.70439, 74.7956),\n (188.76564, 162.2656, 185.70439, 162.2656),\n (185.70439, 162.2656, 185.70439, 88.7956),\n (188.76564, 88.7956, 185.70439, 88.7956),\n (188.76564, 162.2656, 188.76564, 88.7956)\n]\nVISIBLE_CIRCLES = [\n\n]\nVISIBLE_ARCS = [\n\n]\nHIDDEN_SEGMENTS = [\n\n]\n# (orient, text, p1, p2, base) for linear; (orient, text, center, radius, angle) for diameter\nDIMENSIONS = [\n ('horizontal', '100', (171.7044, 88.7956), (98.2344, 88.7956), (134.9694, 77.7956)),\n ('vertical', '100', (171.7044, 162.2656), (171.7044, 88.7956), (182.7044, 125.5306)),\n ('horizontal', '4.1667', (188.7656, 162.2656), (185.7044, 162.2656), (187.235, 151.2656))\n]\n\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\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\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,\n angle=(0 if d[0] == \"horizontal\" else 90),\n 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,\n 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,\n 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,\n text=text, dimstyle=\"EZDXF\").render()\n\n doc.saveas(out_path)\n\n\nif __name__ == \"__main__\":\n out = sys.argv[1] if len(sys.argv) > 1 else \"0067_00679235_gt.dxf\"\n draw(out)\n print(\"wrote\", out)\n```"}], "images": ["images/0067_00679235.png"], "id": "0067_00679235"} {"messages": [{"role": "user", "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 9.64 mm."}, {"role": "assistant", "content": "```python\n#!/usr/bin/env python3\n# -*- coding: utf-8 -*-\n# Ground-truth 2D engineering drawing for part: 0068_00681169\n# Self-contained: reproduces the three-view DXF via ezdxf, NO FreeCAD needed.\n# Coordinates are A4 page millimetres (scale=1.340221978021984, page=[297.0, 210.0]).\n# visible edges -> solid (layer OUTLINE); hidden edges -> dashed (layer HIDDEN)\n# dimensions -> real movable DIMENSION entities (text = true mm value)\n# Run: python 0068_00681169_gt.py [out.dxf]\nimport sys\nimport ezdxf\nimport math\n\nSCALE = 1.340221978021984\nPAGE = [297.0, 210.0]\n\nVISIBLE_SEGMENTS = [\n (197.052219, 164.317147, 197.052219, 96.600668),\n (197.052219, 96.600668, 63.030021, 96.600668),\n (63.030021, 96.600668, 63.030021, 164.317147),\n (63.030021, 164.317147, 197.052219, 164.317147),\n (197.052219, 69.682866, 197.052219, 82.600668),\n (197.052219, 82.600668, 63.030021, 82.600668),\n (63.030021, 69.682866, 63.030021, 82.600668),\n (197.052219, 69.682866, 63.030021, 69.682866),\n (211.052219, 96.600668, 223.970021, 96.600668),\n (223.970021, 96.600668, 223.970021, 164.317147),\n (211.052219, 164.317147, 223.970021, 164.317147),\n (211.052219, 96.600668, 211.052219, 164.317147)\n]\nVISIBLE_CIRCLES = [\n\n]\nVISIBLE_ARCS = [\n\n]\nHIDDEN_SEGMENTS = [\n\n]\n# (orient, text, p1, p2, base) for linear; (orient, text, center, radius, angle) for diameter\nDIMENSIONS = [\n ('horizontal', '100', (197.0522, 164.3171), (63.03, 164.3171), (130.0411, 153.3171)),\n ('vertical', '50.5263', (197.0522, 96.6007), (197.0522, 164.3171), (186.0522, 130.4589)),\n ('horizontal', '9.6386', (211.0522, 96.6007), (223.9701, 96.6007), (217.5111, 107.6007))\n]\n\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\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\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,\n angle=(0 if d[0] == \"horizontal\" else 90),\n 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,\n 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,\n 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,\n text=text, dimstyle=\"EZDXF\").render()\n\n doc.saveas(out_path)\n\n\nif __name__ == \"__main__\":\n out = sys.argv[1] if len(sys.argv) > 1 else \"0068_00681169_gt.dxf\"\n draw(out)\n print(\"wrote\", out)\n```"}], "images": ["images/0068_00681169.png"], "id": "0068_00681169"} {"messages": [{"role": "user", "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": "assistant", "content": "```python\n#!/usr/bin/env python3\n# -*- coding: utf-8 -*-\n# Ground-truth 2D engineering drawing for part: 0068_00685930\n# Self-contained: reproduces the three-view DXF via ezdxf, NO FreeCAD needed.\n# Coordinates are A4 page millimetres (scale=0.6406666666666666, page=[297.0, 210.0]).\n# visible edges -> solid (layer OUTLINE); hidden edges -> dashed (layer HIDDEN)\n# dimensions -> real movable DIMENSION entities (text = true mm value)\n# Run: python 0068_00685930_gt.py [out.dxf]\nimport sys\nimport ezdxf\nimport math\n\nSCALE = 0.6406666666666666\nPAGE = [297.0, 210.0]\n\nVISIBLE_SEGMENTS = [\n (152.516687, 107.98332, 152.516687, 172.049987),\n (152.516687, 172.049987, 88.45002, 172.049987),\n (88.45002, 172.049987, 88.45002, 107.98332),\n (88.45002, 107.98332, 152.516687, 107.98332),\n (152.516687, 93.98332, 152.516687, 61.949987),\n (88.45002, 93.98332, 88.45002, 61.949987),\n (88.45002, 61.949987, 152.516687, 61.949987),\n (88.45002, 93.98332, 152.516687, 93.98332),\n (198.55002, 172.049987, 166.516687, 172.049987),\n (166.516687, 172.049987, 166.516687, 107.98332),\n (198.55002, 107.98332, 166.516687, 107.98332),\n (198.55002, 172.049987, 198.55002, 107.98332)\n]\nVISIBLE_CIRCLES = [\n\n]\nVISIBLE_ARCS = [\n\n]\nHIDDEN_SEGMENTS = [\n\n]\n# (orient, text, p1, p2, base) for linear; (orient, text, center, radius, angle) for diameter\nDIMENSIONS = [\n ('horizontal', '100', (152.5167, 107.9833), (88.45, 107.9833), (120.4833, 96.9833)),\n ('vertical', '100', (152.5167, 172.05), (152.5167, 107.9833), (163.5167, 140.0167)),\n ('horizontal', '50', (198.55, 172.05), (166.5167, 172.05), (182.5333, 161.05))\n]\n\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\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\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,\n angle=(0 if d[0] == \"horizontal\" else 90),\n 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,\n 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,\n 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,\n text=text, dimstyle=\"EZDXF\").render()\n\n doc.saveas(out_path)\n\n\nif __name__ == \"__main__\":\n out = sys.argv[1] if len(sys.argv) > 1 else \"0068_00685930_gt.dxf\"\n draw(out)\n print(\"wrote\", out)\n```"}], "images": ["images/0068_00685930.png"], "id": "0068_00685930"} {"messages": [{"role": "user", "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 72.63 mm tall. It is extruded to a thickness of 15.63 mm."}, {"role": "assistant", "content": "```python\n#!/usr/bin/env python3\n# -*- coding: utf-8 -*-\n# Ground-truth 2D engineering drawing for part: 0068_00686732\n# Self-contained: reproduces the three-view DXF via ezdxf, NO FreeCAD needed.\n# Coordinates are A4 page millimetres (scale=0.8511768292682949, page=[297.0, 210.0]).\n# visible edges -> solid (layer OUTLINE); hidden edges -> dashed (layer HIDDEN)\n# dimensions -> real movable DIMENSION entities (text = true mm value)\n# Run: python 0068_00686732_gt.py [out.dxf]\nimport sys\nimport ezdxf\nimport math\n\nSCALE = 0.8511768292682949\nPAGE = [297.0, 210.0]\n\nVISIBLE_SEGMENTS = [\n (172.409009, 99.73865, 172.409009, 161.560967),\n (172.409009, 161.560967, 87.291326, 161.560967),\n (87.291326, 161.560967, 87.291326, 99.73865),\n (87.291326, 99.73865, 172.409009, 99.73865),\n (172.409009, 85.73865, 172.409009, 72.439012),\n (87.291326, 85.73865, 87.291326, 72.439012),\n (87.291326, 72.439012, 172.409009, 72.439012),\n (87.291326, 85.73865, 172.409009, 85.73865),\n (199.708647, 161.560967, 186.409009, 161.560967),\n (186.409009, 161.560967, 186.409009, 99.73865),\n (199.708647, 99.73865, 186.409009, 99.73865),\n (199.708647, 161.560967, 199.708647, 99.73865)\n]\nVISIBLE_CIRCLES = [\n\n]\nVISIBLE_ARCS = [\n\n]\nHIDDEN_SEGMENTS = [\n\n]\n# (orient, text, p1, p2, base) for linear; (orient, text, center, radius, angle) for diameter\nDIMENSIONS = [\n ('horizontal', '100', (172.409, 99.7386), (87.2913, 99.7386), (129.8502, 88.7386)),\n ('vertical', '72.6316', (172.409, 161.561), (172.409, 99.7386), (183.409, 130.6498)),\n ('horizontal', '15.625', (199.7087, 161.561), (186.409, 161.561), (193.0588, 150.561))\n]\n\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\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\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,\n angle=(0 if d[0] == \"horizontal\" else 90),\n 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,\n 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,\n 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,\n text=text, dimstyle=\"EZDXF\").render()\n\n doc.saveas(out_path)\n\n\nif __name__ == \"__main__\":\n out = sys.argv[1] if len(sys.argv) > 1 else \"0068_00686732_gt.dxf\"\n draw(out)\n print(\"wrote\", out)\n```"}], "images": ["images/0068_00686732.png"], "id": "0068_00686732"} {"messages": [{"role": "user", "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 2.08 mm."}, {"role": "assistant", "content": "```python\n#!/usr/bin/env python3\n# -*- coding: utf-8 -*-\n# Ground-truth 2D engineering drawing for part: 0068_00689317\n# Self-contained: reproduces the three-view DXF via ezdxf, NO FreeCAD needed.\n# Coordinates are A4 page millimetres (scale=0.8409216867469886, page=[297.0, 210.0]).\n# visible edges -> solid (layer OUTLINE); hidden edges -> dashed (layer HIDDEN)\n# dimensions -> real movable DIMENSION entities (text = true mm value)\n# Run: python 0068_00689317_gt.py [out.dxf]\nimport sys\nimport ezdxf\nimport math\n\nSCALE = 0.8409216867469886\nPAGE = [297.0, 210.0]\n\nVISIBLE_SEGMENTS = [\n (177.67013, 93.452081, 177.67013, 156.299913),\n (177.67013, 156.299913, 93.577961, 156.299913),\n (93.577961, 156.299913, 93.577961, 93.452081),\n (93.577961, 93.452081, 177.67013, 93.452081),\n (177.67013, 79.452081, 177.67013, 77.700161),\n (93.577961, 79.452081, 93.577961, 77.700161),\n (93.577961, 77.700161, 177.67013, 77.700161),\n (93.577961, 79.452081, 177.67013, 79.452081),\n (193.42205, 156.299913, 191.67013, 156.299913),\n (191.67013, 156.299913, 191.67013, 93.452081),\n (193.42205, 93.452081, 191.67013, 93.452081),\n (193.42205, 156.299913, 193.42205, 93.452081)\n]\nVISIBLE_CIRCLES = [\n\n]\nVISIBLE_ARCS = [\n\n]\nHIDDEN_SEGMENTS = [\n\n]\n# (orient, text, p1, p2, base) for linear; (orient, text, center, radius, angle) for diameter\nDIMENSIONS = [\n ('horizontal', '100', (177.6701, 93.4521), (93.578, 93.4521), (135.624, 82.4521)),\n ('vertical', '74.7368', (177.6701, 156.2999), (177.6701, 93.4521), (188.6701, 124.876)),\n ('horizontal', '2.0833', (193.422, 156.2999), (191.6702, 156.2999), (192.5461, 145.2999))\n]\n\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\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\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,\n angle=(0 if d[0] == \"horizontal\" else 90),\n 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,\n 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,\n 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,\n text=text, dimstyle=\"EZDXF\").render()\n\n doc.saveas(out_path)\n\n\nif __name__ == \"__main__\":\n out = sys.argv[1] if len(sys.argv) > 1 else \"0068_00689317_gt.dxf\"\n draw(out)\n print(\"wrote\", out)\n```"}], "images": ["images/0068_00689317.png"], "id": "0068_00689317"} {"messages": [{"role": "user", "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 3.21 mm."}, {"role": "assistant", "content": "```python\n#!/usr/bin/env python3\n# -*- coding: utf-8 -*-\n# Ground-truth 2D engineering drawing for part: 0069_00690856\n# Self-contained: reproduces the three-view DXF via ezdxf, NO FreeCAD needed.\n# Coordinates are A4 page millimetres (scale=0.9311552795031706, page=[297.0, 210.0]).\n# visible edges -> solid (layer OUTLINE); hidden edges -> dashed (layer HIDDEN)\n# dimensions -> real movable DIMENSION entities (text = true mm value)\n# Run: python 0069_00690856_gt.py [out.dxf]\nimport sys\nimport ezdxf\nimport math\n\nSCALE = 0.9311552795031706\nPAGE = [297.0, 210.0]\n\nVISIBLE_SEGMENTS = [\n (170.783712, 172.050017, 170.783712, 78.934489),\n (170.783712, 78.934489, 99.23178, 78.934489),\n (99.23178, 78.934489, 99.23178, 172.050017),\n (99.23178, 172.050017, 170.783712, 172.050017),\n (170.783712, 61.950017, 170.783712, 64.934489),\n (170.783712, 64.934489, 99.23178, 64.934489),\n (99.23178, 61.950017, 99.23178, 64.934489),\n (170.783712, 61.950017, 99.23178, 61.950017),\n (184.783712, 78.934489, 187.768184, 78.934489),\n (187.768184, 78.934489, 187.768184, 172.050017),\n (184.783712, 172.050017, 187.768184, 172.050017),\n (184.783712, 78.934489, 184.783712, 172.050017)\n]\nVISIBLE_CIRCLES = [\n\n]\nVISIBLE_ARCS = [\n\n]\nHIDDEN_SEGMENTS = [\n\n]\n# (orient, text, p1, p2, base) for linear; (orient, text, center, radius, angle) for diameter\nDIMENSIONS = [\n ('horizontal', '76.8421', (170.7837, 172.05), (99.2318, 172.05), (135.0078, 161.05)),\n ('vertical', '100', (170.7837, 78.9345), (170.7837, 172.05), (159.7837, 125.4922)),\n ('horizontal', '3.2051', (184.7837, 78.9345), (187.7682, 78.9345), (186.276, 89.9345))\n]\n\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\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\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,\n angle=(0 if d[0] == \"horizontal\" else 90),\n 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,\n 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,\n 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,\n text=text, dimstyle=\"EZDXF\").render()\n\n doc.saveas(out_path)\n\n\nif __name__ == \"__main__\":\n out = sys.argv[1] if len(sys.argv) > 1 else \"0069_00690856_gt.dxf\"\n draw(out)\n print(\"wrote\", out)\n```"}], "images": ["images/0069_00690856.png"], "id": "0069_00690856"} {"messages": [{"role": "user", "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 25.26 mm tall. It is extruded to a thickness of 12.23 mm."}, {"role": "assistant", "content": "```python\n#!/usr/bin/env python3\n# -*- coding: utf-8 -*-\n# Ground-truth 2D engineering drawing for part: 0069_00698234\n# Self-contained: reproduces the three-view DXF via ezdxf, NO FreeCAD needed.\n# Coordinates are A4 page millimetres (scale=1.1730504201681125, page=[297.0, 210.0]).\n# visible edges -> solid (layer OUTLINE); hidden edges -> dashed (layer HIDDEN)\n# dimensions -> real movable DIMENSION entities (text = true mm value)\n# Run: python 0069_00698234_gt.py [out.dxf]\nimport sys\nimport ezdxf\nimport math\n\nSCALE = 1.1730504201681125\nPAGE = [297.0, 210.0]\n\nVISIBLE_SEGMENTS = [\n (187.976979, 116.358065, 187.976979, 145.993023),\n (187.976979, 145.993023, 70.671937, 145.993023),\n (70.671937, 145.993023, 70.671937, 116.358065),\n (70.671937, 116.358065, 187.976979, 116.358065),\n (187.976979, 102.358065, 187.976979, 88.006916),\n (70.671937, 102.358065, 70.671937, 88.006916),\n (70.671937, 88.006916, 187.976979, 88.006916),\n (70.671937, 102.358065, 187.976979, 102.358065),\n (216.328127, 145.993023, 201.976979, 145.993023),\n (201.976979, 145.993023, 201.976979, 116.358065),\n (216.328127, 116.358065, 201.976979, 116.358065),\n (216.328127, 145.993023, 216.328127, 116.358065)\n]\nVISIBLE_CIRCLES = [\n\n]\nVISIBLE_ARCS = [\n\n]\nHIDDEN_SEGMENTS = [\n\n]\n# (orient, text, p1, p2, base) for linear; (orient, text, center, radius, angle) for diameter\nDIMENSIONS = [\n ('horizontal', '100', (187.977, 116.3581), (70.6719, 116.3581), (129.3245, 105.3581)),\n ('vertical', '25.2632', (187.977, 145.993), (187.977, 116.3581), (198.977, 131.1756)),\n ('horizontal', '12.234', (216.3281, 145.993), (201.977, 145.993), (209.1525, 134.993))\n]\n\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\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\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,\n angle=(0 if d[0] == \"horizontal\" else 90),\n 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,\n 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,\n 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,\n text=text, dimstyle=\"EZDXF\").render()\n\n doc.saveas(out_path)\n\n\nif __name__ == \"__main__\":\n out = sys.argv[1] if len(sys.argv) > 1 else \"0069_00698234_gt.dxf\"\n draw(out)\n print(\"wrote\", out)\n```"}], "images": ["images/0069_00698234.png"], "id": "0069_00698234"} {"messages": [{"role": "user", "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 46.32 mm tall. It is extruded to a thickness of 28.03 mm."}, {"role": "assistant", "content": "```python\n#!/usr/bin/env python3\n# -*- coding: utf-8 -*-\n# Ground-truth 2D engineering drawing for part: 0069_00698869\n# Self-contained: reproduces the three-view DXF via ezdxf, NO FreeCAD needed.\n# Coordinates are A4 page millimetres (scale=1.0042661870503817, page=[297.0, 210.0]).\n# visible edges -> solid (layer OUTLINE); hidden edges -> dashed (layer HIDDEN)\n# dimensions -> real movable DIMENSION entities (text = true mm value)\n# Run: python 0069_00698869_gt.py [out.dxf]\nimport sys\nimport ezdxf\nimport math\n\nSCALE = 1.0042661870503817\nPAGE = [297.0, 210.0]\n\nVISIBLE_SEGMENTS = [\n (172.638387, 161.331693, 172.638387, 114.818311),\n (172.638387, 114.818311, 72.211768, 114.818311),\n (72.211768, 114.818311, 72.211768, 161.331693),\n (72.211768, 161.331693, 172.638387, 161.331693),\n (172.638387, 72.668426, 172.638387, 100.818311),\n (72.211768, 72.668426, 72.211768, 100.818311),\n (72.211768, 100.818311, 172.638387, 100.818311),\n (72.211768, 72.668426, 172.638387, 72.668426),\n (214.788272, 114.818311, 186.638387, 114.818311),\n (186.638387, 114.818311, 186.638387, 161.331693),\n (214.788272, 161.331693, 186.638387, 161.331693),\n (214.788272, 114.818311, 214.788272, 161.331693)\n]\nVISIBLE_CIRCLES = [\n\n]\nVISIBLE_ARCS = [\n\n]\nHIDDEN_SEGMENTS = [\n\n]\n# (orient, text, p1, p2, base) for linear; (orient, text, center, radius, angle) for diameter\nDIMENSIONS = [\n ('horizontal', '100', (172.6384, 114.8183), (72.2117, 114.8183), (122.4251, 103.8183)),\n ('vertical', '46.3158', (172.6384, 161.3317), (172.6384, 114.8183), (183.6384, 138.075)),\n ('horizontal', '28.0303', (214.7883, 161.3317), (186.6384, 161.3317), (200.7133, 150.3317))\n]\n\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\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\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,\n angle=(0 if d[0] == \"horizontal\" else 90),\n 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,\n 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,\n 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,\n text=text, dimstyle=\"EZDXF\").render()\n\n doc.saveas(out_path)\n\n\nif __name__ == \"__main__\":\n out = sys.argv[1] if len(sys.argv) > 1 else \"0069_00698869_gt.dxf\"\n draw(out)\n print(\"wrote\", out)\n```"}], "images": ["images/0069_00698869.png"], "id": "0069_00698869"} {"messages": [{"role": "user", "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 56.84 mm tall. It is extruded to a thickness of 24.48 mm."}, {"role": "assistant", "content": "```python\n#!/usr/bin/env python3\n# -*- coding: utf-8 -*-\n# Ground-truth 2D engineering drawing for part: 0069_00698870\n# Self-contained: reproduces the three-view DXF via ezdxf, NO FreeCAD needed.\n# Coordinates are A4 page millimetres (scale=0.9368657718120976, page=[297.0, 210.0]).\n# visible edges -> solid (layer OUTLINE); hidden edges -> dashed (layer HIDDEN)\n# dimensions -> real movable DIMENSION entities (text = true mm value)\n# Run: python 0069_00698870_gt.py [out.dxf]\nimport sys\nimport ezdxf\nimport math\n\nSCALE = 0.9368657718120976\nPAGE = [297.0, 210.0]\n\nVISIBLE_SEGMENTS = [\n (171.876417, 108.840086, 171.876417, 162.093509),\n (171.876417, 162.093509, 78.18984, 162.093509),\n (78.18984, 162.093509, 78.18984, 108.840086),\n (78.18984, 108.840086, 171.876417, 108.840086),\n (171.876417, 94.840086, 171.876417, 71.906393),\n (78.18984, 94.840086, 78.18984, 71.906393),\n (78.18984, 71.906393, 171.876417, 71.906393),\n (78.18984, 94.840086, 171.876417, 94.840086),\n (208.81011, 162.093509, 185.876417, 162.093509),\n (185.876417, 162.093509, 185.876417, 108.840086),\n (208.81011, 108.840086, 185.876417, 108.840086),\n (208.81011, 162.093509, 208.81011, 108.840086)\n]\nVISIBLE_CIRCLES = [\n\n]\nVISIBLE_ARCS = [\n\n]\nHIDDEN_SEGMENTS = [\n\n]\n# (orient, text, p1, p2, base) for linear; (orient, text, center, radius, angle) for diameter\nDIMENSIONS = [\n ('horizontal', '100', (171.8764, 108.8401), (78.1899, 108.8401), (125.0332, 97.8401)),\n ('vertical', '56.8421', (171.8764, 162.0935), (171.8764, 108.8401), (182.8764, 135.4668)),\n ('horizontal', '24.4792', (208.8101, 162.0935), (185.8764, 162.0935), (197.3433, 151.0935))\n]\n\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\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\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,\n angle=(0 if d[0] == \"horizontal\" else 90),\n 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,\n 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,\n 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,\n text=text, dimstyle=\"EZDXF\").render()\n\n doc.saveas(out_path)\n\n\nif __name__ == \"__main__\":\n out = sys.argv[1] if len(sys.argv) > 1 else \"0069_00698870_gt.dxf\"\n draw(out)\n print(\"wrote\", out)\n```"}], "images": ["images/0069_00698870.png"], "id": "0069_00698870"} {"messages": [{"role": "user", "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 0.52 mm."}, {"role": "assistant", "content": "```python\n#!/usr/bin/env python3\n# -*- coding: utf-8 -*-\n# Ground-truth 2D engineering drawing for part: 0069_00699887\n# Self-contained: reproduces the three-view DXF via ezdxf, NO FreeCAD needed.\n# Coordinates are A4 page millimetres (scale=1.461786528497414, page=[297.0, 210.0]).\n# visible edges -> solid (layer OUTLINE); hidden edges -> dashed (layer HIDDEN)\n# dimensions -> real movable DIMENSION entities (text = true mm value)\n# Run: python 0069_00699887_gt.py [out.dxf]\nimport sys\nimport ezdxf\nimport math\n\nSCALE = 1.461786528497414\nPAGE = [297.0, 210.0]\n\nVISIBLE_SEGMENTS = [\n (209.208681, 161.309993, 209.208681, 87.451305),\n (209.208681, 87.451305, 63.030028, 87.451305),\n (63.030028, 87.451305, 63.030028, 161.309993),\n (63.030028, 161.309993, 209.208681, 161.309993),\n (209.208681, 72.689958, 209.208681, 73.451305),\n (209.208681, 73.451305, 63.030028, 73.451305),\n (63.030028, 72.689958, 63.030028, 73.451305),\n (209.208681, 72.689958, 63.030028, 72.689958),\n (223.208681, 87.451305, 223.970028, 87.451305),\n (223.970028, 87.451305, 223.970028, 161.309993),\n (223.208681, 161.309993, 223.970028, 161.309993),\n (223.208681, 87.451305, 223.208681, 161.309993)\n]\nVISIBLE_CIRCLES = [\n\n]\nVISIBLE_ARCS = [\n\n]\nHIDDEN_SEGMENTS = [\n\n]\n# (orient, text, p1, p2, base) for linear; (orient, text, center, radius, angle) for diameter\nDIMENSIONS = [\n ('horizontal', '100', (209.2087, 161.31), (63.03, 161.31), (136.1193, 150.31)),\n ('vertical', '50.5263', (209.2087, 87.4513), (209.2087, 161.31), (198.2087, 124.3807)),\n ('horizontal', '0.5208', (223.2087, 87.4513), (223.97, 87.4513), (223.5893, 98.4513))\n]\n\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\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\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,\n angle=(0 if d[0] == \"horizontal\" else 90),\n 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,\n 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,\n 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,\n text=text, dimstyle=\"EZDXF\").render()\n\n doc.saveas(out_path)\n\n\nif __name__ == \"__main__\":\n out = sys.argv[1] if len(sys.argv) > 1 else \"0069_00699887_gt.dxf\"\n draw(out)\n print(\"wrote\", out)\n```"}], "images": ["images/0069_00699887.png"], "id": "0069_00699887"} {"messages": [{"role": "user", "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 3.27 mm."}, {"role": "assistant", "content": "```python\n#!/usr/bin/env python3\n# -*- coding: utf-8 -*-\n# Ground-truth 2D engineering drawing for part: 0069_00699929\n# Self-contained: reproduces the three-view DXF via ezdxf, NO FreeCAD needed.\n# Coordinates are A4 page millimetres (scale=1.0495714285715259, page=[297.0, 210.0]).\n# visible edges -> solid (layer OUTLINE); hidden edges -> dashed (layer HIDDEN)\n# dimensions -> real movable DIMENSION entities (text = true mm value)\n# Run: python 0069_00699929_gt.py [out.dxf]\nimport sys\nimport ezdxf\nimport math\n\nSCALE = 1.0495714285715259\nPAGE = [297.0, 210.0]\n\nVISIBLE_SEGMENTS = [\n (187.263594, 104.723626, 187.263594, 146.706483),\n (187.263594, 146.706483, 82.306451, 146.706483),\n (82.306451, 146.706483, 82.306451, 104.723626),\n (82.306451, 104.723626, 187.263594, 104.723626),\n (187.263594, 90.723626, 187.263594, 87.293654),\n (82.306451, 90.723626, 82.306451, 87.293654),\n (82.306451, 87.293654, 187.263594, 87.293654),\n (82.306451, 90.723626, 187.263594, 90.723626),\n (204.693566, 146.706483, 201.263594, 146.706483),\n (201.263594, 146.706483, 201.263594, 104.723626),\n (204.693566, 104.723626, 201.263594, 104.723626),\n (204.693566, 146.706483, 204.693566, 104.723626)\n]\nVISIBLE_CIRCLES = [\n\n]\nVISIBLE_ARCS = [\n\n]\nHIDDEN_SEGMENTS = [\n\n]\n# (orient, text, p1, p2, base) for linear; (orient, text, center, radius, angle) for diameter\nDIMENSIONS = [\n ('horizontal', '100', (187.2636, 104.7236), (82.3064, 104.7236), (134.785, 93.7236)),\n ('vertical', '40', (187.2636, 146.7065), (187.2636, 104.7236), (198.2636, 125.715)),\n ('horizontal', '3.268', (204.6936, 146.7065), (201.2636, 146.7065), (202.9786, 135.7065))\n]\n\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\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\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,\n angle=(0 if d[0] == \"horizontal\" else 90),\n 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,\n 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,\n 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,\n text=text, dimstyle=\"EZDXF\").render()\n\n doc.saveas(out_path)\n\n\nif __name__ == \"__main__\":\n out = sys.argv[1] if len(sys.argv) > 1 else \"0069_00699929_gt.dxf\"\n draw(out)\n print(\"wrote\", out)\n```"}], "images": ["images/0069_00699929.png"], "id": "0069_00699929"} {"messages": [{"role": "user", "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 0.53 mm."}, {"role": "assistant", "content": "```python\n#!/usr/bin/env python3\n# -*- coding: utf-8 -*-\n# Ground-truth 2D engineering drawing for part: 0070_00701670\n# Self-contained: reproduces the three-view DXF via ezdxf, NO FreeCAD needed.\n# Coordinates are A4 page millimetres (scale=1.034022222222322, page=[297.0, 210.0]).\n# visible edges -> solid (layer OUTLINE); hidden edges -> dashed (layer HIDDEN)\n# dimensions -> real movable DIMENSION entities (text = true mm value)\n# Run: python 0070_00701670_gt.py [out.dxf]\nimport sys\nimport ezdxf\nimport math\n\nSCALE = 1.034022222222322\nPAGE = [297.0, 210.0]\n\nVISIBLE_SEGMENTS = [\n (187.929, 102.503253, 187.929, 146.041031),\n (187.929, 146.041031, 84.526778, 146.041031),\n (84.526778, 146.041031, 84.526778, 102.503253),\n (84.526778, 102.503253, 187.929, 102.503253),\n (187.929, 88.503253, 187.929, 87.959031),\n (84.526778, 88.503253, 84.526778, 87.959031),\n (84.526778, 87.959031, 187.929, 87.959031),\n (84.526778, 88.503253, 187.929, 88.503253),\n (202.473222, 146.041031, 201.929, 146.041031),\n (201.929, 146.041031, 201.929, 102.503253),\n (202.473222, 102.503253, 201.929, 102.503253),\n (202.473222, 146.041031, 202.473222, 102.503253)\n]\nVISIBLE_CIRCLES = [\n\n]\nVISIBLE_ARCS = [\n\n]\nHIDDEN_SEGMENTS = [\n\n]\n# (orient, text, p1, p2, base) for linear; (orient, text, center, radius, angle) for diameter\nDIMENSIONS = [\n ('horizontal', '100', (187.929, 102.5033), (84.5268, 102.5033), (136.2279, 91.5033)),\n ('vertical', '42.1053', (187.929, 146.041), (187.929, 102.5033), (198.929, 124.2721)),\n ('horizontal', '0.5263', (202.4732, 146.041), (201.929, 146.041), (202.2011, 135.041))\n]\n\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\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\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,\n angle=(0 if d[0] == \"horizontal\" else 90),\n 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,\n 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,\n 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,\n text=text, dimstyle=\"EZDXF\").render()\n\n doc.saveas(out_path)\n\n\nif __name__ == \"__main__\":\n out = sys.argv[1] if len(sys.argv) > 1 else \"0070_00701670_gt.dxf\"\n draw(out)\n print(\"wrote\", out)\n```"}], "images": ["images/0070_00701670.png"], "id": "0070_00701670"} {"messages": [{"role": "user", "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 10.53 mm."}, {"role": "assistant", "content": "```python\n#!/usr/bin/env python3\n# -*- coding: utf-8 -*-\n# Ground-truth 2D engineering drawing for part: 0070_00704874\n# Self-contained: reproduces the three-view DXF via ezdxf, NO FreeCAD needed.\n# Coordinates are A4 page millimetres (scale=0.8694761904768487, page=[297.0, 210.0]).\n# visible edges -> solid (layer OUTLINE); hidden edges -> dashed (layer HIDDEN)\n# dimensions -> real movable DIMENSION entities (text = true mm value)\n# Run: python 0070_00704874_gt.py [out.dxf]\nimport sys\nimport ezdxf\nimport math\n\nSCALE = 0.8694761904768487\nPAGE = [297.0, 210.0]\n\nVISIBLE_SEGMENTS = [\n (149.313313, 85.102389, 149.313313, 172.050008),\n (149.313313, 172.050008, 114.534266, 172.050008),\n (114.534266, 172.050008, 114.534266, 85.102389),\n (114.534266, 85.102389, 149.313313, 85.102389),\n (149.313313, 71.102389, 149.313313, 61.950008),\n (114.534266, 71.102389, 114.534266, 61.950008),\n (114.534266, 61.950008, 149.313313, 61.950008),\n (114.534266, 71.102389, 149.313313, 71.102389),\n (172.465694, 172.050008, 163.313313, 172.050008),\n (163.313313, 172.050008, 163.313313, 85.102389),\n (172.465694, 85.102389, 163.313313, 85.102389),\n (172.465694, 172.050008, 172.465694, 85.102389)\n]\nVISIBLE_CIRCLES = [\n\n]\nVISIBLE_ARCS = [\n\n]\nHIDDEN_SEGMENTS = [\n\n]\n# (orient, text, p1, p2, base) for linear; (orient, text, center, radius, angle) for diameter\nDIMENSIONS = [\n ('horizontal', '40', (149.3133, 85.1024), (114.5343, 85.1024), (131.9238, 74.1024)),\n ('vertical', '100', (149.3133, 172.05), (149.3133, 85.1024), (160.3133, 128.5762)),\n ('horizontal', '10.5263', (172.4657, 172.05), (163.3133, 172.05), (167.8895, 161.05))\n]\n\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\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\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,\n angle=(0 if d[0] == \"horizontal\" else 90),\n 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,\n 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,\n 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,\n text=text, dimstyle=\"EZDXF\").render()\n\n doc.saveas(out_path)\n\n\nif __name__ == \"__main__\":\n out = sys.argv[1] if len(sys.argv) > 1 else \"0070_00704874_gt.dxf\"\n draw(out)\n print(\"wrote\", out)\n```"}], "images": ["images/0070_00704874.png"], "id": "0070_00704874"} {"messages": [{"role": "user", "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 133.33 mm."}, {"role": "assistant", "content": "```python\n#!/usr/bin/env python3\n# -*- coding: utf-8 -*-\n# Ground-truth 2D engineering drawing for part: 0070_00705653\n# Self-contained: reproduces the three-view DXF via ezdxf, NO FreeCAD needed.\n# Coordinates are A4 page millimetres (scale=0.41185714285714875, page=[297.0, 210.0]).\n# visible edges -> solid (layer OUTLINE); hidden edges -> dashed (layer HIDDEN)\n# dimensions -> real movable DIMENSION entities (text = true mm value)\n# Run: python 0070_00705653_gt.py [out.dxf]\nimport sys\nimport ezdxf\nimport math\n\nSCALE = 0.41185714285714875\nPAGE = [297.0, 210.0]\n\nVISIBLE_SEGMENTS = [\n (124.65007, 172.050009, 124.65007, 130.864294),\n (124.65007, 130.864294, 93.435634, 130.864294),\n (93.435634, 130.864294, 93.435634, 172.050009),\n (93.435634, 172.050009, 124.65007, 172.050009),\n (124.65007, 61.950009, 124.65007, 116.864294),\n (124.65007, 116.864294, 93.435634, 116.864294),\n (93.435634, 61.950009, 93.435634, 116.864294),\n (124.65007, 61.950009, 93.435634, 61.950009),\n (138.65007, 130.864294, 193.564356, 130.864294),\n (193.564356, 130.864294, 193.564356, 172.050009),\n (138.65007, 172.050009, 193.564356, 172.050009),\n (138.65007, 130.864294, 138.65007, 172.050009)\n]\nVISIBLE_CIRCLES = [\n\n]\nVISIBLE_ARCS = [\n\n]\nHIDDEN_SEGMENTS = [\n\n]\n# (orient, text, p1, p2, base) for linear; (orient, text, center, radius, angle) for diameter\nDIMENSIONS = [\n ('horizontal', '75.7895', (124.6501, 172.05), (93.4356, 172.05), (109.0429, 161.05)),\n ('vertical', '100', (124.6501, 130.8643), (124.6501, 172.05), (113.6501, 151.4571)),\n ('horizontal', '133.333', (138.6501, 130.8643), (193.5643, 130.8643), (166.1072, 141.8643))\n]\n\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\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\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,\n angle=(0 if d[0] == \"horizontal\" else 90),\n 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,\n 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,\n 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,\n text=text, dimstyle=\"EZDXF\").render()\n\n doc.saveas(out_path)\n\n\nif __name__ == \"__main__\":\n out = sys.argv[1] if len(sys.argv) > 1 else \"0070_00705653_gt.dxf\"\n draw(out)\n print(\"wrote\", out)\n```"}], "images": ["images/0070_00705653.png"], "id": "0070_00705653"} {"messages": [{"role": "user", "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 57.89 mm wide and 100 mm tall. It is extruded to a thickness of 5.21 mm."}, {"role": "assistant", "content": "```python\n#!/usr/bin/env python3\n# -*- coding: utf-8 -*-\n# Ground-truth 2D engineering drawing for part: 0070_00709006\n# Self-contained: reproduces the three-view DXF via ezdxf, NO FreeCAD needed.\n# Coordinates are A4 page millimetres (scale=0.9134257425742601, page=[297.0, 210.0]).\n# visible edges -> solid (layer OUTLINE); hidden edges -> dashed (layer HIDDEN)\n# dimensions -> real movable DIMENSION entities (text = true mm value)\n# Run: python 0070_00709006_gt.py [out.dxf]\nimport sys\nimport ezdxf\nimport math\n\nSCALE = 0.9134257425742601\nPAGE = [297.0, 210.0]\n\nVISIBLE_SEGMENTS = [\n (160.562583, 80.707415, 160.562583, 172.04999),\n (160.562583, 172.04999, 107.68004, 172.04999),\n (107.68004, 172.04999, 107.68004, 80.707415),\n (107.68004, 80.707415, 160.562583, 80.707415),\n (160.562583, 66.707415, 160.562583, 61.94999),\n (107.68004, 66.707415, 107.68004, 61.94999),\n (107.68004, 61.94999, 160.562583, 61.94999),\n (107.68004, 66.707415, 160.562583, 66.707415),\n (179.320009, 172.04999, 174.562583, 172.04999),\n (174.562583, 172.04999, 174.562583, 80.707415),\n (179.320009, 80.707415, 174.562583, 80.707415),\n (179.320009, 172.04999, 179.320009, 80.707415)\n]\nVISIBLE_CIRCLES = [\n\n]\nVISIBLE_ARCS = [\n\n]\nHIDDEN_SEGMENTS = [\n\n]\n# (orient, text, p1, p2, base) for linear; (orient, text, center, radius, angle) for diameter\nDIMENSIONS = [\n ('horizontal', '57.8947', (160.5626, 80.7074), (107.68, 80.7074), (134.1213, 69.7074)),\n ('vertical', '100', (160.5626, 172.05), (160.5626, 80.7074), (171.5626, 126.3787)),\n ('horizontal', '5.2083', (179.32, 172.05), (174.5626, 172.05), (176.9413, 161.05))\n]\n\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\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\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,\n angle=(0 if d[0] == \"horizontal\" else 90),\n 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,\n 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,\n 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,\n text=text, dimstyle=\"EZDXF\").render()\n\n doc.saveas(out_path)\n\n\nif __name__ == \"__main__\":\n out = sys.argv[1] if len(sys.argv) > 1 else \"0070_00709006_gt.dxf\"\n draw(out)\n print(\"wrote\", out)\n```"}], "images": ["images/0070_00709006.png"], "id": "0070_00709006"} {"messages": [{"role": "user", "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 2.08 mm."}, {"role": "assistant", "content": "```python\n#!/usr/bin/env python3\n# -*- coding: utf-8 -*-\n# Ground-truth 2D engineering drawing for part: 0070_00709492\n# Self-contained: reproduces the three-view DXF via ezdxf, NO FreeCAD needed.\n# Coordinates are A4 page millimetres (scale=1.4394122448979638, page=[297.0, 210.0]).\n# visible edges -> solid (layer OUTLINE); hidden edges -> dashed (layer HIDDEN)\n# dimensions -> real movable DIMENSION entities (text = true mm value)\n# Run: python 0070_00709492_gt.py [out.dxf]\nimport sys\nimport ezdxf\nimport math\n\nSCALE = 1.4394122448979638\nPAGE = [297.0, 210.0]\n\nVISIBLE_SEGMENTS = [\n (206.97121, 155.045236, 206.97121, 95.953576),\n (206.97121, 95.953576, 63.029985, 95.953576),\n (63.029985, 95.953576, 63.029985, 155.045236),\n (63.029985, 155.045236, 206.97121, 155.045236),\n (206.97121, 78.9548, 206.97121, 81.953576),\n (206.97121, 81.953576, 63.029985, 81.953576),\n (63.029985, 78.9548, 63.029985, 81.953576),\n (206.97121, 78.9548, 63.029985, 78.9548),\n (220.97121, 95.953576, 223.969985, 95.953576),\n (223.969985, 95.953576, 223.969985, 155.045236),\n (220.97121, 155.045236, 223.969985, 155.045236),\n (220.97121, 95.953576, 220.97121, 155.045236)\n]\nVISIBLE_CIRCLES = [\n\n]\nVISIBLE_ARCS = [\n\n]\nHIDDEN_SEGMENTS = [\n\n]\n# (orient, text, p1, p2, base) for linear; (orient, text, center, radius, angle) for diameter\nDIMENSIONS = [\n ('horizontal', '100', (206.9712, 155.0452), (63.03, 155.0452), (135.0006, 144.0452)),\n ('vertical', '41.0526', (206.9712, 95.9536), (206.9712, 155.0452), (195.9712, 125.4994)),\n ('horizontal', '2.0833', (220.9712, 95.9536), (223.97, 95.9536), (222.4706, 106.9536))\n]\n\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\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\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,\n angle=(0 if d[0] == \"horizontal\" else 90),\n 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,\n 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,\n 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,\n text=text, dimstyle=\"EZDXF\").render()\n\n doc.saveas(out_path)\n\n\nif __name__ == \"__main__\":\n out = sys.argv[1] if len(sys.argv) > 1 else \"0070_00709492_gt.dxf\"\n draw(out)\n print(\"wrote\", out)\n```"}], "images": ["images/0070_00709492.png"], "id": "0070_00709492"} {"messages": [{"role": "user", "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 95.79 mm tall. It is extruded to a thickness of 35.42 mm."}, {"role": "assistant", "content": "```python\n#!/usr/bin/env python3\n# -*- coding: utf-8 -*-\n# Ground-truth 2D engineering drawing for part: 0071_00717573\n# Self-contained: reproduces the three-view DXF via ezdxf, NO FreeCAD needed.\n# Coordinates are A4 page millimetres (scale=0.7324352331606563, page=[297.0, 210.0]).\n# visible edges -> solid (layer OUTLINE); hidden edges -> dashed (layer HIDDEN)\n# dimensions -> real movable DIMENSION entities (text = true mm value)\n# Run: python 0071_00717573_gt.py [out.dxf]\nimport sys\nimport ezdxf\nimport math\n\nSCALE = 0.7324352331606563\nPAGE = [297.0, 210.0]\n\nVISIBLE_SEGMENTS = [\n (160.151582, 172.049991, 160.151582, 101.890406),\n (160.151582, 101.890406, 86.908058, 101.890406),\n (86.908058, 101.890406, 86.908058, 172.049991),\n (86.908058, 172.049991, 160.151582, 172.049991),\n (160.151582, 61.949991, 160.151582, 87.890406),\n (160.151582, 87.890406, 86.908058, 87.890406),\n (86.908058, 61.949991, 86.908058, 87.890406),\n (160.151582, 61.949991, 86.908058, 61.949991),\n (174.151582, 101.890406, 200.091996, 101.890406),\n (200.091996, 101.890406, 200.091996, 172.049991),\n (174.151582, 172.049991, 200.091996, 172.049991),\n (174.151582, 101.890406, 174.151582, 172.049991)\n]\nVISIBLE_CIRCLES = [\n\n]\nVISIBLE_ARCS = [\n\n]\nHIDDEN_SEGMENTS = [\n\n]\n# (orient, text, p1, p2, base) for linear; (orient, text, center, radius, angle) for diameter\nDIMENSIONS = [\n ('horizontal', '100', (160.1516, 172.05), (86.908, 172.05), (123.5298, 161.05)),\n ('vertical', '95.7895', (160.1516, 101.8904), (160.1516, 172.05), (149.1516, 136.9702)),\n ('horizontal', '35.4167', (174.1516, 101.8904), (200.092, 101.8904), (187.1218, 112.8904))\n]\n\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\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\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,\n angle=(0 if d[0] == \"horizontal\" else 90),\n 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,\n 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,\n 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,\n text=text, dimstyle=\"EZDXF\").render()\n\n doc.saveas(out_path)\n\n\nif __name__ == \"__main__\":\n out = sys.argv[1] if len(sys.argv) > 1 else \"0071_00717573_gt.dxf\"\n draw(out)\n print(\"wrote\", out)\n```"}], "images": ["images/0071_00717573.png"], "id": "0071_00717573"} {"messages": [{"role": "user", "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 7.29 mm."}, {"role": "assistant", "content": "```python\n#!/usr/bin/env python3\n# -*- coding: utf-8 -*-\n# Ground-truth 2D engineering drawing for part: 0071_00717931\n# Self-contained: reproduces the three-view DXF via ezdxf, NO FreeCAD needed.\n# Coordinates are A4 page millimetres (scale=1.0340222222222202, page=[297.0, 210.0]).\n# visible edges -> solid (layer OUTLINE); hidden edges -> dashed (layer HIDDEN)\n# dimensions -> real movable DIMENSION entities (text = true mm value)\n# Run: python 0071_00717931_gt.py [out.dxf]\nimport sys\nimport ezdxf\nimport math\n\nSCALE = 1.0340222222222202\nPAGE = [297.0, 210.0]\n\nVISIBLE_SEGMENTS = [\n (184.431215, 106.000973, 184.431215, 149.538751),\n (184.431215, 149.538751, 81.028993, 149.538751),\n (81.028993, 149.538751, 81.028993, 106.000973),\n (81.028993, 106.000973, 184.431215, 106.000973),\n (184.431215, 92.000973, 184.431215, 84.461228),\n (81.028993, 92.000973, 81.028993, 84.461228),\n (81.028993, 84.461228, 184.431215, 84.461228),\n (81.028993, 92.000973, 184.431215, 92.000973),\n (205.970961, 149.538751, 198.431215, 149.538751),\n (198.431215, 149.538751, 198.431215, 106.000973),\n (205.970961, 106.000973, 198.431215, 106.000973),\n (205.970961, 149.538751, 205.970961, 106.000973)\n]\nVISIBLE_CIRCLES = [\n\n]\nVISIBLE_ARCS = [\n\n]\nHIDDEN_SEGMENTS = [\n\n]\n# (orient, text, p1, p2, base) for linear; (orient, text, center, radius, angle) for diameter\nDIMENSIONS = [\n ('horizontal', '100', (184.4312, 106.0009), (81.029, 106.0009), (132.7301, 95.0009)),\n ('vertical', '42.1053', (184.4312, 149.5388), (184.4312, 106.0009), (195.4312, 127.7699)),\n ('horizontal', '7.2917', (205.971, 149.5388), (198.4312, 149.5388), (202.2011, 138.5388))\n]\n\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\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\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,\n angle=(0 if d[0] == \"horizontal\" else 90),\n 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,\n 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,\n 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,\n text=text, dimstyle=\"EZDXF\").render()\n\n doc.saveas(out_path)\n\n\nif __name__ == \"__main__\":\n out = sys.argv[1] if len(sys.argv) > 1 else \"0071_00717931_gt.dxf\"\n draw(out)\n print(\"wrote\", out)\n```"}], "images": ["images/0071_00717931.png"], "id": "0071_00717931"} {"messages": [{"role": "user", "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 45.26 mm tall. It is extruded to a thickness of 1.04 mm."}, {"role": "assistant", "content": "```python\n#!/usr/bin/env python3\n# -*- coding: utf-8 -*-\n# Ground-truth 2D engineering drawing for part: 0071_00719659\n# Self-contained: reproduces the three-view DXF via ezdxf, NO FreeCAD needed.\n# Coordinates are A4 page millimetres (scale=1.4542515463917478, page=[297.0, 210.0]).\n# visible edges -> solid (layer OUTLINE); hidden edges -> dashed (layer HIDDEN)\n# dimensions -> real movable DIMENSION entities (text = true mm value)\n# Run: python 0071_00719659_gt.py [out.dxf]\nimport sys\nimport ezdxf\nimport math\n\nSCALE = 1.4542515463917478\nPAGE = [297.0, 210.0]\n\nVISIBLE_SEGMENTS = [\n (208.455182, 157.66945, 208.455182, 91.845433),\n (208.455182, 91.845433, 63.030027, 91.845433),\n (63.030027, 91.845433, 63.030027, 157.66945),\n (63.030027, 157.66945, 208.455182, 157.66945),\n (208.455182, 76.330588, 208.455182, 77.845433),\n (208.455182, 77.845433, 63.030027, 77.845433),\n (63.030027, 76.330588, 63.030027, 77.845433),\n (208.455182, 76.330588, 63.030027, 76.330588),\n (222.455182, 91.845433, 223.970027, 91.845433),\n (223.970027, 91.845433, 223.970027, 157.66945),\n (222.455182, 157.66945, 223.970027, 157.66945),\n (222.455182, 91.845433, 222.455182, 157.66945)\n]\nVISIBLE_CIRCLES = [\n\n]\nVISIBLE_ARCS = [\n\n]\nHIDDEN_SEGMENTS = [\n\n]\n# (orient, text, p1, p2, base) for linear; (orient, text, center, radius, angle) for diameter\nDIMENSIONS = [\n ('horizontal', '100', (208.4552, 157.6695), (63.03, 157.6695), (135.7426, 146.6695)),\n ('vertical', '45.2632', (208.4552, 91.8454), (208.4552, 157.6695), (197.4552, 124.7575)),\n ('horizontal', '1.0417', (222.4552, 91.8454), (223.97, 91.8454), (223.2126, 102.8454))\n]\n\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\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\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,\n angle=(0 if d[0] == \"horizontal\" else 90),\n 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,\n 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,\n 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,\n text=text, dimstyle=\"EZDXF\").render()\n\n doc.saveas(out_path)\n\n\nif __name__ == \"__main__\":\n out = sys.argv[1] if len(sys.argv) > 1 else \"0071_00719659_gt.dxf\"\n draw(out)\n print(\"wrote\", out)\n```"}], "images": ["images/0071_00719659.png"], "id": "0071_00719659"} {"messages": [{"role": "user", "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.53 mm."}, {"role": "assistant", "content": "```python\n#!/usr/bin/env python3\n# -*- coding: utf-8 -*-\n# Ground-truth 2D engineering drawing for part: 0072_00722694\n# Self-contained: reproduces the three-view DXF via ezdxf, NO FreeCAD needed.\n# Coordinates are A4 page millimetres (scale=0.8948269230769476, page=[297.0, 210.0]).\n# visible edges -> solid (layer OUTLINE); hidden edges -> dashed (layer HIDDEN)\n# dimensions -> real movable DIMENSION entities (text = true mm value)\n# Run: python 0072_00722694_gt.py [out.dxf]\nimport sys\nimport ezdxf\nimport math\n\nSCALE = 0.8948269230769476\nPAGE = [297.0, 210.0]\n\nVISIBLE_SEGMENTS = [\n (181.002095, 95.510595, 181.002095, 152.967903),\n (181.002095, 152.967903, 91.519403, 152.967903),\n (91.519403, 152.967903, 91.519403, 95.510595),\n (91.519403, 95.510595, 181.002095, 95.510595),\n (181.002095, 81.510595, 181.002095, 81.032078),\n (91.519403, 81.510595, 91.519403, 81.032078),\n (91.519403, 81.032078, 181.002095, 81.032078),\n (91.519403, 81.510595, 181.002095, 81.510595),\n (195.480612, 152.967903, 195.002095, 152.967903),\n (195.002095, 152.967903, 195.002095, 95.510595),\n (195.480612, 95.510595, 195.002095, 95.510595),\n (195.480612, 152.967903, 195.480612, 95.510595)\n]\nVISIBLE_CIRCLES = [\n\n]\nVISIBLE_ARCS = [\n\n]\nHIDDEN_SEGMENTS = [\n\n]\n# (orient, text, p1, p2, base) for linear; (orient, text, center, radius, angle) for diameter\nDIMENSIONS = [\n ('horizontal', '100', (181.0021, 95.5106), (91.5194, 95.5106), (136.2607, 84.5106)),\n ('vertical', '64.2105', (181.0021, 152.9679), (181.0021, 95.5106), (192.0021, 124.2393)),\n ('vertical', '0.5348', (195.4806, 152.9679), (195.0021, 152.9679), (195.2413, 141.9679))\n]\n\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\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\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,\n angle=(0 if d[0] == \"horizontal\" else 90),\n 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,\n 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,\n 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,\n text=text, dimstyle=\"EZDXF\").render()\n\n doc.saveas(out_path)\n\n\nif __name__ == \"__main__\":\n out = sys.argv[1] if len(sys.argv) > 1 else \"0072_00722694_gt.dxf\"\n draw(out)\n print(\"wrote\", out)\n```"}], "images": ["images/0072_00722694.png"], "id": "0072_00722694"} {"messages": [{"role": "user", "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 -2.08 mm."}, {"role": "assistant", "content": "```python\n#!/usr/bin/env python3\n# -*- coding: utf-8 -*-\n# Ground-truth 2D engineering drawing for part: 0072_00728910\n# Self-contained: reproduces the three-view DXF via ezdxf, NO FreeCAD needed.\n# Coordinates are A4 page millimetres (scale=1.38369434796345, page=[297.0, 210.0]).\n# visible edges -> solid (layer OUTLINE); hidden edges -> dashed (layer HIDDEN)\n# dimensions -> real movable DIMENSION entities (text = true mm value)\n# Run: python 0072_00728910_gt.py [out.dxf]\nimport sys\nimport ezdxf\nimport math\n\nSCALE = 1.38369434796345\nPAGE = [297.0, 210.0]\n\nVISIBLE_SEGMENTS = [\n (204.243388, 172.050002, 204.243388, 78.832699),\n (204.243388, 78.832699, 65.873953, 78.832699),\n (65.873953, 78.832699, 65.873953, 172.050002),\n (65.873953, 172.050002, 204.243388, 172.050002),\n (204.243388, 64.832699, 204.243388, 61.950002),\n (204.243388, 61.950002, 65.873953, 61.950002),\n (65.873953, 64.832699, 65.873953, 61.950002),\n (204.243388, 64.832699, 65.873953, 64.832699),\n (221.126084, 78.832699, 218.243388, 78.832699),\n (218.243388, 78.832699, 218.243388, 172.050002),\n (221.126084, 172.050002, 218.243388, 172.050002),\n (221.126084, 78.832699, 221.126084, 172.050002)\n]\nVISIBLE_CIRCLES = [\n\n]\nVISIBLE_ARCS = [\n\n]\nHIDDEN_SEGMENTS = [\n\n]\n# (orient, text, p1, p2, base) for linear; (orient, text, center, radius, angle) for diameter\nDIMENSIONS = [\n ('horizontal', '100', (204.2434, 172.05), (65.8739, 172.05), (135.0587, 161.05)),\n ('vertical', '67.3684', (204.2434, 78.8327), (204.2434, 172.05), (193.2434, 125.4414)),\n ('horizontal', '2.0833', (221.1261, 78.8327), (218.2434, 78.8327), (219.6847, 67.8327))\n]\n\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\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\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,\n angle=(0 if d[0] == \"horizontal\" else 90),\n 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,\n 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,\n 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,\n text=text, dimstyle=\"EZDXF\").render()\n\n doc.saveas(out_path)\n\n\nif __name__ == \"__main__\":\n out = sys.argv[1] if len(sys.argv) > 1 else \"0072_00728910_gt.dxf\"\n draw(out)\n print(\"wrote\", out)\n```"}], "images": ["images/0072_00728910.png"], "id": "0072_00728910"} {"messages": [{"role": "user", "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 2400 mm."}, {"role": "assistant", "content": "```python\n#!/usr/bin/env python3\n# -*- coding: utf-8 -*-\n# Ground-truth 2D engineering drawing for part: 0073_00730684\n# Self-contained: reproduces the three-view DXF via ezdxf, NO FreeCAD needed.\n# Coordinates are A4 page millimetres (scale=0.03844, page=[297.0, 210.0]).\n# visible edges -> solid (layer OUTLINE); hidden edges -> dashed (layer HIDDEN)\n# dimensions -> real movable DIMENSION entities (text = true mm value)\n# Run: python 0073_00730684_gt.py [out.dxf]\nimport sys\nimport ezdxf\nimport math\n\nSCALE = 0.03844\nPAGE = [297.0, 210.0]\n\nVISIBLE_SEGMENTS = [\n (92.294, 172.05, 92.294, 168.206),\n (92.294, 168.206, 88.45, 168.206),\n (88.45, 168.206, 88.45, 172.05),\n (88.45, 172.05, 92.294, 172.05),\n (92.294, 61.95, 92.294, 154.206),\n (92.294, 154.206, 88.45, 154.206),\n (88.45, 61.95, 88.45, 154.206),\n (92.294, 61.95, 88.45, 61.95),\n (106.294, 168.206, 198.55, 168.206),\n (198.55, 168.206, 198.55, 172.05),\n (106.294, 172.05, 198.55, 172.05),\n (106.294, 168.206, 106.294, 172.05)\n]\nVISIBLE_CIRCLES = [\n\n]\nVISIBLE_ARCS = [\n\n]\nHIDDEN_SEGMENTS = [\n\n]\n# (orient, text, p1, p2, base) for linear; (orient, text, center, radius, angle) for diameter\nDIMENSIONS = [\n ('horizontal', '100', (92.294, 172.05), (88.45, 172.05), (90.372, 161.05)),\n ('vertical', '100', (92.294, 168.206), (92.294, 172.05), (81.294, 170.128)),\n ('horizontal', '2400', (106.294, 168.206), (198.55, 168.206), (152.422, 179.206))\n]\n\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\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\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,\n angle=(0 if d[0] == \"horizontal\" else 90),\n 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,\n 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,\n 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,\n text=text, dimstyle=\"EZDXF\").render()\n\n doc.saveas(out_path)\n\n\nif __name__ == \"__main__\":\n out = sys.argv[1] if len(sys.argv) > 1 else \"0073_00730684_gt.dxf\"\n draw(out)\n print(\"wrote\", out)\n```"}], "images": ["images/0073_00730684.png"], "id": "0073_00730684"} {"messages": [{"role": "user", "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 66.32 mm tall. It is extruded to a thickness of 5.73 mm."}, {"role": "assistant", "content": "```python\n#!/usr/bin/env python3\n# -*- coding: utf-8 -*-\n# Ground-truth 2D engineering drawing for part: 0073_00731370\n# Self-contained: reproduces the three-view DXF via ezdxf, NO FreeCAD needed.\n# Coordinates are A4 page millimetres (scale=1.3338893539305, page=[297.0, 210.0]).\n# visible edges -> solid (layer OUTLINE); hidden edges -> dashed (layer HIDDEN)\n# dimensions -> real movable DIMENSION entities (text = true mm value)\n# Run: python 0073_00731370_gt.py [out.dxf]\nimport sys\nimport ezdxf\nimport math\n\nSCALE = 1.3338893539305\nPAGE = [297.0, 210.0]\n\nVISIBLE_SEGMENTS = [\n (199.373412, 172.050055, 199.373412, 83.59213),\n (199.373412, 83.59213, 65.984477, 83.59213),\n (65.984477, 83.59213, 65.984477, 172.050055),\n (65.984477, 172.050055, 199.373412, 172.050055),\n (199.373412, 61.950055, 199.373412, 69.59213),\n (199.373412, 69.59213, 65.984477, 69.59213),\n (65.984477, 61.950055, 65.984477, 69.59213),\n (199.373412, 61.950055, 65.984477, 61.950055),\n (213.373412, 83.59213, 221.015487, 83.59213),\n (221.015487, 83.59213, 221.015487, 172.050055),\n (213.373412, 172.050055, 221.015487, 172.050055),\n (213.373412, 83.59213, 213.373412, 172.050055)\n]\nVISIBLE_CIRCLES = [\n\n]\nVISIBLE_ARCS = [\n\n]\nHIDDEN_SEGMENTS = [\n\n]\n# (orient, text, p1, p2, base) for linear; (orient, text, center, radius, angle) for diameter\nDIMENSIONS = [\n ('horizontal', '100', (199.3734, 172.0501), (65.9845, 172.0501), (132.679, 161.0501)),\n ('vertical', '66.3158', (199.3734, 83.5921), (199.3734, 172.0501), (188.3734, 127.8211)),\n ('horizontal', '5.7292', (213.3734, 83.5921), (221.0155, 83.5921), (217.1945, 94.5921))\n]\n\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\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\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,\n angle=(0 if d[0] == \"horizontal\" else 90),\n 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,\n 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,\n 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,\n text=text, dimstyle=\"EZDXF\").render()\n\n doc.saveas(out_path)\n\n\nif __name__ == \"__main__\":\n out = sys.argv[1] if len(sys.argv) > 1 else \"0073_00731370_gt.dxf\"\n draw(out)\n print(\"wrote\", out)\n```"}], "images": ["images/0073_00731370.png"], "id": "0073_00731370"} {"messages": [{"role": "user", "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": "assistant", "content": "```python\n#!/usr/bin/env python3\n# -*- coding: utf-8 -*-\n# Ground-truth 2D engineering drawing for part: 0073_00735838\n# Self-contained: reproduces the three-view DXF via ezdxf, NO FreeCAD needed.\n# Coordinates are A4 page millimetres (scale=0.641416861826727, page=[297.0, 210.0]).\n# visible edges -> solid (layer OUTLINE); hidden edges -> dashed (layer HIDDEN)\n# dimensions -> real movable DIMENSION entities (text = true mm value)\n# Run: python 0073_00735838_gt.py [out.dxf]\nimport sys\nimport ezdxf\nimport math\n\nSCALE = 0.641416861826727\nPAGE = [297.0, 210.0]\n\nVISIBLE_SEGMENTS = [\n (147.190292, 118.711114, 147.190292, 172.04999),\n (147.190292, 172.04999, 83.048606, 172.04999),\n (83.048606, 172.04999, 83.048606, 118.711114),\n (83.048606, 118.711114, 147.190292, 118.711114),\n (147.190292, 104.711114, 147.190292, 61.94999),\n (83.048606, 104.711114, 83.048606, 61.94999),\n (83.048606, 61.94999, 147.190292, 61.94999),\n (83.048606, 104.711114, 147.190292, 104.711114),\n (203.951417, 172.04999, 161.190292, 172.04999),\n (161.190292, 172.04999, 161.190292, 118.711114),\n (203.951417, 118.711114, 161.190292, 118.711114),\n (203.951417, 172.04999, 203.951417, 118.711114)\n]\nVISIBLE_CIRCLES = [\n\n]\nVISIBLE_ARCS = [\n\n]\nHIDDEN_SEGMENTS = [\n\n]\n# (orient, text, p1, p2, base) for linear; (orient, text, center, radius, angle) for diameter\nDIMENSIONS = [\n ('horizontal', '100', (147.1903, 118.7111), (83.0486, 118.7111), (115.1194, 107.7111)),\n ('vertical', '83.1579', (147.1903, 172.05), (147.1903, 118.7111), (158.1903, 145.3806)),\n ('horizontal', '66.6667', (203.9514, 172.05), (161.1903, 172.05), (182.5708, 161.05))\n]\n\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\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\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,\n angle=(0 if d[0] == \"horizontal\" else 90),\n 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,\n 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,\n 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,\n text=text, dimstyle=\"EZDXF\").render()\n\n doc.saveas(out_path)\n\n\nif __name__ == \"__main__\":\n out = sys.argv[1] if len(sys.argv) > 1 else \"0073_00735838_gt.dxf\"\n draw(out)\n print(\"wrote\", out)\n```"}], "images": ["images/0073_00735838.png"], "id": "0073_00735838"} {"messages": [{"role": "user", "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 66.32 mm wide and 100 mm tall. It is extruded to a thickness of 33.08 mm."}, {"role": "assistant", "content": "```python\n#!/usr/bin/env python3\n# -*- coding: utf-8 -*-\n# Ground-truth 2D engineering drawing for part: 0073_00736132\n# Self-contained: reproduces the three-view DXF via ezdxf, NO FreeCAD needed.\n# Coordinates are A4 page millimetres (scale=0.7221073446328512, page=[297.0, 210.0]).\n# visible edges -> solid (layer OUTLINE); hidden edges -> dashed (layer HIDDEN)\n# dimensions -> real movable DIMENSION entities (text = true mm value)\n# Run: python 0073_00736132_gt.py [out.dxf]\nimport sys\nimport ezdxf\nimport math\n\nSCALE = 0.7221073446328512\nPAGE = [297.0, 210.0]\n\nVISIBLE_SEGMENTS = [\n (148.498911, 99.839279, 148.498911, 172.050014),\n (148.498911, 172.050014, 100.611792, 172.050014),\n (100.611792, 172.050014, 100.611792, 99.839279),\n (100.611792, 99.839279, 148.498911, 99.839279),\n (148.498911, 85.839279, 148.498911, 61.950014),\n (100.611792, 85.839279, 100.611792, 61.950014),\n (100.611792, 61.950014, 148.498911, 61.950014),\n (100.611792, 85.839279, 148.498911, 85.839279),\n (186.388176, 172.050014, 162.498911, 172.050014),\n (162.498911, 172.050014, 162.498911, 99.839279),\n (186.388176, 99.839279, 162.498911, 99.839279),\n (186.388176, 172.050014, 186.388176, 99.839279)\n]\nVISIBLE_CIRCLES = [\n\n]\nVISIBLE_ARCS = [\n\n]\nHIDDEN_SEGMENTS = [\n\n]\n# (orient, text, p1, p2, base) for linear; (orient, text, center, radius, angle) for diameter\nDIMENSIONS = [\n ('horizontal', '66.3158', (148.4989, 99.8393), (100.6118, 99.8393), (124.5553, 88.8393)),\n ('vertical', '100', (148.4989, 172.05), (148.4989, 99.8393), (159.4989, 135.9446)),\n ('horizontal', '33.0827', (186.3882, 172.05), (162.4989, 172.05), (174.4436, 161.05))\n]\n\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\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\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,\n angle=(0 if d[0] == \"horizontal\" else 90),\n 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,\n 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,\n 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,\n text=text, dimstyle=\"EZDXF\").render()\n\n doc.saveas(out_path)\n\n\nif __name__ == \"__main__\":\n out = sys.argv[1] if len(sys.argv) > 1 else \"0073_00736132_gt.dxf\"\n draw(out)\n print(\"wrote\", out)\n```"}], "images": ["images/0073_00736132.png"], "id": "0073_00736132"} {"messages": [{"role": "user", "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 66.32 mm tall. It is extruded to a thickness of 66.67 mm."}, {"role": "assistant", "content": "```python\n#!/usr/bin/env python3\n# -*- coding: utf-8 -*-\n# Ground-truth 2D engineering drawing for part: 0073_00736488\n# Self-contained: reproduces the three-view DXF via ezdxf, NO FreeCAD needed.\n# Coordinates are A4 page millimetres (scale=0.7226517150395771, page=[297.0, 210.0]).\n# visible edges -> solid (layer OUTLINE); hidden edges -> dashed (layer HIDDEN)\n# dimensions -> real movable DIMENSION entities (text = true mm value)\n# Run: python 0073_00736488_gt.py [out.dxf]\nimport sys\nimport ezdxf\nimport math\n\nSCALE = 0.7226517150395771\nPAGE = [297.0, 210.0]\n\nVISIBLE_SEGMENTS = [\n (148.544198, 172.050011, 148.544198, 124.126792),\n (148.544198, 124.126792, 76.279027, 124.126792),\n (76.279027, 124.126792, 76.279027, 172.050011),\n (76.279027, 172.050011, 148.544198, 172.050011),\n (148.544198, 61.950011, 148.544198, 110.126792),\n (148.544198, 110.126792, 76.279027, 110.126792),\n (76.279027, 61.950011, 76.279027, 110.126792),\n (148.544198, 61.950011, 76.279027, 61.950011),\n (162.544198, 124.126792, 210.720979, 124.126792),\n (210.720979, 124.126792, 210.720979, 172.050011),\n (162.544198, 172.050011, 210.720979, 172.050011),\n (162.544198, 124.126792, 162.544198, 172.050011)\n]\nVISIBLE_CIRCLES = [\n\n]\nVISIBLE_ARCS = [\n\n]\nHIDDEN_SEGMENTS = [\n\n]\n# (orient, text, p1, p2, base) for linear; (orient, text, center, radius, angle) for diameter\nDIMENSIONS = [\n ('horizontal', '100', (148.5442, 172.05), (76.279, 172.05), (112.4116, 161.05)),\n ('vertical', '66.3158', (148.5442, 124.1268), (148.5442, 172.05), (137.5442, 148.0884)),\n ('horizontal', '66.6667', (162.5442, 124.1268), (210.721, 124.1268), (186.6326, 135.1268))\n]\n\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\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\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,\n angle=(0 if d[0] == \"horizontal\" else 90),\n 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,\n 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,\n 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,\n text=text, dimstyle=\"EZDXF\").render()\n\n doc.saveas(out_path)\n\n\nif __name__ == \"__main__\":\n out = sys.argv[1] if len(sys.argv) > 1 else \"0073_00736488_gt.dxf\"\n draw(out)\n print(\"wrote\", out)\n```"}], "images": ["images/0073_00736488.png"], "id": "0073_00736488"} {"messages": [{"role": "user", "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 77.89 mm tall. It is extruded to a thickness of 44.72 mm."}, {"role": "assistant", "content": "```python\n#!/usr/bin/env python3\n# -*- coding: utf-8 -*-\n# Ground-truth 2D engineering drawing for part: 0073_00738329\n# Self-contained: reproduces the three-view DXF via ezdxf, NO FreeCAD needed.\n# Coordinates are A4 page millimetres (scale=0.7837848118936386, page=[297.0, 210.0]).\n# visible edges -> solid (layer OUTLINE); hidden edges -> dashed (layer HIDDEN)\n# dimensions -> real movable DIMENSION entities (text = true mm value)\n# Run: python 0073_00738329_gt.py [out.dxf]\nimport sys\nimport ezdxf\nimport math\n\nSCALE = 0.7837848118936386\nPAGE = [297.0, 210.0]\n\nVISIBLE_SEGMENTS = [\n (158.165599, 110.997293, 158.165599, 172.050005),\n (158.165599, 172.050005, 79.787117, 172.050005),\n (79.787117, 172.050005, 79.787117, 110.997293),\n (79.787117, 110.997293, 158.165599, 110.997293),\n (158.165599, 96.997293, 158.165599, 61.950005),\n (79.787117, 96.997293, 79.787117, 61.950005),\n (79.787117, 61.950005, 158.165599, 61.950005),\n (79.787117, 96.997293, 158.165599, 96.997293),\n (207.212887, 172.050005, 172.165599, 172.050005),\n (172.165599, 172.050005, 172.165599, 110.997293),\n (207.212887, 110.997293, 172.165599, 110.997293),\n (207.212887, 172.050005, 207.212887, 110.997293)\n]\nVISIBLE_CIRCLES = [\n\n]\nVISIBLE_ARCS = [\n\n]\nHIDDEN_SEGMENTS = [\n\n]\n# (orient, text, p1, p2, base) for linear; (orient, text, center, radius, angle) for diameter\nDIMENSIONS = [\n ('horizontal', '100', (158.1656, 110.9973), (79.7871, 110.9973), (118.9764, 99.9973)),\n ('vertical', '77.8947', (158.1656, 172.05), (158.1656, 110.9973), (169.1656, 141.5237)),\n ('horizontal', '44.7154', (207.2129, 172.05), (172.1656, 172.05), (189.6893, 161.05))\n]\n\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\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\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,\n angle=(0 if d[0] == \"horizontal\" else 90),\n 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,\n 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,\n 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,\n text=text, dimstyle=\"EZDXF\").render()\n\n doc.saveas(out_path)\n\n\nif __name__ == \"__main__\":\n out = sys.argv[1] if len(sys.argv) > 1 else \"0073_00738329_gt.dxf\"\n draw(out)\n print(\"wrote\", out)\n```"}], "images": ["images/0073_00738329.png"], "id": "0073_00738329"} {"messages": [{"role": "user", "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 25 mm."}, {"role": "assistant", "content": "```python\n#!/usr/bin/env python3\n# -*- coding: utf-8 -*-\n# Ground-truth 2D engineering drawing for part: 0073_00738574\n# Self-contained: reproduces the three-view DXF via ezdxf, NO FreeCAD needed.\n# Coordinates are A4 page millimetres (scale=0.7688, page=[297.0, 210.0]).\n# visible edges -> solid (layer OUTLINE); hidden edges -> dashed (layer HIDDEN)\n# dimensions -> real movable DIMENSION entities (text = true mm value)\n# Run: python 0073_00738574_gt.py [out.dxf]\nimport sys\nimport ezdxf\nimport math\n\nSCALE = 0.7688\nPAGE = [297.0, 210.0]\n\nVISIBLE_SEGMENTS = [\n (146.312306, 172.05, 146.312306, 95.17),\n (146.312306, 95.17, 107.467675, 95.17),\n (107.467675, 95.17, 107.467675, 172.05),\n (107.467675, 172.05, 146.312306, 172.05),\n (146.312306, 61.95, 146.312306, 81.17),\n (146.312306, 81.17, 107.467675, 81.17),\n (107.467675, 61.95, 107.467675, 81.17),\n (146.312306, 61.95, 107.467675, 61.95),\n (160.312306, 95.17, 179.532306, 95.17),\n (179.532306, 95.17, 179.532306, 172.05),\n (160.312306, 172.05, 179.532306, 172.05),\n (160.312306, 95.17, 160.312306, 172.05)\n]\nVISIBLE_CIRCLES = [\n\n]\nVISIBLE_ARCS = [\n\n]\nHIDDEN_SEGMENTS = [\n\n]\n# (orient, text, p1, p2, base) for linear; (orient, text, center, radius, angle) for diameter\nDIMENSIONS = [\n ('horizontal', '50.5263', (146.3123, 172.05), (107.4677, 172.05), (126.89, 161.05)),\n ('vertical', '100', (146.3123, 95.17), (146.3123, 172.05), (135.3123, 133.61)),\n ('horizontal', '25', (160.3123, 95.17), (179.5323, 95.17), (169.9223, 106.17))\n]\n\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\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\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,\n angle=(0 if d[0] == \"horizontal\" else 90),\n 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,\n 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,\n 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,\n text=text, dimstyle=\"EZDXF\").render()\n\n doc.saveas(out_path)\n\n\nif __name__ == \"__main__\":\n out = sys.argv[1] if len(sys.argv) > 1 else \"0073_00738574_gt.dxf\"\n draw(out)\n print(\"wrote\", out)\n```"}], "images": ["images/0073_00738574.png"], "id": "0073_00738574"} {"messages": [{"role": "user", "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 26.56 mm."}, {"role": "assistant", "content": "```python\n#!/usr/bin/env python3\n# -*- coding: utf-8 -*-\n# Ground-truth 2D engineering drawing for part: 0073_00739183\n# Self-contained: reproduces the three-view DXF via ezdxf, NO FreeCAD needed.\n# Coordinates are A4 page millimetres (scale=1.1610074074074075, page=[297.0, 210.0]).\n# visible edges -> solid (layer OUTLINE); hidden edges -> dashed (layer HIDDEN)\n# dimensions -> real movable DIMENSION entities (text = true mm value)\n# Run: python 0073_00739183_gt.py [out.dxf]\nimport sys\nimport ezdxf\nimport math\n\nSCALE = 1.1610074074074075\nPAGE = [297.0, 210.0]\n\nVISIBLE_SEGMENTS = [\n (179.130716, 140.030708, 179.130716, 138.808595),\n (179.130716, 138.808595, 63.029976, 138.808595),\n (63.029976, 138.808595, 63.029976, 140.030708),\n (63.029976, 140.030708, 179.130716, 140.030708),\n (179.130716, 93.969336, 179.130716, 124.808595),\n (179.130716, 124.808595, 63.029976, 124.808595),\n (63.029976, 93.969336, 63.029976, 124.808595),\n (179.130716, 93.969336, 63.029976, 93.969336),\n (193.130716, 138.808595, 223.969976, 138.808595),\n (223.969976, 138.808595, 223.969976, 140.030708),\n (193.130716, 140.030708, 223.969976, 140.030708),\n (193.130716, 138.808595, 193.130716, 140.030708)\n]\nVISIBLE_CIRCLES = [\n\n]\nVISIBLE_ARCS = [\n\n]\nHIDDEN_SEGMENTS = [\n\n]\n# (orient, text, p1, p2, base) for linear; (orient, text, center, radius, angle) for diameter\nDIMENSIONS = [\n ('horizontal', '100', (179.1307, 140.0307), (63.03, 140.0307), (121.0804, 129.0307)),\n ('vertical', '1.0526', (179.1307, 138.8086), (179.1307, 140.0307), (168.1307, 139.4196)),\n ('horizontal', '26.5625', (193.1307, 138.8086), (223.97, 138.8086), (208.5504, 149.8086))\n]\n\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\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\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,\n angle=(0 if d[0] == \"horizontal\" else 90),\n 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,\n 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,\n 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,\n text=text, dimstyle=\"EZDXF\").render()\n\n doc.saveas(out_path)\n\n\nif __name__ == \"__main__\":\n out = sys.argv[1] if len(sys.argv) > 1 else \"0073_00739183_gt.dxf\"\n draw(out)\n print(\"wrote\", out)\n```"}], "images": ["images/0073_00739183.png"], "id": "0073_00739183"} {"messages": [{"role": "user", "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 25.26 mm tall. It is extruded to a thickness of 12.77 mm."}, {"role": "assistant", "content": "```python\n#!/usr/bin/env python3\n# -*- coding: utf-8 -*-\n# Ground-truth 2D engineering drawing for part: 0074_00745735\n# Self-contained: reproduces the three-view DXF via ezdxf, NO FreeCAD needed.\n# Coordinates are A4 page millimetres (scale=1.3030528301894593, page=[297.0, 210.0]).\n# visible edges -> solid (layer OUTLINE); hidden edges -> dashed (layer HIDDEN)\n# dimensions -> real movable DIMENSION entities (text = true mm value)\n# Run: python 0074_00745735_gt.py [out.dxf]\nimport sys\nimport ezdxf\nimport math\n\nSCALE = 1.3030528301894593\nPAGE = [297.0, 210.0]\n\nVISIBLE_SEGMENTS = [\n (193.335253, 148.776958, 193.335253, 115.857728),\n (193.335253, 115.857728, 63.02997, 115.857728),\n (63.02997, 115.857728, 63.02997, 148.776958),\n (63.02997, 148.776958, 193.335253, 148.776958),\n (193.335253, 85.223011, 193.335253, 101.857728),\n (193.335253, 101.857728, 63.02997, 101.857728),\n (63.02997, 85.223011, 63.02997, 101.857728),\n (193.335253, 85.223011, 63.02997, 85.223011),\n (207.335253, 115.857728, 223.96997, 115.857728),\n (223.96997, 115.857728, 223.96997, 148.776958),\n (207.335253, 148.776958, 223.96997, 148.776958),\n (207.335253, 115.857728, 207.335253, 148.776958)\n]\nVISIBLE_CIRCLES = [\n\n]\nVISIBLE_ARCS = [\n\n]\nHIDDEN_SEGMENTS = [\n\n]\n# (orient, text, p1, p2, base) for linear; (orient, text, center, radius, angle) for diameter\nDIMENSIONS = [\n ('horizontal', '100', (193.3352, 148.777), (63.0299, 148.777), (128.1826, 137.777)),\n ('vertical', '25.2632', (193.3352, 115.8577), (193.3352, 148.777), (182.3352, 132.3173)),\n ('horizontal', '12.766', (207.3353, 115.8577), (223.9701, 115.8577), (215.6527, 126.8577))\n]\n\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\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\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,\n angle=(0 if d[0] == \"horizontal\" else 90),\n 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,\n 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,\n 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,\n text=text, dimstyle=\"EZDXF\").render()\n\n doc.saveas(out_path)\n\n\nif __name__ == \"__main__\":\n out = sys.argv[1] if len(sys.argv) > 1 else \"0074_00745735_gt.dxf\"\n draw(out)\n print(\"wrote\", out)\n```"}], "images": ["images/0074_00745735.png"], "id": "0074_00745735"} {"messages": [{"role": "user", "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 87.37 mm tall. It is extruded to a thickness of 66.67 mm."}, {"role": "assistant", "content": "```python\n#!/usr/bin/env python3\n# -*- coding: utf-8 -*-\n# Ground-truth 2D engineering drawing for part: 0074_00747252\n# Self-contained: reproduces the three-view DXF via ezdxf, NO FreeCAD needed.\n# Coordinates are A4 page millimetres (scale=0.6238838268792962, page=[297.0, 210.0]).\n# visible edges -> solid (layer OUTLINE); hidden edges -> dashed (layer HIDDEN)\n# dimensions -> real movable DIMENSION entities (text = true mm value)\n# Run: python 0074_00747252_gt.py [out.dxf]\nimport sys\nimport ezdxf\nimport math\n\nSCALE = 0.6238838268792962\nPAGE = [297.0, 210.0]\n\nVISIBLE_SEGMENTS = [\n (146.898066, 117.542273, 146.898066, 172.050018),\n (146.898066, 172.050018, 84.509683, 172.050018),\n (84.509683, 172.050018, 84.509683, 117.542273),\n (84.509683, 117.542273, 146.898066, 117.542273),\n (146.898066, 103.542273, 146.898066, 61.950018),\n (84.509683, 103.542273, 84.509683, 61.950018),\n (84.509683, 61.950018, 146.898066, 61.950018),\n (84.509683, 103.542273, 146.898066, 103.542273),\n (202.490321, 172.050018, 160.898066, 172.050018),\n (160.898066, 172.050018, 160.898066, 117.542273),\n (202.490321, 117.542273, 160.898066, 117.542273),\n (202.490321, 172.050018, 202.490321, 117.542273)\n]\nVISIBLE_CIRCLES = [\n\n]\nVISIBLE_ARCS = [\n\n]\nHIDDEN_SEGMENTS = [\n\n]\n# (orient, text, p1, p2, base) for linear; (orient, text, center, radius, angle) for diameter\nDIMENSIONS = [\n ('horizontal', '100', (146.8981, 117.5423), (84.5097, 117.5423), (115.7039, 106.5423)),\n ('vertical', '87.3684', (146.8981, 172.05), (146.8981, 117.5423), (157.8981, 144.7961)),\n ('horizontal', '66.6667', (202.4903, 172.05), (160.898, 172.05), (181.6942, 161.05))\n]\n\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\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\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,\n angle=(0 if d[0] == \"horizontal\" else 90),\n 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,\n 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,\n 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,\n text=text, dimstyle=\"EZDXF\").render()\n\n doc.saveas(out_path)\n\n\nif __name__ == \"__main__\":\n out = sys.argv[1] if len(sys.argv) > 1 else \"0074_00747252_gt.dxf\"\n draw(out)\n print(\"wrote\", out)\n```"}], "images": ["images/0074_00747252.png"], "id": "0074_00747252"} {"messages": [{"role": "user", "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": "assistant", "content": "```python\n#!/usr/bin/env python3\n# -*- coding: utf-8 -*-\n# Ground-truth 2D engineering drawing for part: 0074_00748391\n# Self-contained: reproduces the three-view DXF via ezdxf, NO FreeCAD needed.\n# Coordinates are A4 page millimetres (scale=0.4805, page=[297.0, 210.0]).\n# visible edges -> solid (layer OUTLINE); hidden edges -> dashed (layer HIDDEN)\n# dimensions -> real movable DIMENSION entities (text = true mm value)\n# Run: python 0074_00748391_gt.py [out.dxf]\nimport sys\nimport ezdxf\nimport math\n\nSCALE = 0.4805\nPAGE = [297.0, 210.0]\n\nVISIBLE_SEGMENTS = [\n (136.5, 172.05, 136.5, 124.0),\n (136.5, 124.0, 88.45, 124.0),\n (88.45, 124.0, 88.45, 172.05),\n (88.45, 172.05, 136.5, 172.05),\n (136.5, 61.95, 136.5, 110.0),\n (136.5, 110.0, 88.45, 110.0),\n (88.45, 61.95, 88.45, 110.0),\n (136.5, 61.95, 88.45, 61.95),\n (150.5, 124.0, 198.55, 124.0),\n (198.55, 124.0, 198.55, 172.05),\n (150.5, 172.05, 198.55, 172.05),\n (150.5, 124.0, 150.5, 172.05)\n]\nVISIBLE_CIRCLES = [\n\n]\nVISIBLE_ARCS = [\n\n]\nHIDDEN_SEGMENTS = [\n\n]\n# (orient, text, p1, p2, base) for linear; (orient, text, center, radius, angle) for diameter\nDIMENSIONS = [\n ('horizontal', '100', (136.5, 172.05), (88.45, 172.05), (112.475, 161.05)),\n ('vertical', '100', (136.5, 124.0), (136.5, 172.05), (125.5, 148.025)),\n ('horizontal', '100', (150.5, 124.0), (198.55, 124.0), (174.525, 135.0))\n]\n\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\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\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,\n angle=(0 if d[0] == \"horizontal\" else 90),\n 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,\n 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,\n 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,\n text=text, dimstyle=\"EZDXF\").render()\n\n doc.saveas(out_path)\n\n\nif __name__ == \"__main__\":\n out = sys.argv[1] if len(sys.argv) > 1 else \"0074_00748391_gt.dxf\"\n draw(out)\n print(\"wrote\", out)\n```"}], "images": ["images/0074_00748391.png"], "id": "0074_00748391"} {"messages": [{"role": "user", "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": "assistant", "content": "```python\n#!/usr/bin/env python3\n# -*- coding: utf-8 -*-\n# Ground-truth 2D engineering drawing for part: 0075_00757223\n# Self-contained: reproduces the three-view DXF via ezdxf, NO FreeCAD needed.\n# Coordinates are A4 page millimetres (scale=0.4805, page=[297.0, 210.0]).\n# visible edges -> solid (layer OUTLINE); hidden edges -> dashed (layer HIDDEN)\n# dimensions -> real movable DIMENSION entities (text = true mm value)\n# Run: python 0075_00757223_gt.py [out.dxf]\nimport sys\nimport ezdxf\nimport math\n\nSCALE = 0.4805\nPAGE = [297.0, 210.0]\n\nVISIBLE_SEGMENTS = [\n (136.5, 172.05, 136.5, 124.0),\n (136.5, 124.0, 88.45, 124.0),\n (88.45, 124.0, 88.45, 172.05),\n (88.45, 172.05, 136.5, 172.05),\n (136.5, 61.95, 136.5, 110.0),\n (136.5, 110.0, 88.45, 110.0),\n (88.45, 61.95, 88.45, 110.0),\n (136.5, 61.95, 88.45, 61.95),\n (150.5, 124.0, 198.55, 124.0),\n (198.55, 124.0, 198.55, 172.05),\n (150.5, 172.05, 198.55, 172.05),\n (150.5, 124.0, 150.5, 172.05)\n]\nVISIBLE_CIRCLES = [\n\n]\nVISIBLE_ARCS = [\n\n]\nHIDDEN_SEGMENTS = [\n\n]\n# (orient, text, p1, p2, base) for linear; (orient, text, center, radius, angle) for diameter\nDIMENSIONS = [\n ('horizontal', '100', (136.5, 172.05), (88.45, 172.05), (112.475, 161.05)),\n ('vertical', '100', (136.5, 124.0), (136.5, 172.05), (125.5, 148.025)),\n ('horizontal', '100', (150.5, 124.0), (198.55, 124.0), (174.525, 135.0))\n]\n\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\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\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,\n angle=(0 if d[0] == \"horizontal\" else 90),\n 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,\n 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,\n 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,\n text=text, dimstyle=\"EZDXF\").render()\n\n doc.saveas(out_path)\n\n\nif __name__ == \"__main__\":\n out = sys.argv[1] if len(sys.argv) > 1 else \"0075_00757223_gt.dxf\"\n draw(out)\n print(\"wrote\", out)\n```"}], "images": ["images/0075_00757223.png"], "id": "0075_00757223"} {"messages": [{"role": "user", "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 281.22 mm. The outline includes one or more oblique (angled) edges."}, {"role": "assistant", "content": "```python\n#!/usr/bin/env python3\n# -*- coding: utf-8 -*-\n# Ground-truth 2D engineering drawing for part: 0075_00758342\n# Self-contained: reproduces the three-view DXF via ezdxf, NO FreeCAD needed.\n# Coordinates are A4 page millimetres (scale=0.260974578069041, page=[297.0, 210.0]).\n# visible edges -> solid (layer OUTLINE); hidden edges -> dashed (layer HIDDEN)\n# dimensions -> real movable DIMENSION entities (text = true mm value)\n# Run: python 0075_00758342_gt.py [out.dxf]\nimport sys\nimport ezdxf\nimport math\n\nSCALE = 0.260974578069041\nPAGE = [297.0, 210.0]\n\nVISIBLE_SEGMENTS = [\n (99.66783, 149.340723, 112.800906, 171.776396),\n (112.800906, 171.776396, 86.808359, 172.050001),\n (86.808359, 172.050001, 99.66783, 149.340723),\n (112.800906, 135.340723, 112.800906, 61.950001),\n (112.800906, 61.950001, 86.808359, 61.950001),\n (86.808359, 135.340723, 86.808359, 61.950001),\n (112.800906, 135.340723, 86.808359, 135.340723),\n (126.800906, 149.340723, 200.191628, 149.340723),\n (126.800906, 172.050001, 200.191628, 172.050001),\n (200.191628, 172.050001, 200.191628, 149.340723),\n (126.800906, 172.050001, 126.800906, 149.340723)\n]\nVISIBLE_CIRCLES = [\n\n]\nVISIBLE_ARCS = [\n\n]\nHIDDEN_SEGMENTS = [\n (99.6678, 61.95, 99.6678, 135.3407)\n]\n# (orient, text, p1, p2, base) for linear; (orient, text, center, radius, angle) for diameter\nDIMENSIONS = [\n ('aligned', '99.6146', (99.6678, 149.3407), (112.8009, 171.7764), (96.7412, 166.1155)),\n ('horizontal', '99.6035', (112.8009, 171.7764), (86.8084, 172.05), (99.6889, 160.9138)),\n ('aligned', '100', (86.8084, 172.05), (99.6678, 149.3407), (102.81, 166.1156)),\n ('horizontal', '281.218', (126.8009, 172.05), (200.1916, 172.05), (163.4963, 183.05))\n]\n\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\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\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,\n angle=(0 if d[0] == \"horizontal\" else 90),\n 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,\n 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,\n 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,\n text=text, dimstyle=\"EZDXF\").render()\n\n doc.saveas(out_path)\n\n\nif __name__ == \"__main__\":\n out = sys.argv[1] if len(sys.argv) > 1 else \"0075_00758342_gt.dxf\"\n draw(out)\n print(\"wrote\", out)\n```"}], "images": ["images/0075_00758342.png"], "id": "0075_00758342"} {"messages": [{"role": "user", "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 74.74 mm wide and 100 mm tall. It is extruded to a thickness of -6.25 mm."}, {"role": "assistant", "content": "```python\n#!/usr/bin/env python3\n# -*- coding: utf-8 -*-\n# Ground-truth 2D engineering drawing for part: 0075_00758563\n# Self-contained: reproduces the three-view DXF via ezdxf, NO FreeCAD needed.\n# Coordinates are A4 page millimetres (scale=0.8409216867469884, page=[297.0, 210.0]).\n# visible edges -> solid (layer OUTLINE); hidden edges -> dashed (layer HIDDEN)\n# dimensions -> real movable DIMENSION entities (text = true mm value)\n# Run: python 0075_00758563_gt.py [out.dxf]\nimport sys\nimport ezdxf\nimport math\n\nSCALE = 0.8409216867469884\nPAGE = [297.0, 210.0]\n\nVISIBLE_SEGMENTS = [\n (165.296014, 84.581819, 165.296014, 168.673987),\n (165.296014, 168.673987, 102.448183, 168.673987),\n (102.448183, 168.673987, 102.448183, 84.581819),\n (102.448183, 84.581819, 165.296014, 84.581819),\n (165.296014, 65.326058, 165.296014, 70.581819),\n (102.448183, 65.326058, 102.448183, 70.581819),\n (102.448183, 70.581819, 165.296014, 70.581819),\n (102.448183, 65.326058, 165.296014, 65.326058),\n (179.296014, 168.673987, 184.551775, 168.673987),\n (184.551775, 168.673987, 184.551775, 84.581819),\n (179.296014, 84.581819, 184.551775, 84.581819),\n (179.296014, 168.673987, 179.296014, 84.581819)\n]\nVISIBLE_CIRCLES = [\n\n]\nVISIBLE_ARCS = [\n\n]\nHIDDEN_SEGMENTS = [\n\n]\n# (orient, text, p1, p2, base) for linear; (orient, text, center, radius, angle) for diameter\nDIMENSIONS = [\n ('horizontal', '74.7368', (165.296, 84.5818), (102.4482, 84.5818), (133.8721, 73.5818)),\n ('vertical', '100', (165.296, 168.674), (165.296, 84.5818), (176.296, 126.6279)),\n ('horizontal', '6.25', (179.296, 168.674), (184.5518, 168.674), (181.9239, 179.674))\n]\n\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\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\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,\n angle=(0 if d[0] == \"horizontal\" else 90),\n 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,\n 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,\n 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,\n text=text, dimstyle=\"EZDXF\").render()\n\n doc.saveas(out_path)\n\n\nif __name__ == \"__main__\":\n out = sys.argv[1] if len(sys.argv) > 1 else \"0075_00758563_gt.dxf\"\n draw(out)\n print(\"wrote\", out)\n```"}], "images": ["images/0075_00758563.png"], "id": "0075_00758563"} {"messages": [{"role": "user", "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 685.71 mm."}, {"role": "assistant", "content": "```python\n#!/usr/bin/env python3\n# -*- coding: utf-8 -*-\n# Ground-truth 2D engineering drawing for part: 0076_00761205\n# Self-contained: reproduces the three-view DXF via ezdxf, NO FreeCAD needed.\n# Coordinates are A4 page millimetres (scale=0.13184753455747392, page=[297.0, 210.0]).\n# visible edges -> solid (layer OUTLINE); hidden edges -> dashed (layer HIDDEN)\n# dimensions -> real movable DIMENSION entities (text = true mm value)\n# Run: python 0076_00761205_gt.py [out.dxf]\nimport sys\nimport ezdxf\nimport math\n\nSCALE = 0.13184753455747392\nPAGE = [297.0, 210.0]\n\nVISIBLE_SEGMENTS = [\n (97.887503, 166.359723, 97.887503, 172.049985),\n (97.887503, 172.049985, 84.70275, 172.049985),\n (84.70275, 172.049985, 84.70275, 166.359723),\n (84.70275, 166.359723, 97.887503, 166.359723),\n (97.887503, 152.359723, 97.887503, 61.949985),\n (84.70275, 152.359723, 84.70275, 61.949985),\n (84.70275, 61.949985, 97.887503, 61.949985),\n (84.70275, 152.359723, 97.887503, 152.359723),\n (202.297241, 172.049985, 111.887503, 172.049985),\n (111.887503, 172.049985, 111.887503, 166.359723),\n (202.297241, 166.359723, 111.887503, 166.359723),\n (202.297241, 172.049985, 202.297241, 166.359723)\n]\nVISIBLE_CIRCLES = [\n\n]\nVISIBLE_ARCS = [\n\n]\nHIDDEN_SEGMENTS = [\n\n]\n# (orient, text, p1, p2, base) for linear; (orient, text, center, radius, angle) for diameter\nDIMENSIONS = [\n ('horizontal', '100', (97.8875, 166.3597), (84.7028, 166.3597), (91.2951, 155.3597)),\n ('vertical', '43.1579', (97.8875, 172.05), (97.8875, 166.3597), (108.8875, 169.2049)),\n ('horizontal', '685.714', (202.2972, 172.05), (111.8875, 172.05), (157.0924, 161.05))\n]\n\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\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\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,\n angle=(0 if d[0] == \"horizontal\" else 90),\n 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,\n 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,\n 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,\n text=text, dimstyle=\"EZDXF\").render()\n\n doc.saveas(out_path)\n\n\nif __name__ == \"__main__\":\n out = sys.argv[1] if len(sys.argv) > 1 else \"0076_00761205_gt.dxf\"\n draw(out)\n print(\"wrote\", out)\n```"}], "images": ["images/0076_00761205.png"], "id": "0076_00761205"} {"messages": [{"role": "user", "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.6 mm."}, {"role": "assistant", "content": "```python\n#!/usr/bin/env python3\n# -*- coding: utf-8 -*-\n# Ground-truth 2D engineering drawing for part: 0076_00765453\n# Self-contained: reproduces the three-view DXF via ezdxf, NO FreeCAD needed.\n# Coordinates are A4 page millimetres (scale=1.4321055837563406, page=[297.0, 210.0]).\n# visible edges -> solid (layer OUTLINE); hidden edges -> dashed (layer HIDDEN)\n# dimensions -> real movable DIMENSION entities (text = true mm value)\n# Run: python 0076_00765453_gt.py [out.dxf]\nimport sys\nimport ezdxf\nimport math\n\nSCALE = 1.4321055837563406\nPAGE = [297.0, 210.0]\n\nVISIBLE_SEGMENTS = [\n (206.240583, 156.014289, 206.240583, 95.715107),\n (206.240583, 95.715107, 63.030025, 95.715107),\n (63.030025, 95.715107, 63.030025, 156.014289),\n (63.030025, 156.014289, 206.240583, 156.014289),\n (206.240583, 77.985665, 206.240583, 81.715107),\n (206.240583, 81.715107, 63.030025, 81.715107),\n (63.030025, 77.985665, 63.030025, 81.715107),\n (206.240583, 77.985665, 63.030025, 77.985665),\n (220.240583, 95.715107, 223.970025, 95.715107),\n (223.970025, 95.715107, 223.970025, 156.014289),\n (220.240583, 156.014289, 223.970025, 156.014289),\n (220.240583, 95.715107, 220.240583, 156.014289)\n]\nVISIBLE_CIRCLES = [\n\n]\nVISIBLE_ARCS = [\n\n]\nHIDDEN_SEGMENTS = [\n\n]\n# (orient, text, p1, p2, base) for linear; (orient, text, center, radius, angle) for diameter\nDIMENSIONS = [\n ('horizontal', '100', (206.2406, 156.0143), (63.03, 156.0143), (134.6353, 145.0143)),\n ('vertical', '42.1053', (206.2406, 95.7151), (206.2406, 156.0143), (195.2406, 125.8647)),\n ('horizontal', '2.6042', (220.2406, 95.7151), (223.97, 95.7151), (222.1053, 106.7151))\n]\n\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\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\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,\n angle=(0 if d[0] == \"horizontal\" else 90),\n 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,\n 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,\n 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,\n text=text, dimstyle=\"EZDXF\").render()\n\n doc.saveas(out_path)\n\n\nif __name__ == \"__main__\":\n out = sys.argv[1] if len(sys.argv) > 1 else \"0076_00765453_gt.dxf\"\n draw(out)\n print(\"wrote\", out)\n```"}], "images": ["images/0076_00765453.png"], "id": "0076_00765453"} {"messages": [{"role": "user", "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": "assistant", "content": "```python\n#!/usr/bin/env python3\n# -*- coding: utf-8 -*-\n# Ground-truth 2D engineering drawing for part: 0077_00770090\n# Self-contained: reproduces the three-view DXF via ezdxf, NO FreeCAD needed.\n# Coordinates are A4 page millimetres (scale=0.641416861826727, page=[297.0, 210.0]).\n# visible edges -> solid (layer OUTLINE); hidden edges -> dashed (layer HIDDEN)\n# dimensions -> real movable DIMENSION entities (text = true mm value)\n# Run: python 0077_00770090_gt.py [out.dxf]\nimport sys\nimport ezdxf\nimport math\n\nSCALE = 0.641416861826727\nPAGE = [297.0, 210.0]\n\nVISIBLE_SEGMENTS = [\n (147.190292, 118.711114, 147.190292, 172.04999),\n (147.190292, 172.04999, 83.048606, 172.04999),\n (83.048606, 172.04999, 83.048606, 118.711114),\n (83.048606, 118.711114, 147.190292, 118.711114),\n (147.190292, 104.711114, 147.190292, 61.94999),\n (83.048606, 104.711114, 83.048606, 61.94999),\n (83.048606, 61.94999, 147.190292, 61.94999),\n (83.048606, 104.711114, 147.190292, 104.711114),\n (203.951417, 172.04999, 161.190292, 172.04999),\n (161.190292, 172.04999, 161.190292, 118.711114),\n (203.951417, 118.711114, 161.190292, 118.711114),\n (203.951417, 172.04999, 203.951417, 118.711114)\n]\nVISIBLE_CIRCLES = [\n\n]\nVISIBLE_ARCS = [\n\n]\nHIDDEN_SEGMENTS = [\n\n]\n# (orient, text, p1, p2, base) for linear; (orient, text, center, radius, angle) for diameter\nDIMENSIONS = [\n ('horizontal', '100', (147.1903, 118.7111), (83.0486, 118.7111), (115.1194, 107.7111)),\n ('vertical', '83.1579', (147.1903, 172.05), (147.1903, 118.7111), (158.1903, 145.3806)),\n ('horizontal', '66.6667', (203.9514, 172.05), (161.1903, 172.05), (182.5708, 161.05))\n]\n\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\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\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,\n angle=(0 if d[0] == \"horizontal\" else 90),\n 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,\n 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,\n 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,\n text=text, dimstyle=\"EZDXF\").render()\n\n doc.saveas(out_path)\n\n\nif __name__ == \"__main__\":\n out = sys.argv[1] if len(sys.argv) > 1 else \"0077_00770090_gt.dxf\"\n draw(out)\n print(\"wrote\", out)\n```"}], "images": ["images/0077_00770090.png"], "id": "0077_00770090"} {"messages": [{"role": "user", "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. It is extruded to a thickness of 66.67 mm."}, {"role": "assistant", "content": "```python\n#!/usr/bin/env python3\n# -*- coding: utf-8 -*-\n# Ground-truth 2D engineering drawing for part: 0077_00770273\n# Self-contained: reproduces the three-view DXF via ezdxf, NO FreeCAD needed.\n# Coordinates are A4 page millimetres (scale=0.7847707736390079, page=[297.0, 210.0]).\n# visible edges -> solid (layer OUTLINE); hidden edges -> dashed (layer HIDDEN)\n# dimensions -> real movable DIMENSION entities (text = true mm value)\n# Run: python 0077_00770273_gt.py [out.dxf]\nimport sys\nimport ezdxf\nimport math\n\nSCALE = 0.7847707736390079\nPAGE = [297.0, 210.0]\n\nVISIBLE_SEGMENTS = [\n (149.579505, 128.268031, 149.579505, 172.049979),\n (149.579505, 172.049979, 71.102428, 172.049979),\n (71.102428, 172.049979, 71.102428, 128.268031),\n (71.102428, 128.268031, 149.579505, 128.268031),\n (149.579505, 114.268031, 149.579505, 61.949979),\n (71.102428, 114.268031, 71.102428, 61.949979),\n (71.102428, 61.949979, 149.579505, 61.949979),\n (71.102428, 114.268031, 149.579505, 114.268031),\n (215.897557, 172.049979, 163.579505, 172.049979),\n (163.579505, 172.049979, 163.579505, 128.268031),\n (215.897557, 128.268031, 163.579505, 128.268031),\n (215.897557, 172.049979, 215.897557, 128.268031)\n]\nVISIBLE_CIRCLES = [\n\n]\nVISIBLE_ARCS = [\n\n]\nHIDDEN_SEGMENTS = [\n\n]\n# (orient, text, p1, p2, base) for linear; (orient, text, center, radius, angle) for diameter\nDIMENSIONS = [\n ('horizontal', '100', (149.5795, 128.268), (71.1024, 128.268), (110.341, 117.268)),\n ('vertical', '55.7895', (149.5795, 172.05), (149.5795, 128.268), (160.5795, 150.159)),\n ('horizontal', '66.6667', (215.8976, 172.05), (163.5795, 172.05), (189.7385, 161.05))\n]\n\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\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\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,\n angle=(0 if d[0] == \"horizontal\" else 90),\n 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,\n 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,\n 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,\n text=text, dimstyle=\"EZDXF\").render()\n\n doc.saveas(out_path)\n\n\nif __name__ == \"__main__\":\n out = sys.argv[1] if len(sys.argv) > 1 else \"0077_00770273_gt.dxf\"\n draw(out)\n print(\"wrote\", out)\n```"}], "images": ["images/0077_00770273.png"], "id": "0077_00770273"} {"messages": [{"role": "user", "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 81.05 mm wide and 100 mm tall. It is extruded to a thickness of 1.04 mm."}, {"role": "assistant", "content": "```python\n#!/usr/bin/env python3\n# -*- coding: utf-8 -*-\n# Ground-truth 2D engineering drawing for part: 0077_00770806\n# Self-contained: reproduces the three-view DXF via ezdxf, NO FreeCAD needed.\n# Coordinates are A4 page millimetres (scale=0.8115872093023273, page=[297.0, 210.0]).\n# visible edges -> solid (layer OUTLINE); hidden edges -> dashed (layer HIDDEN)\n# dimensions -> real movable DIMENSION entities (text = true mm value)\n# Run: python 0077_00770806_gt.py [out.dxf]\nimport sys\nimport ezdxf\nimport math\n\nSCALE = 0.8115872093023273\nPAGE = [297.0, 210.0]\n\nVISIBLE_SEGMENTS = [\n (168.967915, 83.843347, 168.967915, 165.002068),\n (168.967915, 165.002068, 103.186636, 165.002068),\n (103.186636, 165.002068, 103.186636, 83.843347),\n (103.186636, 83.843347, 168.967915, 83.843347),\n (168.967915, 69.843347, 168.967915, 68.997944),\n (103.186636, 69.843347, 103.186636, 68.997944),\n (103.186636, 68.997944, 168.967915, 68.997944),\n (103.186636, 69.843347, 168.967915, 69.843347),\n (183.813318, 165.002068, 182.967915, 165.002068),\n (182.967915, 165.002068, 182.967915, 83.843347),\n (183.813318, 83.843347, 182.967915, 83.843347),\n (183.813318, 165.002068, 183.813318, 83.843347)\n]\nVISIBLE_CIRCLES = [\n\n]\nVISIBLE_ARCS = [\n\n]\nHIDDEN_SEGMENTS = [\n\n]\n# (orient, text, p1, p2, base) for linear; (orient, text, center, radius, angle) for diameter\nDIMENSIONS = [\n ('horizontal', '81.0526', (168.9679, 83.8433), (103.1867, 83.8433), (136.0773, 72.8433)),\n ('vertical', '100', (168.9679, 165.0021), (168.9679, 83.8433), (179.9679, 124.4227)),\n ('horizontal', '1.0417', (183.8133, 165.0021), (182.9679, 165.0021), (183.3906, 154.0021))\n]\n\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\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\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,\n angle=(0 if d[0] == \"horizontal\" else 90),\n 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,\n 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,\n 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,\n text=text, dimstyle=\"EZDXF\").render()\n\n doc.saveas(out_path)\n\n\nif __name__ == \"__main__\":\n out = sys.argv[1] if len(sys.argv) > 1 else \"0077_00770806_gt.dxf\"\n draw(out)\n print(\"wrote\", out)\n```"}], "images": ["images/0077_00770806.png"], "id": "0077_00770806"} {"messages": [{"role": "user", "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 2.08 mm."}, {"role": "assistant", "content": "```python\n#!/usr/bin/env python3\n# -*- coding: utf-8 -*-\n# Ground-truth 2D engineering drawing for part: 0077_00777883\n# Self-contained: reproduces the three-view DXF via ezdxf, NO FreeCAD needed.\n# Coordinates are A4 page millimetres (scale=1.2690272727272782, page=[297.0, 210.0]).\n# visible edges -> solid (layer OUTLINE); hidden edges -> dashed (layer HIDDEN)\n# dimensions -> real movable DIMENSION entities (text = true mm value)\n# Run: python 0077_00777883_gt.py [out.dxf]\nimport sys\nimport ezdxf\nimport math\n\nSCALE = 1.2690272727272782\nPAGE = [297.0, 210.0]\n\nVISIBLE_SEGMENTS = [\n (197.307563, 116.625156, 197.307563, 136.662429),\n (70.404835, 116.625156, 197.307563, 116.625156),\n (197.307563, 136.662429, 70.404835, 136.662429),\n (70.404835, 136.662429, 70.404835, 116.625156),\n (197.307563, 97.337543, 197.307563, 102.625156),\n (70.404835, 97.337543, 70.404835, 102.625156),\n (70.404835, 97.337543, 197.307563, 97.337543),\n (70.404835, 102.625156, 197.307563, 102.625156),\n (211.307563, 116.625156, 216.595176, 116.625156),\n (216.595176, 136.662429, 211.307563, 136.662429),\n (211.307563, 136.662429, 211.307563, 116.625156),\n (216.595176, 136.662429, 216.595176, 116.625156)\n]\nVISIBLE_CIRCLES = [\n\n]\nVISIBLE_ARCS = [\n\n]\nHIDDEN_SEGMENTS = [\n\n]\n# (orient, text, p1, p2, base) for linear; (orient, text, center, radius, angle) for diameter\nDIMENSIONS = [\n ('horizontal', '100', (197.3076, 116.6252), (70.4048, 116.6252), (133.8562, 105.6252)),\n ('vertical', '15.7895', (197.3076, 136.6624), (197.3076, 116.6252), (208.3076, 126.6438)),\n ('horizontal', '4.1667', (216.5951, 136.6624), (211.3076, 136.6624), (213.9514, 125.6624))\n]\n\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\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\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,\n angle=(0 if d[0] == \"horizontal\" else 90),\n 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,\n 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,\n 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,\n text=text, dimstyle=\"EZDXF\").render()\n\n doc.saveas(out_path)\n\n\nif __name__ == \"__main__\":\n out = sys.argv[1] if len(sys.argv) > 1 else \"0077_00777883_gt.dxf\"\n draw(out)\n print(\"wrote\", out)\n```"}], "images": ["images/0077_00777883.png"], "id": "0077_00777883"} {"messages": [{"role": "user", "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 17.19 mm."}, {"role": "assistant", "content": "```python\n#!/usr/bin/env python3\n# -*- coding: utf-8 -*-\n# Ground-truth 2D engineering drawing for part: 0077_00778227\n# Self-contained: reproduces the three-view DXF via ezdxf, NO FreeCAD needed.\n# Coordinates are A4 page millimetres (scale=1.0821162790697956, page=[297.0, 210.0]).\n# visible edges -> solid (layer OUTLINE); hidden edges -> dashed (layer HIDDEN)\n# dimensions -> real movable DIMENSION entities (text = true mm value)\n# Run: python 0077_00778227_gt.py [out.dxf]\nimport sys\nimport ezdxf\nimport math\n\nSCALE = 1.0821162790697956\nPAGE = [297.0, 210.0]\n\nVISIBLE_SEGMENTS = [\n (181.306391, 113.935257, 181.306391, 152.663629),\n (181.306391, 152.663629, 73.094763, 152.663629),\n (73.094763, 152.663629, 73.094763, 113.935257),\n (73.094763, 113.935257, 181.306391, 113.935257),\n (181.306391, 99.935257, 181.306391, 81.336383),\n (73.094763, 99.935257, 73.094763, 81.336383),\n (73.094763, 81.336383, 181.306391, 81.336383),\n (73.094763, 99.935257, 181.306391, 99.935257),\n (213.905264, 152.663629, 195.306391, 152.663629),\n (195.306391, 152.663629, 195.306391, 113.935257),\n (213.905264, 113.935257, 195.306391, 113.935257),\n (213.905264, 152.663629, 213.905264, 113.935257)\n]\nVISIBLE_CIRCLES = [\n\n]\nVISIBLE_ARCS = [\n\n]\nHIDDEN_SEGMENTS = [\n\n]\n# (orient, text, p1, p2, base) for linear; (orient, text, center, radius, angle) for diameter\nDIMENSIONS = [\n ('horizontal', '100', (181.3064, 113.9353), (73.0947, 113.9353), (127.2006, 102.9353)),\n ('vertical', '35.7895', (181.3064, 152.6636), (181.3064, 113.9353), (192.3064, 133.2994)),\n ('horizontal', '17.1875', (213.9053, 152.6636), (195.3064, 152.6636), (204.6058, 141.6636))\n]\n\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\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\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,\n angle=(0 if d[0] == \"horizontal\" else 90),\n 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,\n 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,\n 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,\n text=text, dimstyle=\"EZDXF\").render()\n\n doc.saveas(out_path)\n\n\nif __name__ == \"__main__\":\n out = sys.argv[1] if len(sys.argv) > 1 else \"0077_00778227_gt.dxf\"\n draw(out)\n print(\"wrote\", out)\n```"}], "images": ["images/0077_00778227.png"], "id": "0077_00778227"} {"messages": [{"role": "user", "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 71.58 mm tall. It is extruded to a thickness of 141.18 mm."}, {"role": "assistant", "content": "```python\n#!/usr/bin/env python3\n# -*- coding: utf-8 -*-\n# Ground-truth 2D engineering drawing for part: 0077_00779234\n# Self-contained: reproduces the three-view DXF via ezdxf, NO FreeCAD needed.\n# Coordinates are A4 page millimetres (scale=0.4516923748545039, page=[297.0, 210.0]).\n# visible edges -> solid (layer OUTLINE); hidden edges -> dashed (layer HIDDEN)\n# dimensions -> real movable DIMENSION entities (text = true mm value)\n# Run: python 0077_00779234_gt.py [out.dxf]\nimport sys\nimport ezdxf\nimport math\n\nSCALE = 0.4516923748545039\nPAGE = [297.0, 210.0]\n\nVISIBLE_SEGMENTS = [\n (127.20048, 172.049979, 127.20048, 139.718314),\n (127.20048, 139.718314, 82.031243, 139.718314),\n (82.031243, 139.718314, 82.031243, 172.049979),\n (82.031243, 172.049979, 127.20048, 172.049979),\n (127.20048, 61.949979, 127.20048, 125.718314),\n (127.20048, 125.718314, 82.031243, 125.718314),\n (82.031243, 61.949979, 82.031243, 125.718314),\n (127.20048, 61.949979, 82.031243, 61.949979),\n (141.20048, 139.718314, 204.968816, 139.718314),\n (204.968816, 139.718314, 204.968816, 172.049979),\n (141.20048, 172.049979, 204.968816, 172.049979),\n (141.20048, 139.718314, 141.20048, 172.049979)\n]\nVISIBLE_CIRCLES = [\n\n]\nVISIBLE_ARCS = [\n\n]\nHIDDEN_SEGMENTS = [\n\n]\n# (orient, text, p1, p2, base) for linear; (orient, text, center, radius, angle) for diameter\nDIMENSIONS = [\n ('horizontal', '100', (127.2005, 172.05), (82.0312, 172.05), (104.6158, 161.05)),\n ('vertical', '71.5789', (127.2005, 139.7183), (127.2005, 172.05), (116.2005, 155.8842)),\n ('horizontal', '141.177', (141.2005, 139.7183), (204.9688, 139.7183), (173.0846, 150.7183))\n]\n\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\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\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,\n angle=(0 if d[0] == \"horizontal\" else 90),\n 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,\n 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,\n 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,\n text=text, dimstyle=\"EZDXF\").render()\n\n doc.saveas(out_path)\n\n\nif __name__ == \"__main__\":\n out = sys.argv[1] if len(sys.argv) > 1 else \"0077_00779234_gt.dxf\"\n draw(out)\n print(\"wrote\", out)\n```"}], "images": ["images/0077_00779234.png"], "id": "0077_00779234"} {"messages": [{"role": "user", "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 4.21 mm tall. It is extruded to a thickness of 2.23 mm."}, {"role": "assistant", "content": "```python\n#!/usr/bin/env python3\n# -*- coding: utf-8 -*-\n# Ground-truth 2D engineering drawing for part: 0078_00785220\n# Self-contained: reproduces the three-view DXF via ezdxf, NO FreeCAD needed.\n# Coordinates are A4 page millimetres (scale=1.410030303030431, page=[297.0, 210.0]).\n# visible edges -> solid (layer OUTLINE); hidden edges -> dashed (layer HIDDEN)\n# dimensions -> real movable DIMENSION entities (text = true mm value)\n# Run: python 0078_00785220_gt.py [out.dxf]\nimport sys\nimport ezdxf\nimport math\n\nSCALE = 1.410030303030431\nPAGE = [297.0, 210.0]\n\nVISIBLE_SEGMENTS = [\n (205.426105, 122.606978, 205.426105, 128.543948),\n (205.426105, 128.543948, 64.423075, 128.543948),\n (64.423075, 128.543948, 64.423075, 122.606978),\n (64.423075, 122.606978, 205.426105, 122.606978),\n (205.426105, 108.606978, 205.426105, 105.456072),\n (64.423075, 108.606978, 64.423075, 105.456072),\n (64.423075, 105.456072, 205.426105, 105.456072),\n (64.423075, 108.606978, 205.426105, 108.606978),\n (222.577011, 128.543948, 219.426105, 128.543948),\n (219.426105, 128.543948, 219.426105, 122.606978),\n (222.577011, 122.606978, 219.426105, 122.606978),\n (222.577011, 128.543948, 222.577011, 122.606978)\n]\nVISIBLE_CIRCLES = [\n\n]\nVISIBLE_ARCS = [\n\n]\nHIDDEN_SEGMENTS = [\n\n]\n# (orient, text, p1, p2, base) for linear; (orient, text, center, radius, angle) for diameter\nDIMENSIONS = [\n ('horizontal', '100', (205.4261, 122.6069), (64.4231, 122.6069), (134.9246, 111.6069)),\n ('vertical', '4.2105', (205.4261, 128.544), (205.4261, 122.6069), (216.4261, 125.5755)),\n ('horizontal', '2.2346', (222.577, 128.544), (219.4261, 128.544), (221.0015, 117.544))\n]\n\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\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\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,\n angle=(0 if d[0] == \"horizontal\" else 90),\n 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,\n 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,\n 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,\n text=text, dimstyle=\"EZDXF\").render()\n\n doc.saveas(out_path)\n\n\nif __name__ == \"__main__\":\n out = sys.argv[1] if len(sys.argv) > 1 else \"0078_00785220_gt.dxf\"\n draw(out)\n print(\"wrote\", out)\n```"}], "images": ["images/0078_00785220.png"], "id": "0078_00785220"} {"messages": [{"role": "user", "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 88.42 mm tall. It is extruded to a thickness of 85.71 mm."}, {"role": "assistant", "content": "```python\n#!/usr/bin/env python3\n# -*- coding: utf-8 -*-\n# Ground-truth 2D engineering drawing for part: 0078_00786856\n# Self-contained: reproduces the three-view DXF via ezdxf, NO FreeCAD needed.\n# Coordinates are A4 page millimetres (scale=0.5518696027634126, page=[297.0, 210.0]).\n# visible edges -> solid (layer OUTLINE); hidden edges -> dashed (layer HIDDEN)\n# dimensions -> real movable DIMENSION entities (text = true mm value)\n# Run: python 0078_00786856_gt.py [out.dxf]\nimport sys\nimport ezdxf\nimport math\n\nSCALE = 0.5518696027634126\nPAGE = [297.0, 210.0]\n\nVISIBLE_SEGMENTS = [\n (140.44191, 123.253105, 140.44191, 172.049996),\n (140.44191, 172.049996, 85.25495, 172.049996),\n (85.25495, 172.049996, 85.25495, 123.253105),\n (85.25495, 123.253105, 140.44191, 123.253105),\n (140.44191, 109.253105, 140.44191, 61.949996),\n (85.25495, 109.253105, 85.25495, 61.949996),\n (85.25495, 61.949996, 140.44191, 61.949996),\n (85.25495, 109.253105, 140.44191, 109.253105),\n (201.745019, 172.049996, 154.44191, 172.049996),\n (154.44191, 172.049996, 154.44191, 123.253105),\n (201.745019, 123.253105, 154.44191, 123.253105),\n (201.745019, 172.049996, 201.745019, 123.253105)\n]\nVISIBLE_CIRCLES = [\n\n]\nVISIBLE_ARCS = [\n\n]\nHIDDEN_SEGMENTS = [\n\n]\n# (orient, text, p1, p2, base) for linear; (orient, text, center, radius, angle) for diameter\nDIMENSIONS = [\n ('horizontal', '100', (140.4419, 123.2531), (85.255, 123.2531), (112.8485, 112.2531)),\n ('vertical', '88.4211', (140.4419, 172.05), (140.4419, 123.2531), (151.4419, 147.6515)),\n ('horizontal', '85.7143', (201.745, 172.05), (154.4419, 172.05), (178.0935, 161.05))\n]\n\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; _ds.dxf.dimasz = 2.5\n _ds.dxf.dimexe = 1.25; _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\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\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,\n angle=(0 if d[0] == \"horizontal\" else 90),\n 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,\n 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,\n 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,\n text=text, dimstyle=\"EZDXF\").render()\n\n doc.saveas(out_path)\n\n\nif __name__ == \"__main__\":\n out = sys.argv[1] if len(sys.argv) > 1 else \"0078_00786856_gt.dxf\"\n draw(out)\n print(\"wrote\", out)\n```"}], "images": ["images/0078_00786856.png"], "id": "0078_00786856"} {"messages": [{"role": "user", "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 18.95 mm tall. It is extruded to a thickness of 54.17 mm."}, {"role": "assistant", "content": "```python\n#!/usr/bin/env python3\n# -*- coding: utf-8 -*-\n# Ground-truth 2D engineering drawing for part: 0078_00787605\n# Self-contained: reproduces the three-view DXF via ezdxf, NO FreeCAD needed.\n# Coordinates are A4 page millimetres (scale=1.2353362831858368, page=[297.0, 210.0]).\n# visible edges -> solid (layer OUTLINE); hidden edges -> dashed (layer HIDDEN)\n# dimensions -> real movable DIMENSION entities (text = true mm value)\n# Run: python 0078_00787605_gt.py [out.dxf]\nimport sys\nimport ezdxf\nimport math\n\nSCALE = 1.2353362831858368\nPAGE = [297.0, 210.0]\n\nVISIBLE_SEGMENTS = [\n (164.809776, 145.753817, 164.809776, 169.160189),\n (164.809776, 169.160189, 41.276148, 169.160189),\n (41.276148, 169.160189, 41.276148, 145.753817),\n (41.276148, 145.753817, 164.809776, 145.753817),\n (164.809776, 131.753817, 164.809776, 64.839768),\n (41.276148, 131.753817, 41.276148, 64.839768),\n (41.276148, 64.839768, 164.809776, 64.839768),\n (41.276148, 131.753817, 164.809776, 131.753817),\n (245.723825, 169.160189, 178.809776, 169.160189),\n (178.809776, 169.160189, 178.809776, 145.753817),\n (245.723825, 145.753817, 178.809776, 145.753817),\n (245.723825, 169.160189, 245.723825, 145.753817)\n]\nVISIBLE_CIRCLES = [\n\n]\nVISIBLE_ARCS = [\n\n]\nHIDDEN_SEGMENTS = [\n\n]\n# (orient, text, p1, p2, base) for linear; (orient, text, center, radius, angle) for diameter\nDIMENSIONS = [\n ('horizontal', '100', (164.8098, 145.7538), (41.2762, 145.7538), (103.043, 134.7538)),\n ('vertical', '18.9474', (164.8098, 169.1602), (164.8098, 145.7538), (175.8098, 157.457)),\n ('horizontal', '54.1667', (245.7238, 169.1602), (178.8097, 169.1602), (212.2668, 158.1602))\n]\n\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; _ds.dxf.dimasz = 2.5\n _ds.dxf.dimexe = 1.25; _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\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\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,\n angle=(0 if d[0] == \"horizontal\" else 90),\n 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,\n 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,\n 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,\n text=text, dimstyle=\"EZDXF\").render()\n\n doc.saveas(out_path)\n\n\nif __name__ == \"__main__\":\n out = sys.argv[1] if len(sys.argv) > 1 else \"0078_00787605_gt.dxf\"\n draw(out)\n print(\"wrote\", out)\n```"}], "images": ["images/0078_00787605.png"], "id": "0078_00787605"} {"messages": [{"role": "user", "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 3.16 mm tall. It is extruded to a thickness of 9.38 mm."}, {"role": "assistant", "content": "```python\n#!/usr/bin/env python3\n# -*- coding: utf-8 -*-\n# Ground-truth 2D engineering drawing for part: 0078_00789242\n# Self-contained: reproduces the three-view DXF via ezdxf, NO FreeCAD needed.\n# Coordinates are A4 page millimetres (scale=1.4244183673469402, page=[297.0, 210.0]).\n# visible edges -> solid (layer OUTLINE); hidden edges -> dashed (layer HIDDEN)\n# dimensions -> real movable DIMENSION entities (text = true mm value)\n# Run: python 0078_00789242_gt.py [out.dxf]\nimport sys\nimport ezdxf\nimport math\n\nSCALE = 1.4244183673469402\nPAGE = [297.0, 210.0]\n\nVISIBLE_SEGMENTS = [\n (201.043983, 128.427862, 201.043983, 132.926025),\n (201.043983, 132.926025, 58.602146, 132.926025),\n (58.602146, 132.926025, 58.602146, 128.427862),\n (58.602146, 128.427862, 201.043983, 128.427862),\n (201.043983, 114.427862, 201.043983, 101.07394),\n (58.602146, 114.427862, 58.602146, 101.07394),\n (58.602146, 101.07394, 201.043983, 101.07394),\n (58.602146, 114.427862, 201.043983, 114.427862),\n (228.397905, 132.926025, 215.043983, 132.926025),\n (215.043983, 132.926025, 215.043983, 128.427862),\n (228.397905, 128.427862, 215.043983, 128.427862),\n (228.397905, 132.926025, 228.397905, 128.427862)\n]\nVISIBLE_CIRCLES = [\n\n]\nVISIBLE_ARCS = [\n\n]\nHIDDEN_SEGMENTS = [\n\n]\n# (orient, text, p1, p2, base) for linear; (orient, text, center, radius, angle) for diameter\nDIMENSIONS = [\n ('horizontal', '100', (201.044, 128.4279), (58.6021, 128.4279), (129.823, 117.4279)),\n ('vertical', '3.1579', (201.044, 132.926), (201.044, 128.4279), (212.044, 130.677)),\n ('horizontal', '9.375', (228.3979, 132.926), (215.044, 132.926), (221.7209, 121.926))\n]\n\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; _ds.dxf.dimasz = 2.5\n _ds.dxf.dimexe = 1.25; _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\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\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,\n angle=(0 if d[0] == \"horizontal\" else 90),\n 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,\n 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,\n 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,\n text=text, dimstyle=\"EZDXF\").render()\n\n doc.saveas(out_path)\n\n\nif __name__ == \"__main__\":\n out = sys.argv[1] if len(sys.argv) > 1 else \"0078_00789242_gt.dxf\"\n draw(out)\n print(\"wrote\", out)\n```"}], "images": ["images/0078_00789242.png"], "id": "0078_00789242"} {"messages": [{"role": "user", "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 3.23 mm."}, {"role": "assistant", "content": "```python\n#!/usr/bin/env python3\n# -*- coding: utf-8 -*-\n# Ground-truth 2D engineering drawing for part: 0078_00789937\n# Self-contained: reproduces the three-view DXF via ezdxf, NO FreeCAD needed.\n# Coordinates are A4 page millimetres (scale=0.7347, page=[297.0, 210.0]).\n# visible edges -> solid (layer OUTLINE); hidden edges -> dashed (layer HIDDEN)\n# dimensions -> real movable DIMENSION entities (text = true mm value)\n# Run: python 0078_00789937_gt.py [out.dxf]\nimport sys\nimport ezdxf\nimport math\n\nSCALE = 0.7347\nPAGE = [297.0, 210.0]\n\nVISIBLE_SEGMENTS = [\n (172.05, 88.45, 172.05, 161.92),\n (172.05, 161.92, 98.58, 161.92),\n (98.58, 161.92, 98.58, 88.45),\n (98.58, 88.45, 172.05, 88.45),\n (172.05, 74.45, 172.05, 72.08),\n (98.58, 74.45, 98.58, 72.08),\n (98.58, 72.08, 172.05, 72.08),\n (98.58, 74.45, 172.05, 74.45),\n (188.42, 161.92, 186.05, 161.92),\n (186.05, 161.92, 186.05, 88.45),\n (188.42, 88.45, 186.05, 88.45),\n (188.42, 161.92, 188.42, 88.45)\n]\nVISIBLE_CIRCLES = [\n\n]\nVISIBLE_ARCS = [\n\n]\nHIDDEN_SEGMENTS = [\n\n]\n# (orient, text, p1, p2, base) for linear; (orient, text, center, radius, angle) for diameter\nDIMENSIONS = [\n ('horizontal', '100', (172.05, 88.45), (98.58, 88.45), (135.315, 77.45)),\n ('vertical', '100', (172.05, 161.92), (172.05, 88.45), (183.05, 125.185)),\n ('horizontal', '3.2258', (188.42, 161.92), (186.05, 161.92), (187.235, 150.92))\n]\n\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; _ds.dxf.dimasz = 2.5\n _ds.dxf.dimexe = 1.25; _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\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\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,\n angle=(0 if d[0] == \"horizontal\" else 90),\n 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,\n 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,\n 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,\n text=text, dimstyle=\"EZDXF\").render()\n\n doc.saveas(out_path)\n\n\nif __name__ == \"__main__\":\n out = sys.argv[1] if len(sys.argv) > 1 else \"0078_00789937_gt.dxf\"\n draw(out)\n print(\"wrote\", out)\n```"}], "images": ["images/0078_00789937.png"], "id": "0078_00789937"} {"messages": [{"role": "user", "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 3.12 mm."}, {"role": "assistant", "content": "```python\n#!/usr/bin/env python3\n# -*- coding: utf-8 -*-\n# Ground-truth 2D engineering drawing for part: 0079_00796760\n# Self-contained: reproduces the three-view DXF via ezdxf, NO FreeCAD needed.\n# Coordinates are A4 page millimetres (scale=0.9244569536424226, page=[297.0, 210.0]).\n# visible edges -> solid (layer OUTLINE); hidden edges -> dashed (layer HIDDEN)\n# dimensions -> real movable DIMENSION entities (text = true mm value)\n# Run: python 0079_00796760_gt.py [out.dxf]\nimport sys\nimport ezdxf\nimport math\n\nSCALE = 0.9244569536424226\nPAGE = [297.0, 210.0]\n\nVISIBLE_SEGMENTS = [\n (181.278393, 98.197297, 181.278393, 152.691602),\n (181.278393, 152.691602, 88.832698, 152.691602),\n (88.832698, 152.691602, 88.832698, 98.197297),\n (88.832698, 98.197297, 181.278393, 98.197297),\n (181.278393, 84.197297, 181.278393, 81.308369),\n (88.832698, 84.197297, 88.832698, 81.308369),\n (88.832698, 81.308369, 181.278393, 81.308369),\n (88.832698, 84.197297, 181.278393, 84.197297),\n (198.167321, 152.691602, 195.278393, 152.691602),\n (195.278393, 152.691602, 195.278393, 98.197297),\n (198.167321, 98.197297, 195.278393, 98.197297),\n (198.167321, 152.691602, 198.167321, 98.197297)\n]\nVISIBLE_CIRCLES = [\n\n]\nVISIBLE_ARCS = [\n\n]\nHIDDEN_SEGMENTS = [\n\n]\n# (orient, text, p1, p2, base) for linear; (orient, text, center, radius, angle) for diameter\nDIMENSIONS = [\n ('horizontal', '100', (181.2784, 98.1973), (88.8327, 98.1973), (135.0555, 87.1973)),\n ('vertical', '58.9474', (181.2784, 152.6916), (181.2784, 98.1973), (192.2784, 125.4445)),\n ('horizontal', '3.125', (198.1673, 152.6916), (195.2784, 152.6916), (196.7228, 141.6916))\n]\n\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; _ds.dxf.dimasz = 2.5\n _ds.dxf.dimexe = 1.25; _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\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\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,\n angle=(0 if d[0] == \"horizontal\" else 90),\n 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,\n 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,\n 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,\n text=text, dimstyle=\"EZDXF\").render()\n\n doc.saveas(out_path)\n\n\nif __name__ == \"__main__\":\n out = sys.argv[1] if len(sys.argv) > 1 else \"0079_00796760_gt.dxf\"\n draw(out)\n print(\"wrote\", out)\n```"}], "images": ["images/0079_00796760.png"], "id": "0079_00796760"} {"messages": [{"role": "user", "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 66.32 mm tall. It is extruded to a thickness of 66.67 mm."}, {"role": "assistant", "content": "```python\n#!/usr/bin/env python3\n# -*- coding: utf-8 -*-\n# Ground-truth 2D engineering drawing for part: 0080_00801095\n# Self-contained: reproduces the three-view DXF via ezdxf, NO FreeCAD needed.\n# Coordinates are A4 page millimetres (scale=0.7226517150396151, page=[297.0, 210.0]).\n# visible edges -> solid (layer OUTLINE); hidden edges -> dashed (layer HIDDEN)\n# dimensions -> real movable DIMENSION entities (text = true mm value)\n# Run: python 0080_00801095_gt.py [out.dxf]\nimport sys\nimport ezdxf\nimport math\n\nSCALE = 0.7226517150396151\nPAGE = [297.0, 210.0]\n\nVISIBLE_SEGMENTS = [\n (148.544198, 124.126789, 148.544198, 172.050008),\n (148.544198, 172.050008, 76.279027, 172.050008),\n (76.279027, 172.050008, 76.279027, 124.126789),\n (76.279027, 124.126789, 148.544198, 124.126789),\n (148.544198, 110.126789, 148.544198, 61.950008),\n (76.279027, 110.126789, 76.279027, 61.950008),\n (76.279027, 61.950008, 148.544198, 61.950008),\n (76.279027, 110.126789, 148.544198, 110.126789),\n (210.720979, 172.050008, 162.544198, 172.050008),\n (162.544198, 172.050008, 162.544198, 124.126789),\n (210.720979, 124.126789, 162.544198, 124.126789),\n (210.720979, 172.050008, 210.720979, 124.126789)\n]\nVISIBLE_CIRCLES = [\n\n]\nVISIBLE_ARCS = [\n\n]\nHIDDEN_SEGMENTS = [\n\n]\n# (orient, text, p1, p2, base) for linear; (orient, text, center, radius, angle) for diameter\nDIMENSIONS = [\n ('horizontal', '100', (148.5442, 124.1268), (76.279, 124.1268), (112.4116, 113.1268)),\n ('vertical', '66.3158', (148.5442, 172.05), (148.5442, 124.1268), (159.5442, 148.0884)),\n ('horizontal', '66.6667', (210.721, 172.05), (162.5442, 172.05), (186.6326, 161.05))\n]\n\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; _ds.dxf.dimasz = 2.5\n _ds.dxf.dimexe = 1.25; _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\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\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,\n angle=(0 if d[0] == \"horizontal\" else 90),\n 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,\n 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,\n 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,\n text=text, dimstyle=\"EZDXF\").render()\n\n doc.saveas(out_path)\n\n\nif __name__ == \"__main__\":\n out = sys.argv[1] if len(sys.argv) > 1 else \"0080_00801095_gt.dxf\"\n draw(out)\n print(\"wrote\", out)\n```"}], "images": ["images/0080_00801095.png"], "id": "0080_00801095"} {"messages": [{"role": "user", "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 640 mm."}, {"role": "assistant", "content": "```python\n#!/usr/bin/env python3\n# -*- coding: utf-8 -*-\n# Ground-truth 2D engineering drawing for part: 0080_00803392\n# Self-contained: reproduces the three-view DXF via ezdxf, NO FreeCAD needed.\n# Coordinates are A4 page millimetres (scale=0.1298648648648661, page=[297.0, 210.0]).\n# visible edges -> solid (layer OUTLINE); hidden edges -> dashed (layer HIDDEN)\n# dimensions -> real movable DIMENSION entities (text = true mm value)\n# Run: python 0080_00803392_gt.py [out.dxf]\nimport sys\nimport ezdxf\nimport math\n\nSCALE = 0.1298648648648661\nPAGE = [297.0, 210.0]\n\nVISIBLE_SEGMENTS = [\n (101.436495, 159.063508, 101.436495, 172.049995),\n (101.436495, 172.049995, 88.450008, 172.049995),\n (88.450008, 172.049995, 88.450008, 159.063508),\n (88.450008, 159.063508, 101.436495, 159.063508),\n (101.436495, 145.063508, 101.436495, 61.949995),\n (88.450008, 145.063508, 88.450008, 61.949995),\n (88.450008, 61.949995, 101.436495, 61.949995),\n (88.450008, 145.063508, 101.436495, 145.063508),\n (198.550008, 172.049995, 115.436495, 172.049995),\n (115.436495, 172.049995, 115.436495, 159.063508),\n (198.550008, 159.063508, 115.436495, 159.063508),\n (198.550008, 172.049995, 198.550008, 159.063508)\n]\nVISIBLE_CIRCLES = [\n\n]\nVISIBLE_ARCS = [\n\n]\nHIDDEN_SEGMENTS = [\n\n]\n# (orient, text, p1, p2, base) for linear; (orient, text, center, radius, angle) for diameter\nDIMENSIONS = [\n ('horizontal', '100', (101.4365, 159.0635), (88.45, 159.0635), (94.9432, 148.0635)),\n ('vertical', '100', (101.4365, 172.05), (101.4365, 159.0635), (112.4365, 165.5568)),\n ('horizontal', '640', (198.55, 172.05), (115.4365, 172.05), (156.9932, 161.05))\n]\n\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; _ds.dxf.dimasz = 2.5\n _ds.dxf.dimexe = 1.25; _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\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\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,\n angle=(0 if d[0] == \"horizontal\" else 90),\n 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,\n 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,\n 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,\n text=text, dimstyle=\"EZDXF\").render()\n\n doc.saveas(out_path)\n\n\nif __name__ == \"__main__\":\n out = sys.argv[1] if len(sys.argv) > 1 else \"0080_00803392_gt.dxf\"\n draw(out)\n print(\"wrote\", out)\n```"}], "images": ["images/0080_00803392.png"], "id": "0080_00803392"} {"messages": [{"role": "user", "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 31.2 mm."}, {"role": "assistant", "content": "```python\n#!/usr/bin/env python3\n# -*- coding: utf-8 -*-\n# Ground-truth 2D engineering drawing for part: 0080_00803712\n# Self-contained: reproduces the three-view DXF via ezdxf, NO FreeCAD needed.\n# Coordinates are A4 page millimetres (scale=0.7324695121951219, page=[297.0, 210.0]).\n# visible edges -> solid (layer OUTLINE); hidden edges -> dashed (layer HIDDEN)\n# dimensions -> real movable DIMENSION entities (text = true mm value)\n# Run: python 0080_00803712_gt.py [out.dxf]\nimport sys\nimport ezdxf\nimport math\n\nSCALE = 0.7324695121951219\nPAGE = [297.0, 210.0]\n\nVISIBLE_SEGMENTS = [\n (148.975105, 172.049971, 148.975105, 98.80302),\n (148.975105, 98.80302, 101.171832, 98.80302),\n (101.171832, 98.80302, 101.171832, 172.049971),\n (101.171832, 172.049971, 148.975105, 172.049971),\n (148.975105, 61.949971, 148.975105, 84.80302),\n (148.975105, 84.80302, 101.171832, 84.80302),\n (101.171832, 61.949971, 101.171832, 84.80302),\n (148.975105, 61.949971, 101.171832, 61.949971),\n (162.975105, 98.80302, 185.828154, 98.80302),\n (185.828154, 98.80302, 185.828154, 172.049971),\n (162.975105, 172.049971, 185.828154, 172.049971),\n (162.975105, 98.80302, 162.975105, 172.049971)\n]\nVISIBLE_CIRCLES = [\n\n]\nVISIBLE_ARCS = [\n\n]\nHIDDEN_SEGMENTS = [\n\n]\n# (orient, text, p1, p2, base) for linear; (orient, text, center, radius, angle) for diameter\nDIMENSIONS = [\n ('horizontal', '65.2632', (148.9751, 172.05), (101.1718, 172.05), (125.0735, 161.05)),\n ('vertical', '100', (148.9751, 98.803), (148.9751, 172.05), (137.9751, 135.4265)),\n ('horizontal', '31.2', (162.9751, 98.803), (185.8282, 98.803), (174.4016, 109.803))\n]\n\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; _ds.dxf.dimasz = 2.5\n _ds.dxf.dimexe = 1.25; _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\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\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,\n angle=(0 if d[0] == \"horizontal\" else 90),\n 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,\n 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,\n 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,\n text=text, dimstyle=\"EZDXF\").render()\n\n doc.saveas(out_path)\n\n\nif __name__ == \"__main__\":\n out = sys.argv[1] if len(sys.argv) > 1 else \"0080_00803712_gt.dxf\"\n draw(out)\n print(\"wrote\", out)\n```"}], "images": ["images/0080_00803712.png"], "id": "0080_00803712"} {"messages": [{"role": "user", "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 90.53 mm tall. It is extruded to a thickness of 10.94 mm."}, {"role": "assistant", "content": "```python\n#!/usr/bin/env python3\n# -*- coding: utf-8 -*-\n# Ground-truth 2D engineering drawing for part: 0080_00808846\n# Self-contained: reproduces the three-view DXF via ezdxf, NO FreeCAD needed.\n# Coordinates are A4 page millimetres (scale=0.9471356783920223, page=[297.0, 210.0]).\n# visible edges -> solid (layer OUTLINE); hidden edges -> dashed (layer HIDDEN)\n# dimensions -> real movable DIMENSION entities (text = true mm value)\n# Run: python 0080_00808846_gt.py [out.dxf]\nimport sys\nimport ezdxf\nimport math\n\nSCALE = 0.9471356783920223\nPAGE = [297.0, 210.0]\n\nVISIBLE_SEGMENTS = [\n (178.677114, 172.050002, 178.677114, 86.309299),\n (178.677114, 86.309299, 83.963546, 86.309299),\n (83.963546, 86.309299, 83.963546, 172.050002),\n (83.963546, 172.050002, 178.677114, 172.050002),\n (178.677114, 61.950002, 178.677114, 72.309299),\n (178.677114, 72.309299, 83.963546, 72.309299),\n (83.963546, 61.950002, 83.963546, 72.309299),\n (178.677114, 61.950002, 83.963546, 61.950002),\n (192.677114, 86.309299, 203.036411, 86.309299),\n (203.036411, 86.309299, 203.036411, 172.050002),\n (192.677114, 172.050002, 203.036411, 172.050002),\n (192.677114, 86.309299, 192.677114, 172.050002)\n]\nVISIBLE_CIRCLES = [\n\n]\nVISIBLE_ARCS = [\n\n]\nHIDDEN_SEGMENTS = [\n\n]\n# (orient, text, p1, p2, base) for linear; (orient, text, center, radius, angle) for diameter\nDIMENSIONS = [\n ('horizontal', '100', (178.6771, 172.05), (83.9636, 172.05), (131.3204, 161.05)),\n ('vertical', '90.5263', (178.6771, 86.3093), (178.6771, 172.05), (167.6771, 129.1796)),\n ('horizontal', '10.9375', (192.6771, 86.3093), (203.0364, 86.3093), (197.8568, 97.3093))\n]\n\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; _ds.dxf.dimasz = 2.5\n _ds.dxf.dimexe = 1.25; _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\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\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,\n angle=(0 if d[0] == \"horizontal\" else 90),\n 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,\n 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,\n 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,\n text=text, dimstyle=\"EZDXF\").render()\n\n doc.saveas(out_path)\n\n\nif __name__ == \"__main__\":\n out = sys.argv[1] if len(sys.argv) > 1 else \"0080_00808846_gt.dxf\"\n draw(out)\n print(\"wrote\", out)\n```"}], "images": ["images/0080_00808846.png"], "id": "0080_00808846"} {"messages": [{"role": "user", "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 66.67 mm."}, {"role": "assistant", "content": "```python\n#!/usr/bin/env python3\n# -*- coding: utf-8 -*-\n# Ground-truth 2D engineering drawing for part: 0080_00809808\n# Self-contained: reproduces the three-view DXF via ezdxf, NO FreeCAD needed.\n# Coordinates are A4 page millimetres (scale=0.8816399999999983, page=[297.0, 210.0]).\n# visible edges -> solid (layer OUTLINE); hidden edges -> dashed (layer HIDDEN)\n# dimensions -> real movable DIMENSION entities (text = true mm value)\n# Run: python 0080_00809808_gt.py [out.dxf]\nimport sys\nimport ezdxf\nimport math\n\nSCALE = 0.8816399999999983\nPAGE = [297.0, 210.0]\n\nVISIBLE_SEGMENTS = [\n (151.194, 168.236728, 151.194, 138.539381),\n (151.194, 138.539381, 63.03, 138.539381),\n (63.03, 138.539381, 63.03, 168.236728),\n (63.03, 168.236728, 151.194, 168.236728),\n (151.194, 65.763381, 151.194, 124.539381),\n (151.194, 124.539381, 63.03, 124.539381),\n (63.03, 65.763381, 63.03, 124.539381),\n (151.194, 65.763381, 63.03, 65.763381),\n (165.194, 138.539381, 223.97, 138.539381),\n (223.97, 138.539381, 223.97, 168.236728),\n (165.194, 168.236728, 223.97, 168.236728),\n (165.194, 138.539381, 165.194, 168.236728)\n]\nVISIBLE_CIRCLES = [\n\n]\nVISIBLE_ARCS = [\n\n]\nHIDDEN_SEGMENTS = [\n\n]\n# (orient, text, p1, p2, base) for linear; (orient, text, center, radius, angle) for diameter\nDIMENSIONS = [\n ('horizontal', '100', (151.194, 168.2367), (63.03, 168.2367), (107.112, 157.2367)),\n ('vertical', '33.6842', (151.194, 138.5394), (151.194, 168.2367), (140.194, 153.388)),\n ('horizontal', '66.6667', (165.194, 138.5394), (223.97, 138.5394), (194.582, 149.5394))\n]\n\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; _ds.dxf.dimasz = 2.5\n _ds.dxf.dimexe = 1.25; _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\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\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,\n angle=(0 if d[0] == \"horizontal\" else 90),\n 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,\n 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,\n 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,\n text=text, dimstyle=\"EZDXF\").render()\n\n doc.saveas(out_path)\n\n\nif __name__ == \"__main__\":\n out = sys.argv[1] if len(sys.argv) > 1 else \"0080_00809808_gt.dxf\"\n draw(out)\n print(\"wrote\", out)\n```"}], "images": ["images/0080_00809808.png"], "id": "0080_00809808"} {"messages": [{"role": "user", "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 40.35 mm."}, {"role": "assistant", "content": "```python\n#!/usr/bin/env python3\n# -*- coding: utf-8 -*-\n# Ground-truth 2D engineering drawing for part: 0081_00811361\n# Self-contained: reproduces the three-view DXF via ezdxf, NO FreeCAD needed.\n# Coordinates are A4 page millimetres (scale=0.6847125000000073, page=[297.0, 210.0]).\n# visible edges -> solid (layer OUTLINE); hidden edges -> dashed (layer HIDDEN)\n# dimensions -> real movable DIMENSION entities (text = true mm value)\n# Run: python 0081_00811361_gt.py [out.dxf]\nimport sys\nimport ezdxf\nimport math\n\nSCALE = 0.6847125000000073\nPAGE = [297.0, 210.0]\n\nVISIBLE_SEGMENTS = [\n (124.4875, 172.04997, 124.4875, 103.57872),\n (124.4875, 103.57872, 120.88375, 103.57872),\n (120.88375, 103.57872, 120.88375, 172.04997),\n (120.88375, 172.04997, 124.4875, 172.04997),\n (124.4875, 61.94997, 124.4875, 89.57872),\n (124.4875, 89.57872, 120.88375, 89.57872),\n (120.88375, 61.94997, 120.88375, 89.57872),\n (124.4875, 61.94997, 120.88375, 61.94997),\n (138.4875, 103.57872, 166.11625, 103.57872),\n (166.11625, 103.57872, 166.11625, 172.04997),\n (138.4875, 172.04997, 166.11625, 172.04997),\n (138.4875, 103.57872, 138.4875, 172.04997)\n]\nVISIBLE_CIRCLES = [\n\n]\nVISIBLE_ARCS = [\n\n]\nHIDDEN_SEGMENTS = [\n\n]\n# (orient, text, p1, p2, base) for linear; (orient, text, center, radius, angle) for diameter\nDIMENSIONS = [\n ('horizontal', '5.2632', (124.4875, 172.05), (120.8837, 172.05), (122.6856, 161.05)),\n ('vertical', '100', (124.4875, 103.5787), (124.4875, 172.05), (113.4875, 137.8144)),\n ('horizontal', '40.3509', (138.4875, 103.5787), (166.1163, 103.5787), (152.3019, 114.5787))\n]\n\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; _ds.dxf.dimasz = 2.5\n _ds.dxf.dimexe = 1.25; _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\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\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,\n angle=(0 if d[0] == \"horizontal\" else 90),\n 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,\n 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,\n 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,\n text=text, dimstyle=\"EZDXF\").render()\n\n doc.saveas(out_path)\n\n\nif __name__ == \"__main__\":\n out = sys.argv[1] if len(sys.argv) > 1 else \"0081_00811361_gt.dxf\"\n draw(out)\n print(\"wrote\", out)\n```"}], "images": ["images/0081_00811361.png"], "id": "0081_00811361"} {"messages": [{"role": "user", "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 66.32 mm tall. It is extruded to a thickness of 0.52 mm."}, {"role": "assistant", "content": "```python\n#!/usr/bin/env python3\n# -*- coding: utf-8 -*-\n# Ground-truth 2D engineering drawing for part: 0081_00814768\n# Self-contained: reproduces the three-view DXF via ezdxf, NO FreeCAD needed.\n# Coordinates are A4 page millimetres (scale=1.4378344680502768, page=[297.0, 210.0]).\n# visible edges -> solid (layer OUTLINE); hidden edges -> dashed (layer HIDDEN)\n# dimensions -> real movable DIMENSION entities (text = true mm value)\n# Run: python 0081_00814768_gt.py [out.dxf]\nimport sys\nimport ezdxf\nimport math\n\nSCALE = 1.4378344680502768\nPAGE = [297.0, 210.0]\n\nVISIBLE_SEGMENTS = [\n (208.017275, 172.050057, 208.017275, 76.698929),\n (208.017275, 76.698929, 64.233828, 76.698929),\n (64.233828, 76.698929, 64.233828, 172.050057),\n (64.233828, 172.050057, 208.017275, 172.050057),\n (208.017275, 61.950057, 208.017275, 62.698929),\n (208.017275, 62.698929, 64.233828, 62.698929),\n (64.233828, 61.950057, 64.233828, 62.698929),\n (208.017275, 61.950057, 64.233828, 61.950057),\n (222.017275, 76.698929, 222.766147, 76.698929),\n (222.766147, 76.698929, 222.766147, 172.050057),\n (222.017275, 172.050057, 222.766147, 172.050057),\n (222.017275, 76.698929, 222.017275, 172.050057)\n]\nVISIBLE_CIRCLES = [\n\n]\nVISIBLE_ARCS = [\n\n]\nHIDDEN_SEGMENTS = [\n\n]\n# (orient, text, p1, p2, base) for linear; (orient, text, center, radius, angle) for diameter\nDIMENSIONS = [\n ('horizontal', '100', (208.0173, 172.0501), (64.2338, 172.0501), (136.1256, 161.0501)),\n ('vertical', '66.3158', (208.0173, 76.6989), (208.0173, 172.0501), (197.0173, 124.3745)),\n ('horizontal', '0.5208', (222.0173, 76.6989), (222.7661, 76.6989), (222.3917, 87.6989))\n]\n\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; _ds.dxf.dimasz = 2.5\n _ds.dxf.dimexe = 1.25; _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\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\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,\n angle=(0 if d[0] == \"horizontal\" else 90),\n 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,\n 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,\n 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,\n text=text, dimstyle=\"EZDXF\").render()\n\n doc.saveas(out_path)\n\n\nif __name__ == \"__main__\":\n out = sys.argv[1] if len(sys.argv) > 1 else \"0081_00814768_gt.dxf\"\n draw(out)\n print(\"wrote\", out)\n```"}], "images": ["images/0081_00814768.png"], "id": "0081_00814768"} {"messages": [{"role": "user", "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 49.47 mm wide and 100 mm tall. It is extruded to a thickness of 1.04 mm."}, {"role": "assistant", "content": "```python\n#!/usr/bin/env python3\n# -*- coding: utf-8 -*-\n# Ground-truth 2D engineering drawing for part: 0081_00817495\n# Self-contained: reproduces the three-view DXF via ezdxf, NO FreeCAD needed.\n# Coordinates are A4 page millimetres (scale=0.9510927835051515, page=[297.0, 210.0]).\n# visible edges -> solid (layer OUTLINE); hidden edges -> dashed (layer HIDDEN)\n# dimensions -> real movable DIMENSION entities (text = true mm value)\n# Run: python 0081_00817495_gt.py [out.dxf]\nimport sys\nimport ezdxf\nimport math\n\nSCALE = 0.9510927835051515\nPAGE = [297.0, 210.0]\n\nVISIBLE_SEGMENTS = [\n (159.531688, 172.049987, 159.531688, 76.940709),\n (159.531688, 76.940709, 112.477624, 76.940709),\n (112.477624, 76.940709, 112.477624, 172.049987),\n (112.477624, 172.049987, 159.531688, 172.049987),\n (159.531688, 61.949987, 159.531688, 62.940709),\n (159.531688, 62.940709, 112.477624, 62.940709),\n (112.477624, 61.949987, 112.477624, 62.940709),\n (159.531688, 61.949987, 112.477624, 61.949987),\n (173.531688, 76.940709, 174.52241, 76.940709),\n (174.52241, 76.940709, 174.52241, 172.049987),\n (173.531688, 172.049987, 174.52241, 172.049987),\n (173.531688, 76.940709, 173.531688, 172.049987)\n]\nVISIBLE_CIRCLES = [\n\n]\nVISIBLE_ARCS = [\n\n]\nHIDDEN_SEGMENTS = [\n\n]\n# (orient, text, p1, p2, base) for linear; (orient, text, center, radius, angle) for diameter\nDIMENSIONS = [\n ('horizontal', '49.4737', (159.5317, 172.05), (112.4776, 172.05), (136.0046, 161.05)),\n ('vertical', '100', (159.5317, 76.9407), (159.5317, 172.05), (148.5317, 124.4954)),\n ('horizontal', '1.0417', (173.5317, 76.9407), (174.5224, 76.9407), (174.027, 87.9407))\n]\n\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; _ds.dxf.dimasz = 2.5\n _ds.dxf.dimexe = 1.25; _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\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\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,\n angle=(0 if d[0] == \"horizontal\" else 90),\n 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,\n 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,\n 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,\n text=text, dimstyle=\"EZDXF\").render()\n\n doc.saveas(out_path)\n\n\nif __name__ == \"__main__\":\n out = sys.argv[1] if len(sys.argv) > 1 else \"0081_00817495_gt.dxf\"\n draw(out)\n print(\"wrote\", out)\n```"}], "images": ["images/0081_00817495.png"], "id": "0081_00817495"} {"messages": [{"role": "user", "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 0.52 mm."}, {"role": "assistant", "content": "```python\n#!/usr/bin/env python3\n# -*- coding: utf-8 -*-\n# Ground-truth 2D engineering drawing for part: 0082_00820488\n# Self-contained: reproduces the three-view DXF via ezdxf, NO FreeCAD needed.\n# Coordinates are A4 page millimetres (scale=0.9560207253886043, page=[297.0, 210.0]).\n# visible edges -> solid (layer OUTLINE); hidden edges -> dashed (layer HIDDEN)\n# dimensions -> real movable DIMENSION entities (text = true mm value)\n# Run: python 0082_00820488_gt.py [out.dxf]\nimport sys\nimport ezdxf\nimport math\n\nSCALE = 0.9560207253886043\nPAGE = [297.0, 210.0]\n\nVISIBLE_SEGMENTS = [\n (184.052089, 172.049984, 184.052089, 76.447911),\n (184.052089, 76.447911, 88.450016, 76.447911),\n (88.450016, 76.447911, 88.450016, 172.049984),\n (88.450016, 172.049984, 184.052089, 172.049984),\n (184.052089, 61.949984, 184.052089, 62.447911),\n (184.052089, 62.447911, 88.450016, 62.447911),\n (88.450016, 61.949984, 88.450016, 62.447911),\n (184.052089, 61.949984, 88.450016, 61.949984),\n (198.052089, 76.447911, 198.550016, 76.447911),\n (198.550016, 76.447911, 198.550016, 172.049984),\n (198.052089, 172.049984, 198.550016, 172.049984),\n (198.052089, 76.447911, 198.052089, 172.049984)\n]\nVISIBLE_CIRCLES = [\n\n]\nVISIBLE_ARCS = [\n\n]\nHIDDEN_SEGMENTS = [\n\n]\n# (orient, text, p1, p2, base) for linear; (orient, text, center, radius, angle) for diameter\nDIMENSIONS = [\n ('horizontal', '100', (184.0521, 172.05), (88.45, 172.05), (136.251, 161.05)),\n ('vertical', '100', (184.0521, 76.4479), (184.0521, 172.05), (173.0521, 124.249)),\n ('vertical', '0.5208', (198.0521, 76.4479), (198.55, 76.4479), (198.301, 87.4479))\n]\n\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; _ds.dxf.dimasz = 2.5\n _ds.dxf.dimexe = 1.25; _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\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\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,\n angle=(0 if d[0] == \"horizontal\" else 90),\n 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,\n 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,\n 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,\n text=text, dimstyle=\"EZDXF\").render()\n\n doc.saveas(out_path)\n\n\nif __name__ == \"__main__\":\n out = sys.argv[1] if len(sys.argv) > 1 else \"0082_00820488_gt.dxf\"\n draw(out)\n print(\"wrote\", out)\n```"}], "images": ["images/0082_00820488.png"], "id": "0082_00820488"} {"messages": [{"role": "user", "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 11.58 mm tall. It is extruded to a thickness of 1920 mm."}, {"role": "assistant", "content": "```python\n#!/usr/bin/env python3\n# -*- coding: utf-8 -*-\n# Ground-truth 2D engineering drawing for part: 0082_00820753\n# Self-contained: reproduces the three-view DXF via ezdxf, NO FreeCAD needed.\n# Coordinates are A4 page millimetres (scale=0.04975204359673025, page=[297.0, 210.0]).\n# visible edges -> solid (layer OUTLINE); hidden edges -> dashed (layer HIDDEN)\n# dimensions -> real movable DIMENSION entities (text = true mm value)\n# Run: python 0082_00820753_gt.py [out.dxf]\nimport sys\nimport ezdxf\nimport math\n\nSCALE = 0.04975204359673025\nPAGE = [297.0, 210.0]\n\nVISIBLE_SEGMENTS = [\n (91.225616, 172.049986, 91.225616, 171.473909),\n (91.225616, 171.473909, 86.250412, 171.473909),\n (86.250412, 171.473909, 86.250412, 172.049986),\n (86.250412, 172.049986, 91.225616, 172.049986),\n (91.225616, 61.949986, 91.225616, 157.473909),\n (91.225616, 157.473909, 86.250412, 157.473909),\n (86.250412, 61.949986, 86.250412, 157.473909),\n (91.225616, 61.949986, 86.250412, 61.949986),\n (105.225616, 171.473909, 200.74954, 171.473909),\n (200.74954, 171.473909, 200.74954, 172.049986),\n (105.225616, 172.049986, 200.74954, 172.049986),\n (105.225616, 171.473909, 105.225616, 172.049986)\n]\nVISIBLE_CIRCLES = [\n\n]\nVISIBLE_ARCS = [\n\n]\nHIDDEN_SEGMENTS = [\n\n]\n# (orient, text, p1, p2, base) for linear; (orient, text, center, radius, angle) for diameter\nDIMENSIONS = [\n ('horizontal', '100', (91.2256, 172.05), (86.2504, 172.05), (88.738, 161.05)),\n ('vertical', '11.5789', (91.2256, 171.4739), (91.2256, 172.05), (80.2256, 171.762)),\n ('horizontal', '1920', (105.2256, 171.4739), (200.7496, 171.4739), (152.9876, 182.4739))\n]\n\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; _ds.dxf.dimasz = 2.5\n _ds.dxf.dimexe = 1.25; _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\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\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,\n angle=(0 if d[0] == \"horizontal\" else 90),\n 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,\n 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,\n 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,\n text=text, dimstyle=\"EZDXF\").render()\n\n doc.saveas(out_path)\n\n\nif __name__ == \"__main__\":\n out = sys.argv[1] if len(sys.argv) > 1 else \"0082_00820753_gt.dxf\"\n draw(out)\n print(\"wrote\", out)\n```"}], "images": ["images/0082_00820753.png"], "id": "0082_00820753"} {"messages": [{"role": "user", "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 66.32 mm tall. It is extruded to a thickness of 27.48 mm."}, {"role": "assistant", "content": "```python\n#!/usr/bin/env python3\n# -*- coding: utf-8 -*-\n# Ground-truth 2D engineering drawing for part: 0082_00824543\n# Self-contained: reproduces the three-view DXF via ezdxf, NO FreeCAD needed.\n# Coordinates are A4 page millimetres (scale=1.024556240897837, page=[297.0, 210.0]).\n# visible edges -> solid (layer OUTLINE); hidden edges -> dashed (layer HIDDEN)\n# dimensions -> real movable DIMENSION entities (text = true mm value)\n# Run: python 0082_00824543_gt.py [out.dxf]\nimport sys\nimport ezdxf\nimport math\n\nSCALE = 1.024556240897837\nPAGE = [297.0, 210.0]\n\nVISIBLE_SEGMENTS = [\n (173.649916, 172.050034, 173.649916, 104.105778),\n (173.649916, 104.105778, 71.194292, 104.105778),\n (71.194292, 104.105778, 71.194292, 172.050034),\n (71.194292, 172.050034, 173.649916, 172.050034),\n (173.649916, 61.950034, 173.649916, 90.105778),\n (173.649916, 90.105778, 71.194292, 90.105778),\n (71.194292, 61.950034, 71.194292, 90.105778),\n (173.649916, 61.950034, 71.194292, 61.950034),\n (187.649916, 104.105778, 215.80566, 104.105778),\n (215.80566, 104.105778, 215.80566, 172.050034),\n (187.649916, 172.050034, 215.80566, 172.050034),\n (187.649916, 104.105778, 187.649916, 172.050034)\n]\nVISIBLE_CIRCLES = [\n\n]\nVISIBLE_ARCS = [\n\n]\nHIDDEN_SEGMENTS = [\n\n]\n# (orient, text, p1, p2, base) for linear; (orient, text, center, radius, angle) for diameter\nDIMENSIONS = [\n ('horizontal', '100', (173.6499, 172.05), (71.1943, 172.05), (122.4221, 161.05)),\n ('vertical', '66.3158', (173.6499, 104.1058), (173.6499, 172.05), (162.6499, 138.0779)),\n ('horizontal', '27.4809', (187.6499, 104.1058), (215.8057, 104.1058), (201.7278, 115.1058))\n]\n\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; _ds.dxf.dimasz = 2.5\n _ds.dxf.dimexe = 1.25; _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\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\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,\n angle=(0 if d[0] == \"horizontal\" else 90),\n 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,\n 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,\n 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,\n text=text, dimstyle=\"EZDXF\").render()\n\n doc.saveas(out_path)\n\n\nif __name__ == \"__main__\":\n out = sys.argv[1] if len(sys.argv) > 1 else \"0082_00824543_gt.dxf\"\n draw(out)\n print(\"wrote\", out)\n```"}], "images": ["images/0082_00824543.png"], "id": "0082_00824543"} {"messages": [{"role": "user", "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 33.6 mm."}, {"role": "assistant", "content": "```python\n#!/usr/bin/env python3\n# -*- coding: utf-8 -*-\n# Ground-truth 2D engineering drawing for part: 0082_00825579\n# Self-contained: reproduces the three-view DXF via ezdxf, NO FreeCAD needed.\n# Coordinates are A4 page millimetres (scale=0.719311377245509, page=[297.0, 210.0]).\n# visible edges -> solid (layer OUTLINE); hidden edges -> dashed (layer HIDDEN)\n# dimensions -> real movable DIMENSION entities (text = true mm value)\n# Run: python 0082_00825579_gt.py [out.dxf]\nimport sys\nimport ezdxf\nimport math\n\nSCALE = 0.719311377245509\nPAGE = [297.0, 210.0]\n\nVISIBLE_SEGMENTS = [\n (160.381115, 172.050023, 160.381115, 100.118885),\n (160.381115, 100.118885, 88.449977, 100.118885),\n (88.449977, 100.118885, 88.449977, 172.050023),\n (88.449977, 172.050023, 160.381115, 172.050023),\n (160.381115, 61.950023, 160.381115, 86.118885),\n (160.381115, 86.118885, 88.449977, 86.118885),\n (88.449977, 61.950023, 88.449977, 86.118885),\n (160.381115, 61.950023, 88.449977, 61.950023),\n (174.381115, 100.118885, 198.549977, 100.118885),\n (198.549977, 100.118885, 198.549977, 172.050023),\n (174.381115, 172.050023, 198.549977, 172.050023),\n (174.381115, 100.118885, 174.381115, 172.050023)\n]\nVISIBLE_CIRCLES = [\n\n]\nVISIBLE_ARCS = [\n\n]\nHIDDEN_SEGMENTS = [\n\n]\n# (orient, text, p1, p2, base) for linear; (orient, text, center, radius, angle) for diameter\nDIMENSIONS = [\n ('horizontal', '100', (160.3811, 172.05), (88.45, 172.05), (124.4156, 161.05)),\n ('vertical', '100', (160.3811, 100.1189), (160.3811, 172.05), (149.3811, 136.0844)),\n ('horizontal', '33.6', (174.3811, 100.1189), (198.55, 100.1189), (186.4656, 111.1189))\n]\n\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; _ds.dxf.dimasz = 2.5\n _ds.dxf.dimexe = 1.25; _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\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\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,\n angle=(0 if d[0] == \"horizontal\" else 90),\n 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,\n 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,\n 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,\n text=text, dimstyle=\"EZDXF\").render()\n\n doc.saveas(out_path)\n\n\nif __name__ == \"__main__\":\n out = sys.argv[1] if len(sys.argv) > 1 else \"0082_00825579_gt.dxf\"\n draw(out)\n print(\"wrote\", out)\n```"}], "images": ["images/0082_00825579.png"], "id": "0082_00825579"} {"messages": [{"role": "user", "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.56 mm."}, {"role": "assistant", "content": "```python\n#!/usr/bin/env python3\n# -*- coding: utf-8 -*-\n# Ground-truth 2D engineering drawing for part: 0082_00829011\n# Self-contained: reproduces the three-view DXF via ezdxf, NO FreeCAD needed.\n# Coordinates are A4 page millimetres (scale=0.7346999999999999, page=[297.0, 210.0]).\n# visible edges -> solid (layer OUTLINE); hidden edges -> dashed (layer HIDDEN)\n# dimensions -> real movable DIMENSION entities (text = true mm value)\n# Run: python 0082_00829011_gt.py [out.dxf]\nimport sys\nimport ezdxf\nimport math\n\nSCALE = 0.7346999999999999\nPAGE = [297.0, 210.0]\n\nVISIBLE_SEGMENTS = [\n (172.661006, 87.839, 172.661006, 161.309),\n (172.661006, 161.309, 99.191006, 161.309),\n (99.191006, 161.309, 99.191006, 87.839),\n (99.191006, 87.839, 172.661006, 87.839),\n (172.661006, 73.839, 172.661006, 72.691031),\n (99.191006, 73.839, 99.191006, 72.691031),\n (99.191006, 72.691031, 172.661006, 72.691031),\n (99.191006, 73.839, 172.661006, 73.839),\n (187.808975, 161.309, 186.661006, 161.309),\n (186.661006, 161.309, 186.661006, 87.839),\n (187.808975, 87.839, 186.661006, 87.839),\n (187.808975, 161.309, 187.808975, 87.839)\n]\nVISIBLE_CIRCLES = [\n\n]\nVISIBLE_ARCS = [\n\n]\nHIDDEN_SEGMENTS = [\n\n]\n# (orient, text, p1, p2, base) for linear; (orient, text, center, radius, angle) for diameter\nDIMENSIONS = [\n ('horizontal', '100', (172.661, 87.839), (99.191, 87.839), (135.926, 76.839)),\n ('vertical', '100', (172.661, 161.309), (172.661, 87.839), (183.661, 124.574)),\n ('horizontal', '1.5625', (187.809, 161.309), (186.661, 161.309), (187.235, 150.309))\n]\n\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; _ds.dxf.dimasz = 2.5\n _ds.dxf.dimexe = 1.25; _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\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\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,\n angle=(0 if d[0] == \"horizontal\" else 90),\n 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,\n 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,\n 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,\n text=text, dimstyle=\"EZDXF\").render()\n\n doc.saveas(out_path)\n\n\nif __name__ == \"__main__\":\n out = sys.argv[1] if len(sys.argv) > 1 else \"0082_00829011_gt.dxf\"\n draw(out)\n print(\"wrote\", out)\n```"}], "images": ["images/0082_00829011.png"], "id": "0082_00829011"} {"messages": [{"role": "user", "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 9600 mm."}, {"role": "assistant", "content": "```python\n#!/usr/bin/env python3\n# -*- coding: utf-8 -*-\n# Ground-truth 2D engineering drawing for part: 0082_00829048\n# Self-contained: reproduces the three-view DXF via ezdxf, NO FreeCAD needed.\n# Coordinates are A4 page millimetres (scale=0.00990721649484536, page=[297.0, 210.0]).\n# visible edges -> solid (layer OUTLINE); hidden edges -> dashed (layer HIDDEN)\n# dimensions -> real movable DIMENSION entities (text = true mm value)\n# Run: python 0082_00829048_gt.py [out.dxf]\nimport sys\nimport ezdxf\nimport math\n\nSCALE = 0.00990721649484536\nPAGE = [297.0, 210.0]\n\nVISIBLE_SEGMENTS = [\n (89.440709, 172.050013, 89.440709, 171.059291),\n (89.440709, 171.059291, 88.449987, 171.059291),\n (88.449987, 171.059291, 88.449987, 172.050013),\n (88.449987, 172.050013, 89.440709, 172.050013),\n (89.440709, 61.950013, 89.440709, 157.059291),\n (89.440709, 157.059291, 88.449987, 157.059291),\n (88.449987, 61.950013, 88.449987, 157.059291),\n (89.440709, 61.950013, 88.449987, 61.950013),\n (103.440709, 171.059291, 198.549987, 171.059291),\n (198.549987, 171.059291, 198.549987, 172.050013),\n (103.440709, 172.050013, 198.549987, 172.050013),\n (103.440709, 171.059291, 103.440709, 172.050013)\n]\nVISIBLE_CIRCLES = [\n\n]\nVISIBLE_ARCS = [\n\n]\nHIDDEN_SEGMENTS = [\n\n]\n# (orient, text, p1, p2, base) for linear; (orient, text, center, radius, angle) for diameter\nDIMENSIONS = [\n ('horizontal', '100', (89.4407, 172.05), (88.45, 172.05), (88.9454, 161.05)),\n ('vertical', '100', (89.4407, 171.0593), (89.4407, 172.05), (78.4407, 171.5546)),\n ('horizontal', '9600', (103.4407, 171.0593), (198.55, 171.0593), (150.9954, 182.0593))\n]\n\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; _ds.dxf.dimasz = 2.5\n _ds.dxf.dimexe = 1.25; _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\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\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,\n angle=(0 if d[0] == \"horizontal\" else 90),\n 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,\n 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,\n 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,\n text=text, dimstyle=\"EZDXF\").render()\n\n doc.saveas(out_path)\n\n\nif __name__ == \"__main__\":\n out = sys.argv[1] if len(sys.argv) > 1 else \"0082_00829048_gt.dxf\"\n draw(out)\n print(\"wrote\", out)\n```"}], "images": ["images/0082_00829048.png"], "id": "0082_00829048"} {"messages": [{"role": "user", "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 16.67 mm."}, {"role": "assistant", "content": "```python\n#!/usr/bin/env python3\n# -*- coding: utf-8 -*-\n# Ground-truth 2D engineering drawing for part: 0083_00832206\n# Self-contained: reproduces the three-view DXF via ezdxf, NO FreeCAD needed.\n# Coordinates are A4 page millimetres (scale=0.8022586206896861, page=[297.0, 210.0]).\n# visible edges -> solid (layer OUTLINE); hidden edges -> dashed (layer HIDDEN)\n# dimensions -> real movable DIMENSION entities (text = true mm value)\n# Run: python 0083_00832206_gt.py [out.dxf]\nimport sys\nimport ezdxf\nimport math\n\nSCALE = 0.8022586206896861\nPAGE = [297.0, 210.0]\n\nVISIBLE_SEGMENTS = [\n (163.171592, 90.572563, 163.171592, 170.798425),\n (163.171592, 170.798425, 96.457454, 170.798425),\n (96.457454, 170.798425, 96.457454, 90.572563),\n (96.457454, 90.572563, 163.171592, 90.572563),\n (163.171592, 76.572563, 163.171592, 63.201586),\n (96.457454, 76.572563, 96.457454, 63.201586),\n (96.457454, 63.201586, 163.171592, 63.201586),\n (96.457454, 76.572563, 163.171592, 76.572563),\n (190.542569, 170.798425, 177.171592, 170.798425),\n (177.171592, 170.798425, 177.171592, 90.572563),\n (190.542569, 90.572563, 177.171592, 90.572563),\n (190.542569, 170.798425, 190.542569, 90.572563)\n]\nVISIBLE_CIRCLES = [\n\n]\nVISIBLE_ARCS = [\n\n]\nHIDDEN_SEGMENTS = [\n\n]\n# (orient, text, p1, p2, base) for linear; (orient, text, center, radius, angle) for diameter\nDIMENSIONS = [\n ('horizontal', '83.1579', (163.1716, 90.5726), (96.4574, 90.5726), (129.8145, 79.5726)),\n ('vertical', '100', (163.1716, 170.7984), (163.1716, 90.5726), (174.1716, 130.6855)),\n ('horizontal', '16.6667', (190.5426, 170.7984), (177.1716, 170.7984), (183.8571, 159.7984))\n]\n\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; _ds.dxf.dimasz = 2.5\n _ds.dxf.dimexe = 1.25; _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\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\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,\n angle=(0 if d[0] == \"horizontal\" else 90),\n 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,\n 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,\n 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,\n text=text, dimstyle=\"EZDXF\").render()\n\n doc.saveas(out_path)\n\n\nif __name__ == \"__main__\":\n out = sys.argv[1] if len(sys.argv) > 1 else \"0083_00832206_gt.dxf\"\n draw(out)\n print(\"wrote\", out)\n```"}], "images": ["images/0083_00832206.png"], "id": "0083_00832206"} {"messages": [{"role": "user", "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 77.89 mm tall. It is extruded to a thickness of -2.08 mm."}, {"role": "assistant", "content": "```python\n#!/usr/bin/env python3\n# -*- coding: utf-8 -*-\n# Ground-truth 2D engineering drawing for part: 0083_00832275\n# Self-contained: reproduces the three-view DXF via ezdxf, NO FreeCAD needed.\n# Coordinates are A4 page millimetres (scale=1.2015793803126396, page=[297.0, 210.0]).\n# visible edges -> solid (layer OUTLINE); hidden edges -> dashed (layer HIDDEN)\n# dimensions -> real movable DIMENSION entities (text = true mm value)\n# Run: python 0083_00832275_gt.py [out.dxf]\nimport sys\nimport ezdxf\nimport math\n\nSCALE = 1.2015793803126396\nPAGE = [297.0, 210.0]\n\nVISIBLE_SEGMENTS = [\n (195.32733, 172.050006, 195.32733, 78.453296),\n (195.32733, 78.453296, 75.169391, 78.453296),\n (75.169391, 78.453296, 75.169391, 172.050006),\n (75.169391, 172.050006, 195.32733, 172.050006),\n (195.32733, 64.453296, 195.32733, 61.950006),\n (195.32733, 61.950006, 75.169391, 61.950006),\n (75.169391, 64.453296, 75.169391, 61.950006),\n (195.32733, 64.453296, 75.169391, 64.453296),\n (211.83062, 78.453296, 209.32733, 78.453296),\n (209.32733, 78.453296, 209.32733, 172.050006),\n (211.83062, 172.050006, 209.32733, 172.050006),\n (211.83062, 78.453296, 211.83062, 172.050006)\n]\nVISIBLE_CIRCLES = [\n\n]\nVISIBLE_ARCS = [\n\n]\nHIDDEN_SEGMENTS = [\n\n]\n# (orient, text, p1, p2, base) for linear; (orient, text, center, radius, angle) for diameter\nDIMENSIONS = [\n ('horizontal', '100', (195.3273, 172.05), (75.1694, 172.05), (135.2484, 161.05)),\n ('vertical', '77.8947', (195.3273, 78.4533), (195.3273, 172.05), (184.3273, 125.2517)),\n ('horizontal', '2.0833', (211.8306, 78.4533), (209.3274, 78.4533), (210.579, 67.4533))\n]\n\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; _ds.dxf.dimasz = 2.5\n _ds.dxf.dimexe = 1.25; _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\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\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,\n angle=(0 if d[0] == \"horizontal\" else 90),\n 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,\n 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,\n 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,\n text=text, dimstyle=\"EZDXF\").render()\n\n doc.saveas(out_path)\n\n\nif __name__ == \"__main__\":\n out = sys.argv[1] if len(sys.argv) > 1 else \"0083_00832275_gt.dxf\"\n draw(out)\n print(\"wrote\", out)\n```"}], "images": ["images/0083_00832275.png"], "id": "0083_00832275"} {"messages": [{"role": "user", "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 92.63 mm tall. It is extruded to a thickness of 0.52 mm."}, {"role": "assistant", "content": "```python\n#!/usr/bin/env python3\n# -*- coding: utf-8 -*-\n# Ground-truth 2D engineering drawing for part: 0083_00834113\n# Self-contained: reproduces the three-view DXF via ezdxf, NO FreeCAD needed.\n# Coordinates are A4 page millimetres (scale=0.7628032786885499, page=[297.0, 210.0]).\n# visible edges -> solid (layer OUTLINE); hidden edges -> dashed (layer HIDDEN)\n# dimensions -> real movable DIMENSION entities (text = true mm value)\n# Run: python 0083_00834113_gt.py [out.dxf]\nimport sys\nimport ezdxf\nimport math\n\nSCALE = 0.7628032786885499\nPAGE = [297.0, 210.0]\n\nVISIBLE_SEGMENTS = [\n (174.441507, 88.868817, 174.441507, 159.528489),\n (174.441507, 159.528489, 98.161179, 159.528489),\n (98.161179, 159.528489, 98.161179, 88.868817),\n (98.161179, 88.868817, 174.441507, 88.868817),\n (174.441507, 74.868817, 174.441507, 74.471523),\n (98.161179, 74.868817, 98.161179, 74.471523),\n (98.161179, 74.471523, 174.441507, 74.471523),\n (98.161179, 74.868817, 174.441507, 74.868817),\n (188.8388, 159.528489, 188.441507, 159.528489),\n (188.441507, 159.528489, 188.441507, 88.868817),\n (188.8388, 88.868817, 188.441507, 88.868817),\n (188.8388, 159.528489, 188.8388, 88.868817)\n]\nVISIBLE_CIRCLES = [\n\n]\nVISIBLE_ARCS = [\n\n]\nHIDDEN_SEGMENTS = [\n\n]\n# (orient, text, p1, p2, base) for linear; (orient, text, center, radius, angle) for diameter\nDIMENSIONS = [\n ('horizontal', '100', (174.4415, 88.8688), (98.1612, 88.8688), (136.3014, 77.8688)),\n ('vertical', '92.6316', (174.4415, 159.5285), (174.4415, 88.8688), (185.4415, 124.1987)),\n ('vertical', '0.5208', (188.8388, 159.5285), (188.4415, 159.5285), (188.6402, 148.5285))\n]\n\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; _ds.dxf.dimasz = 2.5\n _ds.dxf.dimexe = 1.25; _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\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\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,\n angle=(0 if d[0] == \"horizontal\" else 90),\n 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,\n 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,\n 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,\n text=text, dimstyle=\"EZDXF\").render()\n\n doc.saveas(out_path)\n\n\nif __name__ == \"__main__\":\n out = sys.argv[1] if len(sys.argv) > 1 else \"0083_00834113_gt.dxf\"\n draw(out)\n print(\"wrote\", out)\n```"}], "images": ["images/0083_00834113.png"], "id": "0083_00834113"} {"messages": [{"role": "user", "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 10.53 mm wide and 100 mm tall. It is extruded to a thickness of 2400 mm."}, {"role": "assistant", "content": "```python\n#!/usr/bin/env python3\n# -*- coding: utf-8 -*-\n# Ground-truth 2D engineering drawing for part: 0084_00842701\n# Self-contained: reproduces the three-view DXF via ezdxf, NO FreeCAD needed.\n# Coordinates are A4 page millimetres (scale=0.03844, page=[297.0, 210.0]).\n# visible edges -> solid (layer OUTLINE); hidden edges -> dashed (layer HIDDEN)\n# dimensions -> real movable DIMENSION entities (text = true mm value)\n# Run: python 0084_00842701_gt.py [out.dxf]\nimport sys\nimport ezdxf\nimport math\n\nSCALE = 0.03844\nPAGE = [297.0, 210.0]\n\nVISIBLE_SEGMENTS = [\n (90.574306, 168.206, 90.574306, 172.05),\n (90.574306, 172.05, 90.169675, 172.05),\n (90.169675, 172.05, 90.169675, 168.206),\n (90.169675, 168.206, 90.574306, 168.206),\n (90.574306, 154.206, 90.574306, 61.95),\n (90.169675, 154.206, 90.169675, 61.95),\n (90.169675, 61.95, 90.574306, 61.95),\n (90.169675, 154.206, 90.574306, 154.206),\n (196.830306, 172.05, 104.574306, 172.05),\n (104.574306, 172.05, 104.574306, 168.206),\n (196.830306, 168.206, 104.574306, 168.206),\n (196.830306, 172.05, 196.830306, 168.206)\n]\nVISIBLE_CIRCLES = [\n\n]\nVISIBLE_ARCS = [\n\n]\nHIDDEN_SEGMENTS = [\n\n]\n# (orient, text, p1, p2, base) for linear; (orient, text, center, radius, angle) for diameter\nDIMENSIONS = [\n ('vertical', '10.5263', (90.5743, 168.206), (90.1697, 168.206), (90.372, 157.206)),\n ('vertical', '100', (90.5743, 172.05), (90.5743, 168.206), (101.5743, 170.128)),\n ('horizontal', '2400', (196.8303, 172.05), (104.5743, 172.05), (150.7023, 161.05))\n]\n\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; _ds.dxf.dimasz = 2.5\n _ds.dxf.dimexe = 1.25; _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\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\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,\n angle=(0 if d[0] == \"horizontal\" else 90),\n 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,\n 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,\n 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,\n text=text, dimstyle=\"EZDXF\").render()\n\n doc.saveas(out_path)\n\n\nif __name__ == \"__main__\":\n out = sys.argv[1] if len(sys.argv) > 1 else \"0084_00842701_gt.dxf\"\n draw(out)\n print(\"wrote\", out)\n```"}], "images": ["images/0084_00842701.png"], "id": "0084_00842701"} {"messages": [{"role": "user", "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 22.47 mm."}, {"role": "assistant", "content": "```python\n#!/usr/bin/env python3\n# -*- coding: utf-8 -*-\n# Ground-truth 2D engineering drawing for part: 0084_00849003\n# Self-contained: reproduces the three-view DXF via ezdxf, NO FreeCAD needed.\n# Coordinates are A4 page millimetres (scale=0.7846697247706584, page=[297.0, 210.0]).\n# visible edges -> solid (layer OUTLINE); hidden edges -> dashed (layer HIDDEN)\n# dimensions -> real movable DIMENSION entities (text = true mm value)\n# Run: python 0084_00849003_gt.py [out.dxf]\nimport sys\nimport ezdxf\nimport math\n\nSCALE = 0.7846697247706584\nPAGE = [297.0, 210.0]\n\nVISIBLE_SEGMENTS = [\n (147.506709, 93.583017, 147.506709, 172.049989),\n (147.506709, 172.049989, 107.860238, 172.049989),\n (107.860238, 172.049989, 107.860238, 93.583017),\n (107.860238, 93.583017, 147.506709, 93.583017),\n (147.506709, 79.583017, 147.506709, 61.949989),\n (107.860238, 79.583017, 107.860238, 61.949989),\n (107.860238, 61.949989, 147.506709, 61.949989),\n (107.860238, 79.583017, 147.506709, 79.583017),\n (179.139736, 172.049989, 161.506709, 172.049989),\n (161.506709, 172.049989, 161.506709, 93.583017),\n (179.139736, 93.583017, 161.506709, 93.583017),\n (179.139736, 172.049989, 179.139736, 93.583017)\n]\nVISIBLE_CIRCLES = [\n\n]\nVISIBLE_ARCS = [\n\n]\nHIDDEN_SEGMENTS = [\n\n]\n# (orient, text, p1, p2, base) for linear; (orient, text, center, radius, angle) for diameter\nDIMENSIONS = [\n ('horizontal', '50.5263', (147.5067, 93.583), (107.8603, 93.583), (127.6835, 82.583)),\n ('vertical', '100', (147.5067, 172.05), (147.5067, 93.583), (158.5067, 132.8165)),\n ('horizontal', '22.4719', (179.1397, 172.05), (161.5067, 172.05), (170.3232, 161.05))\n]\n\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; _ds.dxf.dimasz = 2.5\n _ds.dxf.dimexe = 1.25; _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\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\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,\n angle=(0 if d[0] == \"horizontal\" else 90),\n 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,\n 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,\n 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,\n text=text, dimstyle=\"EZDXF\").render()\n\n doc.saveas(out_path)\n\n\nif __name__ == \"__main__\":\n out = sys.argv[1] if len(sys.argv) > 1 else \"0084_00849003_gt.dxf\"\n draw(out)\n print(\"wrote\", out)\n```"}], "images": ["images/0084_00849003.png"], "id": "0084_00849003"} {"messages": [{"role": "user", "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 51.58 mm tall. It is extruded to a thickness of 2.45 mm."}, {"role": "assistant", "content": "```python\n#!/usr/bin/env python3\n# -*- coding: utf-8 -*-\n# Ground-truth 2D engineering drawing for part: 0084_00849948\n# Self-contained: reproduces the three-view DXF via ezdxf, NO FreeCAD needed.\n# Coordinates are A4 page millimetres (scale=0.969395833333423, page=[297.0, 210.0]).\n# visible edges -> solid (layer OUTLINE); hidden edges -> dashed (layer HIDDEN)\n# dimensions -> real movable DIMENSION entities (text = true mm value)\n# Run: python 0084_00849948_gt.py [out.dxf]\nimport sys\nimport ezdxf\nimport math\n\nSCALE = 0.969395833333423\nPAGE = [297.0, 210.0]\n\nVISIBLE_SEGMENTS = [\n (183.78032, 100.18929, 183.78032, 150.189707),\n (183.78032, 150.189707, 86.840736, 150.189707),\n (86.840736, 150.189707, 86.840736, 100.18929),\n (86.840736, 100.18929, 183.78032, 100.18929),\n (183.78032, 86.18929, 183.78032, 83.810405),\n (86.840736, 86.18929, 86.840736, 83.810405),\n (86.840736, 83.810405, 183.78032, 83.810405),\n (86.840736, 86.18929, 183.78032, 86.18929),\n (200.159205, 150.189707, 197.78032, 150.189707),\n (197.78032, 150.189707, 197.78032, 100.18929),\n (200.159205, 100.18929, 197.78032, 100.18929),\n (200.159205, 150.189707, 200.159205, 100.18929)\n]\nVISIBLE_CIRCLES = [\n\n]\nVISIBLE_ARCS = [\n\n]\nHIDDEN_SEGMENTS = [\n\n]\n# (orient, text, p1, p2, base) for linear; (orient, text, center, radius, angle) for diameter\nDIMENSIONS = [\n ('horizontal', '100', (183.7803, 100.1893), (86.8408, 100.1893), (135.3106, 89.1893)),\n ('vertical', '51.5789', (183.7803, 150.1897), (183.7803, 100.1893), (194.7803, 125.1895)),\n ('horizontal', '2.454', (200.1592, 150.1897), (197.7803, 150.1897), (198.9698, 139.1897))\n]\n\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; _ds.dxf.dimasz = 2.5\n _ds.dxf.dimexe = 1.25; _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\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\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,\n angle=(0 if d[0] == \"horizontal\" else 90),\n 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,\n 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,\n 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,\n text=text, dimstyle=\"EZDXF\").render()\n\n doc.saveas(out_path)\n\n\nif __name__ == \"__main__\":\n out = sys.argv[1] if len(sys.argv) > 1 else \"0084_00849948_gt.dxf\"\n draw(out)\n print(\"wrote\", out)\n```"}], "images": ["images/0084_00849948.png"], "id": "0084_00849948"} {"messages": [{"role": "user", "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 51.58 mm tall. It is extruded to a thickness of 112.94 mm."}, {"role": "assistant", "content": "```python\n#!/usr/bin/env python3\n# -*- coding: utf-8 -*-\n# Ground-truth 2D engineering drawing for part: 0085_00850557\n# Self-contained: reproduces the three-view DXF via ezdxf, NO FreeCAD needed.\n# Coordinates are A4 page millimetres (scale=0.5841230711328861, page=[297.0, 210.0]).\n# visible edges -> solid (layer OUTLINE); hidden edges -> dashed (layer HIDDEN)\n# dimensions -> real movable DIMENSION entities (text = true mm value)\n# Run: python 0085_00850557_gt.py [out.dxf]\nimport sys\nimport ezdxf\nimport math\n\nSCALE = 0.5841230711328861\nPAGE = [297.0, 210.0]\n\nVISIBLE_SEGMENTS = [\n (132.720392, 172.049972, 132.720392, 141.921519),\n (132.720392, 141.921519, 74.308085, 141.921519),\n (74.308085, 141.921519, 74.308085, 172.049972),\n (74.308085, 172.049972, 132.720392, 172.049972),\n (132.720392, 61.949972, 132.720392, 127.921519),\n (132.720392, 127.921519, 74.308085, 127.921519),\n (74.308085, 61.949972, 74.308085, 127.921519),\n (132.720392, 61.949972, 74.308085, 61.949972),\n (146.720392, 141.921519, 212.691939, 141.921519),\n (212.691939, 141.921519, 212.691939, 172.049972),\n (146.720392, 172.049972, 212.691939, 172.049972),\n (146.720392, 141.921519, 146.720392, 172.049972)\n]\nVISIBLE_CIRCLES = [\n\n]\nVISIBLE_ARCS = [\n\n]\nHIDDEN_SEGMENTS = [\n\n]\n# (orient, text, p1, p2, base) for linear; (orient, text, center, radius, angle) for diameter\nDIMENSIONS = [\n ('horizontal', '100', (132.7204, 172.05), (74.3081, 172.05), (103.5142, 161.05)),\n ('vertical', '51.5789', (132.7204, 141.9215), (132.7204, 172.05), (121.7204, 156.9858)),\n ('horizontal', '112.941', (146.7204, 141.9215), (212.6919, 141.9215), (179.7062, 152.9215))\n]\n\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; _ds.dxf.dimasz = 2.5\n _ds.dxf.dimexe = 1.25; _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\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\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,\n angle=(0 if d[0] == \"horizontal\" else 90),\n 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,\n 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,\n 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,\n text=text, dimstyle=\"EZDXF\").render()\n\n doc.saveas(out_path)\n\n\nif __name__ == \"__main__\":\n out = sys.argv[1] if len(sys.argv) > 1 else \"0085_00850557_gt.dxf\"\n draw(out)\n print(\"wrote\", out)\n```"}], "images": ["images/0085_00850557.png"], "id": "0085_00850557"} {"messages": [{"role": "user", "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": "assistant", "content": "```python\n#!/usr/bin/env python3\n# -*- coding: utf-8 -*-\n# Ground-truth 2D engineering drawing for part: 0085_00853896\n# Self-contained: reproduces the three-view DXF via ezdxf, NO FreeCAD needed.\n# Coordinates are A4 page millimetres (scale=0.4805, page=[297.0, 210.0]).\n# visible edges -> solid (layer OUTLINE); hidden edges -> dashed (layer HIDDEN)\n# dimensions -> real movable DIMENSION entities (text = true mm value)\n# Run: python 0085_00853896_gt.py [out.dxf]\nimport sys\nimport ezdxf\nimport math\n\nSCALE = 0.4805\nPAGE = [297.0, 210.0]\n\nVISIBLE_SEGMENTS = [\n (136.5, 172.05, 136.5, 124.0),\n (136.5, 124.0, 88.45, 124.0),\n (88.45, 124.0, 88.45, 172.05),\n (88.45, 172.05, 136.5, 172.05),\n (136.5, 61.95, 136.5, 110.0),\n (136.5, 110.0, 88.45, 110.0),\n (88.45, 61.95, 88.45, 110.0),\n (136.5, 61.95, 88.45, 61.95),\n (150.5, 124.0, 198.55, 124.0),\n (198.55, 124.0, 198.55, 172.05),\n (150.5, 172.05, 198.55, 172.05),\n (150.5, 124.0, 150.5, 172.05)\n]\nVISIBLE_CIRCLES = [\n\n]\nVISIBLE_ARCS = [\n\n]\nHIDDEN_SEGMENTS = [\n\n]\n# (orient, text, p1, p2, base) for linear; (orient, text, center, radius, angle) for diameter\nDIMENSIONS = [\n ('horizontal', '100', (136.5, 172.05), (88.45, 172.05), (112.475, 161.05)),\n ('vertical', '100', (136.5, 124.0), (136.5, 172.05), (125.5, 148.025)),\n ('horizontal', '100', (150.5, 124.0), (198.55, 124.0), (174.525, 135.0))\n]\n\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; _ds.dxf.dimasz = 2.5\n _ds.dxf.dimexe = 1.25; _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\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\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,\n angle=(0 if d[0] == \"horizontal\" else 90),\n 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,\n 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,\n 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,\n text=text, dimstyle=\"EZDXF\").render()\n\n doc.saveas(out_path)\n\n\nif __name__ == \"__main__\":\n out = sys.argv[1] if len(sys.argv) > 1 else \"0085_00853896_gt.dxf\"\n draw(out)\n print(\"wrote\", out)\n```"}], "images": ["images/0085_00853896.png"], "id": "0085_00853896"} {"messages": [{"role": "user", "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. It is extruded to a thickness of 27.41 mm. The outline includes one or more oblique (angled) edges."}, {"role": "assistant", "content": "```python\n#!/usr/bin/env python3\n# -*- coding: utf-8 -*-\n# Ground-truth 2D engineering drawing for part: 0085_00853989\n# Self-contained: reproduces the three-view DXF via ezdxf, NO FreeCAD needed.\n# Coordinates are A4 page millimetres (scale=0.2882284646598422, page=[297.0, 210.0]).\n# visible edges -> solid (layer OUTLINE); hidden edges -> dashed (layer HIDDEN)\n# dimensions -> real movable DIMENSION entities (text = true mm value)\n# Run: python 0085_00853989_gt.py [out.dxf]\nimport sys\nimport ezdxf\nimport math\n\nSCALE = 0.2882284646598422\nPAGE = [297.0, 210.0]\n\nVISIBLE_SEGMENTS = [\n (94.820053, 155.389864, 118.340201, 172.049969),\n (118.340201, 172.049969, 146.76038, 172.049969),\n (146.76038, 172.049969, 170.280529, 155.389864),\n (170.280529, 155.389864, 179.100584, 127.949691),\n (179.100584, 127.949691, 170.280529, 100.509518),\n (170.280529, 100.509518, 146.76038, 83.849413),\n (146.76038, 83.849413, 118.340201, 83.849413),\n (118.340201, 83.849413, 94.820053, 100.509518),\n (94.820053, 100.509518, 85.999997, 127.949691),\n (85.999997, 127.949691, 94.820053, 155.389864),\n (179.100584, 61.949969, 179.100584, 69.849413),\n (179.100584, 69.849413, 170.280529, 69.849413),\n (170.280529, 61.949969, 170.280529, 69.849413),\n (179.100584, 61.949969, 170.280529, 61.949969),\n (170.280529, 69.849413, 146.76038, 69.849413),\n (146.76038, 61.949969, 146.76038, 69.849413),\n (170.280529, 61.949969, 146.76038, 61.949969),\n (146.76038, 69.849413, 118.340201, 69.849413),\n (118.340201, 61.949969, 118.340201, 69.849413),\n (146.76038, 61.949969, 118.340201, 61.949969),\n (118.340201, 69.849413, 94.820053, 69.849413),\n (94.820053, 61.949969, 94.820053, 69.849413),\n (118.340201, 61.949969, 94.820053, 61.949969),\n (94.820053, 69.849413, 85.999997, 69.849413),\n (85.999997, 61.949969, 85.999997, 69.849413),\n (94.820053, 61.949969, 85.999997, 61.949969),\n (193.100584, 155.389864, 201.000028, 155.389864),\n (201.000028, 155.389864, 201.000028, 172.049969),\n (193.100584, 172.049969, 201.000028, 172.049969),\n (193.100584, 155.389864, 193.100584, 172.049969),\n (193.100584, 83.849413, 201.000028, 83.849413),\n (201.000028, 83.849413, 201.000028, 100.509518),\n (193.100584, 100.509518, 201.000028, 100.509518),\n (193.100584, 83.849413, 193.100584, 100.509518),\n (201.000028, 100.509518, 201.000028, 127.949691),\n (193.100584, 127.949691, 201.000028, 127.949691),\n (193.100584, 100.509518, 193.100584, 127.949691),\n (201.000028, 127.949691, 201.000028, 155.389864),\n (193.100584, 127.949691, 193.100584, 155.389864)\n]\nVISIBLE_CIRCLES = [\n\n]\nVISIBLE_ARCS = [\n\n]\nHIDDEN_SEGMENTS = [\n\n]\n# (orient, text, p1, p2, base) for linear; (orient, text, center, radius, angle) for diameter\nDIMENSIONS = [\n ('horizontal', '98.603', (118.3402, 83.8494), (146.7604, 83.8494), (132.5503, 94.8494)),\n ('aligned', '100', (94.8201, 100.5095), (118.3402, 83.8494), (112.9383, 101.1558)),\n ('aligned', '100', (146.7604, 83.8494), (170.2805, 100.5095), (152.1623, 101.1558)),\n ('aligned', '100', (170.2805, 100.5095), (179.1006, 127.9497), (164.2182, 117.5957)),\n ('aligned', '100', (179.1006, 127.9497), (170.2805, 155.3899), (164.2182, 138.3037)),\n ('aligned', '100', (170.2805, 155.3899), (146.7604, 172.05), (152.1623, 154.7437)),\n ('aligned', '100', (118.3402, 172.05), (94.8201, 155.3899), (112.9383, 154.7437)),\n ('aligned', '100', (94.8201, 155.3899), (86.0, 127.9497), (100.8823, 138.3037)),\n ('aligned', '100', (86.0, 127.9497), (94.8201, 100.5095), (100.8823, 117.5957)),\n ('horizontal', '27.4069', (193.1006, 127.9497), (201.0, 127.9497), (197.0503, 138.9497))\n]\n\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; _ds.dxf.dimasz = 2.5\n _ds.dxf.dimexe = 1.25; _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\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\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,\n angle=(0 if d[0] == \"horizontal\" else 90),\n 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,\n 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,\n 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,\n text=text, dimstyle=\"EZDXF\").render()\n\n doc.saveas(out_path)\n\n\nif __name__ == \"__main__\":\n out = sys.argv[1] if len(sys.argv) > 1 else \"0085_00853989_gt.dxf\"\n draw(out)\n print(\"wrote\", out)\n```"}], "images": ["images/0085_00853989.png"], "id": "0085_00853989"} {"messages": [{"role": "user", "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 1200 mm."}, {"role": "assistant", "content": "```python\n#!/usr/bin/env python3\n# -*- coding: utf-8 -*-\n# Ground-truth 2D engineering drawing for part: 0085_00855443\n# Self-contained: reproduces the three-view DXF via ezdxf, NO FreeCAD needed.\n# Coordinates are A4 page millimetres (scale=0.07684764309764308, page=[297.0, 210.0]).\n# visible edges -> solid (layer OUTLINE); hidden edges -> dashed (layer HIDDEN)\n# dimensions -> real movable DIMENSION entities (text = true mm value)\n# Run: python 0085_00855443_gt.py [out.dxf]\nimport sys\nimport ezdxf\nimport math\n\nSCALE = 0.07684764309764308\nPAGE = [297.0, 210.0]\n\nVISIBLE_SEGMENTS = [\n (94.233799, 172.050017, 94.233799, 168.167189),\n (94.233799, 168.167189, 86.549034, 168.167189),\n (86.549034, 168.167189, 86.549034, 172.050017),\n (86.549034, 172.050017, 94.233799, 172.050017),\n (94.233799, 61.950017, 94.233799, 154.167189),\n (94.233799, 154.167189, 86.549034, 154.167189),\n (86.549034, 61.950017, 86.549034, 154.167189),\n (94.233799, 61.950017, 86.549034, 61.950017),\n (108.233799, 168.167189, 200.45097, 168.167189),\n (200.45097, 168.167189, 200.45097, 172.050017),\n (108.233799, 172.050017, 200.45097, 172.050017),\n (108.233799, 168.167189, 108.233799, 172.050017)\n]\nVISIBLE_CIRCLES = [\n\n]\nVISIBLE_ARCS = [\n\n]\nHIDDEN_SEGMENTS = [\n\n]\n# (orient, text, p1, p2, base) for linear; (orient, text, center, radius, angle) for diameter\nDIMENSIONS = [\n ('horizontal', '100', (94.2338, 172.05), (86.549, 172.05), (90.3914, 161.05)),\n ('vertical', '50.5263', (94.2338, 168.1672), (94.2338, 172.05), (83.2338, 170.1086)),\n ('horizontal', '1200', (108.2338, 168.1672), (200.451, 168.1672), (154.3424, 179.1672))\n]\n\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; _ds.dxf.dimasz = 2.5\n _ds.dxf.dimexe = 1.25; _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\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\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,\n angle=(0 if d[0] == \"horizontal\" else 90),\n 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,\n 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,\n 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,\n text=text, dimstyle=\"EZDXF\").render()\n\n doc.saveas(out_path)\n\n\nif __name__ == \"__main__\":\n out = sys.argv[1] if len(sys.argv) > 1 else \"0085_00855443_gt.dxf\"\n draw(out)\n print(\"wrote\", out)\n```"}], "images": ["images/0085_00855443.png"], "id": "0085_00855443"} {"messages": [{"role": "user", "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 6.32 mm tall. It is extruded to a thickness of 34.03 mm."}, {"role": "assistant", "content": "```python\n#!/usr/bin/env python3\n# -*- coding: utf-8 -*-\n# Ground-truth 2D engineering drawing for part: 0085_00856355\n# Self-contained: reproduces the three-view DXF via ezdxf, NO FreeCAD needed.\n# Coordinates are A4 page millimetres (scale=1.09631015625002, page=[297.0, 210.0]).\n# visible edges -> solid (layer OUTLINE); hidden edges -> dashed (layer HIDDEN)\n# dimensions -> real movable DIMENSION entities (text = true mm value)\n# Run: python 0085_00856355_gt.py [out.dxf]\nimport sys\nimport ezdxf\nimport math\n\nSCALE = 1.09631015625002\nPAGE = [297.0, 210.0]\n\nVISIBLE_SEGMENTS = [\n (172.661006, 146.116538, 172.661006, 139.192474),\n (172.661006, 139.192474, 63.029991, 139.192474),\n (63.029991, 139.192474, 63.029991, 146.116538),\n (63.029991, 146.116538, 172.661006, 146.116538),\n (172.661006, 87.88349, 172.661006, 125.192474),\n (172.661006, 125.192474, 63.029991, 125.192474),\n (63.029991, 87.88349, 63.029991, 125.192474),\n (172.661006, 87.88349, 63.029991, 87.88349),\n (186.661006, 139.192474, 223.969991, 139.192474),\n (223.969991, 139.192474, 223.969991, 146.116538),\n (186.661006, 146.116538, 223.969991, 146.116538),\n (186.661006, 139.192474, 186.661006, 146.116538)\n]\nVISIBLE_CIRCLES = [\n\n]\nVISIBLE_ARCS = [\n\n]\nHIDDEN_SEGMENTS = [\n\n]\n# (orient, text, p1, p2, base) for linear; (orient, text, center, radius, angle) for diameter\nDIMENSIONS = [\n ('horizontal', '100', (172.661, 146.1165), (63.03, 146.1165), (117.8455, 135.1165)),\n ('vertical', '6.3158', (172.661, 139.1925), (172.661, 146.1165), (161.661, 142.6545)),\n ('horizontal', '34.0314', (186.661, 139.1925), (223.97, 139.1925), (205.3155, 150.1925))\n]\n\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; _ds.dxf.dimasz = 2.5\n _ds.dxf.dimexe = 1.25; _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\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\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,\n angle=(0 if d[0] == \"horizontal\" else 90),\n 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,\n 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,\n 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,\n text=text, dimstyle=\"EZDXF\").render()\n\n doc.saveas(out_path)\n\n\nif __name__ == \"__main__\":\n out = sys.argv[1] if len(sys.argv) > 1 else \"0085_00856355_gt.dxf\"\n draw(out)\n print(\"wrote\", out)\n```"}], "images": ["images/0085_00856355.png"], "id": "0085_00856355"} {"messages": [{"role": "user", "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 5.21 mm."}, {"role": "assistant", "content": "```python\n#!/usr/bin/env python3\n# -*- coding: utf-8 -*-\n# Ground-truth 2D engineering drawing for part: 0086_00860755\n# Self-contained: reproduces the three-view DXF via ezdxf, NO FreeCAD needed.\n# Coordinates are A4 page millimetres (scale=1.4391030927835013, page=[297.0, 210.0]).\n# visible edges -> solid (layer OUTLINE); hidden edges -> dashed (layer HIDDEN)\n# dimensions -> real movable DIMENSION entities (text = true mm value)\n# Run: python 0086_00860755_gt.py [out.dxf]\nimport sys\nimport ezdxf\nimport math\n\nSCALE = 1.4391030927835013\nPAGE = [297.0, 210.0]\n\nVISIBLE_SEGMENTS = [\n (204.707496, 126.232806, 204.707496, 129.262496),\n (204.707496, 129.262496, 60.797187, 129.262496),\n (60.797187, 129.262496, 60.797187, 126.232806),\n (60.797187, 126.232806, 204.707496, 126.232806),\n (204.707496, 112.232806, 204.707496, 104.737477),\n (60.797187, 112.232806, 60.797187, 104.737477),\n (60.797187, 104.737477, 204.707496, 104.737477),\n (60.797187, 112.232806, 204.707496, 112.232806),\n (226.202825, 129.262496, 218.707496, 129.262496),\n (218.707496, 129.262496, 218.707496, 126.232806),\n (226.202825, 126.232806, 218.707496, 126.232806),\n (226.202825, 129.262496, 226.202825, 126.232806)\n]\nVISIBLE_CIRCLES = [\n\n]\nVISIBLE_ARCS = [\n\n]\nHIDDEN_SEGMENTS = [\n\n]\n# (orient, text, p1, p2, base) for linear; (orient, text, center, radius, angle) for diameter\nDIMENSIONS = [\n ('horizontal', '100', (204.7075, 126.2328), (60.7972, 126.2328), (132.7523, 115.2328)),\n ('vertical', '2.1053', (204.7075, 129.2625), (204.7075, 126.2328), (215.7075, 127.7476)),\n ('horizontal', '5.2083', (226.2028, 129.2625), (218.7075, 129.2625), (222.4552, 118.2625))\n]\n\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; _ds.dxf.dimasz = 2.5\n _ds.dxf.dimexe = 1.25; _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\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\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,\n angle=(0 if d[0] == \"horizontal\" else 90),\n 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,\n 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,\n 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,\n text=text, dimstyle=\"EZDXF\").render()\n\n doc.saveas(out_path)\n\n\nif __name__ == \"__main__\":\n out = sys.argv[1] if len(sys.argv) > 1 else \"0086_00860755_gt.dxf\"\n draw(out)\n print(\"wrote\", out)\n```"}], "images": ["images/0086_00860755.png"], "id": "0086_00860755"} {"messages": [{"role": "user", "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 417.39 mm."}, {"role": "assistant", "content": "```python\n#!/usr/bin/env python3\n# -*- coding: utf-8 -*-\n# Ground-truth 2D engineering drawing for part: 0086_00869486\n# Self-contained: reproduces the three-view DXF via ezdxf, NO FreeCAD needed.\n# Coordinates are A4 page millimetres (scale=0.18573949579832222, page=[297.0, 210.0]).\n# visible edges -> solid (layer OUTLINE); hidden edges -> dashed (layer HIDDEN)\n# dimensions -> real movable DIMENSION entities (text = true mm value)\n# Run: python 0086_00869486_gt.py [out.dxf]\nimport sys\nimport ezdxf\nimport math\n\nSCALE = 0.18573949579832222\nPAGE = [297.0, 210.0]\n\nVISIBLE_SEGMENTS = [\n (107.02392, 172.04997, 107.02392, 153.47602),\n (107.02392, 153.47602, 88.44997, 153.47602),\n (88.44997, 153.47602, 88.44997, 172.04997),\n (88.44997, 172.04997, 107.02392, 172.04997),\n (107.02392, 61.94997, 107.02392, 139.47602),\n (107.02392, 139.47602, 88.44997, 139.47602),\n (88.44997, 61.94997, 88.44997, 139.47602),\n (107.02392, 61.94997, 88.44997, 61.94997),\n (121.02392, 153.47602, 198.54997, 153.47602),\n (198.54997, 153.47602, 198.54997, 172.04997),\n (121.02392, 172.04997, 198.54997, 172.04997),\n (121.02392, 153.47602, 121.02392, 172.04997)\n]\nVISIBLE_CIRCLES = [\n\n]\nVISIBLE_ARCS = [\n\n]\nHIDDEN_SEGMENTS = [\n\n]\n# (orient, text, p1, p2, base) for linear; (orient, text, center, radius, angle) for diameter\nDIMENSIONS = [\n ('horizontal', '100', (107.0239, 172.05), (88.45, 172.05), (97.737, 161.05)),\n ('vertical', '100', (107.0239, 153.476), (107.0239, 172.05), (96.0239, 162.763)),\n ('horizontal', '417.391', (121.0239, 153.476), (198.55, 153.476), (159.787, 164.476))\n]\n\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; _ds.dxf.dimasz = 2.5\n _ds.dxf.dimexe = 1.25; _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\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\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,\n angle=(0 if d[0] == \"horizontal\" else 90),\n 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,\n 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,\n 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,\n text=text, dimstyle=\"EZDXF\").render()\n\n doc.saveas(out_path)\n\n\nif __name__ == \"__main__\":\n out = sys.argv[1] if len(sys.argv) > 1 else \"0086_00869486_gt.dxf\"\n draw(out)\n print(\"wrote\", out)\n```"}], "images": ["images/0086_00869486.png"], "id": "0086_00869486"} {"messages": [{"role": "user", "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 3.21 mm."}, {"role": "assistant", "content": "```python\n#!/usr/bin/env python3\n# -*- coding: utf-8 -*-\n# Ground-truth 2D engineering drawing for part: 0087_00870284\n# Self-contained: reproduces the three-view DXF via ezdxf, NO FreeCAD needed.\n# Coordinates are A4 page millimetres (scale=0.9311552795031706, page=[297.0, 210.0]).\n# visible edges -> solid (layer OUTLINE); hidden edges -> dashed (layer HIDDEN)\n# dimensions -> real movable DIMENSION entities (text = true mm value)\n# Run: python 0087_00870284_gt.py [out.dxf]\nimport sys\nimport ezdxf\nimport math\n\nSCALE = 0.9311552795031706\nPAGE = [297.0, 210.0]\n\nVISIBLE_SEGMENTS = [\n (170.783712, 172.050017, 170.783712, 78.934489),\n (170.783712, 78.934489, 99.23178, 78.934489),\n (99.23178, 78.934489, 99.23178, 172.050017),\n (99.23178, 172.050017, 170.783712, 172.050017),\n (170.783712, 61.950017, 170.783712, 64.934489),\n (170.783712, 64.934489, 99.23178, 64.934489),\n (99.23178, 61.950017, 99.23178, 64.934489),\n (170.783712, 61.950017, 99.23178, 61.950017),\n (184.783712, 78.934489, 187.768184, 78.934489),\n (187.768184, 78.934489, 187.768184, 172.050017),\n (184.783712, 172.050017, 187.768184, 172.050017),\n (184.783712, 78.934489, 184.783712, 172.050017)\n]\nVISIBLE_CIRCLES = [\n\n]\nVISIBLE_ARCS = [\n\n]\nHIDDEN_SEGMENTS = [\n\n]\n# (orient, text, p1, p2, base) for linear; (orient, text, center, radius, angle) for diameter\nDIMENSIONS = [\n ('horizontal', '76.8421', (170.7837, 172.05), (99.2318, 172.05), (135.0078, 161.05)),\n ('vertical', '100', (170.7837, 78.9345), (170.7837, 172.05), (159.7837, 125.4922)),\n ('horizontal', '3.2051', (184.7837, 78.9345), (187.7682, 78.9345), (186.276, 89.9345))\n]\n\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; _ds.dxf.dimasz = 2.5\n _ds.dxf.dimexe = 1.25; _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\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\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,\n angle=(0 if d[0] == \"horizontal\" else 90),\n 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,\n 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,\n 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,\n text=text, dimstyle=\"EZDXF\").render()\n\n doc.saveas(out_path)\n\n\nif __name__ == \"__main__\":\n out = sys.argv[1] if len(sys.argv) > 1 else \"0087_00870284_gt.dxf\"\n draw(out)\n print(\"wrote\", out)\n```"}], "images": ["images/0087_00870284.png"], "id": "0087_00870284"} {"messages": [{"role": "user", "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 46.32 mm tall. It is extruded to a thickness of 3.09 mm."}, {"role": "assistant", "content": "```python\n#!/usr/bin/env python3\n# -*- coding: utf-8 -*-\n# Ground-truth 2D engineering drawing for part: 0087_00872692\n# Self-contained: reproduces the three-view DXF via ezdxf, NO FreeCAD needed.\n# Coordinates are A4 page millimetres (scale=1.4254059880240821, page=[297.0, 210.0]).\n# visible edges -> solid (layer OUTLINE); hidden edges -> dashed (layer HIDDEN)\n# dimensions -> real movable DIMENSION entities (text = true mm value)\n# Run: python 0087_00872692_gt.py [out.dxf]\nimport sys\nimport ezdxf\nimport math\n\nSCALE = 1.4254059880240821\nPAGE = [297.0, 210.0]\n\nVISIBLE_SEGMENTS = [\n (205.57054, 159.209122, 205.57054, 93.190319),\n (205.57054, 93.190319, 63.029941, 93.190319),\n (63.029941, 93.190319, 63.029941, 159.209122),\n (63.029941, 159.209122, 205.57054, 159.209122),\n (205.57054, 74.790917, 205.57054, 79.190319),\n (205.57054, 79.190319, 63.029941, 79.190319),\n (63.029941, 74.790917, 63.029941, 79.190319),\n (205.57054, 74.790917, 63.029941, 74.790917),\n (219.57054, 93.190319, 223.969941, 93.190319),\n (223.969941, 93.190319, 223.969941, 159.209122),\n (219.57054, 159.209122, 223.969941, 159.209122),\n (219.57054, 93.190319, 219.57054, 159.209122)\n]\nVISIBLE_CIRCLES = [\n\n]\nVISIBLE_ARCS = [\n\n]\nHIDDEN_SEGMENTS = [\n\n]\n# (orient, text, p1, p2, base) for linear; (orient, text, center, radius, angle) for diameter\nDIMENSIONS = [\n ('horizontal', '100', (205.5705, 159.209), (63.0299, 159.209), (134.3002, 148.209)),\n ('vertical', '46.3158', (205.5705, 93.1904), (205.5705, 159.209), (194.5705, 126.1997)),\n ('horizontal', '3.0864', (219.5706, 93.1904), (223.97, 93.1904), (221.7703, 104.1904))\n]\n\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; _ds.dxf.dimasz = 2.5\n _ds.dxf.dimexe = 1.25; _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\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\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,\n angle=(0 if d[0] == \"horizontal\" else 90),\n 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,\n 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,\n 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,\n text=text, dimstyle=\"EZDXF\").render()\n\n doc.saveas(out_path)\n\n\nif __name__ == \"__main__\":\n out = sys.argv[1] if len(sys.argv) > 1 else \"0087_00872692_gt.dxf\"\n draw(out)\n print(\"wrote\", out)\n```"}], "images": ["images/0087_00872692.png"], "id": "0087_00872692"} {"messages": [{"role": "user", "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 168.42 mm."}, {"role": "assistant", "content": "```python\n#!/usr/bin/env python3\n# -*- coding: utf-8 -*-\n# Ground-truth 2D engineering drawing for part: 0087_00872806\n# Self-contained: reproduces the three-view DXF via ezdxf, NO FreeCAD needed.\n# Coordinates are A4 page millimetres (scale=0.35942913385837333, page=[297.0, 210.0]).\n# visible edges -> solid (layer OUTLINE); hidden edges -> dashed (layer HIDDEN)\n# dimensions -> real movable DIMENSION entities (text = true mm value)\n# Run: python 0087_00872806_gt.py [out.dxf]\nimport sys\nimport ezdxf\nimport math\n\nSCALE = 0.35942913385837333\nPAGE = [297.0, 210.0]\n\nVISIBLE_SEGMENTS = [\n (124.203716, 136.48542, 124.203716, 172.049987),\n (124.203716, 172.049987, 88.260803, 172.049987),\n (88.260803, 172.049987, 88.260803, 136.48542),\n (88.260803, 136.48542, 124.203716, 136.48542),\n (124.203716, 122.48542, 124.203716, 61.949987),\n (88.260803, 122.48542, 88.260803, 61.949987),\n (88.260803, 61.949987, 124.203716, 61.949987),\n (88.260803, 122.48542, 124.203716, 122.48542),\n (198.739149, 172.049987, 138.203716, 172.049987),\n (138.203716, 172.049987, 138.203716, 136.48542),\n (198.739149, 136.48542, 138.203716, 136.48542),\n (198.739149, 172.049987, 198.739149, 136.48542)\n]\nVISIBLE_CIRCLES = [\n\n]\nVISIBLE_ARCS = [\n\n]\nHIDDEN_SEGMENTS = [\n\n]\n# (orient, text, p1, p2, base) for linear; (orient, text, center, radius, angle) for diameter\nDIMENSIONS = [\n ('horizontal', '100', (124.2037, 136.4854), (88.2608, 136.4854), (106.2323, 125.4854)),\n ('vertical', '98.9474', (124.2037, 172.05), (124.2037, 136.4854), (135.2037, 154.2677)),\n ('horizontal', '168.421', (198.7392, 172.05), (138.2037, 172.05), (168.4714, 161.05))\n]\n\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; _ds.dxf.dimasz = 2.5\n _ds.dxf.dimexe = 1.25; _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\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\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,\n angle=(0 if d[0] == \"horizontal\" else 90),\n 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,\n 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,\n 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,\n text=text, dimstyle=\"EZDXF\").render()\n\n doc.saveas(out_path)\n\n\nif __name__ == \"__main__\":\n out = sys.argv[1] if len(sys.argv) > 1 else \"0087_00872806_gt.dxf\"\n draw(out)\n print(\"wrote\", out)\n```"}], "images": ["images/0087_00872806.png"], "id": "0087_00872806"} {"messages": [{"role": "user", "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 12.63 mm wide and 100 mm tall. It is extruded to a thickness of 1.04 mm."}, {"role": "assistant", "content": "```python\n#!/usr/bin/env python3\n# -*- coding: utf-8 -*-\n# Ground-truth 2D engineering drawing for part: 0087_00873587\n# Self-contained: reproduces the three-view DXF via ezdxf, NO FreeCAD needed.\n# Coordinates are A4 page millimetres (scale=0.9510927835051515, page=[297.0, 210.0]).\n# visible edges -> solid (layer OUTLINE); hidden edges -> dashed (layer HIDDEN)\n# dimensions -> real movable DIMENSION entities (text = true mm value)\n# Run: python 0087_00873587_gt.py [out.dxf]\nimport sys\nimport ezdxf\nimport math\n\nSCALE = 0.9510927835051515\nPAGE = [297.0, 210.0]\n\nVISIBLE_SEGMENTS = [\n (142.011556, 172.049987, 142.011556, 76.940709),\n (142.011556, 76.940709, 129.997753, 76.940709),\n (129.997753, 76.940709, 129.997753, 172.049987),\n (129.997753, 172.049987, 142.011556, 172.049987),\n (142.011556, 61.949987, 142.011556, 62.940709),\n (142.011556, 62.940709, 129.997753, 62.940709),\n (129.997753, 61.949987, 129.997753, 62.940709),\n (142.011556, 61.949987, 129.997753, 61.949987),\n (156.011556, 76.940709, 157.002278, 76.940709),\n (157.002278, 76.940709, 157.002278, 172.049987),\n (156.011556, 172.049987, 157.002278, 172.049987),\n (156.011556, 76.940709, 156.011556, 172.049987)\n]\nVISIBLE_CIRCLES = [\n\n]\nVISIBLE_ARCS = [\n\n]\nHIDDEN_SEGMENTS = [\n\n]\n# (orient, text, p1, p2, base) for linear; (orient, text, center, radius, angle) for diameter\nDIMENSIONS = [\n ('horizontal', '12.6316', (142.0116, 172.05), (129.9977, 172.05), (136.0046, 161.05)),\n ('vertical', '100', (142.0116, 76.9407), (142.0116, 172.05), (131.0116, 124.4954)),\n ('horizontal', '1.0417', (156.0115, 76.9407), (157.0023, 76.9407), (156.5069, 87.9407))\n]\n\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; _ds.dxf.dimasz = 2.5\n _ds.dxf.dimexe = 1.25; _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\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\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,\n angle=(0 if d[0] == \"horizontal\" else 90),\n 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,\n 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,\n 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,\n text=text, dimstyle=\"EZDXF\").render()\n\n doc.saveas(out_path)\n\n\nif __name__ == \"__main__\":\n out = sys.argv[1] if len(sys.argv) > 1 else \"0087_00873587_gt.dxf\"\n draw(out)\n print(\"wrote\", out)\n```"}], "images": ["images/0087_00873587.png"], "id": "0087_00873587"} {"messages": [{"role": "user", "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 1371.43 mm."}, {"role": "assistant", "content": "```python\n#!/usr/bin/env python3\n# -*- coding: utf-8 -*-\n# Ground-truth 2D engineering drawing for part: 0087_00875175\n# Self-contained: reproduces the three-view DXF via ezdxf, NO FreeCAD needed.\n# Coordinates are A4 page millimetres (scale=0.06531067961163177, page=[297.0, 210.0]).\n# visible edges -> solid (layer OUTLINE); hidden edges -> dashed (layer HIDDEN)\n# dimensions -> real movable DIMENSION entities (text = true mm value)\n# Run: python 0087_00875175_gt.py [out.dxf]\nimport sys\nimport ezdxf\nimport math\n\nSCALE = 0.06531067961163177\nPAGE = [297.0, 210.0]\n\nVISIBLE_SEGMENTS = [\n (94.981087, 165.518919, 94.981087, 172.049987),\n (94.981087, 172.049987, 88.450019, 172.049987),\n (88.450019, 172.049987, 88.450019, 165.518919),\n (88.450019, 165.518919, 94.981087, 165.518919),\n (94.981087, 151.518919, 94.981087, 61.949987),\n (88.450019, 151.518919, 88.450019, 61.949987),\n (88.450019, 61.949987, 94.981087, 61.949987),\n (88.450019, 151.518919, 94.981087, 151.518919),\n (198.550019, 172.049987, 108.981087, 172.049987),\n (108.981087, 172.049987, 108.981087, 165.518919),\n (198.550019, 165.518919, 108.981087, 165.518919),\n (198.550019, 172.049987, 198.550019, 165.518919)\n]\nVISIBLE_CIRCLES = [\n\n]\nVISIBLE_ARCS = [\n\n]\nHIDDEN_SEGMENTS = [\n\n]\n# (orient, text, p1, p2, base) for linear; (orient, text, center, radius, angle) for diameter\nDIMENSIONS = [\n ('horizontal', '100', (94.9811, 165.5189), (88.45, 165.5189), (91.7155, 154.5189)),\n ('vertical', '100', (94.9811, 172.05), (94.9811, 165.5189), (105.9811, 168.7845)),\n ('horizontal', '1371.43', (198.55, 172.05), (108.9811, 172.05), (153.7655, 161.05))\n]\n\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; _ds.dxf.dimasz = 2.5\n _ds.dxf.dimexe = 1.25; _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\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\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,\n angle=(0 if d[0] == \"horizontal\" else 90),\n 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,\n 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,\n 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,\n text=text, dimstyle=\"EZDXF\").render()\n\n doc.saveas(out_path)\n\n\nif __name__ == \"__main__\":\n out = sys.argv[1] if len(sys.argv) > 1 else \"0087_00875175_gt.dxf\"\n draw(out)\n print(\"wrote\", out)\n```"}], "images": ["images/0087_00875175.png"], "id": "0087_00875175"} {"messages": [{"role": "user", "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 -1.04 mm."}, {"role": "assistant", "content": "```python\n#!/usr/bin/env python3\n# -*- coding: utf-8 -*-\n# Ground-truth 2D engineering drawing for part: 0087_00878985\n# Self-contained: reproduces the three-view DXF via ezdxf, NO FreeCAD needed.\n# Coordinates are A4 page millimetres (scale=1.0737923076923617, page=[297.0, 210.0]).\n# visible edges -> solid (layer OUTLINE); hidden edges -> dashed (layer HIDDEN)\n# dimensions -> real movable DIMENSION entities (text = true mm value)\n# Run: python 0087_00878985_gt.py [out.dxf]\nimport sys\nimport ezdxf\nimport math\n\nSCALE = 1.0737923076923617\nPAGE = [297.0, 210.0]\n\nVISIBLE_SEGMENTS = [\n (189.630319, 104.778918, 189.630319, 144.339688),\n (189.630319, 144.339688, 82.251089, 144.339688),\n (82.251089, 144.339688, 82.251089, 104.778918),\n (82.251089, 104.778918, 189.630319, 104.778918),\n (189.630319, 89.660385, 189.630319, 90.778918),\n (82.251089, 89.660385, 82.251089, 90.778918),\n (82.251089, 90.778918, 189.630319, 90.778918),\n (82.251089, 89.660385, 189.630319, 89.660385),\n (203.630319, 144.339688, 204.748853, 144.339688),\n (204.748853, 144.339688, 204.748853, 104.778918),\n (203.630319, 104.778918, 204.748853, 104.778918),\n (203.630319, 144.339688, 203.630319, 104.778918)\n]\nVISIBLE_CIRCLES = [\n\n]\nVISIBLE_ARCS = [\n\n]\nHIDDEN_SEGMENTS = [\n\n]\n# (orient, text, p1, p2, base) for linear; (orient, text, center, radius, angle) for diameter\nDIMENSIONS = [\n ('horizontal', '100', (189.6303, 104.7789), (82.2511, 104.7789), (135.9407, 93.7789)),\n ('vertical', '36.8421', (189.6303, 144.3397), (189.6303, 104.7789), (200.6303, 124.5593)),\n ('horizontal', '1.0417', (203.6303, 144.3397), (204.7489, 144.3397), (204.1896, 155.3397))\n]\n\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; _ds.dxf.dimasz = 2.5\n _ds.dxf.dimexe = 1.25; _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\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\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,\n angle=(0 if d[0] == \"horizontal\" else 90),\n 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,\n 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,\n 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,\n text=text, dimstyle=\"EZDXF\").render()\n\n doc.saveas(out_path)\n\n\nif __name__ == \"__main__\":\n out = sys.argv[1] if len(sys.argv) > 1 else \"0087_00878985_gt.dxf\"\n draw(out)\n print(\"wrote\", out)\n```"}], "images": ["images/0087_00878985.png"], "id": "0087_00878985"} {"messages": [{"role": "user", "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 5 mm. The outline includes one or more oblique (angled) edges."}, {"role": "assistant", "content": "```python\n#!/usr/bin/env python3\n# -*- coding: utf-8 -*-\n# Ground-truth 2D engineering drawing for part: 0087_00879719\n# Self-contained: reproduces the three-view DXF via ezdxf, NO FreeCAD needed.\n# Coordinates are A4 page millimetres (scale=0.3923900343166968, page=[297.0, 210.0]).\n# visible edges -> solid (layer OUTLINE); hidden edges -> dashed (layer HIDDEN)\n# dimensions -> real movable DIMENSION entities (text = true mm value)\n# Run: python 0087_00879719_gt.py [out.dxf]\nimport sys\nimport ezdxf\nimport math\n\nSCALE = 0.3923900343166968\nPAGE = [297.0, 210.0]\n\nVISIBLE_SEGMENTS = [\n (116.196181, 172.049994, 154.842626, 172.049994),\n (154.842626, 172.049994, 182.588791, 144.303828),\n (182.588791, 144.303828, 182.588791, 105.657384),\n (182.588791, 105.657384, 154.842626, 77.911218),\n (154.842626, 77.911218, 116.196181, 77.911218),\n (116.196181, 77.911218, 88.450016, 105.657384),\n (88.450016, 105.657384, 88.450016, 144.303828),\n (88.450016, 144.303828, 116.196181, 172.049994),\n (182.588791, 61.949994, 182.588791, 63.911218),\n (182.588791, 63.911218, 154.842626, 63.911218),\n (154.842626, 61.949994, 154.842626, 63.911218),\n (182.588791, 61.949994, 154.842626, 61.949994),\n (154.842626, 63.911218, 116.196181, 63.911218),\n (116.196181, 61.949994, 116.196181, 63.911218),\n (154.842626, 61.949994, 116.196181, 61.949994),\n (116.196181, 63.911218, 88.450016, 63.911218),\n (88.450016, 61.949994, 88.450016, 63.911218),\n (116.196181, 61.949994, 88.450016, 61.949994),\n (196.588791, 172.049994, 198.550016, 172.049994),\n (196.588791, 77.911218, 198.550016, 77.911218),\n (198.550016, 77.911218, 198.550016, 105.657384),\n (196.588791, 105.657384, 198.550016, 105.657384),\n (196.588791, 77.911218, 196.588791, 105.657384),\n (198.550016, 105.657384, 198.550016, 144.303828),\n (196.588791, 144.303828, 198.550016, 144.303828),\n (196.588791, 105.657384, 196.588791, 144.303828),\n (198.550016, 144.303828, 198.550016, 172.049994),\n (196.588791, 144.303828, 196.588791, 172.049994)\n]\nVISIBLE_CIRCLES = [\n\n]\nVISIBLE_ARCS = [\n\n]\nHIDDEN_SEGMENTS = [\n\n]\n# (orient, text, p1, p2, base) for linear; (orient, text, center, radius, angle) for diameter\nDIMENSIONS = [\n ('horizontal', '98.4899', (116.1962, 77.9112), (154.8426, 77.9112), (135.5194, 88.9112)),\n ('vertical', '98.4899', (182.5888, 105.6574), (182.5888, 144.3038), (171.5888, 124.9806)),\n ('aligned', '100', (154.8426, 77.9112), (182.5888, 105.6574), (160.9375, 99.5625)),\n ('aligned', '100', (182.5888, 144.3038), (154.8426, 172.05), (160.9375, 150.3987)),\n ('aligned', '100', (116.1962, 172.05), (88.45, 144.3038), (110.1013, 150.3987)),\n ('aligned', '100', (88.45, 105.6574), (116.1962, 77.9112), (110.1013, 99.5625)),\n ('horizontal', '4.9982', (196.5888, 105.6574), (198.55, 105.6574), (197.5694, 116.6574))\n]\n\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; _ds.dxf.dimasz = 2.5\n _ds.dxf.dimexe = 1.25; _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\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\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,\n angle=(0 if d[0] == \"horizontal\" else 90),\n 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,\n 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,\n 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,\n text=text, dimstyle=\"EZDXF\").render()\n\n doc.saveas(out_path)\n\n\nif __name__ == \"__main__\":\n out = sys.argv[1] if len(sys.argv) > 1 else \"0087_00879719_gt.dxf\"\n draw(out)\n print(\"wrote\", out)\n```"}], "images": ["images/0087_00879719.png"], "id": "0087_00879719"} {"messages": [{"role": "user", "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 7.23 mm."}, {"role": "assistant", "content": "```python\n#!/usr/bin/env python3\n# -*- coding: utf-8 -*-\n# Ground-truth 2D engineering drawing for part: 0088_00880790\n# Self-contained: reproduces the three-view DXF via ezdxf, NO FreeCAD needed.\n# Coordinates are A4 page millimetres (scale=0.734700000000044, page=[297.0, 210.0]).\n# visible edges -> solid (layer OUTLINE); hidden edges -> dashed (layer HIDDEN)\n# dimensions -> real movable DIMENSION entities (text = true mm value)\n# Run: python 0088_00880790_gt.py [out.dxf]\nimport sys\nimport ezdxf\nimport math\n\nSCALE = 0.734700000000044\nPAGE = [297.0, 210.0]\n\nVISIBLE_SEGMENTS = [\n (170.579483, 89.9206, 170.579483, 163.3906),\n (170.579483, 163.3906, 97.109483, 163.3906),\n (97.109483, 163.3906, 97.109483, 89.9206),\n (97.109483, 89.9206, 170.579483, 89.9206),\n (170.579483, 75.9206, 170.579483, 70.609516),\n (97.109483, 75.9206, 97.109483, 70.609516),\n (97.109483, 70.609516, 170.579483, 70.609516),\n (97.109483, 75.9206, 170.579483, 75.9206),\n (189.890567, 163.3906, 184.579483, 163.3906),\n (184.579483, 163.3906, 184.579483, 89.9206),\n (189.890567, 89.9206, 184.579483, 89.9206),\n (189.890567, 163.3906, 189.890567, 89.9206)\n]\nVISIBLE_CIRCLES = [\n\n]\nVISIBLE_ARCS = [\n\n]\nHIDDEN_SEGMENTS = [\n\n]\n# (orient, text, p1, p2, base) for linear; (orient, text, center, radius, angle) for diameter\nDIMENSIONS = [\n ('horizontal', '100', (170.5795, 89.9206), (97.1095, 89.9206), (133.8445, 78.9206)),\n ('vertical', '100', (170.5795, 163.3906), (170.5795, 89.9206), (181.5795, 126.6556)),\n ('horizontal', '7.2289', (189.8905, 163.3906), (184.5795, 163.3906), (187.235, 152.3906))\n]\n\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; _ds.dxf.dimasz = 2.5\n _ds.dxf.dimexe = 1.25; _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\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\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,\n angle=(0 if d[0] == \"horizontal\" else 90),\n 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,\n 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,\n 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,\n text=text, dimstyle=\"EZDXF\").render()\n\n doc.saveas(out_path)\n\n\nif __name__ == \"__main__\":\n out = sys.argv[1] if len(sys.argv) > 1 else \"0088_00880790_gt.dxf\"\n draw(out)\n print(\"wrote\", out)\n```"}], "images": ["images/0088_00880790.png"], "id": "0088_00880790"} {"messages": [{"role": "user", "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 69.57 mm."}, {"role": "assistant", "content": "```python\n#!/usr/bin/env python3\n# -*- coding: utf-8 -*-\n# Ground-truth 2D engineering drawing for part: 0088_00884077\n# Self-contained: reproduces the three-view DXF via ezdxf, NO FreeCAD needed.\n# Coordinates are A4 page millimetres (scale=0.8665692307692324, page=[297.0, 210.0]).\n# visible edges -> solid (layer OUTLINE); hidden edges -> dashed (layer HIDDEN)\n# dimensions -> real movable DIMENSION entities (text = true mm value)\n# Run: python 0088_00884077_gt.py [out.dxf]\nimport sys\nimport ezdxf\nimport math\n\nSCALE = 0.8665692307692324\nPAGE = [297.0, 210.0]\n\nVISIBLE_SEGMENTS = [\n (149.686909, 165.543772, 149.686909, 142.739319),\n (149.686909, 142.739319, 63.029986, 142.739319),\n (63.029986, 142.739319, 63.029986, 165.543772),\n (63.029986, 165.543772, 149.686909, 165.543772),\n (149.686909, 68.456242, 149.686909, 128.739319),\n (149.686909, 128.739319, 63.029986, 128.739319),\n (63.029986, 68.456242, 63.029986, 128.739319),\n (149.686909, 68.456242, 63.029986, 68.456242),\n (163.686909, 142.739319, 223.969986, 142.739319),\n (223.969986, 142.739319, 223.969986, 165.543772),\n (163.686909, 165.543772, 223.969986, 165.543772),\n (163.686909, 142.739319, 163.686909, 165.543772)\n]\nVISIBLE_CIRCLES = [\n\n]\nVISIBLE_ARCS = [\n\n]\nHIDDEN_SEGMENTS = [\n\n]\n# (orient, text, p1, p2, base) for linear; (orient, text, center, radius, angle) for diameter\nDIMENSIONS = [\n ('horizontal', '100', (149.6869, 165.5438), (63.03, 165.5438), (106.3585, 154.5438)),\n ('vertical', '26.3158', (149.6869, 142.7393), (149.6869, 165.5438), (138.6869, 154.1415)),\n ('horizontal', '69.5652', (163.6869, 142.7393), (223.97, 142.7393), (193.8285, 153.7393))\n]\n\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; _ds.dxf.dimasz = 2.5\n _ds.dxf.dimexe = 1.25; _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\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\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,\n angle=(0 if d[0] == \"horizontal\" else 90),\n 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,\n 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,\n 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,\n text=text, dimstyle=\"EZDXF\").render()\n\n doc.saveas(out_path)\n\n\nif __name__ == \"__main__\":\n out = sys.argv[1] if len(sys.argv) > 1 else \"0088_00884077_gt.dxf\"\n draw(out)\n print(\"wrote\", out)\n```"}], "images": ["images/0088_00884077.png"], "id": "0088_00884077"} {"messages": [{"role": "user", "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": "assistant", "content": "```python\n#!/usr/bin/env python3\n# -*- coding: utf-8 -*-\n# Ground-truth 2D engineering drawing for part: 0088_00889953\n# Self-contained: reproduces the three-view DXF via ezdxf, NO FreeCAD needed.\n# Coordinates are A4 page millimetres (scale=0.4805, page=[297.0, 210.0]).\n# visible edges -> solid (layer OUTLINE); hidden edges -> dashed (layer HIDDEN)\n# dimensions -> real movable DIMENSION entities (text = true mm value)\n# Run: python 0088_00889953_gt.py [out.dxf]\nimport sys\nimport ezdxf\nimport math\n\nSCALE = 0.4805\nPAGE = [297.0, 210.0]\n\nVISIBLE_SEGMENTS = [\n (136.5, 172.05, 136.5, 124.0),\n (136.5, 124.0, 88.45, 124.0),\n (88.45, 124.0, 88.45, 172.05),\n (88.45, 172.05, 136.5, 172.05),\n (136.5, 61.95, 136.5, 110.0),\n (136.5, 110.0, 88.45, 110.0),\n (88.45, 61.95, 88.45, 110.0),\n (136.5, 61.95, 88.45, 61.95),\n (150.5, 124.0, 198.55, 124.0),\n (198.55, 124.0, 198.55, 172.05),\n (150.5, 172.05, 198.55, 172.05),\n (150.5, 124.0, 150.5, 172.05)\n]\nVISIBLE_CIRCLES = [\n\n]\nVISIBLE_ARCS = [\n\n]\nHIDDEN_SEGMENTS = [\n\n]\n# (orient, text, p1, p2, base) for linear; (orient, text, center, radius, angle) for diameter\nDIMENSIONS = [\n ('horizontal', '100', (136.5, 172.05), (88.45, 172.05), (112.475, 161.05)),\n ('vertical', '100', (136.5, 124.0), (136.5, 172.05), (125.5, 148.025)),\n ('horizontal', '100', (150.5, 124.0), (198.55, 124.0), (174.525, 135.0))\n]\n\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; _ds.dxf.dimasz = 2.5\n _ds.dxf.dimexe = 1.25; _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\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\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,\n angle=(0 if d[0] == \"horizontal\" else 90),\n 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,\n 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,\n 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,\n text=text, dimstyle=\"EZDXF\").render()\n\n doc.saveas(out_path)\n\n\nif __name__ == \"__main__\":\n out = sys.argv[1] if len(sys.argv) > 1 else \"0088_00889953_gt.dxf\"\n draw(out)\n print(\"wrote\", out)\n```"}], "images": ["images/0088_00889953.png"], "id": "0088_00889953"} {"messages": [{"role": "user", "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 2.6 mm."}, {"role": "assistant", "content": "```python\n#!/usr/bin/env python3\n# -*- coding: utf-8 -*-\n# Ground-truth 2D engineering drawing for part: 0089_00895007\n# Self-contained: reproduces the three-view DXF via ezdxf, NO FreeCAD needed.\n# Coordinates are A4 page millimetres (scale=0.9366091370558345, page=[297.0, 210.0]).\n# visible edges -> solid (layer OUTLINE); hidden edges -> dashed (layer HIDDEN)\n# dimensions -> real movable DIMENSION entities (text = true mm value)\n# Run: python 0089_00895007_gt.py [out.dxf]\nimport sys\nimport ezdxf\nimport math\n\nSCALE = 0.9366091370558345\nPAGE = [297.0, 210.0]\n\nVISIBLE_SEGMENTS = [\n (175.209613, 172.050008, 175.209613, 78.389095),\n (175.209613, 78.389095, 95.351361, 78.389095),\n (95.351361, 78.389095, 95.351361, 172.050008),\n (95.351361, 172.050008, 175.209613, 172.050008),\n (175.209613, 61.950008, 175.209613, 64.389095),\n (175.209613, 64.389095, 95.351361, 64.389095),\n (95.351361, 61.950008, 95.351361, 64.389095),\n (175.209613, 61.950008, 95.351361, 61.950008),\n (189.209613, 78.389095, 191.6487, 78.389095),\n (191.6487, 78.389095, 191.6487, 172.050008),\n (189.209613, 172.050008, 191.6487, 172.050008),\n (189.209613, 78.389095, 189.209613, 172.050008)\n]\nVISIBLE_CIRCLES = [\n\n]\nVISIBLE_ARCS = [\n\n]\nHIDDEN_SEGMENTS = [\n\n]\n# (orient, text, p1, p2, base) for linear; (orient, text, center, radius, angle) for diameter\nDIMENSIONS = [\n ('horizontal', '85.2632', (175.2096, 172.05), (95.3514, 172.05), (135.2805, 161.05)),\n ('vertical', '100', (175.2096, 78.3891), (175.2096, 172.05), (164.2096, 125.2195)),\n ('horizontal', '2.6042', (189.2096, 78.3891), (191.6487, 78.3891), (190.4291, 89.3891))\n]\n\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; _ds.dxf.dimasz = 2.5\n _ds.dxf.dimexe = 1.25; _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\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\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,\n angle=(0 if d[0] == \"horizontal\" else 90),\n 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,\n 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,\n 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,\n text=text, dimstyle=\"EZDXF\").render()\n\n doc.saveas(out_path)\n\n\nif __name__ == \"__main__\":\n out = sys.argv[1] if len(sys.argv) > 1 else \"0089_00895007_gt.dxf\"\n draw(out)\n print(\"wrote\", out)\n```"}], "images": ["images/0089_00895007.png"], "id": "0089_00895007"} {"messages": [{"role": "user", "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 -1371.43 mm."}, {"role": "assistant", "content": "```python\n#!/usr/bin/env python3\n# -*- coding: utf-8 -*-\n# Ground-truth 2D engineering drawing for part: 0089_00896177\n# Self-contained: reproduces the three-view DXF via ezdxf, NO FreeCAD needed.\n# Coordinates are A4 page millimetres (scale=0.06531067961163146, page=[297.0, 210.0]).\n# visible edges -> solid (layer OUTLINE); hidden edges -> dashed (layer HIDDEN)\n# dimensions -> real movable DIMENSION entities (text = true mm value)\n# Run: python 0089_00896177_gt.py [out.dxf]\nimport sys\nimport ezdxf\nimport math\n\nSCALE = 0.06531067961163146\nPAGE = [297.0, 210.0]\n\nVISIBLE_SEGMENTS = [\n (94.981087, 172.049981, 94.981087, 165.518913),\n (94.981087, 165.518913, 88.450019, 165.518913),\n (88.450019, 165.518913, 88.450019, 172.049981),\n (88.450019, 172.049981, 94.981087, 172.049981),\n (94.981087, 151.518913, 94.981087, 61.949981),\n (94.981087, 61.949981, 88.450019, 61.949981),\n (88.450019, 151.518913, 88.450019, 61.949981),\n (94.981087, 151.518913, 88.450019, 151.518913),\n (198.550019, 165.518913, 108.981087, 165.518913),\n (108.981087, 165.518913, 108.981087, 172.049981),\n (198.550019, 172.049981, 108.981087, 172.049981),\n (198.550019, 165.518913, 198.550019, 172.049981)\n]\nVISIBLE_CIRCLES = [\n\n]\nVISIBLE_ARCS = [\n\n]\nHIDDEN_SEGMENTS = [\n\n]\n# (orient, text, p1, p2, base) for linear; (orient, text, center, radius, angle) for diameter\nDIMENSIONS = [\n ('horizontal', '100', (94.9811, 172.05), (88.45, 172.05), (91.7155, 161.05)),\n ('vertical', '100', (94.9811, 165.5189), (94.9811, 172.05), (83.9811, 168.7845)),\n ('horizontal', '1371.43', (198.55, 165.5189), (108.9811, 165.5189), (153.7655, 154.5189))\n]\n\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; _ds.dxf.dimasz = 2.5\n _ds.dxf.dimexe = 1.25; _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\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\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,\n angle=(0 if d[0] == \"horizontal\" else 90),\n 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,\n 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,\n 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,\n text=text, dimstyle=\"EZDXF\").render()\n\n doc.saveas(out_path)\n\n\nif __name__ == \"__main__\":\n out = sys.argv[1] if len(sys.argv) > 1 else \"0089_00896177_gt.dxf\"\n draw(out)\n print(\"wrote\", out)\n```"}], "images": ["images/0089_00896177.png"], "id": "0089_00896177"} {"messages": [{"role": "user", "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 100 mm."}, {"role": "assistant", "content": "```python\n#!/usr/bin/env python3\n# -*- coding: utf-8 -*-\n# Ground-truth 2D engineering drawing for part: 0090_00902676\n# Self-contained: reproduces the three-view DXF via ezdxf, NO FreeCAD needed.\n# Coordinates are A4 page millimetres (scale=0.638426573426572, page=[297.0, 210.0]).\n# visible edges -> solid (layer OUTLINE); hidden edges -> dashed (layer HIDDEN)\n# dimensions -> real movable DIMENSION entities (text = true mm value)\n# Run: python 0090_00902676_gt.py [out.dxf]\nimport sys\nimport ezdxf\nimport math\n\nSCALE = 0.638426573426572\nPAGE = [297.0, 210.0]\n\nVISIBLE_SEGMENTS = [\n (136.5, 172.050026, 136.5, 139.792683),\n (136.5, 139.792683, 72.657343, 139.792683),\n (72.657343, 139.792683, 72.657343, 172.050026),\n (72.657343, 172.050026, 136.5, 172.050026),\n (136.5, 61.950026, 136.5, 125.792683),\n (136.5, 125.792683, 72.657343, 125.792683),\n (72.657343, 61.950026, 72.657343, 125.792683),\n (136.5, 61.950026, 72.657343, 61.950026),\n (150.5, 139.792683, 214.342657, 139.792683),\n (214.342657, 139.792683, 214.342657, 172.050026),\n (150.5, 172.050026, 214.342657, 172.050026),\n (150.5, 139.792683, 150.5, 172.050026)\n]\nVISIBLE_CIRCLES = [\n\n]\nVISIBLE_ARCS = [\n\n]\nHIDDEN_SEGMENTS = [\n\n]\n# (orient, text, p1, p2, base) for linear; (orient, text, center, radius, angle) for diameter\nDIMENSIONS = [\n ('horizontal', '100', (136.5, 172.05), (72.6573, 172.05), (104.5787, 161.05)),\n ('vertical', '50.5263', (136.5, 139.7927), (136.5, 172.05), (125.5, 155.9213)),\n ('horizontal', '100', (150.5, 139.7927), (214.3427, 139.7927), (182.4213, 150.7927))\n]\n\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; _ds.dxf.dimasz = 2.5\n _ds.dxf.dimexe = 1.25; _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\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\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,\n angle=(0 if d[0] == \"horizontal\" else 90),\n 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,\n 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,\n 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,\n text=text, dimstyle=\"EZDXF\").render()\n\n doc.saveas(out_path)\n\n\nif __name__ == \"__main__\":\n out = sys.argv[1] if len(sys.argv) > 1 else \"0090_00902676_gt.dxf\"\n draw(out)\n print(\"wrote\", out)\n```"}], "images": ["images/0090_00902676.png"], "id": "0090_00902676"} {"messages": [{"role": "user", "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 45.26 mm wide and 100 mm tall. It is extruded to a thickness of 3200 mm."}, {"role": "assistant", "content": "```python\n#!/usr/bin/env python3\n# -*- coding: utf-8 -*-\n# Ground-truth 2D engineering drawing for part: 0090_00904933\n# Self-contained: reproduces the three-view DXF via ezdxf, NO FreeCAD needed.\n# Coordinates are A4 page millimetres (scale=0.02912121212121212, page=[297.0, 210.0]).\n# visible edges -> solid (layer OUTLINE); hidden edges -> dashed (layer HIDDEN)\n# dimensions -> real movable DIMENSION entities (text = true mm value)\n# Run: python 0090_00904933_gt.py [out.dxf]\nimport sys\nimport ezdxf\nimport math\n\nSCALE = 0.02912121212121212\nPAGE = [297.0, 210.0]\n\nVISIBLE_SEGMENTS = [\n (90.565108, 172.050013, 90.565108, 169.137892),\n (90.565108, 169.137892, 89.24699, 169.137892),\n (89.24699, 169.137892, 89.24699, 172.050013),\n (89.24699, 172.050013, 90.565108, 172.050013),\n (90.565108, 61.950013, 90.565108, 155.137892),\n (90.565108, 155.137892, 89.24699, 155.137892),\n (89.24699, 61.950013, 89.24699, 155.137892),\n (90.565108, 61.950013, 89.24699, 61.950013),\n (104.565108, 169.137892, 197.752987, 169.137892),\n (197.752987, 169.137892, 197.752987, 172.050013),\n (104.565108, 172.050013, 197.752987, 172.050013),\n (104.565108, 169.137892, 104.565108, 172.050013)\n]\nVISIBLE_CIRCLES = [\n\n]\nVISIBLE_ARCS = [\n\n]\nHIDDEN_SEGMENTS = [\n\n]\n# (orient, text, p1, p2, base) for linear; (orient, text, center, radius, angle) for diameter\nDIMENSIONS = [\n ('horizontal', '45.2632', (90.5651, 172.05), (89.247, 172.05), (89.9061, 161.05)),\n ('vertical', '100', (90.5651, 169.1379), (90.5651, 172.05), (79.5651, 170.5939)),\n ('horizontal', '3200', (104.5651, 169.1379), (197.753, 169.1379), (151.1591, 180.1379))\n]\n\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; _ds.dxf.dimasz = 2.5\n _ds.dxf.dimexe = 1.25; _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\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\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,\n angle=(0 if d[0] == \"horizontal\" else 90),\n 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,\n 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,\n 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,\n text=text, dimstyle=\"EZDXF\").render()\n\n doc.saveas(out_path)\n\n\nif __name__ == \"__main__\":\n out = sys.argv[1] if len(sys.argv) > 1 else \"0090_00904933_gt.dxf\"\n draw(out)\n print(\"wrote\", out)\n```"}], "images": ["images/0090_00904933.png"], "id": "0090_00904933"} {"messages": [{"role": "user", "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 56.84 mm tall. It is extruded to a thickness of 5.73 mm."}, {"role": "assistant", "content": "```python\n#!/usr/bin/env python3\n# -*- coding: utf-8 -*-\n# Ground-truth 2D engineering drawing for part: 0091_00910601\n# Self-contained: reproduces the three-view DXF via ezdxf, NO FreeCAD needed.\n# Coordinates are A4 page millimetres (scale=0.9368657718120976, page=[297.0, 210.0]).\n# visible edges -> solid (layer OUTLINE); hidden edges -> dashed (layer HIDDEN)\n# dimensions -> real movable DIMENSION entities (text = true mm value)\n# Run: python 0091_00910601_gt.py [out.dxf]\nimport sys\nimport ezdxf\nimport math\n\nSCALE = 0.9368657718120976\nPAGE = [297.0, 210.0]\n\nVISIBLE_SEGMENTS = [\n (180.659563, 100.056986, 180.659563, 153.310409),\n (180.659563, 153.310409, 86.972986, 153.310409),\n (86.972986, 153.310409, 86.972986, 100.056986),\n (86.972986, 100.056986, 180.659563, 100.056986),\n (180.659563, 86.056986, 180.659563, 80.689526),\n (86.972986, 86.056986, 86.972986, 80.689526),\n (86.972986, 80.689526, 180.659563, 80.689526),\n (86.972986, 86.056986, 180.659563, 86.056986),\n (200.027024, 153.310409, 194.659563, 153.310409),\n (194.659563, 153.310409, 194.659563, 100.056986),\n (200.027024, 100.056986, 194.659563, 100.056986),\n (200.027024, 153.310409, 200.027024, 100.056986)\n]\nVISIBLE_CIRCLES = [\n\n]\nVISIBLE_ARCS = [\n\n]\nHIDDEN_SEGMENTS = [\n\n]\n# (orient, text, p1, p2, base) for linear; (orient, text, center, radius, angle) for diameter\nDIMENSIONS = [\n ('horizontal', '100', (180.6596, 100.057), (86.973, 100.057), (133.8163, 89.057)),\n ('vertical', '56.8421', (180.6596, 153.3104), (180.6596, 100.057), (191.6596, 126.6837)),\n ('horizontal', '5.7292', (200.027, 153.3104), (194.6595, 153.3104), (197.3433, 142.3104))\n]\n\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; _ds.dxf.dimasz = 2.5\n _ds.dxf.dimexe = 1.25; _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\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\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,\n angle=(0 if d[0] == \"horizontal\" else 90),\n 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,\n 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,\n 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,\n text=text, dimstyle=\"EZDXF\").render()\n\n doc.saveas(out_path)\n\n\nif __name__ == \"__main__\":\n out = sys.argv[1] if len(sys.argv) > 1 else \"0091_00910601_gt.dxf\"\n draw(out)\n print(\"wrote\", out)\n```"}], "images": ["images/0091_00910601.png"], "id": "0091_00910601"} {"messages": [{"role": "user", "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 181.13 mm."}, {"role": "assistant", "content": "```python\n#!/usr/bin/env python3\n# -*- coding: utf-8 -*-\n# Ground-truth 2D engineering drawing for part: 0091_00912436\n# Self-contained: reproduces the three-view DXF via ezdxf, NO FreeCAD needed.\n# Coordinates are A4 page millimetres (scale=0.5244564274878153, page=[297.0, 210.0]).\n# visible edges -> solid (layer OUTLINE); hidden edges -> dashed (layer HIDDEN)\n# dimensions -> real movable DIMENSION entities (text = true mm value)\n# Run: python 0091_00912436_gt.py [out.dxf]\nimport sys\nimport ezdxf\nimport math\n\nSCALE = 0.5244564274878153\nPAGE = [297.0, 210.0]\n\nVISIBLE_SEGMENTS = [\n (115.224892, 170.945889, 115.224892, 172.050008),\n (115.224892, 172.050008, 62.77925, 172.050008),\n (62.77925, 172.050008, 62.77925, 170.945889),\n (62.77925, 170.945889, 115.224892, 170.945889),\n (115.224892, 156.945889, 115.224892, 61.950008),\n (62.77925, 156.945889, 62.77925, 61.950008),\n (62.77925, 61.950008, 115.224892, 61.950008),\n (62.77925, 156.945889, 115.224892, 156.945889),\n (224.220774, 172.050008, 129.224892, 172.050008),\n (129.224892, 172.050008, 129.224892, 170.945889),\n (224.220774, 170.945889, 129.224892, 170.945889),\n (224.220774, 172.050008, 224.220774, 170.945889)\n]\nVISIBLE_CIRCLES = [\n\n]\nVISIBLE_ARCS = [\n\n]\nHIDDEN_SEGMENTS = [\n\n]\n# (orient, text, p1, p2, base) for linear; (orient, text, center, radius, angle) for diameter\nDIMENSIONS = [\n ('horizontal', '100', (115.2249, 170.9459), (62.7792, 170.9459), (89.0021, 159.9459)),\n ('vertical', '2.1053', (115.2249, 172.05), (115.2249, 170.9459), (126.2249, 171.4979)),\n ('horizontal', '181.132', (224.2208, 172.05), (129.2249, 172.05), (176.7228, 161.05))\n]\n\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; _ds.dxf.dimasz = 2.5\n _ds.dxf.dimexe = 1.25; _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\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\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,\n angle=(0 if d[0] == \"horizontal\" else 90),\n 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,\n 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,\n 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,\n text=text, dimstyle=\"EZDXF\").render()\n\n doc.saveas(out_path)\n\n\nif __name__ == \"__main__\":\n out = sys.argv[1] if len(sys.argv) > 1 else \"0091_00912436_gt.dxf\"\n draw(out)\n print(\"wrote\", out)\n```"}], "images": ["images/0091_00912436.png"], "id": "0091_00912436"} {"messages": [{"role": "user", "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.04 mm."}, {"role": "assistant", "content": "```python\n#!/usr/bin/env python3\n# -*- coding: utf-8 -*-\n# Ground-truth 2D engineering drawing for part: 0091_00914068\n# Self-contained: reproduces the three-view DXF via ezdxf, NO FreeCAD needed.\n# Coordinates are A4 page millimetres (scale=0.7346999999999999, page=[297.0, 210.0]).\n# visible edges -> solid (layer OUTLINE); hidden edges -> dashed (layer HIDDEN)\n# dimensions -> real movable DIMENSION entities (text = true mm value)\n# Run: python 0091_00914068_gt.py [out.dxf]\nimport sys\nimport ezdxf\nimport math\n\nSCALE = 0.7346999999999999\nPAGE = [297.0, 210.0]\n\nVISIBLE_SEGMENTS = [\n (172.852317, 87.6477, 172.852317, 161.1177),\n (172.852317, 161.1177, 99.382317, 161.1177),\n (99.382317, 161.1177, 99.382317, 87.6477),\n (99.382317, 87.6477, 172.852317, 87.6477),\n (172.852317, 73.6477, 172.852317, 72.882387),\n (99.382317, 73.6477, 99.382317, 72.882387),\n (99.382317, 72.882387, 172.852317, 72.882387),\n (99.382317, 73.6477, 172.852317, 73.6477),\n (187.61763, 161.1177, 186.852317, 161.1177),\n (186.852317, 161.1177, 186.852317, 87.6477),\n (187.61763, 87.6477, 186.852317, 87.6477),\n (187.61763, 161.1177, 187.61763, 87.6477)\n]\nVISIBLE_CIRCLES = [\n\n]\nVISIBLE_ARCS = [\n\n]\nHIDDEN_SEGMENTS = [\n\n]\n# (orient, text, p1, p2, base) for linear; (orient, text, center, radius, angle) for diameter\nDIMENSIONS = [\n ('horizontal', '100', (172.8523, 87.6477), (99.3823, 87.6477), (136.1173, 76.6477)),\n ('vertical', '100', (172.8523, 161.1177), (172.8523, 87.6477), (183.8523, 124.3827)),\n ('horizontal', '1.0417', (187.6177, 161.1177), (186.8523, 161.1177), (187.235, 150.1177))\n]\n\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; _ds.dxf.dimasz = 2.5\n _ds.dxf.dimexe = 1.25; _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\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\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,\n angle=(0 if d[0] == \"horizontal\" else 90),\n 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,\n 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,\n 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,\n text=text, dimstyle=\"EZDXF\").render()\n\n doc.saveas(out_path)\n\n\nif __name__ == \"__main__\":\n out = sys.argv[1] if len(sys.argv) > 1 else \"0091_00914068_gt.dxf\"\n draw(out)\n print(\"wrote\", out)\n```"}], "images": ["images/0091_00914068.png"], "id": "0091_00914068"} {"messages": [{"role": "user", "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 38.95 mm tall. It is extruded to a thickness of 3.12 mm."}, {"role": "assistant", "content": "```python\n#!/usr/bin/env python3\n# -*- coding: utf-8 -*-\n# Ground-truth 2D engineering drawing for part: 0091_00915825\n# Self-contained: reproduces the three-view DXF via ezdxf, NO FreeCAD needed.\n# Coordinates are A4 page millimetres (scale=1.4248727272727273, page=[297.0, 210.0]).\n# visible edges -> solid (layer OUTLINE); hidden edges -> dashed (layer HIDDEN)\n# dimensions -> real movable DIMENSION entities (text = true mm value)\n# Run: python 0091_00915825_gt.py [out.dxf]\nimport sys\nimport ezdxf\nimport math\n\nSCALE = 1.4248727272727273\nPAGE = [297.0, 210.0]\n\nVISIBLE_SEGMENTS = [\n (205.517289, 153.973866, 205.517289, 98.478823),\n (205.517289, 98.478823, 63.030016, 98.478823),\n (63.030016, 98.478823, 63.030016, 153.973866),\n (63.030016, 153.973866, 205.517289, 153.973866),\n (205.517289, 80.026096, 205.517289, 84.478823),\n (205.517289, 84.478823, 63.030016, 84.478823),\n (63.030016, 80.026096, 63.030016, 84.478823),\n (205.517289, 80.026096, 63.030016, 80.026096),\n (219.517289, 98.478823, 223.970016, 98.478823),\n (223.970016, 98.478823, 223.970016, 153.973866),\n (219.517289, 153.973866, 223.970016, 153.973866),\n (219.517289, 98.478823, 219.517289, 153.973866)\n]\nVISIBLE_CIRCLES = [\n\n]\nVISIBLE_ARCS = [\n\n]\nHIDDEN_SEGMENTS = [\n\n]\n# (orient, text, p1, p2, base) for linear; (orient, text, center, radius, angle) for diameter\nDIMENSIONS = [\n ('horizontal', '100', (205.5173, 153.9739), (63.03, 153.9739), (134.2736, 142.9739)),\n ('vertical', '38.9474', (205.5173, 98.4788), (205.5173, 153.9739), (194.5173, 126.2263)),\n ('horizontal', '3.125', (219.5173, 98.4788), (223.97, 98.4788), (221.7436, 109.4788))\n]\n\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; _ds.dxf.dimasz = 2.5\n _ds.dxf.dimexe = 1.25; _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\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\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,\n angle=(0 if d[0] == \"horizontal\" else 90),\n 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,\n 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,\n 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,\n text=text, dimstyle=\"EZDXF\").render()\n\n doc.saveas(out_path)\n\n\nif __name__ == \"__main__\":\n out = sys.argv[1] if len(sys.argv) > 1 else \"0091_00915825_gt.dxf\"\n draw(out)\n print(\"wrote\", out)\n```"}], "images": ["images/0091_00915825.png"], "id": "0091_00915825"} {"messages": [{"role": "user", "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 44.27 mm."}, {"role": "assistant", "content": "```python\n#!/usr/bin/env python3\n# -*- coding: utf-8 -*-\n# Ground-truth 2D engineering drawing for part: 0091_00918627\n# Self-contained: reproduces the three-view DXF via ezdxf, NO FreeCAD needed.\n# Coordinates are A4 page millimetres (scale=1.4391030927835013, page=[297.0, 210.0]).\n# visible edges -> solid (layer OUTLINE); hidden edges -> dashed (layer HIDDEN)\n# dimensions -> real movable DIMENSION entities (text = true mm value)\n# Run: python 0091_00918627_gt.py [out.dxf]\nimport sys\nimport ezdxf\nimport math\n\nSCALE = 1.4391030927835013\nPAGE = [297.0, 210.0]\n\nVISIBLE_SEGMENTS = [\n (176.600023, 154.340306, 176.600023, 157.369996),\n (176.600023, 157.369996, 32.689714, 157.369996),\n (32.689714, 157.369996, 32.689714, 154.340306),\n (32.689714, 154.340306, 176.600023, 154.340306),\n (176.600023, 140.340306, 176.600023, 76.630012),\n (32.689714, 140.340306, 32.689714, 76.630012),\n (32.689714, 76.630012, 176.600023, 76.630012),\n (32.689714, 140.340306, 176.600023, 140.340306),\n (254.310316, 157.369996, 190.600023, 157.369996),\n (190.600023, 157.369996, 190.600023, 154.340306),\n (254.310316, 154.340306, 190.600023, 154.340306),\n (254.310316, 157.369996, 254.310316, 154.340306)\n]\nVISIBLE_CIRCLES = [\n\n]\nVISIBLE_ARCS = [\n\n]\nHIDDEN_SEGMENTS = [\n\n]\n# (orient, text, p1, p2, base) for linear; (orient, text, center, radius, angle) for diameter\nDIMENSIONS = [\n ('horizontal', '100', (176.6, 154.3403), (32.6897, 154.3403), (104.6449, 143.3403)),\n ('vertical', '2.1053', (176.6, 157.37), (176.6, 154.3403), (187.6, 155.8552)),\n ('horizontal', '44.2708', (254.3103, 157.37), (190.6001, 157.37), (222.4552, 146.37))\n]\n\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; _ds.dxf.dimasz = 2.5\n _ds.dxf.dimexe = 1.25; _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\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\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,\n angle=(0 if d[0] == \"horizontal\" else 90),\n 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,\n 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,\n 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,\n text=text, dimstyle=\"EZDXF\").render()\n\n doc.saveas(out_path)\n\n\nif __name__ == \"__main__\":\n out = sys.argv[1] if len(sys.argv) > 1 else \"0091_00918627_gt.dxf\"\n draw(out)\n print(\"wrote\", out)\n```"}], "images": ["images/0091_00918627.png"], "id": "0091_00918627"} {"messages": [{"role": "user", "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 46.32 mm tall. It is extruded to a thickness of 0.52 mm."}, {"role": "assistant", "content": "```python\n#!/usr/bin/env python3\n# -*- coding: utf-8 -*-\n# Ground-truth 2D engineering drawing for part: 0092_00920561\n# Self-contained: reproduces the three-view DXF via ezdxf, NO FreeCAD needed.\n# Coordinates are A4 page millimetres (scale=1.4542515463917622, page=[297.0, 210.0]).\n# visible edges -> solid (layer OUTLINE); hidden edges -> dashed (layer HIDDEN)\n# dimensions -> real movable DIMENSION entities (text = true mm value)\n# Run: python 0092_00920561_gt.py [out.dxf]\nimport sys\nimport ezdxf\nimport math\n\nSCALE = 1.4542515463917622\nPAGE = [297.0, 210.0]\n\nVISIBLE_SEGMENTS = [\n (208.455182, 158.434805, 208.455182, 91.079997),\n (63.030027, 158.434805, 208.455182, 158.434805),\n (208.455182, 91.079997, 63.030027, 91.079997),\n (63.030027, 91.079997, 63.030027, 158.434805),\n (208.455182, 75.565151, 208.455182, 77.079997),\n (208.455182, 77.079997, 63.030027, 77.079997),\n (63.030027, 75.565151, 63.030027, 77.079997),\n (208.455182, 75.565151, 63.030027, 75.565151),\n (223.970027, 158.434805, 222.455182, 158.434805),\n (222.455182, 91.079997, 223.970027, 91.079997),\n (223.970027, 91.079997, 223.970027, 158.434805),\n (222.455182, 91.079997, 222.455182, 158.434805)\n]\nVISIBLE_CIRCLES = [\n\n]\nVISIBLE_ARCS = [\n\n]\nHIDDEN_SEGMENTS = [\n\n]\n# (orient, text, p1, p2, base) for linear; (orient, text, center, radius, angle) for diameter\nDIMENSIONS = [\n ('horizontal', '100', (208.4552, 158.4348), (63.03, 158.4348), (135.7426, 147.4348)),\n ('vertical', '46.3158', (208.4552, 91.08), (208.4552, 158.4348), (197.4552, 124.7574)),\n ('horizontal', '1.0417', (222.4552, 91.08), (223.97, 91.08), (223.2126, 102.08))\n]\n\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; _ds.dxf.dimasz = 2.5\n _ds.dxf.dimexe = 1.25; _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\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\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,\n angle=(0 if d[0] == \"horizontal\" else 90),\n 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,\n 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,\n 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,\n text=text, dimstyle=\"EZDXF\").render()\n\n doc.saveas(out_path)\n\n\nif __name__ == \"__main__\":\n out = sys.argv[1] if len(sys.argv) > 1 else \"0092_00920561_gt.dxf\"\n draw(out)\n print(\"wrote\", out)\n```"}], "images": ["images/0092_00920561.png"], "id": "0092_00920561"} {"messages": [{"role": "user", "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 60 mm wide and 100 mm tall. It is extruded to a thickness of 25.83 mm."}, {"role": "assistant", "content": "```python\n#!/usr/bin/env python3\n# -*- coding: utf-8 -*-\n# Ground-truth 2D engineering drawing for part: 0092_00923761\n# Self-contained: reproduces the three-view DXF via ezdxf, NO FreeCAD needed.\n# Coordinates are A4 page millimetres (scale=0.6336724890830021, page=[297.0, 210.0]).\n# visible edges -> solid (layer OUTLINE); hidden edges -> dashed (layer HIDDEN)\n# dimensions -> real movable DIMENSION entities (text = true mm value)\n# Run: python 0092_00923761_gt.py [out.dxf]\nimport sys\nimport ezdxf\nimport math\n\nSCALE = 0.6336724890830021\nPAGE = [297.0, 210.0]\n\nVISIBLE_SEGMENTS = [\n (139.1438, 108.682731, 139.1438, 172.04998),\n (101.12345, 108.682731, 139.1438, 108.682731),\n (139.1438, 172.04998, 101.12345, 172.04998),\n (101.12345, 172.04998, 101.12345, 108.682731),\n (139.1438, 61.94998, 139.1438, 94.682731),\n (101.12345, 61.94998, 101.12345, 94.682731),\n (101.12345, 61.94998, 139.1438, 61.94998),\n (101.12345, 94.682731, 139.1438, 94.682731),\n (153.1438, 108.682731, 185.876551, 108.682731),\n (185.876551, 172.04998, 153.1438, 172.04998),\n (153.1438, 172.04998, 153.1438, 108.682731),\n (185.876551, 172.04998, 185.876551, 108.682731)\n]\nVISIBLE_CIRCLES = [\n\n]\nVISIBLE_ARCS = [\n\n]\nHIDDEN_SEGMENTS = [\n\n]\n# (orient, text, p1, p2, base) for linear; (orient, text, center, radius, angle) for diameter\nDIMENSIONS = [\n ('horizontal', '60', (139.1438, 108.6827), (101.1235, 108.6827), (120.1336, 97.6827)),\n ('vertical', '100', (139.1438, 172.05), (139.1438, 108.6827), (150.1438, 140.3663)),\n ('horizontal', '51.6556', (185.8765, 172.05), (153.1438, 172.05), (169.5102, 161.05))\n]\n\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; _ds.dxf.dimasz = 2.5\n _ds.dxf.dimexe = 1.25; _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\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\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,\n angle=(0 if d[0] == \"horizontal\" else 90),\n 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,\n 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,\n 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,\n text=text, dimstyle=\"EZDXF\").render()\n\n doc.saveas(out_path)\n\n\nif __name__ == \"__main__\":\n out = sys.argv[1] if len(sys.argv) > 1 else \"0092_00923761_gt.dxf\"\n draw(out)\n print(\"wrote\", out)\n```"}], "images": ["images/0092_00923761.png"], "id": "0092_00923761"} {"messages": [{"role": "user", "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 19.79 mm."}, {"role": "assistant", "content": "```python\n#!/usr/bin/env python3\n# -*- coding: utf-8 -*-\n# Ground-truth 2D engineering drawing for part: 0092_00925538\n# Self-contained: reproduces the three-view DXF via ezdxf, NO FreeCAD needed.\n# Coordinates are A4 page millimetres (scale=0.976174825174823, page=[297.0, 210.0]).\n# visible edges -> solid (layer OUTLINE); hidden edges -> dashed (layer HIDDEN)\n# dimensions -> real movable DIMENSION entities (text = true mm value)\n# Run: python 0092_00925538_gt.py [out.dxf]\nimport sys\nimport ezdxf\nimport math\n\nSCALE = 0.976174825174823\nPAGE = [297.0, 210.0]\n\nVISIBLE_SEGMENTS = [\n (175.648671, 108.99879, 175.648671, 158.321307),\n (175.648671, 158.321307, 78.031189, 158.321307),\n (78.031189, 158.321307, 78.031189, 108.99879),\n (78.031189, 108.99879, 175.648671, 108.99879),\n (175.648671, 94.99879, 175.648671, 75.678663),\n (78.031189, 94.99879, 78.031189, 75.678663),\n (78.031189, 75.678663, 175.648671, 75.678663),\n (78.031189, 94.99879, 175.648671, 94.99879),\n (208.968798, 158.321307, 189.648671, 158.321307),\n (189.648671, 158.321307, 189.648671, 108.99879),\n (208.968798, 108.99879, 189.648671, 108.99879),\n (208.968798, 158.321307, 208.968798, 108.99879)\n]\nVISIBLE_CIRCLES = [\n\n]\nVISIBLE_ARCS = [\n\n]\nHIDDEN_SEGMENTS = [\n\n]\n# (orient, text, p1, p2, base) for linear; (orient, text, center, radius, angle) for diameter\nDIMENSIONS = [\n ('horizontal', '100', (175.6487, 108.9988), (78.0312, 108.9988), (126.8399, 97.9988)),\n ('vertical', '50.5263', (175.6487, 158.3213), (175.6487, 108.9988), (186.6487, 133.6601)),\n ('horizontal', '19.7917', (208.9688, 158.3213), (189.6486, 158.3213), (199.3087, 147.3213))\n]\n\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; _ds.dxf.dimasz = 2.5\n _ds.dxf.dimexe = 1.25; _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\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\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,\n angle=(0 if d[0] == \"horizontal\" else 90),\n 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,\n 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,\n 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,\n text=text, dimstyle=\"EZDXF\").render()\n\n doc.saveas(out_path)\n\n\nif __name__ == \"__main__\":\n out = sys.argv[1] if len(sys.argv) > 1 else \"0092_00925538_gt.dxf\"\n draw(out)\n print(\"wrote\", out)\n```"}], "images": ["images/0092_00925538.png"], "id": "0092_00925538"} {"messages": [{"role": "user", "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 5.26 mm."}, {"role": "assistant", "content": "```python\n#!/usr/bin/env python3\n# -*- coding: utf-8 -*-\n# Ground-truth 2D engineering drawing for part: 0092_00926667\n# Self-contained: reproduces the three-view DXF via ezdxf, NO FreeCAD needed.\n# Coordinates are A4 page millimetres (scale=1.395929999999998, page=[297.0, 210.0]).\n# visible edges -> solid (layer OUTLINE); hidden edges -> dashed (layer HIDDEN)\n# dimensions -> real movable DIMENSION entities (text = true mm value)\n# Run: python 0092_00926667_gt.py [out.dxf]\nimport sys\nimport ezdxf\nimport math\n\nSCALE = 1.395929999999998\nPAGE = [297.0, 210.0]\n\nVISIBLE_SEGMENTS = [\n (202.62302, 150.4492, 202.62302, 104.8978),\n (202.62302, 104.8978, 63.03002, 104.8978),\n (63.03002, 104.8978, 63.03002, 150.4492),\n (63.03002, 150.4492, 202.62302, 150.4492),\n (202.62302, 83.5508, 202.62302, 90.8978),\n (202.62302, 90.8978, 63.03002, 90.8978),\n (63.03002, 83.5508, 63.03002, 90.8978),\n (202.62302, 83.5508, 63.03002, 83.5508),\n (216.62302, 104.8978, 223.97002, 104.8978),\n (223.97002, 104.8978, 223.97002, 150.4492),\n (216.62302, 150.4492, 223.97002, 150.4492),\n (216.62302, 104.8978, 216.62302, 150.4492)\n]\nVISIBLE_CIRCLES = [\n\n]\nVISIBLE_ARCS = [\n\n]\nHIDDEN_SEGMENTS = [\n\n]\n# (orient, text, p1, p2, base) for linear; (orient, text, center, radius, angle) for diameter\nDIMENSIONS = [\n ('horizontal', '100', (202.623, 150.4492), (63.03, 150.4492), (132.8265, 139.4492)),\n ('vertical', '32.6316', (202.623, 104.8978), (202.623, 150.4492), (191.623, 127.6735)),\n ('horizontal', '5.2632', (216.623, 104.8978), (223.9701, 104.8978), (220.2965, 115.8978))\n]\n\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; _ds.dxf.dimasz = 2.5\n _ds.dxf.dimexe = 1.25; _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\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\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,\n angle=(0 if d[0] == \"horizontal\" else 90),\n 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,\n 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,\n 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,\n text=text, dimstyle=\"EZDXF\").render()\n\n doc.saveas(out_path)\n\n\nif __name__ == \"__main__\":\n out = sys.argv[1] if len(sys.argv) > 1 else \"0092_00926667_gt.dxf\"\n draw(out)\n print(\"wrote\", out)\n```"}], "images": ["images/0092_00926667.png"], "id": "0092_00926667"} {"messages": [{"role": "user", "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 1.04 mm."}, {"role": "assistant", "content": "```python\n#!/usr/bin/env python3\n# -*- coding: utf-8 -*-\n# Ground-truth 2D engineering drawing for part: 0092_00926781\n# Self-contained: reproduces the three-view DXF via ezdxf, NO FreeCAD needed.\n# Coordinates are A4 page millimetres (scale=1.153661157024853, page=[297.0, 210.0]).\n# visible edges -> solid (layer OUTLINE); hidden edges -> dashed (layer HIDDEN)\n# dimensions -> real movable DIMENSION entities (text = true mm value)\n# Run: python 0092_00926781_gt.py [out.dxf]\nimport sys\nimport ezdxf\nimport math\n\nSCALE = 1.153661157024853\nPAGE = [297.0, 210.0]\n\nVISIBLE_SEGMENTS = [\n (192.981311, 109.414769, 192.981311, 140.988654),\n (77.615195, 109.414769, 192.981311, 109.414769),\n (192.981311, 140.988654, 77.615195, 140.988654),\n (77.615195, 140.988654, 77.615195, 109.414769),\n (192.981311, 93.011309, 192.981311, 95.414769),\n (77.615195, 93.011309, 77.615195, 95.414769),\n (77.615195, 93.011309, 192.981311, 93.011309),\n (77.615195, 95.414769, 192.981311, 95.414769),\n (206.981311, 109.414769, 209.384772, 109.414769),\n (209.384772, 140.988654, 206.981311, 140.988654),\n (206.981311, 140.988654, 206.981311, 109.414769),\n (209.384772, 140.988654, 209.384772, 109.414769)\n]\nVISIBLE_CIRCLES = [\n\n]\nVISIBLE_ARCS = [\n\n]\nHIDDEN_SEGMENTS = [\n\n]\n# (orient, text, p1, p2, base) for linear; (orient, text, center, radius, angle) for diameter\nDIMENSIONS = [\n ('horizontal', '100', (192.9813, 109.4147), (77.6152, 109.4147), (135.2983, 98.4147)),\n ('vertical', '27.3684', (192.9813, 140.9887), (192.9813, 109.4147), (203.9813, 125.2017)),\n ('horizontal', '2.0833', (209.3848, 140.9887), (206.9813, 140.9887), (208.1831, 129.9887))\n]\n\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; _ds.dxf.dimasz = 2.5\n _ds.dxf.dimexe = 1.25; _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\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\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,\n angle=(0 if d[0] == \"horizontal\" else 90),\n 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,\n 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,\n 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,\n text=text, dimstyle=\"EZDXF\").render()\n\n doc.saveas(out_path)\n\n\nif __name__ == \"__main__\":\n out = sys.argv[1] if len(sys.argv) > 1 else \"0092_00926781_gt.dxf\"\n draw(out)\n print(\"wrote\", out)\n```"}], "images": ["images/0092_00926781.png"], "id": "0092_00926781"} {"messages": [{"role": "user", "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 38.54 mm."}, {"role": "assistant", "content": "```python\n#!/usr/bin/env python3\n# -*- coding: utf-8 -*-\n# Ground-truth 2D engineering drawing for part: 0092_00929275\n# Self-contained: reproduces the three-view DXF via ezdxf, NO FreeCAD needed.\n# Coordinates are A4 page millimetres (scale=0.8035500137526361, page=[297.0, 210.0]).\n# visible edges -> solid (layer OUTLINE); hidden edges -> dashed (layer HIDDEN)\n# dimensions -> real movable DIMENSION entities (text = true mm value)\n# Run: python 0092_00929275_gt.py [out.dxf]\nimport sys\nimport ezdxf\n\nSCALE = 0.8035500137526361\nPAGE = [297.0, 210.0]\n\nVISIBLE_SEGMENTS = [\n (161.192409, 172.050026, 161.192409, 106.920183),\n (161.192409, 106.920183, 80.837408, 106.920183),\n (80.837408, 106.920183, 80.837408, 172.050026),\n (80.837408, 172.050026, 161.192409, 172.050026),\n (161.192409, 61.950026, 161.192409, 92.920183),\n (161.192409, 92.920183, 80.837408, 92.920183),\n (80.837408, 61.950026, 80.837408, 92.920183),\n (161.192409, 61.950026, 80.837408, 61.950026),\n (175.192409, 106.920183, 206.162566, 106.920183),\n (206.162566, 106.920183, 206.162566, 172.050026),\n (175.192409, 172.050026, 206.162566, 172.050026),\n (175.192409, 106.920183, 175.192409, 172.050026)\n]\nVISIBLE_CIRCLES = [\n\n]\nVISIBLE_ARCS = [\n\n]\nHIDDEN_SEGMENTS = [\n\n]\n# (orient, text, p1, p2, base) for linear; (orient, text, center, radius, angle) for diameter\nDIMENSIONS = [\n ('horizontal', '100', (161.1924, 172.05), (80.8374, 172.05), (121.0149, 161.05)),\n ('vertical', '81.0526', (161.1924, 106.9202), (161.1924, 172.05), (150.1924, 139.4851)),\n ('horizontal', '38.5417', (175.1924, 106.9202), (206.1626, 106.9202), (190.6775, 117.9202))\n]\n\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\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\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,\n angle=(0 if d[0] == \"horizontal\" else 90),\n 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,\n text=text, dimstyle=\"EZDXF\").render()\n\n doc.saveas(out_path)\n\n\nif __name__ == \"__main__\":\n out = sys.argv[1] if len(sys.argv) > 1 else \"0092_00929275_gt.dxf\"\n draw(out)\n print(\"wrote\", out)\n```"}], "images": ["images/0092_00929275.png"], "id": "0092_00929275"} {"messages": [{"role": "user", "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": "assistant", "content": "```python\n#!/usr/bin/env python3\n# -*- coding: utf-8 -*-\n# Ground-truth 2D engineering drawing for part: 0093_00935166\n# Self-contained: reproduces the three-view DXF via ezdxf, NO FreeCAD needed.\n# Coordinates are A4 page millimetres (scale=0.48050000000000725, page=[297.0, 210.0]).\n# visible edges -> solid (layer OUTLINE); hidden edges -> dashed (layer HIDDEN)\n# dimensions -> real movable DIMENSION entities (text = true mm value)\n# Run: python 0093_00935166_gt.py [out.dxf]\nimport sys\nimport ezdxf\n\nSCALE = 0.48050000000000725\nPAGE = [297.0, 210.0]\n\nVISIBLE_SEGMENTS = [\n (136.5, 124.0, 136.5, 172.05),\n (136.5, 172.05, 88.45, 172.05),\n (88.45, 172.05, 88.45, 124.0),\n (88.45, 124.0, 136.5, 124.0),\n (136.5, 110.0, 136.5, 61.95),\n (136.5, 61.95, 88.45, 61.95),\n (88.45, 110.0, 88.45, 61.95),\n (136.5, 110.0, 88.45, 110.0),\n (150.5, 172.05, 198.55, 172.05),\n (198.55, 172.05, 198.55, 124.0),\n (150.5, 124.0, 198.55, 124.0),\n (150.5, 172.05, 150.5, 124.0)\n]\nVISIBLE_CIRCLES = [\n\n]\nVISIBLE_ARCS = [\n\n]\nHIDDEN_SEGMENTS = [\n\n]\n# (orient, text, p1, p2, base) for linear; (orient, text, center, radius, angle) for diameter\nDIMENSIONS = [\n ('horizontal', '100', (136.5, 172.05), (88.45, 172.05), (112.475, 161.05)),\n ('vertical', '100', (136.5, 124.0), (136.5, 172.05), (125.5, 148.025)),\n ('horizontal', '100', (150.5, 124.0), (198.55, 124.0), (174.525, 135.0))\n]\n\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\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\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,\n angle=(0 if d[0] == \"horizontal\" else 90),\n 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,\n text=text, dimstyle=\"EZDXF\").render()\n\n doc.saveas(out_path)\n\n\nif __name__ == \"__main__\":\n out = sys.argv[1] if len(sys.argv) > 1 else \"0093_00935166_gt.dxf\"\n draw(out)\n print(\"wrote\", out)\n```"}], "images": ["images/0093_00935166.png"], "id": "0093_00935166"} {"messages": [{"role": "user", "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 63.16 mm tall. It is extruded to a thickness of 9.38 mm."}, {"role": "assistant", "content": "```python\n#!/usr/bin/env python3\n# -*- coding: utf-8 -*-\n# Ground-truth 2D engineering drawing for part: 0094_00941924\n# Self-contained: reproduces the three-view DXF via ezdxf, NO FreeCAD needed.\n# Coordinates are A4 page millimetres (scale=1.3249160997732448, page=[297.0, 210.0]).\n# visible edges -> solid (layer OUTLINE); hidden edges -> dashed (layer HIDDEN)\n# dimensions -> real movable DIMENSION entities (text = true mm value)\n# Run: python 0094_00941924_gt.py [out.dxf]\nimport sys\nimport ezdxf\n\nSCALE = 1.3249160997732448\nPAGE = [297.0, 210.0]\n\nVISIBLE_SEGMENTS = [\n (196.535284, 172.050007, 196.535284, 88.371095),\n (196.535284, 88.371095, 64.043674, 88.371095),\n (64.043674, 88.371095, 64.043674, 172.050007),\n (64.043674, 172.050007, 196.535284, 172.050007),\n (196.535284, 61.950007, 196.535284, 74.371095),\n (196.535284, 74.371095, 64.043674, 74.371095),\n (64.043674, 61.950007, 64.043674, 74.371095),\n (196.535284, 61.950007, 64.043674, 61.950007),\n (210.535284, 88.371095, 222.956373, 88.371095),\n (222.956373, 88.371095, 222.956373, 172.050007),\n (210.535284, 172.050007, 222.956373, 172.050007),\n (210.535284, 88.371095, 210.535284, 172.050007)\n]\nVISIBLE_CIRCLES = [\n\n]\nVISIBLE_ARCS = [\n\n]\nHIDDEN_SEGMENTS = [\n\n]\n# (orient, text, p1, p2, base) for linear; (orient, text, center, radius, angle) for diameter\nDIMENSIONS = [\n ('horizontal', '100', (196.5353, 172.05), (64.0437, 172.05), (130.2895, 161.05)),\n ('vertical', '63.1579', (196.5353, 88.3711), (196.5353, 172.05), (185.5353, 130.2105)),\n ('horizontal', '9.375', (210.5353, 88.3711), (222.9563, 88.3711), (216.7458, 99.3711))\n]\n\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\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\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,\n angle=(0 if d[0] == \"horizontal\" else 90),\n 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,\n text=text, dimstyle=\"EZDXF\").render()\n\n doc.saveas(out_path)\n\n\nif __name__ == \"__main__\":\n out = sys.argv[1] if len(sys.argv) > 1 else \"0094_00941924_gt.dxf\"\n draw(out)\n print(\"wrote\", out)\n```"}], "images": ["images/0094_00941924.png"], "id": "0094_00941924"} {"messages": [{"role": "user", "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 50 mm."}, {"role": "assistant", "content": "```python\n#!/usr/bin/env python3\n# -*- coding: utf-8 -*-\n# Ground-truth 2D engineering drawing for part: 0094_00945287\n# Self-contained: reproduces the three-view DXF via ezdxf, NO FreeCAD needed.\n# Coordinates are A4 page millimetres (scale=0.9559685863874315, page=[297.0, 210.0]).\n# visible edges -> solid (layer OUTLINE); hidden edges -> dashed (layer HIDDEN)\n# dimensions -> real movable DIMENSION entities (text = true mm value)\n# Run: python 0094_00945287_gt.py [out.dxf]\nimport sys\nimport ezdxf\n\nSCALE = 0.9559685863874315\nPAGE = [297.0, 210.0]\n\nVISIBLE_SEGMENTS = [\n (160.399206, 172.049982, 160.399206, 123.748412),\n (160.399206, 123.748412, 64.802347, 123.748412),\n (64.802347, 123.748412, 64.802347, 172.049982),\n (64.802347, 172.049982, 160.399206, 172.049982),\n (160.399206, 61.949982, 160.399206, 109.748412),\n (160.399206, 109.748412, 64.802347, 109.748412),\n (64.802347, 61.949982, 64.802347, 109.748412),\n (160.399206, 61.949982, 64.802347, 61.949982),\n (174.399206, 123.748412, 222.197635, 123.748412),\n (222.197635, 123.748412, 222.197635, 172.049982),\n (174.399206, 172.049982, 222.197635, 172.049982),\n (174.399206, 123.748412, 174.399206, 172.049982)\n]\nVISIBLE_CIRCLES = [\n\n]\nVISIBLE_ARCS = [\n\n]\nHIDDEN_SEGMENTS = [\n\n]\n# (orient, text, p1, p2, base) for linear; (orient, text, center, radius, angle) for diameter\nDIMENSIONS = [\n ('horizontal', '100', (160.3992, 172.05), (64.8024, 172.05), (112.6008, 161.05)),\n ('vertical', '50.5263', (160.3992, 123.7484), (160.3992, 172.05), (149.3992, 147.8992)),\n ('horizontal', '50', (174.3992, 123.7484), (222.1976, 123.7484), (198.2984, 134.7484))\n]\n\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\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\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,\n angle=(0 if d[0] == \"horizontal\" else 90),\n 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,\n text=text, dimstyle=\"EZDXF\").render()\n\n doc.saveas(out_path)\n\n\nif __name__ == \"__main__\":\n out = sys.argv[1] if len(sys.argv) > 1 else \"0094_00945287_gt.dxf\"\n draw(out)\n print(\"wrote\", out)\n```"}], "images": ["images/0094_00945287.png"], "id": "0094_00945287"} {"messages": [{"role": "user", "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 2.6 mm."}, {"role": "assistant", "content": "```python\n#!/usr/bin/env python3\n# -*- coding: utf-8 -*-\n# Ground-truth 2D engineering drawing for part: 0094_00947078\n# Self-contained: reproduces the three-view DXF via ezdxf, NO FreeCAD needed.\n# Coordinates are A4 page millimetres (scale=1.4321055837563406, page=[297.0, 210.0]).\n# visible edges -> solid (layer OUTLINE); hidden edges -> dashed (layer HIDDEN)\n# dimensions -> real movable DIMENSION entities (text = true mm value)\n# Run: python 0094_00947078_gt.py [out.dxf]\nimport sys\nimport ezdxf\n\nSCALE = 1.4321055837563406\nPAGE = [297.0, 210.0]\n\nVISIBLE_SEGMENTS = [\n (206.240583, 162.044211, 206.240583, 89.685192),\n (206.240583, 89.685192, 63.030025, 89.685192),\n (63.030025, 89.685192, 63.030025, 162.044211),\n (63.030025, 162.044211, 206.240583, 162.044211),\n (206.240583, 71.955751, 206.240583, 75.685192),\n (206.240583, 75.685192, 63.030025, 75.685192),\n (63.030025, 71.955751, 63.030025, 75.685192),\n (206.240583, 71.955751, 63.030025, 71.955751),\n (220.240583, 89.685192, 223.970025, 89.685192),\n (223.970025, 89.685192, 223.970025, 162.044211),\n (220.240583, 162.044211, 223.970025, 162.044211),\n (220.240583, 89.685192, 220.240583, 162.044211)\n]\nVISIBLE_CIRCLES = [\n\n]\nVISIBLE_ARCS = [\n\n]\nHIDDEN_SEGMENTS = [\n\n]\n# (orient, text, p1, p2, base) for linear; (orient, text, center, radius, angle) for diameter\nDIMENSIONS = [\n ('horizontal', '100', (206.2406, 162.0442), (63.03, 162.0442), (134.6353, 151.0442)),\n ('vertical', '50.5263', (206.2406, 89.6852), (206.2406, 162.0442), (195.2406, 125.8647)),\n ('horizontal', '2.6042', (220.2406, 89.6852), (223.97, 89.6852), (222.1053, 100.6852))\n]\n\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\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\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,\n angle=(0 if d[0] == \"horizontal\" else 90),\n 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,\n text=text, dimstyle=\"EZDXF\").render()\n\n doc.saveas(out_path)\n\n\nif __name__ == \"__main__\":\n out = sys.argv[1] if len(sys.argv) > 1 else \"0094_00947078_gt.dxf\"\n draw(out)\n print(\"wrote\", out)\n```"}], "images": ["images/0094_00947078.png"], "id": "0094_00947078"} {"messages": [{"role": "user", "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 22.11 mm tall. It is extruded to a thickness of 14.06 mm."}, {"role": "assistant", "content": "```python\n#!/usr/bin/env python3\n# -*- coding: utf-8 -*-\n# Ground-truth 2D engineering drawing for part: 0094_00947539\n# Self-contained: reproduces the three-view DXF via ezdxf, NO FreeCAD needed.\n# Coordinates are A4 page millimetres (scale=1.2033879310345195, page=[297.0, 210.0]).\n# visible edges -> solid (layer OUTLINE); hidden edges -> dashed (layer HIDDEN)\n# dimensions -> real movable DIMENSION entities (text = true mm value)\n# Run: python 0094_00947539_gt.py [out.dxf]\nimport sys\nimport ezdxf\n\nSCALE = 1.2033879310345195\nPAGE = [297.0, 210.0]\n\nVISIBLE_SEGMENTS = [\n (179.746782, 127.622036, 179.746782, 154.223243),\n (59.407988, 127.622036, 179.746782, 127.622036),\n (179.746782, 154.223243, 59.407988, 154.223243),\n (59.407988, 154.223243, 59.407988, 127.622036),\n (179.746782, 79.77675, 179.746782, 113.622036),\n (59.407988, 79.77675, 59.407988, 113.622036),\n (59.407988, 79.77675, 179.746782, 79.77675),\n (59.407988, 113.622036, 179.746782, 113.622036),\n (193.746782, 127.622036, 227.592067, 127.622036),\n (227.592067, 154.223243, 193.746782, 154.223243),\n (193.746782, 154.223243, 193.746782, 127.622036),\n (227.592067, 154.223243, 227.592067, 127.622036)\n]\nVISIBLE_CIRCLES = [\n\n]\nVISIBLE_ARCS = [\n\n]\nHIDDEN_SEGMENTS = [\n\n]\n# (orient, text, p1, p2, base) for linear; (orient, text, center, radius, angle) for diameter\nDIMENSIONS = [\n ('horizontal', '100', (179.7468, 127.6221), (59.408, 127.6221), (119.5774, 116.6221)),\n ('vertical', '22.1053', (179.7468, 154.2232), (179.7468, 127.6221), (190.7468, 140.9226)),\n ('horizontal', '28.125', (227.592, 154.2232), (193.7468, 154.2232), (210.6694, 143.2232))\n]\n\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\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\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,\n angle=(0 if d[0] == \"horizontal\" else 90),\n 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,\n text=text, dimstyle=\"EZDXF\").render()\n\n doc.saveas(out_path)\n\n\nif __name__ == \"__main__\":\n out = sys.argv[1] if len(sys.argv) > 1 else \"0094_00947539_gt.dxf\"\n draw(out)\n print(\"wrote\", out)\n```"}], "images": ["images/0094_00947539.png"], "id": "0094_00947539"} {"messages": [{"role": "user", "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 3.65 mm."}, {"role": "assistant", "content": "```python\n#!/usr/bin/env python3\n# -*- coding: utf-8 -*-\n# Ground-truth 2D engineering drawing for part: 0095_00952000\n# Self-contained: reproduces the three-view DXF via ezdxf, NO FreeCAD needed.\n# Coordinates are A4 page millimetres (scale=0.9271959798995005, page=[297.0, 210.0]).\n# visible edges -> solid (layer OUTLINE); hidden edges -> dashed (layer HIDDEN)\n# dimensions -> real movable DIMENSION entities (text = true mm value)\n# Run: python 0095_00952000_gt.py [out.dxf]\nimport sys\nimport ezdxf\n\nSCALE = 0.9271959798995005\nPAGE = [297.0, 210.0]\n\nVISIBLE_SEGMENTS = [\n (181.169599, 172.049999, 181.169599, 79.330401),\n (181.169599, 79.330401, 88.450001, 79.330401),\n (88.450001, 79.330401, 88.450001, 172.049999),\n (88.450001, 172.049999, 181.169599, 172.049999),\n (181.169599, 61.949999, 181.169599, 65.330401),\n (181.169599, 65.330401, 88.450001, 65.330401),\n (88.450001, 61.949999, 88.450001, 65.330401),\n (181.169599, 61.949999, 88.450001, 61.949999),\n (195.169599, 79.330401, 198.550001, 79.330401),\n (198.550001, 79.330401, 198.550001, 172.049999),\n (195.169599, 172.049999, 198.550001, 172.049999),\n (195.169599, 79.330401, 195.169599, 172.049999)\n]\nVISIBLE_CIRCLES = [\n\n]\nVISIBLE_ARCS = [\n\n]\nHIDDEN_SEGMENTS = [\n\n]\n# (orient, text, p1, p2, base) for linear; (orient, text, center, radius, angle) for diameter\nDIMENSIONS = [\n ('horizontal', '100', (181.1696, 172.05), (88.45, 172.05), (134.8098, 161.05)),\n ('vertical', '100', (181.1696, 79.3304), (181.1696, 172.05), (170.1696, 125.6902)),\n ('horizontal', '3.6458', (195.1696, 79.3304), (198.55, 79.3304), (196.8598, 90.3304))\n]\n\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\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\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,\n angle=(0 if d[0] == \"horizontal\" else 90),\n 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,\n text=text, dimstyle=\"EZDXF\").render()\n\n doc.saveas(out_path)\n\n\nif __name__ == \"__main__\":\n out = sys.argv[1] if len(sys.argv) > 1 else \"0095_00952000_gt.dxf\"\n draw(out)\n print(\"wrote\", out)\n```"}], "images": ["images/0095_00952000.png"], "id": "0095_00952000"} {"messages": [{"role": "user", "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 26.32 mm wide and 100 mm tall. It is extruded to a thickness of 12.5 mm."}, {"role": "assistant", "content": "```python\n#!/usr/bin/env python3\n# -*- coding: utf-8 -*-\n# Ground-truth 2D engineering drawing for part: 0095_00953662\n# Self-contained: reproduces the three-view DXF via ezdxf, NO FreeCAD needed.\n# Coordinates are A4 page millimetres (scale=0.8542222222222222, page=[297.0, 210.0]).\n# visible edges -> solid (layer OUTLINE); hidden edges -> dashed (layer HIDDEN)\n# dimensions -> real movable DIMENSION entities (text = true mm value)\n# Run: python 0095_00953662_gt.py [out.dxf]\nimport sys\nimport ezdxf\n\nSCALE = 0.8542222222222222\nPAGE = [297.0, 210.0]\n\nVISIBLE_SEGMENTS = [\n (142.400891, 172.050013, 142.400891, 86.627791),\n (142.400891, 86.627791, 119.921359, 86.627791),\n (119.921359, 86.627791, 119.921359, 172.050013),\n (119.921359, 172.050013, 142.400891, 172.050013),\n (142.400891, 61.950013, 142.400891, 72.627791),\n (142.400891, 72.627791, 119.921359, 72.627791),\n (119.921359, 61.950013, 119.921359, 72.627791),\n (142.400891, 61.950013, 119.921359, 61.950013),\n (156.400891, 86.627791, 167.078669, 86.627791),\n (167.078669, 86.627791, 167.078669, 172.050013),\n (156.400891, 172.050013, 167.078669, 172.050013),\n (156.400891, 86.627791, 156.400891, 172.050013)\n]\nVISIBLE_CIRCLES = [\n\n]\nVISIBLE_ARCS = [\n\n]\nHIDDEN_SEGMENTS = [\n\n]\n# (orient, text, p1, p2, base) for linear; (orient, text, center, radius, angle) for diameter\nDIMENSIONS = [\n ('horizontal', '26.3158', (142.4009, 172.05), (119.9213, 172.05), (131.1611, 161.05)),\n ('vertical', '100', (142.4009, 86.6278), (142.4009, 172.05), (131.4009, 129.3389)),\n ('horizontal', '12.5', (156.4009, 86.6278), (167.0787, 86.6278), (161.7398, 97.6278))\n]\n\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\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\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,\n angle=(0 if d[0] == \"horizontal\" else 90),\n 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,\n text=text, dimstyle=\"EZDXF\").render()\n\n doc.saveas(out_path)\n\n\nif __name__ == \"__main__\":\n out = sys.argv[1] if len(sys.argv) > 1 else \"0095_00953662_gt.dxf\"\n draw(out)\n print(\"wrote\", out)\n```"}], "images": ["images/0095_00953662.png"], "id": "0095_00953662"} {"messages": [{"role": "user", "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.31 mm."}, {"role": "assistant", "content": "```python\n#!/usr/bin/env python3\n# -*- coding: utf-8 -*-\n# Ground-truth 2D engineering drawing for part: 0095_00954971\n# Self-contained: reproduces the three-view DXF via ezdxf, NO FreeCAD needed.\n# Coordinates are A4 page millimetres (scale=0.8711869158878699, page=[297.0, 210.0]).\n# visible edges -> solid (layer OUTLINE); hidden edges -> dashed (layer HIDDEN)\n# dimensions -> real movable DIMENSION entities (text = true mm value)\n# Run: python 0095_00954971_gt.py [out.dxf]\nimport sys\nimport ezdxf\n\nSCALE = 0.8711869158878699\nPAGE = [297.0, 210.0]\n\nVISIBLE_SEGMENTS = [\n (175.568697, 172.049995, 175.568697, 84.931303),\n (175.568697, 84.931303, 88.450005, 84.931303),\n (88.450005, 84.931303, 88.450005, 172.049995),\n (88.450005, 172.049995, 175.568697, 172.049995),\n (175.568697, 61.949995, 175.568697, 70.931303),\n (175.568697, 70.931303, 88.450005, 70.931303),\n (88.450005, 61.949995, 88.450005, 70.931303),\n (175.568697, 61.949995, 88.450005, 61.949995),\n (189.568697, 84.931303, 198.550005, 84.931303),\n (198.550005, 84.931303, 198.550005, 172.049995),\n (189.568697, 172.049995, 198.550005, 172.049995),\n (189.568697, 84.931303, 189.568697, 172.049995)\n]\nVISIBLE_CIRCLES = [\n\n]\nVISIBLE_ARCS = [\n\n]\nHIDDEN_SEGMENTS = [\n\n]\n# (orient, text, p1, p2, base) for linear; (orient, text, center, radius, angle) for diameter\nDIMENSIONS = [\n ('horizontal', '100', (175.5687, 172.05), (88.45, 172.05), (132.0094, 161.05)),\n ('vertical', '100', (175.5687, 84.9313), (175.5687, 172.05), (164.5687, 128.4907)),\n ('horizontal', '10.3093', (189.5687, 84.9313), (198.55, 84.9313), (194.0594, 95.9313))\n]\n\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\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\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,\n angle=(0 if d[0] == \"horizontal\" else 90),\n 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,\n text=text, dimstyle=\"EZDXF\").render()\n\n doc.saveas(out_path)\n\n\nif __name__ == \"__main__\":\n out = sys.argv[1] if len(sys.argv) > 1 else \"0095_00954971_gt.dxf\"\n draw(out)\n print(\"wrote\", out)\n```"}], "images": ["images/0095_00954971.png"], "id": "0095_00954971"} {"messages": [{"role": "user", "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 4.21 mm tall. It is extruded to a thickness of 1.56 mm."}, {"role": "assistant", "content": "```python\n#!/usr/bin/env python3\n# -*- coding: utf-8 -*-\n# Ground-truth 2D engineering drawing for part: 0095_00959024\n# Self-contained: reproduces the three-view DXF via ezdxf, NO FreeCAD needed.\n# Coordinates are A4 page millimetres (scale=1.446793846153846, page=[297.0, 210.0]).\n# visible edges -> solid (layer OUTLINE); hidden edges -> dashed (layer HIDDEN)\n# dimensions -> real movable DIMENSION entities (text = true mm value)\n# Run: python 0095_00959024_gt.py [out.dxf]\nimport sys\nimport ezdxf\n\nSCALE = 1.446793846153846\nPAGE = [297.0, 210.0]\n\nVISIBLE_SEGMENTS = [\n (207.709394, 128.176238, 207.709394, 122.084475),\n (207.709394, 122.084475, 63.030009, 122.084475),\n (63.030009, 122.084475, 63.030009, 128.176238),\n (63.030009, 128.176238, 207.709394, 128.176238),\n (207.709394, 105.823859, 207.709394, 108.084475),\n (207.709394, 108.084475, 63.030009, 108.084475),\n (63.030009, 105.823859, 63.030009, 108.084475),\n (207.709394, 105.823859, 63.030009, 105.823859),\n (221.709394, 122.084475, 223.970009, 122.084475),\n (223.970009, 122.084475, 223.970009, 128.176238),\n (221.709394, 128.176238, 223.970009, 128.176238),\n (221.709394, 122.084475, 221.709394, 128.176238)\n]\nVISIBLE_CIRCLES = [\n\n]\nVISIBLE_ARCS = [\n\n]\nHIDDEN_SEGMENTS = [\n\n]\n# (orient, text, p1, p2, base) for linear; (orient, text, center, radius, angle) for diameter\nDIMENSIONS = [\n ('horizontal', '100', (207.7094, 128.1762), (63.03, 128.1762), (135.3697, 117.1762)),\n ('vertical', '4.2105', (207.7094, 122.0845), (207.7094, 128.1762), (196.7094, 125.1303)),\n ('horizontal', '1.5625', (221.7094, 122.0845), (223.97, 122.0845), (222.8397, 133.0845))\n]\n\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\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\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,\n angle=(0 if d[0] == \"horizontal\" else 90),\n 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,\n text=text, dimstyle=\"EZDXF\").render()\n\n doc.saveas(out_path)\n\n\nif __name__ == \"__main__\":\n out = sys.argv[1] if len(sys.argv) > 1 else \"0095_00959024_gt.dxf\"\n draw(out)\n print(\"wrote\", out)\n```"}], "images": ["images/0095_00959024.png"], "id": "0095_00959024"} {"messages": [{"role": "user", "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 44.21 mm tall. It is extruded to a thickness of 1.56 mm."}, {"role": "assistant", "content": "```python\n#!/usr/bin/env python3\n# -*- coding: utf-8 -*-\n# Ground-truth 2D engineering drawing for part: 0095_00959029\n# Self-contained: reproduces the three-view DXF via ezdxf, NO FreeCAD needed.\n# Coordinates are A4 page millimetres (scale=1.446793846153846, page=[297.0, 210.0]).\n# visible edges -> solid (layer OUTLINE); hidden edges -> dashed (layer HIDDEN)\n# dimensions -> real movable DIMENSION entities (text = true mm value)\n# Run: python 0095_00959029_gt.py [out.dxf]\nimport sys\nimport ezdxf\n\nSCALE = 1.446793846153846\nPAGE = [297.0, 210.0]\n\nVISIBLE_SEGMENTS = [\n (207.709394, 157.11201, 207.709394, 93.148493),\n (207.709394, 93.148493, 63.030009, 93.148493),\n (63.030009, 93.148493, 63.030009, 157.11201),\n (63.030009, 157.11201, 207.709394, 157.11201),\n (207.709394, 76.887878, 207.709394, 79.148493),\n (207.709394, 79.148493, 63.030009, 79.148493),\n (63.030009, 76.887878, 63.030009, 79.148493),\n (207.709394, 76.887878, 63.030009, 76.887878),\n (221.709394, 93.148493, 223.970009, 93.148493),\n (223.970009, 93.148493, 223.970009, 157.11201),\n (221.709394, 157.11201, 223.970009, 157.11201),\n (221.709394, 93.148493, 221.709394, 157.11201)\n]\nVISIBLE_CIRCLES = [\n\n]\nVISIBLE_ARCS = [\n\n]\nHIDDEN_SEGMENTS = [\n\n]\n# (orient, text, p1, p2, base) for linear; (orient, text, center, radius, angle) for diameter\nDIMENSIONS = [\n ('horizontal', '100', (207.7094, 157.112), (63.03, 157.112), (135.3697, 146.112)),\n ('vertical', '44.2105', (207.7094, 93.1485), (207.7094, 157.112), (196.7094, 125.1303)),\n ('horizontal', '1.5625', (221.7094, 93.1485), (223.97, 93.1485), (222.8397, 104.1485))\n]\n\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\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\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,\n angle=(0 if d[0] == \"horizontal\" else 90),\n 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,\n text=text, dimstyle=\"EZDXF\").render()\n\n doc.saveas(out_path)\n\n\nif __name__ == \"__main__\":\n out = sys.argv[1] if len(sys.argv) > 1 else \"0095_00959029_gt.dxf\"\n draw(out)\n print(\"wrote\", out)\n```"}], "images": ["images/0095_00959029.png"], "id": "0095_00959029"} {"messages": [{"role": "user", "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": "assistant", "content": "```python\n#!/usr/bin/env python3\n# -*- coding: utf-8 -*-\n# Ground-truth 2D engineering drawing for part: 0096_00961595\n# Self-contained: reproduces the three-view DXF via ezdxf, NO FreeCAD needed.\n# Coordinates are A4 page millimetres (scale=0.4805, page=[297.0, 210.0]).\n# visible edges -> solid (layer OUTLINE); hidden edges -> dashed (layer HIDDEN)\n# dimensions -> real movable DIMENSION entities (text = true mm value)\n# Run: python 0096_00961595_gt.py [out.dxf]\nimport sys\nimport ezdxf\n\nSCALE = 0.4805\nPAGE = [297.0, 210.0]\n\nVISIBLE_SEGMENTS = [\n (136.5, 172.05, 136.5, 124.0),\n (136.5, 124.0, 88.45, 124.0),\n (88.45, 124.0, 88.45, 172.05),\n (88.45, 172.05, 136.5, 172.05),\n (136.5, 61.95, 136.5, 110.0),\n (136.5, 110.0, 88.45, 110.0),\n (88.45, 61.95, 88.45, 110.0),\n (136.5, 61.95, 88.45, 61.95),\n (150.5, 124.0, 198.55, 124.0),\n (198.55, 124.0, 198.55, 172.05),\n (150.5, 172.05, 198.55, 172.05),\n (150.5, 124.0, 150.5, 172.05)\n]\nVISIBLE_CIRCLES = [\n\n]\nVISIBLE_ARCS = [\n\n]\nHIDDEN_SEGMENTS = [\n\n]\n# (orient, text, p1, p2, base) for linear; (orient, text, center, radius, angle) for diameter\nDIMENSIONS = [\n ('horizontal', '100', (136.5, 172.05), (88.45, 172.05), (112.475, 161.05)),\n ('vertical', '100', (136.5, 124.0), (136.5, 172.05), (125.5, 148.025)),\n ('horizontal', '100', (150.5, 124.0), (198.55, 124.0), (174.525, 135.0))\n]\n\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\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\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,\n angle=(0 if d[0] == \"horizontal\" else 90),\n 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,\n text=text, dimstyle=\"EZDXF\").render()\n\n doc.saveas(out_path)\n\n\nif __name__ == \"__main__\":\n out = sys.argv[1] if len(sys.argv) > 1 else \"0096_00961595_gt.dxf\"\n draw(out)\n print(\"wrote\", out)\n```"}], "images": ["images/0096_00961595.png"], "id": "0096_00961595"} {"messages": [{"role": "user", "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 3.12 mm."}, {"role": "assistant", "content": "```python\n#!/usr/bin/env python3\n# -*- coding: utf-8 -*-\n# Ground-truth 2D engineering drawing for part: 0096_00964450\n# Self-contained: reproduces the three-view DXF via ezdxf, NO FreeCAD needed.\n# Coordinates are A4 page millimetres (scale=0.9318787878787879, page=[297.0, 210.0]).\n# visible edges -> solid (layer OUTLINE); hidden edges -> dashed (layer HIDDEN)\n# dimensions -> real movable DIMENSION entities (text = true mm value)\n# Run: python 0096_00964450_gt.py [out.dxf]\nimport sys\nimport ezdxf\n\nSCALE = 0.9318787878787879\nPAGE = [297.0, 210.0]\n\nVISIBLE_SEGMENTS = [\n (181.147407, 172.049987, 181.147407, 78.862108),\n (181.147407, 78.862108, 88.940453, 78.862108),\n (88.940453, 78.862108, 88.940453, 172.049987),\n (88.940453, 172.049987, 181.147407, 172.049987),\n (181.147407, 61.949987, 181.147407, 64.862108),\n (181.147407, 64.862108, 88.940453, 64.862108),\n (88.940453, 61.949987, 88.940453, 64.862108),\n (181.147407, 61.949987, 88.940453, 61.949987),\n (195.147407, 78.862108, 198.059528, 78.862108),\n (198.059528, 78.862108, 198.059528, 172.049987),\n (195.147407, 172.049987, 198.059528, 172.049987),\n (195.147407, 78.862108, 195.147407, 172.049987)\n]\nVISIBLE_CIRCLES = [\n\n]\nVISIBLE_ARCS = [\n\n]\nHIDDEN_SEGMENTS = [\n\n]\n# (orient, text, p1, p2, base) for linear; (orient, text, center, radius, angle) for diameter\nDIMENSIONS = [\n ('horizontal', '98.9474', (181.1474, 172.05), (88.9405, 172.05), (135.044, 161.05)),\n ('vertical', '100', (181.1474, 78.8621), (181.1474, 172.05), (170.1474, 125.4561)),\n ('horizontal', '3.125', (195.1474, 78.8621), (198.0595, 78.8621), (196.6035, 89.8621))\n]\n\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\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\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,\n angle=(0 if d[0] == \"horizontal\" else 90),\n 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,\n text=text, dimstyle=\"EZDXF\").render()\n\n doc.saveas(out_path)\n\n\nif __name__ == \"__main__\":\n out = sys.argv[1] if len(sys.argv) > 1 else \"0096_00964450_gt.dxf\"\n draw(out)\n print(\"wrote\", out)\n```"}], "images": ["images/0096_00964450.png"], "id": "0096_00964450"} {"messages": [{"role": "user", "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. It is extruded to a thickness of 40.62 mm."}, {"role": "assistant", "content": "```python\n#!/usr/bin/env python3\n# -*- coding: utf-8 -*-\n# Ground-truth 2D engineering drawing for part: 0096_00966458\n# Self-contained: reproduces the three-view DXF via ezdxf, NO FreeCAD needed.\n# Coordinates are A4 page millimetres (scale=0.9967383145684018, page=[297.0, 210.0]).\n# visible edges -> solid (layer OUTLINE); hidden edges -> dashed (layer HIDDEN)\n# dimensions -> real movable DIMENSION entities (text = true mm value)\n# Run: python 0096_00966458_gt.py [out.dxf]\nimport sys\nimport ezdxf\n\nSCALE = 0.9967383145684018\nPAGE = [297.0, 210.0]\n\nVISIBLE_SEGMENTS = [\n (166.090687, 172.050004, 166.090687, 116.442498),\n (166.090687, 116.442498, 66.416856, 116.442498),\n (66.416856, 116.442498, 66.416856, 172.050004),\n (66.416856, 172.050004, 166.090687, 172.050004),\n (166.090687, 61.950004, 166.090687, 102.442498),\n (166.090687, 102.442498, 66.416856, 102.442498),\n (66.416856, 61.950004, 66.416856, 102.442498),\n (166.090687, 61.950004, 66.416856, 61.950004),\n (180.090687, 116.442498, 220.583182, 116.442498),\n (220.583182, 116.442498, 220.583182, 172.050004),\n (180.090687, 172.050004, 220.583182, 172.050004),\n (180.090687, 116.442498, 180.090687, 172.050004)\n]\nVISIBLE_CIRCLES = [\n\n]\nVISIBLE_ARCS = [\n\n]\nHIDDEN_SEGMENTS = [\n\n]\n# (orient, text, p1, p2, base) for linear; (orient, text, center, radius, angle) for diameter\nDIMENSIONS = [\n ('horizontal', '100', (166.0907, 172.05), (66.4168, 172.05), (116.2538, 161.05)),\n ('vertical', '55.7895', (166.0907, 116.4425), (166.0907, 172.05), (155.0907, 144.2463)),\n ('horizontal', '40.625', (180.0907, 116.4425), (220.5832, 116.4425), (200.3369, 127.4425))\n]\n\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\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\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,\n angle=(0 if d[0] == \"horizontal\" else 90),\n 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,\n text=text, dimstyle=\"EZDXF\").render()\n\n doc.saveas(out_path)\n\n\nif __name__ == \"__main__\":\n out = sys.argv[1] if len(sys.argv) > 1 else \"0096_00966458_gt.dxf\"\n draw(out)\n print(\"wrote\", out)\n```"}], "images": ["images/0096_00966458.png"], "id": "0096_00966458"} {"messages": [{"role": "user", "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 1.56 mm."}, {"role": "assistant", "content": "```python\n#!/usr/bin/env python3\n# -*- coding: utf-8 -*-\n# Ground-truth 2D engineering drawing for part: 0097_00970022\n# Self-contained: reproduces the three-view DXF via ezdxf, NO FreeCAD needed.\n# Coordinates are A4 page millimetres (scale=1.2771322404372227, page=[297.0, 210.0]).\n# visible edges -> solid (layer OUTLINE); hidden edges -> dashed (layer HIDDEN)\n# dimensions -> real movable DIMENSION entities (text = true mm value)\n# Run: python 0097_00970022_gt.py [out.dxf]\nimport sys\nimport ezdxf\n\nSCALE = 1.2771322404372227\nPAGE = [297.0, 210.0]\n\nVISIBLE_SEGMENTS = [\n (199.358881, 172.050049, 199.358881, 77.945568),\n (199.358881, 77.945568, 71.645657, 77.945568),\n (71.645657, 77.945568, 71.645657, 172.050049),\n (71.645657, 172.050049, 199.358881, 172.050049),\n (199.358881, 61.950049, 199.358881, 63.945568),\n (199.358881, 63.945568, 71.645657, 63.945568),\n (71.645657, 61.950049, 71.645657, 63.945568),\n (199.358881, 61.950049, 71.645657, 61.950049),\n (213.358881, 77.945568, 215.3544, 77.945568),\n (215.3544, 77.945568, 215.3544, 172.050049),\n (213.358881, 172.050049, 215.3544, 172.050049),\n (213.358881, 77.945568, 213.358881, 172.050049)\n]\nVISIBLE_CIRCLES = [\n\n]\nVISIBLE_ARCS = [\n\n]\nHIDDEN_SEGMENTS = [\n\n]\n# (orient, text, p1, p2, base) for linear; (orient, text, center, radius, angle) for diameter\nDIMENSIONS = [\n ('horizontal', '100', (199.3589, 172.05), (71.6456, 172.05), (135.5022, 161.05)),\n ('vertical', '73.6842', (199.3589, 77.9456), (199.3589, 172.05), (188.3589, 124.9978)),\n ('horizontal', '1.5625', (213.3589, 77.9456), (215.3544, 77.9456), (214.3566, 88.9456))\n]\n\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\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\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,\n angle=(0 if d[0] == \"horizontal\" else 90),\n 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,\n text=text, dimstyle=\"EZDXF\").render()\n\n doc.saveas(out_path)\n\n\nif __name__ == \"__main__\":\n out = sys.argv[1] if len(sys.argv) > 1 else \"0097_00970022_gt.dxf\"\n draw(out)\n print(\"wrote\", out)\n```"}], "images": ["images/0097_00970022.png"], "id": "0097_00970022"} {"messages": [{"role": "user", "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 593.33 mm."}, {"role": "assistant", "content": "```python\n#!/usr/bin/env python3\n# -*- coding: utf-8 -*-\n# Ground-truth 2D engineering drawing for part: 0097_00974833\n# Self-contained: reproduces the three-view DXF via ezdxf, NO FreeCAD needed.\n# Coordinates are A4 page millimetres (scale=0.1386057692307773, page=[297.0, 210.0]).\n# visible edges -> solid (layer OUTLINE); hidden edges -> dashed (layer HIDDEN)\n# dimensions -> real movable DIMENSION entities (text = true mm value)\n# Run: python 0097_00974833_gt.py [out.dxf]\nimport sys\nimport ezdxf\n\nSCALE = 0.1386057692307773\nPAGE = [297.0, 210.0]\n\nVISIBLE_SEGMENTS = [\n (102.310591, 158.189414, 102.310591, 172.049991),\n (102.310591, 172.049991, 88.450014, 172.049991),\n (88.450014, 172.049991, 88.450014, 158.189414),\n (88.450014, 158.189414, 102.310591, 158.189414),\n (102.310591, 144.189414, 102.310591, 61.949991),\n (88.450014, 144.189414, 88.450014, 61.949991),\n (88.450014, 61.949991, 102.310591, 61.949991),\n (88.450014, 144.189414, 102.310591, 144.189414),\n (198.550014, 172.049991, 116.310591, 172.049991),\n (116.310591, 172.049991, 116.310591, 158.189414),\n (198.550014, 158.189414, 116.310591, 158.189414),\n (198.550014, 172.049991, 198.550014, 158.189414)\n]\nVISIBLE_CIRCLES = [\n\n]\nVISIBLE_ARCS = [\n\n]\nHIDDEN_SEGMENTS = [\n\n]\n# (orient, text, p1, p2, base) for linear; (orient, text, center, radius, angle) for diameter\nDIMENSIONS = [\n ('horizontal', '100', (102.3106, 158.1894), (88.45, 158.1894), (95.3803, 147.1894)),\n ('vertical', '100', (102.3106, 172.05), (102.3106, 158.1894), (113.3106, 165.1197)),\n ('horizontal', '593.333', (198.55, 172.05), (116.3106, 172.05), (157.4303, 161.05))\n]\n\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\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\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,\n angle=(0 if d[0] == \"horizontal\" else 90),\n 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,\n text=text, dimstyle=\"EZDXF\").render()\n\n doc.saveas(out_path)\n\n\nif __name__ == \"__main__\":\n out = sys.argv[1] if len(sys.argv) > 1 else \"0097_00974833_gt.dxf\"\n draw(out)\n print(\"wrote\", out)\n```"}], "images": ["images/0097_00974833.png"], "id": "0097_00974833"} {"messages": [{"role": "user", "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 2.6 mm."}, {"role": "assistant", "content": "```python\n#!/usr/bin/env python3\n# -*- coding: utf-8 -*-\n# Ground-truth 2D engineering drawing for part: 0097_00975357\n# Self-contained: reproduces the three-view DXF via ezdxf, NO FreeCAD needed.\n# Coordinates are A4 page millimetres (scale=1.3966574257425657, page=[297.0, 210.0]).\n# visible edges -> solid (layer OUTLINE); hidden edges -> dashed (layer HIDDEN)\n# dimensions -> real movable DIMENSION entities (text = true mm value)\n# Run: python 0097_00975357_gt.py [out.dxf]\nimport sys\nimport ezdxf\n\nSCALE = 1.3966574257425657\nPAGE = [297.0, 210.0]\n\nVISIBLE_SEGMENTS = [\n (202.695717, 142.338769, 202.695717, 112.935454),\n (63.029974, 142.338769, 202.695717, 142.338769),\n (202.695717, 112.935454, 63.029974, 112.935454),\n (63.029974, 112.935454, 63.029974, 142.338769),\n (202.695717, 91.661197, 202.695717, 98.935454),\n (202.695717, 98.935454, 63.029974, 98.935454),\n (63.029974, 91.661197, 63.029974, 98.935454),\n (202.695717, 91.661197, 63.029974, 91.661197),\n (223.969974, 142.338769, 216.695717, 142.338769),\n (216.695717, 112.935454, 223.969974, 112.935454),\n (223.969974, 112.935454, 223.969974, 142.338769),\n (216.695717, 112.935454, 216.695717, 142.338769)\n]\nVISIBLE_CIRCLES = [\n\n]\nVISIBLE_ARCS = [\n\n]\nHIDDEN_SEGMENTS = [\n\n]\n# (orient, text, p1, p2, base) for linear; (orient, text, center, radius, angle) for diameter\nDIMENSIONS = [\n ('horizontal', '100', (202.6957, 142.3387), (63.03, 142.3387), (132.8629, 131.3387)),\n ('vertical', '21.0526', (202.6957, 112.9355), (202.6957, 142.3387), (191.6957, 127.6371)),\n ('horizontal', '5.2083', (216.6957, 112.9355), (223.97, 112.9355), (220.3329, 123.9355))\n]\n\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\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\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,\n angle=(0 if d[0] == \"horizontal\" else 90),\n 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,\n text=text, dimstyle=\"EZDXF\").render()\n\n doc.saveas(out_path)\n\n\nif __name__ == \"__main__\":\n out = sys.argv[1] if len(sys.argv) > 1 else \"0097_00975357_gt.dxf\"\n draw(out)\n print(\"wrote\", out)\n```"}], "images": ["images/0097_00975357.png"], "id": "0097_00975357"} {"messages": [{"role": "user", "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 6.25 mm."}, {"role": "assistant", "content": "```python\n#!/usr/bin/env python3\n# -*- coding: utf-8 -*-\n# Ground-truth 2D engineering drawing for part: 0097_00976980\n# Self-contained: reproduces the three-view DXF via ezdxf, NO FreeCAD needed.\n# Coordinates are A4 page millimetres (scale=1.3829647058823529, page=[297.0, 210.0]).\n# visible edges -> solid (layer OUTLINE); hidden edges -> dashed (layer HIDDEN)\n# dimensions -> real movable DIMENSION entities (text = true mm value)\n# Run: python 0097_00976980_gt.py [out.dxf]\nimport sys\nimport ezdxf\n\nSCALE = 1.3829647058823529\nPAGE = [297.0, 210.0]\n\nVISIBLE_SEGMENTS = [\n (201.326488, 171.266492, 201.326488, 85.377105),\n (201.326488, 85.377105, 63.030018, 85.377105),\n (63.030018, 85.377105, 63.030018, 171.266492),\n (63.030018, 171.266492, 201.326488, 171.266492),\n (201.326488, 62.733576, 201.326488, 71.377105),\n (201.326488, 71.377105, 63.030018, 71.377105),\n (63.030018, 62.733576, 63.030018, 71.377105),\n (201.326488, 62.733576, 63.030018, 62.733576),\n (215.326488, 85.377105, 223.970018, 85.377105),\n (223.970018, 85.377105, 223.970018, 171.266492),\n (215.326488, 171.266492, 223.970018, 171.266492),\n (215.326488, 85.377105, 215.326488, 171.266492)\n]\nVISIBLE_CIRCLES = [\n\n]\nVISIBLE_ARCS = [\n\n]\nHIDDEN_SEGMENTS = [\n\n]\n# (orient, text, p1, p2, base) for linear; (orient, text, center, radius, angle) for diameter\nDIMENSIONS = [\n ('horizontal', '100', (201.3265, 171.2665), (63.03, 171.2665), (132.1782, 160.2665)),\n ('vertical', '62.1053', (201.3265, 85.3771), (201.3265, 171.2665), (190.3265, 128.3218)),\n ('horizontal', '6.25', (215.3265, 85.3771), (223.97, 85.3771), (219.6482, 96.3771))\n]\n\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\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\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,\n angle=(0 if d[0] == \"horizontal\" else 90),\n 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,\n text=text, dimstyle=\"EZDXF\").render()\n\n doc.saveas(out_path)\n\n\nif __name__ == \"__main__\":\n out = sys.argv[1] if len(sys.argv) > 1 else \"0097_00976980_gt.dxf\"\n draw(out)\n print(\"wrote\", out)\n```"}], "images": ["images/0097_00976980.png"], "id": "0097_00976980"} {"messages": [{"role": "user", "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 61.05 mm wide and 100 mm tall. It is extruded to a thickness of 36.73 mm."}, {"role": "assistant", "content": "```python\n#!/usr/bin/env python3\n# -*- coding: utf-8 -*-\n# Ground-truth 2D engineering drawing for part: 0097_00979155\n# Self-contained: reproduces the three-view DXF via ezdxf, NO FreeCAD needed.\n# Coordinates are A4 page millimetres (scale=0.7028208955224138, page=[297.0, 210.0]).\n# visible edges -> solid (layer OUTLINE); hidden edges -> dashed (layer HIDDEN)\n# dimensions -> real movable DIMENSION entities (text = true mm value)\n# Run: python 0097_00979155_gt.py [out.dxf]\nimport sys\nimport ezdxf\n\nSCALE = 0.7028208955224138\nPAGE = [297.0, 210.0]\n\nVISIBLE_SEGMENTS = [\n (145.045591, 101.767906, 145.045591, 172.049996),\n (145.045591, 172.049996, 102.136526, 172.049996),\n (102.136526, 172.049996, 102.136526, 101.767906),\n (102.136526, 101.767906, 145.045591, 101.767906),\n (145.045591, 87.767906, 145.045591, 61.949996),\n (102.136526, 87.767906, 102.136526, 61.949996),\n (102.136526, 61.949996, 145.045591, 61.949996),\n (102.136526, 87.767906, 145.045591, 87.767906),\n (184.863501, 172.049996, 159.045591, 172.049996),\n (159.045591, 172.049996, 159.045591, 101.767906),\n (184.863501, 101.767906, 159.045591, 101.767906),\n (184.863501, 172.049996, 184.863501, 101.767906)\n]\nVISIBLE_CIRCLES = [\n\n]\nVISIBLE_ARCS = [\n\n]\nHIDDEN_SEGMENTS = [\n\n]\n# (orient, text, p1, p2, base) for linear; (orient, text, center, radius, angle) for diameter\nDIMENSIONS = [\n ('horizontal', '61.0526', (145.0456, 101.7679), (102.1365, 101.7679), (123.591, 90.7679)),\n ('vertical', '100', (145.0456, 172.05), (145.0456, 101.7679), (156.0456, 136.9089)),\n ('horizontal', '36.7347', (184.8635, 172.05), (159.0456, 172.05), (171.9545, 161.05))\n]\n\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\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\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,\n angle=(0 if d[0] == \"horizontal\" else 90),\n 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,\n text=text, dimstyle=\"EZDXF\").render()\n\n doc.saveas(out_path)\n\n\nif __name__ == \"__main__\":\n out = sys.argv[1] if len(sys.argv) > 1 else \"0097_00979155_gt.dxf\"\n draw(out)\n print(\"wrote\", out)\n```"}], "images": ["images/0097_00979155.png"], "id": "0097_00979155"} {"messages": [{"role": "user", "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 1.92 mm."}, {"role": "assistant", "content": "```python\n#!/usr/bin/env python3\n# -*- coding: utf-8 -*-\n# Ground-truth 2D engineering drawing for part: 0098_00983414\n# Self-contained: reproduces the three-view DXF via ezdxf, NO FreeCAD needed.\n# Coordinates are A4 page millimetres (scale=1.0991574803149917, page=[297.0, 210.0]).\n# visible edges -> solid (layer OUTLINE); hidden edges -> dashed (layer HIDDEN)\n# dimensions -> real movable DIMENSION entities (text = true mm value)\n# Run: python 0098_00983414_gt.py [out.dxf]\nimport sys\nimport ezdxf\n\nSCALE = 1.0991574803149917\nPAGE = [297.0, 210.0]\n\nVISIBLE_SEGMENTS = [\n (190.401017, 106.544769, 190.401017, 143.569021),\n (190.401017, 143.569021, 80.485269, 143.569021),\n (80.485269, 143.569021, 80.485269, 106.544769),\n (80.485269, 106.544769, 190.401017, 106.544769),\n (190.401017, 92.544769, 190.401017, 90.431004),\n (80.485269, 92.544769, 80.485269, 90.431004),\n (80.485269, 90.431004, 190.401017, 90.431004),\n (80.485269, 92.544769, 190.401017, 92.544769),\n (206.514781, 143.569021, 204.401017, 143.569021),\n (204.401017, 143.569021, 204.401017, 106.544769),\n (206.514781, 106.544769, 204.401017, 106.544769),\n (206.514781, 143.569021, 206.514781, 106.544769)\n]\nVISIBLE_CIRCLES = [\n\n]\nVISIBLE_ARCS = [\n\n]\nHIDDEN_SEGMENTS = [\n\n]\n# (orient, text, p1, p2, base) for linear; (orient, text, center, radius, angle) for diameter\nDIMENSIONS = [\n ('horizontal', '100', (190.401, 106.5448), (80.4853, 106.5448), (135.4432, 95.5448)),\n ('vertical', '33.6842', (190.401, 143.569), (190.401, 106.5448), (201.401, 125.0569)),\n ('horizontal', '1.9231', (206.5148, 143.569), (204.401, 143.569), (205.4579, 132.569))\n]\n\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\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\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,\n angle=(0 if d[0] == \"horizontal\" else 90),\n 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,\n text=text, dimstyle=\"EZDXF\").render()\n\n doc.saveas(out_path)\n\n\nif __name__ == \"__main__\":\n out = sys.argv[1] if len(sys.argv) > 1 else \"0098_00983414_gt.dxf\"\n draw(out)\n print(\"wrote\", out)\n```"}], "images": ["images/0098_00983414.png"], "id": "0098_00983414"} {"messages": [{"role": "user", "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 46.32 mm wide and 100 mm tall. It is extruded to a thickness of 2.08 mm."}, {"role": "assistant", "content": "```python\n#!/usr/bin/env python3\n# -*- coding: utf-8 -*-\n# Ground-truth 2D engineering drawing for part: 0098_00983693\n# Self-contained: reproduces the three-view DXF via ezdxf, NO FreeCAD needed.\n# Coordinates are A4 page millimetres (scale=0.9413877551020439, page=[297.0, 210.0]).\n# visible edges -> solid (layer OUTLINE); hidden edges -> dashed (layer HIDDEN)\n# dimensions -> real movable DIMENSION entities (text = true mm value)\n# Run: python 0098_00983693_gt.py [out.dxf]\nimport sys\nimport ezdxf\n\nSCALE = 0.9413877551020439\nPAGE = [297.0, 210.0]\n\nVISIBLE_SEGMENTS = [\n (157.319899, 172.049985, 157.319899, 77.91121),\n (157.319899, 77.91121, 113.718781, 77.91121),\n (113.718781, 77.91121, 113.718781, 172.049985),\n (113.718781, 172.049985, 157.319899, 172.049985),\n (157.319899, 61.949985, 157.319899, 63.91121),\n (157.319899, 63.91121, 113.718781, 63.91121),\n (113.718781, 61.949985, 113.718781, 63.91121),\n (157.319899, 61.949985, 113.718781, 61.949985),\n (171.319899, 77.91121, 173.281123, 77.91121),\n (173.281123, 77.91121, 173.281123, 172.049985),\n (171.319899, 172.049985, 173.281123, 172.049985),\n (171.319899, 77.91121, 171.319899, 172.049985)\n]\nVISIBLE_CIRCLES = [\n\n]\nVISIBLE_ARCS = [\n\n]\nHIDDEN_SEGMENTS = [\n\n]\n# (orient, text, p1, p2, base) for linear; (orient, text, center, radius, angle) for diameter\nDIMENSIONS = [\n ('horizontal', '46.3158', (157.3199, 172.05), (113.7188, 172.05), (135.5194, 161.05)),\n ('vertical', '100', (157.3199, 77.9112), (157.3199, 172.05), (146.3199, 124.9806)),\n ('horizontal', '2.0833', (171.3199, 77.9112), (173.2811, 77.9112), (172.3005, 88.9112))\n]\n\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\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\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,\n angle=(0 if d[0] == \"horizontal\" else 90),\n 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,\n text=text, dimstyle=\"EZDXF\").render()\n\n doc.saveas(out_path)\n\n\nif __name__ == \"__main__\":\n out = sys.argv[1] if len(sys.argv) > 1 else \"0098_00983693_gt.dxf\"\n draw(out)\n print(\"wrote\", out)\n```"}], "images": ["images/0098_00983693.png"], "id": "0098_00983693"} {"messages": [{"role": "user", "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 96.84 mm wide and 100 mm tall. It is extruded to a thickness of 1.04 mm."}, {"role": "assistant", "content": "```python\n#!/usr/bin/env python3\n# -*- coding: utf-8 -*-\n# Ground-truth 2D engineering drawing for part: 0099_00990183\n# Self-contained: reproduces the three-view DXF via ezdxf, NO FreeCAD needed.\n# Coordinates are A4 page millimetres (scale=0.9510927835051515, page=[297.0, 210.0]).\n# visible edges -> solid (layer OUTLINE); hidden edges -> dashed (layer HIDDEN)\n# dimensions -> real movable DIMENSION entities (text = true mm value)\n# Run: python 0099_00990183_gt.py [out.dxf]\nimport sys\nimport ezdxf\n\nSCALE = 0.9510927835051515\nPAGE = [297.0, 210.0]\n\nVISIBLE_SEGMENTS = [\n (182.057541, 172.049987, 182.057541, 76.940709),\n (182.057541, 76.940709, 89.951714, 76.940709),\n (89.951714, 76.940709, 89.951714, 172.049987),\n (89.951714, 172.049987, 182.057541, 172.049987),\n (182.057541, 61.949987, 182.057541, 62.940709),\n (182.057541, 62.940709, 89.951714, 62.940709),\n (89.951714, 61.949987, 89.951714, 62.940709),\n (182.057541, 61.949987, 89.951714, 61.949987),\n (196.057541, 76.940709, 197.048263, 76.940709),\n (197.048263, 76.940709, 197.048263, 172.049987),\n (196.057541, 172.049987, 197.048263, 172.049987),\n (196.057541, 76.940709, 196.057541, 172.049987)\n]\nVISIBLE_CIRCLES = [\n\n]\nVISIBLE_ARCS = [\n\n]\nHIDDEN_SEGMENTS = [\n\n]\n# (orient, text, p1, p2, base) for linear; (orient, text, center, radius, angle) for diameter\nDIMENSIONS = [\n ('horizontal', '96.8421', (182.0575, 172.05), (89.9517, 172.05), (136.0046, 161.05)),\n ('vertical', '100', (182.0575, 76.9407), (182.0575, 172.05), (171.0575, 124.4954)),\n ('horizontal', '1.0417', (196.0576, 76.9407), (197.0483, 76.9407), (196.5529, 87.9407))\n]\n\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\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\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,\n angle=(0 if d[0] == \"horizontal\" else 90),\n 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,\n text=text, dimstyle=\"EZDXF\").render()\n\n doc.saveas(out_path)\n\n\nif __name__ == \"__main__\":\n out = sys.argv[1] if len(sys.argv) > 1 else \"0099_00990183_gt.dxf\"\n draw(out)\n print(\"wrote\", out)\n```"}], "images": ["images/0099_00990183.png"], "id": "0099_00990183"} {"messages": [{"role": "user", "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": "assistant", "content": "```python\n#!/usr/bin/env python3\n# -*- coding: utf-8 -*-\n# Ground-truth 2D engineering drawing for part: 0001_00010868\n# Self-contained: reproduces the three-view DXF via ezdxf, NO FreeCAD needed.\n# Coordinates are A4 page millimetres (scale=0.3225734265734338, page=[297.0, 210.0]).\n# visible edges -> solid (layer OUTLINE); hidden edges -> dashed (layer HIDDEN)\n# dimensions -> real movable DIMENSION entities (text = true mm value)\n# Run: python 0001_00010868_gt.py [out.dxf]\nimport sys\nimport ezdxf\n\nSCALE = 0.3225734265734338\nPAGE = [297.0, 210.0]\n\nVISIBLE_SEGMENTS = [\n (112.642971, 70.014371, 111.634929, 70.014371),\n (111.634929, 70.014371, 110.626887, 70.014371),\n (110.626887, 70.014371, 109.618845, 70.014371),\n (109.618845, 70.014371, 108.610803, 70.014371),\n (108.610803, 70.014371, 107.602762, 70.014371),\n (107.602762, 70.014371, 106.59472, 70.014371),\n (106.59472, 70.014371, 105.586678, 70.014371),\n (105.586678, 70.014371, 104.578636, 70.014371),\n (104.578636, 70.014371, 103.570594, 70.014371),\n (103.570594, 70.014371, 102.562552, 70.014371),\n (102.562552, 70.014371, 101.55451, 70.014371),\n (101.55451, 70.014371, 100.546468, 70.014371),\n (100.546468, 70.014371, 99.538426, 70.014371),\n (99.538426, 70.014371, 98.530384, 70.014371),\n (98.530384, 70.014371, 97.522342, 70.014371),\n (97.522342, 70.014371, 96.5143, 70.014371),\n (96.5143, 70.014371, 95.506258, 70.014371),\n (95.506258, 70.014371, 94.498216, 70.014371),\n (94.498216, 70.014371, 93.490174, 70.014371),\n (93.490174, 70.014371, 92.482132, 70.014371),\n (92.482132, 70.014371, 91.47409, 70.014371),\n (91.47409, 70.014371, 90.466048, 70.014371),\n (90.466048, 70.014371, 89.458006, 70.014371),\n (89.458006, 70.014371, 88.449964, 70.014371),\n (88.449964, 70.014371, 87.441922, 70.014371),\n (87.441922, 70.014371, 86.43388, 70.014371),\n (86.43388, 70.014371, 85.425838, 70.014371),\n (85.425838, 70.014371, 84.417797, 70.014371),\n (84.417797, 70.014371, 83.409755, 70.014371),\n (83.409755, 70.014371, 82.401713, 70.014371),\n (82.401713, 70.014371, 81.393671, 70.014371),\n (81.393671, 70.014371, 80.385629, 70.014371),\n (112.642971, 70.014371, 112.642971, 133.857028),\n (112.642971, 133.857028, 111.634929, 133.857028),\n (111.634929, 133.857028, 110.626887, 133.857028),\n (110.626887, 133.857028, 109.618845, 133.857028),\n (109.618845, 133.857028, 108.610803, 133.857028),\n (108.610803, 133.857028, 107.602762, 133.857028),\n (107.602762, 133.857028, 106.59472, 133.857028),\n (106.59472, 133.857028, 105.586678, 133.857028),\n (105.586678, 133.857028, 104.578636, 133.857028),\n (104.578636, 133.857028, 103.570594, 133.857028),\n (103.570594, 133.857028, 102.562552, 133.857028),\n (102.562552, 133.857028, 101.55451, 133.857028),\n (101.55451, 133.857028, 100.546468, 133.857028),\n (100.546468, 133.857028, 99.538426, 133.857028),\n (99.538426, 133.857028, 98.530384, 133.857028),\n (98.530384, 133.857028, 97.522342, 133.857028),\n (97.522342, 133.857028, 96.5143, 133.857028),\n (96.5143, 133.857028, 95.506258, 133.857028),\n (95.506258, 133.857028, 94.498216, 133.857028),\n (94.498216, 133.857028, 93.490174, 133.857028),\n (93.490174, 133.857028, 92.482132, 133.857028),\n (92.482132, 133.857028, 91.47409, 133.857028),\n (91.47409, 133.857028, 90.466048, 133.857028),\n (90.466048, 133.857028, 89.458006, 133.857028),\n (89.458006, 133.857028, 88.449964, 133.857028),\n (88.449964, 133.857028, 87.441922, 133.857028),\n (87.441922, 133.857028, 86.43388, 133.857028),\n (86.43388, 133.857028, 85.425838, 133.857028),\n (85.425838, 133.857028, 84.417797, 133.857028),\n (84.417797, 133.857028, 83.409755, 133.857028),\n (83.409755, 133.857028, 82.401713, 133.857028),\n (82.401713, 133.857028, 81.393671, 133.857028),\n (81.393671, 133.857028, 80.385629, 133.857028),\n (80.385629, 133.857028, 80.385629, 70.014371),\n (126.642972, 147.857029, 126.642972, 148.865071),\n (126.642972, 148.865071, 126.642972, 149.873113),\n (126.642972, 149.873113, 126.642972, 150.881155),\n (126.642972, 150.881155, 126.642972, 151.889197),\n (126.642972, 151.889197, 126.642972, 152.897238),\n (126.642972, 152.897238, 126.642972, 153.90528),\n (126.642972, 153.90528, 126.642972, 154.913322),\n (126.642972, 154.913322, 126.642972, 155.921364),\n (126.642972, 155.921364, 126.642972, 156.929406),\n (126.642972, 156.929406, 126.642972, 157.937448),\n (126.642972, 157.937448, 126.642972, 158.94549),\n (126.642972, 158.94549, 126.642972, 159.953532),\n (126.642972, 159.953532, 126.642972, 160.961574),\n (126.642972, 160.961574, 126.642972, 161.969616),\n (126.642972, 161.969616, 126.642972, 162.977658),\n (126.642972, 162.977658, 126.642972, 163.9857),\n (126.642972, 163.9857, 126.642972, 164.993742),\n (126.642972, 164.993742, 126.642972, 166.001784),\n (126.642972, 166.001784, 126.642972, 167.009826),\n (126.642972, 167.009826, 126.642972, 168.017868),\n (126.642972, 168.017868, 126.642972, 169.02591),\n (126.642972, 169.02591, 126.642972, 170.033952),\n (126.642972, 170.033952, 126.642972, 171.041994),\n (126.642972, 171.041994, 126.642972, 172.050036),\n (126.642972, 172.050036, 126.642972, 173.058078),\n (126.642972, 173.058078, 126.642972, 174.06612),\n (126.642972, 174.06612, 126.642972, 175.074162),\n (126.642972, 175.074162, 126.642972, 176.082203),\n (126.642972, 176.082203, 126.642972, 177.090245),\n (126.642972, 177.090245, 126.642972, 178.098287),\n (126.642972, 178.098287, 126.642972, 179.106329),\n (126.642972, 179.106329, 126.642972, 180.114371),\n (190.485629, 147.857029, 190.485629, 148.865071),\n (190.485629, 148.865071, 190.485629, 149.873113),\n (190.485629, 149.873113, 190.485629, 150.881155),\n (190.485629, 150.881155, 190.485629, 151.889197),\n (190.485629, 151.889197, 190.485629, 152.897238),\n (190.485629, 152.897238, 190.485629, 153.90528),\n (190.485629, 153.90528, 190.485629, 154.913322),\n (190.485629, 154.913322, 190.485629, 155.921364),\n (190.485629, 155.921364, 190.485629, 156.929406),\n (190.485629, 156.929406, 190.485629, 157.937448),\n (190.485629, 157.937448, 190.485629, 158.94549),\n (190.485629, 158.94549, 190.485629, 159.953532),\n (190.485629, 159.953532, 190.485629, 160.961574),\n (190.485629, 160.961574, 190.485629, 161.969616),\n (190.485629, 161.969616, 190.485629, 162.977658),\n (190.485629, 162.977658, 190.485629, 163.9857),\n (190.485629, 163.9857, 190.485629, 164.993742),\n (190.485629, 164.993742, 190.485629, 166.001784),\n (190.485629, 166.001784, 190.485629, 167.009826),\n (190.485629, 167.009826, 190.485629, 168.017868),\n (190.485629, 168.017868, 190.485629, 169.02591),\n (190.485629, 169.02591, 190.485629, 170.033952),\n (190.485629, 170.033952, 190.485629, 171.041994),\n (190.485629, 171.041994, 190.485629, 172.050036),\n (190.485629, 172.050036, 190.485629, 173.058078),\n (190.485629, 173.058078, 190.485629, 174.06612),\n (190.485629, 174.06612, 190.485629, 175.074162),\n (190.485629, 175.074162, 190.485629, 176.082203),\n (190.485629, 176.082203, 190.485629, 177.090245),\n (190.485629, 177.090245, 190.485629, 178.098287),\n (190.485629, 178.098287, 190.485629, 179.106329),\n (190.485629, 179.106329, 190.485629, 180.114371),\n (190.485629, 147.857029, 126.642972, 147.857029),\n (190.485629, 180.114371, 126.642972, 180.114371)\n]\nVISIBLE_CIRCLES = [\n (96.5143, 163.9857, 16.128671)\n]\nVISIBLE_ARCS = [\n\n]\nHIDDEN_SEGMENTS = [\n\n]\n# (orient, text, p1, p2, base) for linear; (orient, text, center, radius, angle) for diameter\nDIMENSIONS = [\n ('diameter', '%%c100', (96.5143, 163.9857), 16.1287, 45),\n ('horizontal', '197.917', (126.643, 163.9857), (190.4857, 163.9857), (158.5643, 174.9857))\n]\n\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\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\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,\n angle=(0 if d[0] == \"horizontal\" else 90),\n 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,\n text=text, dimstyle=\"EZDXF\").render()\n\n doc.saveas(out_path)\n\n\nif __name__ == \"__main__\":\n out = sys.argv[1] if len(sys.argv) > 1 else \"0001_00010868_gt.dxf\"\n draw(out)\n print(\"wrote\", out)\n```"}], "images": ["images/0001_00010868.png"], "id": "0001_00010868"} {"messages": [{"role": "user", "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 558.82 mm."}, {"role": "assistant", "content": "```python\n#!/usr/bin/env python3\n# -*- coding: utf-8 -*-\n# Ground-truth 2D engineering drawing for part: 0001_00017026\n# Self-contained: reproduces the three-view DXF via ezdxf, NO FreeCAD needed.\n# Coordinates are A4 page millimetres (scale=0.14586607142858576, page=[297.0, 210.0]).\n# visible edges -> solid (layer OUTLINE); hidden edges -> dashed (layer HIDDEN)\n# dimensions -> real movable DIMENSION entities (text = true mm value)\n# Run: python 0001_00017026_gt.py [out.dxf]\nimport sys\nimport ezdxf\n\nSCALE = 0.14586607142858576\nPAGE = [297.0, 210.0]\n\nVISIBLE_SEGMENTS = [\n (84.803396, 147.109996, 85.259228, 147.109996),\n (85.259228, 147.109996, 85.715059, 147.109996),\n (85.715059, 147.109996, 86.170891, 147.109996),\n (86.170891, 147.109996, 86.626722, 147.109996),\n (86.626722, 147.109996, 87.082554, 147.109996),\n (87.082554, 147.109996, 87.538385, 147.109996),\n (87.538385, 147.109996, 87.994217, 147.109996),\n (87.994217, 147.109996, 88.450048, 147.109996),\n (88.450048, 147.109996, 88.90588, 147.109996),\n (88.90588, 147.109996, 89.361711, 147.109996),\n (89.361711, 147.109996, 89.817543, 147.109996),\n (89.817543, 147.109996, 90.273374, 147.109996),\n (90.273374, 147.109996, 90.729206, 147.109996),\n (90.729206, 147.109996, 91.185037, 147.109996),\n (91.185037, 147.109996, 91.640869, 147.109996),\n (91.640869, 147.109996, 92.0967, 147.109996),\n (92.0967, 147.109996, 92.552531, 147.109996),\n (92.552531, 147.109996, 93.008363, 147.109996),\n (93.008363, 147.109996, 93.464194, 147.109996),\n (93.464194, 147.109996, 93.920026, 147.109996),\n (93.920026, 147.109996, 94.375857, 147.109996),\n (94.375857, 147.109996, 94.831689, 147.109996),\n (94.831689, 147.109996, 95.28752, 147.109996),\n (95.28752, 147.109996, 95.743352, 147.109996),\n (95.743352, 147.109996, 96.199183, 147.109996),\n (96.199183, 147.109996, 96.655015, 147.109996),\n (96.655015, 147.109996, 97.110846, 147.109996),\n (97.110846, 147.109996, 97.566678, 147.109996),\n (97.566678, 147.109996, 98.022509, 147.109996),\n (98.022509, 147.109996, 98.478341, 147.109996),\n (98.478341, 147.109996, 98.934172, 147.109996),\n (98.934172, 147.109996, 99.390004, 147.109996),\n (99.390004, 147.109996, 99.390004, 65.596603),\n (84.803396, 65.596603, 85.259228, 65.596603),\n (85.259228, 65.596603, 85.715059, 65.596603),\n (85.715059, 65.596603, 86.170891, 65.596603),\n (86.170891, 65.596603, 86.626722, 65.596603),\n (86.626722, 65.596603, 87.082554, 65.596603),\n (87.082554, 65.596603, 87.538385, 65.596603),\n (87.538385, 65.596603, 87.994217, 65.596603),\n (87.994217, 65.596603, 88.450048, 65.596603),\n (88.450048, 65.596603, 88.90588, 65.596603),\n (88.90588, 65.596603, 89.361711, 65.596603),\n (89.361711, 65.596603, 89.817543, 65.596603),\n (89.817543, 65.596603, 90.273374, 65.596603),\n (90.273374, 65.596603, 90.729206, 65.596603),\n (90.729206, 65.596603, 91.185037, 65.596603),\n (91.185037, 65.596603, 91.640869, 65.596603),\n (91.640869, 65.596603, 92.0967, 65.596603),\n (92.0967, 65.596603, 92.552531, 65.596603),\n (92.552531, 65.596603, 93.008363, 65.596603),\n (93.008363, 65.596603, 93.464194, 65.596603),\n (93.464194, 65.596603, 93.920026, 65.596603),\n (93.920026, 65.596603, 94.375857, 65.596603),\n (94.375857, 65.596603, 94.831689, 65.596603),\n (94.831689, 65.596603, 95.28752, 65.596603),\n (95.28752, 65.596603, 95.743352, 65.596603),\n (95.743352, 65.596603, 96.199183, 65.596603),\n (96.199183, 65.596603, 96.655015, 65.596603),\n (96.655015, 65.596603, 97.110846, 65.596603),\n (97.110846, 65.596603, 97.566678, 65.596603),\n (97.566678, 65.596603, 98.022509, 65.596603),\n (98.022509, 65.596603, 98.478341, 65.596603),\n (98.478341, 65.596603, 98.934172, 65.596603),\n (98.934172, 65.596603, 99.390004, 65.596603),\n (84.803396, 65.596603, 84.803396, 147.109996),\n (194.903397, 175.696604, 194.903397, 175.240772),\n (194.903397, 175.240772, 194.903397, 174.784941),\n (194.903397, 174.784941, 194.903397, 174.329109),\n (194.903397, 174.329109, 194.903397, 173.873278),\n (194.903397, 173.873278, 194.903397, 173.417446),\n (194.903397, 173.417446, 194.903397, 172.961615),\n (194.903397, 172.961615, 194.903397, 172.505783),\n (194.903397, 172.505783, 194.903397, 172.049952),\n (194.903397, 172.049952, 194.903397, 171.59412),\n (194.903397, 171.59412, 194.903397, 171.138289),\n (194.903397, 171.138289, 194.903397, 170.682457),\n (194.903397, 170.682457, 194.903397, 170.226626),\n (194.903397, 170.226626, 194.903397, 169.770794),\n (194.903397, 169.770794, 194.903397, 169.314963),\n (194.903397, 169.314963, 194.903397, 168.859131),\n (194.903397, 168.859131, 194.903397, 168.4033),\n (194.903397, 168.4033, 194.903397, 167.947469),\n (194.903397, 167.947469, 194.903397, 167.491637),\n (194.903397, 167.491637, 194.903397, 167.035806),\n (194.903397, 167.035806, 194.903397, 166.579974),\n (194.903397, 166.579974, 194.903397, 166.124143),\n (194.903397, 166.124143, 194.903397, 165.668311),\n (194.903397, 165.668311, 194.903397, 165.21248),\n (194.903397, 165.21248, 194.903397, 164.756648),\n (194.903397, 164.756648, 194.903397, 164.300817),\n (194.903397, 164.300817, 194.903397, 163.844985),\n (194.903397, 163.844985, 194.903397, 163.389154),\n (194.903397, 163.389154, 194.903397, 162.933322),\n (194.903397, 162.933322, 194.903397, 162.477491),\n (194.903397, 162.477491, 194.903397, 162.021659),\n (194.903397, 162.021659, 194.903397, 161.565828),\n (194.903397, 161.565828, 194.903397, 161.109996),\n (113.390004, 175.696604, 113.390004, 175.240772),\n (113.390004, 175.240772, 113.390004, 174.784941),\n (113.390004, 174.784941, 113.390004, 174.329109),\n (113.390004, 174.329109, 113.390004, 173.873278),\n (113.390004, 173.873278, 113.390004, 173.417446),\n (113.390004, 173.417446, 113.390004, 172.961615),\n (113.390004, 172.961615, 113.390004, 172.505783),\n (113.390004, 172.505783, 113.390004, 172.049952),\n (113.390004, 172.049952, 113.390004, 171.59412),\n (113.390004, 171.59412, 113.390004, 171.138289),\n (113.390004, 171.138289, 113.390004, 170.682457),\n (113.390004, 170.682457, 113.390004, 170.226626),\n (113.390004, 170.226626, 113.390004, 169.770794),\n (113.390004, 169.770794, 113.390004, 169.314963),\n (113.390004, 169.314963, 113.390004, 168.859131),\n (113.390004, 168.859131, 113.390004, 168.4033),\n (113.390004, 168.4033, 113.390004, 167.947469),\n (113.390004, 167.947469, 113.390004, 167.491637),\n (113.390004, 167.491637, 113.390004, 167.035806),\n (113.390004, 167.035806, 113.390004, 166.579974),\n (113.390004, 166.579974, 113.390004, 166.124143),\n (113.390004, 166.124143, 113.390004, 165.668311),\n (113.390004, 165.668311, 113.390004, 165.21248),\n (113.390004, 165.21248, 113.390004, 164.756648),\n (113.390004, 164.756648, 113.390004, 164.300817),\n (113.390004, 164.300817, 113.390004, 163.844985),\n (113.390004, 163.844985, 113.390004, 163.389154),\n (113.390004, 163.389154, 113.390004, 162.933322),\n (113.390004, 162.933322, 113.390004, 162.477491),\n (113.390004, 162.477491, 113.390004, 162.021659),\n (113.390004, 162.021659, 113.390004, 161.565828),\n (113.390004, 161.565828, 113.390004, 161.109996),\n (113.390004, 175.696604, 194.903397, 175.696604),\n (113.390004, 161.109996, 194.903397, 161.109996)\n]\nVISIBLE_CIRCLES = [\n (92.0967, 168.4033, 7.293304)\n]\nVISIBLE_ARCS = [\n\n]\nHIDDEN_SEGMENTS = [\n\n]\n# (orient, text, p1, p2, base) for linear; (orient, text, center, radius, angle) for diameter\nDIMENSIONS = [\n ('diameter', '%%c100', (92.0967, 168.4033), 7.2933, 45),\n ('horizontal', '558.823', (194.9033, 168.4033), (113.39, 168.4033), (154.1467, 157.4033))\n]\n\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\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\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,\n angle=(0 if d[0] == \"horizontal\" else 90),\n 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,\n text=text, dimstyle=\"EZDXF\").render()\n\n doc.saveas(out_path)\n\n\nif __name__ == \"__main__\":\n out = sys.argv[1] if len(sys.argv) > 1 else \"0001_00017026_gt.dxf\"\n draw(out)\n print(\"wrote\", out)\n```"}], "images": ["images/0001_00017026.png"], "id": "0001_00017026"} {"messages": [{"role": "user", "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 250 mm."}, {"role": "assistant", "content": "```python\n#!/usr/bin/env python3\n# -*- coding: utf-8 -*-\n# Ground-truth 2D engineering drawing for part: 0001_00017027\n# Self-contained: reproduces the three-view DXF via ezdxf, NO FreeCAD needed.\n# Coordinates are A4 page millimetres (scale=0.2745714285714286, page=[297.0, 210.0]).\n# visible edges -> solid (layer OUTLINE); hidden edges -> dashed (layer HIDDEN)\n# dimensions -> real movable DIMENSION entities (text = true mm value)\n# Run: python 0001_00017027_gt.py [out.dxf]\nimport sys\nimport ezdxf\n\nSCALE = 0.2745714285714286\nPAGE = [297.0, 210.0]\n\nVISIBLE_SEGMENTS = [\n (109.042871, 68.814271, 108.184836, 68.814271),\n (108.184836, 68.814271, 107.3268, 68.814271),\n (107.3268, 68.814271, 106.468764, 68.814271),\n (106.468764, 68.814271, 105.610729, 68.814271),\n (105.610729, 68.814271, 104.752693, 68.814271),\n (104.752693, 68.814271, 103.894657, 68.814271),\n (103.894657, 68.814271, 103.036621, 68.814271),\n (103.036621, 68.814271, 102.178586, 68.814271),\n (102.178586, 68.814271, 101.32055, 68.814271),\n (101.32055, 68.814271, 100.462514, 68.814271),\n (100.462514, 68.814271, 99.604479, 68.814271),\n (99.604479, 68.814271, 98.746443, 68.814271),\n (98.746443, 68.814271, 97.888407, 68.814271),\n (97.888407, 68.814271, 97.030371, 68.814271),\n (97.030371, 68.814271, 96.172336, 68.814271),\n (96.172336, 68.814271, 95.3143, 68.814271),\n (95.3143, 68.814271, 94.456264, 68.814271),\n (94.456264, 68.814271, 93.598229, 68.814271),\n (93.598229, 68.814271, 92.740193, 68.814271),\n (92.740193, 68.814271, 91.882157, 68.814271),\n (91.882157, 68.814271, 91.024121, 68.814271),\n (91.024121, 68.814271, 90.166086, 68.814271),\n (90.166086, 68.814271, 89.30805, 68.814271),\n (89.30805, 68.814271, 88.450014, 68.814271),\n (88.450014, 68.814271, 87.591979, 68.814271),\n (87.591979, 68.814271, 86.733943, 68.814271),\n (86.733943, 68.814271, 85.875907, 68.814271),\n (85.875907, 68.814271, 85.017871, 68.814271),\n (85.017871, 68.814271, 84.159836, 68.814271),\n (84.159836, 68.814271, 83.3018, 68.814271),\n (83.3018, 68.814271, 82.443764, 68.814271),\n (82.443764, 68.814271, 81.585729, 68.814271),\n (109.042871, 68.814271, 109.042871, 137.457128),\n (109.042871, 137.457128, 108.184836, 137.457128),\n (108.184836, 137.457128, 107.3268, 137.457128),\n (107.3268, 137.457128, 106.468764, 137.457128),\n (106.468764, 137.457128, 105.610729, 137.457128),\n (105.610729, 137.457128, 104.752693, 137.457128),\n (104.752693, 137.457128, 103.894657, 137.457128),\n (103.894657, 137.457128, 103.036621, 137.457128),\n (103.036621, 137.457128, 102.178586, 137.457128),\n (102.178586, 137.457128, 101.32055, 137.457128),\n (101.32055, 137.457128, 100.462514, 137.457128),\n (100.462514, 137.457128, 99.604479, 137.457128),\n (99.604479, 137.457128, 98.746443, 137.457128),\n (98.746443, 137.457128, 97.888407, 137.457128),\n (97.888407, 137.457128, 97.030371, 137.457128),\n (97.030371, 137.457128, 96.172336, 137.457128),\n (96.172336, 137.457128, 95.3143, 137.457128),\n (95.3143, 137.457128, 94.456264, 137.457128),\n (94.456264, 137.457128, 93.598229, 137.457128),\n (93.598229, 137.457128, 92.740193, 137.457128),\n (92.740193, 137.457128, 91.882157, 137.457128),\n (91.882157, 137.457128, 91.024121, 137.457128),\n (91.024121, 137.457128, 90.166086, 137.457128),\n (90.166086, 137.457128, 89.30805, 137.457128),\n (89.30805, 137.457128, 88.450014, 137.457128),\n (88.450014, 137.457128, 87.591979, 137.457128),\n (87.591979, 137.457128, 86.733943, 137.457128),\n (86.733943, 137.457128, 85.875907, 137.457128),\n (85.875907, 137.457128, 85.017871, 137.457128),\n (85.017871, 137.457128, 84.159836, 137.457128),\n (84.159836, 137.457128, 83.3018, 137.457128),\n (83.3018, 137.457128, 82.443764, 137.457128),\n (82.443764, 137.457128, 81.585729, 137.457128),\n (81.585729, 137.457128, 81.585729, 68.814271),\n (123.042872, 151.457129, 123.042872, 152.315164),\n (123.042872, 152.315164, 123.042872, 153.1732),\n (123.042872, 153.1732, 123.042872, 154.031236),\n (123.042872, 154.031236, 123.042872, 154.889271),\n (123.042872, 154.889271, 123.042872, 155.747307),\n (123.042872, 155.747307, 123.042872, 156.605343),\n (123.042872, 156.605343, 123.042872, 157.463379),\n (123.042872, 157.463379, 123.042872, 158.321414),\n (123.042872, 158.321414, 123.042872, 159.17945),\n (123.042872, 159.17945, 123.042872, 160.037486),\n (123.042872, 160.037486, 123.042872, 160.895521),\n (123.042872, 160.895521, 123.042872, 161.753557),\n (123.042872, 161.753557, 123.042872, 162.611593),\n (123.042872, 162.611593, 123.042872, 163.469629),\n (123.042872, 163.469629, 123.042872, 164.327664),\n (123.042872, 164.327664, 123.042872, 165.1857),\n (123.042872, 165.1857, 123.042872, 166.043736),\n (123.042872, 166.043736, 123.042872, 166.901771),\n (123.042872, 166.901771, 123.042872, 167.759807),\n (123.042872, 167.759807, 123.042872, 168.617843),\n (123.042872, 168.617843, 123.042872, 169.475879),\n (123.042872, 169.475879, 123.042872, 170.333914),\n (123.042872, 170.333914, 123.042872, 171.19195),\n (123.042872, 171.19195, 123.042872, 172.049986),\n (123.042872, 172.049986, 123.042872, 172.908021),\n (123.042872, 172.908021, 123.042872, 173.766057),\n (123.042872, 173.766057, 123.042872, 174.624093),\n (123.042872, 174.624093, 123.042872, 175.482129),\n (123.042872, 175.482129, 123.042872, 176.340164),\n (123.042872, 176.340164, 123.042872, 177.1982),\n (123.042872, 177.1982, 123.042872, 178.056236),\n (123.042872, 178.056236, 123.042872, 178.914271),\n (191.685729, 151.457129, 191.685729, 152.315164),\n (191.685729, 152.315164, 191.685729, 153.1732),\n (191.685729, 153.1732, 191.685729, 154.031236),\n (191.685729, 154.031236, 191.685729, 154.889271),\n (191.685729, 154.889271, 191.685729, 155.747307),\n (191.685729, 155.747307, 191.685729, 156.605343),\n (191.685729, 156.605343, 191.685729, 157.463379),\n (191.685729, 157.463379, 191.685729, 158.321414),\n (191.685729, 158.321414, 191.685729, 159.17945),\n (191.685729, 159.17945, 191.685729, 160.037486),\n (191.685729, 160.037486, 191.685729, 160.895521),\n (191.685729, 160.895521, 191.685729, 161.753557),\n (191.685729, 161.753557, 191.685729, 162.611593),\n (191.685729, 162.611593, 191.685729, 163.469629),\n (191.685729, 163.469629, 191.685729, 164.327664),\n (191.685729, 164.327664, 191.685729, 165.1857),\n (191.685729, 165.1857, 191.685729, 166.043736),\n (191.685729, 166.043736, 191.685729, 166.901771),\n (191.685729, 166.901771, 191.685729, 167.759807),\n (191.685729, 167.759807, 191.685729, 168.617843),\n (191.685729, 168.617843, 191.685729, 169.475879),\n (191.685729, 169.475879, 191.685729, 170.333914),\n (191.685729, 170.333914, 191.685729, 171.19195),\n (191.685729, 171.19195, 191.685729, 172.049986),\n (191.685729, 172.049986, 191.685729, 172.908021),\n (191.685729, 172.908021, 191.685729, 173.766057),\n (191.685729, 173.766057, 191.685729, 174.624093),\n (191.685729, 174.624093, 191.685729, 175.482129),\n (191.685729, 175.482129, 191.685729, 176.340164),\n (191.685729, 176.340164, 191.685729, 177.1982),\n (191.685729, 177.1982, 191.685729, 178.056236),\n (191.685729, 178.056236, 191.685729, 178.914271),\n (191.685729, 151.457129, 123.042872, 151.457129),\n (191.685729, 178.914271, 123.042872, 178.914271)\n]\nVISIBLE_CIRCLES = [\n (95.3143, 165.1857, 13.728571)\n]\nVISIBLE_ARCS = [\n\n]\nHIDDEN_SEGMENTS = [\n\n]\n# (orient, text, p1, p2, base) for linear; (orient, text, center, radius, angle) for diameter\nDIMENSIONS = [\n ('diameter', '%%c100', (95.3143, 165.1857), 13.7286, 45),\n ('horizontal', '250', (123.0429, 165.1857), (191.6857, 165.1857), (157.3643, 176.1857))\n]\n\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\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\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,\n angle=(0 if d[0] == \"horizontal\" else 90),\n 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,\n text=text, dimstyle=\"EZDXF\").render()\n\n doc.saveas(out_path)\n\n\nif __name__ == \"__main__\":\n out = sys.argv[1] if len(sys.argv) > 1 else \"0001_00017027_gt.dxf\"\n draw(out)\n print(\"wrote\", out)\n```"}], "images": ["images/0001_00017027.png"], "id": "0001_00017027"} {"messages": [{"role": "user", "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": "assistant", "content": "```python\n#!/usr/bin/env python3\n# -*- coding: utf-8 -*-\n# Ground-truth 2D engineering drawing for part: 0001_00017740\n# Self-contained: reproduces the three-view DXF via ezdxf, NO FreeCAD needed.\n# Coordinates are A4 page millimetres (scale=0.21268032786885335, page=[297.0, 210.0]).\n# visible edges -> solid (layer OUTLINE); hidden edges -> dashed (layer HIDDEN)\n# dimensions -> real movable DIMENSION entities (text = true mm value)\n# Run: python 0001_00017740_gt.py [out.dxf]\nimport sys\nimport ezdxf\n\nSCALE = 0.21268032786885335\nPAGE = [297.0, 210.0]\n\nVISIBLE_SEGMENTS = [\n (104.401016, 67.267016, 103.73639, 67.267016),\n (103.73639, 67.267016, 103.071764, 67.267016),\n (103.071764, 67.267016, 102.407138, 67.267016),\n (102.407138, 67.267016, 101.742512, 67.267016),\n (101.742512, 67.267016, 101.077886, 67.267016),\n (101.077886, 67.267016, 100.41326, 67.267016),\n (100.41326, 67.267016, 99.748634, 67.267016),\n (99.748634, 67.267016, 99.084008, 67.267016),\n (99.084008, 67.267016, 98.419382, 67.267016),\n (98.419382, 67.267016, 97.754756, 67.267016),\n (97.754756, 67.267016, 97.09013, 67.267016),\n (97.09013, 67.267016, 96.425504, 67.267016),\n (96.425504, 67.267016, 95.760878, 67.267016),\n (95.760878, 67.267016, 95.096252, 67.267016),\n (95.096252, 67.267016, 94.431626, 67.267016),\n (94.431626, 67.267016, 93.767, 67.267016),\n (93.767, 67.267016, 93.102374, 67.267016),\n (93.102374, 67.267016, 92.437748, 67.267016),\n (92.437748, 67.267016, 91.773122, 67.267016),\n (91.773122, 67.267016, 91.108496, 67.267016),\n (91.108496, 67.267016, 90.44387, 67.267016),\n (90.44387, 67.267016, 89.779244, 67.267016),\n (89.779244, 67.267016, 89.114618, 67.267016),\n (89.114618, 67.267016, 88.449992, 67.267016),\n (88.449992, 67.267016, 87.785366, 67.267016),\n (87.785366, 67.267016, 87.12074, 67.267016),\n (87.12074, 67.267016, 86.456114, 67.267016),\n (86.456114, 67.267016, 85.791488, 67.267016),\n (85.791488, 67.267016, 85.126862, 67.267016),\n (85.126862, 67.267016, 84.462236, 67.267016),\n (84.462236, 67.267016, 83.79761, 67.267016),\n (83.79761, 67.267016, 83.132984, 67.267016),\n (104.401016, 67.267016, 104.401016, 142.098983),\n (104.401016, 142.098983, 103.73639, 142.098983),\n (103.73639, 142.098983, 103.071764, 142.098983),\n (103.071764, 142.098983, 102.407138, 142.098983),\n (102.407138, 142.098983, 101.742512, 142.098983),\n (101.742512, 142.098983, 101.077886, 142.098983),\n (101.077886, 142.098983, 100.41326, 142.098983),\n (100.41326, 142.098983, 99.748634, 142.098983),\n (99.748634, 142.098983, 99.084008, 142.098983),\n (99.084008, 142.098983, 98.419382, 142.098983),\n (98.419382, 142.098983, 97.754756, 142.098983),\n (97.754756, 142.098983, 97.09013, 142.098983),\n (97.09013, 142.098983, 96.425504, 142.098983),\n (96.425504, 142.098983, 95.760878, 142.098983),\n (95.760878, 142.098983, 95.096252, 142.098983),\n (95.096252, 142.098983, 94.431626, 142.098983),\n (94.431626, 142.098983, 93.767, 142.098983),\n (93.767, 142.098983, 93.102374, 142.098983),\n (93.102374, 142.098983, 92.437748, 142.098983),\n (92.437748, 142.098983, 91.773122, 142.098983),\n (91.773122, 142.098983, 91.108496, 142.098983),\n (91.108496, 142.098983, 90.44387, 142.098983),\n (90.44387, 142.098983, 89.779244, 142.098983),\n (89.779244, 142.098983, 89.114618, 142.098983),\n (89.114618, 142.098983, 88.449992, 142.098983),\n (88.449992, 142.098983, 87.785366, 142.098983),\n (87.785366, 142.098983, 87.12074, 142.098983),\n (87.12074, 142.098983, 86.456114, 142.098983),\n (86.456114, 142.098983, 85.791488, 142.098983),\n (85.791488, 142.098983, 85.126862, 142.098983),\n (85.126862, 142.098983, 84.462236, 142.098983),\n (84.462236, 142.098983, 83.79761, 142.098983),\n (83.79761, 142.098983, 83.132984, 142.098983),\n (83.132984, 142.098983, 83.132984, 67.267016),\n (118.401017, 156.098984, 118.401017, 156.76361),\n (118.401017, 156.76361, 118.401017, 157.428236),\n (118.401017, 157.428236, 118.401017, 158.092862),\n (118.401017, 158.092862, 118.401017, 158.757488),\n (118.401017, 158.757488, 118.401017, 159.422114),\n (118.401017, 159.422114, 118.401017, 160.08674),\n (118.401017, 160.08674, 118.401017, 160.751366),\n (118.401017, 160.751366, 118.401017, 161.415992),\n (118.401017, 161.415992, 118.401017, 162.080618),\n (118.401017, 162.080618, 118.401017, 162.745244),\n (118.401017, 162.745244, 118.401017, 163.40987),\n (118.401017, 163.40987, 118.401017, 164.074496),\n (118.401017, 164.074496, 118.401017, 164.739122),\n (118.401017, 164.739122, 118.401017, 165.403748),\n (118.401017, 165.403748, 118.401017, 166.068374),\n (118.401017, 166.068374, 118.401017, 166.733),\n (118.401017, 166.733, 118.401017, 167.397626),\n (118.401017, 167.397626, 118.401017, 168.062252),\n (118.401017, 168.062252, 118.401017, 168.726878),\n (118.401017, 168.726878, 118.401017, 169.391504),\n (118.401017, 169.391504, 118.401017, 170.05613),\n (118.401017, 170.05613, 118.401017, 170.720756),\n (118.401017, 170.720756, 118.401017, 171.385382),\n (118.401017, 171.385382, 118.401017, 172.050008),\n (118.401017, 172.050008, 118.401017, 172.714634),\n (118.401017, 172.714634, 118.401017, 173.37926),\n (118.401017, 173.37926, 118.401017, 174.043886),\n (118.401017, 174.043886, 118.401017, 174.708512),\n (118.401017, 174.708512, 118.401017, 175.373138),\n (118.401017, 175.373138, 118.401017, 176.037764),\n (118.401017, 176.037764, 118.401017, 176.70239),\n (118.401017, 176.70239, 118.401017, 177.367016),\n (193.232984, 156.098984, 193.232984, 156.76361),\n (193.232984, 156.76361, 193.232984, 157.428236),\n (193.232984, 157.428236, 193.232984, 158.092862),\n (193.232984, 158.092862, 193.232984, 158.757488),\n (193.232984, 158.757488, 193.232984, 159.422114),\n (193.232984, 159.422114, 193.232984, 160.08674),\n (193.232984, 160.08674, 193.232984, 160.751366),\n (193.232984, 160.751366, 193.232984, 161.415992),\n (193.232984, 161.415992, 193.232984, 162.080618),\n (193.232984, 162.080618, 193.232984, 162.745244),\n (193.232984, 162.745244, 193.232984, 163.40987),\n (193.232984, 163.40987, 193.232984, 164.074496),\n (193.232984, 164.074496, 193.232984, 164.739122),\n (193.232984, 164.739122, 193.232984, 165.403748),\n (193.232984, 165.403748, 193.232984, 166.068374),\n (193.232984, 166.068374, 193.232984, 166.733),\n (193.232984, 166.733, 193.232984, 167.397626),\n (193.232984, 167.397626, 193.232984, 168.062252),\n (193.232984, 168.062252, 193.232984, 168.726878),\n (193.232984, 168.726878, 193.232984, 169.391504),\n (193.232984, 169.391504, 193.232984, 170.05613),\n (193.232984, 170.05613, 193.232984, 170.720756),\n (193.232984, 170.720756, 193.232984, 171.385382),\n (193.232984, 171.385382, 193.232984, 172.050008),\n (193.232984, 172.050008, 193.232984, 172.714634),\n (193.232984, 172.714634, 193.232984, 173.37926),\n (193.232984, 173.37926, 193.232984, 174.043886),\n (193.232984, 174.043886, 193.232984, 174.708512),\n (193.232984, 174.708512, 193.232984, 175.373138),\n (193.232984, 175.373138, 193.232984, 176.037764),\n (193.232984, 176.037764, 193.232984, 176.70239),\n (193.232984, 176.70239, 193.232984, 177.367016),\n (193.232984, 156.098984, 118.401017, 156.098984),\n (193.232984, 177.367016, 118.401017, 177.367016)\n]\nVISIBLE_CIRCLES = [\n (93.767, 166.733, 10.634016)\n]\nVISIBLE_ARCS = [\n\n]\nHIDDEN_SEGMENTS = [\n\n]\n# (orient, text, p1, p2, base) for linear; (orient, text, center, radius, angle) for diameter\nDIMENSIONS = [\n ('diameter', '%%c100', (93.767, 166.733), 10.634, 45),\n ('horizontal', '351.852', (118.401, 166.733), (193.233, 166.733), (155.817, 177.733))\n]\n\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\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\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,\n angle=(0 if d[0] == \"horizontal\" else 90),\n 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,\n text=text, dimstyle=\"EZDXF\").render()\n\n doc.saveas(out_path)\n\n\nif __name__ == \"__main__\":\n out = sys.argv[1] if len(sys.argv) > 1 else \"0001_00017740_gt.dxf\"\n draw(out)\n print(\"wrote\", out)\n```"}], "images": ["images/0001_00017740.png"], "id": "0001_00017740"} {"messages": [{"role": "user", "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 179.25 mm."}, {"role": "assistant", "content": "```python\n#!/usr/bin/env python3\n# -*- coding: utf-8 -*-\n# Ground-truth 2D engineering drawing for part: 0003_00037115\n# Self-contained: reproduces the three-view DXF via ezdxf, NO FreeCAD needed.\n# Coordinates are A4 page millimetres (scale=0.3441418918919017, page=[297.0, 210.0]).\n# visible edges -> solid (layer OUTLINE); hidden edges -> dashed (layer HIDDEN)\n# dimensions -> real movable DIMENSION entities (text = true mm value)\n# Run: python 0003_00037115_gt.py [out.dxf]\nimport sys\nimport ezdxf\n\nSCALE = 0.3441418918919017\nPAGE = [297.0, 210.0]\n\nVISIBLE_SEGMENTS = [\n (114.260695, 70.553594, 113.185251, 70.553594),\n (113.185251, 70.553594, 112.109808, 70.553594),\n (112.109808, 70.553594, 111.034364, 70.553594),\n (111.034364, 70.553594, 109.958921, 70.553594),\n (109.958921, 70.553594, 108.883478, 70.553594),\n (108.883478, 70.553594, 107.808034, 70.553594),\n (107.808034, 70.553594, 106.732591, 70.553594),\n (106.732591, 70.553594, 105.657147, 70.553594),\n (105.657147, 70.553594, 104.581704, 70.553594),\n (104.581704, 70.553594, 103.50626, 70.553594),\n (103.50626, 70.553594, 102.430817, 70.553594),\n (102.430817, 70.553594, 101.355374, 70.553594),\n (101.355374, 70.553594, 100.27993, 70.553594),\n (100.27993, 70.553594, 99.204487, 70.553594),\n (99.204487, 70.553594, 98.129043, 70.553594),\n (98.129043, 70.553594, 97.0536, 70.553594),\n (97.0536, 70.553594, 95.978157, 70.553594),\n (95.978157, 70.553594, 94.902713, 70.553594),\n (94.902713, 70.553594, 93.82727, 70.553594),\n (93.82727, 70.553594, 92.751826, 70.553594),\n (92.751826, 70.553594, 91.676383, 70.553594),\n (91.676383, 70.553594, 90.60094, 70.553594),\n (90.60094, 70.553594, 89.525496, 70.553594),\n (89.525496, 70.553594, 88.450053, 70.553594),\n (88.450053, 70.553594, 87.374609, 70.553594),\n (87.374609, 70.553594, 86.299166, 70.553594),\n (86.299166, 70.553594, 85.223722, 70.553594),\n (85.223722, 70.553594, 84.148279, 70.553594),\n (84.148279, 70.553594, 83.072836, 70.553594),\n (83.072836, 70.553594, 81.997392, 70.553594),\n (81.997392, 70.553594, 80.921949, 70.553594),\n (80.921949, 70.553594, 79.846505, 70.553594),\n (114.260695, 70.553594, 114.260695, 132.239405),\n (114.260695, 132.239405, 113.185251, 132.239405),\n (113.185251, 132.239405, 112.109808, 132.239405),\n (112.109808, 132.239405, 111.034364, 132.239405),\n (111.034364, 132.239405, 109.958921, 132.239405),\n (109.958921, 132.239405, 108.883478, 132.239405),\n (108.883478, 132.239405, 107.808034, 132.239405),\n (107.808034, 132.239405, 106.732591, 132.239405),\n (106.732591, 132.239405, 105.657147, 132.239405),\n (105.657147, 132.239405, 104.581704, 132.239405),\n (104.581704, 132.239405, 103.50626, 132.239405),\n (103.50626, 132.239405, 102.430817, 132.239405),\n (102.430817, 132.239405, 101.355374, 132.239405),\n (101.355374, 132.239405, 100.27993, 132.239405),\n (100.27993, 132.239405, 99.204487, 132.239405),\n (99.204487, 132.239405, 98.129043, 132.239405),\n (98.129043, 132.239405, 97.0536, 132.239405),\n (97.0536, 132.239405, 95.978157, 132.239405),\n (95.978157, 132.239405, 94.902713, 132.239405),\n (94.902713, 132.239405, 93.82727, 132.239405),\n (93.82727, 132.239405, 92.751826, 132.239405),\n (92.751826, 132.239405, 91.676383, 132.239405),\n (91.676383, 132.239405, 90.60094, 132.239405),\n (90.60094, 132.239405, 89.525496, 132.239405),\n (89.525496, 132.239405, 88.450053, 132.239405),\n (88.450053, 132.239405, 87.374609, 132.239405),\n (87.374609, 132.239405, 86.299166, 132.239405),\n (86.299166, 132.239405, 85.223722, 132.239405),\n (85.223722, 132.239405, 84.148279, 132.239405),\n (84.148279, 132.239405, 83.072836, 132.239405),\n (83.072836, 132.239405, 81.997392, 132.239405),\n (81.997392, 132.239405, 80.921949, 132.239405),\n (80.921949, 132.239405, 79.846505, 132.239405),\n (79.846505, 132.239405, 79.846505, 70.553594),\n (128.260695, 146.239405, 128.260695, 147.314849),\n (128.260695, 147.314849, 128.260695, 148.390292),\n (128.260695, 148.390292, 128.260695, 149.465736),\n (128.260695, 149.465736, 128.260695, 150.541179),\n (128.260695, 150.541179, 128.260695, 151.616622),\n (128.260695, 151.616622, 128.260695, 152.692066),\n (128.260695, 152.692066, 128.260695, 153.767509),\n (128.260695, 153.767509, 128.260695, 154.842953),\n (128.260695, 154.842953, 128.260695, 155.918396),\n (128.260695, 155.918396, 128.260695, 156.99384),\n (128.260695, 156.99384, 128.260695, 158.069283),\n (128.260695, 158.069283, 128.260695, 159.144726),\n (128.260695, 159.144726, 128.260695, 160.22017),\n (128.260695, 160.22017, 128.260695, 161.295613),\n (128.260695, 161.295613, 128.260695, 162.371057),\n (128.260695, 162.371057, 128.260695, 163.4465),\n (128.260695, 163.4465, 128.260695, 164.521943),\n (128.260695, 164.521943, 128.260695, 165.597387),\n (128.260695, 165.597387, 128.260695, 166.67283),\n (128.260695, 166.67283, 128.260695, 167.748274),\n (128.260695, 167.748274, 128.260695, 168.823717),\n (128.260695, 168.823717, 128.260695, 169.89916),\n (128.260695, 169.89916, 128.260695, 170.974604),\n (128.260695, 170.974604, 128.260695, 172.050047),\n (128.260695, 172.050047, 128.260695, 173.125491),\n (128.260695, 173.125491, 128.260695, 174.200934),\n (128.260695, 174.200934, 128.260695, 175.276378),\n (128.260695, 175.276378, 128.260695, 176.351821),\n (128.260695, 176.351821, 128.260695, 177.427264),\n (128.260695, 177.427264, 128.260695, 178.502708),\n (128.260695, 178.502708, 128.260695, 179.578151),\n (128.260695, 179.578151, 128.260695, 180.653595),\n (189.946506, 146.239405, 189.946506, 147.314849),\n (189.946506, 147.314849, 189.946506, 148.390292),\n (189.946506, 148.390292, 189.946506, 149.465736),\n (189.946506, 149.465736, 189.946506, 150.541179),\n (189.946506, 150.541179, 189.946506, 151.616622),\n (189.946506, 151.616622, 189.946506, 152.692066),\n (189.946506, 152.692066, 189.946506, 153.767509),\n (189.946506, 153.767509, 189.946506, 154.842953),\n (189.946506, 154.842953, 189.946506, 155.918396),\n (189.946506, 155.918396, 189.946506, 156.99384),\n (189.946506, 156.99384, 189.946506, 158.069283),\n (189.946506, 158.069283, 189.946506, 159.144726),\n (189.946506, 159.144726, 189.946506, 160.22017),\n (189.946506, 160.22017, 189.946506, 161.295613),\n (189.946506, 161.295613, 189.946506, 162.371057),\n (189.946506, 162.371057, 189.946506, 163.4465),\n (189.946506, 163.4465, 189.946506, 164.521943),\n (189.946506, 164.521943, 189.946506, 165.597387),\n (189.946506, 165.597387, 189.946506, 166.67283),\n (189.946506, 166.67283, 189.946506, 167.748274),\n (189.946506, 167.748274, 189.946506, 168.823717),\n (189.946506, 168.823717, 189.946506, 169.89916),\n (189.946506, 169.89916, 189.946506, 170.974604),\n (189.946506, 170.974604, 189.946506, 172.050047),\n (189.946506, 172.050047, 189.946506, 173.125491),\n (189.946506, 173.125491, 189.946506, 174.200934),\n (189.946506, 174.200934, 189.946506, 175.276378),\n (189.946506, 175.276378, 189.946506, 176.351821),\n (189.946506, 176.351821, 189.946506, 177.427264),\n (189.946506, 177.427264, 189.946506, 178.502708),\n (189.946506, 178.502708, 189.946506, 179.578151),\n (189.946506, 179.578151, 189.946506, 180.653595),\n (189.946506, 146.239405, 128.260695, 146.239405),\n (189.946506, 180.653595, 128.260695, 180.653595)\n]\nVISIBLE_CIRCLES = [\n (97.0536, 163.4465, 17.207095)\n]\nVISIBLE_ARCS = [\n\n]\nHIDDEN_SEGMENTS = [\n\n]\n# (orient, text, p1, p2, base) for linear; (orient, text, center, radius, angle) for diameter\nDIMENSIONS = [\n ('diameter', '%%c100', (97.0536, 163.4465), 17.2071, 45),\n ('horizontal', '179.245', (128.2606, 163.4465), (189.9465, 163.4465), (159.1036, 174.4465))\n]\n\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\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\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,\n angle=(0 if d[0] == \"horizontal\" else 90),\n 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,\n text=text, dimstyle=\"EZDXF\").render()\n\n doc.saveas(out_path)\n\n\nif __name__ == \"__main__\":\n out = sys.argv[1] if len(sys.argv) > 1 else \"0003_00037115_gt.dxf\"\n draw(out)\n print(\"wrote\", out)\n```"}], "images": ["images/0003_00037115.png"], "id": "0003_00037115"} {"messages": [{"role": "user", "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": "assistant", "content": "```python\n#!/usr/bin/env python3\n# -*- coding: utf-8 -*-\n# Ground-truth 2D engineering drawing for part: 0007_00075232\n# Self-contained: reproduces the three-view DXF via ezdxf, NO FreeCAD needed.\n# Coordinates are A4 page millimetres (scale=0.21268032786885335, page=[297.0, 210.0]).\n# visible edges -> solid (layer OUTLINE); hidden edges -> dashed (layer HIDDEN)\n# dimensions -> real movable DIMENSION entities (text = true mm value)\n# Run: python 0007_00075232_gt.py [out.dxf]\nimport sys\nimport ezdxf\n\nSCALE = 0.21268032786885335\nPAGE = [297.0, 210.0]\n\nVISIBLE_SEGMENTS = [\n (104.401016, 67.267016, 103.73639, 67.267016),\n (103.73639, 67.267016, 103.071764, 67.267016),\n (103.071764, 67.267016, 102.407138, 67.267016),\n (102.407138, 67.267016, 101.742512, 67.267016),\n (101.742512, 67.267016, 101.077886, 67.267016),\n (101.077886, 67.267016, 100.41326, 67.267016),\n (100.41326, 67.267016, 99.748634, 67.267016),\n (99.748634, 67.267016, 99.084008, 67.267016),\n (99.084008, 67.267016, 98.419382, 67.267016),\n (98.419382, 67.267016, 97.754756, 67.267016),\n (97.754756, 67.267016, 97.09013, 67.267016),\n (97.09013, 67.267016, 96.425504, 67.267016),\n (96.425504, 67.267016, 95.760878, 67.267016),\n (95.760878, 67.267016, 95.096252, 67.267016),\n (95.096252, 67.267016, 94.431626, 67.267016),\n (94.431626, 67.267016, 93.767, 67.267016),\n (93.767, 67.267016, 93.102374, 67.267016),\n (93.102374, 67.267016, 92.437748, 67.267016),\n (92.437748, 67.267016, 91.773122, 67.267016),\n (91.773122, 67.267016, 91.108496, 67.267016),\n (91.108496, 67.267016, 90.44387, 67.267016),\n (90.44387, 67.267016, 89.779244, 67.267016),\n (89.779244, 67.267016, 89.114618, 67.267016),\n (89.114618, 67.267016, 88.449992, 67.267016),\n (88.449992, 67.267016, 87.785366, 67.267016),\n (87.785366, 67.267016, 87.12074, 67.267016),\n (87.12074, 67.267016, 86.456114, 67.267016),\n (86.456114, 67.267016, 85.791488, 67.267016),\n (85.791488, 67.267016, 85.126862, 67.267016),\n (85.126862, 67.267016, 84.462236, 67.267016),\n (84.462236, 67.267016, 83.79761, 67.267016),\n (83.79761, 67.267016, 83.132984, 67.267016),\n (104.401016, 67.267016, 104.401016, 142.098983),\n (104.401016, 142.098983, 103.73639, 142.098983),\n (103.73639, 142.098983, 103.071764, 142.098983),\n (103.071764, 142.098983, 102.407138, 142.098983),\n (102.407138, 142.098983, 101.742512, 142.098983),\n (101.742512, 142.098983, 101.077886, 142.098983),\n (101.077886, 142.098983, 100.41326, 142.098983),\n (100.41326, 142.098983, 99.748634, 142.098983),\n (99.748634, 142.098983, 99.084008, 142.098983),\n (99.084008, 142.098983, 98.419382, 142.098983),\n (98.419382, 142.098983, 97.754756, 142.098983),\n (97.754756, 142.098983, 97.09013, 142.098983),\n (97.09013, 142.098983, 96.425504, 142.098983),\n (96.425504, 142.098983, 95.760878, 142.098983),\n (95.760878, 142.098983, 95.096252, 142.098983),\n (95.096252, 142.098983, 94.431626, 142.098983),\n (94.431626, 142.098983, 93.767, 142.098983),\n (93.767, 142.098983, 93.102374, 142.098983),\n (93.102374, 142.098983, 92.437748, 142.098983),\n (92.437748, 142.098983, 91.773122, 142.098983),\n (91.773122, 142.098983, 91.108496, 142.098983),\n (91.108496, 142.098983, 90.44387, 142.098983),\n (90.44387, 142.098983, 89.779244, 142.098983),\n (89.779244, 142.098983, 89.114618, 142.098983),\n (89.114618, 142.098983, 88.449992, 142.098983),\n (88.449992, 142.098983, 87.785366, 142.098983),\n (87.785366, 142.098983, 87.12074, 142.098983),\n (87.12074, 142.098983, 86.456114, 142.098983),\n (86.456114, 142.098983, 85.791488, 142.098983),\n (85.791488, 142.098983, 85.126862, 142.098983),\n (85.126862, 142.098983, 84.462236, 142.098983),\n (84.462236, 142.098983, 83.79761, 142.098983),\n (83.79761, 142.098983, 83.132984, 142.098983),\n (83.132984, 142.098983, 83.132984, 67.267016),\n (118.401017, 156.098984, 118.401017, 156.76361),\n (118.401017, 156.76361, 118.401017, 157.428236),\n (118.401017, 157.428236, 118.401017, 158.092862),\n (118.401017, 158.092862, 118.401017, 158.757488),\n (118.401017, 158.757488, 118.401017, 159.422114),\n (118.401017, 159.422114, 118.401017, 160.08674),\n (118.401017, 160.08674, 118.401017, 160.751366),\n (118.401017, 160.751366, 118.401017, 161.415992),\n (118.401017, 161.415992, 118.401017, 162.080618),\n (118.401017, 162.080618, 118.401017, 162.745244),\n (118.401017, 162.745244, 118.401017, 163.40987),\n (118.401017, 163.40987, 118.401017, 164.074496),\n (118.401017, 164.074496, 118.401017, 164.739122),\n (118.401017, 164.739122, 118.401017, 165.403748),\n (118.401017, 165.403748, 118.401017, 166.068374),\n (118.401017, 166.068374, 118.401017, 166.733),\n (118.401017, 166.733, 118.401017, 167.397626),\n (118.401017, 167.397626, 118.401017, 168.062252),\n (118.401017, 168.062252, 118.401017, 168.726878),\n (118.401017, 168.726878, 118.401017, 169.391504),\n (118.401017, 169.391504, 118.401017, 170.05613),\n (118.401017, 170.05613, 118.401017, 170.720756),\n (118.401017, 170.720756, 118.401017, 171.385382),\n (118.401017, 171.385382, 118.401017, 172.050008),\n (118.401017, 172.050008, 118.401017, 172.714634),\n (118.401017, 172.714634, 118.401017, 173.37926),\n (118.401017, 173.37926, 118.401017, 174.043886),\n (118.401017, 174.043886, 118.401017, 174.708512),\n (118.401017, 174.708512, 118.401017, 175.373138),\n (118.401017, 175.373138, 118.401017, 176.037764),\n (118.401017, 176.037764, 118.401017, 176.70239),\n (118.401017, 176.70239, 118.401017, 177.367016),\n (193.232984, 156.098984, 193.232984, 156.76361),\n (193.232984, 156.76361, 193.232984, 157.428236),\n (193.232984, 157.428236, 193.232984, 158.092862),\n (193.232984, 158.092862, 193.232984, 158.757488),\n (193.232984, 158.757488, 193.232984, 159.422114),\n (193.232984, 159.422114, 193.232984, 160.08674),\n (193.232984, 160.08674, 193.232984, 160.751366),\n (193.232984, 160.751366, 193.232984, 161.415992),\n (193.232984, 161.415992, 193.232984, 162.080618),\n (193.232984, 162.080618, 193.232984, 162.745244),\n (193.232984, 162.745244, 193.232984, 163.40987),\n (193.232984, 163.40987, 193.232984, 164.074496),\n (193.232984, 164.074496, 193.232984, 164.739122),\n (193.232984, 164.739122, 193.232984, 165.403748),\n (193.232984, 165.403748, 193.232984, 166.068374),\n (193.232984, 166.068374, 193.232984, 166.733),\n (193.232984, 166.733, 193.232984, 167.397626),\n (193.232984, 167.397626, 193.232984, 168.062252),\n (193.232984, 168.062252, 193.232984, 168.726878),\n (193.232984, 168.726878, 193.232984, 169.391504),\n (193.232984, 169.391504, 193.232984, 170.05613),\n (193.232984, 170.05613, 193.232984, 170.720756),\n (193.232984, 170.720756, 193.232984, 171.385382),\n (193.232984, 171.385382, 193.232984, 172.050008),\n (193.232984, 172.050008, 193.232984, 172.714634),\n (193.232984, 172.714634, 193.232984, 173.37926),\n (193.232984, 173.37926, 193.232984, 174.043886),\n (193.232984, 174.043886, 193.232984, 174.708512),\n (193.232984, 174.708512, 193.232984, 175.373138),\n (193.232984, 175.373138, 193.232984, 176.037764),\n (193.232984, 176.037764, 193.232984, 176.70239),\n (193.232984, 176.70239, 193.232984, 177.367016),\n (193.232984, 156.098984, 118.401017, 156.098984),\n (193.232984, 177.367016, 118.401017, 177.367016)\n]\nVISIBLE_CIRCLES = [\n (93.767, 166.733, 10.634016)\n]\nVISIBLE_ARCS = [\n\n]\nHIDDEN_SEGMENTS = [\n\n]\n# (orient, text, p1, p2, base) for linear; (orient, text, center, radius, angle) for diameter\nDIMENSIONS = [\n ('diameter', '%%c100', (93.767, 166.733), 10.634, 45),\n ('horizontal', '351.852', (118.401, 166.733), (193.233, 166.733), (155.817, 177.733))\n]\n\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\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\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,\n angle=(0 if d[0] == \"horizontal\" else 90),\n 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,\n text=text, dimstyle=\"EZDXF\").render()\n\n doc.saveas(out_path)\n\n\nif __name__ == \"__main__\":\n out = sys.argv[1] if len(sys.argv) > 1 else \"0007_00075232_gt.dxf\"\n draw(out)\n print(\"wrote\", out)\n```"}], "images": ["images/0007_00075232.png"], "id": "0007_00075232"} {"messages": [{"role": "user", "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 306.45 mm."}, {"role": "assistant", "content": "```python\n#!/usr/bin/env python3\n# -*- coding: utf-8 -*-\n# Ground-truth 2D engineering drawing for part: 0007_00079116\n# Self-contained: reproduces the three-view DXF via ezdxf, NO FreeCAD needed.\n# Coordinates are A4 page millimetres (scale=0.23643650793652296, page=[297.0, 210.0]).\n# visible edges -> solid (layer OUTLINE); hidden edges -> dashed (layer HIDDEN)\n# dimensions -> real movable DIMENSION entities (text = true mm value)\n# Run: python 0007_00079116_gt.py [out.dxf]\nimport sys\nimport ezdxf\n\nSCALE = 0.23643650793652296\nPAGE = [297.0, 210.0]\n\nVISIBLE_SEGMENTS = [\n (82.539075, 140.317274, 83.277939, 140.317274),\n (83.277939, 140.317274, 84.016803, 140.317274),\n (84.016803, 140.317274, 84.755667, 140.317274),\n (84.755667, 140.317274, 85.494531, 140.317274),\n (85.494531, 140.317274, 86.233395, 140.317274),\n (86.233395, 140.317274, 86.972259, 140.317274),\n (86.972259, 140.317274, 87.711123, 140.317274),\n (87.711123, 140.317274, 88.449987, 140.317274),\n (88.449987, 140.317274, 89.188851, 140.317274),\n (89.188851, 140.317274, 89.927715, 140.317274),\n (89.927715, 140.317274, 90.66658, 140.317274),\n (90.66658, 140.317274, 91.405444, 140.317274),\n (91.405444, 140.317274, 92.144308, 140.317274),\n (92.144308, 140.317274, 92.883172, 140.317274),\n (92.883172, 140.317274, 93.622036, 140.317274),\n (93.622036, 140.317274, 94.3609, 140.317274),\n (94.3609, 140.317274, 95.099764, 140.317274),\n (95.099764, 140.317274, 95.838628, 140.317274),\n (95.838628, 140.317274, 96.577492, 140.317274),\n (96.577492, 140.317274, 97.316356, 140.317274),\n (97.316356, 140.317274, 98.05522, 140.317274),\n (98.05522, 140.317274, 98.794085, 140.317274),\n (98.794085, 140.317274, 99.532949, 140.317274),\n (99.532949, 140.317274, 100.271813, 140.317274),\n (100.271813, 140.317274, 101.010677, 140.317274),\n (101.010677, 140.317274, 101.749541, 140.317274),\n (101.749541, 140.317274, 102.488405, 140.317274),\n (102.488405, 140.317274, 103.227269, 140.317274),\n (103.227269, 140.317274, 103.966133, 140.317274),\n (103.966133, 140.317274, 104.704997, 140.317274),\n (104.704997, 140.317274, 105.443861, 140.317274),\n (105.443861, 140.317274, 106.182725, 140.317274),\n (106.182725, 140.317274, 106.182725, 67.860925),\n (82.539075, 67.860925, 83.277939, 67.860925),\n (83.277939, 67.860925, 84.016803, 67.860925),\n (84.016803, 67.860925, 84.755667, 67.860925),\n (84.755667, 67.860925, 85.494531, 67.860925),\n (85.494531, 67.860925, 86.233395, 67.860925),\n (86.233395, 67.860925, 86.972259, 67.860925),\n (86.972259, 67.860925, 87.711123, 67.860925),\n (87.711123, 67.860925, 88.449987, 67.860925),\n (88.449987, 67.860925, 89.188851, 67.860925),\n (89.188851, 67.860925, 89.927715, 67.860925),\n (89.927715, 67.860925, 90.66658, 67.860925),\n (90.66658, 67.860925, 91.405444, 67.860925),\n (91.405444, 67.860925, 92.144308, 67.860925),\n (92.144308, 67.860925, 92.883172, 67.860925),\n (92.883172, 67.860925, 93.622036, 67.860925),\n (93.622036, 67.860925, 94.3609, 67.860925),\n (94.3609, 67.860925, 95.099764, 67.860925),\n (95.099764, 67.860925, 95.838628, 67.860925),\n (95.838628, 67.860925, 96.577492, 67.860925),\n (96.577492, 67.860925, 97.316356, 67.860925),\n (97.316356, 67.860925, 98.05522, 67.860925),\n (98.05522, 67.860925, 98.794085, 67.860925),\n (98.794085, 67.860925, 99.532949, 67.860925),\n (99.532949, 67.860925, 100.271813, 67.860925),\n (100.271813, 67.860925, 101.010677, 67.860925),\n (101.010677, 67.860925, 101.749541, 67.860925),\n (101.749541, 67.860925, 102.488405, 67.860925),\n (102.488405, 67.860925, 103.227269, 67.860925),\n (103.227269, 67.860925, 103.966133, 67.860925),\n (103.966133, 67.860925, 104.704997, 67.860925),\n (104.704997, 67.860925, 105.443861, 67.860925),\n (105.443861, 67.860925, 106.182725, 67.860925),\n (82.539075, 67.860925, 82.539075, 140.317274),\n (192.639075, 177.960925, 192.639075, 177.222061),\n (192.639075, 177.222061, 192.639075, 176.483197),\n (192.639075, 176.483197, 192.639075, 175.744333),\n (192.639075, 175.744333, 192.639075, 175.005469),\n (192.639075, 175.005469, 192.639075, 174.266605),\n (192.639075, 174.266605, 192.639075, 173.527741),\n (192.639075, 173.527741, 192.639075, 172.788877),\n (192.639075, 172.788877, 192.639075, 172.050013),\n (192.639075, 172.050013, 192.639075, 171.311149),\n (192.639075, 171.311149, 192.639075, 170.572285),\n (192.639075, 170.572285, 192.639075, 169.83342),\n (192.639075, 169.83342, 192.639075, 169.094556),\n (192.639075, 169.094556, 192.639075, 168.355692),\n (192.639075, 168.355692, 192.639075, 167.616828),\n (192.639075, 167.616828, 192.639075, 166.877964),\n (192.639075, 166.877964, 192.639075, 166.1391),\n (192.639075, 166.1391, 192.639075, 165.400236),\n (192.639075, 165.400236, 192.639075, 164.661372),\n (192.639075, 164.661372, 192.639075, 163.922508),\n (192.639075, 163.922508, 192.639075, 163.183644),\n (192.639075, 163.183644, 192.639075, 162.44478),\n (192.639075, 162.44478, 192.639075, 161.705915),\n (192.639075, 161.705915, 192.639075, 160.967051),\n (192.639075, 160.967051, 192.639075, 160.228187),\n (192.639075, 160.228187, 192.639075, 159.489323),\n (192.639075, 159.489323, 192.639075, 158.750459),\n (192.639075, 158.750459, 192.639075, 158.011595),\n (192.639075, 158.011595, 192.639075, 157.272731),\n (192.639075, 157.272731, 192.639075, 156.533867),\n (192.639075, 156.533867, 192.639075, 155.795003),\n (192.639075, 155.795003, 192.639075, 155.056139),\n (192.639075, 155.056139, 192.639075, 154.317275),\n (120.182726, 177.960925, 120.182726, 177.222061),\n (120.182726, 177.222061, 120.182726, 176.483197),\n (120.182726, 176.483197, 120.182726, 175.744333),\n (120.182726, 175.744333, 120.182726, 175.005469),\n (120.182726, 175.005469, 120.182726, 174.266605),\n (120.182726, 174.266605, 120.182726, 173.527741),\n (120.182726, 173.527741, 120.182726, 172.788877),\n (120.182726, 172.788877, 120.182726, 172.050013),\n (120.182726, 172.050013, 120.182726, 171.311149),\n (120.182726, 171.311149, 120.182726, 170.572285),\n (120.182726, 170.572285, 120.182726, 169.83342),\n (120.182726, 169.83342, 120.182726, 169.094556),\n (120.182726, 169.094556, 120.182726, 168.355692),\n (120.182726, 168.355692, 120.182726, 167.616828),\n (120.182726, 167.616828, 120.182726, 166.877964),\n (120.182726, 166.877964, 120.182726, 166.1391),\n (120.182726, 166.1391, 120.182726, 165.400236),\n (120.182726, 165.400236, 120.182726, 164.661372),\n (120.182726, 164.661372, 120.182726, 163.922508),\n (120.182726, 163.922508, 120.182726, 163.183644),\n (120.182726, 163.183644, 120.182726, 162.44478),\n (120.182726, 162.44478, 120.182726, 161.705915),\n (120.182726, 161.705915, 120.182726, 160.967051),\n (120.182726, 160.967051, 120.182726, 160.228187),\n (120.182726, 160.228187, 120.182726, 159.489323),\n (120.182726, 159.489323, 120.182726, 158.750459),\n (120.182726, 158.750459, 120.182726, 158.011595),\n (120.182726, 158.011595, 120.182726, 157.272731),\n (120.182726, 157.272731, 120.182726, 156.533867),\n (120.182726, 156.533867, 120.182726, 155.795003),\n (120.182726, 155.795003, 120.182726, 155.056139),\n (120.182726, 155.056139, 120.182726, 154.317275),\n (120.182726, 177.960925, 192.639075, 177.960925),\n (120.182726, 154.317275, 192.639075, 154.317275)\n]\nVISIBLE_CIRCLES = [\n (94.3609, 166.1391, 11.821825)\n]\nVISIBLE_ARCS = [\n\n]\nHIDDEN_SEGMENTS = [\n\n]\n# (orient, text, p1, p2, base) for linear; (orient, text, center, radius, angle) for diameter\nDIMENSIONS = [\n ('diameter', '%%c100', (94.3609, 166.1391), 11.8218, 45),\n ('horizontal', '306.452', (192.6391, 166.1391), (120.1827, 166.1391), (156.4109, 155.1391))\n]\n\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\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\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,\n angle=(0 if d[0] == \"horizontal\" else 90),\n 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,\n text=text, dimstyle=\"EZDXF\").render()\n\n doc.saveas(out_path)\n\n\nif __name__ == \"__main__\":\n out = sys.argv[1] if len(sys.argv) > 1 else \"0007_00079116_gt.dxf\"\n draw(out)\n print(\"wrote\", out)\n```"}], "images": ["images/0007_00079116.png"], "id": "0007_00079116"} {"messages": [{"role": "user", "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 19.07 mm."}, {"role": "assistant", "content": "```python\n#!/usr/bin/env python3\n# -*- coding: utf-8 -*-\n# Ground-truth 2D engineering drawing for part: 0008_00082564\n# Self-contained: reproduces the three-view DXF via ezdxf, NO FreeCAD needed.\n# Coordinates are A4 page millimetres (scale=0.807087620175879, page=[297.0, 210.0]).\n# visible edges -> solid (layer OUTLINE); hidden edges -> dashed (layer HIDDEN)\n# dimensions -> real movable DIMENSION entities (text = true mm value)\n# Run: python 0008_00082564_gt.py [out.dxf]\nimport sys\nimport ezdxf\n\nSCALE = 0.807087620175879\nPAGE = [297.0, 210.0]\n\nVISIBLE_SEGMENTS = [\n (148.981581, 82.127181, 146.459432, 82.127181),\n (146.459432, 82.127181, 143.937283, 82.127181),\n (143.937283, 82.127181, 141.415135, 82.127181),\n (141.415135, 82.127181, 138.892986, 82.127181),\n (138.892986, 82.127181, 136.370837, 82.127181),\n (136.370837, 82.127181, 133.848688, 82.127181),\n (133.848688, 82.127181, 131.326539, 82.127181),\n (131.326539, 82.127181, 128.804391, 82.127181),\n (128.804391, 82.127181, 126.282242, 82.127181),\n (126.282242, 82.127181, 123.760093, 82.127181),\n (123.760093, 82.127181, 121.237944, 82.127181),\n (121.237944, 82.127181, 118.715795, 82.127181),\n (118.715795, 82.127181, 116.193646, 82.127181),\n (116.193646, 82.127181, 113.671498, 82.127181),\n (113.671498, 82.127181, 111.149349, 82.127181),\n (111.149349, 82.127181, 108.6272, 82.127181),\n (108.6272, 82.127181, 106.105051, 82.127181),\n (106.105051, 82.127181, 103.582902, 82.127181),\n (103.582902, 82.127181, 101.060754, 82.127181),\n (101.060754, 82.127181, 98.538605, 82.127181),\n (98.538605, 82.127181, 96.016456, 82.127181),\n (96.016456, 82.127181, 93.494307, 82.127181),\n (93.494307, 82.127181, 90.972158, 82.127181),\n (90.972158, 82.127181, 88.450009, 82.127181),\n (88.450009, 82.127181, 85.927861, 82.127181),\n (85.927861, 82.127181, 83.405712, 82.127181),\n (83.405712, 82.127181, 80.883563, 82.127181),\n (80.883563, 82.127181, 78.361414, 82.127181),\n (78.361414, 82.127181, 75.839265, 82.127181),\n (75.839265, 82.127181, 73.317117, 82.127181),\n (73.317117, 82.127181, 70.794968, 82.127181),\n (70.794968, 82.127181, 68.272819, 82.127181),\n (148.981581, 82.127181, 148.981581, 97.518419),\n (148.981581, 97.518419, 146.459432, 97.518419),\n (146.459432, 97.518419, 143.937283, 97.518419),\n (143.937283, 97.518419, 141.415135, 97.518419),\n (141.415135, 97.518419, 138.892986, 97.518419),\n (138.892986, 97.518419, 136.370837, 97.518419),\n (136.370837, 97.518419, 133.848688, 97.518419),\n (133.848688, 97.518419, 131.326539, 97.518419),\n (131.326539, 97.518419, 128.804391, 97.518419),\n (128.804391, 97.518419, 126.282242, 97.518419),\n (126.282242, 97.518419, 123.760093, 97.518419),\n (123.760093, 97.518419, 121.237944, 97.518419),\n (121.237944, 97.518419, 118.715795, 97.518419),\n (118.715795, 97.518419, 116.193646, 97.518419),\n (116.193646, 97.518419, 113.671498, 97.518419),\n (113.671498, 97.518419, 111.149349, 97.518419),\n (111.149349, 97.518419, 108.6272, 97.518419),\n (108.6272, 97.518419, 106.105051, 97.518419),\n (106.105051, 97.518419, 103.582902, 97.518419),\n (103.582902, 97.518419, 101.060754, 97.518419),\n (101.060754, 97.518419, 98.538605, 97.518419),\n (98.538605, 97.518419, 96.016456, 97.518419),\n (96.016456, 97.518419, 93.494307, 97.518419),\n (93.494307, 97.518419, 90.972158, 97.518419),\n (90.972158, 97.518419, 88.450009, 97.518419),\n (88.450009, 97.518419, 85.927861, 97.518419),\n (85.927861, 97.518419, 83.405712, 97.518419),\n (83.405712, 97.518419, 80.883563, 97.518419),\n (80.883563, 97.518419, 78.361414, 97.518419),\n (78.361414, 97.518419, 75.839265, 97.518419),\n (75.839265, 97.518419, 73.317117, 97.518419),\n (73.317117, 97.518419, 70.794968, 97.518419),\n (70.794968, 97.518419, 68.272819, 97.518419),\n (68.272819, 97.518419, 68.272819, 82.127181),\n (162.981581, 111.518419, 162.981581, 114.040568),\n (162.981581, 114.040568, 162.981581, 116.562717),\n (162.981581, 116.562717, 162.981581, 119.084865),\n (162.981581, 119.084865, 162.981581, 121.607014),\n (162.981581, 121.607014, 162.981581, 124.129163),\n (162.981581, 124.129163, 162.981581, 126.651312),\n (162.981581, 126.651312, 162.981581, 129.173461),\n (162.981581, 129.173461, 162.981581, 131.695609),\n (162.981581, 131.695609, 162.981581, 134.217758),\n (162.981581, 134.217758, 162.981581, 136.739907),\n (162.981581, 136.739907, 162.981581, 139.262056),\n (162.981581, 139.262056, 162.981581, 141.784205),\n (162.981581, 141.784205, 162.981581, 144.306354),\n (162.981581, 144.306354, 162.981581, 146.828502),\n (162.981581, 146.828502, 162.981581, 149.350651),\n (162.981581, 149.350651, 162.981581, 151.8728),\n (162.981581, 151.8728, 162.981581, 154.394949),\n (162.981581, 154.394949, 162.981581, 156.917098),\n (162.981581, 156.917098, 162.981581, 159.439246),\n (162.981581, 159.439246, 162.981581, 161.961395),\n (162.981581, 161.961395, 162.981581, 164.483544),\n (162.981581, 164.483544, 162.981581, 167.005693),\n (162.981581, 167.005693, 162.981581, 169.527842),\n (162.981581, 169.527842, 162.981581, 172.049991),\n (162.981581, 172.049991, 162.981581, 174.572139),\n (162.981581, 174.572139, 162.981581, 177.094288),\n (162.981581, 177.094288, 162.981581, 179.616437),\n (162.981581, 179.616437, 162.981581, 182.138586),\n (162.981581, 182.138586, 162.981581, 184.660735),\n (162.981581, 184.660735, 162.981581, 187.182883),\n (162.981581, 187.182883, 162.981581, 189.705032),\n (162.981581, 189.705032, 162.981581, 192.227181),\n (178.372819, 111.518419, 178.372819, 114.040568),\n (178.372819, 114.040568, 178.372819, 116.562717),\n (178.372819, 116.562717, 178.372819, 119.084865),\n (178.372819, 119.084865, 178.372819, 121.607014),\n (178.372819, 121.607014, 178.372819, 124.129163),\n (178.372819, 124.129163, 178.372819, 126.651312),\n (178.372819, 126.651312, 178.372819, 129.173461),\n (178.372819, 129.173461, 178.372819, 131.695609),\n (178.372819, 131.695609, 178.372819, 134.217758),\n (178.372819, 134.217758, 178.372819, 136.739907),\n (178.372819, 136.739907, 178.372819, 139.262056),\n (178.372819, 139.262056, 178.372819, 141.784205),\n (178.372819, 141.784205, 178.372819, 144.306354),\n (178.372819, 144.306354, 178.372819, 146.828502),\n (178.372819, 146.828502, 178.372819, 149.350651),\n (178.372819, 149.350651, 178.372819, 151.8728),\n (178.372819, 151.8728, 178.372819, 154.394949),\n (178.372819, 154.394949, 178.372819, 156.917098),\n (178.372819, 156.917098, 178.372819, 159.439246),\n (178.372819, 159.439246, 178.372819, 161.961395),\n (178.372819, 161.961395, 178.372819, 164.483544),\n (178.372819, 164.483544, 178.372819, 167.005693),\n (178.372819, 167.005693, 178.372819, 169.527842),\n (178.372819, 169.527842, 178.372819, 172.049991),\n (178.372819, 172.049991, 178.372819, 174.572139),\n (178.372819, 174.572139, 178.372819, 177.094288),\n (178.372819, 177.094288, 178.372819, 179.616437),\n (178.372819, 179.616437, 178.372819, 182.138586),\n (178.372819, 182.138586, 178.372819, 184.660735),\n (178.372819, 184.660735, 178.372819, 187.182883),\n (178.372819, 187.182883, 178.372819, 189.705032),\n (178.372819, 189.705032, 178.372819, 192.227181),\n (178.372819, 111.518419, 162.981581, 111.518419),\n (178.372819, 192.227181, 162.981581, 192.227181)\n]\nVISIBLE_CIRCLES = [\n (108.6272, 151.8728, 40.354381)\n]\nVISIBLE_ARCS = [\n\n]\nHIDDEN_SEGMENTS = [\n\n]\n# (orient, text, p1, p2, base) for linear; (orient, text, center, radius, angle) for diameter\nDIMENSIONS = [\n ('diameter', '%%c100', (108.6272, 151.8728), 40.3544, 45),\n ('horizontal', '19.0701', (162.9816, 151.8728), (178.3728, 151.8728), (170.6772, 162.8728))\n]\n\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\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\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,\n angle=(0 if d[0] == \"horizontal\" else 90),\n 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,\n text=text, dimstyle=\"EZDXF\").render()\n\n doc.saveas(out_path)\n\n\nif __name__ == \"__main__\":\n out = sys.argv[1] if len(sys.argv) > 1 else \"0008_00082564_gt.dxf\"\n draw(out)\n print(\"wrote\", out)\n```"}], "images": ["images/0008_00082564.png"], "id": "0008_00082564"} {"messages": [{"role": "user", "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": "assistant", "content": "```python\n#!/usr/bin/env python3\n# -*- coding: utf-8 -*-\n# Ground-truth 2D engineering drawing for part: 0009_00097432\n# Self-contained: reproduces the three-view DXF via ezdxf, NO FreeCAD needed.\n# Coordinates are A4 page millimetres (scale=0.18731355932203736, page=[297.0, 210.0]).\n# visible edges -> solid (layer OUTLINE); hidden edges -> dashed (layer HIDDEN)\n# dimensions -> real movable DIMENSION entities (text = true mm value)\n# Run: python 0009_00097432_gt.py [out.dxf]\nimport sys\nimport ezdxf\n\nSCALE = 0.18731355932203736\nPAGE = [297.0, 210.0]\n\nVISIBLE_SEGMENTS = [\n (83.767122, 144.001522, 84.352477, 144.001522),\n (84.352477, 144.001522, 84.937832, 144.001522),\n (84.937832, 144.001522, 85.523187, 144.001522),\n (85.523187, 144.001522, 86.108542, 144.001522),\n (86.108542, 144.001522, 86.693896, 144.001522),\n (86.693896, 144.001522, 87.279251, 144.001522),\n (87.279251, 144.001522, 87.864606, 144.001522),\n (87.864606, 144.001522, 88.449961, 144.001522),\n (88.449961, 144.001522, 89.035316, 144.001522),\n (89.035316, 144.001522, 89.620671, 144.001522),\n (89.620671, 144.001522, 90.206026, 144.001522),\n (90.206026, 144.001522, 90.791381, 144.001522),\n (90.791381, 144.001522, 91.376735, 144.001522),\n (91.376735, 144.001522, 91.96209, 144.001522),\n (91.96209, 144.001522, 92.547445, 144.001522),\n (92.547445, 144.001522, 93.1328, 144.001522),\n (93.1328, 144.001522, 93.718155, 144.001522),\n (93.718155, 144.001522, 94.30351, 144.001522),\n (94.30351, 144.001522, 94.888865, 144.001522),\n (94.888865, 144.001522, 95.474219, 144.001522),\n (95.474219, 144.001522, 96.059574, 144.001522),\n (96.059574, 144.001522, 96.644929, 144.001522),\n (96.644929, 144.001522, 97.230284, 144.001522),\n (97.230284, 144.001522, 97.815639, 144.001522),\n (97.815639, 144.001522, 98.400994, 144.001522),\n (98.400994, 144.001522, 98.986349, 144.001522),\n (98.986349, 144.001522, 99.571704, 144.001522),\n (99.571704, 144.001522, 100.157058, 144.001522),\n (100.157058, 144.001522, 100.742413, 144.001522),\n (100.742413, 144.001522, 101.327768, 144.001522),\n (101.327768, 144.001522, 101.913123, 144.001522),\n (101.913123, 144.001522, 102.498478, 144.001522),\n (102.498478, 144.001522, 102.498478, 66.632878),\n (83.767122, 66.632878, 84.352477, 66.632878),\n (84.352477, 66.632878, 84.937832, 66.632878),\n (84.937832, 66.632878, 85.523187, 66.632878),\n (85.523187, 66.632878, 86.108542, 66.632878),\n (86.108542, 66.632878, 86.693896, 66.632878),\n (86.693896, 66.632878, 87.279251, 66.632878),\n (87.279251, 66.632878, 87.864606, 66.632878),\n (87.864606, 66.632878, 88.449961, 66.632878),\n (88.449961, 66.632878, 89.035316, 66.632878),\n (89.035316, 66.632878, 89.620671, 66.632878),\n (89.620671, 66.632878, 90.206026, 66.632878),\n (90.206026, 66.632878, 90.791381, 66.632878),\n (90.791381, 66.632878, 91.376735, 66.632878),\n (91.376735, 66.632878, 91.96209, 66.632878),\n (91.96209, 66.632878, 92.547445, 66.632878),\n (92.547445, 66.632878, 93.1328, 66.632878),\n (93.1328, 66.632878, 93.718155, 66.632878),\n (93.718155, 66.632878, 94.30351, 66.632878),\n (94.30351, 66.632878, 94.888865, 66.632878),\n (94.888865, 66.632878, 95.474219, 66.632878),\n (95.474219, 66.632878, 96.059574, 66.632878),\n (96.059574, 66.632878, 96.644929, 66.632878),\n (96.644929, 66.632878, 97.230284, 66.632878),\n (97.230284, 66.632878, 97.815639, 66.632878),\n (97.815639, 66.632878, 98.400994, 66.632878),\n (98.400994, 66.632878, 98.986349, 66.632878),\n (98.986349, 66.632878, 99.571704, 66.632878),\n (99.571704, 66.632878, 100.157058, 66.632878),\n (100.157058, 66.632878, 100.742413, 66.632878),\n (100.742413, 66.632878, 101.327768, 66.632878),\n (101.327768, 66.632878, 101.913123, 66.632878),\n (101.913123, 66.632878, 102.498478, 66.632878),\n (83.767122, 144.001522, 83.767122, 66.632878),\n (193.867122, 176.732878, 193.867122, 176.147523),\n (193.867122, 176.147523, 193.867122, 175.562168),\n (193.867122, 175.562168, 193.867122, 174.976813),\n (193.867122, 174.976813, 193.867122, 174.391458),\n (193.867122, 174.391458, 193.867122, 173.806104),\n (193.867122, 173.806104, 193.867122, 173.220749),\n (193.867122, 173.220749, 193.867122, 172.635394),\n (193.867122, 172.635394, 193.867122, 172.050039),\n (193.867122, 172.050039, 193.867122, 171.464684),\n (193.867122, 171.464684, 193.867122, 170.879329),\n (193.867122, 170.879329, 193.867122, 170.293974),\n (193.867122, 170.293974, 193.867122, 169.708619),\n (193.867122, 169.708619, 193.867122, 169.123265),\n (193.867122, 169.123265, 193.867122, 168.53791),\n (193.867122, 168.53791, 193.867122, 167.952555),\n (193.867122, 167.952555, 193.867122, 167.3672),\n (193.867122, 167.3672, 193.867122, 166.781845),\n (193.867122, 166.781845, 193.867122, 166.19649),\n (193.867122, 166.19649, 193.867122, 165.611135),\n (193.867122, 165.611135, 193.867122, 165.025781),\n (193.867122, 165.025781, 193.867122, 164.440426),\n (193.867122, 164.440426, 193.867122, 163.855071),\n (193.867122, 163.855071, 193.867122, 163.269716),\n (193.867122, 163.269716, 193.867122, 162.684361),\n (193.867122, 162.684361, 193.867122, 162.099006),\n (193.867122, 162.099006, 193.867122, 161.513651),\n (193.867122, 161.513651, 193.867122, 160.928296),\n (193.867122, 160.928296, 193.867122, 160.342942),\n (193.867122, 160.342942, 193.867122, 159.757587),\n (193.867122, 159.757587, 193.867122, 159.172232),\n (193.867122, 159.172232, 193.867122, 158.586877),\n (193.867122, 158.586877, 193.867122, 158.001522),\n (116.498478, 176.732878, 116.498478, 176.147523),\n (116.498478, 176.147523, 116.498478, 175.562168),\n (116.498478, 175.562168, 116.498478, 174.976813),\n (116.498478, 174.976813, 116.498478, 174.391458),\n (116.498478, 174.391458, 116.498478, 173.806104),\n (116.498478, 173.806104, 116.498478, 173.220749),\n (116.498478, 173.220749, 116.498478, 172.635394),\n (116.498478, 172.635394, 116.498478, 172.050039),\n (116.498478, 172.050039, 116.498478, 171.464684),\n (116.498478, 171.464684, 116.498478, 170.879329),\n (116.498478, 170.879329, 116.498478, 170.293974),\n (116.498478, 170.293974, 116.498478, 169.708619),\n (116.498478, 169.708619, 116.498478, 169.123265),\n (116.498478, 169.123265, 116.498478, 168.53791),\n (116.498478, 168.53791, 116.498478, 167.952555),\n (116.498478, 167.952555, 116.498478, 167.3672),\n (116.498478, 167.3672, 116.498478, 166.781845),\n (116.498478, 166.781845, 116.498478, 166.19649),\n (116.498478, 166.19649, 116.498478, 165.611135),\n (116.498478, 165.611135, 116.498478, 165.025781),\n (116.498478, 165.025781, 116.498478, 164.440426),\n (116.498478, 164.440426, 116.498478, 163.855071),\n (116.498478, 163.855071, 116.498478, 163.269716),\n (116.498478, 163.269716, 116.498478, 162.684361),\n (116.498478, 162.684361, 116.498478, 162.099006),\n (116.498478, 162.099006, 116.498478, 161.513651),\n (116.498478, 161.513651, 116.498478, 160.928296),\n (116.498478, 160.928296, 116.498478, 160.342942),\n (116.498478, 160.342942, 116.498478, 159.757587),\n (116.498478, 159.757587, 116.498478, 159.172232),\n (116.498478, 159.172232, 116.498478, 158.586877),\n (116.498478, 158.586877, 116.498478, 158.001522),\n (193.867122, 158.001522, 116.498478, 158.001522),\n (193.867122, 176.732878, 116.498478, 176.732878)\n]\nVISIBLE_CIRCLES = [\n (93.1328, 167.3672, 9.365678)\n]\nVISIBLE_ARCS = [\n\n]\nHIDDEN_SEGMENTS = [\n\n]\n# (orient, text, p1, p2, base) for linear; (orient, text, center, radius, angle) for diameter\nDIMENSIONS = [\n ('diameter', '%%c100', (93.1328, 167.3672), 9.3657, 45),\n ('horizontal', '413.043', (116.4985, 167.3672), (193.8672, 167.3672), (155.1828, 178.3672))\n]\n\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\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\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,\n angle=(0 if d[0] == \"horizontal\" else 90),\n 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,\n text=text, dimstyle=\"EZDXF\").render()\n\n doc.saveas(out_path)\n\n\nif __name__ == \"__main__\":\n out = sys.argv[1] if len(sys.argv) > 1 else \"0009_00097432_gt.dxf\"\n draw(out)\n print(\"wrote\", out)\n```"}], "images": ["images/0009_00097432.png"], "id": "0009_00097432"} {"messages": [{"role": "user", "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 41.75 mm."}, {"role": "assistant", "content": "```python\n#!/usr/bin/env python3\n# -*- coding: utf-8 -*-\n# Ground-truth 2D engineering drawing for part: 0010_00100696\n# Self-contained: reproduces the three-view DXF via ezdxf, NO FreeCAD needed.\n# Coordinates are A4 page millimetres (scale=0.6779634860489149, page=[297.0, 210.0]).\n# visible edges -> solid (layer OUTLINE); hidden edges -> dashed (layer HIDDEN)\n# dimensions -> real movable DIMENSION entities (text = true mm value)\n# Run: python 0010_00100696_gt.py [out.dxf]\nimport sys\nimport ezdxf\n\nSCALE = 0.6779634860489149\nPAGE = [297.0, 210.0]\n\nVISIBLE_SEGMENTS = [\n (71.500926, 107.202725, 73.619562, 107.202725),\n (73.619562, 107.202725, 75.738197, 107.202725),\n (75.738197, 107.202725, 77.856833, 107.202725),\n (77.856833, 107.202725, 79.975469, 107.202725),\n (79.975469, 107.202725, 82.094105, 107.202725),\n (82.094105, 107.202725, 84.212741, 107.202725),\n (84.212741, 107.202725, 86.331377, 107.202725),\n (86.331377, 107.202725, 88.450013, 107.202725),\n (88.450013, 107.202725, 90.568649, 107.202725),\n (90.568649, 107.202725, 92.687285, 107.202725),\n (92.687285, 107.202725, 94.805921, 107.202725),\n (94.805921, 107.202725, 96.924556, 107.202725),\n (96.924556, 107.202725, 99.043192, 107.202725),\n (99.043192, 107.202725, 101.161828, 107.202725),\n (101.161828, 107.202725, 103.280464, 107.202725),\n (103.280464, 107.202725, 105.3991, 107.202725),\n (105.3991, 107.202725, 107.517736, 107.202725),\n (107.517736, 107.202725, 109.636372, 107.202725),\n (109.636372, 107.202725, 111.755008, 107.202725),\n (111.755008, 107.202725, 113.873644, 107.202725),\n (113.873644, 107.202725, 115.992279, 107.202725),\n (115.992279, 107.202725, 118.110915, 107.202725),\n (118.110915, 107.202725, 120.229551, 107.202725),\n (120.229551, 107.202725, 122.348187, 107.202725),\n (122.348187, 107.202725, 124.466823, 107.202725),\n (124.466823, 107.202725, 126.585459, 107.202725),\n (126.585459, 107.202725, 128.704095, 107.202725),\n (128.704095, 107.202725, 130.822731, 107.202725),\n (130.822731, 107.202725, 132.941367, 107.202725),\n (132.941367, 107.202725, 135.060003, 107.202725),\n (135.060003, 107.202725, 137.178638, 107.202725),\n (137.178638, 107.202725, 139.297274, 107.202725),\n (139.297274, 107.202725, 139.297274, 78.899074),\n (71.500926, 78.899074, 73.619562, 78.899074),\n (73.619562, 78.899074, 75.738197, 78.899074),\n (75.738197, 78.899074, 77.856833, 78.899074),\n (77.856833, 78.899074, 79.975469, 78.899074),\n (79.975469, 78.899074, 82.094105, 78.899074),\n (82.094105, 78.899074, 84.212741, 78.899074),\n (84.212741, 78.899074, 86.331377, 78.899074),\n (86.331377, 78.899074, 88.450013, 78.899074),\n (88.450013, 78.899074, 90.568649, 78.899074),\n (90.568649, 78.899074, 92.687285, 78.899074),\n (92.687285, 78.899074, 94.805921, 78.899074),\n (94.805921, 78.899074, 96.924556, 78.899074),\n (96.924556, 78.899074, 99.043192, 78.899074),\n (99.043192, 78.899074, 101.161828, 78.899074),\n (101.161828, 78.899074, 103.280464, 78.899074),\n (103.280464, 78.899074, 105.3991, 78.899074),\n (105.3991, 78.899074, 107.517736, 78.899074),\n (107.517736, 78.899074, 109.636372, 78.899074),\n (109.636372, 78.899074, 111.755008, 78.899074),\n (111.755008, 78.899074, 113.873644, 78.899074),\n (113.873644, 78.899074, 115.992279, 78.899074),\n (115.992279, 78.899074, 118.110915, 78.899074),\n (118.110915, 78.899074, 120.229551, 78.899074),\n (120.229551, 78.899074, 122.348187, 78.899074),\n (122.348187, 78.899074, 124.466823, 78.899074),\n (124.466823, 78.899074, 126.585459, 78.899074),\n (126.585459, 78.899074, 128.704095, 78.899074),\n (128.704095, 78.899074, 130.822731, 78.899074),\n (130.822731, 78.899074, 132.941367, 78.899074),\n (132.941367, 78.899074, 135.060003, 78.899074),\n (135.060003, 78.899074, 137.178638, 78.899074),\n (137.178638, 78.899074, 139.297274, 78.899074),\n (71.500926, 78.899074, 71.500926, 107.202725),\n (181.600926, 188.999074, 181.600926, 186.880438),\n (181.600926, 186.880438, 181.600926, 184.761803),\n (181.600926, 184.761803, 181.600926, 182.643167),\n (181.600926, 182.643167, 181.600926, 180.524531),\n (181.600926, 180.524531, 181.600926, 178.405895),\n (181.600926, 178.405895, 181.600926, 176.287259),\n (181.600926, 176.287259, 181.600926, 174.168623),\n (181.600926, 174.168623, 181.600926, 172.049987),\n (181.600926, 172.049987, 181.600926, 169.931351),\n (181.600926, 169.931351, 181.600926, 167.812715),\n (181.600926, 167.812715, 181.600926, 165.694079),\n (181.600926, 165.694079, 181.600926, 163.575444),\n (181.600926, 163.575444, 181.600926, 161.456808),\n (181.600926, 161.456808, 181.600926, 159.338172),\n (181.600926, 159.338172, 181.600926, 157.219536),\n (181.600926, 157.219536, 181.600926, 155.1009),\n (181.600926, 155.1009, 181.600926, 152.982264),\n (181.600926, 152.982264, 181.600926, 150.863628),\n (181.600926, 150.863628, 181.600926, 148.744992),\n (181.600926, 148.744992, 181.600926, 146.626356),\n (181.600926, 146.626356, 181.600926, 144.507721),\n (181.600926, 144.507721, 181.600926, 142.389085),\n (181.600926, 142.389085, 181.600926, 140.270449),\n (181.600926, 140.270449, 181.600926, 138.151813),\n (181.600926, 138.151813, 181.600926, 136.033177),\n (181.600926, 136.033177, 181.600926, 133.914541),\n (181.600926, 133.914541, 181.600926, 131.795905),\n (181.600926, 131.795905, 181.600926, 129.677269),\n (181.600926, 129.677269, 181.600926, 127.558633),\n (181.600926, 127.558633, 181.600926, 125.439997),\n (181.600926, 125.439997, 181.600926, 123.321362),\n (181.600926, 123.321362, 181.600926, 121.202726),\n (153.297275, 188.999074, 153.297275, 186.880438),\n (153.297275, 186.880438, 153.297275, 184.761803),\n (153.297275, 184.761803, 153.297275, 182.643167),\n (153.297275, 182.643167, 153.297275, 180.524531),\n (153.297275, 180.524531, 153.297275, 178.405895),\n (153.297275, 178.405895, 153.297275, 176.287259),\n (153.297275, 176.287259, 153.297275, 174.168623),\n (153.297275, 174.168623, 153.297275, 172.049987),\n (153.297275, 172.049987, 153.297275, 169.931351),\n (153.297275, 169.931351, 153.297275, 167.812715),\n (153.297275, 167.812715, 153.297275, 165.694079),\n (153.297275, 165.694079, 153.297275, 163.575444),\n (153.297275, 163.575444, 153.297275, 161.456808),\n (153.297275, 161.456808, 153.297275, 159.338172),\n (153.297275, 159.338172, 153.297275, 157.219536),\n (153.297275, 157.219536, 153.297275, 155.1009),\n (153.297275, 155.1009, 153.297275, 152.982264),\n (153.297275, 152.982264, 153.297275, 150.863628),\n (153.297275, 150.863628, 153.297275, 148.744992),\n (153.297275, 148.744992, 153.297275, 146.626356),\n (153.297275, 146.626356, 153.297275, 144.507721),\n (153.297275, 144.507721, 153.297275, 142.389085),\n (153.297275, 142.389085, 153.297275, 140.270449),\n (153.297275, 140.270449, 153.297275, 138.151813),\n (153.297275, 138.151813, 153.297275, 136.033177),\n (153.297275, 136.033177, 153.297275, 133.914541),\n (153.297275, 133.914541, 153.297275, 131.795905),\n (153.297275, 131.795905, 153.297275, 129.677269),\n (153.297275, 129.677269, 153.297275, 127.558633),\n (153.297275, 127.558633, 153.297275, 125.439997),\n (153.297275, 125.439997, 153.297275, 123.321362),\n (153.297275, 123.321362, 153.297275, 121.202726),\n (153.297275, 188.999074, 181.600926, 188.999074),\n (153.297275, 121.202726, 181.600926, 121.202726)\n]\nVISIBLE_CIRCLES = [\n (105.3991, 155.1009, 33.898174)\n]\nVISIBLE_ARCS = [\n\n]\nHIDDEN_SEGMENTS = [\n\n]\n# (orient, text, p1, p2, base) for linear; (orient, text, center, radius, angle) for diameter\nDIMENSIONS = [\n ('diameter', '%%c100', (105.3991, 155.1009), 33.8982, 45),\n ('horizontal', '41.748', (181.6009, 155.1009), (153.2973, 155.1009), (167.4491, 144.1009))\n]\n\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\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\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,\n angle=(0 if d[0] == \"horizontal\" else 90),\n 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,\n text=text, dimstyle=\"EZDXF\").render()\n\n doc.saveas(out_path)\n\n\nif __name__ == \"__main__\":\n out = sys.argv[1] if len(sys.argv) > 1 else \"0010_00100696_gt.dxf\"\n draw(out)\n print(\"wrote\", out)\n```"}], "images": ["images/0010_00100696.png"], "id": "0010_00100696"} {"messages": [{"role": "user", "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 24.22 mm."}, {"role": "assistant", "content": "```python\n#!/usr/bin/env python3\n# -*- coding: utf-8 -*-\n# Ground-truth 2D engineering drawing for part: 0011_00113741\n# Self-contained: reproduces the three-view DXF via ezdxf, NO FreeCAD needed.\n# Coordinates are A4 page millimetres (scale=0.7347, page=[297.0, 210.0]).\n# visible edges -> solid (layer OUTLINE); hidden edges -> dashed (layer HIDDEN)\n# dimensions -> real movable DIMENSION entities (text = true mm value)\n# Run: python 0011_00113741_gt.py [out.dxf]\nimport sys\nimport ezdxf\n\nSCALE = 0.7347\nPAGE = [297.0, 210.0]\n\nVISIBLE_SEGMENTS = [\n (72.4987, 100.5313, 74.794637, 100.5313),\n (74.794637, 100.5313, 77.090575, 100.5313),\n (77.090575, 100.5313, 79.386512, 100.5313),\n (79.386512, 100.5313, 81.68245, 100.5313),\n (81.68245, 100.5313, 83.978387, 100.5313),\n (83.978387, 100.5313, 86.274325, 100.5313),\n (86.274325, 100.5313, 88.570262, 100.5313),\n (88.570262, 100.5313, 90.8662, 100.5313),\n (90.8662, 100.5313, 93.162138, 100.5313),\n (93.162138, 100.5313, 95.458075, 100.5313),\n (95.458075, 100.5313, 97.754013, 100.5313),\n (97.754013, 100.5313, 100.04995, 100.5313),\n (100.04995, 100.5313, 102.345888, 100.5313),\n (102.345888, 100.5313, 104.641825, 100.5313),\n (104.641825, 100.5313, 106.937763, 100.5313),\n (106.937763, 100.5313, 109.2337, 100.5313),\n (109.2337, 100.5313, 111.529637, 100.5313),\n (111.529637, 100.5313, 113.825575, 100.5313),\n (113.825575, 100.5313, 116.121512, 100.5313),\n (116.121512, 100.5313, 118.41745, 100.5313),\n (118.41745, 100.5313, 120.713388, 100.5313),\n (120.713388, 100.5313, 123.009325, 100.5313),\n (123.009325, 100.5313, 125.305263, 100.5313),\n (125.305263, 100.5313, 127.6012, 100.5313),\n (127.6012, 100.5313, 129.897138, 100.5313),\n (129.897138, 100.5313, 132.193075, 100.5313),\n (132.193075, 100.5313, 134.489013, 100.5313),\n (134.489013, 100.5313, 136.78495, 100.5313),\n (136.78495, 100.5313, 139.080888, 100.5313),\n (139.080888, 100.5313, 141.376825, 100.5313),\n (141.376825, 100.5313, 143.672763, 100.5313),\n (143.672763, 100.5313, 145.9687, 100.5313),\n (145.9687, 100.5313, 145.9687, 82.733798),\n (72.4987, 82.733798, 74.794637, 82.733798),\n (74.794637, 82.733798, 77.090575, 82.733798),\n (77.090575, 82.733798, 79.386512, 82.733798),\n (79.386512, 82.733798, 81.68245, 82.733798),\n (81.68245, 82.733798, 83.978387, 82.733798),\n (83.978387, 82.733798, 86.274325, 82.733798),\n (86.274325, 82.733798, 88.570262, 82.733798),\n (88.570262, 82.733798, 90.8662, 82.733798),\n (90.8662, 82.733798, 93.162138, 82.733798),\n (93.162138, 82.733798, 95.458075, 82.733798),\n (95.458075, 82.733798, 97.754013, 82.733798),\n (97.754013, 82.733798, 100.04995, 82.733798),\n (100.04995, 82.733798, 102.345888, 82.733798),\n (102.345888, 82.733798, 104.641825, 82.733798),\n (104.641825, 82.733798, 106.937763, 82.733798),\n (106.937763, 82.733798, 109.2337, 82.733798),\n (109.2337, 82.733798, 111.529637, 82.733798),\n (111.529637, 82.733798, 113.825575, 82.733798),\n (113.825575, 82.733798, 116.121512, 82.733798),\n (116.121512, 82.733798, 118.41745, 82.733798),\n (118.41745, 82.733798, 120.713388, 82.733798),\n (120.713388, 82.733798, 123.009325, 82.733798),\n (123.009325, 82.733798, 125.305263, 82.733798),\n (125.305263, 82.733798, 127.6012, 82.733798),\n (127.6012, 82.733798, 129.897138, 82.733798),\n (129.897138, 82.733798, 132.193075, 82.733798),\n (132.193075, 82.733798, 134.489013, 82.733798),\n (134.489013, 82.733798, 136.78495, 82.733798),\n (136.78495, 82.733798, 139.080888, 82.733798),\n (139.080888, 82.733798, 141.376825, 82.733798),\n (141.376825, 82.733798, 143.672763, 82.733798),\n (143.672763, 82.733798, 145.9687, 82.733798),\n (72.4987, 82.733798, 72.4987, 100.5313),\n (177.766202, 188.0013, 177.766202, 185.705363),\n (177.766202, 185.705363, 177.766202, 183.409425),\n (177.766202, 183.409425, 177.766202, 181.113488),\n (177.766202, 181.113488, 177.766202, 178.81755),\n (177.766202, 178.81755, 177.766202, 176.521613),\n (177.766202, 176.521613, 177.766202, 174.225675),\n (177.766202, 174.225675, 177.766202, 171.929738),\n (177.766202, 171.929738, 177.766202, 169.6338),\n (177.766202, 169.6338, 177.766202, 167.337863),\n (177.766202, 167.337863, 177.766202, 165.041925),\n (177.766202, 165.041925, 177.766202, 162.745988),\n (177.766202, 162.745988, 177.766202, 160.45005),\n (177.766202, 160.45005, 177.766202, 158.154113),\n (177.766202, 158.154113, 177.766202, 155.858175),\n (177.766202, 155.858175, 177.766202, 153.562238),\n (177.766202, 153.562238, 177.766202, 151.2663),\n (177.766202, 151.2663, 177.766202, 148.970362),\n (177.766202, 148.970362, 177.766202, 146.674425),\n (177.766202, 146.674425, 177.766202, 144.378488),\n (177.766202, 144.378488, 177.766202, 142.08255),\n (177.766202, 142.08255, 177.766202, 139.786613),\n (177.766202, 139.786613, 177.766202, 137.490675),\n (177.766202, 137.490675, 177.766202, 135.194738),\n (177.766202, 135.194738, 177.766202, 132.8988),\n (177.766202, 132.8988, 177.766202, 130.602863),\n (177.766202, 130.602863, 177.766202, 128.306925),\n (177.766202, 128.306925, 177.766202, 126.010988),\n (177.766202, 126.010988, 177.766202, 123.71505),\n (177.766202, 123.71505, 177.766202, 121.419113),\n (177.766202, 121.419113, 177.766202, 119.123175),\n (177.766202, 119.123175, 177.766202, 116.827238),\n (177.766202, 116.827238, 177.766202, 114.5313),\n (159.9687, 188.0013, 159.9687, 185.705363),\n (159.9687, 185.705363, 159.9687, 183.409425),\n (159.9687, 183.409425, 159.9687, 181.113488),\n (159.9687, 181.113488, 159.9687, 178.81755),\n (159.9687, 178.81755, 159.9687, 176.521613),\n (159.9687, 176.521613, 159.9687, 174.225675),\n (159.9687, 174.225675, 159.9687, 171.929738),\n (159.9687, 171.929738, 159.9687, 169.6338),\n (159.9687, 169.6338, 159.9687, 167.337863),\n (159.9687, 167.337863, 159.9687, 165.041925),\n (159.9687, 165.041925, 159.9687, 162.745988),\n (159.9687, 162.745988, 159.9687, 160.45005),\n (159.9687, 160.45005, 159.9687, 158.154113),\n (159.9687, 158.154113, 159.9687, 155.858175),\n (159.9687, 155.858175, 159.9687, 153.562238),\n (159.9687, 153.562238, 159.9687, 151.2663),\n (159.9687, 151.2663, 159.9687, 148.970363),\n (159.9687, 148.970363, 159.9687, 146.674425),\n (159.9687, 146.674425, 159.9687, 144.378488),\n (159.9687, 144.378488, 159.9687, 142.08255),\n (159.9687, 142.08255, 159.9687, 139.786613),\n (159.9687, 139.786613, 159.9687, 137.490675),\n (159.9687, 137.490675, 159.9687, 135.194738),\n (159.9687, 135.194738, 159.9687, 132.8988),\n (159.9687, 132.8988, 159.9687, 130.602863),\n (159.9687, 130.602863, 159.9687, 128.306925),\n (159.9687, 128.306925, 159.9687, 126.010988),\n (159.9687, 126.010988, 159.9687, 123.71505),\n (159.9687, 123.71505, 159.9687, 121.419113),\n (159.9687, 121.419113, 159.9687, 119.123175),\n (159.9687, 119.123175, 159.9687, 116.827238),\n (159.9687, 116.827238, 159.9687, 114.5313),\n (159.9687, 188.0013, 177.766202, 188.0013),\n (159.9687, 114.5313, 177.766202, 114.5313)\n]\nVISIBLE_CIRCLES = [\n (109.2337, 151.2663, 36.735)\n]\nVISIBLE_ARCS = [\n\n]\nHIDDEN_SEGMENTS = [\n\n]\n# (orient, text, p1, p2, base) for linear; (orient, text, center, radius, angle) for diameter\nDIMENSIONS = [\n ('diameter', '%%c100', (109.2337, 151.2663), 36.735, 45),\n ('horizontal', '24.2242', (177.7663, 151.2663), (159.9687, 151.2663), (168.8675, 140.2663))\n]\n\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\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\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,\n angle=(0 if d[0] == \"horizontal\" else 90),\n 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,\n text=text, dimstyle=\"EZDXF\").render()\n\n doc.saveas(out_path)\n\n\nif __name__ == \"__main__\":\n out = sys.argv[1] if len(sys.argv) > 1 else \"0011_00113741_gt.dxf\"\n draw(out)\n print(\"wrote\", out)\n```"}], "images": ["images/0011_00113741.png"], "id": "0011_00113741"} {"messages": [{"role": "user", "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 20.9 mm."}, {"role": "assistant", "content": "```python\n#!/usr/bin/env python3\n# -*- coding: utf-8 -*-\n# Ground-truth 2D engineering drawing for part: 0012_00121160\n# Self-contained: reproduces the three-view DXF via ezdxf, NO FreeCAD needed.\n# Coordinates are A4 page millimetres (scale=0.7948847265332335, page=[297.0, 210.0]).\n# visible edges -> solid (layer OUTLINE); hidden edges -> dashed (layer HIDDEN)\n# dimensions -> real movable DIMENSION entities (text = true mm value)\n# Run: python 0012_00121160_gt.py [out.dxf]\nimport sys\nimport ezdxf\n\nSCALE = 0.7948847265332335\nPAGE = [297.0, 210.0]\n\nVISIBLE_SEGMENTS = [\n (148.066436, 81.822136, 145.582422, 81.822136),\n (145.582422, 81.822136, 143.098407, 81.822136),\n (143.098407, 81.822136, 140.614392, 81.822136),\n (140.614392, 81.822136, 138.130377, 81.822136),\n (138.130377, 81.822136, 135.646362, 81.822136),\n (135.646362, 81.822136, 133.162348, 81.822136),\n (133.162348, 81.822136, 130.678333, 81.822136),\n (130.678333, 81.822136, 128.194318, 81.822136),\n (128.194318, 81.822136, 125.710303, 81.822136),\n (125.710303, 81.822136, 123.226289, 81.822136),\n (123.226289, 81.822136, 120.742274, 81.822136),\n (120.742274, 81.822136, 118.258259, 81.822136),\n (118.258259, 81.822136, 115.774244, 81.822136),\n (115.774244, 81.822136, 113.29023, 81.822136),\n (113.29023, 81.822136, 110.806215, 81.822136),\n (110.806215, 81.822136, 108.3222, 81.822136),\n (108.3222, 81.822136, 105.838185, 81.822136),\n (105.838185, 81.822136, 103.35417, 81.822136),\n (103.35417, 81.822136, 100.870156, 81.822136),\n (100.870156, 81.822136, 98.386141, 81.822136),\n (98.386141, 81.822136, 95.902126, 81.822136),\n (95.902126, 81.822136, 93.418111, 81.822136),\n (93.418111, 81.822136, 90.934097, 81.822136),\n (90.934097, 81.822136, 88.450082, 81.822136),\n (88.450082, 81.822136, 85.966067, 81.822136),\n (85.966067, 81.822136, 83.482052, 81.822136),\n (83.482052, 81.822136, 80.998038, 81.822136),\n (80.998038, 81.822136, 78.514023, 81.822136),\n (78.514023, 81.822136, 76.030008, 81.822136),\n (76.030008, 81.822136, 73.545993, 81.822136),\n (73.545993, 81.822136, 71.061978, 81.822136),\n (71.061978, 81.822136, 68.577964, 81.822136),\n (148.066436, 81.822136, 148.066436, 98.433663),\n (148.066436, 98.433663, 145.582422, 98.433663),\n (145.582422, 98.433663, 143.098407, 98.433663),\n (143.098407, 98.433663, 140.614392, 98.433663),\n (140.614392, 98.433663, 138.130377, 98.433663),\n (138.130377, 98.433663, 135.646362, 98.433663),\n (135.646362, 98.433663, 133.162348, 98.433663),\n (133.162348, 98.433663, 130.678333, 98.433663),\n (130.678333, 98.433663, 128.194318, 98.433663),\n (128.194318, 98.433663, 125.710303, 98.433663),\n (125.710303, 98.433663, 123.226289, 98.433663),\n (123.226289, 98.433663, 120.742274, 98.433663),\n (120.742274, 98.433663, 118.258259, 98.433663),\n (118.258259, 98.433663, 115.774244, 98.433663),\n (115.774244, 98.433663, 113.29023, 98.433663),\n (113.29023, 98.433663, 110.806215, 98.433663),\n (110.806215, 98.433663, 108.3222, 98.433663),\n (108.3222, 98.433663, 105.838185, 98.433663),\n (105.838185, 98.433663, 103.35417, 98.433663),\n (103.35417, 98.433663, 100.870156, 98.433663),\n (100.870156, 98.433663, 98.386141, 98.433663),\n (98.386141, 98.433663, 95.902126, 98.433663),\n (95.902126, 98.433663, 93.418111, 98.433663),\n (93.418111, 98.433663, 90.934097, 98.433663),\n (90.934097, 98.433663, 88.450082, 98.433663),\n (88.450082, 98.433663, 85.966067, 98.433663),\n (85.966067, 98.433663, 83.482052, 98.433663),\n (83.482052, 98.433663, 80.998038, 98.433663),\n (80.998038, 98.433663, 78.514023, 98.433663),\n (78.514023, 98.433663, 76.030008, 98.433663),\n (76.030008, 98.433663, 73.545993, 98.433663),\n (73.545993, 98.433663, 71.061978, 98.433663),\n (71.061978, 98.433663, 68.577964, 98.433663),\n (68.577964, 98.433663, 68.577964, 81.822136),\n (162.066437, 112.433664, 162.066437, 114.917678),\n (162.066437, 114.917678, 162.066437, 117.401693),\n (162.066437, 117.401693, 162.066437, 119.885708),\n (162.066437, 119.885708, 162.066437, 122.369723),\n (162.066437, 122.369723, 162.066437, 124.853738),\n (162.066437, 124.853738, 162.066437, 127.337752),\n (162.066437, 127.337752, 162.066437, 129.821767),\n (162.066437, 129.821767, 162.066437, 132.305782),\n (162.066437, 132.305782, 162.066437, 134.789797),\n (162.066437, 134.789797, 162.066437, 137.273811),\n (162.066437, 137.273811, 162.066437, 139.757826),\n (162.066437, 139.757826, 162.066437, 142.241841),\n (162.066437, 142.241841, 162.066437, 144.725856),\n (162.066437, 144.725856, 162.066437, 147.20987),\n (162.066437, 147.20987, 162.066437, 149.693885),\n (162.066437, 149.693885, 162.066437, 152.1779),\n (162.066437, 152.1779, 162.066437, 154.661915),\n (162.066437, 154.661915, 162.066437, 157.14593),\n (162.066437, 157.14593, 162.066437, 159.629944),\n (162.066437, 159.629944, 162.066437, 162.113959),\n (162.066437, 162.113959, 162.066437, 164.597974),\n (162.066437, 164.597974, 162.066437, 167.081989),\n (162.066437, 167.081989, 162.066437, 169.566003),\n (162.066437, 169.566003, 162.066437, 172.050018),\n (162.066437, 172.050018, 162.066437, 174.534033),\n (162.066437, 174.534033, 162.066437, 177.018048),\n (162.066437, 177.018048, 162.066437, 179.502062),\n (162.066437, 179.502062, 162.066437, 181.986077),\n (162.066437, 181.986077, 162.066437, 184.470092),\n (162.066437, 184.470092, 162.066437, 186.954107),\n (162.066437, 186.954107, 162.066437, 189.438122),\n (162.066437, 189.438122, 162.066437, 191.922136),\n (178.677964, 112.433664, 178.677964, 114.917678),\n (178.677964, 114.917678, 178.677964, 117.401693),\n (178.677964, 117.401693, 178.677964, 119.885708),\n (178.677964, 119.885708, 178.677964, 122.369723),\n (178.677964, 122.369723, 178.677964, 124.853738),\n (178.677964, 124.853738, 178.677964, 127.337752),\n (178.677964, 127.337752, 178.677964, 129.821767),\n (178.677964, 129.821767, 178.677964, 132.305782),\n (178.677964, 132.305782, 178.677964, 134.789797),\n (178.677964, 134.789797, 178.677964, 137.273811),\n (178.677964, 137.273811, 178.677964, 139.757826),\n (178.677964, 139.757826, 178.677964, 142.241841),\n (178.677964, 142.241841, 178.677964, 144.725856),\n (178.677964, 144.725856, 178.677964, 147.20987),\n (178.677964, 147.20987, 178.677964, 149.693885),\n (178.677964, 149.693885, 178.677964, 152.1779),\n (178.677964, 152.1779, 178.677964, 154.661915),\n (178.677964, 154.661915, 178.677964, 157.14593),\n (178.677964, 157.14593, 178.677964, 159.629944),\n (178.677964, 159.629944, 178.677964, 162.113959),\n (178.677964, 162.113959, 178.677964, 164.597974),\n (178.677964, 164.597974, 178.677964, 167.081989),\n (178.677964, 167.081989, 178.677964, 169.566003),\n (178.677964, 169.566003, 178.677964, 172.050018),\n (178.677964, 172.050018, 178.677964, 174.534033),\n (178.677964, 174.534033, 178.677964, 177.018048),\n (178.677964, 177.018048, 178.677964, 179.502062),\n (178.677964, 179.502062, 178.677964, 181.986077),\n (178.677964, 181.986077, 178.677964, 184.470092),\n (178.677964, 184.470092, 178.677964, 186.954107),\n (178.677964, 186.954107, 178.677964, 189.438122),\n (178.677964, 189.438122, 178.677964, 191.922136),\n (178.677964, 112.433664, 162.066437, 112.433664),\n (178.677964, 191.922136, 162.066437, 191.922136)\n]\nVISIBLE_CIRCLES = [\n (108.3222, 152.1779, 39.744236)\n]\nVISIBLE_ARCS = [\n\n]\nHIDDEN_SEGMENTS = [\n\n]\n# (orient, text, p1, p2, base) for linear; (orient, text, center, radius, angle) for diameter\nDIMENSIONS = [\n ('diameter', '%%c100', (108.3222, 152.1779), 39.7442, 45),\n ('horizontal', '20.898', (162.0664, 152.1779), (178.6779, 152.1779), (170.3721, 163.1779))\n]\n\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\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\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,\n angle=(0 if d[0] == \"horizontal\" else 90),\n 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,\n text=text, dimstyle=\"EZDXF\").render()\n\n doc.saveas(out_path)\n\n\nif __name__ == \"__main__\":\n out = sys.argv[1] if len(sys.argv) > 1 else \"0012_00121160_gt.dxf\"\n draw(out)\n print(\"wrote\", out)\n```"}], "images": ["images/0012_00121160.png"], "id": "0012_00121160"} {"messages": [{"role": "user", "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": "assistant", "content": "```python\n#!/usr/bin/env python3\n# -*- coding: utf-8 -*-\n# Ground-truth 2D engineering drawing for part: 0012_00122886\n# Self-contained: reproduces the three-view DXF via ezdxf, NO FreeCAD needed.\n# Coordinates are A4 page millimetres (scale=0.18731355932203736, page=[297.0, 210.0]).\n# visible edges -> solid (layer OUTLINE); hidden edges -> dashed (layer HIDDEN)\n# dimensions -> real movable DIMENSION entities (text = true mm value)\n# Run: python 0012_00122886_gt.py [out.dxf]\nimport sys\nimport ezdxf\n\nSCALE = 0.18731355932203736\nPAGE = [297.0, 210.0]\n\nVISIBLE_SEGMENTS = [\n (83.767122, 144.001522, 84.352477, 144.001522),\n (84.352477, 144.001522, 84.937832, 144.001522),\n (84.937832, 144.001522, 85.523187, 144.001522),\n (85.523187, 144.001522, 86.108542, 144.001522),\n (86.108542, 144.001522, 86.693896, 144.001522),\n (86.693896, 144.001522, 87.279251, 144.001522),\n (87.279251, 144.001522, 87.864606, 144.001522),\n (87.864606, 144.001522, 88.449961, 144.001522),\n (88.449961, 144.001522, 89.035316, 144.001522),\n (89.035316, 144.001522, 89.620671, 144.001522),\n (89.620671, 144.001522, 90.206026, 144.001522),\n (90.206026, 144.001522, 90.791381, 144.001522),\n (90.791381, 144.001522, 91.376735, 144.001522),\n (91.376735, 144.001522, 91.96209, 144.001522),\n (91.96209, 144.001522, 92.547445, 144.001522),\n (92.547445, 144.001522, 93.1328, 144.001522),\n (93.1328, 144.001522, 93.718155, 144.001522),\n (93.718155, 144.001522, 94.30351, 144.001522),\n (94.30351, 144.001522, 94.888865, 144.001522),\n (94.888865, 144.001522, 95.474219, 144.001522),\n (95.474219, 144.001522, 96.059574, 144.001522),\n (96.059574, 144.001522, 96.644929, 144.001522),\n (96.644929, 144.001522, 97.230284, 144.001522),\n (97.230284, 144.001522, 97.815639, 144.001522),\n (97.815639, 144.001522, 98.400994, 144.001522),\n (98.400994, 144.001522, 98.986349, 144.001522),\n (98.986349, 144.001522, 99.571704, 144.001522),\n (99.571704, 144.001522, 100.157058, 144.001522),\n (100.157058, 144.001522, 100.742413, 144.001522),\n (100.742413, 144.001522, 101.327768, 144.001522),\n (101.327768, 144.001522, 101.913123, 144.001522),\n (101.913123, 144.001522, 102.498478, 144.001522),\n (102.498478, 144.001522, 102.498478, 66.632878),\n (83.767122, 66.632878, 84.352477, 66.632878),\n (84.352477, 66.632878, 84.937832, 66.632878),\n (84.937832, 66.632878, 85.523187, 66.632878),\n (85.523187, 66.632878, 86.108542, 66.632878),\n (86.108542, 66.632878, 86.693896, 66.632878),\n (86.693896, 66.632878, 87.279251, 66.632878),\n (87.279251, 66.632878, 87.864606, 66.632878),\n (87.864606, 66.632878, 88.449961, 66.632878),\n (88.449961, 66.632878, 89.035316, 66.632878),\n (89.035316, 66.632878, 89.620671, 66.632878),\n (89.620671, 66.632878, 90.206026, 66.632878),\n (90.206026, 66.632878, 90.791381, 66.632878),\n (90.791381, 66.632878, 91.376735, 66.632878),\n (91.376735, 66.632878, 91.96209, 66.632878),\n (91.96209, 66.632878, 92.547445, 66.632878),\n (92.547445, 66.632878, 93.1328, 66.632878),\n (93.1328, 66.632878, 93.718155, 66.632878),\n (93.718155, 66.632878, 94.30351, 66.632878),\n (94.30351, 66.632878, 94.888865, 66.632878),\n (94.888865, 66.632878, 95.474219, 66.632878),\n (95.474219, 66.632878, 96.059574, 66.632878),\n (96.059574, 66.632878, 96.644929, 66.632878),\n (96.644929, 66.632878, 97.230284, 66.632878),\n (97.230284, 66.632878, 97.815639, 66.632878),\n (97.815639, 66.632878, 98.400994, 66.632878),\n (98.400994, 66.632878, 98.986349, 66.632878),\n (98.986349, 66.632878, 99.571704, 66.632878),\n (99.571704, 66.632878, 100.157058, 66.632878),\n (100.157058, 66.632878, 100.742413, 66.632878),\n (100.742413, 66.632878, 101.327768, 66.632878),\n (101.327768, 66.632878, 101.913123, 66.632878),\n (101.913123, 66.632878, 102.498478, 66.632878),\n (83.767122, 144.001522, 83.767122, 66.632878),\n (193.867122, 176.732878, 193.867122, 176.147523),\n (193.867122, 176.147523, 193.867122, 175.562168),\n (193.867122, 175.562168, 193.867122, 174.976813),\n (193.867122, 174.976813, 193.867122, 174.391458),\n (193.867122, 174.391458, 193.867122, 173.806104),\n (193.867122, 173.806104, 193.867122, 173.220749),\n (193.867122, 173.220749, 193.867122, 172.635394),\n (193.867122, 172.635394, 193.867122, 172.050039),\n (193.867122, 172.050039, 193.867122, 171.464684),\n (193.867122, 171.464684, 193.867122, 170.879329),\n (193.867122, 170.879329, 193.867122, 170.293974),\n (193.867122, 170.293974, 193.867122, 169.708619),\n (193.867122, 169.708619, 193.867122, 169.123265),\n (193.867122, 169.123265, 193.867122, 168.53791),\n (193.867122, 168.53791, 193.867122, 167.952555),\n (193.867122, 167.952555, 193.867122, 167.3672),\n (193.867122, 167.3672, 193.867122, 166.781845),\n (193.867122, 166.781845, 193.867122, 166.19649),\n (193.867122, 166.19649, 193.867122, 165.611135),\n (193.867122, 165.611135, 193.867122, 165.025781),\n (193.867122, 165.025781, 193.867122, 164.440426),\n (193.867122, 164.440426, 193.867122, 163.855071),\n (193.867122, 163.855071, 193.867122, 163.269716),\n (193.867122, 163.269716, 193.867122, 162.684361),\n (193.867122, 162.684361, 193.867122, 162.099006),\n (193.867122, 162.099006, 193.867122, 161.513651),\n (193.867122, 161.513651, 193.867122, 160.928296),\n (193.867122, 160.928296, 193.867122, 160.342942),\n (193.867122, 160.342942, 193.867122, 159.757587),\n (193.867122, 159.757587, 193.867122, 159.172232),\n (193.867122, 159.172232, 193.867122, 158.586877),\n (193.867122, 158.586877, 193.867122, 158.001522),\n (116.498478, 176.732878, 116.498478, 176.147523),\n (116.498478, 176.147523, 116.498478, 175.562168),\n (116.498478, 175.562168, 116.498478, 174.976813),\n (116.498478, 174.976813, 116.498478, 174.391458),\n (116.498478, 174.391458, 116.498478, 173.806104),\n (116.498478, 173.806104, 116.498478, 173.220749),\n (116.498478, 173.220749, 116.498478, 172.635394),\n (116.498478, 172.635394, 116.498478, 172.050039),\n (116.498478, 172.050039, 116.498478, 171.464684),\n (116.498478, 171.464684, 116.498478, 170.879329),\n (116.498478, 170.879329, 116.498478, 170.293974),\n (116.498478, 170.293974, 116.498478, 169.708619),\n (116.498478, 169.708619, 116.498478, 169.123265),\n (116.498478, 169.123265, 116.498478, 168.53791),\n (116.498478, 168.53791, 116.498478, 167.952555),\n (116.498478, 167.952555, 116.498478, 167.3672),\n (116.498478, 167.3672, 116.498478, 166.781845),\n (116.498478, 166.781845, 116.498478, 166.19649),\n (116.498478, 166.19649, 116.498478, 165.611135),\n (116.498478, 165.611135, 116.498478, 165.025781),\n (116.498478, 165.025781, 116.498478, 164.440426),\n (116.498478, 164.440426, 116.498478, 163.855071),\n (116.498478, 163.855071, 116.498478, 163.269716),\n (116.498478, 163.269716, 116.498478, 162.684361),\n (116.498478, 162.684361, 116.498478, 162.099006),\n (116.498478, 162.099006, 116.498478, 161.513651),\n (116.498478, 161.513651, 116.498478, 160.928296),\n (116.498478, 160.928296, 116.498478, 160.342942),\n (116.498478, 160.342942, 116.498478, 159.757587),\n (116.498478, 159.757587, 116.498478, 159.172232),\n (116.498478, 159.172232, 116.498478, 158.586877),\n (116.498478, 158.586877, 116.498478, 158.001522),\n (193.867122, 158.001522, 116.498478, 158.001522),\n (193.867122, 176.732878, 116.498478, 176.732878)\n]\nVISIBLE_CIRCLES = [\n (93.1328, 167.3672, 9.365678)\n]\nVISIBLE_ARCS = [\n\n]\nHIDDEN_SEGMENTS = [\n\n]\n# (orient, text, p1, p2, base) for linear; (orient, text, center, radius, angle) for diameter\nDIMENSIONS = [\n ('diameter', '%%c100', (93.1328, 167.3672), 9.3657, 45),\n ('horizontal', '413.043', (116.4985, 167.3672), (193.8672, 167.3672), (155.1828, 178.3672))\n]\n\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\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\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,\n angle=(0 if d[0] == \"horizontal\" else 90),\n 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,\n text=text, dimstyle=\"EZDXF\").render()\n\n doc.saveas(out_path)\n\n\nif __name__ == \"__main__\":\n out = sys.argv[1] if len(sys.argv) > 1 else \"0012_00122886_gt.dxf\"\n draw(out)\n print(\"wrote\", out)\n```"}], "images": ["images/0012_00122886.png"], "id": "0012_00122886"} {"messages": [{"role": "user", "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 202.13 mm."}, {"role": "assistant", "content": "```python\n#!/usr/bin/env python3\n# -*- coding: utf-8 -*-\n# Ground-truth 2D engineering drawing for part: 0012_00122996\n# Self-contained: reproduces the three-view DXF via ezdxf, NO FreeCAD needed.\n# Coordinates are A4 page millimetres (scale=0.19057805907175873, page=[297.0, 210.0]).\n# visible edges -> solid (layer OUTLINE); hidden edges -> dashed (layer HIDDEN)\n# dimensions -> real movable DIMENSION entities (text = true mm value)\n# Run: python 0012_00122996_gt.py [out.dxf]\nimport sys\nimport ezdxf\n\nSCALE = 0.19057805907175873\nPAGE = [297.0, 210.0]\n\nVISIBLE_SEGMENTS = [\n (102.743403, 105.2355, 102.743403, 66.714403),\n (83.685597, 66.714403, 84.281153, 66.714403),\n (84.281153, 66.714403, 84.87671, 66.714403),\n (84.87671, 66.714403, 85.472266, 66.714403),\n (85.472266, 66.714403, 86.067823, 66.714403),\n (86.067823, 66.714403, 86.663379, 66.714403),\n (86.663379, 66.714403, 87.258936, 66.714403),\n (87.258936, 66.714403, 87.854492, 66.714403),\n (87.854492, 66.714403, 88.450049, 66.714403),\n (88.450049, 66.714403, 89.045605, 66.714403),\n (89.045605, 66.714403, 89.641161, 66.714403),\n (89.641161, 66.714403, 90.236718, 66.714403),\n (90.236718, 66.714403, 90.832274, 66.714403),\n (90.832274, 66.714403, 91.427831, 66.714403),\n (91.427831, 66.714403, 92.023387, 66.714403),\n (92.023387, 66.714403, 92.618944, 66.714403),\n (92.618944, 66.714403, 93.2145, 66.714403),\n (93.2145, 66.714403, 93.810056, 66.714403),\n (93.810056, 66.714403, 94.405613, 66.714403),\n (94.405613, 66.714403, 95.001169, 66.714403),\n (95.001169, 66.714403, 95.596726, 66.714403),\n (95.596726, 66.714403, 96.192282, 66.714403),\n (96.192282, 66.714403, 96.787839, 66.714403),\n (96.787839, 66.714403, 97.383395, 66.714403),\n (97.383395, 66.714403, 97.978951, 66.714403),\n (97.978951, 66.714403, 98.574508, 66.714403),\n (98.574508, 66.714403, 99.170064, 66.714403),\n (99.170064, 66.714403, 99.765621, 66.714403),\n (99.765621, 66.714403, 100.361177, 66.714403),\n (100.361177, 66.714403, 100.956734, 66.714403),\n (100.956734, 66.714403, 101.55229, 66.714403),\n (101.55229, 66.714403, 102.147847, 66.714403),\n (102.147847, 66.714403, 102.743403, 66.714403),\n (102.743403, 105.2355, 102.743403, 143.756597),\n (83.685597, 143.756597, 84.281153, 143.756597),\n (84.281153, 143.756597, 84.87671, 143.756597),\n (84.87671, 143.756597, 85.472266, 143.756597),\n (85.472266, 143.756597, 86.067823, 143.756597),\n (86.067823, 143.756597, 86.663379, 143.756597),\n (86.663379, 143.756597, 87.258936, 143.756597),\n (87.258936, 143.756597, 87.854492, 143.756597),\n (87.854492, 143.756597, 88.450049, 143.756597),\n (88.450049, 143.756597, 89.045605, 143.756597),\n (89.045605, 143.756597, 89.641161, 143.756597),\n (89.641161, 143.756597, 90.236718, 143.756597),\n (90.236718, 143.756597, 90.832274, 143.756597),\n (90.832274, 143.756597, 91.427831, 143.756597),\n (91.427831, 143.756597, 92.023387, 143.756597),\n (92.023387, 143.756597, 92.618944, 143.756597),\n (92.618944, 143.756597, 93.2145, 143.756597),\n (93.2145, 143.756597, 93.810056, 143.756597),\n (93.810056, 143.756597, 94.405613, 143.756597),\n (94.405613, 143.756597, 95.001169, 143.756597),\n (95.001169, 143.756597, 95.596726, 143.756597),\n (95.596726, 143.756597, 96.192282, 143.756597),\n (96.192282, 143.756597, 96.787839, 143.756597),\n (96.787839, 143.756597, 97.383395, 143.756597),\n (97.383395, 143.756597, 97.978951, 143.756597),\n (97.978951, 143.756597, 98.574508, 143.756597),\n (98.574508, 143.756597, 99.170064, 143.756597),\n (99.170064, 143.756597, 99.765621, 143.756597),\n (99.765621, 143.756597, 100.361177, 143.756597),\n (100.361177, 143.756597, 100.956734, 143.756597),\n (100.956734, 143.756597, 101.55229, 143.756597),\n (101.55229, 143.756597, 102.147847, 143.756597),\n (102.147847, 143.756597, 102.743403, 143.756597),\n (83.685597, 66.714403, 83.685597, 105.2355),\n (83.685597, 143.756597, 83.685597, 105.2355),\n (116.743403, 176.814403, 116.743403, 176.218847),\n (116.743403, 176.218847, 116.743403, 175.62329),\n (116.743403, 175.62329, 116.743403, 175.027734),\n (116.743403, 175.027734, 116.743403, 174.432177),\n (116.743403, 174.432177, 116.743403, 173.836621),\n (116.743403, 173.836621, 116.743403, 173.241064),\n (116.743403, 173.241064, 116.743403, 172.645508),\n (116.743403, 172.645508, 116.743403, 172.049951),\n (116.743403, 172.049951, 116.743403, 171.454395),\n (116.743403, 171.454395, 116.743403, 170.858839),\n (116.743403, 170.858839, 116.743403, 170.263282),\n (116.743403, 170.263282, 116.743403, 169.667726),\n (116.743403, 169.667726, 116.743403, 169.072169),\n (116.743403, 169.072169, 116.743403, 168.476613),\n (116.743403, 168.476613, 116.743403, 167.881056),\n (116.743403, 167.881056, 116.743403, 167.2855),\n (116.743403, 167.2855, 116.743403, 166.689944),\n (116.743403, 166.689944, 116.743403, 166.094387),\n (116.743403, 166.094387, 116.743403, 165.498831),\n (116.743403, 165.498831, 116.743403, 164.903274),\n (116.743403, 164.903274, 116.743403, 164.307718),\n (116.743403, 164.307718, 116.743403, 163.712161),\n (116.743403, 163.712161, 116.743403, 163.116605),\n (116.743403, 163.116605, 116.743403, 162.521049),\n (116.743403, 162.521049, 116.743403, 161.925492),\n (116.743403, 161.925492, 116.743403, 161.329936),\n (116.743403, 161.329936, 116.743403, 160.734379),\n (116.743403, 160.734379, 116.743403, 160.138823),\n (116.743403, 160.138823, 116.743403, 159.543266),\n (116.743403, 159.543266, 116.743403, 158.94771),\n (116.743403, 158.94771, 116.743403, 158.352153),\n (116.743403, 158.352153, 116.743403, 157.756597),\n (193.785597, 176.814403, 193.785597, 176.218847),\n (193.785597, 176.218847, 193.785597, 175.62329),\n (193.785597, 175.62329, 193.785597, 175.027734),\n (193.785597, 175.027734, 193.785597, 174.432177),\n (193.785597, 174.432177, 193.785597, 173.836621),\n (193.785597, 173.836621, 193.785597, 173.241064),\n (193.785597, 173.241064, 193.785597, 172.645508),\n (193.785597, 172.645508, 193.785597, 172.049951),\n (193.785597, 172.049951, 193.785597, 171.454395),\n (193.785597, 171.454395, 193.785597, 170.858839),\n (193.785597, 170.858839, 193.785597, 170.263282),\n (193.785597, 170.263282, 193.785597, 169.667726),\n (193.785597, 169.667726, 193.785597, 169.072169),\n (193.785597, 169.072169, 193.785597, 168.476613),\n (193.785597, 168.476613, 193.785597, 167.881056),\n (193.785597, 167.881056, 193.785597, 167.2855),\n (193.785597, 167.2855, 193.785597, 166.689944),\n (193.785597, 166.689944, 193.785597, 166.094387),\n (193.785597, 166.094387, 193.785597, 165.498831),\n (193.785597, 165.498831, 193.785597, 164.903274),\n (193.785597, 164.903274, 193.785597, 164.307718),\n (193.785597, 164.307718, 193.785597, 163.712161),\n (193.785597, 163.712161, 193.785597, 163.116605),\n (193.785597, 163.116605, 193.785597, 162.521049),\n (193.785597, 162.521049, 193.785597, 161.925492),\n (193.785597, 161.925492, 193.785597, 161.329936),\n (193.785597, 161.329936, 193.785597, 160.734379),\n (193.785597, 160.734379, 193.785597, 160.138823),\n (193.785597, 160.138823, 193.785597, 159.543266),\n (193.785597, 159.543266, 193.785597, 158.94771),\n (193.785597, 158.94771, 193.785597, 158.352153),\n (193.785597, 158.352153, 193.785597, 157.756597),\n (116.743403, 176.814403, 155.2645, 176.814403),\n (116.743403, 157.756597, 155.2645, 157.756597),\n (193.785597, 157.756597, 155.2645, 157.756597),\n (193.785597, 176.814403, 155.2645, 176.814403)\n]\nVISIBLE_CIRCLES = [\n (93.2145, 167.2855, 9.528903)\n]\nVISIBLE_ARCS = [\n\n]\nHIDDEN_SEGMENTS = [\n\n]\n# (orient, text, p1, p2, base) for linear; (orient, text, center, radius, angle) for diameter\nDIMENSIONS = [\n ('diameter', '%%c100', (93.2145, 167.2855), 9.5289, 45),\n ('horizontal', '404.255', (193.7856, 167.2855), (116.7433, 167.2855), (155.2645, 156.2855))\n]\n\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\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\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,\n angle=(0 if d[0] == \"horizontal\" else 90),\n 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,\n text=text, dimstyle=\"EZDXF\").render()\n\n doc.saveas(out_path)\n\n\nif __name__ == \"__main__\":\n out = sys.argv[1] if len(sys.argv) > 1 else \"0012_00122996_gt.dxf\"\n draw(out)\n print(\"wrote\", out)\n```"}], "images": ["images/0012_00122996.png"], "id": "0012_00122996"} {"messages": [{"role": "user", "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 7.73 mm."}, {"role": "assistant", "content": "```python\n#!/usr/bin/env python3\n# -*- coding: utf-8 -*-\n# Ground-truth 2D engineering drawing for part: 0012_00124460\n# Self-contained: reproduces the three-view DXF via ezdxf, NO FreeCAD needed.\n# Coordinates are A4 page millimetres (scale=0.8920356549327666, page=[297.0, 210.0]).\n# visible edges -> solid (layer OUTLINE); hidden edges -> dashed (layer HIDDEN)\n# dimensions -> real movable DIMENSION entities (text = true mm value)\n# Run: python 0012_00124460_gt.py [out.dxf]\nimport sys\nimport ezdxf\n\nSCALE = 0.8920356549327666\nPAGE = [297.0, 210.0]\n\nVISIBLE_SEGMENTS = [\n (155.352683, 84.250883, 152.565071, 84.250883),\n (152.565071, 84.250883, 149.77746, 84.250883),\n (149.77746, 84.250883, 146.989848, 84.250883),\n (146.989848, 84.250883, 144.202237, 84.250883),\n (144.202237, 84.250883, 141.414626, 84.250883),\n (141.414626, 84.250883, 138.627014, 84.250883),\n (138.627014, 84.250883, 135.839403, 84.250883),\n (135.839403, 84.250883, 133.051791, 84.250883),\n (133.051791, 84.250883, 130.26418, 84.250883),\n (130.26418, 84.250883, 127.476569, 84.250883),\n (127.476569, 84.250883, 124.688957, 84.250883),\n (124.688957, 84.250883, 121.901346, 84.250883),\n (121.901346, 84.250883, 119.113734, 84.250883),\n (119.113734, 84.250883, 116.326123, 84.250883),\n (116.326123, 84.250883, 113.538511, 84.250883),\n (113.538511, 84.250883, 110.7509, 84.250883),\n (110.7509, 84.250883, 107.963289, 84.250883),\n (107.963289, 84.250883, 105.175677, 84.250883),\n (105.175677, 84.250883, 102.388066, 84.250883),\n (102.388066, 84.250883, 99.600454, 84.250883),\n (99.600454, 84.250883, 96.812843, 84.250883),\n (96.812843, 84.250883, 94.025231, 84.250883),\n (94.025231, 84.250883, 91.23762, 84.250883),\n (91.23762, 84.250883, 88.450009, 84.250883),\n (88.450009, 84.250883, 85.662397, 84.250883),\n (85.662397, 84.250883, 82.874786, 84.250883),\n (82.874786, 84.250883, 80.087174, 84.250883),\n (80.087174, 84.250883, 77.299563, 84.250883),\n (77.299563, 84.250883, 74.511952, 84.250883),\n (74.511952, 84.250883, 71.72434, 84.250883),\n (71.72434, 84.250883, 68.936729, 84.250883),\n (68.936729, 84.250883, 66.149117, 84.250883),\n (155.352683, 84.250883, 155.352683, 91.147317),\n (155.352683, 91.147317, 152.565071, 91.147317),\n (152.565071, 91.147317, 149.77746, 91.147317),\n (149.77746, 91.147317, 146.989848, 91.147317),\n (146.989848, 91.147317, 144.202237, 91.147317),\n (144.202237, 91.147317, 141.414626, 91.147317),\n (141.414626, 91.147317, 138.627014, 91.147317),\n (138.627014, 91.147317, 135.839403, 91.147317),\n (135.839403, 91.147317, 133.051791, 91.147317),\n (133.051791, 91.147317, 130.26418, 91.147317),\n (130.26418, 91.147317, 127.476569, 91.147317),\n (127.476569, 91.147317, 124.688957, 91.147317),\n (124.688957, 91.147317, 121.901346, 91.147317),\n (121.901346, 91.147317, 119.113734, 91.147317),\n (119.113734, 91.147317, 116.326123, 91.147317),\n (116.326123, 91.147317, 113.538511, 91.147317),\n (113.538511, 91.147317, 110.7509, 91.147317),\n (110.7509, 91.147317, 107.963289, 91.147317),\n (107.963289, 91.147317, 105.175677, 91.147317),\n (105.175677, 91.147317, 102.388066, 91.147317),\n (102.388066, 91.147317, 99.600454, 91.147317),\n (99.600454, 91.147317, 96.812843, 91.147317),\n (96.812843, 91.147317, 94.025231, 91.147317),\n (94.025231, 91.147317, 91.23762, 91.147317),\n (91.23762, 91.147317, 88.450009, 91.147317),\n (88.450009, 91.147317, 85.662397, 91.147317),\n (85.662397, 91.147317, 82.874786, 91.147317),\n (82.874786, 91.147317, 80.087174, 91.147317),\n (80.087174, 91.147317, 77.299563, 91.147317),\n (77.299563, 91.147317, 74.511952, 91.147317),\n (74.511952, 91.147317, 71.72434, 91.147317),\n (71.72434, 91.147317, 68.936729, 91.147317),\n (68.936729, 91.147317, 66.149117, 91.147317),\n (66.149117, 91.147317, 66.149117, 84.250883),\n (169.352683, 105.147317, 169.352683, 107.934929),\n (169.352683, 107.934929, 169.352683, 110.72254),\n (169.352683, 110.72254, 169.352683, 113.510152),\n (169.352683, 113.510152, 169.352683, 116.297763),\n (169.352683, 116.297763, 169.352683, 119.085374),\n (169.352683, 119.085374, 169.352683, 121.872986),\n (169.352683, 121.872986, 169.352683, 124.660597),\n (169.352683, 124.660597, 169.352683, 127.448209),\n (169.352683, 127.448209, 169.352683, 130.23582),\n (169.352683, 130.23582, 169.352683, 133.023431),\n (169.352683, 133.023431, 169.352683, 135.811043),\n (169.352683, 135.811043, 169.352683, 138.598654),\n (169.352683, 138.598654, 169.352683, 141.386266),\n (169.352683, 141.386266, 169.352683, 144.173877),\n (169.352683, 144.173877, 169.352683, 146.961489),\n (169.352683, 146.961489, 169.352683, 149.7491),\n (169.352683, 149.7491, 169.352683, 152.536711),\n (169.352683, 152.536711, 169.352683, 155.324323),\n (169.352683, 155.324323, 169.352683, 158.111934),\n (169.352683, 158.111934, 169.352683, 160.899546),\n (169.352683, 160.899546, 169.352683, 163.687157),\n (169.352683, 163.687157, 169.352683, 166.474769),\n (169.352683, 166.474769, 169.352683, 169.26238),\n (169.352683, 169.26238, 169.352683, 172.049991),\n (169.352683, 172.049991, 169.352683, 174.837603),\n (169.352683, 174.837603, 169.352683, 177.625214),\n (169.352683, 177.625214, 169.352683, 180.412826),\n (169.352683, 180.412826, 169.352683, 183.200437),\n (169.352683, 183.200437, 169.352683, 185.988048),\n (169.352683, 185.988048, 169.352683, 188.77566),\n (169.352683, 188.77566, 169.352683, 191.563271),\n (169.352683, 191.563271, 169.352683, 194.350883),\n (176.249117, 105.147317, 176.249117, 107.934929),\n (176.249117, 107.934929, 176.249117, 110.72254),\n (176.249117, 110.72254, 176.249117, 113.510152),\n (176.249117, 113.510152, 176.249117, 116.297763),\n (176.249117, 116.297763, 176.249117, 119.085374),\n (176.249117, 119.085374, 176.249117, 121.872986),\n (176.249117, 121.872986, 176.249117, 124.660597),\n (176.249117, 124.660597, 176.249117, 127.448209),\n (176.249117, 127.448209, 176.249117, 130.23582),\n (176.249117, 130.23582, 176.249117, 133.023431),\n (176.249117, 133.023431, 176.249117, 135.811043),\n (176.249117, 135.811043, 176.249117, 138.598654),\n (176.249117, 138.598654, 176.249117, 141.386266),\n (176.249117, 141.386266, 176.249117, 144.173877),\n (176.249117, 144.173877, 176.249117, 146.961489),\n (176.249117, 146.961489, 176.249117, 149.7491),\n (176.249117, 149.7491, 176.249117, 152.536711),\n (176.249117, 152.536711, 176.249117, 155.324323),\n (176.249117, 155.324323, 176.249117, 158.111934),\n (176.249117, 158.111934, 176.249117, 160.899546),\n (176.249117, 160.899546, 176.249117, 163.687157),\n (176.249117, 163.687157, 176.249117, 166.474769),\n (176.249117, 166.474769, 176.249117, 169.26238),\n (176.249117, 169.26238, 176.249117, 172.049991),\n (176.249117, 172.049991, 176.249117, 174.837603),\n (176.249117, 174.837603, 176.249117, 177.625214),\n (176.249117, 177.625214, 176.249117, 180.412826),\n (176.249117, 180.412826, 176.249117, 183.200437),\n (176.249117, 183.200437, 176.249117, 185.988048),\n (176.249117, 185.988048, 176.249117, 188.77566),\n (176.249117, 188.77566, 176.249117, 191.563271),\n (176.249117, 191.563271, 176.249117, 194.350883),\n (176.249117, 105.147317, 169.352683, 105.147317),\n (176.249117, 194.350883, 169.352683, 194.350883)\n]\nVISIBLE_CIRCLES = [\n (110.7509, 149.7491, 44.601783)\n]\nVISIBLE_ARCS = [\n\n]\nHIDDEN_SEGMENTS = [\n\n]\n# (orient, text, p1, p2, base) for linear; (orient, text, center, radius, angle) for diameter\nDIMENSIONS = [\n ('diameter', '%%c100', (110.7509, 149.7491), 44.6018, 45),\n ('horizontal', '7.7311', (169.3527, 149.7491), (176.2491, 149.7491), (172.8009, 160.7491))\n]\n\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\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\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,\n angle=(0 if d[0] == \"horizontal\" else 90),\n 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,\n text=text, dimstyle=\"EZDXF\").render()\n\n doc.saveas(out_path)\n\n\nif __name__ == \"__main__\":\n out = sys.argv[1] if len(sys.argv) > 1 else \"0012_00124460_gt.dxf\"\n draw(out)\n print(\"wrote\", out)\n```"}], "images": ["images/0012_00124460.png"], "id": "0012_00124460"} {"messages": [{"role": "user", "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": "assistant", "content": "```python\n#!/usr/bin/env python3\n# -*- coding: utf-8 -*-\n# Ground-truth 2D engineering drawing for part: 0012_00124665\n# Self-contained: reproduces the three-view DXF via ezdxf, NO FreeCAD needed.\n# Coordinates are A4 page millimetres (scale=0.21268032786885335, page=[297.0, 210.0]).\n# visible edges -> solid (layer OUTLINE); hidden edges -> dashed (layer HIDDEN)\n# dimensions -> real movable DIMENSION entities (text = true mm value)\n# Run: python 0012_00124665_gt.py [out.dxf]\nimport sys\nimport ezdxf\n\nSCALE = 0.21268032786885335\nPAGE = [297.0, 210.0]\n\nVISIBLE_SEGMENTS = [\n (104.401016, 67.267016, 103.73639, 67.267016),\n (103.73639, 67.267016, 103.071764, 67.267016),\n (103.071764, 67.267016, 102.407138, 67.267016),\n (102.407138, 67.267016, 101.742512, 67.267016),\n (101.742512, 67.267016, 101.077886, 67.267016),\n (101.077886, 67.267016, 100.41326, 67.267016),\n (100.41326, 67.267016, 99.748634, 67.267016),\n (99.748634, 67.267016, 99.084008, 67.267016),\n (99.084008, 67.267016, 98.419382, 67.267016),\n (98.419382, 67.267016, 97.754756, 67.267016),\n (97.754756, 67.267016, 97.09013, 67.267016),\n (97.09013, 67.267016, 96.425504, 67.267016),\n (96.425504, 67.267016, 95.760878, 67.267016),\n (95.760878, 67.267016, 95.096252, 67.267016),\n (95.096252, 67.267016, 94.431626, 67.267016),\n (94.431626, 67.267016, 93.767, 67.267016),\n (93.767, 67.267016, 93.102374, 67.267016),\n (93.102374, 67.267016, 92.437748, 67.267016),\n (92.437748, 67.267016, 91.773122, 67.267016),\n (91.773122, 67.267016, 91.108496, 67.267016),\n (91.108496, 67.267016, 90.44387, 67.267016),\n (90.44387, 67.267016, 89.779244, 67.267016),\n (89.779244, 67.267016, 89.114618, 67.267016),\n (89.114618, 67.267016, 88.449992, 67.267016),\n (88.449992, 67.267016, 87.785366, 67.267016),\n (87.785366, 67.267016, 87.12074, 67.267016),\n (87.12074, 67.267016, 86.456114, 67.267016),\n (86.456114, 67.267016, 85.791488, 67.267016),\n (85.791488, 67.267016, 85.126862, 67.267016),\n (85.126862, 67.267016, 84.462236, 67.267016),\n (84.462236, 67.267016, 83.79761, 67.267016),\n (83.79761, 67.267016, 83.132984, 67.267016),\n (104.401016, 67.267016, 104.401016, 142.098983),\n (104.401016, 142.098983, 103.73639, 142.098983),\n (103.73639, 142.098983, 103.071764, 142.098983),\n (103.071764, 142.098983, 102.407138, 142.098983),\n (102.407138, 142.098983, 101.742512, 142.098983),\n (101.742512, 142.098983, 101.077886, 142.098983),\n (101.077886, 142.098983, 100.41326, 142.098983),\n (100.41326, 142.098983, 99.748634, 142.098983),\n (99.748634, 142.098983, 99.084008, 142.098983),\n (99.084008, 142.098983, 98.419382, 142.098983),\n (98.419382, 142.098983, 97.754756, 142.098983),\n (97.754756, 142.098983, 97.09013, 142.098983),\n (97.09013, 142.098983, 96.425504, 142.098983),\n (96.425504, 142.098983, 95.760878, 142.098983),\n (95.760878, 142.098983, 95.096252, 142.098983),\n (95.096252, 142.098983, 94.431626, 142.098983),\n (94.431626, 142.098983, 93.767, 142.098983),\n (93.767, 142.098983, 93.102374, 142.098983),\n (93.102374, 142.098983, 92.437748, 142.098983),\n (92.437748, 142.098983, 91.773122, 142.098983),\n (91.773122, 142.098983, 91.108496, 142.098983),\n (91.108496, 142.098983, 90.44387, 142.098983),\n (90.44387, 142.098983, 89.779244, 142.098983),\n (89.779244, 142.098983, 89.114618, 142.098983),\n (89.114618, 142.098983, 88.449992, 142.098983),\n (88.449992, 142.098983, 87.785366, 142.098983),\n (87.785366, 142.098983, 87.12074, 142.098983),\n (87.12074, 142.098983, 86.456114, 142.098983),\n (86.456114, 142.098983, 85.791488, 142.098983),\n (85.791488, 142.098983, 85.126862, 142.098983),\n (85.126862, 142.098983, 84.462236, 142.098983),\n (84.462236, 142.098983, 83.79761, 142.098983),\n (83.79761, 142.098983, 83.132984, 142.098983),\n (83.132984, 142.098983, 83.132984, 67.267016),\n (118.401017, 156.098984, 118.401017, 156.76361),\n (118.401017, 156.76361, 118.401017, 157.428236),\n (118.401017, 157.428236, 118.401017, 158.092862),\n (118.401017, 158.092862, 118.401017, 158.757488),\n (118.401017, 158.757488, 118.401017, 159.422114),\n (118.401017, 159.422114, 118.401017, 160.08674),\n (118.401017, 160.08674, 118.401017, 160.751366),\n (118.401017, 160.751366, 118.401017, 161.415992),\n (118.401017, 161.415992, 118.401017, 162.080618),\n (118.401017, 162.080618, 118.401017, 162.745244),\n (118.401017, 162.745244, 118.401017, 163.40987),\n (118.401017, 163.40987, 118.401017, 164.074496),\n (118.401017, 164.074496, 118.401017, 164.739122),\n (118.401017, 164.739122, 118.401017, 165.403748),\n (118.401017, 165.403748, 118.401017, 166.068374),\n (118.401017, 166.068374, 118.401017, 166.733),\n (118.401017, 166.733, 118.401017, 167.397626),\n (118.401017, 167.397626, 118.401017, 168.062252),\n (118.401017, 168.062252, 118.401017, 168.726878),\n (118.401017, 168.726878, 118.401017, 169.391504),\n (118.401017, 169.391504, 118.401017, 170.05613),\n (118.401017, 170.05613, 118.401017, 170.720756),\n (118.401017, 170.720756, 118.401017, 171.385382),\n (118.401017, 171.385382, 118.401017, 172.050008),\n (118.401017, 172.050008, 118.401017, 172.714634),\n (118.401017, 172.714634, 118.401017, 173.37926),\n (118.401017, 173.37926, 118.401017, 174.043886),\n (118.401017, 174.043886, 118.401017, 174.708512),\n (118.401017, 174.708512, 118.401017, 175.373138),\n (118.401017, 175.373138, 118.401017, 176.037764),\n (118.401017, 176.037764, 118.401017, 176.70239),\n (118.401017, 176.70239, 118.401017, 177.367016),\n (193.232984, 156.098984, 193.232984, 156.76361),\n (193.232984, 156.76361, 193.232984, 157.428236),\n (193.232984, 157.428236, 193.232984, 158.092862),\n (193.232984, 158.092862, 193.232984, 158.757488),\n (193.232984, 158.757488, 193.232984, 159.422114),\n (193.232984, 159.422114, 193.232984, 160.08674),\n (193.232984, 160.08674, 193.232984, 160.751366),\n (193.232984, 160.751366, 193.232984, 161.415992),\n (193.232984, 161.415992, 193.232984, 162.080618),\n (193.232984, 162.080618, 193.232984, 162.745244),\n (193.232984, 162.745244, 193.232984, 163.40987),\n (193.232984, 163.40987, 193.232984, 164.074496),\n (193.232984, 164.074496, 193.232984, 164.739122),\n (193.232984, 164.739122, 193.232984, 165.403748),\n (193.232984, 165.403748, 193.232984, 166.068374),\n (193.232984, 166.068374, 193.232984, 166.733),\n (193.232984, 166.733, 193.232984, 167.397626),\n (193.232984, 167.397626, 193.232984, 168.062252),\n (193.232984, 168.062252, 193.232984, 168.726878),\n (193.232984, 168.726878, 193.232984, 169.391504),\n (193.232984, 169.391504, 193.232984, 170.05613),\n (193.232984, 170.05613, 193.232984, 170.720756),\n (193.232984, 170.720756, 193.232984, 171.385382),\n (193.232984, 171.385382, 193.232984, 172.050008),\n (193.232984, 172.050008, 193.232984, 172.714634),\n (193.232984, 172.714634, 193.232984, 173.37926),\n (193.232984, 173.37926, 193.232984, 174.043886),\n (193.232984, 174.043886, 193.232984, 174.708512),\n (193.232984, 174.708512, 193.232984, 175.373138),\n (193.232984, 175.373138, 193.232984, 176.037764),\n (193.232984, 176.037764, 193.232984, 176.70239),\n (193.232984, 176.70239, 193.232984, 177.367016),\n (193.232984, 156.098984, 118.401017, 156.098984),\n (193.232984, 177.367016, 118.401017, 177.367016)\n]\nVISIBLE_CIRCLES = [\n (93.767, 166.733, 10.634016)\n]\nVISIBLE_ARCS = [\n\n]\nHIDDEN_SEGMENTS = [\n\n]\n# (orient, text, p1, p2, base) for linear; (orient, text, center, radius, angle) for diameter\nDIMENSIONS = [\n ('diameter', '%%c100', (93.767, 166.733), 10.634, 45),\n ('horizontal', '351.852', (118.401, 166.733), (193.233, 166.733), (155.817, 177.733))\n]\n\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\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\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,\n angle=(0 if d[0] == \"horizontal\" else 90),\n 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,\n text=text, dimstyle=\"EZDXF\").render()\n\n doc.saveas(out_path)\n\n\nif __name__ == \"__main__\":\n out = sys.argv[1] if len(sys.argv) > 1 else \"0012_00124665_gt.dxf\"\n draw(out)\n print(\"wrote\", out)\n```"}], "images": ["images/0012_00124665.png"], "id": "0012_00124665"} {"messages": [{"role": "user", "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 109.01 mm."}, {"role": "assistant", "content": "```python\n#!/usr/bin/env python3\n# -*- coding: utf-8 -*-\n# Ground-truth 2D engineering drawing for part: 0014_00147257\n# Self-contained: reproduces the three-view DXF via ezdxf, NO FreeCAD needed.\n# Coordinates are A4 page millimetres (scale=0.459780738876832, page=[297.0, 210.0]).\n# visible edges -> solid (layer OUTLINE); hidden edges -> dashed (layer HIDDEN)\n# dimensions -> real movable DIMENSION entities (text = true mm value)\n# Run: python 0014_00147257_gt.py [out.dxf]\nimport sys\nimport ezdxf\n\nSCALE = 0.459780738876832\nPAGE = [297.0, 210.0]\n\nVISIBLE_SEGMENTS = [\n (122.933537, 73.444537, 121.496722, 73.444537),\n (121.496722, 73.444537, 120.059907, 73.444537),\n (120.059907, 73.444537, 118.623093, 73.444537),\n (118.623093, 73.444537, 117.186278, 73.444537),\n (117.186278, 73.444537, 115.749463, 73.444537),\n (115.749463, 73.444537, 114.312648, 73.444537),\n (114.312648, 73.444537, 112.875833, 73.444537),\n (112.875833, 73.444537, 111.439018, 73.444537),\n (111.439018, 73.444537, 110.002204, 73.444537),\n (110.002204, 73.444537, 108.565389, 73.444537),\n (108.565389, 73.444537, 107.128574, 73.444537),\n (107.128574, 73.444537, 105.691759, 73.444537),\n (105.691759, 73.444537, 104.254944, 73.444537),\n (104.254944, 73.444537, 102.81813, 73.444537),\n (102.81813, 73.444537, 101.381315, 73.444537),\n (101.381315, 73.444537, 99.9445, 73.444537),\n (99.9445, 73.444537, 98.507685, 73.444537),\n (98.507685, 73.444537, 97.07087, 73.444537),\n (97.07087, 73.444537, 95.634056, 73.444537),\n (95.634056, 73.444537, 94.197241, 73.444537),\n (94.197241, 73.444537, 92.760426, 73.444537),\n (92.760426, 73.444537, 91.323611, 73.444537),\n (91.323611, 73.444537, 89.886796, 73.444537),\n (89.886796, 73.444537, 88.449982, 73.444537),\n (88.449982, 73.444537, 87.013167, 73.444537),\n (87.013167, 73.444537, 85.576352, 73.444537),\n (85.576352, 73.444537, 84.139537, 73.444537),\n (84.139537, 73.444537, 82.702722, 73.444537),\n (82.702722, 73.444537, 81.265907, 73.444537),\n (81.265907, 73.444537, 79.829093, 73.444537),\n (79.829093, 73.444537, 78.392278, 73.444537),\n (78.392278, 73.444537, 76.955463, 73.444537),\n (122.933537, 73.444537, 122.933537, 123.566463),\n (122.933537, 123.566463, 121.496722, 123.566463),\n (121.496722, 123.566463, 120.059907, 123.566463),\n (120.059907, 123.566463, 118.623093, 123.566463),\n (118.623093, 123.566463, 117.186278, 123.566463),\n (117.186278, 123.566463, 115.749463, 123.566463),\n (115.749463, 123.566463, 114.312648, 123.566463),\n (114.312648, 123.566463, 112.875833, 123.566463),\n (112.875833, 123.566463, 111.439018, 123.566463),\n (111.439018, 123.566463, 110.002204, 123.566463),\n (110.002204, 123.566463, 108.565389, 123.566463),\n (108.565389, 123.566463, 107.128574, 123.566463),\n (107.128574, 123.566463, 105.691759, 123.566463),\n (105.691759, 123.566463, 104.254944, 123.566463),\n (104.254944, 123.566463, 102.81813, 123.566463),\n (102.81813, 123.566463, 101.381315, 123.566463),\n (101.381315, 123.566463, 99.9445, 123.566463),\n (99.9445, 123.566463, 98.507685, 123.566463),\n (98.507685, 123.566463, 97.07087, 123.566463),\n (97.07087, 123.566463, 95.634056, 123.566463),\n (95.634056, 123.566463, 94.197241, 123.566463),\n (94.197241, 123.566463, 92.760426, 123.566463),\n (92.760426, 123.566463, 91.323611, 123.566463),\n (91.323611, 123.566463, 89.886796, 123.566463),\n (89.886796, 123.566463, 88.449982, 123.566463),\n (88.449982, 123.566463, 87.013167, 123.566463),\n (87.013167, 123.566463, 85.576352, 123.566463),\n (85.576352, 123.566463, 84.139537, 123.566463),\n (84.139537, 123.566463, 82.702722, 123.566463),\n (82.702722, 123.566463, 81.265907, 123.566463),\n (81.265907, 123.566463, 79.829093, 123.566463),\n (79.829093, 123.566463, 78.392278, 123.566463),\n (78.392278, 123.566463, 76.955463, 123.566463),\n (76.955463, 123.566463, 76.955463, 73.444537),\n (136.933537, 137.566463, 136.933537, 139.003278),\n (136.933537, 139.003278, 136.933537, 140.440093),\n (136.933537, 140.440093, 136.933537, 141.876907),\n (136.933537, 141.876907, 136.933537, 143.313722),\n (136.933537, 143.313722, 136.933537, 144.750537),\n (136.933537, 144.750537, 136.933537, 146.187352),\n (136.933537, 146.187352, 136.933537, 147.624167),\n (136.933537, 147.624167, 136.933537, 149.060982),\n (136.933537, 149.060982, 136.933537, 150.497796),\n (136.933537, 150.497796, 136.933537, 151.934611),\n (136.933537, 151.934611, 136.933537, 153.371426),\n (136.933537, 153.371426, 136.933537, 154.808241),\n (136.933537, 154.808241, 136.933537, 156.245056),\n (136.933537, 156.245056, 136.933537, 157.68187),\n (136.933537, 157.68187, 136.933537, 159.118685),\n (136.933537, 159.118685, 136.933537, 160.5555),\n (136.933537, 160.5555, 136.933537, 161.992315),\n (136.933537, 161.992315, 136.933537, 163.42913),\n (136.933537, 163.42913, 136.933537, 164.865944),\n (136.933537, 164.865944, 136.933537, 166.302759),\n (136.933537, 166.302759, 136.933537, 167.739574),\n (136.933537, 167.739574, 136.933537, 169.176389),\n (136.933537, 169.176389, 136.933537, 170.613204),\n (136.933537, 170.613204, 136.933537, 172.050018),\n (136.933537, 172.050018, 136.933537, 173.486833),\n (136.933537, 173.486833, 136.933537, 174.923648),\n (136.933537, 174.923648, 136.933537, 176.360463),\n (136.933537, 176.360463, 136.933537, 177.797278),\n (136.933537, 177.797278, 136.933537, 179.234093),\n (136.933537, 179.234093, 136.933537, 180.670907),\n (136.933537, 180.670907, 136.933537, 182.107722),\n (136.933537, 182.107722, 136.933537, 183.544537),\n (187.055463, 137.566463, 187.055463, 139.003278),\n (187.055463, 139.003278, 187.055463, 140.440093),\n (187.055463, 140.440093, 187.055463, 141.876907),\n (187.055463, 141.876907, 187.055463, 143.313722),\n (187.055463, 143.313722, 187.055463, 144.750537),\n (187.055463, 144.750537, 187.055463, 146.187352),\n (187.055463, 146.187352, 187.055463, 147.624167),\n (187.055463, 147.624167, 187.055463, 149.060982),\n (187.055463, 149.060982, 187.055463, 150.497796),\n (187.055463, 150.497796, 187.055463, 151.934611),\n (187.055463, 151.934611, 187.055463, 153.371426),\n (187.055463, 153.371426, 187.055463, 154.808241),\n (187.055463, 154.808241, 187.055463, 156.245056),\n (187.055463, 156.245056, 187.055463, 157.68187),\n (187.055463, 157.68187, 187.055463, 159.118685),\n (187.055463, 159.118685, 187.055463, 160.5555),\n (187.055463, 160.5555, 187.055463, 161.992315),\n (187.055463, 161.992315, 187.055463, 163.42913),\n (187.055463, 163.42913, 187.055463, 164.865944),\n (187.055463, 164.865944, 187.055463, 166.302759),\n (187.055463, 166.302759, 187.055463, 167.739574),\n (187.055463, 167.739574, 187.055463, 169.176389),\n (187.055463, 169.176389, 187.055463, 170.613204),\n (187.055463, 170.613204, 187.055463, 172.050018),\n (187.055463, 172.050018, 187.055463, 173.486833),\n (187.055463, 173.486833, 187.055463, 174.923648),\n (187.055463, 174.923648, 187.055463, 176.360463),\n (187.055463, 176.360463, 187.055463, 177.797278),\n (187.055463, 177.797278, 187.055463, 179.234093),\n (187.055463, 179.234093, 187.055463, 180.670907),\n (187.055463, 180.670907, 187.055463, 182.107722),\n (187.055463, 182.107722, 187.055463, 183.544537),\n (187.055463, 137.566463, 136.933537, 137.566463),\n (187.055463, 183.544537, 136.933537, 183.544537)\n]\nVISIBLE_CIRCLES = [\n (99.9445, 160.5555, 22.989037)\n]\nVISIBLE_ARCS = [\n\n]\nHIDDEN_SEGMENTS = [\n\n]\n# (orient, text, p1, p2, base) for linear; (orient, text, center, radius, angle) for diameter\nDIMENSIONS = [\n ('diameter', '%%c100', (99.9445, 160.5555), 22.989, 45),\n ('horizontal', '109.013', (136.9336, 160.5555), (187.0555, 160.5555), (161.9945, 171.5555))\n]\n\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\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\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,\n angle=(0 if d[0] == \"horizontal\" else 90),\n 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,\n text=text, dimstyle=\"EZDXF\").render()\n\n doc.saveas(out_path)\n\n\nif __name__ == \"__main__\":\n out = sys.argv[1] if len(sys.argv) > 1 else \"0014_00147257_gt.dxf\"\n draw(out)\n print(\"wrote\", out)\n```"}], "images": ["images/0014_00147257.png"], "id": "0014_00147257"} {"messages": [{"role": "user", "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 31.42 mm."}, {"role": "assistant", "content": "```python\n#!/usr/bin/env python3\n# -*- coding: utf-8 -*-\n# Ground-truth 2D engineering drawing for part: 0014_00149980\n# Self-contained: reproduces the three-view DXF via ezdxf, NO FreeCAD needed.\n# Coordinates are A4 page millimetres (scale=0.7312692501258173, page=[297.0, 210.0]).\n# visible edges -> solid (layer OUTLINE); hidden edges -> dashed (layer HIDDEN)\n# dimensions -> real movable DIMENSION entities (text = true mm value)\n# Run: python 0014_00149980_gt.py [out.dxf]\nimport sys\nimport ezdxf\n\nSCALE = 0.7312692501258173\nPAGE = [297.0, 210.0]\n\nVISIBLE_SEGMENTS = [\n (143.295163, 80.231762, 141.009946, 80.231762),\n (141.009946, 80.231762, 138.72473, 80.231762),\n (138.72473, 80.231762, 136.439513, 80.231762),\n (136.439513, 80.231762, 134.154297, 80.231762),\n (134.154297, 80.231762, 131.86908, 80.231762),\n (131.86908, 80.231762, 129.583864, 80.231762),\n (129.583864, 80.231762, 127.298648, 80.231762),\n (127.298648, 80.231762, 125.013431, 80.231762),\n (125.013431, 80.231762, 122.728215, 80.231762),\n (122.728215, 80.231762, 120.442998, 80.231762),\n (120.442998, 80.231762, 118.157782, 80.231762),\n (118.157782, 80.231762, 115.872566, 80.231762),\n (115.872566, 80.231762, 113.587349, 80.231762),\n (113.587349, 80.231762, 111.302133, 80.231762),\n (111.302133, 80.231762, 109.016916, 80.231762),\n (109.016916, 80.231762, 106.7317, 80.231762),\n (106.7317, 80.231762, 104.446484, 80.231762),\n (104.446484, 80.231762, 102.161267, 80.231762),\n (102.161267, 80.231762, 99.876051, 80.231762),\n (99.876051, 80.231762, 97.590834, 80.231762),\n (97.590834, 80.231762, 95.305618, 80.231762),\n (95.305618, 80.231762, 93.020402, 80.231762),\n (93.020402, 80.231762, 90.735185, 80.231762),\n (90.735185, 80.231762, 88.449969, 80.231762),\n (88.449969, 80.231762, 86.164752, 80.231762),\n (86.164752, 80.231762, 83.879536, 80.231762),\n (83.879536, 80.231762, 81.59432, 80.231762),\n (81.59432, 80.231762, 79.309103, 80.231762),\n (79.309103, 80.231762, 77.023887, 80.231762),\n (77.023887, 80.231762, 74.73867, 80.231762),\n (74.73867, 80.231762, 72.453454, 80.231762),\n (72.453454, 80.231762, 70.168237, 80.231762),\n (143.295163, 80.231762, 143.295163, 103.204837),\n (143.295163, 103.204837, 141.009946, 103.204837),\n (141.009946, 103.204837, 138.72473, 103.204837),\n (138.72473, 103.204837, 136.439513, 103.204837),\n (136.439513, 103.204837, 134.154297, 103.204837),\n (134.154297, 103.204837, 131.86908, 103.204837),\n (131.86908, 103.204837, 129.583864, 103.204837),\n (129.583864, 103.204837, 127.298648, 103.204837),\n (127.298648, 103.204837, 125.013431, 103.204837),\n (125.013431, 103.204837, 122.728215, 103.204837),\n (122.728215, 103.204837, 120.442998, 103.204837),\n (120.442998, 103.204837, 118.157782, 103.204837),\n (118.157782, 103.204837, 115.872566, 103.204837),\n (115.872566, 103.204837, 113.587349, 103.204837),\n (113.587349, 103.204837, 111.302133, 103.204837),\n (111.302133, 103.204837, 109.016916, 103.204837),\n (109.016916, 103.204837, 106.7317, 103.204837),\n (106.7317, 103.204837, 104.446484, 103.204837),\n (104.446484, 103.204837, 102.161267, 103.204837),\n (102.161267, 103.204837, 99.876051, 103.204837),\n (99.876051, 103.204837, 97.590834, 103.204837),\n (97.590834, 103.204837, 95.305618, 103.204837),\n (95.305618, 103.204837, 93.020402, 103.204837),\n (93.020402, 103.204837, 90.735185, 103.204837),\n (90.735185, 103.204837, 88.449969, 103.204837),\n (88.449969, 103.204837, 86.164752, 103.204837),\n (86.164752, 103.204837, 83.879536, 103.204837),\n (83.879536, 103.204837, 81.59432, 103.204837),\n (81.59432, 103.204837, 79.309103, 103.204837),\n (79.309103, 103.204837, 77.023887, 103.204837),\n (77.023887, 103.204837, 74.73867, 103.204837),\n (74.73867, 103.204837, 72.453454, 103.204837),\n (72.453454, 103.204837, 70.168237, 103.204837),\n (70.168237, 103.204837, 70.168237, 80.231762),\n (157.295163, 117.204837, 157.295163, 119.490054),\n (157.295163, 119.490054, 157.295163, 121.77527),\n (157.295163, 121.77527, 157.295163, 124.060487),\n (157.295163, 124.060487, 157.295163, 126.345703),\n (157.295163, 126.345703, 157.295163, 128.63092),\n (157.295163, 128.63092, 157.295163, 130.916136),\n (157.295163, 130.916136, 157.295163, 133.201352),\n (157.295163, 133.201352, 157.295163, 135.486569),\n (157.295163, 135.486569, 157.295163, 137.771785),\n (157.295163, 137.771785, 157.295163, 140.057002),\n (157.295163, 140.057002, 157.295163, 142.342218),\n (157.295163, 142.342218, 157.295163, 144.627434),\n (157.295163, 144.627434, 157.295163, 146.912651),\n (157.295163, 146.912651, 157.295163, 149.197867),\n (157.295163, 149.197867, 157.295163, 151.483084),\n (157.295163, 151.483084, 157.295163, 153.7683),\n (157.295163, 153.7683, 157.295163, 156.053516),\n (157.295163, 156.053516, 157.295163, 158.338733),\n (157.295163, 158.338733, 157.295163, 160.623949),\n (157.295163, 160.623949, 157.295163, 162.909166),\n (157.295163, 162.909166, 157.295163, 165.194382),\n (157.295163, 165.194382, 157.295163, 167.479598),\n (157.295163, 167.479598, 157.295163, 169.764815),\n (157.295163, 169.764815, 157.295163, 172.050031),\n (157.295163, 172.050031, 157.295163, 174.335248),\n (157.295163, 174.335248, 157.295163, 176.620464),\n (157.295163, 176.620464, 157.295163, 178.90568),\n (157.295163, 178.90568, 157.295163, 181.190897),\n (157.295163, 181.190897, 157.295163, 183.476113),\n (157.295163, 183.476113, 157.295163, 185.76133),\n (157.295163, 185.76133, 157.295163, 188.046546),\n (157.295163, 188.046546, 157.295163, 190.331763),\n (180.268238, 117.204837, 180.268238, 119.490054),\n (180.268238, 119.490054, 180.268238, 121.77527),\n (180.268238, 121.77527, 180.268238, 124.060487),\n (180.268238, 124.060487, 180.268238, 126.345703),\n (180.268238, 126.345703, 180.268238, 128.63092),\n (180.268238, 128.63092, 180.268238, 130.916136),\n (180.268238, 130.916136, 180.268238, 133.201352),\n (180.268238, 133.201352, 180.268238, 135.486569),\n (180.268238, 135.486569, 180.268238, 137.771785),\n (180.268238, 137.771785, 180.268238, 140.057002),\n (180.268238, 140.057002, 180.268238, 142.342218),\n (180.268238, 142.342218, 180.268238, 144.627434),\n (180.268238, 144.627434, 180.268238, 146.912651),\n (180.268238, 146.912651, 180.268238, 149.197867),\n (180.268238, 149.197867, 180.268238, 151.483084),\n (180.268238, 151.483084, 180.268238, 153.7683),\n (180.268238, 153.7683, 180.268238, 156.053516),\n (180.268238, 156.053516, 180.268238, 158.338733),\n (180.268238, 158.338733, 180.268238, 160.623949),\n (180.268238, 160.623949, 180.268238, 162.909166),\n (180.268238, 162.909166, 180.268238, 165.194382),\n (180.268238, 165.194382, 180.268238, 167.479598),\n (180.268238, 167.479598, 180.268238, 169.764815),\n (180.268238, 169.764815, 180.268238, 172.050031),\n (180.268238, 172.050031, 180.268238, 174.335248),\n (180.268238, 174.335248, 180.268238, 176.620464),\n (180.268238, 176.620464, 180.268238, 178.90568),\n (180.268238, 178.90568, 180.268238, 181.190897),\n (180.268238, 181.190897, 180.268238, 183.476113),\n (180.268238, 183.476113, 180.268238, 185.76133),\n (180.268238, 185.76133, 180.268238, 188.046546),\n (180.268238, 188.046546, 180.268238, 190.331763),\n (180.268238, 117.204837, 157.295163, 117.204837),\n (180.268238, 190.331763, 157.295163, 190.331763)\n]\nVISIBLE_CIRCLES = [\n (106.7317, 153.7683, 36.563463)\n]\nVISIBLE_ARCS = [\n\n]\nHIDDEN_SEGMENTS = [\n\n]\n# (orient, text, p1, p2, base) for linear; (orient, text, center, radius, angle) for diameter\nDIMENSIONS = [\n ('diameter', '%%c100', (106.7317, 153.7683), 36.5635, 45),\n ('horizontal', '31.4153', (157.2952, 153.7683), (180.2682, 153.7683), (168.7817, 164.7683))\n]\n\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\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\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,\n angle=(0 if d[0] == \"horizontal\" else 90),\n 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,\n text=text, dimstyle=\"EZDXF\").render()\n\n doc.saveas(out_path)\n\n\nif __name__ == \"__main__\":\n out = sys.argv[1] if len(sys.argv) > 1 else \"0014_00149980_gt.dxf\"\n draw(out)\n print(\"wrote\", out)\n```"}], "images": ["images/0014_00149980.png"], "id": "0014_00149980"} {"messages": [{"role": "user", "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 593.75 mm."}, {"role": "assistant", "content": "```python\n#!/usr/bin/env python3\n# -*- coding: utf-8 -*-\n# Ground-truth 2D engineering drawing for part: 0017_00174412\n# Self-contained: reproduces the three-view DXF via ezdxf, NO FreeCAD needed.\n# Coordinates are A4 page millimetres (scale=0.1385225225225225, page=[297.0, 210.0]).\n# visible edges -> solid (layer OUTLINE); hidden edges -> dashed (layer HIDDEN)\n# dimensions -> real movable DIMENSION entities (text = true mm value)\n# Run: python 0017_00174412_gt.py [out.dxf]\nimport sys\nimport ezdxf\n\nSCALE = 0.1385225225225225\nPAGE = [297.0, 210.0]\n\nVISIBLE_SEGMENTS = [\n (84.986974, 147.660774, 85.419857, 147.660774),\n (85.419857, 147.660774, 85.85274, 147.660774),\n (85.85274, 147.660774, 86.285623, 147.660774),\n (86.285623, 147.660774, 86.718505, 147.660774),\n (86.718505, 147.660774, 87.151388, 147.660774),\n (87.151388, 147.660774, 87.584271, 147.660774),\n (87.584271, 147.660774, 88.017154, 147.660774),\n (88.017154, 147.660774, 88.450037, 147.660774),\n (88.450037, 147.660774, 88.88292, 147.660774),\n (88.88292, 147.660774, 89.315803, 147.660774),\n (89.315803, 147.660774, 89.748686, 147.660774),\n (89.748686, 147.660774, 90.181568, 147.660774),\n (90.181568, 147.660774, 90.614451, 147.660774),\n (90.614451, 147.660774, 91.047334, 147.660774),\n (91.047334, 147.660774, 91.480217, 147.660774),\n (91.480217, 147.660774, 91.9131, 147.660774),\n (91.9131, 147.660774, 92.345983, 147.660774),\n (92.345983, 147.660774, 92.778866, 147.660774),\n (92.778866, 147.660774, 93.211749, 147.660774),\n (93.211749, 147.660774, 93.644632, 147.660774),\n (93.644632, 147.660774, 94.077514, 147.660774),\n (94.077514, 147.660774, 94.510397, 147.660774),\n (94.510397, 147.660774, 94.94328, 147.660774),\n (94.94328, 147.660774, 95.376163, 147.660774),\n (95.376163, 147.660774, 95.809046, 147.660774),\n (95.809046, 147.660774, 96.241929, 147.660774),\n (96.241929, 147.660774, 96.674812, 147.660774),\n (96.674812, 147.660774, 97.107695, 147.660774),\n (97.107695, 147.660774, 97.540577, 147.660774),\n (97.540577, 147.660774, 97.97346, 147.660774),\n (97.97346, 147.660774, 98.406343, 147.660774),\n (98.406343, 147.660774, 98.839226, 147.660774),\n (98.839226, 147.660774, 98.839226, 65.413026),\n (84.986974, 65.413026, 85.419857, 65.413026),\n (85.419857, 65.413026, 85.85274, 65.413026),\n (85.85274, 65.413026, 86.285623, 65.413026),\n (86.285623, 65.413026, 86.718505, 65.413026),\n (86.718505, 65.413026, 87.151388, 65.413026),\n (87.151388, 65.413026, 87.584271, 65.413026),\n (87.584271, 65.413026, 88.017154, 65.413026),\n (88.017154, 65.413026, 88.450037, 65.413026),\n (88.450037, 65.413026, 88.88292, 65.413026),\n (88.88292, 65.413026, 89.315803, 65.413026),\n (89.315803, 65.413026, 89.748686, 65.413026),\n (89.748686, 65.413026, 90.181568, 65.413026),\n (90.181568, 65.413026, 90.614451, 65.413026),\n (90.614451, 65.413026, 91.047334, 65.413026),\n (91.047334, 65.413026, 91.480217, 65.413026),\n (91.480217, 65.413026, 91.9131, 65.413026),\n (91.9131, 65.413026, 92.345983, 65.413026),\n (92.345983, 65.413026, 92.778866, 65.413026),\n (92.778866, 65.413026, 93.211749, 65.413026),\n (93.211749, 65.413026, 93.644632, 65.413026),\n (93.644632, 65.413026, 94.077514, 65.413026),\n (94.077514, 65.413026, 94.510397, 65.413026),\n (94.510397, 65.413026, 94.94328, 65.413026),\n (94.94328, 65.413026, 95.376163, 65.413026),\n (95.376163, 65.413026, 95.809046, 65.413026),\n (95.809046, 65.413026, 96.241929, 65.413026),\n (96.241929, 65.413026, 96.674812, 65.413026),\n (96.674812, 65.413026, 97.107695, 65.413026),\n (97.107695, 65.413026, 97.540577, 65.413026),\n (97.540577, 65.413026, 97.97346, 65.413026),\n (97.97346, 65.413026, 98.406343, 65.413026),\n (98.406343, 65.413026, 98.839226, 65.413026),\n (84.986974, 65.413026, 84.986974, 147.660774),\n (195.086974, 175.513026, 195.086974, 175.080143),\n (195.086974, 175.080143, 195.086974, 174.64726),\n (195.086974, 174.64726, 195.086974, 174.214377),\n (195.086974, 174.214377, 195.086974, 173.781495),\n (195.086974, 173.781495, 195.086974, 173.348612),\n (195.086974, 173.348612, 195.086974, 172.915729),\n (195.086974, 172.915729, 195.086974, 172.482846),\n (195.086974, 172.482846, 195.086974, 172.049963),\n (195.086974, 172.049963, 195.086974, 171.61708),\n (195.086974, 171.61708, 195.086974, 171.184197),\n (195.086974, 171.184197, 195.086974, 170.751314),\n (195.086974, 170.751314, 195.086974, 170.318432),\n (195.086974, 170.318432, 195.086974, 169.885549),\n (195.086974, 169.885549, 195.086974, 169.452666),\n (195.086974, 169.452666, 195.086974, 169.019783),\n (195.086974, 169.019783, 195.086974, 168.5869),\n (195.086974, 168.5869, 195.086974, 168.154017),\n (195.086974, 168.154017, 195.086974, 167.721134),\n (195.086974, 167.721134, 195.086974, 167.288251),\n (195.086974, 167.288251, 195.086974, 166.855368),\n (195.086974, 166.855368, 195.086974, 166.422486),\n (195.086974, 166.422486, 195.086974, 165.989603),\n (195.086974, 165.989603, 195.086974, 165.55672),\n (195.086974, 165.55672, 195.086974, 165.123837),\n (195.086974, 165.123837, 195.086974, 164.690954),\n (195.086974, 164.690954, 195.086974, 164.258071),\n (195.086974, 164.258071, 195.086974, 163.825188),\n (195.086974, 163.825188, 195.086974, 163.392305),\n (195.086974, 163.392305, 195.086974, 162.959423),\n (195.086974, 162.959423, 195.086974, 162.52654),\n (195.086974, 162.52654, 195.086974, 162.093657),\n (195.086974, 162.093657, 195.086974, 161.660774),\n (112.839226, 175.513026, 112.839226, 175.080143),\n (112.839226, 175.080143, 112.839226, 174.64726),\n (112.839226, 174.64726, 112.839226, 174.214377),\n (112.839226, 174.214377, 112.839226, 173.781495),\n (112.839226, 173.781495, 112.839226, 173.348612),\n (112.839226, 173.348612, 112.839226, 172.915729),\n (112.839226, 172.915729, 112.839226, 172.482846),\n (112.839226, 172.482846, 112.839226, 172.049963),\n (112.839226, 172.049963, 112.839226, 171.61708),\n (112.839226, 171.61708, 112.839226, 171.184197),\n (112.839226, 171.184197, 112.839226, 170.751314),\n (112.839226, 170.751314, 112.839226, 170.318432),\n (112.839226, 170.318432, 112.839226, 169.885549),\n (112.839226, 169.885549, 112.839226, 169.452666),\n (112.839226, 169.452666, 112.839226, 169.019783),\n (112.839226, 169.019783, 112.839226, 168.5869),\n (112.839226, 168.5869, 112.839226, 168.154017),\n (112.839226, 168.154017, 112.839226, 167.721134),\n (112.839226, 167.721134, 112.839226, 167.288251),\n (112.839226, 167.288251, 112.839226, 166.855368),\n (112.839226, 166.855368, 112.839226, 166.422486),\n (112.839226, 166.422486, 112.839226, 165.989603),\n (112.839226, 165.989603, 112.839226, 165.55672),\n (112.839226, 165.55672, 112.839226, 165.123837),\n (112.839226, 165.123837, 112.839226, 164.690954),\n (112.839226, 164.690954, 112.839226, 164.258071),\n (112.839226, 164.258071, 112.839226, 163.825188),\n (112.839226, 163.825188, 112.839226, 163.392305),\n (112.839226, 163.392305, 112.839226, 162.959423),\n (112.839226, 162.959423, 112.839226, 162.52654),\n (112.839226, 162.52654, 112.839226, 162.093657),\n (112.839226, 162.093657, 112.839226, 161.660774),\n (112.839226, 175.513026, 195.086974, 175.513026),\n (112.839226, 161.660774, 195.086974, 161.660774)\n]\nVISIBLE_CIRCLES = [\n (91.9131, 168.5869, 6.926126)\n]\nVISIBLE_ARCS = [\n\n]\nHIDDEN_SEGMENTS = [\n\n]\n# (orient, text, p1, p2, base) for linear; (orient, text, center, radius, angle) for diameter\nDIMENSIONS = [\n ('diameter', '%%c100', (91.9131, 168.5869), 6.9261, 45),\n ('horizontal', '593.75', (195.0869, 168.5869), (112.8392, 168.5869), (153.9631, 157.5869))\n]\n\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\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\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,\n angle=(0 if d[0] == \"horizontal\" else 90),\n 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,\n text=text, dimstyle=\"EZDXF\").render()\n\n doc.saveas(out_path)\n\n\nif __name__ == \"__main__\":\n out = sys.argv[1] if len(sys.argv) > 1 else \"0017_00174412_gt.dxf\"\n draw(out)\n print(\"wrote\", out)\n```"}], "images": ["images/0017_00174412.png"], "id": "0017_00174412"} {"messages": [{"role": "user", "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 633.33 mm."}, {"role": "assistant", "content": "```python\n#!/usr/bin/env python3\n# -*- coding: utf-8 -*-\n# Ground-truth 2D engineering drawing for part: 0017_00178498\n# Self-contained: reproduces the three-view DXF via ezdxf, NO FreeCAD needed.\n# Coordinates are A4 page millimetres (scale=0.13104545454545516, page=[297.0, 210.0]).\n# visible edges -> solid (layer OUTLINE); hidden edges -> dashed (layer HIDDEN)\n# dimensions -> real movable DIMENSION entities (text = true mm value)\n# Run: python 0017_00178498_gt.py [out.dxf]\nimport sys\nimport ezdxf\n\nSCALE = 0.13104545454545516\nPAGE = [297.0, 210.0]\n\nVISIBLE_SEGMENTS = [\n (98.278373, 65.226173, 97.868856, 65.226173),\n (97.868856, 65.226173, 97.459339, 65.226173),\n (97.459339, 65.226173, 97.049822, 65.226173),\n (97.049822, 65.226173, 96.640305, 65.226173),\n (96.640305, 65.226173, 96.230788, 65.226173),\n (96.230788, 65.226173, 95.82127, 65.226173),\n (95.82127, 65.226173, 95.411753, 65.226173),\n (95.411753, 65.226173, 95.002236, 65.226173),\n (95.002236, 65.226173, 94.592719, 65.226173),\n (94.592719, 65.226173, 94.183202, 65.226173),\n (94.183202, 65.226173, 93.773685, 65.226173),\n (93.773685, 65.226173, 93.364168, 65.226173),\n (93.364168, 65.226173, 92.954651, 65.226173),\n (92.954651, 65.226173, 92.545134, 65.226173),\n (92.545134, 65.226173, 92.135617, 65.226173),\n (92.135617, 65.226173, 91.7261, 65.226173),\n (91.7261, 65.226173, 91.316583, 65.226173),\n (91.316583, 65.226173, 90.907066, 65.226173),\n (90.907066, 65.226173, 90.497549, 65.226173),\n (90.497549, 65.226173, 90.088032, 65.226173),\n (90.088032, 65.226173, 89.678515, 65.226173),\n (89.678515, 65.226173, 89.268998, 65.226173),\n (89.268998, 65.226173, 88.859481, 65.226173),\n (88.859481, 65.226173, 88.449964, 65.226173),\n (88.449964, 65.226173, 88.040447, 65.226173),\n (88.040447, 65.226173, 87.63093, 65.226173),\n (87.63093, 65.226173, 87.221412, 65.226173),\n (87.221412, 65.226173, 86.811895, 65.226173),\n (86.811895, 65.226173, 86.402378, 65.226173),\n (86.402378, 65.226173, 85.992861, 65.226173),\n (85.992861, 65.226173, 85.583344, 65.226173),\n (85.583344, 65.226173, 85.173827, 65.226173),\n (98.278373, 65.226173, 98.278373, 148.221627),\n (98.278373, 148.221627, 97.868856, 148.221627),\n (97.868856, 148.221627, 97.459339, 148.221627),\n (97.459339, 148.221627, 97.049822, 148.221627),\n (97.049822, 148.221627, 96.640305, 148.221627),\n (96.640305, 148.221627, 96.230788, 148.221627),\n (96.230788, 148.221627, 95.82127, 148.221627),\n (95.82127, 148.221627, 95.411753, 148.221627),\n (95.411753, 148.221627, 95.002236, 148.221627),\n (95.002236, 148.221627, 94.592719, 148.221627),\n (94.592719, 148.221627, 94.183202, 148.221627),\n (94.183202, 148.221627, 93.773685, 148.221627),\n (93.773685, 148.221627, 93.364168, 148.221627),\n (93.364168, 148.221627, 92.954651, 148.221627),\n (92.954651, 148.221627, 92.545134, 148.221627),\n (92.545134, 148.221627, 92.135617, 148.221627),\n (92.135617, 148.221627, 91.7261, 148.221627),\n (91.7261, 148.221627, 91.316583, 148.221627),\n (91.316583, 148.221627, 90.907066, 148.221627),\n (90.907066, 148.221627, 90.497549, 148.221627),\n (90.497549, 148.221627, 90.088032, 148.221627),\n (90.088032, 148.221627, 89.678515, 148.221627),\n (89.678515, 148.221627, 89.268998, 148.221627),\n (89.268998, 148.221627, 88.859481, 148.221627),\n (88.859481, 148.221627, 88.449964, 148.221627),\n (88.449964, 148.221627, 88.040447, 148.221627),\n (88.040447, 148.221627, 87.63093, 148.221627),\n (87.63093, 148.221627, 87.221412, 148.221627),\n (87.221412, 148.221627, 86.811895, 148.221627),\n (86.811895, 148.221627, 86.402378, 148.221627),\n (86.402378, 148.221627, 85.992861, 148.221627),\n (85.992861, 148.221627, 85.583344, 148.221627),\n (85.583344, 148.221627, 85.173827, 148.221627),\n (85.173827, 148.221627, 85.173827, 65.226173),\n (112.278373, 162.221627, 112.278373, 162.631144),\n (112.278373, 162.631144, 112.278373, 163.040661),\n (112.278373, 163.040661, 112.278373, 163.450178),\n (112.278373, 163.450178, 112.278373, 163.859695),\n (112.278373, 163.859695, 112.278373, 164.269212),\n (112.278373, 164.269212, 112.278373, 164.67873),\n (112.278373, 164.67873, 112.278373, 165.088247),\n (112.278373, 165.088247, 112.278373, 165.497764),\n (112.278373, 165.497764, 112.278373, 165.907281),\n (112.278373, 165.907281, 112.278373, 166.316798),\n (112.278373, 166.316798, 112.278373, 166.726315),\n (112.278373, 166.726315, 112.278373, 167.135832),\n (112.278373, 167.135832, 112.278373, 167.545349),\n (112.278373, 167.545349, 112.278373, 167.954866),\n (112.278373, 167.954866, 112.278373, 168.364383),\n (112.278373, 168.364383, 112.278373, 168.7739),\n (112.278373, 168.7739, 112.278373, 169.183417),\n (112.278373, 169.183417, 112.278373, 169.592934),\n (112.278373, 169.592934, 112.278373, 170.002451),\n (112.278373, 170.002451, 112.278373, 170.411968),\n (112.278373, 170.411968, 112.278373, 170.821485),\n (112.278373, 170.821485, 112.278373, 171.231002),\n (112.278373, 171.231002, 112.278373, 171.640519),\n (112.278373, 171.640519, 112.278373, 172.050036),\n (112.278373, 172.050036, 112.278373, 172.459553),\n (112.278373, 172.459553, 112.278373, 172.86907),\n (112.278373, 172.86907, 112.278373, 173.278588),\n (112.278373, 173.278588, 112.278373, 173.688105),\n (112.278373, 173.688105, 112.278373, 174.097622),\n (112.278373, 174.097622, 112.278373, 174.507139),\n (112.278373, 174.507139, 112.278373, 174.916656),\n (112.278373, 174.916656, 112.278373, 175.326173),\n (195.273827, 162.221627, 195.273827, 162.631144),\n (195.273827, 162.631144, 195.273827, 163.040661),\n (195.273827, 163.040661, 195.273827, 163.450178),\n (195.273827, 163.450178, 195.273827, 163.859695),\n (195.273827, 163.859695, 195.273827, 164.269212),\n (195.273827, 164.269212, 195.273827, 164.67873),\n (195.273827, 164.67873, 195.273827, 165.088247),\n (195.273827, 165.088247, 195.273827, 165.497764),\n (195.273827, 165.497764, 195.273827, 165.907281),\n (195.273827, 165.907281, 195.273827, 166.316798),\n (195.273827, 166.316798, 195.273827, 166.726315),\n (195.273827, 166.726315, 195.273827, 167.135832),\n (195.273827, 167.135832, 195.273827, 167.545349),\n (195.273827, 167.545349, 195.273827, 167.954866),\n (195.273827, 167.954866, 195.273827, 168.364383),\n (195.273827, 168.364383, 195.273827, 168.7739),\n (195.273827, 168.7739, 195.273827, 169.183417),\n (195.273827, 169.183417, 195.273827, 169.592934),\n (195.273827, 169.592934, 195.273827, 170.002451),\n (195.273827, 170.002451, 195.273827, 170.411968),\n (195.273827, 170.411968, 195.273827, 170.821485),\n (195.273827, 170.821485, 195.273827, 171.231002),\n (195.273827, 171.231002, 195.273827, 171.640519),\n (195.273827, 171.640519, 195.273827, 172.050036),\n (195.273827, 172.050036, 195.273827, 172.459553),\n (195.273827, 172.459553, 195.273827, 172.86907),\n (195.273827, 172.86907, 195.273827, 173.278588),\n (195.273827, 173.278588, 195.273827, 173.688105),\n (195.273827, 173.688105, 195.273827, 174.097622),\n (195.273827, 174.097622, 195.273827, 174.507139),\n (195.273827, 174.507139, 195.273827, 174.916656),\n (195.273827, 174.916656, 195.273827, 175.326173),\n (195.273827, 162.221627, 112.278373, 162.221627),\n (195.273827, 175.326173, 112.278373, 175.326173)\n]\nVISIBLE_CIRCLES = [\n (91.7261, 168.7739, 6.552273)\n]\nVISIBLE_ARCS = [\n\n]\nHIDDEN_SEGMENTS = [\n\n]\n# (orient, text, p1, p2, base) for linear; (orient, text, center, radius, angle) for diameter\nDIMENSIONS = [\n ('diameter', '%%c100', (91.7261, 168.7739), 6.5523, 45),\n ('horizontal', '633.333', (112.2784, 168.7739), (195.2739, 168.7739), (153.7761, 179.7739))\n]\n\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\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\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,\n angle=(0 if d[0] == \"horizontal\" else 90),\n 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,\n text=text, dimstyle=\"EZDXF\").render()\n\n doc.saveas(out_path)\n\n\nif __name__ == \"__main__\":\n out = sys.argv[1] if len(sys.argv) > 1 else \"0017_00178498_gt.dxf\"\n draw(out)\n print(\"wrote\", out)\n```"}], "images": ["images/0017_00178498.png"], "id": "0017_00178498"} {"messages": [{"role": "user", "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 134.75 mm."}, {"role": "assistant", "content": "```python\n#!/usr/bin/env python3\n# -*- coding: utf-8 -*-\n# Ground-truth 2D engineering drawing for part: 0017_00178846\n# Self-contained: reproduces the three-view DXF via ezdxf, NO FreeCAD needed.\n# Coordinates are A4 page millimetres (scale=0.40936858006050214, page=[297.0, 210.0]).\n# visible edges -> solid (layer OUTLINE); hidden edges -> dashed (layer HIDDEN)\n# dimensions -> real movable DIMENSION entities (text = true mm value)\n# Run: python 0017_00178846_gt.py [out.dxf]\nimport sys\nimport ezdxf\n\nSCALE = 0.40936858006050214\nPAGE = [297.0, 210.0]\n\nVISIBLE_SEGMENTS = [\n (78.215771, 127.347371, 79.495048, 127.347371),\n (79.495048, 127.347371, 80.774325, 127.347371),\n (80.774325, 127.347371, 82.053601, 127.347371),\n (82.053601, 127.347371, 83.332878, 127.347371),\n (83.332878, 127.347371, 84.612155, 127.347371),\n (84.612155, 127.347371, 85.891432, 127.347371),\n (85.891432, 127.347371, 87.170709, 127.347371),\n (87.170709, 127.347371, 88.449985, 127.347371),\n (88.449985, 127.347371, 89.729262, 127.347371),\n (89.729262, 127.347371, 91.008539, 127.347371),\n (91.008539, 127.347371, 92.287816, 127.347371),\n (92.287816, 127.347371, 93.567093, 127.347371),\n (93.567093, 127.347371, 94.84637, 127.347371),\n (94.84637, 127.347371, 96.125646, 127.347371),\n (96.125646, 127.347371, 97.404923, 127.347371),\n (97.404923, 127.347371, 98.6842, 127.347371),\n (98.6842, 127.347371, 99.963477, 127.347371),\n (99.963477, 127.347371, 101.242754, 127.347371),\n (101.242754, 127.347371, 102.52203, 127.347371),\n (102.52203, 127.347371, 103.801307, 127.347371),\n (103.801307, 127.347371, 105.080584, 127.347371),\n (105.080584, 127.347371, 106.359861, 127.347371),\n (106.359861, 127.347371, 107.639138, 127.347371),\n (107.639138, 127.347371, 108.918415, 127.347371),\n (108.918415, 127.347371, 110.197691, 127.347371),\n (110.197691, 127.347371, 111.476968, 127.347371),\n (111.476968, 127.347371, 112.756245, 127.347371),\n (112.756245, 127.347371, 114.035522, 127.347371),\n (114.035522, 127.347371, 115.314799, 127.347371),\n (115.314799, 127.347371, 116.594075, 127.347371),\n (116.594075, 127.347371, 117.873352, 127.347371),\n (117.873352, 127.347371, 119.152629, 127.347371),\n (119.152629, 127.347371, 119.152629, 72.184229),\n (78.215771, 72.184229, 79.495048, 72.184229),\n (79.495048, 72.184229, 80.774325, 72.184229),\n (80.774325, 72.184229, 82.053601, 72.184229),\n (82.053601, 72.184229, 83.332878, 72.184229),\n (83.332878, 72.184229, 84.612155, 72.184229),\n (84.612155, 72.184229, 85.891432, 72.184229),\n (85.891432, 72.184229, 87.170709, 72.184229),\n (87.170709, 72.184229, 88.449985, 72.184229),\n (88.449985, 72.184229, 89.729262, 72.184229),\n (89.729262, 72.184229, 91.008539, 72.184229),\n (91.008539, 72.184229, 92.287816, 72.184229),\n (92.287816, 72.184229, 93.567093, 72.184229),\n (93.567093, 72.184229, 94.84637, 72.184229),\n (94.84637, 72.184229, 96.125646, 72.184229),\n (96.125646, 72.184229, 97.404923, 72.184229),\n (97.404923, 72.184229, 98.6842, 72.184229),\n (98.6842, 72.184229, 99.963477, 72.184229),\n (99.963477, 72.184229, 101.242754, 72.184229),\n (101.242754, 72.184229, 102.52203, 72.184229),\n (102.52203, 72.184229, 103.801307, 72.184229),\n (103.801307, 72.184229, 105.080584, 72.184229),\n (105.080584, 72.184229, 106.359861, 72.184229),\n (106.359861, 72.184229, 107.639138, 72.184229),\n (107.639138, 72.184229, 108.918415, 72.184229),\n (108.918415, 72.184229, 110.197691, 72.184229),\n (110.197691, 72.184229, 111.476968, 72.184229),\n (111.476968, 72.184229, 112.756245, 72.184229),\n (112.756245, 72.184229, 114.035522, 72.184229),\n (114.035522, 72.184229, 115.314799, 72.184229),\n (115.314799, 72.184229, 116.594075, 72.184229),\n (116.594075, 72.184229, 117.873352, 72.184229),\n (117.873352, 72.184229, 119.152629, 72.184229),\n (78.215771, 72.184229, 78.215771, 127.347371),\n (188.315771, 182.284229, 188.315771, 181.004952),\n (188.315771, 181.004952, 188.315771, 179.725675),\n (188.315771, 179.725675, 188.315771, 178.446399),\n (188.315771, 178.446399, 188.315771, 177.167122),\n (188.315771, 177.167122, 188.315771, 175.887845),\n (188.315771, 175.887845, 188.315771, 174.608568),\n (188.315771, 174.608568, 188.315771, 173.329291),\n (188.315771, 173.329291, 188.315771, 172.050015),\n (188.315771, 172.050015, 188.315771, 170.770738),\n (188.315771, 170.770738, 188.315771, 169.491461),\n (188.315771, 169.491461, 188.315771, 168.212184),\n (188.315771, 168.212184, 188.315771, 166.932907),\n (188.315771, 166.932907, 188.315771, 165.65363),\n (188.315771, 165.65363, 188.315771, 164.374354),\n (188.315771, 164.374354, 188.315771, 163.095077),\n (188.315771, 163.095077, 188.315771, 161.8158),\n (188.315771, 161.8158, 188.315771, 160.536523),\n (188.315771, 160.536523, 188.315771, 159.257246),\n (188.315771, 159.257246, 188.315771, 157.97797),\n (188.315771, 157.97797, 188.315771, 156.698693),\n (188.315771, 156.698693, 188.315771, 155.419416),\n (188.315771, 155.419416, 188.315771, 154.140139),\n (188.315771, 154.140139, 188.315771, 152.860862),\n (188.315771, 152.860862, 188.315771, 151.581585),\n (188.315771, 151.581585, 188.315771, 150.302309),\n (188.315771, 150.302309, 188.315771, 149.023032),\n (188.315771, 149.023032, 188.315771, 147.743755),\n (188.315771, 147.743755, 188.315771, 146.464478),\n (188.315771, 146.464478, 188.315771, 145.185201),\n (188.315771, 145.185201, 188.315771, 143.905925),\n (188.315771, 143.905925, 188.315771, 142.626648),\n (188.315771, 142.626648, 188.315771, 141.347371),\n (133.152629, 182.284229, 133.152629, 181.004952),\n (133.152629, 181.004952, 133.152629, 179.725675),\n (133.152629, 179.725675, 133.152629, 178.446399),\n (133.152629, 178.446399, 133.152629, 177.167122),\n (133.152629, 177.167122, 133.152629, 175.887845),\n (133.152629, 175.887845, 133.152629, 174.608568),\n (133.152629, 174.608568, 133.152629, 173.329291),\n (133.152629, 173.329291, 133.152629, 172.050015),\n (133.152629, 172.050015, 133.152629, 170.770738),\n (133.152629, 170.770738, 133.152629, 169.491461),\n (133.152629, 169.491461, 133.152629, 168.212184),\n (133.152629, 168.212184, 133.152629, 166.932907),\n (133.152629, 166.932907, 133.152629, 165.65363),\n (133.152629, 165.65363, 133.152629, 164.374354),\n (133.152629, 164.374354, 133.152629, 163.095077),\n (133.152629, 163.095077, 133.152629, 161.8158),\n (133.152629, 161.8158, 133.152629, 160.536523),\n (133.152629, 160.536523, 133.152629, 159.257246),\n (133.152629, 159.257246, 133.152629, 157.97797),\n (133.152629, 157.97797, 133.152629, 156.698693),\n (133.152629, 156.698693, 133.152629, 155.419416),\n (133.152629, 155.419416, 133.152629, 154.140139),\n (133.152629, 154.140139, 133.152629, 152.860862),\n (133.152629, 152.860862, 133.152629, 151.581585),\n (133.152629, 151.581585, 133.152629, 150.302309),\n (133.152629, 150.302309, 133.152629, 149.023032),\n (133.152629, 149.023032, 133.152629, 147.743755),\n (133.152629, 147.743755, 133.152629, 146.464478),\n (133.152629, 146.464478, 133.152629, 145.185201),\n (133.152629, 145.185201, 133.152629, 143.905925),\n (133.152629, 143.905925, 133.152629, 142.626648),\n (133.152629, 142.626648, 133.152629, 141.347371),\n (133.152629, 182.284229, 188.315771, 182.284229),\n (133.152629, 141.347371, 188.315771, 141.347371)\n]\nVISIBLE_CIRCLES = [\n (98.6842, 161.8158, 20.468429)\n]\nVISIBLE_ARCS = [\n\n]\nHIDDEN_SEGMENTS = [\n\n]\n# (orient, text, p1, p2, base) for linear; (orient, text, center, radius, angle) for diameter\nDIMENSIONS = [\n ('diameter', '%%c100', (98.6842, 161.8158), 20.4684, 45),\n ('horizontal', '134.752', (188.3158, 161.8158), (133.1526, 161.8158), (160.7342, 150.8158))\n]\n\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\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\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,\n angle=(0 if d[0] == \"horizontal\" else 90),\n 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,\n text=text, dimstyle=\"EZDXF\").render()\n\n doc.saveas(out_path)\n\n\nif __name__ == \"__main__\":\n out = sys.argv[1] if len(sys.argv) > 1 else \"0017_00178846_gt.dxf\"\n draw(out)\n print(\"wrote\", out)\n```"}], "images": ["images/0017_00178846.png"], "id": "0017_00178846"} {"messages": [{"role": "user", "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 141.79 mm."}, {"role": "assistant", "content": "```python\n#!/usr/bin/env python3\n# -*- coding: utf-8 -*-\n# Ground-truth 2D engineering drawing for part: 0018_00183957\n# Self-contained: reproduces the three-view DXF via ezdxf, NO FreeCAD needed.\n# Coordinates are A4 page millimetres (scale=0.3974506172839661, page=[297.0, 210.0]).\n# visible edges -> solid (layer OUTLINE); hidden edges -> dashed (layer HIDDEN)\n# dimensions -> real movable DIMENSION entities (text = true mm value)\n# Run: python 0018_00183957_gt.py [out.dxf]\nimport sys\nimport ezdxf\n\nSCALE = 0.3974506172839661\nPAGE = [297.0, 210.0]\n\nVISIBLE_SEGMENTS = [\n (118.258831, 71.886231, 117.016798, 71.886231),\n (117.016798, 71.886231, 115.774765, 71.886231),\n (115.774765, 71.886231, 114.532731, 71.886231),\n (114.532731, 71.886231, 113.290698, 71.886231),\n (113.290698, 71.886231, 112.048665, 71.886231),\n (112.048665, 71.886231, 110.806632, 71.886231),\n (110.806632, 71.886231, 109.564599, 71.886231),\n (109.564599, 71.886231, 108.322565, 71.886231),\n (108.322565, 71.886231, 107.080532, 71.886231),\n (107.080532, 71.886231, 105.838499, 71.886231),\n (105.838499, 71.886231, 104.596466, 71.886231),\n (104.596466, 71.886231, 103.354433, 71.886231),\n (103.354433, 71.886231, 102.1124, 71.886231),\n (102.1124, 71.886231, 100.870366, 71.886231),\n (100.870366, 71.886231, 99.628333, 71.886231),\n (99.628333, 71.886231, 98.3863, 71.886231),\n (98.3863, 71.886231, 97.144267, 71.886231),\n (97.144267, 71.886231, 95.902234, 71.886231),\n (95.902234, 71.886231, 94.6602, 71.886231),\n (94.6602, 71.886231, 93.418167, 71.886231),\n (93.418167, 71.886231, 92.176134, 71.886231),\n (92.176134, 71.886231, 90.934101, 71.886231),\n (90.934101, 71.886231, 89.692068, 71.886231),\n (89.692068, 71.886231, 88.450035, 71.886231),\n (88.450035, 71.886231, 87.208001, 71.886231),\n (87.208001, 71.886231, 85.965968, 71.886231),\n (85.965968, 71.886231, 84.723935, 71.886231),\n (84.723935, 71.886231, 83.481902, 71.886231),\n (83.481902, 71.886231, 82.239869, 71.886231),\n (82.239869, 71.886231, 80.997835, 71.886231),\n (80.997835, 71.886231, 79.755802, 71.886231),\n (79.755802, 71.886231, 78.513769, 71.886231),\n (118.258831, 71.886231, 118.258831, 128.241169),\n (118.258831, 128.241169, 117.016798, 128.241169),\n (117.016798, 128.241169, 115.774765, 128.241169),\n (115.774765, 128.241169, 114.532731, 128.241169),\n (114.532731, 128.241169, 113.290698, 128.241169),\n (113.290698, 128.241169, 112.048665, 128.241169),\n (112.048665, 128.241169, 110.806632, 128.241169),\n (110.806632, 128.241169, 109.564599, 128.241169),\n (109.564599, 128.241169, 108.322565, 128.241169),\n (108.322565, 128.241169, 107.080532, 128.241169),\n (107.080532, 128.241169, 105.838499, 128.241169),\n (105.838499, 128.241169, 104.596466, 128.241169),\n (104.596466, 128.241169, 103.354433, 128.241169),\n (103.354433, 128.241169, 102.1124, 128.241169),\n (102.1124, 128.241169, 100.870366, 128.241169),\n (100.870366, 128.241169, 99.628333, 128.241169),\n (99.628333, 128.241169, 98.3863, 128.241169),\n (98.3863, 128.241169, 97.144267, 128.241169),\n (97.144267, 128.241169, 95.902234, 128.241169),\n (95.902234, 128.241169, 94.6602, 128.241169),\n (94.6602, 128.241169, 93.418167, 128.241169),\n (93.418167, 128.241169, 92.176134, 128.241169),\n (92.176134, 128.241169, 90.934101, 128.241169),\n (90.934101, 128.241169, 89.692068, 128.241169),\n (89.692068, 128.241169, 88.450035, 128.241169),\n (88.450035, 128.241169, 87.208001, 128.241169),\n (87.208001, 128.241169, 85.965968, 128.241169),\n (85.965968, 128.241169, 84.723935, 128.241169),\n (84.723935, 128.241169, 83.481902, 128.241169),\n (83.481902, 128.241169, 82.239869, 128.241169),\n (82.239869, 128.241169, 80.997835, 128.241169),\n (80.997835, 128.241169, 79.755802, 128.241169),\n (79.755802, 128.241169, 78.513769, 128.241169),\n (78.513769, 128.241169, 78.513769, 71.886231),\n (132.258831, 142.241169, 132.258831, 143.483202),\n (132.258831, 143.483202, 132.258831, 144.725235),\n (132.258831, 144.725235, 132.258831, 145.967269),\n (132.258831, 145.967269, 132.258831, 147.209302),\n (132.258831, 147.209302, 132.258831, 148.451335),\n (132.258831, 148.451335, 132.258831, 149.693368),\n (132.258831, 149.693368, 132.258831, 150.935401),\n (132.258831, 150.935401, 132.258831, 152.177435),\n (132.258831, 152.177435, 132.258831, 153.419468),\n (132.258831, 153.419468, 132.258831, 154.661501),\n (132.258831, 154.661501, 132.258831, 155.903534),\n (132.258831, 155.903534, 132.258831, 157.145567),\n (132.258831, 157.145567, 132.258831, 158.3876),\n (132.258831, 158.3876, 132.258831, 159.629634),\n (132.258831, 159.629634, 132.258831, 160.871667),\n (132.258831, 160.871667, 132.258831, 162.1137),\n (132.258831, 162.1137, 132.258831, 163.355733),\n (132.258831, 163.355733, 132.258831, 164.597766),\n (132.258831, 164.597766, 132.258831, 165.8398),\n (132.258831, 165.8398, 132.258831, 167.081833),\n (132.258831, 167.081833, 132.258831, 168.323866),\n (132.258831, 168.323866, 132.258831, 169.565899),\n (132.258831, 169.565899, 132.258831, 170.807932),\n (132.258831, 170.807932, 132.258831, 172.049965),\n (132.258831, 172.049965, 132.258831, 173.291999),\n (132.258831, 173.291999, 132.258831, 174.534032),\n (132.258831, 174.534032, 132.258831, 175.776065),\n (132.258831, 175.776065, 132.258831, 177.018098),\n (132.258831, 177.018098, 132.258831, 178.260131),\n (132.258831, 178.260131, 132.258831, 179.502165),\n (132.258831, 179.502165, 132.258831, 180.744198),\n (132.258831, 180.744198, 132.258831, 181.986231),\n (188.613769, 142.241169, 188.613769, 143.483202),\n (188.613769, 143.483202, 188.613769, 144.725235),\n (188.613769, 144.725235, 188.613769, 145.967269),\n (188.613769, 145.967269, 188.613769, 147.209302),\n (188.613769, 147.209302, 188.613769, 148.451335),\n (188.613769, 148.451335, 188.613769, 149.693368),\n (188.613769, 149.693368, 188.613769, 150.935401),\n (188.613769, 150.935401, 188.613769, 152.177435),\n (188.613769, 152.177435, 188.613769, 153.419468),\n (188.613769, 153.419468, 188.613769, 154.661501),\n (188.613769, 154.661501, 188.613769, 155.903534),\n (188.613769, 155.903534, 188.613769, 157.145567),\n (188.613769, 157.145567, 188.613769, 158.3876),\n (188.613769, 158.3876, 188.613769, 159.629634),\n (188.613769, 159.629634, 188.613769, 160.871667),\n (188.613769, 160.871667, 188.613769, 162.1137),\n (188.613769, 162.1137, 188.613769, 163.355733),\n (188.613769, 163.355733, 188.613769, 164.597766),\n (188.613769, 164.597766, 188.613769, 165.8398),\n (188.613769, 165.8398, 188.613769, 167.081833),\n (188.613769, 167.081833, 188.613769, 168.323866),\n (188.613769, 168.323866, 188.613769, 169.565899),\n (188.613769, 169.565899, 188.613769, 170.807932),\n (188.613769, 170.807932, 188.613769, 172.049965),\n (188.613769, 172.049965, 188.613769, 173.291999),\n (188.613769, 173.291999, 188.613769, 174.534032),\n (188.613769, 174.534032, 188.613769, 175.776065),\n (188.613769, 175.776065, 188.613769, 177.018098),\n (188.613769, 177.018098, 188.613769, 178.260131),\n (188.613769, 178.260131, 188.613769, 179.502165),\n (188.613769, 179.502165, 188.613769, 180.744198),\n (188.613769, 180.744198, 188.613769, 181.986231),\n (188.613769, 142.241169, 132.258831, 142.241169),\n (188.613769, 181.986231, 132.258831, 181.986231)\n]\nVISIBLE_CIRCLES = [\n (98.3863, 162.1137, 19.872531)\n]\nVISIBLE_ARCS = [\n\n]\nHIDDEN_SEGMENTS = [\n\n]\n# (orient, text, p1, p2, base) for linear; (orient, text, center, radius, angle) for diameter\nDIMENSIONS = [\n ('diameter', '%%c100', (98.3863, 162.1137), 19.8725, 45),\n ('horizontal', '141.791', (132.2588, 162.1137), (188.6137, 162.1137), (160.4363, 173.1137))\n]\n\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\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\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,\n angle=(0 if d[0] == \"horizontal\" else 90),\n 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,\n text=text, dimstyle=\"EZDXF\").render()\n\n doc.saveas(out_path)\n\n\nif __name__ == \"__main__\":\n out = sys.argv[1] if len(sys.argv) > 1 else \"0018_00183957_gt.dxf\"\n draw(out)\n print(\"wrote\", out)\n```"}], "images": ["images/0018_00183957.png"], "id": "0018_00183957"} {"messages": [{"role": "user", "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 1386.02 mm."}, {"role": "assistant", "content": "```python\n#!/usr/bin/env python3\n# -*- coding: utf-8 -*-\n# Ground-truth 2D engineering drawing for part: 0018_00188460\n# Self-contained: reproduces the three-view DXF via ezdxf, NO FreeCAD needed.\n# Coordinates are A4 page millimetres (scale=0.06466946205768341, page=[297.0, 210.0]).\n# visible edges -> solid (layer OUTLINE); hidden edges -> dashed (layer HIDDEN)\n# dimensions -> real movable DIMENSION entities (text = true mm value)\n# Run: python 0018_00188460_gt.py [out.dxf]\nimport sys\nimport ezdxf\n\nSCALE = 0.06466946205768341\nPAGE = [297.0, 210.0]\n\nVISIBLE_SEGMENTS = [\n (93.300173, 63.566773, 93.098081, 63.566773),\n (93.098081, 63.566773, 92.895989, 63.566773),\n (92.895989, 63.566773, 92.693897, 63.566773),\n (92.693897, 63.566773, 92.491805, 63.566773),\n (92.491805, 63.566773, 92.289713, 63.566773),\n (92.289713, 63.566773, 92.087621, 63.566773),\n (92.087621, 63.566773, 91.885529, 63.566773),\n (91.885529, 63.566773, 91.683437, 63.566773),\n (91.683437, 63.566773, 91.481344, 63.566773),\n (91.481344, 63.566773, 91.279252, 63.566773),\n (91.279252, 63.566773, 91.07716, 63.566773),\n (91.07716, 63.566773, 90.875068, 63.566773),\n (90.875068, 63.566773, 90.672976, 63.566773),\n (90.672976, 63.566773, 90.470884, 63.566773),\n (90.470884, 63.566773, 90.268792, 63.566773),\n (90.268792, 63.566773, 90.0667, 63.566773),\n (90.0667, 63.566773, 89.864608, 63.566773),\n (89.864608, 63.566773, 89.662516, 63.566773),\n (89.662516, 63.566773, 89.460424, 63.566773),\n (89.460424, 63.566773, 89.258332, 63.566773),\n (89.258332, 63.566773, 89.05624, 63.566773),\n (89.05624, 63.566773, 88.854148, 63.566773),\n (88.854148, 63.566773, 88.652056, 63.566773),\n (88.652056, 63.566773, 88.449963, 63.566773),\n (88.449963, 63.566773, 88.247871, 63.566773),\n (88.247871, 63.566773, 88.045779, 63.566773),\n (88.045779, 63.566773, 87.843687, 63.566773),\n (87.843687, 63.566773, 87.641595, 63.566773),\n (87.641595, 63.566773, 87.439503, 63.566773),\n (87.439503, 63.566773, 87.237411, 63.566773),\n (87.237411, 63.566773, 87.035319, 63.566773),\n (87.035319, 63.566773, 86.833227, 63.566773),\n (93.300173, 63.566773, 93.300173, 153.199827),\n (93.300173, 153.199827, 93.098081, 153.199827),\n (93.098081, 153.199827, 92.895989, 153.199827),\n (92.895989, 153.199827, 92.693897, 153.199827),\n (92.693897, 153.199827, 92.491805, 153.199827),\n (92.491805, 153.199827, 92.289713, 153.199827),\n (92.289713, 153.199827, 92.087621, 153.199827),\n (92.087621, 153.199827, 91.885529, 153.199827),\n (91.885529, 153.199827, 91.683437, 153.199827),\n (91.683437, 153.199827, 91.481344, 153.199827),\n (91.481344, 153.199827, 91.279252, 153.199827),\n (91.279252, 153.199827, 91.07716, 153.199827),\n (91.07716, 153.199827, 90.875068, 153.199827),\n (90.875068, 153.199827, 90.672976, 153.199827),\n (90.672976, 153.199827, 90.470884, 153.199827),\n (90.470884, 153.199827, 90.268792, 153.199827),\n (90.268792, 153.199827, 90.0667, 153.199827),\n (90.0667, 153.199827, 89.864608, 153.199827),\n (89.864608, 153.199827, 89.662516, 153.199827),\n (89.662516, 153.199827, 89.460424, 153.199827),\n (89.460424, 153.199827, 89.258332, 153.199827),\n (89.258332, 153.199827, 89.05624, 153.199827),\n (89.05624, 153.199827, 88.854148, 153.199827),\n (88.854148, 153.199827, 88.652056, 153.199827),\n (88.652056, 153.199827, 88.449963, 153.199827),\n (88.449963, 153.199827, 88.247871, 153.199827),\n (88.247871, 153.199827, 88.045779, 153.199827),\n (88.045779, 153.199827, 87.843687, 153.199827),\n (87.843687, 153.199827, 87.641595, 153.199827),\n (87.641595, 153.199827, 87.439503, 153.199827),\n (87.439503, 153.199827, 87.237411, 153.199827),\n (87.237411, 153.199827, 87.035319, 153.199827),\n (87.035319, 153.199827, 86.833227, 153.199827),\n (86.833227, 153.199827, 86.833227, 63.566773),\n (107.300173, 167.199827, 107.300173, 167.401919),\n (107.300173, 167.401919, 107.300173, 167.604011),\n (107.300173, 167.604011, 107.300173, 167.806103),\n (107.300173, 167.806103, 107.300173, 168.008195),\n (107.300173, 168.008195, 107.300173, 168.210287),\n (107.300173, 168.210287, 107.300173, 168.412379),\n (107.300173, 168.412379, 107.300173, 168.614471),\n (107.300173, 168.614471, 107.300173, 168.816563),\n (107.300173, 168.816563, 107.300173, 169.018656),\n (107.300173, 169.018656, 107.300173, 169.220748),\n (107.300173, 169.220748, 107.300173, 169.42284),\n (107.300173, 169.42284, 107.300173, 169.624932),\n (107.300173, 169.624932, 107.300173, 169.827024),\n (107.300173, 169.827024, 107.300173, 170.029116),\n (107.300173, 170.029116, 107.300173, 170.231208),\n (107.300173, 170.231208, 107.300173, 170.4333),\n (107.300173, 170.4333, 107.300173, 170.635392),\n (107.300173, 170.635392, 107.300173, 170.837484),\n (107.300173, 170.837484, 107.300173, 171.039576),\n (107.300173, 171.039576, 107.300173, 171.241668),\n (107.300173, 171.241668, 107.300173, 171.44376),\n (107.300173, 171.44376, 107.300173, 171.645852),\n (107.300173, 171.645852, 107.300173, 171.847944),\n (107.300173, 171.847944, 107.300173, 172.050037),\n (107.300173, 172.050037, 107.300173, 172.252129),\n (107.300173, 172.252129, 107.300173, 172.454221),\n (107.300173, 172.454221, 107.300173, 172.656313),\n (107.300173, 172.656313, 107.300173, 172.858405),\n (107.300173, 172.858405, 107.300173, 173.060497),\n (107.300173, 173.060497, 107.300173, 173.262589),\n (107.300173, 173.262589, 107.300173, 173.464681),\n (107.300173, 173.464681, 107.300173, 173.666773),\n (196.933227, 167.199827, 196.933227, 167.401919),\n (196.933227, 167.401919, 196.933227, 167.604011),\n (196.933227, 167.604011, 196.933227, 167.806103),\n (196.933227, 167.806103, 196.933227, 168.008195),\n (196.933227, 168.008195, 196.933227, 168.210287),\n (196.933227, 168.210287, 196.933227, 168.412379),\n (196.933227, 168.412379, 196.933227, 168.614471),\n (196.933227, 168.614471, 196.933227, 168.816563),\n (196.933227, 168.816563, 196.933227, 169.018656),\n (196.933227, 169.018656, 196.933227, 169.220748),\n (196.933227, 169.220748, 196.933227, 169.42284),\n (196.933227, 169.42284, 196.933227, 169.624932),\n (196.933227, 169.624932, 196.933227, 169.827024),\n (196.933227, 169.827024, 196.933227, 170.029116),\n (196.933227, 170.029116, 196.933227, 170.231208),\n (196.933227, 170.231208, 196.933227, 170.4333),\n (196.933227, 170.4333, 196.933227, 170.635392),\n (196.933227, 170.635392, 196.933227, 170.837484),\n (196.933227, 170.837484, 196.933227, 171.039576),\n (196.933227, 171.039576, 196.933227, 171.241668),\n (196.933227, 171.241668, 196.933227, 171.44376),\n (196.933227, 171.44376, 196.933227, 171.645852),\n (196.933227, 171.645852, 196.933227, 171.847944),\n (196.933227, 171.847944, 196.933227, 172.050037),\n (196.933227, 172.050037, 196.933227, 172.252129),\n (196.933227, 172.252129, 196.933227, 172.454221),\n (196.933227, 172.454221, 196.933227, 172.656313),\n (196.933227, 172.656313, 196.933227, 172.858405),\n (196.933227, 172.858405, 196.933227, 173.060497),\n (196.933227, 173.060497, 196.933227, 173.262589),\n (196.933227, 173.262589, 196.933227, 173.464681),\n (196.933227, 173.464681, 196.933227, 173.666773),\n (196.933227, 167.199827, 107.300173, 167.199827),\n (196.933227, 173.666773, 107.300173, 173.666773)\n]\nVISIBLE_CIRCLES = [\n (90.0667, 170.4333, 3.233473)\n]\nVISIBLE_ARCS = [\n\n]\nHIDDEN_SEGMENTS = [\n\n]\n# (orient, text, p1, p2, base) for linear; (orient, text, center, radius, angle) for diameter\nDIMENSIONS = [\n ('diameter', '%%c100', (90.0667, 170.4333), 3.2335, 45),\n ('horizontal', '1386.02', (107.3002, 170.4333), (196.9333, 170.4333), (152.1167, 181.4333))\n]\n\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\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\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,\n angle=(0 if d[0] == \"horizontal\" else 90),\n 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,\n text=text, dimstyle=\"EZDXF\").render()\n\n doc.saveas(out_path)\n\n\nif __name__ == \"__main__\":\n out = sys.argv[1] if len(sys.argv) > 1 else \"0018_00188460_gt.dxf\"\n draw(out)\n print(\"wrote\", out)\n```"}], "images": ["images/0018_00188460.png"], "id": "0018_00188460"} {"messages": [{"role": "user", "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 1357.14 mm."}, {"role": "assistant", "content": "```python\n#!/usr/bin/env python3\n# -*- coding: utf-8 -*-\n# Ground-truth 2D engineering drawing for part: 0019_00194813\n# Self-contained: reproduces the three-view DXF via ezdxf, NO FreeCAD needed.\n# Coordinates are A4 page millimetres (scale=0.0659509803921504, page=[297.0, 210.0]).\n# visible edges -> solid (layer OUTLINE); hidden edges -> dashed (layer HIDDEN)\n# dimensions -> real movable DIMENSION entities (text = true mm value)\n# Run: python 0019_00194813_gt.py [out.dxf]\nimport sys\nimport ezdxf\n\nSCALE = 0.0659509803921504\nPAGE = [297.0, 210.0]\n\nVISIBLE_SEGMENTS = [\n (86.801251, 153.103651, 87.007348, 153.103651),\n (87.007348, 153.103651, 87.213445, 153.103651),\n (87.213445, 153.103651, 87.419541, 153.103651),\n (87.419541, 153.103651, 87.625638, 153.103651),\n (87.625638, 153.103651, 87.831735, 153.103651),\n (87.831735, 153.103651, 88.037832, 153.103651),\n (88.037832, 153.103651, 88.243929, 153.103651),\n (88.243929, 153.103651, 88.450025, 153.103651),\n (88.450025, 153.103651, 88.656122, 153.103651),\n (88.656122, 153.103651, 88.862219, 153.103651),\n (88.862219, 153.103651, 89.068316, 153.103651),\n (89.068316, 153.103651, 89.274413, 153.103651),\n (89.274413, 153.103651, 89.48051, 153.103651),\n (89.48051, 153.103651, 89.686606, 153.103651),\n (89.686606, 153.103651, 89.892703, 153.103651),\n (89.892703, 153.103651, 90.0988, 153.103651),\n (90.0988, 153.103651, 90.304897, 153.103651),\n (90.304897, 153.103651, 90.510994, 153.103651),\n (90.510994, 153.103651, 90.71709, 153.103651),\n (90.71709, 153.103651, 90.923187, 153.103651),\n (90.923187, 153.103651, 91.129284, 153.103651),\n (91.129284, 153.103651, 91.335381, 153.103651),\n (91.335381, 153.103651, 91.541478, 153.103651),\n (91.541478, 153.103651, 91.747575, 153.103651),\n (91.747575, 153.103651, 91.953671, 153.103651),\n (91.953671, 153.103651, 92.159768, 153.103651),\n (92.159768, 153.103651, 92.365865, 153.103651),\n (92.365865, 153.103651, 92.571962, 153.103651),\n (92.571962, 153.103651, 92.778059, 153.103651),\n (92.778059, 153.103651, 92.984155, 153.103651),\n (92.984155, 153.103651, 93.190252, 153.103651),\n (93.190252, 153.103651, 93.396349, 153.103651),\n (93.396349, 153.103651, 93.396349, 63.598749),\n (86.801251, 63.598749, 87.007348, 63.598749),\n (87.007348, 63.598749, 87.213445, 63.598749),\n (87.213445, 63.598749, 87.419541, 63.598749),\n (87.419541, 63.598749, 87.625638, 63.598749),\n (87.625638, 63.598749, 87.831735, 63.598749),\n (87.831735, 63.598749, 88.037832, 63.598749),\n (88.037832, 63.598749, 88.243929, 63.598749),\n (88.243929, 63.598749, 88.450025, 63.598749),\n (88.450025, 63.598749, 88.656122, 63.598749),\n (88.656122, 63.598749, 88.862219, 63.598749),\n (88.862219, 63.598749, 89.068316, 63.598749),\n (89.068316, 63.598749, 89.274413, 63.598749),\n (89.274413, 63.598749, 89.48051, 63.598749),\n (89.48051, 63.598749, 89.686606, 63.598749),\n (89.686606, 63.598749, 89.892703, 63.598749),\n (89.892703, 63.598749, 90.0988, 63.598749),\n (90.0988, 63.598749, 90.304897, 63.598749),\n (90.304897, 63.598749, 90.510994, 63.598749),\n (90.510994, 63.598749, 90.71709, 63.598749),\n (90.71709, 63.598749, 90.923187, 63.598749),\n (90.923187, 63.598749, 91.129284, 63.598749),\n (91.129284, 63.598749, 91.335381, 63.598749),\n (91.335381, 63.598749, 91.541478, 63.598749),\n (91.541478, 63.598749, 91.747575, 63.598749),\n (91.747575, 63.598749, 91.953671, 63.598749),\n (91.953671, 63.598749, 92.159768, 63.598749),\n (92.159768, 63.598749, 92.365865, 63.598749),\n (92.365865, 63.598749, 92.571962, 63.598749),\n (92.571962, 63.598749, 92.778059, 63.598749),\n (92.778059, 63.598749, 92.984155, 63.598749),\n (92.984155, 63.598749, 93.190252, 63.598749),\n (93.190252, 63.598749, 93.396349, 63.598749),\n (86.801251, 63.598749, 86.801251, 153.103651),\n (196.901251, 173.698749, 196.901251, 173.492652),\n (196.901251, 173.492652, 196.901251, 173.286555),\n (196.901251, 173.286555, 196.901251, 173.080459),\n (196.901251, 173.080459, 196.901251, 172.874362),\n (196.901251, 172.874362, 196.901251, 172.668265),\n (196.901251, 172.668265, 196.901251, 172.462168),\n (196.901251, 172.462168, 196.901251, 172.256071),\n (196.901251, 172.256071, 196.901251, 172.049975),\n (196.901251, 172.049975, 196.901251, 171.843878),\n (196.901251, 171.843878, 196.901251, 171.637781),\n (196.901251, 171.637781, 196.901251, 171.431684),\n (196.901251, 171.431684, 196.901251, 171.225587),\n (196.901251, 171.225587, 196.901251, 171.01949),\n (196.901251, 171.01949, 196.901251, 170.813394),\n (196.901251, 170.813394, 196.901251, 170.607297),\n (196.901251, 170.607297, 196.901251, 170.4012),\n (196.901251, 170.4012, 196.901251, 170.195103),\n (196.901251, 170.195103, 196.901251, 169.989006),\n (196.901251, 169.989006, 196.901251, 169.78291),\n (196.901251, 169.78291, 196.901251, 169.576813),\n (196.901251, 169.576813, 196.901251, 169.370716),\n (196.901251, 169.370716, 196.901251, 169.164619),\n (196.901251, 169.164619, 196.901251, 168.958522),\n (196.901251, 168.958522, 196.901251, 168.752425),\n (196.901251, 168.752425, 196.901251, 168.546329),\n (196.901251, 168.546329, 196.901251, 168.340232),\n (196.901251, 168.340232, 196.901251, 168.134135),\n (196.901251, 168.134135, 196.901251, 167.928038),\n (196.901251, 167.928038, 196.901251, 167.721941),\n (196.901251, 167.721941, 196.901251, 167.515845),\n (196.901251, 167.515845, 196.901251, 167.309748),\n (196.901251, 167.309748, 196.901251, 167.103651),\n (107.396349, 173.698749, 107.396349, 173.492652),\n (107.396349, 173.492652, 107.396349, 173.286555),\n (107.396349, 173.286555, 107.396349, 173.080459),\n (107.396349, 173.080459, 107.396349, 172.874362),\n (107.396349, 172.874362, 107.396349, 172.668265),\n (107.396349, 172.668265, 107.396349, 172.462168),\n (107.396349, 172.462168, 107.396349, 172.256071),\n (107.396349, 172.256071, 107.396349, 172.049975),\n (107.396349, 172.049975, 107.396349, 171.843878),\n (107.396349, 171.843878, 107.396349, 171.637781),\n (107.396349, 171.637781, 107.396349, 171.431684),\n (107.396349, 171.431684, 107.396349, 171.225587),\n (107.396349, 171.225587, 107.396349, 171.01949),\n (107.396349, 171.01949, 107.396349, 170.813394),\n (107.396349, 170.813394, 107.396349, 170.607297),\n (107.396349, 170.607297, 107.396349, 170.4012),\n (107.396349, 170.4012, 107.396349, 170.195103),\n (107.396349, 170.195103, 107.396349, 169.989006),\n (107.396349, 169.989006, 107.396349, 169.78291),\n (107.396349, 169.78291, 107.396349, 169.576813),\n (107.396349, 169.576813, 107.396349, 169.370716),\n (107.396349, 169.370716, 107.396349, 169.164619),\n (107.396349, 169.164619, 107.396349, 168.958522),\n (107.396349, 168.958522, 107.396349, 168.752425),\n (107.396349, 168.752425, 107.396349, 168.546329),\n (107.396349, 168.546329, 107.396349, 168.340232),\n (107.396349, 168.340232, 107.396349, 168.134135),\n (107.396349, 168.134135, 107.396349, 167.928038),\n (107.396349, 167.928038, 107.396349, 167.721941),\n (107.396349, 167.721941, 107.396349, 167.515845),\n (107.396349, 167.515845, 107.396349, 167.309748),\n (107.396349, 167.309748, 107.396349, 167.103651),\n (107.396349, 173.698749, 196.901251, 173.698749),\n (107.396349, 167.103651, 196.901251, 167.103651)\n]\nVISIBLE_CIRCLES = [\n (90.0988, 170.4012, 3.297549)\n]\nVISIBLE_ARCS = [\n\n]\nHIDDEN_SEGMENTS = [\n\n]\n# (orient, text, p1, p2, base) for linear; (orient, text, center, radius, angle) for diameter\nDIMENSIONS = [\n ('diameter', '%%c100', (90.0988, 170.4012), 3.2975, 45),\n ('horizontal', '1357.14', (196.9012, 170.4012), (107.3963, 170.4012), (152.1488, 159.4012))\n]\n\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\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\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,\n angle=(0 if d[0] == \"horizontal\" else 90),\n 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,\n text=text, dimstyle=\"EZDXF\").render()\n\n doc.saveas(out_path)\n\n\nif __name__ == \"__main__\":\n out = sys.argv[1] if len(sys.argv) > 1 else \"0019_00194813_gt.dxf\"\n draw(out)\n print(\"wrote\", out)\n```"}], "images": ["images/0019_00194813.png"], "id": "0019_00194813"} {"messages": [{"role": "user", "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.35 mm."}, {"role": "assistant", "content": "```python\n#!/usr/bin/env python3\n# -*- coding: utf-8 -*-\n# Ground-truth 2D engineering drawing for part: 0019_00195223\n# Self-contained: reproduces the three-view DXF via ezdxf, NO FreeCAD needed.\n# Coordinates are A4 page millimetres (scale=0.7347, page=[297.0, 210.0]).\n# visible edges -> solid (layer OUTLINE); hidden edges -> dashed (layer HIDDEN)\n# dimensions -> real movable DIMENSION entities (text = true mm value)\n# Run: python 0019_00195223_gt.py [out.dxf]\nimport sys\nimport ezdxf\n\nSCALE = 0.7347\nPAGE = [297.0, 210.0]\n\nVISIBLE_SEGMENTS = [\n (70.984, 102.0459, 73.279937, 102.0459),\n (73.279937, 102.0459, 75.575875, 102.0459),\n (75.575875, 102.0459, 77.871812, 102.0459),\n (77.871812, 102.0459, 80.16775, 102.0459),\n (80.16775, 102.0459, 82.463687, 102.0459),\n (82.463687, 102.0459, 84.759625, 102.0459),\n (84.759625, 102.0459, 87.055562, 102.0459),\n (87.055562, 102.0459, 89.3515, 102.0459),\n (89.3515, 102.0459, 91.647438, 102.0459),\n (91.647438, 102.0459, 93.943375, 102.0459),\n (93.943375, 102.0459, 96.239313, 102.0459),\n (96.239313, 102.0459, 98.53525, 102.0459),\n (98.53525, 102.0459, 100.831188, 102.0459),\n (100.831188, 102.0459, 103.127125, 102.0459),\n (103.127125, 102.0459, 105.423063, 102.0459),\n (105.423063, 102.0459, 107.719, 102.0459),\n (107.719, 102.0459, 110.014937, 102.0459),\n (110.014937, 102.0459, 112.310875, 102.0459),\n (112.310875, 102.0459, 114.606812, 102.0459),\n (114.606812, 102.0459, 116.90275, 102.0459),\n (116.90275, 102.0459, 119.198688, 102.0459),\n (119.198688, 102.0459, 121.494625, 102.0459),\n (121.494625, 102.0459, 123.790563, 102.0459),\n (123.790563, 102.0459, 126.0865, 102.0459),\n (126.0865, 102.0459, 128.382438, 102.0459),\n (128.382438, 102.0459, 130.678375, 102.0459),\n (130.678375, 102.0459, 132.974313, 102.0459),\n (132.974313, 102.0459, 135.27025, 102.0459),\n (135.27025, 102.0459, 137.566188, 102.0459),\n (137.566188, 102.0459, 139.862125, 102.0459),\n (139.862125, 102.0459, 142.158063, 102.0459),\n (142.158063, 102.0459, 144.454, 102.0459),\n (144.454, 102.0459, 144.454, 81.219036),\n (70.984, 81.219036, 73.279937, 81.219036),\n (73.279937, 81.219036, 75.575875, 81.219036),\n (75.575875, 81.219036, 77.871812, 81.219036),\n (77.871812, 81.219036, 80.16775, 81.219036),\n (80.16775, 81.219036, 82.463687, 81.219036),\n (82.463687, 81.219036, 84.759625, 81.219036),\n (84.759625, 81.219036, 87.055562, 81.219036),\n (87.055562, 81.219036, 89.3515, 81.219036),\n (89.3515, 81.219036, 91.647438, 81.219036),\n (91.647438, 81.219036, 93.943375, 81.219036),\n (93.943375, 81.219036, 96.239313, 81.219036),\n (96.239313, 81.219036, 98.53525, 81.219036),\n (98.53525, 81.219036, 100.831188, 81.219036),\n (100.831188, 81.219036, 103.127125, 81.219036),\n (103.127125, 81.219036, 105.423063, 81.219036),\n (105.423063, 81.219036, 107.719, 81.219036),\n (107.719, 81.219036, 110.014937, 81.219036),\n (110.014937, 81.219036, 112.310875, 81.219036),\n (112.310875, 81.219036, 114.606812, 81.219036),\n (114.606812, 81.219036, 116.90275, 81.219036),\n (116.90275, 81.219036, 119.198688, 81.219036),\n (119.198688, 81.219036, 121.494625, 81.219036),\n (121.494625, 81.219036, 123.790563, 81.219036),\n (123.790563, 81.219036, 126.0865, 81.219036),\n (126.0865, 81.219036, 128.382438, 81.219036),\n (128.382438, 81.219036, 130.678375, 81.219036),\n (130.678375, 81.219036, 132.974313, 81.219036),\n (132.974313, 81.219036, 135.27025, 81.219036),\n (135.27025, 81.219036, 137.566188, 81.219036),\n (137.566188, 81.219036, 139.862125, 81.219036),\n (139.862125, 81.219036, 142.158063, 81.219036),\n (142.158063, 81.219036, 144.454, 81.219036),\n (70.984, 81.219036, 70.984, 102.0459),\n (179.280864, 189.5159, 179.280864, 187.219963),\n (179.280864, 187.219963, 179.280864, 184.924025),\n (179.280864, 184.924025, 179.280864, 182.628088),\n (179.280864, 182.628088, 179.280864, 180.33215),\n (179.280864, 180.33215, 179.280864, 178.036213),\n (179.280864, 178.036213, 179.280864, 175.740275),\n (179.280864, 175.740275, 179.280864, 173.444338),\n (179.280864, 173.444338, 179.280864, 171.1484),\n (179.280864, 171.1484, 179.280864, 168.852463),\n (179.280864, 168.852463, 179.280864, 166.556525),\n (179.280864, 166.556525, 179.280864, 164.260588),\n (179.280864, 164.260588, 179.280864, 161.96465),\n (179.280864, 161.96465, 179.280864, 159.668713),\n (179.280864, 159.668713, 179.280864, 157.372775),\n (179.280864, 157.372775, 179.280864, 155.076838),\n (179.280864, 155.076838, 179.280864, 152.7809),\n (179.280864, 152.7809, 179.280864, 150.484962),\n (179.280864, 150.484962, 179.280864, 148.189025),\n (179.280864, 148.189025, 179.280864, 145.893088),\n (179.280864, 145.893088, 179.280864, 143.59715),\n (179.280864, 143.59715, 179.280864, 141.301213),\n (179.280864, 141.301213, 179.280864, 139.005275),\n (179.280864, 139.005275, 179.280864, 136.709338),\n (179.280864, 136.709338, 179.280864, 134.4134),\n (179.280864, 134.4134, 179.280864, 132.117463),\n (179.280864, 132.117463, 179.280864, 129.821525),\n (179.280864, 129.821525, 179.280864, 127.525588),\n (179.280864, 127.525588, 179.280864, 125.22965),\n (179.280864, 125.22965, 179.280864, 122.933713),\n (179.280864, 122.933713, 179.280864, 120.637775),\n (179.280864, 120.637775, 179.280864, 118.341838),\n (179.280864, 118.341838, 179.280864, 116.0459),\n (158.454, 189.5159, 158.454, 187.219963),\n (158.454, 187.219963, 158.454, 184.924025),\n (158.454, 184.924025, 158.454, 182.628088),\n (158.454, 182.628088, 158.454, 180.33215),\n (158.454, 180.33215, 158.454, 178.036213),\n (158.454, 178.036213, 158.454, 175.740275),\n (158.454, 175.740275, 158.454, 173.444338),\n (158.454, 173.444338, 158.454, 171.1484),\n (158.454, 171.1484, 158.454, 168.852463),\n (158.454, 168.852463, 158.454, 166.556525),\n (158.454, 166.556525, 158.454, 164.260588),\n (158.454, 164.260588, 158.454, 161.96465),\n (158.454, 161.96465, 158.454, 159.668713),\n (158.454, 159.668713, 158.454, 157.372775),\n (158.454, 157.372775, 158.454, 155.076838),\n (158.454, 155.076838, 158.454, 152.7809),\n (158.454, 152.7809, 158.454, 150.484963),\n (158.454, 150.484963, 158.454, 148.189025),\n (158.454, 148.189025, 158.454, 145.893088),\n (158.454, 145.893088, 158.454, 143.59715),\n (158.454, 143.59715, 158.454, 141.301213),\n (158.454, 141.301213, 158.454, 139.005275),\n (158.454, 139.005275, 158.454, 136.709338),\n (158.454, 136.709338, 158.454, 134.4134),\n (158.454, 134.4134, 158.454, 132.117463),\n (158.454, 132.117463, 158.454, 129.821525),\n (158.454, 129.821525, 158.454, 127.525588),\n (158.454, 127.525588, 158.454, 125.22965),\n (158.454, 125.22965, 158.454, 122.933713),\n (158.454, 122.933713, 158.454, 120.637775),\n (158.454, 120.637775, 158.454, 118.341838),\n (158.454, 118.341838, 158.454, 116.0459),\n (158.454, 189.5159, 179.280864, 189.5159),\n (158.454, 116.0459, 179.280864, 116.0459)\n]\nVISIBLE_CIRCLES = [\n (107.719, 152.7809, 36.735)\n]\nVISIBLE_ARCS = [\n\n]\nHIDDEN_SEGMENTS = [\n\n]\n# (orient, text, p1, p2, base) for linear; (orient, text, center, radius, angle) for diameter\nDIMENSIONS = [\n ('diameter', '%%c100', (107.719, 152.7809), 36.735, 45),\n ('horizontal', '28.3474', (179.2809, 152.7809), (158.4541, 152.7809), (168.8675, 141.7809))\n]\n\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\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\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,\n angle=(0 if d[0] == \"horizontal\" else 90),\n 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,\n text=text, dimstyle=\"EZDXF\").render()\n\n doc.saveas(out_path)\n\n\nif __name__ == \"__main__\":\n out = sys.argv[1] if len(sys.argv) > 1 else \"0019_00195223_gt.dxf\"\n draw(out)\n print(\"wrote\", out)\n```"}], "images": ["images/0019_00195223.png"], "id": "0019_00195223"} {"messages": [{"role": "user", "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 22.68 mm."}, {"role": "assistant", "content": "```python\n#!/usr/bin/env python3\n# -*- coding: utf-8 -*-\n# Ground-truth 2D engineering drawing for part: 0019_00195498\n# Self-contained: reproduces the three-view DXF via ezdxf, NO FreeCAD needed.\n# Coordinates are A4 page millimetres (scale=0.7347, page=[297.0, 210.0]).\n# visible edges -> solid (layer OUTLINE); hidden edges -> dashed (layer HIDDEN)\n# dimensions -> real movable DIMENSION entities (text = true mm value)\n# Run: python 0019_00195498_gt.py [out.dxf]\nimport sys\nimport ezdxf\n\nSCALE = 0.7347\nPAGE = [297.0, 210.0]\n\nVISIBLE_SEGMENTS = [\n (73.0667, 99.9632, 75.362638, 99.9632),\n (75.362638, 99.9632, 77.658575, 99.9632),\n (77.658575, 99.9632, 79.954512, 99.9632),\n (79.954512, 99.9632, 82.25045, 99.9632),\n (82.25045, 99.9632, 84.546387, 99.9632),\n (84.546387, 99.9632, 86.842325, 99.9632),\n (86.842325, 99.9632, 89.138262, 99.9632),\n (89.138262, 99.9632, 91.4342, 99.9632),\n (91.4342, 99.9632, 93.730138, 99.9632),\n (93.730138, 99.9632, 96.026075, 99.9632),\n (96.026075, 99.9632, 98.322013, 99.9632),\n (98.322013, 99.9632, 100.61795, 99.9632),\n (100.61795, 99.9632, 102.913888, 99.9632),\n (102.913888, 99.9632, 105.209825, 99.9632),\n (105.209825, 99.9632, 107.505763, 99.9632),\n (107.505763, 99.9632, 109.8017, 99.9632),\n (109.8017, 99.9632, 112.097637, 99.9632),\n (112.097637, 99.9632, 114.393575, 99.9632),\n (114.393575, 99.9632, 116.689512, 99.9632),\n (116.689512, 99.9632, 118.98545, 99.9632),\n (118.98545, 99.9632, 121.281388, 99.9632),\n (121.281388, 99.9632, 123.577325, 99.9632),\n (123.577325, 99.9632, 125.873263, 99.9632),\n (125.873263, 99.9632, 128.1692, 99.9632),\n (128.1692, 99.9632, 130.465138, 99.9632),\n (130.465138, 99.9632, 132.761075, 99.9632),\n (132.761075, 99.9632, 135.057013, 99.9632),\n (135.057013, 99.9632, 137.35295, 99.9632),\n (137.35295, 99.9632, 139.648888, 99.9632),\n (139.648888, 99.9632, 141.944825, 99.9632),\n (141.944825, 99.9632, 144.240763, 99.9632),\n (144.240763, 99.9632, 146.5367, 99.9632),\n (146.5367, 99.9632, 146.5367, 83.301709),\n (73.0667, 83.301709, 75.362638, 83.301709),\n (75.362638, 83.301709, 77.658575, 83.301709),\n (77.658575, 83.301709, 79.954512, 83.301709),\n (79.954512, 83.301709, 82.25045, 83.301709),\n (82.25045, 83.301709, 84.546387, 83.301709),\n (84.546387, 83.301709, 86.842325, 83.301709),\n (86.842325, 83.301709, 89.138262, 83.301709),\n (89.138262, 83.301709, 91.4342, 83.301709),\n (91.4342, 83.301709, 93.730138, 83.301709),\n (93.730138, 83.301709, 96.026075, 83.301709),\n (96.026075, 83.301709, 98.322013, 83.301709),\n (98.322013, 83.301709, 100.61795, 83.301709),\n (100.61795, 83.301709, 102.913888, 83.301709),\n (102.913888, 83.301709, 105.209825, 83.301709),\n (105.209825, 83.301709, 107.505763, 83.301709),\n (107.505763, 83.301709, 109.8017, 83.301709),\n (109.8017, 83.301709, 112.097637, 83.301709),\n (112.097637, 83.301709, 114.393575, 83.301709),\n (114.393575, 83.301709, 116.689512, 83.301709),\n (116.689512, 83.301709, 118.98545, 83.301709),\n (118.98545, 83.301709, 121.281388, 83.301709),\n (121.281388, 83.301709, 123.577325, 83.301709),\n (123.577325, 83.301709, 125.873263, 83.301709),\n (125.873263, 83.301709, 128.1692, 83.301709),\n (128.1692, 83.301709, 130.465138, 83.301709),\n (130.465138, 83.301709, 132.761075, 83.301709),\n (132.761075, 83.301709, 135.057013, 83.301709),\n (135.057013, 83.301709, 137.35295, 83.301709),\n (137.35295, 83.301709, 139.648888, 83.301709),\n (139.648888, 83.301709, 141.944825, 83.301709),\n (141.944825, 83.301709, 144.240763, 83.301709),\n (144.240763, 83.301709, 146.5367, 83.301709),\n (73.0667, 83.301709, 73.0667, 99.9632),\n (177.198191, 187.4332, 177.198191, 185.137263),\n (177.198191, 185.137263, 177.198191, 182.841325),\n (177.198191, 182.841325, 177.198191, 180.545388),\n (177.198191, 180.545388, 177.198191, 178.24945),\n (177.198191, 178.24945, 177.198191, 175.953513),\n (177.198191, 175.953513, 177.198191, 173.657575),\n (177.198191, 173.657575, 177.198191, 171.361638),\n (177.198191, 171.361638, 177.198191, 169.0657),\n (177.198191, 169.0657, 177.198191, 166.769763),\n (177.198191, 166.769763, 177.198191, 164.473825),\n (177.198191, 164.473825, 177.198191, 162.177888),\n (177.198191, 162.177888, 177.198191, 159.88195),\n (177.198191, 159.88195, 177.198191, 157.586013),\n (177.198191, 157.586013, 177.198191, 155.290075),\n (177.198191, 155.290075, 177.198191, 152.994138),\n (177.198191, 152.994138, 177.198191, 150.6982),\n (177.198191, 150.6982, 177.198191, 148.402263),\n (177.198191, 148.402263, 177.198191, 146.106325),\n (177.198191, 146.106325, 177.198191, 143.810388),\n (177.198191, 143.810388, 177.198191, 141.51445),\n (177.198191, 141.51445, 177.198191, 139.218513),\n (177.198191, 139.218513, 177.198191, 136.922575),\n (177.198191, 136.922575, 177.198191, 134.626638),\n (177.198191, 134.626638, 177.198191, 132.3307),\n (177.198191, 132.3307, 177.198191, 130.034763),\n (177.198191, 130.034763, 177.198191, 127.738825),\n (177.198191, 127.738825, 177.198191, 125.442888),\n (177.198191, 125.442888, 177.198191, 123.14695),\n (177.198191, 123.14695, 177.198191, 120.851013),\n (177.198191, 120.851013, 177.198191, 118.555075),\n (177.198191, 118.555075, 177.198191, 116.259138),\n (177.198191, 116.259138, 177.198191, 113.9632),\n (160.5367, 187.4332, 160.5367, 185.137263),\n (160.5367, 185.137263, 160.5367, 182.841325),\n (160.5367, 182.841325, 160.5367, 180.545388),\n (160.5367, 180.545388, 160.5367, 178.24945),\n (160.5367, 178.24945, 160.5367, 175.953513),\n (160.5367, 175.953513, 160.5367, 173.657575),\n (160.5367, 173.657575, 160.5367, 171.361638),\n (160.5367, 171.361638, 160.5367, 169.0657),\n (160.5367, 169.0657, 160.5367, 166.769763),\n (160.5367, 166.769763, 160.5367, 164.473825),\n (160.5367, 164.473825, 160.5367, 162.177888),\n (160.5367, 162.177888, 160.5367, 159.88195),\n (160.5367, 159.88195, 160.5367, 157.586013),\n (160.5367, 157.586013, 160.5367, 155.290075),\n (160.5367, 155.290075, 160.5367, 152.994138),\n (160.5367, 152.994138, 160.5367, 150.6982),\n (160.5367, 150.6982, 160.5367, 148.402263),\n (160.5367, 148.402263, 160.5367, 146.106325),\n (160.5367, 146.106325, 160.5367, 143.810388),\n (160.5367, 143.810388, 160.5367, 141.51445),\n (160.5367, 141.51445, 160.5367, 139.218513),\n (160.5367, 139.218513, 160.5367, 136.922575),\n (160.5367, 136.922575, 160.5367, 134.626638),\n (160.5367, 134.626638, 160.5367, 132.3307),\n (160.5367, 132.3307, 160.5367, 130.034763),\n (160.5367, 130.034763, 160.5367, 127.738825),\n (160.5367, 127.738825, 160.5367, 125.442888),\n (160.5367, 125.442888, 160.5367, 123.14695),\n (160.5367, 123.14695, 160.5367, 120.851013),\n (160.5367, 120.851013, 160.5367, 118.555075),\n (160.5367, 118.555075, 160.5367, 116.259138),\n (160.5367, 116.259138, 160.5367, 113.9632),\n (160.5367, 187.4332, 177.198191, 187.4332),\n (160.5367, 113.9632, 177.198191, 113.9632)\n]\nVISIBLE_CIRCLES = [\n (109.8017, 150.6982, 36.735)\n]\nVISIBLE_ARCS = [\n\n]\nHIDDEN_SEGMENTS = [\n\n]\n# (orient, text, p1, p2, base) for linear; (orient, text, center, radius, angle) for diameter\nDIMENSIONS = [\n ('diameter', '%%c100', (109.8017, 150.6982), 36.735, 45),\n ('horizontal', '22.678', (177.1982, 150.6982), (160.5367, 150.6982), (168.8675, 139.6982))\n]\n\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\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\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,\n angle=(0 if d[0] == \"horizontal\" else 90),\n 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,\n text=text, dimstyle=\"EZDXF\").render()\n\n doc.saveas(out_path)\n\n\nif __name__ == \"__main__\":\n out = sys.argv[1] if len(sys.argv) > 1 else \"0019_00195498_gt.dxf\"\n draw(out)\n print(\"wrote\", out)\n```"}], "images": ["images/0019_00195498.png"], "id": "0019_00195498"} {"messages": [{"role": "user", "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": "assistant", "content": "```python\n#!/usr/bin/env python3\n# -*- coding: utf-8 -*-\n# Ground-truth 2D engineering drawing for part: 0019_00195895\n# Self-contained: reproduces the three-view DXF via ezdxf, NO FreeCAD needed.\n# Coordinates are A4 page millimetres (scale=0.21268032786885335, page=[297.0, 210.0]).\n# visible edges -> solid (layer OUTLINE); hidden edges -> dashed (layer HIDDEN)\n# dimensions -> real movable DIMENSION entities (text = true mm value)\n# Run: python 0019_00195895_gt.py [out.dxf]\nimport sys\nimport ezdxf\n\nSCALE = 0.21268032786885335\nPAGE = [297.0, 210.0]\n\nVISIBLE_SEGMENTS = [\n (104.401016, 67.267016, 103.73639, 67.267016),\n (103.73639, 67.267016, 103.071764, 67.267016),\n (103.071764, 67.267016, 102.407138, 67.267016),\n (102.407138, 67.267016, 101.742512, 67.267016),\n (101.742512, 67.267016, 101.077886, 67.267016),\n (101.077886, 67.267016, 100.41326, 67.267016),\n (100.41326, 67.267016, 99.748634, 67.267016),\n (99.748634, 67.267016, 99.084008, 67.267016),\n (99.084008, 67.267016, 98.419382, 67.267016),\n (98.419382, 67.267016, 97.754756, 67.267016),\n (97.754756, 67.267016, 97.09013, 67.267016),\n (97.09013, 67.267016, 96.425504, 67.267016),\n (96.425504, 67.267016, 95.760878, 67.267016),\n (95.760878, 67.267016, 95.096252, 67.267016),\n (95.096252, 67.267016, 94.431626, 67.267016),\n (94.431626, 67.267016, 93.767, 67.267016),\n (93.767, 67.267016, 93.102374, 67.267016),\n (93.102374, 67.267016, 92.437748, 67.267016),\n (92.437748, 67.267016, 91.773122, 67.267016),\n (91.773122, 67.267016, 91.108496, 67.267016),\n (91.108496, 67.267016, 90.44387, 67.267016),\n (90.44387, 67.267016, 89.779244, 67.267016),\n (89.779244, 67.267016, 89.114618, 67.267016),\n (89.114618, 67.267016, 88.449992, 67.267016),\n (88.449992, 67.267016, 87.785366, 67.267016),\n (87.785366, 67.267016, 87.12074, 67.267016),\n (87.12074, 67.267016, 86.456114, 67.267016),\n (86.456114, 67.267016, 85.791488, 67.267016),\n (85.791488, 67.267016, 85.126862, 67.267016),\n (85.126862, 67.267016, 84.462236, 67.267016),\n (84.462236, 67.267016, 83.79761, 67.267016),\n (83.79761, 67.267016, 83.132984, 67.267016),\n (104.401016, 67.267016, 104.401016, 142.098983),\n (104.401016, 142.098983, 103.73639, 142.098983),\n (103.73639, 142.098983, 103.071764, 142.098983),\n (103.071764, 142.098983, 102.407138, 142.098983),\n (102.407138, 142.098983, 101.742512, 142.098983),\n (101.742512, 142.098983, 101.077886, 142.098983),\n (101.077886, 142.098983, 100.41326, 142.098983),\n (100.41326, 142.098983, 99.748634, 142.098983),\n (99.748634, 142.098983, 99.084008, 142.098983),\n (99.084008, 142.098983, 98.419382, 142.098983),\n (98.419382, 142.098983, 97.754756, 142.098983),\n (97.754756, 142.098983, 97.09013, 142.098983),\n (97.09013, 142.098983, 96.425504, 142.098983),\n (96.425504, 142.098983, 95.760878, 142.098983),\n (95.760878, 142.098983, 95.096252, 142.098983),\n (95.096252, 142.098983, 94.431626, 142.098983),\n (94.431626, 142.098983, 93.767, 142.098983),\n (93.767, 142.098983, 93.102374, 142.098983),\n (93.102374, 142.098983, 92.437748, 142.098983),\n (92.437748, 142.098983, 91.773122, 142.098983),\n (91.773122, 142.098983, 91.108496, 142.098983),\n (91.108496, 142.098983, 90.44387, 142.098983),\n (90.44387, 142.098983, 89.779244, 142.098983),\n (89.779244, 142.098983, 89.114618, 142.098983),\n (89.114618, 142.098983, 88.449992, 142.098983),\n (88.449992, 142.098983, 87.785366, 142.098983),\n (87.785366, 142.098983, 87.12074, 142.098983),\n (87.12074, 142.098983, 86.456114, 142.098983),\n (86.456114, 142.098983, 85.791488, 142.098983),\n (85.791488, 142.098983, 85.126862, 142.098983),\n (85.126862, 142.098983, 84.462236, 142.098983),\n (84.462236, 142.098983, 83.79761, 142.098983),\n (83.79761, 142.098983, 83.132984, 142.098983),\n (83.132984, 142.098983, 83.132984, 67.267016),\n (118.401017, 156.098984, 118.401017, 156.76361),\n (118.401017, 156.76361, 118.401017, 157.428236),\n (118.401017, 157.428236, 118.401017, 158.092862),\n (118.401017, 158.092862, 118.401017, 158.757488),\n (118.401017, 158.757488, 118.401017, 159.422114),\n (118.401017, 159.422114, 118.401017, 160.08674),\n (118.401017, 160.08674, 118.401017, 160.751366),\n (118.401017, 160.751366, 118.401017, 161.415992),\n (118.401017, 161.415992, 118.401017, 162.080618),\n (118.401017, 162.080618, 118.401017, 162.745244),\n (118.401017, 162.745244, 118.401017, 163.40987),\n (118.401017, 163.40987, 118.401017, 164.074496),\n (118.401017, 164.074496, 118.401017, 164.739122),\n (118.401017, 164.739122, 118.401017, 165.403748),\n (118.401017, 165.403748, 118.401017, 166.068374),\n (118.401017, 166.068374, 118.401017, 166.733),\n (118.401017, 166.733, 118.401017, 167.397626),\n (118.401017, 167.397626, 118.401017, 168.062252),\n (118.401017, 168.062252, 118.401017, 168.726878),\n (118.401017, 168.726878, 118.401017, 169.391504),\n (118.401017, 169.391504, 118.401017, 170.05613),\n (118.401017, 170.05613, 118.401017, 170.720756),\n (118.401017, 170.720756, 118.401017, 171.385382),\n (118.401017, 171.385382, 118.401017, 172.050008),\n (118.401017, 172.050008, 118.401017, 172.714634),\n (118.401017, 172.714634, 118.401017, 173.37926),\n (118.401017, 173.37926, 118.401017, 174.043886),\n (118.401017, 174.043886, 118.401017, 174.708512),\n (118.401017, 174.708512, 118.401017, 175.373138),\n (118.401017, 175.373138, 118.401017, 176.037764),\n (118.401017, 176.037764, 118.401017, 176.70239),\n (118.401017, 176.70239, 118.401017, 177.367016),\n (193.232984, 156.098984, 193.232984, 156.76361),\n (193.232984, 156.76361, 193.232984, 157.428236),\n (193.232984, 157.428236, 193.232984, 158.092862),\n (193.232984, 158.092862, 193.232984, 158.757488),\n (193.232984, 158.757488, 193.232984, 159.422114),\n (193.232984, 159.422114, 193.232984, 160.08674),\n (193.232984, 160.08674, 193.232984, 160.751366),\n (193.232984, 160.751366, 193.232984, 161.415992),\n (193.232984, 161.415992, 193.232984, 162.080618),\n (193.232984, 162.080618, 193.232984, 162.745244),\n (193.232984, 162.745244, 193.232984, 163.40987),\n (193.232984, 163.40987, 193.232984, 164.074496),\n (193.232984, 164.074496, 193.232984, 164.739122),\n (193.232984, 164.739122, 193.232984, 165.403748),\n (193.232984, 165.403748, 193.232984, 166.068374),\n (193.232984, 166.068374, 193.232984, 166.733),\n (193.232984, 166.733, 193.232984, 167.397626),\n (193.232984, 167.397626, 193.232984, 168.062252),\n (193.232984, 168.062252, 193.232984, 168.726878),\n (193.232984, 168.726878, 193.232984, 169.391504),\n (193.232984, 169.391504, 193.232984, 170.05613),\n (193.232984, 170.05613, 193.232984, 170.720756),\n (193.232984, 170.720756, 193.232984, 171.385382),\n (193.232984, 171.385382, 193.232984, 172.050008),\n (193.232984, 172.050008, 193.232984, 172.714634),\n (193.232984, 172.714634, 193.232984, 173.37926),\n (193.232984, 173.37926, 193.232984, 174.043886),\n (193.232984, 174.043886, 193.232984, 174.708512),\n (193.232984, 174.708512, 193.232984, 175.373138),\n (193.232984, 175.373138, 193.232984, 176.037764),\n (193.232984, 176.037764, 193.232984, 176.70239),\n (193.232984, 176.70239, 193.232984, 177.367016),\n (193.232984, 156.098984, 118.401017, 156.098984),\n (193.232984, 177.367016, 118.401017, 177.367016)\n]\nVISIBLE_CIRCLES = [\n (93.767, 166.733, 10.634016)\n]\nVISIBLE_ARCS = [\n\n]\nHIDDEN_SEGMENTS = [\n\n]\n# (orient, text, p1, p2, base) for linear; (orient, text, center, radius, angle) for diameter\nDIMENSIONS = [\n ('diameter', '%%c100', (93.767, 166.733), 10.634, 45),\n ('horizontal', '351.852', (118.401, 166.733), (193.233, 166.733), (155.817, 177.733))\n]\n\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\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\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,\n angle=(0 if d[0] == \"horizontal\" else 90),\n 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,\n text=text, dimstyle=\"EZDXF\").render()\n\n doc.saveas(out_path)\n\n\nif __name__ == \"__main__\":\n out = sys.argv[1] if len(sys.argv) > 1 else \"0019_00195895_gt.dxf\"\n draw(out)\n print(\"wrote\", out)\n```"}], "images": ["images/0019_00195895.png"], "id": "0019_00195895"} {"messages": [{"role": "user", "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 163.79 mm."}, {"role": "assistant", "content": "```python\n#!/usr/bin/env python3\n# -*- coding: utf-8 -*-\n# Ground-truth 2D engineering drawing for part: 0021_00217337\n# Self-contained: reproduces the three-view DXF via ezdxf, NO FreeCAD needed.\n# Coordinates are A4 page millimetres (scale=0.3643006535947793, page=[297.0, 210.0]).\n# visible edges -> solid (layer OUTLINE); hidden edges -> dashed (layer HIDDEN)\n# dimensions -> real movable DIMENSION entities (text = true mm value)\n# Run: python 0021_00217337_gt.py [out.dxf]\nimport sys\nimport ezdxf\n\nSCALE = 0.3643006535947793\nPAGE = [297.0, 210.0]\n\nVISIBLE_SEGMENTS = [\n (115.772533, 71.057532, 114.634093, 71.057532),\n (114.634093, 71.057532, 113.495654, 71.057532),\n (113.495654, 71.057532, 112.357214, 71.057532),\n (112.357214, 71.057532, 111.218775, 71.057532),\n (111.218775, 71.057532, 110.080335, 71.057532),\n (110.080335, 71.057532, 108.941895, 71.057532),\n (108.941895, 71.057532, 107.803456, 71.057532),\n (107.803456, 71.057532, 106.665016, 71.057532),\n (106.665016, 71.057532, 105.526577, 71.057532),\n (105.526577, 71.057532, 104.388137, 71.057532),\n (104.388137, 71.057532, 103.249698, 71.057532),\n (103.249698, 71.057532, 102.111258, 71.057532),\n (102.111258, 71.057532, 100.972819, 71.057532),\n (100.972819, 71.057532, 99.834379, 71.057532),\n (99.834379, 71.057532, 98.69594, 71.057532),\n (98.69594, 71.057532, 97.5575, 71.057532),\n (97.5575, 71.057532, 96.41906, 71.057532),\n (96.41906, 71.057532, 95.280621, 71.057532),\n (95.280621, 71.057532, 94.142181, 71.057532),\n (94.142181, 71.057532, 93.003742, 71.057532),\n (93.003742, 71.057532, 91.865302, 71.057532),\n (91.865302, 71.057532, 90.726863, 71.057532),\n (90.726863, 71.057532, 89.588423, 71.057532),\n (89.588423, 71.057532, 88.449984, 71.057532),\n (88.449984, 71.057532, 87.311544, 71.057532),\n (87.311544, 71.057532, 86.173105, 71.057532),\n (86.173105, 71.057532, 85.034665, 71.057532),\n (85.034665, 71.057532, 83.896225, 71.057532),\n (83.896225, 71.057532, 82.757786, 71.057532),\n (82.757786, 71.057532, 81.619346, 71.057532),\n (81.619346, 71.057532, 80.480907, 71.057532),\n (80.480907, 71.057532, 79.342467, 71.057532),\n (115.772533, 71.057532, 115.772533, 130.727467),\n (115.772533, 130.727467, 114.634093, 130.727467),\n (114.634093, 130.727467, 113.495654, 130.727467),\n (113.495654, 130.727467, 112.357214, 130.727467),\n (112.357214, 130.727467, 111.218775, 130.727467),\n (111.218775, 130.727467, 110.080335, 130.727467),\n (110.080335, 130.727467, 108.941895, 130.727467),\n (108.941895, 130.727467, 107.803456, 130.727467),\n (107.803456, 130.727467, 106.665016, 130.727467),\n (106.665016, 130.727467, 105.526577, 130.727467),\n (105.526577, 130.727467, 104.388137, 130.727467),\n (104.388137, 130.727467, 103.249698, 130.727467),\n (103.249698, 130.727467, 102.111258, 130.727467),\n (102.111258, 130.727467, 100.972819, 130.727467),\n (100.972819, 130.727467, 99.834379, 130.727467),\n (99.834379, 130.727467, 98.69594, 130.727467),\n (98.69594, 130.727467, 97.5575, 130.727467),\n (97.5575, 130.727467, 96.41906, 130.727467),\n (96.41906, 130.727467, 95.280621, 130.727467),\n (95.280621, 130.727467, 94.142181, 130.727467),\n (94.142181, 130.727467, 93.003742, 130.727467),\n (93.003742, 130.727467, 91.865302, 130.727467),\n (91.865302, 130.727467, 90.726863, 130.727467),\n (90.726863, 130.727467, 89.588423, 130.727467),\n (89.588423, 130.727467, 88.449984, 130.727467),\n (88.449984, 130.727467, 87.311544, 130.727467),\n (87.311544, 130.727467, 86.173105, 130.727467),\n (86.173105, 130.727467, 85.034665, 130.727467),\n (85.034665, 130.727467, 83.896225, 130.727467),\n (83.896225, 130.727467, 82.757786, 130.727467),\n (82.757786, 130.727467, 81.619346, 130.727467),\n (81.619346, 130.727467, 80.480907, 130.727467),\n (80.480907, 130.727467, 79.342467, 130.727467),\n (79.342467, 130.727467, 79.342467, 71.057532),\n (129.772533, 144.727467, 129.772533, 145.865907),\n (129.772533, 145.865907, 129.772533, 147.004346),\n (129.772533, 147.004346, 129.772533, 148.142786),\n (129.772533, 148.142786, 129.772533, 149.281225),\n (129.772533, 149.281225, 129.772533, 150.419665),\n (129.772533, 150.419665, 129.772533, 151.558105),\n (129.772533, 151.558105, 129.772533, 152.696544),\n (129.772533, 152.696544, 129.772533, 153.834984),\n (129.772533, 153.834984, 129.772533, 154.973423),\n (129.772533, 154.973423, 129.772533, 156.111863),\n (129.772533, 156.111863, 129.772533, 157.250302),\n (129.772533, 157.250302, 129.772533, 158.388742),\n (129.772533, 158.388742, 129.772533, 159.527181),\n (129.772533, 159.527181, 129.772533, 160.665621),\n (129.772533, 160.665621, 129.772533, 161.80406),\n (129.772533, 161.80406, 129.772533, 162.9425),\n (129.772533, 162.9425, 129.772533, 164.08094),\n (129.772533, 164.08094, 129.772533, 165.219379),\n (129.772533, 165.219379, 129.772533, 166.357819),\n (129.772533, 166.357819, 129.772533, 167.496258),\n (129.772533, 167.496258, 129.772533, 168.634698),\n (129.772533, 168.634698, 129.772533, 169.773137),\n (129.772533, 169.773137, 129.772533, 170.911577),\n (129.772533, 170.911577, 129.772533, 172.050016),\n (129.772533, 172.050016, 129.772533, 173.188456),\n (129.772533, 173.188456, 129.772533, 174.326895),\n (129.772533, 174.326895, 129.772533, 175.465335),\n (129.772533, 175.465335, 129.772533, 176.603775),\n (129.772533, 176.603775, 129.772533, 177.742214),\n (129.772533, 177.742214, 129.772533, 178.880654),\n (129.772533, 178.880654, 129.772533, 180.019093),\n (129.772533, 180.019093, 129.772533, 181.157533),\n (189.442468, 144.727467, 189.442468, 145.865907),\n (189.442468, 145.865907, 189.442468, 147.004346),\n (189.442468, 147.004346, 189.442468, 148.142786),\n (189.442468, 148.142786, 189.442468, 149.281225),\n (189.442468, 149.281225, 189.442468, 150.419665),\n (189.442468, 150.419665, 189.442468, 151.558105),\n (189.442468, 151.558105, 189.442468, 152.696544),\n (189.442468, 152.696544, 189.442468, 153.834984),\n (189.442468, 153.834984, 189.442468, 154.973423),\n (189.442468, 154.973423, 189.442468, 156.111863),\n (189.442468, 156.111863, 189.442468, 157.250302),\n (189.442468, 157.250302, 189.442468, 158.388742),\n (189.442468, 158.388742, 189.442468, 159.527181),\n (189.442468, 159.527181, 189.442468, 160.665621),\n (189.442468, 160.665621, 189.442468, 161.80406),\n (189.442468, 161.80406, 189.442468, 162.9425),\n (189.442468, 162.9425, 189.442468, 164.08094),\n (189.442468, 164.08094, 189.442468, 165.219379),\n (189.442468, 165.219379, 189.442468, 166.357819),\n (189.442468, 166.357819, 189.442468, 167.496258),\n (189.442468, 167.496258, 189.442468, 168.634698),\n (189.442468, 168.634698, 189.442468, 169.773137),\n (189.442468, 169.773137, 189.442468, 170.911577),\n (189.442468, 170.911577, 189.442468, 172.050016),\n (189.442468, 172.050016, 189.442468, 173.188456),\n (189.442468, 173.188456, 189.442468, 174.326895),\n (189.442468, 174.326895, 189.442468, 175.465335),\n (189.442468, 175.465335, 189.442468, 176.603775),\n (189.442468, 176.603775, 189.442468, 177.742214),\n (189.442468, 177.742214, 189.442468, 178.880654),\n (189.442468, 178.880654, 189.442468, 180.019093),\n (189.442468, 180.019093, 189.442468, 181.157533),\n (189.442468, 144.727467, 129.772533, 144.727467),\n (189.442468, 181.157533, 129.772533, 181.157533)\n]\nVISIBLE_CIRCLES = [\n (97.5575, 162.9425, 18.215033)\n]\nVISIBLE_ARCS = [\n\n]\nHIDDEN_SEGMENTS = [\n\n]\n# (orient, text, p1, p2, base) for linear; (orient, text, center, radius, angle) for diameter\nDIMENSIONS = [\n ('diameter', '%%c100', (97.5575, 162.9425), 18.215, 45),\n ('horizontal', '163.793', (129.7725, 162.9425), (189.4425, 162.9425), (159.6075, 173.9425))\n]\n\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\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\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,\n angle=(0 if d[0] == \"horizontal\" else 90),\n 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,\n text=text, dimstyle=\"EZDXF\").render()\n\n doc.saveas(out_path)\n\n\nif __name__ == \"__main__\":\n out = sys.argv[1] if len(sys.argv) > 1 else \"0021_00217337_gt.dxf\"\n draw(out)\n print(\"wrote\", out)\n```"}], "images": ["images/0021_00217337.png"], "id": "0021_00217337"} {"messages": [{"role": "user", "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": "assistant", "content": "```python\n#!/usr/bin/env python3\n# -*- coding: utf-8 -*-\n# Ground-truth 2D engineering drawing for part: 0021_00217577\n# Self-contained: reproduces the three-view DXF via ezdxf, NO FreeCAD needed.\n# Coordinates are A4 page millimetres (scale=0.3135177304964895, page=[297.0, 210.0]).\n# visible edges -> solid (layer OUTLINE); hidden edges -> dashed (layer HIDDEN)\n# dimensions -> real movable DIMENSION entities (text = true mm value)\n# Run: python 0021_00217577_gt.py [out.dxf]\nimport sys\nimport ezdxf\n\nSCALE = 0.3135177304964895\nPAGE = [297.0, 210.0]\n\nVISIBLE_SEGMENTS = [\n (80.612013, 134.536213, 81.591756, 134.536213),\n (81.591756, 134.536213, 82.571499, 134.536213),\n (82.571499, 134.536213, 83.551242, 134.536213),\n (83.551242, 134.536213, 84.530985, 134.536213),\n (84.530985, 134.536213, 85.510728, 134.536213),\n (85.510728, 134.536213, 86.490471, 134.536213),\n (86.490471, 134.536213, 87.470214, 134.536213),\n (87.470214, 134.536213, 88.449957, 134.536213),\n (88.449957, 134.536213, 89.4297, 134.536213),\n (89.4297, 134.536213, 90.409443, 134.536213),\n (90.409443, 134.536213, 91.389185, 134.536213),\n (91.389185, 134.536213, 92.368928, 134.536213),\n (92.368928, 134.536213, 93.348671, 134.536213),\n (93.348671, 134.536213, 94.328414, 134.536213),\n (94.328414, 134.536213, 95.308157, 134.536213),\n (95.308157, 134.536213, 96.2879, 134.536213),\n (96.2879, 134.536213, 97.267643, 134.536213),\n (97.267643, 134.536213, 98.247386, 134.536213),\n (98.247386, 134.536213, 99.227129, 134.536213),\n (99.227129, 134.536213, 100.206872, 134.536213),\n (100.206872, 134.536213, 101.186615, 134.536213),\n (101.186615, 134.536213, 102.166357, 134.536213),\n (102.166357, 134.536213, 103.1461, 134.536213),\n (103.1461, 134.536213, 104.125843, 134.536213),\n (104.125843, 134.536213, 105.105586, 134.536213),\n (105.105586, 134.536213, 106.085329, 134.536213),\n (106.085329, 134.536213, 107.065072, 134.536213),\n (107.065072, 134.536213, 108.044815, 134.536213),\n (108.044815, 134.536213, 109.024558, 134.536213),\n (109.024558, 134.536213, 110.004301, 134.536213),\n (110.004301, 134.536213, 110.984044, 134.536213),\n (110.984044, 134.536213, 111.963787, 134.536213),\n (111.963787, 134.536213, 111.963787, 69.787986),\n (80.612013, 69.787986, 81.591756, 69.787986),\n (81.591756, 69.787986, 82.571499, 69.787986),\n (82.571499, 69.787986, 83.551242, 69.787986),\n (83.551242, 69.787986, 84.530985, 69.787986),\n (84.530985, 69.787986, 85.510728, 69.787986),\n (85.510728, 69.787986, 86.490471, 69.787986),\n (86.490471, 69.787986, 87.470214, 69.787986),\n (87.470214, 69.787986, 88.449957, 69.787986),\n (88.449957, 69.787986, 89.4297, 69.787986),\n (89.4297, 69.787986, 90.409443, 69.787986),\n (90.409443, 69.787986, 91.389185, 69.787986),\n (91.389185, 69.787986, 92.368928, 69.787986),\n (92.368928, 69.787986, 93.348671, 69.787986),\n (93.348671, 69.787986, 94.328414, 69.787986),\n (94.328414, 69.787986, 95.308157, 69.787986),\n (95.308157, 69.787986, 96.2879, 69.787986),\n (96.2879, 69.787986, 97.267643, 69.787986),\n (97.267643, 69.787986, 98.247386, 69.787986),\n (98.247386, 69.787986, 99.227129, 69.787986),\n (99.227129, 69.787986, 100.206872, 69.787986),\n (100.206872, 69.787986, 101.186615, 69.787986),\n (101.186615, 69.787986, 102.166357, 69.787986),\n (102.166357, 69.787986, 103.1461, 69.787986),\n (103.1461, 69.787986, 104.125843, 69.787986),\n (104.125843, 69.787986, 105.105586, 69.787986),\n (105.105586, 69.787986, 106.085329, 69.787986),\n (106.085329, 69.787986, 107.065072, 69.787986),\n (107.065072, 69.787986, 108.044815, 69.787986),\n (108.044815, 69.787986, 109.024558, 69.787986),\n (109.024558, 69.787986, 110.004301, 69.787986),\n (110.004301, 69.787986, 110.984044, 69.787986),\n (110.984044, 69.787986, 111.963787, 69.787986),\n (80.612013, 69.787986, 80.612013, 134.536213),\n (190.712014, 179.887987, 190.712014, 178.908244),\n (190.712014, 178.908244, 190.712014, 177.928501),\n (190.712014, 177.928501, 190.712014, 176.948758),\n (190.712014, 176.948758, 190.712014, 175.969015),\n (190.712014, 175.969015, 190.712014, 174.989272),\n (190.712014, 174.989272, 190.712014, 174.009529),\n (190.712014, 174.009529, 190.712014, 173.029786),\n (190.712014, 173.029786, 190.712014, 172.050043),\n (190.712014, 172.050043, 190.712014, 171.0703),\n (190.712014, 171.0703, 190.712014, 170.090557),\n (190.712014, 170.090557, 190.712014, 169.110815),\n (190.712014, 169.110815, 190.712014, 168.131072),\n (190.712014, 168.131072, 190.712014, 167.151329),\n (190.712014, 167.151329, 190.712014, 166.171586),\n (190.712014, 166.171586, 190.712014, 165.191843),\n (190.712014, 165.191843, 190.712014, 164.2121),\n (190.712014, 164.2121, 190.712014, 163.232357),\n (190.712014, 163.232357, 190.712014, 162.252614),\n (190.712014, 162.252614, 190.712014, 161.272871),\n (190.712014, 161.272871, 190.712014, 160.293128),\n (190.712014, 160.293128, 190.712014, 159.313385),\n (190.712014, 159.313385, 190.712014, 158.333643),\n (190.712014, 158.333643, 190.712014, 157.3539),\n (190.712014, 157.3539, 190.712014, 156.374157),\n (190.712014, 156.374157, 190.712014, 155.394414),\n (190.712014, 155.394414, 190.712014, 154.414671),\n (190.712014, 154.414671, 190.712014, 153.434928),\n (190.712014, 153.434928, 190.712014, 152.455185),\n (190.712014, 152.455185, 190.712014, 151.475442),\n (190.712014, 151.475442, 190.712014, 150.495699),\n (190.712014, 150.495699, 190.712014, 149.515956),\n (190.712014, 149.515956, 190.712014, 148.536213),\n (125.963787, 179.887987, 125.963787, 178.908244),\n (125.963787, 178.908244, 125.963787, 177.928501),\n (125.963787, 177.928501, 125.963787, 176.948758),\n (125.963787, 176.948758, 125.963787, 175.969015),\n (125.963787, 175.969015, 125.963787, 174.989272),\n (125.963787, 174.989272, 125.963787, 174.009529),\n (125.963787, 174.009529, 125.963787, 173.029786),\n (125.963787, 173.029786, 125.963787, 172.050043),\n (125.963787, 172.050043, 125.963787, 171.0703),\n (125.963787, 171.0703, 125.963787, 170.090557),\n (125.963787, 170.090557, 125.963787, 169.110815),\n (125.963787, 169.110815, 125.963787, 168.131072),\n (125.963787, 168.131072, 125.963787, 167.151329),\n (125.963787, 167.151329, 125.963787, 166.171586),\n (125.963787, 166.171586, 125.963787, 165.191843),\n (125.963787, 165.191843, 125.963787, 164.2121),\n (125.963787, 164.2121, 125.963787, 163.232357),\n (125.963787, 163.232357, 125.963787, 162.252614),\n (125.963787, 162.252614, 125.963787, 161.272871),\n (125.963787, 161.272871, 125.963787, 160.293128),\n (125.963787, 160.293128, 125.963787, 159.313385),\n (125.963787, 159.313385, 125.963787, 158.333643),\n (125.963787, 158.333643, 125.963787, 157.3539),\n (125.963787, 157.3539, 125.963787, 156.374157),\n (125.963787, 156.374157, 125.963787, 155.394414),\n (125.963787, 155.394414, 125.963787, 154.414671),\n (125.963787, 154.414671, 125.963787, 153.434928),\n (125.963787, 153.434928, 125.963787, 152.455185),\n (125.963787, 152.455185, 125.963787, 151.475442),\n (125.963787, 151.475442, 125.963787, 150.495699),\n (125.963787, 150.495699, 125.963787, 149.515956),\n (125.963787, 149.515956, 125.963787, 148.536213),\n (125.963787, 179.887987, 190.712014, 179.887987),\n (125.963787, 148.536213, 190.712014, 148.536213)\n]\nVISIBLE_CIRCLES = [\n (96.2879, 164.2121, 15.675887)\n]\nVISIBLE_ARCS = [\n\n]\nHIDDEN_SEGMENTS = [\n\n]\n# (orient, text, p1, p2, base) for linear; (orient, text, center, radius, angle) for diameter\nDIMENSIONS = [\n ('diameter', '%%c100', (96.2879, 164.2121), 15.6759, 45),\n ('horizontal', '206.522', (190.7121, 164.2121), (125.9638, 164.2121), (158.3379, 153.2121))\n]\n\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\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\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,\n angle=(0 if d[0] == \"horizontal\" else 90),\n 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,\n text=text, dimstyle=\"EZDXF\").render()\n\n doc.saveas(out_path)\n\n\nif __name__ == \"__main__\":\n out = sys.argv[1] if len(sys.argv) > 1 else \"0021_00217577_gt.dxf\"\n draw(out)\n print(\"wrote\", out)\n```"}], "images": ["images/0021_00217577.png"], "id": "0021_00217577"} {"messages": [{"role": "user", "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.21 mm."}, {"role": "assistant", "content": "```python\n#!/usr/bin/env python3\n# -*- coding: utf-8 -*-\n# Ground-truth 2D engineering drawing for part: 0023_00238331\n# Self-contained: reproduces the three-view DXF via ezdxf, NO FreeCAD needed.\n# Coordinates are A4 page millimetres (scale=0.9221675882603185, page=[297.0, 210.0]).\n# visible edges -> solid (layer OUTLINE); hidden edges -> dashed (layer HIDDEN)\n# dimensions -> real movable DIMENSION entities (text = true mm value)\n# Run: python 0023_00238331_gt.py [out.dxf]\nimport sys\nimport ezdxf\n\nSCALE = 0.9221675882603185\nPAGE = [297.0, 210.0]\n\nVISIBLE_SEGMENTS = [\n (157.612579, 85.004179, 154.730806, 85.004179),\n (154.730806, 85.004179, 151.849032, 85.004179),\n (151.849032, 85.004179, 148.967258, 85.004179),\n (148.967258, 85.004179, 146.085485, 85.004179),\n (146.085485, 85.004179, 143.203711, 85.004179),\n (143.203711, 85.004179, 140.321937, 85.004179),\n (140.321937, 85.004179, 137.440163, 85.004179),\n (137.440163, 85.004179, 134.55839, 85.004179),\n (134.55839, 85.004179, 131.676616, 85.004179),\n (131.676616, 85.004179, 128.794842, 85.004179),\n (128.794842, 85.004179, 125.913069, 85.004179),\n (125.913069, 85.004179, 123.031295, 85.004179),\n (123.031295, 85.004179, 120.149521, 85.004179),\n (120.149521, 85.004179, 117.267747, 85.004179),\n (117.267747, 85.004179, 114.385974, 85.004179),\n (114.385974, 85.004179, 111.5042, 85.004179),\n (111.5042, 85.004179, 108.622426, 85.004179),\n (108.622426, 85.004179, 105.740653, 85.004179),\n (105.740653, 85.004179, 102.858879, 85.004179),\n (102.858879, 85.004179, 99.977105, 85.004179),\n (99.977105, 85.004179, 97.095331, 85.004179),\n (97.095331, 85.004179, 94.213558, 85.004179),\n (94.213558, 85.004179, 91.331784, 85.004179),\n (91.331784, 85.004179, 88.45001, 85.004179),\n (88.45001, 85.004179, 85.568237, 85.004179),\n (85.568237, 85.004179, 82.686463, 85.004179),\n (82.686463, 85.004179, 79.804689, 85.004179),\n (79.804689, 85.004179, 76.922915, 85.004179),\n (76.922915, 85.004179, 74.041142, 85.004179),\n (74.041142, 85.004179, 71.159368, 85.004179),\n (71.159368, 85.004179, 68.277594, 85.004179),\n (68.277594, 85.004179, 65.395821, 85.004179),\n (157.612579, 85.004179, 157.612579, 88.88742),\n (157.612579, 88.88742, 154.730806, 88.88742),\n (154.730806, 88.88742, 151.849032, 88.88742),\n (151.849032, 88.88742, 148.967258, 88.88742),\n (148.967258, 88.88742, 146.085485, 88.88742),\n (146.085485, 88.88742, 143.203711, 88.88742),\n (143.203711, 88.88742, 140.321937, 88.88742),\n (140.321937, 88.88742, 137.440163, 88.88742),\n (137.440163, 88.88742, 134.55839, 88.88742),\n (134.55839, 88.88742, 131.676616, 88.88742),\n (131.676616, 88.88742, 128.794842, 88.88742),\n (128.794842, 88.88742, 125.913069, 88.88742),\n (125.913069, 88.88742, 123.031295, 88.88742),\n (123.031295, 88.88742, 120.149521, 88.88742),\n (120.149521, 88.88742, 117.267747, 88.88742),\n (117.267747, 88.88742, 114.385974, 88.88742),\n (114.385974, 88.88742, 111.5042, 88.88742),\n (111.5042, 88.88742, 108.622426, 88.88742),\n (108.622426, 88.88742, 105.740653, 88.88742),\n (105.740653, 88.88742, 102.858879, 88.88742),\n (102.858879, 88.88742, 99.977105, 88.88742),\n (99.977105, 88.88742, 97.095331, 88.88742),\n (97.095331, 88.88742, 94.213558, 88.88742),\n (94.213558, 88.88742, 91.331784, 88.88742),\n (91.331784, 88.88742, 88.45001, 88.88742),\n (88.45001, 88.88742, 85.568237, 88.88742),\n (85.568237, 88.88742, 82.686463, 88.88742),\n (82.686463, 88.88742, 79.804689, 88.88742),\n (79.804689, 88.88742, 76.922915, 88.88742),\n (76.922915, 88.88742, 74.041142, 88.88742),\n (74.041142, 88.88742, 71.159368, 88.88742),\n (71.159368, 88.88742, 68.277594, 88.88742),\n (68.277594, 88.88742, 65.395821, 88.88742),\n (65.395821, 88.88742, 65.395821, 85.004179),\n (171.61258, 102.887421, 171.61258, 105.769194),\n (171.61258, 105.769194, 171.61258, 108.650968),\n (171.61258, 108.650968, 171.61258, 111.532742),\n (171.61258, 111.532742, 171.61258, 114.414515),\n (171.61258, 114.414515, 171.61258, 117.296289),\n (171.61258, 117.296289, 171.61258, 120.178063),\n (171.61258, 120.178063, 171.61258, 123.059837),\n (171.61258, 123.059837, 171.61258, 125.94161),\n (171.61258, 125.94161, 171.61258, 128.823384),\n (171.61258, 128.823384, 171.61258, 131.705158),\n (171.61258, 131.705158, 171.61258, 134.586931),\n (171.61258, 134.586931, 171.61258, 137.468705),\n (171.61258, 137.468705, 171.61258, 140.350479),\n (171.61258, 140.350479, 171.61258, 143.232253),\n (171.61258, 143.232253, 171.61258, 146.114026),\n (171.61258, 146.114026, 171.61258, 148.9958),\n (171.61258, 148.9958, 171.61258, 151.877574),\n (171.61258, 151.877574, 171.61258, 154.759347),\n (171.61258, 154.759347, 171.61258, 157.641121),\n (171.61258, 157.641121, 171.61258, 160.522895),\n (171.61258, 160.522895, 171.61258, 163.404669),\n (171.61258, 163.404669, 171.61258, 166.286442),\n (171.61258, 166.286442, 171.61258, 169.168216),\n (171.61258, 169.168216, 171.61258, 172.04999),\n (171.61258, 172.04999, 171.61258, 174.931763),\n (171.61258, 174.931763, 171.61258, 177.813537),\n (171.61258, 177.813537, 171.61258, 180.695311),\n (171.61258, 180.695311, 171.61258, 183.577085),\n (171.61258, 183.577085, 171.61258, 186.458858),\n (171.61258, 186.458858, 171.61258, 189.340632),\n (171.61258, 189.340632, 171.61258, 192.222406),\n (171.61258, 192.222406, 171.61258, 195.104179),\n (175.495821, 102.887421, 175.495821, 105.769194),\n (175.495821, 105.769194, 175.495821, 108.650968),\n (175.495821, 108.650968, 175.495821, 111.532742),\n (175.495821, 111.532742, 175.495821, 114.414515),\n (175.495821, 114.414515, 175.495821, 117.296289),\n (175.495821, 117.296289, 175.495821, 120.178063),\n (175.495821, 120.178063, 175.495821, 123.059837),\n (175.495821, 123.059837, 175.495821, 125.94161),\n (175.495821, 125.94161, 175.495821, 128.823384),\n (175.495821, 128.823384, 175.495821, 131.705158),\n (175.495821, 131.705158, 175.495821, 134.586931),\n (175.495821, 134.586931, 175.495821, 137.468705),\n (175.495821, 137.468705, 175.495821, 140.350479),\n (175.495821, 140.350479, 175.495821, 143.232253),\n (175.495821, 143.232253, 175.495821, 146.114026),\n (175.495821, 146.114026, 175.495821, 148.9958),\n (175.495821, 148.9958, 175.495821, 151.877574),\n (175.495821, 151.877574, 175.495821, 154.759347),\n (175.495821, 154.759347, 175.495821, 157.641121),\n (175.495821, 157.641121, 175.495821, 160.522895),\n (175.495821, 160.522895, 175.495821, 163.404669),\n (175.495821, 163.404669, 175.495821, 166.286442),\n (175.495821, 166.286442, 175.495821, 169.168216),\n (175.495821, 169.168216, 175.495821, 172.04999),\n (175.495821, 172.04999, 175.495821, 174.931763),\n (175.495821, 174.931763, 175.495821, 177.813537),\n (175.495821, 177.813537, 175.495821, 180.695311),\n (175.495821, 180.695311, 175.495821, 183.577085),\n (175.495821, 183.577085, 175.495821, 186.458858),\n (175.495821, 186.458858, 175.495821, 189.340632),\n (175.495821, 189.340632, 175.495821, 192.222406),\n (175.495821, 192.222406, 175.495821, 195.104179),\n (175.495821, 102.887421, 171.61258, 102.887421),\n (175.495821, 195.104179, 171.61258, 195.104179)\n]\nVISIBLE_CIRCLES = [\n (111.5042, 148.9958, 46.108379)\n]\nVISIBLE_ARCS = [\n\n]\nHIDDEN_SEGMENTS = [\n\n]\n# (orient, text, p1, p2, base) for linear; (orient, text, center, radius, angle) for diameter\nDIMENSIONS = [\n ('diameter', '%%c100', (111.5042, 148.9958), 46.1084, 45),\n ('horizontal', '4.211', (171.6126, 148.9958), (175.4958, 148.9958), (173.5542, 159.9958))\n]\n\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\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\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,\n angle=(0 if d[0] == \"horizontal\" else 90),\n 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,\n text=text, dimstyle=\"EZDXF\").render()\n\n doc.saveas(out_path)\n\n\nif __name__ == \"__main__\":\n out = sys.argv[1] if len(sys.argv) > 1 else \"0023_00238331_gt.dxf\"\n draw(out)\n print(\"wrote\", out)\n```"}], "images": ["images/0023_00238331.png"], "id": "0023_00238331"} {"messages": [{"role": "user", "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.21 mm."}, {"role": "assistant", "content": "```python\n#!/usr/bin/env python3\n# -*- coding: utf-8 -*-\n# Ground-truth 2D engineering drawing for part: 0023_00238539\n# Self-contained: reproduces the three-view DXF via ezdxf, NO FreeCAD needed.\n# Coordinates are A4 page millimetres (scale=0.9221675882603185, page=[297.0, 210.0]).\n# visible edges -> solid (layer OUTLINE); hidden edges -> dashed (layer HIDDEN)\n# dimensions -> real movable DIMENSION entities (text = true mm value)\n# Run: python 0023_00238539_gt.py [out.dxf]\nimport sys\nimport ezdxf\n\nSCALE = 0.9221675882603185\nPAGE = [297.0, 210.0]\n\nVISIBLE_SEGMENTS = [\n (157.612579, 88.88742, 157.612579, 85.004179),\n (157.612579, 85.004179, 154.730806, 85.004179),\n (154.730806, 85.004179, 151.849032, 85.004179),\n (151.849032, 85.004179, 148.967258, 85.004179),\n (148.967258, 85.004179, 146.085485, 85.004179),\n (146.085485, 85.004179, 143.203711, 85.004179),\n (143.203711, 85.004179, 140.321937, 85.004179),\n (140.321937, 85.004179, 137.440163, 85.004179),\n (137.440163, 85.004179, 134.55839, 85.004179),\n (134.55839, 85.004179, 131.676616, 85.004179),\n (131.676616, 85.004179, 128.794842, 85.004179),\n (128.794842, 85.004179, 125.913069, 85.004179),\n (125.913069, 85.004179, 123.031295, 85.004179),\n (123.031295, 85.004179, 120.149521, 85.004179),\n (120.149521, 85.004179, 117.267747, 85.004179),\n (117.267747, 85.004179, 114.385974, 85.004179),\n (114.385974, 85.004179, 111.5042, 85.004179),\n (111.5042, 85.004179, 108.622426, 85.004179),\n (108.622426, 85.004179, 105.740653, 85.004179),\n (105.740653, 85.004179, 102.858879, 85.004179),\n (102.858879, 85.004179, 99.977105, 85.004179),\n (99.977105, 85.004179, 97.095331, 85.004179),\n (97.095331, 85.004179, 94.213558, 85.004179),\n (94.213558, 85.004179, 91.331784, 85.004179),\n (91.331784, 85.004179, 88.45001, 85.004179),\n (88.45001, 85.004179, 85.568237, 85.004179),\n (85.568237, 85.004179, 82.686463, 85.004179),\n (82.686463, 85.004179, 79.804689, 85.004179),\n (79.804689, 85.004179, 76.922915, 85.004179),\n (76.922915, 85.004179, 74.041142, 85.004179),\n (74.041142, 85.004179, 71.159368, 85.004179),\n (71.159368, 85.004179, 68.277594, 85.004179),\n (68.277594, 85.004179, 65.395821, 85.004179),\n (157.612579, 88.88742, 154.730806, 88.88742),\n (154.730806, 88.88742, 151.849032, 88.88742),\n (151.849032, 88.88742, 148.967258, 88.88742),\n (148.967258, 88.88742, 146.085485, 88.88742),\n (146.085485, 88.88742, 143.203711, 88.88742),\n (143.203711, 88.88742, 140.321937, 88.88742),\n (140.321937, 88.88742, 137.440163, 88.88742),\n (137.440163, 88.88742, 134.55839, 88.88742),\n (134.55839, 88.88742, 131.676616, 88.88742),\n (131.676616, 88.88742, 128.794842, 88.88742),\n (128.794842, 88.88742, 125.913069, 88.88742),\n (125.913069, 88.88742, 123.031295, 88.88742),\n (123.031295, 88.88742, 120.149521, 88.88742),\n (120.149521, 88.88742, 117.267747, 88.88742),\n (117.267747, 88.88742, 114.385974, 88.88742),\n (114.385974, 88.88742, 111.5042, 88.88742),\n (111.5042, 88.88742, 108.622426, 88.88742),\n (108.622426, 88.88742, 105.740653, 88.88742),\n (105.740653, 88.88742, 102.858879, 88.88742),\n (102.858879, 88.88742, 99.977105, 88.88742),\n (99.977105, 88.88742, 97.095331, 88.88742),\n (97.095331, 88.88742, 94.213558, 88.88742),\n (94.213558, 88.88742, 91.331784, 88.88742),\n (91.331784, 88.88742, 88.45001, 88.88742),\n (88.45001, 88.88742, 85.568237, 88.88742),\n (85.568237, 88.88742, 82.686463, 88.88742),\n (82.686463, 88.88742, 79.804689, 88.88742),\n (79.804689, 88.88742, 76.922915, 88.88742),\n (76.922915, 88.88742, 74.041142, 88.88742),\n (74.041142, 88.88742, 71.159368, 88.88742),\n (71.159368, 88.88742, 68.277594, 88.88742),\n (68.277594, 88.88742, 65.395821, 88.88742),\n (65.395821, 85.004179, 65.395821, 88.88742),\n (171.61258, 102.887421, 171.61258, 105.769194),\n (171.61258, 105.769194, 171.61258, 108.650968),\n (171.61258, 108.650968, 171.61258, 111.532742),\n (171.61258, 111.532742, 171.61258, 114.414515),\n (171.61258, 114.414515, 171.61258, 117.296289),\n (171.61258, 117.296289, 171.61258, 120.178063),\n (171.61258, 120.178063, 171.61258, 123.059837),\n (171.61258, 123.059837, 171.61258, 125.94161),\n (171.61258, 125.94161, 171.61258, 128.823384),\n (171.61258, 128.823384, 171.61258, 131.705158),\n (171.61258, 131.705158, 171.61258, 134.586931),\n (171.61258, 134.586931, 171.61258, 137.468705),\n (171.61258, 137.468705, 171.61258, 140.350479),\n (171.61258, 140.350479, 171.61258, 143.232253),\n (171.61258, 143.232253, 171.61258, 146.114026),\n (171.61258, 146.114026, 171.61258, 148.9958),\n (171.61258, 148.9958, 171.61258, 151.877574),\n (171.61258, 151.877574, 171.61258, 154.759347),\n (171.61258, 154.759347, 171.61258, 157.641121),\n (171.61258, 157.641121, 171.61258, 160.522895),\n (171.61258, 160.522895, 171.61258, 163.404669),\n (171.61258, 163.404669, 171.61258, 166.286442),\n (171.61258, 166.286442, 171.61258, 169.168216),\n (171.61258, 169.168216, 171.61258, 172.04999),\n (171.61258, 172.04999, 171.61258, 174.931763),\n (171.61258, 174.931763, 171.61258, 177.813537),\n (171.61258, 177.813537, 171.61258, 180.695311),\n (171.61258, 180.695311, 171.61258, 183.577085),\n (171.61258, 183.577085, 171.61258, 186.458858),\n (171.61258, 186.458858, 171.61258, 189.340632),\n (171.61258, 189.340632, 171.61258, 192.222406),\n (171.61258, 192.222406, 171.61258, 195.104179),\n (175.495821, 102.887421, 175.495821, 105.769194),\n (175.495821, 105.769194, 175.495821, 108.650968),\n (175.495821, 108.650968, 175.495821, 111.532742),\n (175.495821, 111.532742, 175.495821, 114.414515),\n (175.495821, 114.414515, 175.495821, 117.296289),\n (175.495821, 117.296289, 175.495821, 120.178063),\n (175.495821, 120.178063, 175.495821, 123.059837),\n (175.495821, 123.059837, 175.495821, 125.94161),\n (175.495821, 125.94161, 175.495821, 128.823384),\n (175.495821, 128.823384, 175.495821, 131.705158),\n (175.495821, 131.705158, 175.495821, 134.586931),\n (175.495821, 134.586931, 175.495821, 137.468705),\n (175.495821, 137.468705, 175.495821, 140.350479),\n (175.495821, 140.350479, 175.495821, 143.232253),\n (175.495821, 143.232253, 175.495821, 146.114026),\n (175.495821, 146.114026, 175.495821, 148.9958),\n (175.495821, 148.9958, 175.495821, 151.877574),\n (175.495821, 151.877574, 175.495821, 154.759347),\n (175.495821, 154.759347, 175.495821, 157.641121),\n (175.495821, 157.641121, 175.495821, 160.522895),\n (175.495821, 160.522895, 175.495821, 163.404669),\n (175.495821, 163.404669, 175.495821, 166.286442),\n (175.495821, 166.286442, 175.495821, 169.168216),\n (175.495821, 169.168216, 175.495821, 172.04999),\n (175.495821, 172.04999, 175.495821, 174.931763),\n (175.495821, 174.931763, 175.495821, 177.813537),\n (175.495821, 177.813537, 175.495821, 180.695311),\n (175.495821, 180.695311, 175.495821, 183.577085),\n (175.495821, 183.577085, 175.495821, 186.458858),\n (175.495821, 186.458858, 175.495821, 189.340632),\n (175.495821, 189.340632, 175.495821, 192.222406),\n (175.495821, 192.222406, 175.495821, 195.104179),\n (171.61258, 195.104179, 175.495821, 195.104179),\n (171.61258, 102.887421, 175.495821, 102.887421)\n]\nVISIBLE_CIRCLES = [\n (111.5042, 148.9958, 46.108379)\n]\nVISIBLE_ARCS = [\n\n]\nHIDDEN_SEGMENTS = [\n\n]\n# (orient, text, p1, p2, base) for linear; (orient, text, center, radius, angle) for diameter\nDIMENSIONS = [\n ('diameter', '%%c100', (111.5042, 148.9958), 46.1084, 45),\n ('horizontal', '4.211', (175.4958, 148.9958), (171.6126, 148.9958), (173.5542, 137.9958))\n]\n\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\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\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,\n angle=(0 if d[0] == \"horizontal\" else 90),\n 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,\n text=text, dimstyle=\"EZDXF\").render()\n\n doc.saveas(out_path)\n\n\nif __name__ == \"__main__\":\n out = sys.argv[1] if len(sys.argv) > 1 else \"0023_00238539_gt.dxf\"\n draw(out)\n print(\"wrote\", out)\n```"}], "images": ["images/0023_00238539.png"], "id": "0023_00238539"} {"messages": [{"role": "user", "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 145.14 mm."}, {"role": "assistant", "content": "```python\n#!/usr/bin/env python3\n# -*- coding: utf-8 -*-\n# Ground-truth 2D engineering drawing for part: 0026_00260035\n# Self-contained: reproduces the three-view DXF via ezdxf, NO FreeCAD needed.\n# Coordinates are A4 page millimetres (scale=0.2462348754449015, page=[297.0, 210.0]).\n# visible edges -> solid (layer OUTLINE); hidden edges -> dashed (layer HIDDEN)\n# dimensions -> real movable DIMENSION entities (text = true mm value)\n# Run: python 0026_00260035_gt.py [out.dxf]\nimport sys\nimport ezdxf\n\nSCALE = 0.2462348754449015\nPAGE = [297.0, 210.0]\n\nVISIBLE_SEGMENTS = [\n (106.917644, 103.8441, 106.917644, 68.105844),\n (82.294156, 68.105844, 83.06364, 68.105844),\n (83.06364, 68.105844, 83.833124, 68.105844),\n (83.833124, 68.105844, 84.602608, 68.105844),\n (84.602608, 68.105844, 85.372092, 68.105844),\n (85.372092, 68.105844, 86.141576, 68.105844),\n (86.141576, 68.105844, 86.91106, 68.105844),\n (86.91106, 68.105844, 87.680544, 68.105844),\n (87.680544, 68.105844, 88.450028, 68.105844),\n (88.450028, 68.105844, 89.219512, 68.105844),\n (89.219512, 68.105844, 89.988996, 68.105844),\n (89.988996, 68.105844, 90.75848, 68.105844),\n (90.75848, 68.105844, 91.527964, 68.105844),\n (91.527964, 68.105844, 92.297448, 68.105844),\n (92.297448, 68.105844, 93.066932, 68.105844),\n (93.066932, 68.105844, 93.836416, 68.105844),\n (93.836416, 68.105844, 94.6059, 68.105844),\n (94.6059, 68.105844, 95.375384, 68.105844),\n (95.375384, 68.105844, 96.144868, 68.105844),\n (96.144868, 68.105844, 96.914352, 68.105844),\n (96.914352, 68.105844, 97.683836, 68.105844),\n (97.683836, 68.105844, 98.45332, 68.105844),\n (98.45332, 68.105844, 99.222804, 68.105844),\n (99.222804, 68.105844, 99.992288, 68.105844),\n (99.992288, 68.105844, 100.761772, 68.105844),\n (100.761772, 68.105844, 101.531256, 68.105844),\n (101.531256, 68.105844, 102.30074, 68.105844),\n (102.30074, 68.105844, 103.070224, 68.105844),\n (103.070224, 68.105844, 103.839708, 68.105844),\n (103.839708, 68.105844, 104.609192, 68.105844),\n (104.609192, 68.105844, 105.378676, 68.105844),\n (105.378676, 68.105844, 106.14816, 68.105844),\n (106.14816, 68.105844, 106.917644, 68.105844),\n (106.917644, 103.8441, 106.917644, 139.582356),\n (82.294156, 139.582356, 83.06364, 139.582356),\n (83.06364, 139.582356, 83.833124, 139.582356),\n (83.833124, 139.582356, 84.602608, 139.582356),\n (84.602608, 139.582356, 85.372092, 139.582356),\n (85.372092, 139.582356, 86.141576, 139.582356),\n (86.141576, 139.582356, 86.91106, 139.582356),\n (86.91106, 139.582356, 87.680544, 139.582356),\n (87.680544, 139.582356, 88.450028, 139.582356),\n (88.450028, 139.582356, 89.219512, 139.582356),\n (89.219512, 139.582356, 89.988996, 139.582356),\n (89.988996, 139.582356, 90.75848, 139.582356),\n (90.75848, 139.582356, 91.527964, 139.582356),\n (91.527964, 139.582356, 92.297448, 139.582356),\n (92.297448, 139.582356, 93.066932, 139.582356),\n (93.066932, 139.582356, 93.836416, 139.582356),\n (93.836416, 139.582356, 94.6059, 139.582356),\n (94.6059, 139.582356, 95.375384, 139.582356),\n (95.375384, 139.582356, 96.144868, 139.582356),\n (96.144868, 139.582356, 96.914352, 139.582356),\n (96.914352, 139.582356, 97.683836, 139.582356),\n (97.683836, 139.582356, 98.45332, 139.582356),\n (98.45332, 139.582356, 99.222804, 139.582356),\n (99.222804, 139.582356, 99.992288, 139.582356),\n (99.992288, 139.582356, 100.761772, 139.582356),\n (100.761772, 139.582356, 101.531256, 139.582356),\n (101.531256, 139.582356, 102.30074, 139.582356),\n (102.30074, 139.582356, 103.070224, 139.582356),\n (103.070224, 139.582356, 103.839708, 139.582356),\n (103.839708, 139.582356, 104.609192, 139.582356),\n (104.609192, 139.582356, 105.378676, 139.582356),\n (105.378676, 139.582356, 106.14816, 139.582356),\n (106.14816, 139.582356, 106.917644, 139.582356),\n (82.294156, 68.105844, 82.294156, 103.8441),\n (82.294156, 139.582356, 82.294156, 103.8441),\n (120.917644, 178.205844, 120.917644, 177.43636),\n (120.917644, 177.43636, 120.917644, 176.666876),\n (120.917644, 176.666876, 120.917644, 175.897392),\n (120.917644, 175.897392, 120.917644, 175.127908),\n (120.917644, 175.127908, 120.917644, 174.358424),\n (120.917644, 174.358424, 120.917644, 173.58894),\n (120.917644, 173.58894, 120.917644, 172.819456),\n (120.917644, 172.819456, 120.917644, 172.049972),\n (120.917644, 172.049972, 120.917644, 171.280488),\n (120.917644, 171.280488, 120.917644, 170.511004),\n (120.917644, 170.511004, 120.917644, 169.74152),\n (120.917644, 169.74152, 120.917644, 168.972036),\n (120.917644, 168.972036, 120.917644, 168.202552),\n (120.917644, 168.202552, 120.917644, 167.433068),\n (120.917644, 167.433068, 120.917644, 166.663584),\n (120.917644, 166.663584, 120.917644, 165.8941),\n (120.917644, 165.8941, 120.917644, 165.124616),\n (120.917644, 165.124616, 120.917644, 164.355132),\n (120.917644, 164.355132, 120.917644, 163.585648),\n (120.917644, 163.585648, 120.917644, 162.816164),\n (120.917644, 162.816164, 120.917644, 162.04668),\n (120.917644, 162.04668, 120.917644, 161.277196),\n (120.917644, 161.277196, 120.917644, 160.507712),\n (120.917644, 160.507712, 120.917644, 159.738228),\n (120.917644, 159.738228, 120.917644, 158.968744),\n (120.917644, 158.968744, 120.917644, 158.19926),\n (120.917644, 158.19926, 120.917644, 157.429776),\n (120.917644, 157.429776, 120.917644, 156.660292),\n (120.917644, 156.660292, 120.917644, 155.890808),\n (120.917644, 155.890808, 120.917644, 155.121324),\n (120.917644, 155.121324, 120.917644, 154.35184),\n (120.917644, 154.35184, 120.917644, 153.582356),\n (192.394156, 178.205844, 192.394156, 177.43636),\n (192.394156, 177.43636, 192.394156, 176.666876),\n (192.394156, 176.666876, 192.394156, 175.897392),\n (192.394156, 175.897392, 192.394156, 175.127908),\n (192.394156, 175.127908, 192.394156, 174.358424),\n (192.394156, 174.358424, 192.394156, 173.58894),\n (192.394156, 173.58894, 192.394156, 172.819456),\n (192.394156, 172.819456, 192.394156, 172.049972),\n (192.394156, 172.049972, 192.394156, 171.280488),\n (192.394156, 171.280488, 192.394156, 170.511004),\n (192.394156, 170.511004, 192.394156, 169.74152),\n (192.394156, 169.74152, 192.394156, 168.972036),\n (192.394156, 168.972036, 192.394156, 168.202552),\n (192.394156, 168.202552, 192.394156, 167.433068),\n (192.394156, 167.433068, 192.394156, 166.663584),\n (192.394156, 166.663584, 192.394156, 165.8941),\n (192.394156, 165.8941, 192.394156, 165.124616),\n (192.394156, 165.124616, 192.394156, 164.355132),\n (192.394156, 164.355132, 192.394156, 163.585648),\n (192.394156, 163.585648, 192.394156, 162.816164),\n (192.394156, 162.816164, 192.394156, 162.04668),\n (192.394156, 162.04668, 192.394156, 161.277196),\n (192.394156, 161.277196, 192.394156, 160.507712),\n (192.394156, 160.507712, 192.394156, 159.738228),\n (192.394156, 159.738228, 192.394156, 158.968744),\n (192.394156, 158.968744, 192.394156, 158.19926),\n (192.394156, 158.19926, 192.394156, 157.429776),\n (192.394156, 157.429776, 192.394156, 156.660292),\n (192.394156, 156.660292, 192.394156, 155.890808),\n (192.394156, 155.890808, 192.394156, 155.121324),\n (192.394156, 155.121324, 192.394156, 154.35184),\n (192.394156, 154.35184, 192.394156, 153.582356),\n (120.917644, 178.205844, 156.6559, 178.205844),\n (120.917644, 153.582356, 156.6559, 153.582356),\n (192.394156, 153.582356, 156.6559, 153.582356),\n (192.394156, 178.205844, 156.6559, 178.205844)\n]\nVISIBLE_CIRCLES = [\n (94.6059, 165.8941, 12.311744)\n]\nVISIBLE_ARCS = [\n\n]\nHIDDEN_SEGMENTS = [\n\n]\n# (orient, text, p1, p2, base) for linear; (orient, text, center, radius, angle) for diameter\nDIMENSIONS = [\n ('diameter', '%%c100', (94.6059, 165.8941), 12.3117, 45),\n ('horizontal', '290.278', (192.3941, 165.8941), (120.9176, 165.8941), (156.6559, 154.8941))\n]\n\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\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\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,\n angle=(0 if d[0] == \"horizontal\" else 90),\n 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,\n text=text, dimstyle=\"EZDXF\").render()\n\n doc.saveas(out_path)\n\n\nif __name__ == \"__main__\":\n out = sys.argv[1] if len(sys.argv) > 1 else \"0026_00260035_gt.dxf\"\n draw(out)\n print(\"wrote\", out)\n```"}], "images": ["images/0026_00260035.png"], "id": "0026_00260035"} {"messages": [{"role": "user", "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": "assistant", "content": "```python\n#!/usr/bin/env python3\n# -*- coding: utf-8 -*-\n# Ground-truth 2D engineering drawing for part: 0026_00260505\n# Self-contained: reproduces the three-view DXF via ezdxf, NO FreeCAD needed.\n# Coordinates are A4 page millimetres (scale=0.6428989547038313, page=[297.0, 210.0]).\n# visible edges -> solid (layer OUTLINE); hidden edges -> dashed (layer HIDDEN)\n# dimensions -> real movable DIMENSION entities (text = true mm value)\n# Run: python 0026_00260505_gt.py [out.dxf]\nimport sys\nimport ezdxf\n\nSCALE = 0.6428989547038313\nPAGE = [297.0, 210.0]\n\nVISIBLE_SEGMENTS = [\n (136.667448, 78.022448, 134.658389, 78.022448),\n (134.658389, 78.022448, 132.649329, 78.022448),\n (132.649329, 78.022448, 130.64027, 78.022448),\n (130.64027, 78.022448, 128.631211, 78.022448),\n (128.631211, 78.022448, 126.622152, 78.022448),\n (126.622152, 78.022448, 124.613092, 78.022448),\n (124.613092, 78.022448, 122.604033, 78.022448),\n (122.604033, 78.022448, 120.594974, 78.022448),\n (120.594974, 78.022448, 118.585915, 78.022448),\n (118.585915, 78.022448, 116.576855, 78.022448),\n (116.576855, 78.022448, 114.567796, 78.022448),\n (114.567796, 78.022448, 112.558737, 78.022448),\n (112.558737, 78.022448, 110.549678, 78.022448),\n (110.549678, 78.022448, 108.540618, 78.022448),\n (108.540618, 78.022448, 106.531559, 78.022448),\n (106.531559, 78.022448, 104.5225, 78.022448),\n (104.5225, 78.022448, 102.513441, 78.022448),\n (102.513441, 78.022448, 100.504382, 78.022448),\n (100.504382, 78.022448, 98.495322, 78.022448),\n (98.495322, 78.022448, 96.486263, 78.022448),\n (96.486263, 78.022448, 94.477204, 78.022448),\n (94.477204, 78.022448, 92.468145, 78.022448),\n (92.468145, 78.022448, 90.459085, 78.022448),\n (90.459085, 78.022448, 88.450026, 78.022448),\n (88.450026, 78.022448, 86.440967, 78.022448),\n (86.440967, 78.022448, 84.431908, 78.022448),\n (84.431908, 78.022448, 82.422848, 78.022448),\n (82.422848, 78.022448, 80.413789, 78.022448),\n (80.413789, 78.022448, 78.40473, 78.022448),\n (78.40473, 78.022448, 76.395671, 78.022448),\n (76.395671, 78.022448, 74.386611, 78.022448),\n (74.386611, 78.022448, 72.377552, 78.022448),\n (136.667448, 78.022448, 136.667448, 109.832552),\n (136.667448, 109.832552, 134.658389, 109.832552),\n (134.658389, 109.832552, 132.649329, 109.832552),\n (132.649329, 109.832552, 130.64027, 109.832552),\n (130.64027, 109.832552, 128.631211, 109.832552),\n (128.631211, 109.832552, 126.622152, 109.832552),\n (126.622152, 109.832552, 124.613092, 109.832552),\n (124.613092, 109.832552, 122.604033, 109.832552),\n (122.604033, 109.832552, 120.594974, 109.832552),\n (120.594974, 109.832552, 118.585915, 109.832552),\n (118.585915, 109.832552, 116.576855, 109.832552),\n (116.576855, 109.832552, 114.567796, 109.832552),\n (114.567796, 109.832552, 112.558737, 109.832552),\n (112.558737, 109.832552, 110.549678, 109.832552),\n (110.549678, 109.832552, 108.540618, 109.832552),\n (108.540618, 109.832552, 106.531559, 109.832552),\n (106.531559, 109.832552, 104.5225, 109.832552),\n (104.5225, 109.832552, 102.513441, 109.832552),\n (102.513441, 109.832552, 100.504382, 109.832552),\n (100.504382, 109.832552, 98.495322, 109.832552),\n (98.495322, 109.832552, 96.486263, 109.832552),\n (96.486263, 109.832552, 94.477204, 109.832552),\n (94.477204, 109.832552, 92.468145, 109.832552),\n (92.468145, 109.832552, 90.459085, 109.832552),\n (90.459085, 109.832552, 88.450026, 109.832552),\n (88.450026, 109.832552, 86.440967, 109.832552),\n (86.440967, 109.832552, 84.431908, 109.832552),\n (84.431908, 109.832552, 82.422848, 109.832552),\n (82.422848, 109.832552, 80.413789, 109.832552),\n (80.413789, 109.832552, 78.40473, 109.832552),\n (78.40473, 109.832552, 76.395671, 109.832552),\n (76.395671, 109.832552, 74.386611, 109.832552),\n (74.386611, 109.832552, 72.377552, 109.832552),\n (72.377552, 109.832552, 72.377552, 78.022448),\n (150.667448, 123.832552, 150.667448, 125.841611),\n (150.667448, 125.841611, 150.667448, 127.850671),\n (150.667448, 127.850671, 150.667448, 129.85973),\n (150.667448, 129.85973, 150.667448, 131.868789),\n (150.667448, 131.868789, 150.667448, 133.877848),\n (150.667448, 133.877848, 150.667448, 135.886908),\n (150.667448, 135.886908, 150.667448, 137.895967),\n (150.667448, 137.895967, 150.667448, 139.905026),\n (150.667448, 139.905026, 150.667448, 141.914085),\n (150.667448, 141.914085, 150.667448, 143.923145),\n (150.667448, 143.923145, 150.667448, 145.932204),\n (150.667448, 145.932204, 150.667448, 147.941263),\n (150.667448, 147.941263, 150.667448, 149.950322),\n (150.667448, 149.950322, 150.667448, 151.959382),\n (150.667448, 151.959382, 150.667448, 153.968441),\n (150.667448, 153.968441, 150.667448, 155.9775),\n (150.667448, 155.9775, 150.667448, 157.986559),\n (150.667448, 157.986559, 150.667448, 159.995618),\n (150.667448, 159.995618, 150.667448, 162.004678),\n (150.667448, 162.004678, 150.667448, 164.013737),\n (150.667448, 164.013737, 150.667448, 166.022796),\n (150.667448, 166.022796, 150.667448, 168.031855),\n (150.667448, 168.031855, 150.667448, 170.040915),\n (150.667448, 170.040915, 150.667448, 172.049974),\n (150.667448, 172.049974, 150.667448, 174.059033),\n (150.667448, 174.059033, 150.667448, 176.068092),\n (150.667448, 176.068092, 150.667448, 178.077152),\n (150.667448, 178.077152, 150.667448, 180.086211),\n (150.667448, 180.086211, 150.667448, 182.09527),\n (150.667448, 182.09527, 150.667448, 184.104329),\n (150.667448, 184.104329, 150.667448, 186.113389),\n (150.667448, 186.113389, 150.667448, 188.122448),\n (182.477552, 123.832552, 182.477552, 125.841611),\n (182.477552, 125.841611, 182.477552, 127.850671),\n (182.477552, 127.850671, 182.477552, 129.85973),\n (182.477552, 129.85973, 182.477552, 131.868789),\n (182.477552, 131.868789, 182.477552, 133.877848),\n (182.477552, 133.877848, 182.477552, 135.886908),\n (182.477552, 135.886908, 182.477552, 137.895967),\n (182.477552, 137.895967, 182.477552, 139.905026),\n (182.477552, 139.905026, 182.477552, 141.914085),\n (182.477552, 141.914085, 182.477552, 143.923145),\n (182.477552, 143.923145, 182.477552, 145.932204),\n (182.477552, 145.932204, 182.477552, 147.941263),\n (182.477552, 147.941263, 182.477552, 149.950322),\n (182.477552, 149.950322, 182.477552, 151.959382),\n (182.477552, 151.959382, 182.477552, 153.968441),\n (182.477552, 153.968441, 182.477552, 155.9775),\n (182.477552, 155.9775, 182.477552, 157.986559),\n (182.477552, 157.986559, 182.477552, 159.995618),\n (182.477552, 159.995618, 182.477552, 162.004678),\n (182.477552, 162.004678, 182.477552, 164.013737),\n (182.477552, 164.013737, 182.477552, 166.022796),\n (182.477552, 166.022796, 182.477552, 168.031855),\n (182.477552, 168.031855, 182.477552, 170.040915),\n (182.477552, 170.040915, 182.477552, 172.049974),\n (182.477552, 172.049974, 182.477552, 174.059033),\n (182.477552, 174.059033, 182.477552, 176.068092),\n (182.477552, 176.068092, 182.477552, 178.077152),\n (182.477552, 178.077152, 182.477552, 180.086211),\n (182.477552, 180.086211, 182.477552, 182.09527),\n (182.477552, 182.09527, 182.477552, 184.104329),\n (182.477552, 184.104329, 182.477552, 186.113389),\n (182.477552, 186.113389, 182.477552, 188.122448),\n (182.477552, 123.832552, 150.667448, 123.832552),\n (182.477552, 188.122448, 150.667448, 188.122448)\n]\nVISIBLE_CIRCLES = [\n (104.5225, 155.9775, 32.144948)\n]\nVISIBLE_ARCS = [\n\n]\nHIDDEN_SEGMENTS = [\n\n]\n# (orient, text, p1, p2, base) for linear; (orient, text, center, radius, angle) for diameter\nDIMENSIONS = [\n ('diameter', '%%c100', (104.5225, 155.9775), 32.1449, 45),\n ('horizontal', '49.4792', (150.6674, 155.9775), (182.4775, 155.9775), (166.5725, 166.9775))\n]\n\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\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\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,\n angle=(0 if d[0] == \"horizontal\" else 90),\n 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,\n text=text, dimstyle=\"EZDXF\").render()\n\n doc.saveas(out_path)\n\n\nif __name__ == \"__main__\":\n out = sys.argv[1] if len(sys.argv) > 1 else \"0026_00260505_gt.dxf\"\n draw(out)\n print(\"wrote\", out)\n```"}], "images": ["images/0026_00260505.png"], "id": "0026_00260505"} {"messages": [{"role": "user", "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 250 mm."}, {"role": "assistant", "content": "```python\n#!/usr/bin/env python3\n# -*- coding: utf-8 -*-\n# Ground-truth 2D engineering drawing for part: 0029_00290330\n# Self-contained: reproduces the three-view DXF via ezdxf, NO FreeCAD needed.\n# Coordinates are A4 page millimetres (scale=0.16016666666666668, page=[297.0, 210.0]).\n# visible edges -> solid (layer OUTLINE); hidden edges -> dashed (layer HIDDEN)\n# dimensions -> real movable DIMENSION entities (text = true mm value)\n# Run: python 0029_00290330_gt.py [out.dxf]\nimport sys\nimport ezdxf\n\nSCALE = 0.16016666666666668\nPAGE = [297.0, 210.0]\n\nVISIBLE_SEGMENTS = [\n (100.462533, 105.9958, 100.462533, 65.954133),\n (84.445867, 65.954133, 84.946388, 65.954133),\n (84.946388, 65.954133, 85.446908, 65.954133),\n (85.446908, 65.954133, 85.947429, 65.954133),\n (85.947429, 65.954133, 86.44795, 65.954133),\n (86.44795, 65.954133, 86.948471, 65.954133),\n (86.948471, 65.954133, 87.448992, 65.954133),\n (87.448992, 65.954133, 87.949512, 65.954133),\n (87.949512, 65.954133, 88.450033, 65.954133),\n (88.450033, 65.954133, 88.950554, 65.954133),\n (88.950554, 65.954133, 89.451075, 65.954133),\n (89.451075, 65.954133, 89.951596, 65.954133),\n (89.951596, 65.954133, 90.452117, 65.954133),\n (90.452117, 65.954133, 90.952638, 65.954133),\n (90.952638, 65.954133, 91.453158, 65.954133),\n (91.453158, 65.954133, 91.953679, 65.954133),\n (91.953679, 65.954133, 92.4542, 65.954133),\n (92.4542, 65.954133, 92.954721, 65.954133),\n (92.954721, 65.954133, 93.455242, 65.954133),\n (93.455242, 65.954133, 93.955762, 65.954133),\n (93.955762, 65.954133, 94.456283, 65.954133),\n (94.456283, 65.954133, 94.956804, 65.954133),\n (94.956804, 65.954133, 95.457325, 65.954133),\n (95.457325, 65.954133, 95.957846, 65.954133),\n (95.957846, 65.954133, 96.458367, 65.954133),\n (96.458367, 65.954133, 96.958888, 65.954133),\n (96.958888, 65.954133, 97.459408, 65.954133),\n (97.459408, 65.954133, 97.959929, 65.954133),\n (97.959929, 65.954133, 98.46045, 65.954133),\n (98.46045, 65.954133, 98.960971, 65.954133),\n (98.960971, 65.954133, 99.461492, 65.954133),\n (99.461492, 65.954133, 99.962013, 65.954133),\n (99.962013, 65.954133, 100.462533, 65.954133),\n (100.462533, 105.9958, 100.462533, 146.037466),\n (84.445867, 146.037466, 84.946388, 146.037466),\n (84.946388, 146.037466, 85.446908, 146.037466),\n (85.446908, 146.037466, 85.947429, 146.037466),\n (85.947429, 146.037466, 86.44795, 146.037466),\n (86.44795, 146.037466, 86.948471, 146.037466),\n (86.948471, 146.037466, 87.448992, 146.037466),\n (87.448992, 146.037466, 87.949512, 146.037466),\n (87.949512, 146.037466, 88.450033, 146.037466),\n (88.450033, 146.037466, 88.950554, 146.037466),\n (88.950554, 146.037466, 89.451075, 146.037466),\n (89.451075, 146.037466, 89.951596, 146.037466),\n (89.951596, 146.037466, 90.452117, 146.037466),\n (90.452117, 146.037466, 90.952638, 146.037466),\n (90.952638, 146.037466, 91.453158, 146.037466),\n (91.453158, 146.037466, 91.953679, 146.037466),\n (91.953679, 146.037466, 92.4542, 146.037466),\n (92.4542, 146.037466, 92.954721, 146.037466),\n (92.954721, 146.037466, 93.455242, 146.037466),\n (93.455242, 146.037466, 93.955762, 146.037466),\n (93.955762, 146.037466, 94.456283, 146.037466),\n (94.456283, 146.037466, 94.956804, 146.037466),\n (94.956804, 146.037466, 95.457325, 146.037466),\n (95.457325, 146.037466, 95.957846, 146.037466),\n (95.957846, 146.037466, 96.458367, 146.037466),\n (96.458367, 146.037466, 96.958888, 146.037466),\n (96.958888, 146.037466, 97.459408, 146.037466),\n (97.459408, 146.037466, 97.959929, 146.037466),\n (97.959929, 146.037466, 98.46045, 146.037466),\n (98.46045, 146.037466, 98.960971, 146.037466),\n (98.960971, 146.037466, 99.461492, 146.037466),\n (99.461492, 146.037466, 99.962013, 146.037466),\n (99.962013, 146.037466, 100.462533, 146.037466),\n (84.445867, 65.954133, 84.445867, 105.9958),\n (84.445867, 146.037466, 84.445867, 105.9958),\n (114.462534, 176.054133, 114.462534, 175.553613),\n (114.462534, 175.553613, 114.462534, 175.053092),\n (114.462534, 175.053092, 114.462534, 174.552571),\n (114.462534, 174.552571, 114.462534, 174.05205),\n (114.462534, 174.05205, 114.462534, 173.551529),\n (114.462534, 173.551529, 114.462534, 173.051008),\n (114.462534, 173.051008, 114.462534, 172.550488),\n (114.462534, 172.550488, 114.462534, 172.049967),\n (114.462534, 172.049967, 114.462534, 171.549446),\n (114.462534, 171.549446, 114.462534, 171.048925),\n (114.462534, 171.048925, 114.462534, 170.548404),\n (114.462534, 170.548404, 114.462534, 170.047883),\n (114.462534, 170.047883, 114.462534, 169.547363),\n (114.462534, 169.547363, 114.462534, 169.046842),\n (114.462534, 169.046842, 114.462534, 168.546321),\n (114.462534, 168.546321, 114.462534, 168.0458),\n (114.462534, 168.0458, 114.462534, 167.545279),\n (114.462534, 167.545279, 114.462534, 167.044758),\n (114.462534, 167.044758, 114.462534, 166.544238),\n (114.462534, 166.544238, 114.462534, 166.043717),\n (114.462534, 166.043717, 114.462534, 165.543196),\n (114.462534, 165.543196, 114.462534, 165.042675),\n (114.462534, 165.042675, 114.462534, 164.542154),\n (114.462534, 164.542154, 114.462534, 164.041633),\n (114.462534, 164.041633, 114.462534, 163.541113),\n (114.462534, 163.541113, 114.462534, 163.040592),\n (114.462534, 163.040592, 114.462534, 162.540071),\n (114.462534, 162.540071, 114.462534, 162.03955),\n (114.462534, 162.03955, 114.462534, 161.539029),\n (114.462534, 161.539029, 114.462534, 161.038508),\n (114.462534, 161.038508, 114.462534, 160.537988),\n (114.462534, 160.537988, 114.462534, 160.037467),\n (194.545867, 176.054133, 194.545867, 175.553613),\n (194.545867, 175.553613, 194.545867, 175.053092),\n (194.545867, 175.053092, 194.545867, 174.552571),\n (194.545867, 174.552571, 194.545867, 174.05205),\n (194.545867, 174.05205, 194.545867, 173.551529),\n (194.545867, 173.551529, 194.545867, 173.051008),\n (194.545867, 173.051008, 194.545867, 172.550488),\n (194.545867, 172.550488, 194.545867, 172.049967),\n (194.545867, 172.049967, 194.545867, 171.549446),\n (194.545867, 171.549446, 194.545867, 171.048925),\n (194.545867, 171.048925, 194.545867, 170.548404),\n (194.545867, 170.548404, 194.545867, 170.047883),\n (194.545867, 170.047883, 194.545867, 169.547363),\n (194.545867, 169.547363, 194.545867, 169.046842),\n (194.545867, 169.046842, 194.545867, 168.546321),\n (194.545867, 168.546321, 194.545867, 168.0458),\n (194.545867, 168.0458, 194.545867, 167.545279),\n (194.545867, 167.545279, 194.545867, 167.044758),\n (194.545867, 167.044758, 194.545867, 166.544238),\n (194.545867, 166.544238, 194.545867, 166.043717),\n (194.545867, 166.043717, 194.545867, 165.543196),\n (194.545867, 165.543196, 194.545867, 165.042675),\n (194.545867, 165.042675, 194.545867, 164.542154),\n (194.545867, 164.542154, 194.545867, 164.041633),\n (194.545867, 164.041633, 194.545867, 163.541113),\n (194.545867, 163.541113, 194.545867, 163.040592),\n (194.545867, 163.040592, 194.545867, 162.540071),\n (194.545867, 162.540071, 194.545867, 162.03955),\n (194.545867, 162.03955, 194.545867, 161.539029),\n (194.545867, 161.539029, 194.545867, 161.038508),\n (194.545867, 161.038508, 194.545867, 160.537988),\n (194.545867, 160.537988, 194.545867, 160.037467),\n (114.462534, 176.054133, 154.5042, 176.054133),\n (114.462534, 160.037467, 154.5042, 160.037467),\n (194.545867, 160.037467, 154.5042, 160.037467),\n (194.545867, 176.054133, 154.5042, 176.054133)\n]\nVISIBLE_CIRCLES = [\n (92.4542, 168.0458, 8.008333)\n]\nVISIBLE_ARCS = [\n\n]\nHIDDEN_SEGMENTS = [\n\n]\n# (orient, text, p1, p2, base) for linear; (orient, text, center, radius, angle) for diameter\nDIMENSIONS = [\n ('diameter', '%%c100', (92.4542, 168.0458), 8.0083, 45),\n ('horizontal', '500', (194.5458, 168.0458), (114.4625, 168.0458), (154.5042, 157.0458))\n]\n\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\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\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,\n angle=(0 if d[0] == \"horizontal\" else 90),\n 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,\n text=text, dimstyle=\"EZDXF\").render()\n\n doc.saveas(out_path)\n\n\nif __name__ == \"__main__\":\n out = sys.argv[1] if len(sys.argv) > 1 else \"0029_00290330_gt.dxf\"\n draw(out)\n print(\"wrote\", out)\n```"}], "images": ["images/0029_00290330.png"], "id": "0029_00290330"} {"messages": [{"role": "user", "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 1357.14 mm."}, {"role": "assistant", "content": "```python\n#!/usr/bin/env python3\n# -*- coding: utf-8 -*-\n# Ground-truth 2D engineering drawing for part: 0031_00311159\n# Self-contained: reproduces the three-view DXF via ezdxf, NO FreeCAD needed.\n# Coordinates are A4 page millimetres (scale=0.0659509803921504, page=[297.0, 210.0]).\n# visible edges -> solid (layer OUTLINE); hidden edges -> dashed (layer HIDDEN)\n# dimensions -> real movable DIMENSION entities (text = true mm value)\n# Run: python 0031_00311159_gt.py [out.dxf]\nimport sys\nimport ezdxf\n\nSCALE = 0.0659509803921504\nPAGE = [297.0, 210.0]\n\nVISIBLE_SEGMENTS = [\n (93.396349, 63.598749, 93.190252, 63.598749),\n (93.190252, 63.598749, 92.984155, 63.598749),\n (92.984155, 63.598749, 92.778059, 63.598749),\n (92.778059, 63.598749, 92.571962, 63.598749),\n (92.571962, 63.598749, 92.365865, 63.598749),\n (92.365865, 63.598749, 92.159768, 63.598749),\n (92.159768, 63.598749, 91.953671, 63.598749),\n (91.953671, 63.598749, 91.747575, 63.598749),\n (91.747575, 63.598749, 91.541478, 63.598749),\n (91.541478, 63.598749, 91.335381, 63.598749),\n (91.335381, 63.598749, 91.129284, 63.598749),\n (91.129284, 63.598749, 90.923187, 63.598749),\n (90.923187, 63.598749, 90.71709, 63.598749),\n (90.71709, 63.598749, 90.510994, 63.598749),\n (90.510994, 63.598749, 90.304897, 63.598749),\n (90.304897, 63.598749, 90.0988, 63.598749),\n (90.0988, 63.598749, 89.892703, 63.598749),\n (89.892703, 63.598749, 89.686606, 63.598749),\n (89.686606, 63.598749, 89.48051, 63.598749),\n (89.48051, 63.598749, 89.274413, 63.598749),\n (89.274413, 63.598749, 89.068316, 63.598749),\n (89.068316, 63.598749, 88.862219, 63.598749),\n (88.862219, 63.598749, 88.656122, 63.598749),\n (88.656122, 63.598749, 88.450025, 63.598749),\n (88.450025, 63.598749, 88.243929, 63.598749),\n (88.243929, 63.598749, 88.037832, 63.598749),\n (88.037832, 63.598749, 87.831735, 63.598749),\n (87.831735, 63.598749, 87.625638, 63.598749),\n (87.625638, 63.598749, 87.419541, 63.598749),\n (87.419541, 63.598749, 87.213445, 63.598749),\n (87.213445, 63.598749, 87.007348, 63.598749),\n (87.007348, 63.598749, 86.801251, 63.598749),\n (93.396349, 63.598749, 93.396349, 153.103651),\n (93.396349, 153.103651, 93.190252, 153.103651),\n (93.190252, 153.103651, 92.984155, 153.103651),\n (92.984155, 153.103651, 92.778059, 153.103651),\n (92.778059, 153.103651, 92.571962, 153.103651),\n (92.571962, 153.103651, 92.365865, 153.103651),\n (92.365865, 153.103651, 92.159768, 153.103651),\n (92.159768, 153.103651, 91.953671, 153.103651),\n (91.953671, 153.103651, 91.747575, 153.103651),\n (91.747575, 153.103651, 91.541478, 153.103651),\n (91.541478, 153.103651, 91.335381, 153.103651),\n (91.335381, 153.103651, 91.129284, 153.103651),\n (91.129284, 153.103651, 90.923187, 153.103651),\n (90.923187, 153.103651, 90.71709, 153.103651),\n (90.71709, 153.103651, 90.510994, 153.103651),\n (90.510994, 153.103651, 90.304897, 153.103651),\n (90.304897, 153.103651, 90.0988, 153.103651),\n (90.0988, 153.103651, 89.892703, 153.103651),\n (89.892703, 153.103651, 89.686606, 153.103651),\n (89.686606, 153.103651, 89.48051, 153.103651),\n (89.48051, 153.103651, 89.274413, 153.103651),\n (89.274413, 153.103651, 89.068316, 153.103651),\n (89.068316, 153.103651, 88.862219, 153.103651),\n (88.862219, 153.103651, 88.656122, 153.103651),\n (88.656122, 153.103651, 88.450025, 153.103651),\n (88.450025, 153.103651, 88.243929, 153.103651),\n (88.243929, 153.103651, 88.037832, 153.103651),\n (88.037832, 153.103651, 87.831735, 153.103651),\n (87.831735, 153.103651, 87.625638, 153.103651),\n (87.625638, 153.103651, 87.419541, 153.103651),\n (87.419541, 153.103651, 87.213445, 153.103651),\n (87.213445, 153.103651, 87.007348, 153.103651),\n (87.007348, 153.103651, 86.801251, 153.103651),\n (86.801251, 153.103651, 86.801251, 63.598749),\n (107.396349, 167.103651, 107.396349, 167.309748),\n (107.396349, 167.309748, 107.396349, 167.515845),\n (107.396349, 167.515845, 107.396349, 167.721941),\n (107.396349, 167.721941, 107.396349, 167.928038),\n (107.396349, 167.928038, 107.396349, 168.134135),\n (107.396349, 168.134135, 107.396349, 168.340232),\n (107.396349, 168.340232, 107.396349, 168.546329),\n (107.396349, 168.546329, 107.396349, 168.752425),\n (107.396349, 168.752425, 107.396349, 168.958522),\n (107.396349, 168.958522, 107.396349, 169.164619),\n (107.396349, 169.164619, 107.396349, 169.370716),\n (107.396349, 169.370716, 107.396349, 169.576813),\n (107.396349, 169.576813, 107.396349, 169.78291),\n (107.396349, 169.78291, 107.396349, 169.989006),\n (107.396349, 169.989006, 107.396349, 170.195103),\n (107.396349, 170.195103, 107.396349, 170.4012),\n (107.396349, 170.4012, 107.396349, 170.607297),\n (107.396349, 170.607297, 107.396349, 170.813394),\n (107.396349, 170.813394, 107.396349, 171.01949),\n (107.396349, 171.01949, 107.396349, 171.225587),\n (107.396349, 171.225587, 107.396349, 171.431684),\n (107.396349, 171.431684, 107.396349, 171.637781),\n (107.396349, 171.637781, 107.396349, 171.843878),\n (107.396349, 171.843878, 107.396349, 172.049975),\n (107.396349, 172.049975, 107.396349, 172.256071),\n (107.396349, 172.256071, 107.396349, 172.462168),\n (107.396349, 172.462168, 107.396349, 172.668265),\n (107.396349, 172.668265, 107.396349, 172.874362),\n (107.396349, 172.874362, 107.396349, 173.080459),\n (107.396349, 173.080459, 107.396349, 173.286555),\n (107.396349, 173.286555, 107.396349, 173.492652),\n (107.396349, 173.492652, 107.396349, 173.698749),\n (196.901251, 167.103651, 196.901251, 167.309748),\n (196.901251, 167.309748, 196.901251, 167.515845),\n (196.901251, 167.515845, 196.901251, 167.721941),\n (196.901251, 167.721941, 196.901251, 167.928038),\n (196.901251, 167.928038, 196.901251, 168.134135),\n (196.901251, 168.134135, 196.901251, 168.340232),\n (196.901251, 168.340232, 196.901251, 168.546329),\n (196.901251, 168.546329, 196.901251, 168.752425),\n (196.901251, 168.752425, 196.901251, 168.958522),\n (196.901251, 168.958522, 196.901251, 169.164619),\n (196.901251, 169.164619, 196.901251, 169.370716),\n (196.901251, 169.370716, 196.901251, 169.576813),\n (196.901251, 169.576813, 196.901251, 169.78291),\n (196.901251, 169.78291, 196.901251, 169.989006),\n (196.901251, 169.989006, 196.901251, 170.195103),\n (196.901251, 170.195103, 196.901251, 170.4012),\n (196.901251, 170.4012, 196.901251, 170.607297),\n (196.901251, 170.607297, 196.901251, 170.813394),\n (196.901251, 170.813394, 196.901251, 171.01949),\n (196.901251, 171.01949, 196.901251, 171.225587),\n (196.901251, 171.225587, 196.901251, 171.431684),\n (196.901251, 171.431684, 196.901251, 171.637781),\n (196.901251, 171.637781, 196.901251, 171.843878),\n (196.901251, 171.843878, 196.901251, 172.049975),\n (196.901251, 172.049975, 196.901251, 172.256071),\n (196.901251, 172.256071, 196.901251, 172.462168),\n (196.901251, 172.462168, 196.901251, 172.668265),\n (196.901251, 172.668265, 196.901251, 172.874362),\n (196.901251, 172.874362, 196.901251, 173.080459),\n (196.901251, 173.080459, 196.901251, 173.286555),\n (196.901251, 173.286555, 196.901251, 173.492652),\n (196.901251, 173.492652, 196.901251, 173.698749),\n (196.901251, 167.103651, 107.396349, 167.103651),\n (196.901251, 173.698749, 107.396349, 173.698749)\n]\nVISIBLE_CIRCLES = [\n (90.0988, 170.4012, 3.297549)\n]\nVISIBLE_ARCS = [\n\n]\nHIDDEN_SEGMENTS = [\n\n]\n# (orient, text, p1, p2, base) for linear; (orient, text, center, radius, angle) for diameter\nDIMENSIONS = [\n ('diameter', '%%c100', (90.0988, 170.4012), 3.2975, 45),\n ('horizontal', '1357.14', (107.3963, 170.4012), (196.9012, 170.4012), (152.1488, 181.4012))\n]\n\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\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\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,\n angle=(0 if d[0] == \"horizontal\" else 90),\n 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,\n text=text, dimstyle=\"EZDXF\").render()\n\n doc.saveas(out_path)\n\n\nif __name__ == \"__main__\":\n out = sys.argv[1] if len(sys.argv) > 1 else \"0031_00311159_gt.dxf\"\n draw(out)\n print(\"wrote\", out)\n```"}], "images": ["images/0031_00311159.png"], "id": "0031_00311159"} {"messages": [{"role": "user", "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 22.16 mm."}, {"role": "assistant", "content": "```python\n#!/usr/bin/env python3\n# -*- coding: utf-8 -*-\n# Ground-truth 2D engineering drawing for part: 0032_00320723\n# Self-contained: reproduces the three-view DXF via ezdxf, NO FreeCAD needed.\n# Coordinates are A4 page millimetres (scale=0.7347, page=[297.0, 210.0]).\n# visible edges -> solid (layer OUTLINE); hidden edges -> dashed (layer HIDDEN)\n# dimensions -> real movable DIMENSION entities (text = true mm value)\n# Run: python 0032_00320723_gt.py [out.dxf]\nimport sys\nimport ezdxf\n\nSCALE = 0.7347\nPAGE = [297.0, 210.0]\n\nVISIBLE_SEGMENTS = [\n (73.2561, 99.7739, 75.552038, 99.7739),\n (75.552038, 99.7739, 77.847975, 99.7739),\n (77.847975, 99.7739, 80.143912, 99.7739),\n (80.143912, 99.7739, 82.43985, 99.7739),\n (82.43985, 99.7739, 84.735788, 99.7739),\n (84.735788, 99.7739, 87.031725, 99.7739),\n (87.031725, 99.7739, 89.327663, 99.7739),\n (89.327663, 99.7739, 91.6236, 99.7739),\n (91.6236, 99.7739, 93.919538, 99.7739),\n (93.919538, 99.7739, 96.215475, 99.7739),\n (96.215475, 99.7739, 98.511413, 99.7739),\n (98.511413, 99.7739, 100.80735, 99.7739),\n (100.80735, 99.7739, 103.103288, 99.7739),\n (103.103288, 99.7739, 105.399225, 99.7739),\n (105.399225, 99.7739, 107.695163, 99.7739),\n (107.695163, 99.7739, 109.9911, 99.7739),\n (109.9911, 99.7739, 112.287037, 99.7739),\n (112.287037, 99.7739, 114.582975, 99.7739),\n (114.582975, 99.7739, 116.878912, 99.7739),\n (116.878912, 99.7739, 119.17485, 99.7739),\n (119.17485, 99.7739, 121.470788, 99.7739),\n (121.470788, 99.7739, 123.766725, 99.7739),\n (123.766725, 99.7739, 126.062663, 99.7739),\n (126.062663, 99.7739, 128.3586, 99.7739),\n (128.3586, 99.7739, 130.654538, 99.7739),\n (130.654538, 99.7739, 132.950475, 99.7739),\n (132.950475, 99.7739, 135.246413, 99.7739),\n (135.246413, 99.7739, 137.54235, 99.7739),\n (137.54235, 99.7739, 139.838288, 99.7739),\n (139.838288, 99.7739, 142.134225, 99.7739),\n (142.134225, 99.7739, 144.430163, 99.7739),\n (144.430163, 99.7739, 146.7261, 99.7739),\n (146.7261, 99.7739, 146.7261, 83.491079),\n (73.2561, 83.491079, 75.552038, 83.491079),\n (75.552038, 83.491079, 77.847975, 83.491079),\n (77.847975, 83.491079, 80.143912, 83.491079),\n (80.143912, 83.491079, 82.43985, 83.491079),\n (82.43985, 83.491079, 84.735788, 83.491079),\n (84.735788, 83.491079, 87.031725, 83.491079),\n (87.031725, 83.491079, 89.327663, 83.491079),\n (89.327663, 83.491079, 91.6236, 83.491079),\n (91.6236, 83.491079, 93.919538, 83.491079),\n (93.919538, 83.491079, 96.215475, 83.491079),\n (96.215475, 83.491079, 98.511413, 83.491079),\n (98.511413, 83.491079, 100.80735, 83.491079),\n (100.80735, 83.491079, 103.103288, 83.491079),\n (103.103288, 83.491079, 105.399225, 83.491079),\n (105.399225, 83.491079, 107.695163, 83.491079),\n (107.695163, 83.491079, 109.9911, 83.491079),\n (109.9911, 83.491079, 112.287037, 83.491079),\n (112.287037, 83.491079, 114.582975, 83.491079),\n (114.582975, 83.491079, 116.878912, 83.491079),\n (116.878912, 83.491079, 119.17485, 83.491079),\n (119.17485, 83.491079, 121.470788, 83.491079),\n (121.470788, 83.491079, 123.766725, 83.491079),\n (123.766725, 83.491079, 126.062663, 83.491079),\n (126.062663, 83.491079, 128.3586, 83.491079),\n (128.3586, 83.491079, 130.654538, 83.491079),\n (130.654538, 83.491079, 132.950475, 83.491079),\n (132.950475, 83.491079, 135.246413, 83.491079),\n (135.246413, 83.491079, 137.54235, 83.491079),\n (137.54235, 83.491079, 139.838288, 83.491079),\n (139.838288, 83.491079, 142.134225, 83.491079),\n (142.134225, 83.491079, 144.430163, 83.491079),\n (144.430163, 83.491079, 146.7261, 83.491079),\n (73.2561, 83.491079, 73.2561, 99.7739),\n (177.008921, 187.2439, 177.008921, 184.947963),\n (177.008921, 184.947963, 177.008921, 182.652025),\n (177.008921, 182.652025, 177.008921, 180.356088),\n (177.008921, 180.356088, 177.008921, 178.06015),\n (177.008921, 178.06015, 177.008921, 175.764213),\n (177.008921, 175.764213, 177.008921, 173.468275),\n (177.008921, 173.468275, 177.008921, 171.172338),\n (177.008921, 171.172338, 177.008921, 168.8764),\n (177.008921, 168.8764, 177.008921, 166.580463),\n (177.008921, 166.580463, 177.008921, 164.284525),\n (177.008921, 164.284525, 177.008921, 161.988588),\n (177.008921, 161.988588, 177.008921, 159.69265),\n (177.008921, 159.69265, 177.008921, 157.396713),\n (177.008921, 157.396713, 177.008921, 155.100775),\n (177.008921, 155.100775, 177.008921, 152.804838),\n (177.008921, 152.804838, 177.008921, 150.5089),\n (177.008921, 150.5089, 177.008921, 148.212963),\n (177.008921, 148.212963, 177.008921, 145.917025),\n (177.008921, 145.917025, 177.008921, 143.621088),\n (177.008921, 143.621088, 177.008921, 141.32515),\n (177.008921, 141.32515, 177.008921, 139.029213),\n (177.008921, 139.029213, 177.008921, 136.733275),\n (177.008921, 136.733275, 177.008921, 134.437338),\n (177.008921, 134.437338, 177.008921, 132.1414),\n (177.008921, 132.1414, 177.008921, 129.845463),\n (177.008921, 129.845463, 177.008921, 127.549525),\n (177.008921, 127.549525, 177.008921, 125.253588),\n (177.008921, 125.253588, 177.008921, 122.95765),\n (177.008921, 122.95765, 177.008921, 120.661713),\n (177.008921, 120.661713, 177.008921, 118.365775),\n (177.008921, 118.365775, 177.008921, 116.069838),\n (177.008921, 116.069838, 177.008921, 113.7739),\n (160.7261, 187.2439, 160.7261, 184.947963),\n (160.7261, 184.947963, 160.7261, 182.652025),\n (160.7261, 182.652025, 160.7261, 180.356088),\n (160.7261, 180.356088, 160.7261, 178.06015),\n (160.7261, 178.06015, 160.7261, 175.764213),\n (160.7261, 175.764213, 160.7261, 173.468275),\n (160.7261, 173.468275, 160.7261, 171.172338),\n (160.7261, 171.172338, 160.7261, 168.8764),\n (160.7261, 168.8764, 160.7261, 166.580463),\n (160.7261, 166.580463, 160.7261, 164.284525),\n (160.7261, 164.284525, 160.7261, 161.988588),\n (160.7261, 161.988588, 160.7261, 159.69265),\n (160.7261, 159.69265, 160.7261, 157.396713),\n (160.7261, 157.396713, 160.7261, 155.100775),\n (160.7261, 155.100775, 160.7261, 152.804838),\n (160.7261, 152.804838, 160.7261, 150.5089),\n (160.7261, 150.5089, 160.7261, 148.212963),\n (160.7261, 148.212963, 160.7261, 145.917025),\n (160.7261, 145.917025, 160.7261, 143.621088),\n (160.7261, 143.621088, 160.7261, 141.32515),\n (160.7261, 141.32515, 160.7261, 139.029213),\n (160.7261, 139.029213, 160.7261, 136.733275),\n (160.7261, 136.733275, 160.7261, 134.437338),\n (160.7261, 134.437338, 160.7261, 132.1414),\n (160.7261, 132.1414, 160.7261, 129.845463),\n (160.7261, 129.845463, 160.7261, 127.549525),\n (160.7261, 127.549525, 160.7261, 125.253588),\n (160.7261, 125.253588, 160.7261, 122.95765),\n (160.7261, 122.95765, 160.7261, 120.661713),\n (160.7261, 120.661713, 160.7261, 118.365775),\n (160.7261, 118.365775, 160.7261, 116.069838),\n (160.7261, 116.069838, 160.7261, 113.7739),\n (160.7261, 187.2439, 177.008921, 187.2439),\n (160.7261, 113.7739, 177.008921, 113.7739)\n]\nVISIBLE_CIRCLES = [\n (109.9911, 150.5089, 36.735)\n]\nVISIBLE_ARCS = [\n\n]\nHIDDEN_SEGMENTS = [\n\n]\n# (orient, text, p1, p2, base) for linear; (orient, text, center, radius, angle) for diameter\nDIMENSIONS = [\n ('diameter', '%%c100', (109.9911, 150.5089), 36.735, 45),\n ('horizontal', '22.1625', (177.0089, 150.5089), (160.7261, 150.5089), (168.8675, 139.5089))\n]\n\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\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\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,\n angle=(0 if d[0] == \"horizontal\" else 90),\n 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,\n text=text, dimstyle=\"EZDXF\").render()\n\n doc.saveas(out_path)\n\n\nif __name__ == \"__main__\":\n out = sys.argv[1] if len(sys.argv) > 1 else \"0032_00320723_gt.dxf\"\n draw(out)\n print(\"wrote\", out)\n```"}], "images": ["images/0032_00320723.png"], "id": "0032_00320723"} {"messages": [{"role": "user", "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 500 mm."}, {"role": "assistant", "content": "```python\n#!/usr/bin/env python3\n# -*- coding: utf-8 -*-\n# Ground-truth 2D engineering drawing for part: 0032_00323939\n# Self-contained: reproduces the three-view DXF via ezdxf, NO FreeCAD needed.\n# Coordinates are A4 page millimetres (scale=0.16016666666666668, page=[297.0, 210.0]).\n# visible edges -> solid (layer OUTLINE); hidden edges -> dashed (layer HIDDEN)\n# dimensions -> real movable DIMENSION entities (text = true mm value)\n# Run: python 0032_00323939_gt.py [out.dxf]\nimport sys\nimport ezdxf\n\nSCALE = 0.16016666666666668\nPAGE = [297.0, 210.0]\n\nVISIBLE_SEGMENTS = [\n (84.445867, 146.037466, 84.946388, 146.037466),\n (84.946388, 146.037466, 85.446908, 146.037466),\n (85.446908, 146.037466, 85.947429, 146.037466),\n (85.947429, 146.037466, 86.44795, 146.037466),\n (86.44795, 146.037466, 86.948471, 146.037466),\n (86.948471, 146.037466, 87.448992, 146.037466),\n (87.448992, 146.037466, 87.949512, 146.037466),\n (87.949512, 146.037466, 88.450033, 146.037466),\n (88.450033, 146.037466, 88.950554, 146.037466),\n (88.950554, 146.037466, 89.451075, 146.037466),\n (89.451075, 146.037466, 89.951596, 146.037466),\n (89.951596, 146.037466, 90.452117, 146.037466),\n (90.452117, 146.037466, 90.952638, 146.037466),\n (90.952638, 146.037466, 91.453158, 146.037466),\n (91.453158, 146.037466, 91.953679, 146.037466),\n (91.953679, 146.037466, 92.4542, 146.037466),\n (92.4542, 146.037466, 92.954721, 146.037466),\n (92.954721, 146.037466, 93.455242, 146.037466),\n (93.455242, 146.037466, 93.955762, 146.037466),\n (93.955762, 146.037466, 94.456283, 146.037466),\n (94.456283, 146.037466, 94.956804, 146.037466),\n (94.956804, 146.037466, 95.457325, 146.037466),\n (95.457325, 146.037466, 95.957846, 146.037466),\n (95.957846, 146.037466, 96.458367, 146.037466),\n (96.458367, 146.037466, 96.958888, 146.037466),\n (96.958888, 146.037466, 97.459408, 146.037466),\n (97.459408, 146.037466, 97.959929, 146.037466),\n (97.959929, 146.037466, 98.46045, 146.037466),\n (98.46045, 146.037466, 98.960971, 146.037466),\n (98.960971, 146.037466, 99.461492, 146.037466),\n (99.461492, 146.037466, 99.962013, 146.037466),\n (99.962013, 146.037466, 100.462533, 146.037466),\n (100.462533, 146.037466, 100.462533, 65.954133),\n (84.445867, 65.954133, 84.946388, 65.954133),\n (84.946388, 65.954133, 85.446908, 65.954133),\n (85.446908, 65.954133, 85.947429, 65.954133),\n (85.947429, 65.954133, 86.44795, 65.954133),\n (86.44795, 65.954133, 86.948471, 65.954133),\n (86.948471, 65.954133, 87.448992, 65.954133),\n (87.448992, 65.954133, 87.949512, 65.954133),\n (87.949512, 65.954133, 88.450033, 65.954133),\n (88.450033, 65.954133, 88.950554, 65.954133),\n (88.950554, 65.954133, 89.451075, 65.954133),\n (89.451075, 65.954133, 89.951596, 65.954133),\n (89.951596, 65.954133, 90.452117, 65.954133),\n (90.452117, 65.954133, 90.952638, 65.954133),\n (90.952638, 65.954133, 91.453158, 65.954133),\n (91.453158, 65.954133, 91.953679, 65.954133),\n (91.953679, 65.954133, 92.4542, 65.954133),\n (92.4542, 65.954133, 92.954721, 65.954133),\n (92.954721, 65.954133, 93.455242, 65.954133),\n (93.455242, 65.954133, 93.955762, 65.954133),\n (93.955762, 65.954133, 94.456283, 65.954133),\n (94.456283, 65.954133, 94.956804, 65.954133),\n (94.956804, 65.954133, 95.457325, 65.954133),\n (95.457325, 65.954133, 95.957846, 65.954133),\n (95.957846, 65.954133, 96.458367, 65.954133),\n (96.458367, 65.954133, 96.958888, 65.954133),\n (96.958888, 65.954133, 97.459408, 65.954133),\n (97.459408, 65.954133, 97.959929, 65.954133),\n (97.959929, 65.954133, 98.46045, 65.954133),\n (98.46045, 65.954133, 98.960971, 65.954133),\n (98.960971, 65.954133, 99.461492, 65.954133),\n (99.461492, 65.954133, 99.962013, 65.954133),\n (99.962013, 65.954133, 100.462533, 65.954133),\n (84.445867, 65.954133, 84.445867, 146.037466),\n (194.545867, 176.054133, 194.545867, 175.553613),\n (194.545867, 175.553613, 194.545867, 175.053092),\n (194.545867, 175.053092, 194.545867, 174.552571),\n (194.545867, 174.552571, 194.545867, 174.05205),\n (194.545867, 174.05205, 194.545867, 173.551529),\n (194.545867, 173.551529, 194.545867, 173.051008),\n (194.545867, 173.051008, 194.545867, 172.550488),\n (194.545867, 172.550488, 194.545867, 172.049967),\n (194.545867, 172.049967, 194.545867, 171.549446),\n (194.545867, 171.549446, 194.545867, 171.048925),\n (194.545867, 171.048925, 194.545867, 170.548404),\n (194.545867, 170.548404, 194.545867, 170.047883),\n (194.545867, 170.047883, 194.545867, 169.547363),\n (194.545867, 169.547363, 194.545867, 169.046842),\n (194.545867, 169.046842, 194.545867, 168.546321),\n (194.545867, 168.546321, 194.545867, 168.0458),\n (194.545867, 168.0458, 194.545867, 167.545279),\n (194.545867, 167.545279, 194.545867, 167.044758),\n (194.545867, 167.044758, 194.545867, 166.544238),\n (194.545867, 166.544238, 194.545867, 166.043717),\n (194.545867, 166.043717, 194.545867, 165.543196),\n (194.545867, 165.543196, 194.545867, 165.042675),\n (194.545867, 165.042675, 194.545867, 164.542154),\n (194.545867, 164.542154, 194.545867, 164.041633),\n (194.545867, 164.041633, 194.545867, 163.541113),\n (194.545867, 163.541113, 194.545867, 163.040592),\n (194.545867, 163.040592, 194.545867, 162.540071),\n (194.545867, 162.540071, 194.545867, 162.03955),\n (194.545867, 162.03955, 194.545867, 161.539029),\n (194.545867, 161.539029, 194.545867, 161.038508),\n (194.545867, 161.038508, 194.545867, 160.537988),\n (194.545867, 160.537988, 194.545867, 160.037467),\n (114.462534, 176.054133, 114.462534, 175.553613),\n (114.462534, 175.553613, 114.462534, 175.053092),\n (114.462534, 175.053092, 114.462534, 174.552571),\n (114.462534, 174.552571, 114.462534, 174.05205),\n (114.462534, 174.05205, 114.462534, 173.551529),\n (114.462534, 173.551529, 114.462534, 173.051008),\n (114.462534, 173.051008, 114.462534, 172.550488),\n (114.462534, 172.550488, 114.462534, 172.049967),\n (114.462534, 172.049967, 114.462534, 171.549446),\n (114.462534, 171.549446, 114.462534, 171.048925),\n (114.462534, 171.048925, 114.462534, 170.548404),\n (114.462534, 170.548404, 114.462534, 170.047883),\n (114.462534, 170.047883, 114.462534, 169.547363),\n (114.462534, 169.547363, 114.462534, 169.046842),\n (114.462534, 169.046842, 114.462534, 168.546321),\n (114.462534, 168.546321, 114.462534, 168.0458),\n (114.462534, 168.0458, 114.462534, 167.545279),\n (114.462534, 167.545279, 114.462534, 167.044758),\n (114.462534, 167.044758, 114.462534, 166.544238),\n (114.462534, 166.544238, 114.462534, 166.043717),\n (114.462534, 166.043717, 114.462534, 165.543196),\n (114.462534, 165.543196, 114.462534, 165.042675),\n (114.462534, 165.042675, 114.462534, 164.542154),\n (114.462534, 164.542154, 114.462534, 164.041633),\n (114.462534, 164.041633, 114.462534, 163.541113),\n (114.462534, 163.541113, 114.462534, 163.040592),\n (114.462534, 163.040592, 114.462534, 162.540071),\n (114.462534, 162.540071, 114.462534, 162.03955),\n (114.462534, 162.03955, 114.462534, 161.539029),\n (114.462534, 161.539029, 114.462534, 161.038508),\n (114.462534, 161.038508, 114.462534, 160.537988),\n (114.462534, 160.537988, 114.462534, 160.037467),\n (114.462534, 176.054133, 194.545867, 176.054133),\n (114.462534, 160.037467, 194.545867, 160.037467)\n]\nVISIBLE_CIRCLES = [\n (92.4542, 168.0458, 8.008333)\n]\nVISIBLE_ARCS = [\n\n]\nHIDDEN_SEGMENTS = [\n\n]\n# (orient, text, p1, p2, base) for linear; (orient, text, center, radius, angle) for diameter\nDIMENSIONS = [\n ('diameter', '%%c100', (92.4542, 168.0458), 8.0083, 45),\n ('horizontal', '500', (194.5458, 168.0458), (114.4625, 168.0458), (154.5042, 157.0458))\n]\n\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\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\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,\n angle=(0 if d[0] == \"horizontal\" else 90),\n 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,\n text=text, dimstyle=\"EZDXF\").render()\n\n doc.saveas(out_path)\n\n\nif __name__ == \"__main__\":\n out = sys.argv[1] if len(sys.argv) > 1 else \"0032_00323939_gt.dxf\"\n draw(out)\n print(\"wrote\", out)\n```"}], "images": ["images/0032_00323939.png"], "id": "0032_00323939"} {"messages": [{"role": "user", "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 16.49 mm."}, {"role": "assistant", "content": "```python\n#!/usr/bin/env python3\n# -*- coding: utf-8 -*-\n# Ground-truth 2D engineering drawing for part: 0033_00336332\n# Self-contained: reproduces the three-view DXF via ezdxf, NO FreeCAD needed.\n# Coordinates are A4 page millimetres (scale=0.7347, page=[297.0, 210.0]).\n# visible edges -> solid (layer OUTLINE); hidden edges -> dashed (layer HIDDEN)\n# dimensions -> real movable DIMENSION entities (text = true mm value)\n# Run: python 0033_00336332_gt.py [out.dxf]\nimport sys\nimport ezdxf\n\nSCALE = 0.7347\nPAGE = [297.0, 210.0]\n\nVISIBLE_SEGMENTS = [\n (75.3388, 97.6912, 77.634737, 97.6912),\n (77.634737, 97.6912, 79.930675, 97.6912),\n (79.930675, 97.6912, 82.226613, 97.6912),\n (82.226613, 97.6912, 84.52255, 97.6912),\n (84.52255, 97.6912, 86.818488, 97.6912),\n (86.818488, 97.6912, 89.114425, 97.6912),\n (89.114425, 97.6912, 91.410363, 97.6912),\n (91.410363, 97.6912, 93.7063, 97.6912),\n (93.7063, 97.6912, 96.002238, 97.6912),\n (96.002238, 97.6912, 98.298175, 97.6912),\n (98.298175, 97.6912, 100.594113, 97.6912),\n (100.594113, 97.6912, 102.89005, 97.6912),\n (102.89005, 97.6912, 105.185988, 97.6912),\n (105.185988, 97.6912, 107.481925, 97.6912),\n (107.481925, 97.6912, 109.777863, 97.6912),\n (109.777863, 97.6912, 112.0738, 97.6912),\n (112.0738, 97.6912, 114.369737, 97.6912),\n (114.369737, 97.6912, 116.665675, 97.6912),\n (116.665675, 97.6912, 118.961612, 97.6912),\n (118.961612, 97.6912, 121.25755, 97.6912),\n (121.25755, 97.6912, 123.553488, 97.6912),\n (123.553488, 97.6912, 125.849425, 97.6912),\n (125.849425, 97.6912, 128.145363, 97.6912),\n (128.145363, 97.6912, 130.4413, 97.6912),\n (130.4413, 97.6912, 132.737238, 97.6912),\n (132.737238, 97.6912, 135.033175, 97.6912),\n (135.033175, 97.6912, 137.329113, 97.6912),\n (137.329113, 97.6912, 139.62505, 97.6912),\n (139.62505, 97.6912, 141.920988, 97.6912),\n (141.920988, 97.6912, 144.216925, 97.6912),\n (144.216925, 97.6912, 146.512863, 97.6912),\n (146.512863, 97.6912, 148.8088, 97.6912),\n (148.8088, 97.6912, 148.8088, 85.573752),\n (75.3388, 85.573752, 77.634737, 85.573752),\n (77.634737, 85.573752, 79.930675, 85.573752),\n (79.930675, 85.573752, 82.226613, 85.573752),\n (82.226613, 85.573752, 84.52255, 85.573752),\n (84.52255, 85.573752, 86.818488, 85.573752),\n (86.818488, 85.573752, 89.114425, 85.573752),\n (89.114425, 85.573752, 91.410363, 85.573752),\n (91.410363, 85.573752, 93.7063, 85.573752),\n (93.7063, 85.573752, 96.002238, 85.573752),\n (96.002238, 85.573752, 98.298175, 85.573752),\n (98.298175, 85.573752, 100.594113, 85.573752),\n (100.594113, 85.573752, 102.89005, 85.573752),\n (102.89005, 85.573752, 105.185988, 85.573752),\n (105.185988, 85.573752, 107.481925, 85.573752),\n (107.481925, 85.573752, 109.777863, 85.573752),\n (109.777863, 85.573752, 112.0738, 85.573752),\n (112.0738, 85.573752, 114.369737, 85.573752),\n (114.369737, 85.573752, 116.665675, 85.573752),\n (116.665675, 85.573752, 118.961612, 85.573752),\n (118.961612, 85.573752, 121.25755, 85.573752),\n (121.25755, 85.573752, 123.553488, 85.573752),\n (123.553488, 85.573752, 125.849425, 85.573752),\n (125.849425, 85.573752, 128.145363, 85.573752),\n (128.145363, 85.573752, 130.4413, 85.573752),\n (130.4413, 85.573752, 132.737238, 85.573752),\n (132.737238, 85.573752, 135.033175, 85.573752),\n (135.033175, 85.573752, 137.329113, 85.573752),\n (137.329113, 85.573752, 139.62505, 85.573752),\n (139.62505, 85.573752, 141.920988, 85.573752),\n (141.920988, 85.573752, 144.216925, 85.573752),\n (144.216925, 85.573752, 146.512863, 85.573752),\n (146.512863, 85.573752, 148.8088, 85.573752),\n (75.3388, 85.573752, 75.3388, 97.6912),\n (174.926248, 185.1612, 174.926248, 182.865263),\n (174.926248, 182.865263, 174.926248, 180.569325),\n (174.926248, 180.569325, 174.926248, 178.273388),\n (174.926248, 178.273388, 174.926248, 175.97745),\n (174.926248, 175.97745, 174.926248, 173.681512),\n (174.926248, 173.681512, 174.926248, 171.385575),\n (174.926248, 171.385575, 174.926248, 169.089638),\n (174.926248, 169.089638, 174.926248, 166.7937),\n (174.926248, 166.7937, 174.926248, 164.497763),\n (174.926248, 164.497763, 174.926248, 162.201825),\n (174.926248, 162.201825, 174.926248, 159.905888),\n (174.926248, 159.905888, 174.926248, 157.60995),\n (174.926248, 157.60995, 174.926248, 155.314013),\n (174.926248, 155.314013, 174.926248, 153.018075),\n (174.926248, 153.018075, 174.926248, 150.722138),\n (174.926248, 150.722138, 174.926248, 148.4262),\n (174.926248, 148.4262, 174.926248, 146.130262),\n (174.926248, 146.130262, 174.926248, 143.834325),\n (174.926248, 143.834325, 174.926248, 141.538387),\n (174.926248, 141.538387, 174.926248, 139.24245),\n (174.926248, 139.24245, 174.926248, 136.946513),\n (174.926248, 136.946513, 174.926248, 134.650575),\n (174.926248, 134.650575, 174.926248, 132.354638),\n (174.926248, 132.354638, 174.926248, 130.0587),\n (174.926248, 130.0587, 174.926248, 127.762763),\n (174.926248, 127.762763, 174.926248, 125.466825),\n (174.926248, 125.466825, 174.926248, 123.170888),\n (174.926248, 123.170888, 174.926248, 120.87495),\n (174.926248, 120.87495, 174.926248, 118.579013),\n (174.926248, 118.579013, 174.926248, 116.283075),\n (174.926248, 116.283075, 174.926248, 113.987138),\n (174.926248, 113.987138, 174.926248, 111.6912),\n (162.8088, 185.1612, 162.8088, 182.865263),\n (162.8088, 182.865263, 162.8088, 180.569325),\n (162.8088, 180.569325, 162.8088, 178.273388),\n (162.8088, 178.273388, 162.8088, 175.97745),\n (162.8088, 175.97745, 162.8088, 173.681512),\n (162.8088, 173.681512, 162.8088, 171.385575),\n (162.8088, 171.385575, 162.8088, 169.089638),\n (162.8088, 169.089638, 162.8088, 166.7937),\n (162.8088, 166.7937, 162.8088, 164.497763),\n (162.8088, 164.497763, 162.8088, 162.201825),\n (162.8088, 162.201825, 162.8088, 159.905888),\n (162.8088, 159.905888, 162.8088, 157.60995),\n (162.8088, 157.60995, 162.8088, 155.314013),\n (162.8088, 155.314013, 162.8088, 153.018075),\n (162.8088, 153.018075, 162.8088, 150.722138),\n (162.8088, 150.722138, 162.8088, 148.4262),\n (162.8088, 148.4262, 162.8088, 146.130263),\n (162.8088, 146.130263, 162.8088, 143.834325),\n (162.8088, 143.834325, 162.8088, 141.538387),\n (162.8088, 141.538387, 162.8088, 139.24245),\n (162.8088, 139.24245, 162.8088, 136.946513),\n (162.8088, 136.946513, 162.8088, 134.650575),\n (162.8088, 134.650575, 162.8088, 132.354638),\n (162.8088, 132.354638, 162.8088, 130.0587),\n (162.8088, 130.0587, 162.8088, 127.762763),\n (162.8088, 127.762763, 162.8088, 125.466825),\n (162.8088, 125.466825, 162.8088, 123.170888),\n (162.8088, 123.170888, 162.8088, 120.87495),\n (162.8088, 120.87495, 162.8088, 118.579013),\n (162.8088, 118.579013, 162.8088, 116.283075),\n (162.8088, 116.283075, 162.8088, 113.987138),\n (162.8088, 113.987138, 162.8088, 111.6912),\n (162.8088, 185.1612, 174.926248, 185.1612),\n (162.8088, 111.6912, 174.926248, 111.6912)\n]\nVISIBLE_CIRCLES = [\n (112.0738, 148.4262, 36.735)\n]\nVISIBLE_ARCS = [\n\n]\nHIDDEN_SEGMENTS = [\n\n]\n# (orient, text, p1, p2, base) for linear; (orient, text, center, radius, angle) for diameter\nDIMENSIONS = [\n ('diameter', '%%c100', (112.0738, 148.4262), 36.735, 45),\n ('horizontal', '16.4931', (174.9262, 148.4262), (162.8087, 148.4262), (168.8675, 137.4262))\n]\n\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\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\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,\n angle=(0 if d[0] == \"horizontal\" else 90),\n 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,\n text=text, dimstyle=\"EZDXF\").render()\n\n doc.saveas(out_path)\n\n\nif __name__ == \"__main__\":\n out = sys.argv[1] if len(sys.argv) > 1 else \"0033_00336332_gt.dxf\"\n draw(out)\n print(\"wrote\", out)\n```"}], "images": ["images/0033_00336332.png"], "id": "0033_00336332"} {"messages": [{"role": "user", "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 19.48 mm."}, {"role": "assistant", "content": "```python\n#!/usr/bin/env python3\n# -*- coding: utf-8 -*-\n# Ground-truth 2D engineering drawing for part: 0035_00351843\n# Self-contained: reproduces the three-view DXF via ezdxf, NO FreeCAD needed.\n# Coordinates are A4 page millimetres (scale=0.804346705003939, page=[297.0, 210.0]).\n# visible edges -> solid (layer OUTLINE); hidden edges -> dashed (layer HIDDEN)\n# dimensions -> real movable DIMENSION entities (text = true mm value)\n# Run: python 0035_00351843_gt.py [out.dxf]\nimport sys\nimport ezdxf\n\nSCALE = 0.804346705003939\nPAGE = [297.0, 210.0]\n\nVISIBLE_SEGMENTS = [\n (148.775935, 82.058635, 146.262352, 82.058635),\n (146.262352, 82.058635, 143.748768, 82.058635),\n (143.748768, 82.058635, 141.235185, 82.058635),\n (141.235185, 82.058635, 138.721601, 82.058635),\n (138.721601, 82.058635, 136.208018, 82.058635),\n (136.208018, 82.058635, 133.694435, 82.058635),\n (133.694435, 82.058635, 131.180851, 82.058635),\n (131.180851, 82.058635, 128.667268, 82.058635),\n (128.667268, 82.058635, 126.153684, 82.058635),\n (126.153684, 82.058635, 123.640101, 82.058635),\n (123.640101, 82.058635, 121.126517, 82.058635),\n (121.126517, 82.058635, 118.612934, 82.058635),\n (118.612934, 82.058635, 116.09935, 82.058635),\n (116.09935, 82.058635, 113.585767, 82.058635),\n (113.585767, 82.058635, 111.072183, 82.058635),\n (111.072183, 82.058635, 108.5586, 82.058635),\n (108.5586, 82.058635, 106.045017, 82.058635),\n (106.045017, 82.058635, 103.531433, 82.058635),\n (103.531433, 82.058635, 101.01785, 82.058635),\n (101.01785, 82.058635, 98.504266, 82.058635),\n (98.504266, 82.058635, 95.990683, 82.058635),\n (95.990683, 82.058635, 93.477099, 82.058635),\n (93.477099, 82.058635, 90.963516, 82.058635),\n (90.963516, 82.058635, 88.449932, 82.058635),\n (88.449932, 82.058635, 85.936349, 82.058635),\n (85.936349, 82.058635, 83.422765, 82.058635),\n (83.422765, 82.058635, 80.909182, 82.058635),\n (80.909182, 82.058635, 78.395599, 82.058635),\n (78.395599, 82.058635, 75.882015, 82.058635),\n (75.882015, 82.058635, 73.368432, 82.058635),\n (73.368432, 82.058635, 70.854848, 82.058635),\n (70.854848, 82.058635, 68.341265, 82.058635),\n (148.775935, 82.058635, 148.775935, 97.723965),\n (148.775935, 97.723965, 146.262352, 97.723965),\n (146.262352, 97.723965, 143.748768, 97.723965),\n (143.748768, 97.723965, 141.235185, 97.723965),\n (141.235185, 97.723965, 138.721601, 97.723965),\n (138.721601, 97.723965, 136.208018, 97.723965),\n (136.208018, 97.723965, 133.694435, 97.723965),\n (133.694435, 97.723965, 131.180851, 97.723965),\n (131.180851, 97.723965, 128.667268, 97.723965),\n (128.667268, 97.723965, 126.153684, 97.723965),\n (126.153684, 97.723965, 123.640101, 97.723965),\n (123.640101, 97.723965, 121.126517, 97.723965),\n (121.126517, 97.723965, 118.612934, 97.723965),\n (118.612934, 97.723965, 116.09935, 97.723965),\n (116.09935, 97.723965, 113.585767, 97.723965),\n (113.585767, 97.723965, 111.072183, 97.723965),\n (111.072183, 97.723965, 108.5586, 97.723965),\n (108.5586, 97.723965, 106.045017, 97.723965),\n (106.045017, 97.723965, 103.531433, 97.723965),\n (103.531433, 97.723965, 101.01785, 97.723965),\n (101.01785, 97.723965, 98.504266, 97.723965),\n (98.504266, 97.723965, 95.990683, 97.723965),\n (95.990683, 97.723965, 93.477099, 97.723965),\n (93.477099, 97.723965, 90.963516, 97.723965),\n (90.963516, 97.723965, 88.449932, 97.723965),\n (88.449932, 97.723965, 85.936349, 97.723965),\n (85.936349, 97.723965, 83.422765, 97.723965),\n (83.422765, 97.723965, 80.909182, 97.723965),\n (80.909182, 97.723965, 78.395599, 97.723965),\n (78.395599, 97.723965, 75.882015, 97.723965),\n (75.882015, 97.723965, 73.368432, 97.723965),\n (73.368432, 97.723965, 70.854848, 97.723965),\n (70.854848, 97.723965, 68.341265, 97.723965),\n (68.341265, 97.723965, 68.341265, 82.058635),\n (162.775935, 111.723965, 162.775935, 114.237548),\n (162.775935, 114.237548, 162.775935, 116.751132),\n (162.775935, 116.751132, 162.775935, 119.264715),\n (162.775935, 119.264715, 162.775935, 121.778299),\n (162.775935, 121.778299, 162.775935, 124.291882),\n (162.775935, 124.291882, 162.775935, 126.805465),\n (162.775935, 126.805465, 162.775935, 129.319049),\n (162.775935, 129.319049, 162.775935, 131.832632),\n (162.775935, 131.832632, 162.775935, 134.346216),\n (162.775935, 134.346216, 162.775935, 136.859799),\n (162.775935, 136.859799, 162.775935, 139.373383),\n (162.775935, 139.373383, 162.775935, 141.886966),\n (162.775935, 141.886966, 162.775935, 144.40055),\n (162.775935, 144.40055, 162.775935, 146.914133),\n (162.775935, 146.914133, 162.775935, 149.427717),\n (162.775935, 149.427717, 162.775935, 151.9413),\n (162.775935, 151.9413, 162.775935, 154.454883),\n (162.775935, 154.454883, 162.775935, 156.968467),\n (162.775935, 156.968467, 162.775935, 159.48205),\n (162.775935, 159.48205, 162.775935, 161.995634),\n (162.775935, 161.995634, 162.775935, 164.509217),\n (162.775935, 164.509217, 162.775935, 167.022801),\n (162.775935, 167.022801, 162.775935, 169.536384),\n (162.775935, 169.536384, 162.775935, 172.049968),\n (162.775935, 172.049968, 162.775935, 174.563551),\n (162.775935, 174.563551, 162.775935, 177.077135),\n (162.775935, 177.077135, 162.775935, 179.590718),\n (162.775935, 179.590718, 162.775935, 182.104301),\n (162.775935, 182.104301, 162.775935, 184.617885),\n (162.775935, 184.617885, 162.775935, 187.131468),\n (162.775935, 187.131468, 162.775935, 189.645052),\n (162.775935, 189.645052, 162.775935, 192.158635),\n (178.441265, 111.723965, 178.441265, 114.237548),\n (178.441265, 114.237548, 178.441265, 116.751132),\n (178.441265, 116.751132, 178.441265, 119.264715),\n (178.441265, 119.264715, 178.441265, 121.778299),\n (178.441265, 121.778299, 178.441265, 124.291882),\n (178.441265, 124.291882, 178.441265, 126.805465),\n (178.441265, 126.805465, 178.441265, 129.319049),\n (178.441265, 129.319049, 178.441265, 131.832632),\n (178.441265, 131.832632, 178.441265, 134.346216),\n (178.441265, 134.346216, 178.441265, 136.859799),\n (178.441265, 136.859799, 178.441265, 139.373383),\n (178.441265, 139.373383, 178.441265, 141.886966),\n (178.441265, 141.886966, 178.441265, 144.40055),\n (178.441265, 144.40055, 178.441265, 146.914133),\n (178.441265, 146.914133, 178.441265, 149.427717),\n (178.441265, 149.427717, 178.441265, 151.9413),\n (178.441265, 151.9413, 178.441265, 154.454883),\n (178.441265, 154.454883, 178.441265, 156.968467),\n (178.441265, 156.968467, 178.441265, 159.48205),\n (178.441265, 159.48205, 178.441265, 161.995634),\n (178.441265, 161.995634, 178.441265, 164.509217),\n (178.441265, 164.509217, 178.441265, 167.022801),\n (178.441265, 167.022801, 178.441265, 169.536384),\n (178.441265, 169.536384, 178.441265, 172.049968),\n (178.441265, 172.049968, 178.441265, 174.563551),\n (178.441265, 174.563551, 178.441265, 177.077135),\n (178.441265, 177.077135, 178.441265, 179.590718),\n (178.441265, 179.590718, 178.441265, 182.104301),\n (178.441265, 182.104301, 178.441265, 184.617885),\n (178.441265, 184.617885, 178.441265, 187.131468),\n (178.441265, 187.131468, 178.441265, 189.645052),\n (178.441265, 189.645052, 178.441265, 192.158635),\n (178.441265, 111.723965, 162.775935, 111.723965),\n (178.441265, 192.158635, 162.775935, 192.158635)\n]\nVISIBLE_CIRCLES = [\n (108.5586, 151.9413, 40.217335)\n]\nVISIBLE_ARCS = [\n\n]\nHIDDEN_SEGMENTS = [\n\n]\n# (orient, text, p1, p2, base) for linear; (orient, text, center, radius, angle) for diameter\nDIMENSIONS = [\n ('diameter', '%%c100', (108.5586, 151.9413), 40.2173, 45),\n ('horizontal', '19.4758', (162.776, 151.9413), (178.4413, 151.9413), (170.6087, 162.9413))\n]\n\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\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\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,\n angle=(0 if d[0] == \"horizontal\" else 90),\n 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,\n text=text, dimstyle=\"EZDXF\").render()\n\n doc.saveas(out_path)\n\n\nif __name__ == \"__main__\":\n out = sys.argv[1] if len(sys.argv) > 1 else \"0035_00351843_gt.dxf\"\n draw(out)\n print(\"wrote\", out)\n```"}], "images": ["images/0035_00351843.png"], "id": "0035_00351843"} {"messages": [{"role": "user", "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 3.16 mm."}, {"role": "assistant", "content": "```python\n#!/usr/bin/env python3\n# -*- coding: utf-8 -*-\n# Ground-truth 2D engineering drawing for part: 0037_00371687\n# Self-contained: reproduces the three-view DXF via ezdxf, NO FreeCAD needed.\n# Coordinates are A4 page millimetres (scale=0.9315784724460205, page=[297.0, 210.0]).\n# visible edges -> solid (layer OUTLINE); hidden edges -> dashed (layer HIDDEN)\n# dimensions -> real movable DIMENSION entities (text = true mm value)\n# Run: python 0037_00371687_gt.py [out.dxf]\nimport sys\nimport ezdxf\n\nSCALE = 0.9315784724460205\nPAGE = [297.0, 210.0]\n\nVISIBLE_SEGMENTS = [\n (158.318324, 85.239423, 155.407141, 85.239423),\n (155.407141, 85.239423, 152.495958, 85.239423),\n (152.495958, 85.239423, 149.584775, 85.239423),\n (149.584775, 85.239423, 146.673593, 85.239423),\n (146.673593, 85.239423, 143.76241, 85.239423),\n (143.76241, 85.239423, 140.851227, 85.239423),\n (140.851227, 85.239423, 137.940045, 85.239423),\n (137.940045, 85.239423, 135.028862, 85.239423),\n (135.028862, 85.239423, 132.117679, 85.239423),\n (132.117679, 85.239423, 129.206496, 85.239423),\n (129.206496, 85.239423, 126.295314, 85.239423),\n (126.295314, 85.239423, 123.384131, 85.239423),\n (123.384131, 85.239423, 120.472948, 85.239423),\n (120.472948, 85.239423, 117.561765, 85.239423),\n (117.561765, 85.239423, 114.650583, 85.239423),\n (114.650583, 85.239423, 111.7394, 85.239423),\n (111.7394, 85.239423, 108.828217, 85.239423),\n (108.828217, 85.239423, 105.917035, 85.239423),\n (105.917035, 85.239423, 103.005852, 85.239423),\n (103.005852, 85.239423, 100.094669, 85.239423),\n (100.094669, 85.239423, 97.183486, 85.239423),\n (97.183486, 85.239423, 94.272304, 85.239423),\n (94.272304, 85.239423, 91.361121, 85.239423),\n (91.361121, 85.239423, 88.449938, 85.239423),\n (88.449938, 85.239423, 85.538755, 85.239423),\n (85.538755, 85.239423, 82.627573, 85.239423),\n (82.627573, 85.239423, 79.71639, 85.239423),\n (79.71639, 85.239423, 76.805207, 85.239423),\n (76.805207, 85.239423, 73.894025, 85.239423),\n (73.894025, 85.239423, 70.982842, 85.239423),\n (70.982842, 85.239423, 68.071659, 85.239423),\n (68.071659, 85.239423, 65.160476, 85.239423),\n (158.318324, 85.239423, 158.318324, 88.181576),\n (158.318324, 88.181576, 155.407141, 88.181576),\n (155.407141, 88.181576, 152.495958, 88.181576),\n (152.495958, 88.181576, 149.584775, 88.181576),\n (149.584775, 88.181576, 146.673593, 88.181576),\n (146.673593, 88.181576, 143.76241, 88.181576),\n (143.76241, 88.181576, 140.851227, 88.181576),\n (140.851227, 88.181576, 137.940045, 88.181576),\n (137.940045, 88.181576, 135.028862, 88.181576),\n (135.028862, 88.181576, 132.117679, 88.181576),\n (132.117679, 88.181576, 129.206496, 88.181576),\n (129.206496, 88.181576, 126.295314, 88.181576),\n (126.295314, 88.181576, 123.384131, 88.181576),\n (123.384131, 88.181576, 120.472948, 88.181576),\n (120.472948, 88.181576, 117.561765, 88.181576),\n (117.561765, 88.181576, 114.650583, 88.181576),\n (114.650583, 88.181576, 111.7394, 88.181576),\n (111.7394, 88.181576, 108.828217, 88.181576),\n (108.828217, 88.181576, 105.917035, 88.181576),\n (105.917035, 88.181576, 103.005852, 88.181576),\n (103.005852, 88.181576, 100.094669, 88.181576),\n (100.094669, 88.181576, 97.183486, 88.181576),\n (97.183486, 88.181576, 94.272304, 88.181576),\n (94.272304, 88.181576, 91.361121, 88.181576),\n (91.361121, 88.181576, 88.449938, 88.181576),\n (88.449938, 88.181576, 85.538755, 88.181576),\n (85.538755, 88.181576, 82.627573, 88.181576),\n (82.627573, 88.181576, 79.71639, 88.181576),\n (79.71639, 88.181576, 76.805207, 88.181576),\n (76.805207, 88.181576, 73.894025, 88.181576),\n (73.894025, 88.181576, 70.982842, 88.181576),\n (70.982842, 88.181576, 68.071659, 88.181576),\n (68.071659, 88.181576, 65.160476, 88.181576),\n (65.160476, 88.181576, 65.160476, 85.239423),\n (172.318324, 102.181576, 172.318324, 105.092759),\n (172.318324, 105.092759, 172.318324, 108.003942),\n (172.318324, 108.003942, 172.318324, 110.915125),\n (172.318324, 110.915125, 172.318324, 113.826307),\n (172.318324, 113.826307, 172.318324, 116.73749),\n (172.318324, 116.73749, 172.318324, 119.648673),\n (172.318324, 119.648673, 172.318324, 122.559855),\n (172.318324, 122.559855, 172.318324, 125.471038),\n (172.318324, 125.471038, 172.318324, 128.382221),\n (172.318324, 128.382221, 172.318324, 131.293404),\n (172.318324, 131.293404, 172.318324, 134.204586),\n (172.318324, 134.204586, 172.318324, 137.115769),\n (172.318324, 137.115769, 172.318324, 140.026952),\n (172.318324, 140.026952, 172.318324, 142.938135),\n (172.318324, 142.938135, 172.318324, 145.849317),\n (172.318324, 145.849317, 172.318324, 148.7605),\n (172.318324, 148.7605, 172.318324, 151.671683),\n (172.318324, 151.671683, 172.318324, 154.582865),\n (172.318324, 154.582865, 172.318324, 157.494048),\n (172.318324, 157.494048, 172.318324, 160.405231),\n (172.318324, 160.405231, 172.318324, 163.316414),\n (172.318324, 163.316414, 172.318324, 166.227596),\n (172.318324, 166.227596, 172.318324, 169.138779),\n (172.318324, 169.138779, 172.318324, 172.049962),\n (172.318324, 172.049962, 172.318324, 174.961145),\n (172.318324, 174.961145, 172.318324, 177.872327),\n (172.318324, 177.872327, 172.318324, 180.78351),\n (172.318324, 180.78351, 172.318324, 183.694693),\n (172.318324, 183.694693, 172.318324, 186.605875),\n (172.318324, 186.605875, 172.318324, 189.517058),\n (172.318324, 189.517058, 172.318324, 192.428241),\n (172.318324, 192.428241, 172.318324, 195.339424),\n (175.260477, 102.181576, 175.260477, 105.092759),\n (175.260477, 105.092759, 175.260477, 108.003942),\n (175.260477, 108.003942, 175.260477, 110.915125),\n (175.260477, 110.915125, 175.260477, 113.826307),\n (175.260477, 113.826307, 175.260477, 116.73749),\n (175.260477, 116.73749, 175.260477, 119.648673),\n (175.260477, 119.648673, 175.260477, 122.559855),\n (175.260477, 122.559855, 175.260477, 125.471038),\n (175.260477, 125.471038, 175.260477, 128.382221),\n (175.260477, 128.382221, 175.260477, 131.293404),\n (175.260477, 131.293404, 175.260477, 134.204586),\n (175.260477, 134.204586, 175.260477, 137.115769),\n (175.260477, 137.115769, 175.260477, 140.026952),\n (175.260477, 140.026952, 175.260477, 142.938135),\n (175.260477, 142.938135, 175.260477, 145.849317),\n (175.260477, 145.849317, 175.260477, 148.7605),\n (175.260477, 148.7605, 175.260477, 151.671683),\n (175.260477, 151.671683, 175.260477, 154.582865),\n (175.260477, 154.582865, 175.260477, 157.494048),\n (175.260477, 157.494048, 175.260477, 160.405231),\n (175.260477, 160.405231, 175.260477, 163.316414),\n (175.260477, 163.316414, 175.260477, 166.227596),\n (175.260477, 166.227596, 175.260477, 169.138779),\n (175.260477, 169.138779, 175.260477, 172.049962),\n (175.260477, 172.049962, 175.260477, 174.961145),\n (175.260477, 174.961145, 175.260477, 177.872327),\n (175.260477, 177.872327, 175.260477, 180.78351),\n (175.260477, 180.78351, 175.260477, 183.694693),\n (175.260477, 183.694693, 175.260477, 186.605875),\n (175.260477, 186.605875, 175.260477, 189.517058),\n (175.260477, 189.517058, 175.260477, 192.428241),\n (175.260477, 192.428241, 175.260477, 195.339424),\n (175.260477, 102.181576, 172.318324, 102.181576),\n (175.260477, 195.339424, 172.318324, 195.339424)\n]\nVISIBLE_CIRCLES = [\n (111.7394, 148.7605, 46.578924)\n]\nVISIBLE_ARCS = [\n\n]\nHIDDEN_SEGMENTS = [\n\n]\n# (orient, text, p1, p2, base) for linear; (orient, text, center, radius, angle) for diameter\nDIMENSIONS = [\n ('diameter', '%%c100', (111.7394, 148.7605), 46.5789, 45),\n ('horizontal', '3.1582', (172.3184, 148.7605), (175.2605, 148.7605), (173.7894, 159.7605))\n]\n\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\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\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,\n angle=(0 if d[0] == \"horizontal\" else 90),\n 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,\n text=text, dimstyle=\"EZDXF\").render()\n\n doc.saveas(out_path)\n\n\nif __name__ == \"__main__\":\n out = sys.argv[1] if len(sys.argv) > 1 else \"0037_00371687_gt.dxf\"\n draw(out)\n print(\"wrote\", out)\n```"}], "images": ["images/0037_00371687.png"], "id": "0037_00371687"} {"messages": [{"role": "user", "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 -339.29 mm."}, {"role": "assistant", "content": "```python\n#!/usr/bin/env python3\n# -*- coding: utf-8 -*-\n# Ground-truth 2D engineering drawing for part: 0037_00371935\n# Self-contained: reproduces the three-view DXF via ezdxf, NO FreeCAD needed.\n# Coordinates are A4 page millimetres (scale=0.21876422764227854, page=[297.0, 210.0]).\n# visible edges -> solid (layer OUTLINE); hidden edges -> dashed (layer HIDDEN)\n# dimensions -> real movable DIMENSION entities (text = true mm value)\n# Run: python 0037_00371935_gt.py [out.dxf]\nimport sys\nimport ezdxf\n\nSCALE = 0.21876422764227854\nPAGE = [297.0, 210.0]\n\nVISIBLE_SEGMENTS = [\n (104.857311, 67.419111, 104.857311, 141.642688),\n (82.980889, 141.642688, 83.664527, 141.642688),\n (83.664527, 141.642688, 84.348165, 141.642688),\n (84.348165, 141.642688, 85.031803, 141.642688),\n (85.031803, 141.642688, 85.715441, 141.642688),\n (85.715441, 141.642688, 86.39908, 141.642688),\n (86.39908, 141.642688, 87.082718, 141.642688),\n (87.082718, 141.642688, 87.766356, 141.642688),\n (87.766356, 141.642688, 88.449994, 141.642688),\n (88.449994, 141.642688, 89.133633, 141.642688),\n (89.133633, 141.642688, 89.817271, 141.642688),\n (89.817271, 141.642688, 90.500909, 141.642688),\n (90.500909, 141.642688, 91.184547, 141.642688),\n (91.184547, 141.642688, 91.868185, 141.642688),\n (91.868185, 141.642688, 92.551824, 141.642688),\n (92.551824, 141.642688, 93.235462, 141.642688),\n (93.235462, 141.642688, 93.9191, 141.642688),\n (93.9191, 141.642688, 94.602738, 141.642688),\n (94.602738, 141.642688, 95.286376, 141.642688),\n (95.286376, 141.642688, 95.970015, 141.642688),\n (95.970015, 141.642688, 96.653653, 141.642688),\n (96.653653, 141.642688, 97.337291, 141.642688),\n (97.337291, 141.642688, 98.020929, 141.642688),\n (98.020929, 141.642688, 98.704567, 141.642688),\n (98.704567, 141.642688, 99.388206, 141.642688),\n (99.388206, 141.642688, 100.071844, 141.642688),\n (100.071844, 141.642688, 100.755482, 141.642688),\n (100.755482, 141.642688, 101.43912, 141.642688),\n (101.43912, 141.642688, 102.122759, 141.642688),\n (102.122759, 141.642688, 102.806397, 141.642688),\n (102.806397, 141.642688, 103.490035, 141.642688),\n (103.490035, 141.642688, 104.173673, 141.642688),\n (104.173673, 141.642688, 104.857311, 141.642688),\n (82.980889, 67.419111, 83.664527, 67.419111),\n (83.664527, 67.419111, 84.348165, 67.419111),\n (84.348165, 67.419111, 85.031803, 67.419111),\n (85.031803, 67.419111, 85.715441, 67.419111),\n (85.715441, 67.419111, 86.39908, 67.419111),\n (86.39908, 67.419111, 87.082718, 67.419111),\n (87.082718, 67.419111, 87.766356, 67.419111),\n (87.766356, 67.419111, 88.449994, 67.419111),\n (88.449994, 67.419111, 89.133633, 67.419111),\n (89.133633, 67.419111, 89.817271, 67.419111),\n (89.817271, 67.419111, 90.500909, 67.419111),\n (90.500909, 67.419111, 91.184547, 67.419111),\n (91.184547, 67.419111, 91.868185, 67.419111),\n (91.868185, 67.419111, 92.551824, 67.419111),\n (92.551824, 67.419111, 93.235462, 67.419111),\n (93.235462, 67.419111, 93.9191, 67.419111),\n (93.9191, 67.419111, 94.602738, 67.419111),\n (94.602738, 67.419111, 95.286376, 67.419111),\n (95.286376, 67.419111, 95.970015, 67.419111),\n (95.970015, 67.419111, 96.653653, 67.419111),\n (96.653653, 67.419111, 97.337291, 67.419111),\n (97.337291, 67.419111, 98.020929, 67.419111),\n (98.020929, 67.419111, 98.704567, 67.419111),\n (98.704567, 67.419111, 99.388206, 67.419111),\n (99.388206, 67.419111, 100.071844, 67.419111),\n (100.071844, 67.419111, 100.755482, 67.419111),\n (100.755482, 67.419111, 101.43912, 67.419111),\n (101.43912, 67.419111, 102.122759, 67.419111),\n (102.122759, 67.419111, 102.806397, 67.419111),\n (102.806397, 67.419111, 103.490035, 67.419111),\n (103.490035, 67.419111, 104.173673, 67.419111),\n (104.173673, 67.419111, 104.857311, 67.419111),\n (82.980889, 141.642688, 82.980889, 67.419111),\n (193.080889, 177.519111, 193.080889, 176.835473),\n (193.080889, 176.835473, 193.080889, 176.151835),\n (193.080889, 176.151835, 193.080889, 175.468197),\n (193.080889, 175.468197, 193.080889, 174.784559),\n (193.080889, 174.784559, 193.080889, 174.10092),\n (193.080889, 174.10092, 193.080889, 173.417282),\n (193.080889, 173.417282, 193.080889, 172.733644),\n (193.080889, 172.733644, 193.080889, 172.050006),\n (193.080889, 172.050006, 193.080889, 171.366367),\n (193.080889, 171.366367, 193.080889, 170.682729),\n (193.080889, 170.682729, 193.080889, 169.999091),\n (193.080889, 169.999091, 193.080889, 169.315453),\n (193.080889, 169.315453, 193.080889, 168.631815),\n (193.080889, 168.631815, 193.080889, 167.948176),\n (193.080889, 167.948176, 193.080889, 167.264538),\n (193.080889, 167.264538, 193.080889, 166.5809),\n (193.080889, 166.5809, 193.080889, 165.897262),\n (193.080889, 165.897262, 193.080889, 165.213624),\n (193.080889, 165.213624, 193.080889, 164.529985),\n (193.080889, 164.529985, 193.080889, 163.846347),\n (193.080889, 163.846347, 193.080889, 163.162709),\n (193.080889, 163.162709, 193.080889, 162.479071),\n (193.080889, 162.479071, 193.080889, 161.795433),\n (193.080889, 161.795433, 193.080889, 161.111794),\n (193.080889, 161.111794, 193.080889, 160.428156),\n (193.080889, 160.428156, 193.080889, 159.744518),\n (193.080889, 159.744518, 193.080889, 159.06088),\n (193.080889, 159.06088, 193.080889, 158.377241),\n (193.080889, 158.377241, 193.080889, 157.693603),\n (193.080889, 157.693603, 193.080889, 157.009965),\n (193.080889, 157.009965, 193.080889, 156.326327),\n (193.080889, 156.326327, 193.080889, 155.642689),\n (118.857312, 177.519111, 118.857312, 176.835473),\n (118.857312, 176.835473, 118.857312, 176.151835),\n (118.857312, 176.151835, 118.857312, 175.468197),\n (118.857312, 175.468197, 118.857312, 174.784559),\n (118.857312, 174.784559, 118.857312, 174.10092),\n (118.857312, 174.10092, 118.857312, 173.417282),\n (118.857312, 173.417282, 118.857312, 172.733644),\n (118.857312, 172.733644, 118.857312, 172.050006),\n (118.857312, 172.050006, 118.857312, 171.366367),\n (118.857312, 171.366367, 118.857312, 170.682729),\n (118.857312, 170.682729, 118.857312, 169.999091),\n (118.857312, 169.999091, 118.857312, 169.315453),\n (118.857312, 169.315453, 118.857312, 168.631815),\n (118.857312, 168.631815, 118.857312, 167.948176),\n (118.857312, 167.948176, 118.857312, 167.264538),\n (118.857312, 167.264538, 118.857312, 166.5809),\n (118.857312, 166.5809, 118.857312, 165.897262),\n (118.857312, 165.897262, 118.857312, 165.213624),\n (118.857312, 165.213624, 118.857312, 164.529985),\n (118.857312, 164.529985, 118.857312, 163.846347),\n (118.857312, 163.846347, 118.857312, 163.162709),\n (118.857312, 163.162709, 118.857312, 162.479071),\n (118.857312, 162.479071, 118.857312, 161.795433),\n (118.857312, 161.795433, 118.857312, 161.111794),\n (118.857312, 161.111794, 118.857312, 160.428156),\n (118.857312, 160.428156, 118.857312, 159.744518),\n (118.857312, 159.744518, 118.857312, 159.06088),\n (118.857312, 159.06088, 118.857312, 158.377241),\n (118.857312, 158.377241, 118.857312, 157.693603),\n (118.857312, 157.693603, 118.857312, 157.009965),\n (118.857312, 157.009965, 118.857312, 156.326327),\n (118.857312, 156.326327, 118.857312, 155.642689),\n (193.080889, 155.642689, 118.857312, 155.642689),\n (193.080889, 177.519111, 118.857312, 177.519111)\n]\nVISIBLE_CIRCLES = [\n (93.9191, 166.5809, 10.938211)\n]\nVISIBLE_ARCS = [\n\n]\nHIDDEN_SEGMENTS = [\n\n]\n# (orient, text, p1, p2, base) for linear; (orient, text, center, radius, angle) for diameter\nDIMENSIONS = [\n ('diameter', '%%c100', (93.9191, 166.5809), 10.9382, 45),\n ('horizontal', '339.286', (118.8573, 166.5809), (193.0809, 166.5809), (155.9691, 177.5809))\n]\n\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\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\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,\n angle=(0 if d[0] == \"horizontal\" else 90),\n 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,\n text=text, dimstyle=\"EZDXF\").render()\n\n doc.saveas(out_path)\n\n\nif __name__ == \"__main__\":\n out = sys.argv[1] if len(sys.argv) > 1 else \"0037_00371935_gt.dxf\"\n draw(out)\n print(\"wrote\", out)\n```"}], "images": ["images/0037_00371935.png"], "id": "0037_00371935"} {"messages": [{"role": "user", "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.64 mm."}, {"role": "assistant", "content": "```python\n#!/usr/bin/env python3\n# -*- coding: utf-8 -*-\n# Ground-truth 2D engineering drawing for part: 0037_00372112\n# Self-contained: reproduces the three-view DXF via ezdxf, NO FreeCAD needed.\n# Coordinates are A4 page millimetres (scale=0.9183985067662156, page=[297.0, 210.0]).\n# visible edges -> solid (layer OUTLINE); hidden edges -> dashed (layer HIDDEN)\n# dimensions -> real movable DIMENSION entities (text = true mm value)\n# Run: python 0037_00372112_gt.py [out.dxf]\nimport sys\nimport ezdxf\n\nSCALE = 0.9183985067662156\nPAGE = [297.0, 210.0]\n\nVISIBLE_SEGMENTS = [\n (157.329825, 84.909925, 154.45983, 84.909925),\n (154.45983, 84.909925, 151.589835, 84.909925),\n (151.589835, 84.909925, 148.719839, 84.909925),\n (148.719839, 84.909925, 145.849844, 84.909925),\n (145.849844, 84.909925, 142.979849, 84.909925),\n (142.979849, 84.909925, 140.109853, 84.909925),\n (140.109853, 84.909925, 137.239858, 84.909925),\n (137.239858, 84.909925, 134.369863, 84.909925),\n (134.369863, 84.909925, 131.499867, 84.909925),\n (131.499867, 84.909925, 128.629872, 84.909925),\n (128.629872, 84.909925, 125.759877, 84.909925),\n (125.759877, 84.909925, 122.889881, 84.909925),\n (122.889881, 84.909925, 120.019886, 84.909925),\n (120.019886, 84.909925, 117.149891, 84.909925),\n (117.149891, 84.909925, 114.279895, 84.909925),\n (114.279895, 84.909925, 111.4099, 84.909925),\n (111.4099, 84.909925, 108.539905, 84.909925),\n (108.539905, 84.909925, 105.669909, 84.909925),\n (105.669909, 84.909925, 102.799914, 84.909925),\n (102.799914, 84.909925, 99.929919, 84.909925),\n (99.929919, 84.909925, 97.059923, 84.909925),\n (97.059923, 84.909925, 94.189928, 84.909925),\n (94.189928, 84.909925, 91.319933, 84.909925),\n (91.319933, 84.909925, 88.449937, 84.909925),\n (88.449937, 84.909925, 85.579942, 84.909925),\n (85.579942, 84.909925, 82.709947, 84.909925),\n (82.709947, 84.909925, 79.839951, 84.909925),\n (79.839951, 84.909925, 76.969956, 84.909925),\n (76.969956, 84.909925, 74.099961, 84.909925),\n (74.099961, 84.909925, 71.229965, 84.909925),\n (71.229965, 84.909925, 68.35997, 84.909925),\n (68.35997, 84.909925, 65.489975, 84.909925),\n (157.329825, 84.909925, 157.329825, 89.170074),\n (157.329825, 89.170074, 154.45983, 89.170074),\n (154.45983, 89.170074, 151.589835, 89.170074),\n (151.589835, 89.170074, 148.719839, 89.170074),\n (148.719839, 89.170074, 145.849844, 89.170074),\n (145.849844, 89.170074, 142.979849, 89.170074),\n (142.979849, 89.170074, 140.109853, 89.170074),\n (140.109853, 89.170074, 137.239858, 89.170074),\n (137.239858, 89.170074, 134.369863, 89.170074),\n (134.369863, 89.170074, 131.499867, 89.170074),\n (131.499867, 89.170074, 128.629872, 89.170074),\n (128.629872, 89.170074, 125.759877, 89.170074),\n (125.759877, 89.170074, 122.889881, 89.170074),\n (122.889881, 89.170074, 120.019886, 89.170074),\n (120.019886, 89.170074, 117.149891, 89.170074),\n (117.149891, 89.170074, 114.279895, 89.170074),\n (114.279895, 89.170074, 111.4099, 89.170074),\n (111.4099, 89.170074, 108.539905, 89.170074),\n (108.539905, 89.170074, 105.669909, 89.170074),\n (105.669909, 89.170074, 102.799914, 89.170074),\n (102.799914, 89.170074, 99.929919, 89.170074),\n (99.929919, 89.170074, 97.059923, 89.170074),\n (97.059923, 89.170074, 94.189928, 89.170074),\n (94.189928, 89.170074, 91.319933, 89.170074),\n (91.319933, 89.170074, 88.449937, 89.170074),\n (88.449937, 89.170074, 85.579942, 89.170074),\n (85.579942, 89.170074, 82.709947, 89.170074),\n (82.709947, 89.170074, 79.839951, 89.170074),\n (79.839951, 89.170074, 76.969956, 89.170074),\n (76.969956, 89.170074, 74.099961, 89.170074),\n (74.099961, 89.170074, 71.229965, 89.170074),\n (71.229965, 89.170074, 68.35997, 89.170074),\n (68.35997, 89.170074, 65.489975, 89.170074),\n (65.489975, 89.170074, 65.489975, 84.909925),\n (171.329826, 103.170075, 171.329826, 106.04007),\n (171.329826, 106.04007, 171.329826, 108.910065),\n (171.329826, 108.910065, 171.329826, 111.780061),\n (171.329826, 111.780061, 171.329826, 114.650056),\n (171.329826, 114.650056, 171.329826, 117.520051),\n (171.329826, 117.520051, 171.329826, 120.390047),\n (171.329826, 120.390047, 171.329826, 123.260042),\n (171.329826, 123.260042, 171.329826, 126.130037),\n (171.329826, 126.130037, 171.329826, 129.000033),\n (171.329826, 129.000033, 171.329826, 131.870028),\n (171.329826, 131.870028, 171.329826, 134.740023),\n (171.329826, 134.740023, 171.329826, 137.610019),\n (171.329826, 137.610019, 171.329826, 140.480014),\n (171.329826, 140.480014, 171.329826, 143.350009),\n (171.329826, 143.350009, 171.329826, 146.220005),\n (171.329826, 146.220005, 171.329826, 149.09),\n (171.329826, 149.09, 171.329826, 151.959995),\n (171.329826, 151.959995, 171.329826, 154.829991),\n (171.329826, 154.829991, 171.329826, 157.699986),\n (171.329826, 157.699986, 171.329826, 160.569981),\n (171.329826, 160.569981, 171.329826, 163.439977),\n (171.329826, 163.439977, 171.329826, 166.309972),\n (171.329826, 166.309972, 171.329826, 169.179967),\n (171.329826, 169.179967, 171.329826, 172.049963),\n (171.329826, 172.049963, 171.329826, 174.919958),\n (171.329826, 174.919958, 171.329826, 177.789953),\n (171.329826, 177.789953, 171.329826, 180.659949),\n (171.329826, 180.659949, 171.329826, 183.529944),\n (171.329826, 183.529944, 171.329826, 186.399939),\n (171.329826, 186.399939, 171.329826, 189.269935),\n (171.329826, 189.269935, 171.329826, 192.13993),\n (171.329826, 192.13993, 171.329826, 195.009925),\n (175.589975, 103.170075, 175.589975, 106.04007),\n (175.589975, 106.04007, 175.589975, 108.910065),\n (175.589975, 108.910065, 175.589975, 111.780061),\n (175.589975, 111.780061, 175.589975, 114.650056),\n (175.589975, 114.650056, 175.589975, 117.520051),\n (175.589975, 117.520051, 175.589975, 120.390047),\n (175.589975, 120.390047, 175.589975, 123.260042),\n (175.589975, 123.260042, 175.589975, 126.130037),\n (175.589975, 126.130037, 175.589975, 129.000033),\n (175.589975, 129.000033, 175.589975, 131.870028),\n (175.589975, 131.870028, 175.589975, 134.740023),\n (175.589975, 134.740023, 175.589975, 137.610019),\n (175.589975, 137.610019, 175.589975, 140.480014),\n (175.589975, 140.480014, 175.589975, 143.350009),\n (175.589975, 143.350009, 175.589975, 146.220005),\n (175.589975, 146.220005, 175.589975, 149.09),\n (175.589975, 149.09, 175.589975, 151.959995),\n (175.589975, 151.959995, 175.589975, 154.829991),\n (175.589975, 154.829991, 175.589975, 157.699986),\n (175.589975, 157.699986, 175.589975, 160.569981),\n (175.589975, 160.569981, 175.589975, 163.439977),\n (175.589975, 163.439977, 175.589975, 166.309972),\n (175.589975, 166.309972, 175.589975, 169.179967),\n (175.589975, 169.179967, 175.589975, 172.049963),\n (175.589975, 172.049963, 175.589975, 174.919958),\n (175.589975, 174.919958, 175.589975, 177.789953),\n (175.589975, 177.789953, 175.589975, 180.659949),\n (175.589975, 180.659949, 175.589975, 183.529944),\n (175.589975, 183.529944, 175.589975, 186.399939),\n (175.589975, 186.399939, 175.589975, 189.269935),\n (175.589975, 189.269935, 175.589975, 192.13993),\n (175.589975, 192.13993, 175.589975, 195.009925),\n (175.589975, 103.170075, 171.329826, 103.170075),\n (175.589975, 195.009925, 171.329826, 195.009925)\n]\nVISIBLE_CIRCLES = [\n (111.4099, 149.09, 45.919925)\n]\nVISIBLE_ARCS = [\n\n]\nHIDDEN_SEGMENTS = [\n\n]\n# (orient, text, p1, p2, base) for linear; (orient, text, center, radius, angle) for diameter\nDIMENSIONS = [\n ('diameter', '%%c100', (111.4099, 149.09), 45.9199, 45),\n ('horizontal', '4.6387', (171.3299, 149.09), (175.5901, 149.09), (173.46, 160.09))\n]\n\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\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\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,\n angle=(0 if d[0] == \"horizontal\" else 90),\n 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,\n text=text, dimstyle=\"EZDXF\").render()\n\n doc.saveas(out_path)\n\n\nif __name__ == \"__main__\":\n out = sys.argv[1] if len(sys.argv) > 1 else \"0037_00372112_gt.dxf\"\n draw(out)\n print(\"wrote\", out)\n```"}], "images": ["images/0037_00372112.png"], "id": "0037_00372112"} {"messages": [{"role": "user", "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": "assistant", "content": "```python\n#!/usr/bin/env python3\n# -*- coding: utf-8 -*-\n# Ground-truth 2D engineering drawing for part: 0038_00381190\n# Self-contained: reproduces the three-view DXF via ezdxf, NO FreeCAD needed.\n# Coordinates are A4 page millimetres (scale=0.21268032786885335, page=[297.0, 210.0]).\n# visible edges -> solid (layer OUTLINE); hidden edges -> dashed (layer HIDDEN)\n# dimensions -> real movable DIMENSION entities (text = true mm value)\n# Run: python 0038_00381190_gt.py [out.dxf]\nimport sys\nimport ezdxf\n\nSCALE = 0.21268032786885335\nPAGE = [297.0, 210.0]\n\nVISIBLE_SEGMENTS = [\n (104.401016, 67.267016, 103.73639, 67.267016),\n (103.73639, 67.267016, 103.071764, 67.267016),\n (103.071764, 67.267016, 102.407138, 67.267016),\n (102.407138, 67.267016, 101.742512, 67.267016),\n (101.742512, 67.267016, 101.077886, 67.267016),\n (101.077886, 67.267016, 100.41326, 67.267016),\n (100.41326, 67.267016, 99.748634, 67.267016),\n (99.748634, 67.267016, 99.084008, 67.267016),\n (99.084008, 67.267016, 98.419382, 67.267016),\n (98.419382, 67.267016, 97.754756, 67.267016),\n (97.754756, 67.267016, 97.09013, 67.267016),\n (97.09013, 67.267016, 96.425504, 67.267016),\n (96.425504, 67.267016, 95.760878, 67.267016),\n (95.760878, 67.267016, 95.096252, 67.267016),\n (95.096252, 67.267016, 94.431626, 67.267016),\n (94.431626, 67.267016, 93.767, 67.267016),\n (93.767, 67.267016, 93.102374, 67.267016),\n (93.102374, 67.267016, 92.437748, 67.267016),\n (92.437748, 67.267016, 91.773122, 67.267016),\n (91.773122, 67.267016, 91.108496, 67.267016),\n (91.108496, 67.267016, 90.44387, 67.267016),\n (90.44387, 67.267016, 89.779244, 67.267016),\n (89.779244, 67.267016, 89.114618, 67.267016),\n (89.114618, 67.267016, 88.449992, 67.267016),\n (88.449992, 67.267016, 87.785366, 67.267016),\n (87.785366, 67.267016, 87.12074, 67.267016),\n (87.12074, 67.267016, 86.456114, 67.267016),\n (86.456114, 67.267016, 85.791488, 67.267016),\n (85.791488, 67.267016, 85.126862, 67.267016),\n (85.126862, 67.267016, 84.462236, 67.267016),\n (84.462236, 67.267016, 83.79761, 67.267016),\n (83.79761, 67.267016, 83.132984, 67.267016),\n (104.401016, 67.267016, 104.401016, 142.098983),\n (104.401016, 142.098983, 103.73639, 142.098983),\n (103.73639, 142.098983, 103.071764, 142.098983),\n (103.071764, 142.098983, 102.407138, 142.098983),\n (102.407138, 142.098983, 101.742512, 142.098983),\n (101.742512, 142.098983, 101.077886, 142.098983),\n (101.077886, 142.098983, 100.41326, 142.098983),\n (100.41326, 142.098983, 99.748634, 142.098983),\n (99.748634, 142.098983, 99.084008, 142.098983),\n (99.084008, 142.098983, 98.419382, 142.098983),\n (98.419382, 142.098983, 97.754756, 142.098983),\n (97.754756, 142.098983, 97.09013, 142.098983),\n (97.09013, 142.098983, 96.425504, 142.098983),\n (96.425504, 142.098983, 95.760878, 142.098983),\n (95.760878, 142.098983, 95.096252, 142.098983),\n (95.096252, 142.098983, 94.431626, 142.098983),\n (94.431626, 142.098983, 93.767, 142.098983),\n (93.767, 142.098983, 93.102374, 142.098983),\n (93.102374, 142.098983, 92.437748, 142.098983),\n (92.437748, 142.098983, 91.773122, 142.098983),\n (91.773122, 142.098983, 91.108496, 142.098983),\n (91.108496, 142.098983, 90.44387, 142.098983),\n (90.44387, 142.098983, 89.779244, 142.098983),\n (89.779244, 142.098983, 89.114618, 142.098983),\n (89.114618, 142.098983, 88.449992, 142.098983),\n (88.449992, 142.098983, 87.785366, 142.098983),\n (87.785366, 142.098983, 87.12074, 142.098983),\n (87.12074, 142.098983, 86.456114, 142.098983),\n (86.456114, 142.098983, 85.791488, 142.098983),\n (85.791488, 142.098983, 85.126862, 142.098983),\n (85.126862, 142.098983, 84.462236, 142.098983),\n (84.462236, 142.098983, 83.79761, 142.098983),\n (83.79761, 142.098983, 83.132984, 142.098983),\n (83.132984, 142.098983, 83.132984, 67.267016),\n (118.401017, 156.098984, 118.401017, 156.76361),\n (118.401017, 156.76361, 118.401017, 157.428236),\n (118.401017, 157.428236, 118.401017, 158.092862),\n (118.401017, 158.092862, 118.401017, 158.757488),\n (118.401017, 158.757488, 118.401017, 159.422114),\n (118.401017, 159.422114, 118.401017, 160.08674),\n (118.401017, 160.08674, 118.401017, 160.751366),\n (118.401017, 160.751366, 118.401017, 161.415992),\n (118.401017, 161.415992, 118.401017, 162.080618),\n (118.401017, 162.080618, 118.401017, 162.745244),\n (118.401017, 162.745244, 118.401017, 163.40987),\n (118.401017, 163.40987, 118.401017, 164.074496),\n (118.401017, 164.074496, 118.401017, 164.739122),\n (118.401017, 164.739122, 118.401017, 165.403748),\n (118.401017, 165.403748, 118.401017, 166.068374),\n (118.401017, 166.068374, 118.401017, 166.733),\n (118.401017, 166.733, 118.401017, 167.397626),\n (118.401017, 167.397626, 118.401017, 168.062252),\n (118.401017, 168.062252, 118.401017, 168.726878),\n (118.401017, 168.726878, 118.401017, 169.391504),\n (118.401017, 169.391504, 118.401017, 170.05613),\n (118.401017, 170.05613, 118.401017, 170.720756),\n (118.401017, 170.720756, 118.401017, 171.385382),\n (118.401017, 171.385382, 118.401017, 172.050008),\n (118.401017, 172.050008, 118.401017, 172.714634),\n (118.401017, 172.714634, 118.401017, 173.37926),\n (118.401017, 173.37926, 118.401017, 174.043886),\n (118.401017, 174.043886, 118.401017, 174.708512),\n (118.401017, 174.708512, 118.401017, 175.373138),\n (118.401017, 175.373138, 118.401017, 176.037764),\n (118.401017, 176.037764, 118.401017, 176.70239),\n (118.401017, 176.70239, 118.401017, 177.367016),\n (193.232984, 156.098984, 193.232984, 156.76361),\n (193.232984, 156.76361, 193.232984, 157.428236),\n (193.232984, 157.428236, 193.232984, 158.092862),\n (193.232984, 158.092862, 193.232984, 158.757488),\n (193.232984, 158.757488, 193.232984, 159.422114),\n (193.232984, 159.422114, 193.232984, 160.08674),\n (193.232984, 160.08674, 193.232984, 160.751366),\n (193.232984, 160.751366, 193.232984, 161.415992),\n (193.232984, 161.415992, 193.232984, 162.080618),\n (193.232984, 162.080618, 193.232984, 162.745244),\n (193.232984, 162.745244, 193.232984, 163.40987),\n (193.232984, 163.40987, 193.232984, 164.074496),\n (193.232984, 164.074496, 193.232984, 164.739122),\n (193.232984, 164.739122, 193.232984, 165.403748),\n (193.232984, 165.403748, 193.232984, 166.068374),\n (193.232984, 166.068374, 193.232984, 166.733),\n (193.232984, 166.733, 193.232984, 167.397626),\n (193.232984, 167.397626, 193.232984, 168.062252),\n (193.232984, 168.062252, 193.232984, 168.726878),\n (193.232984, 168.726878, 193.232984, 169.391504),\n (193.232984, 169.391504, 193.232984, 170.05613),\n (193.232984, 170.05613, 193.232984, 170.720756),\n (193.232984, 170.720756, 193.232984, 171.385382),\n (193.232984, 171.385382, 193.232984, 172.050008),\n (193.232984, 172.050008, 193.232984, 172.714634),\n (193.232984, 172.714634, 193.232984, 173.37926),\n (193.232984, 173.37926, 193.232984, 174.043886),\n (193.232984, 174.043886, 193.232984, 174.708512),\n (193.232984, 174.708512, 193.232984, 175.373138),\n (193.232984, 175.373138, 193.232984, 176.037764),\n (193.232984, 176.037764, 193.232984, 176.70239),\n (193.232984, 176.70239, 193.232984, 177.367016),\n (193.232984, 156.098984, 118.401017, 156.098984),\n (193.232984, 177.367016, 118.401017, 177.367016)\n]\nVISIBLE_CIRCLES = [\n (93.767, 166.733, 10.634016)\n]\nVISIBLE_ARCS = [\n\n]\nHIDDEN_SEGMENTS = [\n\n]\n# (orient, text, p1, p2, base) for linear; (orient, text, center, radius, angle) for diameter\nDIMENSIONS = [\n ('diameter', '%%c100', (93.767, 166.733), 10.634, 45),\n ('horizontal', '351.852', (118.401, 166.733), (193.233, 166.733), (155.817, 177.733))\n]\n\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\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\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,\n angle=(0 if d[0] == \"horizontal\" else 90),\n 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,\n text=text, dimstyle=\"EZDXF\").render()\n\n doc.saveas(out_path)\n\n\nif __name__ == \"__main__\":\n out = sys.argv[1] if len(sys.argv) > 1 else \"0038_00381190_gt.dxf\"\n draw(out)\n print(\"wrote\", out)\n```"}], "images": ["images/0038_00381190.png"], "id": "0038_00381190"} {"messages": [{"role": "user", "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 55.23 mm."}, {"role": "assistant", "content": "```python\n#!/usr/bin/env python3\n# -*- coding: utf-8 -*-\n# Ground-truth 2D engineering drawing for part: 0038_00381625\n# Self-contained: reproduces the three-view DXF via ezdxf, NO FreeCAD needed.\n# Coordinates are A4 page millimetres (scale=0.6190711610486886, page=[297.0, 210.0]).\n# visible edges -> solid (layer OUTLINE); hidden edges -> dashed (layer HIDDEN)\n# dimensions -> real movable DIMENSION entities (text = true mm value)\n# Run: python 0038_00381625_gt.py [out.dxf]\nimport sys\nimport ezdxf\n\nSCALE = 0.6190711610486886\nPAGE = [297.0, 210.0]\n\nVISIBLE_SEGMENTS = [\n (134.880358, 77.426758, 132.945761, 77.426758),\n (132.945761, 77.426758, 131.011163, 77.426758),\n (131.011163, 77.426758, 129.076566, 77.426758),\n (129.076566, 77.426758, 127.141969, 77.426758),\n (127.141969, 77.426758, 125.207371, 77.426758),\n (125.207371, 77.426758, 123.272774, 77.426758),\n (123.272774, 77.426758, 121.338176, 77.426758),\n (121.338176, 77.426758, 119.403579, 77.426758),\n (119.403579, 77.426758, 117.468982, 77.426758),\n (117.468982, 77.426758, 115.534384, 77.426758),\n (115.534384, 77.426758, 113.599787, 77.426758),\n (113.599787, 77.426758, 111.66519, 77.426758),\n (111.66519, 77.426758, 109.730592, 77.426758),\n (109.730592, 77.426758, 107.795995, 77.426758),\n (107.795995, 77.426758, 105.861397, 77.426758),\n (105.861397, 77.426758, 103.9268, 77.426758),\n (103.9268, 77.426758, 101.992203, 77.426758),\n (101.992203, 77.426758, 100.057605, 77.426758),\n (100.057605, 77.426758, 98.123008, 77.426758),\n (98.123008, 77.426758, 96.18841, 77.426758),\n (96.18841, 77.426758, 94.253813, 77.426758),\n (94.253813, 77.426758, 92.319216, 77.426758),\n (92.319216, 77.426758, 90.384618, 77.426758),\n (90.384618, 77.426758, 88.450021, 77.426758),\n (88.450021, 77.426758, 86.515424, 77.426758),\n (86.515424, 77.426758, 84.580826, 77.426758),\n (84.580826, 77.426758, 82.646229, 77.426758),\n (82.646229, 77.426758, 80.711631, 77.426758),\n (80.711631, 77.426758, 78.777034, 77.426758),\n (78.777034, 77.426758, 76.842437, 77.426758),\n (76.842437, 77.426758, 74.907839, 77.426758),\n (74.907839, 77.426758, 72.973242, 77.426758),\n (134.880358, 77.426758, 134.880358, 111.619642),\n (134.880358, 111.619642, 132.945761, 111.619642),\n (132.945761, 111.619642, 131.011163, 111.619642),\n (131.011163, 111.619642, 129.076566, 111.619642),\n (129.076566, 111.619642, 127.141969, 111.619642),\n (127.141969, 111.619642, 125.207371, 111.619642),\n (125.207371, 111.619642, 123.272774, 111.619642),\n (123.272774, 111.619642, 121.338176, 111.619642),\n (121.338176, 111.619642, 119.403579, 111.619642),\n (119.403579, 111.619642, 117.468982, 111.619642),\n (117.468982, 111.619642, 115.534384, 111.619642),\n (115.534384, 111.619642, 113.599787, 111.619642),\n (113.599787, 111.619642, 111.66519, 111.619642),\n (111.66519, 111.619642, 109.730592, 111.619642),\n (109.730592, 111.619642, 107.795995, 111.619642),\n (107.795995, 111.619642, 105.861397, 111.619642),\n (105.861397, 111.619642, 103.9268, 111.619642),\n (103.9268, 111.619642, 101.992203, 111.619642),\n (101.992203, 111.619642, 100.057605, 111.619642),\n (100.057605, 111.619642, 98.123008, 111.619642),\n (98.123008, 111.619642, 96.18841, 111.619642),\n (96.18841, 111.619642, 94.253813, 111.619642),\n (94.253813, 111.619642, 92.319216, 111.619642),\n (92.319216, 111.619642, 90.384618, 111.619642),\n (90.384618, 111.619642, 88.450021, 111.619642),\n (88.450021, 111.619642, 86.515424, 111.619642),\n (86.515424, 111.619642, 84.580826, 111.619642),\n (84.580826, 111.619642, 82.646229, 111.619642),\n (82.646229, 111.619642, 80.711631, 111.619642),\n (80.711631, 111.619642, 78.777034, 111.619642),\n (78.777034, 111.619642, 76.842437, 111.619642),\n (76.842437, 111.619642, 74.907839, 111.619642),\n (74.907839, 111.619642, 72.973242, 111.619642),\n (72.973242, 111.619642, 72.973242, 77.426758),\n (148.880358, 125.619642, 148.880358, 127.554239),\n (148.880358, 127.554239, 148.880358, 129.488837),\n (148.880358, 129.488837, 148.880358, 131.423434),\n (148.880358, 131.423434, 148.880358, 133.358031),\n (148.880358, 133.358031, 148.880358, 135.292629),\n (148.880358, 135.292629, 148.880358, 137.227226),\n (148.880358, 137.227226, 148.880358, 139.161824),\n (148.880358, 139.161824, 148.880358, 141.096421),\n (148.880358, 141.096421, 148.880358, 143.031018),\n (148.880358, 143.031018, 148.880358, 144.965616),\n (148.880358, 144.965616, 148.880358, 146.900213),\n (148.880358, 146.900213, 148.880358, 148.83481),\n (148.880358, 148.83481, 148.880358, 150.769408),\n (148.880358, 150.769408, 148.880358, 152.704005),\n (148.880358, 152.704005, 148.880358, 154.638603),\n (148.880358, 154.638603, 148.880358, 156.5732),\n (148.880358, 156.5732, 148.880358, 158.507797),\n (148.880358, 158.507797, 148.880358, 160.442395),\n (148.880358, 160.442395, 148.880358, 162.376992),\n (148.880358, 162.376992, 148.880358, 164.31159),\n (148.880358, 164.31159, 148.880358, 166.246187),\n (148.880358, 166.246187, 148.880358, 168.180784),\n (148.880358, 168.180784, 148.880358, 170.115382),\n (148.880358, 170.115382, 148.880358, 172.049979),\n (148.880358, 172.049979, 148.880358, 173.984576),\n (148.880358, 173.984576, 148.880358, 175.919174),\n (148.880358, 175.919174, 148.880358, 177.853771),\n (148.880358, 177.853771, 148.880358, 179.788369),\n (148.880358, 179.788369, 148.880358, 181.722966),\n (148.880358, 181.722966, 148.880358, 183.657563),\n (148.880358, 183.657563, 148.880358, 185.592161),\n (148.880358, 185.592161, 148.880358, 187.526758),\n (183.073242, 125.619642, 183.073242, 127.554239),\n (183.073242, 127.554239, 183.073242, 129.488837),\n (183.073242, 129.488837, 183.073242, 131.423434),\n (183.073242, 131.423434, 183.073242, 133.358031),\n (183.073242, 133.358031, 183.073242, 135.292629),\n (183.073242, 135.292629, 183.073242, 137.227226),\n (183.073242, 137.227226, 183.073242, 139.161824),\n (183.073242, 139.161824, 183.073242, 141.096421),\n (183.073242, 141.096421, 183.073242, 143.031018),\n (183.073242, 143.031018, 183.073242, 144.965616),\n (183.073242, 144.965616, 183.073242, 146.900213),\n (183.073242, 146.900213, 183.073242, 148.83481),\n (183.073242, 148.83481, 183.073242, 150.769408),\n (183.073242, 150.769408, 183.073242, 152.704005),\n (183.073242, 152.704005, 183.073242, 154.638603),\n (183.073242, 154.638603, 183.073242, 156.5732),\n (183.073242, 156.5732, 183.073242, 158.507797),\n (183.073242, 158.507797, 183.073242, 160.442395),\n (183.073242, 160.442395, 183.073242, 162.376992),\n (183.073242, 162.376992, 183.073242, 164.31159),\n (183.073242, 164.31159, 183.073242, 166.246187),\n (183.073242, 166.246187, 183.073242, 168.180784),\n (183.073242, 168.180784, 183.073242, 170.115382),\n (183.073242, 170.115382, 183.073242, 172.049979),\n (183.073242, 172.049979, 183.073242, 173.984576),\n (183.073242, 173.984576, 183.073242, 175.919174),\n (183.073242, 175.919174, 183.073242, 177.853771),\n (183.073242, 177.853771, 183.073242, 179.788369),\n (183.073242, 179.788369, 183.073242, 181.722966),\n (183.073242, 181.722966, 183.073242, 183.657563),\n (183.073242, 183.657563, 183.073242, 185.592161),\n (183.073242, 185.592161, 183.073242, 187.526758),\n (183.073242, 125.619642, 148.880358, 125.619642),\n (183.073242, 187.526758, 148.880358, 187.526758)\n]\nVISIBLE_CIRCLES = [\n (103.9268, 156.5732, 30.953558)\n]\nVISIBLE_ARCS = [\n\n]\nHIDDEN_SEGMENTS = [\n\n]\n# (orient, text, p1, p2, base) for linear; (orient, text, center, radius, angle) for diameter\nDIMENSIONS = [\n ('diameter', '%%c100', (103.9268, 156.5732), 30.9536, 45),\n ('horizontal', '55.2326', (148.8803, 156.5732), (183.0732, 156.5732), (165.9768, 167.5732))\n]\n\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\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\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,\n angle=(0 if d[0] == \"horizontal\" else 90),\n 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,\n text=text, dimstyle=\"EZDXF\").render()\n\n doc.saveas(out_path)\n\n\nif __name__ == \"__main__\":\n out = sys.argv[1] if len(sys.argv) > 1 else \"0038_00381625_gt.dxf\"\n draw(out)\n print(\"wrote\", out)\n```"}], "images": ["images/0038_00381625.png"], "id": "0038_00381625"} {"messages": [{"role": "user", "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 148.44 mm."}, {"role": "assistant", "content": "```python\n#!/usr/bin/env python3\n# -*- coding: utf-8 -*-\n# Ground-truth 2D engineering drawing for part: 0039_00396091\n# Self-contained: reproduces the three-view DXF via ezdxf, NO FreeCAD needed.\n# Coordinates are A4 page millimetres (scale=0.38681761006289306, page=[297.0, 210.0]).\n# visible edges -> solid (layer OUTLINE); hidden edges -> dashed (layer HIDDEN)\n# dimensions -> real movable DIMENSION entities (text = true mm value)\n# Run: python 0039_00396091_gt.py [out.dxf]\nimport sys\nimport ezdxf\n\nSCALE = 0.38681761006289306\nPAGE = [297.0, 210.0]\n\nVISIBLE_SEGMENTS = [\n (117.461281, 71.62048, 116.252475, 71.62048),\n (116.252475, 71.62048, 115.04367, 71.62048),\n (115.04367, 71.62048, 113.834865, 71.62048),\n (113.834865, 71.62048, 112.62606, 71.62048),\n (112.62606, 71.62048, 111.417255, 71.62048),\n (111.417255, 71.62048, 110.20845, 71.62048),\n (110.20845, 71.62048, 108.999645, 71.62048),\n (108.999645, 71.62048, 107.79084, 71.62048),\n (107.79084, 71.62048, 106.582035, 71.62048),\n (106.582035, 71.62048, 105.37323, 71.62048),\n (105.37323, 71.62048, 104.164425, 71.62048),\n (104.164425, 71.62048, 102.95562, 71.62048),\n (102.95562, 71.62048, 101.746815, 71.62048),\n (101.746815, 71.62048, 100.53801, 71.62048),\n (100.53801, 71.62048, 99.329205, 71.62048),\n (99.329205, 71.62048, 98.1204, 71.62048),\n (98.1204, 71.62048, 96.911595, 71.62048),\n (96.911595, 71.62048, 95.70279, 71.62048),\n (95.70279, 71.62048, 94.493985, 71.62048),\n (94.493985, 71.62048, 93.28518, 71.62048),\n (93.28518, 71.62048, 92.076375, 71.62048),\n (92.076375, 71.62048, 90.86757, 71.62048),\n (90.86757, 71.62048, 89.658765, 71.62048),\n (89.658765, 71.62048, 88.44996, 71.62048),\n (88.44996, 71.62048, 87.241155, 71.62048),\n (87.241155, 71.62048, 86.03235, 71.62048),\n (86.03235, 71.62048, 84.823545, 71.62048),\n (84.823545, 71.62048, 83.61474, 71.62048),\n (83.61474, 71.62048, 82.405935, 71.62048),\n (82.405935, 71.62048, 81.19713, 71.62048),\n (81.19713, 71.62048, 79.988325, 71.62048),\n (79.988325, 71.62048, 78.779519, 71.62048),\n (117.461281, 71.62048, 117.461281, 129.038719),\n (117.461281, 129.038719, 116.252475, 129.038719),\n (116.252475, 129.038719, 115.04367, 129.038719),\n (115.04367, 129.038719, 113.834865, 129.038719),\n (113.834865, 129.038719, 112.62606, 129.038719),\n (112.62606, 129.038719, 111.417255, 129.038719),\n (111.417255, 129.038719, 110.20845, 129.038719),\n (110.20845, 129.038719, 108.999645, 129.038719),\n (108.999645, 129.038719, 107.79084, 129.038719),\n (107.79084, 129.038719, 106.582035, 129.038719),\n (106.582035, 129.038719, 105.37323, 129.038719),\n (105.37323, 129.038719, 104.164425, 129.038719),\n (104.164425, 129.038719, 102.95562, 129.038719),\n (102.95562, 129.038719, 101.746815, 129.038719),\n (101.746815, 129.038719, 100.53801, 129.038719),\n (100.53801, 129.038719, 99.329205, 129.038719),\n (99.329205, 129.038719, 98.1204, 129.038719),\n (98.1204, 129.038719, 96.911595, 129.038719),\n (96.911595, 129.038719, 95.70279, 129.038719),\n (95.70279, 129.038719, 94.493985, 129.038719),\n (94.493985, 129.038719, 93.28518, 129.038719),\n (93.28518, 129.038719, 92.076375, 129.038719),\n (92.076375, 129.038719, 90.86757, 129.038719),\n (90.86757, 129.038719, 89.658765, 129.038719),\n (89.658765, 129.038719, 88.44996, 129.038719),\n (88.44996, 129.038719, 87.241155, 129.038719),\n (87.241155, 129.038719, 86.03235, 129.038719),\n (86.03235, 129.038719, 84.823545, 129.038719),\n (84.823545, 129.038719, 83.61474, 129.038719),\n (83.61474, 129.038719, 82.405935, 129.038719),\n (82.405935, 129.038719, 81.19713, 129.038719),\n (81.19713, 129.038719, 79.988325, 129.038719),\n (79.988325, 129.038719, 78.779519, 129.038719),\n (78.779519, 129.038719, 78.779519, 71.62048),\n (131.461281, 143.038719, 131.461281, 144.247525),\n (131.461281, 144.247525, 131.461281, 145.45633),\n (131.461281, 145.45633, 131.461281, 146.665135),\n (131.461281, 146.665135, 131.461281, 147.87394),\n (131.461281, 147.87394, 131.461281, 149.082745),\n (131.461281, 149.082745, 131.461281, 150.29155),\n (131.461281, 150.29155, 131.461281, 151.500355),\n (131.461281, 151.500355, 131.461281, 152.70916),\n (131.461281, 152.70916, 131.461281, 153.917965),\n (131.461281, 153.917965, 131.461281, 155.12677),\n (131.461281, 155.12677, 131.461281, 156.335575),\n (131.461281, 156.335575, 131.461281, 157.54438),\n (131.461281, 157.54438, 131.461281, 158.753185),\n (131.461281, 158.753185, 131.461281, 159.96199),\n (131.461281, 159.96199, 131.461281, 161.170795),\n (131.461281, 161.170795, 131.461281, 162.3796),\n (131.461281, 162.3796, 131.461281, 163.588405),\n (131.461281, 163.588405, 131.461281, 164.79721),\n (131.461281, 164.79721, 131.461281, 166.006015),\n (131.461281, 166.006015, 131.461281, 167.21482),\n (131.461281, 167.21482, 131.461281, 168.423625),\n (131.461281, 168.423625, 131.461281, 169.63243),\n (131.461281, 169.63243, 131.461281, 170.841235),\n (131.461281, 170.841235, 131.461281, 172.05004),\n (131.461281, 172.05004, 131.461281, 173.258845),\n (131.461281, 173.258845, 131.461281, 174.46765),\n (131.461281, 174.46765, 131.461281, 175.676455),\n (131.461281, 175.676455, 131.461281, 176.88526),\n (131.461281, 176.88526, 131.461281, 178.094065),\n (131.461281, 178.094065, 131.461281, 179.30287),\n (131.461281, 179.30287, 131.461281, 180.511675),\n (131.461281, 180.511675, 131.461281, 181.720481),\n (188.87952, 143.038719, 188.87952, 144.247525),\n (188.87952, 144.247525, 188.87952, 145.45633),\n (188.87952, 145.45633, 188.87952, 146.665135),\n (188.87952, 146.665135, 188.87952, 147.87394),\n (188.87952, 147.87394, 188.87952, 149.082745),\n (188.87952, 149.082745, 188.87952, 150.29155),\n (188.87952, 150.29155, 188.87952, 151.500355),\n (188.87952, 151.500355, 188.87952, 152.70916),\n (188.87952, 152.70916, 188.87952, 153.917965),\n (188.87952, 153.917965, 188.87952, 155.12677),\n (188.87952, 155.12677, 188.87952, 156.335575),\n (188.87952, 156.335575, 188.87952, 157.54438),\n (188.87952, 157.54438, 188.87952, 158.753185),\n (188.87952, 158.753185, 188.87952, 159.96199),\n (188.87952, 159.96199, 188.87952, 161.170795),\n (188.87952, 161.170795, 188.87952, 162.3796),\n (188.87952, 162.3796, 188.87952, 163.588405),\n (188.87952, 163.588405, 188.87952, 164.79721),\n (188.87952, 164.79721, 188.87952, 166.006015),\n (188.87952, 166.006015, 188.87952, 167.21482),\n (188.87952, 167.21482, 188.87952, 168.423625),\n (188.87952, 168.423625, 188.87952, 169.63243),\n (188.87952, 169.63243, 188.87952, 170.841235),\n (188.87952, 170.841235, 188.87952, 172.05004),\n (188.87952, 172.05004, 188.87952, 173.258845),\n (188.87952, 173.258845, 188.87952, 174.46765),\n (188.87952, 174.46765, 188.87952, 175.676455),\n (188.87952, 175.676455, 188.87952, 176.88526),\n (188.87952, 176.88526, 188.87952, 178.094065),\n (188.87952, 178.094065, 188.87952, 179.30287),\n (188.87952, 179.30287, 188.87952, 180.511675),\n (188.87952, 180.511675, 188.87952, 181.720481),\n (188.87952, 143.038719, 131.461281, 143.038719),\n (188.87952, 181.720481, 131.461281, 181.720481)\n]\nVISIBLE_CIRCLES = [\n (98.1204, 162.3796, 19.340881)\n]\nVISIBLE_ARCS = [\n\n]\nHIDDEN_SEGMENTS = [\n\n]\n# (orient, text, p1, p2, base) for linear; (orient, text, center, radius, angle) for diameter\nDIMENSIONS = [\n ('diameter', '%%c100', (98.1204, 162.3796), 19.3409, 45),\n ('horizontal', '148.438', (131.4613, 162.3796), (188.8796, 162.3796), (160.1704, 173.3796))\n]\n\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\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\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,\n angle=(0 if d[0] == \"horizontal\" else 90),\n 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,\n text=text, dimstyle=\"EZDXF\").render()\n\n doc.saveas(out_path)\n\n\nif __name__ == \"__main__\":\n out = sys.argv[1] if len(sys.argv) > 1 else \"0039_00396091_gt.dxf\"\n draw(out)\n print(\"wrote\", out)\n```"}], "images": ["images/0039_00396091.png"], "id": "0039_00396091"} {"messages": [{"role": "user", "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 65.97 mm."}, {"role": "assistant", "content": "```python\n#!/usr/bin/env python3\n# -*- coding: utf-8 -*-\n# Ground-truth 2D engineering drawing for part: 0040_00402850\n# Self-contained: reproduces the three-view DXF via ezdxf, NO FreeCAD needed.\n# Coordinates are A4 page millimetres (scale=0.5790125523012629, page=[297.0, 210.0]).\n# visible edges -> solid (layer OUTLINE); hidden edges -> dashed (layer HIDDEN)\n# dimensions -> real movable DIMENSION entities (text = true mm value)\n# Run: python 0040_00402850_gt.py [out.dxf]\nimport sys\nimport ezdxf\n\nSCALE = 0.5790125523012629\nPAGE = [297.0, 210.0]\n\nVISIBLE_SEGMENTS = [\n (73.974672, 114.624072, 75.784087, 114.624072),\n (75.784087, 114.624072, 77.593501, 114.624072),\n (77.593501, 114.624072, 79.402915, 114.624072),\n (79.402915, 114.624072, 81.212329, 114.624072),\n (81.212329, 114.624072, 83.021744, 114.624072),\n (83.021744, 114.624072, 84.831158, 114.624072),\n (84.831158, 114.624072, 86.640572, 114.624072),\n (86.640572, 114.624072, 88.449986, 114.624072),\n (88.449986, 114.624072, 90.2594, 114.624072),\n (90.2594, 114.624072, 92.068815, 114.624072),\n (92.068815, 114.624072, 93.878229, 114.624072),\n (93.878229, 114.624072, 95.687643, 114.624072),\n (95.687643, 114.624072, 97.497057, 114.624072),\n (97.497057, 114.624072, 99.306472, 114.624072),\n (99.306472, 114.624072, 101.115886, 114.624072),\n (101.115886, 114.624072, 102.9253, 114.624072),\n (102.9253, 114.624072, 104.734714, 114.624072),\n (104.734714, 114.624072, 106.544128, 114.624072),\n (106.544128, 114.624072, 108.353543, 114.624072),\n (108.353543, 114.624072, 110.162957, 114.624072),\n (110.162957, 114.624072, 111.972371, 114.624072),\n (111.972371, 114.624072, 113.781785, 114.624072),\n (113.781785, 114.624072, 115.5912, 114.624072),\n (115.5912, 114.624072, 117.400614, 114.624072),\n (117.400614, 114.624072, 119.210028, 114.624072),\n (119.210028, 114.624072, 121.019442, 114.624072),\n (121.019442, 114.624072, 122.828856, 114.624072),\n (122.828856, 114.624072, 124.638271, 114.624072),\n (124.638271, 114.624072, 126.447685, 114.624072),\n (126.447685, 114.624072, 128.257099, 114.624072),\n (128.257099, 114.624072, 130.066513, 114.624072),\n (130.066513, 114.624072, 131.875928, 114.624072),\n (131.875928, 114.624072, 131.875928, 76.425327),\n (73.974672, 76.425327, 75.784087, 76.425327),\n (75.784087, 76.425327, 77.593501, 76.425327),\n (77.593501, 76.425327, 79.402915, 76.425327),\n (79.402915, 76.425327, 81.212329, 76.425327),\n (81.212329, 76.425327, 83.021744, 76.425327),\n (83.021744, 76.425327, 84.831158, 76.425327),\n (84.831158, 76.425327, 86.640572, 76.425327),\n (86.640572, 76.425327, 88.449986, 76.425327),\n (88.449986, 76.425327, 90.2594, 76.425327),\n (90.2594, 76.425327, 92.068815, 76.425327),\n (92.068815, 76.425327, 93.878229, 76.425327),\n (93.878229, 76.425327, 95.687643, 76.425327),\n (95.687643, 76.425327, 97.497057, 76.425327),\n (97.497057, 76.425327, 99.306472, 76.425327),\n (99.306472, 76.425327, 101.115886, 76.425327),\n (101.115886, 76.425327, 102.9253, 76.425327),\n (102.9253, 76.425327, 104.734714, 76.425327),\n (104.734714, 76.425327, 106.544128, 76.425327),\n (106.544128, 76.425327, 108.353543, 76.425327),\n (108.353543, 76.425327, 110.162957, 76.425327),\n (110.162957, 76.425327, 111.972371, 76.425327),\n (111.972371, 76.425327, 113.781785, 76.425327),\n (113.781785, 76.425327, 115.5912, 76.425327),\n (115.5912, 76.425327, 117.400614, 76.425327),\n (117.400614, 76.425327, 119.210028, 76.425327),\n (119.210028, 76.425327, 121.019442, 76.425327),\n (121.019442, 76.425327, 122.828856, 76.425327),\n (122.828856, 76.425327, 124.638271, 76.425327),\n (124.638271, 76.425327, 126.447685, 76.425327),\n (126.447685, 76.425327, 128.257099, 76.425327),\n (128.257099, 76.425327, 130.066513, 76.425327),\n (130.066513, 76.425327, 131.875928, 76.425327),\n (73.974672, 76.425327, 73.974672, 114.624072),\n (184.074673, 186.525328, 184.074673, 184.715913),\n (184.074673, 184.715913, 184.074673, 182.906499),\n (184.074673, 182.906499, 184.074673, 181.097085),\n (184.074673, 181.097085, 184.074673, 179.287671),\n (184.074673, 179.287671, 184.074673, 177.478256),\n (184.074673, 177.478256, 184.074673, 175.668842),\n (184.074673, 175.668842, 184.074673, 173.859428),\n (184.074673, 173.859428, 184.074673, 172.050014),\n (184.074673, 172.050014, 184.074673, 170.2406),\n (184.074673, 170.2406, 184.074673, 168.431185),\n (184.074673, 168.431185, 184.074673, 166.621771),\n (184.074673, 166.621771, 184.074673, 164.812357),\n (184.074673, 164.812357, 184.074673, 163.002943),\n (184.074673, 163.002943, 184.074673, 161.193528),\n (184.074673, 161.193528, 184.074673, 159.384114),\n (184.074673, 159.384114, 184.074673, 157.5747),\n (184.074673, 157.5747, 184.074673, 155.765286),\n (184.074673, 155.765286, 184.074673, 153.955872),\n (184.074673, 153.955872, 184.074673, 152.146457),\n (184.074673, 152.146457, 184.074673, 150.337043),\n (184.074673, 150.337043, 184.074673, 148.527629),\n (184.074673, 148.527629, 184.074673, 146.718215),\n (184.074673, 146.718215, 184.074673, 144.9088),\n (184.074673, 144.9088, 184.074673, 143.099386),\n (184.074673, 143.099386, 184.074673, 141.289972),\n (184.074673, 141.289972, 184.074673, 139.480558),\n (184.074673, 139.480558, 184.074673, 137.671144),\n (184.074673, 137.671144, 184.074673, 135.861729),\n (184.074673, 135.861729, 184.074673, 134.052315),\n (184.074673, 134.052315, 184.074673, 132.242901),\n (184.074673, 132.242901, 184.074673, 130.433487),\n (184.074673, 130.433487, 184.074673, 128.624072),\n (145.875928, 186.525328, 145.875928, 184.715913),\n (145.875928, 184.715913, 145.875928, 182.906499),\n (145.875928, 182.906499, 145.875928, 181.097085),\n (145.875928, 181.097085, 145.875928, 179.287671),\n (145.875928, 179.287671, 145.875928, 177.478256),\n (145.875928, 177.478256, 145.875928, 175.668842),\n (145.875928, 175.668842, 145.875928, 173.859428),\n (145.875928, 173.859428, 145.875928, 172.050014),\n (145.875928, 172.050014, 145.875928, 170.2406),\n (145.875928, 170.2406, 145.875928, 168.431185),\n (145.875928, 168.431185, 145.875928, 166.621771),\n (145.875928, 166.621771, 145.875928, 164.812357),\n (145.875928, 164.812357, 145.875928, 163.002943),\n (145.875928, 163.002943, 145.875928, 161.193528),\n (145.875928, 161.193528, 145.875928, 159.384114),\n (145.875928, 159.384114, 145.875928, 157.5747),\n (145.875928, 157.5747, 145.875928, 155.765286),\n (145.875928, 155.765286, 145.875928, 153.955872),\n (145.875928, 153.955872, 145.875928, 152.146457),\n (145.875928, 152.146457, 145.875928, 150.337043),\n (145.875928, 150.337043, 145.875928, 148.527629),\n (145.875928, 148.527629, 145.875928, 146.718215),\n (145.875928, 146.718215, 145.875928, 144.9088),\n (145.875928, 144.9088, 145.875928, 143.099386),\n (145.875928, 143.099386, 145.875928, 141.289972),\n (145.875928, 141.289972, 145.875928, 139.480558),\n (145.875928, 139.480558, 145.875928, 137.671144),\n (145.875928, 137.671144, 145.875928, 135.861729),\n (145.875928, 135.861729, 145.875928, 134.052315),\n (145.875928, 134.052315, 145.875928, 132.242901),\n (145.875928, 132.242901, 145.875928, 130.433487),\n (145.875928, 130.433487, 145.875928, 128.624072),\n (145.875928, 186.525328, 184.074673, 186.525328),\n (145.875928, 128.624072, 184.074673, 128.624072)\n]\nVISIBLE_CIRCLES = [\n (102.9253, 157.5747, 28.950628)\n]\nVISIBLE_ARCS = [\n\n]\nHIDDEN_SEGMENTS = [\n\n]\n# (orient, text, p1, p2, base) for linear; (orient, text, center, radius, angle) for diameter\nDIMENSIONS = [\n ('diameter', '%%c100', (102.9253, 157.5747), 28.9506, 45),\n ('horizontal', '65.9722', (184.0747, 157.5747), (145.876, 157.5747), (164.9753, 146.5747))\n]\n\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\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\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,\n angle=(0 if d[0] == \"horizontal\" else 90),\n 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,\n text=text, dimstyle=\"EZDXF\").render()\n\n doc.saveas(out_path)\n\n\nif __name__ == \"__main__\":\n out = sys.argv[1] if len(sys.argv) > 1 else \"0040_00402850_gt.dxf\"\n draw(out)\n print(\"wrote\", out)\n```"}], "images": ["images/0040_00402850.png"], "id": "0040_00402850"} {"messages": [{"role": "user", "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 678.57 mm."}, {"role": "assistant", "content": "```python\n#!/usr/bin/env python3\n# -*- coding: utf-8 -*-\n# Ground-truth 2D engineering drawing for part: 0044_00444173\n# Self-contained: reproduces the three-view DXF via ezdxf, NO FreeCAD needed.\n# Coordinates are A4 page millimetres (scale=0.1234311926605518, page=[297.0, 210.0]).\n# visible edges -> solid (layer OUTLINE); hidden edges -> dashed (layer HIDDEN)\n# dimensions -> real movable DIMENSION entities (text = true mm value)\n# Run: python 0044_00444173_gt.py [out.dxf]\nimport sys\nimport ezdxf\n\nSCALE = 0.1234311926605518\nPAGE = [297.0, 210.0]\n\nVISIBLE_SEGMENTS = [\n (97.70736, 65.035759, 97.321637, 65.035759),\n (97.321637, 65.035759, 96.935915, 65.035759),\n (96.935915, 65.035759, 96.550192, 65.035759),\n (96.550192, 65.035759, 96.16447, 65.035759),\n (96.16447, 65.035759, 95.778747, 65.035759),\n (95.778747, 65.035759, 95.393025, 65.035759),\n (95.393025, 65.035759, 95.007302, 65.035759),\n (95.007302, 65.035759, 94.62158, 65.035759),\n (94.62158, 65.035759, 94.235857, 65.035759),\n (94.235857, 65.035759, 93.850135, 65.035759),\n (93.850135, 65.035759, 93.464412, 65.035759),\n (93.464412, 65.035759, 93.07869, 65.035759),\n (93.07869, 65.035759, 92.692967, 65.035759),\n (92.692967, 65.035759, 92.307245, 65.035759),\n (92.307245, 65.035759, 91.921522, 65.035759),\n (91.921522, 65.035759, 91.5358, 65.035759),\n (91.5358, 65.035759, 91.150078, 65.035759),\n (91.150078, 65.035759, 90.764355, 65.035759),\n (90.764355, 65.035759, 90.378633, 65.035759),\n (90.378633, 65.035759, 89.99291, 65.035759),\n (89.99291, 65.035759, 89.607188, 65.035759),\n (89.607188, 65.035759, 89.221465, 65.035759),\n (89.221465, 65.035759, 88.835743, 65.035759),\n (88.835743, 65.035759, 88.45002, 65.035759),\n (88.45002, 65.035759, 88.064298, 65.035759),\n (88.064298, 65.035759, 87.678575, 65.035759),\n (87.678575, 65.035759, 87.292853, 65.035759),\n (87.292853, 65.035759, 86.90713, 65.035759),\n (86.90713, 65.035759, 86.521408, 65.035759),\n (86.521408, 65.035759, 86.135685, 65.035759),\n (86.135685, 65.035759, 85.749963, 65.035759),\n (85.749963, 65.035759, 85.36424, 65.035759),\n (97.70736, 65.035759, 97.70736, 148.79264),\n (97.70736, 148.79264, 97.321637, 148.79264),\n (97.321637, 148.79264, 96.935915, 148.79264),\n (96.935915, 148.79264, 96.550192, 148.79264),\n (96.550192, 148.79264, 96.16447, 148.79264),\n (96.16447, 148.79264, 95.778747, 148.79264),\n (95.778747, 148.79264, 95.393025, 148.79264),\n (95.393025, 148.79264, 95.007302, 148.79264),\n (95.007302, 148.79264, 94.62158, 148.79264),\n (94.62158, 148.79264, 94.235857, 148.79264),\n (94.235857, 148.79264, 93.850135, 148.79264),\n (93.850135, 148.79264, 93.464412, 148.79264),\n (93.464412, 148.79264, 93.07869, 148.79264),\n (93.07869, 148.79264, 92.692967, 148.79264),\n (92.692967, 148.79264, 92.307245, 148.79264),\n (92.307245, 148.79264, 91.921522, 148.79264),\n (91.921522, 148.79264, 91.5358, 148.79264),\n (91.5358, 148.79264, 91.150078, 148.79264),\n (91.150078, 148.79264, 90.764355, 148.79264),\n (90.764355, 148.79264, 90.378633, 148.79264),\n (90.378633, 148.79264, 89.99291, 148.79264),\n (89.99291, 148.79264, 89.607188, 148.79264),\n (89.607188, 148.79264, 89.221465, 148.79264),\n (89.221465, 148.79264, 88.835743, 148.79264),\n (88.835743, 148.79264, 88.45002, 148.79264),\n (88.45002, 148.79264, 88.064298, 148.79264),\n (88.064298, 148.79264, 87.678575, 148.79264),\n (87.678575, 148.79264, 87.292853, 148.79264),\n (87.292853, 148.79264, 86.90713, 148.79264),\n (86.90713, 148.79264, 86.521408, 148.79264),\n (86.521408, 148.79264, 86.135685, 148.79264),\n (86.135685, 148.79264, 85.749963, 148.79264),\n (85.749963, 148.79264, 85.36424, 148.79264),\n (85.36424, 148.79264, 85.36424, 65.035759),\n (111.70736, 162.79264, 111.70736, 163.178363),\n (111.70736, 163.178363, 111.70736, 163.564085),\n (111.70736, 163.564085, 111.70736, 163.949808),\n (111.70736, 163.949808, 111.70736, 164.33553),\n (111.70736, 164.33553, 111.70736, 164.721253),\n (111.70736, 164.721253, 111.70736, 165.106975),\n (111.70736, 165.106975, 111.70736, 165.492698),\n (111.70736, 165.492698, 111.70736, 165.87842),\n (111.70736, 165.87842, 111.70736, 166.264143),\n (111.70736, 166.264143, 111.70736, 166.649865),\n (111.70736, 166.649865, 111.70736, 167.035588),\n (111.70736, 167.035588, 111.70736, 167.42131),\n (111.70736, 167.42131, 111.70736, 167.807033),\n (111.70736, 167.807033, 111.70736, 168.192755),\n (111.70736, 168.192755, 111.70736, 168.578478),\n (111.70736, 168.578478, 111.70736, 168.9642),\n (111.70736, 168.9642, 111.70736, 169.349922),\n (111.70736, 169.349922, 111.70736, 169.735645),\n (111.70736, 169.735645, 111.70736, 170.121367),\n (111.70736, 170.121367, 111.70736, 170.50709),\n (111.70736, 170.50709, 111.70736, 170.892812),\n (111.70736, 170.892812, 111.70736, 171.278535),\n (111.70736, 171.278535, 111.70736, 171.664257),\n (111.70736, 171.664257, 111.70736, 172.04998),\n (111.70736, 172.04998, 111.70736, 172.435702),\n (111.70736, 172.435702, 111.70736, 172.821425),\n (111.70736, 172.821425, 111.70736, 173.207147),\n (111.70736, 173.207147, 111.70736, 173.59287),\n (111.70736, 173.59287, 111.70736, 173.978592),\n (111.70736, 173.978592, 111.70736, 174.364315),\n (111.70736, 174.364315, 111.70736, 174.750037),\n (111.70736, 174.750037, 111.70736, 175.13576),\n (195.464241, 162.79264, 195.464241, 163.178363),\n (195.464241, 163.178363, 195.464241, 163.564085),\n (195.464241, 163.564085, 195.464241, 163.949808),\n (195.464241, 163.949808, 195.464241, 164.33553),\n (195.464241, 164.33553, 195.464241, 164.721253),\n (195.464241, 164.721253, 195.464241, 165.106975),\n (195.464241, 165.106975, 195.464241, 165.492698),\n (195.464241, 165.492698, 195.464241, 165.87842),\n (195.464241, 165.87842, 195.464241, 166.264143),\n (195.464241, 166.264143, 195.464241, 166.649865),\n (195.464241, 166.649865, 195.464241, 167.035588),\n (195.464241, 167.035588, 195.464241, 167.42131),\n (195.464241, 167.42131, 195.464241, 167.807033),\n (195.464241, 167.807033, 195.464241, 168.192755),\n (195.464241, 168.192755, 195.464241, 168.578478),\n (195.464241, 168.578478, 195.464241, 168.9642),\n (195.464241, 168.9642, 195.464241, 169.349922),\n (195.464241, 169.349922, 195.464241, 169.735645),\n (195.464241, 169.735645, 195.464241, 170.121367),\n (195.464241, 170.121367, 195.464241, 170.50709),\n (195.464241, 170.50709, 195.464241, 170.892812),\n (195.464241, 170.892812, 195.464241, 171.278535),\n (195.464241, 171.278535, 195.464241, 171.664257),\n (195.464241, 171.664257, 195.464241, 172.04998),\n (195.464241, 172.04998, 195.464241, 172.435702),\n (195.464241, 172.435702, 195.464241, 172.821425),\n (195.464241, 172.821425, 195.464241, 173.207147),\n (195.464241, 173.207147, 195.464241, 173.59287),\n (195.464241, 173.59287, 195.464241, 173.978592),\n (195.464241, 173.978592, 195.464241, 174.364315),\n (195.464241, 174.364315, 195.464241, 174.750037),\n (195.464241, 174.750037, 195.464241, 175.13576),\n (195.464241, 162.79264, 111.70736, 162.79264),\n (195.464241, 175.13576, 111.70736, 175.13576)\n]\nVISIBLE_CIRCLES = [\n (91.5358, 168.9642, 6.17156)\n]\nVISIBLE_ARCS = [\n\n]\nHIDDEN_SEGMENTS = [\n\n]\n# (orient, text, p1, p2, base) for linear; (orient, text, center, radius, angle) for diameter\nDIMENSIONS = [\n ('diameter', '%%c100', (91.5358, 168.9642), 6.1716, 45),\n ('horizontal', '678.571', (111.7073, 168.9642), (195.4642, 168.9642), (153.5858, 179.9642))\n]\n\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\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\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,\n angle=(0 if d[0] == \"horizontal\" else 90),\n 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,\n text=text, dimstyle=\"EZDXF\").render()\n\n doc.saveas(out_path)\n\n\nif __name__ == \"__main__\":\n out = sys.argv[1] if len(sys.argv) > 1 else \"0044_00444173_gt.dxf\"\n draw(out)\n print(\"wrote\", out)\n```"}], "images": ["images/0044_00444173.png"], "id": "0044_00444173"} {"messages": [{"role": "user", "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": "assistant", "content": "```python\n#!/usr/bin/env python3\n# -*- coding: utf-8 -*-\n# Ground-truth 2D engineering drawing for part: 0046_00460499\n# Self-contained: reproduces the three-view DXF via ezdxf, NO FreeCAD needed.\n# Coordinates are A4 page millimetres (scale=0.1938151260504488, page=[297.0, 210.0]).\n# visible edges -> solid (layer OUTLINE); hidden edges -> dashed (layer HIDDEN)\n# dimensions -> real movable DIMENSION entities (text = true mm value)\n# Run: python 0046_00460499_gt.py [out.dxf]\nimport sys\nimport ezdxf\n\nSCALE = 0.1938151260504488\nPAGE = [297.0, 210.0]\n\nVISIBLE_SEGMENTS = [\n (102.986156, 105.1546, 102.986156, 66.795356),\n (83.604644, 66.795356, 84.210316, 66.795356),\n (84.210316, 66.795356, 84.815988, 66.795356),\n (84.815988, 66.795356, 85.421661, 66.795356),\n (85.421661, 66.795356, 86.027333, 66.795356),\n (86.027333, 66.795356, 86.633005, 66.795356),\n (86.633005, 66.795356, 87.238677, 66.795356),\n (87.238677, 66.795356, 87.84435, 66.795356),\n (87.84435, 66.795356, 88.450022, 66.795356),\n (88.450022, 66.795356, 89.055694, 66.795356),\n (89.055694, 66.795356, 89.661366, 66.795356),\n (89.661366, 66.795356, 90.267039, 66.795356),\n (90.267039, 66.795356, 90.872711, 66.795356),\n (90.872711, 66.795356, 91.478383, 66.795356),\n (91.478383, 66.795356, 92.084055, 66.795356),\n (92.084055, 66.795356, 92.689728, 66.795356),\n (92.689728, 66.795356, 93.2954, 66.795356),\n (93.2954, 66.795356, 93.901072, 66.795356),\n (93.901072, 66.795356, 94.506745, 66.795356),\n (94.506745, 66.795356, 95.112417, 66.795356),\n (95.112417, 66.795356, 95.718089, 66.795356),\n (95.718089, 66.795356, 96.323761, 66.795356),\n (96.323761, 66.795356, 96.929434, 66.795356),\n (96.929434, 66.795356, 97.535106, 66.795356),\n (97.535106, 66.795356, 98.140778, 66.795356),\n (98.140778, 66.795356, 98.74645, 66.795356),\n (98.74645, 66.795356, 99.352123, 66.795356),\n (99.352123, 66.795356, 99.957795, 66.795356),\n (99.957795, 66.795356, 100.563467, 66.795356),\n (100.563467, 66.795356, 101.169139, 66.795356),\n (101.169139, 66.795356, 101.774812, 66.795356),\n (101.774812, 66.795356, 102.380484, 66.795356),\n (102.380484, 66.795356, 102.986156, 66.795356),\n (102.986156, 105.1546, 102.986156, 143.513843),\n (83.604644, 143.513843, 84.210316, 143.513843),\n (84.210316, 143.513843, 84.815988, 143.513843),\n (84.815988, 143.513843, 85.421661, 143.513843),\n (85.421661, 143.513843, 86.027333, 143.513843),\n (86.027333, 143.513843, 86.633005, 143.513843),\n (86.633005, 143.513843, 87.238677, 143.513843),\n (87.238677, 143.513843, 87.84435, 143.513843),\n (87.84435, 143.513843, 88.450022, 143.513843),\n (88.450022, 143.513843, 89.055694, 143.513843),\n (89.055694, 143.513843, 89.661366, 143.513843),\n (89.661366, 143.513843, 90.267039, 143.513843),\n (90.267039, 143.513843, 90.872711, 143.513843),\n (90.872711, 143.513843, 91.478383, 143.513843),\n (91.478383, 143.513843, 92.084055, 143.513843),\n (92.084055, 143.513843, 92.689728, 143.513843),\n (92.689728, 143.513843, 93.2954, 143.513843),\n (93.2954, 143.513843, 93.901072, 143.513843),\n (93.901072, 143.513843, 94.506745, 143.513843),\n (94.506745, 143.513843, 95.112417, 143.513843),\n (95.112417, 143.513843, 95.718089, 143.513843),\n (95.718089, 143.513843, 96.323761, 143.513843),\n (96.323761, 143.513843, 96.929434, 143.513843),\n (96.929434, 143.513843, 97.535106, 143.513843),\n (97.535106, 143.513843, 98.140778, 143.513843),\n (98.140778, 143.513843, 98.74645, 143.513843),\n (98.74645, 143.513843, 99.352123, 143.513843),\n (99.352123, 143.513843, 99.957795, 143.513843),\n (99.957795, 143.513843, 100.563467, 143.513843),\n (100.563467, 143.513843, 101.169139, 143.513843),\n (101.169139, 143.513843, 101.774812, 143.513843),\n (101.774812, 143.513843, 102.380484, 143.513843),\n (102.380484, 143.513843, 102.986156, 143.513843),\n (83.604644, 66.795356, 83.604644, 105.1546),\n (83.604644, 143.513843, 83.604644, 105.1546),\n (116.986157, 176.895356, 116.986157, 176.289684),\n (116.986157, 176.289684, 116.986157, 175.684012),\n (116.986157, 175.684012, 116.986157, 175.078339),\n (116.986157, 175.078339, 116.986157, 174.472667),\n (116.986157, 174.472667, 116.986157, 173.866995),\n (116.986157, 173.866995, 116.986157, 173.261323),\n (116.986157, 173.261323, 116.986157, 172.65565),\n (116.986157, 172.65565, 116.986157, 172.049978),\n (116.986157, 172.049978, 116.986157, 171.444306),\n (116.986157, 171.444306, 116.986157, 170.838634),\n (116.986157, 170.838634, 116.986157, 170.232961),\n (116.986157, 170.232961, 116.986157, 169.627289),\n (116.986157, 169.627289, 116.986157, 169.021617),\n (116.986157, 169.021617, 116.986157, 168.415945),\n (116.986157, 168.415945, 116.986157, 167.810272),\n (116.986157, 167.810272, 116.986157, 167.2046),\n (116.986157, 167.2046, 116.986157, 166.598928),\n (116.986157, 166.598928, 116.986157, 165.993255),\n (116.986157, 165.993255, 116.986157, 165.387583),\n (116.986157, 165.387583, 116.986157, 164.781911),\n (116.986157, 164.781911, 116.986157, 164.176239),\n (116.986157, 164.176239, 116.986157, 163.570566),\n (116.986157, 163.570566, 116.986157, 162.964894),\n (116.986157, 162.964894, 116.986157, 162.359222),\n (116.986157, 162.359222, 116.986157, 161.75355),\n (116.986157, 161.75355, 116.986157, 161.147877),\n (116.986157, 161.147877, 116.986157, 160.542205),\n (116.986157, 160.542205, 116.986157, 159.936533),\n (116.986157, 159.936533, 116.986157, 159.330861),\n (116.986157, 159.330861, 116.986157, 158.725188),\n (116.986157, 158.725188, 116.986157, 158.119516),\n (116.986157, 158.119516, 116.986157, 157.513844),\n (193.704644, 176.895356, 193.704644, 176.289684),\n (193.704644, 176.289684, 193.704644, 175.684012),\n (193.704644, 175.684012, 193.704644, 175.078339),\n (193.704644, 175.078339, 193.704644, 174.472667),\n (193.704644, 174.472667, 193.704644, 173.866995),\n (193.704644, 173.866995, 193.704644, 173.261323),\n (193.704644, 173.261323, 193.704644, 172.65565),\n (193.704644, 172.65565, 193.704644, 172.049978),\n (193.704644, 172.049978, 193.704644, 171.444306),\n (193.704644, 171.444306, 193.704644, 170.838634),\n (193.704644, 170.838634, 193.704644, 170.232961),\n (193.704644, 170.232961, 193.704644, 169.627289),\n (193.704644, 169.627289, 193.704644, 169.021617),\n (193.704644, 169.021617, 193.704644, 168.415945),\n (193.704644, 168.415945, 193.704644, 167.810272),\n (193.704644, 167.810272, 193.704644, 167.2046),\n (193.704644, 167.2046, 193.704644, 166.598928),\n (193.704644, 166.598928, 193.704644, 165.993255),\n (193.704644, 165.993255, 193.704644, 165.387583),\n (193.704644, 165.387583, 193.704644, 164.781911),\n (193.704644, 164.781911, 193.704644, 164.176239),\n (193.704644, 164.176239, 193.704644, 163.570566),\n (193.704644, 163.570566, 193.704644, 162.964894),\n (193.704644, 162.964894, 193.704644, 162.359222),\n (193.704644, 162.359222, 193.704644, 161.75355),\n (193.704644, 161.75355, 193.704644, 161.147877),\n (193.704644, 161.147877, 193.704644, 160.542205),\n (193.704644, 160.542205, 193.704644, 159.936533),\n (193.704644, 159.936533, 193.704644, 159.330861),\n (193.704644, 159.330861, 193.704644, 158.725188),\n (193.704644, 158.725188, 193.704644, 158.119516),\n (193.704644, 158.119516, 193.704644, 157.513844),\n (116.986157, 176.895356, 155.3454, 176.895356),\n (116.986157, 157.513844, 155.3454, 157.513844),\n (193.704644, 157.513844, 155.3454, 157.513844),\n (193.704644, 176.895356, 155.3454, 176.895356)\n]\nVISIBLE_CIRCLES = [\n (93.2954, 167.2046, 9.690756)\n]\nVISIBLE_ARCS = [\n\n]\nHIDDEN_SEGMENTS = [\n\n]\n# (orient, text, p1, p2, base) for linear; (orient, text, center, radius, angle) for diameter\nDIMENSIONS = [\n ('diameter', '%%c100', (93.2954, 167.2046), 9.6908, 45),\n ('horizontal', '395.833', (193.7046, 167.2046), (116.9861, 167.2046), (155.3454, 156.2046))\n]\n\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\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\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,\n angle=(0 if d[0] == \"horizontal\" else 90),\n 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,\n text=text, dimstyle=\"EZDXF\").render()\n\n doc.saveas(out_path)\n\n\nif __name__ == \"__main__\":\n out = sys.argv[1] if len(sys.argv) > 1 else \"0046_00460499_gt.dxf\"\n draw(out)\n print(\"wrote\", out)\n```"}], "images": ["images/0046_00460499.png"], "id": "0046_00460499"} {"messages": [{"role": "user", "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": "assistant", "content": "```python\n#!/usr/bin/env python3\n# -*- coding: utf-8 -*-\n# Ground-truth 2D engineering drawing for part: 0047_00470950\n# Self-contained: reproduces the three-view DXF via ezdxf, NO FreeCAD needed.\n# Coordinates are A4 page millimetres (scale=0.18731355932203736, page=[297.0, 210.0]).\n# visible edges -> solid (layer OUTLINE); hidden edges -> dashed (layer HIDDEN)\n# dimensions -> real movable DIMENSION entities (text = true mm value)\n# Run: python 0047_00470950_gt.py [out.dxf]\nimport sys\nimport ezdxf\n\nSCALE = 0.18731355932203736\nPAGE = [297.0, 210.0]\n\nVISIBLE_SEGMENTS = [\n (83.767122, 144.001522, 84.352477, 144.001522),\n (84.352477, 144.001522, 84.937832, 144.001522),\n (84.937832, 144.001522, 85.523187, 144.001522),\n (85.523187, 144.001522, 86.108542, 144.001522),\n (86.108542, 144.001522, 86.693896, 144.001522),\n (86.693896, 144.001522, 87.279251, 144.001522),\n (87.279251, 144.001522, 87.864606, 144.001522),\n (87.864606, 144.001522, 88.449961, 144.001522),\n (88.449961, 144.001522, 89.035316, 144.001522),\n (89.035316, 144.001522, 89.620671, 144.001522),\n (89.620671, 144.001522, 90.206026, 144.001522),\n (90.206026, 144.001522, 90.791381, 144.001522),\n (90.791381, 144.001522, 91.376735, 144.001522),\n (91.376735, 144.001522, 91.96209, 144.001522),\n (91.96209, 144.001522, 92.547445, 144.001522),\n (92.547445, 144.001522, 93.1328, 144.001522),\n (93.1328, 144.001522, 93.718155, 144.001522),\n (93.718155, 144.001522, 94.30351, 144.001522),\n (94.30351, 144.001522, 94.888865, 144.001522),\n (94.888865, 144.001522, 95.474219, 144.001522),\n (95.474219, 144.001522, 96.059574, 144.001522),\n (96.059574, 144.001522, 96.644929, 144.001522),\n (96.644929, 144.001522, 97.230284, 144.001522),\n (97.230284, 144.001522, 97.815639, 144.001522),\n (97.815639, 144.001522, 98.400994, 144.001522),\n (98.400994, 144.001522, 98.986349, 144.001522),\n (98.986349, 144.001522, 99.571704, 144.001522),\n (99.571704, 144.001522, 100.157058, 144.001522),\n (100.157058, 144.001522, 100.742413, 144.001522),\n (100.742413, 144.001522, 101.327768, 144.001522),\n (101.327768, 144.001522, 101.913123, 144.001522),\n (101.913123, 144.001522, 102.498478, 144.001522),\n (102.498478, 144.001522, 102.498478, 66.632878),\n (83.767122, 66.632878, 84.352477, 66.632878),\n (84.352477, 66.632878, 84.937832, 66.632878),\n (84.937832, 66.632878, 85.523187, 66.632878),\n (85.523187, 66.632878, 86.108542, 66.632878),\n (86.108542, 66.632878, 86.693896, 66.632878),\n (86.693896, 66.632878, 87.279251, 66.632878),\n (87.279251, 66.632878, 87.864606, 66.632878),\n (87.864606, 66.632878, 88.449961, 66.632878),\n (88.449961, 66.632878, 89.035316, 66.632878),\n (89.035316, 66.632878, 89.620671, 66.632878),\n (89.620671, 66.632878, 90.206026, 66.632878),\n (90.206026, 66.632878, 90.791381, 66.632878),\n (90.791381, 66.632878, 91.376735, 66.632878),\n (91.376735, 66.632878, 91.96209, 66.632878),\n (91.96209, 66.632878, 92.547445, 66.632878),\n (92.547445, 66.632878, 93.1328, 66.632878),\n (93.1328, 66.632878, 93.718155, 66.632878),\n (93.718155, 66.632878, 94.30351, 66.632878),\n (94.30351, 66.632878, 94.888865, 66.632878),\n (94.888865, 66.632878, 95.474219, 66.632878),\n (95.474219, 66.632878, 96.059574, 66.632878),\n (96.059574, 66.632878, 96.644929, 66.632878),\n (96.644929, 66.632878, 97.230284, 66.632878),\n (97.230284, 66.632878, 97.815639, 66.632878),\n (97.815639, 66.632878, 98.400994, 66.632878),\n (98.400994, 66.632878, 98.986349, 66.632878),\n (98.986349, 66.632878, 99.571704, 66.632878),\n (99.571704, 66.632878, 100.157058, 66.632878),\n (100.157058, 66.632878, 100.742413, 66.632878),\n (100.742413, 66.632878, 101.327768, 66.632878),\n (101.327768, 66.632878, 101.913123, 66.632878),\n (101.913123, 66.632878, 102.498478, 66.632878),\n (83.767122, 144.001522, 83.767122, 66.632878),\n (193.867122, 176.732878, 193.867122, 176.147523),\n (193.867122, 176.147523, 193.867122, 175.562168),\n (193.867122, 175.562168, 193.867122, 174.976813),\n (193.867122, 174.976813, 193.867122, 174.391458),\n (193.867122, 174.391458, 193.867122, 173.806104),\n (193.867122, 173.806104, 193.867122, 173.220749),\n (193.867122, 173.220749, 193.867122, 172.635394),\n (193.867122, 172.635394, 193.867122, 172.050039),\n (193.867122, 172.050039, 193.867122, 171.464684),\n (193.867122, 171.464684, 193.867122, 170.879329),\n (193.867122, 170.879329, 193.867122, 170.293974),\n (193.867122, 170.293974, 193.867122, 169.708619),\n (193.867122, 169.708619, 193.867122, 169.123265),\n (193.867122, 169.123265, 193.867122, 168.53791),\n (193.867122, 168.53791, 193.867122, 167.952555),\n (193.867122, 167.952555, 193.867122, 167.3672),\n (193.867122, 167.3672, 193.867122, 166.781845),\n (193.867122, 166.781845, 193.867122, 166.19649),\n (193.867122, 166.19649, 193.867122, 165.611135),\n (193.867122, 165.611135, 193.867122, 165.025781),\n (193.867122, 165.025781, 193.867122, 164.440426),\n (193.867122, 164.440426, 193.867122, 163.855071),\n (193.867122, 163.855071, 193.867122, 163.269716),\n (193.867122, 163.269716, 193.867122, 162.684361),\n (193.867122, 162.684361, 193.867122, 162.099006),\n (193.867122, 162.099006, 193.867122, 161.513651),\n (193.867122, 161.513651, 193.867122, 160.928296),\n (193.867122, 160.928296, 193.867122, 160.342942),\n (193.867122, 160.342942, 193.867122, 159.757587),\n (193.867122, 159.757587, 193.867122, 159.172232),\n (193.867122, 159.172232, 193.867122, 158.586877),\n (193.867122, 158.586877, 193.867122, 158.001522),\n (116.498478, 176.732878, 116.498478, 176.147523),\n (116.498478, 176.147523, 116.498478, 175.562168),\n (116.498478, 175.562168, 116.498478, 174.976813),\n (116.498478, 174.976813, 116.498478, 174.391458),\n (116.498478, 174.391458, 116.498478, 173.806104),\n (116.498478, 173.806104, 116.498478, 173.220749),\n (116.498478, 173.220749, 116.498478, 172.635394),\n (116.498478, 172.635394, 116.498478, 172.050039),\n (116.498478, 172.050039, 116.498478, 171.464684),\n (116.498478, 171.464684, 116.498478, 170.879329),\n (116.498478, 170.879329, 116.498478, 170.293974),\n (116.498478, 170.293974, 116.498478, 169.708619),\n (116.498478, 169.708619, 116.498478, 169.123265),\n (116.498478, 169.123265, 116.498478, 168.53791),\n (116.498478, 168.53791, 116.498478, 167.952555),\n (116.498478, 167.952555, 116.498478, 167.3672),\n (116.498478, 167.3672, 116.498478, 166.781845),\n (116.498478, 166.781845, 116.498478, 166.19649),\n (116.498478, 166.19649, 116.498478, 165.611135),\n (116.498478, 165.611135, 116.498478, 165.025781),\n (116.498478, 165.025781, 116.498478, 164.440426),\n (116.498478, 164.440426, 116.498478, 163.855071),\n (116.498478, 163.855071, 116.498478, 163.269716),\n (116.498478, 163.269716, 116.498478, 162.684361),\n (116.498478, 162.684361, 116.498478, 162.099006),\n (116.498478, 162.099006, 116.498478, 161.513651),\n (116.498478, 161.513651, 116.498478, 160.928296),\n (116.498478, 160.928296, 116.498478, 160.342942),\n (116.498478, 160.342942, 116.498478, 159.757587),\n (116.498478, 159.757587, 116.498478, 159.172232),\n (116.498478, 159.172232, 116.498478, 158.586877),\n (116.498478, 158.586877, 116.498478, 158.001522),\n (193.867122, 158.001522, 116.498478, 158.001522),\n (193.867122, 176.732878, 116.498478, 176.732878)\n]\nVISIBLE_CIRCLES = [\n (93.1328, 167.3672, 9.365678)\n]\nVISIBLE_ARCS = [\n\n]\nHIDDEN_SEGMENTS = [\n\n]\n# (orient, text, p1, p2, base) for linear; (orient, text, center, radius, angle) for diameter\nDIMENSIONS = [\n ('diameter', '%%c100', (93.1328, 167.3672), 9.3657, 45),\n ('horizontal', '413.043', (116.4985, 167.3672), (193.8672, 167.3672), (155.1828, 178.3672))\n]\n\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\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\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,\n angle=(0 if d[0] == \"horizontal\" else 90),\n 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,\n text=text, dimstyle=\"EZDXF\").render()\n\n doc.saveas(out_path)\n\n\nif __name__ == \"__main__\":\n out = sys.argv[1] if len(sys.argv) > 1 else \"0047_00470950_gt.dxf\"\n draw(out)\n print(\"wrote\", out)\n```"}], "images": ["images/0047_00470950.png"], "id": "0047_00470950"} {"messages": [{"role": "user", "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": "assistant", "content": "```python\n#!/usr/bin/env python3\n# -*- coding: utf-8 -*-\n# Ground-truth 2D engineering drawing for part: 0047_00477777\n# Self-contained: reproduces the three-view DXF via ezdxf, NO FreeCAD needed.\n# Coordinates are A4 page millimetres (scale=0.18731355932203736, page=[297.0, 210.0]).\n# visible edges -> solid (layer OUTLINE); hidden edges -> dashed (layer HIDDEN)\n# dimensions -> real movable DIMENSION entities (text = true mm value)\n# Run: python 0047_00477777_gt.py [out.dxf]\nimport sys\nimport ezdxf\n\nSCALE = 0.18731355932203736\nPAGE = [297.0, 210.0]\n\nVISIBLE_SEGMENTS = [\n (83.767122, 144.001522, 84.352477, 144.001522),\n (84.352477, 144.001522, 84.937832, 144.001522),\n (84.937832, 144.001522, 85.523187, 144.001522),\n (85.523187, 144.001522, 86.108542, 144.001522),\n (86.108542, 144.001522, 86.693896, 144.001522),\n (86.693896, 144.001522, 87.279251, 144.001522),\n (87.279251, 144.001522, 87.864606, 144.001522),\n (87.864606, 144.001522, 88.449961, 144.001522),\n (88.449961, 144.001522, 89.035316, 144.001522),\n (89.035316, 144.001522, 89.620671, 144.001522),\n (89.620671, 144.001522, 90.206026, 144.001522),\n (90.206026, 144.001522, 90.791381, 144.001522),\n (90.791381, 144.001522, 91.376735, 144.001522),\n (91.376735, 144.001522, 91.96209, 144.001522),\n (91.96209, 144.001522, 92.547445, 144.001522),\n (92.547445, 144.001522, 93.1328, 144.001522),\n (93.1328, 144.001522, 93.718155, 144.001522),\n (93.718155, 144.001522, 94.30351, 144.001522),\n (94.30351, 144.001522, 94.888865, 144.001522),\n (94.888865, 144.001522, 95.474219, 144.001522),\n (95.474219, 144.001522, 96.059574, 144.001522),\n (96.059574, 144.001522, 96.644929, 144.001522),\n (96.644929, 144.001522, 97.230284, 144.001522),\n (97.230284, 144.001522, 97.815639, 144.001522),\n (97.815639, 144.001522, 98.400994, 144.001522),\n (98.400994, 144.001522, 98.986349, 144.001522),\n (98.986349, 144.001522, 99.571704, 144.001522),\n (99.571704, 144.001522, 100.157058, 144.001522),\n (100.157058, 144.001522, 100.742413, 144.001522),\n (100.742413, 144.001522, 101.327768, 144.001522),\n (101.327768, 144.001522, 101.913123, 144.001522),\n (101.913123, 144.001522, 102.498478, 144.001522),\n (102.498478, 144.001522, 102.498478, 66.632878),\n (83.767122, 66.632878, 84.352477, 66.632878),\n (84.352477, 66.632878, 84.937832, 66.632878),\n (84.937832, 66.632878, 85.523187, 66.632878),\n (85.523187, 66.632878, 86.108542, 66.632878),\n (86.108542, 66.632878, 86.693896, 66.632878),\n (86.693896, 66.632878, 87.279251, 66.632878),\n (87.279251, 66.632878, 87.864606, 66.632878),\n (87.864606, 66.632878, 88.449961, 66.632878),\n (88.449961, 66.632878, 89.035316, 66.632878),\n (89.035316, 66.632878, 89.620671, 66.632878),\n (89.620671, 66.632878, 90.206026, 66.632878),\n (90.206026, 66.632878, 90.791381, 66.632878),\n (90.791381, 66.632878, 91.376735, 66.632878),\n (91.376735, 66.632878, 91.96209, 66.632878),\n (91.96209, 66.632878, 92.547445, 66.632878),\n (92.547445, 66.632878, 93.1328, 66.632878),\n (93.1328, 66.632878, 93.718155, 66.632878),\n (93.718155, 66.632878, 94.30351, 66.632878),\n (94.30351, 66.632878, 94.888865, 66.632878),\n (94.888865, 66.632878, 95.474219, 66.632878),\n (95.474219, 66.632878, 96.059574, 66.632878),\n (96.059574, 66.632878, 96.644929, 66.632878),\n (96.644929, 66.632878, 97.230284, 66.632878),\n (97.230284, 66.632878, 97.815639, 66.632878),\n (97.815639, 66.632878, 98.400994, 66.632878),\n (98.400994, 66.632878, 98.986349, 66.632878),\n (98.986349, 66.632878, 99.571704, 66.632878),\n (99.571704, 66.632878, 100.157058, 66.632878),\n (100.157058, 66.632878, 100.742413, 66.632878),\n (100.742413, 66.632878, 101.327768, 66.632878),\n (101.327768, 66.632878, 101.913123, 66.632878),\n (101.913123, 66.632878, 102.498478, 66.632878),\n (83.767122, 144.001522, 83.767122, 66.632878),\n (193.867122, 176.732878, 193.867122, 176.147523),\n (193.867122, 176.147523, 193.867122, 175.562168),\n (193.867122, 175.562168, 193.867122, 174.976813),\n (193.867122, 174.976813, 193.867122, 174.391458),\n (193.867122, 174.391458, 193.867122, 173.806104),\n (193.867122, 173.806104, 193.867122, 173.220749),\n (193.867122, 173.220749, 193.867122, 172.635394),\n (193.867122, 172.635394, 193.867122, 172.050039),\n (193.867122, 172.050039, 193.867122, 171.464684),\n (193.867122, 171.464684, 193.867122, 170.879329),\n (193.867122, 170.879329, 193.867122, 170.293974),\n (193.867122, 170.293974, 193.867122, 169.708619),\n (193.867122, 169.708619, 193.867122, 169.123265),\n (193.867122, 169.123265, 193.867122, 168.53791),\n (193.867122, 168.53791, 193.867122, 167.952555),\n (193.867122, 167.952555, 193.867122, 167.3672),\n (193.867122, 167.3672, 193.867122, 166.781845),\n (193.867122, 166.781845, 193.867122, 166.19649),\n (193.867122, 166.19649, 193.867122, 165.611135),\n (193.867122, 165.611135, 193.867122, 165.025781),\n (193.867122, 165.025781, 193.867122, 164.440426),\n (193.867122, 164.440426, 193.867122, 163.855071),\n (193.867122, 163.855071, 193.867122, 163.269716),\n (193.867122, 163.269716, 193.867122, 162.684361),\n (193.867122, 162.684361, 193.867122, 162.099006),\n (193.867122, 162.099006, 193.867122, 161.513651),\n (193.867122, 161.513651, 193.867122, 160.928296),\n (193.867122, 160.928296, 193.867122, 160.342942),\n (193.867122, 160.342942, 193.867122, 159.757587),\n (193.867122, 159.757587, 193.867122, 159.172232),\n (193.867122, 159.172232, 193.867122, 158.586877),\n (193.867122, 158.586877, 193.867122, 158.001522),\n (116.498478, 176.732878, 116.498478, 176.147523),\n (116.498478, 176.147523, 116.498478, 175.562168),\n (116.498478, 175.562168, 116.498478, 174.976813),\n (116.498478, 174.976813, 116.498478, 174.391458),\n (116.498478, 174.391458, 116.498478, 173.806104),\n (116.498478, 173.806104, 116.498478, 173.220749),\n (116.498478, 173.220749, 116.498478, 172.635394),\n (116.498478, 172.635394, 116.498478, 172.050039),\n (116.498478, 172.050039, 116.498478, 171.464684),\n (116.498478, 171.464684, 116.498478, 170.879329),\n (116.498478, 170.879329, 116.498478, 170.293974),\n (116.498478, 170.293974, 116.498478, 169.708619),\n (116.498478, 169.708619, 116.498478, 169.123265),\n (116.498478, 169.123265, 116.498478, 168.53791),\n (116.498478, 168.53791, 116.498478, 167.952555),\n (116.498478, 167.952555, 116.498478, 167.3672),\n (116.498478, 167.3672, 116.498478, 166.781845),\n (116.498478, 166.781845, 116.498478, 166.19649),\n (116.498478, 166.19649, 116.498478, 165.611135),\n (116.498478, 165.611135, 116.498478, 165.025781),\n (116.498478, 165.025781, 116.498478, 164.440426),\n (116.498478, 164.440426, 116.498478, 163.855071),\n (116.498478, 163.855071, 116.498478, 163.269716),\n (116.498478, 163.269716, 116.498478, 162.684361),\n (116.498478, 162.684361, 116.498478, 162.099006),\n (116.498478, 162.099006, 116.498478, 161.513651),\n (116.498478, 161.513651, 116.498478, 160.928296),\n (116.498478, 160.928296, 116.498478, 160.342942),\n (116.498478, 160.342942, 116.498478, 159.757587),\n (116.498478, 159.757587, 116.498478, 159.172232),\n (116.498478, 159.172232, 116.498478, 158.586877),\n (116.498478, 158.586877, 116.498478, 158.001522),\n (193.867122, 158.001522, 116.498478, 158.001522),\n (193.867122, 176.732878, 116.498478, 176.732878)\n]\nVISIBLE_CIRCLES = [\n (93.1328, 167.3672, 9.365678)\n]\nVISIBLE_ARCS = [\n\n]\nHIDDEN_SEGMENTS = [\n\n]\n# (orient, text, p1, p2, base) for linear; (orient, text, center, radius, angle) for diameter\nDIMENSIONS = [\n ('diameter', '%%c100', (93.1328, 167.3672), 9.3657, 45),\n ('horizontal', '413.043', (116.4985, 167.3672), (193.8672, 167.3672), (155.1828, 178.3672))\n]\n\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\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\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,\n angle=(0 if d[0] == \"horizontal\" else 90),\n 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,\n text=text, dimstyle=\"EZDXF\").render()\n\n doc.saveas(out_path)\n\n\nif __name__ == \"__main__\":\n out = sys.argv[1] if len(sys.argv) > 1 else \"0047_00477777_gt.dxf\"\n draw(out)\n print(\"wrote\", out)\n```"}], "images": ["images/0047_00477777.png"], "id": "0047_00477777"} {"messages": [{"role": "user", "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": "assistant", "content": "```python\n#!/usr/bin/env python3\n# -*- coding: utf-8 -*-\n# Ground-truth 2D engineering drawing for part: 0048_00483793\n# Self-contained: reproduces the three-view DXF via ezdxf, NO FreeCAD needed.\n# Coordinates are A4 page millimetres (scale=0.1905780590717436, page=[297.0, 210.0]).\n# visible edges -> solid (layer OUTLINE); hidden edges -> dashed (layer HIDDEN)\n# dimensions -> real movable DIMENSION entities (text = true mm value)\n# Run: python 0048_00483793_gt.py [out.dxf]\nimport sys\nimport ezdxf\n\nSCALE = 0.1905780590717436\nPAGE = [297.0, 210.0]\n\nVISIBLE_SEGMENTS = [\n (83.685497, 143.756597, 84.281053, 143.756597),\n (84.281053, 143.756597, 84.87661, 143.756597),\n (84.87661, 143.756597, 85.472166, 143.756597),\n (85.472166, 143.756597, 86.067723, 143.756597),\n (86.067723, 143.756597, 86.663279, 143.756597),\n (86.663279, 143.756597, 87.258836, 143.756597),\n (87.258836, 143.756597, 87.854392, 143.756597),\n (87.854392, 143.756597, 88.449949, 143.756597),\n (88.449949, 143.756597, 89.045505, 143.756597),\n (89.045505, 143.756597, 89.641061, 143.756597),\n (89.641061, 143.756597, 90.236618, 143.756597),\n (90.236618, 143.756597, 90.832174, 143.756597),\n (90.832174, 143.756597, 91.427731, 143.756597),\n (91.427731, 143.756597, 92.023287, 143.756597),\n (92.023287, 143.756597, 92.618844, 143.756597),\n (92.618844, 143.756597, 93.2144, 143.756597),\n (93.2144, 143.756597, 93.809956, 143.756597),\n (93.809956, 143.756597, 94.405513, 143.756597),\n (94.405513, 143.756597, 95.001069, 143.756597),\n (95.001069, 143.756597, 95.596626, 143.756597),\n (95.596626, 143.756597, 96.192182, 143.756597),\n (96.192182, 143.756597, 96.787739, 143.756597),\n (96.787739, 143.756597, 97.383295, 143.756597),\n (97.383295, 143.756597, 97.978851, 143.756597),\n (97.978851, 143.756597, 98.574408, 143.756597),\n (98.574408, 143.756597, 99.169964, 143.756597),\n (99.169964, 143.756597, 99.765521, 143.756597),\n (99.765521, 143.756597, 100.361077, 143.756597),\n (100.361077, 143.756597, 100.956634, 143.756597),\n (100.956634, 143.756597, 101.55219, 143.756597),\n (101.55219, 143.756597, 102.147747, 143.756597),\n (102.147747, 143.756597, 102.743303, 143.756597),\n (102.743303, 143.756597, 102.743303, 66.714403),\n (83.685497, 66.714403, 84.281053, 66.714403),\n (84.281053, 66.714403, 84.87661, 66.714403),\n (84.87661, 66.714403, 85.472166, 66.714403),\n (85.472166, 66.714403, 86.067723, 66.714403),\n (86.067723, 66.714403, 86.663279, 66.714403),\n (86.663279, 66.714403, 87.258836, 66.714403),\n (87.258836, 66.714403, 87.854392, 66.714403),\n (87.854392, 66.714403, 88.449949, 66.714403),\n (88.449949, 66.714403, 89.045505, 66.714403),\n (89.045505, 66.714403, 89.641061, 66.714403),\n (89.641061, 66.714403, 90.236618, 66.714403),\n (90.236618, 66.714403, 90.832174, 66.714403),\n (90.832174, 66.714403, 91.427731, 66.714403),\n (91.427731, 66.714403, 92.023287, 66.714403),\n (92.023287, 66.714403, 92.618844, 66.714403),\n (92.618844, 66.714403, 93.2144, 66.714403),\n (93.2144, 66.714403, 93.809956, 66.714403),\n (93.809956, 66.714403, 94.405513, 66.714403),\n (94.405513, 66.714403, 95.001069, 66.714403),\n (95.001069, 66.714403, 95.596626, 66.714403),\n (95.596626, 66.714403, 96.192182, 66.714403),\n (96.192182, 66.714403, 96.787739, 66.714403),\n (96.787739, 66.714403, 97.383295, 66.714403),\n (97.383295, 66.714403, 97.978851, 66.714403),\n (97.978851, 66.714403, 98.574408, 66.714403),\n (98.574408, 66.714403, 99.169964, 66.714403),\n (99.169964, 66.714403, 99.765521, 66.714403),\n (99.765521, 66.714403, 100.361077, 66.714403),\n (100.361077, 66.714403, 100.956634, 66.714403),\n (100.956634, 66.714403, 101.55219, 66.714403),\n (101.55219, 66.714403, 102.147747, 66.714403),\n (102.147747, 66.714403, 102.743303, 66.714403),\n (83.685497, 66.714403, 83.685497, 143.756597),\n (193.785497, 176.814403, 193.785497, 176.218847),\n (193.785497, 176.218847, 193.785497, 175.62329),\n (193.785497, 175.62329, 193.785497, 175.027734),\n (193.785497, 175.027734, 193.785497, 174.432177),\n (193.785497, 174.432177, 193.785497, 173.836621),\n (193.785497, 173.836621, 193.785497, 173.241064),\n (193.785497, 173.241064, 193.785497, 172.645508),\n (193.785497, 172.645508, 193.785497, 172.049951),\n (193.785497, 172.049951, 193.785497, 171.454395),\n (193.785497, 171.454395, 193.785497, 170.858839),\n (193.785497, 170.858839, 193.785497, 170.263282),\n (193.785497, 170.263282, 193.785497, 169.667726),\n (193.785497, 169.667726, 193.785497, 169.072169),\n (193.785497, 169.072169, 193.785497, 168.476613),\n (193.785497, 168.476613, 193.785497, 167.881056),\n (193.785497, 167.881056, 193.785497, 167.2855),\n (193.785497, 167.2855, 193.785497, 166.689944),\n (193.785497, 166.689944, 193.785497, 166.094387),\n (193.785497, 166.094387, 193.785497, 165.498831),\n (193.785497, 165.498831, 193.785497, 164.903274),\n (193.785497, 164.903274, 193.785497, 164.307718),\n (193.785497, 164.307718, 193.785497, 163.712161),\n (193.785497, 163.712161, 193.785497, 163.116605),\n (193.785497, 163.116605, 193.785497, 162.521049),\n (193.785497, 162.521049, 193.785497, 161.925492),\n (193.785497, 161.925492, 193.785497, 161.329936),\n (193.785497, 161.329936, 193.785497, 160.734379),\n (193.785497, 160.734379, 193.785497, 160.138823),\n (193.785497, 160.138823, 193.785497, 159.543266),\n (193.785497, 159.543266, 193.785497, 158.94771),\n (193.785497, 158.94771, 193.785497, 158.352153),\n (193.785497, 158.352153, 193.785497, 157.756597),\n (116.743303, 176.814403, 116.743303, 176.218847),\n (116.743303, 176.218847, 116.743303, 175.62329),\n (116.743303, 175.62329, 116.743303, 175.027734),\n (116.743303, 175.027734, 116.743303, 174.432177),\n (116.743303, 174.432177, 116.743303, 173.836621),\n (116.743303, 173.836621, 116.743303, 173.241064),\n (116.743303, 173.241064, 116.743303, 172.645508),\n (116.743303, 172.645508, 116.743303, 172.049951),\n (116.743303, 172.049951, 116.743303, 171.454395),\n (116.743303, 171.454395, 116.743303, 170.858839),\n (116.743303, 170.858839, 116.743303, 170.263282),\n (116.743303, 170.263282, 116.743303, 169.667726),\n (116.743303, 169.667726, 116.743303, 169.072169),\n (116.743303, 169.072169, 116.743303, 168.476613),\n (116.743303, 168.476613, 116.743303, 167.881056),\n (116.743303, 167.881056, 116.743303, 167.2855),\n (116.743303, 167.2855, 116.743303, 166.689944),\n (116.743303, 166.689944, 116.743303, 166.094387),\n (116.743303, 166.094387, 116.743303, 165.498831),\n (116.743303, 165.498831, 116.743303, 164.903274),\n (116.743303, 164.903274, 116.743303, 164.307718),\n (116.743303, 164.307718, 116.743303, 163.712161),\n (116.743303, 163.712161, 116.743303, 163.116605),\n (116.743303, 163.116605, 116.743303, 162.521049),\n (116.743303, 162.521049, 116.743303, 161.925492),\n (116.743303, 161.925492, 116.743303, 161.329936),\n (116.743303, 161.329936, 116.743303, 160.734379),\n (116.743303, 160.734379, 116.743303, 160.138823),\n (116.743303, 160.138823, 116.743303, 159.543266),\n (116.743303, 159.543266, 116.743303, 158.94771),\n (116.743303, 158.94771, 116.743303, 158.352153),\n (116.743303, 158.352153, 116.743303, 157.756597),\n (116.743303, 176.814403, 193.785497, 176.814403),\n (116.743303, 157.756597, 193.785497, 157.756597)\n]\nVISIBLE_CIRCLES = [\n (93.2144, 167.2855, 9.528903)\n]\nVISIBLE_ARCS = [\n\n]\nHIDDEN_SEGMENTS = [\n\n]\n# (orient, text, p1, p2, base) for linear; (orient, text, center, radius, angle) for diameter\nDIMENSIONS = [\n ('diameter', '%%c100', (93.2144, 167.2855), 9.5289, 45),\n ('horizontal', '404.255', (193.7855, 167.2855), (116.7434, 167.2855), (155.2645, 156.2855))\n]\n\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\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\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,\n angle=(0 if d[0] == \"horizontal\" else 90),\n 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,\n text=text, dimstyle=\"EZDXF\").render()\n\n doc.saveas(out_path)\n\n\nif __name__ == \"__main__\":\n out = sys.argv[1] if len(sys.argv) > 1 else \"0048_00483793_gt.dxf\"\n draw(out)\n print(\"wrote\", out)\n```"}], "images": ["images/0048_00483793.png"], "id": "0048_00483793"} {"messages": [{"role": "user", "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 103.26 mm."}, {"role": "assistant", "content": "```python\n#!/usr/bin/env python3\n# -*- coding: utf-8 -*-\n# Ground-truth 2D engineering drawing for part: 0049_00497313\n# Self-contained: reproduces the three-view DXF via ezdxf, NO FreeCAD needed.\n# Coordinates are A4 page millimetres (scale=0.4727914438503078, page=[297.0, 210.0]).\n# visible edges -> solid (layer OUTLINE); hidden edges -> dashed (layer HIDDEN)\n# dimensions -> real movable DIMENSION entities (text = true mm value)\n# Run: python 0049_00497313_gt.py [out.dxf]\nimport sys\nimport ezdxf\n\nSCALE = 0.4727914438503078\nPAGE = [297.0, 210.0]\n\nVISIBLE_SEGMENTS = [\n (76.630228, 122.590628, 78.107701, 122.590628),\n (78.107701, 122.590628, 79.585174, 122.590628),\n (79.585174, 122.590628, 81.062648, 122.590628),\n (81.062648, 122.590628, 82.540121, 122.590628),\n (82.540121, 122.590628, 84.017594, 122.590628),\n (84.017594, 122.590628, 85.495067, 122.590628),\n (85.495067, 122.590628, 86.972541, 122.590628),\n (86.972541, 122.590628, 88.450014, 122.590628),\n (88.450014, 122.590628, 89.927487, 122.590628),\n (89.927487, 122.590628, 91.40496, 122.590628),\n (91.40496, 122.590628, 92.882434, 122.590628),\n (92.882434, 122.590628, 94.359907, 122.590628),\n (94.359907, 122.590628, 95.83738, 122.590628),\n (95.83738, 122.590628, 97.314853, 122.590628),\n (97.314853, 122.590628, 98.792327, 122.590628),\n (98.792327, 122.590628, 100.2698, 122.590628),\n (100.2698, 122.590628, 101.747273, 122.590628),\n (101.747273, 122.590628, 103.224747, 122.590628),\n (103.224747, 122.590628, 104.70222, 122.590628),\n (104.70222, 122.590628, 106.179693, 122.590628),\n (106.179693, 122.590628, 107.657166, 122.590628),\n (107.657166, 122.590628, 109.13464, 122.590628),\n (109.13464, 122.590628, 110.612113, 122.590628),\n (110.612113, 122.590628, 112.089586, 122.590628),\n (112.089586, 122.590628, 113.567059, 122.590628),\n (113.567059, 122.590628, 115.044533, 122.590628),\n (115.044533, 122.590628, 116.522006, 122.590628),\n (116.522006, 122.590628, 117.999479, 122.590628),\n (117.999479, 122.590628, 119.476952, 122.590628),\n (119.476952, 122.590628, 120.954426, 122.590628),\n (120.954426, 122.590628, 122.431899, 122.590628),\n (122.431899, 122.590628, 123.909372, 122.590628),\n (123.909372, 122.590628, 123.909372, 73.769772),\n (76.630228, 73.769772, 78.107701, 73.769772),\n (78.107701, 73.769772, 79.585174, 73.769772),\n (79.585174, 73.769772, 81.062648, 73.769772),\n (81.062648, 73.769772, 82.540121, 73.769772),\n (82.540121, 73.769772, 84.017594, 73.769772),\n (84.017594, 73.769772, 85.495067, 73.769772),\n (85.495067, 73.769772, 86.972541, 73.769772),\n (86.972541, 73.769772, 88.450014, 73.769772),\n (88.450014, 73.769772, 89.927487, 73.769772),\n (89.927487, 73.769772, 91.40496, 73.769772),\n (91.40496, 73.769772, 92.882434, 73.769772),\n (92.882434, 73.769772, 94.359907, 73.769772),\n (94.359907, 73.769772, 95.83738, 73.769772),\n (95.83738, 73.769772, 97.314853, 73.769772),\n (97.314853, 73.769772, 98.792327, 73.769772),\n (98.792327, 73.769772, 100.2698, 73.769772),\n (100.2698, 73.769772, 101.747273, 73.769772),\n (101.747273, 73.769772, 103.224747, 73.769772),\n (103.224747, 73.769772, 104.70222, 73.769772),\n (104.70222, 73.769772, 106.179693, 73.769772),\n (106.179693, 73.769772, 107.657166, 73.769772),\n (107.657166, 73.769772, 109.13464, 73.769772),\n (109.13464, 73.769772, 110.612113, 73.769772),\n (110.612113, 73.769772, 112.089586, 73.769772),\n (112.089586, 73.769772, 113.567059, 73.769772),\n (113.567059, 73.769772, 115.044533, 73.769772),\n (115.044533, 73.769772, 116.522006, 73.769772),\n (116.522006, 73.769772, 117.999479, 73.769772),\n (117.999479, 73.769772, 119.476952, 73.769772),\n (119.476952, 73.769772, 120.954426, 73.769772),\n (120.954426, 73.769772, 122.431899, 73.769772),\n (122.431899, 73.769772, 123.909372, 73.769772),\n (76.630228, 73.769772, 76.630228, 122.590628),\n (186.730228, 183.869772, 186.730228, 182.392299),\n (186.730228, 182.392299, 186.730228, 180.914826),\n (186.730228, 180.914826, 186.730228, 179.437352),\n (186.730228, 179.437352, 186.730228, 177.959879),\n (186.730228, 177.959879, 186.730228, 176.482406),\n (186.730228, 176.482406, 186.730228, 175.004933),\n (186.730228, 175.004933, 186.730228, 173.527459),\n (186.730228, 173.527459, 186.730228, 172.049986),\n (186.730228, 172.049986, 186.730228, 170.572513),\n (186.730228, 170.572513, 186.730228, 169.09504),\n (186.730228, 169.09504, 186.730228, 167.617566),\n (186.730228, 167.617566, 186.730228, 166.140093),\n (186.730228, 166.140093, 186.730228, 164.66262),\n (186.730228, 164.66262, 186.730228, 163.185147),\n (186.730228, 163.185147, 186.730228, 161.707673),\n (186.730228, 161.707673, 186.730228, 160.2302),\n (186.730228, 160.2302, 186.730228, 158.752727),\n (186.730228, 158.752727, 186.730228, 157.275253),\n (186.730228, 157.275253, 186.730228, 155.79778),\n (186.730228, 155.79778, 186.730228, 154.320307),\n (186.730228, 154.320307, 186.730228, 152.842834),\n (186.730228, 152.842834, 186.730228, 151.36536),\n (186.730228, 151.36536, 186.730228, 149.887887),\n (186.730228, 149.887887, 186.730228, 148.410414),\n (186.730228, 148.410414, 186.730228, 146.932941),\n (186.730228, 146.932941, 186.730228, 145.455467),\n (186.730228, 145.455467, 186.730228, 143.977994),\n (186.730228, 143.977994, 186.730228, 142.500521),\n (186.730228, 142.500521, 186.730228, 141.023048),\n (186.730228, 141.023048, 186.730228, 139.545574),\n (186.730228, 139.545574, 186.730228, 138.068101),\n (186.730228, 138.068101, 186.730228, 136.590628),\n (137.909372, 183.869772, 137.909372, 182.392299),\n (137.909372, 182.392299, 137.909372, 180.914826),\n (137.909372, 180.914826, 137.909372, 179.437352),\n (137.909372, 179.437352, 137.909372, 177.959879),\n (137.909372, 177.959879, 137.909372, 176.482406),\n (137.909372, 176.482406, 137.909372, 175.004933),\n (137.909372, 175.004933, 137.909372, 173.527459),\n (137.909372, 173.527459, 137.909372, 172.049986),\n (137.909372, 172.049986, 137.909372, 170.572513),\n (137.909372, 170.572513, 137.909372, 169.09504),\n (137.909372, 169.09504, 137.909372, 167.617566),\n (137.909372, 167.617566, 137.909372, 166.140093),\n (137.909372, 166.140093, 137.909372, 164.66262),\n (137.909372, 164.66262, 137.909372, 163.185147),\n (137.909372, 163.185147, 137.909372, 161.707673),\n (137.909372, 161.707673, 137.909372, 160.2302),\n (137.909372, 160.2302, 137.909372, 158.752727),\n (137.909372, 158.752727, 137.909372, 157.275253),\n (137.909372, 157.275253, 137.909372, 155.79778),\n (137.909372, 155.79778, 137.909372, 154.320307),\n (137.909372, 154.320307, 137.909372, 152.842834),\n (137.909372, 152.842834, 137.909372, 151.36536),\n (137.909372, 151.36536, 137.909372, 149.887887),\n (137.909372, 149.887887, 137.909372, 148.410414),\n (137.909372, 148.410414, 137.909372, 146.932941),\n (137.909372, 146.932941, 137.909372, 145.455467),\n (137.909372, 145.455467, 137.909372, 143.977994),\n (137.909372, 143.977994, 137.909372, 142.500521),\n (137.909372, 142.500521, 137.909372, 141.023048),\n (137.909372, 141.023048, 137.909372, 139.545574),\n (137.909372, 139.545574, 137.909372, 138.068101),\n (137.909372, 138.068101, 137.909372, 136.590628),\n (137.909372, 183.869772, 186.730228, 183.869772),\n (137.909372, 136.590628, 186.730228, 136.590628)\n]\nVISIBLE_CIRCLES = [\n (100.2698, 160.2302, 23.639572)\n]\nVISIBLE_ARCS = [\n\n]\nHIDDEN_SEGMENTS = [\n\n]\n# (orient, text, p1, p2, base) for linear; (orient, text, center, radius, angle) for diameter\nDIMENSIONS = [\n ('diameter', '%%c100', (100.2698, 160.2302), 23.6396, 45),\n ('horizontal', '103.261', (186.7302, 160.2302), (137.9093, 160.2302), (162.3198, 149.2302))\n]\n\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\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\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,\n angle=(0 if d[0] == \"horizontal\" else 90),\n 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,\n text=text, dimstyle=\"EZDXF\").render()\n\n doc.saveas(out_path)\n\n\nif __name__ == \"__main__\":\n out = sys.argv[1] if len(sys.argv) > 1 else \"0049_00497313_gt.dxf\"\n draw(out)\n print(\"wrote\", out)\n```"}], "images": ["images/0049_00497313.png"], "id": "0049_00497313"} {"messages": [{"role": "user", "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 96.94 mm."}, {"role": "assistant", "content": "```python\n#!/usr/bin/env python3\n# -*- coding: utf-8 -*-\n# Ground-truth 2D engineering drawing for part: 0050_00501218\n# Self-contained: reproduces the three-view DXF via ezdxf, NO FreeCAD needed.\n# Coordinates are A4 page millimetres (scale=0.48796891191709874, page=[297.0, 210.0]).\n# visible edges -> solid (layer OUTLINE); hidden edges -> dashed (layer HIDDEN)\n# dimensions -> real movable DIMENSION entities (text = true mm value)\n# Run: python 0050_00501218_gt.py [out.dxf]\nimport sys\nimport ezdxf\n\nSCALE = 0.48796891191709874\nPAGE = [297.0, 210.0]\n\nVISIBLE_SEGMENTS = [\n (125.047646, 74.149245, 123.522743, 74.149245),\n (123.522743, 74.149245, 121.99784, 74.149245),\n (121.99784, 74.149245, 120.472937, 74.149245),\n (120.472937, 74.149245, 118.948034, 74.149245),\n (118.948034, 74.149245, 117.423131, 74.149245),\n (117.423131, 74.149245, 115.898228, 74.149245),\n (115.898228, 74.149245, 114.373326, 74.149245),\n (114.373326, 74.149245, 112.848423, 74.149245),\n (112.848423, 74.149245, 111.32352, 74.149245),\n (111.32352, 74.149245, 109.798617, 74.149245),\n (109.798617, 74.149245, 108.273714, 74.149245),\n (108.273714, 74.149245, 106.748811, 74.149245),\n (106.748811, 74.149245, 105.223909, 74.149245),\n (105.223909, 74.149245, 103.699006, 74.149245),\n (103.699006, 74.149245, 102.174103, 74.149245),\n (102.174103, 74.149245, 100.6492, 74.149245),\n (100.6492, 74.149245, 99.124297, 74.149245),\n (99.124297, 74.149245, 97.599394, 74.149245),\n (97.599394, 74.149245, 96.074491, 74.149245),\n (96.074491, 74.149245, 94.549589, 74.149245),\n (94.549589, 74.149245, 93.024686, 74.149245),\n (93.024686, 74.149245, 91.499783, 74.149245),\n (91.499783, 74.149245, 89.97488, 74.149245),\n (89.97488, 74.149245, 88.449977, 74.149245),\n (88.449977, 74.149245, 86.925074, 74.149245),\n (86.925074, 74.149245, 85.400172, 74.149245),\n (85.400172, 74.149245, 83.875269, 74.149245),\n (83.875269, 74.149245, 82.350366, 74.149245),\n (82.350366, 74.149245, 80.825463, 74.149245),\n (80.825463, 74.149245, 79.30056, 74.149245),\n (79.30056, 74.149245, 77.775657, 74.149245),\n (77.775657, 74.149245, 76.250754, 74.149245),\n (125.047646, 74.149245, 125.047646, 121.452354),\n (125.047646, 121.452354, 123.522743, 121.452354),\n (123.522743, 121.452354, 121.99784, 121.452354),\n (121.99784, 121.452354, 120.472937, 121.452354),\n (120.472937, 121.452354, 118.948034, 121.452354),\n (118.948034, 121.452354, 117.423131, 121.452354),\n (117.423131, 121.452354, 115.898228, 121.452354),\n (115.898228, 121.452354, 114.373326, 121.452354),\n (114.373326, 121.452354, 112.848423, 121.452354),\n (112.848423, 121.452354, 111.32352, 121.452354),\n (111.32352, 121.452354, 109.798617, 121.452354),\n (109.798617, 121.452354, 108.273714, 121.452354),\n (108.273714, 121.452354, 106.748811, 121.452354),\n (106.748811, 121.452354, 105.223909, 121.452354),\n (105.223909, 121.452354, 103.699006, 121.452354),\n (103.699006, 121.452354, 102.174103, 121.452354),\n (102.174103, 121.452354, 100.6492, 121.452354),\n (100.6492, 121.452354, 99.124297, 121.452354),\n (99.124297, 121.452354, 97.599394, 121.452354),\n (97.599394, 121.452354, 96.074491, 121.452354),\n (96.074491, 121.452354, 94.549589, 121.452354),\n (94.549589, 121.452354, 93.024686, 121.452354),\n (93.024686, 121.452354, 91.499783, 121.452354),\n (91.499783, 121.452354, 89.97488, 121.452354),\n (89.97488, 121.452354, 88.449977, 121.452354),\n (88.449977, 121.452354, 86.925074, 121.452354),\n (86.925074, 121.452354, 85.400172, 121.452354),\n (85.400172, 121.452354, 83.875269, 121.452354),\n (83.875269, 121.452354, 82.350366, 121.452354),\n (82.350366, 121.452354, 80.825463, 121.452354),\n (80.825463, 121.452354, 79.30056, 121.452354),\n (79.30056, 121.452354, 77.775657, 121.452354),\n (77.775657, 121.452354, 76.250754, 121.452354),\n (76.250754, 121.452354, 76.250754, 74.149245),\n (139.047646, 135.452354, 139.047646, 136.977257),\n (139.047646, 136.977257, 139.047646, 138.50216),\n (139.047646, 138.50216, 139.047646, 140.027063),\n (139.047646, 140.027063, 139.047646, 141.551966),\n (139.047646, 141.551966, 139.047646, 143.076869),\n (139.047646, 143.076869, 139.047646, 144.601772),\n (139.047646, 144.601772, 139.047646, 146.126674),\n (139.047646, 146.126674, 139.047646, 147.651577),\n (139.047646, 147.651577, 139.047646, 149.17648),\n (139.047646, 149.17648, 139.047646, 150.701383),\n (139.047646, 150.701383, 139.047646, 152.226286),\n (139.047646, 152.226286, 139.047646, 153.751189),\n (139.047646, 153.751189, 139.047646, 155.276091),\n (139.047646, 155.276091, 139.047646, 156.800994),\n (139.047646, 156.800994, 139.047646, 158.325897),\n (139.047646, 158.325897, 139.047646, 159.8508),\n (139.047646, 159.8508, 139.047646, 161.375703),\n (139.047646, 161.375703, 139.047646, 162.900606),\n (139.047646, 162.900606, 139.047646, 164.425509),\n (139.047646, 164.425509, 139.047646, 165.950411),\n (139.047646, 165.950411, 139.047646, 167.475314),\n (139.047646, 167.475314, 139.047646, 169.000217),\n (139.047646, 169.000217, 139.047646, 170.52512),\n (139.047646, 170.52512, 139.047646, 172.050023),\n (139.047646, 172.050023, 139.047646, 173.574926),\n (139.047646, 173.574926, 139.047646, 175.099828),\n (139.047646, 175.099828, 139.047646, 176.624731),\n (139.047646, 176.624731, 139.047646, 178.149634),\n (139.047646, 178.149634, 139.047646, 179.674537),\n (139.047646, 179.674537, 139.047646, 181.19944),\n (139.047646, 181.19944, 139.047646, 182.724343),\n (139.047646, 182.724343, 139.047646, 184.249246),\n (186.350755, 135.452354, 186.350755, 136.977257),\n (186.350755, 136.977257, 186.350755, 138.50216),\n (186.350755, 138.50216, 186.350755, 140.027063),\n (186.350755, 140.027063, 186.350755, 141.551966),\n (186.350755, 141.551966, 186.350755, 143.076869),\n (186.350755, 143.076869, 186.350755, 144.601772),\n (186.350755, 144.601772, 186.350755, 146.126674),\n (186.350755, 146.126674, 186.350755, 147.651577),\n (186.350755, 147.651577, 186.350755, 149.17648),\n (186.350755, 149.17648, 186.350755, 150.701383),\n (186.350755, 150.701383, 186.350755, 152.226286),\n (186.350755, 152.226286, 186.350755, 153.751189),\n (186.350755, 153.751189, 186.350755, 155.276091),\n (186.350755, 155.276091, 186.350755, 156.800994),\n (186.350755, 156.800994, 186.350755, 158.325897),\n (186.350755, 158.325897, 186.350755, 159.8508),\n (186.350755, 159.8508, 186.350755, 161.375703),\n (186.350755, 161.375703, 186.350755, 162.900606),\n (186.350755, 162.900606, 186.350755, 164.425509),\n (186.350755, 164.425509, 186.350755, 165.950411),\n (186.350755, 165.950411, 186.350755, 167.475314),\n (186.350755, 167.475314, 186.350755, 169.000217),\n (186.350755, 169.000217, 186.350755, 170.52512),\n (186.350755, 170.52512, 186.350755, 172.050023),\n (186.350755, 172.050023, 186.350755, 173.574926),\n (186.350755, 173.574926, 186.350755, 175.099828),\n (186.350755, 175.099828, 186.350755, 176.624731),\n (186.350755, 176.624731, 186.350755, 178.149634),\n (186.350755, 178.149634, 186.350755, 179.674537),\n (186.350755, 179.674537, 186.350755, 181.19944),\n (186.350755, 181.19944, 186.350755, 182.724343),\n (186.350755, 182.724343, 186.350755, 184.249246),\n (186.350755, 135.452354, 139.047646, 135.452354),\n (186.350755, 184.249246, 139.047646, 184.249246)\n]\nVISIBLE_CIRCLES = [\n (100.6492, 159.8508, 24.398446)\n]\nVISIBLE_ARCS = [\n\n]\nHIDDEN_SEGMENTS = [\n\n]\n# (orient, text, p1, p2, base) for linear; (orient, text, center, radius, angle) for diameter\nDIMENSIONS = [\n ('diameter', '%%c100', (100.6492, 159.8508), 24.3984, 45),\n ('horizontal', '96.9388', (139.0477, 159.8508), (186.3508, 159.8508), (162.6992, 170.8508))\n]\n\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\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\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,\n angle=(0 if d[0] == \"horizontal\" else 90),\n 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,\n text=text, dimstyle=\"EZDXF\").render()\n\n doc.saveas(out_path)\n\n\nif __name__ == \"__main__\":\n out = sys.argv[1] if len(sys.argv) > 1 else \"0050_00501218_gt.dxf\"\n draw(out)\n print(\"wrote\", out)\n```"}], "images": ["images/0050_00501218.png"], "id": "0050_00501218"} {"messages": [{"role": "user", "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": "assistant", "content": "```python\n#!/usr/bin/env python3\n# -*- coding: utf-8 -*-\n# Ground-truth 2D engineering drawing for part: 0050_00507899\n# Self-contained: reproduces the three-view DXF via ezdxf, NO FreeCAD needed.\n# Coordinates are A4 page millimetres (scale=0.07464077669902913, page=[297.0, 210.0]).\n# visible edges -> solid (layer OUTLINE); hidden edges -> dashed (layer HIDDEN)\n# dimensions -> real movable DIMENSION entities (text = true mm value)\n# Run: python 0050_00507899_gt.py [out.dxf]\nimport sys\nimport ezdxf\n\nSCALE = 0.07464077669902913\nPAGE = [297.0, 210.0]\n\nVISIBLE_SEGMENTS = [\n (86.583961, 152.451961, 86.817214, 152.451961),\n (86.817214, 152.451961, 87.050466, 152.451961),\n (87.050466, 152.451961, 87.283718, 152.451961),\n (87.283718, 152.451961, 87.516971, 152.451961),\n (87.516971, 152.451961, 87.750223, 152.451961),\n (87.750223, 152.451961, 87.983476, 152.451961),\n (87.983476, 152.451961, 88.216728, 152.451961),\n (88.216728, 152.451961, 88.449981, 152.451961),\n (88.449981, 152.451961, 88.683233, 152.451961),\n (88.683233, 152.451961, 88.916485, 152.451961),\n (88.916485, 152.451961, 89.149738, 152.451961),\n (89.149738, 152.451961, 89.38299, 152.451961),\n (89.38299, 152.451961, 89.616243, 152.451961),\n (89.616243, 152.451961, 89.849495, 152.451961),\n (89.849495, 152.451961, 90.082748, 152.451961),\n (90.082748, 152.451961, 90.316, 152.451961),\n (90.316, 152.451961, 90.549252, 152.451961),\n (90.549252, 152.451961, 90.782505, 152.451961),\n (90.782505, 152.451961, 91.015757, 152.451961),\n (91.015757, 152.451961, 91.24901, 152.451961),\n (91.24901, 152.451961, 91.482262, 152.451961),\n (91.482262, 152.451961, 91.715515, 152.451961),\n (91.715515, 152.451961, 91.948767, 152.451961),\n (91.948767, 152.451961, 92.182019, 152.451961),\n (92.182019, 152.451961, 92.415272, 152.451961),\n (92.415272, 152.451961, 92.648524, 152.451961),\n (92.648524, 152.451961, 92.881777, 152.451961),\n (92.881777, 152.451961, 93.115029, 152.451961),\n (93.115029, 152.451961, 93.348282, 152.451961),\n (93.348282, 152.451961, 93.581534, 152.451961),\n (93.581534, 152.451961, 93.814786, 152.451961),\n (93.814786, 152.451961, 94.048039, 152.451961),\n (94.048039, 152.451961, 94.048039, 63.816039),\n (86.583961, 63.816039, 86.817214, 63.816039),\n (86.817214, 63.816039, 87.050466, 63.816039),\n (87.050466, 63.816039, 87.283718, 63.816039),\n (87.283718, 63.816039, 87.516971, 63.816039),\n (87.516971, 63.816039, 87.750223, 63.816039),\n (87.750223, 63.816039, 87.983476, 63.816039),\n (87.983476, 63.816039, 88.216728, 63.816039),\n (88.216728, 63.816039, 88.449981, 63.816039),\n (88.449981, 63.816039, 88.683233, 63.816039),\n (88.683233, 63.816039, 88.916485, 63.816039),\n (88.916485, 63.816039, 89.149738, 63.816039),\n (89.149738, 63.816039, 89.38299, 63.816039),\n (89.38299, 63.816039, 89.616243, 63.816039),\n (89.616243, 63.816039, 89.849495, 63.816039),\n (89.849495, 63.816039, 90.082748, 63.816039),\n (90.082748, 63.816039, 90.316, 63.816039),\n (90.316, 63.816039, 90.549252, 63.816039),\n (90.549252, 63.816039, 90.782505, 63.816039),\n (90.782505, 63.816039, 91.015757, 63.816039),\n (91.015757, 63.816039, 91.24901, 63.816039),\n (91.24901, 63.816039, 91.482262, 63.816039),\n (91.482262, 63.816039, 91.715515, 63.816039),\n (91.715515, 63.816039, 91.948767, 63.816039),\n (91.948767, 63.816039, 92.182019, 63.816039),\n (92.182019, 63.816039, 92.415272, 63.816039),\n (92.415272, 63.816039, 92.648524, 63.816039),\n (92.648524, 63.816039, 92.881777, 63.816039),\n (92.881777, 63.816039, 93.115029, 63.816039),\n (93.115029, 63.816039, 93.348282, 63.816039),\n (93.348282, 63.816039, 93.581534, 63.816039),\n (93.581534, 63.816039, 93.814786, 63.816039),\n (93.814786, 63.816039, 94.048039, 63.816039),\n (86.583961, 63.816039, 86.583961, 152.451961),\n (196.683961, 173.916039, 196.683961, 173.682786),\n (196.683961, 173.682786, 196.683961, 173.449534),\n (196.683961, 173.449534, 196.683961, 173.216282),\n (196.683961, 173.216282, 196.683961, 172.983029),\n (196.683961, 172.983029, 196.683961, 172.749777),\n (196.683961, 172.749777, 196.683961, 172.516524),\n (196.683961, 172.516524, 196.683961, 172.283272),\n (196.683961, 172.283272, 196.683961, 172.050019),\n (196.683961, 172.050019, 196.683961, 171.816767),\n (196.683961, 171.816767, 196.683961, 171.583515),\n (196.683961, 171.583515, 196.683961, 171.350262),\n (196.683961, 171.350262, 196.683961, 171.11701),\n (196.683961, 171.11701, 196.683961, 170.883757),\n (196.683961, 170.883757, 196.683961, 170.650505),\n (196.683961, 170.650505, 196.683961, 170.417252),\n (196.683961, 170.417252, 196.683961, 170.184),\n (196.683961, 170.184, 196.683961, 169.950748),\n (196.683961, 169.950748, 196.683961, 169.717495),\n (196.683961, 169.717495, 196.683961, 169.484243),\n (196.683961, 169.484243, 196.683961, 169.25099),\n (196.683961, 169.25099, 196.683961, 169.017738),\n (196.683961, 169.017738, 196.683961, 168.784485),\n (196.683961, 168.784485, 196.683961, 168.551233),\n (196.683961, 168.551233, 196.683961, 168.317981),\n (196.683961, 168.317981, 196.683961, 168.084728),\n (196.683961, 168.084728, 196.683961, 167.851476),\n (196.683961, 167.851476, 196.683961, 167.618223),\n (196.683961, 167.618223, 196.683961, 167.384971),\n (196.683961, 167.384971, 196.683961, 167.151718),\n (196.683961, 167.151718, 196.683961, 166.918466),\n (196.683961, 166.918466, 196.683961, 166.685214),\n (196.683961, 166.685214, 196.683961, 166.451961),\n (108.048039, 173.916039, 108.048039, 173.682786),\n (108.048039, 173.682786, 108.048039, 173.449534),\n (108.048039, 173.449534, 108.048039, 173.216282),\n (108.048039, 173.216282, 108.048039, 172.983029),\n (108.048039, 172.983029, 108.048039, 172.749777),\n (108.048039, 172.749777, 108.048039, 172.516524),\n (108.048039, 172.516524, 108.048039, 172.283272),\n (108.048039, 172.283272, 108.048039, 172.050019),\n (108.048039, 172.050019, 108.048039, 171.816767),\n (108.048039, 171.816767, 108.048039, 171.583515),\n (108.048039, 171.583515, 108.048039, 171.350262),\n (108.048039, 171.350262, 108.048039, 171.11701),\n (108.048039, 171.11701, 108.048039, 170.883757),\n (108.048039, 170.883757, 108.048039, 170.650505),\n (108.048039, 170.650505, 108.048039, 170.417252),\n (108.048039, 170.417252, 108.048039, 170.184),\n (108.048039, 170.184, 108.048039, 169.950748),\n (108.048039, 169.950748, 108.048039, 169.717495),\n (108.048039, 169.717495, 108.048039, 169.484243),\n (108.048039, 169.484243, 108.048039, 169.25099),\n (108.048039, 169.25099, 108.048039, 169.017738),\n (108.048039, 169.017738, 108.048039, 168.784485),\n (108.048039, 168.784485, 108.048039, 168.551233),\n (108.048039, 168.551233, 108.048039, 168.317981),\n (108.048039, 168.317981, 108.048039, 168.084728),\n (108.048039, 168.084728, 108.048039, 167.851476),\n (108.048039, 167.851476, 108.048039, 167.618223),\n (108.048039, 167.618223, 108.048039, 167.384971),\n (108.048039, 167.384971, 108.048039, 167.151718),\n (108.048039, 167.151718, 108.048039, 166.918466),\n (108.048039, 166.918466, 108.048039, 166.685214),\n (108.048039, 166.685214, 108.048039, 166.451961),\n (108.048039, 173.916039, 196.683961, 173.916039),\n (108.048039, 166.451961, 196.683961, 166.451961)\n]\nVISIBLE_CIRCLES = [\n (90.316, 170.184, 3.732039)\n]\nVISIBLE_ARCS = [\n\n]\nHIDDEN_SEGMENTS = [\n\n]\n# (orient, text, p1, p2, base) for linear; (orient, text, center, radius, angle) for diameter\nDIMENSIONS = [\n ('diameter', '%%c100', (90.316, 170.184), 3.732, 45),\n ('horizontal', '1187.5', (196.684, 170.184), (108.0481, 170.184), (152.366, 159.184))\n]\n\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\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\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,\n angle=(0 if d[0] == \"horizontal\" else 90),\n 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,\n text=text, dimstyle=\"EZDXF\").render()\n\n doc.saveas(out_path)\n\n\nif __name__ == \"__main__\":\n out = sys.argv[1] if len(sys.argv) > 1 else \"0050_00507899_gt.dxf\"\n draw(out)\n print(\"wrote\", out)\n```"}], "images": ["images/0050_00507899.png"], "id": "0050_00507899"} {"messages": [{"role": "user", "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": "assistant", "content": "```python\n#!/usr/bin/env python3\n# -*- coding: utf-8 -*-\n# Ground-truth 2D engineering drawing for part: 0051_00514413\n# Self-contained: reproduces the three-view DXF via ezdxf, NO FreeCAD needed.\n# Coordinates are A4 page millimetres (scale=0.3225734265734338, page=[297.0, 210.0]).\n# visible edges -> solid (layer OUTLINE); hidden edges -> dashed (layer HIDDEN)\n# dimensions -> real movable DIMENSION entities (text = true mm value)\n# Run: python 0051_00514413_gt.py [out.dxf]\nimport sys\nimport ezdxf\n\nSCALE = 0.3225734265734338\nPAGE = [297.0, 210.0]\n\nVISIBLE_SEGMENTS = [\n (112.642971, 70.014371, 111.634929, 70.014371),\n (111.634929, 70.014371, 110.626887, 70.014371),\n (110.626887, 70.014371, 109.618845, 70.014371),\n (109.618845, 70.014371, 108.610803, 70.014371),\n (108.610803, 70.014371, 107.602762, 70.014371),\n (107.602762, 70.014371, 106.59472, 70.014371),\n (106.59472, 70.014371, 105.586678, 70.014371),\n (105.586678, 70.014371, 104.578636, 70.014371),\n (104.578636, 70.014371, 103.570594, 70.014371),\n (103.570594, 70.014371, 102.562552, 70.014371),\n (102.562552, 70.014371, 101.55451, 70.014371),\n (101.55451, 70.014371, 100.546468, 70.014371),\n (100.546468, 70.014371, 99.538426, 70.014371),\n (99.538426, 70.014371, 98.530384, 70.014371),\n (98.530384, 70.014371, 97.522342, 70.014371),\n (97.522342, 70.014371, 96.5143, 70.014371),\n (96.5143, 70.014371, 95.506258, 70.014371),\n (95.506258, 70.014371, 94.498216, 70.014371),\n (94.498216, 70.014371, 93.490174, 70.014371),\n (93.490174, 70.014371, 92.482132, 70.014371),\n (92.482132, 70.014371, 91.47409, 70.014371),\n (91.47409, 70.014371, 90.466048, 70.014371),\n (90.466048, 70.014371, 89.458006, 70.014371),\n (89.458006, 70.014371, 88.449964, 70.014371),\n (88.449964, 70.014371, 87.441922, 70.014371),\n (87.441922, 70.014371, 86.43388, 70.014371),\n (86.43388, 70.014371, 85.425838, 70.014371),\n (85.425838, 70.014371, 84.417797, 70.014371),\n (84.417797, 70.014371, 83.409755, 70.014371),\n (83.409755, 70.014371, 82.401713, 70.014371),\n (82.401713, 70.014371, 81.393671, 70.014371),\n (81.393671, 70.014371, 80.385629, 70.014371),\n (112.642971, 70.014371, 112.642971, 133.857028),\n (112.642971, 133.857028, 111.634929, 133.857028),\n (111.634929, 133.857028, 110.626887, 133.857028),\n (110.626887, 133.857028, 109.618845, 133.857028),\n (109.618845, 133.857028, 108.610803, 133.857028),\n (108.610803, 133.857028, 107.602762, 133.857028),\n (107.602762, 133.857028, 106.59472, 133.857028),\n (106.59472, 133.857028, 105.586678, 133.857028),\n (105.586678, 133.857028, 104.578636, 133.857028),\n (104.578636, 133.857028, 103.570594, 133.857028),\n (103.570594, 133.857028, 102.562552, 133.857028),\n (102.562552, 133.857028, 101.55451, 133.857028),\n (101.55451, 133.857028, 100.546468, 133.857028),\n (100.546468, 133.857028, 99.538426, 133.857028),\n (99.538426, 133.857028, 98.530384, 133.857028),\n (98.530384, 133.857028, 97.522342, 133.857028),\n (97.522342, 133.857028, 96.5143, 133.857028),\n (96.5143, 133.857028, 95.506258, 133.857028),\n (95.506258, 133.857028, 94.498216, 133.857028),\n (94.498216, 133.857028, 93.490174, 133.857028),\n (93.490174, 133.857028, 92.482132, 133.857028),\n (92.482132, 133.857028, 91.47409, 133.857028),\n (91.47409, 133.857028, 90.466048, 133.857028),\n (90.466048, 133.857028, 89.458006, 133.857028),\n (89.458006, 133.857028, 88.449964, 133.857028),\n (88.449964, 133.857028, 87.441922, 133.857028),\n (87.441922, 133.857028, 86.43388, 133.857028),\n (86.43388, 133.857028, 85.425838, 133.857028),\n (85.425838, 133.857028, 84.417797, 133.857028),\n (84.417797, 133.857028, 83.409755, 133.857028),\n (83.409755, 133.857028, 82.401713, 133.857028),\n (82.401713, 133.857028, 81.393671, 133.857028),\n (81.393671, 133.857028, 80.385629, 133.857028),\n (80.385629, 133.857028, 80.385629, 70.014371),\n (126.642972, 147.857029, 126.642972, 148.865071),\n (126.642972, 148.865071, 126.642972, 149.873113),\n (126.642972, 149.873113, 126.642972, 150.881155),\n (126.642972, 150.881155, 126.642972, 151.889197),\n (126.642972, 151.889197, 126.642972, 152.897238),\n (126.642972, 152.897238, 126.642972, 153.90528),\n (126.642972, 153.90528, 126.642972, 154.913322),\n (126.642972, 154.913322, 126.642972, 155.921364),\n (126.642972, 155.921364, 126.642972, 156.929406),\n (126.642972, 156.929406, 126.642972, 157.937448),\n (126.642972, 157.937448, 126.642972, 158.94549),\n (126.642972, 158.94549, 126.642972, 159.953532),\n (126.642972, 159.953532, 126.642972, 160.961574),\n (126.642972, 160.961574, 126.642972, 161.969616),\n (126.642972, 161.969616, 126.642972, 162.977658),\n (126.642972, 162.977658, 126.642972, 163.9857),\n (126.642972, 163.9857, 126.642972, 164.993742),\n (126.642972, 164.993742, 126.642972, 166.001784),\n (126.642972, 166.001784, 126.642972, 167.009826),\n (126.642972, 167.009826, 126.642972, 168.017868),\n (126.642972, 168.017868, 126.642972, 169.02591),\n (126.642972, 169.02591, 126.642972, 170.033952),\n (126.642972, 170.033952, 126.642972, 171.041994),\n (126.642972, 171.041994, 126.642972, 172.050036),\n (126.642972, 172.050036, 126.642972, 173.058078),\n (126.642972, 173.058078, 126.642972, 174.06612),\n (126.642972, 174.06612, 126.642972, 175.074162),\n (126.642972, 175.074162, 126.642972, 176.082203),\n (126.642972, 176.082203, 126.642972, 177.090245),\n (126.642972, 177.090245, 126.642972, 178.098287),\n (126.642972, 178.098287, 126.642972, 179.106329),\n (126.642972, 179.106329, 126.642972, 180.114371),\n (190.485629, 147.857029, 190.485629, 148.865071),\n (190.485629, 148.865071, 190.485629, 149.873113),\n (190.485629, 149.873113, 190.485629, 150.881155),\n (190.485629, 150.881155, 190.485629, 151.889197),\n (190.485629, 151.889197, 190.485629, 152.897238),\n (190.485629, 152.897238, 190.485629, 153.90528),\n (190.485629, 153.90528, 190.485629, 154.913322),\n (190.485629, 154.913322, 190.485629, 155.921364),\n (190.485629, 155.921364, 190.485629, 156.929406),\n (190.485629, 156.929406, 190.485629, 157.937448),\n (190.485629, 157.937448, 190.485629, 158.94549),\n (190.485629, 158.94549, 190.485629, 159.953532),\n (190.485629, 159.953532, 190.485629, 160.961574),\n (190.485629, 160.961574, 190.485629, 161.969616),\n (190.485629, 161.969616, 190.485629, 162.977658),\n (190.485629, 162.977658, 190.485629, 163.9857),\n (190.485629, 163.9857, 190.485629, 164.993742),\n (190.485629, 164.993742, 190.485629, 166.001784),\n (190.485629, 166.001784, 190.485629, 167.009826),\n (190.485629, 167.009826, 190.485629, 168.017868),\n (190.485629, 168.017868, 190.485629, 169.02591),\n (190.485629, 169.02591, 190.485629, 170.033952),\n (190.485629, 170.033952, 190.485629, 171.041994),\n (190.485629, 171.041994, 190.485629, 172.050036),\n (190.485629, 172.050036, 190.485629, 173.058078),\n (190.485629, 173.058078, 190.485629, 174.06612),\n (190.485629, 174.06612, 190.485629, 175.074162),\n (190.485629, 175.074162, 190.485629, 176.082203),\n (190.485629, 176.082203, 190.485629, 177.090245),\n (190.485629, 177.090245, 190.485629, 178.098287),\n (190.485629, 178.098287, 190.485629, 179.106329),\n (190.485629, 179.106329, 190.485629, 180.114371),\n (190.485629, 147.857029, 126.642972, 147.857029),\n (190.485629, 180.114371, 126.642972, 180.114371)\n]\nVISIBLE_CIRCLES = [\n (96.5143, 163.9857, 16.128671)\n]\nVISIBLE_ARCS = [\n\n]\nHIDDEN_SEGMENTS = [\n\n]\n# (orient, text, p1, p2, base) for linear; (orient, text, center, radius, angle) for diameter\nDIMENSIONS = [\n ('diameter', '%%c100', (96.5143, 163.9857), 16.1287, 45),\n ('horizontal', '197.917', (126.643, 163.9857), (190.4857, 163.9857), (158.5643, 174.9857))\n]\n\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\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\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,\n angle=(0 if d[0] == \"horizontal\" else 90),\n 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,\n text=text, dimstyle=\"EZDXF\").render()\n\n doc.saveas(out_path)\n\n\nif __name__ == \"__main__\":\n out = sys.argv[1] if len(sys.argv) > 1 else \"0051_00514413_gt.dxf\"\n draw(out)\n print(\"wrote\", out)\n```"}], "images": ["images/0051_00514413.png"], "id": "0051_00514413"} {"messages": [{"role": "user", "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 134.75 mm."}, {"role": "assistant", "content": "```python\n#!/usr/bin/env python3\n# -*- coding: utf-8 -*-\n# Ground-truth 2D engineering drawing for part: 0052_00523586\n# Self-contained: reproduces the three-view DXF via ezdxf, NO FreeCAD needed.\n# Coordinates are A4 page millimetres (scale=0.40936858006043236, page=[297.0, 210.0]).\n# visible edges -> solid (layer OUTLINE); hidden edges -> dashed (layer HIDDEN)\n# dimensions -> real movable DIMENSION entities (text = true mm value)\n# Run: python 0052_00523586_gt.py [out.dxf]\nimport sys\nimport ezdxf\n\nSCALE = 0.40936858006043236\nPAGE = [297.0, 210.0]\n\nVISIBLE_SEGMENTS = [\n (119.152629, 72.184229, 117.873352, 72.184229),\n (117.873352, 72.184229, 116.594075, 72.184229),\n (116.594075, 72.184229, 115.314799, 72.184229),\n (115.314799, 72.184229, 114.035522, 72.184229),\n (114.035522, 72.184229, 112.756245, 72.184229),\n (112.756245, 72.184229, 111.476968, 72.184229),\n (111.476968, 72.184229, 110.197691, 72.184229),\n (110.197691, 72.184229, 108.918415, 72.184229),\n (108.918415, 72.184229, 107.639138, 72.184229),\n (107.639138, 72.184229, 106.359861, 72.184229),\n (106.359861, 72.184229, 105.080584, 72.184229),\n (105.080584, 72.184229, 103.801307, 72.184229),\n (103.801307, 72.184229, 102.52203, 72.184229),\n (102.52203, 72.184229, 101.242754, 72.184229),\n (101.242754, 72.184229, 99.963477, 72.184229),\n (99.963477, 72.184229, 98.6842, 72.184229),\n (98.6842, 72.184229, 97.404923, 72.184229),\n (97.404923, 72.184229, 96.125646, 72.184229),\n (96.125646, 72.184229, 94.84637, 72.184229),\n (94.84637, 72.184229, 93.567093, 72.184229),\n (93.567093, 72.184229, 92.287816, 72.184229),\n (92.287816, 72.184229, 91.008539, 72.184229),\n (91.008539, 72.184229, 89.729262, 72.184229),\n (89.729262, 72.184229, 88.449985, 72.184229),\n (88.449985, 72.184229, 87.170709, 72.184229),\n (87.170709, 72.184229, 85.891432, 72.184229),\n (85.891432, 72.184229, 84.612155, 72.184229),\n (84.612155, 72.184229, 83.332878, 72.184229),\n (83.332878, 72.184229, 82.053601, 72.184229),\n (82.053601, 72.184229, 80.774325, 72.184229),\n (80.774325, 72.184229, 79.495048, 72.184229),\n (79.495048, 72.184229, 78.215771, 72.184229),\n (119.152629, 72.184229, 119.152629, 127.347371),\n (119.152629, 127.347371, 117.873352, 127.347371),\n (117.873352, 127.347371, 116.594075, 127.347371),\n (116.594075, 127.347371, 115.314799, 127.347371),\n (115.314799, 127.347371, 114.035522, 127.347371),\n (114.035522, 127.347371, 112.756245, 127.347371),\n (112.756245, 127.347371, 111.476968, 127.347371),\n (111.476968, 127.347371, 110.197691, 127.347371),\n (110.197691, 127.347371, 108.918415, 127.347371),\n (108.918415, 127.347371, 107.639138, 127.347371),\n (107.639138, 127.347371, 106.359861, 127.347371),\n (106.359861, 127.347371, 105.080584, 127.347371),\n (105.080584, 127.347371, 103.801307, 127.347371),\n (103.801307, 127.347371, 102.52203, 127.347371),\n (102.52203, 127.347371, 101.242754, 127.347371),\n (101.242754, 127.347371, 99.963477, 127.347371),\n (99.963477, 127.347371, 98.6842, 127.347371),\n (98.6842, 127.347371, 97.404923, 127.347371),\n (97.404923, 127.347371, 96.125646, 127.347371),\n (96.125646, 127.347371, 94.84637, 127.347371),\n (94.84637, 127.347371, 93.567093, 127.347371),\n (93.567093, 127.347371, 92.287816, 127.347371),\n (92.287816, 127.347371, 91.008539, 127.347371),\n (91.008539, 127.347371, 89.729262, 127.347371),\n (89.729262, 127.347371, 88.449985, 127.347371),\n (88.449985, 127.347371, 87.170709, 127.347371),\n (87.170709, 127.347371, 85.891432, 127.347371),\n (85.891432, 127.347371, 84.612155, 127.347371),\n (84.612155, 127.347371, 83.332878, 127.347371),\n (83.332878, 127.347371, 82.053601, 127.347371),\n (82.053601, 127.347371, 80.774325, 127.347371),\n (80.774325, 127.347371, 79.495048, 127.347371),\n (79.495048, 127.347371, 78.215771, 127.347371),\n (78.215771, 127.347371, 78.215771, 72.184229),\n (133.152629, 141.347371, 133.152629, 142.626648),\n (133.152629, 142.626648, 133.152629, 143.905925),\n (133.152629, 143.905925, 133.152629, 145.185201),\n (133.152629, 145.185201, 133.152629, 146.464478),\n (133.152629, 146.464478, 133.152629, 147.743755),\n (133.152629, 147.743755, 133.152629, 149.023032),\n (133.152629, 149.023032, 133.152629, 150.302309),\n (133.152629, 150.302309, 133.152629, 151.581585),\n (133.152629, 151.581585, 133.152629, 152.860862),\n (133.152629, 152.860862, 133.152629, 154.140139),\n (133.152629, 154.140139, 133.152629, 155.419416),\n (133.152629, 155.419416, 133.152629, 156.698693),\n (133.152629, 156.698693, 133.152629, 157.97797),\n (133.152629, 157.97797, 133.152629, 159.257246),\n (133.152629, 159.257246, 133.152629, 160.536523),\n (133.152629, 160.536523, 133.152629, 161.8158),\n (133.152629, 161.8158, 133.152629, 163.095077),\n (133.152629, 163.095077, 133.152629, 164.374354),\n (133.152629, 164.374354, 133.152629, 165.65363),\n (133.152629, 165.65363, 133.152629, 166.932907),\n (133.152629, 166.932907, 133.152629, 168.212184),\n (133.152629, 168.212184, 133.152629, 169.491461),\n (133.152629, 169.491461, 133.152629, 170.770738),\n (133.152629, 170.770738, 133.152629, 172.050015),\n (133.152629, 172.050015, 133.152629, 173.329291),\n (133.152629, 173.329291, 133.152629, 174.608568),\n (133.152629, 174.608568, 133.152629, 175.887845),\n (133.152629, 175.887845, 133.152629, 177.167122),\n (133.152629, 177.167122, 133.152629, 178.446399),\n (133.152629, 178.446399, 133.152629, 179.725675),\n (133.152629, 179.725675, 133.152629, 181.004952),\n (133.152629, 181.004952, 133.152629, 182.284229),\n (188.315771, 141.347371, 188.315771, 142.626648),\n (188.315771, 142.626648, 188.315771, 143.905925),\n (188.315771, 143.905925, 188.315771, 145.185201),\n (188.315771, 145.185201, 188.315771, 146.464478),\n (188.315771, 146.464478, 188.315771, 147.743755),\n (188.315771, 147.743755, 188.315771, 149.023032),\n (188.315771, 149.023032, 188.315771, 150.302309),\n (188.315771, 150.302309, 188.315771, 151.581585),\n (188.315771, 151.581585, 188.315771, 152.860862),\n (188.315771, 152.860862, 188.315771, 154.140139),\n (188.315771, 154.140139, 188.315771, 155.419416),\n (188.315771, 155.419416, 188.315771, 156.698693),\n (188.315771, 156.698693, 188.315771, 157.97797),\n (188.315771, 157.97797, 188.315771, 159.257246),\n (188.315771, 159.257246, 188.315771, 160.536523),\n (188.315771, 160.536523, 188.315771, 161.8158),\n (188.315771, 161.8158, 188.315771, 163.095077),\n (188.315771, 163.095077, 188.315771, 164.374354),\n (188.315771, 164.374354, 188.315771, 165.65363),\n (188.315771, 165.65363, 188.315771, 166.932907),\n (188.315771, 166.932907, 188.315771, 168.212184),\n (188.315771, 168.212184, 188.315771, 169.491461),\n (188.315771, 169.491461, 188.315771, 170.770738),\n (188.315771, 170.770738, 188.315771, 172.050015),\n (188.315771, 172.050015, 188.315771, 173.329291),\n (188.315771, 173.329291, 188.315771, 174.608568),\n (188.315771, 174.608568, 188.315771, 175.887845),\n (188.315771, 175.887845, 188.315771, 177.167122),\n (188.315771, 177.167122, 188.315771, 178.446399),\n (188.315771, 178.446399, 188.315771, 179.725675),\n (188.315771, 179.725675, 188.315771, 181.004952),\n (188.315771, 181.004952, 188.315771, 182.284229),\n (188.315771, 141.347371, 133.152629, 141.347371),\n (188.315771, 182.284229, 133.152629, 182.284229)\n]\nVISIBLE_CIRCLES = [\n (98.6842, 161.8158, 20.468429)\n]\nVISIBLE_ARCS = [\n\n]\nHIDDEN_SEGMENTS = [\n\n]\n# (orient, text, p1, p2, base) for linear; (orient, text, center, radius, angle) for diameter\nDIMENSIONS = [\n ('diameter', '%%c100', (98.6842, 161.8158), 20.4684, 45),\n ('horizontal', '134.752', (133.1526, 161.8158), (188.3158, 161.8158), (160.7342, 172.8158))\n]\n\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\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\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,\n angle=(0 if d[0] == \"horizontal\" else 90),\n 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,\n text=text, dimstyle=\"EZDXF\").render()\n\n doc.saveas(out_path)\n\n\nif __name__ == \"__main__\":\n out = sys.argv[1] if len(sys.argv) > 1 else \"0052_00523586_gt.dxf\"\n draw(out)\n print(\"wrote\", out)\n```"}], "images": ["images/0052_00523586.png"], "id": "0052_00523586"} {"messages": [{"role": "user", "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": "assistant", "content": "```python\n#!/usr/bin/env python3\n# -*- coding: utf-8 -*-\n# Ground-truth 2D engineering drawing for part: 0052_00525076\n# Self-contained: reproduces the three-view DXF via ezdxf, NO FreeCAD needed.\n# Coordinates are A4 page millimetres (scale=0.19381512605042148, page=[297.0, 210.0]).\n# visible edges -> solid (layer OUTLINE); hidden edges -> dashed (layer HIDDEN)\n# dimensions -> real movable DIMENSION entities (text = true mm value)\n# Run: python 0052_00525076_gt.py [out.dxf]\nimport sys\nimport ezdxf\n\nSCALE = 0.19381512605042148\nPAGE = [297.0, 210.0]\n\nVISIBLE_SEGMENTS = [\n (102.986156, 66.795356, 102.380484, 66.795356),\n (102.380484, 66.795356, 101.774812, 66.795356),\n (101.774812, 66.795356, 101.169139, 66.795356),\n (101.169139, 66.795356, 100.563467, 66.795356),\n (100.563467, 66.795356, 99.957795, 66.795356),\n (99.957795, 66.795356, 99.352123, 66.795356),\n (99.352123, 66.795356, 98.74645, 66.795356),\n (98.74645, 66.795356, 98.140778, 66.795356),\n (98.140778, 66.795356, 97.535106, 66.795356),\n (97.535106, 66.795356, 96.929434, 66.795356),\n (96.929434, 66.795356, 96.323761, 66.795356),\n (96.323761, 66.795356, 95.718089, 66.795356),\n (95.718089, 66.795356, 95.112417, 66.795356),\n (95.112417, 66.795356, 94.506745, 66.795356),\n (94.506745, 66.795356, 93.901072, 66.795356),\n (93.901072, 66.795356, 93.2954, 66.795356),\n (93.2954, 66.795356, 92.689728, 66.795356),\n (92.689728, 66.795356, 92.084055, 66.795356),\n (92.084055, 66.795356, 91.478383, 66.795356),\n (91.478383, 66.795356, 90.872711, 66.795356),\n (90.872711, 66.795356, 90.267039, 66.795356),\n (90.267039, 66.795356, 89.661366, 66.795356),\n (89.661366, 66.795356, 89.055694, 66.795356),\n (89.055694, 66.795356, 88.450022, 66.795356),\n (88.450022, 66.795356, 87.84435, 66.795356),\n (87.84435, 66.795356, 87.238677, 66.795356),\n (87.238677, 66.795356, 86.633005, 66.795356),\n (86.633005, 66.795356, 86.027333, 66.795356),\n (86.027333, 66.795356, 85.421661, 66.795356),\n (85.421661, 66.795356, 84.815988, 66.795356),\n (84.815988, 66.795356, 84.210316, 66.795356),\n (84.210316, 66.795356, 83.604644, 66.795356),\n (102.986156, 66.795356, 102.986156, 143.513843),\n (102.986156, 143.513843, 102.380484, 143.513843),\n (102.380484, 143.513843, 101.774812, 143.513843),\n (101.774812, 143.513843, 101.169139, 143.513843),\n (101.169139, 143.513843, 100.563467, 143.513843),\n (100.563467, 143.513843, 99.957795, 143.513843),\n (99.957795, 143.513843, 99.352123, 143.513843),\n (99.352123, 143.513843, 98.74645, 143.513843),\n (98.74645, 143.513843, 98.140778, 143.513843),\n (98.140778, 143.513843, 97.535106, 143.513843),\n (97.535106, 143.513843, 96.929434, 143.513843),\n (96.929434, 143.513843, 96.323761, 143.513843),\n (96.323761, 143.513843, 95.718089, 143.513843),\n (95.718089, 143.513843, 95.112417, 143.513843),\n (95.112417, 143.513843, 94.506745, 143.513843),\n (94.506745, 143.513843, 93.901072, 143.513843),\n (93.901072, 143.513843, 93.2954, 143.513843),\n (93.2954, 143.513843, 92.689728, 143.513843),\n (92.689728, 143.513843, 92.084055, 143.513843),\n (92.084055, 143.513843, 91.478383, 143.513843),\n (91.478383, 143.513843, 90.872711, 143.513843),\n (90.872711, 143.513843, 90.267039, 143.513843),\n (90.267039, 143.513843, 89.661366, 143.513843),\n (89.661366, 143.513843, 89.055694, 143.513843),\n (89.055694, 143.513843, 88.450022, 143.513843),\n (88.450022, 143.513843, 87.84435, 143.513843),\n (87.84435, 143.513843, 87.238677, 143.513843),\n (87.238677, 143.513843, 86.633005, 143.513843),\n (86.633005, 143.513843, 86.027333, 143.513843),\n (86.027333, 143.513843, 85.421661, 143.513843),\n (85.421661, 143.513843, 84.815988, 143.513843),\n (84.815988, 143.513843, 84.210316, 143.513843),\n (84.210316, 143.513843, 83.604644, 143.513843),\n (83.604644, 143.513843, 83.604644, 66.795356),\n (116.986157, 157.513844, 116.986157, 158.119516),\n (116.986157, 158.119516, 116.986157, 158.725188),\n (116.986157, 158.725188, 116.986157, 159.330861),\n (116.986157, 159.330861, 116.986157, 159.936533),\n (116.986157, 159.936533, 116.986157, 160.542205),\n (116.986157, 160.542205, 116.986157, 161.147877),\n (116.986157, 161.147877, 116.986157, 161.75355),\n (116.986157, 161.75355, 116.986157, 162.359222),\n (116.986157, 162.359222, 116.986157, 162.964894),\n (116.986157, 162.964894, 116.986157, 163.570566),\n (116.986157, 163.570566, 116.986157, 164.176239),\n (116.986157, 164.176239, 116.986157, 164.781911),\n (116.986157, 164.781911, 116.986157, 165.387583),\n (116.986157, 165.387583, 116.986157, 165.993255),\n (116.986157, 165.993255, 116.986157, 166.598928),\n (116.986157, 166.598928, 116.986157, 167.2046),\n (116.986157, 167.2046, 116.986157, 167.810272),\n (116.986157, 167.810272, 116.986157, 168.415945),\n (116.986157, 168.415945, 116.986157, 169.021617),\n (116.986157, 169.021617, 116.986157, 169.627289),\n (116.986157, 169.627289, 116.986157, 170.232961),\n (116.986157, 170.232961, 116.986157, 170.838634),\n (116.986157, 170.838634, 116.986157, 171.444306),\n (116.986157, 171.444306, 116.986157, 172.049978),\n (116.986157, 172.049978, 116.986157, 172.65565),\n (116.986157, 172.65565, 116.986157, 173.261323),\n (116.986157, 173.261323, 116.986157, 173.866995),\n (116.986157, 173.866995, 116.986157, 174.472667),\n (116.986157, 174.472667, 116.986157, 175.078339),\n (116.986157, 175.078339, 116.986157, 175.684012),\n (116.986157, 175.684012, 116.986157, 176.289684),\n (116.986157, 176.289684, 116.986157, 176.895356),\n (193.704644, 157.513844, 193.704644, 158.119516),\n (193.704644, 158.119516, 193.704644, 158.725188),\n (193.704644, 158.725188, 193.704644, 159.330861),\n (193.704644, 159.330861, 193.704644, 159.936533),\n (193.704644, 159.936533, 193.704644, 160.542205),\n (193.704644, 160.542205, 193.704644, 161.147877),\n (193.704644, 161.147877, 193.704644, 161.75355),\n (193.704644, 161.75355, 193.704644, 162.359222),\n (193.704644, 162.359222, 193.704644, 162.964894),\n (193.704644, 162.964894, 193.704644, 163.570566),\n (193.704644, 163.570566, 193.704644, 164.176239),\n (193.704644, 164.176239, 193.704644, 164.781911),\n (193.704644, 164.781911, 193.704644, 165.387583),\n (193.704644, 165.387583, 193.704644, 165.993255),\n (193.704644, 165.993255, 193.704644, 166.598928),\n (193.704644, 166.598928, 193.704644, 167.2046),\n (193.704644, 167.2046, 193.704644, 167.810272),\n (193.704644, 167.810272, 193.704644, 168.415945),\n (193.704644, 168.415945, 193.704644, 169.021617),\n (193.704644, 169.021617, 193.704644, 169.627289),\n (193.704644, 169.627289, 193.704644, 170.232961),\n (193.704644, 170.232961, 193.704644, 170.838634),\n (193.704644, 170.838634, 193.704644, 171.444306),\n (193.704644, 171.444306, 193.704644, 172.049978),\n (193.704644, 172.049978, 193.704644, 172.65565),\n (193.704644, 172.65565, 193.704644, 173.261323),\n (193.704644, 173.261323, 193.704644, 173.866995),\n (193.704644, 173.866995, 193.704644, 174.472667),\n (193.704644, 174.472667, 193.704644, 175.078339),\n (193.704644, 175.078339, 193.704644, 175.684012),\n (193.704644, 175.684012, 193.704644, 176.289684),\n (193.704644, 176.289684, 193.704644, 176.895356),\n (193.704644, 157.513844, 116.986157, 157.513844),\n (193.704644, 176.895356, 116.986157, 176.895356)\n]\nVISIBLE_CIRCLES = [\n (93.2954, 167.2046, 9.690756)\n]\nVISIBLE_ARCS = [\n\n]\nHIDDEN_SEGMENTS = [\n\n]\n# (orient, text, p1, p2, base) for linear; (orient, text, center, radius, angle) for diameter\nDIMENSIONS = [\n ('diameter', '%%c100', (93.2954, 167.2046), 9.6908, 45),\n ('horizontal', '395.833', (116.9861, 167.2046), (193.7046, 167.2046), (155.3454, 178.2046))\n]\n\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\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\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,\n angle=(0 if d[0] == \"horizontal\" else 90),\n 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,\n text=text, dimstyle=\"EZDXF\").render()\n\n doc.saveas(out_path)\n\n\nif __name__ == \"__main__\":\n out = sys.argv[1] if len(sys.argv) > 1 else \"0052_00525076_gt.dxf\"\n draw(out)\n print(\"wrote\", out)\n```"}], "images": ["images/0052_00525076.png"], "id": "0052_00525076"} {"messages": [{"role": "user", "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 296.88 mm."}, {"role": "assistant", "content": "```python\n#!/usr/bin/env python3\n# -*- coding: utf-8 -*-\n# Ground-truth 2D engineering drawing for part: 0053_00534425\n# Self-contained: reproduces the three-view DXF via ezdxf, NO FreeCAD needed.\n# Coordinates are A4 page millimetres (scale=0.24214173228346456, page=[297.0, 210.0]).\n# visible edges -> solid (layer OUTLINE); hidden edges -> dashed (layer HIDDEN)\n# dimensions -> real movable DIMENSION entities (text = true mm value)\n# Run: python 0053_00534425_gt.py [out.dxf]\nimport sys\nimport ezdxf\n\nSCALE = 0.24214173228346456\nPAGE = [297.0, 210.0]\n\nVISIBLE_SEGMENTS = [\n (82.396413, 139.889413, 83.153106, 139.889413),\n (83.153106, 139.889413, 83.909799, 139.889413),\n (83.909799, 139.889413, 84.666492, 139.889413),\n (84.666492, 139.889413, 85.423185, 139.889413),\n (85.423185, 139.889413, 86.179878, 139.889413),\n (86.179878, 139.889413, 86.936571, 139.889413),\n (86.936571, 139.889413, 87.693264, 139.889413),\n (87.693264, 139.889413, 88.449957, 139.889413),\n (88.449957, 139.889413, 89.20665, 139.889413),\n (89.20665, 139.889413, 89.963343, 139.889413),\n (89.963343, 139.889413, 90.720035, 139.889413),\n (90.720035, 139.889413, 91.476728, 139.889413),\n (91.476728, 139.889413, 92.233421, 139.889413),\n (92.233421, 139.889413, 92.990114, 139.889413),\n (92.990114, 139.889413, 93.746807, 139.889413),\n (93.746807, 139.889413, 94.5035, 139.889413),\n (94.5035, 139.889413, 95.260193, 139.889413),\n (95.260193, 139.889413, 96.016886, 139.889413),\n (96.016886, 139.889413, 96.773579, 139.889413),\n (96.773579, 139.889413, 97.530272, 139.889413),\n (97.530272, 139.889413, 98.286965, 139.889413),\n (98.286965, 139.889413, 99.043657, 139.889413),\n (99.043657, 139.889413, 99.80035, 139.889413),\n (99.80035, 139.889413, 100.557043, 139.889413),\n (100.557043, 139.889413, 101.313736, 139.889413),\n (101.313736, 139.889413, 102.070429, 139.889413),\n (102.070429, 139.889413, 102.827122, 139.889413),\n (102.827122, 139.889413, 103.583815, 139.889413),\n (103.583815, 139.889413, 104.340508, 139.889413),\n (104.340508, 139.889413, 105.097201, 139.889413),\n (105.097201, 139.889413, 105.853894, 139.889413),\n (105.853894, 139.889413, 106.610587, 139.889413),\n (106.610587, 139.889413, 106.610587, 68.003586),\n (82.396413, 68.003586, 83.153106, 68.003586),\n (83.153106, 68.003586, 83.909799, 68.003586),\n (83.909799, 68.003586, 84.666492, 68.003586),\n (84.666492, 68.003586, 85.423185, 68.003586),\n (85.423185, 68.003586, 86.179878, 68.003586),\n (86.179878, 68.003586, 86.936571, 68.003586),\n (86.936571, 68.003586, 87.693264, 68.003586),\n (87.693264, 68.003586, 88.449957, 68.003586),\n (88.449957, 68.003586, 89.20665, 68.003586),\n (89.20665, 68.003586, 89.963343, 68.003586),\n (89.963343, 68.003586, 90.720035, 68.003586),\n (90.720035, 68.003586, 91.476728, 68.003586),\n (91.476728, 68.003586, 92.233421, 68.003586),\n (92.233421, 68.003586, 92.990114, 68.003586),\n (92.990114, 68.003586, 93.746807, 68.003586),\n (93.746807, 68.003586, 94.5035, 68.003586),\n (94.5035, 68.003586, 95.260193, 68.003586),\n (95.260193, 68.003586, 96.016886, 68.003586),\n (96.016886, 68.003586, 96.773579, 68.003586),\n (96.773579, 68.003586, 97.530272, 68.003586),\n (97.530272, 68.003586, 98.286965, 68.003586),\n (98.286965, 68.003586, 99.043657, 68.003586),\n (99.043657, 68.003586, 99.80035, 68.003586),\n (99.80035, 68.003586, 100.557043, 68.003586),\n (100.557043, 68.003586, 101.313736, 68.003586),\n (101.313736, 68.003586, 102.070429, 68.003586),\n (102.070429, 68.003586, 102.827122, 68.003586),\n (102.827122, 68.003586, 103.583815, 68.003586),\n (103.583815, 68.003586, 104.340508, 68.003586),\n (104.340508, 68.003586, 105.097201, 68.003586),\n (105.097201, 68.003586, 105.853894, 68.003586),\n (105.853894, 68.003586, 106.610587, 68.003586),\n (82.396413, 68.003586, 82.396413, 139.889413),\n (192.496414, 178.103587, 192.496414, 177.346894),\n (192.496414, 177.346894, 192.496414, 176.590201),\n (192.496414, 176.590201, 192.496414, 175.833508),\n (192.496414, 175.833508, 192.496414, 175.076815),\n (192.496414, 175.076815, 192.496414, 174.320122),\n (192.496414, 174.320122, 192.496414, 173.563429),\n (192.496414, 173.563429, 192.496414, 172.806736),\n (192.496414, 172.806736, 192.496414, 172.050043),\n (192.496414, 172.050043, 192.496414, 171.29335),\n (192.496414, 171.29335, 192.496414, 170.536657),\n (192.496414, 170.536657, 192.496414, 169.779965),\n (192.496414, 169.779965, 192.496414, 169.023272),\n (192.496414, 169.023272, 192.496414, 168.266579),\n (192.496414, 168.266579, 192.496414, 167.509886),\n (192.496414, 167.509886, 192.496414, 166.753193),\n (192.496414, 166.753193, 192.496414, 165.9965),\n (192.496414, 165.9965, 192.496414, 165.239807),\n (192.496414, 165.239807, 192.496414, 164.483114),\n (192.496414, 164.483114, 192.496414, 163.726421),\n (192.496414, 163.726421, 192.496414, 162.969728),\n (192.496414, 162.969728, 192.496414, 162.213035),\n (192.496414, 162.213035, 192.496414, 161.456343),\n (192.496414, 161.456343, 192.496414, 160.69965),\n (192.496414, 160.69965, 192.496414, 159.942957),\n (192.496414, 159.942957, 192.496414, 159.186264),\n (192.496414, 159.186264, 192.496414, 158.429571),\n (192.496414, 158.429571, 192.496414, 157.672878),\n (192.496414, 157.672878, 192.496414, 156.916185),\n (192.496414, 156.916185, 192.496414, 156.159492),\n (192.496414, 156.159492, 192.496414, 155.402799),\n (192.496414, 155.402799, 192.496414, 154.646106),\n (192.496414, 154.646106, 192.496414, 153.889413),\n (120.610587, 178.103587, 120.610587, 177.346894),\n (120.610587, 177.346894, 120.610587, 176.590201),\n (120.610587, 176.590201, 120.610587, 175.833508),\n (120.610587, 175.833508, 120.610587, 175.076815),\n (120.610587, 175.076815, 120.610587, 174.320122),\n (120.610587, 174.320122, 120.610587, 173.563429),\n (120.610587, 173.563429, 120.610587, 172.806736),\n (120.610587, 172.806736, 120.610587, 172.050043),\n (120.610587, 172.050043, 120.610587, 171.29335),\n (120.610587, 171.29335, 120.610587, 170.536657),\n (120.610587, 170.536657, 120.610587, 169.779965),\n (120.610587, 169.779965, 120.610587, 169.023272),\n (120.610587, 169.023272, 120.610587, 168.266579),\n (120.610587, 168.266579, 120.610587, 167.509886),\n (120.610587, 167.509886, 120.610587, 166.753193),\n (120.610587, 166.753193, 120.610587, 165.9965),\n (120.610587, 165.9965, 120.610587, 165.239807),\n (120.610587, 165.239807, 120.610587, 164.483114),\n (120.610587, 164.483114, 120.610587, 163.726421),\n (120.610587, 163.726421, 120.610587, 162.969728),\n (120.610587, 162.969728, 120.610587, 162.213035),\n (120.610587, 162.213035, 120.610587, 161.456343),\n (120.610587, 161.456343, 120.610587, 160.69965),\n (120.610587, 160.69965, 120.610587, 159.942957),\n (120.610587, 159.942957, 120.610587, 159.186264),\n (120.610587, 159.186264, 120.610587, 158.429571),\n (120.610587, 158.429571, 120.610587, 157.672878),\n (120.610587, 157.672878, 120.610587, 156.916185),\n (120.610587, 156.916185, 120.610587, 156.159492),\n (120.610587, 156.159492, 120.610587, 155.402799),\n (120.610587, 155.402799, 120.610587, 154.646106),\n (120.610587, 154.646106, 120.610587, 153.889413),\n (120.610587, 178.103587, 192.496414, 178.103587),\n (120.610587, 153.889413, 192.496414, 153.889413)\n]\nVISIBLE_CIRCLES = [\n (94.5035, 165.9965, 12.107087)\n]\nVISIBLE_ARCS = [\n\n]\nHIDDEN_SEGMENTS = [\n\n]\n# (orient, text, p1, p2, base) for linear; (orient, text, center, radius, angle) for diameter\nDIMENSIONS = [\n ('diameter', '%%c100', (94.5035, 165.9965), 12.1071, 45),\n ('horizontal', '296.875', (192.4965, 165.9965), (120.6106, 165.9965), (156.5535, 154.9965))\n]\n\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\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\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,\n angle=(0 if d[0] == \"horizontal\" else 90),\n 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,\n text=text, dimstyle=\"EZDXF\").render()\n\n doc.saveas(out_path)\n\n\nif __name__ == \"__main__\":\n out = sys.argv[1] if len(sys.argv) > 1 else \"0053_00534425_gt.dxf\"\n draw(out)\n print(\"wrote\", out)\n```"}], "images": ["images/0053_00534425.png"], "id": "0053_00534425"} {"messages": [{"role": "user", "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 27.32 mm."}, {"role": "assistant", "content": "```python\n#!/usr/bin/env python3\n# -*- coding: utf-8 -*-\n# Ground-truth 2D engineering drawing for part: 0053_00534781\n# Self-contained: reproduces the three-view DXF via ezdxf, NO FreeCAD needed.\n# Coordinates are A4 page millimetres (scale=0.7548110964332886, page=[297.0, 210.0]).\n# visible edges -> solid (layer OUTLINE); hidden edges -> dashed (layer HIDDEN)\n# dimensions -> real movable DIMENSION entities (text = true mm value)\n# Run: python 0053_00534781_gt.py [out.dxf]\nimport sys\nimport ezdxf\n\nSCALE = 0.7548110964332886\nPAGE = [297.0, 210.0]\n\nVISIBLE_SEGMENTS = [\n (145.060855, 80.820255, 142.70207, 80.820255),\n (142.70207, 80.820255, 140.343285, 80.820255),\n (140.343285, 80.820255, 137.984501, 80.820255),\n (137.984501, 80.820255, 135.625716, 80.820255),\n (135.625716, 80.820255, 133.266931, 80.820255),\n (133.266931, 80.820255, 130.908147, 80.820255),\n (130.908147, 80.820255, 128.549362, 80.820255),\n (128.549362, 80.820255, 126.190577, 80.820255),\n (126.190577, 80.820255, 123.831793, 80.820255),\n (123.831793, 80.820255, 121.473008, 80.820255),\n (121.473008, 80.820255, 119.114223, 80.820255),\n (119.114223, 80.820255, 116.755439, 80.820255),\n (116.755439, 80.820255, 114.396654, 80.820255),\n (114.396654, 80.820255, 112.037869, 80.820255),\n (112.037869, 80.820255, 109.679085, 80.820255),\n (109.679085, 80.820255, 107.3203, 80.820255),\n (107.3203, 80.820255, 104.961515, 80.820255),\n (104.961515, 80.820255, 102.602731, 80.820255),\n (102.602731, 80.820255, 100.243946, 80.820255),\n (100.243946, 80.820255, 97.885161, 80.820255),\n (97.885161, 80.820255, 95.526377, 80.820255),\n (95.526377, 80.820255, 93.167592, 80.820255),\n (93.167592, 80.820255, 90.808807, 80.820255),\n (90.808807, 80.820255, 88.450023, 80.820255),\n (88.450023, 80.820255, 86.091238, 80.820255),\n (86.091238, 80.820255, 83.732453, 80.820255),\n (83.732453, 80.820255, 81.373669, 80.820255),\n (81.373669, 80.820255, 79.014884, 80.820255),\n (79.014884, 80.820255, 76.656099, 80.820255),\n (76.656099, 80.820255, 74.297315, 80.820255),\n (74.297315, 80.820255, 71.93853, 80.820255),\n (71.93853, 80.820255, 69.579745, 80.820255),\n (145.060855, 80.820255, 145.060855, 101.439145),\n (145.060855, 101.439145, 142.70207, 101.439145),\n (142.70207, 101.439145, 140.343285, 101.439145),\n (140.343285, 101.439145, 137.984501, 101.439145),\n (137.984501, 101.439145, 135.625716, 101.439145),\n (135.625716, 101.439145, 133.266931, 101.439145),\n (133.266931, 101.439145, 130.908147, 101.439145),\n (130.908147, 101.439145, 128.549362, 101.439145),\n (128.549362, 101.439145, 126.190577, 101.439145),\n (126.190577, 101.439145, 123.831793, 101.439145),\n (123.831793, 101.439145, 121.473008, 101.439145),\n (121.473008, 101.439145, 119.114223, 101.439145),\n (119.114223, 101.439145, 116.755439, 101.439145),\n (116.755439, 101.439145, 114.396654, 101.439145),\n (114.396654, 101.439145, 112.037869, 101.439145),\n (112.037869, 101.439145, 109.679085, 101.439145),\n (109.679085, 101.439145, 107.3203, 101.439145),\n (107.3203, 101.439145, 104.961515, 101.439145),\n (104.961515, 101.439145, 102.602731, 101.439145),\n (102.602731, 101.439145, 100.243946, 101.439145),\n (100.243946, 101.439145, 97.885161, 101.439145),\n (97.885161, 101.439145, 95.526377, 101.439145),\n (95.526377, 101.439145, 93.167592, 101.439145),\n (93.167592, 101.439145, 90.808807, 101.439145),\n (90.808807, 101.439145, 88.450023, 101.439145),\n (88.450023, 101.439145, 86.091238, 101.439145),\n (86.091238, 101.439145, 83.732453, 101.439145),\n (83.732453, 101.439145, 81.373669, 101.439145),\n (81.373669, 101.439145, 79.014884, 101.439145),\n (79.014884, 101.439145, 76.656099, 101.439145),\n (76.656099, 101.439145, 74.297315, 101.439145),\n (74.297315, 101.439145, 71.93853, 101.439145),\n (71.93853, 101.439145, 69.579745, 101.439145),\n (69.579745, 101.439145, 69.579745, 80.820255),\n (159.060855, 115.439145, 159.060855, 117.79793),\n (159.060855, 117.79793, 159.060855, 120.156715),\n (159.060855, 120.156715, 159.060855, 122.515499),\n (159.060855, 122.515499, 159.060855, 124.874284),\n (159.060855, 124.874284, 159.060855, 127.233069),\n (159.060855, 127.233069, 159.060855, 129.591853),\n (159.060855, 129.591853, 159.060855, 131.950638),\n (159.060855, 131.950638, 159.060855, 134.309423),\n (159.060855, 134.309423, 159.060855, 136.668207),\n (159.060855, 136.668207, 159.060855, 139.026992),\n (159.060855, 139.026992, 159.060855, 141.385777),\n (159.060855, 141.385777, 159.060855, 143.744561),\n (159.060855, 143.744561, 159.060855, 146.103346),\n (159.060855, 146.103346, 159.060855, 148.462131),\n (159.060855, 148.462131, 159.060855, 150.820915),\n (159.060855, 150.820915, 159.060855, 153.1797),\n (159.060855, 153.1797, 159.060855, 155.538485),\n (159.060855, 155.538485, 159.060855, 157.897269),\n (159.060855, 157.897269, 159.060855, 160.256054),\n (159.060855, 160.256054, 159.060855, 162.614839),\n (159.060855, 162.614839, 159.060855, 164.973623),\n (159.060855, 164.973623, 159.060855, 167.332408),\n (159.060855, 167.332408, 159.060855, 169.691193),\n (159.060855, 169.691193, 159.060855, 172.049977),\n (159.060855, 172.049977, 159.060855, 174.408762),\n (159.060855, 174.408762, 159.060855, 176.767547),\n (159.060855, 176.767547, 159.060855, 179.126331),\n (159.060855, 179.126331, 159.060855, 181.485116),\n (159.060855, 181.485116, 159.060855, 183.843901),\n (159.060855, 183.843901, 159.060855, 186.202685),\n (159.060855, 186.202685, 159.060855, 188.56147),\n (159.060855, 188.56147, 159.060855, 190.920255),\n (179.679745, 115.439145, 179.679745, 117.79793),\n (179.679745, 117.79793, 179.679745, 120.156715),\n (179.679745, 120.156715, 179.679745, 122.515499),\n (179.679745, 122.515499, 179.679745, 124.874284),\n (179.679745, 124.874284, 179.679745, 127.233069),\n (179.679745, 127.233069, 179.679745, 129.591853),\n (179.679745, 129.591853, 179.679745, 131.950638),\n (179.679745, 131.950638, 179.679745, 134.309423),\n (179.679745, 134.309423, 179.679745, 136.668207),\n (179.679745, 136.668207, 179.679745, 139.026992),\n (179.679745, 139.026992, 179.679745, 141.385777),\n (179.679745, 141.385777, 179.679745, 143.744561),\n (179.679745, 143.744561, 179.679745, 146.103346),\n (179.679745, 146.103346, 179.679745, 148.462131),\n (179.679745, 148.462131, 179.679745, 150.820915),\n (179.679745, 150.820915, 179.679745, 153.1797),\n (179.679745, 153.1797, 179.679745, 155.538485),\n (179.679745, 155.538485, 179.679745, 157.897269),\n (179.679745, 157.897269, 179.679745, 160.256054),\n (179.679745, 160.256054, 179.679745, 162.614839),\n (179.679745, 162.614839, 179.679745, 164.973623),\n (179.679745, 164.973623, 179.679745, 167.332408),\n (179.679745, 167.332408, 179.679745, 169.691193),\n (179.679745, 169.691193, 179.679745, 172.049977),\n (179.679745, 172.049977, 179.679745, 174.408762),\n (179.679745, 174.408762, 179.679745, 176.767547),\n (179.679745, 176.767547, 179.679745, 179.126331),\n (179.679745, 179.126331, 179.679745, 181.485116),\n (179.679745, 181.485116, 179.679745, 183.843901),\n (179.679745, 183.843901, 179.679745, 186.202685),\n (179.679745, 186.202685, 179.679745, 188.56147),\n (179.679745, 188.56147, 179.679745, 190.920255),\n (179.679745, 115.439145, 159.060855, 115.439145),\n (179.679745, 190.920255, 159.060855, 190.920255)\n]\nVISIBLE_CIRCLES = [\n (107.3203, 153.1797, 37.740555)\n]\nVISIBLE_ARCS = [\n\n]\nHIDDEN_SEGMENTS = [\n\n]\n# (orient, text, p1, p2, base) for linear; (orient, text, center, radius, angle) for diameter\nDIMENSIONS = [\n ('diameter', '%%c100', (107.3203, 153.1797), 37.7406, 45),\n ('horizontal', '27.3166', (159.0608, 153.1797), (179.6797, 153.1797), (169.3703, 164.1797))\n]\n\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\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\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,\n angle=(0 if d[0] == \"horizontal\" else 90),\n 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,\n text=text, dimstyle=\"EZDXF\").render()\n\n doc.saveas(out_path)\n\n\nif __name__ == \"__main__\":\n out = sys.argv[1] if len(sys.argv) > 1 else \"0053_00534781_gt.dxf\"\n draw(out)\n print(\"wrote\", out)\n```"}], "images": ["images/0053_00534781.png"], "id": "0053_00534781"} {"messages": [{"role": "user", "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 6.18 mm."}, {"role": "assistant", "content": "```python\n#!/usr/bin/env python3\n# -*- coding: utf-8 -*-\n# Ground-truth 2D engineering drawing for part: 0054_00542271\n# Self-contained: reproduces the three-view DXF via ezdxf, NO FreeCAD needed.\n# Coordinates are A4 page millimetres (scale=0.9050251379521794, page=[297.0, 210.0]).\n# visible edges -> solid (layer OUTLINE); hidden edges -> dashed (layer HIDDEN)\n# dimensions -> real movable DIMENSION entities (text = true mm value)\n# Run: python 0054_00542271_gt.py [out.dxf]\nimport sys\nimport ezdxf\n\nSCALE = 0.9050251379521794\nPAGE = [297.0, 210.0]\n\nVISIBLE_SEGMENTS = [\n (156.326857, 84.575657, 153.498653, 84.575657),\n (153.498653, 84.575657, 150.67045, 84.575657),\n (150.67045, 84.575657, 147.842246, 84.575657),\n (147.842246, 84.575657, 145.014043, 84.575657),\n (145.014043, 84.575657, 142.185839, 84.575657),\n (142.185839, 84.575657, 139.357636, 84.575657),\n (139.357636, 84.575657, 136.529432, 84.575657),\n (136.529432, 84.575657, 133.701228, 84.575657),\n (133.701228, 84.575657, 130.873025, 84.575657),\n (130.873025, 84.575657, 128.044821, 84.575657),\n (128.044821, 84.575657, 125.216618, 84.575657),\n (125.216618, 84.575657, 122.388414, 84.575657),\n (122.388414, 84.575657, 119.560211, 84.575657),\n (119.560211, 84.575657, 116.732007, 84.575657),\n (116.732007, 84.575657, 113.903804, 84.575657),\n (113.903804, 84.575657, 111.0756, 84.575657),\n (111.0756, 84.575657, 108.247396, 84.575657),\n (108.247396, 84.575657, 105.419193, 84.575657),\n (105.419193, 84.575657, 102.590989, 84.575657),\n (102.590989, 84.575657, 99.762786, 84.575657),\n (99.762786, 84.575657, 96.934582, 84.575657),\n (96.934582, 84.575657, 94.106379, 84.575657),\n (94.106379, 84.575657, 91.278175, 84.575657),\n (91.278175, 84.575657, 88.449972, 84.575657),\n (88.449972, 84.575657, 85.621768, 84.575657),\n (85.621768, 84.575657, 82.793564, 84.575657),\n (82.793564, 84.575657, 79.965361, 84.575657),\n (79.965361, 84.575657, 77.137157, 84.575657),\n (77.137157, 84.575657, 74.308954, 84.575657),\n (74.308954, 84.575657, 71.48075, 84.575657),\n (71.48075, 84.575657, 68.652547, 84.575657),\n (68.652547, 84.575657, 65.824343, 84.575657),\n (156.326857, 84.575657, 156.326857, 90.173143),\n (156.326857, 90.173143, 153.498653, 90.173143),\n (153.498653, 90.173143, 150.67045, 90.173143),\n (150.67045, 90.173143, 147.842246, 90.173143),\n (147.842246, 90.173143, 145.014043, 90.173143),\n (145.014043, 90.173143, 142.185839, 90.173143),\n (142.185839, 90.173143, 139.357636, 90.173143),\n (139.357636, 90.173143, 136.529432, 90.173143),\n (136.529432, 90.173143, 133.701228, 90.173143),\n (133.701228, 90.173143, 130.873025, 90.173143),\n (130.873025, 90.173143, 128.044821, 90.173143),\n (128.044821, 90.173143, 125.216618, 90.173143),\n (125.216618, 90.173143, 122.388414, 90.173143),\n (122.388414, 90.173143, 119.560211, 90.173143),\n (119.560211, 90.173143, 116.732007, 90.173143),\n (116.732007, 90.173143, 113.903804, 90.173143),\n (113.903804, 90.173143, 111.0756, 90.173143),\n (111.0756, 90.173143, 108.247396, 90.173143),\n (108.247396, 90.173143, 105.419193, 90.173143),\n (105.419193, 90.173143, 102.590989, 90.173143),\n (102.590989, 90.173143, 99.762786, 90.173143),\n (99.762786, 90.173143, 96.934582, 90.173143),\n (96.934582, 90.173143, 94.106379, 90.173143),\n (94.106379, 90.173143, 91.278175, 90.173143),\n (91.278175, 90.173143, 88.449972, 90.173143),\n (88.449972, 90.173143, 85.621768, 90.173143),\n (85.621768, 90.173143, 82.793564, 90.173143),\n (82.793564, 90.173143, 79.965361, 90.173143),\n (79.965361, 90.173143, 77.137157, 90.173143),\n (77.137157, 90.173143, 74.308954, 90.173143),\n (74.308954, 90.173143, 71.48075, 90.173143),\n (71.48075, 90.173143, 68.652547, 90.173143),\n (68.652547, 90.173143, 65.824343, 90.173143),\n (65.824343, 90.173143, 65.824343, 84.575657),\n (170.326857, 104.173143, 170.326857, 107.001347),\n (170.326857, 107.001347, 170.326857, 109.82955),\n (170.326857, 109.82955, 170.326857, 112.657754),\n (170.326857, 112.657754, 170.326857, 115.485957),\n (170.326857, 115.485957, 170.326857, 118.314161),\n (170.326857, 118.314161, 170.326857, 121.142364),\n (170.326857, 121.142364, 170.326857, 123.970568),\n (170.326857, 123.970568, 170.326857, 126.798772),\n (170.326857, 126.798772, 170.326857, 129.626975),\n (170.326857, 129.626975, 170.326857, 132.455179),\n (170.326857, 132.455179, 170.326857, 135.283382),\n (170.326857, 135.283382, 170.326857, 138.111586),\n (170.326857, 138.111586, 170.326857, 140.939789),\n (170.326857, 140.939789, 170.326857, 143.767993),\n (170.326857, 143.767993, 170.326857, 146.596196),\n (170.326857, 146.596196, 170.326857, 149.4244),\n (170.326857, 149.4244, 170.326857, 152.252604),\n (170.326857, 152.252604, 170.326857, 155.080807),\n (170.326857, 155.080807, 170.326857, 157.909011),\n (170.326857, 157.909011, 170.326857, 160.737214),\n (170.326857, 160.737214, 170.326857, 163.565418),\n (170.326857, 163.565418, 170.326857, 166.393621),\n (170.326857, 166.393621, 170.326857, 169.221825),\n (170.326857, 169.221825, 170.326857, 172.050028),\n (170.326857, 172.050028, 170.326857, 174.878232),\n (170.326857, 174.878232, 170.326857, 177.706436),\n (170.326857, 177.706436, 170.326857, 180.534639),\n (170.326857, 180.534639, 170.326857, 183.362843),\n (170.326857, 183.362843, 170.326857, 186.191046),\n (170.326857, 186.191046, 170.326857, 189.01925),\n (170.326857, 189.01925, 170.326857, 191.847453),\n (170.326857, 191.847453, 170.326857, 194.675657),\n (175.924343, 104.173143, 175.924343, 107.001347),\n (175.924343, 107.001347, 175.924343, 109.82955),\n (175.924343, 109.82955, 175.924343, 112.657754),\n (175.924343, 112.657754, 175.924343, 115.485957),\n (175.924343, 115.485957, 175.924343, 118.314161),\n (175.924343, 118.314161, 175.924343, 121.142364),\n (175.924343, 121.142364, 175.924343, 123.970568),\n (175.924343, 123.970568, 175.924343, 126.798772),\n (175.924343, 126.798772, 175.924343, 129.626975),\n (175.924343, 129.626975, 175.924343, 132.455179),\n (175.924343, 132.455179, 175.924343, 135.283382),\n (175.924343, 135.283382, 175.924343, 138.111586),\n (175.924343, 138.111586, 175.924343, 140.939789),\n (175.924343, 140.939789, 175.924343, 143.767993),\n (175.924343, 143.767993, 175.924343, 146.596196),\n (175.924343, 146.596196, 175.924343, 149.4244),\n (175.924343, 149.4244, 175.924343, 152.252604),\n (175.924343, 152.252604, 175.924343, 155.080807),\n (175.924343, 155.080807, 175.924343, 157.909011),\n (175.924343, 157.909011, 175.924343, 160.737214),\n (175.924343, 160.737214, 175.924343, 163.565418),\n (175.924343, 163.565418, 175.924343, 166.393621),\n (175.924343, 166.393621, 175.924343, 169.221825),\n (175.924343, 169.221825, 175.924343, 172.050028),\n (175.924343, 172.050028, 175.924343, 174.878232),\n (175.924343, 174.878232, 175.924343, 177.706436),\n (175.924343, 177.706436, 175.924343, 180.534639),\n (175.924343, 180.534639, 175.924343, 183.362843),\n (175.924343, 183.362843, 175.924343, 186.191046),\n (175.924343, 186.191046, 175.924343, 189.01925),\n (175.924343, 189.01925, 175.924343, 191.847453),\n (175.924343, 191.847453, 175.924343, 194.675657),\n (175.924343, 104.173143, 170.326857, 104.173143),\n (175.924343, 194.675657, 170.326857, 194.675657)\n]\nVISIBLE_CIRCLES = [\n (111.0756, 149.4244, 45.251257)\n]\nVISIBLE_ARCS = [\n\n]\nHIDDEN_SEGMENTS = [\n\n]\n# (orient, text, p1, p2, base) for linear; (orient, text, center, radius, angle) for diameter\nDIMENSIONS = [\n ('diameter', '%%c100', (111.0756, 149.4244), 45.2513, 45),\n ('horizontal', '6.1849', (170.3269, 149.4244), (175.9244, 149.4244), (173.1256, 160.4244))\n]\n\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\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\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,\n angle=(0 if d[0] == \"horizontal\" else 90),\n 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,\n text=text, dimstyle=\"EZDXF\").render()\n\n doc.saveas(out_path)\n\n\nif __name__ == \"__main__\":\n out = sys.argv[1] if len(sys.argv) > 1 else \"0054_00542271_gt.dxf\"\n draw(out)\n print(\"wrote\", out)\n```"}], "images": ["images/0054_00542271.png"], "id": "0054_00542271"} {"messages": [{"role": "user", "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 10.31 mm."}, {"role": "assistant", "content": "```python\n#!/usr/bin/env python3\n# -*- coding: utf-8 -*-\n# Ground-truth 2D engineering drawing for part: 0055_00555490\n# Self-contained: reproduces the three-view DXF via ezdxf, NO FreeCAD needed.\n# Coordinates are A4 page millimetres (scale=0.8711957505410208, page=[297.0, 210.0]).\n# visible edges -> solid (layer OUTLINE); hidden edges -> dashed (layer HIDDEN)\n# dimensions -> real movable DIMENSION entities (text = true mm value)\n# Run: python 0055_00555490_gt.py [out.dxf]\nimport sys\nimport ezdxf\n\nSCALE = 0.8711957505410208\nPAGE = [297.0, 210.0]\n\nVISIBLE_SEGMENTS = [\n (153.789688, 83.729887, 151.067201, 83.729887),\n (151.067201, 83.729887, 148.344714, 83.729887),\n (148.344714, 83.729887, 145.622227, 83.729887),\n (145.622227, 83.729887, 142.899741, 83.729887),\n (142.899741, 83.729887, 140.177254, 83.729887),\n (140.177254, 83.729887, 137.454767, 83.729887),\n (137.454767, 83.729887, 134.73228, 83.729887),\n (134.73228, 83.729887, 132.009794, 83.729887),\n (132.009794, 83.729887, 129.287307, 83.729887),\n (129.287307, 83.729887, 126.56482, 83.729887),\n (126.56482, 83.729887, 123.842334, 83.729887),\n (123.842334, 83.729887, 121.119847, 83.729887),\n (121.119847, 83.729887, 118.39736, 83.729887),\n (118.39736, 83.729887, 115.674873, 83.729887),\n (115.674873, 83.729887, 112.952387, 83.729887),\n (112.952387, 83.729887, 110.2299, 83.729887),\n (110.2299, 83.729887, 107.507413, 83.729887),\n (107.507413, 83.729887, 104.784927, 83.729887),\n (104.784927, 83.729887, 102.06244, 83.729887),\n (102.06244, 83.729887, 99.339953, 83.729887),\n (99.339953, 83.729887, 96.617466, 83.729887),\n (96.617466, 83.729887, 93.89498, 83.729887),\n (93.89498, 83.729887, 91.172493, 83.729887),\n (91.172493, 83.729887, 88.450006, 83.729887),\n (88.450006, 83.729887, 85.72752, 83.729887),\n (85.72752, 83.729887, 83.005033, 83.729887),\n (83.005033, 83.729887, 80.282546, 83.729887),\n (80.282546, 83.729887, 77.560059, 83.729887),\n (77.560059, 83.729887, 74.837573, 83.729887),\n (74.837573, 83.729887, 72.115086, 83.729887),\n (72.115086, 83.729887, 69.392599, 83.729887),\n (69.392599, 83.729887, 66.670112, 83.729887),\n (153.789688, 83.729887, 153.789688, 92.710312),\n (153.789688, 92.710312, 151.067201, 92.710312),\n (151.067201, 92.710312, 148.344714, 92.710312),\n (148.344714, 92.710312, 145.622227, 92.710312),\n (145.622227, 92.710312, 142.899741, 92.710312),\n (142.899741, 92.710312, 140.177254, 92.710312),\n (140.177254, 92.710312, 137.454767, 92.710312),\n (137.454767, 92.710312, 134.73228, 92.710312),\n (134.73228, 92.710312, 132.009794, 92.710312),\n (132.009794, 92.710312, 129.287307, 92.710312),\n (129.287307, 92.710312, 126.56482, 92.710312),\n (126.56482, 92.710312, 123.842334, 92.710312),\n (123.842334, 92.710312, 121.119847, 92.710312),\n (121.119847, 92.710312, 118.39736, 92.710312),\n (118.39736, 92.710312, 115.674873, 92.710312),\n (115.674873, 92.710312, 112.952387, 92.710312),\n (112.952387, 92.710312, 110.2299, 92.710312),\n (110.2299, 92.710312, 107.507413, 92.710312),\n (107.507413, 92.710312, 104.784927, 92.710312),\n (104.784927, 92.710312, 102.06244, 92.710312),\n (102.06244, 92.710312, 99.339953, 92.710312),\n (99.339953, 92.710312, 96.617466, 92.710312),\n (96.617466, 92.710312, 93.89498, 92.710312),\n (93.89498, 92.710312, 91.172493, 92.710312),\n (91.172493, 92.710312, 88.450006, 92.710312),\n (88.450006, 92.710312, 85.72752, 92.710312),\n (85.72752, 92.710312, 83.005033, 92.710312),\n (83.005033, 92.710312, 80.282546, 92.710312),\n (80.282546, 92.710312, 77.560059, 92.710312),\n (77.560059, 92.710312, 74.837573, 92.710312),\n (74.837573, 92.710312, 72.115086, 92.710312),\n (72.115086, 92.710312, 69.392599, 92.710312),\n (69.392599, 92.710312, 66.670112, 92.710312),\n (66.670112, 92.710312, 66.670112, 83.729887),\n (167.789688, 106.710312, 167.789688, 109.432799),\n (167.789688, 109.432799, 167.789688, 112.155286),\n (167.789688, 112.155286, 167.789688, 114.877773),\n (167.789688, 114.877773, 167.789688, 117.600259),\n (167.789688, 117.600259, 167.789688, 120.322746),\n (167.789688, 120.322746, 167.789688, 123.045233),\n (167.789688, 123.045233, 167.789688, 125.76772),\n (167.789688, 125.76772, 167.789688, 128.490206),\n (167.789688, 128.490206, 167.789688, 131.212693),\n (167.789688, 131.212693, 167.789688, 133.93518),\n (167.789688, 133.93518, 167.789688, 136.657666),\n (167.789688, 136.657666, 167.789688, 139.380153),\n (167.789688, 139.380153, 167.789688, 142.10264),\n (167.789688, 142.10264, 167.789688, 144.825127),\n (167.789688, 144.825127, 167.789688, 147.547613),\n (167.789688, 147.547613, 167.789688, 150.2701),\n (167.789688, 150.2701, 167.789688, 152.992587),\n (167.789688, 152.992587, 167.789688, 155.715073),\n (167.789688, 155.715073, 167.789688, 158.43756),\n (167.789688, 158.43756, 167.789688, 161.160047),\n (167.789688, 161.160047, 167.789688, 163.882534),\n (167.789688, 163.882534, 167.789688, 166.60502),\n (167.789688, 166.60502, 167.789688, 169.327507),\n (167.789688, 169.327507, 167.789688, 172.049994),\n (167.789688, 172.049994, 167.789688, 174.77248),\n (167.789688, 174.77248, 167.789688, 177.494967),\n (167.789688, 177.494967, 167.789688, 180.217454),\n (167.789688, 180.217454, 167.789688, 182.939941),\n (167.789688, 182.939941, 167.789688, 185.662427),\n (167.789688, 185.662427, 167.789688, 188.384914),\n (167.789688, 188.384914, 167.789688, 191.107401),\n (167.789688, 191.107401, 167.789688, 193.829888),\n (176.770113, 106.710312, 176.770113, 109.432799),\n (176.770113, 109.432799, 176.770113, 112.155286),\n (176.770113, 112.155286, 176.770113, 114.877773),\n (176.770113, 114.877773, 176.770113, 117.600259),\n (176.770113, 117.600259, 176.770113, 120.322746),\n (176.770113, 120.322746, 176.770113, 123.045233),\n (176.770113, 123.045233, 176.770113, 125.76772),\n (176.770113, 125.76772, 176.770113, 128.490206),\n (176.770113, 128.490206, 176.770113, 131.212693),\n (176.770113, 131.212693, 176.770113, 133.93518),\n (176.770113, 133.93518, 176.770113, 136.657666),\n (176.770113, 136.657666, 176.770113, 139.380153),\n (176.770113, 139.380153, 176.770113, 142.10264),\n (176.770113, 142.10264, 176.770113, 144.825127),\n (176.770113, 144.825127, 176.770113, 147.547613),\n (176.770113, 147.547613, 176.770113, 150.2701),\n (176.770113, 150.2701, 176.770113, 152.992587),\n (176.770113, 152.992587, 176.770113, 155.715073),\n (176.770113, 155.715073, 176.770113, 158.43756),\n (176.770113, 158.43756, 176.770113, 161.160047),\n (176.770113, 161.160047, 176.770113, 163.882534),\n (176.770113, 163.882534, 176.770113, 166.60502),\n (176.770113, 166.60502, 176.770113, 169.327507),\n (176.770113, 169.327507, 176.770113, 172.049994),\n (176.770113, 172.049994, 176.770113, 174.77248),\n (176.770113, 174.77248, 176.770113, 177.494967),\n (176.770113, 177.494967, 176.770113, 180.217454),\n (176.770113, 180.217454, 176.770113, 182.939941),\n (176.770113, 182.939941, 176.770113, 185.662427),\n (176.770113, 185.662427, 176.770113, 188.384914),\n (176.770113, 188.384914, 176.770113, 191.107401),\n (176.770113, 191.107401, 176.770113, 193.829888),\n (176.770113, 106.710312, 167.789688, 106.710312),\n (176.770113, 193.829888, 167.789688, 193.829888)\n]\nVISIBLE_CIRCLES = [\n (110.2299, 150.2701, 43.559788)\n]\nVISIBLE_ARCS = [\n\n]\nHIDDEN_SEGMENTS = [\n\n]\n# (orient, text, p1, p2, base) for linear; (orient, text, center, radius, angle) for diameter\nDIMENSIONS = [\n ('diameter', '%%c100', (110.2299, 150.2701), 43.5598, 45),\n ('horizontal', '10.3082', (167.7897, 150.2701), (176.7701, 150.2701), (172.2799, 161.2701))\n]\n\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\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\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,\n angle=(0 if d[0] == \"horizontal\" else 90),\n 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,\n text=text, dimstyle=\"EZDXF\").render()\n\n doc.saveas(out_path)\n\n\nif __name__ == \"__main__\":\n out = sys.argv[1] if len(sys.argv) > 1 else \"0055_00555490_gt.dxf\"\n draw(out)\n print(\"wrote\", out)\n```"}], "images": ["images/0055_00555490.png"], "id": "0055_00555490"} {"messages": [{"role": "user", "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 250 mm."}, {"role": "assistant", "content": "```python\n#!/usr/bin/env python3\n# -*- coding: utf-8 -*-\n# Ground-truth 2D engineering drawing for part: 0055_00558540\n# Self-contained: reproduces the three-view DXF via ezdxf, NO FreeCAD needed.\n# Coordinates are A4 page millimetres (scale=0.2745714285714286, page=[297.0, 210.0]).\n# visible edges -> solid (layer OUTLINE); hidden edges -> dashed (layer HIDDEN)\n# dimensions -> real movable DIMENSION entities (text = true mm value)\n# Run: python 0055_00558540_gt.py [out.dxf]\nimport sys\nimport ezdxf\n\nSCALE = 0.2745714285714286\nPAGE = [297.0, 210.0]\n\nVISIBLE_SEGMENTS = [\n (109.042871, 68.814271, 108.184836, 68.814271),\n (108.184836, 68.814271, 107.3268, 68.814271),\n (107.3268, 68.814271, 106.468764, 68.814271),\n (106.468764, 68.814271, 105.610729, 68.814271),\n (105.610729, 68.814271, 104.752693, 68.814271),\n (104.752693, 68.814271, 103.894657, 68.814271),\n (103.894657, 68.814271, 103.036621, 68.814271),\n (103.036621, 68.814271, 102.178586, 68.814271),\n (102.178586, 68.814271, 101.32055, 68.814271),\n (101.32055, 68.814271, 100.462514, 68.814271),\n (100.462514, 68.814271, 99.604479, 68.814271),\n (99.604479, 68.814271, 98.746443, 68.814271),\n (98.746443, 68.814271, 97.888407, 68.814271),\n (97.888407, 68.814271, 97.030371, 68.814271),\n (97.030371, 68.814271, 96.172336, 68.814271),\n (96.172336, 68.814271, 95.3143, 68.814271),\n (95.3143, 68.814271, 94.456264, 68.814271),\n (94.456264, 68.814271, 93.598229, 68.814271),\n (93.598229, 68.814271, 92.740193, 68.814271),\n (92.740193, 68.814271, 91.882157, 68.814271),\n (91.882157, 68.814271, 91.024121, 68.814271),\n (91.024121, 68.814271, 90.166086, 68.814271),\n (90.166086, 68.814271, 89.30805, 68.814271),\n (89.30805, 68.814271, 88.450014, 68.814271),\n (88.450014, 68.814271, 87.591979, 68.814271),\n (87.591979, 68.814271, 86.733943, 68.814271),\n (86.733943, 68.814271, 85.875907, 68.814271),\n (85.875907, 68.814271, 85.017871, 68.814271),\n (85.017871, 68.814271, 84.159836, 68.814271),\n (84.159836, 68.814271, 83.3018, 68.814271),\n (83.3018, 68.814271, 82.443764, 68.814271),\n (82.443764, 68.814271, 81.585729, 68.814271),\n (109.042871, 68.814271, 109.042871, 137.457128),\n (109.042871, 137.457128, 108.184836, 137.457128),\n (108.184836, 137.457128, 107.3268, 137.457128),\n (107.3268, 137.457128, 106.468764, 137.457128),\n (106.468764, 137.457128, 105.610729, 137.457128),\n (105.610729, 137.457128, 104.752693, 137.457128),\n (104.752693, 137.457128, 103.894657, 137.457128),\n (103.894657, 137.457128, 103.036621, 137.457128),\n (103.036621, 137.457128, 102.178586, 137.457128),\n (102.178586, 137.457128, 101.32055, 137.457128),\n (101.32055, 137.457128, 100.462514, 137.457128),\n (100.462514, 137.457128, 99.604479, 137.457128),\n (99.604479, 137.457128, 98.746443, 137.457128),\n (98.746443, 137.457128, 97.888407, 137.457128),\n (97.888407, 137.457128, 97.030371, 137.457128),\n (97.030371, 137.457128, 96.172336, 137.457128),\n (96.172336, 137.457128, 95.3143, 137.457128),\n (95.3143, 137.457128, 94.456264, 137.457128),\n (94.456264, 137.457128, 93.598229, 137.457128),\n (93.598229, 137.457128, 92.740193, 137.457128),\n (92.740193, 137.457128, 91.882157, 137.457128),\n (91.882157, 137.457128, 91.024121, 137.457128),\n (91.024121, 137.457128, 90.166086, 137.457128),\n (90.166086, 137.457128, 89.30805, 137.457128),\n (89.30805, 137.457128, 88.450014, 137.457128),\n (88.450014, 137.457128, 87.591979, 137.457128),\n (87.591979, 137.457128, 86.733943, 137.457128),\n (86.733943, 137.457128, 85.875907, 137.457128),\n (85.875907, 137.457128, 85.017871, 137.457128),\n (85.017871, 137.457128, 84.159836, 137.457128),\n (84.159836, 137.457128, 83.3018, 137.457128),\n (83.3018, 137.457128, 82.443764, 137.457128),\n (82.443764, 137.457128, 81.585729, 137.457128),\n (81.585729, 137.457128, 81.585729, 68.814271),\n (123.042872, 151.457129, 123.042872, 152.315164),\n (123.042872, 152.315164, 123.042872, 153.1732),\n (123.042872, 153.1732, 123.042872, 154.031236),\n (123.042872, 154.031236, 123.042872, 154.889271),\n (123.042872, 154.889271, 123.042872, 155.747307),\n (123.042872, 155.747307, 123.042872, 156.605343),\n (123.042872, 156.605343, 123.042872, 157.463379),\n (123.042872, 157.463379, 123.042872, 158.321414),\n (123.042872, 158.321414, 123.042872, 159.17945),\n (123.042872, 159.17945, 123.042872, 160.037486),\n (123.042872, 160.037486, 123.042872, 160.895521),\n (123.042872, 160.895521, 123.042872, 161.753557),\n (123.042872, 161.753557, 123.042872, 162.611593),\n (123.042872, 162.611593, 123.042872, 163.469629),\n (123.042872, 163.469629, 123.042872, 164.327664),\n (123.042872, 164.327664, 123.042872, 165.1857),\n (123.042872, 165.1857, 123.042872, 166.043736),\n (123.042872, 166.043736, 123.042872, 166.901771),\n (123.042872, 166.901771, 123.042872, 167.759807),\n (123.042872, 167.759807, 123.042872, 168.617843),\n (123.042872, 168.617843, 123.042872, 169.475879),\n (123.042872, 169.475879, 123.042872, 170.333914),\n (123.042872, 170.333914, 123.042872, 171.19195),\n (123.042872, 171.19195, 123.042872, 172.049986),\n (123.042872, 172.049986, 123.042872, 172.908021),\n (123.042872, 172.908021, 123.042872, 173.766057),\n (123.042872, 173.766057, 123.042872, 174.624093),\n (123.042872, 174.624093, 123.042872, 175.482129),\n (123.042872, 175.482129, 123.042872, 176.340164),\n (123.042872, 176.340164, 123.042872, 177.1982),\n (123.042872, 177.1982, 123.042872, 178.056236),\n (123.042872, 178.056236, 123.042872, 178.914271),\n (191.685729, 151.457129, 191.685729, 152.315164),\n (191.685729, 152.315164, 191.685729, 153.1732),\n (191.685729, 153.1732, 191.685729, 154.031236),\n (191.685729, 154.031236, 191.685729, 154.889271),\n (191.685729, 154.889271, 191.685729, 155.747307),\n (191.685729, 155.747307, 191.685729, 156.605343),\n (191.685729, 156.605343, 191.685729, 157.463379),\n (191.685729, 157.463379, 191.685729, 158.321414),\n (191.685729, 158.321414, 191.685729, 159.17945),\n (191.685729, 159.17945, 191.685729, 160.037486),\n (191.685729, 160.037486, 191.685729, 160.895521),\n (191.685729, 160.895521, 191.685729, 161.753557),\n (191.685729, 161.753557, 191.685729, 162.611593),\n (191.685729, 162.611593, 191.685729, 163.469629),\n (191.685729, 163.469629, 191.685729, 164.327664),\n (191.685729, 164.327664, 191.685729, 165.1857),\n (191.685729, 165.1857, 191.685729, 166.043736),\n (191.685729, 166.043736, 191.685729, 166.901771),\n (191.685729, 166.901771, 191.685729, 167.759807),\n (191.685729, 167.759807, 191.685729, 168.617843),\n (191.685729, 168.617843, 191.685729, 169.475879),\n (191.685729, 169.475879, 191.685729, 170.333914),\n (191.685729, 170.333914, 191.685729, 171.19195),\n (191.685729, 171.19195, 191.685729, 172.049986),\n (191.685729, 172.049986, 191.685729, 172.908021),\n (191.685729, 172.908021, 191.685729, 173.766057),\n (191.685729, 173.766057, 191.685729, 174.624093),\n (191.685729, 174.624093, 191.685729, 175.482129),\n (191.685729, 175.482129, 191.685729, 176.340164),\n (191.685729, 176.340164, 191.685729, 177.1982),\n (191.685729, 177.1982, 191.685729, 178.056236),\n (191.685729, 178.056236, 191.685729, 178.914271),\n (191.685729, 151.457129, 123.042872, 151.457129),\n (191.685729, 178.914271, 123.042872, 178.914271)\n]\nVISIBLE_CIRCLES = [\n (95.3143, 165.1857, 13.728571)\n]\nVISIBLE_ARCS = [\n\n]\nHIDDEN_SEGMENTS = [\n\n]\n# (orient, text, p1, p2, base) for linear; (orient, text, center, radius, angle) for diameter\nDIMENSIONS = [\n ('diameter', '%%c100', (95.3143, 165.1857), 13.7286, 45),\n ('horizontal', '250', (123.0429, 165.1857), (191.6857, 165.1857), (157.3643, 176.1857))\n]\n\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\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\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,\n angle=(0 if d[0] == \"horizontal\" else 90),\n 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,\n text=text, dimstyle=\"EZDXF\").render()\n\n doc.saveas(out_path)\n\n\nif __name__ == \"__main__\":\n out = sys.argv[1] if len(sys.argv) > 1 else \"0055_00558540_gt.dxf\"\n draw(out)\n print(\"wrote\", out)\n```"}], "images": ["images/0055_00558540.png"], "id": "0055_00558540"} {"messages": [{"role": "user", "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 96.94 mm."}, {"role": "assistant", "content": "```python\n#!/usr/bin/env python3\n# -*- coding: utf-8 -*-\n# Ground-truth 2D engineering drawing for part: 0055_00558727\n# Self-contained: reproduces the three-view DXF via ezdxf, NO FreeCAD needed.\n# Coordinates are A4 page millimetres (scale=0.48796891191709874, page=[297.0, 210.0]).\n# visible edges -> solid (layer OUTLINE); hidden edges -> dashed (layer HIDDEN)\n# dimensions -> real movable DIMENSION entities (text = true mm value)\n# Run: python 0055_00558727_gt.py [out.dxf]\nimport sys\nimport ezdxf\n\nSCALE = 0.48796891191709874\nPAGE = [297.0, 210.0]\n\nVISIBLE_SEGMENTS = [\n (125.047646, 74.149245, 123.522743, 74.149245),\n (123.522743, 74.149245, 121.99784, 74.149245),\n (121.99784, 74.149245, 120.472937, 74.149245),\n (120.472937, 74.149245, 118.948034, 74.149245),\n (118.948034, 74.149245, 117.423131, 74.149245),\n (117.423131, 74.149245, 115.898228, 74.149245),\n (115.898228, 74.149245, 114.373326, 74.149245),\n (114.373326, 74.149245, 112.848423, 74.149245),\n (112.848423, 74.149245, 111.32352, 74.149245),\n (111.32352, 74.149245, 109.798617, 74.149245),\n (109.798617, 74.149245, 108.273714, 74.149245),\n (108.273714, 74.149245, 106.748811, 74.149245),\n (106.748811, 74.149245, 105.223909, 74.149245),\n (105.223909, 74.149245, 103.699006, 74.149245),\n (103.699006, 74.149245, 102.174103, 74.149245),\n (102.174103, 74.149245, 100.6492, 74.149245),\n (100.6492, 74.149245, 99.124297, 74.149245),\n (99.124297, 74.149245, 97.599394, 74.149245),\n (97.599394, 74.149245, 96.074491, 74.149245),\n (96.074491, 74.149245, 94.549589, 74.149245),\n (94.549589, 74.149245, 93.024686, 74.149245),\n (93.024686, 74.149245, 91.499783, 74.149245),\n (91.499783, 74.149245, 89.97488, 74.149245),\n (89.97488, 74.149245, 88.449977, 74.149245),\n (88.449977, 74.149245, 86.925074, 74.149245),\n (86.925074, 74.149245, 85.400172, 74.149245),\n (85.400172, 74.149245, 83.875269, 74.149245),\n (83.875269, 74.149245, 82.350366, 74.149245),\n (82.350366, 74.149245, 80.825463, 74.149245),\n (80.825463, 74.149245, 79.30056, 74.149245),\n (79.30056, 74.149245, 77.775657, 74.149245),\n (77.775657, 74.149245, 76.250754, 74.149245),\n (125.047646, 74.149245, 125.047646, 121.452354),\n (125.047646, 121.452354, 123.522743, 121.452354),\n (123.522743, 121.452354, 121.99784, 121.452354),\n (121.99784, 121.452354, 120.472937, 121.452354),\n (120.472937, 121.452354, 118.948034, 121.452354),\n (118.948034, 121.452354, 117.423131, 121.452354),\n (117.423131, 121.452354, 115.898228, 121.452354),\n (115.898228, 121.452354, 114.373326, 121.452354),\n (114.373326, 121.452354, 112.848423, 121.452354),\n (112.848423, 121.452354, 111.32352, 121.452354),\n (111.32352, 121.452354, 109.798617, 121.452354),\n (109.798617, 121.452354, 108.273714, 121.452354),\n (108.273714, 121.452354, 106.748811, 121.452354),\n (106.748811, 121.452354, 105.223909, 121.452354),\n (105.223909, 121.452354, 103.699006, 121.452354),\n (103.699006, 121.452354, 102.174103, 121.452354),\n (102.174103, 121.452354, 100.6492, 121.452354),\n (100.6492, 121.452354, 99.124297, 121.452354),\n (99.124297, 121.452354, 97.599394, 121.452354),\n (97.599394, 121.452354, 96.074491, 121.452354),\n (96.074491, 121.452354, 94.549589, 121.452354),\n (94.549589, 121.452354, 93.024686, 121.452354),\n (93.024686, 121.452354, 91.499783, 121.452354),\n (91.499783, 121.452354, 89.97488, 121.452354),\n (89.97488, 121.452354, 88.449977, 121.452354),\n (88.449977, 121.452354, 86.925074, 121.452354),\n (86.925074, 121.452354, 85.400172, 121.452354),\n (85.400172, 121.452354, 83.875269, 121.452354),\n (83.875269, 121.452354, 82.350366, 121.452354),\n (82.350366, 121.452354, 80.825463, 121.452354),\n (80.825463, 121.452354, 79.30056, 121.452354),\n (79.30056, 121.452354, 77.775657, 121.452354),\n (77.775657, 121.452354, 76.250754, 121.452354),\n (76.250754, 121.452354, 76.250754, 74.149245),\n (139.047646, 135.452354, 139.047646, 136.977257),\n (139.047646, 136.977257, 139.047646, 138.50216),\n (139.047646, 138.50216, 139.047646, 140.027063),\n (139.047646, 140.027063, 139.047646, 141.551966),\n (139.047646, 141.551966, 139.047646, 143.076869),\n (139.047646, 143.076869, 139.047646, 144.601772),\n (139.047646, 144.601772, 139.047646, 146.126674),\n (139.047646, 146.126674, 139.047646, 147.651577),\n (139.047646, 147.651577, 139.047646, 149.17648),\n (139.047646, 149.17648, 139.047646, 150.701383),\n (139.047646, 150.701383, 139.047646, 152.226286),\n (139.047646, 152.226286, 139.047646, 153.751189),\n (139.047646, 153.751189, 139.047646, 155.276091),\n (139.047646, 155.276091, 139.047646, 156.800994),\n (139.047646, 156.800994, 139.047646, 158.325897),\n (139.047646, 158.325897, 139.047646, 159.8508),\n (139.047646, 159.8508, 139.047646, 161.375703),\n (139.047646, 161.375703, 139.047646, 162.900606),\n (139.047646, 162.900606, 139.047646, 164.425509),\n (139.047646, 164.425509, 139.047646, 165.950411),\n (139.047646, 165.950411, 139.047646, 167.475314),\n (139.047646, 167.475314, 139.047646, 169.000217),\n (139.047646, 169.000217, 139.047646, 170.52512),\n (139.047646, 170.52512, 139.047646, 172.050023),\n (139.047646, 172.050023, 139.047646, 173.574926),\n (139.047646, 173.574926, 139.047646, 175.099828),\n (139.047646, 175.099828, 139.047646, 176.624731),\n (139.047646, 176.624731, 139.047646, 178.149634),\n (139.047646, 178.149634, 139.047646, 179.674537),\n (139.047646, 179.674537, 139.047646, 181.19944),\n (139.047646, 181.19944, 139.047646, 182.724343),\n (139.047646, 182.724343, 139.047646, 184.249246),\n (186.350755, 135.452354, 186.350755, 136.977257),\n (186.350755, 136.977257, 186.350755, 138.50216),\n (186.350755, 138.50216, 186.350755, 140.027063),\n (186.350755, 140.027063, 186.350755, 141.551966),\n (186.350755, 141.551966, 186.350755, 143.076869),\n (186.350755, 143.076869, 186.350755, 144.601772),\n (186.350755, 144.601772, 186.350755, 146.126674),\n (186.350755, 146.126674, 186.350755, 147.651577),\n (186.350755, 147.651577, 186.350755, 149.17648),\n (186.350755, 149.17648, 186.350755, 150.701383),\n (186.350755, 150.701383, 186.350755, 152.226286),\n (186.350755, 152.226286, 186.350755, 153.751189),\n (186.350755, 153.751189, 186.350755, 155.276091),\n (186.350755, 155.276091, 186.350755, 156.800994),\n (186.350755, 156.800994, 186.350755, 158.325897),\n (186.350755, 158.325897, 186.350755, 159.8508),\n (186.350755, 159.8508, 186.350755, 161.375703),\n (186.350755, 161.375703, 186.350755, 162.900606),\n (186.350755, 162.900606, 186.350755, 164.425509),\n (186.350755, 164.425509, 186.350755, 165.950411),\n (186.350755, 165.950411, 186.350755, 167.475314),\n (186.350755, 167.475314, 186.350755, 169.000217),\n (186.350755, 169.000217, 186.350755, 170.52512),\n (186.350755, 170.52512, 186.350755, 172.050023),\n (186.350755, 172.050023, 186.350755, 173.574926),\n (186.350755, 173.574926, 186.350755, 175.099828),\n (186.350755, 175.099828, 186.350755, 176.624731),\n (186.350755, 176.624731, 186.350755, 178.149634),\n (186.350755, 178.149634, 186.350755, 179.674537),\n (186.350755, 179.674537, 186.350755, 181.19944),\n (186.350755, 181.19944, 186.350755, 182.724343),\n (186.350755, 182.724343, 186.350755, 184.249246),\n (186.350755, 135.452354, 139.047646, 135.452354),\n (186.350755, 184.249246, 139.047646, 184.249246)\n]\nVISIBLE_CIRCLES = [\n (100.6492, 159.8508, 24.398446)\n]\nVISIBLE_ARCS = [\n\n]\nHIDDEN_SEGMENTS = [\n\n]\n# (orient, text, p1, p2, base) for linear; (orient, text, center, radius, angle) for diameter\nDIMENSIONS = [\n ('diameter', '%%c100', (100.6492, 159.8508), 24.3984, 45),\n ('horizontal', '96.9388', (139.0477, 159.8508), (186.3508, 159.8508), (162.6992, 170.8508))\n]\n\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\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\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,\n angle=(0 if d[0] == \"horizontal\" else 90),\n 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,\n text=text, dimstyle=\"EZDXF\").render()\n\n doc.saveas(out_path)\n\n\nif __name__ == \"__main__\":\n out = sys.argv[1] if len(sys.argv) > 1 else \"0055_00558727_gt.dxf\"\n draw(out)\n print(\"wrote\", out)\n```"}], "images": ["images/0055_00558727.png"], "id": "0055_00558727"} {"messages": [{"role": "user", "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 84.11 mm."}, {"role": "assistant", "content": "```python\n#!/usr/bin/env python3\n# -*- coding: utf-8 -*-\n# Ground-truth 2D engineering drawing for part: 0056_00568716\n# Self-contained: reproduces the three-view DXF via ezdxf, NO FreeCAD needed.\n# Coordinates are A4 page millimetres (scale=0.521957567185291, page=[297.0, 210.0]).\n# visible edges -> solid (layer OUTLINE); hidden edges -> dashed (layer HIDDEN)\n# dimensions -> real movable DIMENSION entities (text = true mm value)\n# Run: python 0056_00568716_gt.py [out.dxf]\nimport sys\nimport ezdxf\n\nSCALE = 0.521957567185291\nPAGE = [297.0, 210.0]\n\nVISIBLE_SEGMENTS = [\n (127.596778, 74.998878, 125.965661, 74.998878),\n (125.965661, 74.998878, 124.334544, 74.998878),\n (124.334544, 74.998878, 122.703426, 74.998878),\n (122.703426, 74.998878, 121.072309, 74.998878),\n (121.072309, 74.998878, 119.441191, 74.998878),\n (119.441191, 74.998878, 117.810074, 74.998878),\n (117.810074, 74.998878, 116.178957, 74.998878),\n (116.178957, 74.998878, 114.547839, 74.998878),\n (114.547839, 74.998878, 112.916722, 74.998878),\n (112.916722, 74.998878, 111.285604, 74.998878),\n (111.285604, 74.998878, 109.654487, 74.998878),\n (109.654487, 74.998878, 108.02337, 74.998878),\n (108.02337, 74.998878, 106.392252, 74.998878),\n (106.392252, 74.998878, 104.761135, 74.998878),\n (104.761135, 74.998878, 103.130017, 74.998878),\n (103.130017, 74.998878, 101.4989, 74.998878),\n (101.4989, 74.998878, 99.867783, 74.998878),\n (99.867783, 74.998878, 98.236665, 74.998878),\n (98.236665, 74.998878, 96.605548, 74.998878),\n (96.605548, 74.998878, 94.97443, 74.998878),\n (94.97443, 74.998878, 93.343313, 74.998878),\n (93.343313, 74.998878, 91.712196, 74.998878),\n (91.712196, 74.998878, 90.081078, 74.998878),\n (90.081078, 74.998878, 88.449961, 74.998878),\n (88.449961, 74.998878, 86.818843, 74.998878),\n (86.818843, 74.998878, 85.187726, 74.998878),\n (85.187726, 74.998878, 83.556609, 74.998878),\n (83.556609, 74.998878, 81.925491, 74.998878),\n (81.925491, 74.998878, 80.294374, 74.998878),\n (80.294374, 74.998878, 78.663256, 74.998878),\n (78.663256, 74.998878, 77.032139, 74.998878),\n (77.032139, 74.998878, 75.401022, 74.998878),\n (127.596778, 74.998878, 127.596778, 118.903121),\n (127.596778, 118.903121, 125.965661, 118.903121),\n (125.965661, 118.903121, 124.334544, 118.903121),\n (124.334544, 118.903121, 122.703426, 118.903121),\n (122.703426, 118.903121, 121.072309, 118.903121),\n (121.072309, 118.903121, 119.441191, 118.903121),\n (119.441191, 118.903121, 117.810074, 118.903121),\n (117.810074, 118.903121, 116.178957, 118.903121),\n (116.178957, 118.903121, 114.547839, 118.903121),\n (114.547839, 118.903121, 112.916722, 118.903121),\n (112.916722, 118.903121, 111.285604, 118.903121),\n (111.285604, 118.903121, 109.654487, 118.903121),\n (109.654487, 118.903121, 108.02337, 118.903121),\n (108.02337, 118.903121, 106.392252, 118.903121),\n (106.392252, 118.903121, 104.761135, 118.903121),\n (104.761135, 118.903121, 103.130017, 118.903121),\n (103.130017, 118.903121, 101.4989, 118.903121),\n (101.4989, 118.903121, 99.867783, 118.903121),\n (99.867783, 118.903121, 98.236665, 118.903121),\n (98.236665, 118.903121, 96.605548, 118.903121),\n (96.605548, 118.903121, 94.97443, 118.903121),\n (94.97443, 118.903121, 93.343313, 118.903121),\n (93.343313, 118.903121, 91.712196, 118.903121),\n (91.712196, 118.903121, 90.081078, 118.903121),\n (90.081078, 118.903121, 88.449961, 118.903121),\n (88.449961, 118.903121, 86.818843, 118.903121),\n (86.818843, 118.903121, 85.187726, 118.903121),\n (85.187726, 118.903121, 83.556609, 118.903121),\n (83.556609, 118.903121, 81.925491, 118.903121),\n (81.925491, 118.903121, 80.294374, 118.903121),\n (80.294374, 118.903121, 78.663256, 118.903121),\n (78.663256, 118.903121, 77.032139, 118.903121),\n (77.032139, 118.903121, 75.401022, 118.903121),\n (75.401022, 118.903121, 75.401022, 74.998878),\n (141.596779, 132.903122, 141.596779, 134.534239),\n (141.596779, 134.534239, 141.596779, 136.165356),\n (141.596779, 136.165356, 141.596779, 137.796474),\n (141.596779, 137.796474, 141.596779, 139.427591),\n (141.596779, 139.427591, 141.596779, 141.058709),\n (141.596779, 141.058709, 141.596779, 142.689826),\n (141.596779, 142.689826, 141.596779, 144.320943),\n (141.596779, 144.320943, 141.596779, 145.952061),\n (141.596779, 145.952061, 141.596779, 147.583178),\n (141.596779, 147.583178, 141.596779, 149.214296),\n (141.596779, 149.214296, 141.596779, 150.845413),\n (141.596779, 150.845413, 141.596779, 152.47653),\n (141.596779, 152.47653, 141.596779, 154.107648),\n (141.596779, 154.107648, 141.596779, 155.738765),\n (141.596779, 155.738765, 141.596779, 157.369883),\n (141.596779, 157.369883, 141.596779, 159.001),\n (141.596779, 159.001, 141.596779, 160.632117),\n (141.596779, 160.632117, 141.596779, 162.263235),\n (141.596779, 162.263235, 141.596779, 163.894352),\n (141.596779, 163.894352, 141.596779, 165.52547),\n (141.596779, 165.52547, 141.596779, 167.156587),\n (141.596779, 167.156587, 141.596779, 168.787704),\n (141.596779, 168.787704, 141.596779, 170.418822),\n (141.596779, 170.418822, 141.596779, 172.049939),\n (141.596779, 172.049939, 141.596779, 173.681057),\n (141.596779, 173.681057, 141.596779, 175.312174),\n (141.596779, 175.312174, 141.596779, 176.943291),\n (141.596779, 176.943291, 141.596779, 178.574409),\n (141.596779, 178.574409, 141.596779, 180.205526),\n (141.596779, 180.205526, 141.596779, 181.836644),\n (141.596779, 181.836644, 141.596779, 183.467761),\n (141.596779, 183.467761, 141.596779, 185.098878),\n (185.501022, 132.903122, 185.501022, 134.534239),\n (185.501022, 134.534239, 185.501022, 136.165356),\n (185.501022, 136.165356, 185.501022, 137.796474),\n (185.501022, 137.796474, 185.501022, 139.427591),\n (185.501022, 139.427591, 185.501022, 141.058709),\n (185.501022, 141.058709, 185.501022, 142.689826),\n (185.501022, 142.689826, 185.501022, 144.320943),\n (185.501022, 144.320943, 185.501022, 145.952061),\n (185.501022, 145.952061, 185.501022, 147.583178),\n (185.501022, 147.583178, 185.501022, 149.214296),\n (185.501022, 149.214296, 185.501022, 150.845413),\n (185.501022, 150.845413, 185.501022, 152.47653),\n (185.501022, 152.47653, 185.501022, 154.107648),\n (185.501022, 154.107648, 185.501022, 155.738765),\n (185.501022, 155.738765, 185.501022, 157.369883),\n (185.501022, 157.369883, 185.501022, 159.001),\n (185.501022, 159.001, 185.501022, 160.632117),\n (185.501022, 160.632117, 185.501022, 162.263235),\n (185.501022, 162.263235, 185.501022, 163.894352),\n (185.501022, 163.894352, 185.501022, 165.52547),\n (185.501022, 165.52547, 185.501022, 167.156587),\n (185.501022, 167.156587, 185.501022, 168.787704),\n (185.501022, 168.787704, 185.501022, 170.418822),\n (185.501022, 170.418822, 185.501022, 172.049939),\n (185.501022, 172.049939, 185.501022, 173.681057),\n (185.501022, 173.681057, 185.501022, 175.312174),\n (185.501022, 175.312174, 185.501022, 176.943291),\n (185.501022, 176.943291, 185.501022, 178.574409),\n (185.501022, 178.574409, 185.501022, 180.205526),\n (185.501022, 180.205526, 185.501022, 181.836644),\n (185.501022, 181.836644, 185.501022, 183.467761),\n (185.501022, 183.467761, 185.501022, 185.098878),\n (185.501022, 132.903122, 141.596779, 132.903122),\n (185.501022, 185.098878, 141.596779, 185.098878)\n]\nVISIBLE_CIRCLES = [\n (101.4989, 159.001, 26.097878)\n]\nVISIBLE_ARCS = [\n\n]\nHIDDEN_SEGMENTS = [\n\n]\n# (orient, text, p1, p2, base) for linear; (orient, text, center, radius, angle) for diameter\nDIMENSIONS = [\n ('diameter', '%%c100', (101.4989, 159.001), 26.0979, 45),\n ('horizontal', '84.1146', (141.5968, 159.001), (185.5011, 159.001), (163.5489, 170.001))\n]\n\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\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\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,\n angle=(0 if d[0] == \"horizontal\" else 90),\n 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,\n text=text, dimstyle=\"EZDXF\").render()\n\n doc.saveas(out_path)\n\n\nif __name__ == \"__main__\":\n out = sys.argv[1] if len(sys.argv) > 1 else \"0056_00568716_gt.dxf\"\n draw(out)\n print(\"wrote\", out)\n```"}], "images": ["images/0056_00568716.png"], "id": "0056_00568716"} {"messages": [{"role": "user", "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": "assistant", "content": "```python\n#!/usr/bin/env python3\n# -*- coding: utf-8 -*-\n# Ground-truth 2D engineering drawing for part: 0056_00569576\n# Self-contained: reproduces the three-view DXF via ezdxf, NO FreeCAD needed.\n# Coordinates are A4 page millimetres (scale=0.9560723268742927, page=[297.0, 210.0]).\n# visible edges -> solid (layer OUTLINE); hidden edges -> dashed (layer HIDDEN)\n# dimensions -> real movable DIMENSION entities (text = true mm value)\n# Run: python 0056_00569576_gt.py [out.dxf]\nimport sys\nimport ezdxf\n\nSCALE = 0.9560723268742927\nPAGE = [297.0, 210.0]\n\nVISIBLE_SEGMENTS = [\n (160.155416, 85.851816, 157.16769, 85.851816),\n (157.16769, 85.851816, 154.179964, 85.851816),\n (154.179964, 85.851816, 151.192238, 85.851816),\n (151.192238, 85.851816, 148.204512, 85.851816),\n (148.204512, 85.851816, 145.216786, 85.851816),\n (145.216786, 85.851816, 142.22906, 85.851816),\n (142.22906, 85.851816, 139.241334, 85.851816),\n (139.241334, 85.851816, 136.253608, 85.851816),\n (136.253608, 85.851816, 133.265882, 85.851816),\n (133.265882, 85.851816, 130.278156, 85.851816),\n (130.278156, 85.851816, 127.29043, 85.851816),\n (127.29043, 85.851816, 124.302704, 85.851816),\n (124.302704, 85.851816, 121.314978, 85.851816),\n (121.314978, 85.851816, 118.327252, 85.851816),\n (118.327252, 85.851816, 115.339526, 85.851816),\n (115.339526, 85.851816, 112.3518, 85.851816),\n (112.3518, 85.851816, 109.364074, 85.851816),\n (109.364074, 85.851816, 106.376348, 85.851816),\n (106.376348, 85.851816, 103.388622, 85.851816),\n (103.388622, 85.851816, 100.400896, 85.851816),\n (100.400896, 85.851816, 97.41317, 85.851816),\n (97.41317, 85.851816, 94.425444, 85.851816),\n (94.425444, 85.851816, 91.437718, 85.851816),\n (91.437718, 85.851816, 88.449992, 85.851816),\n (88.449992, 85.851816, 85.462266, 85.851816),\n (85.462266, 85.851816, 82.47454, 85.851816),\n (82.47454, 85.851816, 79.486814, 85.851816),\n (79.486814, 85.851816, 76.499088, 85.851816),\n (76.499088, 85.851816, 73.511362, 85.851816),\n (73.511362, 85.851816, 70.523636, 85.851816),\n (70.523636, 85.851816, 67.53591, 85.851816),\n (67.53591, 85.851816, 64.548184, 85.851816),\n (160.155416, 85.851816, 160.155416, 86.344583),\n (160.155416, 86.344583, 157.16769, 86.344583),\n (157.16769, 86.344583, 154.179964, 86.344583),\n (154.179964, 86.344583, 151.192238, 86.344583),\n (151.192238, 86.344583, 148.204512, 86.344583),\n (148.204512, 86.344583, 145.216786, 86.344583),\n (145.216786, 86.344583, 142.22906, 86.344583),\n (142.22906, 86.344583, 139.241334, 86.344583),\n (139.241334, 86.344583, 136.253608, 86.344583),\n (136.253608, 86.344583, 133.265882, 86.344583),\n (133.265882, 86.344583, 130.278156, 86.344583),\n (130.278156, 86.344583, 127.29043, 86.344583),\n (127.29043, 86.344583, 124.302704, 86.344583),\n (124.302704, 86.344583, 121.314978, 86.344583),\n (121.314978, 86.344583, 118.327252, 86.344583),\n (118.327252, 86.344583, 115.339526, 86.344583),\n (115.339526, 86.344583, 112.3518, 86.344583),\n (112.3518, 86.344583, 109.364074, 86.344583),\n (109.364074, 86.344583, 106.376348, 86.344583),\n (106.376348, 86.344583, 103.388622, 86.344583),\n (103.388622, 86.344583, 100.400896, 86.344583),\n (100.400896, 86.344583, 97.41317, 86.344583),\n (97.41317, 86.344583, 94.425444, 86.344583),\n (94.425444, 86.344583, 91.437718, 86.344583),\n (91.437718, 86.344583, 88.449992, 86.344583),\n (88.449992, 86.344583, 85.462266, 86.344583),\n (85.462266, 86.344583, 82.47454, 86.344583),\n (82.47454, 86.344583, 79.486814, 86.344583),\n (79.486814, 86.344583, 76.499088, 86.344583),\n (76.499088, 86.344583, 73.511362, 86.344583),\n (73.511362, 86.344583, 70.523636, 86.344583),\n (70.523636, 86.344583, 67.53591, 86.344583),\n (67.53591, 86.344583, 64.548184, 86.344583),\n (64.548184, 86.344583, 64.548184, 85.851816),\n (174.648184, 100.344584, 174.155417, 100.344584),\n (174.648184, 195.951816, 174.155417, 195.951816)\n]\nVISIBLE_CIRCLES = [\n (112.3518, 148.1482, 47.803616)\n]\nVISIBLE_ARCS = [\n (-27473.5982, 148.1482, 27647.768518, -0.099066, 0.099066),\n (-29521.5982, 148.1482, 29696.25862, -0.092232, 0.092232)\n]\nHIDDEN_SEGMENTS = [\n\n]\n# (orient, text, p1, p2, base) for linear; (orient, text, center, radius, angle) for diameter\nDIMENSIONS = [\n ('diameter', '%%c100', (112.3518, 148.1482), 47.8036, 45),\n ('vertical', '0.5154', (174.1554, 148.1482), (174.6482, 148.1482), (174.4018, 159.1482))\n]\n\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\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\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,\n angle=(0 if d[0] == \"horizontal\" else 90),\n 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,\n text=text, dimstyle=\"EZDXF\").render()\n\n doc.saveas(out_path)\n\n\nif __name__ == \"__main__\":\n out = sys.argv[1] if len(sys.argv) > 1 else \"0056_00569576_gt.dxf\"\n draw(out)\n print(\"wrote\", out)\n```"}], "images": ["images/0056_00569576.png"], "id": "0056_00569576"} {"messages": [{"role": "user", "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": "assistant", "content": "```python\n#!/usr/bin/env python3\n# -*- coding: utf-8 -*-\n# Ground-truth 2D engineering drawing for part: 0059_00596180\n# Self-contained: reproduces the three-view DXF via ezdxf, NO FreeCAD needed.\n# Coordinates are A4 page millimetres (scale=0.18731355932203736, page=[297.0, 210.0]).\n# visible edges -> solid (layer OUTLINE); hidden edges -> dashed (layer HIDDEN)\n# dimensions -> real movable DIMENSION entities (text = true mm value)\n# Run: python 0059_00596180_gt.py [out.dxf]\nimport sys\nimport ezdxf\n\nSCALE = 0.18731355932203736\nPAGE = [297.0, 210.0]\n\nVISIBLE_SEGMENTS = [\n (83.767122, 144.001522, 84.352477, 144.001522),\n (84.352477, 144.001522, 84.937832, 144.001522),\n (84.937832, 144.001522, 85.523187, 144.001522),\n (85.523187, 144.001522, 86.108542, 144.001522),\n (86.108542, 144.001522, 86.693896, 144.001522),\n (86.693896, 144.001522, 87.279251, 144.001522),\n (87.279251, 144.001522, 87.864606, 144.001522),\n (87.864606, 144.001522, 88.449961, 144.001522),\n (88.449961, 144.001522, 89.035316, 144.001522),\n (89.035316, 144.001522, 89.620671, 144.001522),\n (89.620671, 144.001522, 90.206026, 144.001522),\n (90.206026, 144.001522, 90.791381, 144.001522),\n (90.791381, 144.001522, 91.376735, 144.001522),\n (91.376735, 144.001522, 91.96209, 144.001522),\n (91.96209, 144.001522, 92.547445, 144.001522),\n (92.547445, 144.001522, 93.1328, 144.001522),\n (93.1328, 144.001522, 93.718155, 144.001522),\n (93.718155, 144.001522, 94.30351, 144.001522),\n (94.30351, 144.001522, 94.888865, 144.001522),\n (94.888865, 144.001522, 95.474219, 144.001522),\n (95.474219, 144.001522, 96.059574, 144.001522),\n (96.059574, 144.001522, 96.644929, 144.001522),\n (96.644929, 144.001522, 97.230284, 144.001522),\n (97.230284, 144.001522, 97.815639, 144.001522),\n (97.815639, 144.001522, 98.400994, 144.001522),\n (98.400994, 144.001522, 98.986349, 144.001522),\n (98.986349, 144.001522, 99.571704, 144.001522),\n (99.571704, 144.001522, 100.157058, 144.001522),\n (100.157058, 144.001522, 100.742413, 144.001522),\n (100.742413, 144.001522, 101.327768, 144.001522),\n (101.327768, 144.001522, 101.913123, 144.001522),\n (101.913123, 144.001522, 102.498478, 144.001522),\n (102.498478, 144.001522, 102.498478, 66.632878),\n (83.767122, 66.632878, 84.352477, 66.632878),\n (84.352477, 66.632878, 84.937832, 66.632878),\n (84.937832, 66.632878, 85.523187, 66.632878),\n (85.523187, 66.632878, 86.108542, 66.632878),\n (86.108542, 66.632878, 86.693896, 66.632878),\n (86.693896, 66.632878, 87.279251, 66.632878),\n (87.279251, 66.632878, 87.864606, 66.632878),\n (87.864606, 66.632878, 88.449961, 66.632878),\n (88.449961, 66.632878, 89.035316, 66.632878),\n (89.035316, 66.632878, 89.620671, 66.632878),\n (89.620671, 66.632878, 90.206026, 66.632878),\n (90.206026, 66.632878, 90.791381, 66.632878),\n (90.791381, 66.632878, 91.376735, 66.632878),\n (91.376735, 66.632878, 91.96209, 66.632878),\n (91.96209, 66.632878, 92.547445, 66.632878),\n (92.547445, 66.632878, 93.1328, 66.632878),\n (93.1328, 66.632878, 93.718155, 66.632878),\n (93.718155, 66.632878, 94.30351, 66.632878),\n (94.30351, 66.632878, 94.888865, 66.632878),\n (94.888865, 66.632878, 95.474219, 66.632878),\n (95.474219, 66.632878, 96.059574, 66.632878),\n (96.059574, 66.632878, 96.644929, 66.632878),\n (96.644929, 66.632878, 97.230284, 66.632878),\n (97.230284, 66.632878, 97.815639, 66.632878),\n (97.815639, 66.632878, 98.400994, 66.632878),\n (98.400994, 66.632878, 98.986349, 66.632878),\n (98.986349, 66.632878, 99.571704, 66.632878),\n (99.571704, 66.632878, 100.157058, 66.632878),\n (100.157058, 66.632878, 100.742413, 66.632878),\n (100.742413, 66.632878, 101.327768, 66.632878),\n (101.327768, 66.632878, 101.913123, 66.632878),\n (101.913123, 66.632878, 102.498478, 66.632878),\n (83.767122, 144.001522, 83.767122, 66.632878),\n (193.867122, 176.732878, 193.867122, 176.147523),\n (193.867122, 176.147523, 193.867122, 175.562168),\n (193.867122, 175.562168, 193.867122, 174.976813),\n (193.867122, 174.976813, 193.867122, 174.391458),\n (193.867122, 174.391458, 193.867122, 173.806104),\n (193.867122, 173.806104, 193.867122, 173.220749),\n (193.867122, 173.220749, 193.867122, 172.635394),\n (193.867122, 172.635394, 193.867122, 172.050039),\n (193.867122, 172.050039, 193.867122, 171.464684),\n (193.867122, 171.464684, 193.867122, 170.879329),\n (193.867122, 170.879329, 193.867122, 170.293974),\n (193.867122, 170.293974, 193.867122, 169.708619),\n (193.867122, 169.708619, 193.867122, 169.123265),\n (193.867122, 169.123265, 193.867122, 168.53791),\n (193.867122, 168.53791, 193.867122, 167.952555),\n (193.867122, 167.952555, 193.867122, 167.3672),\n (193.867122, 167.3672, 193.867122, 166.781845),\n (193.867122, 166.781845, 193.867122, 166.19649),\n (193.867122, 166.19649, 193.867122, 165.611135),\n (193.867122, 165.611135, 193.867122, 165.025781),\n (193.867122, 165.025781, 193.867122, 164.440426),\n (193.867122, 164.440426, 193.867122, 163.855071),\n (193.867122, 163.855071, 193.867122, 163.269716),\n (193.867122, 163.269716, 193.867122, 162.684361),\n (193.867122, 162.684361, 193.867122, 162.099006),\n (193.867122, 162.099006, 193.867122, 161.513651),\n (193.867122, 161.513651, 193.867122, 160.928296),\n (193.867122, 160.928296, 193.867122, 160.342942),\n (193.867122, 160.342942, 193.867122, 159.757587),\n (193.867122, 159.757587, 193.867122, 159.172232),\n (193.867122, 159.172232, 193.867122, 158.586877),\n (193.867122, 158.586877, 193.867122, 158.001522),\n (116.498478, 176.732878, 116.498478, 176.147523),\n (116.498478, 176.147523, 116.498478, 175.562168),\n (116.498478, 175.562168, 116.498478, 174.976813),\n (116.498478, 174.976813, 116.498478, 174.391458),\n (116.498478, 174.391458, 116.498478, 173.806104),\n (116.498478, 173.806104, 116.498478, 173.220749),\n (116.498478, 173.220749, 116.498478, 172.635394),\n (116.498478, 172.635394, 116.498478, 172.050039),\n (116.498478, 172.050039, 116.498478, 171.464684),\n (116.498478, 171.464684, 116.498478, 170.879329),\n (116.498478, 170.879329, 116.498478, 170.293974),\n (116.498478, 170.293974, 116.498478, 169.708619),\n (116.498478, 169.708619, 116.498478, 169.123265),\n (116.498478, 169.123265, 116.498478, 168.53791),\n (116.498478, 168.53791, 116.498478, 167.952555),\n (116.498478, 167.952555, 116.498478, 167.3672),\n (116.498478, 167.3672, 116.498478, 166.781845),\n (116.498478, 166.781845, 116.498478, 166.19649),\n (116.498478, 166.19649, 116.498478, 165.611135),\n (116.498478, 165.611135, 116.498478, 165.025781),\n (116.498478, 165.025781, 116.498478, 164.440426),\n (116.498478, 164.440426, 116.498478, 163.855071),\n (116.498478, 163.855071, 116.498478, 163.269716),\n (116.498478, 163.269716, 116.498478, 162.684361),\n (116.498478, 162.684361, 116.498478, 162.099006),\n (116.498478, 162.099006, 116.498478, 161.513651),\n (116.498478, 161.513651, 116.498478, 160.928296),\n (116.498478, 160.928296, 116.498478, 160.342942),\n (116.498478, 160.342942, 116.498478, 159.757587),\n (116.498478, 159.757587, 116.498478, 159.172232),\n (116.498478, 159.172232, 116.498478, 158.586877),\n (116.498478, 158.586877, 116.498478, 158.001522),\n (193.867122, 158.001522, 116.498478, 158.001522),\n (193.867122, 176.732878, 116.498478, 176.732878)\n]\nVISIBLE_CIRCLES = [\n (93.1328, 167.3672, 9.365678)\n]\nVISIBLE_ARCS = [\n\n]\nHIDDEN_SEGMENTS = [\n\n]\n# (orient, text, p1, p2, base) for linear; (orient, text, center, radius, angle) for diameter\nDIMENSIONS = [\n ('diameter', '%%c100', (93.1328, 167.3672), 9.3657, 45),\n ('horizontal', '413.043', (116.4985, 167.3672), (193.8672, 167.3672), (155.1828, 178.3672))\n]\n\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\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\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,\n angle=(0 if d[0] == \"horizontal\" else 90),\n 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,\n text=text, dimstyle=\"EZDXF\").render()\n\n doc.saveas(out_path)\n\n\nif __name__ == \"__main__\":\n out = sys.argv[1] if len(sys.argv) > 1 else \"0059_00596180_gt.dxf\"\n draw(out)\n print(\"wrote\", out)\n```"}], "images": ["images/0059_00596180.png"], "id": "0059_00596180"} {"messages": [{"role": "user", "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 593.75 mm."}, {"role": "assistant", "content": "```python\n#!/usr/bin/env python3\n# -*- coding: utf-8 -*-\n# Ground-truth 2D engineering drawing for part: 0060_00604118\n# Self-contained: reproduces the three-view DXF via ezdxf, NO FreeCAD needed.\n# Coordinates are A4 page millimetres (scale=0.1385225225225225, page=[297.0, 210.0]).\n# visible edges -> solid (layer OUTLINE); hidden edges -> dashed (layer HIDDEN)\n# dimensions -> real movable DIMENSION entities (text = true mm value)\n# Run: python 0060_00604118_gt.py [out.dxf]\nimport sys\nimport ezdxf\n\nSCALE = 0.1385225225225225\nPAGE = [297.0, 210.0]\n\nVISIBLE_SEGMENTS = [\n (98.839226, 65.413026, 98.406343, 65.413026),\n (98.406343, 65.413026, 97.97346, 65.413026),\n (97.97346, 65.413026, 97.540577, 65.413026),\n (97.540577, 65.413026, 97.107695, 65.413026),\n (97.107695, 65.413026, 96.674812, 65.413026),\n (96.674812, 65.413026, 96.241929, 65.413026),\n (96.241929, 65.413026, 95.809046, 65.413026),\n (95.809046, 65.413026, 95.376163, 65.413026),\n (95.376163, 65.413026, 94.94328, 65.413026),\n (94.94328, 65.413026, 94.510397, 65.413026),\n (94.510397, 65.413026, 94.077514, 65.413026),\n (94.077514, 65.413026, 93.644632, 65.413026),\n (93.644632, 65.413026, 93.211749, 65.413026),\n (93.211749, 65.413026, 92.778866, 65.413026),\n (92.778866, 65.413026, 92.345983, 65.413026),\n (92.345983, 65.413026, 91.9131, 65.413026),\n (91.9131, 65.413026, 91.480217, 65.413026),\n (91.480217, 65.413026, 91.047334, 65.413026),\n (91.047334, 65.413026, 90.614451, 65.413026),\n (90.614451, 65.413026, 90.181568, 65.413026),\n (90.181568, 65.413026, 89.748686, 65.413026),\n (89.748686, 65.413026, 89.315803, 65.413026),\n (89.315803, 65.413026, 88.88292, 65.413026),\n (88.88292, 65.413026, 88.450037, 65.413026),\n (88.450037, 65.413026, 88.017154, 65.413026),\n (88.017154, 65.413026, 87.584271, 65.413026),\n (87.584271, 65.413026, 87.151388, 65.413026),\n (87.151388, 65.413026, 86.718505, 65.413026),\n (86.718505, 65.413026, 86.285623, 65.413026),\n (86.285623, 65.413026, 85.85274, 65.413026),\n (85.85274, 65.413026, 85.419857, 65.413026),\n (85.419857, 65.413026, 84.986974, 65.413026),\n (98.839226, 65.413026, 98.839226, 147.660774),\n (98.839226, 147.660774, 98.406343, 147.660774),\n (98.406343, 147.660774, 97.97346, 147.660774),\n (97.97346, 147.660774, 97.540577, 147.660774),\n (97.540577, 147.660774, 97.107695, 147.660774),\n (97.107695, 147.660774, 96.674812, 147.660774),\n (96.674812, 147.660774, 96.241929, 147.660774),\n (96.241929, 147.660774, 95.809046, 147.660774),\n (95.809046, 147.660774, 95.376163, 147.660774),\n (95.376163, 147.660774, 94.94328, 147.660774),\n (94.94328, 147.660774, 94.510397, 147.660774),\n (94.510397, 147.660774, 94.077514, 147.660774),\n (94.077514, 147.660774, 93.644632, 147.660774),\n (93.644632, 147.660774, 93.211749, 147.660774),\n (93.211749, 147.660774, 92.778866, 147.660774),\n (92.778866, 147.660774, 92.345983, 147.660774),\n (92.345983, 147.660774, 91.9131, 147.660774),\n (91.9131, 147.660774, 91.480217, 147.660774),\n (91.480217, 147.660774, 91.047334, 147.660774),\n (91.047334, 147.660774, 90.614451, 147.660774),\n (90.614451, 147.660774, 90.181568, 147.660774),\n (90.181568, 147.660774, 89.748686, 147.660774),\n (89.748686, 147.660774, 89.315803, 147.660774),\n (89.315803, 147.660774, 88.88292, 147.660774),\n (88.88292, 147.660774, 88.450037, 147.660774),\n (88.450037, 147.660774, 88.017154, 147.660774),\n (88.017154, 147.660774, 87.584271, 147.660774),\n (87.584271, 147.660774, 87.151388, 147.660774),\n (87.151388, 147.660774, 86.718505, 147.660774),\n (86.718505, 147.660774, 86.285623, 147.660774),\n (86.285623, 147.660774, 85.85274, 147.660774),\n (85.85274, 147.660774, 85.419857, 147.660774),\n (85.419857, 147.660774, 84.986974, 147.660774),\n (84.986974, 147.660774, 84.986974, 65.413026),\n (112.839226, 161.660774, 112.839226, 162.093657),\n (112.839226, 162.093657, 112.839226, 162.52654),\n (112.839226, 162.52654, 112.839226, 162.959423),\n (112.839226, 162.959423, 112.839226, 163.392305),\n (112.839226, 163.392305, 112.839226, 163.825188),\n (112.839226, 163.825188, 112.839226, 164.258071),\n (112.839226, 164.258071, 112.839226, 164.690954),\n (112.839226, 164.690954, 112.839226, 165.123837),\n (112.839226, 165.123837, 112.839226, 165.55672),\n (112.839226, 165.55672, 112.839226, 165.989603),\n (112.839226, 165.989603, 112.839226, 166.422486),\n (112.839226, 166.422486, 112.839226, 166.855368),\n (112.839226, 166.855368, 112.839226, 167.288251),\n (112.839226, 167.288251, 112.839226, 167.721134),\n (112.839226, 167.721134, 112.839226, 168.154017),\n (112.839226, 168.154017, 112.839226, 168.5869),\n (112.839226, 168.5869, 112.839226, 169.019783),\n (112.839226, 169.019783, 112.839226, 169.452666),\n (112.839226, 169.452666, 112.839226, 169.885549),\n (112.839226, 169.885549, 112.839226, 170.318432),\n (112.839226, 170.318432, 112.839226, 170.751314),\n (112.839226, 170.751314, 112.839226, 171.184197),\n (112.839226, 171.184197, 112.839226, 171.61708),\n (112.839226, 171.61708, 112.839226, 172.049963),\n (112.839226, 172.049963, 112.839226, 172.482846),\n (112.839226, 172.482846, 112.839226, 172.915729),\n (112.839226, 172.915729, 112.839226, 173.348612),\n (112.839226, 173.348612, 112.839226, 173.781495),\n (112.839226, 173.781495, 112.839226, 174.214377),\n (112.839226, 174.214377, 112.839226, 174.64726),\n (112.839226, 174.64726, 112.839226, 175.080143),\n (112.839226, 175.080143, 112.839226, 175.513026),\n (195.086974, 161.660774, 195.086974, 162.093657),\n (195.086974, 162.093657, 195.086974, 162.52654),\n (195.086974, 162.52654, 195.086974, 162.959423),\n (195.086974, 162.959423, 195.086974, 163.392305),\n (195.086974, 163.392305, 195.086974, 163.825188),\n (195.086974, 163.825188, 195.086974, 164.258071),\n (195.086974, 164.258071, 195.086974, 164.690954),\n (195.086974, 164.690954, 195.086974, 165.123837),\n (195.086974, 165.123837, 195.086974, 165.55672),\n (195.086974, 165.55672, 195.086974, 165.989603),\n (195.086974, 165.989603, 195.086974, 166.422486),\n (195.086974, 166.422486, 195.086974, 166.855368),\n (195.086974, 166.855368, 195.086974, 167.288251),\n (195.086974, 167.288251, 195.086974, 167.721134),\n (195.086974, 167.721134, 195.086974, 168.154017),\n (195.086974, 168.154017, 195.086974, 168.5869),\n (195.086974, 168.5869, 195.086974, 169.019783),\n (195.086974, 169.019783, 195.086974, 169.452666),\n (195.086974, 169.452666, 195.086974, 169.885549),\n (195.086974, 169.885549, 195.086974, 170.318432),\n (195.086974, 170.318432, 195.086974, 170.751314),\n (195.086974, 170.751314, 195.086974, 171.184197),\n (195.086974, 171.184197, 195.086974, 171.61708),\n (195.086974, 171.61708, 195.086974, 172.049963),\n (195.086974, 172.049963, 195.086974, 172.482846),\n (195.086974, 172.482846, 195.086974, 172.915729),\n (195.086974, 172.915729, 195.086974, 173.348612),\n (195.086974, 173.348612, 195.086974, 173.781495),\n (195.086974, 173.781495, 195.086974, 174.214377),\n (195.086974, 174.214377, 195.086974, 174.64726),\n (195.086974, 174.64726, 195.086974, 175.080143),\n (195.086974, 175.080143, 195.086974, 175.513026),\n (195.086974, 161.660774, 112.839226, 161.660774),\n (195.086974, 175.513026, 112.839226, 175.513026)\n]\nVISIBLE_CIRCLES = [\n (91.9131, 168.5869, 6.926126)\n]\nVISIBLE_ARCS = [\n\n]\nHIDDEN_SEGMENTS = [\n\n]\n# (orient, text, p1, p2, base) for linear; (orient, text, center, radius, angle) for diameter\nDIMENSIONS = [\n ('diameter', '%%c100', (91.9131, 168.5869), 6.9261, 45),\n ('horizontal', '593.75', (112.8392, 168.5869), (195.0869, 168.5869), (153.9631, 179.5869))\n]\n\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\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\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,\n angle=(0 if d[0] == \"horizontal\" else 90),\n 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,\n text=text, dimstyle=\"EZDXF\").render()\n\n doc.saveas(out_path)\n\n\nif __name__ == \"__main__\":\n out = sys.argv[1] if len(sys.argv) > 1 else \"0060_00604118_gt.dxf\"\n draw(out)\n print(\"wrote\", out)\n```"}], "images": ["images/0060_00604118.png"], "id": "0060_00604118"} {"messages": [{"role": "user", "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": "assistant", "content": "```python\n#!/usr/bin/env python3\n# -*- coding: utf-8 -*-\n# Ground-truth 2D engineering drawing for part: 0060_00608273\n# Self-contained: reproduces the three-view DXF via ezdxf, NO FreeCAD needed.\n# Coordinates are A4 page millimetres (scale=0.37200000000004796, page=[297.0, 210.0]).\n# visible edges -> solid (layer OUTLINE); hidden edges -> dashed (layer HIDDEN)\n# dimensions -> real movable DIMENSION entities (text = true mm value)\n# Run: python 0060_00608273_gt.py [out.dxf]\nimport sys\nimport ezdxf\n\nSCALE = 0.37200000000004796\nPAGE = [297.0, 210.0]\n\nVISIBLE_SEGMENTS = [\n (79.15, 130.15, 80.3125, 130.15),\n (80.3125, 130.15, 81.475, 130.15),\n (81.475, 130.15, 82.6375, 130.15),\n (82.6375, 130.15, 83.8, 130.15),\n (83.8, 130.15, 84.9625, 130.15),\n (84.9625, 130.15, 86.125, 130.15),\n (86.125, 130.15, 87.2875, 130.15),\n (87.2875, 130.15, 88.45, 130.15),\n (88.45, 130.15, 89.6125, 130.15),\n (89.6125, 130.15, 90.775, 130.15),\n (90.775, 130.15, 91.9375, 130.15),\n (91.9375, 130.15, 93.1, 130.15),\n (93.1, 130.15, 94.2625, 130.15),\n (94.2625, 130.15, 95.425, 130.15),\n (95.425, 130.15, 96.5875, 130.15),\n (96.5875, 130.15, 97.75, 130.15),\n (97.75, 130.15, 98.9125, 130.15),\n (98.9125, 130.15, 100.075, 130.15),\n (100.075, 130.15, 101.2375, 130.15),\n (101.2375, 130.15, 102.4, 130.15),\n (102.4, 130.15, 103.5625, 130.15),\n (103.5625, 130.15, 104.725, 130.15),\n (104.725, 130.15, 105.8875, 130.15),\n (105.8875, 130.15, 107.05, 130.15),\n (107.05, 130.15, 108.2125, 130.15),\n (108.2125, 130.15, 109.375, 130.15),\n (109.375, 130.15, 110.5375, 130.15),\n (110.5375, 130.15, 111.7, 130.15),\n (111.7, 130.15, 112.8625, 130.15),\n (112.8625, 130.15, 114.025, 130.15),\n (114.025, 130.15, 115.1875, 130.15),\n (115.1875, 130.15, 116.35, 130.15),\n (116.35, 130.15, 116.35, 71.25),\n (79.15, 71.25, 80.3125, 71.25),\n (80.3125, 71.25, 81.475, 71.25),\n (81.475, 71.25, 82.6375, 71.25),\n (82.6375, 71.25, 83.8, 71.25),\n (83.8, 71.25, 84.9625, 71.25),\n (84.9625, 71.25, 86.125, 71.25),\n (86.125, 71.25, 87.2875, 71.25),\n (87.2875, 71.25, 88.45, 71.25),\n (88.45, 71.25, 89.6125, 71.25),\n (89.6125, 71.25, 90.775, 71.25),\n (90.775, 71.25, 91.9375, 71.25),\n (91.9375, 71.25, 93.1, 71.25),\n (93.1, 71.25, 94.2625, 71.25),\n (94.2625, 71.25, 95.425, 71.25),\n (95.425, 71.25, 96.5875, 71.25),\n (96.5875, 71.25, 97.75, 71.25),\n (97.75, 71.25, 98.9125, 71.25),\n (98.9125, 71.25, 100.075, 71.25),\n (100.075, 71.25, 101.2375, 71.25),\n (101.2375, 71.25, 102.4, 71.25),\n (102.4, 71.25, 103.5625, 71.25),\n (103.5625, 71.25, 104.725, 71.25),\n (104.725, 71.25, 105.8875, 71.25),\n (105.8875, 71.25, 107.05, 71.25),\n (107.05, 71.25, 108.2125, 71.25),\n (108.2125, 71.25, 109.375, 71.25),\n (109.375, 71.25, 110.5375, 71.25),\n (110.5375, 71.25, 111.7, 71.25),\n (111.7, 71.25, 112.8625, 71.25),\n (112.8625, 71.25, 114.025, 71.25),\n (114.025, 71.25, 115.1875, 71.25),\n (115.1875, 71.25, 116.35, 71.25),\n (79.15, 71.25, 79.15, 130.15),\n (189.25, 181.35, 189.25, 180.1875),\n (189.25, 180.1875, 189.25, 179.025),\n (189.25, 179.025, 189.25, 177.8625),\n (189.25, 177.8625, 189.25, 176.7),\n (189.25, 176.7, 189.25, 175.5375),\n (189.25, 175.5375, 189.25, 174.375),\n (189.25, 174.375, 189.25, 173.2125),\n (189.25, 173.2125, 189.25, 172.05),\n (189.25, 172.05, 189.25, 170.8875),\n (189.25, 170.8875, 189.25, 169.725),\n (189.25, 169.725, 189.25, 168.5625),\n (189.25, 168.5625, 189.25, 167.4),\n (189.25, 167.4, 189.25, 166.2375),\n (189.25, 166.2375, 189.25, 165.075),\n (189.25, 165.075, 189.25, 163.9125),\n (189.25, 163.9125, 189.25, 162.75),\n (189.25, 162.75, 189.25, 161.5875),\n (189.25, 161.5875, 189.25, 160.425),\n (189.25, 160.425, 189.25, 159.2625),\n (189.25, 159.2625, 189.25, 158.1),\n (189.25, 158.1, 189.25, 156.9375),\n (189.25, 156.9375, 189.25, 155.775),\n (189.25, 155.775, 189.25, 154.6125),\n (189.25, 154.6125, 189.25, 153.45),\n (189.25, 153.45, 189.25, 152.2875),\n (189.25, 152.2875, 189.25, 151.125),\n (189.25, 151.125, 189.25, 149.9625),\n (189.25, 149.9625, 189.25, 148.8),\n (189.25, 148.8, 189.25, 147.6375),\n (189.25, 147.6375, 189.25, 146.475),\n (189.25, 146.475, 189.25, 145.3125),\n (189.25, 145.3125, 189.25, 144.15),\n (130.35, 181.35, 130.35, 180.1875),\n (130.35, 180.1875, 130.35, 179.025),\n (130.35, 179.025, 130.35, 177.8625),\n (130.35, 177.8625, 130.35, 176.7),\n (130.35, 176.7, 130.35, 175.5375),\n (130.35, 175.5375, 130.35, 174.375),\n (130.35, 174.375, 130.35, 173.2125),\n (130.35, 173.2125, 130.35, 172.05),\n (130.35, 172.05, 130.35, 170.8875),\n (130.35, 170.8875, 130.35, 169.725),\n (130.35, 169.725, 130.35, 168.5625),\n (130.35, 168.5625, 130.35, 167.4),\n (130.35, 167.4, 130.35, 166.2375),\n (130.35, 166.2375, 130.35, 165.075),\n (130.35, 165.075, 130.35, 163.9125),\n (130.35, 163.9125, 130.35, 162.75),\n (130.35, 162.75, 130.35, 161.5875),\n (130.35, 161.5875, 130.35, 160.425),\n (130.35, 160.425, 130.35, 159.2625),\n (130.35, 159.2625, 130.35, 158.1),\n (130.35, 158.1, 130.35, 156.9375),\n (130.35, 156.9375, 130.35, 155.775),\n (130.35, 155.775, 130.35, 154.6125),\n (130.35, 154.6125, 130.35, 153.45),\n (130.35, 153.45, 130.35, 152.2875),\n (130.35, 152.2875, 130.35, 151.125),\n (130.35, 151.125, 130.35, 149.9625),\n (130.35, 149.9625, 130.35, 148.8),\n (130.35, 148.8, 130.35, 147.6375),\n (130.35, 147.6375, 130.35, 146.475),\n (130.35, 146.475, 130.35, 145.3125),\n (130.35, 145.3125, 130.35, 144.15),\n (130.35, 181.35, 189.25, 181.35),\n (130.35, 144.15, 189.25, 144.15)\n]\nVISIBLE_CIRCLES = [\n (97.75, 162.75, 18.6)\n]\nVISIBLE_ARCS = [\n\n]\nHIDDEN_SEGMENTS = [\n\n]\n# (orient, text, p1, p2, base) for linear; (orient, text, center, radius, angle) for diameter\nDIMENSIONS = [\n ('diameter', '%%c100', (97.75, 162.75), 18.6, 45),\n ('horizontal', '158.333', (189.25, 162.75), (130.35, 162.75), (159.8, 151.75))\n]\n\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\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\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,\n angle=(0 if d[0] == \"horizontal\" else 90),\n 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,\n text=text, dimstyle=\"EZDXF\").render()\n\n doc.saveas(out_path)\n\n\nif __name__ == \"__main__\":\n out = sys.argv[1] if len(sys.argv) > 1 else \"0060_00608273_gt.dxf\"\n draw(out)\n print(\"wrote\", out)\n```"}], "images": ["images/0060_00608273.png"], "id": "0060_00608273"} {"messages": [{"role": "user", "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": "assistant", "content": "```python\n#!/usr/bin/env python3\n# -*- coding: utf-8 -*-\n# Ground-truth 2D engineering drawing for part: 0061_00611260\n# Self-contained: reproduces the three-view DXF via ezdxf, NO FreeCAD needed.\n# Coordinates are A4 page millimetres (scale=0.3225734265734338, page=[297.0, 210.0]).\n# visible edges -> solid (layer OUTLINE); hidden edges -> dashed (layer HIDDEN)\n# dimensions -> real movable DIMENSION entities (text = true mm value)\n# Run: python 0061_00611260_gt.py [out.dxf]\nimport sys\nimport ezdxf\n\nSCALE = 0.3225734265734338\nPAGE = [297.0, 210.0]\n\nVISIBLE_SEGMENTS = [\n (112.642971, 70.014371, 111.634929, 70.014371),\n (111.634929, 70.014371, 110.626887, 70.014371),\n (110.626887, 70.014371, 109.618845, 70.014371),\n (109.618845, 70.014371, 108.610803, 70.014371),\n (108.610803, 70.014371, 107.602762, 70.014371),\n (107.602762, 70.014371, 106.59472, 70.014371),\n (106.59472, 70.014371, 105.586678, 70.014371),\n (105.586678, 70.014371, 104.578636, 70.014371),\n (104.578636, 70.014371, 103.570594, 70.014371),\n (103.570594, 70.014371, 102.562552, 70.014371),\n (102.562552, 70.014371, 101.55451, 70.014371),\n (101.55451, 70.014371, 100.546468, 70.014371),\n (100.546468, 70.014371, 99.538426, 70.014371),\n (99.538426, 70.014371, 98.530384, 70.014371),\n (98.530384, 70.014371, 97.522342, 70.014371),\n (97.522342, 70.014371, 96.5143, 70.014371),\n (96.5143, 70.014371, 95.506258, 70.014371),\n (95.506258, 70.014371, 94.498216, 70.014371),\n (94.498216, 70.014371, 93.490174, 70.014371),\n (93.490174, 70.014371, 92.482132, 70.014371),\n (92.482132, 70.014371, 91.47409, 70.014371),\n (91.47409, 70.014371, 90.466048, 70.014371),\n (90.466048, 70.014371, 89.458006, 70.014371),\n (89.458006, 70.014371, 88.449964, 70.014371),\n (88.449964, 70.014371, 87.441922, 70.014371),\n (87.441922, 70.014371, 86.43388, 70.014371),\n (86.43388, 70.014371, 85.425838, 70.014371),\n (85.425838, 70.014371, 84.417797, 70.014371),\n (84.417797, 70.014371, 83.409755, 70.014371),\n (83.409755, 70.014371, 82.401713, 70.014371),\n (82.401713, 70.014371, 81.393671, 70.014371),\n (81.393671, 70.014371, 80.385629, 70.014371),\n (112.642971, 70.014371, 112.642971, 133.857028),\n (112.642971, 133.857028, 111.634929, 133.857028),\n (111.634929, 133.857028, 110.626887, 133.857028),\n (110.626887, 133.857028, 109.618845, 133.857028),\n (109.618845, 133.857028, 108.610803, 133.857028),\n (108.610803, 133.857028, 107.602762, 133.857028),\n (107.602762, 133.857028, 106.59472, 133.857028),\n (106.59472, 133.857028, 105.586678, 133.857028),\n (105.586678, 133.857028, 104.578636, 133.857028),\n (104.578636, 133.857028, 103.570594, 133.857028),\n (103.570594, 133.857028, 102.562552, 133.857028),\n (102.562552, 133.857028, 101.55451, 133.857028),\n (101.55451, 133.857028, 100.546468, 133.857028),\n (100.546468, 133.857028, 99.538426, 133.857028),\n (99.538426, 133.857028, 98.530384, 133.857028),\n (98.530384, 133.857028, 97.522342, 133.857028),\n (97.522342, 133.857028, 96.5143, 133.857028),\n (96.5143, 133.857028, 95.506258, 133.857028),\n (95.506258, 133.857028, 94.498216, 133.857028),\n (94.498216, 133.857028, 93.490174, 133.857028),\n (93.490174, 133.857028, 92.482132, 133.857028),\n (92.482132, 133.857028, 91.47409, 133.857028),\n (91.47409, 133.857028, 90.466048, 133.857028),\n (90.466048, 133.857028, 89.458006, 133.857028),\n (89.458006, 133.857028, 88.449964, 133.857028),\n (88.449964, 133.857028, 87.441922, 133.857028),\n (87.441922, 133.857028, 86.43388, 133.857028),\n (86.43388, 133.857028, 85.425838, 133.857028),\n (85.425838, 133.857028, 84.417797, 133.857028),\n (84.417797, 133.857028, 83.409755, 133.857028),\n (83.409755, 133.857028, 82.401713, 133.857028),\n (82.401713, 133.857028, 81.393671, 133.857028),\n (81.393671, 133.857028, 80.385629, 133.857028),\n (80.385629, 133.857028, 80.385629, 70.014371),\n (126.642972, 147.857029, 126.642972, 148.865071),\n (126.642972, 148.865071, 126.642972, 149.873113),\n (126.642972, 149.873113, 126.642972, 150.881155),\n (126.642972, 150.881155, 126.642972, 151.889197),\n (126.642972, 151.889197, 126.642972, 152.897238),\n (126.642972, 152.897238, 126.642972, 153.90528),\n (126.642972, 153.90528, 126.642972, 154.913322),\n (126.642972, 154.913322, 126.642972, 155.921364),\n (126.642972, 155.921364, 126.642972, 156.929406),\n (126.642972, 156.929406, 126.642972, 157.937448),\n (126.642972, 157.937448, 126.642972, 158.94549),\n (126.642972, 158.94549, 126.642972, 159.953532),\n (126.642972, 159.953532, 126.642972, 160.961574),\n (126.642972, 160.961574, 126.642972, 161.969616),\n (126.642972, 161.969616, 126.642972, 162.977658),\n (126.642972, 162.977658, 126.642972, 163.9857),\n (126.642972, 163.9857, 126.642972, 164.993742),\n (126.642972, 164.993742, 126.642972, 166.001784),\n (126.642972, 166.001784, 126.642972, 167.009826),\n (126.642972, 167.009826, 126.642972, 168.017868),\n (126.642972, 168.017868, 126.642972, 169.02591),\n (126.642972, 169.02591, 126.642972, 170.033952),\n (126.642972, 170.033952, 126.642972, 171.041994),\n (126.642972, 171.041994, 126.642972, 172.050036),\n (126.642972, 172.050036, 126.642972, 173.058078),\n (126.642972, 173.058078, 126.642972, 174.06612),\n (126.642972, 174.06612, 126.642972, 175.074162),\n (126.642972, 175.074162, 126.642972, 176.082203),\n (126.642972, 176.082203, 126.642972, 177.090245),\n (126.642972, 177.090245, 126.642972, 178.098287),\n (126.642972, 178.098287, 126.642972, 179.106329),\n (126.642972, 179.106329, 126.642972, 180.114371),\n (190.485629, 147.857029, 190.485629, 148.865071),\n (190.485629, 148.865071, 190.485629, 149.873113),\n (190.485629, 149.873113, 190.485629, 150.881155),\n (190.485629, 150.881155, 190.485629, 151.889197),\n (190.485629, 151.889197, 190.485629, 152.897238),\n (190.485629, 152.897238, 190.485629, 153.90528),\n (190.485629, 153.90528, 190.485629, 154.913322),\n (190.485629, 154.913322, 190.485629, 155.921364),\n (190.485629, 155.921364, 190.485629, 156.929406),\n (190.485629, 156.929406, 190.485629, 157.937448),\n (190.485629, 157.937448, 190.485629, 158.94549),\n (190.485629, 158.94549, 190.485629, 159.953532),\n (190.485629, 159.953532, 190.485629, 160.961574),\n (190.485629, 160.961574, 190.485629, 161.969616),\n (190.485629, 161.969616, 190.485629, 162.977658),\n (190.485629, 162.977658, 190.485629, 163.9857),\n (190.485629, 163.9857, 190.485629, 164.993742),\n (190.485629, 164.993742, 190.485629, 166.001784),\n (190.485629, 166.001784, 190.485629, 167.009826),\n (190.485629, 167.009826, 190.485629, 168.017868),\n (190.485629, 168.017868, 190.485629, 169.02591),\n (190.485629, 169.02591, 190.485629, 170.033952),\n (190.485629, 170.033952, 190.485629, 171.041994),\n (190.485629, 171.041994, 190.485629, 172.050036),\n (190.485629, 172.050036, 190.485629, 173.058078),\n (190.485629, 173.058078, 190.485629, 174.06612),\n (190.485629, 174.06612, 190.485629, 175.074162),\n (190.485629, 175.074162, 190.485629, 176.082203),\n (190.485629, 176.082203, 190.485629, 177.090245),\n (190.485629, 177.090245, 190.485629, 178.098287),\n (190.485629, 178.098287, 190.485629, 179.106329),\n (190.485629, 179.106329, 190.485629, 180.114371),\n (190.485629, 147.857029, 126.642972, 147.857029),\n (190.485629, 180.114371, 126.642972, 180.114371)\n]\nVISIBLE_CIRCLES = [\n (96.5143, 163.9857, 16.128671)\n]\nVISIBLE_ARCS = [\n\n]\nHIDDEN_SEGMENTS = [\n\n]\n# (orient, text, p1, p2, base) for linear; (orient, text, center, radius, angle) for diameter\nDIMENSIONS = [\n ('diameter', '%%c100', (96.5143, 163.9857), 16.1287, 45),\n ('horizontal', '197.917', (126.643, 163.9857), (190.4857, 163.9857), (158.5643, 174.9857))\n]\n\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\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\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,\n angle=(0 if d[0] == \"horizontal\" else 90),\n 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,\n text=text, dimstyle=\"EZDXF\").render()\n\n doc.saveas(out_path)\n\n\nif __name__ == \"__main__\":\n out = sys.argv[1] if len(sys.argv) > 1 else \"0061_00611260_gt.dxf\"\n draw(out)\n print(\"wrote\", out)\n```"}], "images": ["images/0061_00611260.png"], "id": "0061_00611260"} {"messages": [{"role": "user", "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 19.07 mm."}, {"role": "assistant", "content": "```python\n#!/usr/bin/env python3\n# -*- coding: utf-8 -*-\n# Ground-truth 2D engineering drawing for part: 0061_00614990\n# Self-contained: reproduces the three-view DXF via ezdxf, NO FreeCAD needed.\n# Coordinates are A4 page millimetres (scale=0.7347, page=[297.0, 210.0]).\n# visible edges -> solid (layer OUTLINE); hidden edges -> dashed (layer HIDDEN)\n# dimensions -> real movable DIMENSION entities (text = true mm value)\n# Run: python 0061_00614990_gt.py [out.dxf]\nimport sys\nimport ezdxf\n\nSCALE = 0.7347\nPAGE = [297.0, 210.0]\n\nVISIBLE_SEGMENTS = [\n (74.3921, 98.6379, 76.688038, 98.6379),\n (76.688038, 98.6379, 78.983975, 98.6379),\n (78.983975, 98.6379, 81.279912, 98.6379),\n (81.279912, 98.6379, 83.57585, 98.6379),\n (83.57585, 98.6379, 85.871787, 98.6379),\n (85.871787, 98.6379, 88.167725, 98.6379),\n (88.167725, 98.6379, 90.463662, 98.6379),\n (90.463662, 98.6379, 92.7596, 98.6379),\n (92.7596, 98.6379, 95.055538, 98.6379),\n (95.055538, 98.6379, 97.351475, 98.6379),\n (97.351475, 98.6379, 99.647413, 98.6379),\n (99.647413, 98.6379, 101.94335, 98.6379),\n (101.94335, 98.6379, 104.239288, 98.6379),\n (104.239288, 98.6379, 106.535225, 98.6379),\n (106.535225, 98.6379, 108.831163, 98.6379),\n (108.831163, 98.6379, 111.1271, 98.6379),\n (111.1271, 98.6379, 113.423037, 98.6379),\n (113.423037, 98.6379, 115.718975, 98.6379),\n (115.718975, 98.6379, 118.014912, 98.6379),\n (118.014912, 98.6379, 120.31085, 98.6379),\n (120.31085, 98.6379, 122.606788, 98.6379),\n (122.606788, 98.6379, 124.902725, 98.6379),\n (124.902725, 98.6379, 127.198663, 98.6379),\n (127.198663, 98.6379, 129.4946, 98.6379),\n (129.4946, 98.6379, 131.790538, 98.6379),\n (131.790538, 98.6379, 134.086475, 98.6379),\n (134.086475, 98.6379, 136.382413, 98.6379),\n (136.382413, 98.6379, 138.67835, 98.6379),\n (138.67835, 98.6379, 140.974288, 98.6379),\n (140.974288, 98.6379, 143.270225, 98.6379),\n (143.270225, 98.6379, 145.566163, 98.6379),\n (145.566163, 98.6379, 147.8621, 98.6379),\n (147.8621, 98.6379, 147.8621, 84.627101),\n (74.3921, 84.627101, 76.688038, 84.627101),\n (76.688038, 84.627101, 78.983975, 84.627101),\n (78.983975, 84.627101, 81.279912, 84.627101),\n (81.279912, 84.627101, 83.57585, 84.627101),\n (83.57585, 84.627101, 85.871787, 84.627101),\n (85.871787, 84.627101, 88.167725, 84.627101),\n (88.167725, 84.627101, 90.463662, 84.627101),\n (90.463662, 84.627101, 92.7596, 84.627101),\n (92.7596, 84.627101, 95.055538, 84.627101),\n (95.055538, 84.627101, 97.351475, 84.627101),\n (97.351475, 84.627101, 99.647413, 84.627101),\n (99.647413, 84.627101, 101.94335, 84.627101),\n (101.94335, 84.627101, 104.239288, 84.627101),\n (104.239288, 84.627101, 106.535225, 84.627101),\n (106.535225, 84.627101, 108.831163, 84.627101),\n (108.831163, 84.627101, 111.1271, 84.627101),\n (111.1271, 84.627101, 113.423037, 84.627101),\n (113.423037, 84.627101, 115.718975, 84.627101),\n (115.718975, 84.627101, 118.014912, 84.627101),\n (118.014912, 84.627101, 120.31085, 84.627101),\n (120.31085, 84.627101, 122.606788, 84.627101),\n (122.606788, 84.627101, 124.902725, 84.627101),\n (124.902725, 84.627101, 127.198663, 84.627101),\n (127.198663, 84.627101, 129.4946, 84.627101),\n (129.4946, 84.627101, 131.790538, 84.627101),\n (131.790538, 84.627101, 134.086475, 84.627101),\n (134.086475, 84.627101, 136.382413, 84.627101),\n (136.382413, 84.627101, 138.67835, 84.627101),\n (138.67835, 84.627101, 140.974288, 84.627101),\n (140.974288, 84.627101, 143.270225, 84.627101),\n (143.270225, 84.627101, 145.566163, 84.627101),\n (145.566163, 84.627101, 147.8621, 84.627101),\n (74.3921, 84.627101, 74.3921, 98.6379),\n (175.872899, 186.1079, 175.872899, 183.811962),\n (175.872899, 183.811962, 175.872899, 181.516025),\n (175.872899, 181.516025, 175.872899, 179.220088),\n (175.872899, 179.220088, 175.872899, 176.92415),\n (175.872899, 176.92415, 175.872899, 174.628212),\n (175.872899, 174.628212, 175.872899, 172.332275),\n (175.872899, 172.332275, 175.872899, 170.036338),\n (175.872899, 170.036338, 175.872899, 167.7404),\n (175.872899, 167.7404, 175.872899, 165.444462),\n (175.872899, 165.444462, 175.872899, 163.148525),\n (175.872899, 163.148525, 175.872899, 160.852588),\n (175.872899, 160.852588, 175.872899, 158.55665),\n (175.872899, 158.55665, 175.872899, 156.260713),\n (175.872899, 156.260713, 175.872899, 153.964775),\n (175.872899, 153.964775, 175.872899, 151.668838),\n (175.872899, 151.668838, 175.872899, 149.3729),\n (175.872899, 149.3729, 175.872899, 147.076962),\n (175.872899, 147.076962, 175.872899, 144.781025),\n (175.872899, 144.781025, 175.872899, 142.485087),\n (175.872899, 142.485087, 175.872899, 140.18915),\n (175.872899, 140.18915, 175.872899, 137.893213),\n (175.872899, 137.893213, 175.872899, 135.597275),\n (175.872899, 135.597275, 175.872899, 133.301338),\n (175.872899, 133.301338, 175.872899, 131.0054),\n (175.872899, 131.0054, 175.872899, 128.709463),\n (175.872899, 128.709463, 175.872899, 126.413525),\n (175.872899, 126.413525, 175.872899, 124.117588),\n (175.872899, 124.117588, 175.872899, 121.82165),\n (175.872899, 121.82165, 175.872899, 119.525713),\n (175.872899, 119.525713, 175.872899, 117.229775),\n (175.872899, 117.229775, 175.872899, 114.933838),\n (175.872899, 114.933838, 175.872899, 112.6379),\n (161.8621, 186.1079, 161.8621, 183.811962),\n (161.8621, 183.811962, 161.8621, 181.516025),\n (161.8621, 181.516025, 161.8621, 179.220088),\n (161.8621, 179.220088, 161.8621, 176.92415),\n (161.8621, 176.92415, 161.8621, 174.628212),\n (161.8621, 174.628212, 161.8621, 172.332275),\n (161.8621, 172.332275, 161.8621, 170.036338),\n (161.8621, 170.036338, 161.8621, 167.7404),\n (161.8621, 167.7404, 161.8621, 165.444463),\n (161.8621, 165.444463, 161.8621, 163.148525),\n (161.8621, 163.148525, 161.8621, 160.852588),\n (161.8621, 160.852588, 161.8621, 158.55665),\n (161.8621, 158.55665, 161.8621, 156.260713),\n (161.8621, 156.260713, 161.8621, 153.964775),\n (161.8621, 153.964775, 161.8621, 151.668838),\n (161.8621, 151.668838, 161.8621, 149.3729),\n (161.8621, 149.3729, 161.8621, 147.076962),\n (161.8621, 147.076962, 161.8621, 144.781025),\n (161.8621, 144.781025, 161.8621, 142.485087),\n (161.8621, 142.485087, 161.8621, 140.18915),\n (161.8621, 140.18915, 161.8621, 137.893213),\n (161.8621, 137.893213, 161.8621, 135.597275),\n (161.8621, 135.597275, 161.8621, 133.301338),\n (161.8621, 133.301338, 161.8621, 131.0054),\n (161.8621, 131.0054, 161.8621, 128.709463),\n (161.8621, 128.709463, 161.8621, 126.413525),\n (161.8621, 126.413525, 161.8621, 124.117588),\n (161.8621, 124.117588, 161.8621, 121.82165),\n (161.8621, 121.82165, 161.8621, 119.525713),\n (161.8621, 119.525713, 161.8621, 117.229775),\n (161.8621, 117.229775, 161.8621, 114.933838),\n (161.8621, 114.933838, 161.8621, 112.6379),\n (161.8621, 186.1079, 175.872899, 186.1079),\n (161.8621, 112.6379, 175.872899, 112.6379)\n]\nVISIBLE_CIRCLES = [\n (111.1271, 149.3729, 36.735)\n]\nVISIBLE_ARCS = [\n\n]\nHIDDEN_SEGMENTS = [\n\n]\n# (orient, text, p1, p2, base) for linear; (orient, text, center, radius, angle) for diameter\nDIMENSIONS = [\n ('diameter', '%%c100', (111.1271, 149.3729), 36.735, 45),\n ('horizontal', '19.0701', (175.8729, 149.3729), (161.8621, 149.3729), (168.8675, 138.3729))\n]\n\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\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\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,\n angle=(0 if d[0] == \"horizontal\" else 90),\n 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,\n text=text, dimstyle=\"EZDXF\").render()\n\n doc.saveas(out_path)\n\n\nif __name__ == \"__main__\":\n out = sys.argv[1] if len(sys.argv) > 1 else \"0061_00614990_gt.dxf\"\n draw(out)\n print(\"wrote\", out)\n```"}], "images": ["images/0061_00614990.png"], "id": "0061_00614990"} {"messages": [{"role": "user", "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 21.13 mm."}, {"role": "assistant", "content": "```python\n#!/usr/bin/env python3\n# -*- coding: utf-8 -*-\n# Ground-truth 2D engineering drawing for part: 0061_00618830\n# Self-contained: reproduces the three-view DXF via ezdxf, NO FreeCAD needed.\n# Coordinates are A4 page millimetres (scale=0.793351189143187, page=[297.0, 210.0]).\n# visible edges -> solid (layer OUTLINE); hidden edges -> dashed (layer HIDDEN)\n# dimensions -> real movable DIMENSION entities (text = true mm value)\n# Run: python 0061_00618830_gt.py [out.dxf]\nimport sys\nimport ezdxf\n\nSCALE = 0.793351189143187\nPAGE = [297.0, 210.0]\n\nVISIBLE_SEGMENTS = [\n (147.951359, 81.783759, 145.472137, 81.783759),\n (145.472137, 81.783759, 142.992915, 81.783759),\n (142.992915, 81.783759, 140.513692, 81.783759),\n (140.513692, 81.783759, 138.03447, 81.783759),\n (138.03447, 81.783759, 135.555247, 81.783759),\n (135.555247, 81.783759, 133.076025, 81.783759),\n (133.076025, 81.783759, 130.596802, 81.783759),\n (130.596802, 81.783759, 128.11758, 81.783759),\n (128.11758, 81.783759, 125.638357, 81.783759),\n (125.638357, 81.783759, 123.159135, 81.783759),\n (123.159135, 81.783759, 120.679912, 81.783759),\n (120.679912, 81.783759, 118.20069, 81.783759),\n (118.20069, 81.783759, 115.721467, 81.783759),\n (115.721467, 81.783759, 113.242245, 81.783759),\n (113.242245, 81.783759, 110.763022, 81.783759),\n (110.763022, 81.783759, 108.2838, 81.783759),\n (108.2838, 81.783759, 105.804578, 81.783759),\n (105.804578, 81.783759, 103.325355, 81.783759),\n (103.325355, 81.783759, 100.846133, 81.783759),\n (100.846133, 81.783759, 98.36691, 81.783759),\n (98.36691, 81.783759, 95.887688, 81.783759),\n (95.887688, 81.783759, 93.408465, 81.783759),\n (93.408465, 81.783759, 90.929243, 81.783759),\n (90.929243, 81.783759, 88.45002, 81.783759),\n (88.45002, 81.783759, 85.970798, 81.783759),\n (85.970798, 81.783759, 83.491575, 81.783759),\n (83.491575, 81.783759, 81.012353, 81.783759),\n (81.012353, 81.783759, 78.53313, 81.783759),\n (78.53313, 81.783759, 76.053908, 81.783759),\n (76.053908, 81.783759, 73.574685, 81.783759),\n (73.574685, 81.783759, 71.095463, 81.783759),\n (71.095463, 81.783759, 68.616241, 81.783759),\n (147.951359, 81.783759, 147.951359, 98.54864),\n (147.951359, 98.54864, 145.472137, 98.54864),\n (145.472137, 98.54864, 142.992915, 98.54864),\n (142.992915, 98.54864, 140.513692, 98.54864),\n (140.513692, 98.54864, 138.03447, 98.54864),\n (138.03447, 98.54864, 135.555247, 98.54864),\n (135.555247, 98.54864, 133.076025, 98.54864),\n (133.076025, 98.54864, 130.596802, 98.54864),\n (130.596802, 98.54864, 128.11758, 98.54864),\n (128.11758, 98.54864, 125.638357, 98.54864),\n (125.638357, 98.54864, 123.159135, 98.54864),\n (123.159135, 98.54864, 120.679912, 98.54864),\n (120.679912, 98.54864, 118.20069, 98.54864),\n (118.20069, 98.54864, 115.721467, 98.54864),\n (115.721467, 98.54864, 113.242245, 98.54864),\n (113.242245, 98.54864, 110.763022, 98.54864),\n (110.763022, 98.54864, 108.2838, 98.54864),\n (108.2838, 98.54864, 105.804578, 98.54864),\n (105.804578, 98.54864, 103.325355, 98.54864),\n (103.325355, 98.54864, 100.846133, 98.54864),\n (100.846133, 98.54864, 98.36691, 98.54864),\n (98.36691, 98.54864, 95.887688, 98.54864),\n (95.887688, 98.54864, 93.408465, 98.54864),\n (93.408465, 98.54864, 90.929243, 98.54864),\n (90.929243, 98.54864, 88.45002, 98.54864),\n (88.45002, 98.54864, 85.970798, 98.54864),\n (85.970798, 98.54864, 83.491575, 98.54864),\n (83.491575, 98.54864, 81.012353, 98.54864),\n (81.012353, 98.54864, 78.53313, 98.54864),\n (78.53313, 98.54864, 76.053908, 98.54864),\n (76.053908, 98.54864, 73.574685, 98.54864),\n (73.574685, 98.54864, 71.095463, 98.54864),\n (71.095463, 98.54864, 68.616241, 98.54864),\n (68.616241, 98.54864, 68.616241, 81.783759),\n (161.95136, 112.548641, 161.95136, 115.027863),\n (161.95136, 115.027863, 161.95136, 117.507085),\n (161.95136, 117.507085, 161.95136, 119.986308),\n (161.95136, 119.986308, 161.95136, 122.46553),\n (161.95136, 122.46553, 161.95136, 124.944753),\n (161.95136, 124.944753, 161.95136, 127.423975),\n (161.95136, 127.423975, 161.95136, 129.903198),\n (161.95136, 129.903198, 161.95136, 132.38242),\n (161.95136, 132.38242, 161.95136, 134.861643),\n (161.95136, 134.861643, 161.95136, 137.340865),\n (161.95136, 137.340865, 161.95136, 139.820088),\n (161.95136, 139.820088, 161.95136, 142.29931),\n (161.95136, 142.29931, 161.95136, 144.778533),\n (161.95136, 144.778533, 161.95136, 147.257755),\n (161.95136, 147.257755, 161.95136, 149.736978),\n (161.95136, 149.736978, 161.95136, 152.2162),\n (161.95136, 152.2162, 161.95136, 154.695422),\n (161.95136, 154.695422, 161.95136, 157.174645),\n (161.95136, 157.174645, 161.95136, 159.653867),\n (161.95136, 159.653867, 161.95136, 162.13309),\n (161.95136, 162.13309, 161.95136, 164.612312),\n (161.95136, 164.612312, 161.95136, 167.091535),\n (161.95136, 167.091535, 161.95136, 169.570757),\n (161.95136, 169.570757, 161.95136, 172.04998),\n (161.95136, 172.04998, 161.95136, 174.529202),\n (161.95136, 174.529202, 161.95136, 177.008425),\n (161.95136, 177.008425, 161.95136, 179.487647),\n (161.95136, 179.487647, 161.95136, 181.96687),\n (161.95136, 181.96687, 161.95136, 184.446092),\n (161.95136, 184.446092, 161.95136, 186.925315),\n (161.95136, 186.925315, 161.95136, 189.404537),\n (161.95136, 189.404537, 161.95136, 191.883759),\n (178.716241, 112.548641, 178.716241, 115.027863),\n (178.716241, 115.027863, 178.716241, 117.507085),\n (178.716241, 117.507085, 178.716241, 119.986308),\n (178.716241, 119.986308, 178.716241, 122.46553),\n (178.716241, 122.46553, 178.716241, 124.944753),\n (178.716241, 124.944753, 178.716241, 127.423975),\n (178.716241, 127.423975, 178.716241, 129.903198),\n (178.716241, 129.903198, 178.716241, 132.38242),\n (178.716241, 132.38242, 178.716241, 134.861643),\n (178.716241, 134.861643, 178.716241, 137.340865),\n (178.716241, 137.340865, 178.716241, 139.820088),\n (178.716241, 139.820088, 178.716241, 142.29931),\n (178.716241, 142.29931, 178.716241, 144.778533),\n (178.716241, 144.778533, 178.716241, 147.257755),\n (178.716241, 147.257755, 178.716241, 149.736978),\n (178.716241, 149.736978, 178.716241, 152.2162),\n (178.716241, 152.2162, 178.716241, 154.695422),\n (178.716241, 154.695422, 178.716241, 157.174645),\n (178.716241, 157.174645, 178.716241, 159.653867),\n (178.716241, 159.653867, 178.716241, 162.13309),\n (178.716241, 162.13309, 178.716241, 164.612312),\n (178.716241, 164.612312, 178.716241, 167.091535),\n (178.716241, 167.091535, 178.716241, 169.570757),\n (178.716241, 169.570757, 178.716241, 172.04998),\n (178.716241, 172.04998, 178.716241, 174.529202),\n (178.716241, 174.529202, 178.716241, 177.008425),\n (178.716241, 177.008425, 178.716241, 179.487647),\n (178.716241, 179.487647, 178.716241, 181.96687),\n (178.716241, 181.96687, 178.716241, 184.446092),\n (178.716241, 184.446092, 178.716241, 186.925315),\n (178.716241, 186.925315, 178.716241, 189.404537),\n (178.716241, 189.404537, 178.716241, 191.883759),\n (178.716241, 112.548641, 161.95136, 112.548641),\n (178.716241, 191.883759, 161.95136, 191.883759)\n]\nVISIBLE_CIRCLES = [\n (108.2838, 152.2162, 39.667559)\n]\nVISIBLE_ARCS = [\n\n]\nHIDDEN_SEGMENTS = [\n\n]\n# (orient, text, p1, p2, base) for linear; (orient, text, center, radius, angle) for diameter\nDIMENSIONS = [\n ('diameter', '%%c100', (108.2838, 152.2162), 39.6676, 45),\n ('horizontal', '21.1317', (161.9513, 152.2162), (178.7162, 152.2162), (170.3338, 163.2162))\n]\n\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\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\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,\n angle=(0 if d[0] == \"horizontal\" else 90),\n 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,\n text=text, dimstyle=\"EZDXF\").render()\n\n doc.saveas(out_path)\n\n\nif __name__ == \"__main__\":\n out = sys.argv[1] if len(sys.argv) > 1 else \"0061_00618830_gt.dxf\"\n draw(out)\n print(\"wrote\", out)\n```"}], "images": ["images/0061_00618830.png"], "id": "0061_00618830"} {"messages": [{"role": "user", "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": "assistant", "content": "```python\n#!/usr/bin/env python3\n# -*- coding: utf-8 -*-\n# Ground-truth 2D engineering drawing for part: 0062_00620727\n# Self-contained: reproduces the three-view DXF via ezdxf, NO FreeCAD needed.\n# Coordinates are A4 page millimetres (scale=0.32257342657349874, page=[297.0, 210.0]).\n# visible edges -> solid (layer OUTLINE); hidden edges -> dashed (layer HIDDEN)\n# dimensions -> real movable DIMENSION entities (text = true mm value)\n# Run: python 0062_00620727_gt.py [out.dxf]\nimport sys\nimport ezdxf\n\nSCALE = 0.32257342657349874\nPAGE = [297.0, 210.0]\n\nVISIBLE_SEGMENTS = [\n (80.385629, 133.857028, 81.393671, 133.857028),\n (81.393671, 133.857028, 82.401713, 133.857028),\n (82.401713, 133.857028, 83.409755, 133.857028),\n (83.409755, 133.857028, 84.417797, 133.857028),\n (84.417797, 133.857028, 85.425838, 133.857028),\n (85.425838, 133.857028, 86.43388, 133.857028),\n (86.43388, 133.857028, 87.441922, 133.857028),\n (87.441922, 133.857028, 88.449964, 133.857028),\n (88.449964, 133.857028, 89.458006, 133.857028),\n (89.458006, 133.857028, 90.466048, 133.857028),\n (90.466048, 133.857028, 91.47409, 133.857028),\n (91.47409, 133.857028, 92.482132, 133.857028),\n (92.482132, 133.857028, 93.490174, 133.857028),\n (93.490174, 133.857028, 94.498216, 133.857028),\n (94.498216, 133.857028, 95.506258, 133.857028),\n (95.506258, 133.857028, 96.5143, 133.857028),\n (96.5143, 133.857028, 97.522342, 133.857028),\n (97.522342, 133.857028, 98.530384, 133.857028),\n (98.530384, 133.857028, 99.538426, 133.857028),\n (99.538426, 133.857028, 100.546468, 133.857028),\n (100.546468, 133.857028, 101.55451, 133.857028),\n (101.55451, 133.857028, 102.562552, 133.857028),\n (102.562552, 133.857028, 103.570594, 133.857028),\n (103.570594, 133.857028, 104.578636, 133.857028),\n (104.578636, 133.857028, 105.586678, 133.857028),\n (105.586678, 133.857028, 106.59472, 133.857028),\n (106.59472, 133.857028, 107.602762, 133.857028),\n (107.602762, 133.857028, 108.610803, 133.857028),\n (108.610803, 133.857028, 109.618845, 133.857028),\n (109.618845, 133.857028, 110.626887, 133.857028),\n (110.626887, 133.857028, 111.634929, 133.857028),\n (111.634929, 133.857028, 112.642971, 133.857028),\n (112.642971, 133.857028, 112.642971, 70.014371),\n (80.385629, 70.014371, 81.393671, 70.014371),\n (81.393671, 70.014371, 82.401713, 70.014371),\n (82.401713, 70.014371, 83.409755, 70.014371),\n (83.409755, 70.014371, 84.417797, 70.014371),\n (84.417797, 70.014371, 85.425838, 70.014371),\n (85.425838, 70.014371, 86.43388, 70.014371),\n (86.43388, 70.014371, 87.441922, 70.014371),\n (87.441922, 70.014371, 88.449964, 70.014371),\n (88.449964, 70.014371, 89.458006, 70.014371),\n (89.458006, 70.014371, 90.466048, 70.014371),\n (90.466048, 70.014371, 91.47409, 70.014371),\n (91.47409, 70.014371, 92.482132, 70.014371),\n (92.482132, 70.014371, 93.490174, 70.014371),\n (93.490174, 70.014371, 94.498216, 70.014371),\n (94.498216, 70.014371, 95.506258, 70.014371),\n (95.506258, 70.014371, 96.5143, 70.014371),\n (96.5143, 70.014371, 97.522342, 70.014371),\n (97.522342, 70.014371, 98.530384, 70.014371),\n (98.530384, 70.014371, 99.538426, 70.014371),\n (99.538426, 70.014371, 100.546468, 70.014371),\n (100.546468, 70.014371, 101.55451, 70.014371),\n (101.55451, 70.014371, 102.562552, 70.014371),\n (102.562552, 70.014371, 103.570594, 70.014371),\n (103.570594, 70.014371, 104.578636, 70.014371),\n (104.578636, 70.014371, 105.586678, 70.014371),\n (105.586678, 70.014371, 106.59472, 70.014371),\n (106.59472, 70.014371, 107.602762, 70.014371),\n (107.602762, 70.014371, 108.610803, 70.014371),\n (108.610803, 70.014371, 109.618845, 70.014371),\n (109.618845, 70.014371, 110.626887, 70.014371),\n (110.626887, 70.014371, 111.634929, 70.014371),\n (111.634929, 70.014371, 112.642971, 70.014371),\n (80.385629, 70.014371, 80.385629, 133.857028),\n (190.485629, 180.114371, 190.485629, 179.106329),\n (190.485629, 179.106329, 190.485629, 178.098287),\n (190.485629, 178.098287, 190.485629, 177.090245),\n (190.485629, 177.090245, 190.485629, 176.082203),\n (190.485629, 176.082203, 190.485629, 175.074162),\n (190.485629, 175.074162, 190.485629, 174.06612),\n (190.485629, 174.06612, 190.485629, 173.058078),\n (190.485629, 173.058078, 190.485629, 172.050036),\n (190.485629, 172.050036, 190.485629, 171.041994),\n (190.485629, 171.041994, 190.485629, 170.033952),\n (190.485629, 170.033952, 190.485629, 169.02591),\n (190.485629, 169.02591, 190.485629, 168.017868),\n (190.485629, 168.017868, 190.485629, 167.009826),\n (190.485629, 167.009826, 190.485629, 166.001784),\n (190.485629, 166.001784, 190.485629, 164.993742),\n (190.485629, 164.993742, 190.485629, 163.9857),\n (190.485629, 163.9857, 190.485629, 162.977658),\n (190.485629, 162.977658, 190.485629, 161.969616),\n (190.485629, 161.969616, 190.485629, 160.961574),\n (190.485629, 160.961574, 190.485629, 159.953532),\n (190.485629, 159.953532, 190.485629, 158.94549),\n (190.485629, 158.94549, 190.485629, 157.937448),\n (190.485629, 157.937448, 190.485629, 156.929406),\n (190.485629, 156.929406, 190.485629, 155.921364),\n (190.485629, 155.921364, 190.485629, 154.913322),\n (190.485629, 154.913322, 190.485629, 153.90528),\n (190.485629, 153.90528, 190.485629, 152.897238),\n (190.485629, 152.897238, 190.485629, 151.889197),\n (190.485629, 151.889197, 190.485629, 150.881155),\n (190.485629, 150.881155, 190.485629, 149.873113),\n (190.485629, 149.873113, 190.485629, 148.865071),\n (190.485629, 148.865071, 190.485629, 147.857029),\n (126.642972, 180.114371, 126.642972, 179.106329),\n (126.642972, 179.106329, 126.642972, 178.098287),\n (126.642972, 178.098287, 126.642972, 177.090245),\n (126.642972, 177.090245, 126.642972, 176.082203),\n (126.642972, 176.082203, 126.642972, 175.074162),\n (126.642972, 175.074162, 126.642972, 174.06612),\n (126.642972, 174.06612, 126.642972, 173.058078),\n (126.642972, 173.058078, 126.642972, 172.050036),\n (126.642972, 172.050036, 126.642972, 171.041994),\n (126.642972, 171.041994, 126.642972, 170.033952),\n (126.642972, 170.033952, 126.642972, 169.02591),\n (126.642972, 169.02591, 126.642972, 168.017868),\n (126.642972, 168.017868, 126.642972, 167.009826),\n (126.642972, 167.009826, 126.642972, 166.001784),\n (126.642972, 166.001784, 126.642972, 164.993742),\n (126.642972, 164.993742, 126.642972, 163.9857),\n (126.642972, 163.9857, 126.642972, 162.977658),\n (126.642972, 162.977658, 126.642972, 161.969616),\n (126.642972, 161.969616, 126.642972, 160.961574),\n (126.642972, 160.961574, 126.642972, 159.953532),\n (126.642972, 159.953532, 126.642972, 158.94549),\n (126.642972, 158.94549, 126.642972, 157.937448),\n (126.642972, 157.937448, 126.642972, 156.929406),\n (126.642972, 156.929406, 126.642972, 155.921364),\n (126.642972, 155.921364, 126.642972, 154.913322),\n (126.642972, 154.913322, 126.642972, 153.90528),\n (126.642972, 153.90528, 126.642972, 152.897238),\n (126.642972, 152.897238, 126.642972, 151.889197),\n (126.642972, 151.889197, 126.642972, 150.881155),\n (126.642972, 150.881155, 126.642972, 149.873113),\n (126.642972, 149.873113, 126.642972, 148.865071),\n (126.642972, 148.865071, 126.642972, 147.857029),\n (126.642972, 180.114371, 190.485629, 180.114371),\n (126.642972, 147.857029, 190.485629, 147.857029)\n]\nVISIBLE_CIRCLES = [\n (96.5143, 163.9857, 16.128671)\n]\nVISIBLE_ARCS = [\n\n]\nHIDDEN_SEGMENTS = [\n\n]\n# (orient, text, p1, p2, base) for linear; (orient, text, center, radius, angle) for diameter\nDIMENSIONS = [\n ('diameter', '%%c100', (96.5143, 163.9857), 16.1287, 45),\n ('horizontal', '197.917', (190.4857, 163.9857), (126.643, 163.9857), (158.5643, 152.9857))\n]\n\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\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\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,\n angle=(0 if d[0] == \"horizontal\" else 90),\n 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,\n text=text, dimstyle=\"EZDXF\").render()\n\n doc.saveas(out_path)\n\n\nif __name__ == \"__main__\":\n out = sys.argv[1] if len(sys.argv) > 1 else \"0062_00620727_gt.dxf\"\n draw(out)\n print(\"wrote\", out)\n```"}], "images": ["images/0062_00620727.png"], "id": "0062_00620727"} {"messages": [{"role": "user", "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 -163.79 mm."}, {"role": "assistant", "content": "```python\n#!/usr/bin/env python3\n# -*- coding: utf-8 -*-\n# Ground-truth 2D engineering drawing for part: 0064_00647066\n# Self-contained: reproduces the three-view DXF via ezdxf, NO FreeCAD needed.\n# Coordinates are A4 page millimetres (scale=0.364300653594876, page=[297.0, 210.0]).\n# visible edges -> solid (layer OUTLINE); hidden edges -> dashed (layer HIDDEN)\n# dimensions -> real movable DIMENSION entities (text = true mm value)\n# Run: python 0064_00647066_gt.py [out.dxf]\nimport sys\nimport ezdxf\n\nSCALE = 0.364300653594876\nPAGE = [297.0, 210.0]\n\nVISIBLE_SEGMENTS = [\n (115.772533, 130.727467, 115.772533, 71.057532),\n (115.772533, 71.057532, 114.634093, 71.057532),\n (114.634093, 71.057532, 113.495654, 71.057532),\n (113.495654, 71.057532, 112.357214, 71.057532),\n (112.357214, 71.057532, 111.218775, 71.057532),\n (111.218775, 71.057532, 110.080335, 71.057532),\n (110.080335, 71.057532, 108.941895, 71.057532),\n (108.941895, 71.057532, 107.803456, 71.057532),\n (107.803456, 71.057532, 106.665016, 71.057532),\n (106.665016, 71.057532, 105.526577, 71.057532),\n (105.526577, 71.057532, 104.388137, 71.057532),\n (104.388137, 71.057532, 103.249698, 71.057532),\n (103.249698, 71.057532, 102.111258, 71.057532),\n (102.111258, 71.057532, 100.972819, 71.057532),\n (100.972819, 71.057532, 99.834379, 71.057532),\n (99.834379, 71.057532, 98.69594, 71.057532),\n (98.69594, 71.057532, 97.5575, 71.057532),\n (97.5575, 71.057532, 96.41906, 71.057532),\n (96.41906, 71.057532, 95.280621, 71.057532),\n (95.280621, 71.057532, 94.142181, 71.057532),\n (94.142181, 71.057532, 93.003742, 71.057532),\n (93.003742, 71.057532, 91.865302, 71.057532),\n (91.865302, 71.057532, 90.726863, 71.057532),\n (90.726863, 71.057532, 89.588423, 71.057532),\n (89.588423, 71.057532, 88.449984, 71.057532),\n (88.449984, 71.057532, 87.311544, 71.057532),\n (87.311544, 71.057532, 86.173105, 71.057532),\n (86.173105, 71.057532, 85.034665, 71.057532),\n (85.034665, 71.057532, 83.896225, 71.057532),\n (83.896225, 71.057532, 82.757786, 71.057532),\n (82.757786, 71.057532, 81.619346, 71.057532),\n (81.619346, 71.057532, 80.480907, 71.057532),\n (80.480907, 71.057532, 79.342467, 71.057532),\n (115.772533, 130.727467, 114.634093, 130.727467),\n (114.634093, 130.727467, 113.495654, 130.727467),\n (113.495654, 130.727467, 112.357214, 130.727467),\n (112.357214, 130.727467, 111.218775, 130.727467),\n (111.218775, 130.727467, 110.080335, 130.727467),\n (110.080335, 130.727467, 108.941895, 130.727467),\n (108.941895, 130.727467, 107.803456, 130.727467),\n (107.803456, 130.727467, 106.665016, 130.727467),\n (106.665016, 130.727467, 105.526577, 130.727467),\n (105.526577, 130.727467, 104.388137, 130.727467),\n (104.388137, 130.727467, 103.249698, 130.727467),\n (103.249698, 130.727467, 102.111258, 130.727467),\n (102.111258, 130.727467, 100.972819, 130.727467),\n (100.972819, 130.727467, 99.834379, 130.727467),\n (99.834379, 130.727467, 98.69594, 130.727467),\n (98.69594, 130.727467, 97.5575, 130.727467),\n (97.5575, 130.727467, 96.41906, 130.727467),\n (96.41906, 130.727467, 95.280621, 130.727467),\n (95.280621, 130.727467, 94.142181, 130.727467),\n (94.142181, 130.727467, 93.003742, 130.727467),\n (93.003742, 130.727467, 91.865302, 130.727467),\n (91.865302, 130.727467, 90.726863, 130.727467),\n (90.726863, 130.727467, 89.588423, 130.727467),\n (89.588423, 130.727467, 88.449984, 130.727467),\n (88.449984, 130.727467, 87.311544, 130.727467),\n (87.311544, 130.727467, 86.173105, 130.727467),\n (86.173105, 130.727467, 85.034665, 130.727467),\n (85.034665, 130.727467, 83.896225, 130.727467),\n (83.896225, 130.727467, 82.757786, 130.727467),\n (82.757786, 130.727467, 81.619346, 130.727467),\n (81.619346, 130.727467, 80.480907, 130.727467),\n (80.480907, 130.727467, 79.342467, 130.727467),\n (79.342467, 71.057532, 79.342467, 130.727467),\n (129.772533, 144.727467, 129.772533, 145.865907),\n (129.772533, 145.865907, 129.772533, 147.004346),\n (129.772533, 147.004346, 129.772533, 148.142786),\n (129.772533, 148.142786, 129.772533, 149.281225),\n (129.772533, 149.281225, 129.772533, 150.419665),\n (129.772533, 150.419665, 129.772533, 151.558105),\n (129.772533, 151.558105, 129.772533, 152.696544),\n (129.772533, 152.696544, 129.772533, 153.834984),\n (129.772533, 153.834984, 129.772533, 154.973423),\n (129.772533, 154.973423, 129.772533, 156.111863),\n (129.772533, 156.111863, 129.772533, 157.250302),\n (129.772533, 157.250302, 129.772533, 158.388742),\n (129.772533, 158.388742, 129.772533, 159.527181),\n (129.772533, 159.527181, 129.772533, 160.665621),\n (129.772533, 160.665621, 129.772533, 161.80406),\n (129.772533, 161.80406, 129.772533, 162.9425),\n (129.772533, 162.9425, 129.772533, 164.08094),\n (129.772533, 164.08094, 129.772533, 165.219379),\n (129.772533, 165.219379, 129.772533, 166.357819),\n (129.772533, 166.357819, 129.772533, 167.496258),\n (129.772533, 167.496258, 129.772533, 168.634698),\n (129.772533, 168.634698, 129.772533, 169.773137),\n (129.772533, 169.773137, 129.772533, 170.911577),\n (129.772533, 170.911577, 129.772533, 172.050016),\n (129.772533, 172.050016, 129.772533, 173.188456),\n (129.772533, 173.188456, 129.772533, 174.326895),\n (129.772533, 174.326895, 129.772533, 175.465335),\n (129.772533, 175.465335, 129.772533, 176.603775),\n (129.772533, 176.603775, 129.772533, 177.742214),\n (129.772533, 177.742214, 129.772533, 178.880654),\n (129.772533, 178.880654, 129.772533, 180.019093),\n (129.772533, 180.019093, 129.772533, 181.157533),\n (189.442468, 144.727467, 189.442468, 145.865907),\n (189.442468, 145.865907, 189.442468, 147.004346),\n (189.442468, 147.004346, 189.442468, 148.142786),\n (189.442468, 148.142786, 189.442468, 149.281225),\n (189.442468, 149.281225, 189.442468, 150.419665),\n (189.442468, 150.419665, 189.442468, 151.558105),\n (189.442468, 151.558105, 189.442468, 152.696544),\n (189.442468, 152.696544, 189.442468, 153.834984),\n (189.442468, 153.834984, 189.442468, 154.973423),\n (189.442468, 154.973423, 189.442468, 156.111863),\n (189.442468, 156.111863, 189.442468, 157.250302),\n (189.442468, 157.250302, 189.442468, 158.388742),\n (189.442468, 158.388742, 189.442468, 159.527181),\n (189.442468, 159.527181, 189.442468, 160.665621),\n (189.442468, 160.665621, 189.442468, 161.80406),\n (189.442468, 161.80406, 189.442468, 162.9425),\n (189.442468, 162.9425, 189.442468, 164.08094),\n (189.442468, 164.08094, 189.442468, 165.219379),\n (189.442468, 165.219379, 189.442468, 166.357819),\n (189.442468, 166.357819, 189.442468, 167.496258),\n (189.442468, 167.496258, 189.442468, 168.634698),\n (189.442468, 168.634698, 189.442468, 169.773137),\n (189.442468, 169.773137, 189.442468, 170.911577),\n (189.442468, 170.911577, 189.442468, 172.050016),\n (189.442468, 172.050016, 189.442468, 173.188456),\n (189.442468, 173.188456, 189.442468, 174.326895),\n (189.442468, 174.326895, 189.442468, 175.465335),\n (189.442468, 175.465335, 189.442468, 176.603775),\n (189.442468, 176.603775, 189.442468, 177.742214),\n (189.442468, 177.742214, 189.442468, 178.880654),\n (189.442468, 178.880654, 189.442468, 180.019093),\n (189.442468, 180.019093, 189.442468, 181.157533),\n (129.772533, 181.157533, 189.442468, 181.157533),\n (129.772533, 144.727467, 189.442468, 144.727467)\n]\nVISIBLE_CIRCLES = [\n (97.5575, 162.9425, 18.215033)\n]\nVISIBLE_ARCS = [\n\n]\nHIDDEN_SEGMENTS = [\n\n]\n# (orient, text, p1, p2, base) for linear; (orient, text, center, radius, angle) for diameter\nDIMENSIONS = [\n ('diameter', '%%c100', (97.5575, 162.9425), 18.215, 45),\n ('horizontal', '163.793', (189.4425, 162.9425), (129.7726, 162.9425), (159.6075, 151.9425))\n]\n\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\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\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,\n angle=(0 if d[0] == \"horizontal\" else 90),\n 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,\n text=text, dimstyle=\"EZDXF\").render()\n\n doc.saveas(out_path)\n\n\nif __name__ == \"__main__\":\n out = sys.argv[1] if len(sys.argv) > 1 else \"0064_00647066_gt.dxf\"\n draw(out)\n print(\"wrote\", out)\n```"}], "images": ["images/0064_00647066.png"], "id": "0064_00647066"} {"messages": [{"role": "user", "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 16.49 mm."}, {"role": "assistant", "content": "```python\n#!/usr/bin/env python3\n# -*- coding: utf-8 -*-\n# Ground-truth 2D engineering drawing for part: 0066_00662637\n# Self-contained: reproduces the three-view DXF via ezdxf, NO FreeCAD needed.\n# Coordinates are A4 page millimetres (scale=0.8249418777943337, page=[297.0, 210.0]).\n# visible edges -> solid (layer OUTLINE); hidden edges -> dashed (layer HIDDEN)\n# dimensions -> real movable DIMENSION entities (text = true mm value)\n# Run: python 0066_00662637_gt.py [out.dxf]\nimport sys\nimport ezdxf\n\nSCALE = 0.8249418777943337\nPAGE = [297.0, 210.0]\n\nVISIBLE_SEGMENTS = [\n (150.320594, 82.573594, 147.742651, 82.573594),\n (147.742651, 82.573594, 145.164707, 82.573594),\n (145.164707, 82.573594, 142.586764, 82.573594),\n (142.586764, 82.573594, 140.00882, 82.573594),\n (140.00882, 82.573594, 137.430877, 82.573594),\n (137.430877, 82.573594, 134.852934, 82.573594),\n (134.852934, 82.573594, 132.27499, 82.573594),\n (132.27499, 82.573594, 129.697047, 82.573594),\n (129.697047, 82.573594, 127.119104, 82.573594),\n (127.119104, 82.573594, 124.54116, 82.573594),\n (124.54116, 82.573594, 121.963217, 82.573594),\n (121.963217, 82.573594, 119.385273, 82.573594),\n (119.385273, 82.573594, 116.80733, 82.573594),\n (116.80733, 82.573594, 114.229387, 82.573594),\n (114.229387, 82.573594, 111.651443, 82.573594),\n (111.651443, 82.573594, 109.0735, 82.573594),\n (109.0735, 82.573594, 106.495557, 82.573594),\n (106.495557, 82.573594, 103.917613, 82.573594),\n (103.917613, 82.573594, 101.33967, 82.573594),\n (101.33967, 82.573594, 98.761727, 82.573594),\n (98.761727, 82.573594, 96.183783, 82.573594),\n (96.183783, 82.573594, 93.60584, 82.573594),\n (93.60584, 82.573594, 91.027896, 82.573594),\n (91.027896, 82.573594, 88.449953, 82.573594),\n (88.449953, 82.573594, 85.87201, 82.573594),\n (85.87201, 82.573594, 83.294066, 82.573594),\n (83.294066, 82.573594, 80.716123, 82.573594),\n (80.716123, 82.573594, 78.13818, 82.573594),\n (78.13818, 82.573594, 75.560236, 82.573594),\n (75.560236, 82.573594, 72.982293, 82.573594),\n (72.982293, 82.573594, 70.404349, 82.573594),\n (70.404349, 82.573594, 67.826406, 82.573594),\n (150.320594, 82.573594, 150.320594, 96.179406),\n (150.320594, 96.179406, 147.742651, 96.179406),\n (147.742651, 96.179406, 145.164707, 96.179406),\n (145.164707, 96.179406, 142.586764, 96.179406),\n (142.586764, 96.179406, 140.00882, 96.179406),\n (140.00882, 96.179406, 137.430877, 96.179406),\n (137.430877, 96.179406, 134.852934, 96.179406),\n (134.852934, 96.179406, 132.27499, 96.179406),\n (132.27499, 96.179406, 129.697047, 96.179406),\n (129.697047, 96.179406, 127.119104, 96.179406),\n (127.119104, 96.179406, 124.54116, 96.179406),\n (124.54116, 96.179406, 121.963217, 96.179406),\n (121.963217, 96.179406, 119.385273, 96.179406),\n (119.385273, 96.179406, 116.80733, 96.179406),\n (116.80733, 96.179406, 114.229387, 96.179406),\n (114.229387, 96.179406, 111.651443, 96.179406),\n (111.651443, 96.179406, 109.0735, 96.179406),\n (109.0735, 96.179406, 106.495557, 96.179406),\n (106.495557, 96.179406, 103.917613, 96.179406),\n (103.917613, 96.179406, 101.33967, 96.179406),\n (101.33967, 96.179406, 98.761727, 96.179406),\n (98.761727, 96.179406, 96.183783, 96.179406),\n (96.183783, 96.179406, 93.60584, 96.179406),\n (93.60584, 96.179406, 91.027896, 96.179406),\n (91.027896, 96.179406, 88.449953, 96.179406),\n (88.449953, 96.179406, 85.87201, 96.179406),\n (85.87201, 96.179406, 83.294066, 96.179406),\n (83.294066, 96.179406, 80.716123, 96.179406),\n (80.716123, 96.179406, 78.13818, 96.179406),\n (78.13818, 96.179406, 75.560236, 96.179406),\n (75.560236, 96.179406, 72.982293, 96.179406),\n (72.982293, 96.179406, 70.404349, 96.179406),\n (70.404349, 96.179406, 67.826406, 96.179406),\n (67.826406, 96.179406, 67.826406, 82.573594),\n (164.320594, 110.179406, 164.320594, 112.757349),\n (164.320594, 112.757349, 164.320594, 115.335293),\n (164.320594, 115.335293, 164.320594, 117.913236),\n (164.320594, 117.913236, 164.320594, 120.49118),\n (164.320594, 120.49118, 164.320594, 123.069123),\n (164.320594, 123.069123, 164.320594, 125.647066),\n (164.320594, 125.647066, 164.320594, 128.22501),\n (164.320594, 128.22501, 164.320594, 130.802953),\n (164.320594, 130.802953, 164.320594, 133.380896),\n (164.320594, 133.380896, 164.320594, 135.95884),\n (164.320594, 135.95884, 164.320594, 138.536783),\n (164.320594, 138.536783, 164.320594, 141.114727),\n (164.320594, 141.114727, 164.320594, 143.69267),\n (164.320594, 143.69267, 164.320594, 146.270613),\n (164.320594, 146.270613, 164.320594, 148.848557),\n (164.320594, 148.848557, 164.320594, 151.4265),\n (164.320594, 151.4265, 164.320594, 154.004443),\n (164.320594, 154.004443, 164.320594, 156.582387),\n (164.320594, 156.582387, 164.320594, 159.16033),\n (164.320594, 159.16033, 164.320594, 161.738273),\n (164.320594, 161.738273, 164.320594, 164.316217),\n (164.320594, 164.316217, 164.320594, 166.89416),\n (164.320594, 166.89416, 164.320594, 169.472104),\n (164.320594, 169.472104, 164.320594, 172.050047),\n (164.320594, 172.050047, 164.320594, 174.62799),\n (164.320594, 174.62799, 164.320594, 177.205934),\n (164.320594, 177.205934, 164.320594, 179.783877),\n (164.320594, 179.783877, 164.320594, 182.36182),\n (164.320594, 182.36182, 164.320594, 184.939764),\n (164.320594, 184.939764, 164.320594, 187.517707),\n (164.320594, 187.517707, 164.320594, 190.095651),\n (164.320594, 190.095651, 164.320594, 192.673594),\n (177.926406, 110.179406, 177.926406, 112.757349),\n (177.926406, 112.757349, 177.926406, 115.335293),\n (177.926406, 115.335293, 177.926406, 117.913236),\n (177.926406, 117.913236, 177.926406, 120.49118),\n (177.926406, 120.49118, 177.926406, 123.069123),\n (177.926406, 123.069123, 177.926406, 125.647066),\n (177.926406, 125.647066, 177.926406, 128.22501),\n (177.926406, 128.22501, 177.926406, 130.802953),\n (177.926406, 130.802953, 177.926406, 133.380896),\n (177.926406, 133.380896, 177.926406, 135.95884),\n (177.926406, 135.95884, 177.926406, 138.536783),\n (177.926406, 138.536783, 177.926406, 141.114727),\n (177.926406, 141.114727, 177.926406, 143.69267),\n (177.926406, 143.69267, 177.926406, 146.270613),\n (177.926406, 146.270613, 177.926406, 148.848557),\n (177.926406, 148.848557, 177.926406, 151.4265),\n (177.926406, 151.4265, 177.926406, 154.004443),\n (177.926406, 154.004443, 177.926406, 156.582387),\n (177.926406, 156.582387, 177.926406, 159.16033),\n (177.926406, 159.16033, 177.926406, 161.738273),\n (177.926406, 161.738273, 177.926406, 164.316217),\n (177.926406, 164.316217, 177.926406, 166.89416),\n (177.926406, 166.89416, 177.926406, 169.472104),\n (177.926406, 169.472104, 177.926406, 172.050047),\n (177.926406, 172.050047, 177.926406, 174.62799),\n (177.926406, 174.62799, 177.926406, 177.205934),\n (177.926406, 177.205934, 177.926406, 179.783877),\n (177.926406, 179.783877, 177.926406, 182.36182),\n (177.926406, 182.36182, 177.926406, 184.939764),\n (177.926406, 184.939764, 177.926406, 187.517707),\n (177.926406, 187.517707, 177.926406, 190.095651),\n (177.926406, 190.095651, 177.926406, 192.673594),\n (177.926406, 110.179406, 164.320594, 110.179406),\n (177.926406, 192.673594, 164.320594, 192.673594)\n]\nVISIBLE_CIRCLES = [\n (109.0735, 151.4265, 41.247094)\n]\nVISIBLE_ARCS = [\n\n]\nHIDDEN_SEGMENTS = [\n\n]\n# (orient, text, p1, p2, base) for linear; (orient, text, center, radius, angle) for diameter\nDIMENSIONS = [\n ('diameter', '%%c100', (109.0735, 151.4265), 41.2471, 45),\n ('horizontal', '16.4931', (164.3206, 151.4265), (177.9265, 151.4265), (171.1236, 162.4265))\n]\n\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\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\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,\n angle=(0 if d[0] == \"horizontal\" else 90),\n 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,\n text=text, dimstyle=\"EZDXF\").render()\n\n doc.saveas(out_path)\n\n\nif __name__ == \"__main__\":\n out = sys.argv[1] if len(sys.argv) > 1 else \"0066_00662637_gt.dxf\"\n draw(out)\n print(\"wrote\", out)\n```"}], "images": ["images/0066_00662637.png"], "id": "0066_00662637"} {"messages": [{"role": "user", "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": "assistant", "content": "```python\n#!/usr/bin/env python3\n# -*- coding: utf-8 -*-\n# Ground-truth 2D engineering drawing for part: 0066_00669173\n# Self-contained: reproduces the three-view DXF via ezdxf, NO FreeCAD needed.\n# Coordinates are A4 page millimetres (scale=0.18731355932203736, page=[297.0, 210.0]).\n# visible edges -> solid (layer OUTLINE); hidden edges -> dashed (layer HIDDEN)\n# dimensions -> real movable DIMENSION entities (text = true mm value)\n# Run: python 0066_00669173_gt.py [out.dxf]\nimport sys\nimport ezdxf\n\nSCALE = 0.18731355932203736\nPAGE = [297.0, 210.0]\n\nVISIBLE_SEGMENTS = [\n (83.767122, 144.001522, 84.352477, 144.001522),\n (84.352477, 144.001522, 84.937832, 144.001522),\n (84.937832, 144.001522, 85.523187, 144.001522),\n (85.523187, 144.001522, 86.108542, 144.001522),\n (86.108542, 144.001522, 86.693896, 144.001522),\n (86.693896, 144.001522, 87.279251, 144.001522),\n (87.279251, 144.001522, 87.864606, 144.001522),\n (87.864606, 144.001522, 88.449961, 144.001522),\n (88.449961, 144.001522, 89.035316, 144.001522),\n (89.035316, 144.001522, 89.620671, 144.001522),\n (89.620671, 144.001522, 90.206026, 144.001522),\n (90.206026, 144.001522, 90.791381, 144.001522),\n (90.791381, 144.001522, 91.376735, 144.001522),\n (91.376735, 144.001522, 91.96209, 144.001522),\n (91.96209, 144.001522, 92.547445, 144.001522),\n (92.547445, 144.001522, 93.1328, 144.001522),\n (93.1328, 144.001522, 93.718155, 144.001522),\n (93.718155, 144.001522, 94.30351, 144.001522),\n (94.30351, 144.001522, 94.888865, 144.001522),\n (94.888865, 144.001522, 95.474219, 144.001522),\n (95.474219, 144.001522, 96.059574, 144.001522),\n (96.059574, 144.001522, 96.644929, 144.001522),\n (96.644929, 144.001522, 97.230284, 144.001522),\n (97.230284, 144.001522, 97.815639, 144.001522),\n (97.815639, 144.001522, 98.400994, 144.001522),\n (98.400994, 144.001522, 98.986349, 144.001522),\n (98.986349, 144.001522, 99.571704, 144.001522),\n (99.571704, 144.001522, 100.157058, 144.001522),\n (100.157058, 144.001522, 100.742413, 144.001522),\n (100.742413, 144.001522, 101.327768, 144.001522),\n (101.327768, 144.001522, 101.913123, 144.001522),\n (101.913123, 144.001522, 102.498478, 144.001522),\n (102.498478, 144.001522, 102.498478, 66.632878),\n (83.767122, 66.632878, 84.352477, 66.632878),\n (84.352477, 66.632878, 84.937832, 66.632878),\n (84.937832, 66.632878, 85.523187, 66.632878),\n (85.523187, 66.632878, 86.108542, 66.632878),\n (86.108542, 66.632878, 86.693896, 66.632878),\n (86.693896, 66.632878, 87.279251, 66.632878),\n (87.279251, 66.632878, 87.864606, 66.632878),\n (87.864606, 66.632878, 88.449961, 66.632878),\n (88.449961, 66.632878, 89.035316, 66.632878),\n (89.035316, 66.632878, 89.620671, 66.632878),\n (89.620671, 66.632878, 90.206026, 66.632878),\n (90.206026, 66.632878, 90.791381, 66.632878),\n (90.791381, 66.632878, 91.376735, 66.632878),\n (91.376735, 66.632878, 91.96209, 66.632878),\n (91.96209, 66.632878, 92.547445, 66.632878),\n (92.547445, 66.632878, 93.1328, 66.632878),\n (93.1328, 66.632878, 93.718155, 66.632878),\n (93.718155, 66.632878, 94.30351, 66.632878),\n (94.30351, 66.632878, 94.888865, 66.632878),\n (94.888865, 66.632878, 95.474219, 66.632878),\n (95.474219, 66.632878, 96.059574, 66.632878),\n (96.059574, 66.632878, 96.644929, 66.632878),\n (96.644929, 66.632878, 97.230284, 66.632878),\n (97.230284, 66.632878, 97.815639, 66.632878),\n (97.815639, 66.632878, 98.400994, 66.632878),\n (98.400994, 66.632878, 98.986349, 66.632878),\n (98.986349, 66.632878, 99.571704, 66.632878),\n (99.571704, 66.632878, 100.157058, 66.632878),\n (100.157058, 66.632878, 100.742413, 66.632878),\n (100.742413, 66.632878, 101.327768, 66.632878),\n (101.327768, 66.632878, 101.913123, 66.632878),\n (101.913123, 66.632878, 102.498478, 66.632878),\n (83.767122, 144.001522, 83.767122, 66.632878),\n (193.867122, 176.732878, 193.867122, 176.147523),\n (193.867122, 176.147523, 193.867122, 175.562168),\n (193.867122, 175.562168, 193.867122, 174.976813),\n (193.867122, 174.976813, 193.867122, 174.391458),\n (193.867122, 174.391458, 193.867122, 173.806104),\n (193.867122, 173.806104, 193.867122, 173.220749),\n (193.867122, 173.220749, 193.867122, 172.635394),\n (193.867122, 172.635394, 193.867122, 172.050039),\n (193.867122, 172.050039, 193.867122, 171.464684),\n (193.867122, 171.464684, 193.867122, 170.879329),\n (193.867122, 170.879329, 193.867122, 170.293974),\n (193.867122, 170.293974, 193.867122, 169.708619),\n (193.867122, 169.708619, 193.867122, 169.123265),\n (193.867122, 169.123265, 193.867122, 168.53791),\n (193.867122, 168.53791, 193.867122, 167.952555),\n (193.867122, 167.952555, 193.867122, 167.3672),\n (193.867122, 167.3672, 193.867122, 166.781845),\n (193.867122, 166.781845, 193.867122, 166.19649),\n (193.867122, 166.19649, 193.867122, 165.611135),\n (193.867122, 165.611135, 193.867122, 165.025781),\n (193.867122, 165.025781, 193.867122, 164.440426),\n (193.867122, 164.440426, 193.867122, 163.855071),\n (193.867122, 163.855071, 193.867122, 163.269716),\n (193.867122, 163.269716, 193.867122, 162.684361),\n (193.867122, 162.684361, 193.867122, 162.099006),\n (193.867122, 162.099006, 193.867122, 161.513651),\n (193.867122, 161.513651, 193.867122, 160.928296),\n (193.867122, 160.928296, 193.867122, 160.342942),\n (193.867122, 160.342942, 193.867122, 159.757587),\n (193.867122, 159.757587, 193.867122, 159.172232),\n (193.867122, 159.172232, 193.867122, 158.586877),\n (193.867122, 158.586877, 193.867122, 158.001522),\n (116.498478, 176.732878, 116.498478, 176.147523),\n (116.498478, 176.147523, 116.498478, 175.562168),\n (116.498478, 175.562168, 116.498478, 174.976813),\n (116.498478, 174.976813, 116.498478, 174.391458),\n (116.498478, 174.391458, 116.498478, 173.806104),\n (116.498478, 173.806104, 116.498478, 173.220749),\n (116.498478, 173.220749, 116.498478, 172.635394),\n (116.498478, 172.635394, 116.498478, 172.050039),\n (116.498478, 172.050039, 116.498478, 171.464684),\n (116.498478, 171.464684, 116.498478, 170.879329),\n (116.498478, 170.879329, 116.498478, 170.293974),\n (116.498478, 170.293974, 116.498478, 169.708619),\n (116.498478, 169.708619, 116.498478, 169.123265),\n (116.498478, 169.123265, 116.498478, 168.53791),\n (116.498478, 168.53791, 116.498478, 167.952555),\n (116.498478, 167.952555, 116.498478, 167.3672),\n (116.498478, 167.3672, 116.498478, 166.781845),\n (116.498478, 166.781845, 116.498478, 166.19649),\n (116.498478, 166.19649, 116.498478, 165.611135),\n (116.498478, 165.611135, 116.498478, 165.025781),\n (116.498478, 165.025781, 116.498478, 164.440426),\n (116.498478, 164.440426, 116.498478, 163.855071),\n (116.498478, 163.855071, 116.498478, 163.269716),\n (116.498478, 163.269716, 116.498478, 162.684361),\n (116.498478, 162.684361, 116.498478, 162.099006),\n (116.498478, 162.099006, 116.498478, 161.513651),\n (116.498478, 161.513651, 116.498478, 160.928296),\n (116.498478, 160.928296, 116.498478, 160.342942),\n (116.498478, 160.342942, 116.498478, 159.757587),\n (116.498478, 159.757587, 116.498478, 159.172232),\n (116.498478, 159.172232, 116.498478, 158.586877),\n (116.498478, 158.586877, 116.498478, 158.001522),\n (193.867122, 158.001522, 116.498478, 158.001522),\n (193.867122, 176.732878, 116.498478, 176.732878)\n]\nVISIBLE_CIRCLES = [\n (93.1328, 167.3672, 9.365678)\n]\nVISIBLE_ARCS = [\n\n]\nHIDDEN_SEGMENTS = [\n\n]\n# (orient, text, p1, p2, base) for linear; (orient, text, center, radius, angle) for diameter\nDIMENSIONS = [\n ('diameter', '%%c100', (93.1328, 167.3672), 9.3657, 45),\n ('horizontal', '413.043', (116.4985, 167.3672), (193.8672, 167.3672), (155.1828, 178.3672))\n]\n\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\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\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,\n angle=(0 if d[0] == \"horizontal\" else 90),\n 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,\n text=text, dimstyle=\"EZDXF\").render()\n\n doc.saveas(out_path)\n\n\nif __name__ == \"__main__\":\n out = sys.argv[1] if len(sys.argv) > 1 else \"0066_00669173_gt.dxf\"\n draw(out)\n print(\"wrote\", out)\n```"}], "images": ["images/0066_00669173.png"], "id": "0066_00669173"} {"messages": [{"role": "user", "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 97.94 mm."}, {"role": "assistant", "content": "```python\n#!/usr/bin/env python3\n# -*- coding: utf-8 -*-\n# Ground-truth 2D engineering drawing for part: 0067_00676272\n# Self-contained: reproduces the three-view DXF via ezdxf, NO FreeCAD needed.\n# Coordinates are A4 page millimetres (scale=0.4855052083333331, page=[297.0, 210.0]).\n# visible edges -> solid (layer OUTLINE); hidden edges -> dashed (layer HIDDEN)\n# dimensions -> real movable DIMENSION entities (text = true mm value)\n# Run: python 0067_00676272_gt.py [out.dxf]\nimport sys\nimport ezdxf\n\nSCALE = 0.4855052083333331\nPAGE = [297.0, 210.0]\n\nVISIBLE_SEGMENTS = [\n (124.86286, 74.08766, 123.345657, 74.08766),\n (123.345657, 74.08766, 121.828453, 74.08766),\n (121.828453, 74.08766, 120.311249, 74.08766),\n (120.311249, 74.08766, 118.794045, 74.08766),\n (118.794045, 74.08766, 117.276842, 74.08766),\n (117.276842, 74.08766, 115.759638, 74.08766),\n (115.759638, 74.08766, 114.242434, 74.08766),\n (114.242434, 74.08766, 112.72523, 74.08766),\n (112.72523, 74.08766, 111.208026, 74.08766),\n (111.208026, 74.08766, 109.690823, 74.08766),\n (109.690823, 74.08766, 108.173619, 74.08766),\n (108.173619, 74.08766, 106.656415, 74.08766),\n (106.656415, 74.08766, 105.139211, 74.08766),\n (105.139211, 74.08766, 103.622008, 74.08766),\n (103.622008, 74.08766, 102.104804, 74.08766),\n (102.104804, 74.08766, 100.5876, 74.08766),\n (100.5876, 74.08766, 99.070396, 74.08766),\n (99.070396, 74.08766, 97.553192, 74.08766),\n (97.553192, 74.08766, 96.035989, 74.08766),\n (96.035989, 74.08766, 94.518785, 74.08766),\n (94.518785, 74.08766, 93.001581, 74.08766),\n (93.001581, 74.08766, 91.484377, 74.08766),\n (91.484377, 74.08766, 89.967174, 74.08766),\n (89.967174, 74.08766, 88.44997, 74.08766),\n (88.44997, 74.08766, 86.932766, 74.08766),\n (86.932766, 74.08766, 85.415562, 74.08766),\n (85.415562, 74.08766, 83.898358, 74.08766),\n (83.898358, 74.08766, 82.381155, 74.08766),\n (82.381155, 74.08766, 80.863951, 74.08766),\n (80.863951, 74.08766, 79.346747, 74.08766),\n (79.346747, 74.08766, 77.829543, 74.08766),\n (77.829543, 74.08766, 76.31234, 74.08766),\n (124.86286, 74.08766, 124.86286, 121.637139),\n (124.86286, 121.637139, 123.345657, 121.637139),\n (123.345657, 121.637139, 121.828453, 121.637139),\n (121.828453, 121.637139, 120.311249, 121.637139),\n (120.311249, 121.637139, 118.794045, 121.637139),\n (118.794045, 121.637139, 117.276842, 121.637139),\n (117.276842, 121.637139, 115.759638, 121.637139),\n (115.759638, 121.637139, 114.242434, 121.637139),\n (114.242434, 121.637139, 112.72523, 121.637139),\n (112.72523, 121.637139, 111.208026, 121.637139),\n (111.208026, 121.637139, 109.690823, 121.637139),\n (109.690823, 121.637139, 108.173619, 121.637139),\n (108.173619, 121.637139, 106.656415, 121.637139),\n (106.656415, 121.637139, 105.139211, 121.637139),\n (105.139211, 121.637139, 103.622008, 121.637139),\n (103.622008, 121.637139, 102.104804, 121.637139),\n (102.104804, 121.637139, 100.5876, 121.637139),\n (100.5876, 121.637139, 99.070396, 121.637139),\n (99.070396, 121.637139, 97.553192, 121.637139),\n (97.553192, 121.637139, 96.035989, 121.637139),\n (96.035989, 121.637139, 94.518785, 121.637139),\n (94.518785, 121.637139, 93.001581, 121.637139),\n (93.001581, 121.637139, 91.484377, 121.637139),\n (91.484377, 121.637139, 89.967174, 121.637139),\n (89.967174, 121.637139, 88.44997, 121.637139),\n (88.44997, 121.637139, 86.932766, 121.637139),\n (86.932766, 121.637139, 85.415562, 121.637139),\n (85.415562, 121.637139, 83.898358, 121.637139),\n (83.898358, 121.637139, 82.381155, 121.637139),\n (82.381155, 121.637139, 80.863951, 121.637139),\n (80.863951, 121.637139, 79.346747, 121.637139),\n (79.346747, 121.637139, 77.829543, 121.637139),\n (77.829543, 121.637139, 76.31234, 121.637139),\n (76.31234, 121.637139, 76.31234, 74.08766),\n (138.862861, 135.63714, 138.862861, 137.154343),\n (138.862861, 137.154343, 138.862861, 138.671547),\n (138.862861, 138.671547, 138.862861, 140.188751),\n (138.862861, 140.188751, 138.862861, 141.705955),\n (138.862861, 141.705955, 138.862861, 143.223158),\n (138.862861, 143.223158, 138.862861, 144.740362),\n (138.862861, 144.740362, 138.862861, 146.257566),\n (138.862861, 146.257566, 138.862861, 147.77477),\n (138.862861, 147.77477, 138.862861, 149.291974),\n (138.862861, 149.291974, 138.862861, 150.809177),\n (138.862861, 150.809177, 138.862861, 152.326381),\n (138.862861, 152.326381, 138.862861, 153.843585),\n (138.862861, 153.843585, 138.862861, 155.360789),\n (138.862861, 155.360789, 138.862861, 156.877992),\n (138.862861, 156.877992, 138.862861, 158.395196),\n (138.862861, 158.395196, 138.862861, 159.9124),\n (138.862861, 159.9124, 138.862861, 161.429604),\n (138.862861, 161.429604, 138.862861, 162.946808),\n (138.862861, 162.946808, 138.862861, 164.464011),\n (138.862861, 164.464011, 138.862861, 165.981215),\n (138.862861, 165.981215, 138.862861, 167.498419),\n (138.862861, 167.498419, 138.862861, 169.015623),\n (138.862861, 169.015623, 138.862861, 170.532826),\n (138.862861, 170.532826, 138.862861, 172.05003),\n (138.862861, 172.05003, 138.862861, 173.567234),\n (138.862861, 173.567234, 138.862861, 175.084438),\n (138.862861, 175.084438, 138.862861, 176.601642),\n (138.862861, 176.601642, 138.862861, 178.118845),\n (138.862861, 178.118845, 138.862861, 179.636049),\n (138.862861, 179.636049, 138.862861, 181.153253),\n (138.862861, 181.153253, 138.862861, 182.670457),\n (138.862861, 182.670457, 138.862861, 184.18766),\n (186.41234, 135.63714, 186.41234, 137.154343),\n (186.41234, 137.154343, 186.41234, 138.671547),\n (186.41234, 138.671547, 186.41234, 140.188751),\n (186.41234, 140.188751, 186.41234, 141.705955),\n (186.41234, 141.705955, 186.41234, 143.223158),\n (186.41234, 143.223158, 186.41234, 144.740362),\n (186.41234, 144.740362, 186.41234, 146.257566),\n (186.41234, 146.257566, 186.41234, 147.77477),\n (186.41234, 147.77477, 186.41234, 149.291974),\n (186.41234, 149.291974, 186.41234, 150.809177),\n (186.41234, 150.809177, 186.41234, 152.326381),\n (186.41234, 152.326381, 186.41234, 153.843585),\n (186.41234, 153.843585, 186.41234, 155.360789),\n (186.41234, 155.360789, 186.41234, 156.877992),\n (186.41234, 156.877992, 186.41234, 158.395196),\n (186.41234, 158.395196, 186.41234, 159.9124),\n (186.41234, 159.9124, 186.41234, 161.429604),\n (186.41234, 161.429604, 186.41234, 162.946808),\n (186.41234, 162.946808, 186.41234, 164.464011),\n (186.41234, 164.464011, 186.41234, 165.981215),\n (186.41234, 165.981215, 186.41234, 167.498419),\n (186.41234, 167.498419, 186.41234, 169.015623),\n (186.41234, 169.015623, 186.41234, 170.532826),\n (186.41234, 170.532826, 186.41234, 172.05003),\n (186.41234, 172.05003, 186.41234, 173.567234),\n (186.41234, 173.567234, 186.41234, 175.084438),\n (186.41234, 175.084438, 186.41234, 176.601642),\n (186.41234, 176.601642, 186.41234, 178.118845),\n (186.41234, 178.118845, 186.41234, 179.636049),\n (186.41234, 179.636049, 186.41234, 181.153253),\n (186.41234, 181.153253, 186.41234, 182.670457),\n (186.41234, 182.670457, 186.41234, 184.18766),\n (186.41234, 135.63714, 138.862861, 135.63714),\n (186.41234, 184.18766, 138.862861, 184.18766)\n]\nVISIBLE_CIRCLES = [\n (100.5876, 159.9124, 24.27526)\n]\nVISIBLE_ARCS = [\n\n]\nHIDDEN_SEGMENTS = [\n\n]\n# (orient, text, p1, p2, base) for linear; (orient, text, center, radius, angle) for diameter\nDIMENSIONS = [\n ('diameter', '%%c100', (100.5876, 159.9124), 24.2753, 45),\n ('horizontal', '97.9381', (138.8629, 159.9124), (186.4123, 159.9124), (162.6376, 170.9124))\n]\n\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\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\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,\n angle=(0 if d[0] == \"horizontal\" else 90),\n 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,\n text=text, dimstyle=\"EZDXF\").render()\n\n doc.saveas(out_path)\n\n\nif __name__ == \"__main__\":\n out = sys.argv[1] if len(sys.argv) > 1 else \"0067_00676272_gt.dxf\"\n draw(out)\n print(\"wrote\", out)\n```"}], "images": ["images/0067_00676272.png"], "id": "0067_00676272"} {"messages": [{"role": "user", "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 808.51 mm."}, {"role": "assistant", "content": "```python\n#!/usr/bin/env python3\n# -*- coding: utf-8 -*-\n# Ground-truth 2D engineering drawing for part: 0067_00679262\n# Self-contained: reproduces the three-view DXF via ezdxf, NO FreeCAD needed.\n# Coordinates are A4 page millimetres (scale=0.10577751756441121, page=[297.0, 210.0]).\n# visible edges -> solid (layer OUTLINE); hidden edges -> dashed (layer HIDDEN)\n# dimensions -> real movable DIMENSION entities (text = true mm value)\n# Run: python 0067_00679262_gt.py [out.dxf]\nimport sys\nimport ezdxf\n\nSCALE = 0.10577751756441121\nPAGE = [297.0, 210.0]\n\nVISIBLE_SEGMENTS = [\n (85.805524, 150.116724, 86.136079, 150.116724),\n (86.136079, 150.116724, 86.466634, 150.116724),\n (86.466634, 150.116724, 86.797188, 150.116724),\n (86.797188, 150.116724, 87.127743, 150.116724),\n (87.127743, 150.116724, 87.458298, 150.116724),\n (87.458298, 150.116724, 87.788853, 150.116724),\n (87.788853, 150.116724, 88.119407, 150.116724),\n (88.119407, 150.116724, 88.449962, 150.116724),\n (88.449962, 150.116724, 88.780517, 150.116724),\n (88.780517, 150.116724, 89.111072, 150.116724),\n (89.111072, 150.116724, 89.441626, 150.116724),\n (89.441626, 150.116724, 89.772181, 150.116724),\n (89.772181, 150.116724, 90.102736, 150.116724),\n (90.102736, 150.116724, 90.433291, 150.116724),\n (90.433291, 150.116724, 90.763845, 150.116724),\n (90.763845, 150.116724, 91.0944, 150.116724),\n (91.0944, 150.116724, 91.424955, 150.116724),\n (91.424955, 150.116724, 91.755509, 150.116724),\n (91.755509, 150.116724, 92.086064, 150.116724),\n (92.086064, 150.116724, 92.416619, 150.116724),\n (92.416619, 150.116724, 92.747174, 150.116724),\n (92.747174, 150.116724, 93.077728, 150.116724),\n (93.077728, 150.116724, 93.408283, 150.116724),\n (93.408283, 150.116724, 93.738838, 150.116724),\n (93.738838, 150.116724, 94.069393, 150.116724),\n (94.069393, 150.116724, 94.399947, 150.116724),\n (94.399947, 150.116724, 94.730502, 150.116724),\n (94.730502, 150.116724, 95.061057, 150.116724),\n (95.061057, 150.116724, 95.391612, 150.116724),\n (95.391612, 150.116724, 95.722166, 150.116724),\n (95.722166, 150.116724, 96.052721, 150.116724),\n (96.052721, 150.116724, 96.383276, 150.116724),\n (96.383276, 150.116724, 96.383276, 64.594476),\n (85.805524, 64.594476, 86.136079, 64.594476),\n (86.136079, 64.594476, 86.466634, 64.594476),\n (86.466634, 64.594476, 86.797188, 64.594476),\n (86.797188, 64.594476, 87.127743, 64.594476),\n (87.127743, 64.594476, 87.458298, 64.594476),\n (87.458298, 64.594476, 87.788853, 64.594476),\n (87.788853, 64.594476, 88.119407, 64.594476),\n (88.119407, 64.594476, 88.449962, 64.594476),\n (88.449962, 64.594476, 88.780517, 64.594476),\n (88.780517, 64.594476, 89.111072, 64.594476),\n (89.111072, 64.594476, 89.441626, 64.594476),\n (89.441626, 64.594476, 89.772181, 64.594476),\n (89.772181, 64.594476, 90.102736, 64.594476),\n (90.102736, 64.594476, 90.433291, 64.594476),\n (90.433291, 64.594476, 90.763845, 64.594476),\n (90.763845, 64.594476, 91.0944, 64.594476),\n (91.0944, 64.594476, 91.424955, 64.594476),\n (91.424955, 64.594476, 91.755509, 64.594476),\n (91.755509, 64.594476, 92.086064, 64.594476),\n (92.086064, 64.594476, 92.416619, 64.594476),\n (92.416619, 64.594476, 92.747174, 64.594476),\n (92.747174, 64.594476, 93.077728, 64.594476),\n (93.077728, 64.594476, 93.408283, 64.594476),\n (93.408283, 64.594476, 93.738838, 64.594476),\n (93.738838, 64.594476, 94.069393, 64.594476),\n (94.069393, 64.594476, 94.399947, 64.594476),\n (94.399947, 64.594476, 94.730502, 64.594476),\n (94.730502, 64.594476, 95.061057, 64.594476),\n (95.061057, 64.594476, 95.391612, 64.594476),\n (95.391612, 64.594476, 95.722166, 64.594476),\n (95.722166, 64.594476, 96.052721, 64.594476),\n (96.052721, 64.594476, 96.383276, 64.594476),\n (85.805524, 64.594476, 85.805524, 150.116724),\n (195.905524, 174.694476, 195.905524, 174.363921),\n (195.905524, 174.363921, 195.905524, 174.033366),\n (195.905524, 174.033366, 195.905524, 173.702812),\n (195.905524, 173.702812, 195.905524, 173.372257),\n (195.905524, 173.372257, 195.905524, 173.041702),\n (195.905524, 173.041702, 195.905524, 172.711147),\n (195.905524, 172.711147, 195.905524, 172.380593),\n (195.905524, 172.380593, 195.905524, 172.050038),\n (195.905524, 172.050038, 195.905524, 171.719483),\n (195.905524, 171.719483, 195.905524, 171.388928),\n (195.905524, 171.388928, 195.905524, 171.058374),\n (195.905524, 171.058374, 195.905524, 170.727819),\n (195.905524, 170.727819, 195.905524, 170.397264),\n (195.905524, 170.397264, 195.905524, 170.066709),\n (195.905524, 170.066709, 195.905524, 169.736155),\n (195.905524, 169.736155, 195.905524, 169.4056),\n (195.905524, 169.4056, 195.905524, 169.075045),\n (195.905524, 169.075045, 195.905524, 168.744491),\n (195.905524, 168.744491, 195.905524, 168.413936),\n (195.905524, 168.413936, 195.905524, 168.083381),\n (195.905524, 168.083381, 195.905524, 167.752826),\n (195.905524, 167.752826, 195.905524, 167.422272),\n (195.905524, 167.422272, 195.905524, 167.091717),\n (195.905524, 167.091717, 195.905524, 166.761162),\n (195.905524, 166.761162, 195.905524, 166.430607),\n (195.905524, 166.430607, 195.905524, 166.100053),\n (195.905524, 166.100053, 195.905524, 165.769498),\n (195.905524, 165.769498, 195.905524, 165.438943),\n (195.905524, 165.438943, 195.905524, 165.108388),\n (195.905524, 165.108388, 195.905524, 164.777834),\n (195.905524, 164.777834, 195.905524, 164.447279),\n (195.905524, 164.447279, 195.905524, 164.116724),\n (110.383276, 174.694476, 110.383276, 174.363921),\n (110.383276, 174.363921, 110.383276, 174.033366),\n (110.383276, 174.033366, 110.383276, 173.702812),\n (110.383276, 173.702812, 110.383276, 173.372257),\n (110.383276, 173.372257, 110.383276, 173.041702),\n (110.383276, 173.041702, 110.383276, 172.711147),\n (110.383276, 172.711147, 110.383276, 172.380593),\n (110.383276, 172.380593, 110.383276, 172.050038),\n (110.383276, 172.050038, 110.383276, 171.719483),\n (110.383276, 171.719483, 110.383276, 171.388928),\n (110.383276, 171.388928, 110.383276, 171.058374),\n (110.383276, 171.058374, 110.383276, 170.727819),\n (110.383276, 170.727819, 110.383276, 170.397264),\n (110.383276, 170.397264, 110.383276, 170.066709),\n (110.383276, 170.066709, 110.383276, 169.736155),\n (110.383276, 169.736155, 110.383276, 169.4056),\n (110.383276, 169.4056, 110.383276, 169.075045),\n (110.383276, 169.075045, 110.383276, 168.744491),\n (110.383276, 168.744491, 110.383276, 168.413936),\n (110.383276, 168.413936, 110.383276, 168.083381),\n (110.383276, 168.083381, 110.383276, 167.752826),\n (110.383276, 167.752826, 110.383276, 167.422272),\n (110.383276, 167.422272, 110.383276, 167.091717),\n (110.383276, 167.091717, 110.383276, 166.761162),\n (110.383276, 166.761162, 110.383276, 166.430607),\n (110.383276, 166.430607, 110.383276, 166.100053),\n (110.383276, 166.100053, 110.383276, 165.769498),\n (110.383276, 165.769498, 110.383276, 165.438943),\n (110.383276, 165.438943, 110.383276, 165.108388),\n (110.383276, 165.108388, 110.383276, 164.777834),\n (110.383276, 164.777834, 110.383276, 164.447279),\n (110.383276, 164.447279, 110.383276, 164.116724),\n (110.383276, 174.694476, 195.905524, 174.694476),\n (110.383276, 164.116724, 195.905524, 164.116724)\n]\nVISIBLE_CIRCLES = [\n (91.0944, 169.4056, 5.288876)\n]\nVISIBLE_ARCS = [\n\n]\nHIDDEN_SEGMENTS = [\n\n]\n# (orient, text, p1, p2, base) for linear; (orient, text, center, radius, angle) for diameter\nDIMENSIONS = [\n ('diameter', '%%c100', (91.0944, 169.4056), 5.2889, 45),\n ('horizontal', '808.511', (195.9056, 169.4056), (110.3833, 169.4056), (153.1444, 158.4056))\n]\n\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\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\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,\n angle=(0 if d[0] == \"horizontal\" else 90),\n 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,\n text=text, dimstyle=\"EZDXF\").render()\n\n doc.saveas(out_path)\n\n\nif __name__ == \"__main__\":\n out = sys.argv[1] if len(sys.argv) > 1 else \"0067_00679262_gt.dxf\"\n draw(out)\n print(\"wrote\", out)\n```"}], "images": ["images/0067_00679262.png"], "id": "0067_00679262"} {"messages": [{"role": "user", "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 500 mm."}, {"role": "assistant", "content": "```python\n#!/usr/bin/env python3\n# -*- coding: utf-8 -*-\n# Ground-truth 2D engineering drawing for part: 0069_00693191\n# Self-contained: reproduces the three-view DXF via ezdxf, NO FreeCAD needed.\n# Coordinates are A4 page millimetres (scale=0.16016666666666668, page=[297.0, 210.0]).\n# visible edges -> solid (layer OUTLINE); hidden edges -> dashed (layer HIDDEN)\n# dimensions -> real movable DIMENSION entities (text = true mm value)\n# Run: python 0069_00693191_gt.py [out.dxf]\nimport sys\nimport ezdxf\n\nSCALE = 0.16016666666666668\nPAGE = [297.0, 210.0]\n\nVISIBLE_SEGMENTS = [\n (100.462533, 65.954133, 99.962013, 65.954133),\n (99.962013, 65.954133, 99.461492, 65.954133),\n (99.461492, 65.954133, 98.960971, 65.954133),\n (98.960971, 65.954133, 98.46045, 65.954133),\n (98.46045, 65.954133, 97.959929, 65.954133),\n (97.959929, 65.954133, 97.459408, 65.954133),\n (97.459408, 65.954133, 96.958888, 65.954133),\n (96.958888, 65.954133, 96.458367, 65.954133),\n (96.458367, 65.954133, 95.957846, 65.954133),\n (95.957846, 65.954133, 95.457325, 65.954133),\n (95.457325, 65.954133, 94.956804, 65.954133),\n (94.956804, 65.954133, 94.456283, 65.954133),\n (94.456283, 65.954133, 93.955763, 65.954133),\n (93.955763, 65.954133, 93.455242, 65.954133),\n (93.455242, 65.954133, 92.954721, 65.954133),\n (92.954721, 65.954133, 92.4542, 65.954133),\n (92.4542, 65.954133, 91.953679, 65.954133),\n (91.953679, 65.954133, 91.453158, 65.954133),\n (91.453158, 65.954133, 90.952637, 65.954133),\n (90.952637, 65.954133, 90.452117, 65.954133),\n (90.452117, 65.954133, 89.951596, 65.954133),\n (89.951596, 65.954133, 89.451075, 65.954133),\n (89.451075, 65.954133, 88.950554, 65.954133),\n (88.950554, 65.954133, 88.450033, 65.954133),\n (88.450033, 65.954133, 87.949512, 65.954133),\n (87.949512, 65.954133, 87.448992, 65.954133),\n (87.448992, 65.954133, 86.948471, 65.954133),\n (86.948471, 65.954133, 86.44795, 65.954133),\n (86.44795, 65.954133, 85.947429, 65.954133),\n (85.947429, 65.954133, 85.446908, 65.954133),\n (85.446908, 65.954133, 84.946388, 65.954133),\n (84.946388, 65.954133, 84.445867, 65.954133),\n (100.462533, 65.954133, 100.462533, 146.037466),\n (100.462533, 146.037466, 99.962013, 146.037466),\n (99.962013, 146.037466, 99.461492, 146.037466),\n (99.461492, 146.037466, 98.960971, 146.037466),\n (98.960971, 146.037466, 98.46045, 146.037466),\n (98.46045, 146.037466, 97.959929, 146.037466),\n (97.959929, 146.037466, 97.459408, 146.037466),\n (97.459408, 146.037466, 96.958888, 146.037466),\n (96.958888, 146.037466, 96.458367, 146.037466),\n (96.458367, 146.037466, 95.957846, 146.037466),\n (95.957846, 146.037466, 95.457325, 146.037466),\n (95.457325, 146.037466, 94.956804, 146.037466),\n (94.956804, 146.037466, 94.456283, 146.037466),\n (94.456283, 146.037466, 93.955763, 146.037466),\n (93.955763, 146.037466, 93.455242, 146.037466),\n (93.455242, 146.037466, 92.954721, 146.037466),\n (92.954721, 146.037466, 92.4542, 146.037466),\n (92.4542, 146.037466, 91.953679, 146.037466),\n (91.953679, 146.037466, 91.453158, 146.037466),\n (91.453158, 146.037466, 90.952637, 146.037466),\n (90.952637, 146.037466, 90.452117, 146.037466),\n (90.452117, 146.037466, 89.951596, 146.037466),\n (89.951596, 146.037466, 89.451075, 146.037466),\n (89.451075, 146.037466, 88.950554, 146.037466),\n (88.950554, 146.037466, 88.450033, 146.037466),\n (88.450033, 146.037466, 87.949512, 146.037466),\n (87.949512, 146.037466, 87.448992, 146.037466),\n (87.448992, 146.037466, 86.948471, 146.037466),\n (86.948471, 146.037466, 86.44795, 146.037466),\n (86.44795, 146.037466, 85.947429, 146.037466),\n (85.947429, 146.037466, 85.446908, 146.037466),\n (85.446908, 146.037466, 84.946388, 146.037466),\n (84.946388, 146.037466, 84.445867, 146.037466),\n (84.445867, 146.037466, 84.445867, 65.954133),\n (114.462534, 160.037467, 114.462534, 160.537988),\n (114.462534, 160.537988, 114.462534, 161.038508),\n (114.462534, 161.038508, 114.462534, 161.539029),\n (114.462534, 161.539029, 114.462534, 162.03955),\n (114.462534, 162.03955, 114.462534, 162.540071),\n (114.462534, 162.540071, 114.462534, 163.040592),\n (114.462534, 163.040592, 114.462534, 163.541113),\n (114.462534, 163.541113, 114.462534, 164.041633),\n (114.462534, 164.041633, 114.462534, 164.542154),\n (114.462534, 164.542154, 114.462534, 165.042675),\n (114.462534, 165.042675, 114.462534, 165.543196),\n (114.462534, 165.543196, 114.462534, 166.043717),\n (114.462534, 166.043717, 114.462534, 166.544238),\n (114.462534, 166.544238, 114.462534, 167.044758),\n (114.462534, 167.044758, 114.462534, 167.545279),\n (114.462534, 167.545279, 114.462534, 168.0458),\n (114.462534, 168.0458, 114.462534, 168.546321),\n (114.462534, 168.546321, 114.462534, 169.046842),\n (114.462534, 169.046842, 114.462534, 169.547363),\n (114.462534, 169.547363, 114.462534, 170.047883),\n (114.462534, 170.047883, 114.462534, 170.548404),\n (114.462534, 170.548404, 114.462534, 171.048925),\n (114.462534, 171.048925, 114.462534, 171.549446),\n (114.462534, 171.549446, 114.462534, 172.049967),\n (114.462534, 172.049967, 114.462534, 172.550488),\n (114.462534, 172.550488, 114.462534, 173.051008),\n (114.462534, 173.051008, 114.462534, 173.551529),\n (114.462534, 173.551529, 114.462534, 174.05205),\n (114.462534, 174.05205, 114.462534, 174.552571),\n (114.462534, 174.552571, 114.462534, 175.053092),\n (114.462534, 175.053092, 114.462534, 175.553613),\n (114.462534, 175.553613, 114.462534, 176.054133),\n (194.545867, 160.037467, 194.545867, 160.537988),\n (194.545867, 160.537988, 194.545867, 161.038508),\n (194.545867, 161.038508, 194.545867, 161.539029),\n (194.545867, 161.539029, 194.545867, 162.03955),\n (194.545867, 162.03955, 194.545867, 162.540071),\n (194.545867, 162.540071, 194.545867, 163.040592),\n (194.545867, 163.040592, 194.545867, 163.541113),\n (194.545867, 163.541113, 194.545867, 164.041633),\n (194.545867, 164.041633, 194.545867, 164.542154),\n (194.545867, 164.542154, 194.545867, 165.042675),\n (194.545867, 165.042675, 194.545867, 165.543196),\n (194.545867, 165.543196, 194.545867, 166.043717),\n (194.545867, 166.043717, 194.545867, 166.544238),\n (194.545867, 166.544238, 194.545867, 167.044758),\n (194.545867, 167.044758, 194.545867, 167.545279),\n (194.545867, 167.545279, 194.545867, 168.0458),\n (194.545867, 168.0458, 194.545867, 168.546321),\n (194.545867, 168.546321, 194.545867, 169.046842),\n (194.545867, 169.046842, 194.545867, 169.547363),\n (194.545867, 169.547363, 194.545867, 170.047883),\n (194.545867, 170.047883, 194.545867, 170.548404),\n (194.545867, 170.548404, 194.545867, 171.048925),\n (194.545867, 171.048925, 194.545867, 171.549446),\n (194.545867, 171.549446, 194.545867, 172.049967),\n (194.545867, 172.049967, 194.545867, 172.550488),\n (194.545867, 172.550488, 194.545867, 173.051008),\n (194.545867, 173.051008, 194.545867, 173.551529),\n (194.545867, 173.551529, 194.545867, 174.05205),\n (194.545867, 174.05205, 194.545867, 174.552571),\n (194.545867, 174.552571, 194.545867, 175.053092),\n (194.545867, 175.053092, 194.545867, 175.553613),\n (194.545867, 175.553613, 194.545867, 176.054133),\n (194.545867, 160.037467, 114.462534, 160.037467),\n (194.545867, 176.054133, 114.462534, 176.054133)\n]\nVISIBLE_CIRCLES = [\n (92.4542, 168.0458, 8.008333)\n]\nVISIBLE_ARCS = [\n\n]\nHIDDEN_SEGMENTS = [\n\n]\n# (orient, text, p1, p2, base) for linear; (orient, text, center, radius, angle) for diameter\nDIMENSIONS = [\n ('diameter', '%%c100', (92.4542, 168.0458), 8.0083, 45),\n ('horizontal', '500', (114.4625, 168.0458), (194.5458, 168.0458), (154.5042, 179.0458))\n]\n\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\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\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,\n angle=(0 if d[0] == \"horizontal\" else 90),\n 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,\n text=text, dimstyle=\"EZDXF\").render()\n\n doc.saveas(out_path)\n\n\nif __name__ == \"__main__\":\n out = sys.argv[1] if len(sys.argv) > 1 else \"0069_00693191_gt.dxf\"\n draw(out)\n print(\"wrote\", out)\n```"}], "images": ["images/0069_00693191.png"], "id": "0069_00693191"} {"messages": [{"role": "user", "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 779.3 mm."}, {"role": "assistant", "content": "```python\n#!/usr/bin/env python3\n# -*- coding: utf-8 -*-\n# Ground-truth 2D engineering drawing for part: 0072_00720105\n# Self-contained: reproduces the three-view DXF via ezdxf, NO FreeCAD needed.\n# Coordinates are A4 page millimetres (scale=0.10929187027987561, page=[297.0, 210.0]).\n# visible edges -> solid (layer OUTLINE); hidden edges -> dashed (layer HIDDEN)\n# dimensions -> real movable DIMENSION entities (text = true mm value)\n# Run: python 0072_00720105_gt.py [out.dxf]\nimport sys\nimport ezdxf\n\nSCALE = 0.10929187027987561\nPAGE = [297.0, 210.0]\n\nVISIBLE_SEGMENTS = [\n (85.717706, 149.853106, 86.059244, 149.853106),\n (86.059244, 149.853106, 86.400781, 149.853106),\n (86.400781, 149.853106, 86.742318, 149.853106),\n (86.742318, 149.853106, 87.083855, 149.853106),\n (87.083855, 149.853106, 87.425392, 149.853106),\n (87.425392, 149.853106, 87.766929, 149.853106),\n (87.766929, 149.853106, 88.108466, 149.853106),\n (88.108466, 149.853106, 88.450003, 149.853106),\n (88.450003, 149.853106, 88.79154, 149.853106),\n (88.79154, 149.853106, 89.133077, 149.853106),\n (89.133077, 149.853106, 89.474615, 149.853106),\n (89.474615, 149.853106, 89.816152, 149.853106),\n (89.816152, 149.853106, 90.157689, 149.853106),\n (90.157689, 149.853106, 90.499226, 149.853106),\n (90.499226, 149.853106, 90.840763, 149.853106),\n (90.840763, 149.853106, 91.1823, 149.853106),\n (91.1823, 149.853106, 91.523837, 149.853106),\n (91.523837, 149.853106, 91.865374, 149.853106),\n (91.865374, 149.853106, 92.206911, 149.853106),\n (92.206911, 149.853106, 92.548448, 149.853106),\n (92.548448, 149.853106, 92.889985, 149.853106),\n (92.889985, 149.853106, 93.231523, 149.853106),\n (93.231523, 149.853106, 93.57306, 149.853106),\n (93.57306, 149.853106, 93.914597, 149.853106),\n (93.914597, 149.853106, 94.256134, 149.853106),\n (94.256134, 149.853106, 94.597671, 149.853106),\n (94.597671, 149.853106, 94.939208, 149.853106),\n (94.939208, 149.853106, 95.280745, 149.853106),\n (95.280745, 149.853106, 95.622282, 149.853106),\n (95.622282, 149.853106, 95.963819, 149.853106),\n (95.963819, 149.853106, 96.305356, 149.853106),\n (96.305356, 149.853106, 96.646894, 149.853106),\n (96.646894, 149.853106, 96.646894, 64.682293),\n (85.717706, 64.682293, 86.059244, 64.682293),\n (86.059244, 64.682293, 86.400781, 64.682293),\n (86.400781, 64.682293, 86.742318, 64.682293),\n (86.742318, 64.682293, 87.083855, 64.682293),\n (87.083855, 64.682293, 87.425392, 64.682293),\n (87.425392, 64.682293, 87.766929, 64.682293),\n (87.766929, 64.682293, 88.108466, 64.682293),\n (88.108466, 64.682293, 88.450003, 64.682293),\n (88.450003, 64.682293, 88.79154, 64.682293),\n (88.79154, 64.682293, 89.133077, 64.682293),\n (89.133077, 64.682293, 89.474615, 64.682293),\n (89.474615, 64.682293, 89.816152, 64.682293),\n (89.816152, 64.682293, 90.157689, 64.682293),\n (90.157689, 64.682293, 90.499226, 64.682293),\n (90.499226, 64.682293, 90.840763, 64.682293),\n (90.840763, 64.682293, 91.1823, 64.682293),\n (91.1823, 64.682293, 91.523837, 64.682293),\n (91.523837, 64.682293, 91.865374, 64.682293),\n (91.865374, 64.682293, 92.206911, 64.682293),\n (92.206911, 64.682293, 92.548448, 64.682293),\n (92.548448, 64.682293, 92.889985, 64.682293),\n (92.889985, 64.682293, 93.231523, 64.682293),\n (93.231523, 64.682293, 93.57306, 64.682293),\n (93.57306, 64.682293, 93.914597, 64.682293),\n (93.914597, 64.682293, 94.256134, 64.682293),\n (94.256134, 64.682293, 94.597671, 64.682293),\n (94.597671, 64.682293, 94.939208, 64.682293),\n (94.939208, 64.682293, 95.280745, 64.682293),\n (95.280745, 64.682293, 95.622282, 64.682293),\n (95.622282, 64.682293, 95.963819, 64.682293),\n (95.963819, 64.682293, 96.305356, 64.682293),\n (96.305356, 64.682293, 96.646894, 64.682293),\n (85.717706, 64.682293, 85.717706, 149.853106),\n (195.817707, 174.782294, 195.817707, 174.440756),\n (195.817707, 174.440756, 195.817707, 174.099219),\n (195.817707, 174.099219, 195.817707, 173.757682),\n (195.817707, 173.757682, 195.817707, 173.416145),\n (195.817707, 173.416145, 195.817707, 173.074608),\n (195.817707, 173.074608, 195.817707, 172.733071),\n (195.817707, 172.733071, 195.817707, 172.391534),\n (195.817707, 172.391534, 195.817707, 172.049997),\n (195.817707, 172.049997, 195.817707, 171.70846),\n (195.817707, 171.70846, 195.817707, 171.366923),\n (195.817707, 171.366923, 195.817707, 171.025385),\n (195.817707, 171.025385, 195.817707, 170.683848),\n (195.817707, 170.683848, 195.817707, 170.342311),\n (195.817707, 170.342311, 195.817707, 170.000774),\n (195.817707, 170.000774, 195.817707, 169.659237),\n (195.817707, 169.659237, 195.817707, 169.3177),\n (195.817707, 169.3177, 195.817707, 168.976163),\n (195.817707, 168.976163, 195.817707, 168.634626),\n (195.817707, 168.634626, 195.817707, 168.293089),\n (195.817707, 168.293089, 195.817707, 167.951552),\n (195.817707, 167.951552, 195.817707, 167.610015),\n (195.817707, 167.610015, 195.817707, 167.268477),\n (195.817707, 167.268477, 195.817707, 166.92694),\n (195.817707, 166.92694, 195.817707, 166.585403),\n (195.817707, 166.585403, 195.817707, 166.243866),\n (195.817707, 166.243866, 195.817707, 165.902329),\n (195.817707, 165.902329, 195.817707, 165.560792),\n (195.817707, 165.560792, 195.817707, 165.219255),\n (195.817707, 165.219255, 195.817707, 164.877718),\n (195.817707, 164.877718, 195.817707, 164.536181),\n (195.817707, 164.536181, 195.817707, 164.194644),\n (195.817707, 164.194644, 195.817707, 163.853106),\n (110.646894, 174.782294, 110.646894, 174.440756),\n (110.646894, 174.440756, 110.646894, 174.099219),\n (110.646894, 174.099219, 110.646894, 173.757682),\n (110.646894, 173.757682, 110.646894, 173.416145),\n (110.646894, 173.416145, 110.646894, 173.074608),\n (110.646894, 173.074608, 110.646894, 172.733071),\n (110.646894, 172.733071, 110.646894, 172.391534),\n (110.646894, 172.391534, 110.646894, 172.049997),\n (110.646894, 172.049997, 110.646894, 171.70846),\n (110.646894, 171.70846, 110.646894, 171.366923),\n (110.646894, 171.366923, 110.646894, 171.025385),\n (110.646894, 171.025385, 110.646894, 170.683848),\n (110.646894, 170.683848, 110.646894, 170.342311),\n (110.646894, 170.342311, 110.646894, 170.000774),\n (110.646894, 170.000774, 110.646894, 169.659237),\n (110.646894, 169.659237, 110.646894, 169.3177),\n (110.646894, 169.3177, 110.646894, 168.976163),\n (110.646894, 168.976163, 110.646894, 168.634626),\n (110.646894, 168.634626, 110.646894, 168.293089),\n (110.646894, 168.293089, 110.646894, 167.951552),\n (110.646894, 167.951552, 110.646894, 167.610015),\n (110.646894, 167.610015, 110.646894, 167.268477),\n (110.646894, 167.268477, 110.646894, 166.92694),\n (110.646894, 166.92694, 110.646894, 166.585403),\n (110.646894, 166.585403, 110.646894, 166.243866),\n (110.646894, 166.243866, 110.646894, 165.902329),\n (110.646894, 165.902329, 110.646894, 165.560792),\n (110.646894, 165.560792, 110.646894, 165.219255),\n (110.646894, 165.219255, 110.646894, 164.877718),\n (110.646894, 164.877718, 110.646894, 164.536181),\n (110.646894, 164.536181, 110.646894, 164.194644),\n (110.646894, 164.194644, 110.646894, 163.853106),\n (110.646894, 174.782294, 195.817707, 174.782294),\n (110.646894, 163.853106, 195.817707, 163.853106)\n]\nVISIBLE_CIRCLES = [\n (91.1823, 169.3177, 5.464594)\n]\nVISIBLE_ARCS = [\n\n]\nHIDDEN_SEGMENTS = [\n\n]\n# (orient, text, p1, p2, base) for linear; (orient, text, center, radius, angle) for diameter\nDIMENSIONS = [\n ('diameter', '%%c100', (91.1823, 169.3177), 5.4646, 45),\n ('horizontal', '779.297', (195.8177, 169.3177), (110.6469, 169.3177), (153.2323, 158.3177))\n]\n\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\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\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,\n angle=(0 if d[0] == \"horizontal\" else 90),\n 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,\n text=text, dimstyle=\"EZDXF\").render()\n\n doc.saveas(out_path)\n\n\nif __name__ == \"__main__\":\n out = sys.argv[1] if len(sys.argv) > 1 else \"0072_00720105_gt.dxf\"\n draw(out)\n print(\"wrote\", out)\n```"}], "images": ["images/0072_00720105.png"], "id": "0072_00720105"} {"messages": [{"role": "user", "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 1357.14 mm."}, {"role": "assistant", "content": "```python\n#!/usr/bin/env python3\n# -*- coding: utf-8 -*-\n# Ground-truth 2D engineering drawing for part: 0072_00720145\n# Self-contained: reproduces the three-view DXF via ezdxf, NO FreeCAD needed.\n# Coordinates are A4 page millimetres (scale=0.0659509803921504, page=[297.0, 210.0]).\n# visible edges -> solid (layer OUTLINE); hidden edges -> dashed (layer HIDDEN)\n# dimensions -> real movable DIMENSION entities (text = true mm value)\n# Run: python 0072_00720145_gt.py [out.dxf]\nimport sys\nimport ezdxf\n\nSCALE = 0.0659509803921504\nPAGE = [297.0, 210.0]\n\nVISIBLE_SEGMENTS = [\n (86.801251, 153.103651, 87.007348, 153.103651),\n (87.007348, 153.103651, 87.213445, 153.103651),\n (87.213445, 153.103651, 87.419541, 153.103651),\n (87.419541, 153.103651, 87.625638, 153.103651),\n (87.625638, 153.103651, 87.831735, 153.103651),\n (87.831735, 153.103651, 88.037832, 153.103651),\n (88.037832, 153.103651, 88.243929, 153.103651),\n (88.243929, 153.103651, 88.450025, 153.103651),\n (88.450025, 153.103651, 88.656122, 153.103651),\n (88.656122, 153.103651, 88.862219, 153.103651),\n (88.862219, 153.103651, 89.068316, 153.103651),\n (89.068316, 153.103651, 89.274413, 153.103651),\n (89.274413, 153.103651, 89.48051, 153.103651),\n (89.48051, 153.103651, 89.686606, 153.103651),\n (89.686606, 153.103651, 89.892703, 153.103651),\n (89.892703, 153.103651, 90.0988, 153.103651),\n (90.0988, 153.103651, 90.304897, 153.103651),\n (90.304897, 153.103651, 90.510994, 153.103651),\n (90.510994, 153.103651, 90.71709, 153.103651),\n (90.71709, 153.103651, 90.923187, 153.103651),\n (90.923187, 153.103651, 91.129284, 153.103651),\n (91.129284, 153.103651, 91.335381, 153.103651),\n (91.335381, 153.103651, 91.541478, 153.103651),\n (91.541478, 153.103651, 91.747575, 153.103651),\n (91.747575, 153.103651, 91.953671, 153.103651),\n (91.953671, 153.103651, 92.159768, 153.103651),\n (92.159768, 153.103651, 92.365865, 153.103651),\n (92.365865, 153.103651, 92.571962, 153.103651),\n (92.571962, 153.103651, 92.778059, 153.103651),\n (92.778059, 153.103651, 92.984155, 153.103651),\n (92.984155, 153.103651, 93.190252, 153.103651),\n (93.190252, 153.103651, 93.396349, 153.103651),\n (93.396349, 153.103651, 93.396349, 63.598749),\n (86.801251, 63.598749, 87.007348, 63.598749),\n (87.007348, 63.598749, 87.213445, 63.598749),\n (87.213445, 63.598749, 87.419541, 63.598749),\n (87.419541, 63.598749, 87.625638, 63.598749),\n (87.625638, 63.598749, 87.831735, 63.598749),\n (87.831735, 63.598749, 88.037832, 63.598749),\n (88.037832, 63.598749, 88.243929, 63.598749),\n (88.243929, 63.598749, 88.450025, 63.598749),\n (88.450025, 63.598749, 88.656122, 63.598749),\n (88.656122, 63.598749, 88.862219, 63.598749),\n (88.862219, 63.598749, 89.068316, 63.598749),\n (89.068316, 63.598749, 89.274413, 63.598749),\n (89.274413, 63.598749, 89.48051, 63.598749),\n (89.48051, 63.598749, 89.686606, 63.598749),\n (89.686606, 63.598749, 89.892703, 63.598749),\n (89.892703, 63.598749, 90.0988, 63.598749),\n (90.0988, 63.598749, 90.304897, 63.598749),\n (90.304897, 63.598749, 90.510994, 63.598749),\n (90.510994, 63.598749, 90.71709, 63.598749),\n (90.71709, 63.598749, 90.923187, 63.598749),\n (90.923187, 63.598749, 91.129284, 63.598749),\n (91.129284, 63.598749, 91.335381, 63.598749),\n (91.335381, 63.598749, 91.541478, 63.598749),\n (91.541478, 63.598749, 91.747575, 63.598749),\n (91.747575, 63.598749, 91.953671, 63.598749),\n (91.953671, 63.598749, 92.159768, 63.598749),\n (92.159768, 63.598749, 92.365865, 63.598749),\n (92.365865, 63.598749, 92.571962, 63.598749),\n (92.571962, 63.598749, 92.778059, 63.598749),\n (92.778059, 63.598749, 92.984155, 63.598749),\n (92.984155, 63.598749, 93.190252, 63.598749),\n (93.190252, 63.598749, 93.396349, 63.598749),\n (86.801251, 63.598749, 86.801251, 153.103651),\n (196.901251, 173.698749, 196.901251, 173.492652),\n (196.901251, 173.492652, 196.901251, 173.286555),\n (196.901251, 173.286555, 196.901251, 173.080459),\n (196.901251, 173.080459, 196.901251, 172.874362),\n (196.901251, 172.874362, 196.901251, 172.668265),\n (196.901251, 172.668265, 196.901251, 172.462168),\n (196.901251, 172.462168, 196.901251, 172.256071),\n (196.901251, 172.256071, 196.901251, 172.049975),\n (196.901251, 172.049975, 196.901251, 171.843878),\n (196.901251, 171.843878, 196.901251, 171.637781),\n (196.901251, 171.637781, 196.901251, 171.431684),\n (196.901251, 171.431684, 196.901251, 171.225587),\n (196.901251, 171.225587, 196.901251, 171.01949),\n (196.901251, 171.01949, 196.901251, 170.813394),\n (196.901251, 170.813394, 196.901251, 170.607297),\n (196.901251, 170.607297, 196.901251, 170.4012),\n (196.901251, 170.4012, 196.901251, 170.195103),\n (196.901251, 170.195103, 196.901251, 169.989006),\n (196.901251, 169.989006, 196.901251, 169.78291),\n (196.901251, 169.78291, 196.901251, 169.576813),\n (196.901251, 169.576813, 196.901251, 169.370716),\n (196.901251, 169.370716, 196.901251, 169.164619),\n (196.901251, 169.164619, 196.901251, 168.958522),\n (196.901251, 168.958522, 196.901251, 168.752425),\n (196.901251, 168.752425, 196.901251, 168.546329),\n (196.901251, 168.546329, 196.901251, 168.340232),\n (196.901251, 168.340232, 196.901251, 168.134135),\n (196.901251, 168.134135, 196.901251, 167.928038),\n (196.901251, 167.928038, 196.901251, 167.721941),\n (196.901251, 167.721941, 196.901251, 167.515845),\n (196.901251, 167.515845, 196.901251, 167.309748),\n (196.901251, 167.309748, 196.901251, 167.103651),\n (107.396349, 173.698749, 107.396349, 173.492652),\n (107.396349, 173.492652, 107.396349, 173.286555),\n (107.396349, 173.286555, 107.396349, 173.080459),\n (107.396349, 173.080459, 107.396349, 172.874362),\n (107.396349, 172.874362, 107.396349, 172.668265),\n (107.396349, 172.668265, 107.396349, 172.462168),\n (107.396349, 172.462168, 107.396349, 172.256071),\n (107.396349, 172.256071, 107.396349, 172.049975),\n (107.396349, 172.049975, 107.396349, 171.843878),\n (107.396349, 171.843878, 107.396349, 171.637781),\n (107.396349, 171.637781, 107.396349, 171.431684),\n (107.396349, 171.431684, 107.396349, 171.225587),\n (107.396349, 171.225587, 107.396349, 171.01949),\n (107.396349, 171.01949, 107.396349, 170.813394),\n (107.396349, 170.813394, 107.396349, 170.607297),\n (107.396349, 170.607297, 107.396349, 170.4012),\n (107.396349, 170.4012, 107.396349, 170.195103),\n (107.396349, 170.195103, 107.396349, 169.989006),\n (107.396349, 169.989006, 107.396349, 169.78291),\n (107.396349, 169.78291, 107.396349, 169.576813),\n (107.396349, 169.576813, 107.396349, 169.370716),\n (107.396349, 169.370716, 107.396349, 169.164619),\n (107.396349, 169.164619, 107.396349, 168.958522),\n (107.396349, 168.958522, 107.396349, 168.752425),\n (107.396349, 168.752425, 107.396349, 168.546329),\n (107.396349, 168.546329, 107.396349, 168.340232),\n (107.396349, 168.340232, 107.396349, 168.134135),\n (107.396349, 168.134135, 107.396349, 167.928038),\n (107.396349, 167.928038, 107.396349, 167.721941),\n (107.396349, 167.721941, 107.396349, 167.515845),\n (107.396349, 167.515845, 107.396349, 167.309748),\n (107.396349, 167.309748, 107.396349, 167.103651),\n (107.396349, 173.698749, 196.901251, 173.698749),\n (107.396349, 167.103651, 196.901251, 167.103651)\n]\nVISIBLE_CIRCLES = [\n (90.0988, 170.4012, 3.297549)\n]\nVISIBLE_ARCS = [\n\n]\nHIDDEN_SEGMENTS = [\n\n]\n# (orient, text, p1, p2, base) for linear; (orient, text, center, radius, angle) for diameter\nDIMENSIONS = [\n ('diameter', '%%c100', (90.0988, 170.4012), 3.2975, 45),\n ('horizontal', '1357.14', (196.9012, 170.4012), (107.3963, 170.4012), (152.1488, 159.4012))\n]\n\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\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\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,\n angle=(0 if d[0] == \"horizontal\" else 90),\n 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,\n text=text, dimstyle=\"EZDXF\").render()\n\n doc.saveas(out_path)\n\n\nif __name__ == \"__main__\":\n out = sys.argv[1] if len(sys.argv) > 1 else \"0072_00720145_gt.dxf\"\n draw(out)\n print(\"wrote\", out)\n```"}], "images": ["images/0072_00720145.png"], "id": "0072_00720145"} {"messages": [{"role": "user", "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 48.84 mm."}, {"role": "assistant", "content": "```python\n#!/usr/bin/env python3\n# -*- coding: utf-8 -*-\n# Ground-truth 2D engineering drawing for part: 0072_00723163\n# Self-contained: reproduces the three-view DXF via ezdxf, NO FreeCAD needed.\n# Coordinates are A4 page millimetres (scale=0.6456746046173427, page=[297.0, 210.0]).\n# visible edges -> solid (layer OUTLINE); hidden edges -> dashed (layer HIDDEN)\n# dimensions -> real movable DIMENSION entities (text = true mm value)\n# Run: python 0072_00723163_gt.py [out.dxf]\nimport sys\nimport ezdxf\n\nSCALE = 0.6456746046173427\nPAGE = [297.0, 210.0]\n\nVISIBLE_SEGMENTS = [\n (136.87563, 78.09183, 134.857897, 78.09183),\n (134.857897, 78.09183, 132.840164, 78.09183),\n (132.840164, 78.09183, 130.822431, 78.09183),\n (130.822431, 78.09183, 128.804698, 78.09183),\n (128.804698, 78.09183, 126.786965, 78.09183),\n (126.786965, 78.09183, 124.769231, 78.09183),\n (124.769231, 78.09183, 122.751498, 78.09183),\n (122.751498, 78.09183, 120.733765, 78.09183),\n (120.733765, 78.09183, 118.716032, 78.09183),\n (118.716032, 78.09183, 116.698299, 78.09183),\n (116.698299, 78.09183, 114.680566, 78.09183),\n (114.680566, 78.09183, 112.662833, 78.09183),\n (112.662833, 78.09183, 110.645099, 78.09183),\n (110.645099, 78.09183, 108.627366, 78.09183),\n (108.627366, 78.09183, 106.609633, 78.09183),\n (106.609633, 78.09183, 104.5919, 78.09183),\n (104.5919, 78.09183, 102.574167, 78.09183),\n (102.574167, 78.09183, 100.556434, 78.09183),\n (100.556434, 78.09183, 98.538701, 78.09183),\n (98.538701, 78.09183, 96.520967, 78.09183),\n (96.520967, 78.09183, 94.503234, 78.09183),\n (94.503234, 78.09183, 92.485501, 78.09183),\n (92.485501, 78.09183, 90.467768, 78.09183),\n (90.467768, 78.09183, 88.450035, 78.09183),\n (88.450035, 78.09183, 86.432302, 78.09183),\n (86.432302, 78.09183, 84.414569, 78.09183),\n (84.414569, 78.09183, 82.396835, 78.09183),\n (82.396835, 78.09183, 80.379102, 78.09183),\n (80.379102, 78.09183, 78.361369, 78.09183),\n (78.361369, 78.09183, 76.343636, 78.09183),\n (76.343636, 78.09183, 74.325903, 78.09183),\n (74.325903, 78.09183, 72.30817, 78.09183),\n (136.87563, 78.09183, 136.87563, 109.62437),\n (136.87563, 109.62437, 134.857897, 109.62437),\n (134.857897, 109.62437, 132.840164, 109.62437),\n (132.840164, 109.62437, 130.822431, 109.62437),\n (130.822431, 109.62437, 128.804698, 109.62437),\n (128.804698, 109.62437, 126.786965, 109.62437),\n (126.786965, 109.62437, 124.769231, 109.62437),\n (124.769231, 109.62437, 122.751498, 109.62437),\n (122.751498, 109.62437, 120.733765, 109.62437),\n (120.733765, 109.62437, 118.716032, 109.62437),\n (118.716032, 109.62437, 116.698299, 109.62437),\n (116.698299, 109.62437, 114.680566, 109.62437),\n (114.680566, 109.62437, 112.662833, 109.62437),\n (112.662833, 109.62437, 110.645099, 109.62437),\n (110.645099, 109.62437, 108.627366, 109.62437),\n (108.627366, 109.62437, 106.609633, 109.62437),\n (106.609633, 109.62437, 104.5919, 109.62437),\n (104.5919, 109.62437, 102.574167, 109.62437),\n (102.574167, 109.62437, 100.556434, 109.62437),\n (100.556434, 109.62437, 98.538701, 109.62437),\n (98.538701, 109.62437, 96.520967, 109.62437),\n (96.520967, 109.62437, 94.503234, 109.62437),\n (94.503234, 109.62437, 92.485501, 109.62437),\n (92.485501, 109.62437, 90.467768, 109.62437),\n (90.467768, 109.62437, 88.450035, 109.62437),\n (88.450035, 109.62437, 86.432302, 109.62437),\n (86.432302, 109.62437, 84.414569, 109.62437),\n (84.414569, 109.62437, 82.396835, 109.62437),\n (82.396835, 109.62437, 80.379102, 109.62437),\n (80.379102, 109.62437, 78.361369, 109.62437),\n (78.361369, 109.62437, 76.343636, 109.62437),\n (76.343636, 109.62437, 74.325903, 109.62437),\n (74.325903, 109.62437, 72.30817, 109.62437),\n (72.30817, 109.62437, 72.30817, 78.09183),\n (150.87563, 123.62437, 150.87563, 125.642103),\n (150.87563, 125.642103, 150.87563, 127.659836),\n (150.87563, 127.659836, 150.87563, 129.677569),\n (150.87563, 129.677569, 150.87563, 131.695302),\n (150.87563, 131.695302, 150.87563, 133.713035),\n (150.87563, 133.713035, 150.87563, 135.730769),\n (150.87563, 135.730769, 150.87563, 137.748502),\n (150.87563, 137.748502, 150.87563, 139.766235),\n (150.87563, 139.766235, 150.87563, 141.783968),\n (150.87563, 141.783968, 150.87563, 143.801701),\n (150.87563, 143.801701, 150.87563, 145.819434),\n (150.87563, 145.819434, 150.87563, 147.837167),\n (150.87563, 147.837167, 150.87563, 149.854901),\n (150.87563, 149.854901, 150.87563, 151.872634),\n (150.87563, 151.872634, 150.87563, 153.890367),\n (150.87563, 153.890367, 150.87563, 155.9081),\n (150.87563, 155.9081, 150.87563, 157.925833),\n (150.87563, 157.925833, 150.87563, 159.943566),\n (150.87563, 159.943566, 150.87563, 161.961299),\n (150.87563, 161.961299, 150.87563, 163.979033),\n (150.87563, 163.979033, 150.87563, 165.996766),\n (150.87563, 165.996766, 150.87563, 168.014499),\n (150.87563, 168.014499, 150.87563, 170.032232),\n (150.87563, 170.032232, 150.87563, 172.049965),\n (150.87563, 172.049965, 150.87563, 174.067698),\n (150.87563, 174.067698, 150.87563, 176.085431),\n (150.87563, 176.085431, 150.87563, 178.103165),\n (150.87563, 178.103165, 150.87563, 180.120898),\n (150.87563, 180.120898, 150.87563, 182.138631),\n (150.87563, 182.138631, 150.87563, 184.156364),\n (150.87563, 184.156364, 150.87563, 186.174097),\n (150.87563, 186.174097, 150.87563, 188.19183),\n (182.40817, 123.62437, 182.40817, 125.642103),\n (182.40817, 125.642103, 182.40817, 127.659836),\n (182.40817, 127.659836, 182.40817, 129.677569),\n (182.40817, 129.677569, 182.40817, 131.695302),\n (182.40817, 131.695302, 182.40817, 133.713035),\n (182.40817, 133.713035, 182.40817, 135.730769),\n (182.40817, 135.730769, 182.40817, 137.748502),\n (182.40817, 137.748502, 182.40817, 139.766235),\n (182.40817, 139.766235, 182.40817, 141.783968),\n (182.40817, 141.783968, 182.40817, 143.801701),\n (182.40817, 143.801701, 182.40817, 145.819434),\n (182.40817, 145.819434, 182.40817, 147.837167),\n (182.40817, 147.837167, 182.40817, 149.854901),\n (182.40817, 149.854901, 182.40817, 151.872634),\n (182.40817, 151.872634, 182.40817, 153.890367),\n (182.40817, 153.890367, 182.40817, 155.9081),\n (182.40817, 155.9081, 182.40817, 157.925833),\n (182.40817, 157.925833, 182.40817, 159.943566),\n (182.40817, 159.943566, 182.40817, 161.961299),\n (182.40817, 161.961299, 182.40817, 163.979033),\n (182.40817, 163.979033, 182.40817, 165.996766),\n (182.40817, 165.996766, 182.40817, 168.014499),\n (182.40817, 168.014499, 182.40817, 170.032232),\n (182.40817, 170.032232, 182.40817, 172.049965),\n (182.40817, 172.049965, 182.40817, 174.067698),\n (182.40817, 174.067698, 182.40817, 176.085431),\n (182.40817, 176.085431, 182.40817, 178.103165),\n (182.40817, 178.103165, 182.40817, 180.120898),\n (182.40817, 180.120898, 182.40817, 182.138631),\n (182.40817, 182.138631, 182.40817, 184.156364),\n (182.40817, 184.156364, 182.40817, 186.174097),\n (182.40817, 186.174097, 182.40817, 188.19183),\n (182.40817, 123.62437, 150.87563, 123.62437),\n (182.40817, 188.19183, 150.87563, 188.19183)\n]\nVISIBLE_CIRCLES = [\n (104.5919, 155.9081, 32.28373)\n]\nVISIBLE_ARCS = [\n\n]\nHIDDEN_SEGMENTS = [\n\n]\n# (orient, text, p1, p2, base) for linear; (orient, text, center, radius, angle) for diameter\nDIMENSIONS = [\n ('diameter', '%%c100', (104.5919, 155.9081), 32.2837, 45),\n ('horizontal', '48.8366', (150.8756, 155.9081), (182.4081, 155.9081), (166.6419, 166.9081))\n]\n\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\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\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,\n angle=(0 if d[0] == \"horizontal\" else 90),\n 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,\n text=text, dimstyle=\"EZDXF\").render()\n\n doc.saveas(out_path)\n\n\nif __name__ == \"__main__\":\n out = sys.argv[1] if len(sys.argv) > 1 else \"0072_00723163_gt.dxf\"\n draw(out)\n print(\"wrote\", out)\n```"}], "images": ["images/0072_00723163.png"], "id": "0072_00723163"} {"messages": [{"role": "user", "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 339.29 mm."}, {"role": "assistant", "content": "```python\n#!/usr/bin/env python3\n# -*- coding: utf-8 -*-\n# Ground-truth 2D engineering drawing for part: 0073_00732528\n# Self-contained: reproduces the three-view DXF via ezdxf, NO FreeCAD needed.\n# Coordinates are A4 page millimetres (scale=0.21876422764227854, page=[297.0, 210.0]).\n# visible edges -> solid (layer OUTLINE); hidden edges -> dashed (layer HIDDEN)\n# dimensions -> real movable DIMENSION entities (text = true mm value)\n# Run: python 0073_00732528_gt.py [out.dxf]\nimport sys\nimport ezdxf\n\nSCALE = 0.21876422764227854\nPAGE = [297.0, 210.0]\n\nVISIBLE_SEGMENTS = [\n (104.857311, 67.419111, 104.173673, 67.419111),\n (104.173673, 67.419111, 103.490035, 67.419111),\n (103.490035, 67.419111, 102.806397, 67.419111),\n (102.806397, 67.419111, 102.122759, 67.419111),\n (102.122759, 67.419111, 101.43912, 67.419111),\n (101.43912, 67.419111, 100.755482, 67.419111),\n (100.755482, 67.419111, 100.071844, 67.419111),\n (100.071844, 67.419111, 99.388206, 67.419111),\n (99.388206, 67.419111, 98.704567, 67.419111),\n (98.704567, 67.419111, 98.020929, 67.419111),\n (98.020929, 67.419111, 97.337291, 67.419111),\n (97.337291, 67.419111, 96.653653, 67.419111),\n (96.653653, 67.419111, 95.970015, 67.419111),\n (95.970015, 67.419111, 95.286376, 67.419111),\n (95.286376, 67.419111, 94.602738, 67.419111),\n (94.602738, 67.419111, 93.9191, 67.419111),\n (93.9191, 67.419111, 93.235462, 67.419111),\n (93.235462, 67.419111, 92.551824, 67.419111),\n (92.551824, 67.419111, 91.868185, 67.419111),\n (91.868185, 67.419111, 91.184547, 67.419111),\n (91.184547, 67.419111, 90.500909, 67.419111),\n (90.500909, 67.419111, 89.817271, 67.419111),\n (89.817271, 67.419111, 89.133633, 67.419111),\n (89.133633, 67.419111, 88.449994, 67.419111),\n (88.449994, 67.419111, 87.766356, 67.419111),\n (87.766356, 67.419111, 87.082718, 67.419111),\n (87.082718, 67.419111, 86.39908, 67.419111),\n (86.39908, 67.419111, 85.715441, 67.419111),\n (85.715441, 67.419111, 85.031803, 67.419111),\n (85.031803, 67.419111, 84.348165, 67.419111),\n (84.348165, 67.419111, 83.664527, 67.419111),\n (83.664527, 67.419111, 82.980889, 67.419111),\n (104.857311, 67.419111, 104.857311, 141.642688),\n (104.857311, 141.642688, 104.173673, 141.642688),\n (104.173673, 141.642688, 103.490035, 141.642688),\n (103.490035, 141.642688, 102.806397, 141.642688),\n (102.806397, 141.642688, 102.122759, 141.642688),\n (102.122759, 141.642688, 101.43912, 141.642688),\n (101.43912, 141.642688, 100.755482, 141.642688),\n (100.755482, 141.642688, 100.071844, 141.642688),\n (100.071844, 141.642688, 99.388206, 141.642688),\n (99.388206, 141.642688, 98.704567, 141.642688),\n (98.704567, 141.642688, 98.020929, 141.642688),\n (98.020929, 141.642688, 97.337291, 141.642688),\n (97.337291, 141.642688, 96.653653, 141.642688),\n (96.653653, 141.642688, 95.970015, 141.642688),\n (95.970015, 141.642688, 95.286376, 141.642688),\n (95.286376, 141.642688, 94.602738, 141.642688),\n (94.602738, 141.642688, 93.9191, 141.642688),\n (93.9191, 141.642688, 93.235462, 141.642688),\n (93.235462, 141.642688, 92.551824, 141.642688),\n (92.551824, 141.642688, 91.868185, 141.642688),\n (91.868185, 141.642688, 91.184547, 141.642688),\n (91.184547, 141.642688, 90.500909, 141.642688),\n (90.500909, 141.642688, 89.817271, 141.642688),\n (89.817271, 141.642688, 89.133633, 141.642688),\n (89.133633, 141.642688, 88.449994, 141.642688),\n (88.449994, 141.642688, 87.766356, 141.642688),\n (87.766356, 141.642688, 87.082718, 141.642688),\n (87.082718, 141.642688, 86.39908, 141.642688),\n (86.39908, 141.642688, 85.715441, 141.642688),\n (85.715441, 141.642688, 85.031803, 141.642688),\n (85.031803, 141.642688, 84.348165, 141.642688),\n (84.348165, 141.642688, 83.664527, 141.642688),\n (83.664527, 141.642688, 82.980889, 141.642688),\n (82.980889, 141.642688, 82.980889, 67.419111),\n (118.857312, 155.642689, 118.857312, 156.326327),\n (118.857312, 156.326327, 118.857312, 157.009965),\n (118.857312, 157.009965, 118.857312, 157.693603),\n (118.857312, 157.693603, 118.857312, 158.377241),\n (118.857312, 158.377241, 118.857312, 159.06088),\n (118.857312, 159.06088, 118.857312, 159.744518),\n (118.857312, 159.744518, 118.857312, 160.428156),\n (118.857312, 160.428156, 118.857312, 161.111794),\n (118.857312, 161.111794, 118.857312, 161.795433),\n (118.857312, 161.795433, 118.857312, 162.479071),\n (118.857312, 162.479071, 118.857312, 163.162709),\n (118.857312, 163.162709, 118.857312, 163.846347),\n (118.857312, 163.846347, 118.857312, 164.529985),\n (118.857312, 164.529985, 118.857312, 165.213624),\n (118.857312, 165.213624, 118.857312, 165.897262),\n (118.857312, 165.897262, 118.857312, 166.5809),\n (118.857312, 166.5809, 118.857312, 167.264538),\n (118.857312, 167.264538, 118.857312, 167.948176),\n (118.857312, 167.948176, 118.857312, 168.631815),\n (118.857312, 168.631815, 118.857312, 169.315453),\n (118.857312, 169.315453, 118.857312, 169.999091),\n (118.857312, 169.999091, 118.857312, 170.682729),\n (118.857312, 170.682729, 118.857312, 171.366367),\n (118.857312, 171.366367, 118.857312, 172.050006),\n (118.857312, 172.050006, 118.857312, 172.733644),\n (118.857312, 172.733644, 118.857312, 173.417282),\n (118.857312, 173.417282, 118.857312, 174.10092),\n (118.857312, 174.10092, 118.857312, 174.784559),\n (118.857312, 174.784559, 118.857312, 175.468197),\n (118.857312, 175.468197, 118.857312, 176.151835),\n (118.857312, 176.151835, 118.857312, 176.835473),\n (118.857312, 176.835473, 118.857312, 177.519111),\n (193.080889, 155.642689, 193.080889, 156.326327),\n (193.080889, 156.326327, 193.080889, 157.009965),\n (193.080889, 157.009965, 193.080889, 157.693603),\n (193.080889, 157.693603, 193.080889, 158.377241),\n (193.080889, 158.377241, 193.080889, 159.06088),\n (193.080889, 159.06088, 193.080889, 159.744518),\n (193.080889, 159.744518, 193.080889, 160.428156),\n (193.080889, 160.428156, 193.080889, 161.111794),\n (193.080889, 161.111794, 193.080889, 161.795433),\n (193.080889, 161.795433, 193.080889, 162.479071),\n (193.080889, 162.479071, 193.080889, 163.162709),\n (193.080889, 163.162709, 193.080889, 163.846347),\n (193.080889, 163.846347, 193.080889, 164.529985),\n (193.080889, 164.529985, 193.080889, 165.213624),\n (193.080889, 165.213624, 193.080889, 165.897262),\n (193.080889, 165.897262, 193.080889, 166.5809),\n (193.080889, 166.5809, 193.080889, 167.264538),\n (193.080889, 167.264538, 193.080889, 167.948176),\n (193.080889, 167.948176, 193.080889, 168.631815),\n (193.080889, 168.631815, 193.080889, 169.315453),\n (193.080889, 169.315453, 193.080889, 169.999091),\n (193.080889, 169.999091, 193.080889, 170.682729),\n (193.080889, 170.682729, 193.080889, 171.366367),\n (193.080889, 171.366367, 193.080889, 172.050006),\n (193.080889, 172.050006, 193.080889, 172.733644),\n (193.080889, 172.733644, 193.080889, 173.417282),\n (193.080889, 173.417282, 193.080889, 174.10092),\n (193.080889, 174.10092, 193.080889, 174.784559),\n (193.080889, 174.784559, 193.080889, 175.468197),\n (193.080889, 175.468197, 193.080889, 176.151835),\n (193.080889, 176.151835, 193.080889, 176.835473),\n (193.080889, 176.835473, 193.080889, 177.519111),\n (193.080889, 155.642689, 118.857312, 155.642689),\n (193.080889, 177.519111, 118.857312, 177.519111)\n]\nVISIBLE_CIRCLES = [\n (93.9191, 166.5809, 10.938211)\n]\nVISIBLE_ARCS = [\n\n]\nHIDDEN_SEGMENTS = [\n\n]\n# (orient, text, p1, p2, base) for linear; (orient, text, center, radius, angle) for diameter\nDIMENSIONS = [\n ('diameter', '%%c100', (93.9191, 166.5809), 10.9382, 45),\n ('horizontal', '339.286', (118.8573, 166.5809), (193.0809, 166.5809), (155.9691, 177.5809))\n]\n\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\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\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,\n angle=(0 if d[0] == \"horizontal\" else 90),\n 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,\n text=text, dimstyle=\"EZDXF\").render()\n\n doc.saveas(out_path)\n\n\nif __name__ == \"__main__\":\n out = sys.argv[1] if len(sys.argv) > 1 else \"0073_00732528_gt.dxf\"\n draw(out)\n print(\"wrote\", out)\n```"}], "images": ["images/0073_00732528.png"], "id": "0073_00732528"} {"messages": [{"role": "user", "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 163.79 mm."}, {"role": "assistant", "content": "```python\n#!/usr/bin/env python3\n# -*- coding: utf-8 -*-\n# Ground-truth 2D engineering drawing for part: 0073_00735916\n# Self-contained: reproduces the three-view DXF via ezdxf, NO FreeCAD needed.\n# Coordinates are A4 page millimetres (scale=0.364300653594876, page=[297.0, 210.0]).\n# visible edges -> solid (layer OUTLINE); hidden edges -> dashed (layer HIDDEN)\n# dimensions -> real movable DIMENSION entities (text = true mm value)\n# Run: python 0073_00735916_gt.py [out.dxf]\nimport sys\nimport ezdxf\n\nSCALE = 0.364300653594876\nPAGE = [297.0, 210.0]\n\nVISIBLE_SEGMENTS = [\n (79.342467, 130.727467, 80.480907, 130.727467),\n (80.480907, 130.727467, 81.619346, 130.727467),\n (81.619346, 130.727467, 82.757786, 130.727467),\n (82.757786, 130.727467, 83.896225, 130.727467),\n (83.896225, 130.727467, 85.034665, 130.727467),\n (85.034665, 130.727467, 86.173105, 130.727467),\n (86.173105, 130.727467, 87.311544, 130.727467),\n (87.311544, 130.727467, 88.449984, 130.727467),\n (88.449984, 130.727467, 89.588423, 130.727467),\n (89.588423, 130.727467, 90.726863, 130.727467),\n (90.726863, 130.727467, 91.865302, 130.727467),\n (91.865302, 130.727467, 93.003742, 130.727467),\n (93.003742, 130.727467, 94.142181, 130.727467),\n (94.142181, 130.727467, 95.280621, 130.727467),\n (95.280621, 130.727467, 96.41906, 130.727467),\n (96.41906, 130.727467, 97.5575, 130.727467),\n (97.5575, 130.727467, 98.69594, 130.727467),\n (98.69594, 130.727467, 99.834379, 130.727467),\n (99.834379, 130.727467, 100.972819, 130.727467),\n (100.972819, 130.727467, 102.111258, 130.727467),\n (102.111258, 130.727467, 103.249698, 130.727467),\n (103.249698, 130.727467, 104.388137, 130.727467),\n (104.388137, 130.727467, 105.526577, 130.727467),\n (105.526577, 130.727467, 106.665016, 130.727467),\n (106.665016, 130.727467, 107.803456, 130.727467),\n (107.803456, 130.727467, 108.941895, 130.727467),\n (108.941895, 130.727467, 110.080335, 130.727467),\n (110.080335, 130.727467, 111.218775, 130.727467),\n (111.218775, 130.727467, 112.357214, 130.727467),\n (112.357214, 130.727467, 113.495654, 130.727467),\n (113.495654, 130.727467, 114.634093, 130.727467),\n (114.634093, 130.727467, 115.772533, 130.727467),\n (115.772533, 130.727467, 115.772533, 71.057532),\n (79.342467, 71.057532, 80.480907, 71.057532),\n (80.480907, 71.057532, 81.619346, 71.057532),\n (81.619346, 71.057532, 82.757786, 71.057532),\n (82.757786, 71.057532, 83.896225, 71.057532),\n (83.896225, 71.057532, 85.034665, 71.057532),\n (85.034665, 71.057532, 86.173105, 71.057532),\n (86.173105, 71.057532, 87.311544, 71.057532),\n (87.311544, 71.057532, 88.449984, 71.057532),\n (88.449984, 71.057532, 89.588423, 71.057532),\n (89.588423, 71.057532, 90.726863, 71.057532),\n (90.726863, 71.057532, 91.865302, 71.057532),\n (91.865302, 71.057532, 93.003742, 71.057532),\n (93.003742, 71.057532, 94.142181, 71.057532),\n (94.142181, 71.057532, 95.280621, 71.057532),\n (95.280621, 71.057532, 96.41906, 71.057532),\n (96.41906, 71.057532, 97.5575, 71.057532),\n (97.5575, 71.057532, 98.69594, 71.057532),\n (98.69594, 71.057532, 99.834379, 71.057532),\n (99.834379, 71.057532, 100.972819, 71.057532),\n (100.972819, 71.057532, 102.111258, 71.057532),\n (102.111258, 71.057532, 103.249698, 71.057532),\n (103.249698, 71.057532, 104.388137, 71.057532),\n (104.388137, 71.057532, 105.526577, 71.057532),\n (105.526577, 71.057532, 106.665016, 71.057532),\n (106.665016, 71.057532, 107.803456, 71.057532),\n (107.803456, 71.057532, 108.941895, 71.057532),\n (108.941895, 71.057532, 110.080335, 71.057532),\n (110.080335, 71.057532, 111.218775, 71.057532),\n (111.218775, 71.057532, 112.357214, 71.057532),\n (112.357214, 71.057532, 113.495654, 71.057532),\n (113.495654, 71.057532, 114.634093, 71.057532),\n (114.634093, 71.057532, 115.772533, 71.057532),\n (79.342467, 71.057532, 79.342467, 130.727467),\n (189.442468, 181.157533, 189.442468, 180.019093),\n (189.442468, 180.019093, 189.442468, 178.880654),\n (189.442468, 178.880654, 189.442468, 177.742214),\n (189.442468, 177.742214, 189.442468, 176.603775),\n (189.442468, 176.603775, 189.442468, 175.465335),\n (189.442468, 175.465335, 189.442468, 174.326895),\n (189.442468, 174.326895, 189.442468, 173.188456),\n (189.442468, 173.188456, 189.442468, 172.050016),\n (189.442468, 172.050016, 189.442468, 170.911577),\n (189.442468, 170.911577, 189.442468, 169.773137),\n (189.442468, 169.773137, 189.442468, 168.634698),\n (189.442468, 168.634698, 189.442468, 167.496258),\n (189.442468, 167.496258, 189.442468, 166.357819),\n (189.442468, 166.357819, 189.442468, 165.219379),\n (189.442468, 165.219379, 189.442468, 164.08094),\n (189.442468, 164.08094, 189.442468, 162.9425),\n (189.442468, 162.9425, 189.442468, 161.80406),\n (189.442468, 161.80406, 189.442468, 160.665621),\n (189.442468, 160.665621, 189.442468, 159.527181),\n (189.442468, 159.527181, 189.442468, 158.388742),\n (189.442468, 158.388742, 189.442468, 157.250302),\n (189.442468, 157.250302, 189.442468, 156.111863),\n (189.442468, 156.111863, 189.442468, 154.973423),\n (189.442468, 154.973423, 189.442468, 153.834984),\n (189.442468, 153.834984, 189.442468, 152.696544),\n (189.442468, 152.696544, 189.442468, 151.558105),\n (189.442468, 151.558105, 189.442468, 150.419665),\n (189.442468, 150.419665, 189.442468, 149.281225),\n (189.442468, 149.281225, 189.442468, 148.142786),\n (189.442468, 148.142786, 189.442468, 147.004346),\n (189.442468, 147.004346, 189.442468, 145.865907),\n (189.442468, 145.865907, 189.442468, 144.727467),\n (129.772533, 181.157533, 129.772533, 180.019093),\n (129.772533, 180.019093, 129.772533, 178.880654),\n (129.772533, 178.880654, 129.772533, 177.742214),\n (129.772533, 177.742214, 129.772533, 176.603775),\n (129.772533, 176.603775, 129.772533, 175.465335),\n (129.772533, 175.465335, 129.772533, 174.326895),\n (129.772533, 174.326895, 129.772533, 173.188456),\n (129.772533, 173.188456, 129.772533, 172.050016),\n (129.772533, 172.050016, 129.772533, 170.911577),\n (129.772533, 170.911577, 129.772533, 169.773137),\n (129.772533, 169.773137, 129.772533, 168.634698),\n (129.772533, 168.634698, 129.772533, 167.496258),\n (129.772533, 167.496258, 129.772533, 166.357819),\n (129.772533, 166.357819, 129.772533, 165.219379),\n (129.772533, 165.219379, 129.772533, 164.08094),\n (129.772533, 164.08094, 129.772533, 162.9425),\n (129.772533, 162.9425, 129.772533, 161.80406),\n (129.772533, 161.80406, 129.772533, 160.665621),\n (129.772533, 160.665621, 129.772533, 159.527181),\n (129.772533, 159.527181, 129.772533, 158.388742),\n (129.772533, 158.388742, 129.772533, 157.250302),\n (129.772533, 157.250302, 129.772533, 156.111863),\n (129.772533, 156.111863, 129.772533, 154.973423),\n (129.772533, 154.973423, 129.772533, 153.834984),\n (129.772533, 153.834984, 129.772533, 152.696544),\n (129.772533, 152.696544, 129.772533, 151.558105),\n (129.772533, 151.558105, 129.772533, 150.419665),\n (129.772533, 150.419665, 129.772533, 149.281225),\n (129.772533, 149.281225, 129.772533, 148.142786),\n (129.772533, 148.142786, 129.772533, 147.004346),\n (129.772533, 147.004346, 129.772533, 145.865907),\n (129.772533, 145.865907, 129.772533, 144.727467),\n (129.772533, 181.157533, 189.442468, 181.157533),\n (129.772533, 144.727467, 189.442468, 144.727467)\n]\nVISIBLE_CIRCLES = [\n (97.5575, 162.9425, 18.215033)\n]\nVISIBLE_ARCS = [\n\n]\nHIDDEN_SEGMENTS = [\n\n]\n# (orient, text, p1, p2, base) for linear; (orient, text, center, radius, angle) for diameter\nDIMENSIONS = [\n ('diameter', '%%c100', (97.5575, 162.9425), 18.215, 45),\n ('horizontal', '163.793', (189.4425, 162.9425), (129.7726, 162.9425), (159.6075, 151.9425))\n]\n\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\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\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,\n angle=(0 if d[0] == \"horizontal\" else 90),\n 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,\n text=text, dimstyle=\"EZDXF\").render()\n\n doc.saveas(out_path)\n\n\nif __name__ == \"__main__\":\n out = sys.argv[1] if len(sys.argv) > 1 else \"0073_00735916_gt.dxf\"\n draw(out)\n print(\"wrote\", out)\n```"}], "images": ["images/0073_00735916.png"], "id": "0073_00735916"} {"messages": [{"role": "user", "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": "assistant", "content": "```python\n#!/usr/bin/env python3\n# -*- coding: utf-8 -*-\n# Ground-truth 2D engineering drawing for part: 0074_00749706\n# Self-contained: reproduces the three-view DXF via ezdxf, NO FreeCAD needed.\n# Coordinates are A4 page millimetres (scale=0.6428989547038615, page=[297.0, 210.0]).\n# visible edges -> solid (layer OUTLINE); hidden edges -> dashed (layer HIDDEN)\n# dimensions -> real movable DIMENSION entities (text = true mm value)\n# Run: python 0074_00749706_gt.py [out.dxf]\nimport sys\nimport ezdxf\n\nSCALE = 0.6428989547038615\nPAGE = [297.0, 210.0]\n\nVISIBLE_SEGMENTS = [\n (72.377552, 109.832552, 74.386611, 109.832552),\n (74.386611, 109.832552, 76.395671, 109.832552),\n (76.395671, 109.832552, 78.40473, 109.832552),\n (78.40473, 109.832552, 80.413789, 109.832552),\n (80.413789, 109.832552, 82.422848, 109.832552),\n (82.422848, 109.832552, 84.431908, 109.832552),\n (84.431908, 109.832552, 86.440967, 109.832552),\n (86.440967, 109.832552, 88.450026, 109.832552),\n (88.450026, 109.832552, 90.459085, 109.832552),\n (90.459085, 109.832552, 92.468145, 109.832552),\n (92.468145, 109.832552, 94.477204, 109.832552),\n (94.477204, 109.832552, 96.486263, 109.832552),\n (96.486263, 109.832552, 98.495322, 109.832552),\n (98.495322, 109.832552, 100.504382, 109.832552),\n (100.504382, 109.832552, 102.513441, 109.832552),\n (102.513441, 109.832552, 104.5225, 109.832552),\n (104.5225, 109.832552, 106.531559, 109.832552),\n (106.531559, 109.832552, 108.540618, 109.832552),\n (108.540618, 109.832552, 110.549678, 109.832552),\n (110.549678, 109.832552, 112.558737, 109.832552),\n (112.558737, 109.832552, 114.567796, 109.832552),\n (114.567796, 109.832552, 116.576855, 109.832552),\n (116.576855, 109.832552, 118.585915, 109.832552),\n (118.585915, 109.832552, 120.594974, 109.832552),\n (120.594974, 109.832552, 122.604033, 109.832552),\n (122.604033, 109.832552, 124.613092, 109.832552),\n (124.613092, 109.832552, 126.622152, 109.832552),\n (126.622152, 109.832552, 128.631211, 109.832552),\n (128.631211, 109.832552, 130.64027, 109.832552),\n (130.64027, 109.832552, 132.649329, 109.832552),\n (132.649329, 109.832552, 134.658389, 109.832552),\n (134.658389, 109.832552, 136.667448, 109.832552),\n (136.667448, 109.832552, 136.667448, 78.022448),\n (72.377552, 78.022448, 74.386611, 78.022448),\n (74.386611, 78.022448, 76.395671, 78.022448),\n (76.395671, 78.022448, 78.40473, 78.022448),\n (78.40473, 78.022448, 80.413789, 78.022448),\n (80.413789, 78.022448, 82.422848, 78.022448),\n (82.422848, 78.022448, 84.431908, 78.022448),\n (84.431908, 78.022448, 86.440967, 78.022448),\n (86.440967, 78.022448, 88.450026, 78.022448),\n (88.450026, 78.022448, 90.459085, 78.022448),\n (90.459085, 78.022448, 92.468145, 78.022448),\n (92.468145, 78.022448, 94.477204, 78.022448),\n (94.477204, 78.022448, 96.486263, 78.022448),\n (96.486263, 78.022448, 98.495322, 78.022448),\n (98.495322, 78.022448, 100.504382, 78.022448),\n (100.504382, 78.022448, 102.513441, 78.022448),\n (102.513441, 78.022448, 104.5225, 78.022448),\n (104.5225, 78.022448, 106.531559, 78.022448),\n (106.531559, 78.022448, 108.540618, 78.022448),\n (108.540618, 78.022448, 110.549678, 78.022448),\n (110.549678, 78.022448, 112.558737, 78.022448),\n (112.558737, 78.022448, 114.567796, 78.022448),\n (114.567796, 78.022448, 116.576855, 78.022448),\n (116.576855, 78.022448, 118.585915, 78.022448),\n (118.585915, 78.022448, 120.594974, 78.022448),\n (120.594974, 78.022448, 122.604033, 78.022448),\n (122.604033, 78.022448, 124.613092, 78.022448),\n (124.613092, 78.022448, 126.622152, 78.022448),\n (126.622152, 78.022448, 128.631211, 78.022448),\n (128.631211, 78.022448, 130.64027, 78.022448),\n (130.64027, 78.022448, 132.649329, 78.022448),\n (132.649329, 78.022448, 134.658389, 78.022448),\n (134.658389, 78.022448, 136.667448, 78.022448),\n (72.377552, 78.022448, 72.377552, 109.832552),\n (182.477552, 188.122448, 182.477552, 186.113389),\n (182.477552, 186.113389, 182.477552, 184.104329),\n (182.477552, 184.104329, 182.477552, 182.09527),\n (182.477552, 182.09527, 182.477552, 180.086211),\n (182.477552, 180.086211, 182.477552, 178.077152),\n (182.477552, 178.077152, 182.477552, 176.068092),\n (182.477552, 176.068092, 182.477552, 174.059033),\n (182.477552, 174.059033, 182.477552, 172.049974),\n (182.477552, 172.049974, 182.477552, 170.040915),\n (182.477552, 170.040915, 182.477552, 168.031855),\n (182.477552, 168.031855, 182.477552, 166.022796),\n (182.477552, 166.022796, 182.477552, 164.013737),\n (182.477552, 164.013737, 182.477552, 162.004678),\n (182.477552, 162.004678, 182.477552, 159.995618),\n (182.477552, 159.995618, 182.477552, 157.986559),\n (182.477552, 157.986559, 182.477552, 155.9775),\n (182.477552, 155.9775, 182.477552, 153.968441),\n (182.477552, 153.968441, 182.477552, 151.959382),\n (182.477552, 151.959382, 182.477552, 149.950322),\n (182.477552, 149.950322, 182.477552, 147.941263),\n (182.477552, 147.941263, 182.477552, 145.932204),\n (182.477552, 145.932204, 182.477552, 143.923145),\n (182.477552, 143.923145, 182.477552, 141.914085),\n (182.477552, 141.914085, 182.477552, 139.905026),\n (182.477552, 139.905026, 182.477552, 137.895967),\n (182.477552, 137.895967, 182.477552, 135.886908),\n (182.477552, 135.886908, 182.477552, 133.877848),\n (182.477552, 133.877848, 182.477552, 131.868789),\n (182.477552, 131.868789, 182.477552, 129.85973),\n (182.477552, 129.85973, 182.477552, 127.850671),\n (182.477552, 127.850671, 182.477552, 125.841611),\n (182.477552, 125.841611, 182.477552, 123.832552),\n (150.667448, 188.122448, 150.667448, 186.113389),\n (150.667448, 186.113389, 150.667448, 184.104329),\n (150.667448, 184.104329, 150.667448, 182.09527),\n (150.667448, 182.09527, 150.667448, 180.086211),\n (150.667448, 180.086211, 150.667448, 178.077152),\n (150.667448, 178.077152, 150.667448, 176.068092),\n (150.667448, 176.068092, 150.667448, 174.059033),\n (150.667448, 174.059033, 150.667448, 172.049974),\n (150.667448, 172.049974, 150.667448, 170.040915),\n (150.667448, 170.040915, 150.667448, 168.031855),\n (150.667448, 168.031855, 150.667448, 166.022796),\n (150.667448, 166.022796, 150.667448, 164.013737),\n (150.667448, 164.013737, 150.667448, 162.004678),\n (150.667448, 162.004678, 150.667448, 159.995618),\n (150.667448, 159.995618, 150.667448, 157.986559),\n (150.667448, 157.986559, 150.667448, 155.9775),\n (150.667448, 155.9775, 150.667448, 153.968441),\n (150.667448, 153.968441, 150.667448, 151.959382),\n (150.667448, 151.959382, 150.667448, 149.950322),\n (150.667448, 149.950322, 150.667448, 147.941263),\n (150.667448, 147.941263, 150.667448, 145.932204),\n (150.667448, 145.932204, 150.667448, 143.923145),\n (150.667448, 143.923145, 150.667448, 141.914085),\n (150.667448, 141.914085, 150.667448, 139.905026),\n (150.667448, 139.905026, 150.667448, 137.895967),\n (150.667448, 137.895967, 150.667448, 135.886908),\n (150.667448, 135.886908, 150.667448, 133.877848),\n (150.667448, 133.877848, 150.667448, 131.868789),\n (150.667448, 131.868789, 150.667448, 129.85973),\n (150.667448, 129.85973, 150.667448, 127.850671),\n (150.667448, 127.850671, 150.667448, 125.841611),\n (150.667448, 125.841611, 150.667448, 123.832552),\n (150.667448, 188.122448, 182.477552, 188.122448),\n (150.667448, 123.832552, 182.477552, 123.832552)\n]\nVISIBLE_CIRCLES = [\n (104.5225, 155.9775, 32.144948)\n]\nVISIBLE_ARCS = [\n\n]\nHIDDEN_SEGMENTS = [\n\n]\n# (orient, text, p1, p2, base) for linear; (orient, text, center, radius, angle) for diameter\nDIMENSIONS = [\n ('diameter', '%%c100', (104.5225, 155.9775), 32.1449, 45),\n ('horizontal', '49.4792', (182.4775, 155.9775), (150.6674, 155.9775), (166.5725, 144.9775))\n]\n\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\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\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,\n angle=(0 if d[0] == \"horizontal\" else 90),\n 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,\n text=text, dimstyle=\"EZDXF\").render()\n\n doc.saveas(out_path)\n\n\nif __name__ == \"__main__\":\n out = sys.argv[1] if len(sys.argv) > 1 else \"0074_00749706_gt.dxf\"\n draw(out)\n print(\"wrote\", out)\n```"}], "images": ["images/0074_00749706.png"], "id": "0074_00749706"} {"messages": [{"role": "user", "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": "assistant", "content": "```python\n#!/usr/bin/env python3\n# -*- coding: utf-8 -*-\n# Ground-truth 2D engineering drawing for part: 0076_00761670\n# Self-contained: reproduces the three-view DXF via ezdxf, NO FreeCAD needed.\n# Coordinates are A4 page millimetres (scale=0.07464077669902913, page=[297.0, 210.0]).\n# visible edges -> solid (layer OUTLINE); hidden edges -> dashed (layer HIDDEN)\n# dimensions -> real movable DIMENSION entities (text = true mm value)\n# Run: python 0076_00761670_gt.py [out.dxf]\nimport sys\nimport ezdxf\n\nSCALE = 0.07464077669902913\nPAGE = [297.0, 210.0]\n\nVISIBLE_SEGMENTS = [\n (94.048039, 63.816039, 94.048039, 152.451961),\n (86.583961, 152.451961, 86.817214, 152.451961),\n (86.817214, 152.451961, 87.050466, 152.451961),\n (87.050466, 152.451961, 87.283718, 152.451961),\n (87.283718, 152.451961, 87.516971, 152.451961),\n (87.516971, 152.451961, 87.750223, 152.451961),\n (87.750223, 152.451961, 87.983476, 152.451961),\n (87.983476, 152.451961, 88.216728, 152.451961),\n (88.216728, 152.451961, 88.449981, 152.451961),\n (88.449981, 152.451961, 88.683233, 152.451961),\n (88.683233, 152.451961, 88.916485, 152.451961),\n (88.916485, 152.451961, 89.149738, 152.451961),\n (89.149738, 152.451961, 89.38299, 152.451961),\n (89.38299, 152.451961, 89.616243, 152.451961),\n (89.616243, 152.451961, 89.849495, 152.451961),\n (89.849495, 152.451961, 90.082748, 152.451961),\n (90.082748, 152.451961, 90.316, 152.451961),\n (90.316, 152.451961, 90.549252, 152.451961),\n (90.549252, 152.451961, 90.782505, 152.451961),\n (90.782505, 152.451961, 91.015757, 152.451961),\n (91.015757, 152.451961, 91.24901, 152.451961),\n (91.24901, 152.451961, 91.482262, 152.451961),\n (91.482262, 152.451961, 91.715515, 152.451961),\n (91.715515, 152.451961, 91.948767, 152.451961),\n (91.948767, 152.451961, 92.182019, 152.451961),\n (92.182019, 152.451961, 92.415272, 152.451961),\n (92.415272, 152.451961, 92.648524, 152.451961),\n (92.648524, 152.451961, 92.881777, 152.451961),\n (92.881777, 152.451961, 93.115029, 152.451961),\n (93.115029, 152.451961, 93.348282, 152.451961),\n (93.348282, 152.451961, 93.581534, 152.451961),\n (93.581534, 152.451961, 93.814786, 152.451961),\n (93.814786, 152.451961, 94.048039, 152.451961),\n (86.583961, 63.816039, 86.817214, 63.816039),\n (86.817214, 63.816039, 87.050466, 63.816039),\n (87.050466, 63.816039, 87.283718, 63.816039),\n (87.283718, 63.816039, 87.516971, 63.816039),\n (87.516971, 63.816039, 87.750223, 63.816039),\n (87.750223, 63.816039, 87.983476, 63.816039),\n (87.983476, 63.816039, 88.216728, 63.816039),\n (88.216728, 63.816039, 88.449981, 63.816039),\n (88.449981, 63.816039, 88.683233, 63.816039),\n (88.683233, 63.816039, 88.916485, 63.816039),\n (88.916485, 63.816039, 89.149738, 63.816039),\n (89.149738, 63.816039, 89.38299, 63.816039),\n (89.38299, 63.816039, 89.616243, 63.816039),\n (89.616243, 63.816039, 89.849495, 63.816039),\n (89.849495, 63.816039, 90.082748, 63.816039),\n (90.082748, 63.816039, 90.316, 63.816039),\n (90.316, 63.816039, 90.549252, 63.816039),\n (90.549252, 63.816039, 90.782505, 63.816039),\n (90.782505, 63.816039, 91.015757, 63.816039),\n (91.015757, 63.816039, 91.24901, 63.816039),\n (91.24901, 63.816039, 91.482262, 63.816039),\n (91.482262, 63.816039, 91.715515, 63.816039),\n (91.715515, 63.816039, 91.948767, 63.816039),\n (91.948767, 63.816039, 92.182019, 63.816039),\n (92.182019, 63.816039, 92.415272, 63.816039),\n (92.415272, 63.816039, 92.648524, 63.816039),\n (92.648524, 63.816039, 92.881777, 63.816039),\n (92.881777, 63.816039, 93.115029, 63.816039),\n (93.115029, 63.816039, 93.348282, 63.816039),\n (93.348282, 63.816039, 93.581534, 63.816039),\n (93.581534, 63.816039, 93.814786, 63.816039),\n (93.814786, 63.816039, 94.048039, 63.816039),\n (86.583961, 152.451961, 86.583961, 63.816039),\n (196.683961, 173.916039, 196.683961, 173.682786),\n (196.683961, 173.682786, 196.683961, 173.449534),\n (196.683961, 173.449534, 196.683961, 173.216282),\n (196.683961, 173.216282, 196.683961, 172.983029),\n (196.683961, 172.983029, 196.683961, 172.749777),\n (196.683961, 172.749777, 196.683961, 172.516524),\n (196.683961, 172.516524, 196.683961, 172.283272),\n (196.683961, 172.283272, 196.683961, 172.050019),\n (196.683961, 172.050019, 196.683961, 171.816767),\n (196.683961, 171.816767, 196.683961, 171.583515),\n (196.683961, 171.583515, 196.683961, 171.350262),\n (196.683961, 171.350262, 196.683961, 171.11701),\n (196.683961, 171.11701, 196.683961, 170.883757),\n (196.683961, 170.883757, 196.683961, 170.650505),\n (196.683961, 170.650505, 196.683961, 170.417252),\n (196.683961, 170.417252, 196.683961, 170.184),\n (196.683961, 170.184, 196.683961, 169.950748),\n (196.683961, 169.950748, 196.683961, 169.717495),\n (196.683961, 169.717495, 196.683961, 169.484243),\n (196.683961, 169.484243, 196.683961, 169.25099),\n (196.683961, 169.25099, 196.683961, 169.017738),\n (196.683961, 169.017738, 196.683961, 168.784485),\n (196.683961, 168.784485, 196.683961, 168.551233),\n (196.683961, 168.551233, 196.683961, 168.317981),\n (196.683961, 168.317981, 196.683961, 168.084728),\n (196.683961, 168.084728, 196.683961, 167.851476),\n (196.683961, 167.851476, 196.683961, 167.618223),\n (196.683961, 167.618223, 196.683961, 167.384971),\n (196.683961, 167.384971, 196.683961, 167.151718),\n (196.683961, 167.151718, 196.683961, 166.918466),\n (196.683961, 166.918466, 196.683961, 166.685214),\n (196.683961, 166.685214, 196.683961, 166.451961),\n (108.048039, 173.916039, 108.048039, 173.682786),\n (108.048039, 173.682786, 108.048039, 173.449534),\n (108.048039, 173.449534, 108.048039, 173.216282),\n (108.048039, 173.216282, 108.048039, 172.983029),\n (108.048039, 172.983029, 108.048039, 172.749777),\n (108.048039, 172.749777, 108.048039, 172.516524),\n (108.048039, 172.516524, 108.048039, 172.283272),\n (108.048039, 172.283272, 108.048039, 172.050019),\n (108.048039, 172.050019, 108.048039, 171.816767),\n (108.048039, 171.816767, 108.048039, 171.583515),\n (108.048039, 171.583515, 108.048039, 171.350262),\n (108.048039, 171.350262, 108.048039, 171.11701),\n (108.048039, 171.11701, 108.048039, 170.883757),\n (108.048039, 170.883757, 108.048039, 170.650505),\n (108.048039, 170.650505, 108.048039, 170.417252),\n (108.048039, 170.417252, 108.048039, 170.184),\n (108.048039, 170.184, 108.048039, 169.950748),\n (108.048039, 169.950748, 108.048039, 169.717495),\n (108.048039, 169.717495, 108.048039, 169.484243),\n (108.048039, 169.484243, 108.048039, 169.25099),\n (108.048039, 169.25099, 108.048039, 169.017738),\n (108.048039, 169.017738, 108.048039, 168.784485),\n (108.048039, 168.784485, 108.048039, 168.551233),\n (108.048039, 168.551233, 108.048039, 168.317981),\n (108.048039, 168.317981, 108.048039, 168.084728),\n (108.048039, 168.084728, 108.048039, 167.851476),\n (108.048039, 167.851476, 108.048039, 167.618223),\n (108.048039, 167.618223, 108.048039, 167.384971),\n (108.048039, 167.384971, 108.048039, 167.151718),\n (108.048039, 167.151718, 108.048039, 166.918466),\n (108.048039, 166.918466, 108.048039, 166.685214),\n (108.048039, 166.685214, 108.048039, 166.451961),\n (196.683961, 166.451961, 108.048039, 166.451961),\n (196.683961, 173.916039, 108.048039, 173.916039)\n]\nVISIBLE_CIRCLES = [\n (90.316, 170.184, 3.732039)\n]\nVISIBLE_ARCS = [\n\n]\nHIDDEN_SEGMENTS = [\n\n]\n# (orient, text, p1, p2, base) for linear; (orient, text, center, radius, angle) for diameter\nDIMENSIONS = [\n ('diameter', '%%c100', (90.316, 170.184), 3.732, 45),\n ('horizontal', '1187.5', (108.0481, 170.184), (196.684, 170.184), (152.366, 181.184))\n]\n\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\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\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,\n angle=(0 if d[0] == \"horizontal\" else 90),\n 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,\n text=text, dimstyle=\"EZDXF\").render()\n\n doc.saveas(out_path)\n\n\nif __name__ == \"__main__\":\n out = sys.argv[1] if len(sys.argv) > 1 else \"0076_00761670_gt.dxf\"\n draw(out)\n print(\"wrote\", out)\n```"}], "images": ["images/0076_00761670.png"], "id": "0076_00761670"} {"messages": [{"role": "user", "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": "assistant", "content": "```python\n#!/usr/bin/env python3\n# -*- coding: utf-8 -*-\n# Ground-truth 2D engineering drawing for part: 0076_00763285\n# Self-contained: reproduces the three-view DXF via ezdxf, NO FreeCAD needed.\n# Coordinates are A4 page millimetres (scale=0.10777570093458749, page=[297.0, 210.0]).\n# visible edges -> solid (layer OUTLINE); hidden edges -> dashed (layer HIDDEN)\n# dimensions -> real movable DIMENSION entities (text = true mm value)\n# Run: python 0076_00763285_gt.py [out.dxf]\nimport sys\nimport ezdxf\n\nSCALE = 0.10777570093458749\nPAGE = [297.0, 210.0]\n\nVISIBLE_SEGMENTS = [\n (96.533185, 149.966815, 96.533185, 64.644385),\n (96.533185, 64.644385, 96.196386, 64.644385),\n (96.196386, 64.644385, 95.859587, 64.644385),\n (95.859587, 64.644385, 95.522788, 64.644385),\n (95.522788, 64.644385, 95.185989, 64.644385),\n (95.185989, 64.644385, 94.84919, 64.644385),\n (94.84919, 64.644385, 94.512391, 64.644385),\n (94.512391, 64.644385, 94.175592, 64.644385),\n (94.175592, 64.644385, 93.838793, 64.644385),\n (93.838793, 64.644385, 93.501993, 64.644385),\n (93.501993, 64.644385, 93.165194, 64.644385),\n (93.165194, 64.644385, 92.828395, 64.644385),\n (92.828395, 64.644385, 92.491596, 64.644385),\n (92.491596, 64.644385, 92.154797, 64.644385),\n (92.154797, 64.644385, 91.817998, 64.644385),\n (91.817998, 64.644385, 91.481199, 64.644385),\n (91.481199, 64.644385, 91.1444, 64.644385),\n (91.1444, 64.644385, 90.807601, 64.644385),\n (90.807601, 64.644385, 90.470802, 64.644385),\n (90.470802, 64.644385, 90.134003, 64.644385),\n (90.134003, 64.644385, 89.797204, 64.644385),\n (89.797204, 64.644385, 89.460405, 64.644385),\n (89.460405, 64.644385, 89.123606, 64.644385),\n (89.123606, 64.644385, 88.786807, 64.644385),\n (88.786807, 64.644385, 88.450007, 64.644385),\n (88.450007, 64.644385, 88.113208, 64.644385),\n (88.113208, 64.644385, 87.776409, 64.644385),\n (87.776409, 64.644385, 87.43961, 64.644385),\n (87.43961, 64.644385, 87.102811, 64.644385),\n (87.102811, 64.644385, 86.766012, 64.644385),\n (86.766012, 64.644385, 86.429213, 64.644385),\n (86.429213, 64.644385, 86.092414, 64.644385),\n (86.092414, 64.644385, 85.755615, 64.644385),\n (96.533185, 149.966815, 96.196386, 149.966815),\n (96.196386, 149.966815, 95.859587, 149.966815),\n (95.859587, 149.966815, 95.522788, 149.966815),\n (95.522788, 149.966815, 95.185989, 149.966815),\n (95.185989, 149.966815, 94.84919, 149.966815),\n (94.84919, 149.966815, 94.512391, 149.966815),\n (94.512391, 149.966815, 94.175592, 149.966815),\n (94.175592, 149.966815, 93.838793, 149.966815),\n (93.838793, 149.966815, 93.501993, 149.966815),\n (93.501993, 149.966815, 93.165194, 149.966815),\n (93.165194, 149.966815, 92.828395, 149.966815),\n (92.828395, 149.966815, 92.491596, 149.966815),\n (92.491596, 149.966815, 92.154797, 149.966815),\n (92.154797, 149.966815, 91.817998, 149.966815),\n (91.817998, 149.966815, 91.481199, 149.966815),\n (91.481199, 149.966815, 91.1444, 149.966815),\n (91.1444, 149.966815, 90.807601, 149.966815),\n (90.807601, 149.966815, 90.470802, 149.966815),\n (90.470802, 149.966815, 90.134003, 149.966815),\n (90.134003, 149.966815, 89.797204, 149.966815),\n (89.797204, 149.966815, 89.460405, 149.966815),\n (89.460405, 149.966815, 89.123606, 149.966815),\n (89.123606, 149.966815, 88.786807, 149.966815),\n (88.786807, 149.966815, 88.450007, 149.966815),\n (88.450007, 149.966815, 88.113208, 149.966815),\n (88.113208, 149.966815, 87.776409, 149.966815),\n (87.776409, 149.966815, 87.43961, 149.966815),\n (87.43961, 149.966815, 87.102811, 149.966815),\n (87.102811, 149.966815, 86.766012, 149.966815),\n (86.766012, 149.966815, 86.429213, 149.966815),\n (86.429213, 149.966815, 86.092414, 149.966815),\n (86.092414, 149.966815, 85.755615, 149.966815),\n (85.755615, 64.644385, 85.755615, 149.966815),\n (110.533185, 163.966815, 110.533185, 164.303614),\n (110.533185, 164.303614, 110.533185, 164.640413),\n (110.533185, 164.640413, 110.533185, 164.977212),\n (110.533185, 164.977212, 110.533185, 165.314011),\n (110.533185, 165.314011, 110.533185, 165.65081),\n (110.533185, 165.65081, 110.533185, 165.987609),\n (110.533185, 165.987609, 110.533185, 166.324408),\n (110.533185, 166.324408, 110.533185, 166.661207),\n (110.533185, 166.661207, 110.533185, 166.998007),\n (110.533185, 166.998007, 110.533185, 167.334806),\n (110.533185, 167.334806, 110.533185, 167.671605),\n (110.533185, 167.671605, 110.533185, 168.008404),\n (110.533185, 168.008404, 110.533185, 168.345203),\n (110.533185, 168.345203, 110.533185, 168.682002),\n (110.533185, 168.682002, 110.533185, 169.018801),\n (110.533185, 169.018801, 110.533185, 169.3556),\n (110.533185, 169.3556, 110.533185, 169.692399),\n (110.533185, 169.692399, 110.533185, 170.029198),\n (110.533185, 170.029198, 110.533185, 170.365997),\n (110.533185, 170.365997, 110.533185, 170.702796),\n (110.533185, 170.702796, 110.533185, 171.039595),\n (110.533185, 171.039595, 110.533185, 171.376394),\n (110.533185, 171.376394, 110.533185, 171.713193),\n (110.533185, 171.713193, 110.533185, 172.049993),\n (110.533185, 172.049993, 110.533185, 172.386792),\n (110.533185, 172.386792, 110.533185, 172.723591),\n (110.533185, 172.723591, 110.533185, 173.06039),\n (110.533185, 173.06039, 110.533185, 173.397189),\n (110.533185, 173.397189, 110.533185, 173.733988),\n (110.533185, 173.733988, 110.533185, 174.070787),\n (110.533185, 174.070787, 110.533185, 174.407586),\n (110.533185, 174.407586, 110.533185, 174.744385),\n (195.855615, 163.966815, 195.855615, 164.303614),\n (195.855615, 164.303614, 195.855615, 164.640413),\n (195.855615, 164.640413, 195.855615, 164.977212),\n (195.855615, 164.977212, 195.855615, 165.314011),\n (195.855615, 165.314011, 195.855615, 165.65081),\n (195.855615, 165.65081, 195.855615, 165.987609),\n (195.855615, 165.987609, 195.855615, 166.324408),\n (195.855615, 166.324408, 195.855615, 166.661207),\n (195.855615, 166.661207, 195.855615, 166.998007),\n (195.855615, 166.998007, 195.855615, 167.334806),\n (195.855615, 167.334806, 195.855615, 167.671605),\n (195.855615, 167.671605, 195.855615, 168.008404),\n (195.855615, 168.008404, 195.855615, 168.345203),\n (195.855615, 168.345203, 195.855615, 168.682002),\n (195.855615, 168.682002, 195.855615, 169.018801),\n (195.855615, 169.018801, 195.855615, 169.3556),\n (195.855615, 169.3556, 195.855615, 169.692399),\n (195.855615, 169.692399, 195.855615, 170.029198),\n (195.855615, 170.029198, 195.855615, 170.365997),\n (195.855615, 170.365997, 195.855615, 170.702796),\n (195.855615, 170.702796, 195.855615, 171.039595),\n (195.855615, 171.039595, 195.855615, 171.376394),\n (195.855615, 171.376394, 195.855615, 171.713193),\n (195.855615, 171.713193, 195.855615, 172.049993),\n (195.855615, 172.049993, 195.855615, 172.386792),\n (195.855615, 172.386792, 195.855615, 172.723591),\n (195.855615, 172.723591, 195.855615, 173.06039),\n (195.855615, 173.06039, 195.855615, 173.397189),\n (195.855615, 173.397189, 195.855615, 173.733988),\n (195.855615, 173.733988, 195.855615, 174.070787),\n (195.855615, 174.070787, 195.855615, 174.407586),\n (195.855615, 174.407586, 195.855615, 174.744385),\n (110.533185, 174.744385, 195.855615, 174.744385),\n (110.533185, 163.966815, 195.855615, 163.966815)\n]\nVISIBLE_CIRCLES = [\n (91.1444, 169.3556, 5.388785)\n]\nVISIBLE_ARCS = [\n\n]\nHIDDEN_SEGMENTS = [\n\n]\n# (orient, text, p1, p2, base) for linear; (orient, text, center, radius, angle) for diameter\nDIMENSIONS = [\n ('diameter', '%%c100', (91.1444, 169.3556), 5.3888, 45),\n ('horizontal', '791.667', (195.8556, 169.3556), (110.5332, 169.3556), (153.1944, 158.3556))\n]\n\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\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\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,\n angle=(0 if d[0] == \"horizontal\" else 90),\n 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,\n text=text, dimstyle=\"EZDXF\").render()\n\n doc.saveas(out_path)\n\n\nif __name__ == \"__main__\":\n out = sys.argv[1] if len(sys.argv) > 1 else \"0076_00763285_gt.dxf\"\n draw(out)\n print(\"wrote\", out)\n```"}], "images": ["images/0076_00763285.png"], "id": "0076_00763285"} {"messages": [{"role": "user", "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 6.84 mm."}, {"role": "assistant", "content": "```python\n#!/usr/bin/env python3\n# -*- coding: utf-8 -*-\n# Ground-truth 2D engineering drawing for part: 0076_00765633\n# Self-contained: reproduces the three-view DXF via ezdxf, NO FreeCAD needed.\n# Coordinates are A4 page millimetres (scale=0.7347, page=[297.0, 210.0]).\n# visible edges -> solid (layer OUTLINE); hidden edges -> dashed (layer HIDDEN)\n# dimensions -> real movable DIMENSION entities (text = true mm value)\n# Run: python 0076_00765633_gt.py [out.dxf]\nimport sys\nimport ezdxf\n\nSCALE = 0.7347\nPAGE = [297.0, 210.0]\n\nVISIBLE_SEGMENTS = [\n (78.8838, 94.1462, 81.179737, 94.1462),\n (81.179737, 94.1462, 83.475675, 94.1462),\n (83.475675, 94.1462, 85.771612, 94.1462),\n (85.771612, 94.1462, 88.06755, 94.1462),\n (88.06755, 94.1462, 90.363487, 94.1462),\n (90.363487, 94.1462, 92.659425, 94.1462),\n (92.659425, 94.1462, 94.955362, 94.1462),\n (94.955362, 94.1462, 97.2513, 94.1462),\n (97.2513, 94.1462, 99.547238, 94.1462),\n (99.547238, 94.1462, 101.843175, 94.1462),\n (101.843175, 94.1462, 104.139113, 94.1462),\n (104.139113, 94.1462, 106.43505, 94.1462),\n (106.43505, 94.1462, 108.730988, 94.1462),\n (108.730988, 94.1462, 111.026925, 94.1462),\n (111.026925, 94.1462, 113.322863, 94.1462),\n (113.322863, 94.1462, 115.6188, 94.1462),\n (115.6188, 94.1462, 117.914737, 94.1462),\n (117.914737, 94.1462, 120.210675, 94.1462),\n (120.210675, 94.1462, 122.506612, 94.1462),\n (122.506612, 94.1462, 124.80255, 94.1462),\n (124.80255, 94.1462, 127.098488, 94.1462),\n (127.098488, 94.1462, 129.394425, 94.1462),\n (129.394425, 94.1462, 131.690363, 94.1462),\n (131.690363, 94.1462, 133.9863, 94.1462),\n (133.9863, 94.1462, 136.282238, 94.1462),\n (136.282238, 94.1462, 138.578175, 94.1462),\n (138.578175, 94.1462, 140.874113, 94.1462),\n (140.874113, 94.1462, 143.17005, 94.1462),\n (143.17005, 94.1462, 145.465988, 94.1462),\n (145.465988, 94.1462, 147.761925, 94.1462),\n (147.761925, 94.1462, 150.057863, 94.1462),\n (150.057863, 94.1462, 152.3538, 94.1462),\n (152.3538, 94.1462, 152.3538, 89.118748),\n (78.8838, 89.118748, 81.179737, 89.118748),\n (81.179737, 89.118748, 83.475675, 89.118748),\n (83.475675, 89.118748, 85.771612, 89.118748),\n (85.771612, 89.118748, 88.06755, 89.118748),\n (88.06755, 89.118748, 90.363487, 89.118748),\n (90.363487, 89.118748, 92.659425, 89.118748),\n (92.659425, 89.118748, 94.955362, 89.118748),\n (94.955362, 89.118748, 97.2513, 89.118748),\n (97.2513, 89.118748, 99.547238, 89.118748),\n (99.547238, 89.118748, 101.843175, 89.118748),\n (101.843175, 89.118748, 104.139113, 89.118748),\n (104.139113, 89.118748, 106.43505, 89.118748),\n (106.43505, 89.118748, 108.730988, 89.118748),\n (108.730988, 89.118748, 111.026925, 89.118748),\n (111.026925, 89.118748, 113.322863, 89.118748),\n (113.322863, 89.118748, 115.6188, 89.118748),\n (115.6188, 89.118748, 117.914737, 89.118748),\n (117.914737, 89.118748, 120.210675, 89.118748),\n (120.210675, 89.118748, 122.506612, 89.118748),\n (122.506612, 89.118748, 124.80255, 89.118748),\n (124.80255, 89.118748, 127.098488, 89.118748),\n (127.098488, 89.118748, 129.394425, 89.118748),\n (129.394425, 89.118748, 131.690363, 89.118748),\n (131.690363, 89.118748, 133.9863, 89.118748),\n (133.9863, 89.118748, 136.282238, 89.118748),\n (136.282238, 89.118748, 138.578175, 89.118748),\n (138.578175, 89.118748, 140.874113, 89.118748),\n (140.874113, 89.118748, 143.17005, 89.118748),\n (143.17005, 89.118748, 145.465988, 89.118748),\n (145.465988, 89.118748, 147.761925, 89.118748),\n (147.761925, 89.118748, 150.057863, 89.118748),\n (150.057863, 89.118748, 152.3538, 89.118748),\n (78.8838, 89.118748, 78.8838, 94.1462),\n (171.381252, 181.6162, 171.381252, 179.320263),\n (171.381252, 179.320263, 171.381252, 177.024325),\n (171.381252, 177.024325, 171.381252, 174.728388),\n (171.381252, 174.728388, 171.381252, 172.43245),\n (171.381252, 172.43245, 171.381252, 170.136513),\n (171.381252, 170.136513, 171.381252, 167.840575),\n (171.381252, 167.840575, 171.381252, 165.544638),\n (171.381252, 165.544638, 171.381252, 163.2487),\n (171.381252, 163.2487, 171.381252, 160.952763),\n (171.381252, 160.952763, 171.381252, 158.656825),\n (171.381252, 158.656825, 171.381252, 156.360888),\n (171.381252, 156.360888, 171.381252, 154.06495),\n (171.381252, 154.06495, 171.381252, 151.769013),\n (171.381252, 151.769013, 171.381252, 149.473075),\n (171.381252, 149.473075, 171.381252, 147.177138),\n (171.381252, 147.177138, 171.381252, 144.8812),\n (171.381252, 144.8812, 171.381252, 142.585262),\n (171.381252, 142.585262, 171.381252, 140.289325),\n (171.381252, 140.289325, 171.381252, 137.993388),\n (171.381252, 137.993388, 171.381252, 135.69745),\n (171.381252, 135.69745, 171.381252, 133.401513),\n (171.381252, 133.401513, 171.381252, 131.105575),\n (171.381252, 131.105575, 171.381252, 128.809638),\n (171.381252, 128.809638, 171.381252, 126.5137),\n (171.381252, 126.5137, 171.381252, 124.217763),\n (171.381252, 124.217763, 171.381252, 121.921825),\n (171.381252, 121.921825, 171.381252, 119.625888),\n (171.381252, 119.625888, 171.381252, 117.32995),\n (171.381252, 117.32995, 171.381252, 115.034013),\n (171.381252, 115.034013, 171.381252, 112.738075),\n (171.381252, 112.738075, 171.381252, 110.442138),\n (171.381252, 110.442138, 171.381252, 108.1462),\n (166.3538, 181.6162, 166.3538, 179.320263),\n (166.3538, 179.320263, 166.3538, 177.024325),\n (166.3538, 177.024325, 166.3538, 174.728388),\n (166.3538, 174.728388, 166.3538, 172.43245),\n (166.3538, 172.43245, 166.3538, 170.136513),\n (166.3538, 170.136513, 166.3538, 167.840575),\n (166.3538, 167.840575, 166.3538, 165.544638),\n (166.3538, 165.544638, 166.3538, 163.2487),\n (166.3538, 163.2487, 166.3538, 160.952763),\n (166.3538, 160.952763, 166.3538, 158.656825),\n (166.3538, 158.656825, 166.3538, 156.360888),\n (166.3538, 156.360888, 166.3538, 154.06495),\n (166.3538, 154.06495, 166.3538, 151.769013),\n (166.3538, 151.769013, 166.3538, 149.473075),\n (166.3538, 149.473075, 166.3538, 147.177138),\n (166.3538, 147.177138, 166.3538, 144.8812),\n (166.3538, 144.8812, 166.3538, 142.585262),\n (166.3538, 142.585262, 166.3538, 140.289325),\n (166.3538, 140.289325, 166.3538, 137.993388),\n (166.3538, 137.993388, 166.3538, 135.69745),\n (166.3538, 135.69745, 166.3538, 133.401513),\n (166.3538, 133.401513, 166.3538, 131.105575),\n (166.3538, 131.105575, 166.3538, 128.809638),\n (166.3538, 128.809638, 166.3538, 126.5137),\n (166.3538, 126.5137, 166.3538, 124.217763),\n (166.3538, 124.217763, 166.3538, 121.921825),\n (166.3538, 121.921825, 166.3538, 119.625888),\n (166.3538, 119.625888, 166.3538, 117.32995),\n (166.3538, 117.32995, 166.3538, 115.034013),\n (166.3538, 115.034013, 166.3538, 112.738075),\n (166.3538, 112.738075, 166.3538, 110.442138),\n (166.3538, 110.442138, 166.3538, 108.1462),\n (166.3538, 181.6162, 171.381252, 181.6162),\n (166.3538, 108.1462, 171.381252, 108.1462)\n]\nVISIBLE_CIRCLES = [\n (115.6188, 144.8812, 36.735)\n]\nVISIBLE_ARCS = [\n\n]\nHIDDEN_SEGMENTS = [\n\n]\n# (orient, text, p1, p2, base) for linear; (orient, text, center, radius, angle) for diameter\nDIMENSIONS = [\n ('diameter', '%%c100', (115.6188, 144.8812), 36.735, 45),\n ('horizontal', '6.8429', (171.3812, 144.8812), (166.3537, 144.8812), (168.8675, 133.8812))\n]\n\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\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\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,\n angle=(0 if d[0] == \"horizontal\" else 90),\n 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,\n text=text, dimstyle=\"EZDXF\").render()\n\n doc.saveas(out_path)\n\n\nif __name__ == \"__main__\":\n out = sys.argv[1] if len(sys.argv) > 1 else \"0076_00765633_gt.dxf\"\n draw(out)\n print(\"wrote\", out)\n```"}], "images": ["images/0076_00765633.png"], "id": "0076_00765633"} {"messages": [{"role": "user", "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": "assistant", "content": "```python\n#!/usr/bin/env python3\n# -*- coding: utf-8 -*-\n# Ground-truth 2D engineering drawing for part: 0077_00770502\n# Self-contained: reproduces the three-view DXF via ezdxf, NO FreeCAD needed.\n# Coordinates are A4 page millimetres (scale=0.6428989547038313, page=[297.0, 210.0]).\n# visible edges -> solid (layer OUTLINE); hidden edges -> dashed (layer HIDDEN)\n# dimensions -> real movable DIMENSION entities (text = true mm value)\n# Run: python 0077_00770502_gt.py [out.dxf]\nimport sys\nimport ezdxf\n\nSCALE = 0.6428989547038313\nPAGE = [297.0, 210.0]\n\nVISIBLE_SEGMENTS = [\n (136.667448, 78.022448, 134.658389, 78.022448),\n (134.658389, 78.022448, 132.649329, 78.022448),\n (132.649329, 78.022448, 130.64027, 78.022448),\n (130.64027, 78.022448, 128.631211, 78.022448),\n (128.631211, 78.022448, 126.622152, 78.022448),\n (126.622152, 78.022448, 124.613092, 78.022448),\n (124.613092, 78.022448, 122.604033, 78.022448),\n (122.604033, 78.022448, 120.594974, 78.022448),\n (120.594974, 78.022448, 118.585915, 78.022448),\n (118.585915, 78.022448, 116.576855, 78.022448),\n (116.576855, 78.022448, 114.567796, 78.022448),\n (114.567796, 78.022448, 112.558737, 78.022448),\n (112.558737, 78.022448, 110.549678, 78.022448),\n (110.549678, 78.022448, 108.540618, 78.022448),\n (108.540618, 78.022448, 106.531559, 78.022448),\n (106.531559, 78.022448, 104.5225, 78.022448),\n (104.5225, 78.022448, 102.513441, 78.022448),\n (102.513441, 78.022448, 100.504382, 78.022448),\n (100.504382, 78.022448, 98.495322, 78.022448),\n (98.495322, 78.022448, 96.486263, 78.022448),\n (96.486263, 78.022448, 94.477204, 78.022448),\n (94.477204, 78.022448, 92.468145, 78.022448),\n (92.468145, 78.022448, 90.459085, 78.022448),\n (90.459085, 78.022448, 88.450026, 78.022448),\n (88.450026, 78.022448, 86.440967, 78.022448),\n (86.440967, 78.022448, 84.431908, 78.022448),\n (84.431908, 78.022448, 82.422848, 78.022448),\n (82.422848, 78.022448, 80.413789, 78.022448),\n (80.413789, 78.022448, 78.40473, 78.022448),\n (78.40473, 78.022448, 76.395671, 78.022448),\n (76.395671, 78.022448, 74.386611, 78.022448),\n (74.386611, 78.022448, 72.377552, 78.022448),\n (136.667448, 78.022448, 136.667448, 109.832552),\n (136.667448, 109.832552, 134.658389, 109.832552),\n (134.658389, 109.832552, 132.649329, 109.832552),\n (132.649329, 109.832552, 130.64027, 109.832552),\n (130.64027, 109.832552, 128.631211, 109.832552),\n (128.631211, 109.832552, 126.622152, 109.832552),\n (126.622152, 109.832552, 124.613092, 109.832552),\n (124.613092, 109.832552, 122.604033, 109.832552),\n (122.604033, 109.832552, 120.594974, 109.832552),\n (120.594974, 109.832552, 118.585915, 109.832552),\n (118.585915, 109.832552, 116.576855, 109.832552),\n (116.576855, 109.832552, 114.567796, 109.832552),\n (114.567796, 109.832552, 112.558737, 109.832552),\n (112.558737, 109.832552, 110.549678, 109.832552),\n (110.549678, 109.832552, 108.540618, 109.832552),\n (108.540618, 109.832552, 106.531559, 109.832552),\n (106.531559, 109.832552, 104.5225, 109.832552),\n (104.5225, 109.832552, 102.513441, 109.832552),\n (102.513441, 109.832552, 100.504382, 109.832552),\n (100.504382, 109.832552, 98.495322, 109.832552),\n (98.495322, 109.832552, 96.486263, 109.832552),\n (96.486263, 109.832552, 94.477204, 109.832552),\n (94.477204, 109.832552, 92.468145, 109.832552),\n (92.468145, 109.832552, 90.459085, 109.832552),\n (90.459085, 109.832552, 88.450026, 109.832552),\n (88.450026, 109.832552, 86.440967, 109.832552),\n (86.440967, 109.832552, 84.431908, 109.832552),\n (84.431908, 109.832552, 82.422848, 109.832552),\n (82.422848, 109.832552, 80.413789, 109.832552),\n (80.413789, 109.832552, 78.40473, 109.832552),\n (78.40473, 109.832552, 76.395671, 109.832552),\n (76.395671, 109.832552, 74.386611, 109.832552),\n (74.386611, 109.832552, 72.377552, 109.832552),\n (72.377552, 109.832552, 72.377552, 78.022448),\n (150.667448, 123.832552, 150.667448, 125.841611),\n (150.667448, 125.841611, 150.667448, 127.850671),\n (150.667448, 127.850671, 150.667448, 129.85973),\n (150.667448, 129.85973, 150.667448, 131.868789),\n (150.667448, 131.868789, 150.667448, 133.877848),\n (150.667448, 133.877848, 150.667448, 135.886908),\n (150.667448, 135.886908, 150.667448, 137.895967),\n (150.667448, 137.895967, 150.667448, 139.905026),\n (150.667448, 139.905026, 150.667448, 141.914085),\n (150.667448, 141.914085, 150.667448, 143.923145),\n (150.667448, 143.923145, 150.667448, 145.932204),\n (150.667448, 145.932204, 150.667448, 147.941263),\n (150.667448, 147.941263, 150.667448, 149.950322),\n (150.667448, 149.950322, 150.667448, 151.959382),\n (150.667448, 151.959382, 150.667448, 153.968441),\n (150.667448, 153.968441, 150.667448, 155.9775),\n (150.667448, 155.9775, 150.667448, 157.986559),\n (150.667448, 157.986559, 150.667448, 159.995618),\n (150.667448, 159.995618, 150.667448, 162.004678),\n (150.667448, 162.004678, 150.667448, 164.013737),\n (150.667448, 164.013737, 150.667448, 166.022796),\n (150.667448, 166.022796, 150.667448, 168.031855),\n (150.667448, 168.031855, 150.667448, 170.040915),\n (150.667448, 170.040915, 150.667448, 172.049974),\n (150.667448, 172.049974, 150.667448, 174.059033),\n (150.667448, 174.059033, 150.667448, 176.068092),\n (150.667448, 176.068092, 150.667448, 178.077152),\n (150.667448, 178.077152, 150.667448, 180.086211),\n (150.667448, 180.086211, 150.667448, 182.09527),\n (150.667448, 182.09527, 150.667448, 184.104329),\n (150.667448, 184.104329, 150.667448, 186.113389),\n (150.667448, 186.113389, 150.667448, 188.122448),\n (182.477552, 123.832552, 182.477552, 125.841611),\n (182.477552, 125.841611, 182.477552, 127.850671),\n (182.477552, 127.850671, 182.477552, 129.85973),\n (182.477552, 129.85973, 182.477552, 131.868789),\n (182.477552, 131.868789, 182.477552, 133.877848),\n (182.477552, 133.877848, 182.477552, 135.886908),\n (182.477552, 135.886908, 182.477552, 137.895967),\n (182.477552, 137.895967, 182.477552, 139.905026),\n (182.477552, 139.905026, 182.477552, 141.914085),\n (182.477552, 141.914085, 182.477552, 143.923145),\n (182.477552, 143.923145, 182.477552, 145.932204),\n (182.477552, 145.932204, 182.477552, 147.941263),\n (182.477552, 147.941263, 182.477552, 149.950322),\n (182.477552, 149.950322, 182.477552, 151.959382),\n (182.477552, 151.959382, 182.477552, 153.968441),\n (182.477552, 153.968441, 182.477552, 155.9775),\n (182.477552, 155.9775, 182.477552, 157.986559),\n (182.477552, 157.986559, 182.477552, 159.995618),\n (182.477552, 159.995618, 182.477552, 162.004678),\n (182.477552, 162.004678, 182.477552, 164.013737),\n (182.477552, 164.013737, 182.477552, 166.022796),\n (182.477552, 166.022796, 182.477552, 168.031855),\n (182.477552, 168.031855, 182.477552, 170.040915),\n (182.477552, 170.040915, 182.477552, 172.049974),\n (182.477552, 172.049974, 182.477552, 174.059033),\n (182.477552, 174.059033, 182.477552, 176.068092),\n (182.477552, 176.068092, 182.477552, 178.077152),\n (182.477552, 178.077152, 182.477552, 180.086211),\n (182.477552, 180.086211, 182.477552, 182.09527),\n (182.477552, 182.09527, 182.477552, 184.104329),\n (182.477552, 184.104329, 182.477552, 186.113389),\n (182.477552, 186.113389, 182.477552, 188.122448),\n (182.477552, 123.832552, 150.667448, 123.832552),\n (182.477552, 188.122448, 150.667448, 188.122448)\n]\nVISIBLE_CIRCLES = [\n (104.5225, 155.9775, 32.144948)\n]\nVISIBLE_ARCS = [\n\n]\nHIDDEN_SEGMENTS = [\n\n]\n# (orient, text, p1, p2, base) for linear; (orient, text, center, radius, angle) for diameter\nDIMENSIONS = [\n ('diameter', '%%c100', (104.5225, 155.9775), 32.1449, 45),\n ('horizontal', '49.4792', (150.6674, 155.9775), (182.4775, 155.9775), (166.5725, 166.9775))\n]\n\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\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\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,\n angle=(0 if d[0] == \"horizontal\" else 90),\n 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,\n text=text, dimstyle=\"EZDXF\").render()\n\n doc.saveas(out_path)\n\n\nif __name__ == \"__main__\":\n out = sys.argv[1] if len(sys.argv) > 1 else \"0077_00770502_gt.dxf\"\n draw(out)\n print(\"wrote\", out)\n```"}], "images": ["images/0077_00770502.png"], "id": "0077_00770502"} {"messages": [{"role": "user", "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 39.69 mm."}, {"role": "assistant", "content": "```python\n#!/usr/bin/env python3\n# -*- coding: utf-8 -*-\n# Ground-truth 2D engineering drawing for part: 0077_00770647\n# Self-contained: reproduces the three-view DXF via ezdxf, NO FreeCAD needed.\n# Coordinates are A4 page millimetres (scale=0.6879695498504952, page=[297.0, 210.0]).\n# visible edges -> solid (layer OUTLINE); hidden edges -> dashed (layer HIDDEN)\n# dimensions -> real movable DIMENSION entities (text = true mm value)\n# Run: python 0077_00770647_gt.py [out.dxf]\nimport sys\nimport ezdxf\n\nSCALE = 0.6879695498504952\nPAGE = [297.0, 210.0]\n\nVISIBLE_SEGMENTS = [\n (71.250723, 106.452322, 73.400627, 106.452322),\n (73.400627, 106.452322, 75.550532, 106.452322),\n (75.550532, 106.452322, 77.700437, 106.452322),\n (77.700437, 106.452322, 79.850342, 106.452322),\n (79.850342, 106.452322, 82.000247, 106.452322),\n (82.000247, 106.452322, 84.150152, 106.452322),\n (84.150152, 106.452322, 86.300056, 106.452322),\n (86.300056, 106.452322, 88.449961, 106.452322),\n (88.449961, 106.452322, 90.599866, 106.452322),\n (90.599866, 106.452322, 92.749771, 106.452322),\n (92.749771, 106.452322, 94.899676, 106.452322),\n (94.899676, 106.452322, 97.049581, 106.452322),\n (97.049581, 106.452322, 99.199485, 106.452322),\n (99.199485, 106.452322, 101.34939, 106.452322),\n (101.34939, 106.452322, 103.499295, 106.452322),\n (103.499295, 106.452322, 105.6492, 106.452322),\n (105.6492, 106.452322, 107.799105, 106.452322),\n (107.799105, 106.452322, 109.94901, 106.452322),\n (109.94901, 106.452322, 112.098915, 106.452322),\n (112.098915, 106.452322, 114.248819, 106.452322),\n (114.248819, 106.452322, 116.398724, 106.452322),\n (116.398724, 106.452322, 118.548629, 106.452322),\n (118.548629, 106.452322, 120.698534, 106.452322),\n (120.698534, 106.452322, 122.848439, 106.452322),\n (122.848439, 106.452322, 124.998344, 106.452322),\n (124.998344, 106.452322, 127.148248, 106.452322),\n (127.148248, 106.452322, 129.298153, 106.452322),\n (129.298153, 106.452322, 131.448058, 106.452322),\n (131.448058, 106.452322, 133.597963, 106.452322),\n (133.597963, 106.452322, 135.747868, 106.452322),\n (135.747868, 106.452322, 137.897773, 106.452322),\n (137.897773, 106.452322, 140.047677, 106.452322),\n (140.047677, 106.452322, 140.047677, 79.149277),\n (71.250723, 79.149277, 73.400627, 79.149277),\n (73.400627, 79.149277, 75.550532, 79.149277),\n (75.550532, 79.149277, 77.700437, 79.149277),\n (77.700437, 79.149277, 79.850342, 79.149277),\n (79.850342, 79.149277, 82.000247, 79.149277),\n (82.000247, 79.149277, 84.150152, 79.149277),\n (84.150152, 79.149277, 86.300056, 79.149277),\n (86.300056, 79.149277, 88.449961, 79.149277),\n (88.449961, 79.149277, 90.599866, 79.149277),\n (90.599866, 79.149277, 92.749771, 79.149277),\n (92.749771, 79.149277, 94.899676, 79.149277),\n (94.899676, 79.149277, 97.049581, 79.149277),\n (97.049581, 79.149277, 99.199485, 79.149277),\n (99.199485, 79.149277, 101.34939, 79.149277),\n (101.34939, 79.149277, 103.499295, 79.149277),\n (103.499295, 79.149277, 105.6492, 79.149277),\n (105.6492, 79.149277, 107.799105, 79.149277),\n (107.799105, 79.149277, 109.94901, 79.149277),\n (109.94901, 79.149277, 112.098915, 79.149277),\n (112.098915, 79.149277, 114.248819, 79.149277),\n (114.248819, 79.149277, 116.398724, 79.149277),\n (116.398724, 79.149277, 118.548629, 79.149277),\n (118.548629, 79.149277, 120.698534, 79.149277),\n (120.698534, 79.149277, 122.848439, 79.149277),\n (122.848439, 79.149277, 124.998344, 79.149277),\n (124.998344, 79.149277, 127.148248, 79.149277),\n (127.148248, 79.149277, 129.298153, 79.149277),\n (129.298153, 79.149277, 131.448058, 79.149277),\n (131.448058, 79.149277, 133.597963, 79.149277),\n (133.597963, 79.149277, 135.747868, 79.149277),\n (135.747868, 79.149277, 137.897773, 79.149277),\n (137.897773, 79.149277, 140.047677, 79.149277),\n (71.250723, 79.149277, 71.250723, 106.452322),\n (181.350723, 189.249277, 181.350723, 187.099373),\n (181.350723, 187.099373, 181.350723, 184.949468),\n (181.350723, 184.949468, 181.350723, 182.799563),\n (181.350723, 182.799563, 181.350723, 180.649658),\n (181.350723, 180.649658, 181.350723, 178.499753),\n (181.350723, 178.499753, 181.350723, 176.349848),\n (181.350723, 176.349848, 181.350723, 174.199944),\n (181.350723, 174.199944, 181.350723, 172.050039),\n (181.350723, 172.050039, 181.350723, 169.900134),\n (181.350723, 169.900134, 181.350723, 167.750229),\n (181.350723, 167.750229, 181.350723, 165.600324),\n (181.350723, 165.600324, 181.350723, 163.450419),\n (181.350723, 163.450419, 181.350723, 161.300515),\n (181.350723, 161.300515, 181.350723, 159.15061),\n (181.350723, 159.15061, 181.350723, 157.000705),\n (181.350723, 157.000705, 181.350723, 154.8508),\n (181.350723, 154.8508, 181.350723, 152.700895),\n (181.350723, 152.700895, 181.350723, 150.55099),\n (181.350723, 150.55099, 181.350723, 148.401085),\n (181.350723, 148.401085, 181.350723, 146.251181),\n (181.350723, 146.251181, 181.350723, 144.101276),\n (181.350723, 144.101276, 181.350723, 141.951371),\n (181.350723, 141.951371, 181.350723, 139.801466),\n (181.350723, 139.801466, 181.350723, 137.651561),\n (181.350723, 137.651561, 181.350723, 135.501656),\n (181.350723, 135.501656, 181.350723, 133.351752),\n (181.350723, 133.351752, 181.350723, 131.201847),\n (181.350723, 131.201847, 181.350723, 129.051942),\n (181.350723, 129.051942, 181.350723, 126.902037),\n (181.350723, 126.902037, 181.350723, 124.752132),\n (181.350723, 124.752132, 181.350723, 122.602227),\n (181.350723, 122.602227, 181.350723, 120.452323),\n (154.047678, 189.249277, 154.047678, 187.099373),\n (154.047678, 187.099373, 154.047678, 184.949468),\n (154.047678, 184.949468, 154.047678, 182.799563),\n (154.047678, 182.799563, 154.047678, 180.649658),\n (154.047678, 180.649658, 154.047678, 178.499753),\n (154.047678, 178.499753, 154.047678, 176.349848),\n (154.047678, 176.349848, 154.047678, 174.199944),\n (154.047678, 174.199944, 154.047678, 172.050039),\n (154.047678, 172.050039, 154.047678, 169.900134),\n (154.047678, 169.900134, 154.047678, 167.750229),\n (154.047678, 167.750229, 154.047678, 165.600324),\n (154.047678, 165.600324, 154.047678, 163.450419),\n (154.047678, 163.450419, 154.047678, 161.300515),\n (154.047678, 161.300515, 154.047678, 159.15061),\n (154.047678, 159.15061, 154.047678, 157.000705),\n (154.047678, 157.000705, 154.047678, 154.8508),\n (154.047678, 154.8508, 154.047678, 152.700895),\n (154.047678, 152.700895, 154.047678, 150.55099),\n (154.047678, 150.55099, 154.047678, 148.401085),\n (154.047678, 148.401085, 154.047678, 146.251181),\n (154.047678, 146.251181, 154.047678, 144.101276),\n (154.047678, 144.101276, 154.047678, 141.951371),\n (154.047678, 141.951371, 154.047678, 139.801466),\n (154.047678, 139.801466, 154.047678, 137.651561),\n (154.047678, 137.651561, 154.047678, 135.501656),\n (154.047678, 135.501656, 154.047678, 133.351752),\n (154.047678, 133.351752, 154.047678, 131.201847),\n (154.047678, 131.201847, 154.047678, 129.051942),\n (154.047678, 129.051942, 154.047678, 126.902037),\n (154.047678, 126.902037, 154.047678, 124.752132),\n (154.047678, 124.752132, 154.047678, 122.602227),\n (154.047678, 122.602227, 154.047678, 120.452323),\n (154.047678, 189.249277, 181.350723, 189.249277),\n (154.047678, 120.452323, 181.350723, 120.452323)\n]\nVISIBLE_CIRCLES = [\n (105.6492, 154.8508, 34.398477)\n]\nVISIBLE_ARCS = [\n\n]\nHIDDEN_SEGMENTS = [\n\n]\n# (orient, text, p1, p2, base) for linear; (orient, text, center, radius, angle) for diameter\nDIMENSIONS = [\n ('diameter', '%%c100', (105.6492, 154.8508), 34.3985, 45),\n ('horizontal', '39.6864', (181.3508, 154.8508), (154.0477, 154.8508), (167.6992, 143.8508))\n]\n\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\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\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,\n angle=(0 if d[0] == \"horizontal\" else 90),\n 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,\n text=text, dimstyle=\"EZDXF\").render()\n\n doc.saveas(out_path)\n\n\nif __name__ == \"__main__\":\n out = sys.argv[1] if len(sys.argv) > 1 else \"0077_00770647_gt.dxf\"\n draw(out)\n print(\"wrote\", out)\n```"}], "images": ["images/0077_00770647.png"], "id": "0077_00770647"} {"messages": [{"role": "user", "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": "assistant", "content": "```python\n#!/usr/bin/env python3\n# -*- coding: utf-8 -*-\n# Ground-truth 2D engineering drawing for part: 0078_00780361\n# Self-contained: reproduces the three-view DXF via ezdxf, NO FreeCAD needed.\n# Coordinates are A4 page millimetres (scale=0.18731355932203736, page=[297.0, 210.0]).\n# visible edges -> solid (layer OUTLINE); hidden edges -> dashed (layer HIDDEN)\n# dimensions -> real movable DIMENSION entities (text = true mm value)\n# Run: python 0078_00780361_gt.py [out.dxf]\nimport sys\nimport ezdxf\n\nSCALE = 0.18731355932203736\nPAGE = [297.0, 210.0]\n\nVISIBLE_SEGMENTS = [\n (83.767122, 144.001522, 84.352477, 144.001522),\n (84.352477, 144.001522, 84.937832, 144.001522),\n (84.937832, 144.001522, 85.523187, 144.001522),\n (85.523187, 144.001522, 86.108542, 144.001522),\n (86.108542, 144.001522, 86.693896, 144.001522),\n (86.693896, 144.001522, 87.279251, 144.001522),\n (87.279251, 144.001522, 87.864606, 144.001522),\n (87.864606, 144.001522, 88.449961, 144.001522),\n (88.449961, 144.001522, 89.035316, 144.001522),\n (89.035316, 144.001522, 89.620671, 144.001522),\n (89.620671, 144.001522, 90.206026, 144.001522),\n (90.206026, 144.001522, 90.791381, 144.001522),\n (90.791381, 144.001522, 91.376735, 144.001522),\n (91.376735, 144.001522, 91.96209, 144.001522),\n (91.96209, 144.001522, 92.547445, 144.001522),\n (92.547445, 144.001522, 93.1328, 144.001522),\n (93.1328, 144.001522, 93.718155, 144.001522),\n (93.718155, 144.001522, 94.30351, 144.001522),\n (94.30351, 144.001522, 94.888865, 144.001522),\n (94.888865, 144.001522, 95.474219, 144.001522),\n (95.474219, 144.001522, 96.059574, 144.001522),\n (96.059574, 144.001522, 96.644929, 144.001522),\n (96.644929, 144.001522, 97.230284, 144.001522),\n (97.230284, 144.001522, 97.815639, 144.001522),\n (97.815639, 144.001522, 98.400994, 144.001522),\n (98.400994, 144.001522, 98.986349, 144.001522),\n (98.986349, 144.001522, 99.571704, 144.001522),\n (99.571704, 144.001522, 100.157058, 144.001522),\n (100.157058, 144.001522, 100.742413, 144.001522),\n (100.742413, 144.001522, 101.327768, 144.001522),\n (101.327768, 144.001522, 101.913123, 144.001522),\n (101.913123, 144.001522, 102.498478, 144.001522),\n (102.498478, 144.001522, 102.498478, 66.632878),\n (83.767122, 66.632878, 84.352477, 66.632878),\n (84.352477, 66.632878, 84.937832, 66.632878),\n (84.937832, 66.632878, 85.523187, 66.632878),\n (85.523187, 66.632878, 86.108542, 66.632878),\n (86.108542, 66.632878, 86.693896, 66.632878),\n (86.693896, 66.632878, 87.279251, 66.632878),\n (87.279251, 66.632878, 87.864606, 66.632878),\n (87.864606, 66.632878, 88.449961, 66.632878),\n (88.449961, 66.632878, 89.035316, 66.632878),\n (89.035316, 66.632878, 89.620671, 66.632878),\n (89.620671, 66.632878, 90.206026, 66.632878),\n (90.206026, 66.632878, 90.791381, 66.632878),\n (90.791381, 66.632878, 91.376735, 66.632878),\n (91.376735, 66.632878, 91.96209, 66.632878),\n (91.96209, 66.632878, 92.547445, 66.632878),\n (92.547445, 66.632878, 93.1328, 66.632878),\n (93.1328, 66.632878, 93.718155, 66.632878),\n (93.718155, 66.632878, 94.30351, 66.632878),\n (94.30351, 66.632878, 94.888865, 66.632878),\n (94.888865, 66.632878, 95.474219, 66.632878),\n (95.474219, 66.632878, 96.059574, 66.632878),\n (96.059574, 66.632878, 96.644929, 66.632878),\n (96.644929, 66.632878, 97.230284, 66.632878),\n (97.230284, 66.632878, 97.815639, 66.632878),\n (97.815639, 66.632878, 98.400994, 66.632878),\n (98.400994, 66.632878, 98.986349, 66.632878),\n (98.986349, 66.632878, 99.571704, 66.632878),\n (99.571704, 66.632878, 100.157058, 66.632878),\n (100.157058, 66.632878, 100.742413, 66.632878),\n (100.742413, 66.632878, 101.327768, 66.632878),\n (101.327768, 66.632878, 101.913123, 66.632878),\n (101.913123, 66.632878, 102.498478, 66.632878),\n (83.767122, 144.001522, 83.767122, 66.632878),\n (193.867122, 176.732878, 193.867122, 176.147523),\n (193.867122, 176.147523, 193.867122, 175.562168),\n (193.867122, 175.562168, 193.867122, 174.976813),\n (193.867122, 174.976813, 193.867122, 174.391458),\n (193.867122, 174.391458, 193.867122, 173.806104),\n (193.867122, 173.806104, 193.867122, 173.220749),\n (193.867122, 173.220749, 193.867122, 172.635394),\n (193.867122, 172.635394, 193.867122, 172.050039),\n (193.867122, 172.050039, 193.867122, 171.464684),\n (193.867122, 171.464684, 193.867122, 170.879329),\n (193.867122, 170.879329, 193.867122, 170.293974),\n (193.867122, 170.293974, 193.867122, 169.708619),\n (193.867122, 169.708619, 193.867122, 169.123265),\n (193.867122, 169.123265, 193.867122, 168.53791),\n (193.867122, 168.53791, 193.867122, 167.952555),\n (193.867122, 167.952555, 193.867122, 167.3672),\n (193.867122, 167.3672, 193.867122, 166.781845),\n (193.867122, 166.781845, 193.867122, 166.19649),\n (193.867122, 166.19649, 193.867122, 165.611135),\n (193.867122, 165.611135, 193.867122, 165.025781),\n (193.867122, 165.025781, 193.867122, 164.440426),\n (193.867122, 164.440426, 193.867122, 163.855071),\n (193.867122, 163.855071, 193.867122, 163.269716),\n (193.867122, 163.269716, 193.867122, 162.684361),\n (193.867122, 162.684361, 193.867122, 162.099006),\n (193.867122, 162.099006, 193.867122, 161.513651),\n (193.867122, 161.513651, 193.867122, 160.928296),\n (193.867122, 160.928296, 193.867122, 160.342942),\n (193.867122, 160.342942, 193.867122, 159.757587),\n (193.867122, 159.757587, 193.867122, 159.172232),\n (193.867122, 159.172232, 193.867122, 158.586877),\n (193.867122, 158.586877, 193.867122, 158.001522),\n (116.498478, 176.732878, 116.498478, 176.147523),\n (116.498478, 176.147523, 116.498478, 175.562168),\n (116.498478, 175.562168, 116.498478, 174.976813),\n (116.498478, 174.976813, 116.498478, 174.391458),\n (116.498478, 174.391458, 116.498478, 173.806104),\n (116.498478, 173.806104, 116.498478, 173.220749),\n (116.498478, 173.220749, 116.498478, 172.635394),\n (116.498478, 172.635394, 116.498478, 172.050039),\n (116.498478, 172.050039, 116.498478, 171.464684),\n (116.498478, 171.464684, 116.498478, 170.879329),\n (116.498478, 170.879329, 116.498478, 170.293974),\n (116.498478, 170.293974, 116.498478, 169.708619),\n (116.498478, 169.708619, 116.498478, 169.123265),\n (116.498478, 169.123265, 116.498478, 168.53791),\n (116.498478, 168.53791, 116.498478, 167.952555),\n (116.498478, 167.952555, 116.498478, 167.3672),\n (116.498478, 167.3672, 116.498478, 166.781845),\n (116.498478, 166.781845, 116.498478, 166.19649),\n (116.498478, 166.19649, 116.498478, 165.611135),\n (116.498478, 165.611135, 116.498478, 165.025781),\n (116.498478, 165.025781, 116.498478, 164.440426),\n (116.498478, 164.440426, 116.498478, 163.855071),\n (116.498478, 163.855071, 116.498478, 163.269716),\n (116.498478, 163.269716, 116.498478, 162.684361),\n (116.498478, 162.684361, 116.498478, 162.099006),\n (116.498478, 162.099006, 116.498478, 161.513651),\n (116.498478, 161.513651, 116.498478, 160.928296),\n (116.498478, 160.928296, 116.498478, 160.342942),\n (116.498478, 160.342942, 116.498478, 159.757587),\n (116.498478, 159.757587, 116.498478, 159.172232),\n (116.498478, 159.172232, 116.498478, 158.586877),\n (116.498478, 158.586877, 116.498478, 158.001522),\n (193.867122, 158.001522, 116.498478, 158.001522),\n (193.867122, 176.732878, 116.498478, 176.732878)\n]\nVISIBLE_CIRCLES = [\n (93.1328, 167.3672, 9.365678)\n]\nVISIBLE_ARCS = [\n\n]\nHIDDEN_SEGMENTS = [\n\n]\n# (orient, text, p1, p2, base) for linear; (orient, text, center, radius, angle) for diameter\nDIMENSIONS = [\n ('diameter', '%%c100', (93.1328, 167.3672), 9.3657, 45),\n ('horizontal', '413.043', (116.4985, 167.3672), (193.8672, 167.3672), (155.1828, 178.3672))\n]\n\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\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\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,\n angle=(0 if d[0] == \"horizontal\" else 90),\n 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,\n text=text, dimstyle=\"EZDXF\").render()\n\n doc.saveas(out_path)\n\n\nif __name__ == \"__main__\":\n out = sys.argv[1] if len(sys.argv) > 1 else \"0078_00780361_gt.dxf\"\n draw(out)\n print(\"wrote\", out)\n```"}], "images": ["images/0078_00780361.png"], "id": "0078_00780361"} {"messages": [{"role": "user", "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 156.68 mm."}, {"role": "assistant", "content": "```python\n#!/usr/bin/env python3\n# -*- coding: utf-8 -*-\n# Ground-truth 2D engineering drawing for part: 0078_00787004\n# Self-contained: reproduces the three-view DXF via ezdxf, NO FreeCAD needed.\n# Coordinates are A4 page millimetres (scale=0.3743902603990645, page=[297.0, 210.0]).\n# visible edges -> solid (layer OUTLINE); hidden edges -> dashed (layer HIDDEN)\n# dimensions -> real movable DIMENSION entities (text = true mm value)\n# Run: python 0078_00787004_gt.py [out.dxf]\nimport sys\nimport ezdxf\n\nSCALE = 0.3743902603990645\nPAGE = [297.0, 210.0]\n\nVISIBLE_SEGMENTS = [\n (116.529213, 71.309713, 115.359243, 71.309713),\n (115.359243, 71.309713, 114.189274, 71.309713),\n (114.189274, 71.309713, 113.019304, 71.309713),\n (113.019304, 71.309713, 111.849335, 71.309713),\n (111.849335, 71.309713, 110.679365, 71.309713),\n (110.679365, 71.309713, 109.509396, 71.309713),\n (109.509396, 71.309713, 108.339426, 71.309713),\n (108.339426, 71.309713, 107.169457, 71.309713),\n (107.169457, 71.309713, 105.999487, 71.309713),\n (105.999487, 71.309713, 104.829517, 71.309713),\n (104.829517, 71.309713, 103.659548, 71.309713),\n (103.659548, 71.309713, 102.489578, 71.309713),\n (102.489578, 71.309713, 101.319609, 71.309713),\n (101.319609, 71.309713, 100.149639, 71.309713),\n (100.149639, 71.309713, 98.97967, 71.309713),\n (98.97967, 71.309713, 97.8097, 71.309713),\n (97.8097, 71.309713, 96.63973, 71.309713),\n (96.63973, 71.309713, 95.469761, 71.309713),\n (95.469761, 71.309713, 94.299791, 71.309713),\n (94.299791, 71.309713, 93.129822, 71.309713),\n (93.129822, 71.309713, 91.959852, 71.309713),\n (91.959852, 71.309713, 90.789883, 71.309713),\n (90.789883, 71.309713, 89.619913, 71.309713),\n (89.619913, 71.309713, 88.449943, 71.309713),\n (88.449943, 71.309713, 87.279974, 71.309713),\n (87.279974, 71.309713, 86.110004, 71.309713),\n (86.110004, 71.309713, 84.940035, 71.309713),\n (84.940035, 71.309713, 83.770065, 71.309713),\n (83.770065, 71.309713, 82.600096, 71.309713),\n (82.600096, 71.309713, 81.430126, 71.309713),\n (81.430126, 71.309713, 80.260157, 71.309713),\n (80.260157, 71.309713, 79.090187, 71.309713),\n (116.529213, 71.309713, 116.529213, 129.970687),\n (116.529213, 129.970687, 115.359243, 129.970687),\n (115.359243, 129.970687, 114.189274, 129.970687),\n (114.189274, 129.970687, 113.019304, 129.970687),\n (113.019304, 129.970687, 111.849335, 129.970687),\n (111.849335, 129.970687, 110.679365, 129.970687),\n (110.679365, 129.970687, 109.509396, 129.970687),\n (109.509396, 129.970687, 108.339426, 129.970687),\n (108.339426, 129.970687, 107.169457, 129.970687),\n (107.169457, 129.970687, 105.999487, 129.970687),\n (105.999487, 129.970687, 104.829517, 129.970687),\n (104.829517, 129.970687, 103.659548, 129.970687),\n (103.659548, 129.970687, 102.489578, 129.970687),\n (102.489578, 129.970687, 101.319609, 129.970687),\n (101.319609, 129.970687, 100.149639, 129.970687),\n (100.149639, 129.970687, 98.97967, 129.970687),\n (98.97967, 129.970687, 97.8097, 129.970687),\n (97.8097, 129.970687, 96.63973, 129.970687),\n (96.63973, 129.970687, 95.469761, 129.970687),\n (95.469761, 129.970687, 94.299791, 129.970687),\n (94.299791, 129.970687, 93.129822, 129.970687),\n (93.129822, 129.970687, 91.959852, 129.970687),\n (91.959852, 129.970687, 90.789883, 129.970687),\n (90.789883, 129.970687, 89.619913, 129.970687),\n (89.619913, 129.970687, 88.449943, 129.970687),\n (88.449943, 129.970687, 87.279974, 129.970687),\n (87.279974, 129.970687, 86.110004, 129.970687),\n (86.110004, 129.970687, 84.940035, 129.970687),\n (84.940035, 129.970687, 83.770065, 129.970687),\n (83.770065, 129.970687, 82.600096, 129.970687),\n (82.600096, 129.970687, 81.430126, 129.970687),\n (81.430126, 129.970687, 80.260157, 129.970687),\n (80.260157, 129.970687, 79.090187, 129.970687),\n (79.090187, 129.970687, 79.090187, 71.309713),\n (130.529213, 143.970687, 130.529213, 145.140657),\n (130.529213, 145.140657, 130.529213, 146.310626),\n (130.529213, 146.310626, 130.529213, 147.480596),\n (130.529213, 147.480596, 130.529213, 148.650565),\n (130.529213, 148.650565, 130.529213, 149.820535),\n (130.529213, 149.820535, 130.529213, 150.990504),\n (130.529213, 150.990504, 130.529213, 152.160474),\n (130.529213, 152.160474, 130.529213, 153.330443),\n (130.529213, 153.330443, 130.529213, 154.500413),\n (130.529213, 154.500413, 130.529213, 155.670383),\n (130.529213, 155.670383, 130.529213, 156.840352),\n (130.529213, 156.840352, 130.529213, 158.010322),\n (130.529213, 158.010322, 130.529213, 159.180291),\n (130.529213, 159.180291, 130.529213, 160.350261),\n (130.529213, 160.350261, 130.529213, 161.52023),\n (130.529213, 161.52023, 130.529213, 162.6902),\n (130.529213, 162.6902, 130.529213, 163.86017),\n (130.529213, 163.86017, 130.529213, 165.030139),\n (130.529213, 165.030139, 130.529213, 166.200109),\n (130.529213, 166.200109, 130.529213, 167.370078),\n (130.529213, 167.370078, 130.529213, 168.540048),\n (130.529213, 168.540048, 130.529213, 169.710017),\n (130.529213, 169.710017, 130.529213, 170.879987),\n (130.529213, 170.879987, 130.529213, 172.049957),\n (130.529213, 172.049957, 130.529213, 173.219926),\n (130.529213, 173.219926, 130.529213, 174.389896),\n (130.529213, 174.389896, 130.529213, 175.559865),\n (130.529213, 175.559865, 130.529213, 176.729835),\n (130.529213, 176.729835, 130.529213, 177.899804),\n (130.529213, 177.899804, 130.529213, 179.069774),\n (130.529213, 179.069774, 130.529213, 180.239743),\n (130.529213, 180.239743, 130.529213, 181.409713),\n (189.190187, 143.970687, 189.190187, 145.140657),\n (189.190187, 145.140657, 189.190187, 146.310626),\n (189.190187, 146.310626, 189.190187, 147.480596),\n (189.190187, 147.480596, 189.190187, 148.650565),\n (189.190187, 148.650565, 189.190187, 149.820535),\n (189.190187, 149.820535, 189.190187, 150.990504),\n (189.190187, 150.990504, 189.190187, 152.160474),\n (189.190187, 152.160474, 189.190187, 153.330443),\n (189.190187, 153.330443, 189.190187, 154.500413),\n (189.190187, 154.500413, 189.190187, 155.670383),\n (189.190187, 155.670383, 189.190187, 156.840352),\n (189.190187, 156.840352, 189.190187, 158.010322),\n (189.190187, 158.010322, 189.190187, 159.180291),\n (189.190187, 159.180291, 189.190187, 160.350261),\n (189.190187, 160.350261, 189.190187, 161.52023),\n (189.190187, 161.52023, 189.190187, 162.6902),\n (189.190187, 162.6902, 189.190187, 163.86017),\n (189.190187, 163.86017, 189.190187, 165.030139),\n (189.190187, 165.030139, 189.190187, 166.200109),\n (189.190187, 166.200109, 189.190187, 167.370078),\n (189.190187, 167.370078, 189.190187, 168.540048),\n (189.190187, 168.540048, 189.190187, 169.710017),\n (189.190187, 169.710017, 189.190187, 170.879987),\n (189.190187, 170.879987, 189.190187, 172.049957),\n (189.190187, 172.049957, 189.190187, 173.219926),\n (189.190187, 173.219926, 189.190187, 174.389896),\n (189.190187, 174.389896, 189.190187, 175.559865),\n (189.190187, 175.559865, 189.190187, 176.729835),\n (189.190187, 176.729835, 189.190187, 177.899804),\n (189.190187, 177.899804, 189.190187, 179.069774),\n (189.190187, 179.069774, 189.190187, 180.239743),\n (189.190187, 180.239743, 189.190187, 181.409713),\n (189.190187, 143.970687, 130.529213, 143.970687),\n (189.190187, 181.409713, 130.529213, 181.409713)\n]\nVISIBLE_CIRCLES = [\n (97.8097, 162.6902, 18.719513)\n]\nVISIBLE_ARCS = [\n\n]\nHIDDEN_SEGMENTS = [\n\n]\n# (orient, text, p1, p2, base) for linear; (orient, text, center, radius, angle) for diameter\nDIMENSIONS = [\n ('diameter', '%%c100', (97.8097, 162.6902), 18.7195, 45),\n ('horizontal', '156.684', (130.5293, 162.6902), (189.1902, 162.6902), (159.8598, 173.6902))\n]\n\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\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\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,\n angle=(0 if d[0] == \"horizontal\" else 90),\n 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,\n text=text, dimstyle=\"EZDXF\").render()\n\n doc.saveas(out_path)\n\n\nif __name__ == \"__main__\":\n out = sys.argv[1] if len(sys.argv) > 1 else \"0078_00787004_gt.dxf\"\n draw(out)\n print(\"wrote\", out)\n```"}], "images": ["images/0078_00787004.png"], "id": "0078_00787004"} {"messages": [{"role": "user", "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 851.04 mm."}, {"role": "assistant", "content": "```python\n#!/usr/bin/env python3\n# -*- coding: utf-8 -*-\n# Ground-truth 2D engineering drawing for part: 0079_00792937\n# Self-contained: reproduces the three-view DXF via ezdxf, NO FreeCAD needed.\n# Coordinates are A4 page millimetres (scale=0.10104709748083313, page=[297.0, 210.0]).\n# visible edges -> solid (layer OUTLINE); hidden edges -> dashed (layer HIDDEN)\n# dimensions -> real movable DIMENSION entities (text = true mm value)\n# Run: python 0079_00792937_gt.py [out.dxf]\nimport sys\nimport ezdxf\n\nSCALE = 0.10104709748083313\nPAGE = [297.0, 210.0]\n\nVISIBLE_SEGMENTS = [\n (96.028555, 64.476155, 95.712783, 64.476155),\n (95.712783, 64.476155, 95.397011, 64.476155),\n (95.397011, 64.476155, 95.081238, 64.476155),\n (95.081238, 64.476155, 94.765466, 64.476155),\n (94.765466, 64.476155, 94.449694, 64.476155),\n (94.449694, 64.476155, 94.133922, 64.476155),\n (94.133922, 64.476155, 93.81815, 64.476155),\n (93.81815, 64.476155, 93.502377, 64.476155),\n (93.502377, 64.476155, 93.186605, 64.476155),\n (93.186605, 64.476155, 92.870833, 64.476155),\n (92.870833, 64.476155, 92.555061, 64.476155),\n (92.555061, 64.476155, 92.239289, 64.476155),\n (92.239289, 64.476155, 91.923517, 64.476155),\n (91.923517, 64.476155, 91.607744, 64.476155),\n (91.607744, 64.476155, 91.291972, 64.476155),\n (91.291972, 64.476155, 90.9762, 64.476155),\n (90.9762, 64.476155, 90.660428, 64.476155),\n (90.660428, 64.476155, 90.344656, 64.476155),\n (90.344656, 64.476155, 90.028883, 64.476155),\n (90.028883, 64.476155, 89.713111, 64.476155),\n (89.713111, 64.476155, 89.397339, 64.476155),\n (89.397339, 64.476155, 89.081567, 64.476155),\n (89.081567, 64.476155, 88.765795, 64.476155),\n (88.765795, 64.476155, 88.450023, 64.476155),\n (88.450023, 64.476155, 88.13425, 64.476155),\n (88.13425, 64.476155, 87.818478, 64.476155),\n (87.818478, 64.476155, 87.502706, 64.476155),\n (87.502706, 64.476155, 87.186934, 64.476155),\n (87.186934, 64.476155, 86.871162, 64.476155),\n (86.871162, 64.476155, 86.555389, 64.476155),\n (86.555389, 64.476155, 86.239617, 64.476155),\n (86.239617, 64.476155, 85.923845, 64.476155),\n (96.028555, 64.476155, 96.028555, 150.471445),\n (96.028555, 150.471445, 95.712783, 150.471445),\n (95.712783, 150.471445, 95.397011, 150.471445),\n (95.397011, 150.471445, 95.081238, 150.471445),\n (95.081238, 150.471445, 94.765466, 150.471445),\n (94.765466, 150.471445, 94.449694, 150.471445),\n (94.449694, 150.471445, 94.133922, 150.471445),\n (94.133922, 150.471445, 93.81815, 150.471445),\n (93.81815, 150.471445, 93.502377, 150.471445),\n (93.502377, 150.471445, 93.186605, 150.471445),\n (93.186605, 150.471445, 92.870833, 150.471445),\n (92.870833, 150.471445, 92.555061, 150.471445),\n (92.555061, 150.471445, 92.239289, 150.471445),\n (92.239289, 150.471445, 91.923517, 150.471445),\n (91.923517, 150.471445, 91.607744, 150.471445),\n (91.607744, 150.471445, 91.291972, 150.471445),\n (91.291972, 150.471445, 90.9762, 150.471445),\n (90.9762, 150.471445, 90.660428, 150.471445),\n (90.660428, 150.471445, 90.344656, 150.471445),\n (90.344656, 150.471445, 90.028883, 150.471445),\n (90.028883, 150.471445, 89.713111, 150.471445),\n (89.713111, 150.471445, 89.397339, 150.471445),\n (89.397339, 150.471445, 89.081567, 150.471445),\n (89.081567, 150.471445, 88.765795, 150.471445),\n (88.765795, 150.471445, 88.450023, 150.471445),\n (88.450023, 150.471445, 88.13425, 150.471445),\n (88.13425, 150.471445, 87.818478, 150.471445),\n (87.818478, 150.471445, 87.502706, 150.471445),\n (87.502706, 150.471445, 87.186934, 150.471445),\n (87.186934, 150.471445, 86.871162, 150.471445),\n (86.871162, 150.471445, 86.555389, 150.471445),\n (86.555389, 150.471445, 86.239617, 150.471445),\n (86.239617, 150.471445, 85.923845, 150.471445),\n (85.923845, 150.471445, 85.923845, 64.476155),\n (110.028555, 164.471445, 110.028555, 164.787217),\n (110.028555, 164.787217, 110.028555, 165.102989),\n (110.028555, 165.102989, 110.028555, 165.418762),\n (110.028555, 165.418762, 110.028555, 165.734534),\n (110.028555, 165.734534, 110.028555, 166.050306),\n (110.028555, 166.050306, 110.028555, 166.366078),\n (110.028555, 166.366078, 110.028555, 166.68185),\n (110.028555, 166.68185, 110.028555, 166.997623),\n (110.028555, 166.997623, 110.028555, 167.313395),\n (110.028555, 167.313395, 110.028555, 167.629167),\n (110.028555, 167.629167, 110.028555, 167.944939),\n (110.028555, 167.944939, 110.028555, 168.260711),\n (110.028555, 168.260711, 110.028555, 168.576483),\n (110.028555, 168.576483, 110.028555, 168.892256),\n (110.028555, 168.892256, 110.028555, 169.208028),\n (110.028555, 169.208028, 110.028555, 169.5238),\n (110.028555, 169.5238, 110.028555, 169.839572),\n (110.028555, 169.839572, 110.028555, 170.155344),\n (110.028555, 170.155344, 110.028555, 170.471117),\n (110.028555, 170.471117, 110.028555, 170.786889),\n (110.028555, 170.786889, 110.028555, 171.102661),\n (110.028555, 171.102661, 110.028555, 171.418433),\n (110.028555, 171.418433, 110.028555, 171.734205),\n (110.028555, 171.734205, 110.028555, 172.049977),\n (110.028555, 172.049977, 110.028555, 172.36575),\n (110.028555, 172.36575, 110.028555, 172.681522),\n (110.028555, 172.681522, 110.028555, 172.997294),\n (110.028555, 172.997294, 110.028555, 173.313066),\n (110.028555, 173.313066, 110.028555, 173.628838),\n (110.028555, 173.628838, 110.028555, 173.944611),\n (110.028555, 173.944611, 110.028555, 174.260383),\n (110.028555, 174.260383, 110.028555, 174.576155),\n (196.023845, 164.471445, 196.023845, 164.787217),\n (196.023845, 164.787217, 196.023845, 165.102989),\n (196.023845, 165.102989, 196.023845, 165.418762),\n (196.023845, 165.418762, 196.023845, 165.734534),\n (196.023845, 165.734534, 196.023845, 166.050306),\n (196.023845, 166.050306, 196.023845, 166.366078),\n (196.023845, 166.366078, 196.023845, 166.68185),\n (196.023845, 166.68185, 196.023845, 166.997623),\n (196.023845, 166.997623, 196.023845, 167.313395),\n (196.023845, 167.313395, 196.023845, 167.629167),\n (196.023845, 167.629167, 196.023845, 167.944939),\n (196.023845, 167.944939, 196.023845, 168.260711),\n (196.023845, 168.260711, 196.023845, 168.576483),\n (196.023845, 168.576483, 196.023845, 168.892256),\n (196.023845, 168.892256, 196.023845, 169.208028),\n (196.023845, 169.208028, 196.023845, 169.5238),\n (196.023845, 169.5238, 196.023845, 169.839572),\n (196.023845, 169.839572, 196.023845, 170.155344),\n (196.023845, 170.155344, 196.023845, 170.471117),\n (196.023845, 170.471117, 196.023845, 170.786889),\n (196.023845, 170.786889, 196.023845, 171.102661),\n (196.023845, 171.102661, 196.023845, 171.418433),\n (196.023845, 171.418433, 196.023845, 171.734205),\n (196.023845, 171.734205, 196.023845, 172.049977),\n (196.023845, 172.049977, 196.023845, 172.36575),\n (196.023845, 172.36575, 196.023845, 172.681522),\n (196.023845, 172.681522, 196.023845, 172.997294),\n (196.023845, 172.997294, 196.023845, 173.313066),\n (196.023845, 173.313066, 196.023845, 173.628838),\n (196.023845, 173.628838, 196.023845, 173.944611),\n (196.023845, 173.944611, 196.023845, 174.260383),\n (196.023845, 174.260383, 196.023845, 174.576155),\n (196.023845, 164.471445, 110.028555, 164.471445),\n (196.023845, 174.576155, 110.028555, 174.576155)\n]\nVISIBLE_CIRCLES = [\n (90.9762, 169.5238, 5.052355)\n]\nVISIBLE_ARCS = [\n\n]\nHIDDEN_SEGMENTS = [\n\n]\n# (orient, text, p1, p2, base) for linear; (orient, text, center, radius, angle) for diameter\nDIMENSIONS = [\n ('diameter', '%%c100', (90.9762, 169.5238), 5.0524, 45),\n ('horizontal', '851.042', (110.0285, 169.5238), (196.0238, 169.5238), (153.0262, 180.5238))\n]\n\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\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\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,\n angle=(0 if d[0] == \"horizontal\" else 90),\n 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,\n text=text, dimstyle=\"EZDXF\").render()\n\n doc.saveas(out_path)\n\n\nif __name__ == \"__main__\":\n out = sys.argv[1] if len(sys.argv) > 1 else \"0079_00792937_gt.dxf\"\n draw(out)\n print(\"wrote\", out)\n```"}], "images": ["images/0079_00792937.png"], "id": "0079_00792937"} {"messages": [{"role": "user", "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": "assistant", "content": "```python\n#!/usr/bin/env python3\n# -*- coding: utf-8 -*-\n# Ground-truth 2D engineering drawing for part: 0079_00798853\n# Self-contained: reproduces the three-view DXF via ezdxf, NO FreeCAD needed.\n# Coordinates are A4 page millimetres (scale=0.6428989547038615, page=[297.0, 210.0]).\n# visible edges -> solid (layer OUTLINE); hidden edges -> dashed (layer HIDDEN)\n# dimensions -> real movable DIMENSION entities (text = true mm value)\n# Run: python 0079_00798853_gt.py [out.dxf]\nimport sys\nimport ezdxf\n\nSCALE = 0.6428989547038615\nPAGE = [297.0, 210.0]\n\nVISIBLE_SEGMENTS = [\n (72.377552, 109.832552, 74.386611, 109.832552),\n (74.386611, 109.832552, 76.395671, 109.832552),\n (76.395671, 109.832552, 78.40473, 109.832552),\n (78.40473, 109.832552, 80.413789, 109.832552),\n (80.413789, 109.832552, 82.422848, 109.832552),\n (82.422848, 109.832552, 84.431908, 109.832552),\n (84.431908, 109.832552, 86.440967, 109.832552),\n (86.440967, 109.832552, 88.450026, 109.832552),\n (88.450026, 109.832552, 90.459085, 109.832552),\n (90.459085, 109.832552, 92.468145, 109.832552),\n (92.468145, 109.832552, 94.477204, 109.832552),\n (94.477204, 109.832552, 96.486263, 109.832552),\n (96.486263, 109.832552, 98.495322, 109.832552),\n (98.495322, 109.832552, 100.504382, 109.832552),\n (100.504382, 109.832552, 102.513441, 109.832552),\n (102.513441, 109.832552, 104.5225, 109.832552),\n (104.5225, 109.832552, 106.531559, 109.832552),\n (106.531559, 109.832552, 108.540618, 109.832552),\n (108.540618, 109.832552, 110.549678, 109.832552),\n (110.549678, 109.832552, 112.558737, 109.832552),\n (112.558737, 109.832552, 114.567796, 109.832552),\n (114.567796, 109.832552, 116.576855, 109.832552),\n (116.576855, 109.832552, 118.585915, 109.832552),\n (118.585915, 109.832552, 120.594974, 109.832552),\n (120.594974, 109.832552, 122.604033, 109.832552),\n (122.604033, 109.832552, 124.613092, 109.832552),\n (124.613092, 109.832552, 126.622152, 109.832552),\n (126.622152, 109.832552, 128.631211, 109.832552),\n (128.631211, 109.832552, 130.64027, 109.832552),\n (130.64027, 109.832552, 132.649329, 109.832552),\n (132.649329, 109.832552, 134.658389, 109.832552),\n (134.658389, 109.832552, 136.667448, 109.832552),\n (136.667448, 109.832552, 136.667448, 78.022448),\n (72.377552, 78.022448, 74.386611, 78.022448),\n (74.386611, 78.022448, 76.395671, 78.022448),\n (76.395671, 78.022448, 78.40473, 78.022448),\n (78.40473, 78.022448, 80.413789, 78.022448),\n (80.413789, 78.022448, 82.422848, 78.022448),\n (82.422848, 78.022448, 84.431908, 78.022448),\n (84.431908, 78.022448, 86.440967, 78.022448),\n (86.440967, 78.022448, 88.450026, 78.022448),\n (88.450026, 78.022448, 90.459085, 78.022448),\n (90.459085, 78.022448, 92.468145, 78.022448),\n (92.468145, 78.022448, 94.477204, 78.022448),\n (94.477204, 78.022448, 96.486263, 78.022448),\n (96.486263, 78.022448, 98.495322, 78.022448),\n (98.495322, 78.022448, 100.504382, 78.022448),\n (100.504382, 78.022448, 102.513441, 78.022448),\n (102.513441, 78.022448, 104.5225, 78.022448),\n (104.5225, 78.022448, 106.531559, 78.022448),\n (106.531559, 78.022448, 108.540618, 78.022448),\n (108.540618, 78.022448, 110.549678, 78.022448),\n (110.549678, 78.022448, 112.558737, 78.022448),\n (112.558737, 78.022448, 114.567796, 78.022448),\n (114.567796, 78.022448, 116.576855, 78.022448),\n (116.576855, 78.022448, 118.585915, 78.022448),\n (118.585915, 78.022448, 120.594974, 78.022448),\n (120.594974, 78.022448, 122.604033, 78.022448),\n (122.604033, 78.022448, 124.613092, 78.022448),\n (124.613092, 78.022448, 126.622152, 78.022448),\n (126.622152, 78.022448, 128.631211, 78.022448),\n (128.631211, 78.022448, 130.64027, 78.022448),\n (130.64027, 78.022448, 132.649329, 78.022448),\n (132.649329, 78.022448, 134.658389, 78.022448),\n (134.658389, 78.022448, 136.667448, 78.022448),\n (72.377552, 78.022448, 72.377552, 109.832552),\n (182.477552, 188.122448, 182.477552, 186.113389),\n (182.477552, 186.113389, 182.477552, 184.104329),\n (182.477552, 184.104329, 182.477552, 182.09527),\n (182.477552, 182.09527, 182.477552, 180.086211),\n (182.477552, 180.086211, 182.477552, 178.077152),\n (182.477552, 178.077152, 182.477552, 176.068092),\n (182.477552, 176.068092, 182.477552, 174.059033),\n (182.477552, 174.059033, 182.477552, 172.049974),\n (182.477552, 172.049974, 182.477552, 170.040915),\n (182.477552, 170.040915, 182.477552, 168.031855),\n (182.477552, 168.031855, 182.477552, 166.022796),\n (182.477552, 166.022796, 182.477552, 164.013737),\n (182.477552, 164.013737, 182.477552, 162.004678),\n (182.477552, 162.004678, 182.477552, 159.995618),\n (182.477552, 159.995618, 182.477552, 157.986559),\n (182.477552, 157.986559, 182.477552, 155.9775),\n (182.477552, 155.9775, 182.477552, 153.968441),\n (182.477552, 153.968441, 182.477552, 151.959382),\n (182.477552, 151.959382, 182.477552, 149.950322),\n (182.477552, 149.950322, 182.477552, 147.941263),\n (182.477552, 147.941263, 182.477552, 145.932204),\n (182.477552, 145.932204, 182.477552, 143.923145),\n (182.477552, 143.923145, 182.477552, 141.914085),\n (182.477552, 141.914085, 182.477552, 139.905026),\n (182.477552, 139.905026, 182.477552, 137.895967),\n (182.477552, 137.895967, 182.477552, 135.886908),\n (182.477552, 135.886908, 182.477552, 133.877848),\n (182.477552, 133.877848, 182.477552, 131.868789),\n (182.477552, 131.868789, 182.477552, 129.85973),\n (182.477552, 129.85973, 182.477552, 127.850671),\n (182.477552, 127.850671, 182.477552, 125.841611),\n (182.477552, 125.841611, 182.477552, 123.832552),\n (150.667448, 188.122448, 150.667448, 186.113389),\n (150.667448, 186.113389, 150.667448, 184.104329),\n (150.667448, 184.104329, 150.667448, 182.09527),\n (150.667448, 182.09527, 150.667448, 180.086211),\n (150.667448, 180.086211, 150.667448, 178.077152),\n (150.667448, 178.077152, 150.667448, 176.068092),\n (150.667448, 176.068092, 150.667448, 174.059033),\n (150.667448, 174.059033, 150.667448, 172.049974),\n (150.667448, 172.049974, 150.667448, 170.040915),\n (150.667448, 170.040915, 150.667448, 168.031855),\n (150.667448, 168.031855, 150.667448, 166.022796),\n (150.667448, 166.022796, 150.667448, 164.013737),\n (150.667448, 164.013737, 150.667448, 162.004678),\n (150.667448, 162.004678, 150.667448, 159.995618),\n (150.667448, 159.995618, 150.667448, 157.986559),\n (150.667448, 157.986559, 150.667448, 155.9775),\n (150.667448, 155.9775, 150.667448, 153.968441),\n (150.667448, 153.968441, 150.667448, 151.959382),\n (150.667448, 151.959382, 150.667448, 149.950322),\n (150.667448, 149.950322, 150.667448, 147.941263),\n (150.667448, 147.941263, 150.667448, 145.932204),\n (150.667448, 145.932204, 150.667448, 143.923145),\n (150.667448, 143.923145, 150.667448, 141.914085),\n (150.667448, 141.914085, 150.667448, 139.905026),\n (150.667448, 139.905026, 150.667448, 137.895967),\n (150.667448, 137.895967, 150.667448, 135.886908),\n (150.667448, 135.886908, 150.667448, 133.877848),\n (150.667448, 133.877848, 150.667448, 131.868789),\n (150.667448, 131.868789, 150.667448, 129.85973),\n (150.667448, 129.85973, 150.667448, 127.850671),\n (150.667448, 127.850671, 150.667448, 125.841611),\n (150.667448, 125.841611, 150.667448, 123.832552),\n (150.667448, 188.122448, 182.477552, 188.122448),\n (150.667448, 123.832552, 182.477552, 123.832552)\n]\nVISIBLE_CIRCLES = [\n (104.5225, 155.9775, 32.144948)\n]\nVISIBLE_ARCS = [\n\n]\nHIDDEN_SEGMENTS = [\n\n]\n# (orient, text, p1, p2, base) for linear; (orient, text, center, radius, angle) for diameter\nDIMENSIONS = [\n ('diameter', '%%c100', (104.5225, 155.9775), 32.1449, 45),\n ('horizontal', '49.4792', (182.4775, 155.9775), (150.6674, 155.9775), (166.5725, 144.9775))\n]\n\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\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\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,\n angle=(0 if d[0] == \"horizontal\" else 90),\n 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,\n text=text, dimstyle=\"EZDXF\").render()\n\n doc.saveas(out_path)\n\n\nif __name__ == \"__main__\":\n out = sys.argv[1] if len(sys.argv) > 1 else \"0079_00798853_gt.dxf\"\n draw(out)\n print(\"wrote\", out)\n```"}], "images": ["images/0079_00798853.png"], "id": "0079_00798853"} {"messages": [{"role": "user", "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 282.98 mm."}, {"role": "assistant", "content": "```python\n#!/usr/bin/env python3\n# -*- coding: utf-8 -*-\n# Ground-truth 2D engineering drawing for part: 0080_00800896\n# Self-contained: reproduces the three-view DXF via ezdxf, NO FreeCAD needed.\n# Coordinates are A4 page millimetres (scale=0.250927777777814, page=[297.0, 210.0]).\n# visible edges -> solid (layer OUTLINE); hidden edges -> dashed (layer HIDDEN)\n# dimensions -> real movable DIMENSION entities (text = true mm value)\n# Run: python 0080_00800896_gt.py [out.dxf]\nimport sys\nimport ezdxf\n\nSCALE = 0.250927777777814\nPAGE = [297.0, 210.0]\n\nVISIBLE_SEGMENTS = [\n (82.176811, 139.230411, 82.96096, 139.230411),\n (82.96096, 139.230411, 83.74511, 139.230411),\n (83.74511, 139.230411, 84.529259, 139.230411),\n (84.529259, 139.230411, 85.313408, 139.230411),\n (85.313408, 139.230411, 86.097558, 139.230411),\n (86.097558, 139.230411, 86.881707, 139.230411),\n (86.881707, 139.230411, 87.665856, 139.230411),\n (87.665856, 139.230411, 88.450006, 139.230411),\n (88.450006, 139.230411, 89.234155, 139.230411),\n (89.234155, 139.230411, 90.018304, 139.230411),\n (90.018304, 139.230411, 90.802453, 139.230411),\n (90.802453, 139.230411, 91.586603, 139.230411),\n (91.586603, 139.230411, 92.370752, 139.230411),\n (92.370752, 139.230411, 93.154901, 139.230411),\n (93.154901, 139.230411, 93.939051, 139.230411),\n (93.939051, 139.230411, 94.7232, 139.230411),\n (94.7232, 139.230411, 95.507349, 139.230411),\n (95.507349, 139.230411, 96.291499, 139.230411),\n (96.291499, 139.230411, 97.075648, 139.230411),\n (97.075648, 139.230411, 97.859797, 139.230411),\n (97.859797, 139.230411, 98.643947, 139.230411),\n (98.643947, 139.230411, 99.428096, 139.230411),\n (99.428096, 139.230411, 100.212245, 139.230411),\n (100.212245, 139.230411, 100.996394, 139.230411),\n (100.996394, 139.230411, 101.780544, 139.230411),\n (101.780544, 139.230411, 102.564693, 139.230411),\n (102.564693, 139.230411, 103.348842, 139.230411),\n (103.348842, 139.230411, 104.132992, 139.230411),\n (104.132992, 139.230411, 104.917141, 139.230411),\n (104.917141, 139.230411, 105.70129, 139.230411),\n (105.70129, 139.230411, 106.48544, 139.230411),\n (106.48544, 139.230411, 107.269589, 139.230411),\n (107.269589, 139.230411, 107.269589, 68.223189),\n (82.176811, 68.223189, 82.96096, 68.223189),\n (82.96096, 68.223189, 83.74511, 68.223189),\n (83.74511, 68.223189, 84.529259, 68.223189),\n (84.529259, 68.223189, 85.313408, 68.223189),\n (85.313408, 68.223189, 86.097558, 68.223189),\n (86.097558, 68.223189, 86.881707, 68.223189),\n (86.881707, 68.223189, 87.665856, 68.223189),\n (87.665856, 68.223189, 88.450006, 68.223189),\n (88.450006, 68.223189, 89.234155, 68.223189),\n (89.234155, 68.223189, 90.018304, 68.223189),\n (90.018304, 68.223189, 90.802453, 68.223189),\n (90.802453, 68.223189, 91.586603, 68.223189),\n (91.586603, 68.223189, 92.370752, 68.223189),\n (92.370752, 68.223189, 93.154901, 68.223189),\n (93.154901, 68.223189, 93.939051, 68.223189),\n (93.939051, 68.223189, 94.7232, 68.223189),\n (94.7232, 68.223189, 95.507349, 68.223189),\n (95.507349, 68.223189, 96.291499, 68.223189),\n (96.291499, 68.223189, 97.075648, 68.223189),\n (97.075648, 68.223189, 97.859797, 68.223189),\n (97.859797, 68.223189, 98.643947, 68.223189),\n (98.643947, 68.223189, 99.428096, 68.223189),\n (99.428096, 68.223189, 100.212245, 68.223189),\n (100.212245, 68.223189, 100.996394, 68.223189),\n (100.996394, 68.223189, 101.780544, 68.223189),\n (101.780544, 68.223189, 102.564693, 68.223189),\n (102.564693, 68.223189, 103.348842, 68.223189),\n (103.348842, 68.223189, 104.132992, 68.223189),\n (104.132992, 68.223189, 104.917141, 68.223189),\n (104.917141, 68.223189, 105.70129, 68.223189),\n (105.70129, 68.223189, 106.48544, 68.223189),\n (106.48544, 68.223189, 107.269589, 68.223189),\n (82.176811, 68.223189, 82.176811, 139.230411),\n (192.276811, 178.323189, 192.276811, 177.53904),\n (192.276811, 177.53904, 192.276811, 176.75489),\n (192.276811, 176.75489, 192.276811, 175.970741),\n (192.276811, 175.970741, 192.276811, 175.186592),\n (192.276811, 175.186592, 192.276811, 174.402442),\n (192.276811, 174.402442, 192.276811, 173.618293),\n (192.276811, 173.618293, 192.276811, 172.834144),\n (192.276811, 172.834144, 192.276811, 172.049994),\n (192.276811, 172.049994, 192.276811, 171.265845),\n (192.276811, 171.265845, 192.276811, 170.481696),\n (192.276811, 170.481696, 192.276811, 169.697547),\n (192.276811, 169.697547, 192.276811, 168.913397),\n (192.276811, 168.913397, 192.276811, 168.129248),\n (192.276811, 168.129248, 192.276811, 167.345099),\n (192.276811, 167.345099, 192.276811, 166.560949),\n (192.276811, 166.560949, 192.276811, 165.7768),\n (192.276811, 165.7768, 192.276811, 164.992651),\n (192.276811, 164.992651, 192.276811, 164.208501),\n (192.276811, 164.208501, 192.276811, 163.424352),\n (192.276811, 163.424352, 192.276811, 162.640203),\n (192.276811, 162.640203, 192.276811, 161.856053),\n (192.276811, 161.856053, 192.276811, 161.071904),\n (192.276811, 161.071904, 192.276811, 160.287755),\n (192.276811, 160.287755, 192.276811, 159.503606),\n (192.276811, 159.503606, 192.276811, 158.719456),\n (192.276811, 158.719456, 192.276811, 157.935307),\n (192.276811, 157.935307, 192.276811, 157.151158),\n (192.276811, 157.151158, 192.276811, 156.367008),\n (192.276811, 156.367008, 192.276811, 155.582859),\n (192.276811, 155.582859, 192.276811, 154.79871),\n (192.276811, 154.79871, 192.276811, 154.01456),\n (192.276811, 154.01456, 192.276811, 153.230411),\n (121.269589, 178.323189, 121.269589, 177.53904),\n (121.269589, 177.53904, 121.269589, 176.75489),\n (121.269589, 176.75489, 121.269589, 175.970741),\n (121.269589, 175.970741, 121.269589, 175.186592),\n (121.269589, 175.186592, 121.269589, 174.402442),\n (121.269589, 174.402442, 121.269589, 173.618293),\n (121.269589, 173.618293, 121.269589, 172.834144),\n (121.269589, 172.834144, 121.269589, 172.049994),\n (121.269589, 172.049994, 121.269589, 171.265845),\n (121.269589, 171.265845, 121.269589, 170.481696),\n (121.269589, 170.481696, 121.269589, 169.697547),\n (121.269589, 169.697547, 121.269589, 168.913397),\n (121.269589, 168.913397, 121.269589, 168.129248),\n (121.269589, 168.129248, 121.269589, 167.345099),\n (121.269589, 167.345099, 121.269589, 166.560949),\n (121.269589, 166.560949, 121.269589, 165.7768),\n (121.269589, 165.7768, 121.269589, 164.992651),\n (121.269589, 164.992651, 121.269589, 164.208501),\n (121.269589, 164.208501, 121.269589, 163.424352),\n (121.269589, 163.424352, 121.269589, 162.640203),\n (121.269589, 162.640203, 121.269589, 161.856053),\n (121.269589, 161.856053, 121.269589, 161.071904),\n (121.269589, 161.071904, 121.269589, 160.287755),\n (121.269589, 160.287755, 121.269589, 159.503606),\n (121.269589, 159.503606, 121.269589, 158.719456),\n (121.269589, 158.719456, 121.269589, 157.935307),\n (121.269589, 157.935307, 121.269589, 157.151158),\n (121.269589, 157.151158, 121.269589, 156.367008),\n (121.269589, 156.367008, 121.269589, 155.582859),\n (121.269589, 155.582859, 121.269589, 154.79871),\n (121.269589, 154.79871, 121.269589, 154.01456),\n (121.269589, 154.01456, 121.269589, 153.230411),\n (121.269589, 178.323189, 192.276811, 178.323189),\n (121.269589, 153.230411, 192.276811, 153.230411)\n]\nVISIBLE_CIRCLES = [\n (94.7232, 165.7768, 12.546389)\n]\nVISIBLE_ARCS = [\n\n]\nHIDDEN_SEGMENTS = [\n\n]\n# (orient, text, p1, p2, base) for linear; (orient, text, center, radius, angle) for diameter\nDIMENSIONS = [\n ('diameter', '%%c100', (94.7232, 165.7768), 12.5464, 45),\n ('horizontal', '282.979', (192.2768, 165.7768), (121.2696, 165.7768), (156.7732, 154.7768))\n]\n\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\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\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,\n angle=(0 if d[0] == \"horizontal\" else 90),\n 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,\n text=text, dimstyle=\"EZDXF\").render()\n\n doc.saveas(out_path)\n\n\nif __name__ == \"__main__\":\n out = sys.argv[1] if len(sys.argv) > 1 else \"0080_00800896_gt.dxf\"\n draw(out)\n print(\"wrote\", out)\n```"}], "images": ["images/0080_00800896.png"], "id": "0080_00800896"} {"messages": [{"role": "user", "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 452.38 mm."}, {"role": "assistant", "content": "```python\n#!/usr/bin/env python3\n# -*- coding: utf-8 -*-\n# Ground-truth 2D engineering drawing for part: 0080_00809063\n# Self-contained: reproduces the three-view DXF via ezdxf, NO FreeCAD needed.\n# Coordinates are A4 page millimetres (scale=0.173974137931051, page=[297.0, 210.0]).\n# visible edges -> solid (layer OUTLINE); hidden edges -> dashed (layer HIDDEN)\n# dimensions -> real movable DIMENSION entities (text = true mm value)\n# Run: python 0080_00809063_gt.py [out.dxf]\nimport sys\nimport ezdxf\n\nSCALE = 0.173974137931051\nPAGE = [297.0, 210.0]\n\nVISIBLE_SEGMENTS = [\n (84.100693, 145.001893, 84.644362, 145.001893),\n (84.644362, 145.001893, 85.188031, 145.001893),\n (85.188031, 145.001893, 85.731701, 145.001893),\n (85.731701, 145.001893, 86.27537, 145.001893),\n (86.27537, 145.001893, 86.819039, 145.001893),\n (86.819039, 145.001893, 87.362708, 145.001893),\n (87.362708, 145.001893, 87.906377, 145.001893),\n (87.906377, 145.001893, 88.450047, 145.001893),\n (88.450047, 145.001893, 88.993716, 145.001893),\n (88.993716, 145.001893, 89.537385, 145.001893),\n (89.537385, 145.001893, 90.081054, 145.001893),\n (90.081054, 145.001893, 90.624723, 145.001893),\n (90.624723, 145.001893, 91.168392, 145.001893),\n (91.168392, 145.001893, 91.712062, 145.001893),\n (91.712062, 145.001893, 92.255731, 145.001893),\n (92.255731, 145.001893, 92.7994, 145.001893),\n (92.7994, 145.001893, 93.343069, 145.001893),\n (93.343069, 145.001893, 93.886738, 145.001893),\n (93.886738, 145.001893, 94.430408, 145.001893),\n (94.430408, 145.001893, 94.974077, 145.001893),\n (94.974077, 145.001893, 95.517746, 145.001893),\n (95.517746, 145.001893, 96.061415, 145.001893),\n (96.061415, 145.001893, 96.605084, 145.001893),\n (96.605084, 145.001893, 97.148753, 145.001893),\n (97.148753, 145.001893, 97.692423, 145.001893),\n (97.692423, 145.001893, 98.236092, 145.001893),\n (98.236092, 145.001893, 98.779761, 145.001893),\n (98.779761, 145.001893, 99.32343, 145.001893),\n (99.32343, 145.001893, 99.867099, 145.001893),\n (99.867099, 145.001893, 100.410769, 145.001893),\n (100.410769, 145.001893, 100.954438, 145.001893),\n (100.954438, 145.001893, 101.498107, 145.001893),\n (101.498107, 145.001893, 101.498107, 66.299307),\n (84.100693, 66.299307, 84.644362, 66.299307),\n (84.644362, 66.299307, 85.188031, 66.299307),\n (85.188031, 66.299307, 85.731701, 66.299307),\n (85.731701, 66.299307, 86.27537, 66.299307),\n (86.27537, 66.299307, 86.819039, 66.299307),\n (86.819039, 66.299307, 87.362708, 66.299307),\n (87.362708, 66.299307, 87.906377, 66.299307),\n (87.906377, 66.299307, 88.450047, 66.299307),\n (88.450047, 66.299307, 88.993716, 66.299307),\n (88.993716, 66.299307, 89.537385, 66.299307),\n (89.537385, 66.299307, 90.081054, 66.299307),\n (90.081054, 66.299307, 90.624723, 66.299307),\n (90.624723, 66.299307, 91.168392, 66.299307),\n (91.168392, 66.299307, 91.712062, 66.299307),\n (91.712062, 66.299307, 92.255731, 66.299307),\n (92.255731, 66.299307, 92.7994, 66.299307),\n (92.7994, 66.299307, 93.343069, 66.299307),\n (93.343069, 66.299307, 93.886738, 66.299307),\n (93.886738, 66.299307, 94.430408, 66.299307),\n (94.430408, 66.299307, 94.974077, 66.299307),\n (94.974077, 66.299307, 95.517746, 66.299307),\n (95.517746, 66.299307, 96.061415, 66.299307),\n (96.061415, 66.299307, 96.605084, 66.299307),\n (96.605084, 66.299307, 97.148753, 66.299307),\n (97.148753, 66.299307, 97.692423, 66.299307),\n (97.692423, 66.299307, 98.236092, 66.299307),\n (98.236092, 66.299307, 98.779761, 66.299307),\n (98.779761, 66.299307, 99.32343, 66.299307),\n (99.32343, 66.299307, 99.867099, 66.299307),\n (99.867099, 66.299307, 100.410769, 66.299307),\n (100.410769, 66.299307, 100.954438, 66.299307),\n (100.954438, 66.299307, 101.498107, 66.299307),\n (84.100693, 66.299307, 84.100693, 145.001893),\n (194.200693, 176.399307, 194.200693, 175.855638),\n (194.200693, 175.855638, 194.200693, 175.311969),\n (194.200693, 175.311969, 194.200693, 174.768299),\n (194.200693, 174.768299, 194.200693, 174.22463),\n (194.200693, 174.22463, 194.200693, 173.680961),\n (194.200693, 173.680961, 194.200693, 173.137292),\n (194.200693, 173.137292, 194.200693, 172.593623),\n (194.200693, 172.593623, 194.200693, 172.049953),\n (194.200693, 172.049953, 194.200693, 171.506284),\n (194.200693, 171.506284, 194.200693, 170.962615),\n (194.200693, 170.962615, 194.200693, 170.418946),\n (194.200693, 170.418946, 194.200693, 169.875277),\n (194.200693, 169.875277, 194.200693, 169.331608),\n (194.200693, 169.331608, 194.200693, 168.787938),\n (194.200693, 168.787938, 194.200693, 168.244269),\n (194.200693, 168.244269, 194.200693, 167.7006),\n (194.200693, 167.7006, 194.200693, 167.156931),\n (194.200693, 167.156931, 194.200693, 166.613262),\n (194.200693, 166.613262, 194.200693, 166.069592),\n (194.200693, 166.069592, 194.200693, 165.525923),\n (194.200693, 165.525923, 194.200693, 164.982254),\n (194.200693, 164.982254, 194.200693, 164.438585),\n (194.200693, 164.438585, 194.200693, 163.894916),\n (194.200693, 163.894916, 194.200693, 163.351247),\n (194.200693, 163.351247, 194.200693, 162.807577),\n (194.200693, 162.807577, 194.200693, 162.263908),\n (194.200693, 162.263908, 194.200693, 161.720239),\n (194.200693, 161.720239, 194.200693, 161.17657),\n (194.200693, 161.17657, 194.200693, 160.632901),\n (194.200693, 160.632901, 194.200693, 160.089231),\n (194.200693, 160.089231, 194.200693, 159.545562),\n (194.200693, 159.545562, 194.200693, 159.001893),\n (115.498107, 176.399307, 115.498107, 175.855638),\n (115.498107, 175.855638, 115.498107, 175.311969),\n (115.498107, 175.311969, 115.498107, 174.768299),\n (115.498107, 174.768299, 115.498107, 174.22463),\n (115.498107, 174.22463, 115.498107, 173.680961),\n (115.498107, 173.680961, 115.498107, 173.137292),\n (115.498107, 173.137292, 115.498107, 172.593623),\n (115.498107, 172.593623, 115.498107, 172.049953),\n (115.498107, 172.049953, 115.498107, 171.506284),\n (115.498107, 171.506284, 115.498107, 170.962615),\n (115.498107, 170.962615, 115.498107, 170.418946),\n (115.498107, 170.418946, 115.498107, 169.875277),\n (115.498107, 169.875277, 115.498107, 169.331608),\n (115.498107, 169.331608, 115.498107, 168.787938),\n (115.498107, 168.787938, 115.498107, 168.244269),\n (115.498107, 168.244269, 115.498107, 167.7006),\n (115.498107, 167.7006, 115.498107, 167.156931),\n (115.498107, 167.156931, 115.498107, 166.613262),\n (115.498107, 166.613262, 115.498107, 166.069592),\n (115.498107, 166.069592, 115.498107, 165.525923),\n (115.498107, 165.525923, 115.498107, 164.982254),\n (115.498107, 164.982254, 115.498107, 164.438585),\n (115.498107, 164.438585, 115.498107, 163.894916),\n (115.498107, 163.894916, 115.498107, 163.351247),\n (115.498107, 163.351247, 115.498107, 162.807577),\n (115.498107, 162.807577, 115.498107, 162.263908),\n (115.498107, 162.263908, 115.498107, 161.720239),\n (115.498107, 161.720239, 115.498107, 161.17657),\n (115.498107, 161.17657, 115.498107, 160.632901),\n (115.498107, 160.632901, 115.498107, 160.089231),\n (115.498107, 160.089231, 115.498107, 159.545562),\n (115.498107, 159.545562, 115.498107, 159.001893),\n (115.498107, 176.399307, 194.200693, 176.399307),\n (115.498107, 159.001893, 194.200693, 159.001893)\n]\nVISIBLE_CIRCLES = [\n (92.7994, 167.7006, 8.698707)\n]\nVISIBLE_ARCS = [\n\n]\nHIDDEN_SEGMENTS = [\n\n]\n# (orient, text, p1, p2, base) for linear; (orient, text, center, radius, angle) for diameter\nDIMENSIONS = [\n ('diameter', '%%c100', (92.7994, 167.7006), 8.6987, 45),\n ('horizontal', '452.381', (194.2006, 167.7006), (115.4981, 167.7006), (154.8493, 156.7006))\n]\n\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\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\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,\n angle=(0 if d[0] == \"horizontal\" else 90),\n 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,\n text=text, dimstyle=\"EZDXF\").render()\n\n doc.saveas(out_path)\n\n\nif __name__ == \"__main__\":\n out = sys.argv[1] if len(sys.argv) > 1 else \"0080_00809063_gt.dxf\"\n draw(out)\n print(\"wrote\", out)\n```"}], "images": ["images/0080_00809063.png"], "id": "0080_00809063"} {"messages": [{"role": "user", "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 27.3 mm."}, {"role": "assistant", "content": "```python\n#!/usr/bin/env python3\n# -*- coding: utf-8 -*-\n# Ground-truth 2D engineering drawing for part: 0081_00810255\n# Self-contained: reproduces the three-view DXF via ezdxf, NO FreeCAD needed.\n# Coordinates are A4 page millimetres (scale=0.7347, page=[297.0, 210.0]).\n# visible edges -> solid (layer OUTLINE); hidden edges -> dashed (layer HIDDEN)\n# dimensions -> real movable DIMENSION entities (text = true mm value)\n# Run: python 0081_00810255_gt.py [out.dxf]\nimport sys\nimport ezdxf\n\nSCALE = 0.7347\nPAGE = [297.0, 210.0]\n\nVISIBLE_SEGMENTS = [\n (71.3692, 101.6607, 73.665138, 101.6607),\n (73.665138, 101.6607, 75.961075, 101.6607),\n (75.961075, 101.6607, 78.257013, 101.6607),\n (78.257013, 101.6607, 80.55295, 101.6607),\n (80.55295, 101.6607, 82.848888, 101.6607),\n (82.848888, 101.6607, 85.144825, 101.6607),\n (85.144825, 101.6607, 87.440763, 101.6607),\n (87.440763, 101.6607, 89.7367, 101.6607),\n (89.7367, 101.6607, 92.032638, 101.6607),\n (92.032638, 101.6607, 94.328575, 101.6607),\n (94.328575, 101.6607, 96.624513, 101.6607),\n (96.624513, 101.6607, 98.92045, 101.6607),\n (98.92045, 101.6607, 101.216388, 101.6607),\n (101.216388, 101.6607, 103.512325, 101.6607),\n (103.512325, 101.6607, 105.808263, 101.6607),\n (105.808263, 101.6607, 108.1042, 101.6607),\n (108.1042, 101.6607, 110.400137, 101.6607),\n (110.400137, 101.6607, 112.696075, 101.6607),\n (112.696075, 101.6607, 114.992012, 101.6607),\n (114.992012, 101.6607, 117.28795, 101.6607),\n (117.28795, 101.6607, 119.583888, 101.6607),\n (119.583888, 101.6607, 121.879825, 101.6607),\n (121.879825, 101.6607, 124.175763, 101.6607),\n (124.175763, 101.6607, 126.4717, 101.6607),\n (126.4717, 101.6607, 128.767638, 101.6607),\n (128.767638, 101.6607, 131.063575, 101.6607),\n (131.063575, 101.6607, 133.359513, 101.6607),\n (133.359513, 101.6607, 135.65545, 101.6607),\n (135.65545, 101.6607, 137.951388, 101.6607),\n (137.951388, 101.6607, 140.247325, 101.6607),\n (140.247325, 101.6607, 142.543263, 101.6607),\n (142.543263, 101.6607, 144.8392, 101.6607),\n (144.8392, 101.6607, 144.8392, 81.604234),\n (71.3692, 81.604234, 73.665138, 81.604234),\n (73.665138, 81.604234, 75.961075, 81.604234),\n (75.961075, 81.604234, 78.257013, 81.604234),\n (78.257013, 81.604234, 80.55295, 81.604234),\n (80.55295, 81.604234, 82.848888, 81.604234),\n (82.848888, 81.604234, 85.144825, 81.604234),\n (85.144825, 81.604234, 87.440763, 81.604234),\n (87.440763, 81.604234, 89.7367, 81.604234),\n (89.7367, 81.604234, 92.032638, 81.604234),\n (92.032638, 81.604234, 94.328575, 81.604234),\n (94.328575, 81.604234, 96.624513, 81.604234),\n (96.624513, 81.604234, 98.92045, 81.604234),\n (98.92045, 81.604234, 101.216388, 81.604234),\n (101.216388, 81.604234, 103.512325, 81.604234),\n (103.512325, 81.604234, 105.808263, 81.604234),\n (105.808263, 81.604234, 108.1042, 81.604234),\n (108.1042, 81.604234, 110.400137, 81.604234),\n (110.400137, 81.604234, 112.696075, 81.604234),\n (112.696075, 81.604234, 114.992012, 81.604234),\n (114.992012, 81.604234, 117.28795, 81.604234),\n (117.28795, 81.604234, 119.583888, 81.604234),\n (119.583888, 81.604234, 121.879825, 81.604234),\n (121.879825, 81.604234, 124.175763, 81.604234),\n (124.175763, 81.604234, 126.4717, 81.604234),\n (126.4717, 81.604234, 128.767638, 81.604234),\n (128.767638, 81.604234, 131.063575, 81.604234),\n (131.063575, 81.604234, 133.359513, 81.604234),\n (133.359513, 81.604234, 135.65545, 81.604234),\n (135.65545, 81.604234, 137.951388, 81.604234),\n (137.951388, 81.604234, 140.247325, 81.604234),\n (140.247325, 81.604234, 142.543263, 81.604234),\n (142.543263, 81.604234, 144.8392, 81.604234),\n (71.3692, 81.604234, 71.3692, 101.6607),\n (178.895666, 189.1307, 178.895666, 186.834763),\n (178.895666, 186.834763, 178.895666, 184.538825),\n (178.895666, 184.538825, 178.895666, 182.242888),\n (178.895666, 182.242888, 178.895666, 179.94695),\n (178.895666, 179.94695, 178.895666, 177.651013),\n (178.895666, 177.651013, 178.895666, 175.355075),\n (178.895666, 175.355075, 178.895666, 173.059138),\n (178.895666, 173.059138, 178.895666, 170.7632),\n (178.895666, 170.7632, 178.895666, 168.467263),\n (178.895666, 168.467263, 178.895666, 166.171325),\n (178.895666, 166.171325, 178.895666, 163.875388),\n (178.895666, 163.875388, 178.895666, 161.57945),\n (178.895666, 161.57945, 178.895666, 159.283513),\n (178.895666, 159.283513, 178.895666, 156.987575),\n (178.895666, 156.987575, 178.895666, 154.691638),\n (178.895666, 154.691638, 178.895666, 152.3957),\n (178.895666, 152.3957, 178.895666, 150.099762),\n (178.895666, 150.099762, 178.895666, 147.803825),\n (178.895666, 147.803825, 178.895666, 145.507888),\n (178.895666, 145.507888, 178.895666, 143.21195),\n (178.895666, 143.21195, 178.895666, 140.916013),\n (178.895666, 140.916013, 178.895666, 138.620075),\n (178.895666, 138.620075, 178.895666, 136.324138),\n (178.895666, 136.324138, 178.895666, 134.0282),\n (178.895666, 134.0282, 178.895666, 131.732263),\n (178.895666, 131.732263, 178.895666, 129.436325),\n (178.895666, 129.436325, 178.895666, 127.140388),\n (178.895666, 127.140388, 178.895666, 124.84445),\n (178.895666, 124.84445, 178.895666, 122.548513),\n (178.895666, 122.548513, 178.895666, 120.252575),\n (178.895666, 120.252575, 178.895666, 117.956638),\n (178.895666, 117.956638, 178.895666, 115.6607),\n (158.8392, 189.1307, 158.8392, 186.834763),\n (158.8392, 186.834763, 158.8392, 184.538825),\n (158.8392, 184.538825, 158.8392, 182.242888),\n (158.8392, 182.242888, 158.8392, 179.94695),\n (158.8392, 179.94695, 158.8392, 177.651013),\n (158.8392, 177.651013, 158.8392, 175.355075),\n (158.8392, 175.355075, 158.8392, 173.059138),\n (158.8392, 173.059138, 158.8392, 170.7632),\n (158.8392, 170.7632, 158.8392, 168.467263),\n (158.8392, 168.467263, 158.8392, 166.171325),\n (158.8392, 166.171325, 158.8392, 163.875388),\n (158.8392, 163.875388, 158.8392, 161.57945),\n (158.8392, 161.57945, 158.8392, 159.283513),\n (158.8392, 159.283513, 158.8392, 156.987575),\n (158.8392, 156.987575, 158.8392, 154.691638),\n (158.8392, 154.691638, 158.8392, 152.3957),\n (158.8392, 152.3957, 158.8392, 150.099763),\n (158.8392, 150.099763, 158.8392, 147.803825),\n (158.8392, 147.803825, 158.8392, 145.507888),\n (158.8392, 145.507888, 158.8392, 143.21195),\n (158.8392, 143.21195, 158.8392, 140.916013),\n (158.8392, 140.916013, 158.8392, 138.620075),\n (158.8392, 138.620075, 158.8392, 136.324138),\n (158.8392, 136.324138, 158.8392, 134.0282),\n (158.8392, 134.0282, 158.8392, 131.732263),\n (158.8392, 131.732263, 158.8392, 129.436325),\n (158.8392, 129.436325, 158.8392, 127.140388),\n (158.8392, 127.140388, 158.8392, 124.84445),\n (158.8392, 124.84445, 158.8392, 122.548513),\n (158.8392, 122.548513, 158.8392, 120.252575),\n (158.8392, 120.252575, 158.8392, 117.956638),\n (158.8392, 117.956638, 158.8392, 115.6607),\n (158.8392, 189.1307, 178.895666, 189.1307),\n (158.8392, 115.6607, 178.895666, 115.6607)\n]\nVISIBLE_CIRCLES = [\n (108.1042, 152.3957, 36.735)\n]\nVISIBLE_ARCS = [\n\n]\nHIDDEN_SEGMENTS = [\n\n]\n# (orient, text, p1, p2, base) for linear; (orient, text, center, radius, angle) for diameter\nDIMENSIONS = [\n ('diameter', '%%c100', (108.1042, 152.3957), 36.735, 45),\n ('horizontal', '27.2989', (178.8957, 152.3957), (158.8392, 152.3957), (168.8675, 141.3957))\n]\n\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\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\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,\n angle=(0 if d[0] == \"horizontal\" else 90),\n 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,\n text=text, dimstyle=\"EZDXF\").render()\n\n doc.saveas(out_path)\n\n\nif __name__ == \"__main__\":\n out = sys.argv[1] if len(sys.argv) > 1 else \"0081_00810255_gt.dxf\"\n draw(out)\n print(\"wrote\", out)\n```"}], "images": ["images/0081_00810255.png"], "id": "0081_00810255"} {"messages": [{"role": "user", "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 31.44 mm."}, {"role": "assistant", "content": "```python\n#!/usr/bin/env python3\n# -*- coding: utf-8 -*-\n# Ground-truth 2D engineering drawing for part: 0081_00812368\n# Self-contained: reproduces the three-view DXF via ezdxf, NO FreeCAD needed.\n# Coordinates are A4 page millimetres (scale=0.7311327031823986, page=[297.0, 210.0]).\n# visible edges -> solid (layer OUTLINE); hidden edges -> dashed (layer HIDDEN)\n# dimensions -> real movable DIMENSION entities (text = true mm value)\n# Run: python 0081_00812368_gt.py [out.dxf]\nimport sys\nimport ezdxf\n\nSCALE = 0.7311327031823986\nPAGE = [297.0, 210.0]\n\nVISIBLE_SEGMENTS = [\n (143.284935, 80.228335, 141.000145, 80.228335),\n (141.000145, 80.228335, 138.715356, 80.228335),\n (138.715356, 80.228335, 136.430566, 80.228335),\n (136.430566, 80.228335, 134.145776, 80.228335),\n (134.145776, 80.228335, 131.860987, 80.228335),\n (131.860987, 80.228335, 129.576197, 80.228335),\n (129.576197, 80.228335, 127.291407, 80.228335),\n (127.291407, 80.228335, 125.006618, 80.228335),\n (125.006618, 80.228335, 122.721828, 80.228335),\n (122.721828, 80.228335, 120.437038, 80.228335),\n (120.437038, 80.228335, 118.152248, 80.228335),\n (118.152248, 80.228335, 115.867459, 80.228335),\n (115.867459, 80.228335, 113.582669, 80.228335),\n (113.582669, 80.228335, 111.297879, 80.228335),\n (111.297879, 80.228335, 109.01309, 80.228335),\n (109.01309, 80.228335, 106.7283, 80.228335),\n (106.7283, 80.228335, 104.44351, 80.228335),\n (104.44351, 80.228335, 102.158721, 80.228335),\n (102.158721, 80.228335, 99.873931, 80.228335),\n (99.873931, 80.228335, 97.589141, 80.228335),\n (97.589141, 80.228335, 95.304352, 80.228335),\n (95.304352, 80.228335, 93.019562, 80.228335),\n (93.019562, 80.228335, 90.734772, 80.228335),\n (90.734772, 80.228335, 88.449982, 80.228335),\n (88.449982, 80.228335, 86.165193, 80.228335),\n (86.165193, 80.228335, 83.880403, 80.228335),\n (83.880403, 80.228335, 81.595613, 80.228335),\n (81.595613, 80.228335, 79.310824, 80.228335),\n (79.310824, 80.228335, 77.026034, 80.228335),\n (77.026034, 80.228335, 74.741244, 80.228335),\n (74.741244, 80.228335, 72.456455, 80.228335),\n (72.456455, 80.228335, 70.171665, 80.228335),\n (143.284935, 80.228335, 143.284935, 103.215065),\n (143.284935, 103.215065, 141.000145, 103.215065),\n (141.000145, 103.215065, 138.715356, 103.215065),\n (138.715356, 103.215065, 136.430566, 103.215065),\n (136.430566, 103.215065, 134.145776, 103.215065),\n (134.145776, 103.215065, 131.860987, 103.215065),\n (131.860987, 103.215065, 129.576197, 103.215065),\n (129.576197, 103.215065, 127.291407, 103.215065),\n (127.291407, 103.215065, 125.006618, 103.215065),\n (125.006618, 103.215065, 122.721828, 103.215065),\n (122.721828, 103.215065, 120.437038, 103.215065),\n (120.437038, 103.215065, 118.152248, 103.215065),\n (118.152248, 103.215065, 115.867459, 103.215065),\n (115.867459, 103.215065, 113.582669, 103.215065),\n (113.582669, 103.215065, 111.297879, 103.215065),\n (111.297879, 103.215065, 109.01309, 103.215065),\n (109.01309, 103.215065, 106.7283, 103.215065),\n (106.7283, 103.215065, 104.44351, 103.215065),\n (104.44351, 103.215065, 102.158721, 103.215065),\n (102.158721, 103.215065, 99.873931, 103.215065),\n (99.873931, 103.215065, 97.589141, 103.215065),\n (97.589141, 103.215065, 95.304352, 103.215065),\n (95.304352, 103.215065, 93.019562, 103.215065),\n (93.019562, 103.215065, 90.734772, 103.215065),\n (90.734772, 103.215065, 88.449982, 103.215065),\n (88.449982, 103.215065, 86.165193, 103.215065),\n (86.165193, 103.215065, 83.880403, 103.215065),\n (83.880403, 103.215065, 81.595613, 103.215065),\n (81.595613, 103.215065, 79.310824, 103.215065),\n (79.310824, 103.215065, 77.026034, 103.215065),\n (77.026034, 103.215065, 74.741244, 103.215065),\n (74.741244, 103.215065, 72.456455, 103.215065),\n (72.456455, 103.215065, 70.171665, 103.215065),\n (70.171665, 103.215065, 70.171665, 80.228335),\n (157.284935, 117.215065, 157.284935, 119.499855),\n (157.284935, 119.499855, 157.284935, 121.784644),\n (157.284935, 121.784644, 157.284935, 124.069434),\n (157.284935, 124.069434, 157.284935, 126.354224),\n (157.284935, 126.354224, 157.284935, 128.639013),\n (157.284935, 128.639013, 157.284935, 130.923803),\n (157.284935, 130.923803, 157.284935, 133.208593),\n (157.284935, 133.208593, 157.284935, 135.493382),\n (157.284935, 135.493382, 157.284935, 137.778172),\n (157.284935, 137.778172, 157.284935, 140.062962),\n (157.284935, 140.062962, 157.284935, 142.347752),\n (157.284935, 142.347752, 157.284935, 144.632541),\n (157.284935, 144.632541, 157.284935, 146.917331),\n (157.284935, 146.917331, 157.284935, 149.202121),\n (157.284935, 149.202121, 157.284935, 151.48691),\n (157.284935, 151.48691, 157.284935, 153.7717),\n (157.284935, 153.7717, 157.284935, 156.05649),\n (157.284935, 156.05649, 157.284935, 158.341279),\n (157.284935, 158.341279, 157.284935, 160.626069),\n (157.284935, 160.626069, 157.284935, 162.910859),\n (157.284935, 162.910859, 157.284935, 165.195648),\n (157.284935, 165.195648, 157.284935, 167.480438),\n (157.284935, 167.480438, 157.284935, 169.765228),\n (157.284935, 169.765228, 157.284935, 172.050018),\n (157.284935, 172.050018, 157.284935, 174.334807),\n (157.284935, 174.334807, 157.284935, 176.619597),\n (157.284935, 176.619597, 157.284935, 178.904387),\n (157.284935, 178.904387, 157.284935, 181.189176),\n (157.284935, 181.189176, 157.284935, 183.473966),\n (157.284935, 183.473966, 157.284935, 185.758756),\n (157.284935, 185.758756, 157.284935, 188.043545),\n (157.284935, 188.043545, 157.284935, 190.328335),\n (180.271665, 117.215065, 180.271665, 119.499855),\n (180.271665, 119.499855, 180.271665, 121.784644),\n (180.271665, 121.784644, 180.271665, 124.069434),\n (180.271665, 124.069434, 180.271665, 126.354224),\n (180.271665, 126.354224, 180.271665, 128.639013),\n (180.271665, 128.639013, 180.271665, 130.923803),\n (180.271665, 130.923803, 180.271665, 133.208593),\n (180.271665, 133.208593, 180.271665, 135.493382),\n (180.271665, 135.493382, 180.271665, 137.778172),\n (180.271665, 137.778172, 180.271665, 140.062962),\n (180.271665, 140.062962, 180.271665, 142.347752),\n (180.271665, 142.347752, 180.271665, 144.632541),\n (180.271665, 144.632541, 180.271665, 146.917331),\n (180.271665, 146.917331, 180.271665, 149.202121),\n (180.271665, 149.202121, 180.271665, 151.48691),\n (180.271665, 151.48691, 180.271665, 153.7717),\n (180.271665, 153.7717, 180.271665, 156.05649),\n (180.271665, 156.05649, 180.271665, 158.341279),\n (180.271665, 158.341279, 180.271665, 160.626069),\n (180.271665, 160.626069, 180.271665, 162.910859),\n (180.271665, 162.910859, 180.271665, 165.195648),\n (180.271665, 165.195648, 180.271665, 167.480438),\n (180.271665, 167.480438, 180.271665, 169.765228),\n (180.271665, 169.765228, 180.271665, 172.050018),\n (180.271665, 172.050018, 180.271665, 174.334807),\n (180.271665, 174.334807, 180.271665, 176.619597),\n (180.271665, 176.619597, 180.271665, 178.904387),\n (180.271665, 178.904387, 180.271665, 181.189176),\n (180.271665, 181.189176, 180.271665, 183.473966),\n (180.271665, 183.473966, 180.271665, 185.758756),\n (180.271665, 185.758756, 180.271665, 188.043545),\n (180.271665, 188.043545, 180.271665, 190.328335),\n (180.271665, 117.215065, 157.284935, 117.215065),\n (180.271665, 190.328335, 157.284935, 190.328335)\n]\nVISIBLE_CIRCLES = [\n (106.7283, 153.7717, 36.556635)\n]\nVISIBLE_ARCS = [\n\n]\nHIDDEN_SEGMENTS = [\n\n]\n# (orient, text, p1, p2, base) for linear; (orient, text, center, radius, angle) for diameter\nDIMENSIONS = [\n ('diameter', '%%c100', (106.7283, 153.7717), 36.5566, 45),\n ('horizontal', '31.4399', (157.285, 153.7717), (180.2717, 153.7717), (168.7783, 164.7717))\n]\n\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\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\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,\n angle=(0 if d[0] == \"horizontal\" else 90),\n 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,\n text=text, dimstyle=\"EZDXF\").render()\n\n doc.saveas(out_path)\n\n\nif __name__ == \"__main__\":\n out = sys.argv[1] if len(sys.argv) > 1 else \"0081_00812368_gt.dxf\"\n draw(out)\n print(\"wrote\", out)\n```"}], "images": ["images/0081_00812368.png"], "id": "0081_00812368"} {"messages": [{"role": "user", "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 13.92 mm."}, {"role": "assistant", "content": "```python\n#!/usr/bin/env python3\n# -*- coding: utf-8 -*-\n# Ground-truth 2D engineering drawing for part: 0081_00814461\n# Self-contained: reproduces the three-view DXF via ezdxf, NO FreeCAD needed.\n# Coordinates are A4 page millimetres (scale=0.7347, page=[297.0, 210.0]).\n# visible edges -> solid (layer OUTLINE); hidden edges -> dashed (layer HIDDEN)\n# dimensions -> real movable DIMENSION entities (text = true mm value)\n# Run: python 0081_00814461_gt.py [out.dxf]\nimport sys\nimport ezdxf\n\nSCALE = 0.7347\nPAGE = [297.0, 210.0]\n\nVISIBLE_SEGMENTS = [\n (76.2854, 96.7445, 78.581337, 96.7445),\n (78.581337, 96.7445, 80.877275, 96.7445),\n (80.877275, 96.7445, 83.173212, 96.7445),\n (83.173212, 96.7445, 85.46915, 96.7445),\n (85.46915, 96.7445, 87.765087, 96.7445),\n (87.765087, 96.7445, 90.061025, 96.7445),\n (90.061025, 96.7445, 92.356962, 96.7445),\n (92.356962, 96.7445, 94.6529, 96.7445),\n (94.6529, 96.7445, 96.948838, 96.7445),\n (96.948838, 96.7445, 99.244775, 96.7445),\n (99.244775, 96.7445, 101.540713, 96.7445),\n (101.540713, 96.7445, 103.83665, 96.7445),\n (103.83665, 96.7445, 106.132588, 96.7445),\n (106.132588, 96.7445, 108.428525, 96.7445),\n (108.428525, 96.7445, 110.724463, 96.7445),\n (110.724463, 96.7445, 113.0204, 96.7445),\n (113.0204, 96.7445, 115.316337, 96.7445),\n (115.316337, 96.7445, 117.612275, 96.7445),\n (117.612275, 96.7445, 119.908212, 96.7445),\n (119.908212, 96.7445, 122.20415, 96.7445),\n (122.20415, 96.7445, 124.500088, 96.7445),\n (124.500088, 96.7445, 126.796025, 96.7445),\n (126.796025, 96.7445, 129.091963, 96.7445),\n (129.091963, 96.7445, 131.3879, 96.7445),\n (131.3879, 96.7445, 133.683838, 96.7445),\n (133.683838, 96.7445, 135.979775, 96.7445),\n (135.979775, 96.7445, 138.275713, 96.7445),\n (138.275713, 96.7445, 140.57165, 96.7445),\n (140.57165, 96.7445, 142.867588, 96.7445),\n (142.867588, 96.7445, 145.163525, 96.7445),\n (145.163525, 96.7445, 147.459463, 96.7445),\n (147.459463, 96.7445, 149.7554, 96.7445),\n (149.7554, 96.7445, 149.7554, 86.520403),\n (76.2854, 86.520403, 78.581337, 86.520403),\n (78.581337, 86.520403, 80.877275, 86.520403),\n (80.877275, 86.520403, 83.173212, 86.520403),\n (83.173212, 86.520403, 85.46915, 86.520403),\n (85.46915, 86.520403, 87.765087, 86.520403),\n (87.765087, 86.520403, 90.061025, 86.520403),\n (90.061025, 86.520403, 92.356962, 86.520403),\n (92.356962, 86.520403, 94.6529, 86.520403),\n (94.6529, 86.520403, 96.948838, 86.520403),\n (96.948838, 86.520403, 99.244775, 86.520403),\n (99.244775, 86.520403, 101.540713, 86.520403),\n (101.540713, 86.520403, 103.83665, 86.520403),\n (103.83665, 86.520403, 106.132588, 86.520403),\n (106.132588, 86.520403, 108.428525, 86.520403),\n (108.428525, 86.520403, 110.724463, 86.520403),\n (110.724463, 86.520403, 113.0204, 86.520403),\n (113.0204, 86.520403, 115.316337, 86.520403),\n (115.316337, 86.520403, 117.612275, 86.520403),\n (117.612275, 86.520403, 119.908212, 86.520403),\n (119.908212, 86.520403, 122.20415, 86.520403),\n (122.20415, 86.520403, 124.500088, 86.520403),\n (124.500088, 86.520403, 126.796025, 86.520403),\n (126.796025, 86.520403, 129.091963, 86.520403),\n (129.091963, 86.520403, 131.3879, 86.520403),\n (131.3879, 86.520403, 133.683838, 86.520403),\n (133.683838, 86.520403, 135.979775, 86.520403),\n (135.979775, 86.520403, 138.275713, 86.520403),\n (138.275713, 86.520403, 140.57165, 86.520403),\n (140.57165, 86.520403, 142.867588, 86.520403),\n (142.867588, 86.520403, 145.163525, 86.520403),\n (145.163525, 86.520403, 147.459463, 86.520403),\n (147.459463, 86.520403, 149.7554, 86.520403),\n (76.2854, 86.520403, 76.2854, 96.7445),\n (173.979497, 184.2145, 173.979497, 181.918563),\n (173.979497, 181.918563, 173.979497, 179.622625),\n (173.979497, 179.622625, 173.979497, 177.326688),\n (173.979497, 177.326688, 173.979497, 175.03075),\n (173.979497, 175.03075, 173.979497, 172.734813),\n (173.979497, 172.734813, 173.979497, 170.438875),\n (173.979497, 170.438875, 173.979497, 168.142938),\n (173.979497, 168.142938, 173.979497, 165.847),\n (173.979497, 165.847, 173.979497, 163.551063),\n (173.979497, 163.551063, 173.979497, 161.255125),\n (173.979497, 161.255125, 173.979497, 158.959188),\n (173.979497, 158.959188, 173.979497, 156.66325),\n (173.979497, 156.66325, 173.979497, 154.367313),\n (173.979497, 154.367313, 173.979497, 152.071375),\n (173.979497, 152.071375, 173.979497, 149.775438),\n (173.979497, 149.775438, 173.979497, 147.4795),\n (173.979497, 147.4795, 173.979497, 145.183562),\n (173.979497, 145.183562, 173.979497, 142.887625),\n (173.979497, 142.887625, 173.979497, 140.591688),\n (173.979497, 140.591688, 173.979497, 138.29575),\n (173.979497, 138.29575, 173.979497, 135.999813),\n (173.979497, 135.999813, 173.979497, 133.703875),\n (173.979497, 133.703875, 173.979497, 131.407938),\n (173.979497, 131.407938, 173.979497, 129.112),\n (173.979497, 129.112, 173.979497, 126.816063),\n (173.979497, 126.816063, 173.979497, 124.520125),\n (173.979497, 124.520125, 173.979497, 122.224188),\n (173.979497, 122.224188, 173.979497, 119.92825),\n (173.979497, 119.92825, 173.979497, 117.632313),\n (173.979497, 117.632313, 173.979497, 115.336375),\n (173.979497, 115.336375, 173.979497, 113.040438),\n (173.979497, 113.040438, 173.979497, 110.7445),\n (163.7554, 184.2145, 163.7554, 181.918563),\n (163.7554, 181.918563, 163.7554, 179.622625),\n (163.7554, 179.622625, 163.7554, 177.326688),\n (163.7554, 177.326688, 163.7554, 175.03075),\n (163.7554, 175.03075, 163.7554, 172.734813),\n (163.7554, 172.734813, 163.7554, 170.438875),\n (163.7554, 170.438875, 163.7554, 168.142938),\n (163.7554, 168.142938, 163.7554, 165.847),\n (163.7554, 165.847, 163.7554, 163.551063),\n (163.7554, 163.551063, 163.7554, 161.255125),\n (163.7554, 161.255125, 163.7554, 158.959188),\n (163.7554, 158.959188, 163.7554, 156.66325),\n (163.7554, 156.66325, 163.7554, 154.367313),\n (163.7554, 154.367313, 163.7554, 152.071375),\n (163.7554, 152.071375, 163.7554, 149.775438),\n (163.7554, 149.775438, 163.7554, 147.4795),\n (163.7554, 147.4795, 163.7554, 145.183562),\n (163.7554, 145.183562, 163.7554, 142.887625),\n (163.7554, 142.887625, 163.7554, 140.591688),\n (163.7554, 140.591688, 163.7554, 138.29575),\n (163.7554, 138.29575, 163.7554, 135.999813),\n (163.7554, 135.999813, 163.7554, 133.703875),\n (163.7554, 133.703875, 163.7554, 131.407938),\n (163.7554, 131.407938, 163.7554, 129.112),\n (163.7554, 129.112, 163.7554, 126.816063),\n (163.7554, 126.816063, 163.7554, 124.520125),\n (163.7554, 124.520125, 163.7554, 122.224188),\n (163.7554, 122.224188, 163.7554, 119.92825),\n (163.7554, 119.92825, 163.7554, 117.632313),\n (163.7554, 117.632313, 163.7554, 115.336375),\n (163.7554, 115.336375, 163.7554, 113.040438),\n (163.7554, 113.040438, 163.7554, 110.7445),\n (163.7554, 184.2145, 173.979497, 184.2145),\n (163.7554, 110.7445, 173.979497, 110.7445)\n]\nVISIBLE_CIRCLES = [\n (113.0204, 147.4795, 36.735)\n]\nVISIBLE_ARCS = [\n\n]\nHIDDEN_SEGMENTS = [\n\n]\n# (orient, text, p1, p2, base) for linear; (orient, text, center, radius, angle) for diameter\nDIMENSIONS = [\n ('diameter', '%%c100', (113.0204, 147.4795), 36.735, 45),\n ('horizontal', '13.916', (173.9795, 147.4795), (163.7555, 147.4795), (168.8675, 136.4795))\n]\n\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\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\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,\n angle=(0 if d[0] == \"horizontal\" else 90),\n 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,\n text=text, dimstyle=\"EZDXF\").render()\n\n doc.saveas(out_path)\n\n\nif __name__ == \"__main__\":\n out = sys.argv[1] if len(sys.argv) > 1 else \"0081_00814461_gt.dxf\"\n draw(out)\n print(\"wrote\", out)\n```"}], "images": ["images/0081_00814461.png"], "id": "0081_00814461"} {"messages": [{"role": "user", "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 163.79 mm."}, {"role": "assistant", "content": "```python\n#!/usr/bin/env python3\n# -*- coding: utf-8 -*-\n# Ground-truth 2D engineering drawing for part: 0083_00839904\n# Self-contained: reproduces the three-view DXF via ezdxf, NO FreeCAD needed.\n# Coordinates are A4 page millimetres (scale=0.22475000000004294, page=[297.0, 210.0]).\n# visible edges -> solid (layer OUTLINE); hidden edges -> dashed (layer HIDDEN)\n# dimensions -> real movable DIMENSION entities (text = true mm value)\n# Run: python 0083_00839904_gt.py [out.dxf]\nimport sys\nimport ezdxf\n\nSCALE = 0.22475000000004294\nPAGE = [297.0, 210.0]\n\nVISIBLE_SEGMENTS = [\n (105.3062, 104.3813, 105.3062, 67.5688),\n (82.8312, 67.5688, 83.533544, 67.5688),\n (83.533544, 67.5688, 84.235887, 67.5688),\n (84.235887, 67.5688, 84.938231, 67.5688),\n (84.938231, 67.5688, 85.640575, 67.5688),\n (85.640575, 67.5688, 86.342919, 67.5688),\n (86.342919, 67.5688, 87.045262, 67.5688),\n (87.045262, 67.5688, 87.747606, 67.5688),\n (87.747606, 67.5688, 88.44995, 67.5688),\n (88.44995, 67.5688, 89.152294, 67.5688),\n (89.152294, 67.5688, 89.854637, 67.5688),\n (89.854637, 67.5688, 90.556981, 67.5688),\n (90.556981, 67.5688, 91.259325, 67.5688),\n (91.259325, 67.5688, 91.961669, 67.5688),\n (91.961669, 67.5688, 92.664012, 67.5688),\n (92.664012, 67.5688, 93.366356, 67.5688),\n (93.366356, 67.5688, 94.0687, 67.5688),\n (94.0687, 67.5688, 94.771044, 67.5688),\n (94.771044, 67.5688, 95.473388, 67.5688),\n (95.473388, 67.5688, 96.175731, 67.5688),\n (96.175731, 67.5688, 96.878075, 67.5688),\n (96.878075, 67.5688, 97.580419, 67.5688),\n (97.580419, 67.5688, 98.282763, 67.5688),\n (98.282763, 67.5688, 98.985106, 67.5688),\n (98.985106, 67.5688, 99.68745, 67.5688),\n (99.68745, 67.5688, 100.389794, 67.5688),\n (100.389794, 67.5688, 101.092138, 67.5688),\n (101.092138, 67.5688, 101.794481, 67.5688),\n (101.794481, 67.5688, 102.496825, 67.5688),\n (102.496825, 67.5688, 103.199169, 67.5688),\n (103.199169, 67.5688, 103.901513, 67.5688),\n (103.901513, 67.5688, 104.603856, 67.5688),\n (104.603856, 67.5688, 105.3062, 67.5688),\n (105.3062, 104.3813, 105.3062, 141.1938),\n (82.8312, 141.1938, 83.533544, 141.1938),\n (83.533544, 141.1938, 84.235887, 141.1938),\n (84.235887, 141.1938, 84.938231, 141.1938),\n (84.938231, 141.1938, 85.640575, 141.1938),\n (85.640575, 141.1938, 86.342919, 141.1938),\n (86.342919, 141.1938, 87.045262, 141.1938),\n (87.045262, 141.1938, 87.747606, 141.1938),\n (87.747606, 141.1938, 88.44995, 141.1938),\n (88.44995, 141.1938, 89.152294, 141.1938),\n (89.152294, 141.1938, 89.854637, 141.1938),\n (89.854637, 141.1938, 90.556981, 141.1938),\n (90.556981, 141.1938, 91.259325, 141.1938),\n (91.259325, 141.1938, 91.961669, 141.1938),\n (91.961669, 141.1938, 92.664012, 141.1938),\n (92.664012, 141.1938, 93.366356, 141.1938),\n (93.366356, 141.1938, 94.0687, 141.1938),\n (94.0687, 141.1938, 94.771044, 141.1938),\n (94.771044, 141.1938, 95.473388, 141.1938),\n (95.473388, 141.1938, 96.175731, 141.1938),\n (96.175731, 141.1938, 96.878075, 141.1938),\n (96.878075, 141.1938, 97.580419, 141.1938),\n (97.580419, 141.1938, 98.282763, 141.1938),\n (98.282763, 141.1938, 98.985106, 141.1938),\n (98.985106, 141.1938, 99.68745, 141.1938),\n (99.68745, 141.1938, 100.389794, 141.1938),\n (100.389794, 141.1938, 101.092138, 141.1938),\n (101.092138, 141.1938, 101.794481, 141.1938),\n (101.794481, 141.1938, 102.496825, 141.1938),\n (102.496825, 141.1938, 103.199169, 141.1938),\n (103.199169, 141.1938, 103.901513, 141.1938),\n (103.901513, 141.1938, 104.603856, 141.1938),\n (104.603856, 141.1938, 105.3062, 141.1938),\n (82.8312, 67.5688, 82.8312, 104.3813),\n (82.8312, 141.1938, 82.8312, 104.3813),\n (119.3062, 177.6688, 119.3062, 176.966456),\n (119.3062, 176.966456, 119.3062, 176.264113),\n (119.3062, 176.264113, 119.3062, 175.561769),\n (119.3062, 175.561769, 119.3062, 174.859425),\n (119.3062, 174.859425, 119.3062, 174.157081),\n (119.3062, 174.157081, 119.3062, 173.454738),\n (119.3062, 173.454738, 119.3062, 172.752394),\n (119.3062, 172.752394, 119.3062, 172.05005),\n (119.3062, 172.05005, 119.3062, 171.347706),\n (119.3062, 171.347706, 119.3062, 170.645363),\n (119.3062, 170.645363, 119.3062, 169.943019),\n (119.3062, 169.943019, 119.3062, 169.240675),\n (119.3062, 169.240675, 119.3062, 168.538331),\n (119.3062, 168.538331, 119.3062, 167.835988),\n (119.3062, 167.835988, 119.3062, 167.133644),\n (119.3062, 167.133644, 119.3062, 166.4313),\n (119.3062, 166.4313, 119.3062, 165.728956),\n (119.3062, 165.728956, 119.3062, 165.026612),\n (119.3062, 165.026612, 119.3062, 164.324269),\n (119.3062, 164.324269, 119.3062, 163.621925),\n (119.3062, 163.621925, 119.3062, 162.919581),\n (119.3062, 162.919581, 119.3062, 162.217237),\n (119.3062, 162.217237, 119.3062, 161.514894),\n (119.3062, 161.514894, 119.3062, 160.81255),\n (119.3062, 160.81255, 119.3062, 160.110206),\n (119.3062, 160.110206, 119.3062, 159.407862),\n (119.3062, 159.407862, 119.3062, 158.705519),\n (119.3062, 158.705519, 119.3062, 158.003175),\n (119.3062, 158.003175, 119.3062, 157.300831),\n (119.3062, 157.300831, 119.3062, 156.598487),\n (119.3062, 156.598487, 119.3062, 155.896144),\n (119.3062, 155.896144, 119.3062, 155.1938),\n (192.9312, 177.6688, 192.9312, 176.966456),\n (192.9312, 176.966456, 192.9312, 176.264113),\n (192.9312, 176.264113, 192.9312, 175.561769),\n (192.9312, 175.561769, 192.9312, 174.859425),\n (192.9312, 174.859425, 192.9312, 174.157081),\n (192.9312, 174.157081, 192.9312, 173.454738),\n (192.9312, 173.454738, 192.9312, 172.752394),\n (192.9312, 172.752394, 192.9312, 172.05005),\n (192.9312, 172.05005, 192.9312, 171.347706),\n (192.9312, 171.347706, 192.9312, 170.645363),\n (192.9312, 170.645363, 192.9312, 169.943019),\n (192.9312, 169.943019, 192.9312, 169.240675),\n (192.9312, 169.240675, 192.9312, 168.538331),\n (192.9312, 168.538331, 192.9312, 167.835988),\n (192.9312, 167.835988, 192.9312, 167.133644),\n (192.9312, 167.133644, 192.9312, 166.4313),\n (192.9312, 166.4313, 192.9312, 165.728956),\n (192.9312, 165.728956, 192.9312, 165.026612),\n (192.9312, 165.026612, 192.9312, 164.324269),\n (192.9312, 164.324269, 192.9312, 163.621925),\n (192.9312, 163.621925, 192.9312, 162.919581),\n (192.9312, 162.919581, 192.9312, 162.217237),\n (192.9312, 162.217237, 192.9312, 161.514894),\n (192.9312, 161.514894, 192.9312, 160.81255),\n (192.9312, 160.81255, 192.9312, 160.110206),\n (192.9312, 160.110206, 192.9312, 159.407862),\n (192.9312, 159.407862, 192.9312, 158.705519),\n (192.9312, 158.705519, 192.9312, 158.003175),\n (192.9312, 158.003175, 192.9312, 157.300831),\n (192.9312, 157.300831, 192.9312, 156.598487),\n (192.9312, 156.598487, 192.9312, 155.896144),\n (192.9312, 155.896144, 192.9312, 155.1938),\n (119.3062, 177.6688, 156.1187, 177.6688),\n (119.3062, 155.1938, 156.1187, 155.1938),\n (192.9312, 155.1938, 156.1187, 155.1938),\n (192.9312, 177.6688, 156.1187, 177.6688)\n]\nVISIBLE_CIRCLES = [\n (94.0687, 166.4313, 11.2375)\n]\nVISIBLE_ARCS = [\n\n]\nHIDDEN_SEGMENTS = [\n\n]\n# (orient, text, p1, p2, base) for linear; (orient, text, center, radius, angle) for diameter\nDIMENSIONS = [\n ('diameter', '%%c100', (94.0687, 166.4313), 11.2375, 45),\n ('horizontal', '327.586', (192.9312, 166.4313), (119.3063, 166.4313), (156.1188, 155.4313))\n]\n\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\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\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,\n angle=(0 if d[0] == \"horizontal\" else 90),\n 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,\n text=text, dimstyle=\"EZDXF\").render()\n\n doc.saveas(out_path)\n\n\nif __name__ == \"__main__\":\n out = sys.argv[1] if len(sys.argv) > 1 else \"0083_00839904_gt.dxf\"\n draw(out)\n print(\"wrote\", out)\n```"}], "images": ["images/0083_00839904.png"], "id": "0083_00839904"} {"messages": [{"role": "user", "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 1055.56 mm."}, {"role": "assistant", "content": "```python\n#!/usr/bin/env python3\n# -*- coding: utf-8 -*-\n# Ground-truth 2D engineering drawing for part: 0085_00854848\n# Self-contained: reproduces the three-view DXF via ezdxf, NO FreeCAD needed.\n# Coordinates are A4 page millimetres (scale=0.08316346153842956, page=[297.0, 210.0]).\n# visible edges -> solid (layer OUTLINE); hidden edges -> dashed (layer HIDDEN)\n# dimensions -> real movable DIMENSION entities (text = true mm value)\n# Run: python 0085_00854848_gt.py [out.dxf]\nimport sys\nimport ezdxf\n\nSCALE = 0.08316346153842956\nPAGE = [297.0, 210.0]\n\nVISIBLE_SEGMENTS = [\n (86.370927, 151.812727, 86.630813, 151.812727),\n (86.630813, 151.812727, 86.890699, 151.812727),\n (86.890699, 151.812727, 87.150584, 151.812727),\n (87.150584, 151.812727, 87.41047, 151.812727),\n (87.41047, 151.812727, 87.670356, 151.812727),\n (87.670356, 151.812727, 87.930242, 151.812727),\n (87.930242, 151.812727, 88.190128, 151.812727),\n (88.190128, 151.812727, 88.450013, 151.812727),\n (88.450013, 151.812727, 88.709899, 151.812727),\n (88.709899, 151.812727, 88.969785, 151.812727),\n (88.969785, 151.812727, 89.229671, 151.812727),\n (89.229671, 151.812727, 89.489557, 151.812727),\n (89.489557, 151.812727, 89.749443, 151.812727),\n (89.749443, 151.812727, 90.009328, 151.812727),\n (90.009328, 151.812727, 90.269214, 151.812727),\n (90.269214, 151.812727, 90.5291, 151.812727),\n (90.5291, 151.812727, 90.788986, 151.812727),\n (90.788986, 151.812727, 91.048872, 151.812727),\n (91.048872, 151.812727, 91.308757, 151.812727),\n (91.308757, 151.812727, 91.568643, 151.812727),\n (91.568643, 151.812727, 91.828529, 151.812727),\n (91.828529, 151.812727, 92.088415, 151.812727),\n (92.088415, 151.812727, 92.348301, 151.812727),\n (92.348301, 151.812727, 92.608187, 151.812727),\n (92.608187, 151.812727, 92.868072, 151.812727),\n (92.868072, 151.812727, 93.127958, 151.812727),\n (93.127958, 151.812727, 93.387844, 151.812727),\n (93.387844, 151.812727, 93.64773, 151.812727),\n (93.64773, 151.812727, 93.907616, 151.812727),\n (93.907616, 151.812727, 94.167501, 151.812727),\n (94.167501, 151.812727, 94.427387, 151.812727),\n (94.427387, 151.812727, 94.687273, 151.812727),\n (94.687273, 151.812727, 94.687273, 64.029073),\n (86.370927, 64.029073, 86.630813, 64.029073),\n (86.630813, 64.029073, 86.890699, 64.029073),\n (86.890699, 64.029073, 87.150584, 64.029073),\n (87.150584, 64.029073, 87.41047, 64.029073),\n (87.41047, 64.029073, 87.670356, 64.029073),\n (87.670356, 64.029073, 87.930242, 64.029073),\n (87.930242, 64.029073, 88.190128, 64.029073),\n (88.190128, 64.029073, 88.450013, 64.029073),\n (88.450013, 64.029073, 88.709899, 64.029073),\n (88.709899, 64.029073, 88.969785, 64.029073),\n (88.969785, 64.029073, 89.229671, 64.029073),\n (89.229671, 64.029073, 89.489557, 64.029073),\n (89.489557, 64.029073, 89.749443, 64.029073),\n (89.749443, 64.029073, 90.009328, 64.029073),\n (90.009328, 64.029073, 90.269214, 64.029073),\n (90.269214, 64.029073, 90.5291, 64.029073),\n (90.5291, 64.029073, 90.788986, 64.029073),\n (90.788986, 64.029073, 91.048872, 64.029073),\n (91.048872, 64.029073, 91.308757, 64.029073),\n (91.308757, 64.029073, 91.568643, 64.029073),\n (91.568643, 64.029073, 91.828529, 64.029073),\n (91.828529, 64.029073, 92.088415, 64.029073),\n (92.088415, 64.029073, 92.348301, 64.029073),\n (92.348301, 64.029073, 92.608187, 64.029073),\n (92.608187, 64.029073, 92.868072, 64.029073),\n (92.868072, 64.029073, 93.127958, 64.029073),\n (93.127958, 64.029073, 93.387844, 64.029073),\n (93.387844, 64.029073, 93.64773, 64.029073),\n (93.64773, 64.029073, 93.907616, 64.029073),\n (93.907616, 64.029073, 94.167501, 64.029073),\n (94.167501, 64.029073, 94.427387, 64.029073),\n (94.427387, 64.029073, 94.687273, 64.029073),\n (86.370927, 64.029073, 86.370927, 151.812727),\n (196.470927, 174.129073, 196.470927, 173.869187),\n (196.470927, 173.869187, 196.470927, 173.609301),\n (196.470927, 173.609301, 196.470927, 173.349416),\n (196.470927, 173.349416, 196.470927, 173.08953),\n (196.470927, 173.08953, 196.470927, 172.829644),\n (196.470927, 172.829644, 196.470927, 172.569758),\n (196.470927, 172.569758, 196.470927, 172.309872),\n (196.470927, 172.309872, 196.470927, 172.049987),\n (196.470927, 172.049987, 196.470927, 171.790101),\n (196.470927, 171.790101, 196.470927, 171.530215),\n (196.470927, 171.530215, 196.470927, 171.270329),\n (196.470927, 171.270329, 196.470927, 171.010443),\n (196.470927, 171.010443, 196.470927, 170.750557),\n (196.470927, 170.750557, 196.470927, 170.490672),\n (196.470927, 170.490672, 196.470927, 170.230786),\n (196.470927, 170.230786, 196.470927, 169.9709),\n (196.470927, 169.9709, 196.470927, 169.711014),\n (196.470927, 169.711014, 196.470927, 169.451128),\n (196.470927, 169.451128, 196.470927, 169.191243),\n (196.470927, 169.191243, 196.470927, 168.931357),\n (196.470927, 168.931357, 196.470927, 168.671471),\n (196.470927, 168.671471, 196.470927, 168.411585),\n (196.470927, 168.411585, 196.470927, 168.151699),\n (196.470927, 168.151699, 196.470927, 167.891813),\n (196.470927, 167.891813, 196.470927, 167.631928),\n (196.470927, 167.631928, 196.470927, 167.372042),\n (196.470927, 167.372042, 196.470927, 167.112156),\n (196.470927, 167.112156, 196.470927, 166.85227),\n (196.470927, 166.85227, 196.470927, 166.592384),\n (196.470927, 166.592384, 196.470927, 166.332499),\n (196.470927, 166.332499, 196.470927, 166.072613),\n (196.470927, 166.072613, 196.470927, 165.812727),\n (108.687273, 174.129073, 108.687273, 173.869187),\n (108.687273, 173.869187, 108.687273, 173.609301),\n (108.687273, 173.609301, 108.687273, 173.349416),\n (108.687273, 173.349416, 108.687273, 173.08953),\n (108.687273, 173.08953, 108.687273, 172.829644),\n (108.687273, 172.829644, 108.687273, 172.569758),\n (108.687273, 172.569758, 108.687273, 172.309872),\n (108.687273, 172.309872, 108.687273, 172.049987),\n (108.687273, 172.049987, 108.687273, 171.790101),\n (108.687273, 171.790101, 108.687273, 171.530215),\n (108.687273, 171.530215, 108.687273, 171.270329),\n (108.687273, 171.270329, 108.687273, 171.010443),\n (108.687273, 171.010443, 108.687273, 170.750557),\n (108.687273, 170.750557, 108.687273, 170.490672),\n (108.687273, 170.490672, 108.687273, 170.230786),\n (108.687273, 170.230786, 108.687273, 169.9709),\n (108.687273, 169.9709, 108.687273, 169.711014),\n (108.687273, 169.711014, 108.687273, 169.451128),\n (108.687273, 169.451128, 108.687273, 169.191243),\n (108.687273, 169.191243, 108.687273, 168.931357),\n (108.687273, 168.931357, 108.687273, 168.671471),\n (108.687273, 168.671471, 108.687273, 168.411585),\n (108.687273, 168.411585, 108.687273, 168.151699),\n (108.687273, 168.151699, 108.687273, 167.891813),\n (108.687273, 167.891813, 108.687273, 167.631928),\n (108.687273, 167.631928, 108.687273, 167.372042),\n (108.687273, 167.372042, 108.687273, 167.112156),\n (108.687273, 167.112156, 108.687273, 166.85227),\n (108.687273, 166.85227, 108.687273, 166.592384),\n (108.687273, 166.592384, 108.687273, 166.332499),\n (108.687273, 166.332499, 108.687273, 166.072613),\n (108.687273, 166.072613, 108.687273, 165.812727),\n (108.687273, 174.129073, 196.470927, 174.129073),\n (108.687273, 165.812727, 196.470927, 165.812727)\n]\nVISIBLE_CIRCLES = [\n (90.5291, 169.9709, 4.158173)\n]\nVISIBLE_ARCS = [\n\n]\nHIDDEN_SEGMENTS = [\n\n]\n# (orient, text, p1, p2, base) for linear; (orient, text, center, radius, angle) for diameter\nDIMENSIONS = [\n ('diameter', '%%c100', (90.5291, 169.9709), 4.1582, 45),\n ('horizontal', '1055.56', (196.4709, 169.9709), (108.6873, 169.9709), (152.5791, 158.9709))\n]\n\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\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\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,\n angle=(0 if d[0] == \"horizontal\" else 90),\n 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,\n text=text, dimstyle=\"EZDXF\").render()\n\n doc.saveas(out_path)\n\n\nif __name__ == \"__main__\":\n out = sys.argv[1] if len(sys.argv) > 1 else \"0085_00854848_gt.dxf\"\n draw(out)\n print(\"wrote\", out)\n```"}], "images": ["images/0085_00854848.png"], "id": "0085_00854848"} {"messages": [{"role": "user", "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 9.79 mm."}, {"role": "assistant", "content": "```python\n#!/usr/bin/env python3\n# -*- coding: utf-8 -*-\n# Ground-truth 2D engineering drawing for part: 0086_00865492\n# Self-contained: reproduces the three-view DXF via ezdxf, NO FreeCAD needed.\n# Coordinates are A4 page millimetres (scale=0.7347, page=[297.0, 210.0]).\n# visible edges -> solid (layer OUTLINE); hidden edges -> dashed (layer HIDDEN)\n# dimensions -> real movable DIMENSION entities (text = true mm value)\n# Run: python 0086_00865492_gt.py [out.dxf]\nimport sys\nimport ezdxf\n\nSCALE = 0.7347\nPAGE = [297.0, 210.0]\n\nVISIBLE_SEGMENTS = [\n (77.8001, 95.2299, 80.096037, 95.2299),\n (80.096037, 95.2299, 82.391975, 95.2299),\n (82.391975, 95.2299, 84.687912, 95.2299),\n (84.687912, 95.2299, 86.98385, 95.2299),\n (86.98385, 95.2299, 89.279787, 95.2299),\n (89.279787, 95.2299, 91.575725, 95.2299),\n (91.575725, 95.2299, 93.871662, 95.2299),\n (93.871662, 95.2299, 96.1676, 95.2299),\n (96.1676, 95.2299, 98.463538, 95.2299),\n (98.463538, 95.2299, 100.759475, 95.2299),\n (100.759475, 95.2299, 103.055413, 95.2299),\n (103.055413, 95.2299, 105.35135, 95.2299),\n (105.35135, 95.2299, 107.647288, 95.2299),\n (107.647288, 95.2299, 109.943225, 95.2299),\n (109.943225, 95.2299, 112.239163, 95.2299),\n (112.239163, 95.2299, 114.5351, 95.2299),\n (114.5351, 95.2299, 116.831037, 95.2299),\n (116.831037, 95.2299, 119.126975, 95.2299),\n (119.126975, 95.2299, 121.422912, 95.2299),\n (121.422912, 95.2299, 123.71885, 95.2299),\n (123.71885, 95.2299, 126.014788, 95.2299),\n (126.014788, 95.2299, 128.310725, 95.2299),\n (128.310725, 95.2299, 130.606663, 95.2299),\n (130.606663, 95.2299, 132.9026, 95.2299),\n (132.9026, 95.2299, 135.198538, 95.2299),\n (135.198538, 95.2299, 137.494475, 95.2299),\n (137.494475, 95.2299, 139.790413, 95.2299),\n (139.790413, 95.2299, 142.08635, 95.2299),\n (142.08635, 95.2299, 144.382288, 95.2299),\n (144.382288, 95.2299, 146.678225, 95.2299),\n (146.678225, 95.2299, 148.974163, 95.2299),\n (148.974163, 95.2299, 151.2701, 95.2299),\n (151.2701, 95.2299, 151.2701, 88.035165),\n (77.8001, 88.035165, 80.096037, 88.035165),\n (80.096037, 88.035165, 82.391975, 88.035165),\n (82.391975, 88.035165, 84.687912, 88.035165),\n (84.687912, 88.035165, 86.98385, 88.035165),\n (86.98385, 88.035165, 89.279787, 88.035165),\n (89.279787, 88.035165, 91.575725, 88.035165),\n (91.575725, 88.035165, 93.871662, 88.035165),\n (93.871662, 88.035165, 96.1676, 88.035165),\n (96.1676, 88.035165, 98.463538, 88.035165),\n (98.463538, 88.035165, 100.759475, 88.035165),\n (100.759475, 88.035165, 103.055413, 88.035165),\n (103.055413, 88.035165, 105.35135, 88.035165),\n (105.35135, 88.035165, 107.647288, 88.035165),\n (107.647288, 88.035165, 109.943225, 88.035165),\n (109.943225, 88.035165, 112.239163, 88.035165),\n (112.239163, 88.035165, 114.5351, 88.035165),\n (114.5351, 88.035165, 116.831037, 88.035165),\n (116.831037, 88.035165, 119.126975, 88.035165),\n (119.126975, 88.035165, 121.422912, 88.035165),\n (121.422912, 88.035165, 123.71885, 88.035165),\n (123.71885, 88.035165, 126.014788, 88.035165),\n (126.014788, 88.035165, 128.310725, 88.035165),\n (128.310725, 88.035165, 130.606663, 88.035165),\n (130.606663, 88.035165, 132.9026, 88.035165),\n (132.9026, 88.035165, 135.198538, 88.035165),\n (135.198538, 88.035165, 137.494475, 88.035165),\n (137.494475, 88.035165, 139.790413, 88.035165),\n (139.790413, 88.035165, 142.08635, 88.035165),\n (142.08635, 88.035165, 144.382288, 88.035165),\n (144.382288, 88.035165, 146.678225, 88.035165),\n (146.678225, 88.035165, 148.974163, 88.035165),\n (148.974163, 88.035165, 151.2701, 88.035165),\n (77.8001, 88.035165, 77.8001, 95.2299),\n (172.464835, 182.6999, 172.464835, 180.403963),\n (172.464835, 180.403963, 172.464835, 178.108025),\n (172.464835, 178.108025, 172.464835, 175.812088),\n (172.464835, 175.812088, 172.464835, 173.51615),\n (172.464835, 173.51615, 172.464835, 171.220213),\n (172.464835, 171.220213, 172.464835, 168.924275),\n (172.464835, 168.924275, 172.464835, 166.628338),\n (172.464835, 166.628338, 172.464835, 164.3324),\n (172.464835, 164.3324, 172.464835, 162.036463),\n (172.464835, 162.036463, 172.464835, 159.740525),\n (172.464835, 159.740525, 172.464835, 157.444588),\n (172.464835, 157.444588, 172.464835, 155.14865),\n (172.464835, 155.14865, 172.464835, 152.852713),\n (172.464835, 152.852713, 172.464835, 150.556775),\n (172.464835, 150.556775, 172.464835, 148.260838),\n (172.464835, 148.260838, 172.464835, 145.9649),\n (172.464835, 145.9649, 172.464835, 143.668962),\n (172.464835, 143.668962, 172.464835, 141.373025),\n (172.464835, 141.373025, 172.464835, 139.077088),\n (172.464835, 139.077088, 172.464835, 136.78115),\n (172.464835, 136.78115, 172.464835, 134.485213),\n (172.464835, 134.485213, 172.464835, 132.189275),\n (172.464835, 132.189275, 172.464835, 129.893338),\n (172.464835, 129.893338, 172.464835, 127.5974),\n (172.464835, 127.5974, 172.464835, 125.301463),\n (172.464835, 125.301463, 172.464835, 123.005525),\n (172.464835, 123.005525, 172.464835, 120.709588),\n (172.464835, 120.709588, 172.464835, 118.41365),\n (172.464835, 118.41365, 172.464835, 116.117713),\n (172.464835, 116.117713, 172.464835, 113.821775),\n (172.464835, 113.821775, 172.464835, 111.525838),\n (172.464835, 111.525838, 172.464835, 109.2299),\n (165.2701, 182.6999, 165.2701, 180.403963),\n (165.2701, 180.403963, 165.2701, 178.108025),\n (165.2701, 178.108025, 165.2701, 175.812088),\n (165.2701, 175.812088, 165.2701, 173.51615),\n (165.2701, 173.51615, 165.2701, 171.220213),\n (165.2701, 171.220213, 165.2701, 168.924275),\n (165.2701, 168.924275, 165.2701, 166.628338),\n (165.2701, 166.628338, 165.2701, 164.3324),\n (165.2701, 164.3324, 165.2701, 162.036463),\n (165.2701, 162.036463, 165.2701, 159.740525),\n (165.2701, 159.740525, 165.2701, 157.444588),\n (165.2701, 157.444588, 165.2701, 155.14865),\n (165.2701, 155.14865, 165.2701, 152.852713),\n (165.2701, 152.852713, 165.2701, 150.556775),\n (165.2701, 150.556775, 165.2701, 148.260838),\n (165.2701, 148.260838, 165.2701, 145.9649),\n (165.2701, 145.9649, 165.2701, 143.668962),\n (165.2701, 143.668962, 165.2701, 141.373025),\n (165.2701, 141.373025, 165.2701, 139.077088),\n (165.2701, 139.077088, 165.2701, 136.78115),\n (165.2701, 136.78115, 165.2701, 134.485213),\n (165.2701, 134.485213, 165.2701, 132.189275),\n (165.2701, 132.189275, 165.2701, 129.893338),\n (165.2701, 129.893338, 165.2701, 127.5974),\n (165.2701, 127.5974, 165.2701, 125.301463),\n (165.2701, 125.301463, 165.2701, 123.005525),\n (165.2701, 123.005525, 165.2701, 120.709588),\n (165.2701, 120.709588, 165.2701, 118.41365),\n (165.2701, 118.41365, 165.2701, 116.117713),\n (165.2701, 116.117713, 165.2701, 113.821775),\n (165.2701, 113.821775, 165.2701, 111.525838),\n (165.2701, 111.525838, 165.2701, 109.2299),\n (165.2701, 182.6999, 172.464835, 182.6999),\n (165.2701, 109.2299, 172.464835, 109.2299)\n]\nVISIBLE_CIRCLES = [\n (114.5351, 145.9649, 36.735)\n]\nVISIBLE_ARCS = [\n\n]\nHIDDEN_SEGMENTS = [\n\n]\n# (orient, text, p1, p2, base) for linear; (orient, text, center, radius, angle) for diameter\nDIMENSIONS = [\n ('diameter', '%%c100', (114.5351, 145.9649), 36.735, 45),\n ('horizontal', '9.7928', (172.4649, 145.9649), (165.2701, 145.9649), (168.8675, 134.9649))\n]\n\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\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\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,\n angle=(0 if d[0] == \"horizontal\" else 90),\n 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,\n text=text, dimstyle=\"EZDXF\").render()\n\n doc.saveas(out_path)\n\n\nif __name__ == \"__main__\":\n out = sys.argv[1] if len(sys.argv) > 1 else \"0086_00865492_gt.dxf\"\n draw(out)\n print(\"wrote\", out)\n```"}], "images": ["images/0086_00865492.png"], "id": "0086_00865492"} {"messages": [{"role": "user", "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 30.92 mm."}, {"role": "assistant", "content": "```python\n#!/usr/bin/env python3\n# -*- coding: utf-8 -*-\n# Ground-truth 2D engineering drawing for part: 0087_00877749\n# Self-contained: reproduces the three-view DXF via ezdxf, NO FreeCAD needed.\n# Coordinates are A4 page millimetres (scale=0.7340109398309672, page=[297.0, 210.0]).\n# visible edges -> solid (layer OUTLINE); hidden edges -> dashed (layer HIDDEN)\n# dimensions -> real movable DIMENSION entities (text = true mm value)\n# Run: python 0087_00877749_gt.py [out.dxf]\nimport sys\nimport ezdxf\n\nSCALE = 0.7340109398309672\nPAGE = [297.0, 210.0]\n\nVISIBLE_SEGMENTS = [\n (70.099653, 102.999153, 72.393437, 102.999153),\n (72.393437, 102.999153, 74.687221, 102.999153),\n (74.687221, 102.999153, 76.981006, 102.999153),\n (76.981006, 102.999153, 79.27479, 102.999153),\n (79.27479, 102.999153, 81.568574, 102.999153),\n (81.568574, 102.999153, 83.862358, 102.999153),\n (83.862358, 102.999153, 86.156142, 102.999153),\n (86.156142, 102.999153, 88.449927, 102.999153),\n (88.449927, 102.999153, 90.743711, 102.999153),\n (90.743711, 102.999153, 93.037495, 102.999153),\n (93.037495, 102.999153, 95.331279, 102.999153),\n (95.331279, 102.999153, 97.625063, 102.999153),\n (97.625063, 102.999153, 99.918847, 102.999153),\n (99.918847, 102.999153, 102.212632, 102.999153),\n (102.212632, 102.999153, 104.506416, 102.999153),\n (104.506416, 102.999153, 106.8002, 102.999153),\n (106.8002, 102.999153, 109.093984, 102.999153),\n (109.093984, 102.999153, 111.387768, 102.999153),\n (111.387768, 102.999153, 113.681553, 102.999153),\n (113.681553, 102.999153, 115.975337, 102.999153),\n (115.975337, 102.999153, 118.269121, 102.999153),\n (118.269121, 102.999153, 120.562905, 102.999153),\n (120.562905, 102.999153, 122.856689, 102.999153),\n (122.856689, 102.999153, 125.150473, 102.999153),\n (125.150473, 102.999153, 127.444258, 102.999153),\n (127.444258, 102.999153, 129.738042, 102.999153),\n (129.738042, 102.999153, 132.031826, 102.999153),\n (132.031826, 102.999153, 134.32561, 102.999153),\n (134.32561, 102.999153, 136.619394, 102.999153),\n (136.619394, 102.999153, 138.913179, 102.999153),\n (138.913179, 102.999153, 141.206963, 102.999153),\n (141.206963, 102.999153, 143.500747, 102.999153),\n (143.500747, 102.999153, 143.500747, 80.300247),\n (70.099653, 80.300247, 72.393437, 80.300247),\n (72.393437, 80.300247, 74.687221, 80.300247),\n (74.687221, 80.300247, 76.981006, 80.300247),\n (76.981006, 80.300247, 79.27479, 80.300247),\n (79.27479, 80.300247, 81.568574, 80.300247),\n (81.568574, 80.300247, 83.862358, 80.300247),\n (83.862358, 80.300247, 86.156142, 80.300247),\n (86.156142, 80.300247, 88.449927, 80.300247),\n (88.449927, 80.300247, 90.743711, 80.300247),\n (90.743711, 80.300247, 93.037495, 80.300247),\n (93.037495, 80.300247, 95.331279, 80.300247),\n (95.331279, 80.300247, 97.625063, 80.300247),\n (97.625063, 80.300247, 99.918847, 80.300247),\n (99.918847, 80.300247, 102.212632, 80.300247),\n (102.212632, 80.300247, 104.506416, 80.300247),\n (104.506416, 80.300247, 106.8002, 80.300247),\n (106.8002, 80.300247, 109.093984, 80.300247),\n (109.093984, 80.300247, 111.387768, 80.300247),\n (111.387768, 80.300247, 113.681553, 80.300247),\n (113.681553, 80.300247, 115.975337, 80.300247),\n (115.975337, 80.300247, 118.269121, 80.300247),\n (118.269121, 80.300247, 120.562905, 80.300247),\n (120.562905, 80.300247, 122.856689, 80.300247),\n (122.856689, 80.300247, 125.150473, 80.300247),\n (125.150473, 80.300247, 127.444258, 80.300247),\n (127.444258, 80.300247, 129.738042, 80.300247),\n (129.738042, 80.300247, 132.031826, 80.300247),\n (132.031826, 80.300247, 134.32561, 80.300247),\n (134.32561, 80.300247, 136.619394, 80.300247),\n (136.619394, 80.300247, 138.913179, 80.300247),\n (138.913179, 80.300247, 141.206963, 80.300247),\n (141.206963, 80.300247, 143.500747, 80.300247),\n (70.099653, 80.300247, 70.099653, 102.999153),\n (180.199653, 190.400247, 180.199653, 188.106463),\n (180.199653, 188.106463, 180.199653, 185.812679),\n (180.199653, 185.812679, 180.199653, 183.518894),\n (180.199653, 183.518894, 180.199653, 181.22511),\n (180.199653, 181.22511, 180.199653, 178.931326),\n (180.199653, 178.931326, 180.199653, 176.637542),\n (180.199653, 176.637542, 180.199653, 174.343758),\n (180.199653, 174.343758, 180.199653, 172.049973),\n (180.199653, 172.049973, 180.199653, 169.756189),\n (180.199653, 169.756189, 180.199653, 167.462405),\n (180.199653, 167.462405, 180.199653, 165.168621),\n (180.199653, 165.168621, 180.199653, 162.874837),\n (180.199653, 162.874837, 180.199653, 160.581053),\n (180.199653, 160.581053, 180.199653, 158.287268),\n (180.199653, 158.287268, 180.199653, 155.993484),\n (180.199653, 155.993484, 180.199653, 153.6997),\n (180.199653, 153.6997, 180.199653, 151.405916),\n (180.199653, 151.405916, 180.199653, 149.112132),\n (180.199653, 149.112132, 180.199653, 146.818347),\n (180.199653, 146.818347, 180.199653, 144.524563),\n (180.199653, 144.524563, 180.199653, 142.230779),\n (180.199653, 142.230779, 180.199653, 139.936995),\n (180.199653, 139.936995, 180.199653, 137.643211),\n (180.199653, 137.643211, 180.199653, 135.349427),\n (180.199653, 135.349427, 180.199653, 133.055642),\n (180.199653, 133.055642, 180.199653, 130.761858),\n (180.199653, 130.761858, 180.199653, 128.468074),\n (180.199653, 128.468074, 180.199653, 126.17429),\n (180.199653, 126.17429, 180.199653, 123.880506),\n (180.199653, 123.880506, 180.199653, 121.586721),\n (180.199653, 121.586721, 180.199653, 119.292937),\n (180.199653, 119.292937, 180.199653, 116.999153),\n (157.500747, 190.400247, 157.500747, 188.106463),\n (157.500747, 188.106463, 157.500747, 185.812679),\n (157.500747, 185.812679, 157.500747, 183.518894),\n (157.500747, 183.518894, 157.500747, 181.22511),\n (157.500747, 181.22511, 157.500747, 178.931326),\n (157.500747, 178.931326, 157.500747, 176.637542),\n (157.500747, 176.637542, 157.500747, 174.343758),\n (157.500747, 174.343758, 157.500747, 172.049973),\n (157.500747, 172.049973, 157.500747, 169.756189),\n (157.500747, 169.756189, 157.500747, 167.462405),\n (157.500747, 167.462405, 157.500747, 165.168621),\n (157.500747, 165.168621, 157.500747, 162.874837),\n (157.500747, 162.874837, 157.500747, 160.581053),\n (157.500747, 160.581053, 157.500747, 158.287268),\n (157.500747, 158.287268, 157.500747, 155.993484),\n (157.500747, 155.993484, 157.500747, 153.6997),\n (157.500747, 153.6997, 157.500747, 151.405916),\n (157.500747, 151.405916, 157.500747, 149.112132),\n (157.500747, 149.112132, 157.500747, 146.818347),\n (157.500747, 146.818347, 157.500747, 144.524563),\n (157.500747, 144.524563, 157.500747, 142.230779),\n (157.500747, 142.230779, 157.500747, 139.936995),\n (157.500747, 139.936995, 157.500747, 137.643211),\n (157.500747, 137.643211, 157.500747, 135.349427),\n (157.500747, 135.349427, 157.500747, 133.055642),\n (157.500747, 133.055642, 157.500747, 130.761858),\n (157.500747, 130.761858, 157.500747, 128.468074),\n (157.500747, 128.468074, 157.500747, 126.17429),\n (157.500747, 126.17429, 157.500747, 123.880506),\n (157.500747, 123.880506, 157.500747, 121.586721),\n (157.500747, 121.586721, 157.500747, 119.292937),\n (157.500747, 119.292937, 157.500747, 116.999153),\n (157.500747, 190.400247, 180.199653, 190.400247),\n (157.500747, 116.999153, 180.199653, 116.999153)\n]\nVISIBLE_CIRCLES = [\n (106.8002, 153.6997, 36.700547)\n]\nVISIBLE_ARCS = [\n\n]\nHIDDEN_SEGMENTS = [\n\n]\n# (orient, text, p1, p2, base) for linear; (orient, text, center, radius, angle) for diameter\nDIMENSIONS = [\n ('diameter', '%%c100', (106.8002, 153.6997), 36.7005, 45),\n ('horizontal', '30.9245', (180.1997, 153.6997), (157.5008, 153.6997), (168.8503, 142.6997))\n]\n\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\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\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,\n angle=(0 if d[0] == \"horizontal\" else 90),\n 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,\n text=text, dimstyle=\"EZDXF\").render()\n\n doc.saveas(out_path)\n\n\nif __name__ == \"__main__\":\n out = sys.argv[1] if len(sys.argv) > 1 else \"0087_00877749_gt.dxf\"\n draw(out)\n print(\"wrote\", out)\n```"}], "images": ["images/0087_00877749.png"], "id": "0087_00877749"} {"messages": [{"role": "user", "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 500 mm."}, {"role": "assistant", "content": "```python\n#!/usr/bin/env python3\n# -*- coding: utf-8 -*-\n# Ground-truth 2D engineering drawing for part: 0088_00884075\n# Self-contained: reproduces the three-view DXF via ezdxf, NO FreeCAD needed.\n# Coordinates are A4 page millimetres (scale=0.16016666666666668, page=[297.0, 210.0]).\n# visible edges -> solid (layer OUTLINE); hidden edges -> dashed (layer HIDDEN)\n# dimensions -> real movable DIMENSION entities (text = true mm value)\n# Run: python 0088_00884075_gt.py [out.dxf]\nimport sys\nimport ezdxf\n\nSCALE = 0.16016666666666668\nPAGE = [297.0, 210.0]\n\nVISIBLE_SEGMENTS = [\n (100.462533, 65.954133, 99.962013, 65.954133),\n (99.962013, 65.954133, 99.461492, 65.954133),\n (99.461492, 65.954133, 98.960971, 65.954133),\n (98.960971, 65.954133, 98.46045, 65.954133),\n (98.46045, 65.954133, 97.959929, 65.954133),\n (97.959929, 65.954133, 97.459408, 65.954133),\n (97.459408, 65.954133, 96.958888, 65.954133),\n (96.958888, 65.954133, 96.458367, 65.954133),\n (96.458367, 65.954133, 95.957846, 65.954133),\n (95.957846, 65.954133, 95.457325, 65.954133),\n (95.457325, 65.954133, 94.956804, 65.954133),\n (94.956804, 65.954133, 94.456283, 65.954133),\n (94.456283, 65.954133, 93.955762, 65.954133),\n (93.955762, 65.954133, 93.455242, 65.954133),\n (93.455242, 65.954133, 92.954721, 65.954133),\n (92.954721, 65.954133, 92.4542, 65.954133),\n (92.4542, 65.954133, 91.953679, 65.954133),\n (91.953679, 65.954133, 91.453158, 65.954133),\n (91.453158, 65.954133, 90.952637, 65.954133),\n (90.952637, 65.954133, 90.452117, 65.954133),\n (90.452117, 65.954133, 89.951596, 65.954133),\n (89.951596, 65.954133, 89.451075, 65.954133),\n (89.451075, 65.954133, 88.950554, 65.954133),\n (88.950554, 65.954133, 88.450033, 65.954133),\n (88.450033, 65.954133, 87.949512, 65.954133),\n (87.949512, 65.954133, 87.448992, 65.954133),\n (87.448992, 65.954133, 86.948471, 65.954133),\n (86.948471, 65.954133, 86.44795, 65.954133),\n (86.44795, 65.954133, 85.947429, 65.954133),\n (85.947429, 65.954133, 85.446908, 65.954133),\n (85.446908, 65.954133, 84.946388, 65.954133),\n (84.946388, 65.954133, 84.445867, 65.954133),\n (100.462533, 65.954133, 100.462533, 146.037466),\n (100.462533, 146.037466, 99.962013, 146.037466),\n (99.962013, 146.037466, 99.461492, 146.037466),\n (99.461492, 146.037466, 98.960971, 146.037466),\n (98.960971, 146.037466, 98.46045, 146.037466),\n (98.46045, 146.037466, 97.959929, 146.037466),\n (97.959929, 146.037466, 97.459408, 146.037466),\n (97.459408, 146.037466, 96.958888, 146.037466),\n (96.958888, 146.037466, 96.458367, 146.037466),\n (96.458367, 146.037466, 95.957846, 146.037466),\n (95.957846, 146.037466, 95.457325, 146.037466),\n (95.457325, 146.037466, 94.956804, 146.037466),\n (94.956804, 146.037466, 94.456283, 146.037466),\n (94.456283, 146.037466, 93.955762, 146.037466),\n (93.955762, 146.037466, 93.455242, 146.037466),\n (93.455242, 146.037466, 92.954721, 146.037466),\n (92.954721, 146.037466, 92.4542, 146.037466),\n (92.4542, 146.037466, 91.953679, 146.037466),\n (91.953679, 146.037466, 91.453158, 146.037466),\n (91.453158, 146.037466, 90.952637, 146.037466),\n (90.952637, 146.037466, 90.452117, 146.037466),\n (90.452117, 146.037466, 89.951596, 146.037466),\n (89.951596, 146.037466, 89.451075, 146.037466),\n (89.451075, 146.037466, 88.950554, 146.037466),\n (88.950554, 146.037466, 88.450033, 146.037466),\n (88.450033, 146.037466, 87.949512, 146.037466),\n (87.949512, 146.037466, 87.448992, 146.037466),\n (87.448992, 146.037466, 86.948471, 146.037466),\n (86.948471, 146.037466, 86.44795, 146.037466),\n (86.44795, 146.037466, 85.947429, 146.037466),\n (85.947429, 146.037466, 85.446908, 146.037466),\n (85.446908, 146.037466, 84.946388, 146.037466),\n (84.946388, 146.037466, 84.445867, 146.037466),\n (84.445867, 146.037466, 84.445867, 65.954133),\n (114.462534, 160.037467, 114.462534, 160.537988),\n (114.462534, 160.537988, 114.462534, 161.038508),\n (114.462534, 161.038508, 114.462534, 161.539029),\n (114.462534, 161.539029, 114.462534, 162.03955),\n (114.462534, 162.03955, 114.462534, 162.540071),\n (114.462534, 162.540071, 114.462534, 163.040592),\n (114.462534, 163.040592, 114.462534, 163.541113),\n (114.462534, 163.541113, 114.462534, 164.041633),\n (114.462534, 164.041633, 114.462534, 164.542154),\n (114.462534, 164.542154, 114.462534, 165.042675),\n (114.462534, 165.042675, 114.462534, 165.543196),\n (114.462534, 165.543196, 114.462534, 166.043717),\n (114.462534, 166.043717, 114.462534, 166.544238),\n (114.462534, 166.544238, 114.462534, 167.044758),\n (114.462534, 167.044758, 114.462534, 167.545279),\n (114.462534, 167.545279, 114.462534, 168.0458),\n (114.462534, 168.0458, 114.462534, 168.546321),\n (114.462534, 168.546321, 114.462534, 169.046842),\n (114.462534, 169.046842, 114.462534, 169.547363),\n (114.462534, 169.547363, 114.462534, 170.047883),\n (114.462534, 170.047883, 114.462534, 170.548404),\n (114.462534, 170.548404, 114.462534, 171.048925),\n (114.462534, 171.048925, 114.462534, 171.549446),\n (114.462534, 171.549446, 114.462534, 172.049967),\n (114.462534, 172.049967, 114.462534, 172.550488),\n (114.462534, 172.550488, 114.462534, 173.051008),\n (114.462534, 173.051008, 114.462534, 173.551529),\n (114.462534, 173.551529, 114.462534, 174.05205),\n (114.462534, 174.05205, 114.462534, 174.552571),\n (114.462534, 174.552571, 114.462534, 175.053092),\n (114.462534, 175.053092, 114.462534, 175.553613),\n (114.462534, 175.553613, 114.462534, 176.054133),\n (194.545867, 160.037467, 194.545867, 160.537988),\n (194.545867, 160.537988, 194.545867, 161.038508),\n (194.545867, 161.038508, 194.545867, 161.539029),\n (194.545867, 161.539029, 194.545867, 162.03955),\n (194.545867, 162.03955, 194.545867, 162.540071),\n (194.545867, 162.540071, 194.545867, 163.040592),\n (194.545867, 163.040592, 194.545867, 163.541113),\n (194.545867, 163.541113, 194.545867, 164.041633),\n (194.545867, 164.041633, 194.545867, 164.542154),\n (194.545867, 164.542154, 194.545867, 165.042675),\n (194.545867, 165.042675, 194.545867, 165.543196),\n (194.545867, 165.543196, 194.545867, 166.043717),\n (194.545867, 166.043717, 194.545867, 166.544238),\n (194.545867, 166.544238, 194.545867, 167.044758),\n (194.545867, 167.044758, 194.545867, 167.545279),\n (194.545867, 167.545279, 194.545867, 168.0458),\n (194.545867, 168.0458, 194.545867, 168.546321),\n (194.545867, 168.546321, 194.545867, 169.046842),\n (194.545867, 169.046842, 194.545867, 169.547363),\n (194.545867, 169.547363, 194.545867, 170.047883),\n (194.545867, 170.047883, 194.545867, 170.548404),\n (194.545867, 170.548404, 194.545867, 171.048925),\n (194.545867, 171.048925, 194.545867, 171.549446),\n (194.545867, 171.549446, 194.545867, 172.049967),\n (194.545867, 172.049967, 194.545867, 172.550488),\n (194.545867, 172.550488, 194.545867, 173.051008),\n (194.545867, 173.051008, 194.545867, 173.551529),\n (194.545867, 173.551529, 194.545867, 174.05205),\n (194.545867, 174.05205, 194.545867, 174.552571),\n (194.545867, 174.552571, 194.545867, 175.053092),\n (194.545867, 175.053092, 194.545867, 175.553613),\n (194.545867, 175.553613, 194.545867, 176.054133),\n (194.545867, 160.037467, 114.462534, 160.037467),\n (194.545867, 176.054133, 114.462534, 176.054133)\n]\nVISIBLE_CIRCLES = [\n (92.4542, 168.0458, 8.008333)\n]\nVISIBLE_ARCS = [\n\n]\nHIDDEN_SEGMENTS = [\n\n]\n# (orient, text, p1, p2, base) for linear; (orient, text, center, radius, angle) for diameter\nDIMENSIONS = [\n ('diameter', '%%c100', (92.4542, 168.0458), 8.0083, 45),\n ('horizontal', '500', (114.4625, 168.0458), (194.5458, 168.0458), (154.5042, 179.0458))\n]\n\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\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\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,\n angle=(0 if d[0] == \"horizontal\" else 90),\n 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,\n text=text, dimstyle=\"EZDXF\").render()\n\n doc.saveas(out_path)\n\n\nif __name__ == \"__main__\":\n out = sys.argv[1] if len(sys.argv) > 1 else \"0088_00884075_gt.dxf\"\n draw(out)\n print(\"wrote\", out)\n```"}], "images": ["images/0088_00884075.png"], "id": "0088_00884075"} {"messages": [{"role": "user", "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 316.67 mm."}, {"role": "assistant", "content": "```python\n#!/usr/bin/env python3\n# -*- coding: utf-8 -*-\n# Ground-truth 2D engineering drawing for part: 0088_00889702\n# Self-contained: reproduces the three-view DXF via ezdxf, NO FreeCAD needed.\n# Coordinates are A4 page millimetres (scale=0.2306400000000037, page=[297.0, 210.0]).\n# visible edges -> solid (layer OUTLINE); hidden edges -> dashed (layer HIDDEN)\n# dimensions -> real movable DIMENSION entities (text = true mm value)\n# Run: python 0088_00889702_gt.py [out.dxf]\nimport sys\nimport ezdxf\n\nSCALE = 0.2306400000000037\nPAGE = [297.0, 210.0]\n\nVISIBLE_SEGMENTS = [\n (105.748, 67.716, 105.02725, 67.716),\n (105.02725, 67.716, 104.3065, 67.716),\n (104.3065, 67.716, 103.58575, 67.716),\n (103.58575, 67.716, 102.865, 67.716),\n (102.865, 67.716, 102.14425, 67.716),\n (102.14425, 67.716, 101.4235, 67.716),\n (101.4235, 67.716, 100.70275, 67.716),\n (100.70275, 67.716, 99.982, 67.716),\n (99.982, 67.716, 99.26125, 67.716),\n (99.26125, 67.716, 98.5405, 67.716),\n (98.5405, 67.716, 97.81975, 67.716),\n (97.81975, 67.716, 97.099, 67.716),\n (97.099, 67.716, 96.37825, 67.716),\n (96.37825, 67.716, 95.6575, 67.716),\n (95.6575, 67.716, 94.93675, 67.716),\n (94.93675, 67.716, 94.216, 67.716),\n (94.216, 67.716, 93.49525, 67.716),\n (93.49525, 67.716, 92.7745, 67.716),\n (92.7745, 67.716, 92.05375, 67.716),\n (92.05375, 67.716, 91.333, 67.716),\n (91.333, 67.716, 90.61225, 67.716),\n (90.61225, 67.716, 89.8915, 67.716),\n (89.8915, 67.716, 89.17075, 67.716),\n (89.17075, 67.716, 88.45, 67.716),\n (88.45, 67.716, 87.72925, 67.716),\n (87.72925, 67.716, 87.0085, 67.716),\n (87.0085, 67.716, 86.28775, 67.716),\n (86.28775, 67.716, 85.567, 67.716),\n (85.567, 67.716, 84.84625, 67.716),\n (84.84625, 67.716, 84.1255, 67.716),\n (84.1255, 67.716, 83.40475, 67.716),\n (83.40475, 67.716, 82.684, 67.716),\n (105.748, 67.716, 105.748, 140.752),\n (105.748, 140.752, 105.02725, 140.752),\n (105.02725, 140.752, 104.3065, 140.752),\n (104.3065, 140.752, 103.58575, 140.752),\n (103.58575, 140.752, 102.865, 140.752),\n (102.865, 140.752, 102.14425, 140.752),\n (102.14425, 140.752, 101.4235, 140.752),\n (101.4235, 140.752, 100.70275, 140.752),\n (100.70275, 140.752, 99.982, 140.752),\n (99.982, 140.752, 99.26125, 140.752),\n (99.26125, 140.752, 98.5405, 140.752),\n (98.5405, 140.752, 97.81975, 140.752),\n (97.81975, 140.752, 97.099, 140.752),\n (97.099, 140.752, 96.37825, 140.752),\n (96.37825, 140.752, 95.6575, 140.752),\n (95.6575, 140.752, 94.93675, 140.752),\n (94.93675, 140.752, 94.216, 140.752),\n (94.216, 140.752, 93.49525, 140.752),\n (93.49525, 140.752, 92.7745, 140.752),\n (92.7745, 140.752, 92.05375, 140.752),\n (92.05375, 140.752, 91.333, 140.752),\n (91.333, 140.752, 90.61225, 140.752),\n (90.61225, 140.752, 89.8915, 140.752),\n (89.8915, 140.752, 89.17075, 140.752),\n (89.17075, 140.752, 88.45, 140.752),\n (88.45, 140.752, 87.72925, 140.752),\n (87.72925, 140.752, 87.0085, 140.752),\n (87.0085, 140.752, 86.28775, 140.752),\n (86.28775, 140.752, 85.567, 140.752),\n (85.567, 140.752, 84.84625, 140.752),\n (84.84625, 140.752, 84.1255, 140.752),\n (84.1255, 140.752, 83.40475, 140.752),\n (83.40475, 140.752, 82.684, 140.752),\n (82.684, 140.752, 82.684, 67.716),\n (119.748, 154.752, 119.748, 155.47275),\n (119.748, 155.47275, 119.748, 156.1935),\n (119.748, 156.1935, 119.748, 156.91425),\n (119.748, 156.91425, 119.748, 157.635),\n (119.748, 157.635, 119.748, 158.35575),\n (119.748, 158.35575, 119.748, 159.0765),\n (119.748, 159.0765, 119.748, 159.79725),\n (119.748, 159.79725, 119.748, 160.518),\n (119.748, 160.518, 119.748, 161.23875),\n (119.748, 161.23875, 119.748, 161.9595),\n (119.748, 161.9595, 119.748, 162.68025),\n (119.748, 162.68025, 119.748, 163.401),\n (119.748, 163.401, 119.748, 164.12175),\n (119.748, 164.12175, 119.748, 164.8425),\n (119.748, 164.8425, 119.748, 165.56325),\n (119.748, 165.56325, 119.748, 166.284),\n (119.748, 166.284, 119.748, 167.00475),\n (119.748, 167.00475, 119.748, 167.7255),\n (119.748, 167.7255, 119.748, 168.44625),\n (119.748, 168.44625, 119.748, 169.167),\n (119.748, 169.167, 119.748, 169.88775),\n (119.748, 169.88775, 119.748, 170.6085),\n (119.748, 170.6085, 119.748, 171.32925),\n (119.748, 171.32925, 119.748, 172.05),\n (119.748, 172.05, 119.748, 172.77075),\n (119.748, 172.77075, 119.748, 173.4915),\n (119.748, 173.4915, 119.748, 174.21225),\n (119.748, 174.21225, 119.748, 174.933),\n (119.748, 174.933, 119.748, 175.65375),\n (119.748, 175.65375, 119.748, 176.3745),\n (119.748, 176.3745, 119.748, 177.09525),\n (119.748, 177.09525, 119.748, 177.816),\n (192.784, 154.752, 192.784, 155.47275),\n (192.784, 155.47275, 192.784, 156.1935),\n (192.784, 156.1935, 192.784, 156.91425),\n (192.784, 156.91425, 192.784, 157.635),\n (192.784, 157.635, 192.784, 158.35575),\n (192.784, 158.35575, 192.784, 159.0765),\n (192.784, 159.0765, 192.784, 159.79725),\n (192.784, 159.79725, 192.784, 160.518),\n (192.784, 160.518, 192.784, 161.23875),\n (192.784, 161.23875, 192.784, 161.9595),\n (192.784, 161.9595, 192.784, 162.68025),\n (192.784, 162.68025, 192.784, 163.401),\n (192.784, 163.401, 192.784, 164.12175),\n (192.784, 164.12175, 192.784, 164.8425),\n (192.784, 164.8425, 192.784, 165.56325),\n (192.784, 165.56325, 192.784, 166.284),\n (192.784, 166.284, 192.784, 167.00475),\n (192.784, 167.00475, 192.784, 167.7255),\n (192.784, 167.7255, 192.784, 168.44625),\n (192.784, 168.44625, 192.784, 169.167),\n (192.784, 169.167, 192.784, 169.88775),\n (192.784, 169.88775, 192.784, 170.6085),\n (192.784, 170.6085, 192.784, 171.32925),\n (192.784, 171.32925, 192.784, 172.05),\n (192.784, 172.05, 192.784, 172.77075),\n (192.784, 172.77075, 192.784, 173.4915),\n (192.784, 173.4915, 192.784, 174.21225),\n (192.784, 174.21225, 192.784, 174.933),\n (192.784, 174.933, 192.784, 175.65375),\n (192.784, 175.65375, 192.784, 176.3745),\n (192.784, 176.3745, 192.784, 177.09525),\n (192.784, 177.09525, 192.784, 177.816),\n (192.784, 154.752, 119.748, 154.752),\n (192.784, 177.816, 119.748, 177.816)\n]\nVISIBLE_CIRCLES = [\n (94.216, 166.284, 11.532)\n]\nVISIBLE_ARCS = [\n\n]\nHIDDEN_SEGMENTS = [\n\n]\n# (orient, text, p1, p2, base) for linear; (orient, text, center, radius, angle) for diameter\nDIMENSIONS = [\n ('diameter', '%%c100', (94.216, 166.284), 11.532, 45),\n ('horizontal', '316.667', (119.748, 166.284), (192.784, 166.284), (156.266, 177.284))\n]\n\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\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\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,\n angle=(0 if d[0] == \"horizontal\" else 90),\n 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,\n text=text, dimstyle=\"EZDXF\").render()\n\n doc.saveas(out_path)\n\n\nif __name__ == \"__main__\":\n out = sys.argv[1] if len(sys.argv) > 1 else \"0088_00889702_gt.dxf\"\n draw(out)\n print(\"wrote\", out)\n```"}], "images": ["images/0088_00889702.png"], "id": "0088_00889702"} {"messages": [{"role": "user", "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": "assistant", "content": "```python\n#!/usr/bin/env python3\n# -*- coding: utf-8 -*-\n# Ground-truth 2D engineering drawing for part: 0090_00905105\n# Self-contained: reproduces the three-view DXF via ezdxf, NO FreeCAD needed.\n# Coordinates are A4 page millimetres (scale=0.18731355932203736, page=[297.0, 210.0]).\n# visible edges -> solid (layer OUTLINE); hidden edges -> dashed (layer HIDDEN)\n# dimensions -> real movable DIMENSION entities (text = true mm value)\n# Run: python 0090_00905105_gt.py [out.dxf]\nimport sys\nimport ezdxf\n\nSCALE = 0.18731355932203736\nPAGE = [297.0, 210.0]\n\nVISIBLE_SEGMENTS = [\n (83.767122, 144.001522, 84.352477, 144.001522),\n (84.352477, 144.001522, 84.937832, 144.001522),\n (84.937832, 144.001522, 85.523187, 144.001522),\n (85.523187, 144.001522, 86.108542, 144.001522),\n (86.108542, 144.001522, 86.693896, 144.001522),\n (86.693896, 144.001522, 87.279251, 144.001522),\n (87.279251, 144.001522, 87.864606, 144.001522),\n (87.864606, 144.001522, 88.449961, 144.001522),\n (88.449961, 144.001522, 89.035316, 144.001522),\n (89.035316, 144.001522, 89.620671, 144.001522),\n (89.620671, 144.001522, 90.206026, 144.001522),\n (90.206026, 144.001522, 90.791381, 144.001522),\n (90.791381, 144.001522, 91.376735, 144.001522),\n (91.376735, 144.001522, 91.96209, 144.001522),\n (91.96209, 144.001522, 92.547445, 144.001522),\n (92.547445, 144.001522, 93.1328, 144.001522),\n (93.1328, 144.001522, 93.718155, 144.001522),\n (93.718155, 144.001522, 94.30351, 144.001522),\n (94.30351, 144.001522, 94.888865, 144.001522),\n (94.888865, 144.001522, 95.474219, 144.001522),\n (95.474219, 144.001522, 96.059574, 144.001522),\n (96.059574, 144.001522, 96.644929, 144.001522),\n (96.644929, 144.001522, 97.230284, 144.001522),\n (97.230284, 144.001522, 97.815639, 144.001522),\n (97.815639, 144.001522, 98.400994, 144.001522),\n (98.400994, 144.001522, 98.986349, 144.001522),\n (98.986349, 144.001522, 99.571704, 144.001522),\n (99.571704, 144.001522, 100.157058, 144.001522),\n (100.157058, 144.001522, 100.742413, 144.001522),\n (100.742413, 144.001522, 101.327768, 144.001522),\n (101.327768, 144.001522, 101.913123, 144.001522),\n (101.913123, 144.001522, 102.498478, 144.001522),\n (102.498478, 144.001522, 102.498478, 66.632878),\n (83.767122, 66.632878, 84.352477, 66.632878),\n (84.352477, 66.632878, 84.937832, 66.632878),\n (84.937832, 66.632878, 85.523187, 66.632878),\n (85.523187, 66.632878, 86.108542, 66.632878),\n (86.108542, 66.632878, 86.693896, 66.632878),\n (86.693896, 66.632878, 87.279251, 66.632878),\n (87.279251, 66.632878, 87.864606, 66.632878),\n (87.864606, 66.632878, 88.449961, 66.632878),\n (88.449961, 66.632878, 89.035316, 66.632878),\n (89.035316, 66.632878, 89.620671, 66.632878),\n (89.620671, 66.632878, 90.206026, 66.632878),\n (90.206026, 66.632878, 90.791381, 66.632878),\n (90.791381, 66.632878, 91.376735, 66.632878),\n (91.376735, 66.632878, 91.96209, 66.632878),\n (91.96209, 66.632878, 92.547445, 66.632878),\n (92.547445, 66.632878, 93.1328, 66.632878),\n (93.1328, 66.632878, 93.718155, 66.632878),\n (93.718155, 66.632878, 94.30351, 66.632878),\n (94.30351, 66.632878, 94.888865, 66.632878),\n (94.888865, 66.632878, 95.474219, 66.632878),\n (95.474219, 66.632878, 96.059574, 66.632878),\n (96.059574, 66.632878, 96.644929, 66.632878),\n (96.644929, 66.632878, 97.230284, 66.632878),\n (97.230284, 66.632878, 97.815639, 66.632878),\n (97.815639, 66.632878, 98.400994, 66.632878),\n (98.400994, 66.632878, 98.986349, 66.632878),\n (98.986349, 66.632878, 99.571704, 66.632878),\n (99.571704, 66.632878, 100.157058, 66.632878),\n (100.157058, 66.632878, 100.742413, 66.632878),\n (100.742413, 66.632878, 101.327768, 66.632878),\n (101.327768, 66.632878, 101.913123, 66.632878),\n (101.913123, 66.632878, 102.498478, 66.632878),\n (83.767122, 144.001522, 83.767122, 66.632878),\n (193.867122, 176.732878, 193.867122, 176.147523),\n (193.867122, 176.147523, 193.867122, 175.562168),\n (193.867122, 175.562168, 193.867122, 174.976813),\n (193.867122, 174.976813, 193.867122, 174.391458),\n (193.867122, 174.391458, 193.867122, 173.806104),\n (193.867122, 173.806104, 193.867122, 173.220749),\n (193.867122, 173.220749, 193.867122, 172.635394),\n (193.867122, 172.635394, 193.867122, 172.050039),\n (193.867122, 172.050039, 193.867122, 171.464684),\n (193.867122, 171.464684, 193.867122, 170.879329),\n (193.867122, 170.879329, 193.867122, 170.293974),\n (193.867122, 170.293974, 193.867122, 169.708619),\n (193.867122, 169.708619, 193.867122, 169.123265),\n (193.867122, 169.123265, 193.867122, 168.53791),\n (193.867122, 168.53791, 193.867122, 167.952555),\n (193.867122, 167.952555, 193.867122, 167.3672),\n (193.867122, 167.3672, 193.867122, 166.781845),\n (193.867122, 166.781845, 193.867122, 166.19649),\n (193.867122, 166.19649, 193.867122, 165.611135),\n (193.867122, 165.611135, 193.867122, 165.025781),\n (193.867122, 165.025781, 193.867122, 164.440426),\n (193.867122, 164.440426, 193.867122, 163.855071),\n (193.867122, 163.855071, 193.867122, 163.269716),\n (193.867122, 163.269716, 193.867122, 162.684361),\n (193.867122, 162.684361, 193.867122, 162.099006),\n (193.867122, 162.099006, 193.867122, 161.513651),\n (193.867122, 161.513651, 193.867122, 160.928296),\n (193.867122, 160.928296, 193.867122, 160.342942),\n (193.867122, 160.342942, 193.867122, 159.757587),\n (193.867122, 159.757587, 193.867122, 159.172232),\n (193.867122, 159.172232, 193.867122, 158.586877),\n (193.867122, 158.586877, 193.867122, 158.001522),\n (116.498478, 176.732878, 116.498478, 176.147523),\n (116.498478, 176.147523, 116.498478, 175.562168),\n (116.498478, 175.562168, 116.498478, 174.976813),\n (116.498478, 174.976813, 116.498478, 174.391458),\n (116.498478, 174.391458, 116.498478, 173.806104),\n (116.498478, 173.806104, 116.498478, 173.220749),\n (116.498478, 173.220749, 116.498478, 172.635394),\n (116.498478, 172.635394, 116.498478, 172.050039),\n (116.498478, 172.050039, 116.498478, 171.464684),\n (116.498478, 171.464684, 116.498478, 170.879329),\n (116.498478, 170.879329, 116.498478, 170.293974),\n (116.498478, 170.293974, 116.498478, 169.708619),\n (116.498478, 169.708619, 116.498478, 169.123265),\n (116.498478, 169.123265, 116.498478, 168.53791),\n (116.498478, 168.53791, 116.498478, 167.952555),\n (116.498478, 167.952555, 116.498478, 167.3672),\n (116.498478, 167.3672, 116.498478, 166.781845),\n (116.498478, 166.781845, 116.498478, 166.19649),\n (116.498478, 166.19649, 116.498478, 165.611135),\n (116.498478, 165.611135, 116.498478, 165.025781),\n (116.498478, 165.025781, 116.498478, 164.440426),\n (116.498478, 164.440426, 116.498478, 163.855071),\n (116.498478, 163.855071, 116.498478, 163.269716),\n (116.498478, 163.269716, 116.498478, 162.684361),\n (116.498478, 162.684361, 116.498478, 162.099006),\n (116.498478, 162.099006, 116.498478, 161.513651),\n (116.498478, 161.513651, 116.498478, 160.928296),\n (116.498478, 160.928296, 116.498478, 160.342942),\n (116.498478, 160.342942, 116.498478, 159.757587),\n (116.498478, 159.757587, 116.498478, 159.172232),\n (116.498478, 159.172232, 116.498478, 158.586877),\n (116.498478, 158.586877, 116.498478, 158.001522),\n (193.867122, 158.001522, 116.498478, 158.001522),\n (193.867122, 176.732878, 116.498478, 176.732878)\n]\nVISIBLE_CIRCLES = [\n (93.1328, 167.3672, 9.365678)\n]\nVISIBLE_ARCS = [\n\n]\nHIDDEN_SEGMENTS = [\n\n]\n# (orient, text, p1, p2, base) for linear; (orient, text, center, radius, angle) for diameter\nDIMENSIONS = [\n ('diameter', '%%c100', (93.1328, 167.3672), 9.3657, 45),\n ('horizontal', '413.043', (116.4985, 167.3672), (193.8672, 167.3672), (155.1828, 178.3672))\n]\n\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\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\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,\n angle=(0 if d[0] == \"horizontal\" else 90),\n 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,\n text=text, dimstyle=\"EZDXF\").render()\n\n doc.saveas(out_path)\n\n\nif __name__ == \"__main__\":\n out = sys.argv[1] if len(sys.argv) > 1 else \"0090_00905105_gt.dxf\"\n draw(out)\n print(\"wrote\", out)\n```"}], "images": ["images/0090_00905105.png"], "id": "0090_00905105"} {"messages": [{"role": "user", "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 104.4 mm."}, {"role": "assistant", "content": "```python\n#!/usr/bin/env python3\n# -*- coding: utf-8 -*-\n# Ground-truth 2D engineering drawing for part: 0091_00910544\n# Self-contained: reproduces the three-view DXF via ezdxf, NO FreeCAD needed.\n# Coordinates are A4 page millimetres (scale=0.4701666666666768, page=[297.0, 210.0]).\n# visible edges -> solid (layer OUTLINE); hidden edges -> dashed (layer HIDDEN)\n# dimensions -> real movable DIMENSION entities (text = true mm value)\n# Run: python 0091_00910544_gt.py [out.dxf]\nimport sys\nimport ezdxf\n\nSCALE = 0.4701666666666768\nPAGE = [297.0, 210.0]\n\nVISIBLE_SEGMENTS = [\n (123.712533, 73.704133, 122.243263, 73.704133),\n (122.243263, 73.704133, 120.773992, 73.704133),\n (120.773992, 73.704133, 119.304721, 73.704133),\n (119.304721, 73.704133, 117.83545, 73.704133),\n (117.83545, 73.704133, 116.366179, 73.704133),\n (116.366179, 73.704133, 114.896908, 73.704133),\n (114.896908, 73.704133, 113.427638, 73.704133),\n (113.427638, 73.704133, 111.958367, 73.704133),\n (111.958367, 73.704133, 110.489096, 73.704133),\n (110.489096, 73.704133, 109.019825, 73.704133),\n (109.019825, 73.704133, 107.550554, 73.704133),\n (107.550554, 73.704133, 106.081283, 73.704133),\n (106.081283, 73.704133, 104.612013, 73.704133),\n (104.612013, 73.704133, 103.142742, 73.704133),\n (103.142742, 73.704133, 101.673471, 73.704133),\n (101.673471, 73.704133, 100.2042, 73.704133),\n (100.2042, 73.704133, 98.734929, 73.704133),\n (98.734929, 73.704133, 97.265658, 73.704133),\n (97.265658, 73.704133, 95.796387, 73.704133),\n (95.796387, 73.704133, 94.327117, 73.704133),\n (94.327117, 73.704133, 92.857846, 73.704133),\n (92.857846, 73.704133, 91.388575, 73.704133),\n (91.388575, 73.704133, 89.919304, 73.704133),\n (89.919304, 73.704133, 88.450033, 73.704133),\n (88.450033, 73.704133, 86.980762, 73.704133),\n (86.980762, 73.704133, 85.511492, 73.704133),\n (85.511492, 73.704133, 84.042221, 73.704133),\n (84.042221, 73.704133, 82.57295, 73.704133),\n (82.57295, 73.704133, 81.103679, 73.704133),\n (81.103679, 73.704133, 79.634408, 73.704133),\n (79.634408, 73.704133, 78.165137, 73.704133),\n (78.165137, 73.704133, 76.695867, 73.704133),\n (123.712533, 73.704133, 123.712533, 122.787466),\n (123.712533, 122.787466, 122.243263, 122.787466),\n (122.243263, 122.787466, 120.773992, 122.787466),\n (120.773992, 122.787466, 119.304721, 122.787466),\n (119.304721, 122.787466, 117.83545, 122.787466),\n (117.83545, 122.787466, 116.366179, 122.787466),\n (116.366179, 122.787466, 114.896908, 122.787466),\n (114.896908, 122.787466, 113.427638, 122.787466),\n (113.427638, 122.787466, 111.958367, 122.787466),\n (111.958367, 122.787466, 110.489096, 122.787466),\n (110.489096, 122.787466, 109.019825, 122.787466),\n (109.019825, 122.787466, 107.550554, 122.787466),\n (107.550554, 122.787466, 106.081283, 122.787466),\n (106.081283, 122.787466, 104.612013, 122.787466),\n (104.612013, 122.787466, 103.142742, 122.787466),\n (103.142742, 122.787466, 101.673471, 122.787466),\n (101.673471, 122.787466, 100.2042, 122.787466),\n (100.2042, 122.787466, 98.734929, 122.787466),\n (98.734929, 122.787466, 97.265658, 122.787466),\n (97.265658, 122.787466, 95.796387, 122.787466),\n (95.796387, 122.787466, 94.327117, 122.787466),\n (94.327117, 122.787466, 92.857846, 122.787466),\n (92.857846, 122.787466, 91.388575, 122.787466),\n (91.388575, 122.787466, 89.919304, 122.787466),\n (89.919304, 122.787466, 88.450033, 122.787466),\n (88.450033, 122.787466, 86.980762, 122.787466),\n (86.980762, 122.787466, 85.511492, 122.787466),\n (85.511492, 122.787466, 84.042221, 122.787466),\n (84.042221, 122.787466, 82.57295, 122.787466),\n (82.57295, 122.787466, 81.103679, 122.787466),\n (81.103679, 122.787466, 79.634408, 122.787466),\n (79.634408, 122.787466, 78.165137, 122.787466),\n (78.165137, 122.787466, 76.695867, 122.787466),\n (76.695867, 122.787466, 76.695867, 73.704133),\n (137.712534, 136.787467, 137.712534, 138.256737),\n (137.712534, 138.256737, 137.712534, 139.726008),\n (137.712534, 139.726008, 137.712534, 141.195279),\n (137.712534, 141.195279, 137.712534, 142.66455),\n (137.712534, 142.66455, 137.712534, 144.133821),\n (137.712534, 144.133821, 137.712534, 145.603092),\n (137.712534, 145.603092, 137.712534, 147.072362),\n (137.712534, 147.072362, 137.712534, 148.541633),\n (137.712534, 148.541633, 137.712534, 150.010904),\n (137.712534, 150.010904, 137.712534, 151.480175),\n (137.712534, 151.480175, 137.712534, 152.949446),\n (137.712534, 152.949446, 137.712534, 154.418717),\n (137.712534, 154.418717, 137.712534, 155.887987),\n (137.712534, 155.887987, 137.712534, 157.357258),\n (137.712534, 157.357258, 137.712534, 158.826529),\n (137.712534, 158.826529, 137.712534, 160.2958),\n (137.712534, 160.2958, 137.712534, 161.765071),\n (137.712534, 161.765071, 137.712534, 163.234342),\n (137.712534, 163.234342, 137.712534, 164.703613),\n (137.712534, 164.703613, 137.712534, 166.172883),\n (137.712534, 166.172883, 137.712534, 167.642154),\n (137.712534, 167.642154, 137.712534, 169.111425),\n (137.712534, 169.111425, 137.712534, 170.580696),\n (137.712534, 170.580696, 137.712534, 172.049967),\n (137.712534, 172.049967, 137.712534, 173.519238),\n (137.712534, 173.519238, 137.712534, 174.988508),\n (137.712534, 174.988508, 137.712534, 176.457779),\n (137.712534, 176.457779, 137.712534, 177.92705),\n (137.712534, 177.92705, 137.712534, 179.396321),\n (137.712534, 179.396321, 137.712534, 180.865592),\n (137.712534, 180.865592, 137.712534, 182.334863),\n (137.712534, 182.334863, 137.712534, 183.804133),\n (186.795867, 136.787467, 186.795867, 138.256737),\n (186.795867, 138.256737, 186.795867, 139.726008),\n (186.795867, 139.726008, 186.795867, 141.195279),\n (186.795867, 141.195279, 186.795867, 142.66455),\n (186.795867, 142.66455, 186.795867, 144.133821),\n (186.795867, 144.133821, 186.795867, 145.603092),\n (186.795867, 145.603092, 186.795867, 147.072362),\n (186.795867, 147.072362, 186.795867, 148.541633),\n (186.795867, 148.541633, 186.795867, 150.010904),\n (186.795867, 150.010904, 186.795867, 151.480175),\n (186.795867, 151.480175, 186.795867, 152.949446),\n (186.795867, 152.949446, 186.795867, 154.418717),\n (186.795867, 154.418717, 186.795867, 155.887987),\n (186.795867, 155.887987, 186.795867, 157.357258),\n (186.795867, 157.357258, 186.795867, 158.826529),\n (186.795867, 158.826529, 186.795867, 160.2958),\n (186.795867, 160.2958, 186.795867, 161.765071),\n (186.795867, 161.765071, 186.795867, 163.234342),\n (186.795867, 163.234342, 186.795867, 164.703613),\n (186.795867, 164.703613, 186.795867, 166.172883),\n (186.795867, 166.172883, 186.795867, 167.642154),\n (186.795867, 167.642154, 186.795867, 169.111425),\n (186.795867, 169.111425, 186.795867, 170.580696),\n (186.795867, 170.580696, 186.795867, 172.049967),\n (186.795867, 172.049967, 186.795867, 173.519238),\n (186.795867, 173.519238, 186.795867, 174.988508),\n (186.795867, 174.988508, 186.795867, 176.457779),\n (186.795867, 176.457779, 186.795867, 177.92705),\n (186.795867, 177.92705, 186.795867, 179.396321),\n (186.795867, 179.396321, 186.795867, 180.865592),\n (186.795867, 180.865592, 186.795867, 182.334863),\n (186.795867, 182.334863, 186.795867, 183.804133),\n (186.795867, 136.787467, 137.712534, 136.787467),\n (186.795867, 183.804133, 137.712534, 183.804133)\n]\nVISIBLE_CIRCLES = [\n (100.2042, 160.2958, 23.508333)\n]\nVISIBLE_ARCS = [\n\n]\nHIDDEN_SEGMENTS = [\n\n]\n# (orient, text, p1, p2, base) for linear; (orient, text, center, radius, angle) for diameter\nDIMENSIONS = [\n ('diameter', '%%c100', (100.2042, 160.2958), 23.5083, 45),\n ('horizontal', '104.396', (137.7125, 160.2958), (186.7958, 160.2958), (162.2542, 171.2958))\n]\n\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\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\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,\n angle=(0 if d[0] == \"horizontal\" else 90),\n 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,\n text=text, dimstyle=\"EZDXF\").render()\n\n doc.saveas(out_path)\n\n\nif __name__ == \"__main__\":\n out = sys.argv[1] if len(sys.argv) > 1 else \"0091_00910544_gt.dxf\"\n draw(out)\n print(\"wrote\", out)\n```"}], "images": ["images/0091_00910544.png"], "id": "0091_00910544"} {"messages": [{"role": "user", "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 -452.38 mm."}, {"role": "assistant", "content": "```python\n#!/usr/bin/env python3\n# -*- coding: utf-8 -*-\n# Ground-truth 2D engineering drawing for part: 0092_00921788\n# Self-contained: reproduces the three-view DXF via ezdxf, NO FreeCAD needed.\n# Coordinates are A4 page millimetres (scale=0.173974137931051, page=[297.0, 210.0]).\n# visible edges -> solid (layer OUTLINE); hidden edges -> dashed (layer HIDDEN)\n# dimensions -> real movable DIMENSION entities (text = true mm value)\n# Run: python 0092_00921788_gt.py [out.dxf]\nimport sys\nimport ezdxf\n\nSCALE = 0.173974137931051\nPAGE = [297.0, 210.0]\n\nVISIBLE_SEGMENTS = [\n (101.498107, 145.001893, 101.498107, 66.299307),\n (101.498107, 66.299307, 100.954438, 66.299307),\n (100.954438, 66.299307, 100.410769, 66.299307),\n (100.410769, 66.299307, 99.867099, 66.299307),\n (99.867099, 66.299307, 99.32343, 66.299307),\n (99.32343, 66.299307, 98.779761, 66.299307),\n (98.779761, 66.299307, 98.236092, 66.299307),\n (98.236092, 66.299307, 97.692423, 66.299307),\n (97.692423, 66.299307, 97.148753, 66.299307),\n (97.148753, 66.299307, 96.605084, 66.299307),\n (96.605084, 66.299307, 96.061415, 66.299307),\n (96.061415, 66.299307, 95.517746, 66.299307),\n (95.517746, 66.299307, 94.974077, 66.299307),\n (94.974077, 66.299307, 94.430408, 66.299307),\n (94.430408, 66.299307, 93.886738, 66.299307),\n (93.886738, 66.299307, 93.343069, 66.299307),\n (93.343069, 66.299307, 92.7994, 66.299307),\n (92.7994, 66.299307, 92.255731, 66.299307),\n (92.255731, 66.299307, 91.712062, 66.299307),\n (91.712062, 66.299307, 91.168392, 66.299307),\n (91.168392, 66.299307, 90.624723, 66.299307),\n (90.624723, 66.299307, 90.081054, 66.299307),\n (90.081054, 66.299307, 89.537385, 66.299307),\n (89.537385, 66.299307, 88.993716, 66.299307),\n (88.993716, 66.299307, 88.450047, 66.299307),\n (88.450047, 66.299307, 87.906377, 66.299307),\n (87.906377, 66.299307, 87.362708, 66.299307),\n (87.362708, 66.299307, 86.819039, 66.299307),\n (86.819039, 66.299307, 86.27537, 66.299307),\n (86.27537, 66.299307, 85.731701, 66.299307),\n (85.731701, 66.299307, 85.188031, 66.299307),\n (85.188031, 66.299307, 84.644362, 66.299307),\n (84.644362, 66.299307, 84.100693, 66.299307),\n (101.498107, 145.001893, 100.954438, 145.001893),\n (100.954438, 145.001893, 100.410769, 145.001893),\n (100.410769, 145.001893, 99.867099, 145.001893),\n (99.867099, 145.001893, 99.32343, 145.001893),\n (99.32343, 145.001893, 98.779761, 145.001893),\n (98.779761, 145.001893, 98.236092, 145.001893),\n (98.236092, 145.001893, 97.692423, 145.001893),\n (97.692423, 145.001893, 97.148753, 145.001893),\n (97.148753, 145.001893, 96.605084, 145.001893),\n (96.605084, 145.001893, 96.061415, 145.001893),\n (96.061415, 145.001893, 95.517746, 145.001893),\n (95.517746, 145.001893, 94.974077, 145.001893),\n (94.974077, 145.001893, 94.430408, 145.001893),\n (94.430408, 145.001893, 93.886738, 145.001893),\n (93.886738, 145.001893, 93.343069, 145.001893),\n (93.343069, 145.001893, 92.7994, 145.001893),\n (92.7994, 145.001893, 92.255731, 145.001893),\n (92.255731, 145.001893, 91.712062, 145.001893),\n (91.712062, 145.001893, 91.168392, 145.001893),\n (91.168392, 145.001893, 90.624723, 145.001893),\n (90.624723, 145.001893, 90.081054, 145.001893),\n (90.081054, 145.001893, 89.537385, 145.001893),\n (89.537385, 145.001893, 88.993716, 145.001893),\n (88.993716, 145.001893, 88.450047, 145.001893),\n (88.450047, 145.001893, 87.906377, 145.001893),\n (87.906377, 145.001893, 87.362708, 145.001893),\n (87.362708, 145.001893, 86.819039, 145.001893),\n (86.819039, 145.001893, 86.27537, 145.001893),\n (86.27537, 145.001893, 85.731701, 145.001893),\n (85.731701, 145.001893, 85.188031, 145.001893),\n (85.188031, 145.001893, 84.644362, 145.001893),\n (84.644362, 145.001893, 84.100693, 145.001893),\n (84.100693, 66.299307, 84.100693, 145.001893),\n (115.498107, 159.001893, 115.498107, 159.545562),\n (115.498107, 159.545562, 115.498107, 160.089231),\n (115.498107, 160.089231, 115.498107, 160.632901),\n (115.498107, 160.632901, 115.498107, 161.17657),\n (115.498107, 161.17657, 115.498107, 161.720239),\n (115.498107, 161.720239, 115.498107, 162.263908),\n (115.498107, 162.263908, 115.498107, 162.807577),\n (115.498107, 162.807577, 115.498107, 163.351247),\n (115.498107, 163.351247, 115.498107, 163.894916),\n (115.498107, 163.894916, 115.498107, 164.438585),\n (115.498107, 164.438585, 115.498107, 164.982254),\n (115.498107, 164.982254, 115.498107, 165.525923),\n (115.498107, 165.525923, 115.498107, 166.069592),\n (115.498107, 166.069592, 115.498107, 166.613262),\n (115.498107, 166.613262, 115.498107, 167.156931),\n (115.498107, 167.156931, 115.498107, 167.7006),\n (115.498107, 167.7006, 115.498107, 168.244269),\n (115.498107, 168.244269, 115.498107, 168.787938),\n (115.498107, 168.787938, 115.498107, 169.331608),\n (115.498107, 169.331608, 115.498107, 169.875277),\n (115.498107, 169.875277, 115.498107, 170.418946),\n (115.498107, 170.418946, 115.498107, 170.962615),\n (115.498107, 170.962615, 115.498107, 171.506284),\n (115.498107, 171.506284, 115.498107, 172.049953),\n (115.498107, 172.049953, 115.498107, 172.593623),\n (115.498107, 172.593623, 115.498107, 173.137292),\n (115.498107, 173.137292, 115.498107, 173.680961),\n (115.498107, 173.680961, 115.498107, 174.22463),\n (115.498107, 174.22463, 115.498107, 174.768299),\n (115.498107, 174.768299, 115.498107, 175.311969),\n (115.498107, 175.311969, 115.498107, 175.855638),\n (115.498107, 175.855638, 115.498107, 176.399307),\n (194.200693, 159.001893, 194.200693, 159.545562),\n (194.200693, 159.545562, 194.200693, 160.089231),\n (194.200693, 160.089231, 194.200693, 160.632901),\n (194.200693, 160.632901, 194.200693, 161.17657),\n (194.200693, 161.17657, 194.200693, 161.720239),\n (194.200693, 161.720239, 194.200693, 162.263908),\n (194.200693, 162.263908, 194.200693, 162.807577),\n (194.200693, 162.807577, 194.200693, 163.351247),\n (194.200693, 163.351247, 194.200693, 163.894916),\n (194.200693, 163.894916, 194.200693, 164.438585),\n (194.200693, 164.438585, 194.200693, 164.982254),\n (194.200693, 164.982254, 194.200693, 165.525923),\n (194.200693, 165.525923, 194.200693, 166.069592),\n (194.200693, 166.069592, 194.200693, 166.613262),\n (194.200693, 166.613262, 194.200693, 167.156931),\n (194.200693, 167.156931, 194.200693, 167.7006),\n (194.200693, 167.7006, 194.200693, 168.244269),\n (194.200693, 168.244269, 194.200693, 168.787938),\n (194.200693, 168.787938, 194.200693, 169.331608),\n (194.200693, 169.331608, 194.200693, 169.875277),\n (194.200693, 169.875277, 194.200693, 170.418946),\n (194.200693, 170.418946, 194.200693, 170.962615),\n (194.200693, 170.962615, 194.200693, 171.506284),\n (194.200693, 171.506284, 194.200693, 172.049953),\n (194.200693, 172.049953, 194.200693, 172.593623),\n (194.200693, 172.593623, 194.200693, 173.137292),\n (194.200693, 173.137292, 194.200693, 173.680961),\n (194.200693, 173.680961, 194.200693, 174.22463),\n (194.200693, 174.22463, 194.200693, 174.768299),\n (194.200693, 174.768299, 194.200693, 175.311969),\n (194.200693, 175.311969, 194.200693, 175.855638),\n (194.200693, 175.855638, 194.200693, 176.399307),\n (115.498107, 176.399307, 194.200693, 176.399307),\n (115.498107, 159.001893, 194.200693, 159.001893)\n]\nVISIBLE_CIRCLES = [\n (92.7994, 167.7006, 8.698707)\n]\nVISIBLE_ARCS = [\n\n]\nHIDDEN_SEGMENTS = [\n\n]\n# (orient, text, p1, p2, base) for linear; (orient, text, center, radius, angle) for diameter\nDIMENSIONS = [\n ('diameter', '%%c100', (92.7994, 167.7006), 8.6987, 45),\n ('horizontal', '452.381', (194.2006, 167.7006), (115.4981, 167.7006), (154.8493, 156.7006))\n]\n\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\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\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,\n angle=(0 if d[0] == \"horizontal\" else 90),\n 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,\n text=text, dimstyle=\"EZDXF\").render()\n\n doc.saveas(out_path)\n\n\nif __name__ == \"__main__\":\n out = sys.argv[1] if len(sys.argv) > 1 else \"0092_00921788_gt.dxf\"\n draw(out)\n print(\"wrote\", out)\n```"}], "images": ["images/0092_00921788.png"], "id": "0092_00921788"} {"messages": [{"role": "user", "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 3.09 mm."}, {"role": "assistant", "content": "```python\n#!/usr/bin/env python3\n# -*- coding: utf-8 -*-\n# Ground-truth 2D engineering drawing for part: 0092_00928753\n# Self-contained: reproduces the three-view DXF via ezdxf, NO FreeCAD needed.\n# Coordinates are A4 page millimetres (scale=0.9321730344174267, page=[297.0, 210.0]).\n# visible edges -> solid (layer OUTLINE); hidden edges -> dashed (layer HIDDEN)\n# dimensions -> real movable DIMENSION entities (text = true mm value)\n# Run: python 0092_00928753_gt.py [out.dxf]\nimport sys\nimport ezdxf\n\nSCALE = 0.9321730344174267\nPAGE = [297.0, 210.0]\n\nVISIBLE_SEGMENTS = [\n (158.362952, 85.254352, 155.449911, 85.254352),\n (155.449911, 85.254352, 152.53687, 85.254352),\n (152.53687, 85.254352, 149.62383, 85.254352),\n (149.62383, 85.254352, 146.710789, 85.254352),\n (146.710789, 85.254352, 143.797748, 85.254352),\n (143.797748, 85.254352, 140.884707, 85.254352),\n (140.884707, 85.254352, 137.971667, 85.254352),\n (137.971667, 85.254352, 135.058626, 85.254352),\n (135.058626, 85.254352, 132.145585, 85.254352),\n (132.145585, 85.254352, 129.232544, 85.254352),\n (129.232544, 85.254352, 126.319504, 85.254352),\n (126.319504, 85.254352, 123.406463, 85.254352),\n (123.406463, 85.254352, 120.493422, 85.254352),\n (120.493422, 85.254352, 117.580381, 85.254352),\n (117.580381, 85.254352, 114.667341, 85.254352),\n (114.667341, 85.254352, 111.7543, 85.254352),\n (111.7543, 85.254352, 108.841259, 85.254352),\n (108.841259, 85.254352, 105.928219, 85.254352),\n (105.928219, 85.254352, 103.015178, 85.254352),\n (103.015178, 85.254352, 100.102137, 85.254352),\n (100.102137, 85.254352, 97.189096, 85.254352),\n (97.189096, 85.254352, 94.276056, 85.254352),\n (94.276056, 85.254352, 91.363015, 85.254352),\n (91.363015, 85.254352, 88.449974, 85.254352),\n (88.449974, 85.254352, 85.536933, 85.254352),\n (85.536933, 85.254352, 82.623893, 85.254352),\n (82.623893, 85.254352, 79.710852, 85.254352),\n (79.710852, 85.254352, 76.797811, 85.254352),\n (76.797811, 85.254352, 73.88477, 85.254352),\n (73.88477, 85.254352, 70.97173, 85.254352),\n (70.97173, 85.254352, 68.058689, 85.254352),\n (68.058689, 85.254352, 65.145648, 85.254352),\n (158.362952, 85.254352, 158.362952, 88.137048),\n (158.362952, 88.137048, 155.449911, 88.137048),\n (155.449911, 88.137048, 152.53687, 88.137048),\n (152.53687, 88.137048, 149.62383, 88.137048),\n (149.62383, 88.137048, 146.710789, 88.137048),\n (146.710789, 88.137048, 143.797748, 88.137048),\n (143.797748, 88.137048, 140.884707, 88.137048),\n (140.884707, 88.137048, 137.971667, 88.137048),\n (137.971667, 88.137048, 135.058626, 88.137048),\n (135.058626, 88.137048, 132.145585, 88.137048),\n (132.145585, 88.137048, 129.232544, 88.137048),\n (129.232544, 88.137048, 126.319504, 88.137048),\n (126.319504, 88.137048, 123.406463, 88.137048),\n (123.406463, 88.137048, 120.493422, 88.137048),\n (120.493422, 88.137048, 117.580381, 88.137048),\n (117.580381, 88.137048, 114.667341, 88.137048),\n (114.667341, 88.137048, 111.7543, 88.137048),\n (111.7543, 88.137048, 108.841259, 88.137048),\n (108.841259, 88.137048, 105.928219, 88.137048),\n (105.928219, 88.137048, 103.015178, 88.137048),\n (103.015178, 88.137048, 100.102137, 88.137048),\n (100.102137, 88.137048, 97.189096, 88.137048),\n (97.189096, 88.137048, 94.276056, 88.137048),\n (94.276056, 88.137048, 91.363015, 88.137048),\n (91.363015, 88.137048, 88.449974, 88.137048),\n (88.449974, 88.137048, 85.536933, 88.137048),\n (85.536933, 88.137048, 82.623893, 88.137048),\n (82.623893, 88.137048, 79.710852, 88.137048),\n (79.710852, 88.137048, 76.797811, 88.137048),\n (76.797811, 88.137048, 73.88477, 88.137048),\n (73.88477, 88.137048, 70.97173, 88.137048),\n (70.97173, 88.137048, 68.058689, 88.137048),\n (68.058689, 88.137048, 65.145648, 88.137048),\n (65.145648, 88.137048, 65.145648, 85.254352),\n (172.362952, 102.137048, 172.362952, 105.050089),\n (172.362952, 105.050089, 172.362952, 107.96313),\n (172.362952, 107.96313, 172.362952, 110.87617),\n (172.362952, 110.87617, 172.362952, 113.789211),\n (172.362952, 113.789211, 172.362952, 116.702252),\n (172.362952, 116.702252, 172.362952, 119.615293),\n (172.362952, 119.615293, 172.362952, 122.528333),\n (172.362952, 122.528333, 172.362952, 125.441374),\n (172.362952, 125.441374, 172.362952, 128.354415),\n (172.362952, 128.354415, 172.362952, 131.267456),\n (172.362952, 131.267456, 172.362952, 134.180496),\n (172.362952, 134.180496, 172.362952, 137.093537),\n (172.362952, 137.093537, 172.362952, 140.006578),\n (172.362952, 140.006578, 172.362952, 142.919619),\n (172.362952, 142.919619, 172.362952, 145.832659),\n (172.362952, 145.832659, 172.362952, 148.7457),\n (172.362952, 148.7457, 172.362952, 151.658741),\n (172.362952, 151.658741, 172.362952, 154.571781),\n (172.362952, 154.571781, 172.362952, 157.484822),\n (172.362952, 157.484822, 172.362952, 160.397863),\n (172.362952, 160.397863, 172.362952, 163.310904),\n (172.362952, 163.310904, 172.362952, 166.223944),\n (172.362952, 166.223944, 172.362952, 169.136985),\n (172.362952, 169.136985, 172.362952, 172.050026),\n (172.362952, 172.050026, 172.362952, 174.963067),\n (172.362952, 174.963067, 172.362952, 177.876107),\n (172.362952, 177.876107, 172.362952, 180.789148),\n (172.362952, 180.789148, 172.362952, 183.702189),\n (172.362952, 183.702189, 172.362952, 186.61523),\n (172.362952, 186.61523, 172.362952, 189.52827),\n (172.362952, 189.52827, 172.362952, 192.441311),\n (172.362952, 192.441311, 172.362952, 195.354352),\n (175.245648, 102.137048, 175.245648, 105.050089),\n (175.245648, 105.050089, 175.245648, 107.96313),\n (175.245648, 107.96313, 175.245648, 110.87617),\n (175.245648, 110.87617, 175.245648, 113.789211),\n (175.245648, 113.789211, 175.245648, 116.702252),\n (175.245648, 116.702252, 175.245648, 119.615293),\n (175.245648, 119.615293, 175.245648, 122.528333),\n (175.245648, 122.528333, 175.245648, 125.441374),\n (175.245648, 125.441374, 175.245648, 128.354415),\n (175.245648, 128.354415, 175.245648, 131.267456),\n (175.245648, 131.267456, 175.245648, 134.180496),\n (175.245648, 134.180496, 175.245648, 137.093537),\n (175.245648, 137.093537, 175.245648, 140.006578),\n (175.245648, 140.006578, 175.245648, 142.919619),\n (175.245648, 142.919619, 175.245648, 145.832659),\n (175.245648, 145.832659, 175.245648, 148.7457),\n (175.245648, 148.7457, 175.245648, 151.658741),\n (175.245648, 151.658741, 175.245648, 154.571781),\n (175.245648, 154.571781, 175.245648, 157.484822),\n (175.245648, 157.484822, 175.245648, 160.397863),\n (175.245648, 160.397863, 175.245648, 163.310904),\n (175.245648, 163.310904, 175.245648, 166.223944),\n (175.245648, 166.223944, 175.245648, 169.136985),\n (175.245648, 169.136985, 175.245648, 172.050026),\n (175.245648, 172.050026, 175.245648, 174.963067),\n (175.245648, 174.963067, 175.245648, 177.876107),\n (175.245648, 177.876107, 175.245648, 180.789148),\n (175.245648, 180.789148, 175.245648, 183.702189),\n (175.245648, 183.702189, 175.245648, 186.61523),\n (175.245648, 186.61523, 175.245648, 189.52827),\n (175.245648, 189.52827, 175.245648, 192.441311),\n (175.245648, 192.441311, 175.245648, 195.354352),\n (175.245648, 102.137048, 172.362952, 102.137048),\n (175.245648, 195.354352, 172.362952, 195.354352)\n]\nVISIBLE_CIRCLES = [\n (111.7543, 148.7457, 46.608652)\n]\nVISIBLE_ARCS = [\n\n]\nHIDDEN_SEGMENTS = [\n\n]\n# (orient, text, p1, p2, base) for linear; (orient, text, center, radius, angle) for diameter\nDIMENSIONS = [\n ('diameter', '%%c100', (111.7543, 148.7457), 46.6087, 45),\n ('horizontal', '3.0924', (172.363, 148.7457), (175.2456, 148.7457), (173.8043, 159.7457))\n]\n\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\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\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,\n angle=(0 if d[0] == \"horizontal\" else 90),\n 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,\n text=text, dimstyle=\"EZDXF\").render()\n\n doc.saveas(out_path)\n\n\nif __name__ == \"__main__\":\n out = sys.argv[1] if len(sys.argv) > 1 else \"0092_00928753_gt.dxf\"\n draw(out)\n print(\"wrote\", out)\n```"}], "images": ["images/0092_00928753.png"], "id": "0092_00928753"} {"messages": [{"role": "user", "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.91 mm."}, {"role": "assistant", "content": "```python\n#!/usr/bin/env python3\n# -*- coding: utf-8 -*-\n# Ground-truth 2D engineering drawing for part: 0095_00958524\n# Self-contained: reproduces the three-view DXF via ezdxf, NO FreeCAD needed.\n# Coordinates are A4 page millimetres (scale=0.608927914565419, page=[297.0, 210.0]).\n# visible edges -> solid (layer OUTLINE); hidden edges -> dashed (layer HIDDEN)\n# dimensions -> real movable DIMENSION entities (text = true mm value)\n# Run: python 0095_00958524_gt.py [out.dxf]\nimport sys\nimport ezdxf\n\nSCALE = 0.608927914565419\nPAGE = [297.0, 210.0]\n\nVISIBLE_SEGMENTS = [\n (134.119596, 94.7768, 134.119596, 77.173196),\n (73.226804, 77.173196, 75.129704, 77.173196),\n (75.129704, 77.173196, 77.032604, 77.173196),\n (77.032604, 77.173196, 78.935503, 77.173196),\n (78.935503, 77.173196, 80.838403, 77.173196),\n (80.838403, 77.173196, 82.741303, 77.173196),\n (82.741303, 77.173196, 84.644203, 77.173196),\n (84.644203, 77.173196, 86.547102, 77.173196),\n (86.547102, 77.173196, 88.450002, 77.173196),\n (88.450002, 77.173196, 90.352902, 77.173196),\n (90.352902, 77.173196, 92.255802, 77.173196),\n (92.255802, 77.173196, 94.158701, 77.173196),\n (94.158701, 77.173196, 96.061601, 77.173196),\n (96.061601, 77.173196, 97.964501, 77.173196),\n (97.964501, 77.173196, 99.867401, 77.173196),\n (99.867401, 77.173196, 101.7703, 77.173196),\n (101.7703, 77.173196, 103.6732, 77.173196),\n (103.6732, 77.173196, 105.5761, 77.173196),\n (105.5761, 77.173196, 107.478999, 77.173196),\n (107.478999, 77.173196, 109.381899, 77.173196),\n (109.381899, 77.173196, 111.284799, 77.173196),\n (111.284799, 77.173196, 113.187699, 77.173196),\n (113.187699, 77.173196, 115.090598, 77.173196),\n (115.090598, 77.173196, 116.993498, 77.173196),\n (116.993498, 77.173196, 118.896398, 77.173196),\n (118.896398, 77.173196, 120.799298, 77.173196),\n (120.799298, 77.173196, 122.702197, 77.173196),\n (122.702197, 77.173196, 124.605097, 77.173196),\n (124.605097, 77.173196, 126.507997, 77.173196),\n (126.507997, 77.173196, 128.410897, 77.173196),\n (128.410897, 77.173196, 130.313796, 77.173196),\n (130.313796, 77.173196, 132.216696, 77.173196),\n (132.216696, 77.173196, 134.119596, 77.173196),\n (134.119596, 94.7768, 134.119596, 112.380404),\n (73.226804, 112.380404, 75.129704, 112.380404),\n (75.129704, 112.380404, 77.032604, 112.380404),\n (77.032604, 112.380404, 78.935503, 112.380404),\n (78.935503, 112.380404, 80.838403, 112.380404),\n (80.838403, 112.380404, 82.741303, 112.380404),\n (82.741303, 112.380404, 84.644203, 112.380404),\n (84.644203, 112.380404, 86.547102, 112.380404),\n (86.547102, 112.380404, 88.450002, 112.380404),\n (88.450002, 112.380404, 90.352902, 112.380404),\n (90.352902, 112.380404, 92.255802, 112.380404),\n (92.255802, 112.380404, 94.158701, 112.380404),\n (94.158701, 112.380404, 96.061601, 112.380404),\n (96.061601, 112.380404, 97.964501, 112.380404),\n (97.964501, 112.380404, 99.867401, 112.380404),\n (99.867401, 112.380404, 101.7703, 112.380404),\n (101.7703, 112.380404, 103.6732, 112.380404),\n (103.6732, 112.380404, 105.5761, 112.380404),\n (105.5761, 112.380404, 107.478999, 112.380404),\n (107.478999, 112.380404, 109.381899, 112.380404),\n (109.381899, 112.380404, 111.284799, 112.380404),\n (111.284799, 112.380404, 113.187699, 112.380404),\n (113.187699, 112.380404, 115.090598, 112.380404),\n (115.090598, 112.380404, 116.993498, 112.380404),\n (116.993498, 112.380404, 118.896398, 112.380404),\n (118.896398, 112.380404, 120.799298, 112.380404),\n (120.799298, 112.380404, 122.702197, 112.380404),\n (122.702197, 112.380404, 124.605097, 112.380404),\n (124.605097, 112.380404, 126.507997, 112.380404),\n (126.507997, 112.380404, 128.410897, 112.380404),\n (128.410897, 112.380404, 130.313796, 112.380404),\n (130.313796, 112.380404, 132.216696, 112.380404),\n (132.216696, 112.380404, 134.119596, 112.380404),\n (73.226804, 77.173196, 73.226804, 94.7768),\n (73.226804, 112.380404, 73.226804, 94.7768),\n (148.119596, 187.273196, 148.119596, 185.370296),\n (148.119596, 185.370296, 148.119596, 183.467396),\n (148.119596, 183.467396, 148.119596, 181.564497),\n (148.119596, 181.564497, 148.119596, 179.661597),\n (148.119596, 179.661597, 148.119596, 177.758697),\n (148.119596, 177.758697, 148.119596, 175.855797),\n (148.119596, 175.855797, 148.119596, 173.952898),\n (148.119596, 173.952898, 148.119596, 172.049998),\n (148.119596, 172.049998, 148.119596, 170.147098),\n (148.119596, 170.147098, 148.119596, 168.244198),\n (148.119596, 168.244198, 148.119596, 166.341299),\n (148.119596, 166.341299, 148.119596, 164.438399),\n (148.119596, 164.438399, 148.119596, 162.535499),\n (148.119596, 162.535499, 148.119596, 160.632599),\n (148.119596, 160.632599, 148.119596, 158.7297),\n (148.119596, 158.7297, 148.119596, 156.8268),\n (148.119596, 156.8268, 148.119596, 154.9239),\n (148.119596, 154.9239, 148.119596, 153.021001),\n (148.119596, 153.021001, 148.119596, 151.118101),\n (148.119596, 151.118101, 148.119596, 149.215201),\n (148.119596, 149.215201, 148.119596, 147.312301),\n (148.119596, 147.312301, 148.119596, 145.409402),\n (148.119596, 145.409402, 148.119596, 143.506502),\n (148.119596, 143.506502, 148.119596, 141.603602),\n (148.119596, 141.603602, 148.119596, 139.700702),\n (148.119596, 139.700702, 148.119596, 137.797803),\n (148.119596, 137.797803, 148.119596, 135.894903),\n (148.119596, 135.894903, 148.119596, 133.992003),\n (148.119596, 133.992003, 148.119596, 132.089103),\n (148.119596, 132.089103, 148.119596, 130.186204),\n (148.119596, 130.186204, 148.119596, 128.283304),\n (148.119596, 128.283304, 148.119596, 126.380404),\n (183.326804, 187.273196, 183.326804, 185.370296),\n (183.326804, 185.370296, 183.326804, 183.467396),\n (183.326804, 183.467396, 183.326804, 181.564497),\n (183.326804, 181.564497, 183.326804, 179.661597),\n (183.326804, 179.661597, 183.326804, 177.758697),\n (183.326804, 177.758697, 183.326804, 175.855797),\n (183.326804, 175.855797, 183.326804, 173.952898),\n (183.326804, 173.952898, 183.326804, 172.049998),\n (183.326804, 172.049998, 183.326804, 170.147098),\n (183.326804, 170.147098, 183.326804, 168.244198),\n (183.326804, 168.244198, 183.326804, 166.341299),\n (183.326804, 166.341299, 183.326804, 164.438399),\n (183.326804, 164.438399, 183.326804, 162.535499),\n (183.326804, 162.535499, 183.326804, 160.632599),\n (183.326804, 160.632599, 183.326804, 158.7297),\n (183.326804, 158.7297, 183.326804, 156.8268),\n (183.326804, 156.8268, 183.326804, 154.9239),\n (183.326804, 154.9239, 183.326804, 153.021001),\n (183.326804, 153.021001, 183.326804, 151.118101),\n (183.326804, 151.118101, 183.326804, 149.215201),\n (183.326804, 149.215201, 183.326804, 147.312301),\n (183.326804, 147.312301, 183.326804, 145.409402),\n (183.326804, 145.409402, 183.326804, 143.506502),\n (183.326804, 143.506502, 183.326804, 141.603602),\n (183.326804, 141.603602, 183.326804, 139.700702),\n (183.326804, 139.700702, 183.326804, 137.797803),\n (183.326804, 137.797803, 183.326804, 135.894903),\n (183.326804, 135.894903, 183.326804, 133.992003),\n (183.326804, 133.992003, 183.326804, 132.089103),\n (183.326804, 132.089103, 183.326804, 130.186204),\n (183.326804, 130.186204, 183.326804, 128.283304),\n (183.326804, 128.283304, 183.326804, 126.380404),\n (148.119596, 187.273196, 165.7232, 187.273196),\n (148.119596, 126.380404, 165.7232, 126.380404),\n (183.326804, 126.380404, 165.7232, 126.380404),\n (183.326804, 187.273196, 165.7232, 187.273196)\n]\nVISIBLE_CIRCLES = [\n (103.6732, 156.8268, 30.446396)\n]\nVISIBLE_ARCS = [\n\n]\nHIDDEN_SEGMENTS = [\n\n]\n# (orient, text, p1, p2, base) for linear; (orient, text, center, radius, angle) for diameter\nDIMENSIONS = [\n ('diameter', '%%c100', (103.6732, 156.8268), 30.4464, 45),\n ('horizontal', '57.8184', (183.3268, 156.8268), (148.1196, 156.8268), (165.7232, 145.8268))\n]\n\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\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\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,\n angle=(0 if d[0] == \"horizontal\" else 90),\n 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,\n text=text, dimstyle=\"EZDXF\").render()\n\n doc.saveas(out_path)\n\n\nif __name__ == \"__main__\":\n out = sys.argv[1] if len(sys.argv) > 1 else \"0095_00958524_gt.dxf\"\n draw(out)\n print(\"wrote\", out)\n```"}], "images": ["images/0095_00958524.png"], "id": "0095_00958524"} {"messages": [{"role": "user", "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 71.97 mm."}, {"role": "assistant", "content": "```python\n#!/usr/bin/env python3\n# -*- coding: utf-8 -*-\n# Ground-truth 2D engineering drawing for part: 0095_00958770\n# Self-contained: reproduces the three-view DXF via ezdxf, NO FreeCAD needed.\n# Coordinates are A4 page millimetres (scale=0.5588193832599118, page=[297.0, 210.0]).\n# visible edges -> solid (layer OUTLINE); hidden edges -> dashed (layer HIDDEN)\n# dimensions -> real movable DIMENSION entities (text = true mm value)\n# Run: python 0095_00958770_gt.py [out.dxf]\nimport sys\nimport ezdxf\n\nSCALE = 0.5588193832599118\nPAGE = [297.0, 210.0]\n\nVISIBLE_SEGMENTS = [\n (130.361469, 75.920469, 128.615159, 75.920469),\n (128.615159, 75.920469, 126.868848, 75.920469),\n (126.868848, 75.920469, 125.122537, 75.920469),\n (125.122537, 75.920469, 123.376227, 75.920469),\n (123.376227, 75.920469, 121.629916, 75.920469),\n (121.629916, 75.920469, 119.883606, 75.920469),\n (119.883606, 75.920469, 118.137295, 75.920469),\n (118.137295, 75.920469, 116.390985, 75.920469),\n (116.390985, 75.920469, 114.644674, 75.920469),\n (114.644674, 75.920469, 112.898363, 75.920469),\n (112.898363, 75.920469, 111.152053, 75.920469),\n (111.152053, 75.920469, 109.405742, 75.920469),\n (109.405742, 75.920469, 107.659432, 75.920469),\n (107.659432, 75.920469, 105.913121, 75.920469),\n (105.913121, 75.920469, 104.166811, 75.920469),\n (104.166811, 75.920469, 102.4205, 75.920469),\n (102.4205, 75.920469, 100.674189, 75.920469),\n (100.674189, 75.920469, 98.927879, 75.920469),\n (98.927879, 75.920469, 97.181568, 75.920469),\n (97.181568, 75.920469, 95.435258, 75.920469),\n (95.435258, 75.920469, 93.688947, 75.920469),\n (93.688947, 75.920469, 91.942637, 75.920469),\n (91.942637, 75.920469, 90.196326, 75.920469),\n (90.196326, 75.920469, 88.450015, 75.920469),\n (88.450015, 75.920469, 86.703705, 75.920469),\n (86.703705, 75.920469, 84.957394, 75.920469),\n (84.957394, 75.920469, 83.211084, 75.920469),\n (83.211084, 75.920469, 81.464773, 75.920469),\n (81.464773, 75.920469, 79.718463, 75.920469),\n (79.718463, 75.920469, 77.972152, 75.920469),\n (77.972152, 75.920469, 76.225841, 75.920469),\n (76.225841, 75.920469, 74.479531, 75.920469),\n (130.361469, 75.920469, 130.361469, 116.138531),\n (130.361469, 116.138531, 128.615159, 116.138531),\n (128.615159, 116.138531, 126.868848, 116.138531),\n (126.868848, 116.138531, 125.122537, 116.138531),\n (125.122537, 116.138531, 123.376227, 116.138531),\n (123.376227, 116.138531, 121.629916, 116.138531),\n (121.629916, 116.138531, 119.883606, 116.138531),\n (119.883606, 116.138531, 118.137295, 116.138531),\n (118.137295, 116.138531, 116.390985, 116.138531),\n (116.390985, 116.138531, 114.644674, 116.138531),\n (114.644674, 116.138531, 112.898363, 116.138531),\n (112.898363, 116.138531, 111.152053, 116.138531),\n (111.152053, 116.138531, 109.405742, 116.138531),\n (109.405742, 116.138531, 107.659432, 116.138531),\n (107.659432, 116.138531, 105.913121, 116.138531),\n (105.913121, 116.138531, 104.166811, 116.138531),\n (104.166811, 116.138531, 102.4205, 116.138531),\n (102.4205, 116.138531, 100.674189, 116.138531),\n (100.674189, 116.138531, 98.927879, 116.138531),\n (98.927879, 116.138531, 97.181568, 116.138531),\n (97.181568, 116.138531, 95.435258, 116.138531),\n (95.435258, 116.138531, 93.688947, 116.138531),\n (93.688947, 116.138531, 91.942637, 116.138531),\n (91.942637, 116.138531, 90.196326, 116.138531),\n (90.196326, 116.138531, 88.450015, 116.138531),\n (88.450015, 116.138531, 86.703705, 116.138531),\n (86.703705, 116.138531, 84.957394, 116.138531),\n (84.957394, 116.138531, 83.211084, 116.138531),\n (83.211084, 116.138531, 81.464773, 116.138531),\n (81.464773, 116.138531, 79.718463, 116.138531),\n (79.718463, 116.138531, 77.972152, 116.138531),\n (77.972152, 116.138531, 76.225841, 116.138531),\n (76.225841, 116.138531, 74.479531, 116.138531),\n (74.479531, 116.138531, 74.479531, 75.920469),\n (144.361469, 130.138531, 144.361469, 131.884841),\n (144.361469, 131.884841, 144.361469, 133.631152),\n (144.361469, 133.631152, 144.361469, 135.377463),\n (144.361469, 135.377463, 144.361469, 137.123773),\n (144.361469, 137.123773, 144.361469, 138.870084),\n (144.361469, 138.870084, 144.361469, 140.616394),\n (144.361469, 140.616394, 144.361469, 142.362705),\n (144.361469, 142.362705, 144.361469, 144.109015),\n (144.361469, 144.109015, 144.361469, 145.855326),\n (144.361469, 145.855326, 144.361469, 147.601637),\n (144.361469, 147.601637, 144.361469, 149.347947),\n (144.361469, 149.347947, 144.361469, 151.094258),\n (144.361469, 151.094258, 144.361469, 152.840568),\n (144.361469, 152.840568, 144.361469, 154.586879),\n (144.361469, 154.586879, 144.361469, 156.333189),\n (144.361469, 156.333189, 144.361469, 158.0795),\n (144.361469, 158.0795, 144.361469, 159.825811),\n (144.361469, 159.825811, 144.361469, 161.572121),\n (144.361469, 161.572121, 144.361469, 163.318432),\n (144.361469, 163.318432, 144.361469, 165.064742),\n (144.361469, 165.064742, 144.361469, 166.811053),\n (144.361469, 166.811053, 144.361469, 168.557363),\n (144.361469, 168.557363, 144.361469, 170.303674),\n (144.361469, 170.303674, 144.361469, 172.049985),\n (144.361469, 172.049985, 144.361469, 173.796295),\n (144.361469, 173.796295, 144.361469, 175.542606),\n (144.361469, 175.542606, 144.361469, 177.288916),\n (144.361469, 177.288916, 144.361469, 179.035227),\n (144.361469, 179.035227, 144.361469, 180.781537),\n (144.361469, 180.781537, 144.361469, 182.527848),\n (144.361469, 182.527848, 144.361469, 184.274159),\n (144.361469, 184.274159, 144.361469, 186.020469),\n (184.579531, 130.138531, 184.579531, 131.884841),\n (184.579531, 131.884841, 184.579531, 133.631152),\n (184.579531, 133.631152, 184.579531, 135.377463),\n (184.579531, 135.377463, 184.579531, 137.123773),\n (184.579531, 137.123773, 184.579531, 138.870084),\n (184.579531, 138.870084, 184.579531, 140.616394),\n (184.579531, 140.616394, 184.579531, 142.362705),\n (184.579531, 142.362705, 184.579531, 144.109015),\n (184.579531, 144.109015, 184.579531, 145.855326),\n (184.579531, 145.855326, 184.579531, 147.601637),\n (184.579531, 147.601637, 184.579531, 149.347947),\n (184.579531, 149.347947, 184.579531, 151.094258),\n (184.579531, 151.094258, 184.579531, 152.840568),\n (184.579531, 152.840568, 184.579531, 154.586879),\n (184.579531, 154.586879, 184.579531, 156.333189),\n (184.579531, 156.333189, 184.579531, 158.0795),\n (184.579531, 158.0795, 184.579531, 159.825811),\n (184.579531, 159.825811, 184.579531, 161.572121),\n (184.579531, 161.572121, 184.579531, 163.318432),\n (184.579531, 163.318432, 184.579531, 165.064742),\n (184.579531, 165.064742, 184.579531, 166.811053),\n (184.579531, 166.811053, 184.579531, 168.557363),\n (184.579531, 168.557363, 184.579531, 170.303674),\n (184.579531, 170.303674, 184.579531, 172.049985),\n (184.579531, 172.049985, 184.579531, 173.796295),\n (184.579531, 173.796295, 184.579531, 175.542606),\n (184.579531, 175.542606, 184.579531, 177.288916),\n (184.579531, 177.288916, 184.579531, 179.035227),\n (184.579531, 179.035227, 184.579531, 180.781537),\n (184.579531, 180.781537, 184.579531, 182.527848),\n (184.579531, 182.527848, 184.579531, 184.274159),\n (184.579531, 184.274159, 184.579531, 186.020469),\n (184.579531, 130.138531, 144.361469, 130.138531),\n (184.579531, 186.020469, 144.361469, 186.020469)\n]\nVISIBLE_CIRCLES = [\n (102.4205, 158.0795, 27.940969)\n]\nVISIBLE_ARCS = [\n\n]\nHIDDEN_SEGMENTS = [\n\n]\n# (orient, text, p1, p2, base) for linear; (orient, text, center, radius, angle) for diameter\nDIMENSIONS = [\n ('diameter', '%%c100', (102.4205, 158.0795), 27.941, 45),\n ('horizontal', '71.9697', (144.3615, 158.0795), (184.5795, 158.0795), (164.4705, 169.0795))\n]\n\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\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\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,\n angle=(0 if d[0] == \"horizontal\" else 90),\n 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,\n text=text, dimstyle=\"EZDXF\").render()\n\n doc.saveas(out_path)\n\n\nif __name__ == \"__main__\":\n out = sys.argv[1] if len(sys.argv) > 1 else \"0095_00958770_gt.dxf\"\n draw(out)\n print(\"wrote\", out)\n```"}], "images": ["images/0095_00958770.png"], "id": "0095_00958770"} {"messages": [{"role": "user", "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": "assistant", "content": "```python\n#!/usr/bin/env python3\n# -*- coding: utf-8 -*-\n# Ground-truth 2D engineering drawing for part: 0098_00981713\n# Self-contained: reproduces the three-view DXF via ezdxf, NO FreeCAD needed.\n# Coordinates are A4 page millimetres (scale=0.19381512605042148, page=[297.0, 210.0]).\n# visible edges -> solid (layer OUTLINE); hidden edges -> dashed (layer HIDDEN)\n# dimensions -> real movable DIMENSION entities (text = true mm value)\n# Run: python 0098_00981713_gt.py [out.dxf]\nimport sys\nimport ezdxf\n\nSCALE = 0.19381512605042148\nPAGE = [297.0, 210.0]\n\nVISIBLE_SEGMENTS = [\n (102.986156, 66.795356, 102.380484, 66.795356),\n (102.380484, 66.795356, 101.774812, 66.795356),\n (101.774812, 66.795356, 101.169139, 66.795356),\n (101.169139, 66.795356, 100.563467, 66.795356),\n (100.563467, 66.795356, 99.957795, 66.795356),\n (99.957795, 66.795356, 99.352123, 66.795356),\n (99.352123, 66.795356, 98.74645, 66.795356),\n (98.74645, 66.795356, 98.140778, 66.795356),\n (98.140778, 66.795356, 97.535106, 66.795356),\n (97.535106, 66.795356, 96.929434, 66.795356),\n (96.929434, 66.795356, 96.323761, 66.795356),\n (96.323761, 66.795356, 95.718089, 66.795356),\n (95.718089, 66.795356, 95.112417, 66.795356),\n (95.112417, 66.795356, 94.506745, 66.795356),\n (94.506745, 66.795356, 93.901072, 66.795356),\n (93.901072, 66.795356, 93.2954, 66.795356),\n (93.2954, 66.795356, 92.689728, 66.795356),\n (92.689728, 66.795356, 92.084055, 66.795356),\n (92.084055, 66.795356, 91.478383, 66.795356),\n (91.478383, 66.795356, 90.872711, 66.795356),\n (90.872711, 66.795356, 90.267039, 66.795356),\n (90.267039, 66.795356, 89.661366, 66.795356),\n (89.661366, 66.795356, 89.055694, 66.795356),\n (89.055694, 66.795356, 88.450022, 66.795356),\n (88.450022, 66.795356, 87.84435, 66.795356),\n (87.84435, 66.795356, 87.238677, 66.795356),\n (87.238677, 66.795356, 86.633005, 66.795356),\n (86.633005, 66.795356, 86.027333, 66.795356),\n (86.027333, 66.795356, 85.421661, 66.795356),\n (85.421661, 66.795356, 84.815988, 66.795356),\n (84.815988, 66.795356, 84.210316, 66.795356),\n (84.210316, 66.795356, 83.604644, 66.795356),\n (102.986156, 66.795356, 102.986156, 143.513843),\n (102.986156, 143.513843, 102.380484, 143.513843),\n (102.380484, 143.513843, 101.774812, 143.513843),\n (101.774812, 143.513843, 101.169139, 143.513843),\n (101.169139, 143.513843, 100.563467, 143.513843),\n (100.563467, 143.513843, 99.957795, 143.513843),\n (99.957795, 143.513843, 99.352123, 143.513843),\n (99.352123, 143.513843, 98.74645, 143.513843),\n (98.74645, 143.513843, 98.140778, 143.513843),\n (98.140778, 143.513843, 97.535106, 143.513843),\n (97.535106, 143.513843, 96.929434, 143.513843),\n (96.929434, 143.513843, 96.323761, 143.513843),\n (96.323761, 143.513843, 95.718089, 143.513843),\n (95.718089, 143.513843, 95.112417, 143.513843),\n (95.112417, 143.513843, 94.506745, 143.513843),\n (94.506745, 143.513843, 93.901072, 143.513843),\n (93.901072, 143.513843, 93.2954, 143.513843),\n (93.2954, 143.513843, 92.689728, 143.513843),\n (92.689728, 143.513843, 92.084055, 143.513843),\n (92.084055, 143.513843, 91.478383, 143.513843),\n (91.478383, 143.513843, 90.872711, 143.513843),\n (90.872711, 143.513843, 90.267039, 143.513843),\n (90.267039, 143.513843, 89.661366, 143.513843),\n (89.661366, 143.513843, 89.055694, 143.513843),\n (89.055694, 143.513843, 88.450022, 143.513843),\n (88.450022, 143.513843, 87.84435, 143.513843),\n (87.84435, 143.513843, 87.238677, 143.513843),\n (87.238677, 143.513843, 86.633005, 143.513843),\n (86.633005, 143.513843, 86.027333, 143.513843),\n (86.027333, 143.513843, 85.421661, 143.513843),\n (85.421661, 143.513843, 84.815988, 143.513843),\n (84.815988, 143.513843, 84.210316, 143.513843),\n (84.210316, 143.513843, 83.604644, 143.513843),\n (83.604644, 143.513843, 83.604644, 66.795356),\n (116.986157, 157.513844, 116.986157, 158.119516),\n (116.986157, 158.119516, 116.986157, 158.725188),\n (116.986157, 158.725188, 116.986157, 159.330861),\n (116.986157, 159.330861, 116.986157, 159.936533),\n (116.986157, 159.936533, 116.986157, 160.542205),\n (116.986157, 160.542205, 116.986157, 161.147877),\n (116.986157, 161.147877, 116.986157, 161.75355),\n (116.986157, 161.75355, 116.986157, 162.359222),\n (116.986157, 162.359222, 116.986157, 162.964894),\n (116.986157, 162.964894, 116.986157, 163.570566),\n (116.986157, 163.570566, 116.986157, 164.176239),\n (116.986157, 164.176239, 116.986157, 164.781911),\n (116.986157, 164.781911, 116.986157, 165.387583),\n (116.986157, 165.387583, 116.986157, 165.993255),\n (116.986157, 165.993255, 116.986157, 166.598928),\n (116.986157, 166.598928, 116.986157, 167.2046),\n (116.986157, 167.2046, 116.986157, 167.810272),\n (116.986157, 167.810272, 116.986157, 168.415945),\n (116.986157, 168.415945, 116.986157, 169.021617),\n (116.986157, 169.021617, 116.986157, 169.627289),\n (116.986157, 169.627289, 116.986157, 170.232961),\n (116.986157, 170.232961, 116.986157, 170.838634),\n (116.986157, 170.838634, 116.986157, 171.444306),\n (116.986157, 171.444306, 116.986157, 172.049978),\n (116.986157, 172.049978, 116.986157, 172.65565),\n (116.986157, 172.65565, 116.986157, 173.261323),\n (116.986157, 173.261323, 116.986157, 173.866995),\n (116.986157, 173.866995, 116.986157, 174.472667),\n (116.986157, 174.472667, 116.986157, 175.078339),\n (116.986157, 175.078339, 116.986157, 175.684012),\n (116.986157, 175.684012, 116.986157, 176.289684),\n (116.986157, 176.289684, 116.986157, 176.895356),\n (193.704644, 157.513844, 193.704644, 158.119516),\n (193.704644, 158.119516, 193.704644, 158.725188),\n (193.704644, 158.725188, 193.704644, 159.330861),\n (193.704644, 159.330861, 193.704644, 159.936533),\n (193.704644, 159.936533, 193.704644, 160.542205),\n (193.704644, 160.542205, 193.704644, 161.147877),\n (193.704644, 161.147877, 193.704644, 161.75355),\n (193.704644, 161.75355, 193.704644, 162.359222),\n (193.704644, 162.359222, 193.704644, 162.964894),\n (193.704644, 162.964894, 193.704644, 163.570566),\n (193.704644, 163.570566, 193.704644, 164.176239),\n (193.704644, 164.176239, 193.704644, 164.781911),\n (193.704644, 164.781911, 193.704644, 165.387583),\n (193.704644, 165.387583, 193.704644, 165.993255),\n (193.704644, 165.993255, 193.704644, 166.598928),\n (193.704644, 166.598928, 193.704644, 167.2046),\n (193.704644, 167.2046, 193.704644, 167.810272),\n (193.704644, 167.810272, 193.704644, 168.415945),\n (193.704644, 168.415945, 193.704644, 169.021617),\n (193.704644, 169.021617, 193.704644, 169.627289),\n (193.704644, 169.627289, 193.704644, 170.232961),\n (193.704644, 170.232961, 193.704644, 170.838634),\n (193.704644, 170.838634, 193.704644, 171.444306),\n (193.704644, 171.444306, 193.704644, 172.049978),\n (193.704644, 172.049978, 193.704644, 172.65565),\n (193.704644, 172.65565, 193.704644, 173.261323),\n (193.704644, 173.261323, 193.704644, 173.866995),\n (193.704644, 173.866995, 193.704644, 174.472667),\n (193.704644, 174.472667, 193.704644, 175.078339),\n (193.704644, 175.078339, 193.704644, 175.684012),\n (193.704644, 175.684012, 193.704644, 176.289684),\n (193.704644, 176.289684, 193.704644, 176.895356),\n (193.704644, 157.513844, 116.986157, 157.513844),\n (193.704644, 176.895356, 116.986157, 176.895356)\n]\nVISIBLE_CIRCLES = [\n (93.2954, 167.2046, 9.690756)\n]\nVISIBLE_ARCS = [\n\n]\nHIDDEN_SEGMENTS = [\n\n]\n# (orient, text, p1, p2, base) for linear; (orient, text, center, radius, angle) for diameter\nDIMENSIONS = [\n ('diameter', '%%c100', (93.2954, 167.2046), 9.6908, 45),\n ('horizontal', '395.833', (116.9861, 167.2046), (193.7046, 167.2046), (155.3454, 178.2046))\n]\n\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\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\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,\n angle=(0 if d[0] == \"horizontal\" else 90),\n 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,\n text=text, dimstyle=\"EZDXF\").render()\n\n doc.saveas(out_path)\n\n\nif __name__ == \"__main__\":\n out = sys.argv[1] if len(sys.argv) > 1 else \"0098_00981713_gt.dxf\"\n draw(out)\n print(\"wrote\", out)\n```"}], "images": ["images/0098_00981713.png"], "id": "0098_00981713"} {"messages": [{"role": "user", "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 26.8 mm."}, {"role": "assistant", "content": "```python\n#!/usr/bin/env python3\n# -*- coding: utf-8 -*-\n# Ground-truth 2D engineering drawing for part: 0099_00990430\n# Self-contained: reproduces the three-view DXF via ezdxf, NO FreeCAD needed.\n# Coordinates are A4 page millimetres (scale=0.7578791716583932, page=[297.0, 210.0]).\n# visible edges -> solid (layer OUTLINE); hidden edges -> dashed (layer HIDDEN)\n# dimensions -> real movable DIMENSION entities (text = true mm value)\n# Run: python 0099_00990430_gt.py [out.dxf]\nimport sys\nimport ezdxf\n\nSCALE = 0.7578791716583932\nPAGE = [297.0, 210.0]\n\nVISIBLE_SEGMENTS = [\n (145.290959, 80.896958, 142.922586, 80.896958),\n (142.922586, 80.896958, 140.554214, 80.896958),\n (140.554214, 80.896958, 138.185841, 80.896958),\n (138.185841, 80.896958, 135.817469, 80.896958),\n (135.817469, 80.896958, 133.449097, 80.896958),\n (133.449097, 80.896958, 131.080724, 80.896958),\n (131.080724, 80.896958, 128.712352, 80.896958),\n (128.712352, 80.896958, 126.343979, 80.896958),\n (126.343979, 80.896958, 123.975607, 80.896958),\n (123.975607, 80.896958, 121.607234, 80.896958),\n (121.607234, 80.896958, 119.238862, 80.896958),\n (119.238862, 80.896958, 116.87049, 80.896958),\n (116.87049, 80.896958, 114.502117, 80.896958),\n (114.502117, 80.896958, 112.133745, 80.896958),\n (112.133745, 80.896958, 109.765372, 80.896958),\n (109.765372, 80.896958, 107.397, 80.896958),\n (107.397, 80.896958, 105.028628, 80.896958),\n (105.028628, 80.896958, 102.660255, 80.896958),\n (102.660255, 80.896958, 100.291883, 80.896958),\n (100.291883, 80.896958, 97.92351, 80.896958),\n (97.92351, 80.896958, 95.555138, 80.896958),\n (95.555138, 80.896958, 93.186766, 80.896958),\n (93.186766, 80.896958, 90.818393, 80.896958),\n (90.818393, 80.896958, 88.450021, 80.896958),\n (88.450021, 80.896958, 86.081648, 80.896958),\n (86.081648, 80.896958, 83.713276, 80.896958),\n (83.713276, 80.896958, 81.344903, 80.896958),\n (81.344903, 80.896958, 78.976531, 80.896958),\n (78.976531, 80.896958, 76.608159, 80.896958),\n (76.608159, 80.896958, 74.239786, 80.896958),\n (74.239786, 80.896958, 71.871414, 80.896958),\n (71.871414, 80.896958, 69.503041, 80.896958),\n (145.290959, 80.896958, 145.290959, 101.209041),\n (145.290959, 101.209041, 142.922586, 101.209041),\n (142.922586, 101.209041, 140.554214, 101.209041),\n (140.554214, 101.209041, 138.185841, 101.209041),\n (138.185841, 101.209041, 135.817469, 101.209041),\n (135.817469, 101.209041, 133.449097, 101.209041),\n (133.449097, 101.209041, 131.080724, 101.209041),\n (131.080724, 101.209041, 128.712352, 101.209041),\n (128.712352, 101.209041, 126.343979, 101.209041),\n (126.343979, 101.209041, 123.975607, 101.209041),\n (123.975607, 101.209041, 121.607234, 101.209041),\n (121.607234, 101.209041, 119.238862, 101.209041),\n (119.238862, 101.209041, 116.87049, 101.209041),\n (116.87049, 101.209041, 114.502117, 101.209041),\n (114.502117, 101.209041, 112.133745, 101.209041),\n (112.133745, 101.209041, 109.765372, 101.209041),\n (109.765372, 101.209041, 107.397, 101.209041),\n (107.397, 101.209041, 105.028628, 101.209041),\n (105.028628, 101.209041, 102.660255, 101.209041),\n (102.660255, 101.209041, 100.291883, 101.209041),\n (100.291883, 101.209041, 97.92351, 101.209041),\n (97.92351, 101.209041, 95.555138, 101.209041),\n (95.555138, 101.209041, 93.186766, 101.209041),\n (93.186766, 101.209041, 90.818393, 101.209041),\n (90.818393, 101.209041, 88.450021, 101.209041),\n (88.450021, 101.209041, 86.081648, 101.209041),\n (86.081648, 101.209041, 83.713276, 101.209041),\n (83.713276, 101.209041, 81.344903, 101.209041),\n (81.344903, 101.209041, 78.976531, 101.209041),\n (78.976531, 101.209041, 76.608159, 101.209041),\n (76.608159, 101.209041, 74.239786, 101.209041),\n (74.239786, 101.209041, 71.871414, 101.209041),\n (71.871414, 101.209041, 69.503041, 101.209041),\n (69.503041, 101.209041, 69.503041, 80.896958),\n (159.290959, 115.209041, 159.290959, 117.577414),\n (159.290959, 117.577414, 159.290959, 119.945786),\n (159.290959, 119.945786, 159.290959, 122.314159),\n (159.290959, 122.314159, 159.290959, 124.682531),\n (159.290959, 124.682531, 159.290959, 127.050903),\n (159.290959, 127.050903, 159.290959, 129.419276),\n (159.290959, 129.419276, 159.290959, 131.787648),\n (159.290959, 131.787648, 159.290959, 134.156021),\n (159.290959, 134.156021, 159.290959, 136.524393),\n (159.290959, 136.524393, 159.290959, 138.892766),\n (159.290959, 138.892766, 159.290959, 141.261138),\n (159.290959, 141.261138, 159.290959, 143.62951),\n (159.290959, 143.62951, 159.290959, 145.997883),\n (159.290959, 145.997883, 159.290959, 148.366255),\n (159.290959, 148.366255, 159.290959, 150.734628),\n (159.290959, 150.734628, 159.290959, 153.103),\n (159.290959, 153.103, 159.290959, 155.471372),\n (159.290959, 155.471372, 159.290959, 157.839745),\n (159.290959, 157.839745, 159.290959, 160.208117),\n (159.290959, 160.208117, 159.290959, 162.57649),\n (159.290959, 162.57649, 159.290959, 164.944862),\n (159.290959, 164.944862, 159.290959, 167.313234),\n (159.290959, 167.313234, 159.290959, 169.681607),\n (159.290959, 169.681607, 159.290959, 172.049979),\n (159.290959, 172.049979, 159.290959, 174.418352),\n (159.290959, 174.418352, 159.290959, 176.786724),\n (159.290959, 176.786724, 159.290959, 179.155097),\n (159.290959, 179.155097, 159.290959, 181.523469),\n (159.290959, 181.523469, 159.290959, 183.891841),\n (159.290959, 183.891841, 159.290959, 186.260214),\n (159.290959, 186.260214, 159.290959, 188.628586),\n (159.290959, 188.628586, 159.290959, 190.996959),\n (179.603042, 115.209041, 179.603042, 117.577414),\n (179.603042, 117.577414, 179.603042, 119.945786),\n (179.603042, 119.945786, 179.603042, 122.314159),\n (179.603042, 122.314159, 179.603042, 124.682531),\n (179.603042, 124.682531, 179.603042, 127.050903),\n (179.603042, 127.050903, 179.603042, 129.419276),\n (179.603042, 129.419276, 179.603042, 131.787648),\n (179.603042, 131.787648, 179.603042, 134.156021),\n (179.603042, 134.156021, 179.603042, 136.524393),\n (179.603042, 136.524393, 179.603042, 138.892766),\n (179.603042, 138.892766, 179.603042, 141.261138),\n (179.603042, 141.261138, 179.603042, 143.62951),\n (179.603042, 143.62951, 179.603042, 145.997883),\n (179.603042, 145.997883, 179.603042, 148.366255),\n (179.603042, 148.366255, 179.603042, 150.734628),\n (179.603042, 150.734628, 179.603042, 153.103),\n (179.603042, 153.103, 179.603042, 155.471372),\n (179.603042, 155.471372, 179.603042, 157.839745),\n (179.603042, 157.839745, 179.603042, 160.208117),\n (179.603042, 160.208117, 179.603042, 162.57649),\n (179.603042, 162.57649, 179.603042, 164.944862),\n (179.603042, 164.944862, 179.603042, 167.313234),\n (179.603042, 167.313234, 179.603042, 169.681607),\n (179.603042, 169.681607, 179.603042, 172.049979),\n (179.603042, 172.049979, 179.603042, 174.418352),\n (179.603042, 174.418352, 179.603042, 176.786724),\n (179.603042, 176.786724, 179.603042, 179.155097),\n (179.603042, 179.155097, 179.603042, 181.523469),\n (179.603042, 181.523469, 179.603042, 183.891841),\n (179.603042, 183.891841, 179.603042, 186.260214),\n (179.603042, 186.260214, 179.603042, 188.628586),\n (179.603042, 188.628586, 179.603042, 190.996959),\n (179.603042, 115.209041, 159.290959, 115.209041),\n (179.603042, 190.996959, 159.290959, 190.996959)\n]\nVISIBLE_CIRCLES = [\n (107.397, 153.103, 37.893959)\n]\nVISIBLE_ARCS = [\n\n]\nHIDDEN_SEGMENTS = [\n\n]\n# (orient, text, p1, p2, base) for linear; (orient, text, center, radius, angle) for diameter\nDIMENSIONS = [\n ('diameter', '%%c100', (107.397, 153.103), 37.894, 45),\n ('horizontal', '26.8012', (159.2909, 153.103), (179.603, 153.103), (169.447, 164.103))\n]\n\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\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\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,\n angle=(0 if d[0] == \"horizontal\" else 90),\n 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,\n text=text, dimstyle=\"EZDXF\").render()\n\n doc.saveas(out_path)\n\n\nif __name__ == \"__main__\":\n out = sys.argv[1] if len(sys.argv) > 1 else \"0099_00990430_gt.dxf\"\n draw(out)\n print(\"wrote\", out)\n```"}], "images": ["images/0099_00990430.png"], "id": "0099_00990430"} {"messages": [{"role": "user", "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 8.33 mm. It is extruded to a thickness of 12.37 mm."}, {"role": "assistant", "content": "```python\n#!/usr/bin/env python3\n# -*- coding: utf-8 -*-\n# Ground-truth 2D engineering drawing for part: 0000_00004434\n# Self-contained: reproduces the three-view DXF via ezdxf, NO FreeCAD needed.\n# Coordinates are A4 page millimetres (scale=0.8552120509849338, page=[297.0, 210.0]).\n# visible edges -> solid (layer OUTLINE); hidden edges -> dashed (layer HIDDEN)\n# dimensions -> real movable DIMENSION entities (text = true mm value)\n# Run: python 0000_00004434_gt.py [out.dxf]\nimport sys\nimport ezdxf\n\nSCALE = 0.8552120509849338\nPAGE = [297.0, 210.0]\n\nVISIBLE_SEGMENTS = [\n (162.390203, 83.330302, 159.717665, 83.330302),\n (159.717665, 83.330302, 157.045127, 83.330302),\n (157.045127, 83.330302, 154.37259, 83.330302),\n (154.37259, 83.330302, 151.700052, 83.330302),\n (151.700052, 83.330302, 149.027514, 83.330302),\n (149.027514, 83.330302, 146.354977, 83.330302),\n (146.354977, 83.330302, 143.682439, 83.330302),\n (143.682439, 83.330302, 141.009901, 83.330302),\n (141.009901, 83.330302, 138.337364, 83.330302),\n (138.337364, 83.330302, 135.664826, 83.330302),\n (135.664826, 83.330302, 132.992288, 83.330302),\n (132.992288, 83.330302, 130.319751, 83.330302),\n (130.319751, 83.330302, 127.647213, 83.330302),\n (127.647213, 83.330302, 124.974675, 83.330302),\n (124.974675, 83.330302, 122.302138, 83.330302),\n (122.302138, 83.330302, 119.6296, 83.330302),\n (119.6296, 83.330302, 116.957062, 83.330302),\n (116.957062, 83.330302, 114.284525, 83.330302),\n (114.284525, 83.330302, 111.611987, 83.330302),\n (111.611987, 83.330302, 108.939449, 83.330302),\n (108.939449, 83.330302, 106.266912, 83.330302),\n (106.266912, 83.330302, 103.594374, 83.330302),\n (103.594374, 83.330302, 100.921836, 83.330302),\n (100.921836, 83.330302, 98.249299, 83.330302),\n (98.249299, 83.330302, 95.576761, 83.330302),\n (95.576761, 83.330302, 92.904223, 83.330302),\n (92.904223, 83.330302, 90.231686, 83.330302),\n (90.231686, 83.330302, 87.559148, 83.330302),\n (87.559148, 83.330302, 84.88661, 83.330302),\n (84.88661, 83.330302, 82.214073, 83.330302),\n (82.214073, 83.330302, 79.541535, 83.330302),\n (79.541535, 83.330302, 76.868997, 83.330302),\n (162.390203, 83.330302, 162.390203, 93.909097),\n (162.390203, 93.909097, 159.717665, 93.909097),\n (159.717665, 93.909097, 157.045127, 93.909097),\n (157.045127, 93.909097, 154.37259, 93.909097),\n (154.37259, 93.909097, 151.700052, 93.909097),\n (151.700052, 93.909097, 149.027514, 93.909097),\n (149.027514, 93.909097, 146.354977, 93.909097),\n (146.354977, 93.909097, 143.682439, 93.909097),\n (143.682439, 93.909097, 141.009901, 93.909097),\n (141.009901, 93.909097, 138.337364, 93.909097),\n (138.337364, 93.909097, 135.664826, 93.909097),\n (135.664826, 93.909097, 132.992288, 93.909097),\n (132.992288, 93.909097, 130.319751, 93.909097),\n (130.319751, 93.909097, 127.647213, 93.909097),\n (127.647213, 93.909097, 124.974675, 93.909097),\n (124.974675, 93.909097, 122.302138, 93.909097),\n (122.302138, 93.909097, 119.6296, 93.909097),\n (119.6296, 93.909097, 116.957062, 93.909097),\n (116.957062, 93.909097, 114.284525, 93.909097),\n (114.284525, 93.909097, 111.611987, 93.909097),\n (111.611987, 93.909097, 108.939449, 93.909097),\n (108.939449, 93.909097, 106.266912, 93.909097),\n (106.266912, 93.909097, 103.594374, 93.909097),\n (103.594374, 93.909097, 100.921836, 93.909097),\n (100.921836, 93.909097, 98.249299, 93.909097),\n (98.249299, 93.909097, 95.576761, 93.909097),\n (95.576761, 93.909097, 92.904223, 93.909097),\n (92.904223, 93.909097, 90.231686, 93.909097),\n (90.231686, 93.909097, 87.559148, 93.909097),\n (87.559148, 93.909097, 84.88661, 93.909097),\n (84.88661, 93.909097, 82.214073, 93.909097),\n (82.214073, 93.909097, 79.541535, 93.909097),\n (79.541535, 93.909097, 76.868997, 93.909097),\n (76.868997, 93.909097, 76.868997, 83.330302),\n (176.390203, 107.909097, 176.390203, 110.581635),\n (176.390203, 110.581635, 176.390203, 113.254173),\n (176.390203, 113.254173, 176.390203, 115.92671),\n (176.390203, 115.92671, 176.390203, 118.599248),\n (176.390203, 118.599248, 176.390203, 121.271786),\n (176.390203, 121.271786, 176.390203, 123.944323),\n (176.390203, 123.944323, 176.390203, 126.616861),\n (176.390203, 126.616861, 176.390203, 129.289399),\n (176.390203, 129.289399, 176.390203, 131.961936),\n (176.390203, 131.961936, 176.390203, 134.634474),\n (176.390203, 134.634474, 176.390203, 137.307012),\n (176.390203, 137.307012, 176.390203, 139.979549),\n (176.390203, 139.979549, 176.390203, 142.652087),\n (176.390203, 142.652087, 176.390203, 145.324625),\n (176.390203, 145.324625, 176.390203, 147.997162),\n (176.390203, 147.997162, 176.390203, 150.6697),\n (176.390203, 150.6697, 176.390203, 153.342238),\n (176.390203, 153.342238, 176.390203, 156.014775),\n (176.390203, 156.014775, 176.390203, 158.687313),\n (176.390203, 158.687313, 176.390203, 161.359851),\n (176.390203, 161.359851, 176.390203, 164.032388),\n (176.390203, 164.032388, 176.390203, 166.704926),\n (176.390203, 166.704926, 176.390203, 169.377464),\n (176.390203, 169.377464, 176.390203, 172.050001),\n (176.390203, 172.050001, 176.390203, 174.722539),\n (176.390203, 174.722539, 176.390203, 177.395077),\n (176.390203, 177.395077, 176.390203, 180.067614),\n (176.390203, 180.067614, 176.390203, 182.740152),\n (176.390203, 182.740152, 176.390203, 185.41269),\n (176.390203, 185.41269, 176.390203, 188.085227),\n (176.390203, 188.085227, 176.390203, 190.757765),\n (176.390203, 190.757765, 176.390203, 193.430303),\n (186.968998, 107.909097, 186.968998, 110.581635),\n (186.968998, 110.581635, 186.968998, 113.254173),\n (186.968998, 113.254173, 186.968998, 115.92671),\n (186.968998, 115.92671, 186.968998, 118.599248),\n (186.968998, 118.599248, 186.968998, 121.271786),\n (186.968998, 121.271786, 186.968998, 123.944323),\n (186.968998, 123.944323, 186.968998, 126.616861),\n (186.968998, 126.616861, 186.968998, 129.289399),\n (186.968998, 129.289399, 186.968998, 131.961936),\n (186.968998, 131.961936, 186.968998, 134.634474),\n (186.968998, 134.634474, 186.968998, 137.307012),\n (186.968998, 137.307012, 186.968998, 139.979549),\n (186.968998, 139.979549, 186.968998, 142.652087),\n (186.968998, 142.652087, 186.968998, 145.324625),\n (186.968998, 145.324625, 186.968998, 147.997162),\n (186.968998, 147.997162, 186.968998, 150.6697),\n (186.968998, 150.6697, 186.968998, 153.342238),\n (186.968998, 153.342238, 186.968998, 156.014775),\n (186.968998, 156.014775, 186.968998, 158.687313),\n (186.968998, 158.687313, 186.968998, 161.359851),\n (186.968998, 161.359851, 186.968998, 164.032388),\n (186.968998, 164.032388, 186.968998, 166.704926),\n (186.968998, 166.704926, 186.968998, 169.377464),\n (186.968998, 169.377464, 186.968998, 172.050001),\n (186.968998, 172.050001, 186.968998, 174.722539),\n (186.968998, 174.722539, 186.968998, 177.395077),\n (186.968998, 177.395077, 186.968998, 180.067614),\n (186.968998, 180.067614, 186.968998, 182.740152),\n (186.968998, 182.740152, 186.968998, 185.41269),\n (186.968998, 185.41269, 186.968998, 188.085227),\n (186.968998, 188.085227, 186.968998, 190.757765),\n (186.968998, 190.757765, 186.968998, 193.430303),\n (186.968998, 107.909097, 176.390203, 107.909097),\n (186.968998, 193.430303, 176.390203, 193.430303)\n]\nVISIBLE_CIRCLES = [\n (119.6296, 150.6697, 42.760603),\n (119.6296, 150.6697, 3.563384)\n]\nVISIBLE_ARCS = [\n\n]\nHIDDEN_SEGMENTS = [\n (123.193, 93.9091, 123.193, 83.3303),\n (116.0662, 83.3303, 116.0662, 93.9091),\n (186.969, 154.2331, 176.3902, 154.2331),\n (186.969, 147.1063, 176.3902, 147.1063)\n]\n# (orient, text, p1, p2, base) for linear; (orient, text, center, radius, angle) for diameter\nDIMENSIONS = [\n ('diameter', '%%c100', (119.6296, 150.6697), 42.7606, 45),\n ('diameter', '%%c8.3333', (119.6296, 150.6697), 3.5634, 135),\n ('horizontal', '12.3698', (176.3902, 150.6697), (186.969, 150.6697), (181.6796, 161.6697))\n]\n\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\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\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,\n angle=(0 if d[0] == \"horizontal\" else 90),\n 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,\n text=text, dimstyle=\"EZDXF\").render()\n\n doc.saveas(out_path)\n\n\nif __name__ == \"__main__\":\n out = sys.argv[1] if len(sys.argv) > 1 else \"0000_00004434_gt.dxf\"\n draw(out)\n print(\"wrote\", out)\n```"}], "images": ["images/0000_00004434.png"], "id": "0000_00004434"} {"messages": [{"role": "user", "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 93.14 mm."}, {"role": "assistant", "content": "```python\n#!/usr/bin/env python3\n# -*- coding: utf-8 -*-\n# Ground-truth 2D engineering drawing for part: 0002_00029886\n# Self-contained: reproduces the three-view DXF via ezdxf, NO FreeCAD needed.\n# Coordinates are A4 page millimetres (scale=0.49757360406091317, page=[297.0, 210.0]).\n# visible edges -> solid (layer OUTLINE); hidden edges -> dashed (layer HIDDEN)\n# dimensions -> real movable DIMENSION entities (text = true mm value)\n# Run: python 0002_00029886_gt.py [out.dxf]\nimport sys\nimport ezdxf\n\nSCALE = 0.49757360406091317\nPAGE = [297.0, 210.0]\n\nVISIBLE_SEGMENTS = [\n (127.06378, 74.38938, 125.508863, 74.38938),\n (125.508863, 74.38938, 123.953945, 74.38938),\n (123.953945, 74.38938, 122.399028, 74.38938),\n (122.399028, 74.38938, 120.84411, 74.38938),\n (120.84411, 74.38938, 119.289193, 74.38938),\n (119.289193, 74.38938, 117.734275, 74.38938),\n (117.734275, 74.38938, 116.179358, 74.38938),\n (116.179358, 74.38938, 114.62444, 74.38938),\n (114.62444, 74.38938, 113.069523, 74.38938),\n (113.069523, 74.38938, 111.514605, 74.38938),\n (111.514605, 74.38938, 109.959688, 74.38938),\n (109.959688, 74.38938, 108.40477, 74.38938),\n (108.40477, 74.38938, 106.849853, 74.38938),\n (106.849853, 74.38938, 105.294935, 74.38938),\n (105.294935, 74.38938, 103.740018, 74.38938),\n (103.740018, 74.38938, 102.1851, 74.38938),\n (102.1851, 74.38938, 100.630182, 74.38938),\n (100.630182, 74.38938, 99.075265, 74.38938),\n (99.075265, 74.38938, 97.520347, 74.38938),\n (97.520347, 74.38938, 95.96543, 74.38938),\n (95.96543, 74.38938, 94.410512, 74.38938),\n (94.410512, 74.38938, 92.855595, 74.38938),\n (92.855595, 74.38938, 91.300677, 74.38938),\n (91.300677, 74.38938, 89.74576, 74.38938),\n (89.74576, 74.38938, 88.190842, 74.38938),\n (88.190842, 74.38938, 86.635925, 74.38938),\n (86.635925, 74.38938, 85.081007, 74.38938),\n (85.081007, 74.38938, 83.52609, 74.38938),\n (83.52609, 74.38938, 81.971172, 74.38938),\n (81.971172, 74.38938, 80.416255, 74.38938),\n (80.416255, 74.38938, 78.861337, 74.38938),\n (78.861337, 74.38938, 77.30642, 74.38938),\n (127.06378, 74.38938, 127.06378, 120.73202),\n (127.06378, 120.73202, 125.508863, 120.73202),\n (125.508863, 120.73202, 123.953945, 120.73202),\n (123.953945, 120.73202, 122.399028, 120.73202),\n (122.399028, 120.73202, 120.84411, 120.73202),\n (120.84411, 120.73202, 119.289193, 120.73202),\n (119.289193, 120.73202, 117.734275, 120.73202),\n (117.734275, 120.73202, 116.179358, 120.73202),\n (116.179358, 120.73202, 114.62444, 120.73202),\n (114.62444, 120.73202, 113.069523, 120.73202),\n (113.069523, 120.73202, 111.514605, 120.73202),\n (111.514605, 120.73202, 109.959688, 120.73202),\n (109.959688, 120.73202, 108.40477, 120.73202),\n (108.40477, 120.73202, 106.849853, 120.73202),\n (106.849853, 120.73202, 105.294935, 120.73202),\n (105.294935, 120.73202, 103.740018, 120.73202),\n (103.740018, 120.73202, 102.1851, 120.73202),\n (102.1851, 120.73202, 100.630182, 120.73202),\n (100.630182, 120.73202, 99.075265, 120.73202),\n (99.075265, 120.73202, 97.520347, 120.73202),\n (97.520347, 120.73202, 95.96543, 120.73202),\n (95.96543, 120.73202, 94.410512, 120.73202),\n (94.410512, 120.73202, 92.855595, 120.73202),\n (92.855595, 120.73202, 91.300677, 120.73202),\n (91.300677, 120.73202, 89.74576, 120.73202),\n (89.74576, 120.73202, 88.190842, 120.73202),\n (88.190842, 120.73202, 86.635925, 120.73202),\n (86.635925, 120.73202, 85.081007, 120.73202),\n (85.081007, 120.73202, 83.52609, 120.73202),\n (83.52609, 120.73202, 81.971172, 120.73202),\n (81.971172, 120.73202, 80.416255, 120.73202),\n (80.416255, 120.73202, 78.861337, 120.73202),\n (78.861337, 120.73202, 77.30642, 120.73202),\n (77.30642, 120.73202, 77.30642, 74.38938),\n (141.06378, 134.73202, 141.06378, 136.286937),\n (141.06378, 136.286937, 141.06378, 137.841855),\n (141.06378, 137.841855, 141.06378, 139.396772),\n (141.06378, 139.396772, 141.06378, 140.95169),\n (141.06378, 140.95169, 141.06378, 142.506607),\n (141.06378, 142.506607, 141.06378, 144.061525),\n (141.06378, 144.061525, 141.06378, 145.616442),\n (141.06378, 145.616442, 141.06378, 147.17136),\n (141.06378, 147.17136, 141.06378, 148.726277),\n (141.06378, 148.726277, 141.06378, 150.281195),\n (141.06378, 150.281195, 141.06378, 151.836112),\n (141.06378, 151.836112, 141.06378, 153.39103),\n (141.06378, 153.39103, 141.06378, 154.945947),\n (141.06378, 154.945947, 141.06378, 156.500865),\n (141.06378, 156.500865, 141.06378, 158.055782),\n (141.06378, 158.055782, 141.06378, 159.6107),\n (141.06378, 159.6107, 141.06378, 161.165618),\n (141.06378, 161.165618, 141.06378, 162.720535),\n (141.06378, 162.720535, 141.06378, 164.275453),\n (141.06378, 164.275453, 141.06378, 165.83037),\n (141.06378, 165.83037, 141.06378, 167.385288),\n (141.06378, 167.385288, 141.06378, 168.940205),\n (141.06378, 168.940205, 141.06378, 170.495123),\n (141.06378, 170.495123, 141.06378, 172.05004),\n (141.06378, 172.05004, 141.06378, 173.604958),\n (141.06378, 173.604958, 141.06378, 175.159875),\n (141.06378, 175.159875, 141.06378, 176.714793),\n (141.06378, 176.714793, 141.06378, 178.26971),\n (141.06378, 178.26971, 141.06378, 179.824628),\n (141.06378, 179.824628, 141.06378, 181.379545),\n (141.06378, 181.379545, 141.06378, 182.934463),\n (141.06378, 182.934463, 141.06378, 184.48938),\n (187.40642, 134.73202, 187.40642, 136.286937),\n (187.40642, 136.286937, 187.40642, 137.841855),\n (187.40642, 137.841855, 187.40642, 139.396772),\n (187.40642, 139.396772, 187.40642, 140.95169),\n (187.40642, 140.95169, 187.40642, 142.506607),\n (187.40642, 142.506607, 187.40642, 144.061525),\n (187.40642, 144.061525, 187.40642, 145.616442),\n (187.40642, 145.616442, 187.40642, 147.17136),\n (187.40642, 147.17136, 187.40642, 148.726277),\n (187.40642, 148.726277, 187.40642, 150.281195),\n (187.40642, 150.281195, 187.40642, 151.836112),\n (187.40642, 151.836112, 187.40642, 153.39103),\n (187.40642, 153.39103, 187.40642, 154.945947),\n (187.40642, 154.945947, 187.40642, 156.500865),\n (187.40642, 156.500865, 187.40642, 158.055782),\n (187.40642, 158.055782, 187.40642, 159.6107),\n (187.40642, 159.6107, 187.40642, 161.165618),\n (187.40642, 161.165618, 187.40642, 162.720535),\n (187.40642, 162.720535, 187.40642, 164.275453),\n (187.40642, 164.275453, 187.40642, 165.83037),\n (187.40642, 165.83037, 187.40642, 167.385288),\n (187.40642, 167.385288, 187.40642, 168.940205),\n (187.40642, 168.940205, 187.40642, 170.495123),\n (187.40642, 170.495123, 187.40642, 172.05004),\n (187.40642, 172.05004, 187.40642, 173.604958),\n (187.40642, 173.604958, 187.40642, 175.159875),\n (187.40642, 175.159875, 187.40642, 176.714793),\n (187.40642, 176.714793, 187.40642, 178.26971),\n (187.40642, 178.26971, 187.40642, 179.824628),\n (187.40642, 179.824628, 187.40642, 181.379545),\n (187.40642, 181.379545, 187.40642, 182.934463),\n (187.40642, 182.934463, 187.40642, 184.48938),\n (187.40642, 134.73202, 141.06378, 134.73202),\n (187.40642, 184.48938, 141.06378, 184.48938)\n]\nVISIBLE_CIRCLES = [\n (102.1851, 159.6107, 24.87868),\n (102.1851, 159.6107, 19.695622)\n]\nVISIBLE_ARCS = [\n\n]\nHIDDEN_SEGMENTS = [\n (121.8807, 120.732, 121.8807, 74.3893),\n (82.4895, 74.3893, 82.4895, 120.732),\n (187.4064, 179.3063, 141.0638, 179.3063),\n (187.4064, 139.915, 141.0638, 139.915)\n]\n# (orient, text, p1, p2, base) for linear; (orient, text, center, radius, angle) for diameter\nDIMENSIONS = [\n ('diameter', '%%c100', (102.1851, 159.6107), 24.8787, 45),\n ('diameter', '%%c79.1667', (102.1851, 159.6107), 19.6956, 135),\n ('horizontal', '93.1373', (141.0638, 159.6107), (187.4064, 159.6107), (164.2351, 170.6107))\n]\n\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\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\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,\n angle=(0 if d[0] == \"horizontal\" else 90),\n 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,\n text=text, dimstyle=\"EZDXF\").render()\n\n doc.saveas(out_path)\n\n\nif __name__ == \"__main__\":\n out = sys.argv[1] if len(sys.argv) > 1 else \"0002_00029886_gt.dxf\"\n draw(out)\n print(\"wrote\", out)\n```"}], "images": ["images/0002_00029886.png"], "id": "0002_00029886"} {"messages": [{"role": "user", "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 77.08 mm. It is extruded to a thickness of 94.06 mm."}, {"role": "assistant", "content": "```python\n#!/usr/bin/env python3\n# -*- coding: utf-8 -*-\n# Ground-truth 2D engineering drawing for part: 0005_00050650\n# Self-contained: reproduces the three-view DXF via ezdxf, NO FreeCAD needed.\n# Coordinates are A4 page millimetres (scale=0.4952091836734696, page=[297.0, 210.0]).\n# visible edges -> solid (layer OUTLINE); hidden edges -> dashed (layer HIDDEN)\n# dimensions -> real movable DIMENSION entities (text = true mm value)\n# Run: python 0005_00050650_gt.py [out.dxf]\nimport sys\nimport ezdxf\n\nSCALE = 0.4952091836734696\nPAGE = [297.0, 210.0]\n\nVISIBLE_SEGMENTS = [\n (127.009259, 74.330259, 125.46173, 74.330259),\n (125.46173, 74.330259, 123.914202, 74.330259),\n (123.914202, 74.330259, 122.366673, 74.330259),\n (122.366673, 74.330259, 120.819144, 74.330259),\n (120.819144, 74.330259, 119.271616, 74.330259),\n (119.271616, 74.330259, 117.724087, 74.330259),\n (117.724087, 74.330259, 116.176558, 74.330259),\n (116.176558, 74.330259, 114.62903, 74.330259),\n (114.62903, 74.330259, 113.081501, 74.330259),\n (113.081501, 74.330259, 111.533972, 74.330259),\n (111.533972, 74.330259, 109.986443, 74.330259),\n (109.986443, 74.330259, 108.438915, 74.330259),\n (108.438915, 74.330259, 106.891386, 74.330259),\n (106.891386, 74.330259, 105.343857, 74.330259),\n (105.343857, 74.330259, 103.796329, 74.330259),\n (103.796329, 74.330259, 102.2488, 74.330259),\n (102.2488, 74.330259, 100.701271, 74.330259),\n (100.701271, 74.330259, 99.153743, 74.330259),\n (99.153743, 74.330259, 97.606214, 74.330259),\n (97.606214, 74.330259, 96.058685, 74.330259),\n (96.058685, 74.330259, 94.511157, 74.330259),\n (94.511157, 74.330259, 92.963628, 74.330259),\n (92.963628, 74.330259, 91.416099, 74.330259),\n (91.416099, 74.330259, 89.86857, 74.330259),\n (89.86857, 74.330259, 88.321042, 74.330259),\n (88.321042, 74.330259, 86.773513, 74.330259),\n (86.773513, 74.330259, 85.225984, 74.330259),\n (85.225984, 74.330259, 83.678456, 74.330259),\n (83.678456, 74.330259, 82.130927, 74.330259),\n (82.130927, 74.330259, 80.583398, 74.330259),\n (80.583398, 74.330259, 79.03587, 74.330259),\n (79.03587, 74.330259, 77.488341, 74.330259),\n (127.009259, 74.330259, 127.009259, 120.909341),\n (127.009259, 120.909341, 125.46173, 120.909341),\n (125.46173, 120.909341, 123.914202, 120.909341),\n (123.914202, 120.909341, 122.366673, 120.909341),\n (122.366673, 120.909341, 120.819144, 120.909341),\n (120.819144, 120.909341, 119.271616, 120.909341),\n (119.271616, 120.909341, 117.724087, 120.909341),\n (117.724087, 120.909341, 116.176558, 120.909341),\n (116.176558, 120.909341, 114.62903, 120.909341),\n (114.62903, 120.909341, 113.081501, 120.909341),\n (113.081501, 120.909341, 111.533972, 120.909341),\n (111.533972, 120.909341, 109.986443, 120.909341),\n (109.986443, 120.909341, 108.438915, 120.909341),\n (108.438915, 120.909341, 106.891386, 120.909341),\n (106.891386, 120.909341, 105.343857, 120.909341),\n (105.343857, 120.909341, 103.796329, 120.909341),\n (103.796329, 120.909341, 102.2488, 120.909341),\n (102.2488, 120.909341, 100.701271, 120.909341),\n (100.701271, 120.909341, 99.153743, 120.909341),\n (99.153743, 120.909341, 97.606214, 120.909341),\n (97.606214, 120.909341, 96.058685, 120.909341),\n (96.058685, 120.909341, 94.511157, 120.909341),\n (94.511157, 120.909341, 92.963628, 120.909341),\n (92.963628, 120.909341, 91.416099, 120.909341),\n (91.416099, 120.909341, 89.86857, 120.909341),\n (89.86857, 120.909341, 88.321042, 120.909341),\n (88.321042, 120.909341, 86.773513, 120.909341),\n (86.773513, 120.909341, 85.225984, 120.909341),\n (85.225984, 120.909341, 83.678456, 120.909341),\n (83.678456, 120.909341, 82.130927, 120.909341),\n (82.130927, 120.909341, 80.583398, 120.909341),\n (80.583398, 120.909341, 79.03587, 120.909341),\n (79.03587, 120.909341, 77.488341, 120.909341),\n (77.488341, 120.909341, 77.488341, 74.330259),\n (141.009259, 134.909341, 141.009259, 136.45687),\n (141.009259, 136.45687, 141.009259, 138.004398),\n (141.009259, 138.004398, 141.009259, 139.551927),\n (141.009259, 139.551927, 141.009259, 141.099456),\n (141.009259, 141.099456, 141.009259, 142.646984),\n (141.009259, 142.646984, 141.009259, 144.194513),\n (141.009259, 144.194513, 141.009259, 145.742042),\n (141.009259, 145.742042, 141.009259, 147.28957),\n (141.009259, 147.28957, 141.009259, 148.837099),\n (141.009259, 148.837099, 141.009259, 150.384628),\n (141.009259, 150.384628, 141.009259, 151.932157),\n (141.009259, 151.932157, 141.009259, 153.479685),\n (141.009259, 153.479685, 141.009259, 155.027214),\n (141.009259, 155.027214, 141.009259, 156.574743),\n (141.009259, 156.574743, 141.009259, 158.122271),\n (141.009259, 158.122271, 141.009259, 159.6698),\n (141.009259, 159.6698, 141.009259, 161.217329),\n (141.009259, 161.217329, 141.009259, 162.764857),\n (141.009259, 162.764857, 141.009259, 164.312386),\n (141.009259, 164.312386, 141.009259, 165.859915),\n (141.009259, 165.859915, 141.009259, 167.407443),\n (141.009259, 167.407443, 141.009259, 168.954972),\n (141.009259, 168.954972, 141.009259, 170.502501),\n (141.009259, 170.502501, 141.009259, 172.05003),\n (141.009259, 172.05003, 141.009259, 173.597558),\n (141.009259, 173.597558, 141.009259, 175.145087),\n (141.009259, 175.145087, 141.009259, 176.692616),\n (141.009259, 176.692616, 141.009259, 178.240144),\n (141.009259, 178.240144, 141.009259, 179.787673),\n (141.009259, 179.787673, 141.009259, 181.335202),\n (141.009259, 181.335202, 141.009259, 182.88273),\n (141.009259, 182.88273, 141.009259, 184.430259),\n (187.588341, 134.909341, 187.588341, 136.45687),\n (187.588341, 136.45687, 187.588341, 138.004398),\n (187.588341, 138.004398, 187.588341, 139.551927),\n (187.588341, 139.551927, 187.588341, 141.099456),\n (187.588341, 141.099456, 187.588341, 142.646984),\n (187.588341, 142.646984, 187.588341, 144.194513),\n (187.588341, 144.194513, 187.588341, 145.742042),\n (187.588341, 145.742042, 187.588341, 147.28957),\n (187.588341, 147.28957, 187.588341, 148.837099),\n (187.588341, 148.837099, 187.588341, 150.384628),\n (187.588341, 150.384628, 187.588341, 151.932157),\n (187.588341, 151.932157, 187.588341, 153.479685),\n (187.588341, 153.479685, 187.588341, 155.027214),\n (187.588341, 155.027214, 187.588341, 156.574743),\n (187.588341, 156.574743, 187.588341, 158.122271),\n (187.588341, 158.122271, 187.588341, 159.6698),\n (187.588341, 159.6698, 187.588341, 161.217329),\n (187.588341, 161.217329, 187.588341, 162.764857),\n (187.588341, 162.764857, 187.588341, 164.312386),\n (187.588341, 164.312386, 187.588341, 165.859915),\n (187.588341, 165.859915, 187.588341, 167.407443),\n (187.588341, 167.407443, 187.588341, 168.954972),\n (187.588341, 168.954972, 187.588341, 170.502501),\n (187.588341, 170.502501, 187.588341, 172.05003),\n (187.588341, 172.05003, 187.588341, 173.597558),\n (187.588341, 173.597558, 187.588341, 175.145087),\n (187.588341, 175.145087, 187.588341, 176.692616),\n (187.588341, 176.692616, 187.588341, 178.240144),\n (187.588341, 178.240144, 187.588341, 179.787673),\n (187.588341, 179.787673, 187.588341, 181.335202),\n (187.588341, 181.335202, 187.588341, 182.88273),\n (187.588341, 182.88273, 187.588341, 184.430259),\n (187.588341, 134.909341, 141.009259, 134.909341),\n (187.588341, 184.430259, 141.009259, 184.430259)\n]\nVISIBLE_CIRCLES = [\n (102.2488, 159.6698, 24.760459),\n (102.2488, 159.6698, 19.086187)\n]\nVISIBLE_ARCS = [\n\n]\nHIDDEN_SEGMENTS = [\n (121.335, 120.9093, 121.335, 74.3302),\n (83.1626, 74.3302, 83.1626, 120.9093),\n (187.5883, 178.756, 141.0093, 178.756),\n (187.5883, 140.5836, 141.0093, 140.5836)\n]\n# (orient, text, p1, p2, base) for linear; (orient, text, center, radius, angle) for diameter\nDIMENSIONS = [\n ('diameter', '%%c100', (102.2488, 159.6698), 24.7605, 45),\n ('diameter', '%%c77.0833', (102.2488, 159.6698), 19.0862, 135),\n ('horizontal', '94.0594', (141.0093, 159.6698), (187.5883, 159.6698), (164.2988, 170.6698))\n]\n\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\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\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,\n angle=(0 if d[0] == \"horizontal\" else 90),\n 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,\n text=text, dimstyle=\"EZDXF\").render()\n\n doc.saveas(out_path)\n\n\nif __name__ == \"__main__\":\n out = sys.argv[1] if len(sys.argv) > 1 else \"0005_00050650_gt.dxf\"\n draw(out)\n print(\"wrote\", out)\n```"}], "images": ["images/0005_00050650.png"], "id": "0005_00050650"} {"messages": [{"role": "user", "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 28.86 mm."}, {"role": "assistant", "content": "```python\n#!/usr/bin/env python3\n# -*- coding: utf-8 -*-\n# Ground-truth 2D engineering drawing for part: 0005_00051858\n# Self-contained: reproduces the three-view DXF via ezdxf, NO FreeCAD needed.\n# Coordinates are A4 page millimetres (scale=0.7347, page=[297.0, 210.0]).\n# visible edges -> solid (layer OUTLINE); hidden edges -> dashed (layer HIDDEN)\n# dimensions -> real movable DIMENSION entities (text = true mm value)\n# Run: python 0005_00051858_gt.py [out.dxf]\nimport sys\nimport ezdxf\n\nSCALE = 0.7347\nPAGE = [297.0, 210.0]\n\nVISIBLE_SEGMENTS = [\n (71.9427, 102.2353, 74.238638, 102.2353),\n (74.238638, 102.2353, 76.534575, 102.2353),\n (76.534575, 102.2353, 78.830512, 102.2353),\n (78.830512, 102.2353, 81.12645, 102.2353),\n (81.12645, 102.2353, 83.422387, 102.2353),\n (83.422387, 102.2353, 85.718325, 102.2353),\n (85.718325, 102.2353, 88.014263, 102.2353),\n (88.014263, 102.2353, 90.3102, 102.2353),\n (90.3102, 102.2353, 92.606138, 102.2353),\n (92.606138, 102.2353, 94.902075, 102.2353),\n (94.902075, 102.2353, 97.198013, 102.2353),\n (97.198013, 102.2353, 99.49395, 102.2353),\n (99.49395, 102.2353, 101.789888, 102.2353),\n (101.789888, 102.2353, 104.085825, 102.2353),\n (104.085825, 102.2353, 106.381763, 102.2353),\n (106.381763, 102.2353, 108.6777, 102.2353),\n (108.6777, 102.2353, 110.973637, 102.2353),\n (110.973637, 102.2353, 113.269575, 102.2353),\n (113.269575, 102.2353, 115.565512, 102.2353),\n (115.565512, 102.2353, 117.86145, 102.2353),\n (117.86145, 102.2353, 120.157388, 102.2353),\n (120.157388, 102.2353, 122.453325, 102.2353),\n (122.453325, 102.2353, 124.749263, 102.2353),\n (124.749263, 102.2353, 127.0452, 102.2353),\n (127.0452, 102.2353, 129.341138, 102.2353),\n (129.341138, 102.2353, 131.637075, 102.2353),\n (131.637075, 102.2353, 133.933013, 102.2353),\n (133.933013, 102.2353, 136.22895, 102.2353),\n (136.22895, 102.2353, 138.524888, 102.2353),\n (138.524888, 102.2353, 140.820825, 102.2353),\n (140.820825, 102.2353, 143.116763, 102.2353),\n (143.116763, 102.2353, 145.4127, 102.2353),\n (145.4127, 102.2353, 145.4127, 81.029766),\n (71.9427, 81.029766, 74.238638, 81.029766),\n (74.238638, 81.029766, 76.534575, 81.029766),\n (76.534575, 81.029766, 78.830512, 81.029766),\n (78.830512, 81.029766, 81.12645, 81.029766),\n (81.12645, 81.029766, 83.422387, 81.029766),\n (83.422387, 81.029766, 85.718325, 81.029766),\n (85.718325, 81.029766, 88.014263, 81.029766),\n (88.014263, 81.029766, 90.3102, 81.029766),\n (90.3102, 81.029766, 92.606138, 81.029766),\n (92.606138, 81.029766, 94.902075, 81.029766),\n (94.902075, 81.029766, 97.198013, 81.029766),\n (97.198013, 81.029766, 99.49395, 81.029766),\n (99.49395, 81.029766, 101.789888, 81.029766),\n (101.789888, 81.029766, 104.085825, 81.029766),\n (104.085825, 81.029766, 106.381763, 81.029766),\n (106.381763, 81.029766, 108.6777, 81.029766),\n (108.6777, 81.029766, 110.973637, 81.029766),\n (110.973637, 81.029766, 113.269575, 81.029766),\n (113.269575, 81.029766, 115.565512, 81.029766),\n (115.565512, 81.029766, 117.86145, 81.029766),\n (117.86145, 81.029766, 120.157388, 81.029766),\n (120.157388, 81.029766, 122.453325, 81.029766),\n (122.453325, 81.029766, 124.749263, 81.029766),\n (124.749263, 81.029766, 127.0452, 81.029766),\n (127.0452, 81.029766, 129.341138, 81.029766),\n (129.341138, 81.029766, 131.637075, 81.029766),\n (131.637075, 81.029766, 133.933013, 81.029766),\n (133.933013, 81.029766, 136.22895, 81.029766),\n (136.22895, 81.029766, 138.524888, 81.029766),\n (138.524888, 81.029766, 140.820825, 81.029766),\n (140.820825, 81.029766, 143.116763, 81.029766),\n (143.116763, 81.029766, 145.4127, 81.029766),\n (71.9427, 81.029766, 71.9427, 102.2353),\n (180.618234, 189.7053, 180.618234, 187.409363),\n (180.618234, 187.409363, 180.618234, 185.113425),\n (180.618234, 185.113425, 180.618234, 182.817488),\n (180.618234, 182.817488, 180.618234, 180.52155),\n (180.618234, 180.52155, 180.618234, 178.225613),\n (180.618234, 178.225613, 180.618234, 175.929675),\n (180.618234, 175.929675, 180.618234, 173.633738),\n (180.618234, 173.633738, 180.618234, 171.3378),\n (180.618234, 171.3378, 180.618234, 169.041863),\n (180.618234, 169.041863, 180.618234, 166.745925),\n (180.618234, 166.745925, 180.618234, 164.449988),\n (180.618234, 164.449988, 180.618234, 162.15405),\n (180.618234, 162.15405, 180.618234, 159.858113),\n (180.618234, 159.858113, 180.618234, 157.562175),\n (180.618234, 157.562175, 180.618234, 155.266238),\n (180.618234, 155.266238, 180.618234, 152.9703),\n (180.618234, 152.9703, 180.618234, 150.674363),\n (180.618234, 150.674363, 180.618234, 148.378425),\n (180.618234, 148.378425, 180.618234, 146.082488),\n (180.618234, 146.082488, 180.618234, 143.78655),\n (180.618234, 143.78655, 180.618234, 141.490613),\n (180.618234, 141.490613, 180.618234, 139.194675),\n (180.618234, 139.194675, 180.618234, 136.898738),\n (180.618234, 136.898738, 180.618234, 134.6028),\n (180.618234, 134.6028, 180.618234, 132.306863),\n (180.618234, 132.306863, 180.618234, 130.010925),\n (180.618234, 130.010925, 180.618234, 127.714988),\n (180.618234, 127.714988, 180.618234, 125.41905),\n (180.618234, 125.41905, 180.618234, 123.123113),\n (180.618234, 123.123113, 180.618234, 120.827175),\n (180.618234, 120.827175, 180.618234, 118.531238),\n (180.618234, 118.531238, 180.618234, 116.2353),\n (159.4127, 189.7053, 159.4127, 187.409363),\n (159.4127, 187.409363, 159.4127, 185.113425),\n (159.4127, 185.113425, 159.4127, 182.817488),\n (159.4127, 182.817488, 159.4127, 180.52155),\n (159.4127, 180.52155, 159.4127, 178.225613),\n (159.4127, 178.225613, 159.4127, 175.929675),\n (159.4127, 175.929675, 159.4127, 173.633738),\n (159.4127, 173.633738, 159.4127, 171.3378),\n (159.4127, 171.3378, 159.4127, 169.041863),\n (159.4127, 169.041863, 159.4127, 166.745925),\n (159.4127, 166.745925, 159.4127, 164.449988),\n (159.4127, 164.449988, 159.4127, 162.15405),\n (159.4127, 162.15405, 159.4127, 159.858113),\n (159.4127, 159.858113, 159.4127, 157.562175),\n (159.4127, 157.562175, 159.4127, 155.266238),\n (159.4127, 155.266238, 159.4127, 152.9703),\n (159.4127, 152.9703, 159.4127, 150.674363),\n (159.4127, 150.674363, 159.4127, 148.378425),\n (159.4127, 148.378425, 159.4127, 146.082488),\n (159.4127, 146.082488, 159.4127, 143.78655),\n (159.4127, 143.78655, 159.4127, 141.490613),\n (159.4127, 141.490613, 159.4127, 139.194675),\n (159.4127, 139.194675, 159.4127, 136.898738),\n (159.4127, 136.898738, 159.4127, 134.6028),\n (159.4127, 134.6028, 159.4127, 132.306863),\n (159.4127, 132.306863, 159.4127, 130.010925),\n (159.4127, 130.010925, 159.4127, 127.714988),\n (159.4127, 127.714988, 159.4127, 125.41905),\n (159.4127, 125.41905, 159.4127, 123.123113),\n (159.4127, 123.123113, 159.4127, 120.827175),\n (159.4127, 120.827175, 159.4127, 118.531238),\n (159.4127, 118.531238, 159.4127, 116.2353),\n (159.4127, 189.7053, 180.618234, 189.7053),\n (159.4127, 116.2353, 180.618234, 116.2353)\n]\nVISIBLE_CIRCLES = [\n (108.6777, 152.9703, 36.735),\n (108.6777, 152.9703, 32.143125)\n]\nVISIBLE_ARCS = [\n\n]\nHIDDEN_SEGMENTS = [\n (140.8208, 81.0297, 140.8208, 102.2353),\n (76.5346, 102.2353, 76.5346, 81.0297),\n (159.4127, 120.8271, 180.6182, 120.8271),\n (159.4127, 185.1134, 180.6182, 185.1134)\n]\n# (orient, text, p1, p2, base) for linear; (orient, text, center, radius, angle) for diameter\nDIMENSIONS = [\n ('diameter', '%%c100', (108.6777, 152.9703), 36.735, 45),\n ('diameter', '%%c87.5', (108.6777, 152.9703), 32.1431, 135),\n ('horizontal', '28.8628', (180.6182, 152.9703), (159.4127, 152.9703), (170.0155, 141.9703))\n]\n\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\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\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,\n angle=(0 if d[0] == \"horizontal\" else 90),\n 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,\n text=text, dimstyle=\"EZDXF\").render()\n\n doc.saveas(out_path)\n\n\nif __name__ == \"__main__\":\n out = sys.argv[1] if len(sys.argv) > 1 else \"0005_00051858_gt.dxf\"\n draw(out)\n print(\"wrote\", out)\n```"}], "images": ["images/0005_00051858.png"], "id": "0005_00051858"} {"messages": [{"role": "user", "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 197.92 mm."}, {"role": "assistant", "content": "```python\n#!/usr/bin/env python3\n# -*- coding: utf-8 -*-\n# Ground-truth 2D engineering drawing for part: 0008_00081277\n# Self-contained: reproduces the three-view DXF via ezdxf, NO FreeCAD needed.\n# Coordinates are A4 page millimetres (scale=0.32257342657349874, page=[297.0, 210.0]).\n# visible edges -> solid (layer OUTLINE); hidden edges -> dashed (layer HIDDEN)\n# dimensions -> real movable DIMENSION entities (text = true mm value)\n# Run: python 0008_00081277_gt.py [out.dxf]\nimport sys\nimport ezdxf\n\nSCALE = 0.32257342657349874\nPAGE = [297.0, 210.0]\n\nVISIBLE_SEGMENTS = [\n (80.889629, 133.857028, 81.897671, 133.857028),\n (81.897671, 133.857028, 82.905713, 133.857028),\n (82.905713, 133.857028, 83.913755, 133.857028),\n (83.913755, 133.857028, 84.921797, 133.857028),\n (84.921797, 133.857028, 85.929838, 133.857028),\n (85.929838, 133.857028, 86.93788, 133.857028),\n (86.93788, 133.857028, 87.945922, 133.857028),\n (87.945922, 133.857028, 88.953964, 133.857028),\n (88.953964, 133.857028, 89.962006, 133.857028),\n (89.962006, 133.857028, 90.970048, 133.857028),\n (90.970048, 133.857028, 91.97809, 133.857028),\n (91.97809, 133.857028, 92.986132, 133.857028),\n (92.986132, 133.857028, 93.994174, 133.857028),\n (93.994174, 133.857028, 95.002216, 133.857028),\n (95.002216, 133.857028, 96.010258, 133.857028),\n (96.010258, 133.857028, 97.0183, 133.857028),\n (97.0183, 133.857028, 98.026342, 133.857028),\n (98.026342, 133.857028, 99.034384, 133.857028),\n (99.034384, 133.857028, 100.042426, 133.857028),\n (100.042426, 133.857028, 101.050468, 133.857028),\n (101.050468, 133.857028, 102.05851, 133.857028),\n (102.05851, 133.857028, 103.066552, 133.857028),\n (103.066552, 133.857028, 104.074594, 133.857028),\n (104.074594, 133.857028, 105.082636, 133.857028),\n (105.082636, 133.857028, 106.090678, 133.857028),\n (106.090678, 133.857028, 107.09872, 133.857028),\n (107.09872, 133.857028, 108.106762, 133.857028),\n (108.106762, 133.857028, 109.114803, 133.857028),\n (109.114803, 133.857028, 110.122845, 133.857028),\n (110.122845, 133.857028, 111.130887, 133.857028),\n (111.130887, 133.857028, 112.138929, 133.857028),\n (112.138929, 133.857028, 113.146971, 133.857028),\n (113.146971, 133.857028, 113.146971, 70.014371),\n (80.889629, 70.014371, 81.897671, 70.014371),\n (81.897671, 70.014371, 82.905713, 70.014371),\n (82.905713, 70.014371, 83.913755, 70.014371),\n (83.913755, 70.014371, 84.921797, 70.014371),\n (84.921797, 70.014371, 85.929838, 70.014371),\n (85.929838, 70.014371, 86.93788, 70.014371),\n (86.93788, 70.014371, 87.945922, 70.014371),\n (87.945922, 70.014371, 88.953964, 70.014371),\n (88.953964, 70.014371, 89.962006, 70.014371),\n (89.962006, 70.014371, 90.970048, 70.014371),\n (90.970048, 70.014371, 91.97809, 70.014371),\n (91.97809, 70.014371, 92.986132, 70.014371),\n (92.986132, 70.014371, 93.994174, 70.014371),\n (93.994174, 70.014371, 95.002216, 70.014371),\n (95.002216, 70.014371, 96.010258, 70.014371),\n (96.010258, 70.014371, 97.0183, 70.014371),\n (97.0183, 70.014371, 98.026342, 70.014371),\n (98.026342, 70.014371, 99.034384, 70.014371),\n (99.034384, 70.014371, 100.042426, 70.014371),\n (100.042426, 70.014371, 101.050468, 70.014371),\n (101.050468, 70.014371, 102.05851, 70.014371),\n (102.05851, 70.014371, 103.066552, 70.014371),\n (103.066552, 70.014371, 104.074594, 70.014371),\n (104.074594, 70.014371, 105.082636, 70.014371),\n (105.082636, 70.014371, 106.090678, 70.014371),\n (106.090678, 70.014371, 107.09872, 70.014371),\n (107.09872, 70.014371, 108.106762, 70.014371),\n (108.106762, 70.014371, 109.114803, 70.014371),\n (109.114803, 70.014371, 110.122845, 70.014371),\n (110.122845, 70.014371, 111.130887, 70.014371),\n (111.130887, 70.014371, 112.138929, 70.014371),\n (112.138929, 70.014371, 113.146971, 70.014371),\n (80.889629, 70.014371, 80.889629, 133.857028),\n (190.989629, 180.114371, 190.989629, 179.106329),\n (190.989629, 179.106329, 190.989629, 178.098287),\n (190.989629, 178.098287, 190.989629, 177.090245),\n (190.989629, 177.090245, 190.989629, 176.082203),\n (190.989629, 176.082203, 190.989629, 175.074162),\n (190.989629, 175.074162, 190.989629, 174.06612),\n (190.989629, 174.06612, 190.989629, 173.058078),\n (190.989629, 173.058078, 190.989629, 172.050036),\n (190.989629, 172.050036, 190.989629, 171.041994),\n (190.989629, 171.041994, 190.989629, 170.033952),\n (190.989629, 170.033952, 190.989629, 169.02591),\n (190.989629, 169.02591, 190.989629, 168.017868),\n (190.989629, 168.017868, 190.989629, 167.009826),\n (190.989629, 167.009826, 190.989629, 166.001784),\n (190.989629, 166.001784, 190.989629, 164.993742),\n (190.989629, 164.993742, 190.989629, 163.9857),\n (190.989629, 163.9857, 190.989629, 162.977658),\n (190.989629, 162.977658, 190.989629, 161.969616),\n (190.989629, 161.969616, 190.989629, 160.961574),\n (190.989629, 160.961574, 190.989629, 159.953532),\n (190.989629, 159.953532, 190.989629, 158.94549),\n (190.989629, 158.94549, 190.989629, 157.937448),\n (190.989629, 157.937448, 190.989629, 156.929406),\n (190.989629, 156.929406, 190.989629, 155.921364),\n (190.989629, 155.921364, 190.989629, 154.913322),\n (190.989629, 154.913322, 190.989629, 153.90528),\n (190.989629, 153.90528, 190.989629, 152.897238),\n (190.989629, 152.897238, 190.989629, 151.889197),\n (190.989629, 151.889197, 190.989629, 150.881155),\n (190.989629, 150.881155, 190.989629, 149.873113),\n (190.989629, 149.873113, 190.989629, 148.865071),\n (190.989629, 148.865071, 190.989629, 147.857029),\n (127.146972, 180.114371, 127.146972, 179.106329),\n (127.146972, 179.106329, 127.146972, 178.098287),\n (127.146972, 178.098287, 127.146972, 177.090245),\n (127.146972, 177.090245, 127.146972, 176.082203),\n (127.146972, 176.082203, 127.146972, 175.074162),\n (127.146972, 175.074162, 127.146972, 174.06612),\n (127.146972, 174.06612, 127.146972, 173.058078),\n (127.146972, 173.058078, 127.146972, 172.050036),\n (127.146972, 172.050036, 127.146972, 171.041994),\n (127.146972, 171.041994, 127.146972, 170.033952),\n (127.146972, 170.033952, 127.146972, 169.02591),\n (127.146972, 169.02591, 127.146972, 168.017868),\n (127.146972, 168.017868, 127.146972, 167.009826),\n (127.146972, 167.009826, 127.146972, 166.001784),\n (127.146972, 166.001784, 127.146972, 164.993742),\n (127.146972, 164.993742, 127.146972, 163.9857),\n (127.146972, 163.9857, 127.146972, 162.977658),\n (127.146972, 162.977658, 127.146972, 161.969616),\n (127.146972, 161.969616, 127.146972, 160.961574),\n (127.146972, 160.961574, 127.146972, 159.953532),\n (127.146972, 159.953532, 127.146972, 158.94549),\n (127.146972, 158.94549, 127.146972, 157.937448),\n (127.146972, 157.937448, 127.146972, 156.929406),\n (127.146972, 156.929406, 127.146972, 155.921364),\n (127.146972, 155.921364, 127.146972, 154.913322),\n (127.146972, 154.913322, 127.146972, 153.90528),\n (127.146972, 153.90528, 127.146972, 152.897238),\n (127.146972, 152.897238, 127.146972, 151.889197),\n (127.146972, 151.889197, 127.146972, 150.881155),\n (127.146972, 150.881155, 127.146972, 149.873113),\n (127.146972, 149.873113, 127.146972, 148.865071),\n (127.146972, 148.865071, 127.146972, 147.857029),\n (127.146972, 180.114371, 190.989629, 180.114371),\n (127.146972, 147.857029, 190.989629, 147.857029)\n]\nVISIBLE_CIRCLES = [\n (97.0183, 163.9857, 16.128671),\n (97.0183, 163.9857, 14.112587)\n]\nVISIBLE_ARCS = [\n\n]\nHIDDEN_SEGMENTS = [\n (111.1309, 70.0143, 111.1309, 133.857),\n (82.9058, 133.857, 82.9058, 70.0143),\n (127.147, 149.8731, 190.9897, 149.8731),\n (127.147, 178.0983, 190.9897, 178.0983)\n]\n# (orient, text, p1, p2, base) for linear; (orient, text, center, radius, angle) for diameter\nDIMENSIONS = [\n ('diameter', '%%c100', (97.0183, 163.9857), 16.1287, 45),\n ('diameter', '%%c87.5', (97.0183, 163.9857), 14.1126, 135),\n ('horizontal', '197.917', (190.9897, 163.9857), (127.147, 163.9857), (159.0684, 152.9857))\n]\n\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\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\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,\n angle=(0 if d[0] == \"horizontal\" else 90),\n 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,\n text=text, dimstyle=\"EZDXF\").render()\n\n doc.saveas(out_path)\n\n\nif __name__ == \"__main__\":\n out = sys.argv[1] if len(sys.argv) > 1 else \"0008_00081277_gt.dxf\"\n draw(out)\n print(\"wrote\", out)\n```"}], "images": ["images/0008_00081277.png"], "id": "0008_00081277"} {"messages": [{"role": "user", "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 10.64 mm. It is extruded to a thickness of 16.84 mm."}, {"role": "assistant", "content": "```python\n#!/usr/bin/env python3\n# -*- coding: utf-8 -*-\n# Ground-truth 2D engineering drawing for part: 0008_00085987\n# Self-contained: reproduces the three-view DXF via ezdxf, NO FreeCAD needed.\n# Coordinates are A4 page millimetres (scale=0.8224643399089507, page=[297.0, 210.0]).\n# visible edges -> solid (layer OUTLINE); hidden edges -> dashed (layer HIDDEN)\n# dimensions -> real movable DIMENSION entities (text = true mm value)\n# Run: python 0008_00085987_gt.py [out.dxf]\nimport sys\nimport ezdxf\n\nSCALE = 0.8224643399089507\nPAGE = [297.0, 210.0]\n\nVISIBLE_SEGMENTS = [\n (159.321917, 82.511617, 156.751716, 82.511617),\n (156.751716, 82.511617, 154.181515, 82.511617),\n (154.181515, 82.511617, 151.611314, 82.511617),\n (151.611314, 82.511617, 149.041113, 82.511617),\n (149.041113, 82.511617, 146.470912, 82.511617),\n (146.470912, 82.511617, 143.900711, 82.511617),\n (143.900711, 82.511617, 141.33051, 82.511617),\n (141.33051, 82.511617, 138.760308, 82.511617),\n (138.760308, 82.511617, 136.190107, 82.511617),\n (136.190107, 82.511617, 133.619906, 82.511617),\n (133.619906, 82.511617, 131.049705, 82.511617),\n (131.049705, 82.511617, 128.479504, 82.511617),\n (128.479504, 82.511617, 125.909303, 82.511617),\n (125.909303, 82.511617, 123.339102, 82.511617),\n (123.339102, 82.511617, 120.768901, 82.511617),\n (120.768901, 82.511617, 118.1987, 82.511617),\n (118.1987, 82.511617, 115.628499, 82.511617),\n (115.628499, 82.511617, 113.058298, 82.511617),\n (113.058298, 82.511617, 110.488097, 82.511617),\n (110.488097, 82.511617, 107.917896, 82.511617),\n (107.917896, 82.511617, 105.347695, 82.511617),\n (105.347695, 82.511617, 102.777494, 82.511617),\n (102.777494, 82.511617, 100.207293, 82.511617),\n (100.207293, 82.511617, 97.637092, 82.511617),\n (97.637092, 82.511617, 95.06689, 82.511617),\n (95.06689, 82.511617, 92.496689, 82.511617),\n (92.496689, 82.511617, 89.926488, 82.511617),\n (89.926488, 82.511617, 87.356287, 82.511617),\n (87.356287, 82.511617, 84.786086, 82.511617),\n (84.786086, 82.511617, 82.215885, 82.511617),\n (82.215885, 82.511617, 79.645684, 82.511617),\n (79.645684, 82.511617, 77.075483, 82.511617),\n (159.321917, 82.511617, 159.321917, 96.365183),\n (159.321917, 96.365183, 156.751716, 96.365183),\n (156.751716, 96.365183, 154.181515, 96.365183),\n (154.181515, 96.365183, 151.611314, 96.365183),\n (151.611314, 96.365183, 149.041113, 96.365183),\n (149.041113, 96.365183, 146.470912, 96.365183),\n (146.470912, 96.365183, 143.900711, 96.365183),\n (143.900711, 96.365183, 141.33051, 96.365183),\n (141.33051, 96.365183, 138.760308, 96.365183),\n (138.760308, 96.365183, 136.190107, 96.365183),\n (136.190107, 96.365183, 133.619906, 96.365183),\n (133.619906, 96.365183, 131.049705, 96.365183),\n (131.049705, 96.365183, 128.479504, 96.365183),\n (128.479504, 96.365183, 125.909303, 96.365183),\n (125.909303, 96.365183, 123.339102, 96.365183),\n (123.339102, 96.365183, 120.768901, 96.365183),\n (120.768901, 96.365183, 118.1987, 96.365183),\n (118.1987, 96.365183, 115.628499, 96.365183),\n (115.628499, 96.365183, 113.058298, 96.365183),\n (113.058298, 96.365183, 110.488097, 96.365183),\n (110.488097, 96.365183, 107.917896, 96.365183),\n (107.917896, 96.365183, 105.347695, 96.365183),\n (105.347695, 96.365183, 102.777494, 96.365183),\n (102.777494, 96.365183, 100.207293, 96.365183),\n (100.207293, 96.365183, 97.637092, 96.365183),\n (97.637092, 96.365183, 95.06689, 96.365183),\n (95.06689, 96.365183, 92.496689, 96.365183),\n (92.496689, 96.365183, 89.926488, 96.365183),\n (89.926488, 96.365183, 87.356287, 96.365183),\n (87.356287, 96.365183, 84.786086, 96.365183),\n (84.786086, 96.365183, 82.215885, 96.365183),\n (82.215885, 96.365183, 79.645684, 96.365183),\n (79.645684, 96.365183, 77.075483, 96.365183),\n (77.075483, 96.365183, 77.075483, 82.511617),\n (173.321917, 110.365183, 173.321917, 112.935384),\n (173.321917, 112.935384, 173.321917, 115.505585),\n (173.321917, 115.505585, 173.321917, 118.075786),\n (173.321917, 118.075786, 173.321917, 120.645987),\n (173.321917, 120.645987, 173.321917, 123.216188),\n (173.321917, 123.216188, 173.321917, 125.786389),\n (173.321917, 125.786389, 173.321917, 128.35659),\n (173.321917, 128.35659, 173.321917, 130.926792),\n (173.321917, 130.926792, 173.321917, 133.496993),\n (173.321917, 133.496993, 173.321917, 136.067194),\n (173.321917, 136.067194, 173.321917, 138.637395),\n (173.321917, 138.637395, 173.321917, 141.207596),\n (173.321917, 141.207596, 173.321917, 143.777797),\n (173.321917, 143.777797, 173.321917, 146.347998),\n (173.321917, 146.347998, 173.321917, 148.918199),\n (173.321917, 148.918199, 173.321917, 151.4884),\n (173.321917, 151.4884, 173.321917, 154.058601),\n (173.321917, 154.058601, 173.321917, 156.628802),\n (173.321917, 156.628802, 173.321917, 159.199003),\n (173.321917, 159.199003, 173.321917, 161.769204),\n (173.321917, 161.769204, 173.321917, 164.339405),\n (173.321917, 164.339405, 173.321917, 166.909606),\n (173.321917, 166.909606, 173.321917, 169.479807),\n (173.321917, 169.479807, 173.321917, 172.050008),\n (173.321917, 172.050008, 173.321917, 174.62021),\n (173.321917, 174.62021, 173.321917, 177.190411),\n (173.321917, 177.190411, 173.321917, 179.760612),\n (173.321917, 179.760612, 173.321917, 182.330813),\n (173.321917, 182.330813, 173.321917, 184.901014),\n (173.321917, 184.901014, 173.321917, 187.471215),\n (173.321917, 187.471215, 173.321917, 190.041416),\n (173.321917, 190.041416, 173.321917, 192.611617),\n (187.175483, 110.365183, 187.175483, 112.935384),\n (187.175483, 112.935384, 187.175483, 115.505585),\n (187.175483, 115.505585, 187.175483, 118.075786),\n (187.175483, 118.075786, 187.175483, 120.645987),\n (187.175483, 120.645987, 187.175483, 123.216188),\n (187.175483, 123.216188, 187.175483, 125.786389),\n (187.175483, 125.786389, 187.175483, 128.35659),\n (187.175483, 128.35659, 187.175483, 130.926792),\n (187.175483, 130.926792, 187.175483, 133.496993),\n (187.175483, 133.496993, 187.175483, 136.067194),\n (187.175483, 136.067194, 187.175483, 138.637395),\n (187.175483, 138.637395, 187.175483, 141.207596),\n (187.175483, 141.207596, 187.175483, 143.777797),\n (187.175483, 143.777797, 187.175483, 146.347998),\n (187.175483, 146.347998, 187.175483, 148.918199),\n (187.175483, 148.918199, 187.175483, 151.4884),\n (187.175483, 151.4884, 187.175483, 154.058601),\n (187.175483, 154.058601, 187.175483, 156.628802),\n (187.175483, 156.628802, 187.175483, 159.199003),\n (187.175483, 159.199003, 187.175483, 161.769204),\n (187.175483, 161.769204, 187.175483, 164.339405),\n (187.175483, 164.339405, 187.175483, 166.909606),\n (187.175483, 166.909606, 187.175483, 169.479807),\n (187.175483, 169.479807, 187.175483, 172.050008),\n (187.175483, 172.050008, 187.175483, 174.62021),\n (187.175483, 174.62021, 187.175483, 177.190411),\n (187.175483, 177.190411, 187.175483, 179.760612),\n (187.175483, 179.760612, 187.175483, 182.330813),\n (187.175483, 182.330813, 187.175483, 184.901014),\n (187.175483, 184.901014, 187.175483, 187.471215),\n (187.175483, 187.471215, 187.175483, 190.041416),\n (187.175483, 190.041416, 187.175483, 192.611617),\n (187.175483, 110.365183, 173.321917, 110.365183),\n (187.175483, 192.611617, 173.321917, 192.611617)\n]\nVISIBLE_CIRCLES = [\n (118.1987, 151.4884, 41.123217),\n (118.1987, 151.4884, 4.37481)\n]\nVISIBLE_ARCS = [\n\n]\nHIDDEN_SEGMENTS = [\n (122.5735, 96.3652, 122.5735, 82.5116),\n (113.8239, 82.5116, 113.8239, 96.3652),\n (187.1755, 155.8632, 173.3219, 155.8632),\n (187.1755, 147.1136, 173.3219, 147.1136)\n]\n# (orient, text, p1, p2, base) for linear; (orient, text, center, radius, angle) for diameter\nDIMENSIONS = [\n ('diameter', '%%c100', (118.1987, 151.4884), 41.1232, 45),\n ('diameter', '%%c10.6383', (118.1987, 151.4884), 4.3748, 135),\n ('horizontal', '16.844', (173.3219, 151.4884), (187.1755, 151.4884), (180.2487, 162.4884))\n]\n\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\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\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,\n angle=(0 if d[0] == \"horizontal\" else 90),\n 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,\n text=text, dimstyle=\"EZDXF\").render()\n\n doc.saveas(out_path)\n\n\nif __name__ == \"__main__\":\n out = sys.argv[1] if len(sys.argv) > 1 else \"0008_00085987_gt.dxf\"\n draw(out)\n print(\"wrote\", out)\n```"}], "images": ["images/0008_00085987.png"], "id": "0008_00085987"} {"messages": [{"role": "user", "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 22.29 mm."}, {"role": "assistant", "content": "```python\n#!/usr/bin/env python3\n# -*- coding: utf-8 -*-\n# Ground-truth 2D engineering drawing for part: 0009_00098216\n# Self-contained: reproduces the three-view DXF via ezdxf, NO FreeCAD needed.\n# Coordinates are A4 page millimetres (scale=0.7858503568413777, page=[297.0, 210.0]).\n# visible edges -> solid (layer OUTLINE); hidden edges -> dashed (layer HIDDEN)\n# dimensions -> real movable DIMENSION entities (text = true mm value)\n# Run: python 0009_00098216_gt.py [out.dxf]\nimport sys\nimport ezdxf\n\nSCALE = 0.7858503568413777\nPAGE = [297.0, 210.0]\n\nVISIBLE_SEGMENTS = [\n (149.230618, 81.596218, 146.774835, 81.596218),\n (146.774835, 81.596218, 144.319053, 81.596218),\n (144.319053, 81.596218, 141.863271, 81.596218),\n (141.863271, 81.596218, 139.407488, 81.596218),\n (139.407488, 81.596218, 136.951706, 81.596218),\n (136.951706, 81.596218, 134.495924, 81.596218),\n (134.495924, 81.596218, 132.040141, 81.596218),\n (132.040141, 81.596218, 129.584359, 81.596218),\n (129.584359, 81.596218, 127.128577, 81.596218),\n (127.128577, 81.596218, 124.672794, 81.596218),\n (124.672794, 81.596218, 122.217012, 81.596218),\n (122.217012, 81.596218, 119.761229, 81.596218),\n (119.761229, 81.596218, 117.305447, 81.596218),\n (117.305447, 81.596218, 114.849665, 81.596218),\n (114.849665, 81.596218, 112.393882, 81.596218),\n (112.393882, 81.596218, 109.9381, 81.596218),\n (109.9381, 81.596218, 107.482318, 81.596218),\n (107.482318, 81.596218, 105.026535, 81.596218),\n (105.026535, 81.596218, 102.570753, 81.596218),\n (102.570753, 81.596218, 100.114971, 81.596218),\n (100.114971, 81.596218, 97.659188, 81.596218),\n (97.659188, 81.596218, 95.203406, 81.596218),\n (95.203406, 81.596218, 92.747623, 81.596218),\n (92.747623, 81.596218, 90.291841, 81.596218),\n (90.291841, 81.596218, 87.836059, 81.596218),\n (87.836059, 81.596218, 85.380276, 81.596218),\n (85.380276, 81.596218, 82.924494, 81.596218),\n (82.924494, 81.596218, 80.468712, 81.596218),\n (80.468712, 81.596218, 78.012929, 81.596218),\n (78.012929, 81.596218, 75.557147, 81.596218),\n (75.557147, 81.596218, 73.101365, 81.596218),\n (73.101365, 81.596218, 70.645582, 81.596218),\n (149.230618, 81.596218, 149.230618, 99.111182),\n (149.230618, 99.111182, 146.774835, 99.111182),\n (146.774835, 99.111182, 144.319053, 99.111182),\n (144.319053, 99.111182, 141.863271, 99.111182),\n (141.863271, 99.111182, 139.407488, 99.111182),\n (139.407488, 99.111182, 136.951706, 99.111182),\n (136.951706, 99.111182, 134.495924, 99.111182),\n (134.495924, 99.111182, 132.040141, 99.111182),\n (132.040141, 99.111182, 129.584359, 99.111182),\n (129.584359, 99.111182, 127.128577, 99.111182),\n (127.128577, 99.111182, 124.672794, 99.111182),\n (124.672794, 99.111182, 122.217012, 99.111182),\n (122.217012, 99.111182, 119.761229, 99.111182),\n (119.761229, 99.111182, 117.305447, 99.111182),\n (117.305447, 99.111182, 114.849665, 99.111182),\n (114.849665, 99.111182, 112.393882, 99.111182),\n (112.393882, 99.111182, 109.9381, 99.111182),\n (109.9381, 99.111182, 107.482318, 99.111182),\n (107.482318, 99.111182, 105.026535, 99.111182),\n (105.026535, 99.111182, 102.570753, 99.111182),\n (102.570753, 99.111182, 100.114971, 99.111182),\n (100.114971, 99.111182, 97.659188, 99.111182),\n (97.659188, 99.111182, 95.203406, 99.111182),\n (95.203406, 99.111182, 92.747623, 99.111182),\n (92.747623, 99.111182, 90.291841, 99.111182),\n (90.291841, 99.111182, 87.836059, 99.111182),\n (87.836059, 99.111182, 85.380276, 99.111182),\n (85.380276, 99.111182, 82.924494, 99.111182),\n (82.924494, 99.111182, 80.468712, 99.111182),\n (80.468712, 99.111182, 78.012929, 99.111182),\n (78.012929, 99.111182, 75.557147, 99.111182),\n (75.557147, 99.111182, 73.101365, 99.111182),\n (73.101365, 99.111182, 70.645582, 99.111182),\n (70.645582, 99.111182, 70.645582, 81.596218),\n (163.230618, 113.111182, 163.230618, 115.566965),\n (163.230618, 115.566965, 163.230618, 118.022747),\n (163.230618, 118.022747, 163.230618, 120.478529),\n (163.230618, 120.478529, 163.230618, 122.934312),\n (163.230618, 122.934312, 163.230618, 125.390094),\n (163.230618, 125.390094, 163.230618, 127.845876),\n (163.230618, 127.845876, 163.230618, 130.301659),\n (163.230618, 130.301659, 163.230618, 132.757441),\n (163.230618, 132.757441, 163.230618, 135.213223),\n (163.230618, 135.213223, 163.230618, 137.669006),\n (163.230618, 137.669006, 163.230618, 140.124788),\n (163.230618, 140.124788, 163.230618, 142.580571),\n (163.230618, 142.580571, 163.230618, 145.036353),\n (163.230618, 145.036353, 163.230618, 147.492135),\n (163.230618, 147.492135, 163.230618, 149.947918),\n (163.230618, 149.947918, 163.230618, 152.4037),\n (163.230618, 152.4037, 163.230618, 154.859482),\n (163.230618, 154.859482, 163.230618, 157.315265),\n (163.230618, 157.315265, 163.230618, 159.771047),\n (163.230618, 159.771047, 163.230618, 162.226829),\n (163.230618, 162.226829, 163.230618, 164.682612),\n (163.230618, 164.682612, 163.230618, 167.138394),\n (163.230618, 167.138394, 163.230618, 169.594177),\n (163.230618, 169.594177, 163.230618, 172.049959),\n (163.230618, 172.049959, 163.230618, 174.505741),\n (163.230618, 174.505741, 163.230618, 176.961524),\n (163.230618, 176.961524, 163.230618, 179.417306),\n (163.230618, 179.417306, 163.230618, 181.873088),\n (163.230618, 181.873088, 163.230618, 184.328871),\n (163.230618, 184.328871, 163.230618, 186.784653),\n (163.230618, 186.784653, 163.230618, 189.240435),\n (163.230618, 189.240435, 163.230618, 191.696218),\n (180.745582, 113.111182, 180.745582, 115.566965),\n (180.745582, 115.566965, 180.745582, 118.022747),\n (180.745582, 118.022747, 180.745582, 120.478529),\n (180.745582, 120.478529, 180.745582, 122.934312),\n (180.745582, 122.934312, 180.745582, 125.390094),\n (180.745582, 125.390094, 180.745582, 127.845876),\n (180.745582, 127.845876, 180.745582, 130.301659),\n (180.745582, 130.301659, 180.745582, 132.757441),\n (180.745582, 132.757441, 180.745582, 135.213223),\n (180.745582, 135.213223, 180.745582, 137.669006),\n (180.745582, 137.669006, 180.745582, 140.124788),\n (180.745582, 140.124788, 180.745582, 142.580571),\n (180.745582, 142.580571, 180.745582, 145.036353),\n (180.745582, 145.036353, 180.745582, 147.492135),\n (180.745582, 147.492135, 180.745582, 149.947918),\n (180.745582, 149.947918, 180.745582, 152.4037),\n (180.745582, 152.4037, 180.745582, 154.859482),\n (180.745582, 154.859482, 180.745582, 157.315265),\n (180.745582, 157.315265, 180.745582, 159.771047),\n (180.745582, 159.771047, 180.745582, 162.226829),\n (180.745582, 162.226829, 180.745582, 164.682612),\n (180.745582, 164.682612, 180.745582, 167.138394),\n (180.745582, 167.138394, 180.745582, 169.594177),\n (180.745582, 169.594177, 180.745582, 172.049959),\n (180.745582, 172.049959, 180.745582, 174.505741),\n (180.745582, 174.505741, 180.745582, 176.961524),\n (180.745582, 176.961524, 180.745582, 179.417306),\n (180.745582, 179.417306, 180.745582, 181.873088),\n (180.745582, 181.873088, 180.745582, 184.328871),\n (180.745582, 184.328871, 180.745582, 186.784653),\n (180.745582, 186.784653, 180.745582, 189.240435),\n (180.745582, 189.240435, 180.745582, 191.696218),\n (180.745582, 113.111182, 163.230618, 113.111182),\n (180.745582, 191.696218, 163.230618, 191.696218)\n]\nVISIBLE_CIRCLES = [\n (109.9381, 152.4037, 39.292518),\n (109.9381, 152.4037, 31.925171)\n]\nVISIBLE_ARCS = [\n\n]\nHIDDEN_SEGMENTS = [\n (141.8633, 99.1112, 141.8633, 81.5963),\n (78.0129, 81.5963, 78.0129, 99.1112),\n (180.7456, 184.3289, 163.2306, 184.3289),\n (180.7456, 120.4786, 163.2306, 120.4786)\n]\n# (orient, text, p1, p2, base) for linear; (orient, text, center, radius, angle) for diameter\nDIMENSIONS = [\n ('diameter', '%%c100', (109.9381, 152.4037), 39.2925, 45),\n ('diameter', '%%c81.25', (109.9381, 152.4037), 31.9252, 135),\n ('horizontal', '22.2879', (163.2306, 152.4037), (180.7456, 152.4037), (171.9881, 163.4037))\n]\n\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\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\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,\n angle=(0 if d[0] == \"horizontal\" else 90),\n 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,\n text=text, dimstyle=\"EZDXF\").render()\n\n doc.saveas(out_path)\n\n\nif __name__ == \"__main__\":\n out = sys.argv[1] if len(sys.argv) > 1 else \"0009_00098216_gt.dxf\"\n draw(out)\n print(\"wrote\", out)\n```"}], "images": ["images/0009_00098216.png"], "id": "0009_00098216"} {"messages": [{"role": "user", "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 91.67 mm. It is extruded to a thickness of 106.74 mm."}, {"role": "assistant", "content": "```python\n#!/usr/bin/env python3\n# -*- coding: utf-8 -*-\n# Ground-truth 2D engineering drawing for part: 0010_00100214\n# Self-contained: reproduces the three-view DXF via ezdxf, NO FreeCAD needed.\n# Coordinates are A4 page millimetres (scale=0.46483152173914816, page=[297.0, 210.0]).\n# visible edges -> solid (layer OUTLINE); hidden edges -> dashed (layer HIDDEN)\n# dimensions -> real movable DIMENSION entities (text = true mm value)\n# Run: python 0010_00100214_gt.py [out.dxf]\nimport sys\nimport ezdxf\n\nSCALE = 0.46483152173914816\nPAGE = [297.0, 210.0]\n\nVISIBLE_SEGMENTS = [\n (123.796576, 73.570776, 122.343978, 73.570776),\n (122.343978, 73.570776, 120.891379, 73.570776),\n (120.891379, 73.570776, 119.438781, 73.570776),\n (119.438781, 73.570776, 117.986182, 73.570776),\n (117.986182, 73.570776, 116.533584, 73.570776),\n (116.533584, 73.570776, 115.080985, 73.570776),\n (115.080985, 73.570776, 113.628387, 73.570776),\n (113.628387, 73.570776, 112.175788, 73.570776),\n (112.175788, 73.570776, 110.72319, 73.570776),\n (110.72319, 73.570776, 109.270591, 73.570776),\n (109.270591, 73.570776, 107.817993, 73.570776),\n (107.817993, 73.570776, 106.365394, 73.570776),\n (106.365394, 73.570776, 104.912796, 73.570776),\n (104.912796, 73.570776, 103.460197, 73.570776),\n (103.460197, 73.570776, 102.007599, 73.570776),\n (102.007599, 73.570776, 100.555, 73.570776),\n (100.555, 73.570776, 99.102401, 73.570776),\n (99.102401, 73.570776, 97.649803, 73.570776),\n (97.649803, 73.570776, 96.197204, 73.570776),\n (96.197204, 73.570776, 94.744606, 73.570776),\n (94.744606, 73.570776, 93.292007, 73.570776),\n (93.292007, 73.570776, 91.839409, 73.570776),\n (91.839409, 73.570776, 90.38681, 73.570776),\n (90.38681, 73.570776, 88.934212, 73.570776),\n (88.934212, 73.570776, 87.481613, 73.570776),\n (87.481613, 73.570776, 86.029015, 73.570776),\n (86.029015, 73.570776, 84.576416, 73.570776),\n (84.576416, 73.570776, 83.123818, 73.570776),\n (83.123818, 73.570776, 81.671219, 73.570776),\n (81.671219, 73.570776, 80.218621, 73.570776),\n (80.218621, 73.570776, 78.766022, 73.570776),\n (78.766022, 73.570776, 77.313424, 73.570776),\n (123.796576, 73.570776, 123.796576, 123.187624),\n (123.796576, 123.187624, 122.343978, 123.187624),\n (122.343978, 123.187624, 120.891379, 123.187624),\n (120.891379, 123.187624, 119.438781, 123.187624),\n (119.438781, 123.187624, 117.986182, 123.187624),\n (117.986182, 123.187624, 116.533584, 123.187624),\n (116.533584, 123.187624, 115.080985, 123.187624),\n (115.080985, 123.187624, 113.628387, 123.187624),\n (113.628387, 123.187624, 112.175788, 123.187624),\n (112.175788, 123.187624, 110.72319, 123.187624),\n (110.72319, 123.187624, 109.270591, 123.187624),\n (109.270591, 123.187624, 107.817993, 123.187624),\n (107.817993, 123.187624, 106.365394, 123.187624),\n (106.365394, 123.187624, 104.912796, 123.187624),\n (104.912796, 123.187624, 103.460197, 123.187624),\n (103.460197, 123.187624, 102.007599, 123.187624),\n (102.007599, 123.187624, 100.555, 123.187624),\n (100.555, 123.187624, 99.102401, 123.187624),\n (99.102401, 123.187624, 97.649803, 123.187624),\n (97.649803, 123.187624, 96.197204, 123.187624),\n (96.197204, 123.187624, 94.744606, 123.187624),\n (94.744606, 123.187624, 93.292007, 123.187624),\n (93.292007, 123.187624, 91.839409, 123.187624),\n (91.839409, 123.187624, 90.38681, 123.187624),\n (90.38681, 123.187624, 88.934212, 123.187624),\n (88.934212, 123.187624, 87.481613, 123.187624),\n (87.481613, 123.187624, 86.029015, 123.187624),\n (86.029015, 123.187624, 84.576416, 123.187624),\n (84.576416, 123.187624, 83.123818, 123.187624),\n (83.123818, 123.187624, 81.671219, 123.187624),\n (81.671219, 123.187624, 80.218621, 123.187624),\n (80.218621, 123.187624, 78.766022, 123.187624),\n (78.766022, 123.187624, 77.313424, 123.187624),\n (77.313424, 123.187624, 77.313424, 73.570776),\n (137.796576, 137.187624, 137.796576, 138.640222),\n (137.796576, 138.640222, 137.796576, 140.092821),\n (137.796576, 140.092821, 137.796576, 141.545419),\n (137.796576, 141.545419, 137.796576, 142.998018),\n (137.796576, 142.998018, 137.796576, 144.450616),\n (137.796576, 144.450616, 137.796576, 145.903215),\n (137.796576, 145.903215, 137.796576, 147.355813),\n (137.796576, 147.355813, 137.796576, 148.808412),\n (137.796576, 148.808412, 137.796576, 150.26101),\n (137.796576, 150.26101, 137.796576, 151.713609),\n (137.796576, 151.713609, 137.796576, 153.166207),\n (137.796576, 153.166207, 137.796576, 154.618806),\n (137.796576, 154.618806, 137.796576, 156.071404),\n (137.796576, 156.071404, 137.796576, 157.524003),\n (137.796576, 157.524003, 137.796576, 158.976601),\n (137.796576, 158.976601, 137.796576, 160.4292),\n (137.796576, 160.4292, 137.796576, 161.881799),\n (137.796576, 161.881799, 137.796576, 163.334397),\n (137.796576, 163.334397, 137.796576, 164.786996),\n (137.796576, 164.786996, 137.796576, 166.239594),\n (137.796576, 166.239594, 137.796576, 167.692193),\n (137.796576, 167.692193, 137.796576, 169.144791),\n (137.796576, 169.144791, 137.796576, 170.59739),\n (137.796576, 170.59739, 137.796576, 172.049988),\n (137.796576, 172.049988, 137.796576, 173.502587),\n (137.796576, 173.502587, 137.796576, 174.955185),\n (137.796576, 174.955185, 137.796576, 176.407784),\n (137.796576, 176.407784, 137.796576, 177.860382),\n (137.796576, 177.860382, 137.796576, 179.312981),\n (137.796576, 179.312981, 137.796576, 180.765579),\n (137.796576, 180.765579, 137.796576, 182.218178),\n (137.796576, 182.218178, 137.796576, 183.670776),\n (187.413424, 137.187624, 187.413424, 138.640222),\n (187.413424, 138.640222, 187.413424, 140.092821),\n (187.413424, 140.092821, 187.413424, 141.545419),\n (187.413424, 141.545419, 187.413424, 142.998018),\n (187.413424, 142.998018, 187.413424, 144.450616),\n (187.413424, 144.450616, 187.413424, 145.903215),\n (187.413424, 145.903215, 187.413424, 147.355813),\n (187.413424, 147.355813, 187.413424, 148.808412),\n (187.413424, 148.808412, 187.413424, 150.26101),\n (187.413424, 150.26101, 187.413424, 151.713609),\n (187.413424, 151.713609, 187.413424, 153.166207),\n (187.413424, 153.166207, 187.413424, 154.618806),\n (187.413424, 154.618806, 187.413424, 156.071404),\n (187.413424, 156.071404, 187.413424, 157.524003),\n (187.413424, 157.524003, 187.413424, 158.976601),\n (187.413424, 158.976601, 187.413424, 160.4292),\n (187.413424, 160.4292, 187.413424, 161.881799),\n (187.413424, 161.881799, 187.413424, 163.334397),\n (187.413424, 163.334397, 187.413424, 164.786996),\n (187.413424, 164.786996, 187.413424, 166.239594),\n (187.413424, 166.239594, 187.413424, 167.692193),\n (187.413424, 167.692193, 187.413424, 169.144791),\n (187.413424, 169.144791, 187.413424, 170.59739),\n (187.413424, 170.59739, 187.413424, 172.049988),\n (187.413424, 172.049988, 187.413424, 173.502587),\n (187.413424, 173.502587, 187.413424, 174.955185),\n (187.413424, 174.955185, 187.413424, 176.407784),\n (187.413424, 176.407784, 187.413424, 177.860382),\n (187.413424, 177.860382, 187.413424, 179.312981),\n (187.413424, 179.312981, 187.413424, 180.765579),\n (187.413424, 180.765579, 187.413424, 182.218178),\n (187.413424, 182.218178, 187.413424, 183.670776),\n (187.413424, 137.187624, 137.796576, 137.187624),\n (187.413424, 183.670776, 137.796576, 183.670776)\n]\nVISIBLE_CIRCLES = [\n (100.555, 160.4292, 23.241576),\n (100.555, 160.4292, 21.304778)\n]\nVISIBLE_ARCS = [\n\n]\nHIDDEN_SEGMENTS = [\n (121.8598, 123.1876, 121.8598, 73.5708),\n (79.2502, 73.5708, 79.2502, 123.1876),\n (187.4134, 181.734, 137.7966, 181.734),\n (187.4134, 139.1244, 137.7966, 139.1244)\n]\n# (orient, text, p1, p2, base) for linear; (orient, text, center, radius, angle) for diameter\nDIMENSIONS = [\n ('diameter', '%%c100', (100.555, 160.4292), 23.2416, 45),\n ('diameter', '%%c91.6667', (100.555, 160.4292), 21.3048, 135),\n ('horizontal', '106.742', (137.7966, 160.4292), (187.4134, 160.4292), (162.605, 171.4292))\n]\n\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\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\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,\n angle=(0 if d[0] == \"horizontal\" else 90),\n 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,\n text=text, dimstyle=\"EZDXF\").render()\n\n doc.saveas(out_path)\n\n\nif __name__ == \"__main__\":\n out = sys.argv[1] if len(sys.argv) > 1 else \"0010_00100214_gt.dxf\"\n draw(out)\n print(\"wrote\", out)\n```"}], "images": ["images/0010_00100214.png"], "id": "0010_00100214"} {"messages": [{"role": "user", "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 2.08 mm. It is extruded to a thickness of 1.55 mm."}, {"role": "assistant", "content": "```python\n#!/usr/bin/env python3\n# -*- coding: utf-8 -*-\n# Ground-truth 2D engineering drawing for part: 0010_00103607\n# Self-contained: reproduces the three-view DXF via ezdxf, NO FreeCAD needed.\n# Coordinates are A4 page millimetres (scale=0.7347, page=[297.0, 210.0]).\n# visible edges -> solid (layer OUTLINE); hidden edges -> dashed (layer HIDDEN)\n# dimensions -> real movable DIMENSION entities (text = true mm value)\n# Run: python 0010_00103607_gt.py [out.dxf]\nimport sys\nimport ezdxf\n\nSCALE = 0.7347\nPAGE = [297.0, 210.0]\n\nVISIBLE_SEGMENTS = [\n (89.8219, 92.2005, 92.117838, 92.2005),\n (92.117838, 92.2005, 94.413775, 92.2005),\n (94.413775, 92.2005, 96.709712, 92.2005),\n (96.709712, 92.2005, 99.00565, 92.2005),\n (99.00565, 92.2005, 101.301587, 92.2005),\n (101.301587, 92.2005, 103.597525, 92.2005),\n (103.597525, 92.2005, 105.893462, 92.2005),\n (105.893462, 92.2005, 108.1894, 92.2005),\n (108.1894, 92.2005, 110.485338, 92.2005),\n (110.485338, 92.2005, 112.781275, 92.2005),\n (112.781275, 92.2005, 115.077213, 92.2005),\n (115.077213, 92.2005, 117.37315, 92.2005),\n (117.37315, 92.2005, 119.669088, 92.2005),\n (119.669088, 92.2005, 121.965025, 92.2005),\n (121.965025, 92.2005, 124.260963, 92.2005),\n (124.260963, 92.2005, 126.5569, 92.2005),\n (126.5569, 92.2005, 128.852837, 92.2005),\n (128.852837, 92.2005, 131.148775, 92.2005),\n (131.148775, 92.2005, 133.444712, 92.2005),\n (133.444712, 92.2005, 135.74065, 92.2005),\n (135.74065, 92.2005, 138.036588, 92.2005),\n (138.036588, 92.2005, 140.332525, 92.2005),\n (140.332525, 92.2005, 142.628463, 92.2005),\n (142.628463, 92.2005, 144.9244, 92.2005),\n (144.9244, 92.2005, 147.220338, 92.2005),\n (147.220338, 92.2005, 149.516275, 92.2005),\n (149.516275, 92.2005, 151.812213, 92.2005),\n (151.812213, 92.2005, 154.10815, 92.2005),\n (154.10815, 92.2005, 156.404088, 92.2005),\n (156.404088, 92.2005, 158.700025, 92.2005),\n (158.700025, 92.2005, 160.995963, 92.2005),\n (160.995963, 92.2005, 163.2919, 92.2005),\n (163.2919, 92.2005, 163.2919, 91.064489),\n (89.8219, 91.064489, 92.117838, 91.064489),\n (92.117838, 91.064489, 94.413775, 91.064489),\n (94.413775, 91.064489, 96.709712, 91.064489),\n (96.709712, 91.064489, 99.00565, 91.064489),\n (99.00565, 91.064489, 101.301587, 91.064489),\n (101.301587, 91.064489, 103.597525, 91.064489),\n (103.597525, 91.064489, 105.893462, 91.064489),\n (105.893462, 91.064489, 108.1894, 91.064489),\n (108.1894, 91.064489, 110.485338, 91.064489),\n (110.485338, 91.064489, 112.781275, 91.064489),\n (112.781275, 91.064489, 115.077213, 91.064489),\n (115.077213, 91.064489, 117.37315, 91.064489),\n (117.37315, 91.064489, 119.669088, 91.064489),\n (119.669088, 91.064489, 121.965025, 91.064489),\n (121.965025, 91.064489, 124.260963, 91.064489),\n (124.260963, 91.064489, 126.5569, 91.064489),\n (126.5569, 91.064489, 128.852837, 91.064489),\n (128.852837, 91.064489, 131.148775, 91.064489),\n (131.148775, 91.064489, 133.444712, 91.064489),\n (133.444712, 91.064489, 135.74065, 91.064489),\n (135.74065, 91.064489, 138.036588, 91.064489),\n (138.036588, 91.064489, 140.332525, 91.064489),\n (140.332525, 91.064489, 142.628463, 91.064489),\n (142.628463, 91.064489, 144.9244, 91.064489),\n (144.9244, 91.064489, 147.220338, 91.064489),\n (147.220338, 91.064489, 149.516275, 91.064489),\n (149.516275, 91.064489, 151.812213, 91.064489),\n (151.812213, 91.064489, 154.10815, 91.064489),\n (154.10815, 91.064489, 156.404088, 91.064489),\n (156.404088, 91.064489, 158.700025, 91.064489),\n (158.700025, 91.064489, 160.995963, 91.064489),\n (160.995963, 91.064489, 163.2919, 91.064489),\n (89.8219, 91.064489, 89.8219, 92.2005),\n (178.427911, 179.6705, 178.427911, 177.374562),\n (178.427911, 177.374562, 178.427911, 175.078625),\n (178.427911, 175.078625, 178.427911, 172.782688),\n (178.427911, 172.782688, 178.427911, 170.48675),\n (178.427911, 170.48675, 178.427911, 168.190812),\n (178.427911, 168.190812, 178.427911, 165.894875),\n (178.427911, 165.894875, 178.427911, 163.598938),\n (178.427911, 163.598938, 178.427911, 161.303),\n (178.427911, 161.303, 178.427911, 159.007063),\n (178.427911, 159.007063, 178.427911, 156.711125),\n (178.427911, 156.711125, 178.427911, 154.415188),\n (178.427911, 154.415188, 178.427911, 152.11925),\n (178.427911, 152.11925, 178.427911, 149.823313),\n (178.427911, 149.823313, 178.427911, 147.527375),\n (178.427911, 147.527375, 178.427911, 145.231438),\n (178.427911, 145.231438, 178.427911, 142.9355),\n (178.427911, 142.9355, 178.427911, 140.639562),\n (178.427911, 140.639562, 178.427911, 138.343625),\n (178.427911, 138.343625, 178.427911, 136.047687),\n (178.427911, 136.047687, 178.427911, 133.75175),\n (178.427911, 133.75175, 178.427911, 131.455813),\n (178.427911, 131.455813, 178.427911, 129.159875),\n (178.427911, 129.159875, 178.427911, 126.863938),\n (178.427911, 126.863938, 178.427911, 124.568),\n (178.427911, 124.568, 178.427911, 122.272063),\n (178.427911, 122.272063, 178.427911, 119.976125),\n (178.427911, 119.976125, 178.427911, 117.680188),\n (178.427911, 117.680188, 178.427911, 115.38425),\n (178.427911, 115.38425, 178.427911, 113.088313),\n (178.427911, 113.088313, 178.427911, 110.792375),\n (178.427911, 110.792375, 178.427911, 108.496438),\n (178.427911, 108.496438, 178.427911, 106.2005),\n (177.2919, 179.6705, 177.2919, 177.374562),\n (177.2919, 177.374562, 177.2919, 175.078625),\n (177.2919, 175.078625, 177.2919, 172.782688),\n (177.2919, 172.782688, 177.2919, 170.48675),\n (177.2919, 170.48675, 177.2919, 168.190812),\n (177.2919, 168.190812, 177.2919, 165.894875),\n (177.2919, 165.894875, 177.2919, 163.598938),\n (177.2919, 163.598938, 177.2919, 161.303),\n (177.2919, 161.303, 177.2919, 159.007063),\n (177.2919, 159.007063, 177.2919, 156.711125),\n (177.2919, 156.711125, 177.2919, 154.415188),\n (177.2919, 154.415188, 177.2919, 152.11925),\n (177.2919, 152.11925, 177.2919, 149.823313),\n (177.2919, 149.823313, 177.2919, 147.527375),\n (177.2919, 147.527375, 177.2919, 145.231438),\n (177.2919, 145.231438, 177.2919, 142.9355),\n (177.2919, 142.9355, 177.2919, 140.639562),\n (177.2919, 140.639562, 177.2919, 138.343625),\n (177.2919, 138.343625, 177.2919, 136.047687),\n (177.2919, 136.047687, 177.2919, 133.75175),\n (177.2919, 133.75175, 177.2919, 131.455813),\n (177.2919, 131.455813, 177.2919, 129.159875),\n (177.2919, 129.159875, 177.2919, 126.863938),\n (177.2919, 126.863938, 177.2919, 124.568),\n (177.2919, 124.568, 177.2919, 122.272063),\n (177.2919, 122.272063, 177.2919, 119.976125),\n (177.2919, 119.976125, 177.2919, 117.680188),\n (177.2919, 117.680188, 177.2919, 115.38425),\n (177.2919, 115.38425, 177.2919, 113.088313),\n (177.2919, 113.088313, 177.2919, 110.792375),\n (177.2919, 110.792375, 177.2919, 108.496438),\n (177.2919, 108.496438, 177.2919, 106.2005),\n (177.2919, 179.6705, 178.427911, 179.6705),\n (177.2919, 106.2005, 178.427911, 106.2005)\n]\nVISIBLE_CIRCLES = [\n (126.5569, 142.9355, 36.735),\n (126.5569, 142.9355, 0.765313)\n]\nVISIBLE_ARCS = [\n\n]\nHIDDEN_SEGMENTS = [\n (127.3222, 91.0645, 127.3222, 92.2005),\n (125.7916, 92.2005, 125.7916, 91.0645),\n (177.2919, 142.1702, 178.4279, 142.1702),\n (177.2919, 143.7008, 178.4279, 143.7008)\n]\n# (orient, text, p1, p2, base) for linear; (orient, text, center, radius, angle) for diameter\nDIMENSIONS = [\n ('diameter', '%%c100', (126.5569, 142.9355), 36.735, 45),\n ('diameter', '%%c2.0833', (126.5569, 142.9355), 0.7653, 135),\n ('horizontal', '1.5462', (178.4279, 142.9355), (177.2919, 142.9355), (177.8599, 131.9355))\n]\n\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\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\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,\n angle=(0 if d[0] == \"horizontal\" else 90),\n 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,\n text=text, dimstyle=\"EZDXF\").render()\n\n doc.saveas(out_path)\n\n\nif __name__ == \"__main__\":\n out = sys.argv[1] if len(sys.argv) > 1 else \"0010_00103607_gt.dxf\"\n draw(out)\n print(\"wrote\", out)\n```"}], "images": ["images/0010_00103607.png"], "id": "0010_00103607"} {"messages": [{"role": "user", "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 83.33 mm. It is extruded to a thickness of 413.04 mm."}, {"role": "assistant", "content": "```python\n#!/usr/bin/env python3\n# -*- coding: utf-8 -*-\n# Ground-truth 2D engineering drawing for part: 0010_00105760\n# Self-contained: reproduces the three-view DXF via ezdxf, NO FreeCAD needed.\n# Coordinates are A4 page millimetres (scale=0.18731355932203375, page=[297.0, 210.0]).\n# visible edges -> solid (layer OUTLINE); hidden edges -> dashed (layer HIDDEN)\n# dimensions -> real movable DIMENSION entities (text = true mm value)\n# Run: python 0010_00105760_gt.py [out.dxf]\nimport sys\nimport ezdxf\n\nSCALE = 0.18731355932203375\nPAGE = [297.0, 210.0]\n\nVISIBLE_SEGMENTS = [\n (102.888778, 66.632878, 102.303423, 66.632878),\n (102.303423, 66.632878, 101.718068, 66.632878),\n (101.718068, 66.632878, 101.132713, 66.632878),\n (101.132713, 66.632878, 100.547358, 66.632878),\n (100.547358, 66.632878, 99.962004, 66.632878),\n (99.962004, 66.632878, 99.376649, 66.632878),\n (99.376649, 66.632878, 98.791294, 66.632878),\n (98.791294, 66.632878, 98.205939, 66.632878),\n (98.205939, 66.632878, 97.620584, 66.632878),\n (97.620584, 66.632878, 97.035229, 66.632878),\n (97.035229, 66.632878, 96.449874, 66.632878),\n (96.449874, 66.632878, 95.864519, 66.632878),\n (95.864519, 66.632878, 95.279165, 66.632878),\n (95.279165, 66.632878, 94.69381, 66.632878),\n (94.69381, 66.632878, 94.108455, 66.632878),\n (94.108455, 66.632878, 93.5231, 66.632878),\n (93.5231, 66.632878, 92.937745, 66.632878),\n (92.937745, 66.632878, 92.35239, 66.632878),\n (92.35239, 66.632878, 91.767035, 66.632878),\n (91.767035, 66.632878, 91.181681, 66.632878),\n (91.181681, 66.632878, 90.596326, 66.632878),\n (90.596326, 66.632878, 90.010971, 66.632878),\n (90.010971, 66.632878, 89.425616, 66.632878),\n (89.425616, 66.632878, 88.840261, 66.632878),\n (88.840261, 66.632878, 88.254906, 66.632878),\n (88.254906, 66.632878, 87.669551, 66.632878),\n (87.669551, 66.632878, 87.084196, 66.632878),\n (87.084196, 66.632878, 86.498842, 66.632878),\n (86.498842, 66.632878, 85.913487, 66.632878),\n (85.913487, 66.632878, 85.328132, 66.632878),\n (85.328132, 66.632878, 84.742777, 66.632878),\n (84.742777, 66.632878, 84.157422, 66.632878),\n (102.888778, 66.632878, 102.888778, 144.001522),\n (102.888778, 144.001522, 102.303423, 144.001522),\n (102.303423, 144.001522, 101.718068, 144.001522),\n (101.718068, 144.001522, 101.132713, 144.001522),\n (101.132713, 144.001522, 100.547358, 144.001522),\n (100.547358, 144.001522, 99.962004, 144.001522),\n (99.962004, 144.001522, 99.376649, 144.001522),\n (99.376649, 144.001522, 98.791294, 144.001522),\n (98.791294, 144.001522, 98.205939, 144.001522),\n (98.205939, 144.001522, 97.620584, 144.001522),\n (97.620584, 144.001522, 97.035229, 144.001522),\n (97.035229, 144.001522, 96.449874, 144.001522),\n (96.449874, 144.001522, 95.864519, 144.001522),\n (95.864519, 144.001522, 95.279165, 144.001522),\n (95.279165, 144.001522, 94.69381, 144.001522),\n (94.69381, 144.001522, 94.108455, 144.001522),\n (94.108455, 144.001522, 93.5231, 144.001522),\n (93.5231, 144.001522, 92.937745, 144.001522),\n (92.937745, 144.001522, 92.35239, 144.001522),\n (92.35239, 144.001522, 91.767035, 144.001522),\n (91.767035, 144.001522, 91.181681, 144.001522),\n (91.181681, 144.001522, 90.596326, 144.001522),\n (90.596326, 144.001522, 90.010971, 144.001522),\n (90.010971, 144.001522, 89.425616, 144.001522),\n (89.425616, 144.001522, 88.840261, 144.001522),\n (88.840261, 144.001522, 88.254906, 144.001522),\n (88.254906, 144.001522, 87.669551, 144.001522),\n (87.669551, 144.001522, 87.084196, 144.001522),\n (87.084196, 144.001522, 86.498842, 144.001522),\n (86.498842, 144.001522, 85.913487, 144.001522),\n (85.913487, 144.001522, 85.328132, 144.001522),\n (85.328132, 144.001522, 84.742777, 144.001522),\n (84.742777, 144.001522, 84.157422, 144.001522),\n (84.157422, 144.001522, 84.157422, 66.632878),\n (116.888778, 158.001522, 116.888778, 158.586877),\n (116.888778, 158.586877, 116.888778, 159.172232),\n (116.888778, 159.172232, 116.888778, 159.757587),\n (116.888778, 159.757587, 116.888778, 160.342942),\n (116.888778, 160.342942, 116.888778, 160.928296),\n (116.888778, 160.928296, 116.888778, 161.513651),\n (116.888778, 161.513651, 116.888778, 162.099006),\n (116.888778, 162.099006, 116.888778, 162.684361),\n (116.888778, 162.684361, 116.888778, 163.269716),\n (116.888778, 163.269716, 116.888778, 163.855071),\n (116.888778, 163.855071, 116.888778, 164.440426),\n (116.888778, 164.440426, 116.888778, 165.025781),\n (116.888778, 165.025781, 116.888778, 165.611135),\n (116.888778, 165.611135, 116.888778, 166.19649),\n (116.888778, 166.19649, 116.888778, 166.781845),\n (116.888778, 166.781845, 116.888778, 167.3672),\n (116.888778, 167.3672, 116.888778, 167.952555),\n (116.888778, 167.952555, 116.888778, 168.53791),\n (116.888778, 168.53791, 116.888778, 169.123265),\n (116.888778, 169.123265, 116.888778, 169.708619),\n (116.888778, 169.708619, 116.888778, 170.293974),\n (116.888778, 170.293974, 116.888778, 170.879329),\n (116.888778, 170.879329, 116.888778, 171.464684),\n (116.888778, 171.464684, 116.888778, 172.050039),\n (116.888778, 172.050039, 116.888778, 172.635394),\n (116.888778, 172.635394, 116.888778, 173.220749),\n (116.888778, 173.220749, 116.888778, 173.806104),\n (116.888778, 173.806104, 116.888778, 174.391458),\n (116.888778, 174.391458, 116.888778, 174.976813),\n (116.888778, 174.976813, 116.888778, 175.562168),\n (116.888778, 175.562168, 116.888778, 176.147523),\n (116.888778, 176.147523, 116.888778, 176.732878),\n (194.257422, 158.001522, 194.257422, 158.586877),\n (194.257422, 158.586877, 194.257422, 159.172232),\n (194.257422, 159.172232, 194.257422, 159.757587),\n (194.257422, 159.757587, 194.257422, 160.342942),\n (194.257422, 160.342942, 194.257422, 160.928296),\n (194.257422, 160.928296, 194.257422, 161.513651),\n (194.257422, 161.513651, 194.257422, 162.099006),\n (194.257422, 162.099006, 194.257422, 162.684361),\n (194.257422, 162.684361, 194.257422, 163.269716),\n (194.257422, 163.269716, 194.257422, 163.855071),\n (194.257422, 163.855071, 194.257422, 164.440426),\n (194.257422, 164.440426, 194.257422, 165.025781),\n (194.257422, 165.025781, 194.257422, 165.611135),\n (194.257422, 165.611135, 194.257422, 166.19649),\n (194.257422, 166.19649, 194.257422, 166.781845),\n (194.257422, 166.781845, 194.257422, 167.3672),\n (194.257422, 167.3672, 194.257422, 167.952555),\n (194.257422, 167.952555, 194.257422, 168.53791),\n (194.257422, 168.53791, 194.257422, 169.123265),\n (194.257422, 169.123265, 194.257422, 169.708619),\n (194.257422, 169.708619, 194.257422, 170.293974),\n (194.257422, 170.293974, 194.257422, 170.879329),\n (194.257422, 170.879329, 194.257422, 171.464684),\n (194.257422, 171.464684, 194.257422, 172.050039),\n (194.257422, 172.050039, 194.257422, 172.635394),\n (194.257422, 172.635394, 194.257422, 173.220749),\n (194.257422, 173.220749, 194.257422, 173.806104),\n (194.257422, 173.806104, 194.257422, 174.391458),\n (194.257422, 174.391458, 194.257422, 174.976813),\n (194.257422, 174.976813, 194.257422, 175.562168),\n (194.257422, 175.562168, 194.257422, 176.147523),\n (194.257422, 176.147523, 194.257422, 176.732878),\n (194.257422, 158.001522, 116.888778, 158.001522),\n (194.257422, 176.732878, 116.888778, 176.732878)\n]\nVISIBLE_CIRCLES = [\n (93.5231, 167.3672, 9.365678),\n (93.5231, 167.3672, 7.804732)\n]\nVISIBLE_ARCS = [\n\n]\nHIDDEN_SEGMENTS = [\n (101.3278, 144.0015, 101.3278, 66.6328),\n (85.7183, 66.6328, 85.7183, 144.0015),\n (194.2574, 175.1719, 116.8888, 175.1719),\n (194.2574, 159.5624, 116.8888, 159.5624)\n]\n# (orient, text, p1, p2, base) for linear; (orient, text, center, radius, angle) for diameter\nDIMENSIONS = [\n ('diameter', '%%c100', (93.5231, 167.3672), 9.3657, 45),\n ('diameter', '%%c83.3333', (93.5231, 167.3672), 7.8047, 135),\n ('horizontal', '413.043', (116.8888, 167.3672), (194.2574, 167.3672), (155.5731, 178.3672))\n]\n\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\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\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,\n angle=(0 if d[0] == \"horizontal\" else 90),\n 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,\n text=text, dimstyle=\"EZDXF\").render()\n\n doc.saveas(out_path)\n\n\nif __name__ == \"__main__\":\n out = sys.argv[1] if len(sys.argv) > 1 else \"0010_00105760_gt.dxf\"\n draw(out)\n print(\"wrote\", out)\n```"}], "images": ["images/0010_00105760.png"], "id": "0010_00105760"} {"messages": [{"role": "user", "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 20.83 mm. It is extruded to a thickness of 29.89 mm."}, {"role": "assistant", "content": "```python\n#!/usr/bin/env python3\n# -*- coding: utf-8 -*-\n# Ground-truth 2D engineering drawing for part: 0010_00108328\n# Self-contained: reproduces the three-view DXF via ezdxf, NO FreeCAD needed.\n# Coordinates are A4 page millimetres (scale=0.7347, page=[297.0, 210.0]).\n# visible edges -> solid (layer OUTLINE); hidden edges -> dashed (layer HIDDEN)\n# dimensions -> real movable DIMENSION entities (text = true mm value)\n# Run: python 0010_00108328_gt.py [out.dxf]\nimport sys\nimport ezdxf\n\nSCALE = 0.7347\nPAGE = [297.0, 210.0]\n\nVISIBLE_SEGMENTS = [\n (77.6865, 102.6139, 79.982438, 102.6139),\n (79.982438, 102.6139, 82.278375, 102.6139),\n (82.278375, 102.6139, 84.574312, 102.6139),\n (84.574312, 102.6139, 86.87025, 102.6139),\n (86.87025, 102.6139, 89.166187, 102.6139),\n (89.166187, 102.6139, 91.462125, 102.6139),\n (91.462125, 102.6139, 93.758062, 102.6139),\n (93.758062, 102.6139, 96.054, 102.6139),\n (96.054, 102.6139, 98.349938, 102.6139),\n (98.349938, 102.6139, 100.645875, 102.6139),\n (100.645875, 102.6139, 102.941813, 102.6139),\n (102.941813, 102.6139, 105.23775, 102.6139),\n (105.23775, 102.6139, 107.533688, 102.6139),\n (107.533688, 102.6139, 109.829625, 102.6139),\n (109.829625, 102.6139, 112.125563, 102.6139),\n (112.125563, 102.6139, 114.4215, 102.6139),\n (114.4215, 102.6139, 116.717437, 102.6139),\n (116.717437, 102.6139, 119.013375, 102.6139),\n (119.013375, 102.6139, 121.309312, 102.6139),\n (121.309312, 102.6139, 123.60525, 102.6139),\n (123.60525, 102.6139, 125.901188, 102.6139),\n (125.901188, 102.6139, 128.197125, 102.6139),\n (128.197125, 102.6139, 130.493063, 102.6139),\n (130.493063, 102.6139, 132.789, 102.6139),\n (132.789, 102.6139, 135.084938, 102.6139),\n (135.084938, 102.6139, 137.380875, 102.6139),\n (137.380875, 102.6139, 139.676813, 102.6139),\n (139.676813, 102.6139, 141.97275, 102.6139),\n (141.97275, 102.6139, 144.268688, 102.6139),\n (144.268688, 102.6139, 146.564625, 102.6139),\n (146.564625, 102.6139, 148.860563, 102.6139),\n (148.860563, 102.6139, 151.1565, 102.6139),\n (151.1565, 102.6139, 151.1565, 80.651025),\n (77.6865, 80.651025, 79.982438, 80.651025),\n (79.982438, 80.651025, 82.278375, 80.651025),\n (82.278375, 80.651025, 84.574312, 80.651025),\n (84.574312, 80.651025, 86.87025, 80.651025),\n (86.87025, 80.651025, 89.166187, 80.651025),\n (89.166187, 80.651025, 91.462125, 80.651025),\n (91.462125, 80.651025, 93.758062, 80.651025),\n (93.758062, 80.651025, 96.054, 80.651025),\n (96.054, 80.651025, 98.349938, 80.651025),\n (98.349938, 80.651025, 100.645875, 80.651025),\n (100.645875, 80.651025, 102.941813, 80.651025),\n (102.941813, 80.651025, 105.23775, 80.651025),\n (105.23775, 80.651025, 107.533688, 80.651025),\n (107.533688, 80.651025, 109.829625, 80.651025),\n (109.829625, 80.651025, 112.125563, 80.651025),\n (112.125563, 80.651025, 114.4215, 80.651025),\n (114.4215, 80.651025, 116.717437, 80.651025),\n (116.717437, 80.651025, 119.013375, 80.651025),\n (119.013375, 80.651025, 121.309312, 80.651025),\n (121.309312, 80.651025, 123.60525, 80.651025),\n (123.60525, 80.651025, 125.901188, 80.651025),\n (125.901188, 80.651025, 128.197125, 80.651025),\n (128.197125, 80.651025, 130.493063, 80.651025),\n (130.493063, 80.651025, 132.789, 80.651025),\n (132.789, 80.651025, 135.084938, 80.651025),\n (135.084938, 80.651025, 137.380875, 80.651025),\n (137.380875, 80.651025, 139.676813, 80.651025),\n (139.676813, 80.651025, 141.97275, 80.651025),\n (141.97275, 80.651025, 144.268688, 80.651025),\n (144.268688, 80.651025, 146.564625, 80.651025),\n (146.564625, 80.651025, 148.860563, 80.651025),\n (148.860563, 80.651025, 151.1565, 80.651025),\n (77.6865, 80.651025, 77.6865, 102.6139),\n (187.119375, 190.0839, 187.119375, 187.787962),\n (187.119375, 187.787962, 187.119375, 185.492025),\n (187.119375, 185.492025, 187.119375, 183.196088),\n (187.119375, 183.196088, 187.119375, 180.90015),\n (187.119375, 180.90015, 187.119375, 178.604212),\n (187.119375, 178.604212, 187.119375, 176.308275),\n (187.119375, 176.308275, 187.119375, 174.012338),\n (187.119375, 174.012338, 187.119375, 171.7164),\n (187.119375, 171.7164, 187.119375, 169.420462),\n (187.119375, 169.420462, 187.119375, 167.124525),\n (187.119375, 167.124525, 187.119375, 164.828588),\n (187.119375, 164.828588, 187.119375, 162.53265),\n (187.119375, 162.53265, 187.119375, 160.236713),\n (187.119375, 160.236713, 187.119375, 157.940775),\n (187.119375, 157.940775, 187.119375, 155.644838),\n (187.119375, 155.644838, 187.119375, 153.3489),\n (187.119375, 153.3489, 187.119375, 151.052962),\n (187.119375, 151.052962, 187.119375, 148.757025),\n (187.119375, 148.757025, 187.119375, 146.461087),\n (187.119375, 146.461087, 187.119375, 144.16515),\n (187.119375, 144.16515, 187.119375, 141.869213),\n (187.119375, 141.869213, 187.119375, 139.573275),\n (187.119375, 139.573275, 187.119375, 137.277338),\n (187.119375, 137.277338, 187.119375, 134.9814),\n (187.119375, 134.9814, 187.119375, 132.685462),\n (187.119375, 132.685462, 187.119375, 130.389525),\n (187.119375, 130.389525, 187.119375, 128.093588),\n (187.119375, 128.093588, 187.119375, 125.79765),\n (187.119375, 125.79765, 187.119375, 123.501713),\n (187.119375, 123.501713, 187.119375, 121.205775),\n (187.119375, 121.205775, 187.119375, 118.909838),\n (187.119375, 118.909838, 187.119375, 116.6139),\n (165.1565, 190.0839, 165.1565, 187.787962),\n (165.1565, 187.787962, 165.1565, 185.492025),\n (165.1565, 185.492025, 165.1565, 183.196088),\n (165.1565, 183.196088, 165.1565, 180.90015),\n (165.1565, 180.90015, 165.1565, 178.604212),\n (165.1565, 178.604212, 165.1565, 176.308275),\n (165.1565, 176.308275, 165.1565, 174.012338),\n (165.1565, 174.012338, 165.1565, 171.7164),\n (165.1565, 171.7164, 165.1565, 169.420463),\n (165.1565, 169.420463, 165.1565, 167.124525),\n (165.1565, 167.124525, 165.1565, 164.828588),\n (165.1565, 164.828588, 165.1565, 162.53265),\n (165.1565, 162.53265, 165.1565, 160.236713),\n (165.1565, 160.236713, 165.1565, 157.940775),\n (165.1565, 157.940775, 165.1565, 155.644838),\n (165.1565, 155.644838, 165.1565, 153.3489),\n (165.1565, 153.3489, 165.1565, 151.052963),\n (165.1565, 151.052963, 165.1565, 148.757025),\n (165.1565, 148.757025, 165.1565, 146.461087),\n (165.1565, 146.461087, 165.1565, 144.16515),\n (165.1565, 144.16515, 165.1565, 141.869213),\n (165.1565, 141.869213, 165.1565, 139.573275),\n (165.1565, 139.573275, 165.1565, 137.277338),\n (165.1565, 137.277338, 165.1565, 134.9814),\n (165.1565, 134.9814, 165.1565, 132.685462),\n (165.1565, 132.685462, 165.1565, 130.389525),\n (165.1565, 130.389525, 165.1565, 128.093588),\n (165.1565, 128.093588, 165.1565, 125.79765),\n (165.1565, 125.79765, 165.1565, 123.501713),\n (165.1565, 123.501713, 165.1565, 121.205775),\n (165.1565, 121.205775, 165.1565, 118.909838),\n (165.1565, 118.909838, 165.1565, 116.6139),\n (165.1565, 190.0839, 187.119375, 190.0839),\n (165.1565, 116.6139, 187.119375, 116.6139)\n]\nVISIBLE_CIRCLES = [\n (114.4215, 153.3489, 36.735),\n (114.4215, 153.3489, 7.653125)\n]\nVISIBLE_ARCS = [\n\n]\nHIDDEN_SEGMENTS = [\n (122.0747, 80.6511, 122.0747, 102.6139),\n (106.7684, 102.6139, 106.7684, 80.6511),\n (165.1565, 145.6958, 187.1194, 145.6958),\n (165.1565, 161.0021, 187.1194, 161.0021)\n]\n# (orient, text, p1, p2, base) for linear; (orient, text, center, radius, angle) for diameter\nDIMENSIONS = [\n ('diameter', '%%c100', (114.4215, 153.3489), 36.735, 45),\n ('diameter', '%%c20.8333', (114.4215, 153.3489), 7.6531, 135),\n ('horizontal', '29.8937', (187.1194, 153.3489), (165.1565, 153.3489), (176.138, 142.3489))\n]\n\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\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\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,\n angle=(0 if d[0] == \"horizontal\" else 90),\n 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,\n text=text, dimstyle=\"EZDXF\").render()\n\n doc.saveas(out_path)\n\n\nif __name__ == \"__main__\":\n out = sys.argv[1] if len(sys.argv) > 1 else \"0010_00108328_gt.dxf\"\n draw(out)\n print(\"wrote\", out)\n```"}], "images": ["images/0010_00108328.png"], "id": "0010_00108328"} {"messages": [{"role": "user", "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 50 mm. It is extruded to a thickness of 5.15 mm."}, {"role": "assistant", "content": "```python\n#!/usr/bin/env python3\n# -*- coding: utf-8 -*-\n# Ground-truth 2D engineering drawing for part: 0013_00131967\n# Self-contained: reproduces the three-view DXF via ezdxf, NO FreeCAD needed.\n# Coordinates are A4 page millimetres (scale=0.7347, page=[297.0, 210.0]).\n# visible edges -> solid (layer OUTLINE); hidden edges -> dashed (layer HIDDEN)\n# dimensions -> real movable DIMENSION entities (text = true mm value)\n# Run: python 0013_00131967_gt.py [out.dxf]\nimport sys\nimport ezdxf\n\nSCALE = 0.7347\nPAGE = [297.0, 210.0]\n\nVISIBLE_SEGMENTS = [\n (155.6726, 91.632497, 155.6726, 87.845795),\n (82.2026, 87.845795, 84.498537, 87.845795),\n (84.498537, 87.845795, 86.794475, 87.845795),\n (86.794475, 87.845795, 89.090412, 87.845795),\n (89.090412, 87.845795, 91.38635, 87.845795),\n (91.38635, 87.845795, 93.682288, 87.845795),\n (93.682288, 87.845795, 95.978225, 87.845795),\n (95.978225, 87.845795, 98.274163, 87.845795),\n (98.274163, 87.845795, 100.5701, 87.845795),\n (100.5701, 87.845795, 102.866038, 87.845795),\n (102.866038, 87.845795, 105.161975, 87.845795),\n (105.161975, 87.845795, 107.457913, 87.845795),\n (107.457913, 87.845795, 109.75385, 87.845795),\n (109.75385, 87.845795, 112.049788, 87.845795),\n (112.049788, 87.845795, 114.345725, 87.845795),\n (114.345725, 87.845795, 116.641663, 87.845795),\n (116.641663, 87.845795, 118.9376, 87.845795),\n (118.9376, 87.845795, 121.233537, 87.845795),\n (121.233537, 87.845795, 123.529475, 87.845795),\n (123.529475, 87.845795, 125.825412, 87.845795),\n (125.825412, 87.845795, 128.12135, 87.845795),\n (128.12135, 87.845795, 130.417288, 87.845795),\n (130.417288, 87.845795, 132.713225, 87.845795),\n (132.713225, 87.845795, 135.009163, 87.845795),\n (135.009163, 87.845795, 137.3051, 87.845795),\n (137.3051, 87.845795, 139.601038, 87.845795),\n (139.601038, 87.845795, 141.896975, 87.845795),\n (141.896975, 87.845795, 144.192913, 87.845795),\n (144.192913, 87.845795, 146.48885, 87.845795),\n (146.48885, 87.845795, 148.784788, 87.845795),\n (148.784788, 87.845795, 151.080725, 87.845795),\n (151.080725, 87.845795, 153.376663, 87.845795),\n (153.376663, 87.845795, 155.6726, 87.845795),\n (155.6726, 91.632497, 155.6726, 95.4192),\n (82.2026, 95.4192, 84.498537, 95.4192),\n (84.498537, 95.4192, 86.794475, 95.4192),\n (86.794475, 95.4192, 89.090412, 95.4192),\n (89.090412, 95.4192, 91.38635, 95.4192),\n (91.38635, 95.4192, 93.682288, 95.4192),\n (93.682288, 95.4192, 95.978225, 95.4192),\n (95.978225, 95.4192, 98.274163, 95.4192),\n (98.274163, 95.4192, 100.5701, 95.4192),\n (100.5701, 95.4192, 102.866038, 95.4192),\n (102.866038, 95.4192, 105.161975, 95.4192),\n (105.161975, 95.4192, 107.457913, 95.4192),\n (107.457913, 95.4192, 109.75385, 95.4192),\n (109.75385, 95.4192, 112.049788, 95.4192),\n (112.049788, 95.4192, 114.345725, 95.4192),\n (114.345725, 95.4192, 116.641663, 95.4192),\n (116.641663, 95.4192, 118.9376, 95.4192),\n (118.9376, 95.4192, 121.233537, 95.4192),\n (121.233537, 95.4192, 123.529475, 95.4192),\n (123.529475, 95.4192, 125.825412, 95.4192),\n (125.825412, 95.4192, 128.12135, 95.4192),\n (128.12135, 95.4192, 130.417288, 95.4192),\n (130.417288, 95.4192, 132.713225, 95.4192),\n (132.713225, 95.4192, 135.009163, 95.4192),\n (135.009163, 95.4192, 137.3051, 95.4192),\n (137.3051, 95.4192, 139.601038, 95.4192),\n (139.601038, 95.4192, 141.896975, 95.4192),\n (141.896975, 95.4192, 144.192913, 95.4192),\n (144.192913, 95.4192, 146.48885, 95.4192),\n (146.48885, 95.4192, 148.784788, 95.4192),\n (148.784788, 95.4192, 151.080725, 95.4192),\n (151.080725, 95.4192, 153.376663, 95.4192),\n (153.376663, 95.4192, 155.6726, 95.4192),\n (82.2026, 87.845795, 82.2026, 91.632497),\n (82.2026, 95.4192, 82.2026, 91.632497),\n (169.6726, 182.8892, 169.6726, 180.593263),\n (169.6726, 180.593263, 169.6726, 178.297325),\n (169.6726, 178.297325, 169.6726, 176.001388),\n (169.6726, 176.001388, 169.6726, 173.70545),\n (169.6726, 173.70545, 169.6726, 171.409513),\n (169.6726, 171.409513, 169.6726, 169.113575),\n (169.6726, 169.113575, 169.6726, 166.817638),\n (169.6726, 166.817638, 169.6726, 164.5217),\n (169.6726, 164.5217, 169.6726, 162.225763),\n (169.6726, 162.225763, 169.6726, 159.929825),\n (169.6726, 159.929825, 169.6726, 157.633888),\n (169.6726, 157.633888, 169.6726, 155.33795),\n (169.6726, 155.33795, 169.6726, 153.042013),\n (169.6726, 153.042013, 169.6726, 150.746075),\n (169.6726, 150.746075, 169.6726, 148.450138),\n (169.6726, 148.450138, 169.6726, 146.1542),\n (169.6726, 146.1542, 169.6726, 143.858262),\n (169.6726, 143.858262, 169.6726, 141.562325),\n (169.6726, 141.562325, 169.6726, 139.266388),\n (169.6726, 139.266388, 169.6726, 136.97045),\n (169.6726, 136.97045, 169.6726, 134.674513),\n (169.6726, 134.674513, 169.6726, 132.378575),\n (169.6726, 132.378575, 169.6726, 130.082638),\n (169.6726, 130.082638, 169.6726, 127.7867),\n (169.6726, 127.7867, 169.6726, 125.490763),\n (169.6726, 125.490763, 169.6726, 123.194825),\n (169.6726, 123.194825, 169.6726, 120.898888),\n (169.6726, 120.898888, 169.6726, 118.60295),\n (169.6726, 118.60295, 169.6726, 116.307013),\n (169.6726, 116.307013, 169.6726, 114.011075),\n (169.6726, 114.011075, 169.6726, 111.715138),\n (169.6726, 111.715138, 169.6726, 109.4192),\n (177.246005, 182.8892, 177.246005, 180.593263),\n (177.246005, 180.593263, 177.246005, 178.297325),\n (177.246005, 178.297325, 177.246005, 176.001387),\n (177.246005, 176.001387, 177.246005, 173.70545),\n (177.246005, 173.70545, 177.246005, 171.409513),\n (177.246005, 171.409513, 177.246005, 169.113575),\n (177.246005, 169.113575, 177.246005, 166.817637),\n (177.246005, 166.817637, 177.246005, 164.5217),\n (177.246005, 164.5217, 177.246005, 162.225763),\n (177.246005, 162.225763, 177.246005, 159.929825),\n (177.246005, 159.929825, 177.246005, 157.633888),\n (177.246005, 157.633888, 177.246005, 155.33795),\n (177.246005, 155.33795, 177.246005, 153.042013),\n (177.246005, 153.042013, 177.246005, 150.746075),\n (177.246005, 150.746075, 177.246005, 148.450138),\n (177.246005, 148.450138, 177.246005, 146.1542),\n (177.246005, 146.1542, 177.246005, 143.858262),\n (177.246005, 143.858262, 177.246005, 141.562325),\n (177.246005, 141.562325, 177.246005, 139.266388),\n (177.246005, 139.266388, 177.246005, 136.97045),\n (177.246005, 136.97045, 177.246005, 134.674513),\n (177.246005, 134.674513, 177.246005, 132.378575),\n (177.246005, 132.378575, 177.246005, 130.082638),\n (177.246005, 130.082638, 177.246005, 127.7867),\n (177.246005, 127.7867, 177.246005, 125.490763),\n (177.246005, 125.490763, 177.246005, 123.194825),\n (177.246005, 123.194825, 177.246005, 120.898888),\n (177.246005, 120.898888, 177.246005, 118.60295),\n (177.246005, 118.60295, 177.246005, 116.307013),\n (177.246005, 116.307013, 177.246005, 114.011075),\n (177.246005, 114.011075, 177.246005, 111.715138),\n (177.246005, 111.715138, 177.246005, 109.4192),\n (169.6726, 182.8892, 173.459303, 182.8892),\n (169.6726, 109.4192, 173.459303, 109.4192),\n (177.246005, 109.4192, 173.459303, 109.4192),\n (177.246005, 182.8892, 173.459303, 182.8892)\n]\nVISIBLE_CIRCLES = [\n (118.9376, 146.1542, 36.735),\n (118.9376, 146.1542, 18.3675)\n]\nVISIBLE_ARCS = [\n\n]\nHIDDEN_SEGMENTS = [\n (137.3052, 91.6325, 137.3052, 95.4192),\n (137.3052, 91.6325, 137.3052, 87.8458),\n (100.5702, 95.4192, 100.5702, 91.6325),\n (100.5702, 87.8458, 100.5702, 91.6325),\n (169.6727, 127.7867, 173.4594, 127.7867),\n (169.6727, 164.5217, 173.4594, 164.5217),\n (177.2461, 164.5217, 173.4594, 164.5217),\n (177.2461, 127.7867, 173.4594, 127.7867)\n]\n# (orient, text, p1, p2, base) for linear; (orient, text, center, radius, angle) for diameter\nDIMENSIONS = [\n ('diameter', '%%c100', (118.9376, 146.1542), 36.735, 45),\n ('diameter', '%%c50', (118.9376, 146.1542), 18.3675, 135),\n ('horizontal', '10.3082', (177.2461, 146.1542), (169.6727, 146.1542), (173.4594, 135.1542))\n]\n\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\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\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,\n angle=(0 if d[0] == \"horizontal\" else 90),\n 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,\n text=text, dimstyle=\"EZDXF\").render()\n\n doc.saveas(out_path)\n\n\nif __name__ == \"__main__\":\n out = sys.argv[1] if len(sys.argv) > 1 else \"0013_00131967_gt.dxf\"\n draw(out)\n print(\"wrote\", out)\n```"}], "images": ["images/0013_00131967.png"], "id": "0013_00131967"} {"messages": [{"role": "user", "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 37.5 mm. It is extruded to a thickness of 6.18 mm."}, {"role": "assistant", "content": "```python\n#!/usr/bin/env python3\n# -*- coding: utf-8 -*-\n# Ground-truth 2D engineering drawing for part: 0014_00144316\n# Self-contained: reproduces the three-view DXF via ezdxf, NO FreeCAD needed.\n# Coordinates are A4 page millimetres (scale=0.7347, page=[297.0, 210.0]).\n# visible edges -> solid (layer OUTLINE); hidden edges -> dashed (layer HIDDEN)\n# dimensions -> real movable DIMENSION entities (text = true mm value)\n# Run: python 0014_00144316_gt.py [out.dxf]\nimport sys\nimport ezdxf\n\nSCALE = 0.7347\nPAGE = [297.0, 210.0]\n\nVISIBLE_SEGMENTS = [\n (84.8653, 93.9045, 87.161237, 93.9045),\n (87.161237, 93.9045, 89.457175, 93.9045),\n (89.457175, 93.9045, 91.753113, 93.9045),\n (91.753113, 93.9045, 94.04905, 93.9045),\n (94.04905, 93.9045, 96.344988, 93.9045),\n (96.344988, 93.9045, 98.640925, 93.9045),\n (98.640925, 93.9045, 100.936863, 93.9045),\n (100.936863, 93.9045, 103.2328, 93.9045),\n (103.2328, 93.9045, 105.528738, 93.9045),\n (105.528738, 93.9045, 107.824675, 93.9045),\n (107.824675, 93.9045, 110.120613, 93.9045),\n (110.120613, 93.9045, 112.41655, 93.9045),\n (112.41655, 93.9045, 114.712488, 93.9045),\n (114.712488, 93.9045, 117.008425, 93.9045),\n (117.008425, 93.9045, 119.304363, 93.9045),\n (119.304363, 93.9045, 121.6003, 93.9045),\n (121.6003, 93.9045, 123.896237, 93.9045),\n (123.896237, 93.9045, 126.192175, 93.9045),\n (126.192175, 93.9045, 128.488112, 93.9045),\n (128.488112, 93.9045, 130.78405, 93.9045),\n (130.78405, 93.9045, 133.079988, 93.9045),\n (133.079988, 93.9045, 135.375925, 93.9045),\n (135.375925, 93.9045, 137.671863, 93.9045),\n (137.671863, 93.9045, 139.9678, 93.9045),\n (139.9678, 93.9045, 142.263738, 93.9045),\n (142.263738, 93.9045, 144.559675, 93.9045),\n (144.559675, 93.9045, 146.855613, 93.9045),\n (146.855613, 93.9045, 149.15155, 93.9045),\n (149.15155, 93.9045, 151.447488, 93.9045),\n (151.447488, 93.9045, 153.743425, 93.9045),\n (153.743425, 93.9045, 156.039363, 93.9045),\n (156.039363, 93.9045, 158.3353, 93.9045),\n (158.3353, 93.9045, 158.3353, 89.360457),\n (84.8653, 89.360457, 87.161237, 89.360457),\n (87.161237, 89.360457, 89.457175, 89.360457),\n (89.457175, 89.360457, 91.753113, 89.360457),\n (91.753113, 89.360457, 94.04905, 89.360457),\n (94.04905, 89.360457, 96.344988, 89.360457),\n (96.344988, 89.360457, 98.640925, 89.360457),\n (98.640925, 89.360457, 100.936863, 89.360457),\n (100.936863, 89.360457, 103.2328, 89.360457),\n (103.2328, 89.360457, 105.528738, 89.360457),\n (105.528738, 89.360457, 107.824675, 89.360457),\n (107.824675, 89.360457, 110.120613, 89.360457),\n (110.120613, 89.360457, 112.41655, 89.360457),\n (112.41655, 89.360457, 114.712488, 89.360457),\n (114.712488, 89.360457, 117.008425, 89.360457),\n (117.008425, 89.360457, 119.304363, 89.360457),\n (119.304363, 89.360457, 121.6003, 89.360457),\n (121.6003, 89.360457, 123.896237, 89.360457),\n (123.896237, 89.360457, 126.192175, 89.360457),\n (126.192175, 89.360457, 128.488112, 89.360457),\n (128.488112, 89.360457, 130.78405, 89.360457),\n (130.78405, 89.360457, 133.079988, 89.360457),\n (133.079988, 89.360457, 135.375925, 89.360457),\n (135.375925, 89.360457, 137.671863, 89.360457),\n (137.671863, 89.360457, 139.9678, 89.360457),\n (139.9678, 89.360457, 142.263738, 89.360457),\n (142.263738, 89.360457, 144.559675, 89.360457),\n (144.559675, 89.360457, 146.855613, 89.360457),\n (146.855613, 89.360457, 149.15155, 89.360457),\n (149.15155, 89.360457, 151.447488, 89.360457),\n (151.447488, 89.360457, 153.743425, 89.360457),\n (153.743425, 89.360457, 156.039363, 89.360457),\n (156.039363, 89.360457, 158.3353, 89.360457),\n (84.8653, 89.360457, 84.8653, 93.9045),\n (176.879343, 181.3745, 176.879343, 179.078563),\n (176.879343, 179.078563, 176.879343, 176.782625),\n (176.879343, 176.782625, 176.879343, 174.486688),\n (176.879343, 174.486688, 176.879343, 172.19075),\n (176.879343, 172.19075, 176.879343, 169.894813),\n (176.879343, 169.894813, 176.879343, 167.598875),\n (176.879343, 167.598875, 176.879343, 165.302938),\n (176.879343, 165.302938, 176.879343, 163.007),\n (176.879343, 163.007, 176.879343, 160.711063),\n (176.879343, 160.711063, 176.879343, 158.415125),\n (176.879343, 158.415125, 176.879343, 156.119188),\n (176.879343, 156.119188, 176.879343, 153.82325),\n (176.879343, 153.82325, 176.879343, 151.527313),\n (176.879343, 151.527313, 176.879343, 149.231375),\n (176.879343, 149.231375, 176.879343, 146.935438),\n (176.879343, 146.935438, 176.879343, 144.6395),\n (176.879343, 144.6395, 176.879343, 142.343562),\n (176.879343, 142.343562, 176.879343, 140.047625),\n (176.879343, 140.047625, 176.879343, 137.751688),\n (176.879343, 137.751688, 176.879343, 135.45575),\n (176.879343, 135.45575, 176.879343, 133.159813),\n (176.879343, 133.159813, 176.879343, 130.863875),\n (176.879343, 130.863875, 176.879343, 128.567938),\n (176.879343, 128.567938, 176.879343, 126.272),\n (176.879343, 126.272, 176.879343, 123.976063),\n (176.879343, 123.976063, 176.879343, 121.680125),\n (176.879343, 121.680125, 176.879343, 119.384188),\n (176.879343, 119.384188, 176.879343, 117.08825),\n (176.879343, 117.08825, 176.879343, 114.792313),\n (176.879343, 114.792313, 176.879343, 112.496375),\n (176.879343, 112.496375, 176.879343, 110.200438),\n (176.879343, 110.200438, 176.879343, 107.9045),\n (172.3353, 181.3745, 172.3353, 179.078563),\n (172.3353, 179.078563, 172.3353, 176.782625),\n (172.3353, 176.782625, 172.3353, 174.486688),\n (172.3353, 174.486688, 172.3353, 172.19075),\n (172.3353, 172.19075, 172.3353, 169.894813),\n (172.3353, 169.894813, 172.3353, 167.598875),\n (172.3353, 167.598875, 172.3353, 165.302938),\n (172.3353, 165.302938, 172.3353, 163.007),\n (172.3353, 163.007, 172.3353, 160.711063),\n (172.3353, 160.711063, 172.3353, 158.415125),\n (172.3353, 158.415125, 172.3353, 156.119188),\n (172.3353, 156.119188, 172.3353, 153.82325),\n (172.3353, 153.82325, 172.3353, 151.527313),\n (172.3353, 151.527313, 172.3353, 149.231375),\n (172.3353, 149.231375, 172.3353, 146.935438),\n (172.3353, 146.935438, 172.3353, 144.6395),\n (172.3353, 144.6395, 172.3353, 142.343562),\n (172.3353, 142.343562, 172.3353, 140.047625),\n (172.3353, 140.047625, 172.3353, 137.751688),\n (172.3353, 137.751688, 172.3353, 135.45575),\n (172.3353, 135.45575, 172.3353, 133.159813),\n (172.3353, 133.159813, 172.3353, 130.863875),\n (172.3353, 130.863875, 172.3353, 128.567938),\n (172.3353, 128.567938, 172.3353, 126.272),\n (172.3353, 126.272, 172.3353, 123.976063),\n (172.3353, 123.976063, 172.3353, 121.680125),\n (172.3353, 121.680125, 172.3353, 119.384188),\n (172.3353, 119.384188, 172.3353, 117.08825),\n (172.3353, 117.08825, 172.3353, 114.792313),\n (172.3353, 114.792313, 172.3353, 112.496375),\n (172.3353, 112.496375, 172.3353, 110.200438),\n (172.3353, 110.200438, 172.3353, 107.9045),\n (172.3353, 181.3745, 176.879343, 181.3745),\n (172.3353, 107.9045, 176.879343, 107.9045)\n]\nVISIBLE_CIRCLES = [\n (121.6003, 144.6395, 36.735),\n (121.6003, 144.6395, 13.775625)\n]\nVISIBLE_ARCS = [\n\n]\nHIDDEN_SEGMENTS = [\n (135.3759, 89.3605, 135.3759, 93.9045),\n (107.8247, 93.9045, 107.8247, 89.3605),\n (172.3353, 130.8639, 176.8794, 130.8639),\n (172.3353, 158.4151, 176.8794, 158.4151)\n]\n# (orient, text, p1, p2, base) for linear; (orient, text, center, radius, angle) for diameter\nDIMENSIONS = [\n ('diameter', '%%c100', (121.6003, 144.6395), 36.735, 45),\n ('diameter', '%%c37.5', (121.6003, 144.6395), 13.7756, 135),\n ('horizontal', '6.1849', (176.8794, 144.6395), (172.3353, 144.6395), (174.6073, 133.6395))\n]\n\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\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\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,\n angle=(0 if d[0] == \"horizontal\" else 90),\n 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,\n text=text, dimstyle=\"EZDXF\").render()\n\n doc.saveas(out_path)\n\n\nif __name__ == \"__main__\":\n out = sys.argv[1] if len(sys.argv) > 1 else \"0014_00144316_gt.dxf\"\n draw(out)\n print(\"wrote\", out)\n```"}], "images": ["images/0014_00144316.png"], "id": "0014_00144316"} {"messages": [{"role": "user", "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 27.08 mm. It is extruded to a thickness of 20.1 mm."}, {"role": "assistant", "content": "```python\n#!/usr/bin/env python3\n# -*- coding: utf-8 -*-\n# Ground-truth 2D engineering drawing for part: 0014_00147578\n# Self-contained: reproduces the three-view DXF via ezdxf, NO FreeCAD needed.\n# Coordinates are A4 page millimetres (scale=0.800160455346255, page=[297.0, 210.0]).\n# visible edges -> solid (layer OUTLINE); hidden edges -> dashed (layer HIDDEN)\n# dimensions -> real movable DIMENSION entities (text = true mm value)\n# Run: python 0014_00147578_gt.py [out.dxf]\nimport sys\nimport ezdxf\n\nSCALE = 0.800160455346255\nPAGE = [297.0, 210.0]\n\nVISIBLE_SEGMENTS = [\n (155.755123, 81.954023, 153.254621, 81.954023),\n (153.254621, 81.954023, 150.75412, 81.954023),\n (150.75412, 81.954023, 148.253618, 81.954023),\n (148.253618, 81.954023, 145.753117, 81.954023),\n (145.753117, 81.954023, 143.252616, 81.954023),\n (143.252616, 81.954023, 140.752114, 81.954023),\n (140.752114, 81.954023, 138.251613, 81.954023),\n (138.251613, 81.954023, 135.751111, 81.954023),\n (135.751111, 81.954023, 133.25061, 81.954023),\n (133.25061, 81.954023, 130.750109, 81.954023),\n (130.750109, 81.954023, 128.249607, 81.954023),\n (128.249607, 81.954023, 125.749106, 81.954023),\n (125.749106, 81.954023, 123.248604, 81.954023),\n (123.248604, 81.954023, 120.748103, 81.954023),\n (120.748103, 81.954023, 118.247601, 81.954023),\n (118.247601, 81.954023, 115.7471, 81.954023),\n (115.7471, 81.954023, 113.246599, 81.954023),\n (113.246599, 81.954023, 110.746097, 81.954023),\n (110.746097, 81.954023, 108.245596, 81.954023),\n (108.245596, 81.954023, 105.745094, 81.954023),\n (105.745094, 81.954023, 103.244593, 81.954023),\n (103.244593, 81.954023, 100.744091, 81.954023),\n (100.744091, 81.954023, 98.24359, 81.954023),\n (98.24359, 81.954023, 95.743089, 81.954023),\n (95.743089, 81.954023, 93.242587, 81.954023),\n (93.242587, 81.954023, 90.742086, 81.954023),\n (90.742086, 81.954023, 88.241584, 81.954023),\n (88.241584, 81.954023, 85.741083, 81.954023),\n (85.741083, 81.954023, 83.240582, 81.954023),\n (83.240582, 81.954023, 80.74008, 81.954023),\n (80.74008, 81.954023, 78.239579, 81.954023),\n (78.239579, 81.954023, 75.739077, 81.954023),\n (155.755123, 81.954023, 155.755123, 98.037977),\n (155.755123, 98.037977, 153.254621, 98.037977),\n (153.254621, 98.037977, 150.75412, 98.037977),\n (150.75412, 98.037977, 148.253618, 98.037977),\n (148.253618, 98.037977, 145.753117, 98.037977),\n (145.753117, 98.037977, 143.252616, 98.037977),\n (143.252616, 98.037977, 140.752114, 98.037977),\n (140.752114, 98.037977, 138.251613, 98.037977),\n (138.251613, 98.037977, 135.751111, 98.037977),\n (135.751111, 98.037977, 133.25061, 98.037977),\n (133.25061, 98.037977, 130.750109, 98.037977),\n (130.750109, 98.037977, 128.249607, 98.037977),\n (128.249607, 98.037977, 125.749106, 98.037977),\n (125.749106, 98.037977, 123.248604, 98.037977),\n (123.248604, 98.037977, 120.748103, 98.037977),\n (120.748103, 98.037977, 118.247601, 98.037977),\n (118.247601, 98.037977, 115.7471, 98.037977),\n (115.7471, 98.037977, 113.246599, 98.037977),\n (113.246599, 98.037977, 110.746097, 98.037977),\n (110.746097, 98.037977, 108.245596, 98.037977),\n (108.245596, 98.037977, 105.745094, 98.037977),\n (105.745094, 98.037977, 103.244593, 98.037977),\n (103.244593, 98.037977, 100.744091, 98.037977),\n (100.744091, 98.037977, 98.24359, 98.037977),\n (98.24359, 98.037977, 95.743089, 98.037977),\n (95.743089, 98.037977, 93.242587, 98.037977),\n (93.242587, 98.037977, 90.742086, 98.037977),\n (90.742086, 98.037977, 88.241584, 98.037977),\n (88.241584, 98.037977, 85.741083, 98.037977),\n (85.741083, 98.037977, 83.240582, 98.037977),\n (83.240582, 98.037977, 80.74008, 98.037977),\n (80.74008, 98.037977, 78.239579, 98.037977),\n (78.239579, 98.037977, 75.739077, 98.037977),\n (75.739077, 98.037977, 75.739077, 81.954023),\n (169.755123, 112.037977, 169.755123, 114.538479),\n (169.755123, 114.538479, 169.755123, 117.03898),\n (169.755123, 117.03898, 169.755123, 119.539482),\n (169.755123, 119.539482, 169.755123, 122.039983),\n (169.755123, 122.039983, 169.755123, 124.540484),\n (169.755123, 124.540484, 169.755123, 127.040986),\n (169.755123, 127.040986, 169.755123, 129.541487),\n (169.755123, 129.541487, 169.755123, 132.041989),\n (169.755123, 132.041989, 169.755123, 134.54249),\n (169.755123, 134.54249, 169.755123, 137.042991),\n (169.755123, 137.042991, 169.755123, 139.543493),\n (169.755123, 139.543493, 169.755123, 142.043994),\n (169.755123, 142.043994, 169.755123, 144.544496),\n (169.755123, 144.544496, 169.755123, 147.044997),\n (169.755123, 147.044997, 169.755123, 149.545499),\n (169.755123, 149.545499, 169.755123, 152.046),\n (169.755123, 152.046, 169.755123, 154.546501),\n (169.755123, 154.546501, 169.755123, 157.047003),\n (169.755123, 157.047003, 169.755123, 159.547504),\n (169.755123, 159.547504, 169.755123, 162.048006),\n (169.755123, 162.048006, 169.755123, 164.548507),\n (169.755123, 164.548507, 169.755123, 167.049009),\n (169.755123, 167.049009, 169.755123, 169.54951),\n (169.755123, 169.54951, 169.755123, 172.050011),\n (169.755123, 172.050011, 169.755123, 174.550513),\n (169.755123, 174.550513, 169.755123, 177.051014),\n (169.755123, 177.051014, 169.755123, 179.551516),\n (169.755123, 179.551516, 169.755123, 182.052017),\n (169.755123, 182.052017, 169.755123, 184.552518),\n (169.755123, 184.552518, 169.755123, 187.05302),\n (169.755123, 187.05302, 169.755123, 189.553521),\n (169.755123, 189.553521, 169.755123, 192.054023),\n (185.839077, 112.037977, 185.839077, 114.538479),\n (185.839077, 114.538479, 185.839077, 117.03898),\n (185.839077, 117.03898, 185.839077, 119.539482),\n (185.839077, 119.539482, 185.839077, 122.039983),\n (185.839077, 122.039983, 185.839077, 124.540484),\n (185.839077, 124.540484, 185.839077, 127.040986),\n (185.839077, 127.040986, 185.839077, 129.541487),\n (185.839077, 129.541487, 185.839077, 132.041989),\n (185.839077, 132.041989, 185.839077, 134.54249),\n (185.839077, 134.54249, 185.839077, 137.042991),\n (185.839077, 137.042991, 185.839077, 139.543493),\n (185.839077, 139.543493, 185.839077, 142.043994),\n (185.839077, 142.043994, 185.839077, 144.544496),\n (185.839077, 144.544496, 185.839077, 147.044997),\n (185.839077, 147.044997, 185.839077, 149.545499),\n (185.839077, 149.545499, 185.839077, 152.046),\n (185.839077, 152.046, 185.839077, 154.546501),\n (185.839077, 154.546501, 185.839077, 157.047003),\n (185.839077, 157.047003, 185.839077, 159.547504),\n (185.839077, 159.547504, 185.839077, 162.048006),\n (185.839077, 162.048006, 185.839077, 164.548507),\n (185.839077, 164.548507, 185.839077, 167.049009),\n (185.839077, 167.049009, 185.839077, 169.54951),\n (185.839077, 169.54951, 185.839077, 172.050011),\n (185.839077, 172.050011, 185.839077, 174.550513),\n (185.839077, 174.550513, 185.839077, 177.051014),\n (185.839077, 177.051014, 185.839077, 179.551516),\n (185.839077, 179.551516, 185.839077, 182.052017),\n (185.839077, 182.052017, 185.839077, 184.552518),\n (185.839077, 184.552518, 185.839077, 187.05302),\n (185.839077, 187.05302, 185.839077, 189.553521),\n (185.839077, 189.553521, 185.839077, 192.054023),\n (185.839077, 112.037977, 169.755123, 112.037977),\n (185.839077, 192.054023, 169.755123, 192.054023)\n]\nVISIBLE_CIRCLES = [\n (115.7471, 152.046, 40.008023),\n (115.7471, 152.046, 10.835506)\n]\nVISIBLE_ARCS = [\n\n]\nHIDDEN_SEGMENTS = [\n (126.5826, 98.038, 126.5826, 81.954),\n (104.9116, 81.954, 104.9116, 98.038),\n (185.8391, 162.8815, 169.7552, 162.8815),\n (185.8391, 141.2105, 169.7552, 141.2105)\n]\n# (orient, text, p1, p2, base) for linear; (orient, text, center, radius, angle) for diameter\nDIMENSIONS = [\n ('diameter', '%%c100', (115.7471, 152.046), 40.008, 45),\n ('diameter', '%%c27.0833', (115.7471, 152.046), 10.8355, 135),\n ('horizontal', '20.1009', (169.7552, 152.046), (185.8391, 152.046), (177.7971, 163.046))\n]\n\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\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\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,\n angle=(0 if d[0] == \"horizontal\" else 90),\n 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,\n text=text, dimstyle=\"EZDXF\").render()\n\n doc.saveas(out_path)\n\n\nif __name__ == \"__main__\":\n out = sys.argv[1] if len(sys.argv) > 1 else \"0014_00147578_gt.dxf\"\n draw(out)\n print(\"wrote\", out)\n```"}], "images": ["images/0014_00147578.png"], "id": "0014_00147578"} {"messages": [{"role": "user", "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": "assistant", "content": "```python\n#!/usr/bin/env python3\n# -*- coding: utf-8 -*-\n# Ground-truth 2D engineering drawing for part: 0015_00151395\n# Self-contained: reproduces the three-view DXF via ezdxf, NO FreeCAD needed.\n# Coordinates are A4 page millimetres (scale=0.6879695498504659, page=[297.0, 210.0]).\n# visible edges -> solid (layer OUTLINE); hidden edges -> dashed (layer HIDDEN)\n# dimensions -> real movable DIMENSION entities (text = true mm value)\n# Run: python 0015_00151395_gt.py [out.dxf]\nimport sys\nimport ezdxf\n\nSCALE = 0.6879695498504659\nPAGE = [297.0, 210.0]\n\nVISIBLE_SEGMENTS = [\n (145.601577, 79.149277, 143.451673, 79.149277),\n (143.451673, 79.149277, 141.301768, 79.149277),\n (141.301768, 79.149277, 139.151863, 79.149277),\n (139.151863, 79.149277, 137.001958, 79.149277),\n (137.001958, 79.149277, 134.852053, 79.149277),\n (134.852053, 79.149277, 132.702148, 79.149277),\n (132.702148, 79.149277, 130.552244, 79.149277),\n (130.552244, 79.149277, 128.402339, 79.149277),\n (128.402339, 79.149277, 126.252434, 79.149277),\n (126.252434, 79.149277, 124.102529, 79.149277),\n (124.102529, 79.149277, 121.952624, 79.149277),\n (121.952624, 79.149277, 119.802719, 79.149277),\n (119.802719, 79.149277, 117.652815, 79.149277),\n (117.652815, 79.149277, 115.50291, 79.149277),\n (115.50291, 79.149277, 113.353005, 79.149277),\n (113.353005, 79.149277, 111.2031, 79.149277),\n (111.2031, 79.149277, 109.053195, 79.149277),\n (109.053195, 79.149277, 106.90329, 79.149277),\n (106.90329, 79.149277, 104.753385, 79.149277),\n (104.753385, 79.149277, 102.603481, 79.149277),\n (102.603481, 79.149277, 100.453576, 79.149277),\n (100.453576, 79.149277, 98.303671, 79.149277),\n (98.303671, 79.149277, 96.153766, 79.149277),\n (96.153766, 79.149277, 94.003861, 79.149277),\n (94.003861, 79.149277, 91.853956, 79.149277),\n (91.853956, 79.149277, 89.704052, 79.149277),\n (89.704052, 79.149277, 87.554147, 79.149277),\n (87.554147, 79.149277, 85.404242, 79.149277),\n (85.404242, 79.149277, 83.254337, 79.149277),\n (83.254337, 79.149277, 81.104432, 79.149277),\n (81.104432, 79.149277, 78.954527, 79.149277),\n (78.954527, 79.149277, 76.804623, 79.149277),\n (145.601577, 79.149277, 145.601577, 106.452322),\n (145.601577, 106.452322, 143.451673, 106.452322),\n (143.451673, 106.452322, 141.301768, 106.452322),\n (141.301768, 106.452322, 139.151863, 106.452322),\n (139.151863, 106.452322, 137.001958, 106.452322),\n (137.001958, 106.452322, 134.852053, 106.452322),\n (134.852053, 106.452322, 132.702148, 106.452322),\n (132.702148, 106.452322, 130.552244, 106.452322),\n (130.552244, 106.452322, 128.402339, 106.452322),\n (128.402339, 106.452322, 126.252434, 106.452322),\n (126.252434, 106.452322, 124.102529, 106.452322),\n (124.102529, 106.452322, 121.952624, 106.452322),\n (121.952624, 106.452322, 119.802719, 106.452322),\n (119.802719, 106.452322, 117.652815, 106.452322),\n (117.652815, 106.452322, 115.50291, 106.452322),\n (115.50291, 106.452322, 113.353005, 106.452322),\n (113.353005, 106.452322, 111.2031, 106.452322),\n (111.2031, 106.452322, 109.053195, 106.452322),\n (109.053195, 106.452322, 106.90329, 106.452322),\n (106.90329, 106.452322, 104.753385, 106.452322),\n (104.753385, 106.452322, 102.603481, 106.452322),\n (102.603481, 106.452322, 100.453576, 106.452322),\n (100.453576, 106.452322, 98.303671, 106.452322),\n (98.303671, 106.452322, 96.153766, 106.452322),\n (96.153766, 106.452322, 94.003861, 106.452322),\n (94.003861, 106.452322, 91.853956, 106.452322),\n (91.853956, 106.452322, 89.704052, 106.452322),\n (89.704052, 106.452322, 87.554147, 106.452322),\n (87.554147, 106.452322, 85.404242, 106.452322),\n (85.404242, 106.452322, 83.254337, 106.452322),\n (83.254337, 106.452322, 81.104432, 106.452322),\n (81.104432, 106.452322, 78.954527, 106.452322),\n (78.954527, 106.452322, 76.804623, 106.452322),\n (76.804623, 106.452322, 76.804623, 79.149277),\n (159.601578, 120.452323, 159.601578, 122.602227),\n (159.601578, 122.602227, 159.601578, 124.752132),\n (159.601578, 124.752132, 159.601578, 126.902037),\n (159.601578, 126.902037, 159.601578, 129.051942),\n (159.601578, 129.051942, 159.601578, 131.201847),\n (159.601578, 131.201847, 159.601578, 133.351752),\n (159.601578, 133.351752, 159.601578, 135.501656),\n (159.601578, 135.501656, 159.601578, 137.651561),\n (159.601578, 137.651561, 159.601578, 139.801466),\n (159.601578, 139.801466, 159.601578, 141.951371),\n (159.601578, 141.951371, 159.601578, 144.101276),\n (159.601578, 144.101276, 159.601578, 146.251181),\n (159.601578, 146.251181, 159.601578, 148.401085),\n (159.601578, 148.401085, 159.601578, 150.55099),\n (159.601578, 150.55099, 159.601578, 152.700895),\n (159.601578, 152.700895, 159.601578, 154.8508),\n (159.601578, 154.8508, 159.601578, 157.000705),\n (159.601578, 157.000705, 159.601578, 159.15061),\n (159.601578, 159.15061, 159.601578, 161.300515),\n (159.601578, 161.300515, 159.601578, 163.450419),\n (159.601578, 163.450419, 159.601578, 165.600324),\n (159.601578, 165.600324, 159.601578, 167.750229),\n (159.601578, 167.750229, 159.601578, 169.900134),\n (159.601578, 169.900134, 159.601578, 172.050039),\n (159.601578, 172.050039, 159.601578, 174.199944),\n (159.601578, 174.199944, 159.601578, 176.349848),\n (159.601578, 176.349848, 159.601578, 178.499753),\n (159.601578, 178.499753, 159.601578, 180.649658),\n (159.601578, 180.649658, 159.601578, 182.799563),\n (159.601578, 182.799563, 159.601578, 184.949468),\n (159.601578, 184.949468, 159.601578, 187.099373),\n (159.601578, 187.099373, 159.601578, 189.249277),\n (186.904623, 120.452323, 186.904623, 122.602227),\n (186.904623, 122.602227, 186.904623, 124.752132),\n (186.904623, 124.752132, 186.904623, 126.902037),\n (186.904623, 126.902037, 186.904623, 129.051942),\n (186.904623, 129.051942, 186.904623, 131.201847),\n (186.904623, 131.201847, 186.904623, 133.351752),\n (186.904623, 133.351752, 186.904623, 135.501656),\n (186.904623, 135.501656, 186.904623, 137.651561),\n (186.904623, 137.651561, 186.904623, 139.801466),\n (186.904623, 139.801466, 186.904623, 141.951371),\n (186.904623, 141.951371, 186.904623, 144.101276),\n (186.904623, 144.101276, 186.904623, 146.251181),\n (186.904623, 146.251181, 186.904623, 148.401085),\n (186.904623, 148.401085, 186.904623, 150.55099),\n (186.904623, 150.55099, 186.904623, 152.700895),\n (186.904623, 152.700895, 186.904623, 154.8508),\n (186.904623, 154.8508, 186.904623, 157.000705),\n (186.904623, 157.000705, 186.904623, 159.15061),\n (186.904623, 159.15061, 186.904623, 161.300515),\n (186.904623, 161.300515, 186.904623, 163.450419),\n (186.904623, 163.450419, 186.904623, 165.600324),\n (186.904623, 165.600324, 186.904623, 167.750229),\n (186.904623, 167.750229, 186.904623, 169.900134),\n (186.904623, 169.900134, 186.904623, 172.050039),\n (186.904623, 172.050039, 186.904623, 174.199944),\n (186.904623, 174.199944, 186.904623, 176.349848),\n (186.904623, 176.349848, 186.904623, 178.499753),\n (186.904623, 178.499753, 186.904623, 180.649658),\n (186.904623, 180.649658, 186.904623, 182.799563),\n (186.904623, 182.799563, 186.904623, 184.949468),\n (186.904623, 184.949468, 186.904623, 187.099373),\n (186.904623, 187.099373, 186.904623, 189.249277),\n (186.904623, 120.452323, 159.601578, 120.452323),\n (186.904623, 189.249277, 159.601578, 189.249277)\n]\nVISIBLE_CIRCLES = [\n (111.2031, 154.8508, 34.398477),\n (111.2031, 154.8508, 12.182794)\n]\nVISIBLE_ARCS = [\n\n]\nHIDDEN_SEGMENTS = [\n (123.386, 106.4523, 123.386, 79.1492),\n (99.0204, 79.1492, 99.0204, 106.4523),\n (186.9047, 167.0336, 159.6016, 167.0336),\n (186.9047, 142.668, 159.6016, 142.668)\n]\n# (orient, text, p1, p2, base) for linear; (orient, text, center, radius, angle) for diameter\nDIMENSIONS = [\n ('diameter', '%%c100', (111.2031, 154.8508), 34.3985, 45),\n ('diameter', '%%c35.4167', (111.2031, 154.8508), 12.1828, 135),\n ('horizontal', '39.6864', (159.6016, 154.8508), (186.9047, 154.8508), (173.2532, 165.8508))\n]\n\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\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\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,\n angle=(0 if d[0] == \"horizontal\" else 90),\n 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,\n text=text, dimstyle=\"EZDXF\").render()\n\n doc.saveas(out_path)\n\n\nif __name__ == \"__main__\":\n out = sys.argv[1] if len(sys.argv) > 1 else \"0015_00151395_gt.dxf\"\n draw(out)\n print(\"wrote\", out)\n```"}], "images": ["images/0015_00151395.png"], "id": "0015_00151395"} {"messages": [{"role": "user", "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 593.75 mm."}, {"role": "assistant", "content": "```python\n#!/usr/bin/env python3\n# -*- coding: utf-8 -*-\n# Ground-truth 2D engineering drawing for part: 0015_00151511\n# Self-contained: reproduces the three-view DXF via ezdxf, NO FreeCAD needed.\n# Coordinates are A4 page millimetres (scale=0.1385225225225225, page=[297.0, 210.0]).\n# visible edges -> solid (layer OUTLINE); hidden edges -> dashed (layer HIDDEN)\n# dimensions -> real movable DIMENSION entities (text = true mm value)\n# Run: python 0015_00151511_gt.py [out.dxf]\nimport sys\nimport ezdxf\n\nSCALE = 0.1385225225225225\nPAGE = [297.0, 210.0]\n\nVISIBLE_SEGMENTS = [\n (99.344226, 65.413026, 98.911343, 65.413026),\n (98.911343, 65.413026, 98.47846, 65.413026),\n (98.47846, 65.413026, 98.045577, 65.413026),\n (98.045577, 65.413026, 97.612695, 65.413026),\n (97.612695, 65.413026, 97.179812, 65.413026),\n (97.179812, 65.413026, 96.746929, 65.413026),\n (96.746929, 65.413026, 96.314046, 65.413026),\n (96.314046, 65.413026, 95.881163, 65.413026),\n (95.881163, 65.413026, 95.44828, 65.413026),\n (95.44828, 65.413026, 95.015397, 65.413026),\n (95.015397, 65.413026, 94.582514, 65.413026),\n (94.582514, 65.413026, 94.149632, 65.413026),\n (94.149632, 65.413026, 93.716749, 65.413026),\n (93.716749, 65.413026, 93.283866, 65.413026),\n (93.283866, 65.413026, 92.850983, 65.413026),\n (92.850983, 65.413026, 92.4181, 65.413026),\n (92.4181, 65.413026, 91.985217, 65.413026),\n (91.985217, 65.413026, 91.552334, 65.413026),\n (91.552334, 65.413026, 91.119451, 65.413026),\n (91.119451, 65.413026, 90.686568, 65.413026),\n (90.686568, 65.413026, 90.253686, 65.413026),\n (90.253686, 65.413026, 89.820803, 65.413026),\n (89.820803, 65.413026, 89.38792, 65.413026),\n (89.38792, 65.413026, 88.955037, 65.413026),\n (88.955037, 65.413026, 88.522154, 65.413026),\n (88.522154, 65.413026, 88.089271, 65.413026),\n (88.089271, 65.413026, 87.656388, 65.413026),\n (87.656388, 65.413026, 87.223505, 65.413026),\n (87.223505, 65.413026, 86.790623, 65.413026),\n (86.790623, 65.413026, 86.35774, 65.413026),\n (86.35774, 65.413026, 85.924857, 65.413026),\n (85.924857, 65.413026, 85.491974, 65.413026),\n (99.344226, 65.413026, 99.344226, 147.660774),\n (99.344226, 147.660774, 98.911343, 147.660774),\n (98.911343, 147.660774, 98.47846, 147.660774),\n (98.47846, 147.660774, 98.045577, 147.660774),\n (98.045577, 147.660774, 97.612695, 147.660774),\n (97.612695, 147.660774, 97.179812, 147.660774),\n (97.179812, 147.660774, 96.746929, 147.660774),\n (96.746929, 147.660774, 96.314046, 147.660774),\n (96.314046, 147.660774, 95.881163, 147.660774),\n (95.881163, 147.660774, 95.44828, 147.660774),\n (95.44828, 147.660774, 95.015397, 147.660774),\n (95.015397, 147.660774, 94.582514, 147.660774),\n (94.582514, 147.660774, 94.149632, 147.660774),\n (94.149632, 147.660774, 93.716749, 147.660774),\n (93.716749, 147.660774, 93.283866, 147.660774),\n (93.283866, 147.660774, 92.850983, 147.660774),\n (92.850983, 147.660774, 92.4181, 147.660774),\n (92.4181, 147.660774, 91.985217, 147.660774),\n (91.985217, 147.660774, 91.552334, 147.660774),\n (91.552334, 147.660774, 91.119451, 147.660774),\n (91.119451, 147.660774, 90.686568, 147.660774),\n (90.686568, 147.660774, 90.253686, 147.660774),\n (90.253686, 147.660774, 89.820803, 147.660774),\n (89.820803, 147.660774, 89.38792, 147.660774),\n (89.38792, 147.660774, 88.955037, 147.660774),\n (88.955037, 147.660774, 88.522154, 147.660774),\n (88.522154, 147.660774, 88.089271, 147.660774),\n (88.089271, 147.660774, 87.656388, 147.660774),\n (87.656388, 147.660774, 87.223505, 147.660774),\n (87.223505, 147.660774, 86.790623, 147.660774),\n (86.790623, 147.660774, 86.35774, 147.660774),\n (86.35774, 147.660774, 85.924857, 147.660774),\n (85.924857, 147.660774, 85.491974, 147.660774),\n (85.491974, 147.660774, 85.491974, 65.413026),\n (113.344226, 161.660774, 113.344226, 162.093657),\n (113.344226, 162.093657, 113.344226, 162.52654),\n (113.344226, 162.52654, 113.344226, 162.959423),\n (113.344226, 162.959423, 113.344226, 163.392305),\n (113.344226, 163.392305, 113.344226, 163.825188),\n (113.344226, 163.825188, 113.344226, 164.258071),\n (113.344226, 164.258071, 113.344226, 164.690954),\n (113.344226, 164.690954, 113.344226, 165.123837),\n (113.344226, 165.123837, 113.344226, 165.55672),\n (113.344226, 165.55672, 113.344226, 165.989603),\n (113.344226, 165.989603, 113.344226, 166.422486),\n (113.344226, 166.422486, 113.344226, 166.855368),\n (113.344226, 166.855368, 113.344226, 167.288251),\n (113.344226, 167.288251, 113.344226, 167.721134),\n (113.344226, 167.721134, 113.344226, 168.154017),\n (113.344226, 168.154017, 113.344226, 168.5869),\n (113.344226, 168.5869, 113.344226, 169.019783),\n (113.344226, 169.019783, 113.344226, 169.452666),\n (113.344226, 169.452666, 113.344226, 169.885549),\n (113.344226, 169.885549, 113.344226, 170.318432),\n (113.344226, 170.318432, 113.344226, 170.751314),\n (113.344226, 170.751314, 113.344226, 171.184197),\n (113.344226, 171.184197, 113.344226, 171.61708),\n (113.344226, 171.61708, 113.344226, 172.049963),\n (113.344226, 172.049963, 113.344226, 172.482846),\n (113.344226, 172.482846, 113.344226, 172.915729),\n (113.344226, 172.915729, 113.344226, 173.348612),\n (113.344226, 173.348612, 113.344226, 173.781495),\n (113.344226, 173.781495, 113.344226, 174.214377),\n (113.344226, 174.214377, 113.344226, 174.64726),\n (113.344226, 174.64726, 113.344226, 175.080143),\n (113.344226, 175.080143, 113.344226, 175.513026),\n (195.591974, 161.660774, 195.591974, 162.093657),\n (195.591974, 162.093657, 195.591974, 162.52654),\n (195.591974, 162.52654, 195.591974, 162.959423),\n (195.591974, 162.959423, 195.591974, 163.392305),\n (195.591974, 163.392305, 195.591974, 163.825188),\n (195.591974, 163.825188, 195.591974, 164.258071),\n (195.591974, 164.258071, 195.591974, 164.690954),\n (195.591974, 164.690954, 195.591974, 165.123837),\n (195.591974, 165.123837, 195.591974, 165.55672),\n (195.591974, 165.55672, 195.591974, 165.989603),\n (195.591974, 165.989603, 195.591974, 166.422486),\n (195.591974, 166.422486, 195.591974, 166.855368),\n (195.591974, 166.855368, 195.591974, 167.288251),\n (195.591974, 167.288251, 195.591974, 167.721134),\n (195.591974, 167.721134, 195.591974, 168.154017),\n (195.591974, 168.154017, 195.591974, 168.5869),\n (195.591974, 168.5869, 195.591974, 169.019783),\n (195.591974, 169.019783, 195.591974, 169.452666),\n (195.591974, 169.452666, 195.591974, 169.885549),\n (195.591974, 169.885549, 195.591974, 170.318432),\n (195.591974, 170.318432, 195.591974, 170.751314),\n (195.591974, 170.751314, 195.591974, 171.184197),\n (195.591974, 171.184197, 195.591974, 171.61708),\n (195.591974, 171.61708, 195.591974, 172.049963),\n (195.591974, 172.049963, 195.591974, 172.482846),\n (195.591974, 172.482846, 195.591974, 172.915729),\n (195.591974, 172.915729, 195.591974, 173.348612),\n (195.591974, 173.348612, 195.591974, 173.781495),\n (195.591974, 173.781495, 195.591974, 174.214377),\n (195.591974, 174.214377, 195.591974, 174.64726),\n (195.591974, 174.64726, 195.591974, 175.080143),\n (195.591974, 175.080143, 195.591974, 175.513026),\n (195.591974, 161.660774, 113.344226, 161.660774),\n (195.591974, 175.513026, 113.344226, 175.513026)\n]\nVISIBLE_CIRCLES = [\n (92.4181, 168.5869, 6.926126),\n (92.4181, 168.5869, 4.906006)\n]\nVISIBLE_ARCS = [\n\n]\nHIDDEN_SEGMENTS = [\n (97.3241, 147.6608, 97.3241, 65.4131),\n (87.5121, 65.4131, 87.5121, 147.6608),\n (195.592, 173.4929, 113.3442, 173.4929),\n (195.592, 163.6809, 113.3442, 163.6809)\n]\n# (orient, text, p1, p2, base) for linear; (orient, text, center, radius, angle) for diameter\nDIMENSIONS = [\n ('diameter', '%%c100', (92.4181, 168.5869), 6.9261, 45),\n ('diameter', '%%c70.8333', (92.4181, 168.5869), 4.906, 135),\n ('horizontal', '593.75', (113.3442, 168.5869), (195.592, 168.5869), (154.4681, 179.5869))\n]\n\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\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\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,\n angle=(0 if d[0] == \"horizontal\" else 90),\n 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,\n text=text, dimstyle=\"EZDXF\").render()\n\n doc.saveas(out_path)\n\n\nif __name__ == \"__main__\":\n out = sys.argv[1] if len(sys.argv) > 1 else \"0015_00151511_gt.dxf\"\n draw(out)\n print(\"wrote\", out)\n```"}], "images": ["images/0015_00151511.png"], "id": "0015_00151511"} {"messages": [{"role": "user", "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": "assistant", "content": "```python\n#!/usr/bin/env python3\n# -*- coding: utf-8 -*-\n# Ground-truth 2D engineering drawing for part: 0015_00156608\n# Self-contained: reproduces the three-view DXF via ezdxf, NO FreeCAD needed.\n# Coordinates are A4 page millimetres (scale=0.6879695498504659, page=[297.0, 210.0]).\n# visible edges -> solid (layer OUTLINE); hidden edges -> dashed (layer HIDDEN)\n# dimensions -> real movable DIMENSION entities (text = true mm value)\n# Run: python 0015_00156608_gt.py [out.dxf]\nimport sys\nimport ezdxf\n\nSCALE = 0.6879695498504659\nPAGE = [297.0, 210.0]\n\nVISIBLE_SEGMENTS = [\n (145.601577, 79.149277, 143.451673, 79.149277),\n (143.451673, 79.149277, 141.301768, 79.149277),\n (141.301768, 79.149277, 139.151863, 79.149277),\n (139.151863, 79.149277, 137.001958, 79.149277),\n (137.001958, 79.149277, 134.852053, 79.149277),\n (134.852053, 79.149277, 132.702148, 79.149277),\n (132.702148, 79.149277, 130.552244, 79.149277),\n (130.552244, 79.149277, 128.402339, 79.149277),\n (128.402339, 79.149277, 126.252434, 79.149277),\n (126.252434, 79.149277, 124.102529, 79.149277),\n (124.102529, 79.149277, 121.952624, 79.149277),\n (121.952624, 79.149277, 119.802719, 79.149277),\n (119.802719, 79.149277, 117.652815, 79.149277),\n (117.652815, 79.149277, 115.50291, 79.149277),\n (115.50291, 79.149277, 113.353005, 79.149277),\n (113.353005, 79.149277, 111.2031, 79.149277),\n (111.2031, 79.149277, 109.053195, 79.149277),\n (109.053195, 79.149277, 106.90329, 79.149277),\n (106.90329, 79.149277, 104.753385, 79.149277),\n (104.753385, 79.149277, 102.603481, 79.149277),\n (102.603481, 79.149277, 100.453576, 79.149277),\n (100.453576, 79.149277, 98.303671, 79.149277),\n (98.303671, 79.149277, 96.153766, 79.149277),\n (96.153766, 79.149277, 94.003861, 79.149277),\n (94.003861, 79.149277, 91.853956, 79.149277),\n (91.853956, 79.149277, 89.704052, 79.149277),\n (89.704052, 79.149277, 87.554147, 79.149277),\n (87.554147, 79.149277, 85.404242, 79.149277),\n (85.404242, 79.149277, 83.254337, 79.149277),\n (83.254337, 79.149277, 81.104432, 79.149277),\n (81.104432, 79.149277, 78.954527, 79.149277),\n (78.954527, 79.149277, 76.804623, 79.149277),\n (145.601577, 79.149277, 145.601577, 106.452322),\n (145.601577, 106.452322, 143.451673, 106.452322),\n (143.451673, 106.452322, 141.301768, 106.452322),\n (141.301768, 106.452322, 139.151863, 106.452322),\n (139.151863, 106.452322, 137.001958, 106.452322),\n (137.001958, 106.452322, 134.852053, 106.452322),\n (134.852053, 106.452322, 132.702148, 106.452322),\n (132.702148, 106.452322, 130.552244, 106.452322),\n (130.552244, 106.452322, 128.402339, 106.452322),\n (128.402339, 106.452322, 126.252434, 106.452322),\n (126.252434, 106.452322, 124.102529, 106.452322),\n (124.102529, 106.452322, 121.952624, 106.452322),\n (121.952624, 106.452322, 119.802719, 106.452322),\n (119.802719, 106.452322, 117.652815, 106.452322),\n (117.652815, 106.452322, 115.50291, 106.452322),\n (115.50291, 106.452322, 113.353005, 106.452322),\n (113.353005, 106.452322, 111.2031, 106.452322),\n (111.2031, 106.452322, 109.053195, 106.452322),\n (109.053195, 106.452322, 106.90329, 106.452322),\n (106.90329, 106.452322, 104.753385, 106.452322),\n (104.753385, 106.452322, 102.603481, 106.452322),\n (102.603481, 106.452322, 100.453576, 106.452322),\n (100.453576, 106.452322, 98.303671, 106.452322),\n (98.303671, 106.452322, 96.153766, 106.452322),\n (96.153766, 106.452322, 94.003861, 106.452322),\n (94.003861, 106.452322, 91.853956, 106.452322),\n (91.853956, 106.452322, 89.704052, 106.452322),\n (89.704052, 106.452322, 87.554147, 106.452322),\n (87.554147, 106.452322, 85.404242, 106.452322),\n (85.404242, 106.452322, 83.254337, 106.452322),\n (83.254337, 106.452322, 81.104432, 106.452322),\n (81.104432, 106.452322, 78.954527, 106.452322),\n (78.954527, 106.452322, 76.804623, 106.452322),\n (76.804623, 106.452322, 76.804623, 79.149277),\n (159.601578, 120.452323, 159.601578, 122.602227),\n (159.601578, 122.602227, 159.601578, 124.752132),\n (159.601578, 124.752132, 159.601578, 126.902037),\n (159.601578, 126.902037, 159.601578, 129.051942),\n (159.601578, 129.051942, 159.601578, 131.201847),\n (159.601578, 131.201847, 159.601578, 133.351752),\n (159.601578, 133.351752, 159.601578, 135.501656),\n (159.601578, 135.501656, 159.601578, 137.651561),\n (159.601578, 137.651561, 159.601578, 139.801466),\n (159.601578, 139.801466, 159.601578, 141.951371),\n (159.601578, 141.951371, 159.601578, 144.101276),\n (159.601578, 144.101276, 159.601578, 146.251181),\n (159.601578, 146.251181, 159.601578, 148.401085),\n (159.601578, 148.401085, 159.601578, 150.55099),\n (159.601578, 150.55099, 159.601578, 152.700895),\n (159.601578, 152.700895, 159.601578, 154.8508),\n (159.601578, 154.8508, 159.601578, 157.000705),\n (159.601578, 157.000705, 159.601578, 159.15061),\n (159.601578, 159.15061, 159.601578, 161.300515),\n (159.601578, 161.300515, 159.601578, 163.450419),\n (159.601578, 163.450419, 159.601578, 165.600324),\n (159.601578, 165.600324, 159.601578, 167.750229),\n (159.601578, 167.750229, 159.601578, 169.900134),\n (159.601578, 169.900134, 159.601578, 172.050039),\n (159.601578, 172.050039, 159.601578, 174.199944),\n (159.601578, 174.199944, 159.601578, 176.349848),\n (159.601578, 176.349848, 159.601578, 178.499753),\n (159.601578, 178.499753, 159.601578, 180.649658),\n (159.601578, 180.649658, 159.601578, 182.799563),\n (159.601578, 182.799563, 159.601578, 184.949468),\n (159.601578, 184.949468, 159.601578, 187.099373),\n (159.601578, 187.099373, 159.601578, 189.249277),\n (186.904623, 120.452323, 186.904623, 122.602227),\n (186.904623, 122.602227, 186.904623, 124.752132),\n (186.904623, 124.752132, 186.904623, 126.902037),\n (186.904623, 126.902037, 186.904623, 129.051942),\n (186.904623, 129.051942, 186.904623, 131.201847),\n (186.904623, 131.201847, 186.904623, 133.351752),\n (186.904623, 133.351752, 186.904623, 135.501656),\n (186.904623, 135.501656, 186.904623, 137.651561),\n (186.904623, 137.651561, 186.904623, 139.801466),\n (186.904623, 139.801466, 186.904623, 141.951371),\n (186.904623, 141.951371, 186.904623, 144.101276),\n (186.904623, 144.101276, 186.904623, 146.251181),\n (186.904623, 146.251181, 186.904623, 148.401085),\n (186.904623, 148.401085, 186.904623, 150.55099),\n (186.904623, 150.55099, 186.904623, 152.700895),\n (186.904623, 152.700895, 186.904623, 154.8508),\n (186.904623, 154.8508, 186.904623, 157.000705),\n (186.904623, 157.000705, 186.904623, 159.15061),\n (186.904623, 159.15061, 186.904623, 161.300515),\n (186.904623, 161.300515, 186.904623, 163.450419),\n (186.904623, 163.450419, 186.904623, 165.600324),\n (186.904623, 165.600324, 186.904623, 167.750229),\n (186.904623, 167.750229, 186.904623, 169.900134),\n (186.904623, 169.900134, 186.904623, 172.050039),\n (186.904623, 172.050039, 186.904623, 174.199944),\n (186.904623, 174.199944, 186.904623, 176.349848),\n (186.904623, 176.349848, 186.904623, 178.499753),\n (186.904623, 178.499753, 186.904623, 180.649658),\n (186.904623, 180.649658, 186.904623, 182.799563),\n (186.904623, 182.799563, 186.904623, 184.949468),\n (186.904623, 184.949468, 186.904623, 187.099373),\n (186.904623, 187.099373, 186.904623, 189.249277),\n (186.904623, 120.452323, 159.601578, 120.452323),\n (186.904623, 189.249277, 159.601578, 189.249277)\n]\nVISIBLE_CIRCLES = [\n (111.2031, 154.8508, 34.398477),\n (111.2031, 154.8508, 12.182794)\n]\nVISIBLE_ARCS = [\n\n]\nHIDDEN_SEGMENTS = [\n (123.386, 106.4523, 123.386, 79.1492),\n (99.0204, 79.1492, 99.0204, 106.4523),\n (186.9047, 167.0336, 159.6016, 167.0336),\n (186.9047, 142.668, 159.6016, 142.668)\n]\n# (orient, text, p1, p2, base) for linear; (orient, text, center, radius, angle) for diameter\nDIMENSIONS = [\n ('diameter', '%%c100', (111.2031, 154.8508), 34.3985, 45),\n ('diameter', '%%c35.4167', (111.2031, 154.8508), 12.1828, 135),\n ('horizontal', '39.6864', (159.6016, 154.8508), (186.9047, 154.8508), (173.2532, 165.8508))\n]\n\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\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\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,\n angle=(0 if d[0] == \"horizontal\" else 90),\n 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,\n text=text, dimstyle=\"EZDXF\").render()\n\n doc.saveas(out_path)\n\n\nif __name__ == \"__main__\":\n out = sys.argv[1] if len(sys.argv) > 1 else \"0015_00156608_gt.dxf\"\n draw(out)\n print(\"wrote\", out)\n```"}], "images": ["images/0015_00156608.png"], "id": "0015_00156608"} {"messages": [{"role": "user", "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 50 mm. It is extruded to a thickness of 24.74 mm."}, {"role": "assistant", "content": "```python\n#!/usr/bin/env python3\n# -*- coding: utf-8 -*-\n# Ground-truth 2D engineering drawing for part: 0017_00171340\n# Self-contained: reproduces the three-view DXF via ezdxf, NO FreeCAD needed.\n# Coordinates are A4 page millimetres (scale=0.7704050104384155, page=[297.0, 210.0]).\n# visible edges -> solid (layer OUTLINE); hidden edges -> dashed (layer HIDDEN)\n# dimensions -> real movable DIMENSION entities (text = true mm value)\n# Run: python 0017_00171340_gt.py [out.dxf]\nimport sys\nimport ezdxf\n\nSCALE = 0.7704050104384155\nPAGE = [297.0, 210.0]\n\nVISIBLE_SEGMENTS = [\n (151.045351, 81.21015, 148.637835, 81.21015),\n (148.637835, 81.21015, 146.230319, 81.21015),\n (146.230319, 81.21015, 143.822804, 81.21015),\n (143.822804, 81.21015, 141.415288, 81.21015),\n (141.415288, 81.21015, 139.007772, 81.21015),\n (139.007772, 81.21015, 136.600257, 81.21015),\n (136.600257, 81.21015, 134.192741, 81.21015),\n (134.192741, 81.21015, 131.785225, 81.21015),\n (131.785225, 81.21015, 129.37771, 81.21015),\n (129.37771, 81.21015, 126.970194, 81.21015),\n (126.970194, 81.21015, 124.562678, 81.21015),\n (124.562678, 81.21015, 122.155163, 81.21015),\n (122.155163, 81.21015, 119.747647, 81.21015),\n (119.747647, 81.21015, 117.340131, 81.21015),\n (117.340131, 81.21015, 114.932616, 81.21015),\n (114.932616, 81.21015, 112.5251, 81.21015),\n (112.5251, 81.21015, 110.117584, 81.21015),\n (110.117584, 81.21015, 107.710069, 81.21015),\n (107.710069, 81.21015, 105.302553, 81.21015),\n (105.302553, 81.21015, 102.895037, 81.21015),\n (102.895037, 81.21015, 100.487522, 81.21015),\n (100.487522, 81.21015, 98.080006, 81.21015),\n (98.080006, 81.21015, 95.67249, 81.21015),\n (95.67249, 81.21015, 93.264975, 81.21015),\n (93.264975, 81.21015, 90.857459, 81.21015),\n (90.857459, 81.21015, 88.449943, 81.21015),\n (88.449943, 81.21015, 86.042428, 81.21015),\n (86.042428, 81.21015, 83.634912, 81.21015),\n (83.634912, 81.21015, 81.227396, 81.21015),\n (81.227396, 81.21015, 78.819881, 81.21015),\n (78.819881, 81.21015, 76.412365, 81.21015),\n (76.412365, 81.21015, 74.004849, 81.21015),\n (151.045351, 81.21015, 151.045351, 100.269649),\n (151.045351, 100.269649, 148.637835, 100.269649),\n (148.637835, 100.269649, 146.230319, 100.269649),\n (146.230319, 100.269649, 143.822804, 100.269649),\n (143.822804, 100.269649, 141.415288, 100.269649),\n (141.415288, 100.269649, 139.007772, 100.269649),\n (139.007772, 100.269649, 136.600257, 100.269649),\n (136.600257, 100.269649, 134.192741, 100.269649),\n (134.192741, 100.269649, 131.785225, 100.269649),\n (131.785225, 100.269649, 129.37771, 100.269649),\n (129.37771, 100.269649, 126.970194, 100.269649),\n (126.970194, 100.269649, 124.562678, 100.269649),\n (124.562678, 100.269649, 122.155163, 100.269649),\n (122.155163, 100.269649, 119.747647, 100.269649),\n (119.747647, 100.269649, 117.340131, 100.269649),\n (117.340131, 100.269649, 114.932616, 100.269649),\n (114.932616, 100.269649, 112.5251, 100.269649),\n (112.5251, 100.269649, 110.117584, 100.269649),\n (110.117584, 100.269649, 107.710069, 100.269649),\n (107.710069, 100.269649, 105.302553, 100.269649),\n (105.302553, 100.269649, 102.895037, 100.269649),\n (102.895037, 100.269649, 100.487522, 100.269649),\n (100.487522, 100.269649, 98.080006, 100.269649),\n (98.080006, 100.269649, 95.67249, 100.269649),\n (95.67249, 100.269649, 93.264975, 100.269649),\n (93.264975, 100.269649, 90.857459, 100.269649),\n (90.857459, 100.269649, 88.449943, 100.269649),\n (88.449943, 100.269649, 86.042428, 100.269649),\n (86.042428, 100.269649, 83.634912, 100.269649),\n (83.634912, 100.269649, 81.227396, 100.269649),\n (81.227396, 100.269649, 78.819881, 100.269649),\n (78.819881, 100.269649, 76.412365, 100.269649),\n (76.412365, 100.269649, 74.004849, 100.269649),\n (74.004849, 100.269649, 74.004849, 81.21015),\n (165.045351, 114.269649, 165.045351, 116.677165),\n (165.045351, 116.677165, 165.045351, 119.084681),\n (165.045351, 119.084681, 165.045351, 121.492196),\n (165.045351, 121.492196, 165.045351, 123.899712),\n (165.045351, 123.899712, 165.045351, 126.307228),\n (165.045351, 126.307228, 165.045351, 128.714743),\n (165.045351, 128.714743, 165.045351, 131.122259),\n (165.045351, 131.122259, 165.045351, 133.529775),\n (165.045351, 133.529775, 165.045351, 135.93729),\n (165.045351, 135.93729, 165.045351, 138.344806),\n (165.045351, 138.344806, 165.045351, 140.752322),\n (165.045351, 140.752322, 165.045351, 143.159837),\n (165.045351, 143.159837, 165.045351, 145.567353),\n (165.045351, 145.567353, 165.045351, 147.974869),\n (165.045351, 147.974869, 165.045351, 150.382384),\n (165.045351, 150.382384, 165.045351, 152.7899),\n (165.045351, 152.7899, 165.045351, 155.197416),\n (165.045351, 155.197416, 165.045351, 157.604931),\n (165.045351, 157.604931, 165.045351, 160.012447),\n (165.045351, 160.012447, 165.045351, 162.419963),\n (165.045351, 162.419963, 165.045351, 164.827478),\n (165.045351, 164.827478, 165.045351, 167.234994),\n (165.045351, 167.234994, 165.045351, 169.64251),\n (165.045351, 169.64251, 165.045351, 172.050025),\n (165.045351, 172.050025, 165.045351, 174.457541),\n (165.045351, 174.457541, 165.045351, 176.865057),\n (165.045351, 176.865057, 165.045351, 179.272572),\n (165.045351, 179.272572, 165.045351, 181.680088),\n (165.045351, 181.680088, 165.045351, 184.087604),\n (165.045351, 184.087604, 165.045351, 186.495119),\n (165.045351, 186.495119, 165.045351, 188.902635),\n (165.045351, 188.902635, 165.045351, 191.310151),\n (184.10485, 114.269649, 184.10485, 116.677165),\n (184.10485, 116.677165, 184.10485, 119.084681),\n (184.10485, 119.084681, 184.10485, 121.492196),\n (184.10485, 121.492196, 184.10485, 123.899712),\n (184.10485, 123.899712, 184.10485, 126.307228),\n (184.10485, 126.307228, 184.10485, 128.714743),\n (184.10485, 128.714743, 184.10485, 131.122259),\n (184.10485, 131.122259, 184.10485, 133.529775),\n (184.10485, 133.529775, 184.10485, 135.93729),\n (184.10485, 135.93729, 184.10485, 138.344806),\n (184.10485, 138.344806, 184.10485, 140.752322),\n (184.10485, 140.752322, 184.10485, 143.159837),\n (184.10485, 143.159837, 184.10485, 145.567353),\n (184.10485, 145.567353, 184.10485, 147.974869),\n (184.10485, 147.974869, 184.10485, 150.382384),\n (184.10485, 150.382384, 184.10485, 152.7899),\n (184.10485, 152.7899, 184.10485, 155.197416),\n (184.10485, 155.197416, 184.10485, 157.604931),\n (184.10485, 157.604931, 184.10485, 160.012447),\n (184.10485, 160.012447, 184.10485, 162.419963),\n (184.10485, 162.419963, 184.10485, 164.827478),\n (184.10485, 164.827478, 184.10485, 167.234994),\n (184.10485, 167.234994, 184.10485, 169.64251),\n (184.10485, 169.64251, 184.10485, 172.050025),\n (184.10485, 172.050025, 184.10485, 174.457541),\n (184.10485, 174.457541, 184.10485, 176.865057),\n (184.10485, 176.865057, 184.10485, 179.272572),\n (184.10485, 179.272572, 184.10485, 181.680088),\n (184.10485, 181.680088, 184.10485, 184.087604),\n (184.10485, 184.087604, 184.10485, 186.495119),\n (184.10485, 186.495119, 184.10485, 188.902635),\n (184.10485, 188.902635, 184.10485, 191.310151),\n (184.10485, 114.269649, 165.045351, 114.269649),\n (184.10485, 191.310151, 165.045351, 191.310151)\n]\nVISIBLE_CIRCLES = [\n (112.5251, 152.7899, 38.520251),\n (112.5251, 152.7899, 19.260125)\n]\nVISIBLE_ARCS = [\n\n]\nHIDDEN_SEGMENTS = [\n (131.7853, 100.2696, 131.7853, 81.2101),\n (93.265, 81.2101, 93.265, 100.2696),\n (184.1049, 172.05, 165.0454, 172.05),\n (184.1049, 133.5297, 165.0454, 133.5297)\n]\n# (orient, text, p1, p2, base) for linear; (orient, text, center, radius, angle) for diameter\nDIMENSIONS = [\n ('diameter', '%%c100', (112.5251, 152.7899), 38.5203, 45),\n ('diameter', '%%c50', (112.5251, 152.7899), 19.2601, 135),\n ('horizontal', '24.7396', (165.0454, 152.7899), (184.1049, 152.7899), (174.5752, 163.7899))\n]\n\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\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\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,\n angle=(0 if d[0] == \"horizontal\" else 90),\n 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,\n text=text, dimstyle=\"EZDXF\").render()\n\n doc.saveas(out_path)\n\n\nif __name__ == \"__main__\":\n out = sys.argv[1] if len(sys.argv) > 1 else \"0017_00171340_gt.dxf\"\n draw(out)\n print(\"wrote\", out)\n```"}], "images": ["images/0017_00171340.png"], "id": "0017_00171340"} {"messages": [{"role": "user", "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 95.83 mm. It is extruded to a thickness of 43.29 mm."}, {"role": "assistant", "content": "```python\n#!/usr/bin/env python3\n# -*- coding: utf-8 -*-\n# Ground-truth 2D engineering drawing for part: 0017_00174401\n# Self-contained: reproduces the three-view DXF via ezdxf, NO FreeCAD needed.\n# Coordinates are A4 page millimetres (scale=0.6706478873239592, page=[297.0, 210.0]).\n# visible edges -> solid (layer OUTLINE); hidden edges -> dashed (layer HIDDEN)\n# dimensions -> real movable DIMENSION entities (text = true mm value)\n# Run: python 0017_00174401_gt.py [out.dxf]\nimport sys\nimport ezdxf\n\nSCALE = 0.6706478873239592\nPAGE = [297.0, 210.0]\n\nVISIBLE_SEGMENTS = [\n (72.033106, 107.751405, 74.12888, 107.751405),\n (74.12888, 107.751405, 76.224655, 107.751405),\n (76.224655, 107.751405, 78.32043, 107.751405),\n (78.32043, 107.751405, 80.416204, 107.751405),\n (80.416204, 107.751405, 82.511979, 107.751405),\n (82.511979, 107.751405, 84.607754, 107.751405),\n (84.607754, 107.751405, 86.703528, 107.751405),\n (86.703528, 107.751405, 88.799303, 107.751405),\n (88.799303, 107.751405, 90.895077, 107.751405),\n (90.895077, 107.751405, 92.990852, 107.751405),\n (92.990852, 107.751405, 95.086627, 107.751405),\n (95.086627, 107.751405, 97.182401, 107.751405),\n (97.182401, 107.751405, 99.278176, 107.751405),\n (99.278176, 107.751405, 101.373951, 107.751405),\n (101.373951, 107.751405, 103.469725, 107.751405),\n (103.469725, 107.751405, 105.5655, 107.751405),\n (105.5655, 107.751405, 107.661275, 107.751405),\n (107.661275, 107.751405, 109.757049, 107.751405),\n (109.757049, 107.751405, 111.852824, 107.751405),\n (111.852824, 107.751405, 113.948599, 107.751405),\n (113.948599, 107.751405, 116.044373, 107.751405),\n (116.044373, 107.751405, 118.140148, 107.751405),\n (118.140148, 107.751405, 120.235923, 107.751405),\n (120.235923, 107.751405, 122.331697, 107.751405),\n (122.331697, 107.751405, 124.427472, 107.751405),\n (124.427472, 107.751405, 126.523246, 107.751405),\n (126.523246, 107.751405, 128.619021, 107.751405),\n (128.619021, 107.751405, 130.714796, 107.751405),\n (130.714796, 107.751405, 132.81057, 107.751405),\n (132.81057, 107.751405, 134.906345, 107.751405),\n (134.906345, 107.751405, 137.00212, 107.751405),\n (137.00212, 107.751405, 139.097894, 107.751405),\n (139.097894, 107.751405, 139.097894, 78.716194),\n (72.033106, 78.716194, 74.12888, 78.716194),\n (74.12888, 78.716194, 76.224655, 78.716194),\n (76.224655, 78.716194, 78.32043, 78.716194),\n (78.32043, 78.716194, 80.416204, 78.716194),\n (80.416204, 78.716194, 82.511979, 78.716194),\n (82.511979, 78.716194, 84.607754, 78.716194),\n (84.607754, 78.716194, 86.703528, 78.716194),\n (86.703528, 78.716194, 88.799303, 78.716194),\n (88.799303, 78.716194, 90.895077, 78.716194),\n (90.895077, 78.716194, 92.990852, 78.716194),\n (92.990852, 78.716194, 95.086627, 78.716194),\n (95.086627, 78.716194, 97.182401, 78.716194),\n (97.182401, 78.716194, 99.278176, 78.716194),\n (99.278176, 78.716194, 101.373951, 78.716194),\n (101.373951, 78.716194, 103.469725, 78.716194),\n (103.469725, 78.716194, 105.5655, 78.716194),\n (105.5655, 78.716194, 107.661275, 78.716194),\n (107.661275, 78.716194, 109.757049, 78.716194),\n (109.757049, 78.716194, 111.852824, 78.716194),\n (111.852824, 78.716194, 113.948599, 78.716194),\n (113.948599, 78.716194, 116.044373, 78.716194),\n (116.044373, 78.716194, 118.140148, 78.716194),\n (118.140148, 78.716194, 120.235923, 78.716194),\n (120.235923, 78.716194, 122.331697, 78.716194),\n (122.331697, 78.716194, 124.427472, 78.716194),\n (124.427472, 78.716194, 126.523246, 78.716194),\n (126.523246, 78.716194, 128.619021, 78.716194),\n (128.619021, 78.716194, 130.714796, 78.716194),\n (130.714796, 78.716194, 132.81057, 78.716194),\n (132.81057, 78.716194, 134.906345, 78.716194),\n (134.906345, 78.716194, 137.00212, 78.716194),\n (137.00212, 78.716194, 139.097894, 78.716194),\n (72.033106, 78.716194, 72.033106, 107.751405),\n (182.133106, 188.816194, 182.133106, 186.72042),\n (182.133106, 186.72042, 182.133106, 184.624645),\n (182.133106, 184.624645, 182.133106, 182.52887),\n (182.133106, 182.52887, 182.133106, 180.433096),\n (182.133106, 180.433096, 182.133106, 178.337321),\n (182.133106, 178.337321, 182.133106, 176.241546),\n (182.133106, 176.241546, 182.133106, 174.145772),\n (182.133106, 174.145772, 182.133106, 172.049997),\n (182.133106, 172.049997, 182.133106, 169.954223),\n (182.133106, 169.954223, 182.133106, 167.858448),\n (182.133106, 167.858448, 182.133106, 165.762673),\n (182.133106, 165.762673, 182.133106, 163.666899),\n (182.133106, 163.666899, 182.133106, 161.571124),\n (182.133106, 161.571124, 182.133106, 159.475349),\n (182.133106, 159.475349, 182.133106, 157.379575),\n (182.133106, 157.379575, 182.133106, 155.2838),\n (182.133106, 155.2838, 182.133106, 153.188025),\n (182.133106, 153.188025, 182.133106, 151.092251),\n (182.133106, 151.092251, 182.133106, 148.996476),\n (182.133106, 148.996476, 182.133106, 146.900701),\n (182.133106, 146.900701, 182.133106, 144.804927),\n (182.133106, 144.804927, 182.133106, 142.709152),\n (182.133106, 142.709152, 182.133106, 140.613377),\n (182.133106, 140.613377, 182.133106, 138.517603),\n (182.133106, 138.517603, 182.133106, 136.421828),\n (182.133106, 136.421828, 182.133106, 134.326054),\n (182.133106, 134.326054, 182.133106, 132.230279),\n (182.133106, 132.230279, 182.133106, 130.134504),\n (182.133106, 130.134504, 182.133106, 128.03873),\n (182.133106, 128.03873, 182.133106, 125.942955),\n (182.133106, 125.942955, 182.133106, 123.84718),\n (182.133106, 123.84718, 182.133106, 121.751406),\n (153.097895, 188.816194, 153.097895, 186.72042),\n (153.097895, 186.72042, 153.097895, 184.624645),\n (153.097895, 184.624645, 153.097895, 182.52887),\n (153.097895, 182.52887, 153.097895, 180.433096),\n (153.097895, 180.433096, 153.097895, 178.337321),\n (153.097895, 178.337321, 153.097895, 176.241546),\n (153.097895, 176.241546, 153.097895, 174.145772),\n (153.097895, 174.145772, 153.097895, 172.049997),\n (153.097895, 172.049997, 153.097895, 169.954223),\n (153.097895, 169.954223, 153.097895, 167.858448),\n (153.097895, 167.858448, 153.097895, 165.762673),\n (153.097895, 165.762673, 153.097895, 163.666899),\n (153.097895, 163.666899, 153.097895, 161.571124),\n (153.097895, 161.571124, 153.097895, 159.475349),\n (153.097895, 159.475349, 153.097895, 157.379575),\n (153.097895, 157.379575, 153.097895, 155.2838),\n (153.097895, 155.2838, 153.097895, 153.188025),\n (153.097895, 153.188025, 153.097895, 151.092251),\n (153.097895, 151.092251, 153.097895, 148.996476),\n (153.097895, 148.996476, 153.097895, 146.900701),\n (153.097895, 146.900701, 153.097895, 144.804927),\n (153.097895, 144.804927, 153.097895, 142.709152),\n (153.097895, 142.709152, 153.097895, 140.613377),\n (153.097895, 140.613377, 153.097895, 138.517603),\n (153.097895, 138.517603, 153.097895, 136.421828),\n (153.097895, 136.421828, 153.097895, 134.326054),\n (153.097895, 134.326054, 153.097895, 132.230279),\n (153.097895, 132.230279, 153.097895, 130.134504),\n (153.097895, 130.134504, 153.097895, 128.03873),\n (153.097895, 128.03873, 153.097895, 125.942955),\n (153.097895, 125.942955, 153.097895, 123.84718),\n (153.097895, 123.84718, 153.097895, 121.751406),\n (153.097895, 188.816194, 182.133106, 188.816194),\n (153.097895, 121.751406, 182.133106, 121.751406)\n]\nVISIBLE_CIRCLES = [\n (105.5655, 155.2838, 33.532394),\n (105.5655, 155.2838, 32.135211)\n]\nVISIBLE_ARCS = [\n\n]\nHIDDEN_SEGMENTS = [\n (137.7007, 78.7162, 137.7007, 107.7514),\n (73.4303, 107.7514, 73.4303, 78.7162),\n (153.0979, 123.1486, 182.1331, 123.1486),\n (153.0979, 187.419, 182.1331, 187.419)\n]\n# (orient, text, p1, p2, base) for linear; (orient, text, center, radius, angle) for diameter\nDIMENSIONS = [\n ('diameter', '%%c100', (105.5655, 155.2838), 33.5324, 45),\n ('diameter', '%%c95.8333', (105.5655, 155.2838), 32.1352, 135),\n ('horizontal', '43.2943', (182.1331, 155.2838), (153.0979, 155.2838), (167.6155, 144.2838))\n]\n\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\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\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,\n angle=(0 if d[0] == \"horizontal\" else 90),\n 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,\n text=text, dimstyle=\"EZDXF\").render()\n\n doc.saveas(out_path)\n\n\nif __name__ == \"__main__\":\n out = sys.argv[1] if len(sys.argv) > 1 else \"0017_00174401_gt.dxf\"\n draw(out)\n print(\"wrote\", out)\n```"}], "images": ["images/0017_00174401.png"], "id": "0017_00174401"} {"messages": [{"role": "user", "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 91.67 mm. It is extruded to a thickness of 17.52 mm."}, {"role": "assistant", "content": "```python\n#!/usr/bin/env python3\n# -*- coding: utf-8 -*-\n# Ground-truth 2D engineering drawing for part: 0017_00179308\n# Self-contained: reproduces the three-view DXF via ezdxf, NO FreeCAD needed.\n# Coordinates are A4 page millimetres (scale=0.8177062136460145, page=[297.0, 210.0]).\n# visible edges -> solid (layer OUTLINE); hidden edges -> dashed (layer HIDDEN)\n# dimensions -> real movable DIMENSION entities (text = true mm value)\n# Run: python 0017_00179308_gt.py [out.dxf]\nimport sys\nimport ezdxf\n\nSCALE = 0.8177062136460145\nPAGE = [297.0, 210.0]\n\nVISIBLE_SEGMENTS = [\n (150.629711, 82.39261, 148.074379, 82.39261),\n (148.074379, 82.39261, 145.519047, 82.39261),\n (145.519047, 82.39261, 142.963715, 82.39261),\n (142.963715, 82.39261, 140.408383, 82.39261),\n (140.408383, 82.39261, 137.853051, 82.39261),\n (137.853051, 82.39261, 135.297719, 82.39261),\n (135.297719, 82.39261, 132.742387, 82.39261),\n (132.742387, 82.39261, 130.187055, 82.39261),\n (130.187055, 82.39261, 127.631723, 82.39261),\n (127.631723, 82.39261, 125.076392, 82.39261),\n (125.076392, 82.39261, 122.52106, 82.39261),\n (122.52106, 82.39261, 119.965728, 82.39261),\n (119.965728, 82.39261, 117.410396, 82.39261),\n (117.410396, 82.39261, 114.855064, 82.39261),\n (114.855064, 82.39261, 112.299732, 82.39261),\n (112.299732, 82.39261, 109.7444, 82.39261),\n (109.7444, 82.39261, 107.189068, 82.39261),\n (107.189068, 82.39261, 104.633736, 82.39261),\n (104.633736, 82.39261, 102.078404, 82.39261),\n (102.078404, 82.39261, 99.523072, 82.39261),\n (99.523072, 82.39261, 96.96774, 82.39261),\n (96.96774, 82.39261, 94.412408, 82.39261),\n (94.412408, 82.39261, 91.857077, 82.39261),\n (91.857077, 82.39261, 89.301745, 82.39261),\n (89.301745, 82.39261, 86.746413, 82.39261),\n (86.746413, 82.39261, 84.191081, 82.39261),\n (84.191081, 82.39261, 81.635749, 82.39261),\n (81.635749, 82.39261, 79.080417, 82.39261),\n (79.080417, 82.39261, 76.525085, 82.39261),\n (76.525085, 82.39261, 73.969753, 82.39261),\n (73.969753, 82.39261, 71.414421, 82.39261),\n (71.414421, 82.39261, 68.859089, 82.39261),\n (150.629711, 82.39261, 150.629711, 96.721989),\n (150.629711, 96.721989, 148.074379, 96.721989),\n (148.074379, 96.721989, 145.519047, 96.721989),\n (145.519047, 96.721989, 142.963715, 96.721989),\n (142.963715, 96.721989, 140.408383, 96.721989),\n (140.408383, 96.721989, 137.853051, 96.721989),\n (137.853051, 96.721989, 135.297719, 96.721989),\n (135.297719, 96.721989, 132.742387, 96.721989),\n (132.742387, 96.721989, 130.187055, 96.721989),\n (130.187055, 96.721989, 127.631723, 96.721989),\n (127.631723, 96.721989, 125.076392, 96.721989),\n (125.076392, 96.721989, 122.52106, 96.721989),\n (122.52106, 96.721989, 119.965728, 96.721989),\n (119.965728, 96.721989, 117.410396, 96.721989),\n (117.410396, 96.721989, 114.855064, 96.721989),\n (114.855064, 96.721989, 112.299732, 96.721989),\n (112.299732, 96.721989, 109.7444, 96.721989),\n (109.7444, 96.721989, 107.189068, 96.721989),\n (107.189068, 96.721989, 104.633736, 96.721989),\n (104.633736, 96.721989, 102.078404, 96.721989),\n (102.078404, 96.721989, 99.523072, 96.721989),\n (99.523072, 96.721989, 96.96774, 96.721989),\n (96.96774, 96.721989, 94.412408, 96.721989),\n (94.412408, 96.721989, 91.857077, 96.721989),\n (91.857077, 96.721989, 89.301745, 96.721989),\n (89.301745, 96.721989, 86.746413, 96.721989),\n (86.746413, 96.721989, 84.191081, 96.721989),\n (84.191081, 96.721989, 81.635749, 96.721989),\n (81.635749, 96.721989, 79.080417, 96.721989),\n (79.080417, 96.721989, 76.525085, 96.721989),\n (76.525085, 96.721989, 73.969753, 96.721989),\n (73.969753, 96.721989, 71.414421, 96.721989),\n (71.414421, 96.721989, 68.859089, 96.721989),\n (68.859089, 96.721989, 68.859089, 82.39261),\n (164.629711, 110.721989, 164.629711, 113.277321),\n (164.629711, 113.277321, 164.629711, 115.832653),\n (164.629711, 115.832653, 164.629711, 118.387985),\n (164.629711, 118.387985, 164.629711, 120.943317),\n (164.629711, 120.943317, 164.629711, 123.498649),\n (164.629711, 123.498649, 164.629711, 126.053981),\n (164.629711, 126.053981, 164.629711, 128.609313),\n (164.629711, 128.609313, 164.629711, 131.164645),\n (164.629711, 131.164645, 164.629711, 133.719977),\n (164.629711, 133.719977, 164.629711, 136.275308),\n (164.629711, 136.275308, 164.629711, 138.83064),\n (164.629711, 138.83064, 164.629711, 141.385972),\n (164.629711, 141.385972, 164.629711, 143.941304),\n (164.629711, 143.941304, 164.629711, 146.496636),\n (164.629711, 146.496636, 164.629711, 149.051968),\n (164.629711, 149.051968, 164.629711, 151.6073),\n (164.629711, 151.6073, 164.629711, 154.162632),\n (164.629711, 154.162632, 164.629711, 156.717964),\n (164.629711, 156.717964, 164.629711, 159.273296),\n (164.629711, 159.273296, 164.629711, 161.828628),\n (164.629711, 161.828628, 164.629711, 164.38396),\n (164.629711, 164.38396, 164.629711, 166.939292),\n (164.629711, 166.939292, 164.629711, 169.494623),\n (164.629711, 169.494623, 164.629711, 172.049955),\n (164.629711, 172.049955, 164.629711, 174.605287),\n (164.629711, 174.605287, 164.629711, 177.160619),\n (164.629711, 177.160619, 164.629711, 179.715951),\n (164.629711, 179.715951, 164.629711, 182.271283),\n (164.629711, 182.271283, 164.629711, 184.826615),\n (164.629711, 184.826615, 164.629711, 187.381947),\n (164.629711, 187.381947, 164.629711, 189.937279),\n (164.629711, 189.937279, 164.629711, 192.492611),\n (178.95909, 110.721989, 178.95909, 113.277321),\n (178.95909, 113.277321, 178.95909, 115.832653),\n (178.95909, 115.832653, 178.95909, 118.387985),\n (178.95909, 118.387985, 178.95909, 120.943317),\n (178.95909, 120.943317, 178.95909, 123.498649),\n (178.95909, 123.498649, 178.95909, 126.053981),\n (178.95909, 126.053981, 178.95909, 128.609313),\n (178.95909, 128.609313, 178.95909, 131.164645),\n (178.95909, 131.164645, 178.95909, 133.719977),\n (178.95909, 133.719977, 178.95909, 136.275308),\n (178.95909, 136.275308, 178.95909, 138.83064),\n (178.95909, 138.83064, 178.95909, 141.385972),\n (178.95909, 141.385972, 178.95909, 143.941304),\n (178.95909, 143.941304, 178.95909, 146.496636),\n (178.95909, 146.496636, 178.95909, 149.051968),\n (178.95909, 149.051968, 178.95909, 151.6073),\n (178.95909, 151.6073, 178.95909, 154.162632),\n (178.95909, 154.162632, 178.95909, 156.717964),\n (178.95909, 156.717964, 178.95909, 159.273296),\n (178.95909, 159.273296, 178.95909, 161.828628),\n (178.95909, 161.828628, 178.95909, 164.38396),\n (178.95909, 164.38396, 178.95909, 166.939292),\n (178.95909, 166.939292, 178.95909, 169.494623),\n (178.95909, 169.494623, 178.95909, 172.049955),\n (178.95909, 172.049955, 178.95909, 174.605287),\n (178.95909, 174.605287, 178.95909, 177.160619),\n (178.95909, 177.160619, 178.95909, 179.715951),\n (178.95909, 179.715951, 178.95909, 182.271283),\n (178.95909, 182.271283, 178.95909, 184.826615),\n (178.95909, 184.826615, 178.95909, 187.381947),\n (178.95909, 187.381947, 178.95909, 189.937279),\n (178.95909, 189.937279, 178.95909, 192.492611),\n (178.95909, 110.721989, 164.629711, 110.721989),\n (178.95909, 192.492611, 164.629711, 192.492611)\n]\nVISIBLE_CIRCLES = [\n (109.7444, 151.6073, 40.885311),\n (109.7444, 151.6073, 37.478201)\n]\nVISIBLE_ARCS = [\n\n]\nHIDDEN_SEGMENTS = [\n (147.2226, 96.722, 147.2226, 82.3927),\n (72.2662, 82.3927, 72.2662, 96.722),\n (178.9591, 189.0855, 164.6297, 189.0855),\n (178.9591, 114.1291, 164.6297, 114.1291)\n]\n# (orient, text, p1, p2, base) for linear; (orient, text, center, radius, angle) for diameter\nDIMENSIONS = [\n ('diameter', '%%c100', (109.7444, 151.6073), 40.8853, 45),\n ('diameter', '%%c91.6667', (109.7444, 151.6073), 37.4782, 135),\n ('horizontal', '17.5239', (164.6297, 151.6073), (178.9591, 151.6073), (171.7944, 162.6073))\n]\n\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\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\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,\n angle=(0 if d[0] == \"horizontal\" else 90),\n 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,\n text=text, dimstyle=\"EZDXF\").render()\n\n doc.saveas(out_path)\n\n\nif __name__ == \"__main__\":\n out = sys.argv[1] if len(sys.argv) > 1 else \"0017_00179308_gt.dxf\"\n draw(out)\n print(\"wrote\", out)\n```"}], "images": ["images/0017_00179308.png"], "id": "0017_00179308"} {"messages": [{"role": "user", "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 158.33 mm."}, {"role": "assistant", "content": "```python\n#!/usr/bin/env python3\n# -*- coding: utf-8 -*-\n# Ground-truth 2D engineering drawing for part: 0018_00181695\n# Self-contained: reproduces the three-view DXF via ezdxf, NO FreeCAD needed.\n# Coordinates are A4 page millimetres (scale=0.4805, page=[297.0, 210.0]).\n# visible edges -> solid (layer OUTLINE); hidden edges -> dashed (layer HIDDEN)\n# dimensions -> real movable DIMENSION entities (text = true mm value)\n# Run: python 0018_00181695_gt.py [out.dxf]\nimport sys\nimport ezdxf\n\nSCALE = 0.4805\nPAGE = [297.0, 210.0]\n\nVISIBLE_SEGMENTS = [\n (113.3509, 59.947933, 111.849338, 59.947933),\n (111.849338, 59.947933, 110.347775, 59.947933),\n (110.347775, 59.947933, 108.846213, 59.947933),\n (108.846213, 59.947933, 107.34465, 59.947933),\n (107.34465, 59.947933, 105.843087, 59.947933),\n (105.843087, 59.947933, 104.341525, 59.947933),\n (104.341525, 59.947933, 102.839962, 59.947933),\n (102.839962, 59.947933, 101.3384, 59.947933),\n (101.3384, 59.947933, 99.836838, 59.947933),\n (99.836838, 59.947933, 98.335275, 59.947933),\n (98.335275, 59.947933, 96.833713, 59.947933),\n (96.833713, 59.947933, 95.33215, 59.947933),\n (95.33215, 59.947933, 93.830588, 59.947933),\n (93.830588, 59.947933, 92.329025, 59.947933),\n (92.329025, 59.947933, 90.827463, 59.947933),\n (90.827463, 59.947933, 89.3259, 59.947933),\n (89.3259, 59.947933, 87.824338, 59.947933),\n (87.824338, 59.947933, 86.322775, 59.947933),\n (86.322775, 59.947933, 84.821213, 59.947933),\n (84.821213, 59.947933, 83.31965, 59.947933),\n (83.31965, 59.947933, 81.818088, 59.947933),\n (81.818088, 59.947933, 80.316525, 59.947933),\n (80.316525, 59.947933, 78.814963, 59.947933),\n (78.814963, 59.947933, 77.3134, 59.947933),\n (77.3134, 59.947933, 75.811838, 59.947933),\n (75.811838, 59.947933, 74.310275, 59.947933),\n (74.310275, 59.947933, 72.808713, 59.947933),\n (72.808713, 59.947933, 71.30715, 59.947933),\n (71.30715, 59.947933, 69.805588, 59.947933),\n (69.805588, 59.947933, 68.304025, 59.947933),\n (68.304025, 59.947933, 66.802463, 59.947933),\n (66.802463, 59.947933, 65.3009, 59.947933),\n (113.3509, 59.947933, 113.3509, 136.0271),\n (113.3509, 136.0271, 111.849338, 136.0271),\n (111.849338, 136.0271, 110.347775, 136.0271),\n (110.347775, 136.0271, 108.846213, 136.0271),\n (108.846213, 136.0271, 107.34465, 136.0271),\n (107.34465, 136.0271, 105.843087, 136.0271),\n (105.843087, 136.0271, 104.341525, 136.0271),\n (104.341525, 136.0271, 102.839962, 136.0271),\n (102.839962, 136.0271, 101.3384, 136.0271),\n (101.3384, 136.0271, 99.836838, 136.0271),\n (99.836838, 136.0271, 98.335275, 136.0271),\n (98.335275, 136.0271, 96.833713, 136.0271),\n (96.833713, 136.0271, 95.33215, 136.0271),\n (95.33215, 136.0271, 93.830588, 136.0271),\n (93.830588, 136.0271, 92.329025, 136.0271),\n (92.329025, 136.0271, 90.827463, 136.0271),\n (90.827463, 136.0271, 89.3259, 136.0271),\n (89.3259, 136.0271, 87.824338, 136.0271),\n (87.824338, 136.0271, 86.322775, 136.0271),\n (86.322775, 136.0271, 84.821213, 136.0271),\n (84.821213, 136.0271, 83.31965, 136.0271),\n (83.31965, 136.0271, 81.818088, 136.0271),\n (81.818088, 136.0271, 80.316525, 136.0271),\n (80.316525, 136.0271, 78.814963, 136.0271),\n (78.814963, 136.0271, 77.3134, 136.0271),\n (77.3134, 136.0271, 75.811838, 136.0271),\n (75.811838, 136.0271, 74.310275, 136.0271),\n (74.310275, 136.0271, 72.808713, 136.0271),\n (72.808713, 136.0271, 71.30715, 136.0271),\n (71.30715, 136.0271, 69.805588, 136.0271),\n (69.805588, 136.0271, 68.304025, 136.0271),\n (68.304025, 136.0271, 66.802463, 136.0271),\n (66.802463, 136.0271, 65.3009, 136.0271),\n (65.3009, 136.0271, 65.3009, 59.947933),\n (127.3509, 150.0271, 127.3509, 151.528662),\n (127.3509, 151.528662, 127.3509, 153.030225),\n (127.3509, 153.030225, 127.3509, 154.531788),\n (127.3509, 154.531788, 127.3509, 156.03335),\n (127.3509, 156.03335, 127.3509, 157.534912),\n (127.3509, 157.534912, 127.3509, 159.036475),\n (127.3509, 159.036475, 127.3509, 160.538038),\n (127.3509, 160.538038, 127.3509, 162.0396),\n (127.3509, 162.0396, 127.3509, 163.541162),\n (127.3509, 163.541162, 127.3509, 165.042725),\n (127.3509, 165.042725, 127.3509, 166.544287),\n (127.3509, 166.544287, 127.3509, 168.04585),\n (127.3509, 168.04585, 127.3509, 169.547412),\n (127.3509, 169.547412, 127.3509, 171.048975),\n (127.3509, 171.048975, 127.3509, 172.550537),\n (127.3509, 172.550537, 127.3509, 174.0521),\n (127.3509, 174.0521, 127.3509, 175.553663),\n (127.3509, 175.553663, 127.3509, 177.055225),\n (127.3509, 177.055225, 127.3509, 178.556787),\n (127.3509, 178.556787, 127.3509, 180.05835),\n (127.3509, 180.05835, 127.3509, 181.559912),\n (127.3509, 181.559912, 127.3509, 183.061475),\n (127.3509, 183.061475, 127.3509, 184.563037),\n (127.3509, 184.563037, 127.3509, 186.0646),\n (127.3509, 186.0646, 127.3509, 187.566162),\n (127.3509, 187.566162, 127.3509, 189.067725),\n (127.3509, 189.067725, 127.3509, 190.569287),\n (127.3509, 190.569287, 127.3509, 192.07085),\n (127.3509, 192.07085, 127.3509, 193.572412),\n (127.3509, 193.572412, 127.3509, 195.073975),\n (127.3509, 195.073975, 127.3509, 196.575537),\n (127.3509, 196.575537, 127.3509, 198.0771),\n (203.430067, 150.0271, 203.430067, 151.528662),\n (203.430067, 151.528662, 203.430067, 153.030225),\n (203.430067, 153.030225, 203.430067, 154.531788),\n (203.430067, 154.531788, 203.430067, 156.03335),\n (203.430067, 156.03335, 203.430067, 157.534912),\n (203.430067, 157.534912, 203.430067, 159.036475),\n (203.430067, 159.036475, 203.430067, 160.538038),\n (203.430067, 160.538038, 203.430067, 162.0396),\n (203.430067, 162.0396, 203.430067, 163.541162),\n (203.430067, 163.541162, 203.430067, 165.042725),\n (203.430067, 165.042725, 203.430067, 166.544287),\n (203.430067, 166.544287, 203.430067, 168.04585),\n (203.430067, 168.04585, 203.430067, 169.547412),\n (203.430067, 169.547412, 203.430067, 171.048975),\n (203.430067, 171.048975, 203.430067, 172.550537),\n (203.430067, 172.550537, 203.430067, 174.0521),\n (203.430067, 174.0521, 203.430067, 175.553663),\n (203.430067, 175.553663, 203.430067, 177.055225),\n (203.430067, 177.055225, 203.430067, 178.556787),\n (203.430067, 178.556787, 203.430067, 180.05835),\n (203.430067, 180.05835, 203.430067, 181.559912),\n (203.430067, 181.559912, 203.430067, 183.061475),\n (203.430067, 183.061475, 203.430067, 184.563037),\n (203.430067, 184.563037, 203.430067, 186.0646),\n (203.430067, 186.0646, 203.430067, 187.566162),\n (203.430067, 187.566162, 203.430067, 189.067725),\n (203.430067, 189.067725, 203.430067, 190.569287),\n (203.430067, 190.569287, 203.430067, 192.07085),\n (203.430067, 192.07085, 203.430067, 193.572412),\n (203.430067, 193.572412, 203.430067, 195.073975),\n (203.430067, 195.073975, 203.430067, 196.575537),\n (203.430067, 196.575537, 203.430067, 198.0771),\n (203.430067, 150.0271, 127.3509, 150.0271),\n (203.430067, 198.0771, 127.3509, 198.0771)\n]\nVISIBLE_CIRCLES = [\n (89.3259, 174.0521, 24.025),\n (89.3259, 174.0521, 12.513021)\n]\nVISIBLE_ARCS = [\n\n]\nHIDDEN_SEGMENTS = [\n (101.8389, 136.0271, 101.8389, 59.9479),\n (76.8129, 59.9479, 76.8129, 136.0271),\n (203.4301, 186.5651, 127.3509, 186.5651),\n (203.4301, 161.5391, 127.3509, 161.5391)\n]\n# (orient, text, p1, p2, base) for linear; (orient, text, center, radius, angle) for diameter\nDIMENSIONS = [\n ('diameter', '%%c100', (89.3259, 174.0521), 24.025, 45),\n ('diameter', '%%c52.0833', (89.3259, 174.0521), 12.513, 135),\n ('horizontal', '158.333', (127.3509, 174.0521), (203.4301, 174.0521), (165.3905, 185.0521))\n]\n\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\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\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,\n angle=(0 if d[0] == \"horizontal\" else 90),\n 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,\n text=text, dimstyle=\"EZDXF\").render()\n\n doc.saveas(out_path)\n\n\nif __name__ == \"__main__\":\n out = sys.argv[1] if len(sys.argv) > 1 else \"0018_00181695_gt.dxf\"\n draw(out)\n print(\"wrote\", out)\n```"}], "images": ["images/0018_00181695.png"], "id": "0018_00181695"} {"messages": [{"role": "user", "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 50 mm. It is extruded to a thickness of 5.15 mm."}, {"role": "assistant", "content": "```python\n#!/usr/bin/env python3\n# -*- coding: utf-8 -*-\n# Ground-truth 2D engineering drawing for part: 0020_00209041\n# Self-contained: reproduces the three-view DXF via ezdxf, NO FreeCAD needed.\n# Coordinates are A4 page millimetres (scale=0.7347, page=[297.0, 210.0]).\n# visible edges -> solid (layer OUTLINE); hidden edges -> dashed (layer HIDDEN)\n# dimensions -> real movable DIMENSION entities (text = true mm value)\n# Run: python 0020_00209041_gt.py [out.dxf]\nimport sys\nimport ezdxf\n\nSCALE = 0.7347\nPAGE = [297.0, 210.0]\n\nVISIBLE_SEGMENTS = [\n (155.6726, 91.632497, 155.6726, 87.845795),\n (82.2026, 87.845795, 84.498537, 87.845795),\n (84.498537, 87.845795, 86.794475, 87.845795),\n (86.794475, 87.845795, 89.090412, 87.845795),\n (89.090412, 87.845795, 91.38635, 87.845795),\n (91.38635, 87.845795, 93.682288, 87.845795),\n (93.682288, 87.845795, 95.978225, 87.845795),\n (95.978225, 87.845795, 98.274163, 87.845795),\n (98.274163, 87.845795, 100.5701, 87.845795),\n (100.5701, 87.845795, 102.866038, 87.845795),\n (102.866038, 87.845795, 105.161975, 87.845795),\n (105.161975, 87.845795, 107.457913, 87.845795),\n (107.457913, 87.845795, 109.75385, 87.845795),\n (109.75385, 87.845795, 112.049788, 87.845795),\n (112.049788, 87.845795, 114.345725, 87.845795),\n (114.345725, 87.845795, 116.641663, 87.845795),\n (116.641663, 87.845795, 118.9376, 87.845795),\n (118.9376, 87.845795, 121.233537, 87.845795),\n (121.233537, 87.845795, 123.529475, 87.845795),\n (123.529475, 87.845795, 125.825412, 87.845795),\n (125.825412, 87.845795, 128.12135, 87.845795),\n (128.12135, 87.845795, 130.417288, 87.845795),\n (130.417288, 87.845795, 132.713225, 87.845795),\n (132.713225, 87.845795, 135.009163, 87.845795),\n (135.009163, 87.845795, 137.3051, 87.845795),\n (137.3051, 87.845795, 139.601038, 87.845795),\n (139.601038, 87.845795, 141.896975, 87.845795),\n (141.896975, 87.845795, 144.192913, 87.845795),\n (144.192913, 87.845795, 146.48885, 87.845795),\n (146.48885, 87.845795, 148.784788, 87.845795),\n (148.784788, 87.845795, 151.080725, 87.845795),\n (151.080725, 87.845795, 153.376663, 87.845795),\n (153.376663, 87.845795, 155.6726, 87.845795),\n (155.6726, 91.632497, 155.6726, 95.4192),\n (82.2026, 95.4192, 84.498537, 95.4192),\n (84.498537, 95.4192, 86.794475, 95.4192),\n (86.794475, 95.4192, 89.090412, 95.4192),\n (89.090412, 95.4192, 91.38635, 95.4192),\n (91.38635, 95.4192, 93.682288, 95.4192),\n (93.682288, 95.4192, 95.978225, 95.4192),\n (95.978225, 95.4192, 98.274163, 95.4192),\n (98.274163, 95.4192, 100.5701, 95.4192),\n (100.5701, 95.4192, 102.866038, 95.4192),\n (102.866038, 95.4192, 105.161975, 95.4192),\n (105.161975, 95.4192, 107.457913, 95.4192),\n (107.457913, 95.4192, 109.75385, 95.4192),\n (109.75385, 95.4192, 112.049788, 95.4192),\n (112.049788, 95.4192, 114.345725, 95.4192),\n (114.345725, 95.4192, 116.641663, 95.4192),\n (116.641663, 95.4192, 118.9376, 95.4192),\n (118.9376, 95.4192, 121.233537, 95.4192),\n (121.233537, 95.4192, 123.529475, 95.4192),\n (123.529475, 95.4192, 125.825412, 95.4192),\n (125.825412, 95.4192, 128.12135, 95.4192),\n (128.12135, 95.4192, 130.417288, 95.4192),\n (130.417288, 95.4192, 132.713225, 95.4192),\n (132.713225, 95.4192, 135.009163, 95.4192),\n (135.009163, 95.4192, 137.3051, 95.4192),\n (137.3051, 95.4192, 139.601038, 95.4192),\n (139.601038, 95.4192, 141.896975, 95.4192),\n (141.896975, 95.4192, 144.192913, 95.4192),\n (144.192913, 95.4192, 146.48885, 95.4192),\n (146.48885, 95.4192, 148.784788, 95.4192),\n (148.784788, 95.4192, 151.080725, 95.4192),\n (151.080725, 95.4192, 153.376663, 95.4192),\n (153.376663, 95.4192, 155.6726, 95.4192),\n (82.2026, 87.845795, 82.2026, 91.632497),\n (82.2026, 95.4192, 82.2026, 91.632497),\n (169.6726, 182.8892, 169.6726, 180.593263),\n (169.6726, 180.593263, 169.6726, 178.297325),\n (169.6726, 178.297325, 169.6726, 176.001388),\n (169.6726, 176.001388, 169.6726, 173.70545),\n (169.6726, 173.70545, 169.6726, 171.409513),\n (169.6726, 171.409513, 169.6726, 169.113575),\n (169.6726, 169.113575, 169.6726, 166.817638),\n (169.6726, 166.817638, 169.6726, 164.5217),\n (169.6726, 164.5217, 169.6726, 162.225763),\n (169.6726, 162.225763, 169.6726, 159.929825),\n (169.6726, 159.929825, 169.6726, 157.633888),\n (169.6726, 157.633888, 169.6726, 155.33795),\n (169.6726, 155.33795, 169.6726, 153.042013),\n (169.6726, 153.042013, 169.6726, 150.746075),\n (169.6726, 150.746075, 169.6726, 148.450138),\n (169.6726, 148.450138, 169.6726, 146.1542),\n (169.6726, 146.1542, 169.6726, 143.858262),\n (169.6726, 143.858262, 169.6726, 141.562325),\n (169.6726, 141.562325, 169.6726, 139.266388),\n (169.6726, 139.266388, 169.6726, 136.97045),\n (169.6726, 136.97045, 169.6726, 134.674513),\n (169.6726, 134.674513, 169.6726, 132.378575),\n (169.6726, 132.378575, 169.6726, 130.082638),\n (169.6726, 130.082638, 169.6726, 127.7867),\n (169.6726, 127.7867, 169.6726, 125.490763),\n (169.6726, 125.490763, 169.6726, 123.194825),\n (169.6726, 123.194825, 169.6726, 120.898888),\n (169.6726, 120.898888, 169.6726, 118.60295),\n (169.6726, 118.60295, 169.6726, 116.307013),\n (169.6726, 116.307013, 169.6726, 114.011075),\n (169.6726, 114.011075, 169.6726, 111.715138),\n (169.6726, 111.715138, 169.6726, 109.4192),\n (177.246005, 182.8892, 177.246005, 180.593263),\n (177.246005, 180.593263, 177.246005, 178.297325),\n (177.246005, 178.297325, 177.246005, 176.001387),\n (177.246005, 176.001387, 177.246005, 173.70545),\n (177.246005, 173.70545, 177.246005, 171.409513),\n (177.246005, 171.409513, 177.246005, 169.113575),\n (177.246005, 169.113575, 177.246005, 166.817637),\n (177.246005, 166.817637, 177.246005, 164.5217),\n (177.246005, 164.5217, 177.246005, 162.225763),\n (177.246005, 162.225763, 177.246005, 159.929825),\n (177.246005, 159.929825, 177.246005, 157.633888),\n (177.246005, 157.633888, 177.246005, 155.33795),\n (177.246005, 155.33795, 177.246005, 153.042013),\n (177.246005, 153.042013, 177.246005, 150.746075),\n (177.246005, 150.746075, 177.246005, 148.450138),\n (177.246005, 148.450138, 177.246005, 146.1542),\n (177.246005, 146.1542, 177.246005, 143.858262),\n (177.246005, 143.858262, 177.246005, 141.562325),\n (177.246005, 141.562325, 177.246005, 139.266388),\n (177.246005, 139.266388, 177.246005, 136.97045),\n (177.246005, 136.97045, 177.246005, 134.674513),\n (177.246005, 134.674513, 177.246005, 132.378575),\n (177.246005, 132.378575, 177.246005, 130.082638),\n (177.246005, 130.082638, 177.246005, 127.7867),\n (177.246005, 127.7867, 177.246005, 125.490763),\n (177.246005, 125.490763, 177.246005, 123.194825),\n (177.246005, 123.194825, 177.246005, 120.898888),\n (177.246005, 120.898888, 177.246005, 118.60295),\n (177.246005, 118.60295, 177.246005, 116.307013),\n (177.246005, 116.307013, 177.246005, 114.011075),\n (177.246005, 114.011075, 177.246005, 111.715138),\n (177.246005, 111.715138, 177.246005, 109.4192),\n (169.6726, 182.8892, 173.459303, 182.8892),\n (169.6726, 109.4192, 173.459303, 109.4192),\n (177.246005, 109.4192, 173.459303, 109.4192),\n (177.246005, 182.8892, 173.459303, 182.8892)\n]\nVISIBLE_CIRCLES = [\n (118.9376, 146.1542, 36.735),\n (118.9376, 146.1542, 18.3675)\n]\nVISIBLE_ARCS = [\n\n]\nHIDDEN_SEGMENTS = [\n (137.3052, 91.6325, 137.3052, 95.4192),\n (137.3052, 91.6325, 137.3052, 87.8458),\n (100.5702, 95.4192, 100.5702, 91.6325),\n (100.5702, 87.8458, 100.5702, 91.6325),\n (169.6727, 127.7867, 173.4594, 127.7867),\n (169.6727, 164.5217, 173.4594, 164.5217),\n (177.2461, 164.5217, 173.4594, 164.5217),\n (177.2461, 127.7867, 173.4594, 127.7867)\n]\n# (orient, text, p1, p2, base) for linear; (orient, text, center, radius, angle) for diameter\nDIMENSIONS = [\n ('diameter', '%%c100', (118.9376, 146.1542), 36.735, 45),\n ('diameter', '%%c50', (118.9376, 146.1542), 18.3675, 135),\n ('horizontal', '10.3082', (177.2461, 146.1542), (169.6727, 146.1542), (173.4594, 135.1542))\n]\n\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\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\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,\n angle=(0 if d[0] == \"horizontal\" else 90),\n 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,\n text=text, dimstyle=\"EZDXF\").render()\n\n doc.saveas(out_path)\n\n\nif __name__ == \"__main__\":\n out = sys.argv[1] if len(sys.argv) > 1 else \"0020_00209041_gt.dxf\"\n draw(out)\n print(\"wrote\", out)\n```"}], "images": ["images/0020_00209041.png"], "id": "0020_00209041"} {"messages": [{"role": "user", "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 84.82 mm."}, {"role": "assistant", "content": "```python\n#!/usr/bin/env python3\n# -*- coding: utf-8 -*-\n# Ground-truth 2D engineering drawing for part: 0021_00212390\n# Self-contained: reproduces the three-view DXF via ezdxf, NO FreeCAD needed.\n# Coordinates are A4 page millimetres (scale=0.5199613526570036, page=[297.0, 210.0]).\n# visible edges -> solid (layer OUTLINE); hidden edges -> dashed (layer HIDDEN)\n# dimensions -> real movable DIMENSION entities (text = true mm value)\n# Run: python 0021_00212390_gt.py [out.dxf]\nimport sys\nimport ezdxf\n\nSCALE = 0.5199613526570036\nPAGE = [297.0, 210.0]\n\nVISIBLE_SEGMENTS = [\n (129.342768, 74.949067, 127.717888, 74.949067),\n (127.717888, 74.949067, 126.093009, 74.949067),\n (126.093009, 74.949067, 124.46813, 74.949067),\n (124.46813, 74.949067, 122.843251, 74.949067),\n (122.843251, 74.949067, 121.218371, 74.949067),\n (121.218371, 74.949067, 119.593492, 74.949067),\n (119.593492, 74.949067, 117.968613, 74.949067),\n (117.968613, 74.949067, 116.343734, 74.949067),\n (116.343734, 74.949067, 114.718855, 74.949067),\n (114.718855, 74.949067, 113.093975, 74.949067),\n (113.093975, 74.949067, 111.469096, 74.949067),\n (111.469096, 74.949067, 109.844217, 74.949067),\n (109.844217, 74.949067, 108.219338, 74.949067),\n (108.219338, 74.949067, 106.594458, 74.949067),\n (106.594458, 74.949067, 104.969579, 74.949067),\n (104.969579, 74.949067, 103.3447, 74.949067),\n (103.3447, 74.949067, 101.719821, 74.949067),\n (101.719821, 74.949067, 100.094942, 74.949067),\n (100.094942, 74.949067, 98.470062, 74.949067),\n (98.470062, 74.949067, 96.845183, 74.949067),\n (96.845183, 74.949067, 95.220304, 74.949067),\n (95.220304, 74.949067, 93.595425, 74.949067),\n (93.595425, 74.949067, 91.970545, 74.949067),\n (91.970545, 74.949067, 90.345666, 74.949067),\n (90.345666, 74.949067, 88.720787, 74.949067),\n (88.720787, 74.949067, 87.095908, 74.949067),\n (87.095908, 74.949067, 85.471029, 74.949067),\n (85.471029, 74.949067, 83.846149, 74.949067),\n (83.846149, 74.949067, 82.22127, 74.949067),\n (82.22127, 74.949067, 80.596391, 74.949067),\n (80.596391, 74.949067, 78.971512, 74.949067),\n (78.971512, 74.949067, 77.346632, 74.949067),\n (129.342768, 74.949067, 129.342768, 119.052932),\n (129.342768, 119.052932, 127.717888, 119.052932),\n (127.717888, 119.052932, 126.093009, 119.052932),\n (126.093009, 119.052932, 124.46813, 119.052932),\n (124.46813, 119.052932, 122.843251, 119.052932),\n (122.843251, 119.052932, 121.218371, 119.052932),\n (121.218371, 119.052932, 119.593492, 119.052932),\n (119.593492, 119.052932, 117.968613, 119.052932),\n (117.968613, 119.052932, 116.343734, 119.052932),\n (116.343734, 119.052932, 114.718855, 119.052932),\n (114.718855, 119.052932, 113.093975, 119.052932),\n (113.093975, 119.052932, 111.469096, 119.052932),\n (111.469096, 119.052932, 109.844217, 119.052932),\n (109.844217, 119.052932, 108.219338, 119.052932),\n (108.219338, 119.052932, 106.594458, 119.052932),\n (106.594458, 119.052932, 104.969579, 119.052932),\n (104.969579, 119.052932, 103.3447, 119.052932),\n (103.3447, 119.052932, 101.719821, 119.052932),\n (101.719821, 119.052932, 100.094942, 119.052932),\n (100.094942, 119.052932, 98.470062, 119.052932),\n (98.470062, 119.052932, 96.845183, 119.052932),\n (96.845183, 119.052932, 95.220304, 119.052932),\n (95.220304, 119.052932, 93.595425, 119.052932),\n (93.595425, 119.052932, 91.970545, 119.052932),\n (91.970545, 119.052932, 90.345666, 119.052932),\n (90.345666, 119.052932, 88.720787, 119.052932),\n (88.720787, 119.052932, 87.095908, 119.052932),\n (87.095908, 119.052932, 85.471029, 119.052932),\n (85.471029, 119.052932, 83.846149, 119.052932),\n (83.846149, 119.052932, 82.22127, 119.052932),\n (82.22127, 119.052932, 80.596391, 119.052932),\n (80.596391, 119.052932, 78.971512, 119.052932),\n (78.971512, 119.052932, 77.346632, 119.052932),\n (77.346632, 119.052932, 77.346632, 74.949067),\n (143.342768, 133.052932, 143.342768, 134.677812),\n (143.342768, 134.677812, 143.342768, 136.302691),\n (143.342768, 136.302691, 143.342768, 137.92757),\n (143.342768, 137.92757, 143.342768, 139.552449),\n (143.342768, 139.552449, 143.342768, 141.177329),\n (143.342768, 141.177329, 143.342768, 142.802208),\n (143.342768, 142.802208, 143.342768, 144.427087),\n (143.342768, 144.427087, 143.342768, 146.051966),\n (143.342768, 146.051966, 143.342768, 147.676845),\n (143.342768, 147.676845, 143.342768, 149.301725),\n (143.342768, 149.301725, 143.342768, 150.926604),\n (143.342768, 150.926604, 143.342768, 152.551483),\n (143.342768, 152.551483, 143.342768, 154.176362),\n (143.342768, 154.176362, 143.342768, 155.801242),\n (143.342768, 155.801242, 143.342768, 157.426121),\n (143.342768, 157.426121, 143.342768, 159.051),\n (143.342768, 159.051, 143.342768, 160.675879),\n (143.342768, 160.675879, 143.342768, 162.300758),\n (143.342768, 162.300758, 143.342768, 163.925638),\n (143.342768, 163.925638, 143.342768, 165.550517),\n (143.342768, 165.550517, 143.342768, 167.175396),\n (143.342768, 167.175396, 143.342768, 168.800275),\n (143.342768, 168.800275, 143.342768, 170.425155),\n (143.342768, 170.425155, 143.342768, 172.050034),\n (143.342768, 172.050034, 143.342768, 173.674913),\n (143.342768, 173.674913, 143.342768, 175.299792),\n (143.342768, 175.299792, 143.342768, 176.924671),\n (143.342768, 176.924671, 143.342768, 178.549551),\n (143.342768, 178.549551, 143.342768, 180.17443),\n (143.342768, 180.17443, 143.342768, 181.799309),\n (143.342768, 181.799309, 143.342768, 183.424188),\n (143.342768, 183.424188, 143.342768, 185.049068),\n (187.446633, 133.052932, 187.446633, 134.677812),\n (187.446633, 134.677812, 187.446633, 136.302691),\n (187.446633, 136.302691, 187.446633, 137.92757),\n (187.446633, 137.92757, 187.446633, 139.552449),\n (187.446633, 139.552449, 187.446633, 141.177329),\n (187.446633, 141.177329, 187.446633, 142.802208),\n (187.446633, 142.802208, 187.446633, 144.427087),\n (187.446633, 144.427087, 187.446633, 146.051966),\n (187.446633, 146.051966, 187.446633, 147.676845),\n (187.446633, 147.676845, 187.446633, 149.301725),\n (187.446633, 149.301725, 187.446633, 150.926604),\n (187.446633, 150.926604, 187.446633, 152.551483),\n (187.446633, 152.551483, 187.446633, 154.176362),\n (187.446633, 154.176362, 187.446633, 155.801242),\n (187.446633, 155.801242, 187.446633, 157.426121),\n (187.446633, 157.426121, 187.446633, 159.051),\n (187.446633, 159.051, 187.446633, 160.675879),\n (187.446633, 160.675879, 187.446633, 162.300758),\n (187.446633, 162.300758, 187.446633, 163.925638),\n (187.446633, 163.925638, 187.446633, 165.550517),\n (187.446633, 165.550517, 187.446633, 167.175396),\n (187.446633, 167.175396, 187.446633, 168.800275),\n (187.446633, 168.800275, 187.446633, 170.425155),\n (187.446633, 170.425155, 187.446633, 172.050034),\n (187.446633, 172.050034, 187.446633, 173.674913),\n (187.446633, 173.674913, 187.446633, 175.299792),\n (187.446633, 175.299792, 187.446633, 176.924671),\n (187.446633, 176.924671, 187.446633, 178.549551),\n (187.446633, 178.549551, 187.446633, 180.17443),\n (187.446633, 180.17443, 187.446633, 181.799309),\n (187.446633, 181.799309, 187.446633, 183.424188),\n (187.446633, 183.424188, 187.446633, 185.049068),\n (187.446633, 133.052932, 143.342768, 133.052932),\n (187.446633, 185.049068, 143.342768, 185.049068)\n]\nVISIBLE_CIRCLES = [\n (103.3447, 159.051, 25.998068),\n (103.3447, 159.051, 18.415298)\n]\nVISIBLE_ARCS = [\n\n]\nHIDDEN_SEGMENTS = [\n (121.76, 119.0529, 121.76, 74.949),\n (84.9294, 74.949, 84.9294, 119.0529),\n (187.4467, 177.4663, 143.3428, 177.4663),\n (187.4467, 140.6357, 143.3428, 140.6357)\n]\n# (orient, text, p1, p2, base) for linear; (orient, text, center, radius, angle) for diameter\nDIMENSIONS = [\n ('diameter', '%%c100', (103.3447, 159.051), 25.9981, 45),\n ('diameter', '%%c70.8333', (103.3447, 159.051), 18.4153, 135),\n ('horizontal', '84.8214', (143.3428, 159.051), (187.4466, 159.051), (165.3947, 170.051))\n]\n\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\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\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,\n angle=(0 if d[0] == \"horizontal\" else 90),\n 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,\n text=text, dimstyle=\"EZDXF\").render()\n\n doc.saveas(out_path)\n\n\nif __name__ == \"__main__\":\n out = sys.argv[1] if len(sys.argv) > 1 else \"0021_00212390_gt.dxf\"\n draw(out)\n print(\"wrote\", out)\n```"}], "images": ["images/0021_00212390.png"], "id": "0021_00212390"} {"messages": [{"role": "user", "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 58.33 mm. It is extruded to a thickness of 16.49 mm."}, {"role": "assistant", "content": "```python\n#!/usr/bin/env python3\n# -*- coding: utf-8 -*-\n# Ground-truth 2D engineering drawing for part: 0024_00248988\n# Self-contained: reproduces the three-view DXF via ezdxf, NO FreeCAD needed.\n# Coordinates are A4 page millimetres (scale=0.7347, page=[297.0, 210.0]).\n# visible edges -> solid (layer OUTLINE); hidden edges -> dashed (layer HIDDEN)\n# dimensions -> real movable DIMENSION entities (text = true mm value)\n# Run: python 0024_00248988_gt.py [out.dxf]\nimport sys\nimport ezdxf\n\nSCALE = 0.7347\nPAGE = [297.0, 210.0]\n\nVISIBLE_SEGMENTS = [\n (79.1653, 97.6912, 81.461238, 97.6912),\n (81.461238, 97.6912, 83.757175, 97.6912),\n (83.757175, 97.6912, 86.053112, 97.6912),\n (86.053112, 97.6912, 88.34905, 97.6912),\n (88.34905, 97.6912, 90.644987, 97.6912),\n (90.644987, 97.6912, 92.940925, 97.6912),\n (92.940925, 97.6912, 95.236863, 97.6912),\n (95.236863, 97.6912, 97.5328, 97.6912),\n (97.5328, 97.6912, 99.828738, 97.6912),\n (99.828738, 97.6912, 102.124675, 97.6912),\n (102.124675, 97.6912, 104.420613, 97.6912),\n (104.420613, 97.6912, 106.71655, 97.6912),\n (106.71655, 97.6912, 109.012488, 97.6912),\n (109.012488, 97.6912, 111.308425, 97.6912),\n (111.308425, 97.6912, 113.604363, 97.6912),\n (113.604363, 97.6912, 115.9003, 97.6912),\n (115.9003, 97.6912, 118.196237, 97.6912),\n (118.196237, 97.6912, 120.492175, 97.6912),\n (120.492175, 97.6912, 122.788112, 97.6912),\n (122.788112, 97.6912, 125.08405, 97.6912),\n (125.08405, 97.6912, 127.379988, 97.6912),\n (127.379988, 97.6912, 129.675925, 97.6912),\n (129.675925, 97.6912, 131.971863, 97.6912),\n (131.971863, 97.6912, 134.2678, 97.6912),\n (134.2678, 97.6912, 136.563738, 97.6912),\n (136.563738, 97.6912, 138.859675, 97.6912),\n (138.859675, 97.6912, 141.155613, 97.6912),\n (141.155613, 97.6912, 143.45155, 97.6912),\n (143.45155, 97.6912, 145.747488, 97.6912),\n (145.747488, 97.6912, 148.043425, 97.6912),\n (148.043425, 97.6912, 150.339363, 97.6912),\n (150.339363, 97.6912, 152.6353, 97.6912),\n (152.6353, 97.6912, 152.6353, 85.573752),\n (79.1653, 85.573752, 81.461238, 85.573752),\n (81.461238, 85.573752, 83.757175, 85.573752),\n (83.757175, 85.573752, 86.053112, 85.573752),\n (86.053112, 85.573752, 88.34905, 85.573752),\n (88.34905, 85.573752, 90.644987, 85.573752),\n (90.644987, 85.573752, 92.940925, 85.573752),\n (92.940925, 85.573752, 95.236863, 85.573752),\n (95.236863, 85.573752, 97.5328, 85.573752),\n (97.5328, 85.573752, 99.828738, 85.573752),\n (99.828738, 85.573752, 102.124675, 85.573752),\n (102.124675, 85.573752, 104.420613, 85.573752),\n (104.420613, 85.573752, 106.71655, 85.573752),\n (106.71655, 85.573752, 109.012488, 85.573752),\n (109.012488, 85.573752, 111.308425, 85.573752),\n (111.308425, 85.573752, 113.604363, 85.573752),\n (113.604363, 85.573752, 115.9003, 85.573752),\n (115.9003, 85.573752, 118.196237, 85.573752),\n (118.196237, 85.573752, 120.492175, 85.573752),\n (120.492175, 85.573752, 122.788112, 85.573752),\n (122.788112, 85.573752, 125.08405, 85.573752),\n (125.08405, 85.573752, 127.379988, 85.573752),\n (127.379988, 85.573752, 129.675925, 85.573752),\n (129.675925, 85.573752, 131.971863, 85.573752),\n (131.971863, 85.573752, 134.2678, 85.573752),\n (134.2678, 85.573752, 136.563738, 85.573752),\n (136.563738, 85.573752, 138.859675, 85.573752),\n (138.859675, 85.573752, 141.155613, 85.573752),\n (141.155613, 85.573752, 143.45155, 85.573752),\n (143.45155, 85.573752, 145.747488, 85.573752),\n (145.747488, 85.573752, 148.043425, 85.573752),\n (148.043425, 85.573752, 150.339363, 85.573752),\n (150.339363, 85.573752, 152.6353, 85.573752),\n (79.1653, 85.573752, 79.1653, 97.6912),\n (178.752748, 185.1612, 178.752748, 182.865263),\n (178.752748, 182.865263, 178.752748, 180.569325),\n (178.752748, 180.569325, 178.752748, 178.273388),\n (178.752748, 178.273388, 178.752748, 175.97745),\n (178.752748, 175.97745, 178.752748, 173.681512),\n (178.752748, 173.681512, 178.752748, 171.385575),\n (178.752748, 171.385575, 178.752748, 169.089638),\n (178.752748, 169.089638, 178.752748, 166.7937),\n (178.752748, 166.7937, 178.752748, 164.497763),\n (178.752748, 164.497763, 178.752748, 162.201825),\n (178.752748, 162.201825, 178.752748, 159.905888),\n (178.752748, 159.905888, 178.752748, 157.60995),\n (178.752748, 157.60995, 178.752748, 155.314013),\n (178.752748, 155.314013, 178.752748, 153.018075),\n (178.752748, 153.018075, 178.752748, 150.722138),\n (178.752748, 150.722138, 178.752748, 148.4262),\n (178.752748, 148.4262, 178.752748, 146.130262),\n (178.752748, 146.130262, 178.752748, 143.834325),\n (178.752748, 143.834325, 178.752748, 141.538387),\n (178.752748, 141.538387, 178.752748, 139.24245),\n (178.752748, 139.24245, 178.752748, 136.946513),\n (178.752748, 136.946513, 178.752748, 134.650575),\n (178.752748, 134.650575, 178.752748, 132.354638),\n (178.752748, 132.354638, 178.752748, 130.0587),\n (178.752748, 130.0587, 178.752748, 127.762763),\n (178.752748, 127.762763, 178.752748, 125.466825),\n (178.752748, 125.466825, 178.752748, 123.170888),\n (178.752748, 123.170888, 178.752748, 120.87495),\n (178.752748, 120.87495, 178.752748, 118.579013),\n (178.752748, 118.579013, 178.752748, 116.283075),\n (178.752748, 116.283075, 178.752748, 113.987138),\n (178.752748, 113.987138, 178.752748, 111.6912),\n (166.6353, 185.1612, 166.6353, 182.865263),\n (166.6353, 182.865263, 166.6353, 180.569325),\n (166.6353, 180.569325, 166.6353, 178.273388),\n (166.6353, 178.273388, 166.6353, 175.97745),\n (166.6353, 175.97745, 166.6353, 173.681512),\n (166.6353, 173.681512, 166.6353, 171.385575),\n (166.6353, 171.385575, 166.6353, 169.089638),\n (166.6353, 169.089638, 166.6353, 166.7937),\n (166.6353, 166.7937, 166.6353, 164.497763),\n (166.6353, 164.497763, 166.6353, 162.201825),\n (166.6353, 162.201825, 166.6353, 159.905888),\n (166.6353, 159.905888, 166.6353, 157.60995),\n (166.6353, 157.60995, 166.6353, 155.314013),\n (166.6353, 155.314013, 166.6353, 153.018075),\n (166.6353, 153.018075, 166.6353, 150.722138),\n (166.6353, 150.722138, 166.6353, 148.4262),\n (166.6353, 148.4262, 166.6353, 146.130263),\n (166.6353, 146.130263, 166.6353, 143.834325),\n (166.6353, 143.834325, 166.6353, 141.538387),\n (166.6353, 141.538387, 166.6353, 139.24245),\n (166.6353, 139.24245, 166.6353, 136.946513),\n (166.6353, 136.946513, 166.6353, 134.650575),\n (166.6353, 134.650575, 166.6353, 132.354638),\n (166.6353, 132.354638, 166.6353, 130.0587),\n (166.6353, 130.0587, 166.6353, 127.762763),\n (166.6353, 127.762763, 166.6353, 125.466825),\n (166.6353, 125.466825, 166.6353, 123.170888),\n (166.6353, 123.170888, 166.6353, 120.87495),\n (166.6353, 120.87495, 166.6353, 118.579013),\n (166.6353, 118.579013, 166.6353, 116.283075),\n (166.6353, 116.283075, 166.6353, 113.987138),\n (166.6353, 113.987138, 166.6353, 111.6912),\n (166.6353, 185.1612, 178.752748, 185.1612),\n (166.6353, 111.6912, 178.752748, 111.6912)\n]\nVISIBLE_CIRCLES = [\n (115.9003, 148.4262, 36.735),\n (115.9003, 148.4262, 21.42875)\n]\nVISIBLE_ARCS = [\n\n]\nHIDDEN_SEGMENTS = [\n (137.3291, 85.5738, 137.3291, 97.6912),\n (94.4716, 97.6912, 94.4716, 85.5738),\n (166.6353, 126.9975, 178.7528, 126.9975),\n (166.6353, 169.855, 178.7528, 169.855)\n]\n# (orient, text, p1, p2, base) for linear; (orient, text, center, radius, angle) for diameter\nDIMENSIONS = [\n ('diameter', '%%c100', (115.9003, 148.4262), 36.735, 45),\n ('diameter', '%%c58.3333', (115.9003, 148.4262), 21.4287, 135),\n ('horizontal', '16.4931', (178.7528, 148.4262), (166.6353, 148.4262), (172.694, 137.4262))\n]\n\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\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\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,\n angle=(0 if d[0] == \"horizontal\" else 90),\n 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,\n text=text, dimstyle=\"EZDXF\").render()\n\n doc.saveas(out_path)\n\n\nif __name__ == \"__main__\":\n out = sys.argv[1] if len(sys.argv) > 1 else \"0024_00248988_gt.dxf\"\n draw(out)\n print(\"wrote\", out)\n```"}], "images": ["images/0024_00248988.png"], "id": "0024_00248988"} {"messages": [{"role": "user", "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 50 mm. It is extruded to a thickness of 35.89 mm."}, {"role": "assistant", "content": "```python\n#!/usr/bin/env python3\n# -*- coding: utf-8 -*-\n# Ground-truth 2D engineering drawing for part: 0025_00259926\n# Self-contained: reproduces the three-view DXF via ezdxf, NO FreeCAD needed.\n# Coordinates are A4 page millimetres (scale=0.4805, page=[297.0, 210.0]).\n# visible edges -> solid (layer OUTLINE); hidden edges -> dashed (layer HIDDEN)\n# dimensions -> real movable DIMENSION entities (text = true mm value)\n# Run: python 0025_00259926_gt.py [out.dxf]\nimport sys\nimport ezdxf\n\nSCALE = 0.4805\nPAGE = [297.0, 210.0]\n\nVISIBLE_SEGMENTS = [\n (142.894, 89.365882, 141.392437, 89.365882),\n (141.392437, 89.365882, 139.890875, 89.365882),\n (139.890875, 89.365882, 138.389313, 89.365882),\n (138.389313, 89.365882, 136.88775, 89.365882),\n (136.88775, 89.365882, 135.386188, 89.365882),\n (135.386188, 89.365882, 133.884625, 89.365882),\n (133.884625, 89.365882, 132.383062, 89.365882),\n (132.383062, 89.365882, 130.8815, 89.365882),\n (130.8815, 89.365882, 129.379938, 89.365882),\n (129.379938, 89.365882, 127.878375, 89.365882),\n (127.878375, 89.365882, 126.376812, 89.365882),\n (126.376812, 89.365882, 124.87525, 89.365882),\n (124.87525, 89.365882, 123.373688, 89.365882),\n (123.373688, 89.365882, 121.872125, 89.365882),\n (121.872125, 89.365882, 120.370563, 89.365882),\n (120.370563, 89.365882, 118.869, 89.365882),\n (118.869, 89.365882, 117.367438, 89.365882),\n (117.367438, 89.365882, 115.865875, 89.365882),\n (115.865875, 89.365882, 114.364313, 89.365882),\n (114.364313, 89.365882, 112.86275, 89.365882),\n (112.86275, 89.365882, 111.361187, 89.365882),\n (111.361187, 89.365882, 109.859625, 89.365882),\n (109.859625, 89.365882, 108.358063, 89.365882),\n (108.358063, 89.365882, 106.8565, 89.365882),\n (106.8565, 89.365882, 105.354938, 89.365882),\n (105.354938, 89.365882, 103.853375, 89.365882),\n (103.853375, 89.365882, 102.351813, 89.365882),\n (102.351813, 89.365882, 100.85025, 89.365882),\n (100.85025, 89.365882, 99.348688, 89.365882),\n (99.348688, 89.365882, 97.847125, 89.365882),\n (97.847125, 89.365882, 96.345563, 89.365882),\n (96.345563, 89.365882, 94.844, 89.365882),\n (142.894, 89.365882, 142.894, 106.6091),\n (142.894, 106.6091, 141.392437, 106.6091),\n (141.392437, 106.6091, 139.890875, 106.6091),\n (139.890875, 106.6091, 138.389313, 106.6091),\n (138.389313, 106.6091, 136.88775, 106.6091),\n (136.88775, 106.6091, 135.386188, 106.6091),\n (135.386188, 106.6091, 133.884625, 106.6091),\n (133.884625, 106.6091, 132.383062, 106.6091),\n (132.383062, 106.6091, 130.8815, 106.6091),\n (130.8815, 106.6091, 129.379938, 106.6091),\n (129.379938, 106.6091, 127.878375, 106.6091),\n (127.878375, 106.6091, 126.376812, 106.6091),\n (126.376812, 106.6091, 124.87525, 106.6091),\n (124.87525, 106.6091, 123.373688, 106.6091),\n (123.373688, 106.6091, 121.872125, 106.6091),\n (121.872125, 106.6091, 120.370563, 106.6091),\n (120.370563, 106.6091, 118.869, 106.6091),\n (118.869, 106.6091, 117.367438, 106.6091),\n (117.367438, 106.6091, 115.865875, 106.6091),\n (115.865875, 106.6091, 114.364313, 106.6091),\n (114.364313, 106.6091, 112.86275, 106.6091),\n (112.86275, 106.6091, 111.361187, 106.6091),\n (111.361187, 106.6091, 109.859625, 106.6091),\n (109.859625, 106.6091, 108.358063, 106.6091),\n (108.358063, 106.6091, 106.8565, 106.6091),\n (106.8565, 106.6091, 105.354938, 106.6091),\n (105.354938, 106.6091, 103.853375, 106.6091),\n (103.853375, 106.6091, 102.351813, 106.6091),\n (102.351813, 106.6091, 100.85025, 106.6091),\n (100.85025, 106.6091, 99.348688, 106.6091),\n (99.348688, 106.6091, 97.847125, 106.6091),\n (97.847125, 106.6091, 96.345563, 106.6091),\n (96.345563, 106.6091, 94.844, 106.6091),\n (94.844, 106.6091, 94.844, 89.365882),\n (156.894, 120.6091, 156.894, 122.110662),\n (156.894, 122.110662, 156.894, 123.612225),\n (156.894, 123.612225, 156.894, 125.113787),\n (156.894, 125.113787, 156.894, 126.61535),\n (156.894, 126.61535, 156.894, 128.116912),\n (156.894, 128.116912, 156.894, 129.618475),\n (156.894, 129.618475, 156.894, 131.120037),\n (156.894, 131.120037, 156.894, 132.6216),\n (156.894, 132.6216, 156.894, 134.123162),\n (156.894, 134.123162, 156.894, 135.624725),\n (156.894, 135.624725, 156.894, 137.126287),\n (156.894, 137.126287, 156.894, 138.62785),\n (156.894, 138.62785, 156.894, 140.129412),\n (156.894, 140.129412, 156.894, 141.630975),\n (156.894, 141.630975, 156.894, 143.132537),\n (156.894, 143.132537, 156.894, 144.6341),\n (156.894, 144.6341, 156.894, 146.135662),\n (156.894, 146.135662, 156.894, 147.637225),\n (156.894, 147.637225, 156.894, 149.138787),\n (156.894, 149.138787, 156.894, 150.64035),\n (156.894, 150.64035, 156.894, 152.141912),\n (156.894, 152.141912, 156.894, 153.643475),\n (156.894, 153.643475, 156.894, 155.145037),\n (156.894, 155.145037, 156.894, 156.6466),\n (156.894, 156.6466, 156.894, 158.148162),\n (156.894, 158.148162, 156.894, 159.649725),\n (156.894, 159.649725, 156.894, 161.151287),\n (156.894, 161.151287, 156.894, 162.65285),\n (156.894, 162.65285, 156.894, 164.154412),\n (156.894, 164.154412, 156.894, 165.655975),\n (156.894, 165.655975, 156.894, 167.157537),\n (156.894, 167.157537, 156.894, 168.6591),\n (174.137218, 120.6091, 174.137218, 122.110662),\n (174.137218, 122.110662, 174.137218, 123.612225),\n (174.137218, 123.612225, 174.137218, 125.113787),\n (174.137218, 125.113787, 174.137218, 126.61535),\n (174.137218, 126.61535, 174.137218, 128.116912),\n (174.137218, 128.116912, 174.137218, 129.618475),\n (174.137218, 129.618475, 174.137218, 131.120037),\n (174.137218, 131.120037, 174.137218, 132.6216),\n (174.137218, 132.6216, 174.137218, 134.123162),\n (174.137218, 134.123162, 174.137218, 135.624725),\n (174.137218, 135.624725, 174.137218, 137.126287),\n (174.137218, 137.126287, 174.137218, 138.62785),\n (174.137218, 138.62785, 174.137218, 140.129412),\n (174.137218, 140.129412, 174.137218, 141.630975),\n (174.137218, 141.630975, 174.137218, 143.132537),\n (174.137218, 143.132537, 174.137218, 144.6341),\n (174.137218, 144.6341, 174.137218, 146.135662),\n (174.137218, 146.135662, 174.137218, 147.637225),\n (174.137218, 147.637225, 174.137218, 149.138787),\n (174.137218, 149.138787, 174.137218, 150.64035),\n (174.137218, 150.64035, 174.137218, 152.141912),\n (174.137218, 152.141912, 174.137218, 153.643475),\n (174.137218, 153.643475, 174.137218, 155.145037),\n (174.137218, 155.145037, 174.137218, 156.6466),\n (174.137218, 156.6466, 174.137218, 158.148162),\n (174.137218, 158.148162, 174.137218, 159.649725),\n (174.137218, 159.649725, 174.137218, 161.151287),\n (174.137218, 161.151287, 174.137218, 162.65285),\n (174.137218, 162.65285, 174.137218, 164.154412),\n (174.137218, 164.154412, 174.137218, 165.655975),\n (174.137218, 165.655975, 174.137218, 167.157537),\n (174.137218, 167.157537, 174.137218, 168.6591),\n (174.137218, 120.6091, 156.894, 120.6091),\n (174.137218, 168.6591, 156.894, 168.6591)\n]\nVISIBLE_CIRCLES = [\n (118.869, 144.6341, 24.025),\n (118.869, 144.6341, 12.0125)\n]\nVISIBLE_ARCS = [\n\n]\nHIDDEN_SEGMENTS = [\n (130.8815, 106.6091, 130.8815, 89.3659),\n (106.8565, 89.3659, 106.8565, 106.6091),\n (174.1372, 156.6466, 156.894, 156.6466),\n (174.1372, 132.6216, 156.894, 132.6216)\n]\n# (orient, text, p1, p2, base) for linear; (orient, text, center, radius, angle) for diameter\nDIMENSIONS = [\n ('diameter', '%%c100', (118.869, 144.6341), 24.025, 45),\n ('diameter', '%%c50', (118.869, 144.6341), 12.0125, 135),\n ('horizontal', '35.886', (156.894, 144.6341), (174.1372, 144.6341), (165.5156, 155.6341))\n]\n\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\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\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,\n angle=(0 if d[0] == \"horizontal\" else 90),\n 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,\n text=text, dimstyle=\"EZDXF\").render()\n\n doc.saveas(out_path)\n\n\nif __name__ == \"__main__\":\n out = sys.argv[1] if len(sys.argv) > 1 else \"0025_00259926_gt.dxf\"\n draw(out)\n print(\"wrote\", out)\n```"}], "images": ["images/0025_00259926.png"], "id": "0025_00259926"} {"messages": [{"role": "user", "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 6.25 mm. It is extruded to a thickness of 24.74 mm."}, {"role": "assistant", "content": "```python\n#!/usr/bin/env python3\n# -*- coding: utf-8 -*-\n# Ground-truth 2D engineering drawing for part: 0026_00264437\n# Self-contained: reproduces the three-view DXF via ezdxf, NO FreeCAD needed.\n# Coordinates are A4 page millimetres (scale=0.7347, page=[297.0, 210.0]).\n# visible edges -> solid (layer OUTLINE); hidden edges -> dashed (layer HIDDEN)\n# dimensions -> real movable DIMENSION entities (text = true mm value)\n# Run: python 0026_00264437_gt.py [out.dxf]\nimport sys\nimport ezdxf\n\nSCALE = 0.7347\nPAGE = [297.0, 210.0]\n\nVISIBLE_SEGMENTS = [\n (80.9192, 100.7206, 83.215137, 100.7206),\n (83.215137, 100.7206, 85.511075, 100.7206),\n (85.511075, 100.7206, 87.807012, 100.7206),\n (87.807012, 100.7206, 90.10295, 100.7206),\n (90.10295, 100.7206, 92.398888, 100.7206),\n (92.398888, 100.7206, 94.694825, 100.7206),\n (94.694825, 100.7206, 96.990763, 100.7206),\n (96.990763, 100.7206, 99.2867, 100.7206),\n (99.2867, 100.7206, 101.582638, 100.7206),\n (101.582638, 100.7206, 103.878575, 100.7206),\n (103.878575, 100.7206, 106.174513, 100.7206),\n (106.174513, 100.7206, 108.47045, 100.7206),\n (108.47045, 100.7206, 110.766388, 100.7206),\n (110.766388, 100.7206, 113.062325, 100.7206),\n (113.062325, 100.7206, 115.358263, 100.7206),\n (115.358263, 100.7206, 117.6542, 100.7206),\n (117.6542, 100.7206, 119.950137, 100.7206),\n (119.950137, 100.7206, 122.246075, 100.7206),\n (122.246075, 100.7206, 124.542012, 100.7206),\n (124.542012, 100.7206, 126.83795, 100.7206),\n (126.83795, 100.7206, 129.133888, 100.7206),\n (129.133888, 100.7206, 131.429825, 100.7206),\n (131.429825, 100.7206, 133.725763, 100.7206),\n (133.725763, 100.7206, 136.0217, 100.7206),\n (136.0217, 100.7206, 138.317638, 100.7206),\n (138.317638, 100.7206, 140.613575, 100.7206),\n (140.613575, 100.7206, 142.909513, 100.7206),\n (142.909513, 100.7206, 145.20545, 100.7206),\n (145.20545, 100.7206, 147.501388, 100.7206),\n (147.501388, 100.7206, 149.797325, 100.7206),\n (149.797325, 100.7206, 152.093263, 100.7206),\n (152.093263, 100.7206, 154.3892, 100.7206),\n (154.3892, 100.7206, 154.3892, 82.544428),\n (80.9192, 82.544428, 83.215137, 82.544428),\n (83.215137, 82.544428, 85.511075, 82.544428),\n (85.511075, 82.544428, 87.807012, 82.544428),\n (87.807012, 82.544428, 90.10295, 82.544428),\n (90.10295, 82.544428, 92.398888, 82.544428),\n (92.398888, 82.544428, 94.694825, 82.544428),\n (94.694825, 82.544428, 96.990763, 82.544428),\n (96.990763, 82.544428, 99.2867, 82.544428),\n (99.2867, 82.544428, 101.582638, 82.544428),\n (101.582638, 82.544428, 103.878575, 82.544428),\n (103.878575, 82.544428, 106.174513, 82.544428),\n (106.174513, 82.544428, 108.47045, 82.544428),\n (108.47045, 82.544428, 110.766388, 82.544428),\n (110.766388, 82.544428, 113.062325, 82.544428),\n (113.062325, 82.544428, 115.358263, 82.544428),\n (115.358263, 82.544428, 117.6542, 82.544428),\n (117.6542, 82.544428, 119.950137, 82.544428),\n (119.950137, 82.544428, 122.246075, 82.544428),\n (122.246075, 82.544428, 124.542012, 82.544428),\n (124.542012, 82.544428, 126.83795, 82.544428),\n (126.83795, 82.544428, 129.133888, 82.544428),\n (129.133888, 82.544428, 131.429825, 82.544428),\n (131.429825, 82.544428, 133.725763, 82.544428),\n (133.725763, 82.544428, 136.0217, 82.544428),\n (136.0217, 82.544428, 138.317638, 82.544428),\n (138.317638, 82.544428, 140.613575, 82.544428),\n (140.613575, 82.544428, 142.909513, 82.544428),\n (142.909513, 82.544428, 145.20545, 82.544428),\n (145.20545, 82.544428, 147.501388, 82.544428),\n (147.501388, 82.544428, 149.797325, 82.544428),\n (149.797325, 82.544428, 152.093263, 82.544428),\n (152.093263, 82.544428, 154.3892, 82.544428),\n (80.9192, 82.544428, 80.9192, 100.7206),\n (186.565372, 188.1906, 186.565372, 185.894663),\n (186.565372, 185.894663, 186.565372, 183.598725),\n (186.565372, 183.598725, 186.565372, 181.302788),\n (186.565372, 181.302788, 186.565372, 179.00685),\n (186.565372, 179.00685, 186.565372, 176.710913),\n (186.565372, 176.710913, 186.565372, 174.414975),\n (186.565372, 174.414975, 186.565372, 172.119038),\n (186.565372, 172.119038, 186.565372, 169.8231),\n (186.565372, 169.8231, 186.565372, 167.527163),\n (186.565372, 167.527163, 186.565372, 165.231225),\n (186.565372, 165.231225, 186.565372, 162.935288),\n (186.565372, 162.935288, 186.565372, 160.63935),\n (186.565372, 160.63935, 186.565372, 158.343413),\n (186.565372, 158.343413, 186.565372, 156.047475),\n (186.565372, 156.047475, 186.565372, 153.751538),\n (186.565372, 153.751538, 186.565372, 151.4556),\n (186.565372, 151.4556, 186.565372, 149.159662),\n (186.565372, 149.159662, 186.565372, 146.863725),\n (186.565372, 146.863725, 186.565372, 144.567788),\n (186.565372, 144.567788, 186.565372, 142.27185),\n (186.565372, 142.27185, 186.565372, 139.975913),\n (186.565372, 139.975913, 186.565372, 137.679975),\n (186.565372, 137.679975, 186.565372, 135.384038),\n (186.565372, 135.384038, 186.565372, 133.0881),\n (186.565372, 133.0881, 186.565372, 130.792163),\n (186.565372, 130.792163, 186.565372, 128.496225),\n (186.565372, 128.496225, 186.565372, 126.200288),\n (186.565372, 126.200288, 186.565372, 123.90435),\n (186.565372, 123.90435, 186.565372, 121.608413),\n (186.565372, 121.608413, 186.565372, 119.312475),\n (186.565372, 119.312475, 186.565372, 117.016538),\n (186.565372, 117.016538, 186.565372, 114.7206),\n (168.3892, 188.1906, 168.3892, 185.894663),\n (168.3892, 185.894663, 168.3892, 183.598725),\n (168.3892, 183.598725, 168.3892, 181.302788),\n (168.3892, 181.302788, 168.3892, 179.00685),\n (168.3892, 179.00685, 168.3892, 176.710913),\n (168.3892, 176.710913, 168.3892, 174.414975),\n (168.3892, 174.414975, 168.3892, 172.119038),\n (168.3892, 172.119038, 168.3892, 169.8231),\n (168.3892, 169.8231, 168.3892, 167.527163),\n (168.3892, 167.527163, 168.3892, 165.231225),\n (168.3892, 165.231225, 168.3892, 162.935288),\n (168.3892, 162.935288, 168.3892, 160.63935),\n (168.3892, 160.63935, 168.3892, 158.343413),\n (168.3892, 158.343413, 168.3892, 156.047475),\n (168.3892, 156.047475, 168.3892, 153.751538),\n (168.3892, 153.751538, 168.3892, 151.4556),\n (168.3892, 151.4556, 168.3892, 149.159663),\n (168.3892, 149.159663, 168.3892, 146.863725),\n (168.3892, 146.863725, 168.3892, 144.567788),\n (168.3892, 144.567788, 168.3892, 142.27185),\n (168.3892, 142.27185, 168.3892, 139.975913),\n (168.3892, 139.975913, 168.3892, 137.679975),\n (168.3892, 137.679975, 168.3892, 135.384038),\n (168.3892, 135.384038, 168.3892, 133.0881),\n (168.3892, 133.0881, 168.3892, 130.792163),\n (168.3892, 130.792163, 168.3892, 128.496225),\n (168.3892, 128.496225, 168.3892, 126.200288),\n (168.3892, 126.200288, 168.3892, 123.90435),\n (168.3892, 123.90435, 168.3892, 121.608413),\n (168.3892, 121.608413, 168.3892, 119.312475),\n (168.3892, 119.312475, 168.3892, 117.016538),\n (168.3892, 117.016538, 168.3892, 114.7206),\n (168.3892, 188.1906, 186.565372, 188.1906),\n (168.3892, 114.7206, 186.565372, 114.7206)\n]\nVISIBLE_CIRCLES = [\n (117.6542, 151.4556, 36.735),\n (117.6542, 151.4556, 2.295937)\n]\nVISIBLE_ARCS = [\n\n]\nHIDDEN_SEGMENTS = [\n (119.9501, 82.5444, 119.9501, 100.7206),\n (115.3582, 100.7206, 115.3582, 82.5444),\n (168.3892, 149.1596, 186.5654, 149.1596),\n (168.3892, 153.7515, 186.5654, 153.7515)\n]\n# (orient, text, p1, p2, base) for linear; (orient, text, center, radius, angle) for diameter\nDIMENSIONS = [\n ('diameter', '%%c100', (117.6542, 151.4556), 36.735, 45),\n ('diameter', '%%c6.25', (117.6542, 151.4556), 2.2959, 135),\n ('horizontal', '24.7396', (186.5654, 151.4556), (168.3892, 151.4556), (177.4773, 140.4556))\n]\n\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\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\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,\n angle=(0 if d[0] == \"horizontal\" else 90),\n 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,\n text=text, dimstyle=\"EZDXF\").render()\n\n doc.saveas(out_path)\n\n\nif __name__ == \"__main__\":\n out = sys.argv[1] if len(sys.argv) > 1 else \"0026_00264437_gt.dxf\"\n draw(out)\n print(\"wrote\", out)\n```"}], "images": ["images/0026_00264437.png"], "id": "0026_00264437"} {"messages": [{"role": "user", "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 2 circular holes (diameters 6.25, 10.42 mm). It is extruded to a thickness of 6.18 mm."}, {"role": "assistant", "content": "```python\n#!/usr/bin/env python3\n# -*- coding: utf-8 -*-\n# Ground-truth 2D engineering drawing for part: 0028_00284567\n# Self-contained: reproduces the three-view DXF via ezdxf, NO FreeCAD needed.\n# Coordinates are A4 page millimetres (scale=0.4805, page=[297.0, 210.0]).\n# visible edges -> solid (layer OUTLINE); hidden edges -> dashed (layer HIDDEN)\n# dimensions -> real movable DIMENSION entities (text = true mm value)\n# Run: python 0028_00284567_gt.py [out.dxf]\nimport sys\nimport ezdxf\n\nSCALE = 0.4805\nPAGE = [297.0, 210.0]\n\nVISIBLE_SEGMENTS = [\n (152.40719, 96.501557, 150.905628, 96.501557),\n (150.905628, 96.501557, 149.404065, 96.501557),\n (149.404065, 96.501557, 147.902503, 96.501557),\n (147.902503, 96.501557, 146.40094, 96.501557),\n (146.40094, 96.501557, 144.899378, 96.501557),\n (144.899378, 96.501557, 143.397815, 96.501557),\n (143.397815, 96.501557, 141.896253, 96.501557),\n (141.896253, 96.501557, 140.39469, 96.501557),\n (140.39469, 96.501557, 138.893128, 96.501557),\n (138.893128, 96.501557, 137.391565, 96.501557),\n (137.391565, 96.501557, 135.890003, 96.501557),\n (135.890003, 96.501557, 134.38844, 96.501557),\n (134.38844, 96.501557, 132.886878, 96.501557),\n (132.886878, 96.501557, 131.385315, 96.501557),\n (131.385315, 96.501557, 129.883753, 96.501557),\n (129.883753, 96.501557, 128.38219, 96.501557),\n (128.38219, 96.501557, 126.880628, 96.501557),\n (126.880628, 96.501557, 125.379065, 96.501557),\n (125.379065, 96.501557, 123.877503, 96.501557),\n (123.877503, 96.501557, 122.37594, 96.501557),\n (122.37594, 96.501557, 120.874378, 96.501557),\n (120.874378, 96.501557, 119.372815, 96.501557),\n (119.372815, 96.501557, 117.871253, 96.501557),\n (117.871253, 96.501557, 116.36969, 96.501557),\n (116.36969, 96.501557, 114.868128, 96.501557),\n (114.868128, 96.501557, 113.366565, 96.501557),\n (113.366565, 96.501557, 111.865003, 96.501557),\n (111.865003, 96.501557, 110.36344, 96.501557),\n (110.36344, 96.501557, 108.861878, 96.501557),\n (108.861878, 96.501557, 107.360315, 96.501557),\n (107.360315, 96.501557, 105.858753, 96.501557),\n (105.858753, 96.501557, 104.35719, 96.501557),\n (152.40719, 96.501557, 152.40719, 99.4734),\n (152.40719, 99.4734, 150.905628, 99.4734),\n (150.905628, 99.4734, 149.404065, 99.4734),\n (149.404065, 99.4734, 147.902503, 99.4734),\n (147.902503, 99.4734, 146.40094, 99.4734),\n (146.40094, 99.4734, 144.899378, 99.4734),\n (144.899378, 99.4734, 143.397815, 99.4734),\n (143.397815, 99.4734, 141.896253, 99.4734),\n (141.896253, 99.4734, 140.39469, 99.4734),\n (140.39469, 99.4734, 138.893128, 99.4734),\n (138.893128, 99.4734, 137.391565, 99.4734),\n (137.391565, 99.4734, 135.890003, 99.4734),\n (135.890003, 99.4734, 134.38844, 99.4734),\n (134.38844, 99.4734, 132.886878, 99.4734),\n (132.886878, 99.4734, 131.385315, 99.4734),\n (131.385315, 99.4734, 129.883753, 99.4734),\n (129.883753, 99.4734, 128.38219, 99.4734),\n (128.38219, 99.4734, 126.880628, 99.4734),\n (126.880628, 99.4734, 125.379065, 99.4734),\n (125.379065, 99.4734, 123.877503, 99.4734),\n (123.877503, 99.4734, 122.37594, 99.4734),\n (122.37594, 99.4734, 120.874378, 99.4734),\n (120.874378, 99.4734, 119.372815, 99.4734),\n (119.372815, 99.4734, 117.871253, 99.4734),\n (117.871253, 99.4734, 116.36969, 99.4734),\n (116.36969, 99.4734, 114.868128, 99.4734),\n (114.868128, 99.4734, 113.366565, 99.4734),\n (113.366565, 99.4734, 111.865003, 99.4734),\n (111.865003, 99.4734, 110.36344, 99.4734),\n (110.36344, 99.4734, 108.861878, 99.4734),\n (108.861878, 99.4734, 107.360315, 99.4734),\n (107.360315, 99.4734, 105.858753, 99.4734),\n (105.858753, 99.4734, 104.35719, 99.4734),\n (104.35719, 99.4734, 104.35719, 96.501557),\n (166.40719, 113.4734, 166.40719, 114.974963),\n (166.40719, 114.974963, 166.40719, 116.476525),\n (166.40719, 116.476525, 166.40719, 117.978088),\n (166.40719, 117.978088, 166.40719, 119.47965),\n (166.40719, 119.47965, 166.40719, 120.981212),\n (166.40719, 120.981212, 166.40719, 122.482775),\n (166.40719, 122.482775, 166.40719, 123.984338),\n (166.40719, 123.984338, 166.40719, 125.4859),\n (166.40719, 125.4859, 166.40719, 126.987463),\n (166.40719, 126.987463, 166.40719, 128.489025),\n (166.40719, 128.489025, 166.40719, 129.990588),\n (166.40719, 129.990588, 166.40719, 131.49215),\n (166.40719, 131.49215, 166.40719, 132.993712),\n (166.40719, 132.993712, 166.40719, 134.495275),\n (166.40719, 134.495275, 166.40719, 135.996837),\n (166.40719, 135.996837, 166.40719, 137.4984),\n (166.40719, 137.4984, 166.40719, 138.999963),\n (166.40719, 138.999963, 166.40719, 140.501525),\n (166.40719, 140.501525, 166.40719, 142.003087),\n (166.40719, 142.003087, 166.40719, 143.50465),\n (166.40719, 143.50465, 166.40719, 145.006213),\n (166.40719, 145.006213, 166.40719, 146.507775),\n (166.40719, 146.507775, 166.40719, 148.009337),\n (166.40719, 148.009337, 166.40719, 149.5109),\n (166.40719, 149.5109, 166.40719, 151.012462),\n (166.40719, 151.012462, 166.40719, 152.514025),\n (166.40719, 152.514025, 166.40719, 154.015587),\n (166.40719, 154.015587, 166.40719, 155.51715),\n (166.40719, 155.51715, 166.40719, 157.018712),\n (166.40719, 157.018712, 166.40719, 158.520275),\n (166.40719, 158.520275, 166.40719, 160.021837),\n (166.40719, 160.021837, 166.40719, 161.5234),\n (169.379033, 113.4734, 169.379033, 114.974963),\n (169.379033, 114.974963, 169.379033, 116.476525),\n (169.379033, 116.476525, 169.379033, 117.978088),\n (169.379033, 117.978088, 169.379033, 119.47965),\n (169.379033, 119.47965, 169.379033, 120.981212),\n (169.379033, 120.981212, 169.379033, 122.482775),\n (169.379033, 122.482775, 169.379033, 123.984338),\n (169.379033, 123.984338, 169.379033, 125.4859),\n (169.379033, 125.4859, 169.379033, 126.987463),\n (169.379033, 126.987463, 169.379033, 128.489025),\n (169.379033, 128.489025, 169.379033, 129.990588),\n (169.379033, 129.990588, 169.379033, 131.49215),\n (169.379033, 131.49215, 169.379033, 132.993712),\n (169.379033, 132.993712, 169.379033, 134.495275),\n (169.379033, 134.495275, 169.379033, 135.996837),\n (169.379033, 135.996837, 169.379033, 137.4984),\n (169.379033, 137.4984, 169.379033, 138.999963),\n (169.379033, 138.999963, 169.379033, 140.501525),\n (169.379033, 140.501525, 169.379033, 142.003087),\n (169.379033, 142.003087, 169.379033, 143.50465),\n (169.379033, 143.50465, 169.379033, 145.006213),\n (169.379033, 145.006213, 169.379033, 146.507775),\n (169.379033, 146.507775, 169.379033, 148.009337),\n (169.379033, 148.009337, 169.379033, 149.5109),\n (169.379033, 149.5109, 169.379033, 151.012462),\n (169.379033, 151.012462, 169.379033, 152.514025),\n (169.379033, 152.514025, 169.379033, 154.015587),\n (169.379033, 154.015587, 169.379033, 155.51715),\n (169.379033, 155.51715, 169.379033, 157.018712),\n (169.379033, 157.018712, 169.379033, 158.520275),\n (169.379033, 158.520275, 169.379033, 160.021837),\n (169.379033, 160.021837, 169.379033, 161.5234),\n (169.379033, 113.4734, 166.40719, 113.4734),\n (169.379033, 161.5234, 166.40719, 161.5234)\n]\nVISIBLE_CIRCLES = [\n (128.38219, 137.4984, 24.025),\n (128.38219, 137.4984, 2.502604),\n (133.887919, 137.4984, 1.501562)\n]\nVISIBLE_ARCS = [\n\n]\nHIDDEN_SEGMENTS = [\n (130.8848, 99.4734, 130.8848, 96.5016),\n (135.3895, 99.4734, 135.3895, 96.5016),\n (125.8796, 96.5016, 125.8796, 99.4734),\n (132.3863, 96.5016, 132.3863, 99.4734),\n (169.379, 140.001, 166.4072, 140.001),\n (169.379, 134.9958, 166.4072, 134.9958),\n (169.379, 139.0, 166.4072, 139.0),\n (169.379, 135.9969, 166.4072, 135.9969)\n]\n# (orient, text, p1, p2, base) for linear; (orient, text, center, radius, angle) for diameter\nDIMENSIONS = [\n ('diameter', '%%c100', (128.3822, 137.4984), 24.025, 45),\n ('diameter', '%%c10.4167', (128.3822, 137.4984), 2.5026, 135),\n ('diameter', '%%c6.25', (133.8879, 137.4984), 1.5016, 45),\n ('horizontal', '11.4583', (128.3822, 137.4984), (133.8879, 137.4984), (131.135, 148.4984)),\n ('horizontal', '6.1849', (166.4072, 137.4984), (169.379, 137.4984), (167.8931, 148.4984))\n]\n\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\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\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,\n angle=(0 if d[0] == \"horizontal\" else 90),\n 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,\n text=text, dimstyle=\"EZDXF\").render()\n\n doc.saveas(out_path)\n\n\nif __name__ == \"__main__\":\n out = sys.argv[1] if len(sys.argv) > 1 else \"0028_00284567_gt.dxf\"\n draw(out)\n print(\"wrote\", out)\n```"}], "images": ["images/0028_00284567.png"], "id": "0028_00284567"} {"messages": [{"role": "user", "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 93.75 mm. It is extruded to a thickness of 452.38 mm."}, {"role": "assistant", "content": "```python\n#!/usr/bin/env python3\n# -*- coding: utf-8 -*-\n# Ground-truth 2D engineering drawing for part: 0028_00286423\n# Self-contained: reproduces the three-view DXF via ezdxf, NO FreeCAD needed.\n# Coordinates are A4 page millimetres (scale=0.09564454976303838, page=[297.0, 210.0]).\n# visible edges -> solid (layer OUTLINE); hidden edges -> dashed (layer HIDDEN)\n# dimensions -> real movable DIMENSION entities (text = true mm value)\n# Run: python 0028_00286423_gt.py [out.dxf]\nimport sys\nimport ezdxf\n\nSCALE = 0.09564454976303838\nPAGE = [297.0, 210.0]\n\nVISIBLE_SEGMENTS = [\n (95.698027, 107.6089, 95.698027, 64.341127),\n (86.133573, 64.341127, 86.432462, 64.341127),\n (86.432462, 64.341127, 86.731351, 64.341127),\n (86.731351, 64.341127, 87.03024, 64.341127),\n (87.03024, 64.341127, 87.329129, 64.341127),\n (87.329129, 64.341127, 87.628019, 64.341127),\n (87.628019, 64.341127, 87.926908, 64.341127),\n (87.926908, 64.341127, 88.225797, 64.341127),\n (88.225797, 64.341127, 88.524686, 64.341127),\n (88.524686, 64.341127, 88.823575, 64.341127),\n (88.823575, 64.341127, 89.122465, 64.341127),\n (89.122465, 64.341127, 89.421354, 64.341127),\n (89.421354, 64.341127, 89.720243, 64.341127),\n (89.720243, 64.341127, 90.019132, 64.341127),\n (90.019132, 64.341127, 90.318022, 64.341127),\n (90.318022, 64.341127, 90.616911, 64.341127),\n (90.616911, 64.341127, 90.9158, 64.341127),\n (90.9158, 64.341127, 91.214689, 64.341127),\n (91.214689, 64.341127, 91.513578, 64.341127),\n (91.513578, 64.341127, 91.812468, 64.341127),\n (91.812468, 64.341127, 92.111357, 64.341127),\n (92.111357, 64.341127, 92.410246, 64.341127),\n (92.410246, 64.341127, 92.709135, 64.341127),\n (92.709135, 64.341127, 93.008025, 64.341127),\n (93.008025, 64.341127, 93.306914, 64.341127),\n (93.306914, 64.341127, 93.605803, 64.341127),\n (93.605803, 64.341127, 93.904692, 64.341127),\n (93.904692, 64.341127, 94.203581, 64.341127),\n (94.203581, 64.341127, 94.502471, 64.341127),\n (94.502471, 64.341127, 94.80136, 64.341127),\n (94.80136, 64.341127, 95.100249, 64.341127),\n (95.100249, 64.341127, 95.399138, 64.341127),\n (95.399138, 64.341127, 95.698027, 64.341127),\n (95.698027, 107.6089, 95.698027, 150.876672),\n (86.133573, 150.876672, 86.432462, 150.876672),\n (86.432462, 150.876672, 86.731351, 150.876672),\n (86.731351, 150.876672, 87.03024, 150.876672),\n (87.03024, 150.876672, 87.329129, 150.876672),\n (87.329129, 150.876672, 87.628019, 150.876672),\n (87.628019, 150.876672, 87.926908, 150.876672),\n (87.926908, 150.876672, 88.225797, 150.876672),\n (88.225797, 150.876672, 88.524686, 150.876672),\n (88.524686, 150.876672, 88.823575, 150.876672),\n (88.823575, 150.876672, 89.122465, 150.876672),\n (89.122465, 150.876672, 89.421354, 150.876672),\n (89.421354, 150.876672, 89.720243, 150.876672),\n (89.720243, 150.876672, 90.019132, 150.876672),\n (90.019132, 150.876672, 90.318022, 150.876672),\n (90.318022, 150.876672, 90.616911, 150.876672),\n (90.616911, 150.876672, 90.9158, 150.876672),\n (90.9158, 150.876672, 91.214689, 150.876672),\n (91.214689, 150.876672, 91.513578, 150.876672),\n (91.513578, 150.876672, 91.812468, 150.876672),\n (91.812468, 150.876672, 92.111357, 150.876672),\n (92.111357, 150.876672, 92.410246, 150.876672),\n (92.410246, 150.876672, 92.709135, 150.876672),\n (92.709135, 150.876672, 93.008025, 150.876672),\n (93.008025, 150.876672, 93.306914, 150.876672),\n (93.306914, 150.876672, 93.605803, 150.876672),\n (93.605803, 150.876672, 93.904692, 150.876672),\n (93.904692, 150.876672, 94.203581, 150.876672),\n (94.203581, 150.876672, 94.502471, 150.876672),\n (94.502471, 150.876672, 94.80136, 150.876672),\n (94.80136, 150.876672, 95.100249, 150.876672),\n (95.100249, 150.876672, 95.399138, 150.876672),\n (95.399138, 150.876672, 95.698027, 150.876672),\n (86.133573, 64.341127, 86.133573, 107.6089),\n (86.133573, 150.876672, 86.133573, 107.6089),\n (109.698028, 174.441127, 109.698028, 174.142238),\n (109.698028, 174.142238, 109.698028, 173.843349),\n (109.698028, 173.843349, 109.698028, 173.54446),\n (109.698028, 173.54446, 109.698028, 173.245571),\n (109.698028, 173.245571, 109.698028, 172.946681),\n (109.698028, 172.946681, 109.698028, 172.647792),\n (109.698028, 172.647792, 109.698028, 172.348903),\n (109.698028, 172.348903, 109.698028, 172.050014),\n (109.698028, 172.050014, 109.698028, 171.751125),\n (109.698028, 171.751125, 109.698028, 171.452235),\n (109.698028, 171.452235, 109.698028, 171.153346),\n (109.698028, 171.153346, 109.698028, 170.854457),\n (109.698028, 170.854457, 109.698028, 170.555568),\n (109.698028, 170.555568, 109.698028, 170.256678),\n (109.698028, 170.256678, 109.698028, 169.957789),\n (109.698028, 169.957789, 109.698028, 169.6589),\n (109.698028, 169.6589, 109.698028, 169.360011),\n (109.698028, 169.360011, 109.698028, 169.061122),\n (109.698028, 169.061122, 109.698028, 168.762232),\n (109.698028, 168.762232, 109.698028, 168.463343),\n (109.698028, 168.463343, 109.698028, 168.164454),\n (109.698028, 168.164454, 109.698028, 167.865565),\n (109.698028, 167.865565, 109.698028, 167.566675),\n (109.698028, 167.566675, 109.698028, 167.267786),\n (109.698028, 167.267786, 109.698028, 166.968897),\n (109.698028, 166.968897, 109.698028, 166.670008),\n (109.698028, 166.670008, 109.698028, 166.371119),\n (109.698028, 166.371119, 109.698028, 166.072229),\n (109.698028, 166.072229, 109.698028, 165.77334),\n (109.698028, 165.77334, 109.698028, 165.474451),\n (109.698028, 165.474451, 109.698028, 165.175562),\n (109.698028, 165.175562, 109.698028, 164.876673),\n (196.233573, 174.441127, 196.233573, 174.142238),\n (196.233573, 174.142238, 196.233573, 173.843349),\n (196.233573, 173.843349, 196.233573, 173.54446),\n (196.233573, 173.54446, 196.233573, 173.245571),\n (196.233573, 173.245571, 196.233573, 172.946681),\n (196.233573, 172.946681, 196.233573, 172.647792),\n (196.233573, 172.647792, 196.233573, 172.348903),\n (196.233573, 172.348903, 196.233573, 172.050014),\n (196.233573, 172.050014, 196.233573, 171.751125),\n (196.233573, 171.751125, 196.233573, 171.452235),\n (196.233573, 171.452235, 196.233573, 171.153346),\n (196.233573, 171.153346, 196.233573, 170.854457),\n (196.233573, 170.854457, 196.233573, 170.555568),\n (196.233573, 170.555568, 196.233573, 170.256678),\n (196.233573, 170.256678, 196.233573, 169.957789),\n (196.233573, 169.957789, 196.233573, 169.6589),\n (196.233573, 169.6589, 196.233573, 169.360011),\n (196.233573, 169.360011, 196.233573, 169.061122),\n (196.233573, 169.061122, 196.233573, 168.762232),\n (196.233573, 168.762232, 196.233573, 168.463343),\n (196.233573, 168.463343, 196.233573, 168.164454),\n (196.233573, 168.164454, 196.233573, 167.865565),\n (196.233573, 167.865565, 196.233573, 167.566675),\n (196.233573, 167.566675, 196.233573, 167.267786),\n (196.233573, 167.267786, 196.233573, 166.968897),\n (196.233573, 166.968897, 196.233573, 166.670008),\n (196.233573, 166.670008, 196.233573, 166.371119),\n (196.233573, 166.371119, 196.233573, 166.072229),\n (196.233573, 166.072229, 196.233573, 165.77334),\n (196.233573, 165.77334, 196.233573, 165.474451),\n (196.233573, 165.474451, 196.233573, 165.175562),\n (196.233573, 165.175562, 196.233573, 164.876673),\n (109.698028, 174.441127, 152.9658, 174.441127),\n (109.698028, 164.876673, 152.9658, 164.876673),\n (196.233573, 164.876673, 152.9658, 164.876673),\n (196.233573, 174.441127, 152.9658, 174.441127)\n]\nVISIBLE_CIRCLES = [\n (90.9158, 169.6589, 4.782227),\n (90.9158, 169.6589, 4.483338)\n]\nVISIBLE_ARCS = [\n\n]\nHIDDEN_SEGMENTS = [\n\n]\n# (orient, text, p1, p2, base) for linear; (orient, text, center, radius, angle) for diameter\nDIMENSIONS = [\n ('diameter', '%%c100', (90.9158, 169.6589), 4.7822, 45),\n ('diameter', '%%c93.75', (90.9158, 169.6589), 4.4833, 135),\n ('horizontal', '904.762', (196.2336, 169.6589), (109.6981, 169.6589), (152.9658, 158.6589))\n]\n\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\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\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,\n angle=(0 if d[0] == \"horizontal\" else 90),\n 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,\n text=text, dimstyle=\"EZDXF\").render()\n\n doc.saveas(out_path)\n\n\nif __name__ == \"__main__\":\n out = sys.argv[1] if len(sys.argv) > 1 else \"0028_00286423_gt.dxf\"\n draw(out)\n print(\"wrote\", out)\n```"}], "images": ["images/0028_00286423.png"], "id": "0028_00286423"} {"messages": [{"role": "user", "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 22.16 mm."}, {"role": "assistant", "content": "```python\n#!/usr/bin/env python3\n# -*- coding: utf-8 -*-\n# Ground-truth 2D engineering drawing for part: 0029_00293193\n# Self-contained: reproduces the three-view DXF via ezdxf, NO FreeCAD needed.\n# Coordinates are A4 page millimetres (scale=0.7866568370564448, page=[297.0, 210.0]).\n# visible edges -> solid (layer OUTLINE); hidden edges -> dashed (layer HIDDEN)\n# dimensions -> real movable DIMENSION entities (text = true mm value)\n# Run: python 0029_00293193_gt.py [out.dxf]\nimport sys\nimport ezdxf\n\nSCALE = 0.7866568370564448\nPAGE = [297.0, 210.0]\n\nVISIBLE_SEGMENTS = [\n (151.956142, 81.616442, 149.497839, 81.616442),\n (149.497839, 81.616442, 147.039537, 81.616442),\n (147.039537, 81.616442, 144.581234, 81.616442),\n (144.581234, 81.616442, 142.122931, 81.616442),\n (142.122931, 81.616442, 139.664629, 81.616442),\n (139.664629, 81.616442, 137.206326, 81.616442),\n (137.206326, 81.616442, 134.748024, 81.616442),\n (134.748024, 81.616442, 132.289721, 81.616442),\n (132.289721, 81.616442, 129.831418, 81.616442),\n (129.831418, 81.616442, 127.373116, 81.616442),\n (127.373116, 81.616442, 124.914813, 81.616442),\n (124.914813, 81.616442, 122.45651, 81.616442),\n (122.45651, 81.616442, 119.998208, 81.616442),\n (119.998208, 81.616442, 117.539905, 81.616442),\n (117.539905, 81.616442, 115.081603, 81.616442),\n (115.081603, 81.616442, 112.6233, 81.616442),\n (112.6233, 81.616442, 110.164997, 81.616442),\n (110.164997, 81.616442, 107.706695, 81.616442),\n (107.706695, 81.616442, 105.248392, 81.616442),\n (105.248392, 81.616442, 102.79009, 81.616442),\n (102.79009, 81.616442, 100.331787, 81.616442),\n (100.331787, 81.616442, 97.873484, 81.616442),\n (97.873484, 81.616442, 95.415182, 81.616442),\n (95.415182, 81.616442, 92.956879, 81.616442),\n (92.956879, 81.616442, 90.498576, 81.616442),\n (90.498576, 81.616442, 88.040274, 81.616442),\n (88.040274, 81.616442, 85.581971, 81.616442),\n (85.581971, 81.616442, 83.123669, 81.616442),\n (83.123669, 81.616442, 80.665366, 81.616442),\n (80.665366, 81.616442, 78.207063, 81.616442),\n (78.207063, 81.616442, 75.748761, 81.616442),\n (75.748761, 81.616442, 73.290458, 81.616442),\n (151.956142, 81.616442, 151.956142, 99.050758),\n (151.956142, 99.050758, 149.497839, 99.050758),\n (149.497839, 99.050758, 147.039537, 99.050758),\n (147.039537, 99.050758, 144.581234, 99.050758),\n (144.581234, 99.050758, 142.122931, 99.050758),\n (142.122931, 99.050758, 139.664629, 99.050758),\n (139.664629, 99.050758, 137.206326, 99.050758),\n (137.206326, 99.050758, 134.748024, 99.050758),\n (134.748024, 99.050758, 132.289721, 99.050758),\n (132.289721, 99.050758, 129.831418, 99.050758),\n (129.831418, 99.050758, 127.373116, 99.050758),\n (127.373116, 99.050758, 124.914813, 99.050758),\n (124.914813, 99.050758, 122.45651, 99.050758),\n (122.45651, 99.050758, 119.998208, 99.050758),\n (119.998208, 99.050758, 117.539905, 99.050758),\n (117.539905, 99.050758, 115.081603, 99.050758),\n (115.081603, 99.050758, 112.6233, 99.050758),\n (112.6233, 99.050758, 110.164997, 99.050758),\n (110.164997, 99.050758, 107.706695, 99.050758),\n (107.706695, 99.050758, 105.248392, 99.050758),\n (105.248392, 99.050758, 102.79009, 99.050758),\n (102.79009, 99.050758, 100.331787, 99.050758),\n (100.331787, 99.050758, 97.873484, 99.050758),\n (97.873484, 99.050758, 95.415182, 99.050758),\n (95.415182, 99.050758, 92.956879, 99.050758),\n (92.956879, 99.050758, 90.498576, 99.050758),\n (90.498576, 99.050758, 88.040274, 99.050758),\n (88.040274, 99.050758, 85.581971, 99.050758),\n (85.581971, 99.050758, 83.123669, 99.050758),\n (83.123669, 99.050758, 80.665366, 99.050758),\n (80.665366, 99.050758, 78.207063, 99.050758),\n (78.207063, 99.050758, 75.748761, 99.050758),\n (75.748761, 99.050758, 73.290458, 99.050758),\n (73.290458, 99.050758, 73.290458, 81.616442),\n (165.956142, 113.050758, 165.956142, 115.509061),\n (165.956142, 115.509061, 165.956142, 117.967363),\n (165.956142, 117.967363, 165.956142, 120.425666),\n (165.956142, 120.425666, 165.956142, 122.883969),\n (165.956142, 122.883969, 165.956142, 125.342271),\n (165.956142, 125.342271, 165.956142, 127.800574),\n (165.956142, 127.800574, 165.956142, 130.258876),\n (165.956142, 130.258876, 165.956142, 132.717179),\n (165.956142, 132.717179, 165.956142, 135.175482),\n (165.956142, 135.175482, 165.956142, 137.633784),\n (165.956142, 137.633784, 165.956142, 140.092087),\n (165.956142, 140.092087, 165.956142, 142.55039),\n (165.956142, 142.55039, 165.956142, 145.008692),\n (165.956142, 145.008692, 165.956142, 147.466995),\n (165.956142, 147.466995, 165.956142, 149.925297),\n (165.956142, 149.925297, 165.956142, 152.3836),\n (165.956142, 152.3836, 165.956142, 154.841903),\n (165.956142, 154.841903, 165.956142, 157.300205),\n (165.956142, 157.300205, 165.956142, 159.758508),\n (165.956142, 159.758508, 165.956142, 162.21681),\n (165.956142, 162.21681, 165.956142, 164.675113),\n (165.956142, 164.675113, 165.956142, 167.133416),\n (165.956142, 167.133416, 165.956142, 169.591718),\n (165.956142, 169.591718, 165.956142, 172.050021),\n (165.956142, 172.050021, 165.956142, 174.508324),\n (165.956142, 174.508324, 165.956142, 176.966626),\n (165.956142, 176.966626, 165.956142, 179.424929),\n (165.956142, 179.424929, 165.956142, 181.883231),\n (165.956142, 181.883231, 165.956142, 184.341534),\n (165.956142, 184.341534, 165.956142, 186.799837),\n (165.956142, 186.799837, 165.956142, 189.258139),\n (165.956142, 189.258139, 165.956142, 191.716442),\n (183.390458, 113.050758, 183.390458, 115.509061),\n (183.390458, 115.509061, 183.390458, 117.967363),\n (183.390458, 117.967363, 183.390458, 120.425666),\n (183.390458, 120.425666, 183.390458, 122.883969),\n (183.390458, 122.883969, 183.390458, 125.342271),\n (183.390458, 125.342271, 183.390458, 127.800574),\n (183.390458, 127.800574, 183.390458, 130.258876),\n (183.390458, 130.258876, 183.390458, 132.717179),\n (183.390458, 132.717179, 183.390458, 135.175482),\n (183.390458, 135.175482, 183.390458, 137.633784),\n (183.390458, 137.633784, 183.390458, 140.092087),\n (183.390458, 140.092087, 183.390458, 142.55039),\n (183.390458, 142.55039, 183.390458, 145.008692),\n (183.390458, 145.008692, 183.390458, 147.466995),\n (183.390458, 147.466995, 183.390458, 149.925297),\n (183.390458, 149.925297, 183.390458, 152.3836),\n (183.390458, 152.3836, 183.390458, 154.841903),\n (183.390458, 154.841903, 183.390458, 157.300205),\n (183.390458, 157.300205, 183.390458, 159.758508),\n (183.390458, 159.758508, 183.390458, 162.21681),\n (183.390458, 162.21681, 183.390458, 164.675113),\n (183.390458, 164.675113, 183.390458, 167.133416),\n (183.390458, 167.133416, 183.390458, 169.591718),\n (183.390458, 169.591718, 183.390458, 172.050021),\n (183.390458, 172.050021, 183.390458, 174.508324),\n (183.390458, 174.508324, 183.390458, 176.966626),\n (183.390458, 176.966626, 183.390458, 179.424929),\n (183.390458, 179.424929, 183.390458, 181.883231),\n (183.390458, 181.883231, 183.390458, 184.341534),\n (183.390458, 184.341534, 183.390458, 186.799837),\n (183.390458, 186.799837, 183.390458, 189.258139),\n (183.390458, 189.258139, 183.390458, 191.716442),\n (183.390458, 113.050758, 165.956142, 113.050758),\n (183.390458, 191.716442, 165.956142, 191.716442)\n]\nVISIBLE_CIRCLES = [\n (112.6233, 152.3836, 39.332842),\n (112.6233, 152.3836, 21.305289)\n]\nVISIBLE_ARCS = [\n\n]\nHIDDEN_SEGMENTS = [\n (133.9286, 99.0507, 133.9286, 81.6164),\n (91.318, 81.6164, 91.318, 99.0507),\n (183.3905, 173.6889, 165.9562, 173.6889),\n (183.3905, 131.0783, 165.9562, 131.0783)\n]\n# (orient, text, p1, p2, base) for linear; (orient, text, center, radius, angle) for diameter\nDIMENSIONS = [\n ('diameter', '%%c100', (112.6233, 152.3836), 39.3328, 45),\n ('diameter', '%%c54.1667', (112.6233, 152.3836), 21.3053, 135),\n ('horizontal', '22.1625', (165.9562, 152.3836), (183.3904, 152.3836), (174.6733, 163.3836))\n]\n\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\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\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,\n angle=(0 if d[0] == \"horizontal\" else 90),\n 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,\n text=text, dimstyle=\"EZDXF\").render()\n\n doc.saveas(out_path)\n\n\nif __name__ == \"__main__\":\n out = sys.argv[1] if len(sys.argv) > 1 else \"0029_00293193_gt.dxf\"\n draw(out)\n print(\"wrote\", out)\n```"}], "images": ["images/0029_00293193.png"], "id": "0029_00293193"} {"messages": [{"role": "user", "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 50 mm. It is extruded to a thickness of 19.59 mm."}, {"role": "assistant", "content": "```python\n#!/usr/bin/env python3\n# -*- coding: utf-8 -*-\n# Ground-truth 2D engineering drawing for part: 0029_00297055\n# Self-contained: reproduces the three-view DXF via ezdxf, NO FreeCAD needed.\n# Coordinates are A4 page millimetres (scale=0.8036091098811375, page=[297.0, 210.0]).\n# visible edges -> solid (layer OUTLINE); hidden edges -> dashed (layer HIDDEN)\n# dimensions -> real movable DIMENSION entities (text = true mm value)\n# Run: python 0029_00297055_gt.py [out.dxf]\nimport sys\nimport ezdxf\n\nSCALE = 0.8036091098811375\nPAGE = [297.0, 210.0]\n\nVISIBLE_SEGMENTS = [\n (153.743255, 82.040255, 151.231977, 82.040255),\n (151.231977, 82.040255, 148.720699, 82.040255),\n (148.720699, 82.040255, 146.20942, 82.040255),\n (146.20942, 82.040255, 143.698142, 82.040255),\n (143.698142, 82.040255, 141.186863, 82.040255),\n (141.186863, 82.040255, 138.675585, 82.040255),\n (138.675585, 82.040255, 136.164306, 82.040255),\n (136.164306, 82.040255, 133.653028, 82.040255),\n (133.653028, 82.040255, 131.141749, 82.040255),\n (131.141749, 82.040255, 128.630471, 82.040255),\n (128.630471, 82.040255, 126.119192, 82.040255),\n (126.119192, 82.040255, 123.607914, 82.040255),\n (123.607914, 82.040255, 121.096635, 82.040255),\n (121.096635, 82.040255, 118.585357, 82.040255),\n (118.585357, 82.040255, 116.074078, 82.040255),\n (116.074078, 82.040255, 113.5628, 82.040255),\n (113.5628, 82.040255, 111.051522, 82.040255),\n (111.051522, 82.040255, 108.540243, 82.040255),\n (108.540243, 82.040255, 106.028965, 82.040255),\n (106.028965, 82.040255, 103.517686, 82.040255),\n (103.517686, 82.040255, 101.006408, 82.040255),\n (101.006408, 82.040255, 98.495129, 82.040255),\n (98.495129, 82.040255, 95.983851, 82.040255),\n (95.983851, 82.040255, 93.472572, 82.040255),\n (93.472572, 82.040255, 90.961294, 82.040255),\n (90.961294, 82.040255, 88.450015, 82.040255),\n (88.450015, 82.040255, 85.938737, 82.040255),\n (85.938737, 82.040255, 83.427458, 82.040255),\n (83.427458, 82.040255, 80.91618, 82.040255),\n (80.91618, 82.040255, 78.404901, 82.040255),\n (78.404901, 82.040255, 75.893623, 82.040255),\n (75.893623, 82.040255, 73.382345, 82.040255),\n (153.743255, 82.040255, 153.743255, 97.779344),\n (153.743255, 97.779344, 151.231977, 97.779344),\n (151.231977, 97.779344, 148.720699, 97.779344),\n (148.720699, 97.779344, 146.20942, 97.779344),\n (146.20942, 97.779344, 143.698142, 97.779344),\n (143.698142, 97.779344, 141.186863, 97.779344),\n (141.186863, 97.779344, 138.675585, 97.779344),\n (138.675585, 97.779344, 136.164306, 97.779344),\n (136.164306, 97.779344, 133.653028, 97.779344),\n (133.653028, 97.779344, 131.141749, 97.779344),\n (131.141749, 97.779344, 128.630471, 97.779344),\n (128.630471, 97.779344, 126.119192, 97.779344),\n (126.119192, 97.779344, 123.607914, 97.779344),\n (123.607914, 97.779344, 121.096635, 97.779344),\n (121.096635, 97.779344, 118.585357, 97.779344),\n (118.585357, 97.779344, 116.074078, 97.779344),\n (116.074078, 97.779344, 113.5628, 97.779344),\n (113.5628, 97.779344, 111.051522, 97.779344),\n (111.051522, 97.779344, 108.540243, 97.779344),\n (108.540243, 97.779344, 106.028965, 97.779344),\n (106.028965, 97.779344, 103.517686, 97.779344),\n (103.517686, 97.779344, 101.006408, 97.779344),\n (101.006408, 97.779344, 98.495129, 97.779344),\n (98.495129, 97.779344, 95.983851, 97.779344),\n (95.983851, 97.779344, 93.472572, 97.779344),\n (93.472572, 97.779344, 90.961294, 97.779344),\n (90.961294, 97.779344, 88.450015, 97.779344),\n (88.450015, 97.779344, 85.938737, 97.779344),\n (85.938737, 97.779344, 83.427458, 97.779344),\n (83.427458, 97.779344, 80.91618, 97.779344),\n (80.91618, 97.779344, 78.404901, 97.779344),\n (78.404901, 97.779344, 75.893623, 97.779344),\n (75.893623, 97.779344, 73.382345, 97.779344),\n (73.382345, 97.779344, 73.382345, 82.040255),\n (167.743256, 111.779345, 167.743256, 114.290623),\n (167.743256, 114.290623, 167.743256, 116.801901),\n (167.743256, 116.801901, 167.743256, 119.31318),\n (167.743256, 119.31318, 167.743256, 121.824458),\n (167.743256, 121.824458, 167.743256, 124.335737),\n (167.743256, 124.335737, 167.743256, 126.847015),\n (167.743256, 126.847015, 167.743256, 129.358294),\n (167.743256, 129.358294, 167.743256, 131.869572),\n (167.743256, 131.869572, 167.743256, 134.380851),\n (167.743256, 134.380851, 167.743256, 136.892129),\n (167.743256, 136.892129, 167.743256, 139.403408),\n (167.743256, 139.403408, 167.743256, 141.914686),\n (167.743256, 141.914686, 167.743256, 144.425965),\n (167.743256, 144.425965, 167.743256, 146.937243),\n (167.743256, 146.937243, 167.743256, 149.448522),\n (167.743256, 149.448522, 167.743256, 151.9598),\n (167.743256, 151.9598, 167.743256, 154.471078),\n (167.743256, 154.471078, 167.743256, 156.982357),\n (167.743256, 156.982357, 167.743256, 159.493635),\n (167.743256, 159.493635, 167.743256, 162.004914),\n (167.743256, 162.004914, 167.743256, 164.516192),\n (167.743256, 164.516192, 167.743256, 167.027471),\n (167.743256, 167.027471, 167.743256, 169.538749),\n (167.743256, 169.538749, 167.743256, 172.050028),\n (167.743256, 172.050028, 167.743256, 174.561306),\n (167.743256, 174.561306, 167.743256, 177.072585),\n (167.743256, 177.072585, 167.743256, 179.583863),\n (167.743256, 179.583863, 167.743256, 182.095142),\n (167.743256, 182.095142, 167.743256, 184.60642),\n (167.743256, 184.60642, 167.743256, 187.117699),\n (167.743256, 187.117699, 167.743256, 189.628977),\n (167.743256, 189.628977, 167.743256, 192.140255),\n (183.482345, 111.779345, 183.482345, 114.290623),\n (183.482345, 114.290623, 183.482345, 116.801901),\n (183.482345, 116.801901, 183.482345, 119.31318),\n (183.482345, 119.31318, 183.482345, 121.824458),\n (183.482345, 121.824458, 183.482345, 124.335737),\n (183.482345, 124.335737, 183.482345, 126.847015),\n (183.482345, 126.847015, 183.482345, 129.358294),\n (183.482345, 129.358294, 183.482345, 131.869572),\n (183.482345, 131.869572, 183.482345, 134.380851),\n (183.482345, 134.380851, 183.482345, 136.892129),\n (183.482345, 136.892129, 183.482345, 139.403408),\n (183.482345, 139.403408, 183.482345, 141.914686),\n (183.482345, 141.914686, 183.482345, 144.425965),\n (183.482345, 144.425965, 183.482345, 146.937243),\n (183.482345, 146.937243, 183.482345, 149.448522),\n (183.482345, 149.448522, 183.482345, 151.9598),\n (183.482345, 151.9598, 183.482345, 154.471078),\n (183.482345, 154.471078, 183.482345, 156.982357),\n (183.482345, 156.982357, 183.482345, 159.493635),\n (183.482345, 159.493635, 183.482345, 162.004914),\n (183.482345, 162.004914, 183.482345, 164.516192),\n (183.482345, 164.516192, 183.482345, 167.027471),\n (183.482345, 167.027471, 183.482345, 169.538749),\n (183.482345, 169.538749, 183.482345, 172.050028),\n (183.482345, 172.050028, 183.482345, 174.561306),\n (183.482345, 174.561306, 183.482345, 177.072585),\n (183.482345, 177.072585, 183.482345, 179.583863),\n (183.482345, 179.583863, 183.482345, 182.095142),\n (183.482345, 182.095142, 183.482345, 184.60642),\n (183.482345, 184.60642, 183.482345, 187.117699),\n (183.482345, 187.117699, 183.482345, 189.628977),\n (183.482345, 189.628977, 183.482345, 192.140255),\n (183.482345, 111.779345, 167.743256, 111.779345),\n (183.482345, 192.140255, 167.743256, 192.140255)\n]\nVISIBLE_CIRCLES = [\n (113.5628, 151.9598, 40.180455),\n (113.5628, 151.9598, 20.090228)\n]\nVISIBLE_ARCS = [\n\n]\nHIDDEN_SEGMENTS = [\n (133.653, 97.7793, 133.653, 82.0402),\n (93.4726, 82.0402, 93.4726, 97.7793),\n (183.4823, 172.05, 167.7432, 172.05),\n (183.4823, 131.8695, 167.7432, 131.8695)\n]\n# (orient, text, p1, p2, base) for linear; (orient, text, center, radius, angle) for diameter\nDIMENSIONS = [\n ('diameter', '%%c100', (113.5628, 151.9598), 40.1805, 45),\n ('diameter', '%%c50', (113.5628, 151.9598), 20.0902, 135),\n ('horizontal', '19.5855', (167.7432, 151.9598), (183.4823, 151.9598), (175.6128, 162.9598))\n]\n\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\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\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,\n angle=(0 if d[0] == \"horizontal\" else 90),\n 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,\n text=text, dimstyle=\"EZDXF\").render()\n\n doc.saveas(out_path)\n\n\nif __name__ == \"__main__\":\n out = sys.argv[1] if len(sys.argv) > 1 else \"0029_00297055_gt.dxf\"\n draw(out)\n print(\"wrote\", out)\n```"}], "images": ["images/0029_00297055.png"], "id": "0029_00297055"} {"messages": [{"role": "user", "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 46.81 mm. It is extruded to a thickness of 32.11 mm."}, {"role": "assistant", "content": "```python\n#!/usr/bin/env python3\n# -*- coding: utf-8 -*-\n# Ground-truth 2D engineering drawing for part: 0031_00311057\n# Self-contained: reproduces the three-view DXF via ezdxf, NO FreeCAD needed.\n# Coordinates are A4 page millimetres (scale=0.7274306085643906, page=[297.0, 210.0]).\n# visible edges -> solid (layer OUTLINE); hidden edges -> dashed (layer HIDDEN)\n# dimensions -> real movable DIMENSION entities (text = true mm value)\n# Run: python 0031_00311057_gt.py [out.dxf]\nimport sys\nimport ezdxf\n\nSCALE = 0.7274306085643906\nPAGE = [297.0, 210.0]\n\nVISIBLE_SEGMENTS = [\n (75.10087, 103.492669, 77.37409, 103.492669),\n (77.37409, 103.492669, 79.647311, 103.492669),\n (79.647311, 103.492669, 81.920532, 103.492669),\n (81.920532, 103.492669, 84.193752, 103.492669),\n (84.193752, 103.492669, 86.466973, 103.492669),\n (86.466973, 103.492669, 88.740193, 103.492669),\n (88.740193, 103.492669, 91.013414, 103.492669),\n (91.013414, 103.492669, 93.286635, 103.492669),\n (93.286635, 103.492669, 95.559855, 103.492669),\n (95.559855, 103.492669, 97.833076, 103.492669),\n (97.833076, 103.492669, 100.106297, 103.492669),\n (100.106297, 103.492669, 102.379517, 103.492669),\n (102.379517, 103.492669, 104.652738, 103.492669),\n (104.652738, 103.492669, 106.925959, 103.492669),\n (106.925959, 103.492669, 109.199179, 103.492669),\n (109.199179, 103.492669, 111.4724, 103.492669),\n (111.4724, 103.492669, 113.745621, 103.492669),\n (113.745621, 103.492669, 116.018841, 103.492669),\n (116.018841, 103.492669, 118.292062, 103.492669),\n (118.292062, 103.492669, 120.565283, 103.492669),\n (120.565283, 103.492669, 122.838503, 103.492669),\n (122.838503, 103.492669, 125.111724, 103.492669),\n (125.111724, 103.492669, 127.384945, 103.492669),\n (127.384945, 103.492669, 129.658165, 103.492669),\n (129.658165, 103.492669, 131.931386, 103.492669),\n (131.931386, 103.492669, 134.204607, 103.492669),\n (134.204607, 103.492669, 136.477827, 103.492669),\n (136.477827, 103.492669, 138.751048, 103.492669),\n (138.751048, 103.492669, 141.024268, 103.492669),\n (141.024268, 103.492669, 143.297489, 103.492669),\n (143.297489, 103.492669, 145.57071, 103.492669),\n (145.57071, 103.492669, 147.84393, 103.492669),\n (147.84393, 103.492669, 147.84393, 80.13573),\n (75.10087, 80.13573, 77.37409, 80.13573),\n (77.37409, 80.13573, 79.647311, 80.13573),\n (79.647311, 80.13573, 81.920532, 80.13573),\n (81.920532, 80.13573, 84.193752, 80.13573),\n (84.193752, 80.13573, 86.466973, 80.13573),\n (86.466973, 80.13573, 88.740193, 80.13573),\n (88.740193, 80.13573, 91.013414, 80.13573),\n (91.013414, 80.13573, 93.286635, 80.13573),\n (93.286635, 80.13573, 95.559855, 80.13573),\n (95.559855, 80.13573, 97.833076, 80.13573),\n (97.833076, 80.13573, 100.106297, 80.13573),\n (100.106297, 80.13573, 102.379517, 80.13573),\n (102.379517, 80.13573, 104.652738, 80.13573),\n (104.652738, 80.13573, 106.925959, 80.13573),\n (106.925959, 80.13573, 109.199179, 80.13573),\n (109.199179, 80.13573, 111.4724, 80.13573),\n (111.4724, 80.13573, 113.745621, 80.13573),\n (113.745621, 80.13573, 116.018841, 80.13573),\n (116.018841, 80.13573, 118.292062, 80.13573),\n (118.292062, 80.13573, 120.565283, 80.13573),\n (120.565283, 80.13573, 122.838503, 80.13573),\n (122.838503, 80.13573, 125.111724, 80.13573),\n (125.111724, 80.13573, 127.384945, 80.13573),\n (127.384945, 80.13573, 129.658165, 80.13573),\n (129.658165, 80.13573, 131.931386, 80.13573),\n (131.931386, 80.13573, 134.204607, 80.13573),\n (134.204607, 80.13573, 136.477827, 80.13573),\n (136.477827, 80.13573, 138.751048, 80.13573),\n (138.751048, 80.13573, 141.024268, 80.13573),\n (141.024268, 80.13573, 143.297489, 80.13573),\n (143.297489, 80.13573, 145.57071, 80.13573),\n (145.57071, 80.13573, 147.84393, 80.13573),\n (75.10087, 80.13573, 75.10087, 103.492669),\n (185.20087, 190.23573, 185.20087, 187.96251),\n (185.20087, 187.96251, 185.20087, 185.689289),\n (185.20087, 185.689289, 185.20087, 183.416068),\n (185.20087, 183.416068, 185.20087, 181.142848),\n (185.20087, 181.142848, 185.20087, 178.869627),\n (185.20087, 178.869627, 185.20087, 176.596407),\n (185.20087, 176.596407, 185.20087, 174.323186),\n (185.20087, 174.323186, 185.20087, 172.049965),\n (185.20087, 172.049965, 185.20087, 169.776745),\n (185.20087, 169.776745, 185.20087, 167.503524),\n (185.20087, 167.503524, 185.20087, 165.230303),\n (185.20087, 165.230303, 185.20087, 162.957083),\n (185.20087, 162.957083, 185.20087, 160.683862),\n (185.20087, 160.683862, 185.20087, 158.410641),\n (185.20087, 158.410641, 185.20087, 156.137421),\n (185.20087, 156.137421, 185.20087, 153.8642),\n (185.20087, 153.8642, 185.20087, 151.590979),\n (185.20087, 151.590979, 185.20087, 149.317759),\n (185.20087, 149.317759, 185.20087, 147.044538),\n (185.20087, 147.044538, 185.20087, 144.771317),\n (185.20087, 144.771317, 185.20087, 142.498097),\n (185.20087, 142.498097, 185.20087, 140.224876),\n (185.20087, 140.224876, 185.20087, 137.951655),\n (185.20087, 137.951655, 185.20087, 135.678435),\n (185.20087, 135.678435, 185.20087, 133.405214),\n (185.20087, 133.405214, 185.20087, 131.131993),\n (185.20087, 131.131993, 185.20087, 128.858773),\n (185.20087, 128.858773, 185.20087, 126.585552),\n (185.20087, 126.585552, 185.20087, 124.312332),\n (185.20087, 124.312332, 185.20087, 122.039111),\n (185.20087, 122.039111, 185.20087, 119.76589),\n (185.20087, 119.76589, 185.20087, 117.49267),\n (161.843931, 190.23573, 161.843931, 187.96251),\n (161.843931, 187.96251, 161.843931, 185.689289),\n (161.843931, 185.689289, 161.843931, 183.416068),\n (161.843931, 183.416068, 161.843931, 181.142848),\n (161.843931, 181.142848, 161.843931, 178.869627),\n (161.843931, 178.869627, 161.843931, 176.596407),\n (161.843931, 176.596407, 161.843931, 174.323186),\n (161.843931, 174.323186, 161.843931, 172.049965),\n (161.843931, 172.049965, 161.843931, 169.776745),\n (161.843931, 169.776745, 161.843931, 167.503524),\n (161.843931, 167.503524, 161.843931, 165.230303),\n (161.843931, 165.230303, 161.843931, 162.957083),\n (161.843931, 162.957083, 161.843931, 160.683862),\n (161.843931, 160.683862, 161.843931, 158.410641),\n (161.843931, 158.410641, 161.843931, 156.137421),\n (161.843931, 156.137421, 161.843931, 153.8642),\n (161.843931, 153.8642, 161.843931, 151.590979),\n (161.843931, 151.590979, 161.843931, 149.317759),\n (161.843931, 149.317759, 161.843931, 147.044538),\n (161.843931, 147.044538, 161.843931, 144.771317),\n (161.843931, 144.771317, 161.843931, 142.498097),\n (161.843931, 142.498097, 161.843931, 140.224876),\n (161.843931, 140.224876, 161.843931, 137.951655),\n (161.843931, 137.951655, 161.843931, 135.678435),\n (161.843931, 135.678435, 161.843931, 133.405214),\n (161.843931, 133.405214, 161.843931, 131.131993),\n (161.843931, 131.131993, 161.843931, 128.858773),\n (161.843931, 128.858773, 161.843931, 126.585552),\n (161.843931, 126.585552, 161.843931, 124.312332),\n (161.843931, 124.312332, 161.843931, 122.039111),\n (161.843931, 122.039111, 161.843931, 119.76589),\n (161.843931, 119.76589, 161.843931, 117.49267),\n (161.843931, 190.23573, 185.20087, 190.23573),\n (161.843931, 117.49267, 185.20087, 117.49267)\n]\nVISIBLE_CIRCLES = [\n (111.4724, 153.8642, 36.37153),\n (111.4724, 153.8642, 17.024972)\n]\nVISIBLE_ARCS = [\n\n]\nHIDDEN_SEGMENTS = [\n (128.4974, 80.1358, 128.4974, 103.4927),\n (94.4474, 103.4927, 94.4474, 80.1358),\n (161.8439, 136.8393, 185.2009, 136.8393),\n (161.8439, 170.8892, 185.2009, 170.8892)\n]\n# (orient, text, p1, p2, base) for linear; (orient, text, center, radius, angle) for diameter\nDIMENSIONS = [\n ('diameter', '%%c100', (111.4724, 153.8642), 36.3715, 45),\n ('diameter', '%%c46.8085', (111.4724, 153.8642), 17.025, 135),\n ('horizontal', '32.1088', (185.2009, 153.8642), (161.844, 153.8642), (173.5224, 142.8642))\n]\n\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\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\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,\n angle=(0 if d[0] == \"horizontal\" else 90),\n 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,\n text=text, dimstyle=\"EZDXF\").render()\n\n doc.saveas(out_path)\n\n\nif __name__ == \"__main__\":\n out = sys.argv[1] if len(sys.argv) > 1 else \"0031_00311057_gt.dxf\"\n draw(out)\n print(\"wrote\", out)\n```"}], "images": ["images/0031_00311057.png"], "id": "0031_00311057"} {"messages": [{"role": "user", "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 97.92 mm. It is extruded to a thickness of -15.98 mm."}, {"role": "assistant", "content": "```python\n#!/usr/bin/env python3\n# -*- coding: utf-8 -*-\n# Ground-truth 2D engineering drawing for part: 0032_00325605\n# Self-contained: reproduces the three-view DXF via ezdxf, NO FreeCAD needed.\n# Coordinates are A4 page millimetres (scale=0.7282769509086472, page=[297.0, 210.0]).\n# visible edges -> solid (layer OUTLINE); hidden edges -> dashed (layer HIDDEN)\n# dimensions -> real movable DIMENSION entities (text = true mm value)\n# Run: python 0032_00325605_gt.py [out.dxf]\nimport sys\nimport ezdxf\n\nSCALE = 0.7282769509086472\nPAGE = [297.0, 210.0]\n\nVISIBLE_SEGMENTS = [\n (70.432752, 103.429252, 72.708618, 103.429252),\n (72.708618, 103.429252, 74.984483, 103.429252),\n (74.984483, 103.429252, 77.260349, 103.429252),\n (77.260349, 103.429252, 79.536214, 103.429252),\n (79.536214, 103.429252, 81.81208, 103.429252),\n (81.81208, 103.429252, 84.087945, 103.429252),\n (84.087945, 103.429252, 86.363811, 103.429252),\n (86.363811, 103.429252, 88.639676, 103.429252),\n (88.639676, 103.429252, 90.915542, 103.429252),\n (90.915542, 103.429252, 93.191407, 103.429252),\n (93.191407, 103.429252, 95.467273, 103.429252),\n (95.467273, 103.429252, 97.743138, 103.429252),\n (97.743138, 103.429252, 100.019004, 103.429252),\n (100.019004, 103.429252, 102.294869, 103.429252),\n (102.294869, 103.429252, 104.570735, 103.429252),\n (104.570735, 103.429252, 106.8466, 103.429252),\n (106.8466, 103.429252, 109.122465, 103.429252),\n (109.122465, 103.429252, 111.398331, 103.429252),\n (111.398331, 103.429252, 113.674196, 103.429252),\n (113.674196, 103.429252, 115.950062, 103.429252),\n (115.950062, 103.429252, 118.225927, 103.429252),\n (118.225927, 103.429252, 120.501793, 103.429252),\n (120.501793, 103.429252, 122.777658, 103.429252),\n (122.777658, 103.429252, 125.053524, 103.429252),\n (125.053524, 103.429252, 127.329389, 103.429252),\n (127.329389, 103.429252, 129.605255, 103.429252),\n (129.605255, 103.429252, 131.88112, 103.429252),\n (131.88112, 103.429252, 134.156986, 103.429252),\n (134.156986, 103.429252, 136.432851, 103.429252),\n (136.432851, 103.429252, 138.708717, 103.429252),\n (138.708717, 103.429252, 140.984582, 103.429252),\n (140.984582, 103.429252, 143.260448, 103.429252),\n (143.260448, 103.429252, 143.260448, 80.156947),\n (70.432752, 80.156947, 72.708618, 80.156947),\n (72.708618, 80.156947, 74.984483, 80.156947),\n (74.984483, 80.156947, 77.260349, 80.156947),\n (77.260349, 80.156947, 79.536214, 80.156947),\n (79.536214, 80.156947, 81.81208, 80.156947),\n (81.81208, 80.156947, 84.087945, 80.156947),\n (84.087945, 80.156947, 86.363811, 80.156947),\n (86.363811, 80.156947, 88.639676, 80.156947),\n (88.639676, 80.156947, 90.915542, 80.156947),\n (90.915542, 80.156947, 93.191407, 80.156947),\n (93.191407, 80.156947, 95.467273, 80.156947),\n (95.467273, 80.156947, 97.743138, 80.156947),\n (97.743138, 80.156947, 100.019004, 80.156947),\n (100.019004, 80.156947, 102.294869, 80.156947),\n (102.294869, 80.156947, 104.570735, 80.156947),\n (104.570735, 80.156947, 106.8466, 80.156947),\n (106.8466, 80.156947, 109.122465, 80.156947),\n (109.122465, 80.156947, 111.398331, 80.156947),\n (111.398331, 80.156947, 113.674196, 80.156947),\n (113.674196, 80.156947, 115.950062, 80.156947),\n (115.950062, 80.156947, 118.225927, 80.156947),\n (118.225927, 80.156947, 120.501793, 80.156947),\n (120.501793, 80.156947, 122.777658, 80.156947),\n (122.777658, 80.156947, 125.053524, 80.156947),\n (125.053524, 80.156947, 127.329389, 80.156947),\n (127.329389, 80.156947, 129.605255, 80.156947),\n (129.605255, 80.156947, 131.88112, 80.156947),\n (131.88112, 80.156947, 134.156986, 80.156947),\n (134.156986, 80.156947, 136.432851, 80.156947),\n (136.432851, 80.156947, 138.708717, 80.156947),\n (138.708717, 80.156947, 140.984582, 80.156947),\n (140.984582, 80.156947, 143.260448, 80.156947),\n (70.432752, 103.429252, 70.432752, 80.156947),\n (180.532753, 190.256948, 180.532753, 187.981082),\n (180.532753, 187.981082, 180.532753, 185.705217),\n (180.532753, 185.705217, 180.532753, 183.429351),\n (180.532753, 183.429351, 180.532753, 181.153486),\n (180.532753, 181.153486, 180.532753, 178.87762),\n (180.532753, 178.87762, 180.532753, 176.601755),\n (180.532753, 176.601755, 180.532753, 174.325889),\n (180.532753, 174.325889, 180.532753, 172.050024),\n (180.532753, 172.050024, 180.532753, 169.774158),\n (180.532753, 169.774158, 180.532753, 167.498293),\n (180.532753, 167.498293, 180.532753, 165.222427),\n (180.532753, 165.222427, 180.532753, 162.946562),\n (180.532753, 162.946562, 180.532753, 160.670696),\n (180.532753, 160.670696, 180.532753, 158.394831),\n (180.532753, 158.394831, 180.532753, 156.118965),\n (180.532753, 156.118965, 180.532753, 153.8431),\n (180.532753, 153.8431, 180.532753, 151.567235),\n (180.532753, 151.567235, 180.532753, 149.291369),\n (180.532753, 149.291369, 180.532753, 147.015504),\n (180.532753, 147.015504, 180.532753, 144.739638),\n (180.532753, 144.739638, 180.532753, 142.463773),\n (180.532753, 142.463773, 180.532753, 140.187907),\n (180.532753, 140.187907, 180.532753, 137.912042),\n (180.532753, 137.912042, 180.532753, 135.636176),\n (180.532753, 135.636176, 180.532753, 133.360311),\n (180.532753, 133.360311, 180.532753, 131.084445),\n (180.532753, 131.084445, 180.532753, 128.80858),\n (180.532753, 128.80858, 180.532753, 126.532714),\n (180.532753, 126.532714, 180.532753, 124.256849),\n (180.532753, 124.256849, 180.532753, 121.980983),\n (180.532753, 121.980983, 180.532753, 119.705118),\n (180.532753, 119.705118, 180.532753, 117.429252),\n (157.260448, 190.256948, 157.260448, 187.981082),\n (157.260448, 187.981082, 157.260448, 185.705217),\n (157.260448, 185.705217, 157.260448, 183.429351),\n (157.260448, 183.429351, 157.260448, 181.153486),\n (157.260448, 181.153486, 157.260448, 178.87762),\n (157.260448, 178.87762, 157.260448, 176.601755),\n (157.260448, 176.601755, 157.260448, 174.325889),\n (157.260448, 174.325889, 157.260448, 172.050024),\n (157.260448, 172.050024, 157.260448, 169.774158),\n (157.260448, 169.774158, 157.260448, 167.498293),\n (157.260448, 167.498293, 157.260448, 165.222427),\n (157.260448, 165.222427, 157.260448, 162.946562),\n (157.260448, 162.946562, 157.260448, 160.670696),\n (157.260448, 160.670696, 157.260448, 158.394831),\n (157.260448, 158.394831, 157.260448, 156.118965),\n (157.260448, 156.118965, 157.260448, 153.8431),\n (157.260448, 153.8431, 157.260448, 151.567235),\n (157.260448, 151.567235, 157.260448, 149.291369),\n (157.260448, 149.291369, 157.260448, 147.015504),\n (157.260448, 147.015504, 157.260448, 144.739638),\n (157.260448, 144.739638, 157.260448, 142.463773),\n (157.260448, 142.463773, 157.260448, 140.187907),\n (157.260448, 140.187907, 157.260448, 137.912042),\n (157.260448, 137.912042, 157.260448, 135.636176),\n (157.260448, 135.636176, 157.260448, 133.360311),\n (157.260448, 133.360311, 157.260448, 131.084445),\n (157.260448, 131.084445, 157.260448, 128.80858),\n (157.260448, 128.80858, 157.260448, 126.532714),\n (157.260448, 126.532714, 157.260448, 124.256849),\n (157.260448, 124.256849, 157.260448, 121.980983),\n (157.260448, 121.980983, 157.260448, 119.705118),\n (157.260448, 119.705118, 157.260448, 117.429252),\n (180.532753, 117.429252, 157.260448, 117.429252),\n (180.532753, 190.256948, 157.260448, 190.256948)\n]\nVISIBLE_CIRCLES = [\n (106.8466, 153.8431, 36.413848),\n (106.8466, 153.8431, 35.655226)\n]\nVISIBLE_ARCS = [\n\n]\nHIDDEN_SEGMENTS = [\n (142.5018, 91.7931, 142.5018, 80.1569),\n (142.5018, 91.7931, 142.5018, 103.4292),\n (71.1914, 80.1569, 71.1914, 91.7931),\n (71.1914, 103.4292, 71.1914, 91.7931),\n (180.5327, 189.4983, 168.8966, 189.4983),\n (180.5327, 118.1879, 168.8966, 118.1879),\n (157.2604, 118.1879, 168.8966, 118.1879),\n (157.2604, 189.4983, 168.8966, 189.4983)\n]\n# (orient, text, p1, p2, base) for linear; (orient, text, center, radius, angle) for diameter\nDIMENSIONS = [\n ('diameter', '%%c100', (106.8466, 153.8431), 36.4138, 45),\n ('diameter', '%%c97.9167', (106.8466, 153.8431), 35.6552, 135),\n ('horizontal', '31.9553', (157.2605, 153.8431), (180.5327, 153.8431), (168.8966, 164.8431))\n]\n\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\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\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,\n angle=(0 if d[0] == \"horizontal\" else 90),\n 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,\n text=text, dimstyle=\"EZDXF\").render()\n\n doc.saveas(out_path)\n\n\nif __name__ == \"__main__\":\n out = sys.argv[1] if len(sys.argv) > 1 else \"0032_00325605_gt.dxf\"\n draw(out)\n print(\"wrote\", out)\n```"}], "images": ["images/0032_00325605.png"], "id": "0032_00325605"} {"messages": [{"role": "user", "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 95.83 mm. It is extruded to a thickness of 2.06 mm."}, {"role": "assistant", "content": "```python\n#!/usr/bin/env python3\n# -*- coding: utf-8 -*-\n# Ground-truth 2D engineering drawing for part: 0034_00348852\n# Self-contained: reproduces the three-view DXF via ezdxf, NO FreeCAD needed.\n# Coordinates are A4 page millimetres (scale=0.7347, page=[297.0, 210.0]).\n# visible edges -> solid (layer OUTLINE); hidden edges -> dashed (layer HIDDEN)\n# dimensions -> real movable DIMENSION entities (text = true mm value)\n# Run: python 0034_00348852_gt.py [out.dxf]\nimport sys\nimport ezdxf\n\nSCALE = 0.7347\nPAGE = [297.0, 210.0]\n\nVISIBLE_SEGMENTS = [\n (81.0228, 92.3898, 83.318737, 92.3898),\n (83.318737, 92.3898, 85.614675, 92.3898),\n (85.614675, 92.3898, 87.910612, 92.3898),\n (87.910612, 92.3898, 90.20655, 92.3898),\n (90.20655, 92.3898, 92.502488, 92.3898),\n (92.502488, 92.3898, 94.798425, 92.3898),\n (94.798425, 92.3898, 97.094363, 92.3898),\n (97.094363, 92.3898, 99.3903, 92.3898),\n (99.3903, 92.3898, 101.686238, 92.3898),\n (101.686238, 92.3898, 103.982175, 92.3898),\n (103.982175, 92.3898, 106.278113, 92.3898),\n (106.278113, 92.3898, 108.57405, 92.3898),\n (108.57405, 92.3898, 110.869988, 92.3898),\n (110.869988, 92.3898, 113.165925, 92.3898),\n (113.165925, 92.3898, 115.461863, 92.3898),\n (115.461863, 92.3898, 117.7578, 92.3898),\n (117.7578, 92.3898, 120.053737, 92.3898),\n (120.053737, 92.3898, 122.349675, 92.3898),\n (122.349675, 92.3898, 124.645612, 92.3898),\n (124.645612, 92.3898, 126.94155, 92.3898),\n (126.94155, 92.3898, 129.237488, 92.3898),\n (129.237488, 92.3898, 131.533425, 92.3898),\n (131.533425, 92.3898, 133.829363, 92.3898),\n (133.829363, 92.3898, 136.1253, 92.3898),\n (136.1253, 92.3898, 138.421238, 92.3898),\n (138.421238, 92.3898, 140.717175, 92.3898),\n (140.717175, 92.3898, 143.013113, 92.3898),\n (143.013113, 92.3898, 145.30905, 92.3898),\n (145.30905, 92.3898, 147.604988, 92.3898),\n (147.604988, 92.3898, 149.900925, 92.3898),\n (149.900925, 92.3898, 152.196863, 92.3898),\n (152.196863, 92.3898, 154.4928, 92.3898),\n (154.4928, 92.3898, 154.4928, 90.875119),\n (81.0228, 90.875119, 83.318737, 90.875119),\n (83.318737, 90.875119, 85.614675, 90.875119),\n (85.614675, 90.875119, 87.910612, 90.875119),\n (87.910612, 90.875119, 90.20655, 90.875119),\n (90.20655, 90.875119, 92.502488, 90.875119),\n (92.502488, 90.875119, 94.798425, 90.875119),\n (94.798425, 90.875119, 97.094363, 90.875119),\n (97.094363, 90.875119, 99.3903, 90.875119),\n (99.3903, 90.875119, 101.686238, 90.875119),\n (101.686238, 90.875119, 103.982175, 90.875119),\n (103.982175, 90.875119, 106.278113, 90.875119),\n (106.278113, 90.875119, 108.57405, 90.875119),\n (108.57405, 90.875119, 110.869988, 90.875119),\n (110.869988, 90.875119, 113.165925, 90.875119),\n (113.165925, 90.875119, 115.461863, 90.875119),\n (115.461863, 90.875119, 117.7578, 90.875119),\n (117.7578, 90.875119, 120.053737, 90.875119),\n (120.053737, 90.875119, 122.349675, 90.875119),\n (122.349675, 90.875119, 124.645612, 90.875119),\n (124.645612, 90.875119, 126.94155, 90.875119),\n (126.94155, 90.875119, 129.237488, 90.875119),\n (129.237488, 90.875119, 131.533425, 90.875119),\n (131.533425, 90.875119, 133.829363, 90.875119),\n (133.829363, 90.875119, 136.1253, 90.875119),\n (136.1253, 90.875119, 138.421238, 90.875119),\n (138.421238, 90.875119, 140.717175, 90.875119),\n (140.717175, 90.875119, 143.013113, 90.875119),\n (143.013113, 90.875119, 145.30905, 90.875119),\n (145.30905, 90.875119, 147.604988, 90.875119),\n (147.604988, 90.875119, 149.900925, 90.875119),\n (149.900925, 90.875119, 152.196863, 90.875119),\n (152.196863, 90.875119, 154.4928, 90.875119),\n (81.0228, 90.875119, 81.0228, 92.3898),\n (170.007481, 179.8598, 170.007481, 177.563862),\n (170.007481, 177.563862, 170.007481, 175.267925),\n (170.007481, 175.267925, 170.007481, 172.971988),\n (170.007481, 172.971988, 170.007481, 170.67605),\n (170.007481, 170.67605, 170.007481, 168.380112),\n (170.007481, 168.380112, 170.007481, 166.084175),\n (170.007481, 166.084175, 170.007481, 163.788238),\n (170.007481, 163.788238, 170.007481, 161.4923),\n (170.007481, 161.4923, 170.007481, 159.196363),\n (170.007481, 159.196363, 170.007481, 156.900425),\n (170.007481, 156.900425, 170.007481, 154.604488),\n (170.007481, 154.604488, 170.007481, 152.30855),\n (170.007481, 152.30855, 170.007481, 150.012613),\n (170.007481, 150.012613, 170.007481, 147.716675),\n (170.007481, 147.716675, 170.007481, 145.420738),\n (170.007481, 145.420738, 170.007481, 143.1248),\n (170.007481, 143.1248, 170.007481, 140.828862),\n (170.007481, 140.828862, 170.007481, 138.532925),\n (170.007481, 138.532925, 170.007481, 136.236987),\n (170.007481, 136.236987, 170.007481, 133.94105),\n (170.007481, 133.94105, 170.007481, 131.645113),\n (170.007481, 131.645113, 170.007481, 129.349175),\n (170.007481, 129.349175, 170.007481, 127.053238),\n (170.007481, 127.053238, 170.007481, 124.7573),\n (170.007481, 124.7573, 170.007481, 122.461363),\n (170.007481, 122.461363, 170.007481, 120.165425),\n (170.007481, 120.165425, 170.007481, 117.869488),\n (170.007481, 117.869488, 170.007481, 115.57355),\n (170.007481, 115.57355, 170.007481, 113.277613),\n (170.007481, 113.277613, 170.007481, 110.981675),\n (170.007481, 110.981675, 170.007481, 108.685738),\n (170.007481, 108.685738, 170.007481, 106.3898),\n (168.4928, 179.8598, 168.4928, 177.563862),\n (168.4928, 177.563862, 168.4928, 175.267925),\n (168.4928, 175.267925, 168.4928, 172.971988),\n (168.4928, 172.971988, 168.4928, 170.67605),\n (168.4928, 170.67605, 168.4928, 168.380112),\n (168.4928, 168.380112, 168.4928, 166.084175),\n (168.4928, 166.084175, 168.4928, 163.788238),\n (168.4928, 163.788238, 168.4928, 161.4923),\n (168.4928, 161.4923, 168.4928, 159.196363),\n (168.4928, 159.196363, 168.4928, 156.900425),\n (168.4928, 156.900425, 168.4928, 154.604488),\n (168.4928, 154.604488, 168.4928, 152.30855),\n (168.4928, 152.30855, 168.4928, 150.012613),\n (168.4928, 150.012613, 168.4928, 147.716675),\n (168.4928, 147.716675, 168.4928, 145.420738),\n (168.4928, 145.420738, 168.4928, 143.1248),\n (168.4928, 143.1248, 168.4928, 140.828862),\n (168.4928, 140.828862, 168.4928, 138.532925),\n (168.4928, 138.532925, 168.4928, 136.236987),\n (168.4928, 136.236987, 168.4928, 133.94105),\n (168.4928, 133.94105, 168.4928, 131.645113),\n (168.4928, 131.645113, 168.4928, 129.349175),\n (168.4928, 129.349175, 168.4928, 127.053238),\n (168.4928, 127.053238, 168.4928, 124.7573),\n (168.4928, 124.7573, 168.4928, 122.461363),\n (168.4928, 122.461363, 168.4928, 120.165425),\n (168.4928, 120.165425, 168.4928, 117.869488),\n (168.4928, 117.869488, 168.4928, 115.57355),\n (168.4928, 115.57355, 168.4928, 113.277613),\n (168.4928, 113.277613, 168.4928, 110.981675),\n (168.4928, 110.981675, 168.4928, 108.685738),\n (168.4928, 108.685738, 168.4928, 106.3898),\n (168.4928, 179.8598, 170.007481, 179.8598),\n (168.4928, 106.3898, 170.007481, 106.3898)\n]\nVISIBLE_CIRCLES = [\n (117.7578, 143.1248, 36.735),\n (117.7578, 143.1248, 35.204375)\n]\nVISIBLE_ARCS = [\n\n]\nHIDDEN_SEGMENTS = [\n (152.9622, 90.8752, 152.9622, 92.3898),\n (82.5534, 92.3898, 82.5534, 90.8752),\n (168.4928, 107.9205, 170.0075, 107.9205),\n (168.4928, 178.3292, 170.0075, 178.3292)\n]\n# (orient, text, p1, p2, base) for linear; (orient, text, center, radius, angle) for diameter\nDIMENSIONS = [\n ('diameter', '%%c100', (117.7578, 143.1248), 36.735, 45),\n ('diameter', '%%c95.8333', (117.7578, 143.1248), 35.2044, 135),\n ('horizontal', '2.0616', (170.0075, 143.1248), (168.4928, 143.1248), (169.2502, 132.1248))\n]\n\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\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\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,\n angle=(0 if d[0] == \"horizontal\" else 90),\n 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,\n text=text, dimstyle=\"EZDXF\").render()\n\n doc.saveas(out_path)\n\n\nif __name__ == \"__main__\":\n out = sys.argv[1] if len(sys.argv) > 1 else \"0034_00348852_gt.dxf\"\n draw(out)\n print(\"wrote\", out)\n```"}], "images": ["images/0034_00348852.png"], "id": "0034_00348852"} {"messages": [{"role": "user", "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 6.25 mm. It is extruded to a thickness of 5.15 mm."}, {"role": "assistant", "content": "```python\n#!/usr/bin/env python3\n# -*- coding: utf-8 -*-\n# Ground-truth 2D engineering drawing for part: 0035_00359556\n# Self-contained: reproduces the three-view DXF via ezdxf, NO FreeCAD needed.\n# Coordinates are A4 page millimetres (scale=0.4805, page=[297.0, 210.0]).\n# visible edges -> solid (layer OUTLINE); hidden edges -> dashed (layer HIDDEN)\n# dimensions -> real movable DIMENSION entities (text = true mm value)\n# Run: python 0035_00359556_gt.py [out.dxf]\nimport sys\nimport ezdxf\n\nSCALE = 0.4805\nPAGE = [297.0, 210.0]\n\nVISIBLE_SEGMENTS = [\n (152.9051, 96.749264, 151.403537, 96.749264),\n (151.403537, 96.749264, 149.901975, 96.749264),\n (149.901975, 96.749264, 148.400412, 96.749264),\n (148.400412, 96.749264, 146.89885, 96.749264),\n (146.89885, 96.749264, 145.397288, 96.749264),\n (145.397288, 96.749264, 143.895725, 96.749264),\n (143.895725, 96.749264, 142.394162, 96.749264),\n (142.394162, 96.749264, 140.8926, 96.749264),\n (140.8926, 96.749264, 139.391038, 96.749264),\n (139.391038, 96.749264, 137.889475, 96.749264),\n (137.889475, 96.749264, 136.387912, 96.749264),\n (136.387912, 96.749264, 134.88635, 96.749264),\n (134.88635, 96.749264, 133.384787, 96.749264),\n (133.384787, 96.749264, 131.883225, 96.749264),\n (131.883225, 96.749264, 130.381663, 96.749264),\n (130.381663, 96.749264, 128.8801, 96.749264),\n (128.8801, 96.749264, 127.378538, 96.749264),\n (127.378538, 96.749264, 125.876975, 96.749264),\n (125.876975, 96.749264, 124.375413, 96.749264),\n (124.375413, 96.749264, 122.87385, 96.749264),\n (122.87385, 96.749264, 121.372287, 96.749264),\n (121.372287, 96.749264, 119.870725, 96.749264),\n (119.870725, 96.749264, 118.369163, 96.749264),\n (118.369163, 96.749264, 116.8676, 96.749264),\n (116.8676, 96.749264, 115.366038, 96.749264),\n (115.366038, 96.749264, 113.864475, 96.749264),\n (113.864475, 96.749264, 112.362913, 96.749264),\n (112.362913, 96.749264, 110.86135, 96.749264),\n (110.86135, 96.749264, 109.359788, 96.749264),\n (109.359788, 96.749264, 107.858225, 96.749264),\n (107.858225, 96.749264, 106.356662, 96.749264),\n (106.356662, 96.749264, 104.8551, 96.749264),\n (152.9051, 96.749264, 152.9051, 99.2258),\n (152.9051, 99.2258, 151.403537, 99.2258),\n (151.403537, 99.2258, 149.901975, 99.2258),\n (149.901975, 99.2258, 148.400412, 99.2258),\n (148.400412, 99.2258, 146.89885, 99.2258),\n (146.89885, 99.2258, 145.397288, 99.2258),\n (145.397288, 99.2258, 143.895725, 99.2258),\n (143.895725, 99.2258, 142.394162, 99.2258),\n (142.394162, 99.2258, 140.8926, 99.2258),\n (140.8926, 99.2258, 139.391038, 99.2258),\n (139.391038, 99.2258, 137.889475, 99.2258),\n (137.889475, 99.2258, 136.387912, 99.2258),\n (136.387912, 99.2258, 134.88635, 99.2258),\n (134.88635, 99.2258, 133.384787, 99.2258),\n (133.384787, 99.2258, 131.883225, 99.2258),\n (131.883225, 99.2258, 130.381663, 99.2258),\n (130.381663, 99.2258, 128.8801, 99.2258),\n (128.8801, 99.2258, 127.378538, 99.2258),\n (127.378538, 99.2258, 125.876975, 99.2258),\n (125.876975, 99.2258, 124.375413, 99.2258),\n (124.375413, 99.2258, 122.87385, 99.2258),\n (122.87385, 99.2258, 121.372287, 99.2258),\n (121.372287, 99.2258, 119.870725, 99.2258),\n (119.870725, 99.2258, 118.369163, 99.2258),\n (118.369163, 99.2258, 116.8676, 99.2258),\n (116.8676, 99.2258, 115.366038, 99.2258),\n (115.366038, 99.2258, 113.864475, 99.2258),\n (113.864475, 99.2258, 112.362913, 99.2258),\n (112.362913, 99.2258, 110.86135, 99.2258),\n (110.86135, 99.2258, 109.359788, 99.2258),\n (109.359788, 99.2258, 107.858225, 99.2258),\n (107.858225, 99.2258, 106.356662, 99.2258),\n (106.356662, 99.2258, 104.8551, 99.2258),\n (104.8551, 99.2258, 104.8551, 96.749264),\n (166.9051, 113.2258, 166.9051, 114.727362),\n (166.9051, 114.727362, 166.9051, 116.228925),\n (166.9051, 116.228925, 166.9051, 117.730487),\n (166.9051, 117.730487, 166.9051, 119.23205),\n (166.9051, 119.23205, 166.9051, 120.733612),\n (166.9051, 120.733612, 166.9051, 122.235175),\n (166.9051, 122.235175, 166.9051, 123.736738),\n (166.9051, 123.736738, 166.9051, 125.2383),\n (166.9051, 125.2383, 166.9051, 126.739863),\n (166.9051, 126.739863, 166.9051, 128.241425),\n (166.9051, 128.241425, 166.9051, 129.742987),\n (166.9051, 129.742987, 166.9051, 131.24455),\n (166.9051, 131.24455, 166.9051, 132.746112),\n (166.9051, 132.746112, 166.9051, 134.247675),\n (166.9051, 134.247675, 166.9051, 135.749237),\n (166.9051, 135.749237, 166.9051, 137.2508),\n (166.9051, 137.2508, 166.9051, 138.752363),\n (166.9051, 138.752363, 166.9051, 140.253925),\n (166.9051, 140.253925, 166.9051, 141.755487),\n (166.9051, 141.755487, 166.9051, 143.25705),\n (166.9051, 143.25705, 166.9051, 144.758612),\n (166.9051, 144.758612, 166.9051, 146.260175),\n (166.9051, 146.260175, 166.9051, 147.761737),\n (166.9051, 147.761737, 166.9051, 149.2633),\n (166.9051, 149.2633, 166.9051, 150.764862),\n (166.9051, 150.764862, 166.9051, 152.266425),\n (166.9051, 152.266425, 166.9051, 153.767987),\n (166.9051, 153.767987, 166.9051, 155.26955),\n (166.9051, 155.26955, 166.9051, 156.771112),\n (166.9051, 156.771112, 166.9051, 158.272675),\n (166.9051, 158.272675, 166.9051, 159.774237),\n (166.9051, 159.774237, 166.9051, 161.2758),\n (169.381636, 113.2258, 169.381636, 114.727362),\n (169.381636, 114.727362, 169.381636, 116.228925),\n (169.381636, 116.228925, 169.381636, 117.730487),\n (169.381636, 117.730487, 169.381636, 119.23205),\n (169.381636, 119.23205, 169.381636, 120.733612),\n (169.381636, 120.733612, 169.381636, 122.235175),\n (169.381636, 122.235175, 169.381636, 123.736738),\n (169.381636, 123.736738, 169.381636, 125.2383),\n (169.381636, 125.2383, 169.381636, 126.739863),\n (169.381636, 126.739863, 169.381636, 128.241425),\n (169.381636, 128.241425, 169.381636, 129.742987),\n (169.381636, 129.742987, 169.381636, 131.24455),\n (169.381636, 131.24455, 169.381636, 132.746112),\n (169.381636, 132.746112, 169.381636, 134.247675),\n (169.381636, 134.247675, 169.381636, 135.749237),\n (169.381636, 135.749237, 169.381636, 137.2508),\n (169.381636, 137.2508, 169.381636, 138.752363),\n (169.381636, 138.752363, 169.381636, 140.253925),\n (169.381636, 140.253925, 169.381636, 141.755487),\n (169.381636, 141.755487, 169.381636, 143.25705),\n (169.381636, 143.25705, 169.381636, 144.758612),\n (169.381636, 144.758612, 169.381636, 146.260175),\n (169.381636, 146.260175, 169.381636, 147.761737),\n (169.381636, 147.761737, 169.381636, 149.2633),\n (169.381636, 149.2633, 169.381636, 150.764862),\n (169.381636, 150.764862, 169.381636, 152.266425),\n (169.381636, 152.266425, 169.381636, 153.767987),\n (169.381636, 153.767987, 169.381636, 155.26955),\n (169.381636, 155.26955, 169.381636, 156.771112),\n (169.381636, 156.771112, 169.381636, 158.272675),\n (169.381636, 158.272675, 169.381636, 159.774237),\n (169.381636, 159.774237, 169.381636, 161.2758),\n (169.381636, 113.2258, 166.9051, 113.2258),\n (169.381636, 161.2758, 166.9051, 161.2758)\n]\nVISIBLE_CIRCLES = [\n (128.8801, 137.2508, 24.025),\n (128.8801, 137.2508, 1.501562)\n]\nVISIBLE_ARCS = [\n\n]\nHIDDEN_SEGMENTS = [\n (130.3817, 99.2258, 130.3817, 96.7492),\n (127.3785, 96.7492, 127.3785, 99.2258),\n (169.3816, 138.7523, 166.9051, 138.7523),\n (169.3816, 135.7492, 166.9051, 135.7492)\n]\n# (orient, text, p1, p2, base) for linear; (orient, text, center, radius, angle) for diameter\nDIMENSIONS = [\n ('diameter', '%%c100', (128.8801, 137.2508), 24.025, 45),\n ('diameter', '%%c6.25', (128.8801, 137.2508), 1.5016, 135),\n ('horizontal', '5.1541', (166.9051, 137.2508), (169.3816, 137.2508), (168.1434, 148.2508))\n]\n\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\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\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,\n angle=(0 if d[0] == \"horizontal\" else 90),\n 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,\n text=text, dimstyle=\"EZDXF\").render()\n\n doc.saveas(out_path)\n\n\nif __name__ == \"__main__\":\n out = sys.argv[1] if len(sys.argv) > 1 else \"0035_00359556_gt.dxf\"\n draw(out)\n print(\"wrote\", out)\n```"}], "images": ["images/0035_00359556.png"], "id": "0035_00359556"} {"messages": [{"role": "user", "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 98.96 mm."}, {"role": "assistant", "content": "```python\n#!/usr/bin/env python3\n# -*- coding: utf-8 -*-\n# Ground-truth 2D engineering drawing for part: 0039_00391896\n# Self-contained: reproduces the three-view DXF via ezdxf, NO FreeCAD needed.\n# Coordinates are A4 page millimetres (scale=0.4830157068062908, page=[297.0, 210.0]).\n# visible edges -> solid (layer OUTLINE); hidden edges -> dashed (layer HIDDEN)\n# dimensions -> real movable DIMENSION entities (text = true mm value)\n# Run: python 0039_00391896_gt.py [out.dxf]\nimport sys\nimport ezdxf\n\nSCALE = 0.4830157068062908\nPAGE = [297.0, 210.0]\n\nVISIBLE_SEGMENTS = [\n (78.638715, 121.823814, 80.148139, 121.823814),\n (80.148139, 121.823814, 81.657563, 121.823814),\n (81.657563, 121.823814, 83.166987, 121.823814),\n (83.166987, 121.823814, 84.676411, 121.823814),\n (84.676411, 121.823814, 86.185835, 121.823814),\n (86.185835, 121.823814, 87.695259, 121.823814),\n (87.695259, 121.823814, 89.204683, 121.823814),\n (89.204683, 121.823814, 90.714107, 121.823814),\n (90.714107, 121.823814, 92.223531, 121.823814),\n (92.223531, 121.823814, 93.732955, 121.823814),\n (93.732955, 121.823814, 95.24238, 121.823814),\n (95.24238, 121.823814, 96.751804, 121.823814),\n (96.751804, 121.823814, 98.261228, 121.823814),\n (98.261228, 121.823814, 99.770652, 121.823814),\n (99.770652, 121.823814, 101.280076, 121.823814),\n (101.280076, 121.823814, 102.7895, 121.823814),\n (102.7895, 121.823814, 104.298924, 121.823814),\n (104.298924, 121.823814, 105.808348, 121.823814),\n (105.808348, 121.823814, 107.317772, 121.823814),\n (107.317772, 121.823814, 108.827196, 121.823814),\n (108.827196, 121.823814, 110.33662, 121.823814),\n (110.33662, 121.823814, 111.846045, 121.823814),\n (111.846045, 121.823814, 113.355469, 121.823814),\n (113.355469, 121.823814, 114.864893, 121.823814),\n (114.864893, 121.823814, 116.374317, 121.823814),\n (116.374317, 121.823814, 117.883741, 121.823814),\n (117.883741, 121.823814, 119.393165, 121.823814),\n (119.393165, 121.823814, 120.902589, 121.823814),\n (120.902589, 121.823814, 122.412013, 121.823814),\n (122.412013, 121.823814, 123.921437, 121.823814),\n (123.921437, 121.823814, 125.430861, 121.823814),\n (125.430861, 121.823814, 126.940285, 121.823814),\n (126.940285, 121.823814, 126.940285, 74.025385),\n (78.638715, 74.025385, 80.148139, 74.025385),\n (80.148139, 74.025385, 81.657563, 74.025385),\n (81.657563, 74.025385, 83.166987, 74.025385),\n (83.166987, 74.025385, 84.676411, 74.025385),\n (84.676411, 74.025385, 86.185835, 74.025385),\n (86.185835, 74.025385, 87.695259, 74.025385),\n (87.695259, 74.025385, 89.204683, 74.025385),\n (89.204683, 74.025385, 90.714107, 74.025385),\n (90.714107, 74.025385, 92.223531, 74.025385),\n (92.223531, 74.025385, 93.732955, 74.025385),\n (93.732955, 74.025385, 95.24238, 74.025385),\n (95.24238, 74.025385, 96.751804, 74.025385),\n (96.751804, 74.025385, 98.261228, 74.025385),\n (98.261228, 74.025385, 99.770652, 74.025385),\n (99.770652, 74.025385, 101.280076, 74.025385),\n (101.280076, 74.025385, 102.7895, 74.025385),\n (102.7895, 74.025385, 104.298924, 74.025385),\n (104.298924, 74.025385, 105.808348, 74.025385),\n (105.808348, 74.025385, 107.317772, 74.025385),\n (107.317772, 74.025385, 108.827196, 74.025385),\n (108.827196, 74.025385, 110.33662, 74.025385),\n (110.33662, 74.025385, 111.846045, 74.025385),\n (111.846045, 74.025385, 113.355469, 74.025385),\n (113.355469, 74.025385, 114.864893, 74.025385),\n (114.864893, 74.025385, 116.374317, 74.025385),\n (116.374317, 74.025385, 117.883741, 74.025385),\n (117.883741, 74.025385, 119.393165, 74.025385),\n (119.393165, 74.025385, 120.902589, 74.025385),\n (120.902589, 74.025385, 122.412013, 74.025385),\n (122.412013, 74.025385, 123.921437, 74.025385),\n (123.921437, 74.025385, 125.430861, 74.025385),\n (125.430861, 74.025385, 126.940285, 74.025385),\n (78.638715, 74.025385, 78.638715, 121.823814),\n (188.738715, 184.125385, 188.738715, 182.615961),\n (188.738715, 182.615961, 188.738715, 181.106537),\n (188.738715, 181.106537, 188.738715, 179.597113),\n (188.738715, 179.597113, 188.738715, 178.087689),\n (188.738715, 178.087689, 188.738715, 176.578265),\n (188.738715, 176.578265, 188.738715, 175.068841),\n (188.738715, 175.068841, 188.738715, 173.559417),\n (188.738715, 173.559417, 188.738715, 172.049993),\n (188.738715, 172.049993, 188.738715, 170.540569),\n (188.738715, 170.540569, 188.738715, 169.031145),\n (188.738715, 169.031145, 188.738715, 167.52172),\n (188.738715, 167.52172, 188.738715, 166.012296),\n (188.738715, 166.012296, 188.738715, 164.502872),\n (188.738715, 164.502872, 188.738715, 162.993448),\n (188.738715, 162.993448, 188.738715, 161.484024),\n (188.738715, 161.484024, 188.738715, 159.9746),\n (188.738715, 159.9746, 188.738715, 158.465176),\n (188.738715, 158.465176, 188.738715, 156.955752),\n (188.738715, 156.955752, 188.738715, 155.446328),\n (188.738715, 155.446328, 188.738715, 153.936904),\n (188.738715, 153.936904, 188.738715, 152.42748),\n (188.738715, 152.42748, 188.738715, 150.918055),\n (188.738715, 150.918055, 188.738715, 149.408631),\n (188.738715, 149.408631, 188.738715, 147.899207),\n (188.738715, 147.899207, 188.738715, 146.389783),\n (188.738715, 146.389783, 188.738715, 144.880359),\n (188.738715, 144.880359, 188.738715, 143.370935),\n (188.738715, 143.370935, 188.738715, 141.861511),\n (188.738715, 141.861511, 188.738715, 140.352087),\n (188.738715, 140.352087, 188.738715, 138.842663),\n (188.738715, 138.842663, 188.738715, 137.333239),\n (188.738715, 137.333239, 188.738715, 135.823815),\n (140.940286, 184.125385, 140.940286, 182.615961),\n (140.940286, 182.615961, 140.940286, 181.106537),\n (140.940286, 181.106537, 140.940286, 179.597113),\n (140.940286, 179.597113, 140.940286, 178.087689),\n (140.940286, 178.087689, 140.940286, 176.578265),\n (140.940286, 176.578265, 140.940286, 175.068841),\n (140.940286, 175.068841, 140.940286, 173.559417),\n (140.940286, 173.559417, 140.940286, 172.049993),\n (140.940286, 172.049993, 140.940286, 170.540569),\n (140.940286, 170.540569, 140.940286, 169.031145),\n (140.940286, 169.031145, 140.940286, 167.52172),\n (140.940286, 167.52172, 140.940286, 166.012296),\n (140.940286, 166.012296, 140.940286, 164.502872),\n (140.940286, 164.502872, 140.940286, 162.993448),\n (140.940286, 162.993448, 140.940286, 161.484024),\n (140.940286, 161.484024, 140.940286, 159.9746),\n (140.940286, 159.9746, 140.940286, 158.465176),\n (140.940286, 158.465176, 140.940286, 156.955752),\n (140.940286, 156.955752, 140.940286, 155.446328),\n (140.940286, 155.446328, 140.940286, 153.936904),\n (140.940286, 153.936904, 140.940286, 152.42748),\n (140.940286, 152.42748, 140.940286, 150.918055),\n (140.940286, 150.918055, 140.940286, 149.408631),\n (140.940286, 149.408631, 140.940286, 147.899207),\n (140.940286, 147.899207, 140.940286, 146.389783),\n (140.940286, 146.389783, 140.940286, 144.880359),\n (140.940286, 144.880359, 140.940286, 143.370935),\n (140.940286, 143.370935, 140.940286, 141.861511),\n (140.940286, 141.861511, 140.940286, 140.352087),\n (140.940286, 140.352087, 140.940286, 138.842663),\n (140.940286, 138.842663, 140.940286, 137.333239),\n (140.940286, 137.333239, 140.940286, 135.823815),\n (140.940286, 184.125385, 188.738715, 184.125385),\n (140.940286, 135.823815, 188.738715, 135.823815)\n]\nVISIBLE_CIRCLES = [\n (102.7895, 159.9746, 24.150785),\n (102.7895, 159.9746, 15.094241)\n]\nVISIBLE_ARCS = [\n\n]\nHIDDEN_SEGMENTS = [\n (117.8838, 74.0254, 117.8838, 121.8238),\n (87.6953, 121.8238, 87.6953, 74.0254),\n (140.9403, 144.8804, 188.7387, 144.8804),\n (140.9403, 175.0688, 188.7387, 175.0688)\n]\n# (orient, text, p1, p2, base) for linear; (orient, text, center, radius, angle) for diameter\nDIMENSIONS = [\n ('diameter', '%%c100', (102.7895, 159.9746), 24.1508, 45),\n ('diameter', '%%c62.5', (102.7895, 159.9746), 15.0942, 135),\n ('horizontal', '98.9583', (188.7387, 159.9746), (140.9403, 159.9746), (164.8395, 148.9746))\n]\n\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\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\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,\n angle=(0 if d[0] == \"horizontal\" else 90),\n 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,\n text=text, dimstyle=\"EZDXF\").render()\n\n doc.saveas(out_path)\n\n\nif __name__ == \"__main__\":\n out = sys.argv[1] if len(sys.argv) > 1 else \"0039_00391896_gt.dxf\"\n draw(out)\n print(\"wrote\", out)\n```"}], "images": ["images/0039_00391896.png"], "id": "0039_00391896"} {"messages": [{"role": "user", "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 93.75 mm. It is extruded to a thickness of 179.25 mm."}, {"role": "assistant", "content": "```python\n#!/usr/bin/env python3\n# -*- coding: utf-8 -*-\n# Ground-truth 2D engineering drawing for part: 0039_00393396\n# Self-contained: reproduces the three-view DXF via ezdxf, NO FreeCAD needed.\n# Coordinates are A4 page millimetres (scale=0.3441418918919756, page=[297.0, 210.0]).\n# visible edges -> solid (layer OUTLINE); hidden edges -> dashed (layer HIDDEN)\n# dimensions -> real movable DIMENSION entities (text = true mm value)\n# Run: python 0039_00393396_gt.py [out.dxf]\nimport sys\nimport ezdxf\n\nSCALE = 0.3441418918919756\nPAGE = [297.0, 210.0]\n\nVISIBLE_SEGMENTS = [\n (80.115305, 132.239405, 81.190749, 132.239405),\n (81.190749, 132.239405, 82.266192, 132.239405),\n (82.266192, 132.239405, 83.341636, 132.239405),\n (83.341636, 132.239405, 84.417079, 132.239405),\n (84.417079, 132.239405, 85.492522, 132.239405),\n (85.492522, 132.239405, 86.567966, 132.239405),\n (86.567966, 132.239405, 87.643409, 132.239405),\n (87.643409, 132.239405, 88.718853, 132.239405),\n (88.718853, 132.239405, 89.794296, 132.239405),\n (89.794296, 132.239405, 90.86974, 132.239405),\n (90.86974, 132.239405, 91.945183, 132.239405),\n (91.945183, 132.239405, 93.020626, 132.239405),\n (93.020626, 132.239405, 94.09607, 132.239405),\n (94.09607, 132.239405, 95.171513, 132.239405),\n (95.171513, 132.239405, 96.246957, 132.239405),\n (96.246957, 132.239405, 97.3224, 132.239405),\n (97.3224, 132.239405, 98.397843, 132.239405),\n (98.397843, 132.239405, 99.473287, 132.239405),\n (99.473287, 132.239405, 100.54873, 132.239405),\n (100.54873, 132.239405, 101.624174, 132.239405),\n (101.624174, 132.239405, 102.699617, 132.239405),\n (102.699617, 132.239405, 103.77506, 132.239405),\n (103.77506, 132.239405, 104.850504, 132.239405),\n (104.850504, 132.239405, 105.925947, 132.239405),\n (105.925947, 132.239405, 107.001391, 132.239405),\n (107.001391, 132.239405, 108.076834, 132.239405),\n (108.076834, 132.239405, 109.152278, 132.239405),\n (109.152278, 132.239405, 110.227721, 132.239405),\n (110.227721, 132.239405, 111.303164, 132.239405),\n (111.303164, 132.239405, 112.378608, 132.239405),\n (112.378608, 132.239405, 113.454051, 132.239405),\n (113.454051, 132.239405, 114.529495, 132.239405),\n (114.529495, 132.239405, 114.529495, 70.553594),\n (80.115305, 70.553594, 81.190749, 70.553594),\n (81.190749, 70.553594, 82.266192, 70.553594),\n (82.266192, 70.553594, 83.341636, 70.553594),\n (83.341636, 70.553594, 84.417079, 70.553594),\n (84.417079, 70.553594, 85.492522, 70.553594),\n (85.492522, 70.553594, 86.567966, 70.553594),\n (86.567966, 70.553594, 87.643409, 70.553594),\n (87.643409, 70.553594, 88.718853, 70.553594),\n (88.718853, 70.553594, 89.794296, 70.553594),\n (89.794296, 70.553594, 90.86974, 70.553594),\n (90.86974, 70.553594, 91.945183, 70.553594),\n (91.945183, 70.553594, 93.020626, 70.553594),\n (93.020626, 70.553594, 94.09607, 70.553594),\n (94.09607, 70.553594, 95.171513, 70.553594),\n (95.171513, 70.553594, 96.246957, 70.553594),\n (96.246957, 70.553594, 97.3224, 70.553594),\n (97.3224, 70.553594, 98.397843, 70.553594),\n (98.397843, 70.553594, 99.473287, 70.553594),\n (99.473287, 70.553594, 100.54873, 70.553594),\n (100.54873, 70.553594, 101.624174, 70.553594),\n (101.624174, 70.553594, 102.699617, 70.553594),\n (102.699617, 70.553594, 103.77506, 70.553594),\n (103.77506, 70.553594, 104.850504, 70.553594),\n (104.850504, 70.553594, 105.925947, 70.553594),\n (105.925947, 70.553594, 107.001391, 70.553594),\n (107.001391, 70.553594, 108.076834, 70.553594),\n (108.076834, 70.553594, 109.152278, 70.553594),\n (109.152278, 70.553594, 110.227721, 70.553594),\n (110.227721, 70.553594, 111.303164, 70.553594),\n (111.303164, 70.553594, 112.378608, 70.553594),\n (112.378608, 70.553594, 113.454051, 70.553594),\n (113.454051, 70.553594, 114.529495, 70.553594),\n (80.115305, 70.553594, 80.115305, 132.239405),\n (190.215306, 180.653595, 190.215306, 179.578151),\n (190.215306, 179.578151, 190.215306, 178.502708),\n (190.215306, 178.502708, 190.215306, 177.427264),\n (190.215306, 177.427264, 190.215306, 176.351821),\n (190.215306, 176.351821, 190.215306, 175.276378),\n (190.215306, 175.276378, 190.215306, 174.200934),\n (190.215306, 174.200934, 190.215306, 173.125491),\n (190.215306, 173.125491, 190.215306, 172.050047),\n (190.215306, 172.050047, 190.215306, 170.974604),\n (190.215306, 170.974604, 190.215306, 169.89916),\n (190.215306, 169.89916, 190.215306, 168.823717),\n (190.215306, 168.823717, 190.215306, 167.748274),\n (190.215306, 167.748274, 190.215306, 166.67283),\n (190.215306, 166.67283, 190.215306, 165.597387),\n (190.215306, 165.597387, 190.215306, 164.521943),\n (190.215306, 164.521943, 190.215306, 163.4465),\n (190.215306, 163.4465, 190.215306, 162.371057),\n (190.215306, 162.371057, 190.215306, 161.295613),\n (190.215306, 161.295613, 190.215306, 160.22017),\n (190.215306, 160.22017, 190.215306, 159.144726),\n (190.215306, 159.144726, 190.215306, 158.069283),\n (190.215306, 158.069283, 190.215306, 156.99384),\n (190.215306, 156.99384, 190.215306, 155.918396),\n (190.215306, 155.918396, 190.215306, 154.842953),\n (190.215306, 154.842953, 190.215306, 153.767509),\n (190.215306, 153.767509, 190.215306, 152.692066),\n (190.215306, 152.692066, 190.215306, 151.616622),\n (190.215306, 151.616622, 190.215306, 150.541179),\n (190.215306, 150.541179, 190.215306, 149.465736),\n (190.215306, 149.465736, 190.215306, 148.390292),\n (190.215306, 148.390292, 190.215306, 147.314849),\n (190.215306, 147.314849, 190.215306, 146.239405),\n (128.529495, 180.653595, 128.529495, 179.578151),\n (128.529495, 179.578151, 128.529495, 178.502708),\n (128.529495, 178.502708, 128.529495, 177.427264),\n (128.529495, 177.427264, 128.529495, 176.351821),\n (128.529495, 176.351821, 128.529495, 175.276378),\n (128.529495, 175.276378, 128.529495, 174.200934),\n (128.529495, 174.200934, 128.529495, 173.125491),\n (128.529495, 173.125491, 128.529495, 172.050047),\n (128.529495, 172.050047, 128.529495, 170.974604),\n (128.529495, 170.974604, 128.529495, 169.89916),\n (128.529495, 169.89916, 128.529495, 168.823717),\n (128.529495, 168.823717, 128.529495, 167.748274),\n (128.529495, 167.748274, 128.529495, 166.67283),\n (128.529495, 166.67283, 128.529495, 165.597387),\n (128.529495, 165.597387, 128.529495, 164.521943),\n (128.529495, 164.521943, 128.529495, 163.4465),\n (128.529495, 163.4465, 128.529495, 162.371057),\n (128.529495, 162.371057, 128.529495, 161.295613),\n (128.529495, 161.295613, 128.529495, 160.22017),\n (128.529495, 160.22017, 128.529495, 159.144726),\n (128.529495, 159.144726, 128.529495, 158.069283),\n (128.529495, 158.069283, 128.529495, 156.99384),\n (128.529495, 156.99384, 128.529495, 155.918396),\n (128.529495, 155.918396, 128.529495, 154.842953),\n (128.529495, 154.842953, 128.529495, 153.767509),\n (128.529495, 153.767509, 128.529495, 152.692066),\n (128.529495, 152.692066, 128.529495, 151.616622),\n (128.529495, 151.616622, 128.529495, 150.541179),\n (128.529495, 150.541179, 128.529495, 149.465736),\n (128.529495, 149.465736, 128.529495, 148.390292),\n (128.529495, 148.390292, 128.529495, 147.314849),\n (128.529495, 147.314849, 128.529495, 146.239405),\n (128.529495, 180.653595, 190.215306, 180.653595),\n (128.529495, 146.239405, 190.215306, 146.239405)\n]\nVISIBLE_CIRCLES = [\n (97.3224, 163.4465, 17.207095),\n (97.3224, 163.4465, 16.131651)\n]\nVISIBLE_ARCS = [\n\n]\nHIDDEN_SEGMENTS = [\n (113.4541, 70.5535, 113.4541, 132.2394),\n (81.1908, 132.2394, 81.1908, 70.5535),\n (128.5295, 147.3148, 190.2153, 147.3148),\n (128.5295, 179.5781, 190.2153, 179.5781)\n]\n# (orient, text, p1, p2, base) for linear; (orient, text, center, radius, angle) for diameter\nDIMENSIONS = [\n ('diameter', '%%c100', (97.3224, 163.4465), 17.2071, 45),\n ('diameter', '%%c93.75', (97.3224, 163.4465), 16.1317, 135),\n ('horizontal', '179.245', (190.2153, 163.4465), (128.5295, 163.4465), (159.3724, 152.4465))\n]\n\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\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\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,\n angle=(0 if d[0] == \"horizontal\" else 90),\n 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,\n text=text, dimstyle=\"EZDXF\").render()\n\n doc.saveas(out_path)\n\n\nif __name__ == \"__main__\":\n out = sys.argv[1] if len(sys.argv) > 1 else \"0039_00393396_gt.dxf\"\n draw(out)\n print(\"wrote\", out)\n```"}], "images": ["images/0039_00393396.png"], "id": "0039_00393396"} {"messages": [{"role": "user", "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 83.33 mm. It is extruded to a thickness of 186.27 mm."}, {"role": "assistant", "content": "```python\n#!/usr/bin/env python3\n# -*- coding: utf-8 -*-\n# Ground-truth 2D engineering drawing for part: 0039_00394836\n# Self-contained: reproduces the three-view DXF via ezdxf, NO FreeCAD needed.\n# Coordinates are A4 page millimetres (scale=0.3356917808219431, page=[297.0, 210.0]).\n# visible edges -> solid (layer OUTLINE); hidden edges -> dashed (layer HIDDEN)\n# dimensions -> real movable DIMENSION entities (text = true mm value)\n# Run: python 0039_00394836_gt.py [out.dxf]\nimport sys\nimport ezdxf\n\nSCALE = 0.3356917808219431\nPAGE = [297.0, 210.0]\n\nVISIBLE_SEGMENTS = [\n (80.757011, 132.873111, 81.806048, 132.873111),\n (81.806048, 132.873111, 82.855085, 132.873111),\n (82.855085, 132.873111, 83.904121, 132.873111),\n (83.904121, 132.873111, 84.953158, 132.873111),\n (84.953158, 132.873111, 86.002195, 132.873111),\n (86.002195, 132.873111, 87.051232, 132.873111),\n (87.051232, 132.873111, 88.100269, 132.873111),\n (88.100269, 132.873111, 89.149305, 132.873111),\n (89.149305, 132.873111, 90.198342, 132.873111),\n (90.198342, 132.873111, 91.247379, 132.873111),\n (91.247379, 132.873111, 92.296416, 132.873111),\n (92.296416, 132.873111, 93.345453, 132.873111),\n (93.345453, 132.873111, 94.39449, 132.873111),\n (94.39449, 132.873111, 95.443526, 132.873111),\n (95.443526, 132.873111, 96.492563, 132.873111),\n (96.492563, 132.873111, 97.5416, 132.873111),\n (97.5416, 132.873111, 98.590637, 132.873111),\n (98.590637, 132.873111, 99.639674, 132.873111),\n (99.639674, 132.873111, 100.68871, 132.873111),\n (100.68871, 132.873111, 101.737747, 132.873111),\n (101.737747, 132.873111, 102.786784, 132.873111),\n (102.786784, 132.873111, 103.835821, 132.873111),\n (103.835821, 132.873111, 104.884858, 132.873111),\n (104.884858, 132.873111, 105.933895, 132.873111),\n (105.933895, 132.873111, 106.982931, 132.873111),\n (106.982931, 132.873111, 108.031968, 132.873111),\n (108.031968, 132.873111, 109.081005, 132.873111),\n (109.081005, 132.873111, 110.130042, 132.873111),\n (110.130042, 132.873111, 111.179079, 132.873111),\n (111.179079, 132.873111, 112.228115, 132.873111),\n (112.228115, 132.873111, 113.277152, 132.873111),\n (113.277152, 132.873111, 114.326189, 132.873111),\n (114.326189, 132.873111, 114.326189, 70.342289),\n (80.757011, 70.342289, 81.806048, 70.342289),\n (81.806048, 70.342289, 82.855085, 70.342289),\n (82.855085, 70.342289, 83.904121, 70.342289),\n (83.904121, 70.342289, 84.953158, 70.342289),\n (84.953158, 70.342289, 86.002195, 70.342289),\n (86.002195, 70.342289, 87.051232, 70.342289),\n (87.051232, 70.342289, 88.100269, 70.342289),\n (88.100269, 70.342289, 89.149305, 70.342289),\n (89.149305, 70.342289, 90.198342, 70.342289),\n (90.198342, 70.342289, 91.247379, 70.342289),\n (91.247379, 70.342289, 92.296416, 70.342289),\n (92.296416, 70.342289, 93.345453, 70.342289),\n (93.345453, 70.342289, 94.39449, 70.342289),\n (94.39449, 70.342289, 95.443526, 70.342289),\n (95.443526, 70.342289, 96.492563, 70.342289),\n (96.492563, 70.342289, 97.5416, 70.342289),\n (97.5416, 70.342289, 98.590637, 70.342289),\n (98.590637, 70.342289, 99.639674, 70.342289),\n (99.639674, 70.342289, 100.68871, 70.342289),\n (100.68871, 70.342289, 101.737747, 70.342289),\n (101.737747, 70.342289, 102.786784, 70.342289),\n (102.786784, 70.342289, 103.835821, 70.342289),\n (103.835821, 70.342289, 104.884858, 70.342289),\n (104.884858, 70.342289, 105.933895, 70.342289),\n (105.933895, 70.342289, 106.982931, 70.342289),\n (106.982931, 70.342289, 108.031968, 70.342289),\n (108.031968, 70.342289, 109.081005, 70.342289),\n (109.081005, 70.342289, 110.130042, 70.342289),\n (110.130042, 70.342289, 111.179079, 70.342289),\n (111.179079, 70.342289, 112.228115, 70.342289),\n (112.228115, 70.342289, 113.277152, 70.342289),\n (113.277152, 70.342289, 114.326189, 70.342289),\n (80.757011, 70.342289, 80.757011, 132.873111),\n (190.857011, 180.442289, 190.857011, 179.393252),\n (190.857011, 179.393252, 190.857011, 178.344215),\n (190.857011, 178.344215, 190.857011, 177.295179),\n (190.857011, 177.295179, 190.857011, 176.246142),\n (190.857011, 176.246142, 190.857011, 175.197105),\n (190.857011, 175.197105, 190.857011, 174.148068),\n (190.857011, 174.148068, 190.857011, 173.099031),\n (190.857011, 173.099031, 190.857011, 172.049995),\n (190.857011, 172.049995, 190.857011, 171.000958),\n (190.857011, 171.000958, 190.857011, 169.951921),\n (190.857011, 169.951921, 190.857011, 168.902884),\n (190.857011, 168.902884, 190.857011, 167.853847),\n (190.857011, 167.853847, 190.857011, 166.80481),\n (190.857011, 166.80481, 190.857011, 165.755774),\n (190.857011, 165.755774, 190.857011, 164.706737),\n (190.857011, 164.706737, 190.857011, 163.6577),\n (190.857011, 163.6577, 190.857011, 162.608663),\n (190.857011, 162.608663, 190.857011, 161.559626),\n (190.857011, 161.559626, 190.857011, 160.51059),\n (190.857011, 160.51059, 190.857011, 159.461553),\n (190.857011, 159.461553, 190.857011, 158.412516),\n (190.857011, 158.412516, 190.857011, 157.363479),\n (190.857011, 157.363479, 190.857011, 156.314442),\n (190.857011, 156.314442, 190.857011, 155.265405),\n (190.857011, 155.265405, 190.857011, 154.216369),\n (190.857011, 154.216369, 190.857011, 153.167332),\n (190.857011, 153.167332, 190.857011, 152.118295),\n (190.857011, 152.118295, 190.857011, 151.069258),\n (190.857011, 151.069258, 190.857011, 150.020221),\n (190.857011, 150.020221, 190.857011, 148.971185),\n (190.857011, 148.971185, 190.857011, 147.922148),\n (190.857011, 147.922148, 190.857011, 146.873111),\n (128.326189, 180.442289, 128.326189, 179.393252),\n (128.326189, 179.393252, 128.326189, 178.344215),\n (128.326189, 178.344215, 128.326189, 177.295179),\n (128.326189, 177.295179, 128.326189, 176.246142),\n (128.326189, 176.246142, 128.326189, 175.197105),\n (128.326189, 175.197105, 128.326189, 174.148068),\n (128.326189, 174.148068, 128.326189, 173.099031),\n (128.326189, 173.099031, 128.326189, 172.049995),\n (128.326189, 172.049995, 128.326189, 171.000958),\n (128.326189, 171.000958, 128.326189, 169.951921),\n (128.326189, 169.951921, 128.326189, 168.902884),\n (128.326189, 168.902884, 128.326189, 167.853847),\n (128.326189, 167.853847, 128.326189, 166.80481),\n (128.326189, 166.80481, 128.326189, 165.755774),\n (128.326189, 165.755774, 128.326189, 164.706737),\n (128.326189, 164.706737, 128.326189, 163.6577),\n (128.326189, 163.6577, 128.326189, 162.608663),\n (128.326189, 162.608663, 128.326189, 161.559626),\n (128.326189, 161.559626, 128.326189, 160.51059),\n (128.326189, 160.51059, 128.326189, 159.461553),\n (128.326189, 159.461553, 128.326189, 158.412516),\n (128.326189, 158.412516, 128.326189, 157.363479),\n (128.326189, 157.363479, 128.326189, 156.314442),\n (128.326189, 156.314442, 128.326189, 155.265405),\n (128.326189, 155.265405, 128.326189, 154.216369),\n (128.326189, 154.216369, 128.326189, 153.167332),\n (128.326189, 153.167332, 128.326189, 152.118295),\n (128.326189, 152.118295, 128.326189, 151.069258),\n (128.326189, 151.069258, 128.326189, 150.020221),\n (128.326189, 150.020221, 128.326189, 148.971185),\n (128.326189, 148.971185, 128.326189, 147.922148),\n (128.326189, 147.922148, 128.326189, 146.873111),\n (128.326189, 180.442289, 190.857011, 180.442289),\n (128.326189, 146.873111, 190.857011, 146.873111)\n]\nVISIBLE_CIRCLES = [\n (97.5416, 163.6577, 16.784589),\n (97.5416, 163.6577, 13.987158)\n]\nVISIBLE_ARCS = [\n\n]\nHIDDEN_SEGMENTS = [\n (111.5288, 70.3423, 111.5288, 132.8731),\n (83.5545, 132.8731, 83.5545, 70.3423),\n (128.3262, 149.6705, 190.8571, 149.6705),\n (128.3262, 177.6449, 190.8571, 177.6449)\n]\n# (orient, text, p1, p2, base) for linear; (orient, text, center, radius, angle) for diameter\nDIMENSIONS = [\n ('diameter', '%%c100', (97.5416, 163.6577), 16.7846, 45),\n ('diameter', '%%c83.3333', (97.5416, 163.6577), 13.9872, 135),\n ('horizontal', '186.274', (190.8571, 163.6577), (128.3262, 163.6577), (159.5917, 152.6577))\n]\n\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\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\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,\n angle=(0 if d[0] == \"horizontal\" else 90),\n 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,\n text=text, dimstyle=\"EZDXF\").render()\n\n doc.saveas(out_path)\n\n\nif __name__ == \"__main__\":\n out = sys.argv[1] if len(sys.argv) > 1 else \"0039_00394836_gt.dxf\"\n draw(out)\n print(\"wrote\", out)\n```"}], "images": ["images/0039_00394836.png"], "id": "0039_00394836"} {"messages": [{"role": "user", "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 20.83 mm. It is extruded to a thickness of 36.08 mm."}, {"role": "assistant", "content": "```python\n#!/usr/bin/env python3\n# -*- coding: utf-8 -*-\n# Ground-truth 2D engineering drawing for part: 0040_00408271\n# Self-contained: reproduces the three-view DXF via ezdxf, NO FreeCAD needed.\n# Coordinates are A4 page millimetres (scale=0.706209712144166, page=[297.0, 210.0]).\n# visible edges -> solid (layer OUTLINE); hidden edges -> dashed (layer HIDDEN)\n# dimensions -> real movable DIMENSION entities (text = true mm value)\n# Run: python 0040_00408271_gt.py [out.dxf]\nimport sys\nimport ezdxf\n\nSCALE = 0.706209712144166\nPAGE = [297.0, 210.0]\n\nVISIBLE_SEGMENTS = [\n (148.404286, 79.605285, 146.19738, 79.605285),\n (146.19738, 79.605285, 143.990475, 79.605285),\n (143.990475, 79.605285, 141.78357, 79.605285),\n (141.78357, 79.605285, 139.576664, 79.605285),\n (139.576664, 79.605285, 137.369759, 79.605285),\n (137.369759, 79.605285, 135.162854, 79.605285),\n (135.162854, 79.605285, 132.955948, 79.605285),\n (132.955948, 79.605285, 130.749043, 79.605285),\n (130.749043, 79.605285, 128.542137, 79.605285),\n (128.542137, 79.605285, 126.335232, 79.605285),\n (126.335232, 79.605285, 124.128327, 79.605285),\n (124.128327, 79.605285, 121.921421, 79.605285),\n (121.921421, 79.605285, 119.714516, 79.605285),\n (119.714516, 79.605285, 117.507611, 79.605285),\n (117.507611, 79.605285, 115.300705, 79.605285),\n (115.300705, 79.605285, 113.0938, 79.605285),\n (113.0938, 79.605285, 110.886895, 79.605285),\n (110.886895, 79.605285, 108.679989, 79.605285),\n (108.679989, 79.605285, 106.473084, 79.605285),\n (106.473084, 79.605285, 104.266179, 79.605285),\n (104.266179, 79.605285, 102.059273, 79.605285),\n (102.059273, 79.605285, 99.852368, 79.605285),\n (99.852368, 79.605285, 97.645463, 79.605285),\n (97.645463, 79.605285, 95.438557, 79.605285),\n (95.438557, 79.605285, 93.231652, 79.605285),\n (93.231652, 79.605285, 91.024746, 79.605285),\n (91.024746, 79.605285, 88.817841, 79.605285),\n (88.817841, 79.605285, 86.610936, 79.605285),\n (86.610936, 79.605285, 84.40403, 79.605285),\n (84.40403, 79.605285, 82.197125, 79.605285),\n (82.197125, 79.605285, 79.99022, 79.605285),\n (79.99022, 79.605285, 77.783314, 79.605285),\n (148.404286, 79.605285, 148.404286, 105.084314),\n (148.404286, 105.084314, 146.19738, 105.084314),\n (146.19738, 105.084314, 143.990475, 105.084314),\n (143.990475, 105.084314, 141.78357, 105.084314),\n (141.78357, 105.084314, 139.576664, 105.084314),\n (139.576664, 105.084314, 137.369759, 105.084314),\n (137.369759, 105.084314, 135.162854, 105.084314),\n (135.162854, 105.084314, 132.955948, 105.084314),\n (132.955948, 105.084314, 130.749043, 105.084314),\n (130.749043, 105.084314, 128.542137, 105.084314),\n (128.542137, 105.084314, 126.335232, 105.084314),\n (126.335232, 105.084314, 124.128327, 105.084314),\n (124.128327, 105.084314, 121.921421, 105.084314),\n (121.921421, 105.084314, 119.714516, 105.084314),\n (119.714516, 105.084314, 117.507611, 105.084314),\n (117.507611, 105.084314, 115.300705, 105.084314),\n (115.300705, 105.084314, 113.0938, 105.084314),\n (113.0938, 105.084314, 110.886895, 105.084314),\n (110.886895, 105.084314, 108.679989, 105.084314),\n (108.679989, 105.084314, 106.473084, 105.084314),\n (106.473084, 105.084314, 104.266179, 105.084314),\n (104.266179, 105.084314, 102.059273, 105.084314),\n (102.059273, 105.084314, 99.852368, 105.084314),\n (99.852368, 105.084314, 97.645463, 105.084314),\n (97.645463, 105.084314, 95.438557, 105.084314),\n (95.438557, 105.084314, 93.231652, 105.084314),\n (93.231652, 105.084314, 91.024746, 105.084314),\n (91.024746, 105.084314, 88.817841, 105.084314),\n (88.817841, 105.084314, 86.610936, 105.084314),\n (86.610936, 105.084314, 84.40403, 105.084314),\n (84.40403, 105.084314, 82.197125, 105.084314),\n (82.197125, 105.084314, 79.99022, 105.084314),\n (79.99022, 105.084314, 77.783314, 105.084314),\n (77.783314, 105.084314, 77.783314, 79.605285),\n (162.404286, 119.084314, 162.404286, 121.29122),\n (162.404286, 121.29122, 162.404286, 123.498125),\n (162.404286, 123.498125, 162.404286, 125.70503),\n (162.404286, 125.70503, 162.404286, 127.911936),\n (162.404286, 127.911936, 162.404286, 130.118841),\n (162.404286, 130.118841, 162.404286, 132.325746),\n (162.404286, 132.325746, 162.404286, 134.532652),\n (162.404286, 134.532652, 162.404286, 136.739557),\n (162.404286, 136.739557, 162.404286, 138.946463),\n (162.404286, 138.946463, 162.404286, 141.153368),\n (162.404286, 141.153368, 162.404286, 143.360273),\n (162.404286, 143.360273, 162.404286, 145.567179),\n (162.404286, 145.567179, 162.404286, 147.774084),\n (162.404286, 147.774084, 162.404286, 149.980989),\n (162.404286, 149.980989, 162.404286, 152.187895),\n (162.404286, 152.187895, 162.404286, 154.3948),\n (162.404286, 154.3948, 162.404286, 156.601705),\n (162.404286, 156.601705, 162.404286, 158.808611),\n (162.404286, 158.808611, 162.404286, 161.015516),\n (162.404286, 161.015516, 162.404286, 163.222421),\n (162.404286, 163.222421, 162.404286, 165.429327),\n (162.404286, 165.429327, 162.404286, 167.636232),\n (162.404286, 167.636232, 162.404286, 169.843137),\n (162.404286, 169.843137, 162.404286, 172.050043),\n (162.404286, 172.050043, 162.404286, 174.256948),\n (162.404286, 174.256948, 162.404286, 176.463854),\n (162.404286, 176.463854, 162.404286, 178.670759),\n (162.404286, 178.670759, 162.404286, 180.877664),\n (162.404286, 180.877664, 162.404286, 183.08457),\n (162.404286, 183.08457, 162.404286, 185.291475),\n (162.404286, 185.291475, 162.404286, 187.49838),\n (162.404286, 187.49838, 162.404286, 189.705286),\n (187.883315, 119.084314, 187.883315, 121.29122),\n (187.883315, 121.29122, 187.883315, 123.498125),\n (187.883315, 123.498125, 187.883315, 125.70503),\n (187.883315, 125.70503, 187.883315, 127.911936),\n (187.883315, 127.911936, 187.883315, 130.118841),\n (187.883315, 130.118841, 187.883315, 132.325746),\n (187.883315, 132.325746, 187.883315, 134.532652),\n (187.883315, 134.532652, 187.883315, 136.739557),\n (187.883315, 136.739557, 187.883315, 138.946463),\n (187.883315, 138.946463, 187.883315, 141.153368),\n (187.883315, 141.153368, 187.883315, 143.360273),\n (187.883315, 143.360273, 187.883315, 145.567179),\n (187.883315, 145.567179, 187.883315, 147.774084),\n (187.883315, 147.774084, 187.883315, 149.980989),\n (187.883315, 149.980989, 187.883315, 152.187895),\n (187.883315, 152.187895, 187.883315, 154.3948),\n (187.883315, 154.3948, 187.883315, 156.601705),\n (187.883315, 156.601705, 187.883315, 158.808611),\n (187.883315, 158.808611, 187.883315, 161.015516),\n (187.883315, 161.015516, 187.883315, 163.222421),\n (187.883315, 163.222421, 187.883315, 165.429327),\n (187.883315, 165.429327, 187.883315, 167.636232),\n (187.883315, 167.636232, 187.883315, 169.843137),\n (187.883315, 169.843137, 187.883315, 172.050043),\n (187.883315, 172.050043, 187.883315, 174.256948),\n (187.883315, 174.256948, 187.883315, 176.463854),\n (187.883315, 176.463854, 187.883315, 178.670759),\n (187.883315, 178.670759, 187.883315, 180.877664),\n (187.883315, 180.877664, 187.883315, 183.08457),\n (187.883315, 183.08457, 187.883315, 185.291475),\n (187.883315, 185.291475, 187.883315, 187.49838),\n (187.883315, 187.49838, 187.883315, 189.705286),\n (187.883315, 119.084314, 162.404286, 119.084314),\n (187.883315, 189.705286, 162.404286, 189.705286)\n]\nVISIBLE_CIRCLES = [\n (113.0938, 154.3948, 35.310486),\n (113.0938, 154.3948, 7.356351)\n]\nVISIBLE_ARCS = [\n\n]\nHIDDEN_SEGMENTS = [\n (120.4501, 105.0843, 120.4501, 79.6052),\n (105.7374, 79.6052, 105.7374, 105.0843),\n (187.8833, 161.7511, 162.4043, 161.7511),\n (187.8833, 147.0384, 162.4043, 147.0384)\n]\n# (orient, text, p1, p2, base) for linear; (orient, text, center, radius, angle) for diameter\nDIMENSIONS = [\n ('diameter', '%%c100', (113.0938, 154.3948), 35.3105, 45),\n ('diameter', '%%c20.8333', (113.0938, 154.3948), 7.3563, 135),\n ('horizontal', '36.0786', (162.4043, 154.3948), (187.8833, 154.3948), (175.1438, 165.3948))\n]\n\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\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\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,\n angle=(0 if d[0] == \"horizontal\" else 90),\n 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,\n text=text, dimstyle=\"EZDXF\").render()\n\n doc.saveas(out_path)\n\n\nif __name__ == \"__main__\":\n out = sys.argv[1] if len(sys.argv) > 1 else \"0040_00408271_gt.dxf\"\n draw(out)\n print(\"wrote\", out)\n```"}], "images": ["images/0040_00408271.png"], "id": "0040_00408271"} {"messages": [{"role": "user", "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": "assistant", "content": "```python\n#!/usr/bin/env python3\n# -*- coding: utf-8 -*-\n# Ground-truth 2D engineering drawing for part: 0041_00412910\n# Self-contained: reproduces the three-view DXF via ezdxf, NO FreeCAD needed.\n# Coordinates are A4 page millimetres (scale=0.6029803921568627, page=[297.0, 210.0]).\n# visible edges -> solid (layer OUTLINE); hidden edges -> dashed (layer HIDDEN)\n# dimensions -> real movable DIMENSION entities (text = true mm value)\n# Run: python 0041_00412910_gt.py [out.dxf]\nimport sys\nimport ezdxf\n\nSCALE = 0.6029803921568627\nPAGE = [297.0, 210.0]\n\nVISIBLE_SEGMENTS = [\n (137.28512, 77.024519, 135.400806, 77.024519),\n (135.400806, 77.024519, 133.516492, 77.024519),\n (133.516492, 77.024519, 131.632178, 77.024519),\n (131.632178, 77.024519, 129.747865, 77.024519),\n (129.747865, 77.024519, 127.863551, 77.024519),\n (127.863551, 77.024519, 125.979237, 77.024519),\n (125.979237, 77.024519, 124.094924, 77.024519),\n (124.094924, 77.024519, 122.21061, 77.024519),\n (122.21061, 77.024519, 120.326296, 77.024519),\n (120.326296, 77.024519, 118.441982, 77.024519),\n (118.441982, 77.024519, 116.557669, 77.024519),\n (116.557669, 77.024519, 114.673355, 77.024519),\n (114.673355, 77.024519, 112.789041, 77.024519),\n (112.789041, 77.024519, 110.904727, 77.024519),\n (110.904727, 77.024519, 109.020414, 77.024519),\n (109.020414, 77.024519, 107.1361, 77.024519),\n (107.1361, 77.024519, 105.251786, 77.024519),\n (105.251786, 77.024519, 103.367473, 77.024519),\n (103.367473, 77.024519, 101.483159, 77.024519),\n (101.483159, 77.024519, 99.598845, 77.024519),\n (99.598845, 77.024519, 97.714531, 77.024519),\n (97.714531, 77.024519, 95.830218, 77.024519),\n (95.830218, 77.024519, 93.945904, 77.024519),\n (93.945904, 77.024519, 92.06159, 77.024519),\n (92.06159, 77.024519, 90.177276, 77.024519),\n (90.177276, 77.024519, 88.292963, 77.024519),\n (88.292963, 77.024519, 86.408649, 77.024519),\n (86.408649, 77.024519, 84.524335, 77.024519),\n (84.524335, 77.024519, 82.640022, 77.024519),\n (82.640022, 77.024519, 80.755708, 77.024519),\n (80.755708, 77.024519, 78.871394, 77.024519),\n (78.871394, 77.024519, 76.98708, 77.024519),\n (137.28512, 77.024519, 137.28512, 112.82648),\n (137.28512, 112.82648, 135.400806, 112.82648),\n (135.400806, 112.82648, 133.516492, 112.82648),\n (133.516492, 112.82648, 131.632178, 112.82648),\n (131.632178, 112.82648, 129.747865, 112.82648),\n (129.747865, 112.82648, 127.863551, 112.82648),\n (127.863551, 112.82648, 125.979237, 112.82648),\n (125.979237, 112.82648, 124.094924, 112.82648),\n (124.094924, 112.82648, 122.21061, 112.82648),\n (122.21061, 112.82648, 120.326296, 112.82648),\n (120.326296, 112.82648, 118.441982, 112.82648),\n (118.441982, 112.82648, 116.557669, 112.82648),\n (116.557669, 112.82648, 114.673355, 112.82648),\n (114.673355, 112.82648, 112.789041, 112.82648),\n (112.789041, 112.82648, 110.904727, 112.82648),\n (110.904727, 112.82648, 109.020414, 112.82648),\n (109.020414, 112.82648, 107.1361, 112.82648),\n (107.1361, 112.82648, 105.251786, 112.82648),\n (105.251786, 112.82648, 103.367473, 112.82648),\n (103.367473, 112.82648, 101.483159, 112.82648),\n (101.483159, 112.82648, 99.598845, 112.82648),\n (99.598845, 112.82648, 97.714531, 112.82648),\n (97.714531, 112.82648, 95.830218, 112.82648),\n (95.830218, 112.82648, 93.945904, 112.82648),\n (93.945904, 112.82648, 92.06159, 112.82648),\n (92.06159, 112.82648, 90.177276, 112.82648),\n (90.177276, 112.82648, 88.292963, 112.82648),\n (88.292963, 112.82648, 86.408649, 112.82648),\n (86.408649, 112.82648, 84.524335, 112.82648),\n (84.524335, 112.82648, 82.640022, 112.82648),\n (82.640022, 112.82648, 80.755708, 112.82648),\n (80.755708, 112.82648, 78.871394, 112.82648),\n (78.871394, 112.82648, 76.98708, 112.82648),\n (76.98708, 112.82648, 76.98708, 77.024519),\n (151.28512, 126.82648, 151.28512, 128.710794),\n (151.28512, 128.710794, 151.28512, 130.595108),\n (151.28512, 130.595108, 151.28512, 132.479422),\n (151.28512, 132.479422, 151.28512, 134.363735),\n (151.28512, 134.363735, 151.28512, 136.248049),\n (151.28512, 136.248049, 151.28512, 138.132363),\n (151.28512, 138.132363, 151.28512, 140.016676),\n (151.28512, 140.016676, 151.28512, 141.90099),\n (151.28512, 141.90099, 151.28512, 143.785304),\n (151.28512, 143.785304, 151.28512, 145.669618),\n (151.28512, 145.669618, 151.28512, 147.553931),\n (151.28512, 147.553931, 151.28512, 149.438245),\n (151.28512, 149.438245, 151.28512, 151.322559),\n (151.28512, 151.322559, 151.28512, 153.206873),\n (151.28512, 153.206873, 151.28512, 155.091186),\n (151.28512, 155.091186, 151.28512, 156.9755),\n (151.28512, 156.9755, 151.28512, 158.859814),\n (151.28512, 158.859814, 151.28512, 160.744127),\n (151.28512, 160.744127, 151.28512, 162.628441),\n (151.28512, 162.628441, 151.28512, 164.512755),\n (151.28512, 164.512755, 151.28512, 166.397069),\n (151.28512, 166.397069, 151.28512, 168.281382),\n (151.28512, 168.281382, 151.28512, 170.165696),\n (151.28512, 170.165696, 151.28512, 172.05001),\n (151.28512, 172.05001, 151.28512, 173.934324),\n (151.28512, 173.934324, 151.28512, 175.818637),\n (151.28512, 175.818637, 151.28512, 177.702951),\n (151.28512, 177.702951, 151.28512, 179.587265),\n (151.28512, 179.587265, 151.28512, 181.471578),\n (151.28512, 181.471578, 151.28512, 183.355892),\n (151.28512, 183.355892, 151.28512, 185.240206),\n (151.28512, 185.240206, 151.28512, 187.12452),\n (187.087081, 126.82648, 187.087081, 128.710794),\n (187.087081, 128.710794, 187.087081, 130.595108),\n (187.087081, 130.595108, 187.087081, 132.479422),\n (187.087081, 132.479422, 187.087081, 134.363735),\n (187.087081, 134.363735, 187.087081, 136.248049),\n (187.087081, 136.248049, 187.087081, 138.132363),\n (187.087081, 138.132363, 187.087081, 140.016676),\n (187.087081, 140.016676, 187.087081, 141.90099),\n (187.087081, 141.90099, 187.087081, 143.785304),\n (187.087081, 143.785304, 187.087081, 145.669618),\n (187.087081, 145.669618, 187.087081, 147.553931),\n (187.087081, 147.553931, 187.087081, 149.438245),\n (187.087081, 149.438245, 187.087081, 151.322559),\n (187.087081, 151.322559, 187.087081, 153.206873),\n (187.087081, 153.206873, 187.087081, 155.091186),\n (187.087081, 155.091186, 187.087081, 156.9755),\n (187.087081, 156.9755, 187.087081, 158.859814),\n (187.087081, 158.859814, 187.087081, 160.744127),\n (187.087081, 160.744127, 187.087081, 162.628441),\n (187.087081, 162.628441, 187.087081, 164.512755),\n (187.087081, 164.512755, 187.087081, 166.397069),\n (187.087081, 166.397069, 187.087081, 168.281382),\n (187.087081, 168.281382, 187.087081, 170.165696),\n (187.087081, 170.165696, 187.087081, 172.05001),\n (187.087081, 172.05001, 187.087081, 173.934324),\n (187.087081, 173.934324, 187.087081, 175.818637),\n (187.087081, 175.818637, 187.087081, 177.702951),\n (187.087081, 177.702951, 187.087081, 179.587265),\n (187.087081, 179.587265, 187.087081, 181.471578),\n (187.087081, 181.471578, 187.087081, 183.355892),\n (187.087081, 183.355892, 187.087081, 185.240206),\n (187.087081, 185.240206, 187.087081, 187.12452),\n (187.087081, 126.82648, 151.28512, 126.82648),\n (187.087081, 187.12452, 151.28512, 187.12452)\n]\nVISIBLE_CIRCLES = [\n (107.1361, 156.9755, 30.14902),\n (107.1361, 156.9755, 15.702614)\n]\nVISIBLE_ARCS = [\n\n]\nHIDDEN_SEGMENTS = [\n (122.8387, 112.8265, 122.8387, 77.0245),\n (91.4335, 77.0245, 91.4335, 112.8265),\n (187.0871, 172.6781, 151.2851, 172.6781),\n (187.0871, 141.2729, 151.2851, 141.2729)\n]\n# (orient, text, p1, p2, base) for linear; (orient, text, center, radius, angle) for diameter\nDIMENSIONS = [\n ('diameter', '%%c100', (107.1361, 156.9755), 30.149, 45),\n ('diameter', '%%c52.0833', (107.1361, 156.9755), 15.7026, 135),\n ('horizontal', '59.375', (151.2851, 156.9755), (187.0871, 156.9755), (169.1861, 167.9755))\n]\n\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\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\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,\n angle=(0 if d[0] == \"horizontal\" else 90),\n 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,\n text=text, dimstyle=\"EZDXF\").render()\n\n doc.saveas(out_path)\n\n\nif __name__ == \"__main__\":\n out = sys.argv[1] if len(sys.argv) > 1 else \"0041_00412910_gt.dxf\"\n draw(out)\n print(\"wrote\", out)\n```"}], "images": ["images/0041_00412910.png"], "id": "0041_00412910"} {"messages": [{"role": "user", "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 50 mm. It is extruded to a thickness of 19.59 mm."}, {"role": "assistant", "content": "```python\n#!/usr/bin/env python3\n# -*- coding: utf-8 -*-\n# Ground-truth 2D engineering drawing for part: 0041_00413027\n# Self-contained: reproduces the three-view DXF via ezdxf, NO FreeCAD needed.\n# Coordinates are A4 page millimetres (scale=0.8036091098811375, page=[297.0, 210.0]).\n# visible edges -> solid (layer OUTLINE); hidden edges -> dashed (layer HIDDEN)\n# dimensions -> real movable DIMENSION entities (text = true mm value)\n# Run: python 0041_00413027_gt.py [out.dxf]\nimport sys\nimport ezdxf\n\nSCALE = 0.8036091098811375\nPAGE = [297.0, 210.0]\n\nVISIBLE_SEGMENTS = [\n (153.743255, 82.040255, 151.231977, 82.040255),\n (151.231977, 82.040255, 148.720699, 82.040255),\n (148.720699, 82.040255, 146.20942, 82.040255),\n (146.20942, 82.040255, 143.698142, 82.040255),\n (143.698142, 82.040255, 141.186863, 82.040255),\n (141.186863, 82.040255, 138.675585, 82.040255),\n (138.675585, 82.040255, 136.164306, 82.040255),\n (136.164306, 82.040255, 133.653028, 82.040255),\n (133.653028, 82.040255, 131.141749, 82.040255),\n (131.141749, 82.040255, 128.630471, 82.040255),\n (128.630471, 82.040255, 126.119192, 82.040255),\n (126.119192, 82.040255, 123.607914, 82.040255),\n (123.607914, 82.040255, 121.096635, 82.040255),\n (121.096635, 82.040255, 118.585357, 82.040255),\n (118.585357, 82.040255, 116.074078, 82.040255),\n (116.074078, 82.040255, 113.5628, 82.040255),\n (113.5628, 82.040255, 111.051522, 82.040255),\n (111.051522, 82.040255, 108.540243, 82.040255),\n (108.540243, 82.040255, 106.028965, 82.040255),\n (106.028965, 82.040255, 103.517686, 82.040255),\n (103.517686, 82.040255, 101.006408, 82.040255),\n (101.006408, 82.040255, 98.495129, 82.040255),\n (98.495129, 82.040255, 95.983851, 82.040255),\n (95.983851, 82.040255, 93.472572, 82.040255),\n (93.472572, 82.040255, 90.961294, 82.040255),\n (90.961294, 82.040255, 88.450015, 82.040255),\n (88.450015, 82.040255, 85.938737, 82.040255),\n (85.938737, 82.040255, 83.427458, 82.040255),\n (83.427458, 82.040255, 80.91618, 82.040255),\n (80.91618, 82.040255, 78.404901, 82.040255),\n (78.404901, 82.040255, 75.893623, 82.040255),\n (75.893623, 82.040255, 73.382345, 82.040255),\n (153.743255, 82.040255, 153.743255, 97.779344),\n (153.743255, 97.779344, 151.231977, 97.779344),\n (151.231977, 97.779344, 148.720699, 97.779344),\n (148.720699, 97.779344, 146.20942, 97.779344),\n (146.20942, 97.779344, 143.698142, 97.779344),\n (143.698142, 97.779344, 141.186863, 97.779344),\n (141.186863, 97.779344, 138.675585, 97.779344),\n (138.675585, 97.779344, 136.164306, 97.779344),\n (136.164306, 97.779344, 133.653028, 97.779344),\n (133.653028, 97.779344, 131.141749, 97.779344),\n (131.141749, 97.779344, 128.630471, 97.779344),\n (128.630471, 97.779344, 126.119192, 97.779344),\n (126.119192, 97.779344, 123.607914, 97.779344),\n (123.607914, 97.779344, 121.096635, 97.779344),\n (121.096635, 97.779344, 118.585357, 97.779344),\n (118.585357, 97.779344, 116.074078, 97.779344),\n (116.074078, 97.779344, 113.5628, 97.779344),\n (113.5628, 97.779344, 111.051522, 97.779344),\n (111.051522, 97.779344, 108.540243, 97.779344),\n (108.540243, 97.779344, 106.028965, 97.779344),\n (106.028965, 97.779344, 103.517686, 97.779344),\n (103.517686, 97.779344, 101.006408, 97.779344),\n (101.006408, 97.779344, 98.495129, 97.779344),\n (98.495129, 97.779344, 95.983851, 97.779344),\n (95.983851, 97.779344, 93.472572, 97.779344),\n (93.472572, 97.779344, 90.961294, 97.779344),\n (90.961294, 97.779344, 88.450015, 97.779344),\n (88.450015, 97.779344, 85.938737, 97.779344),\n (85.938737, 97.779344, 83.427458, 97.779344),\n (83.427458, 97.779344, 80.91618, 97.779344),\n (80.91618, 97.779344, 78.404901, 97.779344),\n (78.404901, 97.779344, 75.893623, 97.779344),\n (75.893623, 97.779344, 73.382345, 97.779344),\n (73.382345, 97.779344, 73.382345, 82.040255),\n (167.743256, 111.779345, 167.743256, 114.290623),\n (167.743256, 114.290623, 167.743256, 116.801901),\n (167.743256, 116.801901, 167.743256, 119.31318),\n (167.743256, 119.31318, 167.743256, 121.824458),\n (167.743256, 121.824458, 167.743256, 124.335737),\n (167.743256, 124.335737, 167.743256, 126.847015),\n (167.743256, 126.847015, 167.743256, 129.358294),\n (167.743256, 129.358294, 167.743256, 131.869572),\n (167.743256, 131.869572, 167.743256, 134.380851),\n (167.743256, 134.380851, 167.743256, 136.892129),\n (167.743256, 136.892129, 167.743256, 139.403408),\n (167.743256, 139.403408, 167.743256, 141.914686),\n (167.743256, 141.914686, 167.743256, 144.425965),\n (167.743256, 144.425965, 167.743256, 146.937243),\n (167.743256, 146.937243, 167.743256, 149.448522),\n (167.743256, 149.448522, 167.743256, 151.9598),\n (167.743256, 151.9598, 167.743256, 154.471078),\n (167.743256, 154.471078, 167.743256, 156.982357),\n (167.743256, 156.982357, 167.743256, 159.493635),\n (167.743256, 159.493635, 167.743256, 162.004914),\n (167.743256, 162.004914, 167.743256, 164.516192),\n (167.743256, 164.516192, 167.743256, 167.027471),\n (167.743256, 167.027471, 167.743256, 169.538749),\n (167.743256, 169.538749, 167.743256, 172.050028),\n (167.743256, 172.050028, 167.743256, 174.561306),\n (167.743256, 174.561306, 167.743256, 177.072585),\n (167.743256, 177.072585, 167.743256, 179.583863),\n (167.743256, 179.583863, 167.743256, 182.095142),\n (167.743256, 182.095142, 167.743256, 184.60642),\n (167.743256, 184.60642, 167.743256, 187.117699),\n (167.743256, 187.117699, 167.743256, 189.628977),\n (167.743256, 189.628977, 167.743256, 192.140255),\n (183.482345, 111.779345, 183.482345, 114.290623),\n (183.482345, 114.290623, 183.482345, 116.801901),\n (183.482345, 116.801901, 183.482345, 119.31318),\n (183.482345, 119.31318, 183.482345, 121.824458),\n (183.482345, 121.824458, 183.482345, 124.335737),\n (183.482345, 124.335737, 183.482345, 126.847015),\n (183.482345, 126.847015, 183.482345, 129.358294),\n (183.482345, 129.358294, 183.482345, 131.869572),\n (183.482345, 131.869572, 183.482345, 134.380851),\n (183.482345, 134.380851, 183.482345, 136.892129),\n (183.482345, 136.892129, 183.482345, 139.403408),\n (183.482345, 139.403408, 183.482345, 141.914686),\n (183.482345, 141.914686, 183.482345, 144.425965),\n (183.482345, 144.425965, 183.482345, 146.937243),\n (183.482345, 146.937243, 183.482345, 149.448522),\n (183.482345, 149.448522, 183.482345, 151.9598),\n (183.482345, 151.9598, 183.482345, 154.471078),\n (183.482345, 154.471078, 183.482345, 156.982357),\n (183.482345, 156.982357, 183.482345, 159.493635),\n (183.482345, 159.493635, 183.482345, 162.004914),\n (183.482345, 162.004914, 183.482345, 164.516192),\n (183.482345, 164.516192, 183.482345, 167.027471),\n (183.482345, 167.027471, 183.482345, 169.538749),\n (183.482345, 169.538749, 183.482345, 172.050028),\n (183.482345, 172.050028, 183.482345, 174.561306),\n (183.482345, 174.561306, 183.482345, 177.072585),\n (183.482345, 177.072585, 183.482345, 179.583863),\n (183.482345, 179.583863, 183.482345, 182.095142),\n (183.482345, 182.095142, 183.482345, 184.60642),\n (183.482345, 184.60642, 183.482345, 187.117699),\n (183.482345, 187.117699, 183.482345, 189.628977),\n (183.482345, 189.628977, 183.482345, 192.140255),\n (183.482345, 111.779345, 167.743256, 111.779345),\n (183.482345, 192.140255, 167.743256, 192.140255)\n]\nVISIBLE_CIRCLES = [\n (113.5628, 151.9598, 40.180455),\n (113.5628, 151.9598, 20.090228)\n]\nVISIBLE_ARCS = [\n\n]\nHIDDEN_SEGMENTS = [\n (133.653, 97.7793, 133.653, 82.0402),\n (93.4726, 82.0402, 93.4726, 97.7793),\n (183.4823, 172.05, 167.7432, 172.05),\n (183.4823, 131.8695, 167.7432, 131.8695)\n]\n# (orient, text, p1, p2, base) for linear; (orient, text, center, radius, angle) for diameter\nDIMENSIONS = [\n ('diameter', '%%c100', (113.5628, 151.9598), 40.1805, 45),\n ('diameter', '%%c50', (113.5628, 151.9598), 20.0902, 135),\n ('horizontal', '19.5855', (167.7432, 151.9598), (183.4823, 151.9598), (175.6128, 162.9598))\n]\n\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\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\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,\n angle=(0 if d[0] == \"horizontal\" else 90),\n 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,\n text=text, dimstyle=\"EZDXF\").render()\n\n doc.saveas(out_path)\n\n\nif __name__ == \"__main__\":\n out = sys.argv[1] if len(sys.argv) > 1 else \"0041_00413027_gt.dxf\"\n draw(out)\n print(\"wrote\", out)\n```"}], "images": ["images/0041_00413027.png"], "id": "0041_00413027"} {"messages": [{"role": "user", "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 158.33 mm."}, {"role": "assistant", "content": "```python\n#!/usr/bin/env python3\n# -*- coding: utf-8 -*-\n# Ground-truth 2D engineering drawing for part: 0041_00416445\n# Self-contained: reproduces the three-view DXF via ezdxf, NO FreeCAD needed.\n# Coordinates are A4 page millimetres (scale=0.4805, page=[297.0, 210.0]).\n# visible edges -> solid (layer OUTLINE); hidden edges -> dashed (layer HIDDEN)\n# dimensions -> real movable DIMENSION entities (text = true mm value)\n# Run: python 0041_00416445_gt.py [out.dxf]\nimport sys\nimport ezdxf\n\nSCALE = 0.4805\nPAGE = [297.0, 210.0]\n\nVISIBLE_SEGMENTS = [\n (113.3509, 59.947933, 111.849338, 59.947933),\n (111.849338, 59.947933, 110.347775, 59.947933),\n (110.347775, 59.947933, 108.846213, 59.947933),\n (108.846213, 59.947933, 107.34465, 59.947933),\n (107.34465, 59.947933, 105.843087, 59.947933),\n (105.843087, 59.947933, 104.341525, 59.947933),\n (104.341525, 59.947933, 102.839962, 59.947933),\n (102.839962, 59.947933, 101.3384, 59.947933),\n (101.3384, 59.947933, 99.836838, 59.947933),\n (99.836838, 59.947933, 98.335275, 59.947933),\n (98.335275, 59.947933, 96.833713, 59.947933),\n (96.833713, 59.947933, 95.33215, 59.947933),\n (95.33215, 59.947933, 93.830588, 59.947933),\n (93.830588, 59.947933, 92.329025, 59.947933),\n (92.329025, 59.947933, 90.827463, 59.947933),\n (90.827463, 59.947933, 89.3259, 59.947933),\n (89.3259, 59.947933, 87.824338, 59.947933),\n (87.824338, 59.947933, 86.322775, 59.947933),\n (86.322775, 59.947933, 84.821213, 59.947933),\n (84.821213, 59.947933, 83.31965, 59.947933),\n (83.31965, 59.947933, 81.818088, 59.947933),\n (81.818088, 59.947933, 80.316525, 59.947933),\n (80.316525, 59.947933, 78.814963, 59.947933),\n (78.814963, 59.947933, 77.3134, 59.947933),\n (77.3134, 59.947933, 75.811838, 59.947933),\n (75.811838, 59.947933, 74.310275, 59.947933),\n (74.310275, 59.947933, 72.808713, 59.947933),\n (72.808713, 59.947933, 71.30715, 59.947933),\n (71.30715, 59.947933, 69.805588, 59.947933),\n (69.805588, 59.947933, 68.304025, 59.947933),\n (68.304025, 59.947933, 66.802463, 59.947933),\n (66.802463, 59.947933, 65.3009, 59.947933),\n (113.3509, 59.947933, 113.3509, 136.0271),\n (113.3509, 136.0271, 111.849338, 136.0271),\n (111.849338, 136.0271, 110.347775, 136.0271),\n (110.347775, 136.0271, 108.846213, 136.0271),\n (108.846213, 136.0271, 107.34465, 136.0271),\n (107.34465, 136.0271, 105.843087, 136.0271),\n (105.843087, 136.0271, 104.341525, 136.0271),\n (104.341525, 136.0271, 102.839962, 136.0271),\n (102.839962, 136.0271, 101.3384, 136.0271),\n (101.3384, 136.0271, 99.836838, 136.0271),\n (99.836838, 136.0271, 98.335275, 136.0271),\n (98.335275, 136.0271, 96.833713, 136.0271),\n (96.833713, 136.0271, 95.33215, 136.0271),\n (95.33215, 136.0271, 93.830588, 136.0271),\n (93.830588, 136.0271, 92.329025, 136.0271),\n (92.329025, 136.0271, 90.827463, 136.0271),\n (90.827463, 136.0271, 89.3259, 136.0271),\n (89.3259, 136.0271, 87.824338, 136.0271),\n (87.824338, 136.0271, 86.322775, 136.0271),\n (86.322775, 136.0271, 84.821213, 136.0271),\n (84.821213, 136.0271, 83.31965, 136.0271),\n (83.31965, 136.0271, 81.818088, 136.0271),\n (81.818088, 136.0271, 80.316525, 136.0271),\n (80.316525, 136.0271, 78.814963, 136.0271),\n (78.814963, 136.0271, 77.3134, 136.0271),\n (77.3134, 136.0271, 75.811838, 136.0271),\n (75.811838, 136.0271, 74.310275, 136.0271),\n (74.310275, 136.0271, 72.808713, 136.0271),\n (72.808713, 136.0271, 71.30715, 136.0271),\n (71.30715, 136.0271, 69.805588, 136.0271),\n (69.805588, 136.0271, 68.304025, 136.0271),\n (68.304025, 136.0271, 66.802463, 136.0271),\n (66.802463, 136.0271, 65.3009, 136.0271),\n (65.3009, 136.0271, 65.3009, 59.947933),\n (127.3509, 150.0271, 127.3509, 151.528662),\n (127.3509, 151.528662, 127.3509, 153.030225),\n (127.3509, 153.030225, 127.3509, 154.531788),\n (127.3509, 154.531788, 127.3509, 156.03335),\n (127.3509, 156.03335, 127.3509, 157.534912),\n (127.3509, 157.534912, 127.3509, 159.036475),\n (127.3509, 159.036475, 127.3509, 160.538038),\n (127.3509, 160.538038, 127.3509, 162.0396),\n (127.3509, 162.0396, 127.3509, 163.541162),\n (127.3509, 163.541162, 127.3509, 165.042725),\n (127.3509, 165.042725, 127.3509, 166.544287),\n (127.3509, 166.544287, 127.3509, 168.04585),\n (127.3509, 168.04585, 127.3509, 169.547412),\n (127.3509, 169.547412, 127.3509, 171.048975),\n (127.3509, 171.048975, 127.3509, 172.550537),\n (127.3509, 172.550537, 127.3509, 174.0521),\n (127.3509, 174.0521, 127.3509, 175.553663),\n (127.3509, 175.553663, 127.3509, 177.055225),\n (127.3509, 177.055225, 127.3509, 178.556787),\n (127.3509, 178.556787, 127.3509, 180.05835),\n (127.3509, 180.05835, 127.3509, 181.559912),\n (127.3509, 181.559912, 127.3509, 183.061475),\n (127.3509, 183.061475, 127.3509, 184.563037),\n (127.3509, 184.563037, 127.3509, 186.0646),\n (127.3509, 186.0646, 127.3509, 187.566162),\n (127.3509, 187.566162, 127.3509, 189.067725),\n (127.3509, 189.067725, 127.3509, 190.569287),\n (127.3509, 190.569287, 127.3509, 192.07085),\n (127.3509, 192.07085, 127.3509, 193.572412),\n (127.3509, 193.572412, 127.3509, 195.073975),\n (127.3509, 195.073975, 127.3509, 196.575537),\n (127.3509, 196.575537, 127.3509, 198.0771),\n (203.430067, 150.0271, 203.430067, 151.528662),\n (203.430067, 151.528662, 203.430067, 153.030225),\n (203.430067, 153.030225, 203.430067, 154.531788),\n (203.430067, 154.531788, 203.430067, 156.03335),\n (203.430067, 156.03335, 203.430067, 157.534912),\n (203.430067, 157.534912, 203.430067, 159.036475),\n (203.430067, 159.036475, 203.430067, 160.538038),\n (203.430067, 160.538038, 203.430067, 162.0396),\n (203.430067, 162.0396, 203.430067, 163.541162),\n (203.430067, 163.541162, 203.430067, 165.042725),\n (203.430067, 165.042725, 203.430067, 166.544287),\n (203.430067, 166.544287, 203.430067, 168.04585),\n (203.430067, 168.04585, 203.430067, 169.547412),\n (203.430067, 169.547412, 203.430067, 171.048975),\n (203.430067, 171.048975, 203.430067, 172.550537),\n (203.430067, 172.550537, 203.430067, 174.0521),\n (203.430067, 174.0521, 203.430067, 175.553663),\n (203.430067, 175.553663, 203.430067, 177.055225),\n (203.430067, 177.055225, 203.430067, 178.556787),\n (203.430067, 178.556787, 203.430067, 180.05835),\n (203.430067, 180.05835, 203.430067, 181.559912),\n (203.430067, 181.559912, 203.430067, 183.061475),\n (203.430067, 183.061475, 203.430067, 184.563037),\n (203.430067, 184.563037, 203.430067, 186.0646),\n (203.430067, 186.0646, 203.430067, 187.566162),\n (203.430067, 187.566162, 203.430067, 189.067725),\n (203.430067, 189.067725, 203.430067, 190.569287),\n (203.430067, 190.569287, 203.430067, 192.07085),\n (203.430067, 192.07085, 203.430067, 193.572412),\n (203.430067, 193.572412, 203.430067, 195.073975),\n (203.430067, 195.073975, 203.430067, 196.575537),\n (203.430067, 196.575537, 203.430067, 198.0771),\n (203.430067, 150.0271, 127.3509, 150.0271),\n (203.430067, 198.0771, 127.3509, 198.0771)\n]\nVISIBLE_CIRCLES = [\n (89.3259, 174.0521, 24.025),\n (89.3259, 174.0521, 12.513021)\n]\nVISIBLE_ARCS = [\n\n]\nHIDDEN_SEGMENTS = [\n (101.8389, 136.0271, 101.8389, 59.9479),\n (76.8129, 59.9479, 76.8129, 136.0271),\n (203.4301, 186.5651, 127.3509, 186.5651),\n (203.4301, 161.5391, 127.3509, 161.5391)\n]\n# (orient, text, p1, p2, base) for linear; (orient, text, center, radius, angle) for diameter\nDIMENSIONS = [\n ('diameter', '%%c100', (89.3259, 174.0521), 24.025, 45),\n ('diameter', '%%c52.0833', (89.3259, 174.0521), 12.513, 135),\n ('horizontal', '158.333', (127.3509, 174.0521), (203.4301, 174.0521), (165.3905, 185.0521))\n]\n\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\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\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,\n angle=(0 if d[0] == \"horizontal\" else 90),\n 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,\n text=text, dimstyle=\"EZDXF\").render()\n\n doc.saveas(out_path)\n\n\nif __name__ == \"__main__\":\n out = sys.argv[1] if len(sys.argv) > 1 else \"0041_00416445_gt.dxf\"\n draw(out)\n print(\"wrote\", out)\n```"}], "images": ["images/0041_00416445.png"], "id": "0041_00416445"} {"messages": [{"role": "user", "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 83.33 mm. It is extruded to a thickness of 114.46 mm."}, {"role": "assistant", "content": "```python\n#!/usr/bin/env python3\n# -*- coding: utf-8 -*-\n# Ground-truth 2D engineering drawing for part: 0042_00421102\n# Self-contained: reproduces the three-view DXF via ezdxf, NO FreeCAD needed.\n# Coordinates are A4 page millimetres (scale=0.44810674157303626, page=[297.0, 210.0]).\n# visible edges -> solid (layer OUTLINE); hidden edges -> dashed (layer HIDDEN)\n# dimensions -> real movable DIMENSION entities (text = true mm value)\n# Run: python 0042_00421102_gt.py [out.dxf]\nimport sys\nimport ezdxf\n\nSCALE = 0.44810674157303626\nPAGE = [297.0, 210.0]\n\nVISIBLE_SEGMENTS = [\n (122.991537, 73.152637, 121.591204, 73.152637),\n (121.591204, 73.152637, 120.19087, 73.152637),\n (120.19087, 73.152637, 118.790536, 73.152637),\n (118.790536, 73.152637, 117.390203, 73.152637),\n (117.390203, 73.152637, 115.989869, 73.152637),\n (115.989869, 73.152637, 114.589536, 73.152637),\n (114.589536, 73.152637, 113.189202, 73.152637),\n (113.189202, 73.152637, 111.788869, 73.152637),\n (111.788869, 73.152637, 110.388535, 73.152637),\n (110.388535, 73.152637, 108.988201, 73.152637),\n (108.988201, 73.152637, 107.587868, 73.152637),\n (107.587868, 73.152637, 106.187534, 73.152637),\n (106.187534, 73.152637, 104.787201, 73.152637),\n (104.787201, 73.152637, 103.386867, 73.152637),\n (103.386867, 73.152637, 101.986534, 73.152637),\n (101.986534, 73.152637, 100.5862, 73.152637),\n (100.5862, 73.152637, 99.185866, 73.152637),\n (99.185866, 73.152637, 97.785533, 73.152637),\n (97.785533, 73.152637, 96.385199, 73.152637),\n (96.385199, 73.152637, 94.984866, 73.152637),\n (94.984866, 73.152637, 93.584532, 73.152637),\n (93.584532, 73.152637, 92.184199, 73.152637),\n (92.184199, 73.152637, 90.783865, 73.152637),\n (90.783865, 73.152637, 89.383531, 73.152637),\n (89.383531, 73.152637, 87.983198, 73.152637),\n (87.983198, 73.152637, 86.582864, 73.152637),\n (86.582864, 73.152637, 85.182531, 73.152637),\n (85.182531, 73.152637, 83.782197, 73.152637),\n (83.782197, 73.152637, 82.381864, 73.152637),\n (82.381864, 73.152637, 80.98153, 73.152637),\n (80.98153, 73.152637, 79.581196, 73.152637),\n (79.581196, 73.152637, 78.180863, 73.152637),\n (122.991537, 73.152637, 122.991537, 124.441963),\n (122.991537, 124.441963, 121.591204, 124.441963),\n (121.591204, 124.441963, 120.19087, 124.441963),\n (120.19087, 124.441963, 118.790536, 124.441963),\n (118.790536, 124.441963, 117.390203, 124.441963),\n (117.390203, 124.441963, 115.989869, 124.441963),\n (115.989869, 124.441963, 114.589536, 124.441963),\n (114.589536, 124.441963, 113.189202, 124.441963),\n (113.189202, 124.441963, 111.788869, 124.441963),\n (111.788869, 124.441963, 110.388535, 124.441963),\n (110.388535, 124.441963, 108.988201, 124.441963),\n (108.988201, 124.441963, 107.587868, 124.441963),\n (107.587868, 124.441963, 106.187534, 124.441963),\n (106.187534, 124.441963, 104.787201, 124.441963),\n (104.787201, 124.441963, 103.386867, 124.441963),\n (103.386867, 124.441963, 101.986534, 124.441963),\n (101.986534, 124.441963, 100.5862, 124.441963),\n (100.5862, 124.441963, 99.185866, 124.441963),\n (99.185866, 124.441963, 97.785533, 124.441963),\n (97.785533, 124.441963, 96.385199, 124.441963),\n (96.385199, 124.441963, 94.984866, 124.441963),\n (94.984866, 124.441963, 93.584532, 124.441963),\n (93.584532, 124.441963, 92.184199, 124.441963),\n (92.184199, 124.441963, 90.783865, 124.441963),\n (90.783865, 124.441963, 89.383531, 124.441963),\n (89.383531, 124.441963, 87.983198, 124.441963),\n (87.983198, 124.441963, 86.582864, 124.441963),\n (86.582864, 124.441963, 85.182531, 124.441963),\n (85.182531, 124.441963, 83.782197, 124.441963),\n (83.782197, 124.441963, 82.381864, 124.441963),\n (82.381864, 124.441963, 80.98153, 124.441963),\n (80.98153, 124.441963, 79.581196, 124.441963),\n (79.581196, 124.441963, 78.180863, 124.441963),\n (78.180863, 124.441963, 78.180863, 73.152637),\n (136.991537, 138.441963, 136.991537, 139.842296),\n (136.991537, 139.842296, 136.991537, 141.24263),\n (136.991537, 141.24263, 136.991537, 142.642964),\n (136.991537, 142.642964, 136.991537, 144.043297),\n (136.991537, 144.043297, 136.991537, 145.443631),\n (136.991537, 145.443631, 136.991537, 146.843964),\n (136.991537, 146.843964, 136.991537, 148.244298),\n (136.991537, 148.244298, 136.991537, 149.644631),\n (136.991537, 149.644631, 136.991537, 151.044965),\n (136.991537, 151.044965, 136.991537, 152.445299),\n (136.991537, 152.445299, 136.991537, 153.845632),\n (136.991537, 153.845632, 136.991537, 155.245966),\n (136.991537, 155.245966, 136.991537, 156.646299),\n (136.991537, 156.646299, 136.991537, 158.046633),\n (136.991537, 158.046633, 136.991537, 159.446966),\n (136.991537, 159.446966, 136.991537, 160.8473),\n (136.991537, 160.8473, 136.991537, 162.247634),\n (136.991537, 162.247634, 136.991537, 163.647967),\n (136.991537, 163.647967, 136.991537, 165.048301),\n (136.991537, 165.048301, 136.991537, 166.448634),\n (136.991537, 166.448634, 136.991537, 167.848968),\n (136.991537, 167.848968, 136.991537, 169.249301),\n (136.991537, 169.249301, 136.991537, 170.649635),\n (136.991537, 170.649635, 136.991537, 172.049969),\n (136.991537, 172.049969, 136.991537, 173.450302),\n (136.991537, 173.450302, 136.991537, 174.850636),\n (136.991537, 174.850636, 136.991537, 176.250969),\n (136.991537, 176.250969, 136.991537, 177.651303),\n (136.991537, 177.651303, 136.991537, 179.051636),\n (136.991537, 179.051636, 136.991537, 180.45197),\n (136.991537, 180.45197, 136.991537, 181.852304),\n (136.991537, 181.852304, 136.991537, 183.252637),\n (188.280863, 138.441963, 188.280863, 139.842296),\n (188.280863, 139.842296, 188.280863, 141.24263),\n (188.280863, 141.24263, 188.280863, 142.642964),\n (188.280863, 142.642964, 188.280863, 144.043297),\n (188.280863, 144.043297, 188.280863, 145.443631),\n (188.280863, 145.443631, 188.280863, 146.843964),\n (188.280863, 146.843964, 188.280863, 148.244298),\n (188.280863, 148.244298, 188.280863, 149.644631),\n (188.280863, 149.644631, 188.280863, 151.044965),\n (188.280863, 151.044965, 188.280863, 152.445299),\n (188.280863, 152.445299, 188.280863, 153.845632),\n (188.280863, 153.845632, 188.280863, 155.245966),\n (188.280863, 155.245966, 188.280863, 156.646299),\n (188.280863, 156.646299, 188.280863, 158.046633),\n (188.280863, 158.046633, 188.280863, 159.446966),\n (188.280863, 159.446966, 188.280863, 160.8473),\n (188.280863, 160.8473, 188.280863, 162.247634),\n (188.280863, 162.247634, 188.280863, 163.647967),\n (188.280863, 163.647967, 188.280863, 165.048301),\n (188.280863, 165.048301, 188.280863, 166.448634),\n (188.280863, 166.448634, 188.280863, 167.848968),\n (188.280863, 167.848968, 188.280863, 169.249301),\n (188.280863, 169.249301, 188.280863, 170.649635),\n (188.280863, 170.649635, 188.280863, 172.049969),\n (188.280863, 172.049969, 188.280863, 173.450302),\n (188.280863, 173.450302, 188.280863, 174.850636),\n (188.280863, 174.850636, 188.280863, 176.250969),\n (188.280863, 176.250969, 188.280863, 177.651303),\n (188.280863, 177.651303, 188.280863, 179.051636),\n (188.280863, 179.051636, 188.280863, 180.45197),\n (188.280863, 180.45197, 188.280863, 181.852304),\n (188.280863, 181.852304, 188.280863, 183.252637),\n (188.280863, 138.441963, 136.991537, 138.441963),\n (188.280863, 183.252637, 136.991537, 183.252637)\n]\nVISIBLE_CIRCLES = [\n (100.5862, 160.8473, 22.405337),\n (100.5862, 160.8473, 18.671114)\n]\nVISIBLE_ARCS = [\n\n]\nHIDDEN_SEGMENTS = [\n (119.2573, 124.442, 119.2573, 73.1527),\n (81.9151, 73.1527, 81.9151, 124.442),\n (188.2809, 179.5184, 136.9916, 179.5184),\n (188.2809, 142.1762, 136.9916, 142.1762)\n]\n# (orient, text, p1, p2, base) for linear; (orient, text, center, radius, angle) for diameter\nDIMENSIONS = [\n ('diameter', '%%c100', (100.5862, 160.8473), 22.4053, 45),\n ('diameter', '%%c83.3333', (100.5862, 160.8473), 18.6711, 135),\n ('horizontal', '114.458', (136.9916, 160.8473), (188.2809, 160.8473), (162.6362, 171.8473))\n]\n\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\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\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,\n angle=(0 if d[0] == \"horizontal\" else 90),\n 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,\n text=text, dimstyle=\"EZDXF\").render()\n\n doc.saveas(out_path)\n\n\nif __name__ == \"__main__\":\n out = sys.argv[1] if len(sys.argv) > 1 else \"0042_00421102_gt.dxf\"\n draw(out)\n print(\"wrote\", out)\n```"}], "images": ["images/0042_00421102.png"], "id": "0042_00421102"} {"messages": [{"role": "user", "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 158.33 mm."}, {"role": "assistant", "content": "```python\n#!/usr/bin/env python3\n# -*- coding: utf-8 -*-\n# Ground-truth 2D engineering drawing for part: 0042_00426128\n# Self-contained: reproduces the three-view DXF via ezdxf, NO FreeCAD needed.\n# Coordinates are A4 page millimetres (scale=0.4805, page=[297.0, 210.0]).\n# visible edges -> solid (layer OUTLINE); hidden edges -> dashed (layer HIDDEN)\n# dimensions -> real movable DIMENSION entities (text = true mm value)\n# Run: python 0042_00426128_gt.py [out.dxf]\nimport sys\nimport ezdxf\n\nSCALE = 0.4805\nPAGE = [297.0, 210.0]\n\nVISIBLE_SEGMENTS = [\n (113.3509, 59.947933, 111.849338, 59.947933),\n (111.849338, 59.947933, 110.347775, 59.947933),\n (110.347775, 59.947933, 108.846213, 59.947933),\n (108.846213, 59.947933, 107.34465, 59.947933),\n (107.34465, 59.947933, 105.843087, 59.947933),\n (105.843087, 59.947933, 104.341525, 59.947933),\n (104.341525, 59.947933, 102.839962, 59.947933),\n (102.839962, 59.947933, 101.3384, 59.947933),\n (101.3384, 59.947933, 99.836838, 59.947933),\n (99.836838, 59.947933, 98.335275, 59.947933),\n (98.335275, 59.947933, 96.833713, 59.947933),\n (96.833713, 59.947933, 95.33215, 59.947933),\n (95.33215, 59.947933, 93.830588, 59.947933),\n (93.830588, 59.947933, 92.329025, 59.947933),\n (92.329025, 59.947933, 90.827463, 59.947933),\n (90.827463, 59.947933, 89.3259, 59.947933),\n (89.3259, 59.947933, 87.824338, 59.947933),\n (87.824338, 59.947933, 86.322775, 59.947933),\n (86.322775, 59.947933, 84.821213, 59.947933),\n (84.821213, 59.947933, 83.31965, 59.947933),\n (83.31965, 59.947933, 81.818088, 59.947933),\n (81.818088, 59.947933, 80.316525, 59.947933),\n (80.316525, 59.947933, 78.814963, 59.947933),\n (78.814963, 59.947933, 77.3134, 59.947933),\n (77.3134, 59.947933, 75.811838, 59.947933),\n (75.811838, 59.947933, 74.310275, 59.947933),\n (74.310275, 59.947933, 72.808713, 59.947933),\n (72.808713, 59.947933, 71.30715, 59.947933),\n (71.30715, 59.947933, 69.805588, 59.947933),\n (69.805588, 59.947933, 68.304025, 59.947933),\n (68.304025, 59.947933, 66.802463, 59.947933),\n (66.802463, 59.947933, 65.3009, 59.947933),\n (113.3509, 59.947933, 113.3509, 136.0271),\n (113.3509, 136.0271, 111.849338, 136.0271),\n (111.849338, 136.0271, 110.347775, 136.0271),\n (110.347775, 136.0271, 108.846213, 136.0271),\n (108.846213, 136.0271, 107.34465, 136.0271),\n (107.34465, 136.0271, 105.843087, 136.0271),\n (105.843087, 136.0271, 104.341525, 136.0271),\n (104.341525, 136.0271, 102.839962, 136.0271),\n (102.839962, 136.0271, 101.3384, 136.0271),\n (101.3384, 136.0271, 99.836838, 136.0271),\n (99.836838, 136.0271, 98.335275, 136.0271),\n (98.335275, 136.0271, 96.833713, 136.0271),\n (96.833713, 136.0271, 95.33215, 136.0271),\n (95.33215, 136.0271, 93.830588, 136.0271),\n (93.830588, 136.0271, 92.329025, 136.0271),\n (92.329025, 136.0271, 90.827463, 136.0271),\n (90.827463, 136.0271, 89.3259, 136.0271),\n (89.3259, 136.0271, 87.824338, 136.0271),\n (87.824338, 136.0271, 86.322775, 136.0271),\n (86.322775, 136.0271, 84.821213, 136.0271),\n (84.821213, 136.0271, 83.31965, 136.0271),\n (83.31965, 136.0271, 81.818088, 136.0271),\n (81.818088, 136.0271, 80.316525, 136.0271),\n (80.316525, 136.0271, 78.814963, 136.0271),\n (78.814963, 136.0271, 77.3134, 136.0271),\n (77.3134, 136.0271, 75.811838, 136.0271),\n (75.811838, 136.0271, 74.310275, 136.0271),\n (74.310275, 136.0271, 72.808713, 136.0271),\n (72.808713, 136.0271, 71.30715, 136.0271),\n (71.30715, 136.0271, 69.805588, 136.0271),\n (69.805588, 136.0271, 68.304025, 136.0271),\n (68.304025, 136.0271, 66.802463, 136.0271),\n (66.802463, 136.0271, 65.3009, 136.0271),\n (65.3009, 136.0271, 65.3009, 59.947933),\n (127.3509, 150.0271, 127.3509, 151.528662),\n (127.3509, 151.528662, 127.3509, 153.030225),\n (127.3509, 153.030225, 127.3509, 154.531788),\n (127.3509, 154.531788, 127.3509, 156.03335),\n (127.3509, 156.03335, 127.3509, 157.534912),\n (127.3509, 157.534912, 127.3509, 159.036475),\n (127.3509, 159.036475, 127.3509, 160.538038),\n (127.3509, 160.538038, 127.3509, 162.0396),\n (127.3509, 162.0396, 127.3509, 163.541162),\n (127.3509, 163.541162, 127.3509, 165.042725),\n (127.3509, 165.042725, 127.3509, 166.544287),\n (127.3509, 166.544287, 127.3509, 168.04585),\n (127.3509, 168.04585, 127.3509, 169.547412),\n (127.3509, 169.547412, 127.3509, 171.048975),\n (127.3509, 171.048975, 127.3509, 172.550537),\n (127.3509, 172.550537, 127.3509, 174.0521),\n (127.3509, 174.0521, 127.3509, 175.553663),\n (127.3509, 175.553663, 127.3509, 177.055225),\n (127.3509, 177.055225, 127.3509, 178.556787),\n (127.3509, 178.556787, 127.3509, 180.05835),\n (127.3509, 180.05835, 127.3509, 181.559912),\n (127.3509, 181.559912, 127.3509, 183.061475),\n (127.3509, 183.061475, 127.3509, 184.563037),\n (127.3509, 184.563037, 127.3509, 186.0646),\n (127.3509, 186.0646, 127.3509, 187.566162),\n (127.3509, 187.566162, 127.3509, 189.067725),\n (127.3509, 189.067725, 127.3509, 190.569287),\n (127.3509, 190.569287, 127.3509, 192.07085),\n (127.3509, 192.07085, 127.3509, 193.572412),\n (127.3509, 193.572412, 127.3509, 195.073975),\n (127.3509, 195.073975, 127.3509, 196.575537),\n (127.3509, 196.575537, 127.3509, 198.0771),\n (203.430067, 150.0271, 203.430067, 151.528662),\n (203.430067, 151.528662, 203.430067, 153.030225),\n (203.430067, 153.030225, 203.430067, 154.531788),\n (203.430067, 154.531788, 203.430067, 156.03335),\n (203.430067, 156.03335, 203.430067, 157.534912),\n (203.430067, 157.534912, 203.430067, 159.036475),\n (203.430067, 159.036475, 203.430067, 160.538038),\n (203.430067, 160.538038, 203.430067, 162.0396),\n (203.430067, 162.0396, 203.430067, 163.541162),\n (203.430067, 163.541162, 203.430067, 165.042725),\n (203.430067, 165.042725, 203.430067, 166.544287),\n (203.430067, 166.544287, 203.430067, 168.04585),\n (203.430067, 168.04585, 203.430067, 169.547412),\n (203.430067, 169.547412, 203.430067, 171.048975),\n (203.430067, 171.048975, 203.430067, 172.550537),\n (203.430067, 172.550537, 203.430067, 174.0521),\n (203.430067, 174.0521, 203.430067, 175.553663),\n (203.430067, 175.553663, 203.430067, 177.055225),\n (203.430067, 177.055225, 203.430067, 178.556787),\n (203.430067, 178.556787, 203.430067, 180.05835),\n (203.430067, 180.05835, 203.430067, 181.559912),\n (203.430067, 181.559912, 203.430067, 183.061475),\n (203.430067, 183.061475, 203.430067, 184.563037),\n (203.430067, 184.563037, 203.430067, 186.0646),\n (203.430067, 186.0646, 203.430067, 187.566162),\n (203.430067, 187.566162, 203.430067, 189.067725),\n (203.430067, 189.067725, 203.430067, 190.569287),\n (203.430067, 190.569287, 203.430067, 192.07085),\n (203.430067, 192.07085, 203.430067, 193.572412),\n (203.430067, 193.572412, 203.430067, 195.073975),\n (203.430067, 195.073975, 203.430067, 196.575537),\n (203.430067, 196.575537, 203.430067, 198.0771),\n (203.430067, 150.0271, 127.3509, 150.0271),\n (203.430067, 198.0771, 127.3509, 198.0771)\n]\nVISIBLE_CIRCLES = [\n (89.3259, 174.0521, 24.025),\n (89.3259, 174.0521, 12.513021)\n]\nVISIBLE_ARCS = [\n\n]\nHIDDEN_SEGMENTS = [\n (101.8389, 136.0271, 101.8389, 59.9479),\n (76.8129, 59.9479, 76.8129, 136.0271),\n (203.4301, 186.5651, 127.3509, 186.5651),\n (203.4301, 161.5391, 127.3509, 161.5391)\n]\n# (orient, text, p1, p2, base) for linear; (orient, text, center, radius, angle) for diameter\nDIMENSIONS = [\n ('diameter', '%%c100', (89.3259, 174.0521), 24.025, 45),\n ('diameter', '%%c52.0833', (89.3259, 174.0521), 12.513, 135),\n ('horizontal', '158.333', (127.3509, 174.0521), (203.4301, 174.0521), (165.3905, 185.0521))\n]\n\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\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\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,\n angle=(0 if d[0] == \"horizontal\" else 90),\n 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,\n text=text, dimstyle=\"EZDXF\").render()\n\n doc.saveas(out_path)\n\n\nif __name__ == \"__main__\":\n out = sys.argv[1] if len(sys.argv) > 1 else \"0042_00426128_gt.dxf\"\n draw(out)\n print(\"wrote\", out)\n```"}], "images": ["images/0042_00426128.png"], "id": "0042_00426128"} {"messages": [{"role": "user", "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": "assistant", "content": "```python\n#!/usr/bin/env python3\n# -*- coding: utf-8 -*-\n# Ground-truth 2D engineering drawing for part: 0045_00459644\n# Self-contained: reproduces the three-view DXF via ezdxf, NO FreeCAD needed.\n# Coordinates are A4 page millimetres (scale=0.7274306085643575, page=[297.0, 210.0]).\n# visible edges -> solid (layer OUTLINE); hidden edges -> dashed (layer HIDDEN)\n# dimensions -> real movable DIMENSION entities (text = true mm value)\n# Run: python 0045_00459644_gt.py [out.dxf]\nimport sys\nimport ezdxf\n\nSCALE = 0.7274306085643575\nPAGE = [297.0, 210.0]\n\nVISIBLE_SEGMENTS = [\n (148.81123, 80.13573, 146.53801, 80.13573),\n (146.53801, 80.13573, 144.264789, 80.13573),\n (144.264789, 80.13573, 141.991568, 80.13573),\n (141.991568, 80.13573, 139.718348, 80.13573),\n (139.718348, 80.13573, 137.445127, 80.13573),\n (137.445127, 80.13573, 135.171907, 80.13573),\n (135.171907, 80.13573, 132.898686, 80.13573),\n (132.898686, 80.13573, 130.625465, 80.13573),\n (130.625465, 80.13573, 128.352245, 80.13573),\n (128.352245, 80.13573, 126.079024, 80.13573),\n (126.079024, 80.13573, 123.805803, 80.13573),\n (123.805803, 80.13573, 121.532583, 80.13573),\n (121.532583, 80.13573, 119.259362, 80.13573),\n (119.259362, 80.13573, 116.986141, 80.13573),\n (116.986141, 80.13573, 114.712921, 80.13573),\n (114.712921, 80.13573, 112.4397, 80.13573),\n (112.4397, 80.13573, 110.166479, 80.13573),\n (110.166479, 80.13573, 107.893259, 80.13573),\n (107.893259, 80.13573, 105.620038, 80.13573),\n (105.620038, 80.13573, 103.346817, 80.13573),\n (103.346817, 80.13573, 101.073597, 80.13573),\n (101.073597, 80.13573, 98.800376, 80.13573),\n (98.800376, 80.13573, 96.527155, 80.13573),\n (96.527155, 80.13573, 94.253935, 80.13573),\n (94.253935, 80.13573, 91.980714, 80.13573),\n (91.980714, 80.13573, 89.707493, 80.13573),\n (89.707493, 80.13573, 87.434273, 80.13573),\n (87.434273, 80.13573, 85.161052, 80.13573),\n (85.161052, 80.13573, 82.887832, 80.13573),\n (82.887832, 80.13573, 80.614611, 80.13573),\n (80.614611, 80.13573, 78.34139, 80.13573),\n (78.34139, 80.13573, 76.06817, 80.13573),\n (148.81123, 80.13573, 148.81123, 103.492669),\n (148.81123, 103.492669, 146.53801, 103.492669),\n (146.53801, 103.492669, 144.264789, 103.492669),\n (144.264789, 103.492669, 141.991568, 103.492669),\n (141.991568, 103.492669, 139.718348, 103.492669),\n (139.718348, 103.492669, 137.445127, 103.492669),\n (137.445127, 103.492669, 135.171907, 103.492669),\n (135.171907, 103.492669, 132.898686, 103.492669),\n (132.898686, 103.492669, 130.625465, 103.492669),\n (130.625465, 103.492669, 128.352245, 103.492669),\n (128.352245, 103.492669, 126.079024, 103.492669),\n (126.079024, 103.492669, 123.805803, 103.492669),\n (123.805803, 103.492669, 121.532583, 103.492669),\n (121.532583, 103.492669, 119.259362, 103.492669),\n (119.259362, 103.492669, 116.986141, 103.492669),\n (116.986141, 103.492669, 114.712921, 103.492669),\n (114.712921, 103.492669, 112.4397, 103.492669),\n (112.4397, 103.492669, 110.166479, 103.492669),\n (110.166479, 103.492669, 107.893259, 103.492669),\n (107.893259, 103.492669, 105.620038, 103.492669),\n (105.620038, 103.492669, 103.346817, 103.492669),\n (103.346817, 103.492669, 101.073597, 103.492669),\n (101.073597, 103.492669, 98.800376, 103.492669),\n (98.800376, 103.492669, 96.527155, 103.492669),\n (96.527155, 103.492669, 94.253935, 103.492669),\n (94.253935, 103.492669, 91.980714, 103.492669),\n (91.980714, 103.492669, 89.707493, 103.492669),\n (89.707493, 103.492669, 87.434273, 103.492669),\n (87.434273, 103.492669, 85.161052, 103.492669),\n (85.161052, 103.492669, 82.887832, 103.492669),\n (82.887832, 103.492669, 80.614611, 103.492669),\n (80.614611, 103.492669, 78.34139, 103.492669),\n (78.34139, 103.492669, 76.06817, 103.492669),\n (76.06817, 103.492669, 76.06817, 80.13573),\n (162.811231, 117.49267, 162.811231, 119.76589),\n (162.811231, 119.76589, 162.811231, 122.039111),\n (162.811231, 122.039111, 162.811231, 124.312332),\n (162.811231, 124.312332, 162.811231, 126.585552),\n (162.811231, 126.585552, 162.811231, 128.858773),\n (162.811231, 128.858773, 162.811231, 131.131993),\n (162.811231, 131.131993, 162.811231, 133.405214),\n (162.811231, 133.405214, 162.811231, 135.678435),\n (162.811231, 135.678435, 162.811231, 137.951655),\n (162.811231, 137.951655, 162.811231, 140.224876),\n (162.811231, 140.224876, 162.811231, 142.498097),\n (162.811231, 142.498097, 162.811231, 144.771317),\n (162.811231, 144.771317, 162.811231, 147.044538),\n (162.811231, 147.044538, 162.811231, 149.317759),\n (162.811231, 149.317759, 162.811231, 151.590979),\n (162.811231, 151.590979, 162.811231, 153.8642),\n (162.811231, 153.8642, 162.811231, 156.137421),\n (162.811231, 156.137421, 162.811231, 158.410641),\n (162.811231, 158.410641, 162.811231, 160.683862),\n (162.811231, 160.683862, 162.811231, 162.957083),\n (162.811231, 162.957083, 162.811231, 165.230303),\n (162.811231, 165.230303, 162.811231, 167.503524),\n (162.811231, 167.503524, 162.811231, 169.776745),\n (162.811231, 169.776745, 162.811231, 172.049965),\n (162.811231, 172.049965, 162.811231, 174.323186),\n (162.811231, 174.323186, 162.811231, 176.596407),\n (162.811231, 176.596407, 162.811231, 178.869627),\n (162.811231, 178.869627, 162.811231, 181.142848),\n (162.811231, 181.142848, 162.811231, 183.416068),\n (162.811231, 183.416068, 162.811231, 185.689289),\n (162.811231, 185.689289, 162.811231, 187.96251),\n (162.811231, 187.96251, 162.811231, 190.23573),\n (186.16817, 117.49267, 186.16817, 119.76589),\n (186.16817, 119.76589, 186.16817, 122.039111),\n (186.16817, 122.039111, 186.16817, 124.312332),\n (186.16817, 124.312332, 186.16817, 126.585552),\n (186.16817, 126.585552, 186.16817, 128.858773),\n (186.16817, 128.858773, 186.16817, 131.131993),\n (186.16817, 131.131993, 186.16817, 133.405214),\n (186.16817, 133.405214, 186.16817, 135.678435),\n (186.16817, 135.678435, 186.16817, 137.951655),\n (186.16817, 137.951655, 186.16817, 140.224876),\n (186.16817, 140.224876, 186.16817, 142.498097),\n (186.16817, 142.498097, 186.16817, 144.771317),\n (186.16817, 144.771317, 186.16817, 147.044538),\n (186.16817, 147.044538, 186.16817, 149.317759),\n (186.16817, 149.317759, 186.16817, 151.590979),\n (186.16817, 151.590979, 186.16817, 153.8642),\n (186.16817, 153.8642, 186.16817, 156.137421),\n (186.16817, 156.137421, 186.16817, 158.410641),\n (186.16817, 158.410641, 186.16817, 160.683862),\n (186.16817, 160.683862, 186.16817, 162.957083),\n (186.16817, 162.957083, 186.16817, 165.230303),\n (186.16817, 165.230303, 186.16817, 167.503524),\n (186.16817, 167.503524, 186.16817, 169.776745),\n (186.16817, 169.776745, 186.16817, 172.049965),\n (186.16817, 172.049965, 186.16817, 174.323186),\n (186.16817, 174.323186, 186.16817, 176.596407),\n (186.16817, 176.596407, 186.16817, 178.869627),\n (186.16817, 178.869627, 186.16817, 181.142848),\n (186.16817, 181.142848, 186.16817, 183.416068),\n (186.16817, 183.416068, 186.16817, 185.689289),\n (186.16817, 185.689289, 186.16817, 187.96251),\n (186.16817, 187.96251, 186.16817, 190.23573),\n (186.16817, 117.49267, 162.811231, 117.49267),\n (186.16817, 190.23573, 162.811231, 190.23573)\n]\nVISIBLE_CIRCLES = [\n (112.4397, 153.8642, 36.37153),\n (112.4397, 153.8642, 13.15566)\n]\nVISIBLE_ARCS = [\n\n]\nHIDDEN_SEGMENTS = [\n (125.5954, 103.4927, 125.5954, 80.1358),\n (99.2841, 80.1358, 99.2841, 103.4927),\n (186.1682, 167.0199, 162.8113, 167.0199),\n (186.1682, 140.7086, 162.8113, 140.7086)\n]\n# (orient, text, p1, p2, base) for linear; (orient, text, center, radius, angle) for diameter\nDIMENSIONS = [\n ('diameter', '%%c100', (112.4397, 153.8642), 36.3715, 45),\n ('diameter', '%%c36.1702', (112.4397, 153.8642), 13.1557, 135),\n ('horizontal', '32.1088', (162.8113, 153.8642), (186.1682, 153.8642), (174.4897, 164.8642))\n]\n\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\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\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,\n angle=(0 if d[0] == \"horizontal\" else 90),\n 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,\n text=text, dimstyle=\"EZDXF\").render()\n\n doc.saveas(out_path)\n\n\nif __name__ == \"__main__\":\n out = sys.argv[1] if len(sys.argv) > 1 else \"0045_00459644_gt.dxf\"\n draw(out)\n print(\"wrote\", out)\n```"}], "images": ["images/0045_00459644.png"], "id": "0045_00459644"} {"messages": [{"role": "user", "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 14.58 mm. It is extruded to a thickness of 2.58 mm."}, {"role": "assistant", "content": "```python\n#!/usr/bin/env python3\n# -*- coding: utf-8 -*-\n# Ground-truth 2D engineering drawing for part: 0046_00461449\n# Self-contained: reproduces the three-view DXF via ezdxf, NO FreeCAD needed.\n# Coordinates are A4 page millimetres (scale=0.9368568255143557, page=[297.0, 210.0]).\n# visible edges -> solid (layer OUTLINE); hidden edges -> dashed (layer HIDDEN)\n# dimensions -> real movable DIMENSION entities (text = true mm value)\n# Run: python 0046_00461449_gt.py [out.dxf]\nimport sys\nimport ezdxf\n\nSCALE = 0.9368568255143557\nPAGE = [297.0, 210.0]\n\nVISIBLE_SEGMENTS = [\n (168.717141, 85.371441, 165.789464, 85.371441),\n (165.789464, 85.371441, 162.861786, 85.371441),\n (162.861786, 85.371441, 159.934109, 85.371441),\n (159.934109, 85.371441, 157.006431, 85.371441),\n (157.006431, 85.371441, 154.078753, 85.371441),\n (154.078753, 85.371441, 151.151076, 85.371441),\n (151.151076, 85.371441, 148.223398, 85.371441),\n (148.223398, 85.371441, 145.295721, 85.371441),\n (145.295721, 85.371441, 142.368043, 85.371441),\n (142.368043, 85.371441, 139.440365, 85.371441),\n (139.440365, 85.371441, 136.512688, 85.371441),\n (136.512688, 85.371441, 133.58501, 85.371441),\n (133.58501, 85.371441, 130.657333, 85.371441),\n (130.657333, 85.371441, 127.729655, 85.371441),\n (127.729655, 85.371441, 124.801978, 85.371441),\n (124.801978, 85.371441, 121.8743, 85.371441),\n (121.8743, 85.371441, 118.946622, 85.371441),\n (118.946622, 85.371441, 116.018945, 85.371441),\n (116.018945, 85.371441, 113.091267, 85.371441),\n (113.091267, 85.371441, 110.16359, 85.371441),\n (110.16359, 85.371441, 107.235912, 85.371441),\n (107.235912, 85.371441, 104.308235, 85.371441),\n (104.308235, 85.371441, 101.380557, 85.371441),\n (101.380557, 85.371441, 98.452879, 85.371441),\n (98.452879, 85.371441, 95.525202, 85.371441),\n (95.525202, 85.371441, 92.597524, 85.371441),\n (92.597524, 85.371441, 89.669847, 85.371441),\n (89.669847, 85.371441, 86.742169, 85.371441),\n (86.742169, 85.371441, 83.814491, 85.371441),\n (83.814491, 85.371441, 80.886814, 85.371441),\n (80.886814, 85.371441, 77.959136, 85.371441),\n (77.959136, 85.371441, 75.031459, 85.371441),\n (168.717141, 85.371441, 168.717141, 87.785759),\n (168.717141, 87.785759, 165.789464, 87.785759),\n (165.789464, 87.785759, 162.861786, 87.785759),\n (162.861786, 87.785759, 159.934109, 87.785759),\n (159.934109, 87.785759, 157.006431, 87.785759),\n (157.006431, 87.785759, 154.078753, 87.785759),\n (154.078753, 87.785759, 151.151076, 87.785759),\n (151.151076, 87.785759, 148.223398, 87.785759),\n (148.223398, 87.785759, 145.295721, 87.785759),\n (145.295721, 87.785759, 142.368043, 87.785759),\n (142.368043, 87.785759, 139.440365, 87.785759),\n (139.440365, 87.785759, 136.512688, 87.785759),\n (136.512688, 87.785759, 133.58501, 87.785759),\n (133.58501, 87.785759, 130.657333, 87.785759),\n (130.657333, 87.785759, 127.729655, 87.785759),\n (127.729655, 87.785759, 124.801978, 87.785759),\n (124.801978, 87.785759, 121.8743, 87.785759),\n (121.8743, 87.785759, 118.946622, 87.785759),\n (118.946622, 87.785759, 116.018945, 87.785759),\n (116.018945, 87.785759, 113.091267, 87.785759),\n (113.091267, 87.785759, 110.16359, 87.785759),\n (110.16359, 87.785759, 107.235912, 87.785759),\n (107.235912, 87.785759, 104.308235, 87.785759),\n (104.308235, 87.785759, 101.380557, 87.785759),\n (101.380557, 87.785759, 98.452879, 87.785759),\n (98.452879, 87.785759, 95.525202, 87.785759),\n (95.525202, 87.785759, 92.597524, 87.785759),\n (92.597524, 87.785759, 89.669847, 87.785759),\n (89.669847, 87.785759, 86.742169, 87.785759),\n (86.742169, 87.785759, 83.814491, 87.785759),\n (83.814491, 87.785759, 80.886814, 87.785759),\n (80.886814, 87.785759, 77.959136, 87.785759),\n (77.959136, 87.785759, 75.031459, 87.785759),\n (75.031459, 87.785759, 75.031459, 85.371441),\n (182.717141, 101.785759, 182.717141, 104.713436),\n (182.717141, 104.713436, 182.717141, 107.641114),\n (182.717141, 107.641114, 182.717141, 110.568791),\n (182.717141, 110.568791, 182.717141, 113.496469),\n (182.717141, 113.496469, 182.717141, 116.424147),\n (182.717141, 116.424147, 182.717141, 119.351824),\n (182.717141, 119.351824, 182.717141, 122.279502),\n (182.717141, 122.279502, 182.717141, 125.207179),\n (182.717141, 125.207179, 182.717141, 128.134857),\n (182.717141, 128.134857, 182.717141, 131.062535),\n (182.717141, 131.062535, 182.717141, 133.990212),\n (182.717141, 133.990212, 182.717141, 136.91789),\n (182.717141, 136.91789, 182.717141, 139.845567),\n (182.717141, 139.845567, 182.717141, 142.773245),\n (182.717141, 142.773245, 182.717141, 145.700922),\n (182.717141, 145.700922, 182.717141, 148.6286),\n (182.717141, 148.6286, 182.717141, 151.556278),\n (182.717141, 151.556278, 182.717141, 154.483955),\n (182.717141, 154.483955, 182.717141, 157.411633),\n (182.717141, 157.411633, 182.717141, 160.33931),\n (182.717141, 160.33931, 182.717141, 163.266988),\n (182.717141, 163.266988, 182.717141, 166.194665),\n (182.717141, 166.194665, 182.717141, 169.122343),\n (182.717141, 169.122343, 182.717141, 172.050021),\n (182.717141, 172.050021, 182.717141, 174.977698),\n (182.717141, 174.977698, 182.717141, 177.905376),\n (182.717141, 177.905376, 182.717141, 180.833053),\n (182.717141, 180.833053, 182.717141, 183.760731),\n (182.717141, 183.760731, 182.717141, 186.688409),\n (182.717141, 186.688409, 182.717141, 189.616086),\n (182.717141, 189.616086, 182.717141, 192.543764),\n (182.717141, 192.543764, 182.717141, 195.471441),\n (185.131459, 101.785759, 185.131459, 104.713436),\n (185.131459, 104.713436, 185.131459, 107.641114),\n (185.131459, 107.641114, 185.131459, 110.568791),\n (185.131459, 110.568791, 185.131459, 113.496469),\n (185.131459, 113.496469, 185.131459, 116.424147),\n (185.131459, 116.424147, 185.131459, 119.351824),\n (185.131459, 119.351824, 185.131459, 122.279502),\n (185.131459, 122.279502, 185.131459, 125.207179),\n (185.131459, 125.207179, 185.131459, 128.134857),\n (185.131459, 128.134857, 185.131459, 131.062535),\n (185.131459, 131.062535, 185.131459, 133.990212),\n (185.131459, 133.990212, 185.131459, 136.91789),\n (185.131459, 136.91789, 185.131459, 139.845567),\n (185.131459, 139.845567, 185.131459, 142.773245),\n (185.131459, 142.773245, 185.131459, 145.700922),\n (185.131459, 145.700922, 185.131459, 148.6286),\n (185.131459, 148.6286, 185.131459, 151.556278),\n (185.131459, 151.556278, 185.131459, 154.483955),\n (185.131459, 154.483955, 185.131459, 157.411633),\n (185.131459, 157.411633, 185.131459, 160.33931),\n (185.131459, 160.33931, 185.131459, 163.266988),\n (185.131459, 163.266988, 185.131459, 166.194665),\n (185.131459, 166.194665, 185.131459, 169.122343),\n (185.131459, 169.122343, 185.131459, 172.050021),\n (185.131459, 172.050021, 185.131459, 174.977698),\n (185.131459, 174.977698, 185.131459, 177.905376),\n (185.131459, 177.905376, 185.131459, 180.833053),\n (185.131459, 180.833053, 185.131459, 183.760731),\n (185.131459, 183.760731, 185.131459, 186.688409),\n (185.131459, 186.688409, 185.131459, 189.616086),\n (185.131459, 189.616086, 185.131459, 192.543764),\n (185.131459, 192.543764, 185.131459, 195.471441),\n (185.131459, 101.785759, 182.717141, 101.785759),\n (185.131459, 195.471441, 182.717141, 195.471441)\n]\nVISIBLE_CIRCLES = [\n (121.8743, 148.6286, 46.842841),\n (121.8743, 148.6286, 6.831248)\n]\nVISIBLE_ARCS = [\n\n]\nHIDDEN_SEGMENTS = [\n (128.7056, 87.7857, 128.7056, 85.3714),\n (115.0431, 85.3714, 115.0431, 87.7857),\n (185.1315, 155.4598, 182.7172, 155.4598),\n (185.1315, 141.7973, 182.7172, 141.7973)\n]\n# (orient, text, p1, p2, base) for linear; (orient, text, center, radius, angle) for diameter\nDIMENSIONS = [\n ('diameter', '%%c100', (121.8743, 148.6286), 46.8428, 45),\n ('diameter', '%%c14.5833', (121.8743, 148.6286), 6.8312, 135),\n ('horizontal', '2.577', (182.7172, 148.6286), (185.1314, 148.6286), (183.9243, 159.6286))\n]\n\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\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\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,\n angle=(0 if d[0] == \"horizontal\" else 90),\n 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,\n text=text, dimstyle=\"EZDXF\").render()\n\n doc.saveas(out_path)\n\n\nif __name__ == \"__main__\":\n out = sys.argv[1] if len(sys.argv) > 1 else \"0046_00461449_gt.dxf\"\n draw(out)\n print(\"wrote\", out)\n```"}], "images": ["images/0046_00461449.png"], "id": "0046_00461449"} {"messages": [{"role": "user", "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 169.64 mm."}, {"role": "assistant", "content": "```python\n#!/usr/bin/env python3\n# -*- coding: utf-8 -*-\n# Ground-truth 2D engineering drawing for part: 0054_00544819\n# Self-contained: reproduces the three-view DXF via ezdxf, NO FreeCAD needed.\n# Coordinates are A4 page millimetres (scale=0.35639735099338693, page=[297.0, 210.0]).\n# visible edges -> solid (layer OUTLINE); hidden edges -> dashed (layer HIDDEN)\n# dimensions -> real movable DIMENSION entities (text = true mm value)\n# Run: python 0054_00544819_gt.py [out.dxf]\nimport sys\nimport ezdxf\n\nSCALE = 0.35639735099338693\nPAGE = [297.0, 210.0]\n\nVISIBLE_SEGMENTS = [\n (117.778568, 70.859967, 116.664826, 70.859967),\n (116.664826, 70.859967, 115.551084, 70.859967),\n (115.551084, 70.859967, 114.437342, 70.859967),\n (114.437342, 70.859967, 113.323601, 70.859967),\n (113.323601, 70.859967, 112.209859, 70.859967),\n (112.209859, 70.859967, 111.096117, 70.859967),\n (111.096117, 70.859967, 109.982375, 70.859967),\n (109.982375, 70.859967, 108.868634, 70.859967),\n (108.868634, 70.859967, 107.754892, 70.859967),\n (107.754892, 70.859967, 106.64115, 70.859967),\n (106.64115, 70.859967, 105.527409, 70.859967),\n (105.527409, 70.859967, 104.413667, 70.859967),\n (104.413667, 70.859967, 103.299925, 70.859967),\n (103.299925, 70.859967, 102.186183, 70.859967),\n (102.186183, 70.859967, 101.072442, 70.859967),\n (101.072442, 70.859967, 99.9587, 70.859967),\n (99.9587, 70.859967, 98.844958, 70.859967),\n (98.844958, 70.859967, 97.731217, 70.859967),\n (97.731217, 70.859967, 96.617475, 70.859967),\n (96.617475, 70.859967, 95.503733, 70.859967),\n (95.503733, 70.859967, 94.389991, 70.859967),\n (94.389991, 70.859967, 93.27625, 70.859967),\n (93.27625, 70.859967, 92.162508, 70.859967),\n (92.162508, 70.859967, 91.048766, 70.859967),\n (91.048766, 70.859967, 89.935025, 70.859967),\n (89.935025, 70.859967, 88.821283, 70.859967),\n (88.821283, 70.859967, 87.707541, 70.859967),\n (87.707541, 70.859967, 86.593799, 70.859967),\n (86.593799, 70.859967, 85.480058, 70.859967),\n (85.480058, 70.859967, 84.366316, 70.859967),\n (84.366316, 70.859967, 83.252574, 70.859967),\n (83.252574, 70.859967, 82.138832, 70.859967),\n (117.778568, 70.859967, 117.778568, 131.320232),\n (117.778568, 131.320232, 116.664826, 131.320232),\n (116.664826, 131.320232, 115.551084, 131.320232),\n (115.551084, 131.320232, 114.437342, 131.320232),\n (114.437342, 131.320232, 113.323601, 131.320232),\n (113.323601, 131.320232, 112.209859, 131.320232),\n (112.209859, 131.320232, 111.096117, 131.320232),\n (111.096117, 131.320232, 109.982375, 131.320232),\n (109.982375, 131.320232, 108.868634, 131.320232),\n (108.868634, 131.320232, 107.754892, 131.320232),\n (107.754892, 131.320232, 106.64115, 131.320232),\n (106.64115, 131.320232, 105.527409, 131.320232),\n (105.527409, 131.320232, 104.413667, 131.320232),\n (104.413667, 131.320232, 103.299925, 131.320232),\n (103.299925, 131.320232, 102.186183, 131.320232),\n (102.186183, 131.320232, 101.072442, 131.320232),\n (101.072442, 131.320232, 99.9587, 131.320232),\n (99.9587, 131.320232, 98.844958, 131.320232),\n (98.844958, 131.320232, 97.731217, 131.320232),\n (97.731217, 131.320232, 96.617475, 131.320232),\n (96.617475, 131.320232, 95.503733, 131.320232),\n (95.503733, 131.320232, 94.389991, 131.320232),\n (94.389991, 131.320232, 93.27625, 131.320232),\n (93.27625, 131.320232, 92.162508, 131.320232),\n (92.162508, 131.320232, 91.048766, 131.320232),\n (91.048766, 131.320232, 89.935025, 131.320232),\n (89.935025, 131.320232, 88.821283, 131.320232),\n (88.821283, 131.320232, 87.707541, 131.320232),\n (87.707541, 131.320232, 86.593799, 131.320232),\n (86.593799, 131.320232, 85.480058, 131.320232),\n (85.480058, 131.320232, 84.366316, 131.320232),\n (84.366316, 131.320232, 83.252574, 131.320232),\n (83.252574, 131.320232, 82.138832, 131.320232),\n (82.138832, 131.320232, 82.138832, 70.859967),\n (131.778568, 145.320232, 131.778568, 146.433974),\n (131.778568, 146.433974, 131.778568, 147.547716),\n (131.778568, 147.547716, 131.778568, 148.661458),\n (131.778568, 148.661458, 131.778568, 149.775199),\n (131.778568, 149.775199, 131.778568, 150.888941),\n (131.778568, 150.888941, 131.778568, 152.002683),\n (131.778568, 152.002683, 131.778568, 153.116425),\n (131.778568, 153.116425, 131.778568, 154.230166),\n (131.778568, 154.230166, 131.778568, 155.343908),\n (131.778568, 155.343908, 131.778568, 156.45765),\n (131.778568, 156.45765, 131.778568, 157.571391),\n (131.778568, 157.571391, 131.778568, 158.685133),\n (131.778568, 158.685133, 131.778568, 159.798875),\n (131.778568, 159.798875, 131.778568, 160.912617),\n (131.778568, 160.912617, 131.778568, 162.026358),\n (131.778568, 162.026358, 131.778568, 163.1401),\n (131.778568, 163.1401, 131.778568, 164.253842),\n (131.778568, 164.253842, 131.778568, 165.367583),\n (131.778568, 165.367583, 131.778568, 166.481325),\n (131.778568, 166.481325, 131.778568, 167.595067),\n (131.778568, 167.595067, 131.778568, 168.708809),\n (131.778568, 168.708809, 131.778568, 169.82255),\n (131.778568, 169.82255, 131.778568, 170.936292),\n (131.778568, 170.936292, 131.778568, 172.050034),\n (131.778568, 172.050034, 131.778568, 173.163775),\n (131.778568, 173.163775, 131.778568, 174.277517),\n (131.778568, 174.277517, 131.778568, 175.391259),\n (131.778568, 175.391259, 131.778568, 176.505001),\n (131.778568, 176.505001, 131.778568, 177.618742),\n (131.778568, 177.618742, 131.778568, 178.732484),\n (131.778568, 178.732484, 131.778568, 179.846226),\n (131.778568, 179.846226, 131.778568, 180.959968),\n (192.238833, 145.320232, 192.238833, 146.433974),\n (192.238833, 146.433974, 192.238833, 147.547716),\n (192.238833, 147.547716, 192.238833, 148.661458),\n (192.238833, 148.661458, 192.238833, 149.775199),\n (192.238833, 149.775199, 192.238833, 150.888941),\n (192.238833, 150.888941, 192.238833, 152.002683),\n (192.238833, 152.002683, 192.238833, 153.116425),\n (192.238833, 153.116425, 192.238833, 154.230166),\n (192.238833, 154.230166, 192.238833, 155.343908),\n (192.238833, 155.343908, 192.238833, 156.45765),\n (192.238833, 156.45765, 192.238833, 157.571391),\n (192.238833, 157.571391, 192.238833, 158.685133),\n (192.238833, 158.685133, 192.238833, 159.798875),\n (192.238833, 159.798875, 192.238833, 160.912617),\n (192.238833, 160.912617, 192.238833, 162.026358),\n (192.238833, 162.026358, 192.238833, 163.1401),\n (192.238833, 163.1401, 192.238833, 164.253842),\n (192.238833, 164.253842, 192.238833, 165.367583),\n (192.238833, 165.367583, 192.238833, 166.481325),\n (192.238833, 166.481325, 192.238833, 167.595067),\n (192.238833, 167.595067, 192.238833, 168.708809),\n (192.238833, 168.708809, 192.238833, 169.82255),\n (192.238833, 169.82255, 192.238833, 170.936292),\n (192.238833, 170.936292, 192.238833, 172.050034),\n (192.238833, 172.050034, 192.238833, 173.163775),\n (192.238833, 173.163775, 192.238833, 174.277517),\n (192.238833, 174.277517, 192.238833, 175.391259),\n (192.238833, 175.391259, 192.238833, 176.505001),\n (192.238833, 176.505001, 192.238833, 177.618742),\n (192.238833, 177.618742, 192.238833, 178.732484),\n (192.238833, 178.732484, 192.238833, 179.846226),\n (192.238833, 179.846226, 192.238833, 180.959968),\n (192.238833, 145.320232, 131.778568, 145.320232),\n (192.238833, 180.959968, 131.778568, 180.959968)\n]\nVISIBLE_CIRCLES = [\n (99.9587, 163.1401, 17.819868),\n (99.9587, 163.1401, 7.424945)\n]\nVISIBLE_ARCS = [\n\n]\nHIDDEN_SEGMENTS = [\n (107.3836, 131.3202, 107.3836, 70.8599),\n (92.5337, 70.8599, 92.5337, 131.3202),\n (192.2388, 170.565, 131.7785, 170.565),\n (192.2388, 155.7151, 131.7785, 155.7151)\n]\n# (orient, text, p1, p2, base) for linear; (orient, text, center, radius, angle) for diameter\nDIMENSIONS = [\n ('diameter', '%%c100', (99.9587, 163.1401), 17.8199, 45),\n ('diameter', '%%c41.6667', (99.9587, 163.1401), 7.425, 135),\n ('horizontal', '169.643', (131.7785, 163.1401), (192.2388, 163.1401), (162.0087, 174.1401))\n]\n\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\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\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,\n angle=(0 if d[0] == \"horizontal\" else 90),\n 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,\n text=text, dimstyle=\"EZDXF\").render()\n\n doc.saveas(out_path)\n\n\nif __name__ == \"__main__\":\n out = sys.argv[1] if len(sys.argv) > 1 else \"0054_00544819_gt.dxf\"\n draw(out)\n print(\"wrote\", out)\n```"}], "images": ["images/0054_00544819.png"], "id": "0054_00544819"} {"messages": [{"role": "user", "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 93.75 mm. It is extruded to a thickness of 1.03 mm."}, {"role": "assistant", "content": "```python\n#!/usr/bin/env python3\n# -*- coding: utf-8 -*-\n# Ground-truth 2D engineering drawing for part: 0054_00549119\n# Self-contained: reproduces the three-view DXF via ezdxf, NO FreeCAD needed.\n# Coordinates are A4 page millimetres (scale=0.951194930727099, page=[297.0, 210.0]).\n# visible edges -> solid (layer OUTLINE); hidden edges -> dashed (layer HIDDEN)\n# dimensions -> real movable DIMENSION entities (text = true mm value)\n# Run: python 0054_00549119_gt.py [out.dxf]\nimport sys\nimport ezdxf\n\nSCALE = 0.951194930727099\nPAGE = [297.0, 210.0]\n\nVISIBLE_SEGMENTS = [\n (160.532747, 85.729846, 157.560262, 85.729846),\n (157.560262, 85.729846, 154.587778, 85.729846),\n (154.587778, 85.729846, 151.615294, 85.729846),\n (151.615294, 85.729846, 148.64281, 85.729846),\n (148.64281, 85.729846, 145.670326, 85.729846),\n (145.670326, 85.729846, 142.697842, 85.729846),\n (142.697842, 85.729846, 139.725357, 85.729846),\n (139.725357, 85.729846, 136.752873, 85.729846),\n (136.752873, 85.729846, 133.780389, 85.729846),\n (133.780389, 85.729846, 130.807905, 85.729846),\n (130.807905, 85.729846, 127.835421, 85.729846),\n (127.835421, 85.729846, 124.862937, 85.729846),\n (124.862937, 85.729846, 121.890452, 85.729846),\n (121.890452, 85.729846, 118.917968, 85.729846),\n (118.917968, 85.729846, 115.945484, 85.729846),\n (115.945484, 85.729846, 112.973, 85.729846),\n (112.973, 85.729846, 110.000516, 85.729846),\n (110.000516, 85.729846, 107.028032, 85.729846),\n (107.028032, 85.729846, 104.055548, 85.729846),\n (104.055548, 85.729846, 101.083063, 85.729846),\n (101.083063, 85.729846, 98.110579, 85.729846),\n (98.110579, 85.729846, 95.138095, 85.729846),\n (95.138095, 85.729846, 92.165611, 85.729846),\n (92.165611, 85.729846, 89.193127, 85.729846),\n (89.193127, 85.729846, 86.220643, 85.729846),\n (86.220643, 85.729846, 83.248158, 85.729846),\n (83.248158, 85.729846, 80.275674, 85.729846),\n (80.275674, 85.729846, 77.30319, 85.729846),\n (77.30319, 85.729846, 74.330706, 85.729846),\n (74.330706, 85.729846, 71.358222, 85.729846),\n (71.358222, 85.729846, 68.385738, 85.729846),\n (68.385738, 85.729846, 65.413253, 85.729846),\n (160.532747, 85.729846, 160.532747, 86.710353),\n (160.532747, 86.710353, 157.560262, 86.710353),\n (157.560262, 86.710353, 154.587778, 86.710353),\n (154.587778, 86.710353, 151.615294, 86.710353),\n (151.615294, 86.710353, 148.64281, 86.710353),\n (148.64281, 86.710353, 145.670326, 86.710353),\n (145.670326, 86.710353, 142.697842, 86.710353),\n (142.697842, 86.710353, 139.725357, 86.710353),\n (139.725357, 86.710353, 136.752873, 86.710353),\n (136.752873, 86.710353, 133.780389, 86.710353),\n (133.780389, 86.710353, 130.807905, 86.710353),\n (130.807905, 86.710353, 127.835421, 86.710353),\n (127.835421, 86.710353, 124.862937, 86.710353),\n (124.862937, 86.710353, 121.890452, 86.710353),\n (121.890452, 86.710353, 118.917968, 86.710353),\n (118.917968, 86.710353, 115.945484, 86.710353),\n (115.945484, 86.710353, 112.973, 86.710353),\n (112.973, 86.710353, 110.000516, 86.710353),\n (110.000516, 86.710353, 107.028032, 86.710353),\n (107.028032, 86.710353, 104.055548, 86.710353),\n (104.055548, 86.710353, 101.083063, 86.710353),\n (101.083063, 86.710353, 98.110579, 86.710353),\n (98.110579, 86.710353, 95.138095, 86.710353),\n (95.138095, 86.710353, 92.165611, 86.710353),\n (92.165611, 86.710353, 89.193127, 86.710353),\n (89.193127, 86.710353, 86.220643, 86.710353),\n (86.220643, 86.710353, 83.248158, 86.710353),\n (83.248158, 86.710353, 80.275674, 86.710353),\n (80.275674, 86.710353, 77.30319, 86.710353),\n (77.30319, 86.710353, 74.330706, 86.710353),\n (74.330706, 86.710353, 71.358222, 86.710353),\n (71.358222, 86.710353, 68.385738, 86.710353),\n (68.385738, 86.710353, 65.413253, 86.710353),\n (65.413253, 86.710353, 65.413253, 85.729846),\n (174.532747, 100.710353, 174.532747, 103.682838),\n (174.532747, 103.682838, 174.532747, 106.655322),\n (174.532747, 106.655322, 174.532747, 109.627806),\n (174.532747, 109.627806, 174.532747, 112.60029),\n (174.532747, 112.60029, 174.532747, 115.572774),\n (174.532747, 115.572774, 174.532747, 118.545258),\n (174.532747, 118.545258, 174.532747, 121.517743),\n (174.532747, 121.517743, 174.532747, 124.490227),\n (174.532747, 124.490227, 174.532747, 127.462711),\n (174.532747, 127.462711, 174.532747, 130.435195),\n (174.532747, 130.435195, 174.532747, 133.407679),\n (174.532747, 133.407679, 174.532747, 136.380163),\n (174.532747, 136.380163, 174.532747, 139.352648),\n (174.532747, 139.352648, 174.532747, 142.325132),\n (174.532747, 142.325132, 174.532747, 145.297616),\n (174.532747, 145.297616, 174.532747, 148.2701),\n (174.532747, 148.2701, 174.532747, 151.242584),\n (174.532747, 151.242584, 174.532747, 154.215068),\n (174.532747, 154.215068, 174.532747, 157.187552),\n (174.532747, 157.187552, 174.532747, 160.160037),\n (174.532747, 160.160037, 174.532747, 163.132521),\n (174.532747, 163.132521, 174.532747, 166.105005),\n (174.532747, 166.105005, 174.532747, 169.077489),\n (174.532747, 169.077489, 174.532747, 172.049973),\n (174.532747, 172.049973, 174.532747, 175.022457),\n (174.532747, 175.022457, 174.532747, 177.994942),\n (174.532747, 177.994942, 174.532747, 180.967426),\n (174.532747, 180.967426, 174.532747, 183.93991),\n (174.532747, 183.93991, 174.532747, 186.912394),\n (174.532747, 186.912394, 174.532747, 189.884878),\n (174.532747, 189.884878, 174.532747, 192.857362),\n (174.532747, 192.857362, 174.532747, 195.829847),\n (175.513254, 100.710353, 175.513254, 103.682838),\n (175.513254, 103.682838, 175.513254, 106.655322),\n (175.513254, 106.655322, 175.513254, 109.627806),\n (175.513254, 109.627806, 175.513254, 112.60029),\n (175.513254, 112.60029, 175.513254, 115.572774),\n (175.513254, 115.572774, 175.513254, 118.545258),\n (175.513254, 118.545258, 175.513254, 121.517743),\n (175.513254, 121.517743, 175.513254, 124.490227),\n (175.513254, 124.490227, 175.513254, 127.462711),\n (175.513254, 127.462711, 175.513254, 130.435195),\n (175.513254, 130.435195, 175.513254, 133.407679),\n (175.513254, 133.407679, 175.513254, 136.380163),\n (175.513254, 136.380163, 175.513254, 139.352648),\n (175.513254, 139.352648, 175.513254, 142.325132),\n (175.513254, 142.325132, 175.513254, 145.297616),\n (175.513254, 145.297616, 175.513254, 148.2701),\n (175.513254, 148.2701, 175.513254, 151.242584),\n (175.513254, 151.242584, 175.513254, 154.215068),\n (175.513254, 154.215068, 175.513254, 157.187552),\n (175.513254, 157.187552, 175.513254, 160.160037),\n (175.513254, 160.160037, 175.513254, 163.132521),\n (175.513254, 163.132521, 175.513254, 166.105005),\n (175.513254, 166.105005, 175.513254, 169.077489),\n (175.513254, 169.077489, 175.513254, 172.049973),\n (175.513254, 172.049973, 175.513254, 175.022457),\n (175.513254, 175.022457, 175.513254, 177.994942),\n (175.513254, 177.994942, 175.513254, 180.967426),\n (175.513254, 180.967426, 175.513254, 183.93991),\n (175.513254, 183.93991, 175.513254, 186.912394),\n (175.513254, 186.912394, 175.513254, 189.884878),\n (175.513254, 189.884878, 175.513254, 192.857362),\n (175.513254, 192.857362, 175.513254, 195.829847),\n (175.513254, 100.710353, 174.532747, 100.710353),\n (175.513254, 195.829847, 174.532747, 195.829847)\n]\nVISIBLE_CIRCLES = [\n (112.973, 148.2701, 47.559747),\n (112.973, 148.2701, 44.587262)\n]\nVISIBLE_ARCS = [\n\n]\nHIDDEN_SEGMENTS = [\n (157.5603, 86.7104, 157.5603, 85.7299),\n (68.3857, 85.7299, 68.3857, 86.7104),\n (175.5132, 192.8574, 174.5327, 192.8574),\n (175.5132, 103.6829, 174.5327, 103.6829)\n]\n# (orient, text, p1, p2, base) for linear; (orient, text, center, radius, angle) for diameter\nDIMENSIONS = [\n ('diameter', '%%c100', (112.973, 148.2701), 47.5597, 45),\n ('diameter', '%%c93.75', (112.973, 148.2701), 44.5873, 135),\n ('horizontal', '1.0308', (174.5327, 148.2701), (175.5132, 148.2701), (175.023, 159.2701))\n]\n\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\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\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,\n angle=(0 if d[0] == \"horizontal\" else 90),\n 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,\n text=text, dimstyle=\"EZDXF\").render()\n\n doc.saveas(out_path)\n\n\nif __name__ == \"__main__\":\n out = sys.argv[1] if len(sys.argv) > 1 else \"0054_00549119_gt.dxf\"\n draw(out)\n print(\"wrote\", out)\n```"}], "images": ["images/0054_00549119.png"], "id": "0054_00549119"} {"messages": [{"role": "user", "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": "assistant", "content": "```python\n#!/usr/bin/env python3\n# -*- coding: utf-8 -*-\n# Ground-truth 2D engineering drawing for part: 0054_00549793\n# Self-contained: reproduces the three-view DXF via ezdxf, NO FreeCAD needed.\n# Coordinates are A4 page millimetres (scale=0.8963238538609416, page=[297.0, 210.0]).\n# visible edges -> solid (layer OUTLINE); hidden edges -> dashed (layer HIDDEN)\n# dimensions -> real movable DIMENSION entities (text = true mm value)\n# Run: python 0054_00549793_gt.py [out.dxf]\nimport sys\nimport ezdxf\n\nSCALE = 0.8963238538609416\nPAGE = [297.0, 210.0]\n\nVISIBLE_SEGMENTS = [\n (161.743093, 84.358092, 158.942081, 84.358092),\n (158.942081, 84.358092, 156.141069, 84.358092),\n (156.141069, 84.358092, 153.340057, 84.358092),\n (153.340057, 84.358092, 150.539045, 84.358092),\n (150.539045, 84.358092, 147.738032, 84.358092),\n (147.738032, 84.358092, 144.93702, 84.358092),\n (144.93702, 84.358092, 142.136008, 84.358092),\n (142.136008, 84.358092, 139.334996, 84.358092),\n (139.334996, 84.358092, 136.533984, 84.358092),\n (136.533984, 84.358092, 133.732972, 84.358092),\n (133.732972, 84.358092, 130.93196, 84.358092),\n (130.93196, 84.358092, 128.130948, 84.358092),\n (128.130948, 84.358092, 125.329936, 84.358092),\n (125.329936, 84.358092, 122.528924, 84.358092),\n (122.528924, 84.358092, 119.727912, 84.358092),\n (119.727912, 84.358092, 116.9269, 84.358092),\n (116.9269, 84.358092, 114.125888, 84.358092),\n (114.125888, 84.358092, 111.324876, 84.358092),\n (111.324876, 84.358092, 108.523864, 84.358092),\n (108.523864, 84.358092, 105.722852, 84.358092),\n (105.722852, 84.358092, 102.92184, 84.358092),\n (102.92184, 84.358092, 100.120828, 84.358092),\n (100.120828, 84.358092, 97.319816, 84.358092),\n (97.319816, 84.358092, 94.518804, 84.358092),\n (94.518804, 84.358092, 91.717792, 84.358092),\n (91.717792, 84.358092, 88.91678, 84.358092),\n (88.91678, 84.358092, 86.115768, 84.358092),\n (86.115768, 84.358092, 83.314755, 84.358092),\n (83.314755, 84.358092, 80.513743, 84.358092),\n (80.513743, 84.358092, 77.712731, 84.358092),\n (77.712731, 84.358092, 74.911719, 84.358092),\n (74.911719, 84.358092, 72.110707, 84.358092),\n (161.743093, 84.358092, 161.743093, 90.825707),\n (161.743093, 90.825707, 158.942081, 90.825707),\n (158.942081, 90.825707, 156.141069, 90.825707),\n (156.141069, 90.825707, 153.340057, 90.825707),\n (153.340057, 90.825707, 150.539045, 90.825707),\n (150.539045, 90.825707, 147.738032, 90.825707),\n (147.738032, 90.825707, 144.93702, 90.825707),\n (144.93702, 90.825707, 142.136008, 90.825707),\n (142.136008, 90.825707, 139.334996, 90.825707),\n (139.334996, 90.825707, 136.533984, 90.825707),\n (136.533984, 90.825707, 133.732972, 90.825707),\n (133.732972, 90.825707, 130.93196, 90.825707),\n (130.93196, 90.825707, 128.130948, 90.825707),\n (128.130948, 90.825707, 125.329936, 90.825707),\n (125.329936, 90.825707, 122.528924, 90.825707),\n (122.528924, 90.825707, 119.727912, 90.825707),\n (119.727912, 90.825707, 116.9269, 90.825707),\n (116.9269, 90.825707, 114.125888, 90.825707),\n (114.125888, 90.825707, 111.324876, 90.825707),\n (111.324876, 90.825707, 108.523864, 90.825707),\n (108.523864, 90.825707, 105.722852, 90.825707),\n (105.722852, 90.825707, 102.92184, 90.825707),\n (102.92184, 90.825707, 100.120828, 90.825707),\n (100.120828, 90.825707, 97.319816, 90.825707),\n (97.319816, 90.825707, 94.518804, 90.825707),\n (94.518804, 90.825707, 91.717792, 90.825707),\n (91.717792, 90.825707, 88.91678, 90.825707),\n (88.91678, 90.825707, 86.115768, 90.825707),\n (86.115768, 90.825707, 83.314755, 90.825707),\n (83.314755, 90.825707, 80.513743, 90.825707),\n (80.513743, 90.825707, 77.712731, 90.825707),\n (77.712731, 90.825707, 74.911719, 90.825707),\n (74.911719, 90.825707, 72.110707, 90.825707),\n (72.110707, 90.825707, 72.110707, 84.358092),\n (175.743093, 104.825707, 175.743093, 107.626719),\n (175.743093, 107.626719, 175.743093, 110.427731),\n (175.743093, 110.427731, 175.743093, 113.228743),\n (175.743093, 113.228743, 175.743093, 116.029755),\n (175.743093, 116.029755, 175.743093, 118.830768),\n (175.743093, 118.830768, 175.743093, 121.63178),\n (175.743093, 121.63178, 175.743093, 124.432792),\n (175.743093, 124.432792, 175.743093, 127.233804),\n (175.743093, 127.233804, 175.743093, 130.034816),\n (175.743093, 130.034816, 175.743093, 132.835828),\n (175.743093, 132.835828, 175.743093, 135.63684),\n (175.743093, 135.63684, 175.743093, 138.437852),\n (175.743093, 138.437852, 175.743093, 141.238864),\n (175.743093, 141.238864, 175.743093, 144.039876),\n (175.743093, 144.039876, 175.743093, 146.840888),\n (175.743093, 146.840888, 175.743093, 149.6419),\n (175.743093, 149.6419, 175.743093, 152.442912),\n (175.743093, 152.442912, 175.743093, 155.243924),\n (175.743093, 155.243924, 175.743093, 158.044936),\n (175.743093, 158.044936, 175.743093, 160.845948),\n (175.743093, 160.845948, 175.743093, 163.64696),\n (175.743093, 163.64696, 175.743093, 166.447972),\n (175.743093, 166.447972, 175.743093, 169.248984),\n (175.743093, 169.248984, 175.743093, 172.049996),\n (175.743093, 172.049996, 175.743093, 174.851008),\n (175.743093, 174.851008, 175.743093, 177.65202),\n (175.743093, 177.65202, 175.743093, 180.453032),\n (175.743093, 180.453032, 175.743093, 183.254045),\n (175.743093, 183.254045, 175.743093, 186.055057),\n (175.743093, 186.055057, 175.743093, 188.856069),\n (175.743093, 188.856069, 175.743093, 191.657081),\n (175.743093, 191.657081, 175.743093, 194.458093),\n (182.210708, 104.825707, 182.210708, 107.626719),\n (182.210708, 107.626719, 182.210708, 110.427731),\n (182.210708, 110.427731, 182.210708, 113.228743),\n (182.210708, 113.228743, 182.210708, 116.029755),\n (182.210708, 116.029755, 182.210708, 118.830768),\n (182.210708, 118.830768, 182.210708, 121.63178),\n (182.210708, 121.63178, 182.210708, 124.432792),\n (182.210708, 124.432792, 182.210708, 127.233804),\n (182.210708, 127.233804, 182.210708, 130.034816),\n (182.210708, 130.034816, 182.210708, 132.835828),\n (182.210708, 132.835828, 182.210708, 135.63684),\n (182.210708, 135.63684, 182.210708, 138.437852),\n (182.210708, 138.437852, 182.210708, 141.238864),\n (182.210708, 141.238864, 182.210708, 144.039876),\n (182.210708, 144.039876, 182.210708, 146.840888),\n (182.210708, 146.840888, 182.210708, 149.6419),\n (182.210708, 149.6419, 182.210708, 152.442912),\n (182.210708, 152.442912, 182.210708, 155.243924),\n (182.210708, 155.243924, 182.210708, 158.044936),\n (182.210708, 158.044936, 182.210708, 160.845948),\n (182.210708, 160.845948, 182.210708, 163.64696),\n (182.210708, 163.64696, 182.210708, 166.447972),\n (182.210708, 166.447972, 182.210708, 169.248984),\n (182.210708, 169.248984, 182.210708, 172.049996),\n (182.210708, 172.049996, 182.210708, 174.851008),\n (182.210708, 174.851008, 182.210708, 177.65202),\n (182.210708, 177.65202, 182.210708, 180.453032),\n (182.210708, 180.453032, 182.210708, 183.254045),\n (182.210708, 183.254045, 182.210708, 186.055057),\n (182.210708, 186.055057, 182.210708, 188.856069),\n (182.210708, 188.856069, 182.210708, 191.657081),\n (182.210708, 191.657081, 182.210708, 194.458093),\n (182.210708, 104.825707, 175.743093, 104.825707),\n (182.210708, 194.458093, 175.743093, 194.458093)\n]\nVISIBLE_CIRCLES = [\n (116.9269, 149.6419, 44.816193),\n (116.9269, 149.6419, 20.540755)\n]\nVISIBLE_ARCS = [\n\n]\nHIDDEN_SEGMENTS = [\n (137.4677, 90.8257, 137.4677, 84.3581),\n (96.3862, 84.3581, 96.3862, 90.8257),\n (182.2108, 170.1827, 175.7431, 170.1827),\n (182.2108, 129.1011, 175.7431, 129.1011)\n]\n# (orient, text, p1, p2, base) for linear; (orient, text, center, radius, angle) for diameter\nDIMENSIONS = [\n ('diameter', '%%c100', (116.9269, 149.6419), 44.8162, 45),\n ('diameter', '%%c45.8333', (116.9269, 149.6419), 20.5407, 135),\n ('horizontal', '7.2157', (175.7431, 149.6419), (182.2108, 149.6419), (178.977, 160.6419))\n]\n\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\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\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,\n angle=(0 if d[0] == \"horizontal\" else 90),\n 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,\n text=text, dimstyle=\"EZDXF\").render()\n\n doc.saveas(out_path)\n\n\nif __name__ == \"__main__\":\n out = sys.argv[1] if len(sys.argv) > 1 else \"0054_00549793_gt.dxf\"\n draw(out)\n print(\"wrote\", out)\n```"}], "images": ["images/0054_00549793.png"], "id": "0054_00549793"} {"messages": [{"role": "user", "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 158.33 mm."}, {"role": "assistant", "content": "```python\n#!/usr/bin/env python3\n# -*- coding: utf-8 -*-\n# Ground-truth 2D engineering drawing for part: 0055_00553974\n# Self-contained: reproduces the three-view DXF via ezdxf, NO FreeCAD needed.\n# Coordinates are A4 page millimetres (scale=0.4805, page=[297.0, 210.0]).\n# visible edges -> solid (layer OUTLINE); hidden edges -> dashed (layer HIDDEN)\n# dimensions -> real movable DIMENSION entities (text = true mm value)\n# Run: python 0055_00553974_gt.py [out.dxf]\nimport sys\nimport ezdxf\n\nSCALE = 0.4805\nPAGE = [297.0, 210.0]\n\nVISIBLE_SEGMENTS = [\n (113.3509, 59.947933, 111.849338, 59.947933),\n (111.849338, 59.947933, 110.347775, 59.947933),\n (110.347775, 59.947933, 108.846213, 59.947933),\n (108.846213, 59.947933, 107.34465, 59.947933),\n (107.34465, 59.947933, 105.843087, 59.947933),\n (105.843087, 59.947933, 104.341525, 59.947933),\n (104.341525, 59.947933, 102.839962, 59.947933),\n (102.839962, 59.947933, 101.3384, 59.947933),\n (101.3384, 59.947933, 99.836838, 59.947933),\n (99.836838, 59.947933, 98.335275, 59.947933),\n (98.335275, 59.947933, 96.833713, 59.947933),\n (96.833713, 59.947933, 95.33215, 59.947933),\n (95.33215, 59.947933, 93.830588, 59.947933),\n (93.830588, 59.947933, 92.329025, 59.947933),\n (92.329025, 59.947933, 90.827463, 59.947933),\n (90.827463, 59.947933, 89.3259, 59.947933),\n (89.3259, 59.947933, 87.824338, 59.947933),\n (87.824338, 59.947933, 86.322775, 59.947933),\n (86.322775, 59.947933, 84.821213, 59.947933),\n (84.821213, 59.947933, 83.31965, 59.947933),\n (83.31965, 59.947933, 81.818088, 59.947933),\n (81.818088, 59.947933, 80.316525, 59.947933),\n (80.316525, 59.947933, 78.814963, 59.947933),\n (78.814963, 59.947933, 77.3134, 59.947933),\n (77.3134, 59.947933, 75.811838, 59.947933),\n (75.811838, 59.947933, 74.310275, 59.947933),\n (74.310275, 59.947933, 72.808713, 59.947933),\n (72.808713, 59.947933, 71.30715, 59.947933),\n (71.30715, 59.947933, 69.805588, 59.947933),\n (69.805588, 59.947933, 68.304025, 59.947933),\n (68.304025, 59.947933, 66.802463, 59.947933),\n (66.802463, 59.947933, 65.3009, 59.947933),\n (113.3509, 59.947933, 113.3509, 136.0271),\n (113.3509, 136.0271, 111.849338, 136.0271),\n (111.849338, 136.0271, 110.347775, 136.0271),\n (110.347775, 136.0271, 108.846213, 136.0271),\n (108.846213, 136.0271, 107.34465, 136.0271),\n (107.34465, 136.0271, 105.843087, 136.0271),\n (105.843087, 136.0271, 104.341525, 136.0271),\n (104.341525, 136.0271, 102.839962, 136.0271),\n (102.839962, 136.0271, 101.3384, 136.0271),\n (101.3384, 136.0271, 99.836838, 136.0271),\n (99.836838, 136.0271, 98.335275, 136.0271),\n (98.335275, 136.0271, 96.833713, 136.0271),\n (96.833713, 136.0271, 95.33215, 136.0271),\n (95.33215, 136.0271, 93.830588, 136.0271),\n (93.830588, 136.0271, 92.329025, 136.0271),\n (92.329025, 136.0271, 90.827463, 136.0271),\n (90.827463, 136.0271, 89.3259, 136.0271),\n (89.3259, 136.0271, 87.824338, 136.0271),\n (87.824338, 136.0271, 86.322775, 136.0271),\n (86.322775, 136.0271, 84.821213, 136.0271),\n (84.821213, 136.0271, 83.31965, 136.0271),\n (83.31965, 136.0271, 81.818088, 136.0271),\n (81.818088, 136.0271, 80.316525, 136.0271),\n (80.316525, 136.0271, 78.814963, 136.0271),\n (78.814963, 136.0271, 77.3134, 136.0271),\n (77.3134, 136.0271, 75.811838, 136.0271),\n (75.811838, 136.0271, 74.310275, 136.0271),\n (74.310275, 136.0271, 72.808713, 136.0271),\n (72.808713, 136.0271, 71.30715, 136.0271),\n (71.30715, 136.0271, 69.805588, 136.0271),\n (69.805588, 136.0271, 68.304025, 136.0271),\n (68.304025, 136.0271, 66.802463, 136.0271),\n (66.802463, 136.0271, 65.3009, 136.0271),\n (65.3009, 136.0271, 65.3009, 59.947933),\n (127.3509, 150.0271, 127.3509, 151.528662),\n (127.3509, 151.528662, 127.3509, 153.030225),\n (127.3509, 153.030225, 127.3509, 154.531788),\n (127.3509, 154.531788, 127.3509, 156.03335),\n (127.3509, 156.03335, 127.3509, 157.534912),\n (127.3509, 157.534912, 127.3509, 159.036475),\n (127.3509, 159.036475, 127.3509, 160.538038),\n (127.3509, 160.538038, 127.3509, 162.0396),\n (127.3509, 162.0396, 127.3509, 163.541162),\n (127.3509, 163.541162, 127.3509, 165.042725),\n (127.3509, 165.042725, 127.3509, 166.544287),\n (127.3509, 166.544287, 127.3509, 168.04585),\n (127.3509, 168.04585, 127.3509, 169.547412),\n (127.3509, 169.547412, 127.3509, 171.048975),\n (127.3509, 171.048975, 127.3509, 172.550537),\n (127.3509, 172.550537, 127.3509, 174.0521),\n (127.3509, 174.0521, 127.3509, 175.553663),\n (127.3509, 175.553663, 127.3509, 177.055225),\n (127.3509, 177.055225, 127.3509, 178.556787),\n (127.3509, 178.556787, 127.3509, 180.05835),\n (127.3509, 180.05835, 127.3509, 181.559912),\n (127.3509, 181.559912, 127.3509, 183.061475),\n (127.3509, 183.061475, 127.3509, 184.563037),\n (127.3509, 184.563037, 127.3509, 186.0646),\n (127.3509, 186.0646, 127.3509, 187.566162),\n (127.3509, 187.566162, 127.3509, 189.067725),\n (127.3509, 189.067725, 127.3509, 190.569287),\n (127.3509, 190.569287, 127.3509, 192.07085),\n (127.3509, 192.07085, 127.3509, 193.572412),\n (127.3509, 193.572412, 127.3509, 195.073975),\n (127.3509, 195.073975, 127.3509, 196.575537),\n (127.3509, 196.575537, 127.3509, 198.0771),\n (203.430067, 150.0271, 203.430067, 151.528662),\n (203.430067, 151.528662, 203.430067, 153.030225),\n (203.430067, 153.030225, 203.430067, 154.531788),\n (203.430067, 154.531788, 203.430067, 156.03335),\n (203.430067, 156.03335, 203.430067, 157.534912),\n (203.430067, 157.534912, 203.430067, 159.036475),\n (203.430067, 159.036475, 203.430067, 160.538038),\n (203.430067, 160.538038, 203.430067, 162.0396),\n (203.430067, 162.0396, 203.430067, 163.541162),\n (203.430067, 163.541162, 203.430067, 165.042725),\n (203.430067, 165.042725, 203.430067, 166.544287),\n (203.430067, 166.544287, 203.430067, 168.04585),\n (203.430067, 168.04585, 203.430067, 169.547412),\n (203.430067, 169.547412, 203.430067, 171.048975),\n (203.430067, 171.048975, 203.430067, 172.550537),\n (203.430067, 172.550537, 203.430067, 174.0521),\n (203.430067, 174.0521, 203.430067, 175.553663),\n (203.430067, 175.553663, 203.430067, 177.055225),\n (203.430067, 177.055225, 203.430067, 178.556787),\n (203.430067, 178.556787, 203.430067, 180.05835),\n (203.430067, 180.05835, 203.430067, 181.559912),\n (203.430067, 181.559912, 203.430067, 183.061475),\n (203.430067, 183.061475, 203.430067, 184.563037),\n (203.430067, 184.563037, 203.430067, 186.0646),\n (203.430067, 186.0646, 203.430067, 187.566162),\n (203.430067, 187.566162, 203.430067, 189.067725),\n (203.430067, 189.067725, 203.430067, 190.569287),\n (203.430067, 190.569287, 203.430067, 192.07085),\n (203.430067, 192.07085, 203.430067, 193.572412),\n (203.430067, 193.572412, 203.430067, 195.073975),\n (203.430067, 195.073975, 203.430067, 196.575537),\n (203.430067, 196.575537, 203.430067, 198.0771),\n (203.430067, 150.0271, 127.3509, 150.0271),\n (203.430067, 198.0771, 127.3509, 198.0771)\n]\nVISIBLE_CIRCLES = [\n (89.3259, 174.0521, 24.025),\n (89.3259, 174.0521, 12.513021)\n]\nVISIBLE_ARCS = [\n\n]\nHIDDEN_SEGMENTS = [\n (101.8389, 136.0271, 101.8389, 59.9479),\n (76.8129, 59.9479, 76.8129, 136.0271),\n (203.4301, 186.5651, 127.3509, 186.5651),\n (203.4301, 161.5391, 127.3509, 161.5391)\n]\n# (orient, text, p1, p2, base) for linear; (orient, text, center, radius, angle) for diameter\nDIMENSIONS = [\n ('diameter', '%%c100', (89.3259, 174.0521), 24.025, 45),\n ('diameter', '%%c52.0833', (89.3259, 174.0521), 12.513, 135),\n ('horizontal', '158.333', (127.3509, 174.0521), (203.4301, 174.0521), (165.3905, 185.0521))\n]\n\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\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\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,\n angle=(0 if d[0] == \"horizontal\" else 90),\n 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,\n text=text, dimstyle=\"EZDXF\").render()\n\n doc.saveas(out_path)\n\n\nif __name__ == \"__main__\":\n out = sys.argv[1] if len(sys.argv) > 1 else \"0055_00553974_gt.dxf\"\n draw(out)\n print(\"wrote\", out)\n```"}], "images": ["images/0055_00553974.png"], "id": "0055_00553974"} {"messages": [{"role": "user", "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 91.67 mm. It is extruded to a thickness of 91.35 mm."}, {"role": "assistant", "content": "```python\n#!/usr/bin/env python3\n# -*- coding: utf-8 -*-\n# Ground-truth 2D engineering drawing for part: 0056_00560858\n# Self-contained: reproduces the three-view DXF via ezdxf, NO FreeCAD needed.\n# Coordinates are A4 page millimetres (scale=0.339945578231297, page=[297.0, 210.0]).\n# visible edges -> solid (layer OUTLINE); hidden edges -> dashed (layer HIDDEN)\n# dimensions -> real movable DIMENSION entities (text = true mm value)\n# Run: python 0056_00560858_gt.py [out.dxf]\nimport sys\nimport ezdxf\n\nSCALE = 0.339945578231297\nPAGE = [297.0, 210.0]\n\nVISIBLE_SEGMENTS = [\n (114.299979, 101.5014, 114.299979, 70.448679),\n (80.305421, 70.448679, 81.367751, 70.448679),\n (81.367751, 70.448679, 82.430081, 70.448679),\n (82.430081, 70.448679, 83.492411, 70.448679),\n (83.492411, 70.448679, 84.554741, 70.448679),\n (84.554741, 70.448679, 85.617071, 70.448679),\n (85.617071, 70.448679, 86.679401, 70.448679),\n (86.679401, 70.448679, 87.741731, 70.448679),\n (87.741731, 70.448679, 88.804061, 70.448679),\n (88.804061, 70.448679, 89.86639, 70.448679),\n (89.86639, 70.448679, 90.92872, 70.448679),\n (90.92872, 70.448679, 91.99105, 70.448679),\n (91.99105, 70.448679, 93.05338, 70.448679),\n (93.05338, 70.448679, 94.11571, 70.448679),\n (94.11571, 70.448679, 95.17804, 70.448679),\n (95.17804, 70.448679, 96.24037, 70.448679),\n (96.24037, 70.448679, 97.3027, 70.448679),\n (97.3027, 70.448679, 98.36503, 70.448679),\n (98.36503, 70.448679, 99.42736, 70.448679),\n (99.42736, 70.448679, 100.48969, 70.448679),\n (100.48969, 70.448679, 101.55202, 70.448679),\n (101.55202, 70.448679, 102.61435, 70.448679),\n (102.61435, 70.448679, 103.67668, 70.448679),\n (103.67668, 70.448679, 104.73901, 70.448679),\n (104.73901, 70.448679, 105.801339, 70.448679),\n (105.801339, 70.448679, 106.863669, 70.448679),\n (106.863669, 70.448679, 107.925999, 70.448679),\n (107.925999, 70.448679, 108.988329, 70.448679),\n (108.988329, 70.448679, 110.050659, 70.448679),\n (110.050659, 70.448679, 111.112989, 70.448679),\n (111.112989, 70.448679, 112.175319, 70.448679),\n (112.175319, 70.448679, 113.237649, 70.448679),\n (113.237649, 70.448679, 114.299979, 70.448679),\n (114.299979, 101.5014, 114.299979, 132.554121),\n (80.305421, 132.554121, 81.367751, 132.554121),\n (81.367751, 132.554121, 82.430081, 132.554121),\n (82.430081, 132.554121, 83.492411, 132.554121),\n (83.492411, 132.554121, 84.554741, 132.554121),\n (84.554741, 132.554121, 85.617071, 132.554121),\n (85.617071, 132.554121, 86.679401, 132.554121),\n (86.679401, 132.554121, 87.741731, 132.554121),\n (87.741731, 132.554121, 88.804061, 132.554121),\n (88.804061, 132.554121, 89.86639, 132.554121),\n (89.86639, 132.554121, 90.92872, 132.554121),\n (90.92872, 132.554121, 91.99105, 132.554121),\n (91.99105, 132.554121, 93.05338, 132.554121),\n (93.05338, 132.554121, 94.11571, 132.554121),\n (94.11571, 132.554121, 95.17804, 132.554121),\n (95.17804, 132.554121, 96.24037, 132.554121),\n (96.24037, 132.554121, 97.3027, 132.554121),\n (97.3027, 132.554121, 98.36503, 132.554121),\n (98.36503, 132.554121, 99.42736, 132.554121),\n (99.42736, 132.554121, 100.48969, 132.554121),\n (100.48969, 132.554121, 101.55202, 132.554121),\n (101.55202, 132.554121, 102.61435, 132.554121),\n (102.61435, 132.554121, 103.67668, 132.554121),\n (103.67668, 132.554121, 104.73901, 132.554121),\n (104.73901, 132.554121, 105.801339, 132.554121),\n (105.801339, 132.554121, 106.863669, 132.554121),\n (106.863669, 132.554121, 107.925999, 132.554121),\n (107.925999, 132.554121, 108.988329, 132.554121),\n (108.988329, 132.554121, 110.050659, 132.554121),\n (110.050659, 132.554121, 111.112989, 132.554121),\n (111.112989, 132.554121, 112.175319, 132.554121),\n (112.175319, 132.554121, 113.237649, 132.554121),\n (113.237649, 132.554121, 114.299979, 132.554121),\n (80.305421, 70.448679, 80.305421, 101.5014),\n (80.305421, 132.554121, 80.305421, 101.5014),\n (128.299979, 180.548679, 128.299979, 179.486349),\n (128.299979, 179.486349, 128.299979, 178.424019),\n (128.299979, 178.424019, 128.299979, 177.361689),\n (128.299979, 177.361689, 128.299979, 176.299359),\n (128.299979, 176.299359, 128.299979, 175.237029),\n (128.299979, 175.237029, 128.299979, 174.174699),\n (128.299979, 174.174699, 128.299979, 173.112369),\n (128.299979, 173.112369, 128.299979, 172.050039),\n (128.299979, 172.050039, 128.299979, 170.98771),\n (128.299979, 170.98771, 128.299979, 169.92538),\n (128.299979, 169.92538, 128.299979, 168.86305),\n (128.299979, 168.86305, 128.299979, 167.80072),\n (128.299979, 167.80072, 128.299979, 166.73839),\n (128.299979, 166.73839, 128.299979, 165.67606),\n (128.299979, 165.67606, 128.299979, 164.61373),\n (128.299979, 164.61373, 128.299979, 163.5514),\n (128.299979, 163.5514, 128.299979, 162.48907),\n (128.299979, 162.48907, 128.299979, 161.42674),\n (128.299979, 161.42674, 128.299979, 160.36441),\n (128.299979, 160.36441, 128.299979, 159.30208),\n (128.299979, 159.30208, 128.299979, 158.23975),\n (128.299979, 158.23975, 128.299979, 157.17742),\n (128.299979, 157.17742, 128.299979, 156.11509),\n (128.299979, 156.11509, 128.299979, 155.052761),\n (128.299979, 155.052761, 128.299979, 153.990431),\n (128.299979, 153.990431, 128.299979, 152.928101),\n (128.299979, 152.928101, 128.299979, 151.865771),\n (128.299979, 151.865771, 128.299979, 150.803441),\n (128.299979, 150.803441, 128.299979, 149.741111),\n (128.299979, 149.741111, 128.299979, 148.678781),\n (128.299979, 148.678781, 128.299979, 147.616451),\n (128.299979, 147.616451, 128.299979, 146.554121),\n (190.405421, 180.548679, 190.405421, 179.486349),\n (190.405421, 179.486349, 190.405421, 178.424019),\n (190.405421, 178.424019, 190.405421, 177.361689),\n (190.405421, 177.361689, 190.405421, 176.299359),\n (190.405421, 176.299359, 190.405421, 175.237029),\n (190.405421, 175.237029, 190.405421, 174.174699),\n (190.405421, 174.174699, 190.405421, 173.112369),\n (190.405421, 173.112369, 190.405421, 172.050039),\n (190.405421, 172.050039, 190.405421, 170.98771),\n (190.405421, 170.98771, 190.405421, 169.92538),\n (190.405421, 169.92538, 190.405421, 168.86305),\n (190.405421, 168.86305, 190.405421, 167.80072),\n (190.405421, 167.80072, 190.405421, 166.73839),\n (190.405421, 166.73839, 190.405421, 165.67606),\n (190.405421, 165.67606, 190.405421, 164.61373),\n (190.405421, 164.61373, 190.405421, 163.5514),\n (190.405421, 163.5514, 190.405421, 162.48907),\n (190.405421, 162.48907, 190.405421, 161.42674),\n (190.405421, 161.42674, 190.405421, 160.36441),\n (190.405421, 160.36441, 190.405421, 159.30208),\n (190.405421, 159.30208, 190.405421, 158.23975),\n (190.405421, 158.23975, 190.405421, 157.17742),\n (190.405421, 157.17742, 190.405421, 156.11509),\n (190.405421, 156.11509, 190.405421, 155.052761),\n (190.405421, 155.052761, 190.405421, 153.990431),\n (190.405421, 153.990431, 190.405421, 152.928101),\n (190.405421, 152.928101, 190.405421, 151.865771),\n (190.405421, 151.865771, 190.405421, 150.803441),\n (190.405421, 150.803441, 190.405421, 149.741111),\n (190.405421, 149.741111, 190.405421, 148.678781),\n (190.405421, 148.678781, 190.405421, 147.616451),\n (190.405421, 147.616451, 190.405421, 146.554121),\n (128.299979, 180.548679, 159.3527, 180.548679),\n (128.299979, 146.554121, 159.3527, 146.554121),\n (190.405421, 146.554121, 159.3527, 146.554121),\n (190.405421, 180.548679, 159.3527, 180.548679)\n]\nVISIBLE_CIRCLES = [\n (97.3027, 163.5514, 16.997279),\n (97.3027, 163.5514, 15.580839)\n]\nVISIBLE_ARCS = [\n\n]\nHIDDEN_SEGMENTS = [\n (112.8836, 101.5014, 112.8836, 132.5541),\n (112.8836, 101.5014, 112.8836, 70.4486),\n (81.7219, 132.5541, 81.7219, 101.5014),\n (81.7219, 70.4486, 81.7219, 101.5014),\n (128.3, 147.9705, 159.3527, 147.9705),\n (128.3, 179.1322, 159.3527, 179.1322),\n (190.4055, 179.1322, 159.3527, 179.1322),\n (190.4055, 147.9705, 159.3527, 147.9705)\n]\n# (orient, text, p1, p2, base) for linear; (orient, text, center, radius, angle) for diameter\nDIMENSIONS = [\n ('diameter', '%%c100', (97.3027, 163.5514), 16.9973, 45),\n ('diameter', '%%c91.6667', (97.3027, 163.5514), 15.5808, 135),\n ('horizontal', '182.692', (190.4055, 163.5514), (128.3, 163.5514), (159.3527, 152.5514))\n]\n\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\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\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,\n angle=(0 if d[0] == \"horizontal\" else 90),\n 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,\n text=text, dimstyle=\"EZDXF\").render()\n\n doc.saveas(out_path)\n\n\nif __name__ == \"__main__\":\n out = sys.argv[1] if len(sys.argv) > 1 else \"0056_00560858_gt.dxf\"\n draw(out)\n print(\"wrote\", out)\n```"}], "images": ["images/0056_00560858.png"], "id": "0056_00560858"} {"messages": [{"role": "user", "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": "assistant", "content": "```python\n#!/usr/bin/env python3\n# -*- coding: utf-8 -*-\n# Ground-truth 2D engineering drawing for part: 0056_00562853\n# Self-contained: reproduces the three-view DXF via ezdxf, NO FreeCAD needed.\n# Coordinates are A4 page millimetres (scale=0.7274306085643575, page=[297.0, 210.0]).\n# visible edges -> solid (layer OUTLINE); hidden edges -> dashed (layer HIDDEN)\n# dimensions -> real movable DIMENSION entities (text = true mm value)\n# Run: python 0056_00562853_gt.py [out.dxf]\nimport sys\nimport ezdxf\n\nSCALE = 0.7274306085643575\nPAGE = [297.0, 210.0]\n\nVISIBLE_SEGMENTS = [\n (148.81123, 80.13573, 146.53801, 80.13573),\n (146.53801, 80.13573, 144.264789, 80.13573),\n (144.264789, 80.13573, 141.991568, 80.13573),\n (141.991568, 80.13573, 139.718348, 80.13573),\n (139.718348, 80.13573, 137.445127, 80.13573),\n (137.445127, 80.13573, 135.171907, 80.13573),\n (135.171907, 80.13573, 132.898686, 80.13573),\n (132.898686, 80.13573, 130.625465, 80.13573),\n (130.625465, 80.13573, 128.352245, 80.13573),\n (128.352245, 80.13573, 126.079024, 80.13573),\n (126.079024, 80.13573, 123.805803, 80.13573),\n (123.805803, 80.13573, 121.532583, 80.13573),\n (121.532583, 80.13573, 119.259362, 80.13573),\n (119.259362, 80.13573, 116.986141, 80.13573),\n (116.986141, 80.13573, 114.712921, 80.13573),\n (114.712921, 80.13573, 112.4397, 80.13573),\n (112.4397, 80.13573, 110.166479, 80.13573),\n (110.166479, 80.13573, 107.893259, 80.13573),\n (107.893259, 80.13573, 105.620038, 80.13573),\n (105.620038, 80.13573, 103.346817, 80.13573),\n (103.346817, 80.13573, 101.073597, 80.13573),\n (101.073597, 80.13573, 98.800376, 80.13573),\n (98.800376, 80.13573, 96.527155, 80.13573),\n (96.527155, 80.13573, 94.253935, 80.13573),\n (94.253935, 80.13573, 91.980714, 80.13573),\n (91.980714, 80.13573, 89.707493, 80.13573),\n (89.707493, 80.13573, 87.434273, 80.13573),\n (87.434273, 80.13573, 85.161052, 80.13573),\n (85.161052, 80.13573, 82.887832, 80.13573),\n (82.887832, 80.13573, 80.614611, 80.13573),\n (80.614611, 80.13573, 78.34139, 80.13573),\n (78.34139, 80.13573, 76.06817, 80.13573),\n (148.81123, 80.13573, 148.81123, 103.492669),\n (148.81123, 103.492669, 146.53801, 103.492669),\n (146.53801, 103.492669, 144.264789, 103.492669),\n (144.264789, 103.492669, 141.991568, 103.492669),\n (141.991568, 103.492669, 139.718348, 103.492669),\n (139.718348, 103.492669, 137.445127, 103.492669),\n (137.445127, 103.492669, 135.171907, 103.492669),\n (135.171907, 103.492669, 132.898686, 103.492669),\n (132.898686, 103.492669, 130.625465, 103.492669),\n (130.625465, 103.492669, 128.352245, 103.492669),\n (128.352245, 103.492669, 126.079024, 103.492669),\n (126.079024, 103.492669, 123.805803, 103.492669),\n (123.805803, 103.492669, 121.532583, 103.492669),\n (121.532583, 103.492669, 119.259362, 103.492669),\n (119.259362, 103.492669, 116.986141, 103.492669),\n (116.986141, 103.492669, 114.712921, 103.492669),\n (114.712921, 103.492669, 112.4397, 103.492669),\n (112.4397, 103.492669, 110.166479, 103.492669),\n (110.166479, 103.492669, 107.893259, 103.492669),\n (107.893259, 103.492669, 105.620038, 103.492669),\n (105.620038, 103.492669, 103.346817, 103.492669),\n (103.346817, 103.492669, 101.073597, 103.492669),\n (101.073597, 103.492669, 98.800376, 103.492669),\n (98.800376, 103.492669, 96.527155, 103.492669),\n (96.527155, 103.492669, 94.253935, 103.492669),\n (94.253935, 103.492669, 91.980714, 103.492669),\n (91.980714, 103.492669, 89.707493, 103.492669),\n (89.707493, 103.492669, 87.434273, 103.492669),\n (87.434273, 103.492669, 85.161052, 103.492669),\n (85.161052, 103.492669, 82.887832, 103.492669),\n (82.887832, 103.492669, 80.614611, 103.492669),\n (80.614611, 103.492669, 78.34139, 103.492669),\n (78.34139, 103.492669, 76.06817, 103.492669),\n (76.06817, 103.492669, 76.06817, 80.13573),\n (162.811231, 117.49267, 162.811231, 119.76589),\n (162.811231, 119.76589, 162.811231, 122.039111),\n (162.811231, 122.039111, 162.811231, 124.312332),\n (162.811231, 124.312332, 162.811231, 126.585552),\n (162.811231, 126.585552, 162.811231, 128.858773),\n (162.811231, 128.858773, 162.811231, 131.131993),\n (162.811231, 131.131993, 162.811231, 133.405214),\n (162.811231, 133.405214, 162.811231, 135.678435),\n (162.811231, 135.678435, 162.811231, 137.951655),\n (162.811231, 137.951655, 162.811231, 140.224876),\n (162.811231, 140.224876, 162.811231, 142.498097),\n (162.811231, 142.498097, 162.811231, 144.771317),\n (162.811231, 144.771317, 162.811231, 147.044538),\n (162.811231, 147.044538, 162.811231, 149.317759),\n (162.811231, 149.317759, 162.811231, 151.590979),\n (162.811231, 151.590979, 162.811231, 153.8642),\n (162.811231, 153.8642, 162.811231, 156.137421),\n (162.811231, 156.137421, 162.811231, 158.410641),\n (162.811231, 158.410641, 162.811231, 160.683862),\n (162.811231, 160.683862, 162.811231, 162.957083),\n (162.811231, 162.957083, 162.811231, 165.230303),\n (162.811231, 165.230303, 162.811231, 167.503524),\n (162.811231, 167.503524, 162.811231, 169.776745),\n (162.811231, 169.776745, 162.811231, 172.049965),\n (162.811231, 172.049965, 162.811231, 174.323186),\n (162.811231, 174.323186, 162.811231, 176.596407),\n (162.811231, 176.596407, 162.811231, 178.869627),\n (162.811231, 178.869627, 162.811231, 181.142848),\n (162.811231, 181.142848, 162.811231, 183.416068),\n (162.811231, 183.416068, 162.811231, 185.689289),\n (162.811231, 185.689289, 162.811231, 187.96251),\n (162.811231, 187.96251, 162.811231, 190.23573),\n (186.16817, 117.49267, 186.16817, 119.76589),\n (186.16817, 119.76589, 186.16817, 122.039111),\n (186.16817, 122.039111, 186.16817, 124.312332),\n (186.16817, 124.312332, 186.16817, 126.585552),\n (186.16817, 126.585552, 186.16817, 128.858773),\n (186.16817, 128.858773, 186.16817, 131.131993),\n (186.16817, 131.131993, 186.16817, 133.405214),\n (186.16817, 133.405214, 186.16817, 135.678435),\n (186.16817, 135.678435, 186.16817, 137.951655),\n (186.16817, 137.951655, 186.16817, 140.224876),\n (186.16817, 140.224876, 186.16817, 142.498097),\n (186.16817, 142.498097, 186.16817, 144.771317),\n (186.16817, 144.771317, 186.16817, 147.044538),\n (186.16817, 147.044538, 186.16817, 149.317759),\n (186.16817, 149.317759, 186.16817, 151.590979),\n (186.16817, 151.590979, 186.16817, 153.8642),\n (186.16817, 153.8642, 186.16817, 156.137421),\n (186.16817, 156.137421, 186.16817, 158.410641),\n (186.16817, 158.410641, 186.16817, 160.683862),\n (186.16817, 160.683862, 186.16817, 162.957083),\n (186.16817, 162.957083, 186.16817, 165.230303),\n (186.16817, 165.230303, 186.16817, 167.503524),\n (186.16817, 167.503524, 186.16817, 169.776745),\n (186.16817, 169.776745, 186.16817, 172.049965),\n (186.16817, 172.049965, 186.16817, 174.323186),\n (186.16817, 174.323186, 186.16817, 176.596407),\n (186.16817, 176.596407, 186.16817, 178.869627),\n (186.16817, 178.869627, 186.16817, 181.142848),\n (186.16817, 181.142848, 186.16817, 183.416068),\n (186.16817, 183.416068, 186.16817, 185.689289),\n (186.16817, 185.689289, 186.16817, 187.96251),\n (186.16817, 187.96251, 186.16817, 190.23573),\n (186.16817, 117.49267, 162.811231, 117.49267),\n (186.16817, 190.23573, 162.811231, 190.23573)\n]\nVISIBLE_CIRCLES = [\n (112.4397, 153.8642, 36.37153),\n (112.4397, 153.8642, 13.15566)\n]\nVISIBLE_ARCS = [\n\n]\nHIDDEN_SEGMENTS = [\n (125.5954, 103.4927, 125.5954, 80.1358),\n (99.2841, 80.1358, 99.2841, 103.4927),\n (186.1682, 167.0199, 162.8113, 167.0199),\n (186.1682, 140.7086, 162.8113, 140.7086)\n]\n# (orient, text, p1, p2, base) for linear; (orient, text, center, radius, angle) for diameter\nDIMENSIONS = [\n ('diameter', '%%c100', (112.4397, 153.8642), 36.3715, 45),\n ('diameter', '%%c36.1702', (112.4397, 153.8642), 13.1557, 135),\n ('horizontal', '32.1088', (162.8113, 153.8642), (186.1682, 153.8642), (174.4897, 164.8642))\n]\n\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\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\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,\n angle=(0 if d[0] == \"horizontal\" else 90),\n 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,\n text=text, dimstyle=\"EZDXF\").render()\n\n doc.saveas(out_path)\n\n\nif __name__ == \"__main__\":\n out = sys.argv[1] if len(sys.argv) > 1 else \"0056_00562853_gt.dxf\"\n draw(out)\n print(\"wrote\", out)\n```"}], "images": ["images/0056_00562853.png"], "id": "0056_00562853"} {"messages": [{"role": "user", "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 82.98 mm. It is extruded to a thickness of 1386.02 mm."}, {"role": "assistant", "content": "```python\n#!/usr/bin/env python3\n# -*- coding: utf-8 -*-\n# Ground-truth 2D engineering drawing for part: 0056_00564999\n# Self-contained: reproduces the three-view DXF via ezdxf, NO FreeCAD needed.\n# Coordinates are A4 page millimetres (scale=0.06466946205768341, page=[297.0, 210.0]).\n# visible edges -> solid (layer OUTLINE); hidden edges -> dashed (layer HIDDEN)\n# dimensions -> real movable DIMENSION entities (text = true mm value)\n# Run: python 0056_00564999_gt.py [out.dxf]\nimport sys\nimport ezdxf\n\nSCALE = 0.06466946205768341\nPAGE = [297.0, 210.0]\n\nVISIBLE_SEGMENTS = [\n (93.437773, 63.566773, 93.235681, 63.566773),\n (93.235681, 63.566773, 93.033589, 63.566773),\n (93.033589, 63.566773, 92.831497, 63.566773),\n (92.831497, 63.566773, 92.629405, 63.566773),\n (92.629405, 63.566773, 92.427313, 63.566773),\n (92.427313, 63.566773, 92.225221, 63.566773),\n (92.225221, 63.566773, 92.023129, 63.566773),\n (92.023129, 63.566773, 91.821037, 63.566773),\n (91.821037, 63.566773, 91.618944, 63.566773),\n (91.618944, 63.566773, 91.416852, 63.566773),\n (91.416852, 63.566773, 91.21476, 63.566773),\n (91.21476, 63.566773, 91.012668, 63.566773),\n (91.012668, 63.566773, 90.810576, 63.566773),\n (90.810576, 63.566773, 90.608484, 63.566773),\n (90.608484, 63.566773, 90.406392, 63.566773),\n (90.406392, 63.566773, 90.2043, 63.566773),\n (90.2043, 63.566773, 90.002208, 63.566773),\n (90.002208, 63.566773, 89.800116, 63.566773),\n (89.800116, 63.566773, 89.598024, 63.566773),\n (89.598024, 63.566773, 89.395932, 63.566773),\n (89.395932, 63.566773, 89.19384, 63.566773),\n (89.19384, 63.566773, 88.991748, 63.566773),\n (88.991748, 63.566773, 88.789656, 63.566773),\n (88.789656, 63.566773, 88.587563, 63.566773),\n (88.587563, 63.566773, 88.385471, 63.566773),\n (88.385471, 63.566773, 88.183379, 63.566773),\n (88.183379, 63.566773, 87.981287, 63.566773),\n (87.981287, 63.566773, 87.779195, 63.566773),\n (87.779195, 63.566773, 87.577103, 63.566773),\n (87.577103, 63.566773, 87.375011, 63.566773),\n (87.375011, 63.566773, 87.172919, 63.566773),\n (87.172919, 63.566773, 86.970827, 63.566773),\n (93.437773, 63.566773, 93.437773, 153.199827),\n (93.437773, 153.199827, 93.235681, 153.199827),\n (93.235681, 153.199827, 93.033589, 153.199827),\n (93.033589, 153.199827, 92.831497, 153.199827),\n (92.831497, 153.199827, 92.629405, 153.199827),\n (92.629405, 153.199827, 92.427313, 153.199827),\n (92.427313, 153.199827, 92.225221, 153.199827),\n (92.225221, 153.199827, 92.023129, 153.199827),\n (92.023129, 153.199827, 91.821037, 153.199827),\n (91.821037, 153.199827, 91.618944, 153.199827),\n (91.618944, 153.199827, 91.416852, 153.199827),\n (91.416852, 153.199827, 91.21476, 153.199827),\n (91.21476, 153.199827, 91.012668, 153.199827),\n (91.012668, 153.199827, 90.810576, 153.199827),\n (90.810576, 153.199827, 90.608484, 153.199827),\n (90.608484, 153.199827, 90.406392, 153.199827),\n (90.406392, 153.199827, 90.2043, 153.199827),\n (90.2043, 153.199827, 90.002208, 153.199827),\n (90.002208, 153.199827, 89.800116, 153.199827),\n (89.800116, 153.199827, 89.598024, 153.199827),\n (89.598024, 153.199827, 89.395932, 153.199827),\n (89.395932, 153.199827, 89.19384, 153.199827),\n (89.19384, 153.199827, 88.991748, 153.199827),\n (88.991748, 153.199827, 88.789656, 153.199827),\n (88.789656, 153.199827, 88.587563, 153.199827),\n (88.587563, 153.199827, 88.385471, 153.199827),\n (88.385471, 153.199827, 88.183379, 153.199827),\n (88.183379, 153.199827, 87.981287, 153.199827),\n (87.981287, 153.199827, 87.779195, 153.199827),\n (87.779195, 153.199827, 87.577103, 153.199827),\n (87.577103, 153.199827, 87.375011, 153.199827),\n (87.375011, 153.199827, 87.172919, 153.199827),\n (87.172919, 153.199827, 86.970827, 153.199827),\n (86.970827, 153.199827, 86.970827, 63.566773),\n (107.437773, 167.199827, 107.437773, 167.401919),\n (107.437773, 167.401919, 107.437773, 167.604011),\n (107.437773, 167.604011, 107.437773, 167.806103),\n (107.437773, 167.806103, 107.437773, 168.008195),\n (107.437773, 168.008195, 107.437773, 168.210287),\n (107.437773, 168.210287, 107.437773, 168.412379),\n (107.437773, 168.412379, 107.437773, 168.614471),\n (107.437773, 168.614471, 107.437773, 168.816563),\n (107.437773, 168.816563, 107.437773, 169.018656),\n (107.437773, 169.018656, 107.437773, 169.220748),\n (107.437773, 169.220748, 107.437773, 169.42284),\n (107.437773, 169.42284, 107.437773, 169.624932),\n (107.437773, 169.624932, 107.437773, 169.827024),\n (107.437773, 169.827024, 107.437773, 170.029116),\n (107.437773, 170.029116, 107.437773, 170.231208),\n (107.437773, 170.231208, 107.437773, 170.4333),\n (107.437773, 170.4333, 107.437773, 170.635392),\n (107.437773, 170.635392, 107.437773, 170.837484),\n (107.437773, 170.837484, 107.437773, 171.039576),\n (107.437773, 171.039576, 107.437773, 171.241668),\n (107.437773, 171.241668, 107.437773, 171.44376),\n (107.437773, 171.44376, 107.437773, 171.645852),\n (107.437773, 171.645852, 107.437773, 171.847944),\n (107.437773, 171.847944, 107.437773, 172.050037),\n (107.437773, 172.050037, 107.437773, 172.252129),\n (107.437773, 172.252129, 107.437773, 172.454221),\n (107.437773, 172.454221, 107.437773, 172.656313),\n (107.437773, 172.656313, 107.437773, 172.858405),\n (107.437773, 172.858405, 107.437773, 173.060497),\n (107.437773, 173.060497, 107.437773, 173.262589),\n (107.437773, 173.262589, 107.437773, 173.464681),\n (107.437773, 173.464681, 107.437773, 173.666773),\n (197.070827, 167.199827, 197.070827, 167.401919),\n (197.070827, 167.401919, 197.070827, 167.604011),\n (197.070827, 167.604011, 197.070827, 167.806103),\n (197.070827, 167.806103, 197.070827, 168.008195),\n (197.070827, 168.008195, 197.070827, 168.210287),\n (197.070827, 168.210287, 197.070827, 168.412379),\n (197.070827, 168.412379, 197.070827, 168.614471),\n (197.070827, 168.614471, 197.070827, 168.816563),\n (197.070827, 168.816563, 197.070827, 169.018656),\n (197.070827, 169.018656, 197.070827, 169.220748),\n (197.070827, 169.220748, 197.070827, 169.42284),\n (197.070827, 169.42284, 197.070827, 169.624932),\n (197.070827, 169.624932, 197.070827, 169.827024),\n (197.070827, 169.827024, 197.070827, 170.029116),\n (197.070827, 170.029116, 197.070827, 170.231208),\n (197.070827, 170.231208, 197.070827, 170.4333),\n (197.070827, 170.4333, 197.070827, 170.635392),\n (197.070827, 170.635392, 197.070827, 170.837484),\n (197.070827, 170.837484, 197.070827, 171.039576),\n (197.070827, 171.039576, 197.070827, 171.241668),\n (197.070827, 171.241668, 197.070827, 171.44376),\n (197.070827, 171.44376, 197.070827, 171.645852),\n (197.070827, 171.645852, 197.070827, 171.847944),\n (197.070827, 171.847944, 197.070827, 172.050037),\n (197.070827, 172.050037, 197.070827, 172.252129),\n (197.070827, 172.252129, 197.070827, 172.454221),\n (197.070827, 172.454221, 197.070827, 172.656313),\n (197.070827, 172.656313, 197.070827, 172.858405),\n (197.070827, 172.858405, 197.070827, 173.060497),\n (197.070827, 173.060497, 197.070827, 173.262589),\n (197.070827, 173.262589, 197.070827, 173.464681),\n (197.070827, 173.464681, 197.070827, 173.666773),\n (197.070827, 167.199827, 107.437773, 167.199827),\n (197.070827, 173.666773, 107.437773, 173.666773)\n]\nVISIBLE_CIRCLES = [\n (90.2043, 170.4333, 3.233473),\n (90.2043, 170.4333, 2.683095)\n]\nVISIBLE_ARCS = [\n\n]\nHIDDEN_SEGMENTS = [\n (92.8874, 153.1998, 92.8874, 63.5667),\n (87.5212, 63.5667, 87.5212, 153.1998),\n (197.0709, 173.1164, 107.4378, 173.1164),\n (197.0709, 167.7502, 107.4378, 167.7502)\n]\n# (orient, text, p1, p2, base) for linear; (orient, text, center, radius, angle) for diameter\nDIMENSIONS = [\n ('diameter', '%%c100', (90.2043, 170.4333), 3.2335, 45),\n ('diameter', '%%c82.9787', (90.2043, 170.4333), 2.6831, 135),\n ('horizontal', '1386.02', (107.4378, 170.4333), (197.0709, 170.4333), (152.2543, 181.4333))\n]\n\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\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\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,\n angle=(0 if d[0] == \"horizontal\" else 90),\n 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,\n text=text, dimstyle=\"EZDXF\").render()\n\n doc.saveas(out_path)\n\n\nif __name__ == \"__main__\":\n out = sys.argv[1] if len(sys.argv) > 1 else \"0056_00564999_gt.dxf\"\n draw(out)\n print(\"wrote\", out)\n```"}], "images": ["images/0056_00564999.png"], "id": "0056_00564999"} {"messages": [{"role": "user", "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 58.33 mm. It is extruded to a thickness of 169.64 mm."}, {"role": "assistant", "content": "```python\n#!/usr/bin/env python3\n# -*- coding: utf-8 -*-\n# Ground-truth 2D engineering drawing for part: 0057_00577273\n# Self-contained: reproduces the three-view DXF via ezdxf, NO FreeCAD needed.\n# Coordinates are A4 page millimetres (scale=0.35639735099338693, page=[297.0, 210.0]).\n# visible edges -> solid (layer OUTLINE); hidden edges -> dashed (layer HIDDEN)\n# dimensions -> real movable DIMENSION entities (text = true mm value)\n# Run: python 0057_00577273_gt.py [out.dxf]\nimport sys\nimport ezdxf\n\nSCALE = 0.35639735099338693\nPAGE = [297.0, 210.0]\n\nVISIBLE_SEGMENTS = [\n (117.036068, 70.859967, 115.922326, 70.859967),\n (115.922326, 70.859967, 114.808584, 70.859967),\n (114.808584, 70.859967, 113.694842, 70.859967),\n (113.694842, 70.859967, 112.581101, 70.859967),\n (112.581101, 70.859967, 111.467359, 70.859967),\n (111.467359, 70.859967, 110.353617, 70.859967),\n (110.353617, 70.859967, 109.239875, 70.859967),\n (109.239875, 70.859967, 108.126134, 70.859967),\n (108.126134, 70.859967, 107.012392, 70.859967),\n (107.012392, 70.859967, 105.89865, 70.859967),\n (105.89865, 70.859967, 104.784909, 70.859967),\n (104.784909, 70.859967, 103.671167, 70.859967),\n (103.671167, 70.859967, 102.557425, 70.859967),\n (102.557425, 70.859967, 101.443683, 70.859967),\n (101.443683, 70.859967, 100.329942, 70.859967),\n (100.329942, 70.859967, 99.2162, 70.859967),\n (99.2162, 70.859967, 98.102458, 70.859967),\n (98.102458, 70.859967, 96.988717, 70.859967),\n (96.988717, 70.859967, 95.874975, 70.859967),\n (95.874975, 70.859967, 94.761233, 70.859967),\n (94.761233, 70.859967, 93.647491, 70.859967),\n (93.647491, 70.859967, 92.53375, 70.859967),\n (92.53375, 70.859967, 91.420008, 70.859967),\n (91.420008, 70.859967, 90.306266, 70.859967),\n (90.306266, 70.859967, 89.192525, 70.859967),\n (89.192525, 70.859967, 88.078783, 70.859967),\n (88.078783, 70.859967, 86.965041, 70.859967),\n (86.965041, 70.859967, 85.851299, 70.859967),\n (85.851299, 70.859967, 84.737558, 70.859967),\n (84.737558, 70.859967, 83.623816, 70.859967),\n (83.623816, 70.859967, 82.510074, 70.859967),\n (82.510074, 70.859967, 81.396332, 70.859967),\n (117.036068, 70.859967, 117.036068, 131.320232),\n (117.036068, 131.320232, 115.922326, 131.320232),\n (115.922326, 131.320232, 114.808584, 131.320232),\n (114.808584, 131.320232, 113.694842, 131.320232),\n (113.694842, 131.320232, 112.581101, 131.320232),\n (112.581101, 131.320232, 111.467359, 131.320232),\n (111.467359, 131.320232, 110.353617, 131.320232),\n (110.353617, 131.320232, 109.239875, 131.320232),\n (109.239875, 131.320232, 108.126134, 131.320232),\n (108.126134, 131.320232, 107.012392, 131.320232),\n (107.012392, 131.320232, 105.89865, 131.320232),\n (105.89865, 131.320232, 104.784909, 131.320232),\n (104.784909, 131.320232, 103.671167, 131.320232),\n (103.671167, 131.320232, 102.557425, 131.320232),\n (102.557425, 131.320232, 101.443683, 131.320232),\n (101.443683, 131.320232, 100.329942, 131.320232),\n (100.329942, 131.320232, 99.2162, 131.320232),\n (99.2162, 131.320232, 98.102458, 131.320232),\n (98.102458, 131.320232, 96.988717, 131.320232),\n (96.988717, 131.320232, 95.874975, 131.320232),\n (95.874975, 131.320232, 94.761233, 131.320232),\n (94.761233, 131.320232, 93.647491, 131.320232),\n (93.647491, 131.320232, 92.53375, 131.320232),\n (92.53375, 131.320232, 91.420008, 131.320232),\n (91.420008, 131.320232, 90.306266, 131.320232),\n (90.306266, 131.320232, 89.192525, 131.320232),\n (89.192525, 131.320232, 88.078783, 131.320232),\n (88.078783, 131.320232, 86.965041, 131.320232),\n (86.965041, 131.320232, 85.851299, 131.320232),\n (85.851299, 131.320232, 84.737558, 131.320232),\n (84.737558, 131.320232, 83.623816, 131.320232),\n (83.623816, 131.320232, 82.510074, 131.320232),\n (82.510074, 131.320232, 81.396332, 131.320232),\n (81.396332, 131.320232, 81.396332, 70.859967),\n (131.036068, 145.320232, 131.036068, 146.433974),\n (131.036068, 146.433974, 131.036068, 147.547716),\n (131.036068, 147.547716, 131.036068, 148.661458),\n (131.036068, 148.661458, 131.036068, 149.775199),\n (131.036068, 149.775199, 131.036068, 150.888941),\n (131.036068, 150.888941, 131.036068, 152.002683),\n (131.036068, 152.002683, 131.036068, 153.116425),\n (131.036068, 153.116425, 131.036068, 154.230166),\n (131.036068, 154.230166, 131.036068, 155.343908),\n (131.036068, 155.343908, 131.036068, 156.45765),\n (131.036068, 156.45765, 131.036068, 157.571391),\n (131.036068, 157.571391, 131.036068, 158.685133),\n (131.036068, 158.685133, 131.036068, 159.798875),\n (131.036068, 159.798875, 131.036068, 160.912617),\n (131.036068, 160.912617, 131.036068, 162.026358),\n (131.036068, 162.026358, 131.036068, 163.1401),\n (131.036068, 163.1401, 131.036068, 164.253842),\n (131.036068, 164.253842, 131.036068, 165.367583),\n (131.036068, 165.367583, 131.036068, 166.481325),\n (131.036068, 166.481325, 131.036068, 167.595067),\n (131.036068, 167.595067, 131.036068, 168.708809),\n (131.036068, 168.708809, 131.036068, 169.82255),\n (131.036068, 169.82255, 131.036068, 170.936292),\n (131.036068, 170.936292, 131.036068, 172.050034),\n (131.036068, 172.050034, 131.036068, 173.163775),\n (131.036068, 173.163775, 131.036068, 174.277517),\n (131.036068, 174.277517, 131.036068, 175.391259),\n (131.036068, 175.391259, 131.036068, 176.505001),\n (131.036068, 176.505001, 131.036068, 177.618742),\n (131.036068, 177.618742, 131.036068, 178.732484),\n (131.036068, 178.732484, 131.036068, 179.846226),\n (131.036068, 179.846226, 131.036068, 180.959968),\n (191.496333, 145.320232, 191.496333, 146.433974),\n (191.496333, 146.433974, 191.496333, 147.547716),\n (191.496333, 147.547716, 191.496333, 148.661458),\n (191.496333, 148.661458, 191.496333, 149.775199),\n (191.496333, 149.775199, 191.496333, 150.888941),\n (191.496333, 150.888941, 191.496333, 152.002683),\n (191.496333, 152.002683, 191.496333, 153.116425),\n (191.496333, 153.116425, 191.496333, 154.230166),\n (191.496333, 154.230166, 191.496333, 155.343908),\n (191.496333, 155.343908, 191.496333, 156.45765),\n (191.496333, 156.45765, 191.496333, 157.571391),\n (191.496333, 157.571391, 191.496333, 158.685133),\n (191.496333, 158.685133, 191.496333, 159.798875),\n (191.496333, 159.798875, 191.496333, 160.912617),\n (191.496333, 160.912617, 191.496333, 162.026358),\n (191.496333, 162.026358, 191.496333, 163.1401),\n (191.496333, 163.1401, 191.496333, 164.253842),\n (191.496333, 164.253842, 191.496333, 165.367583),\n (191.496333, 165.367583, 191.496333, 166.481325),\n (191.496333, 166.481325, 191.496333, 167.595067),\n (191.496333, 167.595067, 191.496333, 168.708809),\n (191.496333, 168.708809, 191.496333, 169.82255),\n (191.496333, 169.82255, 191.496333, 170.936292),\n (191.496333, 170.936292, 191.496333, 172.050034),\n (191.496333, 172.050034, 191.496333, 173.163775),\n (191.496333, 173.163775, 191.496333, 174.277517),\n (191.496333, 174.277517, 191.496333, 175.391259),\n (191.496333, 175.391259, 191.496333, 176.505001),\n (191.496333, 176.505001, 191.496333, 177.618742),\n (191.496333, 177.618742, 191.496333, 178.732484),\n (191.496333, 178.732484, 191.496333, 179.846226),\n (191.496333, 179.846226, 191.496333, 180.959968),\n (191.496333, 145.320232, 131.036068, 145.320232),\n (191.496333, 180.959968, 131.036068, 180.959968)\n]\nVISIBLE_CIRCLES = [\n (99.2162, 163.1401, 17.819868),\n (99.2162, 163.1401, 10.394923)\n]\nVISIBLE_ARCS = [\n\n]\nHIDDEN_SEGMENTS = [\n (109.6111, 131.3202, 109.6111, 70.8599),\n (88.8212, 70.8599, 88.8212, 131.3202),\n (191.4963, 173.535, 131.036, 173.535),\n (191.4963, 152.7451, 131.036, 152.7451)\n]\n# (orient, text, p1, p2, base) for linear; (orient, text, center, radius, angle) for diameter\nDIMENSIONS = [\n ('diameter', '%%c100', (99.2162, 163.1401), 17.8199, 45),\n ('diameter', '%%c58.3333', (99.2162, 163.1401), 10.3949, 135),\n ('horizontal', '169.643', (131.036, 163.1401), (191.4963, 163.1401), (161.2662, 174.1401))\n]\n\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\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\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,\n angle=(0 if d[0] == \"horizontal\" else 90),\n 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,\n text=text, dimstyle=\"EZDXF\").render()\n\n doc.saveas(out_path)\n\n\nif __name__ == \"__main__\":\n out = sys.argv[1] if len(sys.argv) > 1 else \"0057_00577273_gt.dxf\"\n draw(out)\n print(\"wrote\", out)\n```"}], "images": ["images/0057_00577273.png"], "id": "0057_00577273"} {"messages": [{"role": "user", "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 12.37 mm."}, {"role": "assistant", "content": "```python\n#!/usr/bin/env python3\n# -*- coding: utf-8 -*-\n# Ground-truth 2D engineering drawing for part: 0058_00582953\n# Self-contained: reproduces the three-view DXF via ezdxf, NO FreeCAD needed.\n# Coordinates are A4 page millimetres (scale=0.7347, page=[297.0, 210.0]).\n# visible edges -> solid (layer OUTLINE); hidden edges -> dashed (layer HIDDEN)\n# dimensions -> real movable DIMENSION entities (text = true mm value)\n# Run: python 0058_00582953_gt.py [out.dxf]\nimport sys\nimport ezdxf\n\nSCALE = 0.7347\nPAGE = [297.0, 210.0]\n\nVISIBLE_SEGMENTS = [\n (81.254, 96.1765, 83.549937, 96.1765),\n (83.549937, 96.1765, 85.845875, 96.1765),\n (85.845875, 96.1765, 88.141813, 96.1765),\n (88.141813, 96.1765, 90.43775, 96.1765),\n (90.43775, 96.1765, 92.733688, 96.1765),\n (92.733688, 96.1765, 95.029625, 96.1765),\n (95.029625, 96.1765, 97.325563, 96.1765),\n (97.325563, 96.1765, 99.6215, 96.1765),\n (99.6215, 96.1765, 101.917438, 96.1765),\n (101.917438, 96.1765, 104.213375, 96.1765),\n (104.213375, 96.1765, 106.509313, 96.1765),\n (106.509313, 96.1765, 108.80525, 96.1765),\n (108.80525, 96.1765, 111.101188, 96.1765),\n (111.101188, 96.1765, 113.397125, 96.1765),\n (113.397125, 96.1765, 115.693063, 96.1765),\n (115.693063, 96.1765, 117.989, 96.1765),\n (117.989, 96.1765, 120.284937, 96.1765),\n (120.284937, 96.1765, 122.580875, 96.1765),\n (122.580875, 96.1765, 124.876812, 96.1765),\n (124.876812, 96.1765, 127.17275, 96.1765),\n (127.17275, 96.1765, 129.468688, 96.1765),\n (129.468688, 96.1765, 131.764625, 96.1765),\n (131.764625, 96.1765, 134.060563, 96.1765),\n (134.060563, 96.1765, 136.3565, 96.1765),\n (136.3565, 96.1765, 138.652438, 96.1765),\n (138.652438, 96.1765, 140.948375, 96.1765),\n (140.948375, 96.1765, 143.244313, 96.1765),\n (143.244313, 96.1765, 145.54025, 96.1765),\n (145.54025, 96.1765, 147.836188, 96.1765),\n (147.836188, 96.1765, 150.132125, 96.1765),\n (150.132125, 96.1765, 152.428063, 96.1765),\n (152.428063, 96.1765, 154.724, 96.1765),\n (154.724, 96.1765, 154.724, 87.088414),\n (81.254, 87.088414, 83.549937, 87.088414),\n (83.549937, 87.088414, 85.845875, 87.088414),\n (85.845875, 87.088414, 88.141813, 87.088414),\n (88.141813, 87.088414, 90.43775, 87.088414),\n (90.43775, 87.088414, 92.733688, 87.088414),\n (92.733688, 87.088414, 95.029625, 87.088414),\n (95.029625, 87.088414, 97.325563, 87.088414),\n (97.325563, 87.088414, 99.6215, 87.088414),\n (99.6215, 87.088414, 101.917438, 87.088414),\n (101.917438, 87.088414, 104.213375, 87.088414),\n (104.213375, 87.088414, 106.509313, 87.088414),\n (106.509313, 87.088414, 108.80525, 87.088414),\n (108.80525, 87.088414, 111.101188, 87.088414),\n (111.101188, 87.088414, 113.397125, 87.088414),\n (113.397125, 87.088414, 115.693063, 87.088414),\n (115.693063, 87.088414, 117.989, 87.088414),\n (117.989, 87.088414, 120.284937, 87.088414),\n (120.284937, 87.088414, 122.580875, 87.088414),\n (122.580875, 87.088414, 124.876812, 87.088414),\n (124.876812, 87.088414, 127.17275, 87.088414),\n (127.17275, 87.088414, 129.468688, 87.088414),\n (129.468688, 87.088414, 131.764625, 87.088414),\n (131.764625, 87.088414, 134.060563, 87.088414),\n (134.060563, 87.088414, 136.3565, 87.088414),\n (136.3565, 87.088414, 138.652438, 87.088414),\n (138.652438, 87.088414, 140.948375, 87.088414),\n (140.948375, 87.088414, 143.244313, 87.088414),\n (143.244313, 87.088414, 145.54025, 87.088414),\n (145.54025, 87.088414, 147.836188, 87.088414),\n (147.836188, 87.088414, 150.132125, 87.088414),\n (150.132125, 87.088414, 152.428063, 87.088414),\n (152.428063, 87.088414, 154.724, 87.088414),\n (81.254, 87.088414, 81.254, 96.1765),\n (177.812086, 183.6465, 177.812086, 181.350562),\n (177.812086, 181.350562, 177.812086, 179.054625),\n (177.812086, 179.054625, 177.812086, 176.758688),\n (177.812086, 176.758688, 177.812086, 174.46275),\n (177.812086, 174.46275, 177.812086, 172.166812),\n (177.812086, 172.166812, 177.812086, 169.870875),\n (177.812086, 169.870875, 177.812086, 167.574938),\n (177.812086, 167.574938, 177.812086, 165.279),\n (177.812086, 165.279, 177.812086, 162.983063),\n (177.812086, 162.983063, 177.812086, 160.687125),\n (177.812086, 160.687125, 177.812086, 158.391188),\n (177.812086, 158.391188, 177.812086, 156.09525),\n (177.812086, 156.09525, 177.812086, 153.799313),\n (177.812086, 153.799313, 177.812086, 151.503375),\n (177.812086, 151.503375, 177.812086, 149.207438),\n (177.812086, 149.207438, 177.812086, 146.9115),\n (177.812086, 146.9115, 177.812086, 144.615562),\n (177.812086, 144.615562, 177.812086, 142.319625),\n (177.812086, 142.319625, 177.812086, 140.023687),\n (177.812086, 140.023687, 177.812086, 137.72775),\n (177.812086, 137.72775, 177.812086, 135.431813),\n (177.812086, 135.431813, 177.812086, 133.135875),\n (177.812086, 133.135875, 177.812086, 130.839938),\n (177.812086, 130.839938, 177.812086, 128.544),\n (177.812086, 128.544, 177.812086, 126.248063),\n (177.812086, 126.248063, 177.812086, 123.952125),\n (177.812086, 123.952125, 177.812086, 121.656188),\n (177.812086, 121.656188, 177.812086, 119.36025),\n (177.812086, 119.36025, 177.812086, 117.064313),\n (177.812086, 117.064313, 177.812086, 114.768375),\n (177.812086, 114.768375, 177.812086, 112.472438),\n (177.812086, 112.472438, 177.812086, 110.1765),\n (168.724, 183.6465, 168.724, 181.350562),\n (168.724, 181.350562, 168.724, 179.054625),\n (168.724, 179.054625, 168.724, 176.758688),\n (168.724, 176.758688, 168.724, 174.46275),\n (168.724, 174.46275, 168.724, 172.166812),\n (168.724, 172.166812, 168.724, 169.870875),\n (168.724, 169.870875, 168.724, 167.574938),\n (168.724, 167.574938, 168.724, 165.279),\n (168.724, 165.279, 168.724, 162.983063),\n (168.724, 162.983063, 168.724, 160.687125),\n (168.724, 160.687125, 168.724, 158.391188),\n (168.724, 158.391188, 168.724, 156.09525),\n (168.724, 156.09525, 168.724, 153.799313),\n (168.724, 153.799313, 168.724, 151.503375),\n (168.724, 151.503375, 168.724, 149.207438),\n (168.724, 149.207438, 168.724, 146.9115),\n (168.724, 146.9115, 168.724, 144.615562),\n (168.724, 144.615562, 168.724, 142.319625),\n (168.724, 142.319625, 168.724, 140.023687),\n (168.724, 140.023687, 168.724, 137.72775),\n (168.724, 137.72775, 168.724, 135.431813),\n (168.724, 135.431813, 168.724, 133.135875),\n (168.724, 133.135875, 168.724, 130.839938),\n (168.724, 130.839938, 168.724, 128.544),\n (168.724, 128.544, 168.724, 126.248063),\n (168.724, 126.248063, 168.724, 123.952125),\n (168.724, 123.952125, 168.724, 121.656188),\n (168.724, 121.656188, 168.724, 119.36025),\n (168.724, 119.36025, 168.724, 117.064313),\n (168.724, 117.064313, 168.724, 114.768375),\n (168.724, 114.768375, 168.724, 112.472438),\n (168.724, 112.472438, 168.724, 110.1765),\n (168.724, 183.6465, 177.812086, 183.6465),\n (168.724, 110.1765, 177.812086, 110.1765)\n]\nVISIBLE_CIRCLES = [\n (117.989, 146.9115, 36.735),\n (117.989, 146.9115, 19.132813)\n]\nVISIBLE_ARCS = [\n\n]\nHIDDEN_SEGMENTS = [\n (137.1218, 87.0885, 137.1218, 96.1765),\n (98.8562, 96.1765, 98.8562, 87.0885),\n (168.724, 127.7787, 177.8121, 127.7787),\n (168.724, 166.0444, 177.8121, 166.0444)\n]\n# (orient, text, p1, p2, base) for linear; (orient, text, center, radius, angle) for diameter\nDIMENSIONS = [\n ('diameter', '%%c100', (117.989, 146.9115), 36.735, 45),\n ('diameter', '%%c52.0833', (117.989, 146.9115), 19.1328, 135),\n ('horizontal', '12.3698', (177.8121, 146.9115), (168.724, 146.9115), (173.268, 135.9115))\n]\n\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\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\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,\n angle=(0 if d[0] == \"horizontal\" else 90),\n 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,\n text=text, dimstyle=\"EZDXF\").render()\n\n doc.saveas(out_path)\n\n\nif __name__ == \"__main__\":\n out = sys.argv[1] if len(sys.argv) > 1 else \"0058_00582953_gt.dxf\"\n draw(out)\n print(\"wrote\", out)\n```"}], "images": ["images/0058_00582953.png"], "id": "0058_00582953"} {"messages": [{"role": "user", "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": "assistant", "content": "```python\n#!/usr/bin/env python3\n# -*- coding: utf-8 -*-\n# Ground-truth 2D engineering drawing for part: 0059_00599934\n# Self-contained: reproduces the three-view DXF via ezdxf, NO FreeCAD needed.\n# Coordinates are A4 page millimetres (scale=0.8436039434204886, page=[297.0, 210.0]).\n# visible edges -> solid (layer OUTLINE); hidden edges -> dashed (layer HIDDEN)\n# dimensions -> real movable DIMENSION entities (text = true mm value)\n# Run: python 0059_00599934_gt.py [out.dxf]\nimport sys\nimport ezdxf\n\nSCALE = 0.8436039434204886\nPAGE = [297.0, 210.0]\n\nVISIBLE_SEGMENTS = [\n (154.795897, 83.040097, 152.159635, 83.040097),\n (152.159635, 83.040097, 149.523373, 83.040097),\n (149.523373, 83.040097, 146.88711, 83.040097),\n (146.88711, 83.040097, 144.250848, 83.040097),\n (144.250848, 83.040097, 141.614586, 83.040097),\n (141.614586, 83.040097, 138.978323, 83.040097),\n (138.978323, 83.040097, 136.342061, 83.040097),\n (136.342061, 83.040097, 133.705799, 83.040097),\n (133.705799, 83.040097, 131.069536, 83.040097),\n (131.069536, 83.040097, 128.433274, 83.040097),\n (128.433274, 83.040097, 125.797012, 83.040097),\n (125.797012, 83.040097, 123.160749, 83.040097),\n (123.160749, 83.040097, 120.524487, 83.040097),\n (120.524487, 83.040097, 117.888225, 83.040097),\n (117.888225, 83.040097, 115.251962, 83.040097),\n (115.251962, 83.040097, 112.6157, 83.040097),\n (112.6157, 83.040097, 109.979438, 83.040097),\n (109.979438, 83.040097, 107.343175, 83.040097),\n (107.343175, 83.040097, 104.706913, 83.040097),\n (104.706913, 83.040097, 102.070651, 83.040097),\n (102.070651, 83.040097, 99.434388, 83.040097),\n (99.434388, 83.040097, 96.798126, 83.040097),\n (96.798126, 83.040097, 94.161864, 83.040097),\n (94.161864, 83.040097, 91.525601, 83.040097),\n (91.525601, 83.040097, 88.889339, 83.040097),\n (88.889339, 83.040097, 86.253077, 83.040097),\n (86.253077, 83.040097, 83.616814, 83.040097),\n (83.616814, 83.040097, 80.980552, 83.040097),\n (80.980552, 83.040097, 78.34429, 83.040097),\n (78.34429, 83.040097, 75.708027, 83.040097),\n (75.708027, 83.040097, 73.071765, 83.040097),\n (73.071765, 83.040097, 70.435503, 83.040097),\n (154.795897, 83.040097, 154.795897, 94.779703),\n (154.795897, 94.779703, 152.159635, 94.779703),\n (152.159635, 94.779703, 149.523373, 94.779703),\n (149.523373, 94.779703, 146.88711, 94.779703),\n (146.88711, 94.779703, 144.250848, 94.779703),\n (144.250848, 94.779703, 141.614586, 94.779703),\n (141.614586, 94.779703, 138.978323, 94.779703),\n (138.978323, 94.779703, 136.342061, 94.779703),\n (136.342061, 94.779703, 133.705799, 94.779703),\n (133.705799, 94.779703, 131.069536, 94.779703),\n (131.069536, 94.779703, 128.433274, 94.779703),\n (128.433274, 94.779703, 125.797012, 94.779703),\n (125.797012, 94.779703, 123.160749, 94.779703),\n (123.160749, 94.779703, 120.524487, 94.779703),\n (120.524487, 94.779703, 117.888225, 94.779703),\n (117.888225, 94.779703, 115.251962, 94.779703),\n (115.251962, 94.779703, 112.6157, 94.779703),\n (112.6157, 94.779703, 109.979438, 94.779703),\n (109.979438, 94.779703, 107.343175, 94.779703),\n (107.343175, 94.779703, 104.706913, 94.779703),\n (104.706913, 94.779703, 102.070651, 94.779703),\n (102.070651, 94.779703, 99.434388, 94.779703),\n (99.434388, 94.779703, 96.798126, 94.779703),\n (96.798126, 94.779703, 94.161864, 94.779703),\n (94.161864, 94.779703, 91.525601, 94.779703),\n (91.525601, 94.779703, 88.889339, 94.779703),\n (88.889339, 94.779703, 86.253077, 94.779703),\n (86.253077, 94.779703, 83.616814, 94.779703),\n (83.616814, 94.779703, 80.980552, 94.779703),\n (80.980552, 94.779703, 78.34429, 94.779703),\n (78.34429, 94.779703, 75.708027, 94.779703),\n (75.708027, 94.779703, 73.071765, 94.779703),\n (73.071765, 94.779703, 70.435503, 94.779703),\n (70.435503, 94.779703, 70.435503, 83.040097),\n (168.795897, 108.779703, 168.795897, 111.415965),\n (168.795897, 111.415965, 168.795897, 114.052227),\n (168.795897, 114.052227, 168.795897, 116.68849),\n (168.795897, 116.68849, 168.795897, 119.324752),\n (168.795897, 119.324752, 168.795897, 121.961014),\n (168.795897, 121.961014, 168.795897, 124.597277),\n (168.795897, 124.597277, 168.795897, 127.233539),\n (168.795897, 127.233539, 168.795897, 129.869801),\n (168.795897, 129.869801, 168.795897, 132.506064),\n (168.795897, 132.506064, 168.795897, 135.142326),\n (168.795897, 135.142326, 168.795897, 137.778588),\n (168.795897, 137.778588, 168.795897, 140.414851),\n (168.795897, 140.414851, 168.795897, 143.051113),\n (168.795897, 143.051113, 168.795897, 145.687375),\n (168.795897, 145.687375, 168.795897, 148.323638),\n (168.795897, 148.323638, 168.795897, 150.9599),\n (168.795897, 150.9599, 168.795897, 153.596162),\n (168.795897, 153.596162, 168.795897, 156.232425),\n (168.795897, 156.232425, 168.795897, 158.868687),\n (168.795897, 158.868687, 168.795897, 161.504949),\n (168.795897, 161.504949, 168.795897, 164.141212),\n (168.795897, 164.141212, 168.795897, 166.777474),\n (168.795897, 166.777474, 168.795897, 169.413736),\n (168.795897, 169.413736, 168.795897, 172.049999),\n (168.795897, 172.049999, 168.795897, 174.686261),\n (168.795897, 174.686261, 168.795897, 177.322523),\n (168.795897, 177.322523, 168.795897, 179.958786),\n (168.795897, 179.958786, 168.795897, 182.595048),\n (168.795897, 182.595048, 168.795897, 185.23131),\n (168.795897, 185.23131, 168.795897, 187.867573),\n (168.795897, 187.867573, 168.795897, 190.503835),\n (168.795897, 190.503835, 168.795897, 193.140097),\n (180.535503, 108.779703, 180.535503, 111.415965),\n (180.535503, 111.415965, 180.535503, 114.052227),\n (180.535503, 114.052227, 180.535503, 116.68849),\n (180.535503, 116.68849, 180.535503, 119.324752),\n (180.535503, 119.324752, 180.535503, 121.961014),\n (180.535503, 121.961014, 180.535503, 124.597277),\n (180.535503, 124.597277, 180.535503, 127.233539),\n (180.535503, 127.233539, 180.535503, 129.869801),\n (180.535503, 129.869801, 180.535503, 132.506064),\n (180.535503, 132.506064, 180.535503, 135.142326),\n (180.535503, 135.142326, 180.535503, 137.778588),\n (180.535503, 137.778588, 180.535503, 140.414851),\n (180.535503, 140.414851, 180.535503, 143.051113),\n (180.535503, 143.051113, 180.535503, 145.687375),\n (180.535503, 145.687375, 180.535503, 148.323638),\n (180.535503, 148.323638, 180.535503, 150.9599),\n (180.535503, 150.9599, 180.535503, 153.596162),\n (180.535503, 153.596162, 180.535503, 156.232425),\n (180.535503, 156.232425, 180.535503, 158.868687),\n (180.535503, 158.868687, 180.535503, 161.504949),\n (180.535503, 161.504949, 180.535503, 164.141212),\n (180.535503, 164.141212, 180.535503, 166.777474),\n (180.535503, 166.777474, 180.535503, 169.413736),\n (180.535503, 169.413736, 180.535503, 172.049999),\n (180.535503, 172.049999, 180.535503, 174.686261),\n (180.535503, 174.686261, 180.535503, 177.322523),\n (180.535503, 177.322523, 180.535503, 179.958786),\n (180.535503, 179.958786, 180.535503, 182.595048),\n (180.535503, 182.595048, 180.535503, 185.23131),\n (180.535503, 185.23131, 180.535503, 187.867573),\n (180.535503, 187.867573, 180.535503, 190.503835),\n (180.535503, 190.503835, 180.535503, 193.140097),\n (180.535503, 108.779703, 168.795897, 108.779703),\n (180.535503, 193.140097, 168.795897, 193.140097)\n]\nVISIBLE_CIRCLES = [\n (112.6157, 150.9599, 42.180197),\n (112.6157, 150.9599, 29.87764)\n]\nVISIBLE_ARCS = [\n\n]\nHIDDEN_SEGMENTS = [\n (142.4934, 94.7797, 142.4934, 83.0401),\n (82.7381, 83.0401, 82.7381, 94.7797),\n (180.5355, 180.8375, 168.7959, 180.8375),\n (180.5355, 121.0823, 168.7959, 121.0823)\n]\n# (orient, text, p1, p2, base) for linear; (orient, text, center, radius, angle) for diameter\nDIMENSIONS = [\n ('diameter', '%%c100', (112.6157, 150.9599), 42.1802, 45),\n ('diameter', '%%c70.8333', (112.6157, 150.9599), 29.8776, 135),\n ('horizontal', '13.916', (168.7959, 150.9599), (180.5355, 150.9599), (174.6657, 161.9599))\n]\n\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\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\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,\n angle=(0 if d[0] == \"horizontal\" else 90),\n 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,\n text=text, dimstyle=\"EZDXF\").render()\n\n doc.saveas(out_path)\n\n\nif __name__ == \"__main__\":\n out = sys.argv[1] if len(sys.argv) > 1 else \"0059_00599934_gt.dxf\"\n draw(out)\n print(\"wrote\", out)\n```"}], "images": ["images/0059_00599934.png"], "id": "0059_00599934"} {"messages": [{"role": "user", "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 17.52 mm."}, {"role": "assistant", "content": "```python\n#!/usr/bin/env python3\n# -*- coding: utf-8 -*-\n# Ground-truth 2D engineering drawing for part: 0060_00609319\n# Self-contained: reproduces the three-view DXF via ezdxf, NO FreeCAD needed.\n# Coordinates are A4 page millimetres (scale=0.8177062136460145, page=[297.0, 210.0]).\n# visible edges -> solid (layer OUTLINE); hidden edges -> dashed (layer HIDDEN)\n# dimensions -> real movable DIMENSION entities (text = true mm value)\n# Run: python 0060_00609319_gt.py [out.dxf]\nimport sys\nimport ezdxf\n\nSCALE = 0.8177062136460145\nPAGE = [297.0, 210.0]\n\nVISIBLE_SEGMENTS = [\n (152.546211, 82.39261, 149.990879, 82.39261),\n (149.990879, 82.39261, 147.435547, 82.39261),\n (147.435547, 82.39261, 144.880215, 82.39261),\n (144.880215, 82.39261, 142.324883, 82.39261),\n (142.324883, 82.39261, 139.769551, 82.39261),\n (139.769551, 82.39261, 137.214219, 82.39261),\n (137.214219, 82.39261, 134.658887, 82.39261),\n (134.658887, 82.39261, 132.103555, 82.39261),\n (132.103555, 82.39261, 129.548223, 82.39261),\n (129.548223, 82.39261, 126.992892, 82.39261),\n (126.992892, 82.39261, 124.43756, 82.39261),\n (124.43756, 82.39261, 121.882228, 82.39261),\n (121.882228, 82.39261, 119.326896, 82.39261),\n (119.326896, 82.39261, 116.771564, 82.39261),\n (116.771564, 82.39261, 114.216232, 82.39261),\n (114.216232, 82.39261, 111.6609, 82.39261),\n (111.6609, 82.39261, 109.105568, 82.39261),\n (109.105568, 82.39261, 106.550236, 82.39261),\n (106.550236, 82.39261, 103.994904, 82.39261),\n (103.994904, 82.39261, 101.439572, 82.39261),\n (101.439572, 82.39261, 98.88424, 82.39261),\n (98.88424, 82.39261, 96.328908, 82.39261),\n (96.328908, 82.39261, 93.773577, 82.39261),\n (93.773577, 82.39261, 91.218245, 82.39261),\n (91.218245, 82.39261, 88.662913, 82.39261),\n (88.662913, 82.39261, 86.107581, 82.39261),\n (86.107581, 82.39261, 83.552249, 82.39261),\n (83.552249, 82.39261, 80.996917, 82.39261),\n (80.996917, 82.39261, 78.441585, 82.39261),\n (78.441585, 82.39261, 75.886253, 82.39261),\n (75.886253, 82.39261, 73.330921, 82.39261),\n (73.330921, 82.39261, 70.775589, 82.39261),\n (152.546211, 82.39261, 152.546211, 96.721989),\n (152.546211, 96.721989, 149.990879, 96.721989),\n (149.990879, 96.721989, 147.435547, 96.721989),\n (147.435547, 96.721989, 144.880215, 96.721989),\n (144.880215, 96.721989, 142.324883, 96.721989),\n (142.324883, 96.721989, 139.769551, 96.721989),\n (139.769551, 96.721989, 137.214219, 96.721989),\n (137.214219, 96.721989, 134.658887, 96.721989),\n (134.658887, 96.721989, 132.103555, 96.721989),\n (132.103555, 96.721989, 129.548223, 96.721989),\n (129.548223, 96.721989, 126.992892, 96.721989),\n (126.992892, 96.721989, 124.43756, 96.721989),\n (124.43756, 96.721989, 121.882228, 96.721989),\n (121.882228, 96.721989, 119.326896, 96.721989),\n (119.326896, 96.721989, 116.771564, 96.721989),\n (116.771564, 96.721989, 114.216232, 96.721989),\n (114.216232, 96.721989, 111.6609, 96.721989),\n (111.6609, 96.721989, 109.105568, 96.721989),\n (109.105568, 96.721989, 106.550236, 96.721989),\n (106.550236, 96.721989, 103.994904, 96.721989),\n (103.994904, 96.721989, 101.439572, 96.721989),\n (101.439572, 96.721989, 98.88424, 96.721989),\n (98.88424, 96.721989, 96.328908, 96.721989),\n (96.328908, 96.721989, 93.773577, 96.721989),\n (93.773577, 96.721989, 91.218245, 96.721989),\n (91.218245, 96.721989, 88.662913, 96.721989),\n (88.662913, 96.721989, 86.107581, 96.721989),\n (86.107581, 96.721989, 83.552249, 96.721989),\n (83.552249, 96.721989, 80.996917, 96.721989),\n (80.996917, 96.721989, 78.441585, 96.721989),\n (78.441585, 96.721989, 75.886253, 96.721989),\n (75.886253, 96.721989, 73.330921, 96.721989),\n (73.330921, 96.721989, 70.775589, 96.721989),\n (70.775589, 96.721989, 70.775589, 82.39261),\n (166.546211, 110.721989, 166.546211, 113.277321),\n (166.546211, 113.277321, 166.546211, 115.832653),\n (166.546211, 115.832653, 166.546211, 118.387985),\n (166.546211, 118.387985, 166.546211, 120.943317),\n (166.546211, 120.943317, 166.546211, 123.498649),\n (166.546211, 123.498649, 166.546211, 126.053981),\n (166.546211, 126.053981, 166.546211, 128.609313),\n (166.546211, 128.609313, 166.546211, 131.164645),\n (166.546211, 131.164645, 166.546211, 133.719977),\n (166.546211, 133.719977, 166.546211, 136.275308),\n (166.546211, 136.275308, 166.546211, 138.83064),\n (166.546211, 138.83064, 166.546211, 141.385972),\n (166.546211, 141.385972, 166.546211, 143.941304),\n (166.546211, 143.941304, 166.546211, 146.496636),\n (166.546211, 146.496636, 166.546211, 149.051968),\n (166.546211, 149.051968, 166.546211, 151.6073),\n (166.546211, 151.6073, 166.546211, 154.162632),\n (166.546211, 154.162632, 166.546211, 156.717964),\n (166.546211, 156.717964, 166.546211, 159.273296),\n (166.546211, 159.273296, 166.546211, 161.828628),\n (166.546211, 161.828628, 166.546211, 164.38396),\n (166.546211, 164.38396, 166.546211, 166.939292),\n (166.546211, 166.939292, 166.546211, 169.494623),\n (166.546211, 169.494623, 166.546211, 172.049955),\n (166.546211, 172.049955, 166.546211, 174.605287),\n (166.546211, 174.605287, 166.546211, 177.160619),\n (166.546211, 177.160619, 166.546211, 179.715951),\n (166.546211, 179.715951, 166.546211, 182.271283),\n (166.546211, 182.271283, 166.546211, 184.826615),\n (166.546211, 184.826615, 166.546211, 187.381947),\n (166.546211, 187.381947, 166.546211, 189.937279),\n (166.546211, 189.937279, 166.546211, 192.492611),\n (180.87559, 110.721989, 180.87559, 113.277321),\n (180.87559, 113.277321, 180.87559, 115.832653),\n (180.87559, 115.832653, 180.87559, 118.387985),\n (180.87559, 118.387985, 180.87559, 120.943317),\n (180.87559, 120.943317, 180.87559, 123.498649),\n (180.87559, 123.498649, 180.87559, 126.053981),\n (180.87559, 126.053981, 180.87559, 128.609313),\n (180.87559, 128.609313, 180.87559, 131.164645),\n (180.87559, 131.164645, 180.87559, 133.719977),\n (180.87559, 133.719977, 180.87559, 136.275308),\n (180.87559, 136.275308, 180.87559, 138.83064),\n (180.87559, 138.83064, 180.87559, 141.385972),\n (180.87559, 141.385972, 180.87559, 143.941304),\n (180.87559, 143.941304, 180.87559, 146.496636),\n (180.87559, 146.496636, 180.87559, 149.051968),\n (180.87559, 149.051968, 180.87559, 151.6073),\n (180.87559, 151.6073, 180.87559, 154.162632),\n (180.87559, 154.162632, 180.87559, 156.717964),\n (180.87559, 156.717964, 180.87559, 159.273296),\n (180.87559, 159.273296, 180.87559, 161.828628),\n (180.87559, 161.828628, 180.87559, 164.38396),\n (180.87559, 164.38396, 180.87559, 166.939292),\n (180.87559, 166.939292, 180.87559, 169.494623),\n (180.87559, 169.494623, 180.87559, 172.049955),\n (180.87559, 172.049955, 180.87559, 174.605287),\n (180.87559, 174.605287, 180.87559, 177.160619),\n (180.87559, 177.160619, 180.87559, 179.715951),\n (180.87559, 179.715951, 180.87559, 182.271283),\n (180.87559, 182.271283, 180.87559, 184.826615),\n (180.87559, 184.826615, 180.87559, 187.381947),\n (180.87559, 187.381947, 180.87559, 189.937279),\n (180.87559, 189.937279, 180.87559, 192.492611),\n (180.87559, 110.721989, 166.546211, 110.721989),\n (180.87559, 192.492611, 166.546211, 192.492611)\n]\nVISIBLE_CIRCLES = [\n (111.6609, 151.6073, 40.885311),\n (111.6609, 151.6073, 29.812206)\n]\nVISIBLE_ARCS = [\n\n]\nHIDDEN_SEGMENTS = [\n (141.4731, 96.722, 141.4731, 82.3927),\n (81.8487, 82.3927, 81.8487, 96.722),\n (180.8756, 181.4196, 166.5462, 181.4196),\n (180.8756, 121.7951, 166.5462, 121.7951)\n]\n# (orient, text, p1, p2, base) for linear; (orient, text, center, radius, angle) for diameter\nDIMENSIONS = [\n ('diameter', '%%c100', (111.6609, 151.6073), 40.8853, 45),\n ('diameter', '%%c72.9167', (111.6609, 151.6073), 29.8122, 135),\n ('horizontal', '17.5239', (166.5462, 151.6073), (180.8756, 151.6073), (173.7109, 162.6073))\n]\n\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\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\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,\n angle=(0 if d[0] == \"horizontal\" else 90),\n 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,\n text=text, dimstyle=\"EZDXF\").render()\n\n doc.saveas(out_path)\n\n\nif __name__ == \"__main__\":\n out = sys.argv[1] if len(sys.argv) > 1 else \"0060_00609319_gt.dxf\"\n draw(out)\n print(\"wrote\", out)\n```"}], "images": ["images/0060_00609319.png"], "id": "0060_00609319"} {"messages": [{"role": "user", "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": "assistant", "content": "```python\n#!/usr/bin/env python3\n# -*- coding: utf-8 -*-\n# Ground-truth 2D engineering drawing for part: 0062_00622935\n# Self-contained: reproduces the three-view DXF via ezdxf, NO FreeCAD needed.\n# Coordinates are A4 page millimetres (scale=0.7274306085643575, page=[297.0, 210.0]).\n# visible edges -> solid (layer OUTLINE); hidden edges -> dashed (layer HIDDEN)\n# dimensions -> real movable DIMENSION entities (text = true mm value)\n# Run: python 0062_00622935_gt.py [out.dxf]\nimport sys\nimport ezdxf\n\nSCALE = 0.7274306085643575\nPAGE = [297.0, 210.0]\n\nVISIBLE_SEGMENTS = [\n (148.81123, 80.13573, 146.53801, 80.13573),\n (146.53801, 80.13573, 144.264789, 80.13573),\n (144.264789, 80.13573, 141.991568, 80.13573),\n (141.991568, 80.13573, 139.718348, 80.13573),\n (139.718348, 80.13573, 137.445127, 80.13573),\n (137.445127, 80.13573, 135.171907, 80.13573),\n (135.171907, 80.13573, 132.898686, 80.13573),\n (132.898686, 80.13573, 130.625465, 80.13573),\n (130.625465, 80.13573, 128.352245, 80.13573),\n (128.352245, 80.13573, 126.079024, 80.13573),\n (126.079024, 80.13573, 123.805803, 80.13573),\n (123.805803, 80.13573, 121.532583, 80.13573),\n (121.532583, 80.13573, 119.259362, 80.13573),\n (119.259362, 80.13573, 116.986141, 80.13573),\n (116.986141, 80.13573, 114.712921, 80.13573),\n (114.712921, 80.13573, 112.4397, 80.13573),\n (112.4397, 80.13573, 110.166479, 80.13573),\n (110.166479, 80.13573, 107.893259, 80.13573),\n (107.893259, 80.13573, 105.620038, 80.13573),\n (105.620038, 80.13573, 103.346817, 80.13573),\n (103.346817, 80.13573, 101.073597, 80.13573),\n (101.073597, 80.13573, 98.800376, 80.13573),\n (98.800376, 80.13573, 96.527155, 80.13573),\n (96.527155, 80.13573, 94.253935, 80.13573),\n (94.253935, 80.13573, 91.980714, 80.13573),\n (91.980714, 80.13573, 89.707493, 80.13573),\n (89.707493, 80.13573, 87.434273, 80.13573),\n (87.434273, 80.13573, 85.161052, 80.13573),\n (85.161052, 80.13573, 82.887832, 80.13573),\n (82.887832, 80.13573, 80.614611, 80.13573),\n (80.614611, 80.13573, 78.34139, 80.13573),\n (78.34139, 80.13573, 76.06817, 80.13573),\n (148.81123, 80.13573, 148.81123, 103.492669),\n (148.81123, 103.492669, 146.53801, 103.492669),\n (146.53801, 103.492669, 144.264789, 103.492669),\n (144.264789, 103.492669, 141.991568, 103.492669),\n (141.991568, 103.492669, 139.718348, 103.492669),\n (139.718348, 103.492669, 137.445127, 103.492669),\n (137.445127, 103.492669, 135.171907, 103.492669),\n (135.171907, 103.492669, 132.898686, 103.492669),\n (132.898686, 103.492669, 130.625465, 103.492669),\n (130.625465, 103.492669, 128.352245, 103.492669),\n (128.352245, 103.492669, 126.079024, 103.492669),\n (126.079024, 103.492669, 123.805803, 103.492669),\n (123.805803, 103.492669, 121.532583, 103.492669),\n (121.532583, 103.492669, 119.259362, 103.492669),\n (119.259362, 103.492669, 116.986141, 103.492669),\n (116.986141, 103.492669, 114.712921, 103.492669),\n (114.712921, 103.492669, 112.4397, 103.492669),\n (112.4397, 103.492669, 110.166479, 103.492669),\n (110.166479, 103.492669, 107.893259, 103.492669),\n (107.893259, 103.492669, 105.620038, 103.492669),\n (105.620038, 103.492669, 103.346817, 103.492669),\n (103.346817, 103.492669, 101.073597, 103.492669),\n (101.073597, 103.492669, 98.800376, 103.492669),\n (98.800376, 103.492669, 96.527155, 103.492669),\n (96.527155, 103.492669, 94.253935, 103.492669),\n (94.253935, 103.492669, 91.980714, 103.492669),\n (91.980714, 103.492669, 89.707493, 103.492669),\n (89.707493, 103.492669, 87.434273, 103.492669),\n (87.434273, 103.492669, 85.161052, 103.492669),\n (85.161052, 103.492669, 82.887832, 103.492669),\n (82.887832, 103.492669, 80.614611, 103.492669),\n (80.614611, 103.492669, 78.34139, 103.492669),\n (78.34139, 103.492669, 76.06817, 103.492669),\n (76.06817, 103.492669, 76.06817, 80.13573),\n (162.811231, 117.49267, 162.811231, 119.76589),\n (162.811231, 119.76589, 162.811231, 122.039111),\n (162.811231, 122.039111, 162.811231, 124.312332),\n (162.811231, 124.312332, 162.811231, 126.585552),\n (162.811231, 126.585552, 162.811231, 128.858773),\n (162.811231, 128.858773, 162.811231, 131.131993),\n (162.811231, 131.131993, 162.811231, 133.405214),\n (162.811231, 133.405214, 162.811231, 135.678435),\n (162.811231, 135.678435, 162.811231, 137.951655),\n (162.811231, 137.951655, 162.811231, 140.224876),\n (162.811231, 140.224876, 162.811231, 142.498097),\n (162.811231, 142.498097, 162.811231, 144.771317),\n (162.811231, 144.771317, 162.811231, 147.044538),\n (162.811231, 147.044538, 162.811231, 149.317759),\n (162.811231, 149.317759, 162.811231, 151.590979),\n (162.811231, 151.590979, 162.811231, 153.8642),\n (162.811231, 153.8642, 162.811231, 156.137421),\n (162.811231, 156.137421, 162.811231, 158.410641),\n (162.811231, 158.410641, 162.811231, 160.683862),\n (162.811231, 160.683862, 162.811231, 162.957083),\n (162.811231, 162.957083, 162.811231, 165.230303),\n (162.811231, 165.230303, 162.811231, 167.503524),\n (162.811231, 167.503524, 162.811231, 169.776745),\n (162.811231, 169.776745, 162.811231, 172.049965),\n (162.811231, 172.049965, 162.811231, 174.323186),\n (162.811231, 174.323186, 162.811231, 176.596407),\n (162.811231, 176.596407, 162.811231, 178.869627),\n (162.811231, 178.869627, 162.811231, 181.142848),\n (162.811231, 181.142848, 162.811231, 183.416068),\n (162.811231, 183.416068, 162.811231, 185.689289),\n (162.811231, 185.689289, 162.811231, 187.96251),\n (162.811231, 187.96251, 162.811231, 190.23573),\n (186.16817, 117.49267, 186.16817, 119.76589),\n (186.16817, 119.76589, 186.16817, 122.039111),\n (186.16817, 122.039111, 186.16817, 124.312332),\n (186.16817, 124.312332, 186.16817, 126.585552),\n (186.16817, 126.585552, 186.16817, 128.858773),\n (186.16817, 128.858773, 186.16817, 131.131993),\n (186.16817, 131.131993, 186.16817, 133.405214),\n (186.16817, 133.405214, 186.16817, 135.678435),\n (186.16817, 135.678435, 186.16817, 137.951655),\n (186.16817, 137.951655, 186.16817, 140.224876),\n (186.16817, 140.224876, 186.16817, 142.498097),\n (186.16817, 142.498097, 186.16817, 144.771317),\n (186.16817, 144.771317, 186.16817, 147.044538),\n (186.16817, 147.044538, 186.16817, 149.317759),\n (186.16817, 149.317759, 186.16817, 151.590979),\n (186.16817, 151.590979, 186.16817, 153.8642),\n (186.16817, 153.8642, 186.16817, 156.137421),\n (186.16817, 156.137421, 186.16817, 158.410641),\n (186.16817, 158.410641, 186.16817, 160.683862),\n (186.16817, 160.683862, 186.16817, 162.957083),\n (186.16817, 162.957083, 186.16817, 165.230303),\n (186.16817, 165.230303, 186.16817, 167.503524),\n (186.16817, 167.503524, 186.16817, 169.776745),\n (186.16817, 169.776745, 186.16817, 172.049965),\n (186.16817, 172.049965, 186.16817, 174.323186),\n (186.16817, 174.323186, 186.16817, 176.596407),\n (186.16817, 176.596407, 186.16817, 178.869627),\n (186.16817, 178.869627, 186.16817, 181.142848),\n (186.16817, 181.142848, 186.16817, 183.416068),\n (186.16817, 183.416068, 186.16817, 185.689289),\n (186.16817, 185.689289, 186.16817, 187.96251),\n (186.16817, 187.96251, 186.16817, 190.23573),\n (186.16817, 117.49267, 162.811231, 117.49267),\n (186.16817, 190.23573, 162.811231, 190.23573)\n]\nVISIBLE_CIRCLES = [\n (112.4397, 153.8642, 36.37153),\n (112.4397, 153.8642, 13.15566)\n]\nVISIBLE_ARCS = [\n\n]\nHIDDEN_SEGMENTS = [\n (125.5954, 103.4927, 125.5954, 80.1358),\n (99.2841, 80.1358, 99.2841, 103.4927),\n (186.1682, 167.0199, 162.8113, 167.0199),\n (186.1682, 140.7086, 162.8113, 140.7086)\n]\n# (orient, text, p1, p2, base) for linear; (orient, text, center, radius, angle) for diameter\nDIMENSIONS = [\n ('diameter', '%%c100', (112.4397, 153.8642), 36.3715, 45),\n ('diameter', '%%c36.1702', (112.4397, 153.8642), 13.1557, 135),\n ('horizontal', '32.1088', (162.8113, 153.8642), (186.1682, 153.8642), (174.4897, 164.8642))\n]\n\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\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\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,\n angle=(0 if d[0] == \"horizontal\" else 90),\n 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,\n text=text, dimstyle=\"EZDXF\").render()\n\n doc.saveas(out_path)\n\n\nif __name__ == \"__main__\":\n out = sys.argv[1] if len(sys.argv) > 1 else \"0062_00622935_gt.dxf\"\n draw(out)\n print(\"wrote\", out)\n```"}], "images": ["images/0062_00622935.png"], "id": "0062_00622935"} {"messages": [{"role": "user", "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 10.42 mm. It is extruded to a thickness of 10.31 mm."}, {"role": "assistant", "content": "```python\n#!/usr/bin/env python3\n# -*- coding: utf-8 -*-\n# Ground-truth 2D engineering drawing for part: 0063_00633134\n# Self-contained: reproduces the three-view DXF via ezdxf, NO FreeCAD needed.\n# Coordinates are A4 page millimetres (scale=0.8711957505410208, page=[297.0, 210.0]).\n# visible edges -> solid (layer OUTLINE); hidden edges -> dashed (layer HIDDEN)\n# dimensions -> real movable DIMENSION entities (text = true mm value)\n# Run: python 0063_00633134_gt.py [out.dxf]\nimport sys\nimport ezdxf\n\nSCALE = 0.8711957505410208\nPAGE = [297.0, 210.0]\n\nVISIBLE_SEGMENTS = [\n (163.545188, 83.729887, 160.822701, 83.729887),\n (160.822701, 83.729887, 158.100214, 83.729887),\n (158.100214, 83.729887, 155.377727, 83.729887),\n (155.377727, 83.729887, 152.655241, 83.729887),\n (152.655241, 83.729887, 149.932754, 83.729887),\n (149.932754, 83.729887, 147.210267, 83.729887),\n (147.210267, 83.729887, 144.48778, 83.729887),\n (144.48778, 83.729887, 141.765294, 83.729887),\n (141.765294, 83.729887, 139.042807, 83.729887),\n (139.042807, 83.729887, 136.32032, 83.729887),\n (136.32032, 83.729887, 133.597834, 83.729887),\n (133.597834, 83.729887, 130.875347, 83.729887),\n (130.875347, 83.729887, 128.15286, 83.729887),\n (128.15286, 83.729887, 125.430373, 83.729887),\n (125.430373, 83.729887, 122.707887, 83.729887),\n (122.707887, 83.729887, 119.9854, 83.729887),\n (119.9854, 83.729887, 117.262913, 83.729887),\n (117.262913, 83.729887, 114.540427, 83.729887),\n (114.540427, 83.729887, 111.81794, 83.729887),\n (111.81794, 83.729887, 109.095453, 83.729887),\n (109.095453, 83.729887, 106.372966, 83.729887),\n (106.372966, 83.729887, 103.65048, 83.729887),\n (103.65048, 83.729887, 100.927993, 83.729887),\n (100.927993, 83.729887, 98.205506, 83.729887),\n (98.205506, 83.729887, 95.48302, 83.729887),\n (95.48302, 83.729887, 92.760533, 83.729887),\n (92.760533, 83.729887, 90.038046, 83.729887),\n (90.038046, 83.729887, 87.315559, 83.729887),\n (87.315559, 83.729887, 84.593073, 83.729887),\n (84.593073, 83.729887, 81.870586, 83.729887),\n (81.870586, 83.729887, 79.148099, 83.729887),\n (79.148099, 83.729887, 76.425612, 83.729887),\n (163.545188, 83.729887, 163.545188, 92.710312),\n (163.545188, 92.710312, 160.822701, 92.710312),\n (160.822701, 92.710312, 158.100214, 92.710312),\n (158.100214, 92.710312, 155.377727, 92.710312),\n (155.377727, 92.710312, 152.655241, 92.710312),\n (152.655241, 92.710312, 149.932754, 92.710312),\n (149.932754, 92.710312, 147.210267, 92.710312),\n (147.210267, 92.710312, 144.48778, 92.710312),\n (144.48778, 92.710312, 141.765294, 92.710312),\n (141.765294, 92.710312, 139.042807, 92.710312),\n (139.042807, 92.710312, 136.32032, 92.710312),\n (136.32032, 92.710312, 133.597834, 92.710312),\n (133.597834, 92.710312, 130.875347, 92.710312),\n (130.875347, 92.710312, 128.15286, 92.710312),\n (128.15286, 92.710312, 125.430373, 92.710312),\n (125.430373, 92.710312, 122.707887, 92.710312),\n (122.707887, 92.710312, 119.9854, 92.710312),\n (119.9854, 92.710312, 117.262913, 92.710312),\n (117.262913, 92.710312, 114.540427, 92.710312),\n (114.540427, 92.710312, 111.81794, 92.710312),\n (111.81794, 92.710312, 109.095453, 92.710312),\n (109.095453, 92.710312, 106.372966, 92.710312),\n (106.372966, 92.710312, 103.65048, 92.710312),\n (103.65048, 92.710312, 100.927993, 92.710312),\n (100.927993, 92.710312, 98.205506, 92.710312),\n (98.205506, 92.710312, 95.48302, 92.710312),\n (95.48302, 92.710312, 92.760533, 92.710312),\n (92.760533, 92.710312, 90.038046, 92.710312),\n (90.038046, 92.710312, 87.315559, 92.710312),\n (87.315559, 92.710312, 84.593073, 92.710312),\n (84.593073, 92.710312, 81.870586, 92.710312),\n (81.870586, 92.710312, 79.148099, 92.710312),\n (79.148099, 92.710312, 76.425612, 92.710312),\n (76.425612, 92.710312, 76.425612, 83.729887),\n (177.545188, 106.710312, 177.545188, 109.432799),\n (177.545188, 109.432799, 177.545188, 112.155286),\n (177.545188, 112.155286, 177.545188, 114.877773),\n (177.545188, 114.877773, 177.545188, 117.600259),\n (177.545188, 117.600259, 177.545188, 120.322746),\n (177.545188, 120.322746, 177.545188, 123.045233),\n (177.545188, 123.045233, 177.545188, 125.76772),\n (177.545188, 125.76772, 177.545188, 128.490206),\n (177.545188, 128.490206, 177.545188, 131.212693),\n (177.545188, 131.212693, 177.545188, 133.93518),\n (177.545188, 133.93518, 177.545188, 136.657666),\n (177.545188, 136.657666, 177.545188, 139.380153),\n (177.545188, 139.380153, 177.545188, 142.10264),\n (177.545188, 142.10264, 177.545188, 144.825127),\n (177.545188, 144.825127, 177.545188, 147.547613),\n (177.545188, 147.547613, 177.545188, 150.2701),\n (177.545188, 150.2701, 177.545188, 152.992587),\n (177.545188, 152.992587, 177.545188, 155.715073),\n (177.545188, 155.715073, 177.545188, 158.43756),\n (177.545188, 158.43756, 177.545188, 161.160047),\n (177.545188, 161.160047, 177.545188, 163.882534),\n (177.545188, 163.882534, 177.545188, 166.60502),\n (177.545188, 166.60502, 177.545188, 169.327507),\n (177.545188, 169.327507, 177.545188, 172.049994),\n (177.545188, 172.049994, 177.545188, 174.77248),\n (177.545188, 174.77248, 177.545188, 177.494967),\n (177.545188, 177.494967, 177.545188, 180.217454),\n (177.545188, 180.217454, 177.545188, 182.939941),\n (177.545188, 182.939941, 177.545188, 185.662427),\n (177.545188, 185.662427, 177.545188, 188.384914),\n (177.545188, 188.384914, 177.545188, 191.107401),\n (177.545188, 191.107401, 177.545188, 193.829888),\n (186.525613, 106.710312, 186.525613, 109.432799),\n (186.525613, 109.432799, 186.525613, 112.155286),\n (186.525613, 112.155286, 186.525613, 114.877773),\n (186.525613, 114.877773, 186.525613, 117.600259),\n (186.525613, 117.600259, 186.525613, 120.322746),\n (186.525613, 120.322746, 186.525613, 123.045233),\n (186.525613, 123.045233, 186.525613, 125.76772),\n (186.525613, 125.76772, 186.525613, 128.490206),\n (186.525613, 128.490206, 186.525613, 131.212693),\n (186.525613, 131.212693, 186.525613, 133.93518),\n (186.525613, 133.93518, 186.525613, 136.657666),\n (186.525613, 136.657666, 186.525613, 139.380153),\n (186.525613, 139.380153, 186.525613, 142.10264),\n (186.525613, 142.10264, 186.525613, 144.825127),\n (186.525613, 144.825127, 186.525613, 147.547613),\n (186.525613, 147.547613, 186.525613, 150.2701),\n (186.525613, 150.2701, 186.525613, 152.992587),\n (186.525613, 152.992587, 186.525613, 155.715073),\n (186.525613, 155.715073, 186.525613, 158.43756),\n (186.525613, 158.43756, 186.525613, 161.160047),\n (186.525613, 161.160047, 186.525613, 163.882534),\n (186.525613, 163.882534, 186.525613, 166.60502),\n (186.525613, 166.60502, 186.525613, 169.327507),\n (186.525613, 169.327507, 186.525613, 172.049994),\n (186.525613, 172.049994, 186.525613, 174.77248),\n (186.525613, 174.77248, 186.525613, 177.494967),\n (186.525613, 177.494967, 186.525613, 180.217454),\n (186.525613, 180.217454, 186.525613, 182.939941),\n (186.525613, 182.939941, 186.525613, 185.662427),\n (186.525613, 185.662427, 186.525613, 188.384914),\n (186.525613, 188.384914, 186.525613, 191.107401),\n (186.525613, 191.107401, 186.525613, 193.829888),\n (186.525613, 106.710312, 177.545188, 106.710312),\n (186.525613, 193.829888, 177.545188, 193.829888)\n]\nVISIBLE_CIRCLES = [\n (119.9854, 150.2701, 43.559788),\n (119.9854, 150.2701, 4.537478)\n]\nVISIBLE_ARCS = [\n\n]\nHIDDEN_SEGMENTS = [\n (124.5229, 92.7103, 124.5229, 83.7299),\n (115.448, 83.7299, 115.448, 92.7103),\n (186.5257, 154.8076, 177.5453, 154.8076),\n (186.5257, 145.7326, 177.5453, 145.7326)\n]\n# (orient, text, p1, p2, base) for linear; (orient, text, center, radius, angle) for diameter\nDIMENSIONS = [\n ('diameter', '%%c100', (119.9854, 150.2701), 43.5598, 45),\n ('diameter', '%%c10.4167', (119.9854, 150.2701), 4.5375, 135),\n ('horizontal', '10.3082', (177.5453, 150.2701), (186.5257, 150.2701), (182.0355, 161.2701))\n]\n\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\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\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,\n angle=(0 if d[0] == \"horizontal\" else 90),\n 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,\n text=text, dimstyle=\"EZDXF\").render()\n\n doc.saveas(out_path)\n\n\nif __name__ == \"__main__\":\n out = sys.argv[1] if len(sys.argv) > 1 else \"0063_00633134_gt.dxf\"\n draw(out)\n print(\"wrote\", out)\n```"}], "images": ["images/0063_00633134.png"], "id": "0063_00633134"} {"messages": [{"role": "user", "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 58.33 mm. It is extruded to a thickness of 250 mm."}, {"role": "assistant", "content": "```python\n#!/usr/bin/env python3\n# -*- coding: utf-8 -*-\n# Ground-truth 2D engineering drawing for part: 0065_00650953\n# Self-contained: reproduces the three-view DXF via ezdxf, NO FreeCAD needed.\n# Coordinates are A4 page millimetres (scale=0.2745714285714286, page=[297.0, 210.0]).\n# visible edges -> solid (layer OUTLINE); hidden edges -> dashed (layer HIDDEN)\n# dimensions -> real movable DIMENSION entities (text = true mm value)\n# Run: python 0065_00650953_gt.py [out.dxf]\nimport sys\nimport ezdxf\n\nSCALE = 0.2745714285714286\nPAGE = [297.0, 210.0]\n\nVISIBLE_SEGMENTS = [\n (110.472871, 68.814271, 109.614836, 68.814271),\n (109.614836, 68.814271, 108.7568, 68.814271),\n (108.7568, 68.814271, 107.898764, 68.814271),\n (107.898764, 68.814271, 107.040729, 68.814271),\n (107.040729, 68.814271, 106.182693, 68.814271),\n (106.182693, 68.814271, 105.324657, 68.814271),\n (105.324657, 68.814271, 104.466621, 68.814271),\n (104.466621, 68.814271, 103.608586, 68.814271),\n (103.608586, 68.814271, 102.75055, 68.814271),\n (102.75055, 68.814271, 101.892514, 68.814271),\n (101.892514, 68.814271, 101.034479, 68.814271),\n (101.034479, 68.814271, 100.176443, 68.814271),\n (100.176443, 68.814271, 99.318407, 68.814271),\n (99.318407, 68.814271, 98.460371, 68.814271),\n (98.460371, 68.814271, 97.602336, 68.814271),\n (97.602336, 68.814271, 96.7443, 68.814271),\n (96.7443, 68.814271, 95.886264, 68.814271),\n (95.886264, 68.814271, 95.028229, 68.814271),\n (95.028229, 68.814271, 94.170193, 68.814271),\n (94.170193, 68.814271, 93.312157, 68.814271),\n (93.312157, 68.814271, 92.454121, 68.814271),\n (92.454121, 68.814271, 91.596086, 68.814271),\n (91.596086, 68.814271, 90.73805, 68.814271),\n (90.73805, 68.814271, 89.880014, 68.814271),\n (89.880014, 68.814271, 89.021979, 68.814271),\n (89.021979, 68.814271, 88.163943, 68.814271),\n (88.163943, 68.814271, 87.305907, 68.814271),\n (87.305907, 68.814271, 86.447871, 68.814271),\n (86.447871, 68.814271, 85.589836, 68.814271),\n (85.589836, 68.814271, 84.7318, 68.814271),\n (84.7318, 68.814271, 83.873764, 68.814271),\n (83.873764, 68.814271, 83.015729, 68.814271),\n (110.472871, 68.814271, 110.472871, 137.457128),\n (110.472871, 137.457128, 109.614836, 137.457128),\n (109.614836, 137.457128, 108.7568, 137.457128),\n (108.7568, 137.457128, 107.898764, 137.457128),\n (107.898764, 137.457128, 107.040729, 137.457128),\n (107.040729, 137.457128, 106.182693, 137.457128),\n (106.182693, 137.457128, 105.324657, 137.457128),\n (105.324657, 137.457128, 104.466621, 137.457128),\n (104.466621, 137.457128, 103.608586, 137.457128),\n (103.608586, 137.457128, 102.75055, 137.457128),\n (102.75055, 137.457128, 101.892514, 137.457128),\n (101.892514, 137.457128, 101.034479, 137.457128),\n (101.034479, 137.457128, 100.176443, 137.457128),\n (100.176443, 137.457128, 99.318407, 137.457128),\n (99.318407, 137.457128, 98.460371, 137.457128),\n (98.460371, 137.457128, 97.602336, 137.457128),\n (97.602336, 137.457128, 96.7443, 137.457128),\n (96.7443, 137.457128, 95.886264, 137.457128),\n (95.886264, 137.457128, 95.028229, 137.457128),\n (95.028229, 137.457128, 94.170193, 137.457128),\n (94.170193, 137.457128, 93.312157, 137.457128),\n (93.312157, 137.457128, 92.454121, 137.457128),\n (92.454121, 137.457128, 91.596086, 137.457128),\n (91.596086, 137.457128, 90.73805, 137.457128),\n (90.73805, 137.457128, 89.880014, 137.457128),\n (89.880014, 137.457128, 89.021979, 137.457128),\n (89.021979, 137.457128, 88.163943, 137.457128),\n (88.163943, 137.457128, 87.305907, 137.457128),\n (87.305907, 137.457128, 86.447871, 137.457128),\n (86.447871, 137.457128, 85.589836, 137.457128),\n (85.589836, 137.457128, 84.7318, 137.457128),\n (84.7318, 137.457128, 83.873764, 137.457128),\n (83.873764, 137.457128, 83.015729, 137.457128),\n (83.015729, 137.457128, 83.015729, 68.814271),\n (124.472872, 151.457129, 124.472872, 152.315164),\n (124.472872, 152.315164, 124.472872, 153.1732),\n (124.472872, 153.1732, 124.472872, 154.031236),\n (124.472872, 154.031236, 124.472872, 154.889271),\n (124.472872, 154.889271, 124.472872, 155.747307),\n (124.472872, 155.747307, 124.472872, 156.605343),\n (124.472872, 156.605343, 124.472872, 157.463379),\n (124.472872, 157.463379, 124.472872, 158.321414),\n (124.472872, 158.321414, 124.472872, 159.17945),\n (124.472872, 159.17945, 124.472872, 160.037486),\n (124.472872, 160.037486, 124.472872, 160.895521),\n (124.472872, 160.895521, 124.472872, 161.753557),\n (124.472872, 161.753557, 124.472872, 162.611593),\n (124.472872, 162.611593, 124.472872, 163.469629),\n (124.472872, 163.469629, 124.472872, 164.327664),\n (124.472872, 164.327664, 124.472872, 165.1857),\n (124.472872, 165.1857, 124.472872, 166.043736),\n (124.472872, 166.043736, 124.472872, 166.901771),\n (124.472872, 166.901771, 124.472872, 167.759807),\n (124.472872, 167.759807, 124.472872, 168.617843),\n (124.472872, 168.617843, 124.472872, 169.475879),\n (124.472872, 169.475879, 124.472872, 170.333914),\n (124.472872, 170.333914, 124.472872, 171.19195),\n (124.472872, 171.19195, 124.472872, 172.049986),\n (124.472872, 172.049986, 124.472872, 172.908021),\n (124.472872, 172.908021, 124.472872, 173.766057),\n (124.472872, 173.766057, 124.472872, 174.624093),\n (124.472872, 174.624093, 124.472872, 175.482129),\n (124.472872, 175.482129, 124.472872, 176.340164),\n (124.472872, 176.340164, 124.472872, 177.1982),\n (124.472872, 177.1982, 124.472872, 178.056236),\n (124.472872, 178.056236, 124.472872, 178.914271),\n (193.115729, 151.457129, 193.115729, 152.315164),\n (193.115729, 152.315164, 193.115729, 153.1732),\n (193.115729, 153.1732, 193.115729, 154.031236),\n (193.115729, 154.031236, 193.115729, 154.889271),\n (193.115729, 154.889271, 193.115729, 155.747307),\n (193.115729, 155.747307, 193.115729, 156.605343),\n (193.115729, 156.605343, 193.115729, 157.463379),\n (193.115729, 157.463379, 193.115729, 158.321414),\n (193.115729, 158.321414, 193.115729, 159.17945),\n (193.115729, 159.17945, 193.115729, 160.037486),\n (193.115729, 160.037486, 193.115729, 160.895521),\n (193.115729, 160.895521, 193.115729, 161.753557),\n (193.115729, 161.753557, 193.115729, 162.611593),\n (193.115729, 162.611593, 193.115729, 163.469629),\n (193.115729, 163.469629, 193.115729, 164.327664),\n (193.115729, 164.327664, 193.115729, 165.1857),\n (193.115729, 165.1857, 193.115729, 166.043736),\n (193.115729, 166.043736, 193.115729, 166.901771),\n (193.115729, 166.901771, 193.115729, 167.759807),\n (193.115729, 167.759807, 193.115729, 168.617843),\n (193.115729, 168.617843, 193.115729, 169.475879),\n (193.115729, 169.475879, 193.115729, 170.333914),\n (193.115729, 170.333914, 193.115729, 171.19195),\n (193.115729, 171.19195, 193.115729, 172.049986),\n (193.115729, 172.049986, 193.115729, 172.908021),\n (193.115729, 172.908021, 193.115729, 173.766057),\n (193.115729, 173.766057, 193.115729, 174.624093),\n (193.115729, 174.624093, 193.115729, 175.482129),\n (193.115729, 175.482129, 193.115729, 176.340164),\n (193.115729, 176.340164, 193.115729, 177.1982),\n (193.115729, 177.1982, 193.115729, 178.056236),\n (193.115729, 178.056236, 193.115729, 178.914271),\n (193.115729, 151.457129, 124.472872, 151.457129),\n (193.115729, 178.914271, 124.472872, 178.914271)\n]\nVISIBLE_CIRCLES = [\n (96.7443, 165.1857, 13.728571),\n (96.7443, 165.1857, 8.008333)\n]\nVISIBLE_ARCS = [\n\n]\nHIDDEN_SEGMENTS = [\n (104.7527, 137.4571, 104.7527, 68.8143),\n (88.736, 68.8143, 88.736, 137.4571),\n (193.1158, 173.194, 124.4729, 173.194),\n (193.1158, 157.1774, 124.4729, 157.1774)\n]\n# (orient, text, p1, p2, base) for linear; (orient, text, center, radius, angle) for diameter\nDIMENSIONS = [\n ('diameter', '%%c100', (96.7443, 165.1857), 13.7286, 45),\n ('diameter', '%%c58.3333', (96.7443, 165.1857), 8.0083, 135),\n ('horizontal', '250', (124.4729, 165.1857), (193.1158, 165.1857), (158.7943, 176.1857))\n]\n\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\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\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,\n angle=(0 if d[0] == \"horizontal\" else 90),\n 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,\n text=text, dimstyle=\"EZDXF\").render()\n\n doc.saveas(out_path)\n\n\nif __name__ == \"__main__\":\n out = sys.argv[1] if len(sys.argv) > 1 else \"0065_00650953_gt.dxf\"\n draw(out)\n print(\"wrote\", out)\n```"}], "images": ["images/0065_00650953.png"], "id": "0065_00650953"} {"messages": [{"role": "user", "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": "assistant", "content": "```python\n#!/usr/bin/env python3\n# -*- coding: utf-8 -*-\n# Ground-truth 2D engineering drawing for part: 0067_00671712\n# Self-contained: reproduces the three-view DXF via ezdxf, NO FreeCAD needed.\n# Coordinates are A4 page millimetres (scale=0.8752854672135206, page=[297.0, 210.0]).\n# visible edges -> solid (layer OUTLINE); hidden edges -> dashed (layer HIDDEN)\n# dimensions -> real movable DIMENSION entities (text = true mm value)\n# Run: python 0067_00671712_gt.py [out.dxf]\nimport sys\nimport ezdxf\n\nSCALE = 0.8752854672135206\nPAGE = [297.0, 210.0]\n\nVISIBLE_SEGMENTS = [\n (159.338973, 83.832173, 156.603706, 83.832173),\n (156.603706, 83.832173, 153.868439, 83.832173),\n (153.868439, 83.832173, 151.133172, 83.832173),\n (151.133172, 83.832173, 148.397905, 83.832173),\n (148.397905, 83.832173, 145.662638, 83.832173),\n (145.662638, 83.832173, 142.927371, 83.832173),\n (142.927371, 83.832173, 140.192104, 83.832173),\n (140.192104, 83.832173, 137.456837, 83.832173),\n (137.456837, 83.832173, 134.72157, 83.832173),\n (134.72157, 83.832173, 131.986303, 83.832173),\n (131.986303, 83.832173, 129.251035, 83.832173),\n (129.251035, 83.832173, 126.515768, 83.832173),\n (126.515768, 83.832173, 123.780501, 83.832173),\n (123.780501, 83.832173, 121.045234, 83.832173),\n (121.045234, 83.832173, 118.309967, 83.832173),\n (118.309967, 83.832173, 115.5747, 83.832173),\n (115.5747, 83.832173, 112.839433, 83.832173),\n (112.839433, 83.832173, 110.104166, 83.832173),\n (110.104166, 83.832173, 107.368899, 83.832173),\n (107.368899, 83.832173, 104.633632, 83.832173),\n (104.633632, 83.832173, 101.898365, 83.832173),\n (101.898365, 83.832173, 99.163097, 83.832173),\n (99.163097, 83.832173, 96.42783, 83.832173),\n (96.42783, 83.832173, 93.692563, 83.832173),\n (93.692563, 83.832173, 90.957296, 83.832173),\n (90.957296, 83.832173, 88.222029, 83.832173),\n (88.222029, 83.832173, 85.486762, 83.832173),\n (85.486762, 83.832173, 82.751495, 83.832173),\n (82.751495, 83.832173, 80.016228, 83.832173),\n (80.016228, 83.832173, 77.280961, 83.832173),\n (77.280961, 83.832173, 74.545694, 83.832173),\n (74.545694, 83.832173, 71.810427, 83.832173),\n (159.338973, 83.832173, 159.338973, 92.403626),\n (159.338973, 92.403626, 156.603706, 92.403626),\n (156.603706, 92.403626, 153.868439, 92.403626),\n (153.868439, 92.403626, 151.133172, 92.403626),\n (151.133172, 92.403626, 148.397905, 92.403626),\n (148.397905, 92.403626, 145.662638, 92.403626),\n (145.662638, 92.403626, 142.927371, 92.403626),\n (142.927371, 92.403626, 140.192104, 92.403626),\n (140.192104, 92.403626, 137.456837, 92.403626),\n (137.456837, 92.403626, 134.72157, 92.403626),\n (134.72157, 92.403626, 131.986303, 92.403626),\n (131.986303, 92.403626, 129.251035, 92.403626),\n (129.251035, 92.403626, 126.515768, 92.403626),\n (126.515768, 92.403626, 123.780501, 92.403626),\n (123.780501, 92.403626, 121.045234, 92.403626),\n (121.045234, 92.403626, 118.309967, 92.403626),\n (118.309967, 92.403626, 115.5747, 92.403626),\n (115.5747, 92.403626, 112.839433, 92.403626),\n (112.839433, 92.403626, 110.104166, 92.403626),\n (110.104166, 92.403626, 107.368899, 92.403626),\n (107.368899, 92.403626, 104.633632, 92.403626),\n (104.633632, 92.403626, 101.898365, 92.403626),\n (101.898365, 92.403626, 99.163097, 92.403626),\n (99.163097, 92.403626, 96.42783, 92.403626),\n (96.42783, 92.403626, 93.692563, 92.403626),\n (93.692563, 92.403626, 90.957296, 92.403626),\n (90.957296, 92.403626, 88.222029, 92.403626),\n (88.222029, 92.403626, 85.486762, 92.403626),\n (85.486762, 92.403626, 82.751495, 92.403626),\n (82.751495, 92.403626, 80.016228, 92.403626),\n (80.016228, 92.403626, 77.280961, 92.403626),\n (77.280961, 92.403626, 74.545694, 92.403626),\n (74.545694, 92.403626, 71.810427, 92.403626),\n (71.810427, 92.403626, 71.810427, 83.832173),\n (173.338974, 106.403627, 173.338974, 109.138894),\n (173.338974, 109.138894, 173.338974, 111.874161),\n (173.338974, 111.874161, 173.338974, 114.609428),\n (173.338974, 114.609428, 173.338974, 117.344695),\n (173.338974, 117.344695, 173.338974, 120.079962),\n (173.338974, 120.079962, 173.338974, 122.815229),\n (173.338974, 122.815229, 173.338974, 125.550496),\n (173.338974, 125.550496, 173.338974, 128.285763),\n (173.338974, 128.285763, 173.338974, 131.02103),\n (173.338974, 131.02103, 173.338974, 133.756297),\n (173.338974, 133.756297, 173.338974, 136.491565),\n (173.338974, 136.491565, 173.338974, 139.226832),\n (173.338974, 139.226832, 173.338974, 141.962099),\n (173.338974, 141.962099, 173.338974, 144.697366),\n (173.338974, 144.697366, 173.338974, 147.432633),\n (173.338974, 147.432633, 173.338974, 150.1679),\n (173.338974, 150.1679, 173.338974, 152.903167),\n (173.338974, 152.903167, 173.338974, 155.638434),\n (173.338974, 155.638434, 173.338974, 158.373701),\n (173.338974, 158.373701, 173.338974, 161.108968),\n (173.338974, 161.108968, 173.338974, 163.844235),\n (173.338974, 163.844235, 173.338974, 166.579503),\n (173.338974, 166.579503, 173.338974, 169.31477),\n (173.338974, 169.31477, 173.338974, 172.050037),\n (173.338974, 172.050037, 173.338974, 174.785304),\n (173.338974, 174.785304, 173.338974, 177.520571),\n (173.338974, 177.520571, 173.338974, 180.255838),\n (173.338974, 180.255838, 173.338974, 182.991105),\n (173.338974, 182.991105, 173.338974, 185.726372),\n (173.338974, 185.726372, 173.338974, 188.461639),\n (173.338974, 188.461639, 173.338974, 191.196906),\n (173.338974, 191.196906, 173.338974, 193.932173),\n (181.910427, 106.403627, 181.910427, 109.138894),\n (181.910427, 109.138894, 181.910427, 111.874161),\n (181.910427, 111.874161, 181.910427, 114.609428),\n (181.910427, 114.609428, 181.910427, 117.344695),\n (181.910427, 117.344695, 181.910427, 120.079962),\n (181.910427, 120.079962, 181.910427, 122.815229),\n (181.910427, 122.815229, 181.910427, 125.550496),\n (181.910427, 125.550496, 181.910427, 128.285763),\n (181.910427, 128.285763, 181.910427, 131.02103),\n (181.910427, 131.02103, 181.910427, 133.756297),\n (181.910427, 133.756297, 181.910427, 136.491565),\n (181.910427, 136.491565, 181.910427, 139.226832),\n (181.910427, 139.226832, 181.910427, 141.962099),\n (181.910427, 141.962099, 181.910427, 144.697366),\n (181.910427, 144.697366, 181.910427, 147.432633),\n (181.910427, 147.432633, 181.910427, 150.1679),\n (181.910427, 150.1679, 181.910427, 152.903167),\n (181.910427, 152.903167, 181.910427, 155.638434),\n (181.910427, 155.638434, 181.910427, 158.373701),\n (181.910427, 158.373701, 181.910427, 161.108968),\n (181.910427, 161.108968, 181.910427, 163.844235),\n (181.910427, 163.844235, 181.910427, 166.579503),\n (181.910427, 166.579503, 181.910427, 169.31477),\n (181.910427, 169.31477, 181.910427, 172.050037),\n (181.910427, 172.050037, 181.910427, 174.785304),\n (181.910427, 174.785304, 181.910427, 177.520571),\n (181.910427, 177.520571, 181.910427, 180.255838),\n (181.910427, 180.255838, 181.910427, 182.991105),\n (181.910427, 182.991105, 181.910427, 185.726372),\n (181.910427, 185.726372, 181.910427, 188.461639),\n (181.910427, 188.461639, 181.910427, 191.196906),\n (181.910427, 191.196906, 181.910427, 193.932173),\n (181.910427, 106.403627, 173.338974, 106.403627),\n (181.910427, 193.932173, 173.338974, 193.932173)\n]\nVISIBLE_CIRCLES = [\n (115.5747, 150.1679, 43.764273),\n (115.5747, 150.1679, 22.793892)\n]\nVISIBLE_ARCS = [\n\n]\nHIDDEN_SEGMENTS = [\n (138.3686, 92.4036, 138.3686, 83.8321),\n (92.7808, 83.8321, 92.7808, 92.4036),\n (181.9105, 172.9618, 173.339, 172.9618),\n (181.9105, 127.374, 173.339, 127.374)\n]\n# (orient, text, p1, p2, base) for linear; (orient, text, center, radius, angle) for diameter\nDIMENSIONS = [\n ('diameter', '%%c100', (115.5747, 150.1679), 43.7643, 45),\n ('diameter', '%%c52.0833', (115.5747, 150.1679), 22.7939, 135),\n ('horizontal', '9.7928', (173.339, 150.1679), (181.9105, 150.1679), (177.6248, 161.1679))\n]\n\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\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\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,\n angle=(0 if d[0] == \"horizontal\" else 90),\n 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,\n text=text, dimstyle=\"EZDXF\").render()\n\n doc.saveas(out_path)\n\n\nif __name__ == \"__main__\":\n out = sys.argv[1] if len(sys.argv) > 1 else \"0067_00671712_gt.dxf\"\n draw(out)\n print(\"wrote\", out)\n```"}], "images": ["images/0067_00671712.png"], "id": "0067_00671712"} {"messages": [{"role": "user", "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 15.55 mm."}, {"role": "assistant", "content": "```python\n#!/usr/bin/env python3\n# -*- coding: utf-8 -*-\n# Ground-truth 2D engineering drawing for part: 0067_00679787\n# Self-contained: reproduces the three-view DXF via ezdxf, NO FreeCAD needed.\n# Coordinates are A4 page millimetres (scale=0.7330474406991744, page=[297.0, 210.0]).\n# visible edges -> solid (layer OUTLINE); hidden edges -> dashed (layer HIDDEN)\n# dimensions -> real movable DIMENSION entities (text = true mm value)\n# Run: python 0067_00679787_gt.py [out.dxf]\nimport sys\nimport ezdxf\n\nSCALE = 0.7330474406991744\nPAGE = [297.0, 210.0]\n\nVISIBLE_SEGMENTS = [\n (149.277272, 91.6738, 149.277272, 103.071428),\n (149.277272, 103.071428, 146.986499, 103.071428),\n (146.986499, 103.071428, 144.695726, 103.071428),\n (144.695726, 103.071428, 142.404952, 103.071428),\n (142.404952, 103.071428, 140.114179, 103.071428),\n (140.114179, 103.071428, 137.823406, 103.071428),\n (137.823406, 103.071428, 135.532633, 103.071428),\n (135.532633, 103.071428, 133.241859, 103.071428),\n (133.241859, 103.071428, 130.951086, 103.071428),\n (130.951086, 103.071428, 128.660313, 103.071428),\n (128.660313, 103.071428, 126.36954, 103.071428),\n (126.36954, 103.071428, 124.078766, 103.071428),\n (124.078766, 103.071428, 121.787993, 103.071428),\n (121.787993, 103.071428, 119.49722, 103.071428),\n (119.49722, 103.071428, 117.206447, 103.071428),\n (117.206447, 103.071428, 114.915673, 103.071428),\n (114.915673, 103.071428, 112.6249, 103.071428),\n (112.6249, 103.071428, 110.334127, 103.071428),\n (110.334127, 103.071428, 108.043353, 103.071428),\n (108.043353, 103.071428, 105.75258, 103.071428),\n (105.75258, 103.071428, 103.461807, 103.071428),\n (103.461807, 103.071428, 101.171034, 103.071428),\n (101.171034, 103.071428, 98.88026, 103.071428),\n (98.88026, 103.071428, 96.589487, 103.071428),\n (96.589487, 103.071428, 94.298714, 103.071428),\n (94.298714, 103.071428, 92.007941, 103.071428),\n (92.007941, 103.071428, 89.717167, 103.071428),\n (89.717167, 103.071428, 87.426394, 103.071428),\n (87.426394, 103.071428, 85.135621, 103.071428),\n (85.135621, 103.071428, 82.844848, 103.071428),\n (82.844848, 103.071428, 80.554074, 103.071428),\n (80.554074, 103.071428, 78.263301, 103.071428),\n (78.263301, 103.071428, 75.972528, 103.071428),\n (149.277272, 91.6738, 149.277272, 80.276172),\n (149.277272, 80.276172, 146.986499, 80.276172),\n (146.986499, 80.276172, 144.695726, 80.276172),\n (144.695726, 80.276172, 142.404952, 80.276172),\n (142.404952, 80.276172, 140.114179, 80.276172),\n (140.114179, 80.276172, 137.823406, 80.276172),\n (137.823406, 80.276172, 135.532633, 80.276172),\n (135.532633, 80.276172, 133.241859, 80.276172),\n (133.241859, 80.276172, 130.951086, 80.276172),\n (130.951086, 80.276172, 128.660313, 80.276172),\n (128.660313, 80.276172, 126.36954, 80.276172),\n (126.36954, 80.276172, 124.078766, 80.276172),\n (124.078766, 80.276172, 121.787993, 80.276172),\n (121.787993, 80.276172, 119.49722, 80.276172),\n (119.49722, 80.276172, 117.206447, 80.276172),\n (117.206447, 80.276172, 114.915673, 80.276172),\n (114.915673, 80.276172, 112.6249, 80.276172),\n (112.6249, 80.276172, 110.334127, 80.276172),\n (110.334127, 80.276172, 108.043353, 80.276172),\n (108.043353, 80.276172, 105.75258, 80.276172),\n (105.75258, 80.276172, 103.461807, 80.276172),\n (103.461807, 80.276172, 101.171034, 80.276172),\n (101.171034, 80.276172, 98.88026, 80.276172),\n (98.88026, 80.276172, 96.589487, 80.276172),\n (96.589487, 80.276172, 94.298714, 80.276172),\n (94.298714, 80.276172, 92.007941, 80.276172),\n (92.007941, 80.276172, 89.717167, 80.276172),\n (89.717167, 80.276172, 87.426394, 80.276172),\n (87.426394, 80.276172, 85.135621, 80.276172),\n (85.135621, 80.276172, 82.844848, 80.276172),\n (82.844848, 80.276172, 80.554074, 80.276172),\n (80.554074, 80.276172, 78.263301, 80.276172),\n (78.263301, 80.276172, 75.972528, 80.276172),\n (75.972528, 103.071428, 75.972528, 91.6738),\n (75.972528, 80.276172, 75.972528, 91.6738),\n (186.072528, 117.071428, 186.072528, 119.362201),\n (186.072528, 119.362201, 186.072528, 121.652974),\n (186.072528, 121.652974, 186.072528, 123.943748),\n (186.072528, 123.943748, 186.072528, 126.234521),\n (186.072528, 126.234521, 186.072528, 128.525294),\n (186.072528, 128.525294, 186.072528, 130.816067),\n (186.072528, 130.816067, 186.072528, 133.106841),\n (186.072528, 133.106841, 186.072528, 135.397614),\n (186.072528, 135.397614, 186.072528, 137.688387),\n (186.072528, 137.688387, 186.072528, 139.97916),\n (186.072528, 139.97916, 186.072528, 142.269934),\n (186.072528, 142.269934, 186.072528, 144.560707),\n (186.072528, 144.560707, 186.072528, 146.85148),\n (186.072528, 146.85148, 186.072528, 149.142253),\n (186.072528, 149.142253, 186.072528, 151.433027),\n (186.072528, 151.433027, 186.072528, 153.7238),\n (186.072528, 153.7238, 186.072528, 156.014573),\n (186.072528, 156.014573, 186.072528, 158.305347),\n (186.072528, 158.305347, 186.072528, 160.59612),\n (186.072528, 160.59612, 186.072528, 162.886893),\n (186.072528, 162.886893, 186.072528, 165.177666),\n (186.072528, 165.177666, 186.072528, 167.46844),\n (186.072528, 167.46844, 186.072528, 169.759213),\n (186.072528, 169.759213, 186.072528, 172.049986),\n (186.072528, 172.049986, 186.072528, 174.340759),\n (186.072528, 174.340759, 186.072528, 176.631533),\n (186.072528, 176.631533, 186.072528, 178.922306),\n (186.072528, 178.922306, 186.072528, 181.213079),\n (186.072528, 181.213079, 186.072528, 183.503852),\n (186.072528, 183.503852, 186.072528, 185.794626),\n (186.072528, 185.794626, 186.072528, 188.085399),\n (186.072528, 188.085399, 186.072528, 190.376172),\n (163.277272, 117.071428, 163.277272, 119.362201),\n (163.277272, 119.362201, 163.277272, 121.652974),\n (163.277272, 121.652974, 163.277272, 123.943748),\n (163.277272, 123.943748, 163.277272, 126.234521),\n (163.277272, 126.234521, 163.277272, 128.525294),\n (163.277272, 128.525294, 163.277272, 130.816067),\n (163.277272, 130.816067, 163.277272, 133.106841),\n (163.277272, 133.106841, 163.277272, 135.397614),\n (163.277272, 135.397614, 163.277272, 137.688387),\n (163.277272, 137.688387, 163.277272, 139.97916),\n (163.277272, 139.97916, 163.277272, 142.269934),\n (163.277272, 142.269934, 163.277272, 144.560707),\n (163.277272, 144.560707, 163.277272, 146.85148),\n (163.277272, 146.85148, 163.277272, 149.142253),\n (163.277272, 149.142253, 163.277272, 151.433027),\n (163.277272, 151.433027, 163.277272, 153.7238),\n (163.277272, 153.7238, 163.277272, 156.014573),\n (163.277272, 156.014573, 163.277272, 158.305347),\n (163.277272, 158.305347, 163.277272, 160.59612),\n (163.277272, 160.59612, 163.277272, 162.886893),\n (163.277272, 162.886893, 163.277272, 165.177666),\n (163.277272, 165.177666, 163.277272, 167.46844),\n (163.277272, 167.46844, 163.277272, 169.759213),\n (163.277272, 169.759213, 163.277272, 172.049986),\n (163.277272, 172.049986, 163.277272, 174.340759),\n (163.277272, 174.340759, 163.277272, 176.631533),\n (163.277272, 176.631533, 163.277272, 178.922306),\n (163.277272, 178.922306, 163.277272, 181.213079),\n (163.277272, 181.213079, 163.277272, 183.503852),\n (163.277272, 183.503852, 163.277272, 185.794626),\n (163.277272, 185.794626, 163.277272, 188.085399),\n (163.277272, 188.085399, 163.277272, 190.376172),\n (186.072528, 117.071428, 174.6749, 117.071428),\n (186.072528, 190.376172, 174.6749, 190.376172),\n (163.277272, 190.376172, 174.6749, 190.376172),\n (163.277272, 117.071428, 174.6749, 117.071428)\n]\nVISIBLE_CIRCLES = [\n (112.6249, 153.7238, 36.652372),\n (112.6249, 153.7238, 13.257241)\n]\nVISIBLE_ARCS = [\n\n]\nHIDDEN_SEGMENTS = [\n (125.8822, 91.6738, 125.8822, 80.2762),\n (125.8822, 91.6738, 125.8822, 103.0714),\n (99.3677, 80.2762, 99.3677, 91.6738),\n (99.3677, 103.0714, 99.3677, 91.6738),\n (186.0726, 166.9811, 174.675, 166.9811),\n (186.0726, 140.4666, 174.675, 140.4666),\n (163.2773, 140.4666, 174.675, 140.4666),\n (163.2773, 166.9811, 174.675, 166.9811)\n]\n# (orient, text, p1, p2, base) for linear; (orient, text, center, radius, angle) for diameter\nDIMENSIONS = [\n ('diameter', '%%c100', (112.6249, 153.7238), 36.6524, 45),\n ('diameter', '%%c36.1702', (112.6249, 153.7238), 13.2572, 135),\n ('horizontal', '31.0966', (163.2773, 153.7238), (186.0726, 153.7238), (174.675, 164.7238))\n]\n\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\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\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,\n angle=(0 if d[0] == \"horizontal\" else 90),\n 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,\n text=text, dimstyle=\"EZDXF\").render()\n\n doc.saveas(out_path)\n\n\nif __name__ == \"__main__\":\n out = sys.argv[1] if len(sys.argv) > 1 else \"0067_00679787_gt.dxf\"\n draw(out)\n print(\"wrote\", out)\n```"}], "images": ["images/0067_00679787.png"], "id": "0067_00679787"} {"messages": [{"role": "user", "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": "assistant", "content": "```python\n#!/usr/bin/env python3\n# -*- coding: utf-8 -*-\n# Ground-truth 2D engineering drawing for part: 0068_00683481\n# Self-contained: reproduces the three-view DXF via ezdxf, NO FreeCAD needed.\n# Coordinates are A4 page millimetres (scale=0.8752854672135206, page=[297.0, 210.0]).\n# visible edges -> solid (layer OUTLINE); hidden edges -> dashed (layer HIDDEN)\n# dimensions -> real movable DIMENSION entities (text = true mm value)\n# Run: python 0068_00683481_gt.py [out.dxf]\nimport sys\nimport ezdxf\n\nSCALE = 0.8752854672135206\nPAGE = [297.0, 210.0]\n\nVISIBLE_SEGMENTS = [\n (159.338973, 83.832173, 156.603706, 83.832173),\n (156.603706, 83.832173, 153.868439, 83.832173),\n (153.868439, 83.832173, 151.133172, 83.832173),\n (151.133172, 83.832173, 148.397905, 83.832173),\n (148.397905, 83.832173, 145.662638, 83.832173),\n (145.662638, 83.832173, 142.927371, 83.832173),\n (142.927371, 83.832173, 140.192104, 83.832173),\n (140.192104, 83.832173, 137.456837, 83.832173),\n (137.456837, 83.832173, 134.72157, 83.832173),\n (134.72157, 83.832173, 131.986303, 83.832173),\n (131.986303, 83.832173, 129.251035, 83.832173),\n (129.251035, 83.832173, 126.515768, 83.832173),\n (126.515768, 83.832173, 123.780501, 83.832173),\n (123.780501, 83.832173, 121.045234, 83.832173),\n (121.045234, 83.832173, 118.309967, 83.832173),\n (118.309967, 83.832173, 115.5747, 83.832173),\n (115.5747, 83.832173, 112.839433, 83.832173),\n (112.839433, 83.832173, 110.104166, 83.832173),\n (110.104166, 83.832173, 107.368899, 83.832173),\n (107.368899, 83.832173, 104.633632, 83.832173),\n (104.633632, 83.832173, 101.898365, 83.832173),\n (101.898365, 83.832173, 99.163097, 83.832173),\n (99.163097, 83.832173, 96.42783, 83.832173),\n (96.42783, 83.832173, 93.692563, 83.832173),\n (93.692563, 83.832173, 90.957296, 83.832173),\n (90.957296, 83.832173, 88.222029, 83.832173),\n (88.222029, 83.832173, 85.486762, 83.832173),\n (85.486762, 83.832173, 82.751495, 83.832173),\n (82.751495, 83.832173, 80.016228, 83.832173),\n (80.016228, 83.832173, 77.280961, 83.832173),\n (77.280961, 83.832173, 74.545694, 83.832173),\n (74.545694, 83.832173, 71.810427, 83.832173),\n (159.338973, 83.832173, 159.338973, 92.403626),\n (159.338973, 92.403626, 156.603706, 92.403626),\n (156.603706, 92.403626, 153.868439, 92.403626),\n (153.868439, 92.403626, 151.133172, 92.403626),\n (151.133172, 92.403626, 148.397905, 92.403626),\n (148.397905, 92.403626, 145.662638, 92.403626),\n (145.662638, 92.403626, 142.927371, 92.403626),\n (142.927371, 92.403626, 140.192104, 92.403626),\n (140.192104, 92.403626, 137.456837, 92.403626),\n (137.456837, 92.403626, 134.72157, 92.403626),\n (134.72157, 92.403626, 131.986303, 92.403626),\n (131.986303, 92.403626, 129.251035, 92.403626),\n (129.251035, 92.403626, 126.515768, 92.403626),\n (126.515768, 92.403626, 123.780501, 92.403626),\n (123.780501, 92.403626, 121.045234, 92.403626),\n (121.045234, 92.403626, 118.309967, 92.403626),\n (118.309967, 92.403626, 115.5747, 92.403626),\n (115.5747, 92.403626, 112.839433, 92.403626),\n (112.839433, 92.403626, 110.104166, 92.403626),\n (110.104166, 92.403626, 107.368899, 92.403626),\n (107.368899, 92.403626, 104.633632, 92.403626),\n (104.633632, 92.403626, 101.898365, 92.403626),\n (101.898365, 92.403626, 99.163097, 92.403626),\n (99.163097, 92.403626, 96.42783, 92.403626),\n (96.42783, 92.403626, 93.692563, 92.403626),\n (93.692563, 92.403626, 90.957296, 92.403626),\n (90.957296, 92.403626, 88.222029, 92.403626),\n (88.222029, 92.403626, 85.486762, 92.403626),\n (85.486762, 92.403626, 82.751495, 92.403626),\n (82.751495, 92.403626, 80.016228, 92.403626),\n (80.016228, 92.403626, 77.280961, 92.403626),\n (77.280961, 92.403626, 74.545694, 92.403626),\n (74.545694, 92.403626, 71.810427, 92.403626),\n (71.810427, 92.403626, 71.810427, 83.832173),\n (173.338974, 106.403627, 173.338974, 109.138894),\n (173.338974, 109.138894, 173.338974, 111.874161),\n (173.338974, 111.874161, 173.338974, 114.609428),\n (173.338974, 114.609428, 173.338974, 117.344695),\n (173.338974, 117.344695, 173.338974, 120.079962),\n (173.338974, 120.079962, 173.338974, 122.815229),\n (173.338974, 122.815229, 173.338974, 125.550496),\n (173.338974, 125.550496, 173.338974, 128.285763),\n (173.338974, 128.285763, 173.338974, 131.02103),\n (173.338974, 131.02103, 173.338974, 133.756297),\n (173.338974, 133.756297, 173.338974, 136.491565),\n (173.338974, 136.491565, 173.338974, 139.226832),\n (173.338974, 139.226832, 173.338974, 141.962099),\n (173.338974, 141.962099, 173.338974, 144.697366),\n (173.338974, 144.697366, 173.338974, 147.432633),\n (173.338974, 147.432633, 173.338974, 150.1679),\n (173.338974, 150.1679, 173.338974, 152.903167),\n (173.338974, 152.903167, 173.338974, 155.638434),\n (173.338974, 155.638434, 173.338974, 158.373701),\n (173.338974, 158.373701, 173.338974, 161.108968),\n (173.338974, 161.108968, 173.338974, 163.844235),\n (173.338974, 163.844235, 173.338974, 166.579503),\n (173.338974, 166.579503, 173.338974, 169.31477),\n (173.338974, 169.31477, 173.338974, 172.050037),\n (173.338974, 172.050037, 173.338974, 174.785304),\n (173.338974, 174.785304, 173.338974, 177.520571),\n (173.338974, 177.520571, 173.338974, 180.255838),\n (173.338974, 180.255838, 173.338974, 182.991105),\n (173.338974, 182.991105, 173.338974, 185.726372),\n (173.338974, 185.726372, 173.338974, 188.461639),\n (173.338974, 188.461639, 173.338974, 191.196906),\n (173.338974, 191.196906, 173.338974, 193.932173),\n (181.910427, 106.403627, 181.910427, 109.138894),\n (181.910427, 109.138894, 181.910427, 111.874161),\n (181.910427, 111.874161, 181.910427, 114.609428),\n (181.910427, 114.609428, 181.910427, 117.344695),\n (181.910427, 117.344695, 181.910427, 120.079962),\n (181.910427, 120.079962, 181.910427, 122.815229),\n (181.910427, 122.815229, 181.910427, 125.550496),\n (181.910427, 125.550496, 181.910427, 128.285763),\n (181.910427, 128.285763, 181.910427, 131.02103),\n (181.910427, 131.02103, 181.910427, 133.756297),\n (181.910427, 133.756297, 181.910427, 136.491565),\n (181.910427, 136.491565, 181.910427, 139.226832),\n (181.910427, 139.226832, 181.910427, 141.962099),\n (181.910427, 141.962099, 181.910427, 144.697366),\n (181.910427, 144.697366, 181.910427, 147.432633),\n (181.910427, 147.432633, 181.910427, 150.1679),\n (181.910427, 150.1679, 181.910427, 152.903167),\n (181.910427, 152.903167, 181.910427, 155.638434),\n (181.910427, 155.638434, 181.910427, 158.373701),\n (181.910427, 158.373701, 181.910427, 161.108968),\n (181.910427, 161.108968, 181.910427, 163.844235),\n (181.910427, 163.844235, 181.910427, 166.579503),\n (181.910427, 166.579503, 181.910427, 169.31477),\n (181.910427, 169.31477, 181.910427, 172.050037),\n (181.910427, 172.050037, 181.910427, 174.785304),\n (181.910427, 174.785304, 181.910427, 177.520571),\n (181.910427, 177.520571, 181.910427, 180.255838),\n (181.910427, 180.255838, 181.910427, 182.991105),\n (181.910427, 182.991105, 181.910427, 185.726372),\n (181.910427, 185.726372, 181.910427, 188.461639),\n (181.910427, 188.461639, 181.910427, 191.196906),\n (181.910427, 191.196906, 181.910427, 193.932173),\n (181.910427, 106.403627, 173.338974, 106.403627),\n (181.910427, 193.932173, 173.338974, 193.932173)\n]\nVISIBLE_CIRCLES = [\n (115.5747, 150.1679, 43.764273),\n (115.5747, 150.1679, 22.793892)\n]\nVISIBLE_ARCS = [\n\n]\nHIDDEN_SEGMENTS = [\n (138.3686, 92.4036, 138.3686, 83.8321),\n (92.7808, 83.8321, 92.7808, 92.4036),\n (181.9105, 172.9618, 173.339, 172.9618),\n (181.9105, 127.374, 173.339, 127.374)\n]\n# (orient, text, p1, p2, base) for linear; (orient, text, center, radius, angle) for diameter\nDIMENSIONS = [\n ('diameter', '%%c100', (115.5747, 150.1679), 43.7643, 45),\n ('diameter', '%%c52.0833', (115.5747, 150.1679), 22.7939, 135),\n ('horizontal', '9.7928', (173.339, 150.1679), (181.9105, 150.1679), (177.6248, 161.1679))\n]\n\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\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\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,\n angle=(0 if d[0] == \"horizontal\" else 90),\n 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,\n text=text, dimstyle=\"EZDXF\").render()\n\n doc.saveas(out_path)\n\n\nif __name__ == \"__main__\":\n out = sys.argv[1] if len(sys.argv) > 1 else \"0068_00683481_gt.dxf\"\n draw(out)\n print(\"wrote\", out)\n```"}], "images": ["images/0068_00683481.png"], "id": "0068_00683481"} {"messages": [{"role": "user", "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 593.75 mm."}, {"role": "assistant", "content": "```python\n#!/usr/bin/env python3\n# -*- coding: utf-8 -*-\n# Ground-truth 2D engineering drawing for part: 0071_00715298\n# Self-contained: reproduces the three-view DXF via ezdxf, NO FreeCAD needed.\n# Coordinates are A4 page millimetres (scale=0.1385225225225225, page=[297.0, 210.0]).\n# visible edges -> solid (layer OUTLINE); hidden edges -> dashed (layer HIDDEN)\n# dimensions -> real movable DIMENSION entities (text = true mm value)\n# Run: python 0071_00715298_gt.py [out.dxf]\nimport sys\nimport ezdxf\n\nSCALE = 0.1385225225225225\nPAGE = [297.0, 210.0]\n\nVISIBLE_SEGMENTS = [\n (85.347674, 147.660774, 85.780557, 147.660774),\n (85.780557, 147.660774, 86.21344, 147.660774),\n (86.21344, 147.660774, 86.646323, 147.660774),\n (86.646323, 147.660774, 87.079205, 147.660774),\n (87.079205, 147.660774, 87.512088, 147.660774),\n (87.512088, 147.660774, 87.944971, 147.660774),\n (87.944971, 147.660774, 88.377854, 147.660774),\n (88.377854, 147.660774, 88.810737, 147.660774),\n (88.810737, 147.660774, 89.24362, 147.660774),\n (89.24362, 147.660774, 89.676503, 147.660774),\n (89.676503, 147.660774, 90.109386, 147.660774),\n (90.109386, 147.660774, 90.542268, 147.660774),\n (90.542268, 147.660774, 90.975151, 147.660774),\n (90.975151, 147.660774, 91.408034, 147.660774),\n (91.408034, 147.660774, 91.840917, 147.660774),\n (91.840917, 147.660774, 92.2738, 147.660774),\n (92.2738, 147.660774, 92.706683, 147.660774),\n (92.706683, 147.660774, 93.139566, 147.660774),\n (93.139566, 147.660774, 93.572449, 147.660774),\n (93.572449, 147.660774, 94.005332, 147.660774),\n (94.005332, 147.660774, 94.438214, 147.660774),\n (94.438214, 147.660774, 94.871097, 147.660774),\n (94.871097, 147.660774, 95.30398, 147.660774),\n (95.30398, 147.660774, 95.736863, 147.660774),\n (95.736863, 147.660774, 96.169746, 147.660774),\n (96.169746, 147.660774, 96.602629, 147.660774),\n (96.602629, 147.660774, 97.035512, 147.660774),\n (97.035512, 147.660774, 97.468395, 147.660774),\n (97.468395, 147.660774, 97.901277, 147.660774),\n (97.901277, 147.660774, 98.33416, 147.660774),\n (98.33416, 147.660774, 98.767043, 147.660774),\n (98.767043, 147.660774, 99.199926, 147.660774),\n (99.199926, 147.660774, 99.199926, 65.413026),\n (85.347674, 65.413026, 85.780557, 65.413026),\n (85.780557, 65.413026, 86.21344, 65.413026),\n (86.21344, 65.413026, 86.646323, 65.413026),\n (86.646323, 65.413026, 87.079205, 65.413026),\n (87.079205, 65.413026, 87.512088, 65.413026),\n (87.512088, 65.413026, 87.944971, 65.413026),\n (87.944971, 65.413026, 88.377854, 65.413026),\n (88.377854, 65.413026, 88.810737, 65.413026),\n (88.810737, 65.413026, 89.24362, 65.413026),\n (89.24362, 65.413026, 89.676503, 65.413026),\n (89.676503, 65.413026, 90.109386, 65.413026),\n (90.109386, 65.413026, 90.542268, 65.413026),\n (90.542268, 65.413026, 90.975151, 65.413026),\n (90.975151, 65.413026, 91.408034, 65.413026),\n (91.408034, 65.413026, 91.840917, 65.413026),\n (91.840917, 65.413026, 92.2738, 65.413026),\n (92.2738, 65.413026, 92.706683, 65.413026),\n (92.706683, 65.413026, 93.139566, 65.413026),\n (93.139566, 65.413026, 93.572449, 65.413026),\n (93.572449, 65.413026, 94.005332, 65.413026),\n (94.005332, 65.413026, 94.438214, 65.413026),\n (94.438214, 65.413026, 94.871097, 65.413026),\n (94.871097, 65.413026, 95.30398, 65.413026),\n (95.30398, 65.413026, 95.736863, 65.413026),\n (95.736863, 65.413026, 96.169746, 65.413026),\n (96.169746, 65.413026, 96.602629, 65.413026),\n (96.602629, 65.413026, 97.035512, 65.413026),\n (97.035512, 65.413026, 97.468395, 65.413026),\n (97.468395, 65.413026, 97.901277, 65.413026),\n (97.901277, 65.413026, 98.33416, 65.413026),\n (98.33416, 65.413026, 98.767043, 65.413026),\n (98.767043, 65.413026, 99.199926, 65.413026),\n (85.347674, 65.413026, 85.347674, 147.660774),\n (195.447674, 175.513026, 195.447674, 175.080143),\n (195.447674, 175.080143, 195.447674, 174.64726),\n (195.447674, 174.64726, 195.447674, 174.214377),\n (195.447674, 174.214377, 195.447674, 173.781495),\n (195.447674, 173.781495, 195.447674, 173.348612),\n (195.447674, 173.348612, 195.447674, 172.915729),\n (195.447674, 172.915729, 195.447674, 172.482846),\n (195.447674, 172.482846, 195.447674, 172.049963),\n (195.447674, 172.049963, 195.447674, 171.61708),\n (195.447674, 171.61708, 195.447674, 171.184197),\n (195.447674, 171.184197, 195.447674, 170.751314),\n (195.447674, 170.751314, 195.447674, 170.318432),\n (195.447674, 170.318432, 195.447674, 169.885549),\n (195.447674, 169.885549, 195.447674, 169.452666),\n (195.447674, 169.452666, 195.447674, 169.019783),\n (195.447674, 169.019783, 195.447674, 168.5869),\n (195.447674, 168.5869, 195.447674, 168.154017),\n (195.447674, 168.154017, 195.447674, 167.721134),\n (195.447674, 167.721134, 195.447674, 167.288251),\n (195.447674, 167.288251, 195.447674, 166.855368),\n (195.447674, 166.855368, 195.447674, 166.422486),\n (195.447674, 166.422486, 195.447674, 165.989603),\n (195.447674, 165.989603, 195.447674, 165.55672),\n (195.447674, 165.55672, 195.447674, 165.123837),\n (195.447674, 165.123837, 195.447674, 164.690954),\n (195.447674, 164.690954, 195.447674, 164.258071),\n (195.447674, 164.258071, 195.447674, 163.825188),\n (195.447674, 163.825188, 195.447674, 163.392305),\n (195.447674, 163.392305, 195.447674, 162.959423),\n (195.447674, 162.959423, 195.447674, 162.52654),\n (195.447674, 162.52654, 195.447674, 162.093657),\n (195.447674, 162.093657, 195.447674, 161.660774),\n (113.199926, 175.513026, 113.199926, 175.080143),\n (113.199926, 175.080143, 113.199926, 174.64726),\n (113.199926, 174.64726, 113.199926, 174.214377),\n (113.199926, 174.214377, 113.199926, 173.781495),\n (113.199926, 173.781495, 113.199926, 173.348612),\n (113.199926, 173.348612, 113.199926, 172.915729),\n (113.199926, 172.915729, 113.199926, 172.482846),\n (113.199926, 172.482846, 113.199926, 172.049963),\n (113.199926, 172.049963, 113.199926, 171.61708),\n (113.199926, 171.61708, 113.199926, 171.184197),\n (113.199926, 171.184197, 113.199926, 170.751314),\n (113.199926, 170.751314, 113.199926, 170.318432),\n (113.199926, 170.318432, 113.199926, 169.885549),\n (113.199926, 169.885549, 113.199926, 169.452666),\n (113.199926, 169.452666, 113.199926, 169.019783),\n (113.199926, 169.019783, 113.199926, 168.5869),\n (113.199926, 168.5869, 113.199926, 168.154017),\n (113.199926, 168.154017, 113.199926, 167.721134),\n (113.199926, 167.721134, 113.199926, 167.288251),\n (113.199926, 167.288251, 113.199926, 166.855368),\n (113.199926, 166.855368, 113.199926, 166.422486),\n (113.199926, 166.422486, 113.199926, 165.989603),\n (113.199926, 165.989603, 113.199926, 165.55672),\n (113.199926, 165.55672, 113.199926, 165.123837),\n (113.199926, 165.123837, 113.199926, 164.690954),\n (113.199926, 164.690954, 113.199926, 164.258071),\n (113.199926, 164.258071, 113.199926, 163.825188),\n (113.199926, 163.825188, 113.199926, 163.392305),\n (113.199926, 163.392305, 113.199926, 162.959423),\n (113.199926, 162.959423, 113.199926, 162.52654),\n (113.199926, 162.52654, 113.199926, 162.093657),\n (113.199926, 162.093657, 113.199926, 161.660774),\n (113.199926, 175.513026, 195.447674, 175.513026),\n (113.199926, 161.660774, 195.447674, 161.660774)\n]\nVISIBLE_CIRCLES = [\n (92.2738, 168.5869, 6.926126),\n (92.2738, 168.5869, 5.483183)\n]\nVISIBLE_ARCS = [\n\n]\nHIDDEN_SEGMENTS = [\n (97.757, 65.4131, 97.757, 147.6608),\n (86.7906, 147.6608, 86.7906, 65.4131),\n (113.1999, 163.1038, 195.4477, 163.1038),\n (113.1999, 174.0701, 195.4477, 174.0701)\n]\n# (orient, text, p1, p2, base) for linear; (orient, text, center, radius, angle) for diameter\nDIMENSIONS = [\n ('diameter', '%%c100', (92.2738, 168.5869), 6.9261, 45),\n ('diameter', '%%c79.1667', (92.2738, 168.5869), 5.4832, 135),\n ('horizontal', '593.75', (195.4477, 168.5869), (113.1999, 168.5869), (154.3238, 157.5869))\n]\n\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\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\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,\n angle=(0 if d[0] == \"horizontal\" else 90),\n 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,\n text=text, dimstyle=\"EZDXF\").render()\n\n doc.saveas(out_path)\n\n\nif __name__ == \"__main__\":\n out = sys.argv[1] if len(sys.argv) > 1 else \"0071_00715298_gt.dxf\"\n draw(out)\n print(\"wrote\", out)\n```"}], "images": ["images/0071_00715298.png"], "id": "0071_00715298"} {"messages": [{"role": "user", "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 68.75 mm. It is extruded to a thickness of 16.49 mm."}, {"role": "assistant", "content": "```python\n#!/usr/bin/env python3\n# -*- coding: utf-8 -*-\n# Ground-truth 2D engineering drawing for part: 0072_00727799\n# Self-contained: reproduces the three-view DXF via ezdxf, NO FreeCAD needed.\n# Coordinates are A4 page millimetres (scale=0.7347, page=[297.0, 210.0]).\n# visible edges -> solid (layer OUTLINE); hidden edges -> dashed (layer HIDDEN)\n# dimensions -> real movable DIMENSION entities (text = true mm value)\n# Run: python 0072_00727799_gt.py [out.dxf]\nimport sys\nimport ezdxf\n\nSCALE = 0.7347\nPAGE = [297.0, 210.0]\n\nVISIBLE_SEGMENTS = [\n (78.2087, 97.6912, 80.504638, 97.6912),\n (80.504638, 97.6912, 82.800575, 97.6912),\n (82.800575, 97.6912, 85.096513, 97.6912),\n (85.096513, 97.6912, 87.39245, 97.6912),\n (87.39245, 97.6912, 89.688388, 97.6912),\n (89.688388, 97.6912, 91.984325, 97.6912),\n (91.984325, 97.6912, 94.280263, 97.6912),\n (94.280263, 97.6912, 96.5762, 97.6912),\n (96.5762, 97.6912, 98.872138, 97.6912),\n (98.872138, 97.6912, 101.168075, 97.6912),\n (101.168075, 97.6912, 103.464013, 97.6912),\n (103.464013, 97.6912, 105.75995, 97.6912),\n (105.75995, 97.6912, 108.055888, 97.6912),\n (108.055888, 97.6912, 110.351825, 97.6912),\n (110.351825, 97.6912, 112.647763, 97.6912),\n (112.647763, 97.6912, 114.9437, 97.6912),\n (114.9437, 97.6912, 117.239638, 97.6912),\n (117.239638, 97.6912, 119.535575, 97.6912),\n (119.535575, 97.6912, 121.831512, 97.6912),\n (121.831512, 97.6912, 124.12745, 97.6912),\n (124.12745, 97.6912, 126.423388, 97.6912),\n (126.423388, 97.6912, 128.719325, 97.6912),\n (128.719325, 97.6912, 131.015263, 97.6912),\n (131.015263, 97.6912, 133.3112, 97.6912),\n (133.3112, 97.6912, 135.607138, 97.6912),\n (135.607138, 97.6912, 137.903075, 97.6912),\n (137.903075, 97.6912, 140.199013, 97.6912),\n (140.199013, 97.6912, 142.49495, 97.6912),\n (142.49495, 97.6912, 144.790888, 97.6912),\n (144.790888, 97.6912, 147.086825, 97.6912),\n (147.086825, 97.6912, 149.382763, 97.6912),\n (149.382763, 97.6912, 151.6787, 97.6912),\n (151.6787, 97.6912, 151.6787, 85.573752),\n (78.2087, 85.573752, 80.504638, 85.573752),\n (80.504638, 85.573752, 82.800575, 85.573752),\n (82.800575, 85.573752, 85.096513, 85.573752),\n (85.096513, 85.573752, 87.39245, 85.573752),\n (87.39245, 85.573752, 89.688388, 85.573752),\n (89.688388, 85.573752, 91.984325, 85.573752),\n (91.984325, 85.573752, 94.280263, 85.573752),\n (94.280263, 85.573752, 96.5762, 85.573752),\n (96.5762, 85.573752, 98.872138, 85.573752),\n (98.872138, 85.573752, 101.168075, 85.573752),\n (101.168075, 85.573752, 103.464013, 85.573752),\n (103.464013, 85.573752, 105.75995, 85.573752),\n (105.75995, 85.573752, 108.055888, 85.573752),\n (108.055888, 85.573752, 110.351825, 85.573752),\n (110.351825, 85.573752, 112.647763, 85.573752),\n (112.647763, 85.573752, 114.9437, 85.573752),\n (114.9437, 85.573752, 117.239638, 85.573752),\n (117.239638, 85.573752, 119.535575, 85.573752),\n (119.535575, 85.573752, 121.831512, 85.573752),\n (121.831512, 85.573752, 124.12745, 85.573752),\n (124.12745, 85.573752, 126.423388, 85.573752),\n (126.423388, 85.573752, 128.719325, 85.573752),\n (128.719325, 85.573752, 131.015263, 85.573752),\n (131.015263, 85.573752, 133.3112, 85.573752),\n (133.3112, 85.573752, 135.607138, 85.573752),\n (135.607138, 85.573752, 137.903075, 85.573752),\n (137.903075, 85.573752, 140.199013, 85.573752),\n (140.199013, 85.573752, 142.49495, 85.573752),\n (142.49495, 85.573752, 144.790888, 85.573752),\n (144.790888, 85.573752, 147.086825, 85.573752),\n (147.086825, 85.573752, 149.382763, 85.573752),\n (149.382763, 85.573752, 151.6787, 85.573752),\n (78.2087, 85.573752, 78.2087, 97.6912),\n (177.796148, 185.1612, 177.796148, 182.865263),\n (177.796148, 182.865263, 177.796148, 180.569325),\n (177.796148, 180.569325, 177.796148, 178.273388),\n (177.796148, 178.273388, 177.796148, 175.97745),\n (177.796148, 175.97745, 177.796148, 173.681512),\n (177.796148, 173.681512, 177.796148, 171.385575),\n (177.796148, 171.385575, 177.796148, 169.089638),\n (177.796148, 169.089638, 177.796148, 166.7937),\n (177.796148, 166.7937, 177.796148, 164.497763),\n (177.796148, 164.497763, 177.796148, 162.201825),\n (177.796148, 162.201825, 177.796148, 159.905888),\n (177.796148, 159.905888, 177.796148, 157.60995),\n (177.796148, 157.60995, 177.796148, 155.314013),\n (177.796148, 155.314013, 177.796148, 153.018075),\n (177.796148, 153.018075, 177.796148, 150.722138),\n (177.796148, 150.722138, 177.796148, 148.4262),\n (177.796148, 148.4262, 177.796148, 146.130262),\n (177.796148, 146.130262, 177.796148, 143.834325),\n (177.796148, 143.834325, 177.796148, 141.538387),\n (177.796148, 141.538387, 177.796148, 139.24245),\n (177.796148, 139.24245, 177.796148, 136.946513),\n (177.796148, 136.946513, 177.796148, 134.650575),\n (177.796148, 134.650575, 177.796148, 132.354638),\n (177.796148, 132.354638, 177.796148, 130.0587),\n (177.796148, 130.0587, 177.796148, 127.762763),\n (177.796148, 127.762763, 177.796148, 125.466825),\n (177.796148, 125.466825, 177.796148, 123.170888),\n (177.796148, 123.170888, 177.796148, 120.87495),\n (177.796148, 120.87495, 177.796148, 118.579013),\n (177.796148, 118.579013, 177.796148, 116.283075),\n (177.796148, 116.283075, 177.796148, 113.987138),\n (177.796148, 113.987138, 177.796148, 111.6912),\n (165.6787, 185.1612, 165.6787, 182.865263),\n (165.6787, 182.865263, 165.6787, 180.569325),\n (165.6787, 180.569325, 165.6787, 178.273388),\n (165.6787, 178.273388, 165.6787, 175.97745),\n (165.6787, 175.97745, 165.6787, 173.681512),\n (165.6787, 173.681512, 165.6787, 171.385575),\n (165.6787, 171.385575, 165.6787, 169.089638),\n (165.6787, 169.089638, 165.6787, 166.7937),\n (165.6787, 166.7937, 165.6787, 164.497763),\n (165.6787, 164.497763, 165.6787, 162.201825),\n (165.6787, 162.201825, 165.6787, 159.905888),\n (165.6787, 159.905888, 165.6787, 157.60995),\n (165.6787, 157.60995, 165.6787, 155.314013),\n (165.6787, 155.314013, 165.6787, 153.018075),\n (165.6787, 153.018075, 165.6787, 150.722138),\n (165.6787, 150.722138, 165.6787, 148.4262),\n (165.6787, 148.4262, 165.6787, 146.130263),\n (165.6787, 146.130263, 165.6787, 143.834325),\n (165.6787, 143.834325, 165.6787, 141.538387),\n (165.6787, 141.538387, 165.6787, 139.24245),\n (165.6787, 139.24245, 165.6787, 136.946513),\n (165.6787, 136.946513, 165.6787, 134.650575),\n (165.6787, 134.650575, 165.6787, 132.354638),\n (165.6787, 132.354638, 165.6787, 130.0587),\n (165.6787, 130.0587, 165.6787, 127.762763),\n (165.6787, 127.762763, 165.6787, 125.466825),\n (165.6787, 125.466825, 165.6787, 123.170888),\n (165.6787, 123.170888, 165.6787, 120.87495),\n (165.6787, 120.87495, 165.6787, 118.579013),\n (165.6787, 118.579013, 165.6787, 116.283075),\n (165.6787, 116.283075, 165.6787, 113.987138),\n (165.6787, 113.987138, 165.6787, 111.6912),\n (165.6787, 185.1612, 177.796148, 185.1612),\n (165.6787, 111.6912, 177.796148, 111.6912)\n]\nVISIBLE_CIRCLES = [\n (114.9437, 148.4262, 36.735),\n (114.9437, 148.4262, 25.255313)\n]\nVISIBLE_ARCS = [\n\n]\nHIDDEN_SEGMENTS = [\n (140.199, 85.5738, 140.199, 97.6912),\n (89.6884, 97.6912, 89.6884, 85.5738),\n (165.6787, 123.1709, 177.7961, 123.1709),\n (165.6787, 173.6815, 177.7961, 173.6815)\n]\n# (orient, text, p1, p2, base) for linear; (orient, text, center, radius, angle) for diameter\nDIMENSIONS = [\n ('diameter', '%%c100', (114.9437, 148.4262), 36.735, 45),\n ('diameter', '%%c68.75', (114.9437, 148.4262), 25.2553, 135),\n ('horizontal', '16.4931', (177.7961, 148.4262), (165.6787, 148.4262), (171.7374, 137.4262))\n]\n\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\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\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,\n angle=(0 if d[0] == \"horizontal\" else 90),\n 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,\n text=text, dimstyle=\"EZDXF\").render()\n\n doc.saveas(out_path)\n\n\nif __name__ == \"__main__\":\n out = sys.argv[1] if len(sys.argv) > 1 else \"0072_00727799_gt.dxf\"\n draw(out)\n print(\"wrote\", out)\n```"}], "images": ["images/0072_00727799.png"], "id": "0072_00727799"} {"messages": [{"role": "user", "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 4 circular holes (diameters 10.42, 27.08 mm). It is extruded to a thickness of 49.48 mm."}, {"role": "assistant", "content": "```python\n#!/usr/bin/env python3\n# -*- coding: utf-8 -*-\n# Ground-truth 2D engineering drawing for part: 0072_00729494\n# Self-contained: reproduces the three-view DXF via ezdxf, NO FreeCAD needed.\n# Coordinates are A4 page millimetres (scale=0.6428989547038313, page=[297.0, 210.0]).\n# visible edges -> solid (layer OUTLINE); hidden edges -> dashed (layer HIDDEN)\n# dimensions -> real movable DIMENSION entities (text = true mm value)\n# Run: python 0072_00729494_gt.py [out.dxf]\nimport sys\nimport ezdxf\n\nSCALE = 0.6428989547038313\nPAGE = [297.0, 210.0]\n\nVISIBLE_SEGMENTS = [\n (149.224045, 101.126647, 147.214986, 101.126647),\n (147.214986, 101.126647, 145.205927, 101.126647),\n (145.205927, 101.126647, 143.196867, 101.126647),\n (143.196867, 101.126647, 141.187808, 101.126647),\n (141.187808, 101.126647, 139.178749, 101.126647),\n (139.178749, 101.126647, 137.16969, 101.126647),\n (137.16969, 101.126647, 135.16063, 101.126647),\n (135.16063, 101.126647, 133.151571, 101.126647),\n (133.151571, 101.126647, 131.142512, 101.126647),\n (131.142512, 101.126647, 129.133453, 101.126647),\n (129.133453, 101.126647, 127.124393, 101.126647),\n (127.124393, 101.126647, 125.115334, 101.126647),\n (125.115334, 101.126647, 123.106275, 101.126647),\n (123.106275, 101.126647, 121.097216, 101.126647),\n (121.097216, 101.126647, 119.088157, 101.126647),\n (119.088157, 101.126647, 117.079097, 101.126647),\n (117.079097, 101.126647, 115.070038, 101.126647),\n (115.070038, 101.126647, 113.060979, 101.126647),\n (113.060979, 101.126647, 111.05192, 101.126647),\n (111.05192, 101.126647, 109.04286, 101.126647),\n (109.04286, 101.126647, 107.033801, 101.126647),\n (107.033801, 101.126647, 105.024742, 101.126647),\n (105.024742, 101.126647, 103.015683, 101.126647),\n (103.015683, 101.126647, 101.006623, 101.126647),\n (101.006623, 101.126647, 98.997564, 101.126647),\n (98.997564, 101.126647, 96.988505, 101.126647),\n (96.988505, 101.126647, 94.979446, 101.126647),\n (94.979446, 101.126647, 92.970386, 101.126647),\n (92.970386, 101.126647, 90.961327, 101.126647),\n (90.961327, 101.126647, 88.952268, 101.126647),\n (88.952268, 101.126647, 86.943209, 101.126647),\n (86.943209, 101.126647, 84.93415, 101.126647),\n (149.224045, 101.126647, 149.224045, 69.316542),\n (149.224045, 69.316542, 147.214986, 69.316542),\n (147.214986, 69.316542, 145.205927, 69.316542),\n (145.205927, 69.316542, 143.196867, 69.316542),\n (143.196867, 69.316542, 141.187808, 69.316542),\n (141.187808, 69.316542, 139.178749, 69.316542),\n (139.178749, 69.316542, 137.16969, 69.316542),\n (137.16969, 69.316542, 135.16063, 69.316542),\n (135.16063, 69.316542, 133.151571, 69.316542),\n (133.151571, 69.316542, 131.142512, 69.316542),\n (131.142512, 69.316542, 129.133453, 69.316542),\n (129.133453, 69.316542, 127.124393, 69.316542),\n (127.124393, 69.316542, 125.115334, 69.316542),\n (125.115334, 69.316542, 123.106275, 69.316542),\n (123.106275, 69.316542, 121.097216, 69.316542),\n (121.097216, 69.316542, 119.088157, 69.316542),\n (119.088157, 69.316542, 117.079097, 69.316542),\n (117.079097, 69.316542, 115.070038, 69.316542),\n (115.070038, 69.316542, 113.060979, 69.316542),\n (113.060979, 69.316542, 111.05192, 69.316542),\n (111.05192, 69.316542, 109.04286, 69.316542),\n (109.04286, 69.316542, 107.033801, 69.316542),\n (107.033801, 69.316542, 105.024742, 69.316542),\n (105.024742, 69.316542, 103.015683, 69.316542),\n (103.015683, 69.316542, 101.006623, 69.316542),\n (101.006623, 69.316542, 98.997564, 69.316542),\n (98.997564, 69.316542, 96.988505, 69.316542),\n (96.988505, 69.316542, 94.979446, 69.316542),\n (94.979446, 69.316542, 92.970386, 69.316542),\n (92.970386, 69.316542, 90.961327, 69.316542),\n (90.961327, 69.316542, 88.952268, 69.316542),\n (88.952268, 69.316542, 86.943209, 69.316542),\n (86.943209, 69.316542, 84.93415, 69.316542),\n (84.93415, 69.316542, 84.93415, 101.126647),\n (163.224045, 179.416542, 163.224045, 177.407483),\n (163.224045, 177.407483, 163.224045, 175.398424),\n (163.224045, 175.398424, 163.224045, 173.389365),\n (163.224045, 173.389365, 163.224045, 171.380305),\n (163.224045, 171.380305, 163.224045, 169.371246),\n (163.224045, 169.371246, 163.224045, 167.362187),\n (163.224045, 167.362187, 163.224045, 165.353128),\n (163.224045, 165.353128, 163.224045, 163.344068),\n (163.224045, 163.344068, 163.224045, 161.335009),\n (163.224045, 161.335009, 163.224045, 159.32595),\n (163.224045, 159.32595, 163.224045, 157.316891),\n (163.224045, 157.316891, 163.224045, 155.307831),\n (163.224045, 155.307831, 163.224045, 153.298772),\n (163.224045, 153.298772, 163.224045, 151.289713),\n (163.224045, 151.289713, 163.224045, 149.280654),\n (163.224045, 149.280654, 163.224045, 147.271595),\n (163.224045, 147.271595, 163.224045, 145.262535),\n (163.224045, 145.262535, 163.224045, 143.253476),\n (163.224045, 143.253476, 163.224045, 141.244417),\n (163.224045, 141.244417, 163.224045, 139.235358),\n (163.224045, 139.235358, 163.224045, 137.226298),\n (163.224045, 137.226298, 163.224045, 135.217239),\n (163.224045, 135.217239, 163.224045, 133.20818),\n (163.224045, 133.20818, 163.224045, 131.199121),\n (163.224045, 131.199121, 163.224045, 129.190061),\n (163.224045, 129.190061, 163.224045, 127.181002),\n (163.224045, 127.181002, 163.224045, 125.171943),\n (163.224045, 125.171943, 163.224045, 123.162884),\n (163.224045, 123.162884, 163.224045, 121.153825),\n (163.224045, 121.153825, 163.224045, 119.144765),\n (163.224045, 119.144765, 163.224045, 117.135706),\n (163.224045, 117.135706, 163.224045, 115.126647),\n (195.03415, 179.416542, 195.03415, 177.407483),\n (195.03415, 177.407483, 195.03415, 175.398424),\n (195.03415, 175.398424, 195.03415, 173.389365),\n (195.03415, 173.389365, 195.03415, 171.380305),\n (195.03415, 171.380305, 195.03415, 169.371246),\n (195.03415, 169.371246, 195.03415, 167.362187),\n (195.03415, 167.362187, 195.03415, 165.353128),\n (195.03415, 165.353128, 195.03415, 163.344068),\n (195.03415, 163.344068, 195.03415, 161.335009),\n (195.03415, 161.335009, 195.03415, 159.32595),\n (195.03415, 159.32595, 195.03415, 157.316891),\n (195.03415, 157.316891, 195.03415, 155.307831),\n (195.03415, 155.307831, 195.03415, 153.298772),\n (195.03415, 153.298772, 195.03415, 151.289713),\n (195.03415, 151.289713, 195.03415, 149.280654),\n (195.03415, 149.280654, 195.03415, 147.271595),\n (195.03415, 147.271595, 195.03415, 145.262535),\n (195.03415, 145.262535, 195.03415, 143.253476),\n (195.03415, 143.253476, 195.03415, 141.244417),\n (195.03415, 141.244417, 195.03415, 139.235358),\n (195.03415, 139.235358, 195.03415, 137.226298),\n (195.03415, 137.226298, 195.03415, 135.217239),\n (195.03415, 135.217239, 195.03415, 133.20818),\n (195.03415, 133.20818, 195.03415, 131.199121),\n (195.03415, 131.199121, 195.03415, 129.190061),\n (195.03415, 129.190061, 195.03415, 127.181002),\n (195.03415, 127.181002, 195.03415, 125.171943),\n (195.03415, 125.171943, 195.03415, 123.162884),\n (195.03415, 123.162884, 195.03415, 121.153825),\n (195.03415, 121.153825, 195.03415, 119.144765),\n (195.03415, 119.144765, 195.03415, 117.135706),\n (195.03415, 117.135706, 195.03415, 115.126647),\n (195.03415, 179.416542, 163.224045, 179.416542),\n (195.03415, 115.126647, 163.224045, 115.126647)\n]\nVISIBLE_CIRCLES = [\n (117.079097, 147.271595, 32.144948),\n (95.649132, 135.217239, 3.348432),\n (117.079097, 147.271595, 8.705923),\n (117.079097, 170.040933, 3.348432),\n (137.839376, 135.217239, 3.348432)\n]\nVISIBLE_ARCS = [\n\n]\nHIDDEN_SEGMENTS = [\n (98.9976, 101.1267, 98.9976, 69.3166),\n (125.785, 101.1267, 125.785, 69.3166),\n (120.4275, 101.1267, 120.4275, 69.3166),\n (141.1878, 101.1267, 141.1878, 69.3166),\n (92.3007, 69.3166, 92.3007, 101.1267),\n (108.3732, 69.3166, 108.3732, 101.1267),\n (113.7307, 69.3166, 113.7307, 101.1267),\n (134.4909, 69.3166, 134.4909, 101.1267),\n (195.0341, 138.5657, 163.224, 138.5657),\n (195.0341, 131.8688, 163.224, 131.8688),\n (195.0341, 155.9775, 163.224, 155.9775),\n (195.0341, 173.3894, 163.224, 173.3894),\n (195.0341, 166.6925, 163.224, 166.6925)\n]\n# (orient, text, p1, p2, base) for linear; (orient, text, center, radius, angle) for diameter\nDIMENSIONS = [\n ('diameter', '%%c100', (117.0791, 147.2716), 32.1449, 45),\n ('diameter', '%%c10.4167', (95.6491, 135.2172), 3.3484, 45),\n ('horizontal', '33.3333', (117.0791, 147.2716), (95.6491, 147.2716), (106.3641, 136.2716)),\n ('vertical', '18.75', (95.6491, 147.2716), (95.6491, 135.2172), (106.6491, 141.2444)),\n ('diameter', '%%c27.0833', (117.0791, 147.2716), 8.7059, 135),\n ('diameter', '%%c10.4167', (117.0791, 170.041), 3.3484, 45),\n ('vertical', '35.4167', (117.0791, 147.2716), (117.0791, 170.041), (106.0791, 158.6563)),\n ('diameter', '%%c10.4167', (137.8394, 135.2172), 3.3484, 45),\n ('horizontal', '32.2917', (117.0791, 147.2716), (137.8394, 147.2716), (127.4592, 158.2716)),\n ('vertical', '18.75', (137.8394, 147.2716), (137.8394, 135.2172), (148.8394, 141.2444)),\n ('horizontal', '49.4792', (163.224, 147.2716), (195.0342, 147.2716), (179.1291, 158.2716))\n]\n\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\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\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,\n angle=(0 if d[0] == \"horizontal\" else 90),\n 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,\n text=text, dimstyle=\"EZDXF\").render()\n\n doc.saveas(out_path)\n\n\nif __name__ == \"__main__\":\n out = sys.argv[1] if len(sys.argv) > 1 else \"0072_00729494_gt.dxf\"\n draw(out)\n print(\"wrote\", out)\n```"}], "images": ["images/0072_00729494.png"], "id": "0072_00729494"} {"messages": [{"role": "user", "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 30.92 mm."}, {"role": "assistant", "content": "```python\n#!/usr/bin/env python3\n# -*- coding: utf-8 -*-\n# Ground-truth 2D engineering drawing for part: 0073_00738037\n# Self-contained: reproduces the three-view DXF via ezdxf, NO FreeCAD needed.\n# Coordinates are A4 page millimetres (scale=0.7340109398309672, page=[297.0, 210.0]).\n# visible edges -> solid (layer OUTLINE); hidden edges -> dashed (layer HIDDEN)\n# dimensions -> real movable DIMENSION entities (text = true mm value)\n# Run: python 0073_00738037_gt.py [out.dxf]\nimport sys\nimport ezdxf\n\nSCALE = 0.7340109398309672\nPAGE = [297.0, 210.0]\n\nVISIBLE_SEGMENTS = [\n (71.246553, 102.999153, 73.540337, 102.999153),\n (73.540337, 102.999153, 75.834121, 102.999153),\n (75.834121, 102.999153, 78.127906, 102.999153),\n (78.127906, 102.999153, 80.42169, 102.999153),\n (80.42169, 102.999153, 82.715474, 102.999153),\n (82.715474, 102.999153, 85.009258, 102.999153),\n (85.009258, 102.999153, 87.303042, 102.999153),\n (87.303042, 102.999153, 89.596827, 102.999153),\n (89.596827, 102.999153, 91.890611, 102.999153),\n (91.890611, 102.999153, 94.184395, 102.999153),\n (94.184395, 102.999153, 96.478179, 102.999153),\n (96.478179, 102.999153, 98.771963, 102.999153),\n (98.771963, 102.999153, 101.065747, 102.999153),\n (101.065747, 102.999153, 103.359532, 102.999153),\n (103.359532, 102.999153, 105.653316, 102.999153),\n (105.653316, 102.999153, 107.9471, 102.999153),\n (107.9471, 102.999153, 110.240884, 102.999153),\n (110.240884, 102.999153, 112.534668, 102.999153),\n (112.534668, 102.999153, 114.828453, 102.999153),\n (114.828453, 102.999153, 117.122237, 102.999153),\n (117.122237, 102.999153, 119.416021, 102.999153),\n (119.416021, 102.999153, 121.709805, 102.999153),\n (121.709805, 102.999153, 124.003589, 102.999153),\n (124.003589, 102.999153, 126.297373, 102.999153),\n (126.297373, 102.999153, 128.591158, 102.999153),\n (128.591158, 102.999153, 130.884942, 102.999153),\n (130.884942, 102.999153, 133.178726, 102.999153),\n (133.178726, 102.999153, 135.47251, 102.999153),\n (135.47251, 102.999153, 137.766294, 102.999153),\n (137.766294, 102.999153, 140.060079, 102.999153),\n (140.060079, 102.999153, 142.353863, 102.999153),\n (142.353863, 102.999153, 144.647647, 102.999153),\n (144.647647, 102.999153, 144.647647, 80.300247),\n (71.246553, 80.300247, 73.540337, 80.300247),\n (73.540337, 80.300247, 75.834121, 80.300247),\n (75.834121, 80.300247, 78.127906, 80.300247),\n (78.127906, 80.300247, 80.42169, 80.300247),\n (80.42169, 80.300247, 82.715474, 80.300247),\n (82.715474, 80.300247, 85.009258, 80.300247),\n (85.009258, 80.300247, 87.303042, 80.300247),\n (87.303042, 80.300247, 89.596827, 80.300247),\n (89.596827, 80.300247, 91.890611, 80.300247),\n (91.890611, 80.300247, 94.184395, 80.300247),\n (94.184395, 80.300247, 96.478179, 80.300247),\n (96.478179, 80.300247, 98.771963, 80.300247),\n (98.771963, 80.300247, 101.065747, 80.300247),\n (101.065747, 80.300247, 103.359532, 80.300247),\n (103.359532, 80.300247, 105.653316, 80.300247),\n (105.653316, 80.300247, 107.9471, 80.300247),\n (107.9471, 80.300247, 110.240884, 80.300247),\n (110.240884, 80.300247, 112.534668, 80.300247),\n (112.534668, 80.300247, 114.828453, 80.300247),\n (114.828453, 80.300247, 117.122237, 80.300247),\n (117.122237, 80.300247, 119.416021, 80.300247),\n (119.416021, 80.300247, 121.709805, 80.300247),\n (121.709805, 80.300247, 124.003589, 80.300247),\n (124.003589, 80.300247, 126.297373, 80.300247),\n (126.297373, 80.300247, 128.591158, 80.300247),\n (128.591158, 80.300247, 130.884942, 80.300247),\n (130.884942, 80.300247, 133.178726, 80.300247),\n (133.178726, 80.300247, 135.47251, 80.300247),\n (135.47251, 80.300247, 137.766294, 80.300247),\n (137.766294, 80.300247, 140.060079, 80.300247),\n (140.060079, 80.300247, 142.353863, 80.300247),\n (142.353863, 80.300247, 144.647647, 80.300247),\n (71.246553, 80.300247, 71.246553, 102.999153),\n (181.346553, 190.400247, 181.346553, 188.106463),\n (181.346553, 188.106463, 181.346553, 185.812679),\n (181.346553, 185.812679, 181.346553, 183.518894),\n (181.346553, 183.518894, 181.346553, 181.22511),\n (181.346553, 181.22511, 181.346553, 178.931326),\n (181.346553, 178.931326, 181.346553, 176.637542),\n (181.346553, 176.637542, 181.346553, 174.343758),\n (181.346553, 174.343758, 181.346553, 172.049973),\n (181.346553, 172.049973, 181.346553, 169.756189),\n (181.346553, 169.756189, 181.346553, 167.462405),\n (181.346553, 167.462405, 181.346553, 165.168621),\n (181.346553, 165.168621, 181.346553, 162.874837),\n (181.346553, 162.874837, 181.346553, 160.581053),\n (181.346553, 160.581053, 181.346553, 158.287268),\n (181.346553, 158.287268, 181.346553, 155.993484),\n (181.346553, 155.993484, 181.346553, 153.6997),\n (181.346553, 153.6997, 181.346553, 151.405916),\n (181.346553, 151.405916, 181.346553, 149.112132),\n (181.346553, 149.112132, 181.346553, 146.818347),\n (181.346553, 146.818347, 181.346553, 144.524563),\n (181.346553, 144.524563, 181.346553, 142.230779),\n (181.346553, 142.230779, 181.346553, 139.936995),\n (181.346553, 139.936995, 181.346553, 137.643211),\n (181.346553, 137.643211, 181.346553, 135.349427),\n (181.346553, 135.349427, 181.346553, 133.055642),\n (181.346553, 133.055642, 181.346553, 130.761858),\n (181.346553, 130.761858, 181.346553, 128.468074),\n (181.346553, 128.468074, 181.346553, 126.17429),\n (181.346553, 126.17429, 181.346553, 123.880506),\n (181.346553, 123.880506, 181.346553, 121.586721),\n (181.346553, 121.586721, 181.346553, 119.292937),\n (181.346553, 119.292937, 181.346553, 116.999153),\n (158.647647, 190.400247, 158.647647, 188.106463),\n (158.647647, 188.106463, 158.647647, 185.812679),\n (158.647647, 185.812679, 158.647647, 183.518894),\n (158.647647, 183.518894, 158.647647, 181.22511),\n (158.647647, 181.22511, 158.647647, 178.931326),\n (158.647647, 178.931326, 158.647647, 176.637542),\n (158.647647, 176.637542, 158.647647, 174.343758),\n (158.647647, 174.343758, 158.647647, 172.049973),\n (158.647647, 172.049973, 158.647647, 169.756189),\n (158.647647, 169.756189, 158.647647, 167.462405),\n (158.647647, 167.462405, 158.647647, 165.168621),\n (158.647647, 165.168621, 158.647647, 162.874837),\n (158.647647, 162.874837, 158.647647, 160.581053),\n (158.647647, 160.581053, 158.647647, 158.287268),\n (158.647647, 158.287268, 158.647647, 155.993484),\n (158.647647, 155.993484, 158.647647, 153.6997),\n (158.647647, 153.6997, 158.647647, 151.405916),\n (158.647647, 151.405916, 158.647647, 149.112132),\n (158.647647, 149.112132, 158.647647, 146.818347),\n (158.647647, 146.818347, 158.647647, 144.524563),\n (158.647647, 144.524563, 158.647647, 142.230779),\n (158.647647, 142.230779, 158.647647, 139.936995),\n (158.647647, 139.936995, 158.647647, 137.643211),\n (158.647647, 137.643211, 158.647647, 135.349427),\n (158.647647, 135.349427, 158.647647, 133.055642),\n (158.647647, 133.055642, 158.647647, 130.761858),\n (158.647647, 130.761858, 158.647647, 128.468074),\n (158.647647, 128.468074, 158.647647, 126.17429),\n (158.647647, 126.17429, 158.647647, 123.880506),\n (158.647647, 123.880506, 158.647647, 121.586721),\n (158.647647, 121.586721, 158.647647, 119.292937),\n (158.647647, 119.292937, 158.647647, 116.999153),\n (158.647647, 190.400247, 181.346553, 190.400247),\n (158.647647, 116.999153, 181.346553, 116.999153)\n]\nVISIBLE_CIRCLES = [\n (107.9471, 153.6997, 36.700547),\n (107.9471, 153.6997, 32.112979)\n]\nVISIBLE_ARCS = [\n\n]\nHIDDEN_SEGMENTS = [\n (140.0601, 80.3003, 140.0601, 102.9992),\n (75.8342, 102.9992, 75.8342, 80.3003),\n (158.6477, 121.5867, 181.3466, 121.5867),\n (158.6477, 185.8127, 181.3466, 185.8127)\n]\n# (orient, text, p1, p2, base) for linear; (orient, text, center, radius, angle) for diameter\nDIMENSIONS = [\n ('diameter', '%%c100', (107.9471, 153.6997), 36.7005, 45),\n ('diameter', '%%c87.5', (107.9471, 153.6997), 32.113, 135),\n ('horizontal', '30.9245', (181.3466, 153.6997), (158.6477, 153.6997), (169.9972, 142.6997))\n]\n\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\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\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,\n angle=(0 if d[0] == \"horizontal\" else 90),\n 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,\n text=text, dimstyle=\"EZDXF\").render()\n\n doc.saveas(out_path)\n\n\nif __name__ == \"__main__\":\n out = sys.argv[1] if len(sys.argv) > 1 else \"0073_00738037_gt.dxf\"\n draw(out)\n print(\"wrote\", out)\n```"}], "images": ["images/0073_00738037.png"], "id": "0073_00738037"} {"messages": [{"role": "user", "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 93.75 mm. It is extruded to a thickness of 39.69 mm."}, {"role": "assistant", "content": "```python\n#!/usr/bin/env python3\n# -*- coding: utf-8 -*-\n# Ground-truth 2D engineering drawing for part: 0073_00738116\n# Self-contained: reproduces the three-view DXF via ezdxf, NO FreeCAD needed.\n# Coordinates are A4 page millimetres (scale=0.6879695498504952, page=[297.0, 210.0]).\n# visible edges -> solid (layer OUTLINE); hidden edges -> dashed (layer HIDDEN)\n# dimensions -> real movable DIMENSION entities (text = true mm value)\n# Run: python 0073_00738116_gt.py [out.dxf]\nimport sys\nimport ezdxf\n\nSCALE = 0.6879695498504952\nPAGE = [297.0, 210.0]\n\nVISIBLE_SEGMENTS = [\n (71.788223, 106.452322, 73.938127, 106.452322),\n (73.938127, 106.452322, 76.088032, 106.452322),\n (76.088032, 106.452322, 78.237937, 106.452322),\n (78.237937, 106.452322, 80.387842, 106.452322),\n (80.387842, 106.452322, 82.537747, 106.452322),\n (82.537747, 106.452322, 84.687652, 106.452322),\n (84.687652, 106.452322, 86.837556, 106.452322),\n (86.837556, 106.452322, 88.987461, 106.452322),\n (88.987461, 106.452322, 91.137366, 106.452322),\n (91.137366, 106.452322, 93.287271, 106.452322),\n (93.287271, 106.452322, 95.437176, 106.452322),\n (95.437176, 106.452322, 97.587081, 106.452322),\n (97.587081, 106.452322, 99.736985, 106.452322),\n (99.736985, 106.452322, 101.88689, 106.452322),\n (101.88689, 106.452322, 104.036795, 106.452322),\n (104.036795, 106.452322, 106.1867, 106.452322),\n (106.1867, 106.452322, 108.336605, 106.452322),\n (108.336605, 106.452322, 110.48651, 106.452322),\n (110.48651, 106.452322, 112.636415, 106.452322),\n (112.636415, 106.452322, 114.786319, 106.452322),\n (114.786319, 106.452322, 116.936224, 106.452322),\n (116.936224, 106.452322, 119.086129, 106.452322),\n (119.086129, 106.452322, 121.236034, 106.452322),\n (121.236034, 106.452322, 123.385939, 106.452322),\n (123.385939, 106.452322, 125.535844, 106.452322),\n (125.535844, 106.452322, 127.685748, 106.452322),\n (127.685748, 106.452322, 129.835653, 106.452322),\n (129.835653, 106.452322, 131.985558, 106.452322),\n (131.985558, 106.452322, 134.135463, 106.452322),\n (134.135463, 106.452322, 136.285368, 106.452322),\n (136.285368, 106.452322, 138.435273, 106.452322),\n (138.435273, 106.452322, 140.585177, 106.452322),\n (140.585177, 106.452322, 140.585177, 79.149277),\n (71.788223, 79.149277, 73.938127, 79.149277),\n (73.938127, 79.149277, 76.088032, 79.149277),\n (76.088032, 79.149277, 78.237937, 79.149277),\n (78.237937, 79.149277, 80.387842, 79.149277),\n (80.387842, 79.149277, 82.537747, 79.149277),\n (82.537747, 79.149277, 84.687652, 79.149277),\n (84.687652, 79.149277, 86.837556, 79.149277),\n (86.837556, 79.149277, 88.987461, 79.149277),\n (88.987461, 79.149277, 91.137366, 79.149277),\n (91.137366, 79.149277, 93.287271, 79.149277),\n (93.287271, 79.149277, 95.437176, 79.149277),\n (95.437176, 79.149277, 97.587081, 79.149277),\n (97.587081, 79.149277, 99.736985, 79.149277),\n (99.736985, 79.149277, 101.88689, 79.149277),\n (101.88689, 79.149277, 104.036795, 79.149277),\n (104.036795, 79.149277, 106.1867, 79.149277),\n (106.1867, 79.149277, 108.336605, 79.149277),\n (108.336605, 79.149277, 110.48651, 79.149277),\n (110.48651, 79.149277, 112.636415, 79.149277),\n (112.636415, 79.149277, 114.786319, 79.149277),\n (114.786319, 79.149277, 116.936224, 79.149277),\n (116.936224, 79.149277, 119.086129, 79.149277),\n (119.086129, 79.149277, 121.236034, 79.149277),\n (121.236034, 79.149277, 123.385939, 79.149277),\n (123.385939, 79.149277, 125.535844, 79.149277),\n (125.535844, 79.149277, 127.685748, 79.149277),\n (127.685748, 79.149277, 129.835653, 79.149277),\n (129.835653, 79.149277, 131.985558, 79.149277),\n (131.985558, 79.149277, 134.135463, 79.149277),\n (134.135463, 79.149277, 136.285368, 79.149277),\n (136.285368, 79.149277, 138.435273, 79.149277),\n (138.435273, 79.149277, 140.585177, 79.149277),\n (71.788223, 79.149277, 71.788223, 106.452322),\n (181.888223, 189.249277, 181.888223, 187.099373),\n (181.888223, 187.099373, 181.888223, 184.949468),\n (181.888223, 184.949468, 181.888223, 182.799563),\n (181.888223, 182.799563, 181.888223, 180.649658),\n (181.888223, 180.649658, 181.888223, 178.499753),\n (181.888223, 178.499753, 181.888223, 176.349848),\n (181.888223, 176.349848, 181.888223, 174.199944),\n (181.888223, 174.199944, 181.888223, 172.050039),\n (181.888223, 172.050039, 181.888223, 169.900134),\n (181.888223, 169.900134, 181.888223, 167.750229),\n (181.888223, 167.750229, 181.888223, 165.600324),\n (181.888223, 165.600324, 181.888223, 163.450419),\n (181.888223, 163.450419, 181.888223, 161.300515),\n (181.888223, 161.300515, 181.888223, 159.15061),\n (181.888223, 159.15061, 181.888223, 157.000705),\n (181.888223, 157.000705, 181.888223, 154.8508),\n (181.888223, 154.8508, 181.888223, 152.700895),\n (181.888223, 152.700895, 181.888223, 150.55099),\n (181.888223, 150.55099, 181.888223, 148.401085),\n (181.888223, 148.401085, 181.888223, 146.251181),\n (181.888223, 146.251181, 181.888223, 144.101276),\n (181.888223, 144.101276, 181.888223, 141.951371),\n (181.888223, 141.951371, 181.888223, 139.801466),\n (181.888223, 139.801466, 181.888223, 137.651561),\n (181.888223, 137.651561, 181.888223, 135.501656),\n (181.888223, 135.501656, 181.888223, 133.351752),\n (181.888223, 133.351752, 181.888223, 131.201847),\n (181.888223, 131.201847, 181.888223, 129.051942),\n (181.888223, 129.051942, 181.888223, 126.902037),\n (181.888223, 126.902037, 181.888223, 124.752132),\n (181.888223, 124.752132, 181.888223, 122.602227),\n (181.888223, 122.602227, 181.888223, 120.452323),\n (154.585178, 189.249277, 154.585178, 187.099373),\n (154.585178, 187.099373, 154.585178, 184.949468),\n (154.585178, 184.949468, 154.585178, 182.799563),\n (154.585178, 182.799563, 154.585178, 180.649658),\n (154.585178, 180.649658, 154.585178, 178.499753),\n (154.585178, 178.499753, 154.585178, 176.349848),\n (154.585178, 176.349848, 154.585178, 174.199944),\n (154.585178, 174.199944, 154.585178, 172.050039),\n (154.585178, 172.050039, 154.585178, 169.900134),\n (154.585178, 169.900134, 154.585178, 167.750229),\n (154.585178, 167.750229, 154.585178, 165.600324),\n (154.585178, 165.600324, 154.585178, 163.450419),\n (154.585178, 163.450419, 154.585178, 161.300515),\n (154.585178, 161.300515, 154.585178, 159.15061),\n (154.585178, 159.15061, 154.585178, 157.000705),\n (154.585178, 157.000705, 154.585178, 154.8508),\n (154.585178, 154.8508, 154.585178, 152.700895),\n (154.585178, 152.700895, 154.585178, 150.55099),\n (154.585178, 150.55099, 154.585178, 148.401085),\n (154.585178, 148.401085, 154.585178, 146.251181),\n (154.585178, 146.251181, 154.585178, 144.101276),\n (154.585178, 144.101276, 154.585178, 141.951371),\n (154.585178, 141.951371, 154.585178, 139.801466),\n (154.585178, 139.801466, 154.585178, 137.651561),\n (154.585178, 137.651561, 154.585178, 135.501656),\n (154.585178, 135.501656, 154.585178, 133.351752),\n (154.585178, 133.351752, 154.585178, 131.201847),\n (154.585178, 131.201847, 154.585178, 129.051942),\n (154.585178, 129.051942, 154.585178, 126.902037),\n (154.585178, 126.902037, 154.585178, 124.752132),\n (154.585178, 124.752132, 154.585178, 122.602227),\n (154.585178, 122.602227, 154.585178, 120.452323),\n (154.585178, 189.249277, 181.888223, 189.249277),\n (154.585178, 120.452323, 181.888223, 120.452323)\n]\nVISIBLE_CIRCLES = [\n (106.1867, 154.8508, 34.398477),\n (106.1867, 154.8508, 32.248573)\n]\nVISIBLE_ARCS = [\n\n]\nHIDDEN_SEGMENTS = [\n (138.4353, 79.1492, 138.4353, 106.4523),\n (73.9381, 106.4523, 73.9381, 79.1492),\n (154.5852, 122.6022, 181.8882, 122.6022),\n (154.5852, 187.0993, 181.8882, 187.0993)\n]\n# (orient, text, p1, p2, base) for linear; (orient, text, center, radius, angle) for diameter\nDIMENSIONS = [\n ('diameter', '%%c100', (106.1867, 154.8508), 34.3985, 45),\n ('diameter', '%%c93.75', (106.1867, 154.8508), 32.2486, 135),\n ('horizontal', '39.6864', (181.8882, 154.8508), (154.5852, 154.8508), (168.2367, 143.8508))\n]\n\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\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\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,\n angle=(0 if d[0] == \"horizontal\" else 90),\n 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,\n text=text, dimstyle=\"EZDXF\").render()\n\n doc.saveas(out_path)\n\n\nif __name__ == \"__main__\":\n out = sys.argv[1] if len(sys.argv) > 1 else \"0073_00738116_gt.dxf\"\n draw(out)\n print(\"wrote\", out)\n```"}], "images": ["images/0073_00738116.png"], "id": "0073_00738116"} {"messages": [{"role": "user", "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 3.09 mm."}, {"role": "assistant", "content": "```python\n#!/usr/bin/env python3\n# -*- coding: utf-8 -*-\n# Ground-truth 2D engineering drawing for part: 0073_00738560\n# Self-contained: reproduces the three-view DXF via ezdxf, NO FreeCAD needed.\n# Coordinates are A4 page millimetres (scale=0.7347, page=[297.0, 210.0]).\n# visible edges -> solid (layer OUTLINE); hidden edges -> dashed (layer HIDDEN)\n# dimensions -> real movable DIMENSION entities (text = true mm value)\n# Run: python 0073_00738560_gt.py [out.dxf]\nimport sys\nimport ezdxf\n\nSCALE = 0.7347\nPAGE = [297.0, 210.0]\n\nVISIBLE_SEGMENTS = [\n (89.0626, 92.7685, 91.358538, 92.7685),\n (91.358538, 92.7685, 93.654475, 92.7685),\n (93.654475, 92.7685, 95.950412, 92.7685),\n (95.950412, 92.7685, 98.24635, 92.7685),\n (98.24635, 92.7685, 100.542288, 92.7685),\n (100.542288, 92.7685, 102.838225, 92.7685),\n (102.838225, 92.7685, 105.134163, 92.7685),\n (105.134163, 92.7685, 107.4301, 92.7685),\n (107.4301, 92.7685, 109.726038, 92.7685),\n (109.726038, 92.7685, 112.021975, 92.7685),\n (112.021975, 92.7685, 114.317913, 92.7685),\n (114.317913, 92.7685, 116.61385, 92.7685),\n (116.61385, 92.7685, 118.909788, 92.7685),\n (118.909788, 92.7685, 121.205725, 92.7685),\n (121.205725, 92.7685, 123.501663, 92.7685),\n (123.501663, 92.7685, 125.7976, 92.7685),\n (125.7976, 92.7685, 128.093537, 92.7685),\n (128.093537, 92.7685, 130.389475, 92.7685),\n (130.389475, 92.7685, 132.685412, 92.7685),\n (132.685412, 92.7685, 134.98135, 92.7685),\n (134.98135, 92.7685, 137.277288, 92.7685),\n (137.277288, 92.7685, 139.573225, 92.7685),\n (139.573225, 92.7685, 141.869163, 92.7685),\n (141.869163, 92.7685, 144.1651, 92.7685),\n (144.1651, 92.7685, 146.461038, 92.7685),\n (146.461038, 92.7685, 148.756975, 92.7685),\n (148.756975, 92.7685, 151.052913, 92.7685),\n (151.052913, 92.7685, 153.34885, 92.7685),\n (153.34885, 92.7685, 155.644788, 92.7685),\n (155.644788, 92.7685, 157.940725, 92.7685),\n (157.940725, 92.7685, 160.236663, 92.7685),\n (160.236663, 92.7685, 162.5326, 92.7685),\n (162.5326, 92.7685, 162.5326, 90.496478),\n (89.0626, 90.496478, 91.358538, 90.496478),\n (91.358538, 90.496478, 93.654475, 90.496478),\n (93.654475, 90.496478, 95.950412, 90.496478),\n (95.950412, 90.496478, 98.24635, 90.496478),\n (98.24635, 90.496478, 100.542288, 90.496478),\n (100.542288, 90.496478, 102.838225, 90.496478),\n (102.838225, 90.496478, 105.134163, 90.496478),\n (105.134163, 90.496478, 107.4301, 90.496478),\n (107.4301, 90.496478, 109.726038, 90.496478),\n (109.726038, 90.496478, 112.021975, 90.496478),\n (112.021975, 90.496478, 114.317913, 90.496478),\n (114.317913, 90.496478, 116.61385, 90.496478),\n (116.61385, 90.496478, 118.909788, 90.496478),\n (118.909788, 90.496478, 121.205725, 90.496478),\n (121.205725, 90.496478, 123.501663, 90.496478),\n (123.501663, 90.496478, 125.7976, 90.496478),\n (125.7976, 90.496478, 128.093537, 90.496478),\n (128.093537, 90.496478, 130.389475, 90.496478),\n (130.389475, 90.496478, 132.685412, 90.496478),\n (132.685412, 90.496478, 134.98135, 90.496478),\n (134.98135, 90.496478, 137.277288, 90.496478),\n (137.277288, 90.496478, 139.573225, 90.496478),\n (139.573225, 90.496478, 141.869163, 90.496478),\n (141.869163, 90.496478, 144.1651, 90.496478),\n (144.1651, 90.496478, 146.461038, 90.496478),\n (146.461038, 90.496478, 148.756975, 90.496478),\n (148.756975, 90.496478, 151.052913, 90.496478),\n (151.052913, 90.496478, 153.34885, 90.496478),\n (153.34885, 90.496478, 155.644788, 90.496478),\n (155.644788, 90.496478, 157.940725, 90.496478),\n (157.940725, 90.496478, 160.236663, 90.496478),\n (160.236663, 90.496478, 162.5326, 90.496478),\n (89.0626, 90.496478, 89.0626, 92.7685),\n (178.804622, 180.2385, 178.804622, 177.942563),\n (178.804622, 177.942563, 178.804622, 175.646625),\n (178.804622, 175.646625, 178.804622, 173.350688),\n (178.804622, 173.350688, 178.804622, 171.05475),\n (178.804622, 171.05475, 178.804622, 168.758813),\n (178.804622, 168.758813, 178.804622, 166.462875),\n (178.804622, 166.462875, 178.804622, 164.166938),\n (178.804622, 164.166938, 178.804622, 161.871),\n (178.804622, 161.871, 178.804622, 159.575063),\n (178.804622, 159.575063, 178.804622, 157.279125),\n (178.804622, 157.279125, 178.804622, 154.983188),\n (178.804622, 154.983188, 178.804622, 152.68725),\n (178.804622, 152.68725, 178.804622, 150.391313),\n (178.804622, 150.391313, 178.804622, 148.095375),\n (178.804622, 148.095375, 178.804622, 145.799438),\n (178.804622, 145.799438, 178.804622, 143.5035),\n (178.804622, 143.5035, 178.804622, 141.207562),\n (178.804622, 141.207562, 178.804622, 138.911625),\n (178.804622, 138.911625, 178.804622, 136.615688),\n (178.804622, 136.615688, 178.804622, 134.31975),\n (178.804622, 134.31975, 178.804622, 132.023813),\n (178.804622, 132.023813, 178.804622, 129.727875),\n (178.804622, 129.727875, 178.804622, 127.431938),\n (178.804622, 127.431938, 178.804622, 125.136),\n (178.804622, 125.136, 178.804622, 122.840063),\n (178.804622, 122.840063, 178.804622, 120.544125),\n (178.804622, 120.544125, 178.804622, 118.248188),\n (178.804622, 118.248188, 178.804622, 115.95225),\n (178.804622, 115.95225, 178.804622, 113.656313),\n (178.804622, 113.656313, 178.804622, 111.360375),\n (178.804622, 111.360375, 178.804622, 109.064438),\n (178.804622, 109.064438, 178.804622, 106.7685),\n (176.5326, 180.2385, 176.5326, 177.942563),\n (176.5326, 177.942563, 176.5326, 175.646625),\n (176.5326, 175.646625, 176.5326, 173.350688),\n (176.5326, 173.350688, 176.5326, 171.05475),\n (176.5326, 171.05475, 176.5326, 168.758813),\n (176.5326, 168.758813, 176.5326, 166.462875),\n (176.5326, 166.462875, 176.5326, 164.166938),\n (176.5326, 164.166938, 176.5326, 161.871),\n (176.5326, 161.871, 176.5326, 159.575063),\n (176.5326, 159.575063, 176.5326, 157.279125),\n (176.5326, 157.279125, 176.5326, 154.983188),\n (176.5326, 154.983188, 176.5326, 152.68725),\n (176.5326, 152.68725, 176.5326, 150.391313),\n (176.5326, 150.391313, 176.5326, 148.095375),\n (176.5326, 148.095375, 176.5326, 145.799438),\n (176.5326, 145.799438, 176.5326, 143.5035),\n (176.5326, 143.5035, 176.5326, 141.207562),\n (176.5326, 141.207562, 176.5326, 138.911625),\n (176.5326, 138.911625, 176.5326, 136.615688),\n (176.5326, 136.615688, 176.5326, 134.31975),\n (176.5326, 134.31975, 176.5326, 132.023813),\n (176.5326, 132.023813, 176.5326, 129.727875),\n (176.5326, 129.727875, 176.5326, 127.431938),\n (176.5326, 127.431938, 176.5326, 125.136),\n (176.5326, 125.136, 176.5326, 122.840063),\n (176.5326, 122.840063, 176.5326, 120.544125),\n (176.5326, 120.544125, 176.5326, 118.248188),\n (176.5326, 118.248188, 176.5326, 115.95225),\n (176.5326, 115.95225, 176.5326, 113.656313),\n (176.5326, 113.656313, 176.5326, 111.360375),\n (176.5326, 111.360375, 176.5326, 109.064438),\n (176.5326, 109.064438, 176.5326, 106.7685),\n (176.5326, 180.2385, 178.804622, 180.2385),\n (176.5326, 106.7685, 178.804622, 106.7685)\n]\nVISIBLE_CIRCLES = [\n (125.7976, 143.5035, 36.735),\n (125.7976, 143.5035, 1.530625)\n]\nVISIBLE_ARCS = [\n\n]\nHIDDEN_SEGMENTS = [\n (127.3282, 90.4965, 127.3282, 92.7685),\n (124.267, 92.7685, 124.267, 90.4965),\n (176.5326, 141.9729, 178.8046, 141.9729),\n (176.5326, 145.0341, 178.8046, 145.0341)\n]\n# (orient, text, p1, p2, base) for linear; (orient, text, center, radius, angle) for diameter\nDIMENSIONS = [\n ('diameter', '%%c100', (125.7976, 143.5035), 36.735, 45),\n ('diameter', '%%c4.1667', (125.7976, 143.5035), 1.5306, 135),\n ('horizontal', '3.0924', (178.8046, 143.5035), (176.5326, 143.5035), (177.6686, 132.5035))\n]\n\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\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\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,\n angle=(0 if d[0] == \"horizontal\" else 90),\n 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,\n text=text, dimstyle=\"EZDXF\").render()\n\n doc.saveas(out_path)\n\n\nif __name__ == \"__main__\":\n out = sys.argv[1] if len(sys.argv) > 1 else \"0073_00738560_gt.dxf\"\n draw(out)\n print(\"wrote\", out)\n```"}], "images": ["images/0073_00738560.png"], "id": "0073_00738560"} {"messages": [{"role": "user", "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 791.67 mm."}, {"role": "assistant", "content": "```python\n#!/usr/bin/env python3\n# -*- coding: utf-8 -*-\n# Ground-truth 2D engineering drawing for part: 0074_00742515\n# Self-contained: reproduces the three-view DXF via ezdxf, NO FreeCAD needed.\n# Coordinates are A4 page millimetres (scale=0.10777570093458023, page=[297.0, 210.0]).\n# visible edges -> solid (layer OUTLINE); hidden edges -> dashed (layer HIDDEN)\n# dimensions -> real movable DIMENSION entities (text = true mm value)\n# Run: python 0074_00742515_gt.py [out.dxf]\nimport sys\nimport ezdxf\n\nSCALE = 0.10777570093458023\nPAGE = [297.0, 210.0]\n\nVISIBLE_SEGMENTS = [\n (96.869985, 64.644385, 96.533186, 64.644385),\n (96.533186, 64.644385, 96.196387, 64.644385),\n (96.196387, 64.644385, 95.859588, 64.644385),\n (95.859588, 64.644385, 95.522789, 64.644385),\n (95.522789, 64.644385, 95.18599, 64.644385),\n (95.18599, 64.644385, 94.849191, 64.644385),\n (94.849191, 64.644385, 94.512392, 64.644385),\n (94.512392, 64.644385, 94.175593, 64.644385),\n (94.175593, 64.644385, 93.838793, 64.644385),\n (93.838793, 64.644385, 93.501994, 64.644385),\n (93.501994, 64.644385, 93.165195, 64.644385),\n (93.165195, 64.644385, 92.828396, 64.644385),\n (92.828396, 64.644385, 92.491597, 64.644385),\n (92.491597, 64.644385, 92.154798, 64.644385),\n (92.154798, 64.644385, 91.817999, 64.644385),\n (91.817999, 64.644385, 91.4812, 64.644385),\n (91.4812, 64.644385, 91.144401, 64.644385),\n (91.144401, 64.644385, 90.807602, 64.644385),\n (90.807602, 64.644385, 90.470803, 64.644385),\n (90.470803, 64.644385, 90.134004, 64.644385),\n (90.134004, 64.644385, 89.797205, 64.644385),\n (89.797205, 64.644385, 89.460406, 64.644385),\n (89.460406, 64.644385, 89.123607, 64.644385),\n (89.123607, 64.644385, 88.786807, 64.644385),\n (88.786807, 64.644385, 88.450008, 64.644385),\n (88.450008, 64.644385, 88.113209, 64.644385),\n (88.113209, 64.644385, 87.77641, 64.644385),\n (87.77641, 64.644385, 87.439611, 64.644385),\n (87.439611, 64.644385, 87.102812, 64.644385),\n (87.102812, 64.644385, 86.766013, 64.644385),\n (86.766013, 64.644385, 86.429214, 64.644385),\n (86.429214, 64.644385, 86.092415, 64.644385),\n (96.869985, 64.644385, 96.869985, 149.966815),\n (96.869985, 149.966815, 96.533186, 149.966815),\n (96.533186, 149.966815, 96.196387, 149.966815),\n (96.196387, 149.966815, 95.859588, 149.966815),\n (95.859588, 149.966815, 95.522789, 149.966815),\n (95.522789, 149.966815, 95.18599, 149.966815),\n (95.18599, 149.966815, 94.849191, 149.966815),\n (94.849191, 149.966815, 94.512392, 149.966815),\n (94.512392, 149.966815, 94.175593, 149.966815),\n (94.175593, 149.966815, 93.838793, 149.966815),\n (93.838793, 149.966815, 93.501994, 149.966815),\n (93.501994, 149.966815, 93.165195, 149.966815),\n (93.165195, 149.966815, 92.828396, 149.966815),\n (92.828396, 149.966815, 92.491597, 149.966815),\n (92.491597, 149.966815, 92.154798, 149.966815),\n (92.154798, 149.966815, 91.817999, 149.966815),\n (91.817999, 149.966815, 91.4812, 149.966815),\n (91.4812, 149.966815, 91.144401, 149.966815),\n (91.144401, 149.966815, 90.807602, 149.966815),\n (90.807602, 149.966815, 90.470803, 149.966815),\n (90.470803, 149.966815, 90.134004, 149.966815),\n (90.134004, 149.966815, 89.797205, 149.966815),\n (89.797205, 149.966815, 89.460406, 149.966815),\n (89.460406, 149.966815, 89.123607, 149.966815),\n (89.123607, 149.966815, 88.786807, 149.966815),\n (88.786807, 149.966815, 88.450008, 149.966815),\n (88.450008, 149.966815, 88.113209, 149.966815),\n (88.113209, 149.966815, 87.77641, 149.966815),\n (87.77641, 149.966815, 87.439611, 149.966815),\n (87.439611, 149.966815, 87.102812, 149.966815),\n (87.102812, 149.966815, 86.766013, 149.966815),\n (86.766013, 149.966815, 86.429214, 149.966815),\n (86.429214, 149.966815, 86.092415, 149.966815),\n (86.092415, 149.966815, 86.092415, 64.644385),\n (110.869985, 163.966815, 110.869985, 164.303614),\n (110.869985, 164.303614, 110.869985, 164.640413),\n (110.869985, 164.640413, 110.869985, 164.977212),\n (110.869985, 164.977212, 110.869985, 165.314011),\n (110.869985, 165.314011, 110.869985, 165.65081),\n (110.869985, 165.65081, 110.869985, 165.987609),\n (110.869985, 165.987609, 110.869985, 166.324408),\n (110.869985, 166.324408, 110.869985, 166.661207),\n (110.869985, 166.661207, 110.869985, 166.998007),\n (110.869985, 166.998007, 110.869985, 167.334806),\n (110.869985, 167.334806, 110.869985, 167.671605),\n (110.869985, 167.671605, 110.869985, 168.008404),\n (110.869985, 168.008404, 110.869985, 168.345203),\n (110.869985, 168.345203, 110.869985, 168.682002),\n (110.869985, 168.682002, 110.869985, 169.018801),\n (110.869985, 169.018801, 110.869985, 169.3556),\n (110.869985, 169.3556, 110.869985, 169.692399),\n (110.869985, 169.692399, 110.869985, 170.029198),\n (110.869985, 170.029198, 110.869985, 170.365997),\n (110.869985, 170.365997, 110.869985, 170.702796),\n (110.869985, 170.702796, 110.869985, 171.039595),\n (110.869985, 171.039595, 110.869985, 171.376394),\n (110.869985, 171.376394, 110.869985, 171.713193),\n (110.869985, 171.713193, 110.869985, 172.049993),\n (110.869985, 172.049993, 110.869985, 172.386792),\n (110.869985, 172.386792, 110.869985, 172.723591),\n (110.869985, 172.723591, 110.869985, 173.06039),\n (110.869985, 173.06039, 110.869985, 173.397189),\n (110.869985, 173.397189, 110.869985, 173.733988),\n (110.869985, 173.733988, 110.869985, 174.070787),\n (110.869985, 174.070787, 110.869985, 174.407586),\n (110.869985, 174.407586, 110.869985, 174.744385),\n (196.192415, 163.966815, 196.192415, 164.303614),\n (196.192415, 164.303614, 196.192415, 164.640413),\n (196.192415, 164.640413, 196.192415, 164.977212),\n (196.192415, 164.977212, 196.192415, 165.314011),\n (196.192415, 165.314011, 196.192415, 165.65081),\n (196.192415, 165.65081, 196.192415, 165.987609),\n (196.192415, 165.987609, 196.192415, 166.324408),\n (196.192415, 166.324408, 196.192415, 166.661207),\n (196.192415, 166.661207, 196.192415, 166.998007),\n (196.192415, 166.998007, 196.192415, 167.334806),\n (196.192415, 167.334806, 196.192415, 167.671605),\n (196.192415, 167.671605, 196.192415, 168.008404),\n (196.192415, 168.008404, 196.192415, 168.345203),\n (196.192415, 168.345203, 196.192415, 168.682002),\n (196.192415, 168.682002, 196.192415, 169.018801),\n (196.192415, 169.018801, 196.192415, 169.3556),\n (196.192415, 169.3556, 196.192415, 169.692399),\n (196.192415, 169.692399, 196.192415, 170.029198),\n (196.192415, 170.029198, 196.192415, 170.365997),\n (196.192415, 170.365997, 196.192415, 170.702796),\n (196.192415, 170.702796, 196.192415, 171.039595),\n (196.192415, 171.039595, 196.192415, 171.376394),\n (196.192415, 171.376394, 196.192415, 171.713193),\n (196.192415, 171.713193, 196.192415, 172.049993),\n (196.192415, 172.049993, 196.192415, 172.386792),\n (196.192415, 172.386792, 196.192415, 172.723591),\n (196.192415, 172.723591, 196.192415, 173.06039),\n (196.192415, 173.06039, 196.192415, 173.397189),\n (196.192415, 173.397189, 196.192415, 173.733988),\n (196.192415, 173.733988, 196.192415, 174.070787),\n (196.192415, 174.070787, 196.192415, 174.407586),\n (196.192415, 174.407586, 196.192415, 174.744385),\n (196.192415, 163.966815, 110.869985, 163.966815),\n (196.192415, 174.744385, 110.869985, 174.744385)\n]\nVISIBLE_CIRCLES = [\n (91.4812, 169.3556, 5.388785),\n (91.4812, 169.3556, 4.041589)\n]\nVISIBLE_ARCS = [\n\n]\nHIDDEN_SEGMENTS = [\n (95.5228, 149.9668, 95.5228, 64.6444),\n (87.4396, 64.6444, 87.4396, 149.9668),\n (196.1924, 173.3972, 110.87, 173.3972),\n (196.1924, 165.314, 110.87, 165.314)\n]\n# (orient, text, p1, p2, base) for linear; (orient, text, center, radius, angle) for diameter\nDIMENSIONS = [\n ('diameter', '%%c100', (91.4812, 169.3556), 5.3888, 45),\n ('diameter', '%%c75', (91.4812, 169.3556), 4.0416, 135),\n ('horizontal', '791.667', (110.87, 169.3556), (196.1924, 169.3556), (153.5312, 180.3556))\n]\n\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\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\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,\n angle=(0 if d[0] == \"horizontal\" else 90),\n 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,\n text=text, dimstyle=\"EZDXF\").render()\n\n doc.saveas(out_path)\n\n\nif __name__ == \"__main__\":\n out = sys.argv[1] if len(sys.argv) > 1 else \"0074_00742515_gt.dxf\"\n draw(out)\n print(\"wrote\", out)\n```"}], "images": ["images/0074_00742515.png"], "id": "0074_00742515"} {"messages": [{"role": "user", "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 51.06 mm. It is extruded to a thickness of 101.06 mm."}, {"role": "assistant", "content": "```python\n#!/usr/bin/env python3\n# -*- coding: utf-8 -*-\n# Ground-truth 2D engineering drawing for part: 0074_00748188\n# Self-contained: reproduces the three-view DXF via ezdxf, NO FreeCAD needed.\n# Coordinates are A4 page millimetres (scale=0.4779576719576815, page=[297.0, 210.0]).\n# visible edges -> solid (layer OUTLINE); hidden edges -> dashed (layer HIDDEN)\n# dimensions -> real movable DIMENSION entities (text = true mm value)\n# Run: python 0074_00748188_gt.py [out.dxf]\nimport sys\nimport ezdxf\n\nSCALE = 0.4779576719576815\nPAGE = [297.0, 210.0]\n\nVISIBLE_SEGMENTS = [\n (127.220484, 73.898883, 125.726866, 73.898883),\n (125.726866, 73.898883, 124.233248, 73.898883),\n (124.233248, 73.898883, 122.73963, 73.898883),\n (122.73963, 73.898883, 121.246013, 73.898883),\n (121.246013, 73.898883, 119.752395, 73.898883),\n (119.752395, 73.898883, 118.258777, 73.898883),\n (118.258777, 73.898883, 116.76516, 73.898883),\n (116.76516, 73.898883, 115.271542, 73.898883),\n (115.271542, 73.898883, 113.777924, 73.898883),\n (113.777924, 73.898883, 112.284306, 73.898883),\n (112.284306, 73.898883, 110.790689, 73.898883),\n (110.790689, 73.898883, 109.297071, 73.898883),\n (109.297071, 73.898883, 107.803453, 73.898883),\n (107.803453, 73.898883, 106.309835, 73.898883),\n (106.309835, 73.898883, 104.816218, 73.898883),\n (104.816218, 73.898883, 103.3226, 73.898883),\n (103.3226, 73.898883, 101.828982, 73.898883),\n (101.828982, 73.898883, 100.335365, 73.898883),\n (100.335365, 73.898883, 98.841747, 73.898883),\n (98.841747, 73.898883, 97.348129, 73.898883),\n (97.348129, 73.898883, 95.854511, 73.898883),\n (95.854511, 73.898883, 94.360894, 73.898883),\n (94.360894, 73.898883, 92.867276, 73.898883),\n (92.867276, 73.898883, 91.373658, 73.898883),\n (91.373658, 73.898883, 89.88004, 73.898883),\n (89.88004, 73.898883, 88.386423, 73.898883),\n (88.386423, 73.898883, 86.892805, 73.898883),\n (86.892805, 73.898883, 85.399187, 73.898883),\n (85.399187, 73.898883, 83.90557, 73.898883),\n (83.90557, 73.898883, 82.411952, 73.898883),\n (82.411952, 73.898883, 80.918334, 73.898883),\n (80.918334, 73.898883, 79.424716, 73.898883),\n (127.220484, 73.898883, 127.220484, 122.203116),\n (127.220484, 122.203116, 125.726866, 122.203116),\n (125.726866, 122.203116, 124.233248, 122.203116),\n (124.233248, 122.203116, 122.73963, 122.203116),\n (122.73963, 122.203116, 121.246013, 122.203116),\n (121.246013, 122.203116, 119.752395, 122.203116),\n (119.752395, 122.203116, 118.258777, 122.203116),\n (118.258777, 122.203116, 116.76516, 122.203116),\n (116.76516, 122.203116, 115.271542, 122.203116),\n (115.271542, 122.203116, 113.777924, 122.203116),\n (113.777924, 122.203116, 112.284306, 122.203116),\n (112.284306, 122.203116, 110.790689, 122.203116),\n (110.790689, 122.203116, 109.297071, 122.203116),\n (109.297071, 122.203116, 107.803453, 122.203116),\n (107.803453, 122.203116, 106.309835, 122.203116),\n (106.309835, 122.203116, 104.816218, 122.203116),\n (104.816218, 122.203116, 103.3226, 122.203116),\n (103.3226, 122.203116, 101.828982, 122.203116),\n (101.828982, 122.203116, 100.335365, 122.203116),\n (100.335365, 122.203116, 98.841747, 122.203116),\n (98.841747, 122.203116, 97.348129, 122.203116),\n (97.348129, 122.203116, 95.854511, 122.203116),\n (95.854511, 122.203116, 94.360894, 122.203116),\n (94.360894, 122.203116, 92.867276, 122.203116),\n (92.867276, 122.203116, 91.373658, 122.203116),\n (91.373658, 122.203116, 89.88004, 122.203116),\n (89.88004, 122.203116, 88.386423, 122.203116),\n (88.386423, 122.203116, 86.892805, 122.203116),\n (86.892805, 122.203116, 85.399187, 122.203116),\n (85.399187, 122.203116, 83.90557, 122.203116),\n (83.90557, 122.203116, 82.411952, 122.203116),\n (82.411952, 122.203116, 80.918334, 122.203116),\n (80.918334, 122.203116, 79.424716, 122.203116),\n (79.424716, 122.203116, 79.424716, 73.898883),\n (141.220484, 136.203116, 141.220484, 137.696734),\n (141.220484, 137.696734, 141.220484, 139.190352),\n (141.220484, 139.190352, 141.220484, 140.68397),\n (141.220484, 140.68397, 141.220484, 142.177587),\n (141.220484, 142.177587, 141.220484, 143.671205),\n (141.220484, 143.671205, 141.220484, 145.164823),\n (141.220484, 145.164823, 141.220484, 146.65844),\n (141.220484, 146.65844, 141.220484, 148.152058),\n (141.220484, 148.152058, 141.220484, 149.645676),\n (141.220484, 149.645676, 141.220484, 151.139294),\n (141.220484, 151.139294, 141.220484, 152.632911),\n (141.220484, 152.632911, 141.220484, 154.126529),\n (141.220484, 154.126529, 141.220484, 155.620147),\n (141.220484, 155.620147, 141.220484, 157.113765),\n (141.220484, 157.113765, 141.220484, 158.607382),\n (141.220484, 158.607382, 141.220484, 160.101),\n (141.220484, 160.101, 141.220484, 161.594618),\n (141.220484, 161.594618, 141.220484, 163.088235),\n (141.220484, 163.088235, 141.220484, 164.581853),\n (141.220484, 164.581853, 141.220484, 166.075471),\n (141.220484, 166.075471, 141.220484, 167.569089),\n (141.220484, 167.569089, 141.220484, 169.062706),\n (141.220484, 169.062706, 141.220484, 170.556324),\n (141.220484, 170.556324, 141.220484, 172.049942),\n (141.220484, 172.049942, 141.220484, 173.54356),\n (141.220484, 173.54356, 141.220484, 175.037177),\n (141.220484, 175.037177, 141.220484, 176.530795),\n (141.220484, 176.530795, 141.220484, 178.024413),\n (141.220484, 178.024413, 141.220484, 179.51803),\n (141.220484, 179.51803, 141.220484, 181.011648),\n (141.220484, 181.011648, 141.220484, 182.505266),\n (141.220484, 182.505266, 141.220484, 183.998884),\n (189.524717, 136.203116, 189.524717, 137.696734),\n (189.524717, 137.696734, 189.524717, 139.190352),\n (189.524717, 139.190352, 189.524717, 140.68397),\n (189.524717, 140.68397, 189.524717, 142.177587),\n (189.524717, 142.177587, 189.524717, 143.671205),\n (189.524717, 143.671205, 189.524717, 145.164823),\n (189.524717, 145.164823, 189.524717, 146.65844),\n (189.524717, 146.65844, 189.524717, 148.152058),\n (189.524717, 148.152058, 189.524717, 149.645676),\n (189.524717, 149.645676, 189.524717, 151.139294),\n (189.524717, 151.139294, 189.524717, 152.632911),\n (189.524717, 152.632911, 189.524717, 154.126529),\n (189.524717, 154.126529, 189.524717, 155.620147),\n (189.524717, 155.620147, 189.524717, 157.113765),\n (189.524717, 157.113765, 189.524717, 158.607382),\n (189.524717, 158.607382, 189.524717, 160.101),\n (189.524717, 160.101, 189.524717, 161.594618),\n (189.524717, 161.594618, 189.524717, 163.088235),\n (189.524717, 163.088235, 189.524717, 164.581853),\n (189.524717, 164.581853, 189.524717, 166.075471),\n (189.524717, 166.075471, 189.524717, 167.569089),\n (189.524717, 167.569089, 189.524717, 169.062706),\n (189.524717, 169.062706, 189.524717, 170.556324),\n (189.524717, 170.556324, 189.524717, 172.049942),\n (189.524717, 172.049942, 189.524717, 173.54356),\n (189.524717, 173.54356, 189.524717, 175.037177),\n (189.524717, 175.037177, 189.524717, 176.530795),\n (189.524717, 176.530795, 189.524717, 178.024413),\n (189.524717, 178.024413, 189.524717, 179.51803),\n (189.524717, 179.51803, 189.524717, 181.011648),\n (189.524717, 181.011648, 189.524717, 182.505266),\n (189.524717, 182.505266, 189.524717, 183.998884),\n (189.524717, 136.203116, 141.220484, 136.203116),\n (189.524717, 183.998884, 141.220484, 183.998884)\n]\nVISIBLE_CIRCLES = [\n (103.3226, 160.101, 23.897884),\n (103.3226, 160.101, 12.203175)\n]\nVISIBLE_ARCS = [\n\n]\nHIDDEN_SEGMENTS = [\n (115.5258, 122.2032, 115.5258, 73.8989),\n (91.1194, 73.8989, 91.1194, 122.2032),\n (189.5247, 172.3042, 141.2205, 172.3042),\n (189.5247, 147.8979, 141.2205, 147.8979)\n]\n# (orient, text, p1, p2, base) for linear; (orient, text, center, radius, angle) for diameter\nDIMENSIONS = [\n ('diameter', '%%c100', (103.3226, 160.101), 23.8979, 45),\n ('diameter', '%%c51.0638', (103.3226, 160.101), 12.2032, 135),\n ('horizontal', '101.064', (141.2205, 160.101), (189.5247, 160.101), (165.3726, 171.101))\n]\n\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\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\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,\n angle=(0 if d[0] == \"horizontal\" else 90),\n 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,\n text=text, dimstyle=\"EZDXF\").render()\n\n doc.saveas(out_path)\n\n\nif __name__ == \"__main__\":\n out = sys.argv[1] if len(sys.argv) > 1 else \"0074_00748188_gt.dxf\"\n draw(out)\n print(\"wrote\", out)\n```"}], "images": ["images/0074_00748188.png"], "id": "0074_00748188"} {"messages": [{"role": "user", "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": "assistant", "content": "```python\n#!/usr/bin/env python3\n# -*- coding: utf-8 -*-\n# Ground-truth 2D engineering drawing for part: 0075_00752616\n# Self-contained: reproduces the three-view DXF via ezdxf, NO FreeCAD needed.\n# Coordinates are A4 page millimetres (scale=0.6029803921568627, page=[297.0, 210.0]).\n# visible edges -> solid (layer OUTLINE); hidden edges -> dashed (layer HIDDEN)\n# dimensions -> real movable DIMENSION entities (text = true mm value)\n# Run: python 0075_00752616_gt.py [out.dxf]\nimport sys\nimport ezdxf\n\nSCALE = 0.6029803921568627\nPAGE = [297.0, 210.0]\n\nVISIBLE_SEGMENTS = [\n (137.28512, 77.024519, 135.400806, 77.024519),\n (135.400806, 77.024519, 133.516492, 77.024519),\n (133.516492, 77.024519, 131.632178, 77.024519),\n (131.632178, 77.024519, 129.747865, 77.024519),\n (129.747865, 77.024519, 127.863551, 77.024519),\n (127.863551, 77.024519, 125.979237, 77.024519),\n (125.979237, 77.024519, 124.094924, 77.024519),\n (124.094924, 77.024519, 122.21061, 77.024519),\n (122.21061, 77.024519, 120.326296, 77.024519),\n (120.326296, 77.024519, 118.441982, 77.024519),\n (118.441982, 77.024519, 116.557669, 77.024519),\n (116.557669, 77.024519, 114.673355, 77.024519),\n (114.673355, 77.024519, 112.789041, 77.024519),\n (112.789041, 77.024519, 110.904727, 77.024519),\n (110.904727, 77.024519, 109.020414, 77.024519),\n (109.020414, 77.024519, 107.1361, 77.024519),\n (107.1361, 77.024519, 105.251786, 77.024519),\n (105.251786, 77.024519, 103.367473, 77.024519),\n (103.367473, 77.024519, 101.483159, 77.024519),\n (101.483159, 77.024519, 99.598845, 77.024519),\n (99.598845, 77.024519, 97.714531, 77.024519),\n (97.714531, 77.024519, 95.830218, 77.024519),\n (95.830218, 77.024519, 93.945904, 77.024519),\n (93.945904, 77.024519, 92.06159, 77.024519),\n (92.06159, 77.024519, 90.177276, 77.024519),\n (90.177276, 77.024519, 88.292963, 77.024519),\n (88.292963, 77.024519, 86.408649, 77.024519),\n (86.408649, 77.024519, 84.524335, 77.024519),\n (84.524335, 77.024519, 82.640022, 77.024519),\n (82.640022, 77.024519, 80.755708, 77.024519),\n (80.755708, 77.024519, 78.871394, 77.024519),\n (78.871394, 77.024519, 76.98708, 77.024519),\n (137.28512, 77.024519, 137.28512, 112.82648),\n (137.28512, 112.82648, 135.400806, 112.82648),\n (135.400806, 112.82648, 133.516492, 112.82648),\n (133.516492, 112.82648, 131.632178, 112.82648),\n (131.632178, 112.82648, 129.747865, 112.82648),\n (129.747865, 112.82648, 127.863551, 112.82648),\n (127.863551, 112.82648, 125.979237, 112.82648),\n (125.979237, 112.82648, 124.094924, 112.82648),\n (124.094924, 112.82648, 122.21061, 112.82648),\n (122.21061, 112.82648, 120.326296, 112.82648),\n (120.326296, 112.82648, 118.441982, 112.82648),\n (118.441982, 112.82648, 116.557669, 112.82648),\n (116.557669, 112.82648, 114.673355, 112.82648),\n (114.673355, 112.82648, 112.789041, 112.82648),\n (112.789041, 112.82648, 110.904727, 112.82648),\n (110.904727, 112.82648, 109.020414, 112.82648),\n (109.020414, 112.82648, 107.1361, 112.82648),\n (107.1361, 112.82648, 105.251786, 112.82648),\n (105.251786, 112.82648, 103.367473, 112.82648),\n (103.367473, 112.82648, 101.483159, 112.82648),\n (101.483159, 112.82648, 99.598845, 112.82648),\n (99.598845, 112.82648, 97.714531, 112.82648),\n (97.714531, 112.82648, 95.830218, 112.82648),\n (95.830218, 112.82648, 93.945904, 112.82648),\n (93.945904, 112.82648, 92.06159, 112.82648),\n (92.06159, 112.82648, 90.177276, 112.82648),\n (90.177276, 112.82648, 88.292963, 112.82648),\n (88.292963, 112.82648, 86.408649, 112.82648),\n (86.408649, 112.82648, 84.524335, 112.82648),\n (84.524335, 112.82648, 82.640022, 112.82648),\n (82.640022, 112.82648, 80.755708, 112.82648),\n (80.755708, 112.82648, 78.871394, 112.82648),\n (78.871394, 112.82648, 76.98708, 112.82648),\n (76.98708, 112.82648, 76.98708, 77.024519),\n (151.28512, 126.82648, 151.28512, 128.710794),\n (151.28512, 128.710794, 151.28512, 130.595108),\n (151.28512, 130.595108, 151.28512, 132.479422),\n (151.28512, 132.479422, 151.28512, 134.363735),\n (151.28512, 134.363735, 151.28512, 136.248049),\n (151.28512, 136.248049, 151.28512, 138.132363),\n (151.28512, 138.132363, 151.28512, 140.016676),\n (151.28512, 140.016676, 151.28512, 141.90099),\n (151.28512, 141.90099, 151.28512, 143.785304),\n (151.28512, 143.785304, 151.28512, 145.669618),\n (151.28512, 145.669618, 151.28512, 147.553931),\n (151.28512, 147.553931, 151.28512, 149.438245),\n (151.28512, 149.438245, 151.28512, 151.322559),\n (151.28512, 151.322559, 151.28512, 153.206873),\n (151.28512, 153.206873, 151.28512, 155.091186),\n (151.28512, 155.091186, 151.28512, 156.9755),\n (151.28512, 156.9755, 151.28512, 158.859814),\n (151.28512, 158.859814, 151.28512, 160.744127),\n (151.28512, 160.744127, 151.28512, 162.628441),\n (151.28512, 162.628441, 151.28512, 164.512755),\n (151.28512, 164.512755, 151.28512, 166.397069),\n (151.28512, 166.397069, 151.28512, 168.281382),\n (151.28512, 168.281382, 151.28512, 170.165696),\n (151.28512, 170.165696, 151.28512, 172.05001),\n (151.28512, 172.05001, 151.28512, 173.934324),\n (151.28512, 173.934324, 151.28512, 175.818637),\n (151.28512, 175.818637, 151.28512, 177.702951),\n (151.28512, 177.702951, 151.28512, 179.587265),\n (151.28512, 179.587265, 151.28512, 181.471578),\n (151.28512, 181.471578, 151.28512, 183.355892),\n (151.28512, 183.355892, 151.28512, 185.240206),\n (151.28512, 185.240206, 151.28512, 187.12452),\n (187.087081, 126.82648, 187.087081, 128.710794),\n (187.087081, 128.710794, 187.087081, 130.595108),\n (187.087081, 130.595108, 187.087081, 132.479422),\n (187.087081, 132.479422, 187.087081, 134.363735),\n (187.087081, 134.363735, 187.087081, 136.248049),\n (187.087081, 136.248049, 187.087081, 138.132363),\n (187.087081, 138.132363, 187.087081, 140.016676),\n (187.087081, 140.016676, 187.087081, 141.90099),\n (187.087081, 141.90099, 187.087081, 143.785304),\n (187.087081, 143.785304, 187.087081, 145.669618),\n (187.087081, 145.669618, 187.087081, 147.553931),\n (187.087081, 147.553931, 187.087081, 149.438245),\n (187.087081, 149.438245, 187.087081, 151.322559),\n (187.087081, 151.322559, 187.087081, 153.206873),\n (187.087081, 153.206873, 187.087081, 155.091186),\n (187.087081, 155.091186, 187.087081, 156.9755),\n (187.087081, 156.9755, 187.087081, 158.859814),\n (187.087081, 158.859814, 187.087081, 160.744127),\n (187.087081, 160.744127, 187.087081, 162.628441),\n (187.087081, 162.628441, 187.087081, 164.512755),\n (187.087081, 164.512755, 187.087081, 166.397069),\n (187.087081, 166.397069, 187.087081, 168.281382),\n (187.087081, 168.281382, 187.087081, 170.165696),\n (187.087081, 170.165696, 187.087081, 172.05001),\n (187.087081, 172.05001, 187.087081, 173.934324),\n (187.087081, 173.934324, 187.087081, 175.818637),\n (187.087081, 175.818637, 187.087081, 177.702951),\n (187.087081, 177.702951, 187.087081, 179.587265),\n (187.087081, 179.587265, 187.087081, 181.471578),\n (187.087081, 181.471578, 187.087081, 183.355892),\n (187.087081, 183.355892, 187.087081, 185.240206),\n (187.087081, 185.240206, 187.087081, 187.12452),\n (187.087081, 126.82648, 151.28512, 126.82648),\n (187.087081, 187.12452, 151.28512, 187.12452)\n]\nVISIBLE_CIRCLES = [\n (107.1361, 156.9755, 30.14902),\n (107.1361, 156.9755, 15.702614)\n]\nVISIBLE_ARCS = [\n\n]\nHIDDEN_SEGMENTS = [\n (122.8387, 112.8265, 122.8387, 77.0245),\n (91.4335, 77.0245, 91.4335, 112.8265),\n (187.0871, 172.6781, 151.2851, 172.6781),\n (187.0871, 141.2729, 151.2851, 141.2729)\n]\n# (orient, text, p1, p2, base) for linear; (orient, text, center, radius, angle) for diameter\nDIMENSIONS = [\n ('diameter', '%%c100', (107.1361, 156.9755), 30.149, 45),\n ('diameter', '%%c52.0833', (107.1361, 156.9755), 15.7026, 135),\n ('horizontal', '59.375', (151.2851, 156.9755), (187.0871, 156.9755), (169.1861, 167.9755))\n]\n\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\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\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,\n angle=(0 if d[0] == \"horizontal\" else 90),\n 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,\n text=text, dimstyle=\"EZDXF\").render()\n\n doc.saveas(out_path)\n\n\nif __name__ == \"__main__\":\n out = sys.argv[1] if len(sys.argv) > 1 else \"0075_00752616_gt.dxf\"\n draw(out)\n print(\"wrote\", out)\n```"}], "images": ["images/0075_00752616.png"], "id": "0075_00752616"} {"messages": [{"role": "user", "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 26.8 mm."}, {"role": "assistant", "content": "```python\n#!/usr/bin/env python3\n# -*- coding: utf-8 -*-\n# Ground-truth 2D engineering drawing for part: 0075_00753801\n# Self-contained: reproduces the three-view DXF via ezdxf, NO FreeCAD needed.\n# Coordinates are A4 page millimetres (scale=0.7347, page=[297.0, 210.0]).\n# visible edges -> solid (layer OUTLINE); hidden edges -> dashed (layer HIDDEN)\n# dimensions -> real movable DIMENSION entities (text = true mm value)\n# Run: python 0075_00753801_gt.py [out.dxf]\nimport sys\nimport ezdxf\n\nSCALE = 0.7347\nPAGE = [297.0, 210.0]\n\nVISIBLE_SEGMENTS = [\n (80.3531, 101.4779, 82.649037, 101.4779),\n (82.649037, 101.4779, 84.944975, 101.4779),\n (84.944975, 101.4779, 87.240912, 101.4779),\n (87.240912, 101.4779, 89.53685, 101.4779),\n (89.53685, 101.4779, 91.832787, 101.4779),\n (91.832787, 101.4779, 94.128725, 101.4779),\n (94.128725, 101.4779, 96.424662, 101.4779),\n (96.424662, 101.4779, 98.7206, 101.4779),\n (98.7206, 101.4779, 101.016538, 101.4779),\n (101.016538, 101.4779, 103.312475, 101.4779),\n (103.312475, 101.4779, 105.608413, 101.4779),\n (105.608413, 101.4779, 107.90435, 101.4779),\n (107.90435, 101.4779, 110.200288, 101.4779),\n (110.200288, 101.4779, 112.496225, 101.4779),\n (112.496225, 101.4779, 114.792163, 101.4779),\n (114.792163, 101.4779, 117.0881, 101.4779),\n (117.0881, 101.4779, 119.384037, 101.4779),\n (119.384037, 101.4779, 121.679975, 101.4779),\n (121.679975, 101.4779, 123.975912, 101.4779),\n (123.975912, 101.4779, 126.27185, 101.4779),\n (126.27185, 101.4779, 128.567788, 101.4779),\n (128.567788, 101.4779, 130.863725, 101.4779),\n (130.863725, 101.4779, 133.159663, 101.4779),\n (133.159663, 101.4779, 135.4556, 101.4779),\n (135.4556, 101.4779, 137.751538, 101.4779),\n (137.751538, 101.4779, 140.047475, 101.4779),\n (140.047475, 101.4779, 142.343413, 101.4779),\n (142.343413, 101.4779, 144.63935, 101.4779),\n (144.63935, 101.4779, 146.935288, 101.4779),\n (146.935288, 101.4779, 149.231225, 101.4779),\n (149.231225, 101.4779, 151.527163, 101.4779),\n (151.527163, 101.4779, 153.8231, 101.4779),\n (153.8231, 101.4779, 153.8231, 81.787047),\n (80.3531, 81.787047, 82.649037, 81.787047),\n (82.649037, 81.787047, 84.944975, 81.787047),\n (84.944975, 81.787047, 87.240912, 81.787047),\n (87.240912, 81.787047, 89.53685, 81.787047),\n (89.53685, 81.787047, 91.832787, 81.787047),\n (91.832787, 81.787047, 94.128725, 81.787047),\n (94.128725, 81.787047, 96.424662, 81.787047),\n (96.424662, 81.787047, 98.7206, 81.787047),\n (98.7206, 81.787047, 101.016538, 81.787047),\n (101.016538, 81.787047, 103.312475, 81.787047),\n (103.312475, 81.787047, 105.608413, 81.787047),\n (105.608413, 81.787047, 107.90435, 81.787047),\n (107.90435, 81.787047, 110.200288, 81.787047),\n (110.200288, 81.787047, 112.496225, 81.787047),\n (112.496225, 81.787047, 114.792163, 81.787047),\n (114.792163, 81.787047, 117.0881, 81.787047),\n (117.0881, 81.787047, 119.384037, 81.787047),\n (119.384037, 81.787047, 121.679975, 81.787047),\n (121.679975, 81.787047, 123.975912, 81.787047),\n (123.975912, 81.787047, 126.27185, 81.787047),\n (126.27185, 81.787047, 128.567788, 81.787047),\n (128.567788, 81.787047, 130.863725, 81.787047),\n (130.863725, 81.787047, 133.159663, 81.787047),\n (133.159663, 81.787047, 135.4556, 81.787047),\n (135.4556, 81.787047, 137.751538, 81.787047),\n (137.751538, 81.787047, 140.047475, 81.787047),\n (140.047475, 81.787047, 142.343413, 81.787047),\n (142.343413, 81.787047, 144.63935, 81.787047),\n (144.63935, 81.787047, 146.935288, 81.787047),\n (146.935288, 81.787047, 149.231225, 81.787047),\n (149.231225, 81.787047, 151.527163, 81.787047),\n (151.527163, 81.787047, 153.8231, 81.787047),\n (80.3531, 81.787047, 80.3531, 101.4779),\n (187.513953, 188.9479, 187.513953, 186.651962),\n (187.513953, 186.651962, 187.513953, 184.356025),\n (187.513953, 184.356025, 187.513953, 182.060088),\n (187.513953, 182.060088, 187.513953, 179.76415),\n (187.513953, 179.76415, 187.513953, 177.468212),\n (187.513953, 177.468212, 187.513953, 175.172275),\n (187.513953, 175.172275, 187.513953, 172.876338),\n (187.513953, 172.876338, 187.513953, 170.5804),\n (187.513953, 170.5804, 187.513953, 168.284463),\n (187.513953, 168.284463, 187.513953, 165.988525),\n (187.513953, 165.988525, 187.513953, 163.692588),\n (187.513953, 163.692588, 187.513953, 161.39665),\n (187.513953, 161.39665, 187.513953, 159.100713),\n (187.513953, 159.100713, 187.513953, 156.804775),\n (187.513953, 156.804775, 187.513953, 154.508838),\n (187.513953, 154.508838, 187.513953, 152.2129),\n (187.513953, 152.2129, 187.513953, 149.916962),\n (187.513953, 149.916962, 187.513953, 147.621025),\n (187.513953, 147.621025, 187.513953, 145.325087),\n (187.513953, 145.325087, 187.513953, 143.02915),\n (187.513953, 143.02915, 187.513953, 140.733213),\n (187.513953, 140.733213, 187.513953, 138.437275),\n (187.513953, 138.437275, 187.513953, 136.141338),\n (187.513953, 136.141338, 187.513953, 133.8454),\n (187.513953, 133.8454, 187.513953, 131.549463),\n (187.513953, 131.549463, 187.513953, 129.253525),\n (187.513953, 129.253525, 187.513953, 126.957588),\n (187.513953, 126.957588, 187.513953, 124.66165),\n (187.513953, 124.66165, 187.513953, 122.365713),\n (187.513953, 122.365713, 187.513953, 120.069775),\n (187.513953, 120.069775, 187.513953, 117.773838),\n (187.513953, 117.773838, 187.513953, 115.4779),\n (167.8231, 188.9479, 167.8231, 186.651962),\n (167.8231, 186.651962, 167.8231, 184.356025),\n (167.8231, 184.356025, 167.8231, 182.060088),\n (167.8231, 182.060088, 167.8231, 179.76415),\n (167.8231, 179.76415, 167.8231, 177.468212),\n (167.8231, 177.468212, 167.8231, 175.172275),\n (167.8231, 175.172275, 167.8231, 172.876338),\n (167.8231, 172.876338, 167.8231, 170.5804),\n (167.8231, 170.5804, 167.8231, 168.284463),\n (167.8231, 168.284463, 167.8231, 165.988525),\n (167.8231, 165.988525, 167.8231, 163.692588),\n (167.8231, 163.692588, 167.8231, 161.39665),\n (167.8231, 161.39665, 167.8231, 159.100713),\n (167.8231, 159.100713, 167.8231, 156.804775),\n (167.8231, 156.804775, 167.8231, 154.508838),\n (167.8231, 154.508838, 167.8231, 152.2129),\n (167.8231, 152.2129, 167.8231, 149.916963),\n (167.8231, 149.916963, 167.8231, 147.621025),\n (167.8231, 147.621025, 167.8231, 145.325087),\n (167.8231, 145.325087, 167.8231, 143.02915),\n (167.8231, 143.02915, 167.8231, 140.733213),\n (167.8231, 140.733213, 167.8231, 138.437275),\n (167.8231, 138.437275, 167.8231, 136.141338),\n (167.8231, 136.141338, 167.8231, 133.8454),\n (167.8231, 133.8454, 167.8231, 131.549463),\n (167.8231, 131.549463, 167.8231, 129.253525),\n (167.8231, 129.253525, 167.8231, 126.957588),\n (167.8231, 126.957588, 167.8231, 124.66165),\n (167.8231, 124.66165, 167.8231, 122.365713),\n (167.8231, 122.365713, 167.8231, 120.069775),\n (167.8231, 120.069775, 167.8231, 117.773838),\n (167.8231, 117.773838, 167.8231, 115.4779),\n (167.8231, 188.9479, 187.513953, 188.9479),\n (167.8231, 115.4779, 187.513953, 115.4779)\n]\nVISIBLE_CIRCLES = [\n (117.0881, 152.2129, 36.735),\n (117.0881, 152.2129, 1.530625)\n]\nVISIBLE_ARCS = [\n\n]\nHIDDEN_SEGMENTS = [\n (118.6188, 81.7871, 118.6188, 101.4779),\n (115.5575, 101.4779, 115.5575, 81.7871),\n (167.8232, 150.6823, 187.514, 150.6823),\n (167.8232, 153.7436, 187.514, 153.7436)\n]\n# (orient, text, p1, p2, base) for linear; (orient, text, center, radius, angle) for diameter\nDIMENSIONS = [\n ('diameter', '%%c100', (117.0881, 152.2129), 36.735, 45),\n ('diameter', '%%c4.1667', (117.0881, 152.2129), 1.5306, 135),\n ('horizontal', '26.8012', (187.514, 152.2129), (167.8232, 152.2129), (177.6686, 141.2129))\n]\n\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\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\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,\n angle=(0 if d[0] == \"horizontal\" else 90),\n 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,\n text=text, dimstyle=\"EZDXF\").render()\n\n doc.saveas(out_path)\n\n\nif __name__ == \"__main__\":\n out = sys.argv[1] if len(sys.argv) > 1 else \"0075_00753801_gt.dxf\"\n draw(out)\n print(\"wrote\", out)\n```"}], "images": ["images/0075_00753801.png"], "id": "0075_00753801"} {"messages": [{"role": "user", "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 95.96 mm."}, {"role": "assistant", "content": "```python\n#!/usr/bin/env python3\n# -*- coding: utf-8 -*-\n# Ground-truth 2D engineering drawing for part: 0077_00772808\n# Self-contained: reproduces the three-view DXF via ezdxf, NO FreeCAD needed.\n# Coordinates are A4 page millimetres (scale=0.4904072164948452, page=[297.0, 210.0]).\n# visible edges -> solid (layer OUTLINE); hidden edges -> dashed (layer HIDDEN)\n# dimensions -> real movable DIMENSION entities (text = true mm value)\n# Run: python 0077_00772808_gt.py [out.dxf]\nimport sys\nimport ezdxf\n\nSCALE = 0.4904072164948452\nPAGE = [297.0, 210.0]\n\nVISIBLE_SEGMENTS = [\n (125.996761, 74.210161, 124.464238, 74.210161),\n (124.464238, 74.210161, 122.931716, 74.210161),\n (122.931716, 74.210161, 121.399193, 74.210161),\n (121.399193, 74.210161, 119.866671, 74.210161),\n (119.866671, 74.210161, 118.334148, 74.210161),\n (118.334148, 74.210161, 116.801626, 74.210161),\n (116.801626, 74.210161, 115.269103, 74.210161),\n (115.269103, 74.210161, 113.73658, 74.210161),\n (113.73658, 74.210161, 112.204058, 74.210161),\n (112.204058, 74.210161, 110.671535, 74.210161),\n (110.671535, 74.210161, 109.139013, 74.210161),\n (109.139013, 74.210161, 107.60649, 74.210161),\n (107.60649, 74.210161, 106.073968, 74.210161),\n (106.073968, 74.210161, 104.541445, 74.210161),\n (104.541445, 74.210161, 103.008923, 74.210161),\n (103.008923, 74.210161, 101.4764, 74.210161),\n (101.4764, 74.210161, 99.943877, 74.210161),\n (99.943877, 74.210161, 98.411355, 74.210161),\n (98.411355, 74.210161, 96.878832, 74.210161),\n (96.878832, 74.210161, 95.34631, 74.210161),\n (95.34631, 74.210161, 93.813787, 74.210161),\n (93.813787, 74.210161, 92.281265, 74.210161),\n (92.281265, 74.210161, 90.748742, 74.210161),\n (90.748742, 74.210161, 89.21622, 74.210161),\n (89.21622, 74.210161, 87.683697, 74.210161),\n (87.683697, 74.210161, 86.151174, 74.210161),\n (86.151174, 74.210161, 84.618652, 74.210161),\n (84.618652, 74.210161, 83.086129, 74.210161),\n (83.086129, 74.210161, 81.553607, 74.210161),\n (81.553607, 74.210161, 80.021084, 74.210161),\n (80.021084, 74.210161, 78.488562, 74.210161),\n (78.488562, 74.210161, 76.956039, 74.210161),\n (125.996761, 74.210161, 125.996761, 121.269439),\n (125.996761, 121.269439, 124.464238, 121.269439),\n (124.464238, 121.269439, 122.931716, 121.269439),\n (122.931716, 121.269439, 121.399193, 121.269439),\n (121.399193, 121.269439, 119.866671, 121.269439),\n (119.866671, 121.269439, 118.334148, 121.269439),\n (118.334148, 121.269439, 116.801626, 121.269439),\n (116.801626, 121.269439, 115.269103, 121.269439),\n (115.269103, 121.269439, 113.73658, 121.269439),\n (113.73658, 121.269439, 112.204058, 121.269439),\n (112.204058, 121.269439, 110.671535, 121.269439),\n (110.671535, 121.269439, 109.139013, 121.269439),\n (109.139013, 121.269439, 107.60649, 121.269439),\n (107.60649, 121.269439, 106.073968, 121.269439),\n (106.073968, 121.269439, 104.541445, 121.269439),\n (104.541445, 121.269439, 103.008923, 121.269439),\n (103.008923, 121.269439, 101.4764, 121.269439),\n (101.4764, 121.269439, 99.943877, 121.269439),\n (99.943877, 121.269439, 98.411355, 121.269439),\n (98.411355, 121.269439, 96.878832, 121.269439),\n (96.878832, 121.269439, 95.34631, 121.269439),\n (95.34631, 121.269439, 93.813787, 121.269439),\n (93.813787, 121.269439, 92.281265, 121.269439),\n (92.281265, 121.269439, 90.748742, 121.269439),\n (90.748742, 121.269439, 89.21622, 121.269439),\n (89.21622, 121.269439, 87.683697, 121.269439),\n (87.683697, 121.269439, 86.151174, 121.269439),\n (86.151174, 121.269439, 84.618652, 121.269439),\n (84.618652, 121.269439, 83.086129, 121.269439),\n (83.086129, 121.269439, 81.553607, 121.269439),\n (81.553607, 121.269439, 80.021084, 121.269439),\n (80.021084, 121.269439, 78.488562, 121.269439),\n (78.488562, 121.269439, 76.956039, 121.269439),\n (76.956039, 121.269439, 76.956039, 74.210161),\n (139.996761, 135.269439, 139.996761, 136.801962),\n (139.996761, 136.801962, 139.996761, 138.334484),\n (139.996761, 138.334484, 139.996761, 139.867007),\n (139.996761, 139.867007, 139.996761, 141.399529),\n (139.996761, 141.399529, 139.996761, 142.932052),\n (139.996761, 142.932052, 139.996761, 144.464574),\n (139.996761, 144.464574, 139.996761, 145.997097),\n (139.996761, 145.997097, 139.996761, 147.52962),\n (139.996761, 147.52962, 139.996761, 149.062142),\n (139.996761, 149.062142, 139.996761, 150.594665),\n (139.996761, 150.594665, 139.996761, 152.127187),\n (139.996761, 152.127187, 139.996761, 153.65971),\n (139.996761, 153.65971, 139.996761, 155.192232),\n (139.996761, 155.192232, 139.996761, 156.724755),\n (139.996761, 156.724755, 139.996761, 158.257277),\n (139.996761, 158.257277, 139.996761, 159.7898),\n (139.996761, 159.7898, 139.996761, 161.322323),\n (139.996761, 161.322323, 139.996761, 162.854845),\n (139.996761, 162.854845, 139.996761, 164.387368),\n (139.996761, 164.387368, 139.996761, 165.91989),\n (139.996761, 165.91989, 139.996761, 167.452413),\n (139.996761, 167.452413, 139.996761, 168.984935),\n (139.996761, 168.984935, 139.996761, 170.517458),\n (139.996761, 170.517458, 139.996761, 172.04998),\n (139.996761, 172.04998, 139.996761, 173.582503),\n (139.996761, 173.582503, 139.996761, 175.115026),\n (139.996761, 175.115026, 139.996761, 176.647548),\n (139.996761, 176.647548, 139.996761, 178.180071),\n (139.996761, 178.180071, 139.996761, 179.712593),\n (139.996761, 179.712593, 139.996761, 181.245116),\n (139.996761, 181.245116, 139.996761, 182.777638),\n (139.996761, 182.777638, 139.996761, 184.310161),\n (187.056039, 135.269439, 187.056039, 136.801962),\n (187.056039, 136.801962, 187.056039, 138.334484),\n (187.056039, 138.334484, 187.056039, 139.867007),\n (187.056039, 139.867007, 187.056039, 141.399529),\n (187.056039, 141.399529, 187.056039, 142.932052),\n (187.056039, 142.932052, 187.056039, 144.464574),\n (187.056039, 144.464574, 187.056039, 145.997097),\n (187.056039, 145.997097, 187.056039, 147.52962),\n (187.056039, 147.52962, 187.056039, 149.062142),\n (187.056039, 149.062142, 187.056039, 150.594665),\n (187.056039, 150.594665, 187.056039, 152.127187),\n (187.056039, 152.127187, 187.056039, 153.65971),\n (187.056039, 153.65971, 187.056039, 155.192232),\n (187.056039, 155.192232, 187.056039, 156.724755),\n (187.056039, 156.724755, 187.056039, 158.257277),\n (187.056039, 158.257277, 187.056039, 159.7898),\n (187.056039, 159.7898, 187.056039, 161.322323),\n (187.056039, 161.322323, 187.056039, 162.854845),\n (187.056039, 162.854845, 187.056039, 164.387368),\n (187.056039, 164.387368, 187.056039, 165.91989),\n (187.056039, 165.91989, 187.056039, 167.452413),\n (187.056039, 167.452413, 187.056039, 168.984935),\n (187.056039, 168.984935, 187.056039, 170.517458),\n (187.056039, 170.517458, 187.056039, 172.04998),\n (187.056039, 172.04998, 187.056039, 173.582503),\n (187.056039, 173.582503, 187.056039, 175.115026),\n (187.056039, 175.115026, 187.056039, 176.647548),\n (187.056039, 176.647548, 187.056039, 178.180071),\n (187.056039, 178.180071, 187.056039, 179.712593),\n (187.056039, 179.712593, 187.056039, 181.245116),\n (187.056039, 181.245116, 187.056039, 182.777638),\n (187.056039, 182.777638, 187.056039, 184.310161),\n (187.056039, 135.269439, 139.996761, 135.269439),\n (187.056039, 184.310161, 139.996761, 184.310161)\n]\nVISIBLE_CIRCLES = [\n (101.4764, 159.7898, 24.520361),\n (101.4764, 159.7898, 21.455316)\n]\nVISIBLE_ARCS = [\n\n]\nHIDDEN_SEGMENTS = [\n (122.9318, 121.2695, 122.9318, 74.2102),\n (80.0211, 74.2102, 80.0211, 121.2695),\n (187.0561, 181.2451, 139.9968, 181.2451),\n (187.0561, 138.3345, 139.9968, 138.3345)\n]\n# (orient, text, p1, p2, base) for linear; (orient, text, center, radius, angle) for diameter\nDIMENSIONS = [\n ('diameter', '%%c100', (101.4764, 159.7898), 24.5204, 45),\n ('diameter', '%%c87.5', (101.4764, 159.7898), 21.4553, 135),\n ('horizontal', '95.9596', (139.9968, 159.7898), (187.0561, 159.7898), (163.5264, 170.7898))\n]\n\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\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\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,\n angle=(0 if d[0] == \"horizontal\" else 90),\n 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,\n text=text, dimstyle=\"EZDXF\").render()\n\n doc.saveas(out_path)\n\n\nif __name__ == \"__main__\":\n out = sys.argv[1] if len(sys.argv) > 1 else \"0077_00772808_gt.dxf\"\n draw(out)\n print(\"wrote\", out)\n```"}], "images": ["images/0077_00772808.png"], "id": "0077_00772808"} {"messages": [{"role": "user", "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 22.68 mm."}, {"role": "assistant", "content": "```python\n#!/usr/bin/env python3\n# -*- coding: utf-8 -*-\n# Ground-truth 2D engineering drawing for part: 0077_00777039\n# Self-contained: reproduces the three-view DXF via ezdxf, NO FreeCAD needed.\n# Coordinates are A4 page millimetres (scale=0.7833518485759767, page=[297.0, 210.0]).\n# visible edges -> solid (layer OUTLINE); hidden edges -> dashed (layer HIDDEN)\n# dimensions -> real movable DIMENSION entities (text = true mm value)\n# Run: python 0077_00777039_gt.py [out.dxf]\nimport sys\nimport ezdxf\n\nSCALE = 0.7833518485759767\nPAGE = [297.0, 210.0]\n\nVISIBLE_SEGMENTS = [\n (149.037392, 81.533792, 146.589418, 81.533792),\n (146.589418, 81.533792, 144.141443, 81.533792),\n (144.141443, 81.533792, 141.693469, 81.533792),\n (141.693469, 81.533792, 139.245494, 81.533792),\n (139.245494, 81.533792, 136.79752, 81.533792),\n (136.79752, 81.533792, 134.349545, 81.533792),\n (134.349545, 81.533792, 131.901571, 81.533792),\n (131.901571, 81.533792, 129.453596, 81.533792),\n (129.453596, 81.533792, 127.005622, 81.533792),\n (127.005622, 81.533792, 124.557647, 81.533792),\n (124.557647, 81.533792, 122.109673, 81.533792),\n (122.109673, 81.533792, 119.661698, 81.533792),\n (119.661698, 81.533792, 117.213724, 81.533792),\n (117.213724, 81.533792, 114.765749, 81.533792),\n (114.765749, 81.533792, 112.317775, 81.533792),\n (112.317775, 81.533792, 109.8698, 81.533792),\n (109.8698, 81.533792, 107.421825, 81.533792),\n (107.421825, 81.533792, 104.973851, 81.533792),\n (104.973851, 81.533792, 102.525876, 81.533792),\n (102.525876, 81.533792, 100.077902, 81.533792),\n (100.077902, 81.533792, 97.629927, 81.533792),\n (97.629927, 81.533792, 95.181953, 81.533792),\n (95.181953, 81.533792, 92.733978, 81.533792),\n (92.733978, 81.533792, 90.286004, 81.533792),\n (90.286004, 81.533792, 87.838029, 81.533792),\n (87.838029, 81.533792, 85.390055, 81.533792),\n (85.390055, 81.533792, 82.94208, 81.533792),\n (82.94208, 81.533792, 80.494106, 81.533792),\n (80.494106, 81.533792, 78.046131, 81.533792),\n (78.046131, 81.533792, 75.598157, 81.533792),\n (75.598157, 81.533792, 73.150182, 81.533792),\n (73.150182, 81.533792, 70.702208, 81.533792),\n (149.037392, 81.533792, 149.037392, 99.298607),\n (149.037392, 99.298607, 146.589418, 99.298607),\n (146.589418, 99.298607, 144.141443, 99.298607),\n (144.141443, 99.298607, 141.693469, 99.298607),\n (141.693469, 99.298607, 139.245494, 99.298607),\n (139.245494, 99.298607, 136.79752, 99.298607),\n (136.79752, 99.298607, 134.349545, 99.298607),\n (134.349545, 99.298607, 131.901571, 99.298607),\n (131.901571, 99.298607, 129.453596, 99.298607),\n (129.453596, 99.298607, 127.005622, 99.298607),\n (127.005622, 99.298607, 124.557647, 99.298607),\n (124.557647, 99.298607, 122.109673, 99.298607),\n (122.109673, 99.298607, 119.661698, 99.298607),\n (119.661698, 99.298607, 117.213724, 99.298607),\n (117.213724, 99.298607, 114.765749, 99.298607),\n (114.765749, 99.298607, 112.317775, 99.298607),\n (112.317775, 99.298607, 109.8698, 99.298607),\n (109.8698, 99.298607, 107.421825, 99.298607),\n (107.421825, 99.298607, 104.973851, 99.298607),\n (104.973851, 99.298607, 102.525876, 99.298607),\n (102.525876, 99.298607, 100.077902, 99.298607),\n (100.077902, 99.298607, 97.629927, 99.298607),\n (97.629927, 99.298607, 95.181953, 99.298607),\n (95.181953, 99.298607, 92.733978, 99.298607),\n (92.733978, 99.298607, 90.286004, 99.298607),\n (90.286004, 99.298607, 87.838029, 99.298607),\n (87.838029, 99.298607, 85.390055, 99.298607),\n (85.390055, 99.298607, 82.94208, 99.298607),\n (82.94208, 99.298607, 80.494106, 99.298607),\n (80.494106, 99.298607, 78.046131, 99.298607),\n (78.046131, 99.298607, 75.598157, 99.298607),\n (75.598157, 99.298607, 73.150182, 99.298607),\n (73.150182, 99.298607, 70.702208, 99.298607),\n (70.702208, 99.298607, 70.702208, 81.533792),\n (163.037393, 113.298608, 163.037393, 115.746582),\n (163.037393, 115.746582, 163.037393, 118.194557),\n (163.037393, 118.194557, 163.037393, 120.642531),\n (163.037393, 120.642531, 163.037393, 123.090506),\n (163.037393, 123.090506, 163.037393, 125.53848),\n (163.037393, 125.53848, 163.037393, 127.986455),\n (163.037393, 127.986455, 163.037393, 130.434429),\n (163.037393, 130.434429, 163.037393, 132.882404),\n (163.037393, 132.882404, 163.037393, 135.330378),\n (163.037393, 135.330378, 163.037393, 137.778353),\n (163.037393, 137.778353, 163.037393, 140.226327),\n (163.037393, 140.226327, 163.037393, 142.674302),\n (163.037393, 142.674302, 163.037393, 145.122276),\n (163.037393, 145.122276, 163.037393, 147.570251),\n (163.037393, 147.570251, 163.037393, 150.018225),\n (163.037393, 150.018225, 163.037393, 152.4662),\n (163.037393, 152.4662, 163.037393, 154.914175),\n (163.037393, 154.914175, 163.037393, 157.362149),\n (163.037393, 157.362149, 163.037393, 159.810124),\n (163.037393, 159.810124, 163.037393, 162.258098),\n (163.037393, 162.258098, 163.037393, 164.706073),\n (163.037393, 164.706073, 163.037393, 167.154047),\n (163.037393, 167.154047, 163.037393, 169.602022),\n (163.037393, 169.602022, 163.037393, 172.049996),\n (163.037393, 172.049996, 163.037393, 174.497971),\n (163.037393, 174.497971, 163.037393, 176.945945),\n (163.037393, 176.945945, 163.037393, 179.39392),\n (163.037393, 179.39392, 163.037393, 181.841894),\n (163.037393, 181.841894, 163.037393, 184.289869),\n (163.037393, 184.289869, 163.037393, 186.737843),\n (163.037393, 186.737843, 163.037393, 189.185818),\n (163.037393, 189.185818, 163.037393, 191.633792),\n (180.802208, 113.298608, 180.802208, 115.746582),\n (180.802208, 115.746582, 180.802208, 118.194557),\n (180.802208, 118.194557, 180.802208, 120.642531),\n (180.802208, 120.642531, 180.802208, 123.090506),\n (180.802208, 123.090506, 180.802208, 125.53848),\n (180.802208, 125.53848, 180.802208, 127.986455),\n (180.802208, 127.986455, 180.802208, 130.434429),\n (180.802208, 130.434429, 180.802208, 132.882404),\n (180.802208, 132.882404, 180.802208, 135.330378),\n (180.802208, 135.330378, 180.802208, 137.778353),\n (180.802208, 137.778353, 180.802208, 140.226327),\n (180.802208, 140.226327, 180.802208, 142.674302),\n (180.802208, 142.674302, 180.802208, 145.122276),\n (180.802208, 145.122276, 180.802208, 147.570251),\n (180.802208, 147.570251, 180.802208, 150.018225),\n (180.802208, 150.018225, 180.802208, 152.4662),\n (180.802208, 152.4662, 180.802208, 154.914175),\n (180.802208, 154.914175, 180.802208, 157.362149),\n (180.802208, 157.362149, 180.802208, 159.810124),\n (180.802208, 159.810124, 180.802208, 162.258098),\n (180.802208, 162.258098, 180.802208, 164.706073),\n (180.802208, 164.706073, 180.802208, 167.154047),\n (180.802208, 167.154047, 180.802208, 169.602022),\n (180.802208, 169.602022, 180.802208, 172.049996),\n (180.802208, 172.049996, 180.802208, 174.497971),\n (180.802208, 174.497971, 180.802208, 176.945945),\n (180.802208, 176.945945, 180.802208, 179.39392),\n (180.802208, 179.39392, 180.802208, 181.841894),\n (180.802208, 181.841894, 180.802208, 184.289869),\n (180.802208, 184.289869, 180.802208, 186.737843),\n (180.802208, 186.737843, 180.802208, 189.185818),\n (180.802208, 189.185818, 180.802208, 191.633792),\n (180.802208, 113.298608, 163.037393, 113.298608),\n (180.802208, 191.633792, 163.037393, 191.633792)\n]\nVISIBLE_CIRCLES = [\n (109.8698, 152.4662, 39.167592),\n (109.8698, 152.4662, 31.823669)\n]\nVISIBLE_ARCS = [\n\n]\nHIDDEN_SEGMENTS = [\n (141.6934, 99.2986, 141.6934, 81.5338),\n (78.0461, 81.5338, 78.0461, 99.2986),\n (180.8022, 184.2899, 163.0374, 184.2899),\n (180.8022, 120.6425, 163.0374, 120.6425)\n]\n# (orient, text, p1, p2, base) for linear; (orient, text, center, radius, angle) for diameter\nDIMENSIONS = [\n ('diameter', '%%c100', (109.8698, 152.4662), 39.1676, 45),\n ('diameter', '%%c81.25', (109.8698, 152.4662), 31.8237, 135),\n ('horizontal', '22.678', (163.0374, 152.4662), (180.8022, 152.4662), (171.9198, 163.4662))\n]\n\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\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\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,\n angle=(0 if d[0] == \"horizontal\" else 90),\n 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,\n text=text, dimstyle=\"EZDXF\").render()\n\n doc.saveas(out_path)\n\n\nif __name__ == \"__main__\":\n out = sys.argv[1] if len(sys.argv) > 1 else \"0077_00777039_gt.dxf\"\n draw(out)\n print(\"wrote\", out)\n```"}], "images": ["images/0077_00777039.png"], "id": "0077_00777039"} {"messages": [{"role": "user", "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 172.73 mm."}, {"role": "assistant", "content": "```python\n#!/usr/bin/env python3\n# -*- coding: utf-8 -*-\n# Ground-truth 2D engineering drawing for part: 0077_00778908\n# Self-contained: reproduces the three-view DXF via ezdxf, NO FreeCAD needed.\n# Coordinates are A4 page millimetres (scale=0.3523666666666702, page=[297.0, 210.0]).\n# visible edges -> solid (layer OUTLINE); hidden edges -> dashed (layer HIDDEN)\n# dimensions -> real movable DIMENSION entities (text = true mm value)\n# Run: python 0077_00778908_gt.py [out.dxf]\nimport sys\nimport ezdxf\n\nSCALE = 0.3523666666666702\nPAGE = [297.0, 210.0]\n\nVISIBLE_SEGMENTS = [\n (115.703333, 70.759133, 114.602188, 70.759133),\n (114.602188, 70.759133, 113.501042, 70.759133),\n (113.501042, 70.759133, 112.399896, 70.759133),\n (112.399896, 70.759133, 111.29875, 70.759133),\n (111.29875, 70.759133, 110.197604, 70.759133),\n (110.197604, 70.759133, 109.096458, 70.759133),\n (109.096458, 70.759133, 107.995313, 70.759133),\n (107.995313, 70.759133, 106.894167, 70.759133),\n (106.894167, 70.759133, 105.793021, 70.759133),\n (105.793021, 70.759133, 104.691875, 70.759133),\n (104.691875, 70.759133, 103.590729, 70.759133),\n (103.590729, 70.759133, 102.489583, 70.759133),\n (102.489583, 70.759133, 101.388438, 70.759133),\n (101.388438, 70.759133, 100.287292, 70.759133),\n (100.287292, 70.759133, 99.186146, 70.759133),\n (99.186146, 70.759133, 98.085, 70.759133),\n (98.085, 70.759133, 96.983854, 70.759133),\n (96.983854, 70.759133, 95.882708, 70.759133),\n (95.882708, 70.759133, 94.781562, 70.759133),\n (94.781562, 70.759133, 93.680417, 70.759133),\n (93.680417, 70.759133, 92.579271, 70.759133),\n (92.579271, 70.759133, 91.478125, 70.759133),\n (91.478125, 70.759133, 90.376979, 70.759133),\n (90.376979, 70.759133, 89.275833, 70.759133),\n (89.275833, 70.759133, 88.174687, 70.759133),\n (88.174687, 70.759133, 87.073542, 70.759133),\n (87.073542, 70.759133, 85.972396, 70.759133),\n (85.972396, 70.759133, 84.87125, 70.759133),\n (84.87125, 70.759133, 83.770104, 70.759133),\n (83.770104, 70.759133, 82.668958, 70.759133),\n (82.668958, 70.759133, 81.567812, 70.759133),\n (81.567812, 70.759133, 80.466667, 70.759133),\n (115.703333, 70.759133, 115.703333, 131.622466),\n (115.703333, 131.622466, 114.602188, 131.622466),\n (114.602188, 131.622466, 113.501042, 131.622466),\n (113.501042, 131.622466, 112.399896, 131.622466),\n (112.399896, 131.622466, 111.29875, 131.622466),\n (111.29875, 131.622466, 110.197604, 131.622466),\n (110.197604, 131.622466, 109.096458, 131.622466),\n (109.096458, 131.622466, 107.995313, 131.622466),\n (107.995313, 131.622466, 106.894167, 131.622466),\n (106.894167, 131.622466, 105.793021, 131.622466),\n (105.793021, 131.622466, 104.691875, 131.622466),\n (104.691875, 131.622466, 103.590729, 131.622466),\n (103.590729, 131.622466, 102.489583, 131.622466),\n (102.489583, 131.622466, 101.388438, 131.622466),\n (101.388438, 131.622466, 100.287292, 131.622466),\n (100.287292, 131.622466, 99.186146, 131.622466),\n (99.186146, 131.622466, 98.085, 131.622466),\n (98.085, 131.622466, 96.983854, 131.622466),\n (96.983854, 131.622466, 95.882708, 131.622466),\n (95.882708, 131.622466, 94.781562, 131.622466),\n (94.781562, 131.622466, 93.680417, 131.622466),\n (93.680417, 131.622466, 92.579271, 131.622466),\n (92.579271, 131.622466, 91.478125, 131.622466),\n (91.478125, 131.622466, 90.376979, 131.622466),\n (90.376979, 131.622466, 89.275833, 131.622466),\n (89.275833, 131.622466, 88.174687, 131.622466),\n (88.174687, 131.622466, 87.073542, 131.622466),\n (87.073542, 131.622466, 85.972396, 131.622466),\n (85.972396, 131.622466, 84.87125, 131.622466),\n (84.87125, 131.622466, 83.770104, 131.622466),\n (83.770104, 131.622466, 82.668958, 131.622466),\n (82.668958, 131.622466, 81.567812, 131.622466),\n (81.567812, 131.622466, 80.466667, 131.622466),\n (80.466667, 131.622466, 80.466667, 70.759133),\n (129.703334, 145.622467, 129.703334, 146.723612),\n (129.703334, 146.723612, 129.703334, 147.824758),\n (129.703334, 147.824758, 129.703334, 148.925904),\n (129.703334, 148.925904, 129.703334, 150.02705),\n (129.703334, 150.02705, 129.703334, 151.128196),\n (129.703334, 151.128196, 129.703334, 152.229342),\n (129.703334, 152.229342, 129.703334, 153.330487),\n (129.703334, 153.330487, 129.703334, 154.431633),\n (129.703334, 154.431633, 129.703334, 155.532779),\n (129.703334, 155.532779, 129.703334, 156.633925),\n (129.703334, 156.633925, 129.703334, 157.735071),\n (129.703334, 157.735071, 129.703334, 158.836217),\n (129.703334, 158.836217, 129.703334, 159.937362),\n (129.703334, 159.937362, 129.703334, 161.038508),\n (129.703334, 161.038508, 129.703334, 162.139654),\n (129.703334, 162.139654, 129.703334, 163.2408),\n (129.703334, 163.2408, 129.703334, 164.341946),\n (129.703334, 164.341946, 129.703334, 165.443092),\n (129.703334, 165.443092, 129.703334, 166.544238),\n (129.703334, 166.544238, 129.703334, 167.645383),\n (129.703334, 167.645383, 129.703334, 168.746529),\n (129.703334, 168.746529, 129.703334, 169.847675),\n (129.703334, 169.847675, 129.703334, 170.948821),\n (129.703334, 170.948821, 129.703334, 172.049967),\n (129.703334, 172.049967, 129.703334, 173.151113),\n (129.703334, 173.151113, 129.703334, 174.252258),\n (129.703334, 174.252258, 129.703334, 175.353404),\n (129.703334, 175.353404, 129.703334, 176.45455),\n (129.703334, 176.45455, 129.703334, 177.555696),\n (129.703334, 177.555696, 129.703334, 178.656842),\n (129.703334, 178.656842, 129.703334, 179.757988),\n (129.703334, 179.757988, 129.703334, 180.859133),\n (190.566667, 145.622467, 190.566667, 146.723612),\n (190.566667, 146.723612, 190.566667, 147.824758),\n (190.566667, 147.824758, 190.566667, 148.925904),\n (190.566667, 148.925904, 190.566667, 150.02705),\n (190.566667, 150.02705, 190.566667, 151.128196),\n (190.566667, 151.128196, 190.566667, 152.229342),\n (190.566667, 152.229342, 190.566667, 153.330487),\n (190.566667, 153.330487, 190.566667, 154.431633),\n (190.566667, 154.431633, 190.566667, 155.532779),\n (190.566667, 155.532779, 190.566667, 156.633925),\n (190.566667, 156.633925, 190.566667, 157.735071),\n (190.566667, 157.735071, 190.566667, 158.836217),\n (190.566667, 158.836217, 190.566667, 159.937362),\n (190.566667, 159.937362, 190.566667, 161.038508),\n (190.566667, 161.038508, 190.566667, 162.139654),\n (190.566667, 162.139654, 190.566667, 163.2408),\n (190.566667, 163.2408, 190.566667, 164.341946),\n (190.566667, 164.341946, 190.566667, 165.443092),\n (190.566667, 165.443092, 190.566667, 166.544238),\n (190.566667, 166.544238, 190.566667, 167.645383),\n (190.566667, 167.645383, 190.566667, 168.746529),\n (190.566667, 168.746529, 190.566667, 169.847675),\n (190.566667, 169.847675, 190.566667, 170.948821),\n (190.566667, 170.948821, 190.566667, 172.049967),\n (190.566667, 172.049967, 190.566667, 173.151113),\n (190.566667, 173.151113, 190.566667, 174.252258),\n (190.566667, 174.252258, 190.566667, 175.353404),\n (190.566667, 175.353404, 190.566667, 176.45455),\n (190.566667, 176.45455, 190.566667, 177.555696),\n (190.566667, 177.555696, 190.566667, 178.656842),\n (190.566667, 178.656842, 190.566667, 179.757988),\n (190.566667, 179.757988, 190.566667, 180.859133),\n (190.566667, 145.622467, 129.703334, 145.622467),\n (190.566667, 180.859133, 129.703334, 180.859133)\n]\nVISIBLE_CIRCLES = [\n (98.085, 163.2408, 17.618333),\n (98.085, 163.2408, 14.314896)\n]\nVISIBLE_ARCS = [\n\n]\nHIDDEN_SEGMENTS = [\n (112.3999, 131.6225, 112.3999, 70.7592),\n (83.7701, 70.7592, 83.7701, 131.6225),\n (190.5667, 177.5557, 129.7034, 177.5557),\n (190.5667, 148.9259, 129.7034, 148.9259)\n]\n# (orient, text, p1, p2, base) for linear; (orient, text, center, radius, angle) for diameter\nDIMENSIONS = [\n ('diameter', '%%c100', (98.085, 163.2408), 17.6183, 45),\n ('diameter', '%%c81.25', (98.085, 163.2408), 14.3149, 135),\n ('horizontal', '172.727', (129.7034, 163.2408), (190.5667, 163.2408), (160.135, 174.2408))\n]\n\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\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\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,\n angle=(0 if d[0] == \"horizontal\" else 90),\n 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,\n text=text, dimstyle=\"EZDXF\").render()\n\n doc.saveas(out_path)\n\n\nif __name__ == \"__main__\":\n out = sys.argv[1] if len(sys.argv) > 1 else \"0077_00778908_gt.dxf\"\n draw(out)\n print(\"wrote\", out)\n```"}], "images": ["images/0077_00778908.png"], "id": "0077_00778908"} {"messages": [{"role": "user", "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 93.75 mm. It is extruded to a thickness of 1.55 mm."}, {"role": "assistant", "content": "```python\n#!/usr/bin/env python3\n# -*- coding: utf-8 -*-\n# Ground-truth 2D engineering drawing for part: 0080_00806466\n# Self-contained: reproduces the three-view DXF via ezdxf, NO FreeCAD needed.\n# Coordinates are A4 page millimetres (scale=0.9463670460009648, page=[297.0, 210.0]).\n# visible edges -> solid (layer OUTLINE); hidden edges -> dashed (layer HIDDEN)\n# dimensions -> real movable DIMENSION entities (text = true mm value)\n# Run: python 0080_00806466_gt.py [out.dxf]\nimport sys\nimport ezdxf\n\nSCALE = 0.9463670460009648\nPAGE = [297.0, 210.0]\n\nVISIBLE_SEGMENTS = [\n (160.166852, 85.609152, 157.209455, 85.609152),\n (157.209455, 85.609152, 154.252058, 85.609152),\n (154.252058, 85.609152, 151.294661, 85.609152),\n (151.294661, 85.609152, 148.337264, 85.609152),\n (148.337264, 85.609152, 145.379867, 85.609152),\n (145.379867, 85.609152, 142.42247, 85.609152),\n (142.42247, 85.609152, 139.465073, 85.609152),\n (139.465073, 85.609152, 136.507676, 85.609152),\n (136.507676, 85.609152, 133.550279, 85.609152),\n (133.550279, 85.609152, 130.592882, 85.609152),\n (130.592882, 85.609152, 127.635485, 85.609152),\n (127.635485, 85.609152, 124.678088, 85.609152),\n (124.678088, 85.609152, 121.720691, 85.609152),\n (121.720691, 85.609152, 118.763294, 85.609152),\n (118.763294, 85.609152, 115.805897, 85.609152),\n (115.805897, 85.609152, 112.8485, 85.609152),\n (112.8485, 85.609152, 109.891103, 85.609152),\n (109.891103, 85.609152, 106.933706, 85.609152),\n (106.933706, 85.609152, 103.976309, 85.609152),\n (103.976309, 85.609152, 101.018912, 85.609152),\n (101.018912, 85.609152, 98.061515, 85.609152),\n (98.061515, 85.609152, 95.104118, 85.609152),\n (95.104118, 85.609152, 92.146721, 85.609152),\n (92.146721, 85.609152, 89.189324, 85.609152),\n (89.189324, 85.609152, 86.231927, 85.609152),\n (86.231927, 85.609152, 83.27453, 85.609152),\n (83.27453, 85.609152, 80.317133, 85.609152),\n (80.317133, 85.609152, 77.359736, 85.609152),\n (77.359736, 85.609152, 74.402339, 85.609152),\n (74.402339, 85.609152, 71.444942, 85.609152),\n (71.444942, 85.609152, 68.487545, 85.609152),\n (68.487545, 85.609152, 65.530148, 85.609152),\n (160.166852, 85.609152, 160.166852, 87.072447),\n (160.166852, 87.072447, 157.209455, 87.072447),\n (157.209455, 87.072447, 154.252058, 87.072447),\n (154.252058, 87.072447, 151.294661, 87.072447),\n (151.294661, 87.072447, 148.337264, 87.072447),\n (148.337264, 87.072447, 145.379867, 87.072447),\n (145.379867, 87.072447, 142.42247, 87.072447),\n (142.42247, 87.072447, 139.465073, 87.072447),\n (139.465073, 87.072447, 136.507676, 87.072447),\n (136.507676, 87.072447, 133.550279, 87.072447),\n (133.550279, 87.072447, 130.592882, 87.072447),\n (130.592882, 87.072447, 127.635485, 87.072447),\n (127.635485, 87.072447, 124.678088, 87.072447),\n (124.678088, 87.072447, 121.720691, 87.072447),\n (121.720691, 87.072447, 118.763294, 87.072447),\n (118.763294, 87.072447, 115.805897, 87.072447),\n (115.805897, 87.072447, 112.8485, 87.072447),\n (112.8485, 87.072447, 109.891103, 87.072447),\n (109.891103, 87.072447, 106.933706, 87.072447),\n (106.933706, 87.072447, 103.976309, 87.072447),\n (103.976309, 87.072447, 101.018912, 87.072447),\n (101.018912, 87.072447, 98.061515, 87.072447),\n (98.061515, 87.072447, 95.104118, 87.072447),\n (95.104118, 87.072447, 92.146721, 87.072447),\n (92.146721, 87.072447, 89.189324, 87.072447),\n (89.189324, 87.072447, 86.231927, 87.072447),\n (86.231927, 87.072447, 83.27453, 87.072447),\n (83.27453, 87.072447, 80.317133, 87.072447),\n (80.317133, 87.072447, 77.359736, 87.072447),\n (77.359736, 87.072447, 74.402339, 87.072447),\n (74.402339, 87.072447, 71.444942, 87.072447),\n (71.444942, 87.072447, 68.487545, 87.072447),\n (68.487545, 87.072447, 65.530148, 87.072447),\n (65.530148, 87.072447, 65.530148, 85.609152),\n (174.166853, 101.072448, 174.166853, 104.029845),\n (174.166853, 104.029845, 174.166853, 106.987242),\n (174.166853, 106.987242, 174.166853, 109.944639),\n (174.166853, 109.944639, 174.166853, 112.902036),\n (174.166853, 112.902036, 174.166853, 115.859433),\n (174.166853, 115.859433, 174.166853, 118.81683),\n (174.166853, 118.81683, 174.166853, 121.774227),\n (174.166853, 121.774227, 174.166853, 124.731624),\n (174.166853, 124.731624, 174.166853, 127.689021),\n (174.166853, 127.689021, 174.166853, 130.646418),\n (174.166853, 130.646418, 174.166853, 133.603815),\n (174.166853, 133.603815, 174.166853, 136.561212),\n (174.166853, 136.561212, 174.166853, 139.518609),\n (174.166853, 139.518609, 174.166853, 142.476006),\n (174.166853, 142.476006, 174.166853, 145.433403),\n (174.166853, 145.433403, 174.166853, 148.3908),\n (174.166853, 148.3908, 174.166853, 151.348197),\n (174.166853, 151.348197, 174.166853, 154.305594),\n (174.166853, 154.305594, 174.166853, 157.262991),\n (174.166853, 157.262991, 174.166853, 160.220388),\n (174.166853, 160.220388, 174.166853, 163.177785),\n (174.166853, 163.177785, 174.166853, 166.135182),\n (174.166853, 166.135182, 174.166853, 169.092579),\n (174.166853, 169.092579, 174.166853, 172.049976),\n (174.166853, 172.049976, 174.166853, 175.007373),\n (174.166853, 175.007373, 174.166853, 177.96477),\n (174.166853, 177.96477, 174.166853, 180.922167),\n (174.166853, 180.922167, 174.166853, 183.879564),\n (174.166853, 183.879564, 174.166853, 186.836961),\n (174.166853, 186.836961, 174.166853, 189.794358),\n (174.166853, 189.794358, 174.166853, 192.751755),\n (174.166853, 192.751755, 174.166853, 195.709152),\n (175.630148, 101.072448, 175.630148, 104.029845),\n (175.630148, 104.029845, 175.630148, 106.987242),\n (175.630148, 106.987242, 175.630148, 109.944639),\n (175.630148, 109.944639, 175.630148, 112.902036),\n (175.630148, 112.902036, 175.630148, 115.859433),\n (175.630148, 115.859433, 175.630148, 118.81683),\n (175.630148, 118.81683, 175.630148, 121.774227),\n (175.630148, 121.774227, 175.630148, 124.731624),\n (175.630148, 124.731624, 175.630148, 127.689021),\n (175.630148, 127.689021, 175.630148, 130.646418),\n (175.630148, 130.646418, 175.630148, 133.603815),\n (175.630148, 133.603815, 175.630148, 136.561212),\n (175.630148, 136.561212, 175.630148, 139.518609),\n (175.630148, 139.518609, 175.630148, 142.476006),\n (175.630148, 142.476006, 175.630148, 145.433403),\n (175.630148, 145.433403, 175.630148, 148.3908),\n (175.630148, 148.3908, 175.630148, 151.348197),\n (175.630148, 151.348197, 175.630148, 154.305594),\n (175.630148, 154.305594, 175.630148, 157.262991),\n (175.630148, 157.262991, 175.630148, 160.220388),\n (175.630148, 160.220388, 175.630148, 163.177785),\n (175.630148, 163.177785, 175.630148, 166.135182),\n (175.630148, 166.135182, 175.630148, 169.092579),\n (175.630148, 169.092579, 175.630148, 172.049976),\n (175.630148, 172.049976, 175.630148, 175.007373),\n (175.630148, 175.007373, 175.630148, 177.96477),\n (175.630148, 177.96477, 175.630148, 180.922167),\n (175.630148, 180.922167, 175.630148, 183.879564),\n (175.630148, 183.879564, 175.630148, 186.836961),\n (175.630148, 186.836961, 175.630148, 189.794358),\n (175.630148, 189.794358, 175.630148, 192.751755),\n (175.630148, 192.751755, 175.630148, 195.709152),\n (175.630148, 101.072448, 174.166853, 101.072448),\n (175.630148, 195.709152, 174.166853, 195.709152)\n]\nVISIBLE_CIRCLES = [\n (112.8485, 148.3908, 47.318352),\n (112.8485, 148.3908, 44.360955)\n]\nVISIBLE_ARCS = [\n\n]\nHIDDEN_SEGMENTS = [\n (157.2095, 87.0725, 157.2095, 85.6092),\n (68.4876, 85.6092, 68.4876, 87.0725),\n (175.6302, 192.7518, 174.1669, 192.7518),\n (175.6302, 104.0299, 174.1669, 104.0299)\n]\n# (orient, text, p1, p2, base) for linear; (orient, text, center, radius, angle) for diameter\nDIMENSIONS = [\n ('diameter', '%%c100', (112.8485, 148.3908), 47.3184, 45),\n ('diameter', '%%c93.75', (112.8485, 148.3908), 44.361, 135),\n ('horizontal', '1.5462', (174.1669, 148.3908), (175.6302, 148.3908), (174.8985, 159.3908))\n]\n\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\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\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,\n angle=(0 if d[0] == \"horizontal\" else 90),\n 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,\n text=text, dimstyle=\"EZDXF\").render()\n\n doc.saveas(out_path)\n\n\nif __name__ == \"__main__\":\n out = sys.argv[1] if len(sys.argv) > 1 else \"0080_00806466_gt.dxf\"\n draw(out)\n print(\"wrote\", out)\n```"}], "images": ["images/0080_00806466.png"], "id": "0080_00806466"} {"messages": [{"role": "user", "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 1.03 mm."}, {"role": "assistant", "content": "```python\n#!/usr/bin/env python3\n# -*- coding: utf-8 -*-\n# Ground-truth 2D engineering drawing for part: 0082_00823938\n# Self-contained: reproduces the three-view DXF via ezdxf, NO FreeCAD needed.\n# Coordinates are A4 page millimetres (scale=0.951194930727099, page=[297.0, 210.0]).\n# visible edges -> solid (layer OUTLINE); hidden edges -> dashed (layer HIDDEN)\n# dimensions -> real movable DIMENSION entities (text = true mm value)\n# Run: python 0082_00823938_gt.py [out.dxf]\nimport sys\nimport ezdxf\n\nSCALE = 0.951194930727099\nPAGE = [297.0, 210.0]\n\nVISIBLE_SEGMENTS = [\n (161.523547, 85.729846, 158.551062, 85.729846),\n (158.551062, 85.729846, 155.578578, 85.729846),\n (155.578578, 85.729846, 152.606094, 85.729846),\n (152.606094, 85.729846, 149.63361, 85.729846),\n (149.63361, 85.729846, 146.661126, 85.729846),\n (146.661126, 85.729846, 143.688642, 85.729846),\n (143.688642, 85.729846, 140.716157, 85.729846),\n (140.716157, 85.729846, 137.743673, 85.729846),\n (137.743673, 85.729846, 134.771189, 85.729846),\n (134.771189, 85.729846, 131.798705, 85.729846),\n (131.798705, 85.729846, 128.826221, 85.729846),\n (128.826221, 85.729846, 125.853737, 85.729846),\n (125.853737, 85.729846, 122.881252, 85.729846),\n (122.881252, 85.729846, 119.908768, 85.729846),\n (119.908768, 85.729846, 116.936284, 85.729846),\n (116.936284, 85.729846, 113.9638, 85.729846),\n (113.9638, 85.729846, 110.991316, 85.729846),\n (110.991316, 85.729846, 108.018832, 85.729846),\n (108.018832, 85.729846, 105.046348, 85.729846),\n (105.046348, 85.729846, 102.073863, 85.729846),\n (102.073863, 85.729846, 99.101379, 85.729846),\n (99.101379, 85.729846, 96.128895, 85.729846),\n (96.128895, 85.729846, 93.156411, 85.729846),\n (93.156411, 85.729846, 90.183927, 85.729846),\n (90.183927, 85.729846, 87.211443, 85.729846),\n (87.211443, 85.729846, 84.238958, 85.729846),\n (84.238958, 85.729846, 81.266474, 85.729846),\n (81.266474, 85.729846, 78.29399, 85.729846),\n (78.29399, 85.729846, 75.321506, 85.729846),\n (75.321506, 85.729846, 72.349022, 85.729846),\n (72.349022, 85.729846, 69.376538, 85.729846),\n (69.376538, 85.729846, 66.404053, 85.729846),\n (161.523547, 85.729846, 161.523547, 86.710353),\n (161.523547, 86.710353, 158.551062, 86.710353),\n (158.551062, 86.710353, 155.578578, 86.710353),\n (155.578578, 86.710353, 152.606094, 86.710353),\n (152.606094, 86.710353, 149.63361, 86.710353),\n (149.63361, 86.710353, 146.661126, 86.710353),\n (146.661126, 86.710353, 143.688642, 86.710353),\n (143.688642, 86.710353, 140.716157, 86.710353),\n (140.716157, 86.710353, 137.743673, 86.710353),\n (137.743673, 86.710353, 134.771189, 86.710353),\n (134.771189, 86.710353, 131.798705, 86.710353),\n (131.798705, 86.710353, 128.826221, 86.710353),\n (128.826221, 86.710353, 125.853737, 86.710353),\n (125.853737, 86.710353, 122.881252, 86.710353),\n (122.881252, 86.710353, 119.908768, 86.710353),\n (119.908768, 86.710353, 116.936284, 86.710353),\n (116.936284, 86.710353, 113.9638, 86.710353),\n (113.9638, 86.710353, 110.991316, 86.710353),\n (110.991316, 86.710353, 108.018832, 86.710353),\n (108.018832, 86.710353, 105.046348, 86.710353),\n (105.046348, 86.710353, 102.073863, 86.710353),\n (102.073863, 86.710353, 99.101379, 86.710353),\n (99.101379, 86.710353, 96.128895, 86.710353),\n (96.128895, 86.710353, 93.156411, 86.710353),\n (93.156411, 86.710353, 90.183927, 86.710353),\n (90.183927, 86.710353, 87.211443, 86.710353),\n (87.211443, 86.710353, 84.238958, 86.710353),\n (84.238958, 86.710353, 81.266474, 86.710353),\n (81.266474, 86.710353, 78.29399, 86.710353),\n (78.29399, 86.710353, 75.321506, 86.710353),\n (75.321506, 86.710353, 72.349022, 86.710353),\n (72.349022, 86.710353, 69.376538, 86.710353),\n (69.376538, 86.710353, 66.404053, 86.710353),\n (66.404053, 86.710353, 66.404053, 85.729846),\n (175.523547, 100.710353, 175.523547, 103.682838),\n (175.523547, 103.682838, 175.523547, 106.655322),\n (175.523547, 106.655322, 175.523547, 109.627806),\n (175.523547, 109.627806, 175.523547, 112.60029),\n (175.523547, 112.60029, 175.523547, 115.572774),\n (175.523547, 115.572774, 175.523547, 118.545258),\n (175.523547, 118.545258, 175.523547, 121.517743),\n (175.523547, 121.517743, 175.523547, 124.490227),\n (175.523547, 124.490227, 175.523547, 127.462711),\n (175.523547, 127.462711, 175.523547, 130.435195),\n (175.523547, 130.435195, 175.523547, 133.407679),\n (175.523547, 133.407679, 175.523547, 136.380163),\n (175.523547, 136.380163, 175.523547, 139.352648),\n (175.523547, 139.352648, 175.523547, 142.325132),\n (175.523547, 142.325132, 175.523547, 145.297616),\n (175.523547, 145.297616, 175.523547, 148.2701),\n (175.523547, 148.2701, 175.523547, 151.242584),\n (175.523547, 151.242584, 175.523547, 154.215068),\n (175.523547, 154.215068, 175.523547, 157.187552),\n (175.523547, 157.187552, 175.523547, 160.160037),\n (175.523547, 160.160037, 175.523547, 163.132521),\n (175.523547, 163.132521, 175.523547, 166.105005),\n (175.523547, 166.105005, 175.523547, 169.077489),\n (175.523547, 169.077489, 175.523547, 172.049973),\n (175.523547, 172.049973, 175.523547, 175.022457),\n (175.523547, 175.022457, 175.523547, 177.994942),\n (175.523547, 177.994942, 175.523547, 180.967426),\n (175.523547, 180.967426, 175.523547, 183.93991),\n (175.523547, 183.93991, 175.523547, 186.912394),\n (175.523547, 186.912394, 175.523547, 189.884878),\n (175.523547, 189.884878, 175.523547, 192.857362),\n (175.523547, 192.857362, 175.523547, 195.829847),\n (176.504054, 100.710353, 176.504054, 103.682838),\n (176.504054, 103.682838, 176.504054, 106.655322),\n (176.504054, 106.655322, 176.504054, 109.627806),\n (176.504054, 109.627806, 176.504054, 112.60029),\n (176.504054, 112.60029, 176.504054, 115.572774),\n (176.504054, 115.572774, 176.504054, 118.545258),\n (176.504054, 118.545258, 176.504054, 121.517743),\n (176.504054, 121.517743, 176.504054, 124.490227),\n (176.504054, 124.490227, 176.504054, 127.462711),\n (176.504054, 127.462711, 176.504054, 130.435195),\n (176.504054, 130.435195, 176.504054, 133.407679),\n (176.504054, 133.407679, 176.504054, 136.380163),\n (176.504054, 136.380163, 176.504054, 139.352648),\n (176.504054, 139.352648, 176.504054, 142.325132),\n (176.504054, 142.325132, 176.504054, 145.297616),\n (176.504054, 145.297616, 176.504054, 148.2701),\n (176.504054, 148.2701, 176.504054, 151.242584),\n (176.504054, 151.242584, 176.504054, 154.215068),\n (176.504054, 154.215068, 176.504054, 157.187552),\n (176.504054, 157.187552, 176.504054, 160.160037),\n (176.504054, 160.160037, 176.504054, 163.132521),\n (176.504054, 163.132521, 176.504054, 166.105005),\n (176.504054, 166.105005, 176.504054, 169.077489),\n (176.504054, 169.077489, 176.504054, 172.049973),\n (176.504054, 172.049973, 176.504054, 175.022457),\n (176.504054, 175.022457, 176.504054, 177.994942),\n (176.504054, 177.994942, 176.504054, 180.967426),\n (176.504054, 180.967426, 176.504054, 183.93991),\n (176.504054, 183.93991, 176.504054, 186.912394),\n (176.504054, 186.912394, 176.504054, 189.884878),\n (176.504054, 189.884878, 176.504054, 192.857362),\n (176.504054, 192.857362, 176.504054, 195.829847),\n (176.504054, 100.710353, 175.523547, 100.710353),\n (176.504054, 195.829847, 175.523547, 195.829847)\n]\nVISIBLE_CIRCLES = [\n (113.9638, 148.2701, 47.559747),\n (113.9638, 148.2701, 40.62395)\n]\nVISIBLE_ARCS = [\n\n]\nHIDDEN_SEGMENTS = [\n (154.5878, 86.7104, 154.5878, 85.7299),\n (73.3399, 85.7299, 73.3399, 86.7104),\n (176.5041, 188.8941, 175.5236, 188.8941),\n (176.5041, 107.6462, 175.5236, 107.6462)\n]\n# (orient, text, p1, p2, base) for linear; (orient, text, center, radius, angle) for diameter\nDIMENSIONS = [\n ('diameter', '%%c100', (113.9638, 148.2701), 47.5597, 45),\n ('diameter', '%%c85.4167', (113.9638, 148.2701), 40.624, 135),\n ('horizontal', '1.0308', (175.5236, 148.2701), (176.5041, 148.2701), (176.0138, 159.2701))\n]\n\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\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\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,\n angle=(0 if d[0] == \"horizontal\" else 90),\n 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,\n text=text, dimstyle=\"EZDXF\").render()\n\n doc.saveas(out_path)\n\n\nif __name__ == \"__main__\":\n out = sys.argv[1] if len(sys.argv) > 1 else \"0082_00823938_gt.dxf\"\n draw(out)\n print(\"wrote\", out)\n```"}], "images": ["images/0082_00823938.png"], "id": "0082_00823938"} {"messages": [{"role": "user", "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 8.33 mm. It is extruded to a thickness of 4.12 mm."}, {"role": "assistant", "content": "```python\n#!/usr/bin/env python3\n# -*- coding: utf-8 -*-\n# Ground-truth 2D engineering drawing for part: 0082_00824139\n# Self-contained: reproduces the three-view DXF via ezdxf, NO FreeCAD needed.\n# Coordinates are A4 page millimetres (scale=0.9229445602334296, page=[297.0, 210.0]).\n# visible edges -> solid (layer OUTLINE); hidden edges -> dashed (layer HIDDEN)\n# dimensions -> real movable DIMENSION entities (text = true mm value)\n# Run: python 0082_00824139_gt.py [out.dxf]\nimport sys\nimport ezdxf\n\nSCALE = 0.9229445602334296\nPAGE = [297.0, 210.0]\n\nVISIBLE_SEGMENTS = [\n (172.812884, 80.657262, 169.928682, 80.657262),\n (169.928682, 80.657262, 167.04448, 80.657262),\n (167.04448, 80.657262, 164.160278, 80.657262),\n (164.160278, 80.657262, 161.276077, 80.657262),\n (161.276077, 80.657262, 158.391875, 80.657262),\n (158.391875, 80.657262, 155.507673, 80.657262),\n (155.507673, 80.657262, 152.623471, 80.657262),\n (152.623471, 80.657262, 149.73927, 80.657262),\n (149.73927, 80.657262, 146.855068, 80.657262),\n (146.855068, 80.657262, 143.970866, 80.657262),\n (143.970866, 80.657262, 141.086664, 80.657262),\n (141.086664, 80.657262, 138.202463, 80.657262),\n (138.202463, 80.657262, 135.318261, 80.657262),\n (135.318261, 80.657262, 132.434059, 80.657262),\n (132.434059, 80.657262, 129.549857, 80.657262),\n (129.549857, 80.657262, 126.665656, 80.657262),\n (126.665656, 80.657262, 123.781454, 80.657262),\n (123.781454, 80.657262, 120.897252, 80.657262),\n (120.897252, 80.657262, 118.01305, 80.657262),\n (118.01305, 80.657262, 115.128849, 80.657262),\n (115.128849, 80.657262, 112.244647, 80.657262),\n (112.244647, 80.657262, 109.360445, 80.657262),\n (109.360445, 80.657262, 106.476243, 80.657262),\n (106.476243, 80.657262, 103.592042, 80.657262),\n (103.592042, 80.657262, 100.70784, 80.657262),\n (100.70784, 80.657262, 97.823638, 80.657262),\n (97.823638, 80.657262, 94.939436, 80.657262),\n (94.939436, 80.657262, 92.055235, 80.657262),\n (92.055235, 80.657262, 89.171033, 80.657262),\n (89.171033, 80.657262, 86.286831, 80.657262),\n (86.286831, 80.657262, 83.402629, 80.657262),\n (83.402629, 80.657262, 80.518428, 80.657262),\n (172.812884, 80.657262, 172.812884, 76.851718),\n (172.812884, 76.851718, 169.928682, 76.851718),\n (169.928682, 76.851718, 167.04448, 76.851718),\n (167.04448, 76.851718, 164.160278, 76.851718),\n (164.160278, 76.851718, 161.276077, 76.851718),\n (161.276077, 76.851718, 158.391875, 76.851718),\n (158.391875, 76.851718, 155.507673, 76.851718),\n (155.507673, 76.851718, 152.623471, 76.851718),\n (152.623471, 76.851718, 149.73927, 76.851718),\n (149.73927, 76.851718, 146.855068, 76.851718),\n (146.855068, 76.851718, 143.970866, 76.851718),\n (143.970866, 76.851718, 141.086664, 76.851718),\n (141.086664, 76.851718, 138.202463, 76.851718),\n (138.202463, 76.851718, 135.318261, 76.851718),\n (135.318261, 76.851718, 132.434059, 76.851718),\n (132.434059, 76.851718, 129.549857, 76.851718),\n (129.549857, 76.851718, 126.665656, 76.851718),\n (126.665656, 76.851718, 123.781454, 76.851718),\n (123.781454, 76.851718, 120.897252, 76.851718),\n (120.897252, 76.851718, 118.01305, 76.851718),\n (118.01305, 76.851718, 115.128849, 76.851718),\n (115.128849, 76.851718, 112.244647, 76.851718),\n (112.244647, 76.851718, 109.360445, 76.851718),\n (109.360445, 76.851718, 106.476243, 76.851718),\n (106.476243, 76.851718, 103.592042, 76.851718),\n (103.592042, 76.851718, 100.70784, 76.851718),\n (100.70784, 76.851718, 97.823638, 76.851718),\n (97.823638, 76.851718, 94.939436, 76.851718),\n (94.939436, 76.851718, 92.055235, 76.851718),\n (92.055235, 76.851718, 89.171033, 76.851718),\n (89.171033, 76.851718, 86.286831, 76.851718),\n (86.286831, 76.851718, 83.402629, 76.851718),\n (83.402629, 76.851718, 80.518428, 76.851718),\n (80.518428, 76.851718, 80.518428, 80.657262),\n (186.812884, 186.951718, 186.812884, 184.067516),\n (186.812884, 184.067516, 186.812884, 181.183315),\n (186.812884, 181.183315, 186.812884, 178.299113),\n (186.812884, 178.299113, 186.812884, 175.414911),\n (186.812884, 175.414911, 186.812884, 172.530709),\n (186.812884, 172.530709, 186.812884, 169.646508),\n (186.812884, 169.646508, 186.812884, 166.762306),\n (186.812884, 166.762306, 186.812884, 163.878104),\n (186.812884, 163.878104, 186.812884, 160.993902),\n (186.812884, 160.993902, 186.812884, 158.109701),\n (186.812884, 158.109701, 186.812884, 155.225499),\n (186.812884, 155.225499, 186.812884, 152.341297),\n (186.812884, 152.341297, 186.812884, 149.457095),\n (186.812884, 149.457095, 186.812884, 146.572894),\n (186.812884, 146.572894, 186.812884, 143.688692),\n (186.812884, 143.688692, 186.812884, 140.80449),\n (186.812884, 140.80449, 186.812884, 137.920288),\n (186.812884, 137.920288, 186.812884, 135.036087),\n (186.812884, 135.036087, 186.812884, 132.151885),\n (186.812884, 132.151885, 186.812884, 129.267683),\n (186.812884, 129.267683, 186.812884, 126.383481),\n (186.812884, 126.383481, 186.812884, 123.49928),\n (186.812884, 123.49928, 186.812884, 120.615078),\n (186.812884, 120.615078, 186.812884, 117.730876),\n (186.812884, 117.730876, 186.812884, 114.846674),\n (186.812884, 114.846674, 186.812884, 111.962473),\n (186.812884, 111.962473, 186.812884, 109.078271),\n (186.812884, 109.078271, 186.812884, 106.194069),\n (186.812884, 106.194069, 186.812884, 103.309867),\n (186.812884, 103.309867, 186.812884, 100.425666),\n (186.812884, 100.425666, 186.812884, 97.541464),\n (186.812884, 97.541464, 186.812884, 94.657262),\n (190.618428, 186.951718, 190.618428, 184.067516),\n (190.618428, 184.067516, 190.618428, 181.183315),\n (190.618428, 181.183315, 190.618428, 178.299113),\n (190.618428, 178.299113, 190.618428, 175.414911),\n (190.618428, 175.414911, 190.618428, 172.530709),\n (190.618428, 172.530709, 190.618428, 169.646508),\n (190.618428, 169.646508, 190.618428, 166.762306),\n (190.618428, 166.762306, 190.618428, 163.878104),\n (190.618428, 163.878104, 190.618428, 160.993902),\n (190.618428, 160.993902, 190.618428, 158.109701),\n (190.618428, 158.109701, 190.618428, 155.225499),\n (190.618428, 155.225499, 190.618428, 152.341297),\n (190.618428, 152.341297, 190.618428, 149.457095),\n (190.618428, 149.457095, 190.618428, 146.572894),\n (190.618428, 146.572894, 190.618428, 143.688692),\n (190.618428, 143.688692, 190.618428, 140.80449),\n (190.618428, 140.80449, 190.618428, 137.920288),\n (190.618428, 137.920288, 190.618428, 135.036087),\n (190.618428, 135.036087, 190.618428, 132.151885),\n (190.618428, 132.151885, 190.618428, 129.267683),\n (190.618428, 129.267683, 190.618428, 126.383481),\n (190.618428, 126.383481, 190.618428, 123.49928),\n (190.618428, 123.49928, 190.618428, 120.615078),\n (190.618428, 120.615078, 190.618428, 117.730876),\n (190.618428, 117.730876, 190.618428, 114.846674),\n (190.618428, 114.846674, 190.618428, 111.962473),\n (190.618428, 111.962473, 190.618428, 109.078271),\n (190.618428, 109.078271, 190.618428, 106.194069),\n (190.618428, 106.194069, 190.618428, 103.309867),\n (190.618428, 103.309867, 190.618428, 100.425666),\n (190.618428, 100.425666, 190.618428, 97.541464),\n (190.618428, 97.541464, 190.618428, 94.657262),\n (190.618428, 186.951718, 186.812884, 186.951718),\n (190.618428, 94.657262, 186.812884, 94.657262)\n]\nVISIBLE_CIRCLES = [\n (126.665656, 140.80449, 46.147228),\n (108.399044, 173.49211, 3.845602)\n]\nVISIBLE_ARCS = [\n\n]\nHIDDEN_SEGMENTS = [\n (112.2447, 80.6573, 112.2447, 76.8517),\n (104.5535, 76.8517, 104.5535, 80.6573),\n (190.6184, 177.3377, 186.8129, 177.3377),\n (190.6184, 169.6465, 186.8129, 169.6465)\n]\n# (orient, text, p1, p2, base) for linear; (orient, text, center, radius, angle) for diameter\nDIMENSIONS = [\n ('diameter', '%%c100', (126.6656, 140.8045), 46.1472, 45),\n ('diameter', '%%c8.3333', (108.3991, 173.4921), 3.8456, 45),\n ('horizontal', '19.7917', (126.6656, 140.8045), (108.3991, 140.8045), (117.5324, 129.8045)),\n ('vertical', '35.4167', (108.3991, 140.8045), (108.3991, 173.4921), (97.3991, 157.1483)),\n ('horizontal', '4.1233', (186.8129, 140.8045), (190.6185, 140.8045), (188.7157, 151.8045))\n]\n\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\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\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,\n angle=(0 if d[0] == \"horizontal\" else 90),\n 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,\n text=text, dimstyle=\"EZDXF\").render()\n\n doc.saveas(out_path)\n\n\nif __name__ == \"__main__\":\n out = sys.argv[1] if len(sys.argv) > 1 else \"0082_00824139_gt.dxf\"\n draw(out)\n print(\"wrote\", out)\n```"}], "images": ["images/0082_00824139.png"], "id": "0082_00824139"} {"messages": [{"role": "user", "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 431.82 mm."}, {"role": "assistant", "content": "```python\n#!/usr/bin/env python3\n# -*- coding: utf-8 -*-\n# Ground-truth 2D engineering drawing for part: 0083_00835572\n# Self-contained: reproduces the three-view DXF via ezdxf, NO FreeCAD needed.\n# Coordinates are A4 page millimetres (scale=0.18070085470088249, page=[297.0, 210.0]).\n# visible edges -> solid (layer OUTLINE); hidden edges -> dashed (layer HIDDEN)\n# dimensions -> real movable DIMENSION entities (text = true mm value)\n# Run: python 0083_00835572_gt.py [out.dxf]\nimport sys\nimport ezdxf\n\nSCALE = 0.18070085470088249\nPAGE = [297.0, 210.0]\n\nVISIBLE_SEGMENTS = [\n (84.779557, 144.497457, 85.344247, 144.497457),\n (85.344247, 144.497457, 85.908938, 144.497457),\n (85.908938, 144.497457, 86.473628, 144.497457),\n (86.473628, 144.497457, 87.038318, 144.497457),\n (87.038318, 144.497457, 87.603008, 144.497457),\n (87.603008, 144.497457, 88.167698, 144.497457),\n (88.167698, 144.497457, 88.732388, 144.497457),\n (88.732388, 144.497457, 89.297079, 144.497457),\n (89.297079, 144.497457, 89.861769, 144.497457),\n (89.861769, 144.497457, 90.426459, 144.497457),\n (90.426459, 144.497457, 90.991149, 144.497457),\n (90.991149, 144.497457, 91.555839, 144.497457),\n (91.555839, 144.497457, 92.120529, 144.497457),\n (92.120529, 144.497457, 92.68522, 144.497457),\n (92.68522, 144.497457, 93.24991, 144.497457),\n (93.24991, 144.497457, 93.8146, 144.497457),\n (93.8146, 144.497457, 94.37929, 144.497457),\n (94.37929, 144.497457, 94.94398, 144.497457),\n (94.94398, 144.497457, 95.508671, 144.497457),\n (95.508671, 144.497457, 96.073361, 144.497457),\n (96.073361, 144.497457, 96.638051, 144.497457),\n (96.638051, 144.497457, 97.202741, 144.497457),\n (97.202741, 144.497457, 97.767431, 144.497457),\n (97.767431, 144.497457, 98.332121, 144.497457),\n (98.332121, 144.497457, 98.896812, 144.497457),\n (98.896812, 144.497457, 99.461502, 144.497457),\n (99.461502, 144.497457, 100.026192, 144.497457),\n (100.026192, 144.497457, 100.590882, 144.497457),\n (100.590882, 144.497457, 101.155572, 144.497457),\n (101.155572, 144.497457, 101.720262, 144.497457),\n (101.720262, 144.497457, 102.284953, 144.497457),\n (102.284953, 144.497457, 102.849643, 144.497457),\n (102.849643, 144.497457, 102.849643, 66.467543),\n (84.779557, 66.467543, 85.344247, 66.467543),\n (85.344247, 66.467543, 85.908938, 66.467543),\n (85.908938, 66.467543, 86.473628, 66.467543),\n (86.473628, 66.467543, 87.038318, 66.467543),\n (87.038318, 66.467543, 87.603008, 66.467543),\n (87.603008, 66.467543, 88.167698, 66.467543),\n (88.167698, 66.467543, 88.732388, 66.467543),\n (88.732388, 66.467543, 89.297079, 66.467543),\n (89.297079, 66.467543, 89.861769, 66.467543),\n (89.861769, 66.467543, 90.426459, 66.467543),\n (90.426459, 66.467543, 90.991149, 66.467543),\n (90.991149, 66.467543, 91.555839, 66.467543),\n (91.555839, 66.467543, 92.120529, 66.467543),\n (92.120529, 66.467543, 92.68522, 66.467543),\n (92.68522, 66.467543, 93.24991, 66.467543),\n (93.24991, 66.467543, 93.8146, 66.467543),\n (93.8146, 66.467543, 94.37929, 66.467543),\n (94.37929, 66.467543, 94.94398, 66.467543),\n (94.94398, 66.467543, 95.508671, 66.467543),\n (95.508671, 66.467543, 96.073361, 66.467543),\n (96.073361, 66.467543, 96.638051, 66.467543),\n (96.638051, 66.467543, 97.202741, 66.467543),\n (97.202741, 66.467543, 97.767431, 66.467543),\n (97.767431, 66.467543, 98.332121, 66.467543),\n (98.332121, 66.467543, 98.896812, 66.467543),\n (98.896812, 66.467543, 99.461502, 66.467543),\n (99.461502, 66.467543, 100.026192, 66.467543),\n (100.026192, 66.467543, 100.590882, 66.467543),\n (100.590882, 66.467543, 101.155572, 66.467543),\n (101.155572, 66.467543, 101.720262, 66.467543),\n (101.720262, 66.467543, 102.284953, 66.467543),\n (102.284953, 66.467543, 102.849643, 66.467543),\n (84.779557, 66.467543, 84.779557, 144.497457),\n (194.879557, 176.567543, 194.879557, 176.002853),\n (194.879557, 176.002853, 194.879557, 175.438162),\n (194.879557, 175.438162, 194.879557, 174.873472),\n (194.879557, 174.873472, 194.879557, 174.308782),\n (194.879557, 174.308782, 194.879557, 173.744092),\n (194.879557, 173.744092, 194.879557, 173.179402),\n (194.879557, 173.179402, 194.879557, 172.614712),\n (194.879557, 172.614712, 194.879557, 172.050021),\n (194.879557, 172.050021, 194.879557, 171.485331),\n (194.879557, 171.485331, 194.879557, 170.920641),\n (194.879557, 170.920641, 194.879557, 170.355951),\n (194.879557, 170.355951, 194.879557, 169.791261),\n (194.879557, 169.791261, 194.879557, 169.226571),\n (194.879557, 169.226571, 194.879557, 168.66188),\n (194.879557, 168.66188, 194.879557, 168.09719),\n (194.879557, 168.09719, 194.879557, 167.5325),\n (194.879557, 167.5325, 194.879557, 166.96781),\n (194.879557, 166.96781, 194.879557, 166.40312),\n (194.879557, 166.40312, 194.879557, 165.838429),\n (194.879557, 165.838429, 194.879557, 165.273739),\n (194.879557, 165.273739, 194.879557, 164.709049),\n (194.879557, 164.709049, 194.879557, 164.144359),\n (194.879557, 164.144359, 194.879557, 163.579669),\n (194.879557, 163.579669, 194.879557, 163.014979),\n (194.879557, 163.014979, 194.879557, 162.450288),\n (194.879557, 162.450288, 194.879557, 161.885598),\n (194.879557, 161.885598, 194.879557, 161.320908),\n (194.879557, 161.320908, 194.879557, 160.756218),\n (194.879557, 160.756218, 194.879557, 160.191528),\n (194.879557, 160.191528, 194.879557, 159.626838),\n (194.879557, 159.626838, 194.879557, 159.062147),\n (194.879557, 159.062147, 194.879557, 158.497457),\n (116.849643, 176.567543, 116.849643, 176.002853),\n (116.849643, 176.002853, 116.849643, 175.438162),\n (116.849643, 175.438162, 116.849643, 174.873472),\n (116.849643, 174.873472, 116.849643, 174.308782),\n (116.849643, 174.308782, 116.849643, 173.744092),\n (116.849643, 173.744092, 116.849643, 173.179402),\n (116.849643, 173.179402, 116.849643, 172.614712),\n (116.849643, 172.614712, 116.849643, 172.050021),\n (116.849643, 172.050021, 116.849643, 171.485331),\n (116.849643, 171.485331, 116.849643, 170.920641),\n (116.849643, 170.920641, 116.849643, 170.355951),\n (116.849643, 170.355951, 116.849643, 169.791261),\n (116.849643, 169.791261, 116.849643, 169.226571),\n (116.849643, 169.226571, 116.849643, 168.66188),\n (116.849643, 168.66188, 116.849643, 168.09719),\n (116.849643, 168.09719, 116.849643, 167.5325),\n (116.849643, 167.5325, 116.849643, 166.96781),\n (116.849643, 166.96781, 116.849643, 166.40312),\n (116.849643, 166.40312, 116.849643, 165.838429),\n (116.849643, 165.838429, 116.849643, 165.273739),\n (116.849643, 165.273739, 116.849643, 164.709049),\n (116.849643, 164.709049, 116.849643, 164.144359),\n (116.849643, 164.144359, 116.849643, 163.579669),\n (116.849643, 163.579669, 116.849643, 163.014979),\n (116.849643, 163.014979, 116.849643, 162.450288),\n (116.849643, 162.450288, 116.849643, 161.885598),\n (116.849643, 161.885598, 116.849643, 161.320908),\n (116.849643, 161.320908, 116.849643, 160.756218),\n (116.849643, 160.756218, 116.849643, 160.191528),\n (116.849643, 160.191528, 116.849643, 159.626838),\n (116.849643, 159.626838, 116.849643, 159.062147),\n (116.849643, 159.062147, 116.849643, 158.497457),\n (116.849643, 176.567543, 194.879557, 176.567543),\n (116.849643, 158.497457, 194.879557, 158.497457)\n]\nVISIBLE_CIRCLES = [\n (93.8146, 167.5325, 9.035043),\n (93.8146, 167.5325, 5.646902)\n]\nVISIBLE_ARCS = [\n\n]\nHIDDEN_SEGMENTS = [\n (99.4615, 66.4675, 99.4615, 144.4974),\n (88.1677, 144.4974, 88.1677, 66.4675),\n (116.8496, 161.8856, 194.8795, 161.8856),\n (116.8496, 173.1794, 194.8795, 173.1794)\n]\n# (orient, text, p1, p2, base) for linear; (orient, text, center, radius, angle) for diameter\nDIMENSIONS = [\n ('diameter', '%%c100', (93.8146, 167.5325), 9.035, 45),\n ('diameter', '%%c62.5', (93.8146, 167.5325), 5.6469, 135),\n ('horizontal', '431.818', (194.8795, 167.5325), (116.8496, 167.5325), (155.8646, 156.5325))\n]\n\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\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\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,\n angle=(0 if d[0] == \"horizontal\" else 90),\n 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,\n text=text, dimstyle=\"EZDXF\").render()\n\n doc.saveas(out_path)\n\n\nif __name__ == \"__main__\":\n out = sys.argv[1] if len(sys.argv) > 1 else \"0083_00835572_gt.dxf\"\n draw(out)\n print(\"wrote\", out)\n```"}], "images": ["images/0083_00835572.png"], "id": "0083_00835572"} {"messages": [{"role": "user", "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 83.33 mm. It is extruded to a thickness of 271.43 mm."}, {"role": "assistant", "content": "```python\n#!/usr/bin/env python3\n# -*- coding: utf-8 -*-\n# Ground-truth 2D engineering drawing for part: 0083_00835976\n# Self-contained: reproduces the three-view DXF via ezdxf, NO FreeCAD needed.\n# Coordinates are A4 page millimetres (scale=0.258730769230819, page=[297.0, 210.0]).\n# visible edges -> solid (layer OUTLINE); hidden edges -> dashed (layer HIDDEN)\n# dimensions -> real movable DIMENSION entities (text = true mm value)\n# Run: python 0083_00835976_gt.py [out.dxf]\nimport sys\nimport ezdxf\n\nSCALE = 0.258730769230819\nPAGE = [297.0, 210.0]\n\nVISIBLE_SEGMENTS = [\n (82.520762, 138.645161, 83.329295, 138.645161),\n (83.329295, 138.645161, 84.137829, 138.645161),\n (84.137829, 138.645161, 84.946362, 138.645161),\n (84.946362, 138.645161, 85.754896, 138.645161),\n (85.754896, 138.645161, 86.56343, 138.645161),\n (86.56343, 138.645161, 87.371963, 138.645161),\n (87.371963, 138.645161, 88.180497, 138.645161),\n (88.180497, 138.645161, 88.989031, 138.645161),\n (88.989031, 138.645161, 89.797564, 138.645161),\n (89.797564, 138.645161, 90.606098, 138.645161),\n (90.606098, 138.645161, 91.414632, 138.645161),\n (91.414632, 138.645161, 92.223165, 138.645161),\n (92.223165, 138.645161, 93.031699, 138.645161),\n (93.031699, 138.645161, 93.840233, 138.645161),\n (93.840233, 138.645161, 94.648766, 138.645161),\n (94.648766, 138.645161, 95.4573, 138.645161),\n (95.4573, 138.645161, 96.265834, 138.645161),\n (96.265834, 138.645161, 97.074367, 138.645161),\n (97.074367, 138.645161, 97.882901, 138.645161),\n (97.882901, 138.645161, 98.691435, 138.645161),\n (98.691435, 138.645161, 99.499968, 138.645161),\n (99.499968, 138.645161, 100.308502, 138.645161),\n (100.308502, 138.645161, 101.117036, 138.645161),\n (101.117036, 138.645161, 101.925569, 138.645161),\n (101.925569, 138.645161, 102.734103, 138.645161),\n (102.734103, 138.645161, 103.542637, 138.645161),\n (103.542637, 138.645161, 104.35117, 138.645161),\n (104.35117, 138.645161, 105.159704, 138.645161),\n (105.159704, 138.645161, 105.968238, 138.645161),\n (105.968238, 138.645161, 106.776771, 138.645161),\n (106.776771, 138.645161, 107.585305, 138.645161),\n (107.585305, 138.645161, 108.393838, 138.645161),\n (108.393838, 138.645161, 108.393838, 68.418238),\n (82.520762, 68.418238, 83.329295, 68.418238),\n (83.329295, 68.418238, 84.137829, 68.418238),\n (84.137829, 68.418238, 84.946362, 68.418238),\n (84.946362, 68.418238, 85.754896, 68.418238),\n (85.754896, 68.418238, 86.56343, 68.418238),\n (86.56343, 68.418238, 87.371963, 68.418238),\n (87.371963, 68.418238, 88.180497, 68.418238),\n (88.180497, 68.418238, 88.989031, 68.418238),\n (88.989031, 68.418238, 89.797564, 68.418238),\n (89.797564, 68.418238, 90.606098, 68.418238),\n (90.606098, 68.418238, 91.414632, 68.418238),\n (91.414632, 68.418238, 92.223165, 68.418238),\n (92.223165, 68.418238, 93.031699, 68.418238),\n (93.031699, 68.418238, 93.840233, 68.418238),\n (93.840233, 68.418238, 94.648766, 68.418238),\n (94.648766, 68.418238, 95.4573, 68.418238),\n (95.4573, 68.418238, 96.265834, 68.418238),\n (96.265834, 68.418238, 97.074367, 68.418238),\n (97.074367, 68.418238, 97.882901, 68.418238),\n (97.882901, 68.418238, 98.691435, 68.418238),\n (98.691435, 68.418238, 99.499968, 68.418238),\n (99.499968, 68.418238, 100.308502, 68.418238),\n (100.308502, 68.418238, 101.117036, 68.418238),\n (101.117036, 68.418238, 101.925569, 68.418238),\n (101.925569, 68.418238, 102.734103, 68.418238),\n (102.734103, 68.418238, 103.542637, 68.418238),\n (103.542637, 68.418238, 104.35117, 68.418238),\n (104.35117, 68.418238, 105.159704, 68.418238),\n (105.159704, 68.418238, 105.968238, 68.418238),\n (105.968238, 68.418238, 106.776771, 68.418238),\n (106.776771, 68.418238, 107.585305, 68.418238),\n (107.585305, 68.418238, 108.393838, 68.418238),\n (82.520762, 68.418238, 82.520762, 138.645161),\n (192.620762, 178.518238, 192.620762, 177.709705),\n (192.620762, 177.709705, 192.620762, 176.901171),\n (192.620762, 176.901171, 192.620762, 176.092638),\n (192.620762, 176.092638, 192.620762, 175.284104),\n (192.620762, 175.284104, 192.620762, 174.47557),\n (192.620762, 174.47557, 192.620762, 173.667037),\n (192.620762, 173.667037, 192.620762, 172.858503),\n (192.620762, 172.858503, 192.620762, 172.049969),\n (192.620762, 172.049969, 192.620762, 171.241436),\n (192.620762, 171.241436, 192.620762, 170.432902),\n (192.620762, 170.432902, 192.620762, 169.624368),\n (192.620762, 169.624368, 192.620762, 168.815835),\n (192.620762, 168.815835, 192.620762, 168.007301),\n (192.620762, 168.007301, 192.620762, 167.198767),\n (192.620762, 167.198767, 192.620762, 166.390234),\n (192.620762, 166.390234, 192.620762, 165.5817),\n (192.620762, 165.5817, 192.620762, 164.773166),\n (192.620762, 164.773166, 192.620762, 163.964633),\n (192.620762, 163.964633, 192.620762, 163.156099),\n (192.620762, 163.156099, 192.620762, 162.347565),\n (192.620762, 162.347565, 192.620762, 161.539032),\n (192.620762, 161.539032, 192.620762, 160.730498),\n (192.620762, 160.730498, 192.620762, 159.921964),\n (192.620762, 159.921964, 192.620762, 159.113431),\n (192.620762, 159.113431, 192.620762, 158.304897),\n (192.620762, 158.304897, 192.620762, 157.496363),\n (192.620762, 157.496363, 192.620762, 156.68783),\n (192.620762, 156.68783, 192.620762, 155.879296),\n (192.620762, 155.879296, 192.620762, 155.070762),\n (192.620762, 155.070762, 192.620762, 154.262229),\n (192.620762, 154.262229, 192.620762, 153.453695),\n (192.620762, 153.453695, 192.620762, 152.645162),\n (122.393839, 178.518238, 122.393839, 177.709705),\n (122.393839, 177.709705, 122.393839, 176.901171),\n (122.393839, 176.901171, 122.393839, 176.092638),\n (122.393839, 176.092638, 122.393839, 175.284104),\n (122.393839, 175.284104, 122.393839, 174.47557),\n (122.393839, 174.47557, 122.393839, 173.667037),\n (122.393839, 173.667037, 122.393839, 172.858503),\n (122.393839, 172.858503, 122.393839, 172.049969),\n (122.393839, 172.049969, 122.393839, 171.241436),\n (122.393839, 171.241436, 122.393839, 170.432902),\n (122.393839, 170.432902, 122.393839, 169.624368),\n (122.393839, 169.624368, 122.393839, 168.815835),\n (122.393839, 168.815835, 122.393839, 168.007301),\n (122.393839, 168.007301, 122.393839, 167.198767),\n (122.393839, 167.198767, 122.393839, 166.390234),\n (122.393839, 166.390234, 122.393839, 165.5817),\n (122.393839, 165.5817, 122.393839, 164.773166),\n (122.393839, 164.773166, 122.393839, 163.964633),\n (122.393839, 163.964633, 122.393839, 163.156099),\n (122.393839, 163.156099, 122.393839, 162.347565),\n (122.393839, 162.347565, 122.393839, 161.539032),\n (122.393839, 161.539032, 122.393839, 160.730498),\n (122.393839, 160.730498, 122.393839, 159.921964),\n (122.393839, 159.921964, 122.393839, 159.113431),\n (122.393839, 159.113431, 122.393839, 158.304897),\n (122.393839, 158.304897, 122.393839, 157.496363),\n (122.393839, 157.496363, 122.393839, 156.68783),\n (122.393839, 156.68783, 122.393839, 155.879296),\n (122.393839, 155.879296, 122.393839, 155.070762),\n (122.393839, 155.070762, 122.393839, 154.262229),\n (122.393839, 154.262229, 122.393839, 153.453695),\n (122.393839, 153.453695, 122.393839, 152.645162),\n (122.393839, 178.518238, 192.620762, 178.518238),\n (122.393839, 152.645162, 192.620762, 152.645162)\n]\nVISIBLE_CIRCLES = [\n (95.4573, 165.5817, 12.936538),\n (95.4573, 165.5817, 10.780449)\n]\nVISIBLE_ARCS = [\n\n]\nHIDDEN_SEGMENTS = [\n (106.2377, 68.4183, 106.2377, 138.6452),\n (84.6768, 138.6452, 84.6768, 68.4183),\n (122.3938, 154.8013, 192.6208, 154.8013),\n (122.3938, 176.3622, 192.6208, 176.3622)\n]\n# (orient, text, p1, p2, base) for linear; (orient, text, center, radius, angle) for diameter\nDIMENSIONS = [\n ('diameter', '%%c100', (95.4573, 165.5817), 12.9365, 45),\n ('diameter', '%%c83.3333', (95.4573, 165.5817), 10.7804, 135),\n ('horizontal', '271.429', (192.6208, 165.5817), (122.3938, 165.5817), (157.5073, 154.5817))\n]\n\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\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\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,\n angle=(0 if d[0] == \"horizontal\" else 90),\n 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,\n text=text, dimstyle=\"EZDXF\").render()\n\n doc.saveas(out_path)\n\n\nif __name__ == \"__main__\":\n out = sys.argv[1] if len(sys.argv) > 1 else \"0083_00835976_gt.dxf\"\n draw(out)\n print(\"wrote\", out)\n```"}], "images": ["images/0083_00835976.png"], "id": "0083_00835976"} {"messages": [{"role": "user", "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 250 mm."}, {"role": "assistant", "content": "```python\n#!/usr/bin/env python3\n# -*- coding: utf-8 -*-\n# Ground-truth 2D engineering drawing for part: 0084_00841542\n# Self-contained: reproduces the three-view DXF via ezdxf, NO FreeCAD needed.\n# Coordinates are A4 page millimetres (scale=0.2745714285714286, page=[297.0, 210.0]).\n# visible edges -> solid (layer OUTLINE); hidden edges -> dashed (layer HIDDEN)\n# dimensions -> real movable DIMENSION entities (text = true mm value)\n# Run: python 0084_00841542_gt.py [out.dxf]\nimport sys\nimport ezdxf\n\nSCALE = 0.2745714285714286\nPAGE = [297.0, 210.0]\n\nVISIBLE_SEGMENTS = [\n (109.686371, 68.814271, 108.828336, 68.814271),\n (108.828336, 68.814271, 107.9703, 68.814271),\n (107.9703, 68.814271, 107.112264, 68.814271),\n (107.112264, 68.814271, 106.254229, 68.814271),\n (106.254229, 68.814271, 105.396193, 68.814271),\n (105.396193, 68.814271, 104.538157, 68.814271),\n (104.538157, 68.814271, 103.680121, 68.814271),\n (103.680121, 68.814271, 102.822086, 68.814271),\n (102.822086, 68.814271, 101.96405, 68.814271),\n (101.96405, 68.814271, 101.106014, 68.814271),\n (101.106014, 68.814271, 100.247979, 68.814271),\n (100.247979, 68.814271, 99.389943, 68.814271),\n (99.389943, 68.814271, 98.531907, 68.814271),\n (98.531907, 68.814271, 97.673871, 68.814271),\n (97.673871, 68.814271, 96.815836, 68.814271),\n (96.815836, 68.814271, 95.9578, 68.814271),\n (95.9578, 68.814271, 95.099764, 68.814271),\n (95.099764, 68.814271, 94.241729, 68.814271),\n (94.241729, 68.814271, 93.383693, 68.814271),\n (93.383693, 68.814271, 92.525657, 68.814271),\n (92.525657, 68.814271, 91.667621, 68.814271),\n (91.667621, 68.814271, 90.809586, 68.814271),\n (90.809586, 68.814271, 89.95155, 68.814271),\n (89.95155, 68.814271, 89.093514, 68.814271),\n (89.093514, 68.814271, 88.235479, 68.814271),\n (88.235479, 68.814271, 87.377443, 68.814271),\n (87.377443, 68.814271, 86.519407, 68.814271),\n (86.519407, 68.814271, 85.661371, 68.814271),\n (85.661371, 68.814271, 84.803336, 68.814271),\n (84.803336, 68.814271, 83.9453, 68.814271),\n (83.9453, 68.814271, 83.087264, 68.814271),\n (83.087264, 68.814271, 82.229229, 68.814271),\n (109.686371, 68.814271, 109.686371, 137.457128),\n (109.686371, 137.457128, 108.828336, 137.457128),\n (108.828336, 137.457128, 107.9703, 137.457128),\n (107.9703, 137.457128, 107.112264, 137.457128),\n (107.112264, 137.457128, 106.254229, 137.457128),\n (106.254229, 137.457128, 105.396193, 137.457128),\n (105.396193, 137.457128, 104.538157, 137.457128),\n (104.538157, 137.457128, 103.680121, 137.457128),\n (103.680121, 137.457128, 102.822086, 137.457128),\n (102.822086, 137.457128, 101.96405, 137.457128),\n (101.96405, 137.457128, 101.106014, 137.457128),\n (101.106014, 137.457128, 100.247979, 137.457128),\n (100.247979, 137.457128, 99.389943, 137.457128),\n (99.389943, 137.457128, 98.531907, 137.457128),\n (98.531907, 137.457128, 97.673871, 137.457128),\n (97.673871, 137.457128, 96.815836, 137.457128),\n (96.815836, 137.457128, 95.9578, 137.457128),\n (95.9578, 137.457128, 95.099764, 137.457128),\n (95.099764, 137.457128, 94.241729, 137.457128),\n (94.241729, 137.457128, 93.383693, 137.457128),\n (93.383693, 137.457128, 92.525657, 137.457128),\n (92.525657, 137.457128, 91.667621, 137.457128),\n (91.667621, 137.457128, 90.809586, 137.457128),\n (90.809586, 137.457128, 89.95155, 137.457128),\n (89.95155, 137.457128, 89.093514, 137.457128),\n (89.093514, 137.457128, 88.235479, 137.457128),\n (88.235479, 137.457128, 87.377443, 137.457128),\n (87.377443, 137.457128, 86.519407, 137.457128),\n (86.519407, 137.457128, 85.661371, 137.457128),\n (85.661371, 137.457128, 84.803336, 137.457128),\n (84.803336, 137.457128, 83.9453, 137.457128),\n (83.9453, 137.457128, 83.087264, 137.457128),\n (83.087264, 137.457128, 82.229229, 137.457128),\n (82.229229, 137.457128, 82.229229, 68.814271),\n (123.686372, 151.457129, 123.686372, 152.315164),\n (123.686372, 152.315164, 123.686372, 153.1732),\n (123.686372, 153.1732, 123.686372, 154.031236),\n (123.686372, 154.031236, 123.686372, 154.889271),\n (123.686372, 154.889271, 123.686372, 155.747307),\n (123.686372, 155.747307, 123.686372, 156.605343),\n (123.686372, 156.605343, 123.686372, 157.463379),\n (123.686372, 157.463379, 123.686372, 158.321414),\n (123.686372, 158.321414, 123.686372, 159.17945),\n (123.686372, 159.17945, 123.686372, 160.037486),\n (123.686372, 160.037486, 123.686372, 160.895521),\n (123.686372, 160.895521, 123.686372, 161.753557),\n (123.686372, 161.753557, 123.686372, 162.611593),\n (123.686372, 162.611593, 123.686372, 163.469629),\n (123.686372, 163.469629, 123.686372, 164.327664),\n (123.686372, 164.327664, 123.686372, 165.1857),\n (123.686372, 165.1857, 123.686372, 166.043736),\n (123.686372, 166.043736, 123.686372, 166.901771),\n (123.686372, 166.901771, 123.686372, 167.759807),\n (123.686372, 167.759807, 123.686372, 168.617843),\n (123.686372, 168.617843, 123.686372, 169.475879),\n (123.686372, 169.475879, 123.686372, 170.333914),\n (123.686372, 170.333914, 123.686372, 171.19195),\n (123.686372, 171.19195, 123.686372, 172.049986),\n (123.686372, 172.049986, 123.686372, 172.908021),\n (123.686372, 172.908021, 123.686372, 173.766057),\n (123.686372, 173.766057, 123.686372, 174.624093),\n (123.686372, 174.624093, 123.686372, 175.482129),\n (123.686372, 175.482129, 123.686372, 176.340164),\n (123.686372, 176.340164, 123.686372, 177.1982),\n (123.686372, 177.1982, 123.686372, 178.056236),\n (123.686372, 178.056236, 123.686372, 178.914271),\n (192.329229, 151.457129, 192.329229, 152.315164),\n (192.329229, 152.315164, 192.329229, 153.1732),\n (192.329229, 153.1732, 192.329229, 154.031236),\n (192.329229, 154.031236, 192.329229, 154.889271),\n (192.329229, 154.889271, 192.329229, 155.747307),\n (192.329229, 155.747307, 192.329229, 156.605343),\n (192.329229, 156.605343, 192.329229, 157.463379),\n (192.329229, 157.463379, 192.329229, 158.321414),\n (192.329229, 158.321414, 192.329229, 159.17945),\n (192.329229, 159.17945, 192.329229, 160.037486),\n (192.329229, 160.037486, 192.329229, 160.895521),\n (192.329229, 160.895521, 192.329229, 161.753557),\n (192.329229, 161.753557, 192.329229, 162.611593),\n (192.329229, 162.611593, 192.329229, 163.469629),\n (192.329229, 163.469629, 192.329229, 164.327664),\n (192.329229, 164.327664, 192.329229, 165.1857),\n (192.329229, 165.1857, 192.329229, 166.043736),\n (192.329229, 166.043736, 192.329229, 166.901771),\n (192.329229, 166.901771, 192.329229, 167.759807),\n (192.329229, 167.759807, 192.329229, 168.617843),\n (192.329229, 168.617843, 192.329229, 169.475879),\n (192.329229, 169.475879, 192.329229, 170.333914),\n (192.329229, 170.333914, 192.329229, 171.19195),\n (192.329229, 171.19195, 192.329229, 172.049986),\n (192.329229, 172.049986, 192.329229, 172.908021),\n (192.329229, 172.908021, 192.329229, 173.766057),\n (192.329229, 173.766057, 192.329229, 174.624093),\n (192.329229, 174.624093, 192.329229, 175.482129),\n (192.329229, 175.482129, 192.329229, 176.340164),\n (192.329229, 176.340164, 192.329229, 177.1982),\n (192.329229, 177.1982, 192.329229, 178.056236),\n (192.329229, 178.056236, 192.329229, 178.914271),\n (192.329229, 151.457129, 123.686372, 151.457129),\n (192.329229, 178.914271, 123.686372, 178.914271)\n]\nVISIBLE_CIRCLES = [\n (95.9578, 165.1857, 13.728571),\n (95.9578, 165.1857, 11.154464)\n]\nVISIBLE_ARCS = [\n\n]\nHIDDEN_SEGMENTS = [\n (107.1123, 137.4571, 107.1123, 68.8143),\n (84.8033, 68.8143, 84.8033, 137.4571),\n (192.3292, 176.3402, 123.6864, 176.3402),\n (192.3292, 154.0313, 123.6864, 154.0313)\n]\n# (orient, text, p1, p2, base) for linear; (orient, text, center, radius, angle) for diameter\nDIMENSIONS = [\n ('diameter', '%%c100', (95.9578, 165.1857), 13.7286, 45),\n ('diameter', '%%c81.25', (95.9578, 165.1857), 11.1545, 135),\n ('horizontal', '250', (123.6864, 165.1857), (192.3292, 165.1857), (158.0078, 176.1857))\n]\n\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\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\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,\n angle=(0 if d[0] == \"horizontal\" else 90),\n 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,\n text=text, dimstyle=\"EZDXF\").render()\n\n doc.saveas(out_path)\n\n\nif __name__ == \"__main__\":\n out = sys.argv[1] if len(sys.argv) > 1 else \"0084_00841542_gt.dxf\"\n draw(out)\n print(\"wrote\", out)\n```"}], "images": ["images/0084_00841542.png"], "id": "0084_00841542"} {"messages": [{"role": "user", "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.11 mm. It is extruded to a thickness of 1078.01 mm."}, {"role": "assistant", "content": "```python\n#!/usr/bin/env python3\n# -*- coding: utf-8 -*-\n# Ground-truth 2D engineering drawing for part: 0084_00842827\n# Self-contained: reproduces the three-view DXF via ezdxf, NO FreeCAD needed.\n# Coordinates are A4 page millimetres (scale=0.08157796508128763, page=[297.0, 210.0]).\n# visible edges -> solid (layer OUTLINE); hidden edges -> dashed (layer HIDDEN)\n# dimensions -> real movable DIMENSION entities (text = true mm value)\n# Run: python 0084_00842827_gt.py [out.dxf]\nimport sys\nimport ezdxf\n\nSCALE = 0.08157796508128763\nPAGE = [297.0, 210.0]\n\nVISIBLE_SEGMENTS = [\n (86.562402, 151.931702, 86.817333, 151.931702),\n (86.817333, 151.931702, 87.072264, 151.931702),\n (87.072264, 151.931702, 87.327195, 151.931702),\n (87.327195, 151.931702, 87.582126, 151.931702),\n (87.582126, 151.931702, 87.837057, 151.931702),\n (87.837057, 151.931702, 88.091989, 151.931702),\n (88.091989, 151.931702, 88.34692, 151.931702),\n (88.34692, 151.931702, 88.601851, 151.931702),\n (88.601851, 151.931702, 88.856782, 151.931702),\n (88.856782, 151.931702, 89.111713, 151.931702),\n (89.111713, 151.931702, 89.366644, 151.931702),\n (89.366644, 151.931702, 89.621575, 151.931702),\n (89.621575, 151.931702, 89.876507, 151.931702),\n (89.876507, 151.931702, 90.131438, 151.931702),\n (90.131438, 151.931702, 90.386369, 151.931702),\n (90.386369, 151.931702, 90.6413, 151.931702),\n (90.6413, 151.931702, 90.896231, 151.931702),\n (90.896231, 151.931702, 91.151162, 151.931702),\n (91.151162, 151.931702, 91.406093, 151.931702),\n (91.406093, 151.931702, 91.661025, 151.931702),\n (91.661025, 151.931702, 91.915956, 151.931702),\n (91.915956, 151.931702, 92.170887, 151.931702),\n (92.170887, 151.931702, 92.425818, 151.931702),\n (92.425818, 151.931702, 92.680749, 151.931702),\n (92.680749, 151.931702, 92.93568, 151.931702),\n (92.93568, 151.931702, 93.190611, 151.931702),\n (93.190611, 151.931702, 93.445543, 151.931702),\n (93.445543, 151.931702, 93.700474, 151.931702),\n (93.700474, 151.931702, 93.955405, 151.931702),\n (93.955405, 151.931702, 94.210336, 151.931702),\n (94.210336, 151.931702, 94.465267, 151.931702),\n (94.465267, 151.931702, 94.720198, 151.931702),\n (94.720198, 151.931702, 94.720198, 63.989498),\n (86.562402, 63.989498, 86.817333, 63.989498),\n (86.817333, 63.989498, 87.072264, 63.989498),\n (87.072264, 63.989498, 87.327195, 63.989498),\n (87.327195, 63.989498, 87.582126, 63.989498),\n (87.582126, 63.989498, 87.837057, 63.989498),\n (87.837057, 63.989498, 88.091989, 63.989498),\n (88.091989, 63.989498, 88.34692, 63.989498),\n (88.34692, 63.989498, 88.601851, 63.989498),\n (88.601851, 63.989498, 88.856782, 63.989498),\n (88.856782, 63.989498, 89.111713, 63.989498),\n (89.111713, 63.989498, 89.366644, 63.989498),\n (89.366644, 63.989498, 89.621575, 63.989498),\n (89.621575, 63.989498, 89.876507, 63.989498),\n (89.876507, 63.989498, 90.131438, 63.989498),\n (90.131438, 63.989498, 90.386369, 63.989498),\n (90.386369, 63.989498, 90.6413, 63.989498),\n (90.6413, 63.989498, 90.896231, 63.989498),\n (90.896231, 63.989498, 91.151162, 63.989498),\n (91.151162, 63.989498, 91.406093, 63.989498),\n (91.406093, 63.989498, 91.661025, 63.989498),\n (91.661025, 63.989498, 91.915956, 63.989498),\n (91.915956, 63.989498, 92.170887, 63.989498),\n (92.170887, 63.989498, 92.425818, 63.989498),\n (92.425818, 63.989498, 92.680749, 63.989498),\n (92.680749, 63.989498, 92.93568, 63.989498),\n (92.93568, 63.989498, 93.190611, 63.989498),\n (93.190611, 63.989498, 93.445543, 63.989498),\n (93.445543, 63.989498, 93.700474, 63.989498),\n (93.700474, 63.989498, 93.955405, 63.989498),\n (93.955405, 63.989498, 94.210336, 63.989498),\n (94.210336, 63.989498, 94.465267, 63.989498),\n (94.465267, 63.989498, 94.720198, 63.989498),\n (86.562402, 63.989498, 86.562402, 151.931702),\n (196.662402, 174.089498, 196.662402, 173.834567),\n (196.662402, 173.834567, 196.662402, 173.579636),\n (196.662402, 173.579636, 196.662402, 173.324705),\n (196.662402, 173.324705, 196.662402, 173.069774),\n (196.662402, 173.069774, 196.662402, 172.814843),\n (196.662402, 172.814843, 196.662402, 172.559911),\n (196.662402, 172.559911, 196.662402, 172.30498),\n (196.662402, 172.30498, 196.662402, 172.050049),\n (196.662402, 172.050049, 196.662402, 171.795118),\n (196.662402, 171.795118, 196.662402, 171.540187),\n (196.662402, 171.540187, 196.662402, 171.285256),\n (196.662402, 171.285256, 196.662402, 171.030325),\n (196.662402, 171.030325, 196.662402, 170.775393),\n (196.662402, 170.775393, 196.662402, 170.520462),\n (196.662402, 170.520462, 196.662402, 170.265531),\n (196.662402, 170.265531, 196.662402, 170.0106),\n (196.662402, 170.0106, 196.662402, 169.755669),\n (196.662402, 169.755669, 196.662402, 169.500738),\n (196.662402, 169.500738, 196.662402, 169.245807),\n (196.662402, 169.245807, 196.662402, 168.990875),\n (196.662402, 168.990875, 196.662402, 168.735944),\n (196.662402, 168.735944, 196.662402, 168.481013),\n (196.662402, 168.481013, 196.662402, 168.226082),\n (196.662402, 168.226082, 196.662402, 167.971151),\n (196.662402, 167.971151, 196.662402, 167.71622),\n (196.662402, 167.71622, 196.662402, 167.461289),\n (196.662402, 167.461289, 196.662402, 167.206357),\n (196.662402, 167.206357, 196.662402, 166.951426),\n (196.662402, 166.951426, 196.662402, 166.696495),\n (196.662402, 166.696495, 196.662402, 166.441564),\n (196.662402, 166.441564, 196.662402, 166.186633),\n (196.662402, 166.186633, 196.662402, 165.931702),\n (108.720198, 174.089498, 108.720198, 173.834567),\n (108.720198, 173.834567, 108.720198, 173.579636),\n (108.720198, 173.579636, 108.720198, 173.324705),\n (108.720198, 173.324705, 108.720198, 173.069774),\n (108.720198, 173.069774, 108.720198, 172.814843),\n (108.720198, 172.814843, 108.720198, 172.559911),\n (108.720198, 172.559911, 108.720198, 172.30498),\n (108.720198, 172.30498, 108.720198, 172.050049),\n (108.720198, 172.050049, 108.720198, 171.795118),\n (108.720198, 171.795118, 108.720198, 171.540187),\n (108.720198, 171.540187, 108.720198, 171.285256),\n (108.720198, 171.285256, 108.720198, 171.030325),\n (108.720198, 171.030325, 108.720198, 170.775393),\n (108.720198, 170.775393, 108.720198, 170.520462),\n (108.720198, 170.520462, 108.720198, 170.265531),\n (108.720198, 170.265531, 108.720198, 170.0106),\n (108.720198, 170.0106, 108.720198, 169.755669),\n (108.720198, 169.755669, 108.720198, 169.500738),\n (108.720198, 169.500738, 108.720198, 169.245807),\n (108.720198, 169.245807, 108.720198, 168.990875),\n (108.720198, 168.990875, 108.720198, 168.735944),\n (108.720198, 168.735944, 108.720198, 168.481013),\n (108.720198, 168.481013, 108.720198, 168.226082),\n (108.720198, 168.226082, 108.720198, 167.971151),\n (108.720198, 167.971151, 108.720198, 167.71622),\n (108.720198, 167.71622, 108.720198, 167.461289),\n (108.720198, 167.461289, 108.720198, 167.206357),\n (108.720198, 167.206357, 108.720198, 166.951426),\n (108.720198, 166.951426, 108.720198, 166.696495),\n (108.720198, 166.696495, 108.720198, 166.441564),\n (108.720198, 166.441564, 108.720198, 166.186633),\n (108.720198, 166.186633, 108.720198, 165.931702),\n (108.720198, 174.089498, 196.662402, 174.089498),\n (108.720198, 165.931702, 196.662402, 165.931702)\n]\nVISIBLE_CIRCLES = [\n (90.6413, 170.0106, 4.078898),\n (90.6413, 170.0106, 3.471403)\n]\nVISIBLE_ARCS = [\n\n]\nHIDDEN_SEGMENTS = [\n (94.1127, 63.9894, 94.1127, 151.9317),\n (87.1699, 151.9317, 87.1699, 63.9894),\n (108.7202, 166.5391, 196.6624, 166.5391),\n (108.7202, 173.482, 196.6624, 173.482)\n]\n# (orient, text, p1, p2, base) for linear; (orient, text, center, radius, angle) for diameter\nDIMENSIONS = [\n ('diameter', '%%c100', (90.6413, 170.0106), 4.0789, 45),\n ('diameter', '%%c85.1064', (90.6413, 170.0106), 3.4714, 135),\n ('horizontal', '1078.01', (196.6624, 170.0106), (108.7202, 170.0106), (152.6913, 159.0106))\n]\n\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\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\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,\n angle=(0 if d[0] == \"horizontal\" else 90),\n 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,\n text=text, dimstyle=\"EZDXF\").render()\n\n doc.saveas(out_path)\n\n\nif __name__ == \"__main__\":\n out = sys.argv[1] if len(sys.argv) > 1 else \"0084_00842827_gt.dxf\"\n draw(out)\n print(\"wrote\", out)\n```"}], "images": ["images/0084_00842827.png"], "id": "0084_00842827"} {"messages": [{"role": "user", "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 95.83 mm. It is extruded to a thickness of 730.77 mm."}, {"role": "assistant", "content": "```python\n#!/usr/bin/env python3\n# -*- coding: utf-8 -*-\n# Ground-truth 2D engineering drawing for part: 0084_00842961\n# Self-contained: reproduces the three-view DXF via ezdxf, NO FreeCAD needed.\n# Coordinates are A4 page millimetres (scale=0.1156759259259302, page=[297.0, 210.0]).\n# visible edges -> solid (layer OUTLINE); hidden edges -> dashed (layer HIDDEN)\n# dimensions -> real movable DIMENSION entities (text = true mm value)\n# Run: python 0084_00842961_gt.py [out.dxf]\nimport sys\nimport ezdxf\n\nSCALE = 0.1156759259259302\nPAGE = [297.0, 210.0]\n\nVISIBLE_SEGMENTS = [\n (85.618304, 149.374304, 85.979791, 149.374304),\n (85.979791, 149.374304, 86.341278, 149.374304),\n (86.341278, 149.374304, 86.702766, 149.374304),\n (86.702766, 149.374304, 87.064253, 149.374304),\n (87.064253, 149.374304, 87.42574, 149.374304),\n (87.42574, 149.374304, 87.787227, 149.374304),\n (87.787227, 149.374304, 88.148715, 149.374304),\n (88.148715, 149.374304, 88.510202, 149.374304),\n (88.510202, 149.374304, 88.871689, 149.374304),\n (88.871689, 149.374304, 89.233176, 149.374304),\n (89.233176, 149.374304, 89.594664, 149.374304),\n (89.594664, 149.374304, 89.956151, 149.374304),\n (89.956151, 149.374304, 90.317638, 149.374304),\n (90.317638, 149.374304, 90.679125, 149.374304),\n (90.679125, 149.374304, 91.040613, 149.374304),\n (91.040613, 149.374304, 91.4021, 149.374304),\n (91.4021, 149.374304, 91.763587, 149.374304),\n (91.763587, 149.374304, 92.125075, 149.374304),\n (92.125075, 149.374304, 92.486562, 149.374304),\n (92.486562, 149.374304, 92.848049, 149.374304),\n (92.848049, 149.374304, 93.209536, 149.374304),\n (93.209536, 149.374304, 93.571024, 149.374304),\n (93.571024, 149.374304, 93.932511, 149.374304),\n (93.932511, 149.374304, 94.293998, 149.374304),\n (94.293998, 149.374304, 94.655485, 149.374304),\n (94.655485, 149.374304, 95.016973, 149.374304),\n (95.016973, 149.374304, 95.37846, 149.374304),\n (95.37846, 149.374304, 95.739947, 149.374304),\n (95.739947, 149.374304, 96.101434, 149.374304),\n (96.101434, 149.374304, 96.462922, 149.374304),\n (96.462922, 149.374304, 96.824409, 149.374304),\n (96.824409, 149.374304, 97.185896, 149.374304),\n (97.185896, 149.374304, 97.185896, 64.841896),\n (85.618304, 64.841896, 85.979791, 64.841896),\n (85.979791, 64.841896, 86.341278, 64.841896),\n (86.341278, 64.841896, 86.702766, 64.841896),\n (86.702766, 64.841896, 87.064253, 64.841896),\n (87.064253, 64.841896, 87.42574, 64.841896),\n (87.42574, 64.841896, 87.787227, 64.841896),\n (87.787227, 64.841896, 88.148715, 64.841896),\n (88.148715, 64.841896, 88.510202, 64.841896),\n (88.510202, 64.841896, 88.871689, 64.841896),\n (88.871689, 64.841896, 89.233176, 64.841896),\n (89.233176, 64.841896, 89.594664, 64.841896),\n (89.594664, 64.841896, 89.956151, 64.841896),\n (89.956151, 64.841896, 90.317638, 64.841896),\n (90.317638, 64.841896, 90.679125, 64.841896),\n (90.679125, 64.841896, 91.040613, 64.841896),\n (91.040613, 64.841896, 91.4021, 64.841896),\n (91.4021, 64.841896, 91.763587, 64.841896),\n (91.763587, 64.841896, 92.125075, 64.841896),\n (92.125075, 64.841896, 92.486562, 64.841896),\n (92.486562, 64.841896, 92.848049, 64.841896),\n (92.848049, 64.841896, 93.209536, 64.841896),\n (93.209536, 64.841896, 93.571024, 64.841896),\n (93.571024, 64.841896, 93.932511, 64.841896),\n (93.932511, 64.841896, 94.293998, 64.841896),\n (94.293998, 64.841896, 94.655485, 64.841896),\n (94.655485, 64.841896, 95.016973, 64.841896),\n (95.016973, 64.841896, 95.37846, 64.841896),\n (95.37846, 64.841896, 95.739947, 64.841896),\n (95.739947, 64.841896, 96.101434, 64.841896),\n (96.101434, 64.841896, 96.462922, 64.841896),\n (96.462922, 64.841896, 96.824409, 64.841896),\n (96.824409, 64.841896, 97.185896, 64.841896),\n (85.618304, 64.841896, 85.618304, 149.374304),\n (195.718304, 174.941896, 195.718304, 174.580409),\n (195.718304, 174.580409, 195.718304, 174.218922),\n (195.718304, 174.218922, 195.718304, 173.857434),\n (195.718304, 173.857434, 195.718304, 173.495947),\n (195.718304, 173.495947, 195.718304, 173.13446),\n (195.718304, 173.13446, 195.718304, 172.772973),\n (195.718304, 172.772973, 195.718304, 172.411485),\n (195.718304, 172.411485, 195.718304, 172.049998),\n (195.718304, 172.049998, 195.718304, 171.688511),\n (195.718304, 171.688511, 195.718304, 171.327024),\n (195.718304, 171.327024, 195.718304, 170.965536),\n (195.718304, 170.965536, 195.718304, 170.604049),\n (195.718304, 170.604049, 195.718304, 170.242562),\n (195.718304, 170.242562, 195.718304, 169.881075),\n (195.718304, 169.881075, 195.718304, 169.519587),\n (195.718304, 169.519587, 195.718304, 169.1581),\n (195.718304, 169.1581, 195.718304, 168.796613),\n (195.718304, 168.796613, 195.718304, 168.435125),\n (195.718304, 168.435125, 195.718304, 168.073638),\n (195.718304, 168.073638, 195.718304, 167.712151),\n (195.718304, 167.712151, 195.718304, 167.350664),\n (195.718304, 167.350664, 195.718304, 166.989176),\n (195.718304, 166.989176, 195.718304, 166.627689),\n (195.718304, 166.627689, 195.718304, 166.266202),\n (195.718304, 166.266202, 195.718304, 165.904715),\n (195.718304, 165.904715, 195.718304, 165.543227),\n (195.718304, 165.543227, 195.718304, 165.18174),\n (195.718304, 165.18174, 195.718304, 164.820253),\n (195.718304, 164.820253, 195.718304, 164.458766),\n (195.718304, 164.458766, 195.718304, 164.097278),\n (195.718304, 164.097278, 195.718304, 163.735791),\n (195.718304, 163.735791, 195.718304, 163.374304),\n (111.185896, 174.941896, 111.185896, 174.580409),\n (111.185896, 174.580409, 111.185896, 174.218922),\n (111.185896, 174.218922, 111.185896, 173.857434),\n (111.185896, 173.857434, 111.185896, 173.495947),\n (111.185896, 173.495947, 111.185896, 173.13446),\n (111.185896, 173.13446, 111.185896, 172.772973),\n (111.185896, 172.772973, 111.185896, 172.411485),\n (111.185896, 172.411485, 111.185896, 172.049998),\n (111.185896, 172.049998, 111.185896, 171.688511),\n (111.185896, 171.688511, 111.185896, 171.327024),\n (111.185896, 171.327024, 111.185896, 170.965536),\n (111.185896, 170.965536, 111.185896, 170.604049),\n (111.185896, 170.604049, 111.185896, 170.242562),\n (111.185896, 170.242562, 111.185896, 169.881075),\n (111.185896, 169.881075, 111.185896, 169.519587),\n (111.185896, 169.519587, 111.185896, 169.1581),\n (111.185896, 169.1581, 111.185896, 168.796613),\n (111.185896, 168.796613, 111.185896, 168.435125),\n (111.185896, 168.435125, 111.185896, 168.073638),\n (111.185896, 168.073638, 111.185896, 167.712151),\n (111.185896, 167.712151, 111.185896, 167.350664),\n (111.185896, 167.350664, 111.185896, 166.989176),\n (111.185896, 166.989176, 111.185896, 166.627689),\n (111.185896, 166.627689, 111.185896, 166.266202),\n (111.185896, 166.266202, 111.185896, 165.904715),\n (111.185896, 165.904715, 111.185896, 165.543227),\n (111.185896, 165.543227, 111.185896, 165.18174),\n (111.185896, 165.18174, 111.185896, 164.820253),\n (111.185896, 164.820253, 111.185896, 164.458766),\n (111.185896, 164.458766, 111.185896, 164.097278),\n (111.185896, 164.097278, 111.185896, 163.735791),\n (111.185896, 163.735791, 111.185896, 163.374304),\n (111.185896, 174.941896, 195.718304, 174.941896),\n (111.185896, 163.374304, 195.718304, 163.374304)\n]\nVISIBLE_CIRCLES = [\n (91.4021, 169.1581, 5.783796),\n (91.4021, 169.1581, 5.542805)\n]\nVISIBLE_ARCS = [\n\n]\nHIDDEN_SEGMENTS = [\n\n]\n# (orient, text, p1, p2, base) for linear; (orient, text, center, radius, angle) for diameter\nDIMENSIONS = [\n ('diameter', '%%c100', (91.4021, 169.1581), 5.7838, 45),\n ('diameter', '%%c95.8333', (91.4021, 169.1581), 5.5428, 135),\n ('horizontal', '730.769', (195.7183, 169.1581), (111.1859, 169.1581), (153.4521, 158.1581))\n]\n\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\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\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,\n angle=(0 if d[0] == \"horizontal\" else 90),\n 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,\n text=text, dimstyle=\"EZDXF\").render()\n\n doc.saveas(out_path)\n\n\nif __name__ == \"__main__\":\n out = sys.argv[1] if len(sys.argv) > 1 else \"0084_00842961_gt.dxf\"\n draw(out)\n print(\"wrote\", out)\n```"}], "images": ["images/0084_00842961.png"], "id": "0084_00842961"} {"messages": [{"role": "user", "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 64.58 mm. It is extruded to a thickness of 678.57 mm."}, {"role": "assistant", "content": "```python\n#!/usr/bin/env python3\n# -*- coding: utf-8 -*-\n# Ground-truth 2D engineering drawing for part: 0084_00847641\n# Self-contained: reproduces the three-view DXF via ezdxf, NO FreeCAD needed.\n# Coordinates are A4 page millimetres (scale=0.1234311926605518, page=[297.0, 210.0]).\n# visible edges -> solid (layer OUTLINE); hidden edges -> dashed (layer HIDDEN)\n# dimensions -> real movable DIMENSION entities (text = true mm value)\n# Run: python 0084_00847641_gt.py [out.dxf]\nimport sys\nimport ezdxf\n\nSCALE = 0.1234311926605518\nPAGE = [297.0, 210.0]\n\nVISIBLE_SEGMENTS = [\n (98.25376, 65.035759, 97.868037, 65.035759),\n (97.868037, 65.035759, 97.482315, 65.035759),\n (97.482315, 65.035759, 97.096592, 65.035759),\n (97.096592, 65.035759, 96.71087, 65.035759),\n (96.71087, 65.035759, 96.325147, 65.035759),\n (96.325147, 65.035759, 95.939425, 65.035759),\n (95.939425, 65.035759, 95.553702, 65.035759),\n (95.553702, 65.035759, 95.16798, 65.035759),\n (95.16798, 65.035759, 94.782257, 65.035759),\n (94.782257, 65.035759, 94.396535, 65.035759),\n (94.396535, 65.035759, 94.010812, 65.035759),\n (94.010812, 65.035759, 93.62509, 65.035759),\n (93.62509, 65.035759, 93.239367, 65.035759),\n (93.239367, 65.035759, 92.853645, 65.035759),\n (92.853645, 65.035759, 92.467922, 65.035759),\n (92.467922, 65.035759, 92.0822, 65.035759),\n (92.0822, 65.035759, 91.696478, 65.035759),\n (91.696478, 65.035759, 91.310755, 65.035759),\n (91.310755, 65.035759, 90.925033, 65.035759),\n (90.925033, 65.035759, 90.53931, 65.035759),\n (90.53931, 65.035759, 90.153588, 65.035759),\n (90.153588, 65.035759, 89.767865, 65.035759),\n (89.767865, 65.035759, 89.382143, 65.035759),\n (89.382143, 65.035759, 88.99642, 65.035759),\n (88.99642, 65.035759, 88.610698, 65.035759),\n (88.610698, 65.035759, 88.224975, 65.035759),\n (88.224975, 65.035759, 87.839253, 65.035759),\n (87.839253, 65.035759, 87.45353, 65.035759),\n (87.45353, 65.035759, 87.067808, 65.035759),\n (87.067808, 65.035759, 86.682085, 65.035759),\n (86.682085, 65.035759, 86.296363, 65.035759),\n (86.296363, 65.035759, 85.91064, 65.035759),\n (98.25376, 65.035759, 98.25376, 148.79264),\n (98.25376, 148.79264, 97.868037, 148.79264),\n (97.868037, 148.79264, 97.482315, 148.79264),\n (97.482315, 148.79264, 97.096592, 148.79264),\n (97.096592, 148.79264, 96.71087, 148.79264),\n (96.71087, 148.79264, 96.325147, 148.79264),\n (96.325147, 148.79264, 95.939425, 148.79264),\n (95.939425, 148.79264, 95.553702, 148.79264),\n (95.553702, 148.79264, 95.16798, 148.79264),\n (95.16798, 148.79264, 94.782257, 148.79264),\n (94.782257, 148.79264, 94.396535, 148.79264),\n (94.396535, 148.79264, 94.010812, 148.79264),\n (94.010812, 148.79264, 93.62509, 148.79264),\n (93.62509, 148.79264, 93.239367, 148.79264),\n (93.239367, 148.79264, 92.853645, 148.79264),\n (92.853645, 148.79264, 92.467922, 148.79264),\n (92.467922, 148.79264, 92.0822, 148.79264),\n (92.0822, 148.79264, 91.696478, 148.79264),\n (91.696478, 148.79264, 91.310755, 148.79264),\n (91.310755, 148.79264, 90.925033, 148.79264),\n (90.925033, 148.79264, 90.53931, 148.79264),\n (90.53931, 148.79264, 90.153588, 148.79264),\n (90.153588, 148.79264, 89.767865, 148.79264),\n (89.767865, 148.79264, 89.382143, 148.79264),\n (89.382143, 148.79264, 88.99642, 148.79264),\n (88.99642, 148.79264, 88.610698, 148.79264),\n (88.610698, 148.79264, 88.224975, 148.79264),\n (88.224975, 148.79264, 87.839253, 148.79264),\n (87.839253, 148.79264, 87.45353, 148.79264),\n (87.45353, 148.79264, 87.067808, 148.79264),\n (87.067808, 148.79264, 86.682085, 148.79264),\n (86.682085, 148.79264, 86.296363, 148.79264),\n (86.296363, 148.79264, 85.91064, 148.79264),\n (85.91064, 148.79264, 85.91064, 65.035759),\n (112.25376, 162.79264, 112.25376, 163.178363),\n (112.25376, 163.178363, 112.25376, 163.564085),\n (112.25376, 163.564085, 112.25376, 163.949808),\n (112.25376, 163.949808, 112.25376, 164.33553),\n (112.25376, 164.33553, 112.25376, 164.721253),\n (112.25376, 164.721253, 112.25376, 165.106975),\n (112.25376, 165.106975, 112.25376, 165.492698),\n (112.25376, 165.492698, 112.25376, 165.87842),\n (112.25376, 165.87842, 112.25376, 166.264143),\n (112.25376, 166.264143, 112.25376, 166.649865),\n (112.25376, 166.649865, 112.25376, 167.035588),\n (112.25376, 167.035588, 112.25376, 167.42131),\n (112.25376, 167.42131, 112.25376, 167.807033),\n (112.25376, 167.807033, 112.25376, 168.192755),\n (112.25376, 168.192755, 112.25376, 168.578478),\n (112.25376, 168.578478, 112.25376, 168.9642),\n (112.25376, 168.9642, 112.25376, 169.349922),\n (112.25376, 169.349922, 112.25376, 169.735645),\n (112.25376, 169.735645, 112.25376, 170.121367),\n (112.25376, 170.121367, 112.25376, 170.50709),\n (112.25376, 170.50709, 112.25376, 170.892812),\n (112.25376, 170.892812, 112.25376, 171.278535),\n (112.25376, 171.278535, 112.25376, 171.664257),\n (112.25376, 171.664257, 112.25376, 172.04998),\n (112.25376, 172.04998, 112.25376, 172.435702),\n (112.25376, 172.435702, 112.25376, 172.821425),\n (112.25376, 172.821425, 112.25376, 173.207147),\n (112.25376, 173.207147, 112.25376, 173.59287),\n (112.25376, 173.59287, 112.25376, 173.978592),\n (112.25376, 173.978592, 112.25376, 174.364315),\n (112.25376, 174.364315, 112.25376, 174.750037),\n (112.25376, 174.750037, 112.25376, 175.13576),\n (196.010641, 162.79264, 196.010641, 163.178363),\n (196.010641, 163.178363, 196.010641, 163.564085),\n (196.010641, 163.564085, 196.010641, 163.949808),\n (196.010641, 163.949808, 196.010641, 164.33553),\n (196.010641, 164.33553, 196.010641, 164.721253),\n (196.010641, 164.721253, 196.010641, 165.106975),\n (196.010641, 165.106975, 196.010641, 165.492698),\n (196.010641, 165.492698, 196.010641, 165.87842),\n (196.010641, 165.87842, 196.010641, 166.264143),\n (196.010641, 166.264143, 196.010641, 166.649865),\n (196.010641, 166.649865, 196.010641, 167.035588),\n (196.010641, 167.035588, 196.010641, 167.42131),\n (196.010641, 167.42131, 196.010641, 167.807033),\n (196.010641, 167.807033, 196.010641, 168.192755),\n (196.010641, 168.192755, 196.010641, 168.578478),\n (196.010641, 168.578478, 196.010641, 168.9642),\n (196.010641, 168.9642, 196.010641, 169.349922),\n (196.010641, 169.349922, 196.010641, 169.735645),\n (196.010641, 169.735645, 196.010641, 170.121367),\n (196.010641, 170.121367, 196.010641, 170.50709),\n (196.010641, 170.50709, 196.010641, 170.892812),\n (196.010641, 170.892812, 196.010641, 171.278535),\n (196.010641, 171.278535, 196.010641, 171.664257),\n (196.010641, 171.664257, 196.010641, 172.04998),\n (196.010641, 172.04998, 196.010641, 172.435702),\n (196.010641, 172.435702, 196.010641, 172.821425),\n (196.010641, 172.821425, 196.010641, 173.207147),\n (196.010641, 173.207147, 196.010641, 173.59287),\n (196.010641, 173.59287, 196.010641, 173.978592),\n (196.010641, 173.978592, 196.010641, 174.364315),\n (196.010641, 174.364315, 196.010641, 174.750037),\n (196.010641, 174.750037, 196.010641, 175.13576),\n (196.010641, 162.79264, 112.25376, 162.79264),\n (196.010641, 175.13576, 112.25376, 175.13576)\n]\nVISIBLE_CIRCLES = [\n (92.0822, 168.9642, 6.17156),\n (92.0822, 168.9642, 3.985799)\n]\nVISIBLE_ARCS = [\n\n]\nHIDDEN_SEGMENTS = [\n (96.068, 148.7927, 96.068, 65.0358),\n (88.0964, 65.0358, 88.0964, 148.7927),\n (196.0107, 172.95, 112.2538, 172.95),\n (196.0107, 164.9784, 112.2538, 164.9784)\n]\n# (orient, text, p1, p2, base) for linear; (orient, text, center, radius, angle) for diameter\nDIMENSIONS = [\n ('diameter', '%%c100', (92.0822, 168.9642), 6.1716, 45),\n ('diameter', '%%c64.5833', (92.0822, 168.9642), 3.9858, 135),\n ('horizontal', '678.571', (112.2538, 168.9642), (196.0107, 168.9642), (154.1322, 179.9642))\n]\n\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\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\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,\n angle=(0 if d[0] == \"horizontal\" else 90),\n 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,\n text=text, dimstyle=\"EZDXF\").render()\n\n doc.saveas(out_path)\n\n\nif __name__ == \"__main__\":\n out = sys.argv[1] if len(sys.argv) > 1 else \"0084_00847641_gt.dxf\"\n draw(out)\n print(\"wrote\", out)\n```"}], "images": ["images/0084_00847641.png"], "id": "0084_00847641"} {"messages": [{"role": "user", "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": "assistant", "content": "```python\n#!/usr/bin/env python3\n# -*- coding: utf-8 -*-\n# Ground-truth 2D engineering drawing for part: 0086_00865393\n# Self-contained: reproduces the three-view DXF via ezdxf, NO FreeCAD needed.\n# Coordinates are A4 page millimetres (scale=0.8752854672135206, page=[297.0, 210.0]).\n# visible edges -> solid (layer OUTLINE); hidden edges -> dashed (layer HIDDEN)\n# dimensions -> real movable DIMENSION entities (text = true mm value)\n# Run: python 0086_00865393_gt.py [out.dxf]\nimport sys\nimport ezdxf\n\nSCALE = 0.8752854672135206\nPAGE = [297.0, 210.0]\n\nVISIBLE_SEGMENTS = [\n (159.338973, 83.832173, 156.603706, 83.832173),\n (156.603706, 83.832173, 153.868439, 83.832173),\n (153.868439, 83.832173, 151.133172, 83.832173),\n (151.133172, 83.832173, 148.397905, 83.832173),\n (148.397905, 83.832173, 145.662638, 83.832173),\n (145.662638, 83.832173, 142.927371, 83.832173),\n (142.927371, 83.832173, 140.192104, 83.832173),\n (140.192104, 83.832173, 137.456837, 83.832173),\n (137.456837, 83.832173, 134.72157, 83.832173),\n (134.72157, 83.832173, 131.986303, 83.832173),\n (131.986303, 83.832173, 129.251035, 83.832173),\n (129.251035, 83.832173, 126.515768, 83.832173),\n (126.515768, 83.832173, 123.780501, 83.832173),\n (123.780501, 83.832173, 121.045234, 83.832173),\n (121.045234, 83.832173, 118.309967, 83.832173),\n (118.309967, 83.832173, 115.5747, 83.832173),\n (115.5747, 83.832173, 112.839433, 83.832173),\n (112.839433, 83.832173, 110.104166, 83.832173),\n (110.104166, 83.832173, 107.368899, 83.832173),\n (107.368899, 83.832173, 104.633632, 83.832173),\n (104.633632, 83.832173, 101.898365, 83.832173),\n (101.898365, 83.832173, 99.163097, 83.832173),\n (99.163097, 83.832173, 96.42783, 83.832173),\n (96.42783, 83.832173, 93.692563, 83.832173),\n (93.692563, 83.832173, 90.957296, 83.832173),\n (90.957296, 83.832173, 88.222029, 83.832173),\n (88.222029, 83.832173, 85.486762, 83.832173),\n (85.486762, 83.832173, 82.751495, 83.832173),\n (82.751495, 83.832173, 80.016228, 83.832173),\n (80.016228, 83.832173, 77.280961, 83.832173),\n (77.280961, 83.832173, 74.545694, 83.832173),\n (74.545694, 83.832173, 71.810427, 83.832173),\n (159.338973, 83.832173, 159.338973, 92.403626),\n (159.338973, 92.403626, 156.603706, 92.403626),\n (156.603706, 92.403626, 153.868439, 92.403626),\n (153.868439, 92.403626, 151.133172, 92.403626),\n (151.133172, 92.403626, 148.397905, 92.403626),\n (148.397905, 92.403626, 145.662638, 92.403626),\n (145.662638, 92.403626, 142.927371, 92.403626),\n (142.927371, 92.403626, 140.192104, 92.403626),\n (140.192104, 92.403626, 137.456837, 92.403626),\n (137.456837, 92.403626, 134.72157, 92.403626),\n (134.72157, 92.403626, 131.986303, 92.403626),\n (131.986303, 92.403626, 129.251035, 92.403626),\n (129.251035, 92.403626, 126.515768, 92.403626),\n (126.515768, 92.403626, 123.780501, 92.403626),\n (123.780501, 92.403626, 121.045234, 92.403626),\n (121.045234, 92.403626, 118.309967, 92.403626),\n (118.309967, 92.403626, 115.5747, 92.403626),\n (115.5747, 92.403626, 112.839433, 92.403626),\n (112.839433, 92.403626, 110.104166, 92.403626),\n (110.104166, 92.403626, 107.368899, 92.403626),\n (107.368899, 92.403626, 104.633632, 92.403626),\n (104.633632, 92.403626, 101.898365, 92.403626),\n (101.898365, 92.403626, 99.163097, 92.403626),\n (99.163097, 92.403626, 96.42783, 92.403626),\n (96.42783, 92.403626, 93.692563, 92.403626),\n (93.692563, 92.403626, 90.957296, 92.403626),\n (90.957296, 92.403626, 88.222029, 92.403626),\n (88.222029, 92.403626, 85.486762, 92.403626),\n (85.486762, 92.403626, 82.751495, 92.403626),\n (82.751495, 92.403626, 80.016228, 92.403626),\n (80.016228, 92.403626, 77.280961, 92.403626),\n (77.280961, 92.403626, 74.545694, 92.403626),\n (74.545694, 92.403626, 71.810427, 92.403626),\n (71.810427, 92.403626, 71.810427, 83.832173),\n (173.338974, 106.403627, 173.338974, 109.138894),\n (173.338974, 109.138894, 173.338974, 111.874161),\n (173.338974, 111.874161, 173.338974, 114.609428),\n (173.338974, 114.609428, 173.338974, 117.344695),\n (173.338974, 117.344695, 173.338974, 120.079962),\n (173.338974, 120.079962, 173.338974, 122.815229),\n (173.338974, 122.815229, 173.338974, 125.550496),\n (173.338974, 125.550496, 173.338974, 128.285763),\n (173.338974, 128.285763, 173.338974, 131.02103),\n (173.338974, 131.02103, 173.338974, 133.756297),\n (173.338974, 133.756297, 173.338974, 136.491565),\n (173.338974, 136.491565, 173.338974, 139.226832),\n (173.338974, 139.226832, 173.338974, 141.962099),\n (173.338974, 141.962099, 173.338974, 144.697366),\n (173.338974, 144.697366, 173.338974, 147.432633),\n (173.338974, 147.432633, 173.338974, 150.1679),\n (173.338974, 150.1679, 173.338974, 152.903167),\n (173.338974, 152.903167, 173.338974, 155.638434),\n (173.338974, 155.638434, 173.338974, 158.373701),\n (173.338974, 158.373701, 173.338974, 161.108968),\n (173.338974, 161.108968, 173.338974, 163.844235),\n (173.338974, 163.844235, 173.338974, 166.579503),\n (173.338974, 166.579503, 173.338974, 169.31477),\n (173.338974, 169.31477, 173.338974, 172.050037),\n (173.338974, 172.050037, 173.338974, 174.785304),\n (173.338974, 174.785304, 173.338974, 177.520571),\n (173.338974, 177.520571, 173.338974, 180.255838),\n (173.338974, 180.255838, 173.338974, 182.991105),\n (173.338974, 182.991105, 173.338974, 185.726372),\n (173.338974, 185.726372, 173.338974, 188.461639),\n (173.338974, 188.461639, 173.338974, 191.196906),\n (173.338974, 191.196906, 173.338974, 193.932173),\n (181.910427, 106.403627, 181.910427, 109.138894),\n (181.910427, 109.138894, 181.910427, 111.874161),\n (181.910427, 111.874161, 181.910427, 114.609428),\n (181.910427, 114.609428, 181.910427, 117.344695),\n (181.910427, 117.344695, 181.910427, 120.079962),\n (181.910427, 120.079962, 181.910427, 122.815229),\n (181.910427, 122.815229, 181.910427, 125.550496),\n (181.910427, 125.550496, 181.910427, 128.285763),\n (181.910427, 128.285763, 181.910427, 131.02103),\n (181.910427, 131.02103, 181.910427, 133.756297),\n (181.910427, 133.756297, 181.910427, 136.491565),\n (181.910427, 136.491565, 181.910427, 139.226832),\n (181.910427, 139.226832, 181.910427, 141.962099),\n (181.910427, 141.962099, 181.910427, 144.697366),\n (181.910427, 144.697366, 181.910427, 147.432633),\n (181.910427, 147.432633, 181.910427, 150.1679),\n (181.910427, 150.1679, 181.910427, 152.903167),\n (181.910427, 152.903167, 181.910427, 155.638434),\n (181.910427, 155.638434, 181.910427, 158.373701),\n (181.910427, 158.373701, 181.910427, 161.108968),\n (181.910427, 161.108968, 181.910427, 163.844235),\n (181.910427, 163.844235, 181.910427, 166.579503),\n (181.910427, 166.579503, 181.910427, 169.31477),\n (181.910427, 169.31477, 181.910427, 172.050037),\n (181.910427, 172.050037, 181.910427, 174.785304),\n (181.910427, 174.785304, 181.910427, 177.520571),\n (181.910427, 177.520571, 181.910427, 180.255838),\n (181.910427, 180.255838, 181.910427, 182.991105),\n (181.910427, 182.991105, 181.910427, 185.726372),\n (181.910427, 185.726372, 181.910427, 188.461639),\n (181.910427, 188.461639, 181.910427, 191.196906),\n (181.910427, 191.196906, 181.910427, 193.932173),\n (181.910427, 106.403627, 173.338974, 106.403627),\n (181.910427, 193.932173, 173.338974, 193.932173)\n]\nVISIBLE_CIRCLES = [\n (115.5747, 150.1679, 43.764273),\n (115.5747, 150.1679, 22.793892)\n]\nVISIBLE_ARCS = [\n\n]\nHIDDEN_SEGMENTS = [\n (138.3686, 92.4036, 138.3686, 83.8321),\n (92.7808, 83.8321, 92.7808, 92.4036),\n (181.9105, 172.9618, 173.339, 172.9618),\n (181.9105, 127.374, 173.339, 127.374)\n]\n# (orient, text, p1, p2, base) for linear; (orient, text, center, radius, angle) for diameter\nDIMENSIONS = [\n ('diameter', '%%c100', (115.5747, 150.1679), 43.7643, 45),\n ('diameter', '%%c52.0833', (115.5747, 150.1679), 22.7939, 135),\n ('horizontal', '9.7928', (173.339, 150.1679), (181.9105, 150.1679), (177.6248, 161.1679))\n]\n\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\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\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,\n angle=(0 if d[0] == \"horizontal\" else 90),\n 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,\n text=text, dimstyle=\"EZDXF\").render()\n\n doc.saveas(out_path)\n\n\nif __name__ == \"__main__\":\n out = sys.argv[1] if len(sys.argv) > 1 else \"0086_00865393_gt.dxf\"\n draw(out)\n print(\"wrote\", out)\n```"}], "images": ["images/0086_00865393.png"], "id": "0086_00865393"} {"messages": [{"role": "user", "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 39.58 mm. It is extruded to a thickness of 500 mm."}, {"role": "assistant", "content": "```python\n#!/usr/bin/env python3\n# -*- coding: utf-8 -*-\n# Ground-truth 2D engineering drawing for part: 0087_00871151\n# Self-contained: reproduces the three-view DXF via ezdxf, NO FreeCAD needed.\n# Coordinates are A4 page millimetres (scale=0.16016666666666668, page=[297.0, 210.0]).\n# visible edges -> solid (layer OUTLINE); hidden edges -> dashed (layer HIDDEN)\n# dimensions -> real movable DIMENSION entities (text = true mm value)\n# Run: python 0087_00871151_gt.py [out.dxf]\nimport sys\nimport ezdxf\n\nSCALE = 0.16016666666666668\nPAGE = [297.0, 210.0]\n\nVISIBLE_SEGMENTS = [\n (101.672133, 65.954133, 101.171612, 65.954133),\n (101.171612, 65.954133, 100.671092, 65.954133),\n (100.671092, 65.954133, 100.170571, 65.954133),\n (100.170571, 65.954133, 99.67005, 65.954133),\n (99.67005, 65.954133, 99.169529, 65.954133),\n (99.169529, 65.954133, 98.669008, 65.954133),\n (98.669008, 65.954133, 98.168487, 65.954133),\n (98.168487, 65.954133, 97.667967, 65.954133),\n (97.667967, 65.954133, 97.167446, 65.954133),\n (97.167446, 65.954133, 96.666925, 65.954133),\n (96.666925, 65.954133, 96.166404, 65.954133),\n (96.166404, 65.954133, 95.665883, 65.954133),\n (95.665883, 65.954133, 95.165362, 65.954133),\n (95.165362, 65.954133, 94.664842, 65.954133),\n (94.664842, 65.954133, 94.164321, 65.954133),\n (94.164321, 65.954133, 93.6638, 65.954133),\n (93.6638, 65.954133, 93.163279, 65.954133),\n (93.163279, 65.954133, 92.662758, 65.954133),\n (92.662758, 65.954133, 92.162237, 65.954133),\n (92.162237, 65.954133, 91.661717, 65.954133),\n (91.661717, 65.954133, 91.161196, 65.954133),\n (91.161196, 65.954133, 90.660675, 65.954133),\n (90.660675, 65.954133, 90.160154, 65.954133),\n (90.160154, 65.954133, 89.659633, 65.954133),\n (89.659633, 65.954133, 89.159112, 65.954133),\n (89.159112, 65.954133, 88.658592, 65.954133),\n (88.658592, 65.954133, 88.158071, 65.954133),\n (88.158071, 65.954133, 87.65755, 65.954133),\n (87.65755, 65.954133, 87.157029, 65.954133),\n (87.157029, 65.954133, 86.656508, 65.954133),\n (86.656508, 65.954133, 86.155987, 65.954133),\n (86.155987, 65.954133, 85.655467, 65.954133),\n (101.672133, 65.954133, 101.672133, 146.037466),\n (101.672133, 146.037466, 101.171612, 146.037466),\n (101.171612, 146.037466, 100.671092, 146.037466),\n (100.671092, 146.037466, 100.170571, 146.037466),\n (100.170571, 146.037466, 99.67005, 146.037466),\n (99.67005, 146.037466, 99.169529, 146.037466),\n (99.169529, 146.037466, 98.669008, 146.037466),\n (98.669008, 146.037466, 98.168487, 146.037466),\n (98.168487, 146.037466, 97.667967, 146.037466),\n (97.667967, 146.037466, 97.167446, 146.037466),\n (97.167446, 146.037466, 96.666925, 146.037466),\n (96.666925, 146.037466, 96.166404, 146.037466),\n (96.166404, 146.037466, 95.665883, 146.037466),\n (95.665883, 146.037466, 95.165362, 146.037466),\n (95.165362, 146.037466, 94.664842, 146.037466),\n (94.664842, 146.037466, 94.164321, 146.037466),\n (94.164321, 146.037466, 93.6638, 146.037466),\n (93.6638, 146.037466, 93.163279, 146.037466),\n (93.163279, 146.037466, 92.662758, 146.037466),\n (92.662758, 146.037466, 92.162237, 146.037466),\n (92.162237, 146.037466, 91.661717, 146.037466),\n (91.661717, 146.037466, 91.161196, 146.037466),\n (91.161196, 146.037466, 90.660675, 146.037466),\n (90.660675, 146.037466, 90.160154, 146.037466),\n (90.160154, 146.037466, 89.659633, 146.037466),\n (89.659633, 146.037466, 89.159112, 146.037466),\n (89.159112, 146.037466, 88.658592, 146.037466),\n (88.658592, 146.037466, 88.158071, 146.037466),\n (88.158071, 146.037466, 87.65755, 146.037466),\n (87.65755, 146.037466, 87.157029, 146.037466),\n (87.157029, 146.037466, 86.656508, 146.037466),\n (86.656508, 146.037466, 86.155987, 146.037466),\n (86.155987, 146.037466, 85.655467, 146.037466),\n (85.655467, 146.037466, 85.655467, 65.954133),\n (115.672134, 160.037467, 115.672134, 160.537988),\n (115.672134, 160.537988, 115.672134, 161.038508),\n (115.672134, 161.038508, 115.672134, 161.539029),\n (115.672134, 161.539029, 115.672134, 162.03955),\n (115.672134, 162.03955, 115.672134, 162.540071),\n (115.672134, 162.540071, 115.672134, 163.040592),\n (115.672134, 163.040592, 115.672134, 163.541113),\n (115.672134, 163.541113, 115.672134, 164.041633),\n (115.672134, 164.041633, 115.672134, 164.542154),\n (115.672134, 164.542154, 115.672134, 165.042675),\n (115.672134, 165.042675, 115.672134, 165.543196),\n (115.672134, 165.543196, 115.672134, 166.043717),\n (115.672134, 166.043717, 115.672134, 166.544238),\n (115.672134, 166.544238, 115.672134, 167.044758),\n (115.672134, 167.044758, 115.672134, 167.545279),\n (115.672134, 167.545279, 115.672134, 168.0458),\n (115.672134, 168.0458, 115.672134, 168.546321),\n (115.672134, 168.546321, 115.672134, 169.046842),\n (115.672134, 169.046842, 115.672134, 169.547363),\n (115.672134, 169.547363, 115.672134, 170.047883),\n (115.672134, 170.047883, 115.672134, 170.548404),\n (115.672134, 170.548404, 115.672134, 171.048925),\n (115.672134, 171.048925, 115.672134, 171.549446),\n (115.672134, 171.549446, 115.672134, 172.049967),\n (115.672134, 172.049967, 115.672134, 172.550488),\n (115.672134, 172.550488, 115.672134, 173.051008),\n (115.672134, 173.051008, 115.672134, 173.551529),\n (115.672134, 173.551529, 115.672134, 174.05205),\n (115.672134, 174.05205, 115.672134, 174.552571),\n (115.672134, 174.552571, 115.672134, 175.053092),\n (115.672134, 175.053092, 115.672134, 175.553613),\n (115.672134, 175.553613, 115.672134, 176.054133),\n (195.755467, 160.037467, 195.755467, 160.537988),\n (195.755467, 160.537988, 195.755467, 161.038508),\n (195.755467, 161.038508, 195.755467, 161.539029),\n (195.755467, 161.539029, 195.755467, 162.03955),\n (195.755467, 162.03955, 195.755467, 162.540071),\n (195.755467, 162.540071, 195.755467, 163.040592),\n (195.755467, 163.040592, 195.755467, 163.541113),\n (195.755467, 163.541113, 195.755467, 164.041633),\n (195.755467, 164.041633, 195.755467, 164.542154),\n (195.755467, 164.542154, 195.755467, 165.042675),\n (195.755467, 165.042675, 195.755467, 165.543196),\n (195.755467, 165.543196, 195.755467, 166.043717),\n (195.755467, 166.043717, 195.755467, 166.544238),\n (195.755467, 166.544238, 195.755467, 167.044758),\n (195.755467, 167.044758, 195.755467, 167.545279),\n (195.755467, 167.545279, 195.755467, 168.0458),\n (195.755467, 168.0458, 195.755467, 168.546321),\n (195.755467, 168.546321, 195.755467, 169.046842),\n (195.755467, 169.046842, 195.755467, 169.547363),\n (195.755467, 169.547363, 195.755467, 170.047883),\n (195.755467, 170.047883, 195.755467, 170.548404),\n (195.755467, 170.548404, 195.755467, 171.048925),\n (195.755467, 171.048925, 195.755467, 171.549446),\n (195.755467, 171.549446, 195.755467, 172.049967),\n (195.755467, 172.049967, 195.755467, 172.550488),\n (195.755467, 172.550488, 195.755467, 173.051008),\n (195.755467, 173.051008, 195.755467, 173.551529),\n (195.755467, 173.551529, 195.755467, 174.05205),\n (195.755467, 174.05205, 195.755467, 174.552571),\n (195.755467, 174.552571, 195.755467, 175.053092),\n (195.755467, 175.053092, 195.755467, 175.553613),\n (195.755467, 175.553613, 195.755467, 176.054133),\n (195.755467, 160.037467, 115.672134, 160.037467),\n (195.755467, 176.054133, 115.672134, 176.054133)\n]\nVISIBLE_CIRCLES = [\n (93.6638, 168.0458, 8.008333),\n (93.6638, 168.0458, 3.169965)\n]\nVISIBLE_ARCS = [\n\n]\nHIDDEN_SEGMENTS = [\n (96.8337, 146.0375, 96.8337, 65.9542),\n (90.4938, 65.9542, 90.4938, 146.0375),\n (195.7554, 171.2158, 115.6721, 171.2158),\n (195.7554, 164.8759, 115.6721, 164.8759)\n]\n# (orient, text, p1, p2, base) for linear; (orient, text, center, radius, angle) for diameter\nDIMENSIONS = [\n ('diameter', '%%c100', (93.6638, 168.0458), 8.0083, 45),\n ('diameter', '%%c39.5833', (93.6638, 168.0458), 3.17, 135),\n ('horizontal', '500', (115.6721, 168.0458), (195.7554, 168.0458), (155.7138, 179.0458))\n]\n\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\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\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,\n angle=(0 if d[0] == \"horizontal\" else 90),\n 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,\n text=text, dimstyle=\"EZDXF\").render()\n\n doc.saveas(out_path)\n\n\nif __name__ == \"__main__\":\n out = sys.argv[1] if len(sys.argv) > 1 else \"0087_00871151_gt.dxf\"\n draw(out)\n print(\"wrote\", out)\n```"}], "images": ["images/0087_00871151.png"], "id": "0087_00871151"} {"messages": [{"role": "user", "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 91.67 mm. It is extruded to a thickness of 316.67 mm."}, {"role": "assistant", "content": "```python\n#!/usr/bin/env python3\n# -*- coding: utf-8 -*-\n# Ground-truth 2D engineering drawing for part: 0087_00873288\n# Self-contained: reproduces the three-view DXF via ezdxf, NO FreeCAD needed.\n# Coordinates are A4 page millimetres (scale=0.2306400000000369, page=[297.0, 210.0]).\n# visible edges -> solid (layer OUTLINE); hidden edges -> dashed (layer HIDDEN)\n# dimensions -> real movable DIMENSION entities (text = true mm value)\n# Run: python 0087_00873288_gt.py [out.dxf]\nimport sys\nimport ezdxf\n\nSCALE = 0.2306400000000369\nPAGE = [297.0, 210.0]\n\nVISIBLE_SEGMENTS = [\n (82.9242, 140.752, 83.64495, 140.752),\n (83.64495, 140.752, 84.3657, 140.752),\n (84.3657, 140.752, 85.08645, 140.752),\n (85.08645, 140.752, 85.8072, 140.752),\n (85.8072, 140.752, 86.52795, 140.752),\n (86.52795, 140.752, 87.2487, 140.752),\n (87.2487, 140.752, 87.96945, 140.752),\n (87.96945, 140.752, 88.6902, 140.752),\n (88.6902, 140.752, 89.41095, 140.752),\n (89.41095, 140.752, 90.1317, 140.752),\n (90.1317, 140.752, 90.85245, 140.752),\n (90.85245, 140.752, 91.5732, 140.752),\n (91.5732, 140.752, 92.29395, 140.752),\n (92.29395, 140.752, 93.0147, 140.752),\n (93.0147, 140.752, 93.73545, 140.752),\n (93.73545, 140.752, 94.4562, 140.752),\n (94.4562, 140.752, 95.17695, 140.752),\n (95.17695, 140.752, 95.8977, 140.752),\n (95.8977, 140.752, 96.61845, 140.752),\n (96.61845, 140.752, 97.3392, 140.752),\n (97.3392, 140.752, 98.05995, 140.752),\n (98.05995, 140.752, 98.7807, 140.752),\n (98.7807, 140.752, 99.50145, 140.752),\n (99.50145, 140.752, 100.2222, 140.752),\n (100.2222, 140.752, 100.94295, 140.752),\n (100.94295, 140.752, 101.6637, 140.752),\n (101.6637, 140.752, 102.38445, 140.752),\n (102.38445, 140.752, 103.1052, 140.752),\n (103.1052, 140.752, 103.82595, 140.752),\n (103.82595, 140.752, 104.5467, 140.752),\n (104.5467, 140.752, 105.26745, 140.752),\n (105.26745, 140.752, 105.9882, 140.752),\n (105.9882, 140.752, 105.9882, 67.716),\n (82.9242, 67.716, 83.64495, 67.716),\n (83.64495, 67.716, 84.3657, 67.716),\n (84.3657, 67.716, 85.08645, 67.716),\n (85.08645, 67.716, 85.8072, 67.716),\n (85.8072, 67.716, 86.52795, 67.716),\n (86.52795, 67.716, 87.2487, 67.716),\n (87.2487, 67.716, 87.96945, 67.716),\n (87.96945, 67.716, 88.6902, 67.716),\n (88.6902, 67.716, 89.41095, 67.716),\n (89.41095, 67.716, 90.1317, 67.716),\n (90.1317, 67.716, 90.85245, 67.716),\n (90.85245, 67.716, 91.5732, 67.716),\n (91.5732, 67.716, 92.29395, 67.716),\n (92.29395, 67.716, 93.0147, 67.716),\n (93.0147, 67.716, 93.73545, 67.716),\n (93.73545, 67.716, 94.4562, 67.716),\n (94.4562, 67.716, 95.17695, 67.716),\n (95.17695, 67.716, 95.8977, 67.716),\n (95.8977, 67.716, 96.61845, 67.716),\n (96.61845, 67.716, 97.3392, 67.716),\n (97.3392, 67.716, 98.05995, 67.716),\n (98.05995, 67.716, 98.7807, 67.716),\n (98.7807, 67.716, 99.50145, 67.716),\n (99.50145, 67.716, 100.2222, 67.716),\n (100.2222, 67.716, 100.94295, 67.716),\n (100.94295, 67.716, 101.6637, 67.716),\n (101.6637, 67.716, 102.38445, 67.716),\n (102.38445, 67.716, 103.1052, 67.716),\n (103.1052, 67.716, 103.82595, 67.716),\n (103.82595, 67.716, 104.5467, 67.716),\n (104.5467, 67.716, 105.26745, 67.716),\n (105.26745, 67.716, 105.9882, 67.716),\n (82.9242, 67.716, 82.9242, 140.752),\n (193.0242, 177.816, 193.0242, 177.09525),\n (193.0242, 177.09525, 193.0242, 176.3745),\n (193.0242, 176.3745, 193.0242, 175.65375),\n (193.0242, 175.65375, 193.0242, 174.933),\n (193.0242, 174.933, 193.0242, 174.21225),\n (193.0242, 174.21225, 193.0242, 173.4915),\n (193.0242, 173.4915, 193.0242, 172.77075),\n (193.0242, 172.77075, 193.0242, 172.05),\n (193.0242, 172.05, 193.0242, 171.32925),\n (193.0242, 171.32925, 193.0242, 170.6085),\n (193.0242, 170.6085, 193.0242, 169.88775),\n (193.0242, 169.88775, 193.0242, 169.167),\n (193.0242, 169.167, 193.0242, 168.44625),\n (193.0242, 168.44625, 193.0242, 167.7255),\n (193.0242, 167.7255, 193.0242, 167.00475),\n (193.0242, 167.00475, 193.0242, 166.284),\n (193.0242, 166.284, 193.0242, 165.56325),\n (193.0242, 165.56325, 193.0242, 164.8425),\n (193.0242, 164.8425, 193.0242, 164.12175),\n (193.0242, 164.12175, 193.0242, 163.401),\n (193.0242, 163.401, 193.0242, 162.68025),\n (193.0242, 162.68025, 193.0242, 161.9595),\n (193.0242, 161.9595, 193.0242, 161.23875),\n (193.0242, 161.23875, 193.0242, 160.518),\n (193.0242, 160.518, 193.0242, 159.79725),\n (193.0242, 159.79725, 193.0242, 159.0765),\n (193.0242, 159.0765, 193.0242, 158.35575),\n (193.0242, 158.35575, 193.0242, 157.635),\n (193.0242, 157.635, 193.0242, 156.91425),\n (193.0242, 156.91425, 193.0242, 156.1935),\n (193.0242, 156.1935, 193.0242, 155.47275),\n (193.0242, 155.47275, 193.0242, 154.752),\n (119.9882, 177.816, 119.9882, 177.09525),\n (119.9882, 177.09525, 119.9882, 176.3745),\n (119.9882, 176.3745, 119.9882, 175.65375),\n (119.9882, 175.65375, 119.9882, 174.933),\n (119.9882, 174.933, 119.9882, 174.21225),\n (119.9882, 174.21225, 119.9882, 173.4915),\n (119.9882, 173.4915, 119.9882, 172.77075),\n (119.9882, 172.77075, 119.9882, 172.05),\n (119.9882, 172.05, 119.9882, 171.32925),\n (119.9882, 171.32925, 119.9882, 170.6085),\n (119.9882, 170.6085, 119.9882, 169.88775),\n (119.9882, 169.88775, 119.9882, 169.167),\n (119.9882, 169.167, 119.9882, 168.44625),\n (119.9882, 168.44625, 119.9882, 167.7255),\n (119.9882, 167.7255, 119.9882, 167.00475),\n (119.9882, 167.00475, 119.9882, 166.284),\n (119.9882, 166.284, 119.9882, 165.56325),\n (119.9882, 165.56325, 119.9882, 164.8425),\n (119.9882, 164.8425, 119.9882, 164.12175),\n (119.9882, 164.12175, 119.9882, 163.401),\n (119.9882, 163.401, 119.9882, 162.68025),\n (119.9882, 162.68025, 119.9882, 161.9595),\n (119.9882, 161.9595, 119.9882, 161.23875),\n (119.9882, 161.23875, 119.9882, 160.518),\n (119.9882, 160.518, 119.9882, 159.79725),\n (119.9882, 159.79725, 119.9882, 159.0765),\n (119.9882, 159.0765, 119.9882, 158.35575),\n (119.9882, 158.35575, 119.9882, 157.635),\n (119.9882, 157.635, 119.9882, 156.91425),\n (119.9882, 156.91425, 119.9882, 156.1935),\n (119.9882, 156.1935, 119.9882, 155.47275),\n (119.9882, 155.47275, 119.9882, 154.752),\n (119.9882, 177.816, 193.0242, 177.816),\n (119.9882, 154.752, 193.0242, 154.752)\n]\nVISIBLE_CIRCLES = [\n (94.4562, 166.284, 11.532),\n (94.4562, 166.284, 10.571)\n]\nVISIBLE_ARCS = [\n\n]\nHIDDEN_SEGMENTS = [\n (105.0272, 67.716, 105.0272, 140.752),\n (83.8852, 140.752, 83.8852, 67.716),\n (119.9883, 155.713, 193.0243, 155.713),\n (119.9883, 176.855, 193.0243, 176.855)\n]\n# (orient, text, p1, p2, base) for linear; (orient, text, center, radius, angle) for diameter\nDIMENSIONS = [\n ('diameter', '%%c100', (94.4562, 166.284), 11.532, 45),\n ('diameter', '%%c91.6667', (94.4562, 166.284), 10.571, 135),\n ('horizontal', '316.667', (193.0243, 166.284), (119.9882, 166.284), (156.5062, 155.284))\n]\n\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\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\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,\n angle=(0 if d[0] == \"horizontal\" else 90),\n 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,\n text=text, dimstyle=\"EZDXF\").render()\n\n doc.saveas(out_path)\n\n\nif __name__ == \"__main__\":\n out = sys.argv[1] if len(sys.argv) > 1 else \"0087_00873288_gt.dxf\"\n draw(out)\n print(\"wrote\", out)\n```"}], "images": ["images/0087_00873288.png"], "id": "0087_00873288"} {"messages": [{"role": "user", "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 37.5 mm. It is extruded to a thickness of 75.21 mm."}, {"role": "assistant", "content": "```python\n#!/usr/bin/env python3\n# -*- coding: utf-8 -*-\n# Ground-truth 2D engineering drawing for part: 0087_00874020\n# Self-contained: reproduces the three-view DXF via ezdxf, NO FreeCAD needed.\n# Coordinates are A4 page millimetres (scale=0.5484898929845433, page=[297.0, 210.0]).\n# visible edges -> solid (layer OUTLINE); hidden edges -> dashed (layer HIDDEN)\n# dimensions -> real movable DIMENSION entities (text = true mm value)\n# Run: python 0087_00874020_gt.py [out.dxf]\nimport sys\nimport ezdxf\n\nSCALE = 0.5484898929845433\nPAGE = [297.0, 210.0]\n\nVISIBLE_SEGMENTS = [\n (133.871795, 75.662294, 132.157764, 75.662294),\n (132.157764, 75.662294, 130.443733, 75.662294),\n (130.443733, 75.662294, 128.729702, 75.662294),\n (128.729702, 75.662294, 127.015671, 75.662294),\n (127.015671, 75.662294, 125.30164, 75.662294),\n (125.30164, 75.662294, 123.587609, 75.662294),\n (123.587609, 75.662294, 121.873578, 75.662294),\n (121.873578, 75.662294, 120.159547, 75.662294),\n (120.159547, 75.662294, 118.445516, 75.662294),\n (118.445516, 75.662294, 116.731485, 75.662294),\n (116.731485, 75.662294, 115.017455, 75.662294),\n (115.017455, 75.662294, 113.303424, 75.662294),\n (113.303424, 75.662294, 111.589393, 75.662294),\n (111.589393, 75.662294, 109.875362, 75.662294),\n (109.875362, 75.662294, 108.161331, 75.662294),\n (108.161331, 75.662294, 106.4473, 75.662294),\n (106.4473, 75.662294, 104.733269, 75.662294),\n (104.733269, 75.662294, 103.019238, 75.662294),\n (103.019238, 75.662294, 101.305207, 75.662294),\n (101.305207, 75.662294, 99.591176, 75.662294),\n (99.591176, 75.662294, 97.877145, 75.662294),\n (97.877145, 75.662294, 96.163115, 75.662294),\n (96.163115, 75.662294, 94.449084, 75.662294),\n (94.449084, 75.662294, 92.735053, 75.662294),\n (92.735053, 75.662294, 91.021022, 75.662294),\n (91.021022, 75.662294, 89.306991, 75.662294),\n (89.306991, 75.662294, 87.59296, 75.662294),\n (87.59296, 75.662294, 85.878929, 75.662294),\n (85.878929, 75.662294, 84.164898, 75.662294),\n (84.164898, 75.662294, 82.450867, 75.662294),\n (82.450867, 75.662294, 80.736836, 75.662294),\n (80.736836, 75.662294, 79.022805, 75.662294),\n (133.871795, 75.662294, 133.871795, 116.913305),\n (133.871795, 116.913305, 132.157764, 116.913305),\n (132.157764, 116.913305, 130.443733, 116.913305),\n (130.443733, 116.913305, 128.729702, 116.913305),\n (128.729702, 116.913305, 127.015671, 116.913305),\n (127.015671, 116.913305, 125.30164, 116.913305),\n (125.30164, 116.913305, 123.587609, 116.913305),\n (123.587609, 116.913305, 121.873578, 116.913305),\n (121.873578, 116.913305, 120.159547, 116.913305),\n (120.159547, 116.913305, 118.445516, 116.913305),\n (118.445516, 116.913305, 116.731485, 116.913305),\n (116.731485, 116.913305, 115.017455, 116.913305),\n (115.017455, 116.913305, 113.303424, 116.913305),\n (113.303424, 116.913305, 111.589393, 116.913305),\n (111.589393, 116.913305, 109.875362, 116.913305),\n (109.875362, 116.913305, 108.161331, 116.913305),\n (108.161331, 116.913305, 106.4473, 116.913305),\n (106.4473, 116.913305, 104.733269, 116.913305),\n (104.733269, 116.913305, 103.019238, 116.913305),\n (103.019238, 116.913305, 101.305207, 116.913305),\n (101.305207, 116.913305, 99.591176, 116.913305),\n (99.591176, 116.913305, 97.877145, 116.913305),\n (97.877145, 116.913305, 96.163115, 116.913305),\n (96.163115, 116.913305, 94.449084, 116.913305),\n (94.449084, 116.913305, 92.735053, 116.913305),\n (92.735053, 116.913305, 91.021022, 116.913305),\n (91.021022, 116.913305, 89.306991, 116.913305),\n (89.306991, 116.913305, 87.59296, 116.913305),\n (87.59296, 116.913305, 85.878929, 116.913305),\n (85.878929, 116.913305, 84.164898, 116.913305),\n (84.164898, 116.913305, 82.450867, 116.913305),\n (82.450867, 116.913305, 80.736836, 116.913305),\n (80.736836, 116.913305, 79.022805, 116.913305),\n (79.022805, 116.913305, 79.022805, 75.662294),\n (147.871795, 130.913305, 147.871795, 132.627336),\n (147.871795, 132.627336, 147.871795, 134.341367),\n (147.871795, 134.341367, 147.871795, 136.055398),\n (147.871795, 136.055398, 147.871795, 137.769429),\n (147.871795, 137.769429, 147.871795, 139.48346),\n (147.871795, 139.48346, 147.871795, 141.197491),\n (147.871795, 141.197491, 147.871795, 142.911522),\n (147.871795, 142.911522, 147.871795, 144.625553),\n (147.871795, 144.625553, 147.871795, 146.339584),\n (147.871795, 146.339584, 147.871795, 148.053615),\n (147.871795, 148.053615, 147.871795, 149.767645),\n (147.871795, 149.767645, 147.871795, 151.481676),\n (147.871795, 151.481676, 147.871795, 153.195707),\n (147.871795, 153.195707, 147.871795, 154.909738),\n (147.871795, 154.909738, 147.871795, 156.623769),\n (147.871795, 156.623769, 147.871795, 158.3378),\n (147.871795, 158.3378, 147.871795, 160.051831),\n (147.871795, 160.051831, 147.871795, 161.765862),\n (147.871795, 161.765862, 147.871795, 163.479893),\n (147.871795, 163.479893, 147.871795, 165.193924),\n (147.871795, 165.193924, 147.871795, 166.907955),\n (147.871795, 166.907955, 147.871795, 168.621985),\n (147.871795, 168.621985, 147.871795, 170.336016),\n (147.871795, 170.336016, 147.871795, 172.050047),\n (147.871795, 172.050047, 147.871795, 173.764078),\n (147.871795, 173.764078, 147.871795, 175.478109),\n (147.871795, 175.478109, 147.871795, 177.19214),\n (147.871795, 177.19214, 147.871795, 178.906171),\n (147.871795, 178.906171, 147.871795, 180.620202),\n (147.871795, 180.620202, 147.871795, 182.334233),\n (147.871795, 182.334233, 147.871795, 184.048264),\n (147.871795, 184.048264, 147.871795, 185.762295),\n (189.122806, 130.913305, 189.122806, 132.627336),\n (189.122806, 132.627336, 189.122806, 134.341367),\n (189.122806, 134.341367, 189.122806, 136.055398),\n (189.122806, 136.055398, 189.122806, 137.769429),\n (189.122806, 137.769429, 189.122806, 139.48346),\n (189.122806, 139.48346, 189.122806, 141.197491),\n (189.122806, 141.197491, 189.122806, 142.911522),\n (189.122806, 142.911522, 189.122806, 144.625553),\n (189.122806, 144.625553, 189.122806, 146.339584),\n (189.122806, 146.339584, 189.122806, 148.053615),\n (189.122806, 148.053615, 189.122806, 149.767645),\n (189.122806, 149.767645, 189.122806, 151.481676),\n (189.122806, 151.481676, 189.122806, 153.195707),\n (189.122806, 153.195707, 189.122806, 154.909738),\n (189.122806, 154.909738, 189.122806, 156.623769),\n (189.122806, 156.623769, 189.122806, 158.3378),\n (189.122806, 158.3378, 189.122806, 160.051831),\n (189.122806, 160.051831, 189.122806, 161.765862),\n (189.122806, 161.765862, 189.122806, 163.479893),\n (189.122806, 163.479893, 189.122806, 165.193924),\n (189.122806, 165.193924, 189.122806, 166.907955),\n (189.122806, 166.907955, 189.122806, 168.621985),\n (189.122806, 168.621985, 189.122806, 170.336016),\n (189.122806, 170.336016, 189.122806, 172.050047),\n (189.122806, 172.050047, 189.122806, 173.764078),\n (189.122806, 173.764078, 189.122806, 175.478109),\n (189.122806, 175.478109, 189.122806, 177.19214),\n (189.122806, 177.19214, 189.122806, 178.906171),\n (189.122806, 178.906171, 189.122806, 180.620202),\n (189.122806, 180.620202, 189.122806, 182.334233),\n (189.122806, 182.334233, 189.122806, 184.048264),\n (189.122806, 184.048264, 189.122806, 185.762295),\n (189.122806, 130.913305, 147.871795, 130.913305),\n (189.122806, 185.762295, 147.871795, 185.762295)\n]\nVISIBLE_CIRCLES = [\n (106.4473, 158.3378, 27.424495),\n (106.4473, 158.3378, 10.284185)\n]\nVISIBLE_ARCS = [\n\n]\nHIDDEN_SEGMENTS = [\n (116.7315, 116.9133, 116.7315, 75.6622),\n (96.1631, 75.6622, 96.1631, 116.9133),\n (189.1228, 168.6219, 147.8718, 168.6219),\n (189.1228, 148.0536, 147.8718, 148.0536)\n]\n# (orient, text, p1, p2, base) for linear; (orient, text, center, radius, angle) for diameter\nDIMENSIONS = [\n ('diameter', '%%c100', (106.4473, 158.3378), 27.4245, 45),\n ('diameter', '%%c37.5', (106.4473, 158.3378), 10.2842, 135),\n ('horizontal', '75.2083', (147.8718, 158.3378), (189.1228, 158.3378), (168.4973, 169.3378))\n]\n\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\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\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,\n angle=(0 if d[0] == \"horizontal\" else 90),\n 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,\n text=text, dimstyle=\"EZDXF\").render()\n\n doc.saveas(out_path)\n\n\nif __name__ == \"__main__\":\n out = sys.argv[1] if len(sys.argv) > 1 else \"0087_00874020_gt.dxf\"\n draw(out)\n print(\"wrote\", out)\n```"}], "images": ["images/0087_00874020.png"], "id": "0087_00874020"} {"messages": [{"role": "user", "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 63.83 mm. It is extruded to a thickness of 4.74 mm."}, {"role": "assistant", "content": "```python\n#!/usr/bin/env python3\n# -*- coding: utf-8 -*-\n# Ground-truth 2D engineering drawing for part: 0088_00881212\n# Self-contained: reproduces the three-view DXF via ezdxf, NO FreeCAD needed.\n# Coordinates are A4 page millimetres (scale=0.917533089985713, page=[297.0, 210.0]).\n# visible edges -> solid (layer OUTLINE); hidden edges -> dashed (layer HIDDEN)\n# dimensions -> real movable DIMENSION entities (text = true mm value)\n# Run: python 0088_00881212_gt.py [out.dxf]\nimport sys\nimport ezdxf\n\nSCALE = 0.917533089985713\nPAGE = [297.0, 210.0]\n\nVISIBLE_SEGMENTS = [\n (161.413354, 84.888354, 158.546064, 84.888354),\n (158.546064, 84.888354, 155.678773, 84.888354),\n (155.678773, 84.888354, 152.811482, 84.888354),\n (152.811482, 84.888354, 149.944191, 84.888354),\n (149.944191, 84.888354, 147.0769, 84.888354),\n (147.0769, 84.888354, 144.209609, 84.888354),\n (144.209609, 84.888354, 141.342318, 84.888354),\n (141.342318, 84.888354, 138.475027, 84.888354),\n (138.475027, 84.888354, 135.607736, 84.888354),\n (135.607736, 84.888354, 132.740445, 84.888354),\n (132.740445, 84.888354, 129.873155, 84.888354),\n (129.873155, 84.888354, 127.005864, 84.888354),\n (127.005864, 84.888354, 124.138573, 84.888354),\n (124.138573, 84.888354, 121.271282, 84.888354),\n (121.271282, 84.888354, 118.403991, 84.888354),\n (118.403991, 84.888354, 115.5367, 84.888354),\n (115.5367, 84.888354, 112.669409, 84.888354),\n (112.669409, 84.888354, 109.802118, 84.888354),\n (109.802118, 84.888354, 106.934827, 84.888354),\n (106.934827, 84.888354, 104.067536, 84.888354),\n (104.067536, 84.888354, 101.200245, 84.888354),\n (101.200245, 84.888354, 98.332955, 84.888354),\n (98.332955, 84.888354, 95.465664, 84.888354),\n (95.465664, 84.888354, 92.598373, 84.888354),\n (92.598373, 84.888354, 89.731082, 84.888354),\n (89.731082, 84.888354, 86.863791, 84.888354),\n (86.863791, 84.888354, 83.9965, 84.888354),\n (83.9965, 84.888354, 81.129209, 84.888354),\n (81.129209, 84.888354, 78.261918, 84.888354),\n (78.261918, 84.888354, 75.394627, 84.888354),\n (75.394627, 84.888354, 72.527336, 84.888354),\n (72.527336, 84.888354, 69.660046, 84.888354),\n (161.413354, 84.888354, 161.413354, 89.235045),\n (161.413354, 89.235045, 158.546064, 89.235045),\n (158.546064, 89.235045, 155.678773, 89.235045),\n (155.678773, 89.235045, 152.811482, 89.235045),\n (152.811482, 89.235045, 149.944191, 89.235045),\n (149.944191, 89.235045, 147.0769, 89.235045),\n (147.0769, 89.235045, 144.209609, 89.235045),\n (144.209609, 89.235045, 141.342318, 89.235045),\n (141.342318, 89.235045, 138.475027, 89.235045),\n (138.475027, 89.235045, 135.607736, 89.235045),\n (135.607736, 89.235045, 132.740445, 89.235045),\n (132.740445, 89.235045, 129.873155, 89.235045),\n (129.873155, 89.235045, 127.005864, 89.235045),\n (127.005864, 89.235045, 124.138573, 89.235045),\n (124.138573, 89.235045, 121.271282, 89.235045),\n (121.271282, 89.235045, 118.403991, 89.235045),\n (118.403991, 89.235045, 115.5367, 89.235045),\n (115.5367, 89.235045, 112.669409, 89.235045),\n (112.669409, 89.235045, 109.802118, 89.235045),\n (109.802118, 89.235045, 106.934827, 89.235045),\n (106.934827, 89.235045, 104.067536, 89.235045),\n (104.067536, 89.235045, 101.200245, 89.235045),\n (101.200245, 89.235045, 98.332955, 89.235045),\n (98.332955, 89.235045, 95.465664, 89.235045),\n (95.465664, 89.235045, 92.598373, 89.235045),\n (92.598373, 89.235045, 89.731082, 89.235045),\n (89.731082, 89.235045, 86.863791, 89.235045),\n (86.863791, 89.235045, 83.9965, 89.235045),\n (83.9965, 89.235045, 81.129209, 89.235045),\n (81.129209, 89.235045, 78.261918, 89.235045),\n (78.261918, 89.235045, 75.394627, 89.235045),\n (75.394627, 89.235045, 72.527336, 89.235045),\n (72.527336, 89.235045, 69.660046, 89.235045),\n (69.660046, 89.235045, 69.660046, 84.888354),\n (175.413355, 103.235046, 175.413355, 106.102336),\n (175.413355, 106.102336, 175.413355, 108.969627),\n (175.413355, 108.969627, 175.413355, 111.836918),\n (175.413355, 111.836918, 175.413355, 114.704209),\n (175.413355, 114.704209, 175.413355, 117.5715),\n (175.413355, 117.5715, 175.413355, 120.438791),\n (175.413355, 120.438791, 175.413355, 123.306082),\n (175.413355, 123.306082, 175.413355, 126.173373),\n (175.413355, 126.173373, 175.413355, 129.040664),\n (175.413355, 129.040664, 175.413355, 131.907955),\n (175.413355, 131.907955, 175.413355, 134.775245),\n (175.413355, 134.775245, 175.413355, 137.642536),\n (175.413355, 137.642536, 175.413355, 140.509827),\n (175.413355, 140.509827, 175.413355, 143.377118),\n (175.413355, 143.377118, 175.413355, 146.244409),\n (175.413355, 146.244409, 175.413355, 149.1117),\n (175.413355, 149.1117, 175.413355, 151.978991),\n (175.413355, 151.978991, 175.413355, 154.846282),\n (175.413355, 154.846282, 175.413355, 157.713573),\n (175.413355, 157.713573, 175.413355, 160.580864),\n (175.413355, 160.580864, 175.413355, 163.448155),\n (175.413355, 163.448155, 175.413355, 166.315445),\n (175.413355, 166.315445, 175.413355, 169.182736),\n (175.413355, 169.182736, 175.413355, 172.050027),\n (175.413355, 172.050027, 175.413355, 174.917318),\n (175.413355, 174.917318, 175.413355, 177.784609),\n (175.413355, 177.784609, 175.413355, 180.6519),\n (175.413355, 180.6519, 175.413355, 183.519191),\n (175.413355, 183.519191, 175.413355, 186.386482),\n (175.413355, 186.386482, 175.413355, 189.253773),\n (175.413355, 189.253773, 175.413355, 192.121064),\n (175.413355, 192.121064, 175.413355, 194.988354),\n (179.760046, 103.235046, 179.760046, 106.102336),\n (179.760046, 106.102336, 179.760046, 108.969627),\n (179.760046, 108.969627, 179.760046, 111.836918),\n (179.760046, 111.836918, 179.760046, 114.704209),\n (179.760046, 114.704209, 179.760046, 117.5715),\n (179.760046, 117.5715, 179.760046, 120.438791),\n (179.760046, 120.438791, 179.760046, 123.306082),\n (179.760046, 123.306082, 179.760046, 126.173373),\n (179.760046, 126.173373, 179.760046, 129.040664),\n (179.760046, 129.040664, 179.760046, 131.907955),\n (179.760046, 131.907955, 179.760046, 134.775245),\n (179.760046, 134.775245, 179.760046, 137.642536),\n (179.760046, 137.642536, 179.760046, 140.509827),\n (179.760046, 140.509827, 179.760046, 143.377118),\n (179.760046, 143.377118, 179.760046, 146.244409),\n (179.760046, 146.244409, 179.760046, 149.1117),\n (179.760046, 149.1117, 179.760046, 151.978991),\n (179.760046, 151.978991, 179.760046, 154.846282),\n (179.760046, 154.846282, 179.760046, 157.713573),\n (179.760046, 157.713573, 179.760046, 160.580864),\n (179.760046, 160.580864, 179.760046, 163.448155),\n (179.760046, 163.448155, 179.760046, 166.315445),\n (179.760046, 166.315445, 179.760046, 169.182736),\n (179.760046, 169.182736, 179.760046, 172.050027),\n (179.760046, 172.050027, 179.760046, 174.917318),\n (179.760046, 174.917318, 179.760046, 177.784609),\n (179.760046, 177.784609, 179.760046, 180.6519),\n (179.760046, 180.6519, 179.760046, 183.519191),\n (179.760046, 183.519191, 179.760046, 186.386482),\n (179.760046, 186.386482, 179.760046, 189.253773),\n (179.760046, 189.253773, 179.760046, 192.121064),\n (179.760046, 192.121064, 179.760046, 194.988354),\n (179.760046, 103.235046, 175.413355, 103.235046),\n (179.760046, 194.988354, 175.413355, 194.988354)\n]\nVISIBLE_CIRCLES = [\n (115.5367, 149.1117, 45.876654),\n (115.5367, 149.1117, 29.282971)\n]\nVISIBLE_ARCS = [\n\n]\nHIDDEN_SEGMENTS = [\n (144.8197, 89.235, 144.8197, 84.8883),\n (86.2538, 84.8883, 86.2538, 89.235),\n (179.7601, 178.3946, 175.4134, 178.3946),\n (179.7601, 119.8287, 175.4134, 119.8287)\n]\n# (orient, text, p1, p2, base) for linear; (orient, text, center, radius, angle) for diameter\nDIMENSIONS = [\n ('diameter', '%%c100', (115.5367, 149.1117), 45.8767, 45),\n ('diameter', '%%c63.8298', (115.5367, 149.1117), 29.283, 135),\n ('horizontal', '4.7374', (175.4134, 149.1117), (179.7601, 149.1117), (177.5868, 160.1117))\n]\n\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\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\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,\n angle=(0 if d[0] == \"horizontal\" else 90),\n 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,\n text=text, dimstyle=\"EZDXF\").render()\n\n doc.saveas(out_path)\n\n\nif __name__ == \"__main__\":\n out = sys.argv[1] if len(sys.argv) > 1 else \"0088_00881212_gt.dxf\"\n draw(out)\n print(\"wrote\", out)\n```"}], "images": ["images/0088_00881212.png"], "id": "0088_00881212"} {"messages": [{"role": "user", "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 97.92 mm. It is extruded to a thickness of 678.57 mm."}, {"role": "assistant", "content": "```python\n#!/usr/bin/env python3\n# -*- coding: utf-8 -*-\n# Ground-truth 2D engineering drawing for part: 0089_00892559\n# Self-contained: reproduces the three-view DXF via ezdxf, NO FreeCAD needed.\n# Coordinates are A4 page millimetres (scale=0.123431192660555, page=[297.0, 210.0]).\n# visible edges -> solid (layer OUTLINE); hidden edges -> dashed (layer HIDDEN)\n# dimensions -> real movable DIMENSION entities (text = true mm value)\n# Run: python 0089_00892559_gt.py [out.dxf]\nimport sys\nimport ezdxf\n\nSCALE = 0.123431192660555\nPAGE = [297.0, 210.0]\n\nVISIBLE_SEGMENTS = [\n (85.39634, 148.79264, 85.782063, 148.79264),\n (85.782063, 148.79264, 86.167785, 148.79264),\n (86.167785, 148.79264, 86.553508, 148.79264),\n (86.553508, 148.79264, 86.93923, 148.79264),\n (86.93923, 148.79264, 87.324953, 148.79264),\n (87.324953, 148.79264, 87.710675, 148.79264),\n (87.710675, 148.79264, 88.096398, 148.79264),\n (88.096398, 148.79264, 88.48212, 148.79264),\n (88.48212, 148.79264, 88.867843, 148.79264),\n (88.867843, 148.79264, 89.253565, 148.79264),\n (89.253565, 148.79264, 89.639288, 148.79264),\n (89.639288, 148.79264, 90.02501, 148.79264),\n (90.02501, 148.79264, 90.410733, 148.79264),\n (90.410733, 148.79264, 90.796455, 148.79264),\n (90.796455, 148.79264, 91.182178, 148.79264),\n (91.182178, 148.79264, 91.5679, 148.79264),\n (91.5679, 148.79264, 91.953622, 148.79264),\n (91.953622, 148.79264, 92.339345, 148.79264),\n (92.339345, 148.79264, 92.725067, 148.79264),\n (92.725067, 148.79264, 93.11079, 148.79264),\n (93.11079, 148.79264, 93.496512, 148.79264),\n (93.496512, 148.79264, 93.882235, 148.79264),\n (93.882235, 148.79264, 94.267957, 148.79264),\n (94.267957, 148.79264, 94.65368, 148.79264),\n (94.65368, 148.79264, 95.039402, 148.79264),\n (95.039402, 148.79264, 95.425125, 148.79264),\n (95.425125, 148.79264, 95.810847, 148.79264),\n (95.810847, 148.79264, 96.19657, 148.79264),\n (96.19657, 148.79264, 96.582292, 148.79264),\n (96.582292, 148.79264, 96.968015, 148.79264),\n (96.968015, 148.79264, 97.353737, 148.79264),\n (97.353737, 148.79264, 97.73946, 148.79264),\n (97.73946, 148.79264, 97.73946, 65.035759),\n (85.39634, 65.035759, 85.782063, 65.035759),\n (85.782063, 65.035759, 86.167785, 65.035759),\n (86.167785, 65.035759, 86.553508, 65.035759),\n (86.553508, 65.035759, 86.93923, 65.035759),\n (86.93923, 65.035759, 87.324953, 65.035759),\n (87.324953, 65.035759, 87.710675, 65.035759),\n (87.710675, 65.035759, 88.096398, 65.035759),\n (88.096398, 65.035759, 88.48212, 65.035759),\n (88.48212, 65.035759, 88.867843, 65.035759),\n (88.867843, 65.035759, 89.253565, 65.035759),\n (89.253565, 65.035759, 89.639288, 65.035759),\n (89.639288, 65.035759, 90.02501, 65.035759),\n (90.02501, 65.035759, 90.410733, 65.035759),\n (90.410733, 65.035759, 90.796455, 65.035759),\n (90.796455, 65.035759, 91.182178, 65.035759),\n (91.182178, 65.035759, 91.5679, 65.035759),\n (91.5679, 65.035759, 91.953622, 65.035759),\n (91.953622, 65.035759, 92.339345, 65.035759),\n (92.339345, 65.035759, 92.725067, 65.035759),\n (92.725067, 65.035759, 93.11079, 65.035759),\n (93.11079, 65.035759, 93.496512, 65.035759),\n (93.496512, 65.035759, 93.882235, 65.035759),\n (93.882235, 65.035759, 94.267957, 65.035759),\n (94.267957, 65.035759, 94.65368, 65.035759),\n (94.65368, 65.035759, 95.039402, 65.035759),\n (95.039402, 65.035759, 95.425125, 65.035759),\n (95.425125, 65.035759, 95.810847, 65.035759),\n (95.810847, 65.035759, 96.19657, 65.035759),\n (96.19657, 65.035759, 96.582292, 65.035759),\n (96.582292, 65.035759, 96.968015, 65.035759),\n (96.968015, 65.035759, 97.353737, 65.035759),\n (97.353737, 65.035759, 97.73946, 65.035759),\n (85.39634, 65.035759, 85.39634, 148.79264),\n (195.496341, 175.13576, 195.496341, 174.750037),\n (195.496341, 174.750037, 195.496341, 174.364315),\n (195.496341, 174.364315, 195.496341, 173.978592),\n (195.496341, 173.978592, 195.496341, 173.59287),\n (195.496341, 173.59287, 195.496341, 173.207147),\n (195.496341, 173.207147, 195.496341, 172.821425),\n (195.496341, 172.821425, 195.496341, 172.435702),\n (195.496341, 172.435702, 195.496341, 172.04998),\n (195.496341, 172.04998, 195.496341, 171.664257),\n (195.496341, 171.664257, 195.496341, 171.278535),\n (195.496341, 171.278535, 195.496341, 170.892812),\n (195.496341, 170.892812, 195.496341, 170.50709),\n (195.496341, 170.50709, 195.496341, 170.121367),\n (195.496341, 170.121367, 195.496341, 169.735645),\n (195.496341, 169.735645, 195.496341, 169.349922),\n (195.496341, 169.349922, 195.496341, 168.9642),\n (195.496341, 168.9642, 195.496341, 168.578478),\n (195.496341, 168.578478, 195.496341, 168.192755),\n (195.496341, 168.192755, 195.496341, 167.807033),\n (195.496341, 167.807033, 195.496341, 167.42131),\n (195.496341, 167.42131, 195.496341, 167.035588),\n (195.496341, 167.035588, 195.496341, 166.649865),\n (195.496341, 166.649865, 195.496341, 166.264143),\n (195.496341, 166.264143, 195.496341, 165.87842),\n (195.496341, 165.87842, 195.496341, 165.492698),\n (195.496341, 165.492698, 195.496341, 165.106975),\n (195.496341, 165.106975, 195.496341, 164.721253),\n (195.496341, 164.721253, 195.496341, 164.33553),\n (195.496341, 164.33553, 195.496341, 163.949808),\n (195.496341, 163.949808, 195.496341, 163.564085),\n (195.496341, 163.564085, 195.496341, 163.178363),\n (195.496341, 163.178363, 195.496341, 162.79264),\n (111.73946, 175.13576, 111.73946, 174.750037),\n (111.73946, 174.750037, 111.73946, 174.364315),\n (111.73946, 174.364315, 111.73946, 173.978592),\n (111.73946, 173.978592, 111.73946, 173.59287),\n (111.73946, 173.59287, 111.73946, 173.207147),\n (111.73946, 173.207147, 111.73946, 172.821425),\n (111.73946, 172.821425, 111.73946, 172.435702),\n (111.73946, 172.435702, 111.73946, 172.04998),\n (111.73946, 172.04998, 111.73946, 171.664257),\n (111.73946, 171.664257, 111.73946, 171.278535),\n (111.73946, 171.278535, 111.73946, 170.892812),\n (111.73946, 170.892812, 111.73946, 170.50709),\n (111.73946, 170.50709, 111.73946, 170.121367),\n (111.73946, 170.121367, 111.73946, 169.735645),\n (111.73946, 169.735645, 111.73946, 169.349922),\n (111.73946, 169.349922, 111.73946, 168.9642),\n (111.73946, 168.9642, 111.73946, 168.578478),\n (111.73946, 168.578478, 111.73946, 168.192755),\n (111.73946, 168.192755, 111.73946, 167.807033),\n (111.73946, 167.807033, 111.73946, 167.42131),\n (111.73946, 167.42131, 111.73946, 167.035588),\n (111.73946, 167.035588, 111.73946, 166.649865),\n (111.73946, 166.649865, 111.73946, 166.264143),\n (111.73946, 166.264143, 111.73946, 165.87842),\n (111.73946, 165.87842, 111.73946, 165.492698),\n (111.73946, 165.492698, 111.73946, 165.106975),\n (111.73946, 165.106975, 111.73946, 164.721253),\n (111.73946, 164.721253, 111.73946, 164.33553),\n (111.73946, 164.33553, 111.73946, 163.949808),\n (111.73946, 163.949808, 111.73946, 163.564085),\n (111.73946, 163.564085, 111.73946, 163.178363),\n (111.73946, 163.178363, 111.73946, 162.79264),\n (111.73946, 175.13576, 195.496341, 175.13576),\n (111.73946, 162.79264, 195.496341, 162.79264)\n]\nVISIBLE_CIRCLES = [\n (91.5679, 168.9642, 6.17156),\n (91.5679, 168.9642, 6.042985)\n]\nVISIBLE_ARCS = [\n\n]\nHIDDEN_SEGMENTS = [\n\n]\n# (orient, text, p1, p2, base) for linear; (orient, text, center, radius, angle) for diameter\nDIMENSIONS = [\n ('diameter', '%%c100', (91.5679, 168.9642), 6.1716, 45),\n ('diameter', '%%c97.9167', (91.5679, 168.9642), 6.043, 135),\n ('horizontal', '678.571', (195.4964, 168.9642), (111.7395, 168.9642), (153.6179, 157.9642))\n]\n\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\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\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,\n angle=(0 if d[0] == \"horizontal\" else 90),\n 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,\n text=text, dimstyle=\"EZDXF\").render()\n\n doc.saveas(out_path)\n\n\nif __name__ == \"__main__\":\n out = sys.argv[1] if len(sys.argv) > 1 else \"0089_00892559_gt.dxf\"\n draw(out)\n print(\"wrote\", out)\n```"}], "images": ["images/0089_00892559.png"], "id": "0089_00892559"} {"messages": [{"role": "user", "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 91.67 mm. It is extruded to a thickness of 82.61 mm."}, {"role": "assistant", "content": "```python\n#!/usr/bin/env python3\n# -*- coding: utf-8 -*-\n# Ground-truth 2D engineering drawing for part: 0089_00896741\n# Self-contained: reproduces the three-view DXF via ezdxf, NO FreeCAD needed.\n# Coordinates are A4 page millimetres (scale=0.5262619047619159, page=[297.0, 210.0]).\n# visible edges -> solid (layer OUTLINE); hidden edges -> dashed (layer HIDDEN)\n# dimensions -> real movable DIMENSION entities (text = true mm value)\n# Run: python 0089_00896741_gt.py [out.dxf]\nimport sys\nimport ezdxf\n\nSCALE = 0.5262619047619159\nPAGE = [297.0, 210.0]\n\nVISIBLE_SEGMENTS = [\n (75.841605, 118.580405, 77.486173, 118.580405),\n (77.486173, 118.580405, 79.130742, 118.580405),\n (79.130742, 118.580405, 80.77531, 118.580405),\n (80.77531, 118.580405, 82.419879, 118.580405),\n (82.419879, 118.580405, 84.064447, 118.580405),\n (84.064447, 118.580405, 85.709015, 118.580405),\n (85.709015, 118.580405, 87.353584, 118.580405),\n (87.353584, 118.580405, 88.998152, 118.580405),\n (88.998152, 118.580405, 90.642721, 118.580405),\n (90.642721, 118.580405, 92.287289, 118.580405),\n (92.287289, 118.580405, 93.931858, 118.580405),\n (93.931858, 118.580405, 95.576426, 118.580405),\n (95.576426, 118.580405, 97.220995, 118.580405),\n (97.220995, 118.580405, 98.865563, 118.580405),\n (98.865563, 118.580405, 100.510132, 118.580405),\n (100.510132, 118.580405, 102.1547, 118.580405),\n (102.1547, 118.580405, 103.799268, 118.580405),\n (103.799268, 118.580405, 105.443837, 118.580405),\n (105.443837, 118.580405, 107.088405, 118.580405),\n (107.088405, 118.580405, 108.732974, 118.580405),\n (108.732974, 118.580405, 110.377542, 118.580405),\n (110.377542, 118.580405, 112.022111, 118.580405),\n (112.022111, 118.580405, 113.666679, 118.580405),\n (113.666679, 118.580405, 115.311248, 118.580405),\n (115.311248, 118.580405, 116.955816, 118.580405),\n (116.955816, 118.580405, 118.600385, 118.580405),\n (118.600385, 118.580405, 120.244953, 118.580405),\n (120.244953, 118.580405, 121.889521, 118.580405),\n (121.889521, 118.580405, 123.53409, 118.580405),\n (123.53409, 118.580405, 125.178658, 118.580405),\n (125.178658, 118.580405, 126.823227, 118.580405),\n (126.823227, 118.580405, 128.467795, 118.580405),\n (128.467795, 118.580405, 128.467795, 75.106595),\n (75.841605, 75.106595, 77.486173, 75.106595),\n (77.486173, 75.106595, 79.130742, 75.106595),\n (79.130742, 75.106595, 80.77531, 75.106595),\n (80.77531, 75.106595, 82.419879, 75.106595),\n (82.419879, 75.106595, 84.064447, 75.106595),\n (84.064447, 75.106595, 85.709015, 75.106595),\n (85.709015, 75.106595, 87.353584, 75.106595),\n (87.353584, 75.106595, 88.998152, 75.106595),\n (88.998152, 75.106595, 90.642721, 75.106595),\n (90.642721, 75.106595, 92.287289, 75.106595),\n (92.287289, 75.106595, 93.931858, 75.106595),\n (93.931858, 75.106595, 95.576426, 75.106595),\n (95.576426, 75.106595, 97.220995, 75.106595),\n (97.220995, 75.106595, 98.865563, 75.106595),\n (98.865563, 75.106595, 100.510132, 75.106595),\n (100.510132, 75.106595, 102.1547, 75.106595),\n (102.1547, 75.106595, 103.799268, 75.106595),\n (103.799268, 75.106595, 105.443837, 75.106595),\n (105.443837, 75.106595, 107.088405, 75.106595),\n (107.088405, 75.106595, 108.732974, 75.106595),\n (108.732974, 75.106595, 110.377542, 75.106595),\n (110.377542, 75.106595, 112.022111, 75.106595),\n (112.022111, 75.106595, 113.666679, 75.106595),\n (113.666679, 75.106595, 115.311248, 75.106595),\n (115.311248, 75.106595, 116.955816, 75.106595),\n (116.955816, 75.106595, 118.600385, 75.106595),\n (118.600385, 75.106595, 120.244953, 75.106595),\n (120.244953, 75.106595, 121.889521, 75.106595),\n (121.889521, 75.106595, 123.53409, 75.106595),\n (123.53409, 75.106595, 125.178658, 75.106595),\n (125.178658, 75.106595, 126.823227, 75.106595),\n (126.823227, 75.106595, 128.467795, 75.106595),\n (75.841605, 75.106595, 75.841605, 118.580405),\n (185.941605, 185.206595, 185.941605, 183.562027),\n (185.941605, 183.562027, 185.941605, 181.917458),\n (185.941605, 181.917458, 185.941605, 180.27289),\n (185.941605, 180.27289, 185.941605, 178.628321),\n (185.941605, 178.628321, 185.941605, 176.983753),\n (185.941605, 176.983753, 185.941605, 175.339185),\n (185.941605, 175.339185, 185.941605, 173.694616),\n (185.941605, 173.694616, 185.941605, 172.050048),\n (185.941605, 172.050048, 185.941605, 170.405479),\n (185.941605, 170.405479, 185.941605, 168.760911),\n (185.941605, 168.760911, 185.941605, 167.116342),\n (185.941605, 167.116342, 185.941605, 165.471774),\n (185.941605, 165.471774, 185.941605, 163.827205),\n (185.941605, 163.827205, 185.941605, 162.182637),\n (185.941605, 162.182637, 185.941605, 160.538068),\n (185.941605, 160.538068, 185.941605, 158.8935),\n (185.941605, 158.8935, 185.941605, 157.248932),\n (185.941605, 157.248932, 185.941605, 155.604363),\n (185.941605, 155.604363, 185.941605, 153.959795),\n (185.941605, 153.959795, 185.941605, 152.315226),\n (185.941605, 152.315226, 185.941605, 150.670658),\n (185.941605, 150.670658, 185.941605, 149.026089),\n (185.941605, 149.026089, 185.941605, 147.381521),\n (185.941605, 147.381521, 185.941605, 145.736952),\n (185.941605, 145.736952, 185.941605, 144.092384),\n (185.941605, 144.092384, 185.941605, 142.447815),\n (185.941605, 142.447815, 185.941605, 140.803247),\n (185.941605, 140.803247, 185.941605, 139.158679),\n (185.941605, 139.158679, 185.941605, 137.51411),\n (185.941605, 137.51411, 185.941605, 135.869542),\n (185.941605, 135.869542, 185.941605, 134.224973),\n (185.941605, 134.224973, 185.941605, 132.580405),\n (142.467795, 185.206595, 142.467795, 183.562027),\n (142.467795, 183.562027, 142.467795, 181.917458),\n (142.467795, 181.917458, 142.467795, 180.27289),\n (142.467795, 180.27289, 142.467795, 178.628321),\n (142.467795, 178.628321, 142.467795, 176.983753),\n (142.467795, 176.983753, 142.467795, 175.339185),\n (142.467795, 175.339185, 142.467795, 173.694616),\n (142.467795, 173.694616, 142.467795, 172.050048),\n (142.467795, 172.050048, 142.467795, 170.405479),\n (142.467795, 170.405479, 142.467795, 168.760911),\n (142.467795, 168.760911, 142.467795, 167.116342),\n (142.467795, 167.116342, 142.467795, 165.471774),\n (142.467795, 165.471774, 142.467795, 163.827205),\n (142.467795, 163.827205, 142.467795, 162.182637),\n (142.467795, 162.182637, 142.467795, 160.538068),\n (142.467795, 160.538068, 142.467795, 158.8935),\n (142.467795, 158.8935, 142.467795, 157.248932),\n (142.467795, 157.248932, 142.467795, 155.604363),\n (142.467795, 155.604363, 142.467795, 153.959795),\n (142.467795, 153.959795, 142.467795, 152.315226),\n (142.467795, 152.315226, 142.467795, 150.670658),\n (142.467795, 150.670658, 142.467795, 149.026089),\n (142.467795, 149.026089, 142.467795, 147.381521),\n (142.467795, 147.381521, 142.467795, 145.736952),\n (142.467795, 145.736952, 142.467795, 144.092384),\n (142.467795, 144.092384, 142.467795, 142.447815),\n (142.467795, 142.447815, 142.467795, 140.803247),\n (142.467795, 140.803247, 142.467795, 139.158679),\n (142.467795, 139.158679, 142.467795, 137.51411),\n (142.467795, 137.51411, 142.467795, 135.869542),\n (142.467795, 135.869542, 142.467795, 134.224973),\n (142.467795, 134.224973, 142.467795, 132.580405),\n (142.467795, 185.206595, 185.941605, 185.206595),\n (142.467795, 132.580405, 185.941605, 132.580405)\n]\nVISIBLE_CIRCLES = [\n (102.1547, 158.8935, 26.313095),\n (102.1547, 158.8935, 24.120337)\n]\nVISIBLE_ARCS = [\n\n]\nHIDDEN_SEGMENTS = [\n (126.2751, 75.1065, 126.2751, 118.5804),\n (78.0344, 118.5804, 78.0344, 75.1065),\n (142.4678, 134.7731, 185.9416, 134.7731),\n (142.4678, 183.0138, 185.9416, 183.0138)\n]\n# (orient, text, p1, p2, base) for linear; (orient, text, center, radius, angle) for diameter\nDIMENSIONS = [\n ('diameter', '%%c100', (102.1547, 158.8935), 26.3131, 45),\n ('diameter', '%%c91.6667', (102.1547, 158.8935), 24.1203, 135),\n ('horizontal', '82.6087', (185.9416, 158.8935), (142.4678, 158.8935), (164.2047, 147.8935))\n]\n\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\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\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,\n angle=(0 if d[0] == \"horizontal\" else 90),\n 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,\n text=text, dimstyle=\"EZDXF\").render()\n\n doc.saveas(out_path)\n\n\nif __name__ == \"__main__\":\n out = sys.argv[1] if len(sys.argv) > 1 else \"0089_00896741_gt.dxf\"\n draw(out)\n print(\"wrote\", out)\n```"}], "images": ["images/0089_00896741.png"], "id": "0089_00896741"} {"messages": [{"role": "user", "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 9.79 mm."}, {"role": "assistant", "content": "```python\n#!/usr/bin/env python3\n# -*- coding: utf-8 -*-\n# Ground-truth 2D engineering drawing for part: 0090_00901837\n# Self-contained: reproduces the three-view DXF via ezdxf, NO FreeCAD needed.\n# Coordinates are A4 page millimetres (scale=0.8752854672135206, page=[297.0, 210.0]).\n# visible edges -> solid (layer OUTLINE); hidden edges -> dashed (layer HIDDEN)\n# dimensions -> real movable DIMENSION entities (text = true mm value)\n# Run: python 0090_00901837_gt.py [out.dxf]\nimport sys\nimport ezdxf\n\nSCALE = 0.8752854672135206\nPAGE = [297.0, 210.0]\n\nVISIBLE_SEGMENTS = [\n (155.463973, 83.832173, 152.728706, 83.832173),\n (152.728706, 83.832173, 149.993439, 83.832173),\n (149.993439, 83.832173, 147.258172, 83.832173),\n (147.258172, 83.832173, 144.522905, 83.832173),\n (144.522905, 83.832173, 141.787638, 83.832173),\n (141.787638, 83.832173, 139.052371, 83.832173),\n (139.052371, 83.832173, 136.317104, 83.832173),\n (136.317104, 83.832173, 133.581837, 83.832173),\n (133.581837, 83.832173, 130.84657, 83.832173),\n (130.84657, 83.832173, 128.111303, 83.832173),\n (128.111303, 83.832173, 125.376035, 83.832173),\n (125.376035, 83.832173, 122.640768, 83.832173),\n (122.640768, 83.832173, 119.905501, 83.832173),\n (119.905501, 83.832173, 117.170234, 83.832173),\n (117.170234, 83.832173, 114.434967, 83.832173),\n (114.434967, 83.832173, 111.6997, 83.832173),\n (111.6997, 83.832173, 108.964433, 83.832173),\n (108.964433, 83.832173, 106.229166, 83.832173),\n (106.229166, 83.832173, 103.493899, 83.832173),\n (103.493899, 83.832173, 100.758632, 83.832173),\n (100.758632, 83.832173, 98.023365, 83.832173),\n (98.023365, 83.832173, 95.288097, 83.832173),\n (95.288097, 83.832173, 92.55283, 83.832173),\n (92.55283, 83.832173, 89.817563, 83.832173),\n (89.817563, 83.832173, 87.082296, 83.832173),\n (87.082296, 83.832173, 84.347029, 83.832173),\n (84.347029, 83.832173, 81.611762, 83.832173),\n (81.611762, 83.832173, 78.876495, 83.832173),\n (78.876495, 83.832173, 76.141228, 83.832173),\n (76.141228, 83.832173, 73.405961, 83.832173),\n (73.405961, 83.832173, 70.670694, 83.832173),\n (70.670694, 83.832173, 67.935427, 83.832173),\n (155.463973, 83.832173, 155.463973, 92.403626),\n (155.463973, 92.403626, 152.728706, 92.403626),\n (152.728706, 92.403626, 149.993439, 92.403626),\n (149.993439, 92.403626, 147.258172, 92.403626),\n (147.258172, 92.403626, 144.522905, 92.403626),\n (144.522905, 92.403626, 141.787638, 92.403626),\n (141.787638, 92.403626, 139.052371, 92.403626),\n (139.052371, 92.403626, 136.317104, 92.403626),\n (136.317104, 92.403626, 133.581837, 92.403626),\n (133.581837, 92.403626, 130.84657, 92.403626),\n (130.84657, 92.403626, 128.111303, 92.403626),\n (128.111303, 92.403626, 125.376035, 92.403626),\n (125.376035, 92.403626, 122.640768, 92.403626),\n (122.640768, 92.403626, 119.905501, 92.403626),\n (119.905501, 92.403626, 117.170234, 92.403626),\n (117.170234, 92.403626, 114.434967, 92.403626),\n (114.434967, 92.403626, 111.6997, 92.403626),\n (111.6997, 92.403626, 108.964433, 92.403626),\n (108.964433, 92.403626, 106.229166, 92.403626),\n (106.229166, 92.403626, 103.493899, 92.403626),\n (103.493899, 92.403626, 100.758632, 92.403626),\n (100.758632, 92.403626, 98.023365, 92.403626),\n (98.023365, 92.403626, 95.288097, 92.403626),\n (95.288097, 92.403626, 92.55283, 92.403626),\n (92.55283, 92.403626, 89.817563, 92.403626),\n (89.817563, 92.403626, 87.082296, 92.403626),\n (87.082296, 92.403626, 84.347029, 92.403626),\n (84.347029, 92.403626, 81.611762, 92.403626),\n (81.611762, 92.403626, 78.876495, 92.403626),\n (78.876495, 92.403626, 76.141228, 92.403626),\n (76.141228, 92.403626, 73.405961, 92.403626),\n (73.405961, 92.403626, 70.670694, 92.403626),\n (70.670694, 92.403626, 67.935427, 92.403626),\n (67.935427, 92.403626, 67.935427, 83.832173),\n (169.463974, 106.403627, 169.463974, 109.138894),\n (169.463974, 109.138894, 169.463974, 111.874161),\n (169.463974, 111.874161, 169.463974, 114.609428),\n (169.463974, 114.609428, 169.463974, 117.344695),\n (169.463974, 117.344695, 169.463974, 120.079962),\n (169.463974, 120.079962, 169.463974, 122.815229),\n (169.463974, 122.815229, 169.463974, 125.550496),\n (169.463974, 125.550496, 169.463974, 128.285763),\n (169.463974, 128.285763, 169.463974, 131.02103),\n (169.463974, 131.02103, 169.463974, 133.756297),\n (169.463974, 133.756297, 169.463974, 136.491565),\n (169.463974, 136.491565, 169.463974, 139.226832),\n (169.463974, 139.226832, 169.463974, 141.962099),\n (169.463974, 141.962099, 169.463974, 144.697366),\n (169.463974, 144.697366, 169.463974, 147.432633),\n (169.463974, 147.432633, 169.463974, 150.1679),\n (169.463974, 150.1679, 169.463974, 152.903167),\n (169.463974, 152.903167, 169.463974, 155.638434),\n (169.463974, 155.638434, 169.463974, 158.373701),\n (169.463974, 158.373701, 169.463974, 161.108968),\n (169.463974, 161.108968, 169.463974, 163.844235),\n (169.463974, 163.844235, 169.463974, 166.579503),\n (169.463974, 166.579503, 169.463974, 169.31477),\n (169.463974, 169.31477, 169.463974, 172.050037),\n (169.463974, 172.050037, 169.463974, 174.785304),\n (169.463974, 174.785304, 169.463974, 177.520571),\n (169.463974, 177.520571, 169.463974, 180.255838),\n (169.463974, 180.255838, 169.463974, 182.991105),\n (169.463974, 182.991105, 169.463974, 185.726372),\n (169.463974, 185.726372, 169.463974, 188.461639),\n (169.463974, 188.461639, 169.463974, 191.196906),\n (169.463974, 191.196906, 169.463974, 193.932173),\n (178.035427, 106.403627, 178.035427, 109.138894),\n (178.035427, 109.138894, 178.035427, 111.874161),\n (178.035427, 111.874161, 178.035427, 114.609428),\n (178.035427, 114.609428, 178.035427, 117.344695),\n (178.035427, 117.344695, 178.035427, 120.079962),\n (178.035427, 120.079962, 178.035427, 122.815229),\n (178.035427, 122.815229, 178.035427, 125.550496),\n (178.035427, 125.550496, 178.035427, 128.285763),\n (178.035427, 128.285763, 178.035427, 131.02103),\n (178.035427, 131.02103, 178.035427, 133.756297),\n (178.035427, 133.756297, 178.035427, 136.491565),\n (178.035427, 136.491565, 178.035427, 139.226832),\n (178.035427, 139.226832, 178.035427, 141.962099),\n (178.035427, 141.962099, 178.035427, 144.697366),\n (178.035427, 144.697366, 178.035427, 147.432633),\n (178.035427, 147.432633, 178.035427, 150.1679),\n (178.035427, 150.1679, 178.035427, 152.903167),\n (178.035427, 152.903167, 178.035427, 155.638434),\n (178.035427, 155.638434, 178.035427, 158.373701),\n (178.035427, 158.373701, 178.035427, 161.108968),\n (178.035427, 161.108968, 178.035427, 163.844235),\n (178.035427, 163.844235, 178.035427, 166.579503),\n (178.035427, 166.579503, 178.035427, 169.31477),\n (178.035427, 169.31477, 178.035427, 172.050037),\n (178.035427, 172.050037, 178.035427, 174.785304),\n (178.035427, 174.785304, 178.035427, 177.520571),\n (178.035427, 177.520571, 178.035427, 180.255838),\n (178.035427, 180.255838, 178.035427, 182.991105),\n (178.035427, 182.991105, 178.035427, 185.726372),\n (178.035427, 185.726372, 178.035427, 188.461639),\n (178.035427, 188.461639, 178.035427, 191.196906),\n (178.035427, 191.196906, 178.035427, 193.932173),\n (178.035427, 106.403627, 169.463974, 106.403627),\n (178.035427, 193.932173, 169.463974, 193.932173)\n]\nVISIBLE_CIRCLES = [\n (111.6997, 150.1679, 43.764273),\n (111.6997, 150.1679, 38.293739)\n]\nVISIBLE_ARCS = [\n\n]\nHIDDEN_SEGMENTS = [\n (149.9935, 92.4036, 149.9935, 83.8321),\n (73.406, 83.8321, 73.406, 92.4036),\n (178.0355, 188.4616, 169.464, 188.4616),\n (178.0355, 111.8741, 169.464, 111.8741)\n]\n# (orient, text, p1, p2, base) for linear; (orient, text, center, radius, angle) for diameter\nDIMENSIONS = [\n ('diameter', '%%c100', (111.6997, 150.1679), 43.7643, 45),\n ('diameter', '%%c87.5', (111.6997, 150.1679), 38.2937, 135),\n ('horizontal', '9.7928', (169.464, 150.1679), (178.0355, 150.1679), (173.7498, 161.1679))\n]\n\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\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\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,\n angle=(0 if d[0] == \"horizontal\" else 90),\n 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,\n text=text, dimstyle=\"EZDXF\").render()\n\n doc.saveas(out_path)\n\n\nif __name__ == \"__main__\":\n out = sys.argv[1] if len(sys.argv) > 1 else \"0090_00901837_gt.dxf\"\n draw(out)\n print(\"wrote\", out)\n```"}], "images": ["images/0090_00901837.png"], "id": "0090_00901837"} {"messages": [{"role": "user", "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 91.67 mm. It is extruded to a thickness of 22.16 mm."}, {"role": "assistant", "content": "```python\n#!/usr/bin/env python3\n# -*- coding: utf-8 -*-\n# Ground-truth 2D engineering drawing for part: 0090_00909974\n# Self-contained: reproduces the three-view DXF via ezdxf, NO FreeCAD needed.\n# Coordinates are A4 page millimetres (scale=0.4805, page=[297.0, 210.0]).\n# visible edges -> solid (layer OUTLINE); hidden edges -> dashed (layer HIDDEN)\n# dimensions -> real movable DIMENSION entities (text = true mm value)\n# Run: python 0090_00909974_gt.py [out.dxf]\nimport sys\nimport ezdxf\n\nSCALE = 0.4805\nPAGE = [297.0, 210.0]\n\nVISIBLE_SEGMENTS = [\n (143.6885, 92.662998, 142.186937, 92.662998),\n (142.186937, 92.662998, 140.685375, 92.662998),\n (140.685375, 92.662998, 139.183812, 92.662998),\n (139.183812, 92.662998, 137.68225, 92.662998),\n (137.68225, 92.662998, 136.180688, 92.662998),\n (136.180688, 92.662998, 134.679125, 92.662998),\n (134.679125, 92.662998, 133.177562, 92.662998),\n (133.177562, 92.662998, 131.676, 92.662998),\n (131.676, 92.662998, 130.174438, 92.662998),\n (130.174438, 92.662998, 128.672875, 92.662998),\n (128.672875, 92.662998, 127.171312, 92.662998),\n (127.171312, 92.662998, 125.66975, 92.662998),\n (125.66975, 92.662998, 124.168188, 92.662998),\n (124.168188, 92.662998, 122.666625, 92.662998),\n (122.666625, 92.662998, 121.165063, 92.662998),\n (121.165063, 92.662998, 119.6635, 92.662998),\n (119.6635, 92.662998, 118.161938, 92.662998),\n (118.161938, 92.662998, 116.660375, 92.662998),\n (116.660375, 92.662998, 115.158813, 92.662998),\n (115.158813, 92.662998, 113.65725, 92.662998),\n (113.65725, 92.662998, 112.155687, 92.662998),\n (112.155687, 92.662998, 110.654125, 92.662998),\n (110.654125, 92.662998, 109.152563, 92.662998),\n (109.152563, 92.662998, 107.651, 92.662998),\n (107.651, 92.662998, 106.149438, 92.662998),\n (106.149438, 92.662998, 104.647875, 92.662998),\n (104.647875, 92.662998, 103.146313, 92.662998),\n (103.146313, 92.662998, 101.64475, 92.662998),\n (101.64475, 92.662998, 100.143188, 92.662998),\n (100.143188, 92.662998, 98.641625, 92.662998),\n (98.641625, 92.662998, 97.140062, 92.662998),\n (97.140062, 92.662998, 95.6385, 92.662998),\n (143.6885, 92.662998, 143.6885, 103.3121),\n (143.6885, 103.3121, 142.186937, 103.3121),\n (142.186937, 103.3121, 140.685375, 103.3121),\n (140.685375, 103.3121, 139.183812, 103.3121),\n (139.183812, 103.3121, 137.68225, 103.3121),\n (137.68225, 103.3121, 136.180688, 103.3121),\n (136.180688, 103.3121, 134.679125, 103.3121),\n (134.679125, 103.3121, 133.177562, 103.3121),\n (133.177562, 103.3121, 131.676, 103.3121),\n (131.676, 103.3121, 130.174438, 103.3121),\n (130.174438, 103.3121, 128.672875, 103.3121),\n (128.672875, 103.3121, 127.171312, 103.3121),\n (127.171312, 103.3121, 125.66975, 103.3121),\n (125.66975, 103.3121, 124.168188, 103.3121),\n (124.168188, 103.3121, 122.666625, 103.3121),\n (122.666625, 103.3121, 121.165063, 103.3121),\n (121.165063, 103.3121, 119.6635, 103.3121),\n (119.6635, 103.3121, 118.161938, 103.3121),\n (118.161938, 103.3121, 116.660375, 103.3121),\n (116.660375, 103.3121, 115.158813, 103.3121),\n (115.158813, 103.3121, 113.65725, 103.3121),\n (113.65725, 103.3121, 112.155687, 103.3121),\n (112.155687, 103.3121, 110.654125, 103.3121),\n (110.654125, 103.3121, 109.152563, 103.3121),\n (109.152563, 103.3121, 107.651, 103.3121),\n (107.651, 103.3121, 106.149438, 103.3121),\n (106.149438, 103.3121, 104.647875, 103.3121),\n (104.647875, 103.3121, 103.146313, 103.3121),\n (103.146313, 103.3121, 101.64475, 103.3121),\n (101.64475, 103.3121, 100.143188, 103.3121),\n (100.143188, 103.3121, 98.641625, 103.3121),\n (98.641625, 103.3121, 97.140062, 103.3121),\n (97.140062, 103.3121, 95.6385, 103.3121),\n (95.6385, 103.3121, 95.6385, 92.662998),\n (157.6885, 117.3121, 157.6885, 118.813662),\n (157.6885, 118.813662, 157.6885, 120.315225),\n (157.6885, 120.315225, 157.6885, 121.816787),\n (157.6885, 121.816787, 157.6885, 123.31835),\n (157.6885, 123.31835, 157.6885, 124.819912),\n (157.6885, 124.819912, 157.6885, 126.321475),\n (157.6885, 126.321475, 157.6885, 127.823037),\n (157.6885, 127.823037, 157.6885, 129.3246),\n (157.6885, 129.3246, 157.6885, 130.826162),\n (157.6885, 130.826162, 157.6885, 132.327725),\n (157.6885, 132.327725, 157.6885, 133.829287),\n (157.6885, 133.829287, 157.6885, 135.33085),\n (157.6885, 135.33085, 157.6885, 136.832412),\n (157.6885, 136.832412, 157.6885, 138.333975),\n (157.6885, 138.333975, 157.6885, 139.835537),\n (157.6885, 139.835537, 157.6885, 141.3371),\n (157.6885, 141.3371, 157.6885, 142.838662),\n (157.6885, 142.838662, 157.6885, 144.340225),\n (157.6885, 144.340225, 157.6885, 145.841787),\n (157.6885, 145.841787, 157.6885, 147.34335),\n (157.6885, 147.34335, 157.6885, 148.844912),\n (157.6885, 148.844912, 157.6885, 150.346475),\n (157.6885, 150.346475, 157.6885, 151.848037),\n (157.6885, 151.848037, 157.6885, 153.3496),\n (157.6885, 153.3496, 157.6885, 154.851162),\n (157.6885, 154.851162, 157.6885, 156.352725),\n (157.6885, 156.352725, 157.6885, 157.854287),\n (157.6885, 157.854287, 157.6885, 159.35585),\n (157.6885, 159.35585, 157.6885, 160.857412),\n (157.6885, 160.857412, 157.6885, 162.358975),\n (157.6885, 162.358975, 157.6885, 163.860537),\n (157.6885, 163.860537, 157.6885, 165.3621),\n (168.337602, 117.3121, 168.337602, 118.813662),\n (168.337602, 118.813662, 168.337602, 120.315225),\n (168.337602, 120.315225, 168.337602, 121.816787),\n (168.337602, 121.816787, 168.337602, 123.31835),\n (168.337602, 123.31835, 168.337602, 124.819912),\n (168.337602, 124.819912, 168.337602, 126.321475),\n (168.337602, 126.321475, 168.337602, 127.823037),\n (168.337602, 127.823037, 168.337602, 129.3246),\n (168.337602, 129.3246, 168.337602, 130.826162),\n (168.337602, 130.826162, 168.337602, 132.327725),\n (168.337602, 132.327725, 168.337602, 133.829287),\n (168.337602, 133.829287, 168.337602, 135.33085),\n (168.337602, 135.33085, 168.337602, 136.832412),\n (168.337602, 136.832412, 168.337602, 138.333975),\n (168.337602, 138.333975, 168.337602, 139.835537),\n (168.337602, 139.835537, 168.337602, 141.3371),\n (168.337602, 141.3371, 168.337602, 142.838662),\n (168.337602, 142.838662, 168.337602, 144.340225),\n (168.337602, 144.340225, 168.337602, 145.841787),\n (168.337602, 145.841787, 168.337602, 147.34335),\n (168.337602, 147.34335, 168.337602, 148.844912),\n (168.337602, 148.844912, 168.337602, 150.346475),\n (168.337602, 150.346475, 168.337602, 151.848037),\n (168.337602, 151.848037, 168.337602, 153.3496),\n (168.337602, 153.3496, 168.337602, 154.851162),\n (168.337602, 154.851162, 168.337602, 156.352725),\n (168.337602, 156.352725, 168.337602, 157.854287),\n (168.337602, 157.854287, 168.337602, 159.35585),\n (168.337602, 159.35585, 168.337602, 160.857412),\n (168.337602, 160.857412, 168.337602, 162.358975),\n (168.337602, 162.358975, 168.337602, 163.860537),\n (168.337602, 163.860537, 168.337602, 165.3621),\n (168.337602, 117.3121, 157.6885, 117.3121),\n (168.337602, 165.3621, 157.6885, 165.3621)\n]\nVISIBLE_CIRCLES = [\n (119.6635, 141.3371, 24.025),\n (119.6635, 141.3371, 22.022917)\n]\nVISIBLE_ARCS = [\n\n]\nHIDDEN_SEGMENTS = [\n (141.6864, 103.3121, 141.6864, 92.6629),\n (97.6406, 92.6629, 97.6406, 103.3121),\n (168.3376, 163.36, 157.6885, 163.36),\n (168.3376, 119.3141, 157.6885, 119.3141)\n]\n# (orient, text, p1, p2, base) for linear; (orient, text, center, radius, angle) for diameter\nDIMENSIONS = [\n ('diameter', '%%c100', (119.6635, 141.3371), 24.025, 45),\n ('diameter', '%%c91.6667', (119.6635, 141.3371), 22.0229, 135),\n ('horizontal', '22.1625', (157.6885, 141.3371), (168.3376, 141.3371), (163.013, 152.3371))\n]\n\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\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\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,\n angle=(0 if d[0] == \"horizontal\" else 90),\n 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,\n text=text, dimstyle=\"EZDXF\").render()\n\n doc.saveas(out_path)\n\n\nif __name__ == \"__main__\":\n out = sys.argv[1] if len(sys.argv) > 1 else \"0090_00909974_gt.dxf\"\n draw(out)\n print(\"wrote\", out)\n```"}], "images": ["images/0090_00909974.png"], "id": "0090_00909974"} {"messages": [{"role": "user", "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 18.55 mm."}, {"role": "assistant", "content": "```python\n#!/usr/bin/env python3\n# -*- coding: utf-8 -*-\n# Ground-truth 2D engineering drawing for part: 0091_00910298\n# Self-contained: reproduces the three-view DXF via ezdxf, NO FreeCAD needed.\n# Coordinates are A4 page millimetres (scale=0.8105963756177924, page=[297.0, 210.0]).\n# visible edges -> solid (layer OUTLINE); hidden edges -> dashed (layer HIDDEN)\n# dimensions -> real movable DIMENSION entities (text = true mm value)\n# Run: python 0091_00910298_gt.py [out.dxf]\nimport sys\nimport ezdxf\n\nSCALE = 0.8105963756177924\nPAGE = [297.0, 210.0]\n\nVISIBLE_SEGMENTS = [\n (153.255419, 82.214919, 150.722305, 82.214919),\n (150.722305, 82.214919, 148.189191, 82.214919),\n (148.189191, 82.214919, 145.656078, 82.214919),\n (145.656078, 82.214919, 143.122964, 82.214919),\n (143.122964, 82.214919, 140.58985, 82.214919),\n (140.58985, 82.214919, 138.056737, 82.214919),\n (138.056737, 82.214919, 135.523623, 82.214919),\n (135.523623, 82.214919, 132.990509, 82.214919),\n (132.990509, 82.214919, 130.457396, 82.214919),\n (130.457396, 82.214919, 127.924282, 82.214919),\n (127.924282, 82.214919, 125.391168, 82.214919),\n (125.391168, 82.214919, 122.858055, 82.214919),\n (122.858055, 82.214919, 120.324941, 82.214919),\n (120.324941, 82.214919, 117.791827, 82.214919),\n (117.791827, 82.214919, 115.258714, 82.214919),\n (115.258714, 82.214919, 112.7256, 82.214919),\n (112.7256, 82.214919, 110.192486, 82.214919),\n (110.192486, 82.214919, 107.659373, 82.214919),\n (107.659373, 82.214919, 105.126259, 82.214919),\n (105.126259, 82.214919, 102.593145, 82.214919),\n (102.593145, 82.214919, 100.060032, 82.214919),\n (100.060032, 82.214919, 97.526918, 82.214919),\n (97.526918, 82.214919, 94.993804, 82.214919),\n (94.993804, 82.214919, 92.460691, 82.214919),\n (92.460691, 82.214919, 89.927577, 82.214919),\n (89.927577, 82.214919, 87.394463, 82.214919),\n (87.394463, 82.214919, 84.86135, 82.214919),\n (84.86135, 82.214919, 82.328236, 82.214919),\n (82.328236, 82.214919, 79.795122, 82.214919),\n (79.795122, 82.214919, 77.262009, 82.214919),\n (77.262009, 82.214919, 74.728895, 82.214919),\n (74.728895, 82.214919, 72.195781, 82.214919),\n (153.255419, 82.214919, 153.255419, 97.255281),\n (153.255419, 97.255281, 150.722305, 97.255281),\n (150.722305, 97.255281, 148.189191, 97.255281),\n (148.189191, 97.255281, 145.656078, 97.255281),\n (145.656078, 97.255281, 143.122964, 97.255281),\n (143.122964, 97.255281, 140.58985, 97.255281),\n (140.58985, 97.255281, 138.056737, 97.255281),\n (138.056737, 97.255281, 135.523623, 97.255281),\n (135.523623, 97.255281, 132.990509, 97.255281),\n (132.990509, 97.255281, 130.457396, 97.255281),\n (130.457396, 97.255281, 127.924282, 97.255281),\n (127.924282, 97.255281, 125.391168, 97.255281),\n (125.391168, 97.255281, 122.858055, 97.255281),\n (122.858055, 97.255281, 120.324941, 97.255281),\n (120.324941, 97.255281, 117.791827, 97.255281),\n (117.791827, 97.255281, 115.258714, 97.255281),\n (115.258714, 97.255281, 112.7256, 97.255281),\n (112.7256, 97.255281, 110.192486, 97.255281),\n (110.192486, 97.255281, 107.659373, 97.255281),\n (107.659373, 97.255281, 105.126259, 97.255281),\n (105.126259, 97.255281, 102.593145, 97.255281),\n (102.593145, 97.255281, 100.060032, 97.255281),\n (100.060032, 97.255281, 97.526918, 97.255281),\n (97.526918, 97.255281, 94.993804, 97.255281),\n (94.993804, 97.255281, 92.460691, 97.255281),\n (92.460691, 97.255281, 89.927577, 97.255281),\n (89.927577, 97.255281, 87.394463, 97.255281),\n (87.394463, 97.255281, 84.86135, 97.255281),\n (84.86135, 97.255281, 82.328236, 97.255281),\n (82.328236, 97.255281, 79.795122, 97.255281),\n (79.795122, 97.255281, 77.262009, 97.255281),\n (77.262009, 97.255281, 74.728895, 97.255281),\n (74.728895, 97.255281, 72.195781, 97.255281),\n (72.195781, 97.255281, 72.195781, 82.214919),\n (167.255419, 111.255281, 167.255419, 113.788395),\n (167.255419, 113.788395, 167.255419, 116.321509),\n (167.255419, 116.321509, 167.255419, 118.854622),\n (167.255419, 118.854622, 167.255419, 121.387736),\n (167.255419, 121.387736, 167.255419, 123.92085),\n (167.255419, 123.92085, 167.255419, 126.453963),\n (167.255419, 126.453963, 167.255419, 128.987077),\n (167.255419, 128.987077, 167.255419, 131.520191),\n (167.255419, 131.520191, 167.255419, 134.053304),\n (167.255419, 134.053304, 167.255419, 136.586418),\n (167.255419, 136.586418, 167.255419, 139.119532),\n (167.255419, 139.119532, 167.255419, 141.652645),\n (167.255419, 141.652645, 167.255419, 144.185759),\n (167.255419, 144.185759, 167.255419, 146.718873),\n (167.255419, 146.718873, 167.255419, 149.251986),\n (167.255419, 149.251986, 167.255419, 151.7851),\n (167.255419, 151.7851, 167.255419, 154.318214),\n (167.255419, 154.318214, 167.255419, 156.851327),\n (167.255419, 156.851327, 167.255419, 159.384441),\n (167.255419, 159.384441, 167.255419, 161.917555),\n (167.255419, 161.917555, 167.255419, 164.450668),\n (167.255419, 164.450668, 167.255419, 166.983782),\n (167.255419, 166.983782, 167.255419, 169.516896),\n (167.255419, 169.516896, 167.255419, 172.050009),\n (167.255419, 172.050009, 167.255419, 174.583123),\n (167.255419, 174.583123, 167.255419, 177.116237),\n (167.255419, 177.116237, 167.255419, 179.64935),\n (167.255419, 179.64935, 167.255419, 182.182464),\n (167.255419, 182.182464, 167.255419, 184.715578),\n (167.255419, 184.715578, 167.255419, 187.248691),\n (167.255419, 187.248691, 167.255419, 189.781805),\n (167.255419, 189.781805, 167.255419, 192.314919),\n (182.295781, 111.255281, 182.295781, 113.788395),\n (182.295781, 113.788395, 182.295781, 116.321509),\n (182.295781, 116.321509, 182.295781, 118.854622),\n (182.295781, 118.854622, 182.295781, 121.387736),\n (182.295781, 121.387736, 182.295781, 123.92085),\n (182.295781, 123.92085, 182.295781, 126.453963),\n (182.295781, 126.453963, 182.295781, 128.987077),\n (182.295781, 128.987077, 182.295781, 131.520191),\n (182.295781, 131.520191, 182.295781, 134.053304),\n (182.295781, 134.053304, 182.295781, 136.586418),\n (182.295781, 136.586418, 182.295781, 139.119532),\n (182.295781, 139.119532, 182.295781, 141.652645),\n (182.295781, 141.652645, 182.295781, 144.185759),\n (182.295781, 144.185759, 182.295781, 146.718873),\n (182.295781, 146.718873, 182.295781, 149.251986),\n (182.295781, 149.251986, 182.295781, 151.7851),\n (182.295781, 151.7851, 182.295781, 154.318214),\n (182.295781, 154.318214, 182.295781, 156.851327),\n (182.295781, 156.851327, 182.295781, 159.384441),\n (182.295781, 159.384441, 182.295781, 161.917555),\n (182.295781, 161.917555, 182.295781, 164.450668),\n (182.295781, 164.450668, 182.295781, 166.983782),\n (182.295781, 166.983782, 182.295781, 169.516896),\n (182.295781, 169.516896, 182.295781, 172.050009),\n (182.295781, 172.050009, 182.295781, 174.583123),\n (182.295781, 174.583123, 182.295781, 177.116237),\n (182.295781, 177.116237, 182.295781, 179.64935),\n (182.295781, 179.64935, 182.295781, 182.182464),\n (182.295781, 182.182464, 182.295781, 184.715578),\n (182.295781, 184.715578, 182.295781, 187.248691),\n (182.295781, 187.248691, 182.295781, 189.781805),\n (182.295781, 189.781805, 182.295781, 192.314919),\n (182.295781, 111.255281, 167.255419, 111.255281),\n (182.295781, 192.314919, 167.255419, 192.314919)\n]\nVISIBLE_CIRCLES = [\n (112.7256, 151.7851, 40.529819),\n (112.7256, 151.7851, 24.486766)\n]\nVISIBLE_ARCS = [\n\n]\nHIDDEN_SEGMENTS = [\n (137.2124, 97.2553, 137.2124, 82.2149),\n (88.2389, 82.2149, 88.2389, 97.2553),\n (182.2959, 176.2719, 167.2555, 176.2719),\n (182.2959, 127.2983, 167.2555, 127.2983)\n]\n# (orient, text, p1, p2, base) for linear; (orient, text, center, radius, angle) for diameter\nDIMENSIONS = [\n ('diameter', '%%c100', (112.7256, 151.7851), 40.5298, 45),\n ('diameter', '%%c60.4167', (112.7256, 151.7851), 24.4868, 135),\n ('horizontal', '18.5547', (167.2555, 151.7851), (182.2959, 151.7851), (174.7757, 162.7851))\n]\n\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\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\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,\n angle=(0 if d[0] == \"horizontal\" else 90),\n 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,\n text=text, dimstyle=\"EZDXF\").render()\n\n doc.saveas(out_path)\n\n\nif __name__ == \"__main__\":\n out = sys.argv[1] if len(sys.argv) > 1 else \"0091_00910298_gt.dxf\"\n draw(out)\n print(\"wrote\", out)\n```"}], "images": ["images/0091_00910298.png"], "id": "0091_00910298"} {"messages": [{"role": "user", "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 593.75 mm."}, {"role": "assistant", "content": "```python\n#!/usr/bin/env python3\n# -*- coding: utf-8 -*-\n# Ground-truth 2D engineering drawing for part: 0094_00940952\n# Self-contained: reproduces the three-view DXF via ezdxf, NO FreeCAD needed.\n# Coordinates are A4 page millimetres (scale=0.1385225225225225, page=[297.0, 210.0]).\n# visible edges -> solid (layer OUTLINE); hidden edges -> dashed (layer HIDDEN)\n# dimensions -> real movable DIMENSION entities (text = true mm value)\n# Run: python 0094_00940952_gt.py [out.dxf]\nimport sys\nimport ezdxf\n\nSCALE = 0.1385225225225225\nPAGE = [297.0, 210.0]\n\nVISIBLE_SEGMENTS = [\n (99.163826, 65.413026, 98.730943, 65.413026),\n (98.730943, 65.413026, 98.29806, 65.413026),\n (98.29806, 65.413026, 97.865177, 65.413026),\n (97.865177, 65.413026, 97.432295, 65.413026),\n (97.432295, 65.413026, 96.999412, 65.413026),\n (96.999412, 65.413026, 96.566529, 65.413026),\n (96.566529, 65.413026, 96.133646, 65.413026),\n (96.133646, 65.413026, 95.700763, 65.413026),\n (95.700763, 65.413026, 95.26788, 65.413026),\n (95.26788, 65.413026, 94.834997, 65.413026),\n (94.834997, 65.413026, 94.402114, 65.413026),\n (94.402114, 65.413026, 93.969232, 65.413026),\n (93.969232, 65.413026, 93.536349, 65.413026),\n (93.536349, 65.413026, 93.103466, 65.413026),\n (93.103466, 65.413026, 92.670583, 65.413026),\n (92.670583, 65.413026, 92.2377, 65.413026),\n (92.2377, 65.413026, 91.804817, 65.413026),\n (91.804817, 65.413026, 91.371934, 65.413026),\n (91.371934, 65.413026, 90.939051, 65.413026),\n (90.939051, 65.413026, 90.506168, 65.413026),\n (90.506168, 65.413026, 90.073286, 65.413026),\n (90.073286, 65.413026, 89.640403, 65.413026),\n (89.640403, 65.413026, 89.20752, 65.413026),\n (89.20752, 65.413026, 88.774637, 65.413026),\n (88.774637, 65.413026, 88.341754, 65.413026),\n (88.341754, 65.413026, 87.908871, 65.413026),\n (87.908871, 65.413026, 87.475988, 65.413026),\n (87.475988, 65.413026, 87.043105, 65.413026),\n (87.043105, 65.413026, 86.610223, 65.413026),\n (86.610223, 65.413026, 86.17734, 65.413026),\n (86.17734, 65.413026, 85.744457, 65.413026),\n (85.744457, 65.413026, 85.311574, 65.413026),\n (99.163826, 65.413026, 99.163826, 147.660774),\n (99.163826, 147.660774, 98.730943, 147.660774),\n (98.730943, 147.660774, 98.29806, 147.660774),\n (98.29806, 147.660774, 97.865177, 147.660774),\n (97.865177, 147.660774, 97.432295, 147.660774),\n (97.432295, 147.660774, 96.999412, 147.660774),\n (96.999412, 147.660774, 96.566529, 147.660774),\n (96.566529, 147.660774, 96.133646, 147.660774),\n (96.133646, 147.660774, 95.700763, 147.660774),\n (95.700763, 147.660774, 95.26788, 147.660774),\n (95.26788, 147.660774, 94.834997, 147.660774),\n (94.834997, 147.660774, 94.402114, 147.660774),\n (94.402114, 147.660774, 93.969232, 147.660774),\n (93.969232, 147.660774, 93.536349, 147.660774),\n (93.536349, 147.660774, 93.103466, 147.660774),\n (93.103466, 147.660774, 92.670583, 147.660774),\n (92.670583, 147.660774, 92.2377, 147.660774),\n (92.2377, 147.660774, 91.804817, 147.660774),\n (91.804817, 147.660774, 91.371934, 147.660774),\n (91.371934, 147.660774, 90.939051, 147.660774),\n (90.939051, 147.660774, 90.506168, 147.660774),\n (90.506168, 147.660774, 90.073286, 147.660774),\n (90.073286, 147.660774, 89.640403, 147.660774),\n (89.640403, 147.660774, 89.20752, 147.660774),\n (89.20752, 147.660774, 88.774637, 147.660774),\n (88.774637, 147.660774, 88.341754, 147.660774),\n (88.341754, 147.660774, 87.908871, 147.660774),\n (87.908871, 147.660774, 87.475988, 147.660774),\n (87.475988, 147.660774, 87.043105, 147.660774),\n (87.043105, 147.660774, 86.610223, 147.660774),\n (86.610223, 147.660774, 86.17734, 147.660774),\n (86.17734, 147.660774, 85.744457, 147.660774),\n (85.744457, 147.660774, 85.311574, 147.660774),\n (85.311574, 147.660774, 85.311574, 65.413026),\n (113.163826, 161.660774, 113.163826, 162.093657),\n (113.163826, 162.093657, 113.163826, 162.52654),\n (113.163826, 162.52654, 113.163826, 162.959423),\n (113.163826, 162.959423, 113.163826, 163.392305),\n (113.163826, 163.392305, 113.163826, 163.825188),\n (113.163826, 163.825188, 113.163826, 164.258071),\n (113.163826, 164.258071, 113.163826, 164.690954),\n (113.163826, 164.690954, 113.163826, 165.123837),\n (113.163826, 165.123837, 113.163826, 165.55672),\n (113.163826, 165.55672, 113.163826, 165.989603),\n (113.163826, 165.989603, 113.163826, 166.422486),\n (113.163826, 166.422486, 113.163826, 166.855368),\n (113.163826, 166.855368, 113.163826, 167.288251),\n (113.163826, 167.288251, 113.163826, 167.721134),\n (113.163826, 167.721134, 113.163826, 168.154017),\n (113.163826, 168.154017, 113.163826, 168.5869),\n (113.163826, 168.5869, 113.163826, 169.019783),\n (113.163826, 169.019783, 113.163826, 169.452666),\n (113.163826, 169.452666, 113.163826, 169.885549),\n (113.163826, 169.885549, 113.163826, 170.318432),\n (113.163826, 170.318432, 113.163826, 170.751314),\n (113.163826, 170.751314, 113.163826, 171.184197),\n (113.163826, 171.184197, 113.163826, 171.61708),\n (113.163826, 171.61708, 113.163826, 172.049963),\n (113.163826, 172.049963, 113.163826, 172.482846),\n (113.163826, 172.482846, 113.163826, 172.915729),\n (113.163826, 172.915729, 113.163826, 173.348612),\n (113.163826, 173.348612, 113.163826, 173.781495),\n (113.163826, 173.781495, 113.163826, 174.214377),\n (113.163826, 174.214377, 113.163826, 174.64726),\n (113.163826, 174.64726, 113.163826, 175.080143),\n (113.163826, 175.080143, 113.163826, 175.513026),\n (195.411574, 161.660774, 195.411574, 162.093657),\n (195.411574, 162.093657, 195.411574, 162.52654),\n (195.411574, 162.52654, 195.411574, 162.959423),\n (195.411574, 162.959423, 195.411574, 163.392305),\n (195.411574, 163.392305, 195.411574, 163.825188),\n (195.411574, 163.825188, 195.411574, 164.258071),\n (195.411574, 164.258071, 195.411574, 164.690954),\n (195.411574, 164.690954, 195.411574, 165.123837),\n (195.411574, 165.123837, 195.411574, 165.55672),\n (195.411574, 165.55672, 195.411574, 165.989603),\n (195.411574, 165.989603, 195.411574, 166.422486),\n (195.411574, 166.422486, 195.411574, 166.855368),\n (195.411574, 166.855368, 195.411574, 167.288251),\n (195.411574, 167.288251, 195.411574, 167.721134),\n (195.411574, 167.721134, 195.411574, 168.154017),\n (195.411574, 168.154017, 195.411574, 168.5869),\n (195.411574, 168.5869, 195.411574, 169.019783),\n (195.411574, 169.019783, 195.411574, 169.452666),\n (195.411574, 169.452666, 195.411574, 169.885549),\n (195.411574, 169.885549, 195.411574, 170.318432),\n (195.411574, 170.318432, 195.411574, 170.751314),\n (195.411574, 170.751314, 195.411574, 171.184197),\n (195.411574, 171.184197, 195.411574, 171.61708),\n (195.411574, 171.61708, 195.411574, 172.049963),\n (195.411574, 172.049963, 195.411574, 172.482846),\n (195.411574, 172.482846, 195.411574, 172.915729),\n (195.411574, 172.915729, 195.411574, 173.348612),\n (195.411574, 173.348612, 195.411574, 173.781495),\n (195.411574, 173.781495, 195.411574, 174.214377),\n (195.411574, 174.214377, 195.411574, 174.64726),\n (195.411574, 174.64726, 195.411574, 175.080143),\n (195.411574, 175.080143, 195.411574, 175.513026),\n (195.411574, 161.660774, 113.163826, 161.660774),\n (195.411574, 175.513026, 113.163826, 175.513026)\n]\nVISIBLE_CIRCLES = [\n (92.2377, 168.5869, 6.926126),\n (92.2377, 168.5869, 5.627477)\n]\nVISIBLE_ARCS = [\n\n]\nHIDDEN_SEGMENTS = [\n (97.8652, 147.6608, 97.8652, 65.4131),\n (86.6102, 65.4131, 86.6102, 147.6608),\n (195.4116, 174.2144, 113.1639, 174.2144),\n (195.4116, 162.9595, 113.1639, 162.9595)\n]\n# (orient, text, p1, p2, base) for linear; (orient, text, center, radius, angle) for diameter\nDIMENSIONS = [\n ('diameter', '%%c100', (92.2377, 168.5869), 6.9261, 45),\n ('diameter', '%%c81.25', (92.2377, 168.5869), 5.6275, 135),\n ('horizontal', '593.75', (113.1639, 168.5869), (195.4116, 168.5869), (154.2877, 179.5869))\n]\n\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\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\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,\n angle=(0 if d[0] == \"horizontal\" else 90),\n 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,\n text=text, dimstyle=\"EZDXF\").render()\n\n doc.saveas(out_path)\n\n\nif __name__ == \"__main__\":\n out = sys.argv[1] if len(sys.argv) > 1 else \"0094_00940952_gt.dxf\"\n draw(out)\n print(\"wrote\", out)\n```"}], "images": ["images/0094_00940952.png"], "id": "0094_00940952"} {"messages": [{"role": "user", "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 28.35 mm."}, {"role": "assistant", "content": "```python\n#!/usr/bin/env python3\n# -*- coding: utf-8 -*-\n# Ground-truth 2D engineering drawing for part: 0095_00959659\n# Self-contained: reproduces the three-view DXF via ezdxf, NO FreeCAD needed.\n# Coordinates are A4 page millimetres (scale=0.7347, page=[297.0, 210.0]).\n# visible edges -> solid (layer OUTLINE); hidden edges -> dashed (layer HIDDEN)\n# dimensions -> real movable DIMENSION entities (text = true mm value)\n# Run: python 0095_00959659_gt.py [out.dxf]\nimport sys\nimport ezdxf\n\nSCALE = 0.7347\nPAGE = [297.0, 210.0]\n\nVISIBLE_SEGMENTS = [\n (76.3412, 102.0459, 78.637137, 102.0459),\n (78.637137, 102.0459, 80.933075, 102.0459),\n (80.933075, 102.0459, 83.229012, 102.0459),\n (83.229012, 102.0459, 85.52495, 102.0459),\n (85.52495, 102.0459, 87.820887, 102.0459),\n (87.820887, 102.0459, 90.116825, 102.0459),\n (90.116825, 102.0459, 92.412762, 102.0459),\n (92.412762, 102.0459, 94.7087, 102.0459),\n (94.7087, 102.0459, 97.004638, 102.0459),\n (97.004638, 102.0459, 99.300575, 102.0459),\n (99.300575, 102.0459, 101.596513, 102.0459),\n (101.596513, 102.0459, 103.89245, 102.0459),\n (103.89245, 102.0459, 106.188388, 102.0459),\n (106.188388, 102.0459, 108.484325, 102.0459),\n (108.484325, 102.0459, 110.780263, 102.0459),\n (110.780263, 102.0459, 113.0762, 102.0459),\n (113.0762, 102.0459, 115.372137, 102.0459),\n (115.372137, 102.0459, 117.668075, 102.0459),\n (117.668075, 102.0459, 119.964012, 102.0459),\n (119.964012, 102.0459, 122.25995, 102.0459),\n (122.25995, 102.0459, 124.555888, 102.0459),\n (124.555888, 102.0459, 126.851825, 102.0459),\n (126.851825, 102.0459, 129.147763, 102.0459),\n (129.147763, 102.0459, 131.4437, 102.0459),\n (131.4437, 102.0459, 133.739638, 102.0459),\n (133.739638, 102.0459, 136.035575, 102.0459),\n (136.035575, 102.0459, 138.331513, 102.0459),\n (138.331513, 102.0459, 140.62745, 102.0459),\n (140.62745, 102.0459, 142.923388, 102.0459),\n (142.923388, 102.0459, 145.219325, 102.0459),\n (145.219325, 102.0459, 147.515263, 102.0459),\n (147.515263, 102.0459, 149.8112, 102.0459),\n (149.8112, 102.0459, 149.8112, 81.219036),\n (76.3412, 81.219036, 78.637137, 81.219036),\n (78.637137, 81.219036, 80.933075, 81.219036),\n (80.933075, 81.219036, 83.229012, 81.219036),\n (83.229012, 81.219036, 85.52495, 81.219036),\n (85.52495, 81.219036, 87.820887, 81.219036),\n (87.820887, 81.219036, 90.116825, 81.219036),\n (90.116825, 81.219036, 92.412762, 81.219036),\n (92.412762, 81.219036, 94.7087, 81.219036),\n (94.7087, 81.219036, 97.004638, 81.219036),\n (97.004638, 81.219036, 99.300575, 81.219036),\n (99.300575, 81.219036, 101.596513, 81.219036),\n (101.596513, 81.219036, 103.89245, 81.219036),\n (103.89245, 81.219036, 106.188388, 81.219036),\n (106.188388, 81.219036, 108.484325, 81.219036),\n (108.484325, 81.219036, 110.780263, 81.219036),\n (110.780263, 81.219036, 113.0762, 81.219036),\n (113.0762, 81.219036, 115.372137, 81.219036),\n (115.372137, 81.219036, 117.668075, 81.219036),\n (117.668075, 81.219036, 119.964012, 81.219036),\n (119.964012, 81.219036, 122.25995, 81.219036),\n (122.25995, 81.219036, 124.555888, 81.219036),\n (124.555888, 81.219036, 126.851825, 81.219036),\n (126.851825, 81.219036, 129.147763, 81.219036),\n (129.147763, 81.219036, 131.4437, 81.219036),\n (131.4437, 81.219036, 133.739638, 81.219036),\n (133.739638, 81.219036, 136.035575, 81.219036),\n (136.035575, 81.219036, 138.331513, 81.219036),\n (138.331513, 81.219036, 140.62745, 81.219036),\n (140.62745, 81.219036, 142.923388, 81.219036),\n (142.923388, 81.219036, 145.219325, 81.219036),\n (145.219325, 81.219036, 147.515263, 81.219036),\n (147.515263, 81.219036, 149.8112, 81.219036),\n (76.3412, 81.219036, 76.3412, 102.0459),\n (184.638064, 189.5159, 184.638064, 187.219963),\n (184.638064, 187.219963, 184.638064, 184.924025),\n (184.638064, 184.924025, 184.638064, 182.628088),\n (184.638064, 182.628088, 184.638064, 180.33215),\n (184.638064, 180.33215, 184.638064, 178.036213),\n (184.638064, 178.036213, 184.638064, 175.740275),\n (184.638064, 175.740275, 184.638064, 173.444338),\n (184.638064, 173.444338, 184.638064, 171.1484),\n (184.638064, 171.1484, 184.638064, 168.852463),\n (184.638064, 168.852463, 184.638064, 166.556525),\n (184.638064, 166.556525, 184.638064, 164.260588),\n (184.638064, 164.260588, 184.638064, 161.96465),\n (184.638064, 161.96465, 184.638064, 159.668713),\n (184.638064, 159.668713, 184.638064, 157.372775),\n (184.638064, 157.372775, 184.638064, 155.076838),\n (184.638064, 155.076838, 184.638064, 152.7809),\n (184.638064, 152.7809, 184.638064, 150.484962),\n (184.638064, 150.484962, 184.638064, 148.189025),\n (184.638064, 148.189025, 184.638064, 145.893088),\n (184.638064, 145.893088, 184.638064, 143.59715),\n (184.638064, 143.59715, 184.638064, 141.301213),\n (184.638064, 141.301213, 184.638064, 139.005275),\n (184.638064, 139.005275, 184.638064, 136.709338),\n (184.638064, 136.709338, 184.638064, 134.4134),\n (184.638064, 134.4134, 184.638064, 132.117463),\n (184.638064, 132.117463, 184.638064, 129.821525),\n (184.638064, 129.821525, 184.638064, 127.525588),\n (184.638064, 127.525588, 184.638064, 125.22965),\n (184.638064, 125.22965, 184.638064, 122.933713),\n (184.638064, 122.933713, 184.638064, 120.637775),\n (184.638064, 120.637775, 184.638064, 118.341838),\n (184.638064, 118.341838, 184.638064, 116.0459),\n (163.8112, 189.5159, 163.8112, 187.219963),\n (163.8112, 187.219963, 163.8112, 184.924025),\n (163.8112, 184.924025, 163.8112, 182.628088),\n (163.8112, 182.628088, 163.8112, 180.33215),\n (163.8112, 180.33215, 163.8112, 178.036213),\n (163.8112, 178.036213, 163.8112, 175.740275),\n (163.8112, 175.740275, 163.8112, 173.444338),\n (163.8112, 173.444338, 163.8112, 171.1484),\n (163.8112, 171.1484, 163.8112, 168.852463),\n (163.8112, 168.852463, 163.8112, 166.556525),\n (163.8112, 166.556525, 163.8112, 164.260588),\n (163.8112, 164.260588, 163.8112, 161.96465),\n (163.8112, 161.96465, 163.8112, 159.668713),\n (163.8112, 159.668713, 163.8112, 157.372775),\n (163.8112, 157.372775, 163.8112, 155.076838),\n (163.8112, 155.076838, 163.8112, 152.7809),\n (163.8112, 152.7809, 163.8112, 150.484963),\n (163.8112, 150.484963, 163.8112, 148.189025),\n (163.8112, 148.189025, 163.8112, 145.893088),\n (163.8112, 145.893088, 163.8112, 143.59715),\n (163.8112, 143.59715, 163.8112, 141.301213),\n (163.8112, 141.301213, 163.8112, 139.005275),\n (163.8112, 139.005275, 163.8112, 136.709338),\n (163.8112, 136.709338, 163.8112, 134.4134),\n (163.8112, 134.4134, 163.8112, 132.117463),\n (163.8112, 132.117463, 163.8112, 129.821525),\n (163.8112, 129.821525, 163.8112, 127.525588),\n (163.8112, 127.525588, 163.8112, 125.22965),\n (163.8112, 125.22965, 163.8112, 122.933713),\n (163.8112, 122.933713, 163.8112, 120.637775),\n (163.8112, 120.637775, 163.8112, 118.341838),\n (163.8112, 118.341838, 163.8112, 116.0459),\n (163.8112, 189.5159, 184.638064, 189.5159),\n (163.8112, 116.0459, 184.638064, 116.0459)\n]\nVISIBLE_CIRCLES = [\n (113.0762, 152.7809, 36.735),\n (113.0762, 152.7809, 15.30625)\n]\nVISIBLE_ARCS = [\n\n]\nHIDDEN_SEGMENTS = [\n (128.3825, 81.2191, 128.3825, 102.0459),\n (97.77, 102.0459, 97.77, 81.2191),\n (163.8113, 137.4747, 184.6381, 137.4747),\n (163.8113, 168.0872, 184.6381, 168.0872)\n]\n# (orient, text, p1, p2, base) for linear; (orient, text, center, radius, angle) for diameter\nDIMENSIONS = [\n ('diameter', '%%c100', (113.0762, 152.7809), 36.735, 45),\n ('diameter', '%%c41.6667', (113.0762, 152.7809), 15.3063, 135),\n ('horizontal', '28.3474', (184.6381, 152.7809), (163.8113, 152.7809), (174.2247, 141.7809))\n]\n\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\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\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,\n angle=(0 if d[0] == \"horizontal\" else 90),\n 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,\n text=text, dimstyle=\"EZDXF\").render()\n\n doc.saveas(out_path)\n\n\nif __name__ == \"__main__\":\n out = sys.argv[1] if len(sys.argv) > 1 else \"0095_00959659_gt.dxf\"\n draw(out)\n print(\"wrote\", out)\n```"}], "images": ["images/0095_00959659.png"], "id": "0095_00959659"} {"messages": [{"role": "user", "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 47.92 mm. It is extruded to a thickness of 87.96 mm."}, {"role": "assistant", "content": "```python\n#!/usr/bin/env python3\n# -*- coding: utf-8 -*-\n# Ground-truth 2D engineering drawing for part: 0096_00960316\n# Self-contained: reproduces the three-view DXF via ezdxf, NO FreeCAD needed.\n# Coordinates are A4 page millimetres (scale=0.511270935960591, page=[297.0, 210.0]).\n# visible edges -> solid (layer OUTLINE); hidden edges -> dashed (layer HIDDEN)\n# dimensions -> real movable DIMENSION entities (text = true mm value)\n# Run: python 0096_00960316_gt.py [out.dxf]\nimport sys\nimport ezdxf\n\nSCALE = 0.511270935960591\nPAGE = [297.0, 210.0]\n\nVISIBLE_SEGMENTS = [\n (130.123847, 74.731747, 128.526125, 74.731747),\n (128.526125, 74.731747, 126.928403, 74.731747),\n (126.928403, 74.731747, 125.330682, 74.731747),\n (125.330682, 74.731747, 123.73296, 74.731747),\n (123.73296, 74.731747, 122.135238, 74.731747),\n (122.135238, 74.731747, 120.537517, 74.731747),\n (120.537517, 74.731747, 118.939795, 74.731747),\n (118.939795, 74.731747, 117.342073, 74.731747),\n (117.342073, 74.731747, 115.744352, 74.731747),\n (115.744352, 74.731747, 114.14663, 74.731747),\n (114.14663, 74.731747, 112.548908, 74.731747),\n (112.548908, 74.731747, 110.951187, 74.731747),\n (110.951187, 74.731747, 109.353465, 74.731747),\n (109.353465, 74.731747, 107.755743, 74.731747),\n (107.755743, 74.731747, 106.158022, 74.731747),\n (106.158022, 74.731747, 104.5603, 74.731747),\n (104.5603, 74.731747, 102.962578, 74.731747),\n (102.962578, 74.731747, 101.364857, 74.731747),\n (101.364857, 74.731747, 99.767135, 74.731747),\n (99.767135, 74.731747, 98.169413, 74.731747),\n (98.169413, 74.731747, 96.571692, 74.731747),\n (96.571692, 74.731747, 94.97397, 74.731747),\n (94.97397, 74.731747, 93.376248, 74.731747),\n (93.376248, 74.731747, 91.778527, 74.731747),\n (91.778527, 74.731747, 90.180805, 74.731747),\n (90.180805, 74.731747, 88.583083, 74.731747),\n (88.583083, 74.731747, 86.985362, 74.731747),\n (86.985362, 74.731747, 85.38764, 74.731747),\n (85.38764, 74.731747, 83.789918, 74.731747),\n (83.789918, 74.731747, 82.192197, 74.731747),\n (82.192197, 74.731747, 80.594475, 74.731747),\n (80.594475, 74.731747, 78.996753, 74.731747),\n (130.123847, 74.731747, 130.123847, 119.704653),\n (130.123847, 119.704653, 128.526125, 119.704653),\n (128.526125, 119.704653, 126.928403, 119.704653),\n (126.928403, 119.704653, 125.330682, 119.704653),\n (125.330682, 119.704653, 123.73296, 119.704653),\n (123.73296, 119.704653, 122.135238, 119.704653),\n (122.135238, 119.704653, 120.537517, 119.704653),\n (120.537517, 119.704653, 118.939795, 119.704653),\n (118.939795, 119.704653, 117.342073, 119.704653),\n (117.342073, 119.704653, 115.744352, 119.704653),\n (115.744352, 119.704653, 114.14663, 119.704653),\n (114.14663, 119.704653, 112.548908, 119.704653),\n (112.548908, 119.704653, 110.951187, 119.704653),\n (110.951187, 119.704653, 109.353465, 119.704653),\n (109.353465, 119.704653, 107.755743, 119.704653),\n (107.755743, 119.704653, 106.158022, 119.704653),\n (106.158022, 119.704653, 104.5603, 119.704653),\n (104.5603, 119.704653, 102.962578, 119.704653),\n (102.962578, 119.704653, 101.364857, 119.704653),\n (101.364857, 119.704653, 99.767135, 119.704653),\n (99.767135, 119.704653, 98.169413, 119.704653),\n (98.169413, 119.704653, 96.571692, 119.704653),\n (96.571692, 119.704653, 94.97397, 119.704653),\n (94.97397, 119.704653, 93.376248, 119.704653),\n (93.376248, 119.704653, 91.778527, 119.704653),\n (91.778527, 119.704653, 90.180805, 119.704653),\n (90.180805, 119.704653, 88.583083, 119.704653),\n (88.583083, 119.704653, 86.985362, 119.704653),\n (86.985362, 119.704653, 85.38764, 119.704653),\n (85.38764, 119.704653, 83.789918, 119.704653),\n (83.789918, 119.704653, 82.192197, 119.704653),\n (82.192197, 119.704653, 80.594475, 119.704653),\n (80.594475, 119.704653, 78.996753, 119.704653),\n (78.996753, 119.704653, 78.996753, 74.731747),\n (144.123847, 133.704653, 144.123847, 135.302375),\n (144.123847, 135.302375, 144.123847, 136.900097),\n (144.123847, 136.900097, 144.123847, 138.497818),\n (144.123847, 138.497818, 144.123847, 140.09554),\n (144.123847, 140.09554, 144.123847, 141.693262),\n (144.123847, 141.693262, 144.123847, 143.290983),\n (144.123847, 143.290983, 144.123847, 144.888705),\n (144.123847, 144.888705, 144.123847, 146.486427),\n (144.123847, 146.486427, 144.123847, 148.084148),\n (144.123847, 148.084148, 144.123847, 149.68187),\n (144.123847, 149.68187, 144.123847, 151.279592),\n (144.123847, 151.279592, 144.123847, 152.877313),\n (144.123847, 152.877313, 144.123847, 154.475035),\n (144.123847, 154.475035, 144.123847, 156.072757),\n (144.123847, 156.072757, 144.123847, 157.670478),\n (144.123847, 157.670478, 144.123847, 159.2682),\n (144.123847, 159.2682, 144.123847, 160.865922),\n (144.123847, 160.865922, 144.123847, 162.463643),\n (144.123847, 162.463643, 144.123847, 164.061365),\n (144.123847, 164.061365, 144.123847, 165.659087),\n (144.123847, 165.659087, 144.123847, 167.256808),\n (144.123847, 167.256808, 144.123847, 168.85453),\n (144.123847, 168.85453, 144.123847, 170.452252),\n (144.123847, 170.452252, 144.123847, 172.049973),\n (144.123847, 172.049973, 144.123847, 173.647695),\n (144.123847, 173.647695, 144.123847, 175.245417),\n (144.123847, 175.245417, 144.123847, 176.843138),\n (144.123847, 176.843138, 144.123847, 178.44086),\n (144.123847, 178.44086, 144.123847, 180.038582),\n (144.123847, 180.038582, 144.123847, 181.636303),\n (144.123847, 181.636303, 144.123847, 183.234025),\n (144.123847, 183.234025, 144.123847, 184.831747),\n (189.096753, 133.704653, 189.096753, 135.302375),\n (189.096753, 135.302375, 189.096753, 136.900097),\n (189.096753, 136.900097, 189.096753, 138.497818),\n (189.096753, 138.497818, 189.096753, 140.09554),\n (189.096753, 140.09554, 189.096753, 141.693262),\n (189.096753, 141.693262, 189.096753, 143.290983),\n (189.096753, 143.290983, 189.096753, 144.888705),\n (189.096753, 144.888705, 189.096753, 146.486427),\n (189.096753, 146.486427, 189.096753, 148.084148),\n (189.096753, 148.084148, 189.096753, 149.68187),\n (189.096753, 149.68187, 189.096753, 151.279592),\n (189.096753, 151.279592, 189.096753, 152.877313),\n (189.096753, 152.877313, 189.096753, 154.475035),\n (189.096753, 154.475035, 189.096753, 156.072757),\n (189.096753, 156.072757, 189.096753, 157.670478),\n (189.096753, 157.670478, 189.096753, 159.2682),\n (189.096753, 159.2682, 189.096753, 160.865922),\n (189.096753, 160.865922, 189.096753, 162.463643),\n (189.096753, 162.463643, 189.096753, 164.061365),\n (189.096753, 164.061365, 189.096753, 165.659087),\n (189.096753, 165.659087, 189.096753, 167.256808),\n (189.096753, 167.256808, 189.096753, 168.85453),\n (189.096753, 168.85453, 189.096753, 170.452252),\n (189.096753, 170.452252, 189.096753, 172.049973),\n (189.096753, 172.049973, 189.096753, 173.647695),\n (189.096753, 173.647695, 189.096753, 175.245417),\n (189.096753, 175.245417, 189.096753, 176.843138),\n (189.096753, 176.843138, 189.096753, 178.44086),\n (189.096753, 178.44086, 189.096753, 180.038582),\n (189.096753, 180.038582, 189.096753, 181.636303),\n (189.096753, 181.636303, 189.096753, 183.234025),\n (189.096753, 183.234025, 189.096753, 184.831747),\n (189.096753, 133.704653, 144.123847, 133.704653),\n (189.096753, 184.831747, 144.123847, 184.831747)\n]\nVISIBLE_CIRCLES = [\n (104.5603, 159.2682, 25.563547),\n (104.5603, 159.2682, 12.2492)\n]\nVISIBLE_ARCS = [\n\n]\nHIDDEN_SEGMENTS = [\n (116.8096, 119.7047, 116.8096, 74.7318),\n (92.3112, 74.7318, 92.3112, 119.7047),\n (189.0968, 171.5174, 144.1239, 171.5174),\n (189.0968, 147.019, 144.1239, 147.019)\n]\n# (orient, text, p1, p2, base) for linear; (orient, text, center, radius, angle) for diameter\nDIMENSIONS = [\n ('diameter', '%%c100', (104.5603, 159.2682), 25.5635, 45),\n ('diameter', '%%c47.9167', (104.5603, 159.2682), 12.2492, 135),\n ('horizontal', '87.963', (144.1239, 159.2682), (189.0968, 159.2682), (166.6104, 170.2682))\n]\n\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\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\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,\n angle=(0 if d[0] == \"horizontal\" else 90),\n 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,\n text=text, dimstyle=\"EZDXF\").render()\n\n doc.saveas(out_path)\n\n\nif __name__ == \"__main__\":\n out = sys.argv[1] if len(sys.argv) > 1 else \"0096_00960316_gt.dxf\"\n draw(out)\n print(\"wrote\", out)\n```"}], "images": ["images/0096_00960316.png"], "id": "0096_00960316"} {"messages": [{"role": "user", "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 39.58 mm. It is extruded to a thickness of 6.18 mm."}, {"role": "assistant", "content": "```python\n#!/usr/bin/env python3\n# -*- coding: utf-8 -*-\n# Ground-truth 2D engineering drawing for part: 0096_00962577\n# Self-contained: reproduces the three-view DXF via ezdxf, NO FreeCAD needed.\n# Coordinates are A4 page millimetres (scale=0.9050251379521794, page=[297.0, 210.0]).\n# visible edges -> solid (layer OUTLINE); hidden edges -> dashed (layer HIDDEN)\n# dimensions -> real movable DIMENSION entities (text = true mm value)\n# Run: python 0096_00962577_gt.py [out.dxf]\nimport sys\nimport ezdxf\n\nSCALE = 0.9050251379521794\nPAGE = [297.0, 210.0]\n\nVISIBLE_SEGMENTS = [\n (163.161657, 84.575657, 160.333453, 84.575657),\n (160.333453, 84.575657, 157.50525, 84.575657),\n (157.50525, 84.575657, 154.677046, 84.575657),\n (154.677046, 84.575657, 151.848843, 84.575657),\n (151.848843, 84.575657, 149.020639, 84.575657),\n (149.020639, 84.575657, 146.192436, 84.575657),\n (146.192436, 84.575657, 143.364232, 84.575657),\n (143.364232, 84.575657, 140.536028, 84.575657),\n (140.536028, 84.575657, 137.707825, 84.575657),\n (137.707825, 84.575657, 134.879621, 84.575657),\n (134.879621, 84.575657, 132.051418, 84.575657),\n (132.051418, 84.575657, 129.223214, 84.575657),\n (129.223214, 84.575657, 126.395011, 84.575657),\n (126.395011, 84.575657, 123.566807, 84.575657),\n (123.566807, 84.575657, 120.738604, 84.575657),\n (120.738604, 84.575657, 117.9104, 84.575657),\n (117.9104, 84.575657, 115.082196, 84.575657),\n (115.082196, 84.575657, 112.253993, 84.575657),\n (112.253993, 84.575657, 109.425789, 84.575657),\n (109.425789, 84.575657, 106.597586, 84.575657),\n (106.597586, 84.575657, 103.769382, 84.575657),\n (103.769382, 84.575657, 100.941179, 84.575657),\n (100.941179, 84.575657, 98.112975, 84.575657),\n (98.112975, 84.575657, 95.284772, 84.575657),\n (95.284772, 84.575657, 92.456568, 84.575657),\n (92.456568, 84.575657, 89.628364, 84.575657),\n (89.628364, 84.575657, 86.800161, 84.575657),\n (86.800161, 84.575657, 83.971957, 84.575657),\n (83.971957, 84.575657, 81.143754, 84.575657),\n (81.143754, 84.575657, 78.31555, 84.575657),\n (78.31555, 84.575657, 75.487347, 84.575657),\n (75.487347, 84.575657, 72.659143, 84.575657),\n (163.161657, 84.575657, 163.161657, 90.173143),\n (163.161657, 90.173143, 160.333453, 90.173143),\n (160.333453, 90.173143, 157.50525, 90.173143),\n (157.50525, 90.173143, 154.677046, 90.173143),\n (154.677046, 90.173143, 151.848843, 90.173143),\n (151.848843, 90.173143, 149.020639, 90.173143),\n (149.020639, 90.173143, 146.192436, 90.173143),\n (146.192436, 90.173143, 143.364232, 90.173143),\n (143.364232, 90.173143, 140.536028, 90.173143),\n (140.536028, 90.173143, 137.707825, 90.173143),\n (137.707825, 90.173143, 134.879621, 90.173143),\n (134.879621, 90.173143, 132.051418, 90.173143),\n (132.051418, 90.173143, 129.223214, 90.173143),\n (129.223214, 90.173143, 126.395011, 90.173143),\n (126.395011, 90.173143, 123.566807, 90.173143),\n (123.566807, 90.173143, 120.738604, 90.173143),\n (120.738604, 90.173143, 117.9104, 90.173143),\n (117.9104, 90.173143, 115.082196, 90.173143),\n (115.082196, 90.173143, 112.253993, 90.173143),\n (112.253993, 90.173143, 109.425789, 90.173143),\n (109.425789, 90.173143, 106.597586, 90.173143),\n (106.597586, 90.173143, 103.769382, 90.173143),\n (103.769382, 90.173143, 100.941179, 90.173143),\n (100.941179, 90.173143, 98.112975, 90.173143),\n (98.112975, 90.173143, 95.284772, 90.173143),\n (95.284772, 90.173143, 92.456568, 90.173143),\n (92.456568, 90.173143, 89.628364, 90.173143),\n (89.628364, 90.173143, 86.800161, 90.173143),\n (86.800161, 90.173143, 83.971957, 90.173143),\n (83.971957, 90.173143, 81.143754, 90.173143),\n (81.143754, 90.173143, 78.31555, 90.173143),\n (78.31555, 90.173143, 75.487347, 90.173143),\n (75.487347, 90.173143, 72.659143, 90.173143),\n (72.659143, 90.173143, 72.659143, 84.575657),\n (177.161657, 104.173143, 177.161657, 107.001347),\n (177.161657, 107.001347, 177.161657, 109.82955),\n (177.161657, 109.82955, 177.161657, 112.657754),\n (177.161657, 112.657754, 177.161657, 115.485957),\n (177.161657, 115.485957, 177.161657, 118.314161),\n (177.161657, 118.314161, 177.161657, 121.142364),\n (177.161657, 121.142364, 177.161657, 123.970568),\n (177.161657, 123.970568, 177.161657, 126.798772),\n (177.161657, 126.798772, 177.161657, 129.626975),\n (177.161657, 129.626975, 177.161657, 132.455179),\n (177.161657, 132.455179, 177.161657, 135.283382),\n (177.161657, 135.283382, 177.161657, 138.111586),\n (177.161657, 138.111586, 177.161657, 140.939789),\n (177.161657, 140.939789, 177.161657, 143.767993),\n (177.161657, 143.767993, 177.161657, 146.596196),\n (177.161657, 146.596196, 177.161657, 149.4244),\n (177.161657, 149.4244, 177.161657, 152.252604),\n (177.161657, 152.252604, 177.161657, 155.080807),\n (177.161657, 155.080807, 177.161657, 157.909011),\n (177.161657, 157.909011, 177.161657, 160.737214),\n (177.161657, 160.737214, 177.161657, 163.565418),\n (177.161657, 163.565418, 177.161657, 166.393621),\n (177.161657, 166.393621, 177.161657, 169.221825),\n (177.161657, 169.221825, 177.161657, 172.050028),\n (177.161657, 172.050028, 177.161657, 174.878232),\n (177.161657, 174.878232, 177.161657, 177.706436),\n (177.161657, 177.706436, 177.161657, 180.534639),\n (177.161657, 180.534639, 177.161657, 183.362843),\n (177.161657, 183.362843, 177.161657, 186.191046),\n (177.161657, 186.191046, 177.161657, 189.01925),\n (177.161657, 189.01925, 177.161657, 191.847453),\n (177.161657, 191.847453, 177.161657, 194.675657),\n (182.759143, 104.173143, 182.759143, 107.001347),\n (182.759143, 107.001347, 182.759143, 109.82955),\n (182.759143, 109.82955, 182.759143, 112.657754),\n (182.759143, 112.657754, 182.759143, 115.485957),\n (182.759143, 115.485957, 182.759143, 118.314161),\n (182.759143, 118.314161, 182.759143, 121.142364),\n (182.759143, 121.142364, 182.759143, 123.970568),\n (182.759143, 123.970568, 182.759143, 126.798772),\n (182.759143, 126.798772, 182.759143, 129.626975),\n (182.759143, 129.626975, 182.759143, 132.455179),\n (182.759143, 132.455179, 182.759143, 135.283382),\n (182.759143, 135.283382, 182.759143, 138.111586),\n (182.759143, 138.111586, 182.759143, 140.939789),\n (182.759143, 140.939789, 182.759143, 143.767993),\n (182.759143, 143.767993, 182.759143, 146.596196),\n (182.759143, 146.596196, 182.759143, 149.4244),\n (182.759143, 149.4244, 182.759143, 152.252604),\n (182.759143, 152.252604, 182.759143, 155.080807),\n (182.759143, 155.080807, 182.759143, 157.909011),\n (182.759143, 157.909011, 182.759143, 160.737214),\n (182.759143, 160.737214, 182.759143, 163.565418),\n (182.759143, 163.565418, 182.759143, 166.393621),\n (182.759143, 166.393621, 182.759143, 169.221825),\n (182.759143, 169.221825, 182.759143, 172.050028),\n (182.759143, 172.050028, 182.759143, 174.878232),\n (182.759143, 174.878232, 182.759143, 177.706436),\n (182.759143, 177.706436, 182.759143, 180.534639),\n (182.759143, 180.534639, 182.759143, 183.362843),\n (182.759143, 183.362843, 182.759143, 186.191046),\n (182.759143, 186.191046, 182.759143, 189.01925),\n (182.759143, 189.01925, 182.759143, 191.847453),\n (182.759143, 191.847453, 182.759143, 194.675657),\n (182.759143, 104.173143, 177.161657, 104.173143),\n (182.759143, 194.675657, 177.161657, 194.675657)\n]\nVISIBLE_CIRCLES = [\n (117.9104, 149.4244, 45.251257),\n (117.9104, 149.4244, 17.911956)\n]\nVISIBLE_ARCS = [\n\n]\nHIDDEN_SEGMENTS = [\n (135.8224, 90.1731, 135.8224, 84.5756),\n (99.9985, 84.5756, 99.9985, 90.1731),\n (182.7592, 167.3363, 177.1617, 167.3363),\n (182.7592, 131.5124, 177.1617, 131.5124)\n]\n# (orient, text, p1, p2, base) for linear; (orient, text, center, radius, angle) for diameter\nDIMENSIONS = [\n ('diameter', '%%c100', (117.9104, 149.4244), 45.2513, 45),\n ('diameter', '%%c39.5833', (117.9104, 149.4244), 17.9119, 135),\n ('horizontal', '6.1849', (177.1617, 149.4244), (182.7592, 149.4244), (179.9605, 160.4244))\n]\n\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\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\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,\n angle=(0 if d[0] == \"horizontal\" else 90),\n 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,\n text=text, dimstyle=\"EZDXF\").render()\n\n doc.saveas(out_path)\n\n\nif __name__ == \"__main__\":\n out = sys.argv[1] if len(sys.argv) > 1 else \"0096_00962577_gt.dxf\"\n draw(out)\n print(\"wrote\", out)\n```"}], "images": ["images/0096_00962577.png"], "id": "0096_00962577"} {"messages": [{"role": "user", "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 38.66 mm."}, {"role": "assistant", "content": "```python\n#!/usr/bin/env python3\n# -*- coding: utf-8 -*-\n# Ground-truth 2D engineering drawing for part: 0097_00977153\n# Self-contained: reproduces the three-view DXF via ezdxf, NO FreeCAD needed.\n# Coordinates are A4 page millimetres (scale=0.6930841648080777, page=[297.0, 210.0]).\n# visible edges -> solid (layer OUTLINE); hidden edges -> dashed (layer HIDDEN)\n# dimensions -> real movable DIMENSION entities (text = true mm value)\n# Run: python 0097_00977153_gt.py [out.dxf]\nimport sys\nimport ezdxf\n\nSCALE = 0.6930841648080777\nPAGE = [297.0, 210.0]\n\nVISIBLE_SEGMENTS = [\n (143.860608, 79.277108, 141.69472, 79.277108),\n (141.69472, 79.277108, 139.528832, 79.277108),\n (139.528832, 79.277108, 137.362944, 79.277108),\n (137.362944, 79.277108, 135.197056, 79.277108),\n (135.197056, 79.277108, 133.031168, 79.277108),\n (133.031168, 79.277108, 130.86528, 79.277108),\n (130.86528, 79.277108, 128.699392, 79.277108),\n (128.699392, 79.277108, 126.533504, 79.277108),\n (126.533504, 79.277108, 124.367616, 79.277108),\n (124.367616, 79.277108, 122.201728, 79.277108),\n (122.201728, 79.277108, 120.03584, 79.277108),\n (120.03584, 79.277108, 117.869952, 79.277108),\n (117.869952, 79.277108, 115.704064, 79.277108),\n (115.704064, 79.277108, 113.538176, 79.277108),\n (113.538176, 79.277108, 111.372288, 79.277108),\n (111.372288, 79.277108, 109.2064, 79.277108),\n (109.2064, 79.277108, 107.040512, 79.277108),\n (107.040512, 79.277108, 104.874624, 79.277108),\n (104.874624, 79.277108, 102.708736, 79.277108),\n (102.708736, 79.277108, 100.542848, 79.277108),\n (100.542848, 79.277108, 98.37696, 79.277108),\n (98.37696, 79.277108, 96.211072, 79.277108),\n (96.211072, 79.277108, 94.045184, 79.277108),\n (94.045184, 79.277108, 91.879296, 79.277108),\n (91.879296, 79.277108, 89.713408, 79.277108),\n (89.713408, 79.277108, 87.54752, 79.277108),\n (87.54752, 79.277108, 85.381632, 79.277108),\n (85.381632, 79.277108, 83.215744, 79.277108),\n (83.215744, 79.277108, 81.049856, 79.277108),\n (81.049856, 79.277108, 78.883968, 79.277108),\n (78.883968, 79.277108, 76.71808, 79.277108),\n (76.71808, 79.277108, 74.552192, 79.277108),\n (143.860608, 79.277108, 143.860608, 106.068692),\n (143.860608, 106.068692, 141.69472, 106.068692),\n (141.69472, 106.068692, 139.528832, 106.068692),\n (139.528832, 106.068692, 137.362944, 106.068692),\n (137.362944, 106.068692, 135.197056, 106.068692),\n (135.197056, 106.068692, 133.031168, 106.068692),\n (133.031168, 106.068692, 130.86528, 106.068692),\n (130.86528, 106.068692, 128.699392, 106.068692),\n (128.699392, 106.068692, 126.533504, 106.068692),\n (126.533504, 106.068692, 124.367616, 106.068692),\n (124.367616, 106.068692, 122.201728, 106.068692),\n (122.201728, 106.068692, 120.03584, 106.068692),\n (120.03584, 106.068692, 117.869952, 106.068692),\n (117.869952, 106.068692, 115.704064, 106.068692),\n (115.704064, 106.068692, 113.538176, 106.068692),\n (113.538176, 106.068692, 111.372288, 106.068692),\n (111.372288, 106.068692, 109.2064, 106.068692),\n (109.2064, 106.068692, 107.040512, 106.068692),\n (107.040512, 106.068692, 104.874624, 106.068692),\n (104.874624, 106.068692, 102.708736, 106.068692),\n (102.708736, 106.068692, 100.542848, 106.068692),\n (100.542848, 106.068692, 98.37696, 106.068692),\n (98.37696, 106.068692, 96.211072, 106.068692),\n (96.211072, 106.068692, 94.045184, 106.068692),\n (94.045184, 106.068692, 91.879296, 106.068692),\n (91.879296, 106.068692, 89.713408, 106.068692),\n (89.713408, 106.068692, 87.54752, 106.068692),\n (87.54752, 106.068692, 85.381632, 106.068692),\n (85.381632, 106.068692, 83.215744, 106.068692),\n (83.215744, 106.068692, 81.049856, 106.068692),\n (81.049856, 106.068692, 78.883968, 106.068692),\n (78.883968, 106.068692, 76.71808, 106.068692),\n (76.71808, 106.068692, 74.552192, 106.068692),\n (74.552192, 106.068692, 74.552192, 79.277108),\n (157.860608, 120.068692, 157.860608, 122.23458),\n (157.860608, 122.23458, 157.860608, 124.400468),\n (157.860608, 124.400468, 157.860608, 126.566356),\n (157.860608, 126.566356, 157.860608, 128.732244),\n (157.860608, 128.732244, 157.860608, 130.898132),\n (157.860608, 130.898132, 157.860608, 133.06402),\n (157.860608, 133.06402, 157.860608, 135.229908),\n (157.860608, 135.229908, 157.860608, 137.395796),\n (157.860608, 137.395796, 157.860608, 139.561684),\n (157.860608, 139.561684, 157.860608, 141.727572),\n (157.860608, 141.727572, 157.860608, 143.89346),\n (157.860608, 143.89346, 157.860608, 146.059348),\n (157.860608, 146.059348, 157.860608, 148.225236),\n (157.860608, 148.225236, 157.860608, 150.391124),\n (157.860608, 150.391124, 157.860608, 152.557012),\n (157.860608, 152.557012, 157.860608, 154.7229),\n (157.860608, 154.7229, 157.860608, 156.888788),\n (157.860608, 156.888788, 157.860608, 159.054676),\n (157.860608, 159.054676, 157.860608, 161.220564),\n (157.860608, 161.220564, 157.860608, 163.386452),\n (157.860608, 163.386452, 157.860608, 165.55234),\n (157.860608, 165.55234, 157.860608, 167.718228),\n (157.860608, 167.718228, 157.860608, 169.884116),\n (157.860608, 169.884116, 157.860608, 172.050004),\n (157.860608, 172.050004, 157.860608, 174.215892),\n (157.860608, 174.215892, 157.860608, 176.38178),\n (157.860608, 176.38178, 157.860608, 178.547668),\n (157.860608, 178.547668, 157.860608, 180.713556),\n (157.860608, 180.713556, 157.860608, 182.879444),\n (157.860608, 182.879444, 157.860608, 185.045332),\n (157.860608, 185.045332, 157.860608, 187.21122),\n (157.860608, 187.21122, 157.860608, 189.377108),\n (184.652192, 120.068692, 184.652192, 122.23458),\n (184.652192, 122.23458, 184.652192, 124.400468),\n (184.652192, 124.400468, 184.652192, 126.566356),\n (184.652192, 126.566356, 184.652192, 128.732244),\n (184.652192, 128.732244, 184.652192, 130.898132),\n (184.652192, 130.898132, 184.652192, 133.06402),\n (184.652192, 133.06402, 184.652192, 135.229908),\n (184.652192, 135.229908, 184.652192, 137.395796),\n (184.652192, 137.395796, 184.652192, 139.561684),\n (184.652192, 139.561684, 184.652192, 141.727572),\n (184.652192, 141.727572, 184.652192, 143.89346),\n (184.652192, 143.89346, 184.652192, 146.059348),\n (184.652192, 146.059348, 184.652192, 148.225236),\n (184.652192, 148.225236, 184.652192, 150.391124),\n (184.652192, 150.391124, 184.652192, 152.557012),\n (184.652192, 152.557012, 184.652192, 154.7229),\n (184.652192, 154.7229, 184.652192, 156.888788),\n (184.652192, 156.888788, 184.652192, 159.054676),\n (184.652192, 159.054676, 184.652192, 161.220564),\n (184.652192, 161.220564, 184.652192, 163.386452),\n (184.652192, 163.386452, 184.652192, 165.55234),\n (184.652192, 165.55234, 184.652192, 167.718228),\n (184.652192, 167.718228, 184.652192, 169.884116),\n (184.652192, 169.884116, 184.652192, 172.050004),\n (184.652192, 172.050004, 184.652192, 174.215892),\n (184.652192, 174.215892, 184.652192, 176.38178),\n (184.652192, 176.38178, 184.652192, 178.547668),\n (184.652192, 178.547668, 184.652192, 180.713556),\n (184.652192, 180.713556, 184.652192, 182.879444),\n (184.652192, 182.879444, 184.652192, 185.045332),\n (184.652192, 185.045332, 184.652192, 187.21122),\n (184.652192, 187.21122, 184.652192, 189.377108),\n (184.652192, 120.068692, 157.860608, 120.068692),\n (184.652192, 189.377108, 157.860608, 189.377108)\n]\nVISIBLE_CIRCLES = [\n (109.2064, 154.7229, 34.654208),\n (109.2064, 154.7229, 20.936917)\n]\nVISIBLE_ARCS = [\n\n]\nHIDDEN_SEGMENTS = [\n (130.1433, 106.0687, 130.1433, 79.2771),\n (88.2695, 79.2771, 88.2695, 106.0687),\n (184.6522, 175.6598, 157.8606, 175.6598),\n (184.6522, 133.786, 157.8606, 133.786)\n]\n# (orient, text, p1, p2, base) for linear; (orient, text, center, radius, angle) for diameter\nDIMENSIONS = [\n ('diameter', '%%c100', (109.2064, 154.7229), 34.6542, 45),\n ('diameter', '%%c60.4167', (109.2064, 154.7229), 20.9369, 135),\n ('horizontal', '38.6556', (157.8606, 154.7229), (184.6522, 154.7229), (171.2564, 165.7229))\n]\n\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\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\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,\n angle=(0 if d[0] == \"horizontal\" else 90),\n 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,\n text=text, dimstyle=\"EZDXF\").render()\n\n doc.saveas(out_path)\n\n\nif __name__ == \"__main__\":\n out = sys.argv[1] if len(sys.argv) > 1 else \"0097_00977153_gt.dxf\"\n draw(out)\n print(\"wrote\", out)\n```"}], "images": ["images/0097_00977153.png"], "id": "0097_00977153"} {"messages": [{"role": "user", "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 21.65 mm."}, {"role": "assistant", "content": "```python\n#!/usr/bin/env python3\n# -*- coding: utf-8 -*-\n# Ground-truth 2D engineering drawing for part: 0098_00985830\n# Self-contained: reproduces the three-view DXF via ezdxf, NO FreeCAD needed.\n# Coordinates are A4 page millimetres (scale=0.7899898314155719, page=[297.0, 210.0]).\n# visible edges -> solid (layer OUTLINE); hidden edges -> dashed (layer HIDDEN)\n# dimensions -> real movable DIMENSION entities (text = true mm value)\n# Run: python 0098_00985830_gt.py [out.dxf]\nimport sys\nimport ezdxf\n\nSCALE = 0.7899898314155719\nPAGE = [297.0, 210.0]\n\nVISIBLE_SEGMENTS = [\n (153.048092, 81.699791, 150.579373, 81.699791),\n (150.579373, 81.699791, 148.110655, 81.699791),\n (148.110655, 81.699791, 145.641937, 81.699791),\n (145.641937, 81.699791, 143.173219, 81.699791),\n (143.173219, 81.699791, 140.7045, 81.699791),\n (140.7045, 81.699791, 138.235782, 81.699791),\n (138.235782, 81.699791, 135.767064, 81.699791),\n (135.767064, 81.699791, 133.298346, 81.699791),\n (133.298346, 81.699791, 130.829628, 81.699791),\n (130.829628, 81.699791, 128.360909, 81.699791),\n (128.360909, 81.699791, 125.892191, 81.699791),\n (125.892191, 81.699791, 123.423473, 81.699791),\n (123.423473, 81.699791, 120.954755, 81.699791),\n (120.954755, 81.699791, 118.486036, 81.699791),\n (118.486036, 81.699791, 116.017318, 81.699791),\n (116.017318, 81.699791, 113.5486, 81.699791),\n (113.5486, 81.699791, 111.079882, 81.699791),\n (111.079882, 81.699791, 108.611164, 81.699791),\n (108.611164, 81.699791, 106.142445, 81.699791),\n (106.142445, 81.699791, 103.673727, 81.699791),\n (103.673727, 81.699791, 101.205009, 81.699791),\n (101.205009, 81.699791, 98.736291, 81.699791),\n (98.736291, 81.699791, 96.267572, 81.699791),\n (96.267572, 81.699791, 93.798854, 81.699791),\n (93.798854, 81.699791, 91.330136, 81.699791),\n (91.330136, 81.699791, 88.861418, 81.699791),\n (88.861418, 81.699791, 86.3927, 81.699791),\n (86.3927, 81.699791, 83.923981, 81.699791),\n (83.923981, 81.699791, 81.455263, 81.699791),\n (81.455263, 81.699791, 78.986545, 81.699791),\n (78.986545, 81.699791, 76.517827, 81.699791),\n (76.517827, 81.699791, 74.049108, 81.699791),\n (153.048092, 81.699791, 153.048092, 98.800808),\n (153.048092, 98.800808, 150.579373, 98.800808),\n (150.579373, 98.800808, 148.110655, 98.800808),\n (148.110655, 98.800808, 145.641937, 98.800808),\n (145.641937, 98.800808, 143.173219, 98.800808),\n (143.173219, 98.800808, 140.7045, 98.800808),\n (140.7045, 98.800808, 138.235782, 98.800808),\n (138.235782, 98.800808, 135.767064, 98.800808),\n (135.767064, 98.800808, 133.298346, 98.800808),\n (133.298346, 98.800808, 130.829628, 98.800808),\n (130.829628, 98.800808, 128.360909, 98.800808),\n (128.360909, 98.800808, 125.892191, 98.800808),\n (125.892191, 98.800808, 123.423473, 98.800808),\n (123.423473, 98.800808, 120.954755, 98.800808),\n (120.954755, 98.800808, 118.486036, 98.800808),\n (118.486036, 98.800808, 116.017318, 98.800808),\n (116.017318, 98.800808, 113.5486, 98.800808),\n (113.5486, 98.800808, 111.079882, 98.800808),\n (111.079882, 98.800808, 108.611164, 98.800808),\n (108.611164, 98.800808, 106.142445, 98.800808),\n (106.142445, 98.800808, 103.673727, 98.800808),\n (103.673727, 98.800808, 101.205009, 98.800808),\n (101.205009, 98.800808, 98.736291, 98.800808),\n (98.736291, 98.800808, 96.267572, 98.800808),\n (96.267572, 98.800808, 93.798854, 98.800808),\n (93.798854, 98.800808, 91.330136, 98.800808),\n (91.330136, 98.800808, 88.861418, 98.800808),\n (88.861418, 98.800808, 86.3927, 98.800808),\n (86.3927, 98.800808, 83.923981, 98.800808),\n (83.923981, 98.800808, 81.455263, 98.800808),\n (81.455263, 98.800808, 78.986545, 98.800808),\n (78.986545, 98.800808, 76.517827, 98.800808),\n (76.517827, 98.800808, 74.049108, 98.800808),\n (74.049108, 98.800808, 74.049108, 81.699791),\n (167.048092, 112.800808, 167.048092, 115.269527),\n (167.048092, 115.269527, 167.048092, 117.738245),\n (167.048092, 117.738245, 167.048092, 120.206963),\n (167.048092, 120.206963, 167.048092, 122.675681),\n (167.048092, 122.675681, 167.048092, 125.1444),\n (167.048092, 125.1444, 167.048092, 127.613118),\n (167.048092, 127.613118, 167.048092, 130.081836),\n (167.048092, 130.081836, 167.048092, 132.550554),\n (167.048092, 132.550554, 167.048092, 135.019272),\n (167.048092, 135.019272, 167.048092, 137.487991),\n (167.048092, 137.487991, 167.048092, 139.956709),\n (167.048092, 139.956709, 167.048092, 142.425427),\n (167.048092, 142.425427, 167.048092, 144.894145),\n (167.048092, 144.894145, 167.048092, 147.362864),\n (167.048092, 147.362864, 167.048092, 149.831582),\n (167.048092, 149.831582, 167.048092, 152.3003),\n (167.048092, 152.3003, 167.048092, 154.769018),\n (167.048092, 154.769018, 167.048092, 157.237736),\n (167.048092, 157.237736, 167.048092, 159.706455),\n (167.048092, 159.706455, 167.048092, 162.175173),\n (167.048092, 162.175173, 167.048092, 164.643891),\n (167.048092, 164.643891, 167.048092, 167.112609),\n (167.048092, 167.112609, 167.048092, 169.581328),\n (167.048092, 169.581328, 167.048092, 172.050046),\n (167.048092, 172.050046, 167.048092, 174.518764),\n (167.048092, 174.518764, 167.048092, 176.987482),\n (167.048092, 176.987482, 167.048092, 179.4562),\n (167.048092, 179.4562, 167.048092, 181.924919),\n (167.048092, 181.924919, 167.048092, 184.393637),\n (167.048092, 184.393637, 167.048092, 186.862355),\n (167.048092, 186.862355, 167.048092, 189.331073),\n (167.048092, 189.331073, 167.048092, 191.799792),\n (184.149109, 112.800808, 184.149109, 115.269527),\n (184.149109, 115.269527, 184.149109, 117.738245),\n (184.149109, 117.738245, 184.149109, 120.206963),\n (184.149109, 120.206963, 184.149109, 122.675681),\n (184.149109, 122.675681, 184.149109, 125.1444),\n (184.149109, 125.1444, 184.149109, 127.613118),\n (184.149109, 127.613118, 184.149109, 130.081836),\n (184.149109, 130.081836, 184.149109, 132.550554),\n (184.149109, 132.550554, 184.149109, 135.019272),\n (184.149109, 135.019272, 184.149109, 137.487991),\n (184.149109, 137.487991, 184.149109, 139.956709),\n (184.149109, 139.956709, 184.149109, 142.425427),\n (184.149109, 142.425427, 184.149109, 144.894145),\n (184.149109, 144.894145, 184.149109, 147.362864),\n (184.149109, 147.362864, 184.149109, 149.831582),\n (184.149109, 149.831582, 184.149109, 152.3003),\n (184.149109, 152.3003, 184.149109, 154.769018),\n (184.149109, 154.769018, 184.149109, 157.237736),\n (184.149109, 157.237736, 184.149109, 159.706455),\n (184.149109, 159.706455, 184.149109, 162.175173),\n (184.149109, 162.175173, 184.149109, 164.643891),\n (184.149109, 164.643891, 184.149109, 167.112609),\n (184.149109, 167.112609, 184.149109, 169.581328),\n (184.149109, 169.581328, 184.149109, 172.050046),\n (184.149109, 172.050046, 184.149109, 174.518764),\n (184.149109, 174.518764, 184.149109, 176.987482),\n (184.149109, 176.987482, 184.149109, 179.4562),\n (184.149109, 179.4562, 184.149109, 181.924919),\n (184.149109, 181.924919, 184.149109, 184.393637),\n (184.149109, 184.393637, 184.149109, 186.862355),\n (184.149109, 186.862355, 184.149109, 189.331073),\n (184.149109, 189.331073, 184.149109, 191.799792),\n (184.149109, 112.800808, 167.048092, 112.800808),\n (184.149109, 191.799792, 167.048092, 191.799792)\n]\nVISIBLE_CIRCLES = [\n (113.5486, 152.3003, 39.499492),\n (113.5486, 152.3003, 18.103934)\n]\nVISIBLE_ARCS = [\n\n]\nHIDDEN_SEGMENTS = [\n (131.6526, 98.8008, 131.6526, 81.6997),\n (95.4447, 81.6997, 95.4447, 98.8008),\n (184.1491, 170.4042, 167.0481, 170.4042),\n (184.1491, 134.1963, 167.0481, 134.1963)\n]\n# (orient, text, p1, p2, base) for linear; (orient, text, center, radius, angle) for diameter\nDIMENSIONS = [\n ('diameter', '%%c100', (113.5486, 152.3003), 39.4995, 45),\n ('diameter', '%%c45.8333', (113.5486, 152.3003), 18.1039, 135),\n ('horizontal', '21.6471', (167.0481, 152.3003), (184.1491, 152.3003), (175.5986, 163.3003))\n]\n\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\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\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,\n angle=(0 if d[0] == \"horizontal\" else 90),\n 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,\n text=text, dimstyle=\"EZDXF\").render()\n\n doc.saveas(out_path)\n\n\nif __name__ == \"__main__\":\n out = sys.argv[1] if len(sys.argv) > 1 else \"0098_00985830_gt.dxf\"\n draw(out)\n print(\"wrote\", out)\n```"}], "images": ["images/0098_00985830.png"], "id": "0098_00985830"} {"messages": [{"role": "user", "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 72.52 mm."}, {"role": "assistant", "content": "```python\n#!/usr/bin/env python3\n# -*- coding: utf-8 -*-\n# Ground-truth 2D engineering drawing for part: 0099_00993215\n# Self-contained: reproduces the three-view DXF via ezdxf, NO FreeCAD needed.\n# Coordinates are A4 page millimetres (scale=0.5570398230088484, page=[297.0, 210.0]).\n# visible edges -> solid (layer OUTLINE); hidden edges -> dashed (layer HIDDEN)\n# dimensions -> real movable DIMENSION entities (text = true mm value)\n# Run: python 0099_00993215_gt.py [out.dxf]\nimport sys\nimport ezdxf\n\nSCALE = 0.5570398230088484\nPAGE = [297.0, 210.0]\n\nVISIBLE_SEGMENTS = [\n (132.984191, 75.875991, 131.243442, 75.875991),\n (131.243442, 75.875991, 129.502692, 75.875991),\n (129.502692, 75.875991, 127.761943, 75.875991),\n (127.761943, 75.875991, 126.021193, 75.875991),\n (126.021193, 75.875991, 124.280444, 75.875991),\n (124.280444, 75.875991, 122.539694, 75.875991),\n (122.539694, 75.875991, 120.798945, 75.875991),\n (120.798945, 75.875991, 119.058196, 75.875991),\n (119.058196, 75.875991, 117.317446, 75.875991),\n (117.317446, 75.875991, 115.576697, 75.875991),\n (115.576697, 75.875991, 113.835947, 75.875991),\n (113.835947, 75.875991, 112.095198, 75.875991),\n (112.095198, 75.875991, 110.354448, 75.875991),\n (110.354448, 75.875991, 108.613699, 75.875991),\n (108.613699, 75.875991, 106.872949, 75.875991),\n (106.872949, 75.875991, 105.1322, 75.875991),\n (105.1322, 75.875991, 103.391451, 75.875991),\n (103.391451, 75.875991, 101.650701, 75.875991),\n (101.650701, 75.875991, 99.909952, 75.875991),\n (99.909952, 75.875991, 98.169202, 75.875991),\n (98.169202, 75.875991, 96.428453, 75.875991),\n (96.428453, 75.875991, 94.687703, 75.875991),\n (94.687703, 75.875991, 92.946954, 75.875991),\n (92.946954, 75.875991, 91.206204, 75.875991),\n (91.206204, 75.875991, 89.465455, 75.875991),\n (89.465455, 75.875991, 87.724706, 75.875991),\n (87.724706, 75.875991, 85.983956, 75.875991),\n (85.983956, 75.875991, 84.243207, 75.875991),\n (84.243207, 75.875991, 82.502457, 75.875991),\n (82.502457, 75.875991, 80.761708, 75.875991),\n (80.761708, 75.875991, 79.020958, 75.875991),\n (79.020958, 75.875991, 77.280209, 75.875991),\n (132.984191, 75.875991, 132.984191, 116.272009),\n (132.984191, 116.272009, 131.243442, 116.272009),\n (131.243442, 116.272009, 129.502692, 116.272009),\n (129.502692, 116.272009, 127.761943, 116.272009),\n (127.761943, 116.272009, 126.021193, 116.272009),\n (126.021193, 116.272009, 124.280444, 116.272009),\n (124.280444, 116.272009, 122.539694, 116.272009),\n (122.539694, 116.272009, 120.798945, 116.272009),\n (120.798945, 116.272009, 119.058196, 116.272009),\n (119.058196, 116.272009, 117.317446, 116.272009),\n (117.317446, 116.272009, 115.576697, 116.272009),\n (115.576697, 116.272009, 113.835947, 116.272009),\n (113.835947, 116.272009, 112.095198, 116.272009),\n (112.095198, 116.272009, 110.354448, 116.272009),\n (110.354448, 116.272009, 108.613699, 116.272009),\n (108.613699, 116.272009, 106.872949, 116.272009),\n (106.872949, 116.272009, 105.1322, 116.272009),\n (105.1322, 116.272009, 103.391451, 116.272009),\n (103.391451, 116.272009, 101.650701, 116.272009),\n (101.650701, 116.272009, 99.909952, 116.272009),\n (99.909952, 116.272009, 98.169202, 116.272009),\n (98.169202, 116.272009, 96.428453, 116.272009),\n (96.428453, 116.272009, 94.687703, 116.272009),\n (94.687703, 116.272009, 92.946954, 116.272009),\n (92.946954, 116.272009, 91.206204, 116.272009),\n (91.206204, 116.272009, 89.465455, 116.272009),\n (89.465455, 116.272009, 87.724706, 116.272009),\n (87.724706, 116.272009, 85.983956, 116.272009),\n (85.983956, 116.272009, 84.243207, 116.272009),\n (84.243207, 116.272009, 82.502457, 116.272009),\n (82.502457, 116.272009, 80.761708, 116.272009),\n (80.761708, 116.272009, 79.020958, 116.272009),\n (79.020958, 116.272009, 77.280209, 116.272009),\n (77.280209, 116.272009, 77.280209, 75.875991),\n (146.984191, 130.272009, 146.984191, 132.012758),\n (146.984191, 132.012758, 146.984191, 133.753508),\n (146.984191, 133.753508, 146.984191, 135.494257),\n (146.984191, 135.494257, 146.984191, 137.235007),\n (146.984191, 137.235007, 146.984191, 138.975756),\n (146.984191, 138.975756, 146.984191, 140.716506),\n (146.984191, 140.716506, 146.984191, 142.457255),\n (146.984191, 142.457255, 146.984191, 144.198004),\n (146.984191, 144.198004, 146.984191, 145.938754),\n (146.984191, 145.938754, 146.984191, 147.679503),\n (146.984191, 147.679503, 146.984191, 149.420253),\n (146.984191, 149.420253, 146.984191, 151.161002),\n (146.984191, 151.161002, 146.984191, 152.901752),\n (146.984191, 152.901752, 146.984191, 154.642501),\n (146.984191, 154.642501, 146.984191, 156.383251),\n (146.984191, 156.383251, 146.984191, 158.124),\n (146.984191, 158.124, 146.984191, 159.864749),\n (146.984191, 159.864749, 146.984191, 161.605499),\n (146.984191, 161.605499, 146.984191, 163.346248),\n (146.984191, 163.346248, 146.984191, 165.086998),\n (146.984191, 165.086998, 146.984191, 166.827747),\n (146.984191, 166.827747, 146.984191, 168.568497),\n (146.984191, 168.568497, 146.984191, 170.309246),\n (146.984191, 170.309246, 146.984191, 172.049996),\n (146.984191, 172.049996, 146.984191, 173.790745),\n (146.984191, 173.790745, 146.984191, 175.531494),\n (146.984191, 175.531494, 146.984191, 177.272244),\n (146.984191, 177.272244, 146.984191, 179.012993),\n (146.984191, 179.012993, 146.984191, 180.753743),\n (146.984191, 180.753743, 146.984191, 182.494492),\n (146.984191, 182.494492, 146.984191, 184.235242),\n (146.984191, 184.235242, 146.984191, 185.975991),\n (187.380209, 130.272009, 187.380209, 132.012758),\n (187.380209, 132.012758, 187.380209, 133.753508),\n (187.380209, 133.753508, 187.380209, 135.494257),\n (187.380209, 135.494257, 187.380209, 137.235007),\n (187.380209, 137.235007, 187.380209, 138.975756),\n (187.380209, 138.975756, 187.380209, 140.716506),\n (187.380209, 140.716506, 187.380209, 142.457255),\n (187.380209, 142.457255, 187.380209, 144.198004),\n (187.380209, 144.198004, 187.380209, 145.938754),\n (187.380209, 145.938754, 187.380209, 147.679503),\n (187.380209, 147.679503, 187.380209, 149.420253),\n (187.380209, 149.420253, 187.380209, 151.161002),\n (187.380209, 151.161002, 187.380209, 152.901752),\n (187.380209, 152.901752, 187.380209, 154.642501),\n (187.380209, 154.642501, 187.380209, 156.383251),\n (187.380209, 156.383251, 187.380209, 158.124),\n (187.380209, 158.124, 187.380209, 159.864749),\n (187.380209, 159.864749, 187.380209, 161.605499),\n (187.380209, 161.605499, 187.380209, 163.346248),\n (187.380209, 163.346248, 187.380209, 165.086998),\n (187.380209, 165.086998, 187.380209, 166.827747),\n (187.380209, 166.827747, 187.380209, 168.568497),\n (187.380209, 168.568497, 187.380209, 170.309246),\n (187.380209, 170.309246, 187.380209, 172.049996),\n (187.380209, 172.049996, 187.380209, 173.790745),\n (187.380209, 173.790745, 187.380209, 175.531494),\n (187.380209, 175.531494, 187.380209, 177.272244),\n (187.380209, 177.272244, 187.380209, 179.012993),\n (187.380209, 179.012993, 187.380209, 180.753743),\n (187.380209, 180.753743, 187.380209, 182.494492),\n (187.380209, 182.494492, 187.380209, 184.235242),\n (187.380209, 184.235242, 187.380209, 185.975991),\n (187.380209, 130.272009, 146.984191, 130.272009),\n (187.380209, 185.975991, 146.984191, 185.975991)\n]\nVISIBLE_CIRCLES = [\n (105.1322, 158.124, 27.851991),\n (105.1322, 158.124, 16.827245)\n]\nVISIBLE_ARCS = [\n\n]\nHIDDEN_SEGMENTS = [\n (121.9594, 116.272, 121.9594, 75.876),\n (88.3049, 75.876, 88.3049, 116.272),\n (187.3802, 174.9512, 146.9842, 174.9512),\n (187.3802, 141.2968, 146.9842, 141.2968)\n]\n# (orient, text, p1, p2, base) for linear; (orient, text, center, radius, angle) for diameter\nDIMENSIONS = [\n ('diameter', '%%c100', (105.1322, 158.124), 27.852, 45),\n ('diameter', '%%c60.4167', (105.1322, 158.124), 16.8273, 135),\n ('horizontal', '72.5191', (146.9842, 158.124), (187.3802, 158.124), (167.1822, 169.124))\n]\n\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\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\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,\n angle=(0 if d[0] == \"horizontal\" else 90),\n 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,\n text=text, dimstyle=\"EZDXF\").render()\n\n doc.saveas(out_path)\n\n\nif __name__ == \"__main__\":\n out = sys.argv[1] if len(sys.argv) > 1 else \"0099_00993215_gt.dxf\"\n draw(out)\n print(\"wrote\", out)\n```"}], "images": ["images/0099_00993215.png"], "id": "0099_00993215"} {"messages": [{"role": "user", "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 74.74 mm wide and 100 mm tall, featuring a circular hole of diameter 21.05 mm. It is extruded to a thickness of 18.75 mm."}, {"role": "assistant", "content": "```python\n#!/usr/bin/env python3\n# -*- coding: utf-8 -*-\n# Ground-truth 2D engineering drawing for part: 0000_00003202\n# Self-contained: reproduces the three-view DXF via ezdxf, NO FreeCAD needed.\n# Coordinates are A4 page millimetres (scale=0.6989090909090908, page=[297.0, 210.0]).\n# visible edges -> solid (layer OUTLINE); hidden edges -> dashed (layer HIDDEN)\n# dimensions -> real movable DIMENSION entities (text = true mm value)\n# Run: python 0000_00003202_gt.py [out.dxf]\nimport sys\nimport ezdxf\n\nSCALE = 0.6989090909090908\nPAGE = [297.0, 210.0]\n\nVISIBLE_SEGMENTS = [\n (149.512582, 172.050026, 149.512582, 102.159117),\n (97.278324, 172.050026, 149.512582, 172.050026),\n (149.512582, 102.159117, 97.278324, 102.159117),\n (97.278324, 102.159117, 97.278324, 172.050026),\n (149.512582, 88.159117, 149.512582, 61.950026),\n (97.278324, 88.159117, 97.278324, 61.950026),\n (97.278324, 88.159117, 149.512582, 88.159117),\n (97.278324, 61.950026, 149.512582, 61.950026),\n (163.512582, 172.050026, 189.721673, 172.050026),\n (189.721673, 102.159117, 163.512582, 102.159117),\n (163.512582, 102.159117, 163.512582, 172.050026),\n (189.721673, 102.159117, 189.721673, 172.050026)\n]\nVISIBLE_CIRCLES = [\n (123.7633, 151.4506, 7.356938)\n]\nVISIBLE_ARCS = [\n\n]\nHIDDEN_SEGMENTS = [\n (131.1202, 88.1591, 131.1202, 61.95),\n (116.4064, 88.1591, 116.4064, 61.95),\n (163.5126, 144.0936, 189.7217, 144.0936),\n (163.5126, 158.8075, 189.7217, 158.8075)\n]\n# (orient, text, p1, p2, base) for linear; (orient, text, center, radius, angle) for diameter\nDIMENSIONS = [\n ('horizontal', '74.7368', (149.5126, 102.1591), (97.2783, 102.1591), (123.3954, 91.1591)),\n ('vertical', '100', (149.5126, 172.05), (149.5126, 102.1591), (160.5126, 137.1045)),\n ('diameter', '%%c21.0526', (123.7633, 151.4506), 7.3569, 45),\n ('horizontal', '37.8947', (97.2783, 151.4506), (123.7633, 151.4506), (110.5208, 162.4506)),\n ('vertical', '29.4737', (123.7633, 172.05), (123.7633, 151.4506), (134.7633, 161.7503)),\n ('horizontal', '37.5', (189.7217, 172.05), (163.5126, 172.05), (176.6171, 161.05))\n]\n\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\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\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,\n angle=(0 if d[0] == \"horizontal\" else 90),\n 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,\n text=text, dimstyle=\"EZDXF\").render()\n\n doc.saveas(out_path)\n\n\nif __name__ == \"__main__\":\n out = sys.argv[1] if len(sys.argv) > 1 else \"0000_00003202_gt.dxf\"\n draw(out)\n print(\"wrote\", out)\n```"}], "images": ["images/0000_00003202.png"], "id": "0000_00003202"} {"messages": [{"role": "user", "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 4 circular holes, each of diameter 6.32 mm. It is extruded to a thickness of 121.52 mm."}, {"role": "assistant", "content": "```python\n#!/usr/bin/env python3\n# -*- coding: utf-8 -*-\n# Ground-truth 2D engineering drawing for part: 0005_00059509\n# Self-contained: reproduces the three-view DXF via ezdxf, NO FreeCAD needed.\n# Coordinates are A4 page millimetres (scale=0.4338228571428711, page=[297.0, 210.0]).\n# visible edges -> solid (layer OUTLINE); hidden edges -> dashed (layer HIDDEN)\n# dimensions -> real movable DIMENSION entities (text = true mm value)\n# Run: python 0005_00059509_gt.py [out.dxf]\nimport sys\nimport ezdxf\n\nSCALE = 0.4338228571428711\nPAGE = [297.0, 210.0]\n\nVISIBLE_SEGMENTS = [\n (131.832293, 172.050043, 131.832293, 128.667757),\n (131.832293, 128.667757, 88.450007, 128.667757),\n (88.450007, 128.667757, 88.450007, 172.050043),\n (88.450007, 172.050043, 131.832293, 172.050043),\n (131.832293, 61.950043, 131.832293, 114.667757),\n (131.832293, 114.667757, 88.450007, 114.667757),\n (88.450007, 61.950043, 88.450007, 114.667757),\n (131.832293, 61.950043, 88.450007, 61.950043),\n (145.832293, 128.667757, 198.550007, 128.667757),\n (198.550007, 128.667757, 198.550007, 172.050043),\n (145.832293, 172.050043, 198.550007, 172.050043),\n (145.832293, 128.667757, 145.832293, 172.050043)\n]\nVISIBLE_CIRCLES = [\n (93.016564, 167.483486, 1.369967),\n (93.016564, 133.234314, 1.369967),\n (127.265736, 167.483486, 1.369967),\n (127.265736, 133.234314, 1.369967)\n]\nVISIBLE_ARCS = [\n\n]\nHIDDEN_SEGMENTS = [\n (94.3865, 114.6677, 94.3865, 61.95),\n (128.6357, 114.6677, 128.6357, 61.95),\n (91.6466, 61.95, 91.6466, 114.6677),\n (125.8958, 61.95, 125.8958, 114.6677),\n (198.55, 134.6042, 145.8323, 134.6042),\n (198.55, 131.8643, 145.8323, 131.8643),\n (198.55, 168.8534, 145.8323, 168.8534),\n (198.55, 166.1135, 145.8323, 166.1135)\n]\n# (orient, text, p1, p2, base) for linear; (orient, text, center, radius, angle) for diameter\nDIMENSIONS = [\n ('horizontal', '100', (131.8323, 172.05), (88.45, 172.05), (110.1411, 161.05)),\n ('vertical', '100', (131.8323, 128.6677), (131.8323, 172.05), (120.8323, 150.3589)),\n ('diameter', '%%c6.3158', (93.0166, 133.2343), 1.37, 45),\n ('horizontal', '10.5263', (88.45, 133.2343), (93.0166, 133.2343), (90.7333, 144.2343)),\n ('vertical', '10.5263', (93.0166, 128.6677), (93.0166, 133.2343), (82.0166, 130.951)),\n ('diameter', '%%c6.3158', (93.0166, 167.4835), 1.37, 45),\n ('horizontal', '10.5263', (88.45, 167.4835), (93.0166, 167.4835), (90.7333, 178.4835)),\n ('vertical', '89.4737', (93.0166, 128.6677), (93.0166, 167.4835), (82.0166, 148.0756)),\n ('diameter', '%%c6.3158', (127.2657, 133.2343), 1.37, 45),\n ('horizontal', '89.4737', (88.45, 133.2343), (127.2657, 133.2343), (107.8579, 144.2343)),\n ('vertical', '10.5263', (127.2657, 128.6677), (127.2657, 133.2343), (116.2657, 130.951)),\n ('diameter', '%%c6.3158', (127.2657, 167.4835), 1.37, 45),\n ('horizontal', '89.4737', (88.45, 167.4835), (127.2657, 167.4835), (107.8579, 178.4835)),\n ('vertical', '89.4737', (127.2657, 128.6677), (127.2657, 167.4835), (116.2657, 148.0756)),\n ('horizontal', '121.519', (145.8323, 128.6677), (198.55, 128.6677), (172.1911, 139.6677))\n]\n\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\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\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,\n angle=(0 if d[0] == \"horizontal\" else 90),\n 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,\n text=text, dimstyle=\"EZDXF\").render()\n\n doc.saveas(out_path)\n\n\nif __name__ == \"__main__\":\n out = sys.argv[1] if len(sys.argv) > 1 else \"0005_00059509_gt.dxf\"\n draw(out)\n print(\"wrote\", out)\n```"}], "images": ["images/0005_00059509.png"], "id": "0005_00059509"} {"messages": [{"role": "user", "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 5 circular holes (diameters 12.63, 90.53 mm). It is extruded to a thickness of 7.89 mm."}, {"role": "assistant", "content": "```python\n#!/usr/bin/env python3\n# -*- coding: utf-8 -*-\n# Ground-truth 2D engineering drawing for part: 0008_00088899\n# Self-contained: reproduces the three-view DXF via ezdxf, NO FreeCAD needed.\n# Coordinates are A4 page millimetres (scale=0.8906829268292704, page=[297.0, 210.0]).\n# visible edges -> solid (layer OUTLINE); hidden edges -> dashed (layer HIDDEN)\n# dimensions -> real movable DIMENSION entities (text = true mm value)\n# Run: python 0008_00088899_gt.py [out.dxf]\nimport sys\nimport ezdxf\n\nSCALE = 0.8906829268292704\nPAGE = [297.0, 210.0]\n\nVISIBLE_SEGMENTS = [\n (177.518266, 82.981673, 177.518266, 172.049966),\n (177.518266, 172.049966, 88.449973, 172.049966),\n (88.449973, 172.049966, 88.449973, 82.981673),\n (88.449973, 82.981673, 177.518266, 82.981673),\n (177.518266, 68.981673, 177.518266, 61.949966),\n (177.518266, 61.949966, 88.449973, 61.949966),\n (88.449973, 68.981673, 88.449973, 61.949966),\n (177.518266, 68.981673, 88.449973, 68.981673),\n (191.518266, 172.049966, 198.549973, 172.049966),\n (198.549973, 172.049966, 198.549973, 82.981673),\n (191.518266, 82.981673, 198.549973, 82.981673),\n (191.518266, 172.049966, 191.518266, 82.981673)\n]\nVISIBLE_CIRCLES = [\n (97.825583, 92.357283, 5.625366),\n (97.825583, 163.611917, 5.625366),\n (133.4529, 127.9846, 40.315122),\n (169.080217, 92.357283, 5.625366),\n (169.080217, 163.611917, 5.625366)\n]\nVISIBLE_ARCS = [\n\n]\nHIDDEN_SEGMENTS = [\n (103.451, 68.9817, 103.451, 61.95),\n (173.768, 68.9817, 173.768, 61.95),\n (174.7056, 68.9817, 174.7056, 61.95),\n (92.2002, 61.95, 92.2002, 68.9817),\n (93.1378, 61.95, 93.1378, 68.9817),\n (163.4549, 61.95, 163.4549, 68.9817),\n (198.55, 97.9827, 191.5183, 97.9827),\n (198.55, 86.732, 191.5183, 86.732),\n (198.55, 169.2373, 191.5183, 169.2373),\n (198.55, 157.9866, 191.5183, 157.9866),\n (198.55, 168.2998, 191.5183, 168.2998),\n (198.55, 87.6695, 191.5183, 87.6695)\n]\n# (orient, text, p1, p2, base) for linear; (orient, text, center, radius, angle) for diameter\nDIMENSIONS = [\n ('horizontal', '100', (177.5183, 172.05), (88.45, 172.05), (132.9841, 161.05)),\n ('vertical', '100', (177.5183, 82.9817), (177.5183, 172.05), (166.5183, 127.5159)),\n ('diameter', '%%c12.6316', (97.8256, 92.3573), 5.6254, 45),\n ('horizontal', '10.5263', (88.45, 92.3573), (97.8256, 92.3573), (93.1378, 103.3573)),\n ('vertical', '10.5263', (97.8256, 82.9817), (97.8256, 92.3573), (86.8256, 87.6695)),\n ('diameter', '%%c12.6316', (97.8256, 163.6119), 5.6254, 45),\n ('horizontal', '10.5263', (88.45, 163.6119), (97.8256, 163.6119), (93.1378, 174.6119)),\n ('vertical', '90.5263', (97.8256, 82.9817), (97.8256, 163.6119), (86.8256, 123.2968)),\n ('diameter', '%%c90.5263', (133.4529, 127.9846), 40.3151, 45),\n ('horizontal', '50.5263', (88.45, 127.9846), (133.4529, 127.9846), (110.9515, 138.9846)),\n ('vertical', '50.5263', (133.4529, 82.9817), (133.4529, 127.9846), (122.4529, 105.4832)),\n ('diameter', '%%c12.6316', (169.0802, 92.3573), 5.6254, 45),\n ('horizontal', '90.5263', (88.45, 92.3573), (169.0802, 92.3573), (128.7651, 103.3573)),\n ('vertical', '10.5263', (169.0802, 82.9817), (169.0802, 92.3573), (158.0802, 87.6695)),\n ('diameter', '%%c12.6316', (169.0802, 163.6119), 5.6254, 45),\n ('horizontal', '90.5263', (88.45, 163.6119), (169.0802, 163.6119), (128.7651, 174.6119)),\n ('vertical', '90.5263', (169.0802, 82.9817), (169.0802, 163.6119), (158.0802, 123.2968)),\n ('horizontal', '7.8947', (191.5183, 82.9817), (198.55, 82.9817), (195.0341, 93.9817))\n]\n\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\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\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,\n angle=(0 if d[0] == \"horizontal\" else 90),\n 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,\n text=text, dimstyle=\"EZDXF\").render()\n\n doc.saveas(out_path)\n\n\nif __name__ == \"__main__\":\n out = sys.argv[1] if len(sys.argv) > 1 else \"0008_00088899_gt.dxf\"\n draw(out)\n print(\"wrote\", out)\n```"}], "images": ["images/0008_00088899.png"], "id": "0008_00088899"} {"messages": [{"role": "user", "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 92.63 mm tall, featuring a circular hole of diameter 46.32 mm. It is extruded to a thickness of 31.78 mm."}, {"role": "assistant", "content": "```python\n#!/usr/bin/env python3\n# -*- coding: utf-8 -*-\n# Ground-truth 2D engineering drawing for part: 0011_00112474\n# Self-contained: reproduces the three-view DXF via ezdxf, NO FreeCAD needed.\n# Coordinates are A4 page millimetres (scale=0.7628032786885736, page=[297.0, 210.0]).\n# visible edges -> solid (layer OUTLINE); hidden edges -> dashed (layer HIDDEN)\n# dimensions -> real movable DIMENSION entities (text = true mm value)\n# Run: python 0011_00112474_gt.py [out.dxf]\nimport sys\nimport ezdxf\n\nSCALE = 0.7628032786885736\nPAGE = [297.0, 210.0]\n\nVISIBLE_SEGMENTS = [\n (162.518139, 100.792264, 162.518139, 171.451936),\n (162.518139, 171.451936, 86.237811, 171.451936),\n (86.237811, 171.451936, 86.237811, 100.792264),\n (86.237811, 100.792264, 162.518139, 100.792264),\n (162.518139, 86.792264, 162.518139, 62.548129),\n (86.237811, 86.792264, 86.237811, 62.548129),\n (86.237811, 62.548129, 162.518139, 62.548129),\n (86.237811, 86.792264, 162.518139, 86.792264),\n (200.762275, 171.451936, 176.518139, 171.451936),\n (176.518139, 171.451936, 176.518139, 100.792264),\n (200.762275, 100.792264, 176.518139, 100.792264),\n (200.762275, 171.451936, 200.762275, 100.792264)\n]\nVISIBLE_CIRCLES = [\n (123.9765, 136.1221, 17.664918)\n]\nVISIBLE_ARCS = [\n\n]\nHIDDEN_SEGMENTS = [\n (141.6414, 62.5481, 141.6414, 86.7922),\n (106.3115, 86.7922, 106.3115, 62.5481),\n (176.5181, 118.4571, 200.7622, 118.4571),\n (176.5181, 153.787, 200.7622, 153.787)\n]\n# (orient, text, p1, p2, base) for linear; (orient, text, center, radius, angle) for diameter\nDIMENSIONS = [\n ('horizontal', '100', (162.5181, 100.7922), (86.2378, 100.7922), (124.3779, 89.7922)),\n ('vertical', '92.6316', (162.5181, 171.4519), (162.5181, 100.7922), (173.5181, 136.1221)),\n ('diameter', '%%c46.3158', (123.9765, 136.1221), 17.6649, 45),\n ('horizontal', '49.4737', (86.2378, 136.1221), (123.9765, 136.1221), (105.1071, 147.1221)),\n ('vertical', '46.3158', (123.9765, 171.4519), (123.9765, 136.1221), (134.9765, 153.787)),\n ('horizontal', '31.7829', (200.7622, 171.4519), (176.5181, 171.4519), (188.6402, 160.4519))\n]\n\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\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\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,\n angle=(0 if d[0] == \"horizontal\" else 90),\n 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,\n text=text, dimstyle=\"EZDXF\").render()\n\n doc.saveas(out_path)\n\n\nif __name__ == \"__main__\":\n out = sys.argv[1] if len(sys.argv) > 1 else \"0011_00112474_gt.dxf\"\n draw(out)\n print(\"wrote\", out)\n```"}], "images": ["images/0011_00112474.png"], "id": "0011_00112474"} {"messages": [{"role": "user", "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 10.53 mm. It is extruded to a thickness of 28.13 mm."}, {"role": "assistant", "content": "```python\n#!/usr/bin/env python3\n# -*- coding: utf-8 -*-\n# Ground-truth 2D engineering drawing for part: 0014_00149881\n# Self-contained: reproduces the three-view DXF via ezdxf, NO FreeCAD needed.\n# Coordinates are A4 page millimetres (scale=0.7500487804878049, page=[297.0, 210.0]).\n# visible edges -> solid (layer OUTLINE); hidden edges -> dashed (layer HIDDEN)\n# dimensions -> real movable DIMENSION entities (text = true mm value)\n# Run: python 0014_00149881_gt.py [out.dxf]\nimport sys\nimport ezdxf\n\nSCALE = 0.7500487804878049\nPAGE = [297.0, 210.0]\n\nVISIBLE_SEGMENTS = [\n (138.584801, 97.045111, 138.584801, 172.049989),\n (138.584801, 172.049989, 113.319999, 172.049989),\n (113.319999, 172.049989, 113.319999, 97.045111),\n (113.319999, 97.045111, 138.584801, 97.045111),\n (138.584801, 83.045111, 138.584801, 61.949989),\n (138.584801, 61.949989, 113.319999, 61.949989),\n (113.319999, 83.045111, 113.319999, 61.949989),\n (138.584801, 83.045111, 113.319999, 83.045111),\n (152.584801, 172.049989, 173.679922, 172.049989),\n (173.679922, 172.049989, 173.679922, 97.045111),\n (152.584801, 97.045111, 173.679922, 97.045111),\n (152.584801, 172.049989, 152.584801, 97.045111)\n]\nVISIBLE_CIRCLES = [\n (125.9524, 125.468012, 3.947625),\n (125.9524, 162.575688, 3.947625)\n]\nVISIBLE_ARCS = [\n\n]\nHIDDEN_SEGMENTS = [\n (129.9001, 83.0451, 129.9001, 61.95),\n (122.0048, 61.95, 122.0048, 83.0451),\n (173.68, 129.4156, 152.5848, 129.4156),\n (173.68, 121.5204, 152.5848, 121.5204),\n (173.68, 166.5233, 152.5848, 166.5233),\n (173.68, 158.6281, 152.5848, 158.6281)\n]\n# (orient, text, p1, p2, base) for linear; (orient, text, center, radius, angle) for diameter\nDIMENSIONS = [\n ('horizontal', '33.6842', (138.5848, 172.05), (113.32, 172.05), (125.9524, 161.05)),\n ('vertical', '100', (138.5848, 97.0451), (138.5848, 172.05), (127.5848, 134.5476)),\n ('diameter', '%%c10.5263', (125.9524, 125.468), 3.9476, 45),\n ('horizontal', '16.8421', (113.32, 125.468), (125.9524, 125.468), (119.6362, 136.468)),\n ('vertical', '37.8947', (125.9524, 97.0451), (125.9524, 125.468), (114.9524, 111.2566)),\n ('diameter', '%%c10.5263', (125.9524, 162.5757), 3.9476, 45),\n ('horizontal', '16.8421', (113.32, 162.5757), (125.9524, 162.5757), (119.6362, 173.5757)),\n ('vertical', '87.3684', (125.9524, 97.0451), (125.9524, 162.5757), (114.9524, 129.8104)),\n ('horizontal', '28.125', (152.5848, 97.0451), (173.68, 97.0451), (163.1324, 108.0451))\n]\n\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\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\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,\n angle=(0 if d[0] == \"horizontal\" else 90),\n 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,\n text=text, dimstyle=\"EZDXF\").render()\n\n doc.saveas(out_path)\n\n\nif __name__ == \"__main__\":\n out = sys.argv[1] if len(sys.argv) > 1 else \"0014_00149881_gt.dxf\"\n draw(out)\n print(\"wrote\", out)\n```"}], "images": ["images/0014_00149881.png"], "id": "0014_00149881"} {"messages": [{"role": "user", "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 4 circular holes (diameters 66.67, 457.14 mm). It is extruded to a thickness of 14.14 mm. The outline includes one or more oblique (angled) edges."}, {"role": "assistant", "content": "```python\n#!/usr/bin/env python3\n# -*- coding: utf-8 -*-\n# Ground-truth 2D engineering drawing for part: 0015_00150054\n# Self-contained: reproduces the three-view DXF via ezdxf, NO FreeCAD needed.\n# Coordinates are A4 page millimetres (scale=0.20391285127882008, page=[297.0, 210.0]).\n# visible edges -> solid (layer OUTLINE); hidden edges -> dashed (layer HIDDEN)\n# dimensions -> real movable DIMENSION entities (text = true mm value)\n# Run: python 0015_00150054_gt.py [out.dxf]\nimport sys\nimport ezdxf\nimport math\n\nSCALE = 0.20391285127882008\nPAGE = [297.0, 210.0]\n\nVISIBLE_SEGMENTS = [\n (138.942714, 153.357973, 118.551429, 153.357973),\n (148.65285, 135.879728, 138.942714, 153.357973),\n (138.942714, 118.401484, 148.65285, 135.879728),\n (118.551429, 118.401484, 138.942714, 118.401484),\n (108.841293, 135.879728, 118.551429, 118.401484),\n (118.551429, 153.357973, 108.841293, 135.879728),\n (175.84123, 75.271076, 172.928189, 75.271076),\n (172.928189, 75.271076, 170.015149, 75.271076),\n (170.015149, 75.271076, 167.102108, 75.271076),\n (167.102108, 75.271076, 164.189067, 75.271076),\n (164.189067, 75.271076, 161.276026, 75.271076),\n (161.276026, 75.271076, 158.362986, 75.271076),\n (158.362986, 75.271076, 155.449945, 75.271076),\n (155.449945, 75.271076, 152.536904, 75.271076),\n (152.536904, 75.271076, 149.623864, 75.271076),\n (149.623864, 75.271076, 146.710823, 75.271076),\n (146.710823, 75.271076, 143.797782, 75.271076),\n (143.797782, 75.271076, 140.884741, 75.271076),\n (140.884741, 75.271076, 137.971701, 75.271076),\n (137.971701, 75.271076, 135.05866, 75.271076),\n (135.05866, 75.271076, 132.145619, 75.271076),\n (132.145619, 75.271076, 129.232578, 75.271076),\n (129.232578, 75.271076, 126.319538, 75.271076),\n (126.319538, 75.271076, 123.406497, 75.271076),\n (123.406497, 75.271076, 120.493456, 75.271076),\n (120.493456, 75.271076, 117.580415, 75.271076),\n (117.580415, 75.271076, 114.667375, 75.271076),\n (114.667375, 75.271076, 111.754334, 75.271076),\n (111.754334, 75.271076, 108.841293, 75.271076),\n (108.841293, 75.271076, 105.928253, 75.271076),\n (105.928253, 75.271076, 103.015212, 75.271076),\n (103.015212, 75.271076, 100.102171, 75.271076),\n (100.102171, 75.271076, 97.18913, 75.271076),\n (97.18913, 75.271076, 94.27609, 75.271076),\n (94.27609, 75.271076, 91.363049, 75.271076),\n (91.363049, 75.271076, 88.450008, 75.271076),\n (88.450008, 75.271076, 85.536967, 75.271076),\n (85.536967, 75.271076, 82.623927, 75.271076),\n (175.84123, 75.271076, 175.84123, 72.38838),\n (175.84123, 72.38838, 172.928189, 72.38838),\n (172.928189, 72.38838, 170.015149, 72.38838),\n (170.015149, 72.38838, 167.102108, 72.38838),\n (167.102108, 72.38838, 164.189067, 72.38838),\n (164.189067, 72.38838, 161.276026, 72.38838),\n (161.276026, 72.38838, 158.362986, 72.38838),\n (158.362986, 72.38838, 155.449945, 72.38838),\n (155.449945, 72.38838, 152.536904, 72.38838),\n (152.536904, 72.38838, 149.623864, 72.38838),\n (149.623864, 72.38838, 146.710823, 72.38838),\n (146.710823, 72.38838, 143.797782, 72.38838),\n (143.797782, 72.38838, 140.884741, 72.38838),\n (140.884741, 72.38838, 137.971701, 72.38838),\n (137.971701, 72.38838, 135.05866, 72.38838),\n (135.05866, 72.38838, 132.145619, 72.38838),\n (132.145619, 72.38838, 129.232578, 72.38838),\n (129.232578, 72.38838, 126.319538, 72.38838),\n (126.319538, 72.38838, 123.406497, 72.38838),\n (123.406497, 72.38838, 120.493456, 72.38838),\n (120.493456, 72.38838, 117.580415, 72.38838),\n (117.580415, 72.38838, 114.667375, 72.38838),\n (114.667375, 72.38838, 111.754334, 72.38838),\n (111.754334, 72.38838, 108.841293, 72.38838),\n (108.841293, 72.38838, 105.928253, 72.38838),\n (105.928253, 72.38838, 103.015212, 72.38838),\n (103.015212, 72.38838, 100.102171, 72.38838),\n (100.102171, 72.38838, 97.18913, 72.38838),\n (97.18913, 72.38838, 94.27609, 72.38838),\n (94.27609, 72.38838, 91.363049, 72.38838),\n (91.363049, 72.38838, 88.450008, 72.38838),\n (88.450008, 72.38838, 85.536967, 72.38838),\n (85.536967, 72.38838, 82.623927, 72.38838),\n (82.623927, 72.38838, 82.623927, 75.271076),\n (189.84123, 182.48838, 189.84123, 179.575339),\n (189.84123, 179.575339, 189.84123, 176.662299),\n (189.84123, 176.662299, 189.84123, 173.749258),\n (189.84123, 173.749258, 189.84123, 170.836217),\n (189.84123, 170.836217, 189.84123, 167.923176),\n (189.84123, 167.923176, 189.84123, 165.010136),\n (189.84123, 165.010136, 189.84123, 162.097095),\n (189.84123, 162.097095, 189.84123, 159.184054),\n (189.84123, 159.184054, 189.84123, 156.271014),\n (189.84123, 156.271014, 189.84123, 153.357973),\n (189.84123, 153.357973, 189.84123, 150.444932),\n (189.84123, 150.444932, 189.84123, 147.531891),\n (189.84123, 147.531891, 189.84123, 144.618851),\n (189.84123, 144.618851, 189.84123, 141.70581),\n (189.84123, 141.70581, 189.84123, 138.792769),\n (189.84123, 138.792769, 189.84123, 135.879728),\n (189.84123, 135.879728, 189.84123, 132.966688),\n (189.84123, 132.966688, 189.84123, 130.053647),\n (189.84123, 130.053647, 189.84123, 127.140606),\n (189.84123, 127.140606, 189.84123, 124.227565),\n (189.84123, 124.227565, 189.84123, 121.314525),\n (189.84123, 121.314525, 189.84123, 118.401484),\n (189.84123, 118.401484, 189.84123, 115.488443),\n (189.84123, 115.488443, 189.84123, 112.575403),\n (189.84123, 112.575403, 189.84123, 109.662362),\n (189.84123, 109.662362, 189.84123, 106.749321),\n (189.84123, 106.749321, 189.84123, 103.83628),\n (189.84123, 103.83628, 189.84123, 100.92324),\n (189.84123, 100.92324, 189.84123, 98.010199),\n (189.84123, 98.010199, 189.84123, 95.097158),\n (189.84123, 95.097158, 189.84123, 92.184117),\n (189.84123, 92.184117, 189.84123, 89.271077),\n (192.723927, 182.48838, 192.723927, 179.575339),\n (192.723927, 179.575339, 192.723927, 176.662299),\n (192.723927, 176.662299, 192.723927, 173.749258),\n (192.723927, 173.749258, 192.723927, 170.836217),\n (192.723927, 170.836217, 192.723927, 167.923176),\n (192.723927, 167.923176, 192.723927, 165.010136),\n (192.723927, 165.010136, 192.723927, 162.097095),\n (192.723927, 162.097095, 192.723927, 159.184054),\n (192.723927, 159.184054, 192.723927, 156.271014),\n (192.723927, 156.271014, 192.723927, 153.357973),\n (192.723927, 153.357973, 192.723927, 150.444932),\n (192.723927, 150.444932, 192.723927, 147.531891),\n (192.723927, 147.531891, 192.723927, 144.618851),\n (192.723927, 144.618851, 192.723927, 141.70581),\n (192.723927, 141.70581, 192.723927, 138.792769),\n (192.723927, 138.792769, 192.723927, 135.879728),\n (192.723927, 135.879728, 192.723927, 132.966688),\n (192.723927, 132.966688, 192.723927, 130.053647),\n (192.723927, 130.053647, 192.723927, 127.140606),\n (192.723927, 127.140606, 192.723927, 124.227565),\n (192.723927, 124.227565, 192.723927, 121.314525),\n (192.723927, 121.314525, 192.723927, 118.401484),\n (192.723927, 118.401484, 192.723927, 115.488443),\n (192.723927, 115.488443, 192.723927, 112.575403),\n (192.723927, 112.575403, 192.723927, 109.662362),\n (192.723927, 109.662362, 192.723927, 106.749321),\n (192.723927, 106.749321, 192.723927, 103.83628),\n (192.723927, 103.83628, 192.723927, 100.92324),\n (192.723927, 100.92324, 192.723927, 98.010199),\n (192.723927, 98.010199, 192.723927, 95.097158),\n (192.723927, 95.097158, 192.723927, 92.184117),\n (192.723927, 92.184117, 192.723927, 89.271077),\n (192.723927, 182.48838, 189.84123, 182.48838),\n (192.723927, 89.271077, 189.84123, 89.271077)\n]\nVISIBLE_CIRCLES = [\n (129.232578, 135.879728, 46.608652),\n (99.131157, 118.401484, 6.797095),\n (129.232578, 169.865204, 6.797095),\n (158.362986, 118.401484, 6.797095)\n]\nVISIBLE_ARCS = [\n\n]\nHIDDEN_SEGMENTS = [\n (105.9282, 75.2711, 105.9282, 72.3884),\n (138.9427, 75.2711, 138.9427, 72.3884),\n (118.5514, 75.2711, 118.5514, 72.3884),\n (148.6528, 75.2711, 148.6528, 72.3884),\n (108.8413, 75.2711, 108.8413, 72.3884),\n (136.0297, 75.2711, 136.0297, 72.3884),\n (165.1601, 75.2711, 165.1601, 72.3884),\n (92.3341, 72.3884, 92.3341, 75.2711),\n (122.4355, 72.3884, 122.4355, 75.2711),\n (151.5659, 72.3884, 151.5659, 75.2711),\n (189.8412, 153.358, 192.7239, 153.358),\n (189.8412, 135.8797, 192.7239, 135.8797),\n (189.8412, 118.4015, 192.7239, 118.4015),\n (192.7239, 125.1986, 189.8412, 125.1986),\n (192.7239, 111.6044, 189.8412, 111.6044),\n (192.7239, 176.6623, 189.8412, 176.6623),\n (192.7239, 163.0681, 189.8412, 163.0681)\n]\n# (orient, text, p1, p2, base) for linear; (orient, text, center, radius, angle) for diameter\nDIMENSIONS = [\n ('horizontal', '100', (118.5514, 118.4015), (138.9427, 118.4015), (128.7471, 129.4015)),\n ('aligned', '98.0536', (138.9427, 118.4015), (148.6528, 135.8797), (134.182, 132.4827)),\n ('aligned', '98.0536', (148.6528, 135.8797), (138.9427, 153.358), (134.182, 139.2768)),\n ('aligned', '98.0536', (118.5514, 153.358), (108.8413, 135.8797), (123.3121, 139.2768)),\n ('aligned', '98.0536', (108.8413, 135.8797), (118.5514, 118.4015), (123.3121, 132.4827)),\n ('diameter', '%%c457.143', (129.2326, 135.8797), 46.6087, 45),\n ('horizontal', '100', (108.8413, 135.8797), (129.2326, 135.8797), (119.0369, 146.8797)),\n ('vertical', '85.7143', (129.2326, 118.4015), (129.2326, 135.8797), (118.2326, 127.1406)),\n ('diameter', '%%c66.6667', (99.1311, 118.4015), 6.7971, 45),\n ('horizontal', '47.619', (108.8413, 118.4015), (99.1311, 118.4015), (103.9862, 107.4015)),\n ('diameter', '%%c66.6667', (129.2326, 169.8652), 6.7971, 45),\n ('horizontal', '100', (108.8413, 169.8652), (129.2326, 169.8652), (119.0369, 180.8652)),\n ('vertical', '252.381', (129.2326, 118.4015), (129.2326, 169.8652), (118.2326, 144.1334)),\n ('diameter', '%%c66.6667', (158.363, 118.4015), 6.7971, 45),\n ('horizontal', '242.857', (108.8413, 118.4015), (158.363, 118.4015), (133.6021, 129.4015)),\n ('horizontal', '14.1369', (189.8412, 118.4015), (192.7239, 118.4015), (191.2826, 129.4015))\n]\n\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; _ds.dxf.dimasz = 2.5\n _ds.dxf.dimexe = 1.25; _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\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\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,\n angle=(0 if d[0] == \"horizontal\" else 90),\n 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,\n 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,\n 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,\n text=text, dimstyle=\"EZDXF\").render()\n\n doc.saveas(out_path)\n\n\nif __name__ == \"__main__\":\n out = sys.argv[1] if len(sys.argv) > 1 else \"0015_00150054_gt.dxf\"\n draw(out)\n print(\"wrote\", out)\n```"}], "images": ["images/0015_00150054.png"], "id": "0015_00150054"} {"messages": [{"role": "user", "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 16.84 mm tall, featuring 2 circular holes, each of diameter 8.42 mm. It is extruded to a thickness of 2.08 mm."}, {"role": "assistant", "content": "```python\n#!/usr/bin/env python3\n# -*- coding: utf-8 -*-\n# Ground-truth 2D engineering drawing for part: 0015_00154792\n# Self-contained: reproduces the three-view DXF via ezdxf, NO FreeCAD needed.\n# Coordinates are A4 page millimetres (scale=1.2575945945945932, page=[297.0, 210.0]).\n# visible edges -> solid (layer OUTLINE); hidden edges -> dashed (layer HIDDEN)\n# dimensions -> real movable DIMENSION entities (text = true mm value)\n# Run: python 0015_00154792_gt.py [out.dxf]\nimport sys\nimport ezdxf\n\nSCALE = 1.2575945945945932\nPAGE = [297.0, 210.0]\n\nVISIBLE_SEGMENTS = [\n (198.06973, 114.71963, 198.06973, 135.90017),\n (198.06973, 135.90017, 72.31027, 135.90017),\n (72.31027, 135.90017, 72.31027, 114.71963),\n (72.31027, 114.71963, 198.06973, 114.71963),\n (198.06973, 100.71963, 198.06973, 98.099641),\n (72.31027, 100.71963, 72.31027, 98.099641),\n (72.31027, 98.099641, 198.06973, 98.099641),\n (72.31027, 100.71963, 198.06973, 100.71963),\n (214.689718, 135.90017, 212.06973, 135.90017),\n (212.06973, 135.90017, 212.06973, 114.71963),\n (214.689718, 114.71963, 212.06973, 114.71963),\n (214.689718, 135.90017, 214.689718, 114.71963)\n]\nVISIBLE_CIRCLES = [\n (80.252973, 125.3099, 5.295135),\n (190.127027, 125.3099, 5.295135)\n]\nVISIBLE_ARCS = [\n\n]\nHIDDEN_SEGMENTS = [\n (85.5481, 98.0997, 85.5481, 100.7197),\n (195.4222, 98.0997, 195.4222, 100.7197),\n (74.9578, 100.7197, 74.9578, 98.0997),\n (184.8319, 100.7197, 184.8319, 98.0997),\n (212.0697, 120.0149, 214.6897, 120.0149),\n (212.0697, 130.6051, 214.6897, 130.6051)\n]\n# (orient, text, p1, p2, base) for linear; (orient, text, center, radius, angle) for diameter\nDIMENSIONS = [\n ('horizontal', '100', (198.0697, 114.7197), (72.3103, 114.7197), (135.19, 103.7197)),\n ('vertical', '16.8421', (198.0697, 135.9003), (198.0697, 114.7197), (209.0697, 125.31)),\n ('diameter', '%%c8.4211', (80.253, 125.3099), 5.2952, 45),\n ('horizontal', '6.3158', (72.3103, 125.3099), (80.253, 125.3099), (76.2816, 136.3099)),\n ('vertical', '8.4211', (80.253, 135.9003), (80.253, 125.3099), (91.253, 130.6051)),\n ('diameter', '%%c8.4211', (190.127, 125.3099), 5.2952, 45),\n ('horizontal', '93.6842', (72.3103, 125.3099), (190.127, 125.3099), (131.2186, 136.3099)),\n ('vertical', '8.4211', (190.127, 135.9003), (190.127, 125.3099), (201.127, 130.6051)),\n ('horizontal', '2.0833', (214.6897, 135.9003), (212.0698, 135.9003), (213.3798, 124.9003))\n]\n\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\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\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,\n angle=(0 if d[0] == \"horizontal\" else 90),\n 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,\n text=text, dimstyle=\"EZDXF\").render()\n\n doc.saveas(out_path)\n\n\nif __name__ == \"__main__\":\n out = sys.argv[1] if len(sys.argv) > 1 else \"0015_00154792_gt.dxf\"\n draw(out)\n print(\"wrote\", out)\n```"}], "images": ["images/0015_00154792.png"], "id": "0015_00154792"} {"messages": [{"role": "user", "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 53.68 mm tall, featuring a circular hole of diameter 29.47 mm. It is extruded to a thickness of 19.38 mm."}, {"role": "assistant", "content": "```python\n#!/usr/bin/env python3\n# -*- coding: utf-8 -*-\n# Ground-truth 2D engineering drawing for part: 0016_00163094\n# Self-contained: reproduces the three-view DXF via ezdxf, NO FreeCAD needed.\n# Coordinates are A4 page millimetres (scale=0.956116438356188, page=[297.0, 210.0]).\n# visible edges -> solid (layer OUTLINE); hidden edges -> dashed (layer HIDDEN)\n# dimensions -> real movable DIMENSION entities (text = true mm value)\n# Run: python 0016_00163094_gt.py [out.dxf]\nimport sys\nimport ezdxf\n\nSCALE = 0.956116438356188\nPAGE = [297.0, 210.0]\n\nVISIBLE_SEGMENTS = [\n (175.041141, 158.928859, 175.041141, 107.600503),\n (175.041141, 107.600503, 79.429497, 107.600503),\n (79.429497, 107.600503, 79.429497, 158.928859),\n (79.429497, 158.928859, 175.041141, 158.928859),\n (175.041141, 75.071114, 175.041141, 93.600503),\n (79.429497, 75.071114, 79.429497, 93.600503),\n (79.429497, 93.600503, 175.041141, 93.600503),\n (79.429497, 75.071114, 175.041141, 75.071114),\n (207.570529, 107.600503, 189.041141, 107.600503),\n (189.041141, 107.600503, 189.041141, 158.928859),\n (207.570529, 158.928859, 189.041141, 158.928859),\n (207.570529, 107.600503, 207.570529, 158.928859)\n]\nVISIBLE_CIRCLES = [\n (126.7321, 133.7679, 14.090137)\n]\nVISIBLE_ARCS = [\n\n]\nHIDDEN_SEGMENTS = [\n (140.8222, 75.0711, 140.8222, 93.6005),\n (112.6419, 93.6005, 112.6419, 75.0711),\n (189.0411, 119.6778, 207.5705, 119.6778),\n (189.0411, 147.8581, 207.5705, 147.8581)\n]\n# (orient, text, p1, p2, base) for linear; (orient, text, center, radius, angle) for diameter\nDIMENSIONS = [\n ('horizontal', '100', (175.0411, 107.6005), (79.4295, 107.6005), (127.2353, 96.6005)),\n ('vertical', '53.6842', (175.0411, 158.9289), (175.0411, 107.6005), (186.0411, 133.2647)),\n ('diameter', '%%c29.4737', (126.7321, 133.7679), 14.0901, 45),\n ('horizontal', '49.4737', (79.4295, 133.7679), (126.7321, 133.7679), (103.0808, 144.7679)),\n ('vertical', '26.3158', (126.7321, 158.9289), (126.7321, 133.7679), (137.7321, 146.3484)),\n ('horizontal', '19.3798', (207.5705, 158.9289), (189.0412, 158.9289), (198.3058, 147.9289))\n]\n\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\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\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,\n angle=(0 if d[0] == \"horizontal\" else 90),\n 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,\n text=text, dimstyle=\"EZDXF\").render()\n\n doc.saveas(out_path)\n\n\nif __name__ == \"__main__\":\n out = sys.argv[1] if len(sys.argv) > 1 else \"0016_00163094_gt.dxf\"\n draw(out)\n print(\"wrote\", out)\n```"}], "images": ["images/0016_00163094.png"], "id": "0016_00163094"} {"messages": [{"role": "user", "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 44.21 mm tall, featuring 2 circular holes, each of diameter 10.53 mm. It is extruded to a thickness of 11.11 mm."}, {"role": "assistant", "content": "```python\n#!/usr/bin/env python3\n# -*- coding: utf-8 -*-\n# Ground-truth 2D engineering drawing for part: 0019_00190996\n# Self-contained: reproduces the three-view DXF via ezdxf, NO FreeCAD needed.\n# Coordinates are A4 page millimetres (scale=1.3224600000000133, page=[297.0, 210.0]).\n# visible edges -> solid (layer OUTLINE); hidden edges -> dashed (layer HIDDEN)\n# dimensions -> real movable DIMENSION entities (text = true mm value)\n# Run: python 0019_00190996_gt.py [out.dxf]\nimport sys\nimport ezdxf\n\nSCALE = 1.3224600000000133\nPAGE = [297.0, 210.0]\n\nVISIBLE_SEGMENTS = [\n (195.275979, 160.580226, 195.275979, 102.113574),\n (195.275979, 102.113574, 63.029979, 102.113574),\n (63.029979, 102.113574, 63.029979, 160.580226),\n (63.029979, 160.580226, 195.275979, 160.580226),\n (195.275979, 73.419574, 195.275979, 88.113574),\n (195.275979, 88.113574, 63.029979, 88.113574),\n (63.029979, 73.419574, 63.029979, 88.113574),\n (195.275979, 73.419574, 63.029979, 73.419574),\n (209.275979, 102.113574, 223.969979, 102.113574),\n (223.969979, 102.113574, 223.969979, 160.580226),\n (209.275979, 160.580226, 223.969979, 160.580226),\n (209.275979, 102.113574, 209.275979, 160.580226)\n]\nVISIBLE_CIRCLES = [\n (78.342674, 131.3469, 6.960316),\n (136.809326, 131.3469, 6.960316)\n]\nVISIBLE_ARCS = [\n\n]\nHIDDEN_SEGMENTS = [\n (85.303, 88.1137, 85.303, 73.4197),\n (143.7697, 88.1137, 143.7697, 73.4197),\n (71.3824, 73.4197, 71.3824, 88.1137),\n (129.849, 73.4197, 129.849, 88.1137),\n (223.97, 138.3073, 209.276, 138.3073),\n (223.97, 124.3867, 209.276, 124.3867)\n]\n# (orient, text, p1, p2, base) for linear; (orient, text, center, radius, angle) for diameter\nDIMENSIONS = [\n ('horizontal', '100', (195.276, 160.5803), (63.03, 160.5803), (129.153, 149.5803)),\n ('vertical', '44.2105', (195.276, 102.1137), (195.276, 160.5803), (184.276, 131.347)),\n ('diameter', '%%c10.5263', (78.3426, 131.3469), 6.9603, 45),\n ('horizontal', '11.5789', (63.03, 131.3469), (78.3426, 131.3469), (70.6863, 142.3469)),\n ('vertical', '22.1053', (78.3426, 102.1137), (78.3426, 131.3469), (67.3426, 116.7303)),\n ('diameter', '%%c10.5263', (136.8094, 131.3469), 6.9603, 45),\n ('horizontal', '55.7895', (63.03, 131.3469), (136.8094, 131.3469), (99.9197, 142.3469)),\n ('vertical', '22.1053', (136.8094, 102.1137), (136.8094, 131.3469), (125.8094, 116.7303)),\n ('horizontal', '11.1111', (209.276, 102.1137), (223.97, 102.1137), (216.623, 113.1137))\n]\n\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\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\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,\n angle=(0 if d[0] == \"horizontal\" else 90),\n 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,\n text=text, dimstyle=\"EZDXF\").render()\n\n doc.saveas(out_path)\n\n\nif __name__ == \"__main__\":\n out = sys.argv[1] if len(sys.argv) > 1 else \"0019_00190996_gt.dxf\"\n draw(out)\n print(\"wrote\", out)\n```"}], "images": ["images/0019_00190996.png"], "id": "0019_00190996"} {"messages": [{"role": "user", "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 a circular hole of diameter 21.05 mm. It is extruded to a thickness of 66.67 mm."}, {"role": "assistant", "content": "```python\n#!/usr/bin/env python3\n# -*- coding: utf-8 -*-\n# Ground-truth 2D engineering drawing for part: 0024_00243246\n# Self-contained: reproduces the three-view DXF via ezdxf, NO FreeCAD needed.\n# Coordinates are A4 page millimetres (scale=0.5765999999999989, page=[297.0, 210.0]).\n# visible edges -> solid (layer OUTLINE); hidden edges -> dashed (layer HIDDEN)\n# dimensions -> real movable DIMENSION entities (text = true mm value)\n# Run: python 0024_00243246_gt.py [out.dxf]\nimport sys\nimport ezdxf\n\nSCALE = 0.5765999999999989\nPAGE = [297.0, 210.0]\n\nVISIBLE_SEGMENTS = [\n (126.991158, 114.390026, 126.991158, 172.050026),\n (126.991158, 172.050026, 107.568842, 172.050026),\n (107.568842, 172.050026, 107.568842, 114.390026),\n (107.568842, 114.390026, 126.991158, 114.390026),\n (126.991158, 100.390026, 126.991158, 61.950026),\n (126.991158, 61.950026, 107.568842, 61.950026),\n (107.568842, 100.390026, 107.568842, 61.950026),\n (126.991158, 100.390026, 107.568842, 100.390026),\n (140.991158, 172.050026, 179.431158, 172.050026),\n (179.431158, 172.050026, 179.431158, 114.390026),\n (140.991158, 114.390026, 179.431158, 114.390026),\n (140.991158, 172.050026, 140.991158, 114.390026)\n]\nVISIBLE_CIRCLES = [\n (117.28, 143.5235, 6.069474)\n]\nVISIBLE_ARCS = [\n\n]\nHIDDEN_SEGMENTS = [\n (123.3495, 100.39, 123.3495, 61.95),\n (111.2105, 61.95, 111.2105, 100.39),\n (179.4312, 149.5929, 140.9912, 149.5929),\n (179.4312, 137.454, 140.9912, 137.454)\n]\n# (orient, text, p1, p2, base) for linear; (orient, text, center, radius, angle) for diameter\nDIMENSIONS = [\n ('horizontal', '33.6842', (126.9911, 172.05), (107.5688, 172.05), (117.28, 161.05)),\n ('vertical', '100', (126.9911, 114.39), (126.9911, 172.05), (115.9911, 143.22)),\n ('diameter', '%%c21.0526', (117.28, 143.5235), 6.0695, 45),\n ('horizontal', '16.8421', (107.5688, 143.5235), (117.28, 143.5235), (112.4244, 154.5235)),\n ('vertical', '50.5263', (117.28, 114.39), (117.28, 143.5235), (106.28, 128.9567)),\n ('horizontal', '66.6667', (140.9912, 114.39), (179.4312, 114.39), (160.2112, 125.39))\n]\n\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\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\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,\n angle=(0 if d[0] == \"horizontal\" else 90),\n 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,\n text=text, dimstyle=\"EZDXF\").render()\n\n doc.saveas(out_path)\n\n\nif __name__ == \"__main__\":\n out = sys.argv[1] if len(sys.argv) > 1 else \"0024_00243246_gt.dxf\"\n draw(out)\n print(\"wrote\", out)\n```"}], "images": ["images/0024_00243246.png"], "id": "0024_00243246"} {"messages": [{"role": "user", "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, featuring 2 circular holes, each of diameter 8.42 mm and a rectangular cutout 16.84 x 12.63 mm. It is extruded to a thickness of 3.26 mm."}, {"role": "assistant", "content": "```python\n#!/usr/bin/env python3\n# -*- coding: utf-8 -*-\n# Ground-truth 2D engineering drawing for part: 0028_00289927\n# Self-contained: reproduces the three-view DXF via ezdxf, NO FreeCAD needed.\n# Coordinates are A4 page millimetres (scale=0.9970928571429084, page=[297.0, 210.0]).\n# visible edges -> solid (layer OUTLINE); hidden edges -> dashed (layer HIDDEN)\n# dimensions -> real movable DIMENSION entities (text = true mm value)\n# Run: python 0028_00289927_gt.py [out.dxf]\nimport sys\nimport ezdxf\n\nSCALE = 0.9970928571429084\nPAGE = [297.0, 210.0]\n\nVISIBLE_SEGMENTS = [\n (184.728986, 149.241007, 184.728986, 102.010293),\n (184.728986, 102.010293, 85.0197, 102.010293),\n (85.0197, 102.010293, 85.0197, 149.241007),\n (85.0197, 149.241007, 184.728986, 149.241007),\n (134.349557, 110.406864, 134.349557, 123.001721),\n (151.1427, 110.406864, 134.349557, 110.406864),\n (151.1427, 123.001721, 151.1427, 110.406864),\n (134.349557, 123.001721, 151.1427, 123.001721),\n (184.728986, 84.758903, 184.728986, 88.010293),\n (85.0197, 84.758903, 85.0197, 88.010293),\n (85.0197, 88.010293, 184.728986, 88.010293),\n (85.0197, 84.758903, 184.728986, 84.758903),\n (201.980375, 102.010293, 198.728986, 102.010293),\n (198.728986, 102.010293, 198.728986, 149.241007),\n (201.980375, 149.241007, 198.728986, 149.241007),\n (201.980375, 102.010293, 201.980375, 149.241007)\n]\nVISIBLE_CIRCLES = [\n (99.7137, 134.547007, 4.198286),\n (99.7137, 116.704293, 4.198286)\n]\nVISIBLE_ARCS = [\n\n]\nHIDDEN_SEGMENTS = [\n (103.9119, 84.7589, 103.9119, 88.0103),\n (134.3495, 84.7589, 134.3495, 88.0103),\n (151.1427, 84.7589, 151.1427, 88.0103),\n (95.5154, 88.0103, 95.5154, 84.7589),\n (201.9803, 110.4069, 198.7289, 110.4069),\n (201.9803, 123.0018, 198.7289, 123.0018),\n (198.7289, 130.3488, 201.9803, 130.3488),\n (198.7289, 138.7453, 201.9803, 138.7453),\n (198.7289, 112.5061, 201.9803, 112.5061),\n (198.7289, 120.9026, 201.9803, 120.9026)\n]\n# (orient, text, p1, p2, base) for linear; (orient, text, center, radius, angle) for diameter\nDIMENSIONS = [\n ('horizontal', '100', (184.7289, 102.0104), (85.0196, 102.0104), (134.8743, 91.0104)),\n ('vertical', '47.3684', (184.7289, 149.2411), (184.7289, 102.0104), (195.7289, 125.6257)),\n ('diameter', '%%c8.4211', (99.7137, 134.547), 4.1983, 45),\n ('horizontal', '14.7368', (85.0196, 134.547), (99.7137, 134.547), (92.3667, 145.547)),\n ('vertical', '14.7368', (99.7137, 149.2411), (99.7137, 134.547), (110.7137, 141.894)),\n ('diameter', '%%c8.4211', (99.7137, 116.7043), 4.1983, 45),\n ('horizontal', '14.7368', (85.0196, 116.7043), (99.7137, 116.7043), (92.3667, 127.7043)),\n ('vertical', '32.6316', (99.7137, 149.2411), (99.7137, 116.7043), (110.7137, 132.9727)),\n ('horizontal', '16.8421', (134.3495, 123.0018), (151.1426, 123.0018), (142.7461, 134.0018)),\n ('vertical', '12.6316', (134.3495, 123.0018), (134.3495, 110.4069), (145.3495, 116.7043)),\n ('horizontal', '49.4737', (85.0196, 123.0018), (134.3495, 123.0018), (109.6846, 134.0018)),\n ('vertical', '26.3158', (134.3495, 149.2411), (134.3495, 123.0018), (145.3495, 136.1214)),\n ('horizontal', '3.2609', (201.9803, 149.2411), (198.7289, 149.2411), (200.3546, 138.2411))\n]\n\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\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\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,\n angle=(0 if d[0] == \"horizontal\" else 90),\n 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,\n text=text, dimstyle=\"EZDXF\").render()\n\n doc.saveas(out_path)\n\n\nif __name__ == \"__main__\":\n out = sys.argv[1] if len(sys.argv) > 1 else \"0028_00289927_gt.dxf\"\n draw(out)\n print(\"wrote\", out)\n```"}], "images": ["images/0028_00289927.png"], "id": "0028_00289927"} {"messages": [{"role": "user", "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 96.83 mm. It is extruded to a thickness of 80.2 mm. The outline includes one or more oblique (angled) edges."}, {"role": "assistant", "content": "```python\n#!/usr/bin/env python3\n# -*- coding: utf-8 -*-\n# Ground-truth 2D engineering drawing for part: 0029_00295417\n# Self-contained: reproduces the three-view DXF via ezdxf, NO FreeCAD needed.\n# Coordinates are A4 page millimetres (scale=0.380145563669334, page=[297.0, 210.0]).\n# visible edges -> solid (layer OUTLINE); hidden edges -> dashed (layer HIDDEN)\n# dimensions -> real movable DIMENSION entities (text = true mm value)\n# Run: python 0029_00295417_gt.py [out.dxf]\nimport sys\nimport ezdxf\nimport math\n\nSCALE = 0.380145563669334\nPAGE = [297.0, 210.0]\n\nVISIBLE_SEGMENTS = [\n (102.453037, 172.050012, 140.06119, 172.050012),\n (140.06119, 172.050012, 159.265353, 139.2429),\n (159.265353, 139.2429, 140.06119, 106.435788),\n (140.06119, 106.435788, 102.453037, 106.435788),\n (102.453037, 106.435788, 83.248874, 139.2429),\n (83.248874, 139.2429, 102.453037, 172.050012),\n (159.265353, 61.950012, 159.265353, 92.435788),\n (159.265353, 92.435788, 140.06119, 92.435788),\n (140.06119, 61.950012, 140.06119, 92.435788),\n (159.265353, 61.950012, 140.06119, 61.950012),\n (140.06119, 92.435788, 102.453037, 92.435788),\n (102.453037, 61.950012, 102.453037, 92.435788),\n (140.06119, 61.950012, 102.453037, 61.950012),\n (102.453037, 92.435788, 83.248874, 92.435788),\n (83.248874, 61.950012, 83.248874, 92.435788),\n (102.453037, 61.950012, 83.248874, 61.950012),\n (173.265353, 172.050012, 203.751129, 172.050012),\n (173.265353, 106.435788, 203.751129, 106.435788),\n (203.751129, 106.435788, 203.751129, 139.2429),\n (173.265353, 139.2429, 203.751129, 139.2429),\n (173.265353, 106.435788, 173.265353, 139.2429),\n (203.751129, 139.2429, 203.751129, 172.050012),\n (173.265353, 139.2429, 173.265353, 172.050012)\n]\nVISIBLE_CIRCLES = [\n (121.6572, 139.2429, 18.40399)\n]\nVISIBLE_ARCS = [\n\n]\nHIDDEN_SEGMENTS = [\n (103.2532, 61.95, 103.2532, 92.4358),\n (203.7511, 157.6469, 173.2654, 157.6469),\n (203.7511, 120.8389, 173.2654, 120.8389)\n]\n# (orient, text, p1, p2, base) for linear; (orient, text, center, radius, angle) for diameter\nDIMENSIONS = [\n ('horizontal', '98.9309', (102.453, 106.4358), (140.0612, 106.4358), (121.2571, 117.4358)),\n ('aligned', '100', (140.0612, 106.4358), (159.2654, 139.2429), (140.1701, 128.3963)),\n ('aligned', '100', (159.2654, 139.2429), (140.0612, 172.05), (140.1701, 150.0895)),\n ('aligned', '100', (102.453, 172.05), (83.2489, 139.2429), (102.3441, 150.0895)),\n ('aligned', '100', (83.2489, 139.2429), (102.453, 106.4358), (102.3441, 128.3963)),\n ('diameter', '%%c96.826', (121.6572, 139.2429), 18.404, 45),\n ('horizontal', '101.036', (83.2489, 139.2429), (121.6572, 139.2429), (102.453, 150.2429)),\n ('vertical', '86.3014', (121.6572, 106.4358), (121.6572, 139.2429), (110.6572, 122.8393)),\n ('horizontal', '80.195', (173.2654, 106.4358), (203.7511, 106.4358), (188.5082, 117.4358))\n]\n\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; _ds.dxf.dimasz = 2.5\n _ds.dxf.dimexe = 1.25; _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\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\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,\n angle=(0 if d[0] == \"horizontal\" else 90),\n 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,\n 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,\n 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,\n text=text, dimstyle=\"EZDXF\").render()\n\n doc.saveas(out_path)\n\n\nif __name__ == \"__main__\":\n out = sys.argv[1] if len(sys.argv) > 1 else \"0029_00295417_gt.dxf\"\n draw(out)\n print(\"wrote\", out)\n```"}], "images": ["images/0029_00295417.png"], "id": "0029_00295417"} {"messages": [{"role": "user", "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 25.26 mm. It is extruded to a thickness of 19.79 mm."}, {"role": "assistant", "content": "```python\n#!/usr/bin/env python3\n# -*- coding: utf-8 -*-\n# Ground-truth 2D engineering drawing for part: 0030_00307964\n# Self-contained: reproduces the three-view DXF via ezdxf, NO FreeCAD needed.\n# Coordinates are A4 page millimetres (scale=0.6884776119403295, page=[297.0, 210.0]).\n# visible edges -> solid (layer OUTLINE); hidden edges -> dashed (layer HIDDEN)\n# dimensions -> real movable DIMENSION entities (text = true mm value)\n# Run: python 0030_00307964_gt.py [out.dxf]\nimport sys\nimport ezdxf\n\nSCALE = 0.6884776119403295\nPAGE = [297.0, 210.0]\n\nVISIBLE_SEGMENTS = [\n (157.297724, 172.050037, 157.297724, 103.202276),\n (88.449963, 172.050037, 157.297724, 172.050037),\n (157.297724, 103.202276, 88.449963, 103.202276),\n (88.449963, 103.202276, 88.449963, 172.050037),\n (157.297724, 89.202276, 157.297724, 61.950037),\n (88.449963, 89.202276, 88.449963, 61.950037),\n (88.449963, 89.202276, 157.297724, 89.202276),\n (88.449963, 61.950037, 157.297724, 61.950037),\n (171.297724, 172.050037, 198.549963, 172.050037),\n (198.549963, 103.202276, 171.297724, 103.202276),\n (171.297724, 103.202276, 171.297724, 172.050037),\n (198.549963, 103.202276, 198.549963, 172.050037)\n]\nVISIBLE_CIRCLES = [\n (123.2362, 137.2638, 8.696559)\n]\nVISIBLE_ARCS = [\n\n]\nHIDDEN_SEGMENTS = [\n (131.9328, 89.2022, 131.9328, 61.95),\n (114.5397, 89.2022, 114.5397, 61.95),\n (171.2978, 128.5672, 198.55, 128.5672),\n (171.2978, 145.9603, 198.55, 145.9603)\n]\n# (orient, text, p1, p2, base) for linear; (orient, text, center, radius, angle) for diameter\nDIMENSIONS = [\n ('horizontal', '100', (157.2978, 103.2022), (88.45, 103.2022), (122.8739, 92.2022)),\n ('vertical', '100', (157.2978, 172.05), (157.2978, 103.2022), (168.2978, 137.6261)),\n ('diameter', '%%c25.2632', (123.2362, 137.2638), 8.6966, 45),\n ('horizontal', '50.5263', (88.45, 137.2638), (123.2362, 137.2638), (105.8431, 148.2638)),\n ('vertical', '50.5263', (123.2362, 172.05), (123.2362, 137.2638), (134.2362, 154.6569)),\n ('horizontal', '39.5833', (198.55, 172.05), (171.2977, 172.05), (184.9239, 161.05))\n]\n\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\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\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,\n angle=(0 if d[0] == \"horizontal\" else 90),\n 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,\n text=text, dimstyle=\"EZDXF\").render()\n\n doc.saveas(out_path)\n\n\nif __name__ == \"__main__\":\n out = sys.argv[1] if len(sys.argv) > 1 else \"0030_00307964_gt.dxf\"\n draw(out)\n print(\"wrote\", out)\n```"}], "images": ["images/0030_00307964.png"], "id": "0030_00307964"} {"messages": [{"role": "user", "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 89.47 mm tall, featuring 2 circular holes, each of diameter 10.53 mm. It is extruded to a thickness of 7.81 mm."}, {"role": "assistant", "content": "```python\n#!/usr/bin/env python3\n# -*- coding: utf-8 -*-\n# Ground-truth 2D engineering drawing for part: 0031_00319922\n# Self-contained: reproduces the three-view DXF via ezdxf, NO FreeCAD needed.\n# Coordinates are A4 page millimetres (scale=0.9878072696534878, page=[297.0, 210.0]).\n# visible edges -> solid (layer OUTLINE); hidden edges -> dashed (layer HIDDEN)\n# dimensions -> real movable DIMENSION entities (text = true mm value)\n# Run: python 0031_00319922_gt.py [out.dxf]\nimport sys\nimport ezdxf\n\nSCALE = 0.9878072696534878\nPAGE = [297.0, 210.0]\n\nVISIBLE_SEGMENTS = [\n (182.031763, 83.667216, 182.031763, 172.049971),\n (182.031763, 172.049971, 83.251037, 172.049971),\n (83.251037, 172.049971, 83.251037, 83.667216),\n (83.251037, 83.667216, 182.031763, 83.667216),\n (182.031763, 69.667216, 182.031763, 61.949971),\n (182.031763, 61.949971, 83.251037, 61.949971),\n (83.251037, 69.667216, 83.251037, 61.949971),\n (182.031763, 69.667216, 83.251037, 69.667216),\n (196.031763, 172.049971, 203.749008, 172.049971),\n (203.749008, 172.049971, 203.749008, 83.667216),\n (196.031763, 83.667216, 203.749008, 83.667216),\n (196.031763, 172.049971, 196.031763, 83.667216)\n]\nVISIBLE_CIRCLES = [\n (93.649008, 161.652, 5.198986),\n (171.633792, 161.652, 5.198986)\n]\nVISIBLE_ARCS = [\n\n]\nHIDDEN_SEGMENTS = [\n (98.848, 69.6672, 98.848, 61.95),\n (176.8328, 69.6672, 176.8328, 61.95),\n (88.45, 61.95, 88.45, 69.6672),\n (166.4348, 61.95, 166.4348, 69.6672),\n (203.749, 166.851, 196.0317, 166.851),\n (203.749, 156.453, 196.0317, 156.453)\n]\n# (orient, text, p1, p2, base) for linear; (orient, text, center, radius, angle) for diameter\nDIMENSIONS = [\n ('horizontal', '100', (182.0317, 172.05), (83.251, 172.05), (132.6414, 161.05)),\n ('vertical', '89.4737', (182.0317, 83.6672), (182.0317, 172.05), (171.0317, 127.8586)),\n ('diameter', '%%c10.5263', (93.649, 161.652), 5.199, 45),\n ('horizontal', '10.5263', (83.251, 161.652), (93.649, 161.652), (88.45, 172.652)),\n ('vertical', '78.9474', (93.649, 83.6672), (93.649, 161.652), (82.649, 122.6596)),\n ('diameter', '%%c10.5263', (171.6338, 161.652), 5.199, 45),\n ('horizontal', '89.4737', (83.251, 161.652), (171.6338, 161.652), (127.4424, 172.652)),\n ('vertical', '78.9474', (171.6338, 83.6672), (171.6338, 161.652), (160.6338, 122.6596)),\n ('horizontal', '7.8125', (196.0317, 83.6672), (203.749, 83.6672), (199.8904, 94.6672))\n]\n\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\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\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,\n angle=(0 if d[0] == \"horizontal\" else 90),\n 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,\n text=text, dimstyle=\"EZDXF\").render()\n\n doc.saveas(out_path)\n\n\nif __name__ == \"__main__\":\n out = sys.argv[1] if len(sys.argv) > 1 else \"0031_00319922_gt.dxf\"\n draw(out)\n print(\"wrote\", out)\n```"}], "images": ["images/0031_00319922.png"], "id": "0031_00319922"} {"messages": [{"role": "user", "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 2 circular holes, each of diameter 6.32 mm. It is extruded to a thickness of 6.25 mm."}, {"role": "assistant", "content": "```python\n#!/usr/bin/env python3\n# -*- coding: utf-8 -*-\n# Ground-truth 2D engineering drawing for part: 0034_00341325\n# Self-contained: reproduces the three-view DXF via ezdxf, NO FreeCAD needed.\n# Coordinates are A4 page millimetres (scale=0.904470588235294, page=[297.0, 210.0]).\n# visible edges -> solid (layer OUTLINE); hidden edges -> dashed (layer HIDDEN)\n# dimensions -> real movable DIMENSION entities (text = true mm value)\n# Run: python 0034_00341325_gt.py [out.dxf]\nimport sys\nimport ezdxf\n\nSCALE = 0.904470588235294\nPAGE = [297.0, 210.0]\n\nVISIBLE_SEGMENTS = [\n (178.897029, 81.602936, 178.897029, 172.049994),\n (178.897029, 172.049994, 88.449971, 172.049994),\n (88.449971, 172.049994, 88.449971, 81.602936),\n (88.449971, 81.602936, 178.897029, 81.602936),\n (178.897029, 67.602936, 178.897029, 61.949994),\n (178.897029, 61.949994, 88.449971, 61.949994),\n (88.449971, 67.602936, 88.449971, 61.949994),\n (178.897029, 67.602936, 88.449971, 67.602936),\n (192.897029, 172.049994, 198.549971, 172.049994),\n (198.549971, 172.049994, 198.549971, 81.602936),\n (192.897029, 81.602936, 198.549971, 81.602936),\n (192.897029, 172.049994, 192.897029, 81.602936)\n]\nVISIBLE_CIRCLES = [\n (122.724646, 164.4334, 2.856223),\n (144.622354, 164.4334, 2.856223)\n]\nVISIBLE_ARCS = [\n\n]\nHIDDEN_SEGMENTS = [\n (125.5809, 67.6029, 125.5809, 61.95),\n (147.4786, 67.6029, 147.4786, 61.95),\n (119.8685, 61.95, 119.8685, 67.6029),\n (141.7662, 61.95, 141.7662, 67.6029),\n (198.55, 167.2896, 192.8971, 167.2896),\n (198.55, 161.5772, 192.8971, 161.5772)\n]\n# (orient, text, p1, p2, base) for linear; (orient, text, center, radius, angle) for diameter\nDIMENSIONS = [\n ('horizontal', '100', (178.8971, 172.05), (88.45, 172.05), (133.6735, 161.05)),\n ('vertical', '100', (178.8971, 81.6029), (178.8971, 172.05), (167.8971, 126.8265)),\n ('diameter', '%%c6.3158', (122.7246, 164.4334), 2.8562, 45),\n ('horizontal', '37.8947', (88.45, 164.4334), (122.7246, 164.4334), (105.5873, 175.4334)),\n ('vertical', '91.5789', (122.7246, 81.6029), (122.7246, 164.4334), (111.7246, 123.0182)),\n ('diameter', '%%c6.3158', (144.6224, 164.4334), 2.8562, 45),\n ('horizontal', '62.1053', (88.45, 164.4334), (144.6224, 164.4334), (116.5362, 175.4334)),\n ('vertical', '91.5789', (144.6224, 81.6029), (144.6224, 164.4334), (133.6224, 123.0182)),\n ('horizontal', '6.25', (192.8971, 81.6029), (198.55, 81.6029), (195.7235, 92.6029))\n]\n\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\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\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,\n angle=(0 if d[0] == \"horizontal\" else 90),\n 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,\n text=text, dimstyle=\"EZDXF\").render()\n\n doc.saveas(out_path)\n\n\nif __name__ == \"__main__\":\n out = sys.argv[1] if len(sys.argv) > 1 else \"0034_00341325_gt.dxf\"\n draw(out)\n print(\"wrote\", out)\n```"}], "images": ["images/0034_00341325.png"], "id": "0034_00341325"} {"messages": [{"role": "user", "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": "assistant", "content": "```python\n#!/usr/bin/env python3\n# -*- coding: utf-8 -*-\n# Ground-truth 2D engineering drawing for part: 0035_00354338\n# Self-contained: reproduces the three-view DXF via ezdxf, NO FreeCAD needed.\n# Coordinates are A4 page millimetres (scale=0.9247575289575778, page=[297.0, 210.0]).\n# visible edges -> solid (layer OUTLINE); hidden edges -> dashed (layer HIDDEN)\n# dimensions -> real movable DIMENSION entities (text = true mm value)\n# Run: python 0035_00354338_gt.py [out.dxf]\nimport sys\nimport ezdxf\n\nSCALE = 0.9247575289575778\nPAGE = [297.0, 210.0]\n\nVISIBLE_SEGMENTS = [\n (155.505762, 167.780393, 155.505762, 134.683807),\n (155.505762, 134.683807, 63.030009, 134.683807),\n (63.030009, 134.683807, 63.030009, 167.780393),\n (63.030009, 167.780393, 155.505762, 167.780393),\n (155.505762, 66.21956, 155.505762, 120.683807),\n (155.505762, 120.683807, 63.030009, 120.683807),\n (63.030009, 66.21956, 63.030009, 120.683807),\n (155.505762, 66.21956, 63.030009, 66.21956),\n (169.505762, 134.683807, 223.970009, 134.683807),\n (223.970009, 134.683807, 223.970009, 167.780393),\n (169.505762, 167.780393, 223.970009, 167.780393),\n (169.505762, 134.683807, 169.505762, 167.780393)\n]\nVISIBLE_CIRCLES = [\n (109.7546, 151.2321, 10.707719)\n]\nVISIBLE_ARCS = [\n\n]\nHIDDEN_SEGMENTS = [\n (120.4623, 120.6838, 120.4623, 66.2196),\n (99.0469, 66.2196, 99.0469, 120.6838),\n (223.97, 161.9398, 169.5058, 161.9398),\n (223.97, 140.5244, 169.5058, 140.5244)\n]\n# (orient, text, p1, p2, base) for linear; (orient, text, center, radius, angle) for diameter\nDIMENSIONS = [\n ('horizontal', '100', (155.5058, 167.7805), (63.03, 167.7805), (109.2679, 156.7805)),\n ('vertical', '35.7895', (155.5058, 134.6838), (155.5058, 167.7805), (144.5058, 151.2321)),\n ('diameter', '%%c23.1579', (109.7546, 151.2321), 10.7077, 45),\n ('horizontal', '50.5263', (63.03, 151.2321), (109.7546, 151.2321), (86.3923, 162.2321)),\n ('vertical', '17.8947', (109.7546, 134.6838), (109.7546, 151.2321), (98.7546, 142.958)),\n ('horizontal', '58.8957', (169.5058, 134.6838), (223.97, 134.6838), (196.7379, 145.6838))\n]\n\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\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\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,\n angle=(0 if d[0] == \"horizontal\" else 90),\n 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,\n text=text, dimstyle=\"EZDXF\").render()\n\n doc.saveas(out_path)\n\n\nif __name__ == \"__main__\":\n out = sys.argv[1] if len(sys.argv) > 1 else \"0035_00354338_gt.dxf\"\n draw(out)\n print(\"wrote\", out)\n```"}], "images": ["images/0035_00354338.png"], "id": "0035_00354338"} {"messages": [{"role": "user", "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 101.04 mm. It is extruded to a thickness of 446.44 mm. The outline includes one or more oblique (angled) edges."}, {"role": "assistant", "content": "```python\n#!/usr/bin/env python3\n# -*- coding: utf-8 -*-\n# Ground-truth 2D engineering drawing for part: 0035_00356786\n# Self-contained: reproduces the three-view DXF via ezdxf, NO FreeCAD needed.\n# Coordinates are A4 page millimetres (scale=0.0901942803962219, page=[297.0, 210.0]).\n# visible edges -> solid (layer OUTLINE); hidden edges -> dashed (layer HIDDEN)\n# dimensions -> real movable DIMENSION entities (text = true mm value)\n# Run: python 0035_00356786_gt.py [out.dxf]\nimport sys\nimport ezdxf\nimport math\n\nSCALE = 0.0901942803962219\nPAGE = [297.0, 210.0]\n\nVISIBLE_SEGMENTS = [\n (91.772373, 172.049997, 100.695376, 172.049997),\n (87.215945, 164.2661, 91.772373, 172.049997),\n (100.695376, 172.049997, 105.251804, 164.2661),\n (105.251804, 164.2661, 100.695376, 156.482203),\n (100.695376, 156.482203, 91.772373, 156.482203),\n (91.772373, 156.482203, 87.215945, 164.2661),\n (87.215945, 142.482203, 87.215945, 61.949997),\n (105.251804, 61.949997, 105.251804, 142.482203),\n (105.251804, 142.482203, 100.695376, 142.482203),\n (100.695376, 142.482203, 91.772373, 142.482203),\n (91.772373, 142.482203, 87.215945, 142.482203),\n (91.772373, 142.482203, 91.772373, 61.949997),\n (91.772373, 61.949997, 87.215945, 61.949997),\n (100.695376, 61.949997, 100.695376, 142.482203),\n (105.251804, 61.949997, 100.695376, 61.949997),\n (100.695376, 61.949997, 91.772373, 61.949997),\n (199.78401, 172.049997, 119.251804, 172.049997),\n (199.78401, 164.2661, 119.251804, 164.2661),\n (199.78401, 164.2661, 199.78401, 172.049997),\n (119.251804, 164.2661, 119.251804, 172.049997),\n (199.78401, 156.482203, 199.78401, 164.2661),\n (199.78401, 156.482203, 119.251804, 156.482203),\n (119.251804, 156.482203, 119.251804, 164.2661)\n]\nVISIBLE_CIRCLES = [\n (96.3288, 164.2661, 4.556427)\n]\nVISIBLE_ARCS = [\n\n]\nHIDDEN_SEGMENTS = [\n (199.784, 168.8225, 119.2518, 168.8225),\n (199.784, 159.7097, 119.2518, 159.7097)\n]\n# (orient, text, p1, p2, base) for linear; (orient, text, center, radius, angle) for diameter\nDIMENSIONS = [\n ('horizontal', '98.9309', (91.7724, 156.4822), (100.6954, 156.4822), (96.2339, 167.4822)),\n ('aligned', '100', (100.6954, 156.4822), (105.2518, 164.2661), (93.4805, 165.9311)),\n ('aligned', '100', (105.2518, 164.2661), (100.6954, 172.05), (93.4805, 162.6011)),\n ('aligned', '100', (91.7724, 172.05), (87.216, 164.2661), (98.9873, 162.6011)),\n ('aligned', '100', (87.216, 164.2661), (91.7724, 156.4822), (98.9873, 165.9311)),\n ('diameter', '%%c101.036', (96.3288, 164.2661), 4.5564, 45),\n ('horizontal', '101.036', (87.216, 164.2661), (96.3288, 164.2661), (91.7724, 175.2661)),\n ('vertical', '86.3014', (96.3288, 156.4822), (96.3288, 164.2661), (85.3288, 160.3742)),\n ('horizontal', '892.875', (119.2518, 156.4822), (199.784, 156.4822), (159.5179, 167.4822))\n]\n\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; _ds.dxf.dimasz = 2.5\n _ds.dxf.dimexe = 1.25; _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\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\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,\n angle=(0 if d[0] == \"horizontal\" else 90),\n 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,\n 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,\n 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,\n text=text, dimstyle=\"EZDXF\").render()\n\n doc.saveas(out_path)\n\n\nif __name__ == \"__main__\":\n out = sys.argv[1] if len(sys.argv) > 1 else \"0035_00356786_gt.dxf\"\n draw(out)\n print(\"wrote\", out)\n```"}], "images": ["images/0035_00356786.png"], "id": "0035_00356786"} {"messages": [{"role": "user", "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 4 circular holes, each of diameter 2.11 mm. It is extruded to a thickness of 3.12 mm."}, {"role": "assistant", "content": "```python\n#!/usr/bin/env python3\n# -*- coding: utf-8 -*-\n# Ground-truth 2D engineering drawing for part: 0038_00384003\n# Self-contained: reproduces the three-view DXF via ezdxf, NO FreeCAD needed.\n# Coordinates are A4 page millimetres (scale=0.9318787878787879, page=[297.0, 210.0]).\n# visible edges -> solid (layer OUTLINE); hidden edges -> dashed (layer HIDDEN)\n# dimensions -> real movable DIMENSION entities (text = true mm value)\n# Run: python 0038_00384003_gt.py [out.dxf]\nimport sys\nimport ezdxf\n\nSCALE = 0.9318787878787879\nPAGE = [297.0, 210.0]\n\nVISIBLE_SEGMENTS = [\n (181.637883, 78.862111, 181.637883, 172.049989),\n (181.637883, 172.049989, 88.450004, 172.049989),\n (88.450004, 172.049989, 88.450004, 78.862111),\n (88.450004, 78.862111, 181.637883, 78.862111),\n (181.637883, 64.862111, 181.637883, 61.949989),\n (181.637883, 61.949989, 88.450004, 61.949989),\n (88.450004, 64.862111, 88.450004, 61.949989),\n (181.637883, 64.862111, 88.450004, 64.862111),\n (195.637883, 172.049989, 198.550004, 172.049989),\n (198.550004, 172.049989, 198.550004, 78.862111),\n (195.637883, 78.862111, 198.550004, 78.862111),\n (195.637883, 172.049989, 195.637883, 78.862111)\n]\nVISIBLE_CIRCLES = [\n (135.534406, 90.633211, 0.980925),\n (135.534406, 124.965587, 0.980925),\n (135.534406, 160.278889, 0.980925),\n (169.866782, 125.946513, 0.980925)\n]\nVISIBLE_ARCS = [\n\n]\nHIDDEN_SEGMENTS = [\n (136.5153, 64.8621, 136.5153, 61.95),\n (170.8477, 64.8621, 170.8477, 61.95),\n (134.5535, 61.95, 134.5535, 64.8621),\n (168.8859, 61.95, 168.8859, 64.8621),\n (198.55, 91.6141, 195.6379, 91.6141),\n (198.55, 89.6523, 195.6379, 89.6523),\n (198.55, 125.9465, 195.6379, 125.9465),\n (198.55, 123.9847, 195.6379, 123.9847),\n (198.55, 161.2598, 195.6379, 161.2598),\n (198.55, 159.298, 195.6379, 159.298),\n (198.55, 126.9274, 195.6379, 126.9274),\n (198.55, 124.9656, 195.6379, 124.9656)\n]\n# (orient, text, p1, p2, base) for linear; (orient, text, center, radius, angle) for diameter\nDIMENSIONS = [\n ('horizontal', '100', (181.6379, 172.05), (88.45, 172.05), (135.0439, 161.05)),\n ('vertical', '100', (181.6379, 78.8621), (181.6379, 172.05), (170.6379, 125.4561)),\n ('diameter', '%%c2.1053', (135.5344, 90.6332), 0.9809, 45),\n ('horizontal', '50.5263', (88.45, 90.6332), (135.5344, 90.6332), (111.9922, 101.6332)),\n ('vertical', '12.6316', (135.5344, 78.8621), (135.5344, 90.6332), (124.5344, 84.7477)),\n ('diameter', '%%c2.1053', (135.5344, 124.9656), 0.9809, 45),\n ('horizontal', '50.5263', (88.45, 124.9656), (135.5344, 124.9656), (111.9922, 135.9656)),\n ('vertical', '49.4737', (135.5344, 78.8621), (135.5344, 124.9656), (124.5344, 101.9139)),\n ('diameter', '%%c2.1053', (135.5344, 160.2789), 0.9809, 45),\n ('horizontal', '50.5263', (88.45, 160.2789), (135.5344, 160.2789), (111.9922, 171.2789)),\n ('vertical', '87.3684', (135.5344, 78.8621), (135.5344, 160.2789), (124.5344, 119.5705)),\n ('diameter', '%%c2.1053', (169.8668, 125.9465), 0.9809, 45),\n ('horizontal', '87.3684', (88.45, 125.9465), (169.8668, 125.9465), (129.1584, 136.9465)),\n ('vertical', '50.5263', (169.8668, 78.8621), (169.8668, 125.9465), (158.8668, 102.4043)),\n ('horizontal', '3.125', (195.6379, 78.8621), (198.55, 78.8621), (197.0939, 89.8621))\n]\n\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\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\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,\n angle=(0 if d[0] == \"horizontal\" else 90),\n 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,\n text=text, dimstyle=\"EZDXF\").render()\n\n doc.saveas(out_path)\n\n\nif __name__ == \"__main__\":\n out = sys.argv[1] if len(sys.argv) > 1 else \"0038_00384003_gt.dxf\"\n draw(out)\n print(\"wrote\", out)\n```"}], "images": ["images/0038_00384003.png"], "id": "0038_00384003"} {"messages": [{"role": "user", "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 90.53 mm wide and 100 mm tall, featuring a circular hole of diameter 46.32 mm. It is extruded to a thickness of 47.4 mm."}, {"role": "assistant", "content": "```python\n#!/usr/bin/env python3\n# -*- coding: utf-8 -*-\n# Ground-truth 2D engineering drawing for part: 0040_00401312\n# Self-contained: reproduces the three-view DXF via ezdxf, NO FreeCAD needed.\n# Coordinates are A4 page millimetres (scale=0.6519858657243962, page=[297.0, 210.0]).\n# visible edges -> solid (layer OUTLINE); hidden edges -> dashed (layer HIDDEN)\n# dimensions -> real movable DIMENSION entities (text = true mm value)\n# Run: python 0040_00401312_gt.py [out.dxf]\nimport sys\nimport ezdxf\n\nSCALE = 0.6519858657243962\nPAGE = [297.0, 210.0]\n\nVISIBLE_SEGMENTS = [\n (150.560239, 172.050044, 150.560239, 106.851457),\n (150.560239, 106.851457, 91.538361, 106.851457),\n (91.538361, 106.851457, 91.538361, 172.050044),\n (91.538361, 172.050044, 150.560239, 172.050044),\n (150.560239, 61.950044, 150.560239, 92.851457),\n (91.538361, 61.950044, 91.538361, 92.851457),\n (91.538361, 92.851457, 150.560239, 92.851457),\n (91.538361, 61.950044, 150.560239, 61.950044),\n (195.461653, 106.851457, 164.560239, 106.851457),\n (164.560239, 106.851457, 164.560239, 172.050044),\n (195.461653, 172.050044, 164.560239, 172.050044),\n (195.461653, 106.851457, 195.461653, 172.050044)\n]\nVISIBLE_CIRCLES = [\n (121.0493, 139.1076, 15.09862)\n]\nVISIBLE_ARCS = [\n\n]\nHIDDEN_SEGMENTS = [\n (136.1479, 61.95, 136.1479, 92.8514),\n (105.9507, 92.8514, 105.9507, 61.95),\n (164.5602, 124.0089, 195.4616, 124.0089),\n (164.5602, 154.2062, 195.4616, 154.2062)\n]\n# (orient, text, p1, p2, base) for linear; (orient, text, center, radius, angle) for diameter\nDIMENSIONS = [\n ('horizontal', '90.5263', (150.5602, 106.8514), (91.5384, 106.8514), (121.0493, 95.8514)),\n ('vertical', '100', (150.5602, 172.05), (150.5602, 106.8514), (161.5602, 139.4507)),\n ('diameter', '%%c46.3158', (121.0493, 139.1076), 15.0986, 45),\n ('horizontal', '45.2632', (91.5384, 139.1076), (121.0493, 139.1076), (106.2938, 150.1076)),\n ('vertical', '50.5263', (121.0493, 172.05), (121.0493, 139.1076), (132.0493, 155.5788)),\n ('horizontal', '47.3958', (195.4616, 172.05), (164.5603, 172.05), (180.011, 161.05))\n]\n\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\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\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,\n angle=(0 if d[0] == \"horizontal\" else 90),\n 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,\n text=text, dimstyle=\"EZDXF\").render()\n\n doc.saveas(out_path)\n\n\nif __name__ == \"__main__\":\n out = sys.argv[1] if len(sys.argv) > 1 else \"0040_00401312_gt.dxf\"\n draw(out)\n print(\"wrote\", out)\n```"}], "images": ["images/0040_00401312.png"], "id": "0040_00401312"} {"messages": [{"role": "user", "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 52.63 mm tall, featuring a circular hole of diameter 16.84 mm and a rectangular cutout 17.89 x 16.84 mm. It is extruded to a thickness of 13.1 mm."}, {"role": "assistant", "content": "```python\n#!/usr/bin/env python3\n# -*- coding: utf-8 -*-\n# Ground-truth 2D engineering drawing for part: 0044_00443147\n# Self-contained: reproduces the three-view DXF via ezdxf, NO FreeCAD needed.\n# Coordinates are A4 page millimetres (scale=0.9627103448276771, page=[297.0, 210.0]).\n# visible edges -> solid (layer OUTLINE); hidden edges -> dashed (layer HIDDEN)\n# dimensions -> real movable DIMENSION entities (text = true mm value)\n# Run: python 0044_00443147_gt.py [out.dxf]\nimport sys\nimport ezdxf\n\nSCALE = 0.9627103448276771\nPAGE = [297.0, 210.0]\n\nVISIBLE_SEGMENTS = [\n (178.328131, 104.972917, 178.328131, 155.641883),\n (178.328131, 155.641883, 82.057097, 155.641883),\n (82.057097, 155.641883, 82.057097, 104.972917),\n (82.057097, 104.972917, 178.328131, 104.972917),\n (145.899993, 138.414434, 145.899993, 122.200366),\n (163.127441, 138.414434, 145.899993, 138.414434),\n (163.127441, 122.200366, 163.127441, 138.414434),\n (145.899993, 122.200366, 163.127441, 122.200366),\n (178.328131, 90.972917, 178.328131, 78.358092),\n (82.057097, 90.972917, 82.057097, 78.358092),\n (82.057097, 78.358092, 178.328131, 78.358092),\n (82.057097, 90.972917, 178.328131, 90.972917),\n (204.942956, 155.641883, 192.328131, 155.641883),\n (192.328131, 155.641883, 192.328131, 104.972917),\n (204.942956, 104.972917, 192.328131, 104.972917),\n (204.942956, 155.641883, 204.942956, 104.972917)\n]\nVISIBLE_CIRCLES = [\n (106.3782, 130.3074, 8.107034)\n]\nVISIBLE_ARCS = [\n\n]\nHIDDEN_SEGMENTS = [\n (114.4852, 78.3581, 114.4852, 90.9729),\n (145.9, 78.3581, 145.9, 90.9729),\n (163.1274, 78.3581, 163.1274, 90.9729),\n (98.2711, 90.9729, 98.2711, 78.3581),\n (204.9429, 122.2004, 192.3281, 122.2004),\n (204.9429, 138.4144, 192.3281, 138.4144),\n (192.3281, 122.2004, 204.9429, 122.2004),\n (192.3281, 138.4144, 204.9429, 138.4144)\n]\n# (orient, text, p1, p2, base) for linear; (orient, text, center, radius, angle) for diameter\nDIMENSIONS = [\n ('horizontal', '100', (178.3281, 104.973), (82.0571, 104.973), (130.1926, 93.973)),\n ('vertical', '52.6316', (178.3281, 155.6419), (178.3281, 104.973), (189.3281, 130.3074)),\n ('diameter', '%%c16.8421', (106.3782, 130.3074), 8.107, 45),\n ('horizontal', '25.2632', (82.0571, 130.3074), (106.3782, 130.3074), (94.2176, 141.3074)),\n ('vertical', '26.3158', (106.3782, 155.6419), (106.3782, 130.3074), (117.3782, 142.9746)),\n ('horizontal', '17.8947', (145.9, 138.4144), (163.1274, 138.4144), (154.5137, 149.4144)),\n ('vertical', '16.8421', (145.9, 138.4144), (145.9, 122.2004), (156.9, 130.3074)),\n ('horizontal', '66.3158', (82.0571, 138.4144), (145.9, 138.4144), (113.9785, 149.4144)),\n ('vertical', '17.8947', (145.9, 155.6419), (145.9, 138.4144), (156.9, 147.0282)),\n ('horizontal', '13.1034', (204.9429, 155.6419), (192.3282, 155.6419), (198.6355, 144.6419))\n]\n\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\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\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,\n angle=(0 if d[0] == \"horizontal\" else 90),\n 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,\n text=text, dimstyle=\"EZDXF\").render()\n\n doc.saveas(out_path)\n\n\nif __name__ == \"__main__\":\n out = sys.argv[1] if len(sys.argv) > 1 else \"0044_00443147_gt.dxf\"\n draw(out)\n print(\"wrote\", out)\n```"}], "images": ["images/0044_00443147.png"], "id": "0044_00443147"} {"messages": [{"role": "user", "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 52.63 mm tall, featuring a circular hole of diameter 16.84 mm and a rectangular cutout 16.84 x 16.84 mm. It is extruded to a thickness of 17.71 mm."}, {"role": "assistant", "content": "```python\n#!/usr/bin/env python3\n# -*- coding: utf-8 -*-\n# Ground-truth 2D engineering drawing for part: 0044_00445873\n# Self-contained: reproduces the three-view DXF via ezdxf, NO FreeCAD needed.\n# Coordinates are A4 page millimetres (scale=0.9627103448275888, page=[297.0, 210.0]).\n# visible edges -> solid (layer OUTLINE); hidden edges -> dashed (layer HIDDEN)\n# dimensions -> real movable DIMENSION entities (text = true mm value)\n# Run: python 0044_00445873_gt.py [out.dxf]\nimport sys\nimport ezdxf\n\nSCALE = 0.9627103448275888\nPAGE = [297.0, 210.0]\n\nVISIBLE_SEGMENTS = [\n (176.111524, 107.189517, 176.111524, 157.858483),\n (176.111524, 157.858483, 79.84049, 157.858483),\n (79.84049, 157.858483, 79.84049, 107.189517),\n (79.84049, 107.189517, 176.111524, 107.189517),\n (98.081317, 140.631034, 98.081317, 124.416966),\n (114.295386, 140.631034, 98.081317, 140.631034),\n (114.295386, 124.416966, 114.295386, 140.631034),\n (98.081317, 124.416966, 114.295386, 124.416966),\n (176.111524, 93.189517, 176.111524, 76.141522),\n (79.84049, 93.189517, 79.84049, 76.141522),\n (79.84049, 76.141522, 176.111524, 76.141522),\n (79.84049, 93.189517, 176.111524, 93.189517),\n (207.15952, 157.858483, 190.111524, 157.858483),\n (190.111524, 157.858483, 190.111524, 107.189517),\n (207.15952, 107.189517, 190.111524, 107.189517),\n (207.15952, 157.858483, 207.15952, 107.189517)\n]\nVISIBLE_CIRCLES = [\n (152.8038, 132.524, 8.107034)\n]\nVISIBLE_ARCS = [\n\n]\nHIDDEN_SEGMENTS = [\n (98.0813, 76.1415, 98.0813, 93.1895),\n (114.2954, 76.1415, 114.2954, 93.1895),\n (160.9108, 76.1415, 160.9108, 93.1895),\n (144.6968, 93.1895, 144.6968, 76.1415),\n (207.1595, 124.417, 190.1115, 124.417),\n (207.1595, 140.631, 190.1115, 140.631),\n (190.1115, 124.417, 207.1595, 124.417),\n (190.1115, 140.631, 207.1595, 140.631)\n]\n# (orient, text, p1, p2, base) for linear; (orient, text, center, radius, angle) for diameter\nDIMENSIONS = [\n ('horizontal', '100', (176.1115, 107.1895), (79.8405, 107.1895), (127.976, 96.1895)),\n ('vertical', '52.6316', (176.1115, 157.8585), (176.1115, 107.1895), (187.1115, 132.524)),\n ('diameter', '%%c16.8421', (152.8038, 132.524), 8.107, 45),\n ('horizontal', '75.7895', (79.8405, 132.524), (152.8038, 132.524), (116.3222, 143.524)),\n ('vertical', '26.3158', (152.8038, 157.8585), (152.8038, 132.524), (163.8038, 145.1912)),\n ('horizontal', '16.8421', (98.0813, 140.6311), (114.2954, 140.6311), (106.1884, 151.6311)),\n ('vertical', '16.8421', (98.0813, 140.6311), (98.0813, 124.417), (109.0813, 132.524)),\n ('horizontal', '18.9474', (79.8405, 140.6311), (98.0813, 140.6311), (88.9609, 151.6311)),\n ('vertical', '17.8947', (98.0813, 157.8585), (98.0813, 140.6311), (109.0813, 149.2448)),\n ('horizontal', '17.7083', (207.1595, 157.8585), (190.1116, 157.8585), (198.6355, 146.8585))\n]\n\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\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\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,\n angle=(0 if d[0] == \"horizontal\" else 90),\n 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,\n text=text, dimstyle=\"EZDXF\").render()\n\n doc.saveas(out_path)\n\n\nif __name__ == \"__main__\":\n out = sys.argv[1] if len(sys.argv) > 1 else \"0044_00445873_gt.dxf\"\n draw(out)\n print(\"wrote\", out)\n```"}], "images": ["images/0044_00445873.png"], "id": "0044_00445873"} {"messages": [{"role": "user", "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": "assistant", "content": "```python\n#!/usr/bin/env python3\n# -*- coding: utf-8 -*-\n# Ground-truth 2D engineering drawing for part: 0044_00447170\n# Self-contained: reproduces the three-view DXF via ezdxf, NO FreeCAD needed.\n# Coordinates are A4 page millimetres (scale=0.9247575289575778, page=[297.0, 210.0]).\n# visible edges -> solid (layer OUTLINE); hidden edges -> dashed (layer HIDDEN)\n# dimensions -> real movable DIMENSION entities (text = true mm value)\n# Run: python 0044_00447170_gt.py [out.dxf]\nimport sys\nimport ezdxf\n\nSCALE = 0.9247575289575778\nPAGE = [297.0, 210.0]\n\nVISIBLE_SEGMENTS = [\n (155.505762, 167.780393, 155.505762, 134.683807),\n (155.505762, 134.683807, 63.030009, 134.683807),\n (63.030009, 134.683807, 63.030009, 167.780393),\n (63.030009, 167.780393, 155.505762, 167.780393),\n (155.505762, 66.21956, 155.505762, 120.683807),\n (155.505762, 120.683807, 63.030009, 120.683807),\n (63.030009, 66.21956, 63.030009, 120.683807),\n (155.505762, 66.21956, 63.030009, 66.21956),\n (169.505762, 134.683807, 223.970009, 134.683807),\n (223.970009, 134.683807, 223.970009, 167.780393),\n (169.505762, 167.780393, 223.970009, 167.780393),\n (169.505762, 134.683807, 169.505762, 167.780393)\n]\nVISIBLE_CIRCLES = [\n (109.7546, 151.2321, 10.707719)\n]\nVISIBLE_ARCS = [\n\n]\nHIDDEN_SEGMENTS = [\n (120.4623, 120.6838, 120.4623, 66.2196),\n (99.0469, 66.2196, 99.0469, 120.6838),\n (223.97, 161.9398, 169.5058, 161.9398),\n (223.97, 140.5244, 169.5058, 140.5244)\n]\n# (orient, text, p1, p2, base) for linear; (orient, text, center, radius, angle) for diameter\nDIMENSIONS = [\n ('horizontal', '100', (155.5058, 167.7805), (63.03, 167.7805), (109.2679, 156.7805)),\n ('vertical', '35.7895', (155.5058, 134.6838), (155.5058, 167.7805), (144.5058, 151.2321)),\n ('diameter', '%%c23.1579', (109.7546, 151.2321), 10.7077, 45),\n ('horizontal', '50.5263', (63.03, 151.2321), (109.7546, 151.2321), (86.3923, 162.2321)),\n ('vertical', '17.8947', (109.7546, 134.6838), (109.7546, 151.2321), (98.7546, 142.958)),\n ('horizontal', '58.8957', (169.5058, 134.6838), (223.97, 134.6838), (196.7379, 145.6838))\n]\n\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\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\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,\n angle=(0 if d[0] == \"horizontal\" else 90),\n 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,\n text=text, dimstyle=\"EZDXF\").render()\n\n doc.saveas(out_path)\n\n\nif __name__ == \"__main__\":\n out = sys.argv[1] if len(sys.argv) > 1 else \"0044_00447170_gt.dxf\"\n draw(out)\n print(\"wrote\", out)\n```"}], "images": ["images/0044_00447170.png"], "id": "0044_00447170"} {"messages": [{"role": "user", "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 83.32 mm. It is extruded to a thickness of 82.45 mm. The outline includes one or more oblique (angled) edges."}, {"role": "assistant", "content": "```python\n#!/usr/bin/env python3\n# -*- coding: utf-8 -*-\n# Ground-truth 2D engineering drawing for part: 0045_00459635\n# Self-contained: reproduces the three-view DXF via ezdxf, NO FreeCAD needed.\n# Coordinates are A4 page millimetres (scale=0.37638076952307936, page=[297.0, 210.0]).\n# visible edges -> solid (layer OUTLINE); hidden edges -> dashed (layer HIDDEN)\n# dimensions -> real movable DIMENSION entities (text = true mm value)\n# Run: python 0045_00459635_gt.py [out.dxf]\nimport sys\nimport ezdxf\nimport math\n\nSCALE = 0.37638076952307936\nPAGE = [297.0, 210.0]\n\nVISIBLE_SEGMENTS = [\n (102.561244, 106.981627, 140.191156, 107.765584),\n (140.191156, 107.765584, 158.222155, 139.9078),\n (158.222155, 139.9078, 139.407199, 172.050016),\n (139.407199, 172.050016, 101.777288, 171.26606),\n (101.777288, 171.26606, 83.746288, 139.123844),\n (83.746288, 139.123844, 102.561244, 106.981627),\n (158.222155, 92.981627, 158.222155, 61.950016),\n (158.222155, 61.950016, 139.407199, 61.950016),\n (139.407199, 92.981627, 139.407199, 61.950016),\n (158.222155, 92.981627, 139.407199, 92.981627),\n (139.407199, 61.950016, 101.777288, 61.950016),\n (101.777288, 92.981627, 101.777288, 61.950016),\n (139.407199, 92.981627, 101.777288, 92.981627),\n (101.777288, 61.950016, 83.746288, 61.950016),\n (83.746288, 92.981627, 83.746288, 61.950016),\n (101.777288, 92.981627, 83.746288, 92.981627),\n (172.222155, 106.981627, 203.253766, 106.981627),\n (172.222155, 172.050016, 203.253766, 172.050016),\n (203.253766, 172.050016, 203.253766, 171.26606),\n (172.222155, 171.26606, 203.253766, 171.26606),\n (172.222155, 172.050016, 172.222155, 171.26606),\n (203.253766, 171.26606, 203.253766, 139.123844),\n (172.222155, 139.123844, 203.253766, 139.123844),\n (172.222155, 171.26606, 172.222155, 139.123844),\n (203.253766, 139.123844, 203.253766, 106.981627),\n (172.222155, 139.123844, 172.222155, 106.981627)\n]\nVISIBLE_CIRCLES = [\n (121.3762, 139.9078, 15.67913)\n]\nVISIBLE_ARCS = [\n\n]\nHIDDEN_SEGMENTS = [\n (102.5612, 92.9816, 102.5612, 61.95),\n (140.1911, 92.9816, 140.1911, 61.95),\n (137.0553, 92.9816, 137.0553, 61.95),\n (105.697, 61.95, 105.697, 92.9816),\n (172.2221, 107.7656, 203.2537, 107.7656),\n (172.2221, 139.9078, 203.2537, 139.9078),\n (203.2537, 155.5869, 172.2221, 155.5869),\n (203.2537, 124.2287, 172.2221, 124.2287)\n]\n# (orient, text, p1, p2, base) for linear; (orient, text, center, radius, angle) for diameter\nDIMENSIONS = [\n ('aligned', '100', (102.5612, 106.9816), (140.1911, 107.7656), (121.1471, 118.3712)),\n ('aligned', '97.9176', (140.1911, 107.7656), (158.2221, 139.9078), (139.6131, 129.2185)),\n ('aligned', '98.9533', (158.2221, 139.9078), (139.4072, 172.05), (139.3215, 150.4219)),\n ('aligned', '100', (139.4072, 172.05), (101.7773, 171.266), (120.8213, 160.6604)),\n ('aligned', '97.9176', (101.7773, 171.266), (83.7462, 139.1238), (102.3553, 149.8132)),\n ('aligned', '98.9533', (83.7462, 139.1238), (102.5612, 106.9816), (102.6469, 128.6097)),\n ('diameter', '%%c83.3153', (121.3762, 139.9078), 15.6791, 45),\n ('horizontal', '99.9783', (83.7462, 139.9078), (121.3762, 139.9078), (102.5612, 150.9078)),\n ('vertical', '87.481', (121.3762, 106.9816), (121.3762, 139.9078), (110.3762, 123.4447)),\n ('horizontal', '82.4474', (172.2221, 106.9816), (203.2537, 106.9816), (187.7379, 117.9816))\n]\n\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; _ds.dxf.dimasz = 2.5\n _ds.dxf.dimexe = 1.25; _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\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\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,\n angle=(0 if d[0] == \"horizontal\" else 90),\n 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,\n 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,\n 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,\n text=text, dimstyle=\"EZDXF\").render()\n\n doc.saveas(out_path)\n\n\nif __name__ == \"__main__\":\n out = sys.argv[1] if len(sys.argv) > 1 else \"0045_00459635_gt.dxf\"\n draw(out)\n print(\"wrote\", out)\n```"}], "images": ["images/0045_00459635.png"], "id": "0045_00459635"} {"messages": [{"role": "user", "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 91.67 mm wide and 100 mm tall, featuring a circular hole of diameter 800 mm and 3 polygonal cutouts. It is extruded to a thickness of 49.48 mm."}, {"role": "assistant", "content": "```python\n#!/usr/bin/env python3\n# -*- coding: utf-8 -*-\n# Ground-truth 2D engineering drawing for part: 0046_00460764\n# Self-contained: reproduces the three-view DXF via ezdxf, NO FreeCAD needed.\n# Coordinates are A4 page millimetres (scale=0.11312814224402203, page=[297.0, 210.0]).\n# visible edges -> solid (layer OUTLINE); hidden edges -> dashed (layer HIDDEN)\n# dimensions -> real movable DIMENSION entities (text = true mm value)\n# Run: python 0046_00460764_gt.py [out.dxf]\nimport sys\nimport ezdxf\n\nSCALE = 0.11312814224402203\nPAGE = [297.0, 210.0]\n\nVISIBLE_SEGMENTS = [\n (104.947833, 122.556486, 95.520488, 116.900079),\n (108.718772, 116.900079, 104.947833, 122.556486),\n (98.348692, 111.243672, 108.718772, 116.900079),\n (95.520488, 116.900079, 98.348692, 111.243672),\n (125.687993, 139.525707, 125.687993, 128.212893),\n (136.058073, 139.525707, 125.687993, 139.525707),\n (136.058073, 128.212893, 136.058073, 139.525707),\n (125.687993, 128.212893, 136.058073, 128.212893),\n (127.573462, 173.46415, 127.573462, 161.208601),\n (134.172604, 173.46415, 127.573462, 173.46415),\n (134.172604, 161.208601, 134.172604, 173.46415),\n (127.573462, 161.208601, 134.172604, 161.208601),\n (156.798232, 122.556486, 153.027294, 116.900079),\n (166.225577, 116.900079, 156.798232, 122.556486),\n (163.397374, 111.243672, 166.225577, 116.900079),\n (153.027294, 116.900079, 163.397374, 111.243672),\n (176.595657, 74.618043, 173.767453, 74.618043),\n (173.767453, 74.618043, 170.93925, 74.618043),\n (170.93925, 74.618043, 168.111046, 74.618043),\n (168.111046, 74.618043, 165.282843, 74.618043),\n (165.282843, 74.618043, 162.454639, 74.618043),\n (162.454639, 74.618043, 159.626436, 74.618043),\n (159.626436, 74.618043, 156.798232, 74.618043),\n (156.798232, 74.618043, 153.970028, 74.618043),\n (153.970028, 74.618043, 151.141825, 74.618043),\n (151.141825, 74.618043, 148.313621, 74.618043),\n (148.313621, 74.618043, 145.485418, 74.618043),\n (145.485418, 74.618043, 142.657214, 74.618043),\n (142.657214, 74.618043, 139.829011, 74.618043),\n (139.829011, 74.618043, 137.000807, 74.618043),\n (137.000807, 74.618043, 134.172604, 74.618043),\n (134.172604, 74.618043, 131.3444, 74.618043),\n (131.3444, 74.618043, 128.516196, 74.618043),\n (128.516196, 74.618043, 125.687993, 74.618043),\n (125.687993, 74.618043, 122.859789, 74.618043),\n (122.859789, 74.618043, 120.031586, 74.618043),\n (120.031586, 74.618043, 117.203382, 74.618043),\n (117.203382, 74.618043, 114.375179, 74.618043),\n (114.375179, 74.618043, 111.546975, 74.618043),\n (111.546975, 74.618043, 108.718772, 74.618043),\n (108.718772, 74.618043, 105.890568, 74.618043),\n (105.890568, 74.618043, 103.062364, 74.618043),\n (103.062364, 74.618043, 100.234161, 74.618043),\n (100.234161, 74.618043, 97.405957, 74.618043),\n (97.405957, 74.618043, 94.577754, 74.618043),\n (94.577754, 74.618043, 91.74955, 74.618043),\n (91.74955, 74.618043, 88.921347, 74.618043),\n (88.921347, 74.618043, 86.093143, 74.618043),\n (176.595657, 74.618043, 176.595657, 69.020557),\n (176.595657, 69.020557, 173.767453, 69.020557),\n (173.767453, 69.020557, 170.93925, 69.020557),\n (170.93925, 69.020557, 168.111046, 69.020557),\n (168.111046, 69.020557, 165.282843, 69.020557),\n (165.282843, 69.020557, 162.454639, 69.020557),\n (162.454639, 69.020557, 159.626436, 69.020557),\n (159.626436, 69.020557, 156.798232, 69.020557),\n (156.798232, 69.020557, 153.970028, 69.020557),\n (153.970028, 69.020557, 151.141825, 69.020557),\n (151.141825, 69.020557, 148.313621, 69.020557),\n (148.313621, 69.020557, 145.485418, 69.020557),\n (145.485418, 69.020557, 142.657214, 69.020557),\n (142.657214, 69.020557, 139.829011, 69.020557),\n (139.829011, 69.020557, 137.000807, 69.020557),\n (137.000807, 69.020557, 134.172604, 69.020557),\n (134.172604, 69.020557, 131.3444, 69.020557),\n (131.3444, 69.020557, 128.516196, 69.020557),\n (128.516196, 69.020557, 125.687993, 69.020557),\n (125.687993, 69.020557, 122.859789, 69.020557),\n (122.859789, 69.020557, 120.031586, 69.020557),\n (120.031586, 69.020557, 117.203382, 69.020557),\n (117.203382, 69.020557, 114.375179, 69.020557),\n (114.375179, 69.020557, 111.546975, 69.020557),\n (111.546975, 69.020557, 108.718772, 69.020557),\n (108.718772, 69.020557, 105.890568, 69.020557),\n (105.890568, 69.020557, 103.062364, 69.020557),\n (103.062364, 69.020557, 100.234161, 69.020557),\n (100.234161, 69.020557, 97.405957, 69.020557),\n (97.405957, 69.020557, 94.577754, 69.020557),\n (94.577754, 69.020557, 91.74955, 69.020557),\n (91.74955, 69.020557, 88.921347, 69.020557),\n (88.921347, 69.020557, 86.093143, 69.020557),\n (86.093143, 69.020557, 86.093143, 74.618043),\n (190.595657, 179.120557, 190.595657, 176.292353),\n (190.595657, 176.292353, 190.595657, 173.46415),\n (190.595657, 173.46415, 190.595657, 170.635946),\n (190.595657, 170.635946, 190.595657, 167.807743),\n (190.595657, 167.807743, 190.595657, 164.979539),\n (190.595657, 164.979539, 190.595657, 162.151336),\n (190.595657, 162.151336, 190.595657, 159.323132),\n (190.595657, 159.323132, 190.595657, 156.494928),\n (190.595657, 156.494928, 190.595657, 153.666725),\n (190.595657, 153.666725, 190.595657, 150.838521),\n (190.595657, 150.838521, 190.595657, 148.010318),\n (190.595657, 148.010318, 190.595657, 145.182114),\n (190.595657, 145.182114, 190.595657, 142.353911),\n (190.595657, 142.353911, 190.595657, 139.525707),\n (190.595657, 139.525707, 190.595657, 136.697504),\n (190.595657, 136.697504, 190.595657, 133.8693),\n (190.595657, 133.8693, 190.595657, 131.041096),\n (190.595657, 131.041096, 190.595657, 128.212893),\n (190.595657, 128.212893, 190.595657, 125.384689),\n (190.595657, 125.384689, 190.595657, 122.556486),\n (190.595657, 122.556486, 190.595657, 119.728282),\n (190.595657, 119.728282, 190.595657, 116.900079),\n (190.595657, 116.900079, 190.595657, 114.071875),\n (190.595657, 114.071875, 190.595657, 111.243672),\n (190.595657, 111.243672, 190.595657, 108.415468),\n (190.595657, 108.415468, 190.595657, 105.587264),\n (190.595657, 105.587264, 190.595657, 102.759061),\n (190.595657, 102.759061, 190.595657, 99.930857),\n (190.595657, 99.930857, 190.595657, 97.102654),\n (190.595657, 97.102654, 190.595657, 94.27445),\n (190.595657, 94.27445, 190.595657, 91.446247),\n (190.595657, 91.446247, 190.595657, 88.618043),\n (196.193143, 179.120557, 196.193143, 176.292353),\n (196.193143, 176.292353, 196.193143, 173.46415),\n (196.193143, 173.46415, 196.193143, 170.635946),\n (196.193143, 170.635946, 196.193143, 167.807743),\n (196.193143, 167.807743, 196.193143, 164.979539),\n (196.193143, 164.979539, 196.193143, 162.151336),\n (196.193143, 162.151336, 196.193143, 159.323132),\n (196.193143, 159.323132, 196.193143, 156.494928),\n (196.193143, 156.494928, 196.193143, 153.666725),\n (196.193143, 153.666725, 196.193143, 150.838521),\n (196.193143, 150.838521, 196.193143, 148.010318),\n (196.193143, 148.010318, 196.193143, 145.182114),\n (196.193143, 145.182114, 196.193143, 142.353911),\n (196.193143, 142.353911, 196.193143, 139.525707),\n (196.193143, 139.525707, 196.193143, 136.697504),\n (196.193143, 136.697504, 196.193143, 133.8693),\n (196.193143, 133.8693, 196.193143, 131.041096),\n (196.193143, 131.041096, 196.193143, 128.212893),\n (196.193143, 128.212893, 196.193143, 125.384689),\n (196.193143, 125.384689, 196.193143, 122.556486),\n (196.193143, 122.556486, 196.193143, 119.728282),\n (196.193143, 119.728282, 196.193143, 116.900079),\n (196.193143, 116.900079, 196.193143, 114.071875),\n (196.193143, 114.071875, 196.193143, 111.243672),\n (196.193143, 111.243672, 196.193143, 108.415468),\n (196.193143, 108.415468, 196.193143, 105.587264),\n (196.193143, 105.587264, 196.193143, 102.759061),\n (196.193143, 102.759061, 196.193143, 99.930857),\n (196.193143, 99.930857, 196.193143, 97.102654),\n (196.193143, 97.102654, 196.193143, 94.27445),\n (196.193143, 94.27445, 196.193143, 91.446247),\n (196.193143, 91.446247, 196.193143, 88.618043),\n (196.193143, 179.120557, 190.595657, 179.120557),\n (196.193143, 88.618043, 190.595657, 88.618043)\n]\nVISIBLE_CIRCLES = [\n (131.3444, 133.8693, 45.251257)\n]\nVISIBLE_ARCS = [\n\n]\nHIDDEN_SEGMENTS = [\n (104.9479, 74.618, 104.9479, 69.0205),\n (95.5205, 74.618, 95.5205, 69.0205),\n (108.7188, 74.618, 108.7188, 69.0205),\n (98.3487, 74.618, 98.3487, 69.0205),\n (125.688, 74.618, 125.688, 69.0205),\n (136.0581, 74.618, 136.0581, 69.0205),\n (127.5735, 74.618, 127.5735, 69.0205),\n (134.1726, 74.618, 134.1726, 69.0205),\n (156.7983, 74.618, 156.7983, 69.0205),\n (153.0273, 74.618, 153.0273, 69.0205),\n (166.2256, 74.618, 166.2256, 69.0205),\n (163.3974, 74.618, 163.3974, 69.0205),\n (190.5957, 122.5564, 196.1932, 122.5564),\n (190.5957, 116.9, 196.1932, 116.9),\n (190.5957, 111.2436, 196.1932, 111.2436),\n (190.5957, 139.5257, 196.1932, 139.5257),\n (190.5957, 128.2128, 196.1932, 128.2128),\n (190.5957, 173.4641, 196.1932, 173.4641),\n (190.5957, 161.2086, 196.1932, 161.2086)\n]\n# (orient, text, p1, p2, base) for linear; (orient, text, center, radius, angle) for diameter\nDIMENSIONS = [\n ('horizontal', '91.6667', (136.0581, 139.5257), (125.688, 139.5257), (130.8731, 128.5257)),\n ('vertical', '100', (136.0581, 128.2128), (136.0581, 139.5257), (125.0581, 133.8693)),\n ('diameter', '%%c800', (131.3444, 133.8693), 45.2513, 45),\n ('horizontal', '50', (125.688, 133.8693), (131.3444, 133.8693), (128.5162, 144.8693)),\n ('vertical', '50', (131.3444, 128.2128), (131.3444, 133.8693), (120.3444, 131.041)),\n ('horizontal', '116.667', (95.5205, 111.2436), (108.7188, 111.2436), (102.1197, 122.2436)),\n ('vertical', '100', (95.5205, 111.2436), (95.5205, 122.5564), (84.5205, 116.9)),\n ('horizontal', '266.667', (125.688, 111.2436), (95.5205, 111.2436), (110.6043, 100.2436)),\n ('vertical', '150', (95.5205, 128.2128), (95.5205, 111.2436), (106.5205, 119.7282)),\n ('horizontal', '58.3333', (127.5735, 161.2086), (134.1726, 161.2086), (130.8731, 172.2086)),\n ('vertical', '108.333', (127.5735, 161.2086), (127.5735, 173.4641), (116.5735, 167.3363)),\n ('horizontal', '16.6667', (125.688, 161.2086), (127.5735, 161.2086), (126.6307, 172.2086)),\n ('vertical', '291.667', (127.5735, 128.2128), (127.5735, 161.2086), (116.5735, 144.7107)),\n ('horizontal', '116.667', (153.0273, 111.2436), (166.2256, 111.2436), (159.6265, 122.2436)),\n ('vertical', '100', (153.0273, 111.2436), (153.0273, 122.5564), (142.0273, 116.9)),\n ('horizontal', '241.667', (125.688, 111.2436), (153.0273, 111.2436), (139.3577, 122.2436)),\n ('vertical', '150', (153.0273, 128.2128), (153.0273, 111.2436), (164.0273, 119.7282)),\n ('horizontal', '49.4792', (190.5957, 128.2128), (196.1932, 128.2128), (193.3944, 139.2128))\n]\n\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\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\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,\n angle=(0 if d[0] == \"horizontal\" else 90),\n 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,\n text=text, dimstyle=\"EZDXF\").render()\n\n doc.saveas(out_path)\n\n\nif __name__ == \"__main__\":\n out = sys.argv[1] if len(sys.argv) > 1 else \"0046_00460764_gt.dxf\"\n draw(out)\n print(\"wrote\", out)\n```"}], "images": ["images/0046_00460764.png"], "id": "0046_00460764"} {"messages": [{"role": "user", "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 78.95 mm tall, featuring 4 circular holes, each of diameter 6.32 mm and a rectangular cutout 80 x 52.63 mm. It is extruded to a thickness of 1.56 mm."}, {"role": "assistant", "content": "```python\n#!/usr/bin/env python3\n# -*- coding: utf-8 -*-\n# Ground-truth 2D engineering drawing for part: 0046_00461045\n# Self-contained: reproduces the three-view DXF via ezdxf, NO FreeCAD needed.\n# Coordinates are A4 page millimetres (scale=1.193642492339116, page=[297.0, 210.0]).\n# visible edges -> solid (layer OUTLINE); hidden edges -> dashed (layer HIDDEN)\n# dimensions -> real movable DIMENSION entities (text = true mm value)\n# Run: python 0046_00461045_gt.py [out.dxf]\nimport sys\nimport ezdxf\n\nSCALE = 1.193642492339116\nPAGE = [297.0, 210.0]\n\nVISIBLE_SEGMENTS = [\n (195.249548, 77.81503, 195.249548, 172.049963),\n (195.249548, 172.049963, 75.885299, 172.049963),\n (75.885299, 172.049963, 75.885299, 77.81503),\n (75.885299, 77.81503, 195.249548, 77.81503),\n (83.424094, 155.715908, 83.424094, 92.892619),\n (178.915493, 155.715908, 83.424094, 155.715908),\n (178.915493, 92.892619, 178.915493, 155.715908),\n (83.424094, 92.892619, 178.915493, 92.892619),\n (195.249548, 63.81503, 195.249548, 61.949963),\n (195.249548, 61.949963, 75.885299, 61.949963),\n (75.885299, 63.81503, 75.885299, 61.949963),\n (195.249548, 63.81503, 75.885299, 63.81503),\n (209.249548, 172.049963, 211.114615, 172.049963),\n (211.114615, 172.049963, 211.114615, 77.81503),\n (209.249548, 77.81503, 211.114615, 77.81503),\n (209.249548, 172.049963, 209.249548, 77.81503)\n]\nVISIBLE_CIRCLES = [\n (101.014615, 84.097359, 3.769397),\n (103.527546, 165.767635, 3.769397),\n (188.967219, 91.636153, 3.769397),\n (188.967219, 139.381853, 3.769397)\n]\nVISIBLE_ARCS = [\n\n]\nHIDDEN_SEGMENTS = [\n (83.4241, 63.8151, 83.4241, 61.95),\n (178.9155, 63.8151, 178.9155, 61.95),\n (104.7841, 63.8151, 104.7841, 61.95),\n (107.297, 63.8151, 107.297, 61.95),\n (192.7367, 63.8151, 192.7367, 61.95),\n (97.2453, 61.95, 97.2453, 63.8151),\n (99.7582, 61.95, 99.7582, 63.8151),\n (185.1979, 61.95, 185.1979, 63.8151),\n (209.2496, 155.7159, 211.1147, 155.7159),\n (209.2496, 92.8927, 211.1147, 92.8927),\n (211.1147, 87.8668, 209.2496, 87.8668),\n (211.1147, 80.328, 209.2496, 80.328),\n (211.1147, 169.5371, 209.2496, 169.5371),\n (211.1147, 161.9983, 209.2496, 161.9983),\n (211.1147, 95.4056, 209.2496, 95.4056),\n (211.1147, 143.1513, 209.2496, 143.1513),\n (211.1147, 135.6125, 209.2496, 135.6125)\n]\n# (orient, text, p1, p2, base) for linear; (orient, text, center, radius, angle) for diameter\nDIMENSIONS = [\n ('horizontal', '100', (195.2496, 172.05), (75.8853, 172.05), (135.5675, 161.05)),\n ('vertical', '78.9474', (195.2496, 77.8151), (195.2496, 172.05), (184.2496, 124.9326)),\n ('diameter', '%%c6.3158', (101.0146, 84.0974), 3.7694, 45),\n ('horizontal', '21.0526', (75.8853, 84.0974), (101.0146, 84.0974), (88.45, 95.0974)),\n ('vertical', '5.2632', (101.0146, 77.8151), (101.0146, 84.0974), (90.0146, 80.9563)),\n ('diameter', '%%c6.3158', (103.5276, 165.7677), 3.7694, 45),\n ('horizontal', '23.1579', (75.8853, 165.7677), (103.5276, 165.7677), (89.7065, 176.7677)),\n ('vertical', '73.6842', (103.5276, 77.8151), (103.5276, 165.7677), (92.5276, 121.7914)),\n ('diameter', '%%c6.3158', (188.9672, 91.6361), 3.7694, 45),\n ('horizontal', '94.7368', (75.8853, 91.6361), (188.9672, 91.6361), (132.4263, 102.6361)),\n ('vertical', '11.5789', (188.9672, 77.8151), (188.9672, 91.6361), (177.9672, 84.7256)),\n ('diameter', '%%c6.3158', (188.9672, 139.3818), 3.7694, 45),\n ('horizontal', '94.7368', (75.8853, 139.3818), (188.9672, 139.3818), (132.4263, 150.3818)),\n ('vertical', '51.5789', (188.9672, 77.8151), (188.9672, 139.3818), (177.9672, 108.5984)),\n ('horizontal', '80', (83.4241, 92.8927), (178.9155, 92.8927), (131.1698, 103.8927)),\n ('vertical', '52.6316', (83.4241, 92.8927), (83.4241, 155.716), (72.4241, 124.3043)),\n ('horizontal', '6.3158', (75.8853, 92.8927), (83.4241, 92.8927), (79.6547, 103.8927)),\n ('vertical', '12.6316', (83.4241, 77.8151), (83.4241, 92.8927), (72.4241, 85.3539)),\n ('horizontal', '1.5625', (209.2496, 77.8151), (211.1147, 77.8151), (210.1821, 88.8151))\n]\n\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\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\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,\n angle=(0 if d[0] == \"horizontal\" else 90),\n 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,\n text=text, dimstyle=\"EZDXF\").render()\n\n doc.saveas(out_path)\n\n\nif __name__ == \"__main__\":\n out = sys.argv[1] if len(sys.argv) > 1 else \"0046_00461045_gt.dxf\"\n draw(out)\n print(\"wrote\", out)\n```"}], "images": ["images/0046_00461045.png"], "id": "0046_00461045"} {"messages": [{"role": "user", "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": "assistant", "content": "```python\n#!/usr/bin/env python3\n# -*- coding: utf-8 -*-\n# Ground-truth 2D engineering drawing for part: 0046_00469966\n# Self-contained: reproduces the three-view DXF via ezdxf, NO FreeCAD needed.\n# Coordinates are A4 page millimetres (scale=0.9247575289575778, page=[297.0, 210.0]).\n# visible edges -> solid (layer OUTLINE); hidden edges -> dashed (layer HIDDEN)\n# dimensions -> real movable DIMENSION entities (text = true mm value)\n# Run: python 0046_00469966_gt.py [out.dxf]\nimport sys\nimport ezdxf\n\nSCALE = 0.9247575289575778\nPAGE = [297.0, 210.0]\n\nVISIBLE_SEGMENTS = [\n (155.505762, 167.780393, 155.505762, 134.683807),\n (155.505762, 134.683807, 63.030009, 134.683807),\n (63.030009, 134.683807, 63.030009, 167.780393),\n (63.030009, 167.780393, 155.505762, 167.780393),\n (155.505762, 66.21956, 155.505762, 120.683807),\n (155.505762, 120.683807, 63.030009, 120.683807),\n (63.030009, 66.21956, 63.030009, 120.683807),\n (155.505762, 66.21956, 63.030009, 66.21956),\n (169.505762, 134.683807, 223.970009, 134.683807),\n (223.970009, 134.683807, 223.970009, 167.780393),\n (169.505762, 167.780393, 223.970009, 167.780393),\n (169.505762, 134.683807, 169.505762, 167.780393)\n]\nVISIBLE_CIRCLES = [\n (109.7546, 151.2321, 10.707719)\n]\nVISIBLE_ARCS = [\n\n]\nHIDDEN_SEGMENTS = [\n (120.4623, 120.6838, 120.4623, 66.2196),\n (99.0469, 66.2196, 99.0469, 120.6838),\n (223.97, 161.9398, 169.5058, 161.9398),\n (223.97, 140.5244, 169.5058, 140.5244)\n]\n# (orient, text, p1, p2, base) for linear; (orient, text, center, radius, angle) for diameter\nDIMENSIONS = [\n ('horizontal', '100', (155.5058, 167.7805), (63.03, 167.7805), (109.2679, 156.7805)),\n ('vertical', '35.7895', (155.5058, 134.6838), (155.5058, 167.7805), (144.5058, 151.2321)),\n ('diameter', '%%c23.1579', (109.7546, 151.2321), 10.7077, 45),\n ('horizontal', '50.5263', (63.03, 151.2321), (109.7546, 151.2321), (86.3923, 162.2321)),\n ('vertical', '17.8947', (109.7546, 134.6838), (109.7546, 151.2321), (98.7546, 142.958)),\n ('horizontal', '58.8957', (169.5058, 134.6838), (223.97, 134.6838), (196.7379, 145.6838))\n]\n\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\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\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,\n angle=(0 if d[0] == \"horizontal\" else 90),\n 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,\n text=text, dimstyle=\"EZDXF\").render()\n\n doc.saveas(out_path)\n\n\nif __name__ == \"__main__\":\n out = sys.argv[1] if len(sys.argv) > 1 else \"0046_00469966_gt.dxf\"\n draw(out)\n print(\"wrote\", out)\n```"}], "images": ["images/0046_00469966.png"], "id": "0046_00469966"} {"messages": [{"role": "user", "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": "assistant", "content": "```python\n#!/usr/bin/env python3\n# -*- coding: utf-8 -*-\n# Ground-truth 2D engineering drawing for part: 0049_00490218\n# Self-contained: reproduces the three-view DXF via ezdxf, NO FreeCAD needed.\n# Coordinates are A4 page millimetres (scale=0.9247575289575778, page=[297.0, 210.0]).\n# visible edges -> solid (layer OUTLINE); hidden edges -> dashed (layer HIDDEN)\n# dimensions -> real movable DIMENSION entities (text = true mm value)\n# Run: python 0049_00490218_gt.py [out.dxf]\nimport sys\nimport ezdxf\n\nSCALE = 0.9247575289575778\nPAGE = [297.0, 210.0]\n\nVISIBLE_SEGMENTS = [\n (155.505762, 167.780393, 155.505762, 134.683807),\n (155.505762, 134.683807, 63.030009, 134.683807),\n (63.030009, 134.683807, 63.030009, 167.780393),\n (63.030009, 167.780393, 155.505762, 167.780393),\n (155.505762, 66.21956, 155.505762, 120.683807),\n (155.505762, 120.683807, 63.030009, 120.683807),\n (63.030009, 66.21956, 63.030009, 120.683807),\n (155.505762, 66.21956, 63.030009, 66.21956),\n (169.505762, 134.683807, 223.970009, 134.683807),\n (223.970009, 134.683807, 223.970009, 167.780393),\n (169.505762, 167.780393, 223.970009, 167.780393),\n (169.505762, 134.683807, 169.505762, 167.780393)\n]\nVISIBLE_CIRCLES = [\n (109.7546, 151.2321, 10.707719)\n]\nVISIBLE_ARCS = [\n\n]\nHIDDEN_SEGMENTS = [\n (120.4623, 120.6838, 120.4623, 66.2196),\n (99.0469, 66.2196, 99.0469, 120.6838),\n (223.97, 161.9398, 169.5058, 161.9398),\n (223.97, 140.5244, 169.5058, 140.5244)\n]\n# (orient, text, p1, p2, base) for linear; (orient, text, center, radius, angle) for diameter\nDIMENSIONS = [\n ('horizontal', '100', (155.5058, 167.7805), (63.03, 167.7805), (109.2679, 156.7805)),\n ('vertical', '35.7895', (155.5058, 134.6838), (155.5058, 167.7805), (144.5058, 151.2321)),\n ('diameter', '%%c23.1579', (109.7546, 151.2321), 10.7077, 45),\n ('horizontal', '50.5263', (63.03, 151.2321), (109.7546, 151.2321), (86.3923, 162.2321)),\n ('vertical', '17.8947', (109.7546, 134.6838), (109.7546, 151.2321), (98.7546, 142.958)),\n ('horizontal', '58.8957', (169.5058, 134.6838), (223.97, 134.6838), (196.7379, 145.6838))\n]\n\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\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\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,\n angle=(0 if d[0] == \"horizontal\" else 90),\n 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,\n text=text, dimstyle=\"EZDXF\").render()\n\n doc.saveas(out_path)\n\n\nif __name__ == \"__main__\":\n out = sys.argv[1] if len(sys.argv) > 1 else \"0049_00490218_gt.dxf\"\n draw(out)\n print(\"wrote\", out)\n```"}], "images": ["images/0049_00490218.png"], "id": "0049_00490218"} {"messages": [{"role": "user", "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, featuring 3 circular holes, each of diameter 2.11 mm. It is extruded to a thickness of 2.6 mm."}, {"role": "assistant", "content": "```python\n#!/usr/bin/env python3\n# -*- coding: utf-8 -*-\n# Ground-truth 2D engineering drawing for part: 0054_00549420\n# Self-contained: reproduces the three-view DXF via ezdxf, NO FreeCAD needed.\n# Coordinates are A4 page millimetres (scale=1.3966574257425657, page=[297.0, 210.0]).\n# visible edges -> solid (layer OUTLINE); hidden edges -> dashed (layer HIDDEN)\n# dimensions -> real movable DIMENSION entities (text = true mm value)\n# Run: python 0054_00549420_gt.py [out.dxf]\nimport sys\nimport ezdxf\n\nSCALE = 1.3966574257425657\nPAGE = [297.0, 210.0]\n\nVISIBLE_SEGMENTS = [\n (202.695737, 109.260034, 202.695737, 146.014177),\n (63.029994, 109.260034, 202.695737, 109.260034),\n (202.695737, 146.014177, 63.029994, 146.014177),\n (63.029994, 146.014177, 63.029994, 109.260034),\n (202.695737, 95.260034, 202.695737, 87.985777),\n (202.695737, 87.985777, 63.029994, 87.985777),\n (63.029994, 95.260034, 63.029994, 87.985777),\n (202.695737, 95.260034, 63.029994, 95.260034),\n (223.969994, 109.260034, 216.695737, 109.260034),\n (216.695737, 146.014177, 223.969994, 146.014177),\n (223.969994, 146.014177, 223.969994, 109.260034),\n (216.695737, 146.014177, 216.695737, 109.260034)\n]\nVISIBLE_CIRCLES = [\n (77.731651, 138.663349, 1.470166),\n (85.08248, 118.081029, 1.470166),\n (154.180268, 126.902023, 1.470166)\n]\nVISIBLE_ARCS = [\n\n]\nHIDDEN_SEGMENTS = [\n (79.2018, 87.9858, 79.2018, 95.2601),\n (86.5527, 87.9858, 86.5527, 95.2601),\n (155.6504, 87.9858, 155.6504, 95.2601),\n (76.2615, 87.9858, 76.2615, 95.2601),\n (83.6123, 87.9858, 83.6123, 95.2601),\n (152.7101, 87.9858, 152.7101, 95.2601),\n (223.97, 140.1335, 216.6957, 140.1335),\n (223.97, 137.1932, 216.6957, 137.1932),\n (223.97, 119.5512, 216.6957, 119.5512),\n (223.97, 116.6109, 216.6957, 116.6109),\n (223.97, 128.3722, 216.6957, 128.3722),\n (223.97, 125.4319, 216.6957, 125.4319)\n]\n# (orient, text, p1, p2, base) for linear; (orient, text, center, radius, angle) for diameter\nDIMENSIONS = [\n ('horizontal', '100', (202.6957, 146.0142), (63.03, 146.0142), (132.8629, 135.0142)),\n ('vertical', '26.3158', (202.6957, 109.26), (202.6957, 146.0142), (191.6957, 127.6371)),\n ('diameter', '%%c2.1053', (77.7316, 138.6634), 1.4702, 45),\n ('horizontal', '10.5263', (63.03, 138.6634), (77.7316, 138.6634), (70.3808, 149.6634)),\n ('vertical', '21.0526', (77.7316, 109.26), (77.7316, 138.6634), (66.7316, 123.9617)),\n ('diameter', '%%c2.1053', (85.0825, 118.081), 1.4702, 45),\n ('horizontal', '15.7895', (63.03, 118.081), (85.0825, 118.081), (74.0563, 129.081)),\n ('vertical', '6.3158', (85.0825, 109.26), (85.0825, 118.081), (74.0825, 113.6705)),\n ('diameter', '%%c2.1053', (154.1803, 126.902), 1.4702, 45),\n ('horizontal', '65.2632', (63.03, 126.902), (154.1803, 126.902), (108.6052, 137.902)),\n ('vertical', '12.6316', (154.1803, 109.26), (154.1803, 126.902), (143.1803, 118.081)),\n ('horizontal', '5.2083', (216.6957, 109.26), (223.97, 109.26), (220.3329, 120.26))\n]\n\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\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\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,\n angle=(0 if d[0] == \"horizontal\" else 90),\n 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,\n text=text, dimstyle=\"EZDXF\").render()\n\n doc.saveas(out_path)\n\n\nif __name__ == \"__main__\":\n out = sys.argv[1] if len(sys.argv) > 1 else \"0054_00549420_gt.dxf\"\n draw(out)\n print(\"wrote\", out)\n```"}], "images": ["images/0054_00549420.png"], "id": "0054_00549420"} {"messages": [{"role": "user", "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 8.42 mm tall, featuring 2 circular holes, each of diameter 2.11 mm. It is extruded to a thickness of -1.13 mm."}, {"role": "assistant", "content": "```python\n#!/usr/bin/env python3\n# -*- coding: utf-8 -*-\n# Ground-truth 2D engineering drawing for part: 0058_00582478\n# Self-contained: reproduces the three-view DXF via ezdxf, NO FreeCAD needed.\n# Coordinates are A4 page millimetres (scale=1.4529821229050688, page=[297.0, 210.0]).\n# visible edges -> solid (layer OUTLINE); hidden edges -> dashed (layer HIDDEN)\n# dimensions -> real movable DIMENSION entities (text = true mm value)\n# Run: python 0058_00582478_gt.py [out.dxf]\nimport sys\nimport ezdxf\n\nSCALE = 1.4529821229050688\nPAGE = [297.0, 210.0]\n\nVISIBLE_SEGMENTS = [\n (208.328206, 130.938719, 208.328206, 118.703081),\n (208.328206, 118.703081, 63.029994, 118.703081),\n (63.029994, 118.703081, 63.029994, 130.938719),\n (63.029994, 130.938719, 208.328206, 130.938719),\n (208.328206, 104.703081, 208.328206, 103.061293),\n (208.328206, 103.061293, 63.029994, 103.061293),\n (63.029994, 104.703081, 63.029994, 103.061293),\n (208.328206, 104.703081, 63.029994, 104.703081),\n (223.969994, 118.703081, 222.328206, 118.703081),\n (222.328206, 118.703081, 222.328206, 130.938719),\n (223.969994, 130.938719, 222.328206, 130.938719),\n (223.969994, 118.703081, 223.969994, 130.938719)\n]\nVISIBLE_CIRCLES = [\n (92.089636, 124.8209, 1.529455),\n (179.268564, 124.8209, 1.529455)\n]\nVISIBLE_ARCS = [\n\n]\nHIDDEN_SEGMENTS = [\n (93.6191, 103.0613, 93.6191, 104.7031),\n (180.798, 103.0613, 180.798, 104.7031),\n (90.5602, 104.7031, 90.5602, 103.0613),\n (177.7391, 104.7031, 177.7391, 103.0613),\n (222.3282, 123.2914, 223.97, 123.2914),\n (222.3282, 126.3503, 223.97, 126.3503)\n]\n# (orient, text, p1, p2, base) for linear; (orient, text, center, radius, angle) for diameter\nDIMENSIONS = [\n ('horizontal', '100', (208.3282, 130.9388), (63.03, 130.9388), (135.6791, 119.9388)),\n ('vertical', '8.4211', (208.3282, 118.7031), (208.3282, 130.9388), (197.3282, 124.8209)),\n ('diameter', '%%c2.1053', (92.0896, 124.8209), 1.5295, 45),\n ('horizontal', '20', (63.03, 124.8209), (92.0896, 124.8209), (77.5598, 135.8209)),\n ('vertical', '4.2105', (92.0896, 118.7031), (92.0896, 124.8209), (81.0896, 121.762)),\n ('diameter', '%%c2.1053', (179.2686, 124.8209), 1.5295, 45),\n ('horizontal', '80', (63.03, 124.8209), (179.2686, 124.8209), (121.1493, 135.8209)),\n ('vertical', '4.2105', (179.2686, 118.7031), (179.2686, 124.8209), (168.2686, 121.762)),\n ('horizontal', '1.1299', (223.97, 118.7031), (222.3283, 118.7031), (223.1491, 107.7031))\n]\n\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\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\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,\n angle=(0 if d[0] == \"horizontal\" else 90),\n 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,\n text=text, dimstyle=\"EZDXF\").render()\n\n doc.saveas(out_path)\n\n\nif __name__ == \"__main__\":\n out = sys.argv[1] if len(sys.argv) > 1 else \"0058_00582478_gt.dxf\"\n draw(out)\n print(\"wrote\", out)\n```"}], "images": ["images/0058_00582478.png"], "id": "0058_00582478"} {"messages": [{"role": "user", "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": "assistant", "content": "```python\n#!/usr/bin/env python3\n# -*- coding: utf-8 -*-\n# Ground-truth 2D engineering drawing for part: 0065_00650480\n# Self-contained: reproduces the three-view DXF via ezdxf, NO FreeCAD needed.\n# Coordinates are A4 page millimetres (scale=0.9247575289575778, page=[297.0, 210.0]).\n# visible edges -> solid (layer OUTLINE); hidden edges -> dashed (layer HIDDEN)\n# dimensions -> real movable DIMENSION entities (text = true mm value)\n# Run: python 0065_00650480_gt.py [out.dxf]\nimport sys\nimport ezdxf\n\nSCALE = 0.9247575289575778\nPAGE = [297.0, 210.0]\n\nVISIBLE_SEGMENTS = [\n (155.505762, 167.780393, 155.505762, 134.683807),\n (155.505762, 134.683807, 63.030009, 134.683807),\n (63.030009, 134.683807, 63.030009, 167.780393),\n (63.030009, 167.780393, 155.505762, 167.780393),\n (155.505762, 66.21956, 155.505762, 120.683807),\n (155.505762, 120.683807, 63.030009, 120.683807),\n (63.030009, 66.21956, 63.030009, 120.683807),\n (155.505762, 66.21956, 63.030009, 66.21956),\n (169.505762, 134.683807, 223.970009, 134.683807),\n (223.970009, 134.683807, 223.970009, 167.780393),\n (169.505762, 167.780393, 223.970009, 167.780393),\n (169.505762, 134.683807, 169.505762, 167.780393)\n]\nVISIBLE_CIRCLES = [\n (109.7546, 151.2321, 10.707719)\n]\nVISIBLE_ARCS = [\n\n]\nHIDDEN_SEGMENTS = [\n (120.4623, 120.6838, 120.4623, 66.2196),\n (99.0469, 66.2196, 99.0469, 120.6838),\n (223.97, 161.9398, 169.5058, 161.9398),\n (223.97, 140.5244, 169.5058, 140.5244)\n]\n# (orient, text, p1, p2, base) for linear; (orient, text, center, radius, angle) for diameter\nDIMENSIONS = [\n ('horizontal', '100', (155.5058, 167.7805), (63.03, 167.7805), (109.2679, 156.7805)),\n ('vertical', '35.7895', (155.5058, 134.6838), (155.5058, 167.7805), (144.5058, 151.2321)),\n ('diameter', '%%c23.1579', (109.7546, 151.2321), 10.7077, 45),\n ('horizontal', '50.5263', (63.03, 151.2321), (109.7546, 151.2321), (86.3923, 162.2321)),\n ('vertical', '17.8947', (109.7546, 134.6838), (109.7546, 151.2321), (98.7546, 142.958)),\n ('horizontal', '58.8957', (169.5058, 134.6838), (223.97, 134.6838), (196.7379, 145.6838))\n]\n\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\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\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,\n angle=(0 if d[0] == \"horizontal\" else 90),\n 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,\n text=text, dimstyle=\"EZDXF\").render()\n\n doc.saveas(out_path)\n\n\nif __name__ == \"__main__\":\n out = sys.argv[1] if len(sys.argv) > 1 else \"0065_00650480_gt.dxf\"\n draw(out)\n print(\"wrote\", out)\n```"}], "images": ["images/0065_00650480.png"], "id": "0065_00650480"} {"messages": [{"role": "user", "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, featuring a circular hole of diameter 21.05 mm. It is extruded to a thickness of -25 mm."}, {"role": "assistant", "content": "```python\n#!/usr/bin/env python3\n# -*- coding: utf-8 -*-\n# Ground-truth 2D engineering drawing for part: 0065_00656222\n# Self-contained: reproduces the three-view DXF via ezdxf, NO FreeCAD needed.\n# Coordinates are A4 page millimetres (scale=0.8163333333333331, page=[297.0, 210.0]).\n# visible edges -> solid (layer OUTLINE); hidden edges -> dashed (layer HIDDEN)\n# dimensions -> real movable DIMENSION entities (text = true mm value)\n# Run: python 0065_00656222_gt.py [out.dxf]\nimport sys\nimport ezdxf\n\nSCALE = 0.8163333333333331\nPAGE = [297.0, 210.0]\n\nVISIBLE_SEGMENTS = [\n (167.112518, 166.857496, 167.112518, 101.55083),\n (167.112518, 101.55083, 85.479184, 101.55083),\n (85.479184, 101.55083, 85.479184, 166.857496),\n (85.479184, 166.857496, 167.112518, 166.857496),\n (167.112518, 87.55083, 167.112518, 67.142496),\n (85.479184, 87.55083, 85.479184, 67.142496),\n (85.479184, 67.142496, 167.112518, 67.142496),\n (85.479184, 87.55083, 167.112518, 87.55083),\n (181.112518, 101.55083, 201.520851, 101.55083),\n (201.520851, 101.55083, 201.520851, 166.857496),\n (181.112518, 166.857496, 201.520851, 166.857496),\n (181.112518, 101.55083, 181.112518, 166.857496)\n]\nVISIBLE_CIRCLES = [\n (126.7255, 116.1589, 8.592982)\n]\nVISIBLE_ARCS = [\n\n]\nHIDDEN_SEGMENTS = [\n (135.3185, 87.5508, 135.3185, 67.1425),\n (118.1325, 67.1425, 118.1325, 87.5508),\n (201.5208, 124.7519, 181.1125, 124.7519),\n (201.5208, 107.5659, 181.1125, 107.5659)\n]\n# (orient, text, p1, p2, base) for linear; (orient, text, center, radius, angle) for diameter\nDIMENSIONS = [\n ('horizontal', '100', (167.1125, 101.5508), (85.4792, 101.5508), (126.2958, 90.5508)),\n ('vertical', '80', (167.1125, 166.8575), (167.1125, 101.5508), (178.1125, 134.2042)),\n ('diameter', '%%c21.0526', (126.7255, 116.1589), 8.593, 45),\n ('horizontal', '50.5263', (85.4792, 116.1589), (126.7255, 116.1589), (106.1023, 127.1589)),\n ('vertical', '62.1053', (126.7255, 166.8575), (126.7255, 116.1589), (137.7255, 141.5082)),\n ('horizontal', '25', (181.1125, 166.8575), (201.5208, 166.8575), (191.3167, 177.8575))\n]\n\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\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\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,\n angle=(0 if d[0] == \"horizontal\" else 90),\n 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,\n text=text, dimstyle=\"EZDXF\").render()\n\n doc.saveas(out_path)\n\n\nif __name__ == \"__main__\":\n out = sys.argv[1] if len(sys.argv) > 1 else \"0065_00656222_gt.dxf\"\n draw(out)\n print(\"wrote\", out)\n```"}], "images": ["images/0065_00656222.png"], "id": "0065_00656222"} {"messages": [{"role": "user", "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 119.84 mm. It is extruded to a thickness of 86.25 mm. The outline includes one or more oblique (angled) edges."}, {"role": "assistant", "content": "```python\n#!/usr/bin/env python3\n# -*- coding: utf-8 -*-\n# Ground-truth 2D engineering drawing for part: 0066_00667169\n# Self-contained: reproduces the three-view DXF via ezdxf, NO FreeCAD needed.\n# Coordinates are A4 page millimetres (scale=0.3381779217969642, page=[297.0, 210.0]).\n# visible edges -> solid (layer OUTLINE); hidden edges -> dashed (layer HIDDEN)\n# dimensions -> real movable DIMENSION entities (text = true mm value)\n# Run: python 0066_00667169_gt.py [out.dxf]\nimport sys\nimport ezdxf\nimport math\n\nSCALE = 0.3381779217969642\nPAGE = [297.0, 210.0]\n\nVISIBLE_SEGMENTS = [\n (122.2232, 105.117695, 151.083903, 121.697247),\n (151.083903, 121.697247, 151.083903, 155.47041),\n (151.083903, 155.47041, 122.2232, 172.049963),\n (122.2232, 172.049963, 92.74844, 155.47041),\n (92.74844, 155.47041, 92.74844, 121.697247),\n (92.74844, 121.697247, 122.2232, 105.117695),\n (151.083903, 91.117694, 151.083903, 61.949963),\n (151.083903, 61.949963, 122.2232, 61.949963),\n (122.2232, 91.117694, 122.2232, 61.949963),\n (151.083903, 91.117694, 122.2232, 91.117694),\n (122.2232, 61.949963, 92.74844, 61.949963),\n (92.74844, 91.117694, 92.74844, 61.949963),\n (122.2232, 91.117694, 92.74844, 91.117694),\n (165.083903, 105.117695, 194.251635, 105.117695),\n (165.083903, 172.049963, 194.251635, 172.049963),\n (194.251635, 172.049963, 194.251635, 155.47041),\n (165.083903, 155.47041, 194.251635, 155.47041),\n (165.083903, 172.049963, 165.083903, 155.47041),\n (194.251635, 155.47041, 194.251635, 121.697247),\n (165.083903, 121.697247, 194.251635, 121.697247),\n (165.083903, 155.47041, 165.083903, 121.697247),\n (194.251635, 121.697247, 194.251635, 105.117695),\n (165.083903, 121.697247, 165.083903, 105.117695)\n]\nVISIBLE_CIRCLES = [\n (122.2232, 138.2768, 20.263898)\n]\nVISIBLE_ARCS = [\n\n]\nHIDDEN_SEGMENTS = [\n (142.4871, 91.1177, 142.4871, 61.95),\n (101.9593, 61.95, 101.9593, 91.1177),\n (194.2516, 158.5407, 165.0839, 158.5407),\n (194.2516, 118.0129, 165.0839, 118.0129)\n]\n# (orient, text, p1, p2, base) for linear; (orient, text, center, radius, angle) for diameter\nDIMENSIONS = [\n ('vertical', '99.868', (151.0839, 121.6973), (151.0839, 155.4704), (140.0839, 138.5839)),\n ('aligned', '98.4214', (122.2232, 105.1177), (151.0839, 121.6973), (131.1742, 122.9457)),\n ('aligned', '98.4214', (151.0839, 155.4704), (122.2232, 172.05), (131.1742, 154.2221)),\n ('aligned', '100', (122.2232, 172.05), (92.7484, 155.4704), (112.8786, 154.1729)),\n ('aligned', '100', (92.7484, 121.6973), (122.2232, 105.1177), (112.8786, 122.9949)),\n ('diameter', '%%c119.842', (122.2232, 138.2768), 20.2639, 45),\n ('horizontal', '87.1576', (92.7484, 138.2768), (122.2232, 138.2768), (107.4858, 149.2768)),\n ('vertical', '98.0522', (122.2232, 105.1177), (122.2232, 138.2768), (111.2232, 121.6973)),\n ('horizontal', '86.2497', (165.0839, 105.1177), (194.2516, 105.1177), (179.6677, 116.1177))\n]\n\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; _ds.dxf.dimasz = 2.5\n _ds.dxf.dimexe = 1.25; _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\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\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,\n angle=(0 if d[0] == \"horizontal\" else 90),\n 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,\n 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,\n 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,\n text=text, dimstyle=\"EZDXF\").render()\n\n doc.saveas(out_path)\n\n\nif __name__ == \"__main__\":\n out = sys.argv[1] if len(sys.argv) > 1 else \"0066_00667169_gt.dxf\"\n draw(out)\n print(\"wrote\", out)\n```"}], "images": ["images/0066_00667169.png"], "id": "0066_00667169"} {"messages": [{"role": "user", "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 113.67 mm. It is extruded to a thickness of 57.28 mm. The outline includes one or more oblique (angled) edges."}, {"role": "assistant", "content": "```python\n#!/usr/bin/env python3\n# -*- coding: utf-8 -*-\n# Ground-truth 2D engineering drawing for part: 0066_00669454\n# Self-contained: reproduces the three-view DXF via ezdxf, NO FreeCAD needed.\n# Coordinates are A4 page millimetres (scale=0.3943960427256723, page=[297.0, 210.0]).\n# visible edges -> solid (layer OUTLINE); hidden edges -> dashed (layer HIDDEN)\n# dimensions -> real movable DIMENSION entities (text = true mm value)\n# Run: python 0066_00669454_gt.py [out.dxf]\nimport sys\nimport ezdxf\nimport math\n\nSCALE = 0.3943960427256723\nPAGE = [297.0, 210.0]\n\nVISIBLE_SEGMENTS = [\n (105.695132, 101.258951, 144.713098, 101.258951),\n (144.713098, 101.258951, 164.637166, 135.2959),\n (164.637166, 135.2959, 144.713098, 169.332849),\n (144.713098, 169.332849, 105.695132, 169.332849),\n (105.695132, 169.332849, 85.771064, 135.2959),\n (85.771064, 135.2959, 105.695132, 101.258951),\n (105.695132, 87.258951, 105.695132, 64.667099),\n (105.695132, 64.667099, 144.713098, 64.667099),\n (144.713098, 87.258951, 144.713098, 64.667099),\n (105.695132, 87.258951, 144.713098, 87.258951),\n (144.713098, 64.667099, 164.637166, 64.667099),\n (164.637166, 87.258951, 164.637166, 64.667099),\n (144.713098, 87.258951, 164.637166, 87.258951),\n (85.771064, 87.258951, 85.771064, 64.667099),\n (85.771064, 64.667099, 105.695132, 64.667099),\n (85.771064, 87.258951, 105.695132, 87.258951),\n (201.229018, 101.258951, 178.637166, 101.258951),\n (201.229018, 169.332849, 178.637166, 169.332849),\n (178.637166, 169.332849, 178.637166, 135.2959),\n (201.229018, 135.2959, 178.637166, 135.2959),\n (201.229018, 169.332849, 201.229018, 135.2959),\n (178.637166, 135.2959, 178.637166, 101.258951),\n (201.229018, 135.2959, 201.229018, 101.258951)\n]\nVISIBLE_CIRCLES = [\n (125.6192, 135.2959, 22.414576)\n]\nVISIBLE_ARCS = [\n\n]\nHIDDEN_SEGMENTS = [\n (148.0337, 64.6671, 148.0337, 87.259),\n (103.2046, 87.259, 103.2046, 64.6671),\n (178.6371, 112.8813, 201.229, 112.8813),\n (178.6371, 157.7105, 201.229, 157.7105)\n]\n# (orient, text, p1, p2, base) for linear; (orient, text, center, radius, angle) for diameter\nDIMENSIONS = [\n ('horizontal', '98.9309', (105.6951, 169.3329), (144.7131, 169.3329), (125.2041, 180.3329)),\n ('aligned', '100', (144.7131, 169.3329), (164.6371, 135.2959), (164.1683, 157.8714)),\n ('aligned', '100', (164.6371, 135.2959), (144.7131, 101.259), (164.1683, 112.7205)),\n ('aligned', '100', (105.6951, 101.259), (85.771, 135.2959), (86.2399, 112.7205)),\n ('aligned', '100', (85.771, 135.2959), (105.6951, 169.3329), (86.2399, 157.8714)),\n ('diameter', '%%c113.665', (125.6192, 135.2959), 22.4146, 45),\n ('horizontal', '101.036', (85.771, 135.2959), (125.6192, 135.2959), (105.6951, 146.2959)),\n ('vertical', '86.3014', (125.6192, 169.3329), (125.6192, 135.2959), (136.6192, 152.3144)),\n ('horizontal', '57.2821', (201.229, 169.3329), (178.6371, 169.3329), (189.9331, 158.3329))\n]\n\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; _ds.dxf.dimasz = 2.5\n _ds.dxf.dimexe = 1.25; _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\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\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,\n angle=(0 if d[0] == \"horizontal\" else 90),\n 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,\n 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,\n 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,\n text=text, dimstyle=\"EZDXF\").render()\n\n doc.saveas(out_path)\n\n\nif __name__ == \"__main__\":\n out = sys.argv[1] if len(sys.argv) > 1 else \"0066_00669454_gt.dxf\"\n draw(out)\n print(\"wrote\", out)\n```"}], "images": ["images/0066_00669454.png"], "id": "0066_00669454"} {"messages": [{"role": "user", "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, featuring a circular hole of diameter 10.53 mm. It is extruded to a thickness of 14.43 mm."}, {"role": "assistant", "content": "```python\n#!/usr/bin/env python3\n# -*- coding: utf-8 -*-\n# Ground-truth 2D engineering drawing for part: 0068_00687627\n# Self-contained: reproduces the three-view DXF via ezdxf, NO FreeCAD needed.\n# Coordinates are A4 page millimetres (scale=1.0495714285714883, page=[297.0, 210.0]).\n# visible edges -> solid (layer OUTLINE); hidden edges -> dashed (layer HIDDEN)\n# dimensions -> real movable DIMENSION entities (text = true mm value)\n# Run: python 0068_00687627_gt.py [out.dxf]\nimport sys\nimport ezdxf\n\nSCALE = 1.0495714285714883\nPAGE = [297.0, 210.0]\n\nVISIBLE_SEGMENTS = [\n (181.40437, 110.582771, 181.40437, 152.565629),\n (181.40437, 152.565629, 76.447227, 152.565629),\n (76.447227, 152.565629, 76.447227, 110.582771),\n (76.447227, 110.582771, 181.40437, 110.582771),\n (181.40437, 96.582771, 181.40437, 81.434318),\n (76.447227, 96.582771, 76.447227, 81.434318),\n (76.447227, 81.434318, 181.40437, 81.434318),\n (76.447227, 96.582771, 181.40437, 96.582771),\n (210.552824, 152.565629, 195.40437, 152.565629),\n (195.40437, 152.565629, 195.40437, 110.582771),\n (210.552824, 110.582771, 195.40437, 110.582771),\n (210.552824, 152.565629, 210.552824, 110.582771)\n]\nVISIBLE_CIRCLES = [\n (110.6964, 131.5742, 5.52406)\n]\nVISIBLE_ARCS = [\n\n]\nHIDDEN_SEGMENTS = [\n (116.2204, 81.4343, 116.2204, 96.5828),\n (105.1723, 96.5828, 105.1723, 81.4343),\n (195.4043, 126.0502, 210.5528, 126.0502),\n (195.4043, 137.0983, 210.5528, 137.0983)\n]\n# (orient, text, p1, p2, base) for linear; (orient, text, center, radius, angle) for diameter\nDIMENSIONS = [\n ('horizontal', '100', (181.4043, 110.5828), (76.4472, 110.5828), (128.9257, 99.5828)),\n ('vertical', '40', (181.4043, 152.5656), (181.4043, 110.5828), (192.4043, 131.5742)),\n ('diameter', '%%c10.5263', (110.6964, 131.5742), 5.5241, 45),\n ('horizontal', '32.6316', (76.4472, 131.5742), (110.6964, 131.5742), (93.5718, 142.5742)),\n ('vertical', '20', (110.6964, 152.5656), (110.6964, 131.5742), (121.6964, 142.0699)),\n ('horizontal', '14.433', (210.5528, 152.5656), (195.4043, 152.5656), (202.9786, 141.5656))\n]\n\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\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\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,\n angle=(0 if d[0] == \"horizontal\" else 90),\n 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,\n text=text, dimstyle=\"EZDXF\").render()\n\n doc.saveas(out_path)\n\n\nif __name__ == \"__main__\":\n out = sys.argv[1] if len(sys.argv) > 1 else \"0068_00687627_gt.dxf\"\n draw(out)\n print(\"wrote\", out)\n```"}], "images": ["images/0068_00687627.png"], "id": "0068_00687627"} {"messages": [{"role": "user", "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 4 circular holes, each of diameter 21.05 mm. It is extruded to a thickness of 50 mm."}, {"role": "assistant", "content": "```python\n#!/usr/bin/env python3\n# -*- coding: utf-8 -*-\n# Ground-truth 2D engineering drawing for part: 0073_00731607\n# Self-contained: reproduces the three-view DXF via ezdxf, NO FreeCAD needed.\n# Coordinates are A4 page millimetres (scale=0.6406666666666667, page=[297.0, 210.0]).\n# visible edges -> solid (layer OUTLINE); hidden edges -> dashed (layer HIDDEN)\n# dimensions -> real movable DIMENSION entities (text = true mm value)\n# Run: python 0073_00731607_gt.py [out.dxf]\nimport sys\nimport ezdxf\n\nSCALE = 0.6406666666666667\nPAGE = [297.0, 210.0]\n\nVISIBLE_SEGMENTS = [\n (152.516683, 172.049983, 152.516683, 107.983317),\n (152.516683, 107.983317, 88.450017, 107.983317),\n (88.450017, 107.983317, 88.450017, 172.049983),\n (88.450017, 172.049983, 152.516683, 172.049983),\n (152.516683, 61.949983, 152.516683, 93.983317),\n (152.516683, 93.983317, 88.450017, 93.983317),\n (88.450017, 61.949983, 88.450017, 93.983317),\n (152.516683, 61.949983, 88.450017, 61.949983),\n (166.516683, 107.983317, 198.550017, 107.983317),\n (198.550017, 107.983317, 198.550017, 172.049983),\n (166.516683, 172.049983, 198.550017, 172.049983),\n (166.516683, 107.983317, 166.516683, 172.049983)\n]\nVISIBLE_CIRCLES = [\n (104.63528, 155.86472, 6.74386),\n (104.63528, 124.16858, 6.74386),\n (136.33142, 155.86472, 6.74386),\n (136.33142, 124.16858, 6.74386)\n]\nVISIBLE_ARCS = [\n\n]\nHIDDEN_SEGMENTS = [\n (111.3791, 93.9833, 111.3791, 61.95),\n (143.0753, 93.9833, 143.0753, 61.95),\n (97.8914, 61.95, 97.8914, 93.9833),\n (129.5875, 61.95, 129.5875, 93.9833),\n (198.55, 130.9125, 166.5167, 130.9125),\n (198.55, 117.4247, 166.5167, 117.4247),\n (198.55, 162.6086, 166.5167, 162.6086),\n (198.55, 149.1209, 166.5167, 149.1209)\n]\n# (orient, text, p1, p2, base) for linear; (orient, text, center, radius, angle) for diameter\nDIMENSIONS = [\n ('horizontal', '100', (152.5167, 172.05), (88.45, 172.05), (120.4833, 161.05)),\n ('vertical', '100', (152.5167, 107.9833), (152.5167, 172.05), (141.5167, 140.0167)),\n ('diameter', '%%c21.0526', (104.6353, 124.1686), 6.7438, 45),\n ('horizontal', '25.2632', (88.45, 124.1686), (104.6353, 124.1686), (96.5426, 135.1686)),\n ('vertical', '25.2632', (104.6353, 107.9833), (104.6353, 124.1686), (93.6353, 116.076)),\n ('diameter', '%%c21.0526', (104.6353, 155.8647), 6.7438, 45),\n ('horizontal', '25.2632', (88.45, 155.8647), (104.6353, 155.8647), (96.5426, 166.8647)),\n ('vertical', '74.7368', (104.6353, 107.9833), (104.6353, 155.8647), (93.6353, 131.924)),\n ('diameter', '%%c21.0526', (136.3314, 124.1686), 6.7438, 45),\n ('horizontal', '74.7368', (88.45, 124.1686), (136.3314, 124.1686), (112.3907, 135.1686)),\n ('vertical', '25.2632', (136.3314, 107.9833), (136.3314, 124.1686), (125.3314, 116.076)),\n ('diameter', '%%c21.0526', (136.3314, 155.8647), 6.7438, 45),\n ('horizontal', '74.7368', (88.45, 155.8647), (136.3314, 155.8647), (112.3907, 166.8647)),\n ('vertical', '74.7368', (136.3314, 107.9833), (136.3314, 155.8647), (125.3314, 131.924)),\n ('horizontal', '50', (166.5167, 107.9833), (198.55, 107.9833), (182.5333, 118.9833))\n]\n\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\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\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,\n angle=(0 if d[0] == \"horizontal\" else 90),\n 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,\n text=text, dimstyle=\"EZDXF\").render()\n\n doc.saveas(out_path)\n\n\nif __name__ == \"__main__\":\n out = sys.argv[1] if len(sys.argv) > 1 else \"0073_00731607_gt.dxf\"\n draw(out)\n print(\"wrote\", out)\n```"}], "images": ["images/0073_00731607.png"], "id": "0073_00731607"} {"messages": [{"role": "user", "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": "assistant", "content": "```python\n#!/usr/bin/env python3\n# -*- coding: utf-8 -*-\n# Ground-truth 2D engineering drawing for part: 0075_00759650\n# Self-contained: reproduces the three-view DXF via ezdxf, NO FreeCAD needed.\n# Coordinates are A4 page millimetres (scale=0.6210544217687202, page=[297.0, 210.0]).\n# visible edges -> solid (layer OUTLINE); hidden edges -> dashed (layer HIDDEN)\n# dimensions -> real movable DIMENSION entities (text = true mm value)\n# Run: python 0075_00759650_gt.py [out.dxf]\nimport sys\nimport ezdxf\n\nSCALE = 0.6210544217687202\nPAGE = [297.0, 210.0]\n\nVISIBLE_SEGMENTS = [\n (162.053763, 146.496179, 162.053763, 112.501621),\n (99.948321, 146.496179, 162.053763, 146.496179),\n (162.053763, 112.501621, 99.948321, 112.501621),\n (99.948321, 112.501621, 99.948321, 146.496179),\n (162.053763, 87.503782, 162.053763, 98.501621),\n (162.053763, 98.501621, 99.948321, 98.501621),\n (99.948321, 87.503782, 99.948321, 98.501621),\n (162.053763, 87.503782, 99.948321, 87.503782),\n (187.051602, 146.496179, 176.053763, 146.496179),\n (176.053763, 112.501621, 187.051602, 112.501621),\n (187.051602, 112.501621, 187.051602, 146.496179),\n (176.053763, 112.501621, 176.053763, 146.496179)\n]\nVISIBLE_CIRCLES = [\n (116.9456, 129.4989, 6.537415)\n]\nVISIBLE_ARCS = [\n\n]\nHIDDEN_SEGMENTS = [\n (123.4831, 87.5038, 123.4831, 98.5016),\n (110.4082, 87.5038, 110.4082, 98.5016),\n (187.0516, 136.0363, 176.0538, 136.0363),\n (187.0516, 122.9615, 176.0538, 122.9615)\n]\n# (orient, text, p1, p2, base) for linear; (orient, text, center, radius, angle) for diameter\nDIMENSIONS = [\n ('horizontal', '100', (162.0538, 146.4962), (99.9484, 146.4962), (131.0011, 135.4962)),\n ('vertical', '54.7368', (162.0538, 112.5017), (162.0538, 146.4962), (151.0538, 129.4989)),\n ('diameter', '%%c21.0526', (116.9456, 129.4989), 6.5374, 45),\n ('horizontal', '27.3684', (99.9484, 129.4989), (116.9456, 129.4989), (108.447, 140.4989)),\n ('vertical', '27.3684', (116.9456, 112.5017), (116.9456, 129.4989), (105.9456, 121.0003)),\n ('horizontal', '17.7083', (176.0538, 112.5017), (187.0517, 112.5017), (181.5527, 123.5017))\n]\n\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\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\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,\n angle=(0 if d[0] == \"horizontal\" else 90),\n 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,\n text=text, dimstyle=\"EZDXF\").render()\n\n doc.saveas(out_path)\n\n\nif __name__ == \"__main__\":\n out = sys.argv[1] if len(sys.argv) > 1 else \"0075_00759650_gt.dxf\"\n draw(out)\n print(\"wrote\", out)\n```"}], "images": ["images/0075_00759650.png"], "id": "0075_00759650"} {"messages": [{"role": "user", "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, featuring 4 circular holes, each of diameter 2.11 mm. It is extruded to a thickness of -1.04 mm."}, {"role": "assistant", "content": "```python\n#!/usr/bin/env python3\n# -*- coding: utf-8 -*-\n# Ground-truth 2D engineering drawing for part: 0076_00763326\n# Self-contained: reproduces the three-view DXF via ezdxf, NO FreeCAD needed.\n# Coordinates are A4 page millimetres (scale=0.9510927835051515, page=[297.0, 210.0]).\n# visible edges -> solid (layer OUTLINE); hidden edges -> dashed (layer HIDDEN)\n# dimensions -> real movable DIMENSION entities (text = true mm value)\n# Run: python 0076_00763326_gt.py [out.dxf]\nimport sys\nimport ezdxf\n\nSCALE = 0.9510927835051515\nPAGE = [297.0, 210.0]\n\nVISIBLE_SEGMENTS = [\n (172.046036, 172.050039, 172.046036, 76.940761),\n (172.046036, 76.940761, 99.963214, 76.940761),\n (99.963214, 76.940761, 99.963214, 172.050039),\n (99.963214, 172.050039, 172.046036, 172.050039),\n (172.046036, 62.940761, 172.046036, 61.950039),\n (172.046036, 61.950039, 99.963214, 61.950039),\n (99.963214, 62.940761, 99.963214, 61.950039),\n (172.046036, 62.940761, 99.963214, 62.940761),\n (187.036757, 76.940761, 186.046036, 76.940761),\n (186.046036, 76.940761, 186.046036, 172.050039),\n (187.036757, 172.050039, 186.046036, 172.050039),\n (187.036757, 76.940761, 187.036757, 172.050039)\n]\nVISIBLE_CIRCLES = [\n (107.972416, 170.047739, 1.00115),\n (107.972416, 78.943061, 1.00115),\n (165.037984, 170.047739, 1.00115),\n (165.037984, 78.943061, 1.00115)\n]\nVISIBLE_ARCS = [\n\n]\nHIDDEN_SEGMENTS = [\n (108.9736, 61.95, 108.9736, 62.9407),\n (166.0391, 61.95, 166.0391, 62.9407),\n (106.9713, 62.9407, 106.9713, 61.95),\n (164.0368, 62.9407, 164.0368, 61.95),\n (186.046, 77.9419, 187.0368, 77.9419),\n (186.046, 79.9442, 187.0368, 79.9442),\n (186.046, 169.0465, 187.0368, 169.0465),\n (186.046, 171.0488, 187.0368, 171.0488)\n]\n# (orient, text, p1, p2, base) for linear; (orient, text, center, radius, angle) for diameter\nDIMENSIONS = [\n ('horizontal', '75.7895', (172.046, 172.05), (99.9633, 172.05), (136.0046, 161.05)),\n ('vertical', '100', (172.046, 76.9407), (172.046, 172.05), (161.046, 124.4954)),\n ('diameter', '%%c2.1053', (107.9724, 78.9431), 1.0012, 45),\n ('horizontal', '8.4211', (99.9633, 78.9431), (107.9724, 78.9431), (103.9678, 89.9431)),\n ('vertical', '2.1053', (107.9724, 76.9407), (107.9724, 78.9431), (96.9724, 77.9419)),\n ('diameter', '%%c2.1053', (107.9724, 170.0477), 1.0012, 45),\n ('horizontal', '8.4211', (99.9633, 170.0477), (107.9724, 170.0477), (103.9678, 181.0477)),\n ('vertical', '97.8947', (107.9724, 76.9407), (107.9724, 170.0477), (96.9724, 123.4942)),\n ('diameter', '%%c2.1053', (165.038, 78.9431), 1.0012, 45),\n ('horizontal', '68.4211', (99.9633, 78.9431), (165.038, 78.9431), (132.5006, 89.9431)),\n ('vertical', '2.1053', (165.038, 76.9407), (165.038, 78.9431), (154.038, 77.9419)),\n ('diameter', '%%c2.1053', (165.038, 170.0477), 1.0012, 45),\n ('horizontal', '68.4211', (99.9633, 170.0477), (165.038, 170.0477), (132.5006, 181.0477)),\n ('vertical', '97.8947', (165.038, 76.9407), (165.038, 170.0477), (154.038, 123.4942)),\n ('horizontal', '1.0417', (187.0368, 76.9407), (186.046, 76.9407), (186.5414, 65.9407))\n]\n\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\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\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,\n angle=(0 if d[0] == \"horizontal\" else 90),\n 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,\n text=text, dimstyle=\"EZDXF\").render()\n\n doc.saveas(out_path)\n\n\nif __name__ == \"__main__\":\n out = sys.argv[1] if len(sys.argv) > 1 else \"0076_00763326_gt.dxf\"\n draw(out)\n print(\"wrote\", out)\n```"}], "images": ["images/0076_00763326.png"], "id": "0076_00763326"} {"messages": [{"role": "user", "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 85.26 mm tall, featuring 2 circular holes, each of diameter 16.84 mm. It is extruded to a thickness of 50 mm."}, {"role": "assistant", "content": "```python\n#!/usr/bin/env python3\n# -*- coding: utf-8 -*-\n# Ground-truth 2D engineering drawing for part: 0078_00784814\n# Self-contained: reproduces the three-view DXF via ezdxf, NO FreeCAD needed.\n# Coordinates are A4 page millimetres (scale=0.7104669260700696, page=[297.0, 210.0]).\n# visible edges -> solid (layer OUTLINE); hidden edges -> dashed (layer HIDDEN)\n# dimensions -> real movable DIMENSION entities (text = true mm value)\n# Run: python 0078_00784814_gt.py [out.dxf]\nimport sys\nimport ezdxf\n\nSCALE = 0.7104669260700696\nPAGE = [297.0, 210.0]\n\nVISIBLE_SEGMENTS = [\n (154.261676, 111.473403, 154.261676, 172.050057),\n (154.261676, 172.050057, 83.214984, 172.050057),\n (83.214984, 172.050057, 83.214984, 111.473403),\n (83.214984, 111.473403, 154.261676, 111.473403),\n (154.261676, 97.473403, 154.261676, 61.950057),\n (154.261676, 61.950057, 83.214984, 61.950057),\n (83.214984, 97.473403, 83.214984, 61.950057),\n (154.261676, 97.473403, 83.214984, 97.473403),\n (168.261676, 172.050057, 203.785023, 172.050057),\n (203.785023, 172.050057, 203.785023, 111.473403),\n (168.261676, 111.473403, 203.785023, 111.473403),\n (168.261676, 172.050057, 168.261676, 111.473403)\n]\nVISIBLE_CIRCLES = [\n (92.189303, 141.3878, 5.982879),\n (144.539497, 141.3878, 5.982879)\n]\nVISIBLE_ARCS = [\n\n]\nHIDDEN_SEGMENTS = [\n (98.1722, 97.4733, 98.1722, 61.95),\n (150.5224, 97.4733, 150.5224, 61.95),\n (86.2064, 61.95, 86.2064, 97.4733),\n (138.5566, 61.95, 138.5566, 97.4733),\n (203.785, 147.3706, 168.2617, 147.3706),\n (203.785, 135.4049, 168.2617, 135.4049)\n]\n# (orient, text, p1, p2, base) for linear; (orient, text, center, radius, angle) for diameter\nDIMENSIONS = [\n ('horizontal', '100', (154.2617, 172.05), (83.215, 172.05), (118.7383, 161.05)),\n ('vertical', '85.2632', (154.2617, 111.4733), (154.2617, 172.05), (143.2617, 141.7617)),\n ('diameter', '%%c16.8421', (92.1893, 141.3878), 5.9829, 45),\n ('horizontal', '12.6316', (83.215, 141.3878), (92.1893, 141.3878), (87.7022, 152.3878)),\n ('vertical', '42.1053', (92.1893, 111.4733), (92.1893, 141.3878), (81.1893, 126.4306)),\n ('diameter', '%%c16.8421', (144.5395, 141.3878), 5.9829, 45),\n ('horizontal', '86.3158', (83.215, 141.3878), (144.5395, 141.3878), (113.8773, 152.3878)),\n ('vertical', '42.1053', (144.5395, 111.4733), (144.5395, 141.3878), (133.5395, 126.4306)),\n ('horizontal', '50', (168.2617, 111.4733), (203.785, 111.4733), (186.0233, 122.4733))\n]\n\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\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\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,\n angle=(0 if d[0] == \"horizontal\" else 90),\n 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,\n text=text, dimstyle=\"EZDXF\").render()\n\n doc.saveas(out_path)\n\n\nif __name__ == \"__main__\":\n out = sys.argv[1] if len(sys.argv) > 1 else \"0078_00784814_gt.dxf\"\n draw(out)\n print(\"wrote\", out)\n```"}], "images": ["images/0078_00784814.png"], "id": "0078_00784814"} {"messages": [{"role": "user", "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 62.11 mm wide and 100 mm tall, featuring 2 circular holes, each of diameter 10.53 mm. It is extruded to a thickness of 7.29 mm."}, {"role": "assistant", "content": "```python\n#!/usr/bin/env python3\n# -*- coding: utf-8 -*-\n# Ground-truth 2D engineering drawing for part: 0085_00858121\n# Self-contained: reproduces the three-view DXF via ezdxf, NO FreeCAD needed.\n# Coordinates are A4 page millimetres (scale=0.8956893203883467, page=[297.0, 210.0]).\n# visible edges -> solid (layer OUTLINE); hidden edges -> dashed (layer HIDDEN)\n# dimensions -> real movable DIMENSION entities (text = true mm value)\n# Run: python 0085_00858121_gt.py [out.dxf]\nimport sys\nimport ezdxf\n\nSCALE = 0.8956893203883467\nPAGE = [297.0, 210.0]\n\nVISIBLE_SEGMENTS = [\n (161.048026, 172.050016, 161.048026, 82.481084),\n (161.048026, 82.481084, 105.421005, 82.481084),\n (105.421005, 82.481084, 105.421005, 172.050016),\n (105.421005, 172.050016, 161.048026, 172.050016),\n (161.048026, 61.950016, 161.048026, 68.481084),\n (161.048026, 68.481084, 105.421005, 68.481084),\n (105.421005, 61.950016, 105.421005, 68.481084),\n (161.048026, 61.950016, 105.421005, 61.950016),\n (175.048026, 82.481084, 181.579094, 82.481084),\n (181.579094, 82.481084, 181.579094, 172.050016),\n (175.048026, 172.050016, 181.579094, 172.050016),\n (175.048026, 82.481084, 175.048026, 172.050016)\n]\nVISIBLE_CIRCLES = [\n (132.7631, 158.850384, 4.714154),\n (132.7631, 95.680716, 4.714154)\n]\nVISIBLE_ARCS = [\n\n]\nHIDDEN_SEGMENTS = [\n (137.4772, 68.4811, 137.4772, 61.95),\n (128.0489, 61.95, 128.0489, 68.4811),\n (181.579, 100.3949, 175.048, 100.3949),\n (181.579, 90.9665, 175.048, 90.9665),\n (181.579, 163.5645, 175.048, 163.5645),\n (181.579, 154.1362, 175.048, 154.1362)\n]\n# (orient, text, p1, p2, base) for linear; (orient, text, center, radius, angle) for diameter\nDIMENSIONS = [\n ('horizontal', '62.1053', (161.0479, 172.05), (105.421, 172.05), (133.2345, 161.05)),\n ('vertical', '100', (161.0479, 82.4811), (161.0479, 172.05), (150.0479, 127.2655)),\n ('diameter', '%%c10.5263', (132.7631, 95.6807), 4.7141, 45),\n ('horizontal', '30.5263', (105.421, 95.6807), (132.7631, 95.6807), (119.092, 106.6807)),\n ('vertical', '14.7368', (132.7631, 82.4811), (132.7631, 95.6807), (121.7631, 89.0809)),\n ('diameter', '%%c10.5263', (132.7631, 158.8504), 4.7141, 45),\n ('horizontal', '30.5263', (105.421, 158.8504), (132.7631, 158.8504), (119.092, 169.8504)),\n ('vertical', '85.2632', (132.7631, 82.4811), (132.7631, 158.8504), (121.7631, 120.6657)),\n ('horizontal', '7.2917', (175.048, 82.4811), (181.5791, 82.4811), (178.3135, 93.4811))\n]\n\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\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\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,\n angle=(0 if d[0] == \"horizontal\" else 90),\n 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,\n text=text, dimstyle=\"EZDXF\").render()\n\n doc.saveas(out_path)\n\n\nif __name__ == \"__main__\":\n out = sys.argv[1] if len(sys.argv) > 1 else \"0085_00858121_gt.dxf\"\n draw(out)\n print(\"wrote\", out)\n```"}], "images": ["images/0085_00858121.png"], "id": "0085_00858121"} {"messages": [{"role": "user", "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, featuring 2 circular holes, each of diameter 6.32 mm. It is extruded to a thickness of 1.56 mm."}, {"role": "assistant", "content": "```python\n#!/usr/bin/env python3\n# -*- coding: utf-8 -*-\n# Ground-truth 2D engineering drawing for part: 0086_00864410\n# Self-contained: reproduces the three-view DXF via ezdxf, NO FreeCAD needed.\n# Coordinates are A4 page millimetres (scale=0.9306200000000369, page=[297.0, 210.0]).\n# visible edges -> solid (layer OUTLINE); hidden edges -> dashed (layer HIDDEN)\n# dimensions -> real movable DIMENSION entities (text = true mm value)\n# Run: python 0086_00864410_gt.py [out.dxf]\nimport sys\nimport ezdxf\n\nSCALE = 0.9306200000000369\nPAGE = [297.0, 210.0]\n\nVISIBLE_SEGMENTS = [\n (181.5769, 152.3931, 181.5769, 98.5151),\n (88.5149, 152.3931, 181.5769, 152.3931),\n (181.5769, 98.5151, 88.5149, 98.5151),\n (88.5149, 98.5151, 88.5149, 152.3931),\n (181.5769, 84.5151, 181.5769, 81.606913),\n (88.5149, 84.5151, 88.5149, 81.606913),\n (88.5149, 84.5151, 181.5769, 84.5151),\n (88.5149, 81.606913, 181.5769, 81.606913),\n (195.5769, 152.3931, 198.485088, 152.3931),\n (198.485088, 98.5151, 195.5769, 98.5151),\n (195.5769, 98.5151, 195.5769, 152.3931),\n (198.485088, 98.5151, 198.485088, 152.3931)\n]\nVISIBLE_CIRCLES = [\n (158.0665, 138.6787, 2.9388),\n (158.0665, 111.2499, 2.9388)\n]\nVISIBLE_ARCS = [\n\n]\nHIDDEN_SEGMENTS = [\n (161.0053, 84.5151, 161.0053, 81.6069),\n (155.1277, 84.5151, 155.1277, 81.6069),\n (195.5769, 135.7399, 198.4851, 135.7399),\n (195.5769, 141.6175, 198.4851, 141.6175),\n (195.5769, 108.3111, 198.4851, 108.3111),\n (195.5769, 114.1887, 198.4851, 114.1887)\n]\n# (orient, text, p1, p2, base) for linear; (orient, text, center, radius, angle) for diameter\nDIMENSIONS = [\n ('horizontal', '100', (181.5769, 98.5151), (88.5149, 98.5151), (135.0459, 87.5151)),\n ('vertical', '57.8947', (181.5769, 152.3931), (181.5769, 98.5151), (192.5769, 125.4541)),\n ('diameter', '%%c6.3158', (158.0665, 138.6787), 2.9388, 45),\n ('horizontal', '74.7368', (88.5149, 138.6787), (158.0665, 138.6787), (123.2907, 149.6787)),\n ('vertical', '14.7368', (158.0665, 152.3931), (158.0665, 138.6787), (169.0665, 145.5359)),\n ('diameter', '%%c6.3158', (158.0665, 111.2499), 2.9388, 45),\n ('horizontal', '74.7368', (88.5149, 111.2499), (158.0665, 111.2499), (123.2907, 122.2499)),\n ('vertical', '44.2105', (158.0665, 152.3931), (158.0665, 111.2499), (169.0665, 131.8215)),\n ('horizontal', '3.125', (198.4851, 152.3931), (195.5769, 152.3931), (197.031, 141.3931))\n]\n\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\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\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,\n angle=(0 if d[0] == \"horizontal\" else 90),\n 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,\n text=text, dimstyle=\"EZDXF\").render()\n\n doc.saveas(out_path)\n\n\nif __name__ == \"__main__\":\n out = sys.argv[1] if len(sys.argv) > 1 else \"0086_00864410_gt.dxf\"\n draw(out)\n print(\"wrote\", out)\n```"}], "images": ["images/0086_00864410.png"], "id": "0086_00864410"} {"messages": [{"role": "user", "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, featuring 3 circular holes (diameters 10.53, 21.05 mm). It is extruded to a thickness of 2.52 mm."}, {"role": "assistant", "content": "```python\n#!/usr/bin/env python3\n# -*- coding: utf-8 -*-\n# Ground-truth 2D engineering drawing for part: 0088_00882715\n# Self-contained: reproduces the three-view DXF via ezdxf, NO FreeCAD needed.\n# Coordinates are A4 page millimetres (scale=1.034022222222264, page=[297.0, 210.0]).\n# visible edges -> solid (layer OUTLINE); hidden edges -> dashed (layer HIDDEN)\n# dimensions -> real movable DIMENSION entities (text = true mm value)\n# Run: python 0088_00882715_gt.py [out.dxf]\nimport sys\nimport ezdxf\n\nSCALE = 1.034022222222264\nPAGE = [297.0, 210.0]\n\nVISIBLE_SEGMENTS = [\n (186.900478, 103.531711, 186.900478, 147.069489),\n (186.900478, 147.069489, 83.498256, 147.069489),\n (83.498256, 147.069489, 83.498256, 103.531711),\n (83.498256, 103.531711, 186.900478, 103.531711),\n (186.900478, 89.531711, 186.900478, 86.930397),\n (83.498256, 89.531711, 83.498256, 86.930397),\n (83.498256, 86.930397, 186.900478, 86.930397),\n (83.498256, 89.531711, 186.900478, 89.531711),\n (203.501792, 147.069489, 200.900478, 147.069489),\n (200.900478, 147.069489, 200.900478, 103.531711),\n (203.501792, 103.531711, 200.900478, 103.531711),\n (203.501792, 147.069489, 203.501792, 103.531711)\n]\nVISIBLE_CIRCLES = [\n (104.1787, 125.3006, 10.884444),\n (142.274256, 125.3006, 10.884444),\n (173.839144, 125.3006, 5.442222)\n]\nVISIBLE_ARCS = [\n\n]\nHIDDEN_SEGMENTS = [\n (115.0631, 86.9305, 115.0631, 89.5318),\n (153.1587, 86.9305, 153.1587, 89.5318),\n (179.2813, 86.9305, 179.2813, 89.5318),\n (93.2942, 89.5318, 93.2942, 86.9305),\n (131.3898, 89.5318, 131.3898, 86.9305),\n (168.3969, 89.5318, 168.3969, 86.9305),\n (200.9005, 114.4162, 203.5018, 114.4162),\n (200.9005, 136.1851, 203.5018, 136.1851),\n (200.9005, 119.8584, 203.5018, 119.8584),\n (200.9005, 130.7429, 203.5018, 130.7429)\n]\n# (orient, text, p1, p2, base) for linear; (orient, text, center, radius, angle) for diameter\nDIMENSIONS = [\n ('horizontal', '100', (186.9005, 103.5318), (83.4983, 103.5318), (135.1994, 92.5318)),\n ('vertical', '42.1053', (186.9005, 147.0695), (186.9005, 103.5318), (197.9005, 125.3006)),\n ('diameter', '%%c21.0526', (104.1787, 125.3006), 10.8844, 45),\n ('horizontal', '20', (83.4983, 125.3006), (104.1787, 125.3006), (93.8385, 136.3006)),\n ('vertical', '21.0526', (104.1787, 147.0695), (104.1787, 125.3006), (115.1787, 136.1851)),\n ('diameter', '%%c21.0526', (142.2743, 125.3006), 10.8844, 45),\n ('horizontal', '56.8421', (83.4983, 125.3006), (142.2743, 125.3006), (112.8863, 136.3006)),\n ('vertical', '21.0526', (142.2743, 147.0695), (142.2743, 125.3006), (153.2743, 136.1851)),\n ('diameter', '%%c10.5263', (173.8391, 125.3006), 5.4422, 45),\n ('horizontal', '87.3684', (83.4983, 125.3006), (173.8391, 125.3006), (128.6687, 136.3006)),\n ('vertical', '21.0526', (173.8391, 147.0695), (173.8391, 125.3006), (184.8391, 136.1851)),\n ('horizontal', '2.5157', (203.5018, 147.0695), (200.9005, 147.0695), (202.2011, 136.0695))\n]\n\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\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\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,\n angle=(0 if d[0] == \"horizontal\" else 90),\n 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,\n text=text, dimstyle=\"EZDXF\").render()\n\n doc.saveas(out_path)\n\n\nif __name__ == \"__main__\":\n out = sys.argv[1] if len(sys.argv) > 1 else \"0088_00882715_gt.dxf\"\n draw(out)\n print(\"wrote\", out)\n```"}], "images": ["images/0088_00882715.png"], "id": "0088_00882715"} {"messages": [{"role": "user", "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 4 circular holes, each of diameter 10.53 mm. It is extruded to a thickness of 75 mm."}, {"role": "assistant", "content": "```python\n#!/usr/bin/env python3\n# -*- coding: utf-8 -*-\n# Ground-truth 2D engineering drawing for part: 0088_00887540\n# Self-contained: reproduces the three-view DXF via ezdxf, NO FreeCAD needed.\n# Coordinates are A4 page millimetres (scale=0.5491428571428572, page=[297.0, 210.0]).\n# visible edges -> solid (layer OUTLINE); hidden edges -> dashed (layer HIDDEN)\n# dimensions -> real movable DIMENSION entities (text = true mm value)\n# Run: python 0088_00887540_gt.py [out.dxf]\nimport sys\nimport ezdxf\n\nSCALE = 0.5491428571428572\nPAGE = [297.0, 210.0]\n\nVISIBLE_SEGMENTS = [\n (143.364315, 172.049993, 143.364315, 117.135707),\n (143.364315, 117.135707, 88.45003, 117.135707),\n (88.45003, 117.135707, 88.45003, 172.049993),\n (88.45003, 172.049993, 143.364315, 172.049993),\n (143.364315, 61.949993, 143.364315, 103.135707),\n (143.364315, 103.135707, 88.45003, 103.135707),\n (88.45003, 61.949993, 88.45003, 103.135707),\n (143.364315, 61.949993, 88.45003, 61.949993),\n (157.364315, 117.135707, 198.55003, 117.135707),\n (198.55003, 117.135707, 198.55003, 172.049993),\n (157.364315, 172.049993, 198.55003, 172.049993),\n (157.364315, 117.135707, 157.364315, 172.049993)\n]\nVISIBLE_CIRCLES = [\n (104.635293, 164.535406, 2.890226),\n (104.635293, 124.650294, 2.890226),\n (126.601007, 164.535406, 2.890226),\n (126.601007, 124.650294, 2.890226)\n]\nVISIBLE_ARCS = [\n\n]\nHIDDEN_SEGMENTS = [\n (107.5255, 103.1357, 107.5255, 61.95),\n (129.4912, 103.1357, 129.4912, 61.95),\n (101.745, 61.95, 101.745, 103.1357),\n (123.7108, 61.95, 123.7108, 103.1357),\n (198.55, 127.5405, 157.3643, 127.5405),\n (198.55, 121.7601, 157.3643, 121.7601),\n (198.55, 167.4256, 157.3643, 167.4256),\n (198.55, 161.6452, 157.3643, 161.6452)\n]\n# (orient, text, p1, p2, base) for linear; (orient, text, center, radius, angle) for diameter\nDIMENSIONS = [\n ('horizontal', '100', (143.3643, 172.05), (88.45, 172.05), (115.9071, 161.05)),\n ('vertical', '100', (143.3643, 117.1357), (143.3643, 172.05), (132.3643, 144.5929)),\n ('diameter', '%%c10.5263', (104.6353, 124.6503), 2.8902, 45),\n ('horizontal', '29.4737', (88.45, 124.6503), (104.6353, 124.6503), (96.5426, 135.6503)),\n ('vertical', '13.6842', (104.6353, 117.1357), (104.6353, 124.6503), (93.6353, 120.893)),\n ('diameter', '%%c10.5263', (104.6353, 164.5354), 2.8902, 45),\n ('horizontal', '29.4737', (88.45, 164.5354), (104.6353, 164.5354), (96.5426, 175.5354)),\n ('vertical', '86.3158', (104.6353, 117.1357), (104.6353, 164.5354), (93.6353, 140.8356)),\n ('diameter', '%%c10.5263', (126.601, 124.6503), 2.8902, 45),\n ('horizontal', '69.4737', (88.45, 124.6503), (126.601, 124.6503), (107.5255, 135.6503)),\n ('vertical', '13.6842', (126.601, 117.1357), (126.601, 124.6503), (115.601, 120.893)),\n ('diameter', '%%c10.5263', (126.601, 164.5354), 2.8902, 45),\n ('horizontal', '69.4737', (88.45, 164.5354), (126.601, 164.5354), (107.5255, 175.5354)),\n ('vertical', '86.3158', (126.601, 117.1357), (126.601, 164.5354), (115.601, 140.8356)),\n ('horizontal', '75', (157.3643, 117.1357), (198.55, 117.1357), (177.9571, 128.1357))\n]\n\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\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\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,\n angle=(0 if d[0] == \"horizontal\" else 90),\n 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,\n text=text, dimstyle=\"EZDXF\").render()\n\n doc.saveas(out_path)\n\n\nif __name__ == \"__main__\":\n out = sys.argv[1] if len(sys.argv) > 1 else \"0088_00887540_gt.dxf\"\n draw(out)\n print(\"wrote\", out)\n```"}], "images": ["images/0088_00887540.png"], "id": "0088_00887540"} {"messages": [{"role": "user", "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 254.05 mm. It is extruded to a thickness of 214.34 mm. The outline includes one or more oblique (angled) edges."}, {"role": "assistant", "content": "```python\n#!/usr/bin/env python3\n# -*- coding: utf-8 -*-\n# Ground-truth 2D engineering drawing for part: 0094_00948607\n# Self-contained: reproduces the three-view DXF via ezdxf, NO FreeCAD needed.\n# Coordinates are A4 page millimetres (scale=0.20517084796789398, page=[297.0, 210.0]).\n# visible edges -> solid (layer OUTLINE); hidden edges -> dashed (layer HIDDEN)\n# dimensions -> real movable DIMENSION entities (text = true mm value)\n# Run: python 0094_00948607_gt.py [out.dxf]\nimport sys\nimport ezdxf\nimport math\n\nSCALE = 0.20517084796789398\nPAGE = [297.0, 210.0]\n\nVISIBLE_SEGMENTS = [\n (123.107184, 132.402094, 102.5901, 132.402094),\n (133.088469, 150.1466, 123.107184, 132.402094),\n (123.107184, 167.891106, 133.088469, 150.1466),\n (102.5901, 167.891106, 123.107184, 167.891106),\n (92.608815, 150.1466, 102.5901, 167.891106),\n (102.5901, 132.402094, 92.608815, 150.1466),\n (139.188143, 66.108843, 137.559253, 66.108843),\n (137.559253, 66.108843, 135.930362, 66.108843),\n (135.930362, 66.108843, 134.301472, 66.108843),\n (134.301472, 66.108843, 132.672582, 66.108843),\n (132.672582, 66.108843, 131.043692, 66.108843),\n (131.043692, 66.108843, 129.414802, 66.108843),\n (129.414802, 66.108843, 127.785912, 66.108843),\n (127.785912, 66.108843, 126.157021, 66.108843),\n (126.157021, 66.108843, 124.528131, 66.108843),\n (124.528131, 66.108843, 122.899241, 66.108843),\n (122.899241, 66.108843, 121.270351, 66.108843),\n (121.270351, 66.108843, 119.641461, 66.108843),\n (119.641461, 66.108843, 118.012571, 66.108843),\n (118.012571, 66.108843, 116.38368, 66.108843),\n (116.38368, 66.108843, 114.75479, 66.108843),\n (114.75479, 66.108843, 113.1259, 66.108843),\n (113.1259, 66.108843, 111.49701, 66.108843),\n (111.49701, 66.108843, 109.86812, 66.108843),\n (109.86812, 66.108843, 108.239229, 66.108843),\n (108.239229, 66.108843, 106.610339, 66.108843),\n (106.610339, 66.108843, 104.981449, 66.108843),\n (104.981449, 66.108843, 103.352559, 66.108843),\n (103.352559, 66.108843, 101.723669, 66.108843),\n (101.723669, 66.108843, 100.094779, 66.108843),\n (100.094779, 66.108843, 98.465888, 66.108843),\n (98.465888, 66.108843, 96.836998, 66.108843),\n (96.836998, 66.108843, 95.208108, 66.108843),\n (95.208108, 66.108843, 93.579218, 66.108843),\n (93.579218, 66.108843, 91.950328, 66.108843),\n (91.950328, 66.108843, 90.321438, 66.108843),\n (90.321438, 66.108843, 88.692547, 66.108843),\n (88.692547, 66.108843, 87.063657, 66.108843),\n (139.188143, 66.108843, 139.188143, 110.084357),\n (139.188143, 110.084357, 137.559253, 110.084357),\n (137.559253, 110.084357, 135.930362, 110.084357),\n (135.930362, 110.084357, 134.301472, 110.084357),\n (134.301472, 110.084357, 132.672582, 110.084357),\n (132.672582, 110.084357, 131.043692, 110.084357),\n (131.043692, 110.084357, 129.414802, 110.084357),\n (129.414802, 110.084357, 127.785912, 110.084357),\n (127.785912, 110.084357, 126.157021, 110.084357),\n (126.157021, 110.084357, 124.528131, 110.084357),\n (124.528131, 110.084357, 122.899241, 110.084357),\n (122.899241, 110.084357, 121.270351, 110.084357),\n (121.270351, 110.084357, 119.641461, 110.084357),\n (119.641461, 110.084357, 118.012571, 110.084357),\n (118.012571, 110.084357, 116.38368, 110.084357),\n (116.38368, 110.084357, 114.75479, 110.084357),\n (114.75479, 110.084357, 113.1259, 110.084357),\n (113.1259, 110.084357, 111.49701, 110.084357),\n (111.49701, 110.084357, 109.86812, 110.084357),\n (109.86812, 110.084357, 108.239229, 110.084357),\n (108.239229, 110.084357, 106.610339, 110.084357),\n (106.610339, 110.084357, 104.981449, 110.084357),\n (104.981449, 110.084357, 103.352559, 110.084357),\n (103.352559, 110.084357, 101.723669, 110.084357),\n (101.723669, 110.084357, 100.094779, 110.084357),\n (100.094779, 110.084357, 98.465888, 110.084357),\n (98.465888, 110.084357, 96.836998, 110.084357),\n (96.836998, 110.084357, 95.208108, 110.084357),\n (95.208108, 110.084357, 93.579218, 110.084357),\n (93.579218, 110.084357, 91.950328, 110.084357),\n (91.950328, 110.084357, 90.321438, 110.084357),\n (90.321438, 110.084357, 88.692547, 110.084357),\n (88.692547, 110.084357, 87.063657, 110.084357),\n (87.063657, 110.084357, 87.063657, 66.108843),\n (153.188143, 124.084357, 153.188143, 125.713247),\n (153.188143, 125.713247, 153.188143, 127.342138),\n (153.188143, 127.342138, 153.188143, 128.971028),\n (153.188143, 128.971028, 153.188143, 130.599918),\n (153.188143, 130.599918, 153.188143, 132.228808),\n (153.188143, 132.228808, 153.188143, 133.857698),\n (153.188143, 133.857698, 153.188143, 135.486588),\n (153.188143, 135.486588, 153.188143, 137.115479),\n (153.188143, 137.115479, 153.188143, 138.744369),\n (153.188143, 138.744369, 153.188143, 140.373259),\n (153.188143, 140.373259, 153.188143, 142.002149),\n (153.188143, 142.002149, 153.188143, 143.631039),\n (153.188143, 143.631039, 153.188143, 145.259929),\n (153.188143, 145.259929, 153.188143, 146.88882),\n (153.188143, 146.88882, 153.188143, 148.51771),\n (153.188143, 148.51771, 153.188143, 150.1466),\n (153.188143, 150.1466, 153.188143, 151.77549),\n (153.188143, 151.77549, 153.188143, 153.40438),\n (153.188143, 153.40438, 153.188143, 155.033271),\n (153.188143, 155.033271, 153.188143, 156.662161),\n (153.188143, 156.662161, 153.188143, 158.291051),\n (153.188143, 158.291051, 153.188143, 159.919941),\n (153.188143, 159.919941, 153.188143, 161.548831),\n (153.188143, 161.548831, 153.188143, 163.177721),\n (153.188143, 163.177721, 153.188143, 164.806612),\n (153.188143, 164.806612, 153.188143, 166.435502),\n (153.188143, 166.435502, 153.188143, 168.064392),\n (153.188143, 168.064392, 153.188143, 169.693282),\n (153.188143, 169.693282, 153.188143, 171.322172),\n (153.188143, 171.322172, 153.188143, 172.951062),\n (153.188143, 172.951062, 153.188143, 174.579953),\n (153.188143, 174.579953, 153.188143, 176.208843),\n (197.163657, 124.084357, 197.163657, 125.713247),\n (197.163657, 125.713247, 197.163657, 127.342138),\n (197.163657, 127.342138, 197.163657, 128.971028),\n (197.163657, 128.971028, 197.163657, 130.599918),\n (197.163657, 130.599918, 197.163657, 132.228808),\n (197.163657, 132.228808, 197.163657, 133.857698),\n (197.163657, 133.857698, 197.163657, 135.486588),\n (197.163657, 135.486588, 197.163657, 137.115479),\n (197.163657, 137.115479, 197.163657, 138.744369),\n (197.163657, 138.744369, 197.163657, 140.373259),\n (197.163657, 140.373259, 197.163657, 142.002149),\n (197.163657, 142.002149, 197.163657, 143.631039),\n (197.163657, 143.631039, 197.163657, 145.259929),\n (197.163657, 145.259929, 197.163657, 146.88882),\n (197.163657, 146.88882, 197.163657, 148.51771),\n (197.163657, 148.51771, 197.163657, 150.1466),\n (197.163657, 150.1466, 197.163657, 151.77549),\n (197.163657, 151.77549, 197.163657, 153.40438),\n (197.163657, 153.40438, 197.163657, 155.033271),\n (197.163657, 155.033271, 197.163657, 156.662161),\n (197.163657, 156.662161, 197.163657, 158.291051),\n (197.163657, 158.291051, 197.163657, 159.919941),\n (197.163657, 159.919941, 197.163657, 161.548831),\n (197.163657, 161.548831, 197.163657, 163.177721),\n (197.163657, 163.177721, 197.163657, 164.806612),\n (197.163657, 164.806612, 197.163657, 166.435502),\n (197.163657, 166.435502, 197.163657, 168.064392),\n (197.163657, 168.064392, 197.163657, 169.693282),\n (197.163657, 169.693282, 197.163657, 171.322172),\n (197.163657, 171.322172, 197.163657, 172.951062),\n (197.163657, 172.951062, 197.163657, 174.579953),\n (197.163657, 174.579953, 197.163657, 176.208843),\n (197.163657, 124.084357, 153.188143, 124.084357),\n (197.163657, 176.208843, 153.188143, 176.208843)\n]\nVISIBLE_CIRCLES = [\n (113.1259, 150.1466, 26.062243)\n]\nVISIBLE_ARCS = [\n\n]\nHIDDEN_SEGMENTS = [\n (123.1072, 110.0844, 123.1072, 66.1089),\n (102.5902, 110.0844, 102.5902, 66.1089),\n (133.0885, 110.0844, 133.0885, 66.1089),\n (92.6089, 110.0844, 92.6089, 66.1089),\n (153.1882, 167.8911, 197.1637, 167.8911),\n (153.1882, 150.1466, 197.1637, 150.1466),\n (153.1882, 132.4021, 197.1637, 132.4021)\n]\n# (orient, text, p1, p2, base) for linear; (orient, text, center, radius, angle) for diameter\nDIMENSIONS = [\n ('horizontal', '100', (102.5902, 132.4021), (123.1072, 132.4021), (112.8487, 143.4021)),\n ('aligned', '99.2301', (123.1072, 132.4021), (133.0885, 150.1466), (118.5105, 146.6672)),\n ('aligned', '99.2301', (133.0885, 150.1466), (123.1072, 167.8911), (118.5105, 153.626)),\n ('aligned', '99.2301', (102.5902, 167.8911), (92.6089, 150.1466), (107.1868, 153.626)),\n ('aligned', '99.2301', (92.6089, 150.1466), (102.5902, 132.4021), (107.1868, 146.6672)),\n ('diameter', '%%c254.054', (113.1259, 150.1466), 26.0622, 45),\n ('horizontal', '100', (92.6089, 150.1466), (113.1259, 150.1466), (102.8674, 161.1466)),\n ('vertical', '86.4865', (113.1259, 132.4021), (113.1259, 150.1466), (102.1259, 141.2744)),\n ('horizontal', '214.336', (153.1882, 132.4021), (197.1637, 132.4021), (175.176, 143.4021))\n]\n\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; _ds.dxf.dimasz = 2.5\n _ds.dxf.dimexe = 1.25; _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\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\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,\n angle=(0 if d[0] == \"horizontal\" else 90),\n 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,\n 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,\n 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,\n text=text, dimstyle=\"EZDXF\").render()\n\n doc.saveas(out_path)\n\n\nif __name__ == \"__main__\":\n out = sys.argv[1] if len(sys.argv) > 1 else \"0094_00948607_gt.dxf\"\n draw(out)\n print(\"wrote\", out)\n```"}], "images": ["images/0094_00948607.png"], "id": "0094_00948607"} {"messages": [{"role": "user", "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 218.63 mm. It is extruded to a thickness of 173.09 mm. The outline includes one or more oblique (angled) edges."}, {"role": "assistant", "content": "```python\n#!/usr/bin/env python3\n# -*- coding: utf-8 -*-\n# Ground-truth 2D engineering drawing for part: 0095_00957418\n# Self-contained: reproduces the three-view DXF via ezdxf, NO FreeCAD needed.\n# Coordinates are A4 page millimetres (scale=0.24532875537788718, page=[297.0, 210.0]).\n# visible edges -> solid (layer OUTLINE); hidden edges -> dashed (layer HIDDEN)\n# dimensions -> real movable DIMENSION entities (text = true mm value)\n# Run: python 0095_00957418_gt.py [out.dxf]\nimport sys\nimport ezdxf\nimport math\n\nSCALE = 0.24532875537788718\nPAGE = [297.0, 210.0]\n\nVISIBLE_SEGMENTS = [\n (126.44304, 169.256395, 102.41804, 169.256395),\n (138.7349, 148.025, 126.44304, 169.256395),\n (126.44304, 126.793605, 138.7349, 148.025),\n (102.41804, 126.793605, 126.44304, 126.793605),\n (90.126179, 148.025, 102.41804, 126.793605),\n (102.41804, 169.256395, 90.126179, 148.025),\n (87.891295, 107.206395, 89.567458, 107.206395),\n (89.567458, 107.206395, 91.243621, 107.206395),\n (91.243621, 107.206395, 92.919784, 107.206395),\n (92.919784, 107.206395, 94.595947, 107.206395),\n (94.595947, 107.206395, 96.272109, 107.206395),\n (96.272109, 107.206395, 97.948272, 107.206395),\n (97.948272, 107.206395, 99.624435, 107.206395),\n (99.624435, 107.206395, 101.300598, 107.206395),\n (101.300598, 107.206395, 102.97676, 107.206395),\n (102.97676, 107.206395, 104.652923, 107.206395),\n (104.652923, 107.206395, 106.329086, 107.206395),\n (106.329086, 107.206395, 108.005249, 107.206395),\n (108.005249, 107.206395, 109.681412, 107.206395),\n (109.681412, 107.206395, 111.357574, 107.206395),\n (111.357574, 107.206395, 113.033737, 107.206395),\n (113.033737, 107.206395, 114.7099, 107.206395),\n (114.7099, 107.206395, 116.386063, 107.206395),\n (116.386063, 107.206395, 118.062226, 107.206395),\n (118.062226, 107.206395, 119.738388, 107.206395),\n (119.738388, 107.206395, 121.414551, 107.206395),\n (121.414551, 107.206395, 123.090714, 107.206395),\n (123.090714, 107.206395, 124.766877, 107.206395),\n (124.766877, 107.206395, 126.44304, 107.206395),\n (126.44304, 107.206395, 128.119202, 107.206395),\n (128.119202, 107.206395, 129.795365, 107.206395),\n (129.795365, 107.206395, 131.471528, 107.206395),\n (131.471528, 107.206395, 133.147691, 107.206395),\n (133.147691, 107.206395, 134.823853, 107.206395),\n (134.823853, 107.206395, 136.500016, 107.206395),\n (136.500016, 107.206395, 138.176179, 107.206395),\n (138.176179, 107.206395, 139.852342, 107.206395),\n (139.852342, 107.206395, 141.528505, 107.206395),\n (141.528505, 107.206395, 141.528505, 64.743604),\n (87.891295, 64.743604, 89.567458, 64.743604),\n (89.567458, 64.743604, 91.243621, 64.743604),\n (91.243621, 64.743604, 92.919784, 64.743604),\n (92.919784, 64.743604, 94.595947, 64.743604),\n (94.595947, 64.743604, 96.272109, 64.743604),\n (96.272109, 64.743604, 97.948272, 64.743604),\n (97.948272, 64.743604, 99.624435, 64.743604),\n (99.624435, 64.743604, 101.300598, 64.743604),\n (101.300598, 64.743604, 102.97676, 64.743604),\n (102.97676, 64.743604, 104.652923, 64.743604),\n (104.652923, 64.743604, 106.329086, 64.743604),\n (106.329086, 64.743604, 108.005249, 64.743604),\n (108.005249, 64.743604, 109.681412, 64.743604),\n (109.681412, 64.743604, 111.357574, 64.743604),\n (111.357574, 64.743604, 113.033737, 64.743604),\n (113.033737, 64.743604, 114.7099, 64.743604),\n (114.7099, 64.743604, 116.386063, 64.743604),\n (116.386063, 64.743604, 118.062226, 64.743604),\n (118.062226, 64.743604, 119.738388, 64.743604),\n (119.738388, 64.743604, 121.414551, 64.743604),\n (121.414551, 64.743604, 123.090714, 64.743604),\n (123.090714, 64.743604, 124.766877, 64.743604),\n (124.766877, 64.743604, 126.44304, 64.743604),\n (126.44304, 64.743604, 128.119202, 64.743604),\n (128.119202, 64.743604, 129.795365, 64.743604),\n (129.795365, 64.743604, 131.471528, 64.743604),\n (131.471528, 64.743604, 133.147691, 64.743604),\n (133.147691, 64.743604, 134.823853, 64.743604),\n (134.823853, 64.743604, 136.500016, 64.743604),\n (136.500016, 64.743604, 138.176179, 64.743604),\n (138.176179, 64.743604, 139.852342, 64.743604),\n (139.852342, 64.743604, 141.528505, 64.743604),\n (87.891295, 64.743604, 87.891295, 107.206395),\n (197.991296, 174.843605, 197.991296, 173.167442),\n (197.991296, 173.167442, 197.991296, 171.491279),\n (197.991296, 171.491279, 197.991296, 169.815116),\n (197.991296, 169.815116, 197.991296, 168.138953),\n (197.991296, 168.138953, 197.991296, 166.462791),\n (197.991296, 166.462791, 197.991296, 164.786628),\n (197.991296, 164.786628, 197.991296, 163.110465),\n (197.991296, 163.110465, 197.991296, 161.434302),\n (197.991296, 161.434302, 197.991296, 159.75814),\n (197.991296, 159.75814, 197.991296, 158.081977),\n (197.991296, 158.081977, 197.991296, 156.405814),\n (197.991296, 156.405814, 197.991296, 154.729651),\n (197.991296, 154.729651, 197.991296, 153.053488),\n (197.991296, 153.053488, 197.991296, 151.377326),\n (197.991296, 151.377326, 197.991296, 149.701163),\n (197.991296, 149.701163, 197.991296, 148.025),\n (197.991296, 148.025, 197.991296, 146.348837),\n (197.991296, 146.348837, 197.991296, 144.672674),\n (197.991296, 144.672674, 197.991296, 142.996512),\n (197.991296, 142.996512, 197.991296, 141.320349),\n (197.991296, 141.320349, 197.991296, 139.644186),\n (197.991296, 139.644186, 197.991296, 137.968023),\n (197.991296, 137.968023, 197.991296, 136.29186),\n (197.991296, 136.29186, 197.991296, 134.615698),\n (197.991296, 134.615698, 197.991296, 132.939535),\n (197.991296, 132.939535, 197.991296, 131.263372),\n (197.991296, 131.263372, 197.991296, 129.587209),\n (197.991296, 129.587209, 197.991296, 127.911047),\n (197.991296, 127.911047, 197.991296, 126.234884),\n (197.991296, 126.234884, 197.991296, 124.558721),\n (197.991296, 124.558721, 197.991296, 122.882558),\n (197.991296, 122.882558, 197.991296, 121.206395),\n (155.528505, 174.843605, 155.528505, 173.167442),\n (155.528505, 173.167442, 155.528505, 171.491279),\n (155.528505, 171.491279, 155.528505, 169.815116),\n (155.528505, 169.815116, 155.528505, 168.138953),\n (155.528505, 168.138953, 155.528505, 166.462791),\n (155.528505, 166.462791, 155.528505, 164.786628),\n (155.528505, 164.786628, 155.528505, 163.110465),\n (155.528505, 163.110465, 155.528505, 161.434302),\n (155.528505, 161.434302, 155.528505, 159.75814),\n (155.528505, 159.75814, 155.528505, 158.081977),\n (155.528505, 158.081977, 155.528505, 156.405814),\n (155.528505, 156.405814, 155.528505, 154.729651),\n (155.528505, 154.729651, 155.528505, 153.053488),\n (155.528505, 153.053488, 155.528505, 151.377326),\n (155.528505, 151.377326, 155.528505, 149.701163),\n (155.528505, 149.701163, 155.528505, 148.025),\n (155.528505, 148.025, 155.528505, 146.348837),\n (155.528505, 146.348837, 155.528505, 144.672674),\n (155.528505, 144.672674, 155.528505, 142.996512),\n (155.528505, 142.996512, 155.528505, 141.320349),\n (155.528505, 141.320349, 155.528505, 139.644186),\n (155.528505, 139.644186, 155.528505, 137.968023),\n (155.528505, 137.968023, 155.528505, 136.29186),\n (155.528505, 136.29186, 155.528505, 134.615698),\n (155.528505, 134.615698, 155.528505, 132.939535),\n (155.528505, 132.939535, 155.528505, 131.263372),\n (155.528505, 131.263372, 155.528505, 129.587209),\n (155.528505, 129.587209, 155.528505, 127.911047),\n (155.528505, 127.911047, 155.528505, 126.234884),\n (155.528505, 126.234884, 155.528505, 124.558721),\n (155.528505, 124.558721, 155.528505, 122.882558),\n (155.528505, 122.882558, 155.528505, 121.206395),\n (155.528505, 174.843605, 197.991296, 174.843605),\n (155.528505, 121.206395, 197.991296, 121.206395)\n]\nVISIBLE_CIRCLES = [\n (114.7099, 148.025, 26.818605)\n]\nVISIBLE_ARCS = [\n\n]\nHIDDEN_SEGMENTS = [\n (126.443, 64.7436, 126.443, 107.2064),\n (102.418, 64.7436, 102.418, 107.2064),\n (138.7349, 64.7436, 138.7349, 107.2064),\n (90.1262, 64.7436, 90.1262, 107.2064),\n (197.9913, 126.7936, 155.5285, 126.7936),\n (197.9913, 148.025, 155.5285, 148.025),\n (197.9913, 169.2564, 155.5285, 169.2564)\n]\n# (orient, text, p1, p2, base) for linear; (orient, text, center, radius, angle) for diameter\nDIMENSIONS = [\n ('horizontal', '97.9298', (102.418, 169.2564), (126.443, 169.2564), (114.4305, 180.2564)),\n ('aligned', '100', (126.443, 169.2564), (138.7349, 148.025), (142.1086, 164.1521)),\n ('aligned', '100', (138.7349, 148.025), (126.443, 126.7936), (142.1086, 131.8979)),\n ('aligned', '100', (102.418, 126.7936), (90.1262, 148.025), (86.7524, 131.8979)),\n ('aligned', '100', (90.1262, 148.025), (102.418, 169.2564), (86.7524, 164.1521)),\n ('diameter', '%%c218.634', (114.7099, 148.025), 26.8186, 45),\n ('horizontal', '100.207', (90.1262, 148.025), (114.7099, 148.025), (102.418, 159.025)),\n ('vertical', '86.5426', (114.7099, 169.2564), (114.7099, 148.025), (125.7099, 158.6407)),\n ('horizontal', '173.085', (197.9913, 169.2564), (155.5285, 169.2564), (176.7599, 158.2564))\n]\n\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; _ds.dxf.dimasz = 2.5\n _ds.dxf.dimexe = 1.25; _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\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\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,\n angle=(0 if d[0] == \"horizontal\" else 90),\n 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,\n 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,\n 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,\n text=text, dimstyle=\"EZDXF\").render()\n\n doc.saveas(out_path)\n\n\nif __name__ == \"__main__\":\n out = sys.argv[1] if len(sys.argv) > 1 else \"0095_00957418_gt.dxf\"\n draw(out)\n print(\"wrote\", out)\n```"}], "images": ["images/0095_00957418.png"], "id": "0095_00957418"} {"messages": [{"role": "user", "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, featuring 4 circular holes, each of diameter 2.11 mm. It is extruded to a thickness of 0.52 mm."}, {"role": "assistant", "content": "```python\n#!/usr/bin/env python3\n# -*- coding: utf-8 -*-\n# Ground-truth 2D engineering drawing for part: 0098_00989125\n# Self-contained: reproduces the three-view DXF via ezdxf, NO FreeCAD needed.\n# Coordinates are A4 page millimetres (scale=1.461786528497414, page=[297.0, 210.0]).\n# visible edges -> solid (layer OUTLINE); hidden edges -> dashed (layer HIDDEN)\n# dimensions -> real movable DIMENSION entities (text = true mm value)\n# Run: python 0098_00989125_gt.py [out.dxf]\nimport sys\nimport ezdxf\n\nSCALE = 1.461786528497414\nPAGE = [297.0, 210.0]\n\nVISIBLE_SEGMENTS = [\n (209.208662, 168.234296, 209.208662, 80.527104),\n (209.208662, 80.527104, 63.030009, 80.527104),\n (63.030009, 80.527104, 63.030009, 168.234296),\n (63.030009, 168.234296, 209.208662, 168.234296),\n (209.208662, 65.765757, 209.208662, 66.527104),\n (209.208662, 66.527104, 63.030009, 66.527104),\n (63.030009, 65.765757, 63.030009, 66.527104),\n (209.208662, 65.765757, 63.030009, 65.765757),\n (223.208662, 80.527104, 223.970009, 80.527104),\n (223.970009, 80.527104, 223.970009, 168.234296),\n (223.208662, 168.234296, 223.970009, 168.234296),\n (223.208662, 80.527104, 223.208662, 168.234296)\n]\nVISIBLE_CIRCLES = [\n (72.262345, 160.540683, 1.538723),\n (72.262345, 88.220717, 1.538723),\n (147.659755, 160.540683, 1.538723),\n (147.659755, 88.220717, 1.538723)\n]\nVISIBLE_ARCS = [\n\n]\nHIDDEN_SEGMENTS = [\n (73.8011, 66.5271, 73.8011, 65.7657),\n (149.1985, 66.5271, 149.1985, 65.7657),\n (70.7236, 65.7657, 70.7236, 66.5271),\n (146.121, 65.7657, 146.121, 66.5271),\n (223.97, 89.7594, 223.2087, 89.7594),\n (223.97, 86.682, 223.2087, 86.682),\n (223.97, 162.0794, 223.2087, 162.0794),\n (223.97, 159.0019, 223.2087, 159.0019)\n]\n# (orient, text, p1, p2, base) for linear; (orient, text, center, radius, angle) for diameter\nDIMENSIONS = [\n ('horizontal', '100', (209.2087, 168.2343), (63.03, 168.2343), (136.1193, 157.2343)),\n ('vertical', '60', (209.2087, 80.5271), (209.2087, 168.2343), (198.2087, 124.3807)),\n ('diameter', '%%c2.1053', (72.2624, 88.2208), 1.5387, 45),\n ('horizontal', '6.3158', (63.03, 88.2208), (72.2624, 88.2208), (67.6462, 99.2208)),\n ('vertical', '5.2632', (72.2624, 80.5271), (72.2624, 88.2208), (61.2624, 84.3739)),\n ('diameter', '%%c2.1053', (72.2624, 160.5406), 1.5387, 45),\n ('horizontal', '6.3158', (63.03, 160.5406), (72.2624, 160.5406), (67.6462, 171.5406)),\n ('vertical', '54.7368', (72.2624, 80.5271), (72.2624, 160.5406), (61.2624, 120.5338)),\n ('diameter', '%%c2.1053', (147.6597, 88.2208), 1.5387, 45),\n ('horizontal', '57.8947', (63.03, 88.2208), (147.6597, 88.2208), (105.3448, 99.2208)),\n ('vertical', '5.2632', (147.6597, 80.5271), (147.6597, 88.2208), (136.6597, 84.3739)),\n ('diameter', '%%c2.1053', (147.6597, 160.5406), 1.5387, 45),\n ('horizontal', '57.8947', (63.03, 160.5406), (147.6597, 160.5406), (105.3448, 171.5406)),\n ('vertical', '54.7368', (147.6597, 80.5271), (147.6597, 160.5406), (136.6597, 120.5338)),\n ('horizontal', '0.5208', (223.2087, 80.5271), (223.97, 80.5271), (223.5893, 91.5271))\n]\n\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\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\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,\n angle=(0 if d[0] == \"horizontal\" else 90),\n 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,\n text=text, dimstyle=\"EZDXF\").render()\n\n doc.saveas(out_path)\n\n\nif __name__ == \"__main__\":\n out = sys.argv[1] if len(sys.argv) > 1 else \"0098_00989125_gt.dxf\"\n draw(out)\n print(\"wrote\", out)\n```"}], "images": ["images/0098_00989125.png"], "id": "0098_00989125"} {"messages": [{"role": "user", "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 243.37 mm. It is extruded to a thickness of 86.55 mm. The outline includes one or more oblique (angled) edges."}, {"role": "assistant", "content": "```python\n#!/usr/bin/env python3\n# -*- coding: utf-8 -*-\n# Ground-truth 2D engineering drawing for part: 0098_00989511\n# Self-contained: reproduces the three-view DXF via ezdxf, NO FreeCAD needed.\n# Coordinates are A4 page millimetres (scale=0.2912831053225325, page=[297.0, 210.0]).\n# visible edges -> solid (layer OUTLINE); hidden edges -> dashed (layer HIDDEN)\n# dimensions -> real movable DIMENSION entities (text = true mm value)\n# Run: python 0098_00989511_gt.py [out.dxf]\nimport sys\nimport ezdxf\nimport math\n\nSCALE = 0.2912831053225325\nPAGE = [297.0, 210.0]\n\nVISIBLE_SEGMENTS = [\n (136.448108, 166.880987, 107.64926, 166.880987),\n (151.216747, 141.7743, 136.448108, 166.880987),\n (136.448108, 116.667613, 151.216747, 141.7743),\n (107.64926, 116.667613, 136.448108, 116.667613),\n (92.880621, 141.7743, 107.64926, 116.667613),\n (107.64926, 166.880987, 92.880621, 141.7743),\n (86.973165, 92.329565, 89.188461, 92.329565),\n (89.188461, 92.329565, 91.403757, 92.329565),\n (91.403757, 92.329565, 93.619053, 92.329565),\n (93.619053, 92.329565, 95.834349, 92.329565),\n (95.834349, 92.329565, 98.049645, 92.329565),\n (98.049645, 92.329565, 100.26494, 92.329565),\n (100.26494, 92.329565, 102.480236, 92.329565),\n (102.480236, 92.329565, 104.695532, 92.329565),\n (104.695532, 92.329565, 106.910828, 92.329565),\n (106.910828, 92.329565, 109.126124, 92.329565),\n (109.126124, 92.329565, 111.34142, 92.329565),\n (111.34142, 92.329565, 113.556716, 92.329565),\n (113.556716, 92.329565, 115.772012, 92.329565),\n (115.772012, 92.329565, 117.987308, 92.329565),\n (117.987308, 92.329565, 120.202604, 92.329565),\n (120.202604, 92.329565, 122.4179, 92.329565),\n (122.4179, 92.329565, 124.633196, 92.329565),\n (124.633196, 92.329565, 126.848492, 92.329565),\n (126.848492, 92.329565, 129.063788, 92.329565),\n (129.063788, 92.329565, 131.279084, 92.329565),\n (131.279084, 92.329565, 133.49438, 92.329565),\n (133.49438, 92.329565, 135.709676, 92.329565),\n (135.709676, 92.329565, 137.924972, 92.329565),\n (137.924972, 92.329565, 140.140268, 92.329565),\n (140.140268, 92.329565, 142.355564, 92.329565),\n (142.355564, 92.329565, 144.57086, 92.329565),\n (144.57086, 92.329565, 146.786155, 92.329565),\n (146.786155, 92.329565, 149.001451, 92.329565),\n (149.001451, 92.329565, 151.216747, 92.329565),\n (151.216747, 92.329565, 153.432043, 92.329565),\n (153.432043, 92.329565, 155.647339, 92.329565),\n (155.647339, 92.329565, 157.862635, 92.329565),\n (157.862635, 92.329565, 157.862635, 67.119035),\n (86.973165, 67.119035, 89.188461, 67.119035),\n (89.188461, 67.119035, 91.403757, 67.119035),\n (91.403757, 67.119035, 93.619053, 67.119035),\n (93.619053, 67.119035, 95.834349, 67.119035),\n (95.834349, 67.119035, 98.049645, 67.119035),\n (98.049645, 67.119035, 100.26494, 67.119035),\n (100.26494, 67.119035, 102.480236, 67.119035),\n (102.480236, 67.119035, 104.695532, 67.119035),\n (104.695532, 67.119035, 106.910828, 67.119035),\n (106.910828, 67.119035, 109.126124, 67.119035),\n (109.126124, 67.119035, 111.34142, 67.119035),\n (111.34142, 67.119035, 113.556716, 67.119035),\n (113.556716, 67.119035, 115.772012, 67.119035),\n (115.772012, 67.119035, 117.987308, 67.119035),\n (117.987308, 67.119035, 120.202604, 67.119035),\n (120.202604, 67.119035, 122.4179, 67.119035),\n (122.4179, 67.119035, 124.633196, 67.119035),\n (124.633196, 67.119035, 126.848492, 67.119035),\n (126.848492, 67.119035, 129.063788, 67.119035),\n (129.063788, 67.119035, 131.279084, 67.119035),\n (131.279084, 67.119035, 133.49438, 67.119035),\n (133.49438, 67.119035, 135.709676, 67.119035),\n (135.709676, 67.119035, 137.924972, 67.119035),\n (137.924972, 67.119035, 140.140268, 67.119035),\n (140.140268, 67.119035, 142.355564, 67.119035),\n (142.355564, 67.119035, 144.57086, 67.119035),\n (144.57086, 67.119035, 146.786155, 67.119035),\n (146.786155, 67.119035, 149.001451, 67.119035),\n (149.001451, 67.119035, 151.216747, 67.119035),\n (151.216747, 67.119035, 153.432043, 67.119035),\n (153.432043, 67.119035, 155.647339, 67.119035),\n (155.647339, 67.119035, 157.862635, 67.119035),\n (86.973165, 67.119035, 86.973165, 92.329565),\n (197.073165, 177.219035, 197.073165, 175.003739),\n (197.073165, 175.003739, 197.073165, 172.788443),\n (197.073165, 172.788443, 197.073165, 170.573147),\n (197.073165, 170.573147, 197.073165, 168.357851),\n (197.073165, 168.357851, 197.073165, 166.142555),\n (197.073165, 166.142555, 197.073165, 163.92726),\n (197.073165, 163.92726, 197.073165, 161.711964),\n (197.073165, 161.711964, 197.073165, 159.496668),\n (197.073165, 159.496668, 197.073165, 157.281372),\n (197.073165, 157.281372, 197.073165, 155.066076),\n (197.073165, 155.066076, 197.073165, 152.85078),\n (197.073165, 152.85078, 197.073165, 150.635484),\n (197.073165, 150.635484, 197.073165, 148.420188),\n (197.073165, 148.420188, 197.073165, 146.204892),\n (197.073165, 146.204892, 197.073165, 143.989596),\n (197.073165, 143.989596, 197.073165, 141.7743),\n (197.073165, 141.7743, 197.073165, 139.559004),\n (197.073165, 139.559004, 197.073165, 137.343708),\n (197.073165, 137.343708, 197.073165, 135.128412),\n (197.073165, 135.128412, 197.073165, 132.913116),\n (197.073165, 132.913116, 197.073165, 130.69782),\n (197.073165, 130.69782, 197.073165, 128.482524),\n (197.073165, 128.482524, 197.073165, 126.267228),\n (197.073165, 126.267228, 197.073165, 124.051932),\n (197.073165, 124.051932, 197.073165, 121.836636),\n (197.073165, 121.836636, 197.073165, 119.62134),\n (197.073165, 119.62134, 197.073165, 117.406045),\n (197.073165, 117.406045, 197.073165, 115.190749),\n (197.073165, 115.190749, 197.073165, 112.975453),\n (197.073165, 112.975453, 197.073165, 110.760157),\n (197.073165, 110.760157, 197.073165, 108.544861),\n (197.073165, 108.544861, 197.073165, 106.329565),\n (171.862635, 177.219035, 171.862635, 175.003739),\n (171.862635, 175.003739, 171.862635, 172.788443),\n (171.862635, 172.788443, 171.862635, 170.573147),\n (171.862635, 170.573147, 171.862635, 168.357851),\n (171.862635, 168.357851, 171.862635, 166.142555),\n (171.862635, 166.142555, 171.862635, 163.92726),\n (171.862635, 163.92726, 171.862635, 161.711964),\n (171.862635, 161.711964, 171.862635, 159.496668),\n (171.862635, 159.496668, 171.862635, 157.281372),\n (171.862635, 157.281372, 171.862635, 155.066076),\n (171.862635, 155.066076, 171.862635, 152.85078),\n (171.862635, 152.85078, 171.862635, 150.635484),\n (171.862635, 150.635484, 171.862635, 148.420188),\n (171.862635, 148.420188, 171.862635, 146.204892),\n (171.862635, 146.204892, 171.862635, 143.989596),\n (171.862635, 143.989596, 171.862635, 141.7743),\n (171.862635, 141.7743, 171.862635, 139.559004),\n (171.862635, 139.559004, 171.862635, 137.343708),\n (171.862635, 137.343708, 171.862635, 135.128412),\n (171.862635, 135.128412, 171.862635, 132.913116),\n (171.862635, 132.913116, 171.862635, 130.69782),\n (171.862635, 130.69782, 171.862635, 128.482524),\n (171.862635, 128.482524, 171.862635, 126.267228),\n (171.862635, 126.267228, 171.862635, 124.051932),\n (171.862635, 124.051932, 171.862635, 121.836636),\n (171.862635, 121.836636, 171.862635, 119.62134),\n (171.862635, 119.62134, 171.862635, 117.406045),\n (171.862635, 117.406045, 171.862635, 115.190749),\n (171.862635, 115.190749, 171.862635, 112.975453),\n (171.862635, 112.975453, 171.862635, 110.760157),\n (171.862635, 110.760157, 171.862635, 108.544861),\n (171.862635, 108.544861, 171.862635, 106.329565),\n (171.862635, 177.219035, 197.073165, 177.219035),\n (171.862635, 106.329565, 197.073165, 106.329565)\n]\nVISIBLE_CIRCLES = [\n (122.4179, 141.7743, 35.444735)\n]\nVISIBLE_ARCS = [\n\n]\nHIDDEN_SEGMENTS = [\n (136.4481, 67.119, 136.4481, 92.3296),\n (107.6492, 67.119, 107.6492, 92.3296),\n (151.2167, 67.119, 151.2167, 92.3296),\n (92.8806, 67.119, 92.8806, 92.3296),\n (197.0731, 116.6676, 171.8626, 116.6676),\n (197.0731, 141.7743, 171.8626, 141.7743),\n (197.0731, 166.881, 171.8626, 166.881)\n]\n# (orient, text, p1, p2, base) for linear; (orient, text, center, radius, angle) for diameter\nDIMENSIONS = [\n ('horizontal', '98.8689', (107.6492, 166.881), (136.4481, 166.881), (122.0487, 177.881)),\n ('aligned', '100', (136.4481, 166.881), (151.2167, 141.7743), (153.3137, 159.9049)),\n ('aligned', '100', (151.2167, 141.7743), (136.4481, 116.6676), (153.3137, 123.6437)),\n ('aligned', '100', (107.6492, 116.6676), (92.8806, 141.7743), (90.7836, 123.6437)),\n ('aligned', '100', (92.8806, 141.7743), (107.6492, 166.881), (90.7836, 159.9049)),\n ('diameter', '%%c243.37', (122.4179, 141.7743), 35.4447, 45),\n ('horizontal', '101.404', (92.8806, 141.7743), (122.4179, 141.7743), (107.6492, 152.7743)),\n ('vertical', '86.1934', (122.4179, 166.881), (122.4179, 141.7743), (133.4179, 154.3276)),\n ('horizontal', '86.5499', (197.0731, 166.881), (171.8626, 166.881), (184.4679, 155.881))\n]\n\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; _ds.dxf.dimasz = 2.5\n _ds.dxf.dimexe = 1.25; _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\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\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,\n angle=(0 if d[0] == \"horizontal\" else 90),\n 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,\n 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,\n 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,\n text=text, dimstyle=\"EZDXF\").render()\n\n doc.saveas(out_path)\n\n\nif __name__ == \"__main__\":\n out = sys.argv[1] if len(sys.argv) > 1 else \"0098_00989511_gt.dxf\"\n draw(out)\n print(\"wrote\", out)\n```"}], "images": ["images/0098_00989511.png"], "id": "0098_00989511"} {"messages": [{"role": "user", "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 82.11 mm wide and 100 mm tall, featuring a rectangular cutout 65.26 x 83.16 mm. It is extruded to a thickness of 1.04 mm."}, {"role": "assistant", "content": "```python\n#!/usr/bin/env python3\n# -*- coding: utf-8 -*-\n# Ground-truth 2D engineering drawing for part: 0001_00019190\n# Self-contained: reproduces the three-view DXF via ezdxf, NO FreeCAD needed.\n# Coordinates are A4 page millimetres (scale=0.9413877551020348, page=[297.0, 210.0]).\n# visible edges -> solid (layer OUTLINE); hidden edges -> dashed (layer HIDDEN)\n# dimensions -> real movable DIMENSION entities (text = true mm value)\n# Run: python 0001_00019190_gt.py [out.dxf]\nimport sys\nimport ezdxf\n\nSCALE = 0.9413877551020348\nPAGE = [297.0, 210.0]\n\nVISIBLE_SEGMENTS = [\n (174.165833, 172.049988, 174.165833, 77.911212),\n (96.872944, 172.049988, 174.165833, 172.049988),\n (174.165833, 77.911212, 96.872944, 77.911212),\n (96.872944, 77.911212, 96.872944, 172.049988),\n (104.80042, 85.838688, 104.80042, 164.122512),\n (166.238358, 85.838688, 104.80042, 85.838688),\n (166.238358, 164.122512, 166.238358, 85.838688),\n (104.80042, 164.122512, 166.238358, 164.122512),\n (174.165833, 61.949988, 174.165833, 63.911212),\n (174.165833, 63.911212, 96.872944, 63.911212),\n (96.872944, 61.949988, 96.872944, 63.911212),\n (174.165833, 61.949988, 96.872944, 61.949988),\n (190.127058, 172.049988, 188.165833, 172.049988),\n (188.165833, 77.911212, 190.127058, 77.911212),\n (190.127058, 77.911212, 190.127058, 172.049988),\n (188.165833, 77.911212, 188.165833, 172.049988)\n]\nVISIBLE_CIRCLES = [\n\n]\nVISIBLE_ARCS = [\n\n]\nHIDDEN_SEGMENTS = [\n (104.8004, 61.95, 104.8004, 63.9112),\n (166.2384, 63.9112, 166.2384, 61.95),\n (190.1271, 85.8387, 188.1658, 85.8387),\n (188.1658, 164.1225, 190.1271, 164.1225)\n]\n# (orient, text, p1, p2, base) for linear; (orient, text, center, radius, angle) for diameter\nDIMENSIONS = [\n ('horizontal', '82.1053', (174.1658, 172.05), (96.873, 172.05), (135.5194, 161.05)),\n ('vertical', '100', (174.1658, 77.9112), (174.1658, 172.05), (163.1658, 124.9806)),\n ('horizontal', '65.2632', (104.8004, 85.8387), (166.2384, 85.8387), (135.5194, 96.8387)),\n ('vertical', '83.1579', (104.8004, 85.8387), (104.8004, 164.1225), (93.8004, 124.9806)),\n ('horizontal', '8.4211', (96.873, 85.8387), (104.8004, 85.8387), (100.8367, 96.8387)),\n ('vertical', '8.4211', (104.8004, 77.9112), (104.8004, 85.8387), (93.8004, 81.875)),\n ('horizontal', '2.0833', (188.1658, 77.9112), (190.1271, 77.9112), (189.1464, 88.9112))\n]\n\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\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\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,\n angle=(0 if d[0] == \"horizontal\" else 90),\n 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,\n text=text, dimstyle=\"EZDXF\").render()\n\n doc.saveas(out_path)\n\n\nif __name__ == \"__main__\":\n out = sys.argv[1] if len(sys.argv) > 1 else \"0001_00019190_gt.dxf\"\n draw(out)\n print(\"wrote\", out)\n```"}], "images": ["images/0001_00019190.png"], "id": "0001_00019190"} {"messages": [{"role": "user", "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 89.47 x 89.47 mm. It is extruded to a thickness of 1371.43 mm."}, {"role": "assistant", "content": "```python\n#!/usr/bin/env python3\n# -*- coding: utf-8 -*-\n# Ground-truth 2D engineering drawing for part: 0006_00061590\n# Self-contained: reproduces the three-view DXF via ezdxf, NO FreeCAD needed.\n# Coordinates are A4 page millimetres (scale=0.033804020100492355, page=[297.0, 210.0]).\n# visible edges -> solid (layer OUTLINE); hidden edges -> dashed (layer HIDDEN)\n# dimensions -> real movable DIMENSION entities (text = true mm value)\n# Run: python 0006_00061590_gt.py [out.dxf]\nimport sys\nimport ezdxf\n\nSCALE = 0.033804020100492355\nPAGE = [297.0, 210.0]\n\nVISIBLE_SEGMENTS = [\n (91.830399, 168.669601, 91.830399, 172.050003),\n (88.449997, 168.669601, 91.830399, 168.669601),\n (91.830399, 172.050003, 88.449997, 172.050003),\n (88.449997, 172.050003, 88.449997, 168.669601),\n (88.627913, 171.872087, 88.627913, 168.847517),\n (91.652483, 171.872087, 88.627913, 171.872087),\n (91.652483, 168.847517, 91.652483, 171.872087),\n (88.627913, 168.847517, 91.652483, 168.847517),\n (91.830399, 61.950003, 91.830399, 154.669601),\n (88.449997, 61.950003, 88.449997, 154.669601),\n (88.449997, 61.950003, 91.830399, 61.950003),\n (88.449997, 154.669601, 91.830399, 154.669601),\n (105.830399, 168.669601, 198.549997, 168.669601),\n (198.549997, 172.050003, 105.830399, 172.050003),\n (105.830399, 172.050003, 105.830399, 168.669601),\n (198.549997, 172.050003, 198.549997, 168.669601)\n]\nVISIBLE_CIRCLES = [\n\n]\nVISIBLE_ARCS = [\n\n]\nHIDDEN_SEGMENTS = [\n\n]\n# (orient, text, p1, p2, base) for linear; (orient, text, center, radius, angle) for diameter\nDIMENSIONS = [\n ('horizontal', '100', (91.8304, 168.6696), (88.45, 168.6696), (90.1402, 157.6696)),\n ('vertical', '100', (91.8304, 172.05), (91.8304, 168.6696), (102.8304, 170.3598)),\n ('horizontal', '89.4737', (88.6279, 171.8721), (91.6525, 171.8721), (90.1402, 182.8721)),\n ('vertical', '89.4737', (88.6279, 171.8721), (88.6279, 168.8475), (99.6279, 170.3598)),\n ('vertical', '5.2632', (88.45, 171.8721), (88.6279, 171.8721), (88.539, 182.8721)),\n ('vertical', '5.2632', (88.6279, 172.05), (88.6279, 171.8721), (99.6279, 171.961)),\n ('horizontal', '2742.86', (198.55, 172.05), (105.8304, 172.05), (152.1902, 161.05))\n]\n\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\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\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,\n angle=(0 if d[0] == \"horizontal\" else 90),\n 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,\n text=text, dimstyle=\"EZDXF\").render()\n\n doc.saveas(out_path)\n\n\nif __name__ == \"__main__\":\n out = sys.argv[1] if len(sys.argv) > 1 else \"0006_00061590_gt.dxf\"\n draw(out)\n print(\"wrote\", out)\n```"}], "images": ["images/0006_00061590.png"], "id": "0006_00061590"} {"messages": [{"role": "user", "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 85.26 x 85.26 mm. It is extruded to a thickness of 252.63 mm."}, {"role": "assistant", "content": "```python\n#!/usr/bin/env python3\n# -*- coding: utf-8 -*-\n# Ground-truth 2D engineering drawing for part: 0006_00062188\n# Self-contained: reproduces the three-view DXF via ezdxf, NO FreeCAD needed.\n# Coordinates are A4 page millimetres (scale=0.2725223880597544, page=[297.0, 210.0]).\n# visible edges -> solid (layer OUTLINE); hidden edges -> dashed (layer HIDDEN)\n# dimensions -> real movable DIMENSION entities (text = true mm value)\n# Run: python 0006_00062188_gt.py [out.dxf]\nimport sys\nimport ezdxf\n\nSCALE = 0.2725223880597544\nPAGE = [297.0, 210.0]\n\nVISIBLE_SEGMENTS = [\n (115.702237, 144.797758, 115.702237, 172.049997),\n (115.702237, 172.049997, 88.449998, 172.049997),\n (88.449998, 172.049997, 88.449998, 144.797758),\n (88.449998, 144.797758, 115.702237, 144.797758),\n (90.458058, 170.041937, 90.458058, 146.805818),\n (113.694177, 170.041937, 90.458058, 170.041937),\n (113.694177, 146.805818, 113.694177, 170.041937),\n (90.458058, 146.805818, 113.694177, 146.805818),\n (115.702237, 130.797758, 115.702237, 61.949997),\n (88.449998, 130.797758, 88.449998, 61.949997),\n (88.449998, 61.949997, 115.702237, 61.949997),\n (88.449998, 130.797758, 115.702237, 130.797758),\n (198.549998, 172.049997, 129.702237, 172.049997),\n (129.702237, 172.049997, 129.702237, 144.797758),\n (198.549998, 144.797758, 129.702237, 144.797758),\n (198.549998, 172.049997, 198.549998, 144.797758)\n]\nVISIBLE_CIRCLES = [\n\n]\nVISIBLE_ARCS = [\n\n]\nHIDDEN_SEGMENTS = [\n (90.4581, 61.95, 90.4581, 130.7978),\n (113.6942, 61.95, 113.6942, 130.7978),\n (198.55, 146.8058, 129.7022, 146.8058),\n (198.55, 170.0419, 129.7022, 170.0419)\n]\n# (orient, text, p1, p2, base) for linear; (orient, text, center, radius, angle) for diameter\nDIMENSIONS = [\n ('horizontal', '100', (115.7022, 144.7978), (88.45, 144.7978), (102.0761, 133.7978)),\n ('vertical', '100', (115.7022, 172.05), (115.7022, 144.7978), (126.7022, 158.4239)),\n ('horizontal', '85.2632', (90.4581, 170.0419), (113.6942, 170.0419), (102.0761, 181.0419)),\n ('vertical', '85.2632', (90.4581, 170.0419), (90.4581, 146.8058), (101.4581, 158.4239)),\n ('horizontal', '7.3684', (88.45, 170.0419), (90.4581, 170.0419), (89.454, 181.0419)),\n ('vertical', '7.3684', (90.4581, 172.05), (90.4581, 170.0419), (101.4581, 171.046)),\n ('horizontal', '252.632', (198.55, 172.05), (129.7022, 172.05), (164.1261, 161.05))\n]\n\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\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\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,\n angle=(0 if d[0] == \"horizontal\" else 90),\n 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,\n text=text, dimstyle=\"EZDXF\").render()\n\n doc.saveas(out_path)\n\n\nif __name__ == \"__main__\":\n out = sys.argv[1] if len(sys.argv) > 1 else \"0006_00062188_gt.dxf\"\n draw(out)\n print(\"wrote\", out)\n```"}], "images": ["images/0006_00062188.png"], "id": "0006_00062188"} {"messages": [{"role": "user", "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 81.05 x 72.63 mm. It is extruded to a thickness of 30 mm."}, {"role": "assistant", "content": "```python\n#!/usr/bin/env python3\n# -*- coding: utf-8 -*-\n# Ground-truth 2D engineering drawing for part: 0008_00089107\n# Self-contained: reproduces the three-view DXF via ezdxf, NO FreeCAD needed.\n# Coordinates are A4 page millimetres (scale=0.7904329004329007, page=[297.0, 210.0]).\n# visible edges -> solid (layer OUTLINE); hidden edges -> dashed (layer HIDDEN)\n# dimensions -> real movable DIMENSION entities (text = true mm value)\n# Run: python 0008_00089107_gt.py [out.dxf]\nimport sys\nimport ezdxf\n\nSCALE = 0.7904329004329007\nPAGE = [297.0, 210.0]\n\nVISIBLE_SEGMENTS = [\n (164.165171, 172.050007, 164.165171, 99.662994),\n (164.165171, 99.662994, 85.121881, 99.662994),\n (85.121881, 99.662994, 85.121881, 172.050007),\n (85.121881, 172.050007, 164.165171, 172.050007),\n (92.610193, 107.151305, 92.610193, 164.561695),\n (156.67686, 107.151305, 92.610193, 107.151305),\n (156.67686, 164.561695, 156.67686, 107.151305),\n (92.610193, 164.561695, 156.67686, 164.561695),\n (164.165171, 61.950007, 164.165171, 85.662994),\n (164.165171, 85.662994, 85.121881, 85.662994),\n (85.121881, 61.950007, 85.121881, 85.662994),\n (164.165171, 61.950007, 85.121881, 61.950007),\n (178.165171, 99.662994, 201.878158, 99.662994),\n (201.878158, 99.662994, 201.878158, 172.050007),\n (178.165171, 172.050007, 201.878158, 172.050007),\n (178.165171, 99.662994, 178.165171, 172.050007)\n]\nVISIBLE_CIRCLES = [\n\n]\nVISIBLE_ARCS = [\n\n]\nHIDDEN_SEGMENTS = [\n (92.6102, 85.663, 92.6102, 61.95),\n (156.6768, 85.663, 156.6768, 61.95),\n (178.1652, 164.5617, 201.8781, 164.5617),\n (178.1652, 107.1513, 201.8781, 107.1513)\n]\n# (orient, text, p1, p2, base) for linear; (orient, text, center, radius, angle) for diameter\nDIMENSIONS = [\n ('horizontal', '100', (164.1652, 172.05), (85.1219, 172.05), (124.6435, 161.05)),\n ('vertical', '91.5789', (164.1652, 99.663), (164.1652, 172.05), (153.1652, 135.8565)),\n ('horizontal', '81.0526', (92.6102, 107.1513), (156.6768, 107.1513), (124.6435, 118.1513)),\n ('vertical', '72.6316', (92.6102, 107.1513), (92.6102, 164.5617), (81.6102, 135.8565)),\n ('horizontal', '9.4737', (85.1219, 107.1513), (92.6102, 107.1513), (88.866, 118.1513)),\n ('vertical', '9.4737', (92.6102, 99.663), (92.6102, 107.1513), (81.6102, 103.4071)),\n ('horizontal', '30', (178.1652, 99.663), (201.8781, 99.663), (190.0216, 110.663))\n]\n\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\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\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,\n angle=(0 if d[0] == \"horizontal\" else 90),\n 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,\n text=text, dimstyle=\"EZDXF\").render()\n\n doc.saveas(out_path)\n\n\nif __name__ == \"__main__\":\n out = sys.argv[1] if len(sys.argv) > 1 else \"0008_00089107_gt.dxf\"\n draw(out)\n print(\"wrote\", out)\n```"}], "images": ["images/0008_00089107.png"], "id": "0008_00089107"} {"messages": [{"role": "user", "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 89.47 x 89.47 mm. It is extruded to a thickness of 49.71 mm."}, {"role": "assistant", "content": "```python\n#!/usr/bin/env python3\n# -*- coding: utf-8 -*-\n# Ground-truth 2D engineering drawing for part: 0009_00095621\n# Self-contained: reproduces the three-view DXF via ezdxf, NO FreeCAD needed.\n# Coordinates are A4 page millimetres (scale=0.6419179687500055, page=[297.0, 210.0]).\n# visible edges -> solid (layer OUTLINE); hidden edges -> dashed (layer HIDDEN)\n# dimensions -> real movable DIMENSION entities (text = true mm value)\n# Run: python 0009_00095621_gt.py [out.dxf]\nimport sys\nimport ezdxf\n\nSCALE = 0.6419179687500055\nPAGE = [297.0, 210.0]\n\nVISIBLE_SEGMENTS = [\n (152.641796, 172.049996, 152.641796, 107.858199),\n (152.641796, 107.858199, 88.45, 107.858199),\n (88.45, 107.858199, 88.45, 172.049996),\n (88.45, 172.049996, 152.641796, 172.049996),\n (91.828515, 111.236715, 91.828515, 168.67148),\n (149.263281, 111.236715, 91.828515, 111.236715),\n (149.263281, 168.67148, 149.263281, 111.236715),\n (91.828515, 168.67148, 149.263281, 168.67148),\n (152.641796, 61.949996, 152.641796, 93.858199),\n (152.641796, 93.858199, 88.45, 93.858199),\n (88.45, 61.949996, 88.45, 93.858199),\n (152.641796, 61.949996, 88.45, 61.949996),\n (166.641796, 107.858199, 198.55, 107.858199),\n (198.55, 107.858199, 198.55, 172.049996),\n (166.641796, 172.049996, 198.55, 172.049996),\n (166.641796, 107.858199, 166.641796, 172.049996)\n]\nVISIBLE_CIRCLES = [\n\n]\nVISIBLE_ARCS = [\n\n]\nHIDDEN_SEGMENTS = [\n (91.8285, 93.8582, 91.8285, 61.95),\n (149.2633, 93.8582, 149.2633, 61.95),\n (166.6418, 168.6715, 198.55, 168.6715),\n (166.6418, 111.2367, 198.55, 111.2367)\n]\n# (orient, text, p1, p2, base) for linear; (orient, text, center, radius, angle) for diameter\nDIMENSIONS = [\n ('horizontal', '100', (152.6418, 172.05), (88.45, 172.05), (120.5459, 161.05)),\n ('vertical', '100', (152.6418, 107.8582), (152.6418, 172.05), (141.6418, 139.9541)),\n ('horizontal', '89.4737', (91.8285, 111.2367), (149.2633, 111.2367), (120.5459, 122.2367)),\n ('vertical', '89.4737', (91.8285, 111.2367), (91.8285, 168.6715), (80.8285, 139.9541)),\n ('horizontal', '5.2632', (88.45, 111.2367), (91.8285, 111.2367), (90.1393, 122.2367)),\n ('vertical', '5.2632', (91.8285, 107.8582), (91.8285, 111.2367), (80.8285, 109.5475)),\n ('horizontal', '49.7076', (166.6418, 107.8582), (198.55, 107.8582), (182.5959, 118.8582))\n]\n\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\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\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,\n angle=(0 if d[0] == \"horizontal\" else 90),\n 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,\n text=text, dimstyle=\"EZDXF\").render()\n\n doc.saveas(out_path)\n\n\nif __name__ == \"__main__\":\n out = sys.argv[1] if len(sys.argv) > 1 else \"0009_00095621_gt.dxf\"\n draw(out)\n print(\"wrote\", out)\n```"}], "images": ["images/0009_00095621.png"], "id": "0009_00095621"} {"messages": [{"role": "user", "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, featuring a rectangular cutout 37.89 x 87.37 mm. It is extruded to a thickness of 1371.43 mm."}, {"role": "assistant", "content": "```python\n#!/usr/bin/env python3\n# -*- coding: utf-8 -*-\n# Ground-truth 2D engineering drawing for part: 0015_00158029\n# Self-contained: reproduces the three-view DXF via ezdxf, NO FreeCAD needed.\n# Coordinates are A4 page millimetres (scale=0.06531067961163177, page=[297.0, 210.0]).\n# visible edges -> solid (layer OUTLINE); hidden edges -> dashed (layer HIDDEN)\n# dimensions -> real movable DIMENSION entities (text = true mm value)\n# Run: python 0015_00158029_gt.py [out.dxf]\nimport sys\nimport ezdxf\n\nSCALE = 0.06531067961163177\nPAGE = [297.0, 210.0]\n\nVISIBLE_SEGMENTS = [\n (93.3655, 165.518919, 93.3655, 172.049987),\n (93.3655, 172.049987, 90.065592, 172.049987),\n (90.065592, 172.049987, 90.065592, 165.518919),\n (90.065592, 165.518919, 93.3655, 165.518919),\n (90.478081, 171.637498, 90.478081, 165.931407),\n (92.953012, 171.637498, 90.478081, 171.637498),\n (92.953012, 165.931407, 92.953012, 171.637498),\n (90.478081, 165.931407, 92.953012, 165.931407),\n (93.3655, 151.518919, 93.3655, 61.949987),\n (90.065592, 151.518919, 90.065592, 61.949987),\n (90.065592, 61.949987, 93.3655, 61.949987),\n (90.065592, 151.518919, 93.3655, 151.518919),\n (196.934432, 172.049987, 107.3655, 172.049987),\n (107.3655, 172.049987, 107.3655, 165.518919),\n (196.934432, 165.518919, 107.3655, 165.518919),\n (196.934432, 172.049987, 196.934432, 165.518919)\n]\nVISIBLE_CIRCLES = [\n\n]\nVISIBLE_ARCS = [\n\n]\nHIDDEN_SEGMENTS = [\n\n]\n# (orient, text, p1, p2, base) for linear; (orient, text, center, radius, angle) for diameter\nDIMENSIONS = [\n ('horizontal', '50.5263', (93.3655, 165.5189), (90.0656, 165.5189), (91.7155, 154.5189)),\n ('vertical', '100', (93.3655, 172.05), (93.3655, 165.5189), (104.3655, 168.7845)),\n ('horizontal', '37.8947', (90.4781, 171.6375), (92.953, 171.6375), (91.7155, 182.6375)),\n ('vertical', '87.3684', (90.4781, 171.6375), (90.4781, 165.9314), (101.4781, 168.7845)),\n ('vertical', '6.3158', (90.0656, 171.6375), (90.4781, 171.6375), (90.2718, 182.6375)),\n ('vertical', '6.3158', (90.4781, 172.05), (90.4781, 171.6375), (101.4781, 171.8438)),\n ('horizontal', '1371.43', (196.9344, 172.05), (107.3655, 172.05), (152.15, 161.05))\n]\n\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\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\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,\n angle=(0 if d[0] == \"horizontal\" else 90),\n 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,\n text=text, dimstyle=\"EZDXF\").render()\n\n doc.saveas(out_path)\n\n\nif __name__ == \"__main__\":\n out = sys.argv[1] if len(sys.argv) > 1 else \"0015_00158029_gt.dxf\"\n draw(out)\n print(\"wrote\", out)\n```"}], "images": ["images/0015_00158029.png"], "id": "0015_00158029"} {"messages": [{"role": "user", "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, featuring a rectangular cutout 69.47 x 93.68 mm. It is extruded to a thickness of 4.14 mm."}, {"role": "assistant", "content": "```python\n#!/usr/bin/env python3\n# -*- coding: utf-8 -*-\n# Ground-truth 2D engineering drawing for part: 0021_00211897\n# Self-contained: reproduces the three-view DXF via ezdxf, NO FreeCAD needed.\n# Coordinates are A4 page millimetres (scale=0.8309107142857749, page=[297.0, 210.0]).\n# visible edges -> solid (layer OUTLINE); hidden edges -> dashed (layer HIDDEN)\n# dimensions -> real movable DIMENSION entities (text = true mm value)\n# Run: python 0021_00211897_gt.py [out.dxf]\nimport sys\nimport ezdxf\n\nSCALE = 0.8309107142857749\nPAGE = [297.0, 210.0]\n\nVISIBLE_SEGMENTS = [\n (166.70367, 84.175259, 166.70367, 167.26633),\n (166.70367, 167.26633, 102.854741, 167.26633),\n (102.854741, 167.26633, 102.854741, 84.175259),\n (102.854741, 84.175259, 166.70367, 84.175259),\n (105.47867, 164.642402, 105.47867, 86.799187),\n (163.205098, 164.642402, 105.47867, 164.642402),\n (163.205098, 86.799187, 163.205098, 164.642402),\n (105.47867, 86.799187, 163.205098, 86.799187),\n (166.70367, 70.175259, 166.70367, 66.733617),\n (102.854741, 70.175259, 102.854741, 66.733617),\n (102.854741, 66.733617, 166.70367, 66.733617),\n (102.854741, 70.175259, 166.70367, 70.175259),\n (184.145312, 167.26633, 180.70367, 167.26633),\n (180.70367, 167.26633, 180.70367, 84.175259),\n (184.145312, 84.175259, 180.70367, 84.175259),\n (184.145312, 167.26633, 184.145312, 84.175259)\n]\nVISIBLE_CIRCLES = [\n\n]\nVISIBLE_ARCS = [\n\n]\nHIDDEN_SEGMENTS = [\n (105.4786, 66.7336, 105.4786, 70.1753),\n (163.2051, 66.7336, 163.2051, 70.1753),\n (184.1453, 86.7992, 180.7036, 86.7992),\n (184.1453, 164.6424, 180.7036, 164.6424)\n]\n# (orient, text, p1, p2, base) for linear; (orient, text, center, radius, angle) for diameter\nDIMENSIONS = [\n ('horizontal', '76.8421', (166.7037, 84.1753), (102.8547, 84.1753), (134.7792, 73.1753)),\n ('vertical', '100', (166.7037, 167.2663), (166.7037, 84.1753), (177.7037, 125.7208)),\n ('horizontal', '69.4737', (105.4787, 164.6424), (163.205, 164.6424), (134.3419, 175.6424)),\n ('vertical', '93.6842', (105.4787, 164.6424), (105.4787, 86.7992), (116.4787, 125.7208)),\n ('horizontal', '3.1579', (102.8547, 164.6424), (105.4787, 164.6424), (104.1667, 175.6424)),\n ('vertical', '3.1579', (105.4787, 167.2663), (105.4787, 164.6424), (116.4787, 165.9544)),\n ('horizontal', '4.142', (184.1453, 167.2663), (180.7037, 167.2663), (182.4245, 156.2663))\n]\n\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\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\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,\n angle=(0 if d[0] == \"horizontal\" else 90),\n 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,\n text=text, dimstyle=\"EZDXF\").render()\n\n doc.saveas(out_path)\n\n\nif __name__ == \"__main__\":\n out = sys.argv[1] if len(sys.argv) > 1 else \"0021_00211897_gt.dxf\"\n draw(out)\n print(\"wrote\", out)\n```"}], "images": ["images/0021_00211897.png"], "id": "0021_00211897"} {"messages": [{"role": "user", "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 93.68 x 93.68 mm. It is extruded to a thickness of 25 mm."}, {"role": "assistant", "content": "```python\n#!/usr/bin/env python3\n# -*- coding: utf-8 -*-\n# Ground-truth 2D engineering drawing for part: 0032_00322756\n# Self-contained: reproduces the three-view DXF via ezdxf, NO FreeCAD needed.\n# Coordinates are A4 page millimetres (scale=0.7688, page=[297.0, 210.0]).\n# visible edges -> solid (layer OUTLINE); hidden edges -> dashed (layer HIDDEN)\n# dimensions -> real movable DIMENSION entities (text = true mm value)\n# Run: python 0032_00322756_gt.py [out.dxf]\nimport sys\nimport ezdxf\n\nSCALE = 0.7688\nPAGE = [297.0, 210.0]\n\nVISIBLE_SEGMENTS = [\n (165.330001, 172.050001, 165.330001, 95.170001),\n (165.330001, 95.170001, 88.450001, 95.170001),\n (88.450001, 95.170001, 88.450001, 172.050001),\n (88.450001, 172.050001, 165.330001, 172.050001),\n (90.877791, 97.597791, 90.877791, 169.622212),\n (162.902212, 97.597791, 90.877791, 97.597791),\n (162.902212, 169.622212, 162.902212, 97.597791),\n (90.877791, 169.622212, 162.902212, 169.622212),\n (165.330001, 61.950001, 165.330001, 81.170001),\n (165.330001, 81.170001, 88.450001, 81.170001),\n (88.450001, 61.950001, 88.450001, 81.170001),\n (165.330001, 61.950001, 88.450001, 61.950001),\n (179.330001, 95.170001, 198.550001, 95.170001),\n (198.550001, 95.170001, 198.550001, 172.050001),\n (179.330001, 172.050001, 198.550001, 172.050001),\n (179.330001, 95.170001, 179.330001, 172.050001)\n]\nVISIBLE_CIRCLES = [\n\n]\nVISIBLE_ARCS = [\n\n]\nHIDDEN_SEGMENTS = [\n (90.8778, 81.17, 90.8778, 61.95),\n (162.9022, 81.17, 162.9022, 61.95),\n (179.33, 169.6222, 198.55, 169.6222),\n (179.33, 97.5978, 198.55, 97.5978)\n]\n# (orient, text, p1, p2, base) for linear; (orient, text, center, radius, angle) for diameter\nDIMENSIONS = [\n ('horizontal', '100', (165.33, 172.05), (88.45, 172.05), (126.89, 161.05)),\n ('vertical', '100', (165.33, 95.17), (165.33, 172.05), (154.33, 133.61)),\n ('horizontal', '93.6842', (90.8778, 97.5978), (162.9022, 97.5978), (126.89, 108.5978)),\n ('vertical', '93.6842', (90.8778, 97.5978), (90.8778, 169.6222), (79.8778, 133.61)),\n ('horizontal', '3.1579', (88.45, 97.5978), (90.8778, 97.5978), (89.6639, 108.5978)),\n ('vertical', '3.1579', (90.8778, 95.17), (90.8778, 97.5978), (79.8778, 96.3839)),\n ('horizontal', '25', (179.33, 95.17), (198.55, 95.17), (188.94, 106.17))\n]\n\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\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\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,\n angle=(0 if d[0] == \"horizontal\" else 90),\n 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,\n text=text, dimstyle=\"EZDXF\").render()\n\n doc.saveas(out_path)\n\n\nif __name__ == \"__main__\":\n out = sys.argv[1] if len(sys.argv) > 1 else \"0032_00322756_gt.dxf\"\n draw(out)\n print(\"wrote\", out)\n```"}], "images": ["images/0032_00322756.png"], "id": "0032_00322756"} {"messages": [{"role": "user", "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 73.68 mm wide and 100 mm tall, featuring a rectangular cutout 69.47 x 95.79 mm. It is extruded to a thickness of 1.04 mm."}, {"role": "assistant", "content": "```python\n#!/usr/bin/env python3\n# -*- coding: utf-8 -*-\n# Ground-truth 2D engineering drawing for part: 0043_00432891\n# Self-contained: reproduces the three-view DXF via ezdxf, NO FreeCAD needed.\n# Coordinates are A4 page millimetres (scale=0.9510927835051515, page=[297.0, 210.0]).\n# visible edges -> solid (layer OUTLINE); hidden edges -> dashed (layer HIDDEN)\n# dimensions -> real movable DIMENSION entities (text = true mm value)\n# Run: python 0043_00432891_gt.py [out.dxf]\nimport sys\nimport ezdxf\n\nSCALE = 0.9510927835051515\nPAGE = [297.0, 210.0]\n\nVISIBLE_SEGMENTS = [\n (171.044905, 172.050011, 171.044905, 76.940733),\n (171.044905, 76.940733, 100.964384, 76.940733),\n (100.964384, 76.940733, 100.964384, 172.050011),\n (100.964384, 172.050011, 171.044905, 172.050011),\n (102.966685, 78.943034, 102.966685, 170.047711),\n (169.042604, 78.943034, 102.966685, 78.943034),\n (169.042604, 170.047711, 169.042604, 78.943034),\n (102.966685, 170.047711, 169.042604, 170.047711),\n (171.044905, 61.950011, 171.044905, 62.940733),\n (171.044905, 62.940733, 100.964384, 62.940733),\n (100.964384, 61.950011, 100.964384, 62.940733),\n (171.044905, 61.950011, 100.964384, 61.950011),\n (185.044905, 76.940733, 186.035627, 76.940733),\n (186.035627, 76.940733, 186.035627, 172.050011),\n (185.044905, 172.050011, 186.035627, 172.050011),\n (185.044905, 76.940733, 185.044905, 172.050011)\n]\nVISIBLE_CIRCLES = [\n\n]\nVISIBLE_ARCS = [\n\n]\nHIDDEN_SEGMENTS = [\n (102.9667, 62.9407, 102.9667, 61.95),\n (169.0426, 62.9407, 169.0426, 61.95),\n (185.0449, 170.0477, 186.0356, 170.0477),\n (185.0449, 78.943, 186.0356, 78.943)\n]\n# (orient, text, p1, p2, base) for linear; (orient, text, center, radius, angle) for diameter\nDIMENSIONS = [\n ('horizontal', '73.6842', (171.0449, 172.05), (100.9643, 172.05), (136.0046, 161.05)),\n ('vertical', '100', (171.0449, 76.9407), (171.0449, 172.05), (160.0449, 124.4954)),\n ('horizontal', '69.4737', (102.9667, 78.9431), (169.0426, 78.9431), (136.0047, 89.9431)),\n ('vertical', '95.7895', (102.9667, 78.9431), (102.9667, 170.0477), (91.9667, 124.4954)),\n ('horizontal', '2.1053', (100.9643, 78.9431), (102.9667, 78.9431), (101.9655, 89.9431)),\n ('vertical', '2.1053', (102.9667, 76.9407), (102.9667, 78.9431), (91.9667, 77.9419)),\n ('horizontal', '1.0417', (185.0449, 76.9407), (186.0357, 76.9407), (185.5403, 87.9407))\n]\n\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\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\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,\n angle=(0 if d[0] == \"horizontal\" else 90),\n 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,\n text=text, dimstyle=\"EZDXF\").render()\n\n doc.saveas(out_path)\n\n\nif __name__ == \"__main__\":\n out = sys.argv[1] if len(sys.argv) > 1 else \"0043_00432891_gt.dxf\"\n draw(out)\n print(\"wrote\", out)\n```"}], "images": ["images/0043_00432891.png"], "id": "0043_00432891"} {"messages": [{"role": "user", "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 74.74 x 74.74 mm. It is extruded to a thickness of 3200 mm."}, {"role": "assistant", "content": "```python\n#!/usr/bin/env python3\n# -*- coding: utf-8 -*-\n# Ground-truth 2D engineering drawing for part: 0043_00434726\n# Self-contained: reproduces the three-view DXF via ezdxf, NO FreeCAD needed.\n# Coordinates are A4 page millimetres (scale=0.02912121212121212, page=[297.0, 210.0]).\n# visible edges -> solid (layer OUTLINE); hidden edges -> dashed (layer HIDDEN)\n# dimensions -> real movable DIMENSION entities (text = true mm value)\n# Run: python 0043_00434726_gt.py [out.dxf]\nimport sys\nimport ezdxf\n\nSCALE = 0.02912121212121212\nPAGE = [297.0, 210.0]\n\nVISIBLE_SEGMENTS = [\n (91.362105, 169.137893, 91.362105, 172.050014),\n (91.362105, 172.050014, 88.449984, 172.050014),\n (88.449984, 172.050014, 88.449984, 169.137893),\n (88.449984, 169.137893, 91.362105, 169.137893),\n (88.81783, 171.682167, 88.81783, 169.505739),\n (90.994258, 171.682167, 88.81783, 171.682167),\n (90.994258, 169.505739, 90.994258, 171.682167),\n (88.81783, 169.505739, 90.994258, 169.505739),\n (91.362105, 155.137893, 91.362105, 61.950014),\n (88.449984, 155.137893, 88.449984, 61.950014),\n (88.449984, 61.950014, 91.362105, 61.950014),\n (88.449984, 155.137893, 91.362105, 155.137893),\n (198.549984, 172.050014, 105.362105, 172.050014),\n (105.362105, 172.050014, 105.362105, 169.137893),\n (198.549984, 169.137893, 105.362105, 169.137893),\n (198.549984, 172.050014, 198.549984, 169.137893)\n]\nVISIBLE_CIRCLES = [\n\n]\nVISIBLE_ARCS = [\n\n]\nHIDDEN_SEGMENTS = [\n\n]\n# (orient, text, p1, p2, base) for linear; (orient, text, center, radius, angle) for diameter\nDIMENSIONS = [\n ('horizontal', '100', (91.3621, 169.1379), (88.45, 169.1379), (89.9061, 158.1379)),\n ('vertical', '100', (91.3621, 172.05), (91.3621, 169.1379), (102.3621, 170.5939)),\n ('horizontal', '74.7368', (88.8178, 171.6822), (90.9943, 171.6822), (89.9061, 182.6822)),\n ('vertical', '74.7368', (88.8178, 171.6822), (88.8178, 169.5057), (99.8178, 170.5939)),\n ('vertical', '12.6316', (88.45, 171.6822), (88.8178, 171.6822), (88.6339, 182.6822)),\n ('vertical', '12.6316', (88.8178, 172.05), (88.8178, 171.6822), (99.8178, 171.8661)),\n ('horizontal', '3200', (198.55, 172.05), (105.3621, 172.05), (151.9561, 161.05))\n]\n\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\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\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,\n angle=(0 if d[0] == \"horizontal\" else 90),\n 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,\n text=text, dimstyle=\"EZDXF\").render()\n\n doc.saveas(out_path)\n\n\nif __name__ == \"__main__\":\n out = sys.argv[1] if len(sys.argv) > 1 else \"0043_00434726_gt.dxf\"\n draw(out)\n print(\"wrote\", out)\n```"}], "images": ["images/0043_00434726.png"], "id": "0043_00434726"} {"messages": [{"role": "user", "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 74.74 x 74.74 mm. It is extruded to a thickness of 2400 mm."}, {"role": "assistant", "content": "```python\n#!/usr/bin/env python3\n# -*- coding: utf-8 -*-\n# Ground-truth 2D engineering drawing for part: 0043_00437672\n# Self-contained: reproduces the three-view DXF via ezdxf, NO FreeCAD needed.\n# Coordinates are A4 page millimetres (scale=0.03844, page=[297.0, 210.0]).\n# visible edges -> solid (layer OUTLINE); hidden edges -> dashed (layer HIDDEN)\n# dimensions -> real movable DIMENSION entities (text = true mm value)\n# Run: python 0043_00437672_gt.py [out.dxf]\nimport sys\nimport ezdxf\n\nSCALE = 0.03844\nPAGE = [297.0, 210.0]\n\nVISIBLE_SEGMENTS = [\n (92.294005, 168.205995, 92.294005, 172.049995),\n (92.294005, 172.049995, 88.450005, 172.049995),\n (88.450005, 172.049995, 88.450005, 168.205995),\n (88.450005, 168.205995, 92.294005, 168.205995),\n (88.935563, 171.564437, 88.935563, 168.691553),\n (91.808447, 171.564437, 88.935563, 171.564437),\n (91.808447, 168.691553, 91.808447, 171.564437),\n (88.935563, 168.691553, 91.808447, 168.691553),\n (92.294005, 154.205995, 92.294005, 61.949995),\n (88.450005, 154.205995, 88.450005, 61.949995),\n (88.450005, 61.949995, 92.294005, 61.949995),\n (88.450005, 154.205995, 92.294005, 154.205995),\n (198.550005, 172.049995, 106.294005, 172.049995),\n (106.294005, 172.049995, 106.294005, 168.205995),\n (198.550005, 168.205995, 106.294005, 168.205995),\n (198.550005, 172.049995, 198.550005, 168.205995)\n]\nVISIBLE_CIRCLES = [\n\n]\nVISIBLE_ARCS = [\n\n]\nHIDDEN_SEGMENTS = [\n\n]\n# (orient, text, p1, p2, base) for linear; (orient, text, center, radius, angle) for diameter\nDIMENSIONS = [\n ('horizontal', '100', (92.294, 168.206), (88.45, 168.206), (90.372, 157.206)),\n ('vertical', '100', (92.294, 172.05), (92.294, 168.206), (103.294, 170.128)),\n ('horizontal', '74.7368', (88.9356, 171.5644), (91.8084, 171.5644), (90.372, 182.5644)),\n ('vertical', '74.7368', (88.9356, 171.5644), (88.9356, 168.6916), (99.9356, 170.128)),\n ('vertical', '12.6316', (88.45, 171.5644), (88.9356, 171.5644), (88.6928, 182.5644)),\n ('vertical', '12.6316', (88.9356, 172.05), (88.9356, 171.5644), (99.9356, 171.8072)),\n ('horizontal', '2400', (198.55, 172.05), (106.294, 172.05), (152.422, 161.05))\n]\n\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\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\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,\n angle=(0 if d[0] == \"horizontal\" else 90),\n 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,\n text=text, dimstyle=\"EZDXF\").render()\n\n doc.saveas(out_path)\n\n\nif __name__ == \"__main__\":\n out = sys.argv[1] if len(sys.argv) > 1 else \"0043_00437672_gt.dxf\"\n draw(out)\n print(\"wrote\", out)\n```"}], "images": ["images/0043_00437672.png"], "id": "0043_00437672"} {"messages": [{"role": "user", "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 51.58 x 68.42 mm. It is extruded to a thickness of 16.67 mm."}, {"role": "assistant", "content": "```python\n#!/usr/bin/env python3\n# -*- coding: utf-8 -*-\n# Ground-truth 2D engineering drawing for part: 0045_00456599\n# Self-contained: reproduces the three-view DXF via ezdxf, NO FreeCAD needed.\n# Coordinates are A4 page millimetres (scale=0.8237142857142833, page=[297.0, 210.0]).\n# visible edges -> solid (layer OUTLINE); hidden edges -> dashed (layer HIDDEN)\n# dimensions -> real movable DIMENSION entities (text = true mm value)\n# Run: python 0045_00456599_gt.py [out.dxf]\nimport sys\nimport ezdxf\n\nSCALE = 0.8237142857142833\nPAGE = [297.0, 210.0]\n\nVISIBLE_SEGMENTS = [\n (170.821407, 172.050016, 170.821407, 89.678587),\n (170.821407, 89.678587, 88.449979, 89.678587),\n (88.449979, 89.678587, 88.449979, 172.050016),\n (88.449979, 172.050016, 170.821407, 172.050016),\n (108.392535, 102.684602, 108.392535, 159.044001),\n (150.878851, 102.684602, 108.392535, 102.684602),\n (150.878851, 159.044001, 150.878851, 102.684602),\n (108.392535, 159.044001, 150.878851, 159.044001),\n (170.821407, 61.950016, 170.821407, 75.678587),\n (170.821407, 75.678587, 88.449979, 75.678587),\n (88.449979, 61.950016, 88.449979, 75.678587),\n (170.821407, 61.950016, 88.449979, 61.950016),\n (184.821407, 89.678587, 198.549979, 89.678587),\n (198.549979, 89.678587, 198.549979, 172.050016),\n (184.821407, 172.050016, 198.549979, 172.050016),\n (184.821407, 89.678587, 184.821407, 172.050016)\n]\nVISIBLE_CIRCLES = [\n\n]\nVISIBLE_ARCS = [\n\n]\nHIDDEN_SEGMENTS = [\n (108.3926, 75.6786, 108.3926, 61.95),\n (150.8789, 75.6786, 150.8789, 61.95),\n (184.8214, 159.044, 198.55, 159.044),\n (184.8214, 102.6846, 198.55, 102.6846)\n]\n# (orient, text, p1, p2, base) for linear; (orient, text, center, radius, angle) for diameter\nDIMENSIONS = [\n ('horizontal', '100', (170.8214, 172.05), (88.45, 172.05), (129.6357, 161.05)),\n ('vertical', '100', (170.8214, 89.6786), (170.8214, 172.05), (159.8214, 130.8643)),\n ('horizontal', '51.5789', (108.3925, 102.6846), (150.8789, 102.6846), (129.6357, 113.6846)),\n ('vertical', '68.4211', (108.3925, 102.6846), (108.3925, 159.044), (97.3925, 130.8643)),\n ('horizontal', '24.2105', (88.45, 102.6846), (108.3925, 102.6846), (98.4213, 113.6846)),\n ('vertical', '15.7895', (108.3925, 89.6786), (108.3925, 102.6846), (97.3925, 96.1816)),\n ('horizontal', '16.6667', (184.8214, 89.6786), (198.55, 89.6786), (191.6857, 100.6786))\n]\n\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\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\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,\n angle=(0 if d[0] == \"horizontal\" else 90),\n 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,\n text=text, dimstyle=\"EZDXF\").render()\n\n doc.saveas(out_path)\n\n\nif __name__ == \"__main__\":\n out = sys.argv[1] if len(sys.argv) > 1 else \"0045_00456599_gt.dxf\"\n draw(out)\n print(\"wrote\", out)\n```"}], "images": ["images/0045_00456599.png"], "id": "0045_00456599"} {"messages": [{"role": "user", "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 110.76 x 128.92 mm. It is extruded to a thickness of 50.92 mm. The outline includes one or more oblique (angled) edges."}, {"role": "assistant", "content": "```python\n#!/usr/bin/env python3\n# -*- coding: utf-8 -*-\n# Ground-truth 2D engineering drawing for part: 0050_00508740\n# Self-contained: reproduces the three-view DXF via ezdxf, NO FreeCAD needed.\n# Coordinates are A4 page millimetres (scale=0.38619386480123385, page=[297.0, 210.0]).\n# visible edges -> solid (layer OUTLINE); hidden edges -> dashed (layer HIDDEN)\n# dimensions -> real movable DIMENSION entities (text = true mm value)\n# Run: python 0050_00508740_gt.py [out.dxf]\nimport sys\nimport ezdxf\nimport math\n\nSCALE = 0.38619386480123385\nPAGE = [297.0, 210.0]\n\nVISIBLE_SEGMENTS = [\n (127.018431, 172.049998, 159.976899, 153.11641),\n (159.976899, 153.11641, 159.976899, 114.547989),\n (159.976899, 114.547989, 127.018431, 95.614401),\n (127.018431, 95.614401, 93.358718, 114.547989),\n (93.358718, 114.547989, 93.358718, 153.11641),\n (93.358718, 153.11641, 127.018431, 172.049998),\n (127.018431, 108.938037, 105.279866, 121.560429),\n (148.055751, 121.560429, 127.018431, 108.938037),\n (148.055751, 146.103969, 148.055751, 121.560429),\n (127.018431, 158.726362, 148.055751, 146.103969),\n (105.279866, 146.103969, 127.018431, 158.726362),\n (105.279866, 121.560429, 105.279866, 146.103969),\n (159.976899, 61.949998, 159.976899, 81.614401),\n (159.976899, 81.614401, 127.018431, 81.614401),\n (127.018431, 61.949998, 127.018431, 81.614401),\n (159.976899, 61.949998, 127.018431, 61.949998),\n (127.018431, 81.614401, 93.358718, 81.614401),\n (93.358718, 61.949998, 93.358718, 81.614401),\n (127.018431, 61.949998, 93.358718, 61.949998),\n (173.976899, 172.049998, 193.641302, 172.049998),\n (173.976899, 95.614401, 193.641302, 95.614401),\n (193.641302, 95.614401, 193.641302, 114.547989),\n (173.976899, 114.547989, 193.641302, 114.547989),\n (173.976899, 95.614401, 173.976899, 114.547989),\n (193.641302, 114.547989, 193.641302, 153.11641),\n (173.976899, 153.11641, 193.641302, 153.11641),\n (173.976899, 114.547989, 173.976899, 153.11641),\n (193.641302, 153.11641, 193.641302, 172.049998),\n (173.976899, 153.11641, 173.976899, 172.049998)\n]\nVISIBLE_CIRCLES = [\n\n]\nVISIBLE_ARCS = [\n\n]\nHIDDEN_SEGMENTS = [\n (105.2799, 81.6144, 105.2799, 61.95),\n (148.0557, 81.6144, 148.0557, 61.95),\n (173.9769, 158.7264, 193.6413, 158.7264),\n (173.9769, 146.104, 193.6413, 146.104),\n (173.9769, 121.5604, 193.6413, 121.5604),\n (173.9769, 108.938, 193.6413, 108.938)\n]\n# (orient, text, p1, p2, base) for linear; (orient, text, center, radius, angle) for diameter\nDIMENSIONS = [\n ('vertical', '99.868', (159.9769, 114.548), (159.9769, 153.1164), (148.9769, 133.8322)),\n ('aligned', '98.4214', (127.0184, 95.6144), (159.9769, 114.548), (138.0183, 114.6194)),\n ('aligned', '98.4214', (159.9769, 153.1164), (127.0184, 172.05), (138.0183, 153.045)),\n ('aligned', '100', (127.0184, 172.05), (93.3587, 153.1164), (115.5814, 152.9959)),\n ('aligned', '100', (93.3587, 114.548), (127.0184, 95.6144), (115.5814, 114.6685)),\n ('horizontal', '110.763', (105.2798, 108.938), (148.0558, 108.938), (126.6678, 119.938)),\n ('vertical', '128.921', (105.2798, 108.938), (105.2798, 158.7264), (94.2798, 133.8322)),\n ('horizontal', '30.8683', (93.3587, 108.938), (105.2798, 108.938), (99.3193, 119.938)),\n ('vertical', '34.4999', (105.2798, 95.6144), (105.2798, 108.938), (94.2798, 102.2762)),\n ('horizontal', '50.9185', (173.9769, 95.6144), (193.6413, 95.6144), (183.8091, 106.6144))\n]\n\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; _ds.dxf.dimasz = 2.5\n _ds.dxf.dimexe = 1.25; _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\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\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,\n angle=(0 if d[0] == \"horizontal\" else 90),\n 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,\n 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,\n 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,\n text=text, dimstyle=\"EZDXF\").render()\n\n doc.saveas(out_path)\n\n\nif __name__ == \"__main__\":\n out = sys.argv[1] if len(sys.argv) > 1 else \"0050_00508740_gt.dxf\"\n draw(out)\n print(\"wrote\", out)\n```"}], "images": ["images/0050_00508740.png"], "id": "0050_00508740"} {"messages": [{"role": "user", "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 89.47 x 89.47 mm. It is extruded to a thickness of 1920 mm."}, {"role": "assistant", "content": "```python\n#!/usr/bin/env python3\n# -*- coding: utf-8 -*-\n# Ground-truth 2D engineering drawing for part: 0050_00509724\n# Self-contained: reproduces the three-view DXF via ezdxf, NO FreeCAD needed.\n# Coordinates are A4 page millimetres (scale=0.047574257425742575, page=[297.0, 210.0]).\n# visible edges -> solid (layer OUTLINE); hidden edges -> dashed (layer HIDDEN)\n# dimensions -> real movable DIMENSION entities (text = true mm value)\n# Run: python 0050_00509724_gt.py [out.dxf]\nimport sys\nimport ezdxf\n\nSCALE = 0.047574257425742575\nPAGE = [297.0, 210.0]\n\nVISIBLE_SEGMENTS = [\n (93.207414, 172.050017, 93.207414, 167.292591),\n (93.207414, 167.292591, 88.449988, 167.292591),\n (88.449988, 167.292591, 88.449988, 172.050017),\n (88.449988, 172.050017, 93.207414, 172.050017),\n (88.700379, 167.542982, 88.700379, 171.799626),\n (92.957023, 167.542982, 88.700379, 167.542982),\n (92.957023, 171.799626, 92.957023, 167.542982),\n (88.700379, 171.799626, 92.957023, 171.799626),\n (93.207414, 61.950017, 93.207414, 153.292591),\n (93.207414, 153.292591, 88.449988, 153.292591),\n (88.449988, 61.950017, 88.449988, 153.292591),\n (93.207414, 61.950017, 88.449988, 61.950017),\n (107.207414, 167.292591, 198.549988, 167.292591),\n (198.549988, 167.292591, 198.549988, 172.050017),\n (107.207414, 172.050017, 198.549988, 172.050017),\n (107.207414, 167.292591, 107.207414, 172.050017)\n]\nVISIBLE_CIRCLES = [\n\n]\nVISIBLE_ARCS = [\n\n]\nHIDDEN_SEGMENTS = [\n\n]\n# (orient, text, p1, p2, base) for linear; (orient, text, center, radius, angle) for diameter\nDIMENSIONS = [\n ('horizontal', '100', (93.2074, 172.05), (88.45, 172.05), (90.8287, 161.05)),\n ('vertical', '100', (93.2074, 167.2926), (93.2074, 172.05), (82.2074, 169.6713)),\n ('horizontal', '89.4737', (88.7004, 167.543), (92.957, 167.543), (90.8287, 178.543)),\n ('vertical', '89.4737', (88.7004, 167.543), (88.7004, 171.7996), (77.7004, 169.6713)),\n ('vertical', '5.2632', (88.45, 167.543), (88.7004, 167.543), (88.5752, 178.543)),\n ('vertical', '5.2632', (88.7004, 167.2926), (88.7004, 167.543), (77.7004, 167.4178)),\n ('horizontal', '1920', (107.2074, 167.2926), (198.55, 167.2926), (152.8787, 178.2926))\n]\n\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\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\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,\n angle=(0 if d[0] == \"horizontal\" else 90),\n 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,\n text=text, dimstyle=\"EZDXF\").render()\n\n doc.saveas(out_path)\n\n\nif __name__ == \"__main__\":\n out = sys.argv[1] if len(sys.argv) > 1 else \"0050_00509724_gt.dxf\"\n draw(out)\n print(\"wrote\", out)\n```"}], "images": ["images/0050_00509724.png"], "id": "0050_00509724"} {"messages": [{"role": "user", "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 74.74 x 74.74 mm. It is extruded to a thickness of 800 mm."}, {"role": "assistant", "content": "```python\n#!/usr/bin/env python3\n# -*- coding: utf-8 -*-\n# Ground-truth 2D engineering drawing for part: 0062_00626447\n# Self-contained: reproduces the three-view DXF via ezdxf, NO FreeCAD needed.\n# Coordinates are A4 page millimetres (scale=0.10677777777777778, page=[297.0, 210.0]).\n# visible edges -> solid (layer OUTLINE); hidden edges -> dashed (layer HIDDEN)\n# dimensions -> real movable DIMENSION entities (text = true mm value)\n# Run: python 0062_00626447_gt.py [out.dxf]\nimport sys\nimport ezdxf\n\nSCALE = 0.10677777777777778\nPAGE = [297.0, 210.0]\n\nVISIBLE_SEGMENTS = [\n (99.127792, 161.37221, 99.127792, 172.049988),\n (99.127792, 172.049988, 88.450015, 172.049988),\n (88.450015, 172.049988, 88.450015, 161.37221),\n (88.450015, 161.37221, 99.127792, 161.37221),\n (89.798787, 170.701216, 89.798787, 162.720982),\n (97.77902, 170.701216, 89.798787, 170.701216),\n (97.77902, 162.720982, 97.77902, 170.701216),\n (89.798787, 162.720982, 97.77902, 162.720982),\n (99.127792, 147.37221, 99.127792, 61.949988),\n (88.450015, 147.37221, 88.450015, 61.949988),\n (88.450015, 61.949988, 99.127792, 61.949988),\n (88.450015, 147.37221, 99.127792, 147.37221),\n (198.550015, 172.049988, 113.127792, 172.049988),\n (113.127792, 172.049988, 113.127792, 161.37221),\n (198.550015, 161.37221, 113.127792, 161.37221),\n (198.550015, 172.049988, 198.550015, 161.37221)\n]\nVISIBLE_CIRCLES = [\n\n]\nVISIBLE_ARCS = [\n\n]\nHIDDEN_SEGMENTS = [\n (89.7988, 61.95, 89.7988, 147.3722),\n (97.779, 61.95, 97.779, 147.3722),\n (198.55, 162.721, 113.1278, 162.721),\n (198.55, 170.7012, 113.1278, 170.7012)\n]\n# (orient, text, p1, p2, base) for linear; (orient, text, center, radius, angle) for diameter\nDIMENSIONS = [\n ('horizontal', '100', (99.1278, 161.3722), (88.45, 161.3722), (93.7889, 150.3722)),\n ('vertical', '100', (99.1278, 172.05), (99.1278, 161.3722), (110.1278, 166.7111)),\n ('horizontal', '74.7368', (89.7988, 170.7012), (97.779, 170.7012), (93.7889, 181.7012)),\n ('vertical', '74.7368', (89.7988, 170.7012), (89.7988, 162.721), (100.7988, 166.7111)),\n ('horizontal', '12.6316', (88.45, 170.7012), (89.7988, 170.7012), (89.1244, 181.7012)),\n ('vertical', '12.6316', (89.7988, 172.05), (89.7988, 170.7012), (100.7988, 171.3756)),\n ('horizontal', '800', (198.55, 172.05), (113.1278, 172.05), (155.8389, 161.05))\n]\n\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\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\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,\n angle=(0 if d[0] == \"horizontal\" else 90),\n 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,\n text=text, dimstyle=\"EZDXF\").render()\n\n doc.saveas(out_path)\n\n\nif __name__ == \"__main__\":\n out = sys.argv[1] if len(sys.argv) > 1 else \"0062_00626447_gt.dxf\"\n draw(out)\n print(\"wrote\", out)\n```"}], "images": ["images/0062_00626447.png"], "id": "0062_00626447"} {"messages": [{"role": "user", "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 92.63 mm tall, featuring a rectangular cutout 89.47 x 76.84 mm. It is extruded to a thickness of 4.14 mm."}, {"role": "assistant", "content": "```python\n#!/usr/bin/env python3\n# -*- coding: utf-8 -*-\n# Ground-truth 2D engineering drawing for part: 0064_00643265\n# Self-contained: reproduces the three-view DXF via ezdxf, NO FreeCAD needed.\n# Coordinates are A4 page millimetres (scale=0.9930395185685879, page=[297.0, 210.0]).\n# visible edges -> solid (layer OUTLINE); hidden edges -> dashed (layer HIDDEN)\n# dimensions -> real movable DIMENSION entities (text = true mm value)\n# Run: python 0064_00643265_gt.py [out.dxf]\nimport sys\nimport ezdxf\n\nSCALE = 0.9930395185685879\nPAGE = [297.0, 210.0]\n\nVISIBLE_SEGMENTS = [\n (184.095381, 80.063172, 184.095381, 172.04999),\n (184.095381, 172.04999, 84.791429, 172.04999),\n (84.791429, 172.04999, 84.791429, 80.063172),\n (84.791429, 80.063172, 184.095381, 80.063172),\n (90.017953, 166.823466, 90.017953, 90.516219),\n (178.868858, 166.823466, 90.017953, 166.823466),\n (178.868858, 90.516219, 178.868858, 166.823466),\n (90.017953, 90.516219, 178.868858, 90.516219),\n (184.095381, 66.063172, 184.095381, 61.94999),\n (184.095381, 61.94999, 84.791429, 61.94999),\n (84.791429, 66.063172, 84.791429, 61.94999),\n (184.095381, 66.063172, 84.791429, 66.063172),\n (198.095381, 172.04999, 202.208563, 172.04999),\n (202.208563, 172.04999, 202.208563, 80.063172),\n (198.095381, 80.063172, 202.208563, 80.063172),\n (198.095381, 172.04999, 198.095381, 80.063172)\n]\nVISIBLE_CIRCLES = [\n\n]\nVISIBLE_ARCS = [\n\n]\nHIDDEN_SEGMENTS = [\n (90.018, 66.0632, 90.018, 61.95),\n (178.8689, 66.0632, 178.8689, 61.95),\n (198.0954, 166.8235, 202.2086, 166.8235),\n (198.0954, 90.5162, 202.2086, 90.5162)\n]\n# (orient, text, p1, p2, base) for linear; (orient, text, center, radius, angle) for diameter\nDIMENSIONS = [\n ('horizontal', '100', (184.0953, 172.05), (84.7914, 172.05), (134.4434, 161.05)),\n ('vertical', '92.6316', (184.0953, 80.0631), (184.0953, 172.05), (173.0953, 126.0566)),\n ('horizontal', '89.4737', (90.018, 90.5163), (178.8689, 90.5163), (134.4434, 101.5163)),\n ('vertical', '76.8421', (90.018, 90.5163), (90.018, 166.8235), (79.018, 128.6699)),\n ('horizontal', '5.2632', (84.7914, 90.5163), (90.018, 90.5163), (87.4047, 101.5163)),\n ('vertical', '10.5263', (90.018, 80.0631), (90.018, 90.5163), (79.018, 85.2897)),\n ('horizontal', '4.142', (198.0954, 80.0631), (202.2086, 80.0631), (200.152, 91.0631))\n]\n\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\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\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,\n angle=(0 if d[0] == \"horizontal\" else 90),\n 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,\n text=text, dimstyle=\"EZDXF\").render()\n\n doc.saveas(out_path)\n\n\nif __name__ == \"__main__\":\n out = sys.argv[1] if len(sys.argv) > 1 else \"0064_00643265_gt.dxf\"\n draw(out)\n print(\"wrote\", out)\n```"}], "images": ["images/0064_00643265.png"], "id": "0064_00643265"} {"messages": [{"role": "user", "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 92.63 mm tall, featuring a rectangular cutout 89.47 x 76.84 mm. It is extruded to a thickness of 4.14 mm."}, {"role": "assistant", "content": "```python\n#!/usr/bin/env python3\n# -*- coding: utf-8 -*-\n# Ground-truth 2D engineering drawing for part: 0064_00643270\n# Self-contained: reproduces the three-view DXF via ezdxf, NO FreeCAD needed.\n# Coordinates are A4 page millimetres (scale=0.9930395185685879, page=[297.0, 210.0]).\n# visible edges -> solid (layer OUTLINE); hidden edges -> dashed (layer HIDDEN)\n# dimensions -> real movable DIMENSION entities (text = true mm value)\n# Run: python 0064_00643270_gt.py [out.dxf]\nimport sys\nimport ezdxf\n\nSCALE = 0.9930395185685879\nPAGE = [297.0, 210.0]\n\nVISIBLE_SEGMENTS = [\n (184.095381, 80.063172, 184.095381, 172.04999),\n (184.095381, 172.04999, 84.791429, 172.04999),\n (84.791429, 172.04999, 84.791429, 80.063172),\n (84.791429, 80.063172, 184.095381, 80.063172),\n (90.017953, 166.823466, 90.017953, 90.516219),\n (178.868858, 166.823466, 90.017953, 166.823466),\n (178.868858, 90.516219, 178.868858, 166.823466),\n (90.017953, 90.516219, 178.868858, 90.516219),\n (184.095381, 66.063172, 184.095381, 61.94999),\n (184.095381, 61.94999, 84.791429, 61.94999),\n (84.791429, 66.063172, 84.791429, 61.94999),\n (184.095381, 66.063172, 84.791429, 66.063172),\n (198.095381, 172.04999, 202.208563, 172.04999),\n (202.208563, 172.04999, 202.208563, 80.063172),\n (198.095381, 80.063172, 202.208563, 80.063172),\n (198.095381, 172.04999, 198.095381, 80.063172)\n]\nVISIBLE_CIRCLES = [\n\n]\nVISIBLE_ARCS = [\n\n]\nHIDDEN_SEGMENTS = [\n (90.018, 66.0632, 90.018, 61.95),\n (178.8689, 66.0632, 178.8689, 61.95),\n (198.0954, 166.8235, 202.2086, 166.8235),\n (198.0954, 90.5162, 202.2086, 90.5162)\n]\n# (orient, text, p1, p2, base) for linear; (orient, text, center, radius, angle) for diameter\nDIMENSIONS = [\n ('horizontal', '100', (184.0953, 172.05), (84.7914, 172.05), (134.4434, 161.05)),\n ('vertical', '92.6316', (184.0953, 80.0631), (184.0953, 172.05), (173.0953, 126.0566)),\n ('horizontal', '89.4737', (90.018, 90.5163), (178.8689, 90.5163), (134.4434, 101.5163)),\n ('vertical', '76.8421', (90.018, 90.5163), (90.018, 166.8235), (79.018, 128.6699)),\n ('horizontal', '5.2632', (84.7914, 90.5163), (90.018, 90.5163), (87.4047, 101.5163)),\n ('vertical', '10.5263', (90.018, 80.0631), (90.018, 90.5163), (79.018, 85.2897)),\n ('horizontal', '4.142', (198.0954, 80.0631), (202.2086, 80.0631), (200.152, 91.0631))\n]\n\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\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\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,\n angle=(0 if d[0] == \"horizontal\" else 90),\n 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,\n text=text, dimstyle=\"EZDXF\").render()\n\n doc.saveas(out_path)\n\n\nif __name__ == \"__main__\":\n out = sys.argv[1] if len(sys.argv) > 1 else \"0064_00643270_gt.dxf\"\n draw(out)\n print(\"wrote\", out)\n```"}], "images": ["images/0064_00643270.png"], "id": "0064_00643270"} {"messages": [{"role": "user", "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 87.37 x 87.37 mm. It is extruded to a thickness of 1920 mm."}, {"role": "assistant", "content": "```python\n#!/usr/bin/env python3\n# -*- coding: utf-8 -*-\n# Ground-truth 2D engineering drawing for part: 0073_00730848\n# Self-contained: reproduces the three-view DXF via ezdxf, NO FreeCAD needed.\n# Coordinates are A4 page millimetres (scale=0.047574257425742575, page=[297.0, 210.0]).\n# visible edges -> solid (layer OUTLINE); hidden edges -> dashed (layer HIDDEN)\n# dimensions -> real movable DIMENSION entities (text = true mm value)\n# Run: python 0073_00730848_gt.py [out.dxf]\nimport sys\nimport ezdxf\n\nSCALE = 0.047574257425742575\nPAGE = [297.0, 210.0]\n\nVISIBLE_SEGMENTS = [\n (93.207429, 167.292568, 93.207429, 172.049993),\n (93.207429, 172.049993, 88.450004, 172.049993),\n (88.450004, 172.049993, 88.450004, 167.292568),\n (88.450004, 167.292568, 93.207429, 167.292568),\n (88.750472, 171.749524, 88.750472, 167.593037),\n (92.90696, 171.749524, 88.750472, 171.749524),\n (92.90696, 167.593037, 92.90696, 171.749524),\n (88.750472, 167.593037, 92.90696, 167.593037),\n (93.207429, 153.292568, 93.207429, 61.949993),\n (88.450004, 153.292568, 88.450004, 61.949993),\n (88.450004, 61.949993, 93.207429, 61.949993),\n (88.450004, 153.292568, 93.207429, 153.292568),\n (198.550004, 172.049993, 107.207429, 172.049993),\n (107.207429, 172.049993, 107.207429, 167.292568),\n (198.550004, 167.292568, 107.207429, 167.292568),\n (198.550004, 172.049993, 198.550004, 167.292568)\n]\nVISIBLE_CIRCLES = [\n\n]\nVISIBLE_ARCS = [\n\n]\nHIDDEN_SEGMENTS = [\n\n]\n# (orient, text, p1, p2, base) for linear; (orient, text, center, radius, angle) for diameter\nDIMENSIONS = [\n ('horizontal', '100', (93.2074, 167.2926), (88.45, 167.2926), (90.8287, 156.2926)),\n ('vertical', '100', (93.2074, 172.05), (93.2074, 167.2926), (104.2074, 169.6713)),\n ('horizontal', '87.3684', (88.7505, 171.7495), (92.907, 171.7495), (90.8287, 182.7495)),\n ('vertical', '87.3684', (88.7505, 171.7495), (88.7505, 167.593), (99.7505, 169.6713)),\n ('vertical', '6.3158', (88.45, 171.7495), (88.7505, 171.7495), (88.6002, 182.7495)),\n ('vertical', '6.3158', (88.7505, 172.05), (88.7505, 171.7495), (99.7505, 171.8998)),\n ('horizontal', '1920', (198.55, 172.05), (107.2074, 172.05), (152.8787, 161.05))\n]\n\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\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\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,\n angle=(0 if d[0] == \"horizontal\" else 90),\n 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,\n text=text, dimstyle=\"EZDXF\").render()\n\n doc.saveas(out_path)\n\n\nif __name__ == \"__main__\":\n out = sys.argv[1] if len(sys.argv) > 1 else \"0073_00730848_gt.dxf\"\n draw(out)\n print(\"wrote\", out)\n```"}], "images": ["images/0073_00730848.png"], "id": "0073_00730848"} {"messages": [{"role": "user", "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 48.42 mm tall, featuring 2 polygonal cutouts. It is extruded to a thickness of 0.52 mm."}, {"role": "assistant", "content": "```python\n#!/usr/bin/env python3\n# -*- coding: utf-8 -*-\n# Ground-truth 2D engineering drawing for part: 0077_00773334\n# Self-contained: reproduces the three-view DXF via ezdxf, NO FreeCAD needed.\n# Coordinates are A4 page millimetres (scale=1.461786528497414, page=[297.0, 210.0]).\n# visible edges -> solid (layer OUTLINE); hidden edges -> dashed (layer HIDDEN)\n# dimensions -> real movable DIMENSION entities (text = true mm value)\n# Run: python 0077_00773334_gt.py [out.dxf]\nimport sys\nimport ezdxf\n\nSCALE = 1.461786528497414\nPAGE = [297.0, 210.0]\n\nVISIBLE_SEGMENTS = [\n (209.208658, 159.771269, 209.208658, 88.990027),\n (209.208658, 88.990027, 63.030005, 88.990027),\n (63.030005, 88.990027, 63.030005, 159.771269),\n (63.030005, 159.771269, 209.208658, 159.771269),\n (67.646173, 93.606195, 67.646173, 155.155101),\n (133.811248, 93.606195, 67.646173, 93.606195),\n (133.811248, 155.155101, 133.811248, 93.606195),\n (67.646173, 155.155101, 133.811248, 155.155101),\n (138.427416, 93.606195, 138.427416, 155.155101),\n (204.59249, 93.606195, 138.427416, 93.606195),\n (204.59249, 155.155101, 204.59249, 93.606195),\n (138.427416, 155.155101, 204.59249, 155.155101),\n (209.208658, 74.22868, 209.208658, 74.990027),\n (209.208658, 74.990027, 63.030005, 74.990027),\n (63.030005, 74.22868, 63.030005, 74.990027),\n (209.208658, 74.22868, 63.030005, 74.22868),\n (223.208658, 88.990027, 223.970005, 88.990027),\n (223.970005, 88.990027, 223.970005, 159.771269),\n (223.208658, 159.771269, 223.970005, 159.771269),\n (223.208658, 88.990027, 223.208658, 159.771269)\n]\nVISIBLE_CIRCLES = [\n\n]\nVISIBLE_ARCS = [\n\n]\nHIDDEN_SEGMENTS = [\n (67.6462, 74.9901, 67.6462, 74.2287),\n (133.8112, 74.9901, 133.8112, 74.2287),\n (138.4274, 74.9901, 138.4274, 74.2287),\n (204.5925, 74.9901, 204.5925, 74.2287),\n (223.2087, 155.1551, 223.97, 155.1551),\n (223.2087, 93.6062, 223.97, 93.6062)\n]\n# (orient, text, p1, p2, base) for linear; (orient, text, center, radius, angle) for diameter\nDIMENSIONS = [\n ('horizontal', '100', (209.2087, 159.7713), (63.03, 159.7713), (136.1193, 148.7713)),\n ('vertical', '48.4211', (209.2087, 88.99), (209.2087, 159.7713), (198.2087, 124.3807)),\n ('horizontal', '45.2632', (67.6462, 93.6062), (133.8113, 93.6062), (100.7287, 104.6062)),\n ('vertical', '42.1053', (67.6462, 93.6062), (67.6462, 155.1551), (56.6462, 124.3807)),\n ('horizontal', '3.1579', (63.03, 93.6062), (67.6462, 93.6062), (65.3381, 104.6062)),\n ('vertical', '3.1579', (67.6462, 88.99), (67.6462, 93.6062), (56.6462, 91.2981)),\n ('horizontal', '45.2632', (138.4273, 93.6062), (204.5925, 93.6062), (171.5099, 104.6062)),\n ('vertical', '42.1053', (138.4273, 93.6062), (138.4273, 155.1551), (127.4273, 124.3807)),\n ('horizontal', '51.5789', (63.03, 93.6062), (138.4273, 93.6062), (100.7287, 104.6062)),\n ('vertical', '3.1579', (138.4273, 88.99), (138.4273, 93.6062), (127.4273, 91.2981)),\n ('horizontal', '0.5208', (223.2087, 88.99), (223.97, 88.99), (223.5893, 99.99))\n]\n\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\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\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,\n angle=(0 if d[0] == \"horizontal\" else 90),\n 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,\n text=text, dimstyle=\"EZDXF\").render()\n\n doc.saveas(out_path)\n\n\nif __name__ == \"__main__\":\n out = sys.argv[1] if len(sys.argv) > 1 else \"0077_00773334_gt.dxf\"\n draw(out)\n print(\"wrote\", out)\n```"}], "images": ["images/0077_00773334.png"], "id": "0077_00773334"} {"messages": [{"role": "user", "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, featuring a rectangular cutout 37.89 x 87.37 mm. It is extruded to a thickness of 1371.43 mm."}, {"role": "assistant", "content": "```python\n#!/usr/bin/env python3\n# -*- coding: utf-8 -*-\n# Ground-truth 2D engineering drawing for part: 0077_00775561\n# Self-contained: reproduces the three-view DXF via ezdxf, NO FreeCAD needed.\n# Coordinates are A4 page millimetres (scale=0.09986213592230148, page=[297.0, 210.0]).\n# visible edges -> solid (layer OUTLINE); hidden edges -> dashed (layer HIDDEN)\n# dimensions -> real movable DIMENSION entities (text = true mm value)\n# Run: python 0077_00775561_gt.py [out.dxf]\nimport sys\nimport ezdxf\n\nSCALE = 0.09986213592230148\nPAGE = [297.0, 210.0]\n\nVISIBLE_SEGMENTS = [\n (70.545925, 197.470007, 70.545925, 187.483794),\n (70.545925, 187.483794, 65.50026, 187.483794),\n (65.50026, 187.483794, 65.50026, 197.470007),\n (65.50026, 197.470007, 70.545925, 197.470007),\n (66.130968, 188.114502, 66.130968, 196.839299),\n (69.915217, 188.114502, 66.130968, 188.114502),\n (69.915217, 196.839299, 69.915217, 188.114502),\n (66.130968, 196.839299, 69.915217, 196.839299),\n (70.545925, 36.530007, 70.545925, 173.483794),\n (70.545925, 173.483794, 65.50026, 173.483794),\n (65.50026, 36.530007, 65.50026, 173.483794),\n (70.545925, 36.530007, 65.50026, 36.530007),\n (84.545925, 187.483794, 221.499712, 187.483794),\n (221.499712, 187.483794, 221.499712, 197.470007),\n (84.545925, 197.470007, 221.499712, 197.470007),\n (84.545925, 187.483794, 84.545925, 197.470007)\n]\nVISIBLE_CIRCLES = [\n\n]\nVISIBLE_ARCS = [\n\n]\nHIDDEN_SEGMENTS = [\n (66.131, 173.4838, 66.131, 36.53),\n (69.9152, 173.4838, 69.9152, 36.53),\n (84.5459, 196.8393, 221.4997, 196.8393),\n (84.5459, 188.1145, 221.4997, 188.1145)\n]\n# (orient, text, p1, p2, base) for linear; (orient, text, center, radius, angle) for diameter\nDIMENSIONS = [\n ('horizontal', '50.5263', (70.5459, 197.47), (65.5003, 197.47), (68.0231, 186.47)),\n ('vertical', '100', (70.5459, 187.4838), (70.5459, 197.47), (59.5459, 192.4769)),\n ('horizontal', '37.8947', (66.131, 188.1145), (69.9152, 188.1145), (68.0231, 199.1145)),\n ('vertical', '87.3684', (66.131, 188.1145), (66.131, 196.8393), (55.131, 192.4769)),\n ('horizontal', '6.3158', (65.5003, 188.1145), (66.131, 188.1145), (65.8156, 199.1145)),\n ('vertical', '6.3158', (66.131, 187.4838), (66.131, 188.1145), (55.131, 187.7991)),\n ('horizontal', '1371.43', (84.5459, 187.4838), (221.4997, 187.4838), (153.0228, 198.4838))\n]\n\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\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\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,\n angle=(0 if d[0] == \"horizontal\" else 90),\n 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,\n text=text, dimstyle=\"EZDXF\").render()\n\n doc.saveas(out_path)\n\n\nif __name__ == \"__main__\":\n out = sys.argv[1] if len(sys.argv) > 1 else \"0077_00775561_gt.dxf\"\n draw(out)\n print(\"wrote\", out)\n```"}], "images": ["images/0077_00775561.png"], "id": "0077_00775561"} {"messages": [{"role": "user", "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, featuring 2 polygonal cutouts. It is extruded to a thickness of 1.04 mm."}, {"role": "assistant", "content": "```python\n#!/usr/bin/env python3\n# -*- coding: utf-8 -*-\n# Ground-truth 2D engineering drawing for part: 0077_00779870\n# Self-contained: reproduces the three-view DXF via ezdxf, NO FreeCAD needed.\n# Coordinates are A4 page millimetres (scale=0.8022586206896556, page=[297.0, 210.0]).\n# visible edges -> solid (layer OUTLINE); hidden edges -> dashed (layer HIDDEN)\n# dimensions -> real movable DIMENSION entities (text = true mm value)\n# Run: python 0077_00779870_gt.py [out.dxf]\nimport sys\nimport ezdxf\n\nSCALE = 0.8022586206896556\nPAGE = [297.0, 210.0]\n\nVISIBLE_SEGMENTS = [\n (169.439217, 164.530772, 169.439217, 84.30491),\n (169.439217, 84.30491, 102.725079, 84.30491),\n (102.725079, 84.30491, 102.725079, 164.530772),\n (102.725079, 164.530772, 169.439217, 164.530772),\n (122.992666, 121.462152, 122.992666, 140.885255),\n (150.860597, 121.462152, 122.992666, 121.462152),\n (150.860597, 140.885255, 150.860597, 121.462152),\n (122.992666, 140.885255, 150.860597, 140.885255),\n (130.59301, 95.283186, 130.59301, 113.861807),\n (144.949217, 95.283186, 130.59301, 95.283186),\n (144.949217, 113.861807, 144.949217, 95.283186),\n (130.59301, 113.861807, 144.949217, 113.861807),\n (169.439217, 69.469224, 169.439217, 70.30491),\n (102.725079, 69.469224, 102.725079, 70.30491),\n (102.725079, 70.30491, 169.439217, 70.30491),\n (102.725079, 69.469224, 169.439217, 69.469224),\n (184.274903, 84.30491, 183.439217, 84.30491),\n (183.439217, 84.30491, 183.439217, 164.530772),\n (184.274903, 164.530772, 183.439217, 164.530772),\n (184.274903, 84.30491, 184.274903, 164.530772)\n]\nVISIBLE_CIRCLES = [\n\n]\nVISIBLE_ARCS = [\n\n]\nHIDDEN_SEGMENTS = [\n (122.9927, 69.4692, 122.9927, 70.3049),\n (150.8606, 69.4692, 150.8606, 70.3049),\n (130.593, 69.4692, 130.593, 70.3049),\n (144.9492, 69.4692, 144.9492, 70.3049),\n (184.2749, 121.4622, 183.4392, 121.4622),\n (184.2749, 140.8853, 183.4392, 140.8853),\n (184.2749, 95.2832, 183.4392, 95.2832),\n (184.2749, 113.8618, 183.4392, 113.8618)\n]\n# (orient, text, p1, p2, base) for linear; (orient, text, center, radius, angle) for diameter\nDIMENSIONS = [\n ('horizontal', '83.1579', (169.4392, 84.3049), (102.7251, 84.3049), (136.0822, 73.3049)),\n ('vertical', '100', (169.4392, 164.5308), (169.4392, 84.3049), (180.4392, 124.4178)),\n ('horizontal', '34.7368', (122.9927, 140.8852), (150.8606, 140.8852), (136.9267, 151.8852)),\n ('vertical', '24.2105', (122.9927, 140.8852), (122.9927, 121.4622), (133.9927, 131.1737)),\n ('horizontal', '25.2632', (102.7251, 140.8852), (122.9927, 140.8852), (112.8589, 151.8852)),\n ('vertical', '29.4737', (122.9927, 164.5308), (122.9927, 140.8852), (133.9927, 152.708)),\n ('horizontal', '17.8947', (130.593, 113.8618), (144.9492, 113.8618), (137.7711, 124.8618)),\n ('vertical', '23.1579', (130.593, 113.8618), (130.593, 95.2832), (141.593, 104.5725)),\n ('horizontal', '34.7368', (102.7251, 113.8618), (130.593, 113.8618), (116.659, 124.8618)),\n ('vertical', '63.1579', (130.593, 164.5308), (130.593, 113.8618), (141.593, 139.1963)),\n ('horizontal', '1.0417', (184.2749, 164.5308), (183.4392, 164.5308), (183.8571, 153.5308))\n]\n\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\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\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,\n angle=(0 if d[0] == \"horizontal\" else 90),\n 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,\n text=text, dimstyle=\"EZDXF\").render()\n\n doc.saveas(out_path)\n\n\nif __name__ == \"__main__\":\n out = sys.argv[1] if len(sys.argv) > 1 else \"0077_00779870_gt.dxf\"\n draw(out)\n print(\"wrote\", out)\n```"}], "images": ["images/0077_00779870.png"], "id": "0077_00779870"} {"messages": [{"role": "user", "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 74.74 x 74.74 mm. It is extruded to a thickness of 5.21 mm."}, {"role": "assistant", "content": "```python\n#!/usr/bin/env python3\n# -*- coding: utf-8 -*-\n# Ground-truth 2D engineering drawing for part: 0079_00797425\n# Self-contained: reproduces the three-view DXF via ezdxf, NO FreeCAD needed.\n# Coordinates are A4 page millimetres (scale=0.9134257425742603, page=[297.0, 210.0]).\n# visible edges -> solid (layer OUTLINE); hidden edges -> dashed (layer HIDDEN)\n# dimensions -> real movable DIMENSION entities (text = true mm value)\n# Run: python 0079_00797425_gt.py [out.dxf]\nimport sys\nimport ezdxf\n\nSCALE = 0.9134257425742603\nPAGE = [297.0, 210.0]\n\nVISIBLE_SEGMENTS = [\n (179.792573, 172.050008, 179.792573, 80.707433),\n (179.792573, 80.707433, 88.449999, 80.707433),\n (88.449999, 80.707433, 88.449999, 172.050008),\n (88.449999, 172.050008, 179.792573, 172.050008),\n (99.988009, 92.245443, 99.988009, 160.511998),\n (168.254564, 92.245443, 99.988009, 92.245443),\n (168.254564, 160.511998, 168.254564, 92.245443),\n (99.988009, 160.511998, 168.254564, 160.511998),\n (179.792573, 61.950008, 179.792573, 66.707433),\n (179.792573, 66.707433, 88.449999, 66.707433),\n (88.449999, 61.950008, 88.449999, 66.707433),\n (179.792573, 61.950008, 88.449999, 61.950008),\n (193.792573, 80.707433, 198.549999, 80.707433),\n (198.549999, 80.707433, 198.549999, 172.050008),\n (193.792573, 172.050008, 198.549999, 172.050008),\n (193.792573, 80.707433, 193.792573, 172.050008)\n]\nVISIBLE_CIRCLES = [\n\n]\nVISIBLE_ARCS = [\n\n]\nHIDDEN_SEGMENTS = [\n (99.988, 66.7074, 99.988, 61.95),\n (168.2546, 66.7074, 168.2546, 61.95),\n (193.7926, 160.512, 198.55, 160.512),\n (193.7926, 92.2454, 198.55, 92.2454)\n]\n# (orient, text, p1, p2, base) for linear; (orient, text, center, radius, angle) for diameter\nDIMENSIONS = [\n ('horizontal', '100', (179.7926, 172.05), (88.45, 172.05), (134.1213, 161.05)),\n ('vertical', '100', (179.7926, 80.7074), (179.7926, 172.05), (168.7926, 126.3787)),\n ('horizontal', '74.7368', (99.988, 92.2455), (168.2545, 92.2455), (134.1213, 103.2455)),\n ('vertical', '74.7368', (99.988, 92.2455), (99.988, 160.512), (88.988, 126.3787)),\n ('horizontal', '12.6316', (88.45, 92.2455), (99.988, 92.2455), (94.219, 103.2455)),\n ('vertical', '12.6316', (99.988, 80.7074), (99.988, 92.2455), (88.988, 86.4764)),\n ('horizontal', '5.2083', (193.7926, 80.7074), (198.55, 80.7074), (196.1713, 91.7074))\n]\n\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\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\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,\n angle=(0 if d[0] == \"horizontal\" else 90),\n 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,\n text=text, dimstyle=\"EZDXF\").render()\n\n doc.saveas(out_path)\n\n\nif __name__ == \"__main__\":\n out = sys.argv[1] if len(sys.argv) > 1 else \"0079_00797425_gt.dxf\"\n draw(out)\n print(\"wrote\", out)\n```"}], "images": ["images/0079_00797425.png"], "id": "0079_00797425"} {"messages": [{"role": "user", "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, featuring a rectangular cutout 68.42 x 53.68 mm. It is extruded to a thickness of 259.46 mm."}, {"role": "assistant", "content": "```python\n#!/usr/bin/env python3\n# -*- coding: utf-8 -*-\n# Ground-truth 2D engineering drawing for part: 0081_00815928\n# Self-contained: reproduces the three-view DXF via ezdxf, NO FreeCAD needed.\n# Coordinates are A4 page millimetres (scale=0.28222199014125016, page=[297.0, 210.0]).\n# visible edges -> solid (layer OUTLINE); hidden edges -> dashed (layer HIDDEN)\n# dimensions -> real movable DIMENSION entities (text = true mm value)\n# Run: python 0081_00815928_gt.py [out.dxf]\nimport sys\nimport ezdxf\n\nSCALE = 0.28222199014125016\nPAGE = [297.0, 210.0]\n\nVISIBLE_SEGMENTS = [\n (113.998515, 172.050002, 113.998515, 149.175167),\n (113.998515, 149.175167, 85.776316, 149.175167),\n (85.776316, 149.175167, 85.776316, 172.050002),\n (85.776316, 172.050002, 113.998515, 172.050002),\n (89.935377, 152.740077, 89.935377, 167.890941),\n (109.245303, 152.740077, 89.935377, 152.740077),\n (109.245303, 167.890941, 109.245303, 152.740077),\n (89.935377, 167.890941, 109.245303, 167.890941),\n (113.998515, 61.950002, 113.998515, 135.175167),\n (85.776316, 61.950002, 85.776316, 135.175167),\n (85.776316, 135.175167, 113.998515, 135.175167),\n (85.776316, 61.950002, 113.998515, 61.950002),\n (201.22368, 149.175167, 127.998515, 149.175167),\n (127.998515, 149.175167, 127.998515, 172.050002),\n (201.22368, 172.050002, 127.998515, 172.050002),\n (201.22368, 149.175167, 201.22368, 172.050002)\n]\nVISIBLE_CIRCLES = [\n\n]\nVISIBLE_ARCS = [\n\n]\nHIDDEN_SEGMENTS = [\n (89.9354, 61.95, 89.9354, 135.1752),\n (109.2453, 61.95, 109.2453, 135.1752),\n (201.2237, 152.7401, 127.9985, 152.7401),\n (201.2237, 167.8909, 127.9985, 167.8909)\n]\n# (orient, text, p1, p2, base) for linear; (orient, text, center, radius, angle) for diameter\nDIMENSIONS = [\n ('horizontal', '100', (113.9985, 149.1752), (85.7763, 149.1752), (99.8874, 138.1752)),\n ('vertical', '81.0526', (113.9985, 172.05), (113.9985, 149.1752), (124.9985, 160.6126)),\n ('horizontal', '68.4211', (89.9354, 167.8909), (109.2453, 167.8909), (99.5903, 178.8909)),\n ('vertical', '53.6842', (89.9354, 167.8909), (89.9354, 152.7401), (100.9354, 160.3155)),\n ('horizontal', '14.7368', (85.7763, 167.8909), (89.9354, 167.8909), (87.8558, 178.8909)),\n ('vertical', '14.7368', (89.9354, 172.05), (89.9354, 167.8909), (100.9354, 169.9705)),\n ('horizontal', '259.459', (201.2237, 172.05), (127.9985, 172.05), (164.6111, 161.05))\n]\n\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\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\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,\n angle=(0 if d[0] == \"horizontal\" else 90),\n 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,\n text=text, dimstyle=\"EZDXF\").render()\n\n doc.saveas(out_path)\n\n\nif __name__ == \"__main__\":\n out = sys.argv[1] if len(sys.argv) > 1 else \"0081_00815928_gt.dxf\"\n draw(out)\n print(\"wrote\", out)\n```"}], "images": ["images/0081_00815928.png"], "id": "0081_00815928"} {"messages": [{"role": "user", "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 87.37 x 87.37 mm. It is extruded to a thickness of 1371.43 mm."}, {"role": "assistant", "content": "```python\n#!/usr/bin/env python3\n# -*- coding: utf-8 -*-\n# Ground-truth 2D engineering drawing for part: 0082_00829737\n# Self-contained: reproduces the three-view DXF via ezdxf, NO FreeCAD needed.\n# Coordinates are A4 page millimetres (scale=0.06531067961163178, page=[297.0, 210.0]).\n# visible edges -> solid (layer OUTLINE); hidden edges -> dashed (layer HIDDEN)\n# dimensions -> real movable DIMENSION entities (text = true mm value)\n# Run: python 0082_00829737_gt.py [out.dxf]\nimport sys\nimport ezdxf\n\nSCALE = 0.06531067961163178\nPAGE = [297.0, 210.0]\n\nVISIBLE_SEGMENTS = [\n (94.981085, 172.049981, 94.981085, 165.518913),\n (94.981085, 165.518913, 88.450017, 165.518913),\n (88.450017, 165.518913, 88.450017, 172.049981),\n (88.450017, 172.049981, 94.981085, 172.049981),\n (88.862506, 165.931402, 88.862506, 171.637493),\n (94.568597, 165.931402, 88.862506, 165.931402),\n (94.568597, 171.637493, 94.568597, 165.931402),\n (88.862506, 171.637493, 94.568597, 171.637493),\n (94.981085, 61.949981, 94.981085, 151.518913),\n (94.981085, 151.518913, 88.450017, 151.518913),\n (88.450017, 61.949981, 88.450017, 151.518913),\n (94.981085, 61.949981, 88.450017, 61.949981),\n (108.981085, 165.518913, 198.550017, 165.518913),\n (198.550017, 165.518913, 198.550017, 172.049981),\n (108.981085, 172.049981, 198.550017, 172.049981),\n (108.981085, 165.518913, 108.981085, 172.049981)\n]\nVISIBLE_CIRCLES = [\n\n]\nVISIBLE_ARCS = [\n\n]\nHIDDEN_SEGMENTS = [\n\n]\n# (orient, text, p1, p2, base) for linear; (orient, text, center, radius, angle) for diameter\nDIMENSIONS = [\n ('horizontal', '100', (94.9811, 172.05), (88.45, 172.05), (91.7155, 161.05)),\n ('vertical', '100', (94.9811, 165.5189), (94.9811, 172.05), (83.9811, 168.7845)),\n ('horizontal', '87.3684', (88.8625, 165.9314), (94.5686, 165.9314), (91.7155, 176.9314)),\n ('vertical', '87.3684', (88.8625, 165.9314), (88.8625, 171.6375), (77.8625, 168.7845)),\n ('vertical', '6.3158', (88.45, 165.9314), (88.8625, 165.9314), (88.6562, 176.9314)),\n ('vertical', '6.3158', (88.8625, 165.5189), (88.8625, 165.9314), (77.8625, 165.7252)),\n ('horizontal', '1371.43', (108.9811, 165.5189), (198.55, 165.5189), (153.7655, 176.5189))\n]\n\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\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\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,\n angle=(0 if d[0] == \"horizontal\" else 90),\n 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,\n text=text, dimstyle=\"EZDXF\").render()\n\n doc.saveas(out_path)\n\n\nif __name__ == \"__main__\":\n out = sys.argv[1] if len(sys.argv) > 1 else \"0082_00829737_gt.dxf\"\n draw(out)\n print(\"wrote\", out)\n```"}], "images": ["images/0082_00829737.png"], "id": "0082_00829737"} {"messages": [{"role": "user", "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, featuring a rectangular cutout 45.26 x 93.68 mm. It is extruded to a thickness of 4.69 mm."}, {"role": "assistant", "content": "```python\n#!/usr/bin/env python3\n# -*- coding: utf-8 -*-\n# Ground-truth 2D engineering drawing for part: 0097_00978039\n# Self-contained: reproduces the three-view DXF via ezdxf, NO FreeCAD needed.\n# Coordinates are A4 page millimetres (scale=0.9179701492537312, page=[297.0, 210.0]).\n# visible edges -> solid (layer OUTLINE); hidden edges -> dashed (layer HIDDEN)\n# dimensions -> real movable DIMENSION entities (text = true mm value)\n# Run: python 0097_00978039_gt.py [out.dxf]\nimport sys\nimport ezdxf\n\nSCALE = 0.9179701492537312\nPAGE = [297.0, 210.0]\n\nVISIBLE_SEGMENTS = [\n (158.022483, 80.252972, 158.022483, 172.049987),\n (158.022483, 172.049987, 110.674549, 172.049987),\n (110.674549, 172.049987, 110.674549, 80.252972),\n (110.674549, 80.252972, 158.022483, 80.252972),\n (113.573402, 169.151134, 113.573402, 83.151825),\n (155.12363, 169.151134, 113.573402, 169.151134),\n (155.12363, 83.151825, 155.12363, 169.151134),\n (113.573402, 83.151825, 155.12363, 83.151825),\n (158.022483, 66.252972, 158.022483, 61.949987),\n (110.674549, 66.252972, 110.674549, 61.949987),\n (110.674549, 61.949987, 158.022483, 61.949987),\n (110.674549, 66.252972, 158.022483, 66.252972),\n (176.325468, 172.049987, 172.022483, 172.049987),\n (172.022483, 172.049987, 172.022483, 80.252972),\n (176.325468, 80.252972, 172.022483, 80.252972),\n (176.325468, 172.049987, 176.325468, 80.252972)\n]\nVISIBLE_CIRCLES = [\n\n]\nVISIBLE_ARCS = [\n\n]\nHIDDEN_SEGMENTS = [\n (113.5734, 61.95, 113.5734, 66.253),\n (155.1236, 61.95, 155.1236, 66.253),\n (176.3255, 83.1518, 172.0225, 83.1518),\n (176.3255, 169.1511, 172.0225, 169.1511)\n]\n# (orient, text, p1, p2, base) for linear; (orient, text, center, radius, angle) for diameter\nDIMENSIONS = [\n ('horizontal', '51.5789', (158.0225, 80.253), (110.6745, 80.253), (134.3485, 69.253)),\n ('vertical', '100', (158.0225, 172.05), (158.0225, 80.253), (169.0225, 126.1515)),\n ('horizontal', '45.2632', (113.5734, 169.1511), (155.1236, 169.1511), (134.3485, 180.1511)),\n ('vertical', '93.6842', (113.5734, 169.1511), (113.5734, 83.1518), (124.5734, 126.1515)),\n ('horizontal', '3.1579', (110.6745, 169.1511), (113.5734, 169.1511), (112.1239, 180.1511)),\n ('vertical', '3.1579', (113.5734, 172.05), (113.5734, 169.1511), (124.5734, 170.6006)),\n ('horizontal', '4.6875', (176.3255, 172.05), (172.0225, 172.05), (174.174, 161.05))\n]\n\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\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\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,\n angle=(0 if d[0] == \"horizontal\" else 90),\n 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,\n text=text, dimstyle=\"EZDXF\").render()\n\n doc.saveas(out_path)\n\n\nif __name__ == \"__main__\":\n out = sys.argv[1] if len(sys.argv) > 1 else \"0097_00978039_gt.dxf\"\n draw(out)\n print(\"wrote\", out)\n```"}], "images": ["images/0097_00978039.png"], "id": "0097_00978039"} {"messages": [{"role": "user", "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 rectangular cutout 89.47 x 40 mm. It is extruded to a thickness of 800 mm."}, {"role": "assistant", "content": "```python\n#!/usr/bin/env python3\n# -*- coding: utf-8 -*-\n# Ground-truth 2D engineering drawing for part: 0098_00980291\n# Self-contained: reproduces the three-view DXF via ezdxf, NO FreeCAD needed.\n# Coordinates are A4 page millimetres (scale=0.11298886138613909, page=[297.0, 210.0]).\n# visible edges -> solid (layer OUTLINE); hidden edges -> dashed (layer HIDDEN)\n# dimensions -> real movable DIMENSION entities (text = true mm value)\n# Run: python 0098_00980291_gt.py [out.dxf]\nimport sys\nimport ezdxf\n\nSCALE = 0.11298886138613909\nPAGE = [297.0, 210.0]\n\nVISIBLE_SEGMENTS = [\n (96.953899, 166.34109, 96.953899, 172.050001),\n (96.953899, 172.050001, 85.655013, 172.050001),\n (85.655013, 172.050001, 85.655013, 166.34109),\n (85.655013, 166.34109, 96.953899, 166.34109),\n (86.249691, 171.455323, 86.249691, 166.935769),\n (96.359221, 171.455323, 86.249691, 171.455323),\n (96.359221, 166.935769, 96.359221, 171.455323),\n (86.249691, 166.935769, 96.359221, 166.935769),\n (96.953899, 152.34109, 96.953899, 61.950001),\n (85.655013, 152.34109, 85.655013, 61.950001),\n (85.655013, 61.950001, 96.953899, 61.950001),\n (85.655013, 152.34109, 96.953899, 152.34109),\n (201.344988, 172.050001, 110.953899, 172.050001),\n (110.953899, 172.050001, 110.953899, 166.34109),\n (201.344988, 166.34109, 110.953899, 166.34109),\n (201.344988, 172.050001, 201.344988, 166.34109)\n]\nVISIBLE_CIRCLES = [\n\n]\nVISIBLE_ARCS = [\n\n]\nHIDDEN_SEGMENTS = [\n (86.2497, 61.95, 86.2497, 152.3411),\n (96.3592, 61.95, 96.3592, 152.3411),\n (201.345, 166.9358, 110.9539, 166.9358),\n (201.345, 171.4553, 110.9539, 171.4553)\n]\n# (orient, text, p1, p2, base) for linear; (orient, text, center, radius, angle) for diameter\nDIMENSIONS = [\n ('horizontal', '100', (96.9539, 166.3411), (85.655, 166.3411), (91.3045, 155.3411)),\n ('vertical', '50.5263', (96.9539, 172.05), (96.9539, 166.3411), (107.9539, 169.1955)),\n ('horizontal', '89.4737', (86.2497, 171.4553), (96.3592, 171.4553), (91.3045, 182.4553)),\n ('vertical', '40', (86.2497, 171.4553), (86.2497, 166.9358), (97.2497, 169.1955)),\n ('horizontal', '5.2632', (85.655, 171.4553), (86.2497, 171.4553), (85.9524, 182.4553)),\n ('vertical', '5.2632', (86.2497, 172.05), (86.2497, 171.4553), (97.2497, 171.7527)),\n ('horizontal', '800', (201.345, 172.05), (110.9539, 172.05), (156.1494, 161.05))\n]\n\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\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\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,\n angle=(0 if d[0] == \"horizontal\" else 90),\n 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,\n text=text, dimstyle=\"EZDXF\").render()\n\n doc.saveas(out_path)\n\n\nif __name__ == \"__main__\":\n out = sys.argv[1] if len(sys.argv) > 1 else \"0098_00980291_gt.dxf\"\n draw(out)\n print(\"wrote\", out)\n```"}], "images": ["images/0098_00980291.png"], "id": "0098_00980291"} {"messages": [{"role": "user", "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 89.47 x 89.47 mm. It is extruded to a thickness of 2400 mm."}, {"role": "assistant", "content": "```python\n#!/usr/bin/env python3\n# -*- coding: utf-8 -*-\n# Ground-truth 2D engineering drawing for part: 0098_00985005\n# Self-contained: reproduces the three-view DXF via ezdxf, NO FreeCAD needed.\n# Coordinates are A4 page millimetres (scale=0.03844, page=[297.0, 210.0]).\n# visible edges -> solid (layer OUTLINE); hidden edges -> dashed (layer HIDDEN)\n# dimensions -> real movable DIMENSION entities (text = true mm value)\n# Run: python 0098_00985005_gt.py [out.dxf]\nimport sys\nimport ezdxf\n\nSCALE = 0.03844\nPAGE = [297.0, 210.0]\n\nVISIBLE_SEGMENTS = [\n (92.293998, 172.049998, 92.293998, 168.205998),\n (92.293998, 168.205998, 88.449998, 168.205998),\n (88.449998, 168.205998, 88.449998, 172.049998),\n (88.449998, 172.049998, 92.293998, 172.049998),\n (88.652314, 168.408314, 88.652314, 171.847682),\n (92.091682, 168.408314, 88.652314, 168.408314),\n (92.091682, 171.847682, 92.091682, 168.408314),\n (88.652314, 171.847682, 92.091682, 171.847682),\n (92.293998, 61.949998, 92.293998, 154.205998),\n (92.293998, 154.205998, 88.449998, 154.205998),\n (88.449998, 61.949998, 88.449998, 154.205998),\n (92.293998, 61.949998, 88.449998, 61.949998),\n (106.293998, 168.205998, 198.549998, 168.205998),\n (198.549998, 168.205998, 198.549998, 172.049998),\n (106.293998, 172.049998, 198.549998, 172.049998),\n (106.293998, 168.205998, 106.293998, 172.049998)\n]\nVISIBLE_CIRCLES = [\n\n]\nVISIBLE_ARCS = [\n\n]\nHIDDEN_SEGMENTS = [\n\n]\n# (orient, text, p1, p2, base) for linear; (orient, text, center, radius, angle) for diameter\nDIMENSIONS = [\n ('horizontal', '100', (92.294, 172.05), (88.45, 172.05), (90.372, 161.05)),\n ('vertical', '100', (92.294, 168.206), (92.294, 172.05), (81.294, 170.128)),\n ('horizontal', '89.4737', (88.6523, 168.4083), (92.0917, 168.4083), (90.372, 179.4083)),\n ('vertical', '89.4737', (88.6523, 168.4083), (88.6523, 171.8477), (77.6523, 170.128)),\n ('vertical', '5.2632', (88.45, 168.4083), (88.6523, 168.4083), (88.5512, 179.4083)),\n ('vertical', '5.2632', (88.6523, 168.206), (88.6523, 168.4083), (77.6523, 168.3072)),\n ('horizontal', '2400', (106.294, 168.206), (198.55, 168.206), (152.422, 179.206))\n]\n\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\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\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,\n angle=(0 if d[0] == \"horizontal\" else 90),\n 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,\n text=text, dimstyle=\"EZDXF\").render()\n\n doc.saveas(out_path)\n\n\nif __name__ == \"__main__\":\n out = sys.argv[1] if len(sys.argv) > 1 else \"0098_00985005_gt.dxf\"\n draw(out)\n print(\"wrote\", out)\n```"}], "images": ["images/0098_00985005.png"], "id": "0098_00985005"} {"messages": [{"role": "user", "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 81.05 x 81.05 mm. It is extruded to a thickness of 960 mm."}, {"role": "assistant", "content": "```python\n#!/usr/bin/env python3\n# -*- coding: utf-8 -*-\n# Ground-truth 2D engineering drawing for part: 0099_00993816\n# Self-contained: reproduces the three-view DXF via ezdxf, NO FreeCAD needed.\n# Coordinates are A4 page millimetres (scale=0.04757425742574257, page=[297.0, 210.0]).\n# visible edges -> solid (layer OUTLINE); hidden edges -> dashed (layer HIDDEN)\n# dimensions -> real movable DIMENSION entities (text = true mm value)\n# Run: python 0099_00993816_gt.py [out.dxf]\nimport sys\nimport ezdxf\n\nSCALE = 0.04757425742574257\nPAGE = [297.0, 210.0]\n\nVISIBLE_SEGMENTS = [\n (93.207412, 167.292584, 93.207412, 172.05001),\n (88.449987, 167.292584, 93.207412, 167.292584),\n (93.207412, 172.05001, 88.449987, 172.05001),\n (88.449987, 172.05001, 88.449987, 167.292584),\n (88.90069, 171.599307, 88.90069, 167.743288),\n (92.756709, 171.599307, 88.90069, 171.599307),\n (92.756709, 167.743288, 92.756709, 171.599307),\n (88.90069, 167.743288, 92.756709, 167.743288),\n (93.207412, 61.95001, 93.207412, 153.292584),\n (88.449987, 61.95001, 88.449987, 153.292584),\n (88.449987, 61.95001, 93.207412, 61.95001),\n (88.449987, 153.292584, 93.207412, 153.292584),\n (107.207412, 167.292584, 198.549987, 167.292584),\n (198.549987, 172.05001, 107.207412, 172.05001),\n (107.207412, 172.05001, 107.207412, 167.292584),\n (198.549987, 172.05001, 198.549987, 167.292584)\n]\nVISIBLE_CIRCLES = [\n\n]\nVISIBLE_ARCS = [\n\n]\nHIDDEN_SEGMENTS = [\n\n]\n# (orient, text, p1, p2, base) for linear; (orient, text, center, radius, angle) for diameter\nDIMENSIONS = [\n ('horizontal', '100', (93.2074, 167.2926), (88.45, 167.2926), (90.8287, 156.2926)),\n ('vertical', '100', (93.2074, 172.05), (93.2074, 167.2926), (104.2074, 169.6713)),\n ('horizontal', '81.0526', (88.9007, 171.5993), (92.7567, 171.5993), (90.8287, 182.5993)),\n ('vertical', '81.0526', (88.9007, 171.5993), (88.9007, 167.7433), (99.9007, 169.6713)),\n ('vertical', '9.4737', (88.45, 171.5993), (88.9007, 171.5993), (88.6754, 182.5993)),\n ('vertical', '9.4737', (88.9007, 172.05), (88.9007, 171.5993), (99.9007, 171.8246)),\n ('horizontal', '1920', (198.55, 172.05), (107.2074, 172.05), (152.8787, 161.05))\n]\n\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\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\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,\n angle=(0 if d[0] == \"horizontal\" else 90),\n 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,\n text=text, dimstyle=\"EZDXF\").render()\n\n doc.saveas(out_path)\n\n\nif __name__ == \"__main__\":\n out = sys.argv[1] if len(sys.argv) > 1 else \"0099_00993816_gt.dxf\"\n draw(out)\n print(\"wrote\", out)\n```"}], "images": ["images/0099_00993816.png"], "id": "0099_00993816"} {"messages": [{"role": "user", "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 57.89 mm wide and 100 mm tall, featuring a rectangular cutout 20 x 13.68 mm. It is extruded to a thickness of 2.08 mm."}, {"role": "assistant", "content": "```python\n#!/usr/bin/env python3\n# -*- coding: utf-8 -*-\n# Ground-truth 2D engineering drawing for part: 0003_00035173\n# Self-contained: reproduces the three-view DXF via ezdxf, NO FreeCAD needed.\n# Coordinates are A4 page millimetres (scale=0.9413877551020439, page=[297.0, 210.0]).\n# visible edges -> solid (layer OUTLINE); hidden edges -> dashed (layer HIDDEN)\n# dimensions -> real movable DIMENSION entities (text = true mm value)\n# Run: python 0003_00035173_gt.py [out.dxf]\nimport sys\nimport ezdxf\n\nSCALE = 0.9413877551020439\nPAGE = [297.0, 210.0]\n\nVISIBLE_SEGMENTS = [\n (162.770087, 77.911205, 162.770087, 172.049981),\n (162.770087, 172.049981, 108.268691, 172.049981),\n (108.268691, 172.049981, 108.268691, 77.911205),\n (108.268691, 77.911205, 162.770087, 77.911205),\n (150.878873, 131.421667, 150.878873, 127.457929),\n (155.833546, 131.421667, 150.878873, 131.421667),\n (155.833546, 118.539519, 155.833546, 131.421667),\n (150.878873, 118.539519, 155.833546, 118.539519),\n (150.878873, 122.503257, 150.878873, 118.539519),\n (137.005791, 122.503257, 150.878873, 122.503257),\n (137.005791, 127.457929, 137.005791, 122.503257),\n (150.878873, 127.457929, 137.005791, 127.457929),\n (162.770087, 63.911205, 162.770087, 61.949981),\n (162.770087, 61.949981, 108.268691, 61.949981),\n (108.268691, 63.911205, 108.268691, 61.949981),\n (162.770087, 63.911205, 108.268691, 63.911205),\n (176.770087, 172.049981, 178.731312, 172.049981),\n (178.731312, 172.049981, 178.731312, 77.911205),\n (176.770087, 77.911205, 178.731312, 77.911205),\n (176.770087, 172.049981, 176.770087, 77.911205)\n]\nVISIBLE_CIRCLES = [\n\n]\nVISIBLE_ARCS = [\n\n]\nHIDDEN_SEGMENTS = [\n (150.8789, 63.9112, 150.8789, 61.95),\n (155.8335, 63.9112, 155.8335, 61.95),\n (137.0058, 63.9112, 137.0058, 61.95),\n (176.7701, 131.4217, 178.7313, 131.4217),\n (176.7701, 127.4579, 178.7313, 127.4579),\n (176.7701, 118.5395, 178.7313, 118.5395),\n (176.7701, 122.5033, 178.7313, 122.5033)\n]\n# (orient, text, p1, p2, base) for linear; (orient, text, center, radius, angle) for diameter\nDIMENSIONS = [\n ('vertical', '100', (162.7701, 172.05), (162.7701, 77.9112), (173.7701, 124.9806)),\n ('horizontal', '57.8947', (108.2687, 172.05), (162.7701, 172.05), (135.5194, 183.05)),\n ('vertical', '100', (108.2687, 77.9112), (108.2687, 172.05), (97.2687, 124.9806)),\n ('horizontal', '57.8947', (162.7701, 77.9112), (108.2687, 77.9112), (135.5194, 66.9112)),\n ('horizontal', '20', (137.0057, 118.5395), (155.8335, 118.5395), (146.4196, 129.5395)),\n ('vertical', '13.6842', (137.0057, 118.5395), (137.0057, 131.4217), (126.0057, 124.9806)),\n ('horizontal', '30.5263', (108.2687, 118.5395), (137.0057, 118.5395), (122.6372, 129.5395)),\n ('vertical', '43.1579', (137.0057, 77.9112), (137.0057, 118.5395), (126.0057, 98.2254)),\n ('horizontal', '2.0833', (176.7701, 77.9112), (178.7313, 77.9112), (177.7507, 88.9112))\n]\n\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\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\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,\n angle=(0 if d[0] == \"horizontal\" else 90),\n 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,\n text=text, dimstyle=\"EZDXF\").render()\n\n doc.saveas(out_path)\n\n\nif __name__ == \"__main__\":\n out = sys.argv[1] if len(sys.argv) > 1 else \"0003_00035173_gt.dxf\"\n draw(out)\n print(\"wrote\", out)\n```"}], "images": ["images/0003_00035173.png"], "id": "0003_00035173"} {"messages": [{"role": "user", "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 37.89 mm tall, featuring 3 circular holes, each of diameter 6.32 mm. It is extruded to a thickness of 5.21 mm."}, {"role": "assistant", "content": "```python\n#!/usr/bin/env python3\n# -*- coding: utf-8 -*-\n# Ground-truth 2D engineering drawing for part: 0003_00037995\n# Self-contained: reproduces the three-view DXF via ezdxf, NO FreeCAD needed.\n# Coordinates are A4 page millimetres (scale=1.3966574257425786, page=[297.0, 210.0]).\n# visible edges -> solid (layer OUTLINE); hidden edges -> dashed (layer HIDDEN)\n# dimensions -> real movable DIMENSION entities (text = true mm value)\n# Run: python 0003_00037995_gt.py [out.dxf]\nimport sys\nimport ezdxf\n\nSCALE = 1.3966574257425786\nPAGE = [297.0, 210.0]\n\nVISIBLE_SEGMENTS = [\n (202.695721, 154.100077, 202.695721, 101.174111),\n (202.695721, 154.100077, 63.029979, 154.100077),\n (63.029979, 101.174111, 63.029979, 154.100077),\n (63.029979, 101.174111, 202.695721, 101.174111),\n (202.695721, 87.174111, 202.695721, 79.899854),\n (202.695721, 79.899854, 63.029979, 79.899854),\n (63.029979, 87.174111, 63.029979, 79.899854),\n (202.695721, 87.174111, 63.029979, 87.174111),\n (216.695721, 154.100077, 223.969979, 154.100077),\n (223.969979, 101.174111, 223.969979, 154.100077),\n (216.695721, 101.174111, 223.969979, 101.174111),\n (216.695721, 154.100077, 216.695721, 101.174111)\n]\nVISIBLE_CIRCLES = [\n (71.850973, 127.637094, 4.410497),\n (107.13495, 127.637094, 4.410497),\n (193.874727, 127.637094, 4.410497)\n]\nVISIBLE_ARCS = [\n\n]\nHIDDEN_SEGMENTS = [\n (76.2615, 87.1741, 76.2615, 79.8999),\n (111.5455, 87.1741, 111.5455, 79.8999),\n (198.2852, 87.1741, 198.2852, 79.8999),\n (67.4405, 79.8999, 67.4405, 87.1741),\n (102.7245, 79.8999, 102.7245, 87.1741),\n (189.4643, 79.8999, 189.4643, 87.1741),\n (223.97, 132.0476, 216.6957, 132.0476),\n (223.97, 123.2266, 216.6957, 123.2266)\n]\n# (orient, text, p1, p2, base) for linear; (orient, text, center, radius, angle) for diameter\nDIMENSIONS = [\n ('vertical', '37.8947', (202.6957, 154.1001), (202.6957, 101.1741), (213.6957, 127.6371)),\n ('horizontal', '100', (63.03, 154.1001), (202.6957, 154.1001), (132.8629, 165.1001)),\n ('vertical', '37.8947', (63.03, 101.1741), (63.03, 154.1001), (52.03, 127.6371)),\n ('horizontal', '100', (202.6957, 101.1741), (63.03, 101.1741), (132.8629, 90.1741)),\n ('diameter', '%%c6.3158', (71.851, 127.6372), 4.4105, 45),\n ('horizontal', '6.3158', (63.03, 127.6372), (71.851, 127.6372), (67.4405, 138.6372)),\n ('vertical', '18.9474', (71.851, 101.1741), (71.851, 127.6372), (60.851, 114.4057)),\n ('diameter', '%%c6.3158', (107.1349, 127.6372), 4.4105, 45),\n ('horizontal', '31.5789', (63.03, 127.6372), (107.1349, 127.6372), (85.0825, 138.6372)),\n ('vertical', '18.9474', (107.1349, 101.1741), (107.1349, 127.6372), (96.1349, 114.4057)),\n ('diameter', '%%c6.3158', (193.8747, 127.6372), 4.4105, 45),\n ('horizontal', '93.6842', (63.03, 127.6372), (193.8747, 127.6372), (128.4524, 138.6372)),\n ('vertical', '18.9474', (193.8747, 101.1741), (193.8747, 127.6372), (182.8747, 114.4057)),\n ('horizontal', '5.2083', (216.6957, 101.1741), (223.97, 101.1741), (220.3328, 112.1741))\n]\n\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\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\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,\n angle=(0 if d[0] == \"horizontal\" else 90),\n 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,\n text=text, dimstyle=\"EZDXF\").render()\n\n doc.saveas(out_path)\n\n\nif __name__ == \"__main__\":\n out = sys.argv[1] if len(sys.argv) > 1 else \"0003_00037995_gt.dxf\"\n draw(out)\n print(\"wrote\", out)\n```"}], "images": ["images/0003_00037995.png"], "id": "0003_00037995"} {"messages": [{"role": "user", "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 45.26 mm bounding box. It is extruded to a thickness of 5.69 mm."}, {"role": "assistant", "content": "```python\n#!/usr/bin/env python3\n# -*- coding: utf-8 -*-\n# Ground-truth 2D engineering drawing for part: 0004_00041363\n# Self-contained: reproduces the three-view DXF via ezdxf, NO FreeCAD needed.\n# Coordinates are A4 page millimetres (scale=1.390278461538476, page=[297.0, 210.0]).\n# visible edges -> solid (layer OUTLINE); hidden edges -> dashed (layer HIDDEN)\n# dimensions -> real movable DIMENSION entities (text = true mm value)\n# Run: python 0004_00041363_gt.py [out.dxf]\nimport sys\nimport ezdxf\n\nSCALE = 1.390278461538476\nPAGE = [297.0, 210.0]\n\nVISIBLE_SEGMENTS = [\n (202.057873, 92.833308, 63.030027, 92.833308),\n (202.057873, 92.833308, 202.057873, 100.150563),\n (202.057873, 100.150563, 136.202578, 100.150563),\n (136.202578, 100.150563, 136.202578, 163.078957),\n (128.885322, 163.078957, 136.202578, 163.078957),\n (128.885322, 163.078957, 128.885322, 100.150563),\n (128.885322, 100.150563, 63.030027, 100.150563),\n (63.030027, 100.150563, 63.030027, 92.833308),\n (202.057873, 78.833308, 202.057873, 70.921154),\n (202.057873, 70.921154, 136.202578, 70.921154),\n (202.057873, 78.833308, 136.202578, 78.833308),\n (136.202578, 78.833308, 136.202578, 70.921154),\n (128.885322, 70.921154, 136.202578, 70.921154),\n (128.885322, 78.833308, 128.885322, 70.921154),\n (136.202578, 78.833308, 128.885322, 78.833308),\n (128.885322, 70.921154, 63.030027, 70.921154),\n (63.030027, 78.833308, 63.030027, 70.921154),\n (128.885322, 78.833308, 63.030027, 78.833308),\n (216.057873, 92.833308, 223.970027, 92.833308),\n (216.057873, 163.078957, 223.970027, 163.078957),\n (223.970027, 163.078957, 223.970027, 100.150563),\n (216.057873, 163.078957, 216.057873, 100.150563),\n (216.057873, 100.150563, 223.970027, 100.150563),\n (223.970027, 100.150563, 223.970027, 92.833308),\n (216.057873, 100.150563, 216.057873, 92.833308)\n]\nVISIBLE_CIRCLES = [\n\n]\nVISIBLE_ARCS = [\n\n]\nHIDDEN_SEGMENTS = [\n\n]\n# (orient, text, p1, p2, base) for linear; (orient, text, center, radius, angle) for diameter\nDIMENSIONS = [\n ('vertical', '5.2632', (202.0579, 100.1506), (202.0579, 92.8333), (213.0579, 96.4919)),\n ('horizontal', '47.3684', (136.2026, 100.1506), (202.0579, 100.1506), (169.1302, 111.1506)),\n ('vertical', '45.2632', (136.2026, 163.0789), (136.2026, 100.1506), (147.2026, 131.6147)),\n ('horizontal', '5.2632', (128.8853, 163.0789), (136.2026, 163.0789), (132.5439, 174.0789)),\n ('vertical', '45.2632', (128.8853, 100.1506), (128.8853, 163.0789), (117.8853, 131.6147)),\n ('horizontal', '47.3684', (63.03, 100.1506), (128.8853, 100.1506), (95.9576, 111.1506)),\n ('vertical', '5.2632', (63.03, 92.8333), (63.03, 100.1506), (52.03, 96.4919)),\n ('horizontal', '100', (202.0579, 92.8333), (63.03, 92.8333), (132.5439, 81.8333)),\n ('horizontal', '5.6911', (216.0578, 92.8333), (223.9701, 92.8333), (220.014, 103.8333))\n]\n\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\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\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,\n angle=(0 if d[0] == \"horizontal\" else 90),\n 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,\n text=text, dimstyle=\"EZDXF\").render()\n\n doc.saveas(out_path)\n\n\nif __name__ == \"__main__\":\n out = sys.argv[1] if len(sys.argv) > 1 else \"0004_00041363_gt.dxf\"\n draw(out)\n print(\"wrote\", out)\n```"}], "images": ["images/0004_00041363.png"], "id": "0004_00041363"} {"messages": [{"role": "user", "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 25.26 x 100 mm bounding box. It is extruded to a thickness of 25 mm."}, {"role": "assistant", "content": "```python\n#!/usr/bin/env python3\n# -*- coding: utf-8 -*-\n# Ground-truth 2D engineering drawing for part: 0004_00045638\n# Self-contained: reproduces the three-view DXF via ezdxf, NO FreeCAD needed.\n# Coordinates are A4 page millimetres (scale=0.7688, page=[297.0, 210.0]).\n# visible edges -> solid (layer OUTLINE); hidden edges -> dashed (layer HIDDEN)\n# dimensions -> real movable DIMENSION entities (text = true mm value)\n# Run: python 0004_00045638_gt.py [out.dxf]\nimport sys\nimport ezdxf\n\nSCALE = 0.7688\nPAGE = [297.0, 210.0]\n\nVISIBLE_SEGMENTS = [\n (136.601166, 95.169992, 136.601166, 172.049992),\n (136.601166, 172.049992, 130.936324, 172.049992),\n (130.936324, 172.049992, 130.936324, 146.962834),\n (130.936324, 146.962834, 122.843693, 146.962834),\n (122.843693, 146.962834, 122.843693, 172.049992),\n (122.843693, 172.049992, 117.178851, 172.049992),\n (117.178851, 172.049992, 117.178851, 95.169992),\n (117.178851, 95.169992, 136.601166, 95.169992),\n (136.601166, 81.169992, 136.601166, 61.949992),\n (136.601166, 61.949992, 130.936324, 61.949992),\n (130.936324, 81.169992, 130.936324, 61.949992),\n (136.601166, 81.169992, 130.936324, 81.169992),\n (130.936324, 61.949992, 122.843693, 61.949992),\n (130.936324, 81.169992, 122.843693, 81.169992),\n (122.843693, 81.169992, 122.843693, 61.949992),\n (122.843693, 61.949992, 117.178851, 61.949992),\n (117.178851, 81.169992, 117.178851, 61.949992),\n (122.843693, 81.169992, 117.178851, 81.169992),\n (150.601166, 172.049992, 169.821166, 172.049992),\n (169.821166, 172.049992, 169.821166, 95.169992),\n (150.601166, 95.169992, 169.821166, 95.169992),\n (150.601166, 172.049992, 150.601166, 95.169992)\n]\nVISIBLE_CIRCLES = [\n\n]\nVISIBLE_ARCS = [\n\n]\nHIDDEN_SEGMENTS = [\n (150.6012, 146.9628, 169.8212, 146.9628)\n]\n# (orient, text, p1, p2, base) for linear; (orient, text, center, radius, angle) for diameter\nDIMENSIONS = [\n ('vertical', '100', (136.6012, 172.05), (136.6012, 95.17), (147.6012, 133.61)),\n ('horizontal', '7.3684', (130.9363, 172.05), (136.6012, 172.05), (133.7687, 183.05)),\n ('vertical', '32.6316', (130.9363, 146.9628), (130.9363, 172.05), (119.9363, 159.5064)),\n ('horizontal', '10.5263', (122.8437, 146.9628), (130.9363, 146.9628), (126.89, 157.9628)),\n ('vertical', '32.6316', (122.8437, 172.05), (122.8437, 146.9628), (133.8437, 159.5064)),\n ('horizontal', '7.3684', (117.1788, 172.05), (122.8437, 172.05), (120.0113, 183.05)),\n ('vertical', '100', (117.1788, 95.17), (117.1788, 172.05), (106.1788, 133.61)),\n ('horizontal', '25.2632', (136.6012, 95.17), (117.1788, 95.17), (126.89, 84.17)),\n ('horizontal', '25', (150.6012, 95.17), (169.8212, 95.17), (160.2112, 106.17))\n]\n\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\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\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,\n angle=(0 if d[0] == \"horizontal\" else 90),\n 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,\n text=text, dimstyle=\"EZDXF\").render()\n\n doc.saveas(out_path)\n\n\nif __name__ == \"__main__\":\n out = sys.argv[1] if len(sys.argv) > 1 else \"0004_00045638_gt.dxf\"\n draw(out)\n print(\"wrote\", out)\n```"}], "images": ["images/0004_00045638.png"], "id": "0004_00045638"} {"messages": [{"role": "user", "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, featuring a rectangular cutout 97.89 x 60 mm. It is extruded to a thickness of 19.79 mm."}, {"role": "assistant", "content": "```python\n#!/usr/bin/env python3\n# -*- coding: utf-8 -*-\n# Ground-truth 2D engineering drawing for part: 0005_00056579\n# Self-contained: reproduces the three-view DXF via ezdxf, NO FreeCAD needed.\n# Coordinates are A4 page millimetres (scale=0.9064480519480502, page=[297.0, 210.0]).\n# visible edges -> solid (layer OUTLINE); hidden edges -> dashed (layer HIDDEN)\n# dimensions -> real movable DIMENSION entities (text = true mm value)\n# Run: python 0005_00056579_gt.py [out.dxf]\nimport sys\nimport ezdxf\n\nSCALE = 0.9064480519480502\nPAGE = [297.0, 210.0]\n\nVISIBLE_SEGMENTS = [\n (172.852327, 161.11766, 172.852327, 104.822465),\n (172.852327, 104.822465, 82.207522, 104.822465),\n (82.207522, 104.822465, 82.207522, 161.11766),\n (82.207522, 161.11766, 172.852327, 161.11766),\n (83.161678, 105.776621, 171.898172, 105.776621),\n (171.898172, 160.163504, 171.898172, 105.776621),\n (83.161678, 160.163504, 171.898172, 160.163504),\n (83.161678, 105.776621, 83.161678, 160.163504),\n (172.852327, 72.882348, 172.852327, 90.822465),\n (82.207522, 72.882348, 82.207522, 90.822465),\n (82.207522, 90.822465, 172.852327, 90.822465),\n (82.207522, 72.882348, 172.852327, 72.882348),\n (204.792445, 104.822465, 186.852327, 104.822465),\n (186.852327, 104.822465, 186.852327, 161.11766),\n (204.792445, 161.11766, 186.852327, 161.11766),\n (204.792445, 104.822465, 204.792445, 161.11766)\n]\nVISIBLE_CIRCLES = [\n\n]\nVISIBLE_ARCS = [\n\n]\nHIDDEN_SEGMENTS = [\n (83.1617, 72.8823, 83.1617, 90.8225),\n (171.8982, 72.8823, 171.8982, 90.8225),\n (204.7925, 105.7766, 186.8523, 105.7766),\n (204.7925, 160.1635, 186.8523, 160.1635)\n]\n# (orient, text, p1, p2, base) for linear; (orient, text, center, radius, angle) for diameter\nDIMENSIONS = [\n ('vertical', '62.1053', (172.8523, 104.8224), (172.8523, 161.1177), (161.8523, 132.97)),\n ('horizontal', '100', (82.2075, 104.8224), (172.8523, 104.8224), (127.5299, 115.8224)),\n ('vertical', '62.1053', (82.2075, 161.1177), (82.2075, 104.8224), (93.2075, 132.97)),\n ('horizontal', '100', (172.8523, 161.1177), (82.2075, 161.1177), (127.5299, 150.1177)),\n ('horizontal', '97.8947', (83.1617, 160.1635), (171.8982, 160.1635), (127.5299, 171.1635)),\n ('vertical', '60', (83.1617, 160.1635), (83.1617, 105.7766), (94.1617, 132.9701)),\n ('horizontal', '1.0526', (82.2075, 160.1635), (83.1617, 160.1635), (82.6846, 171.1635)),\n ('vertical', '1.0526', (83.1617, 161.1177), (83.1617, 160.1635), (94.1617, 160.6406)),\n ('horizontal', '19.7917', (204.7925, 161.1177), (186.8523, 161.1177), (195.8224, 150.1177))\n]\n\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\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\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,\n angle=(0 if d[0] == \"horizontal\" else 90),\n 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,\n text=text, dimstyle=\"EZDXF\").render()\n\n doc.saveas(out_path)\n\n\nif __name__ == \"__main__\":\n out = sys.argv[1] if len(sys.argv) > 1 else \"0005_00056579_gt.dxf\"\n draw(out)\n print(\"wrote\", out)\n```"}], "images": ["images/0005_00056579.png"], "id": "0005_00056579"} {"messages": [{"role": "user", "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 37.89 mm bounding box. It is extruded to a thickness of 24.84 mm."}, {"role": "assistant", "content": "```python\n#!/usr/bin/env python3\n# -*- coding: utf-8 -*-\n# Ground-truth 2D engineering drawing for part: 0007_00072938\n# Self-contained: reproduces the three-view DXF via ezdxf, NO FreeCAD needed.\n# Coordinates are A4 page millimetres (scale=0.6969083969465814, page=[297.0, 210.0]).\n# visible edges -> solid (layer OUTLINE); hidden edges -> dashed (layer HIDDEN)\n# dimensions -> real movable DIMENSION entities (text = true mm value)\n# Run: python 0007_00072938_gt.py [out.dxf]\nimport sys\nimport ezdxf\n\nSCALE = 0.6969083969465814\nPAGE = [297.0, 210.0]\n\nVISIBLE_SEGMENTS = [\n (162.689563, 119.451303, 162.689563, 123.85283),\n (162.689563, 123.85283, 110.604831, 123.85283),\n (110.604831, 123.85283, 110.604831, 145.860464),\n (110.604831, 145.860464, 92.998724, 145.860464),\n (92.998724, 145.860464, 92.998724, 119.451303),\n (92.998724, 119.451303, 162.689563, 119.451303),\n (162.689563, 105.451303, 162.689563, 88.139566),\n (162.689563, 88.139566, 110.604831, 88.139566),\n (162.689563, 105.451303, 110.604831, 105.451303),\n (110.604831, 105.451303, 110.604831, 88.139566),\n (110.604831, 88.139566, 92.998724, 88.139566),\n (92.998724, 105.451303, 92.998724, 88.139566),\n (110.604831, 105.451303, 92.998724, 105.451303),\n (176.689563, 145.860464, 194.001301, 145.860464),\n (194.001301, 145.860464, 194.001301, 119.451303),\n (176.689563, 119.451303, 194.001301, 119.451303),\n (176.689563, 145.860464, 176.689563, 119.451303)\n]\nVISIBLE_CIRCLES = [\n\n]\nVISIBLE_ARCS = [\n\n]\nHIDDEN_SEGMENTS = [\n (176.6896, 123.8528, 194.0013, 123.8528)\n]\n# (orient, text, p1, p2, base) for linear; (orient, text, center, radius, angle) for diameter\nDIMENSIONS = [\n ('vertical', '6.3158', (162.6896, 123.8528), (162.6896, 119.4513), (173.6896, 121.652)),\n ('horizontal', '74.7368', (110.6048, 123.8528), (162.6896, 123.8528), (136.6472, 134.8528)),\n ('vertical', '31.5789', (110.6048, 145.8605), (110.6048, 123.8528), (121.6048, 134.8566)),\n ('horizontal', '25.2632', (92.9987, 145.8605), (110.6048, 145.8605), (101.8018, 156.8605)),\n ('vertical', '37.8947', (92.9987, 119.4513), (92.9987, 145.8605), (81.9987, 132.6559)),\n ('horizontal', '100', (162.6896, 119.4513), (92.9987, 119.4513), (127.8441, 108.4513)),\n ('horizontal', '24.8408', (176.6896, 119.4513), (194.0013, 119.4513), (185.3454, 130.4513))\n]\n\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\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\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,\n angle=(0 if d[0] == \"horizontal\" else 90),\n 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,\n text=text, dimstyle=\"EZDXF\").render()\n\n doc.saveas(out_path)\n\n\nif __name__ == \"__main__\":\n out = sys.argv[1] if len(sys.argv) > 1 else \"0007_00072938_gt.dxf\"\n draw(out)\n print(\"wrote\", out)\n```"}], "images": ["images/0007_00072938.png"], "id": "0007_00072938"} {"messages": [{"role": "user", "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 100 x 48.57 mm bounding box, featuring a rectangular cutout 10 x 40 mm. It is extruded to a thickness of 4.24 mm."}, {"role": "assistant", "content": "```python\n#!/usr/bin/env python3\n# -*- coding: utf-8 -*-\n# Ground-truth 2D engineering drawing for part: 0009_00097526\n# Self-contained: reproduces the three-view DXF via ezdxf, NO FreeCAD needed.\n# Coordinates are A4 page millimetres (scale=0.686647527910716, page=[297.0, 210.0]).\n# visible edges -> solid (layer OUTLINE); hidden edges -> dashed (layer HIDDEN)\n# dimensions -> real movable DIMENSION entities (text = true mm value)\n# Run: python 0009_00097526_gt.py [out.dxf]\nimport sys\nimport ezdxf\n\nSCALE = 0.686647527910716\nPAGE = [297.0, 210.0]\n\nVISIBLE_SEGMENTS = [\n (169.376332, 78.862116, 169.376332, 112.213568),\n (169.376332, 112.213568, 166.433557, 112.213568),\n (166.433557, 112.213568, 166.433557, 138.698544),\n (166.433557, 138.698544, 169.376332, 138.698544),\n (169.376332, 138.698544, 169.376332, 172.049995),\n (169.376332, 172.049995, 100.711579, 172.049995),\n (100.711579, 172.049995, 100.711579, 138.698544),\n (100.711579, 138.698544, 104.63528, 138.698544),\n (104.63528, 138.698544, 104.63528, 112.213568),\n (104.63528, 112.213568, 100.711579, 112.213568),\n (100.711579, 112.213568, 100.711579, 78.862116),\n (100.711579, 78.862116, 169.376332, 78.862116),\n (156.624307, 108.289867, 156.624307, 80.823966),\n (163.490782, 108.289867, 156.624307, 108.289867),\n (163.490782, 80.823966, 163.490782, 108.289867),\n (156.624307, 80.823966, 163.490782, 80.823966),\n (169.376332, 64.862116, 169.376332, 61.949995),\n (169.376332, 61.949995, 100.711579, 61.949995),\n (100.711579, 64.862116, 100.711579, 61.949995),\n (169.376332, 64.862116, 100.711579, 64.862116),\n (183.376332, 172.049995, 186.288453, 172.049995),\n (186.288453, 172.049995, 186.288453, 138.698544),\n (183.376332, 138.698544, 186.288453, 138.698544),\n (183.376332, 172.049995, 183.376332, 138.698544),\n (186.288453, 138.698544, 186.288453, 112.213568),\n (183.376332, 138.698544, 183.376332, 112.213568),\n (183.376332, 112.213568, 186.288453, 112.213568),\n (186.288453, 112.213568, 186.288453, 78.862116),\n (183.376332, 78.862116, 186.288453, 78.862116),\n (183.376332, 112.213568, 183.376332, 78.862116)\n]\nVISIBLE_CIRCLES = [\n\n]\nVISIBLE_ARCS = [\n\n]\nHIDDEN_SEGMENTS = [\n (166.4335, 64.8621, 166.4335, 61.95),\n (104.6353, 64.8621, 104.6353, 61.95),\n (156.6243, 64.8621, 156.6243, 61.95),\n (163.4908, 64.8621, 163.4908, 61.95),\n (183.3763, 108.2899, 186.2884, 108.2899),\n (183.3763, 80.824, 186.2884, 80.824)\n]\n# (orient, text, p1, p2, base) for linear; (orient, text, center, radius, angle) for diameter\nDIMENSIONS = [\n ('vertical', '48.5714', (169.3763, 112.2136), (169.3763, 78.8621), (180.3763, 95.5379)),\n ('horizontal', '4.2857', (166.4336, 112.2136), (169.3763, 112.2136), (167.905, 123.2136)),\n ('vertical', '38.5714', (166.4336, 138.6985), (166.4336, 112.2136), (177.4336, 125.456)),\n ('horizontal', '4.2857', (169.3763, 138.6985), (166.4336, 138.6985), (167.905, 127.6985)),\n ('vertical', '48.5714', (169.3763, 172.05), (169.3763, 138.6985), (180.3763, 155.3743)),\n ('horizontal', '100', (100.7116, 172.05), (169.3763, 172.05), (135.044, 183.05)),\n ('vertical', '48.5714', (100.7116, 138.6985), (100.7116, 172.05), (89.7116, 155.3743)),\n ('horizontal', '5.7143', (104.6353, 138.6985), (100.7116, 138.6985), (102.6734, 127.6985)),\n ('vertical', '38.5714', (104.6353, 112.2136), (104.6353, 138.6985), (93.6353, 125.456)),\n ('horizontal', '5.7143', (100.7116, 112.2136), (104.6353, 112.2136), (102.6734, 123.2136)),\n ('vertical', '48.5714', (100.7116, 78.8621), (100.7116, 112.2136), (89.7116, 95.5379)),\n ('horizontal', '100', (169.3763, 78.8621), (100.7116, 78.8621), (135.044, 67.8621)),\n ('horizontal', '10', (156.6243, 80.824), (163.4907, 80.824), (160.0575, 91.824)),\n ('vertical', '40', (156.6243, 80.824), (156.6243, 108.2899), (145.6243, 94.5569)),\n ('horizontal', '81.4286', (100.7116, 80.824), (156.6243, 80.824), (128.6679, 91.824)),\n ('vertical', '2.8571', (156.6243, 78.8621), (156.6243, 80.824), (145.6243, 79.843)),\n ('horizontal', '4.2411', (183.3763, 78.8621), (186.2885, 78.8621), (184.8324, 89.8621))\n]\n\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\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\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,\n angle=(0 if d[0] == \"horizontal\" else 90),\n 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,\n text=text, dimstyle=\"EZDXF\").render()\n\n doc.saveas(out_path)\n\n\nif __name__ == \"__main__\":\n out = sys.argv[1] if len(sys.argv) > 1 else \"0009_00097526_gt.dxf\"\n draw(out)\n print(\"wrote\", out)\n```"}], "images": ["images/0009_00097526.png"], "id": "0009_00097526"} {"messages": [{"role": "user", "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 -66.67 mm."}, {"role": "assistant", "content": "```python\n#!/usr/bin/env python3\n# -*- coding: utf-8 -*-\n# Ground-truth 2D engineering drawing for part: 0010_00101539\n# Self-contained: reproduces the three-view DXF via ezdxf, NO FreeCAD needed.\n# Coordinates are A4 page millimetres (scale=0.7226517150395771, page=[297.0, 210.0]).\n# visible edges -> solid (layer OUTLINE); hidden edges -> dashed (layer HIDDEN)\n# dimensions -> real movable DIMENSION entities (text = true mm value)\n# Run: python 0010_00101539_gt.py [out.dxf]\nimport sys\nimport ezdxf\n\nSCALE = 0.7226517150395771\nPAGE = [297.0, 210.0]\n\nVISIBLE_SEGMENTS = [\n (148.544194, 172.050018, 148.544194, 147.708065),\n (148.544194, 147.708065, 88.449999, 147.708065),\n (88.449999, 147.708065, 88.449999, 124.126799),\n (88.449999, 124.126799, 76.279023, 124.126799),\n (76.279023, 124.126799, 76.279023, 172.050018),\n (76.279023, 172.050018, 148.544194, 172.050018),\n (148.544194, 110.126799, 148.544194, 61.950018),\n (76.279023, 110.126799, 76.279023, 61.950018),\n (76.279023, 61.950018, 148.544194, 61.950018),\n (76.279023, 110.126799, 148.544194, 110.126799),\n (162.544194, 124.126799, 210.720975, 124.126799),\n (210.720975, 124.126799, 210.720975, 172.050018),\n (162.544194, 172.050018, 210.720975, 172.050018),\n (162.544194, 124.126799, 162.544194, 172.050018)\n]\nVISIBLE_CIRCLES = [\n\n]\nVISIBLE_ARCS = [\n\n]\nHIDDEN_SEGMENTS = [\n (88.45, 110.1268, 88.45, 61.95),\n (162.5442, 147.708, 210.721, 147.708)\n]\n# (orient, text, p1, p2, base) for linear; (orient, text, center, radius, angle) for diameter\nDIMENSIONS = [\n ('vertical', '33.6842', (148.5442, 147.7081), (148.5442, 172.05), (137.5442, 159.879)),\n ('horizontal', '83.1579', (88.45, 147.7081), (148.5442, 147.7081), (118.4971, 158.7081)),\n ('vertical', '32.6316', (88.45, 124.1268), (88.45, 147.7081), (77.45, 135.9174)),\n ('horizontal', '16.8421', (76.279, 124.1268), (88.45, 124.1268), (82.3645, 135.1268)),\n ('vertical', '66.3158', (76.279, 172.05), (76.279, 124.1268), (87.279, 148.0884)),\n ('horizontal', '100', (148.5442, 172.05), (76.279, 172.05), (112.4116, 161.05)),\n ('horizontal', '66.6667', (162.5442, 172.05), (210.721, 172.05), (186.6326, 183.05))\n]\n\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\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\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,\n angle=(0 if d[0] == \"horizontal\" else 90),\n 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,\n text=text, dimstyle=\"EZDXF\").render()\n\n doc.saveas(out_path)\n\n\nif __name__ == \"__main__\":\n out = sys.argv[1] if len(sys.argv) > 1 else \"0010_00101539_gt.dxf\"\n draw(out)\n print(\"wrote\", out)\n```"}], "images": ["images/0010_00101539.png"], "id": "0010_00101539"} {"messages": [{"role": "user", "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 97.89 x 100 mm bounding box. It is extruded to a thickness of 59.18 mm."}, {"role": "assistant", "content": "```python\n#!/usr/bin/env python3\n# -*- coding: utf-8 -*-\n# Ground-truth 2D engineering drawing for part: 0011_00118516\n# Self-contained: reproduces the three-view DXF via ezdxf, NO FreeCAD needed.\n# Coordinates are A4 page millimetres (scale=0.6037051282051878, page=[297.0, 210.0]).\n# visible edges -> solid (layer OUTLINE); hidden edges -> dashed (layer HIDDEN)\n# dimensions -> real movable DIMENSION entities (text = true mm value)\n# Run: python 0011_00118516_gt.py [out.dxf]\nimport sys\nimport ezdxf\n\nSCALE = 0.6037051282051878\nPAGE = [297.0, 210.0]\n\nVISIBLE_SEGMENTS = [\n (94.8048, 172.049989, 94.8048, 116.763309),\n (94.8048, 116.763309, 142.465731, 116.763309),\n (142.465731, 116.763309, 142.465731, 167.601636),\n (142.465731, 167.601636, 148.185043, 167.601636),\n (148.185043, 167.601636, 148.185043, 111.679476),\n (148.185043, 111.679476, 89.085488, 111.679476),\n (89.085488, 111.679476, 89.085488, 172.049989),\n (89.085488, 172.049989, 94.8048, 172.049989),\n (94.8048, 61.949989, 94.8048, 97.679476),\n (94.8048, 97.679476, 142.465731, 97.679476),\n (94.8048, 61.949989, 142.465731, 61.949989),\n (142.465731, 61.949989, 142.465731, 97.679476),\n (142.465731, 97.679476, 148.185043, 97.679476),\n (148.185043, 61.949989, 148.185043, 97.679476),\n (142.465731, 61.949989, 148.185043, 61.949989),\n (89.085488, 61.949989, 89.085488, 97.679476),\n (89.085488, 97.679476, 94.8048, 97.679476),\n (89.085488, 61.949989, 94.8048, 61.949989),\n (197.91453, 111.679476, 162.185043, 111.679476),\n (162.185043, 111.679476, 162.185043, 172.049989),\n (197.91453, 172.049989, 162.185043, 172.049989),\n (197.91453, 111.679476, 197.91453, 172.049989)\n]\nVISIBLE_CIRCLES = [\n\n]\nVISIBLE_ARCS = [\n\n]\nHIDDEN_SEGMENTS = [\n (197.9145, 116.7633, 162.185, 116.7633),\n (197.9145, 167.6016, 162.185, 167.6016)\n]\n# (orient, text, p1, p2, base) for linear; (orient, text, center, radius, angle) for diameter\nDIMENSIONS = [\n ('vertical', '91.5789', (94.8048, 116.7633), (94.8048, 172.05), (83.8048, 144.4067)),\n ('horizontal', '78.9474', (142.4657, 116.7633), (94.8048, 116.7633), (118.6353, 105.7633)),\n ('vertical', '84.2105', (142.4657, 167.6016), (142.4657, 116.7633), (153.4657, 142.1825)),\n ('horizontal', '9.4737', (148.1851, 167.6016), (142.4657, 167.6016), (145.3254, 156.6016)),\n ('vertical', '92.6316', (148.1851, 111.6795), (148.1851, 167.6016), (137.1851, 139.6406)),\n ('horizontal', '97.8947', (89.0855, 111.6795), (148.1851, 111.6795), (118.6353, 122.6795)),\n ('vertical', '100', (89.0855, 172.05), (89.0855, 111.6795), (100.0855, 141.8647)),\n ('horizontal', '9.4737', (94.8048, 172.05), (89.0855, 172.05), (91.9451, 161.05)),\n ('horizontal', '59.1837', (197.9145, 172.05), (162.185, 172.05), (180.0498, 161.05))\n]\n\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\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\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,\n angle=(0 if d[0] == \"horizontal\" else 90),\n 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,\n text=text, dimstyle=\"EZDXF\").render()\n\n doc.saveas(out_path)\n\n\nif __name__ == \"__main__\":\n out = sys.argv[1] if len(sys.argv) > 1 else \"0011_00118516_gt.dxf\"\n draw(out)\n print(\"wrote\", out)\n```"}], "images": ["images/0011_00118516.png"], "id": "0011_00118516"} {"messages": [{"role": "user", "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 29.17 mm."}, {"role": "assistant", "content": "```python\n#!/usr/bin/env python3\n# -*- coding: utf-8 -*-\n# Ground-truth 2D engineering drawing for part: 0015_00157065\n# Self-contained: reproduces the three-view DXF via ezdxf, NO FreeCAD needed.\n# Coordinates are A4 page millimetres (scale=0.743999999999998, page=[297.0, 210.0]).\n# visible edges -> solid (layer OUTLINE); hidden edges -> dashed (layer HIDDEN)\n# dimensions -> real movable DIMENSION entities (text = true mm value)\n# Run: python 0015_00157065_gt.py [out.dxf]\nimport sys\nimport ezdxf\n\nSCALE = 0.743999999999998\nPAGE = [297.0, 210.0]\n\nVISIBLE_SEGMENTS = [\n (162.849997, 172.050003, 162.849997, 97.650003),\n (162.849997, 172.050003, 144.054208, 172.050003),\n (144.054208, 172.050003, 144.054208, 116.445792),\n (144.054208, 116.445792, 88.449997, 116.445792),\n (88.449997, 116.445792, 88.449997, 97.650003),\n (88.449997, 97.650003, 162.849997, 97.650003),\n (162.849997, 83.650003, 162.849997, 61.950003),\n (162.849997, 61.950003, 144.054208, 61.950003),\n (144.054208, 83.650003, 144.054208, 61.950003),\n (162.849997, 83.650003, 144.054208, 83.650003),\n (144.054208, 61.950003, 88.449997, 61.950003),\n (88.449997, 83.650003, 88.449997, 61.950003),\n (144.054208, 83.650003, 88.449997, 83.650003),\n (176.849997, 172.050003, 198.549997, 172.050003),\n (198.549997, 172.050003, 198.549997, 116.445792),\n (176.849997, 172.050003, 176.849997, 116.445792),\n (176.849997, 116.445792, 198.549997, 116.445792),\n (198.549997, 116.445792, 198.549997, 97.650003),\n (176.849997, 97.650003, 198.549997, 97.650003),\n (176.849997, 116.445792, 176.849997, 97.650003)\n]\nVISIBLE_CIRCLES = [\n\n]\nVISIBLE_ARCS = [\n\n]\nHIDDEN_SEGMENTS = [\n\n]\n# (orient, text, p1, p2, base) for linear; (orient, text, center, radius, angle) for diameter\nDIMENSIONS = [\n ('vertical', '100', (162.85, 172.05), (162.85, 97.65), (173.85, 134.85)),\n ('horizontal', '25.2632', (144.0542, 172.05), (162.85, 172.05), (153.4521, 183.05)),\n ('vertical', '74.7368', (144.0542, 116.4458), (144.0542, 172.05), (133.0542, 144.2479)),\n ('horizontal', '74.7368', (88.45, 116.4458), (144.0542, 116.4458), (116.2521, 127.4458)),\n ('vertical', '25.2632', (88.45, 97.65), (88.45, 116.4458), (77.45, 107.0479)),\n ('horizontal', '100', (162.85, 97.65), (88.45, 97.65), (125.65, 86.65)),\n ('horizontal', '29.1667', (176.85, 97.65), (198.55, 97.65), (187.7, 108.65))\n]\n\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\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\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,\n angle=(0 if d[0] == \"horizontal\" else 90),\n 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,\n text=text, dimstyle=\"EZDXF\").render()\n\n doc.saveas(out_path)\n\n\nif __name__ == \"__main__\":\n out = sys.argv[1] if len(sys.argv) > 1 else \"0015_00157065_gt.dxf\"\n draw(out)\n print(\"wrote\", out)\n```"}], "images": ["images/0015_00157065.png"], "id": "0015_00157065"} {"messages": [{"role": "user", "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 93.68 x 93.68 mm. It is extruded to a thickness of 3.12 mm."}, {"role": "assistant", "content": "```python\n#!/usr/bin/env python3\n# -*- coding: utf-8 -*-\n# Ground-truth 2D engineering drawing for part: 0016_00164308\n# Self-contained: reproduces the three-view DXF via ezdxf, NO FreeCAD needed.\n# Coordinates are A4 page millimetres (scale=0.9318787878787879, page=[297.0, 210.0]).\n# visible edges -> solid (layer OUTLINE); hidden edges -> dashed (layer HIDDEN)\n# dimensions -> real movable DIMENSION entities (text = true mm value)\n# Run: python 0016_00164308_gt.py [out.dxf]\nimport sys\nimport ezdxf\n\nSCALE = 0.9318787878787879\nPAGE = [297.0, 210.0]\n\nVISIBLE_SEGMENTS = [\n (181.637891, 78.86211, 181.637891, 172.049989),\n (88.450012, 172.049989, 181.637891, 172.049989),\n (88.450012, 78.86211, 88.450012, 172.049989),\n (88.450012, 78.86211, 181.637891, 78.86211),\n (91.392787, 169.107214, 91.392787, 81.804885),\n (178.695116, 169.107214, 91.392787, 169.107214),\n (178.695116, 81.804885, 178.695116, 169.107214),\n (91.392787, 81.804885, 178.695116, 81.804885),\n (181.637891, 64.86211, 181.637891, 61.949989),\n (88.450012, 61.949989, 181.637891, 61.949989),\n (88.450012, 64.86211, 88.450012, 61.949989),\n (181.637891, 64.86211, 88.450012, 64.86211),\n (195.637891, 172.049989, 198.550012, 172.049989),\n (198.550012, 78.86211, 198.550012, 172.049989),\n (195.637891, 78.86211, 198.550012, 78.86211),\n (195.637891, 172.049989, 195.637891, 78.86211)\n]\nVISIBLE_CIRCLES = [\n\n]\nVISIBLE_ARCS = [\n\n]\nHIDDEN_SEGMENTS = [\n (91.3928, 64.8621, 91.3928, 61.95),\n (178.6951, 64.8621, 178.6951, 61.95),\n (195.6379, 169.1072, 198.55, 169.1072),\n (195.6379, 81.8049, 198.55, 81.8049)\n]\n# (orient, text, p1, p2, base) for linear; (orient, text, center, radius, angle) for diameter\nDIMENSIONS = [\n ('vertical', '100', (181.6379, 172.05), (181.6379, 78.8621), (192.6379, 125.4561)),\n ('horizontal', '100', (88.45, 172.05), (181.6379, 172.05), (135.0439, 183.05)),\n ('vertical', '100', (88.45, 78.8621), (88.45, 172.05), (77.45, 125.4561)),\n ('horizontal', '100', (181.6379, 78.8621), (88.45, 78.8621), (135.0439, 67.8621)),\n ('horizontal', '93.6842', (91.3928, 81.8049), (178.6951, 81.8049), (135.0439, 92.8049)),\n ('vertical', '93.6842', (91.3928, 81.8049), (91.3928, 169.1072), (80.3928, 125.4561)),\n ('horizontal', '3.1579', (88.45, 81.8049), (91.3928, 81.8049), (89.9214, 92.8049)),\n ('vertical', '3.1579', (91.3928, 78.8621), (91.3928, 81.8049), (80.3928, 80.3335)),\n ('horizontal', '3.125', (195.6379, 78.8621), (198.55, 78.8621), (197.0939, 89.8621))\n]\n\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\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\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,\n angle=(0 if d[0] == \"horizontal\" else 90),\n 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,\n text=text, dimstyle=\"EZDXF\").render()\n\n doc.saveas(out_path)\n\n\nif __name__ == \"__main__\":\n out = sys.argv[1] if len(sys.argv) > 1 else \"0016_00164308_gt.dxf\"\n draw(out)\n print(\"wrote\", out)\n```"}], "images": ["images/0016_00164308.png"], "id": "0016_00164308"} {"messages": [{"role": "user", "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 100 x 22.11 mm bounding box. It is extruded to a thickness of 1.56 mm."}, {"role": "assistant", "content": "```python\n#!/usr/bin/env python3\n# -*- coding: utf-8 -*-\n# Ground-truth 2D engineering drawing for part: 0019_00190615\n# Self-contained: reproduces the three-view DXF via ezdxf, NO FreeCAD needed.\n# Coordinates are A4 page millimetres (scale=1.2033879310344802, page=[297.0, 210.0]).\n# visible edges -> solid (layer OUTLINE); hidden edges -> dashed (layer HIDDEN)\n# dimensions -> real movable DIMENSION entities (text = true mm value)\n# Run: python 0019_00190615_gt.py [out.dxf]\nimport sys\nimport ezdxf\n\nSCALE = 1.2033879310344802\nPAGE = [297.0, 210.0]\n\nVISIBLE_SEGMENTS = [\n (79.19062, 138.240777, 79.19062, 124.306811),\n (79.19062, 124.306811, 81.724068, 124.306811),\n (81.724068, 124.306811, 81.724068, 138.240777),\n (81.724068, 138.240777, 189.39562, 138.240777),\n (189.39562, 138.240777, 189.39562, 124.306811),\n (189.39562, 124.306811, 191.929068, 124.306811),\n (191.929068, 124.306811, 191.929068, 138.240777),\n (191.929068, 138.240777, 195.72924, 138.240777),\n (195.72924, 138.240777, 195.72924, 111.63957),\n (195.72924, 111.63957, 75.390447, 111.63957),\n (75.390447, 111.63957, 75.390447, 138.240777),\n (75.390447, 138.240777, 79.19062, 138.240777),\n (79.19062, 95.759276, 79.19062, 97.63957),\n (79.19062, 97.63957, 81.724068, 97.63957),\n (79.19062, 95.759276, 81.724068, 95.759276),\n (81.724068, 95.759276, 81.724068, 97.63957),\n (81.724068, 97.63957, 189.39562, 97.63957),\n (189.39562, 95.759276, 189.39562, 97.63957),\n (81.724068, 95.759276, 189.39562, 95.759276),\n (189.39562, 97.63957, 191.929068, 97.63957),\n (189.39562, 95.759276, 191.929068, 95.759276),\n (191.929068, 95.759276, 191.929068, 97.63957),\n (191.929068, 97.63957, 195.72924, 97.63957),\n (195.72924, 95.759276, 195.72924, 97.63957),\n (191.929068, 95.759276, 195.72924, 95.759276),\n (75.390447, 95.759276, 75.390447, 97.63957),\n (75.390447, 97.63957, 79.19062, 97.63957),\n (75.390447, 95.759276, 79.19062, 95.759276),\n (211.609534, 111.63957, 209.72924, 111.63957),\n (209.72924, 111.63957, 209.72924, 138.240777),\n (211.609534, 138.240777, 209.72924, 138.240777),\n (211.609534, 111.63957, 211.609534, 138.240777)\n]\nVISIBLE_CIRCLES = [\n\n]\nVISIBLE_ARCS = [\n\n]\nHIDDEN_SEGMENTS = [\n (211.6095, 124.3068, 209.7292, 124.3068)\n]\n# (orient, text, p1, p2, base) for linear; (orient, text, center, radius, angle) for diameter\nDIMENSIONS = [\n ('vertical', '11.5789', (79.1906, 124.3068), (79.1906, 138.2408), (68.1906, 131.2738)),\n ('horizontal', '2.1053', (81.7241, 124.3068), (79.1906, 124.3068), (80.4574, 113.3068)),\n ('vertical', '11.5789', (81.7241, 138.2408), (81.7241, 124.3068), (92.7241, 131.2738)),\n ('horizontal', '89.4737', (189.3956, 138.2408), (81.7241, 138.2408), (135.5599, 127.2408)),\n ('vertical', '11.5789', (189.3956, 124.3068), (189.3956, 138.2408), (178.3956, 131.2738)),\n ('horizontal', '2.1053', (191.9291, 124.3068), (189.3956, 124.3068), (190.6623, 113.3068)),\n ('vertical', '11.5789', (191.9291, 138.2408), (191.9291, 124.3068), (202.9291, 131.2738)),\n ('horizontal', '3.1579', (195.7292, 138.2408), (191.9291, 138.2408), (193.8292, 127.2408)),\n ('vertical', '22.1053', (195.7292, 111.6395), (195.7292, 138.2408), (184.7292, 124.9401)),\n ('horizontal', '100', (75.3905, 111.6395), (195.7292, 111.6395), (135.5599, 122.6395)),\n ('vertical', '22.1053', (75.3905, 138.2408), (75.3905, 111.6395), (86.3905, 124.9401)),\n ('horizontal', '3.1579', (79.1906, 138.2408), (75.3905, 138.2408), (77.2905, 127.2408)),\n ('horizontal', '1.5625', (211.6095, 138.2408), (209.7292, 138.2408), (210.6694, 127.2408))\n]\n\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\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\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,\n angle=(0 if d[0] == \"horizontal\" else 90),\n 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,\n text=text, dimstyle=\"EZDXF\").render()\n\n doc.saveas(out_path)\n\n\nif __name__ == \"__main__\":\n out = sys.argv[1] if len(sys.argv) > 1 else \"0019_00190615_gt.dxf\"\n draw(out)\n print(\"wrote\", out)\n```"}], "images": ["images/0019_00190615.png"], "id": "0019_00190615"} {"messages": [{"role": "user", "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 100 x 49.47 mm bounding box. It is extruded to a thickness of -400 mm."}, {"role": "assistant", "content": "```python\n#!/usr/bin/env python3\n# -*- coding: utf-8 -*-\n# Ground-truth 2D engineering drawing for part: 0020_00203583\n# Self-contained: reproduces the three-view DXF via ezdxf, NO FreeCAD needed.\n# Coordinates are A4 page millimetres (scale=0.1922, page=[297.0, 210.0]).\n# visible edges -> solid (layer OUTLINE); hidden edges -> dashed (layer HIDDEN)\n# dimensions -> real movable DIMENSION entities (text = true mm value)\n# Run: python 0020_00203583_gt.py [out.dxf]\nimport sys\nimport ezdxf\n\nSCALE = 0.1922\nPAGE = [297.0, 210.0]\n\nVISIBLE_SEGMENTS = [\n (107.67, 172.05, 107.67, 167.194421),\n (107.67, 167.194421, 105.242211, 167.194421),\n (105.242211, 167.194421, 105.242211, 157.685579),\n (105.242211, 157.685579, 107.67, 157.685579),\n (107.67, 157.685579, 107.67, 152.83),\n (107.67, 152.83, 88.45, 152.83),\n (88.45, 152.83, 88.45, 157.685579),\n (88.45, 157.685579, 90.877789, 157.685579),\n (90.877789, 157.685579, 90.877789, 167.194421),\n (90.877789, 167.194421, 88.45, 167.194421),\n (88.45, 167.194421, 88.45, 172.05),\n (88.45, 172.05, 107.67, 172.05),\n (107.67, 138.83, 107.67, 61.95),\n (88.45, 138.83, 88.45, 61.95),\n (88.45, 61.95, 107.67, 61.95),\n (88.45, 138.83, 107.67, 138.83),\n (121.67, 152.83, 198.55, 152.83),\n (198.55, 152.83, 198.55, 157.685579),\n (121.67, 157.685579, 198.55, 157.685579),\n (121.67, 152.83, 121.67, 157.685579),\n (198.55, 157.685579, 198.55, 167.194421),\n (121.67, 157.685579, 121.67, 167.194421),\n (121.67, 167.194421, 198.55, 167.194421),\n (198.55, 167.194421, 198.55, 172.05),\n (121.67, 172.05, 198.55, 172.05),\n (121.67, 167.194421, 121.67, 172.05)\n]\nVISIBLE_CIRCLES = [\n\n]\nVISIBLE_ARCS = [\n\n]\nHIDDEN_SEGMENTS = [\n (105.2422, 138.83, 105.2422, 61.95),\n (90.8778, 138.83, 90.8778, 61.95)\n]\n# (orient, text, p1, p2, base) for linear; (orient, text, center, radius, angle) for diameter\nDIMENSIONS = [\n ('vertical', '25.2632', (107.67, 167.1944), (107.67, 172.05), (96.67, 169.6222)),\n ('horizontal', '12.6316', (105.2422, 167.1944), (107.67, 167.1944), (106.4561, 178.1944)),\n ('vertical', '49.4737', (105.2422, 157.6856), (105.2422, 167.1944), (94.2422, 162.44)),\n ('horizontal', '12.6316', (107.67, 157.6856), (105.2422, 157.6856), (106.4561, 146.6856)),\n ('vertical', '25.2632', (107.67, 152.83), (107.67, 157.6856), (96.67, 155.2578)),\n ('horizontal', '100', (88.45, 152.83), (107.67, 152.83), (98.06, 163.83)),\n ('vertical', '25.2632', (88.45, 157.6856), (88.45, 152.83), (99.45, 155.2578)),\n ('horizontal', '12.6316', (90.8778, 157.6856), (88.45, 157.6856), (89.6639, 146.6856)),\n ('vertical', '49.4737', (90.8778, 167.1944), (90.8778, 157.6856), (101.8778, 162.44)),\n ('horizontal', '12.6316', (88.45, 167.1944), (90.8778, 167.1944), (89.6639, 178.1944)),\n ('vertical', '25.2632', (88.45, 172.05), (88.45, 167.1944), (99.45, 169.6222)),\n ('horizontal', '100', (107.67, 172.05), (88.45, 172.05), (98.06, 161.05)),\n ('horizontal', '400', (121.67, 172.05), (198.55, 172.05), (160.11, 183.05))\n]\n\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\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\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,\n angle=(0 if d[0] == \"horizontal\" else 90),\n 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,\n text=text, dimstyle=\"EZDXF\").render()\n\n doc.saveas(out_path)\n\n\nif __name__ == \"__main__\":\n out = sys.argv[1] if len(sys.argv) > 1 else \"0020_00203583_gt.dxf\"\n draw(out)\n print(\"wrote\", out)\n```"}], "images": ["images/0020_00203583.png"], "id": "0020_00203583"} {"messages": [{"role": "user", "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 10 edges within a 100 x 56.84 mm bounding box. It is extruded to a thickness of 51.39 mm."}, {"role": "assistant", "content": "```python\n#!/usr/bin/env python3\n# -*- coding: utf-8 -*-\n# Ground-truth 2D engineering drawing for part: 0023_00230716\n# Self-contained: reproduces the three-view DXF via ezdxf, NO FreeCAD needed.\n# Coordinates are A4 page millimetres (scale=0.6576528264132608, page=[297.0, 210.0]).\n# visible edges -> solid (layer OUTLINE); hidden edges -> dashed (layer HIDDEN)\n# dimensions -> real movable DIMENSION entities (text = true mm value)\n# Run: python 0023_00230716_gt.py [out.dxf]\nimport sys\nimport ezdxf\n\nSCALE = 0.6576528264132608\nPAGE = [297.0, 210.0]\n\nVISIBLE_SEGMENTS = [\n (152.484623, 172.049983, 152.484623, 168.588653),\n (152.484623, 168.588653, 140.023832, 168.588653),\n (140.023832, 168.588653, 140.023832, 144.359338),\n (140.023832, 144.359338, 152.484623, 144.359338),\n (152.484623, 144.359338, 152.484623, 109.746031),\n (152.484623, 109.746031, 114.409985, 109.746031),\n (114.409985, 109.746031, 114.409985, 134.667612),\n (114.409985, 134.667612, 86.71934, 134.667612),\n (86.71934, 134.667612, 86.71934, 172.049983),\n (86.71934, 172.049983, 152.484623, 172.049983),\n (152.484623, 61.949983, 152.484623, 95.746031),\n (86.71934, 61.949983, 86.71934, 95.746031),\n (86.71934, 95.746031, 152.484623, 95.746031),\n (86.71934, 61.949983, 152.484623, 61.949983),\n (200.280671, 109.746031, 166.484623, 109.746031),\n (166.484623, 109.746031, 166.484623, 134.667612),\n (200.280671, 109.746031, 200.280671, 134.667612),\n (200.280671, 134.667612, 166.484623, 134.667612),\n (166.484623, 134.667612, 166.484623, 172.049983),\n (200.280671, 172.049983, 166.484623, 172.049983),\n (200.280671, 134.667612, 200.280671, 172.049983)\n]\nVISIBLE_CIRCLES = [\n\n]\nVISIBLE_ARCS = [\n\n]\nHIDDEN_SEGMENTS = [\n (140.0238, 61.95, 140.0238, 95.746),\n (114.41, 61.95, 114.41, 95.746),\n (200.2807, 168.5887, 166.4846, 168.5887),\n (200.2807, 144.3594, 166.4846, 144.3594)\n]\n# (orient, text, p1, p2, base) for linear; (orient, text, center, radius, angle) for diameter\nDIMENSIONS = [\n ('vertical', '5.2632', (152.4846, 168.5886), (152.4846, 172.05), (141.4846, 170.3193)),\n ('horizontal', '18.9474', (140.0238, 168.5886), (152.4846, 168.5886), (146.2542, 179.5886)),\n ('vertical', '36.8421', (140.0238, 144.3593), (140.0238, 168.5886), (129.0238, 156.474)),\n ('horizontal', '18.9474', (152.4846, 144.3593), (140.0238, 144.3593), (146.2542, 133.3593)),\n ('vertical', '52.6316', (152.4846, 109.7461), (152.4846, 144.3593), (141.4846, 127.0527)),\n ('horizontal', '57.8947', (114.41, 109.7461), (152.4846, 109.7461), (133.4473, 120.7461)),\n ('vertical', '37.8947', (114.41, 134.6676), (114.41, 109.7461), (125.41, 122.2069)),\n ('horizontal', '42.1053', (86.7194, 134.6676), (114.41, 134.6676), (100.5647, 145.6676)),\n ('vertical', '56.8421', (86.7194, 172.05), (86.7194, 134.6676), (97.7194, 153.3588)),\n ('horizontal', '100', (152.4846, 172.05), (86.7194, 172.05), (119.602, 161.05)),\n ('horizontal', '51.3889', (200.2807, 172.05), (166.4846, 172.05), (183.3826, 161.05))\n]\n\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\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\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,\n angle=(0 if d[0] == \"horizontal\" else 90),\n 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,\n text=text, dimstyle=\"EZDXF\").render()\n\n doc.saveas(out_path)\n\n\nif __name__ == \"__main__\":\n out = sys.argv[1] if len(sys.argv) > 1 else \"0023_00230716_gt.dxf\"\n draw(out)\n print(\"wrote\", out)\n```"}], "images": ["images/0023_00230716.png"], "id": "0023_00230716"} {"messages": [{"role": "user", "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 100 x 74.74 mm bounding box. It is extruded to a thickness of 62.5 mm."}, {"role": "assistant", "content": "```python\n#!/usr/bin/env python3\n# -*- coding: utf-8 -*-\n# Ground-truth 2D engineering drawing for part: 0023_00231900\n# Self-contained: reproduces the three-view DXF via ezdxf, NO FreeCAD needed.\n# Coordinates are A4 page millimetres (scale=0.7002492809204226, page=[297.0, 210.0]).\n# visible edges -> solid (layer OUTLINE); hidden edges -> dashed (layer HIDDEN)\n# dimensions -> real movable DIMENSION entities (text = true mm value)\n# Run: python 0023_00231900_gt.py [out.dxf]\nimport sys\nimport ezdxf\n\nSCALE = 0.7002492809204226\nPAGE = [297.0, 210.0]\n\nVISIBLE_SEGMENTS = [\n (149.629674, 172.05001, 149.629674, 158.782129),\n (149.629674, 158.782129, 140.78442, 158.782129),\n (140.78442, 158.782129, 140.78442, 149.936875),\n (140.78442, 149.936875, 149.629674, 149.936875),\n (149.629674, 149.936875, 149.629674, 119.71559),\n (149.629674, 119.71559, 123.093912, 119.71559),\n (123.093912, 119.71559, 123.093912, 136.668994),\n (123.093912, 136.668994, 106.140508, 136.668994),\n (106.140508, 136.668994, 106.140508, 119.71559),\n (106.140508, 119.71559, 79.604746, 119.71559),\n (79.604746, 119.71559, 79.604746, 172.05001),\n (79.604746, 172.05001, 149.629674, 172.05001),\n (149.629674, 61.95001, 149.629674, 105.71559),\n (79.604746, 61.95001, 79.604746, 105.71559),\n (79.604746, 105.71559, 149.629674, 105.71559),\n (79.604746, 61.95001, 149.629674, 61.95001),\n (207.395254, 119.71559, 163.629674, 119.71559),\n (163.629674, 119.71559, 163.629674, 172.05001),\n (207.395254, 172.05001, 163.629674, 172.05001),\n (207.395254, 119.71559, 207.395254, 172.05001)\n]\nVISIBLE_CIRCLES = [\n\n]\nVISIBLE_ARCS = [\n\n]\nHIDDEN_SEGMENTS = [\n (140.7844, 61.95, 140.7844, 105.7156),\n (123.0939, 61.95, 123.0939, 105.7156),\n (106.1405, 61.95, 106.1405, 105.7156),\n (207.3953, 158.7821, 163.6297, 158.7821),\n (207.3953, 149.9369, 163.6297, 149.9369),\n (207.3953, 136.669, 163.6297, 136.669)\n]\n# (orient, text, p1, p2, base) for linear; (orient, text, center, radius, angle) for diameter\nDIMENSIONS = [\n ('vertical', '18.9474', (149.6297, 158.7821), (149.6297, 172.05), (138.6297, 165.416)),\n ('horizontal', '12.6316', (140.7844, 158.7821), (149.6297, 158.7821), (145.207, 169.7821)),\n ('vertical', '12.6316', (140.7844, 149.9369), (140.7844, 158.7821), (129.7844, 154.3595)),\n ('horizontal', '12.6316', (149.6297, 149.9369), (140.7844, 149.9369), (145.207, 138.9369)),\n ('vertical', '43.1579', (149.6297, 119.7156), (149.6297, 149.9369), (138.6297, 134.8263)),\n ('horizontal', '37.8947', (123.0939, 119.7156), (149.6297, 119.7156), (136.3618, 130.7156)),\n ('vertical', '24.2105', (123.0939, 136.669), (123.0939, 119.7156), (134.0939, 128.1923)),\n ('horizontal', '24.2105', (106.1405, 136.669), (123.0939, 136.669), (114.6172, 147.669)),\n ('vertical', '24.2105', (106.1405, 119.7156), (106.1405, 136.669), (95.1405, 128.1923)),\n ('horizontal', '37.8947', (79.6047, 119.7156), (106.1405, 119.7156), (92.8726, 130.7156)),\n ('vertical', '74.7368', (79.6047, 172.05), (79.6047, 119.7156), (90.6047, 145.8828)),\n ('horizontal', '100', (149.6297, 172.05), (79.6047, 172.05), (114.6172, 161.05)),\n ('horizontal', '62.5', (207.3953, 172.05), (163.6297, 172.05), (185.5125, 161.05))\n]\n\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\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\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,\n angle=(0 if d[0] == \"horizontal\" else 90),\n 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,\n text=text, dimstyle=\"EZDXF\").render()\n\n doc.saveas(out_path)\n\n\nif __name__ == \"__main__\":\n out = sys.argv[1] if len(sys.argv) > 1 else \"0023_00231900_gt.dxf\"\n draw(out)\n print(\"wrote\", out)\n```"}], "images": ["images/0023_00231900.png"], "id": "0023_00231900"} {"messages": [{"role": "user", "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 13.54 mm."}, {"role": "assistant", "content": "```python\n#!/usr/bin/env python3\n# -*- coding: utf-8 -*-\n# Ground-truth 2D engineering drawing for part: 0024_00242597\n# Self-contained: reproduces the three-view DXF via ezdxf, NO FreeCAD needed.\n# Coordinates are A4 page millimetres (scale=0.846385321100915, page=[297.0, 210.0]).\n# visible edges -> solid (layer OUTLINE); hidden edges -> dashed (layer HIDDEN)\n# dimensions -> real movable DIMENSION entities (text = true mm value)\n# Run: python 0024_00242597_gt.py [out.dxf]\nimport sys\nimport ezdxf\n\nSCALE = 0.846385321100915\nPAGE = [297.0, 210.0]\n\nVISIBLE_SEGMENTS = [\n (100.032099, 87.411488, 100.032099, 160.467905),\n (100.032099, 160.467905, 173.088516, 160.467905),\n (173.088516, 160.467905, 173.088516, 172.05002),\n (173.088516, 172.05002, 88.449984, 172.05002),\n (88.449984, 172.05002, 88.449984, 87.411488),\n (88.449984, 87.411488, 100.032099, 87.411488),\n (173.088516, 73.411488, 173.088516, 61.95002),\n (173.088516, 61.95002, 88.449984, 61.95002),\n (88.449984, 73.411488, 88.449984, 61.95002),\n (173.088516, 73.411488, 88.449984, 73.411488),\n (187.088516, 172.05002, 198.549984, 172.05002),\n (198.549984, 172.05002, 198.549984, 87.411488),\n (187.088516, 87.411488, 198.549984, 87.411488),\n (187.088516, 172.05002, 187.088516, 87.411488)\n]\nVISIBLE_CIRCLES = [\n\n]\nVISIBLE_ARCS = [\n\n]\nHIDDEN_SEGMENTS = [\n (100.0321, 73.4115, 100.0321, 61.95),\n (187.0885, 160.4679, 198.55, 160.4679)\n]\n# (orient, text, p1, p2, base) for linear; (orient, text, center, radius, angle) for diameter\nDIMENSIONS = [\n ('vertical', '86.3158', (100.0321, 160.4679), (100.0321, 87.4115), (111.0321, 123.9397)),\n ('horizontal', '86.3158', (173.0885, 160.4679), (100.0321, 160.4679), (136.5603, 149.4679)),\n ('vertical', '13.6842', (173.0885, 172.05), (173.0885, 160.4679), (184.0885, 166.2589)),\n ('horizontal', '100', (88.45, 172.05), (173.0885, 172.05), (130.7693, 183.05)),\n ('vertical', '100', (88.45, 87.4115), (88.45, 172.05), (77.45, 129.7307)),\n ('horizontal', '13.6842', (100.0321, 87.4115), (88.45, 87.4115), (94.2411, 76.4115)),\n ('horizontal', '13.5417', (187.0885, 87.4115), (198.55, 87.4115), (192.8193, 98.4115))\n]\n\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\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\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,\n angle=(0 if d[0] == \"horizontal\" else 90),\n 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,\n text=text, dimstyle=\"EZDXF\").render()\n\n doc.saveas(out_path)\n\n\nif __name__ == \"__main__\":\n out = sys.argv[1] if len(sys.argv) > 1 else \"0024_00242597_gt.dxf\"\n draw(out)\n print(\"wrote\", out)\n```"}], "images": ["images/0024_00242597.png"], "id": "0024_00242597"} {"messages": [{"role": "user", "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 -49.74 mm."}, {"role": "assistant", "content": "```python\n#!/usr/bin/env python3\n# -*- coding: utf-8 -*-\n# Ground-truth 2D engineering drawing for part: 0026_00263527\n# Self-contained: reproduces the three-view DXF via ezdxf, NO FreeCAD needed.\n# Coordinates are A4 page millimetres (scale=1.0991574803150246, page=[297.0, 210.0]).\n# visible edges -> solid (layer OUTLINE); hidden edges -> dashed (layer HIDDEN)\n# dimensions -> real movable DIMENSION entities (text = true mm value)\n# Run: python 0026_00263527_gt.py [out.dxf]\nimport sys\nimport ezdxf\n\nSCALE = 1.0991574803150246\nPAGE = [297.0, 210.0]\n\nVISIBLE_SEGMENTS = [\n (164.122822, 169.847226, 164.122822, 132.822974),\n (164.122822, 132.822974, 145.610696, 132.822974),\n (145.610696, 132.822974, 145.610696, 151.3351),\n (145.610696, 151.3351, 127.09857, 151.3351),\n (127.09857, 151.3351, 127.09857, 132.822974),\n (127.09857, 132.822974, 54.207074, 132.822974),\n (54.207074, 132.822974, 54.207074, 169.847226),\n (54.207074, 169.847226, 164.122822, 169.847226),\n (164.122822, 118.822974, 164.122822, 64.152838),\n (54.207074, 118.822974, 54.207074, 64.152838),\n (54.207074, 64.152838, 164.122822, 64.152838),\n (54.207074, 118.822974, 164.122822, 118.822974),\n (178.122822, 132.822974, 232.792958, 132.822974),\n (232.792958, 132.822974, 232.792958, 169.847226),\n (178.122822, 169.847226, 232.792958, 169.847226),\n (178.122822, 132.822974, 178.122822, 169.847226)\n]\nVISIBLE_CIRCLES = [\n\n]\nVISIBLE_ARCS = [\n\n]\nHIDDEN_SEGMENTS = [\n (145.6107, 118.8229, 145.6107, 64.1528),\n (127.0986, 118.8229, 127.0986, 64.1528),\n (178.1228, 151.3351, 232.7929, 151.3351)\n]\n# (orient, text, p1, p2, base) for linear; (orient, text, center, radius, angle) for diameter\nDIMENSIONS = [\n ('vertical', '33.6842', (164.1228, 132.823), (164.1228, 169.8472), (153.1228, 151.3351)),\n ('horizontal', '16.8421', (145.6107, 132.823), (164.1228, 132.823), (154.8668, 143.823)),\n ('vertical', '16.8421', (145.6107, 151.3351), (145.6107, 132.823), (156.6107, 142.079)),\n ('horizontal', '16.8421', (127.0986, 151.3351), (145.6107, 151.3351), (136.3546, 162.3351)),\n ('vertical', '16.8421', (127.0986, 132.823), (127.0986, 151.3351), (116.0986, 142.079)),\n ('horizontal', '66.3158', (54.2071, 132.823), (127.0986, 132.823), (90.6528, 143.823)),\n ('vertical', '33.6842', (54.2071, 169.8472), (54.2071, 132.823), (65.2071, 151.3351)),\n ('horizontal', '100', (164.1228, 169.8472), (54.2071, 169.8472), (109.165, 158.8472)),\n ('horizontal', '49.7382', (178.1228, 169.8472), (232.7929, 169.8472), (205.4579, 180.8472))\n]\n\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\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\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,\n angle=(0 if d[0] == \"horizontal\" else 90),\n 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,\n text=text, dimstyle=\"EZDXF\").render()\n\n doc.saveas(out_path)\n\n\nif __name__ == \"__main__\":\n out = sys.argv[1] if len(sys.argv) > 1 else \"0026_00263527_gt.dxf\"\n draw(out)\n print(\"wrote\", out)\n```"}], "images": ["images/0026_00263527.png"], "id": "0026_00263527"} {"messages": [{"role": "user", "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 10 edges within a 100 x 73.68 mm bounding box. It is extruded to a thickness of 100 mm."}, {"role": "assistant", "content": "```python\n#!/usr/bin/env python3\n# -*- coding: utf-8 -*-\n# Ground-truth 2D engineering drawing for part: 0027_00270824\n# Self-contained: reproduces the three-view DXF via ezdxf, NO FreeCAD needed.\n# Coordinates are A4 page millimetres (scale=0.5533030303030296, page=[297.0, 210.0]).\n# visible edges -> solid (layer OUTLINE); hidden edges -> dashed (layer HIDDEN)\n# dimensions -> real movable DIMENSION entities (text = true mm value)\n# Run: python 0027_00270824_gt.py [out.dxf]\nimport sys\nimport ezdxf\n\nSCALE = 0.5533030303030296\nPAGE = [297.0, 210.0]\n\nVISIBLE_SEGMENTS = [\n (136.5, 172.050009, 136.5, 163.896069),\n (136.5, 163.896069, 123.686666, 163.896069),\n (123.686666, 163.896069, 123.686666, 154.577281),\n (123.686666, 154.577281, 110.290909, 154.577281),\n (110.290909, 154.577281, 110.290909, 143.511221),\n (110.290909, 143.511221, 96.312727, 143.511221),\n (96.312727, 143.511221, 96.312727, 131.280312),\n (96.312727, 131.280312, 81.169697, 131.280312),\n (81.169697, 131.280312, 81.169697, 172.050009),\n (81.169697, 172.050009, 136.5, 172.050009),\n (136.5, 61.950009, 136.5, 117.280312),\n (81.169697, 61.950009, 81.169697, 117.280312),\n (81.169697, 117.280312, 136.5, 117.280312),\n (81.169697, 61.950009, 136.5, 61.950009),\n (205.830303, 131.280312, 150.5, 131.280312),\n (150.5, 131.280312, 150.5, 172.050009),\n (205.830303, 172.050009, 150.5, 172.050009),\n (205.830303, 131.280312, 205.830303, 172.050009)\n]\nVISIBLE_CIRCLES = [\n\n]\nVISIBLE_ARCS = [\n\n]\nHIDDEN_SEGMENTS = [\n (123.6867, 61.95, 123.6867, 117.2803),\n (110.2909, 61.95, 110.2909, 117.2803),\n (96.3127, 61.95, 96.3127, 117.2803),\n (205.8303, 163.8961, 150.5, 163.8961),\n (205.8303, 154.5773, 150.5, 154.5773),\n (205.8303, 143.5112, 150.5, 143.5112)\n]\n# (orient, text, p1, p2, base) for linear; (orient, text, center, radius, angle) for diameter\nDIMENSIONS = [\n ('vertical', '14.7368', (136.5, 163.8961), (136.5, 172.05), (125.5, 167.973)),\n ('horizontal', '23.1579', (123.6867, 163.8961), (136.5, 163.8961), (130.0933, 174.8961)),\n ('vertical', '16.8421', (123.6867, 154.5773), (123.6867, 163.8961), (112.6867, 159.2367)),\n ('horizontal', '24.2105', (110.2909, 154.5773), (123.6867, 154.5773), (116.9888, 165.5773)),\n ('vertical', '20', (110.2909, 143.5112), (110.2909, 154.5773), (99.2909, 149.0443)),\n ('horizontal', '25.2632', (96.3127, 143.5112), (110.2909, 143.5112), (103.3018, 154.5112)),\n ('vertical', '22.1053', (96.3127, 131.2803), (96.3127, 143.5112), (85.3127, 137.3958)),\n ('horizontal', '27.3684', (81.1697, 131.2803), (96.3127, 131.2803), (88.7412, 142.2803)),\n ('vertical', '73.6842', (81.1697, 172.05), (81.1697, 131.2803), (92.1697, 151.6652)),\n ('horizontal', '100', (136.5, 172.05), (81.1697, 172.05), (108.8348, 161.05)),\n ('horizontal', '100', (205.8303, 172.05), (150.5, 172.05), (178.1652, 161.05))\n]\n\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\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\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,\n angle=(0 if d[0] == \"horizontal\" else 90),\n 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,\n text=text, dimstyle=\"EZDXF\").render()\n\n doc.saveas(out_path)\n\n\nif __name__ == \"__main__\":\n out = sys.argv[1] if len(sys.argv) > 1 else \"0027_00270824_gt.dxf\"\n draw(out)\n print(\"wrote\", out)\n```"}], "images": ["images/0027_00270824.png"], "id": "0027_00270824"} {"messages": [{"role": "user", "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 33.33 mm."}, {"role": "assistant", "content": "```python\n#!/usr/bin/env python3\n# -*- coding: utf-8 -*-\n# Ground-truth 2D engineering drawing for part: 0027_00271105\n# Self-contained: reproduces the three-view DXF via ezdxf, NO FreeCAD needed.\n# Coordinates are A4 page millimetres (scale=0.720750000000018, page=[297.0, 210.0]).\n# visible edges -> solid (layer OUTLINE); hidden edges -> dashed (layer HIDDEN)\n# dimensions -> real movable DIMENSION entities (text = true mm value)\n# Run: python 0027_00271105_gt.py [out.dxf]\nimport sys\nimport ezdxf\n\nSCALE = 0.720750000000018\nPAGE = [297.0, 210.0]\n\nVISIBLE_SEGMENTS = [\n (160.525, 172.049999, 160.525, 99.974999),\n (160.525, 99.974999, 136.247105, 99.974999),\n (136.247105, 99.974999, 136.247105, 147.772104),\n (136.247105, 147.772104, 112.727895, 147.772104),\n (112.727895, 147.772104, 112.727895, 99.974999),\n (112.727895, 99.974999, 88.45, 99.974999),\n (88.45, 99.974999, 88.45, 172.049999),\n (88.45, 172.049999, 160.525, 172.049999),\n (160.525, 61.949999, 160.525, 85.974999),\n (88.45, 61.949999, 88.45, 85.974999),\n (88.45, 85.974999, 160.525, 85.974999),\n (88.45, 61.949999, 160.525, 61.949999),\n (198.55, 99.974999, 174.525, 99.974999),\n (174.525, 99.974999, 174.525, 172.049999),\n (198.55, 172.049999, 174.525, 172.049999),\n (198.55, 99.974999, 198.55, 172.049999)\n]\nVISIBLE_CIRCLES = [\n\n]\nVISIBLE_ARCS = [\n\n]\nHIDDEN_SEGMENTS = [\n (136.2471, 61.95, 136.2471, 85.975),\n (112.7279, 61.95, 112.7279, 85.975),\n (198.55, 147.7721, 174.525, 147.7721)\n]\n# (orient, text, p1, p2, base) for linear; (orient, text, center, radius, angle) for diameter\nDIMENSIONS = [\n ('vertical', '100', (160.525, 99.975), (160.525, 172.05), (149.525, 136.0125)),\n ('horizontal', '33.6842', (136.2471, 99.975), (160.525, 99.975), (148.3861, 110.975)),\n ('vertical', '66.3158', (136.2471, 147.7721), (136.2471, 99.975), (147.2471, 123.8736)),\n ('horizontal', '32.6316', (112.7279, 147.7721), (136.2471, 147.7721), (124.4875, 158.7721)),\n ('vertical', '66.3158', (112.7279, 99.975), (112.7279, 147.7721), (101.7279, 123.8736)),\n ('horizontal', '33.6842', (88.45, 99.975), (112.7279, 99.975), (100.5889, 110.975)),\n ('vertical', '100', (88.45, 172.05), (88.45, 99.975), (99.45, 136.0125)),\n ('horizontal', '100', (160.525, 172.05), (88.45, 172.05), (124.4875, 161.05)),\n ('horizontal', '33.3333', (198.55, 172.05), (174.525, 172.05), (186.5375, 161.05))\n]\n\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\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\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,\n angle=(0 if d[0] == \"horizontal\" else 90),\n 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,\n text=text, dimstyle=\"EZDXF\").render()\n\n doc.saveas(out_path)\n\n\nif __name__ == \"__main__\":\n out = sys.argv[1] if len(sys.argv) > 1 else \"0027_00271105_gt.dxf\"\n draw(out)\n print(\"wrote\", out)\n```"}], "images": ["images/0027_00271105.png"], "id": "0027_00271105"} {"messages": [{"role": "user", "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 100 mm."}, {"role": "assistant", "content": "```python\n#!/usr/bin/env python3\n# -*- coding: utf-8 -*-\n# Ground-truth 2D engineering drawing for part: 0027_00271128\n# Self-contained: reproduces the three-view DXF via ezdxf, NO FreeCAD needed.\n# Coordinates are A4 page millimetres (scale=0.4805, page=[297.0, 210.0]).\n# visible edges -> solid (layer OUTLINE); hidden edges -> dashed (layer HIDDEN)\n# dimensions -> real movable DIMENSION entities (text = true mm value)\n# Run: python 0027_00271128_gt.py [out.dxf]\nimport sys\nimport ezdxf\n\nSCALE = 0.4805\nPAGE = [297.0, 210.0]\n\nVISIBLE_SEGMENTS = [\n (136.500001, 124.000001, 136.500001, 148.277896),\n (136.500001, 148.277896, 112.727896, 148.277896),\n (112.727896, 148.277896, 112.727896, 172.050001),\n (112.727896, 172.050001, 88.450001, 172.050001),\n (88.450001, 172.050001, 88.450001, 124.000001),\n (88.450001, 124.000001, 136.500001, 124.000001),\n (136.500001, 110.000001, 136.500001, 61.950001),\n (136.500001, 61.950001, 112.727896, 61.950001),\n (136.500001, 110.000001, 112.727896, 110.000001),\n (112.727896, 110.000001, 112.727896, 61.950001),\n (112.727896, 61.950001, 88.450001, 61.950001),\n (88.450001, 110.000001, 88.450001, 61.950001),\n (112.727896, 110.000001, 88.450001, 110.000001),\n (150.500001, 172.050001, 198.550001, 172.050001),\n (198.550001, 172.050001, 198.550001, 124.000001),\n (150.500001, 124.000001, 198.550001, 124.000001),\n (150.500001, 172.050001, 150.500001, 124.000001)\n]\nVISIBLE_CIRCLES = [\n\n]\nVISIBLE_ARCS = [\n\n]\nHIDDEN_SEGMENTS = [\n (150.5, 148.2779, 198.55, 148.2779)\n]\n# (orient, text, p1, p2, base) for linear; (orient, text, center, radius, angle) for diameter\nDIMENSIONS = [\n ('vertical', '50.5263', (136.5, 148.2779), (136.5, 124.0), (147.5, 136.1389)),\n ('horizontal', '49.4737', (112.7279, 148.2779), (136.5, 148.2779), (124.6139, 159.2779)),\n ('vertical', '49.4737', (112.7279, 172.05), (112.7279, 148.2779), (123.7279, 160.1639)),\n ('horizontal', '50.5263', (88.45, 172.05), (112.7279, 172.05), (100.5889, 183.05)),\n ('vertical', '100', (88.45, 124.0), (88.45, 172.05), (77.45, 148.025)),\n ('horizontal', '100', (136.5, 124.0), (88.45, 124.0), (112.475, 113.0)),\n ('horizontal', '100', (150.5, 124.0), (198.55, 124.0), (174.525, 135.0))\n]\n\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\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\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,\n angle=(0 if d[0] == \"horizontal\" else 90),\n 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,\n text=text, dimstyle=\"EZDXF\").render()\n\n doc.saveas(out_path)\n\n\nif __name__ == \"__main__\":\n out = sys.argv[1] if len(sys.argv) > 1 else \"0027_00271128_gt.dxf\"\n draw(out)\n print(\"wrote\", out)\n```"}], "images": ["images/0027_00271128.png"], "id": "0027_00271128"} {"messages": [{"role": "user", "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 14.74 x 100 mm bounding box. It is extruded to a thickness of 60.42 mm."}, {"role": "assistant", "content": "```python\n#!/usr/bin/env python3\n# -*- coding: utf-8 -*-\n# Ground-truth 2D engineering drawing for part: 0028_00280246\n# Self-contained: reproduces the three-view DXF via ezdxf, NO FreeCAD needed.\n# Coordinates are A4 page millimetres (scale=0.59906493506496, page=[297.0, 210.0]).\n# visible edges -> solid (layer OUTLINE); hidden edges -> dashed (layer HIDDEN)\n# dimensions -> real movable DIMENSION entities (text = true mm value)\n# Run: python 0028_00280246_gt.py [out.dxf]\nimport sys\nimport ezdxf\n\nSCALE = 0.59906493506496\nPAGE = [297.0, 210.0]\n\nVISIBLE_SEGMENTS = [\n (122.817422, 172.049992, 122.817422, 112.143498),\n (122.817422, 112.143498, 113.989097, 112.143498),\n (113.989097, 112.143498, 113.989097, 124.124797),\n (113.989097, 124.124797, 118.403259, 124.124797),\n (118.403259, 124.124797, 118.403259, 132.953122),\n (118.403259, 132.953122, 113.989097, 132.953122),\n (113.989097, 132.953122, 113.989097, 172.049992),\n (113.989097, 172.049992, 122.817422, 172.049992),\n (122.817422, 61.949992, 122.817422, 98.143498),\n (113.989097, 61.949992, 113.989097, 98.143498),\n (113.989097, 98.143498, 122.817422, 98.143498),\n (113.989097, 61.949992, 122.817422, 61.949992),\n (173.010929, 112.143498, 136.817422, 112.143498),\n (136.817422, 112.143498, 136.817422, 124.124797),\n (173.010929, 124.124797, 136.817422, 124.124797),\n (173.010929, 112.143498, 173.010929, 124.124797),\n (136.817422, 124.124797, 136.817422, 132.953122),\n (173.010929, 124.124797, 173.010929, 132.953122),\n (173.010929, 132.953122, 136.817422, 132.953122),\n (136.817422, 132.953122, 136.817422, 172.049992),\n (173.010929, 172.049992, 136.817422, 172.049992),\n (173.010929, 132.953122, 173.010929, 172.049992)\n]\nVISIBLE_CIRCLES = [\n\n]\nVISIBLE_ARCS = [\n\n]\nHIDDEN_SEGMENTS = [\n (118.4032, 61.95, 118.4032, 98.1435)\n]\n# (orient, text, p1, p2, base) for linear; (orient, text, center, radius, angle) for diameter\nDIMENSIONS = [\n ('vertical', '100', (122.8174, 112.1435), (122.8174, 172.05), (111.8174, 142.0968)),\n ('horizontal', '14.7368', (113.9891, 112.1435), (122.8174, 112.1435), (118.4033, 123.1435)),\n ('vertical', '20', (113.9891, 124.1248), (113.9891, 112.1435), (124.9891, 118.1342)),\n ('horizontal', '7.3684', (118.4033, 124.1248), (113.9891, 124.1248), (116.1962, 113.1248)),\n ('vertical', '14.7368', (118.4033, 132.9531), (118.4033, 124.1248), (129.4033, 128.539)),\n ('horizontal', '7.3684', (113.9891, 132.9531), (118.4033, 132.9531), (116.1962, 143.9531)),\n ('vertical', '65.2632', (113.9891, 172.05), (113.9891, 132.9531), (124.9891, 152.5016)),\n ('horizontal', '14.7368', (122.8174, 172.05), (113.9891, 172.05), (118.4033, 161.05)),\n ('horizontal', '60.4167', (173.0109, 172.05), (136.8174, 172.05), (154.9142, 161.05))\n]\n\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\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\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,\n angle=(0 if d[0] == \"horizontal\" else 90),\n 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,\n text=text, dimstyle=\"EZDXF\").render()\n\n doc.saveas(out_path)\n\n\nif __name__ == \"__main__\":\n out = sys.argv[1] if len(sys.argv) > 1 else \"0028_00280246_gt.dxf\"\n draw(out)\n print(\"wrote\", out)\n```"}], "images": ["images/0028_00280246.png"], "id": "0028_00280246"} {"messages": [{"role": "user", "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 circular hole of diameter 16.84 mm and a rectangular cutout 15.79 x 16.84 mm. It is extruded to a thickness of 16.67 mm."}, {"role": "assistant", "content": "```python\n#!/usr/bin/env python3\n# -*- coding: utf-8 -*-\n# Ground-truth 2D engineering drawing for part: 0028_00287202\n# Self-contained: reproduces the three-view DXF via ezdxf, NO FreeCAD needed.\n# Coordinates are A4 page millimetres (scale=0.976174825174823, page=[297.0, 210.0]).\n# visible edges -> solid (layer OUTLINE); hidden edges -> dashed (layer HIDDEN)\n# dimensions -> real movable DIMENSION entities (text = true mm value)\n# Run: python 0028_00287202_gt.py [out.dxf]\nimport sys\nimport ezdxf\n\nSCALE = 0.976174825174823\nPAGE = [297.0, 210.0]\n\nVISIBLE_SEGMENTS = [\n (79.556475, 156.796021, 177.173957, 156.796021),\n (177.173957, 156.796021, 177.173957, 107.473504),\n (177.173957, 107.473504, 79.556475, 107.473504),\n (79.556475, 107.473504, 79.556475, 156.796021),\n (98.052419, 123.914343, 98.052419, 140.355182),\n (113.465705, 123.914343, 98.052419, 123.914343),\n (113.465705, 140.355182, 113.465705, 123.914343),\n (98.052419, 140.355182, 113.465705, 140.355182),\n (177.173957, 77.203923, 177.173957, 93.473504),\n (79.556475, 77.203923, 177.173957, 77.203923),\n (79.556475, 77.203923, 79.556475, 93.473504),\n (177.173957, 93.473504, 79.556475, 93.473504),\n (207.443537, 156.796021, 191.173957, 156.796021),\n (207.443537, 107.473504, 191.173957, 107.473504),\n (191.173957, 107.473504, 191.173957, 156.796021),\n (207.443537, 107.473504, 207.443537, 156.796021)\n]\nVISIBLE_CIRCLES = [\n (150.457593, 132.134763, 8.22042)\n]\nVISIBLE_ARCS = [\n\n]\nHIDDEN_SEGMENTS = [\n (98.0524, 77.204, 98.0524, 93.4735),\n (113.4657, 77.204, 113.4657, 93.4735),\n (158.678, 77.204, 158.678, 93.4735),\n (142.2372, 93.4735, 142.2372, 77.204),\n (207.4435, 123.9144, 191.174, 123.9144),\n (207.4435, 140.3552, 191.174, 140.3552),\n (191.174, 123.9144, 207.4435, 123.9144),\n (191.174, 140.3552, 207.4435, 140.3552)\n]\n# (orient, text, p1, p2, base) for linear; (orient, text, center, radius, angle) for diameter\nDIMENSIONS = [\n ('vertical', '50.5263', (177.174, 107.4735), (177.174, 156.796), (166.174, 132.1348)),\n ('horizontal', '100', (79.5565, 107.4735), (177.174, 107.4735), (128.3652, 118.4735)),\n ('vertical', '50.5263', (79.5565, 156.796), (79.5565, 107.4735), (90.5565, 132.1348)),\n ('horizontal', '100', (177.174, 156.796), (79.5565, 156.796), (128.3652, 145.796)),\n ('diameter', '%%c16.8421', (150.4576, 132.1347), 8.2204, 45),\n ('horizontal', '72.6316', (79.5565, 132.1347), (150.4576, 132.1347), (115.007, 143.1347)),\n ('vertical', '25.2632', (150.4576, 156.796), (150.4576, 132.1347), (161.4576, 144.4654)),\n ('horizontal', '15.7895', (98.0524, 140.3552), (113.4657, 140.3552), (105.7591, 151.3552)),\n ('vertical', '16.8421', (98.0524, 140.3552), (98.0524, 123.9144), (109.0524, 132.1348)),\n ('horizontal', '18.9474', (79.5565, 140.3552), (98.0524, 140.3552), (88.8045, 151.3552)),\n ('vertical', '16.8421', (98.0524, 156.796), (98.0524, 140.3552), (109.0524, 148.5756)),\n ('horizontal', '16.6667', (207.4435, 156.796), (191.1739, 156.796), (199.3087, 145.796))\n]\n\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\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\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,\n angle=(0 if d[0] == \"horizontal\" else 90),\n 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,\n text=text, dimstyle=\"EZDXF\").render()\n\n doc.saveas(out_path)\n\n\nif __name__ == \"__main__\":\n out = sys.argv[1] if len(sys.argv) > 1 else \"0028_00287202_gt.dxf\"\n draw(out)\n print(\"wrote\", out)\n```"}], "images": ["images/0028_00287202.png"], "id": "0028_00287202"} {"messages": [{"role": "user", "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, featuring 4 circular holes (diameters 10.53, 12.63 mm). It is extruded to a thickness of 10 mm."}, {"role": "assistant", "content": "```python\n#!/usr/bin/env python3\n# -*- coding: utf-8 -*-\n# Ground-truth 2D engineering drawing for part: 0028_00287771\n# Self-contained: reproduces the three-view DXF via ezdxf, NO FreeCAD needed.\n# Coordinates are A4 page millimetres (scale=0.5890000000000075, page=[297.0, 210.0]).\n# visible edges -> solid (layer OUTLINE); hidden edges -> dashed (layer HIDDEN)\n# dimensions -> real movable DIMENSION entities (text = true mm value)\n# Run: python 0028_00287771_gt.py [out.dxf]\nimport sys\nimport ezdxf\n\nSCALE = 0.5890000000000075\nPAGE = [297.0, 210.0]\n\nVISIBLE_SEGMENTS = [\n (163.005, 108.345, 163.005, 128.185),\n (163.005, 128.185, 144.405, 128.185),\n (144.405, 128.185, 144.405, 145.545),\n (144.405, 145.545, 123.325, 145.545),\n (123.325, 145.545, 123.325, 128.185),\n (123.325, 128.185, 104.105, 128.185),\n (104.105, 128.185, 104.105, 108.345),\n (104.105, 108.345, 163.005, 108.345),\n (163.005, 94.345, 163.005, 88.455),\n (163.005, 88.455, 144.405, 88.455),\n (163.005, 94.345, 144.405, 94.345),\n (144.405, 94.345, 144.405, 88.455),\n (144.405, 88.455, 123.325, 88.455),\n (123.325, 94.345, 123.325, 88.455),\n (144.405, 94.345, 123.325, 94.345),\n (123.325, 88.455, 104.105, 88.455),\n (104.105, 94.345, 104.105, 88.455),\n (123.325, 94.345, 104.105, 94.345),\n (177.005, 145.545, 182.895, 145.545),\n (182.895, 145.545, 182.895, 128.185),\n (177.005, 145.545, 177.005, 128.185),\n (177.005, 128.185, 182.895, 128.185),\n (182.895, 128.185, 182.895, 108.345),\n (177.005, 108.345, 182.895, 108.345),\n (177.005, 128.185, 177.005, 108.345)\n]\nVISIBLE_CIRCLES = [\n (115.265, 118.265, 3.1),\n (134.485, 118.265, 3.72),\n (134.485, 135.005, 3.1),\n (151.845, 118.265, 3.72)\n]\nVISIBLE_ARCS = [\n\n]\nHIDDEN_SEGMENTS = [\n (118.365, 94.345, 118.365, 88.455),\n (138.205, 94.345, 138.205, 88.455),\n (137.585, 94.345, 137.585, 88.455),\n (155.565, 94.345, 155.565, 88.455),\n (112.165, 88.455, 112.165, 94.345),\n (130.765, 88.455, 130.765, 94.345),\n (131.385, 88.455, 131.385, 94.345),\n (148.125, 88.455, 148.125, 94.345),\n (182.895, 121.365, 177.005, 121.365),\n (182.895, 115.165, 177.005, 115.165),\n (182.895, 121.985, 177.005, 121.985),\n (182.895, 114.545, 177.005, 114.545),\n (182.895, 138.105, 177.005, 138.105),\n (182.895, 131.905, 177.005, 131.905)\n]\n# (orient, text, p1, p2, base) for linear; (orient, text, center, radius, angle) for diameter\nDIMENSIONS = [\n ('vertical', '33.6842', (163.005, 128.185), (163.005, 108.345), (174.005, 118.265)),\n ('horizontal', '31.5789', (144.405, 128.185), (163.005, 128.185), (153.705, 139.185)),\n ('vertical', '29.4737', (144.405, 145.545), (144.405, 128.185), (155.405, 136.865)),\n ('horizontal', '35.7895', (123.325, 145.545), (144.405, 145.545), (133.865, 156.545)),\n ('vertical', '29.4737', (123.325, 128.185), (123.325, 145.545), (112.325, 136.865)),\n ('horizontal', '32.6316', (104.105, 128.185), (123.325, 128.185), (113.715, 139.185)),\n ('vertical', '33.6842', (104.105, 108.345), (104.105, 128.185), (93.105, 118.265)),\n ('horizontal', '100', (163.005, 108.345), (104.105, 108.345), (133.555, 97.345)),\n ('diameter', '%%c10.5263', (115.265, 118.265), 3.1, 45),\n ('horizontal', '18.9474', (104.105, 118.265), (115.265, 118.265), (109.685, 129.265)),\n ('vertical', '16.8421', (115.265, 108.345), (115.265, 118.265), (104.265, 113.305)),\n ('diameter', '%%c12.6316', (134.485, 118.265), 3.72, 45),\n ('horizontal', '51.5789', (104.105, 118.265), (134.485, 118.265), (119.295, 129.265)),\n ('vertical', '16.8421', (134.485, 108.345), (134.485, 118.265), (123.485, 113.305)),\n ('diameter', '%%c10.5263', (134.485, 135.005), 3.1, 45),\n ('horizontal', '51.5789', (104.105, 135.005), (134.485, 135.005), (119.295, 146.005)),\n ('vertical', '45.2632', (134.485, 108.345), (134.485, 135.005), (123.485, 121.675)),\n ('diameter', '%%c12.6316', (151.845, 118.265), 3.72, 45),\n ('horizontal', '81.0526', (104.105, 118.265), (151.845, 118.265), (127.975, 129.265)),\n ('vertical', '16.8421', (151.845, 108.345), (151.845, 118.265), (140.845, 113.305)),\n ('horizontal', '10', (177.005, 108.345), (182.895, 108.345), (179.95, 119.345))\n]\n\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\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\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,\n angle=(0 if d[0] == \"horizontal\" else 90),\n 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,\n text=text, dimstyle=\"EZDXF\").render()\n\n doc.saveas(out_path)\n\n\nif __name__ == \"__main__\":\n out = sys.argv[1] if len(sys.argv) > 1 else \"0028_00287771_gt.dxf\"\n draw(out)\n print(\"wrote\", out)\n```"}], "images": ["images/0028_00287771.png"], "id": "0028_00287771"} {"messages": [{"role": "user", "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 76.84 mm bounding box. It is extruded to a thickness of 3.61 mm."}, {"role": "assistant", "content": "```python\n#!/usr/bin/env python3\n# -*- coding: utf-8 -*-\n# Ground-truth 2D engineering drawing for part: 0029_00297425\n# Self-contained: reproduces the three-view DXF via ezdxf, NO FreeCAD needed.\n# Coordinates are A4 page millimetres (scale=1.1944333228247193, page=[297.0, 210.0]).\n# visible edges -> solid (layer OUTLINE); hidden edges -> dashed (layer HIDDEN)\n# dimensions -> real movable DIMENSION entities (text = true mm value)\n# Run: python 0029_00297425_gt.py [out.dxf]\nimport sys\nimport ezdxf\n\nSCALE = 1.1944333228247193\nPAGE = [297.0, 210.0]\n\nVISIBLE_SEGMENTS = [\n (194.063056, 80.267215, 74.619724, 80.267215),\n (194.063056, 80.267215, 194.063056, 101.641285),\n (194.063056, 101.641285, 127.42625, 101.641285),\n (127.42625, 101.641285, 127.42625, 172.049986),\n (127.42625, 172.049986, 74.619724, 172.049986),\n (74.619724, 172.049986, 74.619724, 80.267215),\n (194.063056, 66.267215, 194.063056, 61.949986),\n (194.063056, 61.949986, 127.42625, 61.949986),\n (194.063056, 66.267215, 127.42625, 66.267215),\n (127.42625, 66.267215, 127.42625, 61.949986),\n (127.42625, 61.949986, 74.619724, 61.949986),\n (74.619724, 66.267215, 74.619724, 61.949986),\n (127.42625, 66.267215, 74.619724, 66.267215),\n (208.063056, 80.267215, 212.380285, 80.267215),\n (208.063056, 172.049986, 212.380285, 172.049986),\n (212.380285, 172.049986, 212.380285, 80.267215),\n (208.063056, 172.049986, 208.063056, 80.267215)\n]\nVISIBLE_CIRCLES = [\n\n]\nVISIBLE_ARCS = [\n\n]\nHIDDEN_SEGMENTS = [\n (208.0631, 101.6413, 212.3803, 101.6413)\n]\n# (orient, text, p1, p2, base) for linear; (orient, text, center, radius, angle) for diameter\nDIMENSIONS = [\n ('vertical', '17.8947', (194.063, 101.6413), (194.063, 80.2672), (205.063, 90.9543)),\n ('horizontal', '55.7895', (127.4263, 101.6413), (194.063, 101.6413), (160.7446, 112.6413)),\n ('vertical', '58.9474', (127.4263, 172.05), (127.4263, 101.6413), (138.4263, 136.8456)),\n ('horizontal', '44.2105', (74.6197, 172.05), (127.4263, 172.05), (101.023, 183.05)),\n ('vertical', '76.8421', (74.6197, 80.2672), (74.6197, 172.05), (63.6197, 126.1586)),\n ('horizontal', '100', (194.063, 80.2672), (74.6197, 80.2672), (134.3413, 69.2672)),\n ('horizontal', '3.6145', (208.0631, 80.2672), (212.3803, 80.2672), (210.2217, 91.2672))\n]\n\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\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\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,\n angle=(0 if d[0] == \"horizontal\" else 90),\n 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,\n text=text, dimstyle=\"EZDXF\").render()\n\n doc.saveas(out_path)\n\n\nif __name__ == \"__main__\":\n out = sys.argv[1] if len(sys.argv) > 1 else \"0029_00297425_gt.dxf\"\n draw(out)\n print(\"wrote\", out)\n```"}], "images": ["images/0029_00297425.png"], "id": "0029_00297425"} {"messages": [{"role": "user", "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 46.32 mm tall. It is extruded to a thickness of 6.37 mm."}, {"role": "assistant", "content": "```python\n#!/usr/bin/env python3\n# -*- coding: utf-8 -*-\n# Ground-truth 2D engineering drawing for part: 0030_00300574\n# Self-contained: reproduces the three-view DXF via ezdxf, NO FreeCAD needed.\n# Coordinates are A4 page millimetres (scale=1.0042661870503817, page=[297.0, 210.0]).\n# visible edges -> solid (layer OUTLINE); hidden edges -> dashed (layer HIDDEN)\n# dimensions -> real movable DIMENSION entities (text = true mm value)\n# Run: python 0030_00300574_gt.py [out.dxf]\nimport sys\nimport ezdxf\n\nSCALE = 1.0042661870503817\nPAGE = [297.0, 210.0]\n\nVISIBLE_SEGMENTS = [\n (83.088388, 150.454994, 183.515006, 150.454994),\n (183.515006, 150.454994, 183.515006, 103.941612),\n (183.515006, 103.941612, 83.088388, 103.941612),\n (83.088388, 103.941612, 83.088388, 150.454994),\n (183.515006, 83.545013, 183.515006, 89.941612),\n (83.088388, 83.545013, 183.515006, 83.545013),\n (83.088388, 83.545013, 83.088388, 89.941612),\n (183.515006, 89.941612, 83.088388, 89.941612),\n (203.911606, 150.454994, 197.515006, 150.454994),\n (203.911606, 103.941612, 197.515006, 103.941612),\n (197.515006, 103.941612, 197.515006, 150.454994),\n (203.911606, 103.941612, 203.911606, 150.454994)\n]\nVISIBLE_CIRCLES = [\n\n]\nVISIBLE_ARCS = [\n\n]\nHIDDEN_SEGMENTS = [\n\n]\n# (orient, text, p1, p2, base) for linear; (orient, text, center, radius, angle) for diameter\nDIMENSIONS = [\n ('vertical', '46.3158', (183.515, 103.9416), (183.515, 150.455), (172.515, 127.1983)),\n ('horizontal', '100', (83.0884, 103.9416), (183.515, 103.9416), (133.3017, 114.9416)),\n ('vertical', '46.3158', (83.0884, 150.455), (83.0884, 103.9416), (94.0884, 127.1983)),\n ('horizontal', '100', (183.515, 150.455), (83.0884, 150.455), (133.3017, 139.455)),\n ('horizontal', '6.3694', (203.9116, 150.455), (197.515, 150.455), (200.7133, 139.455))\n]\n\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\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\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,\n angle=(0 if d[0] == \"horizontal\" else 90),\n 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,\n text=text, dimstyle=\"EZDXF\").render()\n\n doc.saveas(out_path)\n\n\nif __name__ == \"__main__\":\n out = sys.argv[1] if len(sys.argv) > 1 else \"0030_00300574_gt.dxf\"\n draw(out)\n print(\"wrote\", out)\n```"}], "images": ["images/0030_00300574.png"], "id": "0030_00300574"} {"messages": [{"role": "user", "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 50.63 x 100 mm bounding box. It is extruded to a thickness of 19.87 mm."}, {"role": "assistant", "content": "```python\n#!/usr/bin/env python3\n# -*- coding: utf-8 -*-\n# Ground-truth 2D engineering drawing for part: 0030_00306492\n# Self-contained: reproduces the three-view DXF via ezdxf, NO FreeCAD needed.\n# Coordinates are A4 page millimetres (scale=0.8017157943071563, page=[297.0, 210.0]).\n# visible edges -> solid (layer OUTLINE); hidden edges -> dashed (layer HIDDEN)\n# dimensions -> real movable DIMENSION entities (text = true mm value)\n# Run: python 0030_00306492_gt.py [out.dxf]\nimport sys\nimport ezdxf\n\nSCALE = 0.8017157943071563\nPAGE = [297.0, 210.0]\n\nVISIBLE_SEGMENTS = [\n (115.850417, 91.878409, 80.331363, 91.878409),\n (115.850417, 91.878409, 115.850417, 102.02671),\n (115.850417, 102.02671, 156.443622, 102.02671),\n (156.443622, 102.02671, 156.443622, 91.878409),\n (156.443622, 91.878409, 176.740224, 91.878409),\n (176.740224, 91.878409, 176.740224, 172.049988),\n (176.740224, 172.049988, 156.443622, 172.049988),\n (156.443622, 172.049988, 156.443622, 161.901687),\n (156.443622, 161.901687, 115.850417, 161.901687),\n (115.850417, 161.901687, 115.850417, 172.049988),\n (80.331363, 172.049988, 115.850417, 172.049988),\n (80.331363, 172.049988, 80.331363, 91.878409),\n (176.740224, 77.878409, 176.740224, 61.949988),\n (176.740224, 61.949988, 156.443622, 61.949988),\n (156.443622, 77.878409, 156.443622, 61.949988),\n (176.740224, 77.878409, 156.443622, 77.878409),\n (156.443622, 61.949988, 115.850417, 61.949988),\n (156.443622, 77.878409, 115.850417, 77.878409),\n (115.850417, 77.878409, 115.850417, 61.949988),\n (80.331363, 61.949988, 115.850417, 61.949988),\n (80.331363, 77.878409, 80.331363, 61.949988),\n (115.850417, 77.878409, 80.331363, 77.878409),\n (190.740224, 91.878409, 206.668645, 91.878409),\n (190.740224, 172.049988, 206.668645, 172.049988),\n (206.668645, 172.049988, 206.668645, 91.878409),\n (190.740224, 172.049988, 190.740224, 91.878409)\n]\nVISIBLE_CIRCLES = [\n\n]\nVISIBLE_ARCS = [\n\n]\nHIDDEN_SEGMENTS = [\n (190.7402, 102.0267, 206.6686, 102.0267),\n (190.7402, 161.9017, 206.6686, 161.9017)\n]\n# (orient, text, p1, p2, base) for linear; (orient, text, center, radius, angle) for diameter\nDIMENSIONS = [\n ('vertical', '12.6582', (115.8504, 102.0267), (115.8504, 91.8784), (126.8504, 96.9526)),\n ('horizontal', '50.6329', (156.4436, 102.0267), (115.8504, 102.0267), (136.147, 91.0267)),\n ('vertical', '12.6582', (156.4436, 91.8784), (156.4436, 102.0267), (145.4436, 96.9526)),\n ('horizontal', '25.3165', (176.7403, 91.8784), (156.4436, 91.8784), (166.5919, 80.8784)),\n ('vertical', '100', (176.7403, 172.05), (176.7403, 91.8784), (187.7403, 131.9642)),\n ('horizontal', '25.3165', (156.4436, 172.05), (176.7403, 172.05), (166.5919, 183.05)),\n ('vertical', '12.6582', (156.4436, 161.9017), (156.4436, 172.05), (145.4436, 166.9758)),\n ('horizontal', '50.6329', (115.8504, 161.9017), (156.4436, 161.9017), (136.147, 172.9017)),\n ('vertical', '12.6582', (115.8504, 172.05), (115.8504, 161.9017), (126.8504, 166.9758)),\n ('horizontal', '44.3038', (80.3314, 172.05), (115.8504, 172.05), (98.0909, 183.05)),\n ('vertical', '100', (80.3314, 91.8784), (80.3314, 172.05), (69.3314, 131.9642)),\n ('horizontal', '44.3038', (115.8504, 91.8784), (80.3314, 91.8784), (98.0909, 80.8784)),\n ('horizontal', '19.8679', (190.7402, 91.8784), (206.6686, 91.8784), (198.7044, 102.8784))\n]\n\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\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\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,\n angle=(0 if d[0] == \"horizontal\" else 90),\n 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,\n text=text, dimstyle=\"EZDXF\").render()\n\n doc.saveas(out_path)\n\n\nif __name__ == \"__main__\":\n out = sys.argv[1] if len(sys.argv) > 1 else \"0030_00306492_gt.dxf\"\n draw(out)\n print(\"wrote\", out)\n```"}], "images": ["images/0030_00306492.png"], "id": "0030_00306492"} {"messages": [{"role": "user", "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 100 x 71.62 mm bounding box. It is extruded to a thickness of 85.59 mm."}, {"role": "assistant", "content": "```python\n#!/usr/bin/env python3\n# -*- coding: utf-8 -*-\n# Ground-truth 2D engineering drawing for part: 0030_00307644\n# Self-contained: reproduces the three-view DXF via ezdxf, NO FreeCAD needed.\n# Coordinates are A4 page millimetres (scale=0.4491410526315935, page=[297.0, 210.0]).\n# visible edges -> solid (layer OUTLINE); hidden edges -> dashed (layer HIDDEN)\n# dimensions -> real movable DIMENSION entities (text = true mm value)\n# Run: python 0030_00307644_gt.py [out.dxf]\nimport sys\nimport ezdxf\n\nSCALE = 0.4491410526315935\nPAGE = [297.0, 210.0]\n\nVISIBLE_SEGMENTS = [\n (139.737009, 172.05, 139.737009, 159.304105),\n (139.737009, 159.304105, 126.991115, 159.304105),\n (126.991115, 159.304105, 126.991115, 127.135895),\n (126.991115, 127.135895, 139.737009, 127.135895),\n (139.737009, 127.135895, 139.737009, 114.39),\n (139.737009, 114.39, 94.822904, 114.39),\n (94.822904, 114.39, 94.822904, 127.135895),\n (94.822904, 127.135895, 107.568799, 127.135895),\n (107.568799, 127.135895, 107.568799, 159.304105),\n (107.568799, 159.304105, 94.822904, 159.304105),\n (94.822904, 159.304105, 94.822904, 172.05),\n (94.822904, 172.05, 139.737009, 172.05),\n (139.737009, 61.95, 139.737009, 100.39),\n (94.822904, 61.95, 94.822904, 100.39),\n (94.822904, 100.39, 139.737009, 100.39),\n (94.822904, 61.95, 139.737009, 61.95),\n (192.177009, 114.39, 153.737009, 114.39),\n (153.737009, 114.39, 153.737009, 127.135895),\n (192.177009, 127.135895, 153.737009, 127.135895),\n (192.177009, 114.39, 192.177009, 127.135895),\n (153.737009, 127.135895, 153.737009, 159.304105),\n (192.177009, 127.135895, 192.177009, 159.304105),\n (192.177009, 159.304105, 153.737009, 159.304105),\n (153.737009, 159.304105, 153.737009, 172.05),\n (192.177009, 172.05, 153.737009, 172.05),\n (192.177009, 159.304105, 192.177009, 172.05)\n]\nVISIBLE_CIRCLES = [\n\n]\nVISIBLE_ARCS = [\n\n]\nHIDDEN_SEGMENTS = [\n (126.9912, 61.95, 126.9912, 100.39),\n (107.5688, 61.95, 107.5688, 100.39)\n]\n# (orient, text, p1, p2, base) for linear; (orient, text, center, radius, angle) for diameter\nDIMENSIONS = [\n ('vertical', '28.3784', (139.737, 159.3041), (139.737, 172.05), (128.737, 165.6771)),\n ('horizontal', '28.3784', (126.9911, 159.3041), (139.737, 159.3041), (133.3641, 170.3041)),\n ('vertical', '71.6216', (126.9911, 127.1359), (126.9911, 159.3041), (115.9911, 143.22)),\n ('horizontal', '28.3784', (139.737, 127.1359), (126.9911, 127.1359), (133.3641, 116.1359)),\n ('vertical', '28.3784', (139.737, 114.39), (139.737, 127.1359), (128.737, 120.763)),\n ('horizontal', '100', (94.8229, 114.39), (139.737, 114.39), (117.28, 125.39)),\n ('vertical', '28.3784', (94.8229, 127.1359), (94.8229, 114.39), (105.8229, 120.763)),\n ('horizontal', '28.3784', (107.5688, 127.1359), (94.8229, 127.1359), (101.1959, 116.1359)),\n ('vertical', '71.6216', (107.5688, 159.3041), (107.5688, 127.1359), (118.5688, 143.22)),\n ('horizontal', '28.3784', (94.8229, 159.3041), (107.5688, 159.3041), (101.1959, 170.3041)),\n ('vertical', '28.3784', (94.8229, 172.05), (94.8229, 159.3041), (105.8229, 165.6771)),\n ('horizontal', '100', (139.737, 172.05), (94.8229, 172.05), (117.28, 161.05)),\n ('horizontal', '85.5856', (192.1771, 172.05), (153.737, 172.05), (172.957, 161.05))\n]\n\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\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\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,\n angle=(0 if d[0] == \"horizontal\" else 90),\n 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,\n text=text, dimstyle=\"EZDXF\").render()\n\n doc.saveas(out_path)\n\n\nif __name__ == \"__main__\":\n out = sys.argv[1] if len(sys.argv) > 1 else \"0030_00307644_gt.dxf\"\n draw(out)\n print(\"wrote\", out)\n```"}], "images": ["images/0030_00307644.png"], "id": "0030_00307644"} {"messages": [{"role": "user", "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 64.21 mm bounding box. It is extruded to a thickness of -75.96 mm."}, {"role": "assistant", "content": "```python\n#!/usr/bin/env python3\n# -*- coding: utf-8 -*-\n# Ground-truth 2D engineering drawing for part: 0032_00321023\n# Self-contained: reproduces the three-view DXF via ezdxf, NO FreeCAD needed.\n# Coordinates are A4 page millimetres (scale=0.5852243589743571, page=[297.0, 210.0]).\n# visible edges -> solid (layer OUTLINE); hidden edges -> dashed (layer HIDDEN)\n# dimensions -> real movable DIMENSION entities (text = true mm value)\n# Run: python 0032_00321023_gt.py [out.dxf]\nimport sys\nimport ezdxf\n\nSCALE = 0.5852243589743571\nPAGE = [297.0, 210.0]\n\nVISIBLE_SEGMENTS = [\n (143.53394, 127.438497, 143.53394, 165.016061),\n (143.53394, 165.016061, 123.205094, 165.016061),\n (123.205094, 165.016061, 123.205094, 150.231446),\n (123.205094, 150.231446, 85.011504, 150.231446),\n (85.011504, 150.231446, 85.011504, 127.438497),\n (85.011504, 127.438497, 143.53394, 127.438497),\n (143.53394, 68.983954, 143.53394, 113.438497),\n (143.53394, 113.438497, 123.205094, 113.438497),\n (123.205094, 68.983954, 123.205094, 113.438497),\n (143.53394, 68.983954, 123.205094, 68.983954),\n (123.205094, 113.438497, 85.011504, 113.438497),\n (85.011504, 68.983954, 85.011504, 113.438497),\n (123.205094, 68.983954, 85.011504, 68.983954),\n (201.988483, 165.016061, 157.53394, 165.016061),\n (157.53394, 165.016061, 157.53394, 150.231446),\n (201.988483, 165.016061, 201.988483, 150.231446),\n (201.988483, 150.231446, 157.53394, 150.231446),\n (157.53394, 150.231446, 157.53394, 127.438497),\n (201.988483, 127.438497, 157.53394, 127.438497),\n (201.988483, 150.231446, 201.988483, 127.438497)\n]\nVISIBLE_CIRCLES = [\n\n]\nVISIBLE_ARCS = [\n\n]\nHIDDEN_SEGMENTS = [\n\n]\n# (orient, text, p1, p2, base) for linear; (orient, text, center, radius, angle) for diameter\nDIMENSIONS = [\n ('vertical', '64.2105', (143.5339, 165.016), (143.5339, 127.4385), (154.5339, 146.2273)),\n ('horizontal', '34.7368', (123.2051, 165.016), (143.5339, 165.016), (133.3695, 176.016)),\n ('vertical', '25.2632', (123.2051, 150.2315), (123.2051, 165.016), (112.2051, 157.6237)),\n ('horizontal', '65.2632', (85.0115, 150.2315), (123.2051, 150.2315), (104.1083, 161.2315)),\n ('vertical', '38.9474', (85.0115, 127.4385), (85.0115, 150.2315), (74.0115, 138.835)),\n ('horizontal', '100', (143.5339, 127.4385), (85.0115, 127.4385), (114.2727, 116.4385)),\n ('horizontal', '75.9615', (201.9885, 127.4385), (157.534, 127.4385), (179.7612, 116.4385))\n]\n\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\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\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,\n angle=(0 if d[0] == \"horizontal\" else 90),\n 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,\n text=text, dimstyle=\"EZDXF\").render()\n\n doc.saveas(out_path)\n\n\nif __name__ == \"__main__\":\n out = sys.argv[1] if len(sys.argv) > 1 else \"0032_00321023_gt.dxf\"\n draw(out)\n print(\"wrote\", out)\n```"}], "images": ["images/0032_00321023.png"], "id": "0032_00321023"} {"messages": [{"role": "user", "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 47.37 mm bounding box. It is extruded to a thickness of -2.08 mm."}, {"role": "assistant", "content": "```python\n#!/usr/bin/env python3\n# -*- coding: utf-8 -*-\n# Ground-truth 2D engineering drawing for part: 0032_00324229\n# Self-contained: reproduces the three-view DXF via ezdxf, NO FreeCAD needed.\n# Coordinates are A4 page millimetres (scale=0.652107142857141, page=[297.0, 210.0]).\n# visible edges -> solid (layer OUTLINE); hidden edges -> dashed (layer HIDDEN)\n# dimensions -> real movable DIMENSION entities (text = true mm value)\n# Run: python 0032_00324229_gt.py [out.dxf]\nimport sys\nimport ezdxf\n\nSCALE = 0.652107142857141\nPAGE = [297.0, 210.0]\n\nVISIBLE_SEGMENTS = [\n (136.850374, 109.234603, 136.850374, 128.454603),\n (136.850374, 128.454603, 145.773946, 128.454603),\n (145.773946, 128.454603, 145.773946, 109.234603),\n (145.773946, 109.234603, 168.426089, 109.234603),\n (168.426089, 109.234603, 168.426089, 140.123889),\n (168.426089, 140.123889, 103.215374, 140.123889),\n (103.215374, 140.123889, 103.215374, 109.234603),\n (103.215374, 109.234603, 136.850374, 109.234603),\n (168.426089, 93.876046, 168.426089, 95.234603),\n (168.426089, 95.234603, 103.215374, 95.234603),\n (103.215374, 93.876046, 103.215374, 95.234603),\n (168.426089, 93.876046, 103.215374, 93.876046),\n (183.784645, 140.123889, 182.426089, 140.123889),\n (182.426089, 140.123889, 182.426089, 109.234603),\n (183.784645, 109.234603, 182.426089, 109.234603),\n (183.784645, 140.123889, 183.784645, 109.234603)\n]\nVISIBLE_CIRCLES = [\n\n]\nVISIBLE_ARCS = [\n\n]\nHIDDEN_SEGMENTS = [\n (136.8504, 93.8761, 136.8504, 95.2346),\n (145.7739, 93.8761, 145.7739, 95.2346),\n (183.7846, 128.4546, 182.4261, 128.4546)\n]\n# (orient, text, p1, p2, base) for linear; (orient, text, center, radius, angle) for diameter\nDIMENSIONS = [\n ('vertical', '29.4737', (136.8503, 128.4546), (136.8503, 109.2346), (147.8503, 118.8446)),\n ('horizontal', '13.6842', (145.774, 128.4546), (136.8503, 128.4546), (141.3121, 117.4546)),\n ('vertical', '29.4737', (145.774, 109.2346), (145.774, 128.4546), (134.774, 118.8446)),\n ('horizontal', '34.7368', (168.4261, 109.2346), (145.774, 109.2346), (157.1, 98.2346)),\n ('vertical', '47.3684', (168.4261, 140.1239), (168.4261, 109.2346), (179.4261, 124.6793)),\n ('horizontal', '100', (103.2154, 140.1239), (168.4261, 140.1239), (135.8207, 151.1239)),\n ('vertical', '47.3684', (103.2154, 109.2346), (103.2154, 140.1239), (92.2154, 124.6793)),\n ('horizontal', '51.5789', (136.8503, 109.2346), (103.2154, 109.2346), (120.0328, 98.2346)),\n ('horizontal', '2.0833', (183.7846, 109.2346), (182.4261, 109.2346), (183.1054, 98.2346))\n]\n\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\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\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,\n angle=(0 if d[0] == \"horizontal\" else 90),\n 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,\n text=text, dimstyle=\"EZDXF\").render()\n\n doc.saveas(out_path)\n\n\nif __name__ == \"__main__\":\n out = sys.argv[1] if len(sys.argv) > 1 else \"0032_00324229_gt.dxf\"\n draw(out)\n print(\"wrote\", out)\n```"}], "images": ["images/0032_00324229.png"], "id": "0032_00324229"} {"messages": [{"role": "user", "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 124.68 mm."}, {"role": "assistant", "content": "```python\n#!/usr/bin/env python3\n# -*- coding: utf-8 -*-\n# Ground-truth 2D engineering drawing for part: 0032_00328689\n# Self-contained: reproduces the three-view DXF via ezdxf, NO FreeCAD needed.\n# Coordinates are A4 page millimetres (scale=0.427728323699486, page=[297.0, 210.0]).\n# visible edges -> solid (layer OUTLINE); hidden edges -> dashed (layer HIDDEN)\n# dimensions -> real movable DIMENSION entities (text = true mm value)\n# Run: python 0032_00328689_gt.py [out.dxf]\nimport sys\nimport ezdxf\n\nSCALE = 0.427728323699486\nPAGE = [297.0, 210.0]\n\nVISIBLE_SEGMENTS = [\n (99.255792, 172.049983, 99.255792, 166.647099),\n (99.255792, 166.647099, 120.417088, 166.647099),\n (120.417088, 166.647099, 120.417088, 172.049983),\n (120.417088, 172.049983, 131.222856, 172.049983),\n (131.222856, 172.049983, 131.222856, 129.277151),\n (131.222856, 129.277151, 88.450024, 129.277151),\n (88.450024, 129.277151, 88.450024, 172.049983),\n (88.450024, 172.049983, 99.255792, 172.049983),\n (99.255792, 61.949983, 99.255792, 115.277151),\n (99.255792, 115.277151, 120.417088, 115.277151),\n (99.255792, 61.949983, 120.417088, 61.949983),\n (120.417088, 61.949983, 120.417088, 115.277151),\n (120.417088, 115.277151, 131.222856, 115.277151),\n (131.222856, 61.949983, 131.222856, 115.277151),\n (120.417088, 61.949983, 131.222856, 61.949983),\n (88.450024, 61.949983, 88.450024, 115.277151),\n (88.450024, 115.277151, 99.255792, 115.277151),\n (88.450024, 61.949983, 99.255792, 61.949983),\n (198.550024, 129.277151, 145.222856, 129.277151),\n (145.222856, 129.277151, 145.222856, 172.049983),\n (198.550024, 172.049983, 145.222856, 172.049983),\n (198.550024, 129.277151, 198.550024, 172.049983)\n]\nVISIBLE_CIRCLES = [\n\n]\nVISIBLE_ARCS = [\n\n]\nHIDDEN_SEGMENTS = [\n (198.55, 166.6471, 145.2228, 166.6471)\n]\n# (orient, text, p1, p2, base) for linear; (orient, text, center, radius, angle) for diameter\nDIMENSIONS = [\n ('vertical', '12.6316', (99.2558, 166.6471), (99.2558, 172.05), (88.2558, 169.3486)),\n ('horizontal', '49.4737', (120.4171, 166.6471), (99.2558, 166.6471), (109.8364, 155.6471)),\n ('vertical', '12.6316', (120.4171, 172.05), (120.4171, 166.6471), (131.4171, 169.3486)),\n ('horizontal', '25.2632', (131.2229, 172.05), (120.4171, 172.05), (125.82, 161.05)),\n ('vertical', '100', (131.2229, 129.2771), (131.2229, 172.05), (120.2229, 150.6636)),\n ('horizontal', '100', (88.45, 129.2771), (131.2229, 129.2771), (109.8364, 140.2771)),\n ('vertical', '100', (88.45, 172.05), (88.45, 129.2771), (99.45, 150.6636)),\n ('horizontal', '25.2632', (99.2558, 172.05), (88.45, 172.05), (93.8529, 161.05)),\n ('horizontal', '124.675', (198.55, 172.05), (145.2228, 172.05), (171.8864, 161.05))\n]\n\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\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\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,\n angle=(0 if d[0] == \"horizontal\" else 90),\n 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,\n text=text, dimstyle=\"EZDXF\").render()\n\n doc.saveas(out_path)\n\n\nif __name__ == \"__main__\":\n out = sys.argv[1] if len(sys.argv) > 1 else \"0032_00328689_gt.dxf\"\n draw(out)\n print(\"wrote\", out)\n```"}], "images": ["images/0032_00328689.png"], "id": "0032_00328689"} {"messages": [{"role": "user", "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 1.05 mm bounding box. It is extruded to a thickness of 58.33 mm."}, {"role": "assistant", "content": "```python\n#!/usr/bin/env python3\n# -*- coding: utf-8 -*-\n# Ground-truth 2D engineering drawing for part: 0033_00330346\n# Self-contained: reproduces the three-view DXF via ezdxf, NO FreeCAD needed.\n# Coordinates are A4 page millimetres (scale=0.9280421052631599, page=[297.0, 210.0]).\n# visible edges -> solid (layer OUTLINE); hidden edges -> dashed (layer HIDDEN)\n# dimensions -> real movable DIMENSION entities (text = true mm value)\n# Run: python 0033_00330346_gt.py [out.dxf]\nimport sys\nimport ezdxf\n\nSCALE = 0.9280421052631599\nPAGE = [297.0, 210.0]\n\nVISIBLE_SEGMENTS = [\n (94.290383, 150.579452, 94.290383, 151.556338),\n (94.290383, 151.556338, 124.573862, 151.556338),\n (124.573862, 151.556338, 124.573862, 150.579452),\n (124.573862, 150.579452, 155.834228, 150.579452),\n (155.834228, 150.579452, 155.834228, 151.556338),\n (124.573862, 151.556338, 155.834228, 151.556338),\n (63.030017, 151.556338, 94.290383, 151.556338),\n (63.030017, 151.556338, 63.030017, 150.579452),\n (63.030017, 150.579452, 94.290383, 150.579452),\n (155.834228, 136.579452, 155.834228, 82.443662),\n (124.573862, 82.443662, 155.834228, 82.443662),\n (94.290383, 82.443662, 124.573862, 82.443662),\n (63.030017, 82.443662, 94.290383, 82.443662),\n (63.030017, 136.579452, 63.030017, 82.443662),\n (155.834228, 136.579452, 124.573862, 136.579452),\n (124.573862, 136.579452, 94.290383, 136.579452),\n (94.290383, 136.579452, 63.030017, 136.579452),\n (169.834228, 151.556338, 223.970017, 151.556338),\n (223.970017, 151.556338, 223.970017, 150.579452),\n (169.834228, 150.579452, 223.970017, 150.579452),\n (169.834228, 151.556338, 169.834228, 150.579452)\n]\nVISIBLE_CIRCLES = [\n\n]\nVISIBLE_ARCS = [\n\n]\nHIDDEN_SEGMENTS = [\n (94.2904, 136.5795, 94.2904, 82.4437),\n (124.5738, 136.5795, 124.5738, 82.4437)\n]\n# (orient, text, p1, p2, base) for linear; (orient, text, center, radius, angle) for diameter\nDIMENSIONS = [\n ('vertical', '1.0526', (94.2904, 151.5564), (94.2904, 150.5794), (105.2904, 151.0679)),\n ('horizontal', '32.6316', (94.2904, 151.5564), (124.5739, 151.5564), (109.4321, 162.5564)),\n ('vertical', '1.0526', (124.5739, 150.5794), (124.5739, 151.5564), (113.5739, 151.0679)),\n ('horizontal', '33.6842', (155.8342, 150.5794), (124.5739, 150.5794), (140.204, 139.5794)),\n ('vertical', '1.0526', (155.8342, 151.5564), (155.8342, 150.5794), (166.8342, 151.0679)),\n ('horizontal', '100', (155.8342, 151.5564), (63.03, 151.5564), (109.4321, 140.5564)),\n ('vertical', '1.0526', (63.03, 150.5794), (63.03, 151.5564), (52.03, 151.0679)),\n ('horizontal', '33.6842', (94.2904, 150.5794), (63.03, 150.5794), (78.6602, 139.5794)),\n ('horizontal', '58.3333', (169.8342, 150.5794), (223.97, 150.5794), (196.9021, 161.5794))\n]\n\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\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\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,\n angle=(0 if d[0] == \"horizontal\" else 90),\n 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,\n text=text, dimstyle=\"EZDXF\").render()\n\n doc.saveas(out_path)\n\n\nif __name__ == \"__main__\":\n out = sys.argv[1] if len(sys.argv) > 1 else \"0033_00330346_gt.dxf\"\n draw(out)\n print(\"wrote\", out)\n```"}], "images": ["images/0033_00330346.png"], "id": "0033_00330346"} {"messages": [{"role": "user", "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 83.16 mm bounding box. It is extruded to a thickness of 66.67 mm."}, {"role": "assistant", "content": "```python\n#!/usr/bin/env python3\n# -*- coding: utf-8 -*-\n# Ground-truth 2D engineering drawing for part: 0035_00356331\n# Self-contained: reproduces the three-view DXF via ezdxf, NO FreeCAD needed.\n# Coordinates are A4 page millimetres (scale=0.641416861826727, page=[297.0, 210.0]).\n# visible edges -> solid (layer OUTLINE); hidden edges -> dashed (layer HIDDEN)\n# dimensions -> real movable DIMENSION entities (text = true mm value)\n# Run: python 0035_00356331_gt.py [out.dxf]\nimport sys\nimport ezdxf\n\nSCALE = 0.641416861826727\nPAGE = [297.0, 210.0]\n\nVISIBLE_SEGMENTS = [\n (104.654226, 172.049997, 104.654226, 161.247187),\n (104.654226, 161.247187, 125.584671, 161.247187),\n (125.584671, 161.247187, 125.584671, 172.049997),\n (125.584671, 172.049997, 147.190292, 172.049997),\n (147.190292, 172.049997, 147.190292, 118.711121),\n (147.190292, 118.711121, 83.048606, 118.711121),\n (83.048606, 118.711121, 83.048606, 172.049997),\n (83.048606, 172.049997, 104.654226, 172.049997),\n (104.654226, 61.949997, 104.654226, 104.711121),\n (104.654226, 104.711121, 125.584671, 104.711121),\n (104.654226, 61.949997, 125.584671, 61.949997),\n (125.584671, 61.949997, 125.584671, 104.711121),\n (125.584671, 104.711121, 147.190292, 104.711121),\n (147.190292, 61.949997, 147.190292, 104.711121),\n (125.584671, 61.949997, 147.190292, 61.949997),\n (83.048606, 61.949997, 83.048606, 104.711121),\n (83.048606, 104.711121, 104.654226, 104.711121),\n (83.048606, 61.949997, 104.654226, 61.949997),\n (203.951416, 118.711121, 161.190292, 118.711121),\n (161.190292, 118.711121, 161.190292, 172.049997),\n (203.951416, 172.049997, 161.190292, 172.049997),\n (203.951416, 118.711121, 203.951416, 172.049997)\n]\nVISIBLE_CIRCLES = [\n\n]\nVISIBLE_ARCS = [\n\n]\nHIDDEN_SEGMENTS = [\n (203.9514, 161.2472, 161.1903, 161.2472)\n]\n# (orient, text, p1, p2, base) for linear; (orient, text, center, radius, angle) for diameter\nDIMENSIONS = [\n ('vertical', '16.8421', (104.6542, 161.2472), (104.6542, 172.05), (93.6542, 166.6486)),\n ('horizontal', '32.6316', (125.5847, 161.2472), (104.6542, 161.2472), (115.1194, 150.2472)),\n ('vertical', '16.8421', (125.5847, 172.05), (125.5847, 161.2472), (136.5847, 166.6486)),\n ('horizontal', '33.6842', (147.1903, 172.05), (125.5847, 172.05), (136.3875, 161.05)),\n ('vertical', '83.1579', (147.1903, 118.7111), (147.1903, 172.05), (136.1903, 145.3806)),\n ('horizontal', '100', (83.0486, 118.7111), (147.1903, 118.7111), (115.1194, 129.7111)),\n ('vertical', '83.1579', (83.0486, 172.05), (83.0486, 118.7111), (94.0486, 145.3806)),\n ('horizontal', '33.6842', (104.6542, 172.05), (83.0486, 172.05), (93.8514, 161.05)),\n ('horizontal', '66.6667', (203.9514, 172.05), (161.1903, 172.05), (182.5708, 161.05))\n]\n\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\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\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,\n angle=(0 if d[0] == \"horizontal\" else 90),\n 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,\n text=text, dimstyle=\"EZDXF\").render()\n\n doc.saveas(out_path)\n\n\nif __name__ == \"__main__\":\n out = sys.argv[1] if len(sys.argv) > 1 else \"0035_00356331_gt.dxf\"\n draw(out)\n print(\"wrote\", out)\n```"}], "images": ["images/0035_00356331.png"], "id": "0035_00356331"} {"messages": [{"role": "user", "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 80 x 100 mm bounding box. It is extruded to a thickness of -120 mm."}, {"role": "assistant", "content": "```python\n#!/usr/bin/env python3\n# -*- coding: utf-8 -*-\n# Ground-truth 2D engineering drawing for part: 0035_00359067\n# Self-contained: reproduces the three-view DXF via ezdxf, NO FreeCAD needed.\n# Coordinates are A4 page millimetres (scale=0.533888888888889, page=[297.0, 210.0]).\n# visible edges -> solid (layer OUTLINE); hidden edges -> dashed (layer HIDDEN)\n# dimensions -> real movable DIMENSION entities (text = true mm value)\n# Run: python 0035_00359067_gt.py [out.dxf]\nimport sys\nimport ezdxf\n\nSCALE = 0.533888888888889\nPAGE = [297.0, 210.0]\n\nVISIBLE_SEGMENTS = [\n (125.822221, 129.338889, 125.822221, 182.727778),\n (125.822221, 182.727778, 104.466665, 182.727778),\n (104.466665, 182.727778, 104.466665, 150.694444),\n (104.466665, 150.694444, 83.11111, 150.694444),\n (83.11111, 150.694444, 83.11111, 129.338889),\n (83.11111, 129.338889, 125.822221, 129.338889),\n (125.822221, 51.272222, 125.822221, 115.338889),\n (125.822221, 115.338889, 104.466665, 115.338889),\n (104.466665, 51.272222, 104.466665, 115.338889),\n (125.822221, 51.272222, 104.466665, 51.272222),\n (104.466665, 115.338889, 83.11111, 115.338889),\n (83.11111, 51.272222, 83.11111, 115.338889),\n (104.466665, 51.272222, 83.11111, 51.272222),\n (203.888888, 182.727778, 139.822221, 182.727778),\n (139.822221, 182.727778, 139.822221, 150.694444),\n (203.888888, 182.727778, 203.888888, 150.694444),\n (203.888888, 150.694444, 139.822221, 150.694444),\n (139.822221, 150.694444, 139.822221, 129.338889),\n (203.888888, 129.338889, 139.822221, 129.338889),\n (203.888888, 150.694444, 203.888888, 129.338889)\n]\nVISIBLE_CIRCLES = [\n\n]\nVISIBLE_ARCS = [\n\n]\nHIDDEN_SEGMENTS = [\n\n]\n# (orient, text, p1, p2, base) for linear; (orient, text, center, radius, angle) for diameter\nDIMENSIONS = [\n ('vertical', '100', (125.8222, 182.7278), (125.8222, 129.3389), (136.8222, 156.0333)),\n ('horizontal', '40', (104.4667, 182.7278), (125.8222, 182.7278), (115.1444, 193.7278)),\n ('vertical', '60', (104.4667, 150.6944), (104.4667, 182.7278), (93.4667, 166.7111)),\n ('horizontal', '40', (83.1111, 150.6944), (104.4667, 150.6944), (93.7889, 161.6944)),\n ('vertical', '40', (83.1111, 129.3389), (83.1111, 150.6944), (72.1111, 140.0167)),\n ('horizontal', '80', (125.8222, 129.3389), (83.1111, 129.3389), (104.4667, 118.3389)),\n ('horizontal', '120', (203.8889, 129.3389), (139.8222, 129.3389), (171.8556, 118.3389))\n]\n\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\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\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,\n angle=(0 if d[0] == \"horizontal\" else 90),\n 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,\n text=text, dimstyle=\"EZDXF\").render()\n\n doc.saveas(out_path)\n\n\nif __name__ == \"__main__\":\n out = sys.argv[1] if len(sys.argv) > 1 else \"0035_00359067_gt.dxf\"\n draw(out)\n print(\"wrote\", out)\n```"}], "images": ["images/0035_00359067.png"], "id": "0035_00359067"} {"messages": [{"role": "user", "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 44.62 mm."}, {"role": "assistant", "content": "```python\n#!/usr/bin/env python3\n# -*- coding: utf-8 -*-\n# Ground-truth 2D engineering drawing for part: 0035_00359102\n# Self-contained: reproduces the three-view DXF via ezdxf, NO FreeCAD needed.\n# Coordinates are A4 page millimetres (scale=1.0991574803149915, page=[297.0, 210.0]).\n# visible edges -> solid (layer OUTLINE); hidden edges -> dashed (layer HIDDEN)\n# dimensions -> real movable DIMENSION entities (text = true mm value)\n# Run: python 0035_00359102_gt.py [out.dxf]\nimport sys\nimport ezdxf\n\nSCALE = 1.0991574803149915\nPAGE = [297.0, 210.0]\n\nVISIBLE_SEGMENTS = [\n (166.938212, 167.031838, 166.938212, 130.007586),\n (166.938212, 130.007586, 142.641046, 130.007586),\n (142.641046, 130.007586, 142.641046, 154.304751),\n (142.641046, 154.304751, 69.74955, 154.304751),\n (69.74955, 154.304751, 69.74955, 130.007586),\n (69.74955, 130.007586, 57.022464, 130.007586),\n (57.022464, 130.007586, 57.022464, 167.031838),\n (57.022464, 167.031838, 166.938212, 167.031838),\n (166.938212, 66.968252, 166.938212, 116.007586),\n (57.022464, 66.968252, 57.022464, 116.007586),\n (57.022464, 116.007586, 166.938212, 116.007586),\n (57.022464, 66.968252, 166.938212, 66.968252),\n (229.977545, 130.007586, 180.938212, 130.007586),\n (180.938212, 130.007586, 180.938212, 167.031838),\n (229.977545, 167.031838, 180.938212, 167.031838),\n (229.977545, 130.007586, 229.977545, 167.031838)\n]\nVISIBLE_CIRCLES = [\n\n]\nVISIBLE_ARCS = [\n\n]\nHIDDEN_SEGMENTS = [\n (142.641, 66.9682, 142.641, 116.0075),\n (69.7495, 66.9682, 69.7495, 116.0075),\n (229.9775, 154.3047, 180.9382, 154.3047)\n]\n# (orient, text, p1, p2, base) for linear; (orient, text, center, radius, angle) for diameter\nDIMENSIONS = [\n ('vertical', '33.6842', (166.9382, 130.0076), (166.9382, 167.0318), (155.9382, 148.5197)),\n ('horizontal', '22.1053', (142.6411, 130.0076), (166.9382, 130.0076), (154.7896, 141.0076)),\n ('vertical', '22.1053', (142.6411, 154.3048), (142.6411, 130.0076), (153.6411, 142.1562)),\n ('horizontal', '66.3158', (69.7496, 154.3048), (142.6411, 154.3048), (106.1953, 165.3048)),\n ('vertical', '22.1053', (69.7496, 130.0076), (69.7496, 154.3048), (58.7496, 142.1562)),\n ('horizontal', '11.5789', (57.0224, 130.0076), (69.7496, 130.0076), (63.386, 141.0076)),\n ('vertical', '33.6842', (57.0224, 167.0318), (57.0224, 130.0076), (68.0224, 148.5197)),\n ('horizontal', '100', (166.9382, 167.0318), (57.0224, 167.0318), (111.9803, 156.0318)),\n ('horizontal', '44.6154', (229.9775, 167.0318), (180.9382, 167.0318), (205.4579, 156.0318))\n]\n\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\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\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,\n angle=(0 if d[0] == \"horizontal\" else 90),\n 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,\n text=text, dimstyle=\"EZDXF\").render()\n\n doc.saveas(out_path)\n\n\nif __name__ == \"__main__\":\n out = sys.argv[1] if len(sys.argv) > 1 else \"0035_00359102_gt.dxf\"\n draw(out)\n print(\"wrote\", out)\n```"}], "images": ["images/0035_00359102.png"], "id": "0035_00359102"} {"messages": [{"role": "user", "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 44.21 x 100 mm bounding box. It is extruded to a thickness of 44.44 mm."}, {"role": "assistant", "content": "```python\n#!/usr/bin/env python3\n# -*- coding: utf-8 -*-\n# Ground-truth 2D engineering drawing for part: 0037_00373516\n# Self-contained: reproduces the three-view DXF via ezdxf, NO FreeCAD needed.\n# Coordinates are A4 page millimetres (scale=0.6653076923077127, page=[297.0, 210.0]).\n# visible edges -> solid (layer OUTLINE); hidden edges -> dashed (layer HIDDEN)\n# dimensions -> real movable DIMENSION entities (text = true mm value)\n# Run: python 0037_00373516_gt.py [out.dxf]\nimport sys\nimport ezdxf\n\nSCALE = 0.6653076923077127\nPAGE = [297.0, 210.0]\n\nVISIBLE_SEGMENTS = [\n (136.422184, 172.049985, 136.422184, 105.519216),\n (136.422184, 105.519216, 135.021536, 105.519216),\n (135.021536, 105.519216, 135.021536, 169.949014),\n (135.021536, 169.949014, 107.008581, 169.949014),\n (107.008581, 169.949014, 107.008581, 172.049985),\n (107.008581, 172.049985, 136.422184, 172.049985),\n (136.422184, 61.949985, 136.422184, 91.519216),\n (107.008581, 61.949985, 107.008581, 91.519216),\n (107.008581, 91.519216, 136.422184, 91.519216),\n (107.008581, 61.949985, 136.422184, 61.949985),\n (179.991415, 105.519216, 150.422184, 105.519216),\n (150.422184, 105.519216, 150.422184, 169.949014),\n (179.991415, 105.519216, 179.991415, 169.949014),\n (179.991415, 169.949014, 150.422184, 169.949014),\n (150.422184, 169.949014, 150.422184, 172.049985),\n (179.991415, 172.049985, 150.422184, 172.049985),\n (179.991415, 169.949014, 179.991415, 172.049985)\n]\nVISIBLE_CIRCLES = [\n\n]\nVISIBLE_ARCS = [\n\n]\nHIDDEN_SEGMENTS = [\n (135.0215, 61.95, 135.0215, 91.5192)\n]\n# (orient, text, p1, p2, base) for linear; (orient, text, center, radius, angle) for diameter\nDIMENSIONS = [\n ('vertical', '100', (136.4222, 105.5192), (136.4222, 172.05), (125.4222, 138.7846)),\n ('horizontal', '2.1053', (135.0215, 105.5192), (136.4222, 105.5192), (135.7219, 116.5192)),\n ('vertical', '96.8421', (135.0215, 169.949), (135.0215, 105.5192), (146.0215, 137.7341)),\n ('horizontal', '42.1053', (107.0086, 169.949), (135.0215, 169.949), (121.0151, 180.949)),\n ('vertical', '3.1579', (107.0086, 172.05), (107.0086, 169.949), (118.0086, 170.9995)),\n ('horizontal', '44.2105', (136.4222, 172.05), (107.0086, 172.05), (121.7154, 161.05)),\n ('horizontal', '44.4444', (179.9914, 172.05), (150.4222, 172.05), (165.2068, 161.05))\n]\n\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\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\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,\n angle=(0 if d[0] == \"horizontal\" else 90),\n 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,\n text=text, dimstyle=\"EZDXF\").render()\n\n doc.saveas(out_path)\n\n\nif __name__ == \"__main__\":\n out = sys.argv[1] if len(sys.argv) > 1 else \"0037_00373516_gt.dxf\"\n draw(out)\n print(\"wrote\", out)\n```"}], "images": ["images/0037_00373516.png"], "id": "0037_00373516"} {"messages": [{"role": "user", "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 41.05 mm bounding box. It is extruded to a thickness of 33.33 mm."}, {"role": "assistant", "content": "```python\n#!/usr/bin/env python3\n# -*- coding: utf-8 -*-\n# Ground-truth 2D engineering drawing for part: 0038_00382112\n# Self-contained: reproduces the three-view DXF via ezdxf, NO FreeCAD needed.\n# Coordinates are A4 page millimetres (scale=0.9306200000000251, page=[297.0, 210.0]).\n# visible edges -> solid (layer OUTLINE); hidden edges -> dashed (layer HIDDEN)\n# dimensions -> real movable DIMENSION entities (text = true mm value)\n# Run: python 0038_00382112_gt.py [out.dxf]\nimport sys\nimport ezdxf\n\nSCALE = 0.9306200000000251\nPAGE = [297.0, 210.0]\n\nVISIBLE_SEGMENTS = [\n (167.520693, 166.44932, 167.520693, 150.77572),\n (167.520693, 150.77572, 136.173493, 150.77572),\n (136.173493, 150.77572, 136.173493, 112.57132),\n (136.173493, 112.57132, 105.805893, 112.57132),\n (105.805893, 112.57132, 105.805893, 150.77572),\n (105.805893, 150.77572, 74.458693, 150.77572),\n (74.458693, 150.77572, 74.458693, 166.44932),\n (74.458693, 166.44932, 167.520693, 166.44932),\n (167.520693, 67.550653, 167.520693, 98.57132),\n (74.458693, 67.550653, 74.458693, 98.57132),\n (74.458693, 98.57132, 167.520693, 98.57132),\n (74.458693, 67.550653, 167.520693, 67.550653),\n (212.54136, 112.57132, 181.520693, 112.57132),\n (181.520693, 112.57132, 181.520693, 150.77572),\n (212.54136, 112.57132, 212.54136, 150.77572),\n (212.54136, 150.77572, 181.520693, 150.77572),\n (181.520693, 150.77572, 181.520693, 166.44932),\n (212.54136, 166.44932, 181.520693, 166.44932),\n (212.54136, 150.77572, 212.54136, 166.44932)\n]\nVISIBLE_CIRCLES = [\n\n]\nVISIBLE_ARCS = [\n\n]\nHIDDEN_SEGMENTS = [\n (136.1735, 67.5507, 136.1735, 98.5713),\n (105.8059, 67.5507, 105.8059, 98.5713)\n]\n# (orient, text, p1, p2, base) for linear; (orient, text, center, radius, angle) for diameter\nDIMENSIONS = [\n ('vertical', '16.8421', (167.5207, 150.7757), (167.5207, 166.4493), (156.5207, 158.6125)),\n ('horizontal', '33.6842', (136.1735, 150.7757), (167.5207, 150.7757), (151.8471, 161.7757)),\n ('vertical', '41.0526', (136.1735, 112.5714), (136.1735, 150.7757), (125.1735, 131.6736)),\n ('horizontal', '32.6316', (105.8059, 112.5714), (136.1735, 112.5714), (120.9897, 123.5714)),\n ('vertical', '41.0526', (105.8059, 150.7757), (105.8059, 112.5714), (116.8059, 131.6736)),\n ('horizontal', '33.6842', (74.4587, 150.7757), (105.8059, 150.7757), (90.1323, 161.7757)),\n ('vertical', '16.8421', (74.4587, 166.4493), (74.4587, 150.7757), (85.4587, 158.6125)),\n ('horizontal', '100', (167.5207, 166.4493), (74.4587, 166.4493), (120.9897, 155.4493)),\n ('horizontal', '33.3333', (212.5413, 166.4493), (181.5207, 166.4493), (197.031, 155.4493))\n]\n\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\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\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,\n angle=(0 if d[0] == \"horizontal\" else 90),\n 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,\n text=text, dimstyle=\"EZDXF\").render()\n\n doc.saveas(out_path)\n\n\nif __name__ == \"__main__\":\n out = sys.argv[1] if len(sys.argv) > 1 else \"0038_00382112_gt.dxf\"\n draw(out)\n print(\"wrote\", out)\n```"}], "images": ["images/0038_00382112.png"], "id": "0038_00382112"} {"messages": [{"role": "user", "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, featuring a rectangular cutout 71.58 x 60 mm. It is extruded to a thickness of 84.21 mm."}, {"role": "assistant", "content": "```python\n#!/usr/bin/env python3\n# -*- coding: utf-8 -*-\n# Ground-truth 2D engineering drawing for part: 0039_00390565\n# Self-contained: reproduces the three-view DXF via ezdxf, NO FreeCAD needed.\n# Coordinates are A4 page millimetres (scale=0.6339930555555642, page=[297.0, 210.0]).\n# visible edges -> solid (layer OUTLINE); hidden edges -> dashed (layer HIDDEN)\n# dimensions -> real movable DIMENSION entities (text = true mm value)\n# Run: python 0039_00390565_gt.py [out.dxf]\nimport sys\nimport ezdxf\n\nSCALE = 0.6339930555555642\nPAGE = [297.0, 210.0]\n\nVISIBLE_SEGMENTS = [\n (141.505189, 129.338885, 78.105883, 129.338885),\n (141.505189, 129.338885, 141.505189, 172.049996),\n (141.505189, 172.049996, 78.105883, 172.049996),\n (78.105883, 172.049996, 78.105883, 129.338885),\n (136.1663, 170.047912, 90.785744, 170.047912),\n (136.1663, 132.008329, 136.1663, 170.047912),\n (90.785744, 132.008329, 136.1663, 132.008329),\n (90.785744, 170.047912, 90.785744, 132.008329),\n (141.505189, 115.338885, 141.505189, 61.949996),\n (141.505189, 61.949996, 78.105883, 61.949996),\n (78.105883, 115.338885, 78.105883, 61.949996),\n (141.505189, 115.338885, 78.105883, 115.338885),\n (155.505189, 129.338885, 208.894078, 129.338885),\n (155.505189, 172.049996, 208.894078, 172.049996),\n (208.894078, 172.049996, 208.894078, 129.338885),\n (155.505189, 172.049996, 155.505189, 129.338885)\n]\nVISIBLE_CIRCLES = [\n\n]\nVISIBLE_ARCS = [\n\n]\nHIDDEN_SEGMENTS = [\n (90.7858, 115.3389, 90.7858, 61.95),\n (136.1663, 115.3389, 136.1663, 61.95),\n (155.5052, 170.0479, 208.8941, 170.0479),\n (155.5052, 132.0083, 208.8941, 132.0083)\n]\n# (orient, text, p1, p2, base) for linear; (orient, text, center, radius, angle) for diameter\nDIMENSIONS = [\n ('vertical', '67.3684', (141.5052, 172.05), (141.5052, 129.3389), (152.5052, 150.6944)),\n ('horizontal', '100', (78.1059, 172.05), (141.5052, 172.05), (109.8055, 183.05)),\n ('vertical', '67.3684', (78.1059, 129.3389), (78.1059, 172.05), (67.1059, 150.6944)),\n ('horizontal', '100', (141.5052, 129.3389), (78.1059, 129.3389), (109.8055, 118.3389)),\n ('horizontal', '71.5789', (90.7857, 132.0083), (136.1663, 132.0083), (113.476, 143.0083)),\n ('vertical', '60', (90.7857, 132.0083), (90.7857, 170.0479), (79.7857, 151.0281)),\n ('horizontal', '20', (78.1059, 132.0083), (90.7857, 132.0083), (84.4458, 143.0083)),\n ('vertical', '4.2105', (90.7857, 129.3389), (90.7857, 132.0083), (79.7857, 130.6736)),\n ('horizontal', '84.2105', (155.5052, 129.3389), (208.8941, 129.3389), (182.1996, 140.3389))\n]\n\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\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\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,\n angle=(0 if d[0] == \"horizontal\" else 90),\n 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,\n text=text, dimstyle=\"EZDXF\").render()\n\n doc.saveas(out_path)\n\n\nif __name__ == \"__main__\":\n out = sys.argv[1] if len(sys.argv) > 1 else \"0039_00390565_gt.dxf\"\n draw(out)\n print(\"wrote\", out)\n```"}], "images": ["images/0039_00390565.png"], "id": "0039_00390565"} {"messages": [{"role": "user", "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 76.84 mm bounding box. It is extruded to a thickness of 1.56 mm."}, {"role": "assistant", "content": "```python\n#!/usr/bin/env python3\n# -*- coding: utf-8 -*-\n# Ground-truth 2D engineering drawing for part: 0041_00417133\n# Self-contained: reproduces the three-view DXF via ezdxf, NO FreeCAD needed.\n# Coordinates are A4 page millimetres (scale=1.2256933081603136, page=[297.0, 210.0]).\n# visible edges -> solid (layer OUTLINE); hidden edges -> dashed (layer HIDDEN)\n# dimensions -> real movable DIMENSION entities (text = true mm value)\n# Run: python 0041_00417133_gt.py [out.dxf]\nimport sys\nimport ezdxf\n\nSCALE = 1.2256933081603136\nPAGE = [297.0, 210.0]\n\nVISIBLE_SEGMENTS = [\n (107.803047, 77.865166, 107.803047, 120.441881),\n (107.803047, 120.441881, 163.281797, 120.441881),\n (163.281797, 120.441881, 163.281797, 77.865166),\n (163.281797, 77.865166, 196.827088, 77.865166),\n (196.827088, 77.865166, 196.827088, 172.05002),\n (196.827088, 172.05002, 74.257757, 172.05002),\n (74.257757, 172.05002, 74.257757, 77.865166),\n (74.257757, 77.865166, 107.803047, 77.865166),\n (196.827088, 63.865166, 196.827088, 61.95002),\n (196.827088, 61.95002, 74.257757, 61.95002),\n (74.257757, 63.865166, 74.257757, 61.95002),\n (196.827088, 63.865166, 74.257757, 63.865166),\n (210.827088, 172.05002, 212.742234, 172.05002),\n (212.742234, 172.05002, 212.742234, 77.865166),\n (210.827088, 77.865166, 212.742234, 77.865166),\n (210.827088, 172.05002, 210.827088, 77.865166)\n]\nVISIBLE_CIRCLES = [\n\n]\nVISIBLE_ARCS = [\n\n]\nHIDDEN_SEGMENTS = [\n (107.8031, 63.8651, 107.8031, 61.95),\n (163.2818, 63.8651, 163.2818, 61.95),\n (210.8271, 120.4419, 212.7422, 120.4419)\n]\n# (orient, text, p1, p2, base) for linear; (orient, text, center, radius, angle) for diameter\nDIMENSIONS = [\n ('vertical', '34.7368', (107.803, 120.4418), (107.803, 77.8652), (118.803, 99.1535)),\n ('horizontal', '45.2632', (163.2818, 120.4418), (107.803, 120.4418), (135.5424, 109.4418)),\n ('vertical', '34.7368', (163.2818, 77.8652), (163.2818, 120.4418), (152.2818, 99.1535)),\n ('horizontal', '27.3684', (196.8271, 77.8652), (163.2818, 77.8652), (180.0545, 66.8652)),\n ('vertical', '76.8421', (196.8271, 172.05), (196.8271, 77.8652), (207.8271, 124.9576)),\n ('horizontal', '100', (74.2578, 172.05), (196.8271, 172.05), (135.5424, 183.05)),\n ('vertical', '76.8421', (74.2578, 77.8652), (74.2578, 172.05), (63.2578, 124.9576)),\n ('horizontal', '27.3684', (107.803, 77.8652), (74.2578, 77.8652), (91.0304, 66.8652)),\n ('horizontal', '1.5625', (210.8271, 77.8652), (212.7422, 77.8652), (211.7847, 88.8652))\n]\n\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\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\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,\n angle=(0 if d[0] == \"horizontal\" else 90),\n 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,\n text=text, dimstyle=\"EZDXF\").render()\n\n doc.saveas(out_path)\n\n\nif __name__ == \"__main__\":\n out = sys.argv[1] if len(sys.argv) > 1 else \"0041_00417133_gt.dxf\"\n draw(out)\n print(\"wrote\", out)\n```"}], "images": ["images/0041_00417133.png"], "id": "0041_00417133"} {"messages": [{"role": "user", "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": "assistant", "content": "```python\n#!/usr/bin/env python3\n# -*- coding: utf-8 -*-\n# Ground-truth 2D engineering drawing for part: 0041_00419055\n# Self-contained: reproduces the three-view DXF via ezdxf, NO FreeCAD needed.\n# Coordinates are A4 page millimetres (scale=0.576600000000023, page=[297.0, 210.0]).\n# visible edges -> solid (layer OUTLINE); hidden edges -> dashed (layer HIDDEN)\n# dimensions -> real movable DIMENSION entities (text = true mm value)\n# Run: python 0041_00419055_gt.py [out.dxf]\nimport sys\nimport ezdxf\n\nSCALE = 0.576600000000023\nPAGE = [297.0, 210.0]\n\nVISIBLE_SEGMENTS = [\n (146.11, 172.050003, 146.11, 114.390003),\n (146.11, 114.390003, 126.687684, 114.390003),\n (126.687684, 114.390003, 126.687684, 152.627687),\n (126.687684, 152.627687, 107.872316, 152.627687),\n (107.872316, 152.627687, 107.872316, 114.390003),\n (107.872316, 114.390003, 88.45, 114.390003),\n (88.45, 114.390003, 88.45, 172.050003),\n (88.45, 172.050003, 146.11, 172.050003),\n (146.11, 61.950003, 146.11, 100.390003),\n (88.45, 61.950003, 88.45, 100.390003),\n (88.45, 100.390003, 146.11, 100.390003),\n (88.45, 61.950003, 146.11, 61.950003),\n (198.55, 114.390003, 160.11, 114.390003),\n (160.11, 114.390003, 160.11, 172.050003),\n (198.55, 172.050003, 160.11, 172.050003),\n (198.55, 114.390003, 198.55, 172.050003)\n]\nVISIBLE_CIRCLES = [\n\n]\nVISIBLE_ARCS = [\n\n]\nHIDDEN_SEGMENTS = [\n (126.6877, 61.95, 126.6877, 100.39),\n (107.8723, 61.95, 107.8723, 100.39),\n (198.55, 152.6277, 160.11, 152.6277)\n]\n# (orient, text, p1, p2, base) for linear; (orient, text, center, radius, angle) for diameter\nDIMENSIONS = [\n ('vertical', '100', (146.11, 114.39), (146.11, 172.05), (135.11, 143.22)),\n ('horizontal', '33.6842', (126.6877, 114.39), (146.11, 114.39), (136.3988, 125.39)),\n ('vertical', '66.3158', (126.6877, 152.6277), (126.6877, 114.39), (137.6877, 133.5088)),\n ('horizontal', '32.6316', (107.8723, 152.6277), (126.6877, 152.6277), (117.28, 163.6277)),\n ('vertical', '66.3158', (107.8723, 114.39), (107.8723, 152.6277), (96.8723, 133.5088)),\n ('horizontal', '33.6842', (88.45, 114.39), (107.8723, 114.39), (98.1612, 125.39)),\n ('vertical', '100', (88.45, 172.05), (88.45, 114.39), (99.45, 143.22)),\n ('horizontal', '100', (146.11, 172.05), (88.45, 172.05), (117.28, 161.05)),\n ('horizontal', '66.6667', (198.55, 172.05), (160.11, 172.05), (179.33, 161.05))\n]\n\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\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\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,\n angle=(0 if d[0] == \"horizontal\" else 90),\n 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,\n text=text, dimstyle=\"EZDXF\").render()\n\n doc.saveas(out_path)\n\n\nif __name__ == \"__main__\":\n out = sys.argv[1] if len(sys.argv) > 1 else \"0041_00419055_gt.dxf\"\n draw(out)\n print(\"wrote\", out)\n```"}], "images": ["images/0041_00419055.png"], "id": "0041_00419055"} {"messages": [{"role": "user", "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": "assistant", "content": "```python\n#!/usr/bin/env python3\n# -*- coding: utf-8 -*-\n# Ground-truth 2D engineering drawing for part: 0041_00419057\n# Self-contained: reproduces the three-view DXF via ezdxf, NO FreeCAD needed.\n# Coordinates are A4 page millimetres (scale=0.576600000000023, page=[297.0, 210.0]).\n# visible edges -> solid (layer OUTLINE); hidden edges -> dashed (layer HIDDEN)\n# dimensions -> real movable DIMENSION entities (text = true mm value)\n# Run: python 0041_00419057_gt.py [out.dxf]\nimport sys\nimport ezdxf\n\nSCALE = 0.576600000000023\nPAGE = [297.0, 210.0]\n\nVISIBLE_SEGMENTS = [\n (146.11, 172.05, 146.11, 114.39),\n (146.11, 114.39, 126.687684, 114.39),\n (126.687684, 114.39, 126.687684, 133.812316),\n (126.687684, 133.812316, 107.872316, 133.812316),\n (107.872316, 133.812316, 107.872316, 152.627684),\n (107.872316, 152.627684, 88.45, 152.627684),\n (88.45, 152.627684, 88.45, 172.05),\n (88.45, 172.05, 146.11, 172.05),\n (146.11, 61.95, 146.11, 100.39),\n (88.45, 61.95, 88.45, 100.39),\n (88.45, 100.39, 146.11, 100.39),\n (88.45, 61.95, 146.11, 61.95),\n (198.55, 114.39, 160.11, 114.39),\n (160.11, 114.39, 160.11, 133.812316),\n (198.55, 114.39, 198.55, 133.812316),\n (198.55, 133.812316, 160.11, 133.812316),\n (160.11, 133.812316, 160.11, 152.627684),\n (198.55, 133.812316, 198.55, 152.627684),\n (198.55, 152.627684, 160.11, 152.627684),\n (160.11, 152.627684, 160.11, 172.05),\n (198.55, 172.05, 160.11, 172.05),\n (198.55, 152.627684, 198.55, 172.05)\n]\nVISIBLE_CIRCLES = [\n\n]\nVISIBLE_ARCS = [\n\n]\nHIDDEN_SEGMENTS = [\n (126.6877, 61.95, 126.6877, 100.39),\n (107.8723, 61.95, 107.8723, 100.39)\n]\n# (orient, text, p1, p2, base) for linear; (orient, text, center, radius, angle) for diameter\nDIMENSIONS = [\n ('vertical', '100', (146.11, 114.39), (146.11, 172.05), (135.11, 143.22)),\n ('horizontal', '33.6842', (126.6877, 114.39), (146.11, 114.39), (136.3988, 125.39)),\n ('vertical', '33.6842', (126.6877, 133.8123), (126.6877, 114.39), (137.6877, 124.1012)),\n ('horizontal', '32.6316', (107.8723, 133.8123), (126.6877, 133.8123), (117.28, 144.8123)),\n ('vertical', '32.6316', (107.8723, 152.6277), (107.8723, 133.8123), (118.8723, 143.22)),\n ('horizontal', '33.6842', (88.45, 152.6277), (107.8723, 152.6277), (98.1612, 163.6277)),\n ('vertical', '33.6842', (88.45, 172.05), (88.45, 152.6277), (99.45, 162.3388)),\n ('horizontal', '100', (146.11, 172.05), (88.45, 172.05), (117.28, 161.05)),\n ('horizontal', '66.6667', (198.55, 172.05), (160.11, 172.05), (179.33, 161.05))\n]\n\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\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\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,\n angle=(0 if d[0] == \"horizontal\" else 90),\n 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,\n text=text, dimstyle=\"EZDXF\").render()\n\n doc.saveas(out_path)\n\n\nif __name__ == \"__main__\":\n out = sys.argv[1] if len(sys.argv) > 1 else \"0041_00419057_gt.dxf\"\n draw(out)\n print(\"wrote\", out)\n```"}], "images": ["images/0041_00419057.png"], "id": "0041_00419057"} {"messages": [{"role": "user", "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 50 mm."}, {"role": "assistant", "content": "```python\n#!/usr/bin/env python3\n# -*- coding: utf-8 -*-\n# Ground-truth 2D engineering drawing for part: 0041_00419265\n# Self-contained: reproduces the three-view DXF via ezdxf, NO FreeCAD needed.\n# Coordinates are A4 page millimetres (scale=0.6406666666666667, page=[297.0, 210.0]).\n# visible edges -> solid (layer OUTLINE); hidden edges -> dashed (layer HIDDEN)\n# dimensions -> real movable DIMENSION entities (text = true mm value)\n# Run: python 0041_00419265_gt.py [out.dxf]\nimport sys\nimport ezdxf\n\nSCALE = 0.6406666666666667\nPAGE = [297.0, 210.0]\n\nVISIBLE_SEGMENTS = [\n (152.516673, 172.049998, 152.516673, 139.679472),\n (152.516673, 139.679472, 120.820532, 139.679472),\n (120.820532, 139.679472, 120.820532, 107.983332),\n (120.820532, 107.983332, 88.450006, 107.983332),\n (88.450006, 107.983332, 88.450006, 172.049998),\n (88.450006, 172.049998, 152.516673, 172.049998),\n (152.516673, 61.949998, 152.516673, 93.983332),\n (88.450006, 61.949998, 88.450006, 93.983332),\n (88.450006, 93.983332, 152.516673, 93.983332),\n (88.450006, 61.949998, 152.516673, 61.949998),\n (198.550006, 107.983332, 166.516673, 107.983332),\n (166.516673, 107.983332, 166.516673, 172.049998),\n (198.550006, 172.049998, 166.516673, 172.049998),\n (198.550006, 107.983332, 198.550006, 172.049998)\n]\nVISIBLE_CIRCLES = [\n\n]\nVISIBLE_ARCS = [\n\n]\nHIDDEN_SEGMENTS = [\n (120.8205, 61.95, 120.8205, 93.9833),\n (198.55, 139.6795, 166.5167, 139.6795)\n]\n# (orient, text, p1, p2, base) for linear; (orient, text, center, radius, angle) for diameter\nDIMENSIONS = [\n ('vertical', '50.5263', (152.5167, 139.6795), (152.5167, 172.05), (141.5167, 155.8647)),\n ('horizontal', '49.4737', (120.8205, 139.6795), (152.5167, 139.6795), (136.6686, 150.6795)),\n ('vertical', '49.4737', (120.8205, 107.9833), (120.8205, 139.6795), (109.8205, 123.8314)),\n ('horizontal', '50.5263', (88.45, 107.9833), (120.8205, 107.9833), (104.6353, 118.9833)),\n ('vertical', '100', (88.45, 172.05), (88.45, 107.9833), (99.45, 140.0167)),\n ('horizontal', '100', (152.5167, 172.05), (88.45, 172.05), (120.4833, 161.05)),\n ('horizontal', '50', (198.55, 172.05), (166.5167, 172.05), (182.5333, 161.05))\n]\n\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\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\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,\n angle=(0 if d[0] == \"horizontal\" else 90),\n 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,\n text=text, dimstyle=\"EZDXF\").render()\n\n doc.saveas(out_path)\n\n\nif __name__ == \"__main__\":\n out = sys.argv[1] if len(sys.argv) > 1 else \"0041_00419265_gt.dxf\"\n draw(out)\n print(\"wrote\", out)\n```"}], "images": ["images/0041_00419265.png"], "id": "0041_00419265"} {"messages": [{"role": "user", "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": "assistant", "content": "```python\n#!/usr/bin/env python3\n# -*- coding: utf-8 -*-\n# Ground-truth 2D engineering drawing for part: 0042_00421340\n# Self-contained: reproduces the three-view DXF via ezdxf, NO FreeCAD needed.\n# Coordinates are A4 page millimetres (scale=0.5517509881422928, page=[297.0, 210.0]).\n# visible edges -> solid (layer OUTLINE); hidden edges -> dashed (layer HIDDEN)\n# dimensions -> real movable DIMENSION entities (text = true mm value)\n# Run: python 0042_00421340_gt.py [out.dxf]\nimport sys\nimport ezdxf\n\nSCALE = 0.5517509881422928\nPAGE = [297.0, 210.0]\n\nVISIBLE_SEGMENTS = [\n (108.912463, 160.8802, 108.912463, 197.470003),\n (108.912463, 197.470003, 72.322661, 197.470003),\n (72.322661, 197.470003, 72.322661, 179.465497),\n (72.322661, 179.465497, 53.737364, 179.465497),\n (53.737364, 179.465497, 53.737364, 160.8802),\n (53.737364, 160.8802, 108.912463, 160.8802),\n (108.912463, 146.8802, 108.912463, 36.530003),\n (108.912463, 36.530003, 72.322661, 36.530003),\n (72.322661, 146.8802, 72.322661, 36.530003),\n (108.912463, 146.8802, 72.322661, 146.8802),\n (72.322661, 36.530003, 53.737364, 36.530003),\n (53.737364, 146.8802, 53.737364, 36.530003),\n (72.322661, 146.8802, 53.737364, 146.8802),\n (122.912463, 197.470003, 233.262661, 197.470003),\n (233.262661, 197.470003, 233.262661, 179.465497),\n (122.912463, 197.470003, 122.912463, 179.465497),\n (122.912463, 179.465497, 233.262661, 179.465497),\n (233.262661, 179.465497, 233.262661, 160.8802),\n (122.912463, 160.8802, 233.262661, 160.8802),\n (122.912463, 179.465497, 122.912463, 160.8802)\n]\nVISIBLE_CIRCLES = [\n\n]\nVISIBLE_ARCS = [\n\n]\nHIDDEN_SEGMENTS = [\n\n]\n# (orient, text, p1, p2, base) for linear; (orient, text, center, radius, angle) for diameter\nDIMENSIONS = [\n ('vertical', '66.3158', (108.9125, 197.47), (108.9125, 160.8802), (119.9125, 179.1751)),\n ('horizontal', '66.3158', (72.3226, 197.47), (108.9125, 197.47), (90.6175, 208.47)),\n ('vertical', '32.6316', (72.3226, 179.4655), (72.3226, 197.47), (61.3226, 188.4677)),\n ('horizontal', '33.6842', (53.7374, 179.4655), (72.3226, 179.4655), (63.03, 190.4655)),\n ('vertical', '33.6842', (53.7374, 160.8802), (53.7374, 179.4655), (42.7374, 170.1728)),\n ('horizontal', '100', (108.9125, 160.8802), (53.7374, 160.8802), (81.3249, 149.8802)),\n ('horizontal', '200', (122.9125, 160.8802), (233.2626, 160.8802), (178.0875, 171.8802))\n]\n\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\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\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,\n angle=(0 if d[0] == \"horizontal\" else 90),\n 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,\n text=text, dimstyle=\"EZDXF\").render()\n\n doc.saveas(out_path)\n\n\nif __name__ == \"__main__\":\n out = sys.argv[1] if len(sys.argv) > 1 else \"0042_00421340_gt.dxf\"\n draw(out)\n print(\"wrote\", out)\n```"}], "images": ["images/0042_00421340.png"], "id": "0042_00421340"} {"messages": [{"role": "user", "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 100 mm."}, {"role": "assistant", "content": "```python\n#!/usr/bin/env python3\n# -*- coding: utf-8 -*-\n# Ground-truth 2D engineering drawing for part: 0042_00421723\n# Self-contained: reproduces the three-view DXF via ezdxf, NO FreeCAD needed.\n# Coordinates are A4 page millimetres (scale=0.4805, page=[297.0, 210.0]).\n# visible edges -> solid (layer OUTLINE); hidden edges -> dashed (layer HIDDEN)\n# dimensions -> real movable DIMENSION entities (text = true mm value)\n# Run: python 0042_00421723_gt.py [out.dxf]\nimport sys\nimport ezdxf\n\nSCALE = 0.4805\nPAGE = [297.0, 210.0]\n\nVISIBLE_SEGMENTS = [\n (136.5, 172.049993, 136.5, 123.999993),\n (136.5, 123.999993, 120.314737, 123.999993),\n (120.314737, 123.999993, 120.314737, 155.864729),\n (120.314737, 155.864729, 104.635263, 155.864729),\n (104.635263, 155.864729, 104.635263, 123.999993),\n (104.635263, 123.999993, 88.45, 123.999993),\n (88.45, 123.999993, 88.45, 172.049993),\n (88.45, 172.049993, 136.5, 172.049993),\n (136.5, 61.949993, 136.5, 109.999993),\n (88.45, 61.949993, 88.45, 109.999993),\n (88.45, 109.999993, 136.5, 109.999993),\n (88.45, 61.949993, 136.5, 61.949993),\n (198.55, 123.999993, 150.5, 123.999993),\n (150.5, 123.999993, 150.5, 172.049993),\n (198.55, 172.049993, 150.5, 172.049993),\n (198.55, 123.999993, 198.55, 172.049993)\n]\nVISIBLE_CIRCLES = [\n\n]\nVISIBLE_ARCS = [\n\n]\nHIDDEN_SEGMENTS = [\n (120.3147, 61.95, 120.3147, 110.0),\n (104.6353, 61.95, 104.6353, 110.0),\n (198.55, 155.8647, 150.5, 155.8647)\n]\n# (orient, text, p1, p2, base) for linear; (orient, text, center, radius, angle) for diameter\nDIMENSIONS = [\n ('vertical', '100', (136.5, 124.0), (136.5, 172.05), (125.5, 148.025)),\n ('horizontal', '33.6842', (120.3147, 124.0), (136.5, 124.0), (128.4074, 135.0)),\n ('vertical', '66.3158', (120.3147, 155.8647), (120.3147, 124.0), (131.3147, 139.9324)),\n ('horizontal', '32.6316', (104.6353, 155.8647), (120.3147, 155.8647), (112.475, 166.8647)),\n ('vertical', '66.3158', (104.6353, 124.0), (104.6353, 155.8647), (93.6353, 139.9324)),\n ('horizontal', '33.6842', (88.45, 124.0), (104.6353, 124.0), (96.5426, 135.0)),\n ('vertical', '100', (88.45, 172.05), (88.45, 124.0), (99.45, 148.025)),\n ('horizontal', '100', (136.5, 172.05), (88.45, 172.05), (112.475, 161.05)),\n ('horizontal', '100', (198.55, 172.05), (150.5, 172.05), (174.525, 161.05))\n]\n\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\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\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,\n angle=(0 if d[0] == \"horizontal\" else 90),\n 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,\n text=text, dimstyle=\"EZDXF\").render()\n\n doc.saveas(out_path)\n\n\nif __name__ == \"__main__\":\n out = sys.argv[1] if len(sys.argv) > 1 else \"0042_00421723_gt.dxf\"\n draw(out)\n print(\"wrote\", out)\n```"}], "images": ["images/0042_00421723.png"], "id": "0042_00421723"} {"messages": [{"role": "user", "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 66.67 mm."}, {"role": "assistant", "content": "```python\n#!/usr/bin/env python3\n# -*- coding: utf-8 -*-\n# Ground-truth 2D engineering drawing for part: 0042_00421738\n# Self-contained: reproduces the three-view DXF via ezdxf, NO FreeCAD needed.\n# Coordinates are A4 page millimetres (scale=0.576600000000023, page=[297.0, 210.0]).\n# visible edges -> solid (layer OUTLINE); hidden edges -> dashed (layer HIDDEN)\n# dimensions -> real movable DIMENSION entities (text = true mm value)\n# Run: python 0042_00421738_gt.py [out.dxf]\nimport sys\nimport ezdxf\n\nSCALE = 0.576600000000023\nPAGE = [297.0, 210.0]\n\nVISIBLE_SEGMENTS = [\n (146.11, 172.050006, 146.11, 152.627691),\n (146.11, 152.627691, 126.687684, 152.627691),\n (126.687684, 152.627691, 126.687684, 114.390006),\n (126.687684, 114.390006, 107.872316, 114.390006),\n (107.872316, 114.390006, 107.872316, 152.627691),\n (107.872316, 152.627691, 88.45, 152.627691),\n (88.45, 152.627691, 88.45, 172.050006),\n (88.45, 172.050006, 146.11, 172.050006),\n (146.11, 61.950006, 146.11, 100.390006),\n (88.45, 61.950006, 88.45, 100.390006),\n (88.45, 100.390006, 146.11, 100.390006),\n (88.45, 61.950006, 146.11, 61.950006),\n (198.55, 114.390006, 160.11, 114.390006),\n (160.11, 114.390006, 160.11, 152.627691),\n (198.55, 114.390006, 198.55, 152.627691),\n (198.55, 152.627691, 160.11, 152.627691),\n (160.11, 152.627691, 160.11, 172.050006),\n (198.55, 172.050006, 160.11, 172.050006),\n (198.55, 152.627691, 198.55, 172.050006)\n]\nVISIBLE_CIRCLES = [\n\n]\nVISIBLE_ARCS = [\n\n]\nHIDDEN_SEGMENTS = [\n (126.6877, 61.95, 126.6877, 100.39),\n (107.8723, 61.95, 107.8723, 100.39)\n]\n# (orient, text, p1, p2, base) for linear; (orient, text, center, radius, angle) for diameter\nDIMENSIONS = [\n ('vertical', '33.6842', (146.11, 152.6277), (146.11, 172.05), (135.11, 162.3388)),\n ('horizontal', '33.6842', (126.6877, 152.6277), (146.11, 152.6277), (136.3988, 163.6277)),\n ('vertical', '66.3158', (126.6877, 114.39), (126.6877, 152.6277), (115.6877, 133.5088)),\n ('horizontal', '32.6316', (107.8723, 114.39), (126.6877, 114.39), (117.28, 125.39)),\n ('vertical', '66.3158', (107.8723, 152.6277), (107.8723, 114.39), (118.8723, 133.5088)),\n ('horizontal', '33.6842', (88.45, 152.6277), (107.8723, 152.6277), (98.1612, 163.6277)),\n ('vertical', '33.6842', (88.45, 172.05), (88.45, 152.6277), (99.45, 162.3388)),\n ('horizontal', '100', (146.11, 172.05), (88.45, 172.05), (117.28, 161.05)),\n ('horizontal', '66.6667', (198.55, 172.05), (160.11, 172.05), (179.33, 161.05))\n]\n\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\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\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,\n angle=(0 if d[0] == \"horizontal\" else 90),\n 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,\n text=text, dimstyle=\"EZDXF\").render()\n\n doc.saveas(out_path)\n\n\nif __name__ == \"__main__\":\n out = sys.argv[1] if len(sys.argv) > 1 else \"0042_00421738_gt.dxf\"\n draw(out)\n print(\"wrote\", out)\n```"}], "images": ["images/0042_00421738.png"], "id": "0042_00421738"} {"messages": [{"role": "user", "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 14.74 x 100 mm bounding box. It is extruded to a thickness of 19.84 mm."}, {"role": "assistant", "content": "```python\n#!/usr/bin/env python3\n# -*- coding: utf-8 -*-\n# Ground-truth 2D engineering drawing for part: 0042_00422312\n# Self-contained: reproduces the three-view DXF via ezdxf, NO FreeCAD needed.\n# Coordinates are A4 page millimetres (scale=0.8018940397351249, page=[297.0, 210.0]).\n# visible edges -> solid (layer OUTLINE); hidden edges -> dashed (layer HIDDEN)\n# dimensions -> real movable DIMENSION entities (text = true mm value)\n# Run: python 0042_00422312_gt.py [out.dxf]\nimport sys\nimport ezdxf\n\nSCALE = 0.8018940397351249\nPAGE = [297.0, 210.0]\n\nVISIBLE_SEGMENTS = [\n (134.453396, 172.050013, 134.453396, 119.715876),\n (134.453396, 119.715876, 128.544703, 119.715876),\n (128.544703, 119.715876, 128.544703, 107.89849),\n (128.544703, 107.89849, 134.453396, 107.89849),\n (134.453396, 107.89849, 134.453396, 91.860609),\n (134.453396, 91.860609, 122.63601, 91.860609),\n (122.63601, 91.860609, 122.63601, 172.050013),\n (122.63601, 172.050013, 134.453396, 172.050013),\n (134.453396, 61.950013, 134.453396, 77.860609),\n (122.63601, 61.950013, 122.63601, 77.860609),\n (122.63601, 77.860609, 134.453396, 77.860609),\n (122.63601, 61.950013, 134.453396, 61.950013),\n (164.363992, 91.860609, 148.453396, 91.860609),\n (148.453396, 91.860609, 148.453396, 172.050013),\n (164.363992, 172.050013, 148.453396, 172.050013),\n (164.363992, 91.860609, 164.363992, 172.050013)\n]\nVISIBLE_CIRCLES = [\n\n]\nVISIBLE_ARCS = [\n\n]\nHIDDEN_SEGMENTS = [\n (128.5447, 61.95, 128.5447, 77.8606),\n (164.364, 119.7159, 148.4534, 119.7159),\n (164.364, 107.8985, 148.4534, 107.8985)\n]\n# (orient, text, p1, p2, base) for linear; (orient, text, center, radius, angle) for diameter\nDIMENSIONS = [\n ('vertical', '65.2632', (134.4534, 119.7159), (134.4534, 172.05), (123.4534, 145.8829)),\n ('horizontal', '7.3684', (128.5447, 119.7159), (134.4534, 119.7159), (131.4991, 130.7159)),\n ('vertical', '14.7368', (128.5447, 107.8985), (128.5447, 119.7159), (117.5447, 113.8072)),\n ('horizontal', '7.3684', (134.4534, 107.8985), (128.5447, 107.8985), (131.4991, 96.8985)),\n ('vertical', '20', (134.4534, 91.8606), (134.4534, 107.8985), (123.4534, 99.8795)),\n ('horizontal', '14.7368', (122.636, 91.8606), (134.4534, 91.8606), (128.5447, 102.8606)),\n ('vertical', '100', (122.636, 172.05), (122.636, 91.8606), (133.636, 131.9553)),\n ('horizontal', '14.7368', (134.4534, 172.05), (122.636, 172.05), (128.5447, 161.05)),\n ('horizontal', '19.8413', (164.364, 172.05), (148.4534, 172.05), (156.4087, 161.05))\n]\n\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\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\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,\n angle=(0 if d[0] == \"horizontal\" else 90),\n 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,\n text=text, dimstyle=\"EZDXF\").render()\n\n doc.saveas(out_path)\n\n\nif __name__ == \"__main__\":\n out = sys.argv[1] if len(sys.argv) > 1 else \"0042_00422312_gt.dxf\"\n draw(out)\n print(\"wrote\", out)\n```"}], "images": ["images/0042_00422312.png"], "id": "0042_00422312"} {"messages": [{"role": "user", "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 20 mm bounding box. It is extruded to a thickness of 120 mm."}, {"role": "assistant", "content": "```python\n#!/usr/bin/env python3\n# -*- coding: utf-8 -*-\n# Ground-truth 2D engineering drawing for part: 0043_00437607\n# Self-contained: reproduces the three-view DXF via ezdxf, NO FreeCAD needed.\n# Coordinates are A4 page millimetres (scale=0.6864285714285713, page=[297.0, 210.0]).\n# visible edges -> solid (layer OUTLINE); hidden edges -> dashed (layer HIDDEN)\n# dimensions -> real movable DIMENSION entities (text = true mm value)\n# Run: python 0043_00437607_gt.py [out.dxf]\nimport sys\nimport ezdxf\n\nSCALE = 0.6864285714285713\nPAGE = [297.0, 210.0]\n\nVISIBLE_SEGMENTS = [\n (63.883087, 172.049979, 63.883087, 161.211633),\n (63.883087, 161.211633, 129.635719, 161.211633),\n (129.635719, 161.211633, 129.635719, 158.321408),\n (129.635719, 158.321408, 60.992861, 158.321408),\n (60.992861, 158.321408, 60.992861, 172.049979),\n (60.992861, 172.049979, 63.883087, 172.049979),\n (63.883087, 61.949979, 63.883087, 144.321408),\n (63.883087, 144.321408, 129.635719, 144.321408),\n (129.635719, 61.949979, 129.635719, 144.321408),\n (63.883087, 61.949979, 129.635719, 61.949979),\n (60.992861, 61.949979, 60.992861, 144.321408),\n (60.992861, 144.321408, 63.883087, 144.321408),\n (60.992861, 61.949979, 63.883087, 61.949979),\n (226.007147, 158.321408, 143.635719, 158.321408),\n (143.635719, 158.321408, 143.635719, 172.049979),\n (226.007147, 172.049979, 143.635719, 172.049979),\n (226.007147, 158.321408, 226.007147, 172.049979)\n]\nVISIBLE_CIRCLES = [\n\n]\nVISIBLE_ARCS = [\n\n]\nHIDDEN_SEGMENTS = [\n (226.0071, 161.2117, 143.6357, 161.2117)\n]\n# (orient, text, p1, p2, base) for linear; (orient, text, center, radius, angle) for diameter\nDIMENSIONS = [\n ('vertical', '15.7895', (63.8831, 161.2116), (63.8831, 172.05), (52.8831, 166.6308)),\n ('horizontal', '95.7895', (129.6357, 161.2116), (63.8831, 161.2116), (96.7594, 150.2116)),\n ('vertical', '4.2105', (129.6357, 158.3214), (129.6357, 161.2116), (118.6357, 159.7665)),\n ('horizontal', '100', (60.9929, 158.3214), (129.6357, 158.3214), (95.3143, 169.3214)),\n ('vertical', '20', (60.9929, 172.05), (60.9929, 158.3214), (71.9929, 165.1857)),\n ('horizontal', '4.2105', (63.8831, 172.05), (60.9929, 172.05), (62.438, 161.05)),\n ('horizontal', '120', (226.0071, 172.05), (143.6357, 172.05), (184.8214, 161.05))\n]\n\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\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\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,\n angle=(0 if d[0] == \"horizontal\" else 90),\n 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,\n text=text, dimstyle=\"EZDXF\").render()\n\n doc.saveas(out_path)\n\n\nif __name__ == \"__main__\":\n out = sys.argv[1] if len(sys.argv) > 1 else \"0043_00437607_gt.dxf\"\n draw(out)\n print(\"wrote\", out)\n```"}], "images": ["images/0043_00437607.png"], "id": "0043_00437607"} {"messages": [{"role": "user", "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 35.79 mm bounding box. It is extruded to a thickness of 100 mm."}, {"role": "assistant", "content": "```python\n#!/usr/bin/env python3\n# -*- coding: utf-8 -*-\n# Ground-truth 2D engineering drawing for part: 0047_00478168\n# Self-contained: reproduces the three-view DXF via ezdxf, NO FreeCAD needed.\n# Coordinates are A4 page millimetres (scale=0.7077131782945867, page=[297.0, 210.0]).\n# visible edges -> solid (layer OUTLINE); hidden edges -> dashed (layer HIDDEN)\n# dimensions -> real movable DIMENSION entities (text = true mm value)\n# Run: python 0047_00478168_gt.py [out.dxf]\nimport sys\nimport ezdxf\n\nSCALE = 0.7077131782945867\nPAGE = [297.0, 210.0]\n\nVISIBLE_SEGMENTS = [\n (136.500025, 146.721307, 136.500025, 172.04999),\n (136.500025, 172.04999, 112.661266, 172.04999),\n (112.661266, 172.04999, 112.661266, 169.815106),\n (112.661266, 169.815106, 89.567467, 169.815106),\n (89.567467, 169.815106, 89.567467, 172.04999),\n (89.567467, 172.04999, 65.728708, 172.04999),\n (65.728708, 172.04999, 65.728708, 146.721307),\n (65.728708, 146.721307, 136.500025, 146.721307),\n (136.500025, 132.721307, 136.500025, 61.94999),\n (136.500025, 61.94999, 112.661266, 61.94999),\n (112.661266, 132.721307, 112.661266, 61.94999),\n (136.500025, 132.721307, 112.661266, 132.721307),\n (112.661266, 61.94999, 89.567467, 61.94999),\n (112.661266, 132.721307, 89.567467, 132.721307),\n (89.567467, 132.721307, 89.567467, 61.94999),\n (89.567467, 61.94999, 65.728708, 61.94999),\n (65.728708, 132.721307, 65.728708, 61.94999),\n (89.567467, 132.721307, 65.728708, 132.721307),\n (150.500025, 172.04999, 221.271343, 172.04999),\n (221.271343, 172.04999, 221.271343, 146.721307),\n (150.500025, 146.721307, 221.271343, 146.721307),\n (150.500025, 172.04999, 150.500025, 146.721307)\n]\nVISIBLE_CIRCLES = [\n\n]\nVISIBLE_ARCS = [\n\n]\nHIDDEN_SEGMENTS = [\n (150.5, 169.8151, 221.2713, 169.8151)\n]\n# (orient, text, p1, p2, base) for linear; (orient, text, center, radius, angle) for diameter\nDIMENSIONS = [\n ('vertical', '35.7895', (136.5, 172.05), (136.5, 146.7213), (147.5, 159.3857)),\n ('horizontal', '33.6842', (112.6613, 172.05), (136.5, 172.05), (124.5806, 183.05)),\n ('vertical', '3.1579', (112.6613, 169.8151), (112.6613, 172.05), (101.6613, 170.9326)),\n ('horizontal', '32.6316', (89.5675, 169.8151), (112.6613, 169.8151), (101.1144, 180.8151)),\n ('vertical', '3.1579', (89.5675, 172.05), (89.5675, 169.8151), (100.5675, 170.9326)),\n ('horizontal', '33.6842', (65.7287, 172.05), (89.5675, 172.05), (77.6481, 183.05)),\n ('vertical', '35.7895', (65.7287, 146.7213), (65.7287, 172.05), (54.7287, 159.3857)),\n ('horizontal', '100', (136.5, 146.7213), (65.7287, 146.7213), (101.1144, 135.7213)),\n ('horizontal', '100', (150.5, 146.7213), (221.2713, 146.7213), (185.8857, 157.7213))\n]\n\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\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\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,\n angle=(0 if d[0] == \"horizontal\" else 90),\n 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,\n text=text, dimstyle=\"EZDXF\").render()\n\n doc.saveas(out_path)\n\n\nif __name__ == \"__main__\":\n out = sys.argv[1] if len(sys.argv) > 1 else \"0047_00478168_gt.dxf\"\n draw(out)\n print(\"wrote\", out)\n```"}], "images": ["images/0047_00478168.png"], "id": "0047_00478168"} {"messages": [{"role": "user", "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 16.84 mm bounding box. It is extruded to a thickness of 62.5 mm."}, {"role": "assistant", "content": "```python\n#!/usr/bin/env python3\n# -*- coding: utf-8 -*-\n# Ground-truth 2D engineering drawing for part: 0048_00483282\n# Self-contained: reproduces the three-view DXF via ezdxf, NO FreeCAD needed.\n# Coordinates are A4 page millimetres (scale=0.9042461538461538, page=[297.0, 210.0]).\n# visible edges -> solid (layer OUTLINE); hidden edges -> dashed (layer HIDDEN)\n# dimensions -> real movable DIMENSION entities (text = true mm value)\n# Run: python 0048_00483282_gt.py [out.dxf]\nimport sys\nimport ezdxf\n\nSCALE = 0.9042461538461538\nPAGE = [297.0, 210.0]\n\nVISIBLE_SEGMENTS = [\n (153.454608, 141.787481, 153.454608, 147.49851),\n (153.454608, 147.49851, 110.621895, 147.49851),\n (110.621895, 147.49851, 110.621895, 162.727918),\n (110.621895, 162.727918, 105.862705, 162.727918),\n (105.862705, 162.727918, 105.862705, 147.49851),\n (105.862705, 147.49851, 63.029992, 147.49851),\n (63.029992, 147.49851, 63.029992, 141.787481),\n (63.029992, 141.787481, 153.454608, 141.787481),\n (153.454608, 127.787481, 153.454608, 71.272097),\n (153.454608, 71.272097, 110.621895, 71.272097),\n (153.454608, 127.787481, 110.621895, 127.787481),\n (110.621895, 127.787481, 110.621895, 71.272097),\n (110.621895, 71.272097, 105.862705, 71.272097),\n (105.862705, 127.787481, 105.862705, 71.272097),\n (110.621895, 127.787481, 105.862705, 127.787481),\n (105.862705, 71.272097, 63.029992, 71.272097),\n (63.029992, 127.787481, 63.029992, 71.272097),\n (105.862705, 127.787481, 63.029992, 127.787481),\n (167.454608, 162.727918, 223.969992, 162.727918),\n (223.969992, 162.727918, 223.969992, 147.49851),\n (167.454608, 162.727918, 167.454608, 147.49851),\n (167.454608, 147.49851, 223.969992, 147.49851),\n (223.969992, 147.49851, 223.969992, 141.787481),\n (167.454608, 141.787481, 223.969992, 141.787481),\n (167.454608, 147.49851, 167.454608, 141.787481)\n]\nVISIBLE_CIRCLES = [\n\n]\nVISIBLE_ARCS = [\n\n]\nHIDDEN_SEGMENTS = [\n\n]\n# (orient, text, p1, p2, base) for linear; (orient, text, center, radius, angle) for diameter\nDIMENSIONS = [\n ('vertical', '6.3158', (153.4546, 147.4985), (153.4546, 141.7875), (164.4546, 144.643)),\n ('horizontal', '47.3684', (110.6219, 147.4985), (153.4546, 147.4985), (132.0383, 158.4985)),\n ('vertical', '16.8421', (110.6219, 162.7279), (110.6219, 147.4985), (121.6219, 155.1132)),\n ('horizontal', '5.2632', (105.8627, 162.7279), (110.6219, 162.7279), (108.2423, 173.7279)),\n ('vertical', '16.8421', (105.8627, 147.4985), (105.8627, 162.7279), (94.8627, 155.1132)),\n ('horizontal', '47.3684', (63.03, 147.4985), (105.8627, 147.4985), (84.4463, 158.4985)),\n ('vertical', '6.3158', (63.03, 141.7875), (63.03, 147.4985), (52.03, 144.643)),\n ('horizontal', '100', (153.4546, 141.7875), (63.03, 141.7875), (108.2423, 130.7875)),\n ('horizontal', '62.5', (167.4546, 141.7875), (223.97, 141.7875), (195.7123, 152.7875))\n]\n\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\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\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,\n angle=(0 if d[0] == \"horizontal\" else 90),\n 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,\n text=text, dimstyle=\"EZDXF\").render()\n\n doc.saveas(out_path)\n\n\nif __name__ == \"__main__\":\n out = sys.argv[1] if len(sys.argv) > 1 else \"0048_00483282_gt.dxf\"\n draw(out)\n print(\"wrote\", out)\n```"}], "images": ["images/0048_00483282.png"], "id": "0048_00483282"} {"messages": [{"role": "user", "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 49.09 mm."}, {"role": "assistant", "content": "```python\n#!/usr/bin/env python3\n# -*- coding: utf-8 -*-\n# Ground-truth 2D engineering drawing for part: 0050_00500114\n# Self-contained: reproduces the three-view DXF via ezdxf, NO FreeCAD needed.\n# Coordinates are A4 page millimetres (scale=0.6445731707317337, page=[297.0, 210.0]).\n# visible edges -> solid (layer OUTLINE); hidden edges -> dashed (layer HIDDEN)\n# dimensions -> real movable DIMENSION entities (text = true mm value)\n# Run: python 0050_00500114_gt.py [out.dxf]\nimport sys\nimport ezdxf\n\nSCALE = 0.6445731707317337\nPAGE = [297.0, 210.0]\n\nVISIBLE_SEGMENTS = [\n (152.907309, 107.592694, 152.907309, 172.050011),\n (152.907309, 172.050011, 121.017899, 172.050011),\n (121.017899, 172.050011, 121.017899, 140.160601),\n (121.017899, 140.160601, 88.449992, 140.160601),\n (88.449992, 140.160601, 88.449992, 107.592694),\n (88.449992, 107.592694, 152.907309, 107.592694),\n (152.907309, 93.592694, 152.907309, 61.950011),\n (152.907309, 61.950011, 121.017899, 61.950011),\n (121.017899, 93.592694, 121.017899, 61.950011),\n (152.907309, 93.592694, 121.017899, 93.592694),\n (121.017899, 61.950011, 88.449992, 61.950011),\n (88.449992, 93.592694, 88.449992, 61.950011),\n (121.017899, 93.592694, 88.449992, 93.592694),\n (166.907309, 172.050011, 198.549992, 172.050011),\n (198.549992, 172.050011, 198.549992, 140.160601),\n (166.907309, 172.050011, 166.907309, 140.160601),\n (166.907309, 140.160601, 198.549992, 140.160601),\n (198.549992, 140.160601, 198.549992, 107.592694),\n (166.907309, 107.592694, 198.549992, 107.592694),\n (166.907309, 140.160601, 166.907309, 107.592694)\n]\nVISIBLE_CIRCLES = [\n\n]\nVISIBLE_ARCS = [\n\n]\nHIDDEN_SEGMENTS = [\n\n]\n# (orient, text, p1, p2, base) for linear; (orient, text, center, radius, angle) for diameter\nDIMENSIONS = [\n ('vertical', '100', (152.9073, 172.05), (152.9073, 107.5927), (163.9073, 139.8213)),\n ('horizontal', '49.4737', (121.0179, 172.05), (152.9073, 172.05), (136.9626, 183.05)),\n ('vertical', '49.4737', (121.0179, 140.1606), (121.0179, 172.05), (110.0179, 156.1053)),\n ('horizontal', '50.5263', (88.45, 140.1606), (121.0179, 140.1606), (104.734, 151.1606)),\n ('vertical', '50.5263', (88.45, 107.5927), (88.45, 140.1606), (77.45, 123.8766)),\n ('horizontal', '100', (152.9073, 107.5927), (88.45, 107.5927), (120.6786, 96.5927)),\n ('horizontal', '49.0909', (166.9073, 107.5927), (198.55, 107.5927), (182.7287, 118.5927))\n]\n\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\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\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,\n angle=(0 if d[0] == \"horizontal\" else 90),\n 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,\n text=text, dimstyle=\"EZDXF\").render()\n\n doc.saveas(out_path)\n\n\nif __name__ == \"__main__\":\n out = sys.argv[1] if len(sys.argv) > 1 else \"0050_00500114_gt.dxf\"\n draw(out)\n print(\"wrote\", out)\n```"}], "images": ["images/0050_00500114.png"], "id": "0050_00500114"} {"messages": [{"role": "user", "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 100 x 10.53 mm bounding box. It is extruded to a thickness of 5.49 mm."}, {"role": "assistant", "content": "```python\n#!/usr/bin/env python3\n# -*- coding: utf-8 -*-\n# Ground-truth 2D engineering drawing for part: 0051_00516185\n# Self-contained: reproduces the three-view DXF via ezdxf, NO FreeCAD needed.\n# Coordinates are A4 page millimetres (scale=0.7422357723577253, page=[297.0, 210.0]).\n# visible edges -> solid (layer OUTLINE); hidden edges -> dashed (layer HIDDEN)\n# dimensions -> real movable DIMENSION entities (text = true mm value)\n# Run: python 0051_00516185_gt.py [out.dxf]\nimport sys\nimport ezdxf\n\nSCALE = 0.7422357723577253\nPAGE = [297.0, 210.0]\n\nVISIBLE_SEGMENTS = [\n (171.572689, 115.10089, 97.349112, 115.10089),\n (171.572689, 115.10089, 171.572689, 122.913898),\n (171.572689, 122.913898, 166.884884, 122.913898),\n (166.884884, 122.913898, 166.884884, 129.945605),\n (166.884884, 129.945605, 171.572689, 129.945605),\n (171.572689, 129.945605, 171.572689, 136.977313),\n (97.349112, 136.977313, 171.572689, 136.977313),\n (97.349112, 136.977313, 97.349112, 129.945605),\n (97.349112, 129.945605, 102.036917, 129.945605),\n (102.036917, 129.945605, 102.036917, 122.913898),\n (102.036917, 122.913898, 97.349112, 122.913898),\n (97.349112, 122.913898, 97.349112, 115.10089),\n (171.572689, 101.10089, 171.572689, 97.022671),\n (97.349112, 97.022671, 171.572689, 97.022671),\n (97.349112, 101.10089, 97.349112, 97.022671),\n (171.572689, 101.10089, 97.349112, 101.10089),\n (185.572689, 115.10089, 189.650907, 115.10089),\n (185.572689, 136.977313, 189.650907, 136.977313),\n (189.650907, 136.977313, 189.650907, 129.945605),\n (185.572689, 129.945605, 189.650907, 129.945605),\n (185.572689, 136.977313, 185.572689, 129.945605),\n (189.650907, 129.945605, 189.650907, 122.913898),\n (185.572689, 129.945605, 185.572689, 122.913898),\n (185.572689, 122.913898, 189.650907, 122.913898),\n (189.650907, 122.913898, 189.650907, 115.10089),\n (185.572689, 122.913898, 185.572689, 115.10089)\n]\nVISIBLE_CIRCLES = [\n\n]\nVISIBLE_ARCS = [\n\n]\nHIDDEN_SEGMENTS = [\n (166.8849, 101.1009, 166.8849, 97.0227),\n (102.0369, 101.1009, 102.0369, 97.0227)\n]\n# (orient, text, p1, p2, base) for linear; (orient, text, center, radius, angle) for diameter\nDIMENSIONS = [\n ('vertical', '10.5263', (171.5727, 122.9139), (171.5727, 115.1009), (182.5727, 119.0074)),\n ('horizontal', '6.3158', (166.8849, 122.9139), (171.5727, 122.9139), (169.2288, 133.9139)),\n ('vertical', '9.4737', (166.8849, 129.9456), (166.8849, 122.9139), (177.8849, 126.4298)),\n ('horizontal', '6.3158', (171.5727, 129.9456), (166.8849, 129.9456), (169.2288, 118.9456)),\n ('vertical', '9.4737', (171.5727, 136.9773), (171.5727, 129.9456), (182.5727, 133.4615)),\n ('horizontal', '100', (97.3491, 136.9773), (171.5727, 136.9773), (134.4609, 147.9773)),\n ('vertical', '9.4737', (97.3491, 129.9456), (97.3491, 136.9773), (86.3491, 133.4615)),\n ('horizontal', '6.3158', (102.0369, 129.9456), (97.3491, 129.9456), (99.693, 118.9456)),\n ('vertical', '9.4737', (102.0369, 122.9139), (102.0369, 129.9456), (91.0369, 126.4298)),\n ('horizontal', '6.3158', (97.3491, 122.9139), (102.0369, 122.9139), (99.693, 133.9139)),\n ('vertical', '10.5263', (97.3491, 115.1009), (97.3491, 122.9139), (86.3491, 119.0074)),\n ('horizontal', '100', (171.5727, 115.1009), (97.3491, 115.1009), (134.4609, 104.1009)),\n ('horizontal', '5.4945', (185.5727, 115.1009), (189.6509, 115.1009), (187.6118, 126.1009))\n]\n\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\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\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,\n angle=(0 if d[0] == \"horizontal\" else 90),\n 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,\n text=text, dimstyle=\"EZDXF\").render()\n\n doc.saveas(out_path)\n\n\nif __name__ == \"__main__\":\n out = sys.argv[1] if len(sys.argv) > 1 else \"0051_00516185_gt.dxf\"\n draw(out)\n print(\"wrote\", out)\n```"}], "images": ["images/0051_00516185.png"], "id": "0051_00516185"} {"messages": [{"role": "user", "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 43.75 mm."}, {"role": "assistant", "content": "```python\n#!/usr/bin/env python3\n# -*- coding: utf-8 -*-\n# Ground-truth 2D engineering drawing for part: 0051_00518467\n# Self-contained: reproduces the three-view DXF via ezdxf, NO FreeCAD needed.\n# Coordinates are A4 page millimetres (scale=0.5125333333333333, page=[297.0, 210.0]).\n# visible edges -> solid (layer OUTLINE); hidden edges -> dashed (layer HIDDEN)\n# dimensions -> real movable DIMENSION entities (text = true mm value)\n# Run: python 0051_00518467_gt.py [out.dxf]\nimport sys\nimport ezdxf\n\nSCALE = 0.5125333333333333\nPAGE = [297.0, 210.0]\n\nVISIBLE_SEGMENTS = [\n (139.703318, 172.050012, 139.703318, 165.575907),\n (88.449985, 172.050012, 139.703318, 172.050012),\n (139.703318, 165.575907, 114.346406, 165.575907),\n (88.449985, 120.796679, 88.449985, 172.050012),\n (114.346406, 165.575907, 114.346406, 146.153591),\n (114.346406, 146.153591, 94.92409, 146.153591),\n (94.92409, 146.153591, 94.92409, 120.796679),\n (94.92409, 120.796679, 88.449985, 120.796679),\n (139.703318, 106.796679, 139.703318, 61.950012),\n (88.449985, 106.796679, 88.449985, 61.950012),\n (88.449985, 106.796679, 139.703318, 106.796679),\n (88.449985, 61.950012, 139.703318, 61.950012),\n (153.703318, 172.050012, 198.549985, 172.050012),\n (153.703318, 120.796679, 153.703318, 172.050012),\n (153.703318, 120.796679, 198.549985, 120.796679),\n (198.549985, 120.796679, 198.549985, 172.050012)\n]\nVISIBLE_CIRCLES = [\n\n]\nVISIBLE_ARCS = [\n\n]\nHIDDEN_SEGMENTS = [\n (114.3464, 61.95, 114.3464, 106.7967),\n (94.9241, 61.95, 94.9241, 106.7967),\n (198.55, 165.5759, 153.7033, 165.5759),\n (198.55, 146.1536, 153.7033, 146.1536)\n]\n# (orient, text, p1, p2, base) for linear; (orient, text, center, radius, angle) for diameter\nDIMENSIONS = [\n ('vertical', '12.6316', (139.7033, 165.5759), (139.7033, 172.05), (128.7033, 168.8129)),\n ('horizontal', '49.4737', (114.3464, 165.5759), (139.7033, 165.5759), (127.0249, 176.5759)),\n ('vertical', '37.8947', (114.3464, 146.1536), (114.3464, 165.5759), (103.3464, 155.8647)),\n ('horizontal', '37.8947', (94.9241, 146.1536), (114.3464, 146.1536), (104.6353, 157.1536)),\n ('vertical', '49.4737', (94.9241, 120.7967), (94.9241, 146.1536), (83.9241, 133.4751)),\n ('horizontal', '12.6316', (88.45, 120.7967), (94.9241, 120.7967), (91.6871, 131.7967)),\n ('vertical', '100', (88.45, 172.05), (88.45, 120.7967), (99.45, 146.4233)),\n ('horizontal', '100', (139.7033, 172.05), (88.45, 172.05), (114.0767, 161.05)),\n ('horizontal', '87.5', (198.55, 172.05), (153.7033, 172.05), (176.1267, 161.05))\n]\n\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\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\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,\n angle=(0 if d[0] == \"horizontal\" else 90),\n 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,\n text=text, dimstyle=\"EZDXF\").render()\n\n doc.saveas(out_path)\n\n\nif __name__ == \"__main__\":\n out = sys.argv[1] if len(sys.argv) > 1 else \"0051_00518467_gt.dxf\"\n draw(out)\n print(\"wrote\", out)\n```"}], "images": ["images/0051_00518467.png"], "id": "0051_00518467"} {"messages": [{"role": "user", "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 125.66 mm."}, {"role": "assistant", "content": "```python\n#!/usr/bin/env python3\n# -*- coding: utf-8 -*-\n# Ground-truth 2D engineering drawing for part: 0052_00527604\n# Self-contained: reproduces the three-view DXF via ezdxf, NO FreeCAD needed.\n# Coordinates are A4 page millimetres (scale=0.42585932004690397, page=[297.0, 210.0]).\n# visible edges -> solid (layer OUTLINE); hidden edges -> dashed (layer HIDDEN)\n# dimensions -> real movable DIMENSION entities (text = true mm value)\n# Run: python 0052_00527604_gt.py [out.dxf]\nimport sys\nimport ezdxf\n\nSCALE = 0.42585932004690397\nPAGE = [297.0, 210.0]\n\nVISIBLE_SEGMENTS = [\n (99.26548, 129.464074, 99.26548, 140.279549),\n (99.26548, 140.279549, 141.851412, 140.279549),\n (141.851412, 140.279549, 141.851412, 161.910498),\n (141.851412, 161.910498, 99.26548, 161.910498),\n (99.26548, 161.910498, 99.26548, 172.050006),\n (99.26548, 172.050006, 77.634531, 172.050006),\n (77.634531, 172.050006, 77.634531, 129.464074),\n (77.634531, 129.464074, 99.26548, 129.464074),\n (141.851412, 115.464074, 141.851412, 61.950006),\n (141.851412, 61.950006, 99.26548, 61.950006),\n (141.851412, 115.464074, 99.26548, 115.464074),\n (99.26548, 115.464074, 99.26548, 61.950006),\n (99.26548, 61.950006, 77.634531, 61.950006),\n (77.634531, 115.464074, 77.634531, 61.950006),\n (99.26548, 115.464074, 77.634531, 115.464074),\n (155.851412, 172.050006, 209.36548, 172.050006),\n (209.36548, 172.050006, 209.36548, 129.464074),\n (155.851412, 129.464074, 209.36548, 129.464074),\n (155.851412, 172.050006, 155.851412, 129.464074)\n]\nVISIBLE_CIRCLES = [\n\n]\nVISIBLE_ARCS = [\n\n]\nHIDDEN_SEGMENTS = [\n (155.8514, 140.2795, 209.3655, 140.2795),\n (155.8514, 161.9105, 209.3655, 161.9105)\n]\n# (orient, text, p1, p2, base) for linear; (orient, text, center, radius, angle) for diameter\nDIMENSIONS = [\n ('vertical', '25.3968', (99.2655, 140.2795), (99.2655, 129.4641), (110.2655, 134.8718)),\n ('horizontal', '100', (141.8514, 140.2795), (99.2655, 140.2795), (120.5585, 129.2795)),\n ('vertical', '50.7937', (141.8514, 161.9105), (141.8514, 140.2795), (152.8514, 151.095)),\n ('horizontal', '100', (99.2655, 161.9105), (141.8514, 161.9105), (120.5585, 172.9105)),\n ('vertical', '23.8095', (99.2655, 172.05), (99.2655, 161.9105), (110.2655, 166.9803)),\n ('horizontal', '50.7937', (77.6345, 172.05), (99.2655, 172.05), (88.45, 183.05)),\n ('vertical', '100', (77.6345, 129.4641), (77.6345, 172.05), (66.6345, 150.757)),\n ('horizontal', '50.7937', (99.2655, 129.4641), (77.6345, 129.4641), (88.45, 118.4641)),\n ('horizontal', '125.661', (155.8514, 129.4641), (209.3655, 129.4641), (182.6084, 140.4641))\n]\n\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\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\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,\n angle=(0 if d[0] == \"horizontal\" else 90),\n 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,\n text=text, dimstyle=\"EZDXF\").render()\n\n doc.saveas(out_path)\n\n\nif __name__ == \"__main__\":\n out = sys.argv[1] if len(sys.argv) > 1 else \"0052_00527604_gt.dxf\"\n draw(out)\n print(\"wrote\", out)\n```"}], "images": ["images/0052_00527604.png"], "id": "0052_00527604"} {"messages": [{"role": "user", "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 80 x 100 mm bounding box. It is extruded to a thickness of 121.15 mm."}, {"role": "assistant", "content": "```python\n#!/usr/bin/env python3\n# -*- coding: utf-8 -*-\n# Ground-truth 2D engineering drawing for part: 0053_00530310\n# Self-contained: reproduces the three-view DXF via ezdxf, NO FreeCAD needed.\n# Coordinates are A4 page millimetres (scale=0.5338888888889096, page=[297.0, 210.0]).\n# visible edges -> solid (layer OUTLINE); hidden edges -> dashed (layer HIDDEN)\n# dimensions -> real movable DIMENSION entities (text = true mm value)\n# Run: python 0053_00530310_gt.py [out.dxf]\nimport sys\nimport ezdxf\n\nSCALE = 0.5338888888889096\nPAGE = [297.0, 210.0]\n\nVISIBLE_SEGMENTS = [\n (125.514205, 129.6469, 125.514205, 183.035789),\n (125.514205, 183.035789, 114.836427, 183.035789),\n (114.836427, 183.035789, 114.836427, 171.796023),\n (114.836427, 171.796023, 93.480872, 171.796023),\n (93.480872, 171.796023, 93.480872, 183.035789),\n (93.480872, 183.035789, 82.803094, 183.035789),\n (82.803094, 183.035789, 82.803094, 129.6469),\n (82.803094, 129.6469, 125.514205, 129.6469),\n (125.514205, 115.6469, 125.514205, 50.964208),\n (125.514205, 50.964208, 114.836427, 50.964208),\n (114.836427, 115.6469, 114.836427, 50.964208),\n (125.514205, 115.6469, 114.836427, 115.6469),\n (114.836427, 50.964208, 93.480872, 50.964208),\n (114.836427, 115.6469, 93.480872, 115.6469),\n (93.480872, 115.6469, 93.480872, 50.964208),\n (93.480872, 50.964208, 82.803094, 50.964208),\n (82.803094, 115.6469, 82.803094, 50.964208),\n (93.480872, 115.6469, 82.803094, 115.6469),\n (139.514205, 183.035789, 204.196898, 183.035789),\n (204.196898, 183.035789, 204.196898, 129.6469),\n (139.514205, 129.6469, 204.196898, 129.6469),\n (139.514205, 183.035789, 139.514205, 129.6469)\n]\nVISIBLE_CIRCLES = [\n\n]\nVISIBLE_ARCS = [\n\n]\nHIDDEN_SEGMENTS = [\n (139.5142, 171.796, 204.1969, 171.796)\n]\n# (orient, text, p1, p2, base) for linear; (orient, text, center, radius, angle) for diameter\nDIMENSIONS = [\n ('vertical', '100', (125.5142, 183.0358), (125.5142, 129.6469), (136.5142, 156.3414)),\n ('horizontal', '20', (114.8364, 183.0358), (125.5142, 183.0358), (120.1753, 194.0358)),\n ('vertical', '21.0526', (114.8364, 171.796), (114.8364, 183.0358), (103.8364, 177.4159)),\n ('horizontal', '40', (93.4809, 171.796), (114.8364, 171.796), (104.1586, 182.796)),\n ('vertical', '21.0526', (93.4809, 183.0358), (93.4809, 171.796), (104.4809, 177.4159)),\n ('horizontal', '20', (82.8031, 183.0358), (93.4809, 183.0358), (88.142, 194.0358)),\n ('vertical', '100', (82.8031, 129.6469), (82.8031, 183.0358), (71.8031, 156.3414)),\n ('horizontal', '80', (125.5142, 129.6469), (82.8031, 129.6469), (104.1586, 118.6469)),\n ('horizontal', '121.154', (139.5142, 129.6469), (204.1969, 129.6469), (171.8555, 140.6469))\n]\n\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\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\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,\n angle=(0 if d[0] == \"horizontal\" else 90),\n 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,\n text=text, dimstyle=\"EZDXF\").render()\n\n doc.saveas(out_path)\n\n\nif __name__ == \"__main__\":\n out = sys.argv[1] if len(sys.argv) > 1 else \"0053_00530310_gt.dxf\"\n draw(out)\n print(\"wrote\", out)\n```"}], "images": ["images/0053_00530310.png"], "id": "0053_00530310"} {"messages": [{"role": "user", "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 100 x 55.26 mm bounding box. It is extruded to a thickness of 24.74 mm."}, {"role": "assistant", "content": "```python\n#!/usr/bin/env python3\n# -*- coding: utf-8 -*-\n# Ground-truth 2D engineering drawing for part: 0054_00545977\n# Self-contained: reproduces the three-view DXF via ezdxf, NO FreeCAD needed.\n# Coordinates are A4 page millimetres (scale=0.4813551724137929, page=[297.0, 210.0]).\n# visible edges -> solid (layer OUTLINE); hidden edges -> dashed (layer HIDDEN)\n# dimensions -> real movable DIMENSION entities (text = true mm value)\n# Run: python 0054_00545977_gt.py [out.dxf]\nimport sys\nimport ezdxf\n\nSCALE = 0.4813551724137929\nPAGE = [297.0, 210.0]\n\nVISIBLE_SEGMENTS = [\n (118.511855, 143.254889, 118.511855, 135.654544),\n (118.511855, 135.654544, 142.579614, 135.654544),\n (142.579614, 135.654544, 142.579614, 143.254889),\n (142.579614, 143.254889, 190.715131, 143.254889),\n (190.715131, 143.254889, 190.715131, 116.653682),\n (190.715131, 116.653682, 142.579614, 116.653682),\n (142.579614, 116.653682, 142.579614, 124.254027),\n (142.579614, 124.254027, 118.511855, 124.254027),\n (118.511855, 124.254027, 118.511855, 116.653682),\n (118.511855, 116.653682, 70.376338, 116.653682),\n (70.376338, 116.653682, 70.376338, 143.254889),\n (70.376338, 143.254889, 118.511855, 143.254889),\n (118.511855, 90.745155, 118.511855, 102.653682),\n (118.511855, 102.653682, 142.579614, 102.653682),\n (118.511855, 90.745155, 142.579614, 90.745155),\n (142.579614, 90.745155, 142.579614, 102.653682),\n (142.579614, 102.653682, 190.715131, 102.653682),\n (190.715131, 90.745155, 190.715131, 102.653682),\n (142.579614, 90.745155, 190.715131, 90.745155),\n (70.376338, 90.745155, 70.376338, 102.653682),\n (70.376338, 102.653682, 118.511855, 102.653682),\n (70.376338, 90.745155, 118.511855, 90.745155),\n (216.623657, 116.653682, 204.715131, 116.653682),\n (204.715131, 116.653682, 204.715131, 143.254889),\n (216.623657, 143.254889, 204.715131, 143.254889),\n (216.623657, 116.653682, 216.623657, 143.254889)\n]\nVISIBLE_CIRCLES = [\n\n]\nVISIBLE_ARCS = [\n\n]\nHIDDEN_SEGMENTS = [\n (216.6237, 135.6545, 204.7151, 135.6545),\n (216.6237, 124.254, 204.7151, 124.254)\n]\n# (orient, text, p1, p2, base) for linear; (orient, text, center, radius, angle) for diameter\nDIMENSIONS = [\n ('vertical', '15.7895', (118.5119, 135.6545), (118.5119, 143.2549), (107.5119, 139.4547)),\n ('horizontal', '50', (142.5796, 135.6545), (118.5119, 135.6545), (130.5457, 124.6545)),\n ('vertical', '15.7895', (142.5796, 143.2549), (142.5796, 135.6545), (153.5796, 139.4547)),\n ('horizontal', '100', (190.7151, 143.2549), (142.5796, 143.2549), (166.6474, 132.2549)),\n ('vertical', '55.2632', (190.7151, 116.6537), (190.7151, 143.2549), (179.7151, 129.9543)),\n ('horizontal', '100', (142.5796, 116.6537), (190.7151, 116.6537), (166.6474, 127.6537)),\n ('vertical', '15.7895', (142.5796, 124.254), (142.5796, 116.6537), (153.5796, 120.4538)),\n ('horizontal', '50', (118.5119, 124.254), (142.5796, 124.254), (130.5457, 135.254)),\n ('vertical', '15.7895', (118.5119, 116.6537), (118.5119, 124.254), (107.5119, 120.4538)),\n ('horizontal', '100', (70.3763, 116.6537), (118.5119, 116.6537), (94.4441, 127.6537)),\n ('vertical', '55.2632', (70.3763, 143.2549), (70.3763, 116.6537), (81.3763, 129.9543)),\n ('horizontal', '100', (118.5119, 143.2549), (70.3763, 143.2549), (94.4441, 132.2549)),\n ('horizontal', '24.7396', (216.6237, 143.2549), (204.7151, 143.2549), (210.6694, 132.2549))\n]\n\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\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\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,\n angle=(0 if d[0] == \"horizontal\" else 90),\n 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,\n text=text, dimstyle=\"EZDXF\").render()\n\n doc.saveas(out_path)\n\n\nif __name__ == \"__main__\":\n out = sys.argv[1] if len(sys.argv) > 1 else \"0054_00545977_gt.dxf\"\n draw(out)\n print(\"wrote\", out)\n```"}], "images": ["images/0054_00545977.png"], "id": "0054_00545977"} {"messages": [{"role": "user", "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 100 x 15.79 mm bounding box. It is extruded to a thickness of 3.12 mm."}, {"role": "assistant", "content": "```python\n#!/usr/bin/env python3\n# -*- coding: utf-8 -*-\n# Ground-truth 2D engineering drawing for part: 0055_00556720\n# Self-contained: reproduces the three-view DXF via ezdxf, NO FreeCAD needed.\n# Coordinates are A4 page millimetres (scale=0.652107142857141, page=[297.0, 210.0]).\n# visible edges -> solid (layer OUTLINE); hidden edges -> dashed (layer HIDDEN)\n# dimensions -> real movable DIMENSION entities (text = true mm value)\n# Run: python 0055_00556720_gt.py [out.dxf]\nimport sys\nimport ezdxf\n\nSCALE = 0.652107142857141\nPAGE = [297.0, 210.0]\n\nVISIBLE_SEGMENTS = [\n (167.067508, 110.593178, 101.856794, 110.593178),\n (167.067508, 110.593178, 167.067508, 120.889606),\n (167.067508, 120.889606, 162.948937, 120.889606),\n (162.948937, 120.889606, 162.948937, 131.186035),\n (162.948937, 131.186035, 167.067508, 131.186035),\n (167.067508, 131.186035, 167.067508, 141.482463),\n (167.067508, 141.482463, 101.856794, 141.482463),\n (101.856794, 141.482463, 101.856794, 131.186035),\n (101.856794, 131.186035, 105.975365, 131.186035),\n (105.975365, 131.186035, 105.975365, 120.889606),\n (105.975365, 120.889606, 101.856794, 120.889606),\n (101.856794, 120.889606, 101.856794, 110.593178),\n (167.067508, 92.517508, 101.856794, 92.517508),\n (101.856794, 96.593178, 167.067508, 96.593178),\n (167.067508, 96.593178, 167.067508, 92.517508),\n (101.856794, 96.593178, 101.856794, 92.517508),\n (185.143178, 110.593178, 181.067508, 110.593178),\n (185.143178, 141.482463, 185.143178, 131.186035),\n (185.143178, 131.186035, 185.143178, 120.889606),\n (185.143178, 120.889606, 185.143178, 110.593178),\n (185.143178, 120.889606, 181.067508, 120.889606),\n (181.067508, 120.889606, 181.067508, 110.593178),\n (181.067508, 141.482463, 181.067508, 131.186035),\n (181.067508, 131.186035, 181.067508, 120.889606),\n (181.067508, 141.482463, 185.143178, 141.482463),\n (181.067508, 131.186035, 185.143178, 131.186035)\n]\nVISIBLE_CIRCLES = [\n\n]\nVISIBLE_ARCS = [\n\n]\nHIDDEN_SEGMENTS = [\n (162.949, 96.5932, 162.949, 92.5175),\n (105.9754, 96.5932, 105.9754, 92.5175)\n]\n# (orient, text, p1, p2, base) for linear; (orient, text, center, radius, angle) for diameter\nDIMENSIONS = [\n ('vertical', '15.7895', (167.0675, 120.8896), (167.0675, 110.5932), (178.0675, 115.7414)),\n ('horizontal', '6.3158', (162.9489, 120.8896), (167.0675, 120.8896), (165.0082, 131.8896)),\n ('vertical', '15.7895', (162.9489, 131.186), (162.9489, 120.8896), (173.9489, 126.0378)),\n ('horizontal', '6.3158', (167.0675, 131.186), (162.9489, 131.186), (165.0082, 120.186)),\n ('vertical', '15.7895', (167.0675, 141.4825), (167.0675, 131.186), (178.0675, 136.3342)),\n ('horizontal', '100', (101.8568, 141.4825), (167.0675, 141.4825), (134.4622, 152.4825)),\n ('vertical', '15.7895', (101.8568, 131.186), (101.8568, 141.4825), (90.8568, 136.3342)),\n ('horizontal', '6.3158', (105.9754, 131.186), (101.8568, 131.186), (103.9161, 120.186)),\n ('vertical', '15.7895', (105.9754, 120.8896), (105.9754, 131.186), (94.9754, 126.0378)),\n ('horizontal', '6.3158', (101.8568, 120.8896), (105.9754, 120.8896), (103.9161, 131.8896)),\n ('vertical', '15.7895', (101.8568, 110.5932), (101.8568, 120.8896), (90.8568, 115.7414)),\n ('horizontal', '100', (167.0675, 110.5932), (101.8568, 110.5932), (134.4622, 99.5932)),\n ('horizontal', '6.25', (181.0675, 110.5932), (185.1432, 110.5932), (183.1054, 121.5932))\n]\n\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\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\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,\n angle=(0 if d[0] == \"horizontal\" else 90),\n 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,\n text=text, dimstyle=\"EZDXF\").render()\n\n doc.saveas(out_path)\n\n\nif __name__ == \"__main__\":\n out = sys.argv[1] if len(sys.argv) > 1 else \"0055_00556720_gt.dxf\"\n draw(out)\n print(\"wrote\", out)\n```"}], "images": ["images/0055_00556720.png"], "id": "0055_00556720"} {"messages": [{"role": "user", "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 50.79 mm bounding box. It is extruded to a thickness of 50.26 mm."}, {"role": "assistant", "content": "```python\n#!/usr/bin/env python3\n# -*- coding: utf-8 -*-\n# Ground-truth 2D engineering drawing for part: 0055_00558169\n# Self-contained: reproduces the three-view DXF via ezdxf, NO FreeCAD needed.\n# Coordinates are A4 page millimetres (scale=0.5859000000000018, page=[297.0, 210.0]).\n# visible edges -> solid (layer OUTLINE); hidden edges -> dashed (layer HIDDEN)\n# dimensions -> real movable DIMENSION entities (text = true mm value)\n# Run: python 0055_00558169_gt.py [out.dxf]\nimport sys\nimport ezdxf\n\nSCALE = 0.5859000000000018\nPAGE = [297.0, 210.0]\n\nVISIBLE_SEGMENTS = [\n (136.19, 168.02, 136.19, 138.26),\n (136.19, 138.26, 165.95, 138.26),\n (165.95, 138.26, 165.95, 109.43),\n (165.95, 109.43, 107.36, 109.43),\n (107.36, 109.43, 107.36, 138.26),\n (107.36, 138.26, 77.6, 138.26),\n (77.6, 138.26, 77.6, 168.02),\n (77.6, 168.02, 136.19, 168.02),\n (136.19, 65.98, 136.19, 95.43),\n (136.19, 95.43, 165.95, 95.43),\n (165.95, 65.98, 165.95, 95.43),\n (136.19, 65.98, 165.95, 65.98),\n (77.6, 65.98, 77.6, 95.43),\n (77.6, 95.43, 136.19, 95.43),\n (77.6, 65.98, 136.19, 65.98),\n (209.4, 109.43, 179.95, 109.43),\n (179.95, 109.43, 179.95, 138.26),\n (209.4, 109.43, 209.4, 138.26),\n (209.4, 138.26, 179.95, 138.26),\n (179.95, 138.26, 179.95, 168.02),\n (209.4, 168.02, 179.95, 168.02),\n (209.4, 138.26, 209.4, 168.02)\n]\nVISIBLE_CIRCLES = [\n\n]\nVISIBLE_ARCS = [\n\n]\nHIDDEN_SEGMENTS = [\n (107.36, 65.98, 107.36, 95.43)\n]\n# (orient, text, p1, p2, base) for linear; (orient, text, center, radius, angle) for diameter\nDIMENSIONS = [\n ('vertical', '50.7937', (136.19, 138.26), (136.19, 168.02), (125.19, 153.14)),\n ('horizontal', '50.7937', (165.95, 138.26), (136.19, 138.26), (151.07, 127.26)),\n ('vertical', '49.2063', (165.95, 109.43), (165.95, 138.26), (154.95, 123.845)),\n ('horizontal', '100', (107.36, 109.43), (165.95, 109.43), (136.655, 120.43)),\n ('vertical', '49.2063', (107.36, 138.26), (107.36, 109.43), (118.36, 123.845)),\n ('horizontal', '50.7937', (77.6, 138.26), (107.36, 138.26), (92.48, 149.26)),\n ('vertical', '50.7937', (77.6, 168.02), (77.6, 138.26), (88.6, 153.14)),\n ('horizontal', '100', (136.19, 168.02), (77.6, 168.02), (106.895, 157.02)),\n ('horizontal', '50.2646', (209.4, 168.02), (179.95, 168.02), (194.675, 157.02))\n]\n\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\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\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,\n angle=(0 if d[0] == \"horizontal\" else 90),\n 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,\n text=text, dimstyle=\"EZDXF\").render()\n\n doc.saveas(out_path)\n\n\nif __name__ == \"__main__\":\n out = sys.argv[1] if len(sys.argv) > 1 else \"0055_00558169_gt.dxf\"\n draw(out)\n print(\"wrote\", out)\n```"}], "images": ["images/0055_00558169.png"], "id": "0055_00558169"} {"messages": [{"role": "user", "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 76.84 x 100 mm bounding box. It is extruded to a thickness of 33.33 mm."}, {"role": "assistant", "content": "```python\n#!/usr/bin/env python3\n# -*- coding: utf-8 -*-\n# Ground-truth 2D engineering drawing for part: 0057_00578940\n# Self-contained: reproduces the three-view DXF via ezdxf, NO FreeCAD needed.\n# Coordinates are A4 page millimetres (scale=0.7207500000000019, page=[297.0, 210.0]).\n# visible edges -> solid (layer OUTLINE); hidden edges -> dashed (layer HIDDEN)\n# dimensions -> real movable DIMENSION entities (text = true mm value)\n# Run: python 0057_00578940_gt.py [out.dxf]\nimport sys\nimport ezdxf\n\nSCALE = 0.7207500000000019\nPAGE = [297.0, 210.0]\n\nVISIBLE_SEGMENTS = [\n (152.179517, 99.975, 152.179517, 172.05),\n (152.179517, 172.05, 96.79557, 172.05),\n (96.79557, 172.05, 96.79557, 147.772105),\n (96.79557, 147.772105, 115.762675, 147.772105),\n (115.762675, 147.772105, 115.762675, 124.252895),\n (115.762675, 124.252895, 96.79557, 124.252895),\n (96.79557, 124.252895, 96.79557, 99.975),\n (96.79557, 99.975, 152.179517, 99.975),\n (152.179517, 85.975, 152.179517, 61.95),\n (152.179517, 61.95, 96.79557, 61.95),\n (96.79557, 85.975, 96.79557, 61.95),\n (152.179517, 85.975, 96.79557, 85.975),\n (166.179517, 172.05, 190.204517, 172.05),\n (190.204517, 172.05, 190.204517, 147.772105),\n (166.179517, 147.772105, 190.204517, 147.772105),\n (166.179517, 172.05, 166.179517, 147.772105),\n (190.204517, 147.772105, 190.204517, 124.252895),\n (166.179517, 147.772105, 166.179517, 124.252895),\n (166.179517, 124.252895, 190.204517, 124.252895),\n (190.204517, 124.252895, 190.204517, 99.975),\n (166.179517, 99.975, 190.204517, 99.975),\n (166.179517, 124.252895, 166.179517, 99.975)\n]\nVISIBLE_CIRCLES = [\n\n]\nVISIBLE_ARCS = [\n\n]\nHIDDEN_SEGMENTS = [\n (115.7626, 85.975, 115.7626, 61.95)\n]\n# (orient, text, p1, p2, base) for linear; (orient, text, center, radius, angle) for diameter\nDIMENSIONS = [\n ('vertical', '100', (152.1795, 172.05), (152.1795, 99.975), (163.1795, 136.0125)),\n ('horizontal', '76.8421', (96.7956, 172.05), (152.1795, 172.05), (124.4875, 183.05)),\n ('vertical', '33.6842', (96.7956, 147.7721), (96.7956, 172.05), (85.7956, 159.9111)),\n ('horizontal', '26.3158', (115.7627, 147.7721), (96.7956, 147.7721), (106.2791, 136.7721)),\n ('vertical', '32.6316', (115.7627, 124.2529), (115.7627, 147.7721), (104.7627, 136.0125)),\n ('horizontal', '26.3158', (96.7956, 124.2529), (115.7627, 124.2529), (106.2791, 135.2529)),\n ('vertical', '33.6842', (96.7956, 99.975), (96.7956, 124.2529), (85.7956, 112.1139)),\n ('horizontal', '76.8421', (152.1795, 99.975), (96.7956, 99.975), (124.4875, 88.975)),\n ('horizontal', '33.3333', (166.1795, 99.975), (190.2044, 99.975), (178.192, 110.975))\n]\n\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\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\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,\n angle=(0 if d[0] == \"horizontal\" else 90),\n 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,\n text=text, dimstyle=\"EZDXF\").render()\n\n doc.saveas(out_path)\n\n\nif __name__ == \"__main__\":\n out = sys.argv[1] if len(sys.argv) > 1 else \"0057_00578940_gt.dxf\"\n draw(out)\n print(\"wrote\", out)\n```"}], "images": ["images/0057_00578940.png"], "id": "0057_00578940"} {"messages": [{"role": "user", "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 33.68 mm bounding box. It is extruded to a thickness of 50 mm."}, {"role": "assistant", "content": "```python\n#!/usr/bin/env python3\n# -*- coding: utf-8 -*-\n# Ground-truth 2D engineering drawing for part: 0059_00596690\n# Self-contained: reproduces the three-view DXF via ezdxf, NO FreeCAD needed.\n# Coordinates are A4 page millimetres (scale=1.0991574803149589, page=[297.0, 210.0]).\n# visible edges -> solid (layer OUTLINE); hidden edges -> dashed (layer HIDDEN)\n# dimensions -> real movable DIMENSION entities (text = true mm value)\n# Run: python 0059_00596690_gt.py [out.dxf]\nimport sys\nimport ezdxf\n\nSCALE = 1.0991574803149589\nPAGE = [297.0, 210.0]\n\nVISIBLE_SEGMENTS = [\n (163.978921, 169.991069, 163.978921, 151.478944),\n (163.978921, 151.478944, 72.575299, 151.478944),\n (72.575299, 151.478944, 72.575299, 132.966818),\n (72.575299, 132.966818, 54.063173, 132.966818),\n (54.063173, 132.966818, 54.063173, 169.991069),\n (54.063173, 169.991069, 163.978921, 169.991069),\n (163.978921, 64.008944, 163.978921, 118.966818),\n (54.063173, 64.008944, 54.063173, 118.966818),\n (54.063173, 118.966818, 163.978921, 118.966818),\n (54.063173, 64.008944, 163.978921, 64.008944),\n (232.936795, 132.966818, 177.978921, 132.966818),\n (177.978921, 132.966818, 177.978921, 169.991069),\n (232.936795, 169.991069, 177.978921, 169.991069),\n (232.936795, 132.966818, 232.936795, 169.991069)\n]\nVISIBLE_CIRCLES = [\n\n]\nVISIBLE_ARCS = [\n\n]\nHIDDEN_SEGMENTS = [\n (72.5753, 64.0089, 72.5753, 118.9668),\n (232.9368, 151.4789, 177.9789, 151.4789)\n]\n# (orient, text, p1, p2, base) for linear; (orient, text, center, radius, angle) for diameter\nDIMENSIONS = [\n ('vertical', '16.8421', (163.9789, 151.4789), (163.9789, 169.9911), (152.9789, 160.735)),\n ('horizontal', '83.1579', (72.5753, 151.4789), (163.9789, 151.4789), (118.2771, 162.4789)),\n ('vertical', '16.8421', (72.5753, 132.9668), (72.5753, 151.4789), (61.5753, 142.2229)),\n ('horizontal', '16.8421', (54.0632, 132.9668), (72.5753, 132.9668), (63.3192, 143.9668)),\n ('vertical', '33.6842', (54.0632, 169.9911), (54.0632, 132.9668), (65.0632, 151.4789)),\n ('horizontal', '100', (163.9789, 169.9911), (54.0632, 169.9911), (109.0211, 158.9911)),\n ('horizontal', '50', (232.9368, 169.9911), (177.9789, 169.9911), (205.4579, 158.9911))\n]\n\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\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\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,\n angle=(0 if d[0] == \"horizontal\" else 90),\n 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,\n text=text, dimstyle=\"EZDXF\").render()\n\n doc.saveas(out_path)\n\n\nif __name__ == \"__main__\":\n out = sys.argv[1] if len(sys.argv) > 1 else \"0059_00596690_gt.dxf\"\n draw(out)\n print(\"wrote\", out)\n```"}], "images": ["images/0059_00596690.png"], "id": "0059_00596690"} {"messages": [{"role": "user", "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 9.47 mm bounding box. It is extruded to a thickness of 37.5 mm."}, {"role": "assistant", "content": "```python\n#!/usr/bin/env python3\n# -*- coding: utf-8 -*-\n# Ground-truth 2D engineering drawing for part: 0060_00600243\n# Self-contained: reproduces the three-view DXF via ezdxf, NO FreeCAD needed.\n# Coordinates are A4 page millimetres (scale=1.3046074766354956, page=[297.0, 210.0]).\n# visible edges -> solid (layer OUTLINE); hidden edges -> dashed (layer HIDDEN)\n# dimensions -> real movable DIMENSION entities (text = true mm value)\n# Run: python 0060_00600243_gt.py [out.dxf]\nimport sys\nimport ezdxf\n\nSCALE = 1.3046074766354956\nPAGE = [297.0, 210.0]\n\nVISIBLE_SEGMENTS = [\n (46.808233, 156.701006, 177.268981, 156.701006),\n (177.268981, 156.701006, 177.268981, 144.341567),\n (177.268981, 144.341567, 140.190663, 144.341567),\n (140.190663, 144.341567, 140.190663, 140.221754),\n (140.190663, 140.221754, 83.886551, 140.221754),\n (83.886551, 140.221754, 83.886551, 144.341567),\n (83.886551, 144.341567, 46.808233, 144.341567),\n (46.808233, 144.341567, 46.808233, 156.701006),\n (177.268981, 77.298973, 177.268981, 126.221754),\n (46.808233, 77.298973, 177.268981, 77.298973),\n (46.808233, 77.298973, 46.808233, 126.221754),\n (177.268981, 126.221754, 46.808233, 126.221754),\n (240.191761, 156.701006, 191.268981, 156.701006),\n (240.191761, 140.221754, 191.268981, 140.221754),\n (191.268981, 140.221754, 191.268981, 144.341567),\n (240.191761, 140.221754, 240.191761, 144.341567),\n (240.191761, 144.341567, 191.268981, 144.341567),\n (191.268981, 144.341567, 191.268981, 156.701006),\n (240.191761, 144.341567, 240.191761, 156.701006)\n]\nVISIBLE_CIRCLES = [\n\n]\nVISIBLE_ARCS = [\n\n]\nHIDDEN_SEGMENTS = [\n (140.1907, 77.299, 140.1907, 126.2218),\n (83.8866, 77.299, 83.8866, 126.2218)\n]\n# (orient, text, p1, p2, base) for linear; (orient, text, center, radius, angle) for diameter\nDIMENSIONS = [\n ('vertical', '9.4737', (177.269, 144.3416), (177.269, 156.701), (166.269, 150.5213)),\n ('horizontal', '28.4211', (140.1906, 144.3416), (177.269, 144.3416), (158.7298, 155.3416)),\n ('vertical', '3.1579', (140.1906, 140.2217), (140.1906, 144.3416), (129.1906, 142.2816)),\n ('horizontal', '43.1579', (83.8866, 140.2217), (140.1906, 140.2217), (112.0386, 151.2217)),\n ('vertical', '3.1579', (83.8866, 144.3416), (83.8866, 140.2217), (94.8866, 142.2816)),\n ('horizontal', '28.4211', (46.8082, 144.3416), (83.8866, 144.3416), (65.3474, 155.3416)),\n ('vertical', '9.4737', (46.8082, 156.701), (46.8082, 144.3416), (57.8082, 150.5213)),\n ('horizontal', '100', (177.269, 156.701), (46.8082, 156.701), (112.0386, 145.701)),\n ('horizontal', '37.5', (240.1918, 156.701), (191.269, 156.701), (215.7304, 145.701))\n]\n\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\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\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,\n angle=(0 if d[0] == \"horizontal\" else 90),\n 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,\n text=text, dimstyle=\"EZDXF\").render()\n\n doc.saveas(out_path)\n\n\nif __name__ == \"__main__\":\n out = sys.argv[1] if len(sys.argv) > 1 else \"0060_00600243_gt.dxf\"\n draw(out)\n print(\"wrote\", out)\n```"}], "images": ["images/0060_00600243.png"], "id": "0060_00600243"} {"messages": [{"role": "user", "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 10.53 mm tall. It is extruded to a thickness of 1.04 mm."}, {"role": "assistant", "content": "```python\n#!/usr/bin/env python3\n# -*- coding: utf-8 -*-\n# Ground-truth 2D engineering drawing for part: 0061_00614362\n# Self-contained: reproduces the three-view DXF via ezdxf, NO FreeCAD needed.\n# Coordinates are A4 page millimetres (scale=1.329457142857151, page=[297.0, 210.0]).\n# visible edges -> solid (layer OUTLINE); hidden edges -> dashed (layer HIDDEN)\n# dimensions -> real movable DIMENSION entities (text = true mm value)\n# Run: python 0061_00614362_gt.py [out.dxf]\nimport sys\nimport ezdxf\n\nSCALE = 1.329457142857151\nPAGE = [297.0, 210.0]\n\nVISIBLE_SEGMENTS = [\n (202.280413, 131.689529, 202.280413, 117.695243),\n (202.280413, 117.695243, 69.334699, 117.695243),\n (69.334699, 117.695243, 69.334699, 131.689529),\n (69.334699, 131.689529, 202.280413, 131.689529),\n (202.280413, 102.310392, 202.280413, 103.695243),\n (69.334699, 102.310392, 69.334699, 103.695243),\n (69.334699, 103.695243, 202.280413, 103.695243),\n (69.334699, 102.310392, 202.280413, 102.310392),\n (217.665264, 117.695243, 216.280413, 117.695243),\n (216.280413, 117.695243, 216.280413, 131.689529),\n (217.665264, 131.689529, 216.280413, 131.689529),\n (217.665264, 117.695243, 217.665264, 131.689529)\n]\nVISIBLE_CIRCLES = [\n\n]\nVISIBLE_ARCS = [\n\n]\nHIDDEN_SEGMENTS = [\n\n]\n# (orient, text, p1, p2, base) for linear; (orient, text, center, radius, angle) for diameter\nDIMENSIONS = [\n ('vertical', '10.5263', (202.2804, 117.6953), (202.2804, 131.6895), (191.2804, 124.6924)),\n ('horizontal', '100', (69.3347, 117.6953), (202.2804, 117.6953), (135.8076, 128.6953)),\n ('vertical', '10.5263', (69.3347, 131.6895), (69.3347, 117.6953), (80.3347, 124.6924)),\n ('horizontal', '100', (202.2804, 131.6895), (69.3347, 131.6895), (135.8076, 120.6895)),\n ('horizontal', '1.0417', (217.6653, 131.6895), (216.2804, 131.6895), (216.9728, 120.6895))\n]\n\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\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\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,\n angle=(0 if d[0] == \"horizontal\" else 90),\n 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,\n text=text, dimstyle=\"EZDXF\").render()\n\n doc.saveas(out_path)\n\n\nif __name__ == \"__main__\":\n out = sys.argv[1] if len(sys.argv) > 1 else \"0061_00614362_gt.dxf\"\n draw(out)\n print(\"wrote\", out)\n```"}], "images": ["images/0061_00614362.png"], "id": "0061_00614362"} {"messages": [{"role": "user", "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 100 x 20 mm bounding box. It is extruded to a thickness of 15.46 mm."}, {"role": "assistant", "content": "```python\n#!/usr/bin/env python3\n# -*- coding: utf-8 -*-\n# Ground-truth 2D engineering drawing for part: 0063_00636993\n# Self-contained: reproduces the three-view DXF via ezdxf, NO FreeCAD needed.\n# Coordinates are A4 page millimetres (scale=1.0948330827067696, page=[297.0, 210.0]).\n# visible edges -> solid (layer OUTLINE); hidden edges -> dashed (layer HIDDEN)\n# dimensions -> real movable DIMENSION entities (text = true mm value)\n# Run: python 0063_00636993_gt.py [out.dxf]\nimport sys\nimport ezdxf\n\nSCALE = 1.0948330827067696\nPAGE = [297.0, 210.0]\n\nVISIBLE_SEGMENTS = [\n (73.978305, 121.516006, 73.978305, 124.253088),\n (183.461613, 124.253088, 73.978305, 124.253088),\n (183.461613, 124.253088, 183.461613, 121.516006),\n (183.461613, 121.516006, 193.041402, 121.516006),\n (193.041402, 121.516006, 193.041402, 143.412667),\n (193.041402, 143.412667, 183.461613, 143.412667),\n (183.461613, 143.412667, 183.461613, 136.56996),\n (73.978305, 136.56996, 183.461613, 136.56996),\n (73.978305, 136.56996, 73.978305, 143.412667),\n (73.978305, 143.412667, 63.029974, 143.412667),\n (63.029974, 143.412667, 63.029974, 121.516006),\n (63.029974, 121.516006, 73.978305, 121.516006),\n (193.041402, 107.516006, 193.041402, 90.587434),\n (193.041402, 90.587434, 183.461613, 90.587434),\n (183.461613, 107.516006, 183.461613, 90.587434),\n (193.041402, 107.516006, 183.461613, 107.516006),\n (73.978305, 90.587434, 183.461613, 90.587434),\n (183.461613, 107.516006, 73.978305, 107.516006),\n (73.978305, 107.516006, 73.978305, 90.587434),\n (73.978305, 90.587434, 63.029974, 90.587434),\n (63.029974, 107.516006, 63.029974, 90.587434),\n (73.978305, 107.516006, 63.029974, 107.516006),\n (207.041402, 143.412667, 223.969974, 143.412667),\n (223.969974, 143.412667, 223.969974, 121.516006),\n (207.041402, 121.516006, 223.969974, 121.516006),\n (207.041402, 143.412667, 207.041402, 121.516006)\n]\nVISIBLE_CIRCLES = [\n\n]\nVISIBLE_ARCS = [\n\n]\nHIDDEN_SEGMENTS = [\n (207.0414, 124.253, 223.97, 124.253),\n (207.0414, 136.5699, 223.97, 136.5699)\n]\n# (orient, text, p1, p2, base) for linear; (orient, text, center, radius, angle) for diameter\nDIMENSIONS = [\n ('vertical', '2.5', (73.9783, 124.2531), (73.9783, 121.516), (84.9783, 122.8845)),\n ('horizontal', '100', (183.4616, 124.2531), (73.9783, 124.2531), (128.72, 113.2531)),\n ('vertical', '2.5', (183.4616, 121.516), (183.4616, 124.2531), (172.4616, 122.8845)),\n ('horizontal', '8.75', (193.0414, 121.516), (183.4616, 121.516), (188.2515, 110.516)),\n ('vertical', '20', (193.0414, 143.4127), (193.0414, 121.516), (204.0414, 132.4643)),\n ('horizontal', '8.75', (183.4616, 143.4127), (193.0414, 143.4127), (188.2515, 154.4127)),\n ('vertical', '6.25', (183.4616, 136.5699), (183.4616, 143.4127), (172.4616, 139.9913)),\n ('horizontal', '100', (73.9783, 136.5699), (183.4616, 136.5699), (128.72, 147.5699)),\n ('vertical', '6.25', (73.9783, 143.4127), (73.9783, 136.5699), (84.9783, 139.9913)),\n ('horizontal', '10', (63.03, 143.4127), (73.9783, 143.4127), (68.5042, 154.4127)),\n ('vertical', '20', (63.03, 121.516), (63.03, 143.4127), (52.03, 132.4643)),\n ('horizontal', '10', (73.9783, 121.516), (63.03, 121.516), (68.5042, 110.516)),\n ('horizontal', '15.4622', (207.0414, 121.516), (223.97, 121.516), (215.5057, 132.516))\n]\n\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\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\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,\n angle=(0 if d[0] == \"horizontal\" else 90),\n 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,\n text=text, dimstyle=\"EZDXF\").render()\n\n doc.saveas(out_path)\n\n\nif __name__ == \"__main__\":\n out = sys.argv[1] if len(sys.argv) > 1 else \"0063_00636993_gt.dxf\"\n draw(out)\n print(\"wrote\", out)\n```"}], "images": ["images/0063_00636993.png"], "id": "0063_00636993"} {"messages": [{"role": "user", "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 100 x 43.48 mm bounding box. It is extruded to a thickness of 16.49 mm."}, {"role": "assistant", "content": "```python\n#!/usr/bin/env python3\n# -*- coding: utf-8 -*-\n# Ground-truth 2D engineering drawing for part: 0065_00652778\n# Self-contained: reproduces the three-view DXF via ezdxf, NO FreeCAD needed.\n# Coordinates are A4 page millimetres (scale=0.9530776597307494, page=[297.0, 210.0]).\n# visible edges -> solid (layer OUTLINE); hidden edges -> dashed (layer HIDDEN)\n# dimensions -> real movable DIMENSION entities (text = true mm value)\n# Run: python 0065_00652778_gt.py [out.dxf]\nimport sys\nimport ezdxf\n\nSCALE = 0.9530776597307494\nPAGE = [297.0, 210.0]\n\nVISIBLE_SEGMENTS = [\n (80.98653, 151.197412, 80.98653, 109.759252),\n (176.294296, 109.759252, 80.98653, 109.759252),\n (176.294296, 109.759252, 176.294296, 151.197412),\n (176.294296, 151.197412, 194.250832, 151.197412),\n (194.250832, 151.197412, 194.250832, 153.959955),\n (194.250832, 153.959955, 173.531752, 153.959955),\n (173.531752, 153.959955, 173.531752, 112.521796),\n (83.749074, 112.521796, 173.531752, 112.521796),\n (83.749074, 112.521796, 83.749074, 153.959955),\n (83.749074, 153.959955, 63.029995, 153.959955),\n (63.029995, 153.959955, 63.029995, 151.197412),\n (63.029995, 151.197412, 80.98653, 151.197412),\n (194.250832, 95.759252, 194.250832, 80.04009),\n (194.250832, 80.04009, 173.531752, 80.04009),\n (173.531752, 95.759252, 173.531752, 80.04009),\n (194.250832, 95.759252, 173.531752, 95.759252),\n (83.749074, 80.04009, 173.531752, 80.04009),\n (173.531752, 95.759252, 83.749074, 95.759252),\n (83.749074, 95.759252, 83.749074, 80.04009),\n (83.749074, 80.04009, 63.029995, 80.04009),\n (63.029995, 95.759252, 63.029995, 80.04009),\n (83.749074, 95.759252, 63.029995, 95.759252),\n (223.969995, 151.197412, 223.969995, 109.759252),\n (208.250832, 109.759252, 223.969995, 109.759252),\n (208.250832, 151.197412, 208.250832, 109.759252),\n (208.250832, 153.959955, 223.969995, 153.959955),\n (223.969995, 153.959955, 223.969995, 151.197412),\n (208.250832, 151.197412, 223.969995, 151.197412),\n (208.250832, 153.959955, 208.250832, 151.197412)\n]\nVISIBLE_CIRCLES = [\n\n]\nVISIBLE_ARCS = [\n\n]\nHIDDEN_SEGMENTS = [\n (80.9865, 95.7592, 80.9865, 80.0401),\n (176.2943, 95.7592, 176.2943, 80.0401),\n (208.2508, 112.5218, 223.97, 112.5218)\n]\n# (orient, text, p1, p2, base) for linear; (orient, text, center, radius, angle) for diameter\nDIMENSIONS = [\n ('vertical', '43.4783', (80.9865, 109.7592), (80.9865, 151.1974), (69.9865, 130.4783)),\n ('horizontal', '100', (176.2943, 109.7592), (80.9865, 109.7592), (128.6404, 98.7592)),\n ('vertical', '43.4783', (176.2943, 151.1974), (176.2943, 109.7592), (187.2943, 130.4783)),\n ('horizontal', '18.8406', (194.2509, 151.1974), (176.2943, 151.1974), (185.2726, 140.1974)),\n ('vertical', '2.8986', (194.2509, 153.96), (194.2509, 151.1974), (205.2509, 152.5787)),\n ('horizontal', '21.7391', (173.5317, 153.96), (194.2509, 153.96), (183.8913, 164.96)),\n ('vertical', '43.4783', (173.5317, 112.5218), (173.5317, 153.96), (162.5317, 133.2409)),\n ('horizontal', '94.2029', (83.7491, 112.5218), (173.5317, 112.5218), (128.6404, 123.5218)),\n ('vertical', '43.4783', (83.7491, 153.96), (83.7491, 112.5218), (94.7491, 133.2409)),\n ('horizontal', '21.7391', (63.03, 153.96), (83.7491, 153.96), (73.3896, 164.96)),\n ('vertical', '2.8986', (63.03, 151.1974), (63.03, 153.96), (52.03, 152.5787)),\n ('horizontal', '18.8406', (80.9865, 151.1974), (63.03, 151.1974), (72.0083, 140.1974)),\n ('horizontal', '16.4931', (208.2508, 151.1974), (223.97, 151.1974), (216.1104, 162.1974))\n]\n\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\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\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,\n angle=(0 if d[0] == \"horizontal\" else 90),\n 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,\n text=text, dimstyle=\"EZDXF\").render()\n\n doc.saveas(out_path)\n\n\nif __name__ == \"__main__\":\n out = sys.argv[1] if len(sys.argv) > 1 else \"0065_00652778_gt.dxf\"\n draw(out)\n print(\"wrote\", out)\n```"}], "images": ["images/0065_00652778.png"], "id": "0065_00652778"} {"messages": [{"role": "user", "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 66.67 mm."}, {"role": "assistant", "content": "```python\n#!/usr/bin/env python3\n# -*- coding: utf-8 -*-\n# Ground-truth 2D engineering drawing for part: 0068_00682037\n# Self-contained: reproduces the three-view DXF via ezdxf, NO FreeCAD needed.\n# Coordinates are A4 page millimetres (scale=0.576600000000023, page=[297.0, 210.0]).\n# visible edges -> solid (layer OUTLINE); hidden edges -> dashed (layer HIDDEN)\n# dimensions -> real movable DIMENSION entities (text = true mm value)\n# Run: python 0068_00682037_gt.py [out.dxf]\nimport sys\nimport ezdxf\n\nSCALE = 0.576600000000023\nPAGE = [297.0, 210.0]\n\nVISIBLE_SEGMENTS = [\n (146.11, 172.050006, 146.11, 152.627691),\n (146.11, 152.627691, 126.687684, 152.627691),\n (126.687684, 152.627691, 126.687684, 114.390006),\n (126.687684, 114.390006, 107.872316, 114.390006),\n (107.872316, 114.390006, 107.872316, 152.627691),\n (107.872316, 152.627691, 88.45, 152.627691),\n (88.45, 152.627691, 88.45, 172.050006),\n (88.45, 172.050006, 146.11, 172.050006),\n (146.11, 61.950006, 146.11, 100.390006),\n (88.45, 61.950006, 88.45, 100.390006),\n (88.45, 100.390006, 146.11, 100.390006),\n (88.45, 61.950006, 146.11, 61.950006),\n (198.55, 114.390006, 160.11, 114.390006),\n (160.11, 114.390006, 160.11, 152.627691),\n (198.55, 114.390006, 198.55, 152.627691),\n (198.55, 152.627691, 160.11, 152.627691),\n (160.11, 152.627691, 160.11, 172.050006),\n (198.55, 172.050006, 160.11, 172.050006),\n (198.55, 152.627691, 198.55, 172.050006)\n]\nVISIBLE_CIRCLES = [\n\n]\nVISIBLE_ARCS = [\n\n]\nHIDDEN_SEGMENTS = [\n (126.6877, 61.95, 126.6877, 100.39),\n (107.8723, 61.95, 107.8723, 100.39)\n]\n# (orient, text, p1, p2, base) for linear; (orient, text, center, radius, angle) for diameter\nDIMENSIONS = [\n ('vertical', '33.6842', (146.11, 152.6277), (146.11, 172.05), (135.11, 162.3388)),\n ('horizontal', '33.6842', (126.6877, 152.6277), (146.11, 152.6277), (136.3989, 163.6277)),\n ('vertical', '66.3158', (126.6877, 114.39), (126.6877, 152.6277), (115.6877, 133.5088)),\n ('horizontal', '32.6316', (107.8723, 114.39), (126.6877, 114.39), (117.28, 125.39)),\n ('vertical', '66.3158', (107.8723, 152.6277), (107.8723, 114.39), (118.8723, 133.5088)),\n ('horizontal', '33.6842', (88.45, 152.6277), (107.8723, 152.6277), (98.1612, 163.6277)),\n ('vertical', '33.6842', (88.45, 172.05), (88.45, 152.6277), (99.45, 162.3388)),\n ('horizontal', '100', (146.11, 172.05), (88.45, 172.05), (117.28, 161.05)),\n ('horizontal', '66.6667', (198.55, 172.05), (160.11, 172.05), (179.33, 161.05))\n]\n\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\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\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,\n angle=(0 if d[0] == \"horizontal\" else 90),\n 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,\n text=text, dimstyle=\"EZDXF\").render()\n\n doc.saveas(out_path)\n\n\nif __name__ == \"__main__\":\n out = sys.argv[1] if len(sys.argv) > 1 else \"0068_00682037_gt.dxf\"\n draw(out)\n print(\"wrote\", out)\n```"}], "images": ["images/0068_00682037.png"], "id": "0068_00682037"} {"messages": [{"role": "user", "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": "assistant", "content": "```python\n#!/usr/bin/env python3\n# -*- coding: utf-8 -*-\n# Ground-truth 2D engineering drawing for part: 0069_00696486\n# Self-contained: reproduces the three-view DXF via ezdxf, NO FreeCAD needed.\n# Coordinates are A4 page millimetres (scale=0.576600000000023, page=[297.0, 210.0]).\n# visible edges -> solid (layer OUTLINE); hidden edges -> dashed (layer HIDDEN)\n# dimensions -> real movable DIMENSION entities (text = true mm value)\n# Run: python 0069_00696486_gt.py [out.dxf]\nimport sys\nimport ezdxf\n\nSCALE = 0.576600000000023\nPAGE = [297.0, 210.0]\n\nVISIBLE_SEGMENTS = [\n (146.11, 172.050009, 146.11, 114.390009),\n (146.11, 114.390009, 126.687684, 114.390009),\n (126.687684, 114.390009, 126.687684, 133.205378),\n (126.687684, 133.205378, 107.872316, 133.205378),\n (107.872316, 133.205378, 107.872316, 152.627694),\n (107.872316, 152.627694, 88.45, 152.627694),\n (88.45, 152.627694, 88.45, 172.050009),\n (88.45, 172.050009, 146.11, 172.050009),\n (146.11, 61.950009, 146.11, 100.390009),\n (88.45, 61.950009, 88.45, 100.390009),\n (88.45, 100.390009, 146.11, 100.390009),\n (88.45, 61.950009, 146.11, 61.950009),\n (198.55, 114.390009, 160.11, 114.390009),\n (160.11, 114.390009, 160.11, 133.205378),\n (198.55, 114.390009, 198.55, 133.205378),\n (198.55, 133.205378, 160.11, 133.205378),\n (160.11, 133.205378, 160.11, 152.627694),\n (198.55, 133.205378, 198.55, 152.627694),\n (198.55, 152.627694, 160.11, 152.627694),\n (160.11, 152.627694, 160.11, 172.050009),\n (198.55, 172.050009, 160.11, 172.050009),\n (198.55, 152.627694, 198.55, 172.050009)\n]\nVISIBLE_CIRCLES = [\n\n]\nVISIBLE_ARCS = [\n\n]\nHIDDEN_SEGMENTS = [\n (126.6877, 61.95, 126.6877, 100.39),\n (107.8723, 61.95, 107.8723, 100.39)\n]\n# (orient, text, p1, p2, base) for linear; (orient, text, center, radius, angle) for diameter\nDIMENSIONS = [\n ('vertical', '100', (146.11, 114.39), (146.11, 172.05), (135.11, 143.22)),\n ('horizontal', '33.6842', (126.6877, 114.39), (146.11, 114.39), (136.3988, 125.39)),\n ('vertical', '32.6316', (126.6877, 133.2054), (126.6877, 114.39), (137.6877, 123.7977)),\n ('horizontal', '32.6316', (107.8723, 133.2054), (126.6877, 133.2054), (117.28, 144.2054)),\n ('vertical', '33.6842', (107.8723, 152.6277), (107.8723, 133.2054), (118.8723, 142.9165)),\n ('horizontal', '33.6842', (88.45, 152.6277), (107.8723, 152.6277), (98.1612, 163.6277)),\n ('vertical', '33.6842', (88.45, 172.05), (88.45, 152.6277), (99.45, 162.3388)),\n ('horizontal', '100', (146.11, 172.05), (88.45, 172.05), (117.28, 161.05)),\n ('horizontal', '66.6667', (198.55, 172.05), (160.11, 172.05), (179.33, 161.05))\n]\n\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\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\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,\n angle=(0 if d[0] == \"horizontal\" else 90),\n 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,\n text=text, dimstyle=\"EZDXF\").render()\n\n doc.saveas(out_path)\n\n\nif __name__ == \"__main__\":\n out = sys.argv[1] if len(sys.argv) > 1 else \"0069_00696486_gt.dxf\"\n draw(out)\n print(\"wrote\", out)\n```"}], "images": ["images/0069_00696486.png"], "id": "0069_00696486"} {"messages": [{"role": "user", "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 200 mm."}, {"role": "assistant", "content": "```python\n#!/usr/bin/env python3\n# -*- coding: utf-8 -*-\n# Ground-truth 2D engineering drawing for part: 0073_00731477\n# Self-contained: reproduces the three-view DXF via ezdxf, NO FreeCAD needed.\n# Coordinates are A4 page millimetres (scale=0.3835924369748032, page=[297.0, 210.0]).\n# visible edges -> solid (layer OUTLINE); hidden edges -> dashed (layer HIDDEN)\n# dimensions -> real movable DIMENSION entities (text = true mm value)\n# Run: python 0073_00731477_gt.py [out.dxf]\nimport sys\nimport ezdxf\n\nSCALE = 0.3835924369748032\nPAGE = [297.0, 210.0]\n\nVISIBLE_SEGMENTS = [\n (117.320383, 152.668496, 78.96114, 152.668496),\n (117.320383, 152.668496, 117.320383, 172.050008),\n (78.96114, 172.050008, 117.320383, 172.050008),\n (78.96114, 172.050008, 78.96114, 152.668496),\n (117.320383, 138.668496, 117.320383, 61.950008),\n (78.96114, 61.950008, 117.320383, 61.950008),\n (78.96114, 138.668496, 78.96114, 61.950008),\n (117.320383, 138.668496, 78.96114, 138.668496),\n (131.320383, 152.668496, 208.038871, 152.668496),\n (131.320383, 172.050008, 208.038871, 172.050008),\n (208.038871, 172.050008, 208.038871, 152.668496),\n (131.320383, 172.050008, 131.320383, 152.668496)\n]\nVISIBLE_CIRCLES = [\n\n]\nVISIBLE_ARCS = [\n\n]\nHIDDEN_SEGMENTS = [\n\n]\n# (orient, text, p1, p2, base) for linear; (orient, text, center, radius, angle) for diameter\nDIMENSIONS = [\n ('vertical', '50.5263', (117.3204, 172.05), (117.3204, 152.6685), (128.3204, 162.3592)),\n ('horizontal', '100', (78.9611, 172.05), (117.3204, 172.05), (98.1408, 183.05)),\n ('vertical', '50.5263', (78.9611, 152.6685), (78.9611, 172.05), (67.9611, 162.3592)),\n ('horizontal', '100', (117.3204, 152.6685), (78.9611, 152.6685), (98.1408, 141.6685)),\n ('horizontal', '200', (131.3204, 152.6685), (208.0389, 152.6685), (169.6796, 163.6685))\n]\n\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\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\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,\n angle=(0 if d[0] == \"horizontal\" else 90),\n 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,\n text=text, dimstyle=\"EZDXF\").render()\n\n doc.saveas(out_path)\n\n\nif __name__ == \"__main__\":\n out = sys.argv[1] if len(sys.argv) > 1 else \"0073_00731477_gt.dxf\"\n draw(out)\n print(\"wrote\", out)\n```"}], "images": ["images/0073_00731477.png"], "id": "0073_00731477"} {"messages": [{"role": "user", "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 83.16 mm bounding box. It is extruded to a thickness of 66.67 mm."}, {"role": "assistant", "content": "```python\n#!/usr/bin/env python3\n# -*- coding: utf-8 -*-\n# Ground-truth 2D engineering drawing for part: 0073_00735729\n# Self-contained: reproduces the three-view DXF via ezdxf, NO FreeCAD needed.\n# Coordinates are A4 page millimetres (scale=0.641416861826727, page=[297.0, 210.0]).\n# visible edges -> solid (layer OUTLINE); hidden edges -> dashed (layer HIDDEN)\n# dimensions -> real movable DIMENSION entities (text = true mm value)\n# Run: python 0073_00735729_gt.py [out.dxf]\nimport sys\nimport ezdxf\n\nSCALE = 0.641416861826727\nPAGE = [297.0, 210.0]\n\nVISIBLE_SEGMENTS = [\n (147.190285, 172.049999, 147.190285, 150.444379),\n (147.190285, 150.444379, 104.654219, 150.444379),\n (104.654219, 150.444379, 104.654219, 118.711123),\n (104.654219, 118.711123, 83.048599, 118.711123),\n (83.048599, 118.711123, 83.048599, 172.049999),\n (83.048599, 172.049999, 147.190285, 172.049999),\n (147.190285, 61.949999, 147.190285, 104.711123),\n (83.048599, 61.949999, 83.048599, 104.711123),\n (83.048599, 104.711123, 147.190285, 104.711123),\n (83.048599, 61.949999, 147.190285, 61.949999),\n (203.951409, 118.711123, 161.190285, 118.711123),\n (161.190285, 118.711123, 161.190285, 172.049999),\n (203.951409, 172.049999, 161.190285, 172.049999),\n (203.951409, 118.711123, 203.951409, 172.049999)\n]\nVISIBLE_CIRCLES = [\n\n]\nVISIBLE_ARCS = [\n\n]\nHIDDEN_SEGMENTS = [\n (104.6542, 61.95, 104.6542, 104.7111),\n (203.9514, 150.4444, 161.1903, 150.4444)\n]\n# (orient, text, p1, p2, base) for linear; (orient, text, center, radius, angle) for diameter\nDIMENSIONS = [\n ('vertical', '33.6842', (147.1903, 150.4444), (147.1903, 172.05), (136.1903, 161.2472)),\n ('horizontal', '66.3158', (104.6542, 150.4444), (147.1903, 150.4444), (125.9222, 161.4444)),\n ('vertical', '49.4737', (104.6542, 118.7111), (104.6542, 150.4444), (93.6542, 134.5778)),\n ('horizontal', '33.6842', (83.0486, 118.7111), (104.6542, 118.7111), (93.8514, 129.7111)),\n ('vertical', '83.1579', (83.0486, 172.05), (83.0486, 118.7111), (94.0486, 145.3806)),\n ('horizontal', '100', (147.1903, 172.05), (83.0486, 172.05), (115.1194, 161.05)),\n ('horizontal', '66.6667', (203.9514, 172.05), (161.1903, 172.05), (182.5708, 161.05))\n]\n\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\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\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,\n angle=(0 if d[0] == \"horizontal\" else 90),\n 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,\n text=text, dimstyle=\"EZDXF\").render()\n\n doc.saveas(out_path)\n\n\nif __name__ == \"__main__\":\n out = sys.argv[1] if len(sys.argv) > 1 else \"0073_00735729_gt.dxf\"\n draw(out)\n print(\"wrote\", out)\n```"}], "images": ["images/0073_00735729.png"], "id": "0073_00735729"} {"messages": [{"role": "user", "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 96.84 mm tall. It is extruded to a thickness of 98.97 mm."}, {"role": "assistant", "content": "```python\n#!/usr/bin/env python3\n# -*- coding: utf-8 -*-\n# Ground-truth 2D engineering drawing for part: 0075_00750598\n# Self-contained: reproduces the three-view DXF via ezdxf, NO FreeCAD needed.\n# Coordinates are A4 page millimetres (scale=0.49077892928401584, page=[297.0, 210.0]).\n# visible edges -> solid (layer OUTLINE); hidden edges -> dashed (layer HIDDEN)\n# dimensions -> real movable DIMENSION entities (text = true mm value)\n# Run: python 0075_00750598_gt.py [out.dxf]\nimport sys\nimport ezdxf\n\nSCALE = 0.49077892928401584\nPAGE = [297.0, 210.0]\n\nVISIBLE_SEGMENTS = [\n (136.752992, 172.049988, 136.752992, 124.521924),\n (136.752992, 124.521924, 87.675099, 124.521924),\n (87.675099, 124.521924, 87.675099, 172.049988),\n (87.675099, 172.049988, 136.752992, 172.049988),\n (136.752992, 61.949988, 136.752992, 110.521924),\n (87.675099, 61.949988, 87.675099, 110.521924),\n (87.675099, 110.521924, 136.752992, 110.521924),\n (87.675099, 61.949988, 136.752992, 61.949988),\n (199.324927, 124.521924, 150.752992, 124.521924),\n (150.752992, 124.521924, 150.752992, 172.049988),\n (199.324927, 172.049988, 150.752992, 172.049988),\n (199.324927, 124.521924, 199.324927, 172.049988)\n]\nVISIBLE_CIRCLES = [\n\n]\nVISIBLE_ARCS = [\n\n]\nHIDDEN_SEGMENTS = [\n\n]\n# (orient, text, p1, p2, base) for linear; (orient, text, center, radius, angle) for diameter\nDIMENSIONS = [\n ('vertical', '96.8421', (136.753, 124.5219), (136.753, 172.05), (125.753, 148.286)),\n ('horizontal', '100', (87.6751, 124.5219), (136.753, 124.5219), (112.2141, 135.5219)),\n ('vertical', '96.8421', (87.6751, 172.05), (87.6751, 124.5219), (98.6751, 148.286)),\n ('horizontal', '100', (136.753, 172.05), (87.6751, 172.05), (112.2141, 161.05)),\n ('horizontal', '98.9691', (199.3249, 172.05), (150.753, 172.05), (175.0389, 161.05))\n]\n\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\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\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,\n angle=(0 if d[0] == \"horizontal\" else 90),\n 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,\n text=text, dimstyle=\"EZDXF\").render()\n\n doc.saveas(out_path)\n\n\nif __name__ == \"__main__\":\n out = sys.argv[1] if len(sys.argv) > 1 else \"0075_00750598_gt.dxf\"\n draw(out)\n print(\"wrote\", out)\n```"}], "images": ["images/0075_00750598.png"], "id": "0075_00750598"} {"messages": [{"role": "user", "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 83.16 mm bounding box. It is extruded to a thickness of 66.67 mm."}, {"role": "assistant", "content": "```python\n#!/usr/bin/env python3\n# -*- coding: utf-8 -*-\n# Ground-truth 2D engineering drawing for part: 0076_00762790\n# Self-contained: reproduces the three-view DXF via ezdxf, NO FreeCAD needed.\n# Coordinates are A4 page millimetres (scale=0.641416861826727, page=[297.0, 210.0]).\n# visible edges -> solid (layer OUTLINE); hidden edges -> dashed (layer HIDDEN)\n# dimensions -> real movable DIMENSION entities (text = true mm value)\n# Run: python 0076_00762790_gt.py [out.dxf]\nimport sys\nimport ezdxf\n\nSCALE = 0.641416861826727\nPAGE = [297.0, 210.0]\n\nVISIBLE_SEGMENTS = [\n (147.190285, 172.049999, 147.190285, 150.444379),\n (147.190285, 150.444379, 104.654219, 150.444379),\n (104.654219, 150.444379, 104.654219, 118.711123),\n (104.654219, 118.711123, 83.048599, 118.711123),\n (83.048599, 118.711123, 83.048599, 172.049999),\n (83.048599, 172.049999, 147.190285, 172.049999),\n (147.190285, 61.949999, 147.190285, 104.711123),\n (83.048599, 61.949999, 83.048599, 104.711123),\n (83.048599, 104.711123, 147.190285, 104.711123),\n (83.048599, 61.949999, 147.190285, 61.949999),\n (203.951409, 118.711123, 161.190285, 118.711123),\n (161.190285, 118.711123, 161.190285, 172.049999),\n (203.951409, 172.049999, 161.190285, 172.049999),\n (203.951409, 118.711123, 203.951409, 172.049999)\n]\nVISIBLE_CIRCLES = [\n\n]\nVISIBLE_ARCS = [\n\n]\nHIDDEN_SEGMENTS = [\n (104.6542, 61.95, 104.6542, 104.7111),\n (203.9514, 150.4444, 161.1903, 150.4444)\n]\n# (orient, text, p1, p2, base) for linear; (orient, text, center, radius, angle) for diameter\nDIMENSIONS = [\n ('vertical', '33.6842', (147.1903, 150.4444), (147.1903, 172.05), (136.1903, 161.2472)),\n ('horizontal', '66.3158', (104.6542, 150.4444), (147.1903, 150.4444), (125.9222, 161.4444)),\n ('vertical', '49.4737', (104.6542, 118.7111), (104.6542, 150.4444), (93.6542, 134.5778)),\n ('horizontal', '33.6842', (83.0486, 118.7111), (104.6542, 118.7111), (93.8514, 129.7111)),\n ('vertical', '83.1579', (83.0486, 172.05), (83.0486, 118.7111), (94.0486, 145.3806)),\n ('horizontal', '100', (147.1903, 172.05), (83.0486, 172.05), (115.1194, 161.05)),\n ('horizontal', '66.6667', (203.9514, 172.05), (161.1903, 172.05), (182.5708, 161.05))\n]\n\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\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\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,\n angle=(0 if d[0] == \"horizontal\" else 90),\n 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,\n text=text, dimstyle=\"EZDXF\").render()\n\n doc.saveas(out_path)\n\n\nif __name__ == \"__main__\":\n out = sys.argv[1] if len(sys.argv) > 1 else \"0076_00762790_gt.dxf\"\n draw(out)\n print(\"wrote\", out)\n```"}], "images": ["images/0076_00762790.png"], "id": "0076_00762790"} {"messages": [{"role": "user", "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 83.16 mm bounding box. It is extruded to a thickness of 66.67 mm."}, {"role": "assistant", "content": "```python\n#!/usr/bin/env python3\n# -*- coding: utf-8 -*-\n# Ground-truth 2D engineering drawing for part: 0076_00765569\n# Self-contained: reproduces the three-view DXF via ezdxf, NO FreeCAD needed.\n# Coordinates are A4 page millimetres (scale=0.641416861826727, page=[297.0, 210.0]).\n# visible edges -> solid (layer OUTLINE); hidden edges -> dashed (layer HIDDEN)\n# dimensions -> real movable DIMENSION entities (text = true mm value)\n# Run: python 0076_00765569_gt.py [out.dxf]\nimport sys\nimport ezdxf\n\nSCALE = 0.641416861826727\nPAGE = [297.0, 210.0]\n\nVISIBLE_SEGMENTS = [\n (147.190285, 172.049999, 147.190285, 150.444379),\n (147.190285, 150.444379, 104.654219, 150.444379),\n (104.654219, 150.444379, 104.654219, 118.711123),\n (104.654219, 118.711123, 83.048599, 118.711123),\n (83.048599, 118.711123, 83.048599, 172.049999),\n (83.048599, 172.049999, 147.190285, 172.049999),\n (147.190285, 61.949999, 147.190285, 104.711123),\n (83.048599, 61.949999, 83.048599, 104.711123),\n (83.048599, 104.711123, 147.190285, 104.711123),\n (83.048599, 61.949999, 147.190285, 61.949999),\n (203.951409, 118.711123, 161.190285, 118.711123),\n (161.190285, 118.711123, 161.190285, 172.049999),\n (203.951409, 172.049999, 161.190285, 172.049999),\n (203.951409, 118.711123, 203.951409, 172.049999)\n]\nVISIBLE_CIRCLES = [\n\n]\nVISIBLE_ARCS = [\n\n]\nHIDDEN_SEGMENTS = [\n (104.6542, 61.95, 104.6542, 104.7111),\n (203.9514, 150.4444, 161.1903, 150.4444)\n]\n# (orient, text, p1, p2, base) for linear; (orient, text, center, radius, angle) for diameter\nDIMENSIONS = [\n ('vertical', '33.6842', (147.1903, 150.4444), (147.1903, 172.05), (136.1903, 161.2472)),\n ('horizontal', '66.3158', (104.6542, 150.4444), (147.1903, 150.4444), (125.9222, 161.4444)),\n ('vertical', '49.4737', (104.6542, 118.7111), (104.6542, 150.4444), (93.6542, 134.5778)),\n ('horizontal', '33.6842', (83.0486, 118.7111), (104.6542, 118.7111), (93.8514, 129.7111)),\n ('vertical', '83.1579', (83.0486, 172.05), (83.0486, 118.7111), (94.0486, 145.3806)),\n ('horizontal', '100', (147.1903, 172.05), (83.0486, 172.05), (115.1194, 161.05)),\n ('horizontal', '66.6667', (203.9514, 172.05), (161.1903, 172.05), (182.5708, 161.05))\n]\n\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\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\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,\n angle=(0 if d[0] == \"horizontal\" else 90),\n 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,\n text=text, dimstyle=\"EZDXF\").render()\n\n doc.saveas(out_path)\n\n\nif __name__ == \"__main__\":\n out = sys.argv[1] if len(sys.argv) > 1 else \"0076_00765569_gt.dxf\"\n draw(out)\n print(\"wrote\", out)\n```"}], "images": ["images/0076_00765569.png"], "id": "0076_00765569"} {"messages": [{"role": "user", "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 83.16 mm bounding box. It is extruded to a thickness of 66.67 mm."}, {"role": "assistant", "content": "```python\n#!/usr/bin/env python3\n# -*- coding: utf-8 -*-\n# Ground-truth 2D engineering drawing for part: 0080_00808316\n# Self-contained: reproduces the three-view DXF via ezdxf, NO FreeCAD needed.\n# Coordinates are A4 page millimetres (scale=0.5246839080459773, page=[297.0, 210.0]).\n# visible edges -> solid (layer OUTLINE); hidden edges -> dashed (layer HIDDEN)\n# dimensions -> real movable DIMENSION entities (text = true mm value)\n# Run: python 0080_00808316_gt.py [out.dxf]\nimport sys\nimport ezdxf\n\nSCALE = 0.5246839080459773\nPAGE = [297.0, 210.0]\n\nVISIBLE_SEGMENTS = [\n (145.244723, 119.673682, 145.244723, 163.305291),\n (145.244723, 163.305291, 127.571159, 163.305291),\n (127.571159, 163.305291, 127.571159, 137.347245),\n (127.571159, 137.347245, 92.776332, 137.347245),\n (92.776332, 137.347245, 92.776332, 119.673682),\n (92.776332, 119.673682, 145.244723, 119.673682),\n (145.244723, 105.673682, 145.244723, 70.694755),\n (145.244723, 70.694755, 127.571159, 70.694755),\n (127.571159, 105.673682, 127.571159, 70.694755),\n (145.244723, 105.673682, 127.571159, 105.673682),\n (127.571159, 70.694755, 92.776332, 70.694755),\n (92.776332, 105.673682, 92.776332, 70.694755),\n (127.571159, 105.673682, 92.776332, 105.673682),\n (159.244723, 163.305291, 194.22365, 163.305291),\n (194.22365, 163.305291, 194.22365, 137.347245),\n (159.244723, 163.305291, 159.244723, 137.347245),\n (159.244723, 137.347245, 194.22365, 137.347245),\n (194.22365, 137.347245, 194.22365, 119.673682),\n (159.244723, 119.673682, 194.22365, 119.673682),\n (159.244723, 137.347245, 159.244723, 119.673682)\n]\nVISIBLE_CIRCLES = [\n\n]\nVISIBLE_ARCS = [\n\n]\nHIDDEN_SEGMENTS = [\n\n]\n# (orient, text, p1, p2, base) for linear; (orient, text, center, radius, angle) for diameter\nDIMENSIONS = [\n ('vertical', '83.1579', (145.2447, 163.3053), (145.2447, 119.6737), (156.2447, 141.4895)),\n ('horizontal', '33.6842', (127.5712, 163.3053), (145.2447, 163.3053), (136.408, 174.3053)),\n ('vertical', '49.4737', (127.5712, 137.3472), (127.5712, 163.3053), (116.5712, 150.3262)),\n ('horizontal', '66.3158', (92.7763, 137.3472), (127.5712, 137.3472), (110.1738, 148.3472)),\n ('vertical', '33.6842', (92.7763, 119.6737), (92.7763, 137.3472), (81.7763, 128.5104)),\n ('horizontal', '100', (145.2447, 119.6737), (92.7763, 119.6737), (119.0105, 108.6737)),\n ('horizontal', '66.6667', (159.2447, 119.6737), (194.2237, 119.6737), (176.7342, 130.6737))\n]\n\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\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\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,\n angle=(0 if d[0] == \"horizontal\" else 90),\n 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,\n text=text, dimstyle=\"EZDXF\").render()\n\n doc.saveas(out_path)\n\n\nif __name__ == \"__main__\":\n out = sys.argv[1] if len(sys.argv) > 1 else \"0080_00808316_gt.dxf\"\n draw(out)\n print(\"wrote\", out)\n```"}], "images": ["images/0080_00808316.png"], "id": "0080_00808316"} {"messages": [{"role": "user", "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 100 x 50.53 mm bounding box. It is extruded to a thickness of 200 mm."}, {"role": "assistant", "content": "```python\n#!/usr/bin/env python3\n# -*- coding: utf-8 -*-\n# Ground-truth 2D engineering drawing for part: 0080_00808592\n# Self-contained: reproduces the three-view DXF via ezdxf, NO FreeCAD needed.\n# Coordinates are A4 page millimetres (scale=0.5865252100840492, page=[297.0, 210.0]).\n# visible edges -> solid (layer OUTLINE); hidden edges -> dashed (layer HIDDEN)\n# dimensions -> real movable DIMENSION entities (text = true mm value)\n# Run: python 0080_00808592_gt.py [out.dxf]\nimport sys\nimport ezdxf\n\nSCALE = 0.5865252100840492\nPAGE = [297.0, 210.0]\n\nVISIBLE_SEGMENTS = [\n (107.173713, 167.835027, 107.173713, 197.469985),\n (107.173713, 197.469985, 87.417074, 197.469985),\n (87.417074, 197.469985, 87.417074, 187.591665),\n (87.417074, 187.591665, 97.295394, 187.591665),\n (97.295394, 187.591665, 97.295394, 177.713346),\n (97.295394, 177.713346, 58.399511, 177.713346),\n (58.399511, 177.713346, 58.399511, 187.591665),\n (58.399511, 187.591665, 68.277831, 187.591665),\n (68.277831, 187.591665, 68.277831, 197.469985),\n (68.277831, 197.469985, 48.521192, 197.469985),\n (48.521192, 197.469985, 48.521192, 167.835027),\n (48.521192, 167.835027, 107.173713, 167.835027),\n (107.173713, 153.835027, 107.173713, 36.529985),\n (107.173713, 36.529985, 87.417074, 36.529985),\n (87.417074, 153.835027, 87.417074, 36.529985),\n (107.173713, 153.835027, 87.417074, 153.835027),\n (87.417074, 36.529985, 68.277831, 36.529985),\n (87.417074, 153.835027, 68.277831, 153.835027),\n (68.277831, 153.835027, 68.277831, 36.529985),\n (68.277831, 36.529985, 48.521192, 36.529985),\n (48.521192, 153.835027, 48.521192, 36.529985),\n (68.277831, 153.835027, 48.521192, 153.835027),\n (121.173713, 197.469985, 238.478755, 197.469985),\n (238.478755, 197.469985, 238.478755, 167.835027),\n (121.173713, 167.835027, 238.478755, 167.835027),\n (121.173713, 197.469985, 121.173713, 167.835027)\n]\nVISIBLE_CIRCLES = [\n\n]\nVISIBLE_ARCS = [\n\n]\nHIDDEN_SEGMENTS = [\n (97.2954, 153.835, 97.2954, 36.53),\n (58.3995, 153.835, 58.3995, 36.53),\n (121.1737, 187.5917, 238.4788, 187.5917),\n (121.1737, 177.7134, 238.4788, 177.7134)\n]\n# (orient, text, p1, p2, base) for linear; (orient, text, center, radius, angle) for diameter\nDIMENSIONS = [\n ('vertical', '50.5263', (107.1737, 197.47), (107.1737, 167.835), (118.1737, 182.6525)),\n ('horizontal', '33.6842', (87.4171, 197.47), (107.1737, 197.47), (97.2954, 208.47)),\n ('vertical', '16.8421', (87.4171, 187.5917), (87.4171, 197.47), (76.4171, 192.5308)),\n ('horizontal', '16.8421', (97.2954, 187.5917), (87.4171, 187.5917), (92.3562, 176.5917)),\n ('vertical', '16.8421', (97.2954, 177.7133), (97.2954, 187.5917), (86.2954, 182.6525)),\n ('horizontal', '66.3158', (58.3995, 177.7133), (97.2954, 177.7133), (77.8475, 188.7133)),\n ('vertical', '16.8421', (58.3995, 187.5917), (58.3995, 177.7133), (69.3995, 182.6525)),\n ('horizontal', '16.8421', (68.2778, 187.5917), (58.3995, 187.5917), (63.3387, 176.5917)),\n ('vertical', '16.8421', (68.2778, 197.47), (68.2778, 187.5917), (79.2778, 192.5308)),\n ('horizontal', '33.6842', (48.5212, 197.47), (68.2778, 197.47), (58.3995, 208.47)),\n ('vertical', '50.5263', (48.5212, 167.835), (48.5212, 197.47), (37.5212, 182.6525)),\n ('horizontal', '100', (107.1737, 167.835), (48.5212, 167.835), (77.8475, 156.835)),\n ('horizontal', '200', (121.1737, 167.835), (238.4788, 167.835), (179.8263, 178.835))\n]\n\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\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\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,\n angle=(0 if d[0] == \"horizontal\" else 90),\n 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,\n text=text, dimstyle=\"EZDXF\").render()\n\n doc.saveas(out_path)\n\n\nif __name__ == \"__main__\":\n out = sys.argv[1] if len(sys.argv) > 1 else \"0080_00808592_gt.dxf\"\n draw(out)\n print(\"wrote\", out)\n```"}], "images": ["images/0080_00808592.png"], "id": "0080_00808592"} {"messages": [{"role": "user", "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 50 mm."}, {"role": "assistant", "content": "```python\n#!/usr/bin/env python3\n# -*- coding: utf-8 -*-\n# Ground-truth 2D engineering drawing for part: 0081_00811665\n# Self-contained: reproduces the three-view DXF via ezdxf, NO FreeCAD needed.\n# Coordinates are A4 page millimetres (scale=1.0991574803149589, page=[297.0, 210.0]).\n# visible edges -> solid (layer OUTLINE); hidden edges -> dashed (layer HIDDEN)\n# dimensions -> real movable DIMENSION entities (text = true mm value)\n# Run: python 0081_00811665_gt.py [out.dxf]\nimport sys\nimport ezdxf\n\nSCALE = 1.0991574803149589\nPAGE = [297.0, 210.0]\n\nVISIBLE_SEGMENTS = [\n (54.06318, 169.991066, 163.978928, 169.991066),\n (163.978928, 169.991066, 163.978928, 132.966814),\n (163.978928, 132.966814, 145.466802, 132.966814),\n (145.466802, 132.966814, 145.466802, 151.47894),\n (145.466802, 151.47894, 126.954676, 151.47894),\n (126.954676, 151.47894, 126.954676, 132.966814),\n (126.954676, 132.966814, 54.06318, 132.966814),\n (54.06318, 132.966814, 54.06318, 169.991066),\n (163.978928, 64.00894, 163.978928, 118.966814),\n (54.06318, 64.00894, 163.978928, 64.00894),\n (54.06318, 64.00894, 54.06318, 118.966814),\n (163.978928, 118.966814, 54.06318, 118.966814),\n (232.936802, 169.991066, 177.978928, 169.991066),\n (232.936802, 132.966814, 177.978928, 132.966814),\n (177.978928, 132.966814, 177.978928, 169.991066),\n (232.936802, 132.966814, 232.936802, 169.991066)\n]\nVISIBLE_CIRCLES = [\n\n]\nVISIBLE_ARCS = [\n\n]\nHIDDEN_SEGMENTS = [\n (145.4668, 64.0089, 145.4668, 118.9668),\n (126.9547, 64.0089, 126.9547, 118.9668),\n (232.9368, 151.4789, 177.9789, 151.4789)\n]\n# (orient, text, p1, p2, base) for linear; (orient, text, center, radius, angle) for diameter\nDIMENSIONS = [\n ('vertical', '33.6842', (163.9789, 132.9668), (163.9789, 169.9911), (152.9789, 151.4789)),\n ('horizontal', '16.8421', (145.4668, 132.9668), (163.9789, 132.9668), (154.7229, 143.9668)),\n ('vertical', '16.8421', (145.4668, 151.4789), (145.4668, 132.9668), (156.4668, 142.2229)),\n ('horizontal', '16.8421', (126.9547, 151.4789), (145.4668, 151.4789), (136.2108, 162.4789)),\n ('vertical', '16.8421', (126.9547, 132.9668), (126.9547, 151.4789), (115.9547, 142.2229)),\n ('horizontal', '66.3158', (54.0632, 132.9668), (126.9547, 132.9668), (90.5089, 143.9668)),\n ('vertical', '33.6842', (54.0632, 169.9911), (54.0632, 132.9668), (65.0632, 151.4789)),\n ('horizontal', '100', (163.9789, 169.9911), (54.0632, 169.9911), (109.0211, 158.9911)),\n ('horizontal', '50', (232.9368, 169.9911), (177.9789, 169.9911), (205.4579, 158.9911))\n]\n\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\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\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,\n angle=(0 if d[0] == \"horizontal\" else 90),\n 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,\n text=text, dimstyle=\"EZDXF\").render()\n\n doc.saveas(out_path)\n\n\nif __name__ == \"__main__\":\n out = sys.argv[1] if len(sys.argv) > 1 else \"0081_00811665_gt.dxf\"\n draw(out)\n print(\"wrote\", out)\n```"}], "images": ["images/0081_00811665.png"], "id": "0081_00811665"} {"messages": [{"role": "user", "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 74.74 mm bounding box. It is extruded to a thickness of 62.5 mm."}, {"role": "assistant", "content": "```python\n#!/usr/bin/env python3\n# -*- coding: utf-8 -*-\n# Ground-truth 2D engineering drawing for part: 0082_00827121\n# Self-contained: reproduces the three-view DXF via ezdxf, NO FreeCAD needed.\n# Coordinates are A4 page millimetres (scale=0.7002492809204226, page=[297.0, 210.0]).\n# visible edges -> solid (layer OUTLINE); hidden edges -> dashed (layer HIDDEN)\n# dimensions -> real movable DIMENSION entities (text = true mm value)\n# Run: python 0082_00827121_gt.py [out.dxf]\nimport sys\nimport ezdxf\n\nSCALE = 0.7002492809204226\nPAGE = [297.0, 210.0]\n\nVISIBLE_SEGMENTS = [\n (97.295253, 119.715593, 97.295253, 155.096609),\n (97.295253, 155.096609, 131.939165, 155.096609),\n (131.939165, 155.096609, 131.939165, 119.715593),\n (131.939165, 119.715593, 149.629673, 119.715593),\n (149.629673, 119.715593, 149.629673, 172.050013),\n (149.629673, 172.050013, 79.604745, 172.050013),\n (79.604745, 172.050013, 79.604745, 119.715593),\n (79.604745, 119.715593, 97.295253, 119.715593),\n (149.629673, 105.715593, 149.629673, 61.950013),\n (149.629673, 61.950013, 79.604745, 61.950013),\n (79.604745, 105.715593, 79.604745, 61.950013),\n (149.629673, 105.715593, 79.604745, 105.715593),\n (163.629673, 172.050013, 207.395253, 172.050013),\n (207.395253, 172.050013, 207.395253, 119.715593),\n (163.629673, 119.715593, 207.395253, 119.715593),\n (163.629673, 172.050013, 163.629673, 119.715593)\n]\nVISIBLE_CIRCLES = [\n\n]\nVISIBLE_ARCS = [\n\n]\nHIDDEN_SEGMENTS = [\n (97.2953, 105.7156, 97.2953, 61.95),\n (131.9392, 105.7156, 131.9392, 61.95),\n (163.6297, 155.0966, 207.3953, 155.0966)\n]\n# (orient, text, p1, p2, base) for linear; (orient, text, center, radius, angle) for diameter\nDIMENSIONS = [\n ('vertical', '50.5263', (97.2953, 155.0966), (97.2953, 119.7156), (108.2953, 137.4061)),\n ('horizontal', '49.4737', (131.9391, 155.0966), (97.2953, 155.0966), (114.6172, 144.0966)),\n ('vertical', '50.5263', (131.9391, 119.7156), (131.9391, 155.0966), (120.9391, 137.4061)),\n ('horizontal', '25.2632', (149.6297, 119.7156), (131.9391, 119.7156), (140.7844, 108.7156)),\n ('vertical', '74.7368', (149.6297, 172.05), (149.6297, 119.7156), (160.6297, 145.8828)),\n ('horizontal', '100', (79.6047, 172.05), (149.6297, 172.05), (114.6172, 183.05)),\n ('vertical', '74.7368', (79.6047, 119.7156), (79.6047, 172.05), (68.6047, 145.8828)),\n ('horizontal', '25.2632', (97.2953, 119.7156), (79.6047, 119.7156), (88.45, 108.7156)),\n ('horizontal', '62.5', (163.6297, 119.7156), (207.3953, 119.7156), (185.5125, 130.7156))\n]\n\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\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\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,\n angle=(0 if d[0] == \"horizontal\" else 90),\n 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,\n text=text, dimstyle=\"EZDXF\").render()\n\n doc.saveas(out_path)\n\n\nif __name__ == \"__main__\":\n out = sys.argv[1] if len(sys.argv) > 1 else \"0082_00827121_gt.dxf\"\n draw(out)\n print(\"wrote\", out)\n```"}], "images": ["images/0082_00827121.png"], "id": "0082_00827121"} {"messages": [{"role": "user", "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 33.33 mm."}, {"role": "assistant", "content": "```python\n#!/usr/bin/env python3\n# -*- coding: utf-8 -*-\n# Ground-truth 2D engineering drawing for part: 0084_00846877\n# Self-contained: reproduces the three-view DXF via ezdxf, NO FreeCAD needed.\n# Coordinates are A4 page millimetres (scale=0.720750000000018, page=[297.0, 210.0]).\n# visible edges -> solid (layer OUTLINE); hidden edges -> dashed (layer HIDDEN)\n# dimensions -> real movable DIMENSION entities (text = true mm value)\n# Run: python 0084_00846877_gt.py [out.dxf]\nimport sys\nimport ezdxf\n\nSCALE = 0.720750000000018\nPAGE = [297.0, 210.0]\n\nVISIBLE_SEGMENTS = [\n (160.525, 172.049998, 160.525, 147.772103),\n (160.525, 147.772103, 136.247105, 147.772103),\n (136.247105, 147.772103, 136.247105, 99.974998),\n (136.247105, 99.974998, 112.727895, 99.974998),\n (112.727895, 99.974998, 112.727895, 147.772103),\n (112.727895, 147.772103, 88.45, 147.772103),\n (88.45, 147.772103, 88.45, 172.049998),\n (88.45, 172.049998, 160.525, 172.049998),\n (160.525, 61.949998, 160.525, 85.974998),\n (88.45, 61.949998, 88.45, 85.974998),\n (88.45, 85.974998, 160.525, 85.974998),\n (88.45, 61.949998, 160.525, 61.949998),\n (198.55, 99.974998, 174.525, 99.974998),\n (174.525, 99.974998, 174.525, 147.772103),\n (198.55, 99.974998, 198.55, 147.772103),\n (198.55, 147.772103, 174.525, 147.772103),\n (174.525, 147.772103, 174.525, 172.049998),\n (198.55, 172.049998, 174.525, 172.049998),\n (198.55, 147.772103, 198.55, 172.049998)\n]\nVISIBLE_CIRCLES = [\n\n]\nVISIBLE_ARCS = [\n\n]\nHIDDEN_SEGMENTS = [\n (136.2471, 61.95, 136.2471, 85.975),\n (112.7279, 61.95, 112.7279, 85.975)\n]\n# (orient, text, p1, p2, base) for linear; (orient, text, center, radius, angle) for diameter\nDIMENSIONS = [\n ('vertical', '33.6842', (160.525, 147.7721), (160.525, 172.05), (149.525, 159.9111)),\n ('horizontal', '33.6842', (136.2471, 147.7721), (160.525, 147.7721), (148.3861, 158.7721)),\n ('vertical', '66.3158', (136.2471, 99.975), (136.2471, 147.7721), (125.2471, 123.8736)),\n ('horizontal', '32.6316', (112.7279, 99.975), (136.2471, 99.975), (124.4875, 110.975)),\n ('vertical', '66.3158', (112.7279, 147.7721), (112.7279, 99.975), (123.7279, 123.8736)),\n ('horizontal', '33.6842', (88.45, 147.7721), (112.7279, 147.7721), (100.5889, 158.7721)),\n ('vertical', '33.6842', (88.45, 172.05), (88.45, 147.7721), (99.45, 159.9111)),\n ('horizontal', '100', (160.525, 172.05), (88.45, 172.05), (124.4875, 161.05)),\n ('horizontal', '33.3333', (198.55, 172.05), (174.525, 172.05), (186.5375, 161.05))\n]\n\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\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\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,\n angle=(0 if d[0] == \"horizontal\" else 90),\n 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,\n text=text, dimstyle=\"EZDXF\").render()\n\n doc.saveas(out_path)\n\n\nif __name__ == \"__main__\":\n out = sys.argv[1] if len(sys.argv) > 1 else \"0084_00846877_gt.dxf\"\n draw(out)\n print(\"wrote\", out)\n```"}], "images": ["images/0084_00846877.png"], "id": "0084_00846877"} {"messages": [{"role": "user", "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 61.05 mm bounding box. It is extruded to a thickness of 97.92 mm."}, {"role": "assistant", "content": "```python\n#!/usr/bin/env python3\n# -*- coding: utf-8 -*-\n# Ground-truth 2D engineering drawing for part: 0085_00850264\n# Self-contained: reproduces the three-view DXF via ezdxf, NO FreeCAD needed.\n# Coordinates are A4 page millimetres (scale=0.60451924403366, page=[297.0, 210.0]).\n# visible edges -> solid (layer OUTLINE); hidden edges -> dashed (layer HIDDEN)\n# dimensions -> real movable DIMENSION entities (text = true mm value)\n# Run: python 0085_00850264_gt.py [out.dxf]\nimport sys\nimport ezdxf\n\nSCALE = 0.60451924403366\nPAGE = [297.0, 210.0]\n\nVISIBLE_SEGMENTS = [\n (137.129707, 135.142501, 137.129707, 172.049992),\n (137.129707, 172.049992, 119.312298, 172.049992),\n (119.312298, 172.049992, 119.312298, 159.959607),\n (119.312298, 159.959607, 76.677783, 159.959607),\n (76.677783, 159.959607, 76.677783, 135.142501),\n (76.677783, 135.142501, 137.129707, 135.142501),\n (137.129707, 121.142501, 137.129707, 61.949992),\n (137.129707, 61.949992, 119.312298, 61.949992),\n (119.312298, 121.142501, 119.312298, 61.949992),\n (137.129707, 121.142501, 119.312298, 121.142501),\n (119.312298, 61.949992, 76.677783, 61.949992),\n (76.677783, 121.142501, 76.677783, 61.949992),\n (119.312298, 121.142501, 76.677783, 121.142501),\n (151.129707, 172.049992, 210.322217, 172.049992),\n (210.322217, 172.049992, 210.322217, 159.959607),\n (151.129707, 172.049992, 151.129707, 159.959607),\n (151.129707, 159.959607, 210.322217, 159.959607),\n (210.322217, 159.959607, 210.322217, 135.142501),\n (151.129707, 135.142501, 210.322217, 135.142501),\n (151.129707, 159.959607, 151.129707, 135.142501)\n]\nVISIBLE_CIRCLES = [\n\n]\nVISIBLE_ARCS = [\n\n]\nHIDDEN_SEGMENTS = [\n\n]\n# (orient, text, p1, p2, base) for linear; (orient, text, center, radius, angle) for diameter\nDIMENSIONS = [\n ('vertical', '61.0526', (137.1297, 172.05), (137.1297, 135.1425), (148.1297, 153.5962)),\n ('horizontal', '29.4737', (119.3123, 172.05), (137.1297, 172.05), (128.221, 183.05)),\n ('vertical', '20', (119.3123, 159.9596), (119.3123, 172.05), (108.3123, 166.0048)),\n ('horizontal', '70.5263', (76.6778, 159.9596), (119.3123, 159.9596), (97.995, 170.9596)),\n ('vertical', '41.0526', (76.6778, 135.1425), (76.6778, 159.9596), (65.6778, 147.5511)),\n ('horizontal', '100', (137.1297, 135.1425), (76.6778, 135.1425), (106.9037, 124.1425)),\n ('horizontal', '97.9167', (151.1297, 135.1425), (210.3222, 135.1425), (180.726, 146.1425))\n]\n\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\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\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,\n angle=(0 if d[0] == \"horizontal\" else 90),\n 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,\n text=text, dimstyle=\"EZDXF\").render()\n\n doc.saveas(out_path)\n\n\nif __name__ == \"__main__\":\n out = sys.argv[1] if len(sys.argv) > 1 else \"0085_00850264_gt.dxf\"\n draw(out)\n print(\"wrote\", out)\n```"}], "images": ["images/0085_00850264.png"], "id": "0085_00850264"} {"messages": [{"role": "user", "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 83.16 mm bounding box. It is extruded to a thickness of 66.41 mm."}, {"role": "assistant", "content": "```python\n#!/usr/bin/env python3\n# -*- coding: utf-8 -*-\n# Ground-truth 2D engineering drawing for part: 0085_00854875\n# Self-contained: reproduces the three-view DXF via ezdxf, NO FreeCAD needed.\n# Coordinates are A4 page millimetres (scale=0.6425336779017985, page=[297.0, 210.0]).\n# visible edges -> solid (layer OUTLINE); hidden edges -> dashed (layer HIDDEN)\n# dimensions -> real movable DIMENSION entities (text = true mm value)\n# Run: python 0085_00854875_gt.py [out.dxf]\nimport sys\nimport ezdxf\n\nSCALE = 0.6425336779017985\nPAGE = [297.0, 210.0]\n\nVISIBLE_SEGMENTS = [\n (147.292576, 118.618277, 147.292576, 145.672326),\n (147.292576, 145.672326, 99.271638, 145.672326),\n (99.271638, 145.672326, 99.271638, 155.817595),\n (99.271638, 155.817595, 147.292576, 155.817595),\n (147.292576, 155.817595, 147.292576, 172.050025),\n (147.292576, 172.050025, 83.039208, 172.050025),\n (83.039208, 172.050025, 83.039208, 118.618277),\n (83.039208, 118.618277, 147.292576, 118.618277),\n (147.292576, 104.618277, 147.292576, 61.950025),\n (147.292576, 61.950025, 83.039208, 61.950025),\n (83.039208, 104.618277, 83.039208, 61.950025),\n (147.292576, 104.618277, 83.039208, 104.618277),\n (161.292576, 172.050025, 203.960828, 172.050025),\n (203.960828, 172.050025, 203.960828, 118.618277),\n (161.292576, 118.618277, 203.960828, 118.618277),\n (161.292576, 172.050025, 161.292576, 118.618277)\n]\nVISIBLE_CIRCLES = [\n\n]\nVISIBLE_ARCS = [\n\n]\nHIDDEN_SEGMENTS = [\n (99.2716, 104.6183, 99.2716, 61.95),\n (161.2926, 145.6723, 203.9608, 145.6723),\n (161.2926, 155.8176, 203.9608, 155.8176)\n]\n# (orient, text, p1, p2, base) for linear; (orient, text, center, radius, angle) for diameter\nDIMENSIONS = [\n ('vertical', '42.1053', (147.2926, 145.6723), (147.2926, 118.6183), (158.2926, 132.1453)),\n ('horizontal', '74.7368', (99.2716, 145.6723), (147.2926, 145.6723), (123.2821, 156.6723)),\n ('vertical', '15.7895', (99.2716, 155.8176), (99.2716, 145.6723), (110.2716, 150.7449)),\n ('horizontal', '74.7368', (147.2926, 155.8176), (99.2716, 155.8176), (123.2821, 144.8176)),\n ('vertical', '25.2632', (147.2926, 172.05), (147.2926, 155.8176), (158.2926, 163.9338)),\n ('horizontal', '100', (83.0392, 172.05), (147.2926, 172.05), (115.1659, 183.05)),\n ('vertical', '83.1579', (83.0392, 118.6183), (83.0392, 172.05), (72.0392, 145.3341)),\n ('horizontal', '100', (147.2926, 118.6183), (83.0392, 118.6183), (115.1659, 107.6183)),\n ('horizontal', '66.4062', (161.2926, 118.6183), (203.9608, 118.6183), (182.6267, 129.6183))\n]\n\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\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\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,\n angle=(0 if d[0] == \"horizontal\" else 90),\n 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,\n text=text, dimstyle=\"EZDXF\").render()\n\n doc.saveas(out_path)\n\n\nif __name__ == \"__main__\":\n out = sys.argv[1] if len(sys.argv) > 1 else \"0085_00854875_gt.dxf\"\n draw(out)\n print(\"wrote\", out)\n```"}], "images": ["images/0085_00854875.png"], "id": "0085_00854875"} {"messages": [{"role": "user", "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 100 x 10.34 mm bounding box. It is extruded to a thickness of 2.27 mm."}, {"role": "assistant", "content": "```python\n#!/usr/bin/env python3\n# -*- coding: utf-8 -*-\n# Ground-truth 2D engineering drawing for part: 0087_00877323\n# Self-contained: reproduces the three-view DXF via ezdxf, NO FreeCAD needed.\n# Coordinates are A4 page millimetres (scale=1.3181985821697804, page=[297.0, 210.0]).\n# visible edges -> solid (layer OUTLINE); hidden edges -> dashed (layer HIDDEN)\n# dimensions -> real movable DIMENSION entities (text = true mm value)\n# Run: python 0087_00877323_gt.py [out.dxf]\nimport sys\nimport ezdxf\n\nSCALE = 1.3181985821697804\nPAGE = [297.0, 210.0]\n\nVISIBLE_SEGMENTS = [\n (69.090671, 118.681125, 69.090671, 112.620442),\n (200.910529, 112.620442, 69.090671, 112.620442),\n (200.910529, 112.620442, 200.910529, 118.681125),\n (200.910529, 118.681125, 206.971212, 118.681125),\n (206.971212, 118.681125, 206.971212, 132.317662),\n (206.971212, 132.317662, 200.910529, 132.317662),\n (200.910529, 132.317662, 200.910529, 138.378345),\n (69.090671, 138.378345, 200.910529, 138.378345),\n (69.090671, 138.378345, 69.090671, 132.317662),\n (69.090671, 132.317662, 63.029988, 132.317662),\n (63.029988, 132.317662, 63.029988, 118.681125),\n (63.029988, 118.681125, 69.090671, 118.681125),\n (206.971212, 98.620442, 206.971212, 95.621667),\n (206.971212, 95.621667, 200.910529, 95.621667),\n (206.971212, 98.620442, 200.910529, 98.620442),\n (200.910529, 98.620442, 200.910529, 95.621667),\n (69.090671, 95.621667, 200.910529, 95.621667),\n (69.090671, 98.620442, 69.090671, 95.621667),\n (200.910529, 98.620442, 69.090671, 98.620442),\n (69.090671, 95.621667, 63.029988, 95.621667),\n (63.029988, 98.620442, 63.029988, 95.621667),\n (69.090671, 98.620442, 63.029988, 98.620442),\n (223.969988, 118.681125, 223.969988, 112.620442),\n (220.971212, 112.620442, 223.969988, 112.620442),\n (220.971212, 118.681125, 220.971212, 112.620442),\n (220.971212, 138.378345, 223.969988, 138.378345),\n (223.969988, 138.378345, 223.969988, 132.317662),\n (220.971212, 138.378345, 220.971212, 132.317662),\n (220.971212, 132.317662, 223.969988, 132.317662),\n (223.969988, 132.317662, 223.969988, 118.681125),\n (220.971212, 118.681125, 223.969988, 118.681125),\n (220.971212, 132.317662, 220.971212, 118.681125)\n]\nVISIBLE_CIRCLES = [\n\n]\nVISIBLE_ARCS = [\n\n]\nHIDDEN_SEGMENTS = [\n\n]\n# (orient, text, p1, p2, base) for linear; (orient, text, center, radius, angle) for diameter\nDIMENSIONS = [\n ('vertical', '4.5977', (69.0907, 112.6204), (69.0907, 118.6811), (58.0907, 115.6507)),\n ('horizontal', '100', (200.9105, 112.6204), (69.0907, 112.6204), (135.0006, 101.6204)),\n ('vertical', '4.5977', (200.9105, 118.6811), (200.9105, 112.6204), (211.9105, 115.6507)),\n ('horizontal', '4.5977', (206.9712, 118.6811), (200.9105, 118.6811), (203.9409, 107.6811)),\n ('vertical', '10.3448', (206.9712, 132.3177), (206.9712, 118.6811), (217.9712, 125.4994)),\n ('horizontal', '4.5977', (200.9105, 132.3177), (206.9712, 132.3177), (203.9409, 143.3177)),\n ('vertical', '4.5977', (200.9105, 138.3784), (200.9105, 132.3177), (211.9105, 135.348)),\n ('horizontal', '100', (69.0907, 138.3784), (200.9105, 138.3784), (135.0006, 149.3784)),\n ('vertical', '4.5977', (69.0907, 132.3177), (69.0907, 138.3784), (58.0907, 135.348)),\n ('horizontal', '4.5977', (63.03, 132.3177), (69.0907, 132.3177), (66.0603, 143.3177)),\n ('vertical', '10.3448', (63.03, 118.6811), (63.03, 132.3177), (52.03, 125.4994)),\n ('horizontal', '4.5977', (69.0907, 118.6811), (63.03, 118.6811), (66.0603, 107.6811)),\n ('horizontal', '2.2749', (220.9712, 118.6811), (223.97, 118.6811), (222.4706, 129.6811))\n]\n\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\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\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,\n angle=(0 if d[0] == \"horizontal\" else 90),\n 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,\n text=text, dimstyle=\"EZDXF\").render()\n\n doc.saveas(out_path)\n\n\nif __name__ == \"__main__\":\n out = sys.argv[1] if len(sys.argv) > 1 else \"0087_00877323_gt.dxf\"\n draw(out)\n print(\"wrote\", out)\n```"}], "images": ["images/0087_00877323.png"], "id": "0087_00877323"} {"messages": [{"role": "user", "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 38.95 x 100 mm bounding box. It is extruded to a thickness of 3.12 mm."}, {"role": "assistant", "content": "```python\n#!/usr/bin/env python3\n# -*- coding: utf-8 -*-\n# Ground-truth 2D engineering drawing for part: 0088_00882915\n# Self-contained: reproduces the three-view DXF via ezdxf, NO FreeCAD needed.\n# Coordinates are A4 page millimetres (scale=0.691628787878786, page=[297.0, 210.0]).\n# visible edges -> solid (layer OUTLINE); hidden edges -> dashed (layer HIDDEN)\n# dimensions -> real movable DIMENSION entities (text = true mm value)\n# Run: python 0088_00882915_gt.py [out.dxf]\nimport sys\nimport ezdxf\n\nSCALE = 0.691628787878786\nPAGE = [297.0, 210.0]\n\nVISIBLE_SEGMENTS = [\n (148.887878, 90.499205, 148.887878, 159.662084),\n (148.887878, 159.662084, 143.791666, 159.662084),\n (143.791666, 159.662084, 143.791666, 138.549205),\n (143.791666, 138.549205, 121.950757, 138.549205),\n (121.950757, 138.549205, 121.950757, 90.499205),\n (121.950757, 90.499205, 148.887878, 90.499205),\n (148.887878, 76.499205, 148.887878, 74.337865),\n (148.887878, 74.337865, 143.791666, 74.337865),\n (143.791666, 76.499205, 143.791666, 74.337865),\n (148.887878, 76.499205, 143.791666, 76.499205),\n (143.791666, 74.337865, 121.950757, 74.337865),\n (121.950757, 76.499205, 121.950757, 74.337865),\n (143.791666, 76.499205, 121.950757, 76.499205),\n (162.887878, 159.662084, 165.049218, 159.662084),\n (165.049218, 159.662084, 165.049218, 138.549205),\n (162.887878, 159.662084, 162.887878, 138.549205),\n (162.887878, 138.549205, 165.049218, 138.549205),\n (165.049218, 138.549205, 165.049218, 90.499205),\n (162.887878, 90.499205, 165.049218, 90.499205),\n (162.887878, 138.549205, 162.887878, 90.499205)\n]\nVISIBLE_CIRCLES = [\n\n]\nVISIBLE_ARCS = [\n\n]\nHIDDEN_SEGMENTS = [\n\n]\n# (orient, text, p1, p2, base) for linear; (orient, text, center, radius, angle) for diameter\nDIMENSIONS = [\n ('vertical', '100', (148.8879, 159.6621), (148.8879, 90.4992), (159.8879, 125.0807)),\n ('horizontal', '7.3684', (143.7916, 159.6621), (148.8879, 159.6621), (146.3398, 170.6621)),\n ('vertical', '30.5263', (143.7916, 138.5492), (143.7916, 159.6621), (132.7916, 149.1057)),\n ('horizontal', '31.5789', (121.9508, 138.5492), (143.7916, 138.5492), (132.8712, 149.5492)),\n ('vertical', '69.4737', (121.9508, 90.4992), (121.9508, 138.5492), (110.9508, 114.5242)),\n ('horizontal', '38.9474', (148.8879, 90.4992), (121.9508, 90.4992), (135.4193, 79.4992)),\n ('horizontal', '3.125', (162.8879, 90.4992), (165.0492, 90.4992), (163.9686, 101.4992))\n]\n\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\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\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,\n angle=(0 if d[0] == \"horizontal\" else 90),\n 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,\n text=text, dimstyle=\"EZDXF\").render()\n\n doc.saveas(out_path)\n\n\nif __name__ == \"__main__\":\n out = sys.argv[1] if len(sys.argv) > 1 else \"0088_00882915_gt.dxf\"\n draw(out)\n print(\"wrote\", out)\n```"}], "images": ["images/0088_00882915.png"], "id": "0088_00882915"} {"messages": [{"role": "user", "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 -9600 mm."}, {"role": "assistant", "content": "```python\n#!/usr/bin/env python3\n# -*- coding: utf-8 -*-\n# Ground-truth 2D engineering drawing for part: 0091_00911468\n# Self-contained: reproduces the three-view DXF via ezdxf, NO FreeCAD needed.\n# Coordinates are A4 page millimetres (scale=0.00990721649484536, page=[297.0, 210.0]).\n# visible edges -> solid (layer OUTLINE); hidden edges -> dashed (layer HIDDEN)\n# dimensions -> real movable DIMENSION entities (text = true mm value)\n# Run: python 0091_00911468_gt.py [out.dxf]\nimport sys\nimport ezdxf\n\nSCALE = 0.00990721649484536\nPAGE = [297.0, 210.0]\n\nVISIBLE_SEGMENTS = [\n (89.440719, 172.050016, 89.440719, 171.059295),\n (89.440719, 171.059295, 89.315575, 171.059295),\n (89.315575, 171.059295, 89.315575, 171.924873),\n (89.315575, 171.924873, 88.449997, 171.924873),\n (88.449997, 171.924873, 88.449997, 172.050016),\n (88.449997, 172.050016, 89.440719, 172.050016),\n (89.440719, 157.059295, 89.440719, 61.950016),\n (88.449997, 157.059295, 88.449997, 61.950016),\n (88.449997, 61.950016, 89.440719, 61.950016),\n (88.449997, 157.059295, 89.440719, 157.059295),\n (103.440719, 171.059295, 198.549997, 171.059295),\n (198.549997, 171.059295, 198.549997, 171.924873),\n (103.440719, 171.059295, 103.440719, 171.924873),\n (103.440719, 171.924873, 198.549997, 171.924873),\n (198.549997, 171.924873, 198.549997, 172.050016),\n (103.440719, 172.050016, 198.549997, 172.050016),\n (103.440719, 171.924873, 103.440719, 172.050016)\n]\nVISIBLE_CIRCLES = [\n\n]\nVISIBLE_ARCS = [\n\n]\nHIDDEN_SEGMENTS = [\n\n]\n# (orient, text, p1, p2, base) for linear; (orient, text, center, radius, angle) for diameter\nDIMENSIONS = [\n ('vertical', '100', (89.4407, 171.0593), (89.4407, 172.05), (78.4407, 171.5546)),\n ('vertical', '12.6316', (89.3156, 171.0593), (89.4407, 171.0593), (89.3781, 182.0593)),\n ('vertical', '87.3684', (89.3156, 171.9249), (89.3156, 171.0593), (100.3156, 171.4921)),\n ('horizontal', '87.3684', (88.45, 171.9249), (89.3156, 171.9249), (88.8828, 182.9249)),\n ('vertical', '12.6316', (88.45, 172.05), (88.45, 171.9249), (99.45, 171.9874)),\n ('horizontal', '100', (89.4407, 172.05), (88.45, 172.05), (88.9454, 161.05)),\n ('horizontal', '9600', (103.4407, 172.05), (198.55, 172.05), (150.9954, 183.05))\n]\n\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\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\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,\n angle=(0 if d[0] == \"horizontal\" else 90),\n 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,\n text=text, dimstyle=\"EZDXF\").render()\n\n doc.saveas(out_path)\n\n\nif __name__ == \"__main__\":\n out = sys.argv[1] if len(sys.argv) > 1 else \"0091_00911468_gt.dxf\"\n draw(out)\n print(\"wrote\", out)\n```"}], "images": ["images/0091_00911468.png"], "id": "0091_00911468"} {"messages": [{"role": "user", "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 56.84 mm bounding box. It is extruded to a thickness of 96 mm."}, {"role": "assistant", "content": "```python\n#!/usr/bin/env python3\n# -*- coding: utf-8 -*-\n# Ground-truth 2D engineering drawing for part: 0091_00915197\n# Self-contained: reproduces the three-view DXF via ezdxf, NO FreeCAD needed.\n# Coordinates are A4 page millimetres (scale=0.6287534435261743, page=[297.0, 210.0]).\n# visible edges -> solid (layer OUTLINE); hidden edges -> dashed (layer HIDDEN)\n# dimensions -> real movable DIMENSION entities (text = true mm value)\n# Run: python 0091_00915197_gt.py [out.dxf]\nimport sys\nimport ezdxf\n\nSCALE = 0.6287534435261743\nPAGE = [297.0, 210.0]\n\nVISIBLE_SEGMENTS = [\n (134.44829, 168.740804, 134.44829, 139.619592),\n (134.44829, 139.619592, 83.486168, 139.619592),\n (83.486168, 139.619592, 83.486168, 136.310364),\n (83.486168, 136.310364, 137.757518, 136.310364),\n (137.757518, 136.310364, 137.757518, 172.050033),\n (137.757518, 172.050033, 74.882174, 172.050033),\n (74.882174, 172.050033, 74.882174, 168.740804),\n (74.882174, 168.740804, 134.44829, 168.740804),\n (137.757518, 122.310364, 137.757518, 61.950033),\n (137.757518, 61.950033, 74.882174, 61.950033),\n (74.882174, 122.310364, 74.882174, 61.950033),\n (137.757518, 122.310364, 74.882174, 122.310364),\n (212.117849, 168.740804, 212.117849, 139.619592),\n (151.757518, 168.740804, 151.757518, 139.619592),\n (151.757518, 139.619592, 212.117849, 139.619592),\n (212.117849, 139.619592, 212.117849, 136.310364),\n (151.757518, 136.310364, 212.117849, 136.310364),\n (151.757518, 139.619592, 151.757518, 136.310364),\n (151.757518, 172.050033, 212.117849, 172.050033),\n (212.117849, 172.050033, 212.117849, 168.740804),\n (151.757518, 168.740804, 212.117849, 168.740804),\n (151.757518, 172.050033, 151.757518, 168.740804)\n]\nVISIBLE_CIRCLES = [\n\n]\nVISIBLE_ARCS = [\n\n]\nHIDDEN_SEGMENTS = [\n (134.4483, 122.3103, 134.4483, 61.95),\n (83.4862, 122.3103, 83.4862, 61.95)\n]\n# (orient, text, p1, p2, base) for linear; (orient, text, center, radius, angle) for diameter\nDIMENSIONS = [\n ('vertical', '46.3158', (134.4483, 139.6196), (134.4483, 168.7408), (123.4483, 154.1802)),\n ('horizontal', '81.0526', (83.4862, 139.6196), (134.4483, 139.6196), (108.9672, 150.6196)),\n ('vertical', '5.2632', (83.4862, 136.3104), (83.4862, 139.6196), (72.4862, 137.965)),\n ('horizontal', '86.3158', (137.7575, 136.3104), (83.4862, 136.3104), (110.6218, 125.3104)),\n ('vertical', '56.8421', (137.7575, 172.05), (137.7575, 136.3104), (148.7575, 154.1802)),\n ('horizontal', '100', (74.8822, 172.05), (137.7575, 172.05), (106.3198, 183.05)),\n ('vertical', '5.2632', (74.8822, 168.7408), (74.8822, 172.05), (63.8822, 170.3954)),\n ('horizontal', '94.7368', (134.4483, 168.7408), (74.8822, 168.7408), (104.6652, 157.7408)),\n ('horizontal', '96', (151.7575, 168.7408), (212.1178, 168.7408), (181.9377, 179.7408))\n]\n\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\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\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,\n angle=(0 if d[0] == \"horizontal\" else 90),\n 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,\n text=text, dimstyle=\"EZDXF\").render()\n\n doc.saveas(out_path)\n\n\nif __name__ == \"__main__\":\n out = sys.argv[1] if len(sys.argv) > 1 else \"0091_00915197_gt.dxf\"\n draw(out)\n print(\"wrote\", out)\n```"}], "images": ["images/0091_00915197.png"], "id": "0091_00915197"} {"messages": [{"role": "user", "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 2 circular holes, each of diameter 8.42 mm. It is extruded to a thickness of 5.21 mm."}, {"role": "assistant", "content": "```python\n#!/usr/bin/env python3\n# -*- coding: utf-8 -*-\n# Ground-truth 2D engineering drawing for part: 0099_00996568\n# Self-contained: reproduces the three-view DXF via ezdxf, NO FreeCAD needed.\n# Coordinates are A4 page millimetres (scale=0.9134257425742603, page=[297.0, 210.0]).\n# visible edges -> solid (layer OUTLINE); hidden edges -> dashed (layer HIDDEN)\n# dimensions -> real movable DIMENSION entities (text = true mm value)\n# Run: python 0099_00996568_gt.py [out.dxf]\nimport sys\nimport ezdxf\n\nSCALE = 0.9134257425742603\nPAGE = [297.0, 210.0]\n\nVISIBLE_SEGMENTS = [\n (145.659302, 80.707409, 145.659302, 172.049983),\n (122.583283, 172.049983, 145.659302, 172.049983),\n (122.583283, 172.049983, 122.583283, 80.707409),\n (122.583283, 80.707409, 145.659302, 80.707409),\n (145.659302, 66.707409, 145.659302, 61.949983),\n (122.583283, 61.949983, 145.659302, 61.949983),\n (122.583283, 66.707409, 122.583283, 61.949983),\n (145.659302, 66.707409, 122.583283, 66.707409),\n (159.659302, 172.049983, 164.416728, 172.049983),\n (164.416728, 172.049983, 164.416728, 80.707409),\n (159.659302, 80.707409, 164.416728, 80.707409),\n (159.659302, 172.049983, 159.659302, 80.707409)\n]\nVISIBLE_CIRCLES = [\n (134.121293, 103.783427, 3.846003),\n (134.121293, 148.973964, 3.846003)\n]\nVISIBLE_ARCS = [\n\n]\nHIDDEN_SEGMENTS = [\n (137.9673, 66.7074, 137.9673, 61.95),\n (130.2753, 61.95, 130.2753, 66.7074),\n (164.4167, 107.6294, 159.6593, 107.6294),\n (164.4167, 99.9374, 159.6593, 99.9374),\n (164.4167, 152.82, 159.6593, 152.82),\n (164.4167, 145.128, 159.6593, 145.128)\n]\n# (orient, text, p1, p2, base) for linear; (orient, text, center, radius, angle) for diameter\nDIMENSIONS = [\n ('vertical', '100', (145.6593, 172.05), (145.6593, 80.7074), (156.6593, 126.3787)),\n ('horizontal', '25.2632', (122.5833, 172.05), (145.6593, 172.05), (134.1213, 183.05)),\n ('vertical', '100', (122.5833, 80.7074), (122.5833, 172.05), (111.5833, 126.3787)),\n ('horizontal', '25.2632', (145.6593, 80.7074), (122.5833, 80.7074), (134.1213, 69.7074)),\n ('diameter', '%%c8.4211', (134.1213, 103.7835), 3.846, 45),\n ('horizontal', '12.6316', (122.5833, 103.7835), (134.1213, 103.7835), (128.3523, 114.7835)),\n ('vertical', '25.2632', (134.1213, 80.7074), (134.1213, 103.7835), (123.1213, 92.2455)),\n ('diameter', '%%c8.4211', (134.1213, 148.9739), 3.846, 45),\n ('horizontal', '12.6316', (122.5833, 148.9739), (134.1213, 148.9739), (128.3523, 159.9739)),\n ('vertical', '74.7368', (134.1213, 80.7074), (134.1213, 148.9739), (123.1213, 114.8407)),\n ('horizontal', '5.2083', (159.6593, 80.7074), (164.4167, 80.7074), (162.038, 91.7074))\n]\n\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\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\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,\n angle=(0 if d[0] == \"horizontal\" else 90),\n 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,\n text=text, dimstyle=\"EZDXF\").render()\n\n doc.saveas(out_path)\n\n\nif __name__ == \"__main__\":\n out = sys.argv[1] if len(sys.argv) > 1 else \"0099_00996568_gt.dxf\"\n draw(out)\n print(\"wrote\", out)\n```"}], "images": ["images/0099_00996568.png"], "id": "0099_00996568"} {"messages": [{"role": "user", "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 84.21 mm tall. It is extruded to a thickness of 41.15 mm. A cut feature: The part is a rectangular plate 22.92 mm wide and 16.89 mm tall. It is extruded to a thickness of -41.15 mm. A cut feature: The part is a rectangular plate 22.92 mm wide and 21.95 mm tall. It is extruded to a thickness of -41.15 mm. A cut feature: The part is a rectangular plate 30.73 mm wide and 26.52 mm tall. It is extruded to a thickness of 41.15 mm."}, {"role": "assistant", "content": "```python\n#!/usr/bin/env python3\n# -*- coding: utf-8 -*-\n# Ground-truth 2D engineering drawing for part: 0025_00256773\n# Self-contained: reproduces the three-view DXF via ezdxf, NO FreeCAD needed.\n# Coordinates are A4 page millimetres (scale=0.7666144762737859, page=[297.0, 210.0]).\n# visible edges -> solid (layer OUTLINE); hidden edges -> dashed (layer HIDDEN)\n# dimensions -> real movable DIMENSION entities (text = true mm value)\n# Run: python 0025_00256773_gt.py [out.dxf]\nimport sys\nimport ezdxf\n\nSCALE = 0.7666144762737859\nPAGE = [297.0, 210.0]\n\nVISIBLE_SEGMENTS = [\n (159.059232, 107.492997, 159.059232, 172.050005),\n (82.397785, 107.492997, 159.059232, 107.492997),\n (159.059232, 172.050005, 82.397785, 172.050005),\n (82.397785, 172.050005, 82.397785, 107.492997),\n (132.307581, 129.453307, 132.307581, 149.787084),\n (108.750157, 129.453307, 132.307581, 129.453307),\n (108.750157, 149.787084, 108.750157, 129.453307),\n (132.307581, 149.787084, 108.750157, 149.787084),\n (159.059232, 93.492997, 159.059232, 61.950005),\n (159.059232, 61.950005, 82.397785, 61.950005),\n (82.397785, 93.492997, 82.397785, 61.950005),\n (159.059232, 93.492997, 82.397785, 93.492997),\n (173.059232, 107.492997, 204.602224, 107.492997),\n (173.059232, 172.050005, 204.602224, 172.050005),\n (173.059232, 172.050005, 173.059232, 107.492997),\n (204.602224, 172.050005, 204.602224, 107.492997)\n]\nVISIBLE_CIRCLES = [\n\n]\nVISIBLE_ARCS = [\n\n]\nHIDDEN_SEGMENTS = [\n (132.3076, 93.493, 132.3076, 61.95),\n (108.7502, 93.493, 108.7502, 61.95),\n (173.0592, 129.4533, 204.6022, 129.4533),\n (173.0592, 149.7871, 204.6022, 149.7871)\n]\n# (orient, text, p1, p2, base) for linear; (orient, text, center, radius, angle) for diameter\nDIMENSIONS = [\n ('horizontal', '100', (159.0592, 172.05), (82.3978, 172.05), (120.7285, 161.05)),\n ('vertical', '84.2105', (159.0592, 107.493), (159.0592, 172.05), (148.0592, 139.7715)),\n ('horizontal', '22.9166', (111.9444, 133.4461), (129.5126, 133.4461), (120.7285, 144.4461)),\n ('vertical', '16.8859', (111.9444, 133.4461), (111.9444, 146.3911), (100.9444, 139.9186)),\n ('horizontal', '38.5417', (82.3978, 133.4461), (111.9444, 133.4461), (97.1711, 144.4461)),\n ('vertical', '33.8542', (111.9444, 107.493), (111.9444, 133.4461), (100.9444, 120.4696)),\n ('horizontal', '22.9166', (111.9444, 131.4497), (129.5126, 131.4497), (120.7285, 142.4497)),\n ('vertical', '21.9518', (111.9444, 131.4497), (111.9444, 148.2783), (100.9444, 139.864)),\n ('horizontal', '38.5417', (82.3978, 131.4497), (111.9444, 131.4497), (97.1711, 142.4497)),\n ('vertical', '31.25', (111.9444, 107.493), (111.9444, 131.4497), (100.9444, 119.4713)),\n ('horizontal', '30.7292', (108.7502, 129.4533), (132.3076, 129.4533), (120.5289, 140.4533)),\n ('vertical', '26.5242', (108.7502, 129.4533), (108.7502, 149.7871), (97.7502, 139.6202)),\n ('horizontal', '34.375', (82.3978, 129.4533), (108.7502, 129.4533), (95.574, 140.4533)),\n ('vertical', '28.6458', (108.7502, 107.493), (108.7502, 129.4533), (97.7502, 118.4731)),\n ('horizontal', '41.1458', (173.0592, 107.493), (204.6022, 107.493), (188.8307, 118.493)),\n ('horizontal', '41.1458', (173.0592, 133.4461), (141.5163, 133.4461), (157.2877, 122.4461)),\n ('horizontal', '41.1458', (173.0592, 131.4497), (141.5163, 131.4497), (157.2877, 120.4497))\n]\n\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\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\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,\n angle=(0 if d[0] == \"horizontal\" else 90),\n 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,\n text=text, dimstyle=\"EZDXF\").render()\n\n doc.saveas(out_path)\n\n\nif __name__ == \"__main__\":\n out = sys.argv[1] if len(sys.argv) > 1 else \"0025_00256773_gt.dxf\"\n draw(out)\n print(\"wrote\", out)\n```"}], "images": ["images/0025_00256773.png"], "id": "0025_00256773"} {"messages": [{"role": "user", "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 90.53 mm tall. It is extruded to a thickness of -41.15 mm. A cut feature: The part is a rectangular plate 88.54 mm wide and 73.63 mm tall. It is extruded to a thickness of -18.23 mm. A cut feature: The part is a rectangular plate 30.21 mm wide and 11.45 mm tall. It is extruded to a thickness of -28.65 mm."}, {"role": "assistant", "content": "```python\n#!/usr/bin/env python3\n# -*- coding: utf-8 -*-\n# Ground-truth 2D engineering drawing for part: 0027_00279087\n# Self-contained: reproduces the three-view DXF via ezdxf, NO FreeCAD needed.\n# Coordinates are A4 page millimetres (scale=0.7298430278552692, page=[297.0, 210.0]).\n# visible edges -> solid (layer OUTLINE); hidden edges -> dashed (layer HIDDEN)\n# dimensions -> real movable DIMENSION entities (text = true mm value)\n# Run: python 0027_00279087_gt.py [out.dxf]\nimport sys\nimport ezdxf\n\nSCALE = 0.7298430278552692\nPAGE = [297.0, 210.0]\n\nVISIBLE_SEGMENTS = [\n (157.977142, 172.049993, 157.977142, 105.979993),\n (84.992839, 172.049993, 157.977142, 172.049993),\n (157.977142, 105.979993, 84.992839, 105.979993),\n (84.992839, 105.979993, 84.992839, 172.049993),\n (113.882459, 120.732905, 91.835117, 120.732905),\n (91.835117, 120.732905, 91.835117, 112.378123),\n (91.835117, 112.378123, 113.882459, 112.378123),\n (113.882459, 112.378123, 113.882459, 120.732905),\n (157.977142, 91.979993, 157.977142, 61.949993),\n (84.992839, 91.979993, 84.992839, 61.949993),\n (84.992839, 61.949993, 157.977142, 61.949993),\n (84.992839, 91.979993, 157.977142, 91.979993),\n (171.977142, 172.049993, 202.007141, 172.049993),\n (171.977142, 105.979993, 202.007141, 105.979993),\n (171.977142, 105.979993, 171.977142, 172.049993),\n (202.007141, 105.979993, 202.007141, 172.049993)\n]\nVISIBLE_CIRCLES = [\n\n]\nVISIBLE_ARCS = [\n\n]\nHIDDEN_SEGMENTS = [\n (153.7958, 164.0673, 153.7958, 110.3294),\n (89.1742, 164.0673, 153.7958, 164.0673),\n (89.1742, 110.3294, 89.1742, 164.0673),\n (153.7958, 110.3294, 89.1742, 110.3294),\n (153.7958, 91.98, 153.7958, 78.6756),\n (153.7958, 78.6756, 89.1742, 78.6756),\n (89.1742, 91.98, 89.1742, 78.6756),\n (113.8825, 61.95, 113.8825, 78.6756),\n (91.8351, 61.95, 91.8351, 78.6756),\n (171.9772, 164.0673, 185.2816, 164.0673),\n (185.2816, 164.0673, 185.2816, 110.3294),\n (171.9772, 110.3294, 185.2816, 110.3294),\n (202.0072, 120.7329, 185.2816, 120.7329),\n (202.0072, 112.3781, 185.2816, 112.3781)\n]\n# (orient, text, p1, p2, base) for linear; (orient, text, center, radius, angle) for diameter\nDIMENSIONS = [\n ('horizontal', '100', (157.9772, 105.98), (84.9928, 105.98), (121.485, 94.98)),\n ('vertical', '90.5263', (157.9772, 172.05), (157.9772, 105.98), (168.9772, 139.015)),\n ('horizontal', '88.5416', (89.1743, 164.0673), (153.7957, 164.0673), (121.485, 175.0673)),\n ('vertical', '73.6294', (89.1743, 164.0673), (89.1743, 110.3294), (100.1743, 137.1984)),\n ('horizontal', '5.7292', (84.9928, 164.0673), (89.1743, 164.0673), (87.0836, 175.0673)),\n ('vertical', '10.9375', (89.1743, 172.05), (89.1743, 164.0673), (100.1743, 168.0587)),\n ('horizontal', '30.2083', (91.8351, 120.7329), (113.8824, 120.7329), (102.8588, 131.7329)),\n ('vertical', '11.4474', (91.8351, 120.7329), (91.8351, 112.3781), (102.8351, 116.5555)),\n ('horizontal', '9.375', (84.9928, 120.7329), (91.8351, 120.7329), (88.414, 131.7329)),\n ('vertical', '70.3125', (91.8351, 172.05), (91.8351, 120.7329), (102.8351, 146.3915)),\n ('horizontal', '41.1458', (171.9772, 172.05), (202.0071, 172.05), (186.9921, 183.05)),\n ('horizontal', '18.2292', (171.9772, 164.0673), (185.2816, 164.0673), (178.6294, 175.0673)),\n ('horizontal', '28.6458', (202.0071, 120.7329), (181.1002, 120.7329), (191.5537, 109.7329))\n]\n\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\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\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,\n angle=(0 if d[0] == \"horizontal\" else 90),\n 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,\n text=text, dimstyle=\"EZDXF\").render()\n\n doc.saveas(out_path)\n\n\nif __name__ == \"__main__\":\n out = sys.argv[1] if len(sys.argv) > 1 else \"0027_00279087_gt.dxf\"\n draw(out)\n print(\"wrote\", out)\n```"}], "images": ["images/0027_00279087.png"], "id": "0027_00279087"} {"messages": [{"role": "user", "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 46.32 mm wide and 100 mm tall. It is extruded to a thickness of 30.73 mm. A cut feature: The part is a rectangular plate 33.75 mm wide and 84.38 mm tall. It is extruded to a thickness of -24.48 mm."}, {"role": "assistant", "content": "```python\n#!/usr/bin/env python3\n# -*- coding: utf-8 -*-\n# Ground-truth 2D engineering drawing for part: 0035_00354405\n# Self-contained: reproduces the three-view DXF via ezdxf, NO FreeCAD needed.\n# Coordinates are A4 page millimetres (scale=0.7351075697211136, page=[297.0, 210.0]).\n# visible edges -> solid (layer OUTLINE); hidden edges -> dashed (layer HIDDEN)\n# dimensions -> real movable DIMENSION entities (text = true mm value)\n# Run: python 0035_00354405_gt.py [out.dxf]\nimport sys\nimport ezdxf\n\nSCALE = 0.7351075697211136\nPAGE = [297.0, 210.0]\n\nVISIBLE_SEGMENTS = [\n (142.228921, 172.049995, 142.228921, 98.539238),\n (108.181833, 172.049995, 142.228921, 172.049995),\n (142.228921, 98.539238, 108.181833, 98.539238),\n (108.181833, 98.539238, 108.181833, 172.049995),\n (137.203267, 166.306967, 137.203267, 104.282266),\n (112.393387, 166.306967, 137.203267, 166.306967),\n (112.393387, 104.282266, 112.393387, 166.306967),\n (137.203267, 104.282266, 112.393387, 104.282266),\n (142.228921, 61.949995, 142.228921, 84.539238),\n (142.228921, 84.539238, 108.181833, 84.539238),\n (108.181833, 61.949995, 108.181833, 84.539238),\n (142.228921, 61.949995, 108.181833, 61.949995),\n (156.228921, 172.049995, 178.818164, 172.049995),\n (156.228921, 98.539238, 178.818164, 98.539238),\n (156.228921, 98.539238, 156.228921, 172.049995),\n (178.818164, 98.539238, 178.818164, 172.049995)\n]\nVISIBLE_CIRCLES = [\n\n]\nVISIBLE_ARCS = [\n\n]\nHIDDEN_SEGMENTS = [\n (137.2033, 61.95, 137.2033, 79.9448),\n (137.2033, 79.9448, 112.3934, 79.9448),\n (112.3934, 61.95, 112.3934, 79.9448),\n (178.8182, 104.2823, 160.8233, 104.2823),\n (160.8233, 104.2823, 160.8233, 166.307),\n (178.8182, 166.307, 160.8233, 166.307)\n]\n# (orient, text, p1, p2, base) for linear; (orient, text, center, radius, angle) for diameter\nDIMENSIONS = [\n ('horizontal', '46.3158', (142.2289, 172.05), (108.1818, 172.05), (125.2054, 161.05)),\n ('vertical', '100', (142.2289, 98.5392), (142.2289, 172.05), (131.2289, 135.2946)),\n ('horizontal', '33.75', (112.3934, 104.2823), (137.2033, 104.2823), (124.7983, 115.2823)),\n ('vertical', '84.375', (112.3934, 104.2823), (112.3934, 166.307), (101.3934, 135.2946)),\n ('horizontal', '5.7292', (108.1818, 104.2823), (112.3934, 104.2823), (110.2876, 115.2823)),\n ('vertical', '7.8125', (112.3934, 98.5392), (112.3934, 104.2823), (101.3934, 101.4108)),\n ('horizontal', '30.7292', (156.2289, 98.5392), (178.8182, 98.5392), (167.5236, 109.5392)),\n ('horizontal', '24.4792', (178.8182, 104.2823), (160.8233, 104.2823), (169.8208, 93.2823))\n]\n\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\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\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,\n angle=(0 if d[0] == \"horizontal\" else 90),\n 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,\n text=text, dimstyle=\"EZDXF\").render()\n\n doc.saveas(out_path)\n\n\nif __name__ == \"__main__\":\n out = sys.argv[1] if len(sys.argv) > 1 else \"0035_00354405_gt.dxf\"\n draw(out)\n print(\"wrote\", out)\n```"}], "images": ["images/0035_00354405.png"], "id": "0035_00354405"} {"messages": [{"role": "user", "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 69.47 mm tall. It is extruded to a thickness of 4.82 mm. A cut feature: The part is a rectangular plate 17.58 mm wide and 26.51 mm tall. It is extruded to a thickness of -21.69 mm."}, {"role": "assistant", "content": "```python\n#!/usr/bin/env python3\n# -*- coding: utf-8 -*-\n# Ground-truth 2D engineering drawing for part: 0040_00400566\n# Self-contained: reproduces the three-view DXF via ezdxf, NO FreeCAD needed.\n# Coordinates are A4 page millimetres (scale=0.867037267080798, page=[297.0, 210.0]).\n# visible edges -> solid (layer OUTLINE); hidden edges -> dashed (layer HIDDEN)\n# dimensions -> real movable DIMENSION entities (text = true mm value)\n# Run: python 0040_00400566_gt.py [out.dxf]\nimport sys\nimport ezdxf\nimport math\n\nSCALE = 0.867037267080798\nPAGE = [297.0, 210.0]\n\nVISIBLE_SEGMENTS = [\n (177.762617, 156.207383, 177.762617, 95.97111),\n (91.05889, 156.207383, 177.762617, 156.207383),\n (177.762617, 95.97111, 141.816582, 95.97111),\n (141.816582, 118.600947, 141.816582, 95.97111),\n (126.576079, 118.600947, 141.816582, 118.600947),\n (126.576079, 95.97111, 126.576079, 118.600947),\n (126.576079, 95.97111, 91.05889, 95.97111),\n (91.05889, 95.97111, 91.05889, 156.207383),\n (177.762617, 77.792617, 177.762617, 81.97111),\n (91.05889, 77.792617, 91.05889, 81.97111),\n (91.05889, 81.97111, 177.762617, 81.97111),\n (91.05889, 77.792617, 177.762617, 77.792617),\n (195.94111, 156.207383, 191.762617, 156.207383),\n (195.94111, 95.97111, 195.94111, 156.207383),\n (191.762617, 95.97111, 191.762617, 156.207383),\n (195.94111, 95.97111, 191.762617, 95.97111)\n]\nVISIBLE_CIRCLES = [\n\n]\nVISIBLE_ARCS = [\n\n]\nHIDDEN_SEGMENTS = [\n (141.8166, 77.7926, 141.8166, 81.9711),\n (126.5761, 81.9711, 126.5761, 77.7926),\n (191.7626, 118.6009, 195.9411, 118.6009)\n]\n# (orient, text, p1, p2, base) for linear; (orient, text, center, radius, angle) for diameter\nDIMENSIONS = [\n ('horizontal', '100', (177.7626, 95.9711), (91.0589, 95.9711), (134.4107, 84.9711)),\n ('vertical', '69.4737', (177.7626, 156.2074), (177.7626, 95.9711), (188.7626, 126.0893)),\n ('horizontal', '17.5777', (126.5761, 118.601), (141.8165, 118.601), (134.1963, 129.601)),\n ('vertical', '26.5061', (126.5761, 118.601), (126.5761, 95.6192), (137.5761, 107.1101)),\n ('horizontal', '40.9639', (91.0589, 118.601), (126.5761, 118.601), (108.8175, 129.601)),\n ('vertical', '43.3735', (126.5761, 156.2074), (126.5761, 118.601), (137.5761, 137.4042)),\n ('horizontal', '4.8193', (195.9411, 156.2074), (191.7626, 156.2074), (193.8519, 145.2074))\n]\n\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; _ds.dxf.dimasz = 2.5\n _ds.dxf.dimexe = 1.25; _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\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\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,\n angle=(0 if d[0] == \"horizontal\" else 90),\n 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,\n 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,\n 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,\n text=text, dimstyle=\"EZDXF\").render()\n\n doc.saveas(out_path)\n\n\nif __name__ == \"__main__\":\n out = sys.argv[1] if len(sys.argv) > 1 else \"0040_00400566_gt.dxf\"\n draw(out)\n print(\"wrote\", out)\n```"}], "images": ["images/0040_00400566.png"], "id": "0040_00400566"} {"messages": [{"role": "user", "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 42.11 mm tall. It is extruded to a thickness of 0.65 mm. A cut feature: The part is a rectangular plate 45.75 mm wide and 13.48 mm tall. It is extruded to a thickness of -1.96 mm."}, {"role": "assistant", "content": "```python\n#!/usr/bin/env python3\n# -*- coding: utf-8 -*-\n# Ground-truth 2D engineering drawing for part: 0051_00513116\n# Self-contained: reproduces the three-view DXF via ezdxf, NO FreeCAD needed.\n# Coordinates are A4 page millimetres (scale=1.034022222222315, page=[297.0, 210.0]).\n# visible edges -> solid (layer OUTLINE); hidden edges -> dashed (layer HIDDEN)\n# dimensions -> real movable DIMENSION entities (text = true mm value)\n# Run: python 0051_00513116_gt.py [out.dxf]\nimport sys\nimport ezdxf\n\nSCALE = 1.034022222222315\nPAGE = [297.0, 210.0]\n\nVISIBLE_SEGMENTS = [\n (187.863197, 146.106819, 187.863197, 102.569041),\n (84.460975, 146.106819, 187.863197, 146.106819),\n (187.863197, 102.569041, 84.460975, 102.569041),\n (84.460975, 102.569041, 84.460975, 146.106819),\n (160.154105, 124.480211, 160.154105, 110.536739),\n (112.845899, 124.480211, 160.154105, 124.480211),\n (112.845899, 110.536739, 112.845899, 124.480211),\n (160.154105, 110.536739, 112.845899, 110.536739),\n (187.863197, 87.89321, 187.863197, 88.569041),\n (84.460975, 87.89321, 84.460975, 88.569041),\n (84.460975, 88.569041, 187.863197, 88.569041),\n (84.460975, 87.89321, 187.863197, 87.89321),\n (202.539029, 146.106819, 201.863197, 146.106819),\n (202.539029, 102.569041, 201.863197, 102.569041),\n (202.539029, 102.569041, 202.539029, 146.106819),\n (201.863197, 102.569041, 201.863197, 146.106819)\n]\nVISIBLE_CIRCLES = [\n\n]\nVISIBLE_ARCS = [\n\n]\nHIDDEN_SEGMENTS = [\n (160.1541, 88.569, 160.1541, 87.8932),\n (112.8459, 88.569, 112.8459, 87.8932),\n (201.8632, 124.4802, 202.539, 124.4802),\n (201.8632, 110.5367, 202.539, 110.5367)\n]\n# (orient, text, p1, p2, base) for linear; (orient, text, center, radius, angle) for diameter\nDIMENSIONS = [\n ('horizontal', '100', (187.8632, 102.5691), (84.461, 102.5691), (136.1621, 91.5691)),\n ('vertical', '42.1053', (187.8632, 146.1068), (187.8632, 102.5691), (198.8632, 124.3379)),\n ('horizontal', '45.7516', (112.8459, 124.4802), (160.1541, 124.4802), (136.5, 135.4802)),\n ('vertical', '13.4847', (112.8459, 124.4802), (112.8459, 110.5367), (123.8459, 117.5085)),\n ('horizontal', '27.451', (84.461, 124.4802), (112.8459, 124.4802), (98.6534, 135.4802)),\n ('vertical', '20.915', (112.8459, 146.1068), (112.8459, 124.4802), (123.8459, 135.2935)),\n ('horizontal', '0.6536', (202.539, 146.1068), (201.8632, 146.1068), (202.2011, 135.1068))\n]\n\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\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\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,\n angle=(0 if d[0] == \"horizontal\" else 90),\n 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,\n text=text, dimstyle=\"EZDXF\").render()\n\n doc.saveas(out_path)\n\n\nif __name__ == \"__main__\":\n out = sys.argv[1] if len(sys.argv) > 1 else \"0051_00513116_gt.dxf\"\n draw(out)\n print(\"wrote\", out)\n```"}], "images": ["images/0051_00513116.png"], "id": "0051_00513116"} {"messages": [{"role": "user", "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 42.11 mm tall. It is extruded to a thickness of 0.65 mm. A cut feature: The part is a rectangular plate 45.75 mm wide and 13.48 mm tall. It is extruded to a thickness of -1.96 mm."}, {"role": "assistant", "content": "```python\n#!/usr/bin/env python3\n# -*- coding: utf-8 -*-\n# Ground-truth 2D engineering drawing for part: 0058_00580449\n# Self-contained: reproduces the three-view DXF via ezdxf, NO FreeCAD needed.\n# Coordinates are A4 page millimetres (scale=1.034022222222315, page=[297.0, 210.0]).\n# visible edges -> solid (layer OUTLINE); hidden edges -> dashed (layer HIDDEN)\n# dimensions -> real movable DIMENSION entities (text = true mm value)\n# Run: python 0058_00580449_gt.py [out.dxf]\nimport sys\nimport ezdxf\n\nSCALE = 1.034022222222315\nPAGE = [297.0, 210.0]\n\nVISIBLE_SEGMENTS = [\n (187.863197, 146.106819, 187.863197, 102.569041),\n (84.460975, 146.106819, 187.863197, 146.106819),\n (187.863197, 102.569041, 84.460975, 102.569041),\n (84.460975, 102.569041, 84.460975, 146.106819),\n (160.154105, 124.480211, 160.154105, 110.536739),\n (112.845899, 124.480211, 160.154105, 124.480211),\n (112.845899, 110.536739, 112.845899, 124.480211),\n (160.154105, 110.536739, 112.845899, 110.536739),\n (187.863197, 87.89321, 187.863197, 88.569041),\n (84.460975, 87.89321, 84.460975, 88.569041),\n (84.460975, 88.569041, 187.863197, 88.569041),\n (84.460975, 87.89321, 187.863197, 87.89321),\n (202.539029, 146.106819, 201.863197, 146.106819),\n (202.539029, 102.569041, 201.863197, 102.569041),\n (202.539029, 102.569041, 202.539029, 146.106819),\n (201.863197, 102.569041, 201.863197, 146.106819)\n]\nVISIBLE_CIRCLES = [\n\n]\nVISIBLE_ARCS = [\n\n]\nHIDDEN_SEGMENTS = [\n (160.1541, 88.569, 160.1541, 87.8932),\n (112.8459, 88.569, 112.8459, 87.8932),\n (201.8632, 124.4802, 202.539, 124.4802),\n (201.8632, 110.5367, 202.539, 110.5367)\n]\n# (orient, text, p1, p2, base) for linear; (orient, text, center, radius, angle) for diameter\nDIMENSIONS = [\n ('horizontal', '100', (187.8632, 102.5691), (84.461, 102.5691), (136.1621, 91.5691)),\n ('vertical', '42.1053', (187.8632, 146.1068), (187.8632, 102.5691), (198.8632, 124.3379)),\n ('horizontal', '45.7516', (112.8459, 124.4802), (160.1541, 124.4802), (136.5, 135.4802)),\n ('vertical', '13.4847', (112.8459, 124.4802), (112.8459, 110.5367), (123.8459, 117.5085)),\n ('horizontal', '27.451', (84.461, 124.4802), (112.8459, 124.4802), (98.6534, 135.4802)),\n ('vertical', '20.915', (112.8459, 146.1068), (112.8459, 124.4802), (123.8459, 135.2935)),\n ('horizontal', '0.6536', (202.539, 146.1068), (201.8632, 146.1068), (202.2011, 135.1068))\n]\n\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\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\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,\n angle=(0 if d[0] == \"horizontal\" else 90),\n 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,\n text=text, dimstyle=\"EZDXF\").render()\n\n doc.saveas(out_path)\n\n\nif __name__ == \"__main__\":\n out = sys.argv[1] if len(sys.argv) > 1 else \"0058_00580449_gt.dxf\"\n draw(out)\n print(\"wrote\", out)\n```"}], "images": ["images/0058_00580449.png"], "id": "0058_00580449"} {"messages": [{"role": "user", "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 -36.46 mm. A cut feature: The part is a rectangular plate 73.44 mm wide and 60.3 mm tall. It is extruded to a thickness of -33.33 mm."}, {"role": "assistant", "content": "```python\n#!/usr/bin/env python3\n# -*- coding: utf-8 -*-\n# Ground-truth 2D engineering drawing for part: 0067_00673669\n# Self-contained: reproduces the three-view DXF via ezdxf, NO FreeCAD needed.\n# Coordinates are A4 page millimetres (scale=0.7042442748091775, page=[297.0, 210.0]).\n# visible edges -> solid (layer OUTLINE); hidden edges -> dashed (layer HIDDEN)\n# dimensions -> real movable DIMENSION entities (text = true mm value)\n# Run: python 0067_00673669_gt.py [out.dxf]\nimport sys\nimport ezdxf\n\nSCALE = 0.7042442748091775\nPAGE = [297.0, 210.0]\n\nVISIBLE_SEGMENTS = [\n (158.874447, 101.625584, 158.874447, 172.050011),\n (88.450019, 101.625584, 158.874447, 101.625584),\n (158.874447, 172.050011, 88.450019, 172.050011),\n (88.450019, 172.050011, 88.450019, 101.625584),\n (149.7046, 111.162225, 149.7046, 153.625375),\n (97.986661, 111.162225, 149.7046, 111.162225),\n (97.986661, 153.625375, 97.986661, 111.162225),\n (149.7046, 153.625375, 97.986661, 153.625375),\n (158.874447, 61.950011, 158.874447, 87.625584),\n (158.874447, 87.625584, 88.450019, 87.625584),\n (88.450019, 61.950011, 88.450019, 87.625584),\n (158.874447, 61.950011, 88.450019, 61.950011),\n (198.550019, 101.625584, 172.874447, 101.625584),\n (198.550019, 172.050011, 172.874447, 172.050011),\n (198.550019, 172.050011, 198.550019, 101.625584),\n (172.874447, 172.050011, 172.874447, 101.625584)\n]\nVISIBLE_CIRCLES = [\n\n]\nVISIBLE_ARCS = [\n\n]\nHIDDEN_SEGMENTS = [\n (149.7046, 61.95, 149.7046, 85.4248),\n (149.7046, 85.4248, 97.9866, 85.4248),\n (97.9866, 61.95, 97.9866, 85.4248),\n (198.55, 111.1622, 175.0752, 111.1622),\n (175.0752, 111.1622, 175.0752, 153.6254),\n (198.55, 153.6254, 175.0752, 153.6254)\n]\n# (orient, text, p1, p2, base) for linear; (orient, text, center, radius, angle) for diameter\nDIMENSIONS = [\n ('horizontal', '100', (158.8744, 172.05), (88.45, 172.05), (123.6622, 161.05)),\n ('vertical', '100', (158.8744, 101.6256), (158.8744, 172.05), (147.8744, 136.8378)),\n ('horizontal', '73.4375', (97.9867, 111.1622), (149.7046, 111.1622), (123.8456, 122.1622)),\n ('vertical', '60.296', (97.9867, 111.1622), (97.9867, 153.6254), (86.9867, 132.3938)),\n ('horizontal', '13.5417', (88.45, 111.1622), (97.9867, 111.1622), (93.2183, 122.1622)),\n ('vertical', '13.5417', (97.9867, 101.6256), (97.9867, 111.1622), (86.9867, 106.3939)),\n ('horizontal', '36.4583', (198.55, 101.6256), (172.8745, 101.6256), (185.7122, 90.6256)),\n ('horizontal', '33.3333', (198.55, 111.1622), (175.0752, 111.1622), (186.8126, 100.1622))\n]\n\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\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\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,\n angle=(0 if d[0] == \"horizontal\" else 90),\n 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,\n text=text, dimstyle=\"EZDXF\").render()\n\n doc.saveas(out_path)\n\n\nif __name__ == \"__main__\":\n out = sys.argv[1] if len(sys.argv) > 1 else \"0067_00673669_gt.dxf\"\n draw(out)\n print(\"wrote\", out)\n```"}], "images": ["images/0067_00673669.png"], "id": "0067_00673669"} {"messages": [{"role": "user", "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 83.16 mm wide and 100 mm tall. It is extruded to a thickness of 2.6 mm. A cut feature: The part is a rectangular plate 41.67 mm wide and 79.17 mm tall. It is extruded to a thickness of -3.65 mm."}, {"role": "assistant", "content": "```python\n#!/usr/bin/env python3\n# -*- coding: utf-8 -*-\n# Ground-truth 2D engineering drawing for part: 0068_00681181\n# Self-contained: reproduces the three-view DXF via ezdxf, NO FreeCAD needed.\n# Coordinates are A4 page millimetres (scale=0.5246839080459973, page=[297.0, 210.0]).\n# visible edges -> solid (layer OUTLINE); hidden edges -> dashed (layer HIDDEN)\n# dimensions -> real movable DIMENSION entities (text = true mm value)\n# Run: python 0068_00681181_gt.py [out.dxf]\nimport sys\nimport ezdxf\nimport math\n\nSCALE = 0.5246839080459973\nPAGE = [297.0, 210.0]\n\nVISIBLE_SEGMENTS = [\n (157.632622, 98.448987, 157.632622, 150.917378),\n (114.001013, 98.448987, 157.632622, 98.448987),\n (157.632622, 150.917378, 146.793757, 150.917378),\n (146.793757, 109.379902, 146.793757, 150.917378),\n (146.793757, 109.379902, 124.931928, 109.379902),\n (124.931928, 150.917378, 124.931928, 109.379902),\n (124.931928, 150.917378, 114.001013, 150.917378),\n (114.001013, 150.917378, 114.001013, 98.448987),\n (157.632622, 84.448987, 157.632622, 83.082622),\n (157.632622, 84.448987, 146.793757, 84.448987),\n (157.632622, 83.082622, 146.793757, 83.082622),\n (146.793757, 83.082622, 146.793757, 84.448987),\n (124.931928, 84.448987, 146.793757, 84.448987),\n (124.931928, 84.448987, 114.001013, 84.448987),\n (146.793757, 83.082622, 124.931928, 83.082622),\n (124.931928, 83.082622, 114.001013, 83.082622),\n (114.001013, 84.448987, 114.001013, 83.082622),\n (124.931928, 83.082622, 124.931928, 84.448987),\n (171.632622, 98.448987, 172.998987, 98.448987),\n (171.632622, 150.917378, 171.632622, 98.448987),\n (172.998987, 150.917378, 172.998987, 98.448987),\n (171.632622, 150.917378, 172.998987, 150.917378)\n]\nVISIBLE_CIRCLES = [\n\n]\nVISIBLE_ARCS = [\n\n]\nHIDDEN_SEGMENTS = [\n (172.999, 109.3799, 171.6326, 109.3799)\n]\n# (orient, text, p1, p2, base) for linear; (orient, text, center, radius, angle) for diameter\nDIMENSIONS = [\n ('horizontal', '83.1579', (157.6326, 150.9174), (114.001, 150.9174), (135.8168, 139.9174)),\n ('vertical', '100', (157.6326, 98.449), (157.6326, 150.9174), (146.6326, 124.6832)),\n ('horizontal', '41.6667', (124.9319, 109.3799), (146.7937, 109.3799), (135.8628, 120.3799)),\n ('vertical', '79.1667', (124.9319, 109.3799), (124.9319, 150.9174), (113.9319, 130.1486)),\n ('horizontal', '20.8334', (114.001, 109.3799), (124.9319, 109.3799), (119.4665, 120.3799)),\n ('vertical', '20.8333', (124.9319, 98.449), (124.9319, 109.3799), (113.9319, 103.9144)),\n ('horizontal', '2.6042', (171.6326, 98.449), (172.999, 98.449), (172.3158, 109.449))\n]\n\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; _ds.dxf.dimasz = 2.5\n _ds.dxf.dimexe = 1.25; _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\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\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,\n angle=(0 if d[0] == \"horizontal\" else 90),\n 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,\n 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,\n 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,\n text=text, dimstyle=\"EZDXF\").render()\n\n doc.saveas(out_path)\n\n\nif __name__ == \"__main__\":\n out = sys.argv[1] if len(sys.argv) > 1 else \"0068_00681181_gt.dxf\"\n draw(out)\n print(\"wrote\", out)\n```"}], "images": ["images/0068_00681181.png"], "id": "0068_00681181"} {"messages": [{"role": "user", "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 45.26 mm tall. It is extruded to a thickness of 15.1 mm. A cut feature: The part is a rectangular plate 91.67 mm wide and 37.63 mm tall. It is extruded to a thickness of -1.56 mm."}, {"role": "assistant", "content": "```python\n#!/usr/bin/env python3\n# -*- coding: utf-8 -*-\n# Ground-truth 2D engineering drawing for part: 0068_00687823\n# Self-contained: reproduces the three-view DXF via ezdxf, NO FreeCAD needed.\n# Coordinates are A4 page millimetres (scale=1.0115434782608683, page=[297.0, 210.0]).\n# visible edges -> solid (layer OUTLINE); hidden edges -> dashed (layer HIDDEN)\n# dimensions -> real movable DIMENSION entities (text = true mm value)\n# Run: python 0068_00687823_gt.py [out.dxf]\nimport sys\nimport ezdxf\n\nSCALE = 1.0115434782608683\nPAGE = [297.0, 210.0]\n\nVISIBLE_SEGMENTS = [\n (179.437905, 108.746469, 179.437905, 154.532121),\n (78.283557, 108.746469, 179.437905, 108.746469),\n (179.437905, 154.532121, 78.283557, 154.532121),\n (78.283557, 154.532121, 78.283557, 108.746469),\n (179.437905, 94.746469, 179.437905, 79.467947),\n (78.283557, 94.746469, 78.283557, 79.467947),\n (78.283557, 79.467947, 179.437905, 79.467947),\n (78.283557, 94.746469, 179.437905, 94.746469),\n (208.716427, 108.746469, 193.437905, 108.746469),\n (208.716427, 154.532121, 193.437905, 154.532121),\n (208.716427, 154.532121, 208.716427, 108.746469),\n (193.437905, 154.532121, 193.437905, 108.746469)\n]\nVISIBLE_CIRCLES = [\n\n]\nVISIBLE_ARCS = [\n\n]\nHIDDEN_SEGMENTS = [\n (175.2231, 150.3173, 175.2231, 112.2513),\n (82.4983, 150.3173, 175.2231, 150.3173),\n (82.4983, 112.2513, 82.4983, 150.3173),\n (175.2231, 112.2513, 82.4983, 112.2513),\n (175.2231, 94.7464, 175.2231, 93.1659),\n (175.2231, 93.1659, 82.4983, 93.1659),\n (82.4983, 94.7464, 82.4983, 93.1659),\n (193.4379, 150.3173, 195.0184, 150.3173),\n (195.0184, 150.3173, 195.0184, 112.2513),\n (193.4379, 112.2513, 195.0184, 112.2513)\n]\n# (orient, text, p1, p2, base) for linear; (orient, text, center, radius, angle) for diameter\nDIMENSIONS = [\n ('horizontal', '100', (179.4379, 108.7465), (78.2836, 108.7465), (128.8607, 97.7465)),\n ('vertical', '45.2632', (179.4379, 154.5321), (179.4379, 108.7465), (190.4379, 131.6393)),\n ('horizontal', '91.6666', (82.4984, 150.3174), (175.2231, 150.3174), (128.8607, 161.3174)),\n ('vertical', '37.6316', (82.4984, 150.3174), (82.4984, 112.2514), (93.4984, 131.2844)),\n ('horizontal', '4.1667', (78.2836, 150.3174), (82.4984, 150.3174), (80.391, 161.3174)),\n ('vertical', '4.1666', (82.4984, 154.5321), (82.4984, 150.3174), (93.4984, 152.4247)),\n ('horizontal', '15.1042', (208.7164, 154.5321), (193.4379, 154.5321), (201.0772, 143.5321)),\n ('horizontal', '1.5625', (193.4379, 150.3174), (195.0184, 150.3174), (194.2281, 161.3174))\n]\n\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\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\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,\n angle=(0 if d[0] == \"horizontal\" else 90),\n 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,\n text=text, dimstyle=\"EZDXF\").render()\n\n doc.saveas(out_path)\n\n\nif __name__ == \"__main__\":\n out = sys.argv[1] if len(sys.argv) > 1 else \"0068_00687823_gt.dxf\"\n draw(out)\n print(\"wrote\", out)\n```"}], "images": ["images/0068_00687823.png"], "id": "0068_00687823"} {"messages": [{"role": "user", "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 3.16 mm wide and 100 mm tall. It is extruded to a thickness of 1.04 mm. A cut feature: The part is a rectangular plate 2.25 mm wide and 5.21 mm tall. It is extruded to a thickness of -1.04 mm."}, {"role": "assistant", "content": "```python\n#!/usr/bin/env python3\n# -*- coding: utf-8 -*-\n# Ground-truth 2D engineering drawing for part: 0071_00718131\n# Self-contained: reproduces the three-view DXF via ezdxf, NO FreeCAD needed.\n# Coordinates are A4 page millimetres (scale=0.9510927835051514, page=[297.0, 210.0]).\n# visible edges -> solid (layer OUTLINE); hidden edges -> dashed (layer HIDDEN)\n# dimensions -> real movable DIMENSION entities (text = true mm value)\n# Run: python 0071_00718131_gt.py [out.dxf]\nimport sys\nimport ezdxf\nimport math\n\nSCALE = 0.9510927835051514\nPAGE = [297.0, 210.0]\n\nVISIBLE_SEGMENTS = [\n (137.506365, 172.05, 137.506365, 76.940722),\n (134.502914, 172.05, 137.506365, 172.05),\n (137.506365, 76.940722, 134.502914, 76.940722),\n (134.502914, 76.940722, 134.502914, 83.875773),\n (134.502914, 83.875773, 136.484357, 83.875773),\n (136.484357, 83.875773, 136.484357, 88.829381),\n (136.484357, 88.829381, 134.502914, 88.829381),\n (134.502914, 88.829381, 134.502914, 172.05),\n (137.506365, 61.95, 137.506365, 62.940722),\n (134.502914, 61.95, 134.502914, 62.940722),\n (134.502914, 62.940722, 137.506365, 62.940722),\n (134.502914, 61.95, 137.506365, 61.95),\n (152.497086, 172.05, 151.506365, 172.05),\n (152.497086, 76.940722, 151.506365, 76.940722),\n (152.497086, 76.940722, 152.497086, 83.875773),\n (152.497086, 83.875773, 152.497086, 88.829381),\n (152.497086, 88.829381, 152.497086, 172.05),\n (151.506365, 76.940722, 151.506365, 83.875773),\n (151.506365, 83.875773, 151.506365, 88.829381),\n (151.506365, 88.829381, 151.506365, 172.05),\n (151.506365, 88.829381, 152.497086, 88.829381),\n (152.497086, 83.875773, 151.506365, 83.875773)\n]\nVISIBLE_CIRCLES = [\n\n]\nVISIBLE_ARCS = [\n\n]\nHIDDEN_SEGMENTS = [\n (136.4844, 61.95, 136.4844, 62.9407)\n]\n# (orient, text, p1, p2, base) for linear; (orient, text, center, radius, angle) for diameter\nDIMENSIONS = [\n ('horizontal', '3.1579', (137.5064, 76.9407), (134.5029, 76.9407), (136.0046, 65.9407)),\n ('vertical', '100', (137.5064, 172.05), (137.5064, 76.9407), (148.5064, 124.4954)),\n ('horizontal', '2.2478', (134.3465, 88.8294), (136.4843, 88.8294), (135.4154, 99.8294)),\n ('vertical', '5.2083', (134.3465, 88.8294), (134.3465, 83.8758), (145.3465, 86.3526)),\n ('vertical', '87.5', (134.3465, 172.05), (134.3465, 88.8294), (145.3465, 130.4397)),\n ('horizontal', '1.0417', (152.4971, 172.05), (151.5063, 172.05), (152.0017, 161.05))\n]\n\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; _ds.dxf.dimasz = 2.5\n _ds.dxf.dimexe = 1.25; _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\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\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,\n angle=(0 if d[0] == \"horizontal\" else 90),\n 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,\n 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,\n 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,\n text=text, dimstyle=\"EZDXF\").render()\n\n doc.saveas(out_path)\n\n\nif __name__ == \"__main__\":\n out = sys.argv[1] if len(sys.argv) > 1 else \"0071_00718131_gt.dxf\"\n draw(out)\n print(\"wrote\", out)\n```"}], "images": ["images/0071_00718131.png"], "id": "0071_00718131"} {"messages": [{"role": "user", "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 12.63 mm tall. It is extruded to a thickness of 5.21 mm. A cut feature: The part is a rectangular plate 87.5 mm wide and 2.76 mm tall. It is extruded to a thickness of -4.69 mm."}, {"role": "assistant", "content": "```python\n#!/usr/bin/env python3\n# -*- coding: utf-8 -*-\n# Ground-truth 2D engineering drawing for part: 0080_00806983\n# Self-contained: reproduces the three-view DXF via ezdxf, NO FreeCAD needed.\n# Coordinates are A4 page millimetres (scale=1.3966574257425786, page=[297.0, 210.0]).\n# visible edges -> solid (layer OUTLINE); hidden edges -> dashed (layer HIDDEN)\n# dimensions -> real movable DIMENSION entities (text = true mm value)\n# Run: python 0080_00806983_gt.py [out.dxf]\nimport sys\nimport ezdxf\n\nSCALE = 1.3966574257425786\nPAGE = [297.0, 210.0]\n\nVISIBLE_SEGMENTS = [\n (202.69572, 118.816121, 202.69572, 136.458109),\n (63.029978, 118.816121, 202.69572, 118.816121),\n (202.69572, 136.458109, 63.029978, 136.458109),\n (63.029978, 136.458109, 63.029978, 118.816121),\n (193.966611, 126.090378, 193.966611, 129.949563),\n (71.759087, 126.090378, 193.966611, 126.090378),\n (71.759087, 129.949563, 71.759087, 126.090378),\n (193.966611, 129.949563, 71.759087, 129.949563),\n (202.69572, 104.816121, 202.69572, 97.541863),\n (202.69572, 97.541863, 63.029978, 97.541863),\n (63.029978, 104.816121, 63.029978, 97.541863),\n (202.69572, 104.816121, 63.029978, 104.816121),\n (216.69572, 118.816121, 223.969978, 118.816121),\n (216.69572, 136.458109, 223.969978, 136.458109),\n (216.69572, 136.458109, 216.69572, 118.816121),\n (223.969978, 136.458109, 223.969978, 118.816121)\n]\nVISIBLE_CIRCLES = [\n\n]\nVISIBLE_ARCS = [\n\n]\nHIDDEN_SEGMENTS = [\n (193.9666, 97.5419, 193.9666, 104.0887),\n (193.9666, 104.0887, 71.7591, 104.0887),\n (71.7591, 97.5419, 71.7591, 104.0887),\n (223.97, 126.0904, 217.4232, 126.0904),\n (217.4232, 126.0904, 217.4232, 129.9496),\n (223.97, 129.9496, 217.4232, 129.9496)\n]\n# (orient, text, p1, p2, base) for linear; (orient, text, center, radius, angle) for diameter\nDIMENSIONS = [\n ('horizontal', '100', (202.6957, 136.4582), (63.03, 136.4582), (132.8629, 125.4582)),\n ('vertical', '12.6316', (202.6957, 118.8161), (202.6957, 136.4582), (191.6957, 127.6371)),\n ('horizontal', '87.5', (71.7591, 126.0903), (193.9666, 126.0903), (132.8629, 137.0903)),\n ('vertical', '2.7632', (71.7591, 126.0903), (71.7591, 129.9496), (60.7591, 128.02)),\n ('horizontal', '6.25', (63.03, 126.0903), (71.7591, 126.0903), (67.3946, 137.0903)),\n ('vertical', '5.2083', (71.7591, 118.8161), (71.7591, 126.0903), (60.7591, 122.4532)),\n ('horizontal', '5.2083', (216.6957, 118.8161), (223.97, 118.8161), (220.3328, 129.8161)),\n ('horizontal', '4.6875', (223.97, 126.0903), (217.4231, 126.0903), (220.6965, 115.0903))\n]\n\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\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\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,\n angle=(0 if d[0] == \"horizontal\" else 90),\n 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,\n text=text, dimstyle=\"EZDXF\").render()\n\n doc.saveas(out_path)\n\n\nif __name__ == \"__main__\":\n out = sys.argv[1] if len(sys.argv) > 1 else \"0080_00806983_gt.dxf\"\n draw(out)\n print(\"wrote\", out)\n```"}], "images": ["images/0080_00806983.png"], "id": "0080_00806983"} {"messages": [{"role": "user", "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 rectilinear stepped plate with 12 edges within a 75.66 x 75.66 mm bounding box. It is extruded to a thickness of -97.92 mm."}, {"role": "assistant", "content": "```python\n#!/usr/bin/env python3\n# -*- coding: utf-8 -*-\n# Ground-truth 2D engineering drawing for part: 0097_00976707\n# Self-contained: reproduces the three-view DXF via ezdxf, NO FreeCAD needed.\n# Coordinates are A4 page millimetres (scale=0.4805, page=[297.0, 210.0]).\n# visible edges -> solid (layer OUTLINE); hidden edges -> dashed (layer HIDDEN)\n# dimensions -> real movable DIMENSION entities (text = true mm value)\n# Run: python 0097_00976707_gt.py [out.dxf]\nimport sys\nimport ezdxf\n\nSCALE = 0.4805\nPAGE = [297.0, 210.0]\n\nVISIBLE_SEGMENTS = [\n (136.5, 172.05, 136.5, 124.0),\n (88.45, 172.05, 136.5, 172.05),\n (136.5, 124.0, 88.45, 124.0),\n (88.45, 124.0, 88.45, 172.05),\n (94.298191, 166.04375, 94.298191, 170.890899),\n (89.451042, 166.04375, 94.298191, 166.04375),\n (89.451042, 129.690132, 89.451042, 166.04375),\n (94.298191, 129.690132, 89.451042, 129.690132),\n (94.298191, 124.842982, 94.298191, 129.690132),\n (130.651809, 124.842982, 94.298191, 124.842982),\n (130.651809, 129.690132, 130.651809, 124.842982),\n (135.498958, 129.690132, 130.651809, 129.690132),\n (135.498958, 166.04375, 135.498958, 129.690132),\n (130.651809, 166.04375, 135.498958, 166.04375),\n (130.651809, 170.890899, 130.651809, 166.04375),\n (94.298191, 170.890899, 130.651809, 170.890899),\n (136.5, 61.95, 136.5, 110.0),\n (136.5, 110.0, 88.45, 110.0),\n (88.45, 61.95, 88.45, 110.0),\n (136.5, 61.95, 88.45, 61.95),\n (150.5, 172.05, 198.55, 172.05),\n (150.5, 124.0, 198.55, 124.0),\n (150.5, 124.0, 150.5, 172.05),\n (198.55, 124.0, 198.55, 172.05)\n]\nVISIBLE_CIRCLES = [\n\n]\nVISIBLE_ARCS = [\n\n]\nHIDDEN_SEGMENTS = [\n (94.2982, 61.95, 94.2982, 108.999),\n (94.2982, 108.999, 130.6518, 108.999),\n (130.6518, 61.95, 130.6518, 108.999),\n (130.6518, 108.999, 135.499, 108.999),\n (135.499, 61.95, 135.499, 108.999),\n (94.2982, 108.999, 89.451, 108.999),\n (89.451, 61.95, 89.451, 108.999),\n (198.55, 130.0063, 151.501, 130.0063),\n (151.501, 130.0063, 151.501, 125.1591),\n (198.55, 125.1591, 151.501, 125.1591),\n (151.501, 130.0063, 151.501, 166.3599),\n (198.55, 166.3599, 151.501, 166.3599),\n (151.501, 166.3599, 151.501, 171.207),\n (198.55, 171.207, 151.501, 171.207)\n]\n# (orient, text, p1, p2, base) for linear; (orient, text, center, radius, angle) for diameter\nDIMENSIONS = [\n ('horizontal', '100', (136.5, 172.05), (88.45, 172.05), (112.475, 161.05)),\n ('vertical', '100', (136.5, 124.0), (136.5, 172.05), (125.5, 148.025)),\n ('horizontal', '95.8334', (89.451, 125.1591), (135.499, 125.1591), (112.475, 136.1591)),\n ('vertical', '95.8333', (89.451, 125.1591), (89.451, 171.207), (78.451, 148.1831)),\n ('horizontal', '2.0833', (88.45, 125.1591), (89.451, 125.1591), (88.9505, 136.1591)),\n ('vertical', '2.4123', (89.451, 124.0), (89.451, 125.1591), (78.451, 124.5796)),\n ('horizontal', '100', (150.5, 124.0), (198.55, 124.0), (174.525, 135.0)),\n ('horizontal', '97.9167', (198.55, 130.0062), (151.501, 130.0062), (175.0255, 119.0062))\n]\n\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\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\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,\n angle=(0 if d[0] == \"horizontal\" else 90),\n 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,\n text=text, dimstyle=\"EZDXF\").render()\n\n doc.saveas(out_path)\n\n\nif __name__ == \"__main__\":\n out = sys.argv[1] if len(sys.argv) > 1 else \"0097_00976707_gt.dxf\"\n draw(out)\n print(\"wrote\", out)\n```"}], "images": ["images/0097_00976707.png"], "id": "0097_00976707"} {"messages": [{"role": "user", "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 89.23 x 100 mm bounding box, featuring a rectangular cutout 67.69 x 86.15 mm. It is extruded to a thickness of 94.95 mm."}, {"role": "assistant", "content": "```python\n#!/usr/bin/env python3\n# -*- coding: utf-8 -*-\n# Ground-truth 2D engineering drawing for part: 0001_00013763\n# Self-contained: reproduces the three-view DXF via ezdxf, NO FreeCAD needed.\n# Coordinates are A4 page millimetres (scale=0.3985889613414148, page=[297.0, 210.0]).\n# visible edges -> solid (layer OUTLINE); hidden edges -> dashed (layer HIDDEN)\n# dimensions -> real movable DIMENSION entities (text = true mm value)\n# Run: python 0001_00013763_gt.py [out.dxf]\nimport sys\nimport ezdxf\nimport math\n\nSCALE = 0.3985889613414148\nPAGE = [297.0, 210.0]\n\nVISIBLE_SEGMENTS = [\n (135.360855, 153.653586, 135.360855, 113.79469),\n (135.360855, 153.653586, 127.389075, 153.653586),\n (127.389075, 153.653586, 127.389075, 172.05),\n (107.15302, 172.05, 127.389075, 172.05),\n (107.15302, 172.05, 107.15302, 153.653586),\n (107.15302, 153.653586, 99.794455, 153.653586),\n (99.794455, 113.79469, 99.794455, 153.653586),\n (99.794455, 113.79469, 135.360855, 113.79469),\n (122.483365, 146.295021, 122.483365, 154.2668),\n (131.068358, 146.295021, 122.483365, 146.295021),\n (131.068358, 119.926828, 131.068358, 146.295021),\n (122.483365, 119.926828, 131.068358, 119.926828),\n (104.086952, 119.926828, 112.671945, 119.926828),\n (104.086952, 146.295021, 104.086952, 119.926828),\n (112.671945, 146.295021, 104.086952, 146.295021),\n (112.671945, 154.2668, 112.671945, 146.295021),\n (135.360855, 99.79469, 135.360855, 61.95),\n (135.360855, 61.95, 127.389075, 61.95),\n (135.360855, 99.79469, 127.389075, 99.79469),\n (127.389075, 99.79469, 127.389075, 61.95),\n (107.15302, 61.95, 127.389075, 61.95),\n (107.15302, 99.79469, 107.15302, 61.95),\n (127.389075, 99.79469, 107.15302, 99.79469),\n (107.15302, 61.95, 99.794455, 61.95),\n (99.794455, 99.79469, 99.794455, 61.95),\n (107.15302, 99.79469, 99.794455, 99.79469),\n (149.360855, 172.05, 187.205545, 172.05),\n (187.205545, 172.05, 187.205545, 153.653586),\n (149.360855, 172.05, 149.360855, 153.653586),\n (149.360855, 153.653586, 187.205545, 153.653586),\n (187.205545, 113.79469, 187.205545, 153.653586),\n (149.360855, 113.79469, 187.205545, 113.79469),\n (149.360855, 153.653586, 149.360855, 113.79469)\n]\nVISIBLE_CIRCLES = [\n\n]\nVISIBLE_ARCS = [\n (117.577655, 154.2668, 4.90571, -0.0, -180.0),\n (117.577655, 119.926828, 4.90571, -180.0, -0.0)\n]\nHIDDEN_SEGMENTS = [\n (112.6719, 99.7947, 112.6719, 61.95),\n (122.4834, 99.7947, 122.4834, 61.95),\n (131.0684, 99.7947, 131.0684, 61.95),\n (104.087, 99.7947, 104.087, 61.95),\n (149.3609, 146.295, 187.2055, 146.295),\n (149.3609, 119.9268, 187.2055, 119.9268),\n (187.2055, 159.1725, 149.3609, 159.1725),\n (187.2055, 115.0211, 149.3609, 115.0211)\n]\n# (orient, text, p1, p2, base) for linear; (orient, text, center, radius, angle) for diameter\nDIMENSIONS = [\n ('horizontal', '18.4615', (107.153, 153.6536), (99.7945, 153.6536), (103.4737, 142.6536)),\n ('horizontal', '20', (135.3609, 153.6536), (127.3891, 153.6536), (131.375, 142.6536)),\n ('horizontal', '50.7692', (127.3891, 172.05), (107.153, 172.05), (117.271, 161.05)),\n ('horizontal', '89.2308', (99.7945, 113.7947), (135.3609, 113.7947), (117.5777, 124.7947)),\n ('vertical', '46.1538', (127.3891, 153.6536), (127.3891, 172.05), (116.3891, 162.8518)),\n ('vertical', '100', (135.3609, 113.7947), (135.3609, 153.6536), (124.3609, 133.7241)),\n ('horizontal', '67.6923', (104.0869, 119.9268), (131.0683, 119.9268), (117.5776, 130.9268)),\n ('vertical', '86.1538', (104.0869, 119.9268), (104.0869, 154.2668), (93.0869, 137.0968)),\n ('horizontal', '10.7692', (99.7945, 119.9268), (104.0869, 119.9268), (101.9407, 130.9268)),\n ('vertical', '15.3846', (104.0869, 113.7947), (104.0869, 119.9268), (93.0869, 116.8608)),\n ('radius', 'R12.3077', (117.5777, 119.9268), 4.9057, 45),\n ('horizontal', '94.9467', (149.3609, 113.7947), (187.2056, 113.7947), (168.2832, 124.7947))\n]\n\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; _ds.dxf.dimasz = 2.5\n _ds.dxf.dimexe = 1.25; _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\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\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,\n angle=(0 if d[0] == \"horizontal\" else 90),\n 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,\n 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,\n 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,\n text=text, dimstyle=\"EZDXF\").render()\n\n doc.saveas(out_path)\n\n\nif __name__ == \"__main__\":\n out = sys.argv[1] if len(sys.argv) > 1 else \"0001_00013763_gt.dxf\"\n draw(out)\n print(\"wrote\", out)\n```"}], "images": ["images/0001_00013763.png"], "id": "0001_00013763"} {"messages": [{"role": "user", "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 82.61 mm wide and 100 mm tall, featuring a circular hole of diameter 269.57 mm. It is extruded to a thickness of 2.55 mm."}, {"role": "assistant", "content": "```python\n#!/usr/bin/env python3\n# -*- coding: utf-8 -*-\n# Ground-truth 2D engineering drawing for part: 0001_00014538\n# Self-contained: reproduces the three-view DXF via ezdxf, NO FreeCAD needed.\n# Coordinates are A4 page millimetres (scale=0.1993442911473999, page=[297.0, 210.0]).\n# visible edges -> solid (layer OUTLINE); hidden edges -> dashed (layer HIDDEN)\n# dimensions -> real movable DIMENSION entities (text = true mm value)\n# Run: python 0001_00014538_gt.py [out.dxf]\nimport sys\nimport ezdxf\nimport math\n\nSCALE = 0.1993442911473999\nPAGE = [297.0, 210.0]\n\nVISIBLE_SEGMENTS = [\n (94.142835, 145.993552, 110.610407, 145.993552),\n (110.610407, 126.059122, 94.142835, 126.059122),\n (94.142835, 126.059122, 94.142835, 145.993552),\n (110.610407, 88.006448, 175.076092, 88.006448),\n (110.610407, 89.022965, 175.076092, 89.022965),\n (110.610407, 89.022965, 110.610407, 88.006448),\n (94.142835, 89.022965, 94.142835, 88.006448),\n (94.142835, 89.022965, 110.610407, 89.022965),\n (94.142835, 88.006448, 110.610407, 88.006448),\n (175.076092, 89.022965, 175.076092, 88.006448),\n (190.092609, 145.993552, 190.092609, 169.029709),\n (190.092609, 103.022965, 190.092609, 126.059122),\n (189.076092, 145.993552, 189.076092, 169.029709),\n (189.076092, 103.022965, 189.076092, 126.059122),\n (189.076092, 145.993552, 190.092609, 145.993552),\n (190.092609, 126.059122, 189.076092, 126.059122),\n (189.076092, 126.059122, 189.076092, 145.993552),\n (190.092609, 126.059122, 190.092609, 145.993552),\n (189.076092, 103.022965, 190.092609, 103.022965),\n (189.076092, 169.029709, 190.092609, 169.029709)\n]\nVISIBLE_CIRCLES = [\n (142.678836, 136.459694, 26.868144)\n]\nVISIBLE_ARCS = [\n (142.07272, 136.026337, 33.003372, -162.421875, 162.421875)\n]\nHIDDEN_SEGMENTS = [\n (169.547, 89.023, 169.547, 88.0064),\n (115.8107, 89.023, 115.8107, 88.0064),\n (189.0761, 109.5916, 190.0926, 109.5916),\n (189.0761, 163.3278, 190.0926, 163.3278)\n]\n# (orient, text, p1, p2, base) for linear; (orient, text, center, radius, angle) for diameter\nDIMENSIONS = [\n ('horizontal', '82.6087', (110.6104, 126.0591), (94.1428, 126.0591), (102.3766, 115.0591)),\n ('vertical', '100', (110.6104, 145.9935), (110.6104, 126.0591), (121.6104, 136.0263)),\n ('diameter', '%%c269.565', (142.6788, 136.4597), 26.8681, 45),\n ('horizontal', '243.478', (94.1428, 136.4597), (142.6788, 136.4597), (118.4108, 147.4597)),\n ('vertical', '47.8261', (142.6788, 145.9935), (142.6788, 136.4597), (153.6788, 141.2266)),\n ('radius', 'R165.56', (142.0727, 136.0263), 33.0034, 135),\n ('horizontal', '5.0993', (190.0926, 145.9935), (189.0761, 145.9935), (189.5844, 134.9935))\n]\n\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; _ds.dxf.dimasz = 2.5\n _ds.dxf.dimexe = 1.25; _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\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\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,\n angle=(0 if d[0] == \"horizontal\" else 90),\n 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,\n 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,\n 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,\n text=text, dimstyle=\"EZDXF\").render()\n\n doc.saveas(out_path)\n\n\nif __name__ == \"__main__\":\n out = sys.argv[1] if len(sys.argv) > 1 else \"0001_00014538_gt.dxf\"\n draw(out)\n print(\"wrote\", out)\n```"}], "images": ["images/0001_00014538.png"], "id": "0001_00014538"} {"messages": [{"role": "user", "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 22.09 mm tall, featuring 2 circular holes, each of diameter 11.63 mm. It is extruded to a thickness of 10.36 mm."}, {"role": "assistant", "content": "```python\n#!/usr/bin/env python3\n# -*- coding: utf-8 -*-\n# Ground-truth 2D engineering drawing for part: 0006_00062070\n# Self-contained: reproduces the three-view DXF via ezdxf, NO FreeCAD needed.\n# Coordinates are A4 page millimetres (scale=1.109407078189357, page=[297.0, 210.0]).\n# visible edges -> solid (layer OUTLINE); hidden edges -> dashed (layer HIDDEN)\n# dimensions -> real movable DIMENSION entities (text = true mm value)\n# Run: python 0006_00062070_gt.py [out.dxf]\nimport sys\nimport ezdxf\nimport math\n\nSCALE = 1.109407078189357\nPAGE = [297.0, 210.0]\n\nVISIBLE_SEGMENTS = [\n (181.710757, 141.999646, 70.770049, 141.999646),\n (70.770049, 117.48949, 181.710757, 117.48949),\n (193.965835, 103.48949, 181.710757, 103.48949),\n (193.965835, 92.000354, 181.710757, 92.000354),\n (181.710757, 92.000354, 70.770049, 92.000354),\n (181.710757, 103.48949, 70.770049, 103.48949),\n (70.770049, 103.48949, 58.514971, 103.48949),\n (70.770049, 92.000354, 58.514971, 92.000354),\n (193.965835, 92.000354, 193.965835, 103.48949),\n (58.514971, 92.000354, 58.514971, 103.48949),\n (181.710757, 103.48949, 181.710757, 92.000354),\n (70.770049, 103.48949, 70.770049, 92.000354),\n (207.965835, 141.999646, 219.454971, 141.999646),\n (207.965835, 141.999646, 207.965835, 117.48949),\n (207.965835, 117.48949, 219.454971, 117.48949),\n (219.454971, 141.999646, 219.454971, 117.48949)\n]\nVISIBLE_CIRCLES = [\n (70.770049, 129.099564, 6.450041),\n (181.710757, 129.099564, 6.450041)\n]\nVISIBLE_ARCS = [\n (181.710757, 129.744568, 12.255078, -90.0, 90.0),\n (70.770049, 129.744568, 12.255078, 90.0, -90.0)\n]\nHIDDEN_SEGMENTS = [\n (77.2201, 103.4895, 77.2201, 92.0004),\n (188.1608, 103.4895, 188.1608, 92.0004),\n (64.32, 92.0004, 64.32, 103.4895),\n (175.2607, 92.0004, 175.2607, 103.4895),\n (219.455, 135.5496, 207.9658, 135.5496),\n (219.455, 122.6495, 207.9658, 122.6495)\n]\n# (orient, text, p1, p2, base) for linear; (orient, text, center, radius, angle) for diameter\nDIMENSIONS = [\n ('horizontal', '100', (181.7108, 141.9996), (70.7701, 141.9996), (126.2404, 130.9996)),\n ('vertical', '22.093', (181.7108, 117.4895), (181.7108, 141.9996), (170.7108, 129.7446)),\n ('diameter', '%%c11.6279', (70.7701, 129.0996), 6.45, 45),\n ('vertical', '10.4651', (70.7701, 117.4895), (70.7701, 129.0996), (59.7701, 123.2945)),\n ('diameter', '%%c11.6279', (181.7108, 129.0996), 6.45, 45),\n ('horizontal', '100', (70.7701, 129.0996), (181.7108, 129.0996), (126.2404, 140.0996)),\n ('vertical', '10.4651', (181.7108, 117.4895), (181.7108, 129.0996), (170.7108, 123.2945)),\n ('radius', 'R11.0465', (181.7108, 129.7446), 12.2551, 135),\n ('horizontal', '10.3561', (207.9658, 117.4895), (219.455, 117.4895), (213.7104, 128.4895))\n]\n\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; _ds.dxf.dimasz = 2.5\n _ds.dxf.dimexe = 1.25; _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\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\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,\n angle=(0 if d[0] == \"horizontal\" else 90),\n 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,\n 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,\n 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,\n text=text, dimstyle=\"EZDXF\").render()\n\n doc.saveas(out_path)\n\n\nif __name__ == \"__main__\":\n out = sys.argv[1] if len(sys.argv) > 1 else \"0006_00062070_gt.dxf\"\n draw(out)\n print(\"wrote\", out)\n```"}], "images": ["images/0006_00062070.png"], "id": "0006_00062070"} {"messages": [{"role": "user", "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 16.84 mm bounding box. It is extruded to a thickness of 3.65 mm."}, {"role": "assistant", "content": "```python\n#!/usr/bin/env python3\n# -*- coding: utf-8 -*-\n# Ground-truth 2D engineering drawing for part: 0007_00071788\n# Self-contained: reproduces the three-view DXF via ezdxf, NO FreeCAD needed.\n# Coordinates are A4 page millimetres (scale=1.417712562813872, page=[297.0, 210.0]).\n# visible edges -> solid (layer OUTLINE); hidden edges -> dashed (layer HIDDEN)\n# dimensions -> real movable DIMENSION entities (text = true mm value)\n# Run: python 0007_00071788_gt.py [out.dxf]\nimport sys\nimport ezdxf\nimport math\n\nSCALE = 1.417712562813872\nPAGE = [297.0, 210.0]\n\nVISIBLE_SEGMENTS = [\n (204.801256, 143.062608, 180.923992, 143.062608),\n (180.923992, 143.062608, 180.923992, 166.939872),\n (86.907264, 166.939872, 86.907264, 143.062608),\n (86.907264, 143.062608, 63.03, 143.062608),\n (204.801256, 91.17345, 204.801256, 86.004707),\n (63.03, 91.17345, 63.03, 86.004707),\n (204.801256, 86.004707, 180.923992, 86.004707),\n (204.801256, 91.17345, 180.923992, 91.17345),\n (180.923992, 91.17345, 180.923992, 86.004707),\n (180.923992, 86.004707, 86.907264, 86.004707),\n (86.907264, 91.17345, 86.907264, 86.004707),\n (180.923992, 91.17345, 86.907264, 91.17345),\n (86.907264, 86.004707, 63.03, 86.004707),\n (86.907264, 91.17345, 63.03, 91.17345),\n (218.801256, 143.062608, 218.801256, 105.17345),\n (223.97, 143.062608, 223.97, 105.17345),\n (218.801256, 143.062608, 223.97, 143.062608),\n (218.801256, 166.939872, 223.97, 166.939872),\n (223.97, 166.939872, 223.97, 143.062608),\n (218.801256, 166.939872, 218.801256, 143.062608),\n (223.97, 105.17345, 218.801256, 105.17345)\n]\nVISIBLE_CIRCLES = [\n\n]\nVISIBLE_ARCS = [\n (133.915628, 190.426871, 85.25342, -146.25, -33.75),\n (133.915628, 191.329468, 52.958839, -152.578125, -27.421875)\n]\nHIDDEN_SEGMENTS = [\n (223.97, 138.3706, 218.8013, 138.3706)\n]\n# (orient, text, p1, p2, base) for linear; (orient, text, center, radius, angle) for diameter\nDIMENSIONS = [\n ('horizontal', '16.8421', (204.8013, 143.0626), (180.924, 143.0626), (192.8626, 132.0626)),\n ('horizontal', '66.3158', (180.924, 166.9398), (86.9073, 166.9398), (133.9156, 155.9398)),\n ('horizontal', '100', (63.03, 143.0626), (204.8013, 143.0626), (133.9156, 154.0626)),\n ('vertical', '16.8421', (180.924, 143.0626), (180.924, 166.9398), (169.924, 155.0012)),\n ('radius', 'R60.1345', (133.9156, 190.4269), 85.2534, 45),\n ('radius', 'R37.3551', (133.9156, 191.3294), 52.9588, 45),\n ('horizontal', '3.6458', (218.8013, 143.0626), (223.97, 143.0626), (221.3856, 154.0626))\n]\n\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; _ds.dxf.dimasz = 2.5\n _ds.dxf.dimexe = 1.25; _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\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\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,\n angle=(0 if d[0] == \"horizontal\" else 90),\n 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,\n 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,\n 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,\n text=text, dimstyle=\"EZDXF\").render()\n\n doc.saveas(out_path)\n\n\nif __name__ == \"__main__\":\n out = sys.argv[1] if len(sys.argv) > 1 else \"0007_00071788_gt.dxf\"\n draw(out)\n print(\"wrote\", out)\n```"}], "images": ["images/0007_00071788.png"], "id": "0007_00071788"} {"messages": [{"role": "user", "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 a circular hole of diameter 25.26 mm. It is extruded to a thickness of 9.09 mm. The outline includes one or more oblique (angled) edges."}, {"role": "assistant", "content": "```python\n#!/usr/bin/env python3\n# -*- coding: utf-8 -*-\n# Ground-truth 2D engineering drawing for part: 0007_00072717\n# Self-contained: reproduces the three-view DXF via ezdxf, NO FreeCAD needed.\n# Coordinates are A4 page millimetres (scale=0.8131538461538472, page=[297.0, 210.0]).\n# visible edges -> solid (layer OUTLINE); hidden edges -> dashed (layer HIDDEN)\n# dimensions -> real movable DIMENSION entities (text = true mm value)\n# Run: python 0007_00072717_gt.py [out.dxf]\nimport sys\nimport ezdxf\nimport math\n\nSCALE = 0.8131538461538472\nPAGE = [297.0, 210.0]\n\nVISIBLE_SEGMENTS = [\n (159.493968, 172.05, 159.493968, 106.141741),\n (98.721417, 172.05, 159.493968, 172.05),\n (98.721417, 90.734615, 98.721417, 172.05),\n (144.086842, 90.734615, 98.721417, 90.734615),\n (159.493968, 76.734615, 159.493968, 61.95),\n (98.721417, 76.734615, 98.721417, 61.95),\n (98.721417, 76.734615, 159.493968, 76.734615),\n (98.721417, 61.95, 159.493968, 61.95),\n (173.493968, 172.05, 188.278583, 172.05),\n (173.493968, 90.734615, 173.493968, 172.05),\n (173.493968, 90.734615, 188.278583, 90.734615),\n (188.278583, 90.734615, 188.278583, 172.05)\n]\nVISIBLE_CIRCLES = [\n (144.086842, 106.141741, 10.271417)\n]\nVISIBLE_ARCS = [\n (144.086842, 106.141741, 15.407126, -90.0, -0.0)\n]\nHIDDEN_SEGMENTS = [\n (154.3583, 76.7346, 154.3583, 61.95),\n (133.8154, 76.7346, 133.8154, 61.95),\n (173.494, 95.8703, 188.2786, 95.8703),\n (173.494, 116.4132, 188.2786, 116.4132)\n]\n# (orient, text, p1, p2, base) for linear; (orient, text, center, radius, angle) for diameter\nDIMENSIONS = [\n ('horizontal', '55.7895', (144.0869, 90.7346), (98.7214, 90.7346), (121.4041, 79.7346)),\n ('horizontal', '74.7368', (98.7214, 172.05), (159.4939, 172.05), (129.1077, 183.05)),\n ('vertical', '81.0526', (159.4939, 172.05), (159.4939, 106.1418), (170.4939, 139.0959)),\n ('vertical', '100', (98.7214, 90.7346), (98.7214, 172.05), (87.7214, 131.3923)),\n ('diameter', '%%c25.2632', (144.0869, 106.1418), 10.2714, 45),\n ('horizontal', '55.7895', (98.7214, 106.1418), (144.0869, 106.1418), (121.4041, 117.1418)),\n ('vertical', '81.0526', (144.0869, 172.05), (144.0869, 106.1418), (155.0869, 139.0959)),\n ('radius', 'R18.9474', (144.0869, 106.1418), 15.4072, 135),\n ('horizontal', '18.1818', (188.2786, 172.05), (173.494, 172.05), (180.8863, 161.05))\n]\n\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; _ds.dxf.dimasz = 2.5\n _ds.dxf.dimexe = 1.25; _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\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\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,\n angle=(0 if d[0] == \"horizontal\" else 90),\n 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,\n 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,\n 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,\n text=text, dimstyle=\"EZDXF\").render()\n\n doc.saveas(out_path)\n\n\nif __name__ == \"__main__\":\n out = sys.argv[1] if len(sys.argv) > 1 else \"0007_00072717_gt.dxf\"\n draw(out)\n print(\"wrote\", out)\n```"}], "images": ["images/0007_00072717.png"], "id": "0007_00072717"} {"messages": [{"role": "user", "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 40.1 mm. The outline includes one or more oblique (angled) edges."}, {"role": "assistant", "content": "```python\n#!/usr/bin/env python3\n# -*- coding: utf-8 -*-\n# Ground-truth 2D engineering drawing for part: 0008_00085169\n# Self-contained: reproduces the three-view DXF via ezdxf, NO FreeCAD needed.\n# Coordinates are A4 page millimetres (scale=0.9600000000000256, page=[297.0, 210.0]).\n# visible edges -> solid (layer OUTLINE); hidden edges -> dashed (layer HIDDEN)\n# dimensions -> real movable DIMENSION entities (text = true mm value)\n# Run: python 0008_00085169_gt.py [out.dxf]\nimport sys\nimport ezdxf\nimport math\n\nSCALE = 0.9600000000000256\nPAGE = [297.0, 210.0]\n\nVISIBLE_SEGMENTS = [\n (165.25, 114.45, 165.25, 172.05),\n (165.25, 172.05, 88.45, 172.05),\n (69.25, 152.85, 69.25, 114.45),\n (69.25, 114.45, 165.25, 114.45),\n (165.25, 100.45, 165.25, 61.95),\n (165.25, 61.95, 88.45, 61.95),\n (88.45, 100.45, 88.45, 61.95),\n (165.25, 100.45, 88.45, 100.45),\n (88.45, 61.95, 69.25, 61.95),\n (69.25, 100.45, 69.25, 61.95),\n (88.45, 100.45, 69.25, 100.45),\n (179.25, 172.05, 217.75, 172.05),\n (217.75, 172.05, 217.75, 152.85),\n (179.25, 152.85, 217.75, 152.85),\n (179.25, 172.05, 179.25, 152.85),\n (217.75, 152.85, 217.75, 114.45),\n (179.25, 114.45, 217.75, 114.45),\n (179.25, 152.85, 179.25, 114.45)\n]\nVISIBLE_CIRCLES = [\n\n]\nVISIBLE_ARCS = [\n (69.25, 172.05, 19.2, -90.0, -0.0)\n]\nHIDDEN_SEGMENTS = [\n\n]\n# (orient, text, p1, p2, base) for linear; (orient, text, center, radius, angle) for diameter\nDIMENSIONS = [\n ('horizontal', '80', (165.25, 172.05), (88.45, 172.05), (126.85, 161.05)),\n ('horizontal', '100', (69.25, 114.45), (165.25, 114.45), (117.25, 125.45)),\n ('vertical', '40', (69.25, 152.85), (69.25, 114.45), (80.25, 133.65)),\n ('vertical', '60', (165.25, 114.45), (165.25, 172.05), (154.25, 143.25)),\n ('radius', 'R20', (69.25, 172.05), 19.2, 45),\n ('horizontal', '40.1042', (179.25, 114.45), (217.75, 114.45), (198.5, 125.45))\n]\n\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; _ds.dxf.dimasz = 2.5\n _ds.dxf.dimexe = 1.25; _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\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\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,\n angle=(0 if d[0] == \"horizontal\" else 90),\n 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,\n 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,\n 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,\n text=text, dimstyle=\"EZDXF\").render()\n\n doc.saveas(out_path)\n\n\nif __name__ == \"__main__\":\n out = sys.argv[1] if len(sys.argv) > 1 else \"0008_00085169_gt.dxf\"\n draw(out)\n print(\"wrote\", out)\n```"}], "images": ["images/0008_00085169.png"], "id": "0008_00085169"} {"messages": [{"role": "user", "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, featuring a circular hole of diameter 309.68 mm. It is extruded to a thickness of 248.63 mm."}, {"role": "assistant", "content": "```python\n#!/usr/bin/env python3\n# -*- coding: utf-8 -*-\n# Ground-truth 2D engineering drawing for part: 0008_00087512\n# Self-contained: reproduces the three-view DXF via ezdxf, NO FreeCAD needed.\n# Coordinates are A4 page millimetres (scale=0.1721272211926367, page=[297.0, 210.0]).\n# visible edges -> solid (layer OUTLINE); hidden edges -> dashed (layer HIDDEN)\n# dimensions -> real movable DIMENSION entities (text = true mm value)\n# Run: python 0008_00087512_gt.py [out.dxf]\nimport sys\nimport ezdxf\nimport math\n\nSCALE = 0.1721272211926367\nPAGE = [297.0, 210.0]\n\nVISIBLE_SEGMENTS = [\n (101.775978, 144.148733, 118.9887, 144.148733),\n (137.311921, 115.157007, 84.008007, 115.157007),\n (137.311921, 115.157007, 137.311921, 72.360921),\n (137.311921, 72.360921, 84.008007, 72.360921),\n (84.008007, 72.360921, 84.008007, 115.157007),\n (151.311921, 182.460921, 151.311921, 129.157007),\n (194.108007, 182.460921, 194.108007, 129.157007),\n (194.108007, 182.460921, 151.311921, 182.460921),\n (194.108007, 129.157007, 151.311921, 129.157007)\n]\nVISIBLE_CIRCLES = [\n (110.659964, 155.808964, 26.651957)\n]\nVISIBLE_ARCS = [\n (110.382339, 155.176765, 13.988815, -52.03125, -127.96875)\n]\nHIDDEN_SEGMENTS = [\n (101.776, 115.157, 101.776, 72.3609),\n (118.9887, 115.157, 118.9887, 72.3609),\n (124.3712, 72.3609, 124.3712, 115.157),\n (96.3935, 72.3609, 96.3935, 115.157),\n (151.3119, 144.1487, 194.108, 144.1487),\n (194.108, 169.1656, 151.3119, 169.1656)\n]\n# (orient, text, p1, p2, base) for linear; (orient, text, center, radius, angle) for diameter\nDIMENSIONS = [\n ('horizontal', '100', (118.9887, 144.1487), (101.776, 144.1487), (110.3823, 133.1487)),\n ('diameter', '%%c309.677', (110.66, 155.809), 26.652, 45),\n ('horizontal', '51.6129', (101.776, 155.809), (110.66, 155.809), (106.218, 166.809)),\n ('vertical', '67.7419', (110.66, 144.1487), (110.66, 155.809), (99.66, 149.9789)),\n ('radius', 'R81.2702', (110.3823, 155.1768), 13.9888, 135)\n]\n\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; _ds.dxf.dimasz = 2.5\n _ds.dxf.dimexe = 1.25; _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\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\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,\n angle=(0 if d[0] == \"horizontal\" else 90),\n 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,\n 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,\n 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,\n text=text, dimstyle=\"EZDXF\").render()\n\n doc.saveas(out_path)\n\n\nif __name__ == \"__main__\":\n out = sys.argv[1] if len(sys.argv) > 1 else \"0008_00087512_gt.dxf\"\n draw(out)\n print(\"wrote\", out)\n```"}], "images": ["images/0008_00087512.png"], "id": "0008_00087512"} {"messages": [{"role": "user", "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 97.73 x 73.02 mm. It is extruded to a thickness of 9.81 mm. The outline includes one or more oblique (angled) edges."}, {"role": "assistant", "content": "```python\n#!/usr/bin/env python3\n# -*- coding: utf-8 -*-\n# Ground-truth 2D engineering drawing for part: 0009_00096631\n# Self-contained: reproduces the three-view DXF via ezdxf, NO FreeCAD needed.\n# Coordinates are A4 page millimetres (scale=0.6179380041095958, page=[297.0, 210.0]).\n# visible edges -> solid (layer OUTLINE); hidden edges -> dashed (layer HIDDEN)\n# dimensions -> real movable DIMENSION entities (text = true mm value)\n# Run: python 0009_00096631_gt.py [out.dxf]\nimport sys\nimport ezdxf\nimport math\n\nSCALE = 0.6179380041095958\nPAGE = [297.0, 210.0]\n\nVISIBLE_SEGMENTS = [\n (166.803182, 119.499329, 107.107389, 103.534176),\n (107.107389, 151.429637, 166.803182, 135.464483),\n (166.803182, 120.887604, 106.413252, 104.92245),\n (106.413252, 150.041363, 166.803182, 134.076209),\n (166.803182, 82.570363, 172.876711, 82.570363),\n (166.803182, 88.63409, 172.876711, 88.63409),\n (75.632344, 82.570363, 107.107389, 82.570363),\n (75.632344, 88.63409, 107.107389, 88.63409),\n (107.107389, 88.63409, 166.803182, 88.63409),\n (107.107389, 82.570363, 166.803182, 82.570363),\n (172.876711, 88.63409, 172.876711, 82.570363),\n (75.632344, 88.63409, 75.632344, 82.570363),\n (166.803182, 82.570363, 166.803182, 88.63409),\n (107.107389, 82.570363, 107.107389, 88.63409),\n (192.940438, 102.63409, 192.940438, 152.329723),\n (186.876711, 102.63409, 186.876711, 152.329723),\n (186.876711, 102.63409, 192.940438, 102.63409),\n (186.876711, 152.329723, 192.940438, 152.329723)\n]\nVISIBLE_CIRCLES = [\n\n]\nVISIBLE_ARCS = [\n (164.594105, 127.481906, 8.282605, -74.53125, 74.53125),\n (100.48016, 127.481906, 24.847816, 74.53125, -74.53125),\n (100.17021, 127.481906, 23.407363, 74.53125, -74.53125),\n (164.978293, 127.481906, 6.842152, -74.53125, 74.53125)\n]\nHIDDEN_SEGMENTS = [\n (106.4133, 82.5704, 106.4133, 88.6341),\n (76.7628, 88.6341, 76.7628, 82.5704),\n (171.8204, 88.6341, 171.8204, 82.5704),\n (192.9404, 150.0414, 186.8767, 150.0414),\n (192.9404, 104.9224, 186.8767, 104.9224),\n (192.9404, 120.8876, 186.8767, 120.8876),\n (192.9404, 134.0762, 186.8767, 134.0762),\n (186.8767, 104.0745, 192.9404, 104.0745),\n (186.8767, 150.8893, 192.9404, 150.8893)\n]\n# (orient, text, p1, p2, base) for linear; (orient, text, center, radius, angle) for diameter\nDIMENSIONS = [\n ('vertical', '25.8362', (166.8032, 135.4645), (166.8032, 119.4993), (177.8032, 127.4819)),\n ('vertical', '77.5085', (107.1074, 103.5342), (107.1074, 151.4297), (96.1074, 127.4819)),\n ('aligned', '100', (166.8032, 119.4993), (107.1074, 103.5342), (139.7973, 100.8902)),\n ('aligned', '100', (107.1074, 151.4297), (166.8032, 135.4645), (139.7973, 154.0736)),\n ('horizontal', '97.7281', (106.4132, 150.0413), (166.8032, 150.0413), (136.6082, 161.0413)),\n ('vertical', '73.0153', (106.4132, 150.0413), (106.4132, 104.9225), (117.4132, 127.4819)),\n ('horizontal', '1.1233', (107.1074, 150.0413), (106.4132, 150.0413), (106.7603, 139.0413)),\n ('vertical', '2.2466', (106.4132, 151.4297), (106.4132, 150.0413), (117.4132, 150.7355)),\n ('radius', 'R13.4036', (164.5941, 127.4819), 8.2826, 45),\n ('radius', 'R40.2109', (100.4802, 127.4819), 24.8478, 45),\n ('radius', 'R11.0726', (164.9783, 127.4819), 6.8422, 135),\n ('radius', 'R37.8798', (100.1702, 127.4819), 23.4074, 135),\n ('horizontal', '9.8128', (192.9404, 135.4645), (186.8767, 135.4645), (189.9086, 124.4645))\n]\n\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; _ds.dxf.dimasz = 2.5\n _ds.dxf.dimexe = 1.25; _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\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\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,\n angle=(0 if d[0] == \"horizontal\" else 90),\n 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,\n 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,\n 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,\n text=text, dimstyle=\"EZDXF\").render()\n\n doc.saveas(out_path)\n\n\nif __name__ == \"__main__\":\n out = sys.argv[1] if len(sys.argv) > 1 else \"0009_00096631_gt.dxf\"\n draw(out)\n print(\"wrote\", out)\n```"}], "images": ["images/0009_00096631.png"], "id": "0009_00096631"} {"messages": [{"role": "user", "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 circular hole of diameter 16.84 mm. It is extruded to a thickness of 8.33 mm. The outline includes one or more oblique (angled) edges."}, {"role": "assistant", "content": "```python\n#!/usr/bin/env python3\n# -*- coding: utf-8 -*-\n# Ground-truth 2D engineering drawing for part: 0009_00096753\n# Self-contained: reproduces the three-view DXF via ezdxf, NO FreeCAD needed.\n# Coordinates are A4 page millimetres (scale=1.0655954198473303, page=[297.0, 210.0]).\n# visible edges -> solid (layer OUTLINE); hidden edges -> dashed (layer HIDDEN)\n# dimensions -> real movable DIMENSION entities (text = true mm value)\n# Run: python 0009_00096753_gt.py [out.dxf]\nimport sys\nimport ezdxf\nimport math\n\nSCALE = 1.0655954198473303\nPAGE = [297.0, 210.0]\n\nVISIBLE_SEGMENTS = [\n (185.33979, 153.116928, 162.906202, 130.68334),\n (162.906202, 130.68334, 123.647424, 130.68334),\n (87.753683, 130.68334, 78.780248, 130.68334),\n (78.780248, 130.68334, 78.780248, 153.116928),\n (78.780248, 153.116928, 185.33979, 153.116928),\n (185.33979, 89.856508, 185.33979, 98.736469),\n (78.780248, 89.856508, 78.780248, 98.736469),\n (78.780248, 98.736469, 185.33979, 98.736469),\n (78.780248, 89.856508, 185.33979, 89.856508),\n (208.219752, 112.73647, 208.219752, 130.68334),\n (199.33979, 112.73647, 199.33979, 130.68334),\n (208.219752, 130.68334, 199.33979, 130.68334),\n (199.33979, 130.68334, 199.33979, 153.116928),\n (208.219752, 153.116928, 199.33979, 153.116928),\n (208.219752, 130.68334, 208.219752, 153.116928),\n (199.33979, 112.73647, 208.219752, 112.73647)\n]\nVISIBLE_CIRCLES = [\n (105.700553, 130.68334, 8.973435)\n]\nVISIBLE_ARCS = [\n (105.700553, 130.68334, 17.94687, -180.0, 0.0)\n]\nHIDDEN_SEGMENTS = [\n (162.9062, 89.8565, 162.9062, 98.7365),\n (123.6474, 89.8565, 123.6474, 98.7365),\n (87.7537, 89.8565, 87.7537, 98.7365),\n (114.674, 89.8565, 114.674, 98.7365),\n (96.7271, 98.7365, 96.7271, 89.8565),\n (199.3398, 121.7099, 208.2198, 121.7099),\n (199.3398, 139.6568, 208.2198, 139.6568)\n]\n# (orient, text, p1, p2, base) for linear; (orient, text, center, radius, angle) for diameter\nDIMENSIONS = [\n ('horizontal', '78.9474', (162.9062, 130.6834), (78.7802, 130.6834), (120.8432, 119.6834)),\n ('horizontal', '100', (78.7802, 153.1169), (185.3398, 153.1169), (132.06, 164.1169)),\n ('vertical', '21.0526', (78.7802, 130.6834), (78.7802, 153.1169), (67.7802, 141.9002)),\n ('aligned', '29.7729', (185.3398, 153.1169), (162.9062, 130.6834), (181.9012, 134.122)),\n ('diameter', '%%c16.8421', (105.7006, 130.6834), 8.9734, 45),\n ('horizontal', '25.2632', (78.7802, 130.6834), (105.7006, 130.6834), (92.2404, 141.6834)),\n ('vertical', '21.0526', (105.7006, 153.1169), (105.7006, 130.6834), (116.7006, 141.9002)),\n ('radius', 'R16.8421', (105.7006, 130.6834), 17.9469, 135),\n ('horizontal', '8.3333', (208.2198, 153.1169), (199.3398, 153.1169), (203.7798, 142.1169))\n]\n\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; _ds.dxf.dimasz = 2.5\n _ds.dxf.dimexe = 1.25; _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\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\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,\n angle=(0 if d[0] == \"horizontal\" else 90),\n 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,\n 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,\n 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,\n text=text, dimstyle=\"EZDXF\").render()\n\n doc.saveas(out_path)\n\n\nif __name__ == \"__main__\":\n out = sys.argv[1] if len(sys.argv) > 1 else \"0009_00096753_gt.dxf\"\n draw(out)\n print(\"wrote\", out)\n```"}], "images": ["images/0009_00096753.png"], "id": "0009_00096753"} {"messages": [{"role": "user", "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 4.12 mm. The outline includes one or more oblique (angled) edges."}, {"role": "assistant", "content": "```python\n#!/usr/bin/env python3\n# -*- coding: utf-8 -*-\n# Ground-truth 2D engineering drawing for part: 0010_00102467\n# Self-contained: reproduces the three-view DXF via ezdxf, NO FreeCAD needed.\n# Coordinates are A4 page millimetres (scale=0.9552702396197256, page=[297.0, 210.0]).\n# visible edges -> solid (layer OUTLINE); hidden edges -> dashed (layer HIDDEN)\n# dimensions -> real movable DIMENSION entities (text = true mm value)\n# Run: python 0010_00102467_gt.py [out.dxf]\nimport sys\nimport ezdxf\nimport math\n\nSCALE = 0.9552702396197256\nPAGE = [297.0, 210.0]\n\nVISIBLE_SEGMENTS = [\n (167.126477, 111.363721, 76.501585, 141.572018),\n (76.501585, 141.572018, 167.126477, 112.953631),\n (186.205402, 92.762104, 192.565043, 92.762104),\n (192.565043, 92.762104, 192.565043, 96.695476),\n (186.205402, 96.695476, 192.565043, 96.695476),\n (186.205402, 92.762104, 186.205402, 96.695476),\n (167.126477, 96.695476, 186.205402, 96.695476),\n (167.126477, 92.762104, 186.205402, 92.762104),\n (76.501585, 92.762104, 167.126477, 92.762104),\n (76.501585, 96.695476, 167.126477, 96.695476),\n (76.501585, 92.762104, 76.501585, 96.695476),\n (167.126477, 92.762104, 167.126477, 96.695476),\n (210.498415, 110.695476, 210.498415, 111.363721),\n (210.498415, 111.363721, 210.498415, 141.572018),\n (206.565043, 110.695476, 206.565043, 111.363721),\n (206.565043, 111.363721, 206.565043, 141.572018),\n (210.498415, 141.572018, 206.565043, 141.572018),\n (210.498415, 111.363721, 206.565043, 111.363721),\n (206.565043, 110.695476, 210.498415, 110.695476)\n]\nVISIBLE_CIRCLES = [\n\n]\nVISIBLE_ARCS = [\n (192.981332, 126.846536, 6.788706, 93.515625, 176.484375),\n (171.494602, 127.003344, 14.713088, -107.270727, 1.010523),\n (193.776287, 127.745563, 6.000425, 101.645727, -175.385523),\n (171.714964, 126.782982, 16.087505, -106.572033, 1.709217)\n]\nHIDDEN_SEGMENTS = [\n (187.7953, 92.7621, 187.7953, 96.6955),\n (187.7759, 96.6955, 187.7759, 92.7621),\n (187.8025, 96.6955, 187.8025, 92.7621),\n (210.4984, 133.6225, 206.565, 133.6225),\n (210.4984, 127.2628, 206.565, 127.2628),\n (206.565, 112.2903, 210.4984, 112.2903)\n]\n# (orient, text, p1, p2, base) for linear; (orient, text, center, radius, angle) for diameter\nDIMENSIONS = [\n ('aligned', '99.4862', (76.5016, 141.572), (167.1265, 112.9536), (125.1265, 137.7522)),\n ('aligned', '100', (167.1265, 111.3638), (76.5016, 141.572), (118.3355, 116.0324)),\n ('radius', 'R15.402', (171.4946, 127.0034), 14.7131, 45),\n ('radius', 'R7.1066', (192.9813, 126.8465), 6.7887, 45),\n ('radius', 'R6.2814', (193.7763, 127.7456), 6.0004, 45),\n ('radius', 'R16.8408', (171.7149, 126.783), 16.0875, 45),\n ('horizontal', '4.1175', (210.4984, 141.572), (206.5651, 141.572), (208.5318, 130.572))\n]\n\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; _ds.dxf.dimasz = 2.5\n _ds.dxf.dimexe = 1.25; _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\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\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,\n angle=(0 if d[0] == \"horizontal\" else 90),\n 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,\n 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,\n 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,\n text=text, dimstyle=\"EZDXF\").render()\n\n doc.saveas(out_path)\n\n\nif __name__ == \"__main__\":\n out = sys.argv[1] if len(sys.argv) > 1 else \"0010_00102467_gt.dxf\"\n draw(out)\n print(\"wrote\", out)\n```"}], "images": ["images/0010_00102467.png"], "id": "0010_00102467"} {"messages": [{"role": "user", "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 18.39 mm wide and 100 mm tall, featuring a circular hole of diameter 6.9 mm and a rectangular cutout 12.64 x 100 mm. It is extruded to a thickness of 3.41 mm."}, {"role": "assistant", "content": "```python\n#!/usr/bin/env python3\n# -*- coding: utf-8 -*-\n# Ground-truth 2D engineering drawing for part: 0010_00107234\n# Self-contained: reproduces the three-view DXF via ezdxf, NO FreeCAD needed.\n# Coordinates are A4 page millimetres (scale=0.7889778826304874, page=[297.0, 210.0]).\n# visible edges -> solid (layer OUTLINE); hidden edges -> dashed (layer HIDDEN)\n# dimensions -> real movable DIMENSION entities (text = true mm value)\n# Run: python 0010_00107234_gt.py [out.dxf]\nimport sys\nimport ezdxf\nimport math\n\nSCALE = 0.7889778826304874\nPAGE = [297.0, 210.0]\n\nVISIBLE_SEGMENTS = [\n (142.408832, 89.524727, 142.408832, 168.422516),\n (127.898894, 168.422516, 127.898894, 89.524727),\n (137.874476, 99.50031, 137.874476, 168.422516),\n (132.43325, 99.50031, 127.898894, 89.524727),\n (132.43325, 168.422516, 132.43325, 99.50031),\n (142.408832, 68.269758, 142.408832, 65.577484),\n (142.408832, 68.269758, 127.898894, 68.269758),\n (127.898894, 68.269758, 127.898894, 65.577484),\n (142.408832, 65.577484, 127.898894, 65.577484),\n (156.408832, 89.524727, 156.408832, 82.269758),\n (159.101106, 89.524727, 159.101106, 82.269758),\n (156.408832, 175.677485, 156.408832, 168.422516),\n (159.101106, 175.677485, 159.101106, 168.422516),\n (159.101106, 168.422516, 159.101106, 89.524727),\n (156.408832, 168.422516, 156.408832, 89.524727),\n (156.408832, 89.524727, 159.101106, 89.524727),\n (159.101106, 82.269758, 156.408832, 82.269758),\n (159.101106, 175.677485, 156.408832, 175.677485),\n (156.408832, 168.422516, 159.101106, 168.422516)\n]\nVISIBLE_CIRCLES = [\n (135.153863, 89.524727, 2.720613)\n]\nVISIBLE_ARCS = [\n (135.153863, 89.524727, 7.254969, -180.0, -0.0),\n (135.153863, 168.422516, 7.254969, -0.0, -180.0),\n (135.153863, 168.422516, 2.720613, -0.0, -180.0),\n (132.886685, 94.512519, 7.053802, -135.0, 45.0)\n]\nHIDDEN_SEGMENTS = [\n (137.8745, 68.2698, 137.8745, 65.5775),\n (132.4332, 68.2698, 132.4332, 65.5775),\n (132.4332, 65.5775, 132.4332, 68.2698),\n (139.9405, 65.5775, 139.9405, 68.2698),\n (156.4088, 99.5003, 159.1011, 99.5003),\n (159.1011, 92.2453, 156.4088, 92.2453),\n (159.1011, 86.8041, 156.4088, 86.8041),\n (159.1011, 171.1431, 156.4088, 171.1431),\n (159.1011, 87.4587, 156.4088, 87.4587)\n]\n# (orient, text, p1, p2, base) for linear; (orient, text, center, radius, angle) for diameter\nDIMENSIONS = [\n ('horizontal', '18.3908', (127.8989, 89.5247), (142.4088, 89.5247), (135.1539, 100.5247)),\n ('vertical', '100', (142.4088, 89.5247), (142.4088, 168.4225), (131.4088, 128.9736)),\n ('diameter', '%%c6.8966', (135.1539, 89.5247), 2.7206, 45),\n ('horizontal', '9.1954', (127.8989, 89.5247), (135.1539, 89.5247), (131.5264, 100.5247)),\n ('horizontal', '12.6437', (127.8989, 89.5247), (137.8745, 89.5247), (132.8867, 100.5247)),\n ('vertical', '100', (127.8989, 89.5247), (127.8989, 168.4225), (116.8989, 128.9736)),\n ('radius', 'R9.1954', (135.1539, 89.5247), 7.255, 135),\n ('radius', 'R8.9404', (132.8867, 94.5125), 7.0538, 45),\n ('radius', 'R3.4483', (135.1539, 168.4225), 2.7206, 45),\n ('horizontal', '3.4124', (156.4088, 89.5247), (159.1011, 89.5247), (157.755, 100.5247))\n]\n\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; _ds.dxf.dimasz = 2.5\n _ds.dxf.dimexe = 1.25; _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\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\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,\n angle=(0 if d[0] == \"horizontal\" else 90),\n 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,\n 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,\n 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,\n text=text, dimstyle=\"EZDXF\").render()\n\n doc.saveas(out_path)\n\n\nif __name__ == \"__main__\":\n out = sys.argv[1] if len(sys.argv) > 1 else \"0010_00107234_gt.dxf\"\n draw(out)\n print(\"wrote\", out)\n```"}], "images": ["images/0010_00107234.png"], "id": "0010_00107234"} {"messages": [{"role": "user", "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. It is extruded to a thickness of 77.68 mm. The outline includes one or more oblique (angled) edges."}, {"role": "assistant", "content": "```python\n#!/usr/bin/env python3\n# -*- coding: utf-8 -*-\n# Ground-truth 2D engineering drawing for part: 0012_00123606\n# Self-contained: reproduces the three-view DXF via ezdxf, NO FreeCAD needed.\n# Coordinates are A4 page millimetres (scale=0.4969055712223403, page=[297.0, 210.0]).\n# visible edges -> solid (layer OUTLINE); hidden edges -> dashed (layer HIDDEN)\n# dimensions -> real movable DIMENSION entities (text = true mm value)\n# Run: python 0012_00123606_gt.py [out.dxf]\nimport sys\nimport ezdxf\nimport math\n\nSCALE = 0.4969055712223403\nPAGE = [297.0, 210.0]\n\nVISIBLE_SEGMENTS = [\n (123.543595, 124.04512, 116.597603, 161.980922),\n (113.926068, 161.980922, 120.872059, 123.510813),\n (113.391761, 122.976506, 113.391761, 172.667063),\n (110.720225, 172.667063, 110.720225, 122.976506),\n (110.720225, 102.50095, 110.720201, 102.50095),\n (123.635643, 102.50095, 123.543595, 102.50095),\n (123.543595, 102.50095, 123.543595, 63.902831),\n (110.720225, 63.902831, 110.720201, 63.902831),\n (123.635643, 63.902831, 123.543595, 63.902831),\n (123.543595, 63.902831, 118.200524, 63.902831),\n (123.543595, 102.50095, 118.200524, 102.50095),\n (118.200524, 102.50095, 116.063296, 102.50095),\n (116.063296, 102.50095, 116.063296, 63.902831),\n (118.200524, 63.902831, 116.063296, 63.902831),\n (116.063296, 102.50095, 113.783872, 102.50095),\n (116.063296, 63.902831, 113.783872, 63.902831),\n (113.783872, 63.902831, 113.391761, 63.902831),\n (113.783872, 102.50095, 113.391761, 102.50095),\n (113.391761, 102.50095, 113.391761, 63.902831),\n (113.391761, 102.50095, 110.720225, 102.50095),\n (110.720225, 102.50095, 110.720225, 63.902831),\n (113.391761, 63.902831, 110.720225, 63.902831),\n (123.635643, 63.902831, 123.635643, 102.50095),\n (118.200524, 63.902831, 118.200524, 102.50095),\n (113.783872, 63.902831, 113.783872, 102.50095),\n (137.635643, 122.976506, 137.635643, 116.500951),\n (176.233763, 122.976506, 176.233763, 116.500951),\n (137.635643, 174.002831, 137.635643, 172.667063),\n (176.233763, 174.002831, 176.233763, 172.667063),\n (176.233763, 172.667063, 176.233763, 122.976506),\n (137.635643, 172.667063, 137.635643, 122.976506),\n (176.233763, 116.500951, 137.635643, 116.500951),\n (176.233763, 174.002831, 137.635643, 174.002831),\n (137.635643, 122.976506, 176.233763, 122.976506),\n (137.635643, 172.667063, 176.233763, 172.667063)\n]\nVISIBLE_CIRCLES = [\n\n]\nVISIBLE_ARCS = [\n (117.177922, 122.958672, 6.457721, 179.841767, 9.685517),\n (121.630192, 163.385685, 5.22497, 139.346192, -164.403808),\n (116.864756, 167.8583, 1.335768, -53.130102, 126.869898),\n (121.4922, 163.454681, 7.708328, 134.772271, -168.977729),\n (117.154916, 122.921577, 3.763556, 179.163742, 9.007492),\n (112.055993, 172.667063, 1.335768, -0.0, -180.0)\n]\nHIDDEN_SEGMENTS = [\n (116.5976, 102.501, 116.5976, 63.9028),\n (117.6662, 102.501, 117.6662, 63.9028),\n (120.8721, 102.501, 120.8721, 63.9028),\n (120.9185, 63.9028, 120.9185, 102.501),\n (137.6356, 124.0451, 176.2338, 124.0451),\n (137.6356, 161.9809, 176.2338, 161.9809),\n (137.6356, 166.7897, 176.2338, 166.7897),\n (137.6356, 168.9269, 176.2338, 168.9269),\n (137.6356, 123.5108, 176.2338, 123.5108),\n (176.2338, 169.1941, 137.6356, 169.1941),\n (176.2338, 119.158, 137.6356, 119.158)\n]\n# (orient, text, p1, p2, base) for linear; (orient, text, center, radius, angle) for diameter\nDIMENSIONS = [\n ('horizontal', '5.3763', (113.3917, 172.6671), (110.7202, 172.6671), (112.056, 161.6671)),\n ('vertical', '100', (113.3917, 122.9765), (113.3917, 172.6671), (102.3917, 147.8218)),\n ('aligned', '77.6133', (123.5436, 124.0451), (116.5976, 161.9809), (109.2505, 141.0319)),\n ('aligned', '78.6712', (113.9261, 161.9809), (120.8721, 123.5108), (128.224, 144.7004)),\n ('radius', 'R12.9959', (117.1779, 122.9587), 6.4577, 45),\n ('radius', 'R10.515', (121.6302, 163.3857), 5.225, 45),\n ('radius', 'R2.6882', (116.8648, 167.8583), 1.3358, 45),\n ('radius', 'R15.5127', (121.4922, 163.4547), 7.7083, 135),\n ('radius', 'R7.574', (117.1549, 122.9216), 3.7636, 135),\n ('horizontal', '77.677', (137.6356, 122.9765), (176.2338, 122.9765), (156.9347, 133.9765))\n]\n\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; _ds.dxf.dimasz = 2.5\n _ds.dxf.dimexe = 1.25; _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\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\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,\n angle=(0 if d[0] == \"horizontal\" else 90),\n 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,\n 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,\n 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,\n text=text, dimstyle=\"EZDXF\").render()\n\n doc.saveas(out_path)\n\n\nif __name__ == \"__main__\":\n out = sys.argv[1] if len(sys.argv) > 1 else \"0012_00123606_gt.dxf\"\n draw(out)\n print(\"wrote\", out)\n```"}], "images": ["images/0012_00123606.png"], "id": "0012_00123606"} {"messages": [{"role": "user", "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. It is extruded to a thickness of 8.11 mm. The outline includes one or more oblique (angled) edges."}, {"role": "assistant", "content": "```python\n#!/usr/bin/env python3\n# -*- coding: utf-8 -*-\n# Ground-truth 2D engineering drawing for part: 0013_00130900\n# Self-contained: reproduces the three-view DXF via ezdxf, NO FreeCAD needed.\n# Coordinates are A4 page millimetres (scale=1.0816250400256973, page=[297.0, 210.0]).\n# visible edges -> solid (layer OUTLINE); hidden edges -> dashed (layer HIDDEN)\n# dimensions -> real movable DIMENSION entities (text = true mm value)\n# Run: python 0013_00130900_gt.py [out.dxf]\nimport sys\nimport ezdxf\nimport math\n\nSCALE = 1.0816250400256973\nPAGE = [297.0, 210.0]\n\nVISIBLE_SEGMENTS = [\n (181.811319, 93.489866, 181.811319, 172.05),\n (73.648815, 93.489866, 181.811319, 93.489866),\n (181.811319, 172.05, 163.594476, 172.05),\n (163.594476, 172.05, 163.594476, 123.092235),\n (152.20895, 111.706708, 103.251185, 111.706708),\n (91.865658, 123.092235, 91.865658, 172.05),\n (91.865658, 172.05, 73.648815, 172.05),\n (73.648815, 172.05, 73.648815, 93.489866),\n (181.811319, 79.489865, 181.811319, 61.95),\n (181.811319, 61.95, 163.594476, 61.95),\n (163.594476, 79.489865, 163.594476, 61.95),\n (181.811319, 79.489865, 163.594476, 79.489865),\n (163.594476, 61.95, 152.20895, 61.95),\n (152.20895, 61.95, 103.251185, 61.95),\n (103.251185, 61.95, 91.865658, 61.95),\n (91.865658, 61.95, 73.648815, 61.95),\n (73.648815, 61.95, 73.648815, 79.489865),\n (163.594476, 79.489865, 152.20895, 79.489865),\n (152.20895, 79.489865, 103.251185, 79.489865),\n (103.251185, 79.489865, 91.865658, 79.489865),\n (91.865658, 79.489865, 73.648815, 79.489865),\n (91.865658, 79.489865, 91.865658, 61.95),\n (152.20895, 79.489865, 152.20895, 61.95),\n (103.251185, 79.489865, 103.251185, 61.95),\n (213.351185, 93.489866, 195.811319, 93.489866),\n (213.351185, 172.05, 213.351185, 93.489866),\n (213.351185, 172.05, 195.811319, 172.05),\n (195.811319, 172.05, 195.811319, 93.489866)\n]\nVISIBLE_CIRCLES = [\n\n]\nVISIBLE_ARCS = [\n (152.20895, 123.092235, 11.385527, -90.0, 0.0),\n (103.251185, 123.092235, 11.385527, -180.0, -90.0)\n]\nHIDDEN_SEGMENTS = [\n (195.8113, 111.7067, 213.3512, 111.7067)\n]\n# (orient, text, p1, p2, base) for linear; (orient, text, center, radius, angle) for diameter\nDIMENSIONS = [\n ('horizontal', '16.8421', (181.8113, 172.05), (163.5945, 172.05), (172.7029, 161.05)),\n ('horizontal', '45.2632', (152.209, 111.7068), (103.2512, 111.7068), (127.7301, 100.7068)),\n ('horizontal', '100', (73.6488, 93.4899), (181.8113, 93.4899), (127.7301, 104.4899)),\n ('vertical', '45.2632', (163.5945, 172.05), (163.5945, 123.0923), (174.5945, 147.5711)),\n ('vertical', '72.6316', (181.8113, 93.4899), (181.8113, 172.05), (170.8113, 132.7699)),\n ('radius', 'R10.5263', (152.209, 123.0923), 11.3855, 45),\n ('horizontal', '16.2162', (195.8113, 93.4899), (213.3512, 93.4899), (204.5813, 104.4899))\n]\n\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; _ds.dxf.dimasz = 2.5\n _ds.dxf.dimexe = 1.25; _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\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\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,\n angle=(0 if d[0] == \"horizontal\" else 90),\n 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,\n 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,\n 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,\n text=text, dimstyle=\"EZDXF\").render()\n\n doc.saveas(out_path)\n\n\nif __name__ == \"__main__\":\n out = sys.argv[1] if len(sys.argv) > 1 else \"0013_00130900_gt.dxf\"\n draw(out)\n print(\"wrote\", out)\n```"}], "images": ["images/0013_00130900.png"], "id": "0013_00130900"} {"messages": [{"role": "user", "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 57.23 mm. The outline includes one or more oblique (angled) edges."}, {"role": "assistant", "content": "```python\n#!/usr/bin/env python3\n# -*- coding: utf-8 -*-\n# Ground-truth 2D engineering drawing for part: 0013_00138062\n# Self-contained: reproduces the three-view DXF via ezdxf, NO FreeCAD needed.\n# Coordinates are A4 page millimetres (scale=0.5597403508771923, page=[297.0, 210.0]).\n# visible edges -> solid (layer OUTLINE); hidden edges -> dashed (layer HIDDEN)\n# dimensions -> real movable DIMENSION entities (text = true mm value)\n# Run: python 0013_00138062_gt.py [out.dxf]\nimport sys\nimport ezdxf\nimport math\n\nSCALE = 0.5597403508771923\nPAGE = [297.0, 210.0]\n\nVISIBLE_SEGMENTS = [\n (144.424035, 107.983333, 96.542631, 107.983333),\n (144.424035, 107.983333, 144.424035, 163.957368),\n (136.331403, 172.05, 104.635263, 172.05),\n (96.542631, 163.957368, 96.542631, 107.983333),\n (144.424035, 93.983333, 144.424035, 61.95),\n (144.424035, 93.983333, 136.331403, 93.983333),\n (144.424035, 61.95, 136.331403, 61.95),\n (136.331403, 61.95, 104.635263, 61.95),\n (136.331403, 93.983333, 104.635263, 93.983333),\n (104.635263, 93.983333, 96.542631, 93.983333),\n (96.542631, 93.983333, 96.542631, 61.95),\n (104.635263, 61.95, 96.542631, 61.95),\n (136.331403, 93.983333, 136.331403, 61.95),\n (104.635263, 93.983333, 104.635263, 61.95),\n (158.424035, 107.983333, 190.457369, 107.983333),\n (158.424035, 172.05, 190.457369, 172.05),\n (158.424035, 172.05, 158.424035, 163.957368),\n (190.457369, 172.05, 190.457369, 163.957368),\n (190.457369, 163.957368, 190.457369, 107.983333),\n (158.424035, 163.957368, 158.424035, 107.983333),\n (158.424035, 163.957368, 190.457369, 163.957368)\n]\nVISIBLE_CIRCLES = [\n\n]\nVISIBLE_ARCS = [\n (136.331403, 163.957368, 8.092632, -0.0, 90.0),\n (104.635263, 163.957368, 8.092632, 90.0, -180.0)\n]\nHIDDEN_SEGMENTS = [\n\n]\n# (orient, text, p1, p2, base) for linear; (orient, text, center, radius, angle) for diameter\nDIMENSIONS = [\n ('horizontal', '56.6265', (136.3314, 172.05), (104.6352, 172.05), (120.4833, 161.05)),\n ('horizontal', '85.5422', (96.5426, 107.9833), (144.424, 107.9833), (120.4833, 118.9833)),\n ('vertical', '100', (144.424, 107.9833), (144.424, 163.9574), (133.424, 135.9704)),\n ('radius', 'R14.4578', (136.3314, 163.9574), 8.0926, 45),\n ('horizontal', '57.2289', (158.424, 107.9833), (190.4574, 107.9833), (174.4407, 118.9833))\n]\n\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; _ds.dxf.dimasz = 2.5\n _ds.dxf.dimexe = 1.25; _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\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\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,\n angle=(0 if d[0] == \"horizontal\" else 90),\n 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,\n 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,\n 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,\n text=text, dimstyle=\"EZDXF\").render()\n\n doc.saveas(out_path)\n\n\nif __name__ == \"__main__\":\n out = sys.argv[1] if len(sys.argv) > 1 else \"0013_00138062_gt.dxf\"\n draw(out)\n print(\"wrote\", out)\n```"}], "images": ["images/0013_00138062.png"], "id": "0013_00138062"} {"messages": [{"role": "user", "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 100 mm."}, {"role": "assistant", "content": "```python\n#!/usr/bin/env python3\n# -*- coding: utf-8 -*-\n# Ground-truth 2D engineering drawing for part: 0014_00140560\n# Self-contained: reproduces the three-view DXF via ezdxf, NO FreeCAD needed.\n# Coordinates are A4 page millimetres (scale=0.4792388451443561, page=[297.0, 210.0]).\n# visible edges -> solid (layer OUTLINE); hidden edges -> dashed (layer HIDDEN)\n# dimensions -> real movable DIMENSION entities (text = true mm value)\n# Run: python 0014_00140560_gt.py [out.dxf]\nimport sys\nimport ezdxf\nimport math\n\nSCALE = 0.4792388451443561\nPAGE = [297.0, 210.0]\n\nVISIBLE_SEGMENTS = [\n (136.5, 178.040486, 136.5, 153.826312),\n (88.576115, 153.826312, 88.576115, 178.040486),\n (88.576115, 178.040486, 136.5, 178.040486),\n (136.5, 67.940485, 136.5, 115.86437),\n (88.576115, 67.940485, 88.576115, 115.86437),\n (88.576115, 115.86437, 136.5, 115.86437),\n (88.576115, 67.940485, 136.5, 67.940485),\n (198.423885, 129.86437, 198.423885, 153.826312),\n (150.5, 129.86437, 150.5, 153.826312),\n (150.5, 153.826312, 150.5, 178.040486),\n (198.423885, 178.040486, 150.5, 178.040486),\n (198.423885, 153.826312, 198.423885, 178.040486),\n (150.5, 129.86437, 198.423885, 129.86437),\n (198.423885, 153.826312, 150.5, 153.826312)\n]\nVISIBLE_CIRCLES = [\n\n]\nVISIBLE_ARCS = [\n (112.538058, 153.826312, 23.961942, -180.0, 0.0)\n]\nHIDDEN_SEGMENTS = [\n\n]\n# (orient, text, p1, p2, base) for linear; (orient, text, center, radius, angle) for diameter\nDIMENSIONS = [\n ('horizontal', '100', (136.5, 153.8263), (88.5761, 153.8263), (112.5381, 142.8263)),\n ('vertical', '50.5263', (136.5, 178.0405), (136.5, 153.8263), (147.5, 165.9334)),\n ('radius', 'R50', (112.5381, 153.8263), 23.9619, 45),\n ('horizontal', '100', (198.4239, 178.0405), (150.5, 178.0405), (174.4619, 167.0405))\n]\n\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; _ds.dxf.dimasz = 2.5\n _ds.dxf.dimexe = 1.25; _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\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\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,\n angle=(0 if d[0] == \"horizontal\" else 90),\n 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,\n 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,\n 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,\n text=text, dimstyle=\"EZDXF\").render()\n\n doc.saveas(out_path)\n\n\nif __name__ == \"__main__\":\n out = sys.argv[1] if len(sys.argv) > 1 else \"0014_00140560_gt.dxf\"\n draw(out)\n print(\"wrote\", out)\n```"}], "images": ["images/0014_00140560.png"], "id": "0014_00140560"} {"messages": [{"role": "user", "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 100 x 25.29 mm bounding box. It is extruded to a thickness of 4.37 mm."}, {"role": "assistant", "content": "```python\n#!/usr/bin/env python3\n# -*- coding: utf-8 -*-\n# Ground-truth 2D engineering drawing for part: 0014_00147488\n# Self-contained: reproduces the three-view DXF via ezdxf, NO FreeCAD needed.\n# Coordinates are A4 page millimetres (scale=1.2939048582996704, page=[297.0, 210.0]).\n# visible edges -> solid (layer OUTLINE); hidden edges -> dashed (layer HIDDEN)\n# dimensions -> real movable DIMENSION entities (text = true mm value)\n# Run: python 0014_00147488_gt.py [out.dxf]\nimport sys\nimport ezdxf\nimport math\n\nSCALE = 1.2939048582996704\nPAGE = [297.0, 210.0]\n\nVISIBLE_SEGMENTS = [\n (68.978988, 111.209676, 68.978988, 106.747935),\n (198.369474, 106.747935, 198.369474, 111.209676),\n (198.369474, 111.209676, 204.318461, 111.209676),\n (204.318461, 111.209676, 204.318461, 143.929109),\n (204.318461, 143.929109, 198.369474, 143.929109),\n (198.369474, 143.929109, 198.369474, 146.903603),\n (68.978988, 146.903603, 68.978988, 143.929109),\n (68.978988, 143.929109, 63.03, 143.929109),\n (63.03, 143.929109, 63.03, 111.209676),\n (63.03, 111.209676, 68.978988, 111.209676),\n (204.318461, 92.747935, 204.318461, 87.096397),\n (204.318461, 87.096397, 198.369474, 87.096397),\n (198.369474, 92.747935, 198.369474, 87.096397),\n (204.318461, 92.747935, 198.369474, 92.747935),\n (198.369474, 87.096397, 68.978988, 87.096397),\n (68.978988, 92.747935, 68.978988, 87.096397),\n (198.369474, 92.747935, 68.978988, 92.747935),\n (68.978988, 87.096397, 63.03, 87.096397),\n (63.03, 92.747935, 63.03, 87.096397),\n (68.978988, 92.747935, 63.03, 92.747935),\n (223.97, 111.209676, 223.97, 106.747935),\n (218.318462, 106.747935, 223.97, 106.747935),\n (218.318462, 111.209676, 218.318462, 106.747935),\n (218.318462, 146.903603, 223.97, 146.903603),\n (223.97, 146.903603, 223.97, 143.929109),\n (218.318462, 146.903603, 218.318462, 143.929109),\n (218.318462, 143.929109, 223.97, 143.929109),\n (223.97, 143.929109, 223.97, 111.209676),\n (218.318462, 111.209676, 223.97, 111.209676),\n (218.318462, 143.929109, 218.318462, 111.209676)\n]\nVISIBLE_CIRCLES = [\n\n]\nVISIBLE_ARCS = [\n (133.674231, -74.063156, 192.036781, 70.3125, 109.6875),\n (133.674231, 327.714695, 192.036781, -109.6875, -70.3125)\n]\nHIDDEN_SEGMENTS = [\n (223.97, 117.9736, 218.3185, 117.9736),\n (223.97, 135.6779, 218.3185, 135.6779)\n]\n# (orient, text, p1, p2, base) for linear; (orient, text, center, radius, angle) for diameter\nDIMENSIONS = [\n ('horizontal', '4.5977', (198.3695, 111.2097), (204.3185, 111.2097), (201.344, 122.2097)),\n ('horizontal', '100', (68.979, 106.748), (198.3695, 106.748), (133.6743, 117.748)),\n ('vertical', '2.2989', (198.3695, 143.9291), (198.3695, 146.9036), (187.3695, 145.4164)),\n ('vertical', '3.4483', (68.979, 111.2097), (68.979, 106.748), (79.979, 108.9788)),\n ('vertical', '25.2874', (204.3185, 111.2097), (204.3185, 143.9291), (193.3185, 127.5694)),\n ('radius', 'R148.417', (133.6743, -74.0632), 192.0368, 45),\n ('horizontal', '4.3678', (218.3185, 111.2097), (223.97, 111.2097), (221.1442, 122.2097))\n]\n\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; _ds.dxf.dimasz = 2.5\n _ds.dxf.dimexe = 1.25; _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\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\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,\n angle=(0 if d[0] == \"horizontal\" else 90),\n 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,\n 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,\n 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,\n text=text, dimstyle=\"EZDXF\").render()\n\n doc.saveas(out_path)\n\n\nif __name__ == \"__main__\":\n out = sys.argv[1] if len(sys.argv) > 1 else \"0014_00147488_gt.dxf\"\n draw(out)\n print(\"wrote\", out)\n```"}], "images": ["images/0014_00147488.png"], "id": "0014_00147488"} {"messages": [{"role": "user", "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 5 circular holes, each of diameter 2.11 mm. It is extruded to a thickness of 1.04 mm. The outline includes one or more oblique (angled) edges."}, {"role": "assistant", "content": "```python\n#!/usr/bin/env python3\n# -*- coding: utf-8 -*-\n# Ground-truth 2D engineering drawing for part: 0017_00174324\n# Self-contained: reproduces the three-view DXF via ezdxf, NO FreeCAD needed.\n# Coordinates are A4 page millimetres (scale=1.1536611570247894, page=[297.0, 210.0]).\n# visible edges -> solid (layer OUTLINE); hidden edges -> dashed (layer HIDDEN)\n# dimensions -> real movable DIMENSION entities (text = true mm value)\n# Run: python 0017_00174324_gt.py [out.dxf]\nimport sys\nimport ezdxf\nimport math\n\nSCALE = 1.1536611570247894\nPAGE = [297.0, 210.0]\n\nVISIBLE_SEGMENTS = [\n (193.582193, 140.387807, 193.582193, 114.885824),\n (187.510292, 108.813923, 84.287978, 108.813923),\n (78.216077, 114.885824, 78.216077, 140.387807),\n (78.216077, 140.387807, 193.582193, 140.387807),\n (193.582193, 93.612193, 193.582193, 94.813923),\n (78.216077, 93.612193, 78.216077, 94.813923),\n (78.216077, 94.813923, 193.582193, 94.813923),\n (78.216077, 93.612193, 193.582193, 93.612193),\n (208.783923, 108.813923, 207.582193, 108.813923),\n (208.783923, 108.813923, 208.783923, 114.885824),\n (207.582193, 108.813923, 207.582193, 114.885824),\n (207.582193, 114.885824, 207.582193, 140.387807),\n (208.783923, 140.387807, 207.582193, 140.387807),\n (208.783923, 114.885824, 208.783923, 140.387807),\n (208.783923, 114.885824, 207.582193, 114.885824)\n]\nVISIBLE_CIRCLES = [\n (84.287978, 136.744667, 1.21438),\n (109.789961, 136.744667, 1.21438),\n (136.506325, 136.744667, 1.21438),\n (162.008308, 136.744667, 1.21438),\n (187.510292, 136.744667, 1.21438)\n]\nVISIBLE_ARCS = [\n (187.510292, 114.885824, 6.071901, -90.0, 0.0),\n (84.287978, 114.885824, 6.071901, -180.0, -90.0)\n]\nHIDDEN_SEGMENTS = [\n (85.5024, 93.6122, 85.5024, 94.8139),\n (111.0043, 93.6122, 111.0043, 94.8139),\n (137.7207, 93.6122, 137.7207, 94.8139),\n (163.2227, 93.6122, 163.2227, 94.8139),\n (188.7247, 93.6122, 188.7247, 94.8139),\n (83.0736, 94.8139, 83.0736, 93.6122),\n (108.5756, 94.8139, 108.5756, 93.6122),\n (135.2919, 94.8139, 135.2919, 93.6122),\n (160.7939, 94.8139, 160.7939, 93.6122),\n (186.2959, 94.8139, 186.2959, 93.6122),\n (207.5822, 135.5303, 208.7839, 135.5303),\n (207.5822, 137.959, 208.7839, 137.959)\n]\n# (orient, text, p1, p2, base) for linear; (orient, text, center, radius, angle) for diameter\nDIMENSIONS = [\n ('horizontal', '89.4737', (187.5102, 108.8139), (84.288, 108.8139), (135.8991, 97.8139)),\n ('horizontal', '100', (78.2161, 140.3878), (193.5822, 140.3878), (135.8991, 151.3878)),\n ('vertical', '22.1053', (193.5822, 140.3878), (193.5822, 114.8858), (204.5822, 127.6368)),\n ('diameter', '%%c2.1053', (84.288, 136.7447), 1.2144, 45),\n ('horizontal', '5.2632', (78.2161, 136.7447), (84.288, 136.7447), (81.2521, 147.7447)),\n ('vertical', '3.1579', (84.288, 140.3878), (84.288, 136.7447), (95.288, 138.5662)),\n ('diameter', '%%c2.1053', (109.7899, 136.7447), 1.2144, 45),\n ('horizontal', '27.3684', (78.2161, 136.7447), (109.7899, 136.7447), (94.003, 147.7447)),\n ('vertical', '3.1579', (109.7899, 140.3878), (109.7899, 136.7447), (120.7899, 138.5662)),\n ('diameter', '%%c2.1053', (136.5063, 136.7447), 1.2144, 45),\n ('horizontal', '50.5263', (78.2161, 136.7447), (136.5063, 136.7447), (107.3612, 147.7447)),\n ('vertical', '3.1579', (136.5063, 140.3878), (136.5063, 136.7447), (147.5063, 138.5662)),\n ('diameter', '%%c2.1053', (162.0083, 136.7447), 1.2144, 45),\n ('horizontal', '72.6316', (78.2161, 136.7447), (162.0083, 136.7447), (120.1122, 147.7447)),\n ('vertical', '3.1579', (162.0083, 140.3878), (162.0083, 136.7447), (173.0083, 138.5662)),\n ('diameter', '%%c2.1053', (187.5102, 136.7447), 1.2144, 45),\n ('horizontal', '94.7368', (78.2161, 136.7447), (187.5102, 136.7447), (132.8632, 147.7447)),\n ('vertical', '3.1579', (187.5102, 140.3878), (187.5102, 136.7447), (198.5102, 138.5662)),\n ('radius', 'R5.2632', (187.5102, 114.8858), 6.0719, 45),\n ('horizontal', '1.0417', (208.7839, 140.3878), (207.5822, 140.3878), (208.183, 129.3878))\n]\n\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; _ds.dxf.dimasz = 2.5\n _ds.dxf.dimexe = 1.25; _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\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\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,\n angle=(0 if d[0] == \"horizontal\" else 90),\n 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,\n 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,\n 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,\n text=text, dimstyle=\"EZDXF\").render()\n\n doc.saveas(out_path)\n\n\nif __name__ == \"__main__\":\n out = sys.argv[1] if len(sys.argv) > 1 else \"0017_00174324_gt.dxf\"\n draw(out)\n print(\"wrote\", out)\n```"}], "images": ["images/0017_00174324.png"], "id": "0017_00174324"} {"messages": [{"role": "user", "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 147.54 x 68.85 mm. It is extruded to a thickness of 115.01 mm. The outline includes one or more oblique (angled) edges."}, {"role": "assistant", "content": "```python\n#!/usr/bin/env python3\n# -*- coding: utf-8 -*-\n# Ground-truth 2D engineering drawing for part: 0019_00194985\n# Self-contained: reproduces the three-view DXF via ezdxf, NO FreeCAD needed.\n# Coordinates are A4 page millimetres (scale=0.48385587301596994, page=[297.0, 210.0]).\n# visible edges -> solid (layer OUTLINE); hidden edges -> dashed (layer HIDDEN)\n# dimensions -> real movable DIMENSION entities (text = true mm value)\n# Run: python 0019_00194985_gt.py [out.dxf]\nimport sys\nimport ezdxf\nimport math\n\nSCALE = 0.48385587301596994\nPAGE = [297.0, 210.0]\n\nVISIBLE_SEGMENTS = [\n (84.483968, 172.05, 132.869555, 172.05),\n (146.354063, 158.565492, 146.354063, 145.080984),\n (132.869555, 131.596476, 84.483968, 131.596476),\n (70.99946, 145.080984, 70.99946, 158.565492),\n (142.388032, 158.565492, 142.388032, 145.080984),\n (84.483968, 168.083968, 132.869555, 168.083968),\n (74.965492, 158.565492, 70.99946, 158.565492),\n (74.965492, 145.080984, 74.965492, 158.565492),\n (132.869555, 134.769302, 84.483968, 134.769302),\n (70.99946, 61.95, 84.483968, 61.95),\n (70.99946, 117.596476, 84.483968, 117.596476),\n (70.99946, 61.95, 70.99946, 117.596476),\n (84.483968, 117.596476, 132.869555, 117.596476),\n (84.483968, 61.95, 132.869555, 61.95),\n (132.869555, 61.95, 146.354063, 61.95),\n (146.354063, 61.95, 146.354063, 117.596476),\n (132.869555, 117.596476, 146.354063, 117.596476),\n (84.483968, 61.95, 84.483968, 117.596476),\n (132.869555, 61.95, 132.869555, 117.596476),\n (216.00054, 158.565492, 216.00054, 172.05),\n (216.00054, 172.05, 160.354064, 172.05),\n (160.354064, 158.565492, 160.354064, 172.05),\n (216.00054, 131.596476, 160.354064, 131.596476),\n (216.00054, 131.596476, 216.00054, 145.080984),\n (160.354064, 131.596476, 160.354064, 145.080984),\n (160.354064, 145.080984, 160.354064, 158.565492),\n (216.00054, 145.080984, 216.00054, 158.565492),\n (216.00054, 158.565492, 160.354064, 158.565492),\n (216.00054, 145.080984, 160.354064, 145.080984)\n]\nVISIBLE_CIRCLES = [\n\n]\nVISIBLE_ARCS = [\n (84.483968, 158.565492, 13.484508, 90.0, -180.0),\n (132.869555, 158.565492, 13.484508, -0.0, 90.0),\n (132.869555, 145.080984, 13.484508, -90.0, 0.0),\n (84.483968, 145.080984, 13.484508, 180.0, -90.0),\n (132.472952, 144.684381, 9.923008, -87.70939, 2.29061),\n (132.869555, 158.565492, 9.518476, -0.0, 90.0),\n (82.500952, 156.582476, 11.67119, 80.217593, 170.217593),\n (84.880571, 144.684381, 9.923008, 177.70939, -92.29061)\n]\nHIDDEN_SEGMENTS = [\n (142.388, 61.95, 142.388, 117.5965),\n (74.9655, 61.95, 74.9655, 117.5965),\n (142.396, 117.5965, 142.396, 61.95),\n (74.9576, 117.5965, 74.9576, 61.95),\n (216.0005, 134.7693, 160.3541, 134.7693),\n (216.0005, 168.084, 160.3541, 168.084),\n (160.3541, 168.2537, 216.0005, 168.2537)\n]\n# (orient, text, p1, p2, base) for linear; (orient, text, center, radius, angle) for diameter\nDIMENSIONS = [\n ('horizontal', '100', (84.484, 172.05), (132.8696, 172.05), (108.6768, 183.05)),\n ('vertical', '27.8689', (146.3541, 158.5655), (146.3541, 145.081), (157.3541, 151.8232)),\n ('horizontal', '147.541', (70.9994, 168.084), (142.388, 168.084), (106.6937, 179.084)),\n ('vertical', '68.8525', (70.9994, 168.084), (70.9994, 134.7693), (81.9994, 151.4266)),\n ('vertical', '8.1967', (70.9994, 172.05), (70.9994, 168.084), (81.9994, 170.067)),\n ('radius', 'R27.8689', (84.484, 158.5655), 13.4845, 45),\n ('radius', 'R24.1212', (82.5009, 156.5825), 11.6712, 45),\n ('radius', 'R19.6721', (132.8696, 158.5655), 9.5185, 45),\n ('radius', 'R20.5082', (132.4729, 144.6844), 9.923, 45),\n ('horizontal', '115.006', (216.0005, 158.5655), (160.3541, 158.5655), (188.1773, 147.5655))\n]\n\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; _ds.dxf.dimasz = 2.5\n _ds.dxf.dimexe = 1.25; _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\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\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,\n angle=(0 if d[0] == \"horizontal\" else 90),\n 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,\n 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,\n 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,\n text=text, dimstyle=\"EZDXF\").render()\n\n doc.saveas(out_path)\n\n\nif __name__ == \"__main__\":\n out = sys.argv[1] if len(sys.argv) > 1 else \"0019_00194985_gt.dxf\"\n draw(out)\n print(\"wrote\", out)\n```"}], "images": ["images/0019_00194985.png"], "id": "0019_00194985"} {"messages": [{"role": "user", "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 46.75 mm tall, featuring 2 circular holes, each of diameter 10.39 mm. It is extruded to a thickness of 2.57 mm."}, {"role": "assistant", "content": "```python\n#!/usr/bin/env python3\n# -*- coding: utf-8 -*-\n# Ground-truth 2D engineering drawing for part: 0019_00196754\n# Self-contained: reproduces the three-view DXF via ezdxf, NO FreeCAD needed.\n# Coordinates are A4 page millimetres (scale=0.8636931297709929, page=[297.0, 210.0]).\n# visible edges -> solid (layer OUTLINE); hidden edges -> dashed (layer HIDDEN)\n# dimensions -> real movable DIMENSION entities (text = true mm value)\n# Run: python 0019_00196754_gt.py [out.dxf]\nimport sys\nimport ezdxf\nimport math\n\nSCALE = 0.8636931297709929\nPAGE = [297.0, 210.0]\n\nVISIBLE_SEGMENTS = [\n (163.431989, 104.919766, 77.062676, 104.919766),\n (77.062676, 104.919766, 77.062676, 145.300224),\n (77.062676, 145.300224, 163.431989, 145.300224),\n (163.431989, 88.699776, 183.622218, 88.699776),\n (163.431989, 90.919766, 183.622218, 90.919766),\n (77.062676, 88.699776, 77.062676, 90.919766),\n (77.062676, 90.919766, 163.431989, 90.919766),\n (77.062676, 88.699776, 163.431989, 88.699776),\n (183.622218, 90.919766, 183.622218, 88.699776),\n (163.431989, 88.699776, 163.431989, 90.919766),\n (199.842209, 104.919766, 197.622219, 104.919766),\n (197.622219, 145.300224, 197.622219, 104.919766),\n (199.842209, 145.300224, 197.622219, 145.300224),\n (199.842209, 104.919766, 199.842209, 145.300224)\n]\nVISIBLE_CIRCLES = [\n (100.617944, 131.840072, 4.486718),\n (154.458554, 131.840072, 4.486718)\n]\nVISIBLE_ARCS = [\n (163.431989, 125.109995, 20.190229, -90.0, 90.0)\n]\nHIDDEN_SEGMENTS = [\n (105.1047, 88.6998, 105.1047, 90.9198),\n (158.9453, 88.6998, 158.9453, 90.9198),\n (96.1312, 90.9198, 96.1312, 88.6998),\n (149.9718, 90.9198, 149.9718, 88.6998),\n (197.6222, 127.3534, 199.8422, 127.3534),\n (197.6222, 136.3268, 199.8422, 136.3268)\n]\n# (orient, text, p1, p2, base) for linear; (orient, text, center, radius, angle) for diameter\nDIMENSIONS = [\n ('horizontal', '100', (163.432, 104.9198), (77.0627, 104.9198), (120.2473, 93.9198)),\n ('vertical', '46.7532', (163.432, 145.3002), (163.432, 104.9198), (174.432, 125.11)),\n ('diameter', '%%c10.3896', (100.6179, 131.8401), 4.4867, 45),\n ('horizontal', '27.2727', (77.0627, 131.8401), (100.6179, 131.8401), (88.8403, 142.8401)),\n ('vertical', '15.5844', (100.6179, 145.3002), (100.6179, 131.8401), (111.6179, 138.5702)),\n ('diameter', '%%c10.3896', (154.4586, 131.8401), 4.4867, 45),\n ('horizontal', '89.6104', (77.0627, 131.8401), (154.4586, 131.8401), (115.7606, 142.8401)),\n ('vertical', '15.5844', (154.4586, 145.3002), (154.4586, 131.8401), (165.4586, 138.5702)),\n ('radius', 'R23.3766', (163.432, 125.11), 20.1902, 45),\n ('horizontal', '2.5703', (199.8422, 145.3002), (197.6223, 145.3002), (198.7322, 134.3002))\n]\n\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; _ds.dxf.dimasz = 2.5\n _ds.dxf.dimexe = 1.25; _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\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\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,\n angle=(0 if d[0] == \"horizontal\" else 90),\n 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,\n 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,\n 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,\n text=text, dimstyle=\"EZDXF\").render()\n\n doc.saveas(out_path)\n\n\nif __name__ == \"__main__\":\n out = sys.argv[1] if len(sys.argv) > 1 else \"0019_00196754_gt.dxf\"\n draw(out)\n print(\"wrote\", out)\n```"}], "images": ["images/0019_00196754.png"], "id": "0019_00196754"} {"messages": [{"role": "user", "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 3 circular holes (diameters 23.52, 94.08 mm). It is extruded to a thickness of 65.06 mm. The outline includes one or more oblique (angled) edges."}, {"role": "assistant", "content": "```python\n#!/usr/bin/env python3\n# -*- coding: utf-8 -*-\n# Ground-truth 2D engineering drawing for part: 0021_00211668\n# Self-contained: reproduces the three-view DXF via ezdxf, NO FreeCAD needed.\n# Coordinates are A4 page millimetres (scale=0.39761007924380937, page=[297.0, 210.0]).\n# visible edges -> solid (layer OUTLINE); hidden edges -> dashed (layer HIDDEN)\n# dimensions -> real movable DIMENSION entities (text = true mm value)\n# Run: python 0021_00211668_gt.py [out.dxf]\nimport sys\nimport ezdxf\nimport math\n\nSCALE = 0.39761007924380937\nPAGE = [297.0, 210.0]\n\nVISIBLE_SEGMENTS = [\n (132.459342, 106.27373, 168.696356, 122.638833),\n (168.696356, 154.200103, 132.459342, 170.565206),\n (104.40488, 170.565206, 68.167866, 154.200103),\n (68.167866, 122.638833, 104.40488, 106.27373),\n (178.962785, 89.304143, 168.696356, 89.304143),\n (178.962785, 63.434794, 168.696356, 63.434794),\n (168.696356, 63.434794, 132.459342, 63.434794),\n (168.696356, 89.304143, 132.459342, 89.304143),\n (132.459342, 89.304143, 104.40488, 89.304143),\n (132.459342, 63.434794, 104.40488, 63.434794),\n (104.40488, 63.434794, 68.167866, 63.434794),\n (104.40488, 89.304143, 68.167866, 89.304143),\n (68.167866, 89.304143, 57.901437, 89.304143),\n (68.167866, 63.434794, 57.901437, 63.434794),\n (178.962785, 63.434794, 178.962785, 89.304143),\n (57.901437, 63.434794, 57.901437, 89.304143),\n (168.696356, 89.304143, 168.696356, 63.434794),\n (132.459342, 89.304143, 132.459342, 63.434794),\n (104.40488, 89.304143, 104.40488, 63.434794),\n (68.167866, 89.304143, 68.167866, 63.434794),\n (192.962785, 106.27373, 192.962785, 103.304143),\n (218.832134, 106.27373, 218.832134, 103.304143),\n (192.962785, 173.534794, 192.962785, 170.565206),\n (218.832134, 173.534794, 218.832134, 170.565206),\n (218.832134, 170.565206, 218.832134, 154.200103),\n (192.962785, 170.565206, 192.962785, 154.200103),\n (192.962785, 154.200103, 192.962785, 122.638833),\n (218.832134, 154.200103, 218.832134, 122.638833),\n (218.832134, 122.638833, 218.832134, 106.27373),\n (192.962785, 122.638833, 192.962785, 106.27373),\n (218.832134, 103.304143, 192.962785, 103.304143),\n (218.832134, 173.534794, 192.962785, 173.534794),\n (192.962785, 106.27373, 218.832134, 106.27373),\n (192.962785, 170.565206, 218.832134, 170.565206),\n (192.962785, 154.200103, 218.832134, 154.200103),\n (192.962785, 122.638833, 218.832134, 122.638833)\n]\nVISIBLE_CIRCLES = [\n (75.181482, 139.003936, 4.675744),\n (118.432111, 139.003936, 18.702975),\n (161.68274, 139.003936, 4.675744)\n]\nVISIBLE_ARCS = [\n (118.432111, 137.918657, 34.614514, -113.90625, -66.09375),\n (161.701281, 138.419468, 17.261504, -66.09375, 66.09375),\n (118.432111, 138.92028, 34.614514, 66.09375, 113.90625),\n (75.16294, 138.419468, 17.261504, 113.90625, -113.90625)\n]\nHIDDEN_SEGMENTS = [\n (79.8572, 89.3041, 79.8572, 63.4348),\n (137.1351, 89.3041, 137.1351, 63.4348),\n (166.3585, 89.3041, 166.3585, 63.4348),\n (70.5057, 63.4348, 70.5057, 89.3041),\n (99.7291, 63.4348, 99.7291, 89.3041),\n (157.007, 63.4348, 157.007, 89.3041),\n (218.8321, 143.6797, 192.9628, 143.6797),\n (218.8321, 134.3282, 192.9628, 134.3282),\n (218.8321, 157.7069, 192.9628, 157.7069),\n (218.8321, 120.301, 192.9628, 120.301)\n]\n# (orient, text, p1, p2, base) for linear; (orient, text, center, radius, angle) for diameter\nDIMENSIONS = [\n ('horizontal', '70.5577', (104.4049, 106.2737), (132.4593, 106.2737), (118.4321, 117.2737)),\n ('vertical', '79.3774', (168.6964, 122.6388), (168.6964, 154.2001), (157.6964, 138.4195)),\n ('aligned', '100', (132.4593, 106.2737), (168.6964, 122.6388), (146.0504, 124.4814)),\n ('aligned', '100', (168.6964, 154.2001), (132.4593, 170.5652), (146.0504, 152.3576)),\n ('aligned', '100', (104.4049, 170.5652), (68.1678, 154.2001), (90.8138, 152.3576)),\n ('aligned', '100', (68.1678, 122.6388), (104.4049, 106.2737), (90.8138, 124.4814)),\n ('diameter', '%%c23.5192', (75.1815, 139.004), 4.6757, 45),\n ('horizontal', '17.6394', (68.1678, 139.004), (75.1815, 139.004), (71.6747, 150.004)),\n ('vertical', '82.3173', (75.1815, 106.2737), (75.1815, 139.004), (64.1815, 122.6388)),\n ('diameter', '%%c94.077', (118.4321, 139.004), 18.703, 45),\n ('horizontal', '126.416', (68.1678, 139.004), (118.4321, 139.004), (93.3, 150.004)),\n ('vertical', '82.3173', (118.4321, 106.2737), (118.4321, 139.004), (107.4321, 122.6388)),\n ('diameter', '%%c23.5192', (161.6828, 139.004), 4.6757, 45),\n ('horizontal', '235.192', (68.1678, 139.004), (161.6828, 139.004), (114.9253, 150.004)),\n ('vertical', '82.3173', (161.6828, 106.2737), (161.6828, 139.004), (150.6828, 122.6388)),\n ('radius', 'R87.0564', (118.4321, 137.9186), 34.6145, 45),\n ('radius', 'R43.4131', (161.7013, 138.4195), 17.2615, 45),\n ('horizontal', '65.0621', (192.9628, 106.2737), (218.8321, 106.2737), (205.8975, 117.2737))\n]\n\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; _ds.dxf.dimasz = 2.5\n _ds.dxf.dimexe = 1.25; _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\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\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,\n angle=(0 if d[0] == \"horizontal\" else 90),\n 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,\n 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,\n 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,\n text=text, dimstyle=\"EZDXF\").render()\n\n doc.saveas(out_path)\n\n\nif __name__ == \"__main__\":\n out = sys.argv[1] if len(sys.argv) > 1 else \"0021_00211668_gt.dxf\"\n draw(out)\n print(\"wrote\", out)\n```"}], "images": ["images/0021_00211668.png"], "id": "0021_00211668"} {"messages": [{"role": "user", "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 circular hole of diameter 25.22 mm. It is extruded to a thickness of 31.24 mm. The outline includes one or more oblique (angled) edges."}, {"role": "assistant", "content": "```python\n#!/usr/bin/env python3\n# -*- coding: utf-8 -*-\n# Ground-truth 2D engineering drawing for part: 0023_00231936\n# Self-contained: reproduces the three-view DXF via ezdxf, NO FreeCAD needed.\n# Coordinates are A4 page millimetres (scale=0.7787291835994646, page=[297.0, 210.0]).\n# visible edges -> solid (layer OUTLINE); hidden edges -> dashed (layer HIDDEN)\n# dimensions -> real movable DIMENSION entities (text = true mm value)\n# Run: python 0023_00231936_gt.py [out.dxf]\nimport sys\nimport ezdxf\nimport math\n\nSCALE = 0.7787291835994646\nPAGE = [297.0, 210.0]\n\nVISIBLE_SEGMENTS = [\n (102.576118, 100.279714, 157.726032, 100.279714),\n (127.506901, 172.050151, 88.977509, 133.520759),\n (88.977509, 86.279112, 83.083274, 86.279112),\n (88.977509, 61.95015, 83.083274, 61.95015),\n (88.977509, 86.279112, 88.977509, 61.95015),\n (161.002442, 86.279112, 127.506901, 86.279112),\n (127.506901, 86.279112, 127.506901, 61.95015),\n (161.002442, 61.95015, 127.506901, 61.95015),\n (127.506901, 61.95015, 88.977509, 61.95015),\n (127.506901, 86.279112, 88.977509, 86.279112),\n (83.083274, 61.95015, 83.083274, 86.279112),\n (161.002442, 61.95015, 161.002442, 86.279112),\n (175.002442, 133.520759, 175.002442, 100.279112),\n (199.331403, 133.520759, 199.331403, 100.279112),\n (175.002442, 133.520759, 199.331403, 133.520759),\n (175.002442, 172.050151, 199.331403, 172.050151),\n (199.331403, 172.050151, 199.331403, 133.520759),\n (175.002442, 172.050151, 175.002442, 133.520759),\n (199.331403, 100.279112, 175.002442, 100.279112)\n]\nVISIBLE_CIRCLES = [\n (102.576118, 119.166671, 9.821218)\n]\nVISIBLE_ARCS = [\n (102.423496, 119.619334, 19.340222, 134.045899, -89.547851),\n (103.02323, 119.494096, 57.979212, -19.353846, 65.021154)\n]\nHIDDEN_SEGMENTS = [\n (157.726, 86.2791, 157.726, 61.9502),\n (112.3973, 86.2791, 112.3973, 61.9502),\n (92.7549, 61.9502, 92.7549, 86.2791),\n (199.3314, 128.9879, 175.0024, 128.9879),\n (199.3314, 109.3455, 175.0024, 109.3455)\n]\n# (orient, text, p1, p2, base) for linear; (orient, text, center, radius, angle) for diameter\nDIMENSIONS = [\n ('horizontal', '70.8204', (102.5761, 100.2797), (157.726, 100.2797), (130.151, 111.2797)),\n ('aligned', '69.9714', (127.5069, 172.0501), (88.9775, 133.5208), (116.0204, 145.0073)),\n ('diameter', '%%c25.2237', (102.5761, 119.1667), 9.8212, 45),\n ('horizontal', '17.4626', (88.9775, 119.1667), (102.5761, 119.1667), (95.7768, 130.1667)),\n ('vertical', '24.2536', (102.5761, 100.2797), (102.5761, 119.1667), (91.5761, 109.7232)),\n ('radius', 'R24.8356', (102.4235, 119.6194), 19.3402, 135),\n ('radius', 'R74.4536', (103.0232, 119.4941), 57.9792, 45),\n ('horizontal', '31.2419', (175.0024, 133.5208), (199.3314, 133.5208), (187.1669, 144.5208))\n]\n\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; _ds.dxf.dimasz = 2.5\n _ds.dxf.dimexe = 1.25; _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\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\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,\n angle=(0 if d[0] == \"horizontal\" else 90),\n 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,\n 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,\n 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,\n text=text, dimstyle=\"EZDXF\").render()\n\n doc.saveas(out_path)\n\n\nif __name__ == \"__main__\":\n out = sys.argv[1] if len(sys.argv) > 1 else \"0023_00231936_gt.dxf\"\n draw(out)\n print(\"wrote\", out)\n```"}], "images": ["images/0023_00231936.png"], "id": "0023_00231936"} {"messages": [{"role": "user", "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 rectangular cutout 180 x 157.78 mm. It is extruded to a thickness of 9.9 mm. The outline includes one or more oblique (angled) edges."}, {"role": "assistant", "content": "```python\n#!/usr/bin/env python3\n# -*- coding: utf-8 -*-\n# Ground-truth 2D engineering drawing for part: 0023_00232130\n# Self-contained: reproduces the three-view DXF via ezdxf, NO FreeCAD needed.\n# Coordinates are A4 page millimetres (scale=0.48890302066772984, page=[297.0, 210.0]).\n# visible edges -> solid (layer OUTLINE); hidden edges -> dashed (layer HIDDEN)\n# dimensions -> real movable DIMENSION entities (text = true mm value)\n# Run: python 0023_00232130_gt.py [out.dxf]\nimport sys\nimport ezdxf\nimport math\n\nSCALE = 0.48890302066772984\nPAGE = [297.0, 210.0]\n\nVISIBLE_SEGMENTS = [\n (109.635814, 172.062342, 158.526116, 172.062342),\n (161.78547, 169.88944, 185.687395, 128.604296),\n (185.687395, 124.258491, 161.78547, 82.973347),\n (158.526116, 80.800445, 109.635814, 80.800445),\n (106.376461, 82.973347, 82.474535, 124.258491),\n (82.474535, 128.604296, 106.376461, 169.88944),\n (156.353214, 88.405603, 111.808716, 88.405603),\n (178.082237, 126.431393, 156.353214, 88.405603),\n (156.353214, 165.543635, 178.082237, 126.431393),\n (111.808716, 165.543635, 156.353214, 165.543635),\n (90.079693, 126.431393, 111.808716, 165.543635),\n (111.808716, 88.405603, 90.079693, 126.431393),\n (185.687395, 61.962342, 185.687395, 66.800445),\n (185.687395, 66.800445, 161.78547, 66.800445),\n (161.78547, 61.962342, 161.78547, 66.800445),\n (185.687395, 61.962342, 161.78547, 61.962342),\n (161.78547, 66.800445, 161.683615, 66.800445),\n (161.683615, 66.800445, 161.58176, 66.800445),\n (161.58176, 66.800445, 161.479905, 66.800445),\n (161.479905, 66.800445, 161.37805, 66.800445),\n (161.37805, 66.800445, 161.276196, 66.800445),\n (161.276196, 66.800445, 161.174341, 66.800445),\n (161.174341, 66.800445, 161.072486, 66.800445),\n (161.072486, 66.800445, 160.970631, 66.800445),\n (160.970631, 66.800445, 160.868776, 66.800445),\n (160.868776, 66.800445, 160.766922, 66.800445),\n (160.766922, 66.800445, 160.665067, 66.800445),\n (160.665067, 66.800445, 160.563212, 66.800445),\n (160.563212, 66.800445, 160.461357, 66.800445),\n (160.461357, 66.800445, 160.359502, 66.800445),\n (160.359502, 66.800445, 160.257648, 66.800445),\n (160.257648, 66.800445, 160.155793, 66.800445),\n (160.155793, 66.800445, 160.053938, 66.800445),\n (160.053938, 66.800445, 159.952083, 66.800445),\n (159.952083, 66.800445, 159.850228, 66.800445),\n (159.850228, 66.800445, 159.748374, 66.800445),\n (159.748374, 66.800445, 159.646519, 66.800445),\n (159.646519, 66.800445, 159.544664, 66.800445),\n (159.544664, 66.800445, 159.442809, 66.800445),\n (159.442809, 66.800445, 159.340954, 66.800445),\n (159.340954, 66.800445, 159.2391, 66.800445),\n (159.2391, 66.800445, 159.137245, 66.800445),\n (159.137245, 66.800445, 159.03539, 66.800445),\n (159.03539, 66.800445, 158.933535, 66.800445),\n (158.933535, 66.800445, 158.83168, 66.800445),\n (158.83168, 66.800445, 158.729826, 66.800445),\n (158.729826, 66.800445, 158.627971, 66.800445),\n (158.627971, 66.800445, 158.526116, 66.800445),\n (158.526116, 61.962342, 158.526116, 66.800445),\n (161.78547, 61.962342, 161.683615, 61.962342),\n (161.683615, 61.962342, 161.58176, 61.962342),\n (161.58176, 61.962342, 161.479905, 61.962342),\n (161.479905, 61.962342, 161.37805, 61.962342),\n (161.37805, 61.962342, 161.276196, 61.962342),\n (161.276196, 61.962342, 161.174341, 61.962342),\n (161.174341, 61.962342, 161.072486, 61.962342),\n (161.072486, 61.962342, 160.970631, 61.962342),\n (160.970631, 61.962342, 160.868776, 61.962342),\n (160.868776, 61.962342, 160.766922, 61.962342),\n (160.766922, 61.962342, 160.665067, 61.962342),\n (160.665067, 61.962342, 160.563212, 61.962342),\n (160.563212, 61.962342, 160.461357, 61.962342),\n (160.461357, 61.962342, 160.359502, 61.962342),\n (160.359502, 61.962342, 160.257648, 61.962342),\n (160.257648, 61.962342, 160.155793, 61.962342),\n (160.155793, 61.962342, 160.053938, 61.962342),\n (160.053938, 61.962342, 159.952083, 61.962342),\n (159.952083, 61.962342, 159.850228, 61.962342),\n (159.850228, 61.962342, 159.748374, 61.962342),\n (159.748374, 61.962342, 159.646519, 61.962342),\n (159.646519, 61.962342, 159.544664, 61.962342),\n (159.544664, 61.962342, 159.442809, 61.962342),\n (159.442809, 61.962342, 159.340954, 61.962342),\n (159.340954, 61.962342, 159.2391, 61.962342),\n (159.2391, 61.962342, 159.137245, 61.962342),\n (159.137245, 61.962342, 159.03539, 61.962342),\n (159.03539, 61.962342, 158.933535, 61.962342),\n (158.933535, 61.962342, 158.83168, 61.962342),\n (158.83168, 61.962342, 158.729826, 61.962342),\n (158.729826, 61.962342, 158.627971, 61.962342),\n (158.627971, 61.962342, 158.526116, 61.962342),\n (158.526116, 66.800445, 109.635814, 66.800445),\n (109.635814, 61.962342, 109.635814, 66.800445),\n (158.526116, 61.962342, 109.635814, 61.962342),\n (106.376461, 61.962342, 106.376461, 66.800445),\n (106.376461, 66.800445, 82.474535, 66.800445),\n (82.474535, 61.962342, 82.474535, 66.800445),\n (106.376461, 61.962342, 82.474535, 61.962342),\n (199.687395, 169.88944, 204.525498, 169.88944),\n (204.525498, 169.88944, 204.525498, 169.957343),\n (204.525498, 169.957343, 204.525498, 170.025246),\n (204.525498, 170.025246, 204.525498, 170.093149),\n (204.525498, 170.093149, 204.525498, 170.161052),\n (204.525498, 170.161052, 204.525498, 170.228956),\n (204.525498, 170.228956, 204.525498, 170.296859),\n (204.525498, 170.296859, 204.525498, 170.364762),\n (204.525498, 170.364762, 204.525498, 170.432665),\n (204.525498, 170.432665, 204.525498, 170.500568),\n (204.525498, 170.500568, 204.525498, 170.568472),\n (204.525498, 170.568472, 204.525498, 170.636375),\n (204.525498, 170.636375, 204.525498, 170.704278),\n (204.525498, 170.704278, 204.525498, 170.772181),\n (204.525498, 170.772181, 204.525498, 170.840084),\n (204.525498, 170.840084, 204.525498, 170.907988),\n (204.525498, 170.907988, 204.525498, 170.975891),\n (204.525498, 170.975891, 204.525498, 171.043794),\n (204.525498, 171.043794, 204.525498, 171.111697),\n (204.525498, 171.111697, 204.525498, 171.1796),\n (204.525498, 171.1796, 204.525498, 171.247504),\n (204.525498, 171.247504, 204.525498, 171.315407),\n (204.525498, 171.315407, 204.525498, 171.38331),\n (204.525498, 171.38331, 204.525498, 171.451213),\n (204.525498, 171.451213, 204.525498, 171.519116),\n (204.525498, 171.519116, 204.525498, 171.58702),\n (204.525498, 171.58702, 204.525498, 171.654923),\n (204.525498, 171.654923, 204.525498, 171.722826),\n (204.525498, 171.722826, 204.525498, 171.790729),\n (204.525498, 171.790729, 204.525498, 171.858632),\n (204.525498, 171.858632, 204.525498, 171.926536),\n (204.525498, 171.926536, 204.525498, 171.994439),\n (204.525498, 171.994439, 204.525498, 172.062342),\n (199.687395, 172.062342, 204.525498, 172.062342),\n (199.687395, 169.88944, 199.687395, 169.957343),\n (199.687395, 169.957343, 199.687395, 170.025246),\n (199.687395, 170.025246, 199.687395, 170.093149),\n (199.687395, 170.093149, 199.687395, 170.161052),\n (199.687395, 170.161052, 199.687395, 170.228956),\n (199.687395, 170.228956, 199.687395, 170.296859),\n (199.687395, 170.296859, 199.687395, 170.364762),\n (199.687395, 170.364762, 199.687395, 170.432665),\n (199.687395, 170.432665, 199.687395, 170.500568),\n (199.687395, 170.500568, 199.687395, 170.568472),\n (199.687395, 170.568472, 199.687395, 170.636375),\n (199.687395, 170.636375, 199.687395, 170.704278),\n (199.687395, 170.704278, 199.687395, 170.772181),\n (199.687395, 170.772181, 199.687395, 170.840084),\n (199.687395, 170.840084, 199.687395, 170.907988),\n (199.687395, 170.907988, 199.687395, 170.975891),\n (199.687395, 170.975891, 199.687395, 171.043794),\n (199.687395, 171.043794, 199.687395, 171.111697),\n (199.687395, 171.111697, 199.687395, 171.1796),\n (199.687395, 171.1796, 199.687395, 171.247504),\n (199.687395, 171.247504, 199.687395, 171.315407),\n (199.687395, 171.315407, 199.687395, 171.38331),\n (199.687395, 171.38331, 199.687395, 171.451213),\n (199.687395, 171.451213, 199.687395, 171.519116),\n (199.687395, 171.519116, 199.687395, 171.58702),\n (199.687395, 171.58702, 199.687395, 171.654923),\n (199.687395, 171.654923, 199.687395, 171.722826),\n (199.687395, 171.722826, 199.687395, 171.790729),\n (199.687395, 171.790729, 199.687395, 171.858632),\n (199.687395, 171.858632, 199.687395, 171.926536),\n (199.687395, 171.926536, 199.687395, 171.994439),\n (199.687395, 171.994439, 199.687395, 172.062342),\n (199.687395, 80.800445, 204.525498, 80.800445),\n (204.525498, 80.800445, 204.525498, 80.868348),\n (204.525498, 80.868348, 204.525498, 80.936251),\n (204.525498, 80.936251, 204.525498, 81.004154),\n (204.525498, 81.004154, 204.525498, 81.072058),\n (204.525498, 81.072058, 204.525498, 81.139961),\n (204.525498, 81.139961, 204.525498, 81.207864),\n (204.525498, 81.207864, 204.525498, 81.275767),\n (204.525498, 81.275767, 204.525498, 81.34367),\n (204.525498, 81.34367, 204.525498, 81.411574),\n (204.525498, 81.411574, 204.525498, 81.479477),\n (204.525498, 81.479477, 204.525498, 81.54738),\n (204.525498, 81.54738, 204.525498, 81.615283),\n (204.525498, 81.615283, 204.525498, 81.683186),\n (204.525498, 81.683186, 204.525498, 81.75109),\n (204.525498, 81.75109, 204.525498, 81.818993),\n (204.525498, 81.818993, 204.525498, 81.886896),\n (204.525498, 81.886896, 204.525498, 81.954799),\n (204.525498, 81.954799, 204.525498, 82.022702),\n (204.525498, 82.022702, 204.525498, 82.090606),\n (204.525498, 82.090606, 204.525498, 82.158509),\n (204.525498, 82.158509, 204.525498, 82.226412),\n (204.525498, 82.226412, 204.525498, 82.294315),\n (204.525498, 82.294315, 204.525498, 82.362218),\n (204.525498, 82.362218, 204.525498, 82.430122),\n (204.525498, 82.430122, 204.525498, 82.498025),\n (204.525498, 82.498025, 204.525498, 82.565928),\n (204.525498, 82.565928, 204.525498, 82.633831),\n (204.525498, 82.633831, 204.525498, 82.701734),\n (204.525498, 82.701734, 204.525498, 82.769638),\n (204.525498, 82.769638, 204.525498, 82.837541),\n (204.525498, 82.837541, 204.525498, 82.905444),\n (204.525498, 82.905444, 204.525498, 82.973347),\n (199.687395, 82.973347, 204.525498, 82.973347),\n (204.525498, 82.973347, 204.525498, 124.258491),\n (199.687395, 124.258491, 204.525498, 124.258491),\n (199.687395, 82.973347, 199.687395, 124.258491),\n (204.525498, 124.258491, 204.525498, 124.394297),\n (204.525498, 124.394297, 204.525498, 124.530104),\n (204.525498, 124.530104, 204.525498, 124.66591),\n (204.525498, 124.66591, 204.525498, 124.801717),\n (204.525498, 124.801717, 204.525498, 124.937523),\n (204.525498, 124.937523, 204.525498, 125.073329),\n (204.525498, 125.073329, 204.525498, 125.209136),\n (204.525498, 125.209136, 204.525498, 125.344942),\n (204.525498, 125.344942, 204.525498, 125.480749),\n (204.525498, 125.480749, 204.525498, 125.616555),\n (204.525498, 125.616555, 204.525498, 125.752361),\n (204.525498, 125.752361, 204.525498, 125.888168),\n (204.525498, 125.888168, 204.525498, 126.023974),\n (204.525498, 126.023974, 204.525498, 126.159781),\n (204.525498, 126.159781, 204.525498, 126.295587),\n (204.525498, 126.295587, 204.525498, 126.431393),\n (204.525498, 126.431393, 204.525498, 126.5672),\n (204.525498, 126.5672, 204.525498, 126.703006),\n (204.525498, 126.703006, 204.525498, 126.838813),\n (204.525498, 126.838813, 204.525498, 126.974619),\n (204.525498, 126.974619, 204.525498, 127.110425),\n (204.525498, 127.110425, 204.525498, 127.246232),\n (204.525498, 127.246232, 204.525498, 127.382038),\n (204.525498, 127.382038, 204.525498, 127.517845),\n (204.525498, 127.517845, 204.525498, 127.653651),\n (204.525498, 127.653651, 204.525498, 127.789457),\n (204.525498, 127.789457, 204.525498, 127.925264),\n (204.525498, 127.925264, 204.525498, 128.06107),\n (204.525498, 128.06107, 204.525498, 128.196877),\n (204.525498, 128.196877, 204.525498, 128.332683),\n (204.525498, 128.332683, 204.525498, 128.468489),\n (204.525498, 128.468489, 204.525498, 128.604296),\n (199.687395, 128.604296, 204.525498, 128.604296),\n (199.687395, 124.258491, 199.687395, 124.394297),\n (199.687395, 124.394297, 199.687395, 124.530104),\n (199.687395, 124.530104, 199.687395, 124.66591),\n (199.687395, 124.66591, 199.687395, 124.801717),\n (199.687395, 124.801717, 199.687395, 124.937523),\n (199.687395, 124.937523, 199.687395, 125.073329),\n (199.687395, 125.073329, 199.687395, 125.209136),\n (199.687395, 125.209136, 199.687395, 125.344942),\n (199.687395, 125.344942, 199.687395, 125.480749),\n (199.687395, 125.480749, 199.687395, 125.616555),\n (199.687395, 125.616555, 199.687395, 125.752361),\n (199.687395, 125.752361, 199.687395, 125.888168),\n (199.687395, 125.888168, 199.687395, 126.023974),\n (199.687395, 126.023974, 199.687395, 126.159781),\n (199.687395, 126.159781, 199.687395, 126.295587),\n (199.687395, 126.295587, 199.687395, 126.431393),\n (199.687395, 126.431393, 199.687395, 126.5672),\n (199.687395, 126.5672, 199.687395, 126.703006),\n (199.687395, 126.703006, 199.687395, 126.838813),\n (199.687395, 126.838813, 199.687395, 126.974619),\n (199.687395, 126.974619, 199.687395, 127.110425),\n (199.687395, 127.110425, 199.687395, 127.246232),\n (199.687395, 127.246232, 199.687395, 127.382038),\n (199.687395, 127.382038, 199.687395, 127.517845),\n (199.687395, 127.517845, 199.687395, 127.653651),\n (199.687395, 127.653651, 199.687395, 127.789457),\n (199.687395, 127.789457, 199.687395, 127.925264),\n (199.687395, 127.925264, 199.687395, 128.06107),\n (199.687395, 128.06107, 199.687395, 128.196877),\n (199.687395, 128.196877, 199.687395, 128.332683),\n (199.687395, 128.332683, 199.687395, 128.468489),\n (199.687395, 128.468489, 199.687395, 128.604296),\n (204.525498, 128.604296, 204.525498, 169.88944),\n (199.687395, 128.604296, 199.687395, 169.88944)\n]\nVISIBLE_CIRCLES = [\n\n]\nVISIBLE_ARCS = [\n (107.372935, 171.925695, 2.267001, -116.075557, 3.455693),\n (160.788995, 171.925695, 2.267001, 176.544307, -63.924443),\n (186.9538, 126.431393, 2.515012, 120.234375, -120.234375),\n (160.788995, 80.937092, 2.267001, 63.924443, -176.544307),\n (107.372935, 80.937092, 2.267001, -3.455693, 116.075557),\n (81.20813, 126.431393, 2.515012, -59.765625, 59.765625),\n (100.993245, -243.439793, 310.32019, 88.404286, 89.005917),\n (100.993245, 372.20258, 310.32019, -89.005917, -88.404286),\n (793.39107, 75.424487, 593.740819, 179.271531, 179.481204)\n]\nHIDDEN_SEGMENTS = [\n (156.3532, 66.7881, 156.3532, 61.95),\n (111.8087, 66.7881, 111.8087, 61.95),\n (178.0822, 66.7881, 178.0822, 61.95),\n (90.0797, 66.7881, 90.0797, 61.95),\n (184.4388, 61.95, 184.4388, 66.7881),\n (83.7231, 61.95, 83.7231, 66.7881),\n (199.6874, 164.4448, 204.5255, 164.4448),\n (199.6874, 126.4191, 204.5255, 126.4191),\n (199.6874, 87.3068, 204.5255, 87.3068)\n]\n# (orient, text, p1, p2, base) for linear; (orient, text, center, radius, angle) for diameter\nDIMENSIONS = [\n ('horizontal', '100', (109.6358, 80.7881), (158.5261, 80.7881), (134.0809, 91.7881)),\n ('vertical', '8.8889', (185.6874, 124.2462), (185.6874, 128.5919), (174.6874, 126.4191)),\n ('aligned', '97.5755', (161.7855, 82.961), (185.6874, 124.2462), (164.2167, 109.115)),\n ('aligned', '97.5755', (185.6874, 128.5919), (161.7855, 169.8771), (164.2167, 143.7231)),\n ('aligned', '97.5755', (106.3764, 169.8771), (82.4745, 128.5919), (103.9452, 143.7231)),\n ('aligned', '97.5755', (82.4745, 124.2462), (106.3764, 82.961), (103.9452, 109.115)),\n ('horizontal', '180', (90.0797, 87.3068), (178.0822, 87.3068), (134.0809, 98.3068)),\n ('vertical', '157.778', (90.0797, 87.3068), (90.0797, 164.4449), (79.0797, 125.8758)),\n ('horizontal', '15.5556', (82.4745, 87.3068), (90.0797, 87.3068), (86.2771, 98.3068)),\n ('vertical', '13.3333', (90.0797, 80.7881), (90.0797, 87.3068), (79.0797, 84.0475)),\n ('radius', 'R4.6369', (107.3729, 80.9248), 2.267, 45),\n ('radius', 'R5.1442', (186.9538, 126.4191), 2.515, 45),\n ('horizontal', '9.8958', (199.6874, 82.961), (204.5255, 82.961), (202.1064, 93.961))\n]\n\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; _ds.dxf.dimasz = 2.5\n _ds.dxf.dimexe = 1.25; _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\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\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,\n angle=(0 if d[0] == \"horizontal\" else 90),\n 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,\n 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,\n 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,\n text=text, dimstyle=\"EZDXF\").render()\n\n doc.saveas(out_path)\n\n\nif __name__ == \"__main__\":\n out = sys.argv[1] if len(sys.argv) > 1 else \"0023_00232130_gt.dxf\"\n draw(out)\n print(\"wrote\", out)\n```"}], "images": ["images/0023_00232130.png"], "id": "0023_00232130"} {"messages": [{"role": "user", "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, featuring 2 circular holes (diameters 16.84, 31.58 mm) and a rectangular cutout 46.32 x 12.63 mm. It is extruded to a thickness of 20.13 mm. The outline includes one or more oblique (angled) edges."}, {"role": "assistant", "content": "```python\n#!/usr/bin/env python3\n# -*- coding: utf-8 -*-\n# Ground-truth 2D engineering drawing for part: 0023_00238994\n# Self-contained: reproduces the three-view DXF via ezdxf, NO FreeCAD needed.\n# Coordinates are A4 page millimetres (scale=0.9303710416524319, page=[297.0, 210.0]).\n# visible edges -> solid (layer OUTLINE); hidden edges -> dashed (layer HIDDEN)\n# dimensions -> real movable DIMENSION entities (text = true mm value)\n# Run: python 0023_00238994_gt.py [out.dxf]\nimport sys\nimport ezdxf\nimport math\n\nSCALE = 0.9303710416524319\nPAGE = [297.0, 210.0]\n\nVISIBLE_SEGMENTS = [\n (125.664842, 109.372372, 80.615296, 109.372372),\n (136.437559, 98.599655, 136.437559, 94.682303),\n (136.437559, 94.682303, 173.652401, 94.682303),\n (173.652401, 172.05, 173.652401, 94.682303),\n (80.615296, 172.05, 173.652401, 172.05),\n (80.615296, 109.372372, 80.615296, 172.05),\n (163.859021, 161.277283, 120.768152, 161.277283),\n (120.768152, 149.525227, 163.859021, 149.525227),\n (173.652401, 80.682303, 173.652401, 61.95),\n (80.615296, 61.95, 173.652401, 61.95),\n (80.615296, 80.682303, 80.615296, 61.95),\n (173.652401, 80.682303, 80.615296, 80.682303),\n (187.652401, 109.372372, 206.384704, 109.372372),\n (206.384704, 109.372372, 206.384704, 98.599655),\n (187.652401, 109.372372, 187.652401, 98.599655),\n (206.384704, 98.599655, 206.384704, 94.682303),\n (187.652401, 94.682303, 206.384704, 94.682303),\n (187.652401, 98.599655, 187.652401, 94.682303),\n (187.652401, 172.05, 206.384704, 172.05),\n (206.384704, 109.372372, 206.384704, 172.05),\n (187.652401, 172.05, 187.652401, 109.372372),\n (187.652401, 98.599655, 206.384704, 98.599655)\n]\nVISIBLE_CIRCLES = [\n (103.140069, 123.083103, 7.834704),\n (156.024318, 119.165751, 14.690069)\n]\nVISIBLE_ARCS = [\n (125.664842, 98.599655, 10.772717, 0.0, 90.0),\n (120.768152, 155.401255, 5.876028, 90.0, -90.0),\n (163.859021, 155.401255, 5.876028, -90.0, 90.0)\n]\nHIDDEN_SEGMENTS = [\n (136.4376, 80.6823, 136.4376, 61.95),\n (110.9748, 80.6823, 110.9748, 61.95),\n (170.7144, 80.6823, 170.7144, 61.95),\n (95.3054, 61.95, 95.3054, 80.6823),\n (114.8921, 61.95, 114.8921, 80.6823),\n (169.735, 61.95, 169.735, 80.6823),\n (141.3342, 61.95, 141.3342, 80.6823),\n (187.6524, 149.5252, 206.3847, 149.5252),\n (187.6524, 161.2773, 206.3847, 161.2773),\n (206.3847, 130.9178, 187.6524, 130.9178),\n (206.3847, 115.2484, 187.6524, 115.2484),\n (206.3847, 133.8558, 187.6524, 133.8558),\n (206.3847, 104.4757, 187.6524, 104.4757)\n]\n# (orient, text, p1, p2, base) for linear; (orient, text, center, radius, angle) for diameter\nDIMENSIONS = [\n ('horizontal', '40', (136.4376, 94.6823), (173.6524, 94.6823), (155.045, 105.6823)),\n ('horizontal', '48.4211', (80.6153, 109.3724), (125.6648, 109.3724), (103.1401, 120.3724)),\n ('horizontal', '100', (173.6524, 172.05), (80.6153, 172.05), (127.1339, 161.05)),\n ('vertical', '4.2105', (136.4376, 98.5996), (136.4376, 94.6823), (147.4376, 96.641)),\n ('vertical', '67.3684', (80.6153, 172.05), (80.6153, 109.3724), (91.6153, 140.7112)),\n ('vertical', '83.1579', (173.6524, 94.6823), (173.6524, 172.05), (162.6524, 133.3662)),\n ('diameter', '%%c16.8421', (103.1401, 123.0831), 7.8347, 45),\n ('horizontal', '24.2105', (80.6153, 123.0831), (103.1401, 123.0831), (91.8777, 134.0831)),\n ('vertical', '30.5263', (103.1401, 94.6823), (103.1401, 123.0831), (92.1401, 108.8827)),\n ('diameter', '%%c31.5789', (156.0243, 119.1658), 14.69, 45),\n ('horizontal', '81.0526', (80.6153, 119.1658), (156.0243, 119.1658), (118.3198, 130.1658)),\n ('vertical', '26.3158', (156.0243, 94.6823), (156.0243, 119.1658), (145.0243, 106.924)),\n ('horizontal', '46.3158', (120.7682, 149.5253), (163.8591, 149.5253), (142.3136, 160.5253)),\n ('vertical', '12.6316', (120.7682, 149.5253), (120.7682, 161.2772), (109.7682, 155.4013)),\n ('horizontal', '43.1579', (80.6153, 149.5253), (120.7682, 149.5253), (100.6918, 160.5253)),\n ('vertical', '58.9474', (120.7682, 94.6823), (120.7682, 149.5253), (109.7682, 122.1038)),\n ('radius', 'R11.5789', (125.6648, 98.5996), 10.7727, 45),\n ('radius', 'R6.3158', (163.8591, 155.4013), 5.876, 45),\n ('horizontal', '20.1342', (187.6524, 109.3724), (206.3847, 109.3724), (197.0185, 120.3724))\n]\n\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; _ds.dxf.dimasz = 2.5\n _ds.dxf.dimexe = 1.25; _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\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\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,\n angle=(0 if d[0] == \"horizontal\" else 90),\n 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,\n 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,\n 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,\n text=text, dimstyle=\"EZDXF\").render()\n\n doc.saveas(out_path)\n\n\nif __name__ == \"__main__\":\n out = sys.argv[1] if len(sys.argv) > 1 else \"0023_00238994_gt.dxf\"\n draw(out)\n print(\"wrote\", out)\n```"}], "images": ["images/0023_00238994.png"], "id": "0023_00238994"} {"messages": [{"role": "user", "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 mm wide and 100 mm tall, featuring 2 circular holes, each of diameter 11.9 mm. It is extruded to a thickness of 12.96 mm."}, {"role": "assistant", "content": "```python\n#!/usr/bin/env python3\n# -*- coding: utf-8 -*-\n# Ground-truth 2D engineering drawing for part: 0024_00240415\n# Self-contained: reproduces the three-view DXF via ezdxf, NO FreeCAD needed.\n# Coordinates are A4 page millimetres (scale=0.6965846292138282, page=[297.0, 210.0]).\n# visible edges -> solid (layer OUTLINE); hidden edges -> dashed (layer HIDDEN)\n# dimensions -> real movable DIMENSION entities (text = true mm value)\n# Run: python 0024_00240415_gt.py [out.dxf]\nimport sys\nimport ezdxf\nimport math\n\nSCALE = 0.6965846292138282\nPAGE = [297.0, 210.0]\n\nVISIBLE_SEGMENTS = [\n (140.693847, 167.696346, 140.693847, 98.037883),\n (123.279231, 98.037883, 123.279231, 167.696346),\n (123.279231, 66.303654, 140.693847, 66.303654),\n (140.693847, 66.303654, 140.693847, 75.330575),\n (123.279231, 75.330575, 140.693847, 75.330575),\n (123.279231, 66.303654, 123.279231, 75.330575),\n (163.720769, 167.696346, 163.720769, 176.403654),\n (154.693847, 167.696346, 154.693847, 176.403654),\n (163.720769, 89.330575, 163.720769, 98.037883),\n (154.693847, 89.330575, 154.693847, 98.037883),\n (154.693847, 98.037883, 154.693847, 167.696346),\n (163.720769, 98.037883, 163.720769, 167.696346),\n (154.693847, 176.403654, 163.720769, 176.403654),\n (154.693847, 89.330575, 163.720769, 89.330575),\n (163.720769, 167.696346, 154.693847, 167.696346),\n (163.720769, 98.037883, 154.693847, 98.037883)\n]\nVISIBLE_CIRCLES = [\n (132.401173, 167.696346, 4.146337),\n (132.401173, 98.037883, 4.146337)\n]\nVISIBLE_ARCS = [\n (131.986539, 167.696346, 8.707308, -0.0, 180.0),\n (131.986539, 98.037883, 8.707308, -180.0, -0.0)\n]\nHIDDEN_SEGMENTS = [\n (136.5475, 66.3037, 136.5475, 75.3306),\n (128.2548, 75.3306, 128.2548, 66.3037),\n (154.6938, 163.55, 163.7208, 163.55),\n (154.6938, 171.8427, 163.7208, 171.8427),\n (154.6938, 93.8915, 163.7208, 93.8915),\n (154.6938, 102.1842, 163.7208, 102.1842)\n]\n# (orient, text, p1, p2, base) for linear; (orient, text, center, radius, angle) for diameter\nDIMENSIONS = [\n ('horizontal', '25', (123.2793, 167.6963), (140.6939, 167.6963), (131.9866, 178.6963)),\n ('vertical', '100', (140.6939, 167.6963), (140.6939, 98.0379), (151.6939, 132.8671)),\n ('diameter', '%%c11.9048', (132.4012, 167.6963), 4.1464, 45),\n ('horizontal', '13.0952', (123.2793, 167.6963), (132.4012, 167.6963), (127.8402, 178.6963)),\n ('diameter', '%%c11.9048', (132.4012, 98.0379), 4.1464, 45),\n ('horizontal', '13.0952', (123.2793, 98.0379), (132.4012, 98.0379), (127.8402, 109.0379)),\n ('vertical', '100', (132.4012, 167.6963), (132.4012, 98.0379), (143.4012, 132.8671)),\n ('radius', 'R12.5', (131.9866, 167.6963), 8.7073, 135),\n ('horizontal', '12.9588', (163.7208, 167.6963), (154.6939, 167.6963), (159.2073, 156.6963))\n]\n\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; _ds.dxf.dimasz = 2.5\n _ds.dxf.dimexe = 1.25; _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\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\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,\n angle=(0 if d[0] == \"horizontal\" else 90),\n 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,\n 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,\n 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,\n text=text, dimstyle=\"EZDXF\").render()\n\n doc.saveas(out_path)\n\n\nif __name__ == \"__main__\":\n out = sys.argv[1] if len(sys.argv) > 1 else \"0024_00240415_gt.dxf\"\n draw(out)\n print(\"wrote\", out)\n```"}], "images": ["images/0024_00240415.png"], "id": "0024_00240415"} {"messages": [{"role": "user", "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 3 circular holes (diameters 23.08, 88.46 mm). It is extruded to a thickness of 6.64 mm. The outline includes one or more oblique (angled) edges."}, {"role": "assistant", "content": "```python\n#!/usr/bin/env python3\n# -*- coding: utf-8 -*-\n# Ground-truth 2D engineering drawing for part: 0024_00241929\n# Self-contained: reproduces the three-view DXF via ezdxf, NO FreeCAD needed.\n# Coordinates are A4 page millimetres (scale=0.6713853461301391, page=[297.0, 210.0]).\n# visible edges -> solid (layer OUTLINE); hidden edges -> dashed (layer HIDDEN)\n# dimensions -> real movable DIMENSION entities (text = true mm value)\n# Run: python 0024_00241929_gt.py [out.dxf]\nimport sys\nimport ezdxf\nimport math\n\nSCALE = 0.6713853461301391\nPAGE = [297.0, 210.0]\n\nVISIBLE_SEGMENTS = [\n (197.326231, 74.970556, 176.513472, 74.970556),\n (176.513472, 74.970556, 176.513472, 70.510304),\n (197.326231, 70.510304, 176.513472, 70.510304),\n (176.513472, 70.510304, 159.728838, 70.510304),\n (159.728838, 74.970556, 159.728838, 70.510304),\n (176.513472, 74.970556, 159.728838, 74.970556),\n (159.728838, 74.970556, 92.590304, 74.970556),\n (92.590304, 74.970556, 92.590304, 70.510304),\n (159.728838, 70.510304, 92.590304, 70.510304),\n (92.590304, 70.510304, 74.514545, 70.510304),\n (92.590304, 74.970556, 74.514545, 74.970556),\n (74.514545, 74.970556, 54.846483, 74.970556),\n (74.514545, 70.510304, 54.846483, 70.510304),\n (197.326231, 70.510304, 197.326231, 74.970556),\n (54.846483, 70.510304, 54.846483, 74.970556),\n (74.514545, 74.970556, 74.514545, 70.510304),\n (215.786484, 113.135795, 215.786484, 104.097915),\n (211.326231, 104.097915, 215.786484, 104.097915),\n (211.326231, 113.135795, 211.326231, 104.097915),\n (211.326231, 104.097915, 211.326231, 88.970557),\n (215.786484, 104.097915, 215.786484, 88.970557),\n (211.326231, 178.617055, 211.326231, 163.489696),\n (211.326231, 163.489696, 215.786484, 163.489696),\n (215.786484, 178.617055, 215.786484, 163.489696),\n (215.786484, 163.489696, 215.786484, 154.451816),\n (211.326231, 163.489696, 211.326231, 154.451816),\n (211.326231, 154.451816, 211.326231, 113.135795),\n (215.786484, 154.451816, 215.786484, 113.135795),\n (215.786484, 88.970557, 211.326231, 88.970557),\n (215.786484, 178.617055, 211.326231, 178.617055),\n (211.326231, 113.135795, 215.786484, 113.135795),\n (211.326231, 154.451816, 215.786484, 154.451816)\n]\nVISIBLE_CIRCLES = [\n (75.80567, 133.793806, 7.746754),\n (126.159571, 133.793806, 29.69589),\n (176.513472, 133.793806, 7.746754)\n]\nVISIBLE_ARCS = [\n (73.010536, 87.533078, 25.646855, 40.231824, 86.638074),\n (126.159571, 133.781178, 44.810621, -138.515625, -41.484375),\n (179.308607, 87.533078, 25.646855, 93.361926, 139.768176),\n (176.651909, 133.777958, 20.674322, -86.803839, 90.383661),\n (179.421098, 179.956364, 25.669754, -140.097631, -96.503881),\n (126.159571, 133.806433, 44.810621, 41.484375, 138.515625),\n (73.010536, 180.054533, 25.646855, -86.638074, -40.231824),\n (75.529408, 133.793806, 20.682924, 92.8125, -92.8125)\n]\nHIDDEN_SEGMENTS = [\n (83.5524, 74.9706, 83.5524, 70.5103),\n (155.8555, 74.9706, 155.8555, 70.5103),\n (184.2602, 74.9706, 184.2602, 70.5103),\n (68.0589, 70.5103, 68.0589, 74.9706),\n (96.4637, 70.5103, 96.4637, 74.9706),\n (168.7667, 70.5103, 168.7667, 74.9706),\n (215.7865, 141.5406, 211.3262, 141.5406),\n (215.7865, 126.0471, 211.3262, 126.0471)\n]\n# (orient, text, p1, p2, base) for linear; (orient, text, center, radius, angle) for diameter\nDIMENSIONS = [\n ('horizontal', '100', (92.5903, 104.0979), (159.7289, 104.0979), (126.1596, 115.0979)),\n ('vertical', '61.5385', (74.5145, 154.4518), (74.5145, 113.1358), (85.5145, 133.7938)),\n ('diameter', '%%c23.0769', (75.8057, 133.7938), 7.7467, 45),\n ('horizontal', '1.9231', (74.5145, 133.7938), (75.8057, 133.7938), (75.1601, 144.7938)),\n ('vertical', '44.2308', (75.8057, 104.0979), (75.8057, 133.7938), (64.8057, 118.9459)),\n ('diameter', '%%c88.4615', (126.1596, 133.7938), 29.6959, 45),\n ('horizontal', '76.9231', (74.5145, 133.7938), (126.1596, 133.7938), (100.3371, 144.7938)),\n ('vertical', '44.2308', (126.1596, 104.0979), (126.1596, 133.7938), (115.1596, 118.9459)),\n ('diameter', '%%c23.0769', (176.5135, 133.7938), 7.7467, 45),\n ('horizontal', '151.923', (74.5145, 133.7938), (176.5135, 133.7938), (125.514, 144.7938)),\n ('vertical', '44.2308', (176.5135, 104.0979), (176.5135, 133.7938), (165.5135, 118.9459)),\n ('radius', 'R38.1999', (73.0105, 87.5331), 25.6469, 45),\n ('radius', 'R66.7435', (126.1596, 133.7812), 44.8106, 135),\n ('radius', 'R30.7935', (176.6519, 133.778), 20.6743, 135),\n ('radius', 'R38.234', (179.4211, 179.9564), 25.6697, 45),\n ('radius', 'R30.8063', (75.5294, 133.7938), 20.6829, 135),\n ('horizontal', '6.6434', (211.3262, 113.1358), (215.7865, 113.1358), (213.5564, 124.1358))\n]\n\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; _ds.dxf.dimasz = 2.5\n _ds.dxf.dimexe = 1.25; _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\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\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,\n angle=(0 if d[0] == \"horizontal\" else 90),\n 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,\n 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,\n 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,\n text=text, dimstyle=\"EZDXF\").render()\n\n doc.saveas(out_path)\n\n\nif __name__ == \"__main__\":\n out = sys.argv[1] if len(sys.argv) > 1 else \"0024_00241929_gt.dxf\"\n draw(out)\n print(\"wrote\", out)\n```"}], "images": ["images/0024_00241929.png"], "id": "0024_00241929"} {"messages": [{"role": "user", "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 3 circular holes (diameters 29.17, 95.83 mm). It is extruded to a thickness of 7.29 mm. The outline includes one or more oblique (angled) edges."}, {"role": "assistant", "content": "```python\n#!/usr/bin/env python3\n# -*- coding: utf-8 -*-\n# Ground-truth 2D engineering drawing for part: 0024_00242731\n# Self-contained: reproduces the three-view DXF via ezdxf, NO FreeCAD needed.\n# Coordinates are A4 page millimetres (scale=0.3966577082029306, page=[297.0, 210.0]).\n# visible edges -> solid (layer OUTLINE); hidden edges -> dashed (layer HIDDEN)\n# dimensions -> real movable DIMENSION entities (text = true mm value)\n# Run: python 0024_00242731_gt.py [out.dxf]\nimport sys\nimport ezdxf\nimport math\n\nSCALE = 0.3966577082029306\nPAGE = [297.0, 210.0]\n\nVISIBLE_SEGMENTS = [\n (97.406139, 85.710956, 97.406139, 88.600717),\n (97.406139, 88.600717, 109.801692, 88.600717),\n (97.406139, 85.710956, 109.801692, 85.710956),\n (109.801692, 85.710956, 149.467463, 85.710956),\n (109.801692, 88.600717, 149.467463, 88.600717),\n (149.467463, 88.600717, 161.863016, 88.600717),\n (161.863016, 85.710956, 161.863016, 88.600717),\n (149.467463, 85.710956, 161.863016, 85.710956),\n (161.863016, 85.710956, 176.009581, 85.710956),\n (161.863016, 88.600717, 176.009581, 88.600717),\n (83.259573, 85.710956, 97.406139, 85.710956),\n (83.259573, 88.600717, 97.406139, 88.600717),\n (176.009581, 88.600717, 176.009581, 85.710956),\n (83.259573, 88.600717, 83.259573, 85.710956),\n (109.801692, 85.710956, 109.801692, 88.600717),\n (149.467463, 85.710956, 149.467463, 88.600717),\n (190.009581, 143.340068, 190.009581, 148.289044),\n (192.899342, 143.340068, 192.899342, 148.289044),\n (192.899342, 148.289044, 192.899342, 156.79071),\n (190.009581, 148.289044, 190.009581, 156.79071),\n (192.899342, 102.600717, 192.899342, 111.102383),\n (190.009581, 102.600717, 190.009581, 111.102383),\n (190.009581, 111.102383, 190.009581, 116.051359),\n (192.899342, 111.102383, 192.899342, 116.051359),\n (192.899342, 116.051359, 192.899342, 143.340068),\n (190.009581, 116.051359, 190.009581, 143.340068),\n (190.009581, 156.79071, 192.899342, 156.79071),\n (190.009581, 102.600717, 192.899342, 102.600717),\n (190.009581, 116.051359, 192.899342, 116.051359),\n (190.009581, 143.340068, 192.899342, 143.340068),\n (192.899342, 148.289044, 190.009581, 148.289044),\n (192.899342, 111.102383, 190.009581, 111.102383)\n]\nVISIBLE_CIRCLES = [\n (96.579768, 130.108899, 5.784592),\n (129.634577, 130.108899, 19.006515),\n (162.689386, 130.108899, 5.784592)\n]\nVISIBLE_ARCS = [\n (98.191408, 159.341201, 16.029625, -92.807966, -43.589216),\n (129.634577, 129.406567, 27.384143, 43.59375, 136.40625),\n (161.077747, 159.341201, 16.029625, -136.410784, -87.192034),\n (162.365227, 129.695714, 13.644354, -92.109375, 92.109375),\n (161.077747, 100.050226, 16.029625, 87.192034, 136.410784),\n (129.634577, 129.98486, 27.384143, -136.40625, -43.59375),\n (98.191408, 100.050226, 16.029625, 43.589216, 92.807966),\n (96.903928, 129.695714, 13.644354, 87.890625, -87.890625)\n]\nHIDDEN_SEGMENTS = [\n (102.3644, 85.711, 102.3644, 88.6007),\n (148.6411, 85.711, 148.6411, 88.6007),\n (168.474, 85.711, 168.474, 88.6007),\n (90.7952, 88.6007, 90.7952, 85.711),\n (110.6281, 88.6007, 110.6281, 85.711),\n (156.9048, 88.6007, 156.9048, 85.711),\n (190.0096, 124.3243, 192.8993, 124.3243),\n (190.0096, 135.8935, 192.8993, 135.8935),\n (190.0096, 149.1154, 192.8993, 149.1154)\n]\n# (orient, text, p1, p2, base) for linear; (orient, text, center, radius, angle) for diameter\nDIMENSIONS = [\n ('horizontal', '100', (109.8017, 148.2891), (149.4675, 148.2891), (129.6346, 159.2891)),\n ('vertical', '68.75', (161.863, 143.3308), (161.863, 116.0606), (172.863, 129.6957)),\n ('diameter', '%%c29.1667', (96.5798, 130.1089), 5.7846, 45),\n ('horizontal', '2.0833', (97.4062, 130.1089), (96.5798, 130.1089), (96.993, 119.1089)),\n ('vertical', '45.8333', (96.5798, 148.2891), (96.5798, 130.1089), (107.5798, 139.199)),\n ('diameter', '%%c95.8333', (129.6346, 130.1089), 19.0065, 45),\n ('horizontal', '81.25', (97.4062, 130.1089), (129.6346, 130.1089), (113.5204, 141.1089)),\n ('vertical', '45.8333', (129.6346, 148.2891), (129.6346, 130.1089), (140.6346, 139.199)),\n ('diameter', '%%c29.1667', (162.6894, 130.1089), 5.7846, 45),\n ('horizontal', '164.583', (97.4062, 130.1089), (162.6894, 130.1089), (130.0478, 141.1089)),\n ('vertical', '45.8333', (162.6894, 148.2891), (162.6894, 130.1089), (173.6894, 139.199)),\n ('radius', 'R40.4117', (98.1914, 159.3412), 16.0296, 45),\n ('radius', 'R69.0372', (129.6346, 129.4066), 27.3841, 135),\n ('radius', 'R34.3983', (162.3652, 129.6957), 13.6444, 135),\n ('horizontal', '7.2853', (192.8993, 143.3308), (190.0096, 143.3308), (191.4545, 132.3308))\n]\n\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; _ds.dxf.dimasz = 2.5\n _ds.dxf.dimexe = 1.25; _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\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\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,\n angle=(0 if d[0] == \"horizontal\" else 90),\n 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,\n 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,\n 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,\n text=text, dimstyle=\"EZDXF\").render()\n\n doc.saveas(out_path)\n\n\nif __name__ == \"__main__\":\n out = sys.argv[1] if len(sys.argv) > 1 else \"0024_00242731_gt.dxf\"\n draw(out)\n print(\"wrote\", out)\n```"}], "images": ["images/0024_00242731.png"], "id": "0024_00242731"} {"messages": [{"role": "user", "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.07 mm wide and 100 mm tall, featuring a rectangular cutout 70.15 x 100 mm. It is extruded to a thickness of 7.24 mm."}, {"role": "assistant", "content": "```python\n#!/usr/bin/env python3\n# -*- coding: utf-8 -*-\n# Ground-truth 2D engineering drawing for part: 0024_00247378\n# Self-contained: reproduces the three-view DXF via ezdxf, NO FreeCAD needed.\n# Coordinates are A4 page millimetres (scale=0.6415986471251485, page=[297.0, 210.0]).\n# visible edges -> solid (layer OUTLINE); hidden edges -> dashed (layer HIDDEN)\n# dimensions -> real movable DIMENSION entities (text = true mm value)\n# Run: python 0024_00247378_gt.py [out.dxf]\nimport sys\nimport ezdxf\nimport math\n\nSCALE = 0.6415986471251485\nPAGE = [297.0, 210.0]\n\nVISIBLE_SEGMENTS = [\n (155.722097, 87.421223, 161.467756, 87.421223),\n (161.467756, 87.421223, 161.467756, 151.581088),\n (106.883991, 151.581088, 106.883991, 87.421223),\n (106.883991, 87.421223, 112.62965, 87.421223),\n (151.891657, 112.319081, 151.891657, 151.581088),\n (116.46009, 112.319081, 106.883991, 87.421223),\n (116.46009, 151.581088, 116.46009, 112.319081),\n (161.467756, 73.421223, 161.467756, 68.772971),\n (161.467756, 73.421223, 106.883991, 73.421223),\n (106.883991, 73.421223, 106.883991, 68.772971),\n (161.467756, 68.772971, 106.883991, 68.772971),\n (175.467757, 178.872971, 175.467757, 151.581088),\n (180.116009, 178.872971, 180.116009, 151.581088),\n (180.116009, 151.581088, 180.116009, 87.421223),\n (175.467757, 87.421223, 180.116009, 87.421223),\n (175.467757, 151.581088, 175.467757, 87.421223),\n (180.116009, 178.872971, 175.467757, 178.872971),\n (175.467757, 151.581088, 180.116009, 151.581088)\n]\nVISIBLE_CIRCLES = [\n\n]\nVISIBLE_ARCS = [\n (134.175874, 87.421223, 21.546223, -0.0, -180.0),\n (134.175874, 151.581088, 27.291883, 0.0, -180.0),\n (134.175874, 151.14619, 17.721121, 1.40625, 178.59375),\n (146.611042, 68.735874, 43.901946, 83.09162, 154.81037)\n]\nHIDDEN_SEGMENTS = [\n (112.6297, 73.4212, 112.6297, 68.773),\n (155.7221, 73.4212, 155.7221, 68.773),\n (116.4601, 73.4212, 116.4601, 68.773),\n (151.8917, 73.4212, 151.8917, 68.773),\n (175.4678, 112.3191, 180.116, 112.3191),\n (180.116, 108.9674, 175.4678, 108.9674),\n (180.116, 168.8673, 175.4678, 168.8673),\n (180.116, 112.6378, 175.4678, 112.6378)\n]\n# (orient, text, p1, p2, base) for linear; (orient, text, center, radius, angle) for diameter\nDIMENSIONS = [\n ('horizontal', '85.0746', (161.4677, 151.5811), (106.884, 151.5811), (134.1759, 140.5811)),\n ('vertical', '100', (161.4677, 87.4212), (161.4677, 151.5811), (150.4677, 119.5012)),\n ('horizontal', '70.1493', (106.884, 87.4212), (151.8916, 87.4212), (129.3878, 98.4212)),\n ('vertical', '100', (106.884, 87.4212), (106.884, 151.5811), (95.884, 119.5012)),\n ('radius', 'R33.5821', (134.1759, 87.4212), 21.5462, 45),\n ('radius', 'R42.5373', (134.1759, 151.5811), 27.2919, 45),\n ('radius', 'R68.4259', (146.611, 68.7359), 43.902, 45),\n ('radius', 'R27.6203', (134.1759, 151.1462), 17.7211, 135),\n ('horizontal', '7.2448', (175.4678, 87.4212), (180.116, 87.4212), (177.7919, 98.4212))\n]\n\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; _ds.dxf.dimasz = 2.5\n _ds.dxf.dimexe = 1.25; _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\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\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,\n angle=(0 if d[0] == \"horizontal\" else 90),\n 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,\n 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,\n 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,\n text=text, dimstyle=\"EZDXF\").render()\n\n doc.saveas(out_path)\n\n\nif __name__ == \"__main__\":\n out = sys.argv[1] if len(sys.argv) > 1 else \"0024_00247378_gt.dxf\"\n draw(out)\n print(\"wrote\", out)\n```"}], "images": ["images/0024_00247378.png"], "id": "0024_00247378"} {"messages": [{"role": "user", "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 18.39 mm wide and 100 mm tall, featuring 2 circular holes, each of diameter 6.9 mm. It is extruded to a thickness of 8.4 mm."}, {"role": "assistant", "content": "```python\n#!/usr/bin/env python3\n# -*- coding: utf-8 -*-\n# Ground-truth 2D engineering drawing for part: 0024_00249429\n# Self-contained: reproduces the three-view DXF via ezdxf, NO FreeCAD needed.\n# Coordinates are A4 page millimetres (scale=0.7579435146443448, page=[297.0, 210.0]).\n# visible edges -> solid (layer OUTLINE); hidden edges -> dashed (layer HIDDEN)\n# dimensions -> real movable DIMENSION entities (text = true mm value)\n# Run: python 0024_00249429_gt.py [out.dxf]\nimport sys\nimport ezdxf\nimport math\n\nSCALE = 0.7579435146443448\nPAGE = [297.0, 210.0]\n\nVISIBLE_SEGMENTS = [\n (140.286367, 168.565202, 140.286367, 92.770851),\n (126.347176, 92.770851, 126.347176, 168.565202),\n (126.347176, 65.434798, 140.286367, 65.434798),\n (140.286367, 65.434798, 140.286367, 71.801255),\n (126.347176, 71.801255, 140.286367, 71.801255),\n (126.347176, 65.434798, 126.347176, 71.801255),\n (160.652824, 168.565202, 160.652824, 175.534798),\n (154.286367, 168.565202, 154.286367, 175.534798),\n (160.652824, 85.801255, 160.652824, 92.770851),\n (154.286367, 85.801255, 154.286367, 92.770851),\n (154.286367, 92.770851, 154.286367, 168.565202),\n (160.652824, 92.770851, 160.652824, 168.565202),\n (154.286367, 175.534798, 160.652824, 175.534798),\n (154.286367, 85.801255, 160.652824, 85.801255),\n (160.652824, 168.565202, 154.286367, 168.565202),\n (160.652824, 92.770851, 154.286367, 92.770851)\n]\nVISIBLE_CIRCLES = [\n (133.316771, 168.565202, 2.613598),\n (133.316771, 92.770851, 2.613598)\n]\nVISIBLE_ARCS = [\n (133.316771, 168.565202, 6.969596, -0.0, 180.0),\n (133.316771, 92.770851, 6.969596, -180.0, -0.0)\n]\nHIDDEN_SEGMENTS = [\n (135.9304, 65.4348, 135.9304, 71.8013),\n (130.7032, 71.8013, 130.7032, 65.4348),\n (154.2864, 165.9516, 160.6528, 165.9516),\n (154.2864, 171.1788, 160.6528, 171.1788),\n (154.2864, 90.1573, 160.6528, 90.1573),\n (154.2864, 95.3844, 160.6528, 95.3844)\n]\n# (orient, text, p1, p2, base) for linear; (orient, text, center, radius, angle) for diameter\nDIMENSIONS = [\n ('horizontal', '18.3908', (126.3472, 168.5652), (140.2864, 168.5652), (133.3168, 179.5652)),\n ('vertical', '100', (140.2864, 168.5652), (140.2864, 92.7709), (151.2864, 130.6681)),\n ('diameter', '%%c6.8966', (133.3168, 168.5652), 2.6136, 45),\n ('horizontal', '9.1954', (126.3472, 168.5652), (133.3168, 168.5652), (129.832, 179.5652)),\n ('diameter', '%%c6.8966', (133.3168, 92.7709), 2.6136, 45),\n ('horizontal', '9.1954', (126.3472, 92.7709), (133.3168, 92.7709), (129.832, 103.7709)),\n ('vertical', '100', (133.3168, 168.5652), (133.3168, 92.7709), (144.3168, 130.6681)),\n ('radius', 'R9.1954', (133.3168, 168.5652), 6.9696, 135),\n ('horizontal', '8.3996', (160.6528, 168.5652), (154.2864, 168.5652), (157.4696, 157.5652))\n]\n\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; _ds.dxf.dimasz = 2.5\n _ds.dxf.dimexe = 1.25; _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\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\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,\n angle=(0 if d[0] == \"horizontal\" else 90),\n 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,\n 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,\n 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,\n text=text, dimstyle=\"EZDXF\").render()\n\n doc.saveas(out_path)\n\n\nif __name__ == \"__main__\":\n out = sys.argv[1] if len(sys.argv) > 1 else \"0024_00249429_gt.dxf\"\n draw(out)\n print(\"wrote\", out)\n```"}], "images": ["images/0024_00249429.png"], "id": "0024_00249429"} {"messages": [{"role": "user", "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 25 mm bounding box, featuring 2 circular holes, each of diameter 21.43 mm. It is extruded to a thickness of 417.58 mm."}, {"role": "assistant", "content": "```python\n#!/usr/bin/env python3\n# -*- coding: utf-8 -*-\n# Ground-truth 2D engineering drawing for part: 0025_00257690\n# Self-contained: reproduces the three-view DXF via ezdxf, NO FreeCAD needed.\n# Coordinates are A4 page millimetres (scale=0.21713469894475854, page=[297.0, 210.0]).\n# visible edges -> solid (layer OUTLINE); hidden edges -> dashed (layer HIDDEN)\n# dimensions -> real movable DIMENSION entities (text = true mm value)\n# Run: python 0025_00257690_gt.py [out.dxf]\nimport sys\nimport ezdxf\nimport math\n\nSCALE = 0.21713469894475854\nPAGE = [297.0, 210.0]\n\nVISIBLE_SEGMENTS = [\n (79.531968, 166.621633, 101.245438, 166.621633),\n (101.245438, 172.05, 94.007614, 172.05),\n (94.007614, 172.05, 94.007614, 170.240544),\n (94.007614, 170.240544, 86.769791, 170.240544),\n (86.769791, 170.240544, 86.769791, 172.05),\n (86.769791, 172.05, 79.531968, 172.05),\n (79.531968, 152.621632, 76.817784, 152.621632),\n (79.531968, 61.95, 76.817784, 61.95),\n (103.959621, 152.621632, 101.245438, 152.621632),\n (103.959621, 61.95, 101.245438, 61.95),\n (101.245438, 61.95, 94.007614, 61.95),\n (94.007614, 152.621632, 94.007614, 61.95),\n (101.245438, 152.621632, 94.007614, 152.621632),\n (94.007614, 61.95, 86.769791, 61.95),\n (94.007614, 152.621632, 86.769791, 152.621632),\n (86.769791, 152.621632, 86.769791, 61.95),\n (86.769791, 61.95, 79.531968, 61.95),\n (86.769791, 152.621632, 79.531968, 152.621632),\n (76.817784, 61.95, 76.817784, 152.621632),\n (103.959621, 61.95, 103.959621, 152.621632),\n (79.531968, 152.621632, 79.531968, 61.95),\n (101.245438, 152.621632, 101.245438, 61.95),\n (117.959621, 172.05, 117.959621, 166.621633),\n (117.959621, 166.621633, 208.631254, 166.621633),\n (208.631254, 172.05, 208.631254, 166.621633),\n (117.959621, 172.05, 208.631254, 172.05)\n]\nVISIBLE_CIRCLES = [\n (79.531968, 169.20657, 2.326443),\n (101.245438, 169.20657, 2.326443)\n]\nVISIBLE_ARCS = [\n (79.531968, 169.335816, 2.714184, 90.0, -90.0),\n (101.245438, 169.335816, 2.714184, -90.0, 90.0)\n]\nHIDDEN_SEGMENTS = [\n (81.8584, 152.6216, 81.8584, 61.95),\n (98.919, 61.95, 98.919, 152.6216),\n (117.9596, 170.2405, 208.6313, 170.2405),\n (208.6313, 171.533, 117.9596, 171.533)\n]\n# (orient, text, p1, p2, base) for linear; (orient, text, center, radius, angle) for diameter\nDIMENSIONS = [\n ('horizontal', '33.3333', (101.2454, 172.05), (94.0076, 172.05), (97.6265, 161.05)),\n ('horizontal', '100', (79.532, 166.6216), (101.2454, 166.6216), (90.3887, 177.6216)),\n ('vertical', '8.3333', (94.0076, 172.05), (94.0076, 170.2406), (105.0076, 171.1453)),\n ('vertical', '25', (79.532, 172.05), (79.532, 166.6216), (90.532, 169.3358)),\n ('diameter', '%%c21.4286', (79.532, 169.2066), 2.3264, 45),\n ('vertical', '11.9048', (79.532, 166.6216), (79.532, 169.2066), (68.532, 167.9141)),\n ('diameter', '%%c21.4286', (101.2454, 169.2066), 2.3264, 45),\n ('horizontal', '100', (79.532, 169.2066), (101.2454, 169.2066), (90.3887, 180.2066)),\n ('vertical', '11.9048', (101.2454, 166.6216), (101.2454, 169.2066), (90.2454, 167.9141)),\n ('radius', 'R12.5', (79.532, 169.3358), 2.7142, 135),\n ('horizontal', '417.582', (117.9596, 172.05), (208.6313, 172.05), (163.2954, 183.05))\n]\n\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; _ds.dxf.dimasz = 2.5\n _ds.dxf.dimexe = 1.25; _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\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\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,\n angle=(0 if d[0] == \"horizontal\" else 90),\n 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,\n 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,\n 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,\n text=text, dimstyle=\"EZDXF\").render()\n\n doc.saveas(out_path)\n\n\nif __name__ == \"__main__\":\n out = sys.argv[1] if len(sys.argv) > 1 else \"0025_00257690_gt.dxf\"\n draw(out)\n print(\"wrote\", out)\n```"}], "images": ["images/0025_00257690.png"], "id": "0025_00257690"} {"messages": [{"role": "user", "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 100 mm. The outline includes one or more oblique (angled) edges."}, {"role": "assistant", "content": "```python\n#!/usr/bin/env python3\n# -*- coding: utf-8 -*-\n# Ground-truth 2D engineering drawing for part: 0026_00264708\n# Self-contained: reproduces the three-view DXF via ezdxf, NO FreeCAD needed.\n# Coordinates are A4 page millimetres (scale=0.4805, page=[297.0, 210.0]).\n# visible edges -> solid (layer OUTLINE); hidden edges -> dashed (layer HIDDEN)\n# dimensions -> real movable DIMENSION entities (text = true mm value)\n# Run: python 0026_00264708_gt.py [out.dxf]\nimport sys\nimport ezdxf\nimport math\n\nSCALE = 0.4805\nPAGE = [297.0, 210.0]\n\nVISIBLE_SEGMENTS = [\n (136.500451, 172.05, 136.500451, 124.0),\n (136.500451, 124.0, 112.728346, 124.0),\n (112.728346, 124.0, 112.728346, 147.772105),\n (88.450451, 172.05, 136.500451, 172.05),\n (136.500451, 61.95, 136.500451, 110.0),\n (88.448645, 61.95, 88.450451, 61.95),\n (88.450451, 61.95, 88.450451, 110.0),\n (88.448645, 110.0, 88.450451, 110.0),\n (88.450451, 110.0, 136.500451, 110.0),\n (88.450451, 61.95, 136.500451, 61.95),\n (88.448645, 110.0, 88.448645, 61.95),\n (198.550452, 124.0, 150.500452, 124.0),\n (150.500452, 124.0, 150.500452, 147.770299),\n (198.550452, 124.0, 198.550452, 147.770299),\n (198.550452, 147.770299, 198.550452, 172.05),\n (198.550452, 172.05, 150.500452, 172.05),\n (150.500452, 147.770299, 150.500452, 172.05),\n (150.500452, 147.770299, 198.550452, 147.770299)\n]\nVISIBLE_CIRCLES = [\n\n]\nVISIBLE_ARCS = [\n (112.434009, 171.755663, 23.985363, 179.296875, -89.296875)\n]\nHIDDEN_SEGMENTS = [\n (112.7283, 61.95, 112.7283, 110.0)\n]\n# (orient, text, p1, p2, base) for linear; (orient, text, center, radius, angle) for diameter\nDIMENSIONS = [\n ('horizontal', '49.4737', (136.5005, 124.0), (112.7283, 124.0), (124.6144, 113.0)),\n ('horizontal', '100', (88.4505, 172.05), (136.5005, 172.05), (112.4755, 183.05)),\n ('vertical', '49.4737', (112.7283, 124.0), (112.7283, 147.7721), (101.7283, 135.8861)),\n ('vertical', '100', (136.5005, 172.05), (136.5005, 124.0), (147.5005, 148.025)),\n ('radius', 'R49.9175', (112.434, 171.7556), 23.9854, 45),\n ('horizontal', '100', (198.5505, 172.05), (150.5005, 172.05), (174.5255, 161.05))\n]\n\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; _ds.dxf.dimasz = 2.5\n _ds.dxf.dimexe = 1.25; _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\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\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,\n angle=(0 if d[0] == \"horizontal\" else 90),\n 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,\n 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,\n 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,\n text=text, dimstyle=\"EZDXF\").render()\n\n doc.saveas(out_path)\n\n\nif __name__ == \"__main__\":\n out = sys.argv[1] if len(sys.argv) > 1 else \"0026_00264708_gt.dxf\"\n draw(out)\n print(\"wrote\", out)\n```"}], "images": ["images/0026_00264708.png"], "id": "0026_00264708"} {"messages": [{"role": "user", "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 45.26 mm tall. It is extruded to a thickness of 12.57 mm."}, {"role": "assistant", "content": "```python\n#!/usr/bin/env python3\n# -*- coding: utf-8 -*-\n# Ground-truth 2D engineering drawing for part: 0027_00272454\n# Self-contained: reproduces the three-view DXF via ezdxf, NO FreeCAD needed.\n# Coordinates are A4 page millimetres (scale=1.305373953488208, page=[297.0, 210.0]).\n# visible edges -> solid (layer OUTLINE); hidden edges -> dashed (layer HIDDEN)\n# dimensions -> real movable DIMENSION entities (text = true mm value)\n# Run: python 0027_00272454_gt.py [out.dxf]\nimport sys\nimport ezdxf\nimport math\n\nSCALE = 1.305373953488208\nPAGE = [297.0, 210.0]\n\nVISIBLE_SEGMENTS = [\n (193.567395, 161.743976, 63.03, 161.743976),\n (63.03, 102.658629, 193.567395, 102.658629),\n (193.567395, 88.658629, 193.567395, 72.256024),\n (193.567395, 72.256024, 63.03, 72.256024),\n (63.03, 88.658629, 63.03, 72.256024),\n (193.567395, 88.658629, 63.03, 88.658629),\n (207.567395, 161.743976, 223.97, 161.743976),\n (223.97, 161.743976, 223.97, 102.658629),\n (207.567395, 102.658629, 223.97, 102.658629),\n (207.567395, 161.743976, 207.567395, 102.658629)\n]\nVISIBLE_CIRCLES = [\n\n]\nVISIBLE_ARCS = [\n (213.307179, 132.201302, 35.530672, 123.75, -123.75),\n (32.753194, 132.201302, 42.301945, -44.296875, 44.296875)\n]\nHIDDEN_SEGMENTS = [\n (177.7765, 72.256, 177.7765, 88.6586),\n (75.0551, 72.256, 75.0551, 88.6586)\n]\n# (orient, text, p1, p2, base) for linear; (orient, text, center, radius, angle) for diameter\nDIMENSIONS = [\n ('horizontal', '100', (193.5674, 161.744), (63.03, 161.744), (128.2987, 150.744)),\n ('vertical', '45.2632', (193.5674, 102.6587), (193.5674, 161.744), (182.5674, 132.2013)),\n ('radius', 'R27.2188', (213.3072, 132.2013), 35.5307, 45),\n ('radius', 'R32.406', (32.7531, 132.2013), 42.3019, 45),\n ('horizontal', '12.5654', (207.5674, 102.6587), (223.9699, 102.6587), (215.7687, 113.6587))\n]\n\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; _ds.dxf.dimasz = 2.5\n _ds.dxf.dimexe = 1.25; _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\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\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,\n angle=(0 if d[0] == \"horizontal\" else 90),\n 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,\n 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,\n 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,\n text=text, dimstyle=\"EZDXF\").render()\n\n doc.saveas(out_path)\n\n\nif __name__ == \"__main__\":\n out = sys.argv[1] if len(sys.argv) > 1 else \"0027_00272454_gt.dxf\"\n draw(out)\n print(\"wrote\", out)\n```"}], "images": ["images/0027_00272454.png"], "id": "0027_00272454"} {"messages": [{"role": "user", "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 3 circular holes (diameters 17.42, 23.23 mm). It is extruded to a thickness of 10.95 mm. The outline includes one or more oblique (angled) edges."}, {"role": "assistant", "content": "```python\n#!/usr/bin/env python3\n# -*- coding: utf-8 -*-\n# Ground-truth 2D engineering drawing for part: 0027_00273170\n# Self-contained: reproduces the three-view DXF via ezdxf, NO FreeCAD needed.\n# Coordinates are A4 page millimetres (scale=0.5342308173040592, page=[297.0, 210.0]).\n# visible edges -> solid (layer OUTLINE); hidden edges -> dashed (layer HIDDEN)\n# dimensions -> real movable DIMENSION entities (text = true mm value)\n# Run: python 0027_00273170_gt.py [out.dxf]\nimport sys\nimport ezdxf\nimport math\n\nSCALE = 0.5342308173040592\nPAGE = [297.0, 210.0]\n\nVISIBLE_SEGMENTS = [\n (125.387862, 162.038757, 166.492109, 127.914477),\n (156.409935, 113.178992, 131.592277, 127.138925),\n (122.285655, 121.710062, 122.285655, 102.321266),\n (104.447963, 100.770162, 95.916892, 144.201065),\n (95.5498, 73.58091, 125.387862, 73.58091),\n (95.5498, 79.428324, 125.387862, 79.428324),\n (125.387862, 79.428324, 166.492109, 79.428324),\n (125.387862, 73.58091, 166.492109, 73.58091),\n (166.492109, 73.58091, 169.776862, 73.58091),\n (166.492109, 79.428324, 169.776862, 79.428324),\n (95.5498, 79.428324, 95.5498, 73.58091),\n (169.776862, 79.428324, 169.776862, 73.58091),\n (125.387862, 73.58091, 125.387862, 79.428324),\n (166.492109, 73.58091, 166.492109, 79.428324),\n (189.624277, 144.201065, 189.624277, 166.141262),\n (183.776863, 144.201065, 183.776863, 166.141262),\n (189.624277, 93.428324, 189.624277, 100.770162),\n (183.776863, 93.428324, 183.776863, 100.770162),\n (183.776863, 100.770162, 183.776863, 144.201065),\n (189.624277, 100.770162, 189.624277, 144.201065),\n (183.776863, 166.141262, 189.624277, 166.141262),\n (183.776863, 93.428324, 189.624277, 93.428324),\n (189.624277, 144.201065, 183.776863, 144.201065),\n (189.624277, 100.770162, 183.776863, 100.770162)\n]\nVISIBLE_CIRCLES = [\n (113.754585, 148.078824, 6.204415),\n (113.754585, 102.321266, 4.653311),\n (160.287695, 120.93451, 4.653311)\n]\nVISIBLE_ARCS = [\n (113.843591, 147.84747, 18.293792, 50.872475, -168.502525),\n (160.81655, 120.980847, 8.960312, -119.45847, 50.69778),\n (128.520984, 121.712463, 6.235329, 60.490812, -179.977938),\n (113.290423, 102.424144, 8.99582, -169.405259, -0.655259)\n]\nHIDDEN_SEGMENTS = [\n (122.2857, 73.5809, 122.2857, 79.4283),\n (119.959, 73.5809, 119.959, 79.4283),\n (118.4079, 73.5809, 118.4079, 79.4283),\n (164.941, 73.5809, 164.941, 79.4283),\n (122.2857, 79.4283, 122.2857, 73.5809),\n (107.5502, 79.4283, 107.5502, 73.5809),\n (109.1013, 79.4283, 109.1013, 73.5809),\n (155.6344, 79.4283, 155.6344, 73.5809),\n (189.6243, 102.3213, 183.7769, 102.3213),\n (183.7769, 112.0205, 189.6243, 112.0205),\n (183.7769, 127.9478, 189.6243, 127.9478),\n (183.7769, 141.8744, 189.6243, 141.8744),\n (183.7769, 154.2832, 189.6243, 154.2832),\n (183.7769, 97.668, 189.6243, 97.668),\n (183.7769, 106.9746, 189.6243, 106.9746),\n (183.7769, 116.2812, 189.6243, 116.2812),\n (183.7769, 125.5878, 189.6243, 125.5878)\n]\n# (orient, text, p1, p2, base) for linear; (orient, text, center, radius, angle) for diameter\nDIMENSIONS = [\n ('vertical', '36.2929', (122.2856, 121.71), (122.2856, 102.3213), (133.2856, 112.0157)),\n ('aligned', '100', (125.3879, 162.0388), (166.4921, 127.9145), (152.9663, 153.4401)),\n ('aligned', '53.3', (156.41, 113.179), (131.5923, 127.1389), (138.6082, 110.5716)),\n ('aligned', '82.8497', (104.4479, 100.7702), (95.9169, 144.2011), (89.3887, 120.3654)),\n ('diameter', '%%c23.2275', (113.7546, 148.0788), 6.2044, 45),\n ('horizontal', '33.3895', (95.9169, 148.0788), (113.7546, 148.0788), (104.8357, 159.0788)),\n ('vertical', '26.1309', (113.7546, 162.0388), (113.7546, 148.0788), (124.7546, 155.0588)),\n ('diameter', '%%c17.4206', (113.7546, 102.3213), 4.6533, 45),\n ('horizontal', '33.3895', (95.9169, 102.3213), (113.7546, 102.3213), (104.8357, 113.3213)),\n ('vertical', '111.782', (113.7546, 162.0388), (113.7546, 102.3213), (124.7546, 132.18)),\n ('diameter', '%%c17.4206', (160.2877, 120.9345), 4.6533, 45),\n ('horizontal', '120.493', (95.9169, 120.9345), (160.2877, 120.9345), (128.1023, 131.9345)),\n ('vertical', '76.941', (160.2877, 162.0388), (160.2877, 120.9345), (171.2877, 141.4866)),\n ('radius', 'R34.2432', (113.8436, 147.8475), 18.2938, 135),\n ('radius', 'R16.7724', (160.8166, 120.9808), 8.9603, 135),\n ('radius', 'R11.6716', (128.521, 121.7125), 6.2353, 45),\n ('radius', 'R16.8388', (113.2904, 102.4242), 8.9958, 135),\n ('horizontal', '10.9455', (189.6243, 144.2011), (183.7769, 144.2011), (186.7006, 133.2011))\n]\n\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; _ds.dxf.dimasz = 2.5\n _ds.dxf.dimexe = 1.25; _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\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\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,\n angle=(0 if d[0] == \"horizontal\" else 90),\n 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,\n 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,\n 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,\n text=text, dimstyle=\"EZDXF\").render()\n\n doc.saveas(out_path)\n\n\nif __name__ == \"__main__\":\n out = sys.argv[1] if len(sys.argv) > 1 else \"0027_00273170_gt.dxf\"\n draw(out)\n print(\"wrote\", out)\n```"}], "images": ["images/0027_00273170.png"], "id": "0027_00273170"} {"messages": [{"role": "user", "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 25 mm tall, featuring 2 circular holes (diameters 7.14, 9.52 mm). It is extruded to a thickness of 7.89 mm."}, {"role": "assistant", "content": "```python\n#!/usr/bin/env python3\n# -*- coding: utf-8 -*-\n# Ground-truth 2D engineering drawing for part: 0028_00283954\n# Self-contained: reproduces the three-view DXF via ezdxf, NO FreeCAD needed.\n# Coordinates are A4 page millimetres (scale=1.1057235000000165, page=[297.0, 210.0]).\n# visible edges -> solid (layer OUTLINE); hidden edges -> dashed (layer HIDDEN)\n# dimensions -> real movable DIMENSION entities (text = true mm value)\n# Run: python 0028_00283954_gt.py [out.dxf]\nimport sys\nimport ezdxf\nimport math\n\nSCALE = 1.1057235000000165\nPAGE = [297.0, 210.0]\n\nVISIBLE_SEGMENTS = [\n (181.500375, 142.183825, 70.928025, 142.183825),\n (70.928025, 114.540738, 181.500375, 114.540738),\n (195.321919, 100.540737, 181.500375, 100.540737),\n (195.321919, 91.816175, 181.500375, 91.816175),\n (181.500375, 91.816175, 70.928025, 91.816175),\n (181.500375, 100.540737, 70.928025, 100.540737),\n (70.928025, 100.540737, 57.106481, 100.540737),\n (70.928025, 91.816175, 57.106481, 91.816175),\n (195.321919, 91.816175, 195.321919, 100.540737),\n (57.106481, 91.816175, 57.106481, 100.540737),\n (181.500375, 100.540737, 181.500375, 91.816175),\n (70.928025, 100.540737, 70.928025, 91.816175),\n (209.321919, 142.183825, 218.046481, 142.183825),\n (209.321919, 142.183825, 209.321919, 114.540738),\n (209.321919, 114.540738, 218.046481, 114.540738),\n (218.046481, 142.183825, 218.046481, 114.540738)\n]\nVISIBLE_CIRCLES = [\n (70.928025, 129.02045, 5.26535),\n (181.500375, 129.02045, 3.949013)\n]\nVISIBLE_ARCS = [\n (181.500375, 128.362281, 13.821544, -90.0, 90.0),\n (70.928025, 128.362281, 13.821544, 90.0, -90.0)\n]\nHIDDEN_SEGMENTS = [\n (76.1934, 100.5407, 76.1934, 91.8162),\n (185.4494, 100.5407, 185.4494, 91.8162),\n (65.6627, 91.8162, 65.6627, 100.5407),\n (177.5514, 91.8162, 177.5514, 100.5407),\n (218.0465, 134.2858, 209.3219, 134.2858),\n (218.0465, 123.7551, 209.3219, 123.7551),\n (218.0465, 132.9695, 209.3219, 132.9695),\n (218.0465, 125.0714, 209.3219, 125.0714)\n]\n# (orient, text, p1, p2, base) for linear; (orient, text, center, radius, angle) for diameter\nDIMENSIONS = [\n ('horizontal', '100', (181.5004, 142.1838), (70.928, 142.1838), (126.2142, 131.1838)),\n ('vertical', '25', (181.5004, 114.5407), (181.5004, 142.1838), (170.5004, 128.3623)),\n ('diameter', '%%c9.5238', (70.928, 129.0204), 5.2653, 45),\n ('vertical', '13.0952', (70.928, 114.5407), (70.928, 129.0204), (59.928, 121.7806)),\n ('diameter', '%%c7.1429', (181.5004, 129.0204), 3.949, 45),\n ('horizontal', '100', (70.928, 129.0204), (181.5004, 129.0204), (126.2142, 140.0204)),\n ('vertical', '13.0952', (181.5004, 114.5407), (181.5004, 129.0204), (170.5004, 121.7806)),\n ('radius', 'R12.5', (181.5004, 128.3623), 13.8215, 45),\n ('horizontal', '7.8904', (209.3219, 114.5407), (218.0465, 114.5407), (213.6842, 125.5407))\n]\n\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; _ds.dxf.dimasz = 2.5\n _ds.dxf.dimexe = 1.25; _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\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\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,\n angle=(0 if d[0] == \"horizontal\" else 90),\n 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,\n 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,\n 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,\n text=text, dimstyle=\"EZDXF\").render()\n\n doc.saveas(out_path)\n\n\nif __name__ == \"__main__\":\n out = sys.argv[1] if len(sys.argv) > 1 else \"0028_00283954_gt.dxf\"\n draw(out)\n print(\"wrote\", out)\n```"}], "images": ["images/0028_00283954.png"], "id": "0028_00283954"} {"messages": [{"role": "user", "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. It is extruded to a thickness of -457.14 mm. The outline includes one or more oblique (angled) edges."}, {"role": "assistant", "content": "```python\n#!/usr/bin/env python3\n# -*- coding: utf-8 -*-\n# Ground-truth 2D engineering drawing for part: 0029_00290393\n# Self-contained: reproduces the three-view DXF via ezdxf, NO FreeCAD needed.\n# Coordinates are A4 page millimetres (scale=0.17248717948719716, page=[297.0, 210.0]).\n# visible edges -> solid (layer OUTLINE); hidden edges -> dashed (layer HIDDEN)\n# dimensions -> real movable DIMENSION entities (text = true mm value)\n# Run: python 0029_00290393_gt.py [out.dxf]\nimport sys\nimport ezdxf\nimport math\n\nSCALE = 0.17248717948719716\nPAGE = [297.0, 210.0]\n\nVISIBLE_SEGMENTS = [\n (101.43193, 154.801282, 101.43193, 155.345978),\n (100.705668, 156.07224, 94.895573, 156.253806),\n (93.624615, 157.706329, 93.624615, 169.144953),\n (94.895573, 170.597476, 100.705668, 170.779042),\n (101.43193, 171.505304, 101.43193, 172.05),\n (101.43193, 172.05, 92.716788, 172.05),\n (92.716788, 172.05, 92.716788, 154.801282),\n (92.716788, 154.801282, 101.43193, 154.801282),\n (101.43193, 61.95, 101.43193, 140.801282),\n (101.43193, 140.801282, 92.716788, 140.801282),\n (92.716788, 61.95, 92.716788, 140.801282),\n (101.43193, 61.95, 92.716788, 61.95),\n (194.283212, 172.05, 115.43193, 172.05),\n (115.43193, 172.05, 115.43193, 154.801282),\n (194.283212, 154.801282, 115.43193, 154.801282),\n (194.283212, 172.05, 194.283212, 154.801282)\n]\nVISIBLE_CIRCLES = [\n\n]\nVISIBLE_ARCS = [\n (100.687391, 155.327701, 0.744764, 1.40625, 88.59375),\n (95.022911, 157.647532, 1.399531, 177.592175, -95.220325),\n (95.022911, 169.20375, 1.399531, 95.220325, -177.592175),\n (100.687391, 171.523581, 0.744764, -88.59375, -1.40625)\n]\nHIDDEN_SEGMENTS = [\n (94.8956, 61.95, 94.8956, 140.8013),\n (93.6246, 61.95, 93.6246, 140.8013),\n (93.6234, 140.8013, 93.6234, 61.95),\n (194.2832, 155.346, 115.4319, 155.346),\n (194.2832, 156.2538, 115.4319, 156.2538),\n (194.2832, 157.7063, 115.4319, 157.7063),\n (194.2832, 169.145, 115.4319, 169.145),\n (194.2832, 170.5975, 115.4319, 170.5975),\n (194.2832, 171.5053, 115.4319, 171.5053)\n]\n# (orient, text, p1, p2, base) for linear; (orient, text, center, radius, angle) for diameter\nDIMENSIONS = [\n ('horizontal', '50.5263', (101.4319, 172.05), (92.7168, 172.05), (97.0744, 161.05)),\n ('vertical', '3.1579', (101.4319, 154.8013), (101.4319, 155.346), (90.4319, 155.0736)),\n ('vertical', '66.3158', (93.6246, 157.7063), (93.6246, 169.145), (82.6246, 163.4256)),\n ('vertical', '100', (92.7168, 172.05), (92.7168, 154.8013), (103.7168, 163.4256)),\n ('horizontal', '33.7007', (100.7057, 156.0722), (94.8956, 156.2538), (97.457, 145.1684)),\n ('horizontal', '33.7007', (94.8956, 170.5975), (100.7057, 170.779), (97.457, 181.6829)),\n ('radius', 'R4.3178', (100.6874, 155.3277), 0.7448, 45),\n ('radius', 'R8.1138', (95.0229, 157.6475), 1.3995, 45),\n ('horizontal', '457.143', (194.2832, 154.8013), (115.4319, 154.8013), (154.8576, 143.8013))\n]\n\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; _ds.dxf.dimasz = 2.5\n _ds.dxf.dimexe = 1.25; _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\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\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,\n angle=(0 if d[0] == \"horizontal\" else 90),\n 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,\n 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,\n 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,\n text=text, dimstyle=\"EZDXF\").render()\n\n doc.saveas(out_path)\n\n\nif __name__ == \"__main__\":\n out = sys.argv[1] if len(sys.argv) > 1 else \"0029_00290393_gt.dxf\"\n draw(out)\n print(\"wrote\", out)\n```"}], "images": ["images/0029_00290393.png"], "id": "0029_00290393"} {"messages": [{"role": "user", "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 71.97 mm. The outline includes one or more oblique (angled) edges."}, {"role": "assistant", "content": "```python\n#!/usr/bin/env python3\n# -*- coding: utf-8 -*-\n# Ground-truth 2D engineering drawing for part: 0029_00291586\n# Self-contained: reproduces the three-view DXF via ezdxf, NO FreeCAD needed.\n# Coordinates are A4 page millimetres (scale=0.5053864541832673, page=[297.0, 210.0]).\n# visible edges -> solid (layer OUTLINE); hidden edges -> dashed (layer HIDDEN)\n# dimensions -> real movable DIMENSION entities (text = true mm value)\n# Run: python 0029_00291586_gt.py [out.dxf]\nimport sys\nimport ezdxf\nimport math\n\nSCALE = 0.5053864541832673\nPAGE = [297.0, 210.0]\n\nVISIBLE_SEGMENTS = [\n (89.215737, 168.221315, 139.754382, 168.221315),\n (147.411753, 160.563944, 147.411753, 131.465936),\n (139.754382, 123.808566, 89.215737, 123.808566),\n (81.558366, 131.465936, 81.558366, 160.563944),\n (73.900996, 65.778685, 89.215737, 65.778685),\n (89.215737, 102.151195, 89.215737, 65.778685),\n (73.900996, 102.151195, 89.215737, 102.151195),\n (89.215737, 65.778685, 139.754382, 65.778685),\n (139.754382, 102.151195, 139.754382, 65.778685),\n (89.215737, 102.151195, 139.754382, 102.151195),\n (139.754382, 65.778685, 155.069123, 65.778685),\n (139.754382, 102.151195, 155.069123, 102.151195),\n (73.900996, 65.778685, 73.900996, 102.151195),\n (155.069123, 65.778685, 155.069123, 102.151195),\n (169.069124, 160.563944, 205.441634, 160.563944),\n (205.441634, 160.563944, 205.441634, 175.878685),\n (169.069124, 160.563944, 169.069124, 175.878685),\n (205.441634, 116.151195, 205.441634, 131.465936),\n (169.069124, 131.465936, 205.441634, 131.465936),\n (169.069124, 116.151195, 169.069124, 131.465936),\n (205.441634, 131.465936, 205.441634, 160.563944),\n (169.069124, 131.465936, 169.069124, 160.563944),\n (205.441634, 175.878685, 169.069124, 175.878685),\n (205.441634, 116.151195, 169.069124, 116.151195)\n]\nVISIBLE_CIRCLES = [\n\n]\nVISIBLE_ARCS = [\n (81.558366, 168.221315, 7.657371, 0.0, -90.0),\n (147.411753, 168.221315, 7.657371, -90.0, 180.0),\n (147.411753, 123.808566, 7.657371, -180.0, 90.0),\n (81.558366, 123.808566, 7.657371, 90.0, 0.0)\n]\nHIDDEN_SEGMENTS = [\n (81.5584, 102.1512, 81.5584, 65.7787),\n (147.4118, 102.1512, 147.4118, 65.7787),\n (169.0691, 168.2213, 205.4416, 168.2213),\n (169.0691, 123.8086, 205.4416, 123.8086)\n]\n# (orient, text, p1, p2, base) for linear; (orient, text, center, radius, angle) for diameter\nDIMENSIONS = [\n ('horizontal', '100', (89.2157, 168.2213), (139.7544, 168.2213), (114.4851, 179.2213)),\n ('vertical', '57.5758', (147.4117, 160.5639), (147.4117, 131.4659), (158.4117, 146.0149)),\n ('radius', 'R15.1515', (81.5584, 168.2213), 7.6574, 45),\n ('horizontal', '71.9697', (169.0691, 160.5639), (205.4416, 160.5639), (187.2554, 171.5639))\n]\n\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; _ds.dxf.dimasz = 2.5\n _ds.dxf.dimexe = 1.25; _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\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\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,\n angle=(0 if d[0] == \"horizontal\" else 90),\n 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,\n 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,\n 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,\n text=text, dimstyle=\"EZDXF\").render()\n\n doc.saveas(out_path)\n\n\nif __name__ == \"__main__\":\n out = sys.argv[1] if len(sys.argv) > 1 else \"0029_00291586_gt.dxf\"\n draw(out)\n print(\"wrote\", out)\n```"}], "images": ["images/0029_00291586.png"], "id": "0029_00291586"} {"messages": [{"role": "user", "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 11.11 mm tall, featuring 2 circular holes, each of diameter 6.67 mm. It is extruded to a thickness of 3.48 mm."}, {"role": "assistant", "content": "```python\n#!/usr/bin/env python3\n# -*- coding: utf-8 -*-\n# Ground-truth 2D engineering drawing for part: 0029_00295359\n# Self-contained: reproduces the three-view DXF via ezdxf, NO FreeCAD needed.\n# Coordinates are A4 page millimetres (scale=1.202236363636346, page=[297.0, 210.0]).\n# visible edges -> solid (layer OUTLINE); hidden edges -> dashed (layer HIDDEN)\n# dimensions -> real movable DIMENSION entities (text = true mm value)\n# Run: python 0029_00295359_gt.py [out.dxf]\nimport sys\nimport ezdxf\nimport math\n\nSCALE = 1.202236363636346\nPAGE = [297.0, 210.0]\n\nVISIBLE_SEGMENTS = [\n (192.182333, 119.412712, 71.958697, 119.412712),\n (71.958697, 132.770894, 192.182333, 132.770894),\n (192.182333, 101.229106, 198.861424, 101.229106),\n (192.182333, 105.412712, 198.861424, 105.412712),\n (65.279606, 101.229106, 71.958697, 101.229106),\n (65.279606, 105.412712, 71.958697, 105.412712),\n (71.958697, 105.412712, 192.182333, 105.412712),\n (71.958697, 101.229106, 192.182333, 101.229106),\n (198.861424, 105.412712, 198.861424, 101.229106),\n (65.279606, 105.412712, 65.279606, 101.229106),\n (192.182333, 101.229106, 192.182333, 105.412712),\n (71.958697, 101.229106, 71.958697, 105.412712),\n (217.045031, 119.412712, 212.861424, 119.412712),\n (217.045031, 119.412712, 217.045031, 132.770894),\n (217.045031, 132.770894, 212.861424, 132.770894),\n (212.861424, 119.412712, 212.861424, 132.770894)\n]\nVISIBLE_CIRCLES = [\n (71.958697, 126.091803, 4.007455),\n (192.182333, 126.091803, 4.007455)\n]\nVISIBLE_ARCS = [\n (192.182333, 126.091803, 6.679091, -90.0, 90.0),\n (71.958697, 126.091803, 6.679091, 90.0, -90.0)\n]\nHIDDEN_SEGMENTS = [\n (75.9662, 101.2291, 75.9662, 105.4127),\n (196.1898, 101.2291, 196.1898, 105.4127),\n (67.9512, 105.4127, 67.9512, 101.2291),\n (188.1749, 105.4127, 188.1749, 101.2291),\n (212.8614, 122.0843, 217.045, 122.0843),\n (212.8614, 130.0993, 217.045, 130.0993)\n]\n# (orient, text, p1, p2, base) for linear; (orient, text, center, radius, angle) for diameter\nDIMENSIONS = [\n ('horizontal', '100', (192.1823, 119.4127), (71.9587, 119.4127), (132.0705, 108.4127)),\n ('vertical', '11.1111', (192.1823, 132.7709), (192.1823, 119.4127), (203.1823, 126.0918)),\n ('diameter', '%%c6.6667', (71.9587, 126.0918), 4.0075, 45),\n ('vertical', '5.5556', (71.9587, 132.7709), (71.9587, 126.0918), (82.9587, 129.4314)),\n ('diameter', '%%c6.6667', (192.1823, 126.0918), 4.0075, 45),\n ('horizontal', '100', (71.9587, 126.0918), (192.1823, 126.0918), (132.0705, 137.0918)),\n ('vertical', '5.5556', (192.1823, 132.7709), (192.1823, 126.0918), (203.1823, 129.4314)),\n ('radius', 'R5.5556', (192.1823, 126.0918), 6.6791, 135),\n ('horizontal', '3.4799', (217.045, 132.7709), (212.8614, 132.7709), (214.9532, 121.7709))\n]\n\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; _ds.dxf.dimasz = 2.5\n _ds.dxf.dimexe = 1.25; _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\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\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,\n angle=(0 if d[0] == \"horizontal\" else 90),\n 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,\n 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,\n 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,\n text=text, dimstyle=\"EZDXF\").render()\n\n doc.saveas(out_path)\n\n\nif __name__ == \"__main__\":\n out = sys.argv[1] if len(sys.argv) > 1 else \"0029_00295359_gt.dxf\"\n draw(out)\n print(\"wrote\", out)\n```"}], "images": ["images/0029_00295359.png"], "id": "0029_00295359"} {"messages": [{"role": "user", "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 66.2 mm wide and 100 mm tall, featuring a circular hole of diameter 30.99 mm. It is extruded to a thickness of 18.25 mm."}, {"role": "assistant", "content": "```python\n#!/usr/bin/env python3\n# -*- coding: utf-8 -*-\n# Ground-truth 2D engineering drawing for part: 0030_00308604\n# Self-contained: reproduces the three-view DXF via ezdxf, NO FreeCAD needed.\n# Coordinates are A4 page millimetres (scale=0.6349754653130775, page=[297.0, 210.0]).\n# visible edges -> solid (layer OUTLINE); hidden edges -> dashed (layer HIDDEN)\n# dimensions -> real movable DIMENSION entities (text = true mm value)\n# Run: python 0030_00308604_gt.py [out.dxf]\nimport sys\nimport ezdxf\nimport math\n\nSCALE = 0.6349754653130775\nPAGE = [297.0, 210.0]\n\nVISIBLE_SEGMENTS = [\n (151.723964, 177.304198, 151.723964, 113.806652),\n (109.690376, 113.806652, 109.690376, 177.304198),\n (109.690376, 177.304198, 151.723964, 177.304198),\n (151.723964, 67.204198, 151.723964, 78.789858),\n (109.690376, 67.204198, 109.690376, 78.789858),\n (109.690376, 78.789858, 151.723964, 78.789858),\n (109.690376, 67.204198, 151.723964, 67.204198),\n (177.309624, 92.789858, 177.309624, 113.806652),\n (165.723964, 92.789858, 165.723964, 113.806652),\n (165.723964, 113.806652, 165.723964, 177.304198),\n (177.309624, 177.304198, 165.723964, 177.304198),\n (177.309624, 113.806652, 177.309624, 177.304198),\n (165.723964, 92.789858, 177.309624, 92.789858),\n (177.309624, 113.806652, 165.723964, 113.806652)\n]\nVISIBLE_CIRCLES = [\n (131.154336, 113.806652, 9.837648)\n]\nVISIBLE_ARCS = [\n (130.70717, 113.806652, 21.016794, -180.0, -0.0)\n]\nHIDDEN_SEGMENTS = [\n (140.992, 67.2042, 140.992, 78.7899),\n (121.3167, 78.7899, 121.3167, 67.2042),\n (165.724, 103.969, 177.3096, 103.969),\n (165.724, 123.6443, 177.3096, 123.6443)\n]\n# (orient, text, p1, p2, base) for linear; (orient, text, center, radius, angle) for diameter\nDIMENSIONS = [\n ('horizontal', '66.1972', (151.724, 113.8067), (109.6904, 113.8067), (130.7072, 102.8067)),\n ('vertical', '100', (151.724, 177.3042), (151.724, 113.8067), (162.724, 145.5554)),\n ('diameter', '%%c30.9859', (131.1543, 113.8067), 9.8376, 45),\n ('horizontal', '33.8028', (109.6904, 113.8067), (131.1543, 113.8067), (120.4223, 124.8067)),\n ('vertical', '100', (131.1543, 177.3042), (131.1543, 113.8067), (142.1543, 145.5554)),\n ('radius', 'R33.0986', (130.7072, 113.8067), 21.0168, 45),\n ('horizontal', '18.2458', (177.3096, 177.3042), (165.724, 177.3042), (171.5168, 166.3042))\n]\n\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; _ds.dxf.dimasz = 2.5\n _ds.dxf.dimexe = 1.25; _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\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\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,\n angle=(0 if d[0] == \"horizontal\" else 90),\n 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,\n 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,\n 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,\n text=text, dimstyle=\"EZDXF\").render()\n\n doc.saveas(out_path)\n\n\nif __name__ == \"__main__\":\n out = sys.argv[1] if len(sys.argv) > 1 else \"0030_00308604_gt.dxf\"\n draw(out)\n print(\"wrote\", out)\n```"}], "images": ["images/0030_00308604.png"], "id": "0030_00308604"} {"messages": [{"role": "user", "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 65.52 mm. It is extruded to a thickness of 107.49 mm. The outline includes one or more oblique (angled) edges."}, {"role": "assistant", "content": "```python\n#!/usr/bin/env python3\n# -*- coding: utf-8 -*-\n# Ground-truth 2D engineering drawing for part: 0030_00309745\n# Self-contained: reproduces the three-view DXF via ezdxf, NO FreeCAD needed.\n# Coordinates are A4 page millimetres (scale=0.45242415234070166, page=[297.0, 210.0]).\n# visible edges -> solid (layer OUTLINE); hidden edges -> dashed (layer HIDDEN)\n# dimensions -> real movable DIMENSION entities (text = true mm value)\n# Run: python 0030_00309745_gt.py [out.dxf]\nimport sys\nimport ezdxf\nimport math\n\nSCALE = 0.45242415234070166\nPAGE = [297.0, 210.0]\n\nVISIBLE_SEGMENTS = [\n (113.289055, 141.908332, 154.631262, 141.908332),\n (154.631262, 141.908332, 154.631262, 125.527458),\n (154.631262, 125.527458, 109.388847, 125.527458),\n (109.388847, 125.527458, 109.388847, 129.427666),\n (109.388847, 129.427666, 80.527306, 129.427666),\n (58.948727, 62.896737, 93.007972, 62.896737),\n (58.948727, 111.527458, 93.007972, 111.527458),\n (93.007972, 62.896737, 106.26868, 62.896737),\n (106.26868, 62.896737, 106.26868, 111.527458),\n (93.007972, 111.527458, 106.26868, 111.527458),\n (106.26868, 111.527458, 113.289055, 111.527458),\n (106.26868, 62.896737, 113.289055, 62.896737),\n (154.631262, 111.527458, 113.289055, 111.527458),\n (154.631262, 62.896737, 154.631262, 111.527458),\n (113.289055, 62.896737, 154.631262, 62.896737),\n (58.948727, 111.527458, 58.948727, 62.896737),\n (93.007972, 62.896737, 93.007972, 111.527458),\n (113.289055, 62.896737, 113.289055, 111.527458),\n (217.261983, 129.427666, 217.261983, 172.996737),\n (168.631262, 129.427666, 168.631262, 172.996737),\n (217.261983, 125.527458, 168.631262, 125.527458),\n (168.631262, 125.527458, 168.631262, 129.427666),\n (217.261983, 125.527458, 217.261983, 129.427666),\n (217.261983, 129.427666, 168.631262, 129.427666),\n (168.631262, 172.996737, 217.261983, 172.996737)\n]\nVISIBLE_CIRCLES = [\n (80.527306, 148.148666, 14.820791)\n]\nVISIBLE_ARCS = [\n (80.733752, 151.211712, 21.785024, 55.707029, -90.542971),\n (75.881759, 143.721389, 30.707748, 8.289484, 56.101984),\n (113.307513, 148.998225, 7.089917, -173.117914, -90.149164)\n]\nHIDDEN_SEGMENTS = [\n (109.3888, 62.8967, 109.3888, 111.5275),\n (95.3481, 62.8967, 95.3481, 111.5275),\n (65.7065, 111.5275, 65.7065, 62.8967),\n (217.262, 148.1487, 168.6313, 148.1487),\n (217.262, 141.9083, 168.6313, 141.9083),\n (168.6313, 133.3279, 217.262, 133.3279),\n (168.6313, 162.9695, 217.262, 162.9695)\n]\n# (orient, text, p1, p2, base) for linear; (orient, text, center, radius, angle) for diameter\nDIMENSIONS = [\n ('horizontal', '63.7931', (109.3888, 129.4277), (80.5273, 129.4277), (94.9581, 118.4277)),\n ('horizontal', '91.3793', (113.2891, 141.9083), (154.6313, 141.9083), (133.9602, 152.9083)),\n ('horizontal', '100', (154.6313, 125.5274), (109.3888, 125.5274), (132.0101, 114.5274)),\n ('vertical', '8.6207', (109.3888, 125.5274), (109.3888, 129.4277), (98.3888, 127.4775)),\n ('vertical', '36.2069', (154.6313, 141.9083), (154.6313, 125.5274), (165.6313, 133.7179)),\n ('diameter', '%%c65.5172', (80.5273, 148.1486), 14.8208, 45),\n ('vertical', '46.5517', (80.5273, 169.2098), (80.5273, 148.1486), (91.5273, 158.6792)),\n ('radius', 'R48.1518', (80.7337, 151.2117), 21.785, 45),\n ('radius', 'R67.8738', (75.8818, 143.7214), 30.7077, 45),\n ('radius', 'R15.671', (113.3075, 148.9982), 7.0899, 45),\n ('horizontal', '107.489', (217.262, 129.4277), (168.6313, 129.4277), (192.9466, 118.4277))\n]\n\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; _ds.dxf.dimasz = 2.5\n _ds.dxf.dimexe = 1.25; _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\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\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,\n angle=(0 if d[0] == \"horizontal\" else 90),\n 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,\n 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,\n 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,\n text=text, dimstyle=\"EZDXF\").render()\n\n doc.saveas(out_path)\n\n\nif __name__ == \"__main__\":\n out = sys.argv[1] if len(sys.argv) > 1 else \"0030_00309745_gt.dxf\"\n draw(out)\n print(\"wrote\", out)\n```"}], "images": ["images/0030_00309745.png"], "id": "0030_00309745"} {"messages": [{"role": "user", "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. It is extruded to a thickness of -80 mm."}, {"role": "assistant", "content": "```python\n#!/usr/bin/env python3\n# -*- coding: utf-8 -*-\n# Ground-truth 2D engineering drawing for part: 0031_00312282\n# Self-contained: reproduces the three-view DXF via ezdxf, NO FreeCAD needed.\n# Coordinates are A4 page millimetres (scale=0.6615579710144447, page=[297.0, 210.0]).\n# visible edges -> solid (layer OUTLINE); hidden edges -> dashed (layer HIDDEN)\n# dimensions -> real movable DIMENSION entities (text = true mm value)\n# Run: python 0031_00312282_gt.py [out.dxf]\nimport sys\nimport ezdxf\nimport math\n\nSCALE = 0.6615579710144447\nPAGE = [297.0, 210.0]\n\nVISIBLE_SEGMENTS = [\n (143.11558, 172.05, 143.11558, 128.874638),\n (143.11558, 128.874638, 76.959783, 128.874638),\n (76.959783, 128.874638, 76.959783, 172.05),\n (76.959783, 114.874638, 143.11558, 114.874638),\n (143.11558, 114.874638, 143.11558, 61.95),\n (76.959783, 61.95, 143.11558, 61.95),\n (76.959783, 114.874638, 76.959783, 61.95),\n (157.11558, 172.05, 210.040217, 172.05),\n (157.11558, 128.874638, 210.040217, 128.874638),\n (210.040217, 128.874638, 210.040217, 172.05),\n (157.11558, 128.874638, 157.11558, 172.05)\n]\nVISIBLE_CIRCLES = [\n\n]\nVISIBLE_ARCS = [\n (110.037681, 172.05, 33.077899, -180.0, 0.0)\n]\nHIDDEN_SEGMENTS = [\n (210.0402, 138.9721, 157.1156, 138.9721)\n]\n# (orient, text, p1, p2, base) for linear; (orient, text, center, radius, angle) for diameter\nDIMENSIONS = [\n ('horizontal', '100', (76.9598, 172.05), (143.1156, 172.05), (110.0377, 183.05)),\n ('vertical', '65.2632', (143.1156, 172.05), (143.1156, 128.8746), (154.1156, 150.4623)),\n ('radius', 'R50', (110.0377, 172.05), 33.0779, 45),\n ('horizontal', '80', (157.1156, 172.05), (210.0402, 172.05), (183.5779, 183.05))\n]\n\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; _ds.dxf.dimasz = 2.5\n _ds.dxf.dimexe = 1.25; _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\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\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,\n angle=(0 if d[0] == \"horizontal\" else 90),\n 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,\n 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,\n 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,\n text=text, dimstyle=\"EZDXF\").render()\n\n doc.saveas(out_path)\n\n\nif __name__ == \"__main__\":\n out = sys.argv[1] if len(sys.argv) > 1 else \"0031_00312282_gt.dxf\"\n draw(out)\n print(\"wrote\", out)\n```"}], "images": ["images/0031_00312282.png"], "id": "0031_00312282"} {"messages": [{"role": "user", "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 2.17 mm. The outline includes one or more oblique (angled) edges."}, {"role": "assistant", "content": "```python\n#!/usr/bin/env python3\n# -*- coding: utf-8 -*-\n# Ground-truth 2D engineering drawing for part: 0031_00318470\n# Self-contained: reproduces the three-view DXF via ezdxf, NO FreeCAD needed.\n# Coordinates are A4 page millimetres (scale=0.886794740364709, page=[297.0, 210.0]).\n# visible edges -> solid (layer OUTLINE); hidden edges -> dashed (layer HIDDEN)\n# dimensions -> real movable DIMENSION entities (text = true mm value)\n# Run: python 0031_00318470_gt.py [out.dxf]\nimport sys\nimport ezdxf\nimport math\n\nSCALE = 0.886794740364709\nPAGE = [297.0, 210.0]\n\nVISIBLE_SEGMENTS = [\n (110.267431, 171.234114, 159.851653, 171.234114),\n (162.712281, 169.327029, 162.712281, 80.647555),\n (159.851653, 78.740469, 110.267431, 78.740469),\n (108.360345, 80.647555, 108.360345, 169.327029),\n (108.360345, 62.765886, 110.267431, 62.765886),\n (108.360345, 64.693259, 110.267431, 64.693259),\n (108.360345, 62.765886, 108.360345, 64.693259),\n (110.267431, 64.693259, 159.851653, 64.693259),\n (159.851653, 62.765886, 159.851653, 64.693259),\n (110.267431, 62.765886, 159.851653, 62.765886),\n (159.851653, 62.765886, 162.712281, 62.765886),\n (162.712281, 62.765886, 162.712281, 64.693259),\n (159.851653, 64.693259, 162.712281, 64.693259),\n (110.267431, 62.765886, 110.267431, 64.693259),\n (178.639655, 169.327029, 178.639655, 171.234114),\n (178.639655, 171.234114, 176.712281, 171.234114),\n (176.712281, 169.327029, 176.712281, 171.234114),\n (178.639655, 171.234114, 178.639655, 171.281324),\n (176.712281, 171.234114, 176.712281, 171.281324),\n (178.639655, 78.69326, 178.639655, 78.740469),\n (176.712281, 78.69326, 176.712281, 78.740469),\n (178.639655, 78.740469, 176.712281, 78.740469),\n (178.639655, 78.740469, 178.639655, 80.647555),\n (176.712281, 78.740469, 176.712281, 80.647555),\n (176.712281, 80.647555, 176.712281, 169.327029),\n (178.639655, 80.647555, 178.639655, 169.327029),\n (176.712281, 171.281324, 178.639655, 171.281324),\n (176.712281, 78.69326, 178.639655, 78.69326),\n (178.639655, 169.327029, 176.712281, 169.327029),\n (178.639655, 80.647555, 176.712281, 80.647555)\n]\nVISIBLE_CIRCLES = [\n\n]\nVISIBLE_ARCS = [\n (110.267431, 169.327029, 1.907085, 90.0, -180.0),\n (160.328424, 168.850257, 2.431066, 11.309932, 101.309932),\n (160.328424, 81.124326, 2.431066, -101.309932, -11.309932),\n (110.267431, 80.647555, 1.907085, -180.0, -90.0)\n]\nHIDDEN_SEGMENTS = [\n\n]\n# (orient, text, p1, p2, base) for linear; (orient, text, center, radius, angle) for diameter\nDIMENSIONS = [\n ('horizontal', '55.914', (110.2674, 171.2341), (159.8517, 171.2341), (135.0595, 182.2341)),\n ('vertical', '100', (162.7123, 169.3271), (162.7123, 80.6476), (173.7123, 124.9873)),\n ('radius', 'R2.1505', (110.2674, 169.3271), 1.9071, 45),\n ('radius', 'R2.7414', (160.3284, 168.8502), 2.4311, 45),\n ('horizontal', '2.1734', (178.6397, 169.3271), (176.7123, 169.3271), (177.676, 158.3271))\n]\n\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; _ds.dxf.dimasz = 2.5\n _ds.dxf.dimexe = 1.25; _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\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\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,\n angle=(0 if d[0] == \"horizontal\" else 90),\n 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,\n 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,\n 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,\n text=text, dimstyle=\"EZDXF\").render()\n\n doc.saveas(out_path)\n\n\nif __name__ == \"__main__\":\n out = sys.argv[1] if len(sys.argv) > 1 else \"0031_00318470_gt.dxf\"\n draw(out)\n print(\"wrote\", out)\n```"}], "images": ["images/0031_00318470.png"], "id": "0031_00318470"} {"messages": [{"role": "user", "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 98.77 mm. It is extruded to a thickness of 11259.26 mm. The outline includes one or more oblique (angled) edges."}, {"role": "assistant", "content": "```python\n#!/usr/bin/env python3\n# -*- coding: utf-8 -*-\n# Ground-truth 2D engineering drawing for part: 0032_00325539\n# Self-contained: reproduces the three-view DXF via ezdxf, NO FreeCAD needed.\n# Coordinates are A4 page millimetres (scale=0.012916049918610117, page=[297.0, 210.0]).\n# visible edges -> solid (layer OUTLINE); hidden edges -> dashed (layer HIDDEN)\n# dimensions -> real movable DIMENSION entities (text = true mm value)\n# Run: python 0032_00325539_gt.py [out.dxf]\nimport sys\nimport ezdxf\nimport math\n\nSCALE = 0.012916049918610117\nPAGE = [297.0, 210.0]\n\nVISIBLE_SEGMENTS = [\n (63.141487, 195.955155, 64.433092, 195.955155),\n (64.544713, 196.066775, 64.544713, 197.342434),\n (64.433092, 197.47, 63.141487, 197.47),\n (63.029867, 197.342434, 63.029867, 196.066775),\n (63.141487, 197.342434, 63.141487, 196.066775),\n (64.433092, 197.342434, 63.141487, 197.342434),\n (64.433092, 196.066775, 64.433092, 197.342434),\n (63.141487, 196.066775, 64.433092, 196.066775),\n (64.544713, 181.955155, 64.544713, 36.53),\n (64.544713, 181.955155, 64.544978, 181.955155),\n (64.544978, 181.955155, 64.433092, 181.955155),\n (64.433092, 181.955155, 64.433092, 36.53),\n (64.544713, 36.53, 64.544978, 36.53),\n (64.544978, 36.53, 64.433092, 36.53),\n (64.433092, 36.53, 63.141487, 36.53),\n (63.141487, 181.955155, 63.141487, 36.53),\n (64.433092, 181.955155, 63.141487, 181.955155),\n (63.141487, 181.955155, 63.029602, 181.955155),\n (63.029602, 181.955155, 63.029867, 181.955155),\n (63.029867, 181.955155, 63.029867, 36.53),\n (63.141487, 36.53, 63.029602, 36.53),\n (63.029602, 36.53, 63.029867, 36.53),\n (64.544978, 36.53, 64.544978, 181.955155),\n (63.029602, 36.53, 63.029602, 181.955155),\n (78.544978, 196.066775, 78.544978, 195.955155),\n (78.544978, 195.955155, 223.970133, 195.955155),\n (223.970133, 196.066775, 223.970133, 195.955155),\n (78.544978, 197.47, 223.970133, 197.47),\n (78.544978, 197.47, 78.544978, 197.342434),\n (78.544978, 197.342434, 223.970133, 197.342434),\n (223.970133, 197.47, 223.970133, 197.342434),\n (223.970133, 197.342434, 223.970133, 196.066775),\n (78.544978, 197.342434, 78.544978, 196.066775),\n (78.544978, 196.066775, 223.970133, 196.066775)\n]\nVISIBLE_CIRCLES = [\n\n]\nVISIBLE_ARCS = [\n (63.141487, 196.066775, 0.11162, 180.0, -90.0),\n (64.433092, 196.066775, 0.11162, -90.0, 0.0),\n (64.425119, 197.350407, 0.119859, -3.814075, 86.185925),\n (63.14946, 197.350407, 0.119859, 93.814075, -176.185925)\n]\nHIDDEN_SEGMENTS = [\n\n]\n# (orient, text, p1, p2, base) for linear; (orient, text, center, radius, angle) for diameter\nDIMENSIONS = [\n ('horizontal', '100', (63.1415, 195.9552), (64.4331, 195.9552), (63.7873, 206.9552)),\n ('vertical', '98.7654', (64.5447, 196.0668), (64.5447, 197.3424), (53.5447, 196.7046)),\n ('horizontal', '100', (63.1415, 196.0668), (64.4331, 196.0668), (63.7873, 207.0668)),\n ('vertical', '98.7654', (63.1415, 196.0668), (63.1415, 197.3424), (52.1415, 196.7046)),\n ('vertical', '8.642', (63.0299, 196.0668), (63.1415, 196.0668), (63.0857, 207.0668)),\n ('vertical', '8.642', (63.1415, 195.9552), (63.1415, 196.0668), (52.1415, 196.011)),\n ('radius', 'R8.642', (63.1415, 196.0668), 0.1116, 45),\n ('radius', 'R9.2798', (64.4251, 197.3504), 0.1199, 45),\n ('horizontal', '11259.3', (78.545, 196.0668), (223.9701, 196.0668), (151.2576, 207.0668))\n]\n\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; _ds.dxf.dimasz = 2.5\n _ds.dxf.dimexe = 1.25; _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\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\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,\n angle=(0 if d[0] == \"horizontal\" else 90),\n 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,\n 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,\n 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,\n text=text, dimstyle=\"EZDXF\").render()\n\n doc.saveas(out_path)\n\n\nif __name__ == \"__main__\":\n out = sys.argv[1] if len(sys.argv) > 1 else \"0032_00325539_gt.dxf\"\n draw(out)\n print(\"wrote\", out)\n```"}], "images": ["images/0032_00325539.png"], "id": "0032_00325539"} {"messages": [{"role": "user", "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 -2561.8 mm. The outline includes one or more oblique (angled) edges."}, {"role": "assistant", "content": "```python\n#!/usr/bin/env python3\n# -*- coding: utf-8 -*-\n# Ground-truth 2D engineering drawing for part: 0033_00339005\n# Self-contained: reproduces the three-view DXF via ezdxf, NO FreeCAD needed.\n# Coordinates are A4 page millimetres (scale=0.03601221052631568, page=[297.0, 210.0]).\n# visible edges -> solid (layer OUTLINE); hidden edges -> dashed (layer HIDDEN)\n# dimensions -> real movable DIMENSION entities (text = true mm value)\n# Run: python 0033_00339005_gt.py [out.dxf]\nimport sys\nimport ezdxf\nimport math\n\nSCALE = 0.03601221052631568\nPAGE = [297.0, 210.0]\n\nVISIBLE_SEGMENTS = [\n (88.57067, 172.05, 92.171892, 172.05),\n (92.293281, 171.928611, 92.293281, 168.367853),\n (92.171892, 168.206, 88.57067, 168.206),\n (88.449281, 168.367853, 88.449281, 171.928611),\n (88.449281, 154.206, 88.449281, 61.95),\n (88.449281, 61.95, 88.57067, 61.95),\n (88.449281, 154.206, 88.57067, 154.206),\n (88.57067, 61.95, 92.171892, 61.95),\n (88.57067, 154.206, 92.171892, 154.206),\n (92.171892, 61.95, 92.293281, 61.95),\n (92.293281, 154.206, 92.293281, 61.95),\n (92.171892, 154.206, 92.293281, 154.206),\n (92.293281, 61.95, 92.294719, 61.95),\n (92.293281, 154.206, 92.294719, 154.206),\n (88.449281, 61.95, 88.447843, 61.95),\n (88.449281, 154.206, 88.447843, 154.206),\n (92.294719, 61.95, 92.294719, 154.206),\n (88.447843, 61.95, 88.447843, 154.206),\n (88.57067, 154.206, 88.57067, 61.95),\n (92.171892, 154.206, 92.171892, 61.95),\n (198.550719, 171.928611, 198.550719, 172.05),\n (106.294719, 172.05, 198.550719, 172.05),\n (106.294719, 171.928611, 106.294719, 172.05),\n (106.294719, 168.206, 198.550719, 168.206),\n (198.550719, 168.206, 198.550719, 168.367853),\n (106.294719, 168.367853, 198.550719, 168.367853),\n (106.294719, 168.206, 106.294719, 168.367853),\n (198.550719, 168.367853, 198.550719, 171.928611),\n (106.294719, 168.367853, 106.294719, 171.928611),\n (106.294719, 171.928611, 198.550719, 171.928611)\n]\nVISIBLE_CIRCLES = [\n\n]\nVISIBLE_ARCS = [\n (88.57067, 171.928611, 0.121389, 90.0, 180.0),\n (92.171892, 171.928611, 0.121389, -0.0, 90.0),\n (92.15166, 168.347621, 0.143059, -81.869898, 8.130102),\n (88.590902, 168.347621, 0.143059, 171.869898, -98.130102)\n]\nHIDDEN_SEGMENTS = [\n\n]\n# (orient, text, p1, p2, base) for linear; (orient, text, center, radius, angle) for diameter\nDIMENSIONS = [\n ('horizontal', '100', (88.5707, 172.05), (92.1719, 172.05), (90.3713, 183.05)),\n ('vertical', '98.8764', (92.2933, 171.9286), (92.2933, 168.3679), (103.2933, 170.1482)),\n ('radius', 'R3.3708', (88.5707, 171.9286), 0.1214, 45),\n ('radius', 'R3.9725', (92.1517, 168.3476), 0.1431, 45),\n ('horizontal', '2561.8', (106.2947, 171.9286), (198.5507, 171.9286), (152.4227, 182.9286))\n]\n\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; _ds.dxf.dimasz = 2.5\n _ds.dxf.dimexe = 1.25; _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\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\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,\n angle=(0 if d[0] == \"horizontal\" else 90),\n 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,\n 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,\n 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,\n text=text, dimstyle=\"EZDXF\").render()\n\n doc.saveas(out_path)\n\n\nif __name__ == \"__main__\":\n out = sys.argv[1] if len(sys.argv) > 1 else \"0033_00339005_gt.dxf\"\n draw(out)\n print(\"wrote\", out)\n```"}], "images": ["images/0033_00339005.png"], "id": "0033_00339005"} {"messages": [{"role": "user", "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 11.58 x 100 mm bounding box. It is extruded to a thickness of 33.33 mm."}, {"role": "assistant", "content": "```python\n#!/usr/bin/env python3\n# -*- coding: utf-8 -*-\n# Ground-truth 2D engineering drawing for part: 0034_00340181\n# Self-contained: reproduces the three-view DXF via ezdxf, NO FreeCAD needed.\n# Coordinates are A4 page millimetres (scale=0.720750000000018, page=[297.0, 210.0]).\n# visible edges -> solid (layer OUTLINE); hidden edges -> dashed (layer HIDDEN)\n# dimensions -> real movable DIMENSION entities (text = true mm value)\n# Run: python 0034_00340181_gt.py [out.dxf]\nimport sys\nimport ezdxf\nimport math\n\nSCALE = 0.720750000000018\nPAGE = [297.0, 210.0]\n\nVISIBLE_SEGMENTS = [\n (120.694079, 172.05, 120.694079, 163.704474),\n (128.280921, 163.704474, 128.280921, 172.05),\n (128.280921, 172.05, 136.626447, 172.05),\n (136.626447, 172.05, 136.626447, 99.975),\n (136.626447, 99.975, 128.280921, 99.975),\n (128.280921, 99.975, 128.280921, 108.320526),\n (120.694079, 108.320526, 120.694079, 99.975),\n (120.694079, 99.975, 112.348553, 99.975),\n (112.348553, 99.975, 112.348553, 172.05),\n (112.348553, 172.05, 120.694079, 172.05),\n (120.694079, 61.95, 120.694079, 85.975),\n (120.694079, 85.975, 128.280921, 85.975),\n (120.694079, 61.95, 128.280921, 61.95),\n (128.280921, 61.95, 128.280921, 85.975),\n (128.280921, 85.975, 136.626447, 85.975),\n (136.626447, 61.95, 136.626447, 85.975),\n (128.280921, 61.95, 136.626447, 61.95),\n (112.348553, 61.95, 112.348553, 85.975),\n (112.348553, 85.975, 120.694079, 85.975),\n (112.348553, 61.95, 120.694079, 61.95),\n (174.651447, 99.975, 150.626447, 99.975),\n (150.626447, 99.975, 150.626447, 172.05),\n (174.651447, 172.05, 150.626447, 172.05),\n (174.651447, 99.975, 174.651447, 172.05)\n]\nVISIBLE_CIRCLES = [\n\n]\nVISIBLE_ARCS = [\n (124.4875, 163.704474, 3.793421, -180.0, -0.0),\n (124.4875, 108.320526, 3.793421, -0.0, -180.0)\n]\nHIDDEN_SEGMENTS = [\n (150.6264, 159.9111, 174.6514, 159.9111),\n (150.6264, 112.1139, 174.6514, 112.1139)\n]\n# (orient, text, p1, p2, base) for linear; (orient, text, center, radius, angle) for diameter\nDIMENSIONS = [\n ('horizontal', '10.5263', (120.694, 163.7045), (128.2809, 163.7045), (124.4875, 174.7045)),\n ('horizontal', '11.5789', (128.2809, 172.05), (136.6264, 172.05), (132.4537, 183.05)),\n ('vertical', '11.5789', (120.694, 172.05), (120.694, 163.7045), (131.694, 167.8773)),\n ('vertical', '100', (136.6264, 172.05), (136.6264, 99.975), (147.6264, 136.0125)),\n ('radius', 'R5.2632', (124.4875, 163.7045), 3.7935, 45),\n ('horizontal', '33.3333', (174.6514, 172.05), (150.6265, 172.05), (162.639, 161.05))\n]\n\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; _ds.dxf.dimasz = 2.5\n _ds.dxf.dimexe = 1.25; _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\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\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,\n angle=(0 if d[0] == \"horizontal\" else 90),\n 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,\n 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,\n 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,\n text=text, dimstyle=\"EZDXF\").render()\n\n doc.saveas(out_path)\n\n\nif __name__ == \"__main__\":\n out = sys.argv[1] if len(sys.argv) > 1 else \"0034_00340181_gt.dxf\"\n draw(out)\n print(\"wrote\", out)\n```"}], "images": ["images/0034_00340181.png"], "id": "0034_00340181"} {"messages": [{"role": "user", "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 3.78 mm. The outline includes one or more oblique (angled) edges."}, {"role": "assistant", "content": "```python\n#!/usr/bin/env python3\n# -*- coding: utf-8 -*-\n# Ground-truth 2D engineering drawing for part: 0034_00347130\n# Self-contained: reproduces the three-view DXF via ezdxf, NO FreeCAD needed.\n# Coordinates are A4 page millimetres (scale=0.8891197494473024, page=[297.0, 210.0]).\n# visible edges -> solid (layer OUTLINE); hidden edges -> dashed (layer HIDDEN)\n# dimensions -> real movable DIMENSION entities (text = true mm value)\n# Run: python 0034_00347130_gt.py [out.dxf]\nimport sys\nimport ezdxf\nimport math\n\nSCALE = 0.8891197494473024\nPAGE = [297.0, 210.0]\n\nVISIBLE_SEGMENTS = [\n (103.746684, 79.313854, 165.889462, 79.313854),\n (167.801547, 81.22594, 167.801547, 170.137915),\n (165.889462, 172.05, 103.746684, 172.05),\n (101.834598, 170.137915, 101.834598, 81.22594),\n (101.834598, 65.313854, 101.834598, 61.95),\n (167.801547, 65.313854, 167.801547, 61.95),\n (167.801547, 65.313854, 165.889462, 65.313854),\n (167.801547, 61.95, 165.889462, 61.95),\n (165.889462, 61.95, 103.746684, 61.95),\n (165.889462, 65.313854, 103.746684, 65.313854),\n (103.746684, 65.313854, 101.834598, 65.313854),\n (103.746684, 61.95, 101.834598, 61.95),\n (165.889462, 65.313854, 165.889462, 61.95),\n (103.746684, 65.313854, 103.746684, 61.95),\n (181.801548, 81.22594, 181.801548, 79.313854),\n (181.801548, 79.313854, 185.165402, 79.313854),\n (185.165402, 81.22594, 185.165402, 79.313854),\n (181.801548, 172.05, 185.165402, 172.05),\n (181.801548, 172.05, 181.801548, 170.137915),\n (185.165402, 172.05, 185.165402, 170.137915),\n (185.165402, 170.137915, 185.165402, 81.22594),\n (181.801548, 170.137915, 181.801548, 81.22594),\n (181.801548, 81.22594, 185.165402, 81.22594),\n (181.801548, 170.137915, 185.165402, 170.137915)\n]\nVISIBLE_CIRCLES = [\n\n]\nVISIBLE_ARCS = [\n (103.746684, 81.22594, 1.912085, 180.0, -90.0),\n (165.889462, 81.22594, 1.912085, -90.0, -0.0),\n (165.889462, 170.137915, 1.912085, -0.0, 90.0),\n (103.746684, 170.137915, 1.912085, 90.0, -180.0)\n]\nHIDDEN_SEGMENTS = [\n\n]\n# (orient, text, p1, p2, base) for linear; (orient, text, center, radius, angle) for diameter\nDIMENSIONS = [\n ('horizontal', '69.8925', (103.7467, 79.3138), (165.8895, 79.3138), (134.8181, 90.3138)),\n ('vertical', '100', (167.8016, 81.2259), (167.8016, 170.1379), (156.8016, 125.6819)),\n ('radius', 'R2.1505', (103.7467, 81.2259), 1.9121, 45),\n ('horizontal', '3.7834', (181.8015, 81.2259), (185.1654, 81.2259), (183.4835, 92.2259))\n]\n\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; _ds.dxf.dimasz = 2.5\n _ds.dxf.dimexe = 1.25; _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\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\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,\n angle=(0 if d[0] == \"horizontal\" else 90),\n 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,\n 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,\n 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,\n text=text, dimstyle=\"EZDXF\").render()\n\n doc.saveas(out_path)\n\n\nif __name__ == \"__main__\":\n out = sys.argv[1] if len(sys.argv) > 1 else \"0034_00347130_gt.dxf\"\n draw(out)\n print(\"wrote\", out)\n```"}], "images": ["images/0034_00347130.png"], "id": "0034_00347130"} {"messages": [{"role": "user", "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 a circular hole of diameter 52.63 mm. It is extruded to a thickness of 2.37 mm. The outline includes one or more oblique (angled) edges."}, {"role": "assistant", "content": "```python\n#!/usr/bin/env python3\n# -*- coding: utf-8 -*-\n# Ground-truth 2D engineering drawing for part: 0035_00352439\n# Self-contained: reproduces the three-view DXF via ezdxf, NO FreeCAD needed.\n# Coordinates are A4 page millimetres (scale=0.7259324392689429, page=[297.0, 210.0]).\n# visible edges -> solid (layer OUTLINE); hidden edges -> dashed (layer HIDDEN)\n# dimensions -> real movable DIMENSION entities (text = true mm value)\n# Run: python 0035_00352439_gt.py [out.dxf]\nimport sys\nimport ezdxf\nimport math\n\nSCALE = 0.7259324392689429\nPAGE = [297.0, 210.0]\n\nVISIBLE_SEGMENTS = [\n (98.485195, 121.268073, 98.485195, 147.248813),\n (171.078439, 147.248813, 171.078439, 121.268073),\n (104.59831, 121.268073, 98.485195, 121.268073),\n (171.078439, 121.268073, 164.965323, 121.268073),\n (164.965323, 121.268073, 164.965323, 109.805982),\n (164.965323, 109.805982, 153.503232, 93.759055),\n (153.503232, 93.759055, 116.060401, 93.759055),\n (116.060401, 93.759055, 104.59831, 109.805982),\n (104.59831, 109.805982, 104.59831, 121.268073),\n (98.485195, 76.322688, 171.078439, 76.322688),\n (171.078439, 76.322688, 171.078439, 79.759055),\n (98.485195, 79.759055, 171.078439, 79.759055),\n (98.485195, 79.759055, 98.485195, 76.322688),\n (188.514805, 147.248813, 188.514805, 168.105811),\n (185.078439, 147.248813, 185.078439, 168.105811),\n (185.078439, 147.248813, 188.514805, 147.248813),\n (185.078439, 121.268073, 188.514805, 121.268073),\n (185.078439, 121.268073, 185.078439, 147.248813),\n (188.514805, 121.268073, 188.514805, 147.248813),\n (185.078439, 93.759055, 185.078439, 109.805982),\n (185.078439, 109.805982, 185.078439, 121.268073),\n (188.514805, 93.759055, 188.514805, 109.805982),\n (188.514805, 109.805982, 188.514805, 121.268073),\n (188.514805, 93.759055, 185.078439, 93.759055),\n (188.514805, 109.805982, 185.078439, 109.805982),\n (185.078439, 168.105811, 188.514805, 168.105811)\n]\nVISIBLE_CIRCLES = [\n (135.163886, 126.617049, 19.103485)\n]\nVISIBLE_ARCS = [\n (134.781817, 126.094512, 42.011299, 30.234375, 149.765625)\n]\nHIDDEN_SEGMENTS = [\n (104.5983, 79.7591, 104.5983, 76.3227),\n (164.9653, 76.3227, 164.9653, 79.7591),\n (153.5032, 76.3227, 153.5032, 79.7591),\n (116.0604, 76.3227, 116.0604, 79.7591),\n (154.2674, 79.7591, 154.2674, 76.3227),\n (116.0604, 79.7591, 116.0604, 76.3227),\n (185.0784, 107.5136, 188.5148, 107.5136),\n (185.0784, 145.7205, 188.5148, 145.7205)\n]\n# (orient, text, p1, p2, base) for linear; (orient, text, center, radius, angle) for diameter\nDIMENSIONS = [\n ('horizontal', '8.4211', (171.0784, 121.2681), (164.9653, 121.2681), (168.0219, 110.2681)),\n ('horizontal', '51.5789', (153.5032, 93.759), (116.0604, 93.759), (134.7818, 82.759)),\n ('horizontal', '100', (98.4852, 147.2488), (171.0784, 147.2488), (134.7818, 158.2488)),\n ('vertical', '15.7895', (164.9653, 121.2681), (164.9653, 109.806), (175.9653, 115.537)),\n ('vertical', '35.7895', (171.0784, 147.2488), (171.0784, 121.2681), (182.0784, 134.2585)),\n ('aligned', '27.1652', (164.9653, 109.806), (153.5032, 93.759), (168.1853, 95.3889)),\n ('aligned', '27.1652', (116.0604, 93.759), (104.5983, 109.806), (101.3783, 95.3889)),\n ('diameter', '%%c52.6316', (135.1639, 126.6171), 19.1035, 45),\n ('horizontal', '50.5263', (98.4852, 126.6171), (135.1639, 126.6171), (116.8245, 137.6171)),\n ('vertical', '28.4211', (135.1639, 147.2488), (135.1639, 126.6171), (146.1639, 136.9329)),\n ('radius', 'R57.8722', (134.7818, 126.0945), 42.0113, 45),\n ('horizontal', '4.7337', (188.5148, 147.2488), (185.0784, 147.2488), (186.7966, 136.2488))\n]\n\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; _ds.dxf.dimasz = 2.5\n _ds.dxf.dimexe = 1.25; _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\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\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,\n angle=(0 if d[0] == \"horizontal\" else 90),\n 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,\n 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,\n 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,\n text=text, dimstyle=\"EZDXF\").render()\n\n doc.saveas(out_path)\n\n\nif __name__ == \"__main__\":\n out = sys.argv[1] if len(sys.argv) > 1 else \"0035_00352439_gt.dxf\"\n draw(out)\n print(\"wrote\", out)\n```"}], "images": ["images/0035_00352439.png"], "id": "0035_00352439"} {"messages": [{"role": "user", "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 60.17 mm. The outline includes one or more oblique (angled) edges."}, {"role": "assistant", "content": "```python\n#!/usr/bin/env python3\n# -*- coding: utf-8 -*-\n# Ground-truth 2D engineering drawing for part: 0036_00361387\n# Self-contained: reproduces the three-view DXF via ezdxf, NO FreeCAD needed.\n# Coordinates are A4 page millimetres (scale=0.7352952016927757, page=[297.0, 210.0]).\n# visible edges -> solid (layer OUTLINE); hidden edges -> dashed (layer HIDDEN)\n# dimensions -> real movable DIMENSION entities (text = true mm value)\n# Run: python 0036_00361387_gt.py [out.dxf]\nimport sys\nimport ezdxf\nimport math\n\nSCALE = 0.7352952016927757\nPAGE = [297.0, 210.0]\n\nVISIBLE_SEGMENTS = [\n (151.14358, 175.72648, 151.14358, 167.986531),\n (151.14358, 167.986531, 121.731772, 167.986531),\n (107.025868, 154.054622, 107.025868, 138.574723),\n (77.614059, 138.574723, 77.614059, 175.72648),\n (77.614059, 175.72648, 151.14358, 175.72648),\n (151.14358, 65.62648, 151.14358, 109.868818),\n (77.614059, 65.62648, 77.614059, 109.868818),\n (77.614059, 109.868818, 151.14358, 109.868818),\n (77.614059, 65.62648, 151.14358, 65.62648),\n (209.385918, 123.868819, 209.385918, 124.328378),\n (209.385918, 124.328378, 209.385918, 124.787938),\n (209.385918, 124.787938, 209.385918, 125.247497),\n (209.385918, 125.247497, 209.385918, 125.707057),\n (209.385918, 125.707057, 209.385918, 126.166616),\n (209.385918, 126.166616, 209.385918, 126.626176),\n (209.385918, 126.626176, 209.385918, 127.085735),\n (209.385918, 127.085735, 209.385918, 127.545295),\n (209.385918, 127.545295, 209.385918, 128.004854),\n (209.385918, 128.004854, 209.385918, 128.464414),\n (209.385918, 128.464414, 209.385918, 128.923973),\n (209.385918, 128.923973, 209.385918, 129.383533),\n (209.385918, 129.383533, 209.385918, 129.843092),\n (209.385918, 129.843092, 209.385918, 130.302652),\n (209.385918, 130.302652, 209.385918, 130.762211),\n (209.385918, 130.762211, 209.385918, 131.221771),\n (209.385918, 131.221771, 209.385918, 131.68133),\n (209.385918, 131.68133, 209.385918, 132.14089),\n (209.385918, 132.14089, 209.385918, 132.600449),\n (209.385918, 132.600449, 209.385918, 133.060009),\n (209.385918, 133.060009, 209.385918, 133.519568),\n (209.385918, 133.519568, 209.385918, 133.979128),\n (209.385918, 133.979128, 209.385918, 134.438687),\n (209.385918, 134.438687, 209.385918, 134.898247),\n (209.385918, 134.898247, 209.385918, 135.357806),\n (209.385918, 135.357806, 209.385918, 135.817366),\n (209.385918, 135.817366, 209.385918, 136.276925),\n (209.385918, 136.276925, 209.385918, 136.736485),\n (209.385918, 136.736485, 209.385918, 137.196044),\n (209.385918, 137.196044, 209.385918, 137.655604),\n (209.385918, 137.655604, 209.385918, 138.115163),\n (209.385918, 138.115163, 209.385918, 138.574723),\n (165.14358, 123.868819, 165.14358, 124.328378),\n (165.14358, 124.328378, 165.14358, 124.787938),\n (165.14358, 124.787938, 165.14358, 125.247497),\n (165.14358, 125.247497, 165.14358, 125.707057),\n (165.14358, 125.707057, 165.14358, 126.166616),\n (165.14358, 126.166616, 165.14358, 126.626176),\n (165.14358, 126.626176, 165.14358, 127.085735),\n (165.14358, 127.085735, 165.14358, 127.545295),\n (165.14358, 127.545295, 165.14358, 128.004854),\n (165.14358, 128.004854, 165.14358, 128.464414),\n (165.14358, 128.464414, 165.14358, 128.923973),\n (165.14358, 128.923973, 165.14358, 129.383533),\n (165.14358, 129.383533, 165.14358, 129.843092),\n (165.14358, 129.843092, 165.14358, 130.302652),\n (165.14358, 130.302652, 165.14358, 130.762211),\n (165.14358, 130.762211, 165.14358, 131.221771),\n (165.14358, 131.221771, 165.14358, 131.68133),\n (165.14358, 131.68133, 165.14358, 132.14089),\n (165.14358, 132.14089, 165.14358, 132.600449),\n (165.14358, 132.600449, 165.14358, 133.060009),\n (165.14358, 133.060009, 165.14358, 133.519568),\n (165.14358, 133.519568, 165.14358, 133.979128),\n (165.14358, 133.979128, 165.14358, 134.438687),\n (165.14358, 134.438687, 165.14358, 134.898247),\n (165.14358, 134.898247, 165.14358, 135.357806),\n (165.14358, 135.357806, 165.14358, 135.817366),\n (165.14358, 135.817366, 165.14358, 136.276925),\n (165.14358, 136.276925, 165.14358, 136.736485),\n (165.14358, 136.736485, 165.14358, 137.196044),\n (165.14358, 137.196044, 165.14358, 137.655604),\n (165.14358, 137.655604, 165.14358, 138.115163),\n (165.14358, 138.115163, 165.14358, 138.574723),\n (165.14358, 138.574723, 165.14358, 175.72648),\n (209.385918, 175.72648, 165.14358, 175.72648),\n (209.385918, 138.574723, 209.385918, 175.72648),\n (165.14358, 123.868819, 209.385918, 123.868819),\n (209.385918, 138.574723, 165.14358, 138.574723)\n]\nVISIBLE_CIRCLES = [\n\n]\nVISIBLE_ARCS = [\n (121.344774, 153.667624, 14.324135, 88.451842, 178.451842),\n (92.319964, 138.574723, 14.705904, -180.0, 0.0)\n]\nHIDDEN_SEGMENTS = [\n (121.7318, 65.6265, 121.7318, 109.8688),\n (107.0259, 65.6265, 107.0259, 109.8688),\n (209.3859, 167.9865, 165.1436, 167.9865),\n (209.3859, 154.0546, 165.1436, 154.0546),\n (165.1436, 167.9918, 209.3859, 167.9918)\n]\n# (orient, text, p1, p2, base) for linear; (orient, text, center, radius, angle) for diameter\nDIMENSIONS = [\n ('horizontal', '40', (151.1436, 167.9865), (121.7318, 167.9865), (136.4377, 156.9865)),\n ('horizontal', '100', (77.614, 175.7265), (151.1436, 175.7265), (114.3788, 186.7265)),\n ('vertical', '10.5263', (151.1436, 175.7265), (151.1436, 167.9865), (162.1436, 171.8565)),\n ('vertical', '21.0526', (107.0259, 154.0546), (107.0259, 138.5747), (118.0259, 146.3147)),\n ('vertical', '50.5263', (77.614, 138.5747), (77.614, 175.7265), (66.614, 157.1506)),\n ('radius', 'R19.4808', (121.3448, 153.6676), 14.3241, 45),\n ('radius', 'R20', (92.32, 138.5747), 14.7059, 45),\n ('horizontal', '60.1695', (209.3859, 175.7265), (165.1436, 175.7265), (187.2648, 164.7265))\n]\n\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; _ds.dxf.dimasz = 2.5\n _ds.dxf.dimexe = 1.25; _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\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\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,\n angle=(0 if d[0] == \"horizontal\" else 90),\n 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,\n 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,\n 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,\n text=text, dimstyle=\"EZDXF\").render()\n\n doc.saveas(out_path)\n\n\nif __name__ == \"__main__\":\n out = sys.argv[1] if len(sys.argv) > 1 else \"0036_00361387_gt.dxf\"\n draw(out)\n print(\"wrote\", out)\n```"}], "images": ["images/0036_00361387.png"], "id": "0036_00361387"} {"messages": [{"role": "user", "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, featuring a circular hole of diameter 7.06 mm. It is extruded to a thickness of 5.82 mm. The outline includes one or more oblique (angled) edges."}, {"role": "assistant", "content": "```python\n#!/usr/bin/env python3\n# -*- coding: utf-8 -*-\n# Ground-truth 2D engineering drawing for part: 0036_00362520\n# Self-contained: reproduces the three-view DXF via ezdxf, NO FreeCAD needed.\n# Coordinates are A4 page millimetres (scale=1.246812175949291, page=[297.0, 210.0]).\n# visible edges -> solid (layer OUTLINE); hidden edges -> dashed (layer HIDDEN)\n# dimensions -> real movable DIMENSION entities (text = true mm value)\n# Run: python 0036_00362520_gt.py [out.dxf]\nimport sys\nimport ezdxf\nimport math\n\nSCALE = 1.246812175949291\nPAGE = [297.0, 210.0]\n\nVISIBLE_SEGMENTS = [\n (72.481285, 115.160735, 197.162503, 115.160735),\n (198.629341, 135.696465, 123.82061, 135.696465),\n (123.82061, 135.696465, 97.417529, 140.096979),\n (97.417529, 140.096979, 62.21342, 128.362276),\n (62.21342, 122.494924, 62.21342, 128.362276),\n (62.21342, 122.494924, 72.481285, 115.160735),\n (198.629341, 101.160735, 198.629341, 93.902943),\n (198.629341, 93.902943, 123.82061, 93.902943),\n (123.82061, 101.160735, 123.82061, 93.902943),\n (198.629341, 101.160735, 123.82061, 101.160735),\n (123.82061, 93.902943, 97.417529, 93.902943),\n (97.417529, 101.160735, 97.417529, 93.902943),\n (123.82061, 101.160735, 97.417529, 101.160735),\n (97.417529, 93.902943, 62.21342, 93.902943),\n (62.21342, 101.160735, 62.21342, 93.902943),\n (97.417529, 101.160735, 62.21342, 101.160735),\n (201.895629, 93.902943, 201.895629, 101.160735),\n (215.895629, 115.160735, 223.15342, 115.160735),\n (215.895629, 140.096979, 223.15342, 140.096979),\n (223.15342, 140.096979, 223.15342, 128.362276),\n (215.895629, 128.362276, 223.15342, 128.362276),\n (215.895629, 140.096979, 215.895629, 128.362276),\n (223.15342, 122.494924, 223.15342, 128.362276),\n (215.895629, 122.494924, 223.15342, 122.494924),\n (215.895629, 128.362276, 215.895629, 122.494924),\n (223.15342, 122.494924, 223.15342, 115.160735),\n (215.895629, 122.494924, 215.895629, 115.160735)\n]\nVISIBLE_CIRCLES = [\n (185.4278, 125.4286, 4.400514)\n]\nVISIBLE_ARCS = [\n (186.567079, 126.237803, 15.32855, -46.273117, 38.101883),\n (298.609085, -4039.268731, 4141.597088, 91.33809, 91.383263),\n (298.609085, 4234.33241, 4141.597088, -91.383263, -91.33809)\n]\nHIDDEN_SEGMENTS = [\n (72.4813, 101.1608, 72.4813, 93.903),\n (197.1625, 101.1608, 197.1625, 93.903),\n (189.8283, 101.1608, 189.8283, 93.903),\n (181.0273, 93.903, 181.0273, 101.1608),\n (215.8956, 135.6965, 223.1534, 135.6965),\n (223.1534, 129.8292, 215.8956, 129.8292),\n (223.1534, 121.0281, 215.8956, 121.0281)\n]\n# (orient, text, p1, p2, base) for linear; (orient, text, center, radius, angle) for diameter\nDIMENSIONS = [\n ('horizontal', '60', (198.6294, 135.6965), (123.8207, 135.6965), (161.225, 124.6965)),\n ('horizontal', '100', (72.4813, 115.1608), (197.1625, 115.1608), (134.8219, 126.1608)),\n ('vertical', '4.7059', (62.2134, 128.3624), (62.2134, 122.495), (73.2134, 125.4287)),\n ('aligned', '21.4686', (123.8207, 135.6965), (97.4175, 140.097), (108.8107, 127.0464)),\n ('aligned', '29.7626', (97.4175, 140.097), (62.2134, 128.3624), (83.294, 123.7942)),\n ('aligned', '10.1204', (62.2134, 122.495), (72.4813, 115.1608), (73.741, 127.7789)),\n ('diameter', '%%c7.0588', (185.4278, 125.4286), 4.4005, 45),\n ('horizontal', '98.8235', (62.2134, 125.4286), (185.4278, 125.4286), (123.8206, 136.4286)),\n ('vertical', '8.2353', (185.4278, 115.1608), (185.4278, 125.4286), (174.4278, 120.2947)),\n ('radius', 'R12.2942', (186.5671, 126.2378), 15.3286, 135),\n ('horizontal', '5.8211', (215.8956, 115.1608), (223.1535, 115.1608), (219.5245, 126.1608))\n]\n\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; _ds.dxf.dimasz = 2.5\n _ds.dxf.dimexe = 1.25; _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\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\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,\n angle=(0 if d[0] == \"horizontal\" else 90),\n 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,\n 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,\n 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,\n text=text, dimstyle=\"EZDXF\").render()\n\n doc.saveas(out_path)\n\n\nif __name__ == \"__main__\":\n out = sys.argv[1] if len(sys.argv) > 1 else \"0036_00362520_gt.dxf\"\n draw(out)\n print(\"wrote\", out)\n```"}], "images": ["images/0036_00362520.png"], "id": "0036_00362520"} {"messages": [{"role": "user", "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 4 circular holes (diameters 9.07, 12.1 mm). It is extruded to a thickness of 2.91 mm. The outline includes one or more oblique (angled) edges."}, {"role": "assistant", "content": "```python\n#!/usr/bin/env python3\n# -*- coding: utf-8 -*-\n# Ground-truth 2D engineering drawing for part: 0036_00366766\n# Self-contained: reproduces the three-view DXF via ezdxf, NO FreeCAD needed.\n# Coordinates are A4 page millimetres (scale=0.586193619437808, page=[297.0, 210.0]).\n# visible edges -> solid (layer OUTLINE); hidden edges -> dashed (layer HIDDEN)\n# dimensions -> real movable DIMENSION entities (text = true mm value)\n# Run: python 0036_00366766_gt.py [out.dxf]\nimport sys\nimport ezdxf\nimport math\n\nSCALE = 0.586193619437808\nPAGE = [297.0, 210.0]\n\nVISIBLE_SEGMENTS = [\n (92.627727, 103.021273, 89.968091, 143.802364),\n (99.720091, 155.327455, 158.232091, 158.873637),\n (158.232091, 129.617636, 124.543364, 132.277273),\n (108.585545, 118.979091, 107.699, 103.021273),\n (89.931215, 78.606626, 90.237118, 78.606626),\n (90.237118, 78.606626, 90.54302, 78.606626),\n (90.54302, 78.606626, 90.848922, 78.606626),\n (90.848922, 78.606626, 91.154825, 78.606626),\n (91.154825, 78.606626, 91.460727, 78.606626),\n (91.460727, 78.606626, 91.766629, 78.606626),\n (91.766629, 78.606626, 92.072532, 78.606626),\n (92.072532, 78.606626, 92.378434, 78.606626),\n (92.378434, 78.606626, 92.684336, 78.606626),\n (92.684336, 78.606626, 92.990239, 78.606626),\n (92.990239, 78.606626, 93.296141, 78.606626),\n (93.296141, 78.606626, 93.602044, 78.606626),\n (93.602044, 78.606626, 93.907946, 78.606626),\n (93.907946, 78.606626, 94.213848, 78.606626),\n (94.213848, 78.606626, 94.519751, 78.606626),\n (94.519751, 78.606626, 94.825653, 78.606626),\n (94.825653, 78.606626, 95.131555, 78.606626),\n (95.131555, 78.606626, 95.437458, 78.606626),\n (95.437458, 78.606626, 95.74336, 78.606626),\n (95.74336, 78.606626, 96.049262, 78.606626),\n (96.049262, 78.606626, 96.355165, 78.606626),\n (96.355165, 78.606626, 96.661067, 78.606626),\n (96.661067, 78.606626, 96.96697, 78.606626),\n (96.96697, 78.606626, 97.272872, 78.606626),\n (97.272872, 78.606626, 97.578774, 78.606626),\n (97.578774, 78.606626, 97.884677, 78.606626),\n (97.884677, 78.606626, 98.190579, 78.606626),\n (98.190579, 78.606626, 98.496481, 78.606626),\n (98.496481, 78.606626, 98.802384, 78.606626),\n (98.802384, 78.606626, 99.108286, 78.606626),\n (99.108286, 78.606626, 99.414188, 78.606626),\n (99.414188, 78.606626, 99.720091, 78.606626),\n (99.720091, 78.606626, 99.720091, 82.021024),\n (89.931215, 82.021024, 90.237118, 82.021024),\n (90.237118, 82.021024, 90.54302, 82.021024),\n (90.54302, 82.021024, 90.848922, 82.021024),\n (90.848922, 82.021024, 91.154825, 82.021024),\n (91.154825, 82.021024, 91.460727, 82.021024),\n (91.460727, 82.021024, 91.766629, 82.021024),\n (91.766629, 82.021024, 92.072532, 82.021024),\n (92.072532, 82.021024, 92.378434, 82.021024),\n (92.378434, 82.021024, 92.684336, 82.021024),\n (92.684336, 82.021024, 92.990239, 82.021024),\n (92.990239, 82.021024, 93.296141, 82.021024),\n (93.296141, 82.021024, 93.602044, 82.021024),\n (93.602044, 82.021024, 93.907946, 82.021024),\n (93.907946, 82.021024, 94.213848, 82.021024),\n (94.213848, 82.021024, 94.519751, 82.021024),\n (94.519751, 82.021024, 94.825653, 82.021024),\n (94.825653, 82.021024, 95.131555, 82.021024),\n (95.131555, 82.021024, 95.437458, 82.021024),\n (95.437458, 82.021024, 95.74336, 82.021024),\n (95.74336, 82.021024, 96.049262, 82.021024),\n (96.049262, 82.021024, 96.355165, 82.021024),\n (96.355165, 82.021024, 96.661067, 82.021024),\n (96.661067, 82.021024, 96.96697, 82.021024),\n (96.96697, 82.021024, 97.272872, 82.021024),\n (97.272872, 82.021024, 97.578774, 82.021024),\n (97.578774, 82.021024, 97.884677, 82.021024),\n (97.884677, 82.021024, 98.190579, 82.021024),\n (98.190579, 82.021024, 98.496481, 82.021024),\n (98.496481, 82.021024, 98.802384, 82.021024),\n (98.802384, 82.021024, 99.108286, 82.021024),\n (99.108286, 82.021024, 99.414188, 82.021024),\n (99.414188, 82.021024, 99.720091, 82.021024),\n (99.720091, 82.021024, 158.232091, 82.021024),\n (158.232091, 78.606626, 158.232091, 82.021024),\n (99.720091, 78.606626, 158.232091, 78.606626),\n (158.232091, 78.606626, 158.724178, 78.606626),\n (158.724178, 78.606626, 159.216264, 78.606626),\n (159.216264, 78.606626, 159.708351, 78.606626),\n (159.708351, 78.606626, 160.200437, 78.606626),\n (160.200437, 78.606626, 160.692524, 78.606626),\n (160.692524, 78.606626, 161.18461, 78.606626),\n (161.18461, 78.606626, 161.676697, 78.606626),\n (161.676697, 78.606626, 162.168783, 78.606626),\n (162.168783, 78.606626, 162.66087, 78.606626),\n (162.66087, 78.606626, 163.152957, 78.606626),\n (163.152957, 78.606626, 163.645043, 78.606626),\n (163.645043, 78.606626, 164.13713, 78.606626),\n (164.13713, 78.606626, 164.629216, 78.606626),\n (164.629216, 78.606626, 165.121303, 78.606626),\n (165.121303, 78.606626, 165.613389, 78.606626),\n (165.613389, 78.606626, 166.105476, 78.606626),\n (166.105476, 78.606626, 166.597562, 78.606626),\n (166.597562, 78.606626, 167.089649, 78.606626),\n (167.089649, 78.606626, 167.581735, 78.606626),\n (167.581735, 78.606626, 168.073822, 78.606626),\n (168.073822, 78.606626, 168.565908, 78.606626),\n (168.565908, 78.606626, 169.057995, 78.606626),\n (169.057995, 78.606626, 169.550081, 78.606626),\n (169.550081, 78.606626, 170.042168, 78.606626),\n (170.042168, 78.606626, 170.534255, 78.606626),\n (170.534255, 78.606626, 171.026341, 78.606626),\n (171.026341, 78.606626, 171.518428, 78.606626),\n (171.518428, 78.606626, 172.010514, 78.606626),\n (172.010514, 78.606626, 172.502601, 78.606626),\n (172.502601, 78.606626, 172.994687, 78.606626),\n (172.994687, 78.606626, 173.486774, 78.606626),\n (173.486774, 78.606626, 173.97886, 78.606626),\n (89.931215, 82.021024, 89.931215, 78.606626),\n (173.97886, 82.021024, 173.97886, 78.606626),\n (191.393259, 143.802364, 191.393259, 144.162523),\n (191.393259, 144.162523, 191.393259, 144.522682),\n (191.393259, 144.522682, 191.393259, 144.882841),\n (191.393259, 144.882841, 191.393259, 145.243),\n (191.393259, 145.243, 191.393259, 145.603159),\n (191.393259, 145.603159, 191.393259, 145.963318),\n (191.393259, 145.963318, 191.393259, 146.323477),\n (191.393259, 146.323477, 191.393259, 146.683636),\n (191.393259, 146.683636, 191.393259, 147.043796),\n (191.393259, 147.043796, 191.393259, 147.403955),\n (191.393259, 147.403955, 191.393259, 147.764114),\n (191.393259, 147.764114, 191.393259, 148.124273),\n (191.393259, 148.124273, 191.393259, 148.484432),\n (191.393259, 148.484432, 191.393259, 148.844591),\n (191.393259, 148.844591, 191.393259, 149.20475),\n (191.393259, 149.20475, 191.393259, 149.564909),\n (191.393259, 149.564909, 191.393259, 149.925068),\n (191.393259, 149.925068, 191.393259, 150.285227),\n (191.393259, 150.285227, 191.393259, 150.645386),\n (191.393259, 150.645386, 191.393259, 151.005546),\n (191.393259, 151.005546, 191.393259, 151.365705),\n (191.393259, 151.365705, 191.393259, 151.725864),\n (191.393259, 151.725864, 191.393259, 152.086023),\n (191.393259, 152.086023, 191.393259, 152.446182),\n (191.393259, 152.446182, 191.393259, 152.806341),\n (191.393259, 152.806341, 191.393259, 153.1665),\n (191.393259, 153.1665, 191.393259, 153.526659),\n (191.393259, 153.526659, 191.393259, 153.886818),\n (191.393259, 153.886818, 191.393259, 154.246977),\n (191.393259, 154.246977, 191.393259, 154.607136),\n (191.393259, 154.607136, 191.393259, 154.967296),\n (191.393259, 154.967296, 191.393259, 155.327455),\n (191.393259, 155.327455, 187.97886, 155.327455),\n (187.97886, 143.802364, 187.97886, 144.162523),\n (187.97886, 144.162523, 187.97886, 144.522682),\n (187.97886, 144.522682, 187.97886, 144.882841),\n (187.97886, 144.882841, 187.97886, 145.243),\n (187.97886, 145.243, 187.97886, 145.603159),\n (187.97886, 145.603159, 187.97886, 145.963318),\n (187.97886, 145.963318, 187.97886, 146.323477),\n (187.97886, 146.323477, 187.97886, 146.683636),\n (187.97886, 146.683636, 187.97886, 147.043796),\n (187.97886, 147.043796, 187.97886, 147.403955),\n (187.97886, 147.403955, 187.97886, 147.764114),\n (187.97886, 147.764114, 187.97886, 148.124273),\n (187.97886, 148.124273, 187.97886, 148.484432),\n (187.97886, 148.484432, 187.97886, 148.844591),\n (187.97886, 148.844591, 187.97886, 149.20475),\n (187.97886, 149.20475, 187.97886, 149.564909),\n (187.97886, 149.564909, 187.97886, 149.925068),\n (187.97886, 149.925068, 187.97886, 150.285227),\n (187.97886, 150.285227, 187.97886, 150.645386),\n (187.97886, 150.645386, 187.97886, 151.005546),\n (187.97886, 151.005546, 187.97886, 151.365705),\n (187.97886, 151.365705, 187.97886, 151.725864),\n (187.97886, 151.725864, 187.97886, 152.086023),\n (187.97886, 152.086023, 187.97886, 152.446182),\n (187.97886, 152.446182, 187.97886, 152.806341),\n (187.97886, 152.806341, 187.97886, 153.1665),\n (187.97886, 153.1665, 187.97886, 153.526659),\n (187.97886, 153.526659, 187.97886, 153.886818),\n (187.97886, 153.886818, 187.97886, 154.246977),\n (187.97886, 154.246977, 187.97886, 154.607136),\n (187.97886, 154.607136, 187.97886, 154.967296),\n (187.97886, 154.967296, 187.97886, 155.327455),\n (187.97886, 143.802364, 191.393259, 143.802364),\n (187.97886, 103.021273, 187.97886, 143.802364),\n (191.393259, 103.021273, 191.393259, 143.802364),\n (187.97886, 155.327455, 187.97886, 158.873637),\n (191.393259, 158.873637, 187.97886, 158.873637),\n (191.393259, 155.327455, 191.393259, 158.873637),\n (187.97886, 96.021024, 187.97886, 96.239782),\n (187.97886, 96.239782, 187.97886, 96.45854),\n (187.97886, 96.45854, 187.97886, 96.677298),\n (187.97886, 96.677298, 187.97886, 96.896055),\n (187.97886, 96.896055, 187.97886, 97.114813),\n (187.97886, 97.114813, 187.97886, 97.333571),\n (187.97886, 97.333571, 187.97886, 97.552329),\n (187.97886, 97.552329, 187.97886, 97.771086),\n (187.97886, 97.771086, 187.97886, 97.989844),\n (187.97886, 97.989844, 187.97886, 98.208602),\n (187.97886, 98.208602, 187.97886, 98.42736),\n (187.97886, 98.42736, 187.97886, 98.646117),\n (187.97886, 98.646117, 187.97886, 98.864875),\n (187.97886, 98.864875, 187.97886, 99.083633),\n (187.97886, 99.083633, 187.97886, 99.302391),\n (187.97886, 99.302391, 187.97886, 99.521148),\n (187.97886, 99.521148, 187.97886, 99.739906),\n (187.97886, 99.739906, 187.97886, 99.958664),\n (187.97886, 99.958664, 187.97886, 100.177422),\n (187.97886, 100.177422, 187.97886, 100.396179),\n (187.97886, 100.396179, 187.97886, 100.614937),\n (187.97886, 100.614937, 187.97886, 100.833695),\n (187.97886, 100.833695, 187.97886, 101.052453),\n (187.97886, 101.052453, 187.97886, 101.271211),\n (187.97886, 101.271211, 187.97886, 101.489968),\n (187.97886, 101.489968, 187.97886, 101.708726),\n (187.97886, 101.708726, 187.97886, 101.927484),\n (187.97886, 101.927484, 187.97886, 102.146242),\n (187.97886, 102.146242, 187.97886, 102.364999),\n (187.97886, 102.364999, 187.97886, 102.583757),\n (187.97886, 102.583757, 187.97886, 102.802515),\n (187.97886, 102.802515, 187.97886, 103.021273),\n (191.393259, 96.021024, 191.393259, 96.239782),\n (191.393259, 96.239782, 191.393259, 96.45854),\n (191.393259, 96.45854, 191.393259, 96.677298),\n (191.393259, 96.677298, 191.393259, 96.896055),\n (191.393259, 96.896055, 191.393259, 97.114813),\n (191.393259, 97.114813, 191.393259, 97.333571),\n (191.393259, 97.333571, 191.393259, 97.552329),\n (191.393259, 97.552329, 191.393259, 97.771086),\n (191.393259, 97.771086, 191.393259, 97.989844),\n (191.393259, 97.989844, 191.393259, 98.208602),\n (191.393259, 98.208602, 191.393259, 98.42736),\n (191.393259, 98.42736, 191.393259, 98.646117),\n (191.393259, 98.646117, 191.393259, 98.864875),\n (191.393259, 98.864875, 191.393259, 99.083633),\n (191.393259, 99.083633, 191.393259, 99.302391),\n (191.393259, 99.302391, 191.393259, 99.521148),\n (191.393259, 99.521148, 191.393259, 99.739906),\n (191.393259, 99.739906, 191.393259, 99.958664),\n (191.393259, 99.958664, 191.393259, 100.177422),\n (191.393259, 100.177422, 191.393259, 100.396179),\n (191.393259, 100.396179, 191.393259, 100.614937),\n (191.393259, 100.614937, 191.393259, 100.833695),\n (191.393259, 100.833695, 191.393259, 101.052453),\n (191.393259, 101.052453, 191.393259, 101.271211),\n (191.393259, 101.271211, 191.393259, 101.489968),\n (191.393259, 101.489968, 191.393259, 101.708726),\n (191.393259, 101.708726, 191.393259, 101.927484),\n (191.393259, 101.927484, 191.393259, 102.146242),\n (191.393259, 102.146242, 191.393259, 102.364999),\n (191.393259, 102.364999, 191.393259, 102.583757),\n (191.393259, 102.583757, 191.393259, 102.802515),\n (191.393259, 102.802515, 191.393259, 103.021273),\n (187.97886, 96.021024, 191.393259, 96.021024),\n (187.97886, 158.913379, 191.393259, 158.913379),\n (187.97886, 103.021273, 191.393259, 103.021273)\n]\nVISIBLE_CIRCLES = [\n (100.606636, 144.688909, 2.659636),\n (100.606636, 103.021273, 2.659636),\n (119.224091, 144.688909, 2.659636),\n (159.118637, 144.688909, 3.546182)\n]\nVISIBLE_ARCS = [\n (100.606636, 144.688909, 10.675421, 94.763642, -175.236358),\n (100.163364, 103.577134, 7.55611, -175.78125, -4.21875),\n (159.311117, 144.245636, 14.667743, -94.21875, 94.21875),\n (123.213545, 117.649273, 14.688322, 84.805571, 174.805571),\n (188.342325, -6655.439155, 6737.496383, 90.122148, 90.256058),\n (-74.713841, 114.971568, 266.339244, 9.487776, 9.496208),\n (429.915474, 145.977062, 238.871685, 176.895589, 176.905108)\n]\nHIDDEN_SEGMENTS = [\n (107.699, 82.021, 107.699, 78.6066),\n (124.5434, 78.6066, 124.5434, 82.021),\n (108.5856, 78.6066, 108.5856, 82.021),\n (103.2663, 82.021, 103.2663, 78.6066),\n (121.8838, 82.021, 121.8838, 78.6066),\n (162.6649, 82.021, 162.6649, 78.6066),\n (97.947, 82.021, 97.947, 78.6066),\n (116.5645, 82.021, 116.5645, 78.6066),\n (155.5725, 82.021, 155.5725, 78.6066),\n (191.3933, 132.2773, 187.9789, 132.2773),\n (191.3933, 118.9791, 187.9789, 118.9791),\n (187.9789, 129.5779, 191.3933, 129.5779),\n (187.9789, 132.3376, 191.3933, 132.3376),\n (187.9789, 142.0293, 191.3933, 142.0293),\n (187.9789, 147.3485, 191.3933, 147.3485),\n (187.9789, 100.3616, 191.3933, 100.3616),\n (187.9789, 105.6809, 191.3933, 105.6809),\n (187.9789, 141.1427, 191.3933, 141.1427),\n (187.9789, 148.2351, 191.3933, 148.2351)\n]\n# (orient, text, p1, p2, base) for linear; (orient, text, center, radius, angle) for diameter\nDIMENSIONS = [\n ('horizontal', '25.7104', (107.6991, 103.0213), (92.6278, 103.0213), (100.1634, 92.0213)),\n ('vertical', '49.9084', (158.2321, 158.8736), (158.2321, 129.6176), (169.2321, 144.2456)),\n ('aligned', '100', (99.7201, 155.3274), (158.2321, 158.8736), (128.3107, 168.0804)),\n ('aligned', '57.6491', (158.2321, 129.6176), (124.5434, 132.2773), (140.522, 119.9816)),\n ('aligned', '27.2648', (108.5856, 118.9791), (107.6991, 103.0213), (119.1254, 110.39)),\n ('aligned', '69.7171', (92.6278, 103.0213), (89.9681, 143.8023), (80.3213, 122.6959)),\n ('diameter', '%%c9.0743', (100.6066, 144.6889), 2.6596, 45),\n ('horizontal', '18.1485', (89.9681, 144.6889), (100.6066, 144.6889), (95.2874, 155.6889)),\n ('vertical', '24.198', (100.6066, 158.8736), (100.6066, 144.6889), (111.6066, 151.7813)),\n ('diameter', '%%c9.0743', (100.6066, 103.0213), 2.6596, 45),\n ('horizontal', '18.1485', (89.9681, 103.0213), (100.6066, 103.0213), (95.2874, 114.0213)),\n ('vertical', '95.2797', (100.6066, 158.8736), (100.6066, 103.0213), (111.6066, 130.9474)),\n ('diameter', '%%c9.0743', (119.2241, 144.6889), 2.6596, 45),\n ('horizontal', '49.9084', (89.9681, 144.6889), (119.2241, 144.6889), (104.5961, 155.6889)),\n ('vertical', '24.198', (119.2241, 158.8736), (119.2241, 144.6889), (130.2241, 151.7813)),\n ('diameter', '%%c12.099', (159.1187, 144.6889), 3.5462, 45),\n ('horizontal', '117.965', (89.9681, 144.6889), (159.1187, 144.6889), (124.5434, 155.6889)),\n ('vertical', '24.198', (159.1187, 158.8736), (159.1187, 144.6889), (170.1187, 151.7813)),\n ('radius', 'R18.2114', (100.6066, 144.6889), 10.6754, 135),\n ('radius', 'R25.022', (159.3111, 144.2456), 14.6677, 135),\n ('radius', 'R25.0571', (123.2136, 117.6493), 14.6883, 45),\n ('radius', 'R12.8901', (100.1634, 103.5772), 7.5561, 135),\n ('horizontal', '5.8247', (191.3933, 143.8023), (187.9789, 143.8023), (189.6861, 132.8023))\n]\n\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; _ds.dxf.dimasz = 2.5\n _ds.dxf.dimexe = 1.25; _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\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\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,\n angle=(0 if d[0] == \"horizontal\" else 90),\n 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,\n 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,\n 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,\n text=text, dimstyle=\"EZDXF\").render()\n\n doc.saveas(out_path)\n\n\nif __name__ == \"__main__\":\n out = sys.argv[1] if len(sys.argv) > 1 else \"0036_00366766_gt.dxf\"\n draw(out)\n print(\"wrote\", out)\n```"}], "images": ["images/0036_00366766.png"], "id": "0036_00366766"} {"messages": [{"role": "user", "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 mm wide and 100 mm tall, featuring 2 circular holes, each of diameter 26.32 mm. It is extruded to a thickness of 24.74 mm."}, {"role": "assistant", "content": "```python\n#!/usr/bin/env python3\n# -*- coding: utf-8 -*-\n# Ground-truth 2D engineering drawing for part: 0039_00391485\n# Self-contained: reproduces the three-view DXF via ezdxf, NO FreeCAD needed.\n# Coordinates are A4 page millimetres (scale=0.5499612518631125, page=[297.0, 210.0]).\n# visible edges -> solid (layer OUTLINE); hidden edges -> dashed (layer HIDDEN)\n# dimensions -> real movable DIMENSION entities (text = true mm value)\n# Run: python 0039_00391485_gt.py [out.dxf]\nimport sys\nimport ezdxf\nimport math\n\nSCALE = 0.5499612518631125\nPAGE = [297.0, 210.0]\n\nVISIBLE_SEGMENTS = [\n (143.446131, 110.179387, 143.446131, 165.175513),\n (115.948069, 165.175513, 115.948069, 110.179387),\n (115.948069, 82.430356, 116.807383, 82.430356),\n (116.807383, 82.430356, 117.666698, 82.430356),\n (117.666698, 82.430356, 118.526012, 82.430356),\n (118.526012, 82.430356, 119.385327, 82.430356),\n (119.385327, 82.430356, 120.244641, 82.430356),\n (120.244641, 82.430356, 121.103955, 82.430356),\n (121.103955, 82.430356, 121.96327, 82.430356),\n (121.96327, 82.430356, 122.822584, 82.430356),\n (122.822584, 82.430356, 123.681899, 82.430356),\n (123.681899, 82.430356, 124.541213, 82.430356),\n (124.541213, 82.430356, 125.400528, 82.430356),\n (125.400528, 82.430356, 126.259842, 82.430356),\n (126.259842, 82.430356, 127.119157, 82.430356),\n (127.119157, 82.430356, 127.978471, 82.430356),\n (127.978471, 82.430356, 128.837786, 82.430356),\n (128.837786, 82.430356, 129.6971, 82.430356),\n (129.6971, 82.430356, 130.556414, 82.430356),\n (130.556414, 82.430356, 131.415729, 82.430356),\n (131.415729, 82.430356, 132.275043, 82.430356),\n (132.275043, 82.430356, 133.134358, 82.430356),\n (133.134358, 82.430356, 133.993672, 82.430356),\n (133.993672, 82.430356, 134.852987, 82.430356),\n (134.852987, 82.430356, 135.712301, 82.430356),\n (135.712301, 82.430356, 136.571616, 82.430356),\n (136.571616, 82.430356, 137.43093, 82.430356),\n (137.43093, 82.430356, 138.290245, 82.430356),\n (138.290245, 82.430356, 139.149559, 82.430356),\n (139.149559, 82.430356, 140.008873, 82.430356),\n (140.008873, 82.430356, 140.868188, 82.430356),\n (140.868188, 82.430356, 141.727502, 82.430356),\n (141.727502, 82.430356, 142.586817, 82.430356),\n (142.586817, 82.430356, 143.446131, 82.430356),\n (143.446131, 82.430356, 143.446131, 68.824544),\n (115.948069, 68.824544, 116.807383, 68.824544),\n (116.807383, 68.824544, 117.666698, 68.824544),\n (117.666698, 68.824544, 118.526012, 68.824544),\n (118.526012, 68.824544, 119.385327, 68.824544),\n (119.385327, 68.824544, 120.244641, 68.824544),\n (120.244641, 68.824544, 121.103955, 68.824544),\n (121.103955, 68.824544, 121.96327, 68.824544),\n (121.96327, 68.824544, 122.822584, 68.824544),\n (122.822584, 68.824544, 123.681899, 68.824544),\n (123.681899, 68.824544, 124.541213, 68.824544),\n (124.541213, 68.824544, 125.400528, 68.824544),\n (125.400528, 68.824544, 126.259842, 68.824544),\n (126.259842, 68.824544, 127.119157, 68.824544),\n (127.119157, 68.824544, 127.978471, 68.824544),\n (127.978471, 68.824544, 128.837786, 68.824544),\n (128.837786, 68.824544, 129.6971, 68.824544),\n (129.6971, 68.824544, 130.556414, 68.824544),\n (130.556414, 68.824544, 131.415729, 68.824544),\n (131.415729, 68.824544, 132.275043, 68.824544),\n (132.275043, 68.824544, 133.134358, 68.824544),\n (133.134358, 68.824544, 133.993672, 68.824544),\n (133.993672, 68.824544, 134.852987, 68.824544),\n (134.852987, 68.824544, 135.712301, 68.824544),\n (135.712301, 68.824544, 136.571616, 68.824544),\n (136.571616, 68.824544, 137.43093, 68.824544),\n (137.43093, 68.824544, 138.290245, 68.824544),\n (138.290245, 68.824544, 139.149559, 68.824544),\n (139.149559, 68.824544, 140.008873, 68.824544),\n (140.008873, 68.824544, 140.868188, 68.824544),\n (140.868188, 68.824544, 141.727502, 68.824544),\n (141.727502, 68.824544, 142.586817, 68.824544),\n (142.586817, 68.824544, 143.446131, 68.824544),\n (115.948069, 82.430356, 115.948069, 68.824544),\n (171.051944, 110.179387, 171.051944, 109.74973),\n (171.051944, 109.74973, 171.051944, 109.320073),\n (171.051944, 109.320073, 171.051944, 108.890416),\n (171.051944, 108.890416, 171.051944, 108.460758),\n (171.051944, 108.460758, 171.051944, 108.031101),\n (171.051944, 108.031101, 171.051944, 107.601444),\n (171.051944, 107.601444, 171.051944, 107.171787),\n (171.051944, 107.171787, 171.051944, 106.74213),\n (171.051944, 106.74213, 171.051944, 106.312472),\n (171.051944, 106.312472, 171.051944, 105.882815),\n (171.051944, 105.882815, 171.051944, 105.453158),\n (171.051944, 105.453158, 171.051944, 105.023501),\n (171.051944, 105.023501, 171.051944, 104.593843),\n (171.051944, 104.593843, 171.051944, 104.164186),\n (171.051944, 104.164186, 171.051944, 103.734529),\n (171.051944, 103.734529, 171.051944, 103.304872),\n (171.051944, 103.304872, 171.051944, 102.875215),\n (171.051944, 102.875215, 171.051944, 102.445557),\n (171.051944, 102.445557, 171.051944, 102.0159),\n (171.051944, 102.0159, 171.051944, 101.586243),\n (171.051944, 101.586243, 171.051944, 101.156586),\n (171.051944, 101.156586, 171.051944, 100.726928),\n (171.051944, 100.726928, 171.051944, 100.297271),\n (171.051944, 100.297271, 171.051944, 99.867614),\n (171.051944, 99.867614, 171.051944, 99.437957),\n (171.051944, 99.437957, 171.051944, 99.008299),\n (171.051944, 99.008299, 171.051944, 98.578642),\n (171.051944, 98.578642, 171.051944, 98.148985),\n (171.051944, 98.148985, 171.051944, 97.719328),\n (171.051944, 97.719328, 171.051944, 97.289671),\n (171.051944, 97.289671, 171.051944, 96.860013),\n (171.051944, 96.860013, 171.051944, 96.430356),\n (157.446131, 110.179387, 157.446131, 109.74973),\n (157.446131, 109.74973, 157.446131, 109.320073),\n (157.446131, 109.320073, 157.446131, 108.890416),\n (157.446131, 108.890416, 157.446131, 108.460758),\n (157.446131, 108.460758, 157.446131, 108.031101),\n (157.446131, 108.031101, 157.446131, 107.601444),\n (157.446131, 107.601444, 157.446131, 107.171787),\n (157.446131, 107.171787, 157.446131, 106.74213),\n (157.446131, 106.74213, 157.446131, 106.312472),\n (157.446131, 106.312472, 157.446131, 105.882815),\n (157.446131, 105.882815, 157.446131, 105.453158),\n (157.446131, 105.453158, 157.446131, 105.023501),\n (157.446131, 105.023501, 157.446131, 104.593843),\n (157.446131, 104.593843, 157.446131, 104.164186),\n (157.446131, 104.164186, 157.446131, 103.734529),\n (157.446131, 103.734529, 157.446131, 103.304872),\n (157.446131, 103.304872, 157.446131, 102.875215),\n (157.446131, 102.875215, 157.446131, 102.445557),\n (157.446131, 102.445557, 157.446131, 102.0159),\n (157.446131, 102.0159, 157.446131, 101.586243),\n (157.446131, 101.586243, 157.446131, 101.156586),\n (157.446131, 101.156586, 157.446131, 100.726928),\n (157.446131, 100.726928, 157.446131, 100.297271),\n (157.446131, 100.297271, 157.446131, 99.867614),\n (157.446131, 99.867614, 157.446131, 99.437957),\n (157.446131, 99.437957, 157.446131, 99.008299),\n (157.446131, 99.008299, 157.446131, 98.578642),\n (157.446131, 98.578642, 157.446131, 98.148985),\n (157.446131, 98.148985, 157.446131, 97.719328),\n (157.446131, 97.719328, 157.446131, 97.289671),\n (157.446131, 97.289671, 157.446131, 96.860013),\n (157.446131, 96.860013, 157.446131, 96.430356),\n (171.051944, 178.924544, 171.051944, 178.494887),\n (171.051944, 178.494887, 171.051944, 178.065229),\n (171.051944, 178.065229, 171.051944, 177.635572),\n (171.051944, 177.635572, 171.051944, 177.205915),\n (171.051944, 177.205915, 171.051944, 176.776258),\n (171.051944, 176.776258, 171.051944, 176.346601),\n (171.051944, 176.346601, 171.051944, 175.916943),\n (171.051944, 175.916943, 171.051944, 175.487286),\n (171.051944, 175.487286, 171.051944, 175.057629),\n (171.051944, 175.057629, 171.051944, 174.627972),\n (171.051944, 174.627972, 171.051944, 174.198314),\n (171.051944, 174.198314, 171.051944, 173.768657),\n (171.051944, 173.768657, 171.051944, 173.339),\n (171.051944, 173.339, 171.051944, 172.909343),\n (171.051944, 172.909343, 171.051944, 172.479685),\n (171.051944, 172.479685, 171.051944, 172.050028),\n (171.051944, 172.050028, 171.051944, 171.620371),\n (171.051944, 171.620371, 171.051944, 171.190714),\n (171.051944, 171.190714, 171.051944, 170.761057),\n (171.051944, 170.761057, 171.051944, 170.331399),\n (171.051944, 170.331399, 171.051944, 169.901742),\n (171.051944, 169.901742, 171.051944, 169.472085),\n (171.051944, 169.472085, 171.051944, 169.042428),\n (171.051944, 169.042428, 171.051944, 168.61277),\n (171.051944, 168.61277, 171.051944, 168.183113),\n (171.051944, 168.183113, 171.051944, 167.753456),\n (171.051944, 167.753456, 171.051944, 167.323799),\n (171.051944, 167.323799, 171.051944, 166.894142),\n (171.051944, 166.894142, 171.051944, 166.464484),\n (171.051944, 166.464484, 171.051944, 166.034827),\n (171.051944, 166.034827, 171.051944, 165.60517),\n (171.051944, 165.60517, 171.051944, 165.175513),\n (157.446131, 178.924544, 157.446131, 178.494887),\n (157.446131, 178.494887, 157.446131, 178.065229),\n (157.446131, 178.065229, 157.446131, 177.635572),\n (157.446131, 177.635572, 157.446131, 177.205915),\n (157.446131, 177.205915, 157.446131, 176.776258),\n (157.446131, 176.776258, 157.446131, 176.346601),\n (157.446131, 176.346601, 157.446131, 175.916943),\n (157.446131, 175.916943, 157.446131, 175.487286),\n (157.446131, 175.487286, 157.446131, 175.057629),\n (157.446131, 175.057629, 157.446131, 174.627972),\n (157.446131, 174.627972, 157.446131, 174.198314),\n (157.446131, 174.198314, 157.446131, 173.768657),\n (157.446131, 173.768657, 157.446131, 173.339),\n (157.446131, 173.339, 157.446131, 172.909343),\n (157.446131, 172.909343, 157.446131, 172.479685),\n (157.446131, 172.479685, 157.446131, 172.050028),\n (157.446131, 172.050028, 157.446131, 171.620371),\n (157.446131, 171.620371, 157.446131, 171.190714),\n (157.446131, 171.190714, 157.446131, 170.761057),\n (157.446131, 170.761057, 157.446131, 170.331399),\n (157.446131, 170.331399, 157.446131, 169.901742),\n (157.446131, 169.901742, 157.446131, 169.472085),\n (157.446131, 169.472085, 157.446131, 169.042428),\n (157.446131, 169.042428, 157.446131, 168.61277),\n (157.446131, 168.61277, 157.446131, 168.183113),\n (157.446131, 168.183113, 157.446131, 167.753456),\n (157.446131, 167.753456, 157.446131, 167.323799),\n (157.446131, 167.323799, 157.446131, 166.894142),\n (157.446131, 166.894142, 157.446131, 166.464484),\n (157.446131, 166.464484, 157.446131, 166.034827),\n (157.446131, 166.034827, 157.446131, 165.60517),\n (157.446131, 165.60517, 157.446131, 165.175513),\n (157.446131, 165.175513, 157.446131, 110.179387),\n (171.051944, 165.175513, 171.051944, 110.179387),\n (157.446131, 96.430356, 171.051944, 96.430356),\n (157.446131, 178.924544, 171.051944, 178.924544),\n (171.051944, 110.179387, 157.446131, 110.179387),\n (171.051944, 165.175513, 157.446131, 165.175513)\n]\nVISIBLE_CIRCLES = [\n (129.6971, 110.179387, 7.236332),\n (129.6971, 165.175513, 7.236332)\n]\nVISIBLE_ARCS = [\n (129.6971, 110.179387, 13.749031, 180.0, 0.0),\n (129.6971, 165.175513, 13.749031, 0.0, 180.0)\n]\nHIDDEN_SEGMENTS = [\n (136.9334, 68.8245, 136.9334, 82.4303),\n (122.4608, 82.4303, 122.4608, 68.8245),\n (157.4461, 157.9392, 171.0519, 157.9392),\n (157.4461, 172.4118, 171.0519, 172.4118),\n (157.4461, 102.943, 171.0519, 102.943),\n (157.4461, 117.4157, 171.0519, 117.4157)\n]\n# (orient, text, p1, p2, base) for linear; (orient, text, center, radius, angle) for diameter\nDIMENSIONS = [\n ('horizontal', '50', (115.9481, 165.1755), (143.4461, 165.1755), (129.6971, 176.1755)),\n ('vertical', '100', (143.4461, 165.1755), (143.4461, 110.1794), (154.4461, 137.6774)),\n ('diameter', '%%c26.3158', (129.6971, 165.1755), 7.2363, 45),\n ('horizontal', '25', (115.9481, 165.1755), (129.6971, 165.1755), (122.8226, 176.1755)),\n ('diameter', '%%c26.3158', (129.6971, 110.1794), 7.2363, 45),\n ('horizontal', '25', (115.9481, 110.1794), (129.6971, 110.1794), (122.8226, 121.1794)),\n ('vertical', '100', (129.6971, 165.1755), (129.6971, 110.1794), (140.6971, 137.6774)),\n ('radius', 'R25', (129.6971, 165.1755), 13.749, 135),\n ('horizontal', '24.7396', (171.0519, 165.1755), (157.4461, 165.1755), (164.249, 154.1755))\n]\n\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; _ds.dxf.dimasz = 2.5\n _ds.dxf.dimexe = 1.25; _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\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\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,\n angle=(0 if d[0] == \"horizontal\" else 90),\n 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,\n 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,\n 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,\n text=text, dimstyle=\"EZDXF\").render()\n\n doc.saveas(out_path)\n\n\nif __name__ == \"__main__\":\n out = sys.argv[1] if len(sys.argv) > 1 else \"0039_00391485_gt.dxf\"\n draw(out)\n print(\"wrote\", out)\n```"}], "images": ["images/0039_00391485.png"], "id": "0039_00391485"} {"messages": [{"role": "user", "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.95 mm tall, featuring a rectangular cutout 86.81 x 48.35 mm. It is extruded to a thickness of 668.13 mm."}, {"role": "assistant", "content": "```python\n#!/usr/bin/env python3\n# -*- coding: utf-8 -*-\n# Ground-truth 2D engineering drawing for part: 0040_00409226\n# Self-contained: reproduces the three-view DXF via ezdxf, NO FreeCAD needed.\n# Coordinates are A4 page millimetres (scale=0.12430845771145371, page=[297.0, 210.0]).\n# visible edges -> solid (layer OUTLINE); hidden edges -> dashed (layer HIDDEN)\n# dimensions -> real movable DIMENSION entities (text = true mm value)\n# Run: python 0040_00409226_gt.py [out.dxf]\nimport sys\nimport ezdxf\nimport math\n\nSCALE = 0.12430845771145371\nPAGE = [297.0, 210.0]\n\nVISIBLE_SEGMENTS = [\n (101.188202, 173.603856, 101.188202, 166.773721),\n (88.757356, 166.773721, 88.757356, 173.603856),\n (88.757356, 173.603856, 101.188202, 173.603856),\n (89.576972, 166.773721, 89.576972, 172.78424),\n (100.368586, 172.78424, 100.368586, 166.773721),\n (89.576972, 172.78424, 100.368586, 172.78424),\n (101.188202, 63.503856, 101.188202, 146.558298),\n (88.757356, 63.503856, 88.757356, 146.558298),\n (88.757356, 146.558298, 101.188202, 146.558298),\n (88.757356, 63.503856, 101.188202, 63.503856),\n (198.242644, 160.558298, 198.242644, 166.773721),\n (115.188202, 160.558298, 115.188202, 166.773721),\n (115.188202, 166.773721, 115.188202, 173.603856),\n (198.242644, 173.603856, 115.188202, 173.603856),\n (198.242644, 166.773721, 198.242644, 173.603856),\n (115.188202, 160.558298, 198.242644, 160.558298),\n (198.242644, 166.773721, 115.188202, 166.773721)\n]\nVISIBLE_CIRCLES = [\n\n]\nVISIBLE_ARCS = [\n (94.972779, 166.773721, 6.215423, -180.0, 0.0),\n (94.972779, 166.773721, 5.395807, -180.0, -0.0)\n]\nHIDDEN_SEGMENTS = [\n (89.577, 63.5039, 89.577, 146.5583),\n (100.3686, 63.5039, 100.3686, 146.5583),\n (198.2426, 172.7842, 115.1882, 172.7842),\n (115.1882, 161.3779, 198.2426, 161.3779)\n]\n# (orient, text, p1, p2, base) for linear; (orient, text, center, radius, angle) for diameter\nDIMENSIONS = [\n ('horizontal', '100', (101.1882, 166.7737), (88.7574, 166.7737), (94.9728, 155.7737)),\n ('vertical', '54.9451', (101.1882, 173.6039), (101.1882, 166.7737), (112.1882, 170.1888)),\n ('horizontal', '86.8132', (89.577, 172.7842), (100.3686, 172.7842), (94.9728, 183.7842)),\n ('vertical', '48.3516', (89.577, 172.7842), (89.577, 166.7737), (100.577, 169.779)),\n ('horizontal', '6.5934', (88.7574, 172.7842), (89.577, 172.7842), (89.1672, 183.7842)),\n ('vertical', '6.5934', (89.577, 173.6039), (89.577, 172.7842), (100.577, 173.194)),\n ('radius', 'R50', (94.9728, 166.7737), 6.2154, 45),\n ('radius', 'R43.4066', (94.9728, 166.7737), 5.3958, 135),\n ('horizontal', '668.132', (198.2426, 173.6039), (115.1882, 173.6039), (156.7154, 162.6039))\n]\n\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; _ds.dxf.dimasz = 2.5\n _ds.dxf.dimexe = 1.25; _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\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\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,\n angle=(0 if d[0] == \"horizontal\" else 90),\n 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,\n 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,\n 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,\n text=text, dimstyle=\"EZDXF\").render()\n\n doc.saveas(out_path)\n\n\nif __name__ == \"__main__\":\n out = sys.argv[1] if len(sys.argv) > 1 else \"0040_00409226_gt.dxf\"\n draw(out)\n print(\"wrote\", out)\n```"}], "images": ["images/0040_00409226.png"], "id": "0040_00409226"} {"messages": [{"role": "user", "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 22.09 mm tall, featuring 2 circular holes, each of diameter 11.63 mm. It is extruded to a thickness of 10.73 mm."}, {"role": "assistant", "content": "```python\n#!/usr/bin/env python3\n# -*- coding: utf-8 -*-\n# Ground-truth 2D engineering drawing for part: 0041_00411453\n# Self-contained: reproduces the three-view DXF via ezdxf, NO FreeCAD needed.\n# Coordinates are A4 page millimetres (scale=1.1062766383191738, page=[297.0, 210.0]).\n# visible edges -> solid (layer OUTLINE); hidden edges -> dashed (layer HIDDEN)\n# dimensions -> real movable DIMENSION entities (text = true mm value)\n# Run: python 0041_00411453_gt.py [out.dxf]\nimport sys\nimport ezdxf\nimport math\n\nSCALE = 1.1062766383191738\nPAGE = [297.0, 210.0]\n\nVISIBLE_SEGMENTS = [\n (181.375882, 117.715186, 70.748218, 117.715186),\n (70.748218, 142.156182, 181.375882, 142.156182),\n (193.59638, 103.715186, 193.214489, 103.715186),\n (193.214489, 103.715186, 192.832599, 103.715186),\n (192.832599, 103.715186, 192.450708, 103.715186),\n (192.450708, 103.715186, 192.068817, 103.715186),\n (192.068817, 103.715186, 191.686927, 103.715186),\n (191.686927, 103.715186, 191.305036, 103.715186),\n (191.305036, 103.715186, 190.923146, 103.715186),\n (190.923146, 103.715186, 190.541255, 103.715186),\n (190.541255, 103.715186, 190.159365, 103.715186),\n (190.159365, 103.715186, 189.777474, 103.715186),\n (189.777474, 103.715186, 189.395584, 103.715186),\n (189.395584, 103.715186, 189.013693, 103.715186),\n (189.013693, 103.715186, 188.631802, 103.715186),\n (188.631802, 103.715186, 188.249912, 103.715186),\n (188.249912, 103.715186, 187.868021, 103.715186),\n (187.868021, 103.715186, 187.486131, 103.715186),\n (187.486131, 103.715186, 187.10424, 103.715186),\n (187.10424, 103.715186, 186.72235, 103.715186),\n (186.72235, 103.715186, 186.340459, 103.715186),\n (186.340459, 103.715186, 185.958569, 103.715186),\n (185.958569, 103.715186, 185.576678, 103.715186),\n (185.576678, 103.715186, 185.194787, 103.715186),\n (185.194787, 103.715186, 184.812897, 103.715186),\n (184.812897, 103.715186, 184.431006, 103.715186),\n (184.431006, 103.715186, 184.049116, 103.715186),\n (184.049116, 103.715186, 183.667225, 103.715186),\n (183.667225, 103.715186, 183.285335, 103.715186),\n (183.285335, 103.715186, 182.903444, 103.715186),\n (182.903444, 103.715186, 182.521554, 103.715186),\n (182.521554, 103.715186, 182.139663, 103.715186),\n (182.139663, 103.715186, 181.757772, 103.715186),\n (181.757772, 103.715186, 181.375882, 103.715186),\n (193.59638, 91.843845, 193.214489, 91.843845),\n (193.214489, 91.843845, 192.832599, 91.843845),\n (192.832599, 91.843845, 192.450708, 91.843845),\n (192.450708, 91.843845, 192.068817, 91.843845),\n (192.068817, 91.843845, 191.686927, 91.843845),\n (191.686927, 91.843845, 191.305036, 91.843845),\n (191.305036, 91.843845, 190.923146, 91.843845),\n (190.923146, 91.843845, 190.541255, 91.843845),\n (190.541255, 91.843845, 190.159365, 91.843845),\n (190.159365, 91.843845, 189.777474, 91.843845),\n (189.777474, 91.843845, 189.395584, 91.843845),\n (189.395584, 91.843845, 189.013693, 91.843845),\n (189.013693, 91.843845, 188.631802, 91.843845),\n (188.631802, 91.843845, 188.249912, 91.843845),\n (188.249912, 91.843845, 187.868021, 91.843845),\n (187.868021, 91.843845, 187.486131, 91.843845),\n (187.486131, 91.843845, 187.10424, 91.843845),\n (187.10424, 91.843845, 186.72235, 91.843845),\n (186.72235, 91.843845, 186.340459, 91.843845),\n (186.340459, 91.843845, 185.958569, 91.843845),\n (185.958569, 91.843845, 185.576678, 91.843845),\n (185.576678, 91.843845, 185.194787, 91.843845),\n (185.194787, 91.843845, 184.812897, 91.843845),\n (184.812897, 91.843845, 184.431006, 91.843845),\n (184.431006, 91.843845, 184.049116, 91.843845),\n (184.049116, 91.843845, 183.667225, 91.843845),\n (183.667225, 91.843845, 183.285335, 91.843845),\n (183.285335, 91.843845, 182.903444, 91.843845),\n (182.903444, 91.843845, 182.521554, 91.843845),\n (182.521554, 91.843845, 182.139663, 91.843845),\n (182.139663, 91.843845, 181.757772, 91.843845),\n (181.757772, 91.843845, 181.375882, 91.843845),\n (70.748218, 91.843845, 181.375882, 91.843845),\n (181.375882, 103.715186, 70.748218, 103.715186),\n (70.748218, 103.715186, 70.366328, 103.715186),\n (70.366328, 103.715186, 69.984437, 103.715186),\n (69.984437, 103.715186, 69.602546, 103.715186),\n (69.602546, 103.715186, 69.220656, 103.715186),\n (69.220656, 103.715186, 68.838765, 103.715186),\n (68.838765, 103.715186, 68.456875, 103.715186),\n (68.456875, 103.715186, 68.074984, 103.715186),\n (68.074984, 103.715186, 67.693094, 103.715186),\n (67.693094, 103.715186, 67.311203, 103.715186),\n (67.311203, 103.715186, 66.929313, 103.715186),\n (66.929313, 103.715186, 66.547422, 103.715186),\n (66.547422, 103.715186, 66.165531, 103.715186),\n (66.165531, 103.715186, 65.783641, 103.715186),\n (65.783641, 103.715186, 65.40175, 103.715186),\n (65.40175, 103.715186, 65.01986, 103.715186),\n (65.01986, 103.715186, 64.637969, 103.715186),\n (64.637969, 103.715186, 64.256079, 103.715186),\n (64.256079, 103.715186, 63.874188, 103.715186),\n (63.874188, 103.715186, 63.492298, 103.715186),\n (63.492298, 103.715186, 63.110407, 103.715186),\n (63.110407, 103.715186, 62.728516, 103.715186),\n (62.728516, 103.715186, 62.346626, 103.715186),\n (62.346626, 103.715186, 61.964735, 103.715186),\n (61.964735, 103.715186, 61.582845, 103.715186),\n (61.582845, 103.715186, 61.200954, 103.715186),\n (61.200954, 103.715186, 60.819064, 103.715186),\n (60.819064, 103.715186, 60.437173, 103.715186),\n (60.437173, 103.715186, 60.055283, 103.715186),\n (60.055283, 103.715186, 59.673392, 103.715186),\n (59.673392, 103.715186, 59.291501, 103.715186),\n (59.291501, 103.715186, 58.909611, 103.715186),\n (58.909611, 103.715186, 58.52772, 103.715186),\n (70.748218, 91.843845, 70.366328, 91.843845),\n (70.366328, 91.843845, 69.984437, 91.843845),\n (69.984437, 91.843845, 69.602546, 91.843845),\n (69.602546, 91.843845, 69.220656, 91.843845),\n (69.220656, 91.843845, 68.838765, 91.843845),\n (68.838765, 91.843845, 68.456875, 91.843845),\n (68.456875, 91.843845, 68.074984, 91.843845),\n (68.074984, 91.843845, 67.693094, 91.843845),\n (67.693094, 91.843845, 67.311203, 91.843845),\n (67.311203, 91.843845, 66.929313, 91.843845),\n (66.929313, 91.843845, 66.547422, 91.843845),\n (66.547422, 91.843845, 66.165531, 91.843845),\n (66.165531, 91.843845, 65.783641, 91.843845),\n (65.783641, 91.843845, 65.40175, 91.843845),\n (65.40175, 91.843845, 65.01986, 91.843845),\n (65.01986, 91.843845, 64.637969, 91.843845),\n (64.637969, 91.843845, 64.256079, 91.843845),\n (64.256079, 91.843845, 63.874188, 91.843845),\n (63.874188, 91.843845, 63.492298, 91.843845),\n (63.492298, 91.843845, 63.110407, 91.843845),\n (63.110407, 91.843845, 62.728516, 91.843845),\n (62.728516, 91.843845, 62.346626, 91.843845),\n (62.346626, 91.843845, 61.964735, 91.843845),\n (61.964735, 91.843845, 61.582845, 91.843845),\n (61.582845, 91.843845, 61.200954, 91.843845),\n (61.200954, 91.843845, 60.819064, 91.843845),\n (60.819064, 91.843845, 60.437173, 91.843845),\n (60.437173, 91.843845, 60.055283, 91.843845),\n (60.055283, 91.843845, 59.673392, 91.843845),\n (59.673392, 91.843845, 59.291501, 91.843845),\n (59.291501, 91.843845, 58.909611, 91.843845),\n (58.909611, 91.843845, 58.52772, 91.843845),\n (193.59638, 91.843845, 193.59638, 103.715186),\n (58.52772, 91.843845, 58.52772, 103.715186),\n (181.375882, 103.715186, 181.375882, 91.843845),\n (70.748218, 103.715186, 70.748218, 91.843845),\n (207.59638, 117.715186, 219.467721, 117.715186),\n (207.59638, 142.156182, 219.467721, 142.156182),\n (207.59638, 142.156182, 207.59638, 141.392401),\n (207.59638, 141.392401, 207.59638, 140.62862),\n (207.59638, 140.62862, 207.59638, 139.864839),\n (207.59638, 139.864839, 207.59638, 139.101057),\n (207.59638, 139.101057, 207.59638, 138.337276),\n (207.59638, 138.337276, 207.59638, 137.573495),\n (207.59638, 137.573495, 207.59638, 136.809714),\n (207.59638, 136.809714, 207.59638, 136.045933),\n (207.59638, 136.045933, 207.59638, 135.282152),\n (207.59638, 135.282152, 207.59638, 134.518371),\n (207.59638, 134.518371, 207.59638, 133.75459),\n (207.59638, 133.75459, 207.59638, 132.990809),\n (207.59638, 132.990809, 207.59638, 132.227027),\n (207.59638, 132.227027, 207.59638, 131.463246),\n (207.59638, 131.463246, 207.59638, 130.699465),\n (207.59638, 130.699465, 207.59638, 129.935684),\n (207.59638, 129.935684, 207.59638, 129.171903),\n (207.59638, 129.171903, 207.59638, 128.408122),\n (207.59638, 128.408122, 207.59638, 127.644341),\n (207.59638, 127.644341, 207.59638, 126.88056),\n (207.59638, 126.88056, 207.59638, 126.116779),\n (207.59638, 126.116779, 207.59638, 125.352997),\n (207.59638, 125.352997, 207.59638, 124.589216),\n (207.59638, 124.589216, 207.59638, 123.825435),\n (207.59638, 123.825435, 207.59638, 123.061654),\n (207.59638, 123.061654, 207.59638, 122.297873),\n (207.59638, 122.297873, 207.59638, 121.534092),\n (207.59638, 121.534092, 207.59638, 120.770311),\n (207.59638, 120.770311, 207.59638, 120.00653),\n (207.59638, 120.00653, 207.59638, 119.242749),\n (207.59638, 119.242749, 207.59638, 118.478967),\n (207.59638, 118.478967, 207.59638, 117.715186),\n (219.467721, 142.156182, 219.467721, 141.392401),\n (219.467721, 141.392401, 219.467721, 140.62862),\n (219.467721, 140.62862, 219.467721, 139.864839),\n (219.467721, 139.864839, 219.467721, 139.101057),\n (219.467721, 139.101057, 219.467721, 138.337276),\n (219.467721, 138.337276, 219.467721, 137.573495),\n (219.467721, 137.573495, 219.467721, 136.809714),\n (219.467721, 136.809714, 219.467721, 136.045933),\n (219.467721, 136.045933, 219.467721, 135.282152),\n (219.467721, 135.282152, 219.467721, 134.518371),\n (219.467721, 134.518371, 219.467721, 133.75459),\n (219.467721, 133.75459, 219.467721, 132.990809),\n (219.467721, 132.990809, 219.467721, 132.227027),\n (219.467721, 132.227027, 219.467721, 131.463246),\n (219.467721, 131.463246, 219.467721, 130.699465),\n (219.467721, 130.699465, 219.467721, 129.935684),\n (219.467721, 129.935684, 219.467721, 129.171903),\n (219.467721, 129.171903, 219.467721, 128.408122),\n (219.467721, 128.408122, 219.467721, 127.644341),\n (219.467721, 127.644341, 219.467721, 126.88056),\n (219.467721, 126.88056, 219.467721, 126.116779),\n (219.467721, 126.116779, 219.467721, 125.352997),\n (219.467721, 125.352997, 219.467721, 124.589216),\n (219.467721, 124.589216, 219.467721, 123.825435),\n (219.467721, 123.825435, 219.467721, 123.061654),\n (219.467721, 123.061654, 219.467721, 122.297873),\n (219.467721, 122.297873, 219.467721, 121.534092),\n (219.467721, 121.534092, 219.467721, 120.770311),\n (219.467721, 120.770311, 219.467721, 120.00653),\n (219.467721, 120.00653, 219.467721, 119.242749),\n (219.467721, 119.242749, 219.467721, 118.478967),\n (219.467721, 118.478967, 219.467721, 117.715186)\n]\nVISIBLE_CIRCLES = [\n (70.748218, 129.2925, 6.431841),\n (181.375882, 129.2925, 6.431841)\n]\nVISIBLE_ARCS = [\n (181.375882, 129.935684, 12.220498, -90.0, 90.0),\n (70.748218, 129.935684, 12.220498, 90.0, -90.0)\n]\nHIDDEN_SEGMENTS = [\n (77.18, 103.7152, 77.18, 91.8438),\n (187.8077, 103.7152, 187.8077, 91.8438),\n (64.3164, 91.8438, 64.3164, 103.7152),\n (174.944, 91.8438, 174.944, 103.7152),\n (219.4677, 135.7243, 207.5964, 135.7243),\n (219.4677, 122.8606, 207.5964, 122.8606)\n]\n# (orient, text, p1, p2, base) for linear; (orient, text, center, radius, angle) for diameter\nDIMENSIONS = [\n ('horizontal', '100', (181.3759, 142.1561), (70.7482, 142.1561), (126.0621, 131.1561)),\n ('vertical', '22.093', (181.3759, 117.7152), (181.3759, 142.1561), (170.3759, 129.9357)),\n ('diameter', '%%c11.6279', (70.7482, 129.2925), 6.4318, 45),\n ('vertical', '10.4651', (70.7482, 117.7152), (70.7482, 129.2925), (59.7482, 123.5038)),\n ('diameter', '%%c11.6279', (181.3759, 129.2925), 6.4318, 45),\n ('horizontal', '100', (70.7482, 129.2925), (181.3759, 129.2925), (126.0621, 140.2925)),\n ('vertical', '10.4651', (181.3759, 117.7152), (181.3759, 129.2925), (170.3759, 123.5038)),\n ('radius', 'R11.0465', (181.3759, 129.9357), 12.2205, 135),\n ('horizontal', '10.7309', (207.5964, 117.7152), (219.4677, 117.7152), (213.532, 128.7152))\n]\n\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; _ds.dxf.dimasz = 2.5\n _ds.dxf.dimexe = 1.25; _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\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\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,\n angle=(0 if d[0] == \"horizontal\" else 90),\n 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,\n 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,\n 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,\n text=text, dimstyle=\"EZDXF\").render()\n\n doc.saveas(out_path)\n\n\nif __name__ == \"__main__\":\n out = sys.argv[1] if len(sys.argv) > 1 else \"0041_00411453_gt.dxf\"\n draw(out)\n print(\"wrote\", out)\n```"}], "images": ["images/0041_00411453.png"], "id": "0041_00411453"} {"messages": [{"role": "user", "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 50 mm."}, {"role": "assistant", "content": "```python\n#!/usr/bin/env python3\n# -*- coding: utf-8 -*-\n# Ground-truth 2D engineering drawing for part: 0041_00417098\n# Self-contained: reproduces the three-view DXF via ezdxf, NO FreeCAD needed.\n# Coordinates are A4 page millimetres (scale=1.0991574803149133, page=[297.0, 210.0]).\n# visible edges -> solid (layer OUTLINE); hidden edges -> dashed (layer HIDDEN)\n# dimensions -> real movable DIMENSION entities (text = true mm value)\n# Run: python 0041_00417098_gt.py [out.dxf]\nimport sys\nimport ezdxf\nimport math\n\nSCALE = 1.0991574803149133\nPAGE = [297.0, 210.0]\n\nVISIBLE_SEGMENTS = [\n (54.063189, 169.991063, 163.978937, 169.991063),\n (163.978937, 169.991063, 163.978937, 132.966811),\n (163.978937, 132.966811, 161.664921, 132.966811),\n (56.377205, 132.966811, 54.063189, 132.966811),\n (54.063189, 132.966811, 54.063189, 169.991063),\n (163.978937, 64.008937, 163.978937, 118.966811),\n (54.063189, 64.008937, 163.978937, 64.008937),\n (54.063189, 64.008937, 54.063189, 118.966811),\n (163.978937, 118.966811, 54.063189, 118.966811),\n (232.936811, 169.991063, 177.978937, 169.991063),\n (232.936811, 132.966811, 177.978937, 132.966811),\n (177.978937, 132.966811, 177.978937, 169.991063),\n (232.936811, 132.966811, 232.936811, 169.991063)\n]\nVISIBLE_CIRCLES = [\n\n]\nVISIBLE_ARCS = [\n (109.021063, 95.890823, 64.389477, 35.15625, 144.84375)\n]\nHIDDEN_SEGMENTS = [\n (161.6649, 64.0089, 161.6649, 118.9668),\n (56.3772, 64.0089, 56.3772, 118.9668),\n (177.9789, 160.2803, 232.9368, 160.2803)\n]\n# (orient, text, p1, p2, base) for linear; (orient, text, center, radius, angle) for diameter\nDIMENSIONS = [\n ('horizontal', '100', (163.9789, 132.9668), (54.0632, 132.9668), (109.0211, 121.9668)),\n ('vertical', '33.6842', (163.9789, 169.9911), (163.9789, 132.9668), (174.9789, 151.4789)),\n ('radius', 'R58.5808', (109.0211, 95.8908), 64.3895, 45),\n ('horizontal', '50', (232.9368, 169.9911), (177.9789, 169.9911), (205.4579, 158.9911))\n]\n\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; _ds.dxf.dimasz = 2.5\n _ds.dxf.dimexe = 1.25; _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\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\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,\n angle=(0 if d[0] == \"horizontal\" else 90),\n 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,\n 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,\n 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,\n text=text, dimstyle=\"EZDXF\").render()\n\n doc.saveas(out_path)\n\n\nif __name__ == \"__main__\":\n out = sys.argv[1] if len(sys.argv) > 1 else \"0041_00417098_gt.dxf\"\n draw(out)\n print(\"wrote\", out)\n```"}], "images": ["images/0041_00417098.png"], "id": "0041_00417098"} {"messages": [{"role": "user", "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 100 mm. The outline includes one or more oblique (angled) edges."}, {"role": "assistant", "content": "```python\n#!/usr/bin/env python3\n# -*- coding: utf-8 -*-\n# Ground-truth 2D engineering drawing for part: 0041_00419000\n# Self-contained: reproduces the three-view DXF via ezdxf, NO FreeCAD needed.\n# Coordinates are A4 page millimetres (scale=0.4804999999999982, page=[297.0, 210.0]).\n# visible edges -> solid (layer OUTLINE); hidden edges -> dashed (layer HIDDEN)\n# dimensions -> real movable DIMENSION entities (text = true mm value)\n# Run: python 0041_00419000_gt.py [out.dxf]\nimport sys\nimport ezdxf\nimport math\n\nSCALE = 0.4804999999999982\nPAGE = [297.0, 210.0]\n\nVISIBLE_SEGMENTS = [\n (136.5, 172.05, 136.5, 147.772105),\n (112.727895, 124.0, 88.45, 124.0),\n (88.45, 124.0, 88.45, 172.05),\n (88.45, 172.05, 136.5, 172.05),\n (136.5, 61.949999, 136.5, 109.999999),\n (88.45, 61.949999, 88.45, 109.999999),\n (88.45, 109.999999, 136.5, 109.999999),\n (88.45, 61.949999, 136.5, 61.949999),\n (198.550001, 124.0, 150.500001, 124.0),\n (150.500001, 124.0, 150.500001, 172.05),\n (198.550001, 172.05, 150.500001, 172.05),\n (198.550001, 124.0, 198.550001, 172.05)\n]\nVISIBLE_CIRCLES = [\n\n]\nVISIBLE_ARCS = [\n (134.126896, 126.373104, 21.530185, 83.671875, -173.671875)\n]\nHIDDEN_SEGMENTS = [\n (112.7279, 61.95, 112.7279, 110.0),\n (112.5967, 110.0, 112.5967, 61.95),\n (198.55, 147.7721, 150.5, 147.7721),\n (150.5, 147.9033, 198.55, 147.9033)\n]\n# (orient, text, p1, p2, base) for linear; (orient, text, center, radius, angle) for diameter\nDIMENSIONS = [\n ('horizontal', '50.5263', (112.7279, 124.0), (88.45, 124.0), (100.5889, 113.0)),\n ('horizontal', '100', (88.45, 172.05), (136.5, 172.05), (112.475, 183.05)),\n ('vertical', '50.5263', (136.5, 172.05), (136.5, 147.7721), (147.5, 159.9111)),\n ('vertical', '100', (88.45, 124.0), (88.45, 172.05), (77.45, 148.025)),\n ('radius', 'R44.8079', (134.1269, 126.3731), 21.5302, 45),\n ('horizontal', '100', (198.55, 172.05), (150.5, 172.05), (174.525, 161.05))\n]\n\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; _ds.dxf.dimasz = 2.5\n _ds.dxf.dimexe = 1.25; _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\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\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,\n angle=(0 if d[0] == \"horizontal\" else 90),\n 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,\n 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,\n 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,\n text=text, dimstyle=\"EZDXF\").render()\n\n doc.saveas(out_path)\n\n\nif __name__ == \"__main__\":\n out = sys.argv[1] if len(sys.argv) > 1 else \"0041_00419000_gt.dxf\"\n draw(out)\n print(\"wrote\", out)\n```"}], "images": ["images/0041_00419000.png"], "id": "0041_00419000"} {"messages": [{"role": "user", "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 4903.23 mm. The outline includes one or more oblique (angled) edges."}, {"role": "assistant", "content": "```python\n#!/usr/bin/env python3\n# -*- coding: utf-8 -*-\n# Ground-truth 2D engineering drawing for part: 0042_00422612\n# Self-contained: reproduces the three-view DXF via ezdxf, NO FreeCAD needed.\n# Coordinates are A4 page millimetres (scale=0.0191911101567518, page=[297.0, 210.0]).\n# visible edges -> solid (layer OUTLINE); hidden edges -> dashed (layer HIDDEN)\n# dimensions -> real movable DIMENSION entities (text = true mm value)\n# Run: python 0042_00422612_gt.py [out.dxf]\nimport sys\nimport ezdxf\nimport math\n\nSCALE = 0.0191911101567518\nPAGE = [297.0, 210.0]\n\nVISIBLE_SEGMENTS = [\n (89.20318, 172.053415, 89.71907, 172.053415),\n (89.760341, 172.012144, 89.760341, 170.093033),\n (89.71907, 170.051761, 89.20318, 170.051761),\n (89.161909, 170.093033, 89.161909, 172.012144),\n (89.760341, 61.953415, 89.760341, 156.051761),\n (89.71907, 156.051761, 89.20318, 156.051761),\n (89.71907, 61.953415, 89.20318, 61.953415),\n (89.161909, 61.953415, 89.161909, 156.051761),\n (89.71907, 61.953415, 89.71907, 156.051761),\n (89.20318, 61.953415, 89.20318, 156.051761),\n (103.760341, 172.053415, 197.858688, 172.053415),\n (103.760341, 170.051761, 197.858688, 170.051761),\n (197.858688, 170.093033, 197.858688, 172.012144),\n (103.760341, 170.093033, 103.760341, 172.012144),\n (103.760341, 172.012144, 197.858688, 172.012144),\n (103.760341, 170.093033, 197.858688, 170.093033)\n]\nVISIBLE_CIRCLES = [\n\n]\nVISIBLE_ARCS = [\n (89.20318, 172.012144, 0.041271, 90.0, -180.0),\n (89.71907, 172.012144, 0.041271, 0.0, 90.0),\n (89.71907, 170.093033, 0.041271, -90.0, 0.0),\n (89.20318, 170.093033, 0.041271, 180.0, -90.0),\n (-847.245415, 101.684568, 937.827647, -2.428122, -2.428016),\n (-847.245415, 116.320608, 937.827647, 2.428016, 2.428122),\n (16946.869246, 142.851838, 16857.881353, -179.725045, -179.725045),\n (16946.869246, 75.153337, 16857.881353, 179.725045, 179.725045),\n (196.761772, 366.829982, 215.858751, -115.523426, -115.518706),\n (104.857257, 366.829982, 215.858751, -64.481294, -64.476574),\n (409.444809, -9421.551824, 9596.494198, 91.825391, 91.825399),\n (-107.825779, -9421.551824, 9596.494198, 88.174601, 88.174609)\n]\nHIDDEN_SEGMENTS = [\n\n]\n# (orient, text, p1, p2, base) for linear; (orient, text, center, radius, angle) for diameter\nDIMENSIONS = [\n ('horizontal', '26.8817', (89.1929, 170.0483), (89.7088, 170.0483), (89.4508, 181.0483)),\n ('vertical', '100', (89.75, 170.0896), (89.75, 172.0087), (78.75, 171.0492)),\n ('radius', 'R2.1505', (89.1929, 170.0896), 0.0413, 45),\n ('horizontal', '4903.23', (103.75, 170.0896), (197.8484, 170.0896), (150.7992, 181.0896))\n]\n\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; _ds.dxf.dimasz = 2.5\n _ds.dxf.dimexe = 1.25; _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\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\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,\n angle=(0 if d[0] == \"horizontal\" else 90),\n 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,\n 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,\n 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,\n text=text, dimstyle=\"EZDXF\").render()\n\n doc.saveas(out_path)\n\n\nif __name__ == \"__main__\":\n out = sys.argv[1] if len(sys.argv) > 1 else \"0042_00422612_gt.dxf\"\n draw(out)\n print(\"wrote\", out)\n```"}], "images": ["images/0042_00422612.png"], "id": "0042_00422612"} {"messages": [{"role": "user", "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 125.35 x 116.9 mm. It is extruded to a thickness of 1605.63 mm. The outline includes one or more oblique (angled) edges."}, {"role": "assistant", "content": "```python\n#!/usr/bin/env python3\n# -*- coding: utf-8 -*-\n# Ground-truth 2D engineering drawing for part: 0043_00433774\n# Self-contained: reproduces the three-view DXF via ezdxf, NO FreeCAD needed.\n# Coordinates are A4 page millimetres (scale=0.055247773279349176, page=[297.0, 210.0]).\n# visible edges -> solid (layer OUTLINE); hidden edges -> dashed (layer HIDDEN)\n# dimensions -> real movable DIMENSION entities (text = true mm value)\n# Run: python 0043_00433774_gt.py [out.dxf]\nimport sys\nimport ezdxf\nimport math\n\nSCALE = 0.055247773279349176\nPAGE = [297.0, 210.0]\n\nVISIBLE_SEGMENTS = [\n (89.383765, 164.657692, 94.908542, 164.657692),\n (95.842308, 165.591458, 95.842308, 171.116235),\n (94.908542, 172.05, 89.383765, 172.05),\n (88.45, 171.116235, 88.45, 165.591458),\n (95.375425, 165.591458, 95.375425, 171.116235),\n (89.383765, 165.124575, 94.908542, 165.124575),\n (88.916882, 165.591458, 88.45, 165.591458),\n (88.916882, 171.116235, 88.916882, 165.591458),\n (94.908542, 171.583118, 89.383765, 171.583118),\n (95.842308, 150.657692, 95.842308, 61.95),\n (95.842308, 150.657692, 94.908542, 150.657692),\n (95.842308, 61.95, 94.908542, 61.95),\n (94.908542, 61.95, 89.383765, 61.95),\n (94.908542, 150.657692, 89.383765, 150.657692),\n (89.383765, 150.657692, 88.45, 150.657692),\n (88.45, 150.657692, 88.45, 61.95),\n (89.383765, 61.95, 88.45, 61.95),\n (94.908542, 150.657692, 94.908542, 61.95),\n (89.383765, 150.657692, 89.383765, 61.95),\n (109.842308, 165.591458, 109.842308, 164.657692),\n (109.842308, 164.657692, 198.55, 164.657692),\n (198.55, 165.591458, 198.55, 164.657692),\n (109.842308, 172.05, 198.55, 172.05),\n (109.842308, 172.05, 109.842308, 171.116235),\n (198.55, 172.05, 198.55, 171.116235),\n (198.55, 171.116235, 198.55, 165.591458),\n (109.842308, 171.116235, 109.842308, 165.591458),\n (109.842308, 165.591458, 198.55, 165.591458),\n (109.842308, 171.116235, 198.55, 171.116235)\n]\nVISIBLE_CIRCLES = [\n\n]\nVISIBLE_ARCS = [\n (89.383765, 165.591458, 0.933765, 180.0, -90.0),\n (94.908542, 165.591458, 0.933765, -90.0, -0.0),\n (94.908542, 171.116235, 0.933765, -0.0, 90.0),\n (89.383765, 171.116235, 0.933765, 90.0, 180.0),\n (94.908542, 171.116235, 0.466883, -0.0, 90.0),\n (94.908542, 165.591458, 0.466883, -90.0, -0.0),\n (89.150324, 165.824899, 0.738206, -161.565051, -71.565051),\n (89.383765, 171.116235, 0.466883, 90.0, -180.0)\n]\nHIDDEN_SEGMENTS = [\n\n]\n# (orient, text, p1, p2, base) for linear; (orient, text, center, radius, angle) for diameter\nDIMENSIONS = [\n ('horizontal', '100', (89.3838, 164.6577), (94.9085, 164.6577), (92.1462, 175.6577)),\n ('vertical', '100', (95.8423, 165.5915), (95.8423, 171.1162), (84.8423, 168.3538)),\n ('horizontal', '125.352', (88.45, 165.1246), (95.3754, 165.1246), (91.9127, 176.1246)),\n ('vertical', '116.901', (88.45, 165.1246), (88.45, 171.5831), (77.45, 168.3538)),\n ('vertical', '8.4507', (88.45, 164.6577), (88.45, 165.1246), (77.45, 164.8911)),\n ('radius', 'R16.9014', (89.3838, 165.5915), 0.9338, 45),\n ('radius', 'R13.3617', (89.1503, 165.8249), 0.7382, 135),\n ('radius', 'R8.4507', (94.9085, 165.5915), 0.4669, 45),\n ('horizontal', '1605.63', (109.8423, 165.5915), (198.55, 165.5915), (154.1962, 176.5915))\n]\n\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; _ds.dxf.dimasz = 2.5\n _ds.dxf.dimexe = 1.25; _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\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\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,\n angle=(0 if d[0] == \"horizontal\" else 90),\n 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,\n 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,\n 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,\n text=text, dimstyle=\"EZDXF\").render()\n\n doc.saveas(out_path)\n\n\nif __name__ == \"__main__\":\n out = sys.argv[1] if len(sys.argv) > 1 else \"0043_00433774_gt.dxf\"\n draw(out)\n print(\"wrote\", out)\n```"}], "images": ["images/0043_00433774.png"], "id": "0043_00433774"} {"messages": [{"role": "user", "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 48.69 mm."}, {"role": "assistant", "content": "```python\n#!/usr/bin/env python3\n# -*- coding: utf-8 -*-\n# Ground-truth 2D engineering drawing for part: 0043_00436986\n# Self-contained: reproduces the three-view DXF via ezdxf, NO FreeCAD needed.\n# Coordinates are A4 page millimetres (scale=0.9882232394366042, page=[297.0, 210.0]).\n# visible edges -> solid (layer OUTLINE); hidden edges -> dashed (layer HIDDEN)\n# dimensions -> real movable DIMENSION entities (text = true mm value)\n# Run: python 0043_00436986_gt.py [out.dxf]\nimport sys\nimport ezdxf\nimport math\n\nSCALE = 0.9882232394366042\nPAGE = [297.0, 210.0]\n\nVISIBLE_SEGMENTS = [\n (131.685509, 136.724088, 161.852324, 136.724088),\n (63.03, 136.724088, 93.196815, 136.724088),\n (161.852324, 122.724088, 161.852324, 74.606412),\n (161.852324, 122.724088, 63.03, 122.724088),\n (63.03, 122.724088, 63.03, 74.606412),\n (161.852324, 74.606412, 63.03, 74.606412),\n (175.852324, 182.063088, 175.852324, 136.724088),\n (175.852324, 136.724088, 223.97, 136.724088),\n (223.97, 182.063088, 223.97, 136.724088),\n (223.97, 182.063088, 175.852324, 182.063088)\n]\nVISIBLE_CIRCLES = [\n\n]\nVISIBLE_ARCS = [\n (112.441162, 132.89615, 19.621366, 11.25, 168.75),\n (112.441162, 132.469053, 49.594034, 4.921875, 175.078125)\n]\nHIDDEN_SEGMENTS = [\n (93.1968, 122.7241, 93.1968, 74.6064),\n (131.6855, 122.7241, 131.6855, 74.6064),\n (223.97, 152.5175, 175.8523, 152.5175)\n]\n# (orient, text, p1, p2, base) for linear; (orient, text, center, radius, angle) for diameter\nDIMENSIONS = [\n ('horizontal', '100', (161.8523, 136.7241), (63.03, 136.7241), (112.4411, 125.7241)),\n ('radius', 'R19.8552', (112.4411, 132.8961), 19.6214, 45),\n ('radius', 'R50.1851', (112.4411, 132.469), 49.5941, 135),\n ('horizontal', '48.6911', (175.8523, 136.7241), (223.97, 136.7241), (199.9112, 147.7241))\n]\n\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; _ds.dxf.dimasz = 2.5\n _ds.dxf.dimexe = 1.25; _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\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\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,\n angle=(0 if d[0] == \"horizontal\" else 90),\n 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,\n 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,\n 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,\n text=text, dimstyle=\"EZDXF\").render()\n\n doc.saveas(out_path)\n\n\nif __name__ == \"__main__\":\n out = sys.argv[1] if len(sys.argv) > 1 else \"0043_00436986_gt.dxf\"\n draw(out)\n print(\"wrote\", out)\n```"}], "images": ["images/0043_00436986.png"], "id": "0043_00436986"} {"messages": [{"role": "user", "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 68.84 mm. The outline includes one or more oblique (angled) edges."}, {"role": "assistant", "content": "```python\n#!/usr/bin/env python3\n# -*- coding: utf-8 -*-\n# Ground-truth 2D engineering drawing for part: 0044_00444540\n# Self-contained: reproduces the three-view DXF via ezdxf, NO FreeCAD needed.\n# Coordinates are A4 page millimetres (scale=0.46532631578947603, page=[297.0, 210.0]).\n# visible edges -> solid (layer OUTLINE); hidden edges -> dashed (layer HIDDEN)\n# dimensions -> real movable DIMENSION entities (text = true mm value)\n# Run: python 0044_00444540_gt.py [out.dxf]\nimport sys\nimport ezdxf\nimport math\n\nSCALE = 0.46532631578947603\nPAGE = [297.0, 210.0]\n\nVISIBLE_SEGMENTS = [\n (97.213902, 107.983311, 143.746534, 107.983311),\n (152.513551, 116.750329, 152.513551, 162.608575),\n (143.746534, 172.049978, 97.213902, 172.049978),\n (88.446885, 162.608575, 88.446885, 116.750329),\n (152.519793, 93.983311, 152.245629, 93.983311),\n (152.245629, 93.983311, 151.971465, 93.983311),\n (151.971465, 93.983311, 151.6973, 93.983311),\n (151.6973, 93.983311, 151.423136, 93.983311),\n (151.423136, 93.983311, 151.148972, 93.983311),\n (151.148972, 93.983311, 150.874807, 93.983311),\n (150.874807, 93.983311, 150.600643, 93.983311),\n (150.600643, 93.983311, 150.326478, 93.983311),\n (150.326478, 93.983311, 150.052314, 93.983311),\n (150.052314, 93.983311, 149.77815, 93.983311),\n (149.77815, 93.983311, 149.503985, 93.983311),\n (149.503985, 93.983311, 149.229821, 93.983311),\n (149.229821, 93.983311, 148.955657, 93.983311),\n (148.955657, 93.983311, 148.681492, 93.983311),\n (148.681492, 93.983311, 148.407328, 93.983311),\n (148.407328, 93.983311, 148.133164, 93.983311),\n (148.133164, 93.983311, 147.858999, 93.983311),\n (147.858999, 93.983311, 147.584835, 93.983311),\n (147.584835, 93.983311, 147.31067, 93.983311),\n (147.31067, 93.983311, 147.036506, 93.983311),\n (147.036506, 93.983311, 146.762342, 93.983311),\n (146.762342, 93.983311, 146.488177, 93.983311),\n (146.488177, 93.983311, 146.214013, 93.983311),\n (146.214013, 93.983311, 145.939849, 93.983311),\n (145.939849, 93.983311, 145.665684, 93.983311),\n (145.665684, 93.983311, 145.39152, 93.983311),\n (145.39152, 93.983311, 145.117356, 93.983311),\n (145.117356, 93.983311, 144.843191, 93.983311),\n (144.843191, 93.983311, 144.569027, 93.983311),\n (144.569027, 93.983311, 144.294862, 93.983311),\n (144.294862, 93.983311, 144.020698, 93.983311),\n (144.020698, 93.983311, 143.746534, 93.983311),\n (143.746534, 93.983311, 143.746534, 61.949978),\n (152.519793, 61.949978, 152.245629, 61.949978),\n (152.245629, 61.949978, 151.971465, 61.949978),\n (151.971465, 61.949978, 151.6973, 61.949978),\n (151.6973, 61.949978, 151.423136, 61.949978),\n (151.423136, 61.949978, 151.148972, 61.949978),\n (151.148972, 61.949978, 150.874807, 61.949978),\n (150.874807, 61.949978, 150.600643, 61.949978),\n (150.600643, 61.949978, 150.326478, 61.949978),\n (150.326478, 61.949978, 150.052314, 61.949978),\n (150.052314, 61.949978, 149.77815, 61.949978),\n (149.77815, 61.949978, 149.503985, 61.949978),\n (149.503985, 61.949978, 149.229821, 61.949978),\n (149.229821, 61.949978, 148.955657, 61.949978),\n (148.955657, 61.949978, 148.681492, 61.949978),\n (148.681492, 61.949978, 148.407328, 61.949978),\n (148.407328, 61.949978, 148.133164, 61.949978),\n (148.133164, 61.949978, 147.858999, 61.949978),\n (147.858999, 61.949978, 147.584835, 61.949978),\n (147.584835, 61.949978, 147.31067, 61.949978),\n (147.31067, 61.949978, 147.036506, 61.949978),\n (147.036506, 61.949978, 146.762342, 61.949978),\n (146.762342, 61.949978, 146.488177, 61.949978),\n (146.488177, 61.949978, 146.214013, 61.949978),\n (146.214013, 61.949978, 145.939849, 61.949978),\n (145.939849, 61.949978, 145.665684, 61.949978),\n (145.665684, 61.949978, 145.39152, 61.949978),\n (145.39152, 61.949978, 145.117356, 61.949978),\n (145.117356, 61.949978, 144.843191, 61.949978),\n (144.843191, 61.949978, 144.569027, 61.949978),\n (144.569027, 61.949978, 144.294862, 61.949978),\n (144.294862, 61.949978, 144.020698, 61.949978),\n (144.020698, 61.949978, 143.746534, 61.949978),\n (143.746534, 61.949978, 97.213902, 61.949978),\n (97.213902, 93.983311, 97.213902, 61.949978),\n (143.746534, 93.983311, 97.213902, 93.983311),\n (97.213902, 93.983311, 96.939738, 93.983311),\n (96.939738, 93.983311, 96.665573, 93.983311),\n (96.665573, 93.983311, 96.391409, 93.983311),\n (96.391409, 93.983311, 96.117245, 93.983311),\n (96.117245, 93.983311, 95.84308, 93.983311),\n (95.84308, 93.983311, 95.568916, 93.983311),\n (95.568916, 93.983311, 95.294752, 93.983311),\n (95.294752, 93.983311, 95.020587, 93.983311),\n (95.020587, 93.983311, 94.746423, 93.983311),\n (94.746423, 93.983311, 94.472258, 93.983311),\n (94.472258, 93.983311, 94.198094, 93.983311),\n (94.198094, 93.983311, 93.92393, 93.983311),\n (93.92393, 93.983311, 93.649765, 93.983311),\n (93.649765, 93.983311, 93.375601, 93.983311),\n (93.375601, 93.983311, 93.101437, 93.983311),\n (93.101437, 93.983311, 92.827272, 93.983311),\n (92.827272, 93.983311, 92.553108, 93.983311),\n (92.553108, 93.983311, 92.278944, 93.983311),\n (92.278944, 93.983311, 92.004779, 93.983311),\n (92.004779, 93.983311, 91.730615, 93.983311),\n (91.730615, 93.983311, 91.45645, 93.983311),\n (91.45645, 93.983311, 91.182286, 93.983311),\n (91.182286, 93.983311, 90.908122, 93.983311),\n (90.908122, 93.983311, 90.633957, 93.983311),\n (90.633957, 93.983311, 90.359793, 93.983311),\n (90.359793, 93.983311, 90.085629, 93.983311),\n (90.085629, 93.983311, 89.811464, 93.983311),\n (89.811464, 93.983311, 89.5373, 93.983311),\n (89.5373, 93.983311, 89.263135, 93.983311),\n (89.263135, 93.983311, 88.988971, 93.983311),\n (88.988971, 93.983311, 88.714807, 93.983311),\n (88.714807, 93.983311, 88.440642, 93.983311),\n (97.213902, 61.949978, 96.939738, 61.949978),\n (96.939738, 61.949978, 96.665573, 61.949978),\n (96.665573, 61.949978, 96.391409, 61.949978),\n (96.391409, 61.949978, 96.117245, 61.949978),\n (96.117245, 61.949978, 95.84308, 61.949978),\n (95.84308, 61.949978, 95.568916, 61.949978),\n (95.568916, 61.949978, 95.294752, 61.949978),\n (95.294752, 61.949978, 95.020587, 61.949978),\n (95.020587, 61.949978, 94.746423, 61.949978),\n (94.746423, 61.949978, 94.472258, 61.949978),\n (94.472258, 61.949978, 94.198094, 61.949978),\n (94.198094, 61.949978, 93.92393, 61.949978),\n (93.92393, 61.949978, 93.649765, 61.949978),\n (93.649765, 61.949978, 93.375601, 61.949978),\n (93.375601, 61.949978, 93.101437, 61.949978),\n (93.101437, 61.949978, 92.827272, 61.949978),\n (92.827272, 61.949978, 92.553108, 61.949978),\n (92.553108, 61.949978, 92.278944, 61.949978),\n (92.278944, 61.949978, 92.004779, 61.949978),\n (92.004779, 61.949978, 91.730615, 61.949978),\n (91.730615, 61.949978, 91.45645, 61.949978),\n (91.45645, 61.949978, 91.182286, 61.949978),\n (91.182286, 61.949978, 90.908122, 61.949978),\n (90.908122, 61.949978, 90.633957, 61.949978),\n (90.633957, 61.949978, 90.359793, 61.949978),\n (90.359793, 61.949978, 90.085629, 61.949978),\n (90.085629, 61.949978, 89.811464, 61.949978),\n (89.811464, 61.949978, 89.5373, 61.949978),\n (89.5373, 61.949978, 89.263135, 61.949978),\n (89.263135, 61.949978, 88.988971, 61.949978),\n (88.988971, 61.949978, 88.714807, 61.949978),\n (88.714807, 61.949978, 88.440642, 61.949978),\n (152.519793, 61.949978, 152.519793, 93.983311),\n (88.440642, 61.949978, 88.440642, 93.983311),\n (166.519794, 116.750329, 166.519794, 116.47636),\n (166.519794, 116.47636, 166.519794, 116.20239),\n (166.519794, 116.20239, 166.519794, 115.928421),\n (166.519794, 115.928421, 166.519794, 115.654452),\n (166.519794, 115.654452, 166.519794, 115.380482),\n (166.519794, 115.380482, 166.519794, 115.106513),\n (166.519794, 115.106513, 166.519794, 114.832544),\n (166.519794, 114.832544, 166.519794, 114.558575),\n (166.519794, 114.558575, 166.519794, 114.284605),\n (166.519794, 114.284605, 166.519794, 114.010636),\n (166.519794, 114.010636, 166.519794, 113.736667),\n (166.519794, 113.736667, 166.519794, 113.462697),\n (166.519794, 113.462697, 166.519794, 113.188728),\n (166.519794, 113.188728, 166.519794, 112.914759),\n (166.519794, 112.914759, 166.519794, 112.640789),\n (166.519794, 112.640789, 166.519794, 112.36682),\n (166.519794, 112.36682, 166.519794, 112.092851),\n (166.519794, 112.092851, 166.519794, 111.818882),\n (166.519794, 111.818882, 166.519794, 111.544912),\n (166.519794, 111.544912, 166.519794, 111.270943),\n (166.519794, 111.270943, 166.519794, 110.996974),\n (166.519794, 110.996974, 166.519794, 110.723004),\n (166.519794, 110.723004, 166.519794, 110.449035),\n (166.519794, 110.449035, 166.519794, 110.175066),\n (166.519794, 110.175066, 166.519794, 109.901096),\n (166.519794, 109.901096, 166.519794, 109.627127),\n (166.519794, 109.627127, 166.519794, 109.353158),\n (166.519794, 109.353158, 166.519794, 109.079189),\n (166.519794, 109.079189, 166.519794, 108.805219),\n (166.519794, 108.805219, 166.519794, 108.53125),\n (166.519794, 108.53125, 166.519794, 108.257281),\n (166.519794, 108.257281, 166.519794, 107.983311),\n (166.519794, 107.983311, 198.553127, 107.983311),\n (198.553127, 116.750329, 198.553127, 116.47636),\n (198.553127, 116.47636, 198.553127, 116.20239),\n (198.553127, 116.20239, 198.553127, 115.928421),\n (198.553127, 115.928421, 198.553127, 115.654452),\n (198.553127, 115.654452, 198.553127, 115.380482),\n (198.553127, 115.380482, 198.553127, 115.106513),\n (198.553127, 115.106513, 198.553127, 114.832544),\n (198.553127, 114.832544, 198.553127, 114.558575),\n (198.553127, 114.558575, 198.553127, 114.284605),\n (198.553127, 114.284605, 198.553127, 114.010636),\n (198.553127, 114.010636, 198.553127, 113.736667),\n (198.553127, 113.736667, 198.553127, 113.462697),\n (198.553127, 113.462697, 198.553127, 113.188728),\n (198.553127, 113.188728, 198.553127, 112.914759),\n (198.553127, 112.914759, 198.553127, 112.640789),\n (198.553127, 112.640789, 198.553127, 112.36682),\n (198.553127, 112.36682, 198.553127, 112.092851),\n (198.553127, 112.092851, 198.553127, 111.818882),\n (198.553127, 111.818882, 198.553127, 111.544912),\n (198.553127, 111.544912, 198.553127, 111.270943),\n (198.553127, 111.270943, 198.553127, 110.996974),\n (198.553127, 110.996974, 198.553127, 110.723004),\n (198.553127, 110.723004, 198.553127, 110.449035),\n (198.553127, 110.449035, 198.553127, 110.175066),\n (198.553127, 110.175066, 198.553127, 109.901096),\n (198.553127, 109.901096, 198.553127, 109.627127),\n (198.553127, 109.627127, 198.553127, 109.353158),\n (198.553127, 109.353158, 198.553127, 109.079189),\n (198.553127, 109.079189, 198.553127, 108.805219),\n (198.553127, 108.805219, 198.553127, 108.53125),\n (198.553127, 108.53125, 198.553127, 108.257281),\n (198.553127, 108.257281, 198.553127, 107.983311),\n (166.519794, 172.049978, 198.553127, 172.049978),\n (166.519794, 172.049978, 166.519794, 171.754934),\n (166.519794, 171.754934, 166.519794, 171.45989),\n (166.519794, 171.45989, 166.519794, 171.164846),\n (166.519794, 171.164846, 166.519794, 170.869803),\n (166.519794, 170.869803, 166.519794, 170.574759),\n (166.519794, 170.574759, 166.519794, 170.279715),\n (166.519794, 170.279715, 166.519794, 169.984671),\n (166.519794, 169.984671, 166.519794, 169.689627),\n (166.519794, 169.689627, 166.519794, 169.394583),\n (166.519794, 169.394583, 166.519794, 169.099539),\n (166.519794, 169.099539, 166.519794, 168.804496),\n (166.519794, 168.804496, 166.519794, 168.509452),\n (166.519794, 168.509452, 166.519794, 168.214408),\n (166.519794, 168.214408, 166.519794, 167.919364),\n (166.519794, 167.919364, 166.519794, 167.62432),\n (166.519794, 167.62432, 166.519794, 167.329276),\n (166.519794, 167.329276, 166.519794, 167.034232),\n (166.519794, 167.034232, 166.519794, 166.739189),\n (166.519794, 166.739189, 166.519794, 166.444145),\n (166.519794, 166.444145, 166.519794, 166.149101),\n (166.519794, 166.149101, 166.519794, 165.854057),\n (166.519794, 165.854057, 166.519794, 165.559013),\n (166.519794, 165.559013, 166.519794, 165.263969),\n (166.519794, 165.263969, 166.519794, 164.968925),\n (166.519794, 164.968925, 166.519794, 164.673882),\n (166.519794, 164.673882, 166.519794, 164.378838),\n (166.519794, 164.378838, 166.519794, 164.083794),\n (166.519794, 164.083794, 166.519794, 163.78875),\n (166.519794, 163.78875, 166.519794, 163.493706),\n (166.519794, 163.493706, 166.519794, 163.198662),\n (166.519794, 163.198662, 166.519794, 162.903618),\n (166.519794, 162.903618, 166.519794, 162.608575),\n (166.519794, 162.608575, 198.553127, 162.608575),\n (198.553127, 172.049978, 198.553127, 171.754934),\n (198.553127, 171.754934, 198.553127, 171.45989),\n (198.553127, 171.45989, 198.553127, 171.164846),\n (198.553127, 171.164846, 198.553127, 170.869803),\n (198.553127, 170.869803, 198.553127, 170.574759),\n (198.553127, 170.574759, 198.553127, 170.279715),\n (198.553127, 170.279715, 198.553127, 169.984671),\n (198.553127, 169.984671, 198.553127, 169.689627),\n (198.553127, 169.689627, 198.553127, 169.394583),\n (198.553127, 169.394583, 198.553127, 169.099539),\n (198.553127, 169.099539, 198.553127, 168.804496),\n (198.553127, 168.804496, 198.553127, 168.509452),\n (198.553127, 168.509452, 198.553127, 168.214408),\n (198.553127, 168.214408, 198.553127, 167.919364),\n (198.553127, 167.919364, 198.553127, 167.62432),\n (198.553127, 167.62432, 198.553127, 167.329276),\n (198.553127, 167.329276, 198.553127, 167.034232),\n (198.553127, 167.034232, 198.553127, 166.739189),\n (198.553127, 166.739189, 198.553127, 166.444145),\n (198.553127, 166.444145, 198.553127, 166.149101),\n (198.553127, 166.149101, 198.553127, 165.854057),\n (198.553127, 165.854057, 198.553127, 165.559013),\n (198.553127, 165.559013, 198.553127, 165.263969),\n (198.553127, 165.263969, 198.553127, 164.968925),\n (198.553127, 164.968925, 198.553127, 164.673882),\n (198.553127, 164.673882, 198.553127, 164.378838),\n (198.553127, 164.378838, 198.553127, 164.083794),\n (198.553127, 164.083794, 198.553127, 163.78875),\n (198.553127, 163.78875, 198.553127, 163.493706),\n (198.553127, 163.493706, 198.553127, 163.198662),\n (198.553127, 163.198662, 198.553127, 162.903618),\n (198.553127, 162.903618, 198.553127, 162.608575),\n (198.553127, 162.608575, 198.553127, 116.750329),\n (166.519794, 162.608575, 166.519794, 116.750329),\n (166.519794, 116.750329, 198.553127, 116.750329)\n]\nVISIBLE_CIRCLES = [\n\n]\nVISIBLE_ARCS = [\n (97.213902, 116.750329, 8.767018, -180.0, -90.0),\n (143.746534, 116.750329, 8.767018, -90.0, -0.0),\n (143.409341, 162.945768, 9.110453, -2.121096, 87.878904),\n (97.551095, 162.945768, 9.110453, 92.121096, -177.878904)\n]\nHIDDEN_SEGMENTS = [\n\n]\n# (orient, text, p1, p2, base) for linear; (orient, text, center, radius, angle) for diameter\nDIMENSIONS = [\n ('horizontal', '100', (97.2139, 107.9834), (143.7465, 107.9834), (120.4802, 118.9834)),\n ('vertical', '98.5507', (152.5136, 116.7503), (152.5136, 162.6086), (141.5136, 139.6795)),\n ('radius', 'R18.8406', (97.2139, 116.7503), 8.767, 45),\n ('radius', 'R19.5786', (143.4094, 162.9458), 9.1104, 45),\n ('horizontal', '68.8406', (166.5198, 116.7503), (198.5531, 116.7503), (182.5365, 127.7503))\n]\n\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; _ds.dxf.dimasz = 2.5\n _ds.dxf.dimexe = 1.25; _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\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\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,\n angle=(0 if d[0] == \"horizontal\" else 90),\n 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,\n 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,\n 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,\n text=text, dimstyle=\"EZDXF\").render()\n\n doc.saveas(out_path)\n\n\nif __name__ == \"__main__\":\n out = sys.argv[1] if len(sys.argv) > 1 else \"0044_00444540_gt.dxf\"\n draw(out)\n print(\"wrote\", out)\n```"}], "images": ["images/0044_00444540.png"], "id": "0044_00444540"} {"messages": [{"role": "user", "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 89.47 x 42.11 mm. It is extruded to a thickness of 2.08 mm. The outline includes one or more oblique (angled) edges."}, {"role": "assistant", "content": "```python\n#!/usr/bin/env python3\n# -*- coding: utf-8 -*-\n# Ground-truth 2D engineering drawing for part: 0045_00459993\n# Self-contained: reproduces the three-view DXF via ezdxf, NO FreeCAD needed.\n# Coordinates are A4 page millimetres (scale=0.9693958333333783, page=[297.0, 210.0]).\n# visible edges -> solid (layer OUTLINE); hidden edges -> dashed (layer HIDDEN)\n# dimensions -> real movable DIMENSION entities (text = true mm value)\n# Run: python 0045_00459993_gt.py [out.dxf]\nimport sys\nimport ezdxf\nimport math\n\nSCALE = 0.9693958333333783\nPAGE = [297.0, 210.0]\n\nVISIBLE_SEGMENTS = [\n (87.020414, 150.009996, 183.959998, 150.009996),\n (183.959998, 150.009996, 183.959998, 109.193329),\n (174.776248, 100.009579, 96.204164, 100.009579),\n (87.020414, 109.193329, 87.020414, 150.009996),\n (96.204164, 104.091246, 174.776248, 104.091246),\n (178.857914, 144.907912, 178.857914, 109.193329),\n (178.857914, 144.907912, 92.122498, 144.907912),\n (92.122498, 109.193329, 92.122498, 144.907912),\n (183.959998, 83.990004, 183.959998, 86.009579),\n (87.020414, 83.990004, 183.959998, 83.990004),\n (87.020414, 83.990004, 87.020414, 86.009579),\n (183.959998, 86.009579, 87.020414, 86.009579),\n (199.979573, 150.009996, 197.959998, 150.009996),\n (199.979573, 100.009579, 197.959998, 100.009579),\n (199.979573, 100.009579, 199.979573, 100.296571),\n (199.979573, 100.296571, 199.979573, 100.583563),\n (199.979573, 100.583563, 199.979573, 100.870555),\n (199.979573, 100.870555, 199.979573, 101.157548),\n (199.979573, 101.157548, 199.979573, 101.44454),\n (199.979573, 101.44454, 199.979573, 101.731532),\n (199.979573, 101.731532, 199.979573, 102.018524),\n (199.979573, 102.018524, 199.979573, 102.305516),\n (199.979573, 102.305516, 199.979573, 102.592509),\n (199.979573, 102.592509, 199.979573, 102.879501),\n (199.979573, 102.879501, 199.979573, 103.166493),\n (199.979573, 103.166493, 199.979573, 103.453485),\n (199.979573, 103.453485, 199.979573, 103.740477),\n (199.979573, 103.740477, 199.979573, 104.02747),\n (199.979573, 104.02747, 199.979573, 104.314462),\n (199.979573, 104.314462, 199.979573, 104.601454),\n (199.979573, 104.601454, 199.979573, 104.888446),\n (199.979573, 104.888446, 199.979573, 105.175438),\n (199.979573, 105.175438, 199.979573, 105.46243),\n (199.979573, 105.46243, 199.979573, 105.749423),\n (199.979573, 105.749423, 199.979573, 106.036415),\n (199.979573, 106.036415, 199.979573, 106.323407),\n (199.979573, 106.323407, 199.979573, 106.610399),\n (199.979573, 106.610399, 199.979573, 106.897391),\n (199.979573, 106.897391, 199.979573, 107.184384),\n (199.979573, 107.184384, 199.979573, 107.471376),\n (199.979573, 107.471376, 199.979573, 107.758368),\n (199.979573, 107.758368, 199.979573, 108.04536),\n (199.979573, 108.04536, 199.979573, 108.332352),\n (199.979573, 108.332352, 199.979573, 108.619345),\n (199.979573, 108.619345, 199.979573, 108.906337),\n (199.979573, 108.906337, 199.979573, 109.193329),\n (197.959998, 100.009579, 197.959998, 100.296571),\n (197.959998, 100.296571, 197.959998, 100.583563),\n (197.959998, 100.583563, 197.959998, 100.870555),\n (197.959998, 100.870555, 197.959998, 101.157548),\n (197.959998, 101.157548, 197.959998, 101.44454),\n (197.959998, 101.44454, 197.959998, 101.731532),\n (197.959998, 101.731532, 197.959998, 102.018524),\n (197.959998, 102.018524, 197.959998, 102.305516),\n (197.959998, 102.305516, 197.959998, 102.592509),\n (197.959998, 102.592509, 197.959998, 102.879501),\n (197.959998, 102.879501, 197.959998, 103.166493),\n (197.959998, 103.166493, 197.959998, 103.453485),\n (197.959998, 103.453485, 197.959998, 103.740477),\n (197.959998, 103.740477, 197.959998, 104.02747),\n (197.959998, 104.02747, 197.959998, 104.314462),\n (197.959998, 104.314462, 197.959998, 104.601454),\n (197.959998, 104.601454, 197.959998, 104.888446),\n (197.959998, 104.888446, 197.959998, 105.175438),\n (197.959998, 105.175438, 197.959998, 105.46243),\n (197.959998, 105.46243, 197.959998, 105.749423),\n (197.959998, 105.749423, 197.959998, 106.036415),\n (197.959998, 106.036415, 197.959998, 106.323407),\n (197.959998, 106.323407, 197.959998, 106.610399),\n (197.959998, 106.610399, 197.959998, 106.897391),\n (197.959998, 106.897391, 197.959998, 107.184384),\n (197.959998, 107.184384, 197.959998, 107.471376),\n (197.959998, 107.471376, 197.959998, 107.758368),\n (197.959998, 107.758368, 197.959998, 108.04536),\n (197.959998, 108.04536, 197.959998, 108.332352),\n (197.959998, 108.332352, 197.959998, 108.619345),\n (197.959998, 108.619345, 197.959998, 108.906337),\n (197.959998, 108.906337, 197.959998, 109.193329),\n (197.959998, 109.193329, 197.959998, 150.009996),\n (199.979573, 109.193329, 199.979573, 150.009996),\n (199.979573, 109.193329, 197.959998, 109.193329)\n]\nVISIBLE_CIRCLES = [\n\n]\nVISIBLE_ARCS = [\n (174.776248, 109.193329, 9.18375, -90.0, -0.0),\n (96.204164, 109.193329, 9.18375, -180.0, -90.0),\n (174.266039, 108.683121, 4.620133, -83.659808, 6.340192),\n (96.714373, 108.683121, 4.620133, 173.659808, -96.340192)\n]\nHIDDEN_SEGMENTS = [\n (96.2042, 83.99, 96.2042, 86.0096),\n (174.7763, 83.99, 174.7763, 86.0096),\n (178.8579, 83.99, 178.8579, 86.0096),\n (92.1225, 83.99, 92.1225, 86.0096),\n (178.8862, 86.0096, 178.8862, 83.99),\n (92.0942, 86.0096, 92.0942, 83.99),\n (199.9796, 104.0912, 197.96, 104.0912),\n (199.9796, 144.9079, 197.96, 144.9079)\n]\n# (orient, text, p1, p2, base) for linear; (orient, text, center, radius, angle) for diameter\nDIMENSIONS = [\n ('horizontal', '81.0526', (174.7762, 100.0096), (96.2042, 100.0096), (135.4902, 89.0096)),\n ('horizontal', '100', (87.0204, 150.01), (183.96, 150.01), (135.4902, 161.01)),\n ('vertical', '42.1053', (183.96, 150.01), (183.96, 109.1933), (194.96, 129.6017)),\n ('horizontal', '89.4737', (92.1225, 144.9079), (178.8579, 144.9079), (135.4902, 155.9079)),\n ('vertical', '42.1053', (92.1225, 144.9079), (92.1225, 104.0912), (103.1225, 124.4996)),\n ('horizontal', '5.2632', (87.0204, 144.9079), (92.1225, 144.9079), (89.5715, 155.9079)),\n ('vertical', '5.2632', (92.1225, 150.01), (92.1225, 144.9079), (103.1225, 147.459)),\n ('radius', 'R9.4737', (174.7762, 109.1933), 9.1838, 45),\n ('radius', 'R4.766', (174.266, 108.6831), 4.6201, 45),\n ('horizontal', '2.0833', (199.9796, 150.01), (197.96, 150.01), (198.9698, 139.01))\n]\n\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; _ds.dxf.dimasz = 2.5\n _ds.dxf.dimexe = 1.25; _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\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\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,\n angle=(0 if d[0] == \"horizontal\" else 90),\n 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,\n 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,\n 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,\n text=text, dimstyle=\"EZDXF\").render()\n\n doc.saveas(out_path)\n\n\nif __name__ == \"__main__\":\n out = sys.argv[1] if len(sys.argv) > 1 else \"0045_00459993_gt.dxf\"\n draw(out)\n print(\"wrote\", out)\n```"}], "images": ["images/0045_00459993.png"], "id": "0045_00459993"} {"messages": [{"role": "user", "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 circular hole of diameter 12.63 mm. It is extruded to a thickness of 6.25 mm. The outline includes one or more oblique (angled) edges."}, {"role": "assistant", "content": "```python\n#!/usr/bin/env python3\n# -*- coding: utf-8 -*-\n# Ground-truth 2D engineering drawing for part: 0046_00465901\n# Self-contained: reproduces the three-view DXF via ezdxf, NO FreeCAD needed.\n# Coordinates are A4 page millimetres (scale=0.9044705882352926, page=[297.0, 210.0]).\n# visible edges -> solid (layer OUTLINE); hidden edges -> dashed (layer HIDDEN)\n# dimensions -> real movable DIMENSION entities (text = true mm value)\n# Run: python 0046_00465901_gt.py [out.dxf]\nimport sys\nimport ezdxf\nimport math\n\nSCALE = 0.9044705882352926\nPAGE = [297.0, 210.0]\n\nVISIBLE_SEGMENTS = [\n (147.954815, 171.098001, 147.954815, 81.603017),\n (147.954815, 81.603017, 119.392585, 81.603017),\n (119.392585, 81.603017, 119.392585, 172.050076),\n (119.392585, 61.950075, 119.392585, 67.603017),\n (119.392035, 67.603017, 120.284622, 67.603017),\n (120.284622, 67.603017, 121.177209, 67.603017),\n (121.177209, 67.603017, 122.069795, 67.603017),\n (122.069795, 67.603017, 122.962382, 67.603017),\n (122.962382, 67.603017, 123.854969, 67.603017),\n (123.854969, 67.603017, 124.747556, 67.603017),\n (124.747556, 67.603017, 125.640143, 67.603017),\n (125.640143, 67.603017, 126.53273, 67.603017),\n (126.53273, 67.603017, 127.425317, 67.603017),\n (127.425317, 67.603017, 128.317904, 67.603017),\n (128.317904, 67.603017, 129.21049, 67.603017),\n (129.21049, 67.603017, 130.103077, 67.603017),\n (130.103077, 67.603017, 130.995664, 67.603017),\n (130.995664, 67.603017, 131.888251, 67.603017),\n (131.888251, 67.603017, 132.780838, 67.603017),\n (132.780838, 67.603017, 133.673425, 67.603017),\n (133.673425, 67.603017, 134.566012, 67.603017),\n (134.566012, 67.603017, 135.458598, 67.603017),\n (135.458598, 67.603017, 136.351185, 67.603017),\n (136.351185, 67.603017, 137.243772, 67.603017),\n (137.243772, 67.603017, 138.136359, 67.603017),\n (138.136359, 67.603017, 139.028946, 67.603017),\n (139.028946, 67.603017, 139.921533, 67.603017),\n (139.921533, 67.603017, 140.81412, 67.603017),\n (140.81412, 67.603017, 141.706706, 67.603017),\n (141.706706, 67.603017, 142.599293, 67.603017),\n (142.599293, 67.603017, 143.49188, 67.603017),\n (143.49188, 67.603017, 144.384467, 67.603017),\n (144.384467, 67.603017, 145.277054, 67.603017),\n (145.277054, 67.603017, 146.169641, 67.603017),\n (146.169641, 67.603017, 147.062228, 67.603017),\n (147.062228, 67.603017, 147.954815, 67.603017),\n (147.954815, 61.950075, 147.954815, 67.603017),\n (119.392035, 61.950075, 120.284622, 61.950075),\n (120.284622, 61.950075, 121.177209, 61.950075),\n (121.177209, 61.950075, 122.069795, 61.950075),\n (122.069795, 61.950075, 122.962382, 61.950075),\n (122.962382, 61.950075, 123.854969, 61.950075),\n (123.854969, 61.950075, 124.747556, 61.950075),\n (124.747556, 61.950075, 125.640143, 61.950075),\n (125.640143, 61.950075, 126.53273, 61.950075),\n (126.53273, 61.950075, 127.425317, 61.950075),\n (127.425317, 61.950075, 128.317904, 61.950075),\n (128.317904, 61.950075, 129.21049, 61.950075),\n (129.21049, 61.950075, 130.103077, 61.950075),\n (130.103077, 61.950075, 130.995664, 61.950075),\n (130.995664, 61.950075, 131.888251, 61.950075),\n (131.888251, 61.950075, 132.780838, 61.950075),\n (132.780838, 61.950075, 133.673425, 61.950075),\n (133.673425, 61.950075, 134.566012, 61.950075),\n (134.566012, 61.950075, 135.458598, 61.950075),\n (135.458598, 61.950075, 136.351185, 61.950075),\n (136.351185, 61.950075, 137.243772, 61.950075),\n (137.243772, 61.950075, 138.136359, 61.950075),\n (138.136359, 61.950075, 139.028946, 61.950075),\n (139.028946, 61.950075, 139.921533, 61.950075),\n (139.921533, 61.950075, 140.81412, 61.950075),\n (140.81412, 61.950075, 141.706706, 61.950075),\n (141.706706, 61.950075, 142.599293, 61.950075),\n (142.599293, 61.950075, 143.49188, 61.950075),\n (143.49188, 61.950075, 144.384467, 61.950075),\n (144.384467, 61.950075, 145.277054, 61.950075),\n (145.277054, 61.950075, 146.169641, 61.950075),\n (146.169641, 61.950075, 147.062228, 61.950075),\n (147.062228, 61.950075, 147.954815, 61.950075),\n (119.392035, 67.603017, 119.392035, 61.950075),\n (167.607756, 172.050076, 161.954815, 172.050076),\n (167.607756, 81.603017, 161.954815, 81.603017),\n (161.954815, 81.603017, 161.954815, 172.050076),\n (167.607756, 81.603017, 167.607756, 172.050076)\n]\nVISIBLE_CIRCLES = [\n (133.6737, 104.4528, 5.712446)\n]\nVISIBLE_ARCS = [\n (133.685386, 171.92462, 14.293351, 179.497098, -3.315402)\n]\nHIDDEN_SEGMENTS = [\n (139.3861, 61.95, 139.3861, 67.6029),\n (127.9612, 67.6029, 127.9612, 61.95),\n (167.6077, 171.0979, 161.9548, 171.0979),\n (161.9548, 157.6312, 167.6077, 157.6312),\n (161.9548, 98.7403, 167.6077, 98.7403),\n (161.9548, 110.1652, 167.6077, 110.1652)\n]\n# (orient, text, p1, p2, base) for linear; (orient, text, center, radius, angle) for diameter\nDIMENSIONS = [\n ('horizontal', '31.5789', (147.9547, 81.6029), (119.3926, 81.6029), (133.6736, 70.6029)),\n ('vertical', '98.9474', (147.9547, 171.098), (147.9547, 81.6029), (158.9547, 126.3504)),\n ('vertical', '100', (119.3926, 81.6029), (119.3926, 172.05), (108.3926, 126.8265)),\n ('diameter', '%%c12.6316', (133.6737, 104.4528), 5.7125, 45),\n ('horizontal', '15.7895', (119.3926, 104.4528), (133.6737, 104.4528), (126.5331, 115.4528)),\n ('vertical', '74.7368', (133.6737, 172.05), (133.6737, 104.4528), (144.6737, 138.2514)),\n ('radius', 'R15.803', (133.6854, 171.9246), 14.2933, 45),\n ('horizontal', '6.25', (167.6077, 171.098), (161.9548, 171.098), (164.7813, 160.098))\n]\n\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; _ds.dxf.dimasz = 2.5\n _ds.dxf.dimexe = 1.25; _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\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\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,\n angle=(0 if d[0] == \"horizontal\" else 90),\n 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,\n 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,\n 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,\n text=text, dimstyle=\"EZDXF\").render()\n\n doc.saveas(out_path)\n\n\nif __name__ == \"__main__\":\n out = sys.argv[1] if len(sys.argv) > 1 else \"0046_00465901_gt.dxf\"\n draw(out)\n print(\"wrote\", out)\n```"}], "images": ["images/0046_00465901.png"], "id": "0046_00465901"} {"messages": [{"role": "user", "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 22.95 mm. It is extruded to a thickness of 32.26 mm. The outline includes one or more oblique (angled) edges."}, {"role": "assistant", "content": "```python\n#!/usr/bin/env python3\n# -*- coding: utf-8 -*-\n# Ground-truth 2D engineering drawing for part: 0047_00470826\n# Self-contained: reproduces the three-view DXF via ezdxf, NO FreeCAD needed.\n# Coordinates are A4 page millimetres (scale=0.5099082153817746, page=[297.0, 210.0]).\n# visible edges -> solid (layer OUTLINE); hidden edges -> dashed (layer HIDDEN)\n# dimensions -> real movable DIMENSION entities (text = true mm value)\n# Run: python 0047_00470826_gt.py [out.dxf]\nimport sys\nimport ezdxf\nimport math\n\nSCALE = 0.5099082153817746\nPAGE = [297.0, 210.0]\n\nVISIBLE_SEGMENTS = [\n (113.644728, 93.504161, 113.644728, 143.659068),\n (113.644728, 143.659068, 142.901757, 143.659068),\n (142.901757, 143.659068, 142.901757, 93.504161),\n (142.901757, 93.504161, 150.424993, 93.504161),\n (150.424993, 93.504161, 150.424993, 144.494983),\n (147.081332, 155.361879, 137.050351, 168.736521),\n (119.496134, 168.736521, 109.465153, 155.361879),\n (106.121492, 144.494983, 106.121492, 93.504161),\n (106.121492, 93.504161, 113.644728, 93.504161),\n (150.428826, 79.504161, 150.324217, 79.504161),\n (150.324217, 79.504161, 150.219608, 79.504161),\n (150.219608, 79.504161, 150.114999, 79.504161),\n (150.114999, 79.504161, 150.01039, 79.504161),\n (150.01039, 79.504161, 149.90578, 79.504161),\n (149.90578, 79.504161, 149.801171, 79.504161),\n (149.801171, 79.504161, 149.696562, 79.504161),\n (149.696562, 79.504161, 149.591953, 79.504161),\n (149.591953, 79.504161, 149.487344, 79.504161),\n (149.487344, 79.504161, 149.382735, 79.504161),\n (149.382735, 79.504161, 149.278125, 79.504161),\n (149.278125, 79.504161, 149.173516, 79.504161),\n (149.173516, 79.504161, 149.068907, 79.504161),\n (149.068907, 79.504161, 148.964298, 79.504161),\n (148.964298, 79.504161, 148.859689, 79.504161),\n (148.859689, 79.504161, 148.755079, 79.504161),\n (148.755079, 79.504161, 148.65047, 79.504161),\n (148.65047, 79.504161, 148.545861, 79.504161),\n (148.545861, 79.504161, 148.441252, 79.504161),\n (148.441252, 79.504161, 148.336643, 79.504161),\n (148.336643, 79.504161, 148.232033, 79.504161),\n (148.232033, 79.504161, 148.127424, 79.504161),\n (148.127424, 79.504161, 148.022815, 79.504161),\n (148.022815, 79.504161, 147.918206, 79.504161),\n (147.918206, 79.504161, 147.813597, 79.504161),\n (147.813597, 79.504161, 147.708987, 79.504161),\n (147.708987, 79.504161, 147.604378, 79.504161),\n (147.604378, 79.504161, 147.499769, 79.504161),\n (147.499769, 79.504161, 147.39516, 79.504161),\n (147.39516, 79.504161, 147.290551, 79.504161),\n (147.290551, 79.504161, 147.185942, 79.504161),\n (147.185942, 79.504161, 147.081332, 79.504161),\n (147.081332, 79.504161, 147.081332, 63.054546),\n (150.428826, 63.054546, 150.324217, 63.054546),\n (150.324217, 63.054546, 150.219608, 63.054546),\n (150.219608, 63.054546, 150.114999, 63.054546),\n (150.114999, 63.054546, 150.01039, 63.054546),\n (150.01039, 63.054546, 149.90578, 63.054546),\n (149.90578, 63.054546, 149.801171, 63.054546),\n (149.801171, 63.054546, 149.696562, 63.054546),\n (149.696562, 63.054546, 149.591953, 63.054546),\n (149.591953, 63.054546, 149.487344, 63.054546),\n (149.487344, 63.054546, 149.382735, 63.054546),\n (149.382735, 63.054546, 149.278125, 63.054546),\n (149.278125, 63.054546, 149.173516, 63.054546),\n (149.173516, 63.054546, 149.068907, 63.054546),\n (149.068907, 63.054546, 148.964298, 63.054546),\n (148.964298, 63.054546, 148.859689, 63.054546),\n (148.859689, 63.054546, 148.755079, 63.054546),\n (148.755079, 63.054546, 148.65047, 63.054546),\n (148.65047, 63.054546, 148.545861, 63.054546),\n (148.545861, 63.054546, 148.441252, 63.054546),\n (148.441252, 63.054546, 148.336643, 63.054546),\n (148.336643, 63.054546, 148.232033, 63.054546),\n (148.232033, 63.054546, 148.127424, 63.054546),\n (148.127424, 63.054546, 148.022815, 63.054546),\n (148.022815, 63.054546, 147.918206, 63.054546),\n (147.918206, 63.054546, 147.813597, 63.054546),\n (147.813597, 63.054546, 147.708987, 63.054546),\n (147.708987, 63.054546, 147.604378, 63.054546),\n (147.604378, 63.054546, 147.499769, 63.054546),\n (147.499769, 63.054546, 147.39516, 63.054546),\n (147.39516, 63.054546, 147.290551, 63.054546),\n (147.290551, 63.054546, 147.185942, 63.054546),\n (147.185942, 63.054546, 147.081332, 63.054546),\n (147.081332, 63.054546, 137.050351, 63.054546),\n (147.081332, 79.504161, 137.050351, 79.504161),\n (137.050351, 79.504161, 136.501782, 79.504161),\n (136.501782, 79.504161, 135.953212, 79.504161),\n (135.953212, 79.504161, 135.404643, 79.504161),\n (135.404643, 79.504161, 134.856074, 79.504161),\n (134.856074, 79.504161, 134.307505, 79.504161),\n (134.307505, 79.504161, 133.758935, 79.504161),\n (133.758935, 79.504161, 133.210366, 79.504161),\n (133.210366, 79.504161, 132.661797, 79.504161),\n (132.661797, 79.504161, 132.113227, 79.504161),\n (132.113227, 79.504161, 131.564658, 79.504161),\n (131.564658, 79.504161, 131.016089, 79.504161),\n (131.016089, 79.504161, 130.46752, 79.504161),\n (130.46752, 79.504161, 129.91895, 79.504161),\n (129.91895, 79.504161, 129.370381, 79.504161),\n (129.370381, 79.504161, 128.821812, 79.504161),\n (128.821812, 79.504161, 128.273242, 79.504161),\n (128.273242, 79.504161, 127.724673, 79.504161),\n (127.724673, 79.504161, 127.176104, 79.504161),\n (127.176104, 79.504161, 126.627535, 79.504161),\n (126.627535, 79.504161, 126.078965, 79.504161),\n (126.078965, 79.504161, 125.530396, 79.504161),\n (125.530396, 79.504161, 124.981827, 79.504161),\n (124.981827, 79.504161, 124.433257, 79.504161),\n (124.433257, 79.504161, 123.884688, 79.504161),\n (123.884688, 79.504161, 123.336119, 79.504161),\n (123.336119, 79.504161, 122.78755, 79.504161),\n (122.78755, 79.504161, 122.23898, 79.504161),\n (122.23898, 79.504161, 121.690411, 79.504161),\n (121.690411, 79.504161, 121.141842, 79.504161),\n (121.141842, 79.504161, 120.593272, 79.504161),\n (120.593272, 79.504161, 120.044703, 79.504161),\n (120.044703, 79.504161, 119.496134, 79.504161),\n (137.050351, 63.054546, 136.501782, 63.054546),\n (136.501782, 63.054546, 135.953212, 63.054546),\n (135.953212, 63.054546, 135.404643, 63.054546),\n (135.404643, 63.054546, 134.856074, 63.054546),\n (134.856074, 63.054546, 134.307505, 63.054546),\n (134.307505, 63.054546, 133.758935, 63.054546),\n (133.758935, 63.054546, 133.210366, 63.054546),\n (133.210366, 63.054546, 132.661797, 63.054546),\n (132.661797, 63.054546, 132.113227, 63.054546),\n (132.113227, 63.054546, 131.564658, 63.054546),\n (131.564658, 63.054546, 131.016089, 63.054546),\n (131.016089, 63.054546, 130.46752, 63.054546),\n (130.46752, 63.054546, 129.91895, 63.054546),\n (129.91895, 63.054546, 129.370381, 63.054546),\n (129.370381, 63.054546, 128.821812, 63.054546),\n (128.821812, 63.054546, 128.273242, 63.054546),\n (128.273242, 63.054546, 127.724673, 63.054546),\n (127.724673, 63.054546, 127.176104, 63.054546),\n (127.176104, 63.054546, 126.627535, 63.054546),\n (126.627535, 63.054546, 126.078965, 63.054546),\n (126.078965, 63.054546, 125.530396, 63.054546),\n (125.530396, 63.054546, 124.981827, 63.054546),\n (124.981827, 63.054546, 124.433257, 63.054546),\n (124.433257, 63.054546, 123.884688, 63.054546),\n (123.884688, 63.054546, 123.336119, 63.054546),\n (123.336119, 63.054546, 122.78755, 63.054546),\n (122.78755, 63.054546, 122.23898, 63.054546),\n (122.23898, 63.054546, 121.690411, 63.054546),\n (121.690411, 63.054546, 121.141842, 63.054546),\n (121.141842, 63.054546, 120.593272, 63.054546),\n (120.593272, 63.054546, 120.044703, 63.054546),\n (120.044703, 63.054546, 119.496134, 63.054546),\n (119.496134, 63.054546, 109.465153, 63.054546),\n (109.465153, 79.504161, 109.465153, 63.054546),\n (119.496134, 79.504161, 109.465153, 79.504161),\n (109.465153, 79.504161, 109.360543, 79.504161),\n (109.360543, 79.504161, 109.255934, 79.504161),\n (109.255934, 79.504161, 109.151325, 79.504161),\n (109.151325, 79.504161, 109.046716, 79.504161),\n (109.046716, 79.504161, 108.942107, 79.504161),\n (108.942107, 79.504161, 108.837497, 79.504161),\n (108.837497, 79.504161, 108.732888, 79.504161),\n (108.732888, 79.504161, 108.628279, 79.504161),\n (108.628279, 79.504161, 108.52367, 79.504161),\n (108.52367, 79.504161, 108.419061, 79.504161),\n (108.419061, 79.504161, 108.314451, 79.504161),\n (108.314451, 79.504161, 108.209842, 79.504161),\n (108.209842, 79.504161, 108.105233, 79.504161),\n (108.105233, 79.504161, 108.000624, 79.504161),\n (108.000624, 79.504161, 107.896015, 79.504161),\n (107.896015, 79.504161, 107.791405, 79.504161),\n (107.791405, 79.504161, 107.686796, 79.504161),\n (107.686796, 79.504161, 107.582187, 79.504161),\n (107.582187, 79.504161, 107.477578, 79.504161),\n (107.477578, 79.504161, 107.372969, 79.504161),\n (107.372969, 79.504161, 107.26836, 79.504161),\n (107.26836, 79.504161, 107.16375, 79.504161),\n (107.16375, 79.504161, 107.059141, 79.504161),\n (107.059141, 79.504161, 106.954532, 79.504161),\n (106.954532, 79.504161, 106.849923, 79.504161),\n (106.849923, 79.504161, 106.745314, 79.504161),\n (106.745314, 79.504161, 106.640704, 79.504161),\n (106.640704, 79.504161, 106.536095, 79.504161),\n (106.536095, 79.504161, 106.431486, 79.504161),\n (106.431486, 79.504161, 106.326877, 79.504161),\n (106.326877, 79.504161, 106.222268, 79.504161),\n (106.222268, 79.504161, 106.117658, 79.504161),\n (109.465153, 63.054546, 109.360543, 63.054546),\n (109.360543, 63.054546, 109.255934, 63.054546),\n (109.255934, 63.054546, 109.151325, 63.054546),\n (109.151325, 63.054546, 109.046716, 63.054546),\n (109.046716, 63.054546, 108.942107, 63.054546),\n (108.942107, 63.054546, 108.837497, 63.054546),\n (108.837497, 63.054546, 108.732888, 63.054546),\n (108.732888, 63.054546, 108.628279, 63.054546),\n (108.628279, 63.054546, 108.52367, 63.054546),\n (108.52367, 63.054546, 108.419061, 63.054546),\n (108.419061, 63.054546, 108.314451, 63.054546),\n (108.314451, 63.054546, 108.209842, 63.054546),\n (108.209842, 63.054546, 108.105233, 63.054546),\n (108.105233, 63.054546, 108.000624, 63.054546),\n (108.000624, 63.054546, 107.896015, 63.054546),\n (107.896015, 63.054546, 107.791405, 63.054546),\n (107.791405, 63.054546, 107.686796, 63.054546),\n (107.686796, 63.054546, 107.582187, 63.054546),\n (107.582187, 63.054546, 107.477578, 63.054546),\n (107.477578, 63.054546, 107.372969, 63.054546),\n (107.372969, 63.054546, 107.26836, 63.054546),\n (107.26836, 63.054546, 107.16375, 63.054546),\n (107.16375, 63.054546, 107.059141, 63.054546),\n (107.059141, 63.054546, 106.954532, 63.054546),\n (106.954532, 63.054546, 106.849923, 63.054546),\n (106.849923, 63.054546, 106.745314, 63.054546),\n (106.745314, 63.054546, 106.640704, 63.054546),\n (106.640704, 63.054546, 106.536095, 63.054546),\n (106.536095, 63.054546, 106.431486, 63.054546),\n (106.431486, 63.054546, 106.326877, 63.054546),\n (106.326877, 63.054546, 106.222268, 63.054546),\n (106.222268, 63.054546, 106.117658, 63.054546),\n (150.428826, 63.054546, 150.428826, 79.504161),\n (106.117658, 63.054546, 106.117658, 79.504161),\n (137.050351, 79.504161, 137.050351, 63.054546),\n (119.496134, 79.504161, 119.496134, 63.054546),\n (164.428827, 173.154546, 164.428827, 173.016483),\n (164.428827, 173.016483, 164.428827, 172.878419),\n (164.428827, 172.878419, 164.428827, 172.740356),\n (164.428827, 172.740356, 164.428827, 172.602293),\n (164.428827, 172.602293, 164.428827, 172.46423),\n (164.428827, 172.46423, 164.428827, 172.326166),\n (164.428827, 172.326166, 164.428827, 172.188103),\n (164.428827, 172.188103, 164.428827, 172.05004),\n (164.428827, 172.05004, 164.428827, 171.911976),\n (164.428827, 171.911976, 164.428827, 171.773913),\n (164.428827, 171.773913, 164.428827, 171.63585),\n (164.428827, 171.63585, 164.428827, 171.497787),\n (164.428827, 171.497787, 164.428827, 171.359723),\n (164.428827, 171.359723, 164.428827, 171.22166),\n (164.428827, 171.22166, 164.428827, 171.083597),\n (164.428827, 171.083597, 164.428827, 170.945533),\n (164.428827, 170.945533, 164.428827, 170.80747),\n (164.428827, 170.80747, 164.428827, 170.669407),\n (164.428827, 170.669407, 164.428827, 170.531344),\n (164.428827, 170.531344, 164.428827, 170.39328),\n (164.428827, 170.39328, 164.428827, 170.255217),\n (164.428827, 170.255217, 164.428827, 170.117154),\n (164.428827, 170.117154, 164.428827, 169.97909),\n (164.428827, 169.97909, 164.428827, 169.841027),\n (164.428827, 169.841027, 164.428827, 169.702964),\n (164.428827, 169.702964, 164.428827, 169.564901),\n (164.428827, 169.564901, 164.428827, 169.426837),\n (164.428827, 169.426837, 164.428827, 169.288774),\n (164.428827, 169.288774, 164.428827, 169.150711),\n (164.428827, 169.150711, 164.428827, 169.012647),\n (164.428827, 169.012647, 164.428827, 168.874584),\n (164.428827, 168.874584, 164.428827, 168.736521),\n (180.878442, 173.154546, 180.878442, 173.016483),\n (180.878442, 173.016483, 180.878442, 172.878419),\n (180.878442, 172.878419, 180.878442, 172.740356),\n (180.878442, 172.740356, 180.878442, 172.602293),\n (180.878442, 172.602293, 180.878442, 172.46423),\n (180.878442, 172.46423, 180.878442, 172.326166),\n (180.878442, 172.326166, 180.878442, 172.188103),\n (180.878442, 172.188103, 180.878442, 172.05004),\n (180.878442, 172.05004, 180.878442, 171.911976),\n (180.878442, 171.911976, 180.878442, 171.773913),\n (180.878442, 171.773913, 180.878442, 171.63585),\n (180.878442, 171.63585, 180.878442, 171.497787),\n (180.878442, 171.497787, 180.878442, 171.359723),\n (180.878442, 171.359723, 180.878442, 171.22166),\n (180.878442, 171.22166, 180.878442, 171.083597),\n (180.878442, 171.083597, 180.878442, 170.945533),\n (180.878442, 170.945533, 180.878442, 170.80747),\n (180.878442, 170.80747, 180.878442, 170.669407),\n (180.878442, 170.669407, 180.878442, 170.531344),\n (180.878442, 170.531344, 180.878442, 170.39328),\n (180.878442, 170.39328, 180.878442, 170.255217),\n (180.878442, 170.255217, 180.878442, 170.117154),\n (180.878442, 170.117154, 180.878442, 169.97909),\n (180.878442, 169.97909, 180.878442, 169.841027),\n (180.878442, 169.841027, 180.878442, 169.702964),\n (180.878442, 169.702964, 180.878442, 169.564901),\n (180.878442, 169.564901, 180.878442, 169.426837),\n (180.878442, 169.426837, 180.878442, 169.288774),\n (180.878442, 169.288774, 180.878442, 169.150711),\n (180.878442, 169.150711, 180.878442, 169.012647),\n (180.878442, 169.012647, 180.878442, 168.874584),\n (180.878442, 168.874584, 180.878442, 168.736521),\n (180.878442, 168.736521, 180.878442, 155.361879),\n (164.428827, 155.361879, 180.878442, 155.361879),\n (164.428827, 168.736521, 164.428827, 155.361879),\n (164.428827, 155.361879, 164.428827, 155.022289),\n (164.428827, 155.022289, 164.428827, 154.682698),\n (164.428827, 154.682698, 164.428827, 154.343108),\n (164.428827, 154.343108, 164.428827, 154.003517),\n (164.428827, 154.003517, 164.428827, 153.663927),\n (164.428827, 153.663927, 164.428827, 153.324336),\n (164.428827, 153.324336, 164.428827, 152.984746),\n (164.428827, 152.984746, 164.428827, 152.645155),\n (164.428827, 152.645155, 164.428827, 152.305565),\n (164.428827, 152.305565, 164.428827, 151.965974),\n (164.428827, 151.965974, 164.428827, 151.626384),\n (164.428827, 151.626384, 164.428827, 151.286793),\n (164.428827, 151.286793, 164.428827, 150.947202),\n (164.428827, 150.947202, 164.428827, 150.607612),\n (164.428827, 150.607612, 164.428827, 150.268021),\n (164.428827, 150.268021, 164.428827, 149.928431),\n (164.428827, 149.928431, 164.428827, 149.58884),\n (164.428827, 149.58884, 164.428827, 149.24925),\n (164.428827, 149.24925, 164.428827, 148.909659),\n (164.428827, 148.909659, 164.428827, 148.570069),\n (164.428827, 148.570069, 164.428827, 148.230478),\n (164.428827, 148.230478, 164.428827, 147.890888),\n (164.428827, 147.890888, 164.428827, 147.551297),\n (164.428827, 147.551297, 164.428827, 147.211707),\n (164.428827, 147.211707, 164.428827, 146.872116),\n (164.428827, 146.872116, 164.428827, 146.532526),\n (164.428827, 146.532526, 164.428827, 146.192935),\n (164.428827, 146.192935, 164.428827, 145.853345),\n (164.428827, 145.853345, 164.428827, 145.513754),\n (164.428827, 145.513754, 164.428827, 145.174164),\n (164.428827, 145.174164, 164.428827, 144.834573),\n (164.428827, 144.834573, 164.428827, 144.494983),\n (164.428827, 144.494983, 180.878442, 144.494983),\n (180.878442, 155.361879, 180.878442, 155.022289),\n (180.878442, 155.022289, 180.878442, 154.682698),\n (180.878442, 154.682698, 180.878442, 154.343108),\n (180.878442, 154.343108, 180.878442, 154.003517),\n (180.878442, 154.003517, 180.878442, 153.663927),\n (180.878442, 153.663927, 180.878442, 153.324336),\n (180.878442, 153.324336, 180.878442, 152.984746),\n (180.878442, 152.984746, 180.878442, 152.645155),\n (180.878442, 152.645155, 180.878442, 152.305565),\n (180.878442, 152.305565, 180.878442, 151.965974),\n (180.878442, 151.965974, 180.878442, 151.626384),\n (180.878442, 151.626384, 180.878442, 151.286793),\n (180.878442, 151.286793, 180.878442, 150.947202),\n (180.878442, 150.947202, 180.878442, 150.607612),\n (180.878442, 150.607612, 180.878442, 150.268021),\n (180.878442, 150.268021, 180.878442, 149.928431),\n (180.878442, 149.928431, 180.878442, 149.58884),\n (180.878442, 149.58884, 180.878442, 149.24925),\n (180.878442, 149.24925, 180.878442, 148.909659),\n (180.878442, 148.909659, 180.878442, 148.570069),\n (180.878442, 148.570069, 180.878442, 148.230478),\n (180.878442, 148.230478, 180.878442, 147.890888),\n (180.878442, 147.890888, 180.878442, 147.551297),\n (180.878442, 147.551297, 180.878442, 147.211707),\n (180.878442, 147.211707, 180.878442, 146.872116),\n (180.878442, 146.872116, 180.878442, 146.532526),\n (180.878442, 146.532526, 180.878442, 146.192935),\n (180.878442, 146.192935, 180.878442, 145.853345),\n (180.878442, 145.853345, 180.878442, 145.513754),\n (180.878442, 145.513754, 180.878442, 145.174164),\n (180.878442, 145.174164, 180.878442, 144.834573),\n (180.878442, 144.834573, 180.878442, 144.494983),\n (180.878442, 144.494983, 180.878442, 93.504161),\n (164.428827, 93.504161, 180.878442, 93.504161),\n (164.428827, 144.494983, 164.428827, 93.504161),\n (180.878442, 173.154546, 164.428827, 173.154546),\n (164.428827, 168.736521, 180.878442, 168.736521)\n]\nVISIBLE_CIRCLES = [\n (128.6912, 162.0492, 5.851406)\n]\nVISIBLE_ARCS = [\n (132.30588, 144.867729, 18.122946, -1.178521, 35.383979),\n (128.273242, 162.226973, 10.927573, 36.5625, 143.4375),\n (124.240605, 144.867729, 18.122946, 144.616021, -178.821479)\n]\nHIDDEN_SEGMENTS = [\n (113.6448, 79.5041, 113.6448, 63.0545),\n (142.9018, 79.5041, 142.9018, 63.0545),\n (134.5426, 79.5041, 134.5426, 63.0545),\n (122.8398, 63.0545, 122.8398, 79.5041),\n (164.4289, 143.659, 180.8785, 143.659),\n (180.8785, 167.9006, 164.4289, 167.9006),\n (180.8785, 156.1978, 164.4289, 156.1978)\n]\n# (orient, text, p1, p2, base) for linear; (orient, text, center, radius, angle) for diameter\nDIMENSIONS = [\n ('horizontal', '14.7541', (142.9018, 93.5041), (150.425, 93.5041), (146.6634, 104.5041)),\n ('horizontal', '34.4262', (137.0504, 168.7365), (119.4961, 168.7365), (128.2733, 157.7365)),\n ('horizontal', '57.377', (113.6447, 143.659), (142.9018, 143.659), (128.2733, 154.659)),\n ('vertical', '98.3607', (113.6447, 93.5041), (113.6447, 143.659), (102.6447, 118.5816)),\n ('vertical', '100', (150.425, 93.5041), (150.425, 144.495), (139.425, 118.9996)),\n ('aligned', '32.7869', (147.0814, 155.3618), (137.0504, 168.7365), (133.2659, 155.4491)),\n ('aligned', '32.7869', (119.4961, 168.7365), (109.4652, 155.3618), (123.2807, 155.4491)),\n ('diameter', '%%c22.9508', (128.6912, 162.0492), 5.8514, 45),\n ('horizontal', '44.2623', (106.1215, 162.0492), (128.6912, 162.0492), (117.4064, 173.0492)),\n ('vertical', '134.426', (128.6912, 93.5041), (128.6912, 162.0492), (117.6912, 127.7767)),\n ('radius', 'R35.5416', (132.3059, 144.8677), 18.123, 45),\n ('radius', 'R21.4305', (128.2733, 162.2269), 10.9276, 135),\n ('horizontal', '32.26', (164.4289, 93.5041), (180.8785, 93.5041), (172.6537, 104.5041))\n]\n\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; _ds.dxf.dimasz = 2.5\n _ds.dxf.dimexe = 1.25; _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\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\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,\n angle=(0 if d[0] == \"horizontal\" else 90),\n 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,\n 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,\n 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,\n text=text, dimstyle=\"EZDXF\").render()\n\n doc.saveas(out_path)\n\n\nif __name__ == \"__main__\":\n out = sys.argv[1] if len(sys.argv) > 1 else \"0047_00470826_gt.dxf\"\n draw(out)\n print(\"wrote\", out)\n```"}], "images": ["images/0047_00470826.png"], "id": "0047_00470826"} {"messages": [{"role": "user", "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 63.16 x 100 mm bounding box, featuring a circular hole of diameter 50.53 mm. It is extruded to a thickness of 33.55 mm."}, {"role": "assistant", "content": "```python\n#!/usr/bin/env python3\n# -*- coding: utf-8 -*-\n# Ground-truth 2D engineering drawing for part: 0048_00481396\n# Self-contained: reproduces the three-view DXF via ezdxf, NO FreeCAD needed.\n# Coordinates are A4 page millimetres (scale=0.7195665024630561, page=[297.0, 210.0]).\n# visible edges -> solid (layer OUTLINE); hidden edges -> dashed (layer HIDDEN)\n# dimensions -> real movable DIMENSION entities (text = true mm value)\n# Run: python 0048_00481396_gt.py [out.dxf]\nimport sys\nimport ezdxf\nimport math\n\nSCALE = 0.7195665024630561\nPAGE = [297.0, 210.0]\n\nVISIBLE_SEGMENTS = [\n (156.146105, 100.093356, 156.146105, 118.271878),\n (156.146105, 118.271878, 144.027091, 118.271878),\n (144.027091, 118.271878, 144.027091, 153.871484),\n (144.027091, 153.871484, 156.146105, 153.871484),\n (156.146105, 153.871484, 156.146105, 172.050006),\n (156.146105, 172.050006, 110.6998, 172.050006),\n (110.6998, 100.093356, 156.146105, 100.093356),\n (156.146105, 86.093355, 156.146105, 61.950006),\n (156.146105, 61.950006, 110.6998, 61.950006),\n (156.146105, 86.093355, 110.6998, 86.093355),\n (110.6998, 86.093355, 109.575477, 86.093355),\n (109.575477, 86.093355, 108.451155, 86.093355),\n (108.451155, 86.093355, 107.326832, 86.093355),\n (107.326832, 86.093355, 106.202509, 86.093355),\n (106.202509, 86.093355, 105.078187, 86.093355),\n (105.078187, 86.093355, 103.953864, 86.093355),\n (103.953864, 86.093355, 102.829541, 86.093355),\n (102.829541, 86.093355, 101.705219, 86.093355),\n (101.705219, 86.093355, 100.580896, 86.093355),\n (100.580896, 86.093355, 99.456573, 86.093355),\n (99.456573, 86.093355, 98.332251, 86.093355),\n (98.332251, 86.093355, 97.207928, 86.093355),\n (97.207928, 86.093355, 96.083605, 86.093355),\n (96.083605, 86.093355, 94.959283, 86.093355),\n (94.959283, 86.093355, 93.83496, 86.093355),\n (93.83496, 86.093355, 92.710637, 86.093355),\n (92.710637, 86.093355, 91.586315, 86.093355),\n (91.586315, 86.093355, 90.461992, 86.093355),\n (90.461992, 86.093355, 89.337669, 86.093355),\n (89.337669, 86.093355, 88.213347, 86.093355),\n (88.213347, 86.093355, 87.089024, 86.093355),\n (87.089024, 86.093355, 85.964701, 86.093355),\n (85.964701, 86.093355, 84.840379, 86.093355),\n (84.840379, 86.093355, 83.716056, 86.093355),\n (83.716056, 86.093355, 82.591733, 86.093355),\n (82.591733, 86.093355, 81.467411, 86.093355),\n (81.467411, 86.093355, 80.343088, 86.093355),\n (80.343088, 86.093355, 79.218766, 86.093355),\n (79.218766, 86.093355, 78.094443, 86.093355),\n (78.094443, 86.093355, 76.97012, 86.093355),\n (76.97012, 86.093355, 75.845798, 86.093355),\n (75.845798, 86.093355, 74.721475, 86.093355),\n (110.6998, 61.950006, 109.575477, 61.950006),\n (109.575477, 61.950006, 108.451155, 61.950006),\n (108.451155, 61.950006, 107.326832, 61.950006),\n (107.326832, 61.950006, 106.202509, 61.950006),\n (106.202509, 61.950006, 105.078187, 61.950006),\n (105.078187, 61.950006, 103.953864, 61.950006),\n (103.953864, 61.950006, 102.829541, 61.950006),\n (102.829541, 61.950006, 101.705219, 61.950006),\n (101.705219, 61.950006, 100.580896, 61.950006),\n (100.580896, 61.950006, 99.456573, 61.950006),\n (99.456573, 61.950006, 98.332251, 61.950006),\n (98.332251, 61.950006, 97.207928, 61.950006),\n (97.207928, 61.950006, 96.083605, 61.950006),\n (96.083605, 61.950006, 94.959283, 61.950006),\n (94.959283, 61.950006, 93.83496, 61.950006),\n (93.83496, 61.950006, 92.710637, 61.950006),\n (92.710637, 61.950006, 91.586315, 61.950006),\n (91.586315, 61.950006, 90.461992, 61.950006),\n (90.461992, 61.950006, 89.337669, 61.950006),\n (89.337669, 61.950006, 88.213347, 61.950006),\n (88.213347, 61.950006, 87.089024, 61.950006),\n (87.089024, 61.950006, 85.964701, 61.950006),\n (85.964701, 61.950006, 84.840379, 61.950006),\n (84.840379, 61.950006, 83.716056, 61.950006),\n (83.716056, 61.950006, 82.591733, 61.950006),\n (82.591733, 61.950006, 81.467411, 61.950006),\n (81.467411, 61.950006, 80.343088, 61.950006),\n (80.343088, 61.950006, 79.218766, 61.950006),\n (79.218766, 61.950006, 78.094443, 61.950006),\n (78.094443, 61.950006, 76.97012, 61.950006),\n (76.97012, 61.950006, 75.845798, 61.950006),\n (75.845798, 61.950006, 74.721475, 61.950006),\n (74.721475, 61.950006, 74.721475, 86.093355),\n (110.6998, 86.093355, 110.6998, 61.950006),\n (170.146106, 172.050006, 194.289455, 172.050006),\n (170.146106, 172.050006, 170.146106, 169.801361),\n (170.146106, 169.801361, 170.146106, 167.552715),\n (170.146106, 167.552715, 170.146106, 165.30407),\n (170.146106, 165.30407, 170.146106, 163.055425),\n (170.146106, 163.055425, 170.146106, 160.806779),\n (170.146106, 160.806779, 170.146106, 158.558134),\n (170.146106, 158.558134, 170.146106, 156.309489),\n (170.146106, 156.309489, 170.146106, 154.060843),\n (170.146106, 154.060843, 170.146106, 151.812198),\n (170.146106, 151.812198, 170.146106, 149.563553),\n (170.146106, 149.563553, 170.146106, 147.314907),\n (170.146106, 147.314907, 170.146106, 145.066262),\n (170.146106, 145.066262, 170.146106, 142.817617),\n (170.146106, 142.817617, 170.146106, 140.568971),\n (170.146106, 140.568971, 170.146106, 138.320326),\n (170.146106, 138.320326, 170.146106, 136.071681),\n (170.146106, 136.071681, 170.146106, 133.823035),\n (170.146106, 133.823035, 170.146106, 131.57439),\n (170.146106, 131.57439, 170.146106, 129.325745),\n (170.146106, 129.325745, 170.146106, 127.0771),\n (170.146106, 127.0771, 170.146106, 124.828454),\n (170.146106, 124.828454, 170.146106, 122.579809),\n (170.146106, 122.579809, 170.146106, 120.331164),\n (170.146106, 120.331164, 170.146106, 118.082518),\n (170.146106, 118.082518, 170.146106, 115.833873),\n (170.146106, 115.833873, 170.146106, 113.585228),\n (170.146106, 113.585228, 170.146106, 111.336582),\n (170.146106, 111.336582, 170.146106, 109.087937),\n (170.146106, 109.087937, 170.146106, 106.839292),\n (170.146106, 106.839292, 170.146106, 104.590646),\n (170.146106, 104.590646, 170.146106, 102.342001),\n (170.146106, 102.342001, 170.146106, 100.093356),\n (170.146106, 100.093356, 194.289455, 100.093356),\n (194.289455, 172.050006, 194.289455, 169.801361),\n (194.289455, 169.801361, 194.289455, 167.552715),\n (194.289455, 167.552715, 194.289455, 165.30407),\n (194.289455, 165.30407, 194.289455, 163.055425),\n (194.289455, 163.055425, 194.289455, 160.806779),\n (194.289455, 160.806779, 194.289455, 158.558134),\n (194.289455, 158.558134, 194.289455, 156.309489),\n (194.289455, 156.309489, 194.289455, 154.060843),\n (194.289455, 154.060843, 194.289455, 151.812198),\n (194.289455, 151.812198, 194.289455, 149.563553),\n (194.289455, 149.563553, 194.289455, 147.314907),\n (194.289455, 147.314907, 194.289455, 145.066262),\n (194.289455, 145.066262, 194.289455, 142.817617),\n (194.289455, 142.817617, 194.289455, 140.568971),\n (194.289455, 140.568971, 194.289455, 138.320326),\n (194.289455, 138.320326, 194.289455, 136.071681),\n (194.289455, 136.071681, 194.289455, 133.823035),\n (194.289455, 133.823035, 194.289455, 131.57439),\n (194.289455, 131.57439, 194.289455, 129.325745),\n (194.289455, 129.325745, 194.289455, 127.0771),\n (194.289455, 127.0771, 194.289455, 124.828454),\n (194.289455, 124.828454, 194.289455, 122.579809),\n (194.289455, 122.579809, 194.289455, 120.331164),\n (194.289455, 120.331164, 194.289455, 118.082518),\n (194.289455, 118.082518, 194.289455, 115.833873),\n (194.289455, 115.833873, 194.289455, 113.585228),\n (194.289455, 113.585228, 194.289455, 111.336582),\n (194.289455, 111.336582, 194.289455, 109.087937),\n (194.289455, 109.087937, 194.289455, 106.839292),\n (194.289455, 106.839292, 194.289455, 104.590646),\n (194.289455, 104.590646, 194.289455, 102.342001),\n (194.289455, 102.342001, 194.289455, 100.093356)\n]\nVISIBLE_CIRCLES = [\n (110.6998, 136.4504, 18.178522)\n]\nVISIBLE_ARCS = [\n (110.6998, 136.071681, 35.978325, 90.0, -90.0)\n]\nHIDDEN_SEGMENTS = [\n (144.027, 86.0933, 144.027, 61.95),\n (128.8783, 86.0933, 128.8783, 61.95),\n (92.5212, 61.95, 92.5212, 86.0933),\n (170.1461, 118.2719, 194.2894, 118.2719),\n (170.1461, 153.8715, 194.2894, 153.8715),\n (194.2894, 154.6289, 170.1461, 154.6289),\n (194.2894, 118.2719, 170.1461, 118.2719)\n]\n# (orient, text, p1, p2, base) for linear; (orient, text, center, radius, angle) for diameter\nDIMENSIONS = [\n ('horizontal', '16.8421', (156.1461, 118.2719), (144.0271, 118.2719), (150.0866, 107.2719)),\n ('horizontal', '63.1579', (156.1461, 172.05), (110.6998, 172.05), (133.4229, 161.05)),\n ('vertical', '25.2632', (156.1461, 100.0933), (156.1461, 118.2719), (145.1461, 109.1826)),\n ('vertical', '49.4737', (144.0271, 118.2719), (144.0271, 153.8714), (133.0271, 136.0717)),\n ('vertical', '100', (110.6998, 172.05), (110.6998, 100.0933), (121.6998, 136.0717)),\n ('diameter', '%%c50.5263', (110.6998, 136.4504), 18.1785, 45),\n ('vertical', '50.5263', (110.6998, 100.0933), (110.6998, 136.4504), (99.6998, 118.2719)),\n ('radius', 'R50', (110.6998, 136.0717), 35.9783, 135),\n ('horizontal', '33.5526', (170.1461, 100.0933), (194.2894, 100.0933), (182.2177, 111.0933))\n]\n\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; _ds.dxf.dimasz = 2.5\n _ds.dxf.dimexe = 1.25; _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\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\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,\n angle=(0 if d[0] == \"horizontal\" else 90),\n 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,\n 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,\n 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,\n text=text, dimstyle=\"EZDXF\").render()\n\n doc.saveas(out_path)\n\n\nif __name__ == \"__main__\":\n out = sys.argv[1] if len(sys.argv) > 1 else \"0048_00481396_gt.dxf\"\n draw(out)\n print(\"wrote\", out)\n```"}], "images": ["images/0048_00481396.png"], "id": "0048_00481396"} {"messages": [{"role": "user", "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 166.48 mm. The outline includes one or more oblique (angled) edges."}, {"role": "assistant", "content": "```python\n#!/usr/bin/env python3\n# -*- coding: utf-8 -*-\n# Ground-truth 2D engineering drawing for part: 0048_00483354\n# Self-contained: reproduces the three-view DXF via ezdxf, NO FreeCAD needed.\n# Coordinates are A4 page millimetres (scale=0.32529531465848294, page=[297.0, 210.0]).\n# visible edges -> solid (layer OUTLINE); hidden edges -> dashed (layer HIDDEN)\n# dimensions -> real movable DIMENSION entities (text = true mm value)\n# Run: python 0048_00483354_gt.py [out.dxf]\nimport sys\nimport ezdxf\nimport math\n\nSCALE = 0.32529531465848294\nPAGE = [297.0, 210.0]\n\nVISIBLE_SEGMENTS = [\n (99.035777, 172.048086, 119.415724, 172.048086),\n (124.510711, 167.345021, 124.510711, 134.81549),\n (119.415724, 130.112425, 99.035777, 130.112425),\n (94.332712, 134.81549, 94.332712, 167.345021),\n (124.510711, 61.952004, 124.510711, 116.108507),\n (124.510711, 61.952004, 124.351493, 61.952004),\n (124.351493, 61.952004, 124.192274, 61.952004),\n (124.192274, 61.952004, 124.033056, 61.952004),\n (124.033056, 61.952004, 123.873838, 61.952004),\n (123.873838, 61.952004, 123.714619, 61.952004),\n (123.714619, 61.952004, 123.555401, 61.952004),\n (123.555401, 61.952004, 123.396183, 61.952004),\n (123.396183, 61.952004, 123.236964, 61.952004),\n (123.236964, 61.952004, 123.077746, 61.952004),\n (123.077746, 61.952004, 122.918528, 61.952004),\n (122.918528, 61.952004, 122.759309, 61.952004),\n (122.759309, 61.952004, 122.600091, 61.952004),\n (122.600091, 61.952004, 122.440872, 61.952004),\n (122.440872, 61.952004, 122.281654, 61.952004),\n (122.281654, 61.952004, 122.122436, 61.952004),\n (122.122436, 61.952004, 121.963217, 61.952004),\n (121.963217, 61.952004, 121.803999, 61.952004),\n (121.803999, 61.952004, 121.644781, 61.952004),\n (121.644781, 61.952004, 121.485562, 61.952004),\n (121.485562, 61.952004, 121.326344, 61.952004),\n (121.326344, 61.952004, 121.167126, 61.952004),\n (121.167126, 61.952004, 121.007907, 61.952004),\n (121.007907, 61.952004, 120.848689, 61.952004),\n (120.848689, 61.952004, 120.689471, 61.952004),\n (120.689471, 61.952004, 120.530252, 61.952004),\n (120.530252, 61.952004, 120.371034, 61.952004),\n (120.371034, 61.952004, 120.211816, 61.952004),\n (120.211816, 61.952004, 120.052597, 61.952004),\n (120.052597, 61.952004, 119.893379, 61.952004),\n (119.893379, 61.952004, 119.734161, 61.952004),\n (119.734161, 61.952004, 119.574942, 61.952004),\n (119.574942, 61.952004, 119.415724, 61.952004),\n (119.415724, 61.952004, 119.415724, 116.108507),\n (124.510711, 116.108507, 124.351493, 116.108507),\n (124.351493, 116.108507, 124.192274, 116.108507),\n (124.192274, 116.108507, 124.033056, 116.108507),\n (124.033056, 116.108507, 123.873838, 116.108507),\n (123.873838, 116.108507, 123.714619, 116.108507),\n (123.714619, 116.108507, 123.555401, 116.108507),\n (123.555401, 116.108507, 123.396183, 116.108507),\n (123.396183, 116.108507, 123.236964, 116.108507),\n (123.236964, 116.108507, 123.077746, 116.108507),\n (123.077746, 116.108507, 122.918528, 116.108507),\n (122.918528, 116.108507, 122.759309, 116.108507),\n (122.759309, 116.108507, 122.600091, 116.108507),\n (122.600091, 116.108507, 122.440872, 116.108507),\n (122.440872, 116.108507, 122.281654, 116.108507),\n (122.281654, 116.108507, 122.122436, 116.108507),\n (122.122436, 116.108507, 121.963217, 116.108507),\n (121.963217, 116.108507, 121.803999, 116.108507),\n (121.803999, 116.108507, 121.644781, 116.108507),\n (121.644781, 116.108507, 121.485562, 116.108507),\n (121.485562, 116.108507, 121.326344, 116.108507),\n (121.326344, 116.108507, 121.167126, 116.108507),\n (121.167126, 116.108507, 121.007907, 116.108507),\n (121.007907, 116.108507, 120.848689, 116.108507),\n (120.848689, 116.108507, 120.689471, 116.108507),\n (120.689471, 116.108507, 120.530252, 116.108507),\n (120.530252, 116.108507, 120.371034, 116.108507),\n (120.371034, 116.108507, 120.211816, 116.108507),\n (120.211816, 116.108507, 120.052597, 116.108507),\n (120.052597, 116.108507, 119.893379, 116.108507),\n (119.893379, 116.108507, 119.734161, 116.108507),\n (119.734161, 116.108507, 119.574942, 116.108507),\n (119.574942, 116.108507, 119.415724, 116.108507),\n (119.415724, 116.108507, 99.035777, 116.108507),\n (119.415724, 61.952004, 99.035777, 61.952004),\n (99.035777, 61.952004, 98.888806, 61.952004),\n (98.888806, 61.952004, 98.741835, 61.952004),\n (98.741835, 61.952004, 98.594864, 61.952004),\n (98.594864, 61.952004, 98.447894, 61.952004),\n (98.447894, 61.952004, 98.300923, 61.952004),\n (98.300923, 61.952004, 98.153952, 61.952004),\n (98.153952, 61.952004, 98.006981, 61.952004),\n (98.006981, 61.952004, 97.86001, 61.952004),\n (97.86001, 61.952004, 97.71304, 61.952004),\n (97.71304, 61.952004, 97.566069, 61.952004),\n (97.566069, 61.952004, 97.419098, 61.952004),\n (97.419098, 61.952004, 97.272127, 61.952004),\n (97.272127, 61.952004, 97.125157, 61.952004),\n (97.125157, 61.952004, 96.978186, 61.952004),\n (96.978186, 61.952004, 96.831215, 61.952004),\n (96.831215, 61.952004, 96.684244, 61.952004),\n (96.684244, 61.952004, 96.537273, 61.952004),\n (96.537273, 61.952004, 96.390303, 61.952004),\n (96.390303, 61.952004, 96.243332, 61.952004),\n (96.243332, 61.952004, 96.096361, 61.952004),\n (96.096361, 61.952004, 95.94939, 61.952004),\n (95.94939, 61.952004, 95.80242, 61.952004),\n (95.80242, 61.952004, 95.655449, 61.952004),\n (95.655449, 61.952004, 95.508478, 61.952004),\n (95.508478, 61.952004, 95.361507, 61.952004),\n (95.361507, 61.952004, 95.214536, 61.952004),\n (95.214536, 61.952004, 95.067566, 61.952004),\n (95.067566, 61.952004, 94.920595, 61.952004),\n (94.920595, 61.952004, 94.773624, 61.952004),\n (94.773624, 61.952004, 94.626653, 61.952004),\n (94.626653, 61.952004, 94.479683, 61.952004),\n (94.479683, 61.952004, 94.332712, 61.952004),\n (94.332712, 61.952004, 94.332712, 116.108507),\n (99.035777, 116.108507, 98.888806, 116.108507),\n (98.888806, 116.108507, 98.741835, 116.108507),\n (98.741835, 116.108507, 98.594864, 116.108507),\n (98.594864, 116.108507, 98.447894, 116.108507),\n (98.447894, 116.108507, 98.300923, 116.108507),\n (98.300923, 116.108507, 98.153952, 116.108507),\n (98.153952, 116.108507, 98.006981, 116.108507),\n (98.006981, 116.108507, 97.86001, 116.108507),\n (97.86001, 116.108507, 97.71304, 116.108507),\n (97.71304, 116.108507, 97.566069, 116.108507),\n (97.566069, 116.108507, 97.419098, 116.108507),\n (97.419098, 116.108507, 97.272127, 116.108507),\n (97.272127, 116.108507, 97.125157, 116.108507),\n (97.125157, 116.108507, 96.978186, 116.108507),\n (96.978186, 116.108507, 96.831215, 116.108507),\n (96.831215, 116.108507, 96.684244, 116.108507),\n (96.684244, 116.108507, 96.537273, 116.108507),\n (96.537273, 116.108507, 96.390303, 116.108507),\n (96.390303, 116.108507, 96.243332, 116.108507),\n (96.243332, 116.108507, 96.096361, 116.108507),\n (96.096361, 116.108507, 95.94939, 116.108507),\n (95.94939, 116.108507, 95.80242, 116.108507),\n (95.80242, 116.108507, 95.655449, 116.108507),\n (95.655449, 116.108507, 95.508478, 116.108507),\n (95.508478, 116.108507, 95.361507, 116.108507),\n (95.361507, 116.108507, 95.214536, 116.108507),\n (95.214536, 116.108507, 95.067566, 116.108507),\n (95.067566, 116.108507, 94.920595, 116.108507),\n (94.920595, 116.108507, 94.773624, 116.108507),\n (94.773624, 116.108507, 94.626653, 116.108507),\n (94.626653, 116.108507, 94.479683, 116.108507),\n (94.479683, 116.108507, 94.332712, 116.108507),\n (99.035777, 61.952004, 99.035777, 116.108507),\n (138.510711, 167.345021, 138.510711, 167.491992),\n (138.510711, 167.491992, 138.510711, 167.638963),\n (138.510711, 167.638963, 138.510711, 167.785934),\n (138.510711, 167.785934, 138.510711, 167.932904),\n (138.510711, 167.932904, 138.510711, 168.079875),\n (138.510711, 168.079875, 138.510711, 168.226846),\n (138.510711, 168.226846, 138.510711, 168.373817),\n (138.510711, 168.373817, 138.510711, 168.520787),\n (138.510711, 168.520787, 138.510711, 168.667758),\n (138.510711, 168.667758, 138.510711, 168.814729),\n (138.510711, 168.814729, 138.510711, 168.9617),\n (138.510711, 168.9617, 138.510711, 169.108671),\n (138.510711, 169.108671, 138.510711, 169.255641),\n (138.510711, 169.255641, 138.510711, 169.402612),\n (138.510711, 169.402612, 138.510711, 169.549583),\n (138.510711, 169.549583, 138.510711, 169.696554),\n (138.510711, 169.696554, 138.510711, 169.843524),\n (138.510711, 169.843524, 138.510711, 169.990495),\n (138.510711, 169.990495, 138.510711, 170.137466),\n (138.510711, 170.137466, 138.510711, 170.284437),\n (138.510711, 170.284437, 138.510711, 170.431408),\n (138.510711, 170.431408, 138.510711, 170.578378),\n (138.510711, 170.578378, 138.510711, 170.725349),\n (138.510711, 170.725349, 138.510711, 170.87232),\n (138.510711, 170.87232, 138.510711, 171.019291),\n (138.510711, 171.019291, 138.510711, 171.166261),\n (138.510711, 171.166261, 138.510711, 171.313232),\n (138.510711, 171.313232, 138.510711, 171.460203),\n (138.510711, 171.460203, 138.510711, 171.607174),\n (138.510711, 171.607174, 138.510711, 171.754145),\n (138.510711, 171.754145, 138.510711, 171.901115),\n (138.510711, 171.901115, 138.510711, 172.048086),\n (138.510711, 172.048086, 192.667215, 172.048086),\n (192.667215, 167.345021, 192.667215, 167.491992),\n (192.667215, 167.491992, 192.667215, 167.638963),\n (192.667215, 167.638963, 192.667215, 167.785934),\n (192.667215, 167.785934, 192.667215, 167.932904),\n (192.667215, 167.932904, 192.667215, 168.079875),\n (192.667215, 168.079875, 192.667215, 168.226846),\n (192.667215, 168.226846, 192.667215, 168.373817),\n (192.667215, 168.373817, 192.667215, 168.520787),\n (192.667215, 168.520787, 192.667215, 168.667758),\n (192.667215, 168.667758, 192.667215, 168.814729),\n (192.667215, 168.814729, 192.667215, 168.9617),\n (192.667215, 168.9617, 192.667215, 169.108671),\n (192.667215, 169.108671, 192.667215, 169.255641),\n (192.667215, 169.255641, 192.667215, 169.402612),\n (192.667215, 169.402612, 192.667215, 169.549583),\n (192.667215, 169.549583, 192.667215, 169.696554),\n (192.667215, 169.696554, 192.667215, 169.843524),\n (192.667215, 169.843524, 192.667215, 169.990495),\n (192.667215, 169.990495, 192.667215, 170.137466),\n (192.667215, 170.137466, 192.667215, 170.284437),\n (192.667215, 170.284437, 192.667215, 170.431408),\n (192.667215, 170.431408, 192.667215, 170.578378),\n (192.667215, 170.578378, 192.667215, 170.725349),\n (192.667215, 170.725349, 192.667215, 170.87232),\n (192.667215, 170.87232, 192.667215, 171.019291),\n (192.667215, 171.019291, 192.667215, 171.166261),\n (192.667215, 171.166261, 192.667215, 171.313232),\n (192.667215, 171.313232, 192.667215, 171.460203),\n (192.667215, 171.460203, 192.667215, 171.607174),\n (192.667215, 171.607174, 192.667215, 171.754145),\n (192.667215, 171.754145, 192.667215, 171.901115),\n (192.667215, 171.901115, 192.667215, 172.048086),\n (138.510711, 130.112425, 192.667215, 130.112425),\n (138.510711, 130.112425, 138.510711, 130.259396),\n (138.510711, 130.259396, 138.510711, 130.406367),\n (138.510711, 130.406367, 138.510711, 130.553337),\n (138.510711, 130.553337, 138.510711, 130.700308),\n (138.510711, 130.700308, 138.510711, 130.847279),\n (138.510711, 130.847279, 138.510711, 130.99425),\n (138.510711, 130.99425, 138.510711, 131.14122),\n (138.510711, 131.14122, 138.510711, 131.288191),\n (138.510711, 131.288191, 138.510711, 131.435162),\n (138.510711, 131.435162, 138.510711, 131.582133),\n (138.510711, 131.582133, 138.510711, 131.729104),\n (138.510711, 131.729104, 138.510711, 131.876074),\n (138.510711, 131.876074, 138.510711, 132.023045),\n (138.510711, 132.023045, 138.510711, 132.170016),\n (138.510711, 132.170016, 138.510711, 132.316987),\n (138.510711, 132.316987, 138.510711, 132.463957),\n (138.510711, 132.463957, 138.510711, 132.610928),\n (138.510711, 132.610928, 138.510711, 132.757899),\n (138.510711, 132.757899, 138.510711, 132.90487),\n (138.510711, 132.90487, 138.510711, 133.051841),\n (138.510711, 133.051841, 138.510711, 133.198811),\n (138.510711, 133.198811, 138.510711, 133.345782),\n (138.510711, 133.345782, 138.510711, 133.492753),\n (138.510711, 133.492753, 138.510711, 133.639724),\n (138.510711, 133.639724, 138.510711, 133.786694),\n (138.510711, 133.786694, 138.510711, 133.933665),\n (138.510711, 133.933665, 138.510711, 134.080636),\n (138.510711, 134.080636, 138.510711, 134.227607),\n (138.510711, 134.227607, 138.510711, 134.374577),\n (138.510711, 134.374577, 138.510711, 134.521548),\n (138.510711, 134.521548, 138.510711, 134.668519),\n (138.510711, 134.668519, 138.510711, 134.81549),\n (192.667215, 130.112425, 192.667215, 130.259396),\n (192.667215, 130.259396, 192.667215, 130.406367),\n (192.667215, 130.406367, 192.667215, 130.553337),\n (192.667215, 130.553337, 192.667215, 130.700308),\n (192.667215, 130.700308, 192.667215, 130.847279),\n (192.667215, 130.847279, 192.667215, 130.99425),\n (192.667215, 130.99425, 192.667215, 131.14122),\n (192.667215, 131.14122, 192.667215, 131.288191),\n (192.667215, 131.288191, 192.667215, 131.435162),\n (192.667215, 131.435162, 192.667215, 131.582133),\n (192.667215, 131.582133, 192.667215, 131.729104),\n (192.667215, 131.729104, 192.667215, 131.876074),\n (192.667215, 131.876074, 192.667215, 132.023045),\n (192.667215, 132.023045, 192.667215, 132.170016),\n (192.667215, 132.170016, 192.667215, 132.316987),\n (192.667215, 132.316987, 192.667215, 132.463957),\n (192.667215, 132.463957, 192.667215, 132.610928),\n (192.667215, 132.610928, 192.667215, 132.757899),\n (192.667215, 132.757899, 192.667215, 132.90487),\n (192.667215, 132.90487, 192.667215, 133.051841),\n (192.667215, 133.051841, 192.667215, 133.198811),\n (192.667215, 133.198811, 192.667215, 133.345782),\n (192.667215, 133.345782, 192.667215, 133.492753),\n (192.667215, 133.492753, 192.667215, 133.639724),\n (192.667215, 133.639724, 192.667215, 133.786694),\n (192.667215, 133.786694, 192.667215, 133.933665),\n (192.667215, 133.933665, 192.667215, 134.080636),\n (192.667215, 134.080636, 192.667215, 134.227607),\n (192.667215, 134.227607, 192.667215, 134.374577),\n (192.667215, 134.374577, 192.667215, 134.521548),\n (192.667215, 134.521548, 192.667215, 134.668519),\n (192.667215, 134.668519, 192.667215, 134.81549),\n (192.667215, 134.81549, 192.667215, 167.345021),\n (138.510711, 134.81549, 138.510711, 167.345021),\n (192.667215, 172.052004, 138.510711, 172.052004),\n (192.667215, 130.108507, 138.510711, 130.108507),\n (138.510711, 167.345021, 192.667215, 167.345021),\n (138.510711, 134.81549, 192.667215, 134.81549)\n]\nVISIBLE_CIRCLES = [\n\n]\nVISIBLE_ARCS = [\n (99.035777, 167.345021, 4.703065, 90.0, -180.0),\n (119.611685, 167.14906, 4.902943, 2.29061, 92.29061),\n (119.611685, 135.011451, 4.902943, -92.29061, -2.29061),\n (99.035777, 134.81549, 4.703065, 180.0, -90.0),\n (148.529867, 187.978419, 18.817454, -122.173607, -122.167256),\n (138.207517, 178.424617, 54.831505, -6.678193, -6.674127),\n (926.424283, -594.244825, 1070.279583, 137.406558, 137.406712),\n (186.156984, 157.73077, 28.377179, -76.738107, -76.736293)\n]\nHIDDEN_SEGMENTS = [\n\n]\n# (orient, text, p1, p2, base) for linear; (orient, text, center, radius, angle) for diameter\nDIMENSIONS = [\n ('horizontal', '62.6506', (99.0358, 130.1124), (119.4158, 130.1124), (109.2258, 141.1124)),\n ('vertical', '100', (124.5107, 134.8155), (124.5107, 167.345), (113.5107, 151.0802)),\n ('radius', 'R14.4578', (99.0358, 134.8155), 4.7031, 45),\n ('radius', 'R15.0723', (119.6117, 135.0114), 4.9029, 45),\n ('horizontal', '166.484', (138.5107, 134.8155), (192.6672, 134.8155), (165.589, 145.8155))\n]\n\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; _ds.dxf.dimasz = 2.5\n _ds.dxf.dimexe = 1.25; _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\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\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,\n angle=(0 if d[0] == \"horizontal\" else 90),\n 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,\n 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,\n 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,\n text=text, dimstyle=\"EZDXF\").render()\n\n doc.saveas(out_path)\n\n\nif __name__ == \"__main__\":\n out = sys.argv[1] if len(sys.argv) > 1 else \"0048_00483354_gt.dxf\"\n draw(out)\n print(\"wrote\", out)\n```"}], "images": ["images/0048_00483354.png"], "id": "0048_00483354"} {"messages": [{"role": "user", "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 29.47 mm. It is extruded to a thickness of 49.66 mm. The outline includes one or more oblique (angled) edges."}, {"role": "assistant", "content": "```python\n#!/usr/bin/env python3\n# -*- coding: utf-8 -*-\n# Ground-truth 2D engineering drawing for part: 0048_00484633\n# Self-contained: reproduces the three-view DXF via ezdxf, NO FreeCAD needed.\n# Coordinates are A4 page millimetres (scale=0.8193231413502376, page=[297.0, 210.0]).\n# visible edges -> solid (layer OUTLINE); hidden edges -> dashed (layer HIDDEN)\n# dimensions -> real movable DIMENSION entities (text = true mm value)\n# Run: python 0048_00484633_gt.py [out.dxf]\nimport sys\nimport ezdxf\nimport math\n\nSCALE = 0.8193231413502376\nPAGE = [297.0, 210.0]\n\nVISIBLE_SEGMENTS = [\n (87.260056, 160.678972, 95.88451, 166.71609),\n (136.419444, 166.71609, 145.043899, 160.678972),\n (157.118134, 134.80561, 157.118134, 118.419147),\n (157.118134, 118.419147, 75.18582, 118.419147),\n (75.18582, 118.419147, 75.18582, 134.80561),\n (75.180876, 63.72793, 75.55835, 63.72793),\n (75.55835, 63.72793, 75.935824, 63.72793),\n (75.935824, 63.72793, 76.313299, 63.72793),\n (76.313299, 63.72793, 76.690773, 63.72793),\n (76.690773, 63.72793, 77.068248, 63.72793),\n (77.068248, 63.72793, 77.445722, 63.72793),\n (77.445722, 63.72793, 77.823196, 63.72793),\n (77.823196, 63.72793, 78.200671, 63.72793),\n (78.200671, 63.72793, 78.578145, 63.72793),\n (78.578145, 63.72793, 78.955619, 63.72793),\n (78.955619, 63.72793, 79.333094, 63.72793),\n (79.333094, 63.72793, 79.710568, 63.72793),\n (79.710568, 63.72793, 80.088043, 63.72793),\n (80.088043, 63.72793, 80.465517, 63.72793),\n (80.465517, 63.72793, 80.842991, 63.72793),\n (80.842991, 63.72793, 81.220466, 63.72793),\n (81.220466, 63.72793, 81.59794, 63.72793),\n (81.59794, 63.72793, 81.975415, 63.72793),\n (81.975415, 63.72793, 82.352889, 63.72793),\n (82.352889, 63.72793, 82.730363, 63.72793),\n (82.730363, 63.72793, 83.107838, 63.72793),\n (83.107838, 63.72793, 83.485312, 63.72793),\n (83.485312, 63.72793, 83.862787, 63.72793),\n (83.862787, 63.72793, 84.240261, 63.72793),\n (84.240261, 63.72793, 84.617735, 63.72793),\n (84.617735, 63.72793, 84.99521, 63.72793),\n (84.99521, 63.72793, 85.372684, 63.72793),\n (85.372684, 63.72793, 85.750158, 63.72793),\n (85.750158, 63.72793, 86.127633, 63.72793),\n (86.127633, 63.72793, 86.505107, 63.72793),\n (86.505107, 63.72793, 86.882582, 63.72793),\n (86.882582, 63.72793, 87.260056, 63.72793),\n (87.260056, 63.72793, 87.260056, 104.419147),\n (75.180876, 104.419147, 75.55835, 104.419147),\n (75.55835, 104.419147, 75.935824, 104.419147),\n (75.935824, 104.419147, 76.313299, 104.419147),\n (76.313299, 104.419147, 76.690773, 104.419147),\n (76.690773, 104.419147, 77.068248, 104.419147),\n (77.068248, 104.419147, 77.445722, 104.419147),\n (77.445722, 104.419147, 77.823196, 104.419147),\n (77.823196, 104.419147, 78.200671, 104.419147),\n (78.200671, 104.419147, 78.578145, 104.419147),\n (78.578145, 104.419147, 78.955619, 104.419147),\n (78.955619, 104.419147, 79.333094, 104.419147),\n (79.333094, 104.419147, 79.710568, 104.419147),\n (79.710568, 104.419147, 80.088043, 104.419147),\n (80.088043, 104.419147, 80.465517, 104.419147),\n (80.465517, 104.419147, 80.842991, 104.419147),\n (80.842991, 104.419147, 81.220466, 104.419147),\n (81.220466, 104.419147, 81.59794, 104.419147),\n (81.59794, 104.419147, 81.975415, 104.419147),\n (81.975415, 104.419147, 82.352889, 104.419147),\n (82.352889, 104.419147, 82.730363, 104.419147),\n (82.730363, 104.419147, 83.107838, 104.419147),\n (83.107838, 104.419147, 83.485312, 104.419147),\n (83.485312, 104.419147, 83.862787, 104.419147),\n (83.862787, 104.419147, 84.240261, 104.419147),\n (84.240261, 104.419147, 84.617735, 104.419147),\n (84.617735, 104.419147, 84.99521, 104.419147),\n (84.99521, 104.419147, 85.372684, 104.419147),\n (85.372684, 104.419147, 85.750158, 104.419147),\n (85.750158, 104.419147, 86.127633, 104.419147),\n (86.127633, 104.419147, 86.505107, 104.419147),\n (86.505107, 104.419147, 86.882582, 104.419147),\n (86.882582, 104.419147, 87.260056, 104.419147),\n (87.260056, 104.419147, 95.88451, 104.419147),\n (95.88451, 63.72793, 95.88451, 104.419147),\n (87.260056, 63.72793, 95.88451, 63.72793),\n (95.88451, 63.72793, 97.151227, 63.72793),\n (97.151227, 63.72793, 98.417944, 63.72793),\n (98.417944, 63.72793, 99.68466, 63.72793),\n (99.68466, 63.72793, 100.951377, 63.72793),\n (100.951377, 63.72793, 102.218094, 63.72793),\n (102.218094, 63.72793, 103.48481, 63.72793),\n (103.48481, 63.72793, 104.751527, 63.72793),\n (104.751527, 63.72793, 106.018244, 63.72793),\n (106.018244, 63.72793, 107.28496, 63.72793),\n (107.28496, 63.72793, 108.551677, 63.72793),\n (108.551677, 63.72793, 109.818394, 63.72793),\n (109.818394, 63.72793, 111.08511, 63.72793),\n (111.08511, 63.72793, 112.351827, 63.72793),\n (112.351827, 63.72793, 113.618544, 63.72793),\n (113.618544, 63.72793, 114.885261, 63.72793),\n (114.885261, 63.72793, 116.151977, 63.72793),\n (116.151977, 63.72793, 117.418694, 63.72793),\n (117.418694, 63.72793, 118.685411, 63.72793),\n (118.685411, 63.72793, 119.952127, 63.72793),\n (119.952127, 63.72793, 121.218844, 63.72793),\n (121.218844, 63.72793, 122.485561, 63.72793),\n (122.485561, 63.72793, 123.752277, 63.72793),\n (123.752277, 63.72793, 125.018994, 63.72793),\n (125.018994, 63.72793, 126.285711, 63.72793),\n (126.285711, 63.72793, 127.552428, 63.72793),\n (127.552428, 63.72793, 128.819144, 63.72793),\n (128.819144, 63.72793, 130.085861, 63.72793),\n (130.085861, 63.72793, 131.352578, 63.72793),\n (131.352578, 63.72793, 132.619294, 63.72793),\n (132.619294, 63.72793, 133.886011, 63.72793),\n (133.886011, 63.72793, 135.152728, 63.72793),\n (135.152728, 63.72793, 136.419444, 63.72793),\n (136.419444, 63.72793, 136.419444, 104.419147),\n (95.88451, 104.419147, 97.151227, 104.419147),\n (97.151227, 104.419147, 98.417944, 104.419147),\n (98.417944, 104.419147, 99.68466, 104.419147),\n (99.68466, 104.419147, 100.951377, 104.419147),\n (100.951377, 104.419147, 102.218094, 104.419147),\n (102.218094, 104.419147, 103.48481, 104.419147),\n (103.48481, 104.419147, 104.751527, 104.419147),\n (104.751527, 104.419147, 106.018244, 104.419147),\n (106.018244, 104.419147, 107.28496, 104.419147),\n (107.28496, 104.419147, 108.551677, 104.419147),\n (108.551677, 104.419147, 109.818394, 104.419147),\n (109.818394, 104.419147, 111.08511, 104.419147),\n (111.08511, 104.419147, 112.351827, 104.419147),\n (112.351827, 104.419147, 113.618544, 104.419147),\n (113.618544, 104.419147, 114.885261, 104.419147),\n (114.885261, 104.419147, 116.151977, 104.419147),\n (116.151977, 104.419147, 117.418694, 104.419147),\n (117.418694, 104.419147, 118.685411, 104.419147),\n (118.685411, 104.419147, 119.952127, 104.419147),\n (119.952127, 104.419147, 121.218844, 104.419147),\n (121.218844, 104.419147, 122.485561, 104.419147),\n (122.485561, 104.419147, 123.752277, 104.419147),\n (123.752277, 104.419147, 125.018994, 104.419147),\n (125.018994, 104.419147, 126.285711, 104.419147),\n (126.285711, 104.419147, 127.552428, 104.419147),\n (127.552428, 104.419147, 128.819144, 104.419147),\n (128.819144, 104.419147, 130.085861, 104.419147),\n (130.085861, 104.419147, 131.352578, 104.419147),\n (131.352578, 104.419147, 132.619294, 104.419147),\n (132.619294, 104.419147, 133.886011, 104.419147),\n (133.886011, 104.419147, 135.152728, 104.419147),\n (135.152728, 104.419147, 136.419444, 104.419147),\n (136.419444, 104.419147, 145.043899, 104.419147),\n (145.043899, 63.72793, 145.043899, 104.419147),\n (136.419444, 63.72793, 145.043899, 63.72793),\n (145.043899, 63.72793, 145.421373, 63.72793),\n (145.421373, 63.72793, 145.798847, 63.72793),\n (145.798847, 63.72793, 146.176322, 63.72793),\n (146.176322, 63.72793, 146.553796, 63.72793),\n (146.553796, 63.72793, 146.931271, 63.72793),\n (146.931271, 63.72793, 147.308745, 63.72793),\n (147.308745, 63.72793, 147.686219, 63.72793),\n (147.686219, 63.72793, 148.063694, 63.72793),\n (148.063694, 63.72793, 148.441168, 63.72793),\n (148.441168, 63.72793, 148.818642, 63.72793),\n (148.818642, 63.72793, 149.196117, 63.72793),\n (149.196117, 63.72793, 149.573591, 63.72793),\n (149.573591, 63.72793, 149.951066, 63.72793),\n (149.951066, 63.72793, 150.32854, 63.72793),\n (150.32854, 63.72793, 150.706014, 63.72793),\n (150.706014, 63.72793, 151.083489, 63.72793),\n (151.083489, 63.72793, 151.460963, 63.72793),\n (151.460963, 63.72793, 151.838438, 63.72793),\n (151.838438, 63.72793, 152.215912, 63.72793),\n (152.215912, 63.72793, 152.593386, 63.72793),\n (152.593386, 63.72793, 152.970861, 63.72793),\n (152.970861, 63.72793, 153.348335, 63.72793),\n (153.348335, 63.72793, 153.72581, 63.72793),\n (153.72581, 63.72793, 154.103284, 63.72793),\n (154.103284, 63.72793, 154.480758, 63.72793),\n (154.480758, 63.72793, 154.858233, 63.72793),\n (154.858233, 63.72793, 155.235707, 63.72793),\n (155.235707, 63.72793, 155.613181, 63.72793),\n (155.613181, 63.72793, 155.990656, 63.72793),\n (155.990656, 63.72793, 156.36813, 63.72793),\n (156.36813, 63.72793, 156.745605, 63.72793),\n (156.745605, 63.72793, 157.123079, 63.72793),\n (145.043899, 104.419147, 145.421373, 104.419147),\n (145.421373, 104.419147, 145.798847, 104.419147),\n (145.798847, 104.419147, 146.176322, 104.419147),\n (146.176322, 104.419147, 146.553796, 104.419147),\n (146.553796, 104.419147, 146.931271, 104.419147),\n (146.931271, 104.419147, 147.308745, 104.419147),\n (147.308745, 104.419147, 147.686219, 104.419147),\n (147.686219, 104.419147, 148.063694, 104.419147),\n (148.063694, 104.419147, 148.441168, 104.419147),\n (148.441168, 104.419147, 148.818642, 104.419147),\n (148.818642, 104.419147, 149.196117, 104.419147),\n (149.196117, 104.419147, 149.573591, 104.419147),\n (149.573591, 104.419147, 149.951066, 104.419147),\n (149.951066, 104.419147, 150.32854, 104.419147),\n (150.32854, 104.419147, 150.706014, 104.419147),\n (150.706014, 104.419147, 151.083489, 104.419147),\n (151.083489, 104.419147, 151.460963, 104.419147),\n (151.460963, 104.419147, 151.838438, 104.419147),\n (151.838438, 104.419147, 152.215912, 104.419147),\n (152.215912, 104.419147, 152.593386, 104.419147),\n (152.593386, 104.419147, 152.970861, 104.419147),\n (152.970861, 104.419147, 153.348335, 104.419147),\n (153.348335, 104.419147, 153.72581, 104.419147),\n (153.72581, 104.419147, 154.103284, 104.419147),\n (154.103284, 104.419147, 154.480758, 104.419147),\n (154.480758, 104.419147, 154.858233, 104.419147),\n (154.858233, 104.419147, 155.235707, 104.419147),\n (155.235707, 104.419147, 155.613181, 104.419147),\n (155.613181, 104.419147, 155.990656, 104.419147),\n (155.990656, 104.419147, 156.36813, 104.419147),\n (156.36813, 104.419147, 156.745605, 104.419147),\n (156.745605, 104.419147, 157.123079, 104.419147),\n (75.180876, 104.419147, 75.180876, 63.72793),\n (157.123079, 104.419147, 157.123079, 63.72793),\n (211.814296, 134.80561, 211.814296, 135.614152),\n (211.814296, 135.614152, 211.814296, 136.422695),\n (211.814296, 136.422695, 211.814296, 137.231237),\n (211.814296, 137.231237, 211.814296, 138.03978),\n (211.814296, 138.03978, 211.814296, 138.848323),\n (211.814296, 138.848323, 211.814296, 139.656865),\n (211.814296, 139.656865, 211.814296, 140.465408),\n (211.814296, 140.465408, 211.814296, 141.27395),\n (211.814296, 141.27395, 211.814296, 142.082493),\n (211.814296, 142.082493, 211.814296, 142.891035),\n (211.814296, 142.891035, 211.814296, 143.699578),\n (211.814296, 143.699578, 211.814296, 144.508121),\n (211.814296, 144.508121, 211.814296, 145.316663),\n (211.814296, 145.316663, 211.814296, 146.125206),\n (211.814296, 146.125206, 211.814296, 146.933748),\n (211.814296, 146.933748, 211.814296, 147.742291),\n (211.814296, 147.742291, 211.814296, 148.550833),\n (211.814296, 148.550833, 211.814296, 149.359376),\n (211.814296, 149.359376, 211.814296, 150.167919),\n (211.814296, 150.167919, 211.814296, 150.976461),\n (211.814296, 150.976461, 211.814296, 151.785004),\n (211.814296, 151.785004, 211.814296, 152.593546),\n (211.814296, 152.593546, 211.814296, 153.402089),\n (211.814296, 153.402089, 211.814296, 154.210631),\n (211.814296, 154.210631, 211.814296, 155.019174),\n (211.814296, 155.019174, 211.814296, 155.827717),\n (211.814296, 155.827717, 211.814296, 156.636259),\n (211.814296, 156.636259, 211.814296, 157.444802),\n (211.814296, 157.444802, 211.814296, 158.253344),\n (211.814296, 158.253344, 211.814296, 159.061887),\n (211.814296, 159.061887, 211.814296, 159.870429),\n (211.814296, 159.870429, 211.814296, 160.678972),\n (211.814296, 160.678972, 171.123079, 160.678972),\n (171.123079, 134.80561, 171.123079, 135.614152),\n (171.123079, 135.614152, 171.123079, 136.422695),\n (171.123079, 136.422695, 171.123079, 137.231237),\n (171.123079, 137.231237, 171.123079, 138.03978),\n (171.123079, 138.03978, 171.123079, 138.848323),\n (171.123079, 138.848323, 171.123079, 139.656865),\n (171.123079, 139.656865, 171.123079, 140.465408),\n (171.123079, 140.465408, 171.123079, 141.27395),\n (171.123079, 141.27395, 171.123079, 142.082493),\n (171.123079, 142.082493, 171.123079, 142.891035),\n (171.123079, 142.891035, 171.123079, 143.699578),\n (171.123079, 143.699578, 171.123079, 144.508121),\n (171.123079, 144.508121, 171.123079, 145.316663),\n (171.123079, 145.316663, 171.123079, 146.125206),\n (171.123079, 146.125206, 171.123079, 146.933748),\n (171.123079, 146.933748, 171.123079, 147.742291),\n (171.123079, 147.742291, 171.123079, 148.550833),\n (171.123079, 148.550833, 171.123079, 149.359376),\n (171.123079, 149.359376, 171.123079, 150.167919),\n (171.123079, 150.167919, 171.123079, 150.976461),\n (171.123079, 150.976461, 171.123079, 151.785004),\n (171.123079, 151.785004, 171.123079, 152.593546),\n (171.123079, 152.593546, 171.123079, 153.402089),\n (171.123079, 153.402089, 171.123079, 154.210631),\n (171.123079, 154.210631, 171.123079, 155.019174),\n (171.123079, 155.019174, 171.123079, 155.827717),\n (171.123079, 155.827717, 171.123079, 156.636259),\n (171.123079, 156.636259, 171.123079, 157.444802),\n (171.123079, 157.444802, 171.123079, 158.253344),\n (171.123079, 158.253344, 171.123079, 159.061887),\n (171.123079, 159.061887, 171.123079, 159.870429),\n (171.123079, 159.870429, 171.123079, 160.678972),\n (211.814296, 134.80561, 171.123079, 134.80561),\n (171.123079, 160.678972, 171.123079, 166.71609),\n (211.814296, 166.71609, 171.123079, 166.71609),\n (211.814296, 160.678972, 211.814296, 166.71609),\n (211.814296, 166.71609, 211.814296, 166.938335),\n (211.814296, 166.938335, 211.814296, 167.16058),\n (211.814296, 167.16058, 211.814296, 167.382825),\n (211.814296, 167.382825, 211.814296, 167.60507),\n (211.814296, 167.60507, 211.814296, 167.827315),\n (211.814296, 167.827315, 211.814296, 168.04956),\n (211.814296, 168.04956, 211.814296, 168.271805),\n (211.814296, 168.271805, 211.814296, 168.49405),\n (211.814296, 168.49405, 211.814296, 168.716295),\n (211.814296, 168.716295, 211.814296, 168.93854),\n (211.814296, 168.93854, 211.814296, 169.160785),\n (211.814296, 169.160785, 211.814296, 169.38303),\n (211.814296, 169.38303, 211.814296, 169.605275),\n (211.814296, 169.605275, 211.814296, 169.82752),\n (211.814296, 169.82752, 211.814296, 170.049765),\n (211.814296, 170.049765, 211.814296, 170.27201),\n (211.814296, 170.27201, 211.814296, 170.494255),\n (211.814296, 170.494255, 211.814296, 170.7165),\n (211.814296, 170.7165, 211.814296, 170.938745),\n (211.814296, 170.938745, 211.814296, 171.16099),\n (211.814296, 171.16099, 211.814296, 171.383235),\n (211.814296, 171.383235, 211.814296, 171.60548),\n (211.814296, 171.60548, 211.814296, 171.827725),\n (211.814296, 171.827725, 211.814296, 172.04997),\n (211.814296, 172.04997, 211.814296, 172.272215),\n (211.814296, 172.272215, 211.814296, 172.49446),\n (211.814296, 172.49446, 211.814296, 172.716705),\n (211.814296, 172.716705, 211.814296, 172.93895),\n (211.814296, 172.93895, 211.814296, 173.161195),\n (211.814296, 173.161195, 211.814296, 173.38344),\n (211.814296, 173.38344, 211.814296, 173.605685),\n (211.814296, 173.605685, 211.814296, 173.82793),\n (171.123079, 166.71609, 171.123079, 166.938335),\n (171.123079, 166.938335, 171.123079, 167.16058),\n (171.123079, 167.16058, 171.123079, 167.382825),\n (171.123079, 167.382825, 171.123079, 167.60507),\n (171.123079, 167.60507, 171.123079, 167.827315),\n (171.123079, 167.827315, 171.123079, 168.04956),\n (171.123079, 168.04956, 171.123079, 168.271805),\n (171.123079, 168.271805, 171.123079, 168.49405),\n (171.123079, 168.49405, 171.123079, 168.716295),\n (171.123079, 168.716295, 171.123079, 168.93854),\n (171.123079, 168.93854, 171.123079, 169.160785),\n (171.123079, 169.160785, 171.123079, 169.38303),\n (171.123079, 169.38303, 171.123079, 169.605275),\n (171.123079, 169.605275, 171.123079, 169.82752),\n (171.123079, 169.82752, 171.123079, 170.049765),\n (171.123079, 170.049765, 171.123079, 170.27201),\n (171.123079, 170.27201, 171.123079, 170.494255),\n (171.123079, 170.494255, 171.123079, 170.7165),\n (171.123079, 170.7165, 171.123079, 170.938745),\n (171.123079, 170.938745, 171.123079, 171.16099),\n (171.123079, 171.16099, 171.123079, 171.383235),\n (171.123079, 171.383235, 171.123079, 171.60548),\n (171.123079, 171.60548, 171.123079, 171.827725),\n (171.123079, 171.827725, 171.123079, 172.04997),\n (171.123079, 172.04997, 171.123079, 172.272215),\n (171.123079, 172.272215, 171.123079, 172.49446),\n (171.123079, 172.49446, 171.123079, 172.716705),\n (171.123079, 172.716705, 171.123079, 172.93895),\n (171.123079, 172.93895, 171.123079, 173.161195),\n (171.123079, 173.161195, 171.123079, 173.38344),\n (171.123079, 173.38344, 171.123079, 173.605685),\n (171.123079, 173.605685, 171.123079, 173.82793),\n (211.814296, 118.419147, 171.123079, 118.419147),\n (171.123079, 118.419147, 171.123079, 134.80561),\n (211.814296, 118.419147, 211.814296, 134.80561),\n (171.123079, 173.82793, 211.814296, 173.82793)\n]\nVISIBLE_CIRCLES = [\n (116.5832, 146.0174, 12.074236)\n]\nVISIBLE_ARCS = [\n (107.728717, 135.372927, 32.547841, 128.967482, -179.001268),\n (116.151977, 141.392691, 32.43524, 51.328125, 128.671875),\n (124.575238, 135.372927, 32.547841, -0.998732, 51.032518)\n]\nHIDDEN_SEGMENTS = [\n (128.6574, 63.728, 128.6574, 104.4192),\n (104.5089, 104.4192, 104.5089, 63.728),\n (171.123, 133.9432, 211.8142, 133.9432),\n (171.123, 158.0917, 211.8142, 158.0917)\n]\n# (orient, text, p1, p2, base) for linear; (orient, text, center, radius, angle) for diameter\nDIMENSIONS = [\n ('horizontal', '49.4737', (95.8844, 166.7161), (136.4194, 166.7161), (116.1519, 177.7161)),\n ('horizontal', '100', (157.1181, 118.4192), (75.1858, 118.4192), (116.1519, 107.4192)),\n ('vertical', '20', (157.1181, 134.8056), (157.1181, 118.4192), (168.1181, 126.6124)),\n ('aligned', '12.849', (87.26, 160.679), (95.8844, 166.7161), (85.2641, 172.7091)),\n ('aligned', '12.849', (136.4194, 166.7161), (145.0438, 160.679), (147.0397, 172.7091)),\n ('diameter', '%%c29.4737', (116.5832, 146.0174), 12.0742, 45),\n ('horizontal', '50.5263', (75.1858, 146.0174), (116.5832, 146.0174), (95.8845, 157.0174)),\n ('vertical', '25.2632', (116.5832, 166.7161), (116.5832, 146.0174), (127.5832, 156.3668)),\n ('radius', 'R39.7253', (107.7286, 135.3729), 32.5479, 45),\n ('radius', 'R39.5878', (116.1519, 141.3927), 32.4352, 45),\n ('horizontal', '49.6644', (211.8142, 134.8056), (171.123, 134.8056), (191.4686, 123.8056))\n]\n\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; _ds.dxf.dimasz = 2.5\n _ds.dxf.dimexe = 1.25; _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\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\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,\n angle=(0 if d[0] == \"horizontal\" else 90),\n 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,\n 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,\n 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,\n text=text, dimstyle=\"EZDXF\").render()\n\n doc.saveas(out_path)\n\n\nif __name__ == \"__main__\":\n out = sys.argv[1] if len(sys.argv) > 1 else \"0048_00484633_gt.dxf\"\n draw(out)\n print(\"wrote\", out)\n```"}], "images": ["images/0048_00484633.png"], "id": "0048_00484633"} {"messages": [{"role": "user", "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": "assistant", "content": "```python\n#!/usr/bin/env python3\n# -*- coding: utf-8 -*-\n# Ground-truth 2D engineering drawing for part: 0049_00492256\n# Self-contained: reproduces the three-view DXF via ezdxf, NO FreeCAD needed.\n# Coordinates are A4 page millimetres (scale=0.7428895147365849, page=[297.0, 210.0]).\n# visible edges -> solid (layer OUTLINE); hidden edges -> dashed (layer HIDDEN)\n# dimensions -> real movable DIMENSION entities (text = true mm value)\n# Run: python 0049_00492256_gt.py [out.dxf]\nimport sys\nimport ezdxf\nimport math\n\nSCALE = 0.7428895147365849\nPAGE = [297.0, 210.0]\n\nVISIBLE_SEGMENTS = [\n (191.680896, 88.480535, 158.628772, 88.480535),\n (191.680896, 81.933735, 158.628772, 81.933735),\n (158.628772, 81.933735, 84.33982, 81.933735),\n (158.628772, 88.480535, 84.33982, 88.480535),\n (84.33982, 88.480535, 51.287696, 88.480535),\n (84.33982, 81.933735, 51.287696, 81.933735),\n (191.680896, 81.933735, 191.680896, 88.480535),\n (51.287696, 81.933735, 51.287696, 88.480535),\n (158.628772, 88.480535, 158.628772, 81.933735),\n (84.33982, 88.480535, 84.33982, 81.933735),\n (205.680896, 153.251616, 205.680896, 102.480536),\n (212.227696, 153.251616, 212.227696, 102.480536),\n (212.227696, 153.251616, 205.680896, 153.251616),\n (212.227696, 102.480536, 205.680896, 102.480536)\n]\nVISIBLE_CIRCLES = [\n (76.460689, 127.303281, 11.255902),\n (166.507903, 127.303281, 11.255902)\n]\nVISIBLE_ARCS = [\n (121.484296, -13.583635, 122.99253, 72.421875, 107.578125),\n (166.295356, 127.866076, 25.38554, -107.578125, 107.578125),\n (121.484296, 269.315786, 122.99253, -107.578125, -72.421875),\n (76.673236, 127.866076, 25.38554, 72.421875, -72.421875)\n]\nHIDDEN_SEGMENTS = [\n (87.7166, 88.4805, 87.7166, 81.9337),\n (177.7638, 88.4805, 177.7638, 81.9337),\n (65.2048, 81.9337, 65.2048, 88.4805),\n (155.252, 81.9337, 155.252, 88.4805),\n (212.2277, 109.4089, 205.6809, 109.4089),\n (212.2277, 146.3233, 205.6809, 146.3233),\n (212.2277, 138.5592, 205.6809, 138.5592),\n (212.2277, 116.0474, 205.6809, 116.0474)\n]\n# (orient, text, p1, p2, base) for linear; (orient, text, center, radius, angle) for diameter\nDIMENSIONS = [\n ('horizontal', '100', (84.3398, 103.6659), (158.6287, 103.6659), (121.4843, 114.6659)),\n ('vertical', '65.1515', (158.6287, 103.6659), (158.6287, 152.0663), (147.6287, 127.8661)),\n ('diameter', '%%c30.303', (76.4607, 127.3033), 11.2559, 45),\n ('horizontal', '10.6061', (84.3398, 127.3033), (76.4607, 127.3033), (80.4002, 116.3033)),\n ('vertical', '31.8182', (76.4607, 103.6659), (76.4607, 127.3033), (65.4607, 115.4846)),\n ('diameter', '%%c30.303', (166.5079, 127.3033), 11.2559, 45),\n ('horizontal', '110.606', (84.3398, 127.3033), (166.5079, 127.3033), (125.4238, 138.3033)),\n ('vertical', '31.8182', (166.5079, 103.6659), (166.5079, 127.3033), (155.5079, 115.4846)),\n ('radius', 'R165.56', (121.4843, -13.5836), 122.9926, 45),\n ('radius', 'R34.1714', (166.2954, 127.8661), 25.3856, 135),\n ('horizontal', '8.8126', (205.6809, 103.6659), (212.2277, 103.6659), (208.9543, 114.6659))\n]\n\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; _ds.dxf.dimasz = 2.5\n _ds.dxf.dimexe = 1.25; _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\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\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,\n angle=(0 if d[0] == \"horizontal\" else 90),\n 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,\n 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,\n 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,\n text=text, dimstyle=\"EZDXF\").render()\n\n doc.saveas(out_path)\n\n\nif __name__ == \"__main__\":\n out = sys.argv[1] if len(sys.argv) > 1 else \"0049_00492256_gt.dxf\"\n draw(out)\n print(\"wrote\", out)\n```"}], "images": ["images/0049_00492256.png"], "id": "0049_00492256"} {"messages": [{"role": "user", "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": "assistant", "content": "```python\n#!/usr/bin/env python3\n# -*- coding: utf-8 -*-\n# Ground-truth 2D engineering drawing for part: 0049_00498011\n# Self-contained: reproduces the three-view DXF via ezdxf, NO FreeCAD needed.\n# Coordinates are A4 page millimetres (scale=0.7428895147365849, page=[297.0, 210.0]).\n# visible edges -> solid (layer OUTLINE); hidden edges -> dashed (layer HIDDEN)\n# dimensions -> real movable DIMENSION entities (text = true mm value)\n# Run: python 0049_00498011_gt.py [out.dxf]\nimport sys\nimport ezdxf\nimport math\n\nSCALE = 0.7428895147365849\nPAGE = [297.0, 210.0]\n\nVISIBLE_SEGMENTS = [\n (191.680896, 88.480535, 158.628772, 88.480535),\n (191.680896, 81.933735, 158.628772, 81.933735),\n (158.628772, 81.933735, 84.33982, 81.933735),\n (158.628772, 88.480535, 84.33982, 88.480535),\n (84.33982, 88.480535, 51.287696, 88.480535),\n (84.33982, 81.933735, 51.287696, 81.933735),\n (191.680896, 81.933735, 191.680896, 88.480535),\n (51.287696, 81.933735, 51.287696, 88.480535),\n (158.628772, 88.480535, 158.628772, 81.933735),\n (84.33982, 88.480535, 84.33982, 81.933735),\n (205.680896, 153.251616, 205.680896, 102.480536),\n (212.227696, 153.251616, 212.227696, 102.480536),\n (212.227696, 153.251616, 205.680896, 153.251616),\n (212.227696, 102.480536, 205.680896, 102.480536)\n]\nVISIBLE_CIRCLES = [\n (76.460689, 127.303281, 11.255902),\n (166.507903, 127.303281, 11.255902)\n]\nVISIBLE_ARCS = [\n (121.484296, -13.583635, 122.99253, 72.421875, 107.578125),\n (166.295356, 127.866076, 25.38554, -107.578125, 107.578125),\n (121.484296, 269.315786, 122.99253, -107.578125, -72.421875),\n (76.673236, 127.866076, 25.38554, 72.421875, -72.421875)\n]\nHIDDEN_SEGMENTS = [\n (87.7166, 88.4805, 87.7166, 81.9337),\n (177.7638, 88.4805, 177.7638, 81.9337),\n (65.2048, 81.9337, 65.2048, 88.4805),\n (155.252, 81.9337, 155.252, 88.4805),\n (212.2277, 109.4089, 205.6809, 109.4089),\n (212.2277, 146.3233, 205.6809, 146.3233),\n (212.2277, 138.5592, 205.6809, 138.5592),\n (212.2277, 116.0474, 205.6809, 116.0474)\n]\n# (orient, text, p1, p2, base) for linear; (orient, text, center, radius, angle) for diameter\nDIMENSIONS = [\n ('horizontal', '100', (84.3398, 103.6659), (158.6287, 103.6659), (121.4843, 114.6659)),\n ('vertical', '65.1515', (158.6287, 103.6659), (158.6287, 152.0663), (147.6287, 127.8661)),\n ('diameter', '%%c30.303', (76.4607, 127.3033), 11.2559, 45),\n ('horizontal', '10.6061', (84.3398, 127.3033), (76.4607, 127.3033), (80.4002, 116.3033)),\n ('vertical', '31.8182', (76.4607, 103.6659), (76.4607, 127.3033), (65.4607, 115.4846)),\n ('diameter', '%%c30.303', (166.5079, 127.3033), 11.2559, 45),\n ('horizontal', '110.606', (84.3398, 127.3033), (166.5079, 127.3033), (125.4238, 138.3033)),\n ('vertical', '31.8182', (166.5079, 103.6659), (166.5079, 127.3033), (155.5079, 115.4846)),\n ('radius', 'R165.56', (121.4843, -13.5836), 122.9926, 45),\n ('radius', 'R34.1714', (166.2954, 127.8661), 25.3856, 135),\n ('horizontal', '8.8126', (205.6809, 103.6659), (212.2277, 103.6659), (208.9543, 114.6659))\n]\n\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; _ds.dxf.dimasz = 2.5\n _ds.dxf.dimexe = 1.25; _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\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\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,\n angle=(0 if d[0] == \"horizontal\" else 90),\n 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,\n 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,\n 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,\n text=text, dimstyle=\"EZDXF\").render()\n\n doc.saveas(out_path)\n\n\nif __name__ == \"__main__\":\n out = sys.argv[1] if len(sys.argv) > 1 else \"0049_00498011_gt.dxf\"\n draw(out)\n print(\"wrote\", out)\n```"}], "images": ["images/0049_00498011.png"], "id": "0049_00498011"} {"messages": [{"role": "user", "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 23.26 mm and 3 polygonal cutouts. It is extruded to a thickness of 22.29 mm. The outline includes one or more oblique (angled) edges."}, {"role": "assistant", "content": "```python\n#!/usr/bin/env python3\n# -*- coding: utf-8 -*-\n# Ground-truth 2D engineering drawing for part: 0051_00517645\n# Self-contained: reproduces the three-view DXF via ezdxf, NO FreeCAD needed.\n# Coordinates are A4 page millimetres (scale=0.66553489142015, page=[297.0, 210.0]).\n# visible edges -> solid (layer OUTLINE); hidden edges -> dashed (layer HIDDEN)\n# dimensions -> real movable DIMENSION entities (text = true mm value)\n# Run: python 0051_00517645_gt.py [out.dxf]\nimport sys\nimport ezdxf\nimport math\n\nSCALE = 0.66553489142015\nPAGE = [297.0, 210.0]\n\nVISIBLE_SEGMENTS = [\n (107.415122, 90.785178, 150.752278, 90.785178),\n (158.491056, 98.523955, 158.491056, 165.077444),\n (150.752278, 172.042345, 107.415122, 172.042345),\n (99.676344, 165.077444, 99.676344, 98.523955),\n (140.691867, 104.714978, 140.691867, 107.036611),\n (120.571044, 101.619466, 137.596356, 101.619466),\n (117.475533, 104.714978, 99.676344, 98.523955),\n (117.475533, 107.036611, 117.475533, 104.714978),\n (137.596356, 110.132122, 120.571044, 110.132122),\n (137.596356, 121.740289, 120.571044, 121.740289),\n (120.571044, 116.323144, 137.596356, 116.323144),\n (137.596356, 134.122333, 120.571044, 134.122333),\n (120.571044, 127.931311, 137.596356, 127.931311),\n (99.676344, 76.785177, 99.676344, 61.95252),\n (158.491056, 76.785177, 158.491056, 61.95252),\n (158.491056, 76.785177, 158.249219, 76.785177),\n (158.249219, 76.785177, 158.007382, 76.785177),\n (158.007382, 76.785177, 157.765545, 76.785177),\n (157.765545, 76.785177, 157.523708, 76.785177),\n (157.523708, 76.785177, 157.281872, 76.785177),\n (157.281872, 76.785177, 157.040035, 76.785177),\n (157.040035, 76.785177, 156.798198, 76.785177),\n (156.798198, 76.785177, 156.556361, 76.785177),\n (156.556361, 76.785177, 156.314524, 76.785177),\n (156.314524, 76.785177, 156.072688, 76.785177),\n (156.072688, 76.785177, 155.830851, 76.785177),\n (155.830851, 76.785177, 155.589014, 76.785177),\n (155.589014, 76.785177, 155.347177, 76.785177),\n (155.347177, 76.785177, 155.10534, 76.785177),\n (155.10534, 76.785177, 154.863504, 76.785177),\n (154.863504, 76.785177, 154.621667, 76.785177),\n (154.621667, 76.785177, 154.37983, 76.785177),\n (154.37983, 76.785177, 154.137993, 76.785177),\n (154.137993, 76.785177, 153.896156, 76.785177),\n (153.896156, 76.785177, 153.65432, 76.785177),\n (153.65432, 76.785177, 153.412483, 76.785177),\n (153.412483, 76.785177, 153.170646, 76.785177),\n (153.170646, 76.785177, 152.928809, 76.785177),\n (152.928809, 76.785177, 152.686972, 76.785177),\n (152.686972, 76.785177, 152.445136, 76.785177),\n (152.445136, 76.785177, 152.203299, 76.785177),\n (152.203299, 76.785177, 151.961462, 76.785177),\n (151.961462, 76.785177, 151.719625, 76.785177),\n (151.719625, 76.785177, 151.477788, 76.785177),\n (151.477788, 76.785177, 151.235951, 76.785177),\n (151.235951, 76.785177, 150.994115, 76.785177),\n (150.994115, 76.785177, 150.752278, 76.785177),\n (150.752278, 76.785177, 150.752278, 61.95252),\n (158.491056, 61.95252, 158.249219, 61.95252),\n (158.249219, 61.95252, 158.007382, 61.95252),\n (158.007382, 61.95252, 157.765545, 61.95252),\n (157.765545, 61.95252, 157.523708, 61.95252),\n (157.523708, 61.95252, 157.281872, 61.95252),\n (157.281872, 61.95252, 157.040035, 61.95252),\n (157.040035, 61.95252, 156.798198, 61.95252),\n (156.798198, 61.95252, 156.556361, 61.95252),\n (156.556361, 61.95252, 156.314524, 61.95252),\n (156.314524, 61.95252, 156.072688, 61.95252),\n (156.072688, 61.95252, 155.830851, 61.95252),\n (155.830851, 61.95252, 155.589014, 61.95252),\n (155.589014, 61.95252, 155.347177, 61.95252),\n (155.347177, 61.95252, 155.10534, 61.95252),\n (155.10534, 61.95252, 154.863504, 61.95252),\n (154.863504, 61.95252, 154.621667, 61.95252),\n (154.621667, 61.95252, 154.37983, 61.95252),\n (154.37983, 61.95252, 154.137993, 61.95252),\n (154.137993, 61.95252, 153.896156, 61.95252),\n (153.896156, 61.95252, 153.65432, 61.95252),\n (153.65432, 61.95252, 153.412483, 61.95252),\n (153.412483, 61.95252, 153.170646, 61.95252),\n (153.170646, 61.95252, 152.928809, 61.95252),\n (152.928809, 61.95252, 152.686972, 61.95252),\n (152.686972, 61.95252, 152.445136, 61.95252),\n (152.445136, 61.95252, 152.203299, 61.95252),\n (152.203299, 61.95252, 151.961462, 61.95252),\n (151.961462, 61.95252, 151.719625, 61.95252),\n (151.719625, 61.95252, 151.477788, 61.95252),\n (151.477788, 61.95252, 151.235951, 61.95252),\n (151.235951, 61.95252, 150.994115, 61.95252),\n (150.994115, 61.95252, 150.752278, 61.95252),\n (150.752278, 61.95252, 107.415122, 61.95252),\n (107.415122, 76.785177, 107.415122, 61.95252),\n (150.752278, 76.785177, 107.415122, 76.785177),\n (107.415122, 76.785177, 107.173285, 76.785177),\n (107.173285, 76.785177, 106.931449, 76.785177),\n (106.931449, 76.785177, 106.689612, 76.785177),\n (106.689612, 76.785177, 106.447775, 76.785177),\n (106.447775, 76.785177, 106.205938, 76.785177),\n (106.205938, 76.785177, 105.964101, 76.785177),\n (105.964101, 76.785177, 105.722264, 76.785177),\n (105.722264, 76.785177, 105.480428, 76.785177),\n (105.480428, 76.785177, 105.238591, 76.785177),\n (105.238591, 76.785177, 104.996754, 76.785177),\n (104.996754, 76.785177, 104.754917, 76.785177),\n (104.754917, 76.785177, 104.51308, 76.785177),\n (104.51308, 76.785177, 104.271244, 76.785177),\n (104.271244, 76.785177, 104.029407, 76.785177),\n (104.029407, 76.785177, 103.78757, 76.785177),\n (103.78757, 76.785177, 103.545733, 76.785177),\n (103.545733, 76.785177, 103.303896, 76.785177),\n (103.303896, 76.785177, 103.06206, 76.785177),\n (103.06206, 76.785177, 102.820223, 76.785177),\n (102.820223, 76.785177, 102.578386, 76.785177),\n (102.578386, 76.785177, 102.336549, 76.785177),\n (102.336549, 76.785177, 102.094712, 76.785177),\n (102.094712, 76.785177, 101.852876, 76.785177),\n (101.852876, 76.785177, 101.611039, 76.785177),\n (101.611039, 76.785177, 101.369202, 76.785177),\n (101.369202, 76.785177, 101.127365, 76.785177),\n (101.127365, 76.785177, 100.885528, 76.785177),\n (100.885528, 76.785177, 100.643692, 76.785177),\n (100.643692, 76.785177, 100.401855, 76.785177),\n (100.401855, 76.785177, 100.160018, 76.785177),\n (100.160018, 76.785177, 99.918181, 76.785177),\n (99.918181, 76.785177, 99.676344, 76.785177),\n (107.415122, 61.95252, 107.173285, 61.95252),\n (107.173285, 61.95252, 106.931449, 61.95252),\n (106.931449, 61.95252, 106.689612, 61.95252),\n (106.689612, 61.95252, 106.447775, 61.95252),\n (106.447775, 61.95252, 106.205938, 61.95252),\n (106.205938, 61.95252, 105.964101, 61.95252),\n (105.964101, 61.95252, 105.722264, 61.95252),\n (105.722264, 61.95252, 105.480428, 61.95252),\n (105.480428, 61.95252, 105.238591, 61.95252),\n (105.238591, 61.95252, 104.996754, 61.95252),\n (104.996754, 61.95252, 104.754917, 61.95252),\n (104.754917, 61.95252, 104.51308, 61.95252),\n (104.51308, 61.95252, 104.271244, 61.95252),\n (104.271244, 61.95252, 104.029407, 61.95252),\n (104.029407, 61.95252, 103.78757, 61.95252),\n (103.78757, 61.95252, 103.545733, 61.95252),\n (103.545733, 61.95252, 103.303896, 61.95252),\n (103.303896, 61.95252, 103.06206, 61.95252),\n (103.06206, 61.95252, 102.820223, 61.95252),\n (102.820223, 61.95252, 102.578386, 61.95252),\n (102.578386, 61.95252, 102.336549, 61.95252),\n (102.336549, 61.95252, 102.094712, 61.95252),\n (102.094712, 61.95252, 101.852876, 61.95252),\n (101.852876, 61.95252, 101.611039, 61.95252),\n (101.611039, 61.95252, 101.369202, 61.95252),\n (101.369202, 61.95252, 101.127365, 61.95252),\n (101.127365, 61.95252, 100.885528, 61.95252),\n (100.885528, 61.95252, 100.643692, 61.95252),\n (100.643692, 61.95252, 100.401855, 61.95252),\n (100.401855, 61.95252, 100.160018, 61.95252),\n (100.160018, 61.95252, 99.918181, 61.95252),\n (99.918181, 61.95252, 99.676344, 61.95252),\n (172.491056, 98.523955, 172.491056, 98.282119),\n (172.491056, 98.282119, 172.491056, 98.040282),\n (172.491056, 98.040282, 172.491056, 97.798445),\n (172.491056, 97.798445, 172.491056, 97.556608),\n (172.491056, 97.556608, 172.491056, 97.314771),\n (172.491056, 97.314771, 172.491056, 97.072935),\n (172.491056, 97.072935, 172.491056, 96.831098),\n (172.491056, 96.831098, 172.491056, 96.589261),\n (172.491056, 96.589261, 172.491056, 96.347424),\n (172.491056, 96.347424, 172.491056, 96.105587),\n (172.491056, 96.105587, 172.491056, 95.86375),\n (172.491056, 95.86375, 172.491056, 95.621914),\n (172.491056, 95.621914, 172.491056, 95.380077),\n (172.491056, 95.380077, 172.491056, 95.13824),\n (172.491056, 95.13824, 172.491056, 94.896403),\n (172.491056, 94.896403, 172.491056, 94.654566),\n (172.491056, 94.654566, 172.491056, 94.41273),\n (172.491056, 94.41273, 172.491056, 94.170893),\n (172.491056, 94.170893, 172.491056, 93.929056),\n (172.491056, 93.929056, 172.491056, 93.687219),\n (172.491056, 93.687219, 172.491056, 93.445382),\n (172.491056, 93.445382, 172.491056, 93.203546),\n (172.491056, 93.203546, 172.491056, 92.961709),\n (172.491056, 92.961709, 172.491056, 92.719872),\n (172.491056, 92.719872, 172.491056, 92.478035),\n (172.491056, 92.478035, 172.491056, 92.236198),\n (172.491056, 92.236198, 172.491056, 91.994362),\n (172.491056, 91.994362, 172.491056, 91.752525),\n (172.491056, 91.752525, 172.491056, 91.510688),\n (172.491056, 91.510688, 172.491056, 91.268851),\n (172.491056, 91.268851, 172.491056, 91.027014),\n (172.491056, 91.027014, 172.491056, 90.785178),\n (172.491056, 90.785178, 187.323713, 90.785178),\n (187.323713, 98.523955, 187.323713, 98.282119),\n (187.323713, 98.282119, 187.323713, 98.040282),\n (187.323713, 98.040282, 187.323713, 97.798445),\n (187.323713, 97.798445, 187.323713, 97.556608),\n (187.323713, 97.556608, 187.323713, 97.314771),\n (187.323713, 97.314771, 187.323713, 97.072935),\n (187.323713, 97.072935, 187.323713, 96.831098),\n (187.323713, 96.831098, 187.323713, 96.589261),\n (187.323713, 96.589261, 187.323713, 96.347424),\n (187.323713, 96.347424, 187.323713, 96.105587),\n (187.323713, 96.105587, 187.323713, 95.86375),\n (187.323713, 95.86375, 187.323713, 95.621914),\n (187.323713, 95.621914, 187.323713, 95.380077),\n (187.323713, 95.380077, 187.323713, 95.13824),\n (187.323713, 95.13824, 187.323713, 94.896403),\n (187.323713, 94.896403, 187.323713, 94.654566),\n (187.323713, 94.654566, 187.323713, 94.41273),\n (187.323713, 94.41273, 187.323713, 94.170893),\n (187.323713, 94.170893, 187.323713, 93.929056),\n (187.323713, 93.929056, 187.323713, 93.687219),\n (187.323713, 93.687219, 187.323713, 93.445382),\n (187.323713, 93.445382, 187.323713, 93.203546),\n (187.323713, 93.203546, 187.323713, 92.961709),\n (187.323713, 92.961709, 187.323713, 92.719872),\n (187.323713, 92.719872, 187.323713, 92.478035),\n (187.323713, 92.478035, 187.323713, 92.236198),\n (187.323713, 92.236198, 187.323713, 91.994362),\n (187.323713, 91.994362, 187.323713, 91.752525),\n (187.323713, 91.752525, 187.323713, 91.510688),\n (187.323713, 91.510688, 187.323713, 91.268851),\n (187.323713, 91.268851, 187.323713, 91.027014),\n (187.323713, 91.027014, 187.323713, 90.785178),\n (172.491056, 172.05252, 172.491056, 171.834549),\n (172.491056, 171.834549, 172.491056, 171.616578),\n (172.491056, 171.616578, 172.491056, 171.398607),\n (172.491056, 171.398607, 172.491056, 171.180636),\n (172.491056, 171.180636, 172.491056, 170.962665),\n (172.491056, 170.962665, 172.491056, 170.744693),\n (172.491056, 170.744693, 172.491056, 170.526722),\n (172.491056, 170.526722, 172.491056, 170.308751),\n (172.491056, 170.308751, 172.491056, 170.09078),\n (172.491056, 170.09078, 172.491056, 169.872809),\n (172.491056, 169.872809, 172.491056, 169.654838),\n (172.491056, 169.654838, 172.491056, 169.436867),\n (172.491056, 169.436867, 172.491056, 169.218896),\n (172.491056, 169.218896, 172.491056, 169.000925),\n (172.491056, 169.000925, 172.491056, 168.782953),\n (172.491056, 168.782953, 172.491056, 168.564982),\n (172.491056, 168.564982, 172.491056, 168.347011),\n (172.491056, 168.347011, 172.491056, 168.12904),\n (172.491056, 168.12904, 172.491056, 167.911069),\n (172.491056, 167.911069, 172.491056, 167.693098),\n (172.491056, 167.693098, 172.491056, 167.475127),\n (172.491056, 167.475127, 172.491056, 167.257156),\n (172.491056, 167.257156, 172.491056, 167.039185),\n (172.491056, 167.039185, 172.491056, 166.821213),\n (172.491056, 166.821213, 172.491056, 166.603242),\n (172.491056, 166.603242, 172.491056, 166.385271),\n (172.491056, 166.385271, 172.491056, 166.1673),\n (172.491056, 166.1673, 172.491056, 165.949329),\n (172.491056, 165.949329, 172.491056, 165.731358),\n (172.491056, 165.731358, 172.491056, 165.513387),\n (172.491056, 165.513387, 172.491056, 165.295416),\n (172.491056, 165.295416, 172.491056, 165.077444),\n (172.491056, 165.077444, 187.323713, 165.077444),\n (187.323713, 172.05252, 187.323713, 171.834549),\n (187.323713, 171.834549, 187.323713, 171.616578),\n (187.323713, 171.616578, 187.323713, 171.398607),\n (187.323713, 171.398607, 187.323713, 171.180636),\n (187.323713, 171.180636, 187.323713, 170.962665),\n (187.323713, 170.962665, 187.323713, 170.744693),\n (187.323713, 170.744693, 187.323713, 170.526722),\n (187.323713, 170.526722, 187.323713, 170.308751),\n (187.323713, 170.308751, 187.323713, 170.09078),\n (187.323713, 170.09078, 187.323713, 169.872809),\n (187.323713, 169.872809, 187.323713, 169.654838),\n (187.323713, 169.654838, 187.323713, 169.436867),\n (187.323713, 169.436867, 187.323713, 169.218896),\n (187.323713, 169.218896, 187.323713, 169.000925),\n (187.323713, 169.000925, 187.323713, 168.782953),\n (187.323713, 168.782953, 187.323713, 168.564982),\n (187.323713, 168.564982, 187.323713, 168.347011),\n (187.323713, 168.347011, 187.323713, 168.12904),\n (187.323713, 168.12904, 187.323713, 167.911069),\n (187.323713, 167.911069, 187.323713, 167.693098),\n (187.323713, 167.693098, 187.323713, 167.475127),\n (187.323713, 167.475127, 187.323713, 167.257156),\n (187.323713, 167.257156, 187.323713, 167.039185),\n (187.323713, 167.039185, 187.323713, 166.821213),\n (187.323713, 166.821213, 187.323713, 166.603242),\n (187.323713, 166.603242, 187.323713, 166.385271),\n (187.323713, 166.385271, 187.323713, 166.1673),\n (187.323713, 166.1673, 187.323713, 165.949329),\n (187.323713, 165.949329, 187.323713, 165.731358),\n (187.323713, 165.731358, 187.323713, 165.513387),\n (187.323713, 165.513387, 187.323713, 165.295416),\n (187.323713, 165.295416, 187.323713, 165.077444),\n (187.323713, 165.077444, 187.323713, 98.523955),\n (172.491056, 165.077444, 172.491056, 98.523955),\n (172.491056, 98.523955, 187.323713, 98.523955),\n (187.323713, 172.05252, 172.491056, 172.05252)\n]\nVISIBLE_CIRCLES = [\n (129.0837, 152.6954, 7.738778)\n]\nVISIBLE_ARCS = [\n (107.415122, 98.523955, 7.738778, -180.0, -90.0),\n (150.752278, 98.523955, 7.738778, -90.0, -0.0),\n (151.139217, 164.690506, 7.362014, 3.012788, 93.012788),\n (107.028183, 164.690506, 7.362014, 86.987212, 176.987212),\n (137.596356, 107.036611, 3.095511, 0.0, 90.0),\n (137.596356, 104.714978, 3.095511, -90.0, -0.0),\n (108.575939, 110.519061, 14.936042, -126.573031, -36.573031),\n (120.571044, 107.036611, 3.095511, 90.0, -180.0),\n (120.571044, 119.031717, 2.708572, 90.0, -90.0),\n (137.596356, 119.031717, 2.708572, -90.0, 90.0),\n (120.571044, 131.026822, 3.095511, 90.0, -90.0),\n (137.596356, 131.026822, 3.095511, -90.0, 90.0)\n]\nHIDDEN_SEGMENTS = [\n (140.6918, 76.7852, 140.6918, 61.9525),\n (120.571, 76.7852, 120.571, 61.9525),\n (117.4755, 76.7852, 117.4755, 61.9525),\n (136.8224, 76.7852, 136.8224, 61.9525),\n (117.8624, 61.9525, 117.8624, 76.7852),\n (140.3049, 61.9525, 140.3049, 76.7852),\n (117.4755, 61.9525, 117.4755, 76.7852),\n (140.6918, 61.9525, 140.6918, 76.7852),\n (121.3449, 61.9525, 121.3449, 76.7852),\n (172.491, 110.1321, 187.3237, 110.1321),\n (172.491, 101.6195, 187.3237, 101.6195),\n (172.491, 104.715, 187.3237, 104.715),\n (172.491, 116.3232, 187.3237, 116.3232),\n (172.491, 121.7403, 187.3237, 121.7403),\n (172.491, 127.9313, 187.3237, 127.9313),\n (172.491, 134.1224, 187.3237, 134.1224),\n (187.3237, 95.583, 172.491, 95.583),\n (187.3237, 160.4342, 172.491, 160.4342),\n (187.3237, 144.9566, 172.491, 144.9566)\n]\n# (orient, text, p1, p2, base) for linear; (orient, text, center, radius, angle) for diameter\nDIMENSIONS = [\n ('horizontal', '65.1163', (107.4151, 90.7852), (150.7522, 90.7852), (129.0837, 101.7852)),\n ('vertical', '100', (158.491, 98.524), (158.491, 165.0775), (147.491, 131.8008)),\n ('diameter', '%%c23.2558', (129.0837, 152.6954), 7.7388, 45),\n ('horizontal', '44.186', (99.6763, 152.6954), (129.0837, 152.6954), (114.38, 163.6954)),\n ('vertical', '93.0233', (129.0837, 90.7852), (129.0837, 152.6954), (118.0837, 121.7403)),\n ('horizontal', '61.6279', (99.6763, 98.524), (140.6919, 98.524), (120.1841, 109.524)),\n ('vertical', '17.4419', (99.6763, 98.524), (99.6763, 110.1321), (88.6763, 104.3281)),\n ('vertical', '11.6279', (99.6763, 90.7852), (99.6763, 98.524), (88.6763, 94.6546)),\n ('horizontal', '25.5814', (120.571, 116.3231), (137.5963, 116.3231), (129.0837, 127.3231)),\n ('vertical', '8.1395', (120.571, 116.3231), (120.571, 121.7403), (109.571, 119.0317)),\n ('horizontal', '31.3953', (99.6763, 116.3231), (120.571, 116.3231), (110.1237, 127.3231)),\n ('vertical', '38.3721', (120.571, 90.7852), (120.571, 116.3231), (109.571, 103.5542)),\n ('horizontal', '25.5814', (120.571, 127.9313), (137.5963, 127.9313), (129.0837, 138.9313)),\n ('vertical', '9.3023', (120.571, 127.9313), (120.571, 134.1223), (109.571, 131.0268)),\n ('horizontal', '31.3953', (99.6763, 127.9313), (120.571, 127.9313), (110.1237, 138.9313)),\n ('vertical', '55.814', (120.571, 90.7852), (120.571, 127.9313), (109.571, 109.3583)),\n ('radius', 'R11.6279', (107.4151, 98.524), 7.7388, 45),\n ('radius', 'R11.0618', (151.1392, 164.6906), 7.362, 45),\n ('radius', 'R22.4422', (108.5759, 110.5191), 14.9361, 45),\n ('radius', 'R4.6512', (137.5963, 104.715), 3.0955, 45),\n ('radius', 'R4.0698', (137.5963, 119.0317), 2.7086, 45),\n ('horizontal', '22.2868', (172.491, 98.524), (187.3237, 98.524), (179.9073, 109.524))\n]\n\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; _ds.dxf.dimasz = 2.5\n _ds.dxf.dimexe = 1.25; _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\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\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,\n angle=(0 if d[0] == \"horizontal\" else 90),\n 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,\n 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,\n 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,\n text=text, dimstyle=\"EZDXF\").render()\n\n doc.saveas(out_path)\n\n\nif __name__ == \"__main__\":\n out = sys.argv[1] if len(sys.argv) > 1 else \"0051_00517645_gt.dxf\"\n draw(out)\n print(\"wrote\", out)\n```"}], "images": ["images/0051_00517645.png"], "id": "0051_00517645"} {"messages": [{"role": "user", "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 69.47 x 100 mm bounding box. It is extruded to a thickness of 252.63 mm."}, {"role": "assistant", "content": "```python\n#!/usr/bin/env python3\n# -*- coding: utf-8 -*-\n# Ground-truth 2D engineering drawing for part: 0052_00525649\n# Self-contained: reproduces the three-view DXF via ezdxf, NO FreeCAD needed.\n# Coordinates are A4 page millimetres (scale=0.27252238805974877, page=[297.0, 210.0]).\n# visible edges -> solid (layer OUTLINE); hidden edges -> dashed (layer HIDDEN)\n# dimensions -> real movable DIMENSION entities (text = true mm value)\n# Run: python 0052_00525649_gt.py [out.dxf]\nimport sys\nimport ezdxf\nimport math\n\nSCALE = 0.27252238805974877\nPAGE = [297.0, 210.0]\n\nVISIBLE_SEGMENTS = [\n (95.478209, 151.586242, 95.478209, 144.797761),\n (95.478209, 172.05, 95.478209, 151.586242),\n (108.960895, 144.797761, 108.960895, 151.295126),\n (108.960895, 151.295126, 108.960895, 172.05),\n (108.960895, 172.05, 111.542687, 172.05),\n (111.542687, 172.05, 111.542687, 144.797761),\n (92.609552, 144.797761, 92.609552, 172.05),\n (92.609552, 172.05, 95.478209, 172.05),\n (95.478209, 61.95, 95.478209, 130.797761),\n (95.478209, 61.95, 108.960895, 61.95),\n (95.478209, 130.797761, 108.960895, 130.797761),\n (108.960895, 61.95, 108.960895, 130.797761),\n (108.960895, 130.797761, 111.542687, 130.797761),\n (111.542687, 61.95, 111.542687, 130.797761),\n (108.960895, 61.95, 111.542687, 61.95),\n (92.609552, 61.95, 92.609552, 130.797761),\n (92.609552, 130.797761, 95.478209, 130.797761),\n (92.609552, 61.95, 95.478209, 61.95),\n (194.390448, 144.797761, 125.542687, 144.797761),\n (125.542687, 144.797761, 125.542687, 172.05),\n (194.390448, 172.05, 125.542687, 172.05),\n (194.390448, 144.797761, 194.390448, 172.05)\n]\nVISIBLE_CIRCLES = [\n\n]\nVISIBLE_ARCS = [\n (102.219552, 144.797761, 6.741343, -0.0, 180.0),\n (102.076119, 144.797761, 9.466567, 43.341758, 134.184385),\n (102.076119, 144.797761, 9.466567, 0.0, 43.341758),\n (102.076119, 144.797761, 9.466567, 134.184385, -180.0)\n]\nHIDDEN_SEGMENTS = [\n (125.5427, 151.5391, 194.3904, 151.5391),\n (125.5427, 154.2643, 194.3904, 154.2643)\n]\n# (orient, text, p1, p2, base) for linear; (orient, text, center, radius, angle) for diameter\nDIMENSIONS = [\n ('horizontal', '9.4737', (108.9609, 172.05), (111.5427, 172.05), (110.2518, 183.05)),\n ('horizontal', '10.5263', (92.6096, 172.05), (95.4782, 172.05), (94.0439, 183.05)),\n ('horizontal', '49.4737', (95.4782, 144.7978), (108.9609, 144.7978), (102.2196, 155.7978)),\n ('horizontal', '69.4737', (111.5427, 144.7978), (92.6096, 144.7978), (102.0761, 133.7978)),\n ('vertical', '100', (95.4782, 172.05), (95.4782, 144.7978), (106.4782, 158.4239)),\n ('radius', 'R24.7368', (102.2195, 144.7978), 6.7413, 45),\n ('radius', 'R34.7368', (102.0761, 144.7978), 9.4666, 135),\n ('horizontal', '252.632', (194.3904, 172.05), (125.5427, 172.05), (159.9666, 161.05))\n]\n\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; _ds.dxf.dimasz = 2.5\n _ds.dxf.dimexe = 1.25; _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\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\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,\n angle=(0 if d[0] == \"horizontal\" else 90),\n 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,\n 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,\n 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,\n text=text, dimstyle=\"EZDXF\").render()\n\n doc.saveas(out_path)\n\n\nif __name__ == \"__main__\":\n out = sys.argv[1] if len(sys.argv) > 1 else \"0052_00525649_gt.dxf\"\n draw(out)\n print(\"wrote\", out)\n```"}], "images": ["images/0052_00525649.png"], "id": "0052_00525649"} {"messages": [{"role": "user", "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 85.71 mm tall, featuring a circular hole of diameter 57.14 mm and a rectangular cutout 71.43 x 21.43 mm. It is extruded to a thickness of 14.14 mm."}, {"role": "assistant", "content": "```python\n#!/usr/bin/env python3\n# -*- coding: utf-8 -*-\n# Ground-truth 2D engineering drawing for part: 0052_00526753\n# Self-contained: reproduces the three-view DXF via ezdxf, NO FreeCAD needed.\n# Coordinates are A4 page millimetres (scale=0.6233818181818175, page=[297.0, 210.0]).\n# visible edges -> solid (layer OUTLINE); hidden edges -> dashed (layer HIDDEN)\n# dimensions -> real movable DIMENSION entities (text = true mm value)\n# Run: python 0052_00526753_gt.py [out.dxf]\nimport sys\nimport ezdxf\nimport math\n\nSCALE = 0.6233818181818175\nPAGE = [297.0, 210.0]\n\nVISIBLE_SEGMENTS = [\n (163.262791, 178.499527, 163.262791, 125.0668),\n (100.924609, 125.0668, 100.924609, 178.499527),\n (100.924609, 178.499527, 163.262791, 178.499527),\n (109.830064, 151.783164, 109.830064, 165.141345),\n (154.357336, 151.783164, 109.830064, 151.783164),\n (154.357336, 165.141345, 154.357336, 151.783164),\n (109.830064, 165.141345, 154.357336, 165.141345),\n (163.262791, 71.08502, 163.262791, 79.897709),\n (100.924609, 71.08502, 100.924609, 79.897709),\n (100.924609, 79.897709, 163.262791, 79.897709),\n (100.924609, 71.08502, 163.262791, 71.08502),\n (186.075481, 93.897709, 186.075481, 94.871743),\n (186.075481, 94.871743, 186.075481, 95.845777),\n (186.075481, 95.845777, 186.075481, 96.819811),\n (186.075481, 96.819811, 186.075481, 97.793845),\n (186.075481, 97.793845, 186.075481, 98.76788),\n (186.075481, 98.76788, 186.075481, 99.741914),\n (186.075481, 99.741914, 186.075481, 100.715948),\n (186.075481, 100.715948, 186.075481, 101.689982),\n (186.075481, 101.689982, 186.075481, 102.664016),\n (186.075481, 102.664016, 186.075481, 103.63805),\n (186.075481, 103.63805, 186.075481, 104.612084),\n (186.075481, 104.612084, 186.075481, 105.586118),\n (186.075481, 105.586118, 186.075481, 106.560152),\n (186.075481, 106.560152, 186.075481, 107.534186),\n (186.075481, 107.534186, 186.075481, 108.50822),\n (186.075481, 108.50822, 186.075481, 109.482255),\n (186.075481, 109.482255, 186.075481, 110.456289),\n (186.075481, 110.456289, 186.075481, 111.430323),\n (186.075481, 111.430323, 186.075481, 112.404357),\n (186.075481, 112.404357, 186.075481, 113.378391),\n (186.075481, 113.378391, 186.075481, 114.352425),\n (186.075481, 114.352425, 186.075481, 115.326459),\n (186.075481, 115.326459, 186.075481, 116.300493),\n (186.075481, 116.300493, 186.075481, 117.274527),\n (186.075481, 117.274527, 186.075481, 118.248561),\n (186.075481, 118.248561, 186.075481, 119.222595),\n (186.075481, 119.222595, 186.075481, 120.19663),\n (186.075481, 120.19663, 186.075481, 121.170664),\n (186.075481, 121.170664, 186.075481, 122.144698),\n (186.075481, 122.144698, 186.075481, 123.118732),\n (186.075481, 123.118732, 186.075481, 124.092766),\n (186.075481, 124.092766, 186.075481, 125.0668),\n (177.262791, 93.897709, 177.262791, 94.871743),\n (177.262791, 94.871743, 177.262791, 95.845777),\n (177.262791, 95.845777, 177.262791, 96.819811),\n (177.262791, 96.819811, 177.262791, 97.793845),\n (177.262791, 97.793845, 177.262791, 98.76788),\n (177.262791, 98.76788, 177.262791, 99.741914),\n (177.262791, 99.741914, 177.262791, 100.715948),\n (177.262791, 100.715948, 177.262791, 101.689982),\n (177.262791, 101.689982, 177.262791, 102.664016),\n (177.262791, 102.664016, 177.262791, 103.63805),\n (177.262791, 103.63805, 177.262791, 104.612084),\n (177.262791, 104.612084, 177.262791, 105.586118),\n (177.262791, 105.586118, 177.262791, 106.560152),\n (177.262791, 106.560152, 177.262791, 107.534186),\n (177.262791, 107.534186, 177.262791, 108.50822),\n (177.262791, 108.50822, 177.262791, 109.482255),\n (177.262791, 109.482255, 177.262791, 110.456289),\n (177.262791, 110.456289, 177.262791, 111.430323),\n (177.262791, 111.430323, 177.262791, 112.404357),\n (177.262791, 112.404357, 177.262791, 113.378391),\n (177.262791, 113.378391, 177.262791, 114.352425),\n (177.262791, 114.352425, 177.262791, 115.326459),\n (177.262791, 115.326459, 177.262791, 116.300493),\n (177.262791, 116.300493, 177.262791, 117.274527),\n (177.262791, 117.274527, 177.262791, 118.248561),\n (177.262791, 118.248561, 177.262791, 119.222595),\n (177.262791, 119.222595, 177.262791, 120.19663),\n (177.262791, 120.19663, 177.262791, 121.170664),\n (177.262791, 121.170664, 177.262791, 122.144698),\n (177.262791, 122.144698, 177.262791, 123.118732),\n (177.262791, 123.118732, 177.262791, 124.092766),\n (177.262791, 124.092766, 177.262791, 125.0668),\n (177.262791, 125.0668, 177.262791, 178.499527),\n (186.075481, 178.499527, 177.262791, 178.499527),\n (186.075481, 125.0668, 186.075481, 178.499527),\n (177.262791, 93.897709, 186.075481, 93.897709),\n (186.075481, 125.0668, 177.262791, 125.0668)\n]\nVISIBLE_CIRCLES = [\n (132.0937, 125.0668, 17.810909)\n]\nVISIBLE_ARCS = [\n (132.0937, 125.0668, 31.169091, -180.0, 0.0)\n]\nHIDDEN_SEGMENTS = [\n (109.83, 71.085, 109.83, 79.8977),\n (154.3573, 71.085, 154.3573, 79.8977),\n (149.9046, 71.085, 149.9046, 79.8977),\n (114.2827, 79.8977, 114.2827, 71.085),\n (186.0754, 151.7832, 177.2627, 151.7832),\n (186.0754, 165.1413, 177.2627, 165.1413),\n (177.2627, 107.2559, 186.0754, 107.2559),\n (177.2627, 142.8777, 186.0754, 142.8777)\n]\n# (orient, text, p1, p2, base) for linear; (orient, text, center, radius, angle) for diameter\nDIMENSIONS = [\n ('horizontal', '100', (163.2627, 125.0668), (100.9246, 125.0668), (132.0937, 114.0668)),\n ('vertical', '85.7143', (163.2627, 178.4995), (163.2627, 125.0668), (174.2627, 151.7832)),\n ('diameter', '%%c57.1429', (132.0937, 125.0668), 17.8109, 45),\n ('horizontal', '50', (100.9246, 125.0668), (132.0937, 125.0668), (116.5091, 136.0668)),\n ('vertical', '85.7143', (132.0937, 178.4995), (132.0937, 125.0668), (143.0937, 151.7832)),\n ('horizontal', '71.4286', (109.83, 165.1413), (154.3573, 165.1413), (132.0937, 176.1413)),\n ('vertical', '21.4286', (109.83, 165.1413), (109.83, 151.7832), (120.83, 158.4623)),\n ('horizontal', '14.2857', (100.9246, 165.1413), (109.83, 165.1413), (105.3773, 176.1413)),\n ('vertical', '21.4286', (109.83, 178.4995), (109.83, 165.1413), (120.83, 171.8204)),\n ('radius', 'R50', (132.0937, 125.0668), 31.1691, 135),\n ('horizontal', '14.1369', (186.0754, 178.4995), (177.2627, 178.4995), (181.6691, 167.4995))\n]\n\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; _ds.dxf.dimasz = 2.5\n _ds.dxf.dimexe = 1.25; _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\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\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,\n angle=(0 if d[0] == \"horizontal\" else 90),\n 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,\n 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,\n 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,\n text=text, dimstyle=\"EZDXF\").render()\n\n doc.saveas(out_path)\n\n\nif __name__ == \"__main__\":\n out = sys.argv[1] if len(sys.argv) > 1 else \"0052_00526753_gt.dxf\"\n draw(out)\n print(\"wrote\", out)\n```"}], "images": ["images/0052_00526753.png"], "id": "0052_00526753"} {"messages": [{"role": "user", "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 40 mm. It is extruded to a thickness of 9.31 mm. The outline includes one or more oblique (angled) edges."}, {"role": "assistant", "content": "```python\n#!/usr/bin/env python3\n# -*- coding: utf-8 -*-\n# Ground-truth 2D engineering drawing for part: 0053_00531855\n# Self-contained: reproduces the three-view DXF via ezdxf, NO FreeCAD needed.\n# Coordinates are A4 page millimetres (scale=0.6572062550303821, page=[297.0, 210.0]).\n# visible edges -> solid (layer OUTLINE); hidden edges -> dashed (layer HIDDEN)\n# dimensions -> real movable DIMENSION entities (text = true mm value)\n# Run: python 0053_00531855_gt.py [out.dxf]\nimport sys\nimport ezdxf\nimport math\n\nSCALE = 0.6572062550303821\nPAGE = [297.0, 210.0]\n\nVISIBLE_SEGMENTS = [\n (100.570395, 163.78674, 166.291021, 163.78674),\n (170.15694, 159.920821, 170.15694, 94.973379),\n (166.291021, 90.334276, 100.570395, 90.334276),\n (96.704476, 94.973379, 96.704476, 159.920821),\n (96.704476, 70.213237, 96.825286, 70.213237),\n (96.825286, 70.213237, 96.946096, 70.213237),\n (96.946096, 70.213237, 97.066906, 70.213237),\n (97.066906, 70.213237, 97.187716, 70.213237),\n (97.187716, 70.213237, 97.308526, 70.213237),\n (97.308526, 70.213237, 97.429336, 70.213237),\n (97.429336, 70.213237, 97.550146, 70.213237),\n (97.550146, 70.213237, 97.670956, 70.213237),\n (97.670956, 70.213237, 97.791766, 70.213237),\n (97.791766, 70.213237, 97.912576, 70.213237),\n (97.912576, 70.213237, 98.033386, 70.213237),\n (98.033386, 70.213237, 98.154196, 70.213237),\n (98.154196, 70.213237, 98.275006, 70.213237),\n (98.275006, 70.213237, 98.395816, 70.213237),\n (98.395816, 70.213237, 98.516626, 70.213237),\n (98.516626, 70.213237, 98.637436, 70.213237),\n (98.637436, 70.213237, 98.758246, 70.213237),\n (98.758246, 70.213237, 98.879056, 70.213237),\n (98.879056, 70.213237, 98.999866, 70.213237),\n (98.999866, 70.213237, 99.120676, 70.213237),\n (99.120676, 70.213237, 99.241486, 70.213237),\n (99.241486, 70.213237, 99.362296, 70.213237),\n (99.362296, 70.213237, 99.483106, 70.213237),\n (99.483106, 70.213237, 99.603916, 70.213237),\n (99.603916, 70.213237, 99.724726, 70.213237),\n (99.724726, 70.213237, 99.845535, 70.213237),\n (99.845535, 70.213237, 99.966345, 70.213237),\n (99.966345, 70.213237, 100.087155, 70.213237),\n (100.087155, 70.213237, 100.207965, 70.213237),\n (100.207965, 70.213237, 100.328775, 70.213237),\n (100.328775, 70.213237, 100.449585, 70.213237),\n (100.449585, 70.213237, 100.570395, 70.213237),\n (96.704476, 76.334276, 96.825286, 76.334276),\n (96.825286, 76.334276, 96.946096, 76.334276),\n (96.946096, 76.334276, 97.066906, 76.334276),\n (97.066906, 76.334276, 97.187716, 76.334276),\n (97.187716, 76.334276, 97.308526, 76.334276),\n (97.308526, 76.334276, 97.429336, 76.334276),\n (97.429336, 76.334276, 97.550146, 76.334276),\n (97.550146, 76.334276, 97.670956, 76.334276),\n (97.670956, 76.334276, 97.791766, 76.334276),\n (97.791766, 76.334276, 97.912576, 76.334276),\n (97.912576, 76.334276, 98.033386, 76.334276),\n (98.033386, 76.334276, 98.154196, 76.334276),\n (98.154196, 76.334276, 98.275006, 76.334276),\n (98.275006, 76.334276, 98.395816, 76.334276),\n (98.395816, 76.334276, 98.516626, 76.334276),\n (98.516626, 76.334276, 98.637436, 76.334276),\n (98.637436, 76.334276, 98.758246, 76.334276),\n (98.758246, 76.334276, 98.879056, 76.334276),\n (98.879056, 76.334276, 98.999866, 76.334276),\n (98.999866, 76.334276, 99.120676, 76.334276),\n (99.120676, 76.334276, 99.241486, 76.334276),\n (99.241486, 76.334276, 99.362296, 76.334276),\n (99.362296, 76.334276, 99.483106, 76.334276),\n (99.483106, 76.334276, 99.603916, 76.334276),\n (99.603916, 76.334276, 99.724726, 76.334276),\n (99.724726, 76.334276, 99.845535, 76.334276),\n (99.845535, 76.334276, 99.966345, 76.334276),\n (99.966345, 76.334276, 100.087155, 76.334276),\n (100.087155, 76.334276, 100.207965, 76.334276),\n (100.207965, 76.334276, 100.328775, 76.334276),\n (100.328775, 76.334276, 100.449585, 76.334276),\n (100.449585, 76.334276, 100.570395, 76.334276),\n (96.704476, 70.213237, 96.704476, 76.334276),\n (100.570395, 76.334276, 166.291021, 76.334276),\n (100.570395, 70.213237, 166.291021, 70.213237),\n (166.291021, 70.213237, 166.411831, 70.213237),\n (166.411831, 70.213237, 166.532641, 70.213237),\n (166.532641, 70.213237, 166.653451, 70.213237),\n (166.653451, 70.213237, 166.774261, 70.213237),\n (166.774261, 70.213237, 166.895071, 70.213237),\n (166.895071, 70.213237, 167.015881, 70.213237),\n (167.015881, 70.213237, 167.136691, 70.213237),\n (167.136691, 70.213237, 167.257501, 70.213237),\n (167.257501, 70.213237, 167.378311, 70.213237),\n (167.378311, 70.213237, 167.499121, 70.213237),\n (167.499121, 70.213237, 167.619931, 70.213237),\n (167.619931, 70.213237, 167.740741, 70.213237),\n (167.740741, 70.213237, 167.86155, 70.213237),\n (167.86155, 70.213237, 167.98236, 70.213237),\n (167.98236, 70.213237, 168.10317, 70.213237),\n (168.10317, 70.213237, 168.22398, 70.213237),\n (168.22398, 70.213237, 168.34479, 70.213237),\n (168.34479, 70.213237, 168.4656, 70.213237),\n (168.4656, 70.213237, 168.58641, 70.213237),\n (168.58641, 70.213237, 168.70722, 70.213237),\n (168.70722, 70.213237, 168.82803, 70.213237),\n (168.82803, 70.213237, 168.94884, 70.213237),\n (168.94884, 70.213237, 169.06965, 70.213237),\n (169.06965, 70.213237, 169.19046, 70.213237),\n (169.19046, 70.213237, 169.31127, 70.213237),\n (169.31127, 70.213237, 169.43208, 70.213237),\n (169.43208, 70.213237, 169.55289, 70.213237),\n (169.55289, 70.213237, 169.6737, 70.213237),\n (169.6737, 70.213237, 169.79451, 70.213237),\n (169.79451, 70.213237, 169.91532, 70.213237),\n (169.91532, 70.213237, 170.03613, 70.213237),\n (170.03613, 70.213237, 170.15694, 70.213237),\n (170.15694, 70.213237, 170.15694, 76.334276),\n (166.291021, 76.334276, 166.411831, 76.334276),\n (166.411831, 76.334276, 166.532641, 76.334276),\n (166.532641, 76.334276, 166.653451, 76.334276),\n (166.653451, 76.334276, 166.774261, 76.334276),\n (166.774261, 76.334276, 166.895071, 76.334276),\n (166.895071, 76.334276, 167.015881, 76.334276),\n (167.015881, 76.334276, 167.136691, 76.334276),\n (167.136691, 76.334276, 167.257501, 76.334276),\n (167.257501, 76.334276, 167.378311, 76.334276),\n (167.378311, 76.334276, 167.499121, 76.334276),\n (167.499121, 76.334276, 167.619931, 76.334276),\n (167.619931, 76.334276, 167.740741, 76.334276),\n (167.740741, 76.334276, 167.86155, 76.334276),\n (167.86155, 76.334276, 167.98236, 76.334276),\n (167.98236, 76.334276, 168.10317, 76.334276),\n (168.10317, 76.334276, 168.22398, 76.334276),\n (168.22398, 76.334276, 168.34479, 76.334276),\n (168.34479, 76.334276, 168.4656, 76.334276),\n (168.4656, 76.334276, 168.58641, 76.334276),\n (168.58641, 76.334276, 168.70722, 76.334276),\n (168.70722, 76.334276, 168.82803, 76.334276),\n (168.82803, 76.334276, 168.94884, 76.334276),\n (168.94884, 76.334276, 169.06965, 76.334276),\n (169.06965, 76.334276, 169.19046, 76.334276),\n (169.19046, 76.334276, 169.31127, 76.334276),\n (169.31127, 76.334276, 169.43208, 76.334276),\n (169.43208, 76.334276, 169.55289, 76.334276),\n (169.55289, 76.334276, 169.6737, 76.334276),\n (169.6737, 76.334276, 169.79451, 76.334276),\n (169.79451, 76.334276, 169.91532, 76.334276),\n (169.91532, 76.334276, 170.03613, 76.334276),\n (170.03613, 76.334276, 170.15694, 76.334276),\n (170.174476, 76.334276, 170.174476, 70.213237),\n (96.68694, 76.334276, 96.68694, 70.213237),\n (100.570395, 70.213237, 100.570395, 76.334276),\n (166.291021, 70.213237, 166.291021, 76.334276),\n (190.295515, 159.920821, 190.295515, 160.041631),\n (190.295515, 160.041631, 190.295515, 160.162441),\n (190.295515, 160.162441, 190.295515, 160.283251),\n (190.295515, 160.283251, 190.295515, 160.404061),\n (190.295515, 160.404061, 190.295515, 160.524871),\n (190.295515, 160.524871, 190.295515, 160.645681),\n (190.295515, 160.645681, 190.295515, 160.766491),\n (190.295515, 160.766491, 190.295515, 160.887301),\n (190.295515, 160.887301, 190.295515, 161.008111),\n (190.295515, 161.008111, 190.295515, 161.128921),\n (190.295515, 161.128921, 190.295515, 161.249731),\n (190.295515, 161.249731, 190.295515, 161.370541),\n (190.295515, 161.370541, 190.295515, 161.49135),\n (190.295515, 161.49135, 190.295515, 161.61216),\n (190.295515, 161.61216, 190.295515, 161.73297),\n (190.295515, 161.73297, 190.295515, 161.85378),\n (190.295515, 161.85378, 190.295515, 161.97459),\n (190.295515, 161.97459, 190.295515, 162.0954),\n (190.295515, 162.0954, 190.295515, 162.21621),\n (190.295515, 162.21621, 190.295515, 162.33702),\n (190.295515, 162.33702, 190.295515, 162.45783),\n (190.295515, 162.45783, 190.295515, 162.57864),\n (190.295515, 162.57864, 190.295515, 162.69945),\n (190.295515, 162.69945, 190.295515, 162.82026),\n (190.295515, 162.82026, 190.295515, 162.94107),\n (190.295515, 162.94107, 190.295515, 163.06188),\n (190.295515, 163.06188, 190.295515, 163.18269),\n (190.295515, 163.18269, 190.295515, 163.3035),\n (190.295515, 163.3035, 190.295515, 163.42431),\n (190.295515, 163.42431, 190.295515, 163.54512),\n (190.295515, 163.54512, 190.295515, 163.66593),\n (190.295515, 163.66593, 190.295515, 163.78674),\n (190.295515, 163.78674, 184.174476, 163.78674),\n (184.174476, 159.920821, 184.174476, 160.041631),\n (184.174476, 160.041631, 184.174476, 160.162441),\n (184.174476, 160.162441, 184.174476, 160.283251),\n (184.174476, 160.283251, 184.174476, 160.404061),\n (184.174476, 160.404061, 184.174476, 160.524871),\n (184.174476, 160.524871, 184.174476, 160.645681),\n (184.174476, 160.645681, 184.174476, 160.766491),\n (184.174476, 160.766491, 184.174476, 160.887301),\n (184.174476, 160.887301, 184.174476, 161.008111),\n (184.174476, 161.008111, 184.174476, 161.128921),\n (184.174476, 161.128921, 184.174476, 161.249731),\n (184.174476, 161.249731, 184.174476, 161.370541),\n (184.174476, 161.370541, 184.174476, 161.49135),\n (184.174476, 161.49135, 184.174476, 161.61216),\n (184.174476, 161.61216, 184.174476, 161.73297),\n (184.174476, 161.73297, 184.174476, 161.85378),\n (184.174476, 161.85378, 184.174476, 161.97459),\n (184.174476, 161.97459, 184.174476, 162.0954),\n (184.174476, 162.0954, 184.174476, 162.21621),\n (184.174476, 162.21621, 184.174476, 162.33702),\n (184.174476, 162.33702, 184.174476, 162.45783),\n (184.174476, 162.45783, 184.174476, 162.57864),\n (184.174476, 162.57864, 184.174476, 162.69945),\n (184.174476, 162.69945, 184.174476, 162.82026),\n (184.174476, 162.82026, 184.174476, 162.94107),\n (184.174476, 162.94107, 184.174476, 163.06188),\n (184.174476, 163.06188, 184.174476, 163.18269),\n (184.174476, 163.18269, 184.174476, 163.3035),\n (184.174476, 163.3035, 184.174476, 163.42431),\n (184.174476, 163.42431, 184.174476, 163.54512),\n (184.174476, 163.54512, 184.174476, 163.66593),\n (184.174476, 163.66593, 184.174476, 163.78674),\n (190.295515, 90.334276, 184.174476, 90.334276),\n (190.295515, 94.973379, 184.174476, 94.973379),\n (184.174476, 94.973379, 184.174476, 159.920821),\n (190.295515, 94.973379, 190.295515, 159.920821),\n (190.295515, 159.920821, 184.174476, 159.920821)\n]\nVISIBLE_CIRCLES = [\n (133.8173, 127.4471, 13.144125)\n]\nVISIBLE_ARCS = [\n (100.570395, 159.920821, 3.865919, 90.0, -180.0),\n (166.291021, 159.920821, 3.865919, -0.0, 90.0),\n (165.904429, 94.586787, 4.270047, -84.805571, 5.194429),\n (100.956987, 94.586787, 4.270047, 174.805571, -95.194429),\n (136.663108, -77.994255, 151.946981, 77.259034, 77.265484),\n (-62.001123, 4099.103646, 4029.463344, -86.697067, -86.696818),\n (120.598425, 337.614464, 268.46742, -95.109898, -95.10617),\n (114.937944, -509.457551, 586.0758, 91.782824, 91.784537),\n (830.533965, 84.668756, 640.274253, 179.077905, 179.492998),\n (-440.293209, 91.942559, 624.469921, -0.147562, 0.27808)\n]\nHIDDEN_SEGMENTS = [\n (146.9614, 70.2132, 146.9614, 76.3343),\n (120.6732, 76.3343, 120.6732, 70.2132),\n (184.1745, 114.303, 190.2955, 114.303),\n (184.1745, 140.5912, 190.2955, 140.5912)\n]\n# (orient, text, p1, p2, base) for linear; (orient, text, center, radius, angle) for diameter\nDIMENSIONS = [\n ('horizontal', '100', (100.5704, 163.7867), (166.291, 163.7867), (133.4307, 174.7867)),\n ('vertical', '98.8235', (170.157, 159.9209), (170.157, 94.9734), (181.157, 127.4471)),\n ('diameter', '%%c40', (133.8173, 127.4471), 13.1441, 45),\n ('horizontal', '56.4706', (96.7044, 127.4471), (133.8173, 127.4471), (115.2609, 138.4471)),\n ('vertical', '55.2941', (133.8173, 163.7867), (133.8173, 127.4471), (144.8173, 145.6169)),\n ('radius', 'R5.8824', (100.5704, 159.9209), 3.866, 45),\n ('radius', 'R6.4973', (165.9045, 94.5868), 4.2701, 45),\n ('horizontal', '9.3137', (190.2955, 159.9209), (184.1745, 159.9209), (187.235, 148.9209))\n]\n\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; _ds.dxf.dimasz = 2.5\n _ds.dxf.dimexe = 1.25; _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\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\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,\n angle=(0 if d[0] == \"horizontal\" else 90),\n 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,\n 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,\n 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,\n text=text, dimstyle=\"EZDXF\").render()\n\n doc.saveas(out_path)\n\n\nif __name__ == \"__main__\":\n out = sys.argv[1] if len(sys.argv) > 1 else \"0053_00531855_gt.dxf\"\n draw(out)\n print(\"wrote\", out)\n```"}], "images": ["images/0053_00531855.png"], "id": "0053_00531855"} {"messages": [{"role": "user", "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": "assistant", "content": "```python\n#!/usr/bin/env python3\n# -*- coding: utf-8 -*-\n# Ground-truth 2D engineering drawing for part: 0053_00535478\n# Self-contained: reproduces the three-view DXF via ezdxf, NO FreeCAD needed.\n# Coordinates are A4 page millimetres (scale=0.5534103896103904, page=[297.0, 210.0]).\n# visible edges -> solid (layer OUTLINE); hidden edges -> dashed (layer HIDDEN)\n# dimensions -> real movable DIMENSION entities (text = true mm value)\n# Run: python 0053_00535478_gt.py [out.dxf]\nimport sys\nimport ezdxf\nimport math\n\nSCALE = 0.5534103896103904\nPAGE = [297.0, 210.0]\n\nVISIBLE_SEGMENTS = [\n (100.021105, 142.128991, 100.021105, 178.828838),\n (81.379913, 197.47003, 81.379913, 142.128991),\n (81.379913, 142.128991, 100.021105, 142.128991),\n (100.021105, 128.128991, 100.021105, 36.53003),\n (100.021105, 128.128991, 99.438568, 128.128991),\n (99.438568, 128.128991, 98.856031, 128.128991),\n (98.856031, 128.128991, 98.273494, 128.128991),\n (98.273494, 128.128991, 97.690956, 128.128991),\n (97.690956, 128.128991, 97.108419, 128.128991),\n (97.108419, 128.128991, 96.525882, 128.128991),\n (96.525882, 128.128991, 95.943345, 128.128991),\n (95.943345, 128.128991, 95.360807, 128.128991),\n (95.360807, 128.128991, 94.77827, 128.128991),\n (94.77827, 128.128991, 94.195733, 128.128991),\n (94.195733, 128.128991, 93.613196, 128.128991),\n (93.613196, 128.128991, 93.030658, 128.128991),\n (93.030658, 128.128991, 92.448121, 128.128991),\n (92.448121, 128.128991, 91.865584, 128.128991),\n (91.865584, 128.128991, 91.283047, 128.128991),\n (91.283047, 128.128991, 90.700509, 128.128991),\n (90.700509, 128.128991, 90.117972, 128.128991),\n (90.117972, 128.128991, 89.535435, 128.128991),\n (89.535435, 128.128991, 88.952898, 128.128991),\n (88.952898, 128.128991, 88.37036, 128.128991),\n (88.37036, 128.128991, 87.787823, 128.128991),\n (87.787823, 128.128991, 87.205286, 128.128991),\n (87.205286, 128.128991, 86.622749, 128.128991),\n (86.622749, 128.128991, 86.040211, 128.128991),\n (86.040211, 128.128991, 85.457674, 128.128991),\n (85.457674, 128.128991, 84.875137, 128.128991),\n (84.875137, 128.128991, 84.2926, 128.128991),\n (84.2926, 128.128991, 83.710062, 128.128991),\n (83.710062, 128.128991, 83.127525, 128.128991),\n (83.127525, 128.128991, 82.544988, 128.128991),\n (82.544988, 128.128991, 81.962451, 128.128991),\n (81.962451, 128.128991, 81.379913, 128.128991),\n (81.379913, 128.128991, 81.379913, 36.53003),\n (100.021105, 36.53003, 99.438568, 36.53003),\n (99.438568, 36.53003, 98.856031, 36.53003),\n (98.856031, 36.53003, 98.273494, 36.53003),\n (98.273494, 36.53003, 97.690956, 36.53003),\n (97.690956, 36.53003, 97.108419, 36.53003),\n (97.108419, 36.53003, 96.525882, 36.53003),\n (96.525882, 36.53003, 95.943345, 36.53003),\n (95.943345, 36.53003, 95.360807, 36.53003),\n (95.360807, 36.53003, 94.77827, 36.53003),\n (94.77827, 36.53003, 94.195733, 36.53003),\n (94.195733, 36.53003, 93.613196, 36.53003),\n (93.613196, 36.53003, 93.030658, 36.53003),\n (93.030658, 36.53003, 92.448121, 36.53003),\n (92.448121, 36.53003, 91.865584, 36.53003),\n (91.865584, 36.53003, 91.283047, 36.53003),\n (91.283047, 36.53003, 90.700509, 36.53003),\n (90.700509, 36.53003, 90.117972, 36.53003),\n (90.117972, 36.53003, 89.535435, 36.53003),\n (89.535435, 36.53003, 88.952898, 36.53003),\n (88.952898, 36.53003, 88.37036, 36.53003),\n (88.37036, 36.53003, 87.787823, 36.53003),\n (87.787823, 36.53003, 87.205286, 36.53003),\n (87.205286, 36.53003, 86.622749, 36.53003),\n (86.622749, 36.53003, 86.040211, 36.53003),\n (86.040211, 36.53003, 85.457674, 36.53003),\n (85.457674, 36.53003, 84.875137, 36.53003),\n (84.875137, 36.53003, 84.2926, 36.53003),\n (84.2926, 36.53003, 83.710062, 36.53003),\n (83.710062, 36.53003, 83.127525, 36.53003),\n (83.127525, 36.53003, 82.544988, 36.53003),\n (82.544988, 36.53003, 81.962451, 36.53003),\n (81.962451, 36.53003, 81.379913, 36.53003),\n (114.021106, 197.47003, 205.620067, 197.47003),\n (205.620067, 197.47003, 205.620067, 142.128991),\n (114.021106, 142.128991, 205.620067, 142.128991),\n (114.021106, 197.47003, 114.021106, 142.128991)\n]\nVISIBLE_CIRCLES = [\n\n]\nVISIBLE_ARCS = [\n (81.379913, 178.828838, 18.641192, -0.0, 90.0)\n]\nHIDDEN_SEGMENTS = [\n\n]\n# (orient, text, p1, p2, base) for linear; (orient, text, center, radius, angle) for diameter\nDIMENSIONS = [\n ('horizontal', '33.6842', (81.3799, 142.129), (100.0211, 142.129), (90.7005, 153.129)),\n ('vertical', '66.3158', (100.0211, 142.129), (100.0211, 178.8288), (89.0211, 160.4789)),\n ('vertical', '100', (81.3799, 197.47), (81.3799, 142.129), (92.3799, 169.7995)),\n ('radius', 'R33.6842', (81.3799, 178.8288), 18.6412, 45),\n ('horizontal', '165.517', (114.0211, 142.129), (205.6201, 142.129), (159.8206, 153.129))\n]\n\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; _ds.dxf.dimasz = 2.5\n _ds.dxf.dimexe = 1.25; _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\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\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,\n angle=(0 if d[0] == \"horizontal\" else 90),\n 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,\n 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,\n 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,\n text=text, dimstyle=\"EZDXF\").render()\n\n doc.saveas(out_path)\n\n\nif __name__ == \"__main__\":\n out = sys.argv[1] if len(sys.argv) > 1 else \"0053_00535478_gt.dxf\"\n draw(out)\n print(\"wrote\", out)\n```"}], "images": ["images/0053_00535478.png"], "id": "0053_00535478"} {"messages": [{"role": "user", "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 67.36 mm. It is extruded to a thickness of 16.92 mm. The outline includes one or more oblique (angled) edges."}, {"role": "assistant", "content": "```python\n#!/usr/bin/env python3\n# -*- coding: utf-8 -*-\n# Ground-truth 2D engineering drawing for part: 0055_00552251\n# Self-contained: reproduces the three-view DXF via ezdxf, NO FreeCAD needed.\n# Coordinates are A4 page millimetres (scale=0.25046269656056136, page=[297.0, 210.0]).\n# visible edges -> solid (layer OUTLINE); hidden edges -> dashed (layer HIDDEN)\n# dimensions -> real movable DIMENSION entities (text = true mm value)\n# Run: python 0055_00552251_gt.py [out.dxf]\nimport sys\nimport ezdxf\nimport math\n\nSCALE = 0.25046269656056136\nPAGE = [297.0, 210.0]\n\nVISIBLE_SEGMENTS = [\n (111.693067, 117.819715, 132.532823, 103.926544),\n (144.441255, 106.407467, 156.349687, 124.270115),\n (153.868763, 136.178547, 133.029007, 150.071718),\n (127.570976, 149.079349, 125.090053, 145.606056),\n (125.090053, 145.606056, 128.563345, 143.125133),\n (128.563345, 143.125133, 116.654913, 124.7663),\n (116.654913, 124.7663, 113.181621, 127.247223),\n (113.181621, 127.247223, 110.700697, 123.773931),\n (110.700697, 88.519892, 110.675852, 88.519892),\n (110.675852, 88.519892, 110.651007, 88.519892),\n (110.651007, 88.519892, 110.626161, 88.519892),\n (110.626161, 88.519892, 110.601316, 88.519892),\n (110.601316, 88.519892, 110.576471, 88.519892),\n (110.576471, 88.519892, 110.551626, 88.519892),\n (110.551626, 88.519892, 110.52678, 88.519892),\n (110.52678, 88.519892, 110.501935, 88.519892),\n (110.501935, 88.519892, 110.47709, 88.519892),\n (110.47709, 88.519892, 110.452244, 88.519892),\n (110.452244, 88.519892, 110.427399, 88.519892),\n (110.427399, 88.519892, 110.402554, 88.519892),\n (110.402554, 88.519892, 110.377709, 88.519892),\n (110.377709, 88.519892, 110.352863, 88.519892),\n (110.352863, 88.519892, 110.328018, 88.519892),\n (110.328018, 88.519892, 110.303173, 88.519892),\n (110.303173, 88.519892, 110.278327, 88.519892),\n (110.278327, 88.519892, 110.253482, 88.519892),\n (110.253482, 88.519892, 110.228637, 88.519892),\n (110.228637, 88.519892, 110.203792, 88.519892),\n (110.203792, 88.519892, 110.178946, 88.519892),\n (110.178946, 88.519892, 110.154101, 88.519892),\n (110.154101, 88.519892, 110.129256, 88.519892),\n (110.129256, 88.519892, 110.10441, 88.519892),\n (110.10441, 88.519892, 110.079565, 88.519892),\n (110.079565, 88.519892, 110.05472, 88.519892),\n (110.05472, 88.519892, 110.029874, 88.519892),\n (110.029874, 88.519892, 110.005029, 88.519892),\n (110.005029, 88.519892, 109.980184, 88.519892),\n (109.980184, 88.519892, 109.955339, 88.519892),\n (109.955339, 88.519892, 109.930493, 88.519892),\n (109.930493, 88.519892, 109.905648, 88.519892),\n (110.700697, 84.28281, 110.675852, 84.28281),\n (110.675852, 84.28281, 110.651007, 84.28281),\n (110.651007, 84.28281, 110.626161, 84.28281),\n (110.626161, 84.28281, 110.601316, 84.28281),\n (110.601316, 84.28281, 110.576471, 84.28281),\n (110.576471, 84.28281, 110.551626, 84.28281),\n (110.551626, 84.28281, 110.52678, 84.28281),\n (110.52678, 84.28281, 110.501935, 84.28281),\n (110.501935, 84.28281, 110.47709, 84.28281),\n (110.47709, 84.28281, 110.452244, 84.28281),\n (110.452244, 84.28281, 110.427399, 84.28281),\n (110.427399, 84.28281, 110.402554, 84.28281),\n (110.402554, 84.28281, 110.377709, 84.28281),\n (110.377709, 84.28281, 110.352863, 84.28281),\n (110.352863, 84.28281, 110.328018, 84.28281),\n (110.328018, 84.28281, 110.303173, 84.28281),\n (110.303173, 84.28281, 110.278327, 84.28281),\n (110.278327, 84.28281, 110.253482, 84.28281),\n (110.253482, 84.28281, 110.228637, 84.28281),\n (110.228637, 84.28281, 110.203792, 84.28281),\n (110.203792, 84.28281, 110.178946, 84.28281),\n (110.178946, 84.28281, 110.154101, 84.28281),\n (110.154101, 84.28281, 110.129256, 84.28281),\n (110.129256, 84.28281, 110.10441, 84.28281),\n (110.10441, 84.28281, 110.079565, 84.28281),\n (110.079565, 84.28281, 110.05472, 84.28281),\n (110.05472, 84.28281, 110.029874, 84.28281),\n (110.029874, 84.28281, 110.005029, 84.28281),\n (110.005029, 84.28281, 109.980184, 84.28281),\n (109.980184, 84.28281, 109.955339, 84.28281),\n (109.955339, 84.28281, 109.930493, 84.28281),\n (109.930493, 84.28281, 109.905648, 84.28281),\n (157.756338, 88.519892, 157.634852, 88.519892),\n (157.634852, 88.519892, 157.513365, 88.519892),\n (157.513365, 88.519892, 157.391878, 88.519892),\n (157.391878, 88.519892, 157.270392, 88.519892),\n (157.270392, 88.519892, 157.148905, 88.519892),\n (157.148905, 88.519892, 157.027418, 88.519892),\n (157.027418, 88.519892, 156.905931, 88.519892),\n (156.905931, 88.519892, 156.784445, 88.519892),\n (156.784445, 88.519892, 156.662958, 88.519892),\n (156.662958, 88.519892, 156.541471, 88.519892),\n (156.541471, 88.519892, 156.419984, 88.519892),\n (156.419984, 88.519892, 156.298498, 88.519892),\n (156.298498, 88.519892, 156.177011, 88.519892),\n (156.177011, 88.519892, 156.055524, 88.519892),\n (156.055524, 88.519892, 155.934038, 88.519892),\n (155.934038, 88.519892, 155.812551, 88.519892),\n (155.812551, 88.519892, 155.691064, 88.519892),\n (155.691064, 88.519892, 155.569577, 88.519892),\n (155.569577, 88.519892, 155.448091, 88.519892),\n (155.448091, 88.519892, 155.326604, 88.519892),\n (155.326604, 88.519892, 155.205117, 88.519892),\n (155.205117, 88.519892, 155.083631, 88.519892),\n (155.083631, 88.519892, 154.962144, 88.519892),\n (154.962144, 88.519892, 154.840657, 88.519892),\n (154.840657, 88.519892, 154.71917, 88.519892),\n (154.71917, 88.519892, 154.597684, 88.519892),\n (154.597684, 88.519892, 154.476197, 88.519892),\n (154.476197, 88.519892, 154.35471, 88.519892),\n (154.35471, 88.519892, 154.233224, 88.519892),\n (154.233224, 88.519892, 154.111737, 88.519892),\n (154.111737, 88.519892, 153.99025, 88.519892),\n (153.99025, 88.519892, 153.868763, 88.519892),\n (157.756338, 84.28281, 157.634852, 84.28281),\n (157.634852, 84.28281, 157.513365, 84.28281),\n (157.513365, 84.28281, 157.391878, 84.28281),\n (157.391878, 84.28281, 157.270392, 84.28281),\n (157.270392, 84.28281, 157.148905, 84.28281),\n (157.148905, 84.28281, 157.027418, 84.28281),\n (157.027418, 84.28281, 156.905931, 84.28281),\n (156.905931, 84.28281, 156.784445, 84.28281),\n (156.784445, 84.28281, 156.662958, 84.28281),\n (156.662958, 84.28281, 156.541471, 84.28281),\n (156.541471, 84.28281, 156.419984, 84.28281),\n (156.419984, 84.28281, 156.298498, 84.28281),\n (156.298498, 84.28281, 156.177011, 84.28281),\n (156.177011, 84.28281, 156.055524, 84.28281),\n (156.055524, 84.28281, 155.934038, 84.28281),\n (155.934038, 84.28281, 155.812551, 84.28281),\n (155.812551, 84.28281, 155.691064, 84.28281),\n (155.691064, 84.28281, 155.569577, 84.28281),\n (155.569577, 84.28281, 155.448091, 84.28281),\n (155.448091, 84.28281, 155.326604, 84.28281),\n (155.326604, 84.28281, 155.205117, 84.28281),\n (155.205117, 84.28281, 155.083631, 84.28281),\n (155.083631, 84.28281, 154.962144, 84.28281),\n (154.962144, 84.28281, 154.840657, 84.28281),\n (154.840657, 84.28281, 154.71917, 84.28281),\n (154.71917, 84.28281, 154.597684, 84.28281),\n (154.597684, 84.28281, 154.476197, 84.28281),\n (154.476197, 84.28281, 154.35471, 84.28281),\n (154.35471, 84.28281, 154.233224, 84.28281),\n (154.233224, 84.28281, 154.111737, 84.28281),\n (154.111737, 84.28281, 153.99025, 84.28281),\n (153.99025, 84.28281, 153.868763, 84.28281),\n (153.868763, 84.28281, 133.029007, 84.28281),\n (133.029007, 88.519892, 133.029007, 84.28281),\n (153.868763, 88.519892, 133.029007, 88.519892),\n (133.029007, 88.519892, 132.858444, 88.519892),\n (132.858444, 88.519892, 132.68788, 88.519892),\n (132.68788, 88.519892, 132.517317, 88.519892),\n (132.517317, 88.519892, 132.346753, 88.519892),\n (132.346753, 88.519892, 132.17619, 88.519892),\n (132.17619, 88.519892, 132.005626, 88.519892),\n (132.005626, 88.519892, 131.835063, 88.519892),\n (131.835063, 88.519892, 131.664499, 88.519892),\n (131.664499, 88.519892, 131.493936, 88.519892),\n (131.493936, 88.519892, 131.323373, 88.519892),\n (131.323373, 88.519892, 131.152809, 88.519892),\n (131.152809, 88.519892, 130.982246, 88.519892),\n (130.982246, 88.519892, 130.811682, 88.519892),\n (130.811682, 88.519892, 130.641119, 88.519892),\n (130.641119, 88.519892, 130.470555, 88.519892),\n (130.470555, 88.519892, 130.299992, 88.519892),\n (130.299992, 88.519892, 130.129428, 88.519892),\n (130.129428, 88.519892, 129.958865, 88.519892),\n (129.958865, 88.519892, 129.788301, 88.519892),\n (129.788301, 88.519892, 129.617738, 88.519892),\n (129.617738, 88.519892, 129.447174, 88.519892),\n (129.447174, 88.519892, 129.276611, 88.519892),\n (129.276611, 88.519892, 129.106047, 88.519892),\n (129.106047, 88.519892, 128.935484, 88.519892),\n (128.935484, 88.519892, 128.76492, 88.519892),\n (128.76492, 88.519892, 128.594357, 88.519892),\n (128.594357, 88.519892, 128.423793, 88.519892),\n (128.423793, 88.519892, 128.25323, 88.519892),\n (128.25323, 88.519892, 128.082666, 88.519892),\n (128.082666, 88.519892, 127.912103, 88.519892),\n (127.912103, 88.519892, 127.741539, 88.519892),\n (127.741539, 88.519892, 127.570976, 88.519892),\n (127.570976, 88.519892, 127.570976, 84.28281),\n (133.029007, 84.28281, 132.858444, 84.28281),\n (132.858444, 84.28281, 132.68788, 84.28281),\n (132.68788, 84.28281, 132.517317, 84.28281),\n (132.517317, 84.28281, 132.346753, 84.28281),\n (132.346753, 84.28281, 132.17619, 84.28281),\n (132.17619, 84.28281, 132.005626, 84.28281),\n (132.005626, 84.28281, 131.835063, 84.28281),\n (131.835063, 84.28281, 131.664499, 84.28281),\n (131.664499, 84.28281, 131.493936, 84.28281),\n (131.493936, 84.28281, 131.323373, 84.28281),\n (131.323373, 84.28281, 131.152809, 84.28281),\n (131.152809, 84.28281, 130.982246, 84.28281),\n (130.982246, 84.28281, 130.811682, 84.28281),\n (130.811682, 84.28281, 130.641119, 84.28281),\n (130.641119, 84.28281, 130.470555, 84.28281),\n (130.470555, 84.28281, 130.299992, 84.28281),\n (130.299992, 84.28281, 130.129428, 84.28281),\n (130.129428, 84.28281, 129.958865, 84.28281),\n (129.958865, 84.28281, 129.788301, 84.28281),\n (129.788301, 84.28281, 129.617738, 84.28281),\n (129.617738, 84.28281, 129.447174, 84.28281),\n (129.447174, 84.28281, 129.276611, 84.28281),\n (129.276611, 84.28281, 129.106047, 84.28281),\n (129.106047, 84.28281, 128.935484, 84.28281),\n (128.935484, 84.28281, 128.76492, 84.28281),\n (128.76492, 84.28281, 128.594357, 84.28281),\n (128.594357, 84.28281, 128.423793, 84.28281),\n (128.423793, 84.28281, 128.25323, 84.28281),\n (128.25323, 84.28281, 128.082666, 84.28281),\n (128.082666, 84.28281, 127.912103, 84.28281),\n (127.912103, 84.28281, 127.741539, 84.28281),\n (127.741539, 84.28281, 127.570976, 84.28281),\n (127.570976, 84.28281, 125.090053, 84.28281),\n (125.090053, 88.519892, 125.090053, 84.28281),\n (127.570976, 88.519892, 125.090053, 88.519892),\n (125.090053, 84.28281, 116.654913, 84.28281),\n (116.654913, 88.519892, 116.654913, 84.28281),\n (125.090053, 88.519892, 116.654913, 88.519892),\n (116.654913, 84.28281, 113.181621, 84.28281),\n (113.181621, 88.519892, 113.181621, 84.28281),\n (116.654913, 88.519892, 113.181621, 88.519892),\n (113.181621, 84.28281, 110.700697, 84.28281),\n (113.181621, 88.519892, 110.700697, 88.519892),\n (109.905648, 84.28281, 109.905648, 88.519892),\n (157.756338, 84.28281, 157.756338, 88.519892),\n (110.700697, 88.519892, 110.700697, 84.28281),\n (153.868763, 88.519892, 153.868763, 84.28281),\n (171.756339, 123.773931, 171.756339, 123.587861),\n (171.756339, 123.587861, 171.756339, 123.401792),\n (171.756339, 123.401792, 171.756339, 123.215723),\n (171.756339, 123.215723, 171.756339, 123.029654),\n (171.756339, 123.029654, 171.756339, 122.843584),\n (171.756339, 122.843584, 171.756339, 122.657515),\n (171.756339, 122.657515, 171.756339, 122.471446),\n (171.756339, 122.471446, 171.756339, 122.285377),\n (171.756339, 122.285377, 171.756339, 122.099307),\n (171.756339, 122.099307, 171.756339, 121.913238),\n (171.756339, 121.913238, 171.756339, 121.727169),\n (171.756339, 121.727169, 171.756339, 121.5411),\n (171.756339, 121.5411, 171.756339, 121.35503),\n (171.756339, 121.35503, 171.756339, 121.168961),\n (171.756339, 121.168961, 171.756339, 120.982892),\n (171.756339, 120.982892, 171.756339, 120.796823),\n (171.756339, 120.796823, 171.756339, 120.610753),\n (171.756339, 120.610753, 171.756339, 120.424684),\n (171.756339, 120.424684, 171.756339, 120.238615),\n (171.756339, 120.238615, 171.756339, 120.052546),\n (171.756339, 120.052546, 171.756339, 119.866476),\n (171.756339, 119.866476, 171.756339, 119.680407),\n (171.756339, 119.680407, 171.756339, 119.494338),\n (171.756339, 119.494338, 171.756339, 119.308269),\n (171.756339, 119.308269, 171.756339, 119.122199),\n (171.756339, 119.122199, 171.756339, 118.93613),\n (171.756339, 118.93613, 171.756339, 118.750061),\n (171.756339, 118.750061, 171.756339, 118.563992),\n (171.756339, 118.563992, 171.756339, 118.377922),\n (171.756339, 118.377922, 171.756339, 118.191853),\n (171.756339, 118.191853, 171.756339, 118.005784),\n (171.756339, 118.005784, 171.756339, 117.819715),\n (171.756339, 117.819715, 175.993421, 117.819715),\n (175.993421, 123.773931, 175.993421, 123.587861),\n (175.993421, 123.587861, 175.993421, 123.401792),\n (175.993421, 123.401792, 175.993421, 123.215723),\n (175.993421, 123.215723, 175.993421, 123.029654),\n (175.993421, 123.029654, 175.993421, 122.843584),\n (175.993421, 122.843584, 175.993421, 122.657515),\n (175.993421, 122.657515, 175.993421, 122.471446),\n (175.993421, 122.471446, 175.993421, 122.285377),\n (175.993421, 122.285377, 175.993421, 122.099307),\n (175.993421, 122.099307, 175.993421, 121.913238),\n (175.993421, 121.913238, 175.993421, 121.727169),\n (175.993421, 121.727169, 175.993421, 121.5411),\n (175.993421, 121.5411, 175.993421, 121.35503),\n (175.993421, 121.35503, 175.993421, 121.168961),\n (175.993421, 121.168961, 175.993421, 120.982892),\n (175.993421, 120.982892, 175.993421, 120.796823),\n (175.993421, 120.796823, 175.993421, 120.610753),\n (175.993421, 120.610753, 175.993421, 120.424684),\n (175.993421, 120.424684, 175.993421, 120.238615),\n (175.993421, 120.238615, 175.993421, 120.052546),\n (175.993421, 120.052546, 175.993421, 119.866476),\n (175.993421, 119.866476, 175.993421, 119.680407),\n (175.993421, 119.680407, 175.993421, 119.494338),\n (175.993421, 119.494338, 175.993421, 119.308269),\n (175.993421, 119.308269, 175.993421, 119.122199),\n (175.993421, 119.122199, 175.993421, 118.93613),\n (175.993421, 118.93613, 175.993421, 118.750061),\n (175.993421, 118.750061, 175.993421, 118.563992),\n (175.993421, 118.563992, 175.993421, 118.377922),\n (175.993421, 118.377922, 175.993421, 118.191853),\n (175.993421, 118.191853, 175.993421, 118.005784),\n (175.993421, 118.005784, 175.993421, 117.819715),\n (175.993421, 117.819715, 175.993421, 103.926544),\n (171.756339, 117.819715, 171.756339, 103.926544),\n (171.756339, 103.926544, 171.756339, 103.882586),\n (171.756339, 103.882586, 171.756339, 103.838628),\n (171.756339, 103.838628, 171.756339, 103.79467),\n (171.756339, 103.79467, 171.756339, 103.750712),\n (171.756339, 103.750712, 171.756339, 103.706755),\n (171.756339, 103.706755, 171.756339, 103.662797),\n (171.756339, 103.662797, 171.756339, 103.618839),\n (171.756339, 103.618839, 171.756339, 103.574881),\n (171.756339, 103.574881, 171.756339, 103.530923),\n (171.756339, 103.530923, 171.756339, 103.486965),\n (171.756339, 103.486965, 171.756339, 103.443007),\n (171.756339, 103.443007, 171.756339, 103.39905),\n (171.756339, 103.39905, 171.756339, 103.355092),\n (171.756339, 103.355092, 171.756339, 103.311134),\n (171.756339, 103.311134, 171.756339, 103.267176),\n (171.756339, 103.267176, 171.756339, 103.223218),\n (171.756339, 103.223218, 171.756339, 103.17926),\n (171.756339, 103.17926, 171.756339, 103.135302),\n (171.756339, 103.135302, 171.756339, 103.091345),\n (171.756339, 103.091345, 171.756339, 103.047387),\n (171.756339, 103.047387, 171.756339, 103.003429),\n (171.756339, 103.003429, 171.756339, 102.959471),\n (171.756339, 102.959471, 171.756339, 102.915513),\n (171.756339, 102.915513, 171.756339, 102.871555),\n (171.756339, 102.871555, 171.756339, 102.827597),\n (171.756339, 102.827597, 171.756339, 102.783639),\n (171.756339, 102.783639, 171.756339, 102.739682),\n (171.756339, 102.739682, 171.756339, 102.695724),\n (171.756339, 102.695724, 171.756339, 102.651766),\n (171.756339, 102.651766, 171.756339, 102.607808),\n (171.756339, 102.607808, 171.756339, 102.56385),\n (171.756339, 102.56385, 171.756339, 102.519892),\n (175.993421, 103.926544, 175.993421, 103.882586),\n (175.993421, 103.882586, 175.993421, 103.838628),\n (175.993421, 103.838628, 175.993421, 103.79467),\n (175.993421, 103.79467, 175.993421, 103.750712),\n (175.993421, 103.750712, 175.993421, 103.706755),\n (175.993421, 103.706755, 175.993421, 103.662797),\n (175.993421, 103.662797, 175.993421, 103.618839),\n (175.993421, 103.618839, 175.993421, 103.574881),\n (175.993421, 103.574881, 175.993421, 103.530923),\n (175.993421, 103.530923, 175.993421, 103.486965),\n (175.993421, 103.486965, 175.993421, 103.443007),\n (175.993421, 103.443007, 175.993421, 103.39905),\n (175.993421, 103.39905, 175.993421, 103.355092),\n (175.993421, 103.355092, 175.993421, 103.311134),\n (175.993421, 103.311134, 175.993421, 103.267176),\n (175.993421, 103.267176, 175.993421, 103.223218),\n (175.993421, 103.223218, 175.993421, 103.17926),\n (175.993421, 103.17926, 175.993421, 103.135302),\n (175.993421, 103.135302, 175.993421, 103.091345),\n (175.993421, 103.091345, 175.993421, 103.047387),\n (175.993421, 103.047387, 175.993421, 103.003429),\n (175.993421, 103.003429, 175.993421, 102.959471),\n (175.993421, 102.959471, 175.993421, 102.915513),\n (175.993421, 102.915513, 175.993421, 102.871555),\n (175.993421, 102.871555, 175.993421, 102.827597),\n (175.993421, 102.827597, 175.993421, 102.783639),\n (175.993421, 102.783639, 175.993421, 102.739682),\n (175.993421, 102.739682, 175.993421, 102.695724),\n (175.993421, 102.695724, 175.993421, 102.651766),\n (175.993421, 102.651766, 175.993421, 102.607808),\n (175.993421, 102.607808, 175.993421, 102.56385),\n (175.993421, 102.56385, 175.993421, 102.519892),\n (171.756339, 150.769202, 171.756339, 150.716394),\n (171.756339, 150.716394, 171.756339, 150.663586),\n (171.756339, 150.663586, 171.756339, 150.610778),\n (171.756339, 150.610778, 171.756339, 150.55797),\n (171.756339, 150.55797, 171.756339, 150.505162),\n (171.756339, 150.505162, 171.756339, 150.452354),\n (171.756339, 150.452354, 171.756339, 150.399547),\n (171.756339, 150.399547, 171.756339, 150.346739),\n (171.756339, 150.346739, 171.756339, 150.293931),\n (171.756339, 150.293931, 171.756339, 150.241123),\n (171.756339, 150.241123, 171.756339, 150.188315),\n (171.756339, 150.188315, 171.756339, 150.135507),\n (171.756339, 150.135507, 171.756339, 150.082699),\n (171.756339, 150.082699, 171.756339, 150.029891),\n (171.756339, 150.029891, 171.756339, 149.977083),\n (171.756339, 149.977083, 171.756339, 149.924275),\n (171.756339, 149.924275, 171.756339, 149.871467),\n (171.756339, 149.871467, 171.756339, 149.818659),\n (171.756339, 149.818659, 171.756339, 149.765852),\n (171.756339, 149.765852, 171.756339, 149.713044),\n (171.756339, 149.713044, 171.756339, 149.660236),\n (171.756339, 149.660236, 171.756339, 149.607428),\n (171.756339, 149.607428, 171.756339, 149.55462),\n (171.756339, 149.55462, 171.756339, 149.501812),\n (171.756339, 149.501812, 171.756339, 149.449004),\n (171.756339, 149.449004, 171.756339, 149.396196),\n (171.756339, 149.396196, 171.756339, 149.343388),\n (171.756339, 149.343388, 171.756339, 149.29058),\n (171.756339, 149.29058, 171.756339, 149.237772),\n (171.756339, 149.237772, 171.756339, 149.184965),\n (171.756339, 149.184965, 171.756339, 149.132157),\n (171.756339, 149.132157, 171.756339, 149.079349),\n (171.756339, 149.079349, 175.993421, 149.079349),\n (175.993421, 150.769202, 175.993421, 150.716394),\n (175.993421, 150.716394, 175.993421, 150.663586),\n (175.993421, 150.663586, 175.993421, 150.610778),\n (175.993421, 150.610778, 175.993421, 150.55797),\n (175.993421, 150.55797, 175.993421, 150.505162),\n (175.993421, 150.505162, 175.993421, 150.452354),\n (175.993421, 150.452354, 175.993421, 150.399547),\n (175.993421, 150.399547, 175.993421, 150.346739),\n (175.993421, 150.346739, 175.993421, 150.293931),\n (175.993421, 150.293931, 175.993421, 150.241123),\n (175.993421, 150.241123, 175.993421, 150.188315),\n (175.993421, 150.188315, 175.993421, 150.135507),\n (175.993421, 150.135507, 175.993421, 150.082699),\n (175.993421, 150.082699, 175.993421, 150.029891),\n (175.993421, 150.029891, 175.993421, 149.977083),\n (175.993421, 149.977083, 175.993421, 149.924275),\n (175.993421, 149.924275, 175.993421, 149.871467),\n (175.993421, 149.871467, 175.993421, 149.818659),\n (175.993421, 149.818659, 175.993421, 149.765852),\n (175.993421, 149.765852, 175.993421, 149.713044),\n (175.993421, 149.713044, 175.993421, 149.660236),\n (175.993421, 149.660236, 175.993421, 149.607428),\n (175.993421, 149.607428, 175.993421, 149.55462),\n (175.993421, 149.55462, 175.993421, 149.501812),\n (175.993421, 149.501812, 175.993421, 149.449004),\n (175.993421, 149.449004, 175.993421, 149.396196),\n (175.993421, 149.396196, 175.993421, 149.343388),\n (175.993421, 149.343388, 175.993421, 149.29058),\n (175.993421, 149.29058, 175.993421, 149.237772),\n (175.993421, 149.237772, 175.993421, 149.184965),\n (175.993421, 149.184965, 175.993421, 149.132157),\n (175.993421, 149.132157, 175.993421, 149.079349),\n (175.993421, 149.079349, 175.993421, 145.606056),\n (171.756339, 145.606056, 175.993421, 145.606056),\n (171.756339, 149.079349, 171.756339, 145.606056),\n (175.993421, 145.606056, 175.993421, 143.125133),\n (171.756339, 143.125133, 175.993421, 143.125133),\n (171.756339, 145.606056, 171.756339, 143.125133),\n (175.993421, 143.125133, 175.993421, 127.247223),\n (171.756339, 143.125133, 171.756339, 127.247223),\n (171.756339, 127.247223, 175.993421, 127.247223),\n (175.993421, 127.247223, 175.993421, 123.773931),\n (171.756339, 127.247223, 171.756339, 123.773931),\n (175.993421, 102.519892, 171.756339, 102.519892),\n (175.993421, 150.769202, 171.756339, 150.769202),\n (171.756339, 123.773931, 175.993421, 123.773931),\n (171.756339, 103.926544, 175.993421, 103.926544)\n]\nVISIBLE_CIRCLES = [\n (136.5023, 124.7663, 8.435139)\n]\nVISIBLE_ARCS = [\n (114.17399, 121.293007, 4.268342, 144.462322, -125.537678),\n (137.246577, 111.121222, 8.601329, -123.231711, -33.231711),\n (149.155009, 128.98387, 8.601329, -33.231711, 56.768289),\n (130.796176, 146.846518, 3.922684, 55.304846, 145.304846)\n]\nHIDDEN_SEGMENTS = [\n (111.6931, 88.5199, 111.6931, 84.2828),\n (128.5634, 88.5199, 128.5634, 84.2828),\n (144.9375, 88.5199, 144.9375, 84.2828),\n (171.7564, 150.0717, 175.9935, 150.0717),\n (171.7564, 124.7663, 175.9935, 124.7663),\n (175.9935, 133.2015, 171.7564, 133.2015),\n (175.9935, 116.3312, 171.7564, 116.3312)\n]\n# (orient, text, p1, p2, base) for linear; (orient, text, center, radius, angle) for diameter\nDIMENSIONS = [\n ('aligned', '100', (111.6931, 117.8197), (132.5329, 103.9266), (128.2147, 120.0257)),\n ('aligned', '85.7143', (144.4413, 106.4075), (156.3497, 124.2701), (141.243, 121.4405)),\n ('aligned', '100', (153.8688, 136.1786), (133.029, 150.0717), (137.3472, 133.9726)),\n ('aligned', '17.0418', (127.571, 149.0794), (125.0901, 145.6061), (135.2816, 140.9491)),\n ('aligned', '17.0418', (125.0901, 145.6061), (128.5634, 143.1252), (133.2204, 153.3167)),\n ('aligned', '87.3695', (128.5634, 143.1252), (116.6549, 124.7663), (131.8377, 127.9596)),\n ('aligned', '17.0418', (116.6549, 124.7663), (113.1817, 127.2472), (108.5247, 117.0557)),\n ('aligned', '17.0418', (113.1817, 127.2472), (110.7007, 123.774), (120.8923, 119.117)),\n ('diameter', '%%c67.3565', (136.5023, 124.7663), 8.4351, 45),\n ('horizontal', '103.016', (110.7007, 124.7663), (136.5023, 124.7663), (123.6015, 135.7663)),\n ('vertical', '83.205', (136.5023, 103.9266), (136.5023, 124.7663), (125.5023, 114.3465)),\n ('radius', 'R17.0418', (114.174, 121.293), 4.2683, 45),\n ('radius', 'R34.3418', (137.2466, 111.1213), 8.6013, 45),\n ('radius', 'R15.6618', (130.7962, 146.8466), 3.9227, 45),\n ('horizontal', '16.917', (171.7564, 123.774), (175.9935, 123.774), (173.8749, 134.774))\n]\n\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; _ds.dxf.dimasz = 2.5\n _ds.dxf.dimexe = 1.25; _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\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\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,\n angle=(0 if d[0] == \"horizontal\" else 90),\n 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,\n 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,\n 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,\n text=text, dimstyle=\"EZDXF\").render()\n\n doc.saveas(out_path)\n\n\nif __name__ == \"__main__\":\n out = sys.argv[1] if len(sys.argv) > 1 else \"0055_00552251_gt.dxf\"\n draw(out)\n print(\"wrote\", out)\n```"}], "images": ["images/0055_00552251.png"], "id": "0055_00552251"} {"messages": [{"role": "user", "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 (diameters 13.87, 50.87 mm). It is extruded to a thickness of 13.28 mm. The outline includes one or more oblique (angled) edges."}, {"role": "assistant", "content": "```python\n#!/usr/bin/env python3\n# -*- coding: utf-8 -*-\n# Ground-truth 2D engineering drawing for part: 0056_00562291\n# Self-contained: reproduces the three-view DXF via ezdxf, NO FreeCAD needed.\n# Coordinates are A4 page millimetres (scale=0.5445086236795945, page=[297.0, 210.0]).\n# visible edges -> solid (layer OUTLINE); hidden edges -> dashed (layer HIDDEN)\n# dimensions -> real movable DIMENSION entities (text = true mm value)\n# Run: python 0056_00562291_gt.py [out.dxf]\nimport sys\nimport ezdxf\nimport math\n\nSCALE = 0.5445086236795945\nPAGE = [297.0, 210.0]\n\nVISIBLE_SEGMENTS = [\n (121.247192, 103.193703, 111.174515, 156.704801),\n (147.058427, 156.704801, 136.98575, 103.193703),\n (110.866185, 68.195617, 112.006828, 68.195617),\n (112.006828, 68.195617, 113.147471, 68.195617),\n (113.147471, 68.195617, 114.288114, 68.195617),\n (114.288114, 68.195617, 115.428757, 68.195617),\n (115.428757, 68.195617, 116.5694, 68.195617),\n (116.5694, 68.195617, 117.710042, 68.195617),\n (117.710042, 68.195617, 118.850685, 68.195617),\n (118.850685, 68.195617, 119.991328, 68.195617),\n (119.991328, 68.195617, 121.131971, 68.195617),\n (121.131971, 68.195617, 122.272614, 68.195617),\n (122.272614, 68.195617, 123.413257, 68.195617),\n (123.413257, 68.195617, 124.5539, 68.195617),\n (124.5539, 68.195617, 125.694543, 68.195617),\n (125.694543, 68.195617, 126.835185, 68.195617),\n (126.835185, 68.195617, 127.975828, 68.195617),\n (127.975828, 68.195617, 129.116471, 68.195617),\n (129.116471, 68.195617, 130.257114, 68.195617),\n (130.257114, 68.195617, 131.397757, 68.195617),\n (131.397757, 68.195617, 132.5384, 68.195617),\n (132.5384, 68.195617, 133.679043, 68.195617),\n (133.679043, 68.195617, 134.819686, 68.195617),\n (134.819686, 68.195617, 135.960328, 68.195617),\n (135.960328, 68.195617, 137.100971, 68.195617),\n (137.100971, 68.195617, 138.241614, 68.195617),\n (138.241614, 68.195617, 139.382257, 68.195617),\n (139.382257, 68.195617, 140.5229, 68.195617),\n (140.5229, 68.195617, 141.663543, 68.195617),\n (141.663543, 68.195617, 142.804186, 68.195617),\n (142.804186, 68.195617, 143.944829, 68.195617),\n (143.944829, 68.195617, 145.085471, 68.195617),\n (145.085471, 68.195617, 146.226114, 68.195617),\n (146.226114, 68.195617, 147.366757, 68.195617),\n (110.866185, 82.654336, 112.006828, 82.654336),\n (112.006828, 82.654336, 113.147471, 82.654336),\n (113.147471, 82.654336, 114.288114, 82.654336),\n (114.288114, 82.654336, 115.428757, 82.654336),\n (115.428757, 82.654336, 116.5694, 82.654336),\n (116.5694, 82.654336, 117.710042, 82.654336),\n (117.710042, 82.654336, 118.850685, 82.654336),\n (118.850685, 82.654336, 119.991328, 82.654336),\n (119.991328, 82.654336, 121.131971, 82.654336),\n (121.131971, 82.654336, 122.272614, 82.654336),\n (122.272614, 82.654336, 123.413257, 82.654336),\n (123.413257, 82.654336, 124.5539, 82.654336),\n (124.5539, 82.654336, 125.694543, 82.654336),\n (125.694543, 82.654336, 126.835185, 82.654336),\n (126.835185, 82.654336, 127.975828, 82.654336),\n (127.975828, 82.654336, 129.116471, 82.654336),\n (129.116471, 82.654336, 130.257114, 82.654336),\n (130.257114, 82.654336, 131.397757, 82.654336),\n (131.397757, 82.654336, 132.5384, 82.654336),\n (132.5384, 82.654336, 133.679043, 82.654336),\n (133.679043, 82.654336, 134.819686, 82.654336),\n (134.819686, 82.654336, 135.960328, 82.654336),\n (135.960328, 82.654336, 137.100971, 82.654336),\n (137.100971, 82.654336, 138.241614, 82.654336),\n (138.241614, 82.654336, 139.382257, 82.654336),\n (139.382257, 82.654336, 140.5229, 82.654336),\n (140.5229, 82.654336, 141.663543, 82.654336),\n (141.663543, 82.654336, 142.804186, 82.654336),\n (142.804186, 82.654336, 143.944829, 82.654336),\n (143.944829, 82.654336, 145.085471, 82.654336),\n (145.085471, 82.654336, 146.226114, 82.654336),\n (146.226114, 82.654336, 147.366757, 82.654336),\n (110.866185, 82.654336, 110.866185, 68.195617),\n (147.366757, 82.654336, 147.366757, 68.195617),\n (175.825477, 156.704801, 175.825477, 157.379514),\n (175.825477, 157.379514, 175.825477, 158.054227),\n (175.825477, 158.054227, 175.825477, 158.72894),\n (175.825477, 158.72894, 175.825477, 159.403653),\n (175.825477, 159.403653, 175.825477, 160.078366),\n (175.825477, 160.078366, 175.825477, 160.753079),\n (175.825477, 160.753079, 175.825477, 161.427792),\n (175.825477, 161.427792, 175.825477, 162.102505),\n (175.825477, 162.102505, 175.825477, 162.777218),\n (175.825477, 162.777218, 175.825477, 163.451931),\n (175.825477, 163.451931, 175.825477, 164.126644),\n (175.825477, 164.126644, 175.825477, 164.801357),\n (175.825477, 164.801357, 175.825477, 165.47607),\n (175.825477, 165.47607, 175.825477, 166.150783),\n (175.825477, 166.150783, 175.825477, 166.825496),\n (175.825477, 166.825496, 175.825477, 167.500209),\n (175.825477, 167.500209, 175.825477, 168.174922),\n (175.825477, 168.174922, 175.825477, 168.849635),\n (175.825477, 168.849635, 175.825477, 169.524348),\n (175.825477, 169.524348, 175.825477, 170.199061),\n (175.825477, 170.199061, 175.825477, 170.873774),\n (175.825477, 170.873774, 175.825477, 171.548487),\n (175.825477, 171.548487, 175.825477, 172.2232),\n (175.825477, 172.2232, 175.825477, 172.897913),\n (175.825477, 172.897913, 175.825477, 173.572626),\n (175.825477, 173.572626, 175.825477, 174.247339),\n (175.825477, 174.247339, 175.825477, 174.922052),\n (175.825477, 174.922052, 175.825477, 175.596765),\n (175.825477, 175.596765, 175.825477, 176.271478),\n (175.825477, 176.271478, 175.825477, 176.946191),\n (175.825477, 176.946191, 175.825477, 177.620904),\n (175.825477, 177.620904, 175.825477, 178.295617),\n (161.366757, 156.704801, 161.366757, 157.379514),\n (161.366757, 157.379514, 161.366757, 158.054227),\n (161.366757, 158.054227, 161.366757, 158.72894),\n (161.366757, 158.72894, 161.366757, 159.403653),\n (161.366757, 159.403653, 161.366757, 160.078366),\n (161.366757, 160.078366, 161.366757, 160.753079),\n (161.366757, 160.753079, 161.366757, 161.427792),\n (161.366757, 161.427792, 161.366757, 162.102505),\n (161.366757, 162.102505, 161.366757, 162.777218),\n (161.366757, 162.777218, 161.366757, 163.451931),\n (161.366757, 163.451931, 161.366757, 164.126644),\n (161.366757, 164.126644, 161.366757, 164.801357),\n (161.366757, 164.801357, 161.366757, 165.47607),\n (161.366757, 165.47607, 161.366757, 166.150783),\n (161.366757, 166.150783, 161.366757, 166.825496),\n (161.366757, 166.825496, 161.366757, 167.500209),\n (161.366757, 167.500209, 161.366757, 168.174922),\n (161.366757, 168.174922, 161.366757, 168.849635),\n (161.366757, 168.849635, 161.366757, 169.524348),\n (161.366757, 169.524348, 161.366757, 170.199061),\n (161.366757, 170.199061, 161.366757, 170.873774),\n (161.366757, 170.873774, 161.366757, 171.548487),\n (161.366757, 171.548487, 161.366757, 172.2232),\n (161.366757, 172.2232, 161.366757, 172.897913),\n (161.366757, 172.897913, 161.366757, 173.572626),\n (161.366757, 173.572626, 161.366757, 174.247339),\n (161.366757, 174.247339, 161.366757, 174.922052),\n (161.366757, 174.922052, 161.366757, 175.596765),\n (161.366757, 175.596765, 161.366757, 176.271478),\n (161.366757, 176.271478, 161.366757, 176.946191),\n (161.366757, 176.946191, 161.366757, 177.620904),\n (161.366757, 177.620904, 161.366757, 178.295617),\n (161.366757, 103.193703, 161.366757, 156.704801),\n (175.825477, 103.193703, 175.825477, 156.704801),\n (161.366757, 96.654336, 161.366757, 96.858692),\n (161.366757, 96.858692, 161.366757, 97.063047),\n (161.366757, 97.063047, 161.366757, 97.267402),\n (161.366757, 97.267402, 161.366757, 97.471757),\n (161.366757, 97.471757, 161.366757, 97.676112),\n (161.366757, 97.676112, 161.366757, 97.880468),\n (161.366757, 97.880468, 161.366757, 98.084823),\n (161.366757, 98.084823, 161.366757, 98.289178),\n (161.366757, 98.289178, 161.366757, 98.493533),\n (161.366757, 98.493533, 161.366757, 98.697888),\n (161.366757, 98.697888, 161.366757, 98.902244),\n (161.366757, 98.902244, 161.366757, 99.106599),\n (161.366757, 99.106599, 161.366757, 99.310954),\n (161.366757, 99.310954, 161.366757, 99.515309),\n (161.366757, 99.515309, 161.366757, 99.719664),\n (161.366757, 99.719664, 161.366757, 99.92402),\n (161.366757, 99.92402, 161.366757, 100.128375),\n (161.366757, 100.128375, 161.366757, 100.33273),\n (161.366757, 100.33273, 161.366757, 100.537085),\n (161.366757, 100.537085, 161.366757, 100.741441),\n (161.366757, 100.741441, 161.366757, 100.945796),\n (161.366757, 100.945796, 161.366757, 101.150151),\n (161.366757, 101.150151, 161.366757, 101.354506),\n (161.366757, 101.354506, 161.366757, 101.558861),\n (161.366757, 101.558861, 161.366757, 101.763217),\n (161.366757, 101.763217, 161.366757, 101.967572),\n (161.366757, 101.967572, 161.366757, 102.171927),\n (161.366757, 102.171927, 161.366757, 102.376282),\n (161.366757, 102.376282, 161.366757, 102.580637),\n (161.366757, 102.580637, 161.366757, 102.784993),\n (161.366757, 102.784993, 161.366757, 102.989348),\n (161.366757, 102.989348, 161.366757, 103.193703),\n (175.825477, 96.654336, 175.825477, 96.858692),\n (175.825477, 96.858692, 175.825477, 97.063047),\n (175.825477, 97.063047, 175.825477, 97.267402),\n (175.825477, 97.267402, 175.825477, 97.471757),\n (175.825477, 97.471757, 175.825477, 97.676112),\n (175.825477, 97.676112, 175.825477, 97.880468),\n (175.825477, 97.880468, 175.825477, 98.084823),\n (175.825477, 98.084823, 175.825477, 98.289178),\n (175.825477, 98.289178, 175.825477, 98.493533),\n (175.825477, 98.493533, 175.825477, 98.697888),\n (175.825477, 98.697888, 175.825477, 98.902244),\n (175.825477, 98.902244, 175.825477, 99.106599),\n (175.825477, 99.106599, 175.825477, 99.310954),\n (175.825477, 99.310954, 175.825477, 99.515309),\n (175.825477, 99.515309, 175.825477, 99.719664),\n (175.825477, 99.719664, 175.825477, 99.92402),\n (175.825477, 99.92402, 175.825477, 100.128375),\n (175.825477, 100.128375, 175.825477, 100.33273),\n (175.825477, 100.33273, 175.825477, 100.537085),\n (175.825477, 100.537085, 175.825477, 100.741441),\n (175.825477, 100.741441, 175.825477, 100.945796),\n (175.825477, 100.945796, 175.825477, 101.150151),\n (175.825477, 101.150151, 175.825477, 101.354506),\n (175.825477, 101.354506, 175.825477, 101.558861),\n (175.825477, 101.558861, 175.825477, 101.763217),\n (175.825477, 101.763217, 175.825477, 101.967572),\n (175.825477, 101.967572, 175.825477, 102.171927),\n (175.825477, 102.171927, 175.825477, 102.376282),\n (175.825477, 102.376282, 175.825477, 102.580637),\n (175.825477, 102.580637, 175.825477, 102.784993),\n (175.825477, 102.784993, 175.825477, 102.989348),\n (175.825477, 102.989348, 175.825477, 103.193703),\n (161.366757, 178.295617, 175.825477, 178.295617),\n (161.366757, 96.654336, 175.825477, 96.654336),\n (161.366757, 156.704801, 175.825477, 156.704801),\n (161.366757, 103.193703, 175.825477, 103.193703)\n]\nVISIBLE_CIRCLES = [\n (128.8017, 159.852512, 13.849931),\n (128.8017, 104.452788, 3.777254)\n]\nVISIBLE_ARCS = [\n (129.116471, 160.045331, 18.250286, -10.546875, -169.453125),\n (129.116471, 104.658848, 8.004511, -169.453125, -10.546875)\n]\nHIDDEN_SEGMENTS = [\n (142.6516, 82.6543, 142.6516, 68.1956),\n (132.579, 82.6543, 132.579, 68.1956),\n (114.9518, 82.6543, 114.9518, 68.1956),\n (125.0245, 82.6543, 125.0245, 68.1956),\n (161.3668, 146.0026, 175.8255, 146.0026),\n (161.3668, 173.7024, 175.8255, 173.7024),\n (161.3668, 100.6755, 175.8255, 100.6755),\n (161.3668, 108.23, 175.8255, 108.23)\n]\n# (orient, text, p1, p2, base) for linear; (orient, text, center, radius, angle) for diameter\nDIMENSIONS = [\n ('horizontal', '28.9041', (136.9858, 103.1937), (121.2472, 103.1937), (129.1165, 92.1937)),\n ('horizontal', '65.9015', (111.1745, 156.7048), (147.0584, 156.7048), (129.1165, 167.7048)),\n ('aligned', '100', (147.0584, 156.7048), (136.9858, 103.1937), (152.8322, 127.9144)),\n ('aligned', '100', (121.2472, 103.1937), (111.1745, 156.7048), (105.4007, 127.9144)),\n ('diameter', '%%c50.8713', (128.8017, 159.8525), 13.8499, 45),\n ('horizontal', '32.3726', (111.1745, 159.8525), (128.8017, 159.8525), (119.9881, 170.8525)),\n ('vertical', '5.7808', (128.8017, 156.7048), (128.8017, 159.8525), (117.8017, 158.2787)),\n ('diameter', '%%c13.874', (128.8017, 104.4528), 3.7773, 45),\n ('horizontal', '32.3726', (111.1745, 104.4528), (128.8017, 104.4528), (119.9881, 115.4528)),\n ('vertical', '95.9618', (128.8017, 156.7048), (128.8017, 104.4528), (139.8017, 130.5788)),\n ('radius', 'R33.517', (129.1165, 160.0453), 18.2503, 45),\n ('radius', 'R14.7004', (129.1165, 104.6588), 8.0045, 45),\n ('horizontal', '26.5537', (175.8255, 156.7048), (161.3667, 156.7048), (168.5961, 145.7048))\n]\n\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; _ds.dxf.dimasz = 2.5\n _ds.dxf.dimexe = 1.25; _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\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\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,\n angle=(0 if d[0] == \"horizontal\" else 90),\n 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,\n 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,\n 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,\n text=text, dimstyle=\"EZDXF\").render()\n\n doc.saveas(out_path)\n\n\nif __name__ == \"__main__\":\n out = sys.argv[1] if len(sys.argv) > 1 else \"0056_00562291_gt.dxf\"\n draw(out)\n print(\"wrote\", out)\n```"}], "images": ["images/0056_00562291.png"], "id": "0056_00562291"} {"messages": [{"role": "user", "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 124.68 mm. The outline includes one or more oblique (angled) edges."}, {"role": "assistant", "content": "```python\n#!/usr/bin/env python3\n# -*- coding: utf-8 -*-\n# Ground-truth 2D engineering drawing for part: 0056_00567683\n# Self-contained: reproduces the three-view DXF via ezdxf, NO FreeCAD needed.\n# Coordinates are A4 page millimetres (scale=0.43177415392176083, page=[297.0, 210.0]).\n# visible edges -> solid (layer OUTLINE); hidden edges -> dashed (layer HIDDEN)\n# dimensions -> real movable DIMENSION entities (text = true mm value)\n# Run: python 0056_00567683_gt.py [out.dxf]\nimport sys\nimport ezdxf\nimport math\n\nSCALE = 0.43177415392176083\nPAGE = [297.0, 210.0]\n\nVISIBLE_SEGMENTS = [\n (131.172906, 129.781602, 131.172906, 172.050019),\n (131.172906, 172.050019, 124.35542, 172.050019),\n (124.35542, 172.050019, 103.448461, 139.780582),\n (94.358479, 146.14357, 87.995491, 146.14357),\n (87.995491, 146.14357, 87.995491, 129.781602),\n (87.995491, 129.781602, 131.172906, 129.781602),\n (131.172906, 115.781602, 131.172906, 61.950019),\n (131.172906, 61.950019, 124.35542, 61.950019),\n (124.35542, 115.781602, 124.35542, 61.950019),\n (131.172906, 115.781602, 124.35542, 115.781602),\n (124.35542, 61.950019, 103.448461, 61.950019),\n (124.35542, 115.781602, 103.448461, 115.781602),\n (103.448461, 61.950019, 103.164399, 61.950019),\n (103.164399, 61.950019, 102.880337, 61.950019),\n (102.880337, 61.950019, 102.596275, 61.950019),\n (102.596275, 61.950019, 102.312213, 61.950019),\n (102.312213, 61.950019, 102.028151, 61.950019),\n (102.028151, 61.950019, 101.744089, 61.950019),\n (101.744089, 61.950019, 101.460027, 61.950019),\n (101.460027, 61.950019, 101.175965, 61.950019),\n (101.175965, 61.950019, 100.891903, 61.950019),\n (100.891903, 61.950019, 100.607841, 61.950019),\n (100.607841, 61.950019, 100.323779, 61.950019),\n (100.323779, 61.950019, 100.039717, 61.950019),\n (100.039717, 61.950019, 99.755656, 61.950019),\n (99.755656, 61.950019, 99.471594, 61.950019),\n (99.471594, 61.950019, 99.187532, 61.950019),\n (99.187532, 61.950019, 98.90347, 61.950019),\n (98.90347, 61.950019, 98.619408, 61.950019),\n (98.619408, 61.950019, 98.335346, 61.950019),\n (98.335346, 61.950019, 98.051284, 61.950019),\n (98.051284, 61.950019, 97.767222, 61.950019),\n (97.767222, 61.950019, 97.48316, 61.950019),\n (97.48316, 61.950019, 97.199098, 61.950019),\n (97.199098, 61.950019, 96.915036, 61.950019),\n (96.915036, 61.950019, 96.630974, 61.950019),\n (96.630974, 61.950019, 96.346912, 61.950019),\n (96.346912, 61.950019, 96.06285, 61.950019),\n (96.06285, 61.950019, 95.778788, 61.950019),\n (95.778788, 61.950019, 95.494726, 61.950019),\n (95.494726, 61.950019, 95.210664, 61.950019),\n (95.210664, 61.950019, 94.926602, 61.950019),\n (94.926602, 61.950019, 94.642541, 61.950019),\n (94.642541, 61.950019, 94.358479, 61.950019),\n (94.358479, 115.781602, 94.358479, 61.950019),\n (103.448461, 115.781602, 103.164399, 115.781602),\n (103.164399, 115.781602, 102.880337, 115.781602),\n (102.880337, 115.781602, 102.596275, 115.781602),\n (102.596275, 115.781602, 102.312213, 115.781602),\n (102.312213, 115.781602, 102.028151, 115.781602),\n (102.028151, 115.781602, 101.744089, 115.781602),\n (101.744089, 115.781602, 101.460027, 115.781602),\n (101.460027, 115.781602, 101.175965, 115.781602),\n (101.175965, 115.781602, 100.891903, 115.781602),\n (100.891903, 115.781602, 100.607841, 115.781602),\n (100.607841, 115.781602, 100.323779, 115.781602),\n (100.323779, 115.781602, 100.039717, 115.781602),\n (100.039717, 115.781602, 99.755656, 115.781602),\n (99.755656, 115.781602, 99.471594, 115.781602),\n (99.471594, 115.781602, 99.187532, 115.781602),\n (99.187532, 115.781602, 98.90347, 115.781602),\n (98.90347, 115.781602, 98.619408, 115.781602),\n (98.619408, 115.781602, 98.335346, 115.781602),\n (98.335346, 115.781602, 98.051284, 115.781602),\n (98.051284, 115.781602, 97.767222, 115.781602),\n (97.767222, 115.781602, 97.48316, 115.781602),\n (97.48316, 115.781602, 97.199098, 115.781602),\n (97.199098, 115.781602, 96.915036, 115.781602),\n (96.915036, 115.781602, 96.630974, 115.781602),\n (96.630974, 115.781602, 96.346912, 115.781602),\n (96.346912, 115.781602, 96.06285, 115.781602),\n (96.06285, 115.781602, 95.778788, 115.781602),\n (95.778788, 115.781602, 95.494726, 115.781602),\n (95.494726, 115.781602, 95.210664, 115.781602),\n (95.210664, 115.781602, 94.926602, 115.781602),\n (94.926602, 115.781602, 94.642541, 115.781602),\n (94.642541, 115.781602, 94.358479, 115.781602),\n (94.358479, 61.950019, 87.995491, 61.950019),\n (87.995491, 115.781602, 87.995491, 61.950019),\n (94.358479, 115.781602, 87.995491, 115.781602),\n (103.448461, 115.781602, 103.448461, 61.950019),\n (145.172906, 172.050019, 199.004489, 172.050019),\n (199.004489, 172.050019, 199.004489, 146.14357),\n (145.172906, 172.050019, 145.172906, 146.14357),\n (145.172906, 146.14357, 199.004489, 146.14357),\n (199.004489, 146.14357, 199.004489, 129.781602),\n (145.172906, 129.781602, 199.004489, 129.781602),\n (145.172906, 146.14357, 145.172906, 129.781602)\n]\nVISIBLE_CIRCLES = [\n\n]\nVISIBLE_ARCS = [\n (98.786288, 142.794674, 5.551631, 142.898605, -32.882645)\n]\nHIDDEN_SEGMENTS = [\n (93.2347, 61.95, 93.2347, 115.7816),\n (199.0045, 137.243, 145.1729, 137.243)\n]\n# (orient, text, p1, p2, base) for linear; (orient, text, center, radius, angle) for diameter\nDIMENSIONS = [\n ('horizontal', '14.7368', (94.3585, 146.1436), (87.9955, 146.1436), (91.177, 135.1436)),\n ('horizontal', '15.7895', (131.1729, 172.05), (124.3554, 172.05), (127.7642, 161.05)),\n ('horizontal', '100', (87.9955, 129.7816), (131.1729, 129.7816), (109.5842, 140.7816)),\n ('vertical', '37.8947', (87.9955, 146.1436), (87.9955, 129.7816), (98.9955, 137.9626)),\n ('vertical', '97.8947', (131.1729, 129.7816), (131.1729, 172.05), (120.1729, 150.9158)),\n ('aligned', '89.0516', (124.3554, 172.05), (103.4485, 139.7806), (123.1337, 149.9341)),\n ('radius', 'R12.8577', (98.7863, 142.7947), 5.5516, 45),\n ('horizontal', '124.675', (145.1729, 129.7816), (199.0045, 129.7816), (172.0887, 140.7816))\n]\n\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; _ds.dxf.dimasz = 2.5\n _ds.dxf.dimexe = 1.25; _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\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\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,\n angle=(0 if d[0] == \"horizontal\" else 90),\n 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,\n 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,\n 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,\n text=text, dimstyle=\"EZDXF\").render()\n\n doc.saveas(out_path)\n\n\nif __name__ == \"__main__\":\n out = sys.argv[1] if len(sys.argv) > 1 else \"0056_00567683_gt.dxf\"\n draw(out)\n print(\"wrote\", out)\n```"}], "images": ["images/0056_00567683.png"], "id": "0056_00567683"} {"messages": [{"role": "user", "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 116.9 x 100 mm. It is extruded to a thickness of 6422.54 mm. The outline includes one or more oblique (angled) edges."}, {"role": "assistant", "content": "```python\n#!/usr/bin/env python3\n# -*- coding: utf-8 -*-\n# Ground-truth 2D engineering drawing for part: 0056_00569863\n# Self-contained: reproduces the three-view DXF via ezdxf, NO FreeCAD needed.\n# Coordinates are A4 page millimetres (scale=0.014657572502684402, page=[297.0, 210.0]).\n# visible edges -> solid (layer OUTLINE); hidden edges -> dashed (layer HIDDEN)\n# dimensions -> real movable DIMENSION entities (text = true mm value)\n# Run: python 0056_00569863_gt.py [out.dxf]\nimport sys\nimport ezdxf\nimport math\n\nSCALE = 0.014657572502684402\nPAGE = [297.0, 210.0]\n\nVISIBLE_SEGMENTS = [\n (88.697721, 172.000485, 90.163479, 172.000485),\n (90.411212, 171.752751, 90.411212, 170.286994),\n (90.163479, 170.03926, 88.697721, 170.03926),\n (88.449988, 170.286994, 88.449988, 171.752751),\n (90.163479, 171.505018, 90.163479, 170.534728),\n (88.945455, 171.752751, 89.915745, 171.752751),\n (88.697721, 171.505018, 88.449988, 171.752751),\n (88.697721, 170.534728, 88.697721, 171.505018),\n (89.915745, 170.286994, 88.945455, 170.286994),\n (88.449988, 61.900485, 88.457729, 61.900485),\n (88.457729, 61.900485, 88.465471, 61.900485),\n (88.465471, 61.900485, 88.473213, 61.900485),\n (88.473213, 61.900485, 88.480954, 61.900485),\n (88.480954, 61.900485, 88.488696, 61.900485),\n (88.488696, 61.900485, 88.496438, 61.900485),\n (88.496438, 61.900485, 88.504179, 61.900485),\n (88.504179, 61.900485, 88.511921, 61.900485),\n (88.511921, 61.900485, 88.519663, 61.900485),\n (88.519663, 61.900485, 88.527404, 61.900485),\n (88.527404, 61.900485, 88.535146, 61.900485),\n (88.535146, 61.900485, 88.542888, 61.900485),\n (88.542888, 61.900485, 88.55063, 61.900485),\n (88.55063, 61.900485, 88.558371, 61.900485),\n (88.558371, 61.900485, 88.566113, 61.900485),\n (88.566113, 61.900485, 88.573855, 61.900485),\n (88.573855, 61.900485, 88.581596, 61.900485),\n (88.581596, 61.900485, 88.589338, 61.900485),\n (88.589338, 61.900485, 88.59708, 61.900485),\n (88.59708, 61.900485, 88.604821, 61.900485),\n (88.604821, 61.900485, 88.612563, 61.900485),\n (88.612563, 61.900485, 88.620305, 61.900485),\n (88.620305, 61.900485, 88.628046, 61.900485),\n (88.628046, 61.900485, 88.635788, 61.900485),\n (88.635788, 61.900485, 88.64353, 61.900485),\n (88.64353, 61.900485, 88.651271, 61.900485),\n (88.651271, 61.900485, 88.659013, 61.900485),\n (88.659013, 61.900485, 88.666755, 61.900485),\n (88.666755, 61.900485, 88.674496, 61.900485),\n (88.674496, 61.900485, 88.682238, 61.900485),\n (88.682238, 61.900485, 88.68998, 61.900485),\n (88.68998, 61.900485, 88.697721, 61.900485),\n (88.449988, 156.03926, 88.457729, 156.03926),\n (88.457729, 156.03926, 88.465471, 156.03926),\n (88.465471, 156.03926, 88.473213, 156.03926),\n (88.473213, 156.03926, 88.480954, 156.03926),\n (88.480954, 156.03926, 88.488696, 156.03926),\n (88.488696, 156.03926, 88.496438, 156.03926),\n (88.496438, 156.03926, 88.504179, 156.03926),\n (88.504179, 156.03926, 88.511921, 156.03926),\n (88.511921, 156.03926, 88.519663, 156.03926),\n (88.519663, 156.03926, 88.527404, 156.03926),\n (88.527404, 156.03926, 88.535146, 156.03926),\n (88.535146, 156.03926, 88.542888, 156.03926),\n (88.542888, 156.03926, 88.55063, 156.03926),\n (88.55063, 156.03926, 88.558371, 156.03926),\n (88.558371, 156.03926, 88.566113, 156.03926),\n (88.566113, 156.03926, 88.573855, 156.03926),\n (88.573855, 156.03926, 88.581596, 156.03926),\n (88.581596, 156.03926, 88.589338, 156.03926),\n (88.589338, 156.03926, 88.59708, 156.03926),\n (88.59708, 156.03926, 88.604821, 156.03926),\n (88.604821, 156.03926, 88.612563, 156.03926),\n (88.612563, 156.03926, 88.620305, 156.03926),\n (88.620305, 156.03926, 88.628046, 156.03926),\n (88.628046, 156.03926, 88.635788, 156.03926),\n (88.635788, 156.03926, 88.64353, 156.03926),\n (88.64353, 156.03926, 88.651271, 156.03926),\n (88.651271, 156.03926, 88.659013, 156.03926),\n (88.659013, 156.03926, 88.666755, 156.03926),\n (88.666755, 156.03926, 88.674496, 156.03926),\n (88.674496, 156.03926, 88.682238, 156.03926),\n (88.682238, 156.03926, 88.68998, 156.03926),\n (88.68998, 156.03926, 88.697721, 156.03926),\n (88.449988, 61.900485, 88.449988, 156.03926),\n (88.697721, 156.03926, 90.163479, 156.03926),\n (88.697721, 61.900485, 90.163479, 61.900485),\n (90.163479, 61.900485, 90.17122, 61.900485),\n (90.17122, 61.900485, 90.178962, 61.900485),\n (90.178962, 61.900485, 90.186704, 61.900485),\n (90.186704, 61.900485, 90.194445, 61.900485),\n (90.194445, 61.900485, 90.202187, 61.900485),\n (90.202187, 61.900485, 90.209929, 61.900485),\n (90.209929, 61.900485, 90.21767, 61.900485),\n (90.21767, 61.900485, 90.225412, 61.900485),\n (90.225412, 61.900485, 90.233154, 61.900485),\n (90.233154, 61.900485, 90.240895, 61.900485),\n (90.240895, 61.900485, 90.248637, 61.900485),\n (90.248637, 61.900485, 90.256379, 61.900485),\n (90.256379, 61.900485, 90.26412, 61.900485),\n (90.26412, 61.900485, 90.271862, 61.900485),\n (90.271862, 61.900485, 90.279604, 61.900485),\n (90.279604, 61.900485, 90.287345, 61.900485),\n (90.287345, 61.900485, 90.295087, 61.900485),\n (90.295087, 61.900485, 90.302829, 61.900485),\n (90.302829, 61.900485, 90.31057, 61.900485),\n (90.31057, 61.900485, 90.318312, 61.900485),\n (90.318312, 61.900485, 90.326054, 61.900485),\n (90.326054, 61.900485, 90.333795, 61.900485),\n (90.333795, 61.900485, 90.341537, 61.900485),\n (90.341537, 61.900485, 90.349279, 61.900485),\n (90.349279, 61.900485, 90.35702, 61.900485),\n (90.35702, 61.900485, 90.364762, 61.900485),\n (90.364762, 61.900485, 90.372504, 61.900485),\n (90.372504, 61.900485, 90.380246, 61.900485),\n (90.380246, 61.900485, 90.387987, 61.900485),\n (90.387987, 61.900485, 90.395729, 61.900485),\n (90.395729, 61.900485, 90.403471, 61.900485),\n (90.403471, 61.900485, 90.411212, 61.900485),\n (90.411212, 61.900485, 90.411212, 156.03926),\n (90.163479, 156.03926, 90.17122, 156.03926),\n (90.17122, 156.03926, 90.178962, 156.03926),\n (90.178962, 156.03926, 90.186704, 156.03926),\n (90.186704, 156.03926, 90.194445, 156.03926),\n (90.194445, 156.03926, 90.202187, 156.03926),\n (90.202187, 156.03926, 90.209929, 156.03926),\n (90.209929, 156.03926, 90.21767, 156.03926),\n (90.21767, 156.03926, 90.225412, 156.03926),\n (90.225412, 156.03926, 90.233154, 156.03926),\n (90.233154, 156.03926, 90.240895, 156.03926),\n (90.240895, 156.03926, 90.248637, 156.03926),\n (90.248637, 156.03926, 90.256379, 156.03926),\n (90.256379, 156.03926, 90.26412, 156.03926),\n (90.26412, 156.03926, 90.271862, 156.03926),\n (90.271862, 156.03926, 90.279604, 156.03926),\n (90.279604, 156.03926, 90.287345, 156.03926),\n (90.287345, 156.03926, 90.295087, 156.03926),\n (90.295087, 156.03926, 90.302829, 156.03926),\n (90.302829, 156.03926, 90.31057, 156.03926),\n (90.31057, 156.03926, 90.318312, 156.03926),\n (90.318312, 156.03926, 90.326054, 156.03926),\n (90.326054, 156.03926, 90.333795, 156.03926),\n (90.333795, 156.03926, 90.341537, 156.03926),\n (90.341537, 156.03926, 90.349279, 156.03926),\n (90.349279, 156.03926, 90.35702, 156.03926),\n (90.35702, 156.03926, 90.364762, 156.03926),\n (90.364762, 156.03926, 90.372504, 156.03926),\n (90.372504, 156.03926, 90.380246, 156.03926),\n (90.380246, 156.03926, 90.387987, 156.03926),\n (90.387987, 156.03926, 90.395729, 156.03926),\n (90.395729, 156.03926, 90.403471, 156.03926),\n (90.403471, 156.03926, 90.411212, 156.03926),\n (88.697721, 61.900485, 88.697721, 156.03926),\n (90.163479, 61.900485, 90.163479, 156.03926),\n (198.549988, 171.752751, 198.549988, 171.760493),\n (198.549988, 171.760493, 198.549988, 171.768235),\n (198.549988, 171.768235, 198.549988, 171.775976),\n (198.549988, 171.775976, 198.549988, 171.783718),\n (198.549988, 171.783718, 198.549988, 171.79146),\n (198.549988, 171.79146, 198.549988, 171.799201),\n (198.549988, 171.799201, 198.549988, 171.806943),\n (198.549988, 171.806943, 198.549988, 171.814685),\n (198.549988, 171.814685, 198.549988, 171.822426),\n (198.549988, 171.822426, 198.549988, 171.830168),\n (198.549988, 171.830168, 198.549988, 171.83791),\n (198.549988, 171.83791, 198.549988, 171.845651),\n (198.549988, 171.845651, 198.549988, 171.853393),\n (198.549988, 171.853393, 198.549988, 171.861135),\n (198.549988, 171.861135, 198.549988, 171.868876),\n (198.549988, 171.868876, 198.549988, 171.876618),\n (198.549988, 171.876618, 198.549988, 171.88436),\n (198.549988, 171.88436, 198.549988, 171.892101),\n (198.549988, 171.892101, 198.549988, 171.899843),\n (198.549988, 171.899843, 198.549988, 171.907585),\n (198.549988, 171.907585, 198.549988, 171.915326),\n (198.549988, 171.915326, 198.549988, 171.923068),\n (198.549988, 171.923068, 198.549988, 171.93081),\n (198.549988, 171.93081, 198.549988, 171.938551),\n (198.549988, 171.938551, 198.549988, 171.946293),\n (198.549988, 171.946293, 198.549988, 171.954035),\n (198.549988, 171.954035, 198.549988, 171.961776),\n (198.549988, 171.961776, 198.549988, 171.969518),\n (198.549988, 171.969518, 198.549988, 171.97726),\n (198.549988, 171.97726, 198.549988, 171.985002),\n (198.549988, 171.985002, 198.549988, 171.992743),\n (198.549988, 171.992743, 198.549988, 172.000485),\n (198.549988, 172.000485, 104.411212, 172.000485),\n (104.411212, 171.752751, 104.411212, 171.760493),\n (104.411212, 171.760493, 104.411212, 171.768235),\n (104.411212, 171.768235, 104.411212, 171.775976),\n (104.411212, 171.775976, 104.411212, 171.783718),\n (104.411212, 171.783718, 104.411212, 171.79146),\n (104.411212, 171.79146, 104.411212, 171.799201),\n (104.411212, 171.799201, 104.411212, 171.806943),\n (104.411212, 171.806943, 104.411212, 171.814685),\n (104.411212, 171.814685, 104.411212, 171.822426),\n (104.411212, 171.822426, 104.411212, 171.830168),\n (104.411212, 171.830168, 104.411212, 171.83791),\n (104.411212, 171.83791, 104.411212, 171.845651),\n (104.411212, 171.845651, 104.411212, 171.853393),\n (104.411212, 171.853393, 104.411212, 171.861135),\n (104.411212, 171.861135, 104.411212, 171.868876),\n (104.411212, 171.868876, 104.411212, 171.876618),\n (104.411212, 171.876618, 104.411212, 171.88436),\n (104.411212, 171.88436, 104.411212, 171.892101),\n (104.411212, 171.892101, 104.411212, 171.899843),\n (104.411212, 171.899843, 104.411212, 171.907585),\n (104.411212, 171.907585, 104.411212, 171.915326),\n (104.411212, 171.915326, 104.411212, 171.923068),\n (104.411212, 171.923068, 104.411212, 171.93081),\n (104.411212, 171.93081, 104.411212, 171.938551),\n (104.411212, 171.938551, 104.411212, 171.946293),\n (104.411212, 171.946293, 104.411212, 171.954035),\n (104.411212, 171.954035, 104.411212, 171.961776),\n (104.411212, 171.961776, 104.411212, 171.969518),\n (104.411212, 171.969518, 104.411212, 171.97726),\n (104.411212, 171.97726, 104.411212, 171.985002),\n (104.411212, 171.985002, 104.411212, 171.992743),\n (104.411212, 171.992743, 104.411212, 172.000485),\n (198.549988, 170.03926, 104.411212, 170.03926),\n (198.549988, 170.03926, 198.549988, 170.047002),\n (198.549988, 170.047002, 198.549988, 170.054744),\n (198.549988, 170.054744, 198.549988, 170.062485),\n (198.549988, 170.062485, 198.549988, 170.070227),\n (198.549988, 170.070227, 198.549988, 170.077969),\n (198.549988, 170.077969, 198.549988, 170.08571),\n (198.549988, 170.08571, 198.549988, 170.093452),\n (198.549988, 170.093452, 198.549988, 170.101194),\n (198.549988, 170.101194, 198.549988, 170.108935),\n (198.549988, 170.108935, 198.549988, 170.116677),\n (198.549988, 170.116677, 198.549988, 170.124419),\n (198.549988, 170.124419, 198.549988, 170.13216),\n (198.549988, 170.13216, 198.549988, 170.139902),\n (198.549988, 170.139902, 198.549988, 170.147644),\n (198.549988, 170.147644, 198.549988, 170.155386),\n (198.549988, 170.155386, 198.549988, 170.163127),\n (198.549988, 170.163127, 198.549988, 170.170869),\n (198.549988, 170.170869, 198.549988, 170.178611),\n (198.549988, 170.178611, 198.549988, 170.186352),\n (198.549988, 170.186352, 198.549988, 170.194094),\n (198.549988, 170.194094, 198.549988, 170.201836),\n (198.549988, 170.201836, 198.549988, 170.209577),\n (198.549988, 170.209577, 198.549988, 170.217319),\n (198.549988, 170.217319, 198.549988, 170.225061),\n (198.549988, 170.225061, 198.549988, 170.232802),\n (198.549988, 170.232802, 198.549988, 170.240544),\n (198.549988, 170.240544, 198.549988, 170.248286),\n (198.549988, 170.248286, 198.549988, 170.256027),\n (198.549988, 170.256027, 198.549988, 170.263769),\n (198.549988, 170.263769, 198.549988, 170.271511),\n (198.549988, 170.271511, 198.549988, 170.279252),\n (198.549988, 170.279252, 198.549988, 170.286994),\n (104.411212, 170.03926, 104.411212, 170.047002),\n (104.411212, 170.047002, 104.411212, 170.054744),\n (104.411212, 170.054744, 104.411212, 170.062485),\n (104.411212, 170.062485, 104.411212, 170.070227),\n (104.411212, 170.070227, 104.411212, 170.077969),\n (104.411212, 170.077969, 104.411212, 170.08571),\n (104.411212, 170.08571, 104.411212, 170.093452),\n (104.411212, 170.093452, 104.411212, 170.101194),\n (104.411212, 170.101194, 104.411212, 170.108935),\n (104.411212, 170.108935, 104.411212, 170.116677),\n (104.411212, 170.116677, 104.411212, 170.124419),\n (104.411212, 170.124419, 104.411212, 170.13216),\n (104.411212, 170.13216, 104.411212, 170.139902),\n (104.411212, 170.139902, 104.411212, 170.147644),\n (104.411212, 170.147644, 104.411212, 170.155386),\n (104.411212, 170.155386, 104.411212, 170.163127),\n (104.411212, 170.163127, 104.411212, 170.170869),\n (104.411212, 170.170869, 104.411212, 170.178611),\n (104.411212, 170.178611, 104.411212, 170.186352),\n (104.411212, 170.186352, 104.411212, 170.194094),\n (104.411212, 170.194094, 104.411212, 170.201836),\n (104.411212, 170.201836, 104.411212, 170.209577),\n (104.411212, 170.209577, 104.411212, 170.217319),\n (104.411212, 170.217319, 104.411212, 170.225061),\n (104.411212, 170.225061, 104.411212, 170.232802),\n (104.411212, 170.232802, 104.411212, 170.240544),\n (104.411212, 170.240544, 104.411212, 170.248286),\n (104.411212, 170.248286, 104.411212, 170.256027),\n (104.411212, 170.256027, 104.411212, 170.263769),\n (104.411212, 170.263769, 104.411212, 170.271511),\n (104.411212, 170.271511, 104.411212, 170.279252),\n (104.411212, 170.279252, 104.411212, 170.286994),\n (104.411212, 170.286994, 104.411212, 171.752751),\n (198.549988, 170.286994, 198.549988, 171.752751),\n (198.549988, 171.752751, 104.411212, 171.752751),\n (198.549988, 170.286994, 104.411212, 170.286994)\n]\nVISIBLE_CIRCLES = [\n\n]\nVISIBLE_ARCS = [\n (88.697721, 171.752751, 0.247734, 90.0, -180.0),\n (90.163479, 171.752751, 0.247734, -0.0, 90.0),\n (90.163479, 170.286994, 0.247734, -90.0, 0.0),\n (88.697721, 170.286994, 0.247734, -180.0, -90.0),\n (89.915745, 170.534728, 0.247734, -90.0, 0.0),\n (89.915745, 171.505018, 0.247734, -0.0, 90.0),\n (88.697721, 171.505018, 0.350348, 45.0, 135.0),\n (88.945455, 170.534728, 0.247734, -180.0, -90.0)\n]\nHIDDEN_SEGMENTS = [\n\n]\n# (orient, text, p1, p2, base) for linear; (orient, text, center, radius, angle) for diameter\nDIMENSIONS = [\n ('horizontal', '100', (88.6977, 172.05), (90.1635, 172.05), (89.4306, 183.05)),\n ('vertical', '100', (90.4112, 171.8023), (90.4112, 170.3365), (101.4112, 171.0694)),\n ('horizontal', '116.901', (88.45, 171.8023), (90.1635, 171.8023), (89.3067, 182.8023)),\n ('vertical', '100', (88.45, 171.8023), (88.45, 170.3365), (99.45, 171.0694)),\n ('vertical', '16.9014', (88.45, 172.05), (88.45, 171.8023), (99.45, 171.9261)),\n ('radius', 'R16.9014', (88.6977, 171.8023), 0.2477, 45),\n ('radius', 'R23.9022', (88.6977, 171.5545), 0.3503, 135),\n ('radius', 'R16.9014', (89.9158, 171.5545), 0.2477, 45),\n ('horizontal', '6422.54', (198.55, 171.8023), (104.4112, 171.8023), (151.4806, 160.8023))\n]\n\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; _ds.dxf.dimasz = 2.5\n _ds.dxf.dimexe = 1.25; _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\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\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,\n angle=(0 if d[0] == \"horizontal\" else 90),\n 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,\n 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,\n 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,\n text=text, dimstyle=\"EZDXF\").render()\n\n doc.saveas(out_path)\n\n\nif __name__ == \"__main__\":\n out = sys.argv[1] if len(sys.argv) > 1 else \"0056_00569863_gt.dxf\"\n draw(out)\n print(\"wrote\", out)\n```"}], "images": ["images/0056_00569863.png"], "id": "0056_00569863"} {"messages": [{"role": "user", "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 3 circular holes, each of diameter 33.25 mm. It is extruded to a thickness of 42.29 mm. The outline includes one or more oblique (angled) edges."}, {"role": "assistant", "content": "```python\n#!/usr/bin/env python3\n# -*- coding: utf-8 -*-\n# Ground-truth 2D engineering drawing for part: 0057_00573906\n# Self-contained: reproduces the three-view DXF via ezdxf, NO FreeCAD needed.\n# Coordinates are A4 page millimetres (scale=0.4431627679169923, page=[297.0, 210.0]).\n# visible edges -> solid (layer OUTLINE); hidden edges -> dashed (layer HIDDEN)\n# dimensions -> real movable DIMENSION entities (text = true mm value)\n# Run: python 0057_00573906_gt.py [out.dxf]\nimport sys\nimport ezdxf\nimport math\n\nSCALE = 0.4431627679169923\nPAGE = [297.0, 210.0]\n\nVISIBLE_SEGMENTS = [\n (92.237436, 64.212176, 93.181547, 64.212176),\n (93.181547, 64.212176, 94.125657, 64.212176),\n (94.125657, 64.212176, 95.069768, 64.212176),\n (95.069768, 64.212176, 96.013879, 64.212176),\n (96.013879, 64.212176, 96.957989, 64.212176),\n (96.957989, 64.212176, 97.9021, 64.212176),\n (97.9021, 64.212176, 98.84621, 64.212176),\n (98.84621, 64.212176, 99.790321, 64.212176),\n (99.790321, 64.212176, 100.734432, 64.212176),\n (100.734432, 64.212176, 101.678542, 64.212176),\n (101.678542, 64.212176, 102.622653, 64.212176),\n (102.622653, 64.212176, 103.566764, 64.212176),\n (103.566764, 64.212176, 104.510874, 64.212176),\n (104.510874, 64.212176, 105.454985, 64.212176),\n (105.454985, 64.212176, 106.399096, 64.212176),\n (106.399096, 64.212176, 107.343206, 64.212176),\n (107.343206, 64.212176, 108.287317, 64.212176),\n (108.287317, 64.212176, 109.231427, 64.212176),\n (109.231427, 64.212176, 110.175538, 64.212176),\n (110.175538, 64.212176, 111.119649, 64.212176),\n (111.119649, 64.212176, 112.063759, 64.212176),\n (112.063759, 64.212176, 113.00787, 64.212176),\n (113.00787, 64.212176, 113.951981, 64.212176),\n (113.951981, 64.212176, 114.896091, 64.212176),\n (114.896091, 64.212176, 115.840202, 64.212176),\n (115.840202, 64.212176, 116.784313, 64.212176),\n (116.784313, 64.212176, 117.728423, 64.212176),\n (117.728423, 64.212176, 118.672534, 64.212176),\n (118.672534, 64.212176, 119.616644, 64.212176),\n (119.616644, 64.212176, 120.560755, 64.212176),\n (120.560755, 64.212176, 121.504866, 64.212176),\n (121.504866, 64.212176, 122.448976, 64.212176),\n (122.448976, 64.212176, 122.448976, 82.952963),\n (92.237436, 82.952963, 93.181547, 82.952963),\n (93.181547, 82.952963, 94.125657, 82.952963),\n (94.125657, 82.952963, 95.069768, 82.952963),\n (95.069768, 82.952963, 96.013879, 82.952963),\n (96.013879, 82.952963, 96.957989, 82.952963),\n (96.957989, 82.952963, 97.9021, 82.952963),\n (97.9021, 82.952963, 98.84621, 82.952963),\n (98.84621, 82.952963, 99.790321, 82.952963),\n (99.790321, 82.952963, 100.734432, 82.952963),\n (100.734432, 82.952963, 101.678542, 82.952963),\n (101.678542, 82.952963, 102.622653, 82.952963),\n (102.622653, 82.952963, 103.566764, 82.952963),\n (103.566764, 82.952963, 104.510874, 82.952963),\n (104.510874, 82.952963, 105.454985, 82.952963),\n (105.454985, 82.952963, 106.399096, 82.952963),\n (106.399096, 82.952963, 107.343206, 82.952963),\n (107.343206, 82.952963, 108.287317, 82.952963),\n (108.287317, 82.952963, 109.231427, 82.952963),\n (109.231427, 82.952963, 110.175538, 82.952963),\n (110.175538, 82.952963, 111.119649, 82.952963),\n (111.119649, 82.952963, 112.063759, 82.952963),\n (112.063759, 82.952963, 113.00787, 82.952963),\n (113.00787, 82.952963, 113.951981, 82.952963),\n (113.951981, 82.952963, 114.896091, 82.952963),\n (114.896091, 82.952963, 115.840202, 82.952963),\n (115.840202, 82.952963, 116.784313, 82.952963),\n (116.784313, 82.952963, 117.728423, 82.952963),\n (117.728423, 82.952963, 118.672534, 82.952963),\n (118.672534, 82.952963, 119.616644, 82.952963),\n (119.616644, 82.952963, 120.560755, 82.952963),\n (120.560755, 82.952963, 121.504866, 82.952963),\n (121.504866, 82.952963, 122.448976, 82.952963),\n (122.448976, 64.212176, 123.064206, 64.212176),\n (123.064206, 64.212176, 123.679435, 64.212176),\n (123.679435, 64.212176, 124.294664, 64.212176),\n (124.294664, 64.212176, 124.909893, 64.212176),\n (124.909893, 64.212176, 125.525123, 64.212176),\n (125.525123, 64.212176, 126.140352, 64.212176),\n (126.140352, 64.212176, 126.755581, 64.212176),\n (126.755581, 64.212176, 127.37081, 64.212176),\n (127.37081, 64.212176, 127.98604, 64.212176),\n (127.98604, 64.212176, 128.601269, 64.212176),\n (128.601269, 64.212176, 129.216498, 64.212176),\n (129.216498, 64.212176, 129.831727, 64.212176),\n (129.831727, 64.212176, 130.446957, 64.212176),\n (130.446957, 64.212176, 131.062186, 64.212176),\n (131.062186, 64.212176, 131.677415, 64.212176),\n (131.677415, 64.212176, 132.292644, 64.212176),\n (132.292644, 64.212176, 132.907874, 64.212176),\n (132.907874, 64.212176, 133.523103, 64.212176),\n (133.523103, 64.212176, 134.138332, 64.212176),\n (134.138332, 64.212176, 134.753561, 64.212176),\n (134.753561, 64.212176, 135.368791, 64.212176),\n (135.368791, 64.212176, 135.98402, 64.212176),\n (135.98402, 64.212176, 136.599249, 64.212176),\n (136.599249, 64.212176, 137.214478, 64.212176),\n (137.214478, 64.212176, 137.829708, 64.212176),\n (137.829708, 64.212176, 138.444937, 64.212176),\n (138.444937, 64.212176, 139.060166, 64.212176),\n (139.060166, 64.212176, 139.675395, 64.212176),\n (139.675395, 64.212176, 140.290625, 64.212176),\n (140.290625, 64.212176, 140.905854, 64.212176),\n (140.905854, 64.212176, 141.521083, 64.212176),\n (141.521083, 64.212176, 142.136312, 64.212176),\n (122.448976, 82.952963, 123.064206, 82.952963),\n (123.064206, 82.952963, 123.679435, 82.952963),\n (123.679435, 82.952963, 124.294664, 82.952963),\n (124.294664, 82.952963, 124.909893, 82.952963),\n (124.909893, 82.952963, 125.525123, 82.952963),\n (125.525123, 82.952963, 126.140352, 82.952963),\n (126.140352, 82.952963, 126.755581, 82.952963),\n (126.755581, 82.952963, 127.37081, 82.952963),\n (127.37081, 82.952963, 127.98604, 82.952963),\n (127.98604, 82.952963, 128.601269, 82.952963),\n (128.601269, 82.952963, 129.216498, 82.952963),\n (129.216498, 82.952963, 129.831727, 82.952963),\n (129.831727, 82.952963, 130.446957, 82.952963),\n (130.446957, 82.952963, 131.062186, 82.952963),\n (131.062186, 82.952963, 131.677415, 82.952963),\n (131.677415, 82.952963, 132.292644, 82.952963),\n (132.292644, 82.952963, 132.907874, 82.952963),\n (132.907874, 82.952963, 133.523103, 82.952963),\n (133.523103, 82.952963, 134.138332, 82.952963),\n (134.138332, 82.952963, 134.753561, 82.952963),\n (134.753561, 82.952963, 135.368791, 82.952963),\n (135.368791, 82.952963, 135.98402, 82.952963),\n (135.98402, 82.952963, 136.599249, 82.952963),\n (136.599249, 82.952963, 137.214478, 82.952963),\n (137.214478, 82.952963, 137.829708, 82.952963),\n (137.829708, 82.952963, 138.444937, 82.952963),\n (138.444937, 82.952963, 139.060166, 82.952963),\n (139.060166, 82.952963, 139.675395, 82.952963),\n (139.675395, 82.952963, 140.290625, 82.952963),\n (140.290625, 82.952963, 140.905854, 82.952963),\n (140.905854, 82.952963, 141.521083, 82.952963),\n (141.521083, 82.952963, 142.136312, 82.952963),\n (142.136312, 82.952963, 142.165842, 82.952963),\n (142.165842, 82.952963, 142.195371, 82.952963),\n (142.195371, 82.952963, 142.2249, 82.952963),\n (142.2249, 82.952963, 142.254429, 82.952963),\n (142.254429, 82.952963, 142.283959, 82.952963),\n (142.283959, 82.952963, 142.313488, 82.952963),\n (142.313488, 82.952963, 142.343017, 82.952963),\n (142.343017, 82.952963, 142.372546, 82.952963),\n (142.372546, 82.952963, 142.402076, 82.952963),\n (142.402076, 82.952963, 142.431605, 82.952963),\n (142.431605, 82.952963, 142.461134, 82.952963),\n (142.461134, 82.952963, 142.490663, 82.952963),\n (142.490663, 82.952963, 142.520192, 82.952963),\n (142.520192, 82.952963, 142.549722, 82.952963),\n (142.549722, 82.952963, 142.579251, 82.952963),\n (142.579251, 82.952963, 142.60878, 82.952963),\n (142.60878, 82.952963, 142.638309, 82.952963),\n (142.638309, 82.952963, 142.667839, 82.952963),\n (142.667839, 82.952963, 142.697368, 82.952963),\n (142.697368, 82.952963, 142.726897, 82.952963),\n (142.726897, 82.952963, 142.756426, 82.952963),\n (142.756426, 82.952963, 142.785956, 82.952963),\n (142.785956, 82.952963, 142.815485, 82.952963),\n (142.815485, 82.952963, 142.845014, 82.952963),\n (142.845014, 82.952963, 142.874543, 82.952963),\n (142.874543, 82.952963, 142.904072, 82.952963),\n (142.904072, 82.952963, 142.933602, 82.952963),\n (142.933602, 82.952963, 142.963131, 82.952963),\n (142.963131, 82.952963, 142.99266, 82.952963),\n (142.99266, 82.952963, 143.022189, 82.952963),\n (143.022189, 82.952963, 143.051719, 82.952963),\n (143.051719, 82.952963, 143.081248, 82.952963),\n (143.081248, 64.212176, 143.081248, 82.952963),\n (142.136312, 64.212176, 142.165842, 64.212176),\n (142.165842, 64.212176, 142.195371, 64.212176),\n (142.195371, 64.212176, 142.2249, 64.212176),\n (142.2249, 64.212176, 142.254429, 64.212176),\n (142.254429, 64.212176, 142.283959, 64.212176),\n (142.283959, 64.212176, 142.313488, 64.212176),\n (142.313488, 64.212176, 142.343017, 64.212176),\n (142.343017, 64.212176, 142.372546, 64.212176),\n (142.372546, 64.212176, 142.402076, 64.212176),\n (142.402076, 64.212176, 142.431605, 64.212176),\n (142.431605, 64.212176, 142.461134, 64.212176),\n (142.461134, 64.212176, 142.490663, 64.212176),\n (142.490663, 64.212176, 142.520192, 64.212176),\n (142.520192, 64.212176, 142.549722, 64.212176),\n (142.549722, 64.212176, 142.579251, 64.212176),\n (142.579251, 64.212176, 142.60878, 64.212176),\n (142.60878, 64.212176, 142.638309, 64.212176),\n (142.638309, 64.212176, 142.667839, 64.212176),\n (142.667839, 64.212176, 142.697368, 64.212176),\n (142.697368, 64.212176, 142.726897, 64.212176),\n (142.726897, 64.212176, 142.756426, 64.212176),\n (142.756426, 64.212176, 142.785956, 64.212176),\n (142.785956, 64.212176, 142.815485, 64.212176),\n (142.815485, 64.212176, 142.845014, 64.212176),\n (142.845014, 64.212176, 142.874543, 64.212176),\n (142.874543, 64.212176, 142.904072, 64.212176),\n (142.904072, 64.212176, 142.933602, 64.212176),\n (142.933602, 64.212176, 142.963131, 64.212176),\n (142.963131, 64.212176, 142.99266, 64.212176),\n (142.99266, 64.212176, 143.022189, 64.212176),\n (143.022189, 64.212176, 143.051719, 64.212176),\n (143.051719, 64.212176, 143.081248, 64.212176),\n (143.081248, 64.212176, 143.3806, 64.212176),\n (143.3806, 64.212176, 143.679952, 64.212176),\n (143.679952, 64.212176, 143.979304, 64.212176),\n (143.979304, 64.212176, 144.278656, 64.212176),\n (144.278656, 64.212176, 144.578009, 64.212176),\n (144.578009, 64.212176, 144.877361, 64.212176),\n (144.877361, 64.212176, 145.176713, 64.212176),\n (145.176713, 64.212176, 145.476065, 64.212176),\n (145.476065, 64.212176, 145.775417, 64.212176),\n (145.775417, 64.212176, 146.074769, 64.212176),\n (146.074769, 64.212176, 146.374121, 64.212176),\n (146.374121, 64.212176, 146.673474, 64.212176),\n (146.673474, 64.212176, 146.972826, 64.212176),\n (146.972826, 64.212176, 147.272178, 64.212176),\n (147.272178, 64.212176, 147.57153, 64.212176),\n (147.57153, 64.212176, 147.870882, 64.212176),\n (147.870882, 64.212176, 148.170234, 64.212176),\n (148.170234, 64.212176, 148.469587, 64.212176),\n (148.469587, 64.212176, 148.768939, 64.212176),\n (148.768939, 64.212176, 149.068291, 64.212176),\n (149.068291, 64.212176, 149.367643, 64.212176),\n (149.367643, 64.212176, 149.666995, 64.212176),\n (149.666995, 64.212176, 149.966347, 64.212176),\n (149.966347, 64.212176, 150.265699, 64.212176),\n (150.265699, 64.212176, 150.565052, 64.212176),\n (150.565052, 64.212176, 150.864404, 64.212176),\n (150.864404, 64.212176, 151.163756, 64.212176),\n (151.163756, 64.212176, 151.463108, 64.212176),\n (151.463108, 64.212176, 151.76246, 64.212176),\n (151.76246, 64.212176, 152.061812, 64.212176),\n (152.061812, 64.212176, 152.361165, 64.212176),\n (152.361165, 64.212176, 152.660517, 64.212176),\n (152.660517, 64.212176, 152.660517, 82.952963),\n (143.081248, 82.952963, 143.3806, 82.952963),\n (143.3806, 82.952963, 143.679952, 82.952963),\n (143.679952, 82.952963, 143.979304, 82.952963),\n (143.979304, 82.952963, 144.278656, 82.952963),\n (144.278656, 82.952963, 144.578009, 82.952963),\n (144.578009, 82.952963, 144.877361, 82.952963),\n (144.877361, 82.952963, 145.176713, 82.952963),\n (145.176713, 82.952963, 145.476065, 82.952963),\n (145.476065, 82.952963, 145.775417, 82.952963),\n (145.775417, 82.952963, 146.074769, 82.952963),\n (146.074769, 82.952963, 146.374121, 82.952963),\n (146.374121, 82.952963, 146.673474, 82.952963),\n (146.673474, 82.952963, 146.972826, 82.952963),\n (146.972826, 82.952963, 147.272178, 82.952963),\n (147.272178, 82.952963, 147.57153, 82.952963),\n (147.57153, 82.952963, 147.870882, 82.952963),\n (147.870882, 82.952963, 148.170234, 82.952963),\n (148.170234, 82.952963, 148.469587, 82.952963),\n (148.469587, 82.952963, 148.768939, 82.952963),\n (148.768939, 82.952963, 149.068291, 82.952963),\n (149.068291, 82.952963, 149.367643, 82.952963),\n (149.367643, 82.952963, 149.666995, 82.952963),\n (149.666995, 82.952963, 149.966347, 82.952963),\n (149.966347, 82.952963, 150.265699, 82.952963),\n (150.265699, 82.952963, 150.565052, 82.952963),\n (150.565052, 82.952963, 150.864404, 82.952963),\n (150.864404, 82.952963, 151.163756, 82.952963),\n (151.163756, 82.952963, 151.463108, 82.952963),\n (151.463108, 82.952963, 151.76246, 82.952963),\n (151.76246, 82.952963, 152.061812, 82.952963),\n (152.061812, 82.952963, 152.361165, 82.952963),\n (152.361165, 82.952963, 152.660517, 82.952963),\n (152.660517, 64.212176, 152.959869, 64.212176),\n (152.959869, 64.212176, 153.259221, 64.212176),\n (153.259221, 64.212176, 153.558573, 64.212176),\n (153.558573, 64.212176, 153.857925, 64.212176),\n (153.857925, 64.212176, 154.157277, 64.212176),\n (154.157277, 64.212176, 154.45663, 64.212176),\n (154.45663, 64.212176, 154.755982, 64.212176),\n (154.755982, 64.212176, 155.055334, 64.212176),\n (155.055334, 64.212176, 155.354686, 64.212176),\n (155.354686, 64.212176, 155.654038, 64.212176),\n (155.654038, 64.212176, 155.95339, 64.212176),\n (155.95339, 64.212176, 156.252743, 64.212176),\n (156.252743, 64.212176, 156.552095, 64.212176),\n (156.552095, 64.212176, 156.851447, 64.212176),\n (156.851447, 64.212176, 157.150799, 64.212176),\n (157.150799, 64.212176, 157.450151, 64.212176),\n (157.450151, 64.212176, 157.749503, 64.212176),\n (157.749503, 64.212176, 158.048855, 64.212176),\n (158.048855, 64.212176, 158.348208, 64.212176),\n (158.348208, 64.212176, 158.64756, 64.212176),\n (158.64756, 64.212176, 158.946912, 64.212176),\n (158.946912, 64.212176, 159.246264, 64.212176),\n (159.246264, 64.212176, 159.545616, 64.212176),\n (159.545616, 64.212176, 159.844968, 64.212176),\n (159.844968, 64.212176, 160.144321, 64.212176),\n (160.144321, 64.212176, 160.443673, 64.212176),\n (160.443673, 64.212176, 160.743025, 64.212176),\n (160.743025, 64.212176, 161.042377, 64.212176),\n (161.042377, 64.212176, 161.341729, 64.212176),\n (161.341729, 64.212176, 161.641081, 64.212176),\n (161.641081, 64.212176, 161.940433, 64.212176),\n (161.940433, 64.212176, 162.239786, 64.212176),\n (152.660517, 82.952963, 152.959869, 82.952963),\n (152.959869, 82.952963, 153.259221, 82.952963),\n (153.259221, 82.952963, 153.558573, 82.952963),\n (153.558573, 82.952963, 153.857925, 82.952963),\n (153.857925, 82.952963, 154.157277, 82.952963),\n (154.157277, 82.952963, 154.45663, 82.952963),\n (154.45663, 82.952963, 154.755982, 82.952963),\n (154.755982, 82.952963, 155.055334, 82.952963),\n (155.055334, 82.952963, 155.354686, 82.952963),\n (155.354686, 82.952963, 155.654038, 82.952963),\n (155.654038, 82.952963, 155.95339, 82.952963),\n (155.95339, 82.952963, 156.252743, 82.952963),\n (156.252743, 82.952963, 156.552095, 82.952963),\n (156.552095, 82.952963, 156.851447, 82.952963),\n (156.851447, 82.952963, 157.150799, 82.952963),\n (157.150799, 82.952963, 157.450151, 82.952963),\n (157.450151, 82.952963, 157.749503, 82.952963),\n (157.749503, 82.952963, 158.048855, 82.952963),\n (158.048855, 82.952963, 158.348208, 82.952963),\n (158.348208, 82.952963, 158.64756, 82.952963),\n (158.64756, 82.952963, 158.946912, 82.952963),\n (158.946912, 82.952963, 159.246264, 82.952963),\n (159.246264, 82.952963, 159.545616, 82.952963),\n (159.545616, 82.952963, 159.844968, 82.952963),\n (159.844968, 82.952963, 160.144321, 82.952963),\n (160.144321, 82.952963, 160.443673, 82.952963),\n (160.443673, 82.952963, 160.743025, 82.952963),\n (160.743025, 82.952963, 161.042377, 82.952963),\n (161.042377, 82.952963, 161.341729, 82.952963),\n (161.341729, 82.952963, 161.641081, 82.952963),\n (161.641081, 82.952963, 161.940433, 82.952963),\n (161.940433, 82.952963, 162.239786, 82.952963),\n (91.728376, 64.212176, 91.744284, 64.212176),\n (91.744284, 64.212176, 91.760192, 64.212176),\n (91.760192, 64.212176, 91.7761, 64.212176),\n (91.7761, 64.212176, 91.792008, 64.212176),\n (91.792008, 64.212176, 91.807917, 64.212176),\n (91.807917, 64.212176, 91.823825, 64.212176),\n (91.823825, 64.212176, 91.839733, 64.212176),\n (91.839733, 64.212176, 91.855641, 64.212176),\n (91.855641, 64.212176, 91.871549, 64.212176),\n (91.871549, 64.212176, 91.887457, 64.212176),\n (91.887457, 64.212176, 91.903365, 64.212176),\n (91.903365, 64.212176, 91.919273, 64.212176),\n (91.919273, 64.212176, 91.935182, 64.212176),\n (91.935182, 64.212176, 91.95109, 64.212176),\n (91.95109, 64.212176, 91.966998, 64.212176),\n (91.966998, 64.212176, 91.982906, 64.212176),\n (91.982906, 64.212176, 91.998814, 64.212176),\n (91.998814, 64.212176, 92.014722, 64.212176),\n (92.014722, 64.212176, 92.03063, 64.212176),\n (92.03063, 64.212176, 92.046538, 64.212176),\n (92.046538, 64.212176, 92.062447, 64.212176),\n (92.062447, 64.212176, 92.078355, 64.212176),\n (92.078355, 64.212176, 92.094263, 64.212176),\n (92.094263, 64.212176, 92.110171, 64.212176),\n (92.110171, 64.212176, 92.126079, 64.212176),\n (92.126079, 64.212176, 92.141987, 64.212176),\n (92.141987, 64.212176, 92.157895, 64.212176),\n (92.157895, 64.212176, 92.173803, 64.212176),\n (92.173803, 64.212176, 92.189712, 64.212176),\n (92.189712, 64.212176, 92.20562, 64.212176),\n (92.20562, 64.212176, 92.221528, 64.212176),\n (92.221528, 64.212176, 92.237436, 64.212176),\n (91.728376, 82.952963, 91.744284, 82.952963),\n (91.744284, 82.952963, 91.760192, 82.952963),\n (91.760192, 82.952963, 91.7761, 82.952963),\n (91.7761, 82.952963, 91.792008, 82.952963),\n (91.792008, 82.952963, 91.807917, 82.952963),\n (91.807917, 82.952963, 91.823825, 82.952963),\n (91.823825, 82.952963, 91.839733, 82.952963),\n (91.839733, 82.952963, 91.855641, 82.952963),\n (91.855641, 82.952963, 91.871549, 82.952963),\n (91.871549, 82.952963, 91.887457, 82.952963),\n (91.887457, 82.952963, 91.903365, 82.952963),\n (91.903365, 82.952963, 91.919273, 82.952963),\n (91.919273, 82.952963, 91.935182, 82.952963),\n (91.935182, 82.952963, 91.95109, 82.952963),\n (91.95109, 82.952963, 91.966998, 82.952963),\n (91.966998, 82.952963, 91.982906, 82.952963),\n (91.982906, 82.952963, 91.998814, 82.952963),\n (91.998814, 82.952963, 92.014722, 82.952963),\n (92.014722, 82.952963, 92.03063, 82.952963),\n (92.03063, 82.952963, 92.046538, 82.952963),\n (92.046538, 82.952963, 92.062447, 82.952963),\n (92.062447, 82.952963, 92.078355, 82.952963),\n (92.078355, 82.952963, 92.094263, 82.952963),\n (92.094263, 82.952963, 92.110171, 82.952963),\n (92.110171, 82.952963, 92.126079, 82.952963),\n (92.126079, 82.952963, 92.141987, 82.952963),\n (92.141987, 82.952963, 92.157895, 82.952963),\n (92.157895, 82.952963, 92.173803, 82.952963),\n (92.173803, 82.952963, 92.189712, 82.952963),\n (92.189712, 82.952963, 92.20562, 82.952963),\n (92.20562, 82.952963, 92.221528, 82.952963),\n (92.221528, 82.952963, 92.237436, 82.952963),\n (142.136312, 82.952963, 142.136312, 64.212176),\n (162.264127, 82.952963, 162.264127, 64.212176),\n (91.728376, 82.952963, 91.728376, 64.212176),\n (92.237436, 64.212176, 92.237436, 82.952963),\n (162.239786, 64.212176, 162.239786, 82.952963),\n (195.004914, 140.282179, 195.004914, 141.295371),\n (195.004914, 141.295371, 195.004914, 142.308563),\n (195.004914, 142.308563, 195.004914, 143.321755),\n (195.004914, 143.321755, 195.004914, 144.334947),\n (195.004914, 144.334947, 195.004914, 145.348139),\n (195.004914, 145.348139, 195.004914, 146.361331),\n (195.004914, 146.361331, 195.004914, 147.374522),\n (195.004914, 147.374522, 195.004914, 148.387714),\n (195.004914, 148.387714, 195.004914, 149.400906),\n (195.004914, 149.400906, 195.004914, 150.414098),\n (195.004914, 150.414098, 195.004914, 151.42729),\n (195.004914, 151.42729, 195.004914, 152.440482),\n (195.004914, 152.440482, 195.004914, 153.453674),\n (195.004914, 153.453674, 195.004914, 154.466866),\n (195.004914, 154.466866, 195.004914, 155.480058),\n (195.004914, 155.480058, 195.004914, 156.49325),\n (195.004914, 156.49325, 195.004914, 157.506441),\n (195.004914, 157.506441, 195.004914, 158.519633),\n (195.004914, 158.519633, 195.004914, 159.532825),\n (195.004914, 159.532825, 195.004914, 160.546017),\n (195.004914, 160.546017, 195.004914, 161.559209),\n (195.004914, 161.559209, 195.004914, 162.572401),\n (195.004914, 162.572401, 195.004914, 163.585593),\n (195.004914, 163.585593, 195.004914, 164.598785),\n (195.004914, 164.598785, 195.004914, 165.611977),\n (195.004914, 165.611977, 195.004914, 166.625169),\n (195.004914, 166.625169, 195.004914, 167.63836),\n (195.004914, 167.63836, 195.004914, 168.651552),\n (195.004914, 168.651552, 195.004914, 169.664744),\n (195.004914, 169.664744, 195.004914, 170.677936),\n (195.004914, 170.677936, 195.004914, 171.691128),\n (195.004914, 171.691128, 195.004914, 172.70432),\n (195.004914, 172.70432, 176.264127, 172.70432),\n (176.264127, 140.282179, 176.264127, 141.295371),\n (176.264127, 141.295371, 176.264127, 142.308563),\n (176.264127, 142.308563, 176.264127, 143.321755),\n (176.264127, 143.321755, 176.264127, 144.334947),\n (176.264127, 144.334947, 176.264127, 145.348139),\n (176.264127, 145.348139, 176.264127, 146.361331),\n (176.264127, 146.361331, 176.264127, 147.374522),\n (176.264127, 147.374522, 176.264127, 148.387714),\n (176.264127, 148.387714, 176.264127, 149.400906),\n (176.264127, 149.400906, 176.264127, 150.414098),\n (176.264127, 150.414098, 176.264127, 151.42729),\n (176.264127, 151.42729, 176.264127, 152.440482),\n (176.264127, 152.440482, 176.264127, 153.453674),\n (176.264127, 153.453674, 176.264127, 154.466866),\n (176.264127, 154.466866, 176.264127, 155.480058),\n (176.264127, 155.480058, 176.264127, 156.49325),\n (176.264127, 156.49325, 176.264127, 157.506441),\n (176.264127, 157.506441, 176.264127, 158.519633),\n (176.264127, 158.519633, 176.264127, 159.532825),\n (176.264127, 159.532825, 176.264127, 160.546017),\n (176.264127, 160.546017, 176.264127, 161.559209),\n (176.264127, 161.559209, 176.264127, 162.572401),\n (176.264127, 162.572401, 176.264127, 163.585593),\n (176.264127, 163.585593, 176.264127, 164.598785),\n (176.264127, 164.598785, 176.264127, 165.611977),\n (176.264127, 165.611977, 176.264127, 166.625169),\n (176.264127, 166.625169, 176.264127, 167.63836),\n (176.264127, 167.63836, 176.264127, 168.651552),\n (176.264127, 168.651552, 176.264127, 169.664744),\n (176.264127, 169.664744, 176.264127, 170.677936),\n (176.264127, 170.677936, 176.264127, 171.691128),\n (176.264127, 171.691128, 176.264127, 172.70432),\n (195.004914, 172.70432, 195.004914, 172.724723),\n (195.004914, 172.724723, 195.004914, 172.745126),\n (195.004914, 172.745126, 195.004914, 172.765529),\n (195.004914, 172.765529, 195.004914, 172.785931),\n (195.004914, 172.785931, 195.004914, 172.806334),\n (195.004914, 172.806334, 195.004914, 172.826737),\n (195.004914, 172.826737, 195.004914, 172.84714),\n (195.004914, 172.84714, 195.004914, 172.867543),\n (195.004914, 172.867543, 195.004914, 172.887946),\n (195.004914, 172.887946, 195.004914, 172.908349),\n (195.004914, 172.908349, 195.004914, 172.928751),\n (195.004914, 172.928751, 195.004914, 172.949154),\n (195.004914, 172.949154, 195.004914, 172.969557),\n (195.004914, 172.969557, 195.004914, 172.98996),\n (195.004914, 172.98996, 195.004914, 173.010363),\n (195.004914, 173.010363, 195.004914, 173.030766),\n (195.004914, 173.030766, 195.004914, 173.051169),\n (195.004914, 173.051169, 195.004914, 173.071572),\n (195.004914, 173.071572, 195.004914, 173.091974),\n (195.004914, 173.091974, 195.004914, 173.112377),\n (195.004914, 173.112377, 195.004914, 173.13278),\n (195.004914, 173.13278, 195.004914, 173.153183),\n (195.004914, 173.153183, 195.004914, 173.173586),\n (195.004914, 173.173586, 195.004914, 173.193989),\n (195.004914, 173.193989, 195.004914, 173.214392),\n (195.004914, 173.214392, 195.004914, 173.234794),\n (195.004914, 173.234794, 195.004914, 173.255197),\n (195.004914, 173.255197, 195.004914, 173.2756),\n (195.004914, 173.2756, 195.004914, 173.296003),\n (195.004914, 173.296003, 195.004914, 173.316406),\n (195.004914, 173.316406, 195.004914, 173.336809),\n (195.004914, 173.336809, 195.004914, 173.357212),\n (195.004914, 96.952963, 195.004914, 97.155646),\n (195.004914, 97.155646, 195.004914, 97.35833),\n (195.004914, 97.35833, 195.004914, 97.561014),\n (195.004914, 97.561014, 195.004914, 97.763697),\n (195.004914, 97.763697, 195.004914, 97.966381),\n (195.004914, 97.966381, 195.004914, 98.169064),\n (195.004914, 98.169064, 195.004914, 98.371748),\n (195.004914, 98.371748, 195.004914, 98.574431),\n (195.004914, 98.574431, 195.004914, 98.777115),\n (195.004914, 98.777115, 195.004914, 98.979799),\n (195.004914, 98.979799, 195.004914, 99.182482),\n (195.004914, 99.182482, 195.004914, 99.385166),\n (195.004914, 99.385166, 195.004914, 99.587849),\n (195.004914, 99.587849, 195.004914, 99.790533),\n (195.004914, 99.790533, 195.004914, 99.993216),\n (195.004914, 99.993216, 195.004914, 100.1959),\n (195.004914, 100.1959, 195.004914, 100.398584),\n (195.004914, 100.398584, 195.004914, 100.601267),\n (195.004914, 100.601267, 195.004914, 100.803951),\n (195.004914, 100.803951, 195.004914, 101.006634),\n (195.004914, 101.006634, 195.004914, 101.209318),\n (195.004914, 101.209318, 195.004914, 101.412001),\n (195.004914, 101.412001, 195.004914, 101.614685),\n (195.004914, 101.614685, 195.004914, 101.817369),\n (195.004914, 101.817369, 195.004914, 102.020052),\n (195.004914, 102.020052, 195.004914, 102.222736),\n (195.004914, 102.222736, 195.004914, 102.425419),\n (195.004914, 102.425419, 195.004914, 102.628103),\n (195.004914, 102.628103, 195.004914, 102.830786),\n (195.004914, 102.830786, 195.004914, 103.03347),\n (195.004914, 103.03347, 195.004914, 103.236154),\n (195.004914, 103.236154, 195.004914, 103.438837),\n (195.004914, 103.438837, 176.264127, 103.438837),\n (176.264127, 96.952963, 176.264127, 97.155646),\n (176.264127, 97.155646, 176.264127, 97.35833),\n (176.264127, 97.35833, 176.264127, 97.561014),\n (176.264127, 97.561014, 176.264127, 97.763697),\n (176.264127, 97.763697, 176.264127, 97.966381),\n (176.264127, 97.966381, 176.264127, 98.169064),\n (176.264127, 98.169064, 176.264127, 98.371748),\n (176.264127, 98.371748, 176.264127, 98.574431),\n (176.264127, 98.574431, 176.264127, 98.777115),\n (176.264127, 98.777115, 176.264127, 98.979799),\n (176.264127, 98.979799, 176.264127, 99.182482),\n (176.264127, 99.182482, 176.264127, 99.385166),\n (176.264127, 99.385166, 176.264127, 99.587849),\n (176.264127, 99.587849, 176.264127, 99.790533),\n (176.264127, 99.790533, 176.264127, 99.993216),\n (176.264127, 99.993216, 176.264127, 100.1959),\n (176.264127, 100.1959, 176.264127, 100.398584),\n (176.264127, 100.398584, 176.264127, 100.601267),\n (176.264127, 100.601267, 176.264127, 100.803951),\n (176.264127, 100.803951, 176.264127, 101.006634),\n (176.264127, 101.006634, 176.264127, 101.209318),\n (176.264127, 101.209318, 176.264127, 101.412001),\n (176.264127, 101.412001, 176.264127, 101.614685),\n (176.264127, 101.614685, 176.264127, 101.817369),\n (176.264127, 101.817369, 176.264127, 102.020052),\n (176.264127, 102.020052, 176.264127, 102.222736),\n (176.264127, 102.222736, 176.264127, 102.425419),\n (176.264127, 102.425419, 176.264127, 102.628103),\n (176.264127, 102.628103, 176.264127, 102.830786),\n (176.264127, 102.830786, 176.264127, 103.03347),\n (176.264127, 103.03347, 176.264127, 103.236154),\n (176.264127, 103.236154, 176.264127, 103.438837),\n (176.264127, 103.438837, 176.264127, 103.875316),\n (176.264127, 103.875316, 176.264127, 104.311795),\n (176.264127, 104.311795, 176.264127, 104.748275),\n (176.264127, 104.748275, 176.264127, 105.184754),\n (176.264127, 105.184754, 176.264127, 105.621233),\n (176.264127, 105.621233, 176.264127, 106.057712),\n (176.264127, 106.057712, 176.264127, 106.494191),\n (176.264127, 106.494191, 176.264127, 106.93067),\n (176.264127, 106.93067, 176.264127, 107.36715),\n (176.264127, 107.36715, 176.264127, 107.803629),\n (176.264127, 107.803629, 176.264127, 108.240108),\n (176.264127, 108.240108, 176.264127, 108.676587),\n (176.264127, 108.676587, 176.264127, 109.113066),\n (176.264127, 109.113066, 176.264127, 109.549545),\n (176.264127, 109.549545, 176.264127, 109.986024),\n (176.264127, 109.986024, 176.264127, 110.422504),\n (176.264127, 110.422504, 176.264127, 110.858983),\n (176.264127, 110.858983, 176.264127, 111.295462),\n (176.264127, 111.295462, 176.264127, 111.731941),\n (176.264127, 111.731941, 176.264127, 112.16842),\n (176.264127, 112.16842, 176.264127, 112.604899),\n (176.264127, 112.604899, 176.264127, 113.041378),\n (176.264127, 113.041378, 176.264127, 113.477858),\n (176.264127, 113.477858, 176.264127, 113.914337),\n (176.264127, 113.914337, 176.264127, 114.350816),\n (176.264127, 114.350816, 176.264127, 114.787295),\n (176.264127, 114.787295, 176.264127, 115.223774),\n (176.264127, 115.223774, 176.264127, 115.660253),\n (176.264127, 115.660253, 176.264127, 116.096732),\n (176.264127, 116.096732, 176.264127, 116.533212),\n (176.264127, 116.533212, 176.264127, 116.969691),\n (176.264127, 116.969691, 176.264127, 117.40617),\n (195.004914, 103.438837, 195.004914, 103.875316),\n (195.004914, 103.875316, 195.004914, 104.311795),\n (195.004914, 104.311795, 195.004914, 104.748275),\n (195.004914, 104.748275, 195.004914, 105.184754),\n (195.004914, 105.184754, 195.004914, 105.621233),\n (195.004914, 105.621233, 195.004914, 106.057712),\n (195.004914, 106.057712, 195.004914, 106.494191),\n (195.004914, 106.494191, 195.004914, 106.93067),\n (195.004914, 106.93067, 195.004914, 107.36715),\n (195.004914, 107.36715, 195.004914, 107.803629),\n (195.004914, 107.803629, 195.004914, 108.240108),\n (195.004914, 108.240108, 195.004914, 108.676587),\n (195.004914, 108.676587, 195.004914, 109.113066),\n (195.004914, 109.113066, 195.004914, 109.549545),\n (195.004914, 109.549545, 195.004914, 109.986024),\n (195.004914, 109.986024, 195.004914, 110.422504),\n (195.004914, 110.422504, 195.004914, 110.858983),\n (195.004914, 110.858983, 195.004914, 111.295462),\n (195.004914, 111.295462, 195.004914, 111.731941),\n (195.004914, 111.731941, 195.004914, 112.16842),\n (195.004914, 112.16842, 195.004914, 112.604899),\n (195.004914, 112.604899, 195.004914, 113.041378),\n (195.004914, 113.041378, 195.004914, 113.477858),\n (195.004914, 113.477858, 195.004914, 113.914337),\n (195.004914, 113.914337, 195.004914, 114.350816),\n (195.004914, 114.350816, 195.004914, 114.787295),\n (195.004914, 114.787295, 195.004914, 115.223774),\n (195.004914, 115.223774, 195.004914, 115.660253),\n (195.004914, 115.660253, 195.004914, 116.096732),\n (195.004914, 116.096732, 195.004914, 116.533212),\n (195.004914, 116.533212, 195.004914, 116.969691),\n (195.004914, 116.969691, 195.004914, 117.40617),\n (195.004914, 117.40617, 195.004914, 118.121045),\n (195.004914, 118.121045, 195.004914, 118.83592),\n (195.004914, 118.83592, 195.004914, 119.550796),\n (195.004914, 119.550796, 195.004914, 120.265671),\n (195.004914, 120.265671, 195.004914, 120.980546),\n (195.004914, 120.980546, 195.004914, 121.695422),\n (195.004914, 121.695422, 195.004914, 122.410297),\n (195.004914, 122.410297, 195.004914, 123.125172),\n (195.004914, 123.125172, 195.004914, 123.840047),\n (195.004914, 123.840047, 195.004914, 124.554923),\n (195.004914, 124.554923, 195.004914, 125.269798),\n (195.004914, 125.269798, 195.004914, 125.984673),\n (195.004914, 125.984673, 195.004914, 126.699549),\n (195.004914, 126.699549, 195.004914, 127.414424),\n (195.004914, 127.414424, 195.004914, 128.129299),\n (195.004914, 128.129299, 195.004914, 128.844174),\n (195.004914, 128.844174, 195.004914, 129.55905),\n (195.004914, 129.55905, 195.004914, 130.273925),\n (195.004914, 130.273925, 195.004914, 130.9888),\n (195.004914, 130.9888, 195.004914, 131.703676),\n (195.004914, 131.703676, 195.004914, 132.418551),\n (195.004914, 132.418551, 195.004914, 133.133426),\n (195.004914, 133.133426, 195.004914, 133.848301),\n (195.004914, 133.848301, 195.004914, 134.563177),\n (195.004914, 134.563177, 195.004914, 135.278052),\n (195.004914, 135.278052, 195.004914, 135.992927),\n (195.004914, 135.992927, 195.004914, 136.707803),\n (195.004914, 136.707803, 195.004914, 137.422678),\n (195.004914, 137.422678, 195.004914, 138.137553),\n (195.004914, 138.137553, 195.004914, 138.852429),\n (195.004914, 138.852429, 195.004914, 139.567304),\n (195.004914, 139.567304, 195.004914, 140.282179),\n (176.264127, 117.40617, 176.264127, 118.121045),\n (176.264127, 118.121045, 176.264127, 118.83592),\n (176.264127, 118.83592, 176.264127, 119.550796),\n (176.264127, 119.550796, 176.264127, 120.265671),\n (176.264127, 120.265671, 176.264127, 120.980546),\n (176.264127, 120.980546, 176.264127, 121.695422),\n (176.264127, 121.695422, 176.264127, 122.410297),\n (176.264127, 122.410297, 176.264127, 123.125172),\n (176.264127, 123.125172, 176.264127, 123.840047),\n (176.264127, 123.840047, 176.264127, 124.554923),\n (176.264127, 124.554923, 176.264127, 125.269798),\n (176.264127, 125.269798, 176.264127, 125.984673),\n (176.264127, 125.984673, 176.264127, 126.699549),\n (176.264127, 126.699549, 176.264127, 127.414424),\n (176.264127, 127.414424, 176.264127, 128.129299),\n (176.264127, 128.129299, 176.264127, 128.844174),\n (176.264127, 128.844174, 176.264127, 129.55905),\n (176.264127, 129.55905, 176.264127, 130.273925),\n (176.264127, 130.273925, 176.264127, 130.9888),\n (176.264127, 130.9888, 176.264127, 131.703676),\n (176.264127, 131.703676, 176.264127, 132.418551),\n (176.264127, 132.418551, 176.264127, 133.133426),\n (176.264127, 133.133426, 176.264127, 133.848301),\n (176.264127, 133.848301, 176.264127, 134.563177),\n (176.264127, 134.563177, 176.264127, 135.278052),\n (176.264127, 135.278052, 176.264127, 135.992927),\n (176.264127, 135.992927, 176.264127, 136.707803),\n (176.264127, 136.707803, 176.264127, 137.422678),\n (176.264127, 137.422678, 176.264127, 138.137553),\n (176.264127, 138.137553, 176.264127, 138.852429),\n (176.264127, 138.852429, 176.264127, 139.567304),\n (176.264127, 139.567304, 176.264127, 140.282179),\n (176.264127, 173.357212, 195.004914, 173.357212),\n (176.264127, 96.952963, 195.004914, 96.952963),\n (176.264127, 117.40617, 195.004914, 117.40617),\n (195.004914, 140.282179, 176.264127, 140.282179)\n]\nVISIBLE_CIRCLES = [\n (109.92224, 135.860978, 7.368668),\n (126.870177, 157.966983, 7.368668),\n (148.976183, 110.070639, 7.368668)\n]\nVISIBLE_ARCS = [\n (135.959748, 129.827836, 44.954797, 107.490115, 166.552615),\n (126.866331, 158.08723, 15.269982, -39.434932, 106.815068),\n (142.765862, 144.914121, 5.378064, 139.768176, -86.638074),\n (144.211125, 128.187776, 11.4136, 42.243739, 95.681239),\n (117.908502, 108.215376, 44.407002, 3.346377, 38.502627),\n (149.206511, 110.010579, 13.057616, -149.782226, 3.499024),\n (112.98039, 88.310087, 29.172278, 31.238404, 93.113404),\n (110.287419, 135.965213, 18.559043, 166.549386, -86.575614),\n (-157.451923, -527.31378, 672.393878, 61.609058, 61.610882),\n (134.069722, 148.839308, 71.660651, -66.850607, -66.832714),\n (817.683159, 160.582526, 641.539604, 178.859032, 178.91733)\n]\nHIDDEN_SEGMENTS = [\n (138.6601, 64.2122, 138.6601, 82.953),\n (137.9232, 64.2122, 137.9232, 82.953),\n (117.2909, 64.2122, 117.2909, 82.953),\n (134.2389, 64.2122, 134.2389, 82.953),\n (156.3449, 64.2122, 156.3449, 82.953),\n (137.3878, 82.953, 137.3878, 64.2122),\n (102.5536, 82.953, 102.5536, 64.2122),\n (119.5015, 82.953, 119.5015, 64.2122),\n (141.6075, 82.953, 141.6075, 64.2122),\n (195.0049, 148.3877, 176.2641, 148.3877),\n (195.0049, 139.5453, 176.2641, 139.5453),\n (195.0049, 135.861, 176.2641, 135.861),\n (176.2641, 139.5361, 195.0049, 139.5361),\n (176.2641, 139.6014, 195.0049, 139.6014),\n (176.2641, 128.4923, 195.0049, 128.4923),\n (176.2641, 143.2296, 195.0049, 143.2296),\n (176.2641, 150.5983, 195.0049, 150.5983),\n (176.2641, 165.3356, 195.0049, 165.3356),\n (176.2641, 102.702, 195.0049, 102.702)\n]\n# (orient, text, p1, p2, base) for linear; (orient, text, center, radius, angle) for diameter\nDIMENSIONS = [\n ('diameter', '%%c33.2549', (109.9222, 135.861), 7.3687, 45),\n ('horizontal', '39.9059', (92.2374, 135.861), (109.9222, 135.861), (101.0798, 146.861)),\n ('vertical', '83.1373', (109.9222, 172.7043), (109.9222, 135.861), (120.9222, 154.2826)),\n ('diameter', '%%c33.2549', (126.8702, 157.967), 7.3687, 45),\n ('horizontal', '78.149', (92.2374, 157.967), (126.8702, 157.967), (109.5538, 168.967)),\n ('vertical', '33.2549', (126.8702, 172.7043), (126.8702, 157.967), (137.8702, 165.3356)),\n ('diameter', '%%c33.2549', (148.9762, 110.0706), 7.3687, 45),\n ('horizontal', '128.031', (92.2374, 110.0706), (148.9762, 110.0706), (120.6068, 121.0706)),\n ('vertical', '141.333', (148.9762, 172.7043), (148.9762, 110.0706), (159.9762, 141.3875)),\n ('radius', 'R101.441', (135.9597, 129.8278), 44.9548, 45),\n ('radius', 'R34.4568', (126.8664, 158.0872), 15.27, 135),\n ('radius', 'R12.1356', (142.7659, 144.9141), 5.378, 45),\n ('radius', 'R25.7549', (144.2111, 128.1878), 11.4136, 45),\n ('radius', 'R100.205', (117.9085, 108.2154), 44.407, 45),\n ('radius', 'R29.4646', (149.2065, 110.0106), 13.0576, 45),\n ('radius', 'R65.8275', (112.9804, 88.3101), 29.1723, 45),\n ('radius', 'R41.8786', (110.2874, 135.9652), 18.559, 135),\n ('horizontal', '42.2887', (195.0049, 140.2822), (176.2641, 140.2822), (185.6345, 129.2822))\n]\n\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; _ds.dxf.dimasz = 2.5\n _ds.dxf.dimexe = 1.25; _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\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\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,\n angle=(0 if d[0] == \"horizontal\" else 90),\n 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,\n 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,\n 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,\n text=text, dimstyle=\"EZDXF\").render()\n\n doc.saveas(out_path)\n\n\nif __name__ == \"__main__\":\n out = sys.argv[1] if len(sys.argv) > 1 else \"0057_00573906_gt.dxf\"\n draw(out)\n print(\"wrote\", out)\n```"}], "images": ["images/0057_00573906.png"], "id": "0057_00573906"} {"messages": [{"role": "user", "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 3 circular holes, each of diameter 33.25 mm. It is extruded to a thickness of 17.14 mm. The outline includes one or more oblique (angled) edges."}, {"role": "assistant", "content": "```python\n#!/usr/bin/env python3\n# -*- coding: utf-8 -*-\n# Ground-truth 2D engineering drawing for part: 0057_00573940\n# Self-contained: reproduces the three-view DXF via ezdxf, NO FreeCAD needed.\n# Coordinates are A4 page millimetres (scale=0.4431550819250073, page=[297.0, 210.0]).\n# visible edges -> solid (layer OUTLINE); hidden edges -> dashed (layer HIDDEN)\n# dimensions -> real movable DIMENSION entities (text = true mm value)\n# Run: python 0057_00573940_gt.py [out.dxf]\nimport sys\nimport ezdxf\nimport math\n\nSCALE = 0.4431550819250073\nPAGE = [297.0, 210.0]\n\nVISIBLE_SEGMENTS = [\n (97.827833, 69.77808, 98.771927, 69.77808),\n (98.771927, 69.77808, 99.716022, 69.77808),\n (99.716022, 69.77808, 100.660116, 69.77808),\n (100.660116, 69.77808, 101.60421, 69.77808),\n (101.60421, 69.77808, 102.548304, 69.77808),\n (102.548304, 69.77808, 103.492399, 69.77808),\n (103.492399, 69.77808, 104.436493, 69.77808),\n (104.436493, 69.77808, 105.380587, 69.77808),\n (105.380587, 69.77808, 106.324681, 69.77808),\n (106.324681, 69.77808, 107.268776, 69.77808),\n (107.268776, 69.77808, 108.21287, 69.77808),\n (108.21287, 69.77808, 109.156964, 69.77808),\n (109.156964, 69.77808, 110.101059, 69.77808),\n (110.101059, 69.77808, 111.045153, 69.77808),\n (111.045153, 69.77808, 111.989247, 69.77808),\n (111.989247, 69.77808, 112.933341, 69.77808),\n (112.933341, 69.77808, 113.877436, 69.77808),\n (113.877436, 69.77808, 114.82153, 69.77808),\n (114.82153, 69.77808, 115.765624, 69.77808),\n (115.765624, 69.77808, 116.709718, 69.77808),\n (116.709718, 69.77808, 117.653813, 69.77808),\n (117.653813, 69.77808, 118.597907, 69.77808),\n (118.597907, 69.77808, 119.542001, 69.77808),\n (119.542001, 69.77808, 120.486095, 69.77808),\n (120.486095, 69.77808, 121.43019, 69.77808),\n (121.43019, 69.77808, 122.374284, 69.77808),\n (122.374284, 69.77808, 123.318378, 69.77808),\n (123.318378, 69.77808, 124.262472, 69.77808),\n (124.262472, 69.77808, 125.206567, 69.77808),\n (125.206567, 69.77808, 126.150661, 69.77808),\n (126.150661, 69.77808, 127.094755, 69.77808),\n (127.094755, 69.77808, 128.03885, 69.77808),\n (128.03885, 69.77808, 128.03885, 77.375102),\n (97.827833, 77.375102, 98.771927, 77.375102),\n (98.771927, 77.375102, 99.716022, 77.375102),\n (99.716022, 77.375102, 100.660116, 77.375102),\n (100.660116, 77.375102, 101.60421, 77.375102),\n (101.60421, 77.375102, 102.548304, 77.375102),\n (102.548304, 77.375102, 103.492399, 77.375102),\n (103.492399, 77.375102, 104.436493, 77.375102),\n (104.436493, 77.375102, 105.380587, 77.375102),\n (105.380587, 77.375102, 106.324681, 77.375102),\n (106.324681, 77.375102, 107.268776, 77.375102),\n (107.268776, 77.375102, 108.21287, 77.375102),\n (108.21287, 77.375102, 109.156964, 77.375102),\n (109.156964, 77.375102, 110.101059, 77.375102),\n (110.101059, 77.375102, 111.045153, 77.375102),\n (111.045153, 77.375102, 111.989247, 77.375102),\n (111.989247, 77.375102, 112.933341, 77.375102),\n (112.933341, 77.375102, 113.877436, 77.375102),\n (113.877436, 77.375102, 114.82153, 77.375102),\n (114.82153, 77.375102, 115.765624, 77.375102),\n (115.765624, 77.375102, 116.709718, 77.375102),\n (116.709718, 77.375102, 117.653813, 77.375102),\n (117.653813, 77.375102, 118.597907, 77.375102),\n (118.597907, 77.375102, 119.542001, 77.375102),\n (119.542001, 77.375102, 120.486095, 77.375102),\n (120.486095, 77.375102, 121.43019, 77.375102),\n (121.43019, 77.375102, 122.374284, 77.375102),\n (122.374284, 77.375102, 123.318378, 77.375102),\n (123.318378, 77.375102, 124.262472, 77.375102),\n (124.262472, 77.375102, 125.206567, 77.375102),\n (125.206567, 77.375102, 126.150661, 77.375102),\n (126.150661, 77.375102, 127.094755, 77.375102),\n (127.094755, 77.375102, 128.03885, 77.375102),\n (128.03885, 69.77808, 128.654068, 69.77808),\n (128.654068, 69.77808, 129.269287, 69.77808),\n (129.269287, 69.77808, 129.884505, 69.77808),\n (129.884505, 69.77808, 130.499724, 69.77808),\n (130.499724, 69.77808, 131.114942, 69.77808),\n (131.114942, 69.77808, 131.730161, 69.77808),\n (131.730161, 69.77808, 132.34538, 69.77808),\n (132.34538, 69.77808, 132.960598, 69.77808),\n (132.960598, 69.77808, 133.575817, 69.77808),\n (133.575817, 69.77808, 134.191035, 69.77808),\n (134.191035, 69.77808, 134.806254, 69.77808),\n (134.806254, 69.77808, 135.421473, 69.77808),\n (135.421473, 69.77808, 136.036691, 69.77808),\n (136.036691, 69.77808, 136.65191, 69.77808),\n (136.65191, 69.77808, 137.267128, 69.77808),\n (137.267128, 69.77808, 137.882347, 69.77808),\n (137.882347, 69.77808, 138.497565, 69.77808),\n (138.497565, 69.77808, 139.112784, 69.77808),\n (139.112784, 69.77808, 139.728003, 69.77808),\n (139.728003, 69.77808, 140.343221, 69.77808),\n (140.343221, 69.77808, 140.95844, 69.77808),\n (140.95844, 69.77808, 141.573658, 69.77808),\n (141.573658, 69.77808, 142.188877, 69.77808),\n (142.188877, 69.77808, 142.804095, 69.77808),\n (142.804095, 69.77808, 143.419314, 69.77808),\n (143.419314, 69.77808, 144.034533, 69.77808),\n (144.034533, 69.77808, 144.649751, 69.77808),\n (144.649751, 69.77808, 145.26497, 69.77808),\n (145.26497, 69.77808, 145.880188, 69.77808),\n (145.880188, 69.77808, 146.495407, 69.77808),\n (146.495407, 69.77808, 147.110626, 69.77808),\n (147.110626, 69.77808, 147.725844, 69.77808),\n (128.03885, 77.375102, 128.654068, 77.375102),\n (128.654068, 77.375102, 129.269287, 77.375102),\n (129.269287, 77.375102, 129.884505, 77.375102),\n (129.884505, 77.375102, 130.499724, 77.375102),\n (130.499724, 77.375102, 131.114942, 77.375102),\n (131.114942, 77.375102, 131.730161, 77.375102),\n (131.730161, 77.375102, 132.34538, 77.375102),\n (132.34538, 77.375102, 132.960598, 77.375102),\n (132.960598, 77.375102, 133.575817, 77.375102),\n (133.575817, 77.375102, 134.191035, 77.375102),\n (134.191035, 77.375102, 134.806254, 77.375102),\n (134.806254, 77.375102, 135.421473, 77.375102),\n (135.421473, 77.375102, 136.036691, 77.375102),\n (136.036691, 77.375102, 136.65191, 77.375102),\n (136.65191, 77.375102, 137.267128, 77.375102),\n (137.267128, 77.375102, 137.882347, 77.375102),\n (137.882347, 77.375102, 138.497565, 77.375102),\n (138.497565, 77.375102, 139.112784, 77.375102),\n (139.112784, 77.375102, 139.728003, 77.375102),\n (139.728003, 77.375102, 140.343221, 77.375102),\n (140.343221, 77.375102, 140.95844, 77.375102),\n (140.95844, 77.375102, 141.573658, 77.375102),\n (141.573658, 77.375102, 142.188877, 77.375102),\n (142.188877, 77.375102, 142.804095, 77.375102),\n (142.804095, 77.375102, 143.419314, 77.375102),\n (143.419314, 77.375102, 144.034533, 77.375102),\n (144.034533, 77.375102, 144.649751, 77.375102),\n (144.649751, 77.375102, 145.26497, 77.375102),\n (145.26497, 77.375102, 145.880188, 77.375102),\n (145.880188, 77.375102, 146.495407, 77.375102),\n (146.495407, 77.375102, 147.110626, 77.375102),\n (147.110626, 77.375102, 147.725844, 77.375102),\n (147.725844, 77.375102, 147.755373, 77.375102),\n (147.755373, 77.375102, 147.784902, 77.375102),\n (147.784902, 77.375102, 147.81443, 77.375102),\n (147.81443, 77.375102, 147.843959, 77.375102),\n (147.843959, 77.375102, 147.873488, 77.375102),\n (147.873488, 77.375102, 147.903016, 77.375102),\n (147.903016, 77.375102, 147.932545, 77.375102),\n (147.932545, 77.375102, 147.962074, 77.375102),\n (147.962074, 77.375102, 147.991603, 77.375102),\n (147.991603, 77.375102, 148.021131, 77.375102),\n (148.021131, 77.375102, 148.05066, 77.375102),\n (148.05066, 77.375102, 148.080189, 77.375102),\n (148.080189, 77.375102, 148.109717, 77.375102),\n (148.109717, 77.375102, 148.139246, 77.375102),\n (148.139246, 77.375102, 148.168775, 77.375102),\n (148.168775, 77.375102, 148.198304, 77.375102),\n (148.198304, 77.375102, 148.227832, 77.375102),\n (148.227832, 77.375102, 148.257361, 77.375102),\n (148.257361, 77.375102, 148.28689, 77.375102),\n (148.28689, 77.375102, 148.316419, 77.375102),\n (148.316419, 77.375102, 148.345947, 77.375102),\n (148.345947, 77.375102, 148.375476, 77.375102),\n (148.375476, 77.375102, 148.405005, 77.375102),\n (148.405005, 77.375102, 148.434533, 77.375102),\n (148.434533, 77.375102, 148.464062, 77.375102),\n (148.464062, 77.375102, 148.493591, 77.375102),\n (148.493591, 77.375102, 148.52312, 77.375102),\n (148.52312, 77.375102, 148.552648, 77.375102),\n (148.552648, 77.375102, 148.582177, 77.375102),\n (148.582177, 77.375102, 148.611706, 77.375102),\n (148.611706, 77.375102, 148.641234, 77.375102),\n (148.641234, 77.375102, 148.670763, 77.375102),\n (147.725844, 69.77808, 147.755373, 69.77808),\n (147.755373, 69.77808, 147.784902, 69.77808),\n (147.784902, 69.77808, 147.81443, 69.77808),\n (147.81443, 69.77808, 147.843959, 69.77808),\n (147.843959, 69.77808, 147.873488, 69.77808),\n (147.873488, 69.77808, 147.903016, 69.77808),\n (147.903016, 69.77808, 147.932545, 69.77808),\n (147.932545, 69.77808, 147.962074, 69.77808),\n (147.962074, 69.77808, 147.991603, 69.77808),\n (147.991603, 69.77808, 148.021131, 69.77808),\n (148.021131, 69.77808, 148.05066, 69.77808),\n (148.05066, 69.77808, 148.080189, 69.77808),\n (148.080189, 69.77808, 148.109717, 69.77808),\n (148.109717, 69.77808, 148.139246, 69.77808),\n (148.139246, 69.77808, 148.168775, 69.77808),\n (148.168775, 69.77808, 148.198304, 69.77808),\n (148.198304, 69.77808, 148.227832, 69.77808),\n (148.227832, 69.77808, 148.257361, 69.77808),\n (148.257361, 69.77808, 148.28689, 69.77808),\n (148.28689, 69.77808, 148.316419, 69.77808),\n (148.316419, 69.77808, 148.345947, 69.77808),\n (148.345947, 69.77808, 148.375476, 69.77808),\n (148.375476, 69.77808, 148.405005, 69.77808),\n (148.405005, 69.77808, 148.434533, 69.77808),\n (148.434533, 69.77808, 148.464062, 69.77808),\n (148.464062, 69.77808, 148.493591, 69.77808),\n (148.493591, 69.77808, 148.52312, 69.77808),\n (148.52312, 69.77808, 148.552648, 69.77808),\n (148.552648, 69.77808, 148.582177, 69.77808),\n (148.582177, 69.77808, 148.611706, 69.77808),\n (148.611706, 69.77808, 148.641234, 69.77808),\n (148.641234, 69.77808, 148.670763, 69.77808),\n (148.670763, 69.77808, 148.947083, 69.77808),\n (148.947083, 69.77808, 149.223404, 69.77808),\n (149.223404, 69.77808, 149.499724, 69.77808),\n (149.499724, 69.77808, 149.776044, 69.77808),\n (149.776044, 69.77808, 150.052364, 69.77808),\n (150.052364, 69.77808, 150.328685, 69.77808),\n (150.328685, 69.77808, 150.605005, 69.77808),\n (150.605005, 69.77808, 150.881325, 69.77808),\n (150.881325, 69.77808, 151.157646, 69.77808),\n (151.157646, 69.77808, 151.433966, 69.77808),\n (151.433966, 69.77808, 151.710286, 69.77808),\n (151.710286, 69.77808, 151.986606, 69.77808),\n (151.986606, 69.77808, 152.262927, 69.77808),\n (152.262927, 69.77808, 152.539247, 69.77808),\n (152.539247, 69.77808, 152.815567, 69.77808),\n (152.815567, 69.77808, 153.091887, 69.77808),\n (153.091887, 69.77808, 153.368208, 69.77808),\n (153.368208, 69.77808, 153.644528, 69.77808),\n (153.644528, 69.77808, 153.920848, 69.77808),\n (153.920848, 69.77808, 154.197169, 69.77808),\n (154.197169, 69.77808, 154.473489, 69.77808),\n (154.473489, 69.77808, 154.749809, 69.77808),\n (154.749809, 69.77808, 155.026129, 69.77808),\n (155.026129, 69.77808, 155.30245, 69.77808),\n (155.30245, 69.77808, 155.57877, 69.77808),\n (155.57877, 69.77808, 155.85509, 69.77808),\n (155.85509, 69.77808, 156.13141, 69.77808),\n (156.13141, 69.77808, 156.407731, 69.77808),\n (156.407731, 69.77808, 156.684051, 69.77808),\n (156.684051, 69.77808, 156.960371, 69.77808),\n (156.960371, 69.77808, 157.236692, 69.77808),\n (157.236692, 69.77808, 157.513012, 69.77808),\n (148.670763, 77.375102, 148.947083, 77.375102),\n (148.947083, 77.375102, 149.223404, 77.375102),\n (149.223404, 77.375102, 149.499724, 77.375102),\n (149.499724, 77.375102, 149.776044, 77.375102),\n (149.776044, 77.375102, 150.052364, 77.375102),\n (150.052364, 77.375102, 150.328685, 77.375102),\n (150.328685, 77.375102, 150.605005, 77.375102),\n (150.605005, 77.375102, 150.881325, 77.375102),\n (150.881325, 77.375102, 151.157646, 77.375102),\n (151.157646, 77.375102, 151.433966, 77.375102),\n (151.433966, 77.375102, 151.710286, 77.375102),\n (151.710286, 77.375102, 151.986606, 77.375102),\n (151.986606, 77.375102, 152.262927, 77.375102),\n (152.262927, 77.375102, 152.539247, 77.375102),\n (152.539247, 77.375102, 152.815567, 77.375102),\n (152.815567, 77.375102, 153.091887, 77.375102),\n (153.091887, 77.375102, 153.368208, 77.375102),\n (153.368208, 77.375102, 153.644528, 77.375102),\n (153.644528, 77.375102, 153.920848, 77.375102),\n (153.920848, 77.375102, 154.197169, 77.375102),\n (154.197169, 77.375102, 154.473489, 77.375102),\n (154.473489, 77.375102, 154.749809, 77.375102),\n (154.749809, 77.375102, 155.026129, 77.375102),\n (155.026129, 77.375102, 155.30245, 77.375102),\n (155.30245, 77.375102, 155.57877, 77.375102),\n (155.57877, 77.375102, 155.85509, 77.375102),\n (155.85509, 77.375102, 156.13141, 77.375102),\n (156.13141, 77.375102, 156.407731, 77.375102),\n (156.407731, 77.375102, 156.684051, 77.375102),\n (156.684051, 77.375102, 156.960371, 77.375102),\n (156.960371, 77.375102, 157.236692, 77.375102),\n (157.236692, 77.375102, 157.513012, 77.375102),\n (157.513012, 69.77808, 157.835385, 69.77808),\n (157.835385, 69.77808, 158.157759, 69.77808),\n (158.157759, 69.77808, 158.480133, 69.77808),\n (158.480133, 69.77808, 158.802506, 69.77808),\n (158.802506, 69.77808, 159.12488, 69.77808),\n (159.12488, 69.77808, 159.447254, 69.77808),\n (159.447254, 69.77808, 159.769627, 69.77808),\n (159.769627, 69.77808, 160.092001, 69.77808),\n (160.092001, 69.77808, 160.414375, 69.77808),\n (160.414375, 69.77808, 160.736748, 69.77808),\n (160.736748, 69.77808, 161.059122, 69.77808),\n (161.059122, 69.77808, 161.381496, 69.77808),\n (161.381496, 69.77808, 161.703869, 69.77808),\n (161.703869, 69.77808, 162.026243, 69.77808),\n (162.026243, 69.77808, 162.348617, 69.77808),\n (162.348617, 69.77808, 162.67099, 69.77808),\n (162.67099, 69.77808, 162.993364, 69.77808),\n (162.993364, 69.77808, 163.315738, 69.77808),\n (163.315738, 69.77808, 163.638111, 69.77808),\n (163.638111, 69.77808, 163.960485, 69.77808),\n (163.960485, 69.77808, 164.282858, 69.77808),\n (164.282858, 69.77808, 164.605232, 69.77808),\n (164.605232, 69.77808, 164.927606, 69.77808),\n (164.927606, 69.77808, 165.249979, 69.77808),\n (165.249979, 69.77808, 165.572353, 69.77808),\n (165.572353, 69.77808, 165.894727, 69.77808),\n (165.894727, 69.77808, 166.2171, 69.77808),\n (166.2171, 69.77808, 166.539474, 69.77808),\n (166.539474, 69.77808, 166.861848, 69.77808),\n (166.861848, 69.77808, 167.184221, 69.77808),\n (167.184221, 69.77808, 167.506595, 69.77808),\n (167.506595, 69.77808, 167.828969, 69.77808),\n (167.828969, 69.77808, 167.828969, 77.375102),\n (157.513012, 77.375102, 157.835385, 77.375102),\n (157.835385, 77.375102, 158.157759, 77.375102),\n (158.157759, 77.375102, 158.480133, 77.375102),\n (158.480133, 77.375102, 158.802506, 77.375102),\n (158.802506, 77.375102, 159.12488, 77.375102),\n (159.12488, 77.375102, 159.447254, 77.375102),\n (159.447254, 77.375102, 159.769627, 77.375102),\n (159.769627, 77.375102, 160.092001, 77.375102),\n (160.092001, 77.375102, 160.414375, 77.375102),\n (160.414375, 77.375102, 160.736748, 77.375102),\n (160.736748, 77.375102, 161.059122, 77.375102),\n (161.059122, 77.375102, 161.381496, 77.375102),\n (161.381496, 77.375102, 161.703869, 77.375102),\n (161.703869, 77.375102, 162.026243, 77.375102),\n (162.026243, 77.375102, 162.348617, 77.375102),\n (162.348617, 77.375102, 162.67099, 77.375102),\n (162.67099, 77.375102, 162.993364, 77.375102),\n (162.993364, 77.375102, 163.315738, 77.375102),\n (163.315738, 77.375102, 163.638111, 77.375102),\n (163.638111, 77.375102, 163.960485, 77.375102),\n (163.960485, 77.375102, 164.282858, 77.375102),\n (164.282858, 77.375102, 164.605232, 77.375102),\n (164.605232, 77.375102, 164.927606, 77.375102),\n (164.927606, 77.375102, 165.249979, 77.375102),\n (165.249979, 77.375102, 165.572353, 77.375102),\n (165.572353, 77.375102, 165.894727, 77.375102),\n (165.894727, 77.375102, 166.2171, 77.375102),\n (166.2171, 77.375102, 166.539474, 77.375102),\n (166.539474, 77.375102, 166.861848, 77.375102),\n (166.861848, 77.375102, 167.184221, 77.375102),\n (167.184221, 77.375102, 167.506595, 77.375102),\n (167.506595, 77.375102, 167.828969, 77.375102),\n (147.725844, 77.375102, 147.725844, 69.77808),\n (167.829444, 77.375102, 167.829444, 69.77808),\n (97.318782, 77.375102, 97.318782, 69.77808),\n (97.827833, 69.77808, 97.827833, 77.375102),\n (148.670763, 69.77808, 148.670763, 77.375102),\n (157.513012, 69.77808, 157.513012, 77.375102),\n (189.426467, 134.729981, 189.426467, 135.743155),\n (189.426467, 135.743155, 189.426467, 136.75633),\n (189.426467, 136.75633, 189.426467, 137.769504),\n (189.426467, 137.769504, 189.426467, 138.782678),\n (189.426467, 138.782678, 189.426467, 139.795853),\n (189.426467, 139.795853, 189.426467, 140.809027),\n (189.426467, 140.809027, 189.426467, 141.822201),\n (189.426467, 141.822201, 189.426467, 142.835376),\n (189.426467, 142.835376, 189.426467, 143.84855),\n (189.426467, 143.84855, 189.426467, 144.861724),\n (189.426467, 144.861724, 189.426467, 145.874899),\n (189.426467, 145.874899, 189.426467, 146.888073),\n (189.426467, 146.888073, 189.426467, 147.901247),\n (189.426467, 147.901247, 189.426467, 148.914422),\n (189.426467, 148.914422, 189.426467, 149.927596),\n (189.426467, 149.927596, 189.426467, 150.94077),\n (189.426467, 150.94077, 189.426467, 151.953945),\n (189.426467, 151.953945, 189.426467, 152.967119),\n (189.426467, 152.967119, 189.426467, 153.980293),\n (189.426467, 153.980293, 189.426467, 154.993468),\n (189.426467, 154.993468, 189.426467, 156.006642),\n (189.426467, 156.006642, 189.426467, 157.019816),\n (189.426467, 157.019816, 189.426467, 158.032991),\n (189.426467, 158.032991, 189.426467, 159.046165),\n (189.426467, 159.046165, 189.426467, 160.059339),\n (189.426467, 160.059339, 189.426467, 161.072514),\n (189.426467, 161.072514, 189.426467, 162.085688),\n (189.426467, 162.085688, 189.426467, 163.098862),\n (189.426467, 163.098862, 189.426467, 164.112037),\n (189.426467, 164.112037, 189.426467, 165.125211),\n (189.426467, 165.125211, 189.426467, 166.138385),\n (189.426467, 166.138385, 189.426467, 167.15156),\n (189.426467, 167.15156, 181.829444, 167.15156),\n (181.829444, 134.729981, 181.829444, 135.743155),\n (181.829444, 135.743155, 181.829444, 136.75633),\n (181.829444, 136.75633, 181.829444, 137.769504),\n (181.829444, 137.769504, 181.829444, 138.782678),\n (181.829444, 138.782678, 181.829444, 139.795853),\n (181.829444, 139.795853, 181.829444, 140.809027),\n (181.829444, 140.809027, 181.829444, 141.822201),\n (181.829444, 141.822201, 181.829444, 142.835376),\n (181.829444, 142.835376, 181.829444, 143.84855),\n (181.829444, 143.84855, 181.829444, 144.861724),\n (181.829444, 144.861724, 181.829444, 145.874899),\n (181.829444, 145.874899, 181.829444, 146.888073),\n (181.829444, 146.888073, 181.829444, 147.901247),\n (181.829444, 147.901247, 181.829444, 148.914422),\n (181.829444, 148.914422, 181.829444, 149.927596),\n (181.829444, 149.927596, 181.829444, 150.94077),\n (181.829444, 150.94077, 181.829444, 151.953945),\n (181.829444, 151.953945, 181.829444, 152.967119),\n (181.829444, 152.967119, 181.829444, 153.980293),\n (181.829444, 153.980293, 181.829444, 154.993468),\n (181.829444, 154.993468, 181.829444, 156.006642),\n (181.829444, 156.006642, 181.829444, 157.019816),\n (181.829444, 157.019816, 181.829444, 158.032991),\n (181.829444, 158.032991, 181.829444, 159.046165),\n (181.829444, 159.046165, 181.829444, 160.059339),\n (181.829444, 160.059339, 181.829444, 161.072514),\n (181.829444, 161.072514, 181.829444, 162.085688),\n (181.829444, 162.085688, 181.829444, 163.098862),\n (181.829444, 163.098862, 181.829444, 164.112037),\n (181.829444, 164.112037, 181.829444, 165.125211),\n (181.829444, 165.125211, 181.829444, 166.138385),\n (181.829444, 166.138385, 181.829444, 167.15156),\n (189.426467, 167.15156, 189.426467, 167.171962),\n (189.426467, 167.171962, 189.426467, 167.192365),\n (189.426467, 167.192365, 189.426467, 167.212767),\n (189.426467, 167.212767, 189.426467, 167.23317),\n (189.426467, 167.23317, 189.426467, 167.253572),\n (189.426467, 167.253572, 189.426467, 167.273975),\n (189.426467, 167.273975, 189.426467, 167.294377),\n (189.426467, 167.294377, 189.426467, 167.31478),\n (189.426467, 167.31478, 189.426467, 167.335182),\n (189.426467, 167.335182, 189.426467, 167.355585),\n (189.426467, 167.355585, 189.426467, 167.375987),\n (189.426467, 167.375987, 189.426467, 167.39639),\n (189.426467, 167.39639, 189.426467, 167.416792),\n (189.426467, 167.416792, 189.426467, 167.437195),\n (189.426467, 167.437195, 189.426467, 167.457597),\n (189.426467, 167.457597, 189.426467, 167.478),\n (189.426467, 167.478, 189.426467, 167.498402),\n (189.426467, 167.498402, 189.426467, 167.518805),\n (189.426467, 167.518805, 189.426467, 167.539207),\n (189.426467, 167.539207, 189.426467, 167.55961),\n (189.426467, 167.55961, 189.426467, 167.580012),\n (189.426467, 167.580012, 189.426467, 167.600415),\n (189.426467, 167.600415, 189.426467, 167.620817),\n (189.426467, 167.620817, 189.426467, 167.64122),\n (189.426467, 167.64122, 189.426467, 167.661622),\n (189.426467, 167.661622, 189.426467, 167.682025),\n (189.426467, 167.682025, 189.426467, 167.702427),\n (189.426467, 167.702427, 189.426467, 167.72283),\n (189.426467, 167.72283, 189.426467, 167.743232),\n (189.426467, 167.743232, 189.426467, 167.763635),\n (189.426467, 167.763635, 189.426467, 167.784037),\n (189.426467, 167.784037, 189.426467, 167.80444),\n (189.426467, 91.375102, 189.426467, 91.578608),\n (189.426467, 91.578608, 189.426467, 91.782113),\n (189.426467, 91.782113, 189.426467, 91.985619),\n (189.426467, 91.985619, 189.426467, 92.189124),\n (189.426467, 92.189124, 189.426467, 92.39263),\n (189.426467, 92.39263, 189.426467, 92.596135),\n (189.426467, 92.596135, 189.426467, 92.799641),\n (189.426467, 92.799641, 189.426467, 93.003146),\n (189.426467, 93.003146, 189.426467, 93.206652),\n (189.426467, 93.206652, 189.426467, 93.410157),\n (189.426467, 93.410157, 189.426467, 93.613663),\n (189.426467, 93.613663, 189.426467, 93.817168),\n (189.426467, 93.817168, 189.426467, 94.020674),\n (189.426467, 94.020674, 189.426467, 94.224179),\n (189.426467, 94.224179, 189.426467, 94.427685),\n (189.426467, 94.427685, 189.426467, 94.63119),\n (189.426467, 94.63119, 189.426467, 94.834696),\n (189.426467, 94.834696, 189.426467, 95.038201),\n (189.426467, 95.038201, 189.426467, 95.241707),\n (189.426467, 95.241707, 189.426467, 95.445212),\n (189.426467, 95.445212, 189.426467, 95.648718),\n (189.426467, 95.648718, 189.426467, 95.852223),\n (189.426467, 95.852223, 189.426467, 96.055729),\n (189.426467, 96.055729, 189.426467, 96.259234),\n (189.426467, 96.259234, 189.426467, 96.46274),\n (189.426467, 96.46274, 189.426467, 96.666245),\n (189.426467, 96.666245, 189.426467, 96.869751),\n (189.426467, 96.869751, 189.426467, 97.073256),\n (189.426467, 97.073256, 189.426467, 97.276762),\n (189.426467, 97.276762, 189.426467, 97.480267),\n (189.426467, 97.480267, 189.426467, 97.683773),\n (189.426467, 97.683773, 189.426467, 97.887278),\n (189.426467, 97.887278, 181.829444, 97.887278),\n (181.829444, 91.375102, 181.829444, 91.578608),\n (181.829444, 91.578608, 181.829444, 91.782113),\n (181.829444, 91.782113, 181.829444, 91.985619),\n (181.829444, 91.985619, 181.829444, 92.189124),\n (181.829444, 92.189124, 181.829444, 92.39263),\n (181.829444, 92.39263, 181.829444, 92.596135),\n (181.829444, 92.596135, 181.829444, 92.799641),\n (181.829444, 92.799641, 181.829444, 93.003146),\n (181.829444, 93.003146, 181.829444, 93.206652),\n (181.829444, 93.206652, 181.829444, 93.410157),\n (181.829444, 93.410157, 181.829444, 93.613663),\n (181.829444, 93.613663, 181.829444, 93.817168),\n (181.829444, 93.817168, 181.829444, 94.020674),\n (181.829444, 94.020674, 181.829444, 94.224179),\n (181.829444, 94.224179, 181.829444, 94.427685),\n (181.829444, 94.427685, 181.829444, 94.63119),\n (181.829444, 94.63119, 181.829444, 94.834696),\n (181.829444, 94.834696, 181.829444, 95.038201),\n (181.829444, 95.038201, 181.829444, 95.241707),\n (181.829444, 95.241707, 181.829444, 95.445212),\n (181.829444, 95.445212, 181.829444, 95.648718),\n (181.829444, 95.648718, 181.829444, 95.852223),\n (181.829444, 95.852223, 181.829444, 96.055729),\n (181.829444, 96.055729, 181.829444, 96.259234),\n (181.829444, 96.259234, 181.829444, 96.46274),\n (181.829444, 96.46274, 181.829444, 96.666245),\n (181.829444, 96.666245, 181.829444, 96.869751),\n (181.829444, 96.869751, 181.829444, 97.073256),\n (181.829444, 97.073256, 181.829444, 97.276762),\n (181.829444, 97.276762, 181.829444, 97.480267),\n (181.829444, 97.480267, 181.829444, 97.683773),\n (181.829444, 97.683773, 181.829444, 97.887278),\n (181.829444, 97.887278, 181.829444, 98.32375),\n (181.829444, 98.32375, 181.829444, 98.760221),\n (181.829444, 98.760221, 181.829444, 99.196693),\n (181.829444, 99.196693, 181.829444, 99.633165),\n (181.829444, 99.633165, 181.829444, 100.069636),\n (181.829444, 100.069636, 181.829444, 100.506108),\n (181.829444, 100.506108, 181.829444, 100.942579),\n (181.829444, 100.942579, 181.829444, 101.379051),\n (181.829444, 101.379051, 181.829444, 101.815522),\n (181.829444, 101.815522, 181.829444, 102.251994),\n (181.829444, 102.251994, 181.829444, 102.688466),\n (181.829444, 102.688466, 181.829444, 103.124937),\n (181.829444, 103.124937, 181.829444, 103.561409),\n (181.829444, 103.561409, 181.829444, 103.99788),\n (181.829444, 103.99788, 181.829444, 104.434352),\n (181.829444, 104.434352, 181.829444, 104.870823),\n (181.829444, 104.870823, 181.829444, 105.307295),\n (181.829444, 105.307295, 181.829444, 105.743767),\n (181.829444, 105.743767, 181.829444, 106.180238),\n (181.829444, 106.180238, 181.829444, 106.61671),\n (181.829444, 106.61671, 181.829444, 107.053181),\n (181.829444, 107.053181, 181.829444, 107.489653),\n (181.829444, 107.489653, 181.829444, 107.926124),\n (181.829444, 107.926124, 181.829444, 108.362596),\n (181.829444, 108.362596, 181.829444, 108.799068),\n (181.829444, 108.799068, 181.829444, 109.235539),\n (181.829444, 109.235539, 181.829444, 109.672011),\n (181.829444, 109.672011, 181.829444, 110.108482),\n (181.829444, 110.108482, 181.829444, 110.544954),\n (181.829444, 110.544954, 181.829444, 110.981425),\n (181.829444, 110.981425, 181.829444, 111.417897),\n (181.829444, 111.417897, 181.829444, 111.854369),\n (189.426467, 97.887278, 189.426467, 98.32375),\n (189.426467, 98.32375, 189.426467, 98.760221),\n (189.426467, 98.760221, 189.426467, 99.196693),\n (189.426467, 99.196693, 189.426467, 99.633165),\n (189.426467, 99.633165, 189.426467, 100.069636),\n (189.426467, 100.069636, 189.426467, 100.506108),\n (189.426467, 100.506108, 189.426467, 100.942579),\n (189.426467, 100.942579, 189.426467, 101.379051),\n (189.426467, 101.379051, 189.426467, 101.815522),\n (189.426467, 101.815522, 189.426467, 102.251994),\n (189.426467, 102.251994, 189.426467, 102.688466),\n (189.426467, 102.688466, 189.426467, 103.124937),\n (189.426467, 103.124937, 189.426467, 103.561409),\n (189.426467, 103.561409, 189.426467, 103.99788),\n (189.426467, 103.99788, 189.426467, 104.434352),\n (189.426467, 104.434352, 189.426467, 104.870823),\n (189.426467, 104.870823, 189.426467, 105.307295),\n (189.426467, 105.307295, 189.426467, 105.743767),\n (189.426467, 105.743767, 189.426467, 106.180238),\n (189.426467, 106.180238, 189.426467, 106.61671),\n (189.426467, 106.61671, 189.426467, 107.053181),\n (189.426467, 107.053181, 189.426467, 107.489653),\n (189.426467, 107.489653, 189.426467, 107.926124),\n (189.426467, 107.926124, 189.426467, 108.362596),\n (189.426467, 108.362596, 189.426467, 108.799068),\n (189.426467, 108.799068, 189.426467, 109.235539),\n (189.426467, 109.235539, 189.426467, 109.672011),\n (189.426467, 109.672011, 189.426467, 110.108482),\n (189.426467, 110.108482, 189.426467, 110.544954),\n (189.426467, 110.544954, 189.426467, 110.981425),\n (189.426467, 110.981425, 189.426467, 111.417897),\n (189.426467, 111.417897, 189.426467, 111.854369),\n (189.426467, 111.854369, 189.426467, 112.569232),\n (189.426467, 112.569232, 189.426467, 113.284094),\n (189.426467, 113.284094, 189.426467, 113.998957),\n (189.426467, 113.998957, 189.426467, 114.71382),\n (189.426467, 114.71382, 189.426467, 115.428683),\n (189.426467, 115.428683, 189.426467, 116.143546),\n (189.426467, 116.143546, 189.426467, 116.858409),\n (189.426467, 116.858409, 189.426467, 117.573272),\n (189.426467, 117.573272, 189.426467, 118.288135),\n (189.426467, 118.288135, 189.426467, 119.002998),\n (189.426467, 119.002998, 189.426467, 119.71786),\n (189.426467, 119.71786, 189.426467, 120.432723),\n (189.426467, 120.432723, 189.426467, 121.147586),\n (189.426467, 121.147586, 189.426467, 121.862449),\n (189.426467, 121.862449, 189.426467, 122.577312),\n (189.426467, 122.577312, 189.426467, 123.292175),\n (189.426467, 123.292175, 189.426467, 124.007038),\n (189.426467, 124.007038, 189.426467, 124.721901),\n (189.426467, 124.721901, 189.426467, 125.436764),\n (189.426467, 125.436764, 189.426467, 126.151626),\n (189.426467, 126.151626, 189.426467, 126.866489),\n (189.426467, 126.866489, 189.426467, 127.581352),\n (189.426467, 127.581352, 189.426467, 128.296215),\n (189.426467, 128.296215, 189.426467, 129.011078),\n (189.426467, 129.011078, 189.426467, 129.725941),\n (189.426467, 129.725941, 189.426467, 130.440804),\n (189.426467, 130.440804, 189.426467, 131.155667),\n (189.426467, 131.155667, 189.426467, 131.87053),\n (189.426467, 131.87053, 189.426467, 132.585392),\n (189.426467, 132.585392, 189.426467, 133.300255),\n (189.426467, 133.300255, 189.426467, 134.015118),\n (189.426467, 134.015118, 189.426467, 134.729981),\n (181.829444, 111.854369, 181.829444, 112.569232),\n (181.829444, 112.569232, 181.829444, 113.284094),\n (181.829444, 113.284094, 181.829444, 113.998957),\n (181.829444, 113.998957, 181.829444, 114.71382),\n (181.829444, 114.71382, 181.829444, 115.428683),\n (181.829444, 115.428683, 181.829444, 116.143546),\n (181.829444, 116.143546, 181.829444, 116.858409),\n (181.829444, 116.858409, 181.829444, 117.573272),\n (181.829444, 117.573272, 181.829444, 118.288135),\n (181.829444, 118.288135, 181.829444, 119.002998),\n (181.829444, 119.002998, 181.829444, 119.71786),\n (181.829444, 119.71786, 181.829444, 120.432723),\n (181.829444, 120.432723, 181.829444, 121.147586),\n (181.829444, 121.147586, 181.829444, 121.862449),\n (181.829444, 121.862449, 181.829444, 122.577312),\n (181.829444, 122.577312, 181.829444, 123.292175),\n (181.829444, 123.292175, 181.829444, 124.007038),\n (181.829444, 124.007038, 181.829444, 124.721901),\n (181.829444, 124.721901, 181.829444, 125.436764),\n (181.829444, 125.436764, 181.829444, 126.151626),\n (181.829444, 126.151626, 181.829444, 126.866489),\n (181.829444, 126.866489, 181.829444, 127.581352),\n (181.829444, 127.581352, 181.829444, 128.296215),\n (181.829444, 128.296215, 181.829444, 129.011078),\n (181.829444, 129.011078, 181.829444, 129.725941),\n (181.829444, 129.725941, 181.829444, 130.440804),\n (181.829444, 130.440804, 181.829444, 131.155667),\n (181.829444, 131.155667, 181.829444, 131.87053),\n (181.829444, 131.87053, 181.829444, 132.585392),\n (181.829444, 132.585392, 181.829444, 133.300255),\n (181.829444, 133.300255, 181.829444, 134.015118),\n (181.829444, 134.015118, 181.829444, 134.729981),\n (181.829444, 167.80444, 189.426467, 167.80444),\n (181.829444, 91.375102, 189.426467, 91.375102),\n (181.829444, 111.854369, 189.426467, 111.854369),\n (189.426467, 134.729981, 181.829444, 134.729981)\n]\nVISIBLE_CIRCLES = [\n (115.512331, 130.308857, 7.368541),\n (132.459974, 152.414479, 7.368541),\n (154.565596, 104.518965, 7.368541)\n]\nVISIBLE_ARCS = [\n (141.549386, 124.275819, 44.954018, 107.490115, 166.552615),\n (132.456127, 152.534723, 15.269717, -39.434932, 106.815068),\n (148.355383, 139.361842, 5.377971, 139.768176, -86.638074),\n (149.317563, 123.092614, 10.919685, 41.36451, 93.39576),\n (126.63203, 102.998327, 41.224993, 2.113909, 41.488909),\n (154.796921, 104.407626, 13.032523, -149.979256, 0.489494),\n (118.570428, 82.758791, 29.171772, 31.238404, 93.113404),\n (115.877503, 130.41309, 18.558721, 166.549386, -86.575614),\n (135.04065, 102.17275, 46.092343, -44.653987, -44.653572),\n (120.816267, 406.670739, 332.634684, -81.874933, -81.874852),\n (107.394165, 16.64176, 54.036594, 100.205847, 100.736612),\n (101.344292, -358.970699, 436.362128, 90.46173, 90.528567),\n (465.428632, 165.445815, 283.60675, 179.523496, 179.655391)\n]\nHIDDEN_SEGMENTS = [\n (144.2496, 69.7781, 144.2496, 77.3751),\n (143.5128, 69.7781, 143.5128, 77.3751),\n (122.8809, 69.7781, 122.8809, 77.3751),\n (139.8285, 69.7781, 139.8285, 77.3751),\n (161.9341, 69.7781, 161.9341, 77.3751),\n (142.9774, 77.3751, 142.9774, 69.7781),\n (108.1438, 77.3751, 108.1438, 69.7781),\n (125.0914, 77.3751, 125.0914, 69.7781),\n (147.197, 77.3751, 147.197, 69.7781),\n (189.4265, 142.8354, 181.8294, 142.8354),\n (189.4265, 104.519, 181.8294, 104.519),\n (181.8294, 133.9839, 189.4265, 133.9839),\n (181.8294, 134.0123, 189.4265, 134.0123),\n (181.8294, 122.9403, 189.4265, 122.9403),\n (181.8294, 137.6774, 189.4265, 137.6774),\n (181.8294, 145.0459, 189.4265, 145.0459),\n (181.8294, 159.783, 189.4265, 159.783),\n (181.8294, 97.1504, 189.4265, 97.1504)\n]\n# (orient, text, p1, p2, base) for linear; (orient, text, center, radius, angle) for diameter\nDIMENSIONS = [\n ('diameter', '%%c33.2549', (115.5123, 130.3088), 7.3685, 45),\n ('horizontal', '39.9059', (97.8278, 130.3088), (115.5123, 130.3088), (106.6701, 141.3088)),\n ('vertical', '83.1373', (115.5123, 167.1516), (115.5123, 130.3088), (126.5123, 148.7302)),\n ('diameter', '%%c33.2549', (132.46, 152.4145), 7.3685, 45),\n ('horizontal', '78.149', (97.8278, 152.4145), (132.46, 152.4145), (115.1439, 163.4145)),\n ('vertical', '33.2549', (132.46, 167.1516), (132.46, 152.4145), (143.46, 159.783)),\n ('diameter', '%%c33.2549', (154.5656, 104.519), 7.3685, 45),\n ('horizontal', '128.031', (97.8278, 104.519), (154.5656, 104.519), (126.1967, 115.519)),\n ('vertical', '141.333', (154.5656, 167.1516), (154.5656, 104.519), (165.5656, 135.8353)),\n ('radius', 'R101.441', (141.5494, 124.2758), 44.954, 45),\n ('radius', 'R34.4568', (132.4561, 152.5347), 15.2697, 135),\n ('radius', 'R12.1356', (148.3554, 139.3618), 5.378, 45),\n ('radius', 'R24.6408', (149.3176, 123.0926), 10.9197, 45),\n ('radius', 'R93.0261', (126.632, 102.9983), 41.225, 45),\n ('radius', 'R29.4085', (154.7969, 104.4076), 13.0325, 135),\n ('radius', 'R65.8275', (118.5704, 82.7588), 29.1718, 45),\n ('radius', 'R41.8786', (115.8775, 130.4131), 18.5587, 135),\n ('horizontal', '17.143', (189.4265, 134.73), (181.8295, 134.73), (185.628, 123.73))\n]\n\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; _ds.dxf.dimasz = 2.5\n _ds.dxf.dimexe = 1.25; _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\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\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,\n angle=(0 if d[0] == \"horizontal\" else 90),\n 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,\n 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,\n 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,\n text=text, dimstyle=\"EZDXF\").render()\n\n doc.saveas(out_path)\n\n\nif __name__ == \"__main__\":\n out = sys.argv[1] if len(sys.argv) > 1 else \"0057_00573940_gt.dxf\"\n draw(out)\n print(\"wrote\", out)\n```"}], "images": ["images/0057_00573940.png"], "id": "0057_00573940"} {"messages": [{"role": "user", "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:\nNo solid geometry found."}, {"role": "assistant", "content": "```python\n#!/usr/bin/env python3\n# -*- coding: utf-8 -*-\n# Ground-truth 2D engineering drawing for part: 0057_00575777\n# Self-contained: reproduces the three-view DXF via ezdxf, NO FreeCAD needed.\n# Coordinates are A4 page millimetres (scale=63.13516411952736, page=[297.0, 210.0]).\n# visible edges -> solid (layer OUTLINE); hidden edges -> dashed (layer HIDDEN)\n# dimensions -> real movable DIMENSION entities (text = true mm value)\n# Run: python 0057_00575777_gt.py [out.dxf]\nimport sys\nimport ezdxf\nimport math\n\nSCALE = 63.13516411952736\nPAGE = [297.0, 210.0]\n\nVISIBLE_SEGMENTS = [\n (116.910446, 97.121976, 116.910446, 97.327359),\n (116.910446, 97.327359, 115.430716, 97.327359),\n (115.430716, 97.121976, 115.430716, 97.327359),\n (115.430716, 97.327359, 115.430716, 134.019482),\n (116.910446, 134.019482, 115.430716, 134.019482),\n (116.910446, 97.327359, 116.910446, 134.019482),\n (115.430716, 134.019482, 115.430716, 171.703283),\n (116.910446, 171.703283, 115.430716, 171.703283),\n (116.910446, 134.019482, 116.910446, 171.703283),\n (115.430716, 171.703283, 115.430716, 191.536862),\n (116.910446, 191.536862, 115.430716, 191.536862),\n (116.910446, 171.703283, 116.910446, 191.536862),\n (116.910446, 191.536862, 116.910446, 191.742246),\n (115.430716, 191.536862, 115.430716, 191.742246),\n (115.430716, 97.121976, 116.910446, 97.121976),\n (115.430716, 191.742246, 116.910446, 191.742246),\n (116.910446, 42.463138, 115.430716, 42.463138),\n (116.910446, 42.463138, 116.910446, 43.454817),\n (116.910446, 43.454817, 115.430716, 43.454817),\n (115.430716, 42.463138, 115.430716, 43.454817),\n (115.430716, 43.454817, 115.430716, 83.121976),\n (116.910446, 83.121976, 115.430716, 83.121976),\n (116.910446, 43.454817, 116.910446, 83.121976),\n (130.910446, 97.327359, 170.577605, 97.327359),\n (171.569284, 97.327359, 171.569284, 134.019482),\n (171.569284, 171.703283, 171.569284, 191.536862),\n (170.577605, 191.536862, 130.910446, 191.536862),\n (130.910446, 191.536862, 130.910446, 171.703283),\n (130.910446, 134.019482, 130.910446, 97.327359)\n]\nVISIBLE_CIRCLES = [\n\n]\nVISIBLE_ARCS = [\n (171.073445, 97.823199, 0.701223, -135.0, -45.0),\n (187.822419, 152.861382, 24.88336, 130.78125, -130.78125),\n (171.073445, 191.041023, 0.701223, 45.0, 135.0),\n (114.657311, 152.861382, 24.88336, -49.21875, 49.21875)\n]\nHIDDEN_SEGMENTS = [\n (115.4307, 51.0934, 116.9104, 51.0934),\n (115.4307, 74.4918, 116.9104, 74.4918)\n]\n# (orient, text, p1, p2, base) for linear; (orient, text, center, radius, angle) for diameter\nDIMENSIONS = [\n\n]\n\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; _ds.dxf.dimasz = 2.5\n _ds.dxf.dimexe = 1.25; _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\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\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,\n angle=(0 if d[0] == \"horizontal\" else 90),\n 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,\n 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,\n 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,\n text=text, dimstyle=\"EZDXF\").render()\n\n doc.saveas(out_path)\n\n\nif __name__ == \"__main__\":\n out = sys.argv[1] if len(sys.argv) > 1 else \"0057_00575777_gt.dxf\"\n draw(out)\n print(\"wrote\", out)\n```"}], "images": ["images/0057_00575777.png"], "id": "0057_00575777"} {"messages": [{"role": "user", "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 30.34 x 100 mm bounding box. It is extruded to a thickness of 7.12 mm."}, {"role": "assistant", "content": "```python\n#!/usr/bin/env python3\n# -*- coding: utf-8 -*-\n# Ground-truth 2D engineering drawing for part: 0058_00586271\n# Self-contained: reproduces the three-view DXF via ezdxf, NO FreeCAD needed.\n# Coordinates are A4 page millimetres (scale=0.7580118168390879, page=[297.0, 210.0]).\n# visible edges -> solid (layer OUTLINE); hidden edges -> dashed (layer HIDDEN)\n# dimensions -> real movable DIMENSION entities (text = true mm value)\n# Run: python 0058_00586271_gt.py [out.dxf]\nimport sys\nimport ezdxf\nimport math\n\nSCALE = 0.7580118168390879\nPAGE = [297.0, 210.0]\n\nVISIBLE_SEGMENTS = [\n (125.285947, 163.000713, 125.285947, 87.199531),\n (134.654633, 87.199531, 134.654633, 163.000713),\n (134.654633, 163.000713, 141.468222, 163.000713),\n (141.468222, 173.221097, 118.472358, 173.221097),\n (118.472358, 163.000713, 125.285947, 163.000713),\n (146.578414, 68.515188, 146.41872, 68.515188),\n (146.41872, 68.515188, 146.259027, 68.515188),\n (146.259027, 68.515188, 146.099333, 68.515188),\n (146.099333, 68.515188, 145.93964, 68.515188),\n (145.93964, 68.515188, 145.779946, 68.515188),\n (145.779946, 68.515188, 145.620253, 68.515188),\n (145.620253, 68.515188, 145.460559, 68.515188),\n (145.460559, 68.515188, 145.300866, 68.515188),\n (145.300866, 68.515188, 145.141172, 68.515188),\n (145.141172, 68.515188, 144.981479, 68.515188),\n (144.981479, 68.515188, 144.821785, 68.515188),\n (144.821785, 68.515188, 144.662092, 68.515188),\n (144.662092, 68.515188, 144.502398, 68.515188),\n (144.502398, 68.515188, 144.342705, 68.515188),\n (144.342705, 68.515188, 144.183011, 68.515188),\n (144.183011, 68.515188, 144.023318, 68.515188),\n (144.023318, 68.515188, 143.863624, 68.515188),\n (143.863624, 68.515188, 143.703931, 68.515188),\n (143.703931, 68.515188, 143.544237, 68.515188),\n (143.544237, 68.515188, 143.384544, 68.515188),\n (143.384544, 68.515188, 143.22485, 68.515188),\n (143.22485, 68.515188, 143.065157, 68.515188),\n (143.065157, 68.515188, 142.905463, 68.515188),\n (142.905463, 68.515188, 142.74577, 68.515188),\n (142.74577, 68.515188, 142.586076, 68.515188),\n (142.586076, 68.515188, 142.426383, 68.515188),\n (142.426383, 68.515188, 142.266689, 68.515188),\n (142.266689, 68.515188, 142.106996, 68.515188),\n (142.106996, 68.515188, 141.947302, 68.515188),\n (141.947302, 68.515188, 141.787609, 68.515188),\n (141.787609, 68.515188, 141.627915, 68.515188),\n (141.627915, 68.515188, 141.468222, 68.515188),\n (146.578414, 63.121097, 146.41872, 63.121097),\n (146.41872, 63.121097, 146.259027, 63.121097),\n (146.259027, 63.121097, 146.099333, 63.121097),\n (146.099333, 63.121097, 145.93964, 63.121097),\n (145.93964, 63.121097, 145.779946, 63.121097),\n (145.779946, 63.121097, 145.620253, 63.121097),\n (145.620253, 63.121097, 145.460559, 63.121097),\n (145.460559, 63.121097, 145.300866, 63.121097),\n (145.300866, 63.121097, 145.141172, 63.121097),\n (145.141172, 63.121097, 144.981479, 63.121097),\n (144.981479, 63.121097, 144.821785, 63.121097),\n (144.821785, 63.121097, 144.662092, 63.121097),\n (144.662092, 63.121097, 144.502398, 63.121097),\n (144.502398, 63.121097, 144.342705, 63.121097),\n (144.342705, 63.121097, 144.183011, 63.121097),\n (144.183011, 63.121097, 144.023318, 63.121097),\n (144.023318, 63.121097, 143.863624, 63.121097),\n (143.863624, 63.121097, 143.703931, 63.121097),\n (143.703931, 63.121097, 143.544237, 63.121097),\n (143.544237, 63.121097, 143.384544, 63.121097),\n (143.384544, 63.121097, 143.22485, 63.121097),\n (143.22485, 63.121097, 143.065157, 63.121097),\n (143.065157, 63.121097, 142.905463, 63.121097),\n (142.905463, 63.121097, 142.74577, 63.121097),\n (142.74577, 63.121097, 142.586076, 63.121097),\n (142.586076, 63.121097, 142.426383, 63.121097),\n (142.426383, 63.121097, 142.266689, 63.121097),\n (142.266689, 63.121097, 142.106996, 63.121097),\n (142.106996, 63.121097, 141.947302, 63.121097),\n (141.947302, 63.121097, 141.787609, 63.121097),\n (141.787609, 63.121097, 141.627915, 63.121097),\n (141.627915, 63.121097, 141.468222, 63.121097),\n (141.468222, 63.121097, 118.472358, 63.121097),\n (118.472358, 68.515188, 118.472358, 63.121097),\n (141.468222, 68.515188, 118.472358, 68.515188),\n (146.578414, 63.121097, 146.578414, 68.515188),\n (141.468222, 68.515188, 141.468222, 63.121097),\n (160.578414, 163.000713, 165.972506, 163.000713),\n (165.972506, 163.000713, 165.972506, 87.199531),\n (160.578414, 163.000713, 160.578414, 87.199531),\n (160.578414, 87.199531, 160.578414, 87.053146),\n (160.578414, 87.053146, 160.578414, 86.90676),\n (160.578414, 86.90676, 160.578414, 86.760374),\n (160.578414, 86.760374, 160.578414, 86.613988),\n (160.578414, 86.613988, 160.578414, 86.467603),\n (160.578414, 86.467603, 160.578414, 86.321217),\n (160.578414, 86.321217, 160.578414, 86.174831),\n (160.578414, 86.174831, 160.578414, 86.028446),\n (160.578414, 86.028446, 160.578414, 85.88206),\n (160.578414, 85.88206, 160.578414, 85.735674),\n (160.578414, 85.735674, 160.578414, 85.589289),\n (160.578414, 85.589289, 160.578414, 85.442903),\n (160.578414, 85.442903, 160.578414, 85.296517),\n (160.578414, 85.296517, 160.578414, 85.150131),\n (160.578414, 85.150131, 160.578414, 85.003746),\n (160.578414, 85.003746, 160.578414, 84.85736),\n (160.578414, 84.85736, 160.578414, 84.710974),\n (160.578414, 84.710974, 160.578414, 84.564589),\n (160.578414, 84.564589, 160.578414, 84.418203),\n (160.578414, 84.418203, 160.578414, 84.271817),\n (160.578414, 84.271817, 160.578414, 84.125431),\n (160.578414, 84.125431, 160.578414, 83.979046),\n (160.578414, 83.979046, 160.578414, 83.83266),\n (160.578414, 83.83266, 160.578414, 83.686274),\n (160.578414, 83.686274, 160.578414, 83.539889),\n (160.578414, 83.539889, 160.578414, 83.393503),\n (160.578414, 83.393503, 160.578414, 83.247117),\n (160.578414, 83.247117, 160.578414, 83.100731),\n (160.578414, 83.100731, 160.578414, 82.954346),\n (160.578414, 82.954346, 160.578414, 82.80796),\n (160.578414, 82.80796, 160.578414, 82.661574),\n (160.578414, 82.661574, 160.578414, 82.515189),\n (165.972506, 87.199531, 165.972506, 87.053146),\n (165.972506, 87.053146, 165.972506, 86.90676),\n (165.972506, 86.90676, 165.972506, 86.760374),\n (165.972506, 86.760374, 165.972506, 86.613988),\n (165.972506, 86.613988, 165.972506, 86.467603),\n (165.972506, 86.467603, 165.972506, 86.321217),\n (165.972506, 86.321217, 165.972506, 86.174831),\n (165.972506, 86.174831, 165.972506, 86.028446),\n (165.972506, 86.028446, 165.972506, 85.88206),\n (165.972506, 85.88206, 165.972506, 85.735674),\n (165.972506, 85.735674, 165.972506, 85.589289),\n (165.972506, 85.589289, 165.972506, 85.442903),\n (165.972506, 85.442903, 165.972506, 85.296517),\n (165.972506, 85.296517, 165.972506, 85.150131),\n (165.972506, 85.150131, 165.972506, 85.003746),\n (165.972506, 85.003746, 165.972506, 84.85736),\n (165.972506, 84.85736, 165.972506, 84.710974),\n (165.972506, 84.710974, 165.972506, 84.564589),\n (165.972506, 84.564589, 165.972506, 84.418203),\n (165.972506, 84.418203, 165.972506, 84.271817),\n (165.972506, 84.271817, 165.972506, 84.125431),\n (165.972506, 84.125431, 165.972506, 83.979046),\n (165.972506, 83.979046, 165.972506, 83.83266),\n (165.972506, 83.83266, 165.972506, 83.686274),\n (165.972506, 83.686274, 165.972506, 83.539889),\n (165.972506, 83.539889, 165.972506, 83.393503),\n (165.972506, 83.393503, 165.972506, 83.247117),\n (165.972506, 83.247117, 165.972506, 83.100731),\n (165.972506, 83.100731, 165.972506, 82.954346),\n (165.972506, 82.954346, 165.972506, 82.80796),\n (165.972506, 82.80796, 165.972506, 82.661574),\n (165.972506, 82.661574, 165.972506, 82.515189),\n (160.578414, 173.221097, 165.972506, 173.221097),\n (165.972506, 173.221097, 165.972506, 172.90171),\n (165.972506, 172.90171, 165.972506, 172.582323),\n (165.972506, 172.582323, 165.972506, 172.262936),\n (165.972506, 172.262936, 165.972506, 171.943549),\n (165.972506, 171.943549, 165.972506, 171.624162),\n (165.972506, 171.624162, 165.972506, 171.304775),\n (165.972506, 171.304775, 165.972506, 170.985388),\n (165.972506, 170.985388, 165.972506, 170.666001),\n (165.972506, 170.666001, 165.972506, 170.346614),\n (165.972506, 170.346614, 165.972506, 170.027227),\n (165.972506, 170.027227, 165.972506, 169.70784),\n (165.972506, 169.70784, 165.972506, 169.388453),\n (165.972506, 169.388453, 165.972506, 169.069066),\n (165.972506, 169.069066, 165.972506, 168.749679),\n (165.972506, 168.749679, 165.972506, 168.430292),\n (165.972506, 168.430292, 165.972506, 168.110905),\n (165.972506, 168.110905, 165.972506, 167.791518),\n (165.972506, 167.791518, 165.972506, 167.472131),\n (165.972506, 167.472131, 165.972506, 167.152744),\n (165.972506, 167.152744, 165.972506, 166.833357),\n (165.972506, 166.833357, 165.972506, 166.51397),\n (165.972506, 166.51397, 165.972506, 166.194583),\n (165.972506, 166.194583, 165.972506, 165.875196),\n (165.972506, 165.875196, 165.972506, 165.555809),\n (165.972506, 165.555809, 165.972506, 165.236422),\n (165.972506, 165.236422, 165.972506, 164.917035),\n (165.972506, 164.917035, 165.972506, 164.597648),\n (165.972506, 164.597648, 165.972506, 164.278261),\n (165.972506, 164.278261, 165.972506, 163.958874),\n (165.972506, 163.958874, 165.972506, 163.639487),\n (165.972506, 163.639487, 165.972506, 163.3201),\n (165.972506, 163.3201, 165.972506, 163.000713),\n (160.578414, 173.221097, 160.578414, 172.90171),\n (160.578414, 172.90171, 160.578414, 172.582323),\n (160.578414, 172.582323, 160.578414, 172.262936),\n (160.578414, 172.262936, 160.578414, 171.943549),\n (160.578414, 171.943549, 160.578414, 171.624162),\n (160.578414, 171.624162, 160.578414, 171.304775),\n (160.578414, 171.304775, 160.578414, 170.985388),\n (160.578414, 170.985388, 160.578414, 170.666001),\n (160.578414, 170.666001, 160.578414, 170.346614),\n (160.578414, 170.346614, 160.578414, 170.027227),\n (160.578414, 170.027227, 160.578414, 169.70784),\n (160.578414, 169.70784, 160.578414, 169.388453),\n (160.578414, 169.388453, 160.578414, 169.069066),\n (160.578414, 169.069066, 160.578414, 168.749679),\n (160.578414, 168.749679, 160.578414, 168.430292),\n (160.578414, 168.430292, 160.578414, 168.110905),\n (160.578414, 168.110905, 160.578414, 167.791518),\n (160.578414, 167.791518, 160.578414, 167.472131),\n (160.578414, 167.472131, 160.578414, 167.152744),\n (160.578414, 167.152744, 160.578414, 166.833357),\n (160.578414, 166.833357, 160.578414, 166.51397),\n (160.578414, 166.51397, 160.578414, 166.194583),\n (160.578414, 166.194583, 160.578414, 165.875196),\n (160.578414, 165.875196, 160.578414, 165.555809),\n (160.578414, 165.555809, 160.578414, 165.236422),\n (160.578414, 165.236422, 160.578414, 164.917035),\n (160.578414, 164.917035, 160.578414, 164.597648),\n (160.578414, 164.597648, 160.578414, 164.278261),\n (160.578414, 164.278261, 160.578414, 163.958874),\n (160.578414, 163.958874, 160.578414, 163.639487),\n (160.578414, 163.639487, 160.578414, 163.3201),\n (160.578414, 163.3201, 160.578414, 163.000713),\n (165.972506, 82.515189, 160.578414, 82.515189),\n (160.578414, 87.199531, 165.972506, 87.199531)\n]\nVISIBLE_CIRCLES = [\n\n]\nVISIBLE_ARCS = [\n (129.97029, 87.199531, 4.684343, -180.0, 0.0),\n (141.468222, 168.110905, 5.110192, -90.0, 90.0),\n (118.472358, 168.110905, 5.110192, -90.0, 90.0)\n]\nHIDDEN_SEGMENTS = [\n (125.286, 68.5152, 125.286, 63.1211),\n (134.6547, 68.5152, 134.6547, 63.1211),\n (123.5826, 63.1211, 123.5826, 68.5152)\n]\n# (orient, text, p1, p2, base) for linear; (orient, text, center, radius, angle) for diameter\nDIMENSIONS = [\n ('horizontal', '8.9888', (134.6547, 163.0007), (141.4682, 163.0007), (138.0614, 174.0007)),\n ('horizontal', '12.3596', (125.2859, 87.1996), (134.6547, 87.1996), (129.9703, 98.1996)),\n ('horizontal', '30.3371', (141.4682, 173.2211), (118.4724, 173.2211), (129.9703, 162.2211)),\n ('vertical', '13.4831', (141.4682, 163.0007), (141.4682, 173.2211), (130.4682, 168.1109)),\n ('vertical', '100', (125.2859, 163.0007), (125.2859, 87.1996), (136.2859, 125.1001)),\n ('radius', 'R6.1798', (129.9703, 87.1996), 4.6844, 45),\n ('radius', 'R6.7416', (141.4682, 168.1109), 5.1102, 45),\n ('horizontal', '7.1161', (160.5784, 163.0007), (165.9725, 163.0007), (163.2755, 174.0007))\n]\n\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; _ds.dxf.dimasz = 2.5\n _ds.dxf.dimexe = 1.25; _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\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\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,\n angle=(0 if d[0] == \"horizontal\" else 90),\n 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,\n 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,\n 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,\n text=text, dimstyle=\"EZDXF\").render()\n\n doc.saveas(out_path)\n\n\nif __name__ == \"__main__\":\n out = sys.argv[1] if len(sys.argv) > 1 else \"0058_00586271_gt.dxf\"\n draw(out)\n print(\"wrote\", out)\n```"}], "images": ["images/0058_00586271.png"], "id": "0058_00586271"} {"messages": [{"role": "user", "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 5 circular holes, each of diameter 9.71 mm. It is extruded to a thickness of 4.19 mm. The outline includes one or more oblique (angled) edges."}, {"role": "assistant", "content": "```python\n#!/usr/bin/env python3\n# -*- coding: utf-8 -*-\n# Ground-truth 2D engineering drawing for part: 0058_00586667\n# Self-contained: reproduces the three-view DXF via ezdxf, NO FreeCAD needed.\n# Coordinates are A4 page millimetres (scale=0.43697614517727756, page=[297.0, 210.0]).\n# visible edges -> solid (layer OUTLINE); hidden edges -> dashed (layer HIDDEN)\n# dimensions -> real movable DIMENSION entities (text = true mm value)\n# Run: python 0058_00586667_gt.py [out.dxf]\nimport sys\nimport ezdxf\nimport math\n\nSCALE = 0.43697614517727756\nPAGE = [297.0, 210.0]\n\nVISIBLE_SEGMENTS = [\n (121.631864, 173.605669, 153.45464, 172.54491),\n (153.45464, 161.406939, 134.891354, 160.876559),\n (129.587558, 154.512004, 132.769836, 123.219607),\n (132.769836, 120.567709, 128.526799, 85.562656),\n (114.73693, 86.093035, 110.493893, 120.567709),\n (110.493893, 123.219607, 114.73693, 166.710735),\n (114.736417, 63.506182, 114.951899, 63.506182),\n (114.951899, 63.506182, 115.167382, 63.506182),\n (115.167382, 63.506182, 115.382865, 63.506182),\n (115.382865, 63.506182, 115.598348, 63.506182),\n (115.598348, 63.506182, 115.81383, 63.506182),\n (115.81383, 63.506182, 116.029313, 63.506182),\n (116.029313, 63.506182, 116.244796, 63.506182),\n (116.244796, 63.506182, 116.460279, 63.506182),\n (116.460279, 63.506182, 116.675761, 63.506182),\n (116.675761, 63.506182, 116.891244, 63.506182),\n (116.891244, 63.506182, 117.106727, 63.506182),\n (117.106727, 63.506182, 117.32221, 63.506182),\n (117.32221, 63.506182, 117.537692, 63.506182),\n (117.537692, 63.506182, 117.753175, 63.506182),\n (117.753175, 63.506182, 117.968658, 63.506182),\n (117.968658, 63.506182, 118.184141, 63.506182),\n (118.184141, 63.506182, 118.399623, 63.506182),\n (118.399623, 63.506182, 118.615106, 63.506182),\n (118.615106, 63.506182, 118.830589, 63.506182),\n (118.830589, 63.506182, 119.046071, 63.506182),\n (119.046071, 63.506182, 119.261554, 63.506182),\n (119.261554, 63.506182, 119.477037, 63.506182),\n (119.477037, 63.506182, 119.69252, 63.506182),\n (119.69252, 63.506182, 119.908002, 63.506182),\n (119.908002, 63.506182, 120.123485, 63.506182),\n (120.123485, 63.506182, 120.338968, 63.506182),\n (120.338968, 63.506182, 120.554451, 63.506182),\n (120.554451, 63.506182, 120.769933, 63.506182),\n (120.769933, 63.506182, 120.985416, 63.506182),\n (120.985416, 63.506182, 121.200899, 63.506182),\n (121.200899, 63.506182, 121.416382, 63.506182),\n (121.416382, 63.506182, 121.631864, 63.506182),\n (121.631864, 63.506182, 121.631864, 65.338403),\n (114.736417, 65.338403, 114.951899, 65.338403),\n (114.951899, 65.338403, 115.167382, 65.338403),\n (115.167382, 65.338403, 115.382865, 65.338403),\n (115.382865, 65.338403, 115.598348, 65.338403),\n (115.598348, 65.338403, 115.81383, 65.338403),\n (115.81383, 65.338403, 116.029313, 65.338403),\n (116.029313, 65.338403, 116.244796, 65.338403),\n (116.244796, 65.338403, 116.460279, 65.338403),\n (116.460279, 65.338403, 116.675761, 65.338403),\n (116.675761, 65.338403, 116.891244, 65.338403),\n (116.891244, 65.338403, 117.106727, 65.338403),\n (117.106727, 65.338403, 117.32221, 65.338403),\n (117.32221, 65.338403, 117.537692, 65.338403),\n (117.537692, 65.338403, 117.753175, 65.338403),\n (117.753175, 65.338403, 117.968658, 65.338403),\n (117.968658, 65.338403, 118.184141, 65.338403),\n (118.184141, 65.338403, 118.399623, 65.338403),\n (118.399623, 65.338403, 118.615106, 65.338403),\n (118.615106, 65.338403, 118.830589, 65.338403),\n (118.830589, 65.338403, 119.046071, 65.338403),\n (119.046071, 65.338403, 119.261554, 65.338403),\n (119.261554, 65.338403, 119.477037, 65.338403),\n (119.477037, 65.338403, 119.69252, 65.338403),\n (119.69252, 65.338403, 119.908002, 65.338403),\n (119.908002, 65.338403, 120.123485, 65.338403),\n (120.123485, 65.338403, 120.338968, 65.338403),\n (120.338968, 65.338403, 120.554451, 65.338403),\n (120.554451, 65.338403, 120.769933, 65.338403),\n (120.769933, 65.338403, 120.985416, 65.338403),\n (120.985416, 65.338403, 121.200899, 65.338403),\n (121.200899, 65.338403, 121.416382, 65.338403),\n (121.416382, 65.338403, 121.631864, 65.338403),\n (121.631864, 65.338403, 153.45464, 65.338403),\n (121.631864, 63.506182, 153.45464, 63.506182),\n (153.45464, 65.338403, 153.622379, 65.338403),\n (153.622379, 65.338403, 153.790118, 65.338403),\n (153.790118, 65.338403, 153.957857, 65.338403),\n (153.957857, 65.338403, 154.125596, 65.338403),\n (154.125596, 65.338403, 154.293335, 65.338403),\n (154.293335, 65.338403, 154.461074, 65.338403),\n (154.461074, 65.338403, 154.628813, 65.338403),\n (154.628813, 65.338403, 154.796551, 65.338403),\n (154.796551, 65.338403, 154.96429, 65.338403),\n (154.96429, 65.338403, 155.132029, 65.338403),\n (155.132029, 65.338403, 155.299768, 65.338403),\n (155.299768, 65.338403, 155.467507, 65.338403),\n (155.467507, 65.338403, 155.635246, 65.338403),\n (155.635246, 65.338403, 155.802985, 65.338403),\n (155.802985, 65.338403, 155.970724, 65.338403),\n (155.970724, 65.338403, 156.138463, 65.338403),\n (156.138463, 65.338403, 156.306201, 65.338403),\n (156.306201, 65.338403, 156.47394, 65.338403),\n (156.47394, 65.338403, 156.641679, 65.338403),\n (156.641679, 65.338403, 156.809418, 65.338403),\n (156.809418, 65.338403, 156.977157, 65.338403),\n (156.977157, 65.338403, 157.144896, 65.338403),\n (157.144896, 65.338403, 157.312635, 65.338403),\n (157.312635, 65.338403, 157.480374, 65.338403),\n (157.480374, 65.338403, 157.648112, 65.338403),\n (157.648112, 65.338403, 157.815851, 65.338403),\n (157.815851, 65.338403, 157.98359, 65.338403),\n (157.98359, 65.338403, 158.151329, 65.338403),\n (158.151329, 65.338403, 158.319068, 65.338403),\n (158.319068, 65.338403, 158.486807, 65.338403),\n (158.486807, 65.338403, 158.654546, 65.338403),\n (158.654546, 65.338403, 158.822285, 65.338403),\n (110.493893, 63.506182, 110.493893, 65.338403),\n (110.493893, 65.338403, 114.736417, 65.338403),\n (110.493893, 63.506182, 114.736417, 63.506182),\n (114.736417, 65.338403, 114.736417, 63.506182),\n (158.822285, 65.338403, 158.822285, 63.506182),\n (110.420595, 65.338403, 110.420595, 63.506182),\n (153.45464, 63.506182, 153.45464, 65.338403),\n (174.654505, 166.710735, 174.654505, 166.926217),\n (174.654505, 166.926217, 174.654505, 167.1417),\n (174.654505, 167.1417, 174.654505, 167.357183),\n (174.654505, 167.357183, 174.654505, 167.572666),\n (174.654505, 167.572666, 174.654505, 167.788148),\n (174.654505, 167.788148, 174.654505, 168.003631),\n (174.654505, 168.003631, 174.654505, 168.219114),\n (174.654505, 168.219114, 174.654505, 168.434596),\n (174.654505, 168.434596, 174.654505, 168.650079),\n (174.654505, 168.650079, 174.654505, 168.865562),\n (174.654505, 168.865562, 174.654505, 169.081045),\n (174.654505, 169.081045, 174.654505, 169.296527),\n (174.654505, 169.296527, 174.654505, 169.51201),\n (174.654505, 169.51201, 174.654505, 169.727493),\n (174.654505, 169.727493, 174.654505, 169.942976),\n (174.654505, 169.942976, 174.654505, 170.158458),\n (174.654505, 170.158458, 174.654505, 170.373941),\n (174.654505, 170.373941, 174.654505, 170.589424),\n (174.654505, 170.589424, 174.654505, 170.804907),\n (174.654505, 170.804907, 174.654505, 171.020389),\n (174.654505, 171.020389, 174.654505, 171.235872),\n (174.654505, 171.235872, 174.654505, 171.451355),\n (174.654505, 171.451355, 174.654505, 171.666838),\n (174.654505, 171.666838, 174.654505, 171.88232),\n (174.654505, 171.88232, 174.654505, 172.097803),\n (174.654505, 172.097803, 174.654505, 172.313286),\n (174.654505, 172.313286, 174.654505, 172.528769),\n (174.654505, 172.528769, 174.654505, 172.744251),\n (174.654505, 172.744251, 174.654505, 172.959734),\n (174.654505, 172.959734, 174.654505, 173.175217),\n (174.654505, 173.175217, 174.654505, 173.3907),\n (174.654505, 173.3907, 174.654505, 173.606182),\n (172.822285, 166.710735, 172.822285, 166.926217),\n (172.822285, 166.926217, 172.822285, 167.1417),\n (172.822285, 167.1417, 172.822285, 167.357183),\n (172.822285, 167.357183, 172.822285, 167.572666),\n (172.822285, 167.572666, 172.822285, 167.788148),\n (172.822285, 167.788148, 172.822285, 168.003631),\n (172.822285, 168.003631, 172.822285, 168.219114),\n (172.822285, 168.219114, 172.822285, 168.434596),\n (172.822285, 168.434596, 172.822285, 168.650079),\n (172.822285, 168.650079, 172.822285, 168.865562),\n (172.822285, 168.865562, 172.822285, 169.081045),\n (172.822285, 169.081045, 172.822285, 169.296527),\n (172.822285, 169.296527, 172.822285, 169.51201),\n (172.822285, 169.51201, 172.822285, 169.727493),\n (172.822285, 169.727493, 172.822285, 169.942976),\n (172.822285, 169.942976, 172.822285, 170.158458),\n (172.822285, 170.158458, 172.822285, 170.373941),\n (172.822285, 170.373941, 172.822285, 170.589424),\n (172.822285, 170.589424, 172.822285, 170.804907),\n (172.822285, 170.804907, 172.822285, 171.020389),\n (172.822285, 171.020389, 172.822285, 171.235872),\n (172.822285, 171.235872, 172.822285, 171.451355),\n (172.822285, 171.451355, 172.822285, 171.666838),\n (172.822285, 171.666838, 172.822285, 171.88232),\n (172.822285, 171.88232, 172.822285, 172.097803),\n (172.822285, 172.097803, 172.822285, 172.313286),\n (172.822285, 172.313286, 172.822285, 172.528769),\n (172.822285, 172.528769, 172.822285, 172.744251),\n (172.822285, 172.744251, 172.822285, 172.959734),\n (172.822285, 172.959734, 172.822285, 173.175217),\n (172.822285, 173.175217, 172.822285, 173.3907),\n (172.822285, 173.3907, 172.822285, 173.606182),\n (174.654505, 166.710735, 172.822285, 166.710735),\n (174.654505, 79.338403, 174.654505, 79.549485),\n (174.654505, 79.549485, 174.654505, 79.760567),\n (174.654505, 79.760567, 174.654505, 79.97165),\n (174.654505, 79.97165, 174.654505, 80.182732),\n (174.654505, 80.182732, 174.654505, 80.393814),\n (174.654505, 80.393814, 174.654505, 80.604896),\n (174.654505, 80.604896, 174.654505, 80.815979),\n (174.654505, 80.815979, 174.654505, 81.027061),\n (174.654505, 81.027061, 174.654505, 81.238143),\n (174.654505, 81.238143, 174.654505, 81.449225),\n (174.654505, 81.449225, 174.654505, 81.660308),\n (174.654505, 81.660308, 174.654505, 81.87139),\n (174.654505, 81.87139, 174.654505, 82.082472),\n (174.654505, 82.082472, 174.654505, 82.293554),\n (174.654505, 82.293554, 174.654505, 82.504637),\n (174.654505, 82.504637, 174.654505, 82.715719),\n (174.654505, 82.715719, 174.654505, 82.926801),\n (174.654505, 82.926801, 174.654505, 83.137883),\n (174.654505, 83.137883, 174.654505, 83.348966),\n (174.654505, 83.348966, 174.654505, 83.560048),\n (174.654505, 83.560048, 174.654505, 83.77113),\n (174.654505, 83.77113, 174.654505, 83.982213),\n (174.654505, 83.982213, 174.654505, 84.193295),\n (174.654505, 84.193295, 174.654505, 84.404377),\n (174.654505, 84.404377, 174.654505, 84.615459),\n (174.654505, 84.615459, 174.654505, 84.826542),\n (174.654505, 84.826542, 174.654505, 85.037624),\n (174.654505, 85.037624, 174.654505, 85.248706),\n (174.654505, 85.248706, 174.654505, 85.459788),\n (174.654505, 85.459788, 174.654505, 85.670871),\n (174.654505, 85.670871, 174.654505, 85.881953),\n (174.654505, 85.881953, 174.654505, 86.093035),\n (174.654505, 86.093035, 172.822285, 86.093035),\n (172.822285, 86.093035, 172.822285, 120.567709),\n (174.654505, 120.567709, 172.822285, 120.567709),\n (174.654505, 86.093035, 174.654505, 120.567709),\n (174.654505, 120.567709, 174.654505, 120.650581),\n (174.654505, 120.650581, 174.654505, 120.733453),\n (174.654505, 120.733453, 174.654505, 120.816325),\n (174.654505, 120.816325, 174.654505, 120.899197),\n (174.654505, 120.899197, 174.654505, 120.982068),\n (174.654505, 120.982068, 174.654505, 121.06494),\n (174.654505, 121.06494, 174.654505, 121.147812),\n (174.654505, 121.147812, 174.654505, 121.230684),\n (174.654505, 121.230684, 174.654505, 121.313556),\n (174.654505, 121.313556, 174.654505, 121.396427),\n (174.654505, 121.396427, 174.654505, 121.479299),\n (174.654505, 121.479299, 174.654505, 121.562171),\n (174.654505, 121.562171, 174.654505, 121.645043),\n (174.654505, 121.645043, 174.654505, 121.727915),\n (174.654505, 121.727915, 174.654505, 121.810786),\n (174.654505, 121.810786, 174.654505, 121.893658),\n (174.654505, 121.893658, 174.654505, 121.97653),\n (174.654505, 121.97653, 174.654505, 122.059402),\n (174.654505, 122.059402, 174.654505, 122.142274),\n (174.654505, 122.142274, 174.654505, 122.225146),\n (174.654505, 122.225146, 174.654505, 122.308017),\n (174.654505, 122.308017, 174.654505, 122.390889),\n (174.654505, 122.390889, 174.654505, 122.473761),\n (174.654505, 122.473761, 174.654505, 122.556633),\n (174.654505, 122.556633, 174.654505, 122.639505),\n (174.654505, 122.639505, 174.654505, 122.722376),\n (174.654505, 122.722376, 174.654505, 122.805248),\n (174.654505, 122.805248, 174.654505, 122.88812),\n (174.654505, 122.88812, 174.654505, 122.970992),\n (174.654505, 122.970992, 174.654505, 123.053864),\n (174.654505, 123.053864, 174.654505, 123.136735),\n (174.654505, 123.136735, 174.654505, 123.219607),\n (174.654505, 123.219607, 172.822285, 123.219607),\n (172.822285, 120.567709, 172.822285, 120.650581),\n (172.822285, 120.650581, 172.822285, 120.733453),\n (172.822285, 120.733453, 172.822285, 120.816325),\n (172.822285, 120.816325, 172.822285, 120.899197),\n (172.822285, 120.899197, 172.822285, 120.982068),\n (172.822285, 120.982068, 172.822285, 121.06494),\n (172.822285, 121.06494, 172.822285, 121.147812),\n (172.822285, 121.147812, 172.822285, 121.230684),\n (172.822285, 121.230684, 172.822285, 121.313556),\n (172.822285, 121.313556, 172.822285, 121.396427),\n (172.822285, 121.396427, 172.822285, 121.479299),\n (172.822285, 121.479299, 172.822285, 121.562171),\n (172.822285, 121.562171, 172.822285, 121.645043),\n (172.822285, 121.645043, 172.822285, 121.727915),\n (172.822285, 121.727915, 172.822285, 121.810786),\n (172.822285, 121.810786, 172.822285, 121.893658),\n (172.822285, 121.893658, 172.822285, 121.97653),\n (172.822285, 121.97653, 172.822285, 122.059402),\n (172.822285, 122.059402, 172.822285, 122.142274),\n (172.822285, 122.142274, 172.822285, 122.225146),\n (172.822285, 122.225146, 172.822285, 122.308017),\n (172.822285, 122.308017, 172.822285, 122.390889),\n (172.822285, 122.390889, 172.822285, 122.473761),\n (172.822285, 122.473761, 172.822285, 122.556633),\n (172.822285, 122.556633, 172.822285, 122.639505),\n (172.822285, 122.639505, 172.822285, 122.722376),\n (172.822285, 122.722376, 172.822285, 122.805248),\n (172.822285, 122.805248, 172.822285, 122.88812),\n (172.822285, 122.88812, 172.822285, 122.970992),\n (172.822285, 122.970992, 172.822285, 123.053864),\n (172.822285, 123.053864, 172.822285, 123.136735),\n (172.822285, 123.136735, 172.822285, 123.219607),\n (172.822285, 123.219607, 172.822285, 166.710735),\n (174.654505, 123.219607, 174.654505, 166.710735),\n (172.822285, 173.606182, 174.654505, 173.606182),\n (172.822285, 79.338403, 174.654505, 79.338403)\n]\nVISIBLE_CIRCLES = [\n (119.510346, 96.170248, 2.121518),\n (121.631864, 166.710735, 2.121518),\n (121.631864, 122.158848, 2.121518),\n (121.631864, 86.093035, 2.121518),\n (152.924261, 166.710735, 2.121518)\n]\nVISIBLE_ARCS = [\n (121.548272, 166.794327, 6.811856, 89.296875, -179.296875),\n (153.249523, 166.975924, 5.572762, -87.890625, 87.890625),\n (135.195641, 155.230794, 5.653959, 93.085054, -172.696196),\n (120.813353, 121.893658, 12.029781, -6.328125, 6.328125),\n (121.648157, 86.251445, 6.913042, -178.686973, -5.718223),\n (122.450376, 121.893658, 12.029781, 173.671875, -173.671875),\n (120.478117, -2002.897562, 2066.714083, 88.936942, 89.085728),\n (139.245448, 201.158365, 140.630316, -101.827043, -101.797813),\n (117.861712, 192.793973, 127.670472, -93.341252, -93.308413),\n (5899.779211, 113.411068, 5727.026431, -179.726697, -179.659121)\n]\nHIDDEN_SEGMENTS = [\n (134.8914, 63.5062, 134.8914, 65.3384),\n (129.5876, 63.5062, 129.5876, 65.3384),\n (132.7698, 63.5062, 132.7698, 65.3384),\n (128.5268, 63.5062, 128.5268, 65.3384),\n (123.7534, 63.5062, 123.7534, 65.3384),\n (155.0458, 63.5062, 155.0458, 65.3384),\n (129.5417, 65.3384, 129.5417, 63.5062),\n (132.8431, 65.3384, 132.8431, 63.5062),\n (117.3888, 65.3384, 117.3888, 63.5062),\n (119.5103, 65.3384, 119.5103, 63.5062),\n (150.8027, 65.3384, 150.8027, 63.5062),\n (174.6545, 160.8766, 172.8223, 160.8766),\n (174.6545, 154.512, 172.8223, 154.512),\n (174.6545, 85.5627, 172.8223, 85.5627),\n (172.8223, 94.0487, 174.6545, 94.0487),\n (172.8223, 98.2918, 174.6545, 98.2918),\n (172.8223, 164.5892, 174.6545, 164.5892),\n (172.8223, 168.8323, 174.6545, 168.8323),\n (172.8223, 120.0373, 174.6545, 120.0373),\n (172.8223, 124.2804, 174.6545, 124.2804),\n (172.8223, 83.9715, 174.6545, 83.9715),\n (172.8223, 88.2146, 174.6545, 88.2146)\n]\n# (orient, text, p1, p2, base) for linear; (orient, text, center, radius, angle) for diameter\nDIMENSIONS = [\n ('vertical', '6.0687', (132.7699, 123.2196), (132.7699, 120.5677), (143.7699, 121.8937)),\n ('vertical', '25.4887', (153.4546, 172.5449), (153.4546, 161.4069), (164.4546, 166.9759)),\n ('aligned', '72.8654', (121.6319, 173.6057), (153.4546, 172.5449), (137.9097, 184.0692)),\n ('aligned', '42.4986', (153.4546, 161.4069), (134.8914, 160.8765), (144.4872, 150.1462)),\n ('aligned', '71.9806', (129.5876, 154.512), (132.7699, 123.2196), (142.1223, 139.9787)),\n ('aligned', '80.6938', (132.7699, 120.5677), (128.5268, 85.5627), (141.5684, 101.7415)),\n ('aligned', '79.489', (114.7369, 86.0931), (110.4939, 120.5677), (101.6978, 101.9867)),\n ('aligned', '100', (110.4939, 123.2196), (114.7369, 166.7107), (101.6674, 146.0333)),\n ('diameter', '%%c9.71', (119.5103, 96.1703), 2.1215, 45),\n ('horizontal', '20.6337', (110.4939, 96.1703), (119.5103, 96.1703), (115.0021, 107.1703)),\n ('vertical', '177.207', (119.5103, 173.6057), (119.5103, 96.1703), (130.5103, 134.888)),\n ('diameter', '%%c9.71', (121.6319, 166.7107), 2.1215, 45),\n ('horizontal', '25.4887', (110.4939, 166.7107), (121.6319, 166.7107), (116.0629, 177.7107)),\n ('vertical', '15.7787', (121.6319, 173.6057), (121.6319, 166.7107), (132.6319, 170.1582)),\n ('diameter', '%%c9.71', (121.6319, 122.1588), 2.1215, 45),\n ('horizontal', '25.4887', (110.4939, 122.1588), (121.6319, 122.1588), (116.0629, 133.1588)),\n ('vertical', '117.734', (121.6319, 173.6057), (121.6319, 122.1588), (132.6319, 147.8823)),\n ('diameter', '%%c9.71', (121.6319, 86.0931), 2.1215, 45),\n ('horizontal', '25.4887', (110.4939, 86.0931), (121.6319, 86.0931), (116.0629, 97.0931)),\n ('vertical', '200.269', (121.6319, 173.6057), (121.6319, 86.0931), (132.6319, 129.8494)),\n ('diameter', '%%c9.71', (152.9242, 166.7107), 2.1215, 45),\n ('horizontal', '97.1', (110.4939, 166.7107), (152.9242, 166.7107), (131.7091, 177.7107)),\n ('vertical', '15.7787', (152.9242, 173.6057), (152.9242, 166.7107), (163.9242, 170.1582)),\n ('radius', 'R15.5886', (121.5483, 166.7943), 6.8118, 135),\n ('radius', 'R12.753', (153.2495, 166.9759), 5.5728, 45),\n ('radius', 'R12.9388', (135.1956, 155.2308), 5.6539, 45),\n ('radius', 'R27.5296', (120.8134, 121.8937), 12.0298, 45),\n ('radius', 'R15.8202', (121.6482, 86.2515), 6.9131, 135),\n ('horizontal', '4.193', (174.6545, 166.7107), (172.8223, 166.7107), (173.7384, 155.7107))\n]\n\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; _ds.dxf.dimasz = 2.5\n _ds.dxf.dimexe = 1.25; _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\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\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,\n angle=(0 if d[0] == \"horizontal\" else 90),\n 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,\n 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,\n 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,\n text=text, dimstyle=\"EZDXF\").render()\n\n doc.saveas(out_path)\n\n\nif __name__ == \"__main__\":\n out = sys.argv[1] if len(sys.argv) > 1 else \"0058_00586667_gt.dxf\"\n draw(out)\n print(\"wrote\", out)\n```"}], "images": ["images/0058_00586667.png"], "id": "0058_00586667"} {"messages": [{"role": "user", "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 214.59 mm. The outline includes one or more oblique (angled) edges."}, {"role": "assistant", "content": "```python\n#!/usr/bin/env python3\n# -*- coding: utf-8 -*-\n# Ground-truth 2D engineering drawing for part: 0059_00592914\n# Self-contained: reproduces the three-view DXF via ezdxf, NO FreeCAD needed.\n# Coordinates are A4 page millimetres (scale=0.3411677200891928, page=[297.0, 210.0]).\n# visible edges -> solid (layer OUTLINE); hidden edges -> dashed (layer HIDDEN)\n# dimensions -> real movable DIMENSION entities (text = true mm value)\n# Run: python 0059_00592914_gt.py [out.dxf]\nimport sys\nimport ezdxf\nimport math\n\nSCALE = 0.3411677200891928\nPAGE = [297.0, 210.0]\n\nVISIBLE_SEGMENTS = [\n (82.836324, 172.034858, 116.953096, 172.034858),\n (118.959965, 170.027989, 118.959965, 150.762047),\n (116.953096, 149.156552, 82.836324, 149.156552),\n (80.829455, 150.762047, 80.829455, 170.027989),\n (80.829455, 61.934858, 80.89217, 61.934858),\n (80.89217, 61.934858, 80.954885, 61.934858),\n (80.954885, 61.934858, 81.017599, 61.934858),\n (81.017599, 61.934858, 81.080314, 61.934858),\n (81.080314, 61.934858, 81.143029, 61.934858),\n (81.143029, 61.934858, 81.205743, 61.934858),\n (81.205743, 61.934858, 81.268458, 61.934858),\n (81.268458, 61.934858, 81.331173, 61.934858),\n (81.331173, 61.934858, 81.393887, 61.934858),\n (81.393887, 61.934858, 81.456602, 61.934858),\n (81.456602, 61.934858, 81.519317, 61.934858),\n (81.519317, 61.934858, 81.582031, 61.934858),\n (81.582031, 61.934858, 81.644746, 61.934858),\n (81.644746, 61.934858, 81.70746, 61.934858),\n (81.70746, 61.934858, 81.770175, 61.934858),\n (81.770175, 61.934858, 81.83289, 61.934858),\n (81.83289, 61.934858, 81.895604, 61.934858),\n (81.895604, 61.934858, 81.958319, 61.934858),\n (81.958319, 61.934858, 82.021034, 61.934858),\n (82.021034, 61.934858, 82.083748, 61.934858),\n (82.083748, 61.934858, 82.146463, 61.934858),\n (82.146463, 61.934858, 82.209178, 61.934858),\n (82.209178, 61.934858, 82.271892, 61.934858),\n (82.271892, 61.934858, 82.334607, 61.934858),\n (82.334607, 61.934858, 82.397322, 61.934858),\n (82.397322, 61.934858, 82.460036, 61.934858),\n (82.460036, 61.934858, 82.522751, 61.934858),\n (82.522751, 61.934858, 82.585466, 61.934858),\n (82.585466, 61.934858, 82.64818, 61.934858),\n (82.64818, 61.934858, 82.710895, 61.934858),\n (82.710895, 61.934858, 82.77361, 61.934858),\n (82.77361, 61.934858, 82.836324, 61.934858),\n (80.829455, 135.145437, 80.89217, 135.145437),\n (80.89217, 135.145437, 80.954885, 135.145437),\n (80.954885, 135.145437, 81.017599, 135.145437),\n (81.017599, 135.145437, 81.080314, 135.145437),\n (81.080314, 135.145437, 81.143029, 135.145437),\n (81.143029, 135.145437, 81.205743, 135.145437),\n (81.205743, 135.145437, 81.268458, 135.145437),\n (81.268458, 135.145437, 81.331173, 135.145437),\n (81.331173, 135.145437, 81.393887, 135.145437),\n (81.393887, 135.145437, 81.456602, 135.145437),\n (81.456602, 135.145437, 81.519317, 135.145437),\n (81.519317, 135.145437, 81.582031, 135.145437),\n (81.582031, 135.145437, 81.644746, 135.145437),\n (81.644746, 135.145437, 81.70746, 135.145437),\n (81.70746, 135.145437, 81.770175, 135.145437),\n (81.770175, 135.145437, 81.83289, 135.145437),\n (81.83289, 135.145437, 81.895604, 135.145437),\n (81.895604, 135.145437, 81.958319, 135.145437),\n (81.958319, 135.145437, 82.021034, 135.145437),\n (82.021034, 135.145437, 82.083748, 135.145437),\n (82.083748, 135.145437, 82.146463, 135.145437),\n (82.146463, 135.145437, 82.209178, 135.145437),\n (82.209178, 135.145437, 82.271892, 135.145437),\n (82.271892, 135.145437, 82.334607, 135.145437),\n (82.334607, 135.145437, 82.397322, 135.145437),\n (82.397322, 135.145437, 82.460036, 135.145437),\n (82.460036, 135.145437, 82.522751, 135.145437),\n (82.522751, 135.145437, 82.585466, 135.145437),\n (82.585466, 135.145437, 82.64818, 135.145437),\n (82.64818, 135.145437, 82.710895, 135.145437),\n (82.710895, 135.145437, 82.77361, 135.145437),\n (82.77361, 135.145437, 82.836324, 135.145437),\n (80.829455, 61.934858, 80.829455, 135.145437),\n (82.836324, 135.145437, 116.953096, 135.145437),\n (82.836324, 61.934858, 116.953096, 61.934858),\n (116.953096, 61.934858, 117.015811, 61.934858),\n (117.015811, 61.934858, 117.078526, 61.934858),\n (117.078526, 61.934858, 117.14124, 61.934858),\n (117.14124, 61.934858, 117.203955, 61.934858),\n (117.203955, 61.934858, 117.26667, 61.934858),\n (117.26667, 61.934858, 117.329384, 61.934858),\n (117.329384, 61.934858, 117.392099, 61.934858),\n (117.392099, 61.934858, 117.454814, 61.934858),\n (117.454814, 61.934858, 117.517528, 61.934858),\n (117.517528, 61.934858, 117.580243, 61.934858),\n (117.580243, 61.934858, 117.642957, 61.934858),\n (117.642957, 61.934858, 117.705672, 61.934858),\n (117.705672, 61.934858, 117.768387, 61.934858),\n (117.768387, 61.934858, 117.831101, 61.934858),\n (117.831101, 61.934858, 117.893816, 61.934858),\n (117.893816, 61.934858, 117.956531, 61.934858),\n (117.956531, 61.934858, 118.019245, 61.934858),\n (118.019245, 61.934858, 118.08196, 61.934858),\n (118.08196, 61.934858, 118.144675, 61.934858),\n (118.144675, 61.934858, 118.207389, 61.934858),\n (118.207389, 61.934858, 118.270104, 61.934858),\n (118.270104, 61.934858, 118.332819, 61.934858),\n (118.332819, 61.934858, 118.395533, 61.934858),\n (118.395533, 61.934858, 118.458248, 61.934858),\n (118.458248, 61.934858, 118.520963, 61.934858),\n (118.520963, 61.934858, 118.583677, 61.934858),\n (118.583677, 61.934858, 118.646392, 61.934858),\n (118.646392, 61.934858, 118.709107, 61.934858),\n (118.709107, 61.934858, 118.771821, 61.934858),\n (118.771821, 61.934858, 118.834536, 61.934858),\n (118.834536, 61.934858, 118.897251, 61.934858),\n (118.897251, 61.934858, 118.959965, 61.934858),\n (118.959965, 61.934858, 118.959965, 135.145437),\n (116.953096, 135.145437, 117.015811, 135.145437),\n (117.015811, 135.145437, 117.078526, 135.145437),\n (117.078526, 135.145437, 117.14124, 135.145437),\n (117.14124, 135.145437, 117.203955, 135.145437),\n (117.203955, 135.145437, 117.26667, 135.145437),\n (117.26667, 135.145437, 117.329384, 135.145437),\n (117.329384, 135.145437, 117.392099, 135.145437),\n (117.392099, 135.145437, 117.454814, 135.145437),\n (117.454814, 135.145437, 117.517528, 135.145437),\n (117.517528, 135.145437, 117.580243, 135.145437),\n (117.580243, 135.145437, 117.642957, 135.145437),\n (117.642957, 135.145437, 117.705672, 135.145437),\n (117.705672, 135.145437, 117.768387, 135.145437),\n (117.768387, 135.145437, 117.831101, 135.145437),\n (117.831101, 135.145437, 117.893816, 135.145437),\n (117.893816, 135.145437, 117.956531, 135.145437),\n (117.956531, 135.145437, 118.019245, 135.145437),\n (118.019245, 135.145437, 118.08196, 135.145437),\n (118.08196, 135.145437, 118.144675, 135.145437),\n (118.144675, 135.145437, 118.207389, 135.145437),\n (118.207389, 135.145437, 118.270104, 135.145437),\n (118.270104, 135.145437, 118.332819, 135.145437),\n (118.332819, 135.145437, 118.395533, 135.145437),\n (118.395533, 135.145437, 118.458248, 135.145437),\n (118.458248, 135.145437, 118.520963, 135.145437),\n (118.520963, 135.145437, 118.583677, 135.145437),\n (118.583677, 135.145437, 118.646392, 135.145437),\n (118.646392, 135.145437, 118.709107, 135.145437),\n (118.709107, 135.145437, 118.771821, 135.145437),\n (118.771821, 135.145437, 118.834536, 135.145437),\n (118.834536, 135.145437, 118.897251, 135.145437),\n (118.897251, 135.145437, 118.959965, 135.145437),\n (82.836324, 61.934858, 82.836324, 135.145437),\n (116.953096, 61.934858, 116.953096, 135.145437),\n (206.170544, 170.027989, 206.170544, 170.090704),\n (206.170544, 170.090704, 206.170544, 170.153418),\n (206.170544, 170.153418, 206.170544, 170.216133),\n (206.170544, 170.216133, 206.170544, 170.278848),\n (206.170544, 170.278848, 206.170544, 170.341562),\n (206.170544, 170.341562, 206.170544, 170.404277),\n (206.170544, 170.404277, 206.170544, 170.466992),\n (206.170544, 170.466992, 206.170544, 170.529706),\n (206.170544, 170.529706, 206.170544, 170.592421),\n (206.170544, 170.592421, 206.170544, 170.655135),\n (206.170544, 170.655135, 206.170544, 170.71785),\n (206.170544, 170.71785, 206.170544, 170.780565),\n (206.170544, 170.780565, 206.170544, 170.843279),\n (206.170544, 170.843279, 206.170544, 170.905994),\n (206.170544, 170.905994, 206.170544, 170.968709),\n (206.170544, 170.968709, 206.170544, 171.031423),\n (206.170544, 171.031423, 206.170544, 171.094138),\n (206.170544, 171.094138, 206.170544, 171.156853),\n (206.170544, 171.156853, 206.170544, 171.219567),\n (206.170544, 171.219567, 206.170544, 171.282282),\n (206.170544, 171.282282, 206.170544, 171.344997),\n (206.170544, 171.344997, 206.170544, 171.407711),\n (206.170544, 171.407711, 206.170544, 171.470426),\n (206.170544, 171.470426, 206.170544, 171.533141),\n (206.170544, 171.533141, 206.170544, 171.595855),\n (206.170544, 171.595855, 206.170544, 171.65857),\n (206.170544, 171.65857, 206.170544, 171.721285),\n (206.170544, 171.721285, 206.170544, 171.783999),\n (206.170544, 171.783999, 206.170544, 171.846714),\n (206.170544, 171.846714, 206.170544, 171.909429),\n (206.170544, 171.909429, 206.170544, 171.972143),\n (206.170544, 171.972143, 206.170544, 172.034858),\n (206.170544, 172.034858, 132.959965, 172.034858),\n (132.959965, 170.027989, 132.959965, 170.090704),\n (132.959965, 170.090704, 132.959965, 170.153418),\n (132.959965, 170.153418, 132.959965, 170.216133),\n (132.959965, 170.216133, 132.959965, 170.278848),\n (132.959965, 170.278848, 132.959965, 170.341562),\n (132.959965, 170.341562, 132.959965, 170.404277),\n (132.959965, 170.404277, 132.959965, 170.466992),\n (132.959965, 170.466992, 132.959965, 170.529706),\n (132.959965, 170.529706, 132.959965, 170.592421),\n (132.959965, 170.592421, 132.959965, 170.655135),\n (132.959965, 170.655135, 132.959965, 170.71785),\n (132.959965, 170.71785, 132.959965, 170.780565),\n (132.959965, 170.780565, 132.959965, 170.843279),\n (132.959965, 170.843279, 132.959965, 170.905994),\n (132.959965, 170.905994, 132.959965, 170.968709),\n (132.959965, 170.968709, 132.959965, 171.031423),\n (132.959965, 171.031423, 132.959965, 171.094138),\n (132.959965, 171.094138, 132.959965, 171.156853),\n (132.959965, 171.156853, 132.959965, 171.219567),\n (132.959965, 171.219567, 132.959965, 171.282282),\n (132.959965, 171.282282, 132.959965, 171.344997),\n (132.959965, 171.344997, 132.959965, 171.407711),\n (132.959965, 171.407711, 132.959965, 171.470426),\n (132.959965, 171.470426, 132.959965, 171.533141),\n (132.959965, 171.533141, 132.959965, 171.595855),\n (132.959965, 171.595855, 132.959965, 171.65857),\n (132.959965, 171.65857, 132.959965, 171.721285),\n (132.959965, 171.721285, 132.959965, 171.783999),\n (132.959965, 171.783999, 132.959965, 171.846714),\n (132.959965, 171.846714, 132.959965, 171.909429),\n (132.959965, 171.909429, 132.959965, 171.972143),\n (132.959965, 171.972143, 132.959965, 172.034858),\n (206.170544, 149.145437, 206.170544, 149.195956),\n (206.170544, 149.195956, 206.170544, 149.246475),\n (206.170544, 149.246475, 206.170544, 149.296994),\n (206.170544, 149.296994, 206.170544, 149.347513),\n (206.170544, 149.347513, 206.170544, 149.398032),\n (206.170544, 149.398032, 206.170544, 149.448551),\n (206.170544, 149.448551, 206.170544, 149.49907),\n (206.170544, 149.49907, 206.170544, 149.549589),\n (206.170544, 149.549589, 206.170544, 149.600109),\n (206.170544, 149.600109, 206.170544, 149.650628),\n (206.170544, 149.650628, 206.170544, 149.701147),\n (206.170544, 149.701147, 206.170544, 149.751666),\n (206.170544, 149.751666, 206.170544, 149.802185),\n (206.170544, 149.802185, 206.170544, 149.852704),\n (206.170544, 149.852704, 206.170544, 149.903223),\n (206.170544, 149.903223, 206.170544, 149.953742),\n (206.170544, 149.953742, 206.170544, 150.004261),\n (206.170544, 150.004261, 206.170544, 150.05478),\n (206.170544, 150.05478, 206.170544, 150.105299),\n (206.170544, 150.105299, 206.170544, 150.155818),\n (206.170544, 150.155818, 206.170544, 150.206337),\n (206.170544, 150.206337, 206.170544, 150.256856),\n (206.170544, 150.256856, 206.170544, 150.307375),\n (206.170544, 150.307375, 206.170544, 150.357895),\n (206.170544, 150.357895, 206.170544, 150.408414),\n (206.170544, 150.408414, 206.170544, 150.458933),\n (206.170544, 150.458933, 206.170544, 150.509452),\n (206.170544, 150.509452, 206.170544, 150.559971),\n (206.170544, 150.559971, 206.170544, 150.61049),\n (206.170544, 150.61049, 206.170544, 150.661009),\n (206.170544, 150.661009, 206.170544, 150.711528),\n (206.170544, 150.711528, 206.170544, 150.762047),\n (206.170544, 150.762047, 132.959965, 150.762047),\n (132.959965, 149.145437, 132.959965, 149.195956),\n (132.959965, 149.195956, 132.959965, 149.246475),\n (132.959965, 149.246475, 132.959965, 149.296994),\n (132.959965, 149.296994, 132.959965, 149.347513),\n (132.959965, 149.347513, 132.959965, 149.398032),\n (132.959965, 149.398032, 132.959965, 149.448551),\n (132.959965, 149.448551, 132.959965, 149.49907),\n (132.959965, 149.49907, 132.959965, 149.549589),\n (132.959965, 149.549589, 132.959965, 149.600109),\n (132.959965, 149.600109, 132.959965, 149.650628),\n (132.959965, 149.650628, 132.959965, 149.701147),\n (132.959965, 149.701147, 132.959965, 149.751666),\n (132.959965, 149.751666, 132.959965, 149.802185),\n (132.959965, 149.802185, 132.959965, 149.852704),\n (132.959965, 149.852704, 132.959965, 149.903223),\n (132.959965, 149.903223, 132.959965, 149.953742),\n (132.959965, 149.953742, 132.959965, 150.004261),\n (132.959965, 150.004261, 132.959965, 150.05478),\n (132.959965, 150.05478, 132.959965, 150.105299),\n (132.959965, 150.105299, 132.959965, 150.155818),\n (132.959965, 150.155818, 132.959965, 150.206337),\n (132.959965, 150.206337, 132.959965, 150.256856),\n (132.959965, 150.256856, 132.959965, 150.307375),\n (132.959965, 150.307375, 132.959965, 150.357895),\n (132.959965, 150.357895, 132.959965, 150.408414),\n (132.959965, 150.408414, 132.959965, 150.458933),\n (132.959965, 150.458933, 132.959965, 150.509452),\n (132.959965, 150.509452, 132.959965, 150.559971),\n (132.959965, 150.559971, 132.959965, 150.61049),\n (132.959965, 150.61049, 132.959965, 150.661009),\n (132.959965, 150.661009, 132.959965, 150.711528),\n (132.959965, 150.711528, 132.959965, 150.762047),\n (132.959965, 150.762047, 132.959965, 170.027989),\n (206.170544, 150.762047, 206.170544, 170.027989),\n (132.959965, 149.145437, 206.170544, 149.145437),\n (206.170544, 170.027989, 132.959965, 170.027989)\n]\nVISIBLE_CIRCLES = [\n\n]\nVISIBLE_ARCS = [\n (82.836324, 170.027989, 2.006869, 90.0, -180.0),\n (116.953096, 170.027989, 2.006869, -0.0, 90.0),\n (117.153783, 150.962734, 1.817297, -96.340192, -6.340192),\n (82.635637, 150.962734, 1.817297, -173.659808, -83.659808)\n]\nHIDDEN_SEGMENTS = [\n\n]\n# (orient, text, p1, p2, base) for linear; (orient, text, center, radius, angle) for diameter\nDIMENSIONS = [\n ('horizontal', '100', (82.8363, 172.0528), (116.9531, 172.0528), (99.8947, 183.0528)),\n ('vertical', '56.4706', (118.96, 170.0459), (118.96, 150.78), (129.96, 160.4129)),\n ('radius', 'R5.8824', (82.8363, 170.0459), 2.0069, 45),\n ('radius', 'R5.3267', (117.1538, 150.9807), 1.8173, 45),\n ('horizontal', '214.588', (206.1705, 170.0459), (132.96, 170.0459), (169.5653, 159.0459))\n]\n\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; _ds.dxf.dimasz = 2.5\n _ds.dxf.dimexe = 1.25; _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\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\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,\n angle=(0 if d[0] == \"horizontal\" else 90),\n 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,\n 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,\n 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,\n text=text, dimstyle=\"EZDXF\").render()\n\n doc.saveas(out_path)\n\n\nif __name__ == \"__main__\":\n out = sys.argv[1] if len(sys.argv) > 1 else \"0059_00592914_gt.dxf\"\n draw(out)\n print(\"wrote\", out)\n```"}], "images": ["images/0059_00592914.png"], "id": "0059_00592914"} {"messages": [{"role": "user", "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 17.89 x 100 mm bounding box. It is extruded to a thickness of 120 mm."}, {"role": "assistant", "content": "```python\n#!/usr/bin/env python3\n# -*- coding: utf-8 -*-\n# Ground-truth 2D engineering drawing for part: 0060_00600516\n# Self-contained: reproduces the three-view DXF via ezdxf, NO FreeCAD needed.\n# Coordinates are A4 page millimetres (scale=0.43681818181817467, page=[297.0, 210.0]).\n# visible edges -> solid (layer OUTLINE); hidden edges -> dashed (layer HIDDEN)\n# dimensions -> real movable DIMENSION entities (text = true mm value)\n# Run: python 0060_00600516_gt.py [out.dxf]\nimport sys\nimport ezdxf\nimport math\n\nSCALE = 0.43681818181817467\nPAGE = [297.0, 210.0]\n\nVISIBLE_SEGMENTS = [\n (100.416133, 128.368175, 92.599387, 128.368175),\n (92.599387, 128.368175, 92.599387, 131.127026),\n (92.599387, 131.127026, 100.416133, 131.127026),\n (100.416133, 169.291141, 92.599387, 169.291141),\n (92.599387, 169.291141, 92.599387, 172.049993),\n (92.599387, 172.049993, 100.416133, 172.049993),\n (118.793639, 61.949993, 118.219342, 61.949993),\n (118.219342, 61.949993, 117.645045, 61.949993),\n (117.645045, 61.949993, 117.070748, 61.949993),\n (117.070748, 61.949993, 116.496451, 61.949993),\n (116.496451, 61.949993, 115.922154, 61.949993),\n (115.922154, 61.949993, 115.347857, 61.949993),\n (115.347857, 61.949993, 114.77356, 61.949993),\n (114.77356, 61.949993, 114.199263, 61.949993),\n (114.199263, 61.949993, 113.624966, 61.949993),\n (113.624966, 61.949993, 113.050669, 61.949993),\n (113.050669, 61.949993, 112.476372, 61.949993),\n (112.476372, 61.949993, 111.902074, 61.949993),\n (111.902074, 61.949993, 111.327777, 61.949993),\n (111.327777, 61.949993, 110.75348, 61.949993),\n (110.75348, 61.949993, 110.179183, 61.949993),\n (110.179183, 61.949993, 109.604886, 61.949993),\n (109.604886, 61.949993, 109.030589, 61.949993),\n (109.030589, 61.949993, 108.456292, 61.949993),\n (108.456292, 61.949993, 107.881995, 61.949993),\n (107.881995, 61.949993, 107.307698, 61.949993),\n (107.307698, 61.949993, 106.733401, 61.949993),\n (106.733401, 61.949993, 106.159104, 61.949993),\n (106.159104, 61.949993, 105.584807, 61.949993),\n (105.584807, 61.949993, 105.01051, 61.949993),\n (105.01051, 61.949993, 104.436213, 61.949993),\n (104.436213, 61.949993, 103.861915, 61.949993),\n (103.861915, 61.949993, 103.287618, 61.949993),\n (103.287618, 61.949993, 102.713321, 61.949993),\n (102.713321, 61.949993, 102.139024, 61.949993),\n (102.139024, 61.949993, 101.564727, 61.949993),\n (101.564727, 61.949993, 100.99043, 61.949993),\n (100.99043, 61.949993, 100.416133, 61.949993),\n (100.416133, 61.949993, 100.416133, 114.368174),\n (118.793639, 114.368174, 118.219342, 114.368174),\n (118.219342, 114.368174, 117.645045, 114.368174),\n (117.645045, 114.368174, 117.070748, 114.368174),\n (117.070748, 114.368174, 116.496451, 114.368174),\n (116.496451, 114.368174, 115.922154, 114.368174),\n (115.922154, 114.368174, 115.347857, 114.368174),\n (115.347857, 114.368174, 114.77356, 114.368174),\n (114.77356, 114.368174, 114.199263, 114.368174),\n (114.199263, 114.368174, 113.624966, 114.368174),\n (113.624966, 114.368174, 113.050669, 114.368174),\n (113.050669, 114.368174, 112.476372, 114.368174),\n (112.476372, 114.368174, 111.902074, 114.368174),\n (111.902074, 114.368174, 111.327777, 114.368174),\n (111.327777, 114.368174, 110.75348, 114.368174),\n (110.75348, 114.368174, 110.179183, 114.368174),\n (110.179183, 114.368174, 109.604886, 114.368174),\n (109.604886, 114.368174, 109.030589, 114.368174),\n (109.030589, 114.368174, 108.456292, 114.368174),\n (108.456292, 114.368174, 107.881995, 114.368174),\n (107.881995, 114.368174, 107.307698, 114.368174),\n (107.307698, 114.368174, 106.733401, 114.368174),\n (106.733401, 114.368174, 106.159104, 114.368174),\n (106.159104, 114.368174, 105.584807, 114.368174),\n (105.584807, 114.368174, 105.01051, 114.368174),\n (105.01051, 114.368174, 104.436213, 114.368174),\n (104.436213, 114.368174, 103.861915, 114.368174),\n (103.861915, 114.368174, 103.287618, 114.368174),\n (103.287618, 114.368174, 102.713321, 114.368174),\n (102.713321, 114.368174, 102.139024, 114.368174),\n (102.139024, 114.368174, 101.564727, 114.368174),\n (101.564727, 114.368174, 100.99043, 114.368174),\n (100.99043, 114.368174, 100.416133, 114.368174),\n (100.416133, 114.368174, 92.599387, 114.368174),\n (92.599387, 61.949993, 92.599387, 114.368174),\n (100.416133, 61.949993, 92.599387, 61.949993),\n (118.793639, 114.368174, 118.793639, 61.949993),\n (132.793639, 128.368175, 185.211821, 128.368175),\n (185.211821, 128.368175, 185.211821, 131.127026),\n (132.793639, 131.127026, 185.211821, 131.127026),\n (132.793639, 128.368175, 132.793639, 131.127026),\n (185.211821, 131.127026, 185.211821, 132.319655),\n (185.211821, 132.319655, 185.211821, 133.512283),\n (185.211821, 133.512283, 185.211821, 134.704912),\n (185.211821, 134.704912, 185.211821, 135.897541),\n (185.211821, 135.897541, 185.211821, 137.090169),\n (185.211821, 137.090169, 185.211821, 138.282798),\n (185.211821, 138.282798, 185.211821, 139.475426),\n (185.211821, 139.475426, 185.211821, 140.668055),\n (185.211821, 140.668055, 185.211821, 141.860683),\n (185.211821, 141.860683, 185.211821, 143.053312),\n (185.211821, 143.053312, 185.211821, 144.245941),\n (185.211821, 144.245941, 185.211821, 145.438569),\n (185.211821, 145.438569, 185.211821, 146.631198),\n (185.211821, 146.631198, 185.211821, 147.823826),\n (185.211821, 147.823826, 185.211821, 149.016455),\n (185.211821, 149.016455, 185.211821, 150.209084),\n (185.211821, 150.209084, 185.211821, 151.401712),\n (185.211821, 151.401712, 185.211821, 152.594341),\n (185.211821, 152.594341, 185.211821, 153.786969),\n (185.211821, 153.786969, 185.211821, 154.979598),\n (185.211821, 154.979598, 185.211821, 156.172227),\n (185.211821, 156.172227, 185.211821, 157.364855),\n (185.211821, 157.364855, 185.211821, 158.557484),\n (185.211821, 158.557484, 185.211821, 159.750112),\n (185.211821, 159.750112, 185.211821, 160.942741),\n (185.211821, 160.942741, 185.211821, 162.135369),\n (185.211821, 162.135369, 185.211821, 163.327998),\n (185.211821, 163.327998, 185.211821, 164.520627),\n (185.211821, 164.520627, 185.211821, 165.713255),\n (185.211821, 165.713255, 185.211821, 166.905884),\n (185.211821, 166.905884, 185.211821, 168.098512),\n (185.211821, 168.098512, 185.211821, 169.291141),\n (132.793639, 131.127026, 132.793639, 132.319655),\n (132.793639, 132.319655, 132.793639, 133.512283),\n (132.793639, 133.512283, 132.793639, 134.704912),\n (132.793639, 134.704912, 132.793639, 135.897541),\n (132.793639, 135.897541, 132.793639, 137.090169),\n (132.793639, 137.090169, 132.793639, 138.282798),\n (132.793639, 138.282798, 132.793639, 139.475426),\n (132.793639, 139.475426, 132.793639, 140.668055),\n (132.793639, 140.668055, 132.793639, 141.860683),\n (132.793639, 141.860683, 132.793639, 143.053312),\n (132.793639, 143.053312, 132.793639, 144.245941),\n (132.793639, 144.245941, 132.793639, 145.438569),\n (132.793639, 145.438569, 132.793639, 146.631198),\n (132.793639, 146.631198, 132.793639, 147.823826),\n (132.793639, 147.823826, 132.793639, 149.016455),\n (132.793639, 149.016455, 132.793639, 150.209084),\n (132.793639, 150.209084, 132.793639, 151.401712),\n (132.793639, 151.401712, 132.793639, 152.594341),\n (132.793639, 152.594341, 132.793639, 153.786969),\n (132.793639, 153.786969, 132.793639, 154.979598),\n (132.793639, 154.979598, 132.793639, 156.172227),\n (132.793639, 156.172227, 132.793639, 157.364855),\n (132.793639, 157.364855, 132.793639, 158.557484),\n (132.793639, 158.557484, 132.793639, 159.750112),\n (132.793639, 159.750112, 132.793639, 160.942741),\n (132.793639, 160.942741, 132.793639, 162.135369),\n (132.793639, 162.135369, 132.793639, 163.327998),\n (132.793639, 163.327998, 132.793639, 164.520627),\n (132.793639, 164.520627, 132.793639, 165.713255),\n (132.793639, 165.713255, 132.793639, 166.905884),\n (132.793639, 166.905884, 132.793639, 168.098512),\n (132.793639, 168.098512, 132.793639, 169.291141),\n (132.793639, 169.291141, 185.211821, 169.291141),\n (185.211821, 169.291141, 185.211821, 172.049993),\n (132.793639, 172.049993, 185.211821, 172.049993),\n (132.793639, 169.291141, 132.793639, 172.049993)\n]\nVISIBLE_CIRCLES = [\n\n]\nVISIBLE_ARCS = [\n (96.626376, 150.209084, 22.167263, -80.15625, 80.15625),\n (96.620476, 150.209084, 19.455897, -78.75, 78.75)\n]\nHIDDEN_SEGMENTS = [\n (116.0764, 61.95, 116.0764, 114.3682)\n]\n# (orient, text, p1, p2, base) for linear; (orient, text, center, radius, angle) for diameter\nDIMENSIONS = [\n ('horizontal', '17.8947', (100.4161, 172.05), (92.5994, 172.05), (96.5078, 161.05)),\n ('vertical', '6.3158', (92.5994, 172.05), (92.5994, 169.2911), (103.5994, 170.6706)),\n ('vertical', '87.3684', (100.4161, 169.2911), (100.4161, 131.127), (111.4161, 150.2091)),\n ('vertical', '100', (100.4161, 128.3682), (100.4161, 172.05), (89.4161, 150.2091)),\n ('radius', 'R50.7471', (96.6264, 150.2091), 22.1673, 45),\n ('radius', 'R44.54', (96.6205, 150.2091), 19.4559, 135),\n ('horizontal', '120', (132.7937, 128.3682), (185.2118, 128.3682), (159.0027, 139.3682))\n]\n\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; _ds.dxf.dimasz = 2.5\n _ds.dxf.dimexe = 1.25; _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\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\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,\n angle=(0 if d[0] == \"horizontal\" else 90),\n 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,\n 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,\n 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,\n text=text, dimstyle=\"EZDXF\").render()\n\n doc.saveas(out_path)\n\n\nif __name__ == \"__main__\":\n out = sys.argv[1] if len(sys.argv) > 1 else \"0060_00600516_gt.dxf\"\n draw(out)\n print(\"wrote\", out)\n```"}], "images": ["images/0060_00600516.png"], "id": "0060_00600516"} {"messages": [{"role": "user", "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.41 mm tall, featuring 3 circular holes, each of diameter 64.41 mm. It is extruded to a thickness of 19.69 mm."}, {"role": "assistant", "content": "```python\n#!/usr/bin/env python3\n# -*- coding: utf-8 -*-\n# Ground-truth 2D engineering drawing for part: 0061_00616779\n# Self-contained: reproduces the three-view DXF via ezdxf, NO FreeCAD needed.\n# Coordinates are A4 page millimetres (scale=0.6072190838186787, page=[297.0, 210.0]).\n# visible edges -> solid (layer OUTLINE); hidden edges -> dashed (layer HIDDEN)\n# dimensions -> real movable DIMENSION entities (text = true mm value)\n# Run: python 0061_00616779_gt.py [out.dxf]\nimport sys\nimport ezdxf\nimport math\n\nSCALE = 0.6072190838186787\nPAGE = [297.0, 210.0]\n\nVISIBLE_SEGMENTS = [\n (187.6806, 82.312622, 186.520283, 82.312622),\n (186.520283, 82.312622, 185.359965, 82.312622),\n (185.359965, 82.312622, 184.199648, 82.312622),\n (184.199648, 82.312622, 183.039331, 82.312622),\n (183.039331, 82.312622, 181.879014, 82.312622),\n (181.879014, 82.312622, 180.718697, 82.312622),\n (180.718697, 82.312622, 179.55838, 82.312622),\n (179.55838, 82.312622, 178.398063, 82.312622),\n (178.398063, 82.312622, 177.237746, 82.312622),\n (177.237746, 82.312622, 176.077428, 82.312622),\n (176.077428, 82.312622, 174.917111, 82.312622),\n (174.917111, 82.312622, 173.756794, 82.312622),\n (173.756794, 82.312622, 172.596477, 82.312622),\n (172.596477, 82.312622, 171.43616, 82.312622),\n (171.43616, 82.312622, 170.275843, 82.312622),\n (170.275843, 82.312622, 169.115526, 82.312622),\n (169.115526, 82.312622, 167.955209, 82.312622),\n (167.955209, 82.312622, 166.794891, 82.312622),\n (166.794891, 82.312622, 165.634574, 82.312622),\n (165.634574, 82.312622, 164.474257, 82.312622),\n (164.474257, 82.312622, 163.31394, 82.312622),\n (163.31394, 82.312622, 162.153623, 82.312622),\n (162.153623, 82.312622, 160.993306, 82.312622),\n (160.993306, 82.312622, 159.832989, 82.312622),\n (159.832989, 82.312622, 158.672672, 82.312622),\n (158.672672, 82.312622, 157.512354, 82.312622),\n (157.512354, 82.312622, 156.352037, 82.312622),\n (156.352037, 82.312622, 155.19172, 82.312622),\n (155.19172, 82.312622, 154.031403, 82.312622),\n (154.031403, 82.312622, 152.871086, 82.312622),\n (152.871086, 82.312622, 151.710769, 82.312622),\n (151.710769, 82.312622, 150.550452, 82.312622),\n (187.6806, 94.270417, 186.520283, 94.270417),\n (186.520283, 94.270417, 185.359965, 94.270417),\n (185.359965, 94.270417, 184.199648, 94.270417),\n (184.199648, 94.270417, 183.039331, 94.270417),\n (183.039331, 94.270417, 181.879014, 94.270417),\n (181.879014, 94.270417, 180.718697, 94.270417),\n (180.718697, 94.270417, 179.55838, 94.270417),\n (179.55838, 94.270417, 178.398063, 94.270417),\n (178.398063, 94.270417, 177.237746, 94.270417),\n (177.237746, 94.270417, 176.077428, 94.270417),\n (176.077428, 94.270417, 174.917111, 94.270417),\n (174.917111, 94.270417, 173.756794, 94.270417),\n (173.756794, 94.270417, 172.596477, 94.270417),\n (172.596477, 94.270417, 171.43616, 94.270417),\n (171.43616, 94.270417, 170.275843, 94.270417),\n (170.275843, 94.270417, 169.115526, 94.270417),\n (169.115526, 94.270417, 167.955209, 94.270417),\n (167.955209, 94.270417, 166.794891, 94.270417),\n (166.794891, 94.270417, 165.634574, 94.270417),\n (165.634574, 94.270417, 164.474257, 94.270417),\n (164.474257, 94.270417, 163.31394, 94.270417),\n (163.31394, 94.270417, 162.153623, 94.270417),\n (162.153623, 94.270417, 160.993306, 94.270417),\n (160.993306, 94.270417, 159.832989, 94.270417),\n (159.832989, 94.270417, 158.672672, 94.270417),\n (158.672672, 94.270417, 157.512354, 94.270417),\n (157.512354, 94.270417, 156.352037, 94.270417),\n (156.352037, 94.270417, 155.19172, 94.270417),\n (155.19172, 94.270417, 154.031403, 94.270417),\n (154.031403, 94.270417, 152.871086, 94.270417),\n (152.871086, 94.270417, 151.710769, 94.270417),\n (151.710769, 94.270417, 150.550452, 94.270417),\n (150.550452, 94.270417, 150.035859, 94.270417),\n (150.035859, 94.270417, 149.521267, 94.270417),\n (149.521267, 94.270417, 149.006674, 94.270417),\n (149.006674, 94.270417, 148.492082, 94.270417),\n (148.492082, 94.270417, 147.977489, 94.270417),\n (147.977489, 94.270417, 147.462897, 94.270417),\n (147.462897, 94.270417, 146.948305, 94.270417),\n (146.948305, 94.270417, 146.433712, 94.270417),\n (146.433712, 94.270417, 145.91912, 94.270417),\n (145.91912, 94.270417, 145.404527, 94.270417),\n (145.404527, 94.270417, 144.889935, 94.270417),\n (144.889935, 94.270417, 144.375342, 94.270417),\n (144.375342, 94.270417, 143.86075, 94.270417),\n (143.86075, 94.270417, 143.346157, 94.270417),\n (143.346157, 94.270417, 142.831565, 94.270417),\n (142.831565, 94.270417, 142.316973, 94.270417),\n (142.316973, 94.270417, 141.80238, 94.270417),\n (141.80238, 94.270417, 141.287788, 94.270417),\n (141.287788, 94.270417, 140.773195, 94.270417),\n (140.773195, 94.270417, 140.258603, 94.270417),\n (140.258603, 94.270417, 139.74401, 94.270417),\n (139.74401, 94.270417, 139.229418, 94.270417),\n (139.229418, 94.270417, 138.714825, 94.270417),\n (138.714825, 94.270417, 138.200233, 94.270417),\n (138.200233, 94.270417, 137.685641, 94.270417),\n (137.685641, 94.270417, 137.171048, 94.270417),\n (137.171048, 94.270417, 136.656456, 94.270417),\n (136.656456, 94.270417, 136.141863, 94.270417),\n (136.141863, 94.270417, 135.627271, 94.270417),\n (135.627271, 94.270417, 135.112678, 94.270417),\n (135.112678, 94.270417, 134.598086, 94.270417),\n (134.598086, 94.270417, 134.083493, 94.270417),\n (150.550452, 82.312622, 150.035859, 82.312622),\n (150.035859, 82.312622, 149.521267, 82.312622),\n (149.521267, 82.312622, 149.006674, 82.312622),\n (149.006674, 82.312622, 148.492082, 82.312622),\n (148.492082, 82.312622, 147.977489, 82.312622),\n (147.977489, 82.312622, 147.462897, 82.312622),\n (147.462897, 82.312622, 146.948305, 82.312622),\n (146.948305, 82.312622, 146.433712, 82.312622),\n (146.433712, 82.312622, 145.91912, 82.312622),\n (145.91912, 82.312622, 145.404527, 82.312622),\n (145.404527, 82.312622, 144.889935, 82.312622),\n (144.889935, 82.312622, 144.375342, 82.312622),\n (144.375342, 82.312622, 143.86075, 82.312622),\n (143.86075, 82.312622, 143.346157, 82.312622),\n (143.346157, 82.312622, 142.831565, 82.312622),\n (142.831565, 82.312622, 142.316973, 82.312622),\n (142.316973, 82.312622, 141.80238, 82.312622),\n (141.80238, 82.312622, 141.287788, 82.312622),\n (141.287788, 82.312622, 140.773195, 82.312622),\n (140.773195, 82.312622, 140.258603, 82.312622),\n (140.258603, 82.312622, 139.74401, 82.312622),\n (139.74401, 82.312622, 139.229418, 82.312622),\n (139.229418, 82.312622, 138.714825, 82.312622),\n (138.714825, 82.312622, 138.200233, 82.312622),\n (138.200233, 82.312622, 137.685641, 82.312622),\n (137.685641, 82.312622, 137.171048, 82.312622),\n (137.171048, 82.312622, 136.656456, 82.312622),\n (136.656456, 82.312622, 136.141863, 82.312622),\n (136.141863, 82.312622, 135.627271, 82.312622),\n (135.627271, 82.312622, 135.112678, 82.312622),\n (135.112678, 82.312622, 134.598086, 82.312622),\n (134.598086, 82.312622, 134.083493, 82.312622),\n (134.083493, 82.312622, 133.215119, 82.312622),\n (133.215119, 82.312622, 132.346744, 82.312622),\n (132.346744, 82.312622, 131.478369, 82.312622),\n (131.478369, 82.312622, 130.609994, 82.312622),\n (130.609994, 82.312622, 129.74162, 82.312622),\n (129.74162, 82.312622, 128.873245, 82.312622),\n (128.873245, 82.312622, 128.00487, 82.312622),\n (128.00487, 82.312622, 127.136495, 82.312622),\n (127.136495, 82.312622, 126.268121, 82.312622),\n (126.268121, 82.312622, 125.399746, 82.312622),\n (125.399746, 82.312622, 124.531371, 82.312622),\n (124.531371, 82.312622, 123.662996, 82.312622),\n (123.662996, 82.312622, 122.794622, 82.312622),\n (122.794622, 82.312622, 121.926247, 82.312622),\n (121.926247, 82.312622, 121.057872, 82.312622),\n (121.057872, 82.312622, 120.189497, 82.312622),\n (120.189497, 82.312622, 119.321123, 82.312622),\n (119.321123, 82.312622, 118.452748, 82.312622),\n (118.452748, 82.312622, 117.584373, 82.312622),\n (117.584373, 82.312622, 116.715998, 82.312622),\n (116.715998, 82.312622, 115.847624, 82.312622),\n (115.847624, 82.312622, 114.979249, 82.312622),\n (114.979249, 82.312622, 114.110874, 82.312622),\n (114.110874, 82.312622, 113.242499, 82.312622),\n (113.242499, 82.312622, 112.374125, 82.312622),\n (112.374125, 82.312622, 111.50575, 82.312622),\n (111.50575, 82.312622, 110.637375, 82.312622),\n (110.637375, 82.312622, 109.769, 82.312622),\n (109.769, 82.312622, 108.900626, 82.312622),\n (108.900626, 82.312622, 108.032251, 82.312622),\n (108.032251, 82.312622, 107.163876, 82.312622),\n (107.163876, 82.312622, 106.295501, 82.312622),\n (134.083493, 94.270417, 133.215119, 94.270417),\n (133.215119, 94.270417, 132.346744, 94.270417),\n (132.346744, 94.270417, 131.478369, 94.270417),\n (131.478369, 94.270417, 130.609994, 94.270417),\n (130.609994, 94.270417, 129.74162, 94.270417),\n (129.74162, 94.270417, 128.873245, 94.270417),\n (128.873245, 94.270417, 128.00487, 94.270417),\n (128.00487, 94.270417, 127.136495, 94.270417),\n (127.136495, 94.270417, 126.268121, 94.270417),\n (126.268121, 94.270417, 125.399746, 94.270417),\n (125.399746, 94.270417, 124.531371, 94.270417),\n (124.531371, 94.270417, 123.662996, 94.270417),\n (123.662996, 94.270417, 122.794622, 94.270417),\n (122.794622, 94.270417, 121.926247, 94.270417),\n (121.926247, 94.270417, 121.057872, 94.270417),\n (121.057872, 94.270417, 120.189497, 94.270417),\n (120.189497, 94.270417, 119.321123, 94.270417),\n (119.321123, 94.270417, 118.452748, 94.270417),\n (118.452748, 94.270417, 117.584373, 94.270417),\n (117.584373, 94.270417, 116.715998, 94.270417),\n (116.715998, 94.270417, 115.847624, 94.270417),\n (115.847624, 94.270417, 114.979249, 94.270417),\n (114.979249, 94.270417, 114.110874, 94.270417),\n (114.110874, 94.270417, 113.242499, 94.270417),\n (113.242499, 94.270417, 112.374125, 94.270417),\n (112.374125, 94.270417, 111.50575, 94.270417),\n (111.50575, 94.270417, 110.637375, 94.270417),\n (110.637375, 94.270417, 109.769, 94.270417),\n (109.769, 94.270417, 108.900626, 94.270417),\n (108.900626, 94.270417, 108.032251, 94.270417),\n (108.032251, 94.270417, 107.163876, 94.270417),\n (107.163876, 94.270417, 106.295501, 94.270417),\n (106.295501, 94.270417, 105.780909, 94.270417),\n (105.780909, 94.270417, 105.266317, 94.270417),\n (105.266317, 94.270417, 104.751724, 94.270417),\n (104.751724, 94.270417, 104.237132, 94.270417),\n (104.237132, 94.270417, 103.722539, 94.270417),\n (103.722539, 94.270417, 103.207947, 94.270417),\n (103.207947, 94.270417, 102.693354, 94.270417),\n (102.693354, 94.270417, 102.178762, 94.270417),\n (102.178762, 94.270417, 101.66417, 94.270417),\n (101.66417, 94.270417, 101.149577, 94.270417),\n (101.149577, 94.270417, 100.634985, 94.270417),\n (100.634985, 94.270417, 100.120392, 94.270417),\n (100.120392, 94.270417, 99.6058, 94.270417),\n (99.6058, 94.270417, 99.091207, 94.270417),\n (99.091207, 94.270417, 98.576615, 94.270417),\n (98.576615, 94.270417, 98.062022, 94.270417),\n (98.062022, 94.270417, 97.54743, 94.270417),\n (97.54743, 94.270417, 97.032838, 94.270417),\n (97.032838, 94.270417, 96.518245, 94.270417),\n (96.518245, 94.270417, 96.003653, 94.270417),\n (96.003653, 94.270417, 95.48906, 94.270417),\n (95.48906, 94.270417, 94.974468, 94.270417),\n (94.974468, 94.270417, 94.459875, 94.270417),\n (94.459875, 94.270417, 93.945283, 94.270417),\n (93.945283, 94.270417, 93.43069, 94.270417),\n (93.43069, 94.270417, 92.916098, 94.270417),\n (92.916098, 94.270417, 92.401506, 94.270417),\n (92.401506, 94.270417, 91.886913, 94.270417),\n (91.886913, 94.270417, 91.372321, 94.270417),\n (91.372321, 94.270417, 90.857728, 94.270417),\n (90.857728, 94.270417, 90.343136, 94.270417),\n (90.343136, 94.270417, 89.828543, 94.270417),\n (106.295501, 82.312622, 105.780909, 82.312622),\n (105.780909, 82.312622, 105.266317, 82.312622),\n (105.266317, 82.312622, 104.751724, 82.312622),\n (104.751724, 82.312622, 104.237132, 82.312622),\n (104.237132, 82.312622, 103.722539, 82.312622),\n (103.722539, 82.312622, 103.207947, 82.312622),\n (103.207947, 82.312622, 102.693354, 82.312622),\n (102.693354, 82.312622, 102.178762, 82.312622),\n (102.178762, 82.312622, 101.66417, 82.312622),\n (101.66417, 82.312622, 101.149577, 82.312622),\n (101.149577, 82.312622, 100.634985, 82.312622),\n (100.634985, 82.312622, 100.120392, 82.312622),\n (100.120392, 82.312622, 99.6058, 82.312622),\n (99.6058, 82.312622, 99.091207, 82.312622),\n (99.091207, 82.312622, 98.576615, 82.312622),\n (98.576615, 82.312622, 98.062022, 82.312622),\n (98.062022, 82.312622, 97.54743, 82.312622),\n (97.54743, 82.312622, 97.032838, 82.312622),\n (97.032838, 82.312622, 96.518245, 82.312622),\n (96.518245, 82.312622, 96.003653, 82.312622),\n (96.003653, 82.312622, 95.48906, 82.312622),\n (95.48906, 82.312622, 94.974468, 82.312622),\n (94.974468, 82.312622, 94.459875, 82.312622),\n (94.459875, 82.312622, 93.945283, 82.312622),\n (93.945283, 82.312622, 93.43069, 82.312622),\n (93.43069, 82.312622, 92.916098, 82.312622),\n (92.916098, 82.312622, 92.401506, 82.312622),\n (92.401506, 82.312622, 91.886913, 82.312622),\n (91.886913, 82.312622, 91.372321, 82.312622),\n (91.372321, 82.312622, 90.857728, 82.312622),\n (90.857728, 82.312622, 90.343136, 82.312622),\n (90.343136, 82.312622, 89.828543, 82.312622),\n (89.828543, 82.312622, 88.668226, 82.312622),\n (88.668226, 82.312622, 87.507909, 82.312622),\n (87.507909, 82.312622, 86.347592, 82.312622),\n (86.347592, 82.312622, 85.187275, 82.312622),\n (85.187275, 82.312622, 84.026958, 82.312622),\n (84.026958, 82.312622, 82.866641, 82.312622),\n (82.866641, 82.312622, 81.706323, 82.312622),\n (81.706323, 82.312622, 80.546006, 82.312622),\n (80.546006, 82.312622, 79.385689, 82.312622),\n (79.385689, 82.312622, 78.225372, 82.312622),\n (78.225372, 82.312622, 77.065055, 82.312622),\n (77.065055, 82.312622, 75.904738, 82.312622),\n (75.904738, 82.312622, 74.744421, 82.312622),\n (74.744421, 82.312622, 73.584104, 82.312622),\n (73.584104, 82.312622, 72.423786, 82.312622),\n (72.423786, 82.312622, 71.263469, 82.312622),\n (71.263469, 82.312622, 70.103152, 82.312622),\n (70.103152, 82.312622, 68.942835, 82.312622),\n (68.942835, 82.312622, 67.782518, 82.312622),\n (67.782518, 82.312622, 66.622201, 82.312622),\n (66.622201, 82.312622, 65.461884, 82.312622),\n (65.461884, 82.312622, 64.301567, 82.312622),\n (64.301567, 82.312622, 63.141249, 82.312622),\n (63.141249, 82.312622, 61.980932, 82.312622),\n (61.980932, 82.312622, 60.820615, 82.312622),\n (60.820615, 82.312622, 59.660298, 82.312622),\n (59.660298, 82.312622, 58.499981, 82.312622),\n (58.499981, 82.312622, 57.339664, 82.312622),\n (57.339664, 82.312622, 56.179347, 82.312622),\n (56.179347, 82.312622, 55.01903, 82.312622),\n (55.01903, 82.312622, 53.858712, 82.312622),\n (53.858712, 82.312622, 52.698395, 82.312622),\n (89.828543, 94.270417, 88.668226, 94.270417),\n (88.668226, 94.270417, 87.507909, 94.270417),\n (87.507909, 94.270417, 86.347592, 94.270417),\n (86.347592, 94.270417, 85.187275, 94.270417),\n (85.187275, 94.270417, 84.026958, 94.270417),\n (84.026958, 94.270417, 82.866641, 94.270417),\n (82.866641, 94.270417, 81.706323, 94.270417),\n (81.706323, 94.270417, 80.546006, 94.270417),\n (80.546006, 94.270417, 79.385689, 94.270417),\n (79.385689, 94.270417, 78.225372, 94.270417),\n (78.225372, 94.270417, 77.065055, 94.270417),\n (77.065055, 94.270417, 75.904738, 94.270417),\n (75.904738, 94.270417, 74.744421, 94.270417),\n (74.744421, 94.270417, 73.584104, 94.270417),\n (73.584104, 94.270417, 72.423786, 94.270417),\n (72.423786, 94.270417, 71.263469, 94.270417),\n (71.263469, 94.270417, 70.103152, 94.270417),\n (70.103152, 94.270417, 68.942835, 94.270417),\n (68.942835, 94.270417, 67.782518, 94.270417),\n (67.782518, 94.270417, 66.622201, 94.270417),\n (66.622201, 94.270417, 65.461884, 94.270417),\n (65.461884, 94.270417, 64.301567, 94.270417),\n (64.301567, 94.270417, 63.141249, 94.270417),\n (63.141249, 94.270417, 61.980932, 94.270417),\n (61.980932, 94.270417, 60.820615, 94.270417),\n (60.820615, 94.270417, 59.660298, 94.270417),\n (59.660298, 94.270417, 58.499981, 94.270417),\n (58.499981, 94.270417, 57.339664, 94.270417),\n (57.339664, 94.270417, 56.179347, 94.270417),\n (56.179347, 94.270417, 55.01903, 94.270417),\n (55.01903, 94.270417, 53.858712, 94.270417),\n (53.858712, 94.270417, 52.698395, 94.270417),\n (187.6806, 94.270417, 187.6806, 82.312622),\n (52.698395, 94.270417, 52.698395, 82.312622),\n (150.550452, 82.312622, 150.550452, 94.270417),\n (134.083493, 82.312622, 134.083493, 94.270417),\n (106.295501, 82.312622, 106.295501, 94.270417),\n (89.828543, 82.312622, 89.828543, 94.270417),\n (201.6806, 108.418655, 201.6806, 109.900795),\n (201.6806, 109.900795, 201.6806, 111.382935),\n (201.6806, 111.382935, 201.6806, 112.865076),\n (201.6806, 112.865076, 201.6806, 114.347216),\n (201.6806, 114.347216, 201.6806, 115.829356),\n (201.6806, 115.829356, 201.6806, 117.311497),\n (201.6806, 117.311497, 201.6806, 118.793637),\n (201.6806, 118.793637, 201.6806, 120.275777),\n (201.6806, 120.275777, 201.6806, 121.757918),\n (201.6806, 121.757918, 201.6806, 123.240058),\n (201.6806, 123.240058, 201.6806, 124.722198),\n (201.6806, 124.722198, 201.6806, 126.204339),\n (201.6806, 126.204339, 201.6806, 127.686479),\n (201.6806, 127.686479, 201.6806, 129.168619),\n (201.6806, 129.168619, 201.6806, 130.65076),\n (201.6806, 130.65076, 201.6806, 132.1329),\n (201.6806, 132.1329, 201.6806, 133.61504),\n (201.6806, 133.61504, 201.6806, 135.097181),\n (201.6806, 135.097181, 201.6806, 136.579321),\n (201.6806, 136.579321, 201.6806, 138.061461),\n (201.6806, 138.061461, 201.6806, 139.543602),\n (201.6806, 139.543602, 201.6806, 141.025742),\n (201.6806, 141.025742, 201.6806, 142.507882),\n (201.6806, 142.507882, 201.6806, 143.990023),\n (201.6806, 143.990023, 201.6806, 145.472163),\n (201.6806, 145.472163, 201.6806, 146.954303),\n (201.6806, 146.954303, 201.6806, 148.436444),\n (201.6806, 148.436444, 201.6806, 149.918584),\n (201.6806, 149.918584, 201.6806, 151.400724),\n (201.6806, 151.400724, 201.6806, 152.882865),\n (201.6806, 152.882865, 201.6806, 154.365005),\n (201.6806, 154.365005, 201.6806, 155.847145),\n (213.638396, 108.418655, 213.638396, 109.900795),\n (213.638396, 109.900795, 213.638396, 111.382935),\n (213.638396, 111.382935, 213.638396, 112.865076),\n (213.638396, 112.865076, 213.638396, 114.347216),\n (213.638396, 114.347216, 213.638396, 115.829356),\n (213.638396, 115.829356, 213.638396, 117.311497),\n (213.638396, 117.311497, 213.638396, 118.793637),\n (213.638396, 118.793637, 213.638396, 120.275777),\n (213.638396, 120.275777, 213.638396, 121.757918),\n (213.638396, 121.757918, 213.638396, 123.240058),\n (213.638396, 123.240058, 213.638396, 124.722198),\n (213.638396, 124.722198, 213.638396, 126.204339),\n (213.638396, 126.204339, 213.638396, 127.686479),\n (213.638396, 127.686479, 213.638396, 129.168619),\n (213.638396, 129.168619, 213.638396, 130.65076),\n (213.638396, 130.65076, 213.638396, 132.1329),\n (213.638396, 132.1329, 213.638396, 133.61504),\n (213.638396, 133.61504, 213.638396, 135.097181),\n (213.638396, 135.097181, 213.638396, 136.579321),\n (213.638396, 136.579321, 213.638396, 138.061461),\n (213.638396, 138.061461, 213.638396, 139.543602),\n (213.638396, 139.543602, 213.638396, 141.025742),\n (213.638396, 141.025742, 213.638396, 142.507882),\n (213.638396, 142.507882, 213.638396, 143.990023),\n (213.638396, 143.990023, 213.638396, 145.472163),\n (213.638396, 145.472163, 213.638396, 146.954303),\n (213.638396, 146.954303, 213.638396, 148.436444),\n (213.638396, 148.436444, 213.638396, 149.918584),\n (213.638396, 149.918584, 213.638396, 151.400724),\n (213.638396, 151.400724, 213.638396, 152.882865),\n (213.638396, 152.882865, 213.638396, 154.365005),\n (213.638396, 154.365005, 213.638396, 155.847145),\n (213.638396, 155.995383, 201.6806, 155.995383),\n (213.638396, 108.270417, 201.6806, 108.270417),\n (213.638396, 108.418655, 201.6806, 108.418655),\n (213.638396, 155.847145, 201.6806, 155.847145)\n]\nVISIBLE_CIRCLES = [\n (76.44914, 132.1329, 19.554513),\n (119.674905, 132.1329, 19.554513),\n (163.929855, 132.1329, 19.554513)\n]\nVISIBLE_ARCS = [\n (98.062022, 163.688221, 14.553679, -124.453125, -55.546875),\n (120.189497, 131.43605, 24.559333, 55.546875, 124.453125),\n (142.316973, 163.688221, 14.553679, -124.453125, -55.546875),\n (163.966355, 132.1329, 23.714245, -124.453125, 124.453125),\n (142.316973, 100.577579, 14.553679, 55.546875, 124.453125),\n (120.189497, 132.82975, 24.559333, -124.453125, -55.546875),\n (98.062022, 100.577579, 14.553679, 55.546875, 124.453125),\n (76.41264, 132.1329, 23.714245, 55.546875, -55.546875),\n (30.383759, 65.989118, 193.469389, 27.680377, 27.719246),\n (270.051219, 122.405118, 65.618157, 149.228879, 149.340158),\n (-66.407026, 123.449021, 268.512769, -3.240517, -3.208936),\n (270.610015, 142.131353, 66.236825, -149.385267, -149.274976)\n]\nHIDDEN_SEGMENTS = [\n (96.0037, 94.2704, 96.0037, 82.3126),\n (139.2294, 94.2704, 139.2294, 82.3126),\n (183.4844, 94.2704, 183.4844, 82.3126),\n (56.8946, 82.3126, 56.8946, 94.2704),\n (100.1204, 82.3126, 100.1204, 94.2704),\n (144.3754, 82.3126, 144.3754, 94.2704),\n (213.6384, 115.1312, 201.6806, 115.1312),\n (213.6384, 149.1345, 201.6806, 149.1345),\n (213.6384, 151.6874, 201.6806, 151.6874),\n (213.6384, 112.5784, 201.6806, 112.5784)\n]\n# (orient, text, p1, p2, base) for linear; (orient, text, center, radius, angle) for diameter\nDIMENSIONS = [\n ('horizontal', '100', (89.8286, 112.5784), (150.5505, 112.5784), (120.1895, 123.5784)),\n ('vertical', '64.4068', (150.5505, 112.5784), (150.5505, 151.6874), (139.5505, 132.1329)),\n ('diameter', '%%c64.4068', (76.4491, 132.1329), 19.5545, 45),\n ('horizontal', '22.0339', (89.8286, 132.1329), (76.4491, 132.1329), (83.1388, 121.1329)),\n ('vertical', '32.2034', (76.4491, 112.5784), (76.4491, 132.1329), (65.4491, 122.3556)),\n ('diameter', '%%c64.4068', (119.6749, 132.1329), 19.5545, 45),\n ('horizontal', '49.1525', (89.8286, 132.1329), (119.6749, 132.1329), (104.7517, 143.1329)),\n ('vertical', '32.2034', (119.6749, 112.5784), (119.6749, 132.1329), (108.6749, 122.3556)),\n ('diameter', '%%c64.4068', (163.9299, 132.1329), 19.5545, 45),\n ('horizontal', '122.034', (89.8286, 132.1329), (163.9299, 132.1329), (126.8792, 143.1329)),\n ('vertical', '32.2034', (163.9299, 112.5784), (163.9299, 132.1329), (152.9299, 122.3556)),\n ('radius', 'R23.9678', (98.062, 100.5776), 14.5537, 45),\n ('radius', 'R40.4456', (120.1895, 132.8297), 24.5593, 135),\n ('radius', 'R39.0539', (163.9664, 132.1329), 23.7143, 135),\n ('horizontal', '19.6927', (201.6806, 112.5784), (213.6384, 112.5784), (207.6595, 123.5784))\n]\n\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; _ds.dxf.dimasz = 2.5\n _ds.dxf.dimexe = 1.25; _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\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\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,\n angle=(0 if d[0] == \"horizontal\" else 90),\n 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,\n 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,\n 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,\n text=text, dimstyle=\"EZDXF\").render()\n\n doc.saveas(out_path)\n\n\nif __name__ == \"__main__\":\n out = sys.argv[1] if len(sys.argv) > 1 else \"0061_00616779_gt.dxf\"\n draw(out)\n print(\"wrote\", out)\n```"}], "images": ["images/0061_00616779.png"], "id": "0061_00616779"} {"messages": [{"role": "user", "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. It is extruded to a thickness of 114.29 mm. The outline includes one or more oblique (angled) edges."}, {"role": "assistant", "content": "```python\n#!/usr/bin/env python3\n# -*- coding: utf-8 -*-\n# Ground-truth 2D engineering drawing for part: 0062_00622284\n# Self-contained: reproduces the three-view DXF via ezdxf, NO FreeCAD needed.\n# Coordinates are A4 page millimetres (scale=0.668081117947579, page=[297.0, 210.0]).\n# visible edges -> solid (layer OUTLINE); hidden edges -> dashed (layer HIDDEN)\n# dimensions -> real movable DIMENSION entities (text = true mm value)\n# Run: python 0062_00622284_gt.py [out.dxf]\nimport sys\nimport ezdxf\nimport math\n\nSCALE = 0.668081117947579\nPAGE = [297.0, 210.0]\n\nVISIBLE_SEGMENTS = [\n (131.72801, 172.064261, 131.72801, 152.373449),\n (131.72801, 152.373449, 131.024767, 152.373449),\n (129.618281, 153.076693, 129.618281, 167.141558),\n (126.805307, 169.954531, 70.545845, 169.954531),\n (67.732872, 167.141558, 67.732872, 153.076693),\n (66.326385, 152.373449, 64.919899, 152.373449),\n (64.919899, 152.373449, 64.919899, 172.064261),\n (64.919899, 172.064261, 131.72801, 172.064261),\n (131.72801, 61.964261, 131.72801, 138.316389),\n (64.919899, 61.964261, 64.919899, 138.316389),\n (64.919899, 138.316389, 131.72801, 138.316389),\n (64.919899, 61.964261, 131.72801, 61.964261),\n (222.080138, 152.373449, 145.728011, 152.373449),\n (145.728011, 152.373449, 145.728011, 172.064261),\n (222.080138, 172.064261, 145.728011, 172.064261),\n (222.080138, 152.373449, 222.080138, 172.064261),\n (145.728011, 152.316389, 222.080138, 152.316389)\n]\nVISIBLE_CIRCLES = [\n\n]\nVISIBLE_ARCS = [\n (130.673146, 153.428314, 1.111925, -161.565051, -71.565051),\n (126.805307, 167.141558, 2.812973, 0.0, 90.0),\n (70.545845, 167.141558, 2.812973, 90.0, -180.0),\n (66.678007, 153.428314, 1.111925, -108.434949, -18.434949),\n (302.61718, 591.500468, 446.479299, -100.392698, -100.391377),\n (65.190969, 591.500468, 446.479299, -79.608623, -79.607302)\n]\nHIDDEN_SEGMENTS = [\n (131.0247, 61.9643, 131.0247, 138.3164),\n (129.6183, 61.9643, 129.6183, 138.3164),\n (67.7329, 61.9643, 67.7329, 138.3164),\n (66.3264, 61.9643, 66.3264, 138.3164),\n (222.0801, 153.0767, 145.728, 153.0767),\n (222.0801, 169.9545, 145.728, 169.9545)\n]\n# (orient, text, p1, p2, base) for linear; (orient, text, center, radius, angle) for diameter\nDIMENSIONS = [\n ('horizontal', '1.0526', (131.728, 152.3734), (131.0248, 152.3734), (131.3764, 141.3734)),\n ('horizontal', '2.1053', (66.3264, 152.3734), (64.9199, 152.3734), (65.6231, 141.3734)),\n ('horizontal', '84.2105', (126.8053, 169.9545), (70.5459, 169.9545), (98.6756, 158.9545)),\n ('horizontal', '100', (64.9199, 172.0643), (131.728, 172.0643), (98.3239, 183.0643)),\n ('vertical', '21.0526', (129.6183, 153.0767), (129.6183, 167.1416), (118.6183, 160.1091)),\n ('vertical', '29.4737', (131.728, 172.0643), (131.728, 152.3734), (142.728, 162.2189)),\n ('radius', 'R1.6644', (130.6732, 153.4283), 1.112, 45),\n ('radius', 'R4.2105', (126.8053, 167.1416), 2.813, 45),\n ('horizontal', '114.286', (222.0801, 172.0643), (145.728, 172.0643), (183.9041, 161.0643))\n]\n\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; _ds.dxf.dimasz = 2.5\n _ds.dxf.dimexe = 1.25; _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\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\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,\n angle=(0 if d[0] == \"horizontal\" else 90),\n 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,\n 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,\n 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,\n text=text, dimstyle=\"EZDXF\").render()\n\n doc.saveas(out_path)\n\n\nif __name__ == \"__main__\":\n out = sys.argv[1] if len(sys.argv) > 1 else \"0062_00622284_gt.dxf\"\n draw(out)\n print(\"wrote\", out)\n```"}], "images": ["images/0062_00622284.png"], "id": "0062_00622284"} {"messages": [{"role": "user", "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 172.92 x 147.92 mm. It is extruded to a thickness of 6333.33 mm. The outline includes one or more oblique (angled) edges."}, {"role": "assistant", "content": "```python\n#!/usr/bin/env python3\n# -*- coding: utf-8 -*-\n# Ground-truth 2D engineering drawing for part: 0062_00624736\n# Self-contained: reproduces the three-view DXF via ezdxf, NO FreeCAD needed.\n# Coordinates are A4 page millimetres (scale=0.007470115023456502, page=[297.0, 210.0]).\n# visible edges -> solid (layer OUTLINE); hidden edges -> dashed (layer HIDDEN)\n# dimensions -> real movable DIMENSION entities (text = true mm value)\n# Run: python 0062_00624736_gt.py [out.dxf]\nimport sys\nimport ezdxf\nimport math\n\nSCALE = 0.007470115023456502\nPAGE = [297.0, 210.0]\n\nVISIBLE_SEGMENTS = [\n (88.450041, 170.929504, 88.450041, 171.676515),\n (88.823547, 172.050021, 89.554996, 172.050021),\n (89.928502, 171.676515, 89.928502, 170.929504),\n (89.554996, 170.571561, 88.823547, 170.571561),\n (89.741749, 171.676515, 89.741749, 170.929504),\n (88.823547, 171.863268, 89.554996, 171.863268),\n (88.636794, 171.676515, 88.450041, 171.676515),\n (88.636794, 170.929504, 88.636794, 171.676515),\n (89.554996, 170.758313, 88.823547, 170.758313),\n (88.450041, 109.260749, 88.450041, 61.950021),\n (88.450041, 61.950021, 88.823547, 61.950021),\n (88.450041, 156.571478, 88.823547, 156.571478),\n (88.450041, 109.260749, 88.450041, 156.571478),\n (88.823547, 156.571478, 89.554996, 156.571478),\n (88.823547, 61.950021, 89.554996, 61.950021),\n (89.554996, 156.571478, 89.928502, 156.571478),\n (89.554996, 61.950021, 89.928502, 61.950021),\n (89.928502, 61.950021, 89.928502, 156.571478),\n (88.823547, 61.950021, 88.823547, 156.571478),\n (89.554996, 61.950021, 89.554996, 156.571478),\n (198.549959, 171.676515, 198.549959, 172.050021),\n (198.549959, 172.050021, 103.928502, 172.050021),\n (103.928502, 171.676515, 103.928502, 172.050021),\n (103.928502, 170.929504, 198.549959, 170.929504),\n (103.928502, 170.929504, 103.928502, 171.676515),\n (198.549959, 170.929504, 198.549959, 171.676515),\n (103.928502, 170.571561, 103.928502, 170.571478),\n (103.928502, 170.571478, 103.928502, 170.929504),\n (198.549959, 170.571561, 198.549959, 170.571478),\n (198.549959, 170.571478, 198.549959, 170.929504),\n (103.928502, 170.571561, 198.549959, 170.571561),\n (151.23923, 171.676515, 198.549959, 171.676515),\n (151.23923, 171.676515, 103.928502, 171.676515),\n (103.928502, 170.571478, 198.549959, 170.571478)\n]\nVISIBLE_CIRCLES = [\n\n]\nVISIBLE_ARCS = [\n (88.823547, 171.676515, 0.373506, 90.0, 180.0),\n (88.815766, 170.937285, 0.365807, -178.781125, -88.781125),\n (89.554996, 171.676515, 0.373506, -0.0, 90.0),\n (89.562777, 170.937285, 0.365807, -91.218875, -1.218875),\n (89.562777, 170.937285, 0.179141, -92.489553, -2.489553),\n (89.554996, 171.676515, 0.186753, -0.0, 90.0),\n (88.730171, 171.583139, 0.295282, 71.565051, 161.565051),\n (88.815766, 170.937285, 0.179141, -177.510447, -87.510447)\n]\nHIDDEN_SEGMENTS = [\n\n]\n# (orient, text, p1, p2, base) for linear; (orient, text, center, radius, angle) for diameter\nDIMENSIONS = [\n ('horizontal', '97.9167', (88.8235, 172.05), (89.555, 172.05), (89.1893, 183.05)),\n ('vertical', '100', (89.9285, 171.6765), (89.9285, 170.9295), (100.9285, 171.303)),\n ('horizontal', '172.917', (88.45, 171.8633), (89.7417, 171.8633), (89.0959, 182.8633)),\n ('vertical', '147.917', (88.45, 171.8633), (88.45, 170.7583), (99.45, 171.3108)),\n ('vertical', '25', (88.45, 172.05), (88.45, 171.8633), (99.45, 171.9566)),\n ('radius', 'R50', (88.8235, 171.6765), 0.3735, 45),\n ('radius', 'R48.9694', (89.5628, 170.9373), 0.3658, 45),\n ('radius', 'R39.5285', (88.7302, 171.5831), 0.2953, 135),\n ('radius', 'R25', (89.555, 171.6765), 0.1868, 45),\n ('radius', 'R23.981', (89.5628, 170.9373), 0.1791, 135),\n ('horizontal', '12666.7', (198.55, 171.6765), (103.9285, 171.6765), (151.2392, 160.6765))\n]\n\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; _ds.dxf.dimasz = 2.5\n _ds.dxf.dimexe = 1.25; _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\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\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,\n angle=(0 if d[0] == \"horizontal\" else 90),\n 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,\n 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,\n 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,\n text=text, dimstyle=\"EZDXF\").render()\n\n doc.saveas(out_path)\n\n\nif __name__ == \"__main__\":\n out = sys.argv[1] if len(sys.argv) > 1 else \"0062_00624736_gt.dxf\"\n draw(out)\n print(\"wrote\", out)\n```"}], "images": ["images/0062_00624736.png"], "id": "0062_00624736"} {"messages": [{"role": "user", "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 2.81 mm. The outline includes one or more oblique (angled) edges."}, {"role": "assistant", "content": "```python\n#!/usr/bin/env python3\n# -*- coding: utf-8 -*-\n# Ground-truth 2D engineering drawing for part: 0063_00632535\n# Self-contained: reproduces the three-view DXF via ezdxf, NO FreeCAD needed.\n# Coordinates are A4 page millimetres (scale=1.525986260151419, page=[297.0, 210.0]).\n# visible edges -> solid (layer OUTLINE); hidden edges -> dashed (layer HIDDEN)\n# dimensions -> real movable DIMENSION entities (text = true mm value)\n# Run: python 0063_00632535_gt.py [out.dxf]\nimport sys\nimport ezdxf\nimport math\n\nSCALE = 1.525986260151419\nPAGE = [297.0, 210.0]\n\nVISIBLE_SEGMENTS = [\n (195.78244, 168.170458, 195.78244, 172.049945),\n (72.932025, 81.528587, 76.811512, 80.235424),\n (195.78244, 66.235424, 195.78244, 61.949945),\n (195.78244, 66.235424, 191.943365, 66.235424),\n (191.943365, 66.235424, 188.104289, 66.235424),\n (188.104289, 66.235424, 184.265214, 66.235424),\n (184.265214, 66.235424, 180.426138, 66.235424),\n (180.426138, 66.235424, 176.587063, 66.235424),\n (176.587063, 66.235424, 172.747987, 66.235424),\n (172.747987, 66.235424, 168.908912, 66.235424),\n (168.908912, 66.235424, 165.069836, 66.235424),\n (165.069836, 66.235424, 161.230761, 66.235424),\n (161.230761, 66.235424, 157.391685, 66.235424),\n (157.391685, 66.235424, 153.55261, 66.235424),\n (153.55261, 66.235424, 149.713535, 66.235424),\n (149.713535, 66.235424, 145.874459, 66.235424),\n (145.874459, 66.235424, 142.035384, 66.235424),\n (142.035384, 66.235424, 138.196308, 66.235424),\n (138.196308, 66.235424, 134.357233, 66.235424),\n (134.357233, 66.235424, 130.518157, 66.235424),\n (130.518157, 66.235424, 126.679082, 66.235424),\n (126.679082, 66.235424, 122.840006, 66.235424),\n (122.840006, 66.235424, 119.000931, 66.235424),\n (119.000931, 66.235424, 115.161855, 66.235424),\n (115.161855, 66.235424, 111.32278, 66.235424),\n (111.32278, 66.235424, 107.483704, 66.235424),\n (107.483704, 66.235424, 103.644629, 66.235424),\n (103.644629, 66.235424, 99.805554, 66.235424),\n (99.805554, 66.235424, 95.966478, 66.235424),\n (95.966478, 66.235424, 92.127403, 66.235424),\n (92.127403, 66.235424, 88.288327, 66.235424),\n (88.288327, 66.235424, 84.449252, 66.235424),\n (84.449252, 66.235424, 80.610176, 66.235424),\n (80.610176, 66.235424, 76.771101, 66.235424),\n (76.771101, 66.235424, 72.932025, 66.235424),\n (72.932025, 66.235424, 72.932025, 61.949945),\n (195.78244, 61.949945, 191.943365, 61.949945),\n (191.943365, 61.949945, 188.104289, 61.949945),\n (188.104289, 61.949945, 184.265214, 61.949945),\n (184.265214, 61.949945, 180.426138, 61.949945),\n (180.426138, 61.949945, 176.587063, 61.949945),\n (176.587063, 61.949945, 172.747987, 61.949945),\n (172.747987, 61.949945, 168.908912, 61.949945),\n (168.908912, 61.949945, 165.069836, 61.949945),\n (165.069836, 61.949945, 161.230761, 61.949945),\n (161.230761, 61.949945, 157.391685, 61.949945),\n (157.391685, 61.949945, 153.55261, 61.949945),\n (153.55261, 61.949945, 149.713535, 61.949945),\n (149.713535, 61.949945, 145.874459, 61.949945),\n (145.874459, 61.949945, 142.035384, 61.949945),\n (142.035384, 61.949945, 138.196308, 61.949945),\n (138.196308, 61.949945, 134.357233, 61.949945),\n (134.357233, 61.949945, 130.518157, 61.949945),\n (130.518157, 61.949945, 126.679082, 61.949945),\n (126.679082, 61.949945, 122.840006, 61.949945),\n (122.840006, 61.949945, 119.000931, 61.949945),\n (119.000931, 61.949945, 115.161855, 61.949945),\n (115.161855, 61.949945, 111.32278, 61.949945),\n (111.32278, 61.949945, 107.483704, 61.949945),\n (107.483704, 61.949945, 103.644629, 61.949945),\n (103.644629, 61.949945, 99.805554, 61.949945),\n (99.805554, 61.949945, 95.966478, 61.949945),\n (95.966478, 61.949945, 92.127403, 61.949945),\n (92.127403, 61.949945, 88.288327, 61.949945),\n (88.288327, 61.949945, 84.449252, 61.949945),\n (84.449252, 61.949945, 80.610176, 61.949945),\n (80.610176, 61.949945, 76.771101, 61.949945),\n (76.771101, 61.949945, 72.932025, 61.949945),\n (209.78244, 80.235424, 214.06792, 80.235424),\n (209.78244, 172.049945, 214.06792, 172.049945),\n (209.78244, 172.049945, 209.78244, 169.221152),\n (209.78244, 169.221152, 209.78244, 166.39236),\n (209.78244, 166.39236, 209.78244, 163.563567),\n (209.78244, 163.563567, 209.78244, 160.734775),\n (209.78244, 160.734775, 209.78244, 157.905983),\n (209.78244, 157.905983, 209.78244, 155.07719),\n (209.78244, 155.07719, 209.78244, 152.248398),\n (209.78244, 152.248398, 209.78244, 149.419605),\n (209.78244, 149.419605, 209.78244, 146.590813),\n (209.78244, 146.590813, 209.78244, 143.76202),\n (209.78244, 143.76202, 209.78244, 140.933228),\n (209.78244, 140.933228, 209.78244, 138.104435),\n (209.78244, 138.104435, 209.78244, 135.275643),\n (209.78244, 135.275643, 209.78244, 132.446851),\n (209.78244, 132.446851, 209.78244, 129.618058),\n (209.78244, 129.618058, 209.78244, 126.789266),\n (209.78244, 126.789266, 209.78244, 123.960473),\n (209.78244, 123.960473, 209.78244, 121.131681),\n (209.78244, 121.131681, 209.78244, 118.302888),\n (209.78244, 118.302888, 209.78244, 115.474096),\n (209.78244, 115.474096, 209.78244, 112.645303),\n (209.78244, 112.645303, 209.78244, 109.816511),\n (209.78244, 109.816511, 209.78244, 106.987719),\n (209.78244, 106.987719, 209.78244, 104.158926),\n (209.78244, 104.158926, 209.78244, 101.330134),\n (209.78244, 101.330134, 209.78244, 98.501341),\n (209.78244, 98.501341, 209.78244, 95.672549),\n (209.78244, 95.672549, 209.78244, 92.843756),\n (209.78244, 92.843756, 209.78244, 90.014964),\n (209.78244, 90.014964, 209.78244, 87.186171),\n (209.78244, 87.186171, 209.78244, 84.357379),\n (209.78244, 84.357379, 209.78244, 81.528587),\n (209.78244, 81.528587, 214.06792, 81.528587),\n (214.06792, 172.049945, 214.06792, 169.221152),\n (214.06792, 169.221152, 214.06792, 166.39236),\n (214.06792, 166.39236, 214.06792, 163.563567),\n (214.06792, 163.563567, 214.06792, 160.734775),\n (214.06792, 160.734775, 214.06792, 157.905983),\n (214.06792, 157.905983, 214.06792, 155.07719),\n (214.06792, 155.07719, 214.06792, 152.248398),\n (214.06792, 152.248398, 214.06792, 149.419605),\n (214.06792, 149.419605, 214.06792, 146.590813),\n (214.06792, 146.590813, 214.06792, 143.76202),\n (214.06792, 143.76202, 214.06792, 140.933228),\n (214.06792, 140.933228, 214.06792, 138.104435),\n (214.06792, 138.104435, 214.06792, 135.275643),\n (214.06792, 135.275643, 214.06792, 132.446851),\n (214.06792, 132.446851, 214.06792, 129.618058),\n (214.06792, 129.618058, 214.06792, 126.789266),\n (214.06792, 126.789266, 214.06792, 123.960473),\n (214.06792, 123.960473, 214.06792, 121.131681),\n (214.06792, 121.131681, 214.06792, 118.302888),\n (214.06792, 118.302888, 214.06792, 115.474096),\n (214.06792, 115.474096, 214.06792, 112.645303),\n (214.06792, 112.645303, 214.06792, 109.816511),\n (214.06792, 109.816511, 214.06792, 106.987719),\n (214.06792, 106.987719, 214.06792, 104.158926),\n (214.06792, 104.158926, 214.06792, 101.330134),\n (214.06792, 101.330134, 214.06792, 98.501341),\n (214.06792, 98.501341, 214.06792, 95.672549),\n (214.06792, 95.672549, 214.06792, 92.843756),\n (214.06792, 92.843756, 214.06792, 90.014964),\n (214.06792, 90.014964, 214.06792, 87.186171),\n (214.06792, 87.186171, 214.06792, 84.357379),\n (214.06792, 84.357379, 214.06792, 81.528587),\n (214.06792, 81.528587, 214.06792, 80.235424),\n (209.78244, 81.528587, 209.78244, 80.235424)\n]\nVISIBLE_CIRCLES = [\n\n]\nVISIBLE_ARCS = [\n (202.099015, 35.176653, 133.143724, 92.719234, 160.219234),\n (202.094626, 34.859946, 137.335135, 92.634352, 160.134352)\n]\nHIDDEN_SEGMENTS = [\n (76.8115, 66.2355, 76.8115, 61.95),\n (209.7825, 168.1705, 214.0679, 168.1705)\n]\n# (orient, text, p1, p2, base) for linear; (orient, text, center, radius, angle) for diameter\nDIMENSIONS = [\n ('vertical', '2.5423', (195.7824, 168.1705), (195.7824, 172.05), (184.7824, 170.1103)),\n ('aligned', '2.6798', (72.9321, 81.5287), (76.8115, 80.2354), (78.3507, 91.3175)),\n ('radius', 'R87.2509', (202.0991, 35.1767), 133.1437, 45),\n ('radius', 'R89.9976', (202.0946, 34.8601), 137.3351, 45),\n ('horizontal', '2.8083', (209.7825, 80.2354), (214.0679, 80.2354), (211.9252, 91.2354))\n]\n\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; _ds.dxf.dimasz = 2.5\n _ds.dxf.dimexe = 1.25; _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\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\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,\n angle=(0 if d[0] == \"horizontal\" else 90),\n 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,\n 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,\n 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,\n text=text, dimstyle=\"EZDXF\").render()\n\n doc.saveas(out_path)\n\n\nif __name__ == \"__main__\":\n out = sys.argv[1] if len(sys.argv) > 1 else \"0063_00632535_gt.dxf\"\n draw(out)\n print(\"wrote\", out)\n```"}], "images": ["images/0063_00632535.png"], "id": "0063_00632535"} {"messages": [{"role": "user", "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 616.63 mm. The outline includes one or more oblique (angled) edges."}, {"role": "assistant", "content": "```python\n#!/usr/bin/env python3\n# -*- coding: utf-8 -*-\n# Ground-truth 2D engineering drawing for part: 0063_00636458\n# Self-contained: reproduces the three-view DXF via ezdxf, NO FreeCAD needed.\n# Coordinates are A4 page millimetres (scale=0.1324004657661871, page=[297.0, 210.0]).\n# visible edges -> solid (layer OUTLINE); hidden edges -> dashed (layer HIDDEN)\n# dimensions -> real movable DIMENSION entities (text = true mm value)\n# Run: python 0063_00636458_gt.py [out.dxf]\nimport sys\nimport ezdxf\nimport math\n\nSCALE = 0.1324004657661871\nPAGE = [297.0, 210.0]\n\nVISIBLE_SEGMENTS = [\n (89.058738, 157.592478, 102.298784, 157.592478),\n (102.907522, 158.201216, 102.907522, 171.441262),\n (102.298784, 172.05, 89.058738, 172.05),\n (88.45, 171.441262, 88.45, 158.201216),\n (102.907522, 143.592478, 102.907522, 61.95),\n (102.907522, 143.592478, 102.298784, 143.592478),\n (102.907522, 61.95, 102.298784, 61.95),\n (102.298784, 61.95, 89.058738, 61.95),\n (102.298784, 143.592478, 89.058738, 143.592478),\n (89.058738, 143.592478, 88.45, 143.592478),\n (88.45, 143.592478, 88.45, 61.95),\n (89.058738, 61.95, 88.45, 61.95),\n (102.298784, 143.592478, 102.298784, 61.95),\n (89.058738, 143.592478, 89.058738, 61.95),\n (116.907522, 158.201216, 116.907522, 157.592478),\n (116.907522, 157.592478, 198.55, 157.592478),\n (198.55, 158.201216, 198.55, 157.592478),\n (116.907522, 172.05, 198.55, 172.05),\n (116.907522, 172.05, 116.907522, 171.441262),\n (198.55, 172.05, 198.55, 171.441262),\n (198.55, 171.441262, 198.55, 158.201216),\n (116.907522, 171.441262, 116.907522, 158.201216),\n (116.907522, 158.201216, 198.55, 158.201216),\n (116.907522, 171.441262, 198.55, 171.441262)\n]\nVISIBLE_CIRCLES = [\n\n]\nVISIBLE_ARCS = [\n (89.058738, 158.201216, 0.608738, -180.0, -90.0),\n (102.298784, 158.201216, 0.608738, -90.0, -0.0),\n (102.298784, 171.441262, 0.608738, -0.0, 90.0),\n (89.058738, 171.441262, 0.608738, 90.0, -180.0)\n]\nHIDDEN_SEGMENTS = [\n\n]\n# (orient, text, p1, p2, base) for linear; (orient, text, center, radius, angle) for diameter\nDIMENSIONS = [\n ('horizontal', '100', (89.0587, 157.5925), (102.2988, 157.5925), (95.6788, 168.5925)),\n ('vertical', '100', (102.9075, 158.2012), (102.9075, 171.4413), (91.9075, 164.8212)),\n ('radius', 'R4.5977', (89.0587, 158.2012), 0.6087, 45),\n ('horizontal', '616.633', (116.9075, 158.2012), (198.55, 158.2012), (157.7288, 169.2012))\n]\n\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; _ds.dxf.dimasz = 2.5\n _ds.dxf.dimexe = 1.25; _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\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\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,\n angle=(0 if d[0] == \"horizontal\" else 90),\n 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,\n 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,\n 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,\n text=text, dimstyle=\"EZDXF\").render()\n\n doc.saveas(out_path)\n\n\nif __name__ == \"__main__\":\n out = sys.argv[1] if len(sys.argv) > 1 else \"0063_00636458_gt.dxf\"\n draw(out)\n print(\"wrote\", out)\n```"}], "images": ["images/0063_00636458.png"], "id": "0063_00636458"} {"messages": [{"role": "user", "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 2.01 mm. It is extruded to a thickness of 1.11 mm. The outline includes one or more oblique (angled) edges."}, {"role": "assistant", "content": "```python\n#!/usr/bin/env python3\n# -*- coding: utf-8 -*-\n# Ground-truth 2D engineering drawing for part: 0063_00636812\n# Self-contained: reproduces the three-view DXF via ezdxf, NO FreeCAD needed.\n# Coordinates are A4 page millimetres (scale=0.5975504462896026, page=[297.0, 210.0]).\n# visible edges -> solid (layer OUTLINE); hidden edges -> dashed (layer HIDDEN)\n# dimensions -> real movable DIMENSION entities (text = true mm value)\n# Run: python 0063_00636812_gt.py [out.dxf]\nimport sys\nimport ezdxf\nimport math\n\nSCALE = 0.5975504462896026\nPAGE = [297.0, 210.0]\n\nVISIBLE_SEGMENTS = [\n (121.081619, 147.516026, 128.300755, 149.922405),\n (128.300755, 149.922405, 144.543813, 98.786853),\n (144.543813, 98.786853, 136.723081, 96.380474),\n (137.324676, 93.372501, 152.966139, 98.185258),\n (152.966139, 98.185258, 135.519892, 155.336757),\n (135.519892, 155.336757, 119.878429, 150.523999),\n (119.878429, 79.342716, 119.878429, 78.678163),\n (152.966139, 79.342716, 152.966139, 78.678163),\n (152.966139, 78.678163, 135.519892, 78.678163),\n (135.519892, 79.342716, 135.519892, 78.678163),\n (152.966139, 79.342716, 135.519892, 79.342716),\n (135.519892, 78.678163, 119.878429, 78.678163),\n (135.519892, 79.342716, 119.878429, 79.342716),\n (118.86018, 78.678163, 118.86018, 79.342716),\n (166.966139, 150.523999, 166.966139, 150.42638),\n (166.966139, 150.42638, 166.966139, 150.32876),\n (166.966139, 150.32876, 166.966139, 150.23114),\n (166.966139, 150.23114, 166.966139, 150.133521),\n (166.966139, 150.133521, 166.966139, 150.035901),\n (166.966139, 150.035901, 166.966139, 149.938281),\n (166.966139, 149.938281, 166.966139, 149.840662),\n (166.966139, 149.840662, 166.966139, 149.743042),\n (166.966139, 149.743042, 166.966139, 149.645422),\n (166.966139, 149.645422, 166.966139, 149.547803),\n (166.966139, 149.547803, 166.966139, 149.450183),\n (166.966139, 149.450183, 166.966139, 149.352563),\n (166.966139, 149.352563, 166.966139, 149.254943),\n (166.966139, 149.254943, 166.966139, 149.157324),\n (166.966139, 149.157324, 166.966139, 149.059704),\n (166.966139, 149.059704, 166.966139, 148.962084),\n (166.966139, 148.962084, 166.966139, 148.864465),\n (166.966139, 148.864465, 166.966139, 148.766845),\n (166.966139, 148.766845, 166.966139, 148.669225),\n (166.966139, 148.669225, 166.966139, 148.571606),\n (166.966139, 148.571606, 166.966139, 148.473986),\n (166.966139, 148.473986, 166.966139, 148.376366),\n (166.966139, 148.376366, 166.966139, 148.278746),\n (166.966139, 148.278746, 166.966139, 148.181127),\n (166.966139, 148.181127, 166.966139, 148.083507),\n (166.966139, 148.083507, 166.966139, 147.985887),\n (166.966139, 147.985887, 166.966139, 147.888268),\n (166.966139, 147.888268, 166.966139, 147.790648),\n (166.966139, 147.790648, 166.966139, 147.693028),\n (166.966139, 147.693028, 166.966139, 147.595409),\n (166.966139, 147.595409, 166.966139, 147.497789),\n (166.966139, 147.497789, 166.966139, 147.400169),\n (166.966139, 150.523999, 167.630691, 150.523999),\n (167.630691, 147.400169, 167.630691, 98.786853),\n (166.966139, 98.786853, 167.630691, 98.786853),\n (166.966139, 147.400169, 166.966139, 98.786853),\n (167.630691, 98.786853, 167.630691, 96.380474),\n (166.966139, 96.380474, 167.630691, 96.380474),\n (166.966139, 98.786853, 166.966139, 96.380474),\n (166.966139, 155.336757, 167.630691, 155.336757),\n (167.630691, 155.336757, 167.630691, 150.523999),\n (166.966139, 155.336757, 166.966139, 150.523999),\n (167.630691, 147.400169, 166.966139, 147.400169),\n (167.630691, 93.342716, 166.966139, 93.342716)\n]\nVISIBLE_CIRCLES = [\n (120.480024, 148.719215, 0.601595),\n (137.324676, 95.177285, 0.601595)\n]\nVISIBLE_ARCS = [\n (120.480024, 149.020013, 1.619843, 111.801409, -68.198591),\n (137.023879, 94.876487, 1.533772, 101.309932, -78.690068),\n (135.370101, 558.786864, 479.711358, -91.972232, -91.850682),\n (131.370182, -211.740151, 290.66655, 92.265992, 92.466537),\n (-12078.034918, 243.006403, 12246.027637, -0.447319, -0.432704),\n (2550.067646, 124.339736, 2383.281572, -179.32782, -179.254795),\n (576.187304, 88.228625, 408.613811, 178.85694, 179.28284)\n]\nHIDDEN_SEGMENTS = [\n (121.0816, 79.3427, 121.0816, 78.6781),\n (128.3008, 79.3427, 128.3008, 78.6781),\n (144.5438, 79.3427, 144.5438, 78.6781),\n (136.7231, 79.3427, 136.7231, 78.6781),\n (137.3247, 79.3427, 137.3247, 78.6781),\n (137.9263, 79.3427, 137.9263, 78.6781),\n (136.7231, 78.6781, 136.7231, 79.3427),\n (166.9661, 149.9224, 167.6307, 149.9224),\n (166.9661, 98.1852, 167.6307, 98.1852),\n (167.6307, 149.3208, 166.9661, 149.3208),\n (167.6307, 148.1176, 166.9661, 148.1176),\n (167.6307, 95.7789, 166.9661, 95.7789),\n (167.6307, 94.5757, 166.9661, 94.5757)\n]\n# (orient, text, p1, p2, base) for linear; (orient, text, center, radius, angle) for diameter\nDIMENSIONS = [\n ('aligned', '12.7347', (121.0816, 147.516), (128.3008, 149.9224), (121.2127, 159.1547)),\n ('aligned', '89.7888', (128.3008, 149.9224), (144.5438, 98.7869), (146.9061, 127.6848)),\n ('aligned', '13.6935', (144.5438, 98.7869), (136.7231, 96.3805), (143.8684, 87.0701)),\n ('aligned', '27.3871', (137.3247, 93.3725), (152.9661, 98.1852), (141.9105, 106.2925)),\n ('aligned', '100', (152.9661, 98.1852), (135.5199, 155.3368), (133.7223, 123.5494)),\n ('aligned', '27.3871', (135.5199, 155.3368), (119.8784, 150.524), (130.9341, 142.4168)),\n ('diameter', '%%c2.0135', (120.48, 148.7192), 0.6016, 45),\n ('horizontal', '1.0068', (119.8784, 148.7192), (120.48, 148.7192), (120.1792, 159.7192)),\n ('vertical', '92.6227', (120.48, 93.3725), (120.48, 148.7192), (109.48, 121.0458)),\n ('diameter', '%%c2.0135', (137.3247, 95.1773), 0.6016, 45),\n ('horizontal', '29.1963', (119.8784, 95.1773), (137.3247, 95.1773), (128.6015, 106.1773)),\n ('vertical', '3.0203', (137.3247, 93.3725), (137.3247, 95.1773), (126.3247, 94.2749)),\n ('radius', 'R2.7108', (120.48, 149.02), 1.6198, 45),\n ('radius', 'R2.5668', (137.0239, 94.8765), 1.5338, 45),\n ('horizontal', '1.1121', (166.9661, 150.524), (167.6307, 150.524), (167.2984, 161.524))\n]\n\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; _ds.dxf.dimasz = 2.5\n _ds.dxf.dimexe = 1.25; _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\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\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,\n angle=(0 if d[0] == \"horizontal\" else 90),\n 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,\n 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,\n 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,\n text=text, dimstyle=\"EZDXF\").render()\n\n doc.saveas(out_path)\n\n\nif __name__ == \"__main__\":\n out = sys.argv[1] if len(sys.argv) > 1 else \"0063_00636812_gt.dxf\"\n draw(out)\n print(\"wrote\", out)\n```"}], "images": ["images/0063_00636812.png"], "id": "0063_00636812"} {"messages": [{"role": "user", "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 53.7 mm. The outline includes one or more oblique (angled) edges."}, {"role": "assistant", "content": "```python\n#!/usr/bin/env python3\n# -*- coding: utf-8 -*-\n# Ground-truth 2D engineering drawing for part: 0067_00678418\n# Self-contained: reproduces the three-view DXF via ezdxf, NO FreeCAD needed.\n# Coordinates are A4 page millimetres (scale=1.0991574803150337, page=[297.0, 210.0]).\n# visible edges -> solid (layer OUTLINE); hidden edges -> dashed (layer HIDDEN)\n# dimensions -> real movable DIMENSION entities (text = true mm value)\n# Run: python 0067_00678418_gt.py [out.dxf]\nimport sys\nimport ezdxf\nimport math\n\nSCALE = 1.0991574803150337\nPAGE = [297.0, 210.0]\n\nVISIBLE_SEGMENTS = [\n (160.786455, 135.002336, 58.969762, 135.002336),\n (52.027715, 172.026588, 161.943463, 172.026588),\n (161.943463, 61.973508, 161.943463, 121.002336),\n (52.027715, 61.973508, 52.027715, 121.002336),\n (52.027715, 121.002336, 161.943463, 121.002336),\n (52.027715, 61.973508, 161.943463, 61.973508),\n (234.97229, 135.002336, 175.943463, 135.002336),\n (175.943463, 135.002336, 175.943463, 136.159344),\n (175.943463, 136.159344, 175.943463, 137.316352),\n (175.943463, 137.316352, 175.943463, 138.47336),\n (175.943463, 138.47336, 175.943463, 139.630368),\n (175.943463, 139.630368, 175.943463, 140.787375),\n (175.943463, 140.787375, 175.943463, 141.944383),\n (175.943463, 141.944383, 175.943463, 143.101391),\n (175.943463, 143.101391, 175.943463, 144.258399),\n (175.943463, 144.258399, 175.943463, 145.415407),\n (175.943463, 145.415407, 175.943463, 146.572415),\n (175.943463, 146.572415, 175.943463, 147.729423),\n (175.943463, 147.729423, 175.943463, 148.886431),\n (175.943463, 148.886431, 175.943463, 150.043438),\n (175.943463, 150.043438, 175.943463, 151.200446),\n (175.943463, 151.200446, 175.943463, 152.357454),\n (175.943463, 152.357454, 175.943463, 153.514462),\n (175.943463, 153.514462, 175.943463, 154.67147),\n (175.943463, 154.67147, 175.943463, 155.828478),\n (175.943463, 155.828478, 175.943463, 156.985486),\n (175.943463, 156.985486, 175.943463, 158.142494),\n (175.943463, 158.142494, 175.943463, 159.299501),\n (175.943463, 159.299501, 175.943463, 160.456509),\n (175.943463, 160.456509, 175.943463, 161.613517),\n (175.943463, 161.613517, 175.943463, 162.770525),\n (175.943463, 162.770525, 175.943463, 163.927533),\n (175.943463, 163.927533, 175.943463, 165.084541),\n (175.943463, 165.084541, 175.943463, 166.241549),\n (175.943463, 166.241549, 175.943463, 167.398556),\n (175.943463, 167.398556, 175.943463, 168.555564),\n (175.943463, 168.555564, 175.943463, 169.712572),\n (175.943463, 169.712572, 175.943463, 170.86958),\n (175.943463, 170.86958, 175.943463, 172.026588),\n (234.97229, 172.026588, 175.943463, 172.026588),\n (234.97229, 135.002336, 234.97229, 136.159344),\n (234.97229, 136.159344, 234.97229, 137.316352),\n (234.97229, 137.316352, 234.97229, 138.47336),\n (234.97229, 138.47336, 234.97229, 139.630368),\n (234.97229, 139.630368, 234.97229, 140.787375),\n (234.97229, 140.787375, 234.97229, 141.944383),\n (234.97229, 141.944383, 234.97229, 143.101391),\n (234.97229, 143.101391, 234.97229, 144.258399),\n (234.97229, 144.258399, 234.97229, 145.415407),\n (234.97229, 145.415407, 234.97229, 146.572415),\n (234.97229, 146.572415, 234.97229, 147.729423),\n (234.97229, 147.729423, 234.97229, 148.886431),\n (234.97229, 148.886431, 234.97229, 150.043438),\n (234.97229, 150.043438, 234.97229, 151.200446),\n (234.97229, 151.200446, 234.97229, 152.357454),\n (234.97229, 152.357454, 234.97229, 153.514462),\n (234.97229, 153.514462, 234.97229, 154.67147),\n (234.97229, 154.67147, 234.97229, 155.828478),\n (234.97229, 155.828478, 234.97229, 156.985486),\n (234.97229, 156.985486, 234.97229, 158.142494),\n (234.97229, 158.142494, 234.97229, 159.299501),\n (234.97229, 159.299501, 234.97229, 160.456509),\n (234.97229, 160.456509, 234.97229, 161.613517),\n (234.97229, 161.613517, 234.97229, 162.770525),\n (234.97229, 162.770525, 234.97229, 163.927533),\n (234.97229, 163.927533, 234.97229, 165.084541),\n (234.97229, 165.084541, 234.97229, 166.241549),\n (234.97229, 166.241549, 234.97229, 167.398556),\n (234.97229, 167.398556, 234.97229, 168.555564),\n (234.97229, 168.555564, 234.97229, 169.712572),\n (234.97229, 169.712572, 234.97229, 170.86958),\n (234.97229, 170.86958, 234.97229, 172.026588)\n]\nVISIBLE_CIRCLES = [\n\n]\nVISIBLE_ARCS = [\n (248.80938, 150.781824, 89.426101, 166.256964, -169.836786),\n (-26.939502, 138.057292, 85.963565, -2.036595, 23.275905)\n]\nHIDDEN_SEGMENTS = [\n (160.7865, 61.9735, 160.7865, 121.0023),\n (58.9698, 61.9735, 58.9698, 121.0023),\n (159.3833, 121.0023, 159.3833, 61.9735),\n (59.0241, 121.0023, 59.0241, 61.9735)\n]\n# (orient, text, p1, p2, base) for linear; (orient, text, center, radius, angle) for diameter\nDIMENSIONS = [\n ('horizontal', '92.6316', (160.7865, 135.0023), (58.9697, 135.0023), (109.8781, 124.0023)),\n ('horizontal', '100', (52.0277, 172.0266), (161.9434, 172.0266), (106.9856, 183.0266)),\n ('radius', 'R81.3588', (248.8094, 150.7817), 89.4261, 45),\n ('radius', 'R78.2086', (-26.9395, 138.0572), 85.9636, 45),\n ('horizontal', '53.7037', (234.9723, 172.0266), (175.9435, 172.0266), (205.4579, 161.0266))\n]\n\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; _ds.dxf.dimasz = 2.5\n _ds.dxf.dimexe = 1.25; _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\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\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,\n angle=(0 if d[0] == \"horizontal\" else 90),\n 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,\n 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,\n 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,\n text=text, dimstyle=\"EZDXF\").render()\n\n doc.saveas(out_path)\n\n\nif __name__ == \"__main__\":\n out = sys.argv[1] if len(sys.argv) > 1 else \"0067_00678418_gt.dxf\"\n draw(out)\n print(\"wrote\", out)\n```"}], "images": ["images/0067_00678418.png"], "id": "0067_00678418"} {"messages": [{"role": "user", "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 115.66 mm."}, {"role": "assistant", "content": "```python\n#!/usr/bin/env python3\n# -*- coding: utf-8 -*-\n# Ground-truth 2D engineering drawing for part: 0068_00681923\n# Self-contained: reproduces the three-view DXF via ezdxf, NO FreeCAD needed.\n# Coordinates are A4 page millimetres (scale=0.7251659351022314, page=[297.0, 210.0]).\n# visible edges -> solid (layer OUTLINE); hidden edges -> dashed (layer HIDDEN)\n# dimensions -> real movable DIMENSION entities (text = true mm value)\n# Run: python 0068_00681923_gt.py [out.dxf]\nimport sys\nimport ezdxf\nimport math\n\nSCALE = 0.7251659351022314\nPAGE = [297.0, 210.0]\n\nVISIBLE_SEGMENTS = [\n (58.304396, 175.106347, 130.82099, 175.106347),\n (58.304396, 65.006346, 58.304396, 148.880961),\n (130.82099, 65.006346, 130.82099, 148.880961),\n (58.304396, 148.880961, 130.82099, 148.880961),\n (58.304396, 65.006346, 130.82099, 65.006346),\n (228.695604, 162.880961, 228.695604, 175.106347),\n (228.695604, 175.106347, 144.82099, 175.106347),\n (144.82099, 162.880961, 144.82099, 175.106347),\n (144.82099, 162.880961, 228.695604, 162.880961)\n]\nVISIBLE_CIRCLES = [\n\n]\nVISIBLE_ARCS = [\n (94.562693, 222.761449, 59.880488, -127.265625, -52.734375)\n]\nHIDDEN_SEGMENTS = [\n\n]\n# (orient, text, p1, p2, base) for linear; (orient, text, center, radius, angle) for diameter\nDIMENSIONS = [\n ('horizontal', '100', (130.821, 175.1063), (58.3044, 175.1063), (94.5627, 164.1063)),\n ('radius', 'R82.5749', (94.5627, 222.7615), 59.8805, 45),\n ('horizontal', '115.663', (228.6956, 175.1063), (144.821, 175.1063), (186.7583, 164.1063))\n]\n\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; _ds.dxf.dimasz = 2.5\n _ds.dxf.dimexe = 1.25; _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\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\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,\n angle=(0 if d[0] == \"horizontal\" else 90),\n 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,\n 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,\n 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,\n text=text, dimstyle=\"EZDXF\").render()\n\n doc.saveas(out_path)\n\n\nif __name__ == \"__main__\":\n out = sys.argv[1] if len(sys.argv) > 1 else \"0068_00681923_gt.dxf\"\n draw(out)\n print(\"wrote\", out)\n```"}], "images": ["images/0068_00681923.png"], "id": "0068_00681923"} {"messages": [{"role": "user", "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 111.11 x 104.94 mm. It is extruded to a thickness of 204.71 mm. The outline includes one or more oblique (angled) edges."}, {"role": "assistant", "content": "```python\n#!/usr/bin/env python3\n# -*- coding: utf-8 -*-\n# Ground-truth 2D engineering drawing for part: 0068_00682140\n# Self-contained: reproduces the three-view DXF via ezdxf, NO FreeCAD needed.\n# Coordinates are A4 page millimetres (scale=0.2984492854653251, page=[297.0, 210.0]).\n# visible edges -> solid (layer OUTLINE); hidden edges -> dashed (layer HIDDEN)\n# dimensions -> real movable DIMENSION entities (text = true mm value)\n# Run: python 0068_00682140_gt.py [out.dxf]\nimport sys\nimport ezdxf\nimport math\n\nSCALE = 0.2984492854653251\nPAGE = [297.0, 210.0]\n\nVISIBLE_SEGMENTS = [\n (91.029191, 137.046689, 120.87412, 137.046689),\n (123.453311, 139.62588, 123.453311, 169.470809),\n (120.87412, 172.05, 91.029191, 172.05),\n (88.45, 169.470809, 88.45, 139.62588),\n (121.611032, 139.62588, 121.611032, 169.470809),\n (91.029191, 138.888968, 120.87412, 138.888968),\n (90.292279, 139.62588, 88.45, 139.62588),\n (90.292279, 169.470809, 90.292279, 139.62588),\n (120.87412, 170.207721, 91.029191, 170.207721),\n (123.453311, 123.046689, 123.453311, 61.95),\n (123.453311, 123.046689, 120.87412, 123.046689),\n (123.453311, 61.95, 120.87412, 61.95),\n (120.87412, 61.95, 91.029191, 61.95),\n (120.87412, 123.046689, 91.029191, 123.046689),\n (91.029191, 123.046689, 88.45, 123.046689),\n (88.45, 123.046689, 88.45, 61.95),\n (91.029191, 61.95, 88.45, 61.95),\n (120.87412, 123.046689, 120.87412, 61.95),\n (91.029191, 123.046689, 91.029191, 61.95),\n (137.453311, 139.62588, 137.453311, 137.046689),\n (137.453311, 137.046689, 198.55, 137.046689),\n (198.55, 139.62588, 198.55, 137.046689),\n (137.453311, 172.05, 198.55, 172.05),\n (137.453311, 172.05, 137.453311, 169.470809),\n (198.55, 172.05, 198.55, 169.470809),\n (198.55, 169.470809, 198.55, 139.62588),\n (137.453311, 169.470809, 137.453311, 139.62588),\n (137.453311, 139.62588, 198.55, 139.62588),\n (137.453311, 169.470809, 198.55, 169.470809)\n]\nVISIBLE_CIRCLES = [\n\n]\nVISIBLE_ARCS = [\n (91.029191, 139.62588, 2.579191, 180.0, -90.0),\n (120.87412, 139.62588, 2.579191, -90.0, -0.0),\n (120.87412, 169.470809, 2.579191, -0.0, 90.0),\n (91.029191, 169.470809, 2.579191, 90.0, -180.0),\n (120.87412, 169.470809, 0.736912, -0.0, 90.0),\n (120.87412, 139.62588, 0.736912, -90.0, -0.0),\n (90.108051, 140.54702, 1.896743, -150.945396, -60.945396),\n (91.029191, 169.470809, 0.736912, 90.0, -180.0)\n]\nHIDDEN_SEGMENTS = [\n (121.611, 123.0467, 121.611, 61.95),\n (90.2923, 123.0467, 90.2923, 61.95),\n (137.4533, 170.2077, 198.55, 170.2077),\n (137.4533, 138.889, 198.55, 138.889),\n (198.55, 138.6503, 137.4533, 138.6503)\n]\n# (orient, text, p1, p2, base) for linear; (orient, text, center, radius, angle) for diameter\nDIMENSIONS = [\n ('horizontal', '100', (91.0292, 137.0467), (120.8741, 137.0467), (105.9517, 148.0467)),\n ('vertical', '100', (123.4533, 139.6259), (123.4533, 169.4708), (112.4533, 154.5483)),\n ('horizontal', '111.111', (88.45, 138.889), (121.611, 138.889), (105.0305, 149.889)),\n ('vertical', '104.938', (88.45, 138.889), (88.45, 170.2077), (77.45, 154.5483)),\n ('vertical', '6.1728', (88.45, 137.0467), (88.45, 138.889), (77.45, 137.9678)),\n ('radius', 'R8.642', (91.0292, 139.6259), 2.5792, 45),\n ('radius', 'R6.3553', (90.1081, 140.547), 1.8967, 45),\n ('radius', 'R2.4691', (120.8741, 139.6259), 0.7369, 45),\n ('horizontal', '204.714', (137.4533, 139.6259), (198.55, 139.6259), (168.0017, 150.6259))\n]\n\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; _ds.dxf.dimasz = 2.5\n _ds.dxf.dimexe = 1.25; _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\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\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,\n angle=(0 if d[0] == \"horizontal\" else 90),\n 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,\n 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,\n 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,\n text=text, dimstyle=\"EZDXF\").render()\n\n doc.saveas(out_path)\n\n\nif __name__ == \"__main__\":\n out = sys.argv[1] if len(sys.argv) > 1 else \"0068_00682140_gt.dxf\"\n draw(out)\n print(\"wrote\", out)\n```"}], "images": ["images/0068_00682140.png"], "id": "0068_00682140"} {"messages": [{"role": "user", "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 5 circular holes, each of diameter 2.25 mm. It is extruded to a thickness of 3.34 mm. The outline includes one or more oblique (angled) edges."}, {"role": "assistant", "content": "```python\n#!/usr/bin/env python3\n# -*- coding: utf-8 -*-\n# Ground-truth 2D engineering drawing for part: 0068_00682319\n# Self-contained: reproduces the three-view DXF via ezdxf, NO FreeCAD needed.\n# Coordinates are A4 page millimetres (scale=1.22238856632425, page=[297.0, 210.0]).\n# visible edges -> solid (layer OUTLINE); hidden edges -> dashed (layer HIDDEN)\n# dimensions -> real movable DIMENSION entities (text = true mm value)\n# Run: python 0068_00682319_gt.py [out.dxf]\nimport sys\nimport ezdxf\nimport math\n\nSCALE = 1.22238856632425\nPAGE = [297.0, 210.0]\n\nVISIBLE_SEGMENTS = [\n (73.341821, 80.027494, 195.580678, 80.027494),\n (199.701089, 84.147905, 199.701089, 167.929593),\n (195.580678, 172.050004, 73.341821, 172.050004),\n (69.22141, 167.929593, 69.22141, 84.147905),\n (199.701089, 66.027494, 199.701089, 61.950004),\n (195.580678, 61.950004, 73.341821, 61.950004),\n (195.580678, 66.027494, 73.341821, 66.027494),\n (73.341821, 66.027494, 73.213058, 66.027494),\n (73.213058, 66.027494, 73.084296, 66.027494),\n (73.084296, 66.027494, 72.955533, 66.027494),\n (72.955533, 66.027494, 72.82677, 66.027494),\n (72.82677, 66.027494, 72.698007, 66.027494),\n (72.698007, 66.027494, 72.569244, 66.027494),\n (72.569244, 66.027494, 72.440481, 66.027494),\n (72.440481, 66.027494, 72.311719, 66.027494),\n (72.311719, 66.027494, 72.182956, 66.027494),\n (72.182956, 66.027494, 72.054193, 66.027494),\n (72.054193, 66.027494, 71.92543, 66.027494),\n (71.92543, 66.027494, 71.796667, 66.027494),\n (71.796667, 66.027494, 71.667904, 66.027494),\n (71.667904, 66.027494, 71.539142, 66.027494),\n (71.539142, 66.027494, 71.410379, 66.027494),\n (71.410379, 66.027494, 71.281616, 66.027494),\n (71.281616, 66.027494, 71.152853, 66.027494),\n (71.152853, 66.027494, 71.02409, 66.027494),\n (71.02409, 66.027494, 70.895327, 66.027494),\n (70.895327, 66.027494, 70.766564, 66.027494),\n (70.766564, 66.027494, 70.637802, 66.027494),\n (70.637802, 66.027494, 70.509039, 66.027494),\n (70.509039, 66.027494, 70.380276, 66.027494),\n (70.380276, 66.027494, 70.251513, 66.027494),\n (70.251513, 66.027494, 70.12275, 66.027494),\n (70.12275, 66.027494, 69.993987, 66.027494),\n (69.993987, 66.027494, 69.865225, 66.027494),\n (69.865225, 66.027494, 69.736462, 66.027494),\n (69.736462, 66.027494, 69.607699, 66.027494),\n (69.607699, 66.027494, 69.478936, 66.027494),\n (69.478936, 66.027494, 69.350173, 66.027494),\n (69.350173, 66.027494, 69.22141, 66.027494),\n (69.22141, 66.027494, 69.22141, 61.950004),\n (73.341821, 61.950004, 73.213058, 61.950004),\n (73.213058, 61.950004, 73.084296, 61.950004),\n (73.084296, 61.950004, 72.955533, 61.950004),\n (72.955533, 61.950004, 72.82677, 61.950004),\n (72.82677, 61.950004, 72.698007, 61.950004),\n (72.698007, 61.950004, 72.569244, 61.950004),\n (72.569244, 61.950004, 72.440481, 61.950004),\n (72.440481, 61.950004, 72.311719, 61.950004),\n (72.311719, 61.950004, 72.182956, 61.950004),\n (72.182956, 61.950004, 72.054193, 61.950004),\n (72.054193, 61.950004, 71.92543, 61.950004),\n (71.92543, 61.950004, 71.796667, 61.950004),\n (71.796667, 61.950004, 71.667904, 61.950004),\n (71.667904, 61.950004, 71.539142, 61.950004),\n (71.539142, 61.950004, 71.410379, 61.950004),\n (71.410379, 61.950004, 71.281616, 61.950004),\n (71.281616, 61.950004, 71.152853, 61.950004),\n (71.152853, 61.950004, 71.02409, 61.950004),\n (71.02409, 61.950004, 70.895327, 61.950004),\n (70.895327, 61.950004, 70.766564, 61.950004),\n (70.766564, 61.950004, 70.637802, 61.950004),\n (70.637802, 61.950004, 70.509039, 61.950004),\n (70.509039, 61.950004, 70.380276, 61.950004),\n (70.380276, 61.950004, 70.251513, 61.950004),\n (70.251513, 61.950004, 70.12275, 61.950004),\n (70.12275, 61.950004, 69.993987, 61.950004),\n (69.993987, 61.950004, 69.865225, 61.950004),\n (69.865225, 61.950004, 69.736462, 61.950004),\n (69.736462, 61.950004, 69.607699, 61.950004),\n (69.607699, 61.950004, 69.478936, 61.950004),\n (69.478936, 61.950004, 69.350173, 61.950004),\n (69.350173, 61.950004, 69.22141, 61.950004),\n (195.580678, 66.027494, 195.580678, 61.950004),\n (73.341821, 66.027494, 73.341821, 61.950004),\n (213.701089, 84.147905, 213.701089, 84.019142),\n (213.701089, 84.019142, 213.701089, 83.890379),\n (213.701089, 83.890379, 213.701089, 83.761616),\n (213.701089, 83.761616, 213.701089, 83.632853),\n (213.701089, 83.632853, 213.701089, 83.50409),\n (213.701089, 83.50409, 213.701089, 83.375328),\n (213.701089, 83.375328, 213.701089, 83.246565),\n (213.701089, 83.246565, 213.701089, 83.117802),\n (213.701089, 83.117802, 213.701089, 82.989039),\n (213.701089, 82.989039, 213.701089, 82.860276),\n (213.701089, 82.860276, 213.701089, 82.731513),\n (213.701089, 82.731513, 213.701089, 82.602751),\n (213.701089, 82.602751, 213.701089, 82.473988),\n (213.701089, 82.473988, 213.701089, 82.345225),\n (213.701089, 82.345225, 213.701089, 82.216462),\n (213.701089, 82.216462, 213.701089, 82.087699),\n (213.701089, 82.087699, 213.701089, 81.958936),\n (213.701089, 81.958936, 213.701089, 81.830174),\n (213.701089, 81.830174, 213.701089, 81.701411),\n (213.701089, 81.701411, 213.701089, 81.572648),\n (213.701089, 81.572648, 213.701089, 81.443885),\n (213.701089, 81.443885, 213.701089, 81.315122),\n (213.701089, 81.315122, 213.701089, 81.186359),\n (213.701089, 81.186359, 213.701089, 81.057597),\n (213.701089, 81.057597, 213.701089, 80.928834),\n (213.701089, 80.928834, 213.701089, 80.800071),\n (213.701089, 80.800071, 213.701089, 80.671308),\n (213.701089, 80.671308, 213.701089, 80.542545),\n (213.701089, 80.542545, 213.701089, 80.413782),\n (213.701089, 80.413782, 213.701089, 80.285019),\n (213.701089, 80.285019, 213.701089, 80.156257),\n (213.701089, 80.156257, 213.701089, 80.027494),\n (213.701089, 80.027494, 217.778579, 80.027494),\n (217.778579, 84.147905, 217.778579, 84.019142),\n (217.778579, 84.019142, 217.778579, 83.890379),\n (217.778579, 83.890379, 217.778579, 83.761616),\n (217.778579, 83.761616, 217.778579, 83.632853),\n (217.778579, 83.632853, 217.778579, 83.50409),\n (217.778579, 83.50409, 217.778579, 83.375328),\n (217.778579, 83.375328, 217.778579, 83.246565),\n (217.778579, 83.246565, 217.778579, 83.117802),\n (217.778579, 83.117802, 217.778579, 82.989039),\n (217.778579, 82.989039, 217.778579, 82.860276),\n (217.778579, 82.860276, 217.778579, 82.731513),\n (217.778579, 82.731513, 217.778579, 82.602751),\n (217.778579, 82.602751, 217.778579, 82.473988),\n (217.778579, 82.473988, 217.778579, 82.345225),\n (217.778579, 82.345225, 217.778579, 82.216462),\n (217.778579, 82.216462, 217.778579, 82.087699),\n (217.778579, 82.087699, 217.778579, 81.958936),\n (217.778579, 81.958936, 217.778579, 81.830174),\n (217.778579, 81.830174, 217.778579, 81.701411),\n (217.778579, 81.701411, 217.778579, 81.572648),\n (217.778579, 81.572648, 217.778579, 81.443885),\n (217.778579, 81.443885, 217.778579, 81.315122),\n (217.778579, 81.315122, 217.778579, 81.186359),\n (217.778579, 81.186359, 217.778579, 81.057597),\n (217.778579, 81.057597, 217.778579, 80.928834),\n (217.778579, 80.928834, 217.778579, 80.800071),\n (217.778579, 80.800071, 217.778579, 80.671308),\n (217.778579, 80.671308, 217.778579, 80.542545),\n (217.778579, 80.542545, 217.778579, 80.413782),\n (217.778579, 80.413782, 217.778579, 80.285019),\n (217.778579, 80.285019, 217.778579, 80.156257),\n (217.778579, 80.156257, 217.778579, 80.027494),\n (213.701089, 172.050004, 217.778579, 172.050004),\n (217.778579, 172.050004, 217.778579, 171.921241),\n (217.778579, 171.921241, 217.778579, 171.792478),\n (217.778579, 171.792478, 217.778579, 171.663715),\n (217.778579, 171.663715, 217.778579, 171.534952),\n (217.778579, 171.534952, 217.778579, 171.40619),\n (217.778579, 171.40619, 217.778579, 171.277427),\n (217.778579, 171.277427, 217.778579, 171.148664),\n (217.778579, 171.148664, 217.778579, 171.019901),\n (217.778579, 171.019901, 217.778579, 170.891138),\n (217.778579, 170.891138, 217.778579, 170.762375),\n (217.778579, 170.762375, 217.778579, 170.633613),\n (217.778579, 170.633613, 217.778579, 170.50485),\n (217.778579, 170.50485, 217.778579, 170.376087),\n (217.778579, 170.376087, 217.778579, 170.247324),\n (217.778579, 170.247324, 217.778579, 170.118561),\n (217.778579, 170.118561, 217.778579, 169.989798),\n (217.778579, 169.989798, 217.778579, 169.861036),\n (217.778579, 169.861036, 217.778579, 169.732273),\n (217.778579, 169.732273, 217.778579, 169.60351),\n (217.778579, 169.60351, 217.778579, 169.474747),\n (217.778579, 169.474747, 217.778579, 169.345984),\n (217.778579, 169.345984, 217.778579, 169.217221),\n (217.778579, 169.217221, 217.778579, 169.088459),\n (217.778579, 169.088459, 217.778579, 168.959696),\n (217.778579, 168.959696, 217.778579, 168.830933),\n (217.778579, 168.830933, 217.778579, 168.70217),\n (217.778579, 168.70217, 217.778579, 168.573407),\n (217.778579, 168.573407, 217.778579, 168.444644),\n (217.778579, 168.444644, 217.778579, 168.315881),\n (217.778579, 168.315881, 217.778579, 168.187119),\n (217.778579, 168.187119, 217.778579, 168.058356),\n (217.778579, 168.058356, 217.778579, 167.929593),\n (217.778579, 167.929593, 217.778579, 84.147905),\n (213.701089, 167.929593, 213.701089, 84.147905),\n (213.701089, 84.147905, 217.778579, 84.147905),\n (213.701089, 167.929593, 217.778579, 167.929593)\n]\nVISIBLE_CIRCLES = [\n (73.341821, 84.147905, 1.37347),\n (73.341821, 167.929593, 1.37347),\n (166.737802, 84.147905, 1.37347),\n (195.580678, 84.147905, 1.37347),\n (195.580678, 167.929593, 1.37347)\n]\nVISIBLE_ARCS = [\n (73.341821, 84.147905, 4.120411, -180.0, -90.0),\n (195.580678, 84.147905, 4.120411, -90.0, -0.0),\n (195.580678, 167.929593, 4.120411, 0.0, 90.0),\n (73.341821, 167.929593, 4.120411, 90.0, -180.0),\n (188.838652, -6273.196842, 6339.230598, 89.901822, 89.939064),\n (188.838652, 6401.174339, 6339.230598, -89.939064, -89.901822),\n (-1161.598569, 168.259281, 1375.30415, -0.013735, 0.157923)\n]\nHIDDEN_SEGMENTS = [\n (74.7153, 66.0275, 74.7153, 61.95),\n (168.1113, 66.0275, 168.1113, 61.95),\n (196.9542, 66.0275, 196.9542, 61.95),\n (71.9684, 61.95, 71.9684, 66.0275),\n (165.3643, 61.95, 165.3643, 66.0275),\n (194.2072, 61.95, 194.2072, 66.0275),\n (217.7786, 85.5214, 213.7011, 85.5214),\n (217.7786, 82.7744, 213.7011, 82.7744),\n (217.7786, 169.3031, 213.7011, 169.3031),\n (217.7786, 166.5561, 213.7011, 166.5561)\n]\n# (orient, text, p1, p2, base) for linear; (orient, text, center, radius, angle) for diameter\nDIMENSIONS = [\n ('horizontal', '100', (73.3418, 80.0275), (195.5807, 80.0275), (134.4613, 91.0275)),\n ('vertical', '68.5393', (199.7011, 84.1479), (199.7011, 167.9296), (188.7011, 126.0388)),\n ('diameter', '%%c2.2472', (73.3418, 84.1479), 1.3735, 45),\n ('horizontal', '3.3708', (69.2214, 84.1479), (73.3418, 84.1479), (71.2816, 95.1479)),\n ('vertical', '3.3708', (73.3418, 80.0275), (73.3418, 84.1479), (62.3418, 82.0877)),\n ('diameter', '%%c2.2472', (73.3418, 167.9296), 1.3735, 45),\n ('horizontal', '3.3708', (69.2214, 167.9296), (73.3418, 167.9296), (71.2816, 178.9296)),\n ('vertical', '71.9101', (73.3418, 80.0275), (73.3418, 167.9296), (62.3418, 123.9785)),\n ('diameter', '%%c2.2472', (166.7378, 84.1479), 1.3735, 45),\n ('horizontal', '79.7753', (69.2214, 84.1479), (166.7378, 84.1479), (117.9796, 95.1479)),\n ('vertical', '3.3708', (166.7378, 80.0275), (166.7378, 84.1479), (155.7378, 82.0877)),\n ('diameter', '%%c2.2472', (195.5807, 84.1479), 1.3735, 45),\n ('horizontal', '103.371', (69.2214, 84.1479), (195.5807, 84.1479), (132.4011, 95.1479)),\n ('vertical', '3.3708', (195.5807, 80.0275), (195.5807, 84.1479), (184.5807, 82.0877)),\n ('diameter', '%%c2.2472', (195.5807, 167.9296), 1.3735, 45),\n ('horizontal', '103.371', (69.2214, 167.9296), (195.5807, 167.9296), (132.4011, 178.9296)),\n ('vertical', '71.9101', (195.5807, 80.0275), (195.5807, 167.9296), (184.5807, 123.9785)),\n ('radius', 'R3.3708', (73.3418, 84.1479), 4.1204, 135),\n ('horizontal', '3.3357', (213.7011, 84.1479), (217.7786, 84.1479), (215.7399, 95.1479))\n]\n\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; _ds.dxf.dimasz = 2.5\n _ds.dxf.dimexe = 1.25; _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\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\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,\n angle=(0 if d[0] == \"horizontal\" else 90),\n 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,\n 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,\n 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,\n text=text, dimstyle=\"EZDXF\").render()\n\n doc.saveas(out_path)\n\n\nif __name__ == \"__main__\":\n out = sys.argv[1] if len(sys.argv) > 1 else \"0068_00682319_gt.dxf\"\n draw(out)\n print(\"wrote\", out)\n```"}], "images": ["images/0068_00682319.png"], "id": "0068_00682319"} {"messages": [{"role": "user", "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, featuring a circular hole of diameter 6.32 mm. It is extruded to a thickness of 61.15 mm."}, {"role": "assistant", "content": "```python\n#!/usr/bin/env python3\n# -*- coding: utf-8 -*-\n# Ground-truth 2D engineering drawing for part: 0068_00682568\n# Self-contained: reproduces the three-view DXF via ezdxf, NO FreeCAD needed.\n# Coordinates are A4 page millimetres (scale=0.6380086431479317, page=[297.0, 210.0]).\n# visible edges -> solid (layer OUTLINE); hidden edges -> dashed (layer HIDDEN)\n# dimensions -> real movable DIMENSION entities (text = true mm value)\n# Run: python 0068_00682568_gt.py [out.dxf]\nimport sys\nimport ezdxf\nimport math\n\nSCALE = 0.6380086431479317\nPAGE = [297.0, 210.0]\n\nVISIBLE_SEGMENTS = [\n (85.092362, 128.212814, 148.893226, 128.212814),\n (148.895628, 114.212814, 146.901701, 114.212814),\n (146.901701, 114.212814, 144.907774, 114.212814),\n (144.907774, 114.212814, 142.913847, 114.212814),\n (142.913847, 114.212814, 140.91992, 114.212814),\n (140.91992, 114.212814, 138.925993, 114.212814),\n (138.925993, 114.212814, 136.932066, 114.212814),\n (136.932066, 114.212814, 134.938138, 114.212814),\n (134.938138, 114.212814, 132.944211, 114.212814),\n (132.944211, 114.212814, 130.950284, 114.212814),\n (130.950284, 114.212814, 128.956357, 114.212814),\n (128.956357, 114.212814, 126.96243, 114.212814),\n (126.96243, 114.212814, 124.968503, 114.212814),\n (124.968503, 114.212814, 122.974575, 114.212814),\n (122.974575, 114.212814, 120.980648, 114.212814),\n (120.980648, 114.212814, 118.986721, 114.212814),\n (118.986721, 114.212814, 116.992794, 114.212814),\n (116.992794, 114.212814, 114.998867, 114.212814),\n (114.998867, 114.212814, 113.00494, 114.212814),\n (113.00494, 114.212814, 111.011013, 114.212814),\n (111.011013, 114.212814, 109.017085, 114.212814),\n (109.017085, 114.212814, 107.023158, 114.212814),\n (107.023158, 114.212814, 105.029231, 114.212814),\n (105.029231, 114.212814, 103.035304, 114.212814),\n (103.035304, 114.212814, 101.041377, 114.212814),\n (101.041377, 114.212814, 99.04745, 114.212814),\n (99.04745, 114.212814, 97.053523, 114.212814),\n (97.053523, 114.212814, 95.059595, 114.212814),\n (95.059595, 114.212814, 93.065668, 114.212814),\n (93.065668, 114.212814, 91.071741, 114.212814),\n (91.071741, 114.212814, 89.077814, 114.212814),\n (89.077814, 114.212814, 87.083887, 114.212814),\n (87.083887, 114.212814, 85.08996, 114.212814),\n (148.895628, 75.20082, 146.901701, 75.20082),\n (146.901701, 75.20082, 144.907774, 75.20082),\n (144.907774, 75.20082, 142.913847, 75.20082),\n (142.913847, 75.20082, 140.91992, 75.20082),\n (140.91992, 75.20082, 138.925993, 75.20082),\n (138.925993, 75.20082, 136.932066, 75.20082),\n (136.932066, 75.20082, 134.938138, 75.20082),\n (134.938138, 75.20082, 132.944211, 75.20082),\n (132.944211, 75.20082, 130.950284, 75.20082),\n (130.950284, 75.20082, 128.956357, 75.20082),\n (128.956357, 75.20082, 126.96243, 75.20082),\n (126.96243, 75.20082, 124.968503, 75.20082),\n (124.968503, 75.20082, 122.974575, 75.20082),\n (122.974575, 75.20082, 120.980648, 75.20082),\n (120.980648, 75.20082, 118.986721, 75.20082),\n (118.986721, 75.20082, 116.992794, 75.20082),\n (116.992794, 75.20082, 114.998867, 75.20082),\n (114.998867, 75.20082, 113.00494, 75.20082),\n (113.00494, 75.20082, 111.011013, 75.20082),\n (111.011013, 75.20082, 109.017085, 75.20082),\n (109.017085, 75.20082, 107.023158, 75.20082),\n (107.023158, 75.20082, 105.029231, 75.20082),\n (105.029231, 75.20082, 103.035304, 75.20082),\n (103.035304, 75.20082, 101.041377, 75.20082),\n (101.041377, 75.20082, 99.04745, 75.20082),\n (99.04745, 75.20082, 97.053523, 75.20082),\n (97.053523, 75.20082, 95.059595, 75.20082),\n (95.059595, 75.20082, 93.065668, 75.20082),\n (93.065668, 75.20082, 91.071741, 75.20082),\n (91.071741, 75.20082, 89.077814, 75.20082),\n (89.077814, 75.20082, 87.083887, 75.20082),\n (87.083887, 75.20082, 85.08996, 75.20082),\n (148.895628, 75.20082, 148.895628, 114.212814),\n (85.08996, 75.20082, 85.08996, 114.212814),\n (162.895629, 160.507145, 162.895629, 159.497947),\n (162.895629, 159.497947, 162.895629, 158.48875),\n (162.895629, 158.48875, 162.895629, 157.479552),\n (162.895629, 157.479552, 162.895629, 156.470354),\n (162.895629, 156.470354, 162.895629, 155.461156),\n (162.895629, 155.461156, 162.895629, 154.451958),\n (162.895629, 154.451958, 162.895629, 153.44276),\n (162.895629, 153.44276, 162.895629, 152.433562),\n (162.895629, 152.433562, 162.895629, 151.424365),\n (162.895629, 151.424365, 162.895629, 150.415167),\n (162.895629, 150.415167, 162.895629, 149.405969),\n (162.895629, 149.405969, 162.895629, 148.396771),\n (162.895629, 148.396771, 162.895629, 147.387573),\n (162.895629, 147.387573, 162.895629, 146.378375),\n (162.895629, 146.378375, 162.895629, 145.369178),\n (162.895629, 145.369178, 162.895629, 144.35998),\n (162.895629, 144.35998, 162.895629, 143.350782),\n (162.895629, 143.350782, 162.895629, 142.341584),\n (162.895629, 142.341584, 162.895629, 141.332386),\n (162.895629, 141.332386, 162.895629, 140.323188),\n (162.895629, 140.323188, 162.895629, 139.31399),\n (162.895629, 139.31399, 162.895629, 138.304793),\n (162.895629, 138.304793, 162.895629, 137.295595),\n (162.895629, 137.295595, 162.895629, 136.286397),\n (162.895629, 136.286397, 162.895629, 135.277199),\n (162.895629, 135.277199, 162.895629, 134.268001),\n (162.895629, 134.268001, 162.895629, 133.258803),\n (162.895629, 133.258803, 162.895629, 132.249605),\n (162.895629, 132.249605, 162.895629, 131.240408),\n (162.895629, 131.240408, 162.895629, 130.23121),\n (162.895629, 130.23121, 162.895629, 129.222012),\n (162.895629, 129.222012, 162.895629, 128.212814),\n (162.895629, 128.212814, 201.907622, 128.212814),\n (201.907622, 160.507145, 201.907622, 159.497947),\n (201.907622, 159.497947, 201.907622, 158.48875),\n (201.907622, 158.48875, 201.907622, 157.479552),\n (201.907622, 157.479552, 201.907622, 156.470354),\n (201.907622, 156.470354, 201.907622, 155.461156),\n (201.907622, 155.461156, 201.907622, 154.451958),\n (201.907622, 154.451958, 201.907622, 153.44276),\n (201.907622, 153.44276, 201.907622, 152.433562),\n (201.907622, 152.433562, 201.907622, 151.424365),\n (201.907622, 151.424365, 201.907622, 150.415167),\n (201.907622, 150.415167, 201.907622, 149.405969),\n (201.907622, 149.405969, 201.907622, 148.396771),\n (201.907622, 148.396771, 201.907622, 147.387573),\n (201.907622, 147.387573, 201.907622, 146.378375),\n (201.907622, 146.378375, 201.907622, 145.369178),\n (201.907622, 145.369178, 201.907622, 144.35998),\n (201.907622, 144.35998, 201.907622, 143.350782),\n (201.907622, 143.350782, 201.907622, 142.341584),\n (201.907622, 142.341584, 201.907622, 141.332386),\n (201.907622, 141.332386, 201.907622, 140.323188),\n (201.907622, 140.323188, 201.907622, 139.31399),\n (201.907622, 139.31399, 201.907622, 138.304793),\n (201.907622, 138.304793, 201.907622, 137.295595),\n (201.907622, 137.295595, 201.907622, 136.286397),\n (201.907622, 136.286397, 201.907622, 135.277199),\n (201.907622, 135.277199, 201.907622, 134.268001),\n (201.907622, 134.268001, 201.907622, 133.258803),\n (201.907622, 133.258803, 201.907622, 132.249605),\n (201.907622, 132.249605, 201.907622, 131.240408),\n (201.907622, 131.240408, 201.907622, 130.23121),\n (201.907622, 130.23121, 201.907622, 129.222012),\n (201.907622, 129.222012, 201.907622, 128.212814),\n (201.907622, 160.507145, 162.895629, 160.507145)\n]\nVISIBLE_CIRCLES = [\n (116.657, 157.0911, 2.014764)\n]\nVISIBLE_ARCS = [\n (116.992794, 128.604311, 31.902834, -0.703125, -179.296875)\n]\nHIDDEN_SEGMENTS = [\n (118.6718, 114.2128, 118.6718, 75.2008),\n (114.6422, 75.2008, 114.6422, 114.2128),\n (201.9076, 159.1059, 162.8956, 159.1059),\n (201.9076, 155.0764, 162.8956, 155.0764)\n]\n# (orient, text, p1, p2, base) for linear; (orient, text, center, radius, angle) for diameter\nDIMENSIONS = [\n ('horizontal', '100', (148.8932, 128.2129), (85.0924, 128.2129), (116.9928, 117.2129)),\n ('diameter', '%%c6.3158', (116.657, 157.0911), 2.0148, 45),\n ('horizontal', '49.4737', (85.0924, 157.0911), (116.657, 157.0911), (100.8747, 168.0911)),\n ('vertical', '45.2632', (116.657, 128.2129), (116.657, 157.0911), (105.657, 142.652)),\n ('radius', 'R50.0038', (116.9928, 128.6043), 31.9029, 45),\n ('horizontal', '61.1465', (162.8956, 128.2129), (201.9076, 128.2129), (182.4016, 139.2129))\n]\n\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; _ds.dxf.dimasz = 2.5\n _ds.dxf.dimexe = 1.25; _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\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\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,\n angle=(0 if d[0] == \"horizontal\" else 90),\n 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,\n 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,\n 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,\n text=text, dimstyle=\"EZDXF\").render()\n\n doc.saveas(out_path)\n\n\nif __name__ == \"__main__\":\n out = sys.argv[1] if len(sys.argv) > 1 else \"0068_00682568_gt.dxf\"\n draw(out)\n print(\"wrote\", out)\n```"}], "images": ["images/0068_00682568.png"], "id": "0068_00682568"} {"messages": [{"role": "user", "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 69.47 mm tall, featuring a rectangular cutout 71.58 x 56.84 mm. It is extruded to a thickness of 6.25 mm."}, {"role": "assistant", "content": "```python\n#!/usr/bin/env python3\n# -*- coding: utf-8 -*-\n# Ground-truth 2D engineering drawing for part: 0068_00682821\n# Self-contained: reproduces the three-view DXF via ezdxf, NO FreeCAD needed.\n# Coordinates are A4 page millimetres (scale=0.5670496894409693, page=[297.0, 210.0]).\n# visible edges -> solid (layer OUTLINE); hidden edges -> dashed (layer HIDDEN)\n# dimensions -> real movable DIMENSION entities (text = true mm value)\n# Run: python 0068_00682821_gt.py [out.dxf]\nimport sys\nimport ezdxf\nimport math\n\nSCALE = 0.5670496894409693\nPAGE = [297.0, 210.0]\n\nVISIBLE_SEGMENTS = [\n (163.080454, 106.074515, 163.080454, 145.469546),\n (163.080454, 145.469546, 106.375485, 145.469546),\n (106.375485, 145.469546, 106.375485, 106.074515),\n (106.375485, 106.074515, 163.080454, 106.074515),\n (146.964305, 134.725446, 146.964305, 137.113024),\n (123.685423, 133.531658, 145.770516, 133.531658),\n (122.491634, 134.725446, 106.375485, 106.074515),\n (122.491634, 137.113024, 122.491634, 134.725446),\n (145.770516, 138.306813, 123.685423, 138.306813),\n (163.080454, 92.074515, 163.080454, 88.530454),\n (163.080454, 88.530454, 106.375485, 88.530454),\n (106.375485, 92.074515, 106.375485, 88.530454),\n (163.080454, 92.074515, 106.375485, 92.074515),\n (177.080454, 145.469546, 180.624515, 145.469546),\n (180.624515, 145.469546, 180.624515, 106.074515),\n (177.080454, 106.074515, 180.624515, 106.074515),\n (177.080454, 145.469546, 177.080454, 106.074515)\n]\nVISIBLE_CIRCLES = [\n\n]\nVISIBLE_ARCS = [\n (145.770516, 137.113024, 1.193789, -0.0, 90.0),\n (145.770516, 134.725446, 1.193789, -90.0, -0.0),\n (101.301883, 128.458055, 22.951347, -77.228757, 12.771243),\n (123.685423, 137.113024, 1.193789, 90.0, -180.0)\n]\nHIDDEN_SEGMENTS = [\n (146.9643, 92.0745, 146.9643, 88.5305),\n (123.6854, 92.0745, 123.6854, 88.5305),\n (122.4916, 92.0745, 122.4916, 88.5305),\n (124.2532, 88.5305, 124.2532, 92.0745),\n (177.0805, 138.3068, 180.6245, 138.3068),\n (177.0805, 133.5317, 180.6245, 133.5317),\n (177.0805, 134.7254, 180.6245, 134.7254)\n]\n# (orient, text, p1, p2, base) for linear; (orient, text, center, radius, angle) for diameter\nDIMENSIONS = [\n ('horizontal', '100', (163.0805, 145.4696), (106.3755, 145.4696), (134.728, 134.4696)),\n ('vertical', '69.4737', (163.0805, 106.0745), (163.0805, 145.4696), (152.0805, 125.772)),\n ('horizontal', '71.5789', (106.3755, 106.0745), (146.9643, 106.0745), (126.6699, 117.0745)),\n ('vertical', '56.8421', (106.3755, 106.0745), (106.3755, 138.3068), (95.3755, 122.1907)),\n ('radius', 'R40.475', (101.3019, 128.4581), 22.9513, 45),\n ('radius', 'R2.1053', (145.7705, 134.7254), 1.1938, 45),\n ('horizontal', '6.25', (177.0805, 106.0745), (180.6245, 106.0745), (178.8525, 117.0745))\n]\n\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; _ds.dxf.dimasz = 2.5\n _ds.dxf.dimexe = 1.25; _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\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\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,\n angle=(0 if d[0] == \"horizontal\" else 90),\n 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,\n 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,\n 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,\n text=text, dimstyle=\"EZDXF\").render()\n\n doc.saveas(out_path)\n\n\nif __name__ == \"__main__\":\n out = sys.argv[1] if len(sys.argv) > 1 else \"0068_00682821_gt.dxf\"\n draw(out)\n print(\"wrote\", out)\n```"}], "images": ["images/0068_00682821.png"], "id": "0068_00682821"} {"messages": [{"role": "user", "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 2 circular holes, each of diameter 11.24 mm. It is extruded to a thickness of 6.67 mm. The outline includes one or more oblique (angled) edges."}, {"role": "assistant", "content": "```python\n#!/usr/bin/env python3\n# -*- coding: utf-8 -*-\n# Ground-truth 2D engineering drawing for part: 0068_00683676\n# Self-contained: reproduces the three-view DXF via ezdxf, NO FreeCAD needed.\n# Coordinates are A4 page millimetres (scale=0.7878108433734909, page=[297.0, 210.0]).\n# visible edges -> solid (layer OUTLINE); hidden edges -> dashed (layer HIDDEN)\n# dimensions -> real movable DIMENSION entities (text = true mm value)\n# Run: python 0068_00683676_gt.py [out.dxf]\nimport sys\nimport ezdxf\nimport math\n\nSCALE = 0.7878108433734909\nPAGE = [297.0, 210.0]\n\nVISIBLE_SEGMENTS = [\n (165.296016, 168.674, 165.296016, 89.892916),\n (159.984931, 84.581831, 107.759269, 84.581831),\n (102.448184, 89.892916, 102.448184, 168.674),\n (102.448184, 168.674, 165.296016, 168.674),\n (165.296016, 65.326071, 165.296016, 70.581831),\n (102.448184, 65.326071, 102.448184, 70.581831),\n (102.448184, 70.581831, 165.296016, 70.581831),\n (102.448184, 65.326071, 165.296016, 65.326071),\n (184.551776, 84.581831, 179.296016, 84.581831),\n (184.551776, 84.581831, 184.551776, 84.747803),\n (184.551776, 84.747803, 184.551776, 84.913774),\n (184.551776, 84.913774, 184.551776, 85.079745),\n (184.551776, 85.079745, 184.551776, 85.245717),\n (184.551776, 85.245717, 184.551776, 85.411688),\n (184.551776, 85.411688, 184.551776, 85.57766),\n (184.551776, 85.57766, 184.551776, 85.743631),\n (184.551776, 85.743631, 184.551776, 85.909602),\n (184.551776, 85.909602, 184.551776, 86.075574),\n (184.551776, 86.075574, 184.551776, 86.241545),\n (184.551776, 86.241545, 184.551776, 86.407517),\n (184.551776, 86.407517, 184.551776, 86.573488),\n (184.551776, 86.573488, 184.551776, 86.739459),\n (184.551776, 86.739459, 184.551776, 86.905431),\n (184.551776, 86.905431, 184.551776, 87.071402),\n (184.551776, 87.071402, 184.551776, 87.237373),\n (184.551776, 87.237373, 184.551776, 87.403345),\n (184.551776, 87.403345, 184.551776, 87.569316),\n (184.551776, 87.569316, 184.551776, 87.735288),\n (184.551776, 87.735288, 184.551776, 87.901259),\n (184.551776, 87.901259, 184.551776, 88.06723),\n (184.551776, 88.06723, 184.551776, 88.233202),\n (184.551776, 88.233202, 184.551776, 88.399173),\n (184.551776, 88.399173, 184.551776, 88.565145),\n (184.551776, 88.565145, 184.551776, 88.731116),\n (184.551776, 88.731116, 184.551776, 88.897087),\n (184.551776, 88.897087, 184.551776, 89.063059),\n (184.551776, 89.063059, 184.551776, 89.22903),\n (184.551776, 89.22903, 184.551776, 89.395002),\n (184.551776, 89.395002, 184.551776, 89.560973),\n (184.551776, 89.560973, 184.551776, 89.726944),\n (184.551776, 89.726944, 184.551776, 89.892916),\n (179.296016, 84.581831, 179.296016, 84.747803),\n (179.296016, 84.747803, 179.296016, 84.913774),\n (179.296016, 84.913774, 179.296016, 85.079745),\n (179.296016, 85.079745, 179.296016, 85.245717),\n (179.296016, 85.245717, 179.296016, 85.411688),\n (179.296016, 85.411688, 179.296016, 85.57766),\n (179.296016, 85.57766, 179.296016, 85.743631),\n (179.296016, 85.743631, 179.296016, 85.909602),\n (179.296016, 85.909602, 179.296016, 86.075574),\n (179.296016, 86.075574, 179.296016, 86.241545),\n (179.296016, 86.241545, 179.296016, 86.407517),\n (179.296016, 86.407517, 179.296016, 86.573488),\n (179.296016, 86.573488, 179.296016, 86.739459),\n (179.296016, 86.739459, 179.296016, 86.905431),\n (179.296016, 86.905431, 179.296016, 87.071402),\n (179.296016, 87.071402, 179.296016, 87.237373),\n (179.296016, 87.237373, 179.296016, 87.403345),\n (179.296016, 87.403345, 179.296016, 87.569316),\n (179.296016, 87.569316, 179.296016, 87.735288),\n (179.296016, 87.735288, 179.296016, 87.901259),\n (179.296016, 87.901259, 179.296016, 88.06723),\n (179.296016, 88.06723, 179.296016, 88.233202),\n (179.296016, 88.233202, 179.296016, 88.399173),\n (179.296016, 88.399173, 179.296016, 88.565145),\n (179.296016, 88.565145, 179.296016, 88.731116),\n (179.296016, 88.731116, 179.296016, 88.897087),\n (179.296016, 88.897087, 179.296016, 89.063059),\n (179.296016, 89.063059, 179.296016, 89.22903),\n (179.296016, 89.22903, 179.296016, 89.395002),\n (179.296016, 89.395002, 179.296016, 89.560973),\n (179.296016, 89.560973, 179.296016, 89.726944),\n (179.296016, 89.726944, 179.296016, 89.892916),\n (179.296016, 89.892916, 179.296016, 168.674),\n (184.551776, 168.674, 179.296016, 168.674),\n (184.551776, 89.892916, 184.551776, 168.674),\n (184.551776, 89.892916, 179.296016, 89.892916)\n]\nVISIBLE_CIRCLES = [\n (115.725895, 95.204, 4.425904),\n (152.018305, 95.204, 4.425904)\n]\nVISIBLE_ARCS = [\n (159.984931, 89.892916, 5.311084, -90.0, 0.0),\n (107.759269, 89.892916, 5.311084, -180.0, -90.0)\n]\nHIDDEN_SEGMENTS = [\n (120.1518, 65.326, 120.1518, 70.5818),\n (156.4442, 65.326, 156.4442, 70.5818),\n (111.3, 70.5818, 111.3, 65.326),\n (147.5924, 70.5818, 147.5924, 65.326),\n (179.296, 90.7781, 184.5518, 90.7781),\n (179.296, 99.6299, 184.5518, 99.6299)\n]\n# (orient, text, p1, p2, base) for linear; (orient, text, center, radius, angle) for diameter\nDIMENSIONS = [\n ('horizontal', '66.2921', (159.9849, 84.5818), (107.7593, 84.5818), (133.8721, 73.5818)),\n ('horizontal', '79.7753', (102.4482, 168.674), (165.2961, 168.674), (133.8721, 179.674)),\n ('vertical', '100', (165.2961, 168.674), (165.2961, 89.8929), (176.2961, 129.2834)),\n ('diameter', '%%c11.236', (115.7259, 95.204), 4.4259, 45),\n ('horizontal', '16.8539', (102.4482, 95.204), (115.7259, 95.204), (109.087, 106.204)),\n ('vertical', '93.2584', (115.7259, 168.674), (115.7259, 95.204), (126.7259, 131.939)),\n ('diameter', '%%c11.236', (152.0183, 95.204), 4.4259, 45),\n ('horizontal', '62.9213', (102.4482, 95.204), (152.0183, 95.204), (127.2332, 106.204)),\n ('vertical', '93.2584', (152.0183, 168.674), (152.0183, 95.204), (163.0183, 131.939)),\n ('radius', 'R6.7416', (159.9849, 89.8929), 5.3111, 45),\n ('horizontal', '6.6713', (184.5518, 168.674), (179.2961, 168.674), (181.9239, 157.674))\n]\n\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; _ds.dxf.dimasz = 2.5\n _ds.dxf.dimexe = 1.25; _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\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\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,\n angle=(0 if d[0] == \"horizontal\" else 90),\n 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,\n 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,\n 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,\n text=text, dimstyle=\"EZDXF\").render()\n\n doc.saveas(out_path)\n\n\nif __name__ == \"__main__\":\n out = sys.argv[1] if len(sys.argv) > 1 else \"0068_00683676_gt.dxf\"\n draw(out)\n print(\"wrote\", out)\n```"}], "images": ["images/0068_00683676.png"], "id": "0068_00683676"} {"messages": [{"role": "user", "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 4.21 mm tall. It is extruded to a thickness of 15.7 mm."}, {"role": "assistant", "content": "```python\n#!/usr/bin/env python3\n# -*- coding: utf-8 -*-\n# Ground-truth 2D engineering drawing for part: 0070_00702825\n# Self-contained: reproduces the three-view DXF via ezdxf, NO FreeCAD needed.\n# Coordinates are A4 page millimetres (scale=1.2512576599035155, page=[297.0, 210.0]).\n# visible edges -> solid (layer OUTLINE); hidden edges -> dashed (layer HIDDEN)\n# dimensions -> real movable DIMENSION entities (text = true mm value)\n# Run: python 0070_00702825_gt.py [out.dxf]\nimport sys\nimport ezdxf\nimport math\n\nSCALE = 1.2512576599035155\nPAGE = [297.0, 210.0]\n\nVISIBLE_SEGMENTS = [\n (189.238959, 148.867486, 189.238959, 143.599033),\n (189.238959, 143.599033, 148.408446, 143.599033),\n (107.577933, 143.599033, 64.113193, 143.599033),\n (64.113193, 143.599033, 64.113193, 148.867486),\n (64.113193, 148.867486, 189.238959, 148.867486),\n (189.238959, 93.405404, 189.238959, 113.053252),\n (64.113193, 93.405404, 64.113193, 113.053252),\n (64.113193, 113.053252, 189.238959, 113.053252),\n (64.113193, 93.405404, 189.238959, 93.405404),\n (222.886807, 127.053252, 222.886807, 143.599033),\n (203.238959, 127.053252, 203.238959, 143.599033),\n (222.886807, 143.599033, 203.238959, 143.599033),\n (203.238959, 143.599033, 203.238959, 148.867486),\n (222.886807, 148.867486, 203.238959, 148.867486),\n (222.886807, 143.599033, 222.886807, 148.867486),\n (203.238959, 127.053252, 222.886807, 127.053252)\n]\nVISIBLE_CIRCLES = [\n\n]\nVISIBLE_ARCS = [\n (127.99319, 147.920976, 20.867724, -168.046875, -11.953125)\n]\nHIDDEN_SEGMENTS = [\n (148.4084, 93.4054, 148.4084, 113.0533),\n (107.5779, 93.4054, 107.5779, 113.0533)\n]\n# (orient, text, p1, p2, base) for linear; (orient, text, center, radius, angle) for diameter\nDIMENSIONS = [\n ('horizontal', '100', (189.239, 143.5991), (64.1132, 143.5991), (126.6761, 132.5991)),\n ('vertical', '4.2105', (189.239, 148.8675), (189.239, 143.5991), (200.239, 146.2333)),\n ('radius', 'R16.6774', (127.9932, 147.921), 20.8677, 45),\n ('horizontal', '15.7025', (222.8868, 148.8675), (203.2389, 148.8675), (213.0629, 137.8675))\n]\n\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; _ds.dxf.dimasz = 2.5\n _ds.dxf.dimexe = 1.25; _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\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\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,\n angle=(0 if d[0] == \"horizontal\" else 90),\n 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,\n 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,\n 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,\n text=text, dimstyle=\"EZDXF\").render()\n\n doc.saveas(out_path)\n\n\nif __name__ == \"__main__\":\n out = sys.argv[1] if len(sys.argv) > 1 else \"0070_00702825_gt.dxf\"\n draw(out)\n print(\"wrote\", out)\n```"}], "images": ["images/0070_00702825.png"], "id": "0070_00702825"} {"messages": [{"role": "user", "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 5.02 mm. The outline includes one or more oblique (angled) edges."}, {"role": "assistant", "content": "```python\n#!/usr/bin/env python3\n# -*- coding: utf-8 -*-\n# Ground-truth 2D engineering drawing for part: 0070_00708605\n# Self-contained: reproduces the three-view DXF via ezdxf, NO FreeCAD needed.\n# Coordinates are A4 page millimetres (scale=1.058733468595531, page=[297.0, 210.0]).\n# visible edges -> solid (layer OUTLINE); hidden edges -> dashed (layer HIDDEN)\n# dimensions -> real movable DIMENSION entities (text = true mm value)\n# Run: python 0070_00708605_gt.py [out.dxf]\nimport sys\nimport ezdxf\nimport math\n\nSCALE = 1.058733468595531\nPAGE = [297.0, 210.0]\n\nVISIBLE_SEGMENTS = [\n (84.804563, 145.658506, 186.862567, 145.658506),\n (186.862567, 145.658506, 186.862567, 107.658186),\n (186.862567, 107.658186, 83.71884, 131.544102),\n (77.922888, 88.341498, 78.137941, 88.341498),\n (78.137941, 88.341498, 78.352993, 88.341498),\n (78.352993, 88.341498, 78.568045, 88.341498),\n (78.568045, 88.341498, 78.783098, 88.341498),\n (78.783098, 88.341498, 78.99815, 88.341498),\n (78.99815, 88.341498, 79.213202, 88.341498),\n (79.213202, 88.341498, 79.428255, 88.341498),\n (79.428255, 88.341498, 79.643307, 88.341498),\n (79.643307, 88.341498, 79.858359, 88.341498),\n (79.858359, 88.341498, 80.073412, 88.341498),\n (80.073412, 88.341498, 80.288464, 88.341498),\n (80.288464, 88.341498, 80.503516, 88.341498),\n (80.503516, 88.341498, 80.718569, 88.341498),\n (80.718569, 88.341498, 80.933621, 88.341498),\n (80.933621, 88.341498, 81.148673, 88.341498),\n (81.148673, 88.341498, 81.363726, 88.341498),\n (81.363726, 88.341498, 81.578778, 88.341498),\n (81.578778, 88.341498, 81.79383, 88.341498),\n (81.79383, 88.341498, 82.008883, 88.341498),\n (82.008883, 88.341498, 82.223935, 88.341498),\n (82.223935, 88.341498, 82.438987, 88.341498),\n (82.438987, 88.341498, 82.65404, 88.341498),\n (82.65404, 88.341498, 82.869092, 88.341498),\n (82.869092, 88.341498, 83.084144, 88.341498),\n (83.084144, 88.341498, 83.299197, 88.341498),\n (83.299197, 88.341498, 83.514249, 88.341498),\n (83.514249, 88.341498, 83.729301, 88.341498),\n (83.729301, 88.341498, 83.944354, 88.341498),\n (83.944354, 88.341498, 84.159406, 88.341498),\n (84.159406, 88.341498, 84.374458, 88.341498),\n (84.374458, 88.341498, 84.589511, 88.341498),\n (84.589511, 88.341498, 84.804563, 88.341498),\n (84.804563, 88.341498, 84.804563, 93.658185),\n (77.922888, 93.658185, 78.137941, 93.658185),\n (78.137941, 93.658185, 78.352993, 93.658185),\n (78.352993, 93.658185, 78.568045, 93.658185),\n (78.568045, 93.658185, 78.783098, 93.658185),\n (78.783098, 93.658185, 78.99815, 93.658185),\n (78.99815, 93.658185, 79.213202, 93.658185),\n (79.213202, 93.658185, 79.428255, 93.658185),\n (79.428255, 93.658185, 79.643307, 93.658185),\n (79.643307, 93.658185, 79.858359, 93.658185),\n (79.858359, 93.658185, 80.073412, 93.658185),\n (80.073412, 93.658185, 80.288464, 93.658185),\n (80.288464, 93.658185, 80.503516, 93.658185),\n (80.503516, 93.658185, 80.718569, 93.658185),\n (80.718569, 93.658185, 80.933621, 93.658185),\n (80.933621, 93.658185, 81.148673, 93.658185),\n (81.148673, 93.658185, 81.363726, 93.658185),\n (81.363726, 93.658185, 81.578778, 93.658185),\n (81.578778, 93.658185, 81.79383, 93.658185),\n (81.79383, 93.658185, 82.008883, 93.658185),\n (82.008883, 93.658185, 82.223935, 93.658185),\n (82.223935, 93.658185, 82.438987, 93.658185),\n (82.438987, 93.658185, 82.65404, 93.658185),\n (82.65404, 93.658185, 82.869092, 93.658185),\n (82.869092, 93.658185, 83.084144, 93.658185),\n (83.084144, 93.658185, 83.299197, 93.658185),\n (83.299197, 93.658185, 83.514249, 93.658185),\n (83.514249, 93.658185, 83.729301, 93.658185),\n (83.729301, 93.658185, 83.944354, 93.658185),\n (83.944354, 93.658185, 84.159406, 93.658185),\n (84.159406, 93.658185, 84.374458, 93.658185),\n (84.374458, 93.658185, 84.589511, 93.658185),\n (84.589511, 93.658185, 84.804563, 93.658185),\n (84.804563, 93.658185, 186.862567, 93.658185),\n (186.862567, 88.341498, 186.862567, 93.658185),\n (84.804563, 88.341498, 186.862567, 88.341498),\n (77.922888, 93.658185, 77.922888, 88.341498),\n (206.179255, 131.544102, 206.179255, 131.985177),\n (206.179255, 131.985177, 206.179255, 132.426252),\n (206.179255, 132.426252, 206.179255, 132.867327),\n (206.179255, 132.867327, 206.179255, 133.308402),\n (206.179255, 133.308402, 206.179255, 133.749477),\n (206.179255, 133.749477, 206.179255, 134.190552),\n (206.179255, 134.190552, 206.179255, 134.631628),\n (206.179255, 134.631628, 206.179255, 135.072703),\n (206.179255, 135.072703, 206.179255, 135.513778),\n (206.179255, 135.513778, 206.179255, 135.954853),\n (206.179255, 135.954853, 206.179255, 136.395928),\n (206.179255, 136.395928, 206.179255, 136.837003),\n (206.179255, 136.837003, 206.179255, 137.278079),\n (206.179255, 137.278079, 206.179255, 137.719154),\n (206.179255, 137.719154, 206.179255, 138.160229),\n (206.179255, 138.160229, 206.179255, 138.601304),\n (206.179255, 138.601304, 206.179255, 139.042379),\n (206.179255, 139.042379, 206.179255, 139.483454),\n (206.179255, 139.483454, 206.179255, 139.924529),\n (206.179255, 139.924529, 206.179255, 140.365605),\n (206.179255, 140.365605, 206.179255, 140.80668),\n (206.179255, 140.80668, 206.179255, 141.247755),\n (206.179255, 141.247755, 206.179255, 141.68883),\n (206.179255, 141.68883, 206.179255, 142.129905),\n (206.179255, 142.129905, 206.179255, 142.57098),\n (206.179255, 142.57098, 206.179255, 143.012056),\n (206.179255, 143.012056, 206.179255, 143.453131),\n (206.179255, 143.453131, 206.179255, 143.894206),\n (206.179255, 143.894206, 206.179255, 144.335281),\n (206.179255, 144.335281, 206.179255, 144.776356),\n (206.179255, 144.776356, 206.179255, 145.217431),\n (206.179255, 145.217431, 206.179255, 145.658506),\n (206.179255, 145.658506, 200.862568, 145.658506),\n (200.862568, 131.544102, 200.862568, 131.985177),\n (200.862568, 131.985177, 200.862568, 132.426252),\n (200.862568, 132.426252, 200.862568, 132.867327),\n (200.862568, 132.867327, 200.862568, 133.308402),\n (200.862568, 133.308402, 200.862568, 133.749477),\n (200.862568, 133.749477, 200.862568, 134.190552),\n (200.862568, 134.190552, 200.862568, 134.631628),\n (200.862568, 134.631628, 200.862568, 135.072703),\n (200.862568, 135.072703, 200.862568, 135.513778),\n (200.862568, 135.513778, 200.862568, 135.954853),\n (200.862568, 135.954853, 200.862568, 136.395928),\n (200.862568, 136.395928, 200.862568, 136.837003),\n (200.862568, 136.837003, 200.862568, 137.278079),\n (200.862568, 137.278079, 200.862568, 137.719154),\n (200.862568, 137.719154, 200.862568, 138.160229),\n (200.862568, 138.160229, 200.862568, 138.601304),\n (200.862568, 138.601304, 200.862568, 139.042379),\n (200.862568, 139.042379, 200.862568, 139.483454),\n (200.862568, 139.483454, 200.862568, 139.924529),\n (200.862568, 139.924529, 200.862568, 140.365605),\n (200.862568, 140.365605, 200.862568, 140.80668),\n (200.862568, 140.80668, 200.862568, 141.247755),\n (200.862568, 141.247755, 200.862568, 141.68883),\n (200.862568, 141.68883, 200.862568, 142.129905),\n (200.862568, 142.129905, 200.862568, 142.57098),\n (200.862568, 142.57098, 200.862568, 143.012056),\n (200.862568, 143.012056, 200.862568, 143.453131),\n (200.862568, 143.453131, 200.862568, 143.894206),\n (200.862568, 143.894206, 200.862568, 144.335281),\n (200.862568, 144.335281, 200.862568, 144.776356),\n (200.862568, 144.776356, 200.862568, 145.217431),\n (200.862568, 145.217431, 200.862568, 145.658506),\n (206.179255, 131.544102, 200.862568, 131.544102),\n (206.179255, 107.658186, 200.862568, 107.658186),\n (200.862568, 107.658186, 200.862568, 131.544102),\n (206.179255, 107.658186, 206.179255, 131.544102)\n]\nVISIBLE_CIRCLES = [\n\n]\nVISIBLE_ARCS = [\n (85.04433, 138.541102, 7.121442, 91.92942, -100.72683)\n]\nHIDDEN_SEGMENTS = [\n (83.7188, 88.3415, 83.7188, 93.6582)\n]\n# (orient, text, p1, p2, base) for linear; (orient, text, center, radius, angle) for diameter\nDIMENSIONS = [\n ('horizontal', '96.3963', (84.8045, 145.6585), (186.8626, 145.6585), (135.8335, 156.6585)),\n ('vertical', '35.8922', (186.8626, 145.6585), (186.8626, 107.6582), (197.8626, 126.6584)),\n ('aligned', '100', (186.8626, 107.6582), (83.7188, 131.5441), (132.809, 108.8848)),\n ('radius', 'R6.7264', (85.0443, 138.541), 7.1215, 45),\n ('horizontal', '5.0217', (206.1792, 131.5441), (200.8626, 131.5441), (203.5209, 120.5441))\n]\n\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; _ds.dxf.dimasz = 2.5\n _ds.dxf.dimexe = 1.25; _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\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\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,\n angle=(0 if d[0] == \"horizontal\" else 90),\n 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,\n 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,\n 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,\n text=text, dimstyle=\"EZDXF\").render()\n\n doc.saveas(out_path)\n\n\nif __name__ == \"__main__\":\n out = sys.argv[1] if len(sys.argv) > 1 else \"0070_00708605_gt.dxf\"\n draw(out)\n print(\"wrote\", out)\n```"}], "images": ["images/0070_00708605.png"], "id": "0070_00708605"} {"messages": [{"role": "user", "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 63.1 mm bounding box, featuring a circular hole of diameter 50 mm. It is extruded to a thickness of 33.03 mm."}, {"role": "assistant", "content": "```python\n#!/usr/bin/env python3\n# -*- coding: utf-8 -*-\n# Ground-truth 2D engineering drawing for part: 0070_00709291\n# Self-contained: reproduces the three-view DXF via ezdxf, NO FreeCAD needed.\n# Coordinates are A4 page millimetres (scale=0.6576648882480426, page=[297.0, 210.0]).\n# visible edges -> solid (layer OUTLINE); hidden edges -> dashed (layer HIDDEN)\n# dimensions -> real movable DIMENSION entities (text = true mm value)\n# Run: python 0070_00709291_gt.py [out.dxf]\nimport sys\nimport ezdxf\nimport math\n\nSCALE = 0.6576648882480426\nPAGE = [297.0, 210.0]\n\nVISIBLE_SEGMENTS = [\n (109.197778, 105.892077, 109.197778, 116.853159),\n (109.197778, 116.853159, 142.081022, 116.853159),\n (142.081022, 116.853159, 142.081022, 105.892077),\n (142.081022, 105.892077, 158.522644, 105.892077),\n (158.522644, 105.892077, 158.522644, 147.3876),\n (92.756156, 147.3876, 92.756156, 105.892077),\n (92.756156, 105.892077, 109.197778, 105.892077),\n (158.522644, 91.892077, 158.522644, 70.170844),\n (158.522644, 91.892077, 156.467442, 91.892077),\n (156.467442, 91.892077, 154.412239, 91.892077),\n (154.412239, 91.892077, 152.357036, 91.892077),\n (152.357036, 91.892077, 150.301833, 91.892077),\n (150.301833, 91.892077, 148.246631, 91.892077),\n (148.246631, 91.892077, 146.191428, 91.892077),\n (146.191428, 91.892077, 144.136225, 91.892077),\n (144.136225, 91.892077, 142.081022, 91.892077),\n (142.081022, 91.892077, 140.025819, 91.892077),\n (140.025819, 91.892077, 137.970617, 91.892077),\n (137.970617, 91.892077, 135.915414, 91.892077),\n (135.915414, 91.892077, 133.860211, 91.892077),\n (133.860211, 91.892077, 131.805008, 91.892077),\n (131.805008, 91.892077, 129.749806, 91.892077),\n (129.749806, 91.892077, 127.694603, 91.892077),\n (127.694603, 91.892077, 125.6394, 91.892077),\n (125.6394, 91.892077, 123.584197, 91.892077),\n (123.584197, 91.892077, 121.528994, 91.892077),\n (121.528994, 91.892077, 119.473792, 91.892077),\n (119.473792, 91.892077, 117.418589, 91.892077),\n (117.418589, 91.892077, 115.363386, 91.892077),\n (115.363386, 91.892077, 113.308183, 91.892077),\n (113.308183, 91.892077, 111.252981, 91.892077),\n (111.252981, 91.892077, 109.197778, 91.892077),\n (109.197778, 91.892077, 107.142575, 91.892077),\n (107.142575, 91.892077, 105.087372, 91.892077),\n (105.087372, 91.892077, 103.032169, 91.892077),\n (103.032169, 91.892077, 100.976967, 91.892077),\n (100.976967, 91.892077, 98.921764, 91.892077),\n (98.921764, 91.892077, 96.866561, 91.892077),\n (96.866561, 91.892077, 94.811358, 91.892077),\n (94.811358, 91.892077, 92.756156, 91.892077),\n (92.756156, 91.892077, 92.756156, 70.170844),\n (158.522644, 70.170844, 156.467442, 70.170844),\n (156.467442, 70.170844, 154.412239, 70.170844),\n (154.412239, 70.170844, 152.357036, 70.170844),\n (152.357036, 70.170844, 150.301833, 70.170844),\n (150.301833, 70.170844, 148.246631, 70.170844),\n (148.246631, 70.170844, 146.191428, 70.170844),\n (146.191428, 70.170844, 144.136225, 70.170844),\n (144.136225, 70.170844, 142.081022, 70.170844),\n (142.081022, 70.170844, 140.025819, 70.170844),\n (140.025819, 70.170844, 137.970617, 70.170844),\n (137.970617, 70.170844, 135.915414, 70.170844),\n (135.915414, 70.170844, 133.860211, 70.170844),\n (133.860211, 70.170844, 131.805008, 70.170844),\n (131.805008, 70.170844, 129.749806, 70.170844),\n (129.749806, 70.170844, 127.694603, 70.170844),\n (127.694603, 70.170844, 125.6394, 70.170844),\n (125.6394, 70.170844, 123.584197, 70.170844),\n (123.584197, 70.170844, 121.528994, 70.170844),\n (121.528994, 70.170844, 119.473792, 70.170844),\n (119.473792, 70.170844, 117.418589, 70.170844),\n (117.418589, 70.170844, 115.363386, 70.170844),\n (115.363386, 70.170844, 113.308183, 70.170844),\n (113.308183, 70.170844, 111.252981, 70.170844),\n (111.252981, 70.170844, 109.197778, 70.170844),\n (109.197778, 70.170844, 107.142575, 70.170844),\n (107.142575, 70.170844, 105.087372, 70.170844),\n (105.087372, 70.170844, 103.032169, 70.170844),\n (103.032169, 70.170844, 100.976967, 70.170844),\n (100.976967, 70.170844, 98.921764, 70.170844),\n (98.921764, 70.170844, 96.866561, 70.170844),\n (96.866561, 70.170844, 94.811358, 70.170844),\n (94.811358, 70.170844, 92.756156, 70.170844),\n (172.522645, 180.270844, 172.522645, 179.243243),\n (172.522645, 179.243243, 172.522645, 178.215642),\n (172.522645, 178.215642, 172.522645, 177.18804),\n (172.522645, 177.18804, 172.522645, 176.160439),\n (172.522645, 176.160439, 172.522645, 175.132837),\n (172.522645, 175.132837, 172.522645, 174.105236),\n (172.522645, 174.105236, 172.522645, 173.077635),\n (172.522645, 173.077635, 172.522645, 172.050033),\n (172.522645, 172.050033, 172.522645, 171.022432),\n (172.522645, 171.022432, 172.522645, 169.994831),\n (172.522645, 169.994831, 172.522645, 168.967229),\n (172.522645, 168.967229, 172.522645, 167.939628),\n (172.522645, 167.939628, 172.522645, 166.912026),\n (172.522645, 166.912026, 172.522645, 165.884425),\n (172.522645, 165.884425, 172.522645, 164.856824),\n (172.522645, 164.856824, 172.522645, 163.829222),\n (172.522645, 163.829222, 172.522645, 162.801621),\n (172.522645, 162.801621, 172.522645, 161.774019),\n (172.522645, 161.774019, 172.522645, 160.746418),\n (172.522645, 160.746418, 172.522645, 159.718817),\n (172.522645, 159.718817, 172.522645, 158.691215),\n (172.522645, 158.691215, 172.522645, 157.663614),\n (172.522645, 157.663614, 172.522645, 156.636012),\n (172.522645, 156.636012, 172.522645, 155.608411),\n (172.522645, 155.608411, 172.522645, 154.58081),\n (172.522645, 154.58081, 172.522645, 153.553208),\n (172.522645, 153.553208, 172.522645, 152.525607),\n (172.522645, 152.525607, 172.522645, 151.498006),\n (172.522645, 151.498006, 172.522645, 150.470404),\n (172.522645, 150.470404, 172.522645, 149.442803),\n (172.522645, 149.442803, 172.522645, 148.415201),\n (172.522645, 148.415201, 172.522645, 147.3876),\n (194.243877, 180.270844, 194.243877, 179.243243),\n (194.243877, 179.243243, 194.243877, 178.215642),\n (194.243877, 178.215642, 194.243877, 177.18804),\n (194.243877, 177.18804, 194.243877, 176.160439),\n (194.243877, 176.160439, 194.243877, 175.132837),\n (194.243877, 175.132837, 194.243877, 174.105236),\n (194.243877, 174.105236, 194.243877, 173.077635),\n (194.243877, 173.077635, 194.243877, 172.050033),\n (194.243877, 172.050033, 194.243877, 171.022432),\n (194.243877, 171.022432, 194.243877, 169.994831),\n (194.243877, 169.994831, 194.243877, 168.967229),\n (194.243877, 168.967229, 194.243877, 167.939628),\n (194.243877, 167.939628, 194.243877, 166.912026),\n (194.243877, 166.912026, 194.243877, 165.884425),\n (194.243877, 165.884425, 194.243877, 164.856824),\n (194.243877, 164.856824, 194.243877, 163.829222),\n (194.243877, 163.829222, 194.243877, 162.801621),\n (194.243877, 162.801621, 194.243877, 161.774019),\n (194.243877, 161.774019, 194.243877, 160.746418),\n (194.243877, 160.746418, 194.243877, 159.718817),\n (194.243877, 159.718817, 194.243877, 158.691215),\n (194.243877, 158.691215, 194.243877, 157.663614),\n (194.243877, 157.663614, 194.243877, 156.636012),\n (194.243877, 156.636012, 194.243877, 155.608411),\n (194.243877, 155.608411, 194.243877, 154.58081),\n (194.243877, 154.58081, 194.243877, 153.553208),\n (194.243877, 153.553208, 194.243877, 152.525607),\n (194.243877, 152.525607, 194.243877, 151.498006),\n (194.243877, 151.498006, 194.243877, 150.470404),\n (194.243877, 150.470404, 194.243877, 149.442803),\n (194.243877, 149.442803, 194.243877, 148.415201),\n (194.243877, 148.415201, 194.243877, 147.3876),\n (194.243877, 147.3876, 194.243877, 105.892077),\n (172.522645, 105.892077, 194.243877, 105.892077),\n (172.522645, 147.3876, 172.522645, 105.892077),\n (194.243877, 180.270844, 172.522645, 180.270844),\n (172.522645, 147.3876, 194.243877, 147.3876)\n]\nVISIBLE_CIRCLES = [\n (125.6394, 147.3876, 16.441622)\n]\nVISIBLE_ARCS = [\n (125.6394, 147.3876, 32.883244, 0.0, -180.0)\n]\nHIDDEN_SEGMENTS = [\n (109.1978, 91.892, 109.1978, 70.1708),\n (142.081, 91.892, 142.081, 70.1708),\n (109.1978, 70.1708, 109.1978, 91.892),\n (172.5226, 116.8531, 194.2439, 116.8531),\n (194.2439, 163.8292, 172.5226, 163.8292),\n (194.2439, 130.9459, 172.5226, 130.9459)\n]\n# (orient, text, p1, p2, base) for linear; (orient, text, center, radius, angle) for diameter\nDIMENSIONS = [\n ('horizontal', '25', (142.081, 105.8921), (158.5227, 105.8921), (150.3018, 116.8921)),\n ('horizontal', '50', (109.1978, 116.8531), (142.081, 116.8531), (125.6394, 127.8531)),\n ('horizontal', '100', (158.5227, 147.3876), (92.7562, 147.3876), (125.6394, 136.3876)),\n ('vertical', '16.6667', (109.1978, 105.8921), (109.1978, 116.8531), (98.1978, 111.3726)),\n ('vertical', '63.0952', (158.5227, 105.8921), (158.5227, 147.3876), (147.5227, 126.6398)),\n ('diameter', '%%c50', (125.6394, 147.3876), 16.4416, 45),\n ('horizontal', '50', (92.7562, 147.3876), (125.6394, 147.3876), (109.1978, 158.3876)),\n ('vertical', '63.0952', (125.6394, 105.8921), (125.6394, 147.3876), (114.6394, 126.6398)),\n ('radius', 'R50', (125.6394, 147.3876), 32.8832, 135),\n ('horizontal', '33.0278', (172.5226, 105.8921), (194.2439, 105.8921), (183.3832, 116.8921))\n]\n\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; _ds.dxf.dimasz = 2.5\n _ds.dxf.dimexe = 1.25; _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\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\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,\n angle=(0 if d[0] == \"horizontal\" else 90),\n 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,\n 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,\n 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,\n text=text, dimstyle=\"EZDXF\").render()\n\n doc.saveas(out_path)\n\n\nif __name__ == \"__main__\":\n out = sys.argv[1] if len(sys.argv) > 1 else \"0070_00709291_gt.dxf\"\n draw(out)\n print(\"wrote\", out)\n```"}], "images": ["images/0070_00709291.png"], "id": "0070_00709291"} {"messages": [{"role": "user", "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 4 circular holes, each of diameter 4.49 mm. It is extruded to a thickness of 12.97 mm. The outline includes one or more oblique (angled) edges."}, {"role": "assistant", "content": "```python\n#!/usr/bin/env python3\n# -*- coding: utf-8 -*-\n# Ground-truth 2D engineering drawing for part: 0071_00712311\n# Self-contained: reproduces the three-view DXF via ezdxf, NO FreeCAD needed.\n# Coordinates are A4 page millimetres (scale=0.7031000000000163, page=[297.0, 210.0]).\n# visible edges -> solid (layer OUTLINE); hidden edges -> dashed (layer HIDDEN)\n# dimensions -> real movable DIMENSION entities (text = true mm value)\n# Run: python 0071_00712311_gt.py [out.dxf]\nimport sys\nimport ezdxf\nimport math\n\nSCALE = 0.7031000000000163\nPAGE = [297.0, 210.0]\n\nVISIBLE_SEGMENTS = [\n (103.10395, 168.45605, 160.77395, 168.45605),\n (165.51395, 163.71605, 165.51395, 93.40605),\n (160.77395, 88.66605, 103.10395, 88.66605),\n (98.36395, 93.40605, 98.36395, 163.71605),\n (98.36395, 65.54395, 98.512075, 65.54395),\n (98.512075, 65.54395, 98.6602, 65.54395),\n (98.6602, 65.54395, 98.808325, 65.54395),\n (98.808325, 65.54395, 98.95645, 65.54395),\n (98.95645, 65.54395, 99.104575, 65.54395),\n (99.104575, 65.54395, 99.2527, 65.54395),\n (99.2527, 65.54395, 99.400825, 65.54395),\n (99.400825, 65.54395, 99.54895, 65.54395),\n (99.54895, 65.54395, 99.697075, 65.54395),\n (99.697075, 65.54395, 99.8452, 65.54395),\n (99.8452, 65.54395, 99.993325, 65.54395),\n (99.993325, 65.54395, 100.14145, 65.54395),\n (100.14145, 65.54395, 100.289575, 65.54395),\n (100.289575, 65.54395, 100.4377, 65.54395),\n (100.4377, 65.54395, 100.585825, 65.54395),\n (100.585825, 65.54395, 100.73395, 65.54395),\n (100.73395, 65.54395, 100.882075, 65.54395),\n (100.882075, 65.54395, 101.0302, 65.54395),\n (101.0302, 65.54395, 101.178325, 65.54395),\n (101.178325, 65.54395, 101.32645, 65.54395),\n (101.32645, 65.54395, 101.474575, 65.54395),\n (101.474575, 65.54395, 101.6227, 65.54395),\n (101.6227, 65.54395, 101.770825, 65.54395),\n (101.770825, 65.54395, 101.91895, 65.54395),\n (101.91895, 65.54395, 102.067075, 65.54395),\n (102.067075, 65.54395, 102.2152, 65.54395),\n (102.2152, 65.54395, 102.363325, 65.54395),\n (102.363325, 65.54395, 102.51145, 65.54395),\n (102.51145, 65.54395, 102.659575, 65.54395),\n (102.659575, 65.54395, 102.8077, 65.54395),\n (102.8077, 65.54395, 102.955825, 65.54395),\n (102.955825, 65.54395, 103.10395, 65.54395),\n (98.36395, 74.66605, 98.512075, 74.66605),\n (98.512075, 74.66605, 98.6602, 74.66605),\n (98.6602, 74.66605, 98.808325, 74.66605),\n (98.808325, 74.66605, 98.95645, 74.66605),\n (98.95645, 74.66605, 99.104575, 74.66605),\n (99.104575, 74.66605, 99.2527, 74.66605),\n (99.2527, 74.66605, 99.400825, 74.66605),\n (99.400825, 74.66605, 99.54895, 74.66605),\n (99.54895, 74.66605, 99.697075, 74.66605),\n (99.697075, 74.66605, 99.8452, 74.66605),\n (99.8452, 74.66605, 99.993325, 74.66605),\n (99.993325, 74.66605, 100.14145, 74.66605),\n (100.14145, 74.66605, 100.289575, 74.66605),\n (100.289575, 74.66605, 100.4377, 74.66605),\n (100.4377, 74.66605, 100.585825, 74.66605),\n (100.585825, 74.66605, 100.73395, 74.66605),\n (100.73395, 74.66605, 100.882075, 74.66605),\n (100.882075, 74.66605, 101.0302, 74.66605),\n (101.0302, 74.66605, 101.178325, 74.66605),\n (101.178325, 74.66605, 101.32645, 74.66605),\n (101.32645, 74.66605, 101.474575, 74.66605),\n (101.474575, 74.66605, 101.6227, 74.66605),\n (101.6227, 74.66605, 101.770825, 74.66605),\n (101.770825, 74.66605, 101.91895, 74.66605),\n (101.91895, 74.66605, 102.067075, 74.66605),\n (102.067075, 74.66605, 102.2152, 74.66605),\n (102.2152, 74.66605, 102.363325, 74.66605),\n (102.363325, 74.66605, 102.51145, 74.66605),\n (102.51145, 74.66605, 102.659575, 74.66605),\n (102.659575, 74.66605, 102.8077, 74.66605),\n (102.8077, 74.66605, 102.955825, 74.66605),\n (102.955825, 74.66605, 103.10395, 74.66605),\n (98.36395, 65.54395, 98.36395, 74.66605),\n (103.10395, 74.66605, 160.77395, 74.66605),\n (103.10395, 65.54395, 160.77395, 65.54395),\n (160.77395, 65.54395, 160.922075, 65.54395),\n (160.922075, 65.54395, 161.0702, 65.54395),\n (161.0702, 65.54395, 161.218325, 65.54395),\n (161.218325, 65.54395, 161.36645, 65.54395),\n (161.36645, 65.54395, 161.514575, 65.54395),\n (161.514575, 65.54395, 161.6627, 65.54395),\n (161.6627, 65.54395, 161.810825, 65.54395),\n (161.810825, 65.54395, 161.95895, 65.54395),\n (161.95895, 65.54395, 162.107075, 65.54395),\n (162.107075, 65.54395, 162.2552, 65.54395),\n (162.2552, 65.54395, 162.403325, 65.54395),\n (162.403325, 65.54395, 162.55145, 65.54395),\n (162.55145, 65.54395, 162.699575, 65.54395),\n (162.699575, 65.54395, 162.8477, 65.54395),\n (162.8477, 65.54395, 162.995825, 65.54395),\n (162.995825, 65.54395, 163.14395, 65.54395),\n (163.14395, 65.54395, 163.292075, 65.54395),\n (163.292075, 65.54395, 163.4402, 65.54395),\n (163.4402, 65.54395, 163.588325, 65.54395),\n (163.588325, 65.54395, 163.73645, 65.54395),\n (163.73645, 65.54395, 163.884575, 65.54395),\n (163.884575, 65.54395, 164.0327, 65.54395),\n (164.0327, 65.54395, 164.180825, 65.54395),\n (164.180825, 65.54395, 164.32895, 65.54395),\n (164.32895, 65.54395, 164.477075, 65.54395),\n (164.477075, 65.54395, 164.6252, 65.54395),\n (164.6252, 65.54395, 164.773325, 65.54395),\n (164.773325, 65.54395, 164.92145, 65.54395),\n (164.92145, 65.54395, 165.069575, 65.54395),\n (165.069575, 65.54395, 165.2177, 65.54395),\n (165.2177, 65.54395, 165.365825, 65.54395),\n (165.365825, 65.54395, 165.51395, 65.54395),\n (165.51395, 65.54395, 165.51395, 74.66605),\n (160.77395, 74.66605, 160.922075, 74.66605),\n (160.922075, 74.66605, 161.0702, 74.66605),\n (161.0702, 74.66605, 161.218325, 74.66605),\n (161.218325, 74.66605, 161.36645, 74.66605),\n (161.36645, 74.66605, 161.514575, 74.66605),\n (161.514575, 74.66605, 161.6627, 74.66605),\n (161.6627, 74.66605, 161.810825, 74.66605),\n (161.810825, 74.66605, 161.95895, 74.66605),\n (161.95895, 74.66605, 162.107075, 74.66605),\n (162.107075, 74.66605, 162.2552, 74.66605),\n (162.2552, 74.66605, 162.403325, 74.66605),\n (162.403325, 74.66605, 162.55145, 74.66605),\n (162.55145, 74.66605, 162.699575, 74.66605),\n (162.699575, 74.66605, 162.8477, 74.66605),\n (162.8477, 74.66605, 162.995825, 74.66605),\n (162.995825, 74.66605, 163.14395, 74.66605),\n (163.14395, 74.66605, 163.292075, 74.66605),\n (163.292075, 74.66605, 163.4402, 74.66605),\n (163.4402, 74.66605, 163.588325, 74.66605),\n (163.588325, 74.66605, 163.73645, 74.66605),\n (163.73645, 74.66605, 163.884575, 74.66605),\n (163.884575, 74.66605, 164.0327, 74.66605),\n (164.0327, 74.66605, 164.180825, 74.66605),\n (164.180825, 74.66605, 164.32895, 74.66605),\n (164.32895, 74.66605, 164.477075, 74.66605),\n (164.477075, 74.66605, 164.6252, 74.66605),\n (164.6252, 74.66605, 164.773325, 74.66605),\n (164.773325, 74.66605, 164.92145, 74.66605),\n (164.92145, 74.66605, 165.069575, 74.66605),\n (165.069575, 74.66605, 165.2177, 74.66605),\n (165.2177, 74.66605, 165.365825, 74.66605),\n (165.365825, 74.66605, 165.51395, 74.66605),\n (103.10395, 65.54395, 103.10395, 74.66605),\n (160.77395, 65.54395, 160.77395, 74.66605),\n (188.63605, 163.71605, 188.63605, 163.864175),\n (188.63605, 163.864175, 188.63605, 164.0123),\n (188.63605, 164.0123, 188.63605, 164.160425),\n (188.63605, 164.160425, 188.63605, 164.30855),\n (188.63605, 164.30855, 188.63605, 164.456675),\n (188.63605, 164.456675, 188.63605, 164.6048),\n (188.63605, 164.6048, 188.63605, 164.752925),\n (188.63605, 164.752925, 188.63605, 164.90105),\n (188.63605, 164.90105, 188.63605, 165.049175),\n (188.63605, 165.049175, 188.63605, 165.1973),\n (188.63605, 165.1973, 188.63605, 165.345425),\n (188.63605, 165.345425, 188.63605, 165.49355),\n (188.63605, 165.49355, 188.63605, 165.641675),\n (188.63605, 165.641675, 188.63605, 165.7898),\n (188.63605, 165.7898, 188.63605, 165.937925),\n (188.63605, 165.937925, 188.63605, 166.08605),\n (188.63605, 166.08605, 188.63605, 166.234175),\n (188.63605, 166.234175, 188.63605, 166.3823),\n (188.63605, 166.3823, 188.63605, 166.530425),\n (188.63605, 166.530425, 188.63605, 166.67855),\n (188.63605, 166.67855, 188.63605, 166.826675),\n (188.63605, 166.826675, 188.63605, 166.9748),\n (188.63605, 166.9748, 188.63605, 167.122925),\n (188.63605, 167.122925, 188.63605, 167.27105),\n (188.63605, 167.27105, 188.63605, 167.419175),\n (188.63605, 167.419175, 188.63605, 167.5673),\n (188.63605, 167.5673, 188.63605, 167.715425),\n (188.63605, 167.715425, 188.63605, 167.86355),\n (188.63605, 167.86355, 188.63605, 168.011675),\n (188.63605, 168.011675, 188.63605, 168.1598),\n (188.63605, 168.1598, 188.63605, 168.307925),\n (188.63605, 168.307925, 188.63605, 168.45605),\n (188.63605, 168.45605, 179.51395, 168.45605),\n (179.51395, 163.71605, 179.51395, 163.864175),\n (179.51395, 163.864175, 179.51395, 164.0123),\n (179.51395, 164.0123, 179.51395, 164.160425),\n (179.51395, 164.160425, 179.51395, 164.30855),\n (179.51395, 164.30855, 179.51395, 164.456675),\n (179.51395, 164.456675, 179.51395, 164.6048),\n (179.51395, 164.6048, 179.51395, 164.752925),\n (179.51395, 164.752925, 179.51395, 164.90105),\n (179.51395, 164.90105, 179.51395, 165.049175),\n (179.51395, 165.049175, 179.51395, 165.1973),\n (179.51395, 165.1973, 179.51395, 165.345425),\n (179.51395, 165.345425, 179.51395, 165.49355),\n (179.51395, 165.49355, 179.51395, 165.641675),\n (179.51395, 165.641675, 179.51395, 165.7898),\n (179.51395, 165.7898, 179.51395, 165.937925),\n (179.51395, 165.937925, 179.51395, 166.08605),\n (179.51395, 166.08605, 179.51395, 166.234175),\n (179.51395, 166.234175, 179.51395, 166.3823),\n (179.51395, 166.3823, 179.51395, 166.530425),\n (179.51395, 166.530425, 179.51395, 166.67855),\n (179.51395, 166.67855, 179.51395, 166.826675),\n (179.51395, 166.826675, 179.51395, 166.9748),\n (179.51395, 166.9748, 179.51395, 167.122925),\n (179.51395, 167.122925, 179.51395, 167.27105),\n (179.51395, 167.27105, 179.51395, 167.419175),\n (179.51395, 167.419175, 179.51395, 167.5673),\n (179.51395, 167.5673, 179.51395, 167.715425),\n (179.51395, 167.715425, 179.51395, 167.86355),\n (179.51395, 167.86355, 179.51395, 168.011675),\n (179.51395, 168.011675, 179.51395, 168.1598),\n (179.51395, 168.1598, 179.51395, 168.307925),\n (179.51395, 168.307925, 179.51395, 168.45605),\n (188.63605, 88.66605, 179.51395, 88.66605),\n (188.63605, 88.66605, 188.63605, 88.814175),\n (188.63605, 88.814175, 188.63605, 88.9623),\n (188.63605, 88.9623, 188.63605, 89.110425),\n (188.63605, 89.110425, 188.63605, 89.25855),\n (188.63605, 89.25855, 188.63605, 89.406675),\n (188.63605, 89.406675, 188.63605, 89.5548),\n (188.63605, 89.5548, 188.63605, 89.702925),\n (188.63605, 89.702925, 188.63605, 89.85105),\n (188.63605, 89.85105, 188.63605, 89.999175),\n (188.63605, 89.999175, 188.63605, 90.1473),\n (188.63605, 90.1473, 188.63605, 90.295425),\n (188.63605, 90.295425, 188.63605, 90.44355),\n (188.63605, 90.44355, 188.63605, 90.591675),\n (188.63605, 90.591675, 188.63605, 90.7398),\n (188.63605, 90.7398, 188.63605, 90.887925),\n (188.63605, 90.887925, 188.63605, 91.03605),\n (188.63605, 91.03605, 188.63605, 91.184175),\n (188.63605, 91.184175, 188.63605, 91.3323),\n (188.63605, 91.3323, 188.63605, 91.480425),\n (188.63605, 91.480425, 188.63605, 91.62855),\n (188.63605, 91.62855, 188.63605, 91.776675),\n (188.63605, 91.776675, 188.63605, 91.9248),\n (188.63605, 91.9248, 188.63605, 92.072925),\n (188.63605, 92.072925, 188.63605, 92.22105),\n (188.63605, 92.22105, 188.63605, 92.369175),\n (188.63605, 92.369175, 188.63605, 92.5173),\n (188.63605, 92.5173, 188.63605, 92.665425),\n (188.63605, 92.665425, 188.63605, 92.81355),\n (188.63605, 92.81355, 188.63605, 92.961675),\n (188.63605, 92.961675, 188.63605, 93.1098),\n (188.63605, 93.1098, 188.63605, 93.257925),\n (188.63605, 93.257925, 188.63605, 93.40605),\n (179.51395, 88.66605, 179.51395, 88.814175),\n (179.51395, 88.814175, 179.51395, 88.9623),\n (179.51395, 88.9623, 179.51395, 89.110425),\n (179.51395, 89.110425, 179.51395, 89.25855),\n (179.51395, 89.25855, 179.51395, 89.406675),\n (179.51395, 89.406675, 179.51395, 89.5548),\n (179.51395, 89.5548, 179.51395, 89.702925),\n (179.51395, 89.702925, 179.51395, 89.85105),\n (179.51395, 89.85105, 179.51395, 89.999175),\n (179.51395, 89.999175, 179.51395, 90.1473),\n (179.51395, 90.1473, 179.51395, 90.295425),\n (179.51395, 90.295425, 179.51395, 90.44355),\n (179.51395, 90.44355, 179.51395, 90.591675),\n (179.51395, 90.591675, 179.51395, 90.7398),\n (179.51395, 90.7398, 179.51395, 90.887925),\n (179.51395, 90.887925, 179.51395, 91.03605),\n (179.51395, 91.03605, 179.51395, 91.184175),\n (179.51395, 91.184175, 179.51395, 91.3323),\n (179.51395, 91.3323, 179.51395, 91.480425),\n (179.51395, 91.480425, 179.51395, 91.62855),\n (179.51395, 91.62855, 179.51395, 91.776675),\n (179.51395, 91.776675, 179.51395, 91.9248),\n (179.51395, 91.9248, 179.51395, 92.072925),\n (179.51395, 92.072925, 179.51395, 92.22105),\n (179.51395, 92.22105, 179.51395, 92.369175),\n (179.51395, 92.369175, 179.51395, 92.5173),\n (179.51395, 92.5173, 179.51395, 92.665425),\n (179.51395, 92.665425, 179.51395, 92.81355),\n (179.51395, 92.81355, 179.51395, 92.961675),\n (179.51395, 92.961675, 179.51395, 93.1098),\n (179.51395, 93.1098, 179.51395, 93.257925),\n (179.51395, 93.257925, 179.51395, 93.40605),\n (179.51395, 93.40605, 179.51395, 163.71605),\n (188.63605, 93.40605, 188.63605, 163.71605),\n (188.63605, 163.71605, 179.51395, 163.71605),\n (188.63605, 93.40605, 179.51395, 93.40605)\n]\nVISIBLE_CIRCLES = [\n (109.42395, 160.55605, 1.58),\n (109.42395, 117.10605, 1.58),\n (154.45395, 160.55605, 1.58),\n (154.45395, 117.10605, 1.58)\n]\nVISIBLE_ARCS = [\n (103.10395, 163.71605, 4.74, 90.0, -180.0),\n (160.77395, 163.71605, 4.74, -0.0, 90.0),\n (160.77395, 93.40605, 4.74, -90.0, -0.0),\n (103.10395, 93.40605, 4.74, -180.0, -90.0)\n]\nHIDDEN_SEGMENTS = [\n (111.004, 65.544, 111.004, 74.666),\n (156.034, 65.544, 156.034, 74.666),\n (107.844, 74.666, 107.844, 65.544),\n (152.874, 74.666, 152.874, 65.544),\n (179.514, 158.976, 188.636, 158.976),\n (179.514, 162.136, 188.636, 162.136),\n (179.514, 115.526, 188.636, 115.526),\n (179.514, 118.686, 188.636, 118.686)\n]\n# (orient, text, p1, p2, base) for linear; (orient, text, center, radius, angle) for diameter\nDIMENSIONS = [\n ('horizontal', '82.0225', (103.1039, 168.456), (160.7739, 168.456), (131.9389, 179.456)),\n ('vertical', '100', (165.514, 163.7161), (165.514, 93.4061), (176.514, 128.5611)),\n ('diameter', '%%c4.4944', (109.4239, 160.5561), 1.58, 45),\n ('horizontal', '15.7303', (98.364, 160.5561), (109.4239, 160.5561), (103.894, 171.5561)),\n ('vertical', '11.236', (109.4239, 168.456), (109.4239, 160.5561), (120.4239, 164.506)),\n ('diameter', '%%c4.4944', (109.4239, 117.106), 1.58, 45),\n ('horizontal', '15.7303', (98.364, 117.106), (109.4239, 117.106), (103.894, 128.106)),\n ('vertical', '73.0337', (109.4239, 168.456), (109.4239, 117.106), (120.4239, 142.781)),\n ('diameter', '%%c4.4944', (154.454, 160.5561), 1.58, 45),\n ('horizontal', '79.7753', (98.364, 160.5561), (154.454, 160.5561), (126.409, 171.5561)),\n ('vertical', '11.236', (154.454, 168.456), (154.454, 160.5561), (165.454, 164.506)),\n ('diameter', '%%c4.4944', (154.454, 117.106), 1.58, 45),\n ('horizontal', '79.7753', (98.364, 117.106), (154.454, 117.106), (126.409, 128.106)),\n ('vertical', '73.0337', (154.454, 168.456), (154.454, 117.106), (165.454, 142.781)),\n ('radius', 'R6.7416', (103.1039, 163.7161), 4.74, 45),\n ('horizontal', '12.9741', (188.636, 163.7161), (179.514, 163.7161), (184.075, 152.7161))\n]\n\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; _ds.dxf.dimasz = 2.5\n _ds.dxf.dimexe = 1.25; _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\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\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,\n angle=(0 if d[0] == \"horizontal\" else 90),\n 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,\n 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,\n 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,\n text=text, dimstyle=\"EZDXF\").render()\n\n doc.saveas(out_path)\n\n\nif __name__ == \"__main__\":\n out = sys.argv[1] if len(sys.argv) > 1 else \"0071_00712311_gt.dxf\"\n draw(out)\n print(\"wrote\", out)\n```"}], "images": ["images/0071_00712311.png"], "id": "0071_00712311"} {"messages": [{"role": "user", "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 circular hole of diameter 15.99 mm. It is extruded to a thickness of 2.11 mm. The outline includes one or more oblique (angled) edges."}, {"role": "assistant", "content": "```python\n#!/usr/bin/env python3\n# -*- coding: utf-8 -*-\n# Ground-truth 2D engineering drawing for part: 0071_00715756\n# Self-contained: reproduces the three-view DXF via ezdxf, NO FreeCAD needed.\n# Coordinates are A4 page millimetres (scale=0.9670999838267001, page=[297.0, 210.0]).\n# visible edges -> solid (layer OUTLINE); hidden edges -> dashed (layer HIDDEN)\n# dimensions -> real movable DIMENSION entities (text = true mm value)\n# Run: python 0071_00715756_gt.py [out.dxf]\nimport sys\nimport ezdxf\nimport math\n\nSCALE = 0.9670999838267001\nPAGE = [297.0, 210.0]\n\nVISIBLE_SEGMENTS = [\n (81.407334, 105.054678, 177.484738, 116.098058),\n (177.484738, 135.976142, 81.407334, 147.019522),\n (81.407334, 147.019522, 81.407334, 105.054678),\n (177.484738, 91.054678, 177.762793, 91.054678),\n (177.762793, 91.054678, 178.040848, 91.054678),\n (178.040848, 91.054678, 178.318902, 91.054678),\n (178.318902, 91.054678, 178.596957, 91.054678),\n (178.596957, 91.054678, 178.875012, 91.054678),\n (178.875012, 91.054678, 179.153067, 91.054678),\n (179.153067, 91.054678, 179.431121, 91.054678),\n (179.431121, 91.054678, 179.709176, 91.054678),\n (179.709176, 91.054678, 179.987231, 91.054678),\n (179.987231, 91.054678, 180.265286, 91.054678),\n (180.265286, 91.054678, 180.543341, 91.054678),\n (180.543341, 91.054678, 180.821395, 91.054678),\n (180.821395, 91.054678, 181.09945, 91.054678),\n (181.09945, 91.054678, 181.377505, 91.054678),\n (181.377505, 91.054678, 181.65556, 91.054678),\n (181.65556, 91.054678, 181.933614, 91.054678),\n (181.933614, 91.054678, 182.211669, 91.054678),\n (182.211669, 91.054678, 182.489724, 91.054678),\n (182.489724, 91.054678, 182.767779, 91.054678),\n (182.767779, 91.054678, 183.045834, 91.054678),\n (183.045834, 91.054678, 183.323888, 91.054678),\n (183.323888, 91.054678, 183.601943, 91.054678),\n (183.601943, 91.054678, 183.879998, 91.054678),\n (183.879998, 91.054678, 184.158053, 91.054678),\n (184.158053, 91.054678, 184.436107, 91.054678),\n (184.436107, 91.054678, 184.714162, 91.054678),\n (184.714162, 91.054678, 184.992217, 91.054678),\n (184.992217, 91.054678, 185.270272, 91.054678),\n (185.270272, 91.054678, 185.548327, 91.054678),\n (185.548327, 91.054678, 185.826381, 91.054678),\n (185.826381, 91.054678, 186.104436, 91.054678),\n (186.104436, 91.054678, 186.382491, 91.054678),\n (177.484738, 86.980422, 177.762793, 86.980422),\n (177.762793, 86.980422, 178.040848, 86.980422),\n (178.040848, 86.980422, 178.318902, 86.980422),\n (178.318902, 86.980422, 178.596957, 86.980422),\n (178.596957, 86.980422, 178.875012, 86.980422),\n (178.875012, 86.980422, 179.153067, 86.980422),\n (179.153067, 86.980422, 179.431121, 86.980422),\n (179.431121, 86.980422, 179.709176, 86.980422),\n (179.709176, 86.980422, 179.987231, 86.980422),\n (179.987231, 86.980422, 180.265286, 86.980422),\n (180.265286, 86.980422, 180.543341, 86.980422),\n (180.543341, 86.980422, 180.821395, 86.980422),\n (180.821395, 86.980422, 181.09945, 86.980422),\n (181.09945, 86.980422, 181.377505, 86.980422),\n (181.377505, 86.980422, 181.65556, 86.980422),\n (181.65556, 86.980422, 181.933614, 86.980422),\n (181.933614, 86.980422, 182.211669, 86.980422),\n (182.211669, 86.980422, 182.489724, 86.980422),\n (182.489724, 86.980422, 182.767779, 86.980422),\n (182.767779, 86.980422, 183.045834, 86.980422),\n (183.045834, 86.980422, 183.323888, 86.980422),\n (183.323888, 86.980422, 183.601943, 86.980422),\n (183.601943, 86.980422, 183.879998, 86.980422),\n (183.879998, 86.980422, 184.158053, 86.980422),\n (184.158053, 86.980422, 184.436107, 86.980422),\n (184.436107, 86.980422, 184.714162, 86.980422),\n (184.714162, 86.980422, 184.992217, 86.980422),\n (184.992217, 86.980422, 185.270272, 86.980422),\n (185.270272, 86.980422, 185.548327, 86.980422),\n (185.548327, 86.980422, 185.826381, 86.980422),\n (185.826381, 86.980422, 186.104436, 86.980422),\n (186.104436, 86.980422, 186.382491, 86.980422),\n (81.407334, 86.980422, 81.407334, 91.054678),\n (81.407334, 86.980422, 177.484738, 86.980422),\n (81.407334, 91.054678, 177.484738, 91.054678),\n (186.382491, 86.980422, 186.382491, 91.054678),\n (177.484738, 86.980422, 177.484738, 91.054678),\n (200.382491, 105.054678, 204.456748, 105.054678),\n (204.456748, 147.019522, 200.382491, 147.019522),\n (200.382491, 147.019522, 200.382491, 105.054678),\n (204.456748, 147.019522, 204.456748, 105.054678)\n]\nVISIBLE_CIRCLES = [\n (176.3804, 126.0371, 7.730366)\n]\nVISIBLE_ARCS = [\n (176.382519, 126.0371, 9.999972, -83.671875, 83.671875)\n]\nHIDDEN_SEGMENTS = [\n (184.1108, 91.0547, 184.1108, 86.9805),\n (168.6501, 91.0547, 168.6501, 86.9805),\n (200.3825, 118.3068, 204.4568, 118.3068),\n (200.3825, 133.7675, 204.4568, 133.7675)\n]\n# (orient, text, p1, p2, base) for linear; (orient, text, center, radius, angle) for diameter\nDIMENSIONS = [\n ('vertical', '20.5543', (177.4848, 135.9761), (177.4848, 116.0981), (188.4848, 126.0371)),\n ('vertical', '43.3925', (81.4074, 105.0547), (81.4074, 147.0195), (70.4074, 126.0371)),\n ('aligned', '100', (177.4848, 116.0981), (81.4074, 105.0547), (130.7022, 99.6484)),\n ('aligned', '100', (81.4074, 147.0195), (177.4848, 135.9761), (130.7022, 152.4259)),\n ('diameter', '%%c15.9867', (176.3804, 126.0371), 7.7304, 45),\n ('horizontal', '98.204', (81.4074, 126.0371), (176.3804, 126.0371), (128.8939, 137.0371)),\n ('vertical', '21.6962', (176.3804, 147.0195), (176.3804, 126.0371), (187.3804, 136.5283)),\n ('radius', 'R10.3402', (176.3826, 126.0371), 10.0, 135),\n ('horizontal', '4.2129', (204.4567, 135.9761), (200.3825, 135.9761), (202.4196, 124.9761))\n]\n\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; _ds.dxf.dimasz = 2.5\n _ds.dxf.dimexe = 1.25; _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\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\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,\n angle=(0 if d[0] == \"horizontal\" else 90),\n 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,\n 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,\n 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,\n text=text, dimstyle=\"EZDXF\").render()\n\n doc.saveas(out_path)\n\n\nif __name__ == \"__main__\":\n out = sys.argv[1] if len(sys.argv) > 1 else \"0071_00715756_gt.dxf\"\n draw(out)\n print(\"wrote\", out)\n```"}], "images": ["images/0071_00715756.png"], "id": "0071_00715756"} {"messages": [{"role": "user", "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 2 circular holes, each of diameter 41.27 mm. It is extruded to a thickness of 50.63 mm."}, {"role": "assistant", "content": "```python\n#!/usr/bin/env python3\n# -*- coding: utf-8 -*-\n# Ground-truth 2D engineering drawing for part: 0071_00719412\n# Self-contained: reproduces the three-view DXF via ezdxf, NO FreeCAD needed.\n# Coordinates are A4 page millimetres (scale=0.38343153661243934, page=[297.0, 210.0]).\n# visible edges -> solid (layer OUTLINE); hidden edges -> dashed (layer HIDDEN)\n# dimensions -> real movable DIMENSION entities (text = true mm value)\n# Run: python 0071_00719412_gt.py [out.dxf]\nimport sys\nimport ezdxf\nimport math\n\nSCALE = 0.38343153661243934\nPAGE = [297.0, 210.0]\n\nVISIBLE_SEGMENTS = [\n (145.964766, 124.121073, 145.964766, 162.464227),\n (107.621612, 162.464227, 107.621612, 124.121073),\n (107.621612, 90.949496, 108.819836, 90.949496),\n (108.819836, 90.949496, 110.01806, 90.949496),\n (110.01806, 90.949496, 111.216283, 90.949496),\n (111.216283, 90.949496, 112.414507, 90.949496),\n (112.414507, 90.949496, 113.61273, 90.949496),\n (113.61273, 90.949496, 114.810954, 90.949496),\n (114.810954, 90.949496, 116.009177, 90.949496),\n (116.009177, 90.949496, 117.207401, 90.949496),\n (117.207401, 90.949496, 118.405624, 90.949496),\n (118.405624, 90.949496, 119.603848, 90.949496),\n (119.603848, 90.949496, 120.802071, 90.949496),\n (120.802071, 90.949496, 122.000295, 90.949496),\n (122.000295, 90.949496, 123.198519, 90.949496),\n (123.198519, 90.949496, 124.396742, 90.949496),\n (124.396742, 90.949496, 125.594966, 90.949496),\n (125.594966, 90.949496, 126.793189, 90.949496),\n (126.793189, 90.949496, 127.991413, 90.949496),\n (127.991413, 90.949496, 129.189636, 90.949496),\n (129.189636, 90.949496, 130.38786, 90.949496),\n (130.38786, 90.949496, 131.586083, 90.949496),\n (131.586083, 90.949496, 132.784307, 90.949496),\n (132.784307, 90.949496, 133.982531, 90.949496),\n (133.982531, 90.949496, 135.180754, 90.949496),\n (135.180754, 90.949496, 136.378978, 90.949496),\n (136.378978, 90.949496, 137.577201, 90.949496),\n (137.577201, 90.949496, 138.775425, 90.949496),\n (138.775425, 90.949496, 139.973648, 90.949496),\n (139.973648, 90.949496, 141.171872, 90.949496),\n (141.171872, 90.949496, 142.370095, 90.949496),\n (142.370095, 90.949496, 143.568319, 90.949496),\n (143.568319, 90.949496, 144.766543, 90.949496),\n (144.766543, 90.949496, 145.964766, 90.949496),\n (145.964766, 90.949496, 145.964766, 71.535803),\n (107.621612, 71.535803, 108.819836, 71.535803),\n (108.819836, 71.535803, 110.01806, 71.535803),\n (110.01806, 71.535803, 111.216283, 71.535803),\n (111.216283, 71.535803, 112.414507, 71.535803),\n (112.414507, 71.535803, 113.61273, 71.535803),\n (113.61273, 71.535803, 114.810954, 71.535803),\n (114.810954, 71.535803, 116.009177, 71.535803),\n (116.009177, 71.535803, 117.207401, 71.535803),\n (117.207401, 71.535803, 118.405624, 71.535803),\n (118.405624, 71.535803, 119.603848, 71.535803),\n (119.603848, 71.535803, 120.802071, 71.535803),\n (120.802071, 71.535803, 122.000295, 71.535803),\n (122.000295, 71.535803, 123.198519, 71.535803),\n (123.198519, 71.535803, 124.396742, 71.535803),\n (124.396742, 71.535803, 125.594966, 71.535803),\n (125.594966, 71.535803, 126.793189, 71.535803),\n (126.793189, 71.535803, 127.991413, 71.535803),\n (127.991413, 71.535803, 129.189636, 71.535803),\n (129.189636, 71.535803, 130.38786, 71.535803),\n (130.38786, 71.535803, 131.586083, 71.535803),\n (131.586083, 71.535803, 132.784307, 71.535803),\n (132.784307, 71.535803, 133.982531, 71.535803),\n (133.982531, 71.535803, 135.180754, 71.535803),\n (135.180754, 71.535803, 136.378978, 71.535803),\n (136.378978, 71.535803, 137.577201, 71.535803),\n (137.577201, 71.535803, 138.775425, 71.535803),\n (138.775425, 71.535803, 139.973648, 71.535803),\n (139.973648, 71.535803, 141.171872, 71.535803),\n (141.171872, 71.535803, 142.370095, 71.535803),\n (142.370095, 71.535803, 143.568319, 71.535803),\n (143.568319, 71.535803, 144.766543, 71.535803),\n (144.766543, 71.535803, 145.964766, 71.535803),\n (107.621612, 90.949496, 107.621612, 71.535803),\n (179.378459, 124.121073, 179.378459, 123.521961),\n (179.378459, 123.521961, 179.378459, 122.92285),\n (179.378459, 122.92285, 179.378459, 122.323738),\n (179.378459, 122.323738, 179.378459, 121.724626),\n (179.378459, 121.724626, 179.378459, 121.125514),\n (179.378459, 121.125514, 179.378459, 120.526403),\n (179.378459, 120.526403, 179.378459, 119.927291),\n (179.378459, 119.927291, 179.378459, 119.328179),\n (179.378459, 119.328179, 179.378459, 118.729067),\n (179.378459, 118.729067, 179.378459, 118.129955),\n (179.378459, 118.129955, 179.378459, 117.530844),\n (179.378459, 117.530844, 179.378459, 116.931732),\n (179.378459, 116.931732, 179.378459, 116.33262),\n (179.378459, 116.33262, 179.378459, 115.733508),\n (179.378459, 115.733508, 179.378459, 115.134397),\n (179.378459, 115.134397, 179.378459, 114.535285),\n (179.378459, 114.535285, 179.378459, 113.936173),\n (179.378459, 113.936173, 179.378459, 113.337061),\n (179.378459, 113.337061, 179.378459, 112.737949),\n (179.378459, 112.737949, 179.378459, 112.138838),\n (179.378459, 112.138838, 179.378459, 111.539726),\n (179.378459, 111.539726, 179.378459, 110.940614),\n (179.378459, 110.940614, 179.378459, 110.341502),\n (179.378459, 110.341502, 179.378459, 109.742391),\n (179.378459, 109.742391, 179.378459, 109.143279),\n (179.378459, 109.143279, 179.378459, 108.544167),\n (179.378459, 108.544167, 179.378459, 107.945055),\n (179.378459, 107.945055, 179.378459, 107.345943),\n (179.378459, 107.345943, 179.378459, 106.746832),\n (179.378459, 106.746832, 179.378459, 106.14772),\n (179.378459, 106.14772, 179.378459, 105.548608),\n (179.378459, 105.548608, 179.378459, 104.949496),\n (159.964766, 124.121073, 159.964766, 123.521961),\n (159.964766, 123.521961, 159.964766, 122.92285),\n (159.964766, 122.92285, 159.964766, 122.323738),\n (159.964766, 122.323738, 159.964766, 121.724626),\n (159.964766, 121.724626, 159.964766, 121.125514),\n (159.964766, 121.125514, 159.964766, 120.526403),\n (159.964766, 120.526403, 159.964766, 119.927291),\n (159.964766, 119.927291, 159.964766, 119.328179),\n (159.964766, 119.328179, 159.964766, 118.729067),\n (159.964766, 118.729067, 159.964766, 118.129955),\n (159.964766, 118.129955, 159.964766, 117.530844),\n (159.964766, 117.530844, 159.964766, 116.931732),\n (159.964766, 116.931732, 159.964766, 116.33262),\n (159.964766, 116.33262, 159.964766, 115.733508),\n (159.964766, 115.733508, 159.964766, 115.134397),\n (159.964766, 115.134397, 159.964766, 114.535285),\n (159.964766, 114.535285, 159.964766, 113.936173),\n (159.964766, 113.936173, 159.964766, 113.337061),\n (159.964766, 113.337061, 159.964766, 112.737949),\n (159.964766, 112.737949, 159.964766, 112.138838),\n (159.964766, 112.138838, 159.964766, 111.539726),\n (159.964766, 111.539726, 159.964766, 110.940614),\n (159.964766, 110.940614, 159.964766, 110.341502),\n (159.964766, 110.341502, 159.964766, 109.742391),\n (159.964766, 109.742391, 159.964766, 109.143279),\n (159.964766, 109.143279, 159.964766, 108.544167),\n (159.964766, 108.544167, 159.964766, 107.945055),\n (159.964766, 107.945055, 159.964766, 107.345943),\n (159.964766, 107.345943, 159.964766, 106.746832),\n (159.964766, 106.746832, 159.964766, 106.14772),\n (159.964766, 106.14772, 159.964766, 105.548608),\n (159.964766, 105.548608, 159.964766, 104.949496),\n (179.378459, 181.635804, 179.378459, 181.036692),\n (179.378459, 181.036692, 179.378459, 180.43758),\n (179.378459, 180.43758, 179.378459, 179.838468),\n (179.378459, 179.838468, 179.378459, 179.239357),\n (179.378459, 179.239357, 179.378459, 178.640245),\n (179.378459, 178.640245, 179.378459, 178.041133),\n (179.378459, 178.041133, 179.378459, 177.442021),\n (179.378459, 177.442021, 179.378459, 176.842909),\n (179.378459, 176.842909, 179.378459, 176.243798),\n (179.378459, 176.243798, 179.378459, 175.644686),\n (179.378459, 175.644686, 179.378459, 175.045574),\n (179.378459, 175.045574, 179.378459, 174.446462),\n (179.378459, 174.446462, 179.378459, 173.847351),\n (179.378459, 173.847351, 179.378459, 173.248239),\n (179.378459, 173.248239, 179.378459, 172.649127),\n (179.378459, 172.649127, 179.378459, 172.050015),\n (179.378459, 172.050015, 179.378459, 171.450903),\n (179.378459, 171.450903, 179.378459, 170.851792),\n (179.378459, 170.851792, 179.378459, 170.25268),\n (179.378459, 170.25268, 179.378459, 169.653568),\n (179.378459, 169.653568, 179.378459, 169.054456),\n (179.378459, 169.054456, 179.378459, 168.455345),\n (179.378459, 168.455345, 179.378459, 167.856233),\n (179.378459, 167.856233, 179.378459, 167.257121),\n (179.378459, 167.257121, 179.378459, 166.658009),\n (179.378459, 166.658009, 179.378459, 166.058897),\n (179.378459, 166.058897, 179.378459, 165.459786),\n (179.378459, 165.459786, 179.378459, 164.860674),\n (179.378459, 164.860674, 179.378459, 164.261562),\n (179.378459, 164.261562, 179.378459, 163.66245),\n (179.378459, 163.66245, 179.378459, 163.063339),\n (179.378459, 163.063339, 179.378459, 162.464227),\n (159.964766, 181.635804, 159.964766, 181.036692),\n (159.964766, 181.036692, 159.964766, 180.43758),\n (159.964766, 180.43758, 159.964766, 179.838468),\n (159.964766, 179.838468, 159.964766, 179.239357),\n (159.964766, 179.239357, 159.964766, 178.640245),\n (159.964766, 178.640245, 159.964766, 178.041133),\n (159.964766, 178.041133, 159.964766, 177.442021),\n (159.964766, 177.442021, 159.964766, 176.842909),\n (159.964766, 176.842909, 159.964766, 176.243798),\n (159.964766, 176.243798, 159.964766, 175.644686),\n (159.964766, 175.644686, 159.964766, 175.045574),\n (159.964766, 175.045574, 159.964766, 174.446462),\n (159.964766, 174.446462, 159.964766, 173.847351),\n (159.964766, 173.847351, 159.964766, 173.248239),\n (159.964766, 173.248239, 159.964766, 172.649127),\n (159.964766, 172.649127, 159.964766, 172.050015),\n (159.964766, 172.050015, 159.964766, 171.450903),\n (159.964766, 171.450903, 159.964766, 170.851792),\n (159.964766, 170.851792, 159.964766, 170.25268),\n (159.964766, 170.25268, 159.964766, 169.653568),\n (159.964766, 169.653568, 159.964766, 169.054456),\n (159.964766, 169.054456, 159.964766, 168.455345),\n (159.964766, 168.455345, 159.964766, 167.856233),\n (159.964766, 167.856233, 159.964766, 167.257121),\n (159.964766, 167.257121, 159.964766, 166.658009),\n (159.964766, 166.658009, 159.964766, 166.058897),\n (159.964766, 166.058897, 159.964766, 165.459786),\n (159.964766, 165.459786, 159.964766, 164.860674),\n (159.964766, 164.860674, 159.964766, 164.261562),\n (159.964766, 164.261562, 159.964766, 163.66245),\n (159.964766, 163.66245, 159.964766, 163.063339),\n (159.964766, 163.063339, 159.964766, 162.464227),\n (159.964766, 162.464227, 159.964766, 124.121073),\n (179.378459, 162.464227, 179.378459, 124.121073),\n (159.964766, 104.949496, 179.378459, 104.949496),\n (159.964766, 181.635804, 179.378459, 181.635804),\n (179.378459, 124.121073, 159.964766, 124.121073),\n (179.378459, 162.464227, 159.964766, 162.464227)\n]\nVISIBLE_CIRCLES = [\n (127.0975, 124.121073, 7.912079),\n (127.0975, 162.464227, 7.912079)\n]\nVISIBLE_ARCS = [\n (126.793189, 124.121073, 19.171577, -180.0, 0.0),\n (126.793189, 162.464227, 19.171577, -0.0, 180.0)\n]\nHIDDEN_SEGMENTS = [\n (135.0095, 71.5358, 135.0095, 90.9495),\n (119.1854, 90.9495, 119.1854, 71.5358),\n (159.9647, 154.5521, 179.3784, 154.5521),\n (159.9647, 170.3763, 179.3784, 170.3763),\n (159.9647, 116.209, 179.3784, 116.209),\n (159.9647, 132.0331, 179.3784, 132.0331)\n]\n# (orient, text, p1, p2, base) for linear; (orient, text, center, radius, angle) for diameter\nDIMENSIONS = [\n ('horizontal', '100', (107.6216, 162.4642), (145.9647, 162.4642), (126.7931, 173.4642)),\n ('vertical', '100', (145.9647, 162.4642), (145.9647, 124.1211), (156.9647, 143.2926)),\n ('diameter', '%%c41.2698', (127.0975, 162.4642), 7.9121, 45),\n ('horizontal', '50.7937', (107.6216, 162.4642), (127.0975, 162.4642), (117.3595, 173.4642)),\n ('diameter', '%%c41.2698', (127.0975, 124.1211), 7.9121, 45),\n ('horizontal', '50.7937', (107.6216, 124.1211), (127.0975, 124.1211), (117.3595, 135.1211)),\n ('vertical', '100', (127.0975, 162.4642), (127.0975, 124.1211), (138.0975, 143.2926)),\n ('radius', 'R50', (126.7931, 162.4642), 19.1716, 45),\n ('horizontal', '50.6314', (179.3784, 162.4642), (159.9647, 162.4642), (169.6716, 151.4642))\n]\n\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; _ds.dxf.dimasz = 2.5\n _ds.dxf.dimexe = 1.25; _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\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\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,\n angle=(0 if d[0] == \"horizontal\" else 90),\n 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,\n 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,\n 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,\n text=text, dimstyle=\"EZDXF\").render()\n\n doc.saveas(out_path)\n\n\nif __name__ == \"__main__\":\n out = sys.argv[1] if len(sys.argv) > 1 else \"0071_00719412_gt.dxf\"\n draw(out)\n print(\"wrote\", out)\n```"}], "images": ["images/0071_00719412.png"], "id": "0071_00719412"} {"messages": [{"role": "user", "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 27.37 mm bounding box. It is extruded to a thickness of 174.55 mm."}, {"role": "assistant", "content": "```python\n#!/usr/bin/env python3\n# -*- coding: utf-8 -*-\n# Ground-truth 2D engineering drawing for part: 0072_00727924\n# Self-contained: reproduces the three-view DXF via ezdxf, NO FreeCAD needed.\n# Coordinates are A4 page millimetres (scale=0.7056631433823753, page=[297.0, 210.0]).\n# visible edges -> solid (layer OUTLINE); hidden edges -> dashed (layer HIDDEN)\n# dimensions -> real movable DIMENSION entities (text = true mm value)\n# Run: python 0072_00727924_gt.py [out.dxf]\nimport sys\nimport ezdxf\nimport math\n\nSCALE = 0.7056631433823753\nPAGE = [297.0, 210.0]\n\nVISIBLE_SEGMENTS = [\n (110.197987, 173.700291, 110.197987, 178.157111),\n (110.197987, 178.157111, 94.599117, 178.157111),\n (94.599117, 197.469997, 94.599117, 178.157111),\n (94.599117, 197.469997, 90.885101, 197.469997),\n (58.944559, 197.469997, 54.487739, 197.469997),\n (54.487739, 197.469997, 54.487739, 178.157111),\n (54.487739, 178.157111, 39.631673, 178.157111),\n (39.631673, 178.157111, 39.631673, 173.700291),\n (39.631673, 173.700291, 110.197987, 173.700291),\n (110.197987, 159.700291, 110.197987, 36.529997),\n (110.197987, 36.529997, 94.599117, 36.529997),\n (110.197987, 159.700291, 94.599117, 159.700291),\n (94.599117, 159.700291, 94.599117, 36.529997),\n (94.599117, 36.529997, 90.885101, 36.529997),\n (90.885101, 159.700291, 90.885101, 36.529997),\n (94.599117, 159.700291, 90.885101, 159.700291),\n (90.885101, 36.529997, 89.886959, 36.529997),\n (89.886959, 36.529997, 88.888817, 36.529997),\n (88.888817, 36.529997, 87.890675, 36.529997),\n (87.890675, 36.529997, 86.892533, 36.529997),\n (86.892533, 36.529997, 85.894391, 36.529997),\n (85.894391, 36.529997, 84.896249, 36.529997),\n (84.896249, 36.529997, 83.898107, 36.529997),\n (83.898107, 36.529997, 82.899965, 36.529997),\n (82.899965, 36.529997, 81.901823, 36.529997),\n (81.901823, 36.529997, 80.903681, 36.529997),\n (80.903681, 36.529997, 79.90554, 36.529997),\n (79.90554, 36.529997, 78.907398, 36.529997),\n (78.907398, 36.529997, 77.909256, 36.529997),\n (77.909256, 36.529997, 76.911114, 36.529997),\n (76.911114, 36.529997, 75.912972, 36.529997),\n (75.912972, 36.529997, 74.91483, 36.529997),\n (74.91483, 36.529997, 73.916688, 36.529997),\n (73.916688, 36.529997, 72.918546, 36.529997),\n (72.918546, 36.529997, 71.920404, 36.529997),\n (71.920404, 36.529997, 70.922262, 36.529997),\n (70.922262, 36.529997, 69.92412, 36.529997),\n (69.92412, 36.529997, 68.925978, 36.529997),\n (68.925978, 36.529997, 67.927836, 36.529997),\n (67.927836, 36.529997, 66.929694, 36.529997),\n (66.929694, 36.529997, 65.931552, 36.529997),\n (65.931552, 36.529997, 64.93341, 36.529997),\n (64.93341, 36.529997, 63.935268, 36.529997),\n (63.935268, 36.529997, 62.937126, 36.529997),\n (62.937126, 36.529997, 61.938985, 36.529997),\n (61.938985, 36.529997, 60.940843, 36.529997),\n (60.940843, 36.529997, 59.942701, 36.529997),\n (59.942701, 36.529997, 58.944559, 36.529997),\n (58.944559, 159.700291, 58.944559, 36.529997),\n (90.885101, 159.700291, 89.886959, 159.700291),\n (89.886959, 159.700291, 88.888817, 159.700291),\n (88.888817, 159.700291, 87.890675, 159.700291),\n (87.890675, 159.700291, 86.892533, 159.700291),\n (86.892533, 159.700291, 85.894391, 159.700291),\n (85.894391, 159.700291, 84.896249, 159.700291),\n (84.896249, 159.700291, 83.898107, 159.700291),\n (83.898107, 159.700291, 82.899965, 159.700291),\n (82.899965, 159.700291, 81.901823, 159.700291),\n (81.901823, 159.700291, 80.903681, 159.700291),\n (80.903681, 159.700291, 79.90554, 159.700291),\n (79.90554, 159.700291, 78.907398, 159.700291),\n (78.907398, 159.700291, 77.909256, 159.700291),\n (77.909256, 159.700291, 76.911114, 159.700291),\n (76.911114, 159.700291, 75.912972, 159.700291),\n (75.912972, 159.700291, 74.91483, 159.700291),\n (74.91483, 159.700291, 73.916688, 159.700291),\n (73.916688, 159.700291, 72.918546, 159.700291),\n (72.918546, 159.700291, 71.920404, 159.700291),\n (71.920404, 159.700291, 70.922262, 159.700291),\n (70.922262, 159.700291, 69.92412, 159.700291),\n (69.92412, 159.700291, 68.925978, 159.700291),\n (68.925978, 159.700291, 67.927836, 159.700291),\n (67.927836, 159.700291, 66.929694, 159.700291),\n (66.929694, 159.700291, 65.931552, 159.700291),\n (65.931552, 159.700291, 64.93341, 159.700291),\n (64.93341, 159.700291, 63.935268, 159.700291),\n (63.935268, 159.700291, 62.937126, 159.700291),\n (62.937126, 159.700291, 61.938985, 159.700291),\n (61.938985, 159.700291, 60.940843, 159.700291),\n (60.940843, 159.700291, 59.942701, 159.700291),\n (59.942701, 159.700291, 58.944559, 159.700291),\n (58.944559, 36.529997, 54.487739, 36.529997),\n (54.487739, 159.700291, 54.487739, 36.529997),\n (58.944559, 159.700291, 54.487739, 159.700291),\n (54.487739, 36.529997, 39.631673, 36.529997),\n (39.631673, 159.700291, 39.631673, 36.529997),\n (54.487739, 159.700291, 39.631673, 159.700291),\n (124.197987, 197.469997, 247.368281, 197.469997),\n (247.368281, 197.469997, 247.368281, 178.157111),\n (124.197987, 197.469997, 124.197987, 178.157111),\n (124.197987, 178.157111, 247.368281, 178.157111),\n (247.368281, 178.157111, 247.368281, 173.700291),\n (124.197987, 173.700291, 247.368281, 173.700291),\n (124.197987, 178.157111, 124.197987, 173.700291)\n]\nVISIBLE_CIRCLES = [\n\n]\nVISIBLE_ARCS = [\n (74.91483, 197.469997, 15.970271, -180.0, -0.0)\n]\nHIDDEN_SEGMENTS = [\n (247.3683, 181.4997, 124.198, 181.4997)\n]\n# (orient, text, p1, p2, base) for linear; (orient, text, center, radius, angle) for diameter\nDIMENSIONS = [\n ('horizontal', '21.0526', (54.4877, 178.1571), (39.6317, 178.1571), (47.0597, 167.1571)),\n ('horizontal', '22.1053', (110.198, 178.1571), (94.5991, 178.1571), (102.3986, 167.1571)),\n ('horizontal', '56.8421', (94.5991, 197.47), (54.4877, 197.47), (74.5434, 186.47)),\n ('horizontal', '100', (39.6317, 173.7003), (110.198, 173.7003), (74.9148, 184.7003)),\n ('vertical', '6.3158', (110.198, 173.7003), (110.198, 178.1571), (99.198, 175.9287)),\n ('vertical', '27.3684', (94.5991, 178.1571), (94.5991, 197.47), (83.5991, 187.8136)),\n ('radius', 'R22.6316', (74.9148, 197.47), 15.9703, 45),\n ('horizontal', '174.546', (124.198, 173.7003), (247.3683, 173.7003), (185.7832, 184.7003))\n]\n\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; _ds.dxf.dimasz = 2.5\n _ds.dxf.dimexe = 1.25; _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\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\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,\n angle=(0 if d[0] == \"horizontal\" else 90),\n 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,\n 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,\n 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,\n text=text, dimstyle=\"EZDXF\").render()\n\n doc.saveas(out_path)\n\n\nif __name__ == \"__main__\":\n out = sys.argv[1] if len(sys.argv) > 1 else \"0072_00727924_gt.dxf\"\n draw(out)\n print(\"wrote\", out)\n```"}], "images": ["images/0072_00727924.png"], "id": "0072_00727924"} {"messages": [{"role": "user", "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 a rectangular cutout 51.58 x 60 mm. It is extruded to a thickness of 7.45 mm. The outline includes one or more oblique (angled) edges."}, {"role": "assistant", "content": "```python\n#!/usr/bin/env python3\n# -*- coding: utf-8 -*-\n# Ground-truth 2D engineering drawing for part: 0072_00728101\n# Self-contained: reproduces the three-view DXF via ezdxf, NO FreeCAD needed.\n# Coordinates are A4 page millimetres (scale=0.8387032211623922, page=[297.0, 210.0]).\n# visible edges -> solid (layer OUTLINE); hidden edges -> dashed (layer HIDDEN)\n# dimensions -> real movable DIMENSION entities (text = true mm value)\n# Run: python 0072_00728101_gt.py [out.dxf]\nimport sys\nimport ezdxf\nimport math\n\nSCALE = 0.8387032211623922\nPAGE = [297.0, 210.0]\n\nVISIBLE_SEGMENTS = [\n (164.718197, 168.961101, 164.718197, 152.187037),\n (164.718197, 152.187037, 118.810231, 85.090779),\n (118.810231, 85.090779, 102.036167, 85.090779),\n (102.036167, 85.090779, 102.036167, 168.961101),\n (102.036167, 168.961101, 109.098931, 168.961101),\n (109.098931, 168.961101, 164.718197, 168.961101),\n (145.295596, 146.007118, 126.755841, 118.638908),\n (121.458768, 156.601264, 139.998523, 156.601264),\n (114.396004, 149.5385, 102.036167, 168.961101),\n (114.396004, 123.053135, 114.396004, 149.5385),\n (164.718197, 64.845117, 164.718197, 71.090779),\n (102.036167, 64.845117, 102.036167, 71.090779),\n (102.036167, 71.090779, 109.098931, 71.090779),\n (109.098931, 71.090779, 164.718197, 71.090779),\n (102.036167, 64.845117, 109.098931, 64.845117),\n (109.098931, 64.845117, 164.718197, 64.845117),\n (184.96386, 85.090779, 178.718197, 85.090779),\n (178.718197, 85.090779, 178.718197, 168.961101),\n (184.96386, 168.961101, 178.718197, 168.961101),\n (184.96386, 85.090779, 184.96386, 168.961101),\n (178.718197, 169.348749, 184.96386, 169.348749)\n]\nVISIBLE_CIRCLES = [\n\n]\nVISIBLE_ARCS = [\n (139.898752, 149.930037, 6.671973, -36.013074, 89.143176),\n (105.567549, 153.069882, 16.278867, 12.528808, 77.471192),\n (105.567549, 153.069882, 16.278867, 77.471192, 102.528808),\n (121.275133, 122.803811, 6.883646, 177.924301, -37.231949),\n (-472.193389, 151.049551, 657.406596, 1.561274, 1.595046),\n (-615.590456, 92.15178, 798.032374, 5.523305, 5.551007)\n]\nHIDDEN_SEGMENTS = [\n (118.8102, 64.8451, 118.8102, 71.0908),\n (145.2956, 64.8451, 145.2956, 71.0908),\n (126.7558, 64.8451, 126.7558, 71.0908),\n (139.9985, 64.8451, 139.9985, 71.0908),\n (121.4588, 64.8451, 121.4588, 71.0908),\n (114.396, 64.8451, 114.396, 71.0908),\n (146.5707, 71.0908, 146.5707, 64.8451),\n (114.3915, 71.0908, 114.3915, 64.8451),\n (184.9638, 152.187, 178.7182, 152.187),\n (184.9638, 146.0071, 178.7182, 146.0071),\n (184.9638, 118.6389, 178.7182, 118.6389),\n (184.9638, 156.6012, 178.7182, 156.6012),\n (184.9638, 149.5385, 178.7182, 149.5385),\n (184.9638, 123.0531, 178.7182, 123.0531),\n (178.7182, 115.9201, 184.9638, 115.9201)\n]\n# (orient, text, p1, p2, base) for linear; (orient, text, center, radius, angle) for diameter\nDIMENSIONS = [\n ('horizontal', '20', (118.8102, 85.0908), (102.0362, 85.0908), (110.4232, 74.0908)),\n ('horizontal', '74.7368', (102.0362, 168.9611), (164.7182, 168.9611), (133.3772, 179.9611)),\n ('vertical', '20', (164.7182, 168.9611), (164.7182, 152.187), (175.7182, 160.5741)),\n ('vertical', '100', (102.0362, 85.0908), (102.0362, 168.9611), (91.0362, 127.0259)),\n ('aligned', '96.9336', (164.7182, 152.187), (118.8102, 85.0908), (150.8426, 112.4274)),\n ('horizontal', '51.5789', (102.0362, 168.9611), (145.2956, 168.9611), (123.6659, 179.9611)),\n ('vertical', '60', (102.0362, 168.9611), (102.0362, 118.6389), (113.0362, 143.8)),\n ('radius', 'R19.4096', (105.5675, 153.0699), 16.2789, 45),\n ('radius', 'R7.9551', (139.8988, 149.93), 6.672, 45),\n ('radius', 'R8.2075', (121.2751, 122.8038), 6.8837, 45),\n ('horizontal', '7.4468', (184.9638, 168.9611), (178.7182, 168.9611), (181.841, 157.9611))\n]\n\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; _ds.dxf.dimasz = 2.5\n _ds.dxf.dimexe = 1.25; _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\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\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,\n angle=(0 if d[0] == \"horizontal\" else 90),\n 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,\n 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,\n 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,\n text=text, dimstyle=\"EZDXF\").render()\n\n doc.saveas(out_path)\n\n\nif __name__ == \"__main__\":\n out = sys.argv[1] if len(sys.argv) > 1 else \"0072_00728101_gt.dxf\"\n draw(out)\n print(\"wrote\", out)\n```"}], "images": ["images/0072_00728101.png"], "id": "0072_00728101"} {"messages": [{"role": "user", "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. It is extruded to a thickness of 273.38 mm. The outline includes one or more oblique (angled) edges."}, {"role": "assistant", "content": "```python\n#!/usr/bin/env python3\n# -*- coding: utf-8 -*-\n# Ground-truth 2D engineering drawing for part: 0073_00731762\n# Self-contained: reproduces the three-view DXF via ezdxf, NO FreeCAD needed.\n# Coordinates are A4 page millimetres (scale=0.1762289106155026, page=[297.0, 210.0]).\n# visible edges -> solid (layer OUTLINE); hidden edges -> dashed (layer HIDDEN)\n# dimensions -> real movable DIMENSION entities (text = true mm value)\n# Run: python 0073_00731762_gt.py [out.dxf]\nimport sys\nimport ezdxf\nimport math\n\nSCALE = 0.1762289106155026\nPAGE = [297.0, 210.0]\n\nVISIBLE_SEGMENTS = [\n (95.015622, 178.62388, 107.709746, 166.399908),\n (117.112802, 166.399908, 129.806926, 178.62388),\n (129.806926, 178.62388, 132.15769, 176.273116),\n (132.15769, 176.273116, 119.933718, 164.049145),\n (104.88883, 164.049145, 92.664858, 176.273116),\n (92.664858, 176.273116, 95.015622, 178.62388),\n (95.015622, 68.52388, 95.015622, 116.701332),\n (95.015622, 116.701332, 107.709746, 116.701332),\n (107.709746, 68.52388, 107.709746, 116.701332),\n (95.015622, 68.52388, 107.709746, 68.52388),\n (107.709746, 68.52388, 109.365912, 68.52388),\n (107.709746, 116.701332, 109.365912, 116.701332),\n (109.365912, 116.701332, 115.456636, 116.701332),\n (109.365912, 68.52388, 115.456636, 68.52388),\n (115.456636, 68.52388, 117.112802, 68.52388),\n (117.112802, 68.52388, 117.112802, 116.701332),\n (115.456636, 116.701332, 117.112802, 116.701332),\n (117.112802, 116.701332, 129.806926, 116.701332),\n (129.806926, 68.52388, 129.806926, 116.701332),\n (117.112802, 68.52388, 129.806926, 68.52388),\n (129.806926, 116.701332, 132.15769, 116.701332),\n (132.15769, 68.52388, 132.15769, 116.701332),\n (129.806926, 68.52388, 132.15769, 68.52388),\n (92.664858, 68.52388, 92.664858, 116.701332),\n (92.664858, 116.701332, 95.015622, 116.701332),\n (92.664858, 68.52388, 95.015622, 68.52388),\n (109.365912, 116.701332, 109.365912, 68.52388),\n (115.456636, 116.701332, 115.456636, 68.52388),\n (194.335142, 178.62388, 146.15769, 178.62388),\n (194.335142, 130.701332, 194.335142, 160.287922),\n (194.335142, 160.287922, 146.15769, 160.287922),\n (146.15769, 130.701332, 146.15769, 160.287922),\n (146.15769, 160.287922, 146.15769, 164.049145),\n (194.335142, 160.287922, 194.335142, 164.049145),\n (146.15769, 164.049145, 146.15769, 176.273116),\n (194.335142, 176.273116, 146.15769, 176.273116),\n (194.335142, 164.049145, 194.335142, 176.273116),\n (146.15769, 176.273116, 146.15769, 178.62388),\n (194.335142, 176.273116, 194.335142, 178.62388),\n (146.15769, 130.701332, 194.335142, 130.701332),\n (194.335142, 164.049145, 146.15769, 164.049145)\n]\nVISIBLE_CIRCLES = [\n\n]\nVISIBLE_ARCS = [\n (103.335409, 162.248747, 6.030503, -60.562016, 43.500484),\n (112.411274, 146.509887, 12.138074, 120.234375, 59.765625),\n (121.487139, 162.248747, 6.030503, 136.499516, -119.437984),\n (121.636438, 162.351989, 2.404078, 135.093766, -120.843734),\n (112.411274, 146.574198, 15.872865, 120.234375, 59.765625),\n (103.18611, 162.351989, 2.404078, -59.156266, 44.906234)\n]\nHIDDEN_SEGMENTS = [\n (106.2993, 68.5239, 106.2993, 116.7013),\n (118.5233, 68.5239, 118.5233, 116.7013),\n (120.4039, 68.5239, 120.4039, 116.7013),\n (104.4187, 68.5239, 104.4187, 116.7013),\n (100.2732, 116.7013, 100.2732, 68.5239),\n (124.5493, 116.7013, 124.5493, 68.5239),\n (119.2324, 116.7013, 119.2324, 68.5239),\n (96.5384, 116.7013, 96.5384, 68.5239),\n (128.2841, 116.7013, 128.2841, 68.5239),\n (105.5902, 116.7013, 105.5902, 68.5239),\n (194.3351, 166.3999, 146.1577, 166.3999),\n (194.3351, 156.9969, 146.1577, 156.9969),\n (146.1577, 134.3718, 194.3351, 134.3718)\n]\n# (orient, text, p1, p2, base) for linear; (orient, text, center, radius, angle) for diameter\nDIMENSIONS = [\n ('horizontal', '69.3642', (106.2993, 156.9969), (118.5233, 156.9969), (112.4113, 167.9969)),\n ('horizontal', '90.707', (120.4039, 160.2879), (104.4187, 160.2879), (112.4113, 149.2879)),\n ('aligned', '100', (95.0156, 178.6239), (107.7098, 166.3999), (108.9927, 180.4354)),\n ('aligned', '100', (117.1128, 166.3999), (129.8069, 178.6239), (115.8298, 180.4354)),\n ('aligned', '18.8646', (129.8069, 178.6239), (132.1577, 176.2731), (138.7605, 185.2267)),\n ('aligned', '98.0957', (132.1577, 176.2731), (119.9337, 164.0491), (133.8239, 162.383)),\n ('aligned', '98.0957', (104.8888, 164.0491), (92.6649, 176.2731), (90.9987, 162.383)),\n ('aligned', '18.8646', (92.6649, 176.2731), (95.0156, 178.6239), (86.0621, 185.2267)),\n ('radius', 'R34.2197', (103.3354, 162.2488), 6.0305, 45),\n ('radius', 'R68.8767', (112.4113, 146.5099), 12.1381, 45),\n ('radius', 'R13.6418', (121.6364, 162.352), 2.4041, 45),\n ('radius', 'R90.0696', (112.4113, 146.5742), 15.8729, 135),\n ('horizontal', '273.38', (194.3351, 178.6239), (146.1577, 178.6239), (170.2464, 167.6239))\n]\n\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; _ds.dxf.dimasz = 2.5\n _ds.dxf.dimexe = 1.25; _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\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\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,\n angle=(0 if d[0] == \"horizontal\" else 90),\n 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,\n 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,\n 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,\n text=text, dimstyle=\"EZDXF\").render()\n\n doc.saveas(out_path)\n\n\nif __name__ == \"__main__\":\n out = sys.argv[1] if len(sys.argv) > 1 else \"0073_00731762_gt.dxf\"\n draw(out)\n print(\"wrote\", out)\n```"}], "images": ["images/0073_00731762.png"], "id": "0073_00731762"} {"messages": [{"role": "user", "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 67.61 mm wide and 100 mm tall, featuring a circular hole of diameter 28.17 mm. It is extruded to a thickness of 26.48 mm."}, {"role": "assistant", "content": "```python\n#!/usr/bin/env python3\n# -*- coding: utf-8 -*-\n# Ground-truth 2D engineering drawing for part: 0073_00731796\n# Self-contained: reproduces the three-view DXF via ezdxf, NO FreeCAD needed.\n# Coordinates are A4 page millimetres (scale=0.5995584439359549, page=[297.0, 210.0]).\n# visible edges -> solid (layer OUTLINE); hidden edges -> dashed (layer HIDDEN)\n# dimensions -> real movable DIMENSION entities (text = true mm value)\n# Run: python 0073_00731796_gt.py [out.dxf]\nimport sys\nimport ezdxf\nimport math\n\nSCALE = 0.5995584439359549\nPAGE = [297.0, 210.0]\n\nVISIBLE_SEGMENTS = [\n (148.828064, 177.116644, 148.828064, 117.1608),\n (108.294536, 117.1608, 108.294536, 177.116644),\n (108.294536, 177.116644, 148.828064, 177.116644),\n (148.828064, 67.016644, 148.828064, 82.894036),\n (108.294536, 67.016644, 108.294536, 82.894036),\n (108.294536, 82.894036, 148.828064, 82.894036),\n (108.294536, 67.016644, 148.828064, 67.016644),\n (178.705456, 96.894036, 178.705456, 97.527372),\n (178.705456, 97.527372, 178.705456, 98.160708),\n (178.705456, 98.160708, 178.705456, 98.794045),\n (178.705456, 98.794045, 178.705456, 99.427381),\n (178.705456, 99.427381, 178.705456, 100.060718),\n (178.705456, 100.060718, 178.705456, 100.694054),\n (178.705456, 100.694054, 178.705456, 101.32739),\n (178.705456, 101.32739, 178.705456, 101.960727),\n (178.705456, 101.960727, 178.705456, 102.594063),\n (178.705456, 102.594063, 178.705456, 103.2274),\n (178.705456, 103.2274, 178.705456, 103.860736),\n (178.705456, 103.860736, 178.705456, 104.494072),\n (178.705456, 104.494072, 178.705456, 105.127409),\n (178.705456, 105.127409, 178.705456, 105.760745),\n (178.705456, 105.760745, 178.705456, 106.394081),\n (178.705456, 106.394081, 178.705456, 107.027418),\n (178.705456, 107.027418, 178.705456, 107.660754),\n (178.705456, 107.660754, 178.705456, 108.294091),\n (178.705456, 108.294091, 178.705456, 108.927427),\n (178.705456, 108.927427, 178.705456, 109.560763),\n (178.705456, 109.560763, 178.705456, 110.1941),\n (178.705456, 110.1941, 178.705456, 110.827436),\n (178.705456, 110.827436, 178.705456, 111.460773),\n (178.705456, 111.460773, 178.705456, 112.094109),\n (178.705456, 112.094109, 178.705456, 112.727445),\n (178.705456, 112.727445, 178.705456, 113.360782),\n (178.705456, 113.360782, 178.705456, 113.994118),\n (178.705456, 113.994118, 178.705456, 114.627454),\n (178.705456, 114.627454, 178.705456, 115.260791),\n (178.705456, 115.260791, 178.705456, 115.894127),\n (178.705456, 115.894127, 178.705456, 116.527464),\n (178.705456, 116.527464, 178.705456, 117.1608),\n (162.828065, 96.894036, 162.828065, 97.527372),\n (162.828065, 97.527372, 162.828065, 98.160708),\n (162.828065, 98.160708, 162.828065, 98.794045),\n (162.828065, 98.794045, 162.828065, 99.427381),\n (162.828065, 99.427381, 162.828065, 100.060718),\n (162.828065, 100.060718, 162.828065, 100.694054),\n (162.828065, 100.694054, 162.828065, 101.32739),\n (162.828065, 101.32739, 162.828065, 101.960727),\n (162.828065, 101.960727, 162.828065, 102.594063),\n (162.828065, 102.594063, 162.828065, 103.2274),\n (162.828065, 103.2274, 162.828065, 103.860736),\n (162.828065, 103.860736, 162.828065, 104.494072),\n (162.828065, 104.494072, 162.828065, 105.127409),\n (162.828065, 105.127409, 162.828065, 105.760745),\n (162.828065, 105.760745, 162.828065, 106.394081),\n (162.828065, 106.394081, 162.828065, 107.027418),\n (162.828065, 107.027418, 162.828065, 107.660754),\n (162.828065, 107.660754, 162.828065, 108.294091),\n (162.828065, 108.294091, 162.828065, 108.927427),\n (162.828065, 108.927427, 162.828065, 109.560763),\n (162.828065, 109.560763, 162.828065, 110.1941),\n (162.828065, 110.1941, 162.828065, 110.827436),\n (162.828065, 110.827436, 162.828065, 111.460773),\n (162.828065, 111.460773, 162.828065, 112.094109),\n (162.828065, 112.094109, 162.828065, 112.727445),\n (162.828065, 112.727445, 162.828065, 113.360782),\n (162.828065, 113.360782, 162.828065, 113.994118),\n (162.828065, 113.994118, 162.828065, 114.627454),\n (162.828065, 114.627454, 162.828065, 115.260791),\n (162.828065, 115.260791, 162.828065, 115.894127),\n (162.828065, 115.894127, 162.828065, 116.527464),\n (162.828065, 116.527464, 162.828065, 117.1608),\n (162.828065, 117.1608, 162.828065, 177.116644),\n (178.705456, 177.116644, 162.828065, 177.116644),\n (178.705456, 117.1608, 178.705456, 177.116644),\n (162.828065, 96.894036, 178.705456, 96.894036),\n (178.705456, 117.1608, 162.828065, 117.1608)\n]\nVISIBLE_CIRCLES = [\n (128.5613, 117.1608, 8.444485)\n]\nVISIBLE_ARCS = [\n (128.5613, 117.1608, 20.266764, -180.0, -0.0)\n]\nHIDDEN_SEGMENTS = [\n (137.0058, 67.0167, 137.0058, 82.8941),\n (120.1168, 82.8941, 120.1168, 67.0167),\n (162.8281, 108.7164, 178.7055, 108.7164),\n (162.8281, 125.6053, 178.7055, 125.6053)\n]\n# (orient, text, p1, p2, base) for linear; (orient, text, center, radius, angle) for diameter\nDIMENSIONS = [\n ('horizontal', '67.6056', (148.8281, 117.1608), (108.2945, 117.1608), (128.5613, 106.1608)),\n ('vertical', '100', (148.8281, 177.1167), (148.8281, 117.1608), (159.8281, 147.1388)),\n ('diameter', '%%c28.169', (128.5613, 117.1608), 8.4445, 45),\n ('horizontal', '33.8028', (108.2945, 117.1608), (128.5613, 117.1608), (118.4279, 128.1608)),\n ('vertical', '100', (128.5613, 177.1167), (128.5613, 117.1608), (139.5613, 147.1388)),\n ('radius', 'R33.8028', (128.5613, 117.1608), 20.2668, 135),\n ('horizontal', '26.4818', (178.7055, 177.1167), (162.8281, 177.1167), (170.7668, 166.1167))\n]\n\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; _ds.dxf.dimasz = 2.5\n _ds.dxf.dimexe = 1.25; _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\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\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,\n angle=(0 if d[0] == \"horizontal\" else 90),\n 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,\n 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,\n 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,\n text=text, dimstyle=\"EZDXF\").render()\n\n doc.saveas(out_path)\n\n\nif __name__ == \"__main__\":\n out = sys.argv[1] if len(sys.argv) > 1 else \"0073_00731796_gt.dxf\"\n draw(out)\n print(\"wrote\", out)\n```"}], "images": ["images/0073_00731796.png"], "id": "0073_00731796"} {"messages": [{"role": "user", "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.09 mm. The outline includes one or more oblique (angled) edges."}, {"role": "assistant", "content": "```python\n#!/usr/bin/env python3\n# -*- coding: utf-8 -*-\n# Ground-truth 2D engineering drawing for part: 0073_00732454\n# Self-contained: reproduces the three-view DXF via ezdxf, NO FreeCAD needed.\n# Coordinates are A4 page millimetres (scale=1.3930199023331604, page=[297.0, 210.0]).\n# visible edges -> solid (layer OUTLINE); hidden edges -> dashed (layer HIDDEN)\n# dimensions -> real movable DIMENSION entities (text = true mm value)\n# Run: python 0073_00732454_gt.py [out.dxf]\nimport sys\nimport ezdxf\nimport math\n\nSCALE = 1.3930199023331604\nPAGE = [297.0, 210.0]\n\nVISIBLE_SEGMENTS = [\n (66.091635, 161.496398, 205.393626, 161.496398),\n (208.455208, 158.434815, 208.455208, 91.080007),\n (205.393626, 88.018425, 66.091635, 88.018425),\n (63.030053, 91.080007, 63.030053, 158.434815),\n (208.455208, 72.503579, 208.455208, 74.018425),\n (208.455208, 74.018425, 208.359533, 74.018425),\n (208.359533, 74.018425, 208.263859, 74.018425),\n (208.263859, 74.018425, 208.168185, 74.018425),\n (208.168185, 74.018425, 208.07251, 74.018425),\n (208.07251, 74.018425, 207.976836, 74.018425),\n (207.976836, 74.018425, 207.881161, 74.018425),\n (207.881161, 74.018425, 207.785487, 74.018425),\n (207.785487, 74.018425, 207.689812, 74.018425),\n (207.689812, 74.018425, 207.594138, 74.018425),\n (207.594138, 74.018425, 207.498463, 74.018425),\n (207.498463, 74.018425, 207.402789, 74.018425),\n (207.402789, 74.018425, 207.307115, 74.018425),\n (207.307115, 74.018425, 207.21144, 74.018425),\n (207.21144, 74.018425, 207.115766, 74.018425),\n (207.115766, 74.018425, 207.020091, 74.018425),\n (207.020091, 74.018425, 206.924417, 74.018425),\n (206.924417, 74.018425, 206.828742, 74.018425),\n (206.828742, 74.018425, 206.733068, 74.018425),\n (206.733068, 74.018425, 206.637393, 74.018425),\n (206.637393, 74.018425, 206.541719, 74.018425),\n (206.541719, 74.018425, 206.446045, 74.018425),\n (206.446045, 74.018425, 206.35037, 74.018425),\n (206.35037, 74.018425, 206.254696, 74.018425),\n (206.254696, 74.018425, 206.159021, 74.018425),\n (206.159021, 74.018425, 206.063347, 74.018425),\n (206.063347, 74.018425, 205.967672, 74.018425),\n (205.967672, 74.018425, 205.871998, 74.018425),\n (205.871998, 74.018425, 205.776323, 74.018425),\n (205.776323, 74.018425, 205.680649, 74.018425),\n (205.680649, 74.018425, 205.584975, 74.018425),\n (205.584975, 74.018425, 205.4893, 74.018425),\n (205.4893, 74.018425, 205.393626, 74.018425),\n (205.393626, 74.018425, 66.091635, 74.018425),\n (205.393626, 72.503579, 66.091635, 72.503579),\n (66.091635, 72.503579, 65.995961, 72.503579),\n (65.995961, 72.503579, 65.900287, 72.503579),\n (65.900287, 72.503579, 65.804612, 72.503579),\n (65.804612, 72.503579, 65.708938, 72.503579),\n (65.708938, 72.503579, 65.613263, 72.503579),\n (65.613263, 72.503579, 65.517589, 72.503579),\n (65.517589, 72.503579, 65.421914, 72.503579),\n (65.421914, 72.503579, 65.32624, 72.503579),\n (65.32624, 72.503579, 65.230565, 72.503579),\n (65.230565, 72.503579, 65.134891, 72.503579),\n (65.134891, 72.503579, 65.039217, 72.503579),\n (65.039217, 72.503579, 64.943542, 72.503579),\n (64.943542, 72.503579, 64.847868, 72.503579),\n (64.847868, 72.503579, 64.752193, 72.503579),\n (64.752193, 72.503579, 64.656519, 72.503579),\n (64.656519, 72.503579, 64.560844, 72.503579),\n (64.560844, 72.503579, 64.46517, 72.503579),\n (64.46517, 72.503579, 64.369495, 72.503579),\n (64.369495, 72.503579, 64.273821, 72.503579),\n (64.273821, 72.503579, 64.178147, 72.503579),\n (64.178147, 72.503579, 64.082472, 72.503579),\n (64.082472, 72.503579, 63.986798, 72.503579),\n (63.986798, 72.503579, 63.891123, 72.503579),\n (63.891123, 72.503579, 63.795449, 72.503579),\n (63.795449, 72.503579, 63.699774, 72.503579),\n (63.699774, 72.503579, 63.6041, 72.503579),\n (63.6041, 72.503579, 63.508425, 72.503579),\n (63.508425, 72.503579, 63.412751, 72.503579),\n (63.412751, 72.503579, 63.317077, 72.503579),\n (63.317077, 72.503579, 63.221402, 72.503579),\n (63.221402, 72.503579, 63.125728, 72.503579),\n (63.125728, 72.503579, 63.030053, 72.503579),\n (63.030053, 72.503579, 63.030053, 74.018425),\n (66.091635, 74.018425, 65.995961, 74.018425),\n (65.995961, 74.018425, 65.900287, 74.018425),\n (65.900287, 74.018425, 65.804612, 74.018425),\n (65.804612, 74.018425, 65.708938, 74.018425),\n (65.708938, 74.018425, 65.613263, 74.018425),\n (65.613263, 74.018425, 65.517589, 74.018425),\n (65.517589, 74.018425, 65.421914, 74.018425),\n (65.421914, 74.018425, 65.32624, 74.018425),\n (65.32624, 74.018425, 65.230565, 74.018425),\n (65.230565, 74.018425, 65.134891, 74.018425),\n (65.134891, 74.018425, 65.039217, 74.018425),\n (65.039217, 74.018425, 64.943542, 74.018425),\n (64.943542, 74.018425, 64.847868, 74.018425),\n (64.847868, 74.018425, 64.752193, 74.018425),\n (64.752193, 74.018425, 64.656519, 74.018425),\n (64.656519, 74.018425, 64.560844, 74.018425),\n (64.560844, 74.018425, 64.46517, 74.018425),\n (64.46517, 74.018425, 64.369495, 74.018425),\n (64.369495, 74.018425, 64.273821, 74.018425),\n (64.273821, 74.018425, 64.178147, 74.018425),\n (64.178147, 74.018425, 64.082472, 74.018425),\n (64.082472, 74.018425, 63.986798, 74.018425),\n (63.986798, 74.018425, 63.891123, 74.018425),\n (63.891123, 74.018425, 63.795449, 74.018425),\n (63.795449, 74.018425, 63.699774, 74.018425),\n (63.699774, 74.018425, 63.6041, 74.018425),\n (63.6041, 74.018425, 63.508425, 74.018425),\n (63.508425, 74.018425, 63.412751, 74.018425),\n (63.412751, 74.018425, 63.317077, 74.018425),\n (63.317077, 74.018425, 63.221402, 74.018425),\n (63.221402, 74.018425, 63.125728, 74.018425),\n (63.125728, 74.018425, 63.030053, 74.018425),\n (205.393626, 72.503579, 205.393626, 74.018425),\n (66.091635, 72.503579, 66.091635, 74.018425),\n (222.455208, 158.434815, 222.455208, 158.53049),\n (222.455208, 158.53049, 222.455208, 158.626164),\n (222.455208, 158.626164, 222.455208, 158.721839),\n (222.455208, 158.721839, 222.455208, 158.817513),\n (222.455208, 158.817513, 222.455208, 158.913188),\n (222.455208, 158.913188, 222.455208, 159.008862),\n (222.455208, 159.008862, 222.455208, 159.104537),\n (222.455208, 159.104537, 222.455208, 159.200211),\n (222.455208, 159.200211, 222.455208, 159.295885),\n (222.455208, 159.295885, 222.455208, 159.39156),\n (222.455208, 159.39156, 222.455208, 159.487234),\n (222.455208, 159.487234, 222.455208, 159.582909),\n (222.455208, 159.582909, 222.455208, 159.678583),\n (222.455208, 159.678583, 222.455208, 159.774258),\n (222.455208, 159.774258, 222.455208, 159.869932),\n (222.455208, 159.869932, 222.455208, 159.965607),\n (222.455208, 159.965607, 222.455208, 160.061281),\n (222.455208, 160.061281, 222.455208, 160.156955),\n (222.455208, 160.156955, 222.455208, 160.25263),\n (222.455208, 160.25263, 222.455208, 160.348304),\n (222.455208, 160.348304, 222.455208, 160.443979),\n (222.455208, 160.443979, 222.455208, 160.539653),\n (222.455208, 160.539653, 222.455208, 160.635328),\n (222.455208, 160.635328, 222.455208, 160.731002),\n (222.455208, 160.731002, 222.455208, 160.826677),\n (222.455208, 160.826677, 222.455208, 160.922351),\n (222.455208, 160.922351, 222.455208, 161.018025),\n (222.455208, 161.018025, 222.455208, 161.1137),\n (222.455208, 161.1137, 222.455208, 161.209374),\n (222.455208, 161.209374, 222.455208, 161.305049),\n (222.455208, 161.305049, 222.455208, 161.400723),\n (222.455208, 161.400723, 222.455208, 161.496398),\n (222.455208, 161.496398, 223.970053, 161.496398),\n (223.970053, 158.434815, 223.970053, 158.53049),\n (223.970053, 158.53049, 223.970053, 158.626164),\n (223.970053, 158.626164, 223.970053, 158.721839),\n (223.970053, 158.721839, 223.970053, 158.817513),\n (223.970053, 158.817513, 223.970053, 158.913188),\n (223.970053, 158.913188, 223.970053, 159.008862),\n (223.970053, 159.008862, 223.970053, 159.104537),\n (223.970053, 159.104537, 223.970053, 159.200211),\n (223.970053, 159.200211, 223.970053, 159.295885),\n (223.970053, 159.295885, 223.970053, 159.39156),\n (223.970053, 159.39156, 223.970053, 159.487234),\n (223.970053, 159.487234, 223.970053, 159.582909),\n (223.970053, 159.582909, 223.970053, 159.678583),\n (223.970053, 159.678583, 223.970053, 159.774258),\n (223.970053, 159.774258, 223.970053, 159.869932),\n (223.970053, 159.869932, 223.970053, 159.965607),\n (223.970053, 159.965607, 223.970053, 160.061281),\n (223.970053, 160.061281, 223.970053, 160.156955),\n (223.970053, 160.156955, 223.970053, 160.25263),\n (223.970053, 160.25263, 223.970053, 160.348304),\n (223.970053, 160.348304, 223.970053, 160.443979),\n (223.970053, 160.443979, 223.970053, 160.539653),\n (223.970053, 160.539653, 223.970053, 160.635328),\n (223.970053, 160.635328, 223.970053, 160.731002),\n (223.970053, 160.731002, 223.970053, 160.826677),\n (223.970053, 160.826677, 223.970053, 160.922351),\n (223.970053, 160.922351, 223.970053, 161.018025),\n (223.970053, 161.018025, 223.970053, 161.1137),\n (223.970053, 161.1137, 223.970053, 161.209374),\n (223.970053, 161.209374, 223.970053, 161.305049),\n (223.970053, 161.305049, 223.970053, 161.400723),\n (223.970053, 161.400723, 223.970053, 161.496398),\n (222.455208, 88.018425, 223.970053, 88.018425),\n (223.970053, 91.080007, 223.970053, 158.434815),\n (222.455208, 91.080007, 222.455208, 158.434815),\n (222.455208, 158.434815, 223.970053, 158.434815),\n (222.455208, 91.080007, 223.970053, 91.080007)\n]\nVISIBLE_CIRCLES = [\n\n]\nVISIBLE_ARCS = [\n (66.091635, 158.434815, 3.061582, 90.0, -180.0),\n (205.393626, 158.434815, 3.061582, 0.0, 90.0),\n (205.393626, 91.080007, 3.061582, -90.0, 0.0),\n (66.091635, 91.080007, 3.061582, 180.0, -90.0),\n (196.253043, 18964.627211, 18892.126674, -89.972279, -89.962993),\n (-603.541468, 109.894023, 826.246263, -1.51706, -1.30482),\n (-224.307609, 82.922329, 448.327412, 0.65132, 1.042543)\n]\nHIDDEN_SEGMENTS = [\n\n]\n# (orient, text, p1, p2, base) for linear; (orient, text, center, radius, angle) for diameter\nDIMENSIONS = [\n ('horizontal', '100', (66.0916, 88.0184), (205.3936, 88.0184), (135.7426, 99.0184)),\n ('vertical', '48.3516', (208.4552, 91.08), (208.4552, 158.4349), (197.4552, 124.7574)),\n ('radius', 'R2.1978', (66.0916, 91.08), 3.0616, 45),\n ('horizontal', '1.0875', (222.4552, 91.08), (223.9701, 91.08), (223.2126, 102.08))\n]\n\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; _ds.dxf.dimasz = 2.5\n _ds.dxf.dimexe = 1.25; _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\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\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,\n angle=(0 if d[0] == \"horizontal\" else 90),\n 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,\n 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,\n 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,\n text=text, dimstyle=\"EZDXF\").render()\n\n doc.saveas(out_path)\n\n\nif __name__ == \"__main__\":\n out = sys.argv[1] if len(sys.argv) > 1 else \"0073_00732454_gt.dxf\"\n draw(out)\n print(\"wrote\", out)\n```"}], "images": ["images/0073_00732454.png"], "id": "0073_00732454"} {"messages": [{"role": "user", "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.19 mm tall, featuring 2 circular holes, each of diameter 16.67 mm. It is extruded to a thickness of 3.95 mm."}, {"role": "assistant", "content": "```python\n#!/usr/bin/env python3\n# -*- coding: utf-8 -*-\n# Ground-truth 2D engineering drawing for part: 0074_00742603\n# Self-contained: reproduces the three-view DXF via ezdxf, NO FreeCAD needed.\n# Coordinates are A4 page millimetres (scale=0.9642937500000495, page=[297.0, 210.0]).\n# visible edges -> solid (layer OUTLINE); hidden edges -> dashed (layer HIDDEN)\n# dimensions -> real movable DIMENSION entities (text = true mm value)\n# Run: python 0074_00742603_gt.py [out.dxf]\nimport sys\nimport ezdxf\nimport math\n\nSCALE = 0.9642937500000495\nPAGE = [297.0, 210.0]\n\nVISIBLE_SEGMENTS = [\n (80.176113, 115.176644, 176.605487, 115.176644),\n (176.605487, 140.431956, 80.176113, 140.431956),\n (176.605487, 101.176644, 177.000102, 101.176644),\n (177.000102, 101.176644, 177.394716, 101.176644),\n (177.394716, 101.176644, 177.78933, 101.176644),\n (177.78933, 101.176644, 178.183945, 101.176644),\n (178.183945, 101.176644, 178.578559, 101.176644),\n (178.578559, 101.176644, 178.973173, 101.176644),\n (178.973173, 101.176644, 179.367787, 101.176644),\n (179.367787, 101.176644, 179.762402, 101.176644),\n (179.762402, 101.176644, 180.157016, 101.176644),\n (180.157016, 101.176644, 180.55163, 101.176644),\n (180.55163, 101.176644, 180.946244, 101.176644),\n (180.946244, 101.176644, 181.340859, 101.176644),\n (181.340859, 101.176644, 181.735473, 101.176644),\n (181.735473, 101.176644, 182.130087, 101.176644),\n (182.130087, 101.176644, 182.524701, 101.176644),\n (182.524701, 101.176644, 182.919316, 101.176644),\n (182.919316, 101.176644, 183.31393, 101.176644),\n (183.31393, 101.176644, 183.708544, 101.176644),\n (183.708544, 101.176644, 184.103158, 101.176644),\n (184.103158, 101.176644, 184.497773, 101.176644),\n (184.497773, 101.176644, 184.892387, 101.176644),\n (184.892387, 101.176644, 185.287001, 101.176644),\n (185.287001, 101.176644, 185.681615, 101.176644),\n (185.681615, 101.176644, 186.07623, 101.176644),\n (186.07623, 101.176644, 186.470844, 101.176644),\n (186.470844, 101.176644, 186.865458, 101.176644),\n (186.865458, 101.176644, 187.260072, 101.176644),\n (187.260072, 101.176644, 187.654687, 101.176644),\n (187.654687, 101.176644, 188.049301, 101.176644),\n (188.049301, 101.176644, 188.443915, 101.176644),\n (188.443915, 101.176644, 188.838529, 101.176644),\n (188.838529, 101.176644, 189.233144, 101.176644),\n (176.605487, 93.568013, 177.000102, 93.568013),\n (177.000102, 93.568013, 177.394716, 93.568013),\n (177.394716, 93.568013, 177.78933, 93.568013),\n (177.78933, 93.568013, 178.183945, 93.568013),\n (178.183945, 93.568013, 178.578559, 93.568013),\n (178.578559, 93.568013, 178.973173, 93.568013),\n (178.973173, 93.568013, 179.367787, 93.568013),\n (179.367787, 93.568013, 179.762402, 93.568013),\n (179.762402, 93.568013, 180.157016, 93.568013),\n (180.157016, 93.568013, 180.55163, 93.568013),\n (180.55163, 93.568013, 180.946244, 93.568013),\n (180.946244, 93.568013, 181.340859, 93.568013),\n (181.340859, 93.568013, 181.735473, 93.568013),\n (181.735473, 93.568013, 182.130087, 93.568013),\n (182.130087, 93.568013, 182.524701, 93.568013),\n (182.524701, 93.568013, 182.919316, 93.568013),\n (182.919316, 93.568013, 183.31393, 93.568013),\n (183.31393, 93.568013, 183.708544, 93.568013),\n (183.708544, 93.568013, 184.103158, 93.568013),\n (184.103158, 93.568013, 184.497773, 93.568013),\n (184.497773, 93.568013, 184.892387, 93.568013),\n (184.892387, 93.568013, 185.287001, 93.568013),\n (185.287001, 93.568013, 185.681615, 93.568013),\n (185.681615, 93.568013, 186.07623, 93.568013),\n (186.07623, 93.568013, 186.470844, 93.568013),\n (186.470844, 93.568013, 186.865458, 93.568013),\n (186.865458, 93.568013, 187.260072, 93.568013),\n (187.260072, 93.568013, 187.654687, 93.568013),\n (187.654687, 93.568013, 188.049301, 93.568013),\n (188.049301, 93.568013, 188.443915, 93.568013),\n (188.443915, 93.568013, 188.838529, 93.568013),\n (188.838529, 93.568013, 189.233144, 93.568013),\n (80.176113, 93.568013, 176.605487, 93.568013),\n (80.176113, 101.176644, 176.605487, 101.176644),\n (67.548456, 93.568013, 67.943071, 93.568013),\n (67.943071, 93.568013, 68.337685, 93.568013),\n (68.337685, 93.568013, 68.732299, 93.568013),\n (68.732299, 93.568013, 69.126913, 93.568013),\n (69.126913, 93.568013, 69.521528, 93.568013),\n (69.521528, 93.568013, 69.916142, 93.568013),\n (69.916142, 93.568013, 70.310756, 93.568013),\n (70.310756, 93.568013, 70.70537, 93.568013),\n (70.70537, 93.568013, 71.099985, 93.568013),\n (71.099985, 93.568013, 71.494599, 93.568013),\n (71.494599, 93.568013, 71.889213, 93.568013),\n (71.889213, 93.568013, 72.283827, 93.568013),\n (72.283827, 93.568013, 72.678442, 93.568013),\n (72.678442, 93.568013, 73.073056, 93.568013),\n (73.073056, 93.568013, 73.46767, 93.568013),\n (73.46767, 93.568013, 73.862284, 93.568013),\n (73.862284, 93.568013, 74.256899, 93.568013),\n (74.256899, 93.568013, 74.651513, 93.568013),\n (74.651513, 93.568013, 75.046127, 93.568013),\n (75.046127, 93.568013, 75.440741, 93.568013),\n (75.440741, 93.568013, 75.835356, 93.568013),\n (75.835356, 93.568013, 76.22997, 93.568013),\n (76.22997, 93.568013, 76.624584, 93.568013),\n (76.624584, 93.568013, 77.019198, 93.568013),\n (77.019198, 93.568013, 77.413813, 93.568013),\n (77.413813, 93.568013, 77.808427, 93.568013),\n (77.808427, 93.568013, 78.203041, 93.568013),\n (78.203041, 93.568013, 78.597655, 93.568013),\n (78.597655, 93.568013, 78.99227, 93.568013),\n (78.99227, 93.568013, 79.386884, 93.568013),\n (79.386884, 93.568013, 79.781498, 93.568013),\n (79.781498, 93.568013, 80.176113, 93.568013),\n (67.548456, 101.176644, 67.943071, 101.176644),\n (67.943071, 101.176644, 68.337685, 101.176644),\n (68.337685, 101.176644, 68.732299, 101.176644),\n (68.732299, 101.176644, 69.126913, 101.176644),\n (69.126913, 101.176644, 69.521528, 101.176644),\n (69.521528, 101.176644, 69.916142, 101.176644),\n (69.916142, 101.176644, 70.310756, 101.176644),\n (70.310756, 101.176644, 70.70537, 101.176644),\n (70.70537, 101.176644, 71.099985, 101.176644),\n (71.099985, 101.176644, 71.494599, 101.176644),\n (71.494599, 101.176644, 71.889213, 101.176644),\n (71.889213, 101.176644, 72.283827, 101.176644),\n (72.283827, 101.176644, 72.678442, 101.176644),\n (72.678442, 101.176644, 73.073056, 101.176644),\n (73.073056, 101.176644, 73.46767, 101.176644),\n (73.46767, 101.176644, 73.862284, 101.176644),\n (73.862284, 101.176644, 74.256899, 101.176644),\n (74.256899, 101.176644, 74.651513, 101.176644),\n (74.651513, 101.176644, 75.046127, 101.176644),\n (75.046127, 101.176644, 75.440741, 101.176644),\n (75.440741, 101.176644, 75.835356, 101.176644),\n (75.835356, 101.176644, 76.22997, 101.176644),\n (76.22997, 101.176644, 76.624584, 101.176644),\n (76.624584, 101.176644, 77.019198, 101.176644),\n (77.019198, 101.176644, 77.413813, 101.176644),\n (77.413813, 101.176644, 77.808427, 101.176644),\n (77.808427, 101.176644, 78.203041, 101.176644),\n (78.203041, 101.176644, 78.597655, 101.176644),\n (78.597655, 101.176644, 78.99227, 101.176644),\n (78.99227, 101.176644, 79.386884, 101.176644),\n (79.386884, 101.176644, 79.781498, 101.176644),\n (79.781498, 101.176644, 80.176113, 101.176644),\n (189.233144, 93.568013, 189.233144, 101.176644),\n (67.548456, 93.568013, 67.548456, 101.176644),\n (176.605487, 93.568013, 176.605487, 101.176644),\n (80.176113, 93.568013, 80.176113, 101.176644),\n (210.841774, 140.431956, 203.233144, 140.431956),\n (203.233144, 115.176644, 210.841774, 115.176644),\n (203.233144, 140.431956, 203.233144, 139.642728),\n (203.233144, 139.642728, 203.233144, 138.853499),\n (203.233144, 138.853499, 203.233144, 138.064271),\n (203.233144, 138.064271, 203.233144, 137.275042),\n (203.233144, 137.275042, 203.233144, 136.485814),\n (203.233144, 136.485814, 203.233144, 135.696585),\n (203.233144, 135.696585, 203.233144, 134.907357),\n (203.233144, 134.907357, 203.233144, 134.118128),\n (203.233144, 134.118128, 203.233144, 133.3289),\n (203.233144, 133.3289, 203.233144, 132.539671),\n (203.233144, 132.539671, 203.233144, 131.750443),\n (203.233144, 131.750443, 203.233144, 130.961214),\n (203.233144, 130.961214, 203.233144, 130.171986),\n (203.233144, 130.171986, 203.233144, 129.382757),\n (203.233144, 129.382757, 203.233144, 128.593529),\n (203.233144, 128.593529, 203.233144, 127.8043),\n (203.233144, 127.8043, 203.233144, 127.015071),\n (203.233144, 127.015071, 203.233144, 126.225843),\n (203.233144, 126.225843, 203.233144, 125.436614),\n (203.233144, 125.436614, 203.233144, 124.647386),\n (203.233144, 124.647386, 203.233144, 123.858157),\n (203.233144, 123.858157, 203.233144, 123.068929),\n (203.233144, 123.068929, 203.233144, 122.2797),\n (203.233144, 122.2797, 203.233144, 121.490472),\n (203.233144, 121.490472, 203.233144, 120.701243),\n (203.233144, 120.701243, 203.233144, 119.912015),\n (203.233144, 119.912015, 203.233144, 119.122786),\n (203.233144, 119.122786, 203.233144, 118.333558),\n (203.233144, 118.333558, 203.233144, 117.544329),\n (203.233144, 117.544329, 203.233144, 116.755101),\n (203.233144, 116.755101, 203.233144, 115.965872),\n (203.233144, 115.965872, 203.233144, 115.176644),\n (210.841774, 140.431956, 210.841774, 139.642728),\n (210.841774, 139.642728, 210.841774, 138.853499),\n (210.841774, 138.853499, 210.841774, 138.064271),\n (210.841774, 138.064271, 210.841774, 137.275042),\n (210.841774, 137.275042, 210.841774, 136.485814),\n (210.841774, 136.485814, 210.841774, 135.696585),\n (210.841774, 135.696585, 210.841774, 134.907357),\n (210.841774, 134.907357, 210.841774, 134.118128),\n (210.841774, 134.118128, 210.841774, 133.3289),\n (210.841774, 133.3289, 210.841774, 132.539671),\n (210.841774, 132.539671, 210.841774, 131.750443),\n (210.841774, 131.750443, 210.841774, 130.961214),\n (210.841774, 130.961214, 210.841774, 130.171986),\n (210.841774, 130.171986, 210.841774, 129.382757),\n (210.841774, 129.382757, 210.841774, 128.593529),\n (210.841774, 128.593529, 210.841774, 127.8043),\n (210.841774, 127.8043, 210.841774, 127.015071),\n (210.841774, 127.015071, 210.841774, 126.225843),\n (210.841774, 126.225843, 210.841774, 125.436614),\n (210.841774, 125.436614, 210.841774, 124.647386),\n (210.841774, 124.647386, 210.841774, 123.858157),\n (210.841774, 123.858157, 210.841774, 123.068929),\n (210.841774, 123.068929, 210.841774, 122.2797),\n (210.841774, 122.2797, 210.841774, 121.490472),\n (210.841774, 121.490472, 210.841774, 120.701243),\n (210.841774, 120.701243, 210.841774, 119.912015),\n (210.841774, 119.912015, 210.841774, 119.122786),\n (210.841774, 119.122786, 210.841774, 118.333558),\n (210.841774, 118.333558, 210.841774, 117.544329),\n (210.841774, 117.544329, 210.841774, 116.755101),\n (210.841774, 116.755101, 210.841774, 115.965872),\n (210.841774, 115.965872, 210.841774, 115.176644)\n]\nVISIBLE_CIRCLES = [\n (80.176113, 127.8043, 8.035781),\n (176.605487, 127.8043, 8.035781)\n]\nVISIBLE_ARCS = [\n (176.605487, 127.8043, 12.627656, -90.0, 90.0),\n (80.176113, 127.8043, 12.627656, 90.0, -90.0)\n]\nHIDDEN_SEGMENTS = [\n (88.2119, 101.1767, 88.2119, 93.568),\n (184.6413, 101.1767, 184.6413, 93.568),\n (72.1403, 101.1767, 72.1403, 93.568),\n (168.5697, 101.1767, 168.5697, 93.568),\n (203.2331, 119.7685, 210.8418, 119.7685),\n (203.2331, 135.8401, 210.8418, 135.8401)\n]\n# (orient, text, p1, p2, base) for linear; (orient, text, center, radius, angle) for diameter\nDIMENSIONS = [\n ('horizontal', '100', (176.6055, 115.1766), (80.1761, 115.1766), (128.3908, 104.1766)),\n ('vertical', '26.1905', (176.6055, 140.432), (176.6055, 115.1766), (187.6055, 127.8043)),\n ('diameter', '%%c16.6667', (80.1761, 127.8043), 8.0358, 45),\n ('vertical', '13.0952', (80.1761, 140.432), (80.1761, 127.8043), (91.1761, 134.1182)),\n ('diameter', '%%c16.6667', (176.6055, 127.8043), 8.0358, 45),\n ('horizontal', '100', (80.1761, 127.8043), (176.6055, 127.8043), (128.3908, 138.8043)),\n ('vertical', '13.0952', (176.6055, 140.432), (176.6055, 127.8043), (187.6055, 134.1182)),\n ('radius', 'R13.0952', (176.6055, 127.8043), 12.6276, 135),\n ('horizontal', '7.8904', (210.8418, 140.432), (203.2331, 140.432), (207.0375, 129.432))\n]\n\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; _ds.dxf.dimasz = 2.5\n _ds.dxf.dimexe = 1.25; _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\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\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,\n angle=(0 if d[0] == \"horizontal\" else 90),\n 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,\n 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,\n 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,\n text=text, dimstyle=\"EZDXF\").render()\n\n doc.saveas(out_path)\n\n\nif __name__ == \"__main__\":\n out = sys.argv[1] if len(sys.argv) > 1 else \"0074_00742603_gt.dxf\"\n draw(out)\n print(\"wrote\", out)\n```"}], "images": ["images/0074_00742603.png"], "id": "0074_00742603"} {"messages": [{"role": "user", "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.51 mm tall, featuring 2 circular holes, each of diameter 5.06 mm. It is extruded to a thickness of 15.03 mm."}, {"role": "assistant", "content": "```python\n#!/usr/bin/env python3\n# -*- coding: utf-8 -*-\n# Ground-truth 2D engineering drawing for part: 0075_00753395\n# Self-contained: reproduces the three-view DXF via ezdxf, NO FreeCAD needed.\n# Coordinates are A4 page millimetres (scale=0.8117664335664341, page=[297.0, 210.0]).\n# visible edges -> solid (layer OUTLINE); hidden edges -> dashed (layer HIDDEN)\n# dimensions -> real movable DIMENSION entities (text = true mm value)\n# Run: python 0075_00753395_gt.py [out.dxf]\nimport sys\nimport ezdxf\nimport math\n\nSCALE = 0.8117664335664341\nPAGE = [297.0, 210.0]\n\nVISIBLE_SEGMENTS = [\n (163.280572, 146.541939, 82.103928, 146.541939),\n (82.103928, 113.660261, 163.280572, 113.660261),\n (163.280572, 99.660261, 163.794348, 99.660261),\n (163.794348, 99.660261, 164.308124, 99.660261),\n (164.308124, 99.660261, 164.8219, 99.660261),\n (164.8219, 99.660261, 165.335677, 99.660261),\n (165.335677, 99.660261, 165.849453, 99.660261),\n (165.849453, 99.660261, 166.363229, 99.660261),\n (166.363229, 99.660261, 166.877005, 99.660261),\n (166.877005, 99.660261, 167.390781, 99.660261),\n (167.390781, 99.660261, 167.904558, 99.660261),\n (167.904558, 99.660261, 168.418334, 99.660261),\n (168.418334, 99.660261, 168.93211, 99.660261),\n (168.93211, 99.660261, 169.445886, 99.660261),\n (169.445886, 99.660261, 169.959663, 99.660261),\n (169.959663, 99.660261, 170.473439, 99.660261),\n (170.473439, 99.660261, 170.987215, 99.660261),\n (170.987215, 99.660261, 171.500991, 99.660261),\n (171.500991, 99.660261, 172.014767, 99.660261),\n (172.014767, 99.660261, 172.528544, 99.660261),\n (172.528544, 99.660261, 173.04232, 99.660261),\n (173.04232, 99.660261, 173.556096, 99.660261),\n (173.556096, 99.660261, 174.069872, 99.660261),\n (174.069872, 99.660261, 174.583649, 99.660261),\n (174.583649, 99.660261, 175.097425, 99.660261),\n (175.097425, 99.660261, 175.611201, 99.660261),\n (175.611201, 99.660261, 176.124977, 99.660261),\n (176.124977, 99.660261, 176.638753, 99.660261),\n (176.638753, 99.660261, 177.15253, 99.660261),\n (177.15253, 99.660261, 177.666306, 99.660261),\n (177.666306, 99.660261, 178.180082, 99.660261),\n (178.180082, 99.660261, 178.693858, 99.660261),\n (178.693858, 99.660261, 179.207635, 99.660261),\n (179.207635, 99.660261, 179.721411, 99.660261),\n (163.280572, 87.458075, 163.794348, 87.458075),\n (163.794348, 87.458075, 164.308124, 87.458075),\n (164.308124, 87.458075, 164.8219, 87.458075),\n (164.8219, 87.458075, 165.335677, 87.458075),\n (165.335677, 87.458075, 165.849453, 87.458075),\n (165.849453, 87.458075, 166.363229, 87.458075),\n (166.363229, 87.458075, 166.877005, 87.458075),\n (166.877005, 87.458075, 167.390781, 87.458075),\n (167.390781, 87.458075, 167.904558, 87.458075),\n (167.904558, 87.458075, 168.418334, 87.458075),\n (168.418334, 87.458075, 168.93211, 87.458075),\n (168.93211, 87.458075, 169.445886, 87.458075),\n (169.445886, 87.458075, 169.959663, 87.458075),\n (169.959663, 87.458075, 170.473439, 87.458075),\n (170.473439, 87.458075, 170.987215, 87.458075),\n (170.987215, 87.458075, 171.500991, 87.458075),\n (171.500991, 87.458075, 172.014767, 87.458075),\n (172.014767, 87.458075, 172.528544, 87.458075),\n (172.528544, 87.458075, 173.04232, 87.458075),\n (173.04232, 87.458075, 173.556096, 87.458075),\n (173.556096, 87.458075, 174.069872, 87.458075),\n (174.069872, 87.458075, 174.583649, 87.458075),\n (174.583649, 87.458075, 175.097425, 87.458075),\n (175.097425, 87.458075, 175.611201, 87.458075),\n (175.611201, 87.458075, 176.124977, 87.458075),\n (176.124977, 87.458075, 176.638753, 87.458075),\n (176.638753, 87.458075, 177.15253, 87.458075),\n (177.15253, 87.458075, 177.666306, 87.458075),\n (177.666306, 87.458075, 178.180082, 87.458075),\n (178.180082, 87.458075, 178.693858, 87.458075),\n (178.693858, 87.458075, 179.207635, 87.458075),\n (179.207635, 87.458075, 179.721411, 87.458075),\n (65.663089, 99.660261, 66.176865, 99.660261),\n (66.176865, 99.660261, 66.690642, 99.660261),\n (66.690642, 99.660261, 67.204418, 99.660261),\n (67.204418, 99.660261, 67.718194, 99.660261),\n (67.718194, 99.660261, 68.23197, 99.660261),\n (68.23197, 99.660261, 68.745747, 99.660261),\n (68.745747, 99.660261, 69.259523, 99.660261),\n (69.259523, 99.660261, 69.773299, 99.660261),\n (69.773299, 99.660261, 70.287075, 99.660261),\n (70.287075, 99.660261, 70.800851, 99.660261),\n (70.800851, 99.660261, 71.314628, 99.660261),\n (71.314628, 99.660261, 71.828404, 99.660261),\n (71.828404, 99.660261, 72.34218, 99.660261),\n (72.34218, 99.660261, 72.855956, 99.660261),\n (72.855956, 99.660261, 73.369733, 99.660261),\n (73.369733, 99.660261, 73.883509, 99.660261),\n (73.883509, 99.660261, 74.397285, 99.660261),\n (74.397285, 99.660261, 74.911061, 99.660261),\n (74.911061, 99.660261, 75.424837, 99.660261),\n (75.424837, 99.660261, 75.938614, 99.660261),\n (75.938614, 99.660261, 76.45239, 99.660261),\n (76.45239, 99.660261, 76.966166, 99.660261),\n (76.966166, 99.660261, 77.479942, 99.660261),\n (77.479942, 99.660261, 77.993719, 99.660261),\n (77.993719, 99.660261, 78.507495, 99.660261),\n (78.507495, 99.660261, 79.021271, 99.660261),\n (79.021271, 99.660261, 79.535047, 99.660261),\n (79.535047, 99.660261, 80.048823, 99.660261),\n (80.048823, 99.660261, 80.5626, 99.660261),\n (80.5626, 99.660261, 81.076376, 99.660261),\n (81.076376, 99.660261, 81.590152, 99.660261),\n (81.590152, 99.660261, 82.103928, 99.660261),\n (65.663089, 87.458075, 66.176865, 87.458075),\n (66.176865, 87.458075, 66.690642, 87.458075),\n (66.690642, 87.458075, 67.204418, 87.458075),\n (67.204418, 87.458075, 67.718194, 87.458075),\n (67.718194, 87.458075, 68.23197, 87.458075),\n (68.23197, 87.458075, 68.745747, 87.458075),\n (68.745747, 87.458075, 69.259523, 87.458075),\n (69.259523, 87.458075, 69.773299, 87.458075),\n (69.773299, 87.458075, 70.287075, 87.458075),\n (70.287075, 87.458075, 70.800851, 87.458075),\n (70.800851, 87.458075, 71.314628, 87.458075),\n (71.314628, 87.458075, 71.828404, 87.458075),\n (71.828404, 87.458075, 72.34218, 87.458075),\n (72.34218, 87.458075, 72.855956, 87.458075),\n (72.855956, 87.458075, 73.369733, 87.458075),\n (73.369733, 87.458075, 73.883509, 87.458075),\n (73.883509, 87.458075, 74.397285, 87.458075),\n (74.397285, 87.458075, 74.911061, 87.458075),\n (74.911061, 87.458075, 75.424837, 87.458075),\n (75.424837, 87.458075, 75.938614, 87.458075),\n (75.938614, 87.458075, 76.45239, 87.458075),\n (76.45239, 87.458075, 76.966166, 87.458075),\n (76.966166, 87.458075, 77.479942, 87.458075),\n (77.479942, 87.458075, 77.993719, 87.458075),\n (77.993719, 87.458075, 78.507495, 87.458075),\n (78.507495, 87.458075, 79.021271, 87.458075),\n (79.021271, 87.458075, 79.535047, 87.458075),\n (79.535047, 87.458075, 80.048823, 87.458075),\n (80.048823, 87.458075, 80.5626, 87.458075),\n (80.5626, 87.458075, 81.076376, 87.458075),\n (81.076376, 87.458075, 81.590152, 87.458075),\n (81.590152, 87.458075, 82.103928, 87.458075),\n (82.103928, 87.458075, 163.280572, 87.458075),\n (82.103928, 99.660261, 163.280572, 99.660261),\n (179.721411, 87.458075, 179.721411, 99.660261),\n (65.663089, 87.458075, 65.663089, 99.660261),\n (163.280572, 99.660261, 163.280572, 87.458075),\n (82.103928, 99.660261, 82.103928, 87.458075),\n (205.923596, 146.541939, 193.721411, 146.541939),\n (205.923596, 146.541939, 205.923596, 145.514387),\n (205.923596, 145.514387, 205.923596, 144.486834),\n (205.923596, 144.486834, 205.923596, 143.459282),\n (205.923596, 143.459282, 205.923596, 142.431729),\n (205.923596, 142.431729, 205.923596, 141.404177),\n (205.923596, 141.404177, 205.923596, 140.376624),\n (205.923596, 140.376624, 205.923596, 139.349072),\n (205.923596, 139.349072, 205.923596, 138.32152),\n (205.923596, 138.32152, 205.923596, 137.293967),\n (205.923596, 137.293967, 205.923596, 136.266415),\n (205.923596, 136.266415, 205.923596, 135.238862),\n (205.923596, 135.238862, 205.923596, 134.21131),\n (205.923596, 134.21131, 205.923596, 133.183757),\n (205.923596, 133.183757, 205.923596, 132.156205),\n (205.923596, 132.156205, 205.923596, 131.128652),\n (205.923596, 131.128652, 205.923596, 130.1011),\n (205.923596, 130.1011, 205.923596, 129.073548),\n (205.923596, 129.073548, 205.923596, 128.045995),\n (205.923596, 128.045995, 205.923596, 127.018443),\n (205.923596, 127.018443, 205.923596, 125.99089),\n (205.923596, 125.99089, 205.923596, 124.963338),\n (205.923596, 124.963338, 205.923596, 123.935785),\n (205.923596, 123.935785, 205.923596, 122.908233),\n (205.923596, 122.908233, 205.923596, 121.88068),\n (205.923596, 121.88068, 205.923596, 120.853128),\n (205.923596, 120.853128, 205.923596, 119.825576),\n (205.923596, 119.825576, 205.923596, 118.798023),\n (205.923596, 118.798023, 205.923596, 117.770471),\n (205.923596, 117.770471, 205.923596, 116.742918),\n (205.923596, 116.742918, 205.923596, 115.715366),\n (205.923596, 115.715366, 205.923596, 114.687813),\n (205.923596, 114.687813, 205.923596, 113.660261),\n (205.923596, 113.660261, 193.721411, 113.660261),\n (193.721411, 146.541939, 193.721411, 145.514387),\n (193.721411, 145.514387, 193.721411, 144.486834),\n (193.721411, 144.486834, 193.721411, 143.459282),\n (193.721411, 143.459282, 193.721411, 142.431729),\n (193.721411, 142.431729, 193.721411, 141.404177),\n (193.721411, 141.404177, 193.721411, 140.376624),\n (193.721411, 140.376624, 193.721411, 139.349072),\n (193.721411, 139.349072, 193.721411, 138.32152),\n (193.721411, 138.32152, 193.721411, 137.293967),\n (193.721411, 137.293967, 193.721411, 136.266415),\n (193.721411, 136.266415, 193.721411, 135.238862),\n (193.721411, 135.238862, 193.721411, 134.21131),\n (193.721411, 134.21131, 193.721411, 133.183757),\n (193.721411, 133.183757, 193.721411, 132.156205),\n (193.721411, 132.156205, 193.721411, 131.128652),\n (193.721411, 131.128652, 193.721411, 130.1011),\n (193.721411, 130.1011, 193.721411, 129.073548),\n (193.721411, 129.073548, 193.721411, 128.045995),\n (193.721411, 128.045995, 193.721411, 127.018443),\n (193.721411, 127.018443, 193.721411, 125.99089),\n (193.721411, 125.99089, 193.721411, 124.963338),\n (193.721411, 124.963338, 193.721411, 123.935785),\n (193.721411, 123.935785, 193.721411, 122.908233),\n (193.721411, 122.908233, 193.721411, 121.88068),\n (193.721411, 121.88068, 193.721411, 120.853128),\n (193.721411, 120.853128, 193.721411, 119.825576),\n (193.721411, 119.825576, 193.721411, 118.798023),\n (193.721411, 118.798023, 193.721411, 117.770471),\n (193.721411, 117.770471, 193.721411, 116.742918),\n (193.721411, 116.742918, 193.721411, 115.715366),\n (193.721411, 115.715366, 193.721411, 114.687813),\n (193.721411, 114.687813, 193.721411, 113.660261)\n]\nVISIBLE_CIRCLES = [\n (82.103928, 130.1011, 2.055105),\n (163.280572, 130.1011, 2.055105)\n]\nVISIBLE_ARCS = [\n (163.280572, 130.1011, 16.440839, -90.0, 90.0),\n (82.103928, 130.1011, 16.440839, 90.0, -90.0)\n]\nHIDDEN_SEGMENTS = [\n (84.159, 87.4581, 84.159, 99.6603),\n (165.3357, 87.4581, 165.3357, 99.6603),\n (80.0488, 99.6603, 80.0488, 87.4581),\n (161.2255, 99.6603, 161.2255, 87.4581),\n (193.7214, 128.046, 205.9236, 128.046),\n (193.7214, 132.1562, 205.9236, 132.1562)\n]\n# (orient, text, p1, p2, base) for linear; (orient, text, center, radius, angle) for diameter\nDIMENSIONS = [\n ('horizontal', '100', (163.2806, 113.6603), (82.1039, 113.6603), (122.6923, 102.6603)),\n ('vertical', '40.5063', (163.2806, 146.5419), (163.2806, 113.6603), (174.2806, 130.1011)),\n ('diameter', '%%c5.0633', (82.1039, 130.1011), 2.0551, 45),\n ('vertical', '20.2532', (82.1039, 146.5419), (82.1039, 130.1011), (93.1039, 138.3215)),\n ('diameter', '%%c5.0633', (163.2806, 130.1011), 2.0551, 45),\n ('horizontal', '100', (82.1039, 130.1011), (163.2806, 130.1011), (122.6923, 141.1011)),\n ('vertical', '20.2532', (163.2806, 146.5419), (163.2806, 130.1011), (174.2806, 138.3215)),\n ('radius', 'R20.2532', (163.2806, 130.1011), 16.4409, 135),\n ('horizontal', '15.0316', (205.9236, 146.5419), (193.7215, 146.5419), (199.8225, 135.5419))\n]\n\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; _ds.dxf.dimasz = 2.5\n _ds.dxf.dimexe = 1.25; _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\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\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,\n angle=(0 if d[0] == \"horizontal\" else 90),\n 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,\n 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,\n 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,\n text=text, dimstyle=\"EZDXF\").render()\n\n doc.saveas(out_path)\n\n\nif __name__ == \"__main__\":\n out = sys.argv[1] if len(sys.argv) > 1 else \"0075_00753395_gt.dxf\"\n draw(out)\n print(\"wrote\", out)\n```"}], "images": ["images/0075_00753395.png"], "id": "0075_00753395"} {"messages": [{"role": "user", "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 9 straight edges. It is extruded to a thickness of 15.24 mm. The outline includes one or more oblique (angled) edges."}, {"role": "assistant", "content": "```python\n#!/usr/bin/env python3\n# -*- coding: utf-8 -*-\n# Ground-truth 2D engineering drawing for part: 0075_00757745\n# Self-contained: reproduces the three-view DXF via ezdxf, NO FreeCAD needed.\n# Coordinates are A4 page millimetres (scale=0.6496754627035431, page=[297.0, 210.0]).\n# visible edges -> solid (layer OUTLINE); hidden edges -> dashed (layer HIDDEN)\n# dimensions -> real movable DIMENSION entities (text = true mm value)\n# Run: python 0075_00757745_gt.py [out.dxf]\nimport sys\nimport ezdxf\nimport math\n\nSCALE = 0.6496754627035431\nPAGE = [297.0, 210.0]\n\nVISIBLE_SEGMENTS = [\n (140.974775, 164.567076, 140.974775, 99.59953),\n (128.639165, 89.731042, 132.751035, 92.198164),\n (134.395783, 97.954782, 133.573409, 99.59953),\n (133.573409, 99.59953, 133.573409, 164.567076),\n (128.639165, 164.567076, 121.237799, 166.211824),\n (121.237799, 64.378971, 121.854579, 64.378971),\n (121.854579, 64.378971, 122.47136, 64.378971),\n (122.47136, 64.378971, 123.08814, 64.378971),\n (123.08814, 64.378971, 123.704921, 64.378971),\n (123.704921, 64.378971, 124.321701, 64.378971),\n (124.321701, 64.378971, 124.938482, 64.378971),\n (124.938482, 64.378971, 125.555262, 64.378971),\n (125.555262, 64.378971, 126.172043, 64.378971),\n (126.172043, 64.378971, 126.788823, 64.378971),\n (126.788823, 64.378971, 127.405604, 64.378971),\n (127.405604, 64.378971, 128.022384, 64.378971),\n (128.022384, 64.378971, 128.639165, 64.378971),\n (128.639165, 64.378971, 129.255945, 64.378971),\n (129.255945, 64.378971, 129.872726, 64.378971),\n (129.872726, 64.378971, 130.489506, 64.378971),\n (130.489506, 64.378971, 131.106287, 64.378971),\n (131.106287, 64.378971, 131.723067, 64.378971),\n (131.723067, 64.378971, 132.339848, 64.378971),\n (132.339848, 64.378971, 132.956628, 64.378971),\n (132.956628, 64.378971, 133.573409, 64.378971),\n (133.573409, 64.378971, 134.190189, 64.378971),\n (134.190189, 64.378971, 134.80697, 64.378971),\n (134.80697, 64.378971, 135.42375, 64.378971),\n (135.42375, 64.378971, 136.040531, 64.378971),\n (136.040531, 64.378971, 136.657311, 64.378971),\n (136.657311, 64.378971, 137.274092, 64.378971),\n (137.274092, 64.378971, 137.890872, 64.378971),\n (137.890872, 64.378971, 138.507653, 64.378971),\n (138.507653, 64.378971, 139.124433, 64.378971),\n (139.124433, 64.378971, 139.741214, 64.378971),\n (139.741214, 64.378971, 140.357994, 64.378971),\n (140.357994, 64.378971, 140.974775, 64.378971),\n (121.237799, 74.282207, 121.854579, 74.282207),\n (121.854579, 74.282207, 122.47136, 74.282207),\n (122.47136, 74.282207, 123.08814, 74.282207),\n (123.08814, 74.282207, 123.704921, 74.282207),\n (123.704921, 74.282207, 124.321701, 74.282207),\n (124.321701, 74.282207, 124.938482, 74.282207),\n (124.938482, 74.282207, 125.555262, 74.282207),\n (125.555262, 74.282207, 126.172043, 74.282207),\n (126.172043, 74.282207, 126.788823, 74.282207),\n (126.788823, 74.282207, 127.405604, 74.282207),\n (127.405604, 74.282207, 128.022384, 74.282207),\n (128.022384, 74.282207, 128.639165, 74.282207),\n (128.639165, 74.282207, 129.255945, 74.282207),\n (129.255945, 74.282207, 129.872726, 74.282207),\n (129.872726, 74.282207, 130.489506, 74.282207),\n (130.489506, 74.282207, 131.106287, 74.282207),\n (131.106287, 74.282207, 131.723067, 74.282207),\n (131.723067, 74.282207, 132.339848, 74.282207),\n (132.339848, 74.282207, 132.956628, 74.282207),\n (132.956628, 74.282207, 133.573409, 74.282207),\n (133.573409, 74.282207, 134.190189, 74.282207),\n (134.190189, 74.282207, 134.80697, 74.282207),\n (134.80697, 74.282207, 135.42375, 74.282207),\n (135.42375, 74.282207, 136.040531, 74.282207),\n (136.040531, 74.282207, 136.657311, 74.282207),\n (136.657311, 74.282207, 137.274092, 74.282207),\n (137.274092, 74.282207, 137.890872, 74.282207),\n (137.890872, 74.282207, 138.507653, 74.282207),\n (138.507653, 74.282207, 139.124433, 74.282207),\n (139.124433, 74.282207, 139.741214, 74.282207),\n (139.741214, 74.282207, 140.357994, 74.282207),\n (140.357994, 74.282207, 140.974775, 74.282207),\n (121.237799, 64.378971, 121.237799, 74.282207),\n (140.974775, 64.378971, 140.974775, 74.282207),\n (140.974775, 64.378971, 140.993196, 64.378971),\n (140.993196, 64.378971, 141.011617, 64.378971),\n (141.011617, 64.378971, 141.030037, 64.378971),\n (141.030037, 64.378971, 141.048458, 64.378971),\n (141.048458, 64.378971, 141.066879, 64.378971),\n (141.066879, 64.378971, 141.0853, 64.378971),\n (141.0853, 64.378971, 141.103721, 64.378971),\n (141.103721, 64.378971, 141.122142, 64.378971),\n (141.122142, 64.378971, 141.140563, 64.378971),\n (141.140563, 64.378971, 141.158984, 64.378971),\n (141.158984, 64.378971, 141.177405, 64.378971),\n (141.177405, 64.378971, 141.195826, 64.378971),\n (141.195826, 64.378971, 141.214247, 64.378971),\n (141.214247, 64.378971, 141.232668, 64.378971),\n (141.232668, 64.378971, 141.251089, 64.378971),\n (141.251089, 64.378971, 141.26951, 64.378971),\n (141.26951, 64.378971, 141.287931, 64.378971),\n (141.287931, 64.378971, 141.306351, 64.378971),\n (141.306351, 64.378971, 141.324772, 64.378971),\n (141.324772, 64.378971, 141.343193, 64.378971),\n (141.343193, 64.378971, 141.361614, 64.378971),\n (141.361614, 64.378971, 141.380035, 64.378971),\n (141.380035, 64.378971, 141.398456, 64.378971),\n (141.398456, 64.378971, 141.416877, 64.378971),\n (141.416877, 64.378971, 141.435298, 64.378971),\n (141.435298, 64.378971, 141.453719, 64.378971),\n (141.453719, 64.378971, 141.47214, 64.378971),\n (141.47214, 64.378971, 141.490561, 64.378971),\n (141.490561, 64.378971, 141.508982, 64.378971),\n (141.508982, 64.378971, 141.527403, 64.378971),\n (141.527403, 64.378971, 141.545824, 64.378971),\n (141.545824, 64.378971, 141.564245, 64.378971),\n (140.974775, 74.282207, 140.993196, 74.282207),\n (140.993196, 74.282207, 141.011617, 74.282207),\n (141.011617, 74.282207, 141.030037, 74.282207),\n (141.030037, 74.282207, 141.048458, 74.282207),\n (141.048458, 74.282207, 141.066879, 74.282207),\n (141.066879, 74.282207, 141.0853, 74.282207),\n (141.0853, 74.282207, 141.103721, 74.282207),\n (141.103721, 74.282207, 141.122142, 74.282207),\n (141.122142, 74.282207, 141.140563, 74.282207),\n (141.140563, 74.282207, 141.158984, 74.282207),\n (141.158984, 74.282207, 141.177405, 74.282207),\n (141.177405, 74.282207, 141.195826, 74.282207),\n (141.195826, 74.282207, 141.214247, 74.282207),\n (141.214247, 74.282207, 141.232668, 74.282207),\n (141.232668, 74.282207, 141.251089, 74.282207),\n (141.251089, 74.282207, 141.26951, 74.282207),\n (141.26951, 74.282207, 141.287931, 74.282207),\n (141.287931, 74.282207, 141.306351, 74.282207),\n (141.306351, 74.282207, 141.324772, 74.282207),\n (141.324772, 74.282207, 141.343193, 74.282207),\n (141.343193, 74.282207, 141.361614, 74.282207),\n (141.361614, 74.282207, 141.380035, 74.282207),\n (141.380035, 74.282207, 141.398456, 74.282207),\n (141.398456, 74.282207, 141.416877, 74.282207),\n (141.416877, 74.282207, 141.435298, 74.282207),\n (141.435298, 74.282207, 141.453719, 74.282207),\n (141.453719, 74.282207, 141.47214, 74.282207),\n (141.47214, 74.282207, 141.490561, 74.282207),\n (141.490561, 74.282207, 141.508982, 74.282207),\n (141.508982, 74.282207, 141.527403, 74.282207),\n (141.527403, 74.282207, 141.545824, 74.282207),\n (141.545824, 74.282207, 141.564245, 74.282207),\n (141.564245, 74.282207, 141.564245, 64.378971),\n (165.467481, 166.211824, 165.467481, 166.470172),\n (165.467481, 166.470172, 165.467481, 166.728521),\n (165.467481, 166.728521, 165.467481, 166.986869),\n (165.467481, 166.986869, 165.467481, 167.245217),\n (165.467481, 167.245217, 165.467481, 167.503566),\n (165.467481, 167.503566, 165.467481, 167.761914),\n (165.467481, 167.761914, 165.467481, 168.020262),\n (165.467481, 168.020262, 165.467481, 168.278611),\n (165.467481, 168.278611, 165.467481, 168.536959),\n (165.467481, 168.536959, 165.467481, 168.795307),\n (165.467481, 168.795307, 165.467481, 169.053656),\n (165.467481, 169.053656, 165.467481, 169.312004),\n (165.467481, 169.312004, 165.467481, 169.570352),\n (165.467481, 169.570352, 165.467481, 169.828701),\n (165.467481, 169.828701, 165.467481, 170.087049),\n (165.467481, 170.087049, 165.467481, 170.345397),\n (165.467481, 170.345397, 165.467481, 170.603746),\n (165.467481, 170.603746, 165.467481, 170.862094),\n (165.467481, 170.862094, 165.467481, 171.120442),\n (165.467481, 171.120442, 165.467481, 171.378791),\n (165.467481, 171.378791, 165.467481, 171.637139),\n (165.467481, 171.637139, 165.467481, 171.895488),\n (165.467481, 171.895488, 165.467481, 172.153836),\n (165.467481, 172.153836, 165.467481, 172.412184),\n (165.467481, 172.412184, 165.467481, 172.670533),\n (165.467481, 172.670533, 165.467481, 172.928881),\n (165.467481, 172.928881, 165.467481, 173.187229),\n (165.467481, 173.187229, 165.467481, 173.445578),\n (165.467481, 173.445578, 165.467481, 173.703926),\n (165.467481, 173.703926, 165.467481, 173.962274),\n (165.467481, 173.962274, 165.467481, 174.220623),\n (165.467481, 174.220623, 165.467481, 174.478971),\n (155.564245, 166.211824, 155.564245, 166.470172),\n (155.564245, 166.470172, 155.564245, 166.728521),\n (155.564245, 166.728521, 155.564245, 166.986869),\n (155.564245, 166.986869, 155.564245, 167.245217),\n (155.564245, 167.245217, 155.564245, 167.503566),\n (155.564245, 167.503566, 155.564245, 167.761914),\n (155.564245, 167.761914, 155.564245, 168.020262),\n (155.564245, 168.020262, 155.564245, 168.278611),\n (155.564245, 168.278611, 155.564245, 168.536959),\n (155.564245, 168.536959, 155.564245, 168.795307),\n (155.564245, 168.795307, 155.564245, 169.053656),\n (155.564245, 169.053656, 155.564245, 169.312004),\n (155.564245, 169.312004, 155.564245, 169.570352),\n (155.564245, 169.570352, 155.564245, 169.828701),\n (155.564245, 169.828701, 155.564245, 170.087049),\n (155.564245, 170.087049, 155.564245, 170.345397),\n (155.564245, 170.345397, 155.564245, 170.603746),\n (155.564245, 170.603746, 155.564245, 170.862094),\n (155.564245, 170.862094, 155.564245, 171.120442),\n (155.564245, 171.120442, 155.564245, 171.378791),\n (155.564245, 171.378791, 155.564245, 171.637139),\n (155.564245, 171.637139, 155.564245, 171.895488),\n (155.564245, 171.895488, 155.564245, 172.153836),\n (155.564245, 172.153836, 155.564245, 172.412184),\n (155.564245, 172.412184, 155.564245, 172.670533),\n (155.564245, 172.670533, 155.564245, 172.928881),\n (155.564245, 172.928881, 155.564245, 173.187229),\n (155.564245, 173.187229, 155.564245, 173.445578),\n (155.564245, 173.445578, 155.564245, 173.703926),\n (155.564245, 173.703926, 155.564245, 173.962274),\n (155.564245, 173.962274, 155.564245, 174.220623),\n (155.564245, 174.220623, 155.564245, 174.478971),\n (165.467481, 166.211824, 155.564245, 166.211824),\n (165.467481, 88.282207, 165.467481, 88.327483),\n (165.467481, 88.327483, 165.467481, 88.372759),\n (165.467481, 88.372759, 165.467481, 88.418035),\n (165.467481, 88.418035, 165.467481, 88.463312),\n (165.467481, 88.463312, 165.467481, 88.508588),\n (165.467481, 88.508588, 165.467481, 88.553864),\n (165.467481, 88.553864, 165.467481, 88.59914),\n (165.467481, 88.59914, 165.467481, 88.644416),\n (165.467481, 88.644416, 165.467481, 88.689692),\n (165.467481, 88.689692, 165.467481, 88.734968),\n (165.467481, 88.734968, 165.467481, 88.780244),\n (165.467481, 88.780244, 165.467481, 88.82552),\n (165.467481, 88.82552, 165.467481, 88.870796),\n (165.467481, 88.870796, 165.467481, 88.916072),\n (165.467481, 88.916072, 165.467481, 88.961348),\n (165.467481, 88.961348, 165.467481, 89.006624),\n (165.467481, 89.006624, 165.467481, 89.0519),\n (165.467481, 89.0519, 165.467481, 89.097177),\n (165.467481, 89.097177, 165.467481, 89.142453),\n (165.467481, 89.142453, 165.467481, 89.187729),\n (165.467481, 89.187729, 165.467481, 89.233005),\n (165.467481, 89.233005, 165.467481, 89.278281),\n (165.467481, 89.278281, 165.467481, 89.323557),\n (165.467481, 89.323557, 165.467481, 89.368833),\n (165.467481, 89.368833, 165.467481, 89.414109),\n (165.467481, 89.414109, 165.467481, 89.459385),\n (165.467481, 89.459385, 165.467481, 89.504661),\n (165.467481, 89.504661, 165.467481, 89.549937),\n (165.467481, 89.549937, 165.467481, 89.595213),\n (165.467481, 89.595213, 165.467481, 89.640489),\n (165.467481, 89.640489, 165.467481, 89.685765),\n (165.467481, 89.685765, 165.467481, 89.731042),\n (165.467481, 89.731042, 155.564245, 89.731042),\n (155.564245, 88.282207, 155.564245, 88.327483),\n (155.564245, 88.327483, 155.564245, 88.372759),\n (155.564245, 88.372759, 155.564245, 88.418035),\n (155.564245, 88.418035, 155.564245, 88.463312),\n (155.564245, 88.463312, 155.564245, 88.508588),\n (155.564245, 88.508588, 155.564245, 88.553864),\n (155.564245, 88.553864, 155.564245, 88.59914),\n (155.564245, 88.59914, 155.564245, 88.644416),\n (155.564245, 88.644416, 155.564245, 88.689692),\n (155.564245, 88.689692, 155.564245, 88.734968),\n (155.564245, 88.734968, 155.564245, 88.780244),\n (155.564245, 88.780244, 155.564245, 88.82552),\n (155.564245, 88.82552, 155.564245, 88.870796),\n (155.564245, 88.870796, 155.564245, 88.916072),\n (155.564245, 88.916072, 155.564245, 88.961348),\n (155.564245, 88.961348, 155.564245, 89.006624),\n (155.564245, 89.006624, 155.564245, 89.0519),\n (155.564245, 89.0519, 155.564245, 89.097177),\n (155.564245, 89.097177, 155.564245, 89.142453),\n (155.564245, 89.142453, 155.564245, 89.187729),\n (155.564245, 89.187729, 155.564245, 89.233005),\n (155.564245, 89.233005, 155.564245, 89.278281),\n (155.564245, 89.278281, 155.564245, 89.323557),\n (155.564245, 89.323557, 155.564245, 89.368833),\n (155.564245, 89.368833, 155.564245, 89.414109),\n (155.564245, 89.414109, 155.564245, 89.459385),\n (155.564245, 89.459385, 155.564245, 89.504661),\n (155.564245, 89.504661, 155.564245, 89.549937),\n (155.564245, 89.549937, 155.564245, 89.595213),\n (155.564245, 89.595213, 155.564245, 89.640489),\n (155.564245, 89.640489, 155.564245, 89.685765),\n (155.564245, 89.685765, 155.564245, 89.731042),\n (155.564245, 89.731042, 155.564245, 92.198164),\n (165.467481, 92.198164, 155.564245, 92.198164),\n (165.467481, 89.731042, 165.467481, 92.198164),\n (155.564245, 92.198164, 155.564245, 92.378058),\n (155.564245, 92.378058, 155.564245, 92.557952),\n (155.564245, 92.557952, 155.564245, 92.737846),\n (155.564245, 92.737846, 155.564245, 92.917741),\n (155.564245, 92.917741, 155.564245, 93.097635),\n (155.564245, 93.097635, 155.564245, 93.277529),\n (155.564245, 93.277529, 155.564245, 93.457424),\n (155.564245, 93.457424, 155.564245, 93.637318),\n (155.564245, 93.637318, 155.564245, 93.817212),\n (155.564245, 93.817212, 155.564245, 93.997107),\n (155.564245, 93.997107, 155.564245, 94.177001),\n (155.564245, 94.177001, 155.564245, 94.356895),\n (155.564245, 94.356895, 155.564245, 94.53679),\n (155.564245, 94.53679, 155.564245, 94.716684),\n (155.564245, 94.716684, 155.564245, 94.896578),\n (155.564245, 94.896578, 155.564245, 95.076473),\n (155.564245, 95.076473, 155.564245, 95.256367),\n (155.564245, 95.256367, 155.564245, 95.436261),\n (155.564245, 95.436261, 155.564245, 95.616155),\n (155.564245, 95.616155, 155.564245, 95.79605),\n (155.564245, 95.79605, 155.564245, 95.975944),\n (155.564245, 95.975944, 155.564245, 96.155838),\n (155.564245, 96.155838, 155.564245, 96.335733),\n (155.564245, 96.335733, 155.564245, 96.515627),\n (155.564245, 96.515627, 155.564245, 96.695521),\n (155.564245, 96.695521, 155.564245, 96.875416),\n (155.564245, 96.875416, 155.564245, 97.05531),\n (155.564245, 97.05531, 155.564245, 97.235204),\n (155.564245, 97.235204, 155.564245, 97.415099),\n (155.564245, 97.415099, 155.564245, 97.594993),\n (155.564245, 97.594993, 155.564245, 97.774887),\n (155.564245, 97.774887, 155.564245, 97.954782),\n (165.467481, 97.954782, 155.564245, 97.954782),\n (165.467481, 92.198164, 165.467481, 92.378058),\n (165.467481, 92.378058, 165.467481, 92.557952),\n (165.467481, 92.557952, 165.467481, 92.737846),\n (165.467481, 92.737846, 165.467481, 92.917741),\n (165.467481, 92.917741, 165.467481, 93.097635),\n (165.467481, 93.097635, 165.467481, 93.277529),\n (165.467481, 93.277529, 165.467481, 93.457424),\n (165.467481, 93.457424, 165.467481, 93.637318),\n (165.467481, 93.637318, 165.467481, 93.817212),\n (165.467481, 93.817212, 165.467481, 93.997107),\n (165.467481, 93.997107, 165.467481, 94.177001),\n (165.467481, 94.177001, 165.467481, 94.356895),\n (165.467481, 94.356895, 165.467481, 94.53679),\n (165.467481, 94.53679, 165.467481, 94.716684),\n (165.467481, 94.716684, 165.467481, 94.896578),\n (165.467481, 94.896578, 165.467481, 95.076473),\n (165.467481, 95.076473, 165.467481, 95.256367),\n (165.467481, 95.256367, 165.467481, 95.436261),\n (165.467481, 95.436261, 165.467481, 95.616155),\n (165.467481, 95.616155, 165.467481, 95.79605),\n (165.467481, 95.79605, 165.467481, 95.975944),\n (165.467481, 95.975944, 165.467481, 96.155838),\n (165.467481, 96.155838, 165.467481, 96.335733),\n (165.467481, 96.335733, 165.467481, 96.515627),\n (165.467481, 96.515627, 165.467481, 96.695521),\n (165.467481, 96.695521, 165.467481, 96.875416),\n (165.467481, 96.875416, 165.467481, 97.05531),\n (165.467481, 97.05531, 165.467481, 97.235204),\n (165.467481, 97.235204, 165.467481, 97.415099),\n (165.467481, 97.415099, 165.467481, 97.594993),\n (165.467481, 97.594993, 165.467481, 97.774887),\n (165.467481, 97.774887, 165.467481, 97.954782),\n (155.564245, 97.954782, 155.564245, 99.59953),\n (165.467481, 99.59953, 155.564245, 99.59953),\n (165.467481, 97.954782, 165.467481, 99.59953),\n (155.564245, 99.59953, 155.564245, 164.567076),\n (165.467481, 99.59953, 165.467481, 164.567076),\n (165.467481, 164.567076, 155.564245, 164.567076),\n (155.564245, 164.567076, 155.564245, 166.211824),\n (165.467481, 164.567076, 165.467481, 166.211824),\n (155.564245, 174.478971, 165.467481, 174.478971),\n (155.564245, 88.282207, 165.467481, 88.282207)\n]\nVISIBLE_CIRCLES = [\n\n]\nVISIBLE_ARCS = [\n (131.035468, 164.539626, 9.939345, 0.158233, 170.314483),\n (133.310183, 96.536269, 8.254061, -124.465192, 21.784808),\n (133.573409, 95.076473, 2.993487, -105.945396, 74.054604),\n (131.106287, 164.567076, 2.467122, -0.0, 180.0)\n]\nHIDDEN_SEGMENTS = [\n (128.6392, 64.379, 128.6392, 74.2822),\n (132.751, 64.379, 132.751, 74.2822),\n (134.3958, 64.379, 134.3958, 74.2822),\n (133.5734, 64.379, 133.5734, 74.2822),\n (136.5669, 74.2822, 136.5669, 64.379),\n (155.5642, 167.0342, 165.4675, 167.0342)\n]\n# (orient, text, p1, p2, base) for linear; (orient, text, center, radius, angle) for diameter\nDIMENSIONS = [\n ('horizontal', '7.5949', (133.5734, 164.5671), (128.6392, 164.5671), (131.1063, 153.5671)),\n ('vertical', '100', (140.9748, 164.5671), (140.9748, 99.5996), (151.9748, 132.0833)),\n ('aligned', '7.381', (128.6392, 89.7311), (132.751, 92.1982), (125.0356, 100.397)),\n ('aligned', '2.8305', (134.3958, 97.9548), (133.5734, 99.5996), (124.1458, 93.858)),\n ('aligned', '11.6703', (128.6392, 164.5671), (121.2378, 166.2118), (122.5523, 154.6514)),\n ('radius', 'R15.2989', (131.0354, 164.5396), 9.9393, 45),\n ('radius', 'R12.7049', (133.3102, 96.5363), 8.2541, 45),\n ('radius', 'R4.6077', (133.5734, 95.0765), 2.9935, 135),\n ('radius', 'R3.7975', (131.1063, 164.5671), 2.4671, 135),\n ('horizontal', '15.2434', (165.4675, 166.2118), (155.5642, 166.2118), (160.5158, 155.2118))\n]\n\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; _ds.dxf.dimasz = 2.5\n _ds.dxf.dimexe = 1.25; _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\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\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,\n angle=(0 if d[0] == \"horizontal\" else 90),\n 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,\n 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,\n 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,\n text=text, dimstyle=\"EZDXF\").render()\n\n doc.saveas(out_path)\n\n\nif __name__ == \"__main__\":\n out = sys.argv[1] if len(sys.argv) > 1 else \"0075_00757745_gt.dxf\"\n draw(out)\n print(\"wrote\", out)\n```"}], "images": ["images/0075_00757745.png"], "id": "0075_00757745"} {"messages": [{"role": "user", "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.22 mm tall. It is extruded to a thickness of 1.1 mm."}, {"role": "assistant", "content": "```python\n#!/usr/bin/env python3\n# -*- coding: utf-8 -*-\n# Ground-truth 2D engineering drawing for part: 0077_00770345\n# Self-contained: reproduces the three-view DXF via ezdxf, NO FreeCAD needed.\n# Coordinates are A4 page millimetres (scale=1.180767857143529, page=[297.0, 210.0]).\n# visible edges -> solid (layer OUTLINE); hidden edges -> dashed (layer HIDDEN)\n# dimensions -> real movable DIMENSION entities (text = true mm value)\n# Run: python 0077_00770345_gt.py [out.dxf]\nimport sys\nimport ezdxf\nimport math\n\nSCALE = 1.180767857143529\nPAGE = [297.0, 210.0]\n\nVISIBLE_SEGMENTS = [\n (72.555407, 132.514102, 190.632193, 132.514102),\n (190.632193, 118.082495, 72.555407, 118.082495),\n (190.632193, 101.485898, 197.847997, 101.485898),\n (190.632193, 104.082494, 197.847997, 104.082494),\n (72.555407, 104.082494, 190.632193, 104.082494),\n (72.555407, 101.485898, 190.632193, 101.485898),\n (65.339604, 104.082494, 72.555407, 104.082494),\n (65.339604, 101.485898, 72.555407, 101.485898),\n (197.847997, 104.082494, 197.847997, 101.485898),\n (65.339604, 104.082494, 65.339604, 101.485898),\n (190.632193, 104.082494, 190.632193, 101.485898),\n (72.555407, 104.082494, 72.555407, 101.485898),\n (211.847997, 132.514102, 214.444593, 132.514102),\n (214.444593, 118.082495, 211.847997, 118.082495),\n (211.847997, 118.082495, 211.847997, 132.514102),\n (214.444593, 118.082495, 214.444593, 132.514102)\n]\nVISIBLE_CIRCLES = [\n\n]\nVISIBLE_ARCS = [\n (190.632193, 125.298298, 7.215804, -90.0, 90.0),\n (72.555407, 125.298298, 7.215804, 90.0, -90.0)\n]\nHIDDEN_SEGMENTS = [\n\n]\n# (orient, text, p1, p2, base) for linear; (orient, text, center, radius, angle) for diameter\nDIMENSIONS = [\n ('horizontal', '100', (190.6322, 118.0825), (72.5554, 118.0825), (131.5938, 107.0825)),\n ('vertical', '12.2222', (190.6322, 132.5141), (190.6322, 118.0825), (201.6322, 125.2983)),\n ('radius', 'R6.1111', (190.6322, 125.2983), 7.2158, 45),\n ('horizontal', '2.1991', (214.4445, 132.5141), (211.848, 132.5141), (213.1463, 121.5141))\n]\n\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; _ds.dxf.dimasz = 2.5\n _ds.dxf.dimexe = 1.25; _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\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\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,\n angle=(0 if d[0] == \"horizontal\" else 90),\n 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,\n 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,\n 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,\n text=text, dimstyle=\"EZDXF\").render()\n\n doc.saveas(out_path)\n\n\nif __name__ == \"__main__\":\n out = sys.argv[1] if len(sys.argv) > 1 else \"0077_00770345_gt.dxf\"\n draw(out)\n print(\"wrote\", out)\n```"}], "images": ["images/0077_00770345.png"], "id": "0077_00770345"} {"messages": [{"role": "user", "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 66.2 mm wide and 100 mm tall, featuring a circular hole of diameter 19.72 mm. It is extruded to a thickness of 26.07 mm."}, {"role": "assistant", "content": "```python\n#!/usr/bin/env python3\n# -*- coding: utf-8 -*-\n# Ground-truth 2D engineering drawing for part: 0077_00776841\n# Self-contained: reproduces the three-view DXF via ezdxf, NO FreeCAD needed.\n# Coordinates are A4 page millimetres (scale=0.603779463310963, page=[297.0, 210.0]).\n# visible edges -> solid (layer OUTLINE); hidden edges -> dashed (layer HIDDEN)\n# dimensions -> real movable DIMENSION entities (text = true mm value)\n# Run: python 0077_00776841_gt.py [out.dxf]\nimport sys\nimport ezdxf\nimport math\n\nSCALE = 0.603779463310963\nPAGE = [297.0, 210.0]\n\nVISIBLE_SEGMENTS = [\n (148.615353, 177.046046, 148.615353, 116.6681),\n (108.646853, 116.6681, 108.646853, 177.046046),\n (108.646853, 177.046046, 148.615353, 177.046046),\n (148.615353, 66.946046, 148.615353, 82.68385),\n (108.646853, 66.946046, 108.646853, 82.68385),\n (108.646853, 82.68385, 148.615353, 82.68385),\n (108.646853, 66.946046, 148.615353, 66.946046),\n (178.353157, 96.68385, 178.353157, 97.308358),\n (178.353157, 97.308358, 178.353157, 97.932866),\n (178.353157, 97.932866, 178.353157, 98.557374),\n (178.353157, 98.557374, 178.353157, 99.181881),\n (178.353157, 99.181881, 178.353157, 99.806389),\n (178.353157, 99.806389, 178.353157, 100.430897),\n (178.353157, 100.430897, 178.353157, 101.055405),\n (178.353157, 101.055405, 178.353157, 101.679913),\n (178.353157, 101.679913, 178.353157, 102.30442),\n (178.353157, 102.30442, 178.353157, 102.928928),\n (178.353157, 102.928928, 178.353157, 103.553436),\n (178.353157, 103.553436, 178.353157, 104.177944),\n (178.353157, 104.177944, 178.353157, 104.802452),\n (178.353157, 104.802452, 178.353157, 105.426959),\n (178.353157, 105.426959, 178.353157, 106.051467),\n (178.353157, 106.051467, 178.353157, 106.675975),\n (178.353157, 106.675975, 178.353157, 107.300483),\n (178.353157, 107.300483, 178.353157, 107.924991),\n (178.353157, 107.924991, 178.353157, 108.549499),\n (178.353157, 108.549499, 178.353157, 109.174006),\n (178.353157, 109.174006, 178.353157, 109.798514),\n (178.353157, 109.798514, 178.353157, 110.423022),\n (178.353157, 110.423022, 178.353157, 111.04753),\n (178.353157, 111.04753, 178.353157, 111.672038),\n (178.353157, 111.672038, 178.353157, 112.296545),\n (178.353157, 112.296545, 178.353157, 112.921053),\n (178.353157, 112.921053, 178.353157, 113.545561),\n (178.353157, 113.545561, 178.353157, 114.170069),\n (178.353157, 114.170069, 178.353157, 114.794577),\n (178.353157, 114.794577, 178.353157, 115.419084),\n (178.353157, 115.419084, 178.353157, 116.043592),\n (178.353157, 116.043592, 178.353157, 116.6681),\n (162.615353, 96.68385, 162.615353, 97.308358),\n (162.615353, 97.308358, 162.615353, 97.932866),\n (162.615353, 97.932866, 162.615353, 98.557374),\n (162.615353, 98.557374, 162.615353, 99.181881),\n (162.615353, 99.181881, 162.615353, 99.806389),\n (162.615353, 99.806389, 162.615353, 100.430897),\n (162.615353, 100.430897, 162.615353, 101.055405),\n (162.615353, 101.055405, 162.615353, 101.679913),\n (162.615353, 101.679913, 162.615353, 102.30442),\n (162.615353, 102.30442, 162.615353, 102.928928),\n (162.615353, 102.928928, 162.615353, 103.553436),\n (162.615353, 103.553436, 162.615353, 104.177944),\n (162.615353, 104.177944, 162.615353, 104.802452),\n (162.615353, 104.802452, 162.615353, 105.426959),\n (162.615353, 105.426959, 162.615353, 106.051467),\n (162.615353, 106.051467, 162.615353, 106.675975),\n (162.615353, 106.675975, 162.615353, 107.300483),\n (162.615353, 107.300483, 162.615353, 107.924991),\n (162.615353, 107.924991, 162.615353, 108.549499),\n (162.615353, 108.549499, 162.615353, 109.174006),\n (162.615353, 109.174006, 162.615353, 109.798514),\n (162.615353, 109.798514, 162.615353, 110.423022),\n (162.615353, 110.423022, 162.615353, 111.04753),\n (162.615353, 111.04753, 162.615353, 111.672038),\n (162.615353, 111.672038, 162.615353, 112.296545),\n (162.615353, 112.296545, 162.615353, 112.921053),\n (162.615353, 112.921053, 162.615353, 113.545561),\n (162.615353, 113.545561, 162.615353, 114.170069),\n (162.615353, 114.170069, 162.615353, 114.794577),\n (162.615353, 114.794577, 162.615353, 115.419084),\n (162.615353, 115.419084, 162.615353, 116.043592),\n (162.615353, 116.043592, 162.615353, 116.6681),\n (162.615353, 116.6681, 162.615353, 177.046046),\n (178.353157, 177.046046, 162.615353, 177.046046),\n (178.353157, 116.6681, 178.353157, 177.046046),\n (162.615353, 96.68385, 178.353157, 96.68385),\n (178.353157, 116.6681, 162.615353, 116.6681)\n]\nVISIBLE_CIRCLES = [\n (129.0563, 116.6681, 5.952755)\n]\nVISIBLE_ARCS = [\n (128.631103, 116.6681, 19.98425, -180.0, -0.0)\n]\nHIDDEN_SEGMENTS = [\n (135.0091, 66.9461, 135.0091, 82.6839),\n (123.1035, 82.6839, 123.1035, 66.9461),\n (162.6153, 110.7154, 178.3532, 110.7154),\n (162.6153, 122.6209, 178.3532, 122.6209)\n]\n# (orient, text, p1, p2, base) for linear; (orient, text, center, radius, angle) for diameter\nDIMENSIONS = [\n ('horizontal', '66.1972', (148.6153, 116.6681), (108.6468, 116.6681), (128.6311, 105.6681)),\n ('vertical', '100', (148.6153, 177.0461), (148.6153, 116.6681), (159.6153, 146.8571)),\n ('diameter', '%%c19.7183', (129.0563, 116.6681), 5.9528, 45),\n ('horizontal', '33.8028', (108.6468, 116.6681), (129.0563, 116.6681), (118.8516, 127.6681)),\n ('vertical', '100', (129.0563, 177.0461), (129.0563, 116.6681), (140.0563, 146.8571)),\n ('radius', 'R33.0986', (128.6311, 116.6681), 19.9843, 45),\n ('horizontal', '26.0655', (178.3532, 177.0461), (162.6153, 177.0461), (170.4842, 166.0461))\n]\n\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; _ds.dxf.dimasz = 2.5\n _ds.dxf.dimexe = 1.25; _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\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\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,\n angle=(0 if d[0] == \"horizontal\" else 90),\n 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,\n 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,\n 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,\n text=text, dimstyle=\"EZDXF\").render()\n\n doc.saveas(out_path)\n\n\nif __name__ == \"__main__\":\n out = sys.argv[1] if len(sys.argv) > 1 else \"0077_00776841_gt.dxf\"\n draw(out)\n print(\"wrote\", out)\n```"}], "images": ["images/0077_00776841.png"], "id": "0077_00776841"} {"messages": [{"role": "user", "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 1.04 mm. The outline includes one or more oblique (angled) edges."}, {"role": "assistant", "content": "```python\n#!/usr/bin/env python3\n# -*- coding: utf-8 -*-\n# Ground-truth 2D engineering drawing for part: 0079_00792346\n# Self-contained: reproduces the three-view DXF via ezdxf, NO FreeCAD needed.\n# Coordinates are A4 page millimetres (scale=0.6006250000000112, page=[297.0, 210.0]).\n# visible edges -> solid (layer OUTLINE); hidden edges -> dashed (layer HIDDEN)\n# dimensions -> real movable DIMENSION entities (text = true mm value)\n# Run: python 0079_00792346_gt.py [out.dxf]\nimport sys\nimport ezdxf\nimport math\n\nSCALE = 0.6006250000000112\nPAGE = [297.0, 210.0]\n\nVISIBLE_SEGMENTS = [\n (154.205908, 94.2816, 154.205908, 154.3441),\n (154.205908, 154.3441, 130.180908, 154.3441),\n (118.168408, 142.3316, 118.168408, 94.2816),\n (118.168408, 94.2816, 154.205908, 94.2816),\n (154.205908, 80.2816, 154.205908, 79.655949),\n (154.205908, 79.655949, 130.180908, 79.655949),\n (154.205908, 80.2816, 130.180908, 80.2816),\n (130.180908, 80.2816, 129.805517, 80.2816),\n (129.805517, 80.2816, 129.430127, 80.2816),\n (129.430127, 80.2816, 129.054736, 80.2816),\n (129.054736, 80.2816, 128.679346, 80.2816),\n (128.679346, 80.2816, 128.303955, 80.2816),\n (128.303955, 80.2816, 127.928564, 80.2816),\n (127.928564, 80.2816, 127.553174, 80.2816),\n (127.553174, 80.2816, 127.177783, 80.2816),\n (127.177783, 80.2816, 126.802392, 80.2816),\n (126.802392, 80.2816, 126.427002, 80.2816),\n (126.427002, 80.2816, 126.051611, 80.2816),\n (126.051611, 80.2816, 125.676221, 80.2816),\n (125.676221, 80.2816, 125.30083, 80.2816),\n (125.30083, 80.2816, 124.925439, 80.2816),\n (124.925439, 80.2816, 124.550049, 80.2816),\n (124.550049, 80.2816, 124.174658, 80.2816),\n (124.174658, 80.2816, 123.799267, 80.2816),\n (123.799267, 80.2816, 123.423877, 80.2816),\n (123.423877, 80.2816, 123.048486, 80.2816),\n (123.048486, 80.2816, 122.673096, 80.2816),\n (122.673096, 80.2816, 122.297705, 80.2816),\n (122.297705, 80.2816, 121.922314, 80.2816),\n (121.922314, 80.2816, 121.546924, 80.2816),\n (121.546924, 80.2816, 121.171533, 80.2816),\n (121.171533, 80.2816, 120.796142, 80.2816),\n (120.796142, 80.2816, 120.420752, 80.2816),\n (120.420752, 80.2816, 120.045361, 80.2816),\n (120.045361, 80.2816, 119.669971, 80.2816),\n (119.669971, 80.2816, 119.29458, 80.2816),\n (119.29458, 80.2816, 118.919189, 80.2816),\n (118.919189, 80.2816, 118.543799, 80.2816),\n (118.543799, 80.2816, 118.168408, 80.2816),\n (118.168408, 80.2816, 118.168408, 79.655949),\n (130.180908, 79.655949, 129.805517, 79.655949),\n (129.805517, 79.655949, 129.430127, 79.655949),\n (129.430127, 79.655949, 129.054736, 79.655949),\n (129.054736, 79.655949, 128.679346, 79.655949),\n (128.679346, 79.655949, 128.303955, 79.655949),\n (128.303955, 79.655949, 127.928564, 79.655949),\n (127.928564, 79.655949, 127.553174, 79.655949),\n (127.553174, 79.655949, 127.177783, 79.655949),\n (127.177783, 79.655949, 126.802392, 79.655949),\n (126.802392, 79.655949, 126.427002, 79.655949),\n (126.427002, 79.655949, 126.051611, 79.655949),\n (126.051611, 79.655949, 125.676221, 79.655949),\n (125.676221, 79.655949, 125.30083, 79.655949),\n (125.30083, 79.655949, 124.925439, 79.655949),\n (124.925439, 79.655949, 124.550049, 79.655949),\n (124.550049, 79.655949, 124.174658, 79.655949),\n (124.174658, 79.655949, 123.799267, 79.655949),\n (123.799267, 79.655949, 123.423877, 79.655949),\n (123.423877, 79.655949, 123.048486, 79.655949),\n (123.048486, 79.655949, 122.673096, 79.655949),\n (122.673096, 79.655949, 122.297705, 79.655949),\n (122.297705, 79.655949, 121.922314, 79.655949),\n (121.922314, 79.655949, 121.546924, 79.655949),\n (121.546924, 79.655949, 121.171533, 79.655949),\n (121.171533, 79.655949, 120.796142, 79.655949),\n (120.796142, 79.655949, 120.420752, 79.655949),\n (120.420752, 79.655949, 120.045361, 79.655949),\n (120.045361, 79.655949, 119.669971, 79.655949),\n (119.669971, 79.655949, 119.29458, 79.655949),\n (119.29458, 79.655949, 118.919189, 79.655949),\n (118.919189, 79.655949, 118.543799, 79.655949),\n (118.543799, 79.655949, 118.168408, 79.655949),\n (130.180908, 80.2816, 130.180908, 79.655949),\n (168.205908, 154.3441, 168.831559, 154.3441),\n (168.205908, 154.3441, 168.205908, 153.968709),\n (168.205908, 153.968709, 168.205908, 153.593319),\n (168.205908, 153.593319, 168.205908, 153.217928),\n (168.205908, 153.217928, 168.205908, 152.842538),\n (168.205908, 152.842538, 168.205908, 152.467147),\n (168.205908, 152.467147, 168.205908, 152.091756),\n (168.205908, 152.091756, 168.205908, 151.716366),\n (168.205908, 151.716366, 168.205908, 151.340975),\n (168.205908, 151.340975, 168.205908, 150.965584),\n (168.205908, 150.965584, 168.205908, 150.590194),\n (168.205908, 150.590194, 168.205908, 150.214803),\n (168.205908, 150.214803, 168.205908, 149.839413),\n (168.205908, 149.839413, 168.205908, 149.464022),\n (168.205908, 149.464022, 168.205908, 149.088631),\n (168.205908, 149.088631, 168.205908, 148.713241),\n (168.205908, 148.713241, 168.205908, 148.33785),\n (168.205908, 148.33785, 168.205908, 147.962459),\n (168.205908, 147.962459, 168.205908, 147.587069),\n (168.205908, 147.587069, 168.205908, 147.211678),\n (168.205908, 147.211678, 168.205908, 146.836288),\n (168.205908, 146.836288, 168.205908, 146.460897),\n (168.205908, 146.460897, 168.205908, 146.085506),\n (168.205908, 146.085506, 168.205908, 145.710116),\n (168.205908, 145.710116, 168.205908, 145.334725),\n (168.205908, 145.334725, 168.205908, 144.959334),\n (168.205908, 144.959334, 168.205908, 144.583944),\n (168.205908, 144.583944, 168.205908, 144.208553),\n (168.205908, 144.208553, 168.205908, 143.833163),\n (168.205908, 143.833163, 168.205908, 143.457772),\n (168.205908, 143.457772, 168.205908, 143.082381),\n (168.205908, 143.082381, 168.205908, 142.706991),\n (168.205908, 142.706991, 168.205908, 142.3316),\n (168.831559, 154.3441, 168.831559, 153.968709),\n (168.831559, 153.968709, 168.831559, 153.593319),\n (168.831559, 153.593319, 168.831559, 153.217928),\n (168.831559, 153.217928, 168.831559, 152.842538),\n (168.831559, 152.842538, 168.831559, 152.467147),\n (168.831559, 152.467147, 168.831559, 152.091756),\n (168.831559, 152.091756, 168.831559, 151.716366),\n (168.831559, 151.716366, 168.831559, 151.340975),\n (168.831559, 151.340975, 168.831559, 150.965584),\n (168.831559, 150.965584, 168.831559, 150.590194),\n (168.831559, 150.590194, 168.831559, 150.214803),\n (168.831559, 150.214803, 168.831559, 149.839413),\n (168.831559, 149.839413, 168.831559, 149.464022),\n (168.831559, 149.464022, 168.831559, 149.088631),\n (168.831559, 149.088631, 168.831559, 148.713241),\n (168.831559, 148.713241, 168.831559, 148.33785),\n (168.831559, 148.33785, 168.831559, 147.962459),\n (168.831559, 147.962459, 168.831559, 147.587069),\n (168.831559, 147.587069, 168.831559, 147.211678),\n (168.831559, 147.211678, 168.831559, 146.836288),\n (168.831559, 146.836288, 168.831559, 146.460897),\n (168.831559, 146.460897, 168.831559, 146.085506),\n (168.831559, 146.085506, 168.831559, 145.710116),\n (168.831559, 145.710116, 168.831559, 145.334725),\n (168.831559, 145.334725, 168.831559, 144.959334),\n (168.831559, 144.959334, 168.831559, 144.583944),\n (168.831559, 144.583944, 168.831559, 144.208553),\n (168.831559, 144.208553, 168.831559, 143.833163),\n (168.831559, 143.833163, 168.831559, 143.457772),\n (168.831559, 143.457772, 168.831559, 143.082381),\n (168.831559, 143.082381, 168.831559, 142.706991),\n (168.831559, 142.706991, 168.831559, 142.3316),\n (168.831559, 142.3316, 168.831559, 94.2816),\n (168.205908, 94.2816, 168.831559, 94.2816),\n (168.205908, 142.3316, 168.205908, 94.2816),\n (168.205908, 142.3316, 168.831559, 142.3316)\n]\nVISIBLE_CIRCLES = [\n\n]\nVISIBLE_ARCS = [\n (130.180908, 142.3316, 12.0125, 90.0, -180.0)\n]\nHIDDEN_SEGMENTS = [\n\n]\n# (orient, text, p1, p2, base) for linear; (orient, text, center, radius, angle) for diameter\nDIMENSIONS = [\n ('horizontal', '40', (154.2059, 154.3441), (130.1809, 154.3441), (142.1934, 143.3441)),\n ('horizontal', '60', (118.1684, 94.2816), (154.2059, 94.2816), (136.1872, 105.2816)),\n ('vertical', '80', (118.1684, 142.3316), (118.1684, 94.2816), (129.1684, 118.3066)),\n ('vertical', '100', (154.2059, 94.2816), (154.2059, 154.3441), (143.2059, 124.3128)),\n ('radius', 'R20', (130.1809, 142.3316), 12.0125, 45),\n ('horizontal', '1.0417', (168.2059, 94.2816), (168.8316, 94.2816), (168.5188, 105.2816))\n]\n\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; _ds.dxf.dimasz = 2.5\n _ds.dxf.dimexe = 1.25; _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\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\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,\n angle=(0 if d[0] == \"horizontal\" else 90),\n 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,\n 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,\n 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,\n text=text, dimstyle=\"EZDXF\").render()\n\n doc.saveas(out_path)\n\n\nif __name__ == \"__main__\":\n out = sys.argv[1] if len(sys.argv) > 1 else \"0079_00792346_gt.dxf\"\n draw(out)\n print(\"wrote\", out)\n```"}], "images": ["images/0079_00792346.png"], "id": "0079_00792346"} {"messages": [{"role": "user", "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 2.91 mm. The outline includes one or more oblique (angled) edges."}, {"role": "assistant", "content": "```python\n#!/usr/bin/env python3\n# -*- coding: utf-8 -*-\n# Ground-truth 2D engineering drawing for part: 0081_00816892\n# Self-contained: reproduces the three-view DXF via ezdxf, NO FreeCAD needed.\n# Coordinates are A4 page millimetres (scale=1.2813576275714802, page=[297.0, 210.0]).\n# visible edges -> solid (layer OUTLINE); hidden edges -> dashed (layer HIDDEN)\n# dimensions -> real movable DIMENSION entities (text = true mm value)\n# Run: python 0081_00816892_gt.py [out.dxf]\nimport sys\nimport ezdxf\nimport math\n\nSCALE = 1.2813576275714802\nPAGE = [297.0, 210.0]\n\nVISIBLE_SEGMENTS = [\n (70.567393, 152.999339, 198.703155, 152.999339),\n (206.240553, 145.461941, 206.240553, 106.267473),\n (198.703155, 98.730075, 70.567393, 98.730075),\n (63.029995, 106.267473, 63.029995, 145.461941),\n (206.240553, 81.000633, 206.240553, 84.730075),\n (206.240553, 81.000633, 206.00501, 81.000633),\n (206.00501, 81.000633, 205.769466, 81.000633),\n (205.769466, 81.000633, 205.533922, 81.000633),\n (205.533922, 81.000633, 205.298379, 81.000633),\n (205.298379, 81.000633, 205.062835, 81.000633),\n (205.062835, 81.000633, 204.827291, 81.000633),\n (204.827291, 81.000633, 204.591747, 81.000633),\n (204.591747, 81.000633, 204.356204, 81.000633),\n (204.356204, 81.000633, 204.12066, 81.000633),\n (204.12066, 81.000633, 203.885116, 81.000633),\n (203.885116, 81.000633, 203.649573, 81.000633),\n (203.649573, 81.000633, 203.414029, 81.000633),\n (203.414029, 81.000633, 203.178485, 81.000633),\n (203.178485, 81.000633, 202.942942, 81.000633),\n (202.942942, 81.000633, 202.707398, 81.000633),\n (202.707398, 81.000633, 202.471854, 81.000633),\n (202.471854, 81.000633, 202.236311, 81.000633),\n (202.236311, 81.000633, 202.000767, 81.000633),\n (202.000767, 81.000633, 201.765223, 81.000633),\n (201.765223, 81.000633, 201.52968, 81.000633),\n (201.52968, 81.000633, 201.294136, 81.000633),\n (201.294136, 81.000633, 201.058592, 81.000633),\n (201.058592, 81.000633, 200.823049, 81.000633),\n (200.823049, 81.000633, 200.587505, 81.000633),\n (200.587505, 81.000633, 200.351961, 81.000633),\n (200.351961, 81.000633, 200.116418, 81.000633),\n (200.116418, 81.000633, 199.880874, 81.000633),\n (199.880874, 81.000633, 199.64533, 81.000633),\n (199.64533, 81.000633, 199.409786, 81.000633),\n (199.409786, 81.000633, 199.174243, 81.000633),\n (199.174243, 81.000633, 198.938699, 81.000633),\n (198.938699, 81.000633, 198.703155, 81.000633),\n (206.240553, 84.730075, 206.00501, 84.730075),\n (206.00501, 84.730075, 205.769466, 84.730075),\n (205.769466, 84.730075, 205.533922, 84.730075),\n (205.533922, 84.730075, 205.298379, 84.730075),\n (205.298379, 84.730075, 205.062835, 84.730075),\n (205.062835, 84.730075, 204.827291, 84.730075),\n (204.827291, 84.730075, 204.591747, 84.730075),\n (204.591747, 84.730075, 204.356204, 84.730075),\n (204.356204, 84.730075, 204.12066, 84.730075),\n (204.12066, 84.730075, 203.885116, 84.730075),\n (203.885116, 84.730075, 203.649573, 84.730075),\n (203.649573, 84.730075, 203.414029, 84.730075),\n (203.414029, 84.730075, 203.178485, 84.730075),\n (203.178485, 84.730075, 202.942942, 84.730075),\n (202.942942, 84.730075, 202.707398, 84.730075),\n (202.707398, 84.730075, 202.471854, 84.730075),\n (202.471854, 84.730075, 202.236311, 84.730075),\n (202.236311, 84.730075, 202.000767, 84.730075),\n (202.000767, 84.730075, 201.765223, 84.730075),\n (201.765223, 84.730075, 201.52968, 84.730075),\n (201.52968, 84.730075, 201.294136, 84.730075),\n (201.294136, 84.730075, 201.058592, 84.730075),\n (201.058592, 84.730075, 200.823049, 84.730075),\n (200.823049, 84.730075, 200.587505, 84.730075),\n (200.587505, 84.730075, 200.351961, 84.730075),\n (200.351961, 84.730075, 200.116418, 84.730075),\n (200.116418, 84.730075, 199.880874, 84.730075),\n (199.880874, 84.730075, 199.64533, 84.730075),\n (199.64533, 84.730075, 199.409786, 84.730075),\n (199.409786, 84.730075, 199.174243, 84.730075),\n (199.174243, 84.730075, 198.938699, 84.730075),\n (198.938699, 84.730075, 198.703155, 84.730075),\n (198.703155, 84.730075, 70.567393, 84.730075),\n (198.703155, 81.000633, 70.567393, 81.000633),\n (70.567393, 81.000633, 70.331849, 81.000633),\n (70.331849, 81.000633, 70.096305, 81.000633),\n (70.096305, 81.000633, 69.860762, 81.000633),\n (69.860762, 81.000633, 69.625218, 81.000633),\n (69.625218, 81.000633, 69.389674, 81.000633),\n (69.389674, 81.000633, 69.154131, 81.000633),\n (69.154131, 81.000633, 68.918587, 81.000633),\n (68.918587, 81.000633, 68.683043, 81.000633),\n (68.683043, 81.000633, 68.4475, 81.000633),\n (68.4475, 81.000633, 68.211956, 81.000633),\n (68.211956, 81.000633, 67.976412, 81.000633),\n (67.976412, 81.000633, 67.740868, 81.000633),\n (67.740868, 81.000633, 67.505325, 81.000633),\n (67.505325, 81.000633, 67.269781, 81.000633),\n (67.269781, 81.000633, 67.034237, 81.000633),\n (67.034237, 81.000633, 66.798694, 81.000633),\n (66.798694, 81.000633, 66.56315, 81.000633),\n (66.56315, 81.000633, 66.327606, 81.000633),\n (66.327606, 81.000633, 66.092063, 81.000633),\n (66.092063, 81.000633, 65.856519, 81.000633),\n (65.856519, 81.000633, 65.620975, 81.000633),\n (65.620975, 81.000633, 65.385432, 81.000633),\n (65.385432, 81.000633, 65.149888, 81.000633),\n (65.149888, 81.000633, 64.914344, 81.000633),\n (64.914344, 81.000633, 64.678801, 81.000633),\n (64.678801, 81.000633, 64.443257, 81.000633),\n (64.443257, 81.000633, 64.207713, 81.000633),\n (64.207713, 81.000633, 63.97217, 81.000633),\n (63.97217, 81.000633, 63.736626, 81.000633),\n (63.736626, 81.000633, 63.501082, 81.000633),\n (63.501082, 81.000633, 63.265539, 81.000633),\n (63.265539, 81.000633, 63.029995, 81.000633),\n (63.029995, 81.000633, 63.029995, 84.730075),\n (70.567393, 84.730075, 70.331849, 84.730075),\n (70.331849, 84.730075, 70.096305, 84.730075),\n (70.096305, 84.730075, 69.860762, 84.730075),\n (69.860762, 84.730075, 69.625218, 84.730075),\n (69.625218, 84.730075, 69.389674, 84.730075),\n (69.389674, 84.730075, 69.154131, 84.730075),\n (69.154131, 84.730075, 68.918587, 84.730075),\n (68.918587, 84.730075, 68.683043, 84.730075),\n (68.683043, 84.730075, 68.4475, 84.730075),\n (68.4475, 84.730075, 68.211956, 84.730075),\n (68.211956, 84.730075, 67.976412, 84.730075),\n (67.976412, 84.730075, 67.740868, 84.730075),\n (67.740868, 84.730075, 67.505325, 84.730075),\n (67.505325, 84.730075, 67.269781, 84.730075),\n (67.269781, 84.730075, 67.034237, 84.730075),\n (67.034237, 84.730075, 66.798694, 84.730075),\n (66.798694, 84.730075, 66.56315, 84.730075),\n (66.56315, 84.730075, 66.327606, 84.730075),\n (66.327606, 84.730075, 66.092063, 84.730075),\n (66.092063, 84.730075, 65.856519, 84.730075),\n (65.856519, 84.730075, 65.620975, 84.730075),\n (65.620975, 84.730075, 65.385432, 84.730075),\n (65.385432, 84.730075, 65.149888, 84.730075),\n (65.149888, 84.730075, 64.914344, 84.730075),\n (64.914344, 84.730075, 64.678801, 84.730075),\n (64.678801, 84.730075, 64.443257, 84.730075),\n (64.443257, 84.730075, 64.207713, 84.730075),\n (64.207713, 84.730075, 63.97217, 84.730075),\n (63.97217, 84.730075, 63.736626, 84.730075),\n (63.736626, 84.730075, 63.501082, 84.730075),\n (63.501082, 84.730075, 63.265539, 84.730075),\n (63.265539, 84.730075, 63.029995, 84.730075),\n (198.703155, 81.000633, 198.703155, 84.730075),\n (70.567393, 81.000633, 70.567393, 84.730075),\n (220.240553, 145.461941, 220.240553, 145.697485),\n (220.240553, 145.697485, 220.240553, 145.933029),\n (220.240553, 145.933029, 220.240553, 146.168572),\n (220.240553, 146.168572, 220.240553, 146.404116),\n (220.240553, 146.404116, 220.240553, 146.63966),\n (220.240553, 146.63966, 220.240553, 146.875203),\n (220.240553, 146.875203, 220.240553, 147.110747),\n (220.240553, 147.110747, 220.240553, 147.346291),\n (220.240553, 147.346291, 220.240553, 147.581834),\n (220.240553, 147.581834, 220.240553, 147.817378),\n (220.240553, 147.817378, 220.240553, 148.052922),\n (220.240553, 148.052922, 220.240553, 148.288465),\n (220.240553, 148.288465, 220.240553, 148.524009),\n (220.240553, 148.524009, 220.240553, 148.759553),\n (220.240553, 148.759553, 220.240553, 148.995097),\n (220.240553, 148.995097, 220.240553, 149.23064),\n (220.240553, 149.23064, 220.240553, 149.466184),\n (220.240553, 149.466184, 220.240553, 149.701728),\n (220.240553, 149.701728, 220.240553, 149.937271),\n (220.240553, 149.937271, 220.240553, 150.172815),\n (220.240553, 150.172815, 220.240553, 150.408359),\n (220.240553, 150.408359, 220.240553, 150.643902),\n (220.240553, 150.643902, 220.240553, 150.879446),\n (220.240553, 150.879446, 220.240553, 151.11499),\n (220.240553, 151.11499, 220.240553, 151.350533),\n (220.240553, 151.350533, 220.240553, 151.586077),\n (220.240553, 151.586077, 220.240553, 151.821621),\n (220.240553, 151.821621, 220.240553, 152.057164),\n (220.240553, 152.057164, 220.240553, 152.292708),\n (220.240553, 152.292708, 220.240553, 152.528252),\n (220.240553, 152.528252, 220.240553, 152.763795),\n (220.240553, 152.763795, 220.240553, 152.999339),\n (220.240553, 152.999339, 223.969995, 152.999339),\n (223.969995, 145.461941, 223.969995, 145.697485),\n (223.969995, 145.697485, 223.969995, 145.933029),\n (223.969995, 145.933029, 223.969995, 146.168572),\n (223.969995, 146.168572, 223.969995, 146.404116),\n (223.969995, 146.404116, 223.969995, 146.63966),\n (223.969995, 146.63966, 223.969995, 146.875203),\n (223.969995, 146.875203, 223.969995, 147.110747),\n (223.969995, 147.110747, 223.969995, 147.346291),\n (223.969995, 147.346291, 223.969995, 147.581834),\n (223.969995, 147.581834, 223.969995, 147.817378),\n (223.969995, 147.817378, 223.969995, 148.052922),\n (223.969995, 148.052922, 223.969995, 148.288465),\n (223.969995, 148.288465, 223.969995, 148.524009),\n (223.969995, 148.524009, 223.969995, 148.759553),\n (223.969995, 148.759553, 223.969995, 148.995097),\n (223.969995, 148.995097, 223.969995, 149.23064),\n (223.969995, 149.23064, 223.969995, 149.466184),\n (223.969995, 149.466184, 223.969995, 149.701728),\n (223.969995, 149.701728, 223.969995, 149.937271),\n (223.969995, 149.937271, 223.969995, 150.172815),\n (223.969995, 150.172815, 223.969995, 150.408359),\n (223.969995, 150.408359, 223.969995, 150.643902),\n (223.969995, 150.643902, 223.969995, 150.879446),\n (223.969995, 150.879446, 223.969995, 151.11499),\n (223.969995, 151.11499, 223.969995, 151.350533),\n (223.969995, 151.350533, 223.969995, 151.586077),\n (223.969995, 151.586077, 223.969995, 151.821621),\n (223.969995, 151.821621, 223.969995, 152.057164),\n (223.969995, 152.057164, 223.969995, 152.292708),\n (223.969995, 152.292708, 223.969995, 152.528252),\n (223.969995, 152.528252, 223.969995, 152.763795),\n (223.969995, 152.763795, 223.969995, 152.999339),\n (220.240553, 98.730075, 223.969995, 98.730075),\n (220.240553, 98.730075, 220.240553, 98.965619),\n (220.240553, 98.965619, 220.240553, 99.201162),\n (220.240553, 99.201162, 220.240553, 99.436706),\n (220.240553, 99.436706, 220.240553, 99.67225),\n (220.240553, 99.67225, 220.240553, 99.907793),\n (220.240553, 99.907793, 220.240553, 100.143337),\n (220.240553, 100.143337, 220.240553, 100.378881),\n (220.240553, 100.378881, 220.240553, 100.614424),\n (220.240553, 100.614424, 220.240553, 100.849968),\n (220.240553, 100.849968, 220.240553, 101.085512),\n (220.240553, 101.085512, 220.240553, 101.321055),\n (220.240553, 101.321055, 220.240553, 101.556599),\n (220.240553, 101.556599, 220.240553, 101.792143),\n (220.240553, 101.792143, 220.240553, 102.027686),\n (220.240553, 102.027686, 220.240553, 102.26323),\n (220.240553, 102.26323, 220.240553, 102.498774),\n (220.240553, 102.498774, 220.240553, 102.734317),\n (220.240553, 102.734317, 220.240553, 102.969861),\n (220.240553, 102.969861, 220.240553, 103.205405),\n (220.240553, 103.205405, 220.240553, 103.440949),\n (220.240553, 103.440949, 220.240553, 103.676492),\n (220.240553, 103.676492, 220.240553, 103.912036),\n (220.240553, 103.912036, 220.240553, 104.14758),\n (220.240553, 104.14758, 220.240553, 104.383123),\n (220.240553, 104.383123, 220.240553, 104.618667),\n (220.240553, 104.618667, 220.240553, 104.854211),\n (220.240553, 104.854211, 220.240553, 105.089754),\n (220.240553, 105.089754, 220.240553, 105.325298),\n (220.240553, 105.325298, 220.240553, 105.560842),\n (220.240553, 105.560842, 220.240553, 105.796385),\n (220.240553, 105.796385, 220.240553, 106.031929),\n (220.240553, 106.031929, 220.240553, 106.267473),\n (223.969995, 98.730075, 223.969995, 98.965619),\n (223.969995, 98.965619, 223.969995, 99.201162),\n (223.969995, 99.201162, 223.969995, 99.436706),\n (223.969995, 99.436706, 223.969995, 99.67225),\n (223.969995, 99.67225, 223.969995, 99.907793),\n (223.969995, 99.907793, 223.969995, 100.143337),\n (223.969995, 100.143337, 223.969995, 100.378881),\n (223.969995, 100.378881, 223.969995, 100.614424),\n (223.969995, 100.614424, 223.969995, 100.849968),\n (223.969995, 100.849968, 223.969995, 101.085512),\n (223.969995, 101.085512, 223.969995, 101.321055),\n (223.969995, 101.321055, 223.969995, 101.556599),\n (223.969995, 101.556599, 223.969995, 101.792143),\n (223.969995, 101.792143, 223.969995, 102.027686),\n (223.969995, 102.027686, 223.969995, 102.26323),\n (223.969995, 102.26323, 223.969995, 102.498774),\n (223.969995, 102.498774, 223.969995, 102.734317),\n (223.969995, 102.734317, 223.969995, 102.969861),\n (223.969995, 102.969861, 223.969995, 103.205405),\n (223.969995, 103.205405, 223.969995, 103.440949),\n (223.969995, 103.440949, 223.969995, 103.676492),\n (223.969995, 103.676492, 223.969995, 103.912036),\n (223.969995, 103.912036, 223.969995, 104.14758),\n (223.969995, 104.14758, 223.969995, 104.383123),\n (223.969995, 104.383123, 223.969995, 104.618667),\n (223.969995, 104.618667, 223.969995, 104.854211),\n (223.969995, 104.854211, 223.969995, 105.089754),\n (223.969995, 105.089754, 223.969995, 105.325298),\n (223.969995, 105.325298, 223.969995, 105.560842),\n (223.969995, 105.560842, 223.969995, 105.796385),\n (223.969995, 105.796385, 223.969995, 106.031929),\n (223.969995, 106.031929, 223.969995, 106.267473),\n (223.969995, 106.267473, 223.969995, 145.461941),\n (220.240553, 106.267473, 220.240553, 145.461941),\n (220.240553, 145.461941, 223.969995, 145.461941),\n (220.240553, 106.267473, 223.969995, 106.267473)\n]\nVISIBLE_CIRCLES = [\n\n]\nVISIBLE_ARCS = [\n (70.567393, 145.461941, 7.537398, 90.0, 180.0),\n (198.703155, 145.461941, 7.537398, -0.0, 90.0),\n (198.703155, 106.267473, 7.537398, -90.0, 0.0),\n (70.567393, 106.267473, 7.537398, 180.0, -90.0)\n]\nHIDDEN_SEGMENTS = [\n\n]\n# (orient, text, p1, p2, base) for linear; (orient, text, center, radius, angle) for diameter\nDIMENSIONS = [\n ('horizontal', '100', (70.5674, 98.73), (198.7032, 98.73), (134.6353, 109.73)),\n ('vertical', '30.5882', (206.2406, 106.2675), (206.2406, 145.4619), (195.2406, 125.8647)),\n ('radius', 'R5.8824', (70.5674, 106.2675), 7.5375, 45),\n ('horizontal', '2.9105', (220.2406, 106.2675), (223.9699, 106.2675), (222.1053, 117.2675))\n]\n\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; _ds.dxf.dimasz = 2.5\n _ds.dxf.dimexe = 1.25; _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\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\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,\n angle=(0 if d[0] == \"horizontal\" else 90),\n 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,\n 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,\n 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,\n text=text, dimstyle=\"EZDXF\").render()\n\n doc.saveas(out_path)\n\n\nif __name__ == \"__main__\":\n out = sys.argv[1] if len(sys.argv) > 1 else \"0081_00816892_gt.dxf\"\n draw(out)\n print(\"wrote\", out)\n```"}], "images": ["images/0081_00816892.png"], "id": "0081_00816892"} {"messages": [{"role": "user", "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 -50.26 mm. The outline includes one or more oblique (angled) edges."}, {"role": "assistant", "content": "```python\n#!/usr/bin/env python3\n# -*- coding: utf-8 -*-\n# Ground-truth 2D engineering drawing for part: 0085_00850213\n# Self-contained: reproduces the three-view DXF via ezdxf, NO FreeCAD needed.\n# Coordinates are A4 page millimetres (scale=0.4779710526315815, page=[297.0, 210.0]).\n# visible edges -> solid (layer OUTLINE); hidden edges -> dashed (layer HIDDEN)\n# dimensions -> real movable DIMENSION entities (text = true mm value)\n# Run: python 0085_00850213_gt.py [out.dxf]\nimport sys\nimport ezdxf\nimport math\n\nSCALE = 0.4779710526315815\nPAGE = [297.0, 210.0]\n\nVISIBLE_SEGMENTS = [\n (100.588947, 172.049962, 148.386053, 172.049962),\n (160.525, 159.911014, 160.525, 112.113909),\n (148.386053, 99.974962, 100.588947, 99.974962),\n (88.45, 112.113909, 88.45, 159.911014),\n (160.525, 85.974961, 160.525, 61.949961),\n (160.525, 61.949961, 160.145658, 61.949961),\n (160.145658, 61.949961, 159.766316, 61.949961),\n (159.766316, 61.949961, 159.386974, 61.949961),\n (159.386974, 61.949961, 159.007631, 61.949961),\n (159.007631, 61.949961, 158.628289, 61.949961),\n (158.628289, 61.949961, 158.248947, 61.949961),\n (158.248947, 61.949961, 157.869605, 61.949961),\n (157.869605, 61.949961, 157.490263, 61.949961),\n (157.490263, 61.949961, 157.110921, 61.949961),\n (157.110921, 61.949961, 156.731579, 61.949961),\n (156.731579, 61.949961, 156.352237, 61.949961),\n (156.352237, 61.949961, 155.972895, 61.949961),\n (155.972895, 61.949961, 155.593553, 61.949961),\n (155.593553, 61.949961, 155.21421, 61.949961),\n (155.21421, 61.949961, 154.834868, 61.949961),\n (154.834868, 61.949961, 154.455526, 61.949961),\n (154.455526, 61.949961, 154.076184, 61.949961),\n (154.076184, 61.949961, 153.696842, 61.949961),\n (153.696842, 61.949961, 153.3175, 61.949961),\n (153.3175, 61.949961, 152.938158, 61.949961),\n (152.938158, 61.949961, 152.558816, 61.949961),\n (152.558816, 61.949961, 152.179474, 61.949961),\n (152.179474, 61.949961, 151.800131, 61.949961),\n (151.800131, 61.949961, 151.420789, 61.949961),\n (151.420789, 61.949961, 151.041447, 61.949961),\n (151.041447, 61.949961, 150.662105, 61.949961),\n (150.662105, 61.949961, 150.282763, 61.949961),\n (150.282763, 61.949961, 149.903421, 61.949961),\n (149.903421, 61.949961, 149.524079, 61.949961),\n (149.524079, 61.949961, 149.144737, 61.949961),\n (149.144737, 61.949961, 148.765395, 61.949961),\n (148.765395, 61.949961, 148.386053, 61.949961),\n (160.525, 85.974961, 160.145658, 85.974961),\n (160.145658, 85.974961, 159.766316, 85.974961),\n (159.766316, 85.974961, 159.386974, 85.974961),\n (159.386974, 85.974961, 159.007631, 85.974961),\n (159.007631, 85.974961, 158.628289, 85.974961),\n (158.628289, 85.974961, 158.248947, 85.974961),\n (158.248947, 85.974961, 157.869605, 85.974961),\n (157.869605, 85.974961, 157.490263, 85.974961),\n (157.490263, 85.974961, 157.110921, 85.974961),\n (157.110921, 85.974961, 156.731579, 85.974961),\n (156.731579, 85.974961, 156.352237, 85.974961),\n (156.352237, 85.974961, 155.972895, 85.974961),\n (155.972895, 85.974961, 155.593553, 85.974961),\n (155.593553, 85.974961, 155.21421, 85.974961),\n (155.21421, 85.974961, 154.834868, 85.974961),\n (154.834868, 85.974961, 154.455526, 85.974961),\n (154.455526, 85.974961, 154.076184, 85.974961),\n (154.076184, 85.974961, 153.696842, 85.974961),\n (153.696842, 85.974961, 153.3175, 85.974961),\n (153.3175, 85.974961, 152.938158, 85.974961),\n (152.938158, 85.974961, 152.558816, 85.974961),\n (152.558816, 85.974961, 152.179474, 85.974961),\n (152.179474, 85.974961, 151.800131, 85.974961),\n (151.800131, 85.974961, 151.420789, 85.974961),\n (151.420789, 85.974961, 151.041447, 85.974961),\n (151.041447, 85.974961, 150.662105, 85.974961),\n (150.662105, 85.974961, 150.282763, 85.974961),\n (150.282763, 85.974961, 149.903421, 85.974961),\n (149.903421, 85.974961, 149.524079, 85.974961),\n (149.524079, 85.974961, 149.144737, 85.974961),\n (149.144737, 85.974961, 148.765395, 85.974961),\n (148.765395, 85.974961, 148.386053, 85.974961),\n (148.386053, 61.949961, 100.588947, 61.949961),\n (148.386053, 85.974961, 100.588947, 85.974961),\n (100.588947, 61.949961, 100.209605, 61.949961),\n (100.209605, 61.949961, 99.830263, 61.949961),\n (99.830263, 61.949961, 99.450921, 61.949961),\n (99.450921, 61.949961, 99.071579, 61.949961),\n (99.071579, 61.949961, 98.692237, 61.949961),\n (98.692237, 61.949961, 98.312895, 61.949961),\n (98.312895, 61.949961, 97.933553, 61.949961),\n (97.933553, 61.949961, 97.55421, 61.949961),\n (97.55421, 61.949961, 97.174868, 61.949961),\n (97.174868, 61.949961, 96.795526, 61.949961),\n (96.795526, 61.949961, 96.416184, 61.949961),\n (96.416184, 61.949961, 96.036842, 61.949961),\n (96.036842, 61.949961, 95.6575, 61.949961),\n (95.6575, 61.949961, 95.278158, 61.949961),\n (95.278158, 61.949961, 94.898816, 61.949961),\n (94.898816, 61.949961, 94.519474, 61.949961),\n (94.519474, 61.949961, 94.140131, 61.949961),\n (94.140131, 61.949961, 93.760789, 61.949961),\n (93.760789, 61.949961, 93.381447, 61.949961),\n (93.381447, 61.949961, 93.002105, 61.949961),\n (93.002105, 61.949961, 92.622763, 61.949961),\n (92.622763, 61.949961, 92.243421, 61.949961),\n (92.243421, 61.949961, 91.864079, 61.949961),\n (91.864079, 61.949961, 91.484737, 61.949961),\n (91.484737, 61.949961, 91.105395, 61.949961),\n (91.105395, 61.949961, 90.726053, 61.949961),\n (90.726053, 61.949961, 90.34671, 61.949961),\n (90.34671, 61.949961, 89.967368, 61.949961),\n (89.967368, 61.949961, 89.588026, 61.949961),\n (89.588026, 61.949961, 89.208684, 61.949961),\n (89.208684, 61.949961, 88.829342, 61.949961),\n (88.829342, 61.949961, 88.45, 61.949961),\n (88.45, 85.974961, 88.45, 61.949961),\n (100.588947, 85.974961, 100.209605, 85.974961),\n (100.209605, 85.974961, 99.830263, 85.974961),\n (99.830263, 85.974961, 99.450921, 85.974961),\n (99.450921, 85.974961, 99.071579, 85.974961),\n (99.071579, 85.974961, 98.692237, 85.974961),\n (98.692237, 85.974961, 98.312895, 85.974961),\n (98.312895, 85.974961, 97.933553, 85.974961),\n (97.933553, 85.974961, 97.55421, 85.974961),\n (97.55421, 85.974961, 97.174868, 85.974961),\n (97.174868, 85.974961, 96.795526, 85.974961),\n (96.795526, 85.974961, 96.416184, 85.974961),\n (96.416184, 85.974961, 96.036842, 85.974961),\n (96.036842, 85.974961, 95.6575, 85.974961),\n (95.6575, 85.974961, 95.278158, 85.974961),\n (95.278158, 85.974961, 94.898816, 85.974961),\n (94.898816, 85.974961, 94.519474, 85.974961),\n (94.519474, 85.974961, 94.140131, 85.974961),\n (94.140131, 85.974961, 93.760789, 85.974961),\n (93.760789, 85.974961, 93.381447, 85.974961),\n (93.381447, 85.974961, 93.002105, 85.974961),\n (93.002105, 85.974961, 92.622763, 85.974961),\n (92.622763, 85.974961, 92.243421, 85.974961),\n (92.243421, 85.974961, 91.864079, 85.974961),\n (91.864079, 85.974961, 91.484737, 85.974961),\n (91.484737, 85.974961, 91.105395, 85.974961),\n (91.105395, 85.974961, 90.726053, 85.974961),\n (90.726053, 85.974961, 90.34671, 85.974961),\n (90.34671, 85.974961, 89.967368, 85.974961),\n (89.967368, 85.974961, 89.588026, 85.974961),\n (89.588026, 85.974961, 89.208684, 85.974961),\n (89.208684, 85.974961, 88.829342, 85.974961),\n (88.829342, 85.974961, 88.45, 85.974961),\n (148.386053, 85.974961, 148.386053, 61.949961),\n (100.588947, 85.974961, 100.588947, 61.949961),\n (174.525, 159.911014, 174.525, 160.290356),\n (174.525, 160.290356, 174.525, 160.669698),\n (174.525, 160.669698, 174.525, 161.049041),\n (174.525, 161.049041, 174.525, 161.428383),\n (174.525, 161.428383, 174.525, 161.807725),\n (174.525, 161.807725, 174.525, 162.187067),\n (174.525, 162.187067, 174.525, 162.566409),\n (174.525, 162.566409, 174.525, 162.945751),\n (174.525, 162.945751, 174.525, 163.325093),\n (174.525, 163.325093, 174.525, 163.704435),\n (174.525, 163.704435, 174.525, 164.083777),\n (174.525, 164.083777, 174.525, 164.463119),\n (174.525, 164.463119, 174.525, 164.842462),\n (174.525, 164.842462, 174.525, 165.221804),\n (174.525, 165.221804, 174.525, 165.601146),\n (174.525, 165.601146, 174.525, 165.980488),\n (174.525, 165.980488, 174.525, 166.35983),\n (174.525, 166.35983, 174.525, 166.739172),\n (174.525, 166.739172, 174.525, 167.118514),\n (174.525, 167.118514, 174.525, 167.497856),\n (174.525, 167.497856, 174.525, 167.877198),\n (174.525, 167.877198, 174.525, 168.256541),\n (174.525, 168.256541, 174.525, 168.635883),\n (174.525, 168.635883, 174.525, 169.015225),\n (174.525, 169.015225, 174.525, 169.394567),\n (174.525, 169.394567, 174.525, 169.773909),\n (174.525, 169.773909, 174.525, 170.153251),\n (174.525, 170.153251, 174.525, 170.532593),\n (174.525, 170.532593, 174.525, 170.911935),\n (174.525, 170.911935, 174.525, 171.291277),\n (174.525, 171.291277, 174.525, 171.670619),\n (174.525, 171.670619, 174.525, 172.049962),\n (198.55, 172.049962, 174.525, 172.049962),\n (198.55, 159.911014, 198.55, 160.290356),\n (198.55, 160.290356, 198.55, 160.669698),\n (198.55, 160.669698, 198.55, 161.049041),\n (198.55, 161.049041, 198.55, 161.428383),\n (198.55, 161.428383, 198.55, 161.807725),\n (198.55, 161.807725, 198.55, 162.187067),\n (198.55, 162.187067, 198.55, 162.566409),\n (198.55, 162.566409, 198.55, 162.945751),\n (198.55, 162.945751, 198.55, 163.325093),\n (198.55, 163.325093, 198.55, 163.704435),\n (198.55, 163.704435, 198.55, 164.083777),\n (198.55, 164.083777, 198.55, 164.463119),\n (198.55, 164.463119, 198.55, 164.842462),\n (198.55, 164.842462, 198.55, 165.221804),\n (198.55, 165.221804, 198.55, 165.601146),\n (198.55, 165.601146, 198.55, 165.980488),\n (198.55, 165.980488, 198.55, 166.35983),\n (198.55, 166.35983, 198.55, 166.739172),\n (198.55, 166.739172, 198.55, 167.118514),\n (198.55, 167.118514, 198.55, 167.497856),\n (198.55, 167.497856, 198.55, 167.877198),\n (198.55, 167.877198, 198.55, 168.256541),\n (198.55, 168.256541, 198.55, 168.635883),\n (198.55, 168.635883, 198.55, 169.015225),\n (198.55, 169.015225, 198.55, 169.394567),\n (198.55, 169.394567, 198.55, 169.773909),\n (198.55, 169.773909, 198.55, 170.153251),\n (198.55, 170.153251, 198.55, 170.532593),\n (198.55, 170.532593, 198.55, 170.911935),\n (198.55, 170.911935, 198.55, 171.291277),\n (198.55, 171.291277, 198.55, 171.670619),\n (198.55, 171.670619, 198.55, 172.049962),\n (198.55, 99.974962, 174.525, 99.974962),\n (174.525, 99.974962, 174.525, 100.354304),\n (174.525, 100.354304, 174.525, 100.733646),\n (174.525, 100.733646, 174.525, 101.112988),\n (174.525, 101.112988, 174.525, 101.49233),\n (174.525, 101.49233, 174.525, 101.871672),\n (174.525, 101.871672, 174.525, 102.251014),\n (174.525, 102.251014, 174.525, 102.630356),\n (174.525, 102.630356, 174.525, 103.009698),\n (174.525, 103.009698, 174.525, 103.389041),\n (174.525, 103.389041, 174.525, 103.768383),\n (174.525, 103.768383, 174.525, 104.147725),\n (174.525, 104.147725, 174.525, 104.527067),\n (174.525, 104.527067, 174.525, 104.906409),\n (174.525, 104.906409, 174.525, 105.285751),\n (174.525, 105.285751, 174.525, 105.665093),\n (174.525, 105.665093, 174.525, 106.044435),\n (174.525, 106.044435, 174.525, 106.423777),\n (174.525, 106.423777, 174.525, 106.803119),\n (174.525, 106.803119, 174.525, 107.182462),\n (174.525, 107.182462, 174.525, 107.561804),\n (174.525, 107.561804, 174.525, 107.941146),\n (174.525, 107.941146, 174.525, 108.320488),\n (174.525, 108.320488, 174.525, 108.69983),\n (174.525, 108.69983, 174.525, 109.079172),\n (174.525, 109.079172, 174.525, 109.458514),\n (174.525, 109.458514, 174.525, 109.837856),\n (174.525, 109.837856, 174.525, 110.217198),\n (174.525, 110.217198, 174.525, 110.596541),\n (174.525, 110.596541, 174.525, 110.975883),\n (174.525, 110.975883, 174.525, 111.355225),\n (174.525, 111.355225, 174.525, 111.734567),\n (174.525, 111.734567, 174.525, 112.113909),\n (198.55, 99.974962, 198.55, 100.354304),\n (198.55, 100.354304, 198.55, 100.733646),\n (198.55, 100.733646, 198.55, 101.112988),\n (198.55, 101.112988, 198.55, 101.49233),\n (198.55, 101.49233, 198.55, 101.871672),\n (198.55, 101.871672, 198.55, 102.251014),\n (198.55, 102.251014, 198.55, 102.630356),\n (198.55, 102.630356, 198.55, 103.009698),\n (198.55, 103.009698, 198.55, 103.389041),\n (198.55, 103.389041, 198.55, 103.768383),\n (198.55, 103.768383, 198.55, 104.147725),\n (198.55, 104.147725, 198.55, 104.527067),\n (198.55, 104.527067, 198.55, 104.906409),\n (198.55, 104.906409, 198.55, 105.285751),\n (198.55, 105.285751, 198.55, 105.665093),\n (198.55, 105.665093, 198.55, 106.044435),\n (198.55, 106.044435, 198.55, 106.423777),\n (198.55, 106.423777, 198.55, 106.803119),\n (198.55, 106.803119, 198.55, 107.182462),\n (198.55, 107.182462, 198.55, 107.561804),\n (198.55, 107.561804, 198.55, 107.941146),\n (198.55, 107.941146, 198.55, 108.320488),\n (198.55, 108.320488, 198.55, 108.69983),\n (198.55, 108.69983, 198.55, 109.079172),\n (198.55, 109.079172, 198.55, 109.458514),\n (198.55, 109.458514, 198.55, 109.837856),\n (198.55, 109.837856, 198.55, 110.217198),\n (198.55, 110.217198, 198.55, 110.596541),\n (198.55, 110.596541, 198.55, 110.975883),\n (198.55, 110.975883, 198.55, 111.355225),\n (198.55, 111.355225, 198.55, 111.734567),\n (198.55, 111.734567, 198.55, 112.113909),\n (174.525, 112.113909, 174.525, 159.911014),\n (198.55, 112.113909, 198.55, 159.911014),\n (198.55, 159.911014, 174.525, 159.911014),\n (198.55, 112.113909, 174.525, 112.113909)\n]\nVISIBLE_CIRCLES = [\n\n]\nVISIBLE_ARCS = [\n (100.588947, 159.911014, 12.138947, 90.0, -180.0),\n (148.386053, 159.911014, 12.138947, -0.0, 90.0),\n (148.386053, 112.113909, 12.138947, -90.0, 0.0),\n (100.588947, 112.113909, 12.138947, -180.0, -90.0)\n]\nHIDDEN_SEGMENTS = [\n\n]\n# (orient, text, p1, p2, base) for linear; (orient, text, center, radius, angle) for diameter\nDIMENSIONS = [\n ('horizontal', '100', (100.5889, 99.975), (148.3861, 99.975), (124.4875, 110.975)),\n ('vertical', '100', (160.525, 112.1139), (160.525, 159.911), (149.525, 136.0125)),\n ('radius', 'R25.3968', (100.5889, 112.1139), 12.1389, 45),\n ('horizontal', '50.2646', (198.55, 112.1139), (174.525, 112.1139), (186.5375, 101.1139))\n]\n\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; _ds.dxf.dimasz = 2.5\n _ds.dxf.dimexe = 1.25; _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\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\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,\n angle=(0 if d[0] == \"horizontal\" else 90),\n 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,\n 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,\n 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,\n text=text, dimstyle=\"EZDXF\").render()\n\n doc.saveas(out_path)\n\n\nif __name__ == \"__main__\":\n out = sys.argv[1] if len(sys.argv) > 1 else \"0085_00850213_gt.dxf\"\n draw(out)\n print(\"wrote\", out)\n```"}], "images": ["images/0085_00850213.png"], "id": "0085_00850213"} {"messages": [{"role": "user", "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 93.68 mm tall. It is extruded to a thickness of 2.6 mm."}, {"role": "assistant", "content": "```python\n#!/usr/bin/env python3\n# -*- coding: utf-8 -*-\n# Ground-truth 2D engineering drawing for part: 0090_00900606\n# Self-contained: reproduces the three-view DXF via ezdxf, NO FreeCAD needed.\n# Coordinates are A4 page millimetres (scale=0.49616847826086535, page=[297.0, 210.0]).\n# visible edges -> solid (layer OUTLINE); hidden edges -> dashed (layer HIDDEN)\n# dimensions -> real movable DIMENSION entities (text = true mm value)\n# Run: python 0090_00900606_gt.py [out.dxf]\nimport sys\nimport ezdxf\nimport math\n\nSCALE = 0.49616847826086535\nPAGE = [297.0, 210.0]\n\nVISIBLE_SEGMENTS = [\n (160.662371, 101.404477, 160.662371, 147.887629),\n (160.662371, 147.887629, 139.248784, 147.887629),\n (132.45911, 147.887629, 111.045523, 147.887629),\n (111.045523, 147.887629, 111.045523, 101.404477),\n (111.045523, 101.404477, 160.662371, 101.404477),\n (160.662371, 87.404477, 160.662371, 86.112371),\n (160.662371, 86.112371, 139.248784, 86.112371),\n (139.248784, 87.404477, 139.248784, 86.112371),\n (160.662371, 87.404477, 139.248784, 87.404477),\n (139.248784, 86.112371, 132.45911, 86.112371),\n (132.45911, 87.404477, 132.45911, 86.112371),\n (139.248784, 87.404477, 132.45911, 87.404477),\n (132.45911, 86.112371, 111.045523, 86.112371),\n (111.045523, 87.404477, 111.045523, 86.112371),\n (132.45911, 87.404477, 111.045523, 87.404477),\n (174.662371, 147.887629, 175.954477, 147.887629),\n (175.954477, 147.887629, 175.954477, 101.404477),\n (174.662371, 101.404477, 175.954477, 101.404477),\n (174.662371, 147.887629, 174.662371, 101.404477)\n]\nVISIBLE_CIRCLES = [\n\n]\nVISIBLE_ARCS = [\n (135.853947, 147.887629, 3.394837, -180.0, 0.0)\n]\nHIDDEN_SEGMENTS = [\n (175.9545, 144.4928, 174.6624, 144.4928)\n]\n# (orient, text, p1, p2, base) for linear; (orient, text, center, radius, angle) for diameter\nDIMENSIONS = [\n ('horizontal', '100', (160.6624, 147.8876), (111.0455, 147.8876), (135.8539, 136.8876)),\n ('vertical', '93.6842', (160.6624, 101.4045), (160.6624, 147.8876), (149.6624, 124.6461)),\n ('radius', 'R6.8421', (135.8539, 147.8876), 3.3948, 45),\n ('horizontal', '2.6042', (174.6624, 101.4045), (175.9545, 101.4045), (175.3084, 112.4045))\n]\n\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; _ds.dxf.dimasz = 2.5\n _ds.dxf.dimexe = 1.25; _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\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\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,\n angle=(0 if d[0] == \"horizontal\" else 90),\n 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,\n 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,\n 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,\n text=text, dimstyle=\"EZDXF\").render()\n\n doc.saveas(out_path)\n\n\nif __name__ == \"__main__\":\n out = sys.argv[1] if len(sys.argv) > 1 else \"0090_00900606_gt.dxf\"\n draw(out)\n print(\"wrote\", out)\n```"}], "images": ["images/0090_00900606.png"], "id": "0090_00900606"} {"messages": [{"role": "user", "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 3 circular holes, each of diameter 8.28 mm. It is extruded to a thickness of 4.44 mm. The outline includes one or more oblique (angled) edges."}, {"role": "assistant", "content": "```python\n#!/usr/bin/env python3\n# -*- coding: utf-8 -*-\n# Ground-truth 2D engineering drawing for part: 0090_00907131\n# Self-contained: reproduces the three-view DXF via ezdxf, NO FreeCAD needed.\n# Coordinates are A4 page millimetres (scale=0.8036910749534497, page=[297.0, 210.0]).\n# visible edges -> solid (layer OUTLINE); hidden edges -> dashed (layer HIDDEN)\n# dimensions -> real movable DIMENSION entities (text = true mm value)\n# Run: python 0090_00907131_gt.py [out.dxf]\nimport sys\nimport ezdxf\nimport math\n\nSCALE = 0.8036910749534497\nPAGE = [297.0, 210.0]\n\nVISIBLE_SEGMENTS = [\n (157.122894, 167.121727, 157.122894, 86.75262),\n (146.59177, 82.318462, 113.889857, 112.803296),\n (112.781318, 120.563072, 146.0375, 170.447345),\n (146.0375, 63.05031, 146.383919, 63.05031),\n (146.383919, 63.05031, 146.730337, 63.05031),\n (146.730337, 63.05031, 147.076756, 63.05031),\n (147.076756, 63.05031, 147.423174, 63.05031),\n (147.423174, 63.05031, 147.769593, 63.05031),\n (147.769593, 63.05031, 148.116012, 63.05031),\n (148.116012, 63.05031, 148.46243, 63.05031),\n (148.46243, 63.05031, 148.808849, 63.05031),\n (148.808849, 63.05031, 149.155267, 63.05031),\n (149.155267, 63.05031, 149.501686, 63.05031),\n (149.501686, 63.05031, 149.848104, 63.05031),\n (149.848104, 63.05031, 150.194523, 63.05031),\n (150.194523, 63.05031, 150.540941, 63.05031),\n (150.540941, 63.05031, 150.88736, 63.05031),\n (150.88736, 63.05031, 151.233779, 63.05031),\n (151.233779, 63.05031, 151.580197, 63.05031),\n (151.580197, 63.05031, 151.926616, 63.05031),\n (151.926616, 63.05031, 152.273034, 63.05031),\n (152.273034, 63.05031, 152.619453, 63.05031),\n (152.619453, 63.05031, 152.965871, 63.05031),\n (152.965871, 63.05031, 153.31229, 63.05031),\n (153.31229, 63.05031, 153.658709, 63.05031),\n (153.658709, 63.05031, 154.005127, 63.05031),\n (154.005127, 63.05031, 154.351546, 63.05031),\n (154.351546, 63.05031, 154.697964, 63.05031),\n (154.697964, 63.05031, 155.044383, 63.05031),\n (155.044383, 63.05031, 155.390801, 63.05031),\n (155.390801, 63.05031, 155.73722, 63.05031),\n (155.73722, 63.05031, 156.083639, 63.05031),\n (156.083639, 63.05031, 156.430057, 63.05031),\n (156.430057, 63.05031, 156.776476, 63.05031),\n (156.776476, 63.05031, 157.122894, 63.05031),\n (146.0375, 66.620183, 146.383919, 66.620183),\n (146.383919, 66.620183, 146.730337, 66.620183),\n (146.730337, 66.620183, 147.076756, 66.620183),\n (147.076756, 66.620183, 147.423174, 66.620183),\n (147.423174, 66.620183, 147.769593, 66.620183),\n (147.769593, 66.620183, 148.116012, 66.620183),\n (148.116012, 66.620183, 148.46243, 66.620183),\n (148.46243, 66.620183, 148.808849, 66.620183),\n (148.808849, 66.620183, 149.155267, 66.620183),\n (149.155267, 66.620183, 149.501686, 66.620183),\n (149.501686, 66.620183, 149.848104, 66.620183),\n (149.848104, 66.620183, 150.194523, 66.620183),\n (150.194523, 66.620183, 150.540941, 66.620183),\n (150.540941, 66.620183, 150.88736, 66.620183),\n (150.88736, 66.620183, 151.233779, 66.620183),\n (151.233779, 66.620183, 151.580197, 66.620183),\n (151.580197, 66.620183, 151.926616, 66.620183),\n (151.926616, 66.620183, 152.273034, 66.620183),\n (152.273034, 66.620183, 152.619453, 66.620183),\n (152.619453, 66.620183, 152.965871, 66.620183),\n (152.965871, 66.620183, 153.31229, 66.620183),\n (153.31229, 66.620183, 153.658709, 66.620183),\n (153.658709, 66.620183, 154.005127, 66.620183),\n (154.005127, 66.620183, 154.351546, 66.620183),\n (154.351546, 66.620183, 154.697964, 66.620183),\n (154.697964, 66.620183, 155.044383, 66.620183),\n (155.044383, 66.620183, 155.390801, 66.620183),\n (155.390801, 66.620183, 155.73722, 66.620183),\n (155.73722, 66.620183, 156.083639, 66.620183),\n (156.083639, 66.620183, 156.430057, 66.620183),\n (156.430057, 66.620183, 156.776476, 66.620183),\n (156.776476, 66.620183, 157.122894, 66.620183),\n (157.122894, 63.05031, 157.122894, 66.620183),\n (111.833086, 63.05031, 111.862718, 63.05031),\n (111.862718, 63.05031, 111.89235, 63.05031),\n (111.89235, 63.05031, 111.921983, 63.05031),\n (111.921983, 63.05031, 111.951615, 63.05031),\n (111.951615, 63.05031, 111.981247, 63.05031),\n (111.981247, 63.05031, 112.010879, 63.05031),\n (112.010879, 63.05031, 112.040512, 63.05031),\n (112.040512, 63.05031, 112.070144, 63.05031),\n (112.070144, 63.05031, 112.099776, 63.05031),\n (112.099776, 63.05031, 112.129408, 63.05031),\n (112.129408, 63.05031, 112.159041, 63.05031),\n (112.159041, 63.05031, 112.188673, 63.05031),\n (112.188673, 63.05031, 112.218305, 63.05031),\n (112.218305, 63.05031, 112.247937, 63.05031),\n (112.247937, 63.05031, 112.27757, 63.05031),\n (112.27757, 63.05031, 112.307202, 63.05031),\n (112.307202, 63.05031, 112.336834, 63.05031),\n (112.336834, 63.05031, 112.366466, 63.05031),\n (112.366466, 63.05031, 112.396099, 63.05031),\n (112.396099, 63.05031, 112.425731, 63.05031),\n (112.425731, 63.05031, 112.455363, 63.05031),\n (112.455363, 63.05031, 112.484995, 63.05031),\n (112.484995, 63.05031, 112.514627, 63.05031),\n (112.514627, 63.05031, 112.54426, 63.05031),\n (112.54426, 63.05031, 112.573892, 63.05031),\n (112.573892, 63.05031, 112.603524, 63.05031),\n (112.603524, 63.05031, 112.633156, 63.05031),\n (112.633156, 63.05031, 112.662789, 63.05031),\n (112.662789, 63.05031, 112.692421, 63.05031),\n (112.692421, 63.05031, 112.722053, 63.05031),\n (112.722053, 63.05031, 112.751685, 63.05031),\n (112.751685, 63.05031, 112.781318, 63.05031),\n (112.781318, 63.05031, 112.781318, 66.620183),\n (111.833086, 66.620183, 111.862718, 66.620183),\n (111.862718, 66.620183, 111.89235, 66.620183),\n (111.89235, 66.620183, 111.921983, 66.620183),\n (111.921983, 66.620183, 111.951615, 66.620183),\n (111.951615, 66.620183, 111.981247, 66.620183),\n (111.981247, 66.620183, 112.010879, 66.620183),\n (112.010879, 66.620183, 112.040512, 66.620183),\n (112.040512, 66.620183, 112.070144, 66.620183),\n (112.070144, 66.620183, 112.099776, 66.620183),\n (112.099776, 66.620183, 112.129408, 66.620183),\n (112.129408, 66.620183, 112.159041, 66.620183),\n (112.159041, 66.620183, 112.188673, 66.620183),\n (112.188673, 66.620183, 112.218305, 66.620183),\n (112.218305, 66.620183, 112.247937, 66.620183),\n (112.247937, 66.620183, 112.27757, 66.620183),\n (112.27757, 66.620183, 112.307202, 66.620183),\n (112.307202, 66.620183, 112.336834, 66.620183),\n (112.336834, 66.620183, 112.366466, 66.620183),\n (112.366466, 66.620183, 112.396099, 66.620183),\n (112.396099, 66.620183, 112.425731, 66.620183),\n (112.425731, 66.620183, 112.455363, 66.620183),\n (112.455363, 66.620183, 112.484995, 66.620183),\n (112.484995, 66.620183, 112.514627, 66.620183),\n (112.514627, 66.620183, 112.54426, 66.620183),\n (112.54426, 66.620183, 112.573892, 66.620183),\n (112.573892, 66.620183, 112.603524, 66.620183),\n (112.603524, 66.620183, 112.633156, 66.620183),\n (112.633156, 66.620183, 112.662789, 66.620183),\n (112.662789, 66.620183, 112.692421, 66.620183),\n (112.692421, 66.620183, 112.722053, 66.620183),\n (112.722053, 66.620183, 112.751685, 66.620183),\n (112.751685, 66.620183, 112.781318, 66.620183),\n (112.781318, 66.620183, 146.0375, 66.620183),\n (112.781318, 63.05031, 146.0375, 63.05031),\n (111.833086, 66.620183, 111.833086, 63.05031),\n (146.0375, 63.05031, 146.0375, 66.620183),\n (171.122894, 82.318462, 171.122894, 112.803296),\n (174.692767, 112.803296, 171.122894, 112.803296),\n (174.692767, 82.318462, 174.692767, 112.803296),\n (174.692767, 112.803296, 174.692767, 113.045789),\n (174.692767, 113.045789, 174.692767, 113.288282),\n (174.692767, 113.288282, 174.692767, 113.530775),\n (174.692767, 113.530775, 174.692767, 113.773268),\n (174.692767, 113.773268, 174.692767, 114.015761),\n (174.692767, 114.015761, 174.692767, 114.258254),\n (174.692767, 114.258254, 174.692767, 114.500747),\n (174.692767, 114.500747, 174.692767, 114.74324),\n (174.692767, 114.74324, 174.692767, 114.985733),\n (174.692767, 114.985733, 174.692767, 115.228226),\n (174.692767, 115.228226, 174.692767, 115.470719),\n (174.692767, 115.470719, 174.692767, 115.713212),\n (174.692767, 115.713212, 174.692767, 115.955705),\n (174.692767, 115.955705, 174.692767, 116.198198),\n (174.692767, 116.198198, 174.692767, 116.440691),\n (174.692767, 116.440691, 174.692767, 116.683184),\n (174.692767, 116.683184, 174.692767, 116.925677),\n (174.692767, 116.925677, 174.692767, 117.16817),\n (174.692767, 117.16817, 174.692767, 117.410663),\n (174.692767, 117.410663, 174.692767, 117.653156),\n (174.692767, 117.653156, 174.692767, 117.895649),\n (174.692767, 117.895649, 174.692767, 118.138142),\n (174.692767, 118.138142, 174.692767, 118.380635),\n (174.692767, 118.380635, 174.692767, 118.623128),\n (174.692767, 118.623128, 174.692767, 118.865621),\n (174.692767, 118.865621, 174.692767, 119.108114),\n (174.692767, 119.108114, 174.692767, 119.350607),\n (174.692767, 119.350607, 174.692767, 119.5931),\n (174.692767, 119.5931, 174.692767, 119.835593),\n (174.692767, 119.835593, 174.692767, 120.078086),\n (174.692767, 120.078086, 174.692767, 120.320579),\n (174.692767, 120.320579, 174.692767, 120.563072),\n (174.692767, 120.563072, 171.122894, 120.563072),\n (171.122894, 112.803296, 171.122894, 113.045789),\n (171.122894, 113.045789, 171.122894, 113.288282),\n (171.122894, 113.288282, 171.122894, 113.530775),\n (171.122894, 113.530775, 171.122894, 113.773268),\n (171.122894, 113.773268, 171.122894, 114.015761),\n (171.122894, 114.015761, 171.122894, 114.258254),\n (171.122894, 114.258254, 171.122894, 114.500747),\n (171.122894, 114.500747, 171.122894, 114.74324),\n (171.122894, 114.74324, 171.122894, 114.985733),\n (171.122894, 114.985733, 171.122894, 115.228226),\n (171.122894, 115.228226, 171.122894, 115.470719),\n (171.122894, 115.470719, 171.122894, 115.713212),\n (171.122894, 115.713212, 171.122894, 115.955705),\n (171.122894, 115.955705, 171.122894, 116.198198),\n (171.122894, 116.198198, 171.122894, 116.440691),\n (171.122894, 116.440691, 171.122894, 116.683184),\n (171.122894, 116.683184, 171.122894, 116.925677),\n (171.122894, 116.925677, 171.122894, 117.16817),\n (171.122894, 117.16817, 171.122894, 117.410663),\n (171.122894, 117.410663, 171.122894, 117.653156),\n (171.122894, 117.653156, 171.122894, 117.895649),\n (171.122894, 117.895649, 171.122894, 118.138142),\n (171.122894, 118.138142, 171.122894, 118.380635),\n (171.122894, 118.380635, 171.122894, 118.623128),\n (171.122894, 118.623128, 171.122894, 118.865621),\n (171.122894, 118.865621, 171.122894, 119.108114),\n (171.122894, 119.108114, 171.122894, 119.350607),\n (171.122894, 119.350607, 171.122894, 119.5931),\n (171.122894, 119.5931, 171.122894, 119.835593),\n (171.122894, 119.835593, 171.122894, 120.078086),\n (171.122894, 120.078086, 171.122894, 120.320579),\n (171.122894, 120.320579, 171.122894, 120.563072),\n (171.122894, 120.563072, 171.122894, 170.447345),\n (174.692767, 120.563072, 174.692767, 170.447345),\n (171.122894, 173.150311, 174.692767, 173.150311),\n (171.122894, 80.620183, 174.692767, 80.620183),\n (174.692767, 170.447345, 171.122894, 170.447345),\n (174.692767, 82.318462, 171.122894, 82.318462)\n]\nVISIBLE_CIRCLES = [\n (117.769745, 117.237453, 3.325618),\n (151.025927, 167.121727, 3.325618),\n (151.025927, 86.75262, 3.325618)\n]\nVISIBLE_ARCS = [\n (151.07579, 167.103177, 6.047133, 0.175756, 146.425756),\n (150.874569, 86.869604, 6.249421, -133.260096, -1.072596),\n (117.833456, 117.325736, 6.00037, 147.348852, -131.088648),\n (2558.808214, 92.617048, 2385.429884, 178.065336, 178.130223),\n (-8595.993578, 3.730317, 8768.726758, 1.089415, 1.107074),\n (850.489226, 111.152689, 676.447881, -177.556841, -177.413134),\n (1328.276252, 91.789272, 1157.198936, -179.531069, -179.446986)\n]\nHIDDEN_SEGMENTS = [\n (113.8899, 63.0503, 113.8899, 66.6202),\n (121.0954, 63.0503, 121.0954, 66.6202),\n (154.3516, 63.0503, 154.3516, 66.6202),\n (114.4441, 66.6202, 114.4441, 63.0503),\n (147.7003, 66.6202, 147.7003, 63.0503),\n (174.6928, 86.7526, 171.1229, 86.7526),\n (171.1229, 113.9118, 174.6928, 113.9118),\n (171.1229, 163.7961, 174.6928, 163.7961),\n (171.1229, 83.427, 174.6928, 83.427),\n (171.1229, 90.0782, 174.6928, 90.0782)\n]\n# (orient, text, p1, p2, base) for linear; (orient, text, center, radius, angle) for diameter\nDIMENSIONS = [\n ('vertical', '100', (157.1229, 167.1217), (157.1229, 86.7526), (168.1229, 126.9372)),\n ('aligned', '55.6274', (146.5918, 82.3185), (113.8899, 112.8033), (122.7402, 89.5147)),\n ('aligned', '74.5976', (112.7813, 120.5631), (146.0375, 170.4474), (120.2569, 151.6069)),\n ('diameter', '%%c8.2759', (117.7698, 117.2375), 3.3256, 45),\n ('horizontal', '6.2069', (112.7813, 117.2375), (117.7698, 117.2375), (115.2755, 128.2375)),\n ('vertical', '66.2069', (117.7698, 170.4474), (117.7698, 117.2375), (128.7698, 143.8424)),\n ('diameter', '%%c8.2759', (151.0259, 167.1217), 3.3256, 45),\n ('horizontal', '47.5862', (112.7813, 167.1217), (151.0259, 167.1217), (131.9036, 178.1217)),\n ('vertical', '4.138', (151.0259, 170.4474), (151.0259, 167.1217), (162.0259, 168.7845)),\n ('diameter', '%%c8.2759', (151.0259, 86.7526), 3.3256, 45),\n ('horizontal', '47.5862', (112.7813, 86.7526), (151.0259, 86.7526), (131.9036, 97.7526)),\n ('vertical', '104.138', (151.0259, 170.4474), (151.0259, 86.7526), (162.0259, 128.6)),\n ('radius', 'R7.5242', (151.0758, 167.1031), 6.0471, 135),\n ('radius', 'R7.7759', (150.8746, 86.8696), 6.2494, 45),\n ('radius', 'R7.466', (117.8335, 117.3257), 6.0004, 135),\n ('horizontal', '4.4418', (174.6928, 170.4474), (171.1229, 170.4474), (172.9079, 159.4474))\n]\n\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; _ds.dxf.dimasz = 2.5\n _ds.dxf.dimexe = 1.25; _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\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\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,\n angle=(0 if d[0] == \"horizontal\" else 90),\n 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,\n 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,\n 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,\n text=text, dimstyle=\"EZDXF\").render()\n\n doc.saveas(out_path)\n\n\nif __name__ == \"__main__\":\n out = sys.argv[1] if len(sys.argv) > 1 else \"0090_00907131_gt.dxf\"\n draw(out)\n print(\"wrote\", out)\n```"}], "images": ["images/0090_00907131.png"], "id": "0090_00907131"} {"messages": [{"role": "user", "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 9 straight edges. It is extruded to a thickness of 27.1 mm. The outline includes one or more oblique (angled) edges."}, {"role": "assistant", "content": "```python\n#!/usr/bin/env python3\n# -*- coding: utf-8 -*-\n# Ground-truth 2D engineering drawing for part: 0091_00919167\n# Self-contained: reproduces the three-view DXF via ezdxf, NO FreeCAD needed.\n# Coordinates are A4 page millimetres (scale=1.048141671826627, page=[297.0, 210.0]).\n# visible edges -> solid (layer OUTLINE); hidden edges -> dashed (layer HIDDEN)\n# dimensions -> real movable DIMENSION entities (text = true mm value)\n# Run: python 0091_00919167_gt.py [out.dxf]\nimport sys\nimport ezdxf\nimport math\n\nSCALE = 1.048141671826627\nPAGE = [297.0, 210.0]\n\nVISIBLE_SEGMENTS = [\n (181.569842, 138.200094, 181.569842, 151.925759),\n (181.569842, 151.925759, 146.631787, 151.925759),\n (146.631787, 151.925759, 146.631787, 136.952307),\n (146.631787, 136.952307, 79.251251, 136.952307),\n (79.251251, 136.952307, 79.251251, 151.925759),\n (79.251251, 151.925759, 63.03001, 151.925759),\n (63.03001, 151.925759, 63.03001, 124.47443),\n (63.03001, 124.47443, 167.844178, 124.47443),\n (181.569842, 110.474429, 181.569842, 82.074261),\n (181.569842, 82.074261, 146.631787, 82.074261),\n (146.631787, 110.474429, 146.631787, 82.074261),\n (181.569842, 110.474429, 146.631787, 110.474429),\n (146.631787, 82.074261, 79.251251, 82.074261),\n (146.631787, 110.474429, 79.251251, 110.474429),\n (79.251251, 110.474429, 79.251251, 82.074261),\n (79.251251, 82.074261, 63.03001, 82.074261),\n (63.03001, 110.474429, 63.03001, 82.074261),\n (79.251251, 110.474429, 63.03001, 110.474429),\n (195.569842, 151.925759, 223.970011, 151.925759),\n (223.970011, 151.925759, 223.970011, 124.47443),\n (195.569842, 124.47443, 223.970011, 124.47443),\n (195.569842, 151.925759, 195.569842, 124.47443)\n]\nVISIBLE_CIRCLES = [\n\n]\nVISIBLE_ARCS = [\n (167.844178, 138.200094, 13.725665, -90.0, -0.0)\n]\nHIDDEN_SEGMENTS = [\n (195.5698, 136.9523, 223.97, 136.9523)\n]\n# (orient, text, p1, p2, base) for linear; (orient, text, center, radius, angle) for diameter\nDIMENSIONS = [\n ('horizontal', '15.4762', (79.2513, 151.9258), (63.03, 151.9258), (71.1406, 140.9258)),\n ('horizontal', '33.3333', (181.5698, 151.9258), (146.6318, 151.9258), (164.1008, 140.9258)),\n ('horizontal', '64.2857', (146.6318, 136.9523), (79.2513, 136.9523), (112.9415, 125.9523)),\n ('horizontal', '100', (63.03, 124.4744), (167.8442, 124.4744), (115.4371, 135.4744)),\n ('vertical', '13.0952', (181.5698, 138.2), (181.5698, 151.9258), (170.5698, 145.0629)),\n ('vertical', '14.2857', (146.6318, 151.9258), (146.6318, 136.9523), (157.6318, 144.4391)),\n ('vertical', '26.1905', (63.03, 151.9258), (63.03, 124.4744), (74.03, 138.2001)),\n ('radius', 'R13.0952', (167.8442, 138.2), 13.7256, 45),\n ('horizontal', '27.0957', (195.5698, 124.4744), (223.97, 124.4744), (209.7699, 135.4744))\n]\n\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; _ds.dxf.dimasz = 2.5\n _ds.dxf.dimexe = 1.25; _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\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\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,\n angle=(0 if d[0] == \"horizontal\" else 90),\n 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,\n 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,\n 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,\n text=text, dimstyle=\"EZDXF\").render()\n\n doc.saveas(out_path)\n\n\nif __name__ == \"__main__\":\n out = sys.argv[1] if len(sys.argv) > 1 else \"0091_00919167_gt.dxf\"\n draw(out)\n print(\"wrote\", out)\n```"}], "images": ["images/0091_00919167.png"], "id": "0091_00919167"} {"messages": [{"role": "user", "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 3 circular holes (diameters 29.63, 33.33 mm). It is extruded to a thickness of 2.9 mm. The outline includes one or more oblique (angled) edges."}, {"role": "assistant", "content": "```python\n#!/usr/bin/env python3\n# -*- coding: utf-8 -*-\n# Ground-truth 2D engineering drawing for part: 0092_00923679\n# Self-contained: reproduces the three-view DXF via ezdxf, NO FreeCAD needed.\n# Coordinates are A4 page millimetres (scale=0.7678972611087556, page=[297.0, 210.0]).\n# visible edges -> solid (layer OUTLINE); hidden edges -> dashed (layer HIDDEN)\n# dimensions -> real movable DIMENSION entities (text = true mm value)\n# Run: python 0092_00923679_gt.py [out.dxf]\nimport sys\nimport ezdxf\nimport math\n\nSCALE = 0.7678972611087556\nPAGE = [297.0, 210.0]\n\nVISIBLE_SEGMENTS = [\n (114.293927, 150.985563, 67.366872, 125.388988),\n (92.963448, 108.324604, 169.753174, 108.324604),\n (195.349749, 125.388988, 148.422694, 150.985563),\n (67.366872, 83.759011, 67.140255, 83.759011),\n (67.140255, 83.759011, 66.913638, 83.759011),\n (66.913638, 83.759011, 66.68702, 83.759011),\n (66.68702, 83.759011, 66.460403, 83.759011),\n (66.460403, 83.759011, 66.233786, 83.759011),\n (66.233786, 83.759011, 66.007168, 83.759011),\n (66.007168, 83.759011, 65.780551, 83.759011),\n (65.780551, 83.759011, 65.553934, 83.759011),\n (65.553934, 83.759011, 65.327317, 83.759011),\n (65.327317, 83.759011, 65.100699, 83.759011),\n (65.100699, 83.759011, 64.874082, 83.759011),\n (64.874082, 83.759011, 64.647465, 83.759011),\n (64.647465, 83.759011, 64.420847, 83.759011),\n (64.420847, 83.759011, 64.19423, 83.759011),\n (64.19423, 83.759011, 63.967613, 83.759011),\n (63.967613, 83.759011, 63.740996, 83.759011),\n (63.740996, 83.759011, 63.514378, 83.759011),\n (63.514378, 83.759011, 63.287761, 83.759011),\n (63.287761, 83.759011, 63.061144, 83.759011),\n (63.061144, 83.759011, 62.834526, 83.759011),\n (62.834526, 83.759011, 62.607909, 83.759011),\n (62.607909, 83.759011, 62.381292, 83.759011),\n (62.381292, 83.759011, 62.154675, 83.759011),\n (62.154675, 83.759011, 61.928057, 83.759011),\n (61.928057, 83.759011, 61.70144, 83.759011),\n (61.70144, 83.759011, 61.474823, 83.759011),\n (61.474823, 83.759011, 61.248205, 83.759011),\n (61.248205, 83.759011, 61.021588, 83.759011),\n (61.021588, 83.759011, 60.794971, 83.759011),\n (60.794971, 83.759011, 60.568354, 83.759011),\n (60.568354, 83.759011, 60.341736, 83.759011),\n (60.341736, 83.759011, 60.115119, 83.759011),\n (67.366872, 79.305394, 67.140255, 79.305394),\n (67.140255, 79.305394, 66.913638, 79.305394),\n (66.913638, 79.305394, 66.68702, 79.305394),\n (66.68702, 79.305394, 66.460403, 79.305394),\n (66.460403, 79.305394, 66.233786, 79.305394),\n (66.233786, 79.305394, 66.007168, 79.305394),\n (66.007168, 79.305394, 65.780551, 79.305394),\n (65.780551, 79.305394, 65.553934, 79.305394),\n (65.553934, 79.305394, 65.327317, 79.305394),\n (65.327317, 79.305394, 65.100699, 79.305394),\n (65.100699, 79.305394, 64.874082, 79.305394),\n (64.874082, 79.305394, 64.647465, 79.305394),\n (64.647465, 79.305394, 64.420847, 79.305394),\n (64.420847, 79.305394, 64.19423, 79.305394),\n (64.19423, 79.305394, 63.967613, 79.305394),\n (63.967613, 79.305394, 63.740996, 79.305394),\n (63.740996, 79.305394, 63.514378, 79.305394),\n (63.514378, 79.305394, 63.287761, 79.305394),\n (63.287761, 79.305394, 63.061144, 79.305394),\n (63.061144, 79.305394, 62.834526, 79.305394),\n (62.834526, 79.305394, 62.607909, 79.305394),\n (62.607909, 79.305394, 62.381292, 79.305394),\n (62.381292, 79.305394, 62.154675, 79.305394),\n (62.154675, 79.305394, 61.928057, 79.305394),\n (61.928057, 79.305394, 61.70144, 79.305394),\n (61.70144, 79.305394, 61.474823, 79.305394),\n (61.474823, 79.305394, 61.248205, 79.305394),\n (61.248205, 79.305394, 61.021588, 79.305394),\n (61.021588, 79.305394, 60.794971, 79.305394),\n (60.794971, 79.305394, 60.568354, 79.305394),\n (60.568354, 79.305394, 60.341736, 79.305394),\n (60.341736, 79.305394, 60.115119, 79.305394),\n (67.366872, 79.305394, 67.366872, 83.759011),\n (114.293927, 79.305394, 114.293927, 83.759011),\n (114.293927, 79.305394, 67.366872, 79.305394),\n (114.293927, 83.759011, 67.366872, 83.759011),\n (202.601502, 79.305394, 202.374885, 79.305394),\n (202.374885, 79.305394, 202.148268, 79.305394),\n (202.148268, 79.305394, 201.92165, 79.305394),\n (201.92165, 79.305394, 201.695033, 79.305394),\n (201.695033, 79.305394, 201.468416, 79.305394),\n (201.468416, 79.305394, 201.241799, 79.305394),\n (201.241799, 79.305394, 201.015181, 79.305394),\n (201.015181, 79.305394, 200.788564, 79.305394),\n (200.788564, 79.305394, 200.561947, 79.305394),\n (200.561947, 79.305394, 200.335329, 79.305394),\n (200.335329, 79.305394, 200.108712, 79.305394),\n (200.108712, 79.305394, 199.882095, 79.305394),\n (199.882095, 79.305394, 199.655478, 79.305394),\n (199.655478, 79.305394, 199.42886, 79.305394),\n (199.42886, 79.305394, 199.202243, 79.305394),\n (199.202243, 79.305394, 198.975626, 79.305394),\n (198.975626, 79.305394, 198.749008, 79.305394),\n (198.749008, 79.305394, 198.522391, 79.305394),\n (198.522391, 79.305394, 198.295774, 79.305394),\n (198.295774, 79.305394, 198.069157, 79.305394),\n (198.069157, 79.305394, 197.842539, 79.305394),\n (197.842539, 79.305394, 197.615922, 79.305394),\n (197.615922, 79.305394, 197.389305, 79.305394),\n (197.389305, 79.305394, 197.162687, 79.305394),\n (197.162687, 79.305394, 196.93607, 79.305394),\n (196.93607, 79.305394, 196.709453, 79.305394),\n (196.709453, 79.305394, 196.482836, 79.305394),\n (196.482836, 79.305394, 196.256218, 79.305394),\n (196.256218, 79.305394, 196.029601, 79.305394),\n (196.029601, 79.305394, 195.802984, 79.305394),\n (195.802984, 79.305394, 195.576366, 79.305394),\n (195.576366, 79.305394, 195.349749, 79.305394),\n (195.349749, 79.305394, 148.422694, 79.305394),\n (148.422694, 79.305394, 148.378256, 79.305394),\n (148.378256, 79.305394, 148.333817, 79.305394),\n (148.333817, 79.305394, 148.289379, 79.305394),\n (148.289379, 79.305394, 148.24494, 79.305394),\n (148.24494, 79.305394, 148.200502, 79.305394),\n (148.200502, 79.305394, 148.156063, 79.305394),\n (148.156063, 79.305394, 148.111625, 79.305394),\n (148.111625, 79.305394, 148.067186, 79.305394),\n (148.067186, 79.305394, 148.022748, 79.305394),\n (148.022748, 79.305394, 147.978309, 79.305394),\n (147.978309, 79.305394, 147.933871, 79.305394),\n (147.933871, 79.305394, 147.889432, 79.305394),\n (147.889432, 79.305394, 147.844994, 79.305394),\n (147.844994, 79.305394, 147.800555, 79.305394),\n (147.800555, 79.305394, 147.756117, 79.305394),\n (147.756117, 79.305394, 147.711678, 79.305394),\n (147.711678, 79.305394, 147.66724, 79.305394),\n (147.66724, 79.305394, 147.622801, 79.305394),\n (147.622801, 79.305394, 147.578363, 79.305394),\n (147.578363, 79.305394, 147.533924, 79.305394),\n (147.533924, 79.305394, 147.489486, 79.305394),\n (147.489486, 79.305394, 147.445047, 79.305394),\n (147.445047, 79.305394, 147.400609, 79.305394),\n (147.400609, 79.305394, 147.35617, 79.305394),\n (147.35617, 79.305394, 147.311732, 79.305394),\n (147.311732, 79.305394, 147.267293, 79.305394),\n (147.267293, 79.305394, 147.222855, 79.305394),\n (147.222855, 79.305394, 147.178416, 79.305394),\n (147.178416, 79.305394, 147.133978, 79.305394),\n (147.133978, 79.305394, 147.089539, 79.305394),\n (147.089539, 79.305394, 147.045101, 79.305394),\n (147.045101, 79.305394, 147.000662, 79.305394),\n (147.000662, 79.305394, 146.023015, 79.305394),\n (146.023015, 79.305394, 145.045368, 79.305394),\n (145.045368, 79.305394, 144.067721, 79.305394),\n (144.067721, 79.305394, 143.090074, 79.305394),\n (143.090074, 79.305394, 142.112427, 79.305394),\n (142.112427, 79.305394, 141.13478, 79.305394),\n (141.13478, 79.305394, 140.157133, 79.305394),\n (140.157133, 79.305394, 139.179486, 79.305394),\n (139.179486, 79.305394, 138.201839, 79.305394),\n (138.201839, 79.305394, 137.224193, 79.305394),\n (137.224193, 79.305394, 136.246546, 79.305394),\n (136.246546, 79.305394, 135.268899, 79.305394),\n (135.268899, 79.305394, 134.291252, 79.305394),\n (134.291252, 79.305394, 133.313605, 79.305394),\n (133.313605, 79.305394, 132.335958, 79.305394),\n (132.335958, 79.305394, 131.358311, 79.305394),\n (131.358311, 79.305394, 130.380664, 79.305394),\n (130.380664, 79.305394, 129.403017, 79.305394),\n (129.403017, 79.305394, 128.42537, 79.305394),\n (128.42537, 79.305394, 127.447723, 79.305394),\n (127.447723, 79.305394, 126.470076, 79.305394),\n (126.470076, 79.305394, 125.492429, 79.305394),\n (125.492429, 79.305394, 124.514782, 79.305394),\n (124.514782, 79.305394, 123.537135, 79.305394),\n (123.537135, 79.305394, 122.559488, 79.305394),\n (122.559488, 79.305394, 121.581841, 79.305394),\n (121.581841, 79.305394, 120.604194, 79.305394),\n (120.604194, 79.305394, 119.626547, 79.305394),\n (119.626547, 79.305394, 118.6489, 79.305394),\n (118.6489, 79.305394, 117.671253, 79.305394),\n (117.671253, 79.305394, 116.693606, 79.305394),\n (116.693606, 79.305394, 115.715959, 79.305394),\n (115.715959, 79.305394, 115.715959, 83.759011),\n (202.601502, 83.759011, 202.374885, 83.759011),\n (202.374885, 83.759011, 202.148268, 83.759011),\n (202.148268, 83.759011, 201.92165, 83.759011),\n (201.92165, 83.759011, 201.695033, 83.759011),\n (201.695033, 83.759011, 201.468416, 83.759011),\n (201.468416, 83.759011, 201.241799, 83.759011),\n (201.241799, 83.759011, 201.015181, 83.759011),\n (201.015181, 83.759011, 200.788564, 83.759011),\n (200.788564, 83.759011, 200.561947, 83.759011),\n (200.561947, 83.759011, 200.335329, 83.759011),\n (200.335329, 83.759011, 200.108712, 83.759011),\n (200.108712, 83.759011, 199.882095, 83.759011),\n (199.882095, 83.759011, 199.655478, 83.759011),\n (199.655478, 83.759011, 199.42886, 83.759011),\n (199.42886, 83.759011, 199.202243, 83.759011),\n (199.202243, 83.759011, 198.975626, 83.759011),\n (198.975626, 83.759011, 198.749008, 83.759011),\n (198.749008, 83.759011, 198.522391, 83.759011),\n (198.522391, 83.759011, 198.295774, 83.759011),\n (198.295774, 83.759011, 198.069157, 83.759011),\n (198.069157, 83.759011, 197.842539, 83.759011),\n (197.842539, 83.759011, 197.615922, 83.759011),\n (197.615922, 83.759011, 197.389305, 83.759011),\n (197.389305, 83.759011, 197.162687, 83.759011),\n (197.162687, 83.759011, 196.93607, 83.759011),\n (196.93607, 83.759011, 196.709453, 83.759011),\n (196.709453, 83.759011, 196.482836, 83.759011),\n (196.482836, 83.759011, 196.256218, 83.759011),\n (196.256218, 83.759011, 196.029601, 83.759011),\n (196.029601, 83.759011, 195.802984, 83.759011),\n (195.802984, 83.759011, 195.576366, 83.759011),\n (195.576366, 83.759011, 195.349749, 83.759011),\n (195.349749, 83.759011, 148.422694, 83.759011),\n (148.422694, 83.759011, 148.378256, 83.759011),\n (148.378256, 83.759011, 148.333817, 83.759011),\n (148.333817, 83.759011, 148.289379, 83.759011),\n (148.289379, 83.759011, 148.24494, 83.759011),\n (148.24494, 83.759011, 148.200502, 83.759011),\n (148.200502, 83.759011, 148.156063, 83.759011),\n (148.156063, 83.759011, 148.111625, 83.759011),\n (148.111625, 83.759011, 148.067186, 83.759011),\n (148.067186, 83.759011, 148.022748, 83.759011),\n (148.022748, 83.759011, 147.978309, 83.759011),\n (147.978309, 83.759011, 147.933871, 83.759011),\n (147.933871, 83.759011, 147.889432, 83.759011),\n (147.889432, 83.759011, 147.844994, 83.759011),\n (147.844994, 83.759011, 147.800555, 83.759011),\n (147.800555, 83.759011, 147.756117, 83.759011),\n (147.756117, 83.759011, 147.711678, 83.759011),\n (147.711678, 83.759011, 147.66724, 83.759011),\n (147.66724, 83.759011, 147.622801, 83.759011),\n (147.622801, 83.759011, 147.578363, 83.759011),\n (147.578363, 83.759011, 147.533924, 83.759011),\n (147.533924, 83.759011, 147.489486, 83.759011),\n (147.489486, 83.759011, 147.445047, 83.759011),\n (147.445047, 83.759011, 147.400609, 83.759011),\n (147.400609, 83.759011, 147.35617, 83.759011),\n (147.35617, 83.759011, 147.311732, 83.759011),\n (147.311732, 83.759011, 147.267293, 83.759011),\n (147.267293, 83.759011, 147.222855, 83.759011),\n (147.222855, 83.759011, 147.178416, 83.759011),\n (147.178416, 83.759011, 147.133978, 83.759011),\n (147.133978, 83.759011, 147.089539, 83.759011),\n (147.089539, 83.759011, 147.045101, 83.759011),\n (147.045101, 83.759011, 147.000662, 83.759011),\n (147.000662, 83.759011, 146.023015, 83.759011),\n (146.023015, 83.759011, 145.045368, 83.759011),\n (145.045368, 83.759011, 144.067721, 83.759011),\n (144.067721, 83.759011, 143.090074, 83.759011),\n (143.090074, 83.759011, 142.112427, 83.759011),\n (142.112427, 83.759011, 141.13478, 83.759011),\n (141.13478, 83.759011, 140.157133, 83.759011),\n (140.157133, 83.759011, 139.179486, 83.759011),\n (139.179486, 83.759011, 138.201839, 83.759011),\n (138.201839, 83.759011, 137.224193, 83.759011),\n (137.224193, 83.759011, 136.246546, 83.759011),\n (136.246546, 83.759011, 135.268899, 83.759011),\n (135.268899, 83.759011, 134.291252, 83.759011),\n (134.291252, 83.759011, 133.313605, 83.759011),\n (133.313605, 83.759011, 132.335958, 83.759011),\n (132.335958, 83.759011, 131.358311, 83.759011),\n (131.358311, 83.759011, 130.380664, 83.759011),\n (130.380664, 83.759011, 129.403017, 83.759011),\n (129.403017, 83.759011, 128.42537, 83.759011),\n (128.42537, 83.759011, 127.447723, 83.759011),\n (127.447723, 83.759011, 126.470076, 83.759011),\n (126.470076, 83.759011, 125.492429, 83.759011),\n (125.492429, 83.759011, 124.514782, 83.759011),\n (124.514782, 83.759011, 123.537135, 83.759011),\n (123.537135, 83.759011, 122.559488, 83.759011),\n (122.559488, 83.759011, 121.581841, 83.759011),\n (121.581841, 83.759011, 120.604194, 83.759011),\n (120.604194, 83.759011, 119.626547, 83.759011),\n (119.626547, 83.759011, 118.6489, 83.759011),\n (118.6489, 83.759011, 117.671253, 83.759011),\n (117.671253, 83.759011, 116.693606, 83.759011),\n (116.693606, 83.759011, 115.715959, 83.759011),\n (195.349749, 83.759011, 195.349749, 79.305394),\n (148.422694, 83.759011, 148.422694, 79.305394),\n (147.000662, 83.759011, 147.000662, 79.305394),\n (60.115119, 79.305394, 60.115119, 83.759011),\n (202.601502, 79.305394, 202.601502, 83.759011),\n (216.601503, 125.388988, 216.601503, 124.525551),\n (216.601503, 124.525551, 216.601503, 123.662114),\n (216.601503, 123.662114, 216.601503, 122.798678),\n (216.601503, 122.798678, 216.601503, 121.935241),\n (216.601503, 121.935241, 216.601503, 121.071804),\n (216.601503, 121.071804, 216.601503, 120.208367),\n (216.601503, 120.208367, 216.601503, 119.344931),\n (216.601503, 119.344931, 216.601503, 118.481494),\n (216.601503, 118.481494, 216.601503, 117.618057),\n (216.601503, 117.618057, 216.601503, 116.75462),\n (216.601503, 116.75462, 216.601503, 115.891183),\n (216.601503, 115.891183, 216.601503, 115.027747),\n (216.601503, 115.027747, 216.601503, 114.16431),\n (216.601503, 114.16431, 216.601503, 113.300873),\n (216.601503, 113.300873, 216.601503, 112.437436),\n (216.601503, 112.437436, 216.601503, 111.574),\n (216.601503, 111.574, 216.601503, 110.710563),\n (216.601503, 110.710563, 216.601503, 109.847126),\n (216.601503, 109.847126, 216.601503, 108.983689),\n (216.601503, 108.983689, 216.601503, 108.120253),\n (216.601503, 108.120253, 216.601503, 107.256816),\n (216.601503, 107.256816, 216.601503, 106.393379),\n (216.601503, 106.393379, 216.601503, 105.529942),\n (216.601503, 105.529942, 216.601503, 104.666505),\n (216.601503, 104.666505, 216.601503, 103.803069),\n (216.601503, 103.803069, 216.601503, 102.939632),\n (216.601503, 102.939632, 216.601503, 102.076195),\n (216.601503, 102.076195, 216.601503, 101.212758),\n (216.601503, 101.212758, 216.601503, 100.349322),\n (216.601503, 100.349322, 216.601503, 99.485885),\n (216.601503, 99.485885, 216.601503, 98.622448),\n (216.601503, 98.622448, 216.601503, 97.759011),\n (221.055119, 125.388988, 221.055119, 124.525551),\n (221.055119, 124.525551, 221.055119, 123.662114),\n (221.055119, 123.662114, 221.055119, 122.798678),\n (221.055119, 122.798678, 221.055119, 121.935241),\n (221.055119, 121.935241, 221.055119, 121.071804),\n (221.055119, 121.071804, 221.055119, 120.208367),\n (221.055119, 120.208367, 221.055119, 119.344931),\n (221.055119, 119.344931, 221.055119, 118.481494),\n (221.055119, 118.481494, 221.055119, 117.618057),\n (221.055119, 117.618057, 221.055119, 116.75462),\n (221.055119, 116.75462, 221.055119, 115.891183),\n (221.055119, 115.891183, 221.055119, 115.027747),\n (221.055119, 115.027747, 221.055119, 114.16431),\n (221.055119, 114.16431, 221.055119, 113.300873),\n (221.055119, 113.300873, 221.055119, 112.437436),\n (221.055119, 112.437436, 221.055119, 111.574),\n (221.055119, 111.574, 221.055119, 110.710563),\n (221.055119, 110.710563, 221.055119, 109.847126),\n (221.055119, 109.847126, 221.055119, 108.983689),\n (221.055119, 108.983689, 221.055119, 108.120253),\n (221.055119, 108.120253, 221.055119, 107.256816),\n (221.055119, 107.256816, 221.055119, 106.393379),\n (221.055119, 106.393379, 221.055119, 105.529942),\n (221.055119, 105.529942, 221.055119, 104.666505),\n (221.055119, 104.666505, 221.055119, 103.803069),\n (221.055119, 103.803069, 221.055119, 102.939632),\n (221.055119, 102.939632, 221.055119, 102.076195),\n (221.055119, 102.076195, 221.055119, 101.212758),\n (221.055119, 101.212758, 221.055119, 100.349322),\n (221.055119, 100.349322, 221.055119, 99.485885),\n (221.055119, 99.485885, 221.055119, 98.622448),\n (221.055119, 98.622448, 221.055119, 97.759011),\n (221.055119, 125.388988, 216.601503, 125.388988),\n (221.055119, 150.985563, 216.601503, 150.985563),\n (221.055119, 150.985563, 221.055119, 125.388988),\n (216.601503, 150.985563, 216.601503, 125.388988),\n (221.055119, 164.703243, 221.055119, 164.363442),\n (221.055119, 164.363442, 221.055119, 164.023642),\n (221.055119, 164.023642, 221.055119, 163.683841),\n (221.055119, 163.683841, 221.055119, 163.344041),\n (221.055119, 163.344041, 221.055119, 163.00424),\n (221.055119, 163.00424, 221.055119, 162.66444),\n (221.055119, 162.66444, 221.055119, 162.324639),\n (221.055119, 162.324639, 221.055119, 161.984839),\n (221.055119, 161.984839, 221.055119, 161.645038),\n (221.055119, 161.645038, 221.055119, 161.305238),\n (221.055119, 161.305238, 221.055119, 160.965438),\n (221.055119, 160.965438, 221.055119, 160.625637),\n (221.055119, 160.625637, 221.055119, 160.285837),\n (221.055119, 160.285837, 221.055119, 159.946036),\n (221.055119, 159.946036, 221.055119, 159.606236),\n (221.055119, 159.606236, 221.055119, 159.266435),\n (221.055119, 159.266435, 221.055119, 158.926635),\n (221.055119, 158.926635, 221.055119, 158.586834),\n (221.055119, 158.586834, 221.055119, 158.247034),\n (221.055119, 158.247034, 221.055119, 157.907233),\n (221.055119, 157.907233, 221.055119, 157.567433),\n (221.055119, 157.567433, 221.055119, 157.227632),\n (221.055119, 157.227632, 221.055119, 156.887832),\n (221.055119, 156.887832, 221.055119, 156.548031),\n (221.055119, 156.548031, 221.055119, 156.208231),\n (221.055119, 156.208231, 221.055119, 155.86843),\n (221.055119, 155.86843, 221.055119, 155.52863),\n (221.055119, 155.52863, 221.055119, 155.188829),\n (221.055119, 155.188829, 221.055119, 154.849029),\n (221.055119, 154.849029, 221.055119, 154.509228),\n (221.055119, 154.509228, 221.055119, 154.169428),\n (221.055119, 154.169428, 221.055119, 153.829627),\n (221.055119, 153.829627, 221.055119, 153.74075),\n (221.055119, 153.74075, 221.055119, 153.651873),\n (221.055119, 153.651873, 221.055119, 153.562996),\n (221.055119, 153.562996, 221.055119, 153.474119),\n (221.055119, 153.474119, 221.055119, 153.385242),\n (221.055119, 153.385242, 221.055119, 153.296365),\n (221.055119, 153.296365, 221.055119, 153.207488),\n (221.055119, 153.207488, 221.055119, 153.118611),\n (221.055119, 153.118611, 221.055119, 153.029734),\n (221.055119, 153.029734, 221.055119, 152.940857),\n (221.055119, 152.940857, 221.055119, 152.85198),\n (221.055119, 152.85198, 221.055119, 152.763103),\n (221.055119, 152.763103, 221.055119, 152.674226),\n (221.055119, 152.674226, 221.055119, 152.585349),\n (221.055119, 152.585349, 221.055119, 152.496472),\n (221.055119, 152.496472, 221.055119, 152.407595),\n (221.055119, 152.407595, 221.055119, 152.318718),\n (221.055119, 152.318718, 221.055119, 152.229841),\n (221.055119, 152.229841, 221.055119, 152.140964),\n (221.055119, 152.140964, 221.055119, 152.052087),\n (221.055119, 152.052087, 221.055119, 151.96321),\n (221.055119, 151.96321, 221.055119, 151.874333),\n (221.055119, 151.874333, 221.055119, 151.785456),\n (221.055119, 151.785456, 221.055119, 151.696579),\n (221.055119, 151.696579, 221.055119, 151.607702),\n (221.055119, 151.607702, 221.055119, 151.518825),\n (221.055119, 151.518825, 221.055119, 151.429948),\n (221.055119, 151.429948, 221.055119, 151.341071),\n (221.055119, 151.341071, 221.055119, 151.252194),\n (221.055119, 151.252194, 221.055119, 151.163317),\n (221.055119, 151.163317, 221.055119, 151.07444),\n (221.055119, 151.07444, 221.055119, 150.985563),\n (216.601503, 153.829627, 216.601503, 153.74075),\n (216.601503, 153.74075, 216.601503, 153.651873),\n (216.601503, 153.651873, 216.601503, 153.562996),\n (216.601503, 153.562996, 216.601503, 153.474119),\n (216.601503, 153.474119, 216.601503, 153.385242),\n (216.601503, 153.385242, 216.601503, 153.296365),\n (216.601503, 153.296365, 216.601503, 153.207488),\n (216.601503, 153.207488, 216.601503, 153.118611),\n (216.601503, 153.118611, 216.601503, 153.029734),\n (216.601503, 153.029734, 216.601503, 152.940857),\n (216.601503, 152.940857, 216.601503, 152.85198),\n (216.601503, 152.85198, 216.601503, 152.763103),\n (216.601503, 152.763103, 216.601503, 152.674226),\n (216.601503, 152.674226, 216.601503, 152.585349),\n (216.601503, 152.585349, 216.601503, 152.496472),\n (216.601503, 152.496472, 216.601503, 152.407595),\n (216.601503, 152.407595, 216.601503, 152.318718),\n (216.601503, 152.318718, 216.601503, 152.229841),\n (216.601503, 152.229841, 216.601503, 152.140964),\n (216.601503, 152.140964, 216.601503, 152.052087),\n (216.601503, 152.052087, 216.601503, 151.96321),\n (216.601503, 151.96321, 216.601503, 151.874333),\n (216.601503, 151.874333, 216.601503, 151.785456),\n (216.601503, 151.785456, 216.601503, 151.696579),\n (216.601503, 151.696579, 216.601503, 151.607702),\n (216.601503, 151.607702, 216.601503, 151.518825),\n (216.601503, 151.518825, 216.601503, 151.429948),\n (216.601503, 151.429948, 216.601503, 151.341071),\n (216.601503, 151.341071, 216.601503, 151.252194),\n (216.601503, 151.252194, 216.601503, 151.163317),\n (216.601503, 151.163317, 216.601503, 151.07444),\n (216.601503, 151.07444, 216.601503, 150.985563),\n (221.055119, 153.829627, 216.601503, 153.829627),\n (216.601503, 164.703243, 216.601503, 164.363442),\n (216.601503, 164.363442, 216.601503, 164.023642),\n (216.601503, 164.023642, 216.601503, 163.683841),\n (216.601503, 163.683841, 216.601503, 163.344041),\n (216.601503, 163.344041, 216.601503, 163.00424),\n (216.601503, 163.00424, 216.601503, 162.66444),\n (216.601503, 162.66444, 216.601503, 162.324639),\n (216.601503, 162.324639, 216.601503, 161.984839),\n (216.601503, 161.984839, 216.601503, 161.645038),\n (216.601503, 161.645038, 216.601503, 161.305238),\n (216.601503, 161.305238, 216.601503, 160.965438),\n (216.601503, 160.965438, 216.601503, 160.625637),\n (216.601503, 160.625637, 216.601503, 160.285837),\n (216.601503, 160.285837, 216.601503, 159.946036),\n (216.601503, 159.946036, 216.601503, 159.606236),\n (216.601503, 159.606236, 216.601503, 159.266435),\n (216.601503, 159.266435, 216.601503, 158.926635),\n (216.601503, 158.926635, 216.601503, 158.586834),\n (216.601503, 158.586834, 216.601503, 158.247034),\n (216.601503, 158.247034, 216.601503, 157.907233),\n (216.601503, 157.907233, 216.601503, 157.567433),\n (216.601503, 157.567433, 216.601503, 157.227632),\n (216.601503, 157.227632, 216.601503, 156.887832),\n (216.601503, 156.887832, 216.601503, 156.548031),\n (216.601503, 156.548031, 216.601503, 156.208231),\n (216.601503, 156.208231, 216.601503, 155.86843),\n (216.601503, 155.86843, 216.601503, 155.52863),\n (216.601503, 155.52863, 216.601503, 155.188829),\n (216.601503, 155.188829, 216.601503, 154.849029),\n (216.601503, 154.849029, 216.601503, 154.509228),\n (216.601503, 154.509228, 216.601503, 154.169428),\n (216.601503, 154.169428, 216.601503, 153.829627),\n (221.055119, 97.759011, 216.601503, 97.759011),\n (221.055119, 164.703243, 216.601503, 164.703243)\n]\nVISIBLE_CIRCLES = [\n (74.477032, 112.5907, 11.376256),\n (131.358311, 148.141499, 12.798288),\n (186.817557, 112.5907, 11.376256)\n]\nVISIBLE_ARCS = [\n (74.978569, 112.622461, 14.86345, 120.804367, -22.633133),\n (91.92331, 104.334858, 4.123101, 75.388074, 141.481824),\n (170.793312, 104.334858, 4.123101, 38.518176, 104.611926),\n (187.738053, 112.622461, 14.86345, -157.366867, 59.195633),\n (151.685991, 154.394752, 4.719287, -173.122449, -133.747449),\n (131.358311, 148.015202, 16.688041, 20.390625, 159.609375),\n (118.979256, 150.420439, 4.719287, 133.747449, 173.122449),\n (116.220845, 119.662429, 40.377894, -92.733612, -90.716761),\n (116.220845, 43.401977, 40.377894, 90.716761, 92.733612)\n]\nHIDDEN_SEGMENTS = [\n (88.6974, 83.759, 88.6974, 79.3054),\n (92.9635, 83.759, 92.9635, 79.3054),\n (169.7532, 83.759, 169.7532, 79.3054),\n (174.0193, 83.759, 174.0193, 79.3054),\n (85.8533, 79.3054, 85.8533, 83.759),\n (144.1566, 79.3054, 144.1566, 83.759),\n (198.1938, 79.3054, 198.1938, 83.759),\n (63.1008, 79.3054, 63.1008, 83.759),\n (118.56, 79.3054, 118.56, 83.759),\n (175.4413, 79.3054, 175.4413, 83.759),\n (216.6015, 106.9025, 221.0551, 106.9025),\n (216.6015, 108.3246, 221.0551, 108.3246),\n (221.0551, 108.4579, 216.6015, 108.4579),\n (221.0551, 123.9669, 216.6015, 123.9669),\n (221.0551, 101.2144, 216.6015, 101.2144),\n (221.0551, 160.9398, 216.6015, 160.9398),\n (221.0551, 135.3432, 216.6015, 135.3432)\n]\n# (orient, text, p1, p2, base) for linear; (orient, text, center, radius, angle) for diameter\nDIMENSIONS = [\n ('horizontal', '40.7407', (147.0007, 153.8296), (115.716, 153.8296), (131.3583, 142.8296)),\n ('horizontal', '100', (92.9635, 108.3246), (169.7532, 108.3246), (131.3583, 119.3246)),\n ('aligned', '69.6109', (195.3497, 125.389), (148.4227, 150.9855), (166.6189, 128.5304)),\n ('aligned', '69.6109', (114.294, 150.9855), (67.3669, 125.389), (96.0978, 128.5304)),\n ('diameter', '%%c29.6296', (74.477, 112.5907), 11.3762, 45),\n ('horizontal', '9.2592', (67.3669, 112.5907), (74.477, 112.5907), (70.922, 123.5907)),\n ('vertical', '7.4074', (74.477, 106.9025), (74.477, 112.5907), (63.477, 109.7466)),\n ('diameter', '%%c33.3333', (131.3583, 148.1415), 12.7983, 45),\n ('horizontal', '83.3333', (67.3669, 148.1415), (131.3583, 148.1415), (99.3626, 159.1415)),\n ('vertical', '53.7037', (131.3583, 106.9025), (131.3583, 148.1415), (120.3583, 127.522)),\n ('diameter', '%%c29.6296', (186.8176, 112.5907), 11.3762, 45),\n ('horizontal', '155.555', (67.3669, 112.5907), (186.8176, 112.5907), (127.0922, 123.5907)),\n ('vertical', '7.4074', (186.8176, 106.9025), (186.8176, 112.5907), (175.8176, 109.7466)),\n ('radius', 'R19.356', (74.9786, 112.6224), 14.8634, 135),\n ('radius', 'R5.3693', (91.9234, 104.3348), 4.1231, 45),\n ('radius', 'R6.1457', (151.686, 154.3948), 4.7193, 45),\n ('radius', 'R21.7321', (131.3583, 148.0152), 16.688, 135),\n ('horizontal', '5.7998', (216.6015, 125.389), (221.0552, 125.389), (218.8283, 136.389))\n]\n\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; _ds.dxf.dimasz = 2.5\n _ds.dxf.dimexe = 1.25; _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\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\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,\n angle=(0 if d[0] == \"horizontal\" else 90),\n 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,\n 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,\n 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,\n text=text, dimstyle=\"EZDXF\").render()\n\n doc.saveas(out_path)\n\n\nif __name__ == \"__main__\":\n out = sys.argv[1] if len(sys.argv) > 1 else \"0092_00923679_gt.dxf\"\n draw(out)\n print(\"wrote\", out)\n```"}], "images": ["images/0092_00923679.png"], "id": "0092_00923679"} {"messages": [{"role": "user", "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 1371.43 mm."}, {"role": "assistant", "content": "```python\n#!/usr/bin/env python3\n# -*- coding: utf-8 -*-\n# Ground-truth 2D engineering drawing for part: 0093_00930295\n# Self-contained: reproduces the three-view DXF via ezdxf, NO FreeCAD needed.\n# Coordinates are A4 page millimetres (scale=0.10337487437182738, page=[297.0, 210.0]).\n# visible edges -> solid (layer OUTLINE); hidden edges -> dashed (layer HIDDEN)\n# dimensions -> real movable DIMENSION entities (text = true mm value)\n# Run: python 0093_00930295_gt.py [out.dxf]\nimport sys\nimport ezdxf\nimport math\n\nSCALE = 0.10337487437182738\nPAGE = [297.0, 210.0]\n\nVISIBLE_SEGMENTS = [\n (68.606802, 193.593442, 70.783115, 193.593442),\n (60.445628, 193.593442, 62.621941, 193.593442),\n (70.783115, 179.593442, 70.783115, 37.822186),\n (70.783115, 179.593442, 60.445628, 179.593442),\n (60.445628, 179.593442, 60.445628, 37.822186),\n (70.783115, 37.822186, 60.445628, 37.822186),\n (84.783116, 198.762186, 84.783116, 193.593442),\n (84.783116, 193.593442, 226.554372, 193.593442),\n (226.554372, 198.762186, 226.554372, 193.593442),\n (226.554372, 198.762186, 84.783116, 198.762186)\n]\nVISIBLE_CIRCLES = [\n\n]\nVISIBLE_ARCS = [\n (65.614372, 193.593442, 2.992431, 0.0, -180.0),\n (65.614372, 193.593442, 5.168744, -0.0, 180.0)\n]\nHIDDEN_SEGMENTS = [\n (62.6219, 179.5934, 62.6219, 37.8222),\n (68.6068, 179.5934, 68.6068, 37.8222),\n (226.5544, 196.5859, 84.7831, 196.5859)\n]\n# (orient, text, p1, p2, base) for linear; (orient, text, center, radius, angle) for diameter\nDIMENSIONS = [\n ('horizontal', '100', (70.7831, 193.5934), (60.4456, 193.5934), (65.6144, 182.5934)),\n ('radius', 'R28.9474', (65.6144, 193.5934), 2.9924, 45),\n ('radius', 'R50', (65.6144, 193.5934), 5.1687, 135),\n ('horizontal', '1371.43', (84.7831, 193.5934), (226.5544, 193.5934), (155.6687, 204.5934))\n]\n\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; _ds.dxf.dimasz = 2.5\n _ds.dxf.dimexe = 1.25; _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\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\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,\n angle=(0 if d[0] == \"horizontal\" else 90),\n 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,\n 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,\n 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,\n text=text, dimstyle=\"EZDXF\").render()\n\n doc.saveas(out_path)\n\n\nif __name__ == \"__main__\":\n out = sys.argv[1] if len(sys.argv) > 1 else \"0093_00930295_gt.dxf\"\n draw(out)\n print(\"wrote\", out)\n```"}], "images": ["images/0093_00930295.png"], "id": "0093_00930295"} {"messages": [{"role": "user", "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 64.46 mm. It is extruded to a thickness of 5.09 mm. The outline includes one or more oblique (angled) edges."}, {"role": "assistant", "content": "```python\n#!/usr/bin/env python3\n# -*- coding: utf-8 -*-\n# Ground-truth 2D engineering drawing for part: 0093_00934670\n# Self-contained: reproduces the three-view DXF via ezdxf, NO FreeCAD needed.\n# Coordinates are A4 page millimetres (scale=0.37455634193449483, page=[297.0, 210.0]).\n# visible edges -> solid (layer OUTLINE); hidden edges -> dashed (layer HIDDEN)\n# dimensions -> real movable DIMENSION entities (text = true mm value)\n# Run: python 0093_00934670_gt.py [out.dxf]\nimport sys\nimport ezdxf\nimport math\n\nSCALE = 0.37455634193449483\nPAGE = [297.0, 210.0]\n\nVISIBLE_SEGMENTS = [\n (89.039915, 80.237816, 120.863726, 99.990526),\n (147.200674, 99.990526, 179.024485, 80.237816),\n (184.511349, 90.114171, 151.590165, 107.672136),\n (139.519064, 130.716965, 139.519064, 168.02764),\n (128.545336, 168.02764, 129.642709, 130.716965),\n (116.474235, 107.672136, 83.553051, 90.114171),\n (83.553051, 65.457872, 83.458408, 65.457872),\n (83.458408, 65.457872, 83.363766, 65.457872),\n (83.363766, 65.457872, 83.269123, 65.457872),\n (83.269123, 65.457872, 83.17448, 65.457872),\n (83.17448, 65.457872, 83.079837, 65.457872),\n (83.079837, 65.457872, 82.985195, 65.457872),\n (82.985195, 65.457872, 82.890552, 65.457872),\n (82.890552, 65.457872, 82.795909, 65.457872),\n (82.795909, 65.457872, 82.701266, 65.457872),\n (82.701266, 65.457872, 82.606624, 65.457872),\n (82.606624, 65.457872, 82.511981, 65.457872),\n (82.511981, 65.457872, 82.417338, 65.457872),\n (82.417338, 65.457872, 82.322696, 65.457872),\n (82.322696, 65.457872, 82.228053, 65.457872),\n (82.228053, 65.457872, 82.13341, 65.457872),\n (82.13341, 65.457872, 82.038767, 65.457872),\n (82.038767, 65.457872, 81.944125, 65.457872),\n (81.944125, 65.457872, 81.849482, 65.457872),\n (81.849482, 65.457872, 81.754839, 65.457872),\n (81.754839, 65.457872, 81.660196, 65.457872),\n (81.660196, 65.457872, 81.565554, 65.457872),\n (81.565554, 65.457872, 81.470911, 65.457872),\n (81.470911, 65.457872, 81.376268, 65.457872),\n (81.376268, 65.457872, 81.281625, 65.457872),\n (81.281625, 65.457872, 81.186983, 65.457872),\n (81.186983, 65.457872, 81.09234, 65.457872),\n (81.09234, 65.457872, 80.997697, 65.457872),\n (80.997697, 65.457872, 80.903054, 65.457872),\n (80.903054, 65.457872, 80.808412, 65.457872),\n (80.808412, 65.457872, 80.713769, 65.457872),\n (80.713769, 65.457872, 80.619126, 65.457872),\n (80.619126, 65.457872, 80.524483, 65.457872),\n (83.553051, 63.550852, 83.458408, 63.550852),\n (83.458408, 63.550852, 83.363766, 63.550852),\n (83.363766, 63.550852, 83.269123, 63.550852),\n (83.269123, 63.550852, 83.17448, 63.550852),\n (83.17448, 63.550852, 83.079837, 63.550852),\n (83.079837, 63.550852, 82.985195, 63.550852),\n (82.985195, 63.550852, 82.890552, 63.550852),\n (82.890552, 63.550852, 82.795909, 63.550852),\n (82.795909, 63.550852, 82.701266, 63.550852),\n (82.701266, 63.550852, 82.606624, 63.550852),\n (82.606624, 63.550852, 82.511981, 63.550852),\n (82.511981, 63.550852, 82.417338, 63.550852),\n (82.417338, 63.550852, 82.322696, 63.550852),\n (82.322696, 63.550852, 82.228053, 63.550852),\n (82.228053, 63.550852, 82.13341, 63.550852),\n (82.13341, 63.550852, 82.038767, 63.550852),\n (82.038767, 63.550852, 81.944125, 63.550852),\n (81.944125, 63.550852, 81.849482, 63.550852),\n (81.849482, 63.550852, 81.754839, 63.550852),\n (81.754839, 63.550852, 81.660196, 63.550852),\n (81.660196, 63.550852, 81.565554, 63.550852),\n (81.565554, 63.550852, 81.470911, 63.550852),\n (81.470911, 63.550852, 81.376268, 63.550852),\n (81.376268, 63.550852, 81.281625, 63.550852),\n (81.281625, 63.550852, 81.186983, 63.550852),\n (81.186983, 63.550852, 81.09234, 63.550852),\n (81.09234, 63.550852, 80.997697, 63.550852),\n (80.997697, 63.550852, 80.903054, 63.550852),\n (80.903054, 63.550852, 80.808412, 63.550852),\n (80.808412, 63.550852, 80.713769, 63.550852),\n (80.713769, 63.550852, 80.619126, 63.550852),\n (80.619126, 63.550852, 80.524483, 63.550852),\n (184.511349, 63.550852, 152.371153, 63.550852),\n (184.511349, 65.457872, 152.371153, 65.457872),\n (152.371153, 65.457872, 151.969577, 65.457872),\n (151.969577, 65.457872, 151.568001, 65.457872),\n (151.568001, 65.457872, 151.166424, 65.457872),\n (151.166424, 65.457872, 150.764848, 65.457872),\n (150.764848, 65.457872, 150.363272, 65.457872),\n (150.363272, 65.457872, 149.961696, 65.457872),\n (149.961696, 65.457872, 149.56012, 65.457872),\n (149.56012, 65.457872, 149.158544, 65.457872),\n (149.158544, 65.457872, 148.756968, 65.457872),\n (148.756968, 65.457872, 148.355392, 65.457872),\n (148.355392, 65.457872, 147.953815, 65.457872),\n (147.953815, 65.457872, 147.552239, 65.457872),\n (147.552239, 65.457872, 147.150663, 65.457872),\n (147.150663, 65.457872, 146.749087, 65.457872),\n (146.749087, 65.457872, 146.347511, 65.457872),\n (146.347511, 65.457872, 145.945935, 65.457872),\n (145.945935, 65.457872, 145.544359, 65.457872),\n (145.544359, 65.457872, 145.142783, 65.457872),\n (145.142783, 65.457872, 144.741207, 65.457872),\n (144.741207, 65.457872, 144.33963, 65.457872),\n (144.33963, 65.457872, 143.938054, 65.457872),\n (143.938054, 65.457872, 143.536478, 65.457872),\n (143.536478, 65.457872, 143.134902, 65.457872),\n (143.134902, 65.457872, 142.733326, 65.457872),\n (142.733326, 65.457872, 142.33175, 65.457872),\n (142.33175, 65.457872, 141.930174, 65.457872),\n (141.930174, 65.457872, 141.528598, 65.457872),\n (141.528598, 65.457872, 141.127022, 65.457872),\n (141.127022, 65.457872, 140.725445, 65.457872),\n (140.725445, 65.457872, 140.323869, 65.457872),\n (140.323869, 65.457872, 139.922293, 65.457872),\n (139.922293, 65.457872, 139.520717, 65.457872),\n (152.371153, 63.550852, 151.969577, 63.550852),\n (151.969577, 63.550852, 151.568001, 63.550852),\n (151.568001, 63.550852, 151.166424, 63.550852),\n (151.166424, 63.550852, 150.764848, 63.550852),\n (150.764848, 63.550852, 150.363272, 63.550852),\n (150.363272, 63.550852, 149.961696, 63.550852),\n (149.961696, 63.550852, 149.56012, 63.550852),\n (149.56012, 63.550852, 149.158544, 63.550852),\n (149.158544, 63.550852, 148.756968, 63.550852),\n (148.756968, 63.550852, 148.355392, 63.550852),\n (148.355392, 63.550852, 147.953815, 63.550852),\n (147.953815, 63.550852, 147.552239, 63.550852),\n (147.552239, 63.550852, 147.150663, 63.550852),\n (147.150663, 63.550852, 146.749087, 63.550852),\n (146.749087, 63.550852, 146.347511, 63.550852),\n (146.347511, 63.550852, 145.945935, 63.550852),\n (145.945935, 63.550852, 145.544359, 63.550852),\n (145.544359, 63.550852, 145.142783, 63.550852),\n (145.142783, 63.550852, 144.741207, 63.550852),\n (144.741207, 63.550852, 144.33963, 63.550852),\n (144.33963, 63.550852, 143.938054, 63.550852),\n (143.938054, 63.550852, 143.536478, 63.550852),\n (143.536478, 63.550852, 143.134902, 63.550852),\n (143.134902, 63.550852, 142.733326, 63.550852),\n (142.733326, 63.550852, 142.33175, 63.550852),\n (142.33175, 63.550852, 141.930174, 63.550852),\n (141.930174, 63.550852, 141.528598, 63.550852),\n (141.528598, 63.550852, 141.127022, 63.550852),\n (141.127022, 63.550852, 140.725445, 63.550852),\n (140.725445, 63.550852, 140.323869, 63.550852),\n (140.323869, 63.550852, 139.922293, 63.550852),\n (139.922293, 63.550852, 139.520717, 63.550852),\n (139.520717, 65.457872, 139.177685, 65.457872),\n (139.177685, 65.457872, 138.834652, 65.457872),\n (138.834652, 65.457872, 138.49162, 65.457872),\n (138.49162, 65.457872, 138.148588, 65.457872),\n (138.148588, 65.457872, 137.805555, 65.457872),\n (137.805555, 65.457872, 137.462523, 65.457872),\n (137.462523, 65.457872, 137.119491, 65.457872),\n (137.119491, 65.457872, 136.776459, 65.457872),\n (136.776459, 65.457872, 136.433426, 65.457872),\n (136.433426, 65.457872, 136.090394, 65.457872),\n (136.090394, 65.457872, 135.747362, 65.457872),\n (135.747362, 65.457872, 135.404329, 65.457872),\n (135.404329, 65.457872, 135.061297, 65.457872),\n (135.061297, 65.457872, 134.718265, 65.457872),\n (134.718265, 65.457872, 134.375232, 65.457872),\n (134.375232, 65.457872, 134.0322, 65.457872),\n (134.0322, 65.457872, 133.689168, 65.457872),\n (133.689168, 65.457872, 133.346135, 65.457872),\n (133.346135, 65.457872, 133.003103, 65.457872),\n (133.003103, 65.457872, 132.660071, 65.457872),\n (132.660071, 65.457872, 132.317038, 65.457872),\n (132.317038, 65.457872, 131.974006, 65.457872),\n (131.974006, 65.457872, 131.630974, 65.457872),\n (131.630974, 65.457872, 131.287941, 65.457872),\n (131.287941, 65.457872, 130.944909, 65.457872),\n (130.944909, 65.457872, 130.601877, 65.457872),\n (130.601877, 65.457872, 130.258845, 65.457872),\n (130.258845, 65.457872, 129.915812, 65.457872),\n (129.915812, 65.457872, 129.57278, 65.457872),\n (129.57278, 65.457872, 129.229748, 65.457872),\n (129.229748, 65.457872, 128.886715, 65.457872),\n (128.886715, 65.457872, 128.543683, 65.457872),\n (139.520717, 63.550852, 139.177685, 63.550852),\n (139.177685, 63.550852, 138.834652, 63.550852),\n (138.834652, 63.550852, 138.49162, 63.550852),\n (138.49162, 63.550852, 138.148588, 63.550852),\n (138.148588, 63.550852, 137.805555, 63.550852),\n (137.805555, 63.550852, 137.462523, 63.550852),\n (137.462523, 63.550852, 137.119491, 63.550852),\n (137.119491, 63.550852, 136.776459, 63.550852),\n (136.776459, 63.550852, 136.433426, 63.550852),\n (136.433426, 63.550852, 136.090394, 63.550852),\n (136.090394, 63.550852, 135.747362, 63.550852),\n (135.747362, 63.550852, 135.404329, 63.550852),\n (135.404329, 63.550852, 135.061297, 63.550852),\n (135.061297, 63.550852, 134.718265, 63.550852),\n (134.718265, 63.550852, 134.375232, 63.550852),\n (134.375232, 63.550852, 134.0322, 63.550852),\n (134.0322, 63.550852, 133.689168, 63.550852),\n (133.689168, 63.550852, 133.346135, 63.550852),\n (133.346135, 63.550852, 133.003103, 63.550852),\n (133.003103, 63.550852, 132.660071, 63.550852),\n (132.660071, 63.550852, 132.317038, 63.550852),\n (132.317038, 63.550852, 131.974006, 63.550852),\n (131.974006, 63.550852, 131.630974, 63.550852),\n (131.630974, 63.550852, 131.287941, 63.550852),\n (131.287941, 63.550852, 130.944909, 63.550852),\n (130.944909, 63.550852, 130.601877, 63.550852),\n (130.601877, 63.550852, 130.258845, 63.550852),\n (130.258845, 63.550852, 129.915812, 63.550852),\n (129.915812, 63.550852, 129.57278, 63.550852),\n (129.57278, 63.550852, 129.229748, 63.550852),\n (129.229748, 63.550852, 128.886715, 63.550852),\n (128.886715, 63.550852, 128.543683, 63.550852),\n (128.543683, 65.457872, 128.147463, 65.457872),\n (128.147463, 65.457872, 127.751242, 65.457872),\n (127.751242, 65.457872, 127.355022, 65.457872),\n (127.355022, 65.457872, 126.958802, 65.457872),\n (126.958802, 65.457872, 126.562581, 65.457872),\n (126.562581, 65.457872, 126.166361, 65.457872),\n (126.166361, 65.457872, 125.770141, 65.457872),\n (125.770141, 65.457872, 125.37392, 65.457872),\n (125.37392, 65.457872, 124.9777, 65.457872),\n (124.9777, 65.457872, 124.58148, 65.457872),\n (124.58148, 65.457872, 124.185259, 65.457872),\n (124.185259, 65.457872, 123.789039, 65.457872),\n (123.789039, 65.457872, 123.392819, 65.457872),\n (123.392819, 65.457872, 122.996599, 65.457872),\n (122.996599, 65.457872, 122.600378, 65.457872),\n (122.600378, 65.457872, 122.204158, 65.457872),\n (122.204158, 65.457872, 121.807938, 65.457872),\n (121.807938, 65.457872, 121.411717, 65.457872),\n (121.411717, 65.457872, 121.015497, 65.457872),\n (121.015497, 65.457872, 120.619277, 65.457872),\n (120.619277, 65.457872, 120.223056, 65.457872),\n (120.223056, 65.457872, 119.826836, 65.457872),\n (119.826836, 65.457872, 119.430616, 65.457872),\n (119.430616, 65.457872, 119.034395, 65.457872),\n (119.034395, 65.457872, 118.638175, 65.457872),\n (118.638175, 65.457872, 118.241955, 65.457872),\n (118.241955, 65.457872, 117.845734, 65.457872),\n (117.845734, 65.457872, 117.449514, 65.457872),\n (117.449514, 65.457872, 117.053294, 65.457872),\n (117.053294, 65.457872, 116.657073, 65.457872),\n (116.657073, 65.457872, 116.260853, 65.457872),\n (116.260853, 65.457872, 115.864633, 65.457872),\n (128.543683, 63.550852, 128.147463, 63.550852),\n (128.147463, 63.550852, 127.751242, 63.550852),\n (127.751242, 63.550852, 127.355022, 63.550852),\n (127.355022, 63.550852, 126.958802, 63.550852),\n (126.958802, 63.550852, 126.562581, 63.550852),\n (126.562581, 63.550852, 126.166361, 63.550852),\n (126.166361, 63.550852, 125.770141, 63.550852),\n (125.770141, 63.550852, 125.37392, 63.550852),\n (125.37392, 63.550852, 124.9777, 63.550852),\n (124.9777, 63.550852, 124.58148, 63.550852),\n (124.58148, 63.550852, 124.185259, 63.550852),\n (124.185259, 63.550852, 123.789039, 63.550852),\n (123.789039, 63.550852, 123.392819, 63.550852),\n (123.392819, 63.550852, 122.996599, 63.550852),\n (122.996599, 63.550852, 122.600378, 63.550852),\n (122.600378, 63.550852, 122.204158, 63.550852),\n (122.204158, 63.550852, 121.807938, 63.550852),\n (121.807938, 63.550852, 121.411717, 63.550852),\n (121.411717, 63.550852, 121.015497, 63.550852),\n (121.015497, 63.550852, 120.619277, 63.550852),\n (120.619277, 63.550852, 120.223056, 63.550852),\n (120.223056, 63.550852, 119.826836, 63.550852),\n (119.826836, 63.550852, 119.430616, 63.550852),\n (119.430616, 63.550852, 119.034395, 63.550852),\n (119.034395, 63.550852, 118.638175, 63.550852),\n (118.638175, 63.550852, 118.241955, 63.550852),\n (118.241955, 63.550852, 117.845734, 63.550852),\n (117.845734, 63.550852, 117.449514, 63.550852),\n (117.449514, 63.550852, 117.053294, 63.550852),\n (117.053294, 63.550852, 116.657073, 63.550852),\n (116.657073, 63.550852, 116.260853, 63.550852),\n (116.260853, 63.550852, 115.864633, 63.550852),\n (115.864633, 63.550852, 83.553051, 63.550852),\n (115.864633, 65.457872, 83.553051, 65.457872),\n (80.524483, 63.550852, 80.524483, 65.457872),\n (187.539917, 63.550852, 187.539917, 65.457872),\n (152.371153, 63.550852, 152.371153, 65.457872),\n (139.520717, 63.550852, 139.520717, 65.457872),\n (128.543683, 63.550852, 128.543683, 65.457872),\n (115.864633, 63.550852, 115.864633, 65.457872),\n (83.553051, 65.457872, 83.553051, 63.550852),\n (184.511349, 65.457872, 184.511349, 63.550852),\n (201.539917, 90.114171, 201.539917, 89.781162),\n (201.539917, 89.781162, 201.539917, 89.448152),\n (201.539917, 89.448152, 201.539917, 89.115143),\n (201.539917, 89.115143, 201.539917, 88.782134),\n (201.539917, 88.782134, 201.539917, 88.449124),\n (201.539917, 88.449124, 201.539917, 88.116115),\n (201.539917, 88.116115, 201.539917, 87.783106),\n (201.539917, 87.783106, 201.539917, 87.450096),\n (201.539917, 87.450096, 201.539917, 87.117087),\n (201.539917, 87.117087, 201.539917, 86.784078),\n (201.539917, 86.784078, 201.539917, 86.451068),\n (201.539917, 86.451068, 201.539917, 86.118059),\n (201.539917, 86.118059, 201.539917, 85.78505),\n (201.539917, 85.78505, 201.539917, 85.45204),\n (201.539917, 85.45204, 201.539917, 85.119031),\n (201.539917, 85.119031, 201.539917, 84.786022),\n (201.539917, 84.786022, 201.539917, 84.453012),\n (201.539917, 84.453012, 201.539917, 84.120003),\n (201.539917, 84.120003, 201.539917, 83.786993),\n (201.539917, 83.786993, 201.539917, 83.453984),\n (201.539917, 83.453984, 201.539917, 83.120975),\n (201.539917, 83.120975, 201.539917, 82.787965),\n (201.539917, 82.787965, 201.539917, 82.454956),\n (201.539917, 82.454956, 201.539917, 82.121947),\n (201.539917, 82.121947, 201.539917, 81.788937),\n (201.539917, 81.788937, 201.539917, 81.455928),\n (201.539917, 81.455928, 201.539917, 81.122919),\n (201.539917, 81.122919, 201.539917, 80.789909),\n (201.539917, 80.789909, 201.539917, 80.4569),\n (201.539917, 80.4569, 201.539917, 80.123891),\n (201.539917, 80.123891, 201.539917, 79.790881),\n (201.539917, 79.790881, 201.539917, 79.457872),\n (203.446937, 90.114171, 203.446937, 89.781162),\n (203.446937, 89.781162, 203.446937, 89.448152),\n (203.446937, 89.448152, 203.446937, 89.115143),\n (203.446937, 89.115143, 203.446937, 88.782134),\n (203.446937, 88.782134, 203.446937, 88.449124),\n (203.446937, 88.449124, 203.446937, 88.116115),\n (203.446937, 88.116115, 203.446937, 87.783106),\n (203.446937, 87.783106, 203.446937, 87.450096),\n (203.446937, 87.450096, 203.446937, 87.117087),\n (203.446937, 87.117087, 203.446937, 86.784078),\n (203.446937, 86.784078, 203.446937, 86.451068),\n (203.446937, 86.451068, 203.446937, 86.118059),\n (203.446937, 86.118059, 203.446937, 85.78505),\n (203.446937, 85.78505, 203.446937, 85.45204),\n (203.446937, 85.45204, 203.446937, 85.119031),\n (203.446937, 85.119031, 203.446937, 84.786022),\n (203.446937, 84.786022, 203.446937, 84.453012),\n (203.446937, 84.453012, 203.446937, 84.120003),\n (203.446937, 84.120003, 203.446937, 83.786993),\n (203.446937, 83.786993, 203.446937, 83.453984),\n (203.446937, 83.453984, 203.446937, 83.120975),\n (203.446937, 83.120975, 203.446937, 82.787965),\n (203.446937, 82.787965, 203.446937, 82.454956),\n (203.446937, 82.454956, 203.446937, 82.121947),\n (203.446937, 82.121947, 203.446937, 81.788937),\n (203.446937, 81.788937, 203.446937, 81.455928),\n (203.446937, 81.455928, 203.446937, 81.122919),\n (203.446937, 81.122919, 203.446937, 80.789909),\n (203.446937, 80.789909, 203.446937, 80.4569),\n (203.446937, 80.4569, 203.446937, 80.123891),\n (203.446937, 80.123891, 203.446937, 79.790881),\n (203.446937, 79.790881, 203.446937, 79.457872),\n (201.539917, 173.650852, 201.539917, 173.475127),\n (201.539917, 173.475127, 201.539917, 173.299401),\n (201.539917, 173.299401, 201.539917, 173.123676),\n (201.539917, 173.123676, 201.539917, 172.947951),\n (201.539917, 172.947951, 201.539917, 172.772225),\n (201.539917, 172.772225, 201.539917, 172.5965),\n (201.539917, 172.5965, 201.539917, 172.420774),\n (201.539917, 172.420774, 201.539917, 172.245049),\n (201.539917, 172.245049, 201.539917, 172.069324),\n (201.539917, 172.069324, 201.539917, 171.893598),\n (201.539917, 171.893598, 201.539917, 171.717873),\n (201.539917, 171.717873, 201.539917, 171.542148),\n (201.539917, 171.542148, 201.539917, 171.366422),\n (201.539917, 171.366422, 201.539917, 171.190697),\n (201.539917, 171.190697, 201.539917, 171.014971),\n (201.539917, 171.014971, 201.539917, 170.839246),\n (201.539917, 170.839246, 201.539917, 170.663521),\n (201.539917, 170.663521, 201.539917, 170.487795),\n (201.539917, 170.487795, 201.539917, 170.31207),\n (201.539917, 170.31207, 201.539917, 170.136345),\n (201.539917, 170.136345, 201.539917, 169.960619),\n (201.539917, 169.960619, 201.539917, 169.784894),\n (201.539917, 169.784894, 201.539917, 169.609168),\n (201.539917, 169.609168, 201.539917, 169.433443),\n (201.539917, 169.433443, 201.539917, 169.257718),\n (201.539917, 169.257718, 201.539917, 169.081992),\n (201.539917, 169.081992, 201.539917, 168.906267),\n (201.539917, 168.906267, 201.539917, 168.730542),\n (201.539917, 168.730542, 201.539917, 168.554816),\n (201.539917, 168.554816, 201.539917, 168.379091),\n (201.539917, 168.379091, 201.539917, 168.203365),\n (201.539917, 168.203365, 201.539917, 168.02764),\n (203.446937, 173.650852, 203.446937, 173.475127),\n (203.446937, 173.475127, 203.446937, 173.299401),\n (203.446937, 173.299401, 203.446937, 173.123676),\n (203.446937, 173.123676, 203.446937, 172.947951),\n (203.446937, 172.947951, 203.446937, 172.772225),\n (203.446937, 172.772225, 203.446937, 172.5965),\n (203.446937, 172.5965, 203.446937, 172.420774),\n (203.446937, 172.420774, 203.446937, 172.245049),\n (203.446937, 172.245049, 203.446937, 172.069324),\n (203.446937, 172.069324, 203.446937, 171.893598),\n (203.446937, 171.893598, 203.446937, 171.717873),\n (203.446937, 171.717873, 203.446937, 171.542148),\n (203.446937, 171.542148, 203.446937, 171.366422),\n (203.446937, 171.366422, 203.446937, 171.190697),\n (203.446937, 171.190697, 203.446937, 171.014971),\n (203.446937, 171.014971, 203.446937, 170.839246),\n (203.446937, 170.839246, 203.446937, 170.663521),\n (203.446937, 170.663521, 203.446937, 170.487795),\n (203.446937, 170.487795, 203.446937, 170.31207),\n (203.446937, 170.31207, 203.446937, 170.136345),\n (203.446937, 170.136345, 203.446937, 169.960619),\n (203.446937, 169.960619, 203.446937, 169.784894),\n (203.446937, 169.784894, 203.446937, 169.609168),\n (203.446937, 169.609168, 203.446937, 169.433443),\n (203.446937, 169.433443, 203.446937, 169.257718),\n (203.446937, 169.257718, 203.446937, 169.081992),\n (203.446937, 169.081992, 203.446937, 168.906267),\n (203.446937, 168.906267, 203.446937, 168.730542),\n (203.446937, 168.730542, 203.446937, 168.554816),\n (203.446937, 168.554816, 203.446937, 168.379091),\n (203.446937, 168.379091, 203.446937, 168.203365),\n (203.446937, 168.203365, 203.446937, 168.02764),\n (203.446937, 168.02764, 203.446937, 130.716965),\n (201.539917, 130.716965, 203.446937, 130.716965),\n (201.539917, 168.02764, 201.539917, 130.716965),\n (201.539917, 130.716965, 201.539917, 129.996814),\n (201.539917, 129.996814, 201.539917, 129.276663),\n (201.539917, 129.276663, 201.539917, 128.556512),\n (201.539917, 128.556512, 201.539917, 127.836361),\n (201.539917, 127.836361, 201.539917, 127.11621),\n (201.539917, 127.11621, 201.539917, 126.396059),\n (201.539917, 126.396059, 201.539917, 125.675909),\n (201.539917, 125.675909, 201.539917, 124.955758),\n (201.539917, 124.955758, 201.539917, 124.235607),\n (201.539917, 124.235607, 201.539917, 123.515456),\n (201.539917, 123.515456, 201.539917, 122.795305),\n (201.539917, 122.795305, 201.539917, 122.075154),\n (201.539917, 122.075154, 201.539917, 121.355003),\n (201.539917, 121.355003, 201.539917, 120.634852),\n (201.539917, 120.634852, 201.539917, 119.914701),\n (201.539917, 119.914701, 201.539917, 119.19455),\n (201.539917, 119.19455, 201.539917, 118.4744),\n (201.539917, 118.4744, 201.539917, 117.754249),\n (201.539917, 117.754249, 201.539917, 117.034098),\n (201.539917, 117.034098, 201.539917, 116.313947),\n (201.539917, 116.313947, 201.539917, 115.593796),\n (201.539917, 115.593796, 201.539917, 114.873645),\n (201.539917, 114.873645, 201.539917, 114.153494),\n (201.539917, 114.153494, 201.539917, 113.433343),\n (201.539917, 113.433343, 201.539917, 112.713192),\n (201.539917, 112.713192, 201.539917, 111.993041),\n (201.539917, 111.993041, 201.539917, 111.27289),\n (201.539917, 111.27289, 201.539917, 110.55274),\n (201.539917, 110.55274, 201.539917, 109.832589),\n (201.539917, 109.832589, 201.539917, 109.112438),\n (201.539917, 109.112438, 201.539917, 108.392287),\n (201.539917, 108.392287, 201.539917, 107.672136),\n (201.539917, 107.672136, 203.446937, 107.672136),\n (203.446937, 130.716965, 203.446937, 129.996814),\n (203.446937, 129.996814, 203.446937, 129.276663),\n (203.446937, 129.276663, 203.446937, 128.556512),\n (203.446937, 128.556512, 203.446937, 127.836361),\n (203.446937, 127.836361, 203.446937, 127.11621),\n (203.446937, 127.11621, 203.446937, 126.396059),\n (203.446937, 126.396059, 203.446937, 125.675909),\n (203.446937, 125.675909, 203.446937, 124.955758),\n (203.446937, 124.955758, 203.446937, 124.235607),\n (203.446937, 124.235607, 203.446937, 123.515456),\n (203.446937, 123.515456, 203.446937, 122.795305),\n (203.446937, 122.795305, 203.446937, 122.075154),\n (203.446937, 122.075154, 203.446937, 121.355003),\n (203.446937, 121.355003, 203.446937, 120.634852),\n (203.446937, 120.634852, 203.446937, 119.914701),\n (203.446937, 119.914701, 203.446937, 119.19455),\n (203.446937, 119.19455, 203.446937, 118.4744),\n (203.446937, 118.4744, 203.446937, 117.754249),\n (203.446937, 117.754249, 203.446937, 117.034098),\n (203.446937, 117.034098, 203.446937, 116.313947),\n (203.446937, 116.313947, 203.446937, 115.593796),\n (203.446937, 115.593796, 203.446937, 114.873645),\n (203.446937, 114.873645, 203.446937, 114.153494),\n (203.446937, 114.153494, 203.446937, 113.433343),\n (203.446937, 113.433343, 203.446937, 112.713192),\n (203.446937, 112.713192, 203.446937, 111.993041),\n (203.446937, 111.993041, 203.446937, 111.27289),\n (203.446937, 111.27289, 203.446937, 110.55274),\n (203.446937, 110.55274, 203.446937, 109.832589),\n (203.446937, 109.832589, 203.446937, 109.112438),\n (203.446937, 109.112438, 203.446937, 108.392287),\n (203.446937, 108.392287, 203.446937, 107.672136),\n (203.446937, 107.672136, 203.446937, 90.114171),\n (201.539917, 107.672136, 201.539917, 90.114171),\n (203.446937, 79.457872, 201.539917, 79.457872),\n (203.446937, 173.650852, 201.539917, 173.650852),\n (201.539917, 90.114171, 203.446937, 90.114171),\n (201.539917, 168.02764, 203.446937, 168.02764)\n]\nVISIBLE_CIRCLES = [\n (134.0322, 113.159, 12.071101)\n]\nVISIBLE_ARCS = [\n (86.175258, 85.108646, 5.650774, 117.648354, -59.539146),\n (134.0322, 113.486235, 18.855844, -134.296875, -45.703125),\n (181.889142, 85.108646, 5.650774, -120.460854, 62.351646),\n (133.745869, 113.009017, 18.625284, -16.6509, 71.94285),\n (134.0322, 168.162335, 5.488517, -1.40625, -178.59375),\n (134.867217, 112.446696, 19.002584, 105.958244, -165.448006),\n (97.690943, -2751.362541, 2818.205782, 88.173039, 88.234581),\n (163.207741, -3700.380799, 3764.001017, 89.629613, 89.675713)\n]\nHIDDEN_SEGMENTS = [\n (89.0399, 65.4578, 89.0399, 63.5508),\n (120.8637, 65.4578, 120.8637, 63.5508),\n (147.2007, 65.4578, 147.2007, 63.5508),\n (179.0245, 65.4578, 179.0245, 63.5508),\n (151.5902, 65.4578, 151.5902, 63.5508),\n (129.6427, 65.4578, 129.6427, 63.5508),\n (116.4742, 65.4578, 116.4742, 63.5508),\n (146.1033, 65.4578, 146.1033, 63.5508),\n (121.9611, 63.5508, 121.9611, 65.4578),\n (201.5399, 80.2378, 203.4469, 80.2378),\n (201.5399, 99.9905, 203.4469, 99.9905),\n (203.4469, 94.6303, 201.5399, 94.6303),\n (203.4469, 125.23, 201.5399, 125.23),\n (203.4469, 101.0878, 201.5399, 101.0878)\n]\n# (orient, text, p1, p2, base) for linear; (orient, text, center, radius, angle) for diameter\nDIMENSIONS = [\n ('horizontal', '29.2979', (139.5191, 168.0276), (128.5453, 168.0276), (134.0322, 157.0276)),\n ('horizontal', '70.315', (120.8637, 99.9905), (147.2007, 99.9905), (134.0322, 110.9905)),\n ('vertical', '99.613', (139.5191, 130.7169), (139.5191, 168.0276), (128.5191, 149.3722)),\n ('aligned', '100', (89.0399, 80.2377), (120.8637, 99.9905), (99.1508, 99.4601)),\n ('aligned', '100', (147.2007, 99.9905), (179.0245, 80.2377), (168.9136, 99.4601)),\n ('aligned', '99.613', (184.5114, 90.1141), (151.5902, 107.6721), (162.8743, 89.1872)),\n ('aligned', '99.6561', (128.5453, 168.0276), (129.6427, 130.7169), (140.0893, 149.6956)),\n ('aligned', '99.613', (116.4742, 107.6721), (83.5531, 90.1141), (105.1901, 89.1872)),\n ('diameter', '%%c64.4555', (134.0322, 113.159), 12.0711, 45),\n ('horizontal', '134.77', (83.5531, 113.159), (134.0322, 113.159), (108.7926, 124.159)),\n ('vertical', '87.8939', (134.0322, 80.2377), (134.0322, 113.159), (123.0322, 96.6983)),\n ('radius', 'R15.0866', (86.1753, 85.1086), 5.6508, 45),\n ('radius', 'R50.3418', (134.0322, 113.4862), 18.8558, 135),\n ('radius', 'R49.7263', (133.7459, 113.0089), 18.6253, 225),\n ('radius', 'R14.6534', (134.0322, 168.1623), 5.4885, 45),\n ('radius', 'R50.7336', (134.8672, 112.4466), 19.0026, 45),\n ('horizontal', '5.0914', (201.5399, 90.1141), (203.4469, 90.1141), (202.4934, 101.1141))\n]\n\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; _ds.dxf.dimasz = 2.5\n _ds.dxf.dimexe = 1.25; _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\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\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,\n angle=(0 if d[0] == \"horizontal\" else 90),\n 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,\n 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,\n 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,\n text=text, dimstyle=\"EZDXF\").render()\n\n doc.saveas(out_path)\n\n\nif __name__ == \"__main__\":\n out = sys.argv[1] if len(sys.argv) > 1 else \"0093_00934670_gt.dxf\"\n draw(out)\n print(\"wrote\", out)\n```"}], "images": ["images/0093_00934670.png"], "id": "0093_00934670"} {"messages": [{"role": "user", "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 47.92 mm. The outline includes one or more oblique (angled) edges."}, {"role": "assistant", "content": "```python\n#!/usr/bin/env python3\n# -*- coding: utf-8 -*-\n# Ground-truth 2D engineering drawing for part: 0093_00939675\n# Self-contained: reproduces the three-view DXF via ezdxf, NO FreeCAD needed.\n# Coordinates are A4 page millimetres (scale=0.9658717214018725, page=[297.0, 210.0]).\n# visible edges -> solid (layer OUTLINE); hidden edges -> dashed (layer HIDDEN)\n# dimensions -> real movable DIMENSION entities (text = true mm value)\n# Run: python 0093_00939675_gt.py [out.dxf]\nimport sys\nimport ezdxf\nimport math\n\nSCALE = 0.9658717214018725\nPAGE = [297.0, 210.0]\n\nVISIBLE_SEGMENTS = [\n (161.6529, 172.050009, 161.6529, 122.231362),\n (161.6529, 122.231362, 76.249506, 122.231362),\n (65.065728, 133.41514, 65.065728, 172.050009),\n (65.065728, 172.050009, 161.6529, 172.050009),\n (161.6529, 61.950009, 161.6529, 108.231362),\n (65.065728, 61.950009, 65.065728, 108.231362),\n (65.065728, 108.231362, 161.6529, 108.231362),\n (65.065728, 61.950009, 161.6529, 61.950009),\n (221.934254, 122.231362, 175.6529, 122.231362),\n (221.934254, 122.231362, 221.934254, 122.580855),\n (221.934254, 122.580855, 221.934254, 122.930349),\n (221.934254, 122.930349, 221.934254, 123.279842),\n (221.934254, 123.279842, 221.934254, 123.629335),\n (221.934254, 123.629335, 221.934254, 123.978828),\n (221.934254, 123.978828, 221.934254, 124.328321),\n (221.934254, 124.328321, 221.934254, 124.677814),\n (221.934254, 124.677814, 221.934254, 125.027307),\n (221.934254, 125.027307, 221.934254, 125.3768),\n (221.934254, 125.3768, 221.934254, 125.726293),\n (221.934254, 125.726293, 221.934254, 126.075786),\n (221.934254, 126.075786, 221.934254, 126.425279),\n (221.934254, 126.425279, 221.934254, 126.774772),\n (221.934254, 126.774772, 221.934254, 127.124265),\n (221.934254, 127.124265, 221.934254, 127.473758),\n (221.934254, 127.473758, 221.934254, 127.823251),\n (221.934254, 127.823251, 221.934254, 128.172744),\n (221.934254, 128.172744, 221.934254, 128.522237),\n (221.934254, 128.522237, 221.934254, 128.87173),\n (221.934254, 128.87173, 221.934254, 129.221224),\n (221.934254, 129.221224, 221.934254, 129.570717),\n (221.934254, 129.570717, 221.934254, 129.92021),\n (221.934254, 129.92021, 221.934254, 130.269703),\n (221.934254, 130.269703, 221.934254, 130.619196),\n (221.934254, 130.619196, 221.934254, 130.968689),\n (221.934254, 130.968689, 221.934254, 131.318182),\n (221.934254, 131.318182, 221.934254, 131.667675),\n (221.934254, 131.667675, 221.934254, 132.017168),\n (221.934254, 132.017168, 221.934254, 132.366661),\n (221.934254, 132.366661, 221.934254, 132.716154),\n (221.934254, 132.716154, 221.934254, 133.065647),\n (221.934254, 133.065647, 221.934254, 133.41514),\n (175.6529, 122.231362, 175.6529, 122.580855),\n (175.6529, 122.580855, 175.6529, 122.930349),\n (175.6529, 122.930349, 175.6529, 123.279842),\n (175.6529, 123.279842, 175.6529, 123.629335),\n (175.6529, 123.629335, 175.6529, 123.978828),\n (175.6529, 123.978828, 175.6529, 124.328321),\n (175.6529, 124.328321, 175.6529, 124.677814),\n (175.6529, 124.677814, 175.6529, 125.027307),\n (175.6529, 125.027307, 175.6529, 125.3768),\n (175.6529, 125.3768, 175.6529, 125.726293),\n (175.6529, 125.726293, 175.6529, 126.075786),\n (175.6529, 126.075786, 175.6529, 126.425279),\n (175.6529, 126.425279, 175.6529, 126.774772),\n (175.6529, 126.774772, 175.6529, 127.124265),\n (175.6529, 127.124265, 175.6529, 127.473758),\n (175.6529, 127.473758, 175.6529, 127.823251),\n (175.6529, 127.823251, 175.6529, 128.172744),\n (175.6529, 128.172744, 175.6529, 128.522237),\n (175.6529, 128.522237, 175.6529, 128.87173),\n (175.6529, 128.87173, 175.6529, 129.221224),\n (175.6529, 129.221224, 175.6529, 129.570717),\n (175.6529, 129.570717, 175.6529, 129.92021),\n (175.6529, 129.92021, 175.6529, 130.269703),\n (175.6529, 130.269703, 175.6529, 130.619196),\n (175.6529, 130.619196, 175.6529, 130.968689),\n (175.6529, 130.968689, 175.6529, 131.318182),\n (175.6529, 131.318182, 175.6529, 131.667675),\n (175.6529, 131.667675, 175.6529, 132.017168),\n (175.6529, 132.017168, 175.6529, 132.366661),\n (175.6529, 132.366661, 175.6529, 132.716154),\n (175.6529, 132.716154, 175.6529, 133.065647),\n (175.6529, 133.065647, 175.6529, 133.41514),\n (175.6529, 133.41514, 175.6529, 172.050009),\n (221.934254, 172.050009, 175.6529, 172.050009),\n (221.934254, 133.41514, 221.934254, 172.050009),\n (221.934254, 133.41514, 175.6529, 133.41514)\n]\nVISIBLE_CIRCLES = [\n\n]\nVISIBLE_ARCS = [\n (76.249506, 133.41514, 11.183778, -180.0, -90.0)\n]\nHIDDEN_SEGMENTS = [\n\n]\n# (orient, text, p1, p2, base) for linear; (orient, text, center, radius, angle) for diameter\nDIMENSIONS = [\n ('horizontal', '88.4211', (161.6529, 122.2314), (76.2495, 122.2314), (118.9512, 111.2314)),\n ('horizontal', '100', (65.0657, 172.05), (161.6529, 172.05), (113.3593, 183.05)),\n ('vertical', '40', (65.0657, 133.4151), (65.0657, 172.05), (54.0657, 152.7326)),\n ('vertical', '51.5789', (161.6529, 172.05), (161.6529, 122.2314), (172.6529, 147.1407)),\n ('radius', 'R11.5789', (76.2495, 133.4151), 11.1837, 45),\n ('horizontal', '47.9167', (221.9343, 172.05), (175.6529, 172.05), (198.7936, 161.05))\n]\n\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; _ds.dxf.dimasz = 2.5\n _ds.dxf.dimexe = 1.25; _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\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\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,\n angle=(0 if d[0] == \"horizontal\" else 90),\n 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,\n 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,\n 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,\n text=text, dimstyle=\"EZDXF\").render()\n\n doc.saveas(out_path)\n\n\nif __name__ == \"__main__\":\n out = sys.argv[1] if len(sys.argv) > 1 else \"0093_00939675_gt.dxf\"\n draw(out)\n print(\"wrote\", out)\n```"}], "images": ["images/0093_00939675.png"], "id": "0093_00939675"} {"messages": [{"role": "user", "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, featuring 4 circular holes, each of diameter 1.96 mm. It is extruded to a thickness of 1.66 mm. The outline includes one or more oblique (angled) edges."}, {"role": "assistant", "content": "```python\n#!/usr/bin/env python3\n# -*- coding: utf-8 -*-\n# Ground-truth 2D engineering drawing for part: 0094_00944237\n# Self-contained: reproduces the three-view DXF via ezdxf, NO FreeCAD needed.\n# Coordinates are A4 page millimetres (scale=0.8753135989751205, page=[297.0, 210.0]).\n# visible edges -> solid (layer OUTLINE); hidden edges -> dashed (layer HIDDEN)\n# dimensions -> real movable DIMENSION entities (text = true mm value)\n# Run: python 0094_00944237_gt.py [out.dxf]\nimport sys\nimport ezdxf\nimport math\n\nSCALE = 0.8753135989751205\nPAGE = [297.0, 210.0]\n\nVISIBLE_SEGMENTS = [\n (95.12518, 111.779661, 140.686054, 157.340535),\n (141.545694, 157.340535, 175.07162, 157.340535),\n (175.931259, 154.761618, 114.037241, 92.8676),\n (111.458324, 92.8676, 95.12518, 109.200743),\n (140.686054, 76.883801, 140.686054, 78.333488),\n (95.12518, 76.883801, 140.686054, 76.883801),\n (140.686054, 78.333488, 95.12518, 78.333488),\n (141.545694, 76.883801, 141.545694, 78.333488),\n (140.686054, 78.333488, 140.712918, 78.333488),\n (140.712918, 78.333488, 140.739782, 78.333488),\n (140.739782, 78.333488, 140.766646, 78.333488),\n (140.766646, 78.333488, 140.793509, 78.333488),\n (140.793509, 78.333488, 140.820373, 78.333488),\n (140.820373, 78.333488, 140.847237, 78.333488),\n (140.847237, 78.333488, 140.874101, 78.333488),\n (140.874101, 78.333488, 140.900964, 78.333488),\n (140.900964, 78.333488, 140.927828, 78.333488),\n (140.927828, 78.333488, 140.954692, 78.333488),\n (140.954692, 78.333488, 140.981555, 78.333488),\n (140.981555, 78.333488, 141.008419, 78.333488),\n (141.008419, 78.333488, 141.035283, 78.333488),\n (141.035283, 78.333488, 141.062147, 78.333488),\n (141.062147, 78.333488, 141.08901, 78.333488),\n (141.08901, 78.333488, 141.115874, 78.333488),\n (141.115874, 78.333488, 141.142738, 78.333488),\n (141.142738, 78.333488, 141.169601, 78.333488),\n (141.169601, 78.333488, 141.196465, 78.333488),\n (141.196465, 78.333488, 141.223329, 78.333488),\n (141.223329, 78.333488, 141.250193, 78.333488),\n (141.250193, 78.333488, 141.277056, 78.333488),\n (141.277056, 78.333488, 141.30392, 78.333488),\n (141.30392, 78.333488, 141.330784, 78.333488),\n (141.330784, 78.333488, 141.357648, 78.333488),\n (141.357648, 78.333488, 141.384511, 78.333488),\n (141.384511, 78.333488, 141.411375, 78.333488),\n (141.411375, 78.333488, 141.438239, 78.333488),\n (141.438239, 78.333488, 141.465102, 78.333488),\n (141.465102, 78.333488, 141.491966, 78.333488),\n (141.491966, 78.333488, 141.51883, 78.333488),\n (141.51883, 78.333488, 141.545694, 78.333488),\n (141.545694, 78.333488, 175.07162, 78.333488),\n (175.07162, 76.883801, 175.07162, 78.333488),\n (141.545694, 76.883801, 175.07162, 76.883801),\n (176.438525, 78.333488, 176.438525, 76.883801),\n (94.591069, 78.333488, 94.591069, 76.883801),\n (95.12518, 76.883801, 95.12518, 78.333488),\n (191.888213, 157.340535, 190.438526, 157.340535),\n (191.888213, 111.779661, 191.888213, 157.340535),\n (190.438526, 157.340535, 190.438526, 111.779661),\n (190.438526, 92.8676, 190.438526, 109.200743),\n (191.888213, 92.8676, 191.888213, 109.200743),\n (191.888213, 109.200743, 191.888213, 109.281334),\n (191.888213, 109.281334, 191.888213, 109.361926),\n (191.888213, 109.361926, 191.888213, 109.442517),\n (191.888213, 109.442517, 191.888213, 109.523108),\n (191.888213, 109.523108, 191.888213, 109.603699),\n (191.888213, 109.603699, 191.888213, 109.68429),\n (191.888213, 109.68429, 191.888213, 109.764881),\n (191.888213, 109.764881, 191.888213, 109.845473),\n (191.888213, 109.845473, 191.888213, 109.926064),\n (191.888213, 109.926064, 191.888213, 110.006655),\n (191.888213, 110.006655, 191.888213, 110.087246),\n (191.888213, 110.087246, 191.888213, 110.167837),\n (191.888213, 110.167837, 191.888213, 110.248428),\n (191.888213, 110.248428, 191.888213, 110.32902),\n (191.888213, 110.32902, 191.888213, 110.409611),\n (191.888213, 110.409611, 191.888213, 110.490202),\n (191.888213, 110.490202, 191.888213, 110.570793),\n (191.888213, 110.570793, 191.888213, 110.651384),\n (191.888213, 110.651384, 191.888213, 110.731975),\n (191.888213, 110.731975, 191.888213, 110.812567),\n (191.888213, 110.812567, 191.888213, 110.893158),\n (191.888213, 110.893158, 191.888213, 110.973749),\n (191.888213, 110.973749, 191.888213, 111.05434),\n (191.888213, 111.05434, 191.888213, 111.134931),\n (191.888213, 111.134931, 191.888213, 111.215522),\n (191.888213, 111.215522, 191.888213, 111.296114),\n (191.888213, 111.296114, 191.888213, 111.376705),\n (191.888213, 111.376705, 191.888213, 111.457296),\n (191.888213, 111.457296, 191.888213, 111.537887),\n (191.888213, 111.537887, 191.888213, 111.618478),\n (191.888213, 111.618478, 191.888213, 111.69907),\n (191.888213, 111.69907, 191.888213, 111.779661),\n (190.438526, 109.200743, 190.438526, 109.281334),\n (190.438526, 109.281334, 190.438526, 109.361926),\n (190.438526, 109.361926, 190.438526, 109.442517),\n (190.438526, 109.442517, 190.438526, 109.523108),\n (190.438526, 109.523108, 190.438526, 109.603699),\n (190.438526, 109.603699, 190.438526, 109.68429),\n (190.438526, 109.68429, 190.438526, 109.764881),\n (190.438526, 109.764881, 190.438526, 109.845473),\n (190.438526, 109.845473, 190.438526, 109.926064),\n (190.438526, 109.926064, 190.438526, 110.006655),\n (190.438526, 110.006655, 190.438526, 110.087246),\n (190.438526, 110.087246, 190.438526, 110.167837),\n (190.438526, 110.167837, 190.438526, 110.248428),\n (190.438526, 110.248428, 190.438526, 110.32902),\n (190.438526, 110.32902, 190.438526, 110.409611),\n (190.438526, 110.409611, 190.438526, 110.490202),\n (190.438526, 110.490202, 190.438526, 110.570793),\n (190.438526, 110.570793, 190.438526, 110.651384),\n (190.438526, 110.651384, 190.438526, 110.731975),\n (190.438526, 110.731975, 190.438526, 110.812567),\n (190.438526, 110.812567, 190.438526, 110.893158),\n (190.438526, 110.893158, 190.438526, 110.973749),\n (190.438526, 110.973749, 190.438526, 111.05434),\n (190.438526, 111.05434, 190.438526, 111.134931),\n (190.438526, 111.134931, 190.438526, 111.215522),\n (190.438526, 111.215522, 190.438526, 111.296114),\n (190.438526, 111.296114, 190.438526, 111.376705),\n (190.438526, 111.376705, 190.438526, 111.457296),\n (190.438526, 111.457296, 190.438526, 111.537887),\n (190.438526, 111.537887, 190.438526, 111.618478),\n (190.438526, 111.618478, 190.438526, 111.69907),\n (190.438526, 111.69907, 190.438526, 111.779661),\n (190.438526, 157.426032, 191.888213, 157.426032),\n (190.438526, 92.333488, 191.888213, 92.333488),\n (191.888213, 111.779661, 190.438526, 111.779661),\n (191.888213, 92.8676, 190.438526, 92.8676),\n (191.888213, 109.200743, 190.438526, 109.200743)\n]\nVISIBLE_CIRCLES = [\n (107.160128, 112.6393, 0.859639),\n (122.633633, 112.6393, 0.859639),\n (144.98425, 149.603783, 0.859639),\n (145.843889, 134.989917, 0.859639)\n]\nVISIBLE_ARCS = [\n (141.115874, 156.302859, 1.123173, 67.5, 112.5),\n (174.967328, 155.873039, 1.471197, -49.065051, 85.934949),\n (112.747782, 94.157058, 1.82357, -135.0, -45.0),\n (96.414639, 110.490202, 1.82357, 135.0, -135.0),\n (139.518696, 58.424195, 18.531346, 83.733617, 86.381518),\n (196.332633, 2272.697513, 2195.910128, -90.55475, -90.519086),\n (121.215849, 1673.566565, 1596.165315, -88.066404, -88.017366),\n (-1074.529097, -66795.390956, 66882.49843, 88.997949, 88.998407),\n (81.841495, -1101.901439, 1180.306708, 89.355156, 89.381082),\n (-239.757538, 141.835776, 431.925672, 2.057186, 2.06852),\n (677.012711, 139.819498, 486.89108, 177.927674, 177.937729),\n (1635.702774, 121.005855, 1444.093982, -178.883514, -178.862326),\n (-1302.865616, 122.01261, 1493.593756, -1.138592, -1.118107)\n]\nHIDDEN_SEGMENTS = [\n (175.9313, 76.8838, 175.9313, 78.3335),\n (108.0198, 76.8838, 108.0198, 78.3335),\n (123.4933, 76.8838, 123.4933, 78.3335),\n (145.8439, 76.8838, 145.8439, 78.3335),\n (146.7035, 76.8838, 146.7035, 78.3335),\n (106.3005, 78.3335, 106.3005, 76.8838),\n (121.774, 78.3335, 121.774, 76.8838),\n (144.1246, 78.3335, 144.1246, 76.8838),\n (144.9843, 78.3335, 144.9843, 76.8838),\n (191.8882, 154.7616, 190.4385, 154.7616),\n (190.4385, 113.4989, 191.8882, 113.4989),\n (190.4385, 148.7441, 191.8882, 148.7441),\n (190.4385, 150.4634, 191.8882, 150.4634),\n (190.4385, 134.1303, 191.8882, 134.1303),\n (190.4385, 135.8495, 191.8882, 135.8495)\n]\n# (orient, text, p1, p2, base) for linear; (orient, text, center, radius, angle) for diameter\nDIMENSIONS = [\n ('horizontal', '2.9463', (114.0373, 92.8675), (111.4583, 92.8675), (112.7478, 81.8675)),\n ('horizontal', '39.2837', (140.686, 157.3405), (175.0717, 157.3405), (157.8789, 168.3405)),\n ('vertical', '2.9463', (95.1252, 109.2007), (95.1252, 111.7797), (84.1252, 110.4902)),\n ('aligned', '100', (175.9312, 154.7616), (114.0373, 92.8675), (152.7624, 116.0364)),\n ('aligned', '26.3889', (111.4583, 92.8675), (95.1252, 109.2007), (95.5136, 93.256)),\n ('aligned', '73.6111', (95.1252, 111.7797), (140.686, 157.3405), (110.1274, 142.3383)),\n ('diameter', '%%c1.9642', (107.1601, 112.6393), 0.8596, 45),\n ('horizontal', '13.7493', (95.1252, 112.6393), (107.1601, 112.6393), (101.1426, 123.6393)),\n ('vertical', '51.0688', (107.1601, 157.3405), (107.1601, 112.6393), (118.1601, 134.9899)),\n ('diameter', '%%c1.9642', (122.6336, 112.6393), 0.8596, 45),\n ('horizontal', '31.427', (95.1252, 112.6393), (122.6336, 112.6393), (108.8794, 123.6393)),\n ('vertical', '51.0688', (122.6336, 157.3405), (122.6336, 112.6393), (133.6336, 134.9899)),\n ('diameter', '%%c1.9642', (144.9843, 149.6038), 0.8596, 45),\n ('horizontal', '56.9614', (95.1252, 149.6038), (144.9843, 149.6038), (120.0547, 160.6038)),\n ('vertical', '8.8388', (144.9843, 157.3405), (144.9843, 149.6038), (155.9843, 153.4722)),\n ('diameter', '%%c1.9642', (145.8439, 134.9899), 0.8596, 45),\n ('horizontal', '57.9435', (95.1252, 134.9899), (145.8439, 134.9899), (120.4845, 145.9899)),\n ('vertical', '25.5344', (145.8439, 157.3405), (145.8439, 134.9899), (156.8439, 146.1652)),\n ('radius', 'R1.2832', (141.1159, 156.3028), 1.1232, 45),\n ('radius', 'R1.6808', (174.9673, 155.8731), 1.4712, 45),\n ('radius', 'R2.0833', (112.7478, 94.1571), 1.8235, 45),\n ('horizontal', '1.6562', (191.8882, 157.3405), (190.4385, 157.3405), (191.1634, 146.3405))\n]\n\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; _ds.dxf.dimasz = 2.5\n _ds.dxf.dimexe = 1.25; _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\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\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,\n angle=(0 if d[0] == \"horizontal\" else 90),\n 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,\n 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,\n 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,\n text=text, dimstyle=\"EZDXF\").render()\n\n doc.saveas(out_path)\n\n\nif __name__ == \"__main__\":\n out = sys.argv[1] if len(sys.argv) > 1 else \"0094_00944237_gt.dxf\"\n draw(out)\n print(\"wrote\", out)\n```"}], "images": ["images/0094_00944237.png"], "id": "0094_00944237"} {"messages": [{"role": "user", "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 2 circular holes, each of diameter 9.3 mm and a rectangular cutout 2.33 x 30.23 mm. It is extruded to a thickness of 10.04 mm. The outline includes one or more oblique (angled) edges."}, {"role": "assistant", "content": "```python\n#!/usr/bin/env python3\n# -*- coding: utf-8 -*-\n# Ground-truth 2D engineering drawing for part: 0094_00944505\n# Self-contained: reproduces the three-view DXF via ezdxf, NO FreeCAD needed.\n# Coordinates are A4 page millimetres (scale=0.6878940311836491, page=[297.0, 210.0]).\n# visible edges -> solid (layer OUTLINE); hidden edges -> dashed (layer HIDDEN)\n# dimensions -> real movable DIMENSION entities (text = true mm value)\n# Run: python 0094_00944505_gt.py [out.dxf]\nimport sys\nimport ezdxf\nimport math\n\nSCALE = 0.6878940311836491\nPAGE = [297.0, 210.0]\n\nVISIBLE_SEGMENTS = [\n (115.448714, 84.564892, 149.843416, 84.564892),\n (164.241198, 98.162798, 164.241198, 139.75639),\n (149.843416, 139.75639, 149.843416, 101.362305),\n (146.643909, 98.162798, 119.448098, 98.162798),\n (115.448714, 101.362305, 115.448714, 166.952201),\n (101.850809, 166.952201, 101.850809, 98.162798),\n (156.24243, 115.760087, 156.24243, 94.963291),\n (157.842184, 115.760087, 156.24243, 115.760087),\n (157.842184, 94.963291, 157.842184, 115.760087),\n (156.24243, 94.963291, 157.842184, 94.963291),\n (164.241198, 70.55918, 164.241198, 63.651153),\n (164.241198, 70.55918, 163.791267, 70.55918),\n (163.791267, 70.55918, 163.341336, 70.55918),\n (163.341336, 70.55918, 162.891406, 70.55918),\n (162.891406, 70.55918, 162.441475, 70.55918),\n (162.441475, 70.55918, 161.991544, 70.55918),\n (161.991544, 70.55918, 161.541614, 70.55918),\n (161.541614, 70.55918, 161.091683, 70.55918),\n (161.091683, 70.55918, 160.641752, 70.55918),\n (160.641752, 70.55918, 160.191822, 70.55918),\n (160.191822, 70.55918, 159.741891, 70.55918),\n (159.741891, 70.55918, 159.29196, 70.55918),\n (159.29196, 70.55918, 158.84203, 70.55918),\n (158.84203, 70.55918, 158.392099, 70.55918),\n (158.392099, 70.55918, 157.942168, 70.55918),\n (157.942168, 70.55918, 157.492238, 70.55918),\n (157.492238, 70.55918, 157.042307, 70.55918),\n (157.042307, 70.55918, 156.592376, 70.55918),\n (156.592376, 70.55918, 156.142445, 70.55918),\n (156.142445, 70.55918, 155.692515, 70.55918),\n (155.692515, 70.55918, 155.242584, 70.55918),\n (155.242584, 70.55918, 154.792653, 70.55918),\n (154.792653, 70.55918, 154.342723, 70.55918),\n (154.342723, 70.55918, 153.892792, 70.55918),\n (153.892792, 70.55918, 153.442861, 70.55918),\n (153.442861, 70.55918, 152.992931, 70.55918),\n (152.992931, 70.55918, 152.543, 70.55918),\n (152.543, 70.55918, 152.093069, 70.55918),\n (152.093069, 70.55918, 151.643139, 70.55918),\n (151.643139, 70.55918, 151.193208, 70.55918),\n (151.193208, 70.55918, 150.743277, 70.55918),\n (150.743277, 70.55918, 150.293346, 70.55918),\n (150.293346, 70.55918, 149.843416, 70.55918),\n (149.843416, 70.55918, 149.843416, 63.651153),\n (164.241198, 63.651153, 163.791267, 63.651153),\n (163.791267, 63.651153, 163.341336, 63.651153),\n (163.341336, 63.651153, 162.891406, 63.651153),\n (162.891406, 63.651153, 162.441475, 63.651153),\n (162.441475, 63.651153, 161.991544, 63.651153),\n (161.991544, 63.651153, 161.541614, 63.651153),\n (161.541614, 63.651153, 161.091683, 63.651153),\n (161.091683, 63.651153, 160.641752, 63.651153),\n (160.641752, 63.651153, 160.191822, 63.651153),\n (160.191822, 63.651153, 159.741891, 63.651153),\n (159.741891, 63.651153, 159.29196, 63.651153),\n (159.29196, 63.651153, 158.84203, 63.651153),\n (158.84203, 63.651153, 158.392099, 63.651153),\n (158.392099, 63.651153, 157.942168, 63.651153),\n (157.942168, 63.651153, 157.492238, 63.651153),\n (157.492238, 63.651153, 157.042307, 63.651153),\n (157.042307, 63.651153, 156.592376, 63.651153),\n (156.592376, 63.651153, 156.142445, 63.651153),\n (156.142445, 63.651153, 155.692515, 63.651153),\n (155.692515, 63.651153, 155.242584, 63.651153),\n (155.242584, 63.651153, 154.792653, 63.651153),\n (154.792653, 63.651153, 154.342723, 63.651153),\n (154.342723, 63.651153, 153.892792, 63.651153),\n (153.892792, 63.651153, 153.442861, 63.651153),\n (153.442861, 63.651153, 152.992931, 63.651153),\n (152.992931, 63.651153, 152.543, 63.651153),\n (152.543, 63.651153, 152.093069, 63.651153),\n (152.093069, 63.651153, 151.643139, 63.651153),\n (151.643139, 63.651153, 151.193208, 63.651153),\n (151.193208, 63.651153, 150.743277, 63.651153),\n (150.743277, 63.651153, 150.293346, 63.651153),\n (150.293346, 63.651153, 149.843416, 63.651153),\n (149.843416, 63.651153, 149.743431, 63.651153),\n (149.743431, 63.651153, 149.643447, 63.651153),\n (149.643447, 63.651153, 149.543462, 63.651153),\n (149.543462, 63.651153, 149.443477, 63.651153),\n (149.443477, 63.651153, 149.343493, 63.651153),\n (149.343493, 63.651153, 149.243508, 63.651153),\n (149.243508, 63.651153, 149.143524, 63.651153),\n (149.143524, 63.651153, 149.043539, 63.651153),\n (149.043539, 63.651153, 148.943554, 63.651153),\n (148.943554, 63.651153, 148.84357, 63.651153),\n (148.84357, 63.651153, 148.743585, 63.651153),\n (148.743585, 63.651153, 148.643601, 63.651153),\n (148.643601, 63.651153, 148.543616, 63.651153),\n (148.543616, 63.651153, 148.443631, 63.651153),\n (148.443631, 63.651153, 148.343647, 63.651153),\n (148.343647, 63.651153, 148.243662, 63.651153),\n (148.243662, 63.651153, 148.143678, 63.651153),\n (148.143678, 63.651153, 148.043693, 63.651153),\n (148.043693, 63.651153, 147.943708, 63.651153),\n (147.943708, 63.651153, 147.843724, 63.651153),\n (147.843724, 63.651153, 147.743739, 63.651153),\n (147.743739, 63.651153, 147.643755, 63.651153),\n (147.643755, 63.651153, 147.54377, 63.651153),\n (147.54377, 63.651153, 147.443785, 63.651153),\n (147.443785, 63.651153, 147.343801, 63.651153),\n (147.343801, 63.651153, 147.243816, 63.651153),\n (147.243816, 63.651153, 147.143832, 63.651153),\n (147.143832, 63.651153, 147.043847, 63.651153),\n (147.043847, 63.651153, 146.943862, 63.651153),\n (146.943862, 63.651153, 146.843878, 63.651153),\n (146.843878, 63.651153, 146.743893, 63.651153),\n (146.743893, 63.651153, 146.643909, 63.651153),\n (149.843416, 70.55918, 149.743431, 70.55918),\n (149.743431, 70.55918, 149.643447, 70.55918),\n (149.643447, 70.55918, 149.543462, 70.55918),\n (149.543462, 70.55918, 149.443477, 70.55918),\n (149.443477, 70.55918, 149.343493, 70.55918),\n (149.343493, 70.55918, 149.243508, 70.55918),\n (149.243508, 70.55918, 149.143524, 70.55918),\n (149.143524, 70.55918, 149.043539, 70.55918),\n (149.043539, 70.55918, 148.943554, 70.55918),\n (148.943554, 70.55918, 148.84357, 70.55918),\n (148.84357, 70.55918, 148.743585, 70.55918),\n (148.743585, 70.55918, 148.643601, 70.55918),\n (148.643601, 70.55918, 148.543616, 70.55918),\n (148.543616, 70.55918, 148.443631, 70.55918),\n (148.443631, 70.55918, 148.343647, 70.55918),\n (148.343647, 70.55918, 148.243662, 70.55918),\n (148.243662, 70.55918, 148.143678, 70.55918),\n (148.143678, 70.55918, 148.043693, 70.55918),\n (148.043693, 70.55918, 147.943708, 70.55918),\n (147.943708, 70.55918, 147.843724, 70.55918),\n (147.843724, 70.55918, 147.743739, 70.55918),\n (147.743739, 70.55918, 147.643755, 70.55918),\n (147.643755, 70.55918, 147.54377, 70.55918),\n (147.54377, 70.55918, 147.443785, 70.55918),\n (147.443785, 70.55918, 147.343801, 70.55918),\n (147.343801, 70.55918, 147.243816, 70.55918),\n (147.243816, 70.55918, 147.143832, 70.55918),\n (147.143832, 70.55918, 147.043847, 70.55918),\n (147.043847, 70.55918, 146.943862, 70.55918),\n (146.943862, 70.55918, 146.843878, 70.55918),\n (146.843878, 70.55918, 146.743893, 70.55918),\n (146.743893, 70.55918, 146.643909, 70.55918),\n (146.643909, 63.651153, 119.448098, 63.651153),\n (119.448098, 70.55918, 119.448098, 63.651153),\n (146.643909, 70.55918, 119.448098, 70.55918),\n (119.448098, 63.651153, 119.323117, 63.651153),\n (119.323117, 63.651153, 119.198137, 63.651153),\n (119.198137, 63.651153, 119.073156, 63.651153),\n (119.073156, 63.651153, 118.948175, 63.651153),\n (118.948175, 63.651153, 118.823194, 63.651153),\n (118.823194, 63.651153, 118.698214, 63.651153),\n (118.698214, 63.651153, 118.573233, 63.651153),\n (118.573233, 63.651153, 118.448252, 63.651153),\n (118.448252, 63.651153, 118.323271, 63.651153),\n (118.323271, 63.651153, 118.198291, 63.651153),\n (118.198291, 63.651153, 118.07331, 63.651153),\n (118.07331, 63.651153, 117.948329, 63.651153),\n (117.948329, 63.651153, 117.823348, 63.651153),\n (117.823348, 63.651153, 117.698368, 63.651153),\n (117.698368, 63.651153, 117.573387, 63.651153),\n (117.573387, 63.651153, 117.448406, 63.651153),\n (117.448406, 63.651153, 117.323425, 63.651153),\n (117.323425, 63.651153, 117.198445, 63.651153),\n (117.198445, 63.651153, 117.073464, 63.651153),\n (117.073464, 63.651153, 116.948483, 63.651153),\n (116.948483, 63.651153, 116.823502, 63.651153),\n (116.823502, 63.651153, 116.698522, 63.651153),\n (116.698522, 63.651153, 116.573541, 63.651153),\n (116.573541, 63.651153, 116.44856, 63.651153),\n (116.44856, 63.651153, 116.323579, 63.651153),\n (116.323579, 63.651153, 116.198599, 63.651153),\n (116.198599, 63.651153, 116.073618, 63.651153),\n (116.073618, 63.651153, 115.948637, 63.651153),\n (115.948637, 63.651153, 115.823656, 63.651153),\n (115.823656, 63.651153, 115.698676, 63.651153),\n (115.698676, 63.651153, 115.573695, 63.651153),\n (115.573695, 63.651153, 115.448714, 63.651153),\n (119.448098, 70.55918, 119.323117, 70.55918),\n (119.323117, 70.55918, 119.198137, 70.55918),\n (119.198137, 70.55918, 119.073156, 70.55918),\n (119.073156, 70.55918, 118.948175, 70.55918),\n (118.948175, 70.55918, 118.823194, 70.55918),\n (118.823194, 70.55918, 118.698214, 70.55918),\n (118.698214, 70.55918, 118.573233, 70.55918),\n (118.573233, 70.55918, 118.448252, 70.55918),\n (118.448252, 70.55918, 118.323271, 70.55918),\n (118.323271, 70.55918, 118.198291, 70.55918),\n (118.198291, 70.55918, 118.07331, 70.55918),\n (118.07331, 70.55918, 117.948329, 70.55918),\n (117.948329, 70.55918, 117.823348, 70.55918),\n (117.823348, 70.55918, 117.698368, 70.55918),\n (117.698368, 70.55918, 117.573387, 70.55918),\n (117.573387, 70.55918, 117.448406, 70.55918),\n (117.448406, 70.55918, 117.323425, 70.55918),\n (117.323425, 70.55918, 117.198445, 70.55918),\n (117.198445, 70.55918, 117.073464, 70.55918),\n (117.073464, 70.55918, 116.948483, 70.55918),\n (116.948483, 70.55918, 116.823502, 70.55918),\n (116.823502, 70.55918, 116.698522, 70.55918),\n (116.698522, 70.55918, 116.573541, 70.55918),\n (116.573541, 70.55918, 116.44856, 70.55918),\n (116.44856, 70.55918, 116.323579, 70.55918),\n (116.323579, 70.55918, 116.198599, 70.55918),\n (116.198599, 70.55918, 116.073618, 70.55918),\n (116.073618, 70.55918, 115.948637, 70.55918),\n (115.948637, 70.55918, 115.823656, 70.55918),\n (115.823656, 70.55918, 115.698676, 70.55918),\n (115.698676, 70.55918, 115.573695, 70.55918),\n (115.573695, 70.55918, 115.448714, 70.55918),\n (115.448714, 70.55918, 115.448714, 63.651153),\n (115.448714, 70.55918, 115.02378, 70.55918),\n (115.02378, 70.55918, 114.598845, 70.55918),\n (114.598845, 70.55918, 114.173911, 70.55918),\n (114.173911, 70.55918, 113.748976, 70.55918),\n (113.748976, 70.55918, 113.324042, 70.55918),\n (113.324042, 70.55918, 112.899107, 70.55918),\n (112.899107, 70.55918, 112.474172, 70.55918),\n (112.474172, 70.55918, 112.049238, 70.55918),\n (112.049238, 70.55918, 111.624303, 70.55918),\n (111.624303, 70.55918, 111.199369, 70.55918),\n (111.199369, 70.55918, 110.774434, 70.55918),\n (110.774434, 70.55918, 110.3495, 70.55918),\n (110.3495, 70.55918, 109.924565, 70.55918),\n (109.924565, 70.55918, 109.499631, 70.55918),\n (109.499631, 70.55918, 109.074696, 70.55918),\n (109.074696, 70.55918, 108.649762, 70.55918),\n (108.649762, 70.55918, 108.224827, 70.55918),\n (108.224827, 70.55918, 107.799893, 70.55918),\n (107.799893, 70.55918, 107.374958, 70.55918),\n (107.374958, 70.55918, 106.950023, 70.55918),\n (106.950023, 70.55918, 106.525089, 70.55918),\n (106.525089, 70.55918, 106.100154, 70.55918),\n (106.100154, 70.55918, 105.67522, 70.55918),\n (105.67522, 70.55918, 105.250285, 70.55918),\n (105.250285, 70.55918, 104.825351, 70.55918),\n (104.825351, 70.55918, 104.400416, 70.55918),\n (104.400416, 70.55918, 103.975482, 70.55918),\n (103.975482, 70.55918, 103.550547, 70.55918),\n (103.550547, 70.55918, 103.125613, 70.55918),\n (103.125613, 70.55918, 102.700678, 70.55918),\n (102.700678, 70.55918, 102.275744, 70.55918),\n (102.275744, 70.55918, 101.850809, 70.55918),\n (101.850809, 70.55918, 101.850809, 63.651153),\n (115.448714, 63.651153, 115.02378, 63.651153),\n (115.02378, 63.651153, 114.598845, 63.651153),\n (114.598845, 63.651153, 114.173911, 63.651153),\n (114.173911, 63.651153, 113.748976, 63.651153),\n (113.748976, 63.651153, 113.324042, 63.651153),\n (113.324042, 63.651153, 112.899107, 63.651153),\n (112.899107, 63.651153, 112.474172, 63.651153),\n (112.474172, 63.651153, 112.049238, 63.651153),\n (112.049238, 63.651153, 111.624303, 63.651153),\n (111.624303, 63.651153, 111.199369, 63.651153),\n (111.199369, 63.651153, 110.774434, 63.651153),\n (110.774434, 63.651153, 110.3495, 63.651153),\n (110.3495, 63.651153, 109.924565, 63.651153),\n (109.924565, 63.651153, 109.499631, 63.651153),\n (109.499631, 63.651153, 109.074696, 63.651153),\n (109.074696, 63.651153, 108.649762, 63.651153),\n (108.649762, 63.651153, 108.224827, 63.651153),\n (108.224827, 63.651153, 107.799893, 63.651153),\n (107.799893, 63.651153, 107.374958, 63.651153),\n (107.374958, 63.651153, 106.950023, 63.651153),\n (106.950023, 63.651153, 106.525089, 63.651153),\n (106.525089, 63.651153, 106.100154, 63.651153),\n (106.100154, 63.651153, 105.67522, 63.651153),\n (105.67522, 63.651153, 105.250285, 63.651153),\n (105.250285, 63.651153, 104.825351, 63.651153),\n (104.825351, 63.651153, 104.400416, 63.651153),\n (104.400416, 63.651153, 103.975482, 63.651153),\n (103.975482, 63.651153, 103.550547, 63.651153),\n (103.550547, 63.651153, 103.125613, 63.651153),\n (103.125613, 63.651153, 102.700678, 63.651153),\n (102.700678, 63.651153, 102.275744, 63.651153),\n (102.275744, 63.651153, 101.850809, 63.651153),\n (146.643909, 70.55918, 146.643909, 63.651153),\n (178.241198, 98.162798, 178.241198, 97.737863),\n (178.241198, 97.737863, 178.241198, 97.312929),\n (178.241198, 97.312929, 178.241198, 96.887994),\n (178.241198, 96.887994, 178.241198, 96.46306),\n (178.241198, 96.46306, 178.241198, 96.038125),\n (178.241198, 96.038125, 178.241198, 95.61319),\n (178.241198, 95.61319, 178.241198, 95.188256),\n (178.241198, 95.188256, 178.241198, 94.763321),\n (178.241198, 94.763321, 178.241198, 94.338387),\n (178.241198, 94.338387, 178.241198, 93.913452),\n (178.241198, 93.913452, 178.241198, 93.488518),\n (178.241198, 93.488518, 178.241198, 93.063583),\n (178.241198, 93.063583, 178.241198, 92.638649),\n (178.241198, 92.638649, 178.241198, 92.213714),\n (178.241198, 92.213714, 178.241198, 91.78878),\n (178.241198, 91.78878, 178.241198, 91.363845),\n (178.241198, 91.363845, 178.241198, 90.93891),\n (178.241198, 90.93891, 178.241198, 90.513976),\n (178.241198, 90.513976, 178.241198, 90.089041),\n (178.241198, 90.089041, 178.241198, 89.664107),\n (178.241198, 89.664107, 178.241198, 89.239172),\n (178.241198, 89.239172, 178.241198, 88.814238),\n (178.241198, 88.814238, 178.241198, 88.389303),\n (178.241198, 88.389303, 178.241198, 87.964369),\n (178.241198, 87.964369, 178.241198, 87.539434),\n (178.241198, 87.539434, 178.241198, 87.1145),\n (178.241198, 87.1145, 178.241198, 86.689565),\n (178.241198, 86.689565, 178.241198, 86.264631),\n (178.241198, 86.264631, 178.241198, 85.839696),\n (178.241198, 85.839696, 178.241198, 85.414761),\n (178.241198, 85.414761, 178.241198, 84.989827),\n (178.241198, 84.989827, 178.241198, 84.564892),\n (178.241198, 84.564892, 185.149225, 84.564892),\n (185.149225, 98.162798, 185.149225, 97.737863),\n (185.149225, 97.737863, 185.149225, 97.312929),\n (185.149225, 97.312929, 185.149225, 96.887994),\n (185.149225, 96.887994, 185.149225, 96.46306),\n (185.149225, 96.46306, 185.149225, 96.038125),\n (185.149225, 96.038125, 185.149225, 95.61319),\n (185.149225, 95.61319, 185.149225, 95.188256),\n (185.149225, 95.188256, 185.149225, 94.763321),\n (185.149225, 94.763321, 185.149225, 94.338387),\n (185.149225, 94.338387, 185.149225, 93.913452),\n (185.149225, 93.913452, 185.149225, 93.488518),\n (185.149225, 93.488518, 185.149225, 93.063583),\n (185.149225, 93.063583, 185.149225, 92.638649),\n (185.149225, 92.638649, 185.149225, 92.213714),\n (185.149225, 92.213714, 185.149225, 91.78878),\n (185.149225, 91.78878, 185.149225, 91.363845),\n (185.149225, 91.363845, 185.149225, 90.93891),\n (185.149225, 90.93891, 185.149225, 90.513976),\n (185.149225, 90.513976, 185.149225, 90.089041),\n (185.149225, 90.089041, 185.149225, 89.664107),\n (185.149225, 89.664107, 185.149225, 89.239172),\n (185.149225, 89.239172, 185.149225, 88.814238),\n (185.149225, 88.814238, 185.149225, 88.389303),\n (185.149225, 88.389303, 185.149225, 87.964369),\n (185.149225, 87.964369, 185.149225, 87.539434),\n (185.149225, 87.539434, 185.149225, 87.1145),\n (185.149225, 87.1145, 185.149225, 86.689565),\n (185.149225, 86.689565, 185.149225, 86.264631),\n (185.149225, 86.264631, 185.149225, 85.839696),\n (185.149225, 85.839696, 185.149225, 85.414761),\n (185.149225, 85.414761, 185.149225, 84.989827),\n (185.149225, 84.989827, 185.149225, 84.564892),\n (178.241198, 173.751153, 178.241198, 173.538686),\n (178.241198, 173.538686, 178.241198, 173.326219),\n (178.241198, 173.326219, 178.241198, 173.113752),\n (178.241198, 173.113752, 178.241198, 172.901284),\n (178.241198, 172.901284, 178.241198, 172.688817),\n (178.241198, 172.688817, 178.241198, 172.47635),\n (178.241198, 172.47635, 178.241198, 172.263883),\n (178.241198, 172.263883, 178.241198, 172.051415),\n (178.241198, 172.051415, 178.241198, 171.838948),\n (178.241198, 171.838948, 178.241198, 171.626481),\n (178.241198, 171.626481, 178.241198, 171.414013),\n (178.241198, 171.414013, 178.241198, 171.201546),\n (178.241198, 171.201546, 178.241198, 170.989079),\n (178.241198, 170.989079, 178.241198, 170.776612),\n (178.241198, 170.776612, 178.241198, 170.564144),\n (178.241198, 170.564144, 178.241198, 170.351677),\n (178.241198, 170.351677, 178.241198, 170.13921),\n (178.241198, 170.13921, 178.241198, 169.926743),\n (178.241198, 169.926743, 178.241198, 169.714275),\n (178.241198, 169.714275, 178.241198, 169.501808),\n (178.241198, 169.501808, 178.241198, 169.289341),\n (178.241198, 169.289341, 178.241198, 169.076873),\n (178.241198, 169.076873, 178.241198, 168.864406),\n (178.241198, 168.864406, 178.241198, 168.651939),\n (178.241198, 168.651939, 178.241198, 168.439472),\n (178.241198, 168.439472, 178.241198, 168.227004),\n (178.241198, 168.227004, 178.241198, 168.014537),\n (178.241198, 168.014537, 178.241198, 167.80207),\n (178.241198, 167.80207, 178.241198, 167.589603),\n (178.241198, 167.589603, 178.241198, 167.377135),\n (178.241198, 167.377135, 178.241198, 167.164668),\n (178.241198, 167.164668, 178.241198, 166.952201),\n (185.149225, 173.751153, 185.149225, 173.538686),\n (185.149225, 173.538686, 185.149225, 173.326219),\n (185.149225, 173.326219, 185.149225, 173.113752),\n (185.149225, 173.113752, 185.149225, 172.901284),\n (185.149225, 172.901284, 185.149225, 172.688817),\n (185.149225, 172.688817, 185.149225, 172.47635),\n (185.149225, 172.47635, 185.149225, 172.263883),\n (185.149225, 172.263883, 185.149225, 172.051415),\n (185.149225, 172.051415, 185.149225, 171.838948),\n (185.149225, 171.838948, 185.149225, 171.626481),\n (185.149225, 171.626481, 185.149225, 171.414013),\n (185.149225, 171.414013, 185.149225, 171.201546),\n (185.149225, 171.201546, 185.149225, 170.989079),\n (185.149225, 170.989079, 185.149225, 170.776612),\n (185.149225, 170.776612, 185.149225, 170.564144),\n (185.149225, 170.564144, 185.149225, 170.351677),\n (185.149225, 170.351677, 185.149225, 170.13921),\n (185.149225, 170.13921, 185.149225, 169.926743),\n (185.149225, 169.926743, 185.149225, 169.714275),\n (185.149225, 169.714275, 185.149225, 169.501808),\n (185.149225, 169.501808, 185.149225, 169.289341),\n (185.149225, 169.289341, 185.149225, 169.076873),\n (185.149225, 169.076873, 185.149225, 168.864406),\n (185.149225, 168.864406, 185.149225, 168.651939),\n (185.149225, 168.651939, 185.149225, 168.439472),\n (185.149225, 168.439472, 185.149225, 168.227004),\n (185.149225, 168.227004, 185.149225, 168.014537),\n (185.149225, 168.014537, 185.149225, 167.80207),\n (185.149225, 167.80207, 185.149225, 167.589603),\n (185.149225, 167.589603, 185.149225, 167.377135),\n (185.149225, 167.377135, 185.149225, 167.164668),\n (185.149225, 167.164668, 185.149225, 166.952201),\n (185.149225, 166.952201, 185.149225, 98.162798),\n (178.241198, 166.952201, 178.241198, 98.162798),\n (185.149225, 84.55918, 178.241198, 84.55918),\n (185.149225, 173.751153, 178.241198, 173.751153),\n (178.241198, 98.162798, 185.149225, 98.162798),\n (178.241198, 166.952201, 185.149225, 166.952201)\n]\nVISIBLE_CIRCLES = [\n (109.0497, 132.557499, 3.199507),\n (109.0497, 166.952201, 3.199507)\n]\nVISIBLE_ARCS = [\n (115.448714, 98.162798, 13.597905, 180.0, -90.0),\n (150.243354, 98.562736, 14.003556, -91.636577, -1.636577),\n (157.042307, 139.75639, 7.198891, -0.0, -180.0),\n (146.643909, 101.362305, 3.199507, -90.0, -0.0),\n (119.04816, 101.762243, 3.621596, -173.659808, -83.659808),\n (108.649762, 166.952201, 6.798953, -0.0, 180.0),\n (-926.009235, 113.946379, 1104.641326, -1.524441, -1.524145),\n (645.694692, 121.20462, 462.000873, -175.451286, -175.45058)\n]\nHIDDEN_SEGMENTS = [\n (112.2492, 70.5592, 112.2492, 63.6512),\n (156.2424, 70.5592, 156.2424, 63.6512),\n (157.8422, 70.5592, 157.8422, 63.6512),\n (105.8502, 63.6512, 105.8502, 70.5592),\n (178.2412, 101.3623, 185.1492, 101.3623),\n (178.2412, 115.7601, 185.1492, 115.7601),\n (178.2412, 94.9633, 185.1492, 94.9633),\n (185.1492, 146.9553, 178.2412, 146.9553),\n (185.1492, 135.757, 178.2412, 135.757),\n (185.1492, 129.358, 178.2412, 129.358),\n (185.1492, 170.1517, 178.2412, 170.1517),\n (185.1492, 163.7527, 178.2412, 163.7527)\n]\n# (orient, text, p1, p2, base) for linear; (orient, text, center, radius, angle) for diameter\nDIMENSIONS = [\n ('horizontal', '19.7674', (115.4487, 166.9522), (101.8508, 166.9522), (108.6498, 155.9522)),\n ('horizontal', '20.9302', (164.2412, 139.7564), (149.8434, 139.7564), (157.0423, 128.7564)),\n ('horizontal', '39.5349', (146.6439, 98.1628), (119.4481, 98.1628), (133.046, 87.1628)),\n ('horizontal', '50', (115.4487, 84.5649), (149.8434, 84.5649), (132.6461, 95.5649)),\n ('vertical', '55.814', (149.8434, 139.7564), (149.8434, 101.3623), (160.8434, 120.5593)),\n ('vertical', '60.4651', (164.2412, 98.1628), (164.2412, 139.7564), (153.2412, 118.9596)),\n ('vertical', '95.3488', (115.4487, 101.3623), (115.4487, 166.9522), (104.4487, 134.1573)),\n ('vertical', '100', (101.8508, 166.9522), (101.8508, 98.1628), (112.8508, 132.5575)),\n ('diameter', '%%c9.3023', (109.0497, 132.5575), 3.1995, 45),\n ('horizontal', '10.4651', (101.8508, 132.5575), (109.0497, 132.5575), (105.4502, 143.5575)),\n ('vertical', '69.7675', (109.0497, 84.5649), (109.0497, 132.5575), (98.0497, 108.5612)),\n ('diameter', '%%c9.3023', (109.0497, 166.9522), 3.1995, 45),\n ('horizontal', '10.4651', (101.8508, 166.9522), (109.0497, 166.9522), (105.4502, 177.9522)),\n ('vertical', '119.767', (109.0497, 84.5649), (109.0497, 166.9522), (98.0497, 125.7586)),\n ('horizontal', '2.3256', (156.2424, 94.9633), (157.8422, 94.9633), (157.0423, 105.9633)),\n ('vertical', '30.2326', (156.2424, 94.9633), (156.2424, 115.7601), (145.2424, 105.3617)),\n ('horizontal', '79.0698', (101.8508, 94.9633), (156.2424, 94.9633), (129.0466, 105.9633)),\n ('vertical', '15.1163', (156.2424, 84.5649), (156.2424, 94.9633), (145.2424, 89.7641)),\n ('radius', 'R19.7674', (115.4487, 98.1628), 13.5979, 45),\n ('radius', 'R20.3571', (150.2434, 98.5628), 14.0035, 45),\n ('radius', 'R10.4651', (157.0423, 139.7564), 7.1989, 45),\n ('radius', 'R4.6512', (146.6439, 101.3623), 3.1995, 45),\n ('radius', 'R5.2648', (119.0481, 101.7622), 3.6216, 45),\n ('radius', 'R9.8837', (108.6497, 166.9522), 6.7989, 45),\n ('horizontal', '10.0423', (178.2412, 98.1628), (185.1492, 98.1628), (181.6952, 109.1628))\n]\n\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; _ds.dxf.dimasz = 2.5\n _ds.dxf.dimexe = 1.25; _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\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\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,\n angle=(0 if d[0] == \"horizontal\" else 90),\n 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,\n 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,\n 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,\n text=text, dimstyle=\"EZDXF\").render()\n\n doc.saveas(out_path)\n\n\nif __name__ == \"__main__\":\n out = sys.argv[1] if len(sys.argv) > 1 else \"0094_00944505_gt.dxf\"\n draw(out)\n print(\"wrote\", out)\n```"}], "images": ["images/0094_00944505.png"], "id": "0094_00944505"} {"messages": [{"role": "user", "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 71.58 mm tall, featuring 4 polygonal cutouts. It is extruded to a thickness of -3.65 mm."}, {"role": "assistant", "content": "```python\n#!/usr/bin/env python3\n# -*- coding: utf-8 -*-\n# Ground-truth 2D engineering drawing for part: 0094_00947512\n# Self-contained: reproduces the three-view DXF via ezdxf, NO FreeCAD needed.\n# Coordinates are A4 page millimetres (scale=1.277504555061591, page=[297.0, 210.0]).\n# visible edges -> solid (layer OUTLINE); hidden edges -> dashed (layer HIDDEN)\n# dimensions -> real movable DIMENSION entities (text = true mm value)\n# Run: python 0094_00947512_gt.py [out.dxf]\nimport sys\nimport ezdxf\nimport math\n\nSCALE = 1.277504555061591\nPAGE = [297.0, 210.0]\n\nVISIBLE_SEGMENTS = [\n (198.046437, 172.049971, 198.046437, 80.60754),\n (198.046437, 80.60754, 70.295981, 80.60754),\n (70.295981, 80.60754, 70.295981, 172.049971),\n (70.295981, 172.049971, 198.046437, 172.049971),\n (93.156589, 153.223588, 85.088139, 153.223588),\n (85.088139, 162.636779, 93.156589, 162.636779),\n (93.156589, 90.020731, 85.088139, 90.020731),\n (85.088139, 99.433922, 93.156589, 99.433922),\n (183.254279, 153.223588, 175.185829, 153.223588),\n (175.185829, 162.636779, 183.254279, 162.636779),\n (183.254279, 90.020731, 175.185829, 90.020731),\n (175.185829, 99.433922, 183.254279, 99.433922),\n (198.046437, 66.60754, 198.046437, 61.949971),\n (198.046437, 61.949971, 70.295981, 61.949971),\n (70.295981, 66.60754, 70.295981, 61.949971),\n (198.046437, 66.60754, 70.295981, 66.60754),\n (216.704005, 80.60754, 212.046437, 80.60754),\n (212.046437, 80.60754, 212.046437, 172.049971),\n (216.704005, 172.049971, 212.046437, 172.049971),\n (216.704005, 80.60754, 216.704005, 172.049971)\n]\nVISIBLE_CIRCLES = [\n\n]\nVISIBLE_ARCS = [\n (85.088139, 157.930184, 4.706596, 90.0, -90.0),\n (93.156589, 157.930184, 4.706596, -90.0, 90.0),\n (85.088139, 94.727327, 4.706596, 90.0, -90.0),\n (93.156589, 94.727327, 4.706596, -90.0, 90.0),\n (175.185829, 157.930184, 4.706596, 90.0, -90.0),\n (183.254279, 157.930184, 4.706596, -90.0, 90.0),\n (175.185829, 94.727327, 4.706596, 90.0, -90.0),\n (183.254279, 94.727327, 4.706596, -90.0, 90.0)\n]\nHIDDEN_SEGMENTS = [\n (80.3816, 66.6076, 80.3816, 61.95),\n (97.8632, 66.6076, 97.8632, 61.95),\n (170.4792, 66.6076, 170.4792, 61.95),\n (187.9609, 66.6076, 187.9609, 61.95),\n (216.704, 99.434, 212.0464, 99.434),\n (216.704, 90.0208, 212.0464, 90.0208),\n (216.704, 162.6368, 212.0464, 162.6368),\n (216.704, 153.2236, 212.0464, 153.2236)\n]\n# (orient, text, p1, p2, base) for linear; (orient, text, center, radius, angle) for diameter\nDIMENSIONS = [\n ('horizontal', '100', (198.0464, 172.0499), (70.296, 172.0499), (134.1712, 161.0499)),\n ('vertical', '71.5789', (198.0464, 80.6076), (198.0464, 172.0499), (187.0464, 126.3288)),\n ('horizontal', '6.3158', (85.0881, 90.0207), (93.1565, 90.0207), (89.1223, 101.0207)),\n ('vertical', '7.3684', (85.0881, 90.0207), (85.0881, 99.4339), (74.0881, 94.7273)),\n ('horizontal', '11.5789', (70.296, 90.0207), (85.0881, 90.0207), (77.692, 101.0207)),\n ('vertical', '7.3684', (85.0881, 80.6076), (85.0881, 90.0207), (74.0881, 85.3142)),\n ('horizontal', '6.3158', (85.0881, 153.2236), (93.1565, 153.2236), (89.1223, 164.2236)),\n ('vertical', '7.3684', (85.0881, 153.2236), (85.0881, 162.6368), (74.0881, 157.9302)),\n ('horizontal', '11.5789', (70.296, 153.2236), (85.0881, 153.2236), (77.692, 164.2236)),\n ('vertical', '56.8421', (85.0881, 80.6076), (85.0881, 153.2236), (74.0881, 116.9156)),\n ('horizontal', '6.3158', (175.1859, 90.0207), (183.2543, 90.0207), (179.2201, 101.0207)),\n ('vertical', '7.3684', (175.1859, 90.0207), (175.1859, 99.4339), (164.1859, 94.7273)),\n ('horizontal', '82.1053', (70.296, 90.0207), (175.1859, 90.0207), (122.7409, 101.0207)),\n ('vertical', '7.3684', (175.1859, 80.6076), (175.1859, 90.0207), (164.1859, 85.3142)),\n ('horizontal', '6.3158', (175.1859, 153.2236), (183.2543, 153.2236), (179.2201, 164.2236)),\n ('vertical', '7.3684', (175.1859, 153.2236), (175.1859, 162.6368), (164.1859, 157.9302)),\n ('horizontal', '82.1053', (70.296, 153.2236), (175.1859, 153.2236), (122.7409, 164.2236)),\n ('vertical', '56.8421', (175.1859, 80.6076), (175.1859, 153.2236), (164.1859, 116.9156)),\n ('radius', 'R3.6842', (93.1565, 94.7273), 4.7066, 45),\n ('horizontal', '3.6458', (216.704, 80.6076), (212.0465, 80.6076), (214.3752, 69.6076))\n]\n\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; _ds.dxf.dimasz = 2.5\n _ds.dxf.dimexe = 1.25; _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\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\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,\n angle=(0 if d[0] == \"horizontal\" else 90),\n 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,\n 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,\n 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,\n text=text, dimstyle=\"EZDXF\").render()\n\n doc.saveas(out_path)\n\n\nif __name__ == \"__main__\":\n out = sys.argv[1] if len(sys.argv) > 1 else \"0094_00947512_gt.dxf\"\n draw(out)\n print(\"wrote\", out)\n```"}], "images": ["images/0094_00947512.png"], "id": "0094_00947512"} {"messages": [{"role": "user", "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 71.58 mm. It is extruded to a thickness of 43.33 mm. The outline includes one or more oblique (angled) edges."}, {"role": "assistant", "content": "```python\n#!/usr/bin/env python3\n# -*- coding: utf-8 -*-\n# Ground-truth 2D engineering drawing for part: 0094_00948124\n# Self-contained: reproduces the three-view DXF via ezdxf, NO FreeCAD needed.\n# Coordinates are A4 page millimetres (scale=0.6704651162790368, page=[297.0, 210.0]).\n# visible edges -> solid (layer OUTLINE); hidden edges -> dashed (layer HIDDEN)\n# dimensions -> real movable DIMENSION entities (text = true mm value)\n# Run: python 0094_00948124_gt.py [out.dxf]\nimport sys\nimport ezdxf\nimport math\n\nSCALE = 0.6704651162790368\nPAGE = [297.0, 210.0]\n\nVISIBLE_SEGMENTS = [\n (108.211045, 172.049985, 135.735402, 172.049985),\n (155.496479, 151.583155, 155.496479, 105.003473),\n (155.496479, 105.003473, 88.449968, 105.003473),\n (88.449968, 105.003473, 88.449968, 151.583155),\n (88.449968, 61.949985, 89.067501, 61.949985),\n (89.067501, 61.949985, 89.685035, 61.949985),\n (89.685035, 61.949985, 90.302569, 61.949985),\n (90.302569, 61.949985, 90.920102, 61.949985),\n (90.920102, 61.949985, 91.537636, 61.949985),\n (91.537636, 61.949985, 92.15517, 61.949985),\n (92.15517, 61.949985, 92.772703, 61.949985),\n (92.772703, 61.949985, 93.390237, 61.949985),\n (93.390237, 61.949985, 94.007771, 61.949985),\n (94.007771, 61.949985, 94.625304, 61.949985),\n (94.625304, 61.949985, 95.242838, 61.949985),\n (95.242838, 61.949985, 95.860372, 61.949985),\n (95.860372, 61.949985, 96.477905, 61.949985),\n (96.477905, 61.949985, 97.095439, 61.949985),\n (97.095439, 61.949985, 97.712973, 61.949985),\n (97.712973, 61.949985, 98.330506, 61.949985),\n (98.330506, 61.949985, 98.94804, 61.949985),\n (98.94804, 61.949985, 99.565574, 61.949985),\n (99.565574, 61.949985, 100.183107, 61.949985),\n (100.183107, 61.949985, 100.800641, 61.949985),\n (100.800641, 61.949985, 101.418175, 61.949985),\n (101.418175, 61.949985, 102.035708, 61.949985),\n (102.035708, 61.949985, 102.653242, 61.949985),\n (102.653242, 61.949985, 103.270776, 61.949985),\n (103.270776, 61.949985, 103.888309, 61.949985),\n (103.888309, 61.949985, 104.505843, 61.949985),\n (104.505843, 61.949985, 105.123377, 61.949985),\n (105.123377, 61.949985, 105.74091, 61.949985),\n (105.74091, 61.949985, 106.358444, 61.949985),\n (106.358444, 61.949985, 106.975978, 61.949985),\n (106.975978, 61.949985, 107.593511, 61.949985),\n (107.593511, 61.949985, 108.211045, 61.949985),\n (108.211045, 61.949985, 108.211045, 91.003473),\n (88.449968, 91.003473, 89.067501, 91.003473),\n (89.067501, 91.003473, 89.685035, 91.003473),\n (89.685035, 91.003473, 90.302569, 91.003473),\n (90.302569, 91.003473, 90.920102, 91.003473),\n (90.920102, 91.003473, 91.537636, 91.003473),\n (91.537636, 91.003473, 92.15517, 91.003473),\n (92.15517, 91.003473, 92.772703, 91.003473),\n (92.772703, 91.003473, 93.390237, 91.003473),\n (93.390237, 91.003473, 94.007771, 91.003473),\n (94.007771, 91.003473, 94.625304, 91.003473),\n (94.625304, 91.003473, 95.242838, 91.003473),\n (95.242838, 91.003473, 95.860372, 91.003473),\n (95.860372, 91.003473, 96.477905, 91.003473),\n (96.477905, 91.003473, 97.095439, 91.003473),\n (97.095439, 91.003473, 97.712973, 91.003473),\n (97.712973, 91.003473, 98.330506, 91.003473),\n (98.330506, 91.003473, 98.94804, 91.003473),\n (98.94804, 91.003473, 99.565574, 91.003473),\n (99.565574, 91.003473, 100.183107, 91.003473),\n (100.183107, 91.003473, 100.800641, 91.003473),\n (100.800641, 91.003473, 101.418175, 91.003473),\n (101.418175, 91.003473, 102.035708, 91.003473),\n (102.035708, 91.003473, 102.653242, 91.003473),\n (102.653242, 91.003473, 103.270776, 91.003473),\n (103.270776, 91.003473, 103.888309, 91.003473),\n (103.888309, 91.003473, 104.505843, 91.003473),\n (104.505843, 91.003473, 105.123377, 91.003473),\n (105.123377, 91.003473, 105.74091, 91.003473),\n (105.74091, 91.003473, 106.358444, 91.003473),\n (106.358444, 91.003473, 106.975978, 91.003473),\n (106.975978, 91.003473, 107.593511, 91.003473),\n (107.593511, 91.003473, 108.211045, 91.003473),\n (88.449968, 61.949985, 88.449968, 91.003473),\n (108.211045, 91.003473, 135.735402, 91.003473),\n (135.735402, 61.949985, 135.735402, 91.003473),\n (108.211045, 61.949985, 135.735402, 61.949985),\n (135.735402, 61.949985, 136.352936, 61.949985),\n (136.352936, 61.949985, 136.97047, 61.949985),\n (136.97047, 61.949985, 137.588003, 61.949985),\n (137.588003, 61.949985, 138.205537, 61.949985),\n (138.205537, 61.949985, 138.823071, 61.949985),\n (138.823071, 61.949985, 139.440604, 61.949985),\n (139.440604, 61.949985, 140.058138, 61.949985),\n (140.058138, 61.949985, 140.675672, 61.949985),\n (140.675672, 61.949985, 141.293205, 61.949985),\n (141.293205, 61.949985, 141.910739, 61.949985),\n (141.910739, 61.949985, 142.528273, 61.949985),\n (142.528273, 61.949985, 143.145806, 61.949985),\n (143.145806, 61.949985, 143.76334, 61.949985),\n (143.76334, 61.949985, 144.380874, 61.949985),\n (144.380874, 61.949985, 144.998407, 61.949985),\n (144.998407, 61.949985, 145.615941, 61.949985),\n (145.615941, 61.949985, 146.233475, 61.949985),\n (146.233475, 61.949985, 146.851008, 61.949985),\n (146.851008, 61.949985, 147.468542, 61.949985),\n (147.468542, 61.949985, 148.086076, 61.949985),\n (148.086076, 61.949985, 148.703609, 61.949985),\n (148.703609, 61.949985, 149.321143, 61.949985),\n (149.321143, 61.949985, 149.938676, 61.949985),\n (149.938676, 61.949985, 150.55621, 61.949985),\n (150.55621, 61.949985, 151.173744, 61.949985),\n (151.173744, 61.949985, 151.791277, 61.949985),\n (151.791277, 61.949985, 152.408811, 61.949985),\n (152.408811, 61.949985, 153.026345, 61.949985),\n (153.026345, 61.949985, 153.643878, 61.949985),\n (153.643878, 61.949985, 154.261412, 61.949985),\n (154.261412, 61.949985, 154.878946, 61.949985),\n (154.878946, 61.949985, 155.496479, 61.949985),\n (155.496479, 61.949985, 155.496479, 91.003473),\n (135.735402, 91.003473, 136.352936, 91.003473),\n (136.352936, 91.003473, 136.97047, 91.003473),\n (136.97047, 91.003473, 137.588003, 91.003473),\n (137.588003, 91.003473, 138.205537, 91.003473),\n (138.205537, 91.003473, 138.823071, 91.003473),\n (138.823071, 91.003473, 139.440604, 91.003473),\n (139.440604, 91.003473, 140.058138, 91.003473),\n (140.058138, 91.003473, 140.675672, 91.003473),\n (140.675672, 91.003473, 141.293205, 91.003473),\n (141.293205, 91.003473, 141.910739, 91.003473),\n (141.910739, 91.003473, 142.528273, 91.003473),\n (142.528273, 91.003473, 143.145806, 91.003473),\n (143.145806, 91.003473, 143.76334, 91.003473),\n (143.76334, 91.003473, 144.380874, 91.003473),\n (144.380874, 91.003473, 144.998407, 91.003473),\n (144.998407, 91.003473, 145.615941, 91.003473),\n (145.615941, 91.003473, 146.233475, 91.003473),\n (146.233475, 91.003473, 146.851008, 91.003473),\n (146.851008, 91.003473, 147.468542, 91.003473),\n (147.468542, 91.003473, 148.086076, 91.003473),\n (148.086076, 91.003473, 148.703609, 91.003473),\n (148.703609, 91.003473, 149.321143, 91.003473),\n (149.321143, 91.003473, 149.938676, 91.003473),\n (149.938676, 91.003473, 150.55621, 91.003473),\n (150.55621, 91.003473, 151.173744, 91.003473),\n (151.173744, 91.003473, 151.791277, 91.003473),\n (151.791277, 91.003473, 152.408811, 91.003473),\n (152.408811, 91.003473, 153.026345, 91.003473),\n (153.026345, 91.003473, 153.643878, 91.003473),\n (153.643878, 91.003473, 154.261412, 91.003473),\n (154.261412, 91.003473, 154.878946, 91.003473),\n (154.878946, 91.003473, 155.496479, 91.003473),\n (198.549968, 151.583155, 198.549968, 152.222744),\n (198.549968, 152.222744, 198.549968, 152.862332),\n (198.549968, 152.862332, 198.549968, 153.50192),\n (198.549968, 153.50192, 198.549968, 154.141509),\n (198.549968, 154.141509, 198.549968, 154.781097),\n (198.549968, 154.781097, 198.549968, 155.420686),\n (198.549968, 155.420686, 198.549968, 156.060274),\n (198.549968, 156.060274, 198.549968, 156.699863),\n (198.549968, 156.699863, 198.549968, 157.339451),\n (198.549968, 157.339451, 198.549968, 157.979039),\n (198.549968, 157.979039, 198.549968, 158.618628),\n (198.549968, 158.618628, 198.549968, 159.258216),\n (198.549968, 159.258216, 198.549968, 159.897805),\n (198.549968, 159.897805, 198.549968, 160.537393),\n (198.549968, 160.537393, 198.549968, 161.176982),\n (198.549968, 161.176982, 198.549968, 161.81657),\n (198.549968, 161.81657, 198.549968, 162.456158),\n (198.549968, 162.456158, 198.549968, 163.095747),\n (198.549968, 163.095747, 198.549968, 163.735335),\n (198.549968, 163.735335, 198.549968, 164.374924),\n (198.549968, 164.374924, 198.549968, 165.014512),\n (198.549968, 165.014512, 198.549968, 165.654101),\n (198.549968, 165.654101, 198.549968, 166.293689),\n (198.549968, 166.293689, 198.549968, 166.933277),\n (198.549968, 166.933277, 198.549968, 167.572866),\n (198.549968, 167.572866, 198.549968, 168.212454),\n (198.549968, 168.212454, 198.549968, 168.852043),\n (198.549968, 168.852043, 198.549968, 169.491631),\n (198.549968, 169.491631, 198.549968, 170.13122),\n (198.549968, 170.13122, 198.549968, 170.770808),\n (198.549968, 170.770808, 198.549968, 171.410397),\n (198.549968, 171.410397, 198.549968, 172.049985),\n (198.549968, 172.049985, 169.49648, 172.049985),\n (169.49648, 151.583155, 169.49648, 152.222744),\n (169.49648, 152.222744, 169.49648, 152.862332),\n (169.49648, 152.862332, 169.49648, 153.50192),\n (169.49648, 153.50192, 169.49648, 154.141509),\n (169.49648, 154.141509, 169.49648, 154.781097),\n (169.49648, 154.781097, 169.49648, 155.420686),\n (169.49648, 155.420686, 169.49648, 156.060274),\n (169.49648, 156.060274, 169.49648, 156.699863),\n (169.49648, 156.699863, 169.49648, 157.339451),\n (169.49648, 157.339451, 169.49648, 157.979039),\n (169.49648, 157.979039, 169.49648, 158.618628),\n (169.49648, 158.618628, 169.49648, 159.258216),\n (169.49648, 159.258216, 169.49648, 159.897805),\n (169.49648, 159.897805, 169.49648, 160.537393),\n (169.49648, 160.537393, 169.49648, 161.176982),\n (169.49648, 161.176982, 169.49648, 161.81657),\n (169.49648, 161.81657, 169.49648, 162.456158),\n (169.49648, 162.456158, 169.49648, 163.095747),\n (169.49648, 163.095747, 169.49648, 163.735335),\n (169.49648, 163.735335, 169.49648, 164.374924),\n (169.49648, 164.374924, 169.49648, 165.014512),\n (169.49648, 165.014512, 169.49648, 165.654101),\n (169.49648, 165.654101, 169.49648, 166.293689),\n (169.49648, 166.293689, 169.49648, 166.933277),\n (169.49648, 166.933277, 169.49648, 167.572866),\n (169.49648, 167.572866, 169.49648, 168.212454),\n (169.49648, 168.212454, 169.49648, 168.852043),\n (169.49648, 168.852043, 169.49648, 169.491631),\n (169.49648, 169.491631, 169.49648, 170.13122),\n (169.49648, 170.13122, 169.49648, 170.770808),\n (169.49648, 170.770808, 169.49648, 171.410397),\n (169.49648, 171.410397, 169.49648, 172.049985),\n (198.549968, 151.583155, 169.49648, 151.583155),\n (198.549968, 105.003473, 169.49648, 105.003473),\n (169.49648, 105.003473, 169.49648, 151.583155),\n (198.549968, 105.003473, 198.549968, 151.583155)\n]\nVISIBLE_CIRCLES = [\n (122.3261, 137.4681, 23.995594)\n]\nVISIBLE_ARCS = [\n (114.938288, 145.78147, 27.116243, 104.364461, 167.645711),\n (130.300553, 147.029299, 25.604146, 10.244914, 77.744914)\n]\nHIDDEN_SEGMENTS = [\n (146.3217, 61.95, 146.3217, 91.0035),\n (98.3305, 91.0035, 98.3305, 61.95),\n (169.4965, 113.4725, 198.55, 113.4725),\n (169.4965, 161.4637, 198.55, 161.4637)\n]\n# (orient, text, p1, p2, base) for linear; (orient, text, center, radius, angle) for diameter\nDIMENSIONS = [\n ('horizontal', '41.0526', (108.2111, 172.05), (135.7354, 172.05), (121.9733, 183.05)),\n ('horizontal', '100', (155.4965, 105.0035), (88.45, 105.0035), (121.9733, 94.0035)),\n ('vertical', '69.4737', (155.4965, 151.5832), (155.4965, 105.0035), (166.4965, 128.2933)),\n ('diameter', '%%c71.5789', (122.3261, 137.4681), 23.9956, 45),\n ('horizontal', '50.5263', (88.45, 137.4681), (122.3261, 137.4681), (105.3881, 148.4681)),\n ('vertical', '51.5789', (122.3261, 172.05), (122.3261, 137.4681), (133.3261, 154.7591)),\n ('radius', 'R40.4439', (114.9383, 145.7815), 27.1162, 45),\n ('radius', 'R38.1886', (130.3006, 147.0293), 25.6041, 45),\n ('horizontal', '43.3333', (198.55, 151.5832), (169.4965, 151.5832), (184.0233, 140.5832))\n]\n\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; _ds.dxf.dimasz = 2.5\n _ds.dxf.dimexe = 1.25; _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\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\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,\n angle=(0 if d[0] == \"horizontal\" else 90),\n 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,\n 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,\n 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,\n text=text, dimstyle=\"EZDXF\").render()\n\n doc.saveas(out_path)\n\n\nif __name__ == \"__main__\":\n out = sys.argv[1] if len(sys.argv) > 1 else \"0094_00948124_gt.dxf\"\n draw(out)\n print(\"wrote\", out)\n```"}], "images": ["images/0094_00948124.png"], "id": "0094_00948124"} {"messages": [{"role": "user", "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 63.16 x 100 mm bounding box, featuring a rectangular cutout 80.26 x 21.05 mm. It is extruded to a thickness of 62.5 mm."}, {"role": "assistant", "content": "```python\n#!/usr/bin/env python3\n# -*- coding: utf-8 -*-\n# Ground-truth 2D engineering drawing for part: 0095_00952449\n# Self-contained: reproduces the three-view DXF via ezdxf, NO FreeCAD needed.\n# Coordinates are A4 page millimetres (scale=0.5913846153846481, page=[297.0, 210.0]).\n# visible edges -> solid (layer OUTLINE); hidden edges -> dashed (layer HIDDEN)\n# dimensions -> real movable DIMENSION entities (text = true mm value)\n# Run: python 0095_00952449_gt.py [out.dxf]\nimport sys\nimport ezdxf\nimport math\n\nSCALE = 0.5913846153846481\nPAGE = [297.0, 210.0]\n\nVISIBLE_SEGMENTS = [\n (118.408305, 169.715608, 118.408305, 172.050021),\n (118.408305, 172.050021, 154.980775, 172.050021),\n (154.980775, 172.050021, 154.980775, 112.911559),\n (154.980775, 112.911559, 118.408305, 112.911559),\n (118.408305, 112.911559, 118.408305, 115.245972),\n (118.408305, 115.245972, 81.057698, 115.245972),\n (81.057698, 115.245972, 81.057698, 169.715608),\n (81.057698, 169.715608, 118.408305, 169.715608),\n (141.752435, 136.255689, 94.286038, 136.255689),\n (94.286038, 148.705891, 141.752435, 148.705891),\n (154.980775, 61.950021, 154.980775, 98.911559),\n (154.980775, 98.911559, 118.408305, 98.911559),\n (118.408305, 61.950021, 118.408305, 98.911559),\n (154.980775, 61.950021, 118.408305, 61.950021),\n (118.408305, 98.911559, 81.057698, 98.911559),\n (81.057698, 61.950021, 81.057698, 98.911559),\n (118.408305, 61.950021, 81.057698, 61.950021),\n (205.942313, 169.715608, 205.942313, 172.050021),\n (168.980775, 172.050021, 205.942313, 172.050021),\n (168.980775, 169.715608, 168.980775, 172.050021),\n (168.980775, 112.911559, 205.942313, 112.911559),\n (205.942313, 112.911559, 205.942313, 115.245972),\n (168.980775, 112.911559, 168.980775, 115.245972),\n (168.980775, 115.245972, 205.942313, 115.245972),\n (205.942313, 115.245972, 205.942313, 169.715608),\n (168.980775, 169.715608, 205.942313, 169.715608),\n (168.980775, 115.245972, 168.980775, 169.715608)\n]\nVISIBLE_CIRCLES = [\n\n]\nVISIBLE_ARCS = [\n (94.286038, 142.48079, 6.225101, 90.0, -90.0),\n (141.752435, 142.48079, 6.225101, -90.0, 90.0)\n]\nHIDDEN_SEGMENTS = [\n (88.0609, 61.95, 88.0609, 98.9115),\n (147.9775, 61.95, 147.9775, 98.9115),\n (168.9808, 136.2557, 205.9423, 136.2557),\n (168.9808, 148.7059, 205.9423, 148.7059)\n]\n# (orient, text, p1, p2, base) for linear; (orient, text, center, radius, angle) for diameter\nDIMENSIONS = [\n ('horizontal', '61.8421', (118.4083, 112.9115), (154.9808, 112.9115), (136.6945, 123.9115)),\n ('horizontal', '63.1579', (118.4083, 169.7156), (81.0577, 169.7156), (99.733, 158.7156)),\n ('vertical', '3.9474', (118.4083, 115.246), (118.4083, 112.9115), (129.4083, 114.0787)),\n ('vertical', '92.1053', (81.0577, 169.7156), (81.0577, 115.246), (92.0577, 142.4808)),\n ('vertical', '100', (154.9808, 112.9115), (154.9808, 172.05), (143.9808, 142.4808)),\n ('horizontal', '80.2632', (94.286, 136.2557), (141.7524, 136.2557), (118.0192, 147.2557)),\n ('vertical', '21.0526', (94.286, 136.2557), (94.286, 148.7059), (83.286, 142.4808)),\n ('horizontal', '22.3684', (81.0577, 136.2557), (94.286, 136.2557), (87.6719, 147.2557)),\n ('vertical', '39.4737', (94.286, 112.9115), (94.286, 136.2557), (83.286, 124.5836)),\n ('radius', 'R10.5263', (141.7524, 142.4808), 6.2251, 45),\n ('horizontal', '62.5', (168.9808, 115.246), (205.9423, 115.246), (187.4615, 126.246))\n]\n\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; _ds.dxf.dimasz = 2.5\n _ds.dxf.dimexe = 1.25; _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\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\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,\n angle=(0 if d[0] == \"horizontal\" else 90),\n 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,\n 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,\n 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,\n text=text, dimstyle=\"EZDXF\").render()\n\n doc.saveas(out_path)\n\n\nif __name__ == \"__main__\":\n out = sys.argv[1] if len(sys.argv) > 1 else \"0095_00952449_gt.dxf\"\n draw(out)\n print(\"wrote\", out)\n```"}], "images": ["images/0095_00952449.png"], "id": "0095_00952449"} {"messages": [{"role": "user", "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 4 circular holes, each of diameter 17.39 mm. It is extruded to a thickness of 8.83 mm. The outline includes one or more oblique (angled) edges."}, {"role": "assistant", "content": "```python\n#!/usr/bin/env python3\n# -*- coding: utf-8 -*-\n# Ground-truth 2D engineering drawing for part: 0096_00963003\n# Self-contained: reproduces the three-view DXF via ezdxf, NO FreeCAD needed.\n# Coordinates are A4 page millimetres (scale=0.9494450665443197, page=[297.0, 210.0]).\n# visible edges -> solid (layer OUTLINE); hidden edges -> dashed (layer HIDDEN)\n# dimensions -> real movable DIMENSION entities (text = true mm value)\n# Run: python 0096_00963003_gt.py [out.dxf]\nimport sys\nimport ezdxf\nimport math\n\nSCALE = 0.9494450665443197\nPAGE = [297.0, 210.0]\n\nVISIBLE_SEGMENTS = [\n (181.302989, 87.425532, 181.302989, 167.921962),\n (178.206973, 172.049984, 83.262466, 172.049984),\n (83.262466, 172.049984, 83.262466, 84.329516),\n (83.262466, 84.329516, 178.206973, 84.329516),\n (181.33966, 70.329516, 181.241764, 70.329516),\n (181.241764, 70.329516, 181.143867, 70.329516),\n (181.143867, 70.329516, 181.045971, 70.329516),\n (181.045971, 70.329516, 180.948074, 70.329516),\n (180.948074, 70.329516, 180.850178, 70.329516),\n (180.850178, 70.329516, 180.752281, 70.329516),\n (180.752281, 70.329516, 180.654385, 70.329516),\n (180.654385, 70.329516, 180.556488, 70.329516),\n (180.556488, 70.329516, 180.458592, 70.329516),\n (180.458592, 70.329516, 180.360695, 70.329516),\n (180.360695, 70.329516, 180.262799, 70.329516),\n (180.262799, 70.329516, 180.164902, 70.329516),\n (180.164902, 70.329516, 180.067006, 70.329516),\n (180.067006, 70.329516, 179.969109, 70.329516),\n (179.969109, 70.329516, 179.871213, 70.329516),\n (179.871213, 70.329516, 179.773316, 70.329516),\n (179.773316, 70.329516, 179.67542, 70.329516),\n (179.67542, 70.329516, 179.577523, 70.329516),\n (179.577523, 70.329516, 179.479627, 70.329516),\n (179.479627, 70.329516, 179.38173, 70.329516),\n (179.38173, 70.329516, 179.283834, 70.329516),\n (179.283834, 70.329516, 179.185938, 70.329516),\n (179.185938, 70.329516, 179.088041, 70.329516),\n (179.088041, 70.329516, 178.990145, 70.329516),\n (178.990145, 70.329516, 178.892248, 70.329516),\n (178.892248, 70.329516, 178.794352, 70.329516),\n (178.794352, 70.329516, 178.696455, 70.329516),\n (178.696455, 70.329516, 178.598559, 70.329516),\n (178.598559, 70.329516, 178.500662, 70.329516),\n (178.500662, 70.329516, 178.402766, 70.329516),\n (178.402766, 70.329516, 178.304869, 70.329516),\n (178.304869, 70.329516, 178.206973, 70.329516),\n (178.206973, 70.329516, 178.206973, 61.949984),\n (181.33966, 61.949984, 181.241764, 61.949984),\n (181.241764, 61.949984, 181.143867, 61.949984),\n (181.143867, 61.949984, 181.045971, 61.949984),\n (181.045971, 61.949984, 180.948074, 61.949984),\n (180.948074, 61.949984, 180.850178, 61.949984),\n (180.850178, 61.949984, 180.752281, 61.949984),\n (180.752281, 61.949984, 180.654385, 61.949984),\n (180.654385, 61.949984, 180.556488, 61.949984),\n (180.556488, 61.949984, 180.458592, 61.949984),\n (180.458592, 61.949984, 180.360695, 61.949984),\n (180.360695, 61.949984, 180.262799, 61.949984),\n (180.262799, 61.949984, 180.164902, 61.949984),\n (180.164902, 61.949984, 180.067006, 61.949984),\n (180.067006, 61.949984, 179.969109, 61.949984),\n (179.969109, 61.949984, 179.871213, 61.949984),\n (179.871213, 61.949984, 179.773316, 61.949984),\n (179.773316, 61.949984, 179.67542, 61.949984),\n (179.67542, 61.949984, 179.577523, 61.949984),\n (179.577523, 61.949984, 179.479627, 61.949984),\n (179.479627, 61.949984, 179.38173, 61.949984),\n (179.38173, 61.949984, 179.283834, 61.949984),\n (179.283834, 61.949984, 179.185938, 61.949984),\n (179.185938, 61.949984, 179.088041, 61.949984),\n (179.088041, 61.949984, 178.990145, 61.949984),\n (178.990145, 61.949984, 178.892248, 61.949984),\n (178.892248, 61.949984, 178.794352, 61.949984),\n (178.794352, 61.949984, 178.696455, 61.949984),\n (178.696455, 61.949984, 178.598559, 61.949984),\n (178.598559, 61.949984, 178.500662, 61.949984),\n (178.500662, 61.949984, 178.402766, 61.949984),\n (178.402766, 61.949984, 178.304869, 61.949984),\n (178.304869, 61.949984, 178.206973, 61.949984),\n (178.206973, 61.949984, 83.262466, 61.949984),\n (83.262466, 70.329516, 83.262466, 61.949984),\n (178.206973, 70.329516, 83.262466, 70.329516),\n (181.33966, 61.949984, 181.33966, 70.329516),\n (195.33966, 172.049984, 203.719192, 172.049984),\n (203.719192, 172.049984, 203.719192, 84.329516),\n (195.33966, 84.329516, 203.719192, 84.329516),\n (195.33966, 172.049984, 195.33966, 84.329516)\n]\nVISIBLE_CIRCLES = [\n (100.80656, 103.937621, 8.256044),\n (100.80656, 152.441879, 8.256044),\n (153.43884, 149.345863, 8.256044),\n (153.43884, 107.033637, 8.256044)\n]\nVISIBLE_ARCS = [\n (178.206973, 87.425532, 3.096017, -90.0, -0.0),\n (177.69097, 168.437965, 3.64869, -8.130102, 81.869898)\n]\nHIDDEN_SEGMENTS = [\n (109.0626, 70.3295, 109.0626, 61.95),\n (161.6949, 70.3295, 161.6949, 61.95),\n (92.5505, 61.95, 92.5505, 70.3295),\n (145.1828, 61.95, 145.1828, 70.3295),\n (195.3397, 167.922, 203.7192, 167.922),\n (203.7192, 112.1937, 195.3397, 112.1937),\n (203.7192, 95.6816, 195.3397, 95.6816),\n (203.7192, 160.6979, 195.3397, 160.6979),\n (203.7192, 144.1859, 195.3397, 144.1859),\n (203.7192, 157.6019, 195.3397, 157.6019),\n (203.7192, 141.0898, 195.3397, 141.0898),\n (203.7192, 115.2897, 195.3397, 115.2897),\n (203.7192, 98.7776, 195.3397, 98.7776)\n]\n# (orient, text, p1, p2, base) for linear; (orient, text, center, radius, angle) for diameter\nDIMENSIONS = [\n ('horizontal', '100', (178.207, 172.05), (83.2625, 172.05), (130.7347, 161.05)),\n ('vertical', '84.7826', (181.303, 87.4255), (181.303, 167.922), (170.303, 127.6738)),\n ('vertical', '92.3913', (83.2625, 172.05), (83.2625, 84.3296), (94.2625, 128.1898)),\n ('diameter', '%%c17.3913', (100.8066, 103.9377), 8.256, 45),\n ('horizontal', '18.4783', (83.2625, 103.9377), (100.8066, 103.9377), (92.0345, 114.9377)),\n ('vertical', '20.6522', (100.8066, 84.3296), (100.8066, 103.9377), (89.8066, 94.1336)),\n ('diameter', '%%c17.3913', (100.8066, 152.4419), 8.256, 45),\n ('horizontal', '18.4783', (83.2625, 152.4419), (100.8066, 152.4419), (92.0345, 163.4419)),\n ('vertical', '71.7391', (100.8066, 84.3296), (100.8066, 152.4419), (89.8066, 118.3857)),\n ('diameter', '%%c17.3913', (153.4388, 149.3458), 8.256, 45),\n ('horizontal', '73.913', (83.2625, 149.3458), (153.4388, 149.3458), (118.3506, 160.3458)),\n ('vertical', '68.4782', (153.4388, 84.3296), (153.4388, 149.3458), (142.4388, 116.8377)),\n ('diameter', '%%c17.3913', (153.4388, 107.0336), 8.256, 45),\n ('horizontal', '73.913', (83.2625, 107.0336), (153.4388, 107.0336), (118.3506, 118.0336)),\n ('vertical', '23.913', (153.4388, 84.3296), (153.4388, 107.0336), (142.4388, 95.6816)),\n ('radius', 'R3.2609', (178.207, 87.4255), 3.096, 45),\n ('radius', 'R3.843', (177.691, 168.4379), 3.6487, 45),\n ('horizontal', '8.8257', (195.3397, 84.3296), (203.7192, 84.3296), (199.5294, 95.3296))\n]\n\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; _ds.dxf.dimasz = 2.5\n _ds.dxf.dimexe = 1.25; _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\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\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,\n angle=(0 if d[0] == \"horizontal\" else 90),\n 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,\n 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,\n 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,\n text=text, dimstyle=\"EZDXF\").render()\n\n doc.saveas(out_path)\n\n\nif __name__ == \"__main__\":\n out = sys.argv[1] if len(sys.argv) > 1 else \"0096_00963003_gt.dxf\"\n draw(out)\n print(\"wrote\", out)\n```"}], "images": ["images/0096_00963003.png"], "id": "0096_00963003"} {"messages": [{"role": "user", "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 93.68 x 93.68 mm. It is extruded to a thickness of 10.45 mm. The outline includes one or more oblique (angled) edges."}, {"role": "assistant", "content": "```python\n#!/usr/bin/env python3\n# -*- coding: utf-8 -*-\n# Ground-truth 2D engineering drawing for part: 0097_00970411\n# Self-contained: reproduces the three-view DXF via ezdxf, NO FreeCAD needed.\n# Coordinates are A4 page millimetres (scale=0.8957043490993387, page=[297.0, 210.0]).\n# visible edges -> solid (layer OUTLINE); hidden edges -> dashed (layer HIDDEN)\n# dimensions -> real movable DIMENSION entities (text = true mm value)\n# Run: python 0097_00970411_gt.py [out.dxf]\nimport sys\nimport ezdxf\nimport math\n\nSCALE = 0.8957043490993387\nPAGE = [297.0, 210.0]\n\nVISIBLE_SEGMENTS = [\n (95.52135, 85.308105, 168.120545, 85.308105),\n (87.03573, 172.05, 95.52135, 85.308105),\n (168.120545, 85.308105, 176.606165, 172.05),\n (171.99926, 152.26569, 173.777625, 172.05),\n (89.86427, 172.05, 91.921137, 151.709872),\n (87.03573, 71.308105, 87.03573, 61.95),\n (176.606165, 71.308105, 176.606165, 61.95),\n (176.606165, 71.308105, 174.56034, 71.308105),\n (173.777625, 71.308105, 89.86427, 71.308105),\n (89.86427, 71.308105, 87.03573, 71.308105),\n (176.606165, 61.95, 174.56034, 61.95),\n (173.777625, 61.95, 89.86427, 61.95),\n (89.86427, 61.95, 87.03573, 61.95),\n (89.86427, 71.308105, 89.86427, 61.95),\n (173.777625, 71.308105, 173.777625, 61.95),\n (190.606165, 85.308105, 199.96427, 85.308105),\n (190.606165, 172.05, 199.96427, 172.05),\n (199.96427, 172.05, 199.96427, 85.308105),\n (190.606165, 172.05, 190.606165, 85.308105)\n]\nVISIBLE_CIRCLES = [\n\n]\nVISIBLE_ARCS = [\n (131.820947, 172.05, 44.785217, -26.216219, -0.0),\n (131.820947, 172.05, 41.956677, -180.0, -0.0),\n (131.820947, 172.05, 44.785217, -180.0, -152.988419)\n]\nHIDDEN_SEGMENTS = [\n (95.5214, 71.3081, 95.5214, 61.95),\n (168.1205, 71.3081, 168.1205, 61.95),\n (91.9211, 61.95, 91.9211, 71.3081),\n (171.9993, 61.95, 171.9993, 71.3081),\n (199.9643, 151.7099, 190.6062, 151.7099),\n (199.9643, 152.2657, 190.6062, 152.2657),\n (199.9643, 130.0933, 190.6062, 130.0933)\n]\n# (orient, text, p1, p2, base) for linear; (orient, text, center, radius, angle) for diameter\nDIMENSIONS = [\n ('horizontal', '81.0526', (95.5214, 85.3081), (168.1205, 85.3081), (131.8209, 96.3081)),\n ('horizontal', '100', (176.6062, 172.05), (87.0357, 172.05), (131.8209, 161.05)),\n ('aligned', '97.3044', (168.1205, 85.3081), (176.6062, 172.05), (161.4156, 129.75)),\n ('aligned', '97.3044', (87.0357, 172.05), (95.5214, 85.3081), (102.2263, 129.75)),\n ('horizontal', '93.6842', (89.8643, 88.1366), (173.7776, 88.1366), (131.8209, 99.1366)),\n ('vertical', '93.6843', (89.8643, 88.1366), (89.8643, 172.05), (78.8643, 130.0933)),\n ('horizontal', '3.1579', (87.0357, 88.1366), (89.8643, 88.1366), (88.45, 99.1366)),\n ('vertical', '3.1579', (89.8643, 85.3081), (89.8643, 88.1366), (78.8643, 86.7223)),\n ('radius', 'R50', (131.8209, 172.05), 44.7852, 45),\n ('radius', 'R46.8421', (131.8209, 172.05), 41.9567, 135),\n ('horizontal', '10.4478', (190.6062, 85.3081), (199.9643, 85.3081), (195.2852, 96.3081))\n]\n\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; _ds.dxf.dimasz = 2.5\n _ds.dxf.dimexe = 1.25; _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\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\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,\n angle=(0 if d[0] == \"horizontal\" else 90),\n 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,\n 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,\n 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,\n text=text, dimstyle=\"EZDXF\").render()\n\n doc.saveas(out_path)\n\n\nif __name__ == \"__main__\":\n out = sys.argv[1] if len(sys.argv) > 1 else \"0097_00970411_gt.dxf\"\n draw(out)\n print(\"wrote\", out)\n```"}], "images": ["images/0097_00970411.png"], "id": "0097_00970411"} {"messages": [{"role": "user", "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 2 circular holes, each of diameter 19.3 mm. It is extruded to a thickness of 9.9 mm. The outline includes one or more oblique (angled) edges."}, {"role": "assistant", "content": "```python\n#!/usr/bin/env python3\n# -*- coding: utf-8 -*-\n# Ground-truth 2D engineering drawing for part: 0098_00986712\n# Self-contained: reproduces the three-view DXF via ezdxf, NO FreeCAD needed.\n# Coordinates are A4 page millimetres (scale=0.8744644549763059, page=[297.0, 210.0]).\n# visible edges -> solid (layer OUTLINE); hidden edges -> dashed (layer HIDDEN)\n# dimensions -> real movable DIMENSION entities (text = true mm value)\n# Run: python 0098_00986712_gt.py [out.dxf]\nimport sys\nimport ezdxf\nimport math\n\nSCALE = 0.8744644549763059\nPAGE = [297.0, 210.0]\n\nVISIBLE_SEGMENTS = [\n (121.43423, 84.603527, 157.486711, 84.603527),\n (157.486711, 84.603527, 157.486711, 172.049973),\n (157.486711, 172.049973, 121.43423, 172.049973),\n (106.859822, 157.475565, 106.859822, 99.177935),\n (106.859822, 70.603527, 107.315272, 70.603527),\n (107.315272, 70.603527, 107.770722, 70.603527),\n (107.770722, 70.603527, 108.226173, 70.603527),\n (108.226173, 70.603527, 108.681623, 70.603527),\n (108.681623, 70.603527, 109.137073, 70.603527),\n (109.137073, 70.603527, 109.592523, 70.603527),\n (109.592523, 70.603527, 110.047974, 70.603527),\n (110.047974, 70.603527, 110.503424, 70.603527),\n (110.503424, 70.603527, 110.958874, 70.603527),\n (110.958874, 70.603527, 111.414324, 70.603527),\n (111.414324, 70.603527, 111.869775, 70.603527),\n (111.869775, 70.603527, 112.325225, 70.603527),\n (112.325225, 70.603527, 112.780675, 70.603527),\n (112.780675, 70.603527, 113.236125, 70.603527),\n (113.236125, 70.603527, 113.691576, 70.603527),\n (113.691576, 70.603527, 114.147026, 70.603527),\n (114.147026, 70.603527, 114.602476, 70.603527),\n (114.602476, 70.603527, 115.057926, 70.603527),\n (115.057926, 70.603527, 115.513377, 70.603527),\n (115.513377, 70.603527, 115.968827, 70.603527),\n (115.968827, 70.603527, 116.424277, 70.603527),\n (116.424277, 70.603527, 116.879727, 70.603527),\n (116.879727, 70.603527, 117.335177, 70.603527),\n (117.335177, 70.603527, 117.790628, 70.603527),\n (117.790628, 70.603527, 118.246078, 70.603527),\n (118.246078, 70.603527, 118.701528, 70.603527),\n (118.701528, 70.603527, 119.156978, 70.603527),\n (119.156978, 70.603527, 119.612429, 70.603527),\n (119.612429, 70.603527, 120.067879, 70.603527),\n (120.067879, 70.603527, 120.523329, 70.603527),\n (120.523329, 70.603527, 120.978779, 70.603527),\n (120.978779, 70.603527, 121.43423, 70.603527),\n (106.859822, 61.949973, 107.315272, 61.949973),\n (107.315272, 61.949973, 107.770722, 61.949973),\n (107.770722, 61.949973, 108.226173, 61.949973),\n (108.226173, 61.949973, 108.681623, 61.949973),\n (108.681623, 61.949973, 109.137073, 61.949973),\n (109.137073, 61.949973, 109.592523, 61.949973),\n (109.592523, 61.949973, 110.047974, 61.949973),\n (110.047974, 61.949973, 110.503424, 61.949973),\n (110.503424, 61.949973, 110.958874, 61.949973),\n (110.958874, 61.949973, 111.414324, 61.949973),\n (111.414324, 61.949973, 111.869775, 61.949973),\n (111.869775, 61.949973, 112.325225, 61.949973),\n (112.325225, 61.949973, 112.780675, 61.949973),\n (112.780675, 61.949973, 113.236125, 61.949973),\n (113.236125, 61.949973, 113.691576, 61.949973),\n (113.691576, 61.949973, 114.147026, 61.949973),\n (114.147026, 61.949973, 114.602476, 61.949973),\n (114.602476, 61.949973, 115.057926, 61.949973),\n (115.057926, 61.949973, 115.513377, 61.949973),\n (115.513377, 61.949973, 115.968827, 61.949973),\n (115.968827, 61.949973, 116.424277, 61.949973),\n (116.424277, 61.949973, 116.879727, 61.949973),\n (116.879727, 61.949973, 117.335177, 61.949973),\n (117.335177, 61.949973, 117.790628, 61.949973),\n (117.790628, 61.949973, 118.246078, 61.949973),\n (118.246078, 61.949973, 118.701528, 61.949973),\n (118.701528, 61.949973, 119.156978, 61.949973),\n (119.156978, 61.949973, 119.612429, 61.949973),\n (119.612429, 61.949973, 120.067879, 61.949973),\n (120.067879, 61.949973, 120.523329, 61.949973),\n (120.523329, 61.949973, 120.978779, 61.949973),\n (120.978779, 61.949973, 121.43423, 61.949973),\n (106.859822, 70.603527, 106.859822, 61.949973),\n (121.43423, 61.949973, 157.486711, 61.949973),\n (157.486711, 70.603527, 157.486711, 61.949973),\n (121.43423, 70.603527, 157.486711, 70.603527),\n (121.43423, 70.603527, 121.43423, 61.949973),\n (180.140266, 99.177935, 180.140266, 98.722485),\n (180.140266, 98.722485, 180.140266, 98.267034),\n (180.140266, 98.267034, 180.140266, 97.811584),\n (180.140266, 97.811584, 180.140266, 97.356134),\n (180.140266, 97.356134, 180.140266, 96.900684),\n (180.140266, 96.900684, 180.140266, 96.445233),\n (180.140266, 96.445233, 180.140266, 95.989783),\n (180.140266, 95.989783, 180.140266, 95.534333),\n (180.140266, 95.534333, 180.140266, 95.078883),\n (180.140266, 95.078883, 180.140266, 94.623432),\n (180.140266, 94.623432, 180.140266, 94.167982),\n (180.140266, 94.167982, 180.140266, 93.712532),\n (180.140266, 93.712532, 180.140266, 93.257082),\n (180.140266, 93.257082, 180.140266, 92.801632),\n (180.140266, 92.801632, 180.140266, 92.346181),\n (180.140266, 92.346181, 180.140266, 91.890731),\n (180.140266, 91.890731, 180.140266, 91.435281),\n (180.140266, 91.435281, 180.140266, 90.979831),\n (180.140266, 90.979831, 180.140266, 90.52438),\n (180.140266, 90.52438, 180.140266, 90.06893),\n (180.140266, 90.06893, 180.140266, 89.61348),\n (180.140266, 89.61348, 180.140266, 89.15803),\n (180.140266, 89.15803, 180.140266, 88.702579),\n (180.140266, 88.702579, 180.140266, 88.247129),\n (180.140266, 88.247129, 180.140266, 87.791679),\n (180.140266, 87.791679, 180.140266, 87.336229),\n (180.140266, 87.336229, 180.140266, 86.880778),\n (180.140266, 86.880778, 180.140266, 86.425328),\n (180.140266, 86.425328, 180.140266, 85.969878),\n (180.140266, 85.969878, 180.140266, 85.514428),\n (180.140266, 85.514428, 180.140266, 85.058977),\n (180.140266, 85.058977, 180.140266, 84.603527),\n (180.140266, 84.603527, 171.486712, 84.603527),\n (171.486712, 99.177935, 171.486712, 98.722485),\n (171.486712, 98.722485, 171.486712, 98.267034),\n (171.486712, 98.267034, 171.486712, 97.811584),\n (171.486712, 97.811584, 171.486712, 97.356134),\n (171.486712, 97.356134, 171.486712, 96.900684),\n (171.486712, 96.900684, 171.486712, 96.445233),\n (171.486712, 96.445233, 171.486712, 95.989783),\n (171.486712, 95.989783, 171.486712, 95.534333),\n (171.486712, 95.534333, 171.486712, 95.078883),\n (171.486712, 95.078883, 171.486712, 94.623432),\n (171.486712, 94.623432, 171.486712, 94.167982),\n (171.486712, 94.167982, 171.486712, 93.712532),\n (171.486712, 93.712532, 171.486712, 93.257082),\n (171.486712, 93.257082, 171.486712, 92.801632),\n (171.486712, 92.801632, 171.486712, 92.346181),\n (171.486712, 92.346181, 171.486712, 91.890731),\n (171.486712, 91.890731, 171.486712, 91.435281),\n (171.486712, 91.435281, 171.486712, 90.979831),\n (171.486712, 90.979831, 171.486712, 90.52438),\n (171.486712, 90.52438, 171.486712, 90.06893),\n (171.486712, 90.06893, 171.486712, 89.61348),\n (171.486712, 89.61348, 171.486712, 89.15803),\n (171.486712, 89.15803, 171.486712, 88.702579),\n (171.486712, 88.702579, 171.486712, 88.247129),\n (171.486712, 88.247129, 171.486712, 87.791679),\n (171.486712, 87.791679, 171.486712, 87.336229),\n (171.486712, 87.336229, 171.486712, 86.880778),\n (171.486712, 86.880778, 171.486712, 86.425328),\n (171.486712, 86.425328, 171.486712, 85.969878),\n (171.486712, 85.969878, 171.486712, 85.514428),\n (171.486712, 85.514428, 171.486712, 85.058977),\n (171.486712, 85.058977, 171.486712, 84.603527),\n (180.140266, 172.049973, 171.486712, 172.049973),\n (180.140266, 172.049973, 180.140266, 171.594523),\n (180.140266, 171.594523, 180.140266, 171.139072),\n (180.140266, 171.139072, 180.140266, 170.683622),\n (180.140266, 170.683622, 180.140266, 170.228172),\n (180.140266, 170.228172, 180.140266, 169.772722),\n (180.140266, 169.772722, 180.140266, 169.317271),\n (180.140266, 169.317271, 180.140266, 168.861821),\n (180.140266, 168.861821, 180.140266, 168.406371),\n (180.140266, 168.406371, 180.140266, 167.950921),\n (180.140266, 167.950921, 180.140266, 167.49547),\n (180.140266, 167.49547, 180.140266, 167.04002),\n (180.140266, 167.04002, 180.140266, 166.58457),\n (180.140266, 166.58457, 180.140266, 166.12912),\n (180.140266, 166.12912, 180.140266, 165.673669),\n (180.140266, 165.673669, 180.140266, 165.218219),\n (180.140266, 165.218219, 180.140266, 164.762769),\n (180.140266, 164.762769, 180.140266, 164.307319),\n (180.140266, 164.307319, 180.140266, 163.851868),\n (180.140266, 163.851868, 180.140266, 163.396418),\n (180.140266, 163.396418, 180.140266, 162.940968),\n (180.140266, 162.940968, 180.140266, 162.485518),\n (180.140266, 162.485518, 180.140266, 162.030068),\n (180.140266, 162.030068, 180.140266, 161.574617),\n (180.140266, 161.574617, 180.140266, 161.119167),\n (180.140266, 161.119167, 180.140266, 160.663717),\n (180.140266, 160.663717, 180.140266, 160.208267),\n (180.140266, 160.208267, 180.140266, 159.752816),\n (180.140266, 159.752816, 180.140266, 159.297366),\n (180.140266, 159.297366, 180.140266, 158.841916),\n (180.140266, 158.841916, 180.140266, 158.386466),\n (180.140266, 158.386466, 180.140266, 157.931015),\n (180.140266, 157.931015, 180.140266, 157.475565),\n (171.486712, 172.049973, 171.486712, 171.594523),\n (171.486712, 171.594523, 171.486712, 171.139072),\n (171.486712, 171.139072, 171.486712, 170.683622),\n (171.486712, 170.683622, 171.486712, 170.228172),\n (171.486712, 170.228172, 171.486712, 169.772722),\n (171.486712, 169.772722, 171.486712, 169.317271),\n (171.486712, 169.317271, 171.486712, 168.861821),\n (171.486712, 168.861821, 171.486712, 168.406371),\n (171.486712, 168.406371, 171.486712, 167.950921),\n (171.486712, 167.950921, 171.486712, 167.49547),\n (171.486712, 167.49547, 171.486712, 167.04002),\n (171.486712, 167.04002, 171.486712, 166.58457),\n (171.486712, 166.58457, 171.486712, 166.12912),\n (171.486712, 166.12912, 171.486712, 165.673669),\n (171.486712, 165.673669, 171.486712, 165.218219),\n (171.486712, 165.218219, 171.486712, 164.762769),\n (171.486712, 164.762769, 171.486712, 164.307319),\n (171.486712, 164.307319, 171.486712, 163.851868),\n (171.486712, 163.851868, 171.486712, 163.396418),\n (171.486712, 163.396418, 171.486712, 162.940968),\n (171.486712, 162.940968, 171.486712, 162.485518),\n (171.486712, 162.485518, 171.486712, 162.030068),\n (171.486712, 162.030068, 171.486712, 161.574617),\n (171.486712, 161.574617, 171.486712, 161.119167),\n (171.486712, 161.119167, 171.486712, 160.663717),\n (171.486712, 160.663717, 171.486712, 160.208267),\n (171.486712, 160.208267, 171.486712, 159.752816),\n (171.486712, 159.752816, 171.486712, 159.297366),\n (171.486712, 159.297366, 171.486712, 158.841916),\n (171.486712, 158.841916, 171.486712, 158.386466),\n (171.486712, 158.386466, 171.486712, 157.931015),\n (171.486712, 157.931015, 171.486712, 157.475565),\n (171.486712, 157.475565, 171.486712, 99.177935),\n (180.140266, 157.475565, 180.140266, 99.177935),\n (180.140266, 99.177935, 171.486712, 99.177935),\n (180.140266, 157.475565, 171.486712, 157.475565)\n]\nVISIBLE_CIRCLES = [\n (125.2696, 103.013305, 8.437815),\n (125.2696, 153.640195, 8.437815)\n]\nVISIBLE_ARCS = [\n (121.43423, 99.177935, 14.574408, -180.0, -90.0),\n (121.43423, 157.475565, 14.574408, 90.0, 180.0)\n]\nHIDDEN_SEGMENTS = [\n (133.7074, 61.95, 133.7074, 70.6036),\n (116.8317, 70.6036, 116.8317, 61.95),\n (171.4867, 145.2024, 180.1402, 145.2024),\n (171.4867, 162.078, 180.1402, 162.078),\n (171.4867, 94.5755, 180.1402, 94.5755),\n (171.4867, 111.4511, 180.1402, 111.4511)\n]\n# (orient, text, p1, p2, base) for linear; (orient, text, center, radius, angle) for diameter\nDIMENSIONS = [\n ('horizontal', '41.2281', (121.4342, 172.05), (157.4867, 172.05), (139.4604, 183.05)),\n ('vertical', '66.6667', (106.8597, 99.178), (106.8597, 157.4756), (95.8597, 128.3268)),\n ('vertical', '100', (157.4867, 172.05), (157.4867, 84.6036), (168.4867, 128.3268)),\n ('diameter', '%%c19.2982', (125.2696, 153.6402), 8.4378, 45),\n ('horizontal', '21.0527', (106.8597, 153.6402), (125.2696, 153.6402), (116.0647, 164.6402)),\n ('vertical', '21.0526', (125.2696, 172.05), (125.2696, 153.6402), (136.2696, 162.8451)),\n ('diameter', '%%c19.2982', (125.2696, 103.0133), 8.4378, 45),\n ('horizontal', '21.0527', (106.8597, 103.0133), (125.2696, 103.0133), (116.0647, 114.0133)),\n ('vertical', '78.9474', (125.2696, 172.05), (125.2696, 103.0133), (136.2696, 137.5317)),\n ('radius', 'R16.6667', (121.4342, 157.4756), 14.5744, 45),\n ('horizontal', '9.8958', (180.1402, 157.4756), (171.4867, 157.4756), (175.8135, 146.4756))\n]\n\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; _ds.dxf.dimasz = 2.5\n _ds.dxf.dimexe = 1.25; _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\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\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,\n angle=(0 if d[0] == \"horizontal\" else 90),\n 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,\n 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,\n 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,\n text=text, dimstyle=\"EZDXF\").render()\n\n doc.saveas(out_path)\n\n\nif __name__ == \"__main__\":\n out = sys.argv[1] if len(sys.argv) > 1 else \"0098_00986712_gt.dxf\"\n draw(out)\n print(\"wrote\", out)\n```"}], "images": ["images/0098_00986712.png"], "id": "0098_00986712"} {"messages": [{"role": "user", "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": "assistant", "content": "```python\n#!/usr/bin/env python3\n# -*- coding: utf-8 -*-\n# Ground-truth 2D engineering drawing for part: 0099_00994284\n# Self-contained: reproduces the three-view DXF via ezdxf, NO FreeCAD needed.\n# Coordinates are A4 page millimetres (scale=0.7428895147365849, page=[297.0, 210.0]).\n# visible edges -> solid (layer OUTLINE); hidden edges -> dashed (layer HIDDEN)\n# dimensions -> real movable DIMENSION entities (text = true mm value)\n# Run: python 0099_00994284_gt.py [out.dxf]\nimport sys\nimport ezdxf\nimport math\n\nSCALE = 0.7428895147365849\nPAGE = [297.0, 210.0]\n\nVISIBLE_SEGMENTS = [\n (191.680896, 88.480535, 158.628772, 88.480535),\n (191.680896, 81.933735, 158.628772, 81.933735),\n (158.628772, 81.933735, 84.33982, 81.933735),\n (158.628772, 88.480535, 84.33982, 88.480535),\n (84.33982, 88.480535, 51.287696, 88.480535),\n (84.33982, 81.933735, 51.287696, 81.933735),\n (191.680896, 81.933735, 191.680896, 88.480535),\n (51.287696, 81.933735, 51.287696, 88.480535),\n (158.628772, 88.480535, 158.628772, 81.933735),\n (84.33982, 88.480535, 84.33982, 81.933735),\n (205.680896, 153.251616, 205.680896, 102.480536),\n (212.227696, 153.251616, 212.227696, 102.480536),\n (212.227696, 153.251616, 205.680896, 153.251616),\n (212.227696, 102.480536, 205.680896, 102.480536)\n]\nVISIBLE_CIRCLES = [\n (76.460689, 127.303281, 11.255902),\n (166.507903, 127.303281, 11.255902)\n]\nVISIBLE_ARCS = [\n (121.484296, -13.583635, 122.99253, 72.421875, 107.578125),\n (166.295356, 127.866076, 25.38554, -107.578125, 107.578125),\n (121.484296, 269.315786, 122.99253, -107.578125, -72.421875),\n (76.673236, 127.866076, 25.38554, 72.421875, -72.421875)\n]\nHIDDEN_SEGMENTS = [\n (87.7166, 88.4805, 87.7166, 81.9337),\n (177.7638, 88.4805, 177.7638, 81.9337),\n (65.2048, 81.9337, 65.2048, 88.4805),\n (155.252, 81.9337, 155.252, 88.4805),\n (212.2277, 109.4089, 205.6809, 109.4089),\n (212.2277, 146.3233, 205.6809, 146.3233),\n (212.2277, 138.5592, 205.6809, 138.5592),\n (212.2277, 116.0474, 205.6809, 116.0474)\n]\n# (orient, text, p1, p2, base) for linear; (orient, text, center, radius, angle) for diameter\nDIMENSIONS = [\n ('horizontal', '100', (84.3398, 103.6659), (158.6287, 103.6659), (121.4843, 114.6659)),\n ('vertical', '65.1515', (158.6287, 103.6659), (158.6287, 152.0663), (147.6287, 127.8661)),\n ('diameter', '%%c30.303', (76.4607, 127.3033), 11.2559, 45),\n ('horizontal', '10.606', (84.3398, 127.3033), (76.4607, 127.3033), (80.4002, 116.3033)),\n ('vertical', '31.8182', (76.4607, 103.6659), (76.4607, 127.3033), (65.4607, 115.4846)),\n ('diameter', '%%c30.303', (166.5079, 127.3033), 11.2559, 45),\n ('horizontal', '110.606', (84.3398, 127.3033), (166.5079, 127.3033), (125.4238, 138.3033)),\n ('vertical', '31.8182', (166.5079, 103.6659), (166.5079, 127.3033), (155.5079, 115.4846)),\n ('radius', 'R165.56', (121.4843, -13.5836), 122.9926, 45),\n ('radius', 'R34.1714', (166.2954, 127.8661), 25.3856, 135),\n ('horizontal', '8.8126', (205.6809, 103.6659), (212.2277, 103.6659), (208.9543, 114.6659))\n]\n\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; _ds.dxf.dimasz = 2.5\n _ds.dxf.dimexe = 1.25; _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\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\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,\n angle=(0 if d[0] == \"horizontal\" else 90),\n 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,\n 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,\n 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,\n text=text, dimstyle=\"EZDXF\").render()\n\n doc.saveas(out_path)\n\n\nif __name__ == \"__main__\":\n out = sys.argv[1] if len(sys.argv) > 1 else \"0099_00994284_gt.dxf\"\n draw(out)\n print(\"wrote\", out)\n```"}], "images": ["images/0099_00994284.png"], "id": "0099_00994284"} {"messages": [{"role": "user", "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 61.94 mm, featuring a circular hole of diameter 44.81 mm. It is extruded to a thickness of 56.21 mm. A union feature: The part is a circular plate with diameter 45.18 mm, featuring a circular hole of diameter 27.3 mm. It is extruded to a thickness of 56.21 mm. A union feature: The part is a polygonal plate with 4 straight edges. It is extruded to a thickness of 56.21 mm. The outline includes one or more oblique (angled) edges."}, {"role": "assistant", "content": "```python\n#!/usr/bin/env python3\n# -*- coding: utf-8 -*-\n# Ground-truth 2D engineering drawing for part: 0000_00006608\n# Self-contained: reproduces the three-view DXF via ezdxf, NO FreeCAD needed.\n# Coordinates are A4 page millimetres (scale=0.7019653314558859, page=[297.0, 210.0]).\n# visible edges -> solid (layer OUTLINE); hidden edges -> dashed (layer HIDDEN)\n# dimensions -> real movable DIMENSION entities (text = true mm value)\n# Run: python 0000_00006608_gt.py [out.dxf]\nimport sys\nimport ezdxf\nimport math\n\nSCALE = 0.7019653314558859\nPAGE = [297.0, 210.0]\n\nVISIBLE_SEGMENTS = [\n (82.223054, 122.552311, 146.293713, 127.947735),\n (148.549911, 159.798836, 78.600958, 165.689274),\n (148.549911, 108.030177, 163.228807, 108.030177),\n (148.549911, 108.030177, 78.600958, 108.030177),\n (78.600958, 108.030177, 55.747191, 108.030177),\n (78.600958, 108.030177, 78.600958, 68.571793),\n (148.549911, 108.030177, 148.549911, 68.571793),\n (148.549911, 68.571793, 78.600958, 68.571793),\n (78.600958, 68.571793, 55.747191, 68.571793),\n (148.549911, 68.571793, 163.228807, 68.571793),\n (55.747191, 68.571793, 55.747191, 108.030177),\n (163.228807, 68.571793, 163.228807, 108.030177),\n (177.228807, 165.689274, 177.228807, 165.509918),\n (177.228807, 165.509918, 177.228807, 122.030177),\n (177.228807, 165.689274, 216.687191, 165.689274),\n (216.687191, 165.689274, 216.687191, 165.509918),\n (216.687191, 165.509918, 216.687191, 122.030177),\n (216.687191, 165.509918, 177.228807, 165.509918),\n (216.687191, 122.030177, 177.228807, 122.030177)\n]\nVISIBLE_CIRCLES = [\n (77.487061, 143.770047, 15.726715),\n (147.369935, 143.770047, 9.581402),\n (77.487061, 143.770047, 21.73987),\n (147.186665, 143.968283, 15.889142)\n]\nVISIBLE_ARCS = [\n (76.730458, 143.968283, 21.801381, 69.782107, 85.078125),\n (147.369935, 143.770047, 15.858872, -93.891224, -131.293171)\n]\nHIDDEN_SEGMENTS = [\n (82.2231, 68.5718, 82.2231, 108.0302),\n (146.2937, 68.5718, 146.2937, 108.0302),\n (84.2648, 68.5718, 84.2648, 108.0302),\n (136.9045, 68.5718, 136.9045, 108.0302),\n (93.2138, 108.0302, 93.2138, 68.5718),\n (156.9513, 108.0302, 156.9513, 68.5718),\n (131.2975, 68.5718, 131.2975, 108.0302),\n (61.7603, 68.5718, 61.7603, 108.0302),\n (131.5111, 68.5718, 131.5111, 108.0302),\n (137.7885, 68.5718, 137.7885, 108.0302),\n (216.6872, 122.5523, 177.2288, 122.5523),\n (216.6872, 127.9477, 177.2288, 127.9477),\n (216.6872, 164.4264, 177.2288, 164.4264),\n (177.2288, 159.7988, 216.6872, 159.7988),\n (216.6872, 131.8546, 177.2288, 131.8546),\n (216.6872, 159.8574, 177.2288, 159.8574),\n (216.6872, 159.4968, 177.2288, 159.4968),\n (216.6872, 128.0433, 177.2288, 128.0433),\n (216.6872, 159.6289, 177.2288, 159.6289),\n (216.6872, 127.9112, 177.2288, 127.9112),\n (216.6872, 153.3514, 177.2288, 153.3514),\n (216.6872, 134.1886, 177.2288, 134.1886)\n]\n# (orient, text, p1, p2, base) for linear; (orient, text, center, radius, angle) for diameter\nDIMENSIONS = [\n ('diameter', '%%c61.94', (77.487, 143.77), 21.7399, 45),\n ('diameter', '%%c44.8077', (77.487, 143.77), 15.7267, 135),\n ('diameter', '%%c45.1842', (147.3699, 143.77), 15.8589, 45),\n ('diameter', '%%c27.2988', (147.3699, 143.77), 9.5814, 135),\n ('horizontal', '99.6473', (78.601, 122.2473), (148.5499, 122.2473), (113.5755, 133.2473)),\n ('vertical', '61.8862', (148.5499, 122.2473), (148.5499, 165.6893), (137.5499, 143.9683)),\n ('aligned', '100', (148.5499, 159.7989), (78.601, 165.6893), (112.6524, 151.7829)),\n ('radius', 'R22.6352', (147.1866, 143.9683), 15.8891, 225),\n ('radius', 'R31.0576', (76.7305, 143.9683), 21.8014, 45)\n]\n\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; _ds.dxf.dimasz = 2.5\n _ds.dxf.dimexe = 1.25; _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\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\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,\n angle=(0 if d[0] == \"horizontal\" else 90),\n 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,\n 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,\n 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,\n text=text, dimstyle=\"EZDXF\").render()\n\n doc.saveas(out_path)\n\n\nif __name__ == \"__main__\":\n out = sys.argv[1] if len(sys.argv) > 1 else \"0000_00006608_gt.dxf\"\n draw(out)\n print(\"wrote\", out)\n```"}], "images": ["images/0000_00006608.png"], "id": "0000_00006608"} {"messages": [{"role": "user", "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 20.58 mm. A union feature: The part is a rectangular plate 56.31 mm wide and 63.69 mm tall, featuring a circular hole of diameter 16.09 mm. It is extruded to a thickness of 20.58 mm."}, {"role": "assistant", "content": "```python\n#!/usr/bin/env python3\n# -*- coding: utf-8 -*-\n# Ground-truth 2D engineering drawing for part: 0003_00030062\n# Self-contained: reproduces the three-view DXF via ezdxf, NO FreeCAD needed.\n# Coordinates are A4 page millimetres (scale=0.7970110341288166, page=[297.0, 210.0]).\n# visible edges -> solid (layer OUTLINE); hidden edges -> dashed (layer HIDDEN)\n# dimensions -> real movable DIMENSION entities (text = true mm value)\n# Run: python 0003_00030062_gt.py [out.dxf]\nimport sys\nimport ezdxf\nimport math\n\nSCALE = 0.7970110341288166\nPAGE = [297.0, 210.0]\n\nVISIBLE_SEGMENTS = [\n (124.042105, 114.446307, 168.311393, 114.446307),\n (168.311393, 165.204797, 123.430203, 165.204797),\n (168.311393, 114.446307, 168.311393, 165.204797),\n (168.311393, 85.58455, 123.430203, 85.58455),\n (123.430203, 85.58455, 53.149217, 85.58455),\n (123.430203, 85.58455, 123.430203, 69.185653),\n (168.311393, 85.58455, 168.311393, 69.185653),\n (168.311393, 69.185653, 123.430203, 69.185653),\n (123.430203, 69.185653, 53.149217, 69.185653),\n (53.149217, 69.185653, 53.149217, 85.58455),\n (182.311393, 179.285654, 182.311393, 99.58455),\n (198.71029, 179.285654, 198.71029, 99.58455),\n (198.71029, 179.285654, 182.311393, 179.285654),\n (198.71029, 99.58455, 182.311393, 99.58455)\n]\nVISIBLE_CIRCLES = [\n (145.870798, 140.092702, 6.411599),\n (92.999769, 139.435102, 39.850552)\n]\nVISIBLE_ARCS = [\n (93.268016, 139.825552, 39.419076, 30.988751, 40.078125)\n]\nHIDDEN_SEGMENTS = [\n (124.0421, 69.1857, 124.0421, 85.5845),\n (127.0607, 69.1857, 127.0607, 85.5845),\n (152.2824, 85.5845, 152.2824, 69.1857),\n (139.4592, 69.1857, 139.4592, 85.5845),\n (198.7103, 114.4463, 182.3114, 114.4463),\n (182.3114, 165.2048, 198.7103, 165.2048),\n (198.7103, 160.1212, 182.3114, 160.1212),\n (198.7103, 146.5043, 182.3114, 146.5043),\n (198.7103, 133.6811, 182.3114, 133.6811)\n]\n# (orient, text, p1, p2, base) for linear; (orient, text, center, radius, angle) for diameter\nDIMENSIONS = [\n ('diameter', '%%c100', (92.9997, 139.4351), 39.8506, 45),\n ('horizontal', '56.3119', (123.4302, 114.4463), (168.3114, 114.4463), (145.8708, 125.4463)),\n ('vertical', '63.6861', (168.3114, 114.4463), (168.3114, 165.2048), (157.3114, 139.8256)),\n ('diameter', '%%c16.0891', (145.8708, 140.0927), 6.4116, 45),\n ('horizontal', '28.156', (123.4302, 140.0927), (145.8708, 140.0927), (134.6505, 151.0927)),\n ('vertical', '32.1782', (145.8708, 114.4463), (145.8708, 140.0927), (134.8708, 127.2695)),\n ('radius', 'R49.4586', (93.268, 139.8256), 39.419, 45),\n ('horizontal', '20.5755', (182.3114, 114.4463), (198.7103, 114.4463), (190.5108, 125.4463))\n]\n\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; _ds.dxf.dimasz = 2.5\n _ds.dxf.dimexe = 1.25; _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\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\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,\n angle=(0 if d[0] == \"horizontal\" else 90),\n 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,\n 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,\n 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,\n text=text, dimstyle=\"EZDXF\").render()\n\n doc.saveas(out_path)\n\n\nif __name__ == \"__main__\":\n out = sys.argv[1] if len(sys.argv) > 1 else \"0003_00030062_gt.dxf\"\n draw(out)\n print(\"wrote\", out)\n```"}], "images": ["images/0003_00030062.png"], "id": "0003_00030062"} {"messages": [{"role": "user", "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 39.07 mm wide and 44.72 mm tall. It is extruded to a thickness of 2.08 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 union feature: The part is a polygonal plate with 6 straight edges. It is extruded to a thickness of 2.08 mm. The outline includes one or more oblique (angled) edges."}, {"role": "assistant", "content": "```python\n#!/usr/bin/env python3\n# -*- coding: utf-8 -*-\n# Ground-truth 2D engineering drawing for part: 0003_00033504\n# Self-contained: reproduces the three-view DXF via ezdxf, NO FreeCAD needed.\n# Coordinates are A4 page millimetres (scale=0.5991147199568608, page=[297.0, 210.0]).\n# visible edges -> solid (layer OUTLINE); hidden edges -> dashed (layer HIDDEN)\n# dimensions -> real movable DIMENSION entities (text = true mm value)\n# Run: python 0003_00033504_gt.py [out.dxf]\nimport sys\nimport ezdxf\nimport math\n\nSCALE = 0.5991147199568608\nPAGE = [297.0, 210.0]\n\nVISIBLE_SEGMENTS = [\n (117.624771, 145.27158, 117.624771, 172.062862),\n (94.217651, 145.27158, 117.624771, 145.27158),\n (117.624771, 172.062862, 94.217651, 172.062862),\n (94.217651, 172.062862, 94.217651, 145.27158),\n (104.809553, 157.352251, 104.809553, 147.763793),\n (114.398012, 158.355695, 105.812996, 158.355695),\n (115.401455, 147.763793, 115.401455, 157.352251),\n (105.812996, 146.760349, 114.398012, 146.760349),\n (94.217651, 145.27158, 94.217651, 145.160087),\n (94.217651, 145.160087, 94.217651, 137.17189),\n (94.217651, 137.17189, 94.217651, 137.120441),\n (95.463757, 145.27158, 95.463757, 145.160087),\n (94.217651, 145.160087, 95.463757, 145.160087),\n (95.463757, 137.17189, 95.463757, 137.120441),\n (95.463757, 145.160087, 95.463757, 137.17189),\n (94.217651, 137.17189, 95.463757, 137.17189),\n (95.463757, 137.120441, 94.217651, 137.120441),\n (117.624771, 63.208969, 117.624771, 61.962862),\n (117.624771, 61.962862, 94.217651, 61.962862),\n (94.217651, 63.208969, 94.217651, 61.962862),\n (117.624771, 63.208969, 94.217651, 63.208969),\n (94.217651, 123.120441, 94.217651, 63.208969),\n (95.463757, 123.120441, 95.463757, 63.208969),\n (94.217651, 123.120441, 95.463757, 123.120441),\n (191.536243, 145.27158, 192.782349, 145.27158),\n (191.536243, 172.062862, 192.782349, 172.062862),\n (191.536243, 172.062862, 191.536243, 171.407017),\n (192.782349, 172.062862, 192.782349, 145.27158),\n (191.536243, 145.27158, 191.536243, 145.160087),\n (191.536243, 145.160087, 137.330626, 137.17189),\n (136.189455, 143.44833, 137.901211, 144.018916),\n (137.901211, 144.018916, 131.624771, 171.407017),\n (131.624771, 171.407017, 191.536243, 171.407017)\n]\nVISIBLE_CIRCLES = [\n\n]\nVISIBLE_ARCS = [\n (105.812996, 147.763793, 1.003443, -180.0, -90.0),\n (105.812996, 157.352251, 1.003443, 90.0, -180.0),\n (114.398012, 157.352251, 1.003443, 0.0, 90.0),\n (114.398012, 147.763793, 1.003443, -90.0, -0.0),\n (136.76004, 140.31011, 3.18967, 100.304846, -79.695154)\n]\nHIDDEN_SEGMENTS = [\n (94.2177, 171.407, 95.4638, 171.407),\n (94.2177, 143.4483, 95.4638, 143.4483),\n (94.2177, 144.0189, 95.4638, 144.0189),\n (104.8096, 61.9629, 104.8096, 63.209),\n (115.4015, 61.9629, 115.4015, 63.209),\n (94.2177, 117.4146, 95.4638, 117.4146),\n (94.2177, 118.5558, 95.4638, 118.5558),\n (94.2177, 116.844, 95.4638, 116.844),\n (95.4638, 121.1748, 94.2177, 121.1748),\n (192.7823, 146.7603, 191.5362, 146.7603),\n (192.7823, 158.3557, 191.5362, 158.3557)\n]\n# (orient, text, p1, p2, base) for linear; (orient, text, center, radius, angle) for diameter\nDIMENSIONS = [\n ('horizontal', '39.0695', (117.6248, 172.0629), (94.2177, 172.0629), (105.9212, 161.0629)),\n ('vertical', '44.7181', (117.6248, 145.2716), (117.6248, 172.0629), (106.6248, 158.6672)),\n ('horizontal', '2.0799', (104.8095, 146.7603), (115.4015, 146.7603), (110.1055, 157.7603)),\n ('vertical', '0.9524', (115.4015, 146.7603), (115.4015, 158.3557), (104.4015, 152.558)),\n ('radius', 'R1.6749', (105.813, 147.7638), 1.0035, 45),\n ('horizontal', '2.0799', (191.5362, 145.2716), (192.7823, 145.2716), (192.1593, 156.2716)),\n ('horizontal', '2.0799', (131.6248, 171.407), (191.5362, 171.407), (161.5805, 182.407)),\n ('aligned', '3.0117', (136.1894, 143.4484), (137.9012, 144.0189), (133.5671, 154.1693)),\n ('aligned', '46.8993', (137.9012, 144.0189), (131.6248, 171.407), (124.0409, 155.2558)),\n ('aligned', '91.4534', (191.5362, 145.1601), (137.3306, 137.1719), (166.0372, 130.2835)),\n ('radius', 'R5.324', (136.76, 140.3101), 3.1897, 45),\n ('horizontal', '2.0799', (94.2177, 117.4146), (95.4638, 117.4146), (94.8407, 128.4146))\n]\n\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; _ds.dxf.dimasz = 2.5\n _ds.dxf.dimexe = 1.25; _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\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\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,\n angle=(0 if d[0] == \"horizontal\" else 90),\n 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,\n 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,\n 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,\n text=text, dimstyle=\"EZDXF\").render()\n\n doc.saveas(out_path)\n\n\nif __name__ == \"__main__\":\n out = sys.argv[1] if len(sys.argv) > 1 else \"0003_00033504_gt.dxf\"\n draw(out)\n print(\"wrote\", out)\n```"}], "images": ["images/0003_00033504.png"], "id": "0003_00033504"} {"messages": [{"role": "user", "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 4.47 mm. The outline includes one or more oblique (angled) edges. A union feature: The part is a circular plate with diameter 31.59 mm, featuring a circular hole of diameter 19.74 mm. It is extruded to a thickness of 4.47 mm. A union feature: The part is a rectangular plate 23.82 mm wide and 2.51 mm tall. It is extruded to a thickness of 1.49 mm. A union feature: The part is a circular plate with diameter 31.59 mm, featuring a circular hole of diameter 19.74 mm. It is extruded to a thickness of 1.49 mm."}, {"role": "assistant", "content": "```python\n#!/usr/bin/env python3\n# -*- coding: utf-8 -*-\n# Ground-truth 2D engineering drawing for part: 0003_00035582\n# Self-contained: reproduces the three-view DXF via ezdxf, NO FreeCAD needed.\n# Coordinates are A4 page millimetres (scale=0.768584076577478, page=[297.0, 210.0]).\n# visible edges -> solid (layer OUTLINE); hidden edges -> dashed (layer HIDDEN)\n# dimensions -> real movable DIMENSION entities (text = true mm value)\n# Run: python 0003_00035582_gt.py [out.dxf]\nimport sys\nimport ezdxf\nimport math\n\nSCALE = 0.768584076577478\nPAGE = [297.0, 210.0]\n\nVISIBLE_SEGMENTS = [\n (149.180529, 138.113562, 179.629114, 138.113562),\n (72.880592, 128.865085, 149.180529, 138.113562),\n (179.779603, 114.992369, 149.180529, 114.992369),\n (149.180529, 114.992369, 72.880592, 124.240846),\n (72.880592, 124.240846, 72.880592, 128.865085),\n (149.180529, 95.862354, 179.629114, 95.862354),\n (149.180529, 95.862354, 149.180529, 99.294406),\n (149.180529, 99.294406, 179.629114, 99.294406),\n (179.629114, 99.294406, 179.629114, 95.862354),\n (72.880592, 95.862354, 149.180529, 95.862354),\n (195.543339, 95.862354, 179.629114, 95.862354),\n (195.543339, 99.294406, 195.543339, 100.438423),\n (171.266086, 100.438423, 195.543339, 100.438423),\n (72.880592, 99.294406, 149.180529, 99.294406),\n (72.880592, 95.862354, 72.880592, 99.294406),\n (72.880592, 99.294406, 72.880592, 100.438423),\n (72.880592, 100.438423, 91.18487, 100.438423),\n (91.18487, 99.294406, 91.18487, 100.438423),\n (171.266086, 100.438423, 171.266086, 99.294406),\n (195.543339, 99.294406, 195.543339, 95.862354),\n (214.119408, 138.113562, 210.687356, 138.113562),\n (214.119408, 128.865085, 214.119408, 138.113562),\n (214.119408, 114.992369, 214.119408, 114.438423),\n (214.119408, 138.715676, 214.119408, 138.113562),\n (214.119408, 114.992369, 214.119408, 124.240846),\n (214.119408, 124.240846, 214.119408, 128.865085),\n (209.543339, 114.438423, 209.543339, 125.794301),\n (209.543339, 127.721067, 209.543339, 138.715676),\n (210.687356, 127.721067, 210.687356, 128.865085),\n (210.687356, 128.865085, 210.687356, 138.113562),\n (210.687356, 114.992369, 210.687356, 124.240846),\n (210.687356, 124.240846, 210.687356, 125.794301),\n (214.119408, 128.865085, 210.687356, 128.865085),\n (214.119408, 114.992369, 210.687356, 114.992369),\n (214.119408, 124.240846, 210.687356, 124.240846),\n (210.687356, 125.794301, 209.543339, 125.794301),\n (209.543339, 125.794301, 209.543339, 127.721067),\n (210.687356, 127.721067, 209.543339, 127.721067),\n (209.543339, 114.438423, 210.687356, 114.438423),\n (210.687356, 114.438423, 214.119408, 114.438423),\n (209.543339, 138.715676, 214.119408, 138.715676)\n]\nVISIBLE_CIRCLES = [\n (183.404712, 126.57705, 7.586642),\n (183.404712, 126.57705, 12.138626)\n]\nVISIBLE_ARCS = [\n (182.70626, 126.552965, 11.560597, 146.814792, -142.864924),\n (183.404712, 126.57705, 12.138626, 148.714765, -144.764897)\n]\nHIDDEN_SEGMENTS = [\n (72.8806, 127.7211, 91.1849, 127.7211),\n (91.1849, 125.7943, 72.8806, 125.7943),\n (91.1849, 127.7211, 91.1849, 125.7943),\n (173.49, 99.2944, 173.49, 95.8624),\n (173.0311, 99.2944, 173.0311, 95.8624),\n (190.9914, 95.8624, 190.9914, 100.4384),\n (175.8181, 100.4384, 175.8181, 95.8624),\n (210.6874, 119.5739, 214.1194, 119.5739),\n (210.6874, 132.8806, 214.1194, 132.8806),\n (209.5433, 118.9904, 214.1194, 118.9904),\n (209.5433, 134.1637, 214.1194, 134.1637)\n]\n# (orient, text, p1, p2, base) for linear; (orient, text, center, radius, angle) for diameter\nDIMENSIONS = [\n ('vertical', '6.0166', (72.8806, 124.2409), (72.8806, 128.865), (61.8806, 126.553)),\n ('aligned', '100', (149.1805, 114.9923), (72.8806, 124.2409), (109.7069, 108.6965)),\n ('aligned', '100', (72.8806, 128.865), (149.1805, 138.1136), (109.7069, 144.4094)),\n ('radius', 'R15.0414', (182.7063, 126.553), 11.5606, 45),\n ('diameter', '%%c31.587', (183.4047, 126.577), 12.1386, 45),\n ('diameter', '%%c19.7419', (183.4047, 126.577), 7.5867, 135),\n ('vertical', '0', (72.8806, 138.1136), (72.8806, 138.1136), (72.8806, 138.1136)),\n ('diameter', '%%c31.587', (183.4047, 126.577), 12.1386, 225),\n ('diameter', '%%c19.7419', (183.4047, 126.577), 7.5867, 315),\n ('horizontal', '4.4654', (214.1194, 138.1136), (210.6874, 138.1136), (212.4034, 127.1136)),\n ('horizontal', '4.4654', (214.1194, 126.577), (210.6874, 126.577), (212.4034, 115.577)),\n ('horizontal', '1.4885', (210.6874, 127.7211), (209.5433, 127.7211), (210.1154, 116.7211)),\n ('horizontal', '4.4654', (210.6874, 126.577), (209.5433, 126.577), (210.1154, 105.577))\n]\n\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; _ds.dxf.dimasz = 2.5\n _ds.dxf.dimexe = 1.25; _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\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\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,\n angle=(0 if d[0] == \"horizontal\" else 90),\n 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,\n 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,\n 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,\n text=text, dimstyle=\"EZDXF\").render()\n\n doc.saveas(out_path)\n\n\nif __name__ == \"__main__\":\n out = sys.argv[1] if len(sys.argv) > 1 else \"0003_00035582_gt.dxf\"\n draw(out)\n print(\"wrote\", out)\n```"}], "images": ["images/0003_00035582.png"], "id": "0003_00035582"} {"messages": [{"role": "user", "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": "assistant", "content": "```python\n#!/usr/bin/env python3\n# -*- coding: utf-8 -*-\n# Ground-truth 2D engineering drawing for part: 0004_00045081\n# Self-contained: reproduces the three-view DXF via ezdxf, NO FreeCAD needed.\n# Coordinates are A4 page millimetres (scale=0.4435514456349072, page=[297.0, 210.0]).\n# visible edges -> solid (layer OUTLINE); hidden edges -> dashed (layer HIDDEN)\n# dimensions -> real movable DIMENSION entities (text = true mm value)\n# Run: python 0004_00045081_gt.py [out.dxf]\nimport sys\nimport ezdxf\nimport math\n\nSCALE = 0.4435514456349072\nPAGE = [297.0, 210.0]\n\nVISIBLE_SEGMENTS = [\n (133.124739, 117.923309, 129.205748, 86.897962),\n (115.569219, 85.172991, 111.09634, 120.583284),\n (111.09634, 123.307153, 115.301611, 167.462498),\n (125.010418, 173.148905, 151.707425, 172.259005),\n (153.674709, 161.154592, 135.276648, 160.628933),\n (130.02006, 154.321027, 132.725251, 127.719982),\n (111.09634, 63.527043, 115.301611, 63.527043),\n (115.301611, 63.527043, 115.779483, 63.527043),\n (115.779483, 63.527043, 125.010418, 63.527043),\n (125.010418, 63.527043, 151.707425, 63.527043),\n (158.424754, 63.527043, 151.707425, 63.527043),\n (111.09634, 65.342956, 115.301611, 65.342956),\n (115.301611, 65.342956, 115.779483, 65.342956),\n (115.779483, 65.342956, 125.010418, 65.342956),\n (125.010418, 65.342956, 151.707425, 65.342956),\n (151.707425, 65.342956, 158.424754, 65.342956),\n (111.09634, 63.527043, 111.09634, 65.342956),\n (115.301611, 63.527043, 115.301611, 65.342956),\n (125.010418, 65.342956, 125.010418, 63.527043),\n (151.707425, 65.342956, 151.707425, 63.527043),\n (158.424754, 65.342956, 158.424754, 63.527043),\n (115.779483, 65.342956, 115.779483, 63.527043),\n (172.424754, 85.172991, 172.424754, 79.342956),\n (174.240666, 79.342956, 174.240666, 85.172991),\n (174.240666, 85.172991, 174.240666, 120.583284),\n (174.240666, 123.307153, 174.240666, 120.583284),\n (174.240666, 123.307153, 174.240666, 167.462498),\n (174.240666, 167.462498, 174.240666, 173.627043),\n (172.424754, 85.172991, 172.424754, 120.583284),\n (172.424754, 120.583284, 172.424754, 123.307153),\n (172.424754, 123.307153, 172.424754, 167.462498),\n (172.424754, 167.462498, 172.424754, 173.627043),\n (174.240666, 85.172991, 172.424754, 85.172991),\n (174.240666, 120.583284, 172.424754, 120.583284),\n (174.240666, 123.307153, 172.424754, 123.307153),\n (174.240666, 167.462498, 172.424754, 167.462498),\n (172.424754, 79.342956, 174.240666, 79.342956),\n (172.424754, 173.627043, 174.240666, 173.627043)\n]\nVISIBLE_CIRCLES = [\n (120.042098, 95.982449, 2.23644),\n (122.517474, 86.080947, 2.293784),\n (122.565261, 122.399197, 2.389359),\n (152.919672, 166.889052, 2.179095),\n (122.517474, 166.889052, 2.293784),\n (122.517474, 86.080947, 6.737991),\n (122.517474, 166.889052, 6.737991),\n (152.919672, 166.889052, 5.505082),\n (122.565261, 122.399197, 11.468921)\n]\nVISIBLE_ARCS = [\n (122.278538, 86.000506, 6.760158, 102.496963, -172.96875),\n (122.278538, 121.962477, 11.26693, -172.96875, -54.812008),\n (122.565261, 122.399197, 11.468921, 167.258023, -57.240634),\n (122.135176, 122.219922, 11.092249, 165.864682, 174.375),\n (121.830635, 166.67552, 6.576282, 173.126983, -82.686575),\n (153.471417, 166.67401, 5.523161, -116.116874, -87.890625),\n (135.578227, 155.033419, 5.603635, 93.085054, -172.696196)\n]\nHIDDEN_SEGMENTS = [\n (120.8157, 65.343, 120.8157, 63.527),\n (129.2057, 65.343, 129.2057, 63.527),\n (133.1247, 65.343, 133.1247, 63.527),\n (132.7253, 65.343, 132.7253, 63.527),\n (128.7712, 65.343, 128.7712, 63.527),\n (122.2785, 63.527, 122.2785, 65.343),\n (130.0201, 63.527, 130.0201, 65.343),\n (135.2766, 63.527, 135.2766, 65.343),\n (153.6747, 63.527, 153.6747, 65.343),\n (151.0401, 65.343, 151.0401, 63.527),\n (122.6678, 65.343, 122.6678, 63.527),\n (155.0988, 63.527, 155.0988, 65.343),\n (129.2555, 65.343, 129.2555, 63.527),\n (134.0342, 65.343, 134.0342, 63.527),\n (117.8057, 65.343, 117.8057, 63.527),\n (120.2237, 65.343, 120.2237, 63.527),\n (120.1759, 65.343, 120.1759, 63.527),\n (129.9746, 65.343, 129.9746, 63.527),\n (150.7406, 65.343, 150.7406, 63.527),\n (172.4248, 92.6005, 174.2407, 92.6005),\n (172.4248, 86.898, 174.2407, 86.898),\n (172.4248, 117.9233, 174.2407, 117.9233),\n (172.4248, 127.72, 174.2407, 127.72),\n (172.4248, 112.7544, 174.2407, 112.7544),\n (172.4248, 124.9288, 174.2407, 124.9288),\n (174.2407, 154.321, 172.4248, 154.321),\n (174.2407, 160.6289, 172.4248, 160.6289),\n (174.2407, 161.1546, 172.4248, 161.1546),\n (172.4248, 161.7148, 174.2407, 161.7148),\n (172.4248, 172.259, 174.2407, 172.259),\n (172.4248, 160.1527, 174.2407, 160.1527),\n (172.4248, 110.9303, 174.2407, 110.9303),\n (172.4248, 110.6955, 174.2407, 110.6955),\n (172.4248, 93.746, 174.2407, 93.746),\n (172.4248, 98.2189, 174.2407, 98.2189),\n (172.4248, 83.7872, 174.2407, 83.7872),\n (172.4248, 88.3747, 174.2407, 88.3747),\n (172.4248, 120.0098, 174.2407, 120.0098),\n (172.4248, 124.7886, 174.2407, 124.7886),\n (172.4248, 161.1508, 174.2407, 161.1508),\n (172.4248, 160.0992, 174.2407, 160.0992),\n (172.4248, 161.384, 174.2407, 161.384),\n (172.4248, 172.3941, 174.2407, 172.3941),\n (172.4248, 160.1511, 174.2407, 160.1511),\n (172.4248, 164.71, 174.2407, 164.71),\n (172.4248, 169.0681, 174.2407, 169.0681),\n (172.4248, 164.5953, 174.2407, 164.5953),\n (172.4248, 169.1828, 174.2407, 169.1828)\n]\n# (orient, text, p1, p2, base) for linear; (orient, text, center, radius, angle) for diameter\nDIMENSIONS = [\n ('diameter', '%%c30.382', (122.5175, 86.0809), 6.738, 45),\n ('diameter', '%%c10.3428', (122.5175, 86.0809), 2.2938, 135),\n ('diameter', '%%c30.382', (122.5175, 166.8891), 6.738, 45),\n ('diameter', '%%c10.3428', (122.5175, 166.8891), 2.2938, 135),\n ('diameter', '%%c24.8227', (152.9197, 166.8891), 5.5051, 45),\n ('diameter', '%%c9.8257', (152.9197, 166.8891), 2.1791, 135),\n ('horizontal', '50.4212', (111.0963, 120.5833), (133.4607, 120.5833), (122.2785, 131.5833)),\n ('vertical', '79.8336', (133.4607, 120.5833), (133.4607, 85.173), (144.4607, 102.8781)),\n ('aligned', '80.4679', (115.5692, 85.173), (111.0963, 120.5833), (102.4195, 101.4996)),\n ('diameter', '%%c10.0842', (120.0421, 95.9824), 2.2364, 45),\n ('horizontal', '20.1685', (111.0963, 95.9824), (120.0421, 95.9824), (115.5692, 106.9824)),\n ('vertical', '55.4634', (120.0421, 120.5833), (120.0421, 95.9824), (131.0421, 108.2829)),\n ('radius', 'R25.4016', (122.2785, 121.9625), 11.2669, 45),\n ('radius', 'R15.241', (122.2785, 86.0005), 6.7602, 225),\n ('diameter', '%%c51.7141', (122.5653, 122.3992), 11.4689, 135),\n ('diameter', '%%c10.7738', (122.5653, 122.3992), 2.3894, 225),\n ('horizontal', '95.9942', (111.0963, 173.2447), (153.6747, 173.2447), (132.3855, 184.2447)),\n ('vertical', '112.586', (153.6747, 173.2447), (153.6747, 123.3072), (164.6747, 148.2759)),\n ('aligned', '41.4959', (153.6747, 161.1546), (135.2767, 160.6289), (144.7898, 149.8963)),\n ('aligned', '100', (111.0963, 123.3072), (115.3016, 167.4625), (102.2485, 146.4277)),\n ('radius', 'R14.8264', (121.8306, 166.6755), 6.5763, 225),\n ('radius', 'R12.4521', (153.4714, 166.674), 5.5231, 45),\n ('radius', 'R12.6336', (135.5782, 155.0334), 5.6037, 45),\n ('radius', 'R25.0078', (122.1352, 122.2199), 11.0922, 315),\n ('horizontal', '4.094', (174.2407, 86.0809), (172.4248, 86.0809), (173.3327, 75.0809)),\n ('horizontal', '4.094', (174.2407, 166.8891), (172.4248, 166.8891), (173.3327, 145.8891)),\n ('horizontal', '4.094', (174.2407, 120.5833), (172.4248, 120.5833), (173.3327, 109.5833)),\n ('horizontal', '4.094', (174.2407, 167.4625), (172.4248, 167.4625), (173.3327, 156.4625))\n]\n\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; _ds.dxf.dimasz = 2.5\n _ds.dxf.dimexe = 1.25; _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\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\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,\n angle=(0 if d[0] == \"horizontal\" else 90),\n 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,\n 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,\n 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,\n text=text, dimstyle=\"EZDXF\").render()\n\n doc.saveas(out_path)\n\n\nif __name__ == \"__main__\":\n out = sys.argv[1] if len(sys.argv) > 1 else \"0004_00045081_gt.dxf\"\n draw(out)\n print(\"wrote\", out)\n```"}], "images": ["images/0004_00045081.png"], "id": "0004_00045081"} {"messages": [{"role": "user", "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 23.16 mm tall. It is extruded to a thickness of 0.82 mm. A cut feature: The part is a circular plate with diameter 5.68 mm. It is extruded to a thickness of -14.75 mm. A cut feature: The part is a circular plate with diameter 3.24 mm. It is extruded to a thickness of -14.75 mm. A cut feature: The part is a circular plate with diameter 3.24 mm. It is extruded to a thickness of -14.75 mm. A cut feature: The part is a polygonal plate with 7 straight edges. It is extruded to a thickness of -14.75 mm. The outline includes one or more oblique (angled) edges."}, {"role": "assistant", "content": "```python\n#!/usr/bin/env python3\n# -*- coding: utf-8 -*-\n# Ground-truth 2D engineering drawing for part: 0005_00058458\n# Self-contained: reproduces the three-view DXF via ezdxf, NO FreeCAD needed.\n# Coordinates are A4 page millimetres (scale=1.1931025641026067, page=[297.0, 210.0]).\n# visible edges -> solid (layer OUTLINE); hidden edges -> dashed (layer HIDDEN)\n# dimensions -> real movable DIMENSION entities (text = true mm value)\n# Run: python 0005_00058458_gt.py [out.dxf]\nimport sys\nimport ezdxf\nimport math\n\nSCALE = 1.1931025641026067\nPAGE = [297.0, 210.0]\n\nVISIBLE_SEGMENTS = [\n (75.866919, 138.792825, 157.917408, 138.792825),\n (75.866919, 111.163081, 75.866919, 138.792825),\n (195.177175, 115.641076, 187.428849, 115.641076),\n (195.177175, 115.641076, 195.177175, 111.163081),\n (195.177175, 111.163081, 75.866919, 111.163081),\n (152.394111, 131.837437, 152.147247, 131.947154),\n (156.223766, 130.135368, 155.927235, 130.26716),\n (184.545288, 117.843213, 183.85351, 118.811702),\n (157.917408, 95.207175, 157.917408, 97.163081),\n (75.866919, 95.207175, 157.917408, 95.207175),\n (75.866919, 97.163081, 75.866919, 95.207175),\n (157.917408, 97.163081, 75.866919, 97.163081),\n (157.917408, 97.163081, 184.591631, 97.163081),\n (187.428849, 97.163081, 184.591631, 97.163081),\n (195.177175, 97.163081, 187.428849, 97.163081),\n (195.177175, 95.207175, 187.428849, 95.207175),\n (157.917408, 95.207175, 184.591631, 95.207175),\n (187.428849, 95.207175, 184.591631, 95.207175),\n (195.177175, 95.207175, 195.177175, 97.163081),\n (187.428849, 95.207175, 187.428849, 97.163081),\n (184.591631, 95.207175, 184.591631, 97.163081),\n (209.177175, 138.792825, 211.133081, 138.792825),\n (209.177175, 111.163081, 209.177175, 138.792825),\n (209.177175, 111.163081, 211.133081, 111.163081),\n (211.133081, 111.163081, 211.133081, 138.792825)\n]\nVISIBLE_CIRCLES = [\n (170.275406, 123.145578, 3.386805),\n (186.396187, 117.277861, 1.935317),\n (154.123741, 130.969201, 1.935317)\n]\nVISIBLE_ARCS = [\n (169.065938, 123.54117, 18.891869, 126.165753, 153.5797),\n (169.620996, 123.454489, 14.970635, -18.066838, 153.495662)\n]\nHIDDEN_SEGMENTS = [\n (152.1472, 97.1631, 152.1472, 95.2072),\n (152.3941, 95.2072, 152.3941, 97.1631),\n (183.8535, 97.1631, 183.8535, 95.2072),\n (156.2238, 97.1631, 156.2238, 95.2072),\n (155.9272, 95.2072, 155.9272, 97.1631),\n (173.6622, 95.2072, 173.6622, 97.1631),\n (152.1884, 95.2072, 152.1884, 97.1631),\n (166.8886, 95.2072, 166.8886, 97.1631),\n (209.1772, 131.9472, 211.1331, 131.9472),\n (211.1331, 131.8374, 209.1772, 131.8374),\n (211.1331, 115.6411, 209.1772, 115.6411),\n (211.1331, 117.8432, 209.1772, 117.8432),\n (209.1772, 118.8117, 211.1331, 118.8117),\n (209.1772, 130.1354, 211.1331, 130.1354),\n (211.1331, 130.2672, 209.1772, 130.2672),\n (211.1331, 115.3425, 209.1772, 115.3425),\n (211.1331, 129.0339, 209.1772, 129.0339),\n (211.1331, 126.5324, 209.1772, 126.5324),\n (211.1331, 119.7588, 209.1772, 119.7588)\n]\n# (orient, text, p1, p2, base) for linear; (orient, text, center, radius, angle) for diameter\nDIMENSIONS = [\n ('horizontal', '100', (195.1772, 111.1631), (75.8669, 111.1631), (135.5221, 100.1631)),\n ('diameter', '%%c5.6773', (170.2754, 123.1456), 3.3868, 45),\n ('horizontal', '79.1285', (75.8669, 138.7929), (170.2754, 138.7929), (123.0712, 149.7929)),\n ('vertical', '13.1148', (170.2754, 138.7929), (170.2754, 123.1456), (181.2754, 130.9692)),\n ('diameter', '%%c3.2442', (186.3962, 117.2779), 1.9353, 45),\n ('horizontal', '92.6402', (75.8669, 138.7929), (186.3962, 138.7929), (131.1316, 149.7929)),\n ('vertical', '18.0328', (186.3962, 138.7929), (186.3962, 117.2779), (197.3962, 128.0354)),\n ('diameter', '%%c3.2442', (154.1237, 130.9692), 1.9353, 45),\n ('horizontal', '65.591', (75.8669, 138.7929), (154.1237, 138.7929), (114.9953, 149.7929)),\n ('vertical', '6.5574', (154.1237, 138.7929), (154.1237, 130.9692), (165.1237, 134.8811)),\n ('horizontal', '36.0656', (152.1472, 139.1944), (195.1772, 139.1944), (173.6622, 150.1944)),\n ('vertical', '19.7412', (195.1772, 139.1944), (195.1772, 115.6411), (206.1772, 127.4177)),\n ('horizontal', '63.9344', (75.8669, 138.7929), (152.1472, 138.7929), (114.0071, 149.7929)),\n ('vertical', '0.3365', (152.1472, 138.7929), (152.1472, 139.1944), (141.1472, 138.9936)),\n ('radius', 'R15.8342', (169.0659, 123.5412), 18.8918, 135),\n ('radius', 'R12.5477', (169.6209, 123.4545), 14.9707, 225),\n ('horizontal', '1.6393', (192.552, 123.1456), (227.7583, 123.1456), (210.1551, 134.1456)),\n ('horizontal', '1.6393', (192.552, 130.9692), (227.7583, 130.9692), (210.1551, 161.9692))\n]\n\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; _ds.dxf.dimasz = 2.5\n _ds.dxf.dimexe = 1.25; _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\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\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,\n angle=(0 if d[0] == \"horizontal\" else 90),\n 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,\n 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,\n 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,\n text=text, dimstyle=\"EZDXF\").render()\n\n doc.saveas(out_path)\n\n\nif __name__ == \"__main__\":\n out = sys.argv[1] if len(sys.argv) > 1 else \"0005_00058458_gt.dxf\"\n draw(out)\n print(\"wrote\", out)\n```"}], "images": ["images/0005_00058458.png"], "id": "0005_00058458"} {"messages": [{"role": "user", "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 41.03 mm wide and 1.73 mm tall. It is extruded to a thickness of 123.08 mm. A cut feature: The part is a polygonal plate with 2 straight edges. It is extruded to a thickness of -2.56 mm."}, {"role": "assistant", "content": "```python\n#!/usr/bin/env python3\n# -*- coding: utf-8 -*-\n# Ground-truth 2D engineering drawing for part: 0008_00085407\n# Self-contained: reproduces the three-view DXF via ezdxf, NO FreeCAD needed.\n# Coordinates are A4 page millimetres (scale=0.770005406574413, page=[297.0, 210.0]).\n# visible edges -> solid (layer OUTLINE); hidden edges -> dashed (layer HIDDEN)\n# dimensions -> real movable DIMENSION entities (text = true mm value)\n# Run: python 0008_00085407_gt.py [out.dxf]\nimport sys\nimport ezdxf\nimport math\n\nSCALE = 0.770005406574413\nPAGE = [297.0, 210.0]\n\nVISIBLE_SEGMENTS = [\n (104.910035, 172.05, 73.320069, 172.05),\n (73.320069, 170.719896, 104.910035, 170.719896),\n (73.320069, 172.05, 73.320069, 170.719896),\n (104.910035, 170.719896, 104.910035, 172.05),\n (104.910035, 156.719896, 104.910035, 148.822405),\n (104.910035, 156.719896, 73.320069, 156.719896),\n (104.910035, 71.821864, 104.910035, 61.95),\n (104.910035, 61.95, 73.320069, 61.95),\n (73.320069, 156.719896, 73.320069, 61.95),\n (118.910035, 172.05, 118.910035, 170.719896),\n (118.910035, 172.05, 213.679931, 172.05),\n (118.910035, 170.719896, 213.679931, 170.719896),\n (213.679931, 172.05, 213.679931, 170.719896)\n]\nVISIBLE_CIRCLES = [\n\n]\nVISIBLE_ARCS = [\n (164.0892, 110.322134, 70.600598, 146.953125, -146.953125)\n]\nHIDDEN_SEGMENTS = [\n (93.4886, 172.05, 93.4886, 170.7199),\n (126.8075, 170.7199, 126.8075, 172.05),\n (203.8081, 170.7199, 203.8081, 172.05)\n]\n# (orient, text, p1, p2, base) for linear; (orient, text, center, radius, angle) for diameter\nDIMENSIONS = [\n ('horizontal', '41.0256', (104.91, 172.05), (73.3201, 172.05), (89.115, 161.05)),\n ('vertical', '1.7274', (104.91, 170.7199), (104.91, 172.05), (93.91, 171.385)),\n ('horizontal', '123.077', (118.91, 170.7199), (213.6799, 170.7199), (166.295, 181.7199)),\n ('radius', 'R91.6884', (164.0892, 110.3221), 70.6006, 45)\n]\n\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; _ds.dxf.dimasz = 2.5\n _ds.dxf.dimexe = 1.25; _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\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\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,\n angle=(0 if d[0] == \"horizontal\" else 90),\n 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,\n 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,\n 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,\n text=text, dimstyle=\"EZDXF\").render()\n\n doc.saveas(out_path)\n\n\nif __name__ == \"__main__\":\n out = sys.argv[1] if len(sys.argv) > 1 else \"0008_00085407_gt.dxf\"\n draw(out)\n print(\"wrote\", out)\n```"}], "images": ["images/0008_00085407.png"], "id": "0008_00085407"} {"messages": [{"role": "user", "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 7 straight edges, featuring a rectangular cutout 13.52 x 2.64 mm. It is extruded to a thickness of 3.61 mm. The outline includes one or more oblique (angled) edges. A union feature: The part is a rectangular plate 100 mm wide and 5.26 mm tall. It is extruded to a thickness of 1.2 mm."}, {"role": "assistant", "content": "```python\n#!/usr/bin/env python3\n# -*- coding: utf-8 -*-\n# Ground-truth 2D engineering drawing for part: 0009_00097591\n# Self-contained: reproduces the three-view DXF via ezdxf, NO FreeCAD needed.\n# Coordinates are A4 page millimetres (scale=1.210181674294638, page=[297.0, 210.0]).\n# visible edges -> solid (layer OUTLINE); hidden edges -> dashed (layer HIDDEN)\n# dimensions -> real movable DIMENSION entities (text = true mm value)\n# Run: python 0009_00097591_gt.py [out.dxf]\nimport sys\nimport ezdxf\nimport math\n\nSCALE = 1.210181674294638\nPAGE = [297.0, 210.0]\n\nVISIBLE_SEGMENTS = [\n (80.737062, 133.65154, 80.737062, 132.454404),\n (64.974772, 133.65154, 80.737062, 133.65154),\n (76.852883, 130.727697, 64.974772, 133.65154),\n (82.931811, 130.060132, 83.929425, 130.060132),\n (83.929425, 130.060132, 83.929425, 140.036265),\n (83.929425, 140.036265, 64.974772, 140.036265),\n (64.974772, 140.036265, 64.974772, 133.65154),\n (83.929425, 133.65154, 204.947592, 133.65154),\n (204.947592, 133.65154, 204.947592, 140.020917),\n (204.947592, 140.020917, 83.929425, 140.020917),\n (64.974772, 103.224805, 62.381743, 103.224805),\n (204.947592, 103.224805, 83.929425, 103.224805),\n (83.929425, 103.224805, 64.974772, 103.224805),\n (64.974772, 98.850655, 62.381743, 98.850655),\n (83.929425, 98.850655, 64.974772, 98.850655),\n (64.974772, 103.224805, 64.974772, 98.850655),\n (83.929425, 103.224805, 83.929425, 98.850655),\n (204.947592, 101.766755, 83.929425, 101.766755),\n (204.947592, 103.224805, 204.947592, 101.766755),\n (62.381743, 98.850655, 62.381743, 103.224805),\n (218.947592, 133.65154, 223.321743, 133.65154),\n (218.947592, 133.65154, 218.947592, 117.224806),\n (218.947592, 140.036265, 218.947592, 133.65154),\n (223.321743, 133.65154, 223.321743, 117.224806),\n (223.321743, 140.036265, 223.321743, 133.65154),\n (218.947592, 140.036265, 223.321743, 140.036265),\n (223.321743, 117.224806, 218.947592, 117.224806)\n]\nVISIBLE_CIRCLES = [\n\n]\nVISIBLE_ARCS = [\n (79.780387, 129.374389, 3.22517, 72.744822, 155.190136),\n (72.171663, 127.014726, 9.78992, 137.318435, -0.094117),\n (79.780387, 129.374389, 3.22517, -47.444796, 12.276072)\n]\nHIDDEN_SEGMENTS = [\n (80.7371, 103.2248, 80.7371, 98.8507),\n (76.8529, 98.8507, 76.8529, 103.2248),\n (82.9318, 103.2248, 82.9318, 98.8507),\n (81.9616, 98.8507, 81.9616, 103.2248),\n (83.0056, 98.8507, 83.0056, 103.2248),\n (218.9476, 132.4544, 223.3217, 132.4544),\n (223.3217, 130.7277, 218.9476, 130.7277),\n (220.4056, 140.0209, 220.4056, 133.6515),\n (218.9476, 130.0601, 223.3217, 130.0601),\n (223.3217, 126.9986, 218.9476, 126.9986),\n (223.3217, 132.5996, 218.9476, 132.5996)\n]\n# (orient, text, p1, p2, base) for linear; (orient, text, center, radius, angle) for diameter\nDIMENSIONS = [\n ('horizontal', '0.8244', (82.9318, 130.0601), (83.9295, 130.0601), (83.4306, 141.0601)),\n ('horizontal', '13.0247', (64.9748, 133.6515), (80.737, 133.6515), (72.8559, 144.6515)),\n ('horizontal', '15.6627', (83.9295, 140.0362), (64.9748, 140.0362), (74.4521, 129.0362)),\n ('vertical', '0.9892', (80.737, 133.6515), (80.737, 132.4544), (91.737, 133.053)),\n ('vertical', '5.2758', (64.9748, 140.0362), (64.9748, 133.6515), (75.9748, 136.8439)),\n ('vertical', '8.2435', (83.9295, 130.0601), (83.9295, 140.0362), (72.9295, 135.0481)),\n ('horizontal', '13.5193', (64.9748, 130.4592), (81.3356, 130.4592), (73.1552, 141.4592)),\n ('vertical', '2.6379', (64.9748, 130.4592), (64.9748, 133.6515), (53.9748, 132.0554)),\n ('vertical', '0.3298', (64.9748, 130.0601), (64.9748, 130.4592), (53.9748, 130.2596)),\n ('radius', 'R2.665', (79.7804, 129.3744), 3.2251, 45),\n ('radius', 'R8.0896', (72.1717, 127.0148), 9.7899, 45),\n ('horizontal', '100', (83.9295, 133.6515), (204.9477, 133.6515), (144.4386, 144.6515)),\n ('vertical', '5.2632', (204.9477, 133.6515), (204.9477, 140.021), (193.9477, 136.8363)),\n ('horizontal', '15.6627', (64.9748, 130.0601), (83.9295, 130.0601), (74.4521, 141.0601)),\n ('vertical', '2.9677', (83.9295, 130.0601), (83.9295, 133.6515), (72.9295, 131.8558)),\n ('horizontal', '3.6145', (218.9476, 133.6515), (223.3218, 133.6515), (221.1347, 144.6515)),\n ('horizontal', '1.2048', (218.9476, 133.6515), (220.4056, 133.6515), (219.6766, 144.6515))\n]\n\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; _ds.dxf.dimasz = 2.5\n _ds.dxf.dimexe = 1.25; _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\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\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,\n angle=(0 if d[0] == \"horizontal\" else 90),\n 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,\n 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,\n 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,\n text=text, dimstyle=\"EZDXF\").render()\n\n doc.saveas(out_path)\n\n\nif __name__ == \"__main__\":\n out = sys.argv[1] if len(sys.argv) > 1 else \"0009_00097591_gt.dxf\"\n draw(out)\n print(\"wrote\", out)\n```"}], "images": ["images/0009_00097591.png"], "id": "0009_00097591"} {"messages": [{"role": "user", "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 33.33 mm. A cut feature: The part is a rectangular plate 54.47 mm wide and 95.83 mm tall. It is extruded to a thickness of -32.29 mm. A cut feature: The part is a rectangular plate 95.83 mm wide and 31.27 mm tall. It is extruded to a thickness of -9.38 mm. A cut feature: The part is a rectangular plate 1.58 mm wide and 8.59 mm tall. It is extruded to a thickness of -4.17 mm. A cut feature: The part is a rectangular plate 1.49 mm wide and 8.11 mm tall. It is extruded to a thickness of -4.17 mm."}, {"role": "assistant", "content": "```python\n#!/usr/bin/env python3\n# -*- coding: utf-8 -*-\n# Ground-truth 2D engineering drawing for part: 0010_00109367\n# Self-contained: reproduces the three-view DXF via ezdxf, NO FreeCAD needed.\n# Coordinates are A4 page millimetres (scale=0.7207500000000019, page=[297.0, 210.0]).\n# visible edges -> solid (layer OUTLINE); hidden edges -> dashed (layer HIDDEN)\n# dimensions -> real movable DIMENSION entities (text = true mm value)\n# Run: python 0010_00109367_gt.py [out.dxf]\nimport sys\nimport ezdxf\nimport math\n\nSCALE = 0.7207500000000019\nPAGE = [297.0, 210.0]\n\nVISIBLE_SEGMENTS = [\n (148.386053, 99.975, 148.386053, 172.05),\n (100.588947, 99.975, 148.386053, 99.975),\n (148.386053, 172.05, 100.588947, 172.05),\n (100.588947, 172.05, 100.588947, 99.975),\n (141.352418, 101.476563, 141.352418, 170.548438),\n (102.09051, 101.476563, 141.352418, 101.476563),\n (102.09051, 170.548438, 102.09051, 101.476563),\n (141.352418, 170.548438, 102.09051, 170.548438),\n (144.13426, 154.995411, 144.13426, 149.151172),\n (145.209062, 149.151172, 145.209062, 154.995411),\n (144.13426, 163.597784, 144.13426, 157.409766),\n (145.272286, 157.409766, 145.272286, 163.597784),\n (148.386053, 85.975, 148.386053, 61.95),\n (148.386053, 61.95, 100.588947, 61.95),\n (100.588947, 85.975, 100.588947, 61.95),\n (148.386053, 85.975, 100.588947, 85.975),\n (162.386053, 99.975, 186.411053, 99.975),\n (162.386053, 172.05, 186.411053, 172.05),\n (162.386053, 172.05, 162.386053, 99.975),\n (186.411053, 172.05, 186.411053, 99.975)\n]\nVISIBLE_CIRCLES = [\n\n]\nVISIBLE_ARCS = [\n (144.671661, 149.144577, 0.537442, 179.296875, 0.703125),\n (144.671661, 154.982219, 0.537563, 1.40625, 178.59375),\n (144.703273, 157.423734, 0.569185, -178.59375, -1.40625),\n (144.703273, 163.604767, 0.569056, -0.703125, -179.296875)\n]\nHIDDEN_SEGMENTS = [\n (141.3524, 61.95, 141.3524, 85.2242),\n (102.0905, 61.95, 102.0905, 85.2242),\n (141.3524, 85.2242, 102.0905, 85.2242),\n (144.1343, 61.95, 144.1343, 64.9531),\n (144.1343, 64.9531, 144.1342, 64.9531),\n (145.2091, 61.95, 145.2091, 64.9531),\n (144.1343, 64.9531, 145.2723, 64.9531),\n (145.2723, 61.95, 145.2723, 64.9531),\n (144.1342, 64.9531, 144.1343, 64.9531),\n (144.1342, 64.9531, 144.1342, 61.95),\n (145.2091, 64.9531, 145.2091, 61.95),\n (145.2723, 64.9531, 145.2723, 61.95),\n (186.4111, 101.4766, 163.1368, 101.4766),\n (163.1368, 101.4766, 163.1368, 170.5484),\n (186.4111, 170.5484, 163.1368, 170.5484),\n (186.4111, 149.1512, 183.4079, 149.1512),\n (183.4079, 149.1512, 183.4079, 148.6071),\n (183.4079, 149.1512, 183.4079, 154.9954),\n (186.4111, 154.9954, 183.4079, 154.9954),\n (183.4079, 154.9954, 183.4079, 155.5198),\n (186.4111, 157.4098, 183.4079, 157.4098),\n (183.4079, 157.4098, 183.4079, 156.8545),\n (186.4111, 163.5978, 183.4079, 163.5978),\n (183.4079, 163.5978, 183.4079, 157.4098),\n (183.4079, 163.5978, 183.4079, 164.1738),\n (183.4079, 148.6071, 186.4111, 148.6071),\n (183.4079, 155.5198, 186.4111, 155.5198),\n (183.4079, 156.8545, 186.4111, 156.8545),\n (183.4079, 164.1738, 186.4111, 164.1738)\n]\n# (orient, text, p1, p2, base) for linear; (orient, text, center, radius, angle) for diameter\nDIMENSIONS = [\n ('horizontal', '66.3158', (148.3861, 172.05), (100.589, 172.05), (124.4875, 161.05)),\n ('vertical', '100', (148.3861, 99.975), (148.3861, 172.05), (137.3861, 136.0125)),\n ('horizontal', '54.4737', (102.0905, 101.4765), (141.3524, 101.4765), (121.7215, 112.4765)),\n ('vertical', '95.8333', (141.3524, 101.4765), (141.3524, 170.5485), (130.3524, 136.0125)),\n ('horizontal', '2.0833', (100.589, 99.975), (102.0905, 99.975), (101.3397, 110.975)),\n ('vertical', '2.0833', (102.0905, 99.975), (102.0905, 101.4765), (91.0905, 100.7258)),\n ('horizontal', '1.5789', (144.1342, 157.4098), (145.2723, 157.4098), (144.7033, 168.4098)),\n ('vertical', '8.5855', (145.2723, 157.4098), (145.2723, 163.5978), (134.2723, 160.5038)),\n ('horizontal', '60.4166', (100.589, 99.975), (144.1342, 99.975), (122.3616, 110.975)),\n ('vertical', '79.6875', (144.1342, 99.975), (144.1342, 157.4098), (133.1342, 128.6924)),\n ('radius', 'R0.7897', (144.7033, 157.4237), 0.5692, 45),\n ('horizontal', '1.4912', (144.1342, 149.1512), (145.2091, 149.1512), (144.6717, 160.1512)),\n ('vertical', '8.1086', (145.2091, 149.1512), (145.2091, 154.9954), (134.2091, 152.0733)),\n ('horizontal', '60.4166', (100.589, 99.975), (144.1342, 99.975), (122.3616, 110.975)),\n ('vertical', '68.2292', (144.1342, 99.975), (144.1342, 149.1512), (133.1342, 124.5631)),\n ('radius', 'R0.7457', (144.6716, 149.1446), 0.5375, 45),\n ('horizontal', '33.3333', (162.3861, 99.975), (186.411, 99.975), (174.3985, 110.975)),\n ('horizontal', '32.2917', (186.411, 101.4765), (163.1368, 101.4765), (174.7739, 90.4765)),\n ('horizontal', '32.2917', (163.1369, 170.5485), (185.6761, 170.5485), (174.4065, 181.5485)),\n ('horizontal', '4.1667', (186.411, 157.4098), (183.4079, 157.4098), (184.9095, 146.4098)),\n ('horizontal', '4.1667', (186.411, 149.1512), (183.4079, 149.1512), (184.9095, 138.1512))\n]\n\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; _ds.dxf.dimasz = 2.5\n _ds.dxf.dimexe = 1.25; _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\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\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,\n angle=(0 if d[0] == \"horizontal\" else 90),\n 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,\n 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,\n 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,\n text=text, dimstyle=\"EZDXF\").render()\n\n doc.saveas(out_path)\n\n\nif __name__ == \"__main__\":\n out = sys.argv[1] if len(sys.argv) > 1 else \"0010_00109367_gt.dxf\"\n draw(out)\n print(\"wrote\", out)\n```"}], "images": ["images/0010_00109367.png"], "id": "0010_00109367"} {"messages": [{"role": "user", "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 9 straight edges, featuring a rectangular cutout 51.65 x 50.55 mm. It is extruded to a thickness of 1431.71 mm. The outline includes one or more oblique (angled) edges. A cut feature: The part is a polygonal plate with 3 straight edges. It is extruded to a thickness of -59.65 mm. The outline includes one or more oblique (angled) edges. A cut feature: The part is a polygonal plate with 3 straight edges. It is extruded to a thickness of -59.65 mm. The outline includes one or more oblique (angled) edges. A cut feature: The part is a polygonal plate with 3 straight edges. It is extruded to a thickness of -59.65 mm. The outline includes one or more oblique (angled) edges."}, {"role": "assistant", "content": "```python\n#!/usr/bin/env python3\n# -*- coding: utf-8 -*-\n# Ground-truth 2D engineering drawing for part: 0011_00118047\n# Self-contained: reproduces the three-view DXF via ezdxf, NO FreeCAD needed.\n# Coordinates are A4 page millimetres (scale=0.06449868296280083, page=[297.0, 210.0]).\n# visible edges -> solid (layer OUTLINE); hidden edges -> dashed (layer HIDDEN)\n# dimensions -> real movable DIMENSION entities (text = true mm value)\n# Run: python 0011_00118047_gt.py [out.dxf]\nimport sys\nimport ezdxf\nimport math\n\nSCALE = 0.06449868296280083\nPAGE = [297.0, 210.0]\n\nVISIBLE_SEGMENTS = [\n (86.962059, 168.647872, 86.962059, 171.766489),\n (87.24557, 172.05, 90.809705, 172.05),\n (90.809705, 172.05, 93.695438, 172.05),\n (90.809705, 171.837367, 90.809705, 172.05),\n (90.809705, 171.837367, 90.718576, 171.837367),\n (90.718576, 171.837367, 90.718576, 168.647872),\n (90.435065, 168.293483, 87.24557, 168.293483),\n (87.174692, 168.576994, 87.174692, 171.837367),\n (90.505943, 168.576994, 87.174692, 168.576994),\n (90.505943, 171.837367, 90.505943, 168.576994),\n (87.174692, 171.837367, 90.505943, 171.837367),\n (93.695438, 171.837367, 90.809705, 171.837367),\n (93.695438, 171.837367, 93.695438, 172.05),\n (86.962059, 61.95, 87.24557, 61.95),\n (86.962059, 154.293483, 87.24557, 154.293483),\n (86.962059, 61.95, 86.962059, 154.293483),\n (87.24557, 61.95, 90.809705, 61.95),\n (90.809705, 154.293483, 87.24557, 154.293483),\n (93.695438, 151.407749, 90.809705, 154.293483),\n (93.695438, 64.835734, 93.695438, 151.407749),\n (90.809705, 61.95, 93.695438, 64.835734),\n (86.962059, 61.95, 86.960097, 61.95),\n (86.962059, 154.293483, 86.960097, 154.293483),\n (86.960097, 154.293483, 86.960097, 61.95),\n (87.24557, 61.95, 87.24557, 154.293483),\n (200.038922, 171.766489, 200.038922, 172.05),\n (200.038922, 172.05, 107.695439, 172.05),\n (107.695439, 171.766489, 107.695439, 172.05),\n (200.038922, 168.647872, 107.695439, 168.647872),\n (107.695439, 168.647872, 107.695439, 171.766489),\n (200.038922, 168.647872, 200.038922, 171.766489),\n (200.038922, 168.293483, 200.038922, 168.647872),\n (107.695439, 168.293483, 107.695439, 168.647872),\n (200.038922, 168.293483, 107.695439, 168.293483),\n (200.038922, 171.766489, 107.695439, 171.766489)\n]\nVISIBLE_CIRCLES = [\n\n]\nVISIBLE_ARCS = [\n (87.24557, 171.766489, 0.283511, 90.0, 180.0),\n (90.399627, 168.612433, 0.320912, -83.659808, 6.340192),\n (87.281009, 168.612433, 0.320912, 173.659808, -96.340192)\n]\nHIDDEN_SEGMENTS = [\n (90.4351, 61.95, 90.4351, 154.2935),\n (90.7186, 61.95, 90.7186, 154.2935),\n (90.5059, 61.95, 90.5059, 154.2935),\n (90.7205, 154.2935, 90.7205, 61.95)\n]\n# (orient, text, p1, p2, base) for linear; (orient, text, center, radius, angle) for diameter\nDIMENSIONS = [\n ('horizontal', '49.4505', (90.4351, 168.2935), (87.2456, 168.2935), (88.8403, 157.2935)),\n ('vertical', '48.3516', (86.9621, 168.6479), (86.9621, 171.7665), (75.9621, 170.2072)),\n ('vertical', '49.4505', (90.7186, 171.8374), (90.7186, 168.6479), (101.7186, 170.2426)),\n ('horizontal', '51.6484', (87.1747, 171.8374), (90.5059, 171.8374), (88.8403, 182.8374)),\n ('vertical', '50.5495', (87.1747, 171.8374), (87.1747, 168.577), (98.1747, 170.2072)),\n ('vertical', '3.2967', (87.1747, 172.05), (87.1747, 171.8374), (98.1747, 171.9437)),\n ('radius', 'R4.3956', (87.2456, 171.7665), 0.2835, 45),\n ('radius', 'R4.9755', (90.3996, 168.6124), 0.3209, 45),\n ('horizontal', '1431.71', (200.0389, 171.7665), (107.6954, 171.7665), (153.8672, 160.7665)),\n ('horizontal', '51.6484', (90.8097, 64.8357), (93.6954, 64.8357), (92.2526, 75.8357)),\n ('vertical', '1431.71', (93.6954, 154.2935), (93.6954, 151.4078), (104.6954, 152.8506))\n]\n\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; _ds.dxf.dimasz = 2.5\n _ds.dxf.dimexe = 1.25; _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\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\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,\n angle=(0 if d[0] == \"horizontal\" else 90),\n 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,\n 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,\n 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,\n text=text, dimstyle=\"EZDXF\").render()\n\n doc.saveas(out_path)\n\n\nif __name__ == \"__main__\":\n out = sys.argv[1] if len(sys.argv) > 1 else \"0011_00118047_gt.dxf\"\n draw(out)\n print(\"wrote\", out)\n```"}], "images": ["images/0011_00118047.png"], "id": "0011_00118047"} {"messages": [{"role": "user", "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 54.97 mm. The outline includes one or more oblique (angled) edges. A cut feature: The part is a rectangular plate 27.85 mm wide and 34.36 mm tall. It is extruded to a thickness of -10.31 mm. A cut feature: The part is a rectangular plate 27.85 mm wide and 34.36 mm tall. It is extruded to a thickness of -10.31 mm. A cut feature: The part is a rectangular plate 65.28 mm wide and 34.36 mm tall. It is extruded to a thickness of -10.31 mm."}, {"role": "assistant", "content": "```python\n#!/usr/bin/env python3\n# -*- coding: utf-8 -*-\n# Ground-truth 2D engineering drawing for part: 0012_00126385\n# Self-contained: reproduces the three-view DXF via ezdxf, NO FreeCAD needed.\n# Coordinates are A4 page millimetres (scale=0.9361499999999919, page=[297.0, 210.0]).\n# visible edges -> solid (layer OUTLINE); hidden edges -> dashed (layer HIDDEN)\n# dimensions -> real movable DIMENSION entities (text = true mm value)\n# Run: python 0012_00126385_gt.py [out.dxf]\nimport sys\nimport ezdxf\nimport math\n\nSCALE = 0.9361499999999919\nPAGE = [297.0, 210.0]\n\nVISIBLE_SEGMENTS = [\n (63.961071, 158.618929, 63.961071, 166.913929),\n (54.481071, 158.618929, 63.961071, 158.618929),\n (63.961071, 166.913929, 157.576071, 166.913929),\n (157.576071, 166.913929, 157.576071, 158.618929),\n (157.576071, 158.618929, 167.056071, 158.618929),\n (140.986071, 132.548929, 80.551071, 132.548929),\n (63.961071, 67.086071, 63.961071, 118.548928),\n (54.481071, 67.086071, 54.481071, 118.548928),\n (54.481071, 118.548928, 63.961071, 118.548928),\n (54.481071, 67.086071, 63.961071, 67.086071),\n (63.961071, 118.548928, 157.576071, 118.548928),\n (157.576071, 67.086071, 157.576071, 118.548928),\n (63.961071, 67.086071, 157.576071, 67.086071),\n (157.576071, 67.086071, 167.056071, 67.086071),\n (157.576071, 118.548928, 167.056071, 118.548928),\n (167.056071, 67.086071, 167.056071, 118.548928),\n (181.056072, 158.618929, 181.056072, 166.913929),\n (232.518929, 166.913929, 181.056072, 166.913929),\n (232.518929, 158.618929, 232.518929, 166.913929),\n (232.518929, 158.618929, 181.056072, 158.618929),\n (232.518929, 132.548929, 232.518929, 158.618929),\n (181.056072, 132.548929, 181.056072, 158.618929),\n (232.518929, 132.548929, 181.056072, 132.548929),\n (190.705357, 132.8875, 222.869643, 132.8875),\n (190.705357, 142.536786, 190.705357, 132.8875),\n (190.705357, 142.536786, 222.869643, 142.536786),\n (222.869643, 142.536786, 222.869643, 132.8875)\n]\nVISIBLE_CIRCLES = [\n\n]\nVISIBLE_ARCS = [\n (140.986071, 158.618929, 26.07, -90.0, 0.0),\n (80.551071, 158.618929, 26.07, -180.0, -90.0)\n]\nHIDDEN_SEGMENTS = [\n (60.0326, 142.5368, 161.5046, 142.5368),\n (76.3632, 108.8996, 76.3632, 76.7354),\n (60.0326, 108.8996, 60.0326, 76.7354),\n (161.5046, 108.8996, 161.5046, 76.7354),\n (145.174, 108.8996, 145.174, 76.7354),\n (60.0326, 76.7354, 161.5046, 76.7354),\n (161.5046, 108.8996, 60.0326, 108.8996)\n]\n# (orient, text, p1, p2, base) for linear; (orient, text, center, radius, angle) for diameter\nDIMENSIONS = [\n ('horizontal', '10.1266', (157.5761, 158.6189), (167.0561, 158.6189), (162.3161, 169.6189)),\n ('horizontal', '64.557', (140.986, 132.5489), (80.5511, 132.5489), (110.7686, 121.5489)),\n ('horizontal', '100', (63.9611, 166.9139), (157.5761, 166.9139), (110.7686, 177.9139)),\n ('vertical', '8.8608', (63.9611, 158.6189), (63.9611, 166.9139), (52.9611, 162.7664)),\n ('radius', 'R27.8481', (140.986, 158.6189), 26.07, 45),\n ('horizontal', '54.9729', (232.5189, 158.6189), (181.056, 158.6189), (206.7875, 147.6189)),\n ('horizontal', '64.557', (54.4811, 108.8997), (80.5511, 108.8997), (67.5161, 119.8997)),\n ('vertical', '34.358', (167.3946, 108.8997), (167.3946, 76.7353), (178.3946, 92.8175)),\n ('vertical', '34.358', (141.3246, 108.8997), (141.3246, 76.7353), (152.3246, 92.8175))\n]\n\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; _ds.dxf.dimasz = 2.5\n _ds.dxf.dimexe = 1.25; _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\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\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,\n angle=(0 if d[0] == \"horizontal\" else 90),\n 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,\n 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,\n 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,\n text=text, dimstyle=\"EZDXF\").render()\n\n doc.saveas(out_path)\n\n\nif __name__ == \"__main__\":\n out = sys.argv[1] if len(sys.argv) > 1 else \"0012_00126385_gt.dxf\"\n draw(out)\n print(\"wrote\", out)\n```"}], "images": ["images/0012_00126385.png"], "id": "0012_00126385"} {"messages": [{"role": "user", "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 9.79 mm. A union feature: The part is a rectangular plate 29.89 mm wide and 27.69 mm tall. It is extruded to a thickness of 9.79 mm. A union feature: The part is a rectangular plate 29.89 mm wide and 27.69 mm tall. It is extruded to a thickness of 9.79 mm."}, {"role": "assistant", "content": "```python\n#!/usr/bin/env python3\n# -*- coding: utf-8 -*-\n# Ground-truth 2D engineering drawing for part: 0013_00130804\n# Self-contained: reproduces the three-view DXF via ezdxf, NO FreeCAD needed.\n# Coordinates are A4 page millimetres (scale=0.8036091098811375, page=[297.0, 210.0]).\n# visible edges -> solid (layer OUTLINE); hidden edges -> dashed (layer HIDDEN)\n# dimensions -> real movable DIMENSION entities (text = true mm value)\n# Run: python 0013_00130804_gt.py [out.dxf]\nimport sys\nimport ezdxf\nimport math\n\nSCALE = 0.8036091098811375\nPAGE = [297.0, 210.0]\n\nVISIBLE_SEGMENTS = [\n (109.262874, 117.083085, 109.262874, 94.830367),\n (133.285694, 94.830367, 133.285694, 117.083085),\n (133.285694, 148.674619, 133.285694, 170.927337),\n (109.262874, 170.927337, 109.262874, 148.674619),\n (161.873286, 78.755074, 81.512375, 78.755074),\n (161.873286, 78.755074, 161.873286, 70.88553),\n (161.873286, 70.88553, 81.512375, 70.88553),\n (109.262874, 70.88553, 109.262874, 63.015985),\n (133.285694, 70.88553, 133.285694, 63.015985),\n (133.285694, 63.015985, 109.262874, 63.015985),\n (81.512375, 70.88553, 81.512375, 78.755074),\n (175.873286, 173.115985, 175.873286, 92.755075),\n (183.742831, 173.115985, 183.742831, 92.755075),\n (191.612375, 94.830367, 191.612375, 92.97325),\n (183.742831, 94.830367, 191.612375, 94.830367),\n (183.742831, 117.083085, 191.612375, 117.083085),\n (191.612375, 117.083085, 191.612375, 94.830367),\n (183.742831, 148.674619, 191.612375, 148.674619),\n (183.742831, 170.927337, 191.612375, 170.927337),\n (191.612375, 172.784453, 191.612375, 170.927337),\n (191.612375, 170.927337, 191.612375, 148.674619),\n (183.742831, 173.115985, 175.873286, 173.115985),\n (183.742831, 92.755075, 175.873286, 92.755075),\n (191.612375, 92.97325, 183.742831, 92.97325),\n (191.612375, 172.784453, 183.742831, 172.784453)\n]\nVISIBLE_CIRCLES = [\n (121.692831, 132.93553, 40.180455)\n]\nVISIBLE_ARCS = [\n (121.274284, 132.745348, 39.772097, -107.578125, -72.421875),\n (121.274284, 133.278596, 20.163546, -126.5625, -53.4375),\n (121.274284, 132.479107, 20.163546, 53.4375, 126.5625),\n (121.274284, 133.012356, 39.772097, 72.421875, 107.578125)\n]\nHIDDEN_SEGMENTS = [\n (191.6124, 113.1151, 183.7428, 113.1151),\n (191.6124, 152.6427, 183.7428, 152.6427)\n]\n# (orient, text, p1, p2, base) for linear; (orient, text, center, radius, angle) for diameter\nDIMENSIONS = [\n ('diameter', '%%c100', (121.6928, 132.9355), 40.1805, 45),\n ('horizontal', '29.8937', (109.2629, 94.8304), (133.2857, 94.8304), (121.2743, 105.8304)),\n ('vertical', '27.691', (133.2857, 94.8304), (133.2857, 117.0831), (122.2857, 105.9567)),\n ('radius', 'R49.4918', (121.2743, 132.7453), 39.7721, 135),\n ('radius', 'R25.0912', (121.2743, 133.2786), 20.1635, 45),\n ('horizontal', '29.8937', (109.2629, 148.6746), (133.2857, 148.6746), (121.2743, 159.6746)),\n ('vertical', '27.691', (133.2857, 148.6746), (133.2857, 170.9274), (122.2857, 159.801)),\n ('radius', 'R25.0912', (121.2743, 132.4791), 20.1635, 225),\n ('radius', 'R49.4918', (121.2743, 133.0124), 39.7721, 135),\n ('horizontal', '9.7928', (175.8733, 132.9355), (183.7429, 132.9355), (179.8081, 143.9355)),\n ('horizontal', '9.7928', (183.7429, 94.8304), (191.6125, 94.8304), (187.6777, 105.8304)),\n ('horizontal', '9.7928', (183.7429, 148.6746), (191.6125, 148.6746), (187.6777, 159.6746))\n]\n\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; _ds.dxf.dimasz = 2.5\n _ds.dxf.dimexe = 1.25; _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\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\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,\n angle=(0 if d[0] == \"horizontal\" else 90),\n 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,\n 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,\n 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,\n text=text, dimstyle=\"EZDXF\").render()\n\n doc.saveas(out_path)\n\n\nif __name__ == \"__main__\":\n out = sys.argv[1] if len(sys.argv) > 1 else \"0013_00130804_gt.dxf\"\n draw(out)\n print(\"wrote\", out)\n```"}], "images": ["images/0013_00130804.png"], "id": "0013_00130804"} {"messages": [{"role": "user", "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 99.74 x 99.74 mm, featuring a circular hole of diameter 33.6 mm. It is extruded to a thickness of 51.09 mm. A union feature: The part is a rectangular plate 83.1 mm wide and 100 mm tall, featuring 4 circular holes, each of diameter 16.9 mm. It is extruded to a thickness of 17.03 mm."}, {"role": "assistant", "content": "```python\n#!/usr/bin/env python3\n# -*- coding: utf-8 -*-\n# Ground-truth 2D engineering drawing for part: 0013_00139834\n# Self-contained: reproduces the three-view DXF via ezdxf, NO FreeCAD needed.\n# Coordinates are A4 page millimetres (scale=0.43860171985477137, page=[297.0, 210.0]).\n# visible edges -> solid (layer OUTLINE); hidden edges -> dashed (layer HIDDEN)\n# dimensions -> real movable DIMENSION entities (text = true mm value)\n# Run: python 0013_00139834_gt.py [out.dxf]\nimport sys\nimport ezdxf\nimport math\n\nSCALE = 0.43860171985477137\nPAGE = [297.0, 210.0]\n\nVISIBLE_SEGMENTS = [\n (102.221956, 124.477351, 102.221956, 168.225205),\n (58.474102, 124.477351, 102.221956, 124.477351),\n (102.221956, 124.477351, 138.669141, 124.477351),\n (138.669141, 168.337523, 102.221956, 168.337523),\n (102.221956, 168.337523, 102.221956, 168.225205),\n (102.221956, 168.225205, 58.474102, 168.225205),\n (58.474102, 168.225205, 58.474102, 124.477351),\n (102.221956, 80.600768, 102.221956, 65.662477),\n (160.599227, 80.600768, 138.669141, 80.600768),\n (138.669141, 80.600768, 102.221956, 80.600768),\n (102.221956, 65.662477, 58.474102, 65.662477),\n (58.474102, 110.477351, 58.474102, 65.662477),\n (102.221956, 110.477351, 58.474102, 110.477351),\n (102.221956, 110.477351, 102.221956, 95.53906),\n (160.599227, 95.53906, 138.669141, 95.53906),\n (102.221956, 95.53906, 102.221956, 80.600768),\n (138.669141, 95.53906, 102.221956, 95.53906),\n (160.599227, 80.600768, 160.599227, 95.53906),\n (138.669141, 95.53906, 138.669141, 80.600768),\n (219.414102, 124.477351, 174.599227, 124.477351),\n (204.47581, 168.337523, 204.47581, 168.225205),\n (174.599227, 168.225205, 219.414102, 168.225205),\n (219.414102, 168.225205, 219.414102, 124.477351),\n (174.599227, 168.225205, 174.599227, 124.477351),\n (189.537519, 168.337523, 204.47581, 168.337523),\n (189.537519, 168.337523, 189.537519, 168.225205)\n]\nVISIBLE_CIRCLES = [\n (117.047929, 139.303325, 3.706493),\n (117.047929, 154.129299, 3.706493),\n (138.669141, 139.303325, 3.706493),\n (138.669141, 154.129299, 3.706493),\n (80.578281, 146.58153, 7.36806)\n]\nVISIBLE_ARCS = [\n (138.669141, 146.407437, 21.930086, -90.0, 90.0)\n]\nHIDDEN_SEGMENTS = [\n (120.7544, 80.6008, 120.7544, 95.5391),\n (142.3756, 80.6008, 142.3756, 95.5391),\n (87.9463, 65.6625, 87.9463, 110.4774),\n (113.3414, 80.6008, 113.3414, 95.5391),\n (134.9626, 80.6008, 134.9626, 95.5391),\n (73.2102, 65.6625, 73.2102, 110.4774),\n (204.4758, 143.0098, 189.5375, 143.0098),\n (204.4758, 135.5968, 189.5375, 135.5968),\n (204.4758, 157.8358, 189.5375, 157.8358),\n (204.4758, 150.4228, 189.5375, 150.4228),\n (219.4141, 153.9496, 174.5992, 153.9496),\n (219.4141, 139.2135, 174.5992, 139.2135)\n]\n# (orient, text, p1, p2, base) for linear; (orient, text, center, radius, angle) for diameter\nDIMENSIONS = [\n ('horizontal', '99.7439', (102.2219, 168.2252), (58.4741, 168.2252), (80.348, 157.2252)),\n ('vertical', '99.7439', (102.2219, 124.4774), (102.2219, 168.2252), (91.2219, 146.3513)),\n ('diameter', '%%c33.598', (80.5783, 146.5815), 7.3681, 45),\n ('horizontal', '50.3969', (58.4741, 146.5815), (80.5783, 146.5815), (69.5262, 157.5815)),\n ('vertical', '50.3969', (80.5783, 124.4774), (80.5783, 146.5815), (69.5783, 135.5294)),\n ('horizontal', '83.0986', (102.2219, 124.4774), (138.6691, 124.4774), (120.4455, 135.4774)),\n ('vertical', '100', (138.6691, 124.4774), (138.6691, 168.3375), (127.6691, 146.4074)),\n ('horizontal', '99.7439', (58.4741, 124.4774), (102.2219, 124.4774), (80.348, 135.4774)),\n ('diameter', '%%c16.9014', (117.0479, 139.3033), 3.7065, 45),\n ('horizontal', '33.8028', (102.2219, 139.3033), (117.0479, 139.3033), (109.6349, 150.3033)),\n ('vertical', '33.8028', (117.0479, 124.4774), (117.0479, 139.3033), (106.0479, 131.8903)),\n ('diameter', '%%c16.9014', (117.0479, 154.1293), 3.7065, 45),\n ('horizontal', '33.8028', (102.2219, 154.1293), (117.0479, 154.1293), (109.6349, 165.1293)),\n ('vertical', '67.6056', (117.0479, 124.4774), (117.0479, 154.1293), (106.0479, 139.3033)),\n ('diameter', '%%c16.9014', (138.6691, 139.3033), 3.7065, 45),\n ('horizontal', '83.0986', (102.2219, 139.3033), (138.6691, 139.3033), (120.4455, 150.3033)),\n ('vertical', '33.8028', (138.6691, 124.4774), (138.6691, 139.3033), (127.6691, 131.8903)),\n ('diameter', '%%c16.9014', (138.6691, 154.1293), 3.7065, 45),\n ('horizontal', '83.0986', (102.2219, 154.1293), (138.6691, 154.1293), (120.4455, 165.1293)),\n ('vertical', '67.6056', (138.6691, 124.4774), (138.6691, 154.1293), (127.6691, 139.3033)),\n ('radius', 'R50', (138.6691, 146.4074), 21.9301, 45),\n ('horizontal', '102.177', (174.5992, 124.4774), (219.4141, 124.4774), (197.0067, 135.4774)),\n ('horizontal', '34.0589', (189.5375, 124.4774), (204.4758, 124.4774), (197.0067, 135.4774))\n]\n\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; _ds.dxf.dimasz = 2.5\n _ds.dxf.dimexe = 1.25; _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\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\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,\n angle=(0 if d[0] == \"horizontal\" else 90),\n 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,\n 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,\n 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,\n text=text, dimstyle=\"EZDXF\").render()\n\n doc.saveas(out_path)\n\n\nif __name__ == \"__main__\":\n out = sys.argv[1] if len(sys.argv) > 1 else \"0013_00139834_gt.dxf\"\n draw(out)\n print(\"wrote\", out)\n```"}], "images": ["images/0013_00139834.png"], "id": "0013_00139834"} {"messages": [{"role": "user", "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 66.32 mm tall. It is extruded to a thickness of 33.33 mm. A union feature: The part is a rectangular plate 100 mm wide and 16.84 mm tall. It is extruded to a thickness of 16.67 mm."}, {"role": "assistant", "content": "```python\n#!/usr/bin/env python3\n# -*- coding: utf-8 -*-\n# Ground-truth 2D engineering drawing for part: 0014_00141163\n# Self-contained: reproduces the three-view DXF via ezdxf, NO FreeCAD needed.\n# Coordinates are A4 page millimetres (scale=0.826199095022577, page=[297.0, 210.0]).\n# visible edges -> solid (layer OUTLINE); hidden edges -> dashed (layer HIDDEN)\n# dimensions -> real movable DIMENSION entities (text = true mm value)\n# Run: python 0014_00141163_gt.py [out.dxf]\nimport sys\nimport ezdxf\nimport math\n\nSCALE = 0.826199095022577\nPAGE = [297.0, 210.0]\n\nVISIBLE_SEGMENTS = [\n (157.154977, 172.05, 157.154977, 117.259955),\n (74.535068, 172.05, 157.154977, 172.05),\n (157.154977, 117.259955, 144.979412, 117.259955),\n (90.189367, 117.259955, 74.535068, 117.259955),\n (74.535068, 117.259955, 74.535068, 172.05),\n (157.154977, 103.259955, 157.154977, 61.95),\n (74.535068, 103.259955, 74.535068, 61.95),\n (74.535068, 103.259955, 157.154977, 103.259955),\n (74.535068, 61.95, 157.154977, 61.95),\n (171.154977, 172.05, 212.464932, 172.05),\n (212.464932, 117.259955, 212.464932, 172.05),\n (184.924962, 117.259955, 184.924962, 158.135068),\n (212.464932, 117.259955, 184.924962, 117.259955),\n (184.924962, 158.135068, 171.154977, 158.135068),\n (171.154977, 158.135068, 171.154977, 172.05)\n]\nVISIBLE_CIRCLES = [\n\n]\nVISIBLE_ARCS = [\n (117.584389, 117.259955, 27.395023, -0.0, 180.0)\n]\nHIDDEN_SEGMENTS = [\n (157.155, 158.1351, 74.5351, 158.1351),\n (144.9794, 61.95, 144.9794, 89.49),\n (157.155, 89.49, 74.5351, 89.49),\n (90.1894, 61.95, 90.1894, 89.49),\n (184.925, 144.655, 212.4649, 144.655)\n]\n# (orient, text, p1, p2, base) for linear; (orient, text, center, radius, angle) for diameter\nDIMENSIONS = [\n ('horizontal', '100', (157.155, 117.2599), (74.5351, 117.2599), (115.845, 106.2599)),\n ('vertical', '66.3158', (157.155, 172.05), (157.155, 117.2599), (168.155, 144.655)),\n ('radius', 'R33.1579', (117.5844, 117.2599), 27.395, 45),\n ('horizontal', '100', (74.5351, 172.05), (157.155, 172.05), (115.845, 183.05))\n]\n\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; _ds.dxf.dimasz = 2.5\n _ds.dxf.dimexe = 1.25; _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\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\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,\n angle=(0 if d[0] == \"horizontal\" else 90),\n 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,\n 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,\n 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,\n text=text, dimstyle=\"EZDXF\").render()\n\n doc.saveas(out_path)\n\n\nif __name__ == \"__main__\":\n out = sys.argv[1] if len(sys.argv) > 1 else \"0014_00141163_gt.dxf\"\n draw(out)\n print(\"wrote\", out)\n```"}], "images": ["images/0014_00141163.png"], "id": "0014_00141163"} {"messages": [{"role": "user", "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 47.37 mm tall. It is extruded to a thickness of 25 mm. A union feature: The part is a rectangular plate 19.96 mm wide and 46.75 mm tall. It is extruded to a thickness of -36.46 mm. A union feature: The part is a rectangular plate 20.23 mm wide and 46.88 mm tall. It is extruded to a thickness of -36.46 mm."}, {"role": "assistant", "content": "```python\n#!/usr/bin/env python3\n# -*- coding: utf-8 -*-\n# Ground-truth 2D engineering drawing for part: 0014_00141438\n# Self-contained: reproduces the three-view DXF via ezdxf, NO FreeCAD needed.\n# Coordinates are A4 page millimetres (scale=0.7613779993077004, page=[297.0, 210.0]).\n# visible edges -> solid (layer OUTLINE); hidden edges -> dashed (layer HIDDEN)\n# dimensions -> real movable DIMENSION entities (text = true mm value)\n# Run: python 0014_00141438_gt.py [out.dxf]\nimport sys\nimport ezdxf\nimport math\n\nSCALE = 0.7613779993077004\nPAGE = [297.0, 210.0]\n\nVISIBLE_SEGMENTS = [\n (166.720695, 158.414802, 166.720695, 122.349528),\n (105.651834, 158.414802, 166.720695, 158.414802),\n (166.720695, 122.349528, 105.092553, 122.349528),\n (90.457668, 128.026469, 90.457668, 127.986458),\n (90.582895, 127.989158, 90.582895, 153.150852),\n (90.248957, 153.203643, 90.248957, 153.155283),\n (166.720695, 75.351442, 166.720695, 94.385892),\n (105.651834, 75.351442, 166.720695, 75.351442),\n (105.651834, 75.351442, 105.651834, 94.385892),\n (105.651834, 94.385892, 166.720695, 94.385892),\n (66.792508, 75.351442, 105.651834, 75.351442),\n (66.792508, 103.110015, 105.651834, 103.110015),\n (113.825352, 103.110015, 105.651834, 103.110015),\n (66.792508, 103.110015, 66.792508, 75.351442),\n (113.825352, 103.110015, 113.825352, 94.385892),\n (105.651834, 94.385892, 105.651834, 103.110015),\n (208.479268, 117.110015, 208.479268, 164.121828),\n (180.720695, 117.110015, 180.720695, 164.121828),\n (180.720695, 117.110015, 208.479268, 117.110015),\n (180.720695, 164.121828, 208.479268, 164.121828)\n]\nVISIBLE_CIRCLES = [\n\n]\nVISIBLE_ARCS = [\n (90.298414, 140.615921, 23.505907, 49.21875, -50.995634),\n (90.248957, 140.570005, 12.585278, -89.049778, -88.479536),\n (90.248957, 140.570005, 12.585278, 88.479536, 90.0),\n (90.457668, 140.615921, 12.589452, 90.949907, -90.0)\n]\nHIDDEN_SEGMENTS = [\n (105.6518, 122.7252, 105.6518, 158.4148),\n (105.0926, 94.3859, 105.0926, 75.3514),\n (90.4577, 75.3514, 90.4577, 103.11),\n (90.249, 103.11, 90.249, 75.3514),\n (90.5829, 94.3859, 90.5829, 75.3514),\n (90.5829, 94.3859, 102.8342, 94.3859),\n (77.8682, 103.11, 77.8682, 75.3514),\n (102.8342, 103.11, 102.8342, 94.3859),\n (208.4793, 158.4148, 189.4448, 158.4148),\n (189.4448, 158.4148, 189.4448, 122.3495),\n (208.4793, 122.3495, 189.4448, 122.3495),\n (180.7207, 122.7252, 189.4448, 122.7252),\n (208.4793, 128.0265, 180.7207, 128.0265),\n (180.7207, 127.9865, 208.4793, 127.9865),\n (180.7207, 153.2036, 208.4793, 153.2036),\n (189.4448, 153.1509, 208.4793, 153.1509),\n (189.4448, 127.9892, 208.4793, 127.9892),\n (208.4793, 153.1553, 180.7207, 153.1553)\n]\n# (orient, text, p1, p2, base) for linear; (orient, text, center, radius, angle) for diameter\nDIMENSIONS = [\n ('vertical', '47.3684', (166.7207, 158.4148), (166.7207, 122.3495), (177.7207, 140.3822)),\n ('horizontal', '20.2173', (105.6519, 158.4148), (90.4576, 158.4148), (98.0548, 147.4148)),\n ('vertical', '46.875', (90.4576, 158.4148), (90.4576, 122.817), (101.4576, 140.6159)),\n ('radius', 'R16.5351', (90.4576, 140.6159), 12.5895, 45),\n ('radius', 'R30.8728', (90.2984, 140.6159), 23.5059, 135),\n ('horizontal', '0.1645', (105.6519, 158.4148), (90.249, 158.4148), (97.9504, 147.4148)),\n ('radius', 'R16.5296', (90.249, 140.57), 12.5853, 225),\n ('radius', 'R30.9525', (90.2588, 140.57), 23.5666, 315),\n ('horizontal', '25', (208.4793, 158.4148), (189.4448, 158.4148), (198.962, 147.4148))\n]\n\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; _ds.dxf.dimasz = 2.5\n _ds.dxf.dimexe = 1.25; _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\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\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,\n angle=(0 if d[0] == \"horizontal\" else 90),\n 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,\n 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,\n 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,\n text=text, dimstyle=\"EZDXF\").render()\n\n doc.saveas(out_path)\n\n\nif __name__ == \"__main__\":\n out = sys.argv[1] if len(sys.argv) > 1 else \"0014_00141438_gt.dxf\"\n draw(out)\n print(\"wrote\", out)\n```"}], "images": ["images/0014_00141438.png"], "id": "0014_00141438"} {"messages": [{"role": "user", "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 28.86 mm. A cut feature: The part is a polygonal plate with 2 straight edges, featuring 2 circular holes, each of diameter 16.02 mm. It is extruded to a thickness of -20.62 mm."}, {"role": "assistant", "content": "```python\n#!/usr/bin/env python3\n# -*- coding: utf-8 -*-\n# Ground-truth 2D engineering drawing for part: 0016_00160663\n# Self-contained: reproduces the three-view DXF via ezdxf, NO FreeCAD needed.\n# Coordinates are A4 page millimetres (scale=0.7457541259683407, page=[297.0, 210.0]).\n# visible edges -> solid (layer OUTLINE); hidden edges -> dashed (layer HIDDEN)\n# dimensions -> real movable DIMENSION entities (text = true mm value)\n# Run: python 0016_00160663_gt.py [out.dxf]\nimport sys\nimport ezdxf\nimport math\n\nSCALE = 0.7457541259683407\nPAGE = [297.0, 210.0]\n\nVISIBLE_SEGMENTS = [\n (157.259898, 96.810121, 82.684485, 96.810121),\n (157.259898, 96.810121, 157.259898, 75.285534),\n (157.259898, 75.285534, 82.684485, 75.285534),\n (82.684485, 75.285534, 82.684485, 96.810121),\n (171.259898, 185.385534, 171.259898, 110.810121),\n (192.784486, 185.385534, 192.784486, 110.810121),\n (192.784486, 185.385534, 171.259898, 185.385534),\n (192.784486, 110.810121, 171.259898, 110.810121)\n]\nVISIBLE_CIRCLES = [\n (119.972192, 148.097828, 37.287706),\n (119.680882, 137.481189, 5.971859),\n (119.680882, 158.714466, 5.971859)\n]\nVISIBLE_ARCS = [\n (119.846766, 137.640389, 17.554894, 143.4375, 36.5625),\n (119.846766, 158.555266, 17.554894, -36.5625, -143.4375)\n]\nHIDDEN_SEGMENTS = [\n (105.7465, 75.2855, 105.7465, 90.6602),\n (102.2919, 90.6602, 137.4017, 90.6602),\n (133.947, 75.2855, 133.947, 90.6602),\n (125.6527, 75.2855, 125.6527, 90.6602),\n (102.2919, 90.6602, 102.2919, 75.2855),\n (137.4017, 90.6602, 137.4017, 75.2855),\n (113.709, 90.6602, 113.709, 75.2855),\n (192.7845, 148.0978, 177.4098, 148.0978),\n (177.4098, 148.0978, 177.4098, 120.0855),\n (177.4098, 148.0978, 177.4098, 176.1102),\n (177.4098, 120.0855, 192.7845, 120.0855),\n (177.4098, 176.1102, 192.7845, 176.1102),\n (177.4098, 131.5093, 192.7845, 131.5093),\n (177.4098, 143.453, 192.7845, 143.453),\n (177.4098, 152.7426, 192.7845, 152.7426),\n (177.4098, 164.6863, 192.7845, 164.6863)\n]\n# (orient, text, p1, p2, base) for linear; (orient, text, center, radius, angle) for diameter\nDIMENSIONS = [\n ('diameter', '%%c100', (119.9722, 148.0978), 37.2877, 45),\n ('diameter', '%%c16.0156', (119.6809, 137.4812), 5.9718, 45),\n ('horizontal', '18.6849', (105.7465, 137.4812), (119.6809, 137.4812), (112.7137, 148.4812)),\n ('vertical', '14.2361', (119.6809, 148.0978), (119.6809, 137.4812), (130.6809, 142.7895)),\n ('diameter', '%%c16.0156', (119.6809, 158.7145), 5.9718, 45),\n ('horizontal', '18.6849', (105.7465, 158.7145), (119.6809, 158.7145), (112.7137, 169.7145)),\n ('vertical', '14.2361', (119.6809, 148.0978), (119.6809, 158.7145), (108.6809, 153.4061)),\n ('radius', 'R23.5398', (119.8467, 137.6404), 17.5549, 135),\n ('horizontal', '28.8628', (171.2599, 148.0978), (192.7845, 148.0978), (182.0222, 159.0978)),\n ('horizontal', '20.6163', (192.7845, 148.0978), (177.4098, 148.0978), (185.0971, 137.0978))\n]\n\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; _ds.dxf.dimasz = 2.5\n _ds.dxf.dimexe = 1.25; _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\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\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,\n angle=(0 if d[0] == \"horizontal\" else 90),\n 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,\n 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,\n 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,\n text=text, dimstyle=\"EZDXF\").render()\n\n doc.saveas(out_path)\n\n\nif __name__ == \"__main__\":\n out = sys.argv[1] if len(sys.argv) > 1 else \"0016_00160663_gt.dxf\"\n draw(out)\n print(\"wrote\", out)\n```"}], "images": ["images/0016_00160663.png"], "id": "0016_00160663"} {"messages": [{"role": "user", "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 57.23 mm. The outline includes one or more oblique (angled) edges. A cut feature: The part is a circular plate with diameter 28.31 mm. It is extruded to a thickness of -114.46 mm. A cut feature: The part is a circular plate with diameter 28.92 mm. It is extruded to a thickness of -114.46 mm."}, {"role": "assistant", "content": "```python\n#!/usr/bin/env python3\n# -*- coding: utf-8 -*-\n# Ground-truth 2D engineering drawing for part: 0016_00163111\n# Self-contained: reproduces the three-view DXF via ezdxf, NO FreeCAD needed.\n# Coordinates are A4 page millimetres (scale=0.5597403508772021, page=[297.0, 210.0]).\n# visible edges -> solid (layer OUTLINE); hidden edges -> dashed (layer HIDDEN)\n# dimensions -> real movable DIMENSION entities (text = true mm value)\n# Run: python 0016_00163111_gt.py [out.dxf]\nimport sys\nimport ezdxf\nimport math\n\nSCALE = 0.5597403508772021\nPAGE = [297.0, 210.0]\n\nVISIBLE_SEGMENTS = [\n (88.45, 107.983333, 88.45, 163.957368),\n (96.542632, 172.05, 152.516667, 172.05),\n (152.516667, 172.05, 152.516667, 168.003684),\n (152.516667, 168.003684, 100.588947, 168.003684),\n (92.496316, 159.911053, 92.496316, 107.983333),\n (92.496316, 107.983333, 88.45, 107.983333),\n (88.45, 61.95, 96.542632, 61.95),\n (88.45, 93.983333, 96.542632, 93.983333),\n (88.45, 61.95, 88.45, 93.983333),\n (96.542632, 93.983333, 152.516667, 93.983333),\n (152.516667, 61.95, 152.516667, 93.983333),\n (96.542632, 61.95, 152.516667, 61.95),\n (96.542632, 61.95, 96.542632, 93.983333),\n (198.55, 163.957368, 198.55, 172.05),\n (198.55, 172.05, 166.516667, 172.05),\n (166.516667, 163.957368, 166.516667, 172.05),\n (198.55, 107.983333, 166.516667, 107.983333),\n (166.516667, 107.983333, 166.516667, 163.957368),\n (198.55, 107.983333, 198.55, 163.957368),\n (198.55, 163.957368, 166.516667, 163.957368)\n]\nVISIBLE_CIRCLES = [\n (140.588465, 77.966667, 7.924035),\n (182.617632, 119.911535, 8.092632)\n]\nVISIBLE_ARCS = [\n (96.542632, 163.957368, 8.092632, 90.0, -180.0),\n (100.588947, 159.911053, 8.092632, 90.0, -180.0)\n]\nHIDDEN_SEGMENTS = [\n (148.5125, 168.0037, 148.5125, 172.05),\n (88.45, 111.8189, 92.4542, 111.8189),\n (88.45, 128.0042, 92.4542, 128.0042),\n (132.6644, 172.05, 132.6644, 168.0037),\n (92.4963, 61.95, 92.4963, 93.9833),\n (92.4542, 69.7897, 92.4542, 85.975),\n (92.4542, 69.7897, 88.45, 69.7897),\n (88.45, 85.975, 92.4542, 85.975),\n (198.55, 168.0037, 166.5167, 168.0037),\n (174.6093, 172.05, 174.6093, 168.0037),\n (190.4574, 172.05, 190.4574, 168.0037)\n]\n# (orient, text, p1, p2, base) for linear; (orient, text, center, radius, angle) for diameter\nDIMENSIONS = [\n ('horizontal', '7.2289', (92.4963, 107.9833), (88.45, 107.9833), (90.4732, 96.9833)),\n ('horizontal', '92.7711', (152.5166, 168.0037), (100.5889, 168.0037), (126.5528, 157.0037)),\n ('horizontal', '100', (96.5426, 172.05), (152.5166, 172.05), (124.5296, 183.05)),\n ('vertical', '7.2289', (152.5166, 172.05), (152.5166, 168.0037), (163.5166, 170.0268)),\n ('vertical', '92.7711', (92.4963, 159.9111), (92.4963, 107.9833), (103.4963, 133.9472)),\n ('vertical', '100', (88.45, 107.9833), (88.45, 163.9574), (77.45, 135.9704)),\n ('radius', 'R14.4578', (96.5426, 163.9574), 8.0926, 45),\n ('horizontal', '57.2289', (198.55, 163.9574), (166.5167, 163.9574), (182.5333, 152.9574)),\n ('vertical', '14.4578', (182.5333, 167.9615), (182.5333, 232.0282), (171.5333, 199.9949)),\n ('diameter', '%%c28.9157', (182.6176, 119.9115), 8.0926, 45),\n ('vertical', '14.4578', (198.55, 172.05), (198.55, 172.05), (198.55, 172.05)),\n ('vertical', '7.2289', (198.55, 172.05), (198.55, 119.9115), (209.55, 145.9808)),\n ('diameter', '%%c28.3133', (140.5885, 77.9667), 7.924, 45),\n ('horizontal', '14.4578', (88.45, 61.95), (140.5885, 61.95), (114.5192, 72.95))\n]\n\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; _ds.dxf.dimasz = 2.5\n _ds.dxf.dimexe = 1.25; _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\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\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,\n angle=(0 if d[0] == \"horizontal\" else 90),\n 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,\n 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,\n 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,\n text=text, dimstyle=\"EZDXF\").render()\n\n doc.saveas(out_path)\n\n\nif __name__ == \"__main__\":\n out = sys.argv[1] if len(sys.argv) > 1 else \"0016_00163111_gt.dxf\"\n draw(out)\n print(\"wrote\", out)\n```"}], "images": ["images/0016_00163111.png"], "id": "0016_00163111"} {"messages": [{"role": "user", "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 87.57 mm. It is extruded to a thickness of 33.91 mm. A union feature: The part is a circular plate with diameter 34.27 mm. It is extruded to a thickness of 33.91 mm. A union feature: The part is a polygonal plate with 4 straight edges. It is extruded to a thickness of 33.91 mm. The outline includes one or more oblique (angled) edges. A union feature: The part is a circular plate with diameter 34.27 mm. It is extruded to a thickness of 33.91 mm."}, {"role": "assistant", "content": "```python\n#!/usr/bin/env python3\n# -*- coding: utf-8 -*-\n# Ground-truth 2D engineering drawing for part: 0017_00172973\n# Self-contained: reproduces the three-view DXF via ezdxf, NO FreeCAD needed.\n# Coordinates are A4 page millimetres (scale=0.41471085676537794, page=[297.0, 210.0]).\n# visible edges -> solid (layer OUTLINE); hidden edges -> dashed (layer HIDDEN)\n# dimensions -> real movable DIMENSION entities (text = true mm value)\n# Run: python 0017_00172973_gt.py [out.dxf]\nimport sys\nimport ezdxf\nimport math\n\nSCALE = 0.41471085676537794\nPAGE = [297.0, 210.0]\n\nVISIBLE_SEGMENTS = [\n (137.654902, 150.934565, 128.170361, 114.893308),\n (114.013258, 117.35509, 104.106982, 154.998939),\n (139.903245, 95.871195, 103.58613, 95.871195),\n (103.58613, 81.808181, 139.903245, 81.808181),\n (114.375997, 81.808181, 114.375997, 67.745168),\n (128.587043, 67.745168, 114.375997, 67.745168),\n (103.58613, 95.871195, 103.58613, 81.808181),\n (139.903245, 95.871195, 139.903245, 81.808181),\n (128.587043, 67.745168, 128.587043, 81.808181),\n (153.903245, 177.845168, 153.903245, 154.998939),\n (167.966259, 154.998939, 167.966259, 177.845168),\n (167.966259, 117.35509, 167.966259, 109.871195),\n (167.966259, 117.35509, 167.966259, 154.998939),\n (167.966259, 154.998939, 153.903245, 154.998939),\n (153.903245, 109.871195, 153.903245, 117.35509),\n (153.903245, 117.35509, 153.903245, 154.998939),\n (153.903245, 117.35509, 167.966259, 117.35509),\n (182.029272, 159.68661, 182.029272, 152.581088),\n (182.029272, 166.792133, 182.029272, 159.68661),\n (153.903245, 177.845168, 167.966259, 177.845168),\n (153.903245, 109.871195, 167.966259, 109.871195),\n (182.029272, 166.792133, 167.966259, 166.792133),\n (182.029272, 152.581088, 167.966259, 152.581088)\n]\nVISIBLE_CIRCLES = [\n (121.48152, 159.68661, 7.105523),\n (121.744688, 159.68661, 18.158558),\n (121.415728, 116.673624, 6.985312)\n]\nVISIBLE_ARCS = [\n (121.108699, 116.976717, 7.105523, 176.947528, 27.513084),\n (121.415728, 159.560999, 17.899863, -165.234375, -115.999139)\n]\nHIDDEN_SEGMENTS = [\n (137.6549, 95.8712, 137.6549, 81.8082),\n (113.5692, 95.8712, 113.5692, 81.8082),\n (104.107, 81.8082, 104.107, 95.8712),\n (127.4106, 95.8712, 127.4106, 81.8082),\n (153.9032, 150.9346, 167.9663, 150.9346),\n (153.9032, 143.4726, 167.9663, 143.4726),\n (167.9663, 114.8933, 153.9032, 114.8933),\n (153.9032, 120.2591, 167.9663, 120.2591)\n]\n# (orient, text, p1, p2, base) for linear; (orient, text, center, radius, angle) for diameter\nDIMENSIONS = [\n ('diameter', '%%c87.5721', (121.7447, 159.6866), 18.1586, 45),\n ('diameter', '%%c34.2674', (121.1087, 116.9767), 7.1055, 45),\n ('horizontal', '83.4739', (104.107, 154.9989), (138.7245, 154.9989), (121.4157, 165.9989)),\n ('vertical', '96.7074', (138.7245, 154.9989), (138.7245, 114.8933), (149.7245, 134.9461)),\n ('radius', 'R43.1623', (121.4157, 159.561), 17.8999, 135),\n ('radius', 'R16.8438', (121.4157, 116.6736), 6.9853, 135),\n ('diameter', '%%c34.2674', (121.4815, 159.6866), 7.1055, 225),\n ('horizontal', '33.9104', (167.9663, 159.6866), (153.9032, 159.6866), (160.9348, 148.6866)),\n ('horizontal', '33.9104', (167.9663, 116.9767), (153.9032, 116.9767), (160.9348, 95.9767)),\n ('horizontal', '33.9104', (167.9663, 154.9989), (153.9032, 154.9989), (160.9348, 143.9989)),\n ('horizontal', '33.9104', (167.9663, 159.6866), (182.0293, 159.6866), (174.9978, 190.6866))\n]\n\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; _ds.dxf.dimasz = 2.5\n _ds.dxf.dimexe = 1.25; _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\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\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,\n angle=(0 if d[0] == \"horizontal\" else 90),\n 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,\n 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,\n 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,\n text=text, dimstyle=\"EZDXF\").render()\n\n doc.saveas(out_path)\n\n\nif __name__ == \"__main__\":\n out = sys.argv[1] if len(sys.argv) > 1 else \"0017_00172973_gt.dxf\"\n draw(out)\n print(\"wrote\", out)\n```"}], "images": ["images/0017_00172973.png"], "id": "0017_00172973"} {"messages": [{"role": "user", "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 3.97 mm. The outline includes one or more oblique (angled) edges. A union feature: The part is a rectangular plate 19.87 mm wide and 15.06 mm tall. It is extruded to a thickness of 3.97 mm."}, {"role": "assistant", "content": "```python\n#!/usr/bin/env python3\n# -*- coding: utf-8 -*-\n# Ground-truth 2D engineering drawing for part: 0017_00178447\n# Self-contained: reproduces the three-view DXF via ezdxf, NO FreeCAD needed.\n# Coordinates are A4 page millimetres (scale=0.9336457495577931, page=[297.0, 210.0]).\n# visible edges -> solid (layer OUTLINE); hidden edges -> dashed (layer HIDDEN)\n# dimensions -> real movable DIMENSION entities (text = true mm value)\n# Run: python 0017_00178447_gt.py [out.dxf]\nimport sys\nimport ezdxf\nimport math\n\nSCALE = 0.9336457495577931\nPAGE = [297.0, 210.0]\n\nVISIBLE_SEGMENTS = [\n (80.855725, 145.535295, 99.403817, 145.535295),\n (188.434657, 117.420292, 180.000156, 106.174291),\n (99.403817, 131.477793, 80.855725, 131.477793),\n (80.855725, 131.477793, 80.855725, 145.535295),\n (99.403817, 88.464673, 188.434657, 88.464673),\n (188.434657, 88.464673, 188.434657, 92.174291),\n (99.403817, 92.174291, 188.434657, 92.174291),\n (80.855725, 88.464673, 80.855725, 92.174291),\n (80.855725, 92.174291, 99.403817, 92.174291),\n (80.855725, 88.464673, 99.403817, 88.464673),\n (99.403817, 88.464673, 99.403817, 92.174291),\n (206.144275, 145.535295, 206.144275, 145.53536),\n (202.434657, 145.535295, 202.434657, 145.53536),\n (206.144275, 145.535295, 202.434657, 145.535295),\n (206.144275, 106.174291, 202.434657, 106.174291),\n (206.144275, 106.174291, 206.144275, 131.477793),\n (206.144275, 131.477793, 206.144275, 145.535295),\n (202.434657, 106.174291, 202.434657, 131.477793),\n (202.434657, 131.477793, 202.434657, 145.535295),\n (206.144275, 131.477793, 202.434657, 131.477793),\n (202.434657, 145.53536, 206.144275, 145.53536)\n]\nVISIBLE_CIRCLES = [\n\n]\nVISIBLE_ARCS = [\n (99.545605, -9.038706, 154.574066, 54.896307, 90.052557),\n (99.765718, -8.378368, 139.856629, 54.992012, 90.148262)\n]\nHIDDEN_SEGMENTS = [\n (180.0002, 88.4647, 180.0002, 92.1743),\n (206.1443, 117.4203, 202.4347, 117.4203)\n]\n# (orient, text, p1, p2, base) for linear; (orient, text, center, radius, angle) for diameter\nDIMENSIONS = [\n ('vertical', '15.0566', (99.4038, 131.4778), (99.4038, 145.5353), (88.4038, 138.5066)),\n ('aligned', '15.0566', (188.4347, 117.4203), (180.0001, 106.1743), (193.0174, 105.1973)),\n ('radius', 'R165.56', (99.5456, -9.0387), 154.5741, 45),\n ('radius', 'R149.796', (99.7657, -8.3784), 139.8566, 45),\n ('horizontal', '19.8663', (80.8557, 145.5353), (99.4038, 145.5353), (90.1298, 156.5353)),\n ('vertical', '15.0566', (99.4038, 145.5353), (99.4038, 131.4778), (110.4038, 138.5066)),\n ('horizontal', '19.8663', (99.4038, 145.5353), (80.8557, 145.5353), (90.1298, 134.5353)),\n ('vertical', '0', (80.8557, 145.5353), (80.8557, 145.5353), (80.8557, 145.5353)),\n ('horizontal', '3.9733', (206.1443, 145.5353), (202.4346, 145.5353), (204.2894, 134.5353)),\n ('horizontal', '3.9733', (206.1443, 145.5353), (202.4346, 145.5353), (204.2894, 134.5353))\n]\n\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; _ds.dxf.dimasz = 2.5\n _ds.dxf.dimexe = 1.25; _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\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\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,\n angle=(0 if d[0] == \"horizontal\" else 90),\n 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,\n 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,\n 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,\n text=text, dimstyle=\"EZDXF\").render()\n\n doc.saveas(out_path)\n\n\nif __name__ == \"__main__\":\n out = sys.argv[1] if len(sys.argv) > 1 else \"0017_00178447_gt.dxf\"\n draw(out)\n print(\"wrote\", out)\n```"}], "images": ["images/0017_00178447.png"], "id": "0017_00178447"} {"messages": [{"role": "user", "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, featuring 4 circular holes, each of diameter 4.6 mm. It is extruded to a thickness of 2.84 mm. The outline includes one or more oblique (angled) edges. A union feature: The part is a rectangular plate 92.13 mm wide and 66.92 mm tall. It is extruded to a thickness of 3.98 mm."}, {"role": "assistant", "content": "```python\n#!/usr/bin/env python3\n# -*- coding: utf-8 -*-\n# Ground-truth 2D engineering drawing for part: 0020_00209863\n# Self-contained: reproduces the three-view DXF via ezdxf, NO FreeCAD needed.\n# Coordinates are A4 page millimetres (scale=0.7221024908362678, page=[297.0, 210.0]).\n# visible edges -> solid (layer OUTLINE); hidden edges -> dashed (layer HIDDEN)\n# dimensions -> real movable DIMENSION entities (text = true mm value)\n# Run: python 0020_00209863_gt.py [out.dxf]\nimport sys\nimport ezdxf\nimport math\n\nSCALE = 0.7221024908362678\nPAGE = [297.0, 210.0]\n\nVISIBLE_SEGMENTS = [\n (94.610793, 94.946082, 94.610793, 157.196297),\n (97.930804, 160.516308, 170.141053, 160.516308),\n (173.461065, 157.196297, 173.461065, 94.946082),\n (170.141053, 92.456074, 97.930804, 92.456074),\n (94.610793, 73.498438, 97.930804, 73.498438),\n (94.610793, 75.551831, 97.930804, 75.551831),\n (94.610793, 73.498438, 94.610793, 75.551831),\n (97.930804, 75.551831, 170.141053, 75.551831),\n (97.930804, 73.498438, 170.141053, 73.498438),\n (170.141053, 73.498438, 173.461065, 73.498438),\n (170.141053, 75.551831, 173.461065, 75.551831),\n (173.461065, 73.498438, 173.461065, 75.551831),\n (170.586315, 75.551831, 170.586315, 78.42658),\n (104.056398, 75.551831, 104.056398, 78.42658),\n (104.056398, 78.42658, 170.586315, 78.42658),\n (97.930804, 73.498438, 97.930804, 75.551831),\n (170.141053, 73.498438, 170.141053, 75.551831),\n (192.389207, 157.196297, 192.389207, 160.516308),\n (192.389207, 160.516308, 190.335815, 160.516308),\n (190.335815, 157.196297, 190.335815, 160.516308),\n (192.389207, 94.946082, 190.335815, 94.946082),\n (190.335815, 94.946082, 190.335815, 157.196297),\n (192.389207, 94.946082, 192.389207, 157.196297),\n (192.389207, 92.42658, 192.389207, 94.946082),\n (190.335815, 92.42658, 190.335815, 94.946082),\n (190.335815, 103.535747, 187.461065, 103.535747),\n (187.461065, 103.535747, 187.461065, 151.857476),\n (190.335815, 151.857476, 187.461065, 151.857476),\n (190.335815, 92.42658, 192.389207, 92.42658),\n (192.389207, 157.196297, 190.335815, 157.196297)\n]\nVISIBLE_CIRCLES = [\n (99.59081, 155.536291, 1.660006),\n (99.59081, 96.606088, 1.660006),\n (168.481048, 155.536291, 1.660006),\n (168.481048, 96.606088, 1.660006)\n]\nVISIBLE_ARCS = [\n (97.930804, 157.196297, 3.320011, 90.0, 180.0),\n (170.141053, 157.196297, 3.320011, -0.0, 90.0),\n (170.556055, 95.361084, 2.934503, -98.130102, -8.130102),\n (97.515803, 95.361084, 2.934503, -171.869898, -81.869898)\n]\nHIDDEN_SEGMENTS = [\n (170.5863, 151.8575, 170.5863, 103.5357),\n (104.0564, 151.8575, 170.5863, 151.8575),\n (104.0564, 103.5357, 104.0564, 151.8575),\n (170.5863, 103.5357, 104.0564, 103.5357),\n (101.2508, 73.4984, 101.2508, 75.5518),\n (166.821, 75.5518, 166.821, 73.4984),\n (190.3358, 153.8763, 192.3892, 153.8763),\n (190.3358, 98.2661, 192.3892, 98.2661)\n]\n# (orient, text, p1, p2, base) for linear; (orient, text, center, radius, angle) for diameter\nDIMENSIONS = [\n ('horizontal', '100', (97.9308, 160.5163), (170.1411, 160.5163), (134.0359, 171.5163)),\n ('vertical', '86.2069', (173.4611, 157.1963), (173.4611, 94.9461), (184.4611, 126.0712)),\n ('diameter', '%%c4.5977', (99.5908, 155.5363), 1.66, 45),\n ('vertical', '66.9181', (99.5908, 160.5163), (99.5908, 155.5363), (110.5908, 158.0263)),\n ('diameter', '%%c4.5977', (99.5908, 96.6061), 1.66, 45),\n ('horizontal', '6.8966', (94.6108, 96.6061), (99.5908, 96.6061), (97.1008, 107.6061)),\n ('vertical', '6.8966', (99.5908, 160.5163), (99.5908, 96.6061), (110.5908, 128.5612)),\n ('diameter', '%%c4.5977', (168.481, 155.5363), 1.66, 45),\n ('horizontal', '6.8966', (94.6108, 155.5363), (168.481, 155.5363), (131.5459, 166.5363)),\n ('vertical', '88.5058', (168.481, 160.5163), (168.481, 155.5363), (179.481, 158.0263)),\n ('diameter', '%%c4.5977', (168.481, 96.6061), 1.66, 45),\n ('horizontal', '102.299', (94.6108, 96.6061), (168.481, 96.6061), (131.5459, 107.6061)),\n ('vertical', '6.8966', (168.481, 160.5163), (168.481, 96.6061), (179.481, 128.5612)),\n ('radius', 'R4.5977', (97.9308, 157.1963), 3.32, 45),\n ('radius', 'R4.0638', (170.556, 95.3611), 2.9345, 45),\n ('horizontal', '102.299', (104.0564, 151.8575), (170.5863, 151.8575), (137.3214, 162.8575)),\n ('vertical', '88.5058', (170.5863, 151.8575), (170.5863, 103.5357), (181.5863, 127.6966)),\n ('horizontal', '92.1336', (94.6108, 160.5163), (104.0564, 160.5163), (99.3336, 171.5163)),\n ('vertical', '66.9181', (104.0564, 160.5163), (104.0564, 151.8575), (115.0564, 156.1869)),\n ('horizontal', '2.8436', (192.3892, 157.1963), (190.3358, 157.1963), (191.3625, 146.1963)),\n ('horizontal', '3.9811', (190.3358, 151.8575), (187.4611, 151.8575), (188.8985, 140.8575))\n]\n\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; _ds.dxf.dimasz = 2.5\n _ds.dxf.dimexe = 1.25; _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\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\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,\n angle=(0 if d[0] == \"horizontal\" else 90),\n 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,\n 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,\n 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,\n text=text, dimstyle=\"EZDXF\").render()\n\n doc.saveas(out_path)\n\n\nif __name__ == \"__main__\":\n out = sys.argv[1] if len(sys.argv) > 1 else \"0020_00209863_gt.dxf\"\n draw(out)\n print(\"wrote\", out)\n```"}], "images": ["images/0020_00209863.png"], "id": "0020_00209863"} {"messages": [{"role": "user", "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 4.13 mm. The outline includes one or more oblique (angled) edges. A cut feature: The part is a polygonal plate with 9 straight edges. It is extruded to a thickness of -0.59 mm. The outline includes one or more oblique (angled) edges. A cut feature: The part is a polygonal plate with 9 straight edges. It is extruded to a thickness of -0.59 mm. The outline includes one or more oblique (angled) edges."}, {"role": "assistant", "content": "```python\n#!/usr/bin/env python3\n# -*- coding: utf-8 -*-\n# Ground-truth 2D engineering drawing for part: 0021_00212429\n# Self-contained: reproduces the three-view DXF via ezdxf, NO FreeCAD needed.\n# Coordinates are A4 page millimetres (scale=0.8170985432281362, page=[297.0, 210.0]).\n# visible edges -> solid (layer OUTLINE); hidden edges -> dashed (layer HIDDEN)\n# dimensions -> real movable DIMENSION entities (text = true mm value)\n# Run: python 0021_00212429_gt.py [out.dxf]\nimport sys\nimport ezdxf\nimport math\n\nSCALE = 0.8170985432281362\nPAGE = [297.0, 210.0]\n\nVISIBLE_SEGMENTS = [\n (103.598456, 166.541471, 103.598456, 84.831616),\n (109.106986, 79.323087, 160.519928, 79.323087),\n (166.028457, 84.831616, 166.028457, 166.541471),\n (160.519928, 172.05, 109.106986, 172.05),\n (122.193547, 83.101958, 126.246324, 87.240964),\n (118.054542, 87.240964, 122.193547, 83.101958),\n (119.692898, 87.240964, 118.054542, 87.240964),\n (121.331255, 85.602608, 119.692898, 87.240964),\n (121.331255, 90.000301, 121.331255, 85.602608),\n (122.969611, 90.000301, 121.331255, 90.000301),\n (122.969611, 85.602608, 122.969611, 90.000301),\n (124.607967, 87.240964, 122.969611, 85.602608),\n (126.246324, 87.240964, 124.607967, 87.240964),\n (147.732632, 83.101958, 151.785408, 87.240964),\n (143.593627, 87.240964, 147.732632, 83.101958),\n (145.231983, 87.240964, 143.593627, 87.240964),\n (146.870339, 85.602608, 145.231983, 87.240964),\n (146.870339, 90.000301, 146.870339, 85.602608),\n (148.508696, 90.000301, 146.870339, 90.000301),\n (148.508696, 85.602608, 148.508696, 90.000301),\n (150.147052, 87.240964, 148.508696, 85.602608),\n (151.785408, 87.240964, 150.147052, 87.240964),\n (103.598456, 65.323087, 103.598456, 61.95),\n (166.028457, 65.323087, 160.519928, 65.323087),\n (160.519928, 65.323087, 109.106986, 65.323087),\n (109.106986, 65.323087, 103.598456, 65.323087),\n (166.028457, 61.95, 160.519928, 61.95),\n (160.519928, 61.95, 109.106986, 61.95),\n (109.106986, 61.95, 103.598456, 61.95),\n (166.028457, 65.323087, 166.028457, 61.95),\n (109.106986, 65.323087, 109.106986, 61.95),\n (160.519928, 65.323087, 160.519928, 61.95),\n (180.028457, 84.831616, 180.028457, 79.323087),\n (180.028457, 79.323087, 183.401544, 79.323087),\n (183.401544, 84.831616, 183.401544, 79.323087),\n (183.401544, 166.541471, 183.401544, 84.831616),\n (180.028457, 166.541471, 180.028457, 84.831616),\n (180.028457, 172.05, 180.028457, 166.541471),\n (183.401544, 172.05, 183.401544, 166.541471),\n (180.028457, 172.05, 183.401544, 172.05),\n (180.028457, 84.831616, 183.401544, 84.831616),\n (180.028457, 166.541471, 183.401544, 166.541471)\n]\nVISIBLE_CIRCLES = [\n\n]\nVISIBLE_ARCS = [\n (109.106986, 84.831616, 5.50853, 180.0, -90.0),\n (160.519928, 84.831616, 5.50853, -90.0, -0.0),\n (160.519928, 166.541471, 5.50853, -0.0, 90.0),\n (109.106986, 166.541471, 5.50853, 90.0, -180.0)\n]\nHIDDEN_SEGMENTS = [\n\n]\n# (orient, text, p1, p2, base) for linear; (orient, text, center, radius, angle) for diameter\nDIMENSIONS = [\n ('horizontal', '62.9213', (109.107, 79.3231), (160.5199, 79.3231), (134.8135, 90.3231)),\n ('vertical', '100', (166.0285, 84.8316), (166.0285, 166.5414), (155.0285, 125.6865)),\n ('radius', 'R6.7416', (109.107, 84.8316), 5.5086, 45),\n ('horizontal', '10.0254', (118.0546, 83.1019), (126.2463, 83.1019), (122.1504, 94.1019)),\n ('vertical', '8.4425', (126.2463, 83.1019), (126.2463, 90.0003), (115.2463, 86.5511)),\n ('horizontal', '17.692', (103.5985, 79.3231), (118.0546, 79.3231), (110.8265, 90.3231)),\n ('vertical', '4.6247', (118.0546, 79.3231), (118.0546, 83.1019), (107.0546, 81.2125)),\n ('aligned', '7.0895', (122.1936, 83.1019), (126.2463, 87.241), (116.3603, 92.8673)),\n ('aligned', '2.8356', (124.6079, 87.241), (122.9696, 85.6026), (131.5669, 78.6436)),\n ('aligned', '2.8356', (121.3312, 85.6026), (119.6929, 87.241), (112.7337, 78.6438)),\n ('aligned', '7.1637', (118.0546, 87.241), (122.1936, 83.1019), (127.9023, 92.9496)),\n ('horizontal', '10.0254', (143.5936, 83.1019), (151.7854, 83.1019), (147.6895, 94.1019)),\n ('vertical', '8.4425', (151.7854, 83.1019), (151.7854, 90.0003), (140.7854, 86.5511)),\n ('horizontal', '48.9478', (103.5985, 79.3231), (143.5936, 79.3231), (123.5961, 90.3231)),\n ('vertical', '4.6247', (143.5936, 79.3231), (143.5936, 83.1019), (132.5936, 81.2125)),\n ('aligned', '7.0895', (147.7327, 83.1019), (151.7854, 87.241), (141.8993, 92.8673)),\n ('aligned', '2.8356', (150.147, 87.241), (148.5087, 85.6026), (157.1062, 78.6438)),\n ('aligned', '2.8356', (146.8704, 85.6026), (145.232, 87.241), (138.273, 78.6436)),\n ('aligned', '7.1637', (143.5936, 87.241), (147.7327, 83.1019), (153.4413, 92.9496)),\n ('horizontal', '4.1281', (180.0285, 84.8316), (183.4015, 84.8316), (181.715, 95.8316)),\n ('vertical', '0.5897', (183.4015, 83.1019), (182.9197, 83.1019), (183.1606, 72.1019)),\n ('vertical', '0.5897', (183.4015, 83.1019), (182.9197, 83.1019), (183.1606, 72.1019))\n]\n\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; _ds.dxf.dimasz = 2.5\n _ds.dxf.dimexe = 1.25; _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\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\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,\n angle=(0 if d[0] == \"horizontal\" else 90),\n 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,\n 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,\n 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,\n text=text, dimstyle=\"EZDXF\").render()\n\n doc.saveas(out_path)\n\n\nif __name__ == \"__main__\":\n out = sys.argv[1] if len(sys.argv) > 1 else \"0021_00212429_gt.dxf\"\n draw(out)\n print(\"wrote\", out)\n```"}], "images": ["images/0021_00212429.png"], "id": "0021_00212429"} {"messages": [{"role": "user", "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 71.72 mm wide and 64.17 mm tall. It is extruded to a thickness of 12.71 mm. A union feature: The part is a polygonal plate with 4 straight edges. It is extruded to a thickness of 24.51 mm. The outline includes one or more oblique (angled) edges. A union feature: The part is a circular plate with diameter 100 mm, featuring a circular hole of diameter 77.08 mm. It is extruded to a thickness of 24.51 mm."}, {"role": "assistant", "content": "```python\n#!/usr/bin/env python3\n# -*- coding: utf-8 -*-\n# Ground-truth 2D engineering drawing for part: 0022_00220214\n# Self-contained: reproduces the three-view DXF via ezdxf, NO FreeCAD needed.\n# Coordinates are A4 page millimetres (scale=0.7718093483766986, page=[297.0, 210.0]).\n# visible edges -> solid (layer OUTLINE); hidden edges -> dashed (layer HIDDEN)\n# dimensions -> real movable DIMENSION entities (text = true mm value)\n# Run: python 0022_00220214_gt.py [out.dxf]\nimport sys\nimport ezdxf\nimport math\n\nSCALE = 0.7718093483766986\nPAGE = [297.0, 210.0]\n\nVISIBLE_SEGMENTS = [\n (90.092971, 136.869021, 110.377781, 133.239108),\n (62.765433, 115.847838, 118.121216, 115.847838),\n (118.121216, 165.376696, 62.765433, 165.376696),\n (62.765433, 165.376696, 62.765433, 115.847838),\n (110.413449, 147.777909, 90.092971, 144.355513),\n (90.092971, 144.355513, 90.092971, 136.869021),\n (118.121216, 87.782084, 186.893677, 87.782084),\n (118.121216, 87.782084, 62.765433, 87.782084),\n (118.121216, 77.972198, 62.765433, 77.972198),\n (62.765433, 87.782084, 62.765433, 77.972198),\n (118.121216, 87.782084, 118.121216, 77.972198),\n (110.413449, 77.972198, 110.413449, 68.863019),\n (110.413449, 68.863019, 90.092971, 68.863019),\n (90.092971, 77.972198, 90.092971, 68.863019),\n (110.413449, 68.863019, 186.893677, 68.863019),\n (186.893677, 68.863019, 186.893677, 87.782084),\n (200.893678, 165.376696, 200.893678, 115.847838),\n (200.893678, 165.376696, 200.893678, 178.963019),\n (200.893678, 101.782084, 200.893678, 115.847838),\n (210.703563, 136.869021, 219.812743, 136.869021),\n (219.812743, 136.869021, 219.812743, 133.239108),\n (219.812743, 133.239108, 210.703563, 133.239108),\n (210.703563, 165.376696, 210.703563, 115.847838),\n (200.893678, 115.847838, 210.703563, 115.847838),\n (200.893678, 165.376696, 210.703563, 165.376696),\n (210.703563, 147.777909, 219.812743, 147.777909),\n (219.812743, 147.777909, 219.812743, 144.355513),\n (210.703563, 144.355513, 219.812743, 144.355513),\n (219.812743, 147.777909, 219.812743, 178.963019),\n (219.812743, 101.782084, 219.812743, 133.239108),\n (219.812743, 144.355513, 219.812743, 136.869021),\n (219.812743, 178.963019, 200.893678, 178.963019),\n (219.812743, 101.782084, 200.893678, 101.782084)\n]\nVISIBLE_CIRCLES = [\n (148.30321, 140.372552, 29.746819),\n (148.30321, 140.372552, 38.590467)\n]\nVISIBLE_ARCS = [\n (147.55272, 140.612267, 38.464144, -169.110614, -139.921875),\n (147.55272, 140.612267, 38.464144, 139.921875, 169.435169),\n (149.47447, 140.505317, 39.732279, 169.453125, 172.296055)\n]\nHIDDEN_SEGMENTS = [\n (109.7812, 77.9722, 109.7812, 87.7821),\n (109.7406, 77.9722, 109.7406, 87.7821),\n (178.05, 87.7821, 178.05, 68.863),\n (219.8127, 145.8316, 200.8937, 145.8316),\n (219.8127, 170.1194, 200.8937, 170.1194),\n (219.8127, 110.6257, 200.8937, 110.6257)\n]\n# (orient, text, p1, p2, base) for linear; (orient, text, center, radius, angle) for diameter\nDIMENSIONS = [\n ('horizontal', '71.7221', (118.1212, 165.3767), (62.7654, 165.3767), (90.4433, 154.3767)),\n ('vertical', '64.1724', (118.1212, 115.8478), (118.1212, 165.3767), (107.1212, 140.6123)),\n ('radius', 'R49.8363', (147.5528, 140.6123), 38.4641, 45),\n ('horizontal', '26.3284', (90.0929, 133.2327), (110.4134, 133.2327), (100.2532, 144.2327)),\n ('vertical', '18.8456', (110.4134, 133.2327), (110.4134, 147.7779), (99.4134, 140.5053)),\n ('horizontal', '35.4071', (62.7654, 115.8478), (90.0929, 115.8478), (76.4292, 126.8478)),\n ('vertical', '22.5248', (90.0929, 115.8478), (90.0929, 133.2327), (79.0929, 124.5403)),\n ('radius', 'R51.4794', (149.4745, 140.5053), 39.7323, 45),\n ('diameter', '%%c100', (148.3032, 140.3726), 38.5905, 135),\n ('diameter', '%%c77.0833', (148.3032, 140.3726), 29.7468, 225),\n ('horizontal', '12.7102', (200.8937, 115.8478), (210.7035, 115.8478), (205.7986, 126.8478)),\n ('horizontal', '24.5126', (200.8937, 133.2327), (219.8127, 133.2327), (210.3532, 144.2327)),\n ('horizontal', '12.7102', (200.8937, 140.3726), (219.8127, 140.3726), (210.3532, 151.3726))\n]\n\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; _ds.dxf.dimasz = 2.5\n _ds.dxf.dimexe = 1.25; _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\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\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,\n angle=(0 if d[0] == \"horizontal\" else 90),\n 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,\n 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,\n 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,\n text=text, dimstyle=\"EZDXF\").render()\n\n doc.saveas(out_path)\n\n\nif __name__ == \"__main__\":\n out = sys.argv[1] if len(sys.argv) > 1 else \"0022_00220214_gt.dxf\"\n draw(out)\n print(\"wrote\", out)\n```"}], "images": ["images/0022_00220214.png"], "id": "0022_00220214"} {"messages": [{"role": "user", "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, featuring a rectangular cutout 84.32 x 78.64 mm. It is extruded to a thickness of 576.03 mm. The outline includes one or more oblique (angled) edges. A cut feature: The part is a polygonal plate with 3 straight edges. It is extruded to a thickness of -48 mm. The outline includes one or more oblique (angled) edges. A cut feature: The part is a polygonal plate with 3 straight edges. It is extruded to a thickness of -48 mm. The outline includes one or more oblique (angled) edges."}, {"role": "assistant", "content": "```python\n#!/usr/bin/env python3\n# -*- coding: utf-8 -*-\n# Ground-truth 2D engineering drawing for part: 0026_00262429\n# Self-contained: reproduces the three-view DXF via ezdxf, NO FreeCAD needed.\n# Coordinates are A4 page millimetres (scale=0.22062097400928987, page=[297.0, 210.0]).\n# visible edges -> solid (layer OUTLINE); hidden edges -> dashed (layer HIDDEN)\n# dimensions -> real movable DIMENSION entities (text = true mm value)\n# Run: python 0026_00262429_gt.py [out.dxf]\nimport sys\nimport ezdxf\nimport math\n\nSCALE = 0.22062097400928987\nPAGE = [297.0, 210.0]\n\nVISIBLE_SEGMENTS = [\n (81.632646, 177.614747, 64.284111, 177.614747),\n (63.03, 196.217393, 63.03, 178.868858),\n (82.797368, 196.682384, 63.119389, 196.682384),\n (82.886757, 196.217393, 82.886757, 178.868858),\n (63.03, 178.868858, 64.284111, 180.122969),\n (80.378535, 178.868858, 65.538222, 178.868858),\n (81.632646, 194.963282, 81.632646, 180.122969),\n (65.538222, 196.217393, 80.378535, 196.217393),\n (64.284111, 180.122969, 64.284111, 194.963282),\n (81.632646, 197.471504, 64.284111, 197.471504),\n (63.03, 163.200303, 63.03, 36.753649),\n (82.044836, 163.611739, 81.632646, 163.611739),\n (82.797368, 36.528496, 81.632646, 36.528496),\n (82.886757, 163.200303, 82.886757, 36.753649),\n (64.284111, 36.528496, 63.119389, 36.528496),\n (64.284111, 163.611739, 63.871921, 163.611739),\n (81.632646, 163.611739, 64.284111, 163.611739),\n (81.632646, 36.528496, 64.284111, 36.528496),\n (81.632646, 163.611739, 81.632646, 36.528496),\n (64.284111, 163.611739, 64.284111, 36.528496),\n (103.760165, 177.614747, 214.73725, 177.614747),\n (214.73725, 177.614747, 215.344504, 178.868858),\n (103.324526, 178.868858, 103.760165, 177.614747),\n (97.298193, 196.217393, 96.886757, 197.401831),\n (103.324526, 178.868858, 97.298193, 196.217393),\n (223.744847, 196.217393, 215.344504, 178.868858),\n (223.744847, 196.217393, 223.97, 196.682384),\n (223.97, 197.471504, 223.97, 196.682384),\n (96.886757, 197.471504, 223.97, 197.471504),\n (96.886757, 197.471504, 96.886757, 197.401831),\n (103.324526, 178.868858, 215.344504, 178.868858),\n (215.093005, 178.349389, 215.092971, 178.349389),\n (103.504974, 178.349389, 103.504949, 178.349389),\n (97.298193, 196.217393, 223.744847, 196.217393)\n]\nVISIBLE_CIRCLES = [\n\n]\nVISIBLE_ARCS = [\n (64.284111, 178.868858, 1.254111, -180.0, -90.0),\n (64.284111, 196.217393, 1.254111, 158.236705, 180.0),\n (81.632646, 196.217393, 1.254111, -0.0, 21.763295),\n (81.632646, 178.868858, 1.254111, -90.0, -0.0),\n (64.284111, 180.122969, 1.773581, -135.0, -45.0),\n (80.378535, 180.122969, 1.254111, -90.0, -0.0),\n (80.378535, 194.963282, 1.254111, 0.0, 90.0),\n (65.538222, 194.963282, 1.254111, 90.0, 180.0),\n (81.632646, 196.217393, 1.254111, 21.763295, 90.0),\n (64.284111, 196.217393, 1.254111, 90.0, 158.236705),\n (82.146667, 162.752988, 0.864768, 31.149032, 96.762586),\n (63.77009, 162.752988, 0.864768, 83.237414, 148.850968),\n (63.383378, 36.763624, 0.353519, -178.383194, -138.309445),\n (82.533379, 36.763624, 0.353519, -41.690555, -1.616806)\n]\nHIDDEN_SEGMENTS = [\n (64.2841, 45.7612, 63.03, 45.154),\n (63.03, 157.174, 64.2841, 156.7383),\n (64.2841, 156.7383, 81.6326, 156.7383),\n (81.6326, 156.7383, 82.8868, 157.174),\n (63.03, 157.174, 65.5382, 157.174),\n (64.2841, 157.6096, 63.03, 157.174),\n (65.5382, 163.2003, 64.2841, 162.7647),\n (81.6326, 162.7647, 80.3785, 163.2003),\n (80.3785, 157.174, 81.6326, 157.6096),\n (65.5382, 157.174, 80.3785, 157.174),\n (81.6326, 45.7612, 64.2841, 45.7612),\n (82.8868, 45.154, 81.6326, 45.7612),\n (63.03, 45.154, 64.2841, 44.5467),\n (65.5382, 45.154, 63.03, 45.154),\n (80.3785, 45.154, 65.5382, 45.154),\n (81.6326, 44.5467, 80.3785, 45.154),\n (80.3785, 36.7536, 81.6326, 37.3609),\n (64.2841, 37.3609, 65.5382, 36.7536),\n (65.5382, 157.174, 65.5382, 45.154),\n (102.8889, 180.123, 215.9518, 180.123)\n]\n# (orient, text, p1, p2, base) for linear; (orient, text, center, radius, angle) for diameter\nDIMENSIONS = [\n ('horizontal', '82.3717', (63.03, 178.8689), (81.6327, 178.8689), (72.3313, 189.8689)),\n ('vertical', '78.635', (63.03, 177.6147), (63.03, 178.8689), (52.03, 178.2418)),\n ('radius', 'R5.6845', (64.2841, 178.8689), 1.2541, 45),\n ('radius', 'R8.039', (64.2841, 180.123), 1.7736, 45),\n ('radius', 'R5.6845', (80.3785, 180.123), 1.2541, 45),\n ('horizontal', '512.476', (96.8868, 177.5451), (103.7844, 177.5451), (100.3356, 188.5451))\n]\n\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; _ds.dxf.dimasz = 2.5\n _ds.dxf.dimexe = 1.25; _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\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\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,\n angle=(0 if d[0] == \"horizontal\" else 90),\n 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,\n 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,\n 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,\n text=text, dimstyle=\"EZDXF\").render()\n\n doc.saveas(out_path)\n\n\nif __name__ == \"__main__\":\n out = sys.argv[1] if len(sys.argv) > 1 else \"0026_00262429_gt.dxf\"\n draw(out)\n print(\"wrote\", out)\n```"}], "images": ["images/0026_00262429.png"], "id": "0026_00262429"} {"messages": [{"role": "user", "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 -22.3 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 -22.3 mm. The outline includes one or more oblique (angled) edges."}, {"role": "assistant", "content": "```python\n#!/usr/bin/env python3\n# -*- coding: utf-8 -*-\n# Ground-truth 2D engineering drawing for part: 0027_00273810\n# Self-contained: reproduces the three-view DXF via ezdxf, NO FreeCAD needed.\n# Coordinates are A4 page millimetres (scale=0.6556489715864843, page=[297.0, 210.0]).\n# visible edges -> solid (layer OUTLINE); hidden edges -> dashed (layer HIDDEN)\n# dimensions -> real movable DIMENSION entities (text = true mm value)\n# Run: python 0027_00273810_gt.py [out.dxf]\nimport sys\nimport ezdxf\nimport math\n\nSCALE = 0.6556489715864843\nPAGE = [297.0, 210.0]\n\nVISIBLE_SEGMENTS = [\n (86.244178, 168.171656, 151.809075, 168.171656),\n (151.809075, 109.070904, 119.488351, 109.070904),\n (119.488351, 109.070904, 119.488351, 138.62128),\n (119.488351, 138.62128, 119.026627, 138.62128),\n (119.026627, 138.62128, 119.026627, 109.532628),\n (119.026627, 109.532628, 86.244178, 109.532628),\n (75.160856, 65.828344, 86.244178, 65.828344),\n (86.244178, 65.828344, 86.244178, 95.070904),\n (75.160856, 95.070904, 86.244178, 95.070904),\n (86.244178, 65.828344, 151.809075, 65.828344),\n (151.809075, 65.828344, 163.000104, 65.828344),\n (151.809075, 65.828344, 151.809075, 95.070904),\n (86.244178, 95.070904, 151.809075, 95.070904),\n (151.809075, 95.070904, 163.000104, 95.070904),\n (75.160856, 65.828344, 75.160856, 95.070904),\n (163.000104, 65.828344, 163.000104, 95.070904),\n (206.242664, 138.62128, 206.242664, 168.171656),\n (206.242664, 168.171656, 177.000104, 168.171656),\n (177.000104, 138.62128, 177.000104, 168.171656),\n (177.000104, 138.62128, 206.242664, 138.62128),\n (206.242664, 109.070904, 206.242664, 109.532628),\n (206.242664, 109.532628, 206.242664, 138.62128),\n (177.000104, 109.070904, 177.000104, 109.532628),\n (177.000104, 109.532628, 177.000104, 138.62128),\n (206.242664, 109.532628, 177.000104, 109.532628),\n (177.000104, 109.070904, 206.242664, 109.070904)\n]\nVISIBLE_CIRCLES = [\n\n]\nVISIBLE_ARCS = [\n (119.006717, 139.032755, 43.845861, 138.350205, -179.462295),\n (118.390091, 138.62128, 44.610013, -41.484375, 41.484375),\n (118.408229, 138.440667, 43.245819, 179.760708, -138.051792)\n]\nHIDDEN_SEGMENTS = [\n (119.4884, 95.0709, 119.4884, 65.8283),\n (119.0266, 95.0709, 119.0266, 65.8283)\n]\n# (orient, text, p1, p2, base) for linear; (orient, text, center, radius, angle) for diameter\nDIMENSIONS = [\n ('horizontal', '49.2958', (151.8091, 109.0709), (119.4883, 109.0709), (135.6487, 98.0709)),\n ('horizontal', '67.6056', (119.4883, 138.6213), (75.1628, 138.6213), (97.3256, 127.6213)),\n ('horizontal', '100', (86.2442, 168.1716), (151.8091, 168.1716), (119.0266, 179.1716)),\n ('vertical', '45.0704', (119.4883, 109.0709), (119.4883, 138.6213), (108.4883, 123.8461)),\n ('vertical', '90.1408', (151.8091, 168.1716), (151.8091, 109.0709), (162.8091, 138.6213)),\n ('radius', 'R66.874', (119.0067, 139.0328), 43.8459, 45),\n ('radius', 'R68.0395', (118.3901, 138.6213), 44.61, 45),\n ('horizontal', '66.9014', (75.1628, 138.6213), (119.0266, 138.6213), (97.0947, 149.6213)),\n ('vertical', '44.3662', (119.0266, 138.6213), (119.0266, 109.5326), (130.0266, 124.077)),\n ('vertical', '0', (75.1628, 168.1716), (75.1628, 168.1716), (75.1628, 168.1716)),\n ('vertical', '45.0704', (75.1628, 168.1716), (75.1628, 138.6213), (86.1628, 153.3965)),\n ('radius', 'R65.9588', (118.4082, 138.4406), 43.2458, 135),\n ('horizontal', '44.6009', (177.0001, 138.6213), (206.2427, 138.6213), (191.6214, 149.6213)),\n ('horizontal', '44.6009', (177.0001, 138.6213), (206.2427, 138.6213), (191.6214, 149.6213))\n]\n\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; _ds.dxf.dimasz = 2.5\n _ds.dxf.dimexe = 1.25; _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\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\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,\n angle=(0 if d[0] == \"horizontal\" else 90),\n 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,\n 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,\n 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,\n text=text, dimstyle=\"EZDXF\").render()\n\n doc.saveas(out_path)\n\n\nif __name__ == \"__main__\":\n out = sys.argv[1] if len(sys.argv) > 1 else \"0027_00273810_gt.dxf\"\n draw(out)\n print(\"wrote\", out)\n```"}], "images": ["images/0027_00273810.png"], "id": "0027_00273810"} {"messages": [{"role": "user", "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, featuring a circular hole of diameter 31.18 mm. It is extruded to a thickness of 31.26 mm. The outline includes one or more oblique (angled) edges. A union feature: The part is a circular plate with diameter 20.35 mm, featuring a circular hole of diameter 10.39 mm. It is extruded to a thickness of 25.51 mm. A union feature: The part is a polygonal plate with 4 straight edges, featuring a rectangular cutout 40.87 x 10.48 mm. It is extruded to a thickness of 20.57 mm. The outline includes one or more oblique (angled) edges."}, {"role": "assistant", "content": "```python\n#!/usr/bin/env python3\n# -*- coding: utf-8 -*-\n# Ground-truth 2D engineering drawing for part: 0028_00285061\n# Self-contained: reproduces the three-view DXF via ezdxf, NO FreeCAD needed.\n# Coordinates are A4 page millimetres (scale=0.8384670879756152, page=[297.0, 210.0]).\n# visible edges -> solid (layer OUTLINE); hidden edges -> dashed (layer HIDDEN)\n# dimensions -> real movable DIMENSION entities (text = true mm value)\n# Run: python 0028_00285061_gt.py [out.dxf]\nimport sys\nimport ezdxf\nimport math\n\nSCALE = 0.8384670879756152\nPAGE = [297.0, 210.0]\n\nVISIBLE_SEGMENTS = [\n (80.104014, 154.353803, 83.371768, 153.990719),\n (86.764073, 152.942615, 164.994169, 145.452499),\n (167.026268, 127.76881, 83.55331, 119.860845),\n (83.371768, 120.223929, 80.104014, 119.860845),\n (106.39854, 140.94875, 140.666386, 140.94875),\n (140.666386, 132.162123, 106.39854, 132.162123),\n (86.764073, 96.892676, 86.764073, 79.646197),\n (83.371768, 105.860845, 97.227612, 105.860845),\n (83.371768, 79.646197, 83.371768, 105.860845),\n (83.371768, 79.646197, 86.764073, 79.646197),\n (80.104014, 79.646197, 83.371768, 79.646197),\n (86.764073, 79.646197, 164.994169, 79.646197),\n (164.994169, 79.646197, 175.304577, 79.646197),\n (62.857535, 79.646197, 80.104014, 79.646197),\n (86.764073, 96.892676, 164.994169, 96.892676),\n (164.994169, 96.892676, 164.994169, 79.646197),\n (62.857535, 105.860845, 80.104014, 105.860845),\n (80.104014, 105.860845, 83.371768, 105.860845),\n (80.104014, 79.646197, 80.104014, 105.860845),\n (175.304577, 79.646197, 175.304577, 101.031831),\n (158.23964, 101.031831, 175.304577, 101.031831),\n (97.227612, 105.860845, 97.227612, 96.892676),\n (62.857535, 105.860845, 62.857535, 79.646197),\n (158.23964, 101.031831, 158.23964, 96.892676),\n (215.519225, 119.860845, 215.519225, 154.353803),\n (215.519225, 119.860845, 189.304578, 119.860845),\n (189.304578, 119.860845, 189.304578, 154.353803),\n (215.519225, 154.353803, 189.304578, 154.353803)\n]\nVISIBLE_CIRCLES = [\n (80.104014, 136.925782, 13.071016),\n (166.772109, 137.107324, 4.357005),\n (166.772109, 137.107324, 8.532468)\n]\nVISIBLE_ARCS = [\n (80.013452, 137.107324, 17.21416, -78.75, 1.798643),\n (80.013452, 137.107324, 17.21416, 66.911336, 78.75),\n (166.772109, 137.107324, 8.532468, 116.454341, 0.0),\n (166.155277, 136.533854, 8.808213, 111.192912, -84.325095),\n (80.232549, 136.555437, 17.021658, -78.75, 3.678894),\n (80.104014, 137.107324, 17.246479, 90.0, -90.0),\n (140.666386, 136.555437, 4.393314, -90.0, 90.0),\n (106.39854, 136.555437, 4.393314, 90.0, -90.0)\n]\nHIDDEN_SEGMENTS = [\n (83.3718, 153.9907, 83.3718, 120.2239),\n (93.175, 79.6462, 93.175, 105.8608),\n (162.971, 96.8927, 162.971, 79.6462),\n (167.0263, 79.6462, 167.0263, 96.8927),\n (171.1291, 79.6462, 171.1291, 101.0318),\n (67.033, 105.8608, 67.033, 79.6462),\n (157.3471, 96.8927, 157.3471, 79.6462),\n (102.0052, 96.8927, 102.0052, 79.6462),\n (145.0597, 96.8927, 145.0597, 79.6462),\n (162.4151, 101.0318, 162.4151, 79.6462),\n (198.2727, 152.9426, 215.5192, 152.9426),\n (198.2727, 137.6476, 215.5192, 137.6476),\n (198.2727, 145.4525, 215.5192, 145.4525),\n (198.2727, 140.9488, 198.2727, 132.1621),\n (198.2727, 144.7464, 215.5192, 144.7464),\n (194.1336, 128.5749, 194.1336, 145.6398),\n (215.5192, 127.7688, 198.2727, 127.7688),\n (215.5192, 140.9488, 198.2727, 140.9488),\n (215.5192, 132.1621, 198.2727, 132.1621),\n (198.2727, 137.6476, 198.2727, 144.7464),\n (198.2727, 144.7464, 198.2727, 152.9426),\n (198.2727, 137.6476, 198.2727, 127.7256),\n (198.2727, 119.8608, 198.2727, 132.1621),\n (198.2727, 132.1621, 198.2727, 137.6476),\n (198.2727, 137.6476, 198.2727, 140.9488),\n (189.3046, 123.8548, 215.5192, 123.8548),\n (189.3046, 149.9968, 215.5192, 149.9968),\n (194.1336, 128.5749, 215.5192, 128.5749),\n (194.1336, 145.6398, 215.5192, 145.6398),\n (198.2727, 127.7256, 215.5192, 127.7256),\n (194.1336, 132.7503, 215.5192, 132.7503),\n (194.1336, 141.4643, 215.5192, 141.4643)\n]\n# (orient, text, p1, p2, base) for linear; (orient, text, center, radius, angle) for diameter\nDIMENSIONS = [\n ('vertical', '40.2721', (83.3718, 153.9907), (83.3718, 120.224), (94.3718, 137.1073)),\n ('vertical', '41.1381', (80.104, 119.8608), (80.104, 154.3538), (69.104, 137.1073)),\n ('horizontal', '3.9213', (83.3718, 120.224), (80.104, 119.8608), (82.9528, 109.1097)),\n ('horizontal', '3.9213', (80.104, 154.3538), (83.3718, 153.9907), (82.9528, 165.105)),\n ('diameter', '%%c31.1784', (80.104, 136.9258), 13.071, 45),\n ('vertical', '20.7856', (80.104, 154.3538), (80.104, 136.9258), (91.104, 145.6398)),\n ('radius', 'R20.5305', (80.0135, 137.1073), 17.2141, 45),\n ('radius', 'R20.5691', (80.104, 137.1073), 17.2465, 135),\n ('diameter', '%%c20.3525', (166.7721, 137.1073), 8.5325, 45),\n ('diameter', '%%c10.3928', (166.7721, 137.1073), 4.357, 135),\n ('horizontal', '99.5542', (83.5533, 153.25), (167.0262, 153.25), (125.2898, 164.25)),\n ('vertical', '39.8217', (167.0262, 153.25), (167.0262, 119.8608), (178.0262, 136.5554)),\n ('horizontal', '4.1138', (80.104, 154.3538), (83.5533, 154.3538), (81.8287, 165.3538)),\n ('vertical', '1.3165', (83.5533, 154.3538), (83.5533, 153.25), (94.5533, 153.8019)),\n ('aligned', '100', (167.0262, 127.7688), (83.5533, 119.8608), (126.3272, 112.8638)),\n ('horizontal', '40.8696', (106.3985, 140.9488), (140.6664, 140.9488), (123.5325, 151.9488)),\n ('vertical', '10.4794', (106.3985, 140.9488), (106.3985, 132.1621), (117.3985, 136.5554)),\n ('horizontal', '27.2464', (83.5533, 140.9488), (106.3985, 140.9488), (94.9759, 151.9488)),\n ('vertical', '14.6711', (106.3985, 153.25), (106.3985, 140.9488), (117.3985, 147.0994)),\n ('radius', 'R20.3009', (80.2326, 136.5554), 17.0216, 135),\n ('radius', 'R10.5051', (166.1552, 136.5338), 8.8082, 45),\n ('radius', 'R5.2397', (140.6664, 136.5554), 4.3933, 45),\n ('horizontal', '31.265', (215.5192, 153.9907), (189.3046, 153.9907), (202.4119, 142.9907)),\n ('horizontal', '20.5691', (215.5192, 137.1073), (194.1336, 137.1073), (204.8264, 126.1073)),\n ('horizontal', '20.5691', (215.5192, 119.8608), (198.2727, 119.8608), (206.896, 108.8608))\n]\n\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; _ds.dxf.dimasz = 2.5\n _ds.dxf.dimexe = 1.25; _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\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\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,\n angle=(0 if d[0] == \"horizontal\" else 90),\n 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,\n 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,\n 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,\n text=text, dimstyle=\"EZDXF\").render()\n\n doc.saveas(out_path)\n\n\nif __name__ == \"__main__\":\n out = sys.argv[1] if len(sys.argv) > 1 else \"0028_00285061_gt.dxf\"\n draw(out)\n print(\"wrote\", out)\n```"}], "images": ["images/0028_00285061.png"], "id": "0028_00285061"} {"messages": [{"role": "user", "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 7 straight edges. It is extruded to a thickness of 219.34 mm. The outline includes one or more oblique (angled) edges. A union feature: The part is a rectangular plate 12.79 mm wide and 43.41 mm tall. It is extruded to a thickness of 219.34 mm. A cut feature: The part is a circular plate with diameter 27.71 mm. It is extruded to a thickness of -219.34 mm. A cut feature: The part is a rectangular plate 34.73 mm wide and 86.82 mm tall. It is extruded to a thickness of -219.34 mm."}, {"role": "assistant", "content": "```python\n#!/usr/bin/env python3\n# -*- coding: utf-8 -*-\n# Ground-truth 2D engineering drawing for part: 0029_00291937\n# Self-contained: reproduces the three-view DXF via ezdxf, NO FreeCAD needed.\n# Coordinates are A4 page millimetres (scale=0.313891437549106, page=[297.0, 210.0]).\n# visible edges -> solid (layer OUTLINE); hidden edges -> dashed (layer HIDDEN)\n# dimensions -> real movable DIMENSION entities (text = true mm value)\n# Run: python 0029_00291937_gt.py [out.dxf]\nimport sys\nimport ezdxf\nimport math\n\nSCALE = 0.313891437549106\nPAGE = [297.0, 210.0]\n\nVISIBLE_SEGMENTS = [\n (79.485448, 144.797761, 110.874591, 144.797761),\n (120.794104, 158.589961, 124.666791, 158.589961),\n (120.794104, 158.589961, 120.794104, 172.05),\n (120.794104, 172.05, 116.777985, 172.05),\n (116.777985, 172.05, 116.777985, 158.589961),\n (116.581708, 158.589961, 116.777985, 158.589961),\n (116.581708, 158.589961, 116.581708, 154.309623),\n (89.472902, 149.078099, 110.874591, 149.078099),\n (124.666791, 130.797761, 124.666791, 61.95),\n (79.485448, 130.797761, 79.485448, 61.95),\n (124.666791, 130.797761, 120.794104, 130.797761),\n (120.794104, 61.95, 124.666791, 61.95),\n (120.794104, 130.797761, 116.777985, 130.797761),\n (116.777985, 130.797761, 116.581708, 130.797761),\n (116.581708, 130.797761, 110.874591, 130.797761),\n (110.874591, 130.797761, 89.472902, 130.797761),\n (89.472902, 130.797761, 79.485448, 130.797761),\n (120.794104, 61.95, 116.777985, 61.95),\n (116.581708, 61.95, 116.777985, 61.95),\n (116.581708, 61.95, 110.874591, 61.95),\n (89.472902, 61.95, 110.874591, 61.95),\n (89.472902, 61.95, 79.485448, 61.95),\n (89.472902, 130.797761, 89.472902, 108.565672),\n (89.472902, 108.565672, 88.091418, 108.565672),\n (88.091418, 81.313433, 88.091418, 108.565672),\n (89.472902, 81.313433, 88.091418, 81.313433),\n (89.472902, 81.313433, 89.472902, 61.95),\n (89.472902, 108.565672, 98.992313, 108.565672),\n (98.992313, 81.313433, 89.472902, 81.313433),\n (98.992313, 108.565672, 98.992313, 81.313433),\n (120.794104, 130.797761, 120.794104, 61.95),\n (116.777985, 130.797761, 116.777985, 61.95),\n (116.581708, 130.797761, 116.581708, 61.95),\n (110.874591, 130.797761, 110.874591, 61.95),\n (138.666791, 144.797761, 207.514552, 144.797761),\n (138.666791, 172.05, 138.666791, 158.589961),\n (138.666791, 158.589961, 138.666791, 154.309623),\n (138.666791, 154.309623, 138.666791, 149.078099),\n (138.666791, 149.078099, 138.666791, 144.797761),\n (207.514552, 172.05, 207.514552, 158.589961),\n (207.514552, 158.589961, 207.514552, 154.309623),\n (207.514552, 154.309623, 207.514552, 149.078099),\n (207.514552, 149.078099, 207.514552, 144.797761),\n (138.666791, 149.078099, 160.898881, 149.078099),\n (160.898881, 149.078099, 160.898881, 147.83648),\n (188.15112, 147.83648, 160.898881, 147.83648),\n (188.15112, 149.078099, 188.15112, 147.83648),\n (188.15112, 149.078099, 207.514552, 149.078099),\n (160.898881, 149.078099, 188.15112, 149.078099),\n (138.666791, 172.05, 207.514552, 172.05),\n (138.666791, 158.589961, 207.514552, 158.589961),\n (138.666791, 154.309623, 207.514552, 154.309623)\n]\nVISIBLE_CIRCLES = [\n (173.090672, 165.640817, 4.34828)\n]\nVISIBLE_ARCS = [\n (110.874591, 158.589961, 13.7922, -90.0, -0.0),\n (111.112388, 154.54742, 5.474488, -92.489553, -2.489553),\n (79.31235, 158.993855, 14.197149, -89.301409, -44.301409)\n]\nHIDDEN_SEGMENTS = [\n (88.0914, 144.7978, 88.0914, 147.8365),\n (98.9923, 144.7978, 98.9923, 149.0781),\n (120.7941, 169.9891, 116.778, 169.9891),\n (116.778, 161.2925, 120.7941, 161.2925),\n (116.778, 92.0256, 120.7941, 92.0256),\n (116.778, 100.7222, 120.7941, 100.7222)\n]\n# (orient, text, p1, p2, base) for linear; (orient, text, center, radius, angle) for diameter\nDIMENSIONS = [\n ('horizontal', '25.7576', (124.6668, 158.59), (116.5817, 158.59), (120.6242, 147.59)),\n ('horizontal', '68.1818', (110.8746, 149.0781), (89.4729, 149.0781), (100.1737, 138.0781)),\n ('horizontal', '100', (79.4854, 144.7978), (110.8746, 144.7978), (95.18, 155.7978)),\n ('vertical', '13.6364', (116.5817, 158.59), (116.5817, 154.3096), (127.5817, 156.4498)),\n ('radius', 'R43.9394', (110.8746, 158.59), 13.7922, 45),\n ('radius', 'R17.4407', (111.1124, 154.5474), 5.4745, 45),\n ('radius', 'R45.2295', (79.3123, 158.9938), 14.1972, 45),\n ('vertical', '13.6364', (120.7941, 158.4239), (120.7941, 172.05), (109.7941, 165.2369)),\n ('horizontal', '12.7946', (79.4854, 144.7978), (116.778, 144.7978), (98.1317, 155.7978)),\n ('horizontal', '219.336', (138.6668, 144.7978), (207.5145, 144.7978), (173.0907, 155.7978)),\n ('diameter', '%%c27.7056', (173.0907, 165.6408), 4.3483, 45),\n ('horizontal', '12.7946', (121.081, 96.3739), (52.2332, 96.3739), (86.6571, 85.3739)),\n ('horizontal', '12.7946', (88.0914, 108.5657), (98.9923, 108.5657), (93.5419, 119.5657))\n]\n\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; _ds.dxf.dimasz = 2.5\n _ds.dxf.dimexe = 1.25; _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\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\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,\n angle=(0 if d[0] == \"horizontal\" else 90),\n 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,\n 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,\n 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,\n text=text, dimstyle=\"EZDXF\").render()\n\n doc.saveas(out_path)\n\n\nif __name__ == \"__main__\":\n out = sys.argv[1] if len(sys.argv) > 1 else \"0029_00291937_gt.dxf\"\n draw(out)\n print(\"wrote\", out)\n```"}], "images": ["images/0029_00291937.png"], "id": "0029_00291937"} {"messages": [{"role": "user", "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, featuring 2 circular holes, each of diameter 12.63 mm. It is extruded to a thickness of -16.67 mm. The outline includes one or more oblique (angled) edges. A union feature: The part is a rectangular plate 100 mm wide and 16.84 mm tall. It is extruded to a thickness of 53.13 mm."}, {"role": "assistant", "content": "```python\n#!/usr/bin/env python3\n# -*- coding: utf-8 -*-\n# Ground-truth 2D engineering drawing for part: 0030_00306512\n# Self-contained: reproduces the three-view DXF via ezdxf, NO FreeCAD needed.\n# Coordinates are A4 page millimetres (scale=0.7620485175202149, page=[297.0, 210.0]).\n# visible edges -> solid (layer OUTLINE); hidden edges -> dashed (layer HIDDEN)\n# dimensions -> real movable DIMENSION entities (text = true mm value)\n# Run: python 0030_00306512_gt.py [out.dxf]\nimport sys\nimport ezdxf\nimport math\n\nSCALE = 0.7620485175202149\nPAGE = [297.0, 210.0]\n\nVISIBLE_SEGMENTS = [\n (148.010108, 173.955121, 148.010108, 138.660243),\n (71.805256, 173.955121, 148.010108, 173.955121),\n (132.769137, 138.660243, 132.769137, 153.099057),\n (124.747574, 161.12062, 95.06779, 161.12062),\n (87.046226, 153.099057, 87.046226, 138.660243),\n (71.805256, 138.660243, 71.805256, 173.955121),\n (148.010108, 117.039757, 148.010108, 63.855121),\n (71.805256, 63.855121, 148.010108, 63.855121),\n (71.805256, 117.039757, 148.010108, 117.039757),\n (71.805256, 117.039757, 71.805256, 63.855121),\n (162.010108, 173.955121, 215.194744, 173.955121),\n (215.194744, 131.039757, 215.194744, 138.660243),\n (215.194744, 138.660243, 215.194744, 173.955121),\n (162.010108, 161.12062, 162.010108, 173.955121),\n (202.493935, 161.12062, 162.010108, 161.12062),\n (202.493935, 138.660243, 202.493935, 161.12062),\n (202.493935, 131.039757, 202.493935, 138.660243),\n (215.194744, 131.039757, 202.493935, 131.039757),\n (202.493935, 138.660243, 215.194744, 138.660243)\n]\nVISIBLE_CIRCLES = [\n (79.826819, 138.660243, 4.812938),\n (139.988544, 138.660243, 4.812938)\n]\nVISIBLE_ARCS = [\n (140.389623, 138.660243, 7.620485, 180.0, -0.0),\n (124.747574, 153.099057, 8.021563, -0.0, 90.0),\n (95.06779, 153.099057, 8.021563, 90.0, 180.0),\n (79.425741, 138.660243, 7.620485, -180.0, 0.0)\n]\nHIDDEN_SEGMENTS = [\n (132.7691, 76.5559, 132.7691, 63.8551),\n (148.0101, 76.5559, 124.7476, 76.5559),\n (95.0678, 76.5559, 71.8053, 76.5559),\n (144.8015, 76.5559, 144.8015, 63.8551),\n (87.0462, 76.5559, 87.0462, 63.8551),\n (84.6398, 76.5559, 84.6398, 63.8551),\n (135.1756, 63.8551, 135.1756, 76.5559),\n (75.0139, 63.8551, 75.0139, 76.5559),\n (215.1947, 143.4732, 202.4939, 143.4732),\n (215.1947, 133.8473, 202.4939, 133.8473)\n]\n# (orient, text, p1, p2, base) for linear; (orient, text, center, radius, angle) for diameter\nDIMENSIONS = [\n ('horizontal', '20', (148.0101, 138.6602), (132.7691, 138.6602), (140.3896, 127.6602)),\n ('horizontal', '38.9474', (124.7476, 161.1206), (95.0678, 161.1206), (109.9077, 150.1206)),\n ('vertical', '18.9474', (132.7691, 138.6602), (132.7691, 153.0991), (121.7691, 145.8797)),\n ('diameter', '%%c12.6316', (79.8268, 138.6602), 4.8129, 45),\n ('horizontal', '100', (71.8053, 138.6602), (79.8268, 138.6602), (75.816, 149.6602)),\n ('diameter', '%%c12.6316', (139.9886, 138.6602), 4.8129, 45),\n ('radius', 'R10', (140.3896, 138.6602), 7.6205, 135),\n ('radius', 'R10.5263', (124.7476, 153.0991), 8.0216, 45)\n]\n\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; _ds.dxf.dimasz = 2.5\n _ds.dxf.dimexe = 1.25; _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\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\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,\n angle=(0 if d[0] == \"horizontal\" else 90),\n 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,\n 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,\n 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,\n text=text, dimstyle=\"EZDXF\").render()\n\n doc.saveas(out_path)\n\n\nif __name__ == \"__main__\":\n out = sys.argv[1] if len(sys.argv) > 1 else \"0030_00306512_gt.dxf\"\n draw(out)\n print(\"wrote\", out)\n```"}], "images": ["images/0030_00306512.png"], "id": "0030_00306512"} {"messages": [{"role": "user", "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 23.36 mm. The outline includes one or more oblique (angled) edges. A cut feature: The part is a polygonal plate with 5 straight edges. It is extruded to a thickness of -119.63 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 -119.63 mm. A cut feature: The part is a polygonal plate with 2 straight edges. It is extruded to a thickness of -119.63 mm. A cut feature: The part is a circular plate with diameter 5.55 mm. It is extruded to a thickness of -47.66 mm."}, {"role": "assistant", "content": "```python\n#!/usr/bin/env python3\n# -*- coding: utf-8 -*-\n# Ground-truth 2D engineering drawing for part: 0031_00317619\n# Self-contained: reproduces the three-view DXF via ezdxf, NO FreeCAD needed.\n# Coordinates are A4 page millimetres (scale=0.7755166666666846, page=[297.0, 210.0]).\n# visible edges -> solid (layer OUTLINE); hidden edges -> dashed (layer HIDDEN)\n# dimensions -> real movable DIMENSION entities (text = true mm value)\n# Run: python 0031_00317619_gt.py [out.dxf]\nimport sys\nimport ezdxf\nimport math\n\nSCALE = 0.7755166666666846\nPAGE = [297.0, 210.0]\n\nVISIBLE_SEGMENTS = [\n (88.664392, 167.753941, 166.216059, 167.753941),\n (166.216059, 167.753941, 166.216059, 131.018941),\n (166.216059, 131.018941, 147.440392, 131.018941),\n (147.440392, 131.018941, 147.440392, 114.692274),\n (147.440392, 114.692274, 119.685059, 114.692274),\n (119.685059, 114.692274, 93.562392, 98.365607),\n (93.562392, 98.365607, 88.664392, 98.365607),\n (88.664392, 98.365607, 88.664392, 167.753941),\n (166.216059, 66.246059, 166.216059, 84.365607),\n (88.664392, 66.246059, 166.216059, 66.246059),\n (88.664392, 66.246059, 88.664392, 84.365607),\n (166.216059, 84.365607, 88.664392, 84.365607),\n (198.335608, 167.753941, 180.216059, 167.753941),\n (198.335608, 98.365607, 198.335608, 167.753941),\n (180.216059, 98.365607, 180.216059, 167.753941),\n (198.335608, 98.365607, 195.955271, 98.365607),\n (195.955271, 113.218533, 195.955271, 98.365607),\n (183.115187, 105.117523, 183.115187, 114.84486),\n (183.211643, 98.365607, 183.115187, 105.117523),\n (183.211643, 98.365607, 180.216059, 98.365607),\n (196.159477, 114.692274, 183.115187, 114.692274)\n]\nVISIBLE_CIRCLES = [\n (162.615037, 75.668224, 2.151458)\n]\nVISIBLE_ARCS = [\n (189.638224, 114.84486, 6.523037, -14.437301, -180.0)\n]\nHIDDEN_SEGMENTS = [\n (164.7665, 131.0189, 164.7665, 167.7539),\n (88.6644, 113.2185, 117.3271, 113.2185),\n (104.3655, 105.1175, 88.6644, 105.1175),\n (160.4636, 167.7539, 160.4636, 131.0189),\n (88.6644, 121.3679, 147.3717, 121.3679),\n (147.4404, 66.2461, 147.4404, 84.3656),\n (119.6851, 81.4665, 119.6851, 84.3656),\n (119.6851, 68.4222, 147.3717, 68.4222),\n (119.6851, 66.2461, 119.6851, 68.4222),\n (117.3271, 68.6264, 119.6851, 68.4222),\n (93.5624, 66.2461, 93.5624, 68.6264),\n (93.5624, 81.37, 93.5624, 84.3656),\n (104.3655, 81.4665, 93.5624, 81.37),\n (93.5624, 81.37, 88.6644, 81.37),\n (88.6644, 68.6264, 117.3271, 68.6264),\n (147.3717, 81.4665, 147.3717, 68.4204),\n (147.3717, 81.4665, 88.6644, 81.4665),\n (88.6644, 68.4204, 147.3717, 68.4204),\n (198.3356, 131.0189, 180.2161, 131.0189),\n (186.762, 167.7539, 186.762, 131.0189),\n (191.0649, 167.7539, 191.0649, 131.0189)\n]\n# (orient, text, p1, p2, base) for linear; (orient, text, center, radius, angle) for diameter\nDIMENSIONS = [\n ('horizontal', '6.3158', (93.5624, 98.3656), (88.6644, 98.3656), (91.1134, 87.3656)),\n ('horizontal', '24.2105', (166.216, 131.019), (147.4404, 131.019), (156.8282, 120.019)),\n ('horizontal', '35.7895', (147.4404, 114.6922), (119.685, 114.6922), (133.5627, 103.6922)),\n ('horizontal', '100', (88.6644, 167.7539), (166.216, 167.7539), (127.4402, 178.7539)),\n ('vertical', '21.0526', (147.4404, 131.019), (147.4404, 114.6922), (158.4404, 122.8556)),\n ('vertical', '47.3684', (166.216, 167.7539), (166.216, 131.019), (177.216, 149.3864)),\n ('vertical', '89.4737', (88.6644, 98.3656), (88.6644, 167.7539), (77.6644, 133.0598)),\n ('aligned', '39.722', (119.685, 114.6922), (93.5624, 98.3656), (112.4537, 97.2009)),\n ('horizontal', '23.3645', (198.3356, 167.7539), (180.216, 167.7539), (189.2758, 156.7539)),\n ('horizontal', '23.3645', (183.1152, 114.8449), (195.9552, 114.8449), (189.5352, 125.8449)),\n ('radius', 'R8.2784', (189.5352, 114.8449), 6.42, 45),\n ('radius', 'R8.4112', (189.6382, 114.8449), 6.523, 135),\n ('radius', 'R8.4112', (189.6382, 114.8449), 6.523, 225),\n ('vertical', '47.3684', (188.9135, 130.79), (188.9135, 167.7539), (177.9135, 149.272)),\n ('diameter', '%%c5.5485', (162.615, 75.6682), 2.1515, 45),\n ('horizontal', '35.7895', (88.6644, 66.2461), (162.615, 66.2461), (125.6397, 77.2461)),\n ('vertical', '23.3645', (162.615, 66.2461), (162.615, 66.2461), (162.615, 66.2461))\n]\n\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; _ds.dxf.dimasz = 2.5\n _ds.dxf.dimexe = 1.25; _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\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\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,\n angle=(0 if d[0] == \"horizontal\" else 90),\n 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,\n 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,\n 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,\n text=text, dimstyle=\"EZDXF\").render()\n\n doc.saveas(out_path)\n\n\nif __name__ == \"__main__\":\n out = sys.argv[1] if len(sys.argv) > 1 else \"0031_00317619_gt.dxf\"\n draw(out)\n print(\"wrote\", out)\n```"}], "images": ["images/0031_00317619.png"], "id": "0031_00317619"} {"messages": [{"role": "user", "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 66.32 mm tall. It is extruded to a thickness of 6.77 mm. A union feature: The part is a circular plate with diameter 10.53 mm. It is extruded to a thickness of 33.33 mm. A union feature: The part is a circular plate with diameter 10.53 mm. It is extruded to a thickness of 33.33 mm. A union feature: The part is a polygonal plate with 3 straight edges. It is extruded to a thickness of 33.33 mm. The outline includes one or more oblique (angled) edges. A union feature: The part is a polygonal plate with 3 straight edges. It is extruded to a thickness of 33.33 mm. The outline includes one or more oblique (angled) edges. A union feature: The part is a polygonal plate with 3 straight edges. It is extruded to a thickness of 33.33 mm. The outline includes one or more oblique (angled) edges. A union feature: The part is a polygonal plate with 3 straight edges. It is extruded to a thickness of 33.33 mm. The outline includes one or more oblique (angled) edges."}, {"role": "assistant", "content": "```python\n#!/usr/bin/env python3\n# -*- coding: utf-8 -*-\n# Ground-truth 2D engineering drawing for part: 0032_00325385\n# Self-contained: reproduces the three-view DXF via ezdxf, NO FreeCAD needed.\n# Coordinates are A4 page millimetres (scale=0.9030261192107811, page=[297.0, 210.0]).\n# visible edges -> solid (layer OUTLINE); hidden edges -> dashed (layer HIDDEN)\n# dimensions -> real movable DIMENSION entities (text = true mm value)\n# Run: python 0032_00325385_gt.py [out.dxf]\nimport sys\nimport ezdxf\nimport math\n\nSCALE = 0.9030261192107811\nPAGE = [297.0, 210.0]\n\nVISIBLE_SEGMENTS = [\n (163.543751, 112.16511, 163.543751, 172.05),\n (73.241139, 112.16511, 163.543751, 112.16511),\n (163.543751, 172.05, 73.241139, 172.05),\n (73.241139, 172.05, 73.241139, 112.16511),\n (142.428584, 129.146358, 142.428584, 124.393589),\n (142.428584, 124.393589, 142.379076, 124.393589),\n (142.379076, 124.393589, 142.379076, 129.09685),\n (142.428584, 160.138373, 142.428584, 155.385604),\n (142.379076, 160.138373, 142.428584, 160.138373),\n (142.379076, 155.435112, 142.379076, 160.138373),\n (163.543751, 98.16511, 163.543751, 92.050871),\n (163.543751, 92.050871, 73.241139, 92.050871),\n (73.241139, 98.16511, 73.241139, 92.050871),\n (163.543751, 98.16511, 73.241139, 98.16511),\n (99.208091, 92.050871, 99.208091, 61.95),\n (99.208091, 61.95, 89.702553, 61.95),\n (137.675815, 92.050871, 137.675815, 61.95),\n (147.181353, 61.95, 137.675815, 61.95),\n (89.702553, 61.95, 89.702553, 92.050871),\n (147.181353, 61.95, 147.181353, 92.050871),\n (177.543751, 112.16511, 183.65799, 112.16511),\n (177.543751, 172.05, 183.65799, 172.05),\n (177.543751, 172.05, 177.543751, 112.16511),\n (183.65799, 172.05, 183.65799, 112.16511),\n (213.758861, 129.146358, 213.758861, 119.64082),\n (213.758861, 164.891142, 213.758861, 155.385604),\n (213.758861, 129.146358, 183.65799, 129.146358),\n (213.758861, 119.64082, 183.65799, 119.64082),\n (213.758861, 164.891142, 183.65799, 164.891142),\n (213.758861, 155.385604, 183.65799, 155.385604)\n]\nVISIBLE_CIRCLES = [\n (94.455322, 124.393589, 4.752769),\n (94.455322, 160.138373, 4.752769)\n]\nVISIBLE_ARCS = [\n (142.428584, 124.393589, 4.752769, -180.0, 90.0),\n (142.379076, 124.393589, 4.703261, 90.0, -180.0),\n (142.428584, 160.138373, 4.752769, -90.0, -180.0),\n (142.379076, 160.138373, 4.703261, -180.0, -90.0)\n]\nHIDDEN_SEGMENTS = [\n (142.4286, 92.0509, 142.4286, 61.95),\n (142.3791, 92.0509, 142.3791, 61.95),\n (183.658, 124.3936, 213.7589, 124.3936),\n (183.658, 160.1384, 213.7589, 160.1384)\n]\n# (orient, text, p1, p2, base) for linear; (orient, text, center, radius, angle) for diameter\nDIMENSIONS = [\n ('horizontal', '100', (163.5438, 172.05), (73.2411, 172.05), (118.3924, 161.05)),\n ('vertical', '66.3158', (163.5438, 112.1651), (163.5438, 172.05), (152.5438, 142.1076)),\n ('diameter', '%%c10.5263', (94.4553, 160.1384), 4.7528, 45),\n ('diameter', '%%c10.5263', (94.4553, 124.3936), 4.7528, 45),\n ('horizontal', '5.2631', (137.6758, 155.3856), (142.4286, 155.3856), (140.0522, 166.3856)),\n ('vertical', '5.2632', (142.4286, 155.3856), (142.4286, 160.1384), (131.4286, 157.762)),\n ('horizontal', '71.3542', (73.2411, 112.1651), (137.6758, 112.1651), (105.4585, 123.1651)),\n ('vertical', '47.8618', (137.6758, 112.1651), (137.6758, 155.3856), (126.6758, 133.7754)),\n ('radius', 'R5.2632', (142.4286, 160.1384), 4.7528, 45),\n ('horizontal', '5.2083', (137.6758, 155.4351), (142.3791, 155.4351), (140.0275, 166.4351)),\n ('vertical', '5.2083', (142.3791, 155.4351), (142.3791, 160.1384), (131.3791, 157.7867)),\n ('horizontal', '71.3542', (73.2411, 112.1651), (137.6758, 112.1651), (105.4585, 123.1651)),\n ('vertical', '47.9166', (137.6758, 112.1651), (137.6758, 155.4351), (126.6758, 133.8001)),\n ('radius', 'R5.2083', (142.3791, 160.1384), 4.7032, 135),\n ('horizontal', '5.2632', (137.6758, 124.3936), (142.4286, 124.3936), (140.0522, 135.3936)),\n ('vertical', '5.2632', (142.4286, 124.3936), (142.4286, 129.1464), (131.4286, 126.77)),\n ('horizontal', '71.3542', (73.2411, 112.1651), (137.6758, 112.1651), (105.4585, 123.1651)),\n ('vertical', '13.5416', (137.6758, 112.1651), (137.6758, 124.3936), (126.6758, 118.2793)),\n ('radius', 'R5.2632', (142.4286, 124.3936), 4.7528, 45),\n ('horizontal', '5.2083', (137.6758, 124.3936), (142.3791, 124.3936), (140.0275, 135.3936)),\n ('vertical', '5.2083', (142.3791, 124.3936), (142.3791, 129.0969), (131.3791, 126.7452)),\n ('horizontal', '71.3542', (73.2411, 112.1651), (137.6758, 112.1651), (105.4585, 123.1651)),\n ('vertical', '13.5416', (137.6758, 112.1651), (137.6758, 124.3936), (126.6758, 118.2793)),\n ('radius', 'R5.2083', (142.3791, 124.3936), 4.7032, 135),\n ('horizontal', '6.7708', (177.5438, 112.1651), (183.658, 112.1651), (180.6009, 123.1651)),\n ('horizontal', '33.3333', (183.658, 160.1384), (213.7588, 160.1384), (198.7084, 171.1384)),\n ('horizontal', '33.3333', (183.658, 124.3936), (213.7588, 124.3936), (198.7084, 145.3936)),\n ('horizontal', '33.3333', (183.658, 160.1384), (213.7588, 160.1384), (198.7084, 171.1384)),\n ('horizontal', '33.3333', (183.658, 160.1384), (213.7588, 160.1384), (198.7084, 171.1384)),\n ('horizontal', '33.3333', (183.658, 124.3936), (213.7588, 124.3936), (198.7084, 135.3936)),\n ('horizontal', '33.3333', (183.658, 124.3936), (213.7588, 124.3936), (198.7084, 135.3936))\n]\n\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; _ds.dxf.dimasz = 2.5\n _ds.dxf.dimexe = 1.25; _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\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\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,\n angle=(0 if d[0] == \"horizontal\" else 90),\n 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,\n 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,\n 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,\n text=text, dimstyle=\"EZDXF\").render()\n\n doc.saveas(out_path)\n\n\nif __name__ == \"__main__\":\n out = sys.argv[1] if len(sys.argv) > 1 else \"0032_00325385_gt.dxf\"\n draw(out)\n print(\"wrote\", out)\n```"}], "images": ["images/0032_00325385.png"], "id": "0032_00325385"} {"messages": [{"role": "user", "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 99.74 x 99.74 mm, featuring a circular hole of diameter 33.6 mm. It is extruded to a thickness of 51.09 mm. A union feature: The part is a rectangular plate 83.1 mm wide and 100 mm tall, featuring 4 circular holes, each of diameter 16.9 mm. It is extruded to a thickness of 17.03 mm."}, {"role": "assistant", "content": "```python\n#!/usr/bin/env python3\n# -*- coding: utf-8 -*-\n# Ground-truth 2D engineering drawing for part: 0033_00331091\n# Self-contained: reproduces the three-view DXF via ezdxf, NO FreeCAD needed.\n# Coordinates are A4 page millimetres (scale=0.43860171985477137, page=[297.0, 210.0]).\n# visible edges -> solid (layer OUTLINE); hidden edges -> dashed (layer HIDDEN)\n# dimensions -> real movable DIMENSION entities (text = true mm value)\n# Run: python 0033_00331091_gt.py [out.dxf]\nimport sys\nimport ezdxf\nimport math\n\nSCALE = 0.43860171985477137\nPAGE = [297.0, 210.0]\n\nVISIBLE_SEGMENTS = [\n (102.221956, 124.477351, 102.221956, 168.225205),\n (58.474102, 124.477351, 102.221956, 124.477351),\n (102.221956, 124.477351, 138.669141, 124.477351),\n (138.669141, 168.337523, 102.221956, 168.337523),\n (102.221956, 168.337523, 102.221956, 168.225205),\n (102.221956, 168.225205, 58.474102, 168.225205),\n (58.474102, 168.225205, 58.474102, 124.477351),\n (102.221956, 80.600768, 102.221956, 65.662477),\n (160.599227, 80.600768, 138.669141, 80.600768),\n (138.669141, 80.600768, 102.221956, 80.600768),\n (102.221956, 65.662477, 58.474102, 65.662477),\n (58.474102, 110.477351, 58.474102, 65.662477),\n (102.221956, 110.477351, 58.474102, 110.477351),\n (102.221956, 110.477351, 102.221956, 95.53906),\n (160.599227, 95.53906, 138.669141, 95.53906),\n (102.221956, 95.53906, 102.221956, 80.600768),\n (138.669141, 95.53906, 102.221956, 95.53906),\n (160.599227, 80.600768, 160.599227, 95.53906),\n (138.669141, 95.53906, 138.669141, 80.600768),\n (219.414102, 124.477351, 174.599227, 124.477351),\n (204.47581, 168.337523, 204.47581, 168.225205),\n (174.599227, 168.225205, 219.414102, 168.225205),\n (219.414102, 168.225205, 219.414102, 124.477351),\n (174.599227, 168.225205, 174.599227, 124.477351),\n (189.537519, 168.337523, 204.47581, 168.337523),\n (189.537519, 168.337523, 189.537519, 168.225205)\n]\nVISIBLE_CIRCLES = [\n (117.047929, 139.303325, 3.706493),\n (117.047929, 154.129299, 3.706493),\n (138.669141, 139.303325, 3.706493),\n (138.669141, 154.129299, 3.706493),\n (80.578281, 146.58153, 7.36806)\n]\nVISIBLE_ARCS = [\n (138.669141, 146.407437, 21.930086, -90.0, 90.0)\n]\nHIDDEN_SEGMENTS = [\n (120.7544, 80.6008, 120.7544, 95.5391),\n (142.3756, 80.6008, 142.3756, 95.5391),\n (87.9463, 65.6625, 87.9463, 110.4774),\n (113.3414, 80.6008, 113.3414, 95.5391),\n (134.9626, 80.6008, 134.9626, 95.5391),\n (73.2102, 65.6625, 73.2102, 110.4774),\n (204.4758, 143.0098, 189.5375, 143.0098),\n (204.4758, 135.5968, 189.5375, 135.5968),\n (204.4758, 157.8358, 189.5375, 157.8358),\n (204.4758, 150.4228, 189.5375, 150.4228),\n (219.4141, 153.9496, 174.5992, 153.9496),\n (219.4141, 139.2135, 174.5992, 139.2135)\n]\n# (orient, text, p1, p2, base) for linear; (orient, text, center, radius, angle) for diameter\nDIMENSIONS = [\n ('horizontal', '99.7439', (102.2219, 168.2252), (58.4741, 168.2252), (80.348, 157.2252)),\n ('vertical', '99.7439', (102.2219, 124.4774), (102.2219, 168.2252), (91.2219, 146.3513)),\n ('diameter', '%%c33.598', (80.5783, 146.5815), 7.3681, 45),\n ('horizontal', '50.3969', (58.4741, 146.5815), (80.5783, 146.5815), (69.5262, 157.5815)),\n ('vertical', '50.3969', (80.5783, 124.4774), (80.5783, 146.5815), (69.5783, 135.5295)),\n ('horizontal', '83.0986', (102.2219, 124.4774), (138.6691, 124.4774), (120.4455, 135.4774)),\n ('vertical', '100', (138.6691, 124.4774), (138.6691, 168.3375), (127.6691, 146.4075)),\n ('horizontal', '99.7439', (58.4741, 124.4774), (102.2219, 124.4774), (80.348, 135.4774)),\n ('vertical', '0', (102.2219, 124.4774), (102.2219, 124.4774), (102.2219, 124.4774)),\n ('diameter', '%%c16.9014', (117.0479, 139.3033), 3.7065, 45),\n ('horizontal', '33.8028', (102.2219, 139.3033), (117.0479, 139.3033), (109.6349, 150.3033)),\n ('vertical', '33.8028', (117.0479, 124.4774), (117.0479, 139.3033), (106.0479, 131.8904)),\n ('diameter', '%%c16.9014', (117.0479, 154.1293), 3.7065, 45),\n ('horizontal', '33.8028', (102.2219, 154.1293), (117.0479, 154.1293), (109.6349, 165.1293)),\n ('vertical', '67.6056', (117.0479, 124.4774), (117.0479, 154.1293), (106.0479, 139.3033)),\n ('diameter', '%%c16.9014', (138.6691, 139.3033), 3.7065, 45),\n ('horizontal', '83.0986', (102.2219, 139.3033), (138.6691, 139.3033), (120.4455, 150.3033)),\n ('vertical', '33.8028', (138.6691, 124.4774), (138.6691, 139.3033), (127.6691, 131.8904)),\n ('diameter', '%%c16.9014', (138.6691, 154.1293), 3.7065, 45),\n ('horizontal', '83.0986', (102.2219, 154.1293), (138.6691, 154.1293), (120.4455, 165.1293)),\n ('vertical', '67.6056', (138.6691, 124.4774), (138.6691, 154.1293), (127.6691, 139.3033)),\n ('radius', 'R50', (138.6691, 146.4075), 21.9301, 45),\n ('horizontal', '102.177', (174.5992, 124.4774), (219.4141, 124.4774), (197.0067, 135.4774)),\n ('horizontal', '34.0589', (189.5375, 124.4774), (204.4758, 124.4774), (197.0067, 135.4774))\n]\n\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; _ds.dxf.dimasz = 2.5\n _ds.dxf.dimexe = 1.25; _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\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\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,\n angle=(0 if d[0] == \"horizontal\" else 90),\n 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,\n 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,\n 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,\n text=text, dimstyle=\"EZDXF\").render()\n\n doc.saveas(out_path)\n\n\nif __name__ == \"__main__\":\n out = sys.argv[1] if len(sys.argv) > 1 else \"0033_00331091_gt.dxf\"\n draw(out)\n print(\"wrote\", out)\n```"}], "images": ["images/0033_00331091.png"], "id": "0033_00331091"} {"messages": [{"role": "user", "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 49.87 mm, featuring a circular hole of diameter 16.62 mm. It is extruded to a thickness of 16.88 mm. A union feature: The part is a polygonal plate with 4 straight edges. It is extruded to a thickness of 16.88 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 16.88 mm. The outline includes one or more oblique (angled) edges. A union feature: The part is a circular plate with diameter 50.12 mm, featuring a circular hole of diameter 17.06 mm. It is extruded to a thickness of 16.88 mm."}, {"role": "assistant", "content": "```python\n#!/usr/bin/env python3\n# -*- coding: utf-8 -*-\n# Ground-truth 2D engineering drawing for part: 0036_00362522\n# Self-contained: reproduces the three-view DXF via ezdxf, NO FreeCAD needed.\n# Coordinates are A4 page millimetres (scale=0.5758757270418603, page=[297.0, 210.0]).\n# visible edges -> solid (layer OUTLINE); hidden edges -> dashed (layer HIDDEN)\n# dimensions -> real movable DIMENSION entities (text = true mm value)\n# Run: python 0036_00362522_gt.py [out.dxf]\nimport sys\nimport ezdxf\nimport math\n\nSCALE = 0.5758757270418603\nPAGE = [297.0, 210.0]\n\nVISIBLE_SEGMENTS = [\n (145.474687, 109.296749, 145.474687, 160.704966),\n (131.453707, 149.713713, 131.453707, 150.268672),\n (116.905267, 164.817111, 116.905267, 107.229538),\n (131.115188, 121.774039, 131.115188, 121.588258),\n (117.212296, 78.87004, 146.072999, 78.87004),\n (117.212296, 78.87004, 116.905267, 78.87004),\n (146.072999, 69.147462, 117.212296, 69.147462),\n (117.212296, 69.147462, 116.905267, 69.147462),\n (116.905267, 78.87004, 116.905267, 69.147462),\n (146.072999, 69.147462, 146.072999, 78.87004),\n (117.212296, 69.147462, 117.212296, 78.87004),\n (169.795576, 92.87004, 169.795576, 107.229538),\n (160.072999, 107.229538, 169.795576, 107.229538),\n (160.072999, 107.229538, 160.072999, 92.87004),\n (160.072999, 164.817111, 160.072999, 179.247463),\n (160.072999, 164.817111, 160.072999, 107.229538),\n (169.795576, 179.247463, 169.795576, 164.817111),\n (169.795576, 164.817111, 169.795576, 107.229538),\n (160.072999, 164.817111, 169.795576, 164.817111),\n (169.795576, 92.87004, 160.072999, 92.87004),\n (169.795576, 179.247463, 160.072999, 179.247463)\n]\nVISIBLE_CIRCLES = [\n (131.264766, 107.229538, 4.7865),\n (131.642648, 164.817111, 4.91246),\n (131.264766, 107.229538, 14.359499),\n (131.642648, 164.817111, 14.430351)\n]\nVISIBLE_ARCS = [\n (131.115188, 164.069221, 14.359499, -88.649152, -37.815751),\n (131.453707, 164.817111, 14.548439, -180.0, -90.0),\n (131.453707, 107.229538, 14.548439, 91.333301, 180.0),\n (131.264766, 107.229538, 14.359499, 90.596842, -180.0)\n]\nHIDDEN_SEGMENTS = [\n (145.4747, 69.1475, 145.4747, 78.87),\n (131.4537, 78.87, 131.4537, 69.1475),\n (142.459, 69.1475, 142.459, 78.87),\n (136.0513, 78.87, 136.0513, 69.1475),\n (131.1152, 69.1475, 131.1152, 78.87),\n (136.5551, 78.87, 136.5551, 69.1475),\n (126.4783, 69.1475, 126.4783, 78.87),\n (126.7302, 69.1475, 126.7302, 78.87),\n (169.7956, 109.2967, 160.073, 109.2967),\n (169.7956, 160.705, 160.073, 160.705),\n (160.073, 150.2687, 169.7956, 150.2687),\n (169.7956, 149.7137, 160.073, 149.7137),\n (169.7956, 155.2651, 160.073, 155.2651),\n (169.7956, 121.5883, 160.073, 121.5883),\n (169.7956, 121.774, 160.073, 121.774),\n (169.7956, 112.016, 160.073, 112.016),\n (169.7956, 102.443, 160.073, 102.443),\n (169.7956, 150.3868, 160.073, 150.3868),\n (169.7956, 169.7296, 160.073, 169.7296),\n (169.7956, 159.9047, 160.073, 159.9047)\n]\n# (orient, text, p1, p2, base) for linear; (orient, text, center, radius, angle) for diameter\nDIMENSIONS = [\n ('diameter', '%%c49.8701', (131.2647, 107.2295), 14.3595, 45),\n ('diameter', '%%c16.6234', (131.2647, 107.2295), 4.7865, 135),\n ('horizontal', '25.2632', (116.9053, 107.2295), (131.4537, 107.2295), (124.1795, 118.2295)),\n ('vertical', '100', (131.4537, 107.2295), (131.4537, 164.8171), (120.4537, 136.0233)),\n ('radius', 'R25.2632', (131.4537, 107.2295), 14.5485, 225),\n ('horizontal', '24.9351', (131.1152, 107.08), (145.4747, 107.08), (138.2949, 118.08)),\n ('vertical', '98.961', (145.4747, 107.08), (145.4747, 164.0692), (134.4747, 135.5746)),\n ('radius', 'R24.9351', (131.1152, 107.08), 14.3595, 315),\n ('diameter', '%%c50.1162', (131.6426, 164.8171), 14.4304, 45),\n ('diameter', '%%c17.0608', (131.6426, 164.8171), 4.9125, 135),\n ('horizontal', '16.8831', (160.073, 107.2295), (169.7956, 107.2295), (164.9343, 118.2295)),\n ('horizontal', '16.8831', (160.073, 107.2295), (169.7956, 107.2295), (164.9343, 118.2295))\n]\n\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; _ds.dxf.dimasz = 2.5\n _ds.dxf.dimexe = 1.25; _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\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\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,\n angle=(0 if d[0] == \"horizontal\" else 90),\n 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,\n 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,\n 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,\n text=text, dimstyle=\"EZDXF\").render()\n\n doc.saveas(out_path)\n\n\nif __name__ == \"__main__\":\n out = sys.argv[1] if len(sys.argv) > 1 else \"0036_00362522_gt.dxf\"\n draw(out)\n print(\"wrote\", out)\n```"}], "images": ["images/0036_00362522.png"], "id": "0036_00362522"} {"messages": [{"role": "user", "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 67.37 mm wide and 92.63 mm tall. It is extruded to a thickness of 457.14 mm. A union feature: The part is a rectangular plate 36.84 mm wide and 100 mm tall. It is extruded to a thickness of 457.14 mm. A union feature: The part is a rectangular plate 35.79 mm wide and 100 mm tall. It is extruded to a thickness of 457.14 mm. A union feature: The part is a rectangular plate 43.91 mm wide and 57.14 mm tall. It is extruded to a thickness of 1371.43 mm. A union feature: The part is a rectangular plate 43.91 mm wide and 57.14 mm tall. It is extruded to a thickness of -914.29 mm."}, {"role": "assistant", "content": "```python\n#!/usr/bin/env python3\n# -*- coding: utf-8 -*-\n# Ground-truth 2D engineering drawing for part: 0036_00365246\n# Self-contained: reproduces the three-view DXF via ezdxf, NO FreeCAD needed.\n# Coordinates are A4 page millimetres (scale=0.03158646661005046, page=[297.0, 210.0]).\n# visible edges -> solid (layer OUTLINE); hidden edges -> dashed (layer HIDDEN)\n# dimensions -> real movable DIMENSION entities (text = true mm value)\n# Run: python 0036_00365246_gt.py [out.dxf]\nimport sys\nimport ezdxf\nimport math\n\nSCALE = 0.03158646661005046\nPAGE = [297.0, 210.0]\n\nVISIBLE_SEGMENTS = [\n (108.333421, 134.942741, 108.395169, 134.942741),\n (106.298269, 138.101387, 106.267239, 138.101387),\n (108.395169, 137.868645, 108.301489, 137.868645),\n (128.176464, 135.393976, 108.276203, 135.393976),\n (128.196324, 137.198917, 108.238226, 137.198917),\n (165.379055, 135.393976, 130.036823, 135.393976),\n (165.379055, 137.198917, 130.05337, 137.198917),\n (165.379055, 135.393976, 165.379055, 137.198917),\n (106.219624, 135.393976, 93.181417, 135.393976),\n (106.187978, 137.198917, 93.181417, 137.198917),\n (93.181417, 135.393976, 93.181417, 137.198917),\n (106.298269, 96.014984, 130.079723, 96.014984),\n (106.267239, 96.014984, 106.170211, 96.014984),\n (106.298269, 96.014984, 106.267239, 96.014984),\n (106.298269, 110.454512, 130.079723, 110.454512),\n (106.267239, 110.454512, 106.170211, 110.454512),\n (106.298269, 110.454512, 106.267239, 110.454512),\n (106.298269, 96.014984, 106.298269, 110.454512),\n (130.05337, 102.750264, 130.05337, 104.137218),\n (106.267239, 110.454512, 106.267239, 96.014984),\n (106.187978, 102.750264, 106.187978, 104.137218),\n (130.05337, 104.137218, 165.379055, 104.137218),\n (165.379055, 102.750264, 130.05337, 102.750264),\n (165.379055, 102.750264, 165.379055, 104.137218),\n (93.181417, 104.137218, 106.187978, 104.137218),\n (106.187978, 102.750264, 93.181417, 102.750264),\n (93.181417, 102.750264, 93.181417, 104.137218),\n (130.079723, 96.014984, 130.079723, 102.750264),\n (130.079723, 104.137218, 130.079723, 110.454512),\n (106.170211, 96.014984, 106.170211, 102.750264),\n (106.170211, 104.137218, 106.170211, 110.454512),\n (193.818583, 138.101387, 193.818583, 148.356874),\n (193.818583, 124.454512, 193.818583, 134.942741),\n (193.818583, 138.101387, 193.818583, 134.942741),\n (179.379055, 138.101387, 179.379055, 148.356874),\n (179.379055, 124.454512, 179.379055, 134.942741),\n (179.379055, 138.101387, 179.379055, 134.942741),\n (179.379055, 138.101387, 193.818583, 138.101387),\n (187.083303, 135.393976, 185.696349, 135.393976),\n (185.696349, 137.198917, 185.696349, 135.393976),\n (187.083303, 137.198917, 185.696349, 137.198917),\n (187.083303, 135.393976, 187.083303, 137.198917),\n (193.818583, 148.356874, 179.379055, 148.356874),\n (193.818583, 124.454512, 179.379055, 124.454512),\n (179.379055, 134.942741, 193.818583, 134.942741)\n]\nVISIBLE_CIRCLES = [\n\n]\nVISIBLE_ARCS = [\n (118.257592, 136.405693, 9.970336, -171.5625, 171.5625),\n (118.128542, 136.405693, 11.951181, -172.96875, 171.843056),\n (119.072054, 136.522064, 12.901843, 172.96875, -172.96875),\n (118.980355, 136.522064, 10.763431, 172.813063, -171.5625)\n]\nHIDDEN_SEGMENTS = [\n (108.3952, 110.4545, 108.3952, 96.015),\n (108.3334, 110.4545, 108.3334, 96.015),\n (128.1963, 102.7503, 128.1963, 104.1372),\n (128.1765, 102.7503, 128.1765, 104.1372),\n (108.3015, 96.015, 108.3015, 110.4545),\n (108.2762, 102.7503, 108.2169, 102.7503),\n (108.2762, 102.7503, 108.2762, 104.1372),\n (108.2762, 104.1372, 108.2169, 104.1372),\n (108.2382, 102.7503, 108.2382, 104.1372),\n (128.1765, 102.7503, 108.2762, 102.7503),\n (108.2762, 104.1372, 128.1765, 104.1372),\n (128.2279, 104.1372, 128.1963, 104.1372),\n (128.1963, 104.1372, 128.1765, 104.1372),\n (108.2382, 104.1372, 128.1765, 104.1372),\n (128.2279, 102.7503, 128.1963, 102.7503),\n (128.1963, 102.7503, 128.1765, 102.7503),\n (128.1765, 102.7503, 108.2382, 102.7503),\n (128.2279, 96.015, 128.2279, 102.7503),\n (128.2279, 104.1372, 128.2279, 110.4545),\n (108.2169, 96.015, 108.2169, 102.7503),\n (108.2169, 104.1372, 108.2169, 110.4545),\n (193.8186, 146.376, 179.3791, 146.376),\n (193.8186, 126.4354, 179.3791, 126.4354)\n]\n# (orient, text, p1, p2, base) for linear; (orient, text, center, radius, angle) for diameter\nDIMENSIONS = [\n ('vertical', '92.6316', (108.3952, 134.9427), (108.3952, 137.8686), (97.3952, 136.4057)),\n ('radius', 'R315.652', (118.2576, 136.4057), 9.9703, 45),\n ('radius', 'R378.364', (118.1285, 136.4057), 11.9512, 135),\n ('horizontal', '36.8421', (107.1697, 134.9427), (108.3334, 134.9427), (107.7516, 145.9427)),\n ('vertical', '100', (108.3334, 134.9427), (108.3334, 138.1014), (97.3334, 136.5221)),\n ('horizontal', '28.5715', (106.2672, 134.9427), (107.1697, 134.9427), (106.7185, 145.9427)),\n ('vertical', '0', (107.1697, 134.9427), (107.1697, 134.9427), (107.1697, 134.9427)),\n ('radius', 'R340.761', (118.9804, 136.5221), 10.7634, 225),\n ('horizontal', '35.7895', (106.2672, 134.9427), (107.3977, 134.9427), (106.8325, 145.9427)),\n ('vertical', '100', (107.3977, 134.9427), (107.3977, 138.1014), (96.3977, 136.5221)),\n ('vertical', '0', (106.2672, 134.9427), (106.2672, 134.9427), (106.2672, 134.9427)),\n ('vertical', '0', (106.2672, 134.9427), (106.2672, 134.9427), (106.2672, 134.9427)),\n ('radius', 'R408.461', (119.0721, 136.5221), 12.9018, 45),\n ('horizontal', '457.143', (179.3791, 134.9427), (193.8186, 134.9427), (186.5988, 145.9427)),\n ('horizontal', '457.143', (179.3791, 134.9427), (193.8186, 134.9427), (186.5988, 145.9427)),\n ('horizontal', '457.143', (185.6963, 135.394), (187.0833, 135.394), (186.3898, 146.394))\n]\n\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; _ds.dxf.dimasz = 2.5\n _ds.dxf.dimexe = 1.25; _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\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\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,\n angle=(0 if d[0] == \"horizontal\" else 90),\n 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,\n 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,\n 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,\n text=text, dimstyle=\"EZDXF\").render()\n\n doc.saveas(out_path)\n\n\nif __name__ == \"__main__\":\n out = sys.argv[1] if len(sys.argv) > 1 else \"0036_00365246_gt.dxf\"\n draw(out)\n print(\"wrote\", out)\n```"}], "images": ["images/0036_00365246.png"], "id": "0036_00365246"} {"messages": [{"role": "user", "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 18.23 mm. It is extruded to a thickness of 29.58 mm. A union feature: The part is a circular plate with diameter 18.96 mm. It is extruded to a thickness of 29.58 mm. A union feature: The part is a circular plate with diameter 21.87 mm. It is extruded to a thickness of 29.58 mm. A union feature: The part is a polygonal plate with 4 straight edges, featuring 3 circular holes (diameters 18.18, 20.78 mm). It is extruded to a thickness of 29.58 mm. The outline includes one or more oblique (angled) edges."}, {"role": "assistant", "content": "```python\n#!/usr/bin/env python3\n# -*- coding: utf-8 -*-\n# Ground-truth 2D engineering drawing for part: 0045_00457931\n# Self-contained: reproduces the three-view DXF via ezdxf, NO FreeCAD needed.\n# Coordinates are A4 page millimetres (scale=0.5729498537563386, page=[297.0, 210.0]).\n# visible edges -> solid (layer OUTLINE); hidden edges -> dashed (layer HIDDEN)\n# dimensions -> real movable DIMENSION entities (text = true mm value)\n# Run: python 0045_00457931_gt.py [out.dxf]\nimport sys\nimport ezdxf\nimport math\n\nSCALE = 0.5729498537563386\nPAGE = [297.0, 210.0]\n\nVISIBLE_SEGMENTS = [\n (143.279493, 107.50537, 143.279493, 163.312174),\n (112.771774, 164.056265, 112.771774, 106.761279),\n (143.279493, 84.362803, 112.771774, 84.362803),\n (143.279493, 67.41407, 112.771774, 67.41407),\n (112.771774, 84.362803, 112.771774, 67.41407),\n (143.279493, 84.362803, 143.279493, 67.41407),\n (157.279493, 106.761279, 157.279493, 98.362804),\n (157.279493, 177.51407, 157.279493, 164.056265),\n (157.279493, 164.056265, 157.279493, 106.761279),\n (174.228226, 106.761279, 174.228226, 98.362804),\n (174.228226, 177.51407, 174.228226, 164.056265),\n (174.228226, 164.056265, 174.228226, 106.761279),\n (157.279493, 106.761279, 174.228226, 106.761279),\n (157.279493, 164.056265, 174.228226, 164.056265),\n (174.228226, 98.362804, 157.279493, 98.362804),\n (174.228226, 177.51407, 157.279493, 177.51407)\n]\nVISIBLE_CIRCLES = [\n (128.328056, 152.646874, 5.221689),\n (128.12354, 137.765059, 5.430557),\n (128.132243, 122.056478, 6.266027),\n (128.397679, 122.387185, 5.952726),\n (128.397679, 138.01309, 5.208635)\n]\nVISIBLE_ARCS = [\n (128.397679, 152.894904, 5.208635, -14.189275, 162.830227),\n (127.808799, 116.023539, 17.660736, -148.368444, -28.837194),\n (127.98899, 162.181845, 15.332225, 4.227819, 172.977819)\n]\nHIDDEN_SEGMENTS = [\n (123.4212, 67.4141, 123.4212, 84.3628),\n (133.4474, 67.4141, 133.4474, 84.3628),\n (127.8814, 67.4141, 127.8814, 84.3628),\n (134.2992, 67.4141, 134.2992, 84.3628),\n (127.7759, 67.4141, 127.7759, 84.3628),\n (133.4812, 67.4141, 133.4812, 84.3628),\n (133.5497, 67.4141, 133.5497, 84.3628),\n (133.6063, 67.4141, 133.6063, 84.3628),\n (133.5541, 67.4141, 133.5541, 84.3628),\n (174.2282, 154.4325, 157.2795, 154.4325),\n (174.2282, 151.6181, 157.2795, 151.6181),\n (157.2795, 107.5054, 174.2282, 107.5054),\n (157.2795, 163.3122, 174.2282, 163.3122),\n (174.2282, 128.3175, 157.2795, 128.3175),\n (174.2282, 123.1664, 157.2795, 123.1664),\n (174.2282, 143.1845, 157.2795, 143.1845),\n (174.2282, 136.8785, 157.2795, 136.8785),\n (174.2282, 157.8686, 157.2795, 157.8686),\n (174.2282, 158.1035, 157.2795, 158.1035),\n (174.2282, 128.3399, 157.2795, 128.3399),\n (174.2282, 143.2217, 157.2795, 143.2217),\n (174.2282, 128.3225, 157.2795, 128.3225),\n (174.2282, 143.1956, 157.2795, 143.1956)\n]\n# (orient, text, p1, p2, base) for linear; (orient, text, center, radius, angle) for diameter\nDIMENSIONS = [\n ('diameter', '%%c18.2274', (128.3281, 152.6469), 5.2217, 45),\n ('diameter', '%%c18.9565', (128.1235, 137.7651), 5.4306, 45),\n ('diameter', '%%c21.8729', (128.1322, 122.0565), 6.266, 45),\n ('horizontal', '53.2467', (112.7718, 106.7613), (143.2795, 106.7613), (128.0256, 117.7613)),\n ('vertical', '100', (143.2795, 106.7613), (143.2795, 164.0562), (132.2795, 135.4087)),\n ('diameter', '%%c20.7792', (128.3977, 122.3872), 5.9527, 135),\n ('horizontal', '27.2727', (112.7718, 122.3872), (128.3977, 122.3872), (120.5847, 133.3872)),\n ('vertical', '27.2728', (128.3977, 106.7613), (128.3977, 122.3872), (117.3977, 114.5742)),\n ('diameter', '%%c18.1818', (128.3977, 138.0131), 5.2086, 135),\n ('horizontal', '27.2727', (112.7718, 138.0131), (128.3977, 138.0131), (120.5847, 149.0131)),\n ('vertical', '54.5455', (128.3977, 106.7613), (128.3977, 138.0131), (117.3977, 122.3872)),\n ('diameter', '%%c18.1818', (128.3977, 152.8949), 5.2086, 135),\n ('horizontal', '27.2727', (112.7718, 152.8949), (128.3977, 152.8949), (120.5847, 163.8949)),\n ('vertical', '80.5195', (128.3977, 106.7613), (128.3977, 152.8949), (117.3977, 129.8281)),\n ('radius', 'R30.8242', (127.8088, 116.0236), 17.6607, 45),\n ('radius', 'R26.7602', (127.989, 162.1818), 15.3323, 45),\n ('horizontal', '29.5815', (157.2795, 152.6469), (174.2282, 152.6469), (165.7539, 163.6469)),\n ('horizontal', '29.5815', (157.2795, 137.7651), (174.2282, 137.7651), (165.7539, 158.7651)),\n ('horizontal', '29.5815', (157.2795, 106.7613), (174.2282, 106.7613), (165.7539, 117.7613))\n]\n\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; _ds.dxf.dimasz = 2.5\n _ds.dxf.dimexe = 1.25; _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\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\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,\n angle=(0 if d[0] == \"horizontal\" else 90),\n 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,\n 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,\n 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,\n text=text, dimstyle=\"EZDXF\").render()\n\n doc.saveas(out_path)\n\n\nif __name__ == \"__main__\":\n out = sys.argv[1] if len(sys.argv) > 1 else \"0045_00457931_gt.dxf\"\n draw(out)\n print(\"wrote\", out)\n```"}], "images": ["images/0045_00457931.png"], "id": "0045_00457931"} {"messages": [{"role": "user", "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 2.14 mm. The outline includes one or more oblique (angled) edges. A union feature: The part is a rectangular plate 19.28 mm wide and 1.22 mm tall. It is extruded to a thickness of 2.14 mm. A union feature: The part is a polygonal plate with 4 straight edges. It is extruded to a thickness of 205.7 mm. The outline includes one or more oblique (angled) edges. A union feature: The part is a rectangular plate 19.28 mm wide and 1.22 mm tall. It is extruded to a thickness of 205.7 mm."}, {"role": "assistant", "content": "```python\n#!/usr/bin/env python3\n# -*- coding: utf-8 -*-\n# Ground-truth 2D engineering drawing for part: 0046_00466319\n# Self-contained: reproduces the three-view DXF via ezdxf, NO FreeCAD needed.\n# Coordinates are A4 page millimetres (scale=0.3476663155313328, page=[297.0, 210.0]).\n# visible edges -> solid (layer OUTLINE); hidden edges -> dashed (layer HIDDEN)\n# dimensions -> real movable DIMENSION entities (text = true mm value)\n# Run: python 0046_00466319_gt.py [out.dxf]\nimport sys\nimport ezdxf\nimport math\n\nSCALE = 0.3476663155313328\nPAGE = [297.0, 210.0]\n\nVISIBLE_SEGMENTS = [\n (85.097674, 172.05, 91.802326, 172.05),\n (116.386046, 147.466279, 115.868494, 147.466279),\n (91.802326, 171.532448, 91.802326, 171.626548),\n (91.802326, 171.626548, 85.097674, 171.626548),\n (85.097674, 171.626548, 85.097674, 172.05),\n (91.802326, 61.95, 116.386046, 61.95),\n (116.386046, 61.95, 116.386046, 133.466279),\n (91.802326, 133.466279, 116.386046, 133.466279),\n (85.097674, 133.466279, 85.097674, 61.95),\n (85.097674, 133.466279, 91.802326, 133.466279),\n (85.097674, 61.95, 91.802326, 61.95),\n (91.802326, 133.466279, 91.802326, 61.95),\n (130.386047, 172.05, 201.902326, 172.05),\n (130.386047, 147.466279, 130.386047, 171.532448),\n (130.386047, 171.532448, 130.386047, 171.626548),\n (130.386047, 171.626548, 130.386047, 172.05),\n (201.902326, 147.466279, 130.386047, 147.466279),\n (201.902326, 147.466279, 201.902326, 171.532448),\n (201.902326, 171.532448, 201.902326, 171.626548),\n (201.902326, 171.626548, 201.902326, 172.05),\n (130.386047, 171.626548, 201.902326, 171.626548),\n (201.902326, 171.532448, 130.386047, 171.532448)\n]\nVISIBLE_CIRCLES = [\n\n]\nVISIBLE_ARCS = [\n (91.802326, 147.466279, 24.583721, -0.0, 90.0),\n (91.802326, 147.466279, 24.066169, -0.0, 90.0)\n]\nHIDDEN_SEGMENTS = [\n (115.8685, 61.95, 115.8685, 133.4663)\n]\n# (orient, text, p1, p2, base) for linear; (orient, text, center, radius, angle) for diameter\nDIMENSIONS = [\n ('horizontal', '1.4886', (116.3861, 147.4663), (115.8685, 147.4663), (116.1273, 136.4663)),\n ('vertical', '1.4886', (91.8023, 171.5324), (91.8023, 172.05), (80.8023, 171.7912)),\n ('radius', 'R70.7107', (91.8023, 147.4663), 24.5837, 45),\n ('radius', 'R69.222', (91.8023, 147.4663), 24.0662, 135),\n ('horizontal', '19.2847', (85.0977, 172.05), (91.8023, 172.05), (88.45, 183.05)),\n ('vertical', '1.218', (91.8023, 172.05), (91.8023, 171.6266), (102.8023, 171.8383)),\n ('horizontal', '19.2847', (91.8023, 172.05), (85.0977, 172.05), (88.45, 161.05)),\n ('vertical', '0', (85.0977, 172.05), (85.0977, 172.05), (85.0977, 172.05)),\n ('horizontal', '70.7107', (91.8023, 172.05), (116.3861, 172.05), (104.0942, 183.05)),\n ('vertical', '70.7107', (116.3861, 172.05), (116.3861, 147.4663), (127.3861, 159.7581)),\n ('vertical', '0', (91.8023, 172.05), (91.8023, 172.05), (91.8023, 172.05)),\n ('radius', 'R70.7107', (91.8023, 147.4663), 24.5837, 225),\n ('radius', 'R69.222', (91.8023, 147.4663), 24.0662, 315),\n ('horizontal', '205.704', (201.9023, 172.05), (130.386, 172.05), (166.1442, 161.05)),\n ('horizontal', '205.704', (201.9023, 172.05), (130.386, 172.05), (166.1442, 161.05))\n]\n\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; _ds.dxf.dimasz = 2.5\n _ds.dxf.dimexe = 1.25; _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\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\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,\n angle=(0 if d[0] == \"horizontal\" else 90),\n 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,\n 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,\n 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,\n text=text, dimstyle=\"EZDXF\").render()\n\n doc.saveas(out_path)\n\n\nif __name__ == \"__main__\":\n out = sys.argv[1] if len(sys.argv) > 1 else \"0046_00466319_gt.dxf\"\n draw(out)\n print(\"wrote\", out)\n```"}], "images": ["images/0046_00466319.png"], "id": "0046_00466319"} {"messages": [{"role": "user", "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 21.05 mm bounding box. It is extruded to a thickness of 37.5 mm. A cut feature: The part is a circular plate with diameter 8.42 mm. It is extruded to a thickness of -16.67 mm. A cut feature: The part is a circular plate with diameter 8.42 mm. It is extruded to a thickness of -16.67 mm."}, {"role": "assistant", "content": "```python\n#!/usr/bin/env python3\n# -*- coding: utf-8 -*-\n# Ground-truth 2D engineering drawing for part: 0047_00470171\n# Self-contained: reproduces the three-view DXF via ezdxf, NO FreeCAD needed.\n# Coordinates are A4 page millimetres (scale=1.1349024390243558, page=[297.0, 210.0]).\n# visible edges -> solid (layer OUTLINE); hidden edges -> dashed (layer HIDDEN)\n# dimensions -> real movable DIMENSION entities (text = true mm value)\n# Run: python 0047_00470171_gt.py [out.dxf]\nimport sys\nimport ezdxf\nimport math\n\nSCALE = 1.1349024390243558\nPAGE = [297.0, 210.0]\n\nVISIBLE_SEGMENTS = [\n (171.965701, 162.004299, 171.965701, 152.447226),\n (58.475457, 162.004299, 171.965701, 162.004299),\n (171.965701, 152.447226, 148.073018, 152.447226),\n (148.073018, 152.447226, 148.073018, 128.554543),\n (148.073018, 128.554543, 138.515945, 128.554543),\n (91.925213, 128.554543, 82.36814, 128.554543),\n (82.36814, 128.554543, 82.36814, 152.447226),\n (82.36814, 152.447226, 58.475457, 152.447226),\n (58.475457, 152.447226, 58.475457, 162.004299),\n (171.965701, 71.995701, 171.965701, 114.554543),\n (58.475457, 71.995701, 58.475457, 114.554543),\n (58.475457, 114.554543, 171.965701, 114.554543),\n (58.475457, 71.995701, 171.965701, 71.995701),\n (228.524543, 162.004299, 185.965701, 162.004299),\n (228.524543, 128.554543, 228.524543, 152.447226),\n (228.524543, 152.447226, 228.524543, 162.004299),\n (185.965701, 128.554543, 185.965701, 152.447226),\n (185.965701, 152.447226, 185.965701, 162.004299),\n (228.524543, 152.447226, 185.965701, 152.447226),\n (228.524543, 128.554543, 185.965701, 128.554543)\n]\nVISIBLE_CIRCLES = [\n (160.193577, 93.275122, 4.778537),\n (70.347134, 93.275122, 4.778537)\n]\nVISIBLE_ARCS = [\n (115.220579, 128.554543, 23.295366, -0.0, 180.0)\n]\nHIDDEN_SEGMENTS = [\n (164.9721, 152.5468, 164.9721, 162.0043),\n (75.1257, 152.5468, 75.1257, 162.0043),\n (155.415, 162.0043, 155.415, 152.5468),\n (65.5686, 162.0043, 65.5686, 152.5468),\n (148.073, 71.9957, 148.073, 114.5545),\n (138.5159, 71.9957, 138.5159, 114.5545),\n (91.9252, 71.9957, 91.9252, 114.5545),\n (82.3681, 71.9957, 82.3681, 114.5545),\n (202.4666, 162.0043, 202.4666, 152.5468),\n (212.0237, 162.0043, 212.0237, 152.5468),\n (185.9657, 151.8499, 228.5245, 151.8499)\n]\n# (orient, text, p1, p2, base) for linear; (orient, text, center, radius, angle) for diameter\nDIMENSIONS = [\n ('horizontal', '21.0526', (171.9657, 152.4472), (148.0731, 152.4472), (160.0194, 141.4472)),\n ('horizontal', '57.8947', (148.0731, 128.5545), (82.3681, 128.5545), (115.2206, 117.5545)),\n ('horizontal', '100', (58.4755, 162.0043), (171.9657, 162.0043), (115.2206, 173.0043)),\n ('vertical', '8.4211', (171.9657, 162.0043), (171.9657, 152.4472), (182.9657, 157.2257)),\n ('vertical', '21.0526', (148.0731, 152.4472), (148.0731, 128.5545), (159.0731, 140.5008)),\n ('radius', 'R20.5263', (115.2206, 128.5545), 23.2953, 45),\n ('horizontal', '37.5', (228.5245, 162.0043), (185.9657, 162.0043), (207.2451, 151.0043)),\n ('diameter', '%%c8.4211', (70.3471, 93.2751), 4.7786, 45),\n ('diameter', '%%c8.4211', (160.1936, 93.2751), 4.7786, 45),\n ('horizontal', '49.4737', (58.4755, 71.9957), (160.1936, 71.9957), (109.3345, 82.9957))\n]\n\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; _ds.dxf.dimasz = 2.5\n _ds.dxf.dimexe = 1.25; _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\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\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,\n angle=(0 if d[0] == \"horizontal\" else 90),\n 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,\n 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,\n 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,\n text=text, dimstyle=\"EZDXF\").render()\n\n doc.saveas(out_path)\n\n\nif __name__ == \"__main__\":\n out = sys.argv[1] if len(sys.argv) > 1 else \"0047_00470171_gt.dxf\"\n draw(out)\n print(\"wrote\", out)\n```"}], "images": ["images/0047_00470171.png"], "id": "0047_00470171"} {"messages": [{"role": "user", "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 25.03 mm, featuring a circular hole of diameter 9.91 mm. It is extruded to a thickness of 4.5 mm. A union feature: The part is a circular plate with diameter 28.96 mm, featuring a circular hole of diameter 9.86 mm. It is extruded to a thickness of 4.5 mm. A union feature: The part is a polygonal plate with 8 straight edges. It is extruded to a thickness of 4.5 mm. The outline includes one or more oblique (angled) edges. A union feature: The part is a circular plate with diameter 50.06 mm, featuring a circular hole of diameter 10.43 mm. It is extruded to a thickness of 4.5 mm. A union feature: The part is a polygonal plate with 4 straight edges, featuring a circular hole of diameter 10.43 mm. It is extruded to a thickness of 4.5 mm. The outline includes one or more oblique (angled) edges. A union feature: The part is a circular plate with diameter 28.96 mm, featuring a circular hole of diameter 9.86 mm. It is extruded to a thickness of 4.5 mm."}, {"role": "assistant", "content": "```python\n#!/usr/bin/env python3\n# -*- coding: utf-8 -*-\n# Ground-truth 2D engineering drawing for part: 0047_00478328\n# Self-contained: reproduces the three-view DXF via ezdxf, NO FreeCAD needed.\n# Coordinates are A4 page millimetres (scale=0.41091146667578904, page=[297.0, 210.0]).\n# visible edges -> solid (layer OUTLINE); hidden edges -> dashed (layer HIDDEN)\n# dimensions -> real movable DIMENSION entities (text = true mm value)\n# Run: python 0047_00478328_gt.py [out.dxf]\nimport sys\nimport ezdxf\nimport math\n\nSCALE = 0.41091146667578904\nPAGE = [297.0, 210.0]\n\nVISIBLE_SEGMENTS = [\n (112.538307, 126.759517, 116.378611, 167.082712),\n (124.613198, 172.9607, 149.725273, 172.123631),\n (151.983427, 161.821846, 134.939239, 161.33487),\n (130.069471, 155.491148, 132.854584, 128.104212),\n (133.108207, 124.909006, 128.822811, 84.197746),\n (116.565464, 86.651013, 112.538307, 124.909006),\n (157.057725, 65.172145, 149.725273, 65.172145),\n (149.725273, 65.172145, 149.725273, 63.321633),\n (149.725273, 63.321633, 157.057725, 63.321633),\n (112.538307, 63.321633, 116.365944, 63.321633),\n (116.365944, 63.321633, 124.613198, 63.321633),\n (124.613198, 63.321633, 149.725273, 63.321633),\n (124.613198, 65.172145, 124.613198, 63.321633),\n (124.613198, 65.172145, 149.725273, 65.172145),\n (112.538307, 65.172145, 116.365944, 65.172145),\n (116.365944, 65.172145, 124.613198, 65.172145),\n (112.538307, 63.321633, 112.538307, 65.172145),\n (157.057725, 65.172145, 157.057725, 63.321633),\n (116.365944, 65.172145, 116.365944, 63.321633),\n (172.908237, 126.759517, 172.908237, 167.082712),\n (172.908237, 167.082712, 172.908237, 173.421634),\n (172.908237, 86.651013, 172.908237, 79.172145),\n (172.908237, 86.651013, 172.908237, 124.909006),\n (172.908237, 126.759517, 172.908237, 124.909006),\n (171.057725, 79.172145, 171.057725, 86.651013),\n (171.057725, 86.651013, 171.057725, 124.909006),\n (171.057725, 124.909006, 171.057725, 126.759517),\n (171.057725, 126.759517, 171.057725, 167.082712),\n (171.057725, 167.082712, 171.057725, 173.421634),\n (172.908237, 126.759517, 171.057725, 126.759517),\n (171.057725, 167.082712, 172.908237, 167.082712),\n (172.908237, 124.909006, 171.057725, 124.909006),\n (171.057725, 86.651013, 172.908237, 86.651013),\n (171.057725, 173.421634, 172.908237, 173.421634),\n (171.057725, 79.172145, 172.908237, 79.172145)\n]\nVISIBLE_CIRCLES = [\n (120.680559, 102.196408, 2.142698),\n (122.823257, 125.834262, 2.142698),\n (122.316801, 167.470777, 2.025823),\n (151.91525, 167.470777, 2.035563),\n (122.316801, 85.123002, 2.025823),\n (151.91525, 167.470777, 5.142475),\n (122.316801, 167.470777, 5.950856),\n (122.823257, 125.834262, 10.28495),\n (122.316801, 85.123002, 5.950856)\n]\nVISIBLE_ARCS = [\n (151.795095, 166.935103, 5.116723, 166.978061, -87.890625),\n (135.218625, 156.151117, 5.191276, 93.085054, -172.696196),\n (122.823257, 125.921985, 10.334714, -34.761928, -5.625),\n (122.823257, 84.78865, 6.028583, -5.625, 66.797225),\n (122.823257, 125.921985, 10.334714, -174.375, -145.238072),\n (122.823257, 125.834262, 10.28495, 149.897066, -145.63955),\n (122.76482, 125.752294, 10.275994, 149.338251, 174.375),\n (122.482688, 166.936501, 6.092348, -179.962091, 34.46017),\n (122.316801, 167.470777, 5.950856, -174.809999, 29.308079)\n]\nHIDDEN_SEGMENTS = [\n (146.81, 65.1721, 146.81, 63.3216),\n (151.9834, 63.3216, 151.9834, 65.1721),\n (113.9255, 65.1721, 113.9255, 63.3216),\n (114.333, 65.1721, 114.333, 63.3216),\n (128.8228, 63.3216, 128.8228, 65.1721),\n (125.1984, 65.1721, 125.1984, 63.3216),\n (133.1082, 63.3216, 133.1082, 65.1721),\n (131.3135, 65.1721, 131.3135, 63.3216),\n (132.8546, 65.1721, 132.8546, 63.3216),\n (130.0695, 63.3216, 130.0695, 65.1721),\n (134.9392, 63.3216, 134.9392, 65.1721),\n (122.8233, 63.3216, 122.8233, 65.1721),\n (127.5059, 65.1721, 127.5059, 63.3216),\n (153.9508, 63.3216, 153.9508, 65.1721),\n (146.7728, 65.1721, 146.7728, 63.3216),\n (146.6784, 65.1721, 146.6784, 63.3216),\n (128.8518, 65.1721, 128.8518, 63.3216),\n (133.1082, 65.1721, 133.1082, 63.3216),\n (130.0273, 65.1721, 130.0273, 63.3216),\n (118.5379, 65.1721, 118.5379, 63.3216),\n (120.6806, 65.1721, 120.6806, 63.3216),\n (128.575, 65.1721, 128.575, 63.3216),\n (128.2677, 65.1721, 128.2677, 63.3216),\n (120.291, 65.1721, 120.291, 63.3216),\n (171.0577, 168.088, 172.9082, 168.088),\n (171.0577, 172.1236, 172.9082, 172.1236),\n (172.9082, 161.8218, 171.0577, 161.8218),\n (171.0577, 130.9927, 172.9082, 130.9927),\n (171.0577, 120.0295, 172.9082, 120.0295),\n (172.9082, 84.1977, 171.0577, 84.1977),\n (171.0577, 90.3296, 172.9082, 90.3296),\n (171.0577, 128.1042, 172.9082, 128.1042),\n (172.9082, 155.4911, 171.0577, 155.4911),\n (172.9082, 161.3349, 171.0577, 161.3349),\n (171.0577, 170.3838, 172.9082, 170.3838),\n (171.0577, 162.3283, 172.9082, 162.3283),\n (171.0577, 172.6133, 172.9082, 172.6133),\n (171.0577, 161.8184, 172.9082, 161.8184),\n (171.0577, 100.0537, 172.9082, 100.0537),\n (171.0577, 104.3391, 172.9082, 104.3391),\n (171.0577, 123.6916, 172.9082, 123.6916),\n (171.0577, 127.977, 172.9082, 127.977),\n (171.0577, 160.8442, 172.9082, 160.8442),\n (171.0577, 161.5199, 172.9082, 161.5199),\n (171.0577, 165.445, 172.9082, 165.445),\n (171.0577, 169.4966, 172.9082, 169.4966),\n (171.0577, 165.4352, 172.9082, 165.4352),\n (171.0577, 169.5063, 172.9082, 169.5063),\n (171.0577, 83.0972, 172.9082, 83.0972)\n]\n# (orient, text, p1, p2, base) for linear; (orient, text, center, radius, angle) for diameter\nDIMENSIONS = [\n ('diameter', '%%c25.0296', (151.9152, 167.4708), 5.1425, 45),\n ('diameter', '%%c9.9076', (151.9152, 167.4708), 2.0356, 135),\n ('diameter', '%%c28.9642', (122.3168, 167.4708), 5.9509, 45),\n ('diameter', '%%c9.8601', (122.3168, 167.4708), 2.0258, 135),\n ('horizontal', '95.9942', (112.5383, 173.0223), (151.9834, 173.0223), (132.2609, 184.0223)),\n ('vertical', '112.586', (151.9834, 173.0223), (151.9834, 126.7595), (162.9834, 149.8909)),\n ('horizontal', '41.4959', (151.9834, 161.8219), (134.9393, 161.3349), (143.7755, 150.5829)),\n ('radius', 'R14.8264', (122.4827, 166.9365), 6.0923, 45),\n ('radius', 'R12.4521', (151.7951, 166.9351), 5.1167, 45),\n ('radius', 'R12.6336', (135.2186, 156.1511), 5.1913, 45),\n ('radius', 'R25.0078', (122.7648, 125.7523), 10.276, 45),\n ('diameter', '%%c50.0592', (122.8232, 125.8343), 10.2849, 135),\n ('diameter', '%%c10.429', (122.8232, 125.8343), 2.1427, 225),\n ('horizontal', '50.0592', (112.5383, 124.909), (133.1082, 124.909), (122.8232, 135.909)),\n ('vertical', '99.0755', (133.1082, 124.909), (133.1082, 84.1978), (144.1082, 104.5534)),\n ('aligned', '99.6229', (133.1082, 124.909), (128.8228, 84.1978), (141.9051, 103.4019)),\n ('diameter', '%%c10.429', (120.6805, 102.1964), 2.1427, 45),\n ('horizontal', '19.8151', (112.5383, 102.1964), (120.6805, 102.1964), (116.6094, 113.1964)),\n ('vertical', '55.2737', (120.6805, 124.909), (120.6805, 102.1964), (131.6805, 113.5527)),\n ('radius', 'R25.1507', (122.8232, 125.922), 10.3347, 315),\n ('radius', 'R14.6712', (122.8232, 84.7887), 6.0286, 45),\n ('diameter', '%%c28.9642', (122.3168, 85.123), 5.9509, 45),\n ('diameter', '%%c9.8601', (122.3168, 85.123), 2.0258, 135),\n ('horizontal', '4.5034', (172.9082, 167.4708), (171.0577, 167.4708), (171.983, 156.4708)),\n ('horizontal', '4.5034', (172.9082, 167.4708), (171.0577, 167.4708), (171.983, 146.4708)),\n ('horizontal', '4.5034', (172.9082, 124.909), (171.0577, 124.909), (171.983, 113.909))\n]\n\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; _ds.dxf.dimasz = 2.5\n _ds.dxf.dimexe = 1.25; _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\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\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,\n angle=(0 if d[0] == \"horizontal\" else 90),\n 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,\n 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,\n 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,\n text=text, dimstyle=\"EZDXF\").render()\n\n doc.saveas(out_path)\n\n\nif __name__ == \"__main__\":\n out = sys.argv[1] if len(sys.argv) > 1 else \"0047_00478328_gt.dxf\"\n draw(out)\n print(\"wrote\", out)\n```"}], "images": ["images/0047_00478328.png"], "id": "0047_00478328"} {"messages": [{"role": "user", "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 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 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": "assistant", "content": "```python\n#!/usr/bin/env python3\n# -*- coding: utf-8 -*-\n# Ground-truth 2D engineering drawing for part: 0048_00487281\n# Self-contained: reproduces the three-view DXF via ezdxf, NO FreeCAD needed.\n# Coordinates are A4 page millimetres (scale=0.4435514456349073, page=[297.0, 210.0]).\n# visible edges -> solid (layer OUTLINE); hidden edges -> dashed (layer HIDDEN)\n# dimensions -> real movable DIMENSION entities (text = true mm value)\n# Run: python 0048_00487281_gt.py [out.dxf]\nimport sys\nimport ezdxf\nimport math\n\nSCALE = 0.4435514456349073\nPAGE = [297.0, 210.0]\n\nVISIBLE_SEGMENTS = [\n (130.02006, 98.648973, 132.725251, 125.250017),\n (153.674709, 91.815407, 135.276648, 92.341066),\n (125.010418, 79.821095, 151.707425, 80.710995),\n (111.09634, 129.662847, 115.301611, 85.507501),\n (133.124739, 135.046691, 129.205748, 166.072037),\n (115.569219, 167.797009, 111.09634, 132.386715),\n (153.674709, 65.342956, 158.424754, 65.342956),\n (153.674709, 65.342956, 135.276648, 65.342956),\n (135.276648, 65.342956, 134.034182, 65.342956),\n (133.124739, 65.342956, 134.034182, 65.342956),\n (133.124739, 65.342956, 129.255465, 65.342956),\n (129.255465, 65.342956, 115.779483, 65.342956),\n (115.779483, 65.342956, 115.569219, 65.342956),\n (115.569219, 65.342956, 111.09634, 65.342956),\n (135.276648, 65.342956, 135.276648, 63.527043),\n (135.276648, 63.527043, 134.034182, 63.527043),\n (153.674709, 65.342956, 153.674709, 63.527043),\n (153.674709, 63.527043, 135.276648, 63.527043),\n (158.424754, 63.527043, 153.674709, 63.527043),\n (134.034182, 63.527043, 133.124739, 63.527043),\n (133.124739, 63.527043, 129.255465, 63.527043),\n (115.779483, 63.527043, 129.255465, 63.527043),\n (115.779483, 63.527043, 115.569219, 63.527043),\n (115.569219, 63.527043, 111.09634, 63.527043),\n (133.124739, 63.527043, 133.124739, 65.342956),\n (111.09634, 65.342956, 111.09634, 63.527043),\n (115.569219, 65.342956, 115.569219, 63.527043),\n (158.424754, 63.527043, 158.424754, 65.342956),\n (134.034182, 63.527043, 134.034182, 65.342956),\n (129.255465, 63.527043, 129.255465, 65.342956),\n (115.779483, 63.527043, 115.779483, 65.342956),\n (172.424754, 129.662847, 172.424754, 85.507501),\n (172.424754, 85.507501, 172.424754, 79.342956),\n (172.424754, 173.627043, 172.424754, 167.797009),\n (172.424754, 167.797009, 172.424754, 132.386715),\n (172.424754, 132.386715, 172.424754, 129.662847),\n (172.424754, 129.662847, 174.240666, 129.662847),\n (174.240666, 85.507501, 174.240666, 79.342956),\n (172.424754, 85.507501, 174.240666, 85.507501),\n (174.240666, 129.662847, 174.240666, 85.507501),\n (174.240666, 167.797009, 174.240666, 173.627043),\n (174.240666, 167.797009, 174.240666, 132.386715),\n (174.240666, 132.386715, 174.240666, 129.662847),\n (172.424754, 132.386715, 174.240666, 132.386715),\n (172.424754, 167.797009, 174.240666, 167.797009),\n (174.240666, 79.342956, 172.424754, 79.342956),\n (174.240666, 173.627043, 172.424754, 173.627043)\n]\nVISIBLE_CIRCLES = [\n (122.517474, 86.080947, 2.293784),\n (152.919672, 86.080947, 2.179095),\n (122.565261, 130.570803, 2.389359),\n (122.517474, 166.889052, 2.293784),\n (120.042098, 156.987551, 2.23644),\n (122.517474, 166.889052, 6.737991),\n (122.517474, 86.080947, 6.737991),\n (152.919672, 86.080947, 5.505082),\n (122.565261, 130.570803, 11.468921)\n]\nVISIBLE_ARCS = [\n (122.135176, 130.750077, 11.092249, -174.375, -165.864682),\n (135.578227, 97.93658, 5.603635, 172.696196, -93.085054),\n (153.471417, 86.295989, 5.523161, 87.890625, 116.116874),\n (121.830635, 86.29448, 6.576282, 82.686575, -173.126983),\n (122.278538, 166.969493, 6.760158, 172.96875, -102.496963),\n (122.278538, 131.007523, 11.26693, 54.812008, 172.96875),\n (122.565261, 130.570803, 11.468921, 57.240634, -167.258023)\n]\nHIDDEN_SEGMENTS = [\n (130.0201, 65.343, 130.0201, 63.527),\n (151.0401, 63.527, 151.0401, 65.343),\n (151.7074, 63.527, 151.7074, 65.343),\n (125.0104, 63.527, 125.0104, 65.343),\n (122.6678, 63.527, 122.6678, 65.343),\n (124.8113, 65.343, 124.8113, 63.527),\n (155.0988, 65.343, 155.0988, 63.527),\n (124.9546, 65.343, 124.9546, 63.527),\n (120.8157, 63.527, 120.8157, 65.343),\n (122.2785, 65.343, 122.2785, 63.527),\n (129.9746, 63.527, 129.9746, 65.343),\n (120.2237, 63.527, 120.2237, 65.343),\n (150.7406, 63.527, 150.7406, 65.343),\n (120.1759, 63.527, 120.1759, 65.343),\n (117.8057, 63.527, 117.8057, 65.343),\n (174.2407, 128.0412, 172.4248, 128.0412),\n (172.4248, 98.649, 174.2407, 98.649),\n (174.2407, 125.25, 172.4248, 125.25),\n (172.4248, 92.3411, 174.2407, 92.3411),\n (172.4248, 91.8154, 174.2407, 91.8154),\n (174.2407, 91.2552, 172.4248, 91.2552),\n (174.2407, 80.711, 172.4248, 80.711),\n (174.2407, 92.8173, 172.4248, 92.8173),\n (174.2407, 140.2156, 172.4248, 140.2156),\n (174.2407, 135.0467, 172.4248, 135.0467),\n (174.2407, 166.072, 172.4248, 166.072),\n (174.2407, 160.3695, 172.4248, 160.3695),\n (174.2407, 91.8192, 172.4248, 91.8192),\n (174.2407, 91.586, 172.4248, 91.586),\n (174.2407, 80.5759, 172.4248, 80.5759),\n (174.2407, 92.8189, 172.4248, 92.8189),\n (174.2407, 92.8708, 172.4248, 92.8708),\n (174.2407, 88.3747, 172.4248, 88.3747),\n (174.2407, 83.7872, 172.4248, 83.7872),\n (174.2407, 88.26, 172.4248, 88.26),\n (174.2407, 83.9019, 172.4248, 83.9019),\n (174.2407, 142.0397, 172.4248, 142.0397),\n (174.2407, 142.2745, 172.4248, 142.2745),\n (174.2407, 132.9602, 172.4248, 132.9602),\n (174.2407, 128.1814, 172.4248, 128.1814),\n (174.2407, 159.224, 172.4248, 159.224),\n (174.2407, 154.7511, 172.4248, 154.7511),\n (174.2407, 169.1828, 172.4248, 169.1828),\n (174.2407, 164.5953, 172.4248, 164.5953)\n]\n# (orient, text, p1, p2, base) for linear; (orient, text, center, radius, angle) for diameter\nDIMENSIONS = [\n ('diameter', '%%c30.382', (122.5175, 166.8891), 6.738, 45),\n ('diameter', '%%c10.3428', (122.5175, 166.8891), 2.2938, 135),\n ('diameter', '%%c30.382', (122.5175, 86.0809), 6.738, 45),\n ('diameter', '%%c10.3428', (122.5175, 86.0809), 2.2938, 135),\n ('diameter', '%%c24.8227', (152.9197, 86.0809), 5.5051, 45),\n ('diameter', '%%c9.8257', (152.9197, 86.0809), 2.1791, 135),\n ('horizontal', '50.4212', (111.0963, 132.3867), (133.4607, 132.3867), (122.2785, 143.3867)),\n ('vertical', '79.8336', (133.4607, 132.3867), (133.4607, 167.797), (122.4607, 150.0919)),\n ('aligned', '80.4679', (115.5692, 167.797), (111.0963, 132.3867), (124.2461, 148.7133)),\n ('diameter', '%%c10.0842', (120.0421, 156.9876), 2.2364, 45),\n ('horizontal', '20.1685', (111.0963, 156.9876), (120.0421, 156.9876), (115.5692, 167.9876)),\n ('vertical', '55.4634', (120.0421, 132.3867), (120.0421, 156.9876), (109.0421, 144.6871)),\n ('radius', 'R25.4016', (122.2785, 131.0075), 11.2669, 45),\n ('radius', 'R15.241', (122.2785, 166.9695), 6.7602, 225),\n ('horizontal', '95.9942', (111.0963, 79.7253), (153.6747, 79.7253), (132.3855, 90.7253)),\n ('vertical', '112.586', (153.6747, 79.7253), (153.6747, 129.6628), (142.6747, 104.6941)),\n ('aligned', '41.4959', (153.6747, 91.8154), (135.2767, 92.3411), (144.1615, 81.0827)),\n ('aligned', '100', (111.0963, 129.6628), (115.3016, 85.5075), (124.1494, 108.6281)),\n ('radius', 'R14.8264', (121.8306, 86.2945), 6.5763, 225),\n ('radius', 'R12.4521', (153.4714, 86.296), 5.5231, 45),\n ('radius', 'R12.6336', (135.5782, 97.9366), 5.6037, 45),\n ('radius', 'R25.0078', (122.1352, 130.7501), 11.0922, 45),\n ('diameter', '%%c51.7141', (122.5653, 130.5708), 11.4689, 135),\n ('diameter', '%%c10.7738', (122.5653, 130.5708), 2.3894, 225),\n ('horizontal', '4.094', (172.4248, 132.3867), (174.2407, 132.3867), (173.3327, 143.3867)),\n ('horizontal', '4.094', (172.4248, 85.5075), (174.2407, 85.5075), (173.3327, 96.5075))\n]\n\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; _ds.dxf.dimasz = 2.5\n _ds.dxf.dimexe = 1.25; _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\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\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,\n angle=(0 if d[0] == \"horizontal\" else 90),\n 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,\n 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,\n 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,\n text=text, dimstyle=\"EZDXF\").render()\n\n doc.saveas(out_path)\n\n\nif __name__ == \"__main__\":\n out = sys.argv[1] if len(sys.argv) > 1 else \"0048_00487281_gt.dxf\"\n draw(out)\n print(\"wrote\", out)\n```"}], "images": ["images/0048_00487281.png"], "id": "0048_00487281"} {"messages": [{"role": "user", "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 66.32 mm tall, featuring a circular hole of diameter 33.68 mm. It is extruded to a thickness of 15.91 mm. A cut feature: The part is a rectangular plate 16.08 mm wide and 18.18 mm tall. It is extruded to a thickness of -2.27 mm. A cut feature: The part is a rectangular plate 16.08 mm wide and 18.18 mm tall. It is extruded to a thickness of -2.27 mm. A cut feature: The part is a rectangular plate 8.61 mm wide and 68.18 mm tall. It is extruded to a thickness of -2.27 mm."}, {"role": "assistant", "content": "```python\n#!/usr/bin/env python3\n# -*- coding: utf-8 -*-\n# Ground-truth 2D engineering drawing for part: 0049_00492790\n# Self-contained: reproduces the three-view DXF via ezdxf, NO FreeCAD needed.\n# Coordinates are A4 page millimetres (scale=1.1687459994182265, page=[297.0, 210.0]).\n# visible edges -> solid (layer OUTLINE); hidden edges -> dashed (layer HIDDEN)\n# dimensions -> real movable DIMENSION entities (text = true mm value)\n# Run: python 0049_00492790_gt.py [out.dxf]\nimport sys\nimport ezdxf\nimport math\n\nSCALE = 1.1687459994182265\nPAGE = [297.0, 210.0]\n\nVISIBLE_SEGMENTS = [\n (185.640457, 94.543686, 185.640457, 172.05),\n (68.765857, 94.543686, 71.422098, 94.543686),\n (71.422098, 94.543686, 81.487853, 94.543686),\n (81.487853, 94.543686, 116.578193, 94.543686),\n (116.578193, 94.543686, 135.367603, 94.543686),\n (135.367603, 94.543686, 185.640457, 94.543686),\n (185.640457, 172.05, 81.487853, 172.05),\n (81.487853, 172.05, 71.422098, 172.05),\n (71.422098, 172.05, 68.765857, 172.05),\n (135.367603, 94.543686, 135.367603, 115.733048),\n (81.487853, 94.543686, 81.487853, 172.05),\n (116.578193, 115.793614, 116.578193, 94.543686),\n (116.578193, 171.574673, 116.578193, 150.324745),\n (135.367603, 171.574673, 116.578193, 171.574673),\n (135.367603, 152.090898, 135.367603, 171.574673),\n (71.422098, 172.05, 71.422098, 94.543686),\n (68.765857, 172.05, 68.765857, 94.543686),\n (185.640457, 80.543686, 185.640457, 61.95),\n (185.640457, 80.543686, 68.765857, 80.543686),\n (185.640457, 61.95, 81.487853, 61.95),\n (81.487853, 64.606241, 81.487853, 61.95),\n (81.487853, 64.606241, 71.422098, 64.606241),\n (71.422098, 61.95, 71.422098, 64.606241),\n (71.422098, 61.95, 68.765857, 61.95),\n (68.765857, 80.543686, 68.765857, 61.95),\n (199.640457, 94.543686, 218.234143, 94.543686),\n (199.640457, 172.05, 218.234143, 172.05),\n (199.640457, 172.05, 199.640457, 94.543686),\n (218.234143, 172.05, 218.234143, 94.543686)\n]\nVISIBLE_CIRCLES = [\n (127.818286, 133.911973, 19.684143)\n]\nVISIBLE_ARCS = [\n (125.972898, 131.91308, 18.657375, -120.234375, -61.068127),\n (125.972898, 134.205279, 18.657375, 111.935899, 120.234375),\n (127.818286, 133.911973, 19.684143, -0.0, 67.44794),\n (127.818286, 133.911973, 19.684143, -67.44794, -0.0),\n (127.818286, 133.911973, 19.684143, -68.605656, -67.44794),\n (127.818286, 133.911973, 19.684143, 67.44794, 116.604728)\n]\nHIDDEN_SEGMENTS = [\n (116.5782, 61.95, 116.5782, 64.6062),\n (116.5782, 64.6062, 135.3676, 64.6062),\n (135.3676, 61.95, 135.3676, 64.6062),\n (134.9988, 61.95, 134.9988, 64.6062),\n (119.0031, 61.95, 119.0031, 64.6062),\n (147.5024, 80.5437, 147.5024, 61.95),\n (108.1341, 61.95, 108.1341, 80.5437),\n (218.2341, 115.733, 215.5779, 115.733),\n (218.2341, 115.7936, 215.5779, 115.7936),\n (215.5779, 94.5437, 215.5779, 172.05),\n (218.2341, 115.5842, 215.5779, 115.5842),\n (218.2341, 151.5119, 215.5779, 151.5119),\n (218.2341, 152.0909, 215.5779, 152.0909),\n (218.2341, 150.3247, 215.5779, 150.3247),\n (215.5779, 94.5437, 215.5779, 113.2557),\n (215.5779, 113.2557, 215.5779, 115.733),\n (215.5779, 115.733, 215.5779, 115.7936),\n (215.5779, 153.5961, 199.6405, 153.5961),\n (218.2341, 114.2278, 199.6405, 114.2278),\n (215.5779, 113.2557, 218.2341, 113.2557)\n]\n# (orient, text, p1, p2, base) for linear; (orient, text, center, radius, angle) for diameter\nDIMENSIONS = [\n ('horizontal', '100', (185.6405, 172.05), (68.7659, 172.05), (127.2032, 161.05)),\n ('vertical', '66.3158', (185.6405, 94.5437), (185.6405, 172.05), (174.6405, 133.2969)),\n ('diameter', '%%c33.6842', (127.8183, 133.912), 19.6841, 45),\n ('horizontal', '50.5263', (68.7659, 133.912), (127.8183, 133.912), (98.2921, 144.912)),\n ('vertical', '33.6842', (127.8183, 94.5437), (127.8183, 133.912), (116.8183, 114.2278)),\n ('horizontal', '16.0765', (116.5782, 150.3248), (135.3675, 150.3248), (125.9729, 161.3248)),\n ('vertical', '18.1818', (135.3675, 150.3248), (135.3675, 171.5747), (124.3675, 160.9497)),\n ('horizontal', '40.9091', (68.7659, 94.5437), (116.5782, 94.5437), (92.672, 105.5437)),\n ('vertical', '47.7273', (116.5782, 94.5437), (116.5782, 150.3248), (105.5782, 122.4342)),\n ('radius', 'R15.9636', (125.9729, 134.2053), 18.6574, 45),\n ('horizontal', '16.0766', (116.5782, 94.5437), (135.3675, 94.5437), (125.9729, 105.5437)),\n ('vertical', '18.1818', (135.3675, 94.5437), (135.3675, 115.7936), (124.3675, 105.1687)),\n ('horizontal', '40.9091', (68.7659, 94.5437), (116.5782, 94.5437), (92.672, 105.5437)),\n ('vertical', '0', (116.5782, 94.5437), (116.5782, 94.5437), (116.5782, 94.5437)),\n ('radius', 'R15.9636', (125.9729, 131.9131), 18.6574, 45),\n ('horizontal', '8.6124', (71.4221, 94.5437), (81.4879, 94.5437), (76.455, 105.5437)),\n ('vertical', '68.1818', (81.4879, 94.5437), (81.4879, 174.2309), (70.4879, 134.3873)),\n ('horizontal', '2.2727', (68.7659, 94.5437), (71.4221, 94.5437), (70.094, 105.5437)),\n ('vertical', '0', (71.4221, 94.5437), (71.4221, 94.5437), (71.4221, 94.5437)),\n ('horizontal', '15.9091', (199.6405, 94.5437), (218.2342, 94.5437), (208.9373, 105.5437)),\n ('horizontal', '2.2727', (218.2342, 150.3248), (215.5779, 150.3248), (216.906, 139.3248)),\n ('horizontal', '2.2727', (218.2342, 94.5437), (215.5779, 94.5437), (216.906, 83.5437)),\n ('horizontal', '2.2727', (218.2342, 94.5437), (215.5779, 94.5437), (216.906, 83.5437))\n]\n\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; _ds.dxf.dimasz = 2.5\n _ds.dxf.dimexe = 1.25; _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\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\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,\n angle=(0 if d[0] == \"horizontal\" else 90),\n 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,\n 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,\n 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,\n text=text, dimstyle=\"EZDXF\").render()\n\n doc.saveas(out_path)\n\n\nif __name__ == \"__main__\":\n out = sys.argv[1] if len(sys.argv) > 1 else \"0049_00492790_gt.dxf\"\n draw(out)\n print(\"wrote\", out)\n```"}], "images": ["images/0049_00492790.png"], "id": "0049_00492790"} {"messages": [{"role": "user", "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 66.32 mm tall. It is extruded to a thickness of 16.67 mm. A union feature: The part is a polygonal plate with 4 straight edges. It is extruded to a thickness of -33.33 mm. The outline includes one or more oblique (angled) edges. A cut feature: The part is a circular plate with diameter 33.68 mm. It is extruded to a thickness of -41.67 mm."}, {"role": "assistant", "content": "```python\n#!/usr/bin/env python3\n# -*- coding: utf-8 -*-\n# Ground-truth 2D engineering drawing for part: 0049_00496519\n# Self-contained: reproduces the three-view DXF via ezdxf, NO FreeCAD needed.\n# Coordinates are A4 page millimetres (scale=0.7226517150395771, page=[297.0, 210.0]).\n# visible edges -> solid (layer OUTLINE); hidden edges -> dashed (layer HIDDEN)\n# dimensions -> real movable DIMENSION entities (text = true mm value)\n# Run: python 0049_00496519_gt.py [out.dxf]\nimport sys\nimport ezdxf\nimport math\n\nSCALE = 0.7226517150395771\nPAGE = [297.0, 210.0]\n\nVISIBLE_SEGMENTS = [\n (148.670976, 178.040402, 148.670976, 165.996207),\n (148.670976, 165.996207, 76.405805, 165.996207),\n (76.405805, 178.040402, 76.405805, 165.996207),\n (148.670976, 178.040402, 76.405805, 178.040402),\n (76.405805, 153.825231, 76.405805, 165.996207),\n (136.5, 153.825231, 124.329024, 153.825231),\n (148.670976, 115.863621, 148.670976, 67.940402),\n (76.405805, 115.863621, 148.670976, 115.863621),\n (148.670976, 67.940402, 76.405805, 67.940402),\n (76.405805, 67.940402, 76.405805, 115.863621),\n (162.670976, 153.825231, 162.670976, 178.040402),\n (162.670976, 129.863621, 162.670976, 153.825231),\n (210.594195, 178.040402, 210.594195, 165.996207),\n (210.594195, 178.040402, 162.670976, 178.040402),\n (210.594195, 165.996207, 186.759367, 165.996207),\n (186.759367, 153.825231, 186.759367, 165.996207),\n (186.759367, 129.863621, 186.759367, 153.825231),\n (186.759367, 129.863621, 162.670976, 129.863621),\n (162.670976, 153.825231, 186.759367, 153.825231)\n]\nVISIBLE_CIRCLES = [\n (100.620976, 153.952012, 12.170976)\n]\nVISIBLE_ARCS = [\n (136.5, 165.996207, 12.170976, -90.0, 0.0),\n (100.367414, 153.825231, 23.961609, -180.0, 0.0),\n (100.620976, 153.952012, 12.170976, 0.0, 81.722871)\n]\nHIDDEN_SEGMENTS = [\n (98.8688, 85.7531, 98.8688, 91.7752),\n (98.8688, 85.7531, 102.3731, 85.7531),\n (102.3731, 85.7531, 102.3731, 91.7752),\n (124.329, 115.8636, 124.329, 91.7752),\n (136.5, 91.7752, 124.329, 91.7752),\n (112.792, 115.8636, 112.792, 91.7752),\n (112.792, 91.7752, 88.45, 91.7752),\n (102.3731, 91.7752, 124.329, 91.7752),\n (124.329, 91.7752, 148.671, 91.7752),\n (102.3731, 91.7752, 76.4058, 91.7752),\n (88.45, 91.7752, 88.45, 115.8636),\n (186.7594, 141.781, 162.671, 141.781)\n]\n# (orient, text, p1, p2, base) for linear; (orient, text, center, radius, angle) for diameter\nDIMENSIONS = [\n ('horizontal', '100', (76.4058, 165.9962), (148.671, 165.9962), (112.5384, 176.9962)),\n ('vertical', '16.8421', (148.671, 165.9962), (148.671, 153.8252), (159.671, 159.9107)),\n ('radius', 'R16.8421', (136.5, 165.9962), 12.171, 45),\n ('radius', 'R33.1579', (100.3674, 153.8252), 23.9616, 45),\n ('diameter', '%%c33.6842', (100.621, 153.952), 12.171, 135),\n ('horizontal', '33.5088', (76.4058, 178.0404), (100.621, 178.0404), (88.5134, 189.0404)),\n ('vertical', '16.6667', (162.671, 178.0404), (162.671, 165.9962), (173.671, 172.0183)),\n ('horizontal', '33.3333', (162.671, 165.9962), (186.7593, 165.9962), (174.7152, 176.9962)),\n ('horizontal', '100', (148.671, 67.9404), (76.4058, 67.9404), (112.5384, 56.9404)),\n ('vertical', '66.3158', (148.671, 115.8636), (148.671, 67.9404), (159.671, 91.902))\n]\n\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; _ds.dxf.dimasz = 2.5\n _ds.dxf.dimexe = 1.25; _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\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\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,\n angle=(0 if d[0] == \"horizontal\" else 90),\n 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,\n 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,\n 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,\n text=text, dimstyle=\"EZDXF\").render()\n\n doc.saveas(out_path)\n\n\nif __name__ == \"__main__\":\n out = sys.argv[1] if len(sys.argv) > 1 else \"0049_00496519_gt.dxf\"\n draw(out)\n print(\"wrote\", out)\n```"}], "images": ["images/0049_00496519.png"], "id": "0049_00496519"} {"messages": [{"role": "user", "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 16.16 mm. A union feature: The part is a polygonal plate with 4 straight edges. It is extruded to a thickness of 32.31 mm. The outline includes one or more oblique (angled) edges."}, {"role": "assistant", "content": "```python\n#!/usr/bin/env python3\n# -*- coding: utf-8 -*-\n# Ground-truth 2D engineering drawing for part: 0053_00530978\n# Self-contained: reproduces the three-view DXF via ezdxf, NO FreeCAD needed.\n# Coordinates are A4 page millimetres (scale=0.6472714776632305, page=[297.0, 210.0]).\n# visible edges -> solid (layer OUTLINE); hidden edges -> dashed (layer HIDDEN)\n# dimensions -> real movable DIMENSION entities (text = true mm value)\n# Run: python 0053_00530978_gt.py [out.dxf]\nimport sys\nimport ezdxf\nimport math\n\nSCALE = 0.6472714776632305\nPAGE = [297.0, 210.0]\n\nVISIBLE_SEGMENTS = [\n (125.950649, 129.72417, 143.563478, 129.72417),\n (143.563478, 150.639404, 133.656262, 150.639404),\n (143.563478, 129.72417, 143.563478, 150.639404),\n (134.903837, 104.27583, 134.903837, 93.818213),\n (134.903837, 93.818213, 70.17669, 93.818213),\n (134.903837, 104.27583, 70.17669, 104.27583),\n (143.563478, 93.818213, 134.903837, 93.818213),\n (125.950649, 93.818213, 125.950649, 72.902978),\n (143.563478, 93.818213, 143.563478, 72.902978),\n (143.563478, 72.902978, 133.656262, 72.902978),\n (133.656262, 93.818213, 133.656262, 72.902978),\n (133.656262, 72.902978, 125.950649, 72.902978),\n (70.17669, 93.818213, 70.17669, 104.27583),\n (168.021096, 183.002978, 168.021096, 118.275831),\n (157.563479, 183.002978, 157.563479, 118.275831),\n (168.021096, 129.72417, 188.936331, 129.72417),\n (168.021096, 150.639404, 188.936331, 150.639404),\n (188.936331, 150.639404, 188.936331, 129.72417),\n (168.021096, 183.002978, 157.563479, 183.002978),\n (168.021096, 118.275831, 157.563479, 118.275831)\n]\nVISIBLE_CIRCLES = [\n (102.540263, 150.639404, 32.363574)\n]\nVISIBLE_ARCS = [\n (101.66968, 150.546862, 31.986715, -40.615484, 0.165766)\n]\nHIDDEN_SEGMENTS = [\n\n]\n# (orient, text, p1, p2, base) for linear; (orient, text, center, radius, angle) for diameter\nDIMENSIONS = [\n ('diameter', '%%c100', (102.5402, 150.6394), 32.3636, 45),\n ('horizontal', '27.2109', (125.9506, 129.7242), (143.5635, 129.7242), (134.7571, 140.7242)),\n ('vertical', '32.3129', (143.5635, 129.7242), (143.5635, 150.6394), (132.5635, 140.1818)),\n ('radius', 'R49.4178', (101.6697, 150.5468), 31.9867, 135),\n ('horizontal', '32.3129', (168.0211, 129.7242), (188.9363, 129.7242), (178.4787, 140.7242))\n]\n\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; _ds.dxf.dimasz = 2.5\n _ds.dxf.dimexe = 1.25; _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\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\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,\n angle=(0 if d[0] == \"horizontal\" else 90),\n 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,\n 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,\n 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,\n text=text, dimstyle=\"EZDXF\").render()\n\n doc.saveas(out_path)\n\n\nif __name__ == \"__main__\":\n out = sys.argv[1] if len(sys.argv) > 1 else \"0053_00530978_gt.dxf\"\n draw(out)\n print(\"wrote\", out)\n```"}], "images": ["images/0053_00530978.png"], "id": "0053_00530978"} {"messages": [{"role": "user", "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 85.26 mm tall. It is extruded to a thickness of 11.46 mm. A cut feature: The part is a rectangular plate 28.13 mm wide and 3.85 mm tall. It is extruded to a thickness of -59.38 mm. A cut feature: The part is a rectangular plate 28.95 mm wide and 42.82 mm tall. It is extruded to a thickness of -59.38 mm. A cut feature: The part is a circular plate with diameter 9.47 mm. It is extruded to a thickness of -59.38 mm. A cut feature: The part is a circular plate with diameter 9.28 mm. It is extruded to a thickness of -59.38 mm. A cut feature: The part is a circular plate with diameter 9.47 mm. It is extruded to a thickness of -59.38 mm. A cut feature: The part is a circular plate with diameter 9.28 mm. It is extruded to a thickness of -59.38 mm."}, {"role": "assistant", "content": "```python\n#!/usr/bin/env python3\n# -*- coding: utf-8 -*-\n# Ground-truth 2D engineering drawing for part: 0053_00537709\n# Self-contained: reproduces the three-view DXF via ezdxf, NO FreeCAD needed.\n# Coordinates are A4 page millimetres (scale=0.9895322550224109, page=[297.0, 210.0]).\n# visible edges -> solid (layer OUTLINE); hidden edges -> dashed (layer HIDDEN)\n# dimensions -> real movable DIMENSION entities (text = true mm value)\n# Run: python 0053_00537709_gt.py [out.dxf]\nimport sys\nimport ezdxf\nimport math\n\nSCALE = 0.9895322550224109\nPAGE = [297.0, 210.0]\n\nVISIBLE_SEGMENTS = [\n (180.307418, 87.483881, 180.307418, 171.854526),\n (142.982955, 87.483881, 180.307418, 87.483881),\n (180.307418, 171.854526, 81.354192, 171.854526),\n (81.354192, 171.854526, 81.354192, 87.483881),\n (81.354192, 87.483881, 114.338601, 87.483881),\n (114.338601, 129.853656, 114.338601, 87.483881),\n (142.982955, 87.483881, 142.982955, 129.853656),\n (180.307418, 73.483847, 180.307418, 62.145456),\n (180.307418, 62.145456, 81.354192, 62.145456),\n (81.354192, 73.483847, 81.354192, 62.145456),\n (180.307418, 73.483847, 81.354192, 73.483847),\n (163.813801, 73.483847, 163.813802, 73.483881),\n (194.307435, 171.854526, 205.645825, 171.854526),\n (194.307435, 171.854526, 194.307435, 87.483881),\n (205.645825, 171.854526, 205.645825, 87.483881),\n (194.307435, 87.483881, 205.645825, 87.483881)\n]\nVISIBLE_CIRCLES = [\n (168.224917, 162.843741, 4.688008),\n (92.979219, 162.843759, 4.590341),\n (168.224917, 96.874924, 4.688008),\n (92.979219, 96.874942, 4.590341)\n]\nVISIBLE_ARCS = [\n (128.660778, 129.853656, 14.322177, -0.0, 180.0),\n (92.976958, 96.875777, 4.589358, 89.981399, -89.981399),\n (92.979272, 96.876539, 4.590257, -90.010287, 1.396582),\n (168.222608, 96.875777, 4.687004, 89.981399, -89.981399),\n (168.224971, 96.876555, 4.687922, -90.010287, 1.396581),\n (92.976958, 162.844594, 4.589358, 89.981399, -89.981399),\n (92.979272, 162.845356, 4.590257, -90.010287, 1.396582),\n (168.222608, 162.844594, 4.687004, 89.981399, -89.981399),\n (168.224971, 162.845372, 4.687922, -90.010287, 1.396582),\n (93.255496, 96.875777, 4.589886, 91.738584, -91.738584),\n (168.501209, 96.875777, 4.687543, 91.702741, -91.702741),\n (93.255496, 162.844594, 4.589886, 91.738584, -91.738584),\n (168.501209, 162.844594, 4.687543, 91.702741, -91.702741)\n]\nHIDDEN_SEGMENTS = [\n (142.983, 62.1455, 142.983, 73.4838),\n (114.3386, 62.1455, 114.3386, 73.4838),\n (97.5694, 62.1455, 97.8422, 73.2562),\n (88.3875, 62.1455, 88.6657, 73.4815),\n (172.9128, 62.1455, 173.1855, 73.2538),\n (194.3074, 144.1758, 205.6458, 144.1758),\n (205.6458, 101.4654, 194.4224, 101.4654),\n (205.6458, 92.2862, 194.4224, 92.2862),\n (205.6458, 101.563, 194.4224, 101.563),\n (205.6458, 92.1885, 194.4224, 92.1885),\n (205.6458, 167.4342, 194.4224, 167.4342),\n (205.6458, 158.255, 194.4224, 158.255),\n (205.6458, 167.5319, 194.4224, 167.5319),\n (205.6458, 158.1573, 194.4224, 158.1573)\n]\n# (orient, text, p1, p2, base) for linear; (orient, text, center, radius, angle) for diameter\nDIMENSIONS = [\n ('horizontal', '100', (180.3074, 171.8546), (81.3542, 171.8546), (130.8308, 160.8546)),\n ('vertical', '85.2632', (180.3074, 87.4839), (180.3074, 171.8546), (169.3074, 129.6692)),\n ('horizontal', '4.6354', (114.3386, 83.3608), (142.1692, 83.3608), (128.2539, 94.3608)),\n ('vertical', '4.5219', (142.1692, 83.3608), (142.1692, 87.1692), (131.1692, 85.265)),\n ('vertical', '4.752', (114.3386, 87.4839), (114.3386, 83.3608), (125.3386, 85.4223)),\n ('horizontal', '80.7757', (114.3386, 87.4839), (142.983, 87.4839), (128.6608, 98.4839)),\n ('vertical', '9.4737', (142.983, 87.4839), (142.983, 129.8537), (131.983, 108.6688)),\n ('horizontal', '76.0417', (81.3542, 87.4839), (114.3386, 87.4839), (97.8464, 98.4839)),\n ('radius', 'R14.4737', (128.6608, 129.8537), 14.3222, 45),\n ('diameter', '%%c9.4737', (168.4996, 162.8446), 4.6873, 45),\n ('horizontal', '76.0417', (81.3542, 87.4839), (168.4996, 87.4839), (124.9269, 98.4839)),\n ('diameter', '%%c9.2763', (93.254, 162.8446), 4.5896, 45),\n ('diameter', '%%c9.4737', (168.4996, 96.8757), 4.6873, 45),\n ('diameter', '%%c9.2763', (93.254, 96.8757), 4.5896, 45),\n ('horizontal', '11.4583', (194.112, 87.4839), (205.4503, 87.4839), (199.7811, 98.4839)),\n ('horizontal', '0.1138', (194.227, 162.8446), (252.9627, 162.8446), (223.5948, 173.8446)),\n ('horizontal', '0.1162', (194.227, 162.8446), (252.9627, 162.8446), (223.5948, 183.8446)),\n ('horizontal', '0.1162', (194.227, 96.8757), (252.9627, 96.8757), (223.5948, 127.8757)),\n ('horizontal', '0.1162', (194.227, 96.8757), (252.9627, 96.8757), (223.5948, 137.8757))\n]\n\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; _ds.dxf.dimasz = 2.5\n _ds.dxf.dimexe = 1.25; _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\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\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,\n angle=(0 if d[0] == \"horizontal\" else 90),\n 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,\n 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,\n 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,\n text=text, dimstyle=\"EZDXF\").render()\n\n doc.saveas(out_path)\n\n\nif __name__ == \"__main__\":\n out = sys.argv[1] if len(sys.argv) > 1 else \"0053_00537709_gt.dxf\"\n draw(out)\n print(\"wrote\", out)\n```"}], "images": ["images/0053_00537709.png"], "id": "0053_00537709"} {"messages": [{"role": "user", "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 4.98 mm. The outline includes one or more oblique (angled) edges. A union feature: The part is a rectangular plate 74.73 mm wide and 12.59 mm tall. It is extruded to a thickness of 4.98 mm."}, {"role": "assistant", "content": "```python\n#!/usr/bin/env python3\n# -*- coding: utf-8 -*-\n# Ground-truth 2D engineering drawing for part: 0054_00548329\n# Self-contained: reproduces the three-view DXF via ezdxf, NO FreeCAD needed.\n# Coordinates are A4 page millimetres (scale=0.47720810420013643, page=[297.0, 210.0]).\n# visible edges -> solid (layer OUTLINE); hidden edges -> dashed (layer HIDDEN)\n# dimensions -> real movable DIMENSION entities (text = true mm value)\n# Run: python 0054_00548329_gt.py [out.dxf]\nimport sys\nimport ezdxf\nimport math\n\nSCALE = 0.47720810420013643\nPAGE = [297.0, 210.0]\n\nVISIBLE_SEGMENTS = [\n (82.114819, 121.652639, 114.805365, 121.652639),\n (147.089234, 124.65579, 146.338447, 123.154215),\n (146.338447, 123.154215, 186.130193, 113.393975),\n (186.130193, 113.393975, 186.130193, 109.640037),\n (186.130193, 109.640037, 139.581358, 120.151064),\n (139.581358, 120.151064, 139.581358, 123.154215),\n (139.581358, 123.154215, 146.338447, 133.665242),\n (117.808515, 123.154215, 117.808515, 121.652639),\n (117.808515, 121.652639, 117.777233, 121.652639),\n (117.777233, 121.652639, 117.777233, 115.646338),\n (117.777233, 115.646338, 82.114819, 115.646338),\n (82.114819, 115.646338, 82.114819, 121.652639),\n (110.807757, 90.885048, 149.185118, 90.885048),\n (110.807757, 95.640036, 149.185118, 95.640036),\n (82.114819, 90.885048, 110.807757, 90.885048),\n (82.114819, 95.640036, 82.114819, 90.885048),\n (110.807757, 95.640036, 82.114819, 95.640036),\n (149.185118, 95.640036, 186.130193, 95.640036),\n (149.185118, 90.885048, 186.130193, 90.885048),\n (186.130193, 90.885048, 186.130193, 95.640036),\n (110.807757, 95.640036, 110.807757, 90.885048),\n (149.185118, 95.640036, 149.185118, 90.885048),\n (204.885181, 121.652639, 204.885181, 152.564662),\n (200.130193, 121.652639, 200.130193, 152.564662),\n (200.130193, 121.652639, 204.885181, 121.652639),\n (200.130193, 109.640037, 200.130193, 115.646338),\n (200.130193, 115.646338, 200.130193, 121.652639),\n (204.885181, 109.640037, 204.885181, 115.646338),\n (204.885181, 115.646338, 204.885181, 121.652639),\n (200.130193, 115.646338, 204.885181, 115.646338),\n (204.885181, 109.640037, 200.130193, 109.640037),\n (200.130193, 152.564662, 204.885181, 152.564662)\n]\nVISIBLE_CIRCLES = [\n\n]\nVISIBLE_ARCS = [\n (129.996437, 133.375982, 19.18868, -27.029204, -142.341704),\n (130.119952, 133.712165, 16.218563, -0.165766, -139.384516)\n]\nHIDDEN_SEGMENTS = [\n (114.8054, 95.64, 114.8054, 90.885),\n (146.3384, 90.885, 146.3384, 95.64),\n (139.5814, 90.885, 139.5814, 95.64),\n (117.8085, 95.64, 117.8085, 90.885),\n (117.7772, 90.885, 117.7772, 95.64),\n (113.9014, 95.64, 113.9014, 90.885),\n (146.3385, 95.64, 146.3385, 90.885),\n (204.8852, 123.1542, 200.1302, 123.1542),\n (204.8852, 113.394, 200.1302, 113.394),\n (204.8852, 120.1511, 200.1302, 120.1511),\n (204.8852, 133.6652, 200.1302, 133.6652),\n (200.1302, 149.9307, 204.8852, 149.9307)\n]\n# (orient, text, p1, p2, base) for linear; (orient, text, center, radius, angle) for diameter\nDIMENSIONS = [\n ('horizontal', '6.2932', (117.8085, 121.6527), (114.8054, 121.6527), (116.3069, 110.6527)),\n ('vertical', '3.1466', (117.8085, 123.1542), (117.8085, 121.6527), (128.8085, 122.4034)),\n ('vertical', '6.2932', (139.5814, 120.1511), (139.5814, 123.1542), (128.5814, 121.6526)),\n ('vertical', '7.8665', (186.1302, 113.394), (186.1302, 109.64), (197.1302, 111.517)),\n ('aligned', '3.518', (147.0892, 124.6558), (146.3384, 123.1542), (156.5525, 118.9856)),\n ('aligned', '85.8562', (146.3384, 123.1542), (186.1302, 113.394), (168.8547, 128.9574)),\n ('aligned', '100', (186.1302, 109.64), (139.5814, 120.1511), (160.4329, 104.1657)),\n ('aligned', '26.1848', (139.5814, 123.1542), (146.3384, 133.6652), (133.7069, 134.358)),\n ('radius', 'R40.2103', (129.9964, 133.376), 19.1887, 45),\n ('radius', 'R33.9864', (130.1199, 133.7122), 16.2186, 135),\n ('horizontal', '74.7314', (82.1148, 121.6527), (117.7772, 121.6527), (99.946, 132.6527)),\n ('vertical', '12.5863', (117.7772, 121.6527), (117.7772, 115.6463), (128.7772, 118.6495)),\n ('horizontal', '68.5038', (114.8054, 133.6652), (82.1148, 133.6652), (98.4601, 122.6652)),\n ('vertical', '25.1726', (82.1148, 133.6652), (82.1148, 121.6527), (93.1148, 127.6589)),\n ('horizontal', '9.9642', (204.8852, 121.6527), (200.1302, 121.6527), (202.5077, 110.6527)),\n ('horizontal', '9.9642', (204.8852, 121.6527), (200.1302, 121.6527), (202.5077, 110.6527))\n]\n\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; _ds.dxf.dimasz = 2.5\n _ds.dxf.dimexe = 1.25; _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\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\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,\n angle=(0 if d[0] == \"horizontal\" else 90),\n 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,\n 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,\n 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,\n text=text, dimstyle=\"EZDXF\").render()\n\n doc.saveas(out_path)\n\n\nif __name__ == \"__main__\":\n out = sys.argv[1] if len(sys.argv) > 1 else \"0054_00548329_gt.dxf\"\n draw(out)\n print(\"wrote\", out)\n```"}], "images": ["images/0054_00548329.png"], "id": "0054_00548329"} {"messages": [{"role": "user", "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 80 mm bounding box. It is extruded to a thickness of 20.29 mm. A union feature: The part is a polygonal plate with 2 straight edges. It is extruded to a thickness of 20.29 mm."}, {"role": "assistant", "content": "```python\n#!/usr/bin/env python3\n# -*- coding: utf-8 -*-\n# Ground-truth 2D engineering drawing for part: 0059_00593855\n# Self-contained: reproduces the three-view DXF via ezdxf, NO FreeCAD needed.\n# Coordinates are A4 page millimetres (scale=0.7969831730769597, page=[297.0, 210.0]).\n# visible edges -> solid (layer OUTLINE); hidden edges -> dashed (layer HIDDEN)\n# dimensions -> real movable DIMENSION entities (text = true mm value)\n# Run: python 0059_00593855_gt.py [out.dxf]\nimport sys\nimport ezdxf\nimport math\n\nSCALE = 0.7969831730769597\nPAGE = [297.0, 210.0]\n\nVISIBLE_SEGMENTS = [\n (136.355619, 128.352708, 136.355619, 128.425658),\n (136.355619, 128.425658, 88.536629, 128.425658),\n (88.536629, 151.915688, 136.355619, 151.915688),\n (136.355619, 151.915688, 136.355619, 151.757629),\n (136.355619, 171.81899, 136.355619, 172.05),\n (136.355619, 172.05, 56.657302, 172.05),\n (56.657302, 172.05, 56.657302, 108.291346),\n (56.657302, 108.291346, 136.355619, 108.291346),\n (136.355619, 94.291346, 56.657302, 94.291346),\n (168.119441, 94.291346, 136.355619, 94.291346),\n (136.355619, 61.95, 56.657302, 61.95),\n (168.119441, 61.95, 136.355619, 61.95),\n (136.355619, 94.291346, 136.355619, 61.95),\n (56.657302, 61.95, 56.657302, 94.291346),\n (168.119441, 61.95, 168.119441, 94.291346),\n (182.119441, 172.05, 182.119441, 108.291346),\n (214.460787, 172.05, 214.460787, 108.291346),\n (214.460787, 172.05, 182.119441, 172.05),\n (214.460787, 108.291346, 182.119441, 108.291346)\n]\nVISIBLE_CIRCLES = [\n\n]\nVISIBLE_ARCS = [\n (136.355619, 140.055168, 11.702461, -90.0, 90.0),\n (88.536629, 140.170673, 11.745015, 90.0, -90.0),\n (136.355619, 140.055168, 31.763822, -90.0, 90.0)\n]\nHIDDEN_SEGMENTS = [\n (148.0581, 61.95, 148.0581, 94.2913),\n (76.7916, 61.95, 76.7916, 94.2913),\n (214.4608, 128.3527, 182.1194, 128.3527),\n (182.1194, 128.4257, 214.4608, 128.4257),\n (182.1194, 151.7576, 214.4608, 151.7576),\n (182.1194, 151.9157, 214.4608, 151.9157)\n]\n# (orient, text, p1, p2, base) for linear; (orient, text, center, radius, angle) for diameter\nDIMENSIONS = [\n ('horizontal', '60', (136.3556, 128.4256), (88.5366, 128.4256), (112.4461, 117.4256)),\n ('horizontal', '100', (136.3556, 172.05), (56.6573, 172.05), (96.5065, 161.05)),\n ('vertical', '25.2632', (136.3556, 108.2914), (136.3556, 128.4256), (125.3556, 118.3585)),\n ('vertical', '29.4737', (88.5366, 128.4256), (88.5366, 151.9157), (77.5366, 140.1707)),\n ('vertical', '80', (56.6573, 172.05), (56.6573, 108.2914), (67.6573, 140.1707)),\n ('radius', 'R14.7368', (88.5366, 140.1707), 11.745, 45),\n ('radius', 'R39.8551', (136.3556, 140.0551), 31.7638, 45),\n ('radius', 'R14.6834', (136.3556, 140.0551), 11.7024, 135),\n ('horizontal', '40.5797', (182.1194, 108.2914), (214.4608, 108.2914), (198.2901, 119.2914)),\n ('horizontal', '40.5797', (182.1194, 108.2914), (214.4608, 108.2914), (198.2901, 119.2914))\n]\n\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; _ds.dxf.dimasz = 2.5\n _ds.dxf.dimexe = 1.25; _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\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\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,\n angle=(0 if d[0] == \"horizontal\" else 90),\n 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,\n 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,\n 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,\n text=text, dimstyle=\"EZDXF\").render()\n\n doc.saveas(out_path)\n\n\nif __name__ == \"__main__\":\n out = sys.argv[1] if len(sys.argv) > 1 else \"0059_00593855_gt.dxf\"\n draw(out)\n print(\"wrote\", out)\n```"}], "images": ["images/0059_00593855.png"], "id": "0059_00593855"} {"messages": [{"role": "user", "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 17.68 mm. The outline includes one or more oblique (angled) edges. A union feature: The part is a circular plate with diameter 82.47 mm, featuring a circular hole of diameter 63.57 mm. It is extruded to a thickness of 17.68 mm. A union feature: The part is a circular plate with diameter 82.47 mm, featuring a circular hole of diameter 63.57 mm. It is extruded to a thickness of 17.68 mm. A union feature: The part is a polygonal plate with 4 straight edges. It is extruded to a thickness of 17.68 mm. The outline includes one or more oblique (angled) edges. A union feature: The part is a circular plate with diameter 82.47 mm, featuring a circular hole of diameter 63.57 mm. It is extruded to a thickness of 17.68 mm."}, {"role": "assistant", "content": "```python\n#!/usr/bin/env python3\n# -*- coding: utf-8 -*-\n# Ground-truth 2D engineering drawing for part: 0059_00594733\n# Self-contained: reproduces the three-view DXF via ezdxf, NO FreeCAD needed.\n# Coordinates are A4 page millimetres (scale=0.3435874405077057, page=[297.0, 210.0]).\n# visible edges -> solid (layer OUTLINE); hidden edges -> dashed (layer HIDDEN)\n# dimensions -> real movable DIMENSION entities (text = true mm value)\n# Run: python 0059_00594733_gt.py [out.dxf]\nimport sys\nimport ezdxf\nimport math\n\nSCALE = 0.3435874405077057\nPAGE = [297.0, 210.0]\n\nVISIBLE_SEGMENTS = [\n (111.172717, 68.307505, 116.621512, 68.307505),\n (116.621512, 68.307505, 144.720054, 68.307505),\n (144.720054, 68.307505, 148.957577, 68.307505),\n (148.957577, 68.307505, 150.337084, 68.307505),\n (148.957577, 74.382934, 150.337084, 74.382934),\n (144.720054, 74.382934, 148.957577, 74.382934),\n (144.720054, 74.382934, 144.720054, 68.307505),\n (116.621512, 68.307505, 116.621512, 74.382934),\n (111.172717, 74.382934, 116.621512, 74.382934),\n (116.621512, 74.382934, 144.720054, 74.382934),\n (150.337084, 74.382934, 150.337084, 68.307505),\n (148.957577, 74.382934, 148.957577, 68.307505),\n (111.172717, 74.382934, 111.172717, 68.307505),\n (170.412513, 133.39522, 170.412513, 165.715517),\n (170.412513, 165.715517, 170.412513, 178.407505),\n (170.412513, 102.226057, 170.412513, 88.382934),\n (170.412513, 102.226057, 170.412513, 133.39522),\n (170.412513, 133.39522, 164.337085, 133.39522),\n (164.337085, 102.226057, 164.337085, 133.39522),\n (170.412513, 102.226057, 164.337085, 102.226057),\n (164.337085, 88.382934, 164.337085, 102.226057),\n (170.412513, 165.715517, 164.337085, 165.715517),\n (164.337085, 133.39522, 164.337085, 165.715517),\n (164.337085, 165.715517, 164.337085, 178.407505),\n (164.337085, 88.382934, 170.412513, 88.382934),\n (164.337085, 178.407505, 170.412513, 178.407505)\n]\nVISIBLE_CIRCLES = [\n (130.789314, 102.550735, 10.921014),\n (130.789314, 133.39522, 10.921014),\n (130.789314, 164.239704, 10.921014),\n (130.789314, 102.550735, 14.167801),\n (130.789314, 133.39522, 14.167801),\n (130.591872, 164.388696, 14.033225)\n]\nVISIBLE_ARCS = [\n (130.62663, 133.477971, 14.005362, 125.740184, -179.661465),\n (137.861162, 149.555368, 26.688446, 142.734375, -142.734375),\n (130.789314, 164.239704, 14.167801, 10.495995, -160.420669),\n (121.162856, 152.069169, 27.794721, -32.90436, 32.054659),\n (130.789314, 133.39522, 14.167801, 10.488132, 14.614722),\n (122.413661, 119.177586, 27.923423, -36.16669, 36.979164),\n (130.612216, 102.226057, 13.990704, 179.337252, -180.0),\n (145.778213, 117.810638, 33.060436, 151.875, -151.875)\n]\nHIDDEN_SEGMENTS = [\n (117.4407, 74.3829, 117.4407, 68.3075),\n (122.4459, 74.3829, 122.4459, 68.3075),\n (141.7103, 68.3075, 141.7103, 74.3829),\n (112.7178, 74.3829, 112.7178, 68.3075),\n (119.8683, 74.3829, 119.8683, 68.3075),\n (164.3371, 135.9742, 170.4125, 135.9742),\n (164.3371, 136.97, 170.4125, 136.97),\n (164.3371, 166.8206, 170.4125, 166.8206),\n (164.3371, 159.4919, 170.4125, 159.4919),\n (164.3371, 144.8458, 170.4125, 144.8458),\n (164.3371, 91.6297, 170.4125, 91.6297),\n (164.3371, 113.4717, 170.4125, 113.4717),\n (164.3371, 122.4742, 170.4125, 122.4742),\n (164.3371, 144.3162, 170.4125, 144.3162),\n (164.3371, 153.3187, 170.4125, 153.3187),\n (164.3371, 175.1607, 170.4125, 175.1607)\n]\n# (orient, text, p1, p2, base) for linear; (orient, text, center, radius, angle) for diameter\nDIMENSIONS = [\n ('vertical', '90.7168', (116.6215, 102.2261), (116.6215, 133.3952), (105.6215, 117.8106)),\n ('radius', 'R40.7189', (130.6119, 133.4572), 13.9905, 45),\n ('radius', 'R81.2702', (122.4137, 119.1776), 27.9234, 45),\n ('radius', 'R96.2213', (145.7782, 117.8106), 33.0604, 45),\n ('diameter', '%%c82.4698', (130.7893, 102.5507), 14.1678, 45),\n ('diameter', '%%c63.5705', (130.7893, 102.5507), 10.921, 135),\n ('diameter', '%%c82.4698', (130.7893, 133.3952), 14.1678, 135),\n ('diameter', '%%c63.5705', (130.7893, 133.3952), 10.921, 225),\n ('horizontal', '80.4797', (116.6215, 167.5111), (144.2733, 167.5111), (130.4474, 178.5111)),\n ('vertical', '99.2931', (144.2733, 167.5111), (144.2733, 133.3952), (155.2733, 150.4532)),\n ('vertical', '0', (116.6215, 136.583), (116.6215, 136.583), (116.6215, 136.583)),\n ('vertical', '90.0152', (116.6215, 136.583), (116.6215, 167.5111), (105.6215, 152.047)),\n ('radius', 'R77.6758', (137.8612, 149.5554), 26.6884, 45),\n ('radius', 'R40.8432', (130.5919, 164.3887), 14.0332, 45),\n ('radius', 'R80.8956', (121.1628, 152.0692), 27.7947, 45),\n ('radius', 'R40.7621', (130.6266, 133.478), 14.0053, 315),\n ('diameter', '%%c82.4698', (130.7893, 164.2397), 14.1678, 135),\n ('diameter', '%%c63.5705', (130.7893, 164.2397), 10.921, 225),\n ('horizontal', '17.6823', (170.4125, 133.3952), (164.3371, 133.3952), (167.3748, 122.3952)),\n ('horizontal', '17.6823', (170.4125, 133.3952), (164.3371, 133.3952), (167.3748, 122.3952)),\n ('horizontal', '17.6823', (170.4125, 164.2397), (164.3371, 164.2397), (167.3748, 133.2397))\n]\n\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; _ds.dxf.dimasz = 2.5\n _ds.dxf.dimexe = 1.25; _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\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\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,\n angle=(0 if d[0] == \"horizontal\" else 90),\n 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,\n 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,\n 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,\n text=text, dimstyle=\"EZDXF\").render()\n\n doc.saveas(out_path)\n\n\nif __name__ == \"__main__\":\n out = sys.argv[1] if len(sys.argv) > 1 else \"0059_00594733_gt.dxf\"\n draw(out)\n print(\"wrote\", out)\n```"}], "images": ["images/0059_00594733.png"], "id": "0059_00594733"} {"messages": [{"role": "user", "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 1.05 mm. It is extruded to a thickness of 7.29 mm. A union feature: The part is a circular plate with diameter 1.03 mm. It is extruded to a thickness of 7.29 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."}, {"role": "assistant", "content": "```python\n#!/usr/bin/env python3\n# -*- coding: utf-8 -*-\n# Ground-truth 2D engineering drawing for part: 0059_00594997\n# Self-contained: reproduces the three-view DXF via ezdxf, NO FreeCAD needed.\n# Coordinates are A4 page millimetres (scale=1.431723076923055, page=[297.0, 210.0]).\n# visible edges -> solid (layer OUTLINE); hidden edges -> dashed (layer HIDDEN)\n# dimensions -> real movable DIMENSION entities (text = true mm value)\n# Run: python 0059_00594997_gt.py [out.dxf]\nimport sys\nimport ezdxf\nimport math\n\nSCALE = 1.431723076923055\nPAGE = [297.0, 210.0]\n\nVISIBLE_SEGMENTS = [\n (60.82433, 129.784978, 201.013881, 129.784978),\n (202.489561, 128.277901, 59.317253, 128.277901),\n (59.317253, 103.838253, 60.82433, 103.838253),\n (60.82433, 103.838253, 201.013881, 103.838253),\n (201.013881, 103.838253, 202.489561, 103.838253),\n (202.489561, 103.838253, 203.243099, 103.838253),\n (58.563715, 103.838253, 59.317253, 103.838253),\n (59.317253, 114.277901, 60.82433, 114.277901),\n (59.317253, 103.838253, 59.317253, 114.277901),\n (60.82433, 103.838253, 60.82433, 114.277901),\n (60.82433, 114.277901, 201.013881, 114.277901),\n (201.013881, 114.277901, 201.013881, 103.838253),\n (58.563715, 114.277901, 59.317253, 114.277901),\n (202.489561, 114.277901, 203.243099, 114.277901),\n (202.489561, 103.838253, 202.489561, 114.277901),\n (201.013881, 114.277901, 202.489561, 114.277901),\n (58.563715, 114.277901, 58.563715, 103.838253),\n (203.243099, 114.277901, 203.243099, 103.838253),\n (227.682747, 129.784978, 227.682747, 130.538516),\n (227.682747, 128.277901, 227.682747, 129.784978),\n (217.243099, 129.784978, 217.243099, 130.538516),\n (227.682747, 129.784978, 217.243099, 129.784978),\n (217.243099, 128.277901, 217.243099, 129.784978),\n (227.682747, 128.277901, 217.243099, 128.277901),\n (217.243099, 130.538516, 227.682747, 130.538516)\n]\nVISIBLE_CIRCLES = [\n (60.070792, 129.784978, 0.753538),\n (201.751721, 129.784978, 0.73784)\n]\nVISIBLE_ARCS = [\n (202.489561, 129.031439, 0.753538, -90.0, 90.0),\n (59.317253, 129.031439, 0.753538, 90.0, -90.0)\n]\nHIDDEN_SEGMENTS = [\n\n]\n# (orient, text, p1, p2, base) for linear; (orient, text, center, radius, angle) for diameter\nDIMENSIONS = [\n ('diameter', '%%c1.0526', (60.0708, 129.785), 0.7535, 45),\n ('diameter', '%%c1.0307', (201.7517, 129.785), 0.7378, 45),\n ('horizontal', '100', (59.3173, 129.785), (202.4896, 129.785), (130.9034, 140.785)),\n ('vertical', '1.0526', (202.4896, 129.785), (202.4896, 128.2779), (213.4896, 129.0315)),\n ('radius', 'R0.5263', (202.4896, 129.0315), 0.7535, 135),\n ('horizontal', '7.2917', (227.6827, 129.785), (217.2431, 129.785), (222.4629, 118.785)),\n ('horizontal', '7.2917', (227.6827, 129.785), (217.2431, 129.785), (222.4629, 108.785)),\n ('horizontal', '7.2917', (227.6827, 129.785), (217.2431, 129.785), (222.4629, 118.785))\n]\n\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; _ds.dxf.dimasz = 2.5\n _ds.dxf.dimexe = 1.25; _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\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\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,\n angle=(0 if d[0] == \"horizontal\" else 90),\n 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,\n 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,\n 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,\n text=text, dimstyle=\"EZDXF\").render()\n\n doc.saveas(out_path)\n\n\nif __name__ == \"__main__\":\n out = sys.argv[1] if len(sys.argv) > 1 else \"0059_00594997_gt.dxf\"\n draw(out)\n print(\"wrote\", out)\n```"}], "images": ["images/0059_00594997.png"], "id": "0059_00594997"} {"messages": [{"role": "user", "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 -46.24 mm. The outline includes one or more oblique (angled) edges. A cut feature: The part is a rectangular plate 100 mm wide and 42.11 mm tall. It is extruded to a thickness of -2.15 mm. A cut feature: The part is a rectangular plate 97.31 mm wide and 39.95 mm tall. It is extruded to a thickness of -43.55 mm. A cut feature: The part is a rectangular plate 3.41 mm wide and 7.53 mm tall. It is extruded to a thickness of -20.43 mm. A cut feature: The part is a rectangular plate 44.62 mm wide and 4.7 mm tall. It is extruded to a thickness of -20.43 mm."}, {"role": "assistant", "content": "```python\n#!/usr/bin/env python3\n# -*- coding: utf-8 -*-\n# Ground-truth 2D engineering drawing for part: 0060_00601387\n# Self-contained: reproduces the three-view DXF via ezdxf, NO FreeCAD needed.\n# Coordinates are A4 page millimetres (scale=0.6455622718978584, page=[297.0, 210.0]).\n# visible edges -> solid (layer OUTLINE); hidden edges -> dashed (layer HIDDEN)\n# dimensions -> real movable DIMENSION entities (text = true mm value)\n# Run: python 0060_00601387_gt.py [out.dxf]\nimport sys\nimport ezdxf\nimport math\n\nSCALE = 0.6455622718978584\nPAGE = [297.0, 210.0]\n\nVISIBLE_SEGMENTS = [\n (88.256368, 150.849107, 88.256368, 126.999472),\n (91.062207, 124.193632, 152.089214, 124.193632),\n (154.895054, 126.999472, 154.895054, 150.849107),\n (152.089214, 153.654946, 91.062207, 153.654946),\n (88.256368, 80.345054, 88.256368, 110.193632),\n (154.895054, 80.345054, 152.089214, 80.345054),\n (152.089214, 80.345054, 91.062207, 80.345054),\n (91.062207, 80.345054, 88.256368, 80.345054),\n (154.895054, 110.193632, 152.089214, 110.193632),\n (152.089214, 110.193632, 91.062207, 110.193632),\n (91.062207, 110.193632, 88.256368, 110.193632),\n (154.895054, 80.345054, 154.895054, 110.193632),\n (91.062207, 80.345054, 91.062207, 110.193632),\n (152.089214, 80.345054, 152.089214, 110.193632),\n (168.895054, 126.999472, 168.895054, 124.193632),\n (198.743632, 124.193632, 168.895054, 124.193632),\n (198.743632, 126.999472, 198.743632, 124.193632),\n (168.895054, 150.849107, 168.895054, 126.999472),\n (198.743632, 150.849107, 198.743632, 126.999472),\n (198.743632, 153.654946, 198.743632, 150.849107),\n (168.895054, 153.654946, 168.895054, 150.849107),\n (198.743632, 153.654946, 168.895054, 153.654946),\n (198.743632, 126.999472, 168.895054, 126.999472),\n (198.743632, 150.849107, 168.895054, 150.849107)\n]\nVISIBLE_CIRCLES = [\n\n]\nVISIBLE_ARCS = [\n (91.062207, 126.999472, 2.805839, -180.0, -90.0),\n (152.089214, 126.999472, 2.805839, -90.0, -0.0),\n (152.089214, 150.849107, 2.805839, 0.0, 90.0),\n (91.062207, 150.849107, 2.805839, 90.0, 180.0)\n]\nHIDDEN_SEGMENTS = [\n (152.8126, 126.3053, 152.8126, 146.7828),\n (89.9918, 126.3053, 152.8126, 126.3053),\n (89.9918, 152.0949, 89.9918, 126.3053),\n (152.8126, 152.0949, 89.9918, 152.0949),\n (152.8126, 149.8152, 152.8126, 152.0949),\n (154.8951, 149.8152, 141.7061, 149.8152),\n (154.8951, 146.7828, 141.7061, 146.7828),\n (141.7061, 149.8152, 141.7061, 146.7828),\n (123.7121, 124.6239, 123.7121, 137.8088),\n (123.7121, 137.8088, 118.8545, 137.8118),\n (118.8545, 124.6268, 118.8545, 137.8118),\n (123.6582, 124.5699, 123.6582, 137.7549),\n (123.6582, 137.7549, 123.7121, 137.8088),\n (118.8545, 137.8118, 118.8006, 137.7578),\n (118.8006, 124.5729, 118.8006, 137.7578),\n (118.8006, 137.7578, 123.6582, 137.7549),\n (152.8126, 110.1936, 152.8126, 108.8053),\n (141.7061, 108.8053, 141.7061, 81.3863),\n (154.8951, 81.3863, 141.7061, 81.3863),\n (152.8126, 108.8053, 89.9918, 108.8053),\n (89.9918, 108.8053, 89.9918, 110.1936),\n (123.7121, 94.4596, 123.7121, 94.7833),\n (123.7121, 94.7833, 118.8545, 94.6641),\n (118.8545, 94.3404, 118.8545, 94.6641),\n (123.7121, 94.4596, 118.8545, 94.3404),\n (123.6582, 96.6576, 123.6582, 96.9813),\n (123.6582, 96.9813, 123.7121, 94.7833),\n (123.6582, 96.6576, 123.7121, 94.4596),\n (118.8545, 94.6641, 118.8006, 96.8621),\n (118.8006, 96.5384, 118.8006, 96.8621),\n (118.8545, 94.3404, 118.8006, 96.5384),\n (118.8006, 96.5384, 123.6582, 96.6576),\n (118.8006, 96.8621, 123.6582, 96.9813),\n (197.7024, 146.7828, 168.8951, 146.7828),\n (197.7024, 149.8152, 197.7024, 146.7828),\n (168.8951, 149.8152, 197.7024, 149.8152),\n (170.2834, 152.0949, 168.8951, 152.0949),\n (170.2834, 152.0949, 170.2834, 126.3053),\n (170.2834, 126.3053, 168.8951, 126.3053),\n (184.6291, 124.6239, 184.3054, 137.8088),\n (184.7483, 124.6268, 184.4246, 137.8118),\n (182.431, 124.5699, 182.1074, 137.7549),\n (182.5502, 124.5729, 182.2266, 137.7578),\n (182.2266, 137.7578, 182.1074, 137.7549),\n (182.1074, 137.7549, 182.2266, 137.7578),\n (182.2266, 137.7578, 184.3054, 137.8088),\n (184.4246, 137.8118, 184.3054, 137.8088)\n]\n# (orient, text, p1, p2, base) for linear; (orient, text, center, radius, angle) for diameter\nDIMENSIONS = [\n ('horizontal', '94.5331', (91.0622, 124.1936), (152.0892, 124.1936), (121.5757, 135.1936)),\n ('vertical', '36.944', (154.8951, 126.9995), (154.8951, 150.8491), (143.8951, 138.9243)),\n ('radius', 'R4.3463', (91.0622, 126.9995), 2.8058, 45),\n ('horizontal', '3.2258', (89.2976, 125.6112), (153.8538, 125.6112), (121.5757, 136.6112)),\n ('vertical', '31.7204', (153.8538, 125.6112), (153.8538, 152.7927), (142.8538, 139.202)),\n ('horizontal', '97.3118', (88.2564, 124.1936), (89.2976, 124.1936), (88.777, 135.1936)),\n ('vertical', '20.424', (152.8126, 126.3053), (152.8126, 152.0949), (141.8126, 139.2001)),\n ('vertical', '20.424', (89.9918, 124.1936), (89.9918, 126.3053), (78.9918, 125.2495)),\n ('horizontal', '46.2366', (198.7436, 126.9995), (168.895, 126.9995), (183.8193, 115.9995)),\n ('vertical', '20.4301', (184.6291, 124.6239), (184.3054, 137.8088), (173.4705, 130.9464)),\n ('horizontal', '44.6237', (197.7024, 146.7829), (168.895, 146.7829), (183.2987, 135.7829)),\n ('vertical', '44.6237', (123.6582, 96.6576), (123.7121, 94.4596), (134.6818, 95.8286)),\n ('horizontal', '17.2043', (123.7121, 94.4596), (118.8545, 94.3404), (121.5533, 83.4033))\n]\n\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; _ds.dxf.dimasz = 2.5\n _ds.dxf.dimexe = 1.25; _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\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\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,\n angle=(0 if d[0] == \"horizontal\" else 90),\n 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,\n 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,\n 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,\n text=text, dimstyle=\"EZDXF\").render()\n\n doc.saveas(out_path)\n\n\nif __name__ == \"__main__\":\n out = sys.argv[1] if len(sys.argv) > 1 else \"0060_00601387_gt.dxf\"\n draw(out)\n print(\"wrote\", out)\n```"}], "images": ["images/0060_00601387.png"], "id": "0060_00601387"} {"messages": [{"role": "user", "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 58.9 mm tall, featuring a circular hole of diameter 41.1 mm. It is extruded to a thickness of 31.23 mm. A union feature: The part is a rectangular plate 99.73 mm wide and 69.81 mm tall, featuring a rectangular cutout 99.73 x 59.84 mm. It is extruded to a thickness of 5.21 mm."}, {"role": "assistant", "content": "```python\n#!/usr/bin/env python3\n# -*- coding: utf-8 -*-\n# Ground-truth 2D engineering drawing for part: 0063_00631233\n# Self-contained: reproduces the three-view DXF via ezdxf, NO FreeCAD needed.\n# Coordinates are A4 page millimetres (scale=0.7318927401747464, page=[297.0, 210.0]).\n# visible edges -> solid (layer OUTLINE); hidden edges -> dashed (layer HIDDEN)\n# dimensions -> real movable DIMENSION entities (text = true mm value)\n# Run: python 0063_00631233_gt.py [out.dxf]\nimport sys\nimport ezdxf\nimport math\n\nSCALE = 0.7318927401747464\nPAGE = [297.0, 210.0]\n\nVISIBLE_SEGMENTS = [\n (85.889531, 109.883494, 158.878287, 109.883494),\n (158.878287, 160.975622, 85.889531, 160.975622),\n (158.878287, 157.847533, 85.889531, 157.847533),\n (159.078805, 156.804836, 85.889531, 156.804836),\n (85.889531, 113.693346, 159.078805, 113.693346),\n (184.424351, 95.883493, 158.878287, 95.883493),\n (158.878287, 95.883493, 85.889531, 95.883493),\n (85.889531, 95.883493, 60.343467, 95.883493),\n (184.424351, 92.073641, 158.878287, 92.073641),\n (158.878287, 92.073641, 85.889531, 92.073641),\n (85.889531, 92.073641, 60.343467, 92.073641),\n (85.889531, 73.024378, 64.333786, 73.024378),\n (159.078805, 73.024378, 85.889531, 73.024378),\n (180.634551, 73.024378, 159.078805, 73.024378),\n (184.424351, 92.073641, 184.424351, 95.883493),\n (60.343467, 92.073641, 60.343467, 95.883493),\n (64.333786, 73.024378, 64.333786, 92.073641),\n (180.634551, 73.024378, 180.634551, 92.073641),\n (158.878287, 95.883493, 158.878287, 92.073641),\n (85.889531, 95.883493, 85.889531, 92.073641),\n (85.889531, 92.073641, 85.889531, 73.024378),\n (159.078805, 92.073641, 159.078805, 73.024378),\n (198.424351, 160.975622, 198.424351, 109.883494),\n (198.424351, 109.883494, 202.234204, 109.883494),\n (198.424351, 160.975622, 202.234204, 160.975622),\n (202.234204, 160.975622, 202.234204, 109.883494),\n (202.234204, 113.693346, 221.283467, 113.693346),\n (221.283467, 156.804836, 221.283467, 113.693346),\n (202.234204, 156.804836, 221.283467, 156.804836)\n]\nVISIBLE_CIRCLES = [\n (85.889531, 135.750388, 15.038892)\n]\nVISIBLE_ARCS = [\n (158.878287, 135.429558, 25.546064, -90.0, 90.0),\n (85.889531, 135.429558, 25.546064, 90.0, -90.0),\n (85.889531, 135.950906, 21.896627, 90.0, -150.134928),\n (158.878287, 135.950906, 21.896627, -12.743766, 90.0),\n (85.889531, 135.249091, 21.555745, 90.0, -90.0),\n (159.078805, 135.249091, 21.555745, -90.0, 90.0)\n]\nHIDDEN_SEGMENTS = [\n (85.8895, 156.8048, 66.9008, 125.0473),\n (85.8895, 113.6933, 66.9008, 125.0473),\n (180.2355, 131.1207, 159.0788, 113.6933),\n (66.9008, 92.0736, 66.9008, 95.8835),\n (100.9284, 95.8835, 100.9284, 73.0244),\n (70.8506, 73.0244, 70.8506, 95.8835),\n (202.2342, 125.0473, 198.4244, 125.0473),\n (198.4244, 157.8475, 202.2342, 157.8475),\n (202.2342, 131.1207, 198.4244, 131.1207),\n (221.2835, 150.7893, 198.4244, 150.7893),\n (221.2835, 120.7115, 198.4244, 120.7115)\n]\n# (orient, text, p1, p2, base) for linear; (orient, text, center, radius, angle) for diameter\nDIMENSIONS = [\n ('horizontal', '100', (159.0788, 156.8049), (85.8896, 156.8049), (122.4842, 145.8049)),\n ('diameter', '%%c41.0959', (85.8896, 135.7504), 15.0389, 45),\n ('vertical', '30.137', (85.8896, 113.6934), (85.8896, 135.7504), (74.8896, 124.7219)),\n ('radius', 'R29.4521', (159.0788, 135.2491), 21.5558, 45),\n ('horizontal', '99.726', (85.8896, 109.8835), (158.8783, 109.8835), (122.3839, 120.8835)),\n ('vertical', '69.8082', (158.8783, 109.8835), (158.8783, 160.9756), (147.8783, 135.4296)),\n ('vertical', '0', (85.8896, 113.6934), (85.8896, 113.6934), (85.8896, 113.6934)),\n ('vertical', '5.2055', (85.8896, 113.6934), (85.8896, 109.8835), (96.8896, 111.7884)),\n ('horizontal', '99.726', (85.8896, 114.0543), (158.8783, 114.0543), (122.3839, 125.0543)),\n ('vertical', '59.8356', (85.8896, 114.0543), (85.8896, 157.8475), (74.8896, 135.9509)),\n ('vertical', '5.6986', (85.8896, 109.8835), (85.8896, 114.0543), (74.8896, 111.9689)),\n ('radius', 'R34.9041', (158.8783, 135.4296), 25.5461, 45),\n ('radius', 'R29.9178', (158.8783, 135.9509), 21.8966, 135),\n ('horizontal', '5.2055', (198.4244, 109.8835), (202.2342, 109.8835), (200.3293, 120.8835))\n]\n\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; _ds.dxf.dimasz = 2.5\n _ds.dxf.dimexe = 1.25; _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\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\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,\n angle=(0 if d[0] == \"horizontal\" else 90),\n 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,\n 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,\n 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,\n text=text, dimstyle=\"EZDXF\").render()\n\n doc.saveas(out_path)\n\n\nif __name__ == \"__main__\":\n out = sys.argv[1] if len(sys.argv) > 1 else \"0063_00631233_gt.dxf\"\n draw(out)\n print(\"wrote\", out)\n```"}], "images": ["images/0063_00631233.png"], "id": "0063_00631233"} {"messages": [{"role": "user", "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 22.49 mm. The outline includes one or more oblique (angled) edges. A union feature: The part is a circular plate with diameter 90.5 mm. It is extruded to a thickness of 22.49 mm. A cut feature: The part is a circular plate with diameter 45.45 mm. It is extruded to a thickness of -56.98 mm."}, {"role": "assistant", "content": "```python\n#!/usr/bin/env python3\n# -*- coding: utf-8 -*-\n# Ground-truth 2D engineering drawing for part: 0066_00666182\n# Self-contained: reproduces the three-view DXF via ezdxf, NO FreeCAD needed.\n# Coordinates are A4 page millimetres (scale=0.6278501452704506, page=[297.0, 210.0]).\n# visible edges -> solid (layer OUTLINE); hidden edges -> dashed (layer HIDDEN)\n# dimensions -> real movable DIMENSION entities (text = true mm value)\n# Run: python 0066_00666182_gt.py [out.dxf]\nimport sys\nimport ezdxf\nimport math\n\nSCALE = 0.6278501452704506\nPAGE = [297.0, 210.0]\n\nVISIBLE_SEGMENTS = [\n (82.846271, 109.708383, 140.817852, 109.708383),\n (78.984125, 166.785669, 141.76914, 166.785669),\n (169.144117, 95.539925, 141.76914, 95.539925),\n (141.76914, 95.539925, 141.76914, 81.419243),\n (169.144117, 81.419243, 141.76914, 81.419243),\n (78.984125, 81.419243, 141.76914, 81.419243),\n (141.76914, 95.539925, 78.984125, 95.539925),\n (78.984125, 95.539925, 50.445482, 95.539925),\n (78.984125, 81.419243, 50.445482, 81.419243),\n (108.16687, 81.419243, 108.16687, 67.29856),\n (108.16687, 67.29856, 51.347224, 67.29856),\n (169.144117, 81.419243, 169.144117, 95.539925),\n (50.445482, 81.419243, 50.445482, 95.539925),\n (51.347224, 67.29856, 51.347224, 81.419243),\n (78.984125, 95.539925, 78.984125, 81.419243),\n (183.144117, 109.708383, 197.2648, 109.708383),\n (183.144117, 166.785669, 197.2648, 166.785669),\n (183.144117, 166.785669, 183.144117, 109.708383),\n (197.2648, 166.785669, 197.2648, 110.258325),\n (197.2648, 110.258325, 197.2648, 109.539926),\n (211.385483, 166.359571, 211.385483, 109.539926),\n (211.385483, 166.359571, 197.2648, 166.359571),\n (211.385483, 109.539926, 197.2648, 109.539926)\n]\nVISIBLE_CIRCLES = [\n (79.132764, 137.949748, 14.269321),\n (79.757047, 137.949748, 28.409823)\n]\nVISIBLE_ARCS = [\n (140.592911, 138.258702, 28.551205, -89.548591, 87.638909),\n (78.984125, 138.247026, 28.538643, 90.0, -101.266247)\n]\nHIDDEN_SEGMENTS = [\n (78.9841, 166.7857, 78.9841, 109.7084),\n (108.1669, 137.9497, 73.4086, 110.2583),\n (82.8463, 109.7084, 108.1669, 137.9497),\n (73.4086, 110.2583, 82.8463, 109.7084),\n (93.4021, 67.2986, 93.4021, 95.5399),\n (64.8634, 95.5399, 64.8634, 67.2986),\n (183.1441, 123.6804, 211.3855, 123.6804),\n (183.1441, 152.2191, 211.3855, 152.2191)\n]\n# (orient, text, p1, p2, base) for linear; (orient, text, center, radius, angle) for diameter\nDIMENSIONS = [\n ('horizontal', '98.4848', (78.9841, 109.7084), (140.8178, 109.7084), (109.901, 120.7084)),\n ('horizontal', '100', (141.7691, 166.7856), (78.9841, 166.7856), (110.3766, 155.7856)),\n ('vertical', '90.9091', (78.9841, 166.7856), (78.9841, 109.7084), (89.9841, 138.247)),\n ('radius', 'R45.4746', (140.5929, 138.2587), 28.5512, 45),\n ('radius', 'R45.4545', (78.9841, 138.247), 28.5386, 45),\n ('diameter', '%%c90.4987', (79.7571, 137.9497), 28.4098, 45),\n ('diameter', '%%c45.4545', (79.1327, 137.9497), 14.2693, 135),\n ('horizontal', '22.4905', (183.1441, 109.7084), (197.2648, 109.7084), (190.2044, 120.7084)),\n ('horizontal', '44.9811', (211.3855, 137.9497), (175.6131, 137.9497), (193.4993, 116.9497))\n]\n\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; _ds.dxf.dimasz = 2.5\n _ds.dxf.dimexe = 1.25; _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\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\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,\n angle=(0 if d[0] == \"horizontal\" else 90),\n 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,\n 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,\n 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,\n text=text, dimstyle=\"EZDXF\").render()\n\n doc.saveas(out_path)\n\n\nif __name__ == \"__main__\":\n out = sys.argv[1] if len(sys.argv) > 1 else \"0066_00666182_gt.dxf\"\n draw(out)\n print(\"wrote\", out)\n```"}], "images": ["images/0066_00666182.png"], "id": "0066_00666182"} {"messages": [{"role": "user", "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 45.57 mm bounding box, featuring 2 circular holes, each of diameter 10.13 mm and a rectangular cutout 54.43 x 25.32 mm. It is extruded to a thickness of 12.44 mm. A union feature: The part is a polygonal plate with 4 straight edges. It is extruded to a thickness of 4.15 mm. The outline includes one or more oblique (angled) edges. A union feature: The part is a circular plate with diameter 13.97 mm. It is extruded to a thickness of 4.15 mm."}, {"role": "assistant", "content": "```python\n#!/usr/bin/env python3\n# -*- coding: utf-8 -*-\n# Ground-truth 2D engineering drawing for part: 0067_00673308\n# Self-contained: reproduces the three-view DXF via ezdxf, NO FreeCAD needed.\n# Coordinates are A4 page millimetres (scale=0.8915751640284502, page=[297.0, 210.0]).\n# visible edges -> solid (layer OUTLINE); hidden edges -> dashed (layer HIDDEN)\n# dimensions -> real movable DIMENSION entities (text = true mm value)\n# Run: python 0067_00673308_gt.py [out.dxf]\nimport sys\nimport ezdxf\nimport math\n\nSCALE = 0.8915751640284502\nPAGE = [297.0, 210.0]\n\nVISIBLE_SEGMENTS = [\n (176.202377, 116.002676, 176.202377, 109.231219),\n (87.04486, 116.002676, 176.202377, 116.002676),\n (176.202377, 109.231219, 194.259595, 109.231219),\n (194.259595, 109.231219, 194.259595, 149.859961),\n (194.259595, 149.859961, 176.202377, 149.859961),\n (176.202377, 149.859961, 176.202377, 143.088504),\n (176.202377, 143.088504, 87.04486, 143.088504),\n (125.41645, 136.317047, 76.887675, 140.831351),\n (76.887675, 118.259828, 125.41645, 123.902709),\n (77.186034, 118.467382, 85.210335, 119.227579),\n (77.186034, 140.221661, 125.247812, 135.66844),\n (194.259595, 95.231219, 176.202377, 95.231219),\n (176.202377, 95.231219, 87.04486, 95.231219),\n (87.04486, 95.231219, 58.410775, 95.231219),\n (194.259595, 84.140039, 176.202377, 84.140039),\n (176.202377, 84.140039, 87.04486, 84.140039),\n (87.04486, 84.140039, 58.410775, 84.140039),\n (87.04486, 95.231219, 87.04486, 84.140039),\n (194.259595, 95.231219, 194.259595, 84.140039),\n (176.202377, 95.231219, 176.202377, 84.140039),\n (58.410775, 84.140039, 58.410775, 95.231219),\n (219.350775, 112.025886, 219.350775, 109.231219),\n (208.259596, 109.231219, 219.350775, 109.231219),\n (208.259596, 112.025886, 208.259596, 109.231219),\n (208.259596, 149.859961, 208.259596, 147.065293),\n (208.259596, 147.065293, 208.259596, 112.025886),\n (219.350775, 149.859961, 219.350775, 147.065293),\n (219.350775, 147.065293, 219.350775, 112.025886),\n (208.259596, 149.859961, 219.350775, 149.859961),\n (219.350775, 147.065293, 208.259596, 147.065293),\n (219.350775, 112.025886, 208.259596, 112.025886)\n]\nVISIBLE_CIRCLES = [\n (185.230986, 117.131252, 4.514305),\n (185.230986, 143.088504, 4.514305),\n (124.080319, 129.558562, 6.226627)\n]\nVISIBLE_ARCS = [\n (75.930478, 129.54559, 17.519703, 50.625, -50.625),\n (75.776125, 129.54559, 11.340369, 84.375, -84.375),\n (124.805097, 130.109878, 6.237203, -84.375, 84.375),\n (76.11473, 129.344522, 10.929769, -84.375, 84.375),\n (124.62496, 129.344522, 6.354517, -126.666428, -113.482026),\n (124.080319, 129.558562, 6.226627, -49.214917, 79.182166)\n]\nHIDDEN_SEGMENTS = [\n (128.1477, 124.844, 125.4164, 123.9027),\n (76.8877, 95.2312, 76.8877, 84.14),\n (125.4164, 91.5342, 125.4164, 84.14),\n (122.4279, 91.5342, 122.4279, 95.2312),\n (122.0929, 91.5342, 122.0929, 95.2312),\n (85.2103, 91.5342, 85.2103, 95.2312),\n (77.186, 95.2312, 77.186, 91.5342),\n (87.0445, 91.5342, 77.186, 91.5342),\n (125.2478, 95.2312, 125.2478, 91.5342),\n (120.8303, 91.5342, 120.8303, 95.2312),\n (128.1477, 91.5342, 128.1477, 95.2312),\n (189.7453, 95.2312, 189.7453, 84.14),\n (120.8303, 91.5342, 122.4279, 91.5342),\n (130.3069, 91.5342, 125.249, 91.5342),\n (122.4279, 91.5342, 125.2478, 91.5342),\n (125.2478, 91.5342, 125.4164, 91.5342),\n (77.186, 91.5342, 122.4279, 91.5342),\n (85.2103, 91.5342, 87.0445, 91.5342),\n (87.0445, 91.5342, 122.0929, 91.5342),\n (77.186, 91.5342, 85.2103, 91.5342),\n (64.4358, 84.14, 64.4358, 95.2312),\n (131.0423, 84.14, 131.0423, 95.2312),\n (180.7167, 84.14, 180.7167, 95.2312),\n (130.3069, 91.5342, 130.3069, 95.2312),\n (208.2596, 116.0027, 219.3508, 116.0027),\n (208.2596, 143.0885, 219.3508, 143.0885),\n (208.2596, 118.2598, 219.3508, 118.2598),\n (211.9567, 123.9027, 219.3508, 123.9027),\n (211.9567, 123.5552, 208.2596, 123.5552),\n (211.9567, 123.5163, 208.2596, 123.5163),\n (211.9567, 119.2276, 208.2596, 119.2276),\n (208.2596, 118.4674, 211.9567, 118.4674),\n (208.2596, 140.2217, 211.9567, 140.2217),\n (211.9567, 140.2217, 211.9567, 118.4674),\n (208.2596, 135.6684, 211.9567, 135.6684),\n (211.9567, 124.2474, 208.2596, 124.2474),\n (211.9567, 124.844, 208.2596, 124.844),\n (219.3508, 140.886, 208.2596, 140.886),\n (219.3508, 118.2052, 208.2596, 118.2052),\n (219.3508, 121.6456, 208.2596, 121.6456),\n (219.3508, 112.6169, 208.2596, 112.6169),\n (219.3508, 147.6028, 208.2596, 147.6028),\n (219.3508, 138.5742, 208.2596, 138.5742)\n]\n# (orient, text, p1, p2, base) for linear; (orient, text, center, radius, angle) for diameter\nDIMENSIONS = [\n ('horizontal', '20.2532', (176.2024, 109.2312), (194.2596, 109.2312), (185.231, 120.2312)),\n ('horizontal', '100', (176.2024, 143.0885), (87.0449, 143.0885), (131.6236, 132.0885)),\n ('vertical', '7.5949', (176.2024, 116.0027), (176.2024, 109.2312), (187.2024, 112.6169)),\n ('vertical', '30.3797', (87.0449, 143.0885), (87.0449, 116.0027), (98.0449, 129.5456)),\n ('vertical', '45.5696', (194.2596, 109.2312), (194.2596, 149.86), (183.2596, 129.5456)),\n ('diameter', '%%c10.1266', (185.231, 117.1313), 4.5143, 45),\n ('horizontal', '110.127', (87.0449, 117.1313), (185.231, 117.1313), (136.1379, 128.1313)),\n ('vertical', '8.8608', (185.231, 109.2312), (185.231, 117.1313), (174.231, 113.1812)),\n ('diameter', '%%c10.1266', (185.231, 143.0885), 4.5143, 45),\n ('horizontal', '110.127', (87.0449, 143.0885), (185.231, 143.0885), (136.1379, 154.0885)),\n ('vertical', '37.9747', (185.231, 109.2312), (185.231, 143.0885), (174.231, 126.1598)),\n ('horizontal', '54.4304', (76.8877, 118.2598), (125.4165, 118.2598), (101.1521, 129.2598)),\n ('vertical', '25.3165', (76.8877, 118.2598), (76.8877, 140.8314), (65.8877, 129.5456)),\n ('horizontal', '11.3924', (87.0449, 118.2598), (76.8877, 118.2598), (81.9663, 107.2598)),\n ('vertical', '10.1266', (76.8877, 109.2312), (76.8877, 118.2598), (65.8877, 113.7455)),\n ('radius', 'R19.6503', (75.9305, 129.5456), 17.5197, 45),\n ('radius', 'R6.9957', (124.8051, 130.1099), 6.2372, 45),\n ('radius', 'R12.7195', (75.7762, 129.5456), 11.3404, 135),\n ('horizontal', '53.9066', (77.186, 118.4674), (125.2478, 118.4674), (101.2169, 129.4674)),\n ('vertical', '24.3998', (125.2478, 118.4674), (125.2478, 140.2216), (114.2478, 129.3445)),\n ('horizontal', '11.0578', (87.0449, 109.2312), (77.186, 109.2312), (82.1154, 98.2312)),\n ('vertical', '10.3594', (77.186, 109.2312), (77.186, 118.4674), (66.186, 113.8493)),\n ('aligned', '54.148', (125.2478, 135.6684), (77.186, 140.2216), (100.1795, 126.9941)),\n ('radius', 'R7.1273', (124.6249, 129.3445), 6.3545, 135),\n ('radius', 'R12.2589', (76.1147, 129.3445), 10.9297, 225),\n ('diameter', '%%c13.9677', (124.0803, 129.5586), 6.2266, 225),\n ('horizontal', '12.44', (208.2596, 116.0027), (219.3508, 116.0027), (213.8052, 127.0027)),\n ('horizontal', '12.44', (208.2596, 129.5586), (211.9567, 129.5586), (210.1081, 140.5586))\n]\n\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; _ds.dxf.dimasz = 2.5\n _ds.dxf.dimexe = 1.25; _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\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\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,\n angle=(0 if d[0] == \"horizontal\" else 90),\n 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,\n 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,\n 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,\n text=text, dimstyle=\"EZDXF\").render()\n\n doc.saveas(out_path)\n\n\nif __name__ == \"__main__\":\n out = sys.argv[1] if len(sys.argv) > 1 else \"0067_00673308_gt.dxf\"\n draw(out)\n print(\"wrote\", out)\n```"}], "images": ["images/0067_00673308.png"], "id": "0067_00673308"} {"messages": [{"role": "user", "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.2 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 -8.2 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 -8.2 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 -8.2 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 -8.2 mm. The outline includes one or more oblique (angled) edges."}, {"role": "assistant", "content": "```python\n#!/usr/bin/env python3\n# -*- coding: utf-8 -*-\n# Ground-truth 2D engineering drawing for part: 0068_00688661\n# Self-contained: reproduces the three-view DXF via ezdxf, NO FreeCAD needed.\n# Coordinates are A4 page millimetres (scale=0.6542922520650848, page=[297.0, 210.0]).\n# visible edges -> solid (layer OUTLINE); hidden edges -> dashed (layer HIDDEN)\n# dimensions -> real movable DIMENSION entities (text = true mm value)\n# Run: python 0068_00688661_gt.py [out.dxf]\nimport sys\nimport ezdxf\nimport math\n\nSCALE = 0.6542922520650848\nPAGE = [297.0, 210.0]\n\nVISIBLE_SEGMENTS = [\n (142.890406, 81.31599, 179.18401, 135.756396),\n (88.45, 117.609594, 142.890406, 81.31599),\n (179.18401, 135.756396, 124.743604, 172.05),\n (95.279442, 127.853756, 122.622883, 109.753169),\n (95.279442, 127.853756, 88.45, 117.609594),\n (124.743604, 172.05, 116.481836, 159.657349),\n (125.678159, 153.651587, 116.481836, 159.657349),\n (113.441965, 155.097541, 122.638287, 149.091779),\n (113.441965, 155.097541, 107.327523, 145.925879),\n (125.241691, 134.169706, 107.327523, 145.925879),\n (104.286386, 141.364174, 122.135065, 129.650978),\n (104.286386, 141.364174, 98.360393, 132.475183),\n (125.703834, 114.374595, 98.360393, 132.475183),\n (155.357988, 100.048173, 158.592987, 104.900671),\n (139.182995, 121.999949, 155.357988, 100.048173),\n (150.736562, 136.557443, 139.182995, 121.999949),\n (146.115135, 121.768878, 155.357988, 133.553516),\n (158.592987, 104.900671, 146.115135, 121.768878),\n (179.18401, 61.95, 179.18401, 67.31599),\n (88.45, 61.95, 88.45, 67.31599),\n (179.18401, 67.31599, 124.743604, 67.31599),\n (124.743604, 61.95, 124.743604, 67.31599),\n (179.18401, 61.95, 124.743604, 61.95),\n (95.279442, 61.95, 98.360393, 61.95),\n (95.279442, 61.95, 88.45, 61.95),\n (124.743604, 61.95, 116.481836, 61.95),\n (113.441965, 61.95, 116.481836, 61.95),\n (113.441965, 61.95, 107.327523, 61.95),\n (104.286386, 61.95, 107.327523, 61.95),\n (104.286386, 61.95, 98.360393, 61.95),\n (95.279442, 67.31599, 98.360393, 67.31599),\n (95.279442, 67.31599, 88.45, 67.31599),\n (124.743604, 67.31599, 116.481836, 67.31599),\n (113.441965, 67.31599, 116.481836, 67.31599),\n (113.441965, 67.31599, 107.327523, 67.31599),\n (104.286386, 67.31599, 107.327523, 67.31599),\n (104.286386, 67.31599, 98.360393, 67.31599),\n (95.279442, 61.95, 95.279442, 67.31599),\n (116.481836, 61.95, 116.481836, 67.31599),\n (98.360393, 61.95, 98.360393, 67.31599),\n (104.286386, 67.31599, 104.286386, 61.95),\n (107.327523, 61.95, 107.327523, 67.31599),\n (113.441965, 67.31599, 113.441965, 61.95),\n (198.55, 81.31599, 193.18401, 81.31599),\n (198.55, 117.609594, 193.18401, 117.609594),\n (193.18401, 117.609594, 193.18401, 81.31599),\n (198.55, 117.609594, 198.55, 81.31599),\n (198.55, 172.05, 193.18401, 172.05),\n (198.55, 127.853756, 198.55, 117.609594),\n (198.55, 172.05, 198.55, 159.657349),\n (198.55, 155.097541, 198.55, 159.657349),\n (198.55, 155.097541, 198.55, 145.925879),\n (198.55, 141.364174, 198.55, 145.925879),\n (198.55, 141.364174, 198.55, 132.475183),\n (198.55, 127.853756, 198.55, 132.475183),\n (193.18401, 127.853756, 193.18401, 117.609594),\n (193.18401, 172.05, 193.18401, 159.657349),\n (193.18401, 155.097541, 193.18401, 159.657349),\n (193.18401, 155.097541, 193.18401, 145.925879),\n (193.18401, 141.364174, 193.18401, 145.925879),\n (193.18401, 141.364174, 193.18401, 132.475183),\n (193.18401, 127.853756, 193.18401, 132.475183),\n (198.55, 127.853756, 193.18401, 127.853756),\n (198.55, 159.657349, 193.18401, 159.657349),\n (198.55, 132.475183, 193.18401, 132.475183),\n (193.18401, 141.364174, 198.55, 141.364174),\n (198.55, 145.925879, 193.18401, 145.925879),\n (193.18401, 155.097541, 198.55, 155.097541)\n]\nVISIBLE_CIRCLES = [\n\n]\nVISIBLE_ARCS = [\n (127.006873, 149.472583, 4.385151, -175.018193, 107.638057),\n (126.511364, 129.969539, 4.387878, -175.836648, 106.819602),\n (127.360253, 109.932619, 4.740768, -177.830693, 110.450557),\n (154.923919, 137.942625, 4.41052, -84.351993, -161.695743)\n]\nHIDDEN_SEGMENTS = [\n (142.8904, 61.95, 142.8904, 67.316),\n (122.6229, 61.95, 122.6229, 67.316),\n (125.7038, 61.95, 125.7038, 67.316),\n (122.1351, 61.95, 122.1351, 67.316),\n (125.6782, 61.95, 125.6782, 67.316),\n (122.6383, 61.95, 122.6383, 67.316),\n (155.358, 61.95, 155.358, 67.316),\n (158.593, 61.95, 158.593, 67.316),\n (146.1151, 61.95, 146.1151, 67.316),\n (150.7366, 61.95, 150.7366, 67.316),\n (139.183, 61.95, 139.183, 67.316),\n (132.101, 67.316, 132.101, 61.95),\n (130.8992, 67.316, 130.8992, 61.95),\n (131.392, 67.316, 131.392, 61.95),\n (150.5134, 67.316, 150.5134, 61.95),\n (159.3344, 67.316, 159.3344, 61.95),\n (198.55, 135.7564, 193.184, 135.7564),\n (198.55, 109.7532, 193.184, 109.7532),\n (198.55, 114.3746, 193.184, 114.3746),\n (198.55, 129.651, 193.184, 129.651),\n (198.55, 134.1697, 193.184, 134.1697),\n (198.55, 153.6516, 193.184, 153.6516),\n (198.55, 149.0918, 193.184, 149.0918),\n (198.55, 100.0482, 193.184, 100.0482),\n (198.55, 104.9007, 193.184, 104.9007),\n (198.55, 121.7689, 193.184, 121.7689),\n (198.55, 133.5535, 193.184, 133.5535),\n (198.55, 136.5574, 193.184, 136.5574),\n (198.55, 121.9999, 193.184, 121.9999),\n (193.184, 105.1919, 198.55, 105.1919),\n (193.184, 114.6734, 198.55, 114.6734),\n (193.184, 125.5817, 198.55, 125.5817),\n (193.184, 134.3574, 198.55, 134.3574),\n (193.184, 145.0874, 198.55, 145.0874),\n (193.184, 153.8577, 198.55, 153.8577),\n (193.184, 142.3531, 198.55, 142.3531)\n]\n# (orient, text, p1, p2, base) for linear; (orient, text, center, radius, angle) for diameter\nDIMENSIONS = [\n ('aligned', '100', (142.8904, 81.316), (179.184, 135.7564), (151.8847, 114.6379)),\n ('aligned', '100', (179.184, 135.7564), (124.7436, 172.05), (145.8621, 144.7507)),\n ('aligned', '100', (124.7436, 172.05), (88.45, 117.6096), (115.7493, 138.7281)),\n ('aligned', '100', (88.45, 117.6096), (142.8904, 81.316), (121.7719, 108.6153)),\n ('horizontal', '46.4997', (95.2794, 109.7531), (125.7038, 109.7531), (110.4916, 120.7531)),\n ('vertical', '34.7277', (125.7038, 109.7531), (125.7038, 132.4752), (114.7038, 121.1142)),\n ('horizontal', '10.4379', (88.45, 81.316), (95.2794, 81.316), (91.8647, 92.316)),\n ('vertical', '43.4625', (95.2794, 81.316), (95.2794, 109.7531), (84.2794, 95.5345)),\n ('aligned', '50.1178', (125.7038, 114.3746), (98.3604, 132.4752), (105.9602, 114.2525)),\n ('aligned', '8.489', (98.3604, 132.4752), (95.2794, 127.8537), (105.9725, 124.0628)),\n ('aligned', '50.1178', (95.2794, 127.8537), (122.6229, 109.7531), (115.023, 127.9758)),\n ('radius', 'R7.2456', (127.3602, 109.9326), 4.7407, 45),\n ('horizontal', '32.3732', (104.0602, 129.651), (125.2417, 129.651), (114.6509, 140.651)),\n ('vertical', '25.0353', (125.2417, 129.651), (125.2417, 146.0314), (114.2417, 137.8412)),\n ('horizontal', '23.8581', (88.45, 81.316), (104.0602, 81.316), (96.2551, 92.316)),\n ('vertical', '73.8737', (104.0602, 81.316), (104.0602, 129.651), (93.0602, 105.4835)),\n ('radius', 'R6.7063', (126.5114, 129.9695), 4.3879, 45),\n ('horizontal', '18.8746', (113.3287, 149.0918), (125.6782, 149.0918), (119.5034, 160.0918)),\n ('vertical', '16.2611', (125.6782, 149.0918), (125.6782, 159.7313), (114.6782, 154.4116)),\n ('horizontal', '38.0238', (88.45, 81.316), (113.3287, 81.316), (100.8893, 92.316)),\n ('vertical', '103.587', (113.3287, 81.316), (113.3287, 149.0918), (102.3287, 115.2039)),\n ('radius', 'R6.7021', (127.0068, 149.4726), 4.3851, 45),\n ('horizontal', '29.6657', (139.183, 100.0482), (158.593, 100.0482), (148.888, 111.0482)),\n ('vertical', '55.7997', (158.593, 100.0482), (158.593, 136.5575), (147.593, 118.3028)),\n ('horizontal', '77.5387', (88.45, 81.316), (139.183, 81.316), (113.8165, 92.316)),\n ('vertical', '28.6297', (139.183, 81.316), (139.183, 100.0482), (128.183, 90.6821)),\n ('aligned', '8.9134', (155.358, 100.0482), (158.593, 104.9006), (147.823, 108.5761)),\n ('aligned', '32.0678', (158.593, 104.9006), (146.1151, 121.7689), (143.5106, 106.7931)),\n ('aligned', '22.8903', (146.1151, 121.7689), (155.358, 133.5535), (142.0812, 134.4498)),\n ('aligned', '28.4049', (150.7366, 136.5575), (139.183, 121.9999), (153.5759, 122.4404)),\n ('aligned', '41.6746', (139.183, 121.9999), (155.358, 100.0482), (156.1261, 117.5492)),\n ('radius', 'R6.7409', (154.9239, 137.9426), 4.4105, 45),\n ('horizontal', '8.2012', (198.55, 81.316), (193.184, 81.316), (195.867, 70.316)),\n ('horizontal', '8.2012', (198.55, 109.7531), (193.184, 109.7531), (195.867, 98.7531)),\n ('horizontal', '8.2012', (198.55, 129.651), (193.184, 129.651), (195.867, 118.651)),\n ('horizontal', '8.2012', (198.55, 149.0918), (193.184, 149.0918), (195.867, 138.0918)),\n ('horizontal', '8.2012', (198.55, 100.0482), (193.184, 100.0482), (195.867, 89.0482))\n]\n\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; _ds.dxf.dimasz = 2.5\n _ds.dxf.dimexe = 1.25; _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\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\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,\n angle=(0 if d[0] == \"horizontal\" else 90),\n 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,\n 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,\n 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,\n text=text, dimstyle=\"EZDXF\").render()\n\n doc.saveas(out_path)\n\n\nif __name__ == \"__main__\":\n out = sys.argv[1] if len(sys.argv) > 1 else \"0068_00688661_gt.dxf\"\n draw(out)\n print(\"wrote\", out)\n```"}], "images": ["images/0068_00688661.png"], "id": "0068_00688661"} {"messages": [{"role": "user", "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 10.71 mm. The outline includes one or more oblique (angled) edges. A union feature: The part is a polygonal plate with 8 straight edges. It is extruded to a thickness of 10.71 mm. The outline includes one or more oblique (angled) edges."}, {"role": "assistant", "content": "```python\n#!/usr/bin/env python3\n# -*- coding: utf-8 -*-\n# Ground-truth 2D engineering drawing for part: 0069_00693937\n# Self-contained: reproduces the three-view DXF via ezdxf, NO FreeCAD needed.\n# Coordinates are A4 page millimetres (scale=0.4653937078289077, page=[297.0, 210.0]).\n# visible edges -> solid (layer OUTLINE); hidden edges -> dashed (layer HIDDEN)\n# dimensions -> real movable DIMENSION entities (text = true mm value)\n# Run: python 0069_00693937_gt.py [out.dxf]\nimport sys\nimport ezdxf\nimport math\n\nSCALE = 0.4653937078289077\nPAGE = [297.0, 210.0]\n\nVISIBLE_SEGMENTS = [\n (175.404592, 71.095408, 134.177686, 71.095408),\n (134.177686, 71.095408, 125.517605, 71.095408),\n (125.517605, 71.095408, 84.290699, 71.095408),\n (175.404592, 66.109301, 134.177686, 66.109301),\n (134.177686, 66.109301, 125.517605, 66.109301),\n (125.517605, 66.109301, 84.290699, 66.109301),\n (84.290699, 66.109301, 84.290699, 71.095408),\n (175.404592, 66.109301, 175.404592, 71.095408),\n (125.517605, 71.095408, 125.517605, 66.109301),\n (134.177686, 71.095408, 134.177686, 66.109301),\n (189.404592, 126.322314, 189.404592, 85.095408),\n (194.390699, 126.322314, 194.390699, 85.095408),\n (194.390699, 134.982395, 194.390699, 126.322314),\n (189.404592, 134.982395, 189.404592, 126.322314),\n (189.404592, 176.209301, 189.404592, 134.982395),\n (194.390699, 176.209301, 194.390699, 134.982395),\n (194.390699, 85.095408, 189.404592, 85.095408),\n (194.390699, 176.209301, 189.404592, 176.209301),\n (189.404592, 126.322314, 194.390699, 126.322314),\n (189.404592, 134.982395, 194.390699, 134.982395)\n]\nVISIBLE_CIRCLES = [\n\n]\nVISIBLE_ARCS = [\n (107.646506, 108.451215, 23.355807, 130.078125, -40.078125),\n (88.965893, 130.652354, 5.658946, -49.921875, 49.921875),\n (129.847646, 89.770602, 5.658946, 40.078125, 139.921875),\n (152.048785, 108.451215, 23.355807, -139.921875, 49.921875),\n (170.729398, 130.652354, 5.658946, 130.078125, -130.078125),\n (152.048785, 152.853494, 23.355807, -49.921875, 139.921875),\n (129.847646, 171.534107, 5.658946, -139.921875, -40.078125),\n (107.646506, 152.853494, 23.355807, 40.078125, -130.078125)\n]\nHIDDEN_SEGMENTS = [\n (94.6248, 66.1093, 94.6248, 71.0954),\n (165.0705, 66.1093, 165.0705, 71.0954),\n (194.3907, 95.4295, 189.4046, 95.4295),\n (194.3907, 165.8752, 189.4046, 165.8752)\n]\n# (orient, text, p1, p2, base) for linear; (orient, text, center, radius, angle) for diameter\nDIMENSIONS = [\n ('horizontal', '18.6081', (125.5176, 93.414), (134.1777, 93.414), (129.8477, 104.414)),\n ('vertical', '18.6081', (167.086, 126.3223), (167.086, 134.9824), (156.086, 130.6523)),\n ('radius', 'R50.1851', (107.6465, 108.4512), 23.3558, 45),\n ('radius', 'R12.1595', (129.8477, 89.7706), 5.659, 45),\n ('horizontal', '160.029', (92.6093, 93.414), (167.086, 93.414), (129.8477, 104.414)),\n ('vertical', '160.029', (167.086, 93.414), (167.086, 167.8907), (156.086, 130.6524)),\n ('vertical', '0', (92.6093, 93.414), (92.6093, 93.414), (92.6093, 93.414)),\n ('vertical', '0', (92.6093, 93.414), (92.6093, 93.414), (92.6093, 93.414)),\n ('radius', 'R50.1851', (107.6465, 108.4512), 23.3558, 135),\n ('radius', 'R12.1595', (129.8477, 89.7706), 5.659, 135),\n ('horizontal', '10.7137', (189.4046, 126.3223), (194.3907, 126.3223), (191.8976, 137.3223)),\n ('horizontal', '10.7137', (189.4046, 126.3223), (194.3907, 126.3223), (191.8976, 137.3223))\n]\n\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; _ds.dxf.dimasz = 2.5\n _ds.dxf.dimexe = 1.25; _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\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\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,\n angle=(0 if d[0] == \"horizontal\" else 90),\n 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,\n 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,\n 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,\n text=text, dimstyle=\"EZDXF\").render()\n\n doc.saveas(out_path)\n\n\nif __name__ == \"__main__\":\n out = sys.argv[1] if len(sys.argv) > 1 else \"0069_00693937_gt.dxf\"\n draw(out)\n print(\"wrote\", out)\n```"}], "images": ["images/0069_00693937.png"], "id": "0069_00693937"} {"messages": [{"role": "user", "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 3 straight edges. It is extruded to a thickness of 84.13 mm. The outline includes one or more oblique (angled) edges. A union feature: The part is a polygonal plate with 3 straight edges. It is extruded to a thickness of 84.13 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 84.13 mm. A union feature: The part is a polygonal plate with 2 straight edges. It is extruded to a thickness of 84.13 mm. A union feature: The part is a polygonal plate with 2 straight edges. It is extruded to a thickness of 84.13 mm."}, {"role": "assistant", "content": "```python\n#!/usr/bin/env python3\n# -*- coding: utf-8 -*-\n# Ground-truth 2D engineering drawing for part: 0071_00717410\n# Self-contained: reproduces the three-view DXF via ezdxf, NO FreeCAD needed.\n# Coordinates are A4 page millimetres (scale=0.47201877623857663, page=[297.0, 210.0]).\n# visible edges -> solid (layer OUTLINE); hidden edges -> dashed (layer HIDDEN)\n# dimensions -> real movable DIMENSION entities (text = true mm value)\n# Run: python 0071_00717410_gt.py [out.dxf]\nimport sys\nimport ezdxf\nimport math\n\nSCALE = 0.47201877623857663\nPAGE = [297.0, 210.0]\n\nVISIBLE_SEGMENTS = [\n (122.3819, 168.447338, 80.241372, 168.447338),\n (127.443249, 118.997752, 80.241372, 118.997752),\n (122.3819, 65.276628, 80.241372, 65.276628),\n (122.3819, 65.276628, 152.674494, 65.276628),\n (55.759363, 65.276628, 80.22927, 65.276628),\n (80.241372, 65.276628, 80.241372, 104.986144),\n (80.241372, 104.986144, 122.3819, 104.986144),\n (122.3819, 104.986144, 122.3819, 65.276628),\n (122.3819, 104.986144, 152.674494, 104.986144),\n (55.759363, 104.986144, 80.22927, 104.986144),\n (152.674494, 104.986144, 152.674494, 65.276628),\n (55.759363, 104.986144, 55.759363, 65.276628),\n (206.38401, 168.447338, 166.674494, 168.447338),\n (206.38401, 118.997752, 166.674494, 118.997752),\n (206.38401, 118.997752, 206.38401, 118.991772),\n (206.38401, 118.991772, 206.38401, 118.986144),\n (206.38401, 118.997752, 206.38401, 169.005129),\n (166.674494, 118.997752, 166.674494, 118.991772),\n (166.674494, 118.991772, 166.674494, 118.986144),\n (166.674494, 118.997752, 166.674494, 169.005129),\n (166.674494, 118.986144, 206.38401, 118.986144),\n (166.674494, 169.011014, 206.38401, 169.011014)\n]\nVISIBLE_CIRCLES = [\n\n]\nVISIBLE_ARCS = [\n (127.662059, 143.998579, 25.012435, -90.501446, 102.186904),\n (80.771798, 143.998579, 25.012435, 91.242861, -91.215425),\n (80.771798, 143.998579, 25.012435, -20.67475, -20.390625),\n (127.407575, 143.774979, 24.777253, -159.67228, -92.381585),\n (127.662059, 143.998579, 25.012435, -159.609375, -92.942752),\n (80.771798, 143.998579, 25.012435, -20.390625, 19.99447),\n (81.037014, 144.097163, 24.729489, -20.390625, 19.989937),\n (127.396843, 144.097163, 24.729489, 160.865052, -159.609375),\n (80.525477, 143.317365, 25.131578, 20.706337, 20.706576),\n (127.662059, 143.998579, 25.012435, 160.850664, -159.609375)\n]\nHIDDEN_SEGMENTS = [\n (104.0336, 104.9861, 104.0336, 65.2766),\n (104.2169, 65.2766, 104.2169, 104.9861),\n (104.2766, 104.9861, 104.2766, 65.2766),\n (126.378, 104.9861, 126.378, 65.2766),\n (104.1734, 104.9861, 104.1734, 65.2766),\n (102.6496, 104.9861, 102.6496, 65.2766),\n (105.7842, 104.9861, 105.7842, 65.2766),\n (102.6674, 104.9861, 102.6674, 65.2766),\n (105.7665, 104.9861, 105.7665, 65.2766),\n (166.6745, 152.2034, 206.384, 152.2034),\n (206.384, 135.2838, 166.6745, 135.2838),\n (166.6745, 152.5511, 206.384, 152.5511),\n (166.6745, 135.1676, 206.384, 135.1676),\n (206.384, 135.4809, 166.6745, 135.4809)\n]\n# (orient, text, p1, p2, base) for linear; (orient, text, center, radius, angle) for diameter\nDIMENSIONS = [\n ('horizontal', '100', (127.4432, 118.9977), (80.2414, 118.9977), (103.8423, 107.9977)),\n ('radius', 'R53.2428', (80.5255, 144.1277), 25.1316, 45),\n ('radius', 'R52.4921', (127.4076, 143.775), 24.7773, 45),\n ('horizontal', '100', (80.2414, 168.4474), (127.4432, 168.4474), (103.8423, 179.4474)),\n ('vertical', '34.7369', (127.4432, 168.4474), (127.4432, 152.0509), (138.4432, 160.2491)),\n ('vertical', '70.0251', (80.2414, 135.3942), (80.2414, 168.4474), (69.2414, 151.9208)),\n ('radius', 'R52.4921', (127.4076, 143.6701), 24.7773, 135),\n ('radius', 'R53.2428', (80.5255, 143.3174), 25.1316, 135),\n ('radius', 'R52.9903', (127.6621, 143.9986), 25.0124, 225),\n ('radius', 'R52.9903', (127.6621, 143.9986), 25.0124, 315),\n ('radius', 'R52.3909', (81.037, 144.0972), 24.7295, 45),\n ('horizontal', '84.127', (206.384, 118.9977), (166.6745, 118.9977), (186.5292, 107.9977))\n]\n\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; _ds.dxf.dimasz = 2.5\n _ds.dxf.dimexe = 1.25; _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\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\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,\n angle=(0 if d[0] == \"horizontal\" else 90),\n 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,\n 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,\n 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,\n text=text, dimstyle=\"EZDXF\").render()\n\n doc.saveas(out_path)\n\n\nif __name__ == \"__main__\":\n out = sys.argv[1] if len(sys.argv) > 1 else \"0071_00717410_gt.dxf\"\n draw(out)\n print(\"wrote\", out)\n```"}], "images": ["images/0071_00717410.png"], "id": "0071_00717410"} {"messages": [{"role": "user", "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": "assistant", "content": "```python\n#!/usr/bin/env python3\n# -*- coding: utf-8 -*-\n# Ground-truth 2D engineering drawing for part: 0071_00719979\n# Self-contained: reproduces the three-view DXF via ezdxf, NO FreeCAD needed.\n# Coordinates are A4 page millimetres (scale=0.4435514456349072, page=[297.0, 210.0]).\n# visible edges -> solid (layer OUTLINE); hidden edges -> dashed (layer HIDDEN)\n# dimensions -> real movable DIMENSION entities (text = true mm value)\n# Run: python 0071_00719979_gt.py [out.dxf]\nimport sys\nimport ezdxf\nimport math\n\nSCALE = 0.4435514456349072\nPAGE = [297.0, 210.0]\n\nVISIBLE_SEGMENTS = [\n (133.124739, 117.923309, 129.205748, 86.897962),\n (115.569219, 85.172991, 111.09634, 120.583284),\n (111.09634, 123.307153, 115.301611, 167.462498),\n (125.010418, 173.148905, 151.707425, 172.259005),\n (153.674709, 161.154592, 135.276648, 160.628933),\n (130.02006, 154.321027, 132.725251, 127.719982),\n (111.09634, 63.527043, 115.301611, 63.527043),\n (115.301611, 63.527043, 115.779483, 63.527043),\n (115.779483, 63.527043, 125.010418, 63.527043),\n (125.010418, 63.527043, 151.707425, 63.527043),\n (158.424754, 63.527043, 151.707425, 63.527043),\n (111.09634, 65.342956, 115.301611, 65.342956),\n (115.301611, 65.342956, 115.779483, 65.342956),\n (115.779483, 65.342956, 125.010418, 65.342956),\n (125.010418, 65.342956, 151.707425, 65.342956),\n (151.707425, 65.342956, 158.424754, 65.342956),\n (111.09634, 63.527043, 111.09634, 65.342956),\n (115.301611, 63.527043, 115.301611, 65.342956),\n (151.707425, 65.342956, 151.707425, 63.527043),\n (125.010418, 65.342956, 125.010418, 63.527043),\n (158.424754, 65.342956, 158.424754, 63.527043),\n (115.779483, 65.342956, 115.779483, 63.527043),\n (172.424754, 85.172991, 172.424754, 79.342956),\n (174.240666, 79.342956, 174.240666, 85.172991),\n (174.240666, 85.172991, 174.240666, 120.583284),\n (174.240666, 120.583284, 174.240666, 123.307153),\n (174.240666, 123.307153, 174.240666, 167.462498),\n (174.240666, 167.462498, 174.240666, 173.627043),\n (172.424754, 85.172991, 172.424754, 120.583284),\n (172.424754, 120.583284, 172.424754, 123.307153),\n (172.424754, 123.307153, 172.424754, 167.462498),\n (172.424754, 167.462498, 172.424754, 173.627043),\n (174.240666, 85.172991, 172.424754, 85.172991),\n (174.240666, 120.583284, 172.424754, 120.583284),\n (174.240666, 123.307153, 172.424754, 123.307153),\n (174.240666, 167.462498, 172.424754, 167.462498),\n (172.424754, 79.342956, 174.240666, 79.342956),\n (172.424754, 173.627043, 174.240666, 173.627043)\n]\nVISIBLE_CIRCLES = [\n (120.042098, 95.982449, 2.23644),\n (122.517474, 86.080947, 2.293784),\n (122.565261, 122.399197, 2.389359),\n (152.919672, 166.889052, 2.179095),\n (122.517474, 166.889052, 2.293784),\n (122.517474, 166.889052, 6.737991),\n (152.919672, 166.889052, 5.505082),\n (122.517474, 86.080947, 6.737991),\n (122.565261, 122.399197, 11.468921)\n]\nVISIBLE_ARCS = [\n (122.278538, 86.000506, 6.760158, 102.496963, -172.96875),\n (122.278538, 121.962477, 11.26693, -172.96875, -54.812008),\n (122.135176, 122.219922, 11.092249, 165.864682, 174.375),\n (121.830635, 166.67552, 6.576282, 173.126983, -82.686575),\n (153.471417, 166.67401, 5.523161, -116.116874, -87.890625),\n (135.578227, 155.033419, 5.603635, 93.085054, -172.696196),\n (122.565261, 122.399197, 11.468921, -22.970823, 27.641047)\n]\nHIDDEN_SEGMENTS = [\n (120.8157, 65.343, 120.8157, 63.527),\n (129.2057, 65.343, 129.2057, 63.527),\n (133.1247, 65.343, 133.1247, 63.527),\n (128.7712, 65.343, 128.7712, 63.527),\n (122.2785, 63.527, 122.2785, 65.343),\n (132.7253, 65.343, 132.7253, 63.527),\n (130.0201, 63.527, 130.0201, 65.343),\n (135.2766, 63.527, 135.2766, 65.343),\n (153.6747, 63.527, 153.6747, 65.343),\n (151.0401, 65.343, 151.0401, 63.527),\n (122.6678, 65.343, 122.6678, 63.527),\n (155.0988, 63.527, 155.0988, 65.343),\n (129.2555, 65.343, 129.2555, 63.527),\n (117.8057, 65.343, 117.8057, 63.527),\n (120.2237, 65.343, 120.2237, 63.527),\n (134.0342, 65.343, 134.0342, 63.527),\n (120.1759, 65.343, 120.1759, 63.527),\n (129.9746, 65.343, 129.9746, 63.527),\n (150.7406, 65.343, 150.7406, 63.527),\n (172.4248, 92.6005, 174.2407, 92.6005),\n (172.4248, 86.898, 174.2407, 86.898),\n (172.4248, 117.9233, 174.2407, 117.9233),\n (172.4248, 112.7544, 174.2407, 112.7544),\n (172.4248, 127.72, 174.2407, 127.72),\n (172.4248, 124.9288, 174.2407, 124.9288),\n (174.2407, 154.321, 172.4248, 154.321),\n (174.2407, 160.6289, 172.4248, 160.6289),\n (174.2407, 161.1546, 172.4248, 161.1546),\n (172.4248, 161.7148, 174.2407, 161.7148),\n (172.4248, 172.259, 174.2407, 172.259),\n (172.4248, 160.1527, 174.2407, 160.1527),\n (172.4248, 110.6955, 174.2407, 110.6955),\n (172.4248, 93.746, 174.2407, 93.746),\n (172.4248, 98.2189, 174.2407, 98.2189),\n (172.4248, 83.7872, 174.2407, 83.7872),\n (172.4248, 88.3747, 174.2407, 88.3747),\n (172.4248, 110.9303, 174.2407, 110.9303),\n (172.4248, 120.0098, 174.2407, 120.0098),\n (172.4248, 124.7886, 174.2407, 124.7886),\n (172.4248, 161.1508, 174.2407, 161.1508),\n (172.4248, 161.384, 174.2407, 161.384),\n (172.4248, 172.3941, 174.2407, 172.3941),\n (172.4248, 160.1511, 174.2407, 160.1511),\n (172.4248, 160.0992, 174.2407, 160.0992),\n (172.4248, 164.5953, 174.2407, 164.5953),\n (172.4248, 169.1828, 174.2407, 169.1828),\n (172.4248, 164.71, 174.2407, 164.71),\n (172.4248, 169.0681, 174.2407, 169.0681)\n]\n# (orient, text, p1, p2, base) for linear; (orient, text, center, radius, angle) for diameter\nDIMENSIONS = [\n ('diameter', '%%c30.382', (122.5175, 166.8891), 6.738, 45),\n ('diameter', '%%c10.3428', (122.5175, 166.8891), 2.2938, 135),\n ('diameter', '%%c24.8227', (152.9197, 166.8891), 5.5051, 45),\n ('diameter', '%%c9.8257', (152.9197, 166.8891), 2.1791, 135),\n ('diameter', '%%c30.382', (122.5175, 86.0809), 6.738, 45),\n ('diameter', '%%c10.3428', (122.5175, 86.0809), 2.2938, 135),\n ('horizontal', '95.9942', (111.0963, 173.2447), (153.6747, 173.2447), (132.3855, 184.2447)),\n ('vertical', '112.586', (153.6747, 173.2447), (153.6747, 123.3072), (164.6747, 148.2759)),\n ('aligned', '41.4959', (153.6747, 161.1546), (135.2767, 160.6289), (144.7898, 149.8963)),\n ('aligned', '100', (111.0963, 123.3072), (115.3016, 167.4625), (102.2485, 146.4277)),\n ('radius', 'R14.8264', (121.8306, 166.6755), 6.5763, 225),\n ('radius', 'R12.4521', (153.4714, 166.674), 5.5231, 45),\n ('radius', 'R12.6336', (135.5782, 155.0334), 5.6037, 45),\n ('radius', 'R25.0078', (122.1352, 122.2199), 11.0922, 45),\n ('horizontal', '50.4212', (111.0963, 120.5833), (133.4607, 120.5833), (122.2785, 131.5833)),\n ('vertical', '79.8336', (133.4607, 120.5833), (133.4607, 85.173), (144.4607, 102.8781)),\n ('aligned', '80.4679', (115.5692, 85.173), (111.0963, 120.5833), (102.4195, 101.4996)),\n ('diameter', '%%c10.0842', (120.0421, 95.9824), 2.2364, 45),\n ('horizontal', '20.1685', (111.0963, 95.9824), (120.0421, 95.9824), (115.5692, 106.9824)),\n ('vertical', '55.4634', (120.0421, 120.5833), (120.0421, 95.9824), (131.0421, 108.2829)),\n ('radius', 'R25.4016', (122.2785, 121.9625), 11.2669, 135),\n ('radius', 'R15.241', (122.2785, 86.0005), 6.7602, 225),\n ('diameter', '%%c51.7141', (122.5653, 122.3992), 11.4689, 225),\n ('diameter', '%%c10.7738', (122.5653, 122.3992), 2.3894, 315),\n ('horizontal', '4.094', (174.2407, 166.8891), (172.4248, 166.8891), (173.3327, 155.8891)),\n ('horizontal', '4.094', (174.2407, 166.8891), (172.4248, 166.8891), (173.3327, 145.8891)),\n ('horizontal', '4.094', (174.2407, 167.4625), (172.4248, 167.4625), (173.3327, 156.4625)),\n ('horizontal', '4.094', (174.2407, 120.5833), (172.4248, 120.5833), (173.3327, 109.5833))\n]\n\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; _ds.dxf.dimasz = 2.5\n _ds.dxf.dimexe = 1.25; _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\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\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,\n angle=(0 if d[0] == \"horizontal\" else 90),\n 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,\n 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,\n 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,\n text=text, dimstyle=\"EZDXF\").render()\n\n doc.saveas(out_path)\n\n\nif __name__ == \"__main__\":\n out = sys.argv[1] if len(sys.argv) > 1 else \"0071_00719979_gt.dxf\"\n draw(out)\n print(\"wrote\", out)\n```"}], "images": ["images/0071_00719979.png"], "id": "0071_00719979"} {"messages": [{"role": "user", "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 60 mm tall. It is extruded to a thickness of 19.78 mm. A union feature: The part is a polygonal plate with 4 straight edges. It is extruded to a thickness of -7.69 mm. The outline includes one or more oblique (angled) edges. A union feature: The part is a circular plate with diameter 51.08 mm. It is extruded to a thickness of 40.66 mm."}, {"role": "assistant", "content": "```python\n#!/usr/bin/env python3\n# -*- coding: utf-8 -*-\n# Ground-truth 2D engineering drawing for part: 0072_00722662\n# Self-contained: reproduces the three-view DXF via ezdxf, NO FreeCAD needed.\n# Coordinates are A4 page millimetres (scale=0.5797519190509436, page=[297.0, 210.0]).\n# visible edges -> solid (layer OUTLINE); hidden edges -> dashed (layer HIDDEN)\n# dimensions -> real movable DIMENSION entities (text = true mm value)\n# Run: python 0072_00722662_gt.py [out.dxf]\nimport sys\nimport ezdxf\nimport math\n\nSCALE = 0.5797519190509436\nPAGE = [297.0, 210.0]\n\nVISIBLE_SEGMENTS = [\n (147.776493, 173.430577, 147.776493, 161.962956),\n (147.776493, 161.962956, 89.801301, 161.962956),\n (89.801301, 173.430577, 89.801301, 161.962956),\n (147.776493, 173.430577, 89.801301, 173.430577),\n (148.413583, 161.962956, 147.776493, 161.962956),\n (90.438391, 161.962956, 105.695021, 121.685454),\n (133.156954, 121.685454, 148.413583, 161.962956),\n (147.776493, 98.115692, 147.776493, 63.330577),\n (89.801301, 98.115692, 147.776493, 98.115692),\n (147.776493, 63.330577, 89.801301, 63.330577),\n (89.801301, 63.330577, 89.801301, 98.115692),\n (148.413583, 63.712831, 147.776493, 63.712831),\n (148.413583, 63.712831, 148.413583, 68.172461),\n (148.413583, 68.172461, 147.776493, 68.172461),\n (162.413583, 173.430577, 162.413583, 161.962956),\n (197.198699, 173.430577, 197.198699, 161.962956),\n (197.198699, 173.430577, 162.413583, 173.430577),\n (197.198699, 161.962956, 162.413583, 161.962956),\n (196.816445, 161.962956, 196.816445, 121.685454),\n (196.816445, 121.685454, 196.816445, 112.264953),\n (192.356814, 161.962956, 192.356814, 124.379931),\n (192.356814, 124.379931, 192.993904, 124.379931),\n (192.993904, 112.115692, 192.993904, 124.379931),\n (169.421574, 112.115692, 169.421574, 141.730318),\n (192.993904, 112.264953, 196.816445, 112.264953),\n (169.421574, 112.115692, 192.993904, 112.115692),\n (169.421574, 141.730318, 192.356814, 141.730318),\n (196.816445, 121.685454, 192.993904, 121.685454)\n]\nVISIBLE_CIRCLES = [\n (119.425987, 126.982073, 14.717119)\n]\nVISIBLE_ARCS = [\n (119.261685, 126.923005, 14.807313, -170.110738, -38.833214)\n]\nHIDDEN_SEGMENTS = [\n (130.7962, 117.638, 133.157, 121.6855),\n (105.695, 121.6855, 130.7962, 117.638),\n (90.4384, 63.7128, 90.4384, 68.1725),\n (104.6744, 68.1725, 104.6744, 67.5354),\n (130.7962, 68.1725, 130.7962, 67.5354),\n (130.7962, 67.5354, 104.6744, 67.5354),\n (134.069, 68.1725, 134.069, 91.1077),\n (134.069, 91.1077, 104.4544, 91.1077),\n (133.157, 68.1725, 90.4384, 68.1725),\n (104.4544, 91.1077, 104.4544, 68.1725),\n (192.3568, 117.638, 192.3568, 121.6855),\n (192.3568, 117.638, 192.9939, 117.638)\n]\n# (orient, text, p1, p2, base) for linear; (orient, text, center, radius, angle) for diameter\nDIMENSIONS = [\n ('aligned', '74.2907', (90.4384, 161.963), (105.695, 121.6855), (108.3535, 145.7207)),\n ('aligned', '74.2907', (133.157, 121.6855), (148.4136, 161.963), (130.4985, 145.7207)),\n ('radius', 'R25.3852', (119.426, 126.9821), 14.7171, 45),\n ('diameter', '%%c51.0816', (119.2617, 126.923), 14.8073, 135),\n ('vertical', '19.7802', (162.4136, 173.4306), (162.4136, 161.963), (173.4136, 167.6968)),\n ('horizontal', '7.6923', (196.8164, 161.963), (192.3568, 161.963), (194.5866, 150.963)),\n ('horizontal', '100', (147.7765, 63.3306), (89.8013, 63.3306), (118.7889, 52.3306)),\n ('vertical', '60', (147.7765, 98.1157), (147.7765, 63.3306), (158.7765, 80.7231))\n]\n\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; _ds.dxf.dimasz = 2.5\n _ds.dxf.dimexe = 1.25; _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\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\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,\n angle=(0 if d[0] == \"horizontal\" else 90),\n 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,\n 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,\n 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,\n text=text, dimstyle=\"EZDXF\").render()\n\n doc.saveas(out_path)\n\n\nif __name__ == \"__main__\":\n out = sys.argv[1] if len(sys.argv) > 1 else \"0072_00722662_gt.dxf\"\n draw(out)\n print(\"wrote\", out)\n```"}], "images": ["images/0072_00722662.png"], "id": "0072_00722662"} {"messages": [{"role": "user", "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 2 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 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. A union feature: The part is a polygonal plate with 2 straight edges, featuring a circular hole of diameter 10.34 mm. It is extruded to a thickness of 4.09 mm."}, {"role": "assistant", "content": "```python\n#!/usr/bin/env python3\n# -*- coding: utf-8 -*-\n# Ground-truth 2D engineering drawing for part: 0072_00724386\n# Self-contained: reproduces the three-view DXF via ezdxf, NO FreeCAD needed.\n# Coordinates are A4 page millimetres (scale=0.44532220377075304, page=[297.0, 210.0]).\n# visible edges -> solid (layer OUTLINE); hidden edges -> dashed (layer HIDDEN)\n# dimensions -> real movable DIMENSION entities (text = true mm value)\n# Run: python 0072_00724386_gt.py [out.dxf]\nimport sys\nimport ezdxf\nimport math\n\nSCALE = 0.44532220377075304\nPAGE = [297.0, 210.0]\n\nVISIBLE_SEGMENTS = [\n (133.111264, 117.970907, 129.176628, 86.8217),\n (115.485659, 85.089842, 110.994923, 120.641501),\n (110.994923, 123.376244, 115.216982, 167.707868),\n (122.06391, 173.5132, 122.365696, 173.5132),\n (122.605586, 173.5132, 151.772441, 172.524493),\n (153.743274, 161.374779, 135.271764, 160.847021),\n (129.99419, 154.513932, 132.710181, 127.806691),\n (122.833035, 173.484806, 122.735113, 173.487898),\n (110.994923, 63.41337, 115.216982, 63.41337),\n (115.216982, 63.41337, 116.284078, 63.41337),\n (116.284078, 63.41337, 121.933895, 63.41337),\n (121.933895, 63.41337, 122.06391, 63.41337),\n (122.06391, 63.41337, 122.365696, 63.41337),\n (122.365696, 63.41337, 122.605586, 63.41337),\n (122.605586, 63.41337, 151.772441, 63.41337),\n (158.512282, 63.41337, 151.772441, 63.41337),\n (110.994923, 65.236532, 115.216982, 65.236532),\n (115.216982, 65.236532, 116.284078, 65.236532),\n (116.284078, 65.236532, 121.933895, 65.236532),\n (121.933895, 65.236532, 122.06391, 65.236532),\n (122.06391, 65.236532, 122.365696, 65.236532),\n (122.365696, 65.236532, 122.605586, 65.236532),\n (122.605586, 65.236532, 151.772441, 65.236532),\n (151.772441, 65.236532, 158.512282, 65.236532),\n (151.772441, 65.236532, 151.772441, 63.41337),\n (122.605586, 63.41337, 122.605586, 65.236532),\n (115.216982, 63.41337, 115.216982, 65.236532),\n (110.994923, 63.41337, 110.994923, 65.236532),\n (122.365696, 63.41337, 122.365696, 65.236532),\n (121.933895, 63.41337, 121.933895, 65.236532),\n (158.512282, 65.236532, 158.512282, 63.41337),\n (116.284078, 65.236532, 116.284078, 63.41337),\n (122.06391, 65.236532, 122.06391, 63.41337),\n (172.512283, 85.089842, 172.512283, 79.236532),\n (174.335445, 79.236532, 174.335445, 85.089842),\n (174.335445, 85.089842, 174.335445, 120.641501),\n (174.335445, 123.376244, 174.335445, 120.641501),\n (174.335445, 123.376244, 174.335445, 167.707868),\n (174.335445, 167.707868, 174.335445, 173.5132),\n (174.335445, 173.5132, 174.335445, 173.51337),\n (172.512283, 85.089842, 172.512283, 120.641501),\n (172.512283, 120.641501, 172.512283, 123.376244),\n (172.512283, 123.376244, 172.512283, 167.707868),\n (172.512283, 167.707868, 172.512283, 173.5132),\n (172.512283, 173.5132, 172.512283, 173.51337),\n (174.335445, 85.089842, 172.512283, 85.089842),\n (174.335445, 167.707868, 172.512283, 167.707868),\n (174.335445, 123.376244, 172.512283, 123.376244),\n (174.335445, 120.641501, 172.512283, 120.641501),\n (174.335445, 173.5132, 172.512283, 173.5132),\n (172.512283, 79.236532, 174.335445, 79.236532),\n (172.512283, 173.51337, 174.335445, 173.51337)\n]\nVISIBLE_CIRCLES = [\n (119.976395, 95.942454, 2.245368),\n (122.461652, 86.001423, 2.302941),\n (122.50963, 122.464663, 2.398897),\n (152.985223, 167.132133, 2.187794),\n (121.933895, 166.604375, 2.302941),\n (122.461652, 86.001423, 6.764891),\n (152.985223, 167.132133, 5.52706),\n (122.50963, 122.464663, 11.514707)\n]\nVISIBLE_ARCS = [\n (122.221763, 85.920661, 6.787146, 102.496963, -172.96875),\n (122.221763, 122.0262, 11.311911, -172.96875, -54.812008),\n (122.50963, 122.464663, 11.514707, 167.258023, -57.240634),\n (122.077829, 122.284673, 11.136531, 165.864682, 174.375),\n (121.886081, 166.824429, 6.727358, 172.454102, 65.807821),\n (122.149796, 167.651457, 5.865717, 92.109375, 64.846998),\n (121.998903, 161.124016, 12.389354, 89.699364, 90.300636),\n (122.149796, 167.651457, 5.865717, 85.242114, 87.890625),\n (121.998903, 161.124016, 12.389354, 86.167739, 87.050854),\n (121.886081, 166.824429, 6.727358, 81.960387, 83.860352),\n (153.539171, 166.916232, 5.54521, -116.116874, -87.890625),\n (135.574547, 155.229169, 5.626006, 93.085054, -172.696196),\n (122.149796, 167.651457, 5.865717, 79.781132, 84.273146),\n (121.886081, 166.824429, 6.727358, 78.820309, 81.908077)\n]\nHIDDEN_SEGMENTS = [\n (120.7531, 65.2365, 120.7531, 63.4134),\n (129.1766, 65.2365, 129.1766, 63.4134),\n (133.1113, 65.2365, 133.1113, 63.4134),\n (132.7102, 65.2365, 132.7102, 63.4134),\n (129.9942, 63.4134, 129.9942, 65.2365),\n (135.2718, 63.4134, 135.2718, 65.2365),\n (153.7433, 63.4134, 153.7433, 65.2365),\n (151.0981, 65.2365, 151.0981, 63.4134),\n (123.1904, 65.2365, 123.1904, 63.4134),\n (124.6429, 65.2365, 124.6429, 63.4134),\n (128.7404, 65.2365, 128.7404, 63.4134),\n (124.7646, 63.4134, 124.7646, 65.2365),\n (124.9085, 63.4134, 124.9085, 65.2365),\n (155.173, 63.4134, 155.173, 65.2365),\n (124.2368, 63.4134, 124.2368, 65.2365),\n (129.2265, 65.2365, 129.2265, 63.4134),\n (134.0243, 65.2365, 134.0243, 63.4134),\n (129.9485, 65.2365, 129.9485, 63.4134),\n (128.6134, 65.2365, 128.6134, 63.4134),\n (117.731, 65.2365, 117.731, 63.4134),\n (120.1587, 65.2365, 120.1587, 63.4134),\n (120.1107, 65.2365, 120.1107, 63.4134),\n (150.7974, 65.2365, 150.7974, 63.4134),\n (128.0155, 65.2365, 128.0155, 63.4134),\n (119.631, 65.2365, 119.631, 63.4134),\n (172.5123, 92.547, 174.3354, 92.547),\n (172.5123, 86.8217, 174.3354, 86.8217),\n (172.5123, 117.9709, 174.3354, 117.9709),\n (172.5123, 127.8067, 174.3354, 127.8067),\n (174.3354, 154.5139, 172.5123, 154.5139),\n (174.3354, 160.847, 172.5123, 160.847),\n (174.3354, 161.3748, 172.5123, 161.3748),\n (172.5123, 161.9372, 174.3354, 161.9372),\n (172.5123, 172.5245, 174.3354, 172.5245),\n (172.5123, 172.961, 174.3354, 172.961),\n (172.5123, 125.0044, 174.3354, 125.0044),\n (172.5123, 112.7814, 174.3354, 112.7814),\n (172.5123, 161.371, 174.3354, 161.371),\n (172.5123, 161.6051, 174.3354, 161.6051),\n (172.5123, 172.6592, 174.3354, 172.6592),\n (172.5123, 160.0971, 174.3354, 160.0971),\n (172.5123, 110.95, 174.3354, 110.95),\n (172.5123, 110.7143, 174.3354, 110.7143),\n (172.5123, 93.6971, 174.3354, 93.6971),\n (172.5123, 98.1878, 174.3354, 98.1878),\n (172.5123, 83.6985, 174.3354, 83.6985),\n (172.5123, 88.3044, 174.3354, 88.3044),\n (172.5123, 120.0658, 174.3354, 120.0658),\n (172.5123, 124.8636, 174.3354, 124.8636),\n (172.5123, 164.9443, 174.3354, 164.9443),\n (172.5123, 169.3199, 174.3354, 169.3199),\n (172.5123, 161.7857, 174.3354, 161.7857),\n (172.5123, 164.3014, 174.3354, 164.3014),\n (172.5123, 168.9073, 174.3354, 168.9073)\n]\n# (orient, text, p1, p2, base) for linear; (orient, text, center, radius, angle) for diameter\nDIMENSIONS = [\n ('radius', 'R27.8211', (121.9989, 161.124), 12.3894, 45),\n ('diameter', '%%c30.382', (122.4616, 86.0014), 6.7649, 45),\n ('diameter', '%%c10.3428', (122.4616, 86.0014), 2.3029, 135),\n ('diameter', '%%c24.8227', (152.9852, 167.1321), 5.527, 45),\n ('diameter', '%%c9.8257', (152.9852, 167.1321), 2.1878, 135),\n ('horizontal', '50.4212', (110.9949, 120.6415), (133.4486, 120.6415), (122.2218, 131.6415)),\n ('vertical', '79.8336', (133.4486, 120.6415), (133.4486, 85.0898), (144.4486, 102.8657)),\n ('horizontal', '24.5642', (121.9339, 173.5132), (110.9949, 173.5132), (116.4644, 162.5132)),\n ('vertical', '118.727', (110.9949, 173.5132), (110.9949, 120.6415), (121.9949, 147.0774)),\n ('aligned', '80.4679', (115.4857, 85.0898), (110.9949, 120.6415), (102.327, 101.4872)),\n ('diameter', '%%c10.0842', (119.9764, 95.9424), 2.2454, 45),\n ('horizontal', '20.1685', (110.9949, 95.9424), (119.9764, 95.9424), (115.4857, 106.9424)),\n ('vertical', '55.4634', (119.9764, 120.6415), (119.9764, 95.9424), (130.9764, 108.292)),\n ('radius', 'R25.4016', (122.2218, 122.0262), 11.3119, 45),\n ('radius', 'R15.241', (122.2218, 85.9207), 6.7872, 225),\n ('diameter', '%%c51.7141', (122.5097, 122.4647), 11.5147, 135),\n ('diameter', '%%c10.7738', (122.5097, 122.4647), 2.3989, 225),\n ('horizontal', '95.9942', (110.9949, 173.5132), (153.7433, 173.5132), (132.3691, 184.5132)),\n ('vertical', '112.586', (153.7433, 173.5132), (153.7433, 123.3762), (164.7433, 148.4447)),\n ('horizontal', '24.5642', (121.9339, 173.5132), (110.9949, 173.5132), (116.4644, 162.5132)),\n ('vertical', '0', (110.9949, 173.5132), (110.9949, 173.5132), (110.9949, 173.5132)),\n ('aligned', '41.4959', (153.7433, 161.3748), (135.2718, 160.847), (144.8217, 150.1154)),\n ('aligned', '100', (110.9949, 123.3762), (115.217, 167.7079), (102.1555, 146.585)),\n ('radius', 'R15.1067', (121.8861, 166.8244), 6.7273, 45),\n ('radius', 'R12.4521', (153.5392, 166.9162), 5.5452, 45),\n ('radius', 'R12.6336', (135.5746, 155.2292), 5.626, 45),\n ('radius', 'R25.0078', (122.0778, 122.2847), 11.1365, 315),\n ('diameter', '%%c10.3428', (121.9339, 166.6044), 2.3029, 135),\n ('vertical', '15.5142', (121.9339, 173.5132), (121.9339, 166.6044), (132.9339, 170.0588)),\n ('radius', 'R13.1719', (122.1498, 167.6515), 5.8657, 45),\n ('horizontal', '4.094', (174.3354, 173.5132), (172.5123, 173.5132), (173.4239, 162.5132)),\n ('horizontal', '4.094', (174.3354, 86.0014), (172.5123, 86.0014), (173.4239, 75.0014)),\n ('horizontal', '4.094', (174.3354, 167.1321), (172.5123, 167.1321), (173.4239, 146.1321)),\n ('horizontal', '4.094', (174.3354, 120.6415), (172.5123, 120.6415), (173.4239, 109.6415)),\n ('horizontal', '4.094', (174.3354, 167.7079), (172.5123, 167.7079), (173.4239, 156.7079)),\n ('horizontal', '4.094', (174.3354, 173.5132), (172.5123, 173.5132), (173.4239, 162.5132))\n]\n\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; _ds.dxf.dimasz = 2.5\n _ds.dxf.dimexe = 1.25; _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\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\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,\n angle=(0 if d[0] == \"horizontal\" else 90),\n 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,\n 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,\n 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,\n text=text, dimstyle=\"EZDXF\").render()\n\n doc.saveas(out_path)\n\n\nif __name__ == \"__main__\":\n out = sys.argv[1] if len(sys.argv) > 1 else \"0072_00724386_gt.dxf\"\n draw(out)\n print(\"wrote\", out)\n```"}], "images": ["images/0072_00724386.png"], "id": "0072_00724386"} {"messages": [{"role": "user", "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.45 mm tall. It is extruded to a thickness of 1.05 mm. A cut feature: The part is a circular plate with diameter 2.08 mm. It is extruded to a thickness of -1.05 mm. A cut feature: The part is a circular plate with diameter 2.08 mm. It is extruded to a thickness of -1.05 mm."}, {"role": "assistant", "content": "```python\n#!/usr/bin/env python3\n# -*- coding: utf-8 -*-\n# Ground-truth 2D engineering drawing for part: 0073_00736409\n# Self-contained: reproduces the three-view DXF via ezdxf, NO FreeCAD needed.\n# Coordinates are A4 page millimetres (scale=1.4257098615176609, page=[297.0, 210.0]).\n# visible edges -> solid (layer OUTLINE); hidden edges -> dashed (layer HIDDEN)\n# dimensions -> real movable DIMENSION entities (text = true mm value)\n# Run: python 0073_00736409_gt.py [out.dxf]\nimport sys\nimport ezdxf\nimport math\n\nSCALE = 1.4257098615176609\nPAGE = [297.0, 210.0]\n\nVISIBLE_SEGMENTS = [\n (63.747025, 119.441963, 206.318011, 119.441963),\n (206.318011, 130.058951, 63.747025, 130.058951),\n (207.752061, 105.441962, 206.318011, 105.441962),\n (206.318011, 105.441962, 206.318011, 103.941049),\n (207.752061, 103.941049, 206.318011, 103.941049),\n (206.318011, 103.941049, 63.747025, 103.941049),\n (63.747025, 105.441962, 63.747025, 103.941049),\n (206.318011, 105.441962, 63.747025, 105.441962),\n (63.747025, 105.441962, 62.312975, 105.441962),\n (63.747025, 103.941049, 62.312975, 103.941049),\n (207.752061, 103.941049, 207.752061, 105.441962),\n (62.312975, 103.941049, 62.312975, 105.441962),\n (221.752061, 119.441963, 223.252975, 119.441963),\n (221.752061, 130.058951, 223.252975, 130.058951),\n (221.752061, 130.058951, 221.752061, 119.441963),\n (223.252975, 130.058951, 223.252975, 119.441963)\n]\nVISIBLE_CIRCLES = [\n (68.265565, 125.445617, 1.485114),\n (201.846869, 125.445617, 1.485114)\n]\nVISIBLE_ARCS = [\n (197.209679, 124.750457, 10.542382, -30.234375, 30.234375),\n (72.855357, 124.750457, 10.542382, 149.765625, -149.765625)\n]\nHIDDEN_SEGMENTS = [\n (69.7507, 103.941, 69.7507, 105.442),\n (203.332, 103.941, 203.332, 105.442),\n (66.7805, 105.442, 66.7805, 103.941),\n (200.3618, 105.442, 200.3618, 103.941),\n (221.7521, 123.9605, 223.253, 123.9605),\n (221.7521, 126.9307, 223.253, 126.9307)\n]\n# (orient, text, p1, p2, base) for linear; (orient, text, center, radius, angle) for diameter\nDIMENSIONS = [\n ('horizontal', '100', (206.318, 130.059), (63.747, 130.059), (135.0325, 119.059)),\n ('vertical', '7.4468', (206.318, 119.442), (206.318, 130.059), (195.318, 124.7505)),\n ('radius', 'R7.3945', (197.2097, 124.7505), 10.5424, 45),\n ('diameter', '%%c2.0833', (201.8468, 125.4457), 1.4851, 45),\n ('horizontal', '96.8639', (63.747, 119.442), (201.8468, 119.442), (132.7969, 130.442)),\n ('vertical', '4.211', (201.8468, 119.442), (201.8468, 125.4457), (190.8468, 122.4438)),\n ('diameter', '%%c2.0833', (68.2655, 125.4457), 1.4851, 45),\n ('horizontal', '3.1693', (63.747, 119.442), (68.2655, 119.442), (66.0063, 130.442)),\n ('vertical', '4.211', (68.2655, 119.442), (68.2655, 125.4457), (57.2655, 122.4438)),\n ('horizontal', '1.0527', (221.7521, 119.442), (223.2529, 119.442), (222.5025, 130.442)),\n ('horizontal', '1.0527', (223.2529, 125.4457), (221.7521, 125.4457), (222.5025, 114.4457)),\n ('horizontal', '1.0527', (223.2529, 125.4457), (221.7521, 125.4457), (222.5025, 104.4457))\n]\n\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; _ds.dxf.dimasz = 2.5\n _ds.dxf.dimexe = 1.25; _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\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\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,\n angle=(0 if d[0] == \"horizontal\" else 90),\n 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,\n 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,\n 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,\n text=text, dimstyle=\"EZDXF\").render()\n\n doc.saveas(out_path)\n\n\nif __name__ == \"__main__\":\n out = sys.argv[1] if len(sys.argv) > 1 else \"0073_00736409_gt.dxf\"\n draw(out)\n print(\"wrote\", out)\n```"}], "images": ["images/0073_00736409.png"], "id": "0073_00736409"} {"messages": [{"role": "user", "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, featuring a rectangular cutout 53.26 x 89.13 mm. It is extruded to a thickness of 431 mm. The outline includes one or more oblique (angled) edges. A cut feature: The part is a circular plate with diameter 17.77 mm. It is extruded to a thickness of -71.83 mm."}, {"role": "assistant", "content": "```python\n#!/usr/bin/env python3\n# -*- coding: utf-8 -*-\n# Ground-truth 2D engineering drawing for part: 0073_00738052\n# Self-contained: reproduces the three-view DXF via ezdxf, NO FreeCAD needed.\n# Coordinates are A4 page millimetres (scale=0.1787828380517002, page=[297.0, 210.0]).\n# visible edges -> solid (layer OUTLINE); hidden edges -> dashed (layer HIDDEN)\n# dimensions -> real movable DIMENSION entities (text = true mm value)\n# Run: python 0073_00738052_gt.py [out.dxf]\nimport sys\nimport ezdxf\nimport math\n\nSCALE = 0.1787828380517002\nPAGE = [297.0, 210.0]\n\nVISIBLE_SEGMENTS = [\n (91.656431, 171.467013, 91.656431, 153.588729),\n (92.239419, 153.005741, 103.70484, 153.005741),\n (104.287827, 153.588729, 104.287827, 171.467013),\n (103.70484, 172.05, 92.239419, 172.05),\n (93.211065, 170.495367, 93.211065, 154.560375),\n (102.733194, 170.495367, 93.211065, 170.495367),\n (102.733194, 154.560375, 102.733194, 170.495367),\n (93.211065, 154.560375, 102.733194, 154.560375),\n (91.656431, 139.005741, 91.656431, 61.95),\n (104.287827, 139.005741, 103.70484, 139.005741),\n (103.70484, 139.005741, 92.239419, 139.005741),\n (92.239419, 139.005741, 91.656431, 139.005741),\n (104.287827, 61.95, 103.70484, 61.95),\n (103.70484, 61.95, 92.239419, 61.95),\n (92.239419, 61.95, 91.656431, 61.95),\n (104.287827, 139.005741, 104.287827, 61.95),\n (92.239419, 139.005741, 92.239419, 61.95),\n (103.70484, 139.005741, 103.70484, 61.95),\n (118.287828, 153.588729, 118.287828, 153.005741),\n (118.287828, 153.005741, 195.343569, 153.005741),\n (195.343569, 153.588729, 195.343569, 153.005741),\n (195.343569, 171.467013, 195.343569, 153.588729),\n (118.287828, 171.467013, 118.287828, 153.588729),\n (118.287828, 172.05, 118.287828, 171.467013),\n (195.343569, 172.05, 195.343569, 171.467013),\n (118.287828, 172.05, 195.343569, 172.05),\n (118.287828, 153.588729, 195.343569, 153.588729),\n (118.287828, 171.467013, 195.343569, 171.467013)\n]\nVISIBLE_CIRCLES = [\n (156.815698, 163.237595, 1.58843)\n]\nVISIBLE_ARCS = [\n (92.239419, 153.588729, 0.582988, -180.0, -90.0),\n (103.70484, 153.588729, 0.582988, -90.0, -0.0),\n (103.70484, 171.467013, 0.582988, 0.0, 90.0),\n (92.239419, 171.467013, 0.582988, 90.0, -180.0)\n]\nHIDDEN_SEGMENTS = [\n (93.2111, 164.826, 91.6564, 164.826),\n (104.2878, 164.826, 102.7332, 164.826),\n (91.6564, 161.6492, 93.2111, 161.6492),\n (102.7332, 161.6492, 104.2878, 161.6492),\n (93.2111, 139.0057, 93.2111, 61.95),\n (102.7332, 139.0057, 102.7332, 61.95),\n (91.6564, 98.8894, 93.2111, 98.8894),\n (91.6564, 102.0663, 93.2111, 102.0663),\n (102.7332, 98.8894, 104.2878, 98.8894),\n (102.7332, 102.0663, 104.2878, 102.0663),\n (118.2878, 170.4954, 195.3436, 170.4954),\n (118.2878, 154.5604, 195.3436, 154.5604)\n]\n# (orient, text, p1, p2, base) for linear; (orient, text, center, radius, angle) for diameter\nDIMENSIONS = [\n ('horizontal', '64.1304', (92.2394, 153.0057), (103.7048, 153.0057), (97.9721, 164.0057)),\n ('vertical', '100', (104.2878, 153.5887), (104.2878, 171.467), (93.2878, 162.5279)),\n ('horizontal', '8.6957', (93.2111, 154.5604), (102.7332, 154.5604), (97.9721, 165.5604)),\n ('horizontal', '8.6957', (91.6564, 154.5604), (93.2111, 154.5604), (92.4337, 165.5604)),\n ('radius', 'R3.2609', (92.2394, 153.5887), 0.583, 45),\n ('horizontal', '431.002', (118.2878, 153.5887), (195.3436, 153.5887), (156.8157, 164.5887)),\n ('diameter', '%%c17.7694', (156.8157, 163.2376), 1.5884, 45)\n]\n\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; _ds.dxf.dimasz = 2.5\n _ds.dxf.dimexe = 1.25; _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\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\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,\n angle=(0 if d[0] == \"horizontal\" else 90),\n 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,\n 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,\n 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,\n text=text, dimstyle=\"EZDXF\").render()\n\n doc.saveas(out_path)\n\n\nif __name__ == \"__main__\":\n out = sys.argv[1] if len(sys.argv) > 1 else \"0073_00738052_gt.dxf\"\n draw(out)\n print(\"wrote\", out)\n```"}], "images": ["images/0073_00738052.png"], "id": "0073_00738052"} {"messages": [{"role": "user", "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 55.79 mm wide and 100 mm tall. It is extruded to a thickness of 34.96 mm. A union feature: The part is a circular plate with diameter 56.69 mm, featuring a circular hole of diameter 35.43 mm. It is extruded to a thickness of 69.92 mm. A union feature: The part is a polygonal plate with 3 straight edges. It is extruded to a thickness of 1.63 mm. The outline includes one or more oblique (angled) edges. A union feature: The part is a polygonal plate with 3 straight edges. It is extruded to a thickness of -1.63 mm. The outline includes one or more oblique (angled) edges."}, {"role": "assistant", "content": "```python\n#!/usr/bin/env python3\n# -*- coding: utf-8 -*-\n# Ground-truth 2D engineering drawing for part: 0074_00741880\n# Self-contained: reproduces the three-view DXF via ezdxf, NO FreeCAD needed.\n# Coordinates are A4 page millimetres (scale=0.48273084859427945, page=[297.0, 210.0]).\n# visible edges -> solid (layer OUTLINE); hidden edges -> dashed (layer HIDDEN)\n# dimensions -> real movable DIMENSION entities (text = true mm value)\n# Run: python 0074_00741880_gt.py [out.dxf]\nimport sys\nimport ezdxf\nimport math\n\nSCALE = 0.48273084859427945\nPAGE = [297.0, 210.0]\n\nVISIBLE_SEGMENTS = [\n (139.693418, 109.929129, 139.693418, 155.176761),\n (139.693418, 109.929129, 122.817462, 109.929129),\n (122.817462, 109.929129, 122.817462, 155.176761),\n (122.817462, 155.176761, 139.693418, 155.176761),\n (139.693418, 155.176761, 139.693418, 158.594678),\n (139.693418, 158.594678, 139.693418, 172.277216),\n (105.941505, 158.594678, 105.941505, 172.277216),\n (105.941505, 144.91214, 105.941505, 158.594678),\n (108.936493, 144.919416, 122.817462, 144.919416),\n (108.936493, 144.919416, 122.817462, 126.34629),\n (105.941505, 144.91214, 108.941932, 144.91214),\n (105.941505, 172.277216, 139.693418, 172.277216),\n (139.693418, 68.564053, 139.693418, 95.929129),\n (105.941505, 68.564053, 105.941505, 95.929129),\n (139.693418, 68.564053, 105.941505, 68.564053),\n (105.941505, 95.929129, 139.693418, 95.929129),\n (180.624718, 109.929129, 180.624718, 155.176761),\n (153.693419, 158.202214, 153.693419, 109.929129),\n (153.693419, 109.929129, 180.624718, 109.929129),\n (167.822126, 126.34629, 166.25227, 126.34629),\n (166.25227, 144.95836, 166.25227, 126.34629),\n (167.822126, 144.919416, 167.822126, 126.34629)\n]\nVISIBLE_CIRCLES = [\n (167.375957, 158.594678, 13.682538),\n (167.375957, 158.594678, 8.551586)\n]\nVISIBLE_ARCS = [\n (167.159068, 158.202214, 13.46565, -87.177575, -57.021199),\n (167.159068, 158.202214, 13.46565, -180.0, -93.861313)\n]\nHIDDEN_SEGMENTS = [\n (122.8175, 146.9063, 139.6934, 146.9063),\n (123.3545, 144.7366, 123.3545, 144.7671),\n (139.6934, 158.2022, 122.8175, 158.2022),\n (123.3545, 144.7671, 123.3545, 144.9584),\n (123.3545, 144.9121, 123.3545, 144.9194),\n (123.3545, 144.9194, 123.3545, 144.9584),\n (123.3545, 144.7529, 123.3545, 144.9121),\n (123.3545, 144.9121, 139.6934, 144.9121),\n (123.3545, 144.7366, 139.6934, 144.7366),\n (105.9415, 150.0431, 139.6934, 150.0431),\n (105.9415, 167.1463, 139.6934, 167.1463),\n (122.8175, 75.1337, 139.6934, 75.1337),\n (108.9074, 83.3703, 123.3545, 83.3703),\n (108.9365, 81.8004, 108.9074, 83.3703),\n (108.9365, 81.8004, 123.3545, 81.8004),\n (123.3545, 81.8004, 123.3545, 83.3703),\n (122.8175, 95.9291, 122.8175, 68.9978),\n (139.6934, 73.695, 105.9415, 73.695),\n (105.9415, 90.7982, 139.6934, 90.7982),\n (181.0585, 158.5947, 174.4888, 146.9063),\n (174.4888, 146.9063, 153.6934, 158.2022),\n (180.6247, 155.1768, 174.4888, 146.9063)\n]\n# (orient, text, p1, p2, base) for linear; (orient, text, center, radius, angle) for diameter\nDIMENSIONS = [\n ('radius', 'R27.8947', (167.1591, 158.2022), 13.4656, 45),\n ('diameter', '%%c56.6881', (167.376, 158.5947), 13.6825, 135),\n ('diameter', '%%c35.43', (167.376, 158.5947), 8.5516, 225),\n ('horizontal', '34.9593', (139.6934, 68.9978), (122.8175, 68.9978), (131.2555, 57.9978)),\n ('horizontal', '34.9593', (139.6934, 82.2466), (105.9415, 82.2466), (122.8175, 71.2466))\n]\n\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; _ds.dxf.dimasz = 2.5\n _ds.dxf.dimexe = 1.25; _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\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\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,\n angle=(0 if d[0] == \"horizontal\" else 90),\n 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,\n 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,\n 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,\n text=text, dimstyle=\"EZDXF\").render()\n\n doc.saveas(out_path)\n\n\nif __name__ == \"__main__\":\n out = sys.argv[1] if len(sys.argv) > 1 else \"0074_00741880_gt.dxf\"\n draw(out)\n print(\"wrote\", out)\n```"}], "images": ["images/0074_00741880.png"], "id": "0074_00741880"} {"messages": [{"role": "user", "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 77.89 mm tall. It is extruded to a thickness of 44.79 mm. A cut feature: The part is a rectangular plate 78.12 mm wide and 55.92 mm tall. It is extruded to a thickness of -44.79 mm. A cut feature: The part is a polygonal plate with 4 straight edges. It is extruded to a thickness of -44.79 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 -44.79 mm. A cut feature: The part is a polygonal plate with 2 straight edges. It is extruded to a thickness of -44.79 mm."}, {"role": "assistant", "content": "```python\n#!/usr/bin/env python3\n# -*- coding: utf-8 -*-\n# Ground-truth 2D engineering drawing for part: 0074_00742953\n# Self-contained: reproduces the three-view DXF via ezdxf, NO FreeCAD needed.\n# Coordinates are A4 page millimetres (scale=0.7832978818482879, page=[297.0, 210.0]).\n# visible edges -> solid (layer OUTLINE); hidden edges -> dashed (layer HIDDEN)\n# dimensions -> real movable DIMENSION entities (text = true mm value)\n# Run: python 0074_00742953_gt.py [out.dxf]\nimport sys\nimport ezdxf\nimport math\n\nSCALE = 0.7832978818482879\nPAGE = [297.0, 210.0]\n\nVISIBLE_SEGMENTS = [\n (114.877715, 132.657503, 114.877715, 149.792144),\n (114.877715, 132.657503, 79.792497, 132.657503),\n (79.792497, 132.657503, 79.792497, 149.792144),\n (79.792497, 149.792144, 114.877715, 149.792144),\n (114.877715, 193.594986, 114.877715, 149.792144),\n (114.877715, 193.594986, 114.877715, 193.672285),\n (79.792497, 193.594986, 79.792497, 149.792144),\n (79.792497, 193.594986, 79.792497, 193.672285),\n (114.877715, 193.672285, 79.792497, 193.672285),\n (79.792497, 193.594986, 114.877715, 193.594986),\n (88.767785, 193.594986, 88.767785, 179.362037),\n (105.902426, 176.718009, 105.902426, 176.984261),\n (105.902426, 177.259103, 105.902426, 193.594986),\n (114.877715, 40.327715, 114.877715, 118.657503),\n (79.792497, 40.327715, 79.792497, 118.657503),\n (114.877715, 118.657503, 105.902426, 118.657503),\n (105.902426, 118.657503, 94.714648, 118.657503),\n (88.767785, 118.657503, 94.714648, 118.657503),\n (88.767785, 118.657503, 79.792497, 118.657503),\n (114.877715, 40.327715, 79.792497, 40.327715),\n (88.767785, 101.522862, 88.767785, 118.657503),\n (105.902426, 101.522862, 88.767785, 101.522862),\n (105.902426, 118.657503, 105.902426, 101.522862),\n (94.714648, 118.657503, 94.714648, 101.522862),\n (207.207503, 132.657503, 207.207503, 149.792144),\n (146.012356, 149.792144, 207.207503, 149.792144),\n (128.877715, 132.657503, 207.207503, 132.657503),\n (146.012356, 193.594986, 146.012356, 149.792144),\n (207.207503, 193.594986, 146.012356, 193.594986),\n (207.207503, 193.594986, 207.207503, 193.672285),\n (207.207503, 193.672285, 128.877715, 193.672285),\n (128.877715, 193.672285, 128.877715, 132.657503)\n]\nVISIBLE_CIRCLES = [\n\n]\nVISIBLE_ARCS = [\n (97.095036, 176.443167, 8.823996, 160.683409, -3.515625),\n (99.261934, 176.310041, 6.653013, -3.515625, 3.515625),\n (97.095036, 176.443167, 8.823996, 3.515625, 105.650171),\n (97.341747, 176.77824, 8.574174, 3.214989, 107.842221)\n]\nHIDDEN_SEGMENTS = [\n (128.8777, 179.362, 146.0124, 179.362),\n (146.0124, 176.718, 128.8777, 176.718),\n (146.0124, 176.9843, 128.8777, 176.9843),\n (128.8777, 184.94, 146.0124, 184.94),\n (146.0124, 177.2591, 128.8777, 177.2591),\n (128.8777, 167.6192, 146.0124, 167.6192),\n (128.8777, 185.2672, 146.0124, 185.2672),\n (128.8777, 185.3524, 146.0124, 185.3524)\n]\n# (orient, text, p1, p2, base) for linear; (orient, text, center, radius, angle) for diameter\nDIMENSIONS = [\n ('horizontal', '21.875', (88.7678, 176.718), (105.9025, 176.718), (97.3351, 187.718)),\n ('radius', 'R10.9462', (97.3417, 176.7782), 8.5741, 45),\n ('radius', 'R8.4936', (99.262, 176.3101), 6.653, 45),\n ('radius', 'R11.2652', (97.0951, 176.4431), 8.824, 135),\n ('horizontal', '100', (207.2075, 193.6723), (128.8777, 193.6723), (168.0426, 182.6723)),\n ('vertical', '77.8947', (207.2075, 132.6575), (207.2075, 193.6723), (196.2075, 163.1649)),\n ('horizontal', '21.875', (146.0124, 149.7921), (207.2075, 149.7921), (176.6099, 160.7921)),\n ('vertical', '3.3755', (207.2075, 149.7921), (207.2075, 193.595), (196.2075, 171.6936)),\n ('horizontal', '21.875', (128.8777, 132.6575), (146.0124, 132.6575), (137.445, 143.6575)),\n ('vertical', '10.1568', (146.0124, 132.6575), (146.0124, 149.7921), (135.0124, 141.2248)),\n ('horizontal', '44.7917', (114.8777, 40.3277), (79.7925, 40.3277), (97.3351, 29.3277)),\n ('horizontal', '44.7917', (79.7925, 40.3277), (114.8777, 40.3277), (97.3351, 51.3277))\n]\n\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; _ds.dxf.dimasz = 2.5\n _ds.dxf.dimexe = 1.25; _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\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\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,\n angle=(0 if d[0] == \"horizontal\" else 90),\n 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,\n 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,\n 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,\n text=text, dimstyle=\"EZDXF\").render()\n\n doc.saveas(out_path)\n\n\nif __name__ == \"__main__\":\n out = sys.argv[1] if len(sys.argv) > 1 else \"0074_00742953_gt.dxf\"\n draw(out)\n print(\"wrote\", out)\n```"}], "images": ["images/0074_00742953.png"], "id": "0074_00742953"} {"messages": [{"role": "user", "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 2 straight edges. It is extruded to a thickness of 62.16 mm. A union feature: The part is a rectangular plate 40.54 mm wide and 34.14 mm tall. It is extruded to a thickness of 24.32 mm."}, {"role": "assistant", "content": "```python\n#!/usr/bin/env python3\n# -*- coding: utf-8 -*-\n# Ground-truth 2D engineering drawing for part: 0075_00757970\n# Self-contained: reproduces the three-view DXF via ezdxf, NO FreeCAD needed.\n# Coordinates are A4 page millimetres (scale=0.5153188405797114, page=[297.0, 210.0]).\n# visible edges -> solid (layer OUTLINE); hidden edges -> dashed (layer HIDDEN)\n# dimensions -> real movable DIMENSION entities (text = true mm value)\n# Run: python 0075_00757970_gt.py [out.dxf]\nimport sys\nimport ezdxf\nimport math\n\nSCALE = 0.5153188405797114\nPAGE = [297.0, 210.0]\n\nVISIBLE_SEGMENTS = [\n (100.114312, 172.05, 100.114312, 154.823837),\n (100.114312, 154.823837, 100.114312, 137.231159),\n (100.114312, 137.231159, 100.114312, 120.518116),\n (100.114312, 137.231159, 121.005616, 137.231159),\n (121.005616, 137.231159, 121.005616, 154.823837),\n (121.005616, 154.823837, 100.114312, 154.823837),\n (125.880254, 106.518116, 100.114312, 106.518116),\n (100.114312, 106.518116, 100.114312, 74.484783),\n (125.880254, 74.484783, 100.114312, 74.484783),\n (100.114312, 74.484783, 100.114312, 61.95),\n (121.005616, 74.484783, 121.005616, 61.95),\n (121.005616, 61.95, 100.114312, 61.95),\n (125.880254, 74.484783, 125.880254, 106.518116),\n (139.880254, 172.05, 171.913587, 172.05),\n (171.913587, 120.518116, 171.913587, 137.231159),\n (171.913587, 154.823837, 171.913587, 172.05),\n (139.880254, 120.518116, 171.913587, 120.518116),\n (171.913587, 154.823837, 184.44837, 154.823837),\n (184.44837, 154.823837, 184.44837, 137.231159),\n (171.913587, 137.231159, 184.44837, 137.231159),\n (139.880254, 172.05, 139.880254, 120.518116)\n]\nVISIBLE_CIRCLES = [\n\n]\nVISIBLE_ARCS = [\n (100.114312, 146.284058, 25.765942, -90.0, 90.0)\n]\nHIDDEN_SEGMENTS = [\n\n]\n# (orient, text, p1, p2, base) for linear; (orient, text, center, radius, angle) for diameter\nDIMENSIONS = [\n ('vertical', '100', (100.1143, 120.5181), (100.1143, 172.05), (89.1143, 146.2841)),\n ('radius', 'R50', (100.1143, 146.2841), 25.7659, 45),\n ('horizontal', '40.5405', (100.1143, 137.2312), (121.0056, 137.2312), (110.56, 148.2312)),\n ('vertical', '34.1394', (121.0056, 137.2312), (121.0056, 154.8238), (110.0056, 146.0275)),\n ('vertical', '32.4324', (100.1143, 120.5181), (100.1143, 137.2312), (89.1143, 128.8747)),\n ('horizontal', '62.1622', (139.8803, 120.5181), (171.9136, 120.5181), (155.8969, 131.5181)),\n ('horizontal', '24.3243', (171.9136, 137.2312), (184.4484, 137.2312), (178.181, 148.2312))\n]\n\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; _ds.dxf.dimasz = 2.5\n _ds.dxf.dimexe = 1.25; _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\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\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,\n angle=(0 if d[0] == \"horizontal\" else 90),\n 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,\n 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,\n 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,\n text=text, dimstyle=\"EZDXF\").render()\n\n doc.saveas(out_path)\n\n\nif __name__ == \"__main__\":\n out = sys.argv[1] if len(sys.argv) > 1 else \"0075_00757970_gt.dxf\"\n draw(out)\n print(\"wrote\", out)\n```"}], "images": ["images/0075_00757970.png"], "id": "0075_00757970"} {"messages": [{"role": "user", "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, featuring 5 circular holes (diameters 16.56, 27.6, 264.98 mm). It is extruded to a thickness of 9.56 mm. The outline includes one or more oblique (angled) edges. A union feature: The part is a polygonal plate with 9 straight edges, featuring a circular hole of diameter 16.22 mm. It is extruded to a thickness of 9.56 mm. The outline includes one or more oblique (angled) edges."}, {"role": "assistant", "content": "```python\n#!/usr/bin/env python3\n# -*- coding: utf-8 -*-\n# Ground-truth 2D engineering drawing for part: 0077_00771692\n# Self-contained: reproduces the three-view DXF via ezdxf, NO FreeCAD needed.\n# Coordinates are A4 page millimetres (scale=0.3500401110122153, page=[297.0, 210.0]).\n# visible edges -> solid (layer OUTLINE); hidden edges -> dashed (layer HIDDEN)\n# dimensions -> real movable DIMENSION entities (text = true mm value)\n# Run: python 0077_00771692_gt.py [out.dxf]\nimport sys\nimport ezdxf\nimport math\n\nSCALE = 0.3500401110122153\nPAGE = [297.0, 210.0]\n\nVISIBLE_SEGMENTS = [\n (106.80748, 117.943743, 106.80748, 144.996871),\n (115.503129, 153.69252, 115.551805, 153.69252),\n (107.043994, 145.515188, 107.043994, 117.606585),\n (107.043994, 117.606585, 118.396646, 110.984204),\n (116.99967, 109.248094, 115.503129, 109.248094),\n (143.522441, 109.248094, 143.468516, 109.248094),\n (151.981576, 117.606585, 151.981576, 152.610596),\n (150.562494, 154.029678, 150.214314, 154.029678),\n (152.218089, 152.726337, 152.218089, 117.943743),\n (176.372668, 71.093515, 83.619084, 71.093515),\n (176.372668, 71.093515, 176.372668, 67.747099),\n (176.372668, 67.747099, 83.619084, 67.747099),\n (83.619084, 67.747099, 83.619084, 71.093515),\n (190.372669, 177.847099, 190.372669, 85.093515),\n (193.719084, 177.847099, 193.719084, 85.093515),\n (193.719084, 177.847099, 190.372669, 177.847099),\n (193.719084, 85.093515, 190.372669, 85.093515)\n]\nVISIBLE_CIRCLES = [\n (129.995876, 131.470307, 46.376792),\n (129.995876, 96.687713, 4.830916),\n (100.044198, 131.470307, 2.89855),\n (158.981371, 131.470307, 2.89855),\n (129.995876, 166.252901, 4.830916),\n (129.749298, 131.324373, 2.838163)\n]\nVISIBLE_ARCS = [\n (106.80748, 153.69252, 8.695649, 0.0, -90.0),\n (107.043994, 154.029678, 8.514489, -90.0, -2.269398),\n (116.03151, 111.457232, 2.411975, -66.334446, -11.309932),\n (106.80748, 109.248094, 8.695649, 90.0, -0.0),\n (151.981576, 109.092096, 8.514489, 90.0, 178.950196),\n (151.981576, 154.029678, 1.419082, -180.0, -90.0),\n (151.734998, 154.175611, 1.52767, -71.565051, -174.518339),\n (152.218089, 109.248094, 8.695649, -180.0, 90.0)\n]\nHIDDEN_SEGMENTS = [\n (134.8268, 71.0935, 134.8268, 67.7471),\n (102.9427, 71.0935, 102.9427, 67.7471),\n (106.8075, 71.0935, 106.8075, 67.7471),\n (115.5031, 71.0935, 115.5031, 67.7471),\n (116.9997, 67.7471, 116.9997, 71.0935),\n (143.5224, 71.0935, 143.5224, 67.7471),\n (143.4685, 67.7471, 143.4685, 71.0935),\n (152.2181, 71.0935, 152.2181, 67.7471),\n (150.2143, 67.7471, 150.2143, 71.0935),\n (115.5518, 67.7471, 115.5518, 71.0935),\n (161.8799, 71.0935, 161.8799, 67.7471),\n (118.3966, 71.0935, 118.3966, 67.7471),\n (151.9816, 71.0935, 151.9816, 67.7471),\n (150.5625, 71.0935, 150.5625, 67.7471),\n (107.044, 71.0935, 107.044, 67.7471),\n (132.5875, 71.0935, 132.5875, 67.7471),\n (125.165, 67.7471, 125.165, 71.0935),\n (97.1456, 67.7471, 97.1456, 71.0935),\n (98.1118, 67.7471, 98.1118, 71.0935),\n (160.9137, 67.7471, 160.9137, 71.0935),\n (153.2627, 67.7471, 153.2627, 71.0935),\n (150.2073, 67.7471, 150.2073, 71.0935),\n (156.0828, 67.7471, 156.0828, 71.0935),\n (126.9111, 67.7471, 126.9111, 71.0935),\n (190.3727, 117.9437, 193.7191, 117.9437),\n (190.3727, 144.9969, 193.7191, 144.9969),\n (190.3727, 109.2481, 193.7191, 109.2481),\n (190.3727, 152.7263, 193.7191, 152.7263),\n (193.7191, 154.0297, 190.3727, 154.0297),\n (190.3727, 153.6925, 193.7191, 153.6925),\n (190.3727, 110.9842, 193.7191, 110.9842),\n (190.3727, 117.6066, 193.7191, 117.6066),\n (190.3727, 145.5152, 193.7191, 145.5152),\n (190.3727, 152.6106, 193.7191, 152.6106),\n (193.7191, 101.5186, 190.3727, 101.5186),\n (193.7191, 91.8568, 190.3727, 91.8568),\n (193.7191, 134.3689, 190.3727, 134.3689),\n (193.7191, 128.5718, 190.3727, 128.5718),\n (193.7191, 100.5524, 190.3727, 100.5524),\n (193.7191, 155.7033, 190.3727, 155.7033),\n (193.7191, 162.3882, 190.3727, 162.3882),\n (193.7191, 171.0838, 190.3727, 171.0838),\n (193.7191, 161.422, 190.3727, 161.422),\n (193.7191, 134.1625, 190.3727, 134.1625),\n (193.7191, 128.4862, 190.3727, 128.4862)\n]\n# (orient, text, p1, p2, base) for linear; (orient, text, center, radius, angle) for diameter\nDIMENSIONS = [\n ('horizontal', '80.046', (143.5224, 109.2481), (115.5031, 109.2481), (129.5128, 98.2481)),\n ('vertical', '77.2858', (106.8075, 117.9437), (106.8075, 144.9969), (95.8075, 131.4703)),\n ('vertical', '99.3675', (152.2181, 152.7264), (152.2181, 117.9437), (163.2181, 135.335)),\n ('diameter', '%%c264.98', (129.9959, 131.4703), 46.3768, 45),\n ('horizontal', '66.245', (106.8075, 131.4703), (129.9959, 131.4703), (118.4017, 142.4703)),\n ('vertical', '63.4848', (129.9959, 109.2481), (129.9959, 131.4703), (118.9959, 120.3592)),\n ('diameter', '%%c16.5612', (100.0442, 131.4703), 2.8985, 45),\n ('horizontal', '19.3214', (106.8075, 131.4703), (100.0442, 131.4703), (103.4258, 120.4703)),\n ('vertical', '63.4848', (100.0442, 109.2481), (100.0442, 131.4703), (89.0442, 120.3592)),\n ('diameter', '%%c27.6021', (129.9959, 96.6877), 4.8309, 45),\n ('horizontal', '66.245', (106.8075, 96.6877), (129.9959, 96.6877), (118.4017, 107.6877)),\n ('vertical', '35.8827', (129.9959, 109.2481), (129.9959, 96.6877), (140.9959, 102.9679)),\n ('diameter', '%%c27.6021', (129.9959, 166.2529), 4.8309, 45),\n ('horizontal', '66.245', (106.8075, 166.2529), (129.9959, 166.2529), (118.4017, 177.2529)),\n ('vertical', '162.852', (129.9959, 109.2481), (129.9959, 166.2529), (118.9959, 137.7505)),\n ('diameter', '%%c16.5612', (158.9814, 131.4703), 2.8985, 45),\n ('horizontal', '149.051', (106.8075, 131.4703), (158.9814, 131.4703), (132.8944, 142.4703)),\n ('vertical', '63.4848', (158.9814, 109.2481), (158.9814, 131.4703), (147.9814, 120.3592)),\n ('radius', 'R24.8419', (106.8075, 153.6925), 8.6957, 45),\n ('radius', 'R4.3643', (151.735, 154.1756), 1.5277, 45),\n ('horizontal', '128.378', (107.044, 109.0921), (151.9816, 109.0921), (129.5128, 120.0921)),\n ('vertical', '128.378', (151.9816, 109.0921), (151.9816, 154.0297), (140.9816, 131.5609)),\n ('vertical', '0.4456', (107.044, 109.2481), (107.044, 109.0921), (118.044, 109.1701)),\n ('aligned', '37.5471', (107.044, 117.6066), (118.3966, 110.9842), (118.2629, 123.797)),\n ('diameter', '%%c16.2162', (129.7493, 131.3244), 2.8382, 135),\n ('horizontal', '64.8649', (107.044, 131.3244), (129.7493, 131.3244), (118.3966, 142.3244)),\n ('vertical', '63.5135', (129.7493, 109.0921), (129.7493, 131.3244), (118.7493, 120.2082)),\n ('radius', 'R6.8906', (116.0315, 111.4572), 2.412, 45),\n ('radius', 'R24.3243', (151.9816, 109.0921), 8.5145, 45),\n ('radius', 'R4.0541', (151.9816, 154.0297), 1.4191, 135),\n ('horizontal', '9.5601', (190.3727, 144.9969), (193.7191, 144.9969), (192.0459, 155.9969)),\n ('horizontal', '9.5601', (190.3727, 110.9842), (193.7191, 110.9842), (192.0459, 121.9842))\n]\n\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; _ds.dxf.dimasz = 2.5\n _ds.dxf.dimexe = 1.25; _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\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\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,\n angle=(0 if d[0] == \"horizontal\" else 90),\n 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,\n 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,\n 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,\n text=text, dimstyle=\"EZDXF\").render()\n\n doc.saveas(out_path)\n\n\nif __name__ == \"__main__\":\n out = sys.argv[1] if len(sys.argv) > 1 else \"0077_00771692_gt.dxf\"\n draw(out)\n print(\"wrote\", out)\n```"}], "images": ["images/0077_00771692.png"], "id": "0077_00771692"} {"messages": [{"role": "user", "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 99.95 mm wide and 49.98 mm tall. It is extruded to a thickness of 7.81 mm. A cut feature: The part is a rectangular plate 100 mm wide and 40.51 mm tall. It is extruded to a thickness of -3.12 mm."}, {"role": "assistant", "content": "```python\n#!/usr/bin/env python3\n# -*- coding: utf-8 -*-\n# Ground-truth 2D engineering drawing for part: 0077_00775054\n# Self-contained: reproduces the three-view DXF via ezdxf, NO FreeCAD needed.\n# Coordinates are A4 page millimetres (scale=0.9315643772798583, page=[297.0, 210.0]).\n# visible edges -> solid (layer OUTLINE); hidden edges -> dashed (layer HIDDEN)\n# dimensions -> real movable DIMENSION entities (text = true mm value)\n# Run: python 0077_00775054_gt.py [out.dxf]\nimport sys\nimport ezdxf\nimport math\n\nSCALE = 0.9315643772798583\nPAGE = [297.0, 210.0]\n\nVISIBLE_SEGMENTS = [\n (74.680297, 104.359505, 167.790793, 104.359505),\n (167.790793, 150.914753, 74.680297, 150.914753),\n (74.680297, 108.72406, 167.836735, 108.72406),\n (167.836735, 146.458313, 74.680297, 146.458313),\n (191.068416, 90.359505, 167.790793, 90.359505),\n (191.068416, 83.085247, 167.790793, 83.085247),\n (167.790793, 83.085247, 74.680297, 83.085247),\n (167.790793, 90.359505, 74.680297, 90.359505),\n (74.680297, 90.359505, 51.402674, 90.359505),\n (74.680297, 83.085247, 51.402674, 83.085247),\n (191.068416, 83.085247, 191.068416, 90.359505),\n (51.402674, 83.085247, 51.402674, 90.359505),\n (167.790793, 90.359505, 167.790793, 83.085247),\n (74.680297, 90.359505, 74.680297, 83.085247),\n (205.068416, 104.359505, 212.342674, 104.359505),\n (205.068416, 150.914753, 212.342674, 150.914753),\n (205.068416, 150.914753, 205.068416, 104.359505),\n (212.342674, 150.914753, 212.342674, 104.359505)\n]\nVISIBLE_CIRCLES = [\n\n]\nVISIBLE_ARCS = [\n (167.790793, 127.637129, 23.277624, -90.0, 90.0),\n (74.680297, 127.637129, 23.277624, 90.0, -90.0),\n (167.836735, 127.591186, 18.867127, -90.0, 90.0),\n (74.680297, 127.591186, 18.867127, 90.0, -90.0)\n]\nHIDDEN_SEGMENTS = [\n (167.8367, 85.995, 186.7039, 85.995),\n (167.8367, 85.995, 74.6803, 85.995),\n (74.6803, 85.995, 55.8132, 85.995),\n (186.7039, 85.995, 186.7039, 83.0852),\n (55.8132, 85.995, 55.8132, 83.0852),\n (212.3427, 108.7241, 209.433, 108.7241),\n (209.433, 108.7241, 209.433, 146.4583),\n (212.3427, 146.4583, 209.433, 146.4583)\n]\n# (orient, text, p1, p2, base) for linear; (orient, text, center, radius, angle) for diameter\nDIMENSIONS = [\n ('horizontal', '99.9507', (167.7908, 150.9147), (74.6803, 150.9147), (121.2356, 139.9147)),\n ('vertical', '49.9753', (167.7908, 104.3595), (167.7908, 150.9147), (156.7908, 127.6371)),\n ('radius', 'R24.9877', (167.7908, 127.6372), 23.2777, 45),\n ('horizontal', '100', (74.6803, 108.7241), (167.8368, 108.7241), (121.2585, 119.7241)),\n ('vertical', '40.5063', (167.8368, 108.7241), (167.8368, 146.4583), (156.8368, 127.5912)),\n ('vertical', '0', (74.6803, 104.3595), (74.6803, 104.3595), (74.6803, 104.3595)),\n ('vertical', '4.6852', (74.6803, 104.3595), (74.6803, 108.7241), (63.6803, 106.5418)),\n ('radius', 'R20.2532', (167.8368, 127.5912), 18.8672, 135),\n ('horizontal', '7.8086', (205.0684, 104.3595), (212.3426, 104.3595), (208.7055, 115.3595)),\n ('horizontal', '3.1235', (212.3426, 108.7241), (209.4329, 108.7241), (210.8878, 97.7241))\n]\n\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; _ds.dxf.dimasz = 2.5\n _ds.dxf.dimexe = 1.25; _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\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\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,\n angle=(0 if d[0] == \"horizontal\" else 90),\n 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,\n 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,\n 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,\n text=text, dimstyle=\"EZDXF\").render()\n\n doc.saveas(out_path)\n\n\nif __name__ == \"__main__\":\n out = sys.argv[1] if len(sys.argv) > 1 else \"0077_00775054_gt.dxf\"\n draw(out)\n print(\"wrote\", out)\n```"}], "images": ["images/0077_00775054.png"], "id": "0077_00775054"} {"messages": [{"role": "user", "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 28.13 mm. A cut feature: The part is a polygonal plate with 2 straight edges. 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. A union feature: The part is a polygonal plate with 8 straight edges. It is extruded to a thickness of 13.54 mm. The outline includes one or more oblique (angled) edges."}, {"role": "assistant", "content": "```python\n#!/usr/bin/env python3\n# -*- coding: utf-8 -*-\n# Ground-truth 2D engineering drawing for part: 0077_00779424\n# Self-contained: reproduces the three-view DXF via ezdxf, NO FreeCAD needed.\n# Coordinates are A4 page millimetres (scale=1.0372235294117245, page=[297.0, 210.0]).\n# visible edges -> solid (layer OUTLINE); hidden edges -> dashed (layer HIDDEN)\n# dimensions -> real movable DIMENSION entities (text = true mm value)\n# Run: python 0077_00779424_gt.py [out.dxf]\nimport sys\nimport ezdxf\nimport math\n\nSCALE = 1.0372235294117245\nPAGE = [297.0, 210.0]\n\nVISIBLE_SEGMENTS = [\n (166.752353, 119.405282, 166.752353, 132.370576),\n (166.752353, 132.370576, 166.752353, 158.301164),\n (166.752353, 158.301164, 166.752353, 171.812365),\n (166.752353, 171.812365, 63.03, 171.812365),\n (63.03, 132.370576, 63.03, 119.405282),\n (63.03, 119.405282, 166.752353, 119.405282),\n (63.03, 171.812365, 63.03, 158.301164),\n (63.03, 158.301164, 63.03, 132.370576),\n (89.733957, 128.355884, 140.048396, 128.355884),\n (145.143529, 133.451017, 145.143529, 157.652899),\n (140.048396, 162.748033, 89.733957, 162.748033),\n (84.638823, 157.652899, 84.638823, 133.451017),\n (166.752353, 105.405282, 166.752353, 76.23337),\n (166.752353, 105.405282, 63.03, 105.405282),\n (166.752353, 76.23337, 63.03, 76.23337),\n (63.03, 105.405282, 63.03, 76.23337),\n (145.143529, 76.23337, 145.143529, 62.187635),\n (145.143529, 62.187635, 140.048396, 62.187635),\n (140.048396, 62.187635, 89.733957, 62.187635),\n (84.638823, 76.23337, 84.638823, 62.187635),\n (89.733957, 62.187635, 84.638823, 62.187635),\n (140.048396, 76.23337, 140.048396, 62.187635),\n (89.733957, 76.23337, 89.733957, 62.187635),\n (180.752353, 171.812365, 180.752353, 119.405282),\n (180.752353, 171.812365, 209.924265, 171.812365),\n (209.924265, 132.370576, 209.924265, 119.405282),\n (209.924265, 171.812365, 209.924265, 158.301164),\n (209.924265, 132.370576, 209.924265, 158.301164),\n (180.752353, 119.405282, 209.924265, 119.405282),\n (209.924265, 158.301164, 196.958971, 158.301164),\n (196.958971, 158.301164, 196.958971, 132.370576),\n (209.924265, 132.370576, 196.958971, 132.370576),\n (209.924265, 128.355884, 223.97, 128.355884),\n (223.97, 133.451017, 223.97, 128.355884),\n (209.924265, 162.748033, 223.97, 162.748033),\n (223.97, 162.748033, 223.97, 157.652899),\n (223.97, 157.652899, 223.97, 133.451017),\n (209.924265, 133.451017, 223.97, 133.451017),\n (209.924265, 157.652899, 223.97, 157.652899)\n]\nVISIBLE_CIRCLES = [\n\n]\nVISIBLE_ARCS = [\n (166.752353, 145.33587, 12.965294, 90.0, -90.0),\n (63.03, 145.33587, 12.965294, -90.0, 90.0),\n (89.733957, 133.451017, 5.095133, -180.0, -90.0),\n (140.048396, 133.451017, 5.095133, -90.0, -0.0),\n (140.048396, 157.652899, 5.095133, 0.0, 90.0),\n (89.733957, 157.652899, 5.095133, 90.0, 180.0)\n]\nHIDDEN_SEGMENTS = [\n (166.7524, 89.1987, 153.7871, 89.1987),\n (63.03, 89.1987, 75.9953, 89.1987),\n (153.7871, 89.1987, 153.7871, 76.2334),\n (75.9953, 89.1987, 75.9953, 76.2334)\n]\n# (orient, text, p1, p2, base) for linear; (orient, text, center, radius, angle) for diameter\nDIMENSIONS = [\n ('horizontal', '100', (166.7524, 171.8123), (63.03, 171.8123), (114.8912, 160.8123)),\n ('vertical', '50.5263', (166.7524, 119.4053), (166.7524, 171.8123), (155.7524, 145.6088)),\n ('radius', 'R12.5', (63.03, 145.3359), 12.9653, 45),\n ('radius', 'R12.5', (166.7524, 145.3359), 12.9653, 45),\n ('horizontal', '58.3334', (84.6388, 128.3559), (145.1436, 128.3559), (114.8912, 139.3559)),\n ('vertical', '33.1579', (145.1436, 128.3559), (145.1436, 162.7481), (134.1436, 145.552)),\n ('horizontal', '20.8333', (63.03, 119.4053), (84.6388, 119.4053), (73.8344, 130.4053)),\n ('vertical', '8.6294', (84.6388, 119.4053), (84.6388, 128.3559), (73.6388, 123.8806)),\n ('radius', 'R4.9123', (89.7339, 133.4511), 5.0952, 45),\n ('horizontal', '28.125', (180.7524, 119.4053), (209.9243, 119.4053), (195.3383, 130.4053)),\n ('horizontal', '12.5', (209.9243, 132.3706), (196.959, 132.3706), (203.4416, 121.3706)),\n ('horizontal', '12.5', (209.9243, 158.3012), (196.959, 158.3012), (203.4416, 147.3012)),\n ('horizontal', '13.5417', (209.9243, 133.4511), (223.97, 133.4511), (216.9471, 144.4511))\n]\n\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; _ds.dxf.dimasz = 2.5\n _ds.dxf.dimexe = 1.25; _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\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\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,\n angle=(0 if d[0] == \"horizontal\" else 90),\n 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,\n 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,\n 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,\n text=text, dimstyle=\"EZDXF\").render()\n\n doc.saveas(out_path)\n\n\nif __name__ == \"__main__\":\n out = sys.argv[1] if len(sys.argv) > 1 else \"0077_00779424_gt.dxf\"\n draw(out)\n print(\"wrote\", out)\n```"}], "images": ["images/0077_00779424.png"], "id": "0077_00779424"} {"messages": [{"role": "user", "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 50 mm. The outline includes one or more oblique (angled) edges. A cut feature: The part is a square plate 25 x 25 mm. It is extruded to a thickness of -37.5 mm."}, {"role": "assistant", "content": "```python\n#!/usr/bin/env python3\n# -*- coding: utf-8 -*-\n# Ground-truth 2D engineering drawing for part: 0078_00786512\n# Self-contained: reproduces the three-view DXF via ezdxf, NO FreeCAD needed.\n# Coordinates are A4 page millimetres (scale=0.9559685863874313, page=[297.0, 210.0]).\n# visible edges -> solid (layer OUTLINE); hidden edges -> dashed (layer HIDDEN)\n# dimensions -> real movable DIMENSION entities (text = true mm value)\n# Run: python 0078_00786512_gt.py [out.dxf]\nimport sys\nimport ezdxf\nimport math\n\nSCALE = 0.9559685863874313\nPAGE = [297.0, 210.0]\n\nVISIBLE_SEGMENTS = [\n (109.078796, 172.05, 109.078796, 151.924346),\n (64.802356, 172.05, 109.078796, 172.05),\n (116.122775, 150.918063, 116.122775, 172.05),\n (116.122775, 172.05, 160.399215, 172.05),\n (160.399215, 172.05, 160.399215, 123.748429),\n (160.399215, 123.748429, 64.802356, 123.748429),\n (64.802356, 123.748429, 64.802356, 172.05),\n (109.078796, 61.95, 109.078796, 109.748429),\n (64.802356, 61.95, 64.802356, 109.748429),\n (64.802356, 109.748429, 109.078796, 109.748429),\n (64.802356, 61.95, 109.078796, 61.95),\n (109.078796, 109.748429, 116.122775, 109.748429),\n (109.078796, 61.95, 116.122775, 61.95),\n (116.122775, 61.95, 160.399215, 61.95),\n (116.122775, 109.748429, 160.399215, 109.748429),\n (116.122775, 61.95, 116.122775, 109.748429),\n (160.399215, 61.95, 160.399215, 109.748429),\n (222.197644, 172.05, 174.399215, 172.05),\n (222.197644, 123.748429, 222.197644, 172.05),\n (174.399215, 123.748429, 174.399215, 172.05),\n (222.197644, 123.748429, 174.399215, 123.748429)\n]\nVISIBLE_CIRCLES = [\n\n]\nVISIBLE_ARCS = [\n (111.737494, 145.378163, 7.065493, 112.104273, 51.635523)\n]\nHIDDEN_SEGMENTS = [\n (136.5, 148.1508, 160.3992, 148.1508),\n (136.5, 124.2516, 136.5, 148.1508),\n (160.3992, 124.2516, 136.5, 124.2516),\n (160.3992, 73.8996, 136.5, 73.8996),\n (136.5, 109.7484, 136.5, 73.8996),\n (104.672, 109.7484, 104.672, 61.95),\n (118.803, 109.7484, 118.803, 61.95),\n (222.1976, 151.9243, 174.3992, 151.9243),\n (222.1976, 150.9181, 174.3992, 150.9181),\n (174.3992, 148.1508, 210.248, 148.1508),\n (210.248, 148.1508, 210.248, 124.2516),\n (174.3992, 124.2516, 210.248, 124.2516),\n (174.3992, 138.3127, 222.1976, 138.3127)\n]\n# (orient, text, p1, p2, base) for linear; (orient, text, center, radius, angle) for diameter\nDIMENSIONS = [\n ('horizontal', '46.3158', (116.1228, 172.05), (160.3992, 172.05), (138.261, 183.05)),\n ('horizontal', '100', (160.3992, 123.7484), (64.8024, 123.7484), (112.6008, 112.7484)),\n ('vertical', '21.0526', (109.0788, 172.05), (109.0788, 151.9244), (120.0788, 161.9872)),\n ('vertical', '22.1053', (116.1228, 150.918), (116.1228, 172.05), (105.1228, 161.484)),\n ('vertical', '50.5263', (160.3992, 172.05), (160.3992, 123.7484), (171.3992, 147.8992)),\n ('radius', 'R7.3909', (111.7375, 145.3782), 7.0655, 45),\n ('horizontal', '25', (136.5, 148.1508), (160.3992, 148.1508), (148.4496, 159.1508)),\n ('horizontal', '25', (64.8024, 172.05), (136.5, 172.05), (100.6512, 183.05)),\n ('vertical', '25', (136.5, 172.05), (136.5, 148.1508), (147.5, 160.1004)),\n ('horizontal', '50', (222.1976, 172.05), (174.3992, 172.05), (198.2984, 161.05)),\n ('horizontal', '37.5', (174.3992, 148.1508), (210.248, 148.1508), (192.3236, 159.1508))\n]\n\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; _ds.dxf.dimasz = 2.5\n _ds.dxf.dimexe = 1.25; _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\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\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,\n angle=(0 if d[0] == \"horizontal\" else 90),\n 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,\n 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,\n 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,\n text=text, dimstyle=\"EZDXF\").render()\n\n doc.saveas(out_path)\n\n\nif __name__ == \"__main__\":\n out = sys.argv[1] if len(sys.argv) > 1 else \"0078_00786512_gt.dxf\"\n draw(out)\n print(\"wrote\", out)\n```"}], "images": ["images/0078_00786512.png"], "id": "0078_00786512"} {"messages": [{"role": "user", "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. It is extruded to a thickness of 2.08 mm. The outline includes one or more oblique (angled) edges. A union feature: The part is a rectangular plate 1.38 mm wide and 14.58 mm tall. It is extruded to a thickness of 35.42 mm. A union feature: The part is a rectangular plate 1.38 mm wide and 14.58 mm tall. It is extruded to a thickness of 35.42 mm. A union feature: The part is a polygonal plate with 3 straight edges. It is extruded to a thickness of -1.04 mm. The outline includes one or more oblique (angled) edges. A union feature: The part is a polygonal plate with 3 straight edges. It is extruded to a thickness of -1.04 mm. The outline includes one or more oblique (angled) edges."}, {"role": "assistant", "content": "```python\n#!/usr/bin/env python3\n# -*- coding: utf-8 -*-\n# Ground-truth 2D engineering drawing for part: 0079_00792707\n# Self-contained: reproduces the three-view DXF via ezdxf, NO FreeCAD needed.\n# Coordinates are A4 page millimetres (scale=0.9448382923674042, page=[297.0, 210.0]).\n# visible edges -> solid (layer OUTLINE); hidden edges -> dashed (layer HIDDEN)\n# dimensions -> real movable DIMENSION entities (text = true mm value)\n# Run: python 0079_00792707_gt.py [out.dxf]\nimport sys\nimport ezdxf\nimport math\n\nSCALE = 0.9448382923674042\nPAGE = [297.0, 210.0]\n\nVISIBLE_SEGMENTS = [\n (71.49972, 111.381436, 162.999849, 127.294502),\n (165.983549, 132.267335, 165.983549, 172.05),\n (165.983549, 172.05, 71.49972, 172.05),\n (71.49972, 172.05, 71.49972, 111.381436),\n (91.183851, 145.828665, 91.183851, 146.812872),\n (147.283624, 145.828665, 147.283624, 146.812872),\n (91.183851, 146.812872, 74.452339, 146.812872),\n (74.452339, 145.828665, 74.452339, 146.812872),\n (91.183851, 145.828665, 74.452339, 145.828665),\n (73.789295, 145.828665, 73.789295, 159.607557),\n (72.483926, 145.828665, 73.789295, 145.828665),\n (73.789295, 159.607557, 72.483926, 159.607557),\n (72.483926, 159.607557, 72.483926, 145.828665),\n (165.320505, 145.828665, 165.320505, 159.607557),\n (165.320505, 159.607557, 164.015136, 159.607557),\n (164.015136, 159.607557, 164.015136, 145.828665),\n (164.015136, 146.812872, 147.283624, 146.812872),\n (164.015136, 145.828665, 147.283624, 145.828665),\n (164.015136, 145.828665, 165.320505, 145.828665),\n (166.040412, 97.381436, 165.983549, 97.381436),\n (166.040412, 95.413023, 165.983549, 95.413023),\n (165.983549, 97.381436, 165.983549, 95.413023),\n (165.983549, 97.381436, 71.49972, 97.381436),\n (165.983549, 95.413023, 71.49972, 95.413023),\n (71.49972, 97.381436, 71.49972, 95.413023),\n (91.183851, 95.413023, 74.452339, 78.681511),\n (74.452339, 78.681511, 74.452339, 95.413023),\n (73.789295, 95.413023, 73.789295, 61.95),\n (73.789295, 61.95, 72.483926, 61.95),\n (72.483926, 95.413023, 72.483926, 61.95),\n (165.320505, 95.413023, 165.320505, 61.95),\n (165.320505, 61.95, 164.015136, 61.95),\n (164.015136, 95.413023, 164.015136, 61.95),\n (164.015136, 78.681511, 147.283624, 95.413023),\n (166.040412, 95.413023, 166.040412, 97.381436),\n (180.040413, 111.381436, 182.008826, 111.381436),\n (180.040413, 172.05, 180.040413, 111.381436),\n (182.008826, 172.05, 182.008826, 111.381436),\n (180.040413, 172.05, 182.008826, 172.05),\n (182.008826, 145.828665, 215.471849, 145.828665),\n (182.008826, 159.607557, 215.471849, 159.607557),\n (215.471849, 159.607557, 215.471849, 145.828665)\n]\nVISIBLE_CIRCLES = [\n\n]\nVISIBLE_ARCS = [\n (161.536695, 131.553921, 4.503717, -71.041882, 9.114368)\n]\nHIDDEN_SEGMENTS = [\n (162.9998, 97.3814, 162.9998, 95.413),\n (180.0404, 132.2673, 182.0088, 132.2673),\n (180.0404, 127.2945, 182.0088, 127.2945),\n (182.0088, 146.8129, 198.7403, 146.8129),\n (198.7403, 145.8287, 198.7403, 146.8129)\n]\n# (orient, text, p1, p2, base) for linear; (orient, text, center, radius, angle) for diameter\nDIMENSIONS = [\n ('horizontal', '100', (165.9835, 172.05), (71.4997, 172.05), (118.7416, 161.05)),\n ('vertical', '42.1053', (165.9835, 132.2674), (165.9835, 172.05), (154.9835, 152.1587)),\n ('vertical', '64.2105', (71.4997, 172.05), (71.4997, 111.3814), (82.4997, 141.7157)),\n ('aligned', '98.2957', (71.4997, 111.3814), (162.9998, 127.2945), (115.365, 130.1753)),\n ('radius', 'R4.7667', (161.5367, 131.5539), 4.5038, 45),\n ('horizontal', '1.3816', (72.484, 145.8286), (73.7893, 145.8286), (73.1366, 156.8286)),\n ('vertical', '14.5833', (73.7893, 145.8286), (73.7893, 159.6076), (62.7893, 152.7181)),\n ('horizontal', '1.0417', (71.4997, 111.3814), (72.484, 111.3814), (71.9918, 122.3814)),\n ('vertical', '36.4583', (72.484, 111.3814), (72.484, 145.8286), (61.484, 128.605)),\n ('horizontal', '1.3816', (164.0152, 145.8286), (165.3205, 145.8286), (164.6678, 156.8286)),\n ('vertical', '14.5833', (165.3205, 145.8286), (165.3205, 159.6076), (154.3205, 152.7181)),\n ('horizontal', '97.9167', (71.4997, 111.3814), (164.0152, 111.3814), (117.7574, 122.3814)),\n ('vertical', '36.4583', (164.0152, 111.3814), (164.0152, 145.8286), (153.0152, 128.605)),\n ('horizontal', '2.0833', (180.0404, 127.2945), (182.0088, 127.2945), (181.0246, 138.2945)),\n ('horizontal', '35.4167', (182.0088, 145.8286), (215.4718, 145.8286), (198.7403, 156.8286)),\n ('horizontal', '35.4167', (182.0088, 145.8286), (215.4718, 145.8286), (198.7403, 156.8286)),\n ('vertical', '1.0417', (182.0088, 145.8286), (182.0088, 146.8129), (171.0088, 146.3208)),\n ('aligned', '25.0434', (91.1838, 95.4131), (74.4523, 78.6815), (90.5963, 79.2691)),\n ('aligned', '25.0434', (164.0152, 78.6815), (147.2836, 95.4131), (147.8712, 79.2691))\n]\n\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; _ds.dxf.dimasz = 2.5\n _ds.dxf.dimexe = 1.25; _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\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\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,\n angle=(0 if d[0] == \"horizontal\" else 90),\n 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,\n 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,\n 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,\n text=text, dimstyle=\"EZDXF\").render()\n\n doc.saveas(out_path)\n\n\nif __name__ == \"__main__\":\n out = sys.argv[1] if len(sys.argv) > 1 else \"0079_00792707_gt.dxf\"\n draw(out)\n print(\"wrote\", out)\n```"}], "images": ["images/0079_00792707.png"], "id": "0079_00792707"} {"messages": [{"role": "user", "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 88.42 mm tall. It is extruded to a thickness of 18.18 mm. A union feature: The part is a rectangular plate 23.33 mm wide and 88.64 mm tall. It is extruded to a thickness of 62.5 mm. A union feature: The part is a rectangular plate 22.83 mm wide and 88.36 mm tall. It is extruded to a thickness of 62.5 mm."}, {"role": "assistant", "content": "```python\n#!/usr/bin/env python3\n# -*- coding: utf-8 -*-\n# Ground-truth 2D engineering drawing for part: 0079_00793537\n# Self-contained: reproduces the three-view DXF via ezdxf, NO FreeCAD needed.\n# Coordinates are A4 page millimetres (scale=0.5397405360891185, page=[297.0, 210.0]).\n# visible edges -> solid (layer OUTLINE); hidden edges -> dashed (layer HIDDEN)\n# dimensions -> real movable DIMENSION entities (text = true mm value)\n# Run: python 0079_00793537_gt.py [out.dxf]\nimport sys\nimport ezdxf\nimport math\n\nSCALE = 0.5397405360891185\nPAGE = [297.0, 210.0]\n\nVISIBLE_SEGMENTS = [\n (124.169207, 118.34446, 123.878701, 118.34446),\n (123.657234, 118.460672, 69.904647, 118.460672),\n (69.904647, 118.460672, 69.904647, 166.185099),\n (123.878701, 166.185099, 69.904647, 166.185099),\n (136.468342, 120.862389, 136.468342, 120.638055),\n (163.115471, 67.740655, 123.878701, 67.740655),\n (123.878701, 67.740655, 69.904647, 67.740655),\n (163.115471, 101.474438, 123.878701, 101.474438),\n (123.878701, 67.740655, 123.878701, 77.554119),\n (69.904647, 67.740655, 69.904647, 77.554119),\n (69.904647, 77.554119, 123.878701, 77.554119),\n (109.341172, 101.474438, 123.878701, 101.474438),\n (163.115471, 101.474438, 163.115471, 67.740655),\n (109.341172, 101.474438, 109.341172, 77.554119),\n (123.878701, 77.554119, 123.878701, 101.474438),\n (210.849255, 118.34446, 210.849255, 115.474438),\n (210.849255, 169.203614, 210.849255, 166.185099),\n (210.849255, 118.34446, 210.849255, 118.460672),\n (210.849255, 118.460672, 210.849255, 166.185099),\n (177.115471, 118.34446, 177.115471, 115.474438),\n (177.115471, 169.203614, 177.115471, 166.185099),\n (210.849255, 166.185099, 201.03579, 166.185099),\n (210.849255, 118.460672, 201.03579, 118.460672),\n (201.03579, 118.460672, 201.03579, 166.185099),\n (177.115471, 118.34446, 177.115471, 166.185099),\n (210.849255, 118.34446, 177.115471, 118.34446),\n (177.115471, 115.474438, 210.849255, 115.474438),\n (177.115471, 169.203614, 210.849255, 169.203614),\n (201.03579, 166.185099, 177.115471, 166.185099)\n]\nVISIBLE_CIRCLES = [\n\n]\nVISIBLE_ARCS = [\n (136.250883, 142.339026, 26.864588, -116.72604, 117.421875),\n (136.289405, 142.26478, 26.948233, -117.953636, -117.421875),\n (136.203637, 142.071093, 21.434672, -89.292414, -47.722276),\n (136.468342, 142.26478, 21.402391, -90.0, -48.595442)\n]\nHIDDEN_SEGMENTS = [\n (136.4683, 101.4744, 136.4683, 67.7407),\n (150.6233, 101.4744, 150.6233, 67.7407),\n (177.1155, 120.6381, 210.8493, 120.6381),\n (177.1155, 126.2117, 210.8493, 126.2117),\n (210.8493, 120.8624, 177.1155, 120.8624)\n]\n# (orient, text, p1, p2, base) for linear; (orient, text, center, radius, angle) for diameter\nDIMENSIONS = [\n ('radius', 'R49.8068', (136.2593, 142.3229), 26.8827, 45),\n ('horizontal', '23.3253', (123.8787, 166.1851), (136.4683, 166.1851), (130.1735, 177.1851)),\n ('vertical', '88.6364', (136.4683, 166.1851), (136.4683, 118.3444), (147.4683, 142.2648)),\n ('horizontal', '100', (69.9047, 166.1851), (123.8787, 166.1851), (96.8917, 177.1851)),\n ('vertical', '0', (123.8787, 166.1851), (123.8787, 166.1851), (123.8787, 166.1851)),\n ('radius', 'R39.6531', (136.4683, 142.2648), 21.4024, 135),\n ('radius', 'R49.9281', (136.2894, 142.2648), 26.9482, 225),\n ('horizontal', '22.8349', (123.8787, 166.1851), (136.2036, 166.1851), (130.0412, 177.1851)),\n ('vertical', '88.3612', (136.2036, 166.1851), (136.2036, 118.493), (147.2036, 142.339)),\n ('horizontal', '100', (69.9047, 166.1851), (123.8787, 166.1851), (96.8917, 177.1851)),\n ('vertical', '0', (123.8787, 166.1851), (123.8787, 166.1851), (123.8787, 166.1851)),\n ('radius', 'R39.7129', (136.2036, 142.0711), 21.4347, 315),\n ('radius', 'R49.7732', (136.2509, 142.339), 26.8646, 90),\n ('horizontal', '18.1818', (210.8493, 166.1851), (201.0358, 166.1851), (205.9425, 155.1851))\n]\n\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; _ds.dxf.dimasz = 2.5\n _ds.dxf.dimexe = 1.25; _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\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\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,\n angle=(0 if d[0] == \"horizontal\" else 90),\n 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,\n 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,\n 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,\n text=text, dimstyle=\"EZDXF\").render()\n\n doc.saveas(out_path)\n\n\nif __name__ == \"__main__\":\n out = sys.argv[1] if len(sys.argv) > 1 else \"0079_00793537_gt.dxf\"\n draw(out)\n print(\"wrote\", out)\n```"}], "images": ["images/0079_00793537.png"], "id": "0079_00793537"} {"messages": [{"role": "user", "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 70.59 mm wide and 100 mm tall. It is extruded to a thickness of 28.84 mm. A union feature: The part is a rectangular plate 27.78 mm wide and 97.23 mm tall. It is extruded to a thickness of 97.34 mm."}, {"role": "assistant", "content": "```python\n#!/usr/bin/env python3\n# -*- coding: utf-8 -*-\n# Ground-truth 2D engineering drawing for part: 0081_00810148\n# Self-contained: reproduces the three-view DXF via ezdxf, NO FreeCAD needed.\n# Coordinates are A4 page millimetres (scale=0.1264499854657578, page=[297.0, 210.0]).\n# visible edges -> solid (layer OUTLINE); hidden edges -> dashed (layer HIDDEN)\n# dimensions -> real movable DIMENSION entities (text = true mm value)\n# Run: python 0081_00810148_gt.py [out.dxf]\nimport sys\nimport ezdxf\nimport math\n\nSCALE = 0.1264499854657578\nPAGE = [297.0, 210.0]\n\nVISIBLE_SEGMENTS = [\n (141.706876, 134.811641, 150.632757, 134.811641),\n (150.632757, 147.456639, 141.706876, 147.456639),\n (150.824712, 134.811641, 154.337478, 134.811641),\n (154.337478, 147.106323, 150.824712, 147.106323),\n (71.000011, 85.063521, 154.337478, 85.063521),\n (71.000011, 72.754442, 154.337478, 72.754442),\n (154.337478, 85.063521, 154.337478, 72.754442),\n (71.000011, 72.754442, 71.000011, 85.063521),\n (168.337478, 99.063521, 168.337478, 182.854443),\n (180.646556, 99.063521, 180.646556, 182.854443),\n (180.646556, 182.854443, 168.337478, 182.854443),\n (180.646556, 99.063521, 168.337478, 99.063521)\n]\nVISIBLE_CIRCLES = [\n\n]\nVISIBLE_ARCS = [\n (111.338502, 141.13414, 39.799655, -38.750329, -9.140625),\n (109.921526, 141.13414, 32.408062, 11.25, -11.25),\n (111.338502, 141.13414, 39.799655, 9.140625, 23.172881),\n (112.619064, 140.958982, 38.697046, 9.140625, -9.140625),\n (112.895472, 140.958982, 41.895461, 8.4375, -8.4375)\n]\nHIDDEN_SEGMENTS = [\n (142.3775, 116.2224, 147.9272, 156.7956),\n (150.6328, 85.0635, 150.6328, 81.4164),\n (141.7069, 85.0635, 141.7069, 81.4164),\n (142.3775, 81.4164, 142.3775, 85.0635),\n (147.9272, 81.4164, 150.6328, 81.4164),\n (147.9272, 81.4164, 147.9272, 85.0635),\n (150.8247, 85.0635, 150.8247, 72.7544),\n (141.7069, 81.4164, 142.3775, 81.4164),\n (142.3775, 81.4164, 150.6328, 81.4164),\n (141.7069, 81.4164, 73.922, 81.4164),\n (73.922, 81.4164, 141.7069, 81.4164),\n (141.7069, 81.4164, 147.9272, 81.4164),\n (150.6328, 81.4164, 147.9272, 81.4164),\n (77.5135, 81.4164, 77.5135, 85.0635),\n (73.922, 72.7544, 73.922, 81.4164),\n (171.9846, 116.2224, 168.3375, 116.2224),\n (168.3375, 147.4566, 171.9846, 147.4566),\n (171.9846, 102.2619, 171.9846, 179.656),\n (171.9846, 156.7956, 168.3375, 156.7956),\n (168.3375, 134.8116, 180.6466, 134.8116),\n (168.3375, 147.1063, 180.6466, 147.1063),\n (171.9846, 173.5422, 171.9846, 116.2224),\n (171.9846, 116.2224, 171.9846, 108.7261),\n (171.9846, 108.7261, 171.9846, 102.2619),\n (171.9846, 173.5422, 168.3375, 173.5422),\n (171.9846, 108.7261, 168.3375, 108.7261),\n (180.6466, 179.656, 171.9846, 179.656),\n (180.6466, 102.2619, 171.9846, 102.2619)\n]\n# (orient, text, p1, p2, base) for linear; (orient, text, center, radius, angle) for diameter\nDIMENSIONS = [\n ('horizontal', '70.5882', (150.6328, 147.4566), (141.7069, 147.4566), (146.1698, 136.4566)),\n ('vertical', '100', (150.6328, 134.8116), (150.6328, 147.4566), (139.6328, 141.1341)),\n ('radius', 'R314.746', (111.3385, 141.1341), 39.7997, 45),\n ('radius', 'R256.291', (109.9215, 141.1341), 32.4081, 45),\n ('horizontal', '27.7799', (150.8247, 134.8116), (154.3375, 134.8116), (152.5811, 145.8116)),\n ('vertical', '97.2296', (154.3375, 134.8116), (154.3375, 147.1063), (143.3375, 140.959)),\n ('horizontal', '72.1063', (141.7069, 134.8116), (150.8247, 134.8116), (146.2658, 145.8116)),\n ('vertical', '0', (150.8247, 134.8116), (150.8247, 134.8116), (150.8247, 134.8116)),\n ('radius', 'R331.32', (112.8955, 140.959), 41.8955, 45),\n ('radius', 'R306.026', (112.6191, 140.959), 38.697, 135),\n ('horizontal', '28.8425', (168.3375, 134.8116), (171.9846, 134.8116), (170.161, 145.8116)),\n ('horizontal', '97.3435', (168.3375, 134.8116), (180.6466, 134.8116), (174.492, 145.8116))\n]\n\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; _ds.dxf.dimasz = 2.5\n _ds.dxf.dimexe = 1.25; _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\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\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,\n angle=(0 if d[0] == \"horizontal\" else 90),\n 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,\n 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,\n 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,\n text=text, dimstyle=\"EZDXF\").render()\n\n doc.saveas(out_path)\n\n\nif __name__ == \"__main__\":\n out = sys.argv[1] if len(sys.argv) > 1 else \"0081_00810148_gt.dxf\"\n draw(out)\n print(\"wrote\", out)\n```"}], "images": ["images/0081_00810148.png"], "id": "0081_00810148"} {"messages": [{"role": "user", "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 41.14 mm, featuring a circular hole of diameter 21.01 mm. It is extruded to a thickness of 51.97 mm. A union feature: The part is a circular plate with diameter 41.14 mm, featuring a circular hole of diameter 21.01 mm. It is extruded to a thickness of 51.97 mm. A union feature: The part is a circular plate with diameter 41.14 mm, featuring a circular hole of diameter 21.01 mm. It is extruded to a thickness of 20.79 mm. A union feature: The part is a circular plate with diameter 41.14 mm, featuring a circular hole of diameter 21.01 mm. It is extruded to a thickness of 20.79 mm. A union feature: The part is a polygonal plate with 8 straight edges, featuring a rectangular cutout 72.07 x 34.87 mm. It is extruded to a thickness of 20.79 mm. The outline includes one or more oblique (angled) edges."}, {"role": "assistant", "content": "```python\n#!/usr/bin/env python3\n# -*- coding: utf-8 -*-\n# Ground-truth 2D engineering drawing for part: 0081_00816466\n# Self-contained: reproduces the three-view DXF via ezdxf, NO FreeCAD needed.\n# Coordinates are A4 page millimetres (scale=0.48819603032016956, page=[297.0, 210.0]).\n# visible edges -> solid (layer OUTLINE); hidden edges -> dashed (layer HIDDEN)\n# dimensions -> real movable DIMENSION entities (text = true mm value)\n# Run: python 0081_00816466_gt.py [out.dxf]\nimport sys\nimport ezdxf\nimport math\n\nSCALE = 0.48819603032016956\nPAGE = [297.0, 210.0]\n\nVISIBLE_SEGMENTS = [\n (68.102595, 127.608226, 114.638936, 112.852801),\n (129.394361, 112.852801, 174.970268, 127.303698),\n (175.930703, 146.903782, 129.394361, 161.659207),\n (114.638936, 161.659207, 68.102595, 146.903782),\n (139.609656, 145.768749, 104.423642, 145.768749),\n (104.423642, 128.743259, 139.609656, 128.743259),\n (182.907815, 72.340793, 162.824413, 72.340793),\n (182.907815, 72.340793, 182.907815, 97.712112),\n (182.907815, 97.712112, 175.930703, 97.712112),\n (175.930703, 97.712112, 129.394361, 97.712112),\n (129.394361, 97.712112, 114.638936, 97.712112),\n (114.638936, 97.712112, 68.102595, 97.712112),\n (68.102595, 97.712112, 61.339135, 97.712112),\n (175.930703, 97.712112, 175.930703, 87.563584),\n (175.930703, 87.563584, 129.394361, 87.563584),\n (129.394361, 87.563584, 114.638936, 87.563584),\n (114.638936, 87.563584, 68.102595, 87.563584),\n (81.422537, 72.340793, 81.422537, 87.563584),\n (81.422537, 72.340793, 61.339135, 72.340793),\n (68.102595, 97.712112, 68.102595, 87.563584),\n (162.824413, 72.340793, 162.824413, 87.563584),\n (61.339135, 72.340793, 61.339135, 97.712112),\n (129.394361, 97.712112, 129.394361, 87.563584),\n (114.638936, 97.712112, 114.638936, 87.563584),\n (196.907816, 162.799896, 196.907816, 161.659207),\n (196.907816, 161.659207, 196.907816, 146.903782),\n (196.907816, 146.903782, 196.907816, 127.608226),\n (196.907816, 127.608226, 196.907816, 112.852801),\n (196.907816, 112.852801, 196.907816, 111.712112),\n (207.056343, 127.608226, 207.056343, 112.852801),\n (207.056343, 112.852801, 207.056343, 111.712112),\n (207.056343, 162.799896, 207.056343, 161.659207),\n (207.056343, 161.659207, 207.056343, 146.903782),\n (196.907816, 127.608226, 207.056343, 127.608226),\n (222.279135, 147.164172, 222.279135, 127.080769),\n (196.907816, 146.903782, 207.056343, 146.903782),\n (222.279135, 147.164172, 207.056343, 147.164172),\n (222.279135, 127.080769, 207.056343, 127.080769),\n (207.056343, 162.799896, 196.907816, 162.799896),\n (207.056343, 111.712112, 196.907816, 111.712112),\n (196.907816, 112.852801, 207.056343, 112.852801),\n (196.907816, 161.659207, 207.056343, 161.659207)\n]\nVISIBLE_CIRCLES = [\n (172.866114, 137.122471, 10.041701),\n (172.866114, 137.122471, 5.127677),\n (71.380836, 137.122471, 10.041701),\n (71.380836, 137.122471, 5.127677)\n]\nVISIBLE_ARCS = [\n (172.874301, 137.256004, 10.120337, 72.421875, -147.201636),\n (122.016649, 136.141143, 24.429031, -107.578125, -72.421875),\n (122.016649, 138.370865, 24.429031, 72.421875, 107.578125),\n (71.158997, 137.256004, 10.120337, 40.575327, 107.578125),\n (71.158997, 137.256004, 10.120337, -107.578125, -102.665817),\n (104.423642, 137.256004, 8.512745, 90.0, -90.0),\n (139.609656, 137.256004, 8.512745, -90.0, 90.0)\n]\nHIDDEN_SEGMENTS = [\n (182.9078, 137.1225, 164.3673, 131.774),\n (174.9703, 127.3037, 164.3673, 131.774),\n (174.9703, 127.3037, 182.9078, 137.1225),\n (78.8459, 143.8387, 68.94, 127.3819),\n (78.8459, 143.8387, 81.4225, 137.1225),\n (81.4225, 137.1225, 68.94, 127.3819),\n (164.3673, 87.5636, 164.3673, 97.7121),\n (174.9703, 87.5636, 174.9703, 97.7121),\n (177.9938, 97.7121, 177.9938, 72.3408),\n (68.94, 87.5636, 68.94, 97.7121),\n (78.8459, 87.5636, 78.8459, 97.7121),\n (76.5085, 97.7121, 76.5085, 72.3408),\n (167.7384, 72.3408, 167.7384, 97.7121),\n (95.9109, 87.5636, 95.9109, 97.7121),\n (148.1224, 87.5636, 148.1224, 97.7121),\n (66.2532, 72.3408, 66.2532, 97.7121),\n (207.0563, 131.774, 196.9078, 131.774),\n (207.0563, 143.8387, 196.9078, 143.8387),\n (196.9078, 128.7433, 207.0563, 128.7433),\n (196.9078, 145.7687, 207.0563, 145.7687),\n (207.0563, 145.7687, 207.0563, 143.8387),\n (207.0563, 143.8387, 207.0563, 128.7433),\n (207.0563, 137.1225, 207.0563, 128.7433),\n (207.0563, 137.1225, 207.0563, 145.7687),\n (222.2791, 142.2501, 196.9078, 142.2501),\n (222.2791, 131.9948, 196.9078, 131.9948)\n]\n# (orient, text, p1, p2, base) for linear; (orient, text, center, radius, angle) for diameter\nDIMENSIONS = [\n ('diameter', '%%c41.138', (71.3809, 137.1225), 10.0417, 45),\n ('diameter', '%%c21.0066', (71.3809, 137.1225), 5.1277, 135),\n ('diameter', '%%c41.138', (172.8661, 137.1225), 10.0417, 45),\n ('diameter', '%%c21.0066', (172.8661, 137.1225), 5.1277, 135),\n ('diameter', '%%c41.138', (71.3809, 137.1225), 10.0417, 225),\n ('diameter', '%%c21.0066', (71.3809, 137.1225), 5.1277, 315),\n ('diameter', '%%c41.138', (172.8661, 137.1225), 10.0417, 225),\n ('diameter', '%%c21.0066', (172.8661, 137.1225), 5.1277, 315),\n ('horizontal', '220.871', (68.1026, 112.8528), (175.9307, 112.8528), (122.0166, 123.8528)),\n ('vertical', '99.973', (175.9307, 112.8528), (175.9307, 161.6592), (164.9307, 137.256)),\n ('aligned', '100', (175.9307, 146.9038), (129.3944, 161.6592), (149.3379, 143.796)),\n ('aligned', '100', (114.6389, 161.6592), (68.1026, 146.9038), (94.6954, 143.796)),\n ('aligned', '100', (68.1026, 127.6082), (114.6389, 112.8528), (94.6954, 130.716)),\n ('horizontal', '72.0735', (104.4236, 128.7433), (139.6097, 128.7433), (122.0166, 139.7433)),\n ('vertical', '34.8743', (104.4236, 128.7433), (104.4236, 145.7688), (93.4236, 137.256)),\n ('horizontal', '74.3985', (68.1026, 128.7433), (104.4236, 128.7433), (86.2631, 139.7433)),\n ('vertical', '32.5494', (104.4236, 112.8528), (104.4236, 128.7433), (93.4236, 120.798)),\n ('radius', 'R50.0394', (122.0166, 136.1411), 24.429, 45),\n ('radius', 'R20.7301', (172.8743, 137.256), 10.1204, 90),\n ('radius', 'R17.4371', (139.6097, 137.256), 8.5127, 45),\n ('horizontal', '20.7878', (196.9078, 137.1225), (222.2791, 137.1225), (209.5935, 148.1225)),\n ('horizontal', '20.7878', (196.9078, 137.1225), (222.2791, 137.1225), (209.5935, 158.1225)),\n ('horizontal', '20.7878', (196.9078, 137.1225), (207.0563, 137.1225), (201.9821, 178.1225)),\n ('horizontal', '20.7878', (196.9078, 112.8528), (207.0563, 112.8528), (201.9821, 123.8528))\n]\n\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; _ds.dxf.dimasz = 2.5\n _ds.dxf.dimexe = 1.25; _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\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\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,\n angle=(0 if d[0] == \"horizontal\" else 90),\n 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,\n 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,\n 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,\n text=text, dimstyle=\"EZDXF\").render()\n\n doc.saveas(out_path)\n\n\nif __name__ == \"__main__\":\n out = sys.argv[1] if len(sys.argv) > 1 else \"0081_00816466_gt.dxf\"\n draw(out)\n print(\"wrote\", out)\n```"}], "images": ["images/0081_00816466.png"], "id": "0081_00816466"} {"messages": [{"role": "user", "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 85.26 mm tall. It is extruded to a thickness of 9.78 mm. A union feature: The part is a polygonal plate with 12 straight edges. It is extruded to a thickness of 94.57 mm. The outline includes one or more oblique (angled) edges."}, {"role": "assistant", "content": "```python\n#!/usr/bin/env python3\n# -*- coding: utf-8 -*-\n# Ground-truth 2D engineering drawing for part: 0082_00820779\n# Self-contained: reproduces the three-view DXF via ezdxf, NO FreeCAD needed.\n# Coordinates are A4 page millimetres (scale=0.5165522755227638, page=[297.0, 210.0]).\n# visible edges -> solid (layer OUTLINE); hidden edges -> dashed (layer HIDDEN)\n# dimensions -> real movable DIMENSION entities (text = true mm value)\n# Run: python 0082_00820779_gt.py [out.dxf]\nimport sys\nimport ezdxf\nimport math\n\nSCALE = 0.5165522755227638\nPAGE = [297.0, 210.0]\n\nVISIBLE_SEGMENTS = [\n (135.37706, 129.130062, 135.37706, 133.62182),\n (135.37706, 133.62182, 135.37706, 172.771046),\n (135.37706, 172.771046, 135.37706, 173.17294),\n (83.721833, 129.130062, 86.673337, 129.130062),\n (132.425556, 129.130062, 135.37706, 129.130062),\n (135.37706, 173.17294, 83.721833, 173.17294),\n (83.721833, 173.17294, 83.721833, 172.771046),\n (83.721833, 172.771046, 83.721833, 133.62182),\n (83.721833, 133.62182, 83.721833, 129.130062),\n (135.37706, 172.771046, 130.483407, 172.771046),\n (88.615486, 128.728167, 130.483407, 128.728167),\n (130.483407, 172.771046, 130.483407, 136.340517),\n (127.764711, 133.62182, 91.334182, 133.62182),\n (88.615486, 136.340517, 88.615486, 172.771046),\n (88.615486, 172.771046, 83.721833, 172.771046),\n (135.37706, 109.674938, 135.37706, 60.82706),\n (135.37706, 114.728167, 135.37706, 109.674938),\n (135.37706, 109.674938, 83.721833, 109.674938),\n (83.721833, 114.728167, 83.721833, 109.674938),\n (135.37706, 114.728167, 83.721833, 114.728167),\n (83.721833, 109.674938, 83.721833, 60.82706),\n (135.37706, 60.82706, 130.483407, 60.82706),\n (130.483407, 109.674938, 130.483407, 60.82706),\n (130.483407, 60.82706, 127.764711, 60.82706),\n (127.764711, 60.82706, 91.334182, 60.82706),\n (91.334182, 60.82706, 88.615486, 60.82706),\n (88.615486, 60.82706, 83.721833, 60.82706),\n (88.615486, 109.674938, 88.615486, 60.82706),\n (127.764711, 109.674938, 127.764711, 60.82706),\n (91.334182, 109.674938, 91.334182, 60.82706),\n (149.37706, 129.130062, 154.430289, 129.130062),\n (149.37706, 173.17294, 154.430289, 173.17294),\n (149.37706, 173.17294, 149.37706, 129.130062),\n (154.430289, 173.17294, 154.430289, 172.771046),\n (154.430289, 172.771046, 203.278167, 172.771046),\n (203.278167, 172.771046, 203.278167, 133.62182),\n (154.430289, 133.62182, 154.430289, 129.130062),\n (154.430289, 129.130062, 154.430289, 128.728167),\n (203.278167, 133.62182, 203.278167, 128.728167),\n (154.430289, 128.728167, 203.278167, 128.728167),\n (154.430289, 133.62182, 203.278167, 133.62182)\n]\nVISIBLE_CIRCLES = [\n\n]\nVISIBLE_ARCS = [\n (130.483407, 133.62182, 4.893653, -90.0, -0.0),\n (88.615486, 133.62182, 4.893653, -180.0, -90.0),\n (127.764711, 136.340517, 2.718696, -90.0, -0.0),\n (91.334182, 136.340517, 2.718696, -180.0, -90.0)\n]\nHIDDEN_SEGMENTS = [\n (132.4256, 129.1301, 135.3771, 133.6218),\n (83.7218, 133.6218, 86.6733, 129.1301)\n]\n# (orient, text, p1, p2, base) for linear; (orient, text, center, radius, angle) for diameter\nDIMENSIONS = [\n ('horizontal', '100', (135.3771, 173.173), (83.7218, 173.173), (109.5494, 162.173)),\n ('vertical', '85.2632', (135.3771, 129.1301), (135.3771, 173.173), (124.3771, 151.1515)),\n ('horizontal', '100', (83.7218, 128.7282), (135.3771, 128.7282), (109.5494, 139.7282)),\n ('vertical', '85.2631', (135.3771, 128.7282), (135.3771, 172.771), (124.3771, 150.7496)),\n ('vertical', '0.778', (83.7218, 129.1301), (83.7218, 128.7282), (94.7218, 128.9291)),\n ('radius', 'R9.4737', (88.6155, 133.6218), 4.8937, 45),\n ('radius', 'R5.2632', (127.7647, 136.3405), 2.7187, 45),\n ('horizontal', '9.7826', (149.3771, 129.1301), (154.4303, 129.1301), (151.9037, 140.1301)),\n ('horizontal', '94.5652', (154.4303, 133.6218), (203.2782, 133.6218), (178.8542, 144.6218))\n]\n\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; _ds.dxf.dimasz = 2.5\n _ds.dxf.dimexe = 1.25; _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\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\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,\n angle=(0 if d[0] == \"horizontal\" else 90),\n 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,\n 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,\n 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,\n text=text, dimstyle=\"EZDXF\").render()\n\n doc.saveas(out_path)\n\n\nif __name__ == \"__main__\":\n out = sys.argv[1] if len(sys.argv) > 1 else \"0082_00820779_gt.dxf\"\n draw(out)\n print(\"wrote\", out)\n```"}], "images": ["images/0082_00820779.png"], "id": "0082_00820779"} {"messages": [{"role": "user", "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 50.23 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 50.23 mm. The outline includes one or more oblique (angled) edges."}, {"role": "assistant", "content": "```python\n#!/usr/bin/env python3\n# -*- coding: utf-8 -*-\n# Ground-truth 2D engineering drawing for part: 0082_00827274\n# Self-contained: reproduces the three-view DXF via ezdxf, NO FreeCAD needed.\n# Coordinates are A4 page millimetres (scale=0.4867303228236596, page=[297.0, 210.0]).\n# visible edges -> solid (layer OUTLINE); hidden edges -> dashed (layer HIDDEN)\n# dimensions -> real movable DIMENSION entities (text = true mm value)\n# Run: python 0082_00827274_gt.py [out.dxf]\nimport sys\nimport ezdxf\nimport math\n\nSCALE = 0.4867303228236596\nPAGE = [297.0, 210.0]\n\nVISIBLE_SEGMENTS = [\n (102.872414, 185.034063, 106.663443, 176.693799),\n (141.540909, 165.320713, 149.122967, 169.869947),\n (106.663443, 74.934063, 106.663443, 99.384461),\n (106.663443, 99.384461, 141.540909, 99.384461),\n (141.540909, 74.934063, 141.540909, 99.384461),\n (106.663443, 74.934063, 141.540909, 74.934063),\n (102.872414, 74.934063, 102.872414, 99.384461),\n (102.872414, 99.384461, 106.663443, 99.384461),\n (102.872414, 74.934063, 106.663443, 74.934063),\n (141.540909, 99.384461, 149.122967, 99.384461),\n (149.122967, 74.934063, 149.122967, 99.384461),\n (141.540909, 74.934063, 149.122967, 74.934063),\n (149.122967, 74.934063, 154.4669, 74.934063),\n (79.949056, 74.934063, 102.872414, 74.934063),\n (149.122967, 99.384461, 154.4669, 99.384461),\n (79.949056, 99.384461, 102.872414, 99.384461),\n (79.949056, 99.384461, 79.949056, 74.934063),\n (154.4669, 99.384461, 154.4669, 74.934063),\n (192.917298, 185.034063, 168.466901, 185.034063),\n (192.917298, 113.384461, 192.917298, 185.034063),\n (168.466901, 113.384461, 168.466901, 185.034063),\n (168.466901, 113.384461, 192.917298, 113.384461)\n]\nVISIBLE_CIRCLES = [\n\n]\nVISIBLE_ARCS = [\n (117.509892, 150.790918, 28.082107, 112.720778, 31.158278),\n (117.207978, 150.643383, 37.258922, 112.628544, 31.066044)\n]\nHIDDEN_SEGMENTS = [\n (89.4278, 99.3845, 89.4278, 74.9341),\n (145.592, 99.3845, 145.592, 74.9341),\n (192.9173, 176.6938, 168.4669, 176.6938),\n (192.9173, 165.3207, 168.4669, 165.3207),\n (192.9173, 169.8699, 168.4669, 169.8699),\n (168.4669, 122.7088, 192.9173, 122.7088)\n]\n# (orient, text, p1, p2, base) for linear; (orient, text, center, radius, angle) for diameter\nDIMENSIONS = [\n ('aligned', '18.1664', (141.5409, 165.3207), (149.123, 169.8699), (139.6725, 177.0278)),\n ('aligned', '18.8224', (102.8724, 185.0341), (106.6634, 176.6938), (114.7819, 185.4158)),\n ('radius', 'R57.6954', (117.5099, 150.7909), 28.0821, 45),\n ('radius', 'R76.5494', (117.208, 150.6434), 37.2589, 135),\n ('horizontal', '95.023', (102.8724, 185.0341), (149.123, 185.0341), (125.9977, 196.0341)),\n ('vertical', '40.5016', (149.123, 185.0341), (149.123, 165.3207), (160.123, 175.1774)),\n ('vertical', '0', (102.8724, 185.0341), (102.8724, 185.0341), (102.8724, 185.0341)),\n ('vertical', '0', (102.8724, 185.0341), (102.8724, 185.0341), (102.8724, 185.0341)),\n ('aligned', '18.1664', (141.5409, 165.3207), (149.123, 169.8699), (139.6725, 177.0278)),\n ('aligned', '18.8224', (102.8724, 185.0341), (106.6634, 176.6938), (114.7819, 185.4158)),\n ('radius', 'R57.6954', (117.5099, 150.7909), 28.0821, 225),\n ('radius', 'R76.5494', (117.208, 150.6434), 37.2589, 315),\n ('horizontal', '50.234', (192.9173, 176.6938), (168.4669, 176.6938), (180.6921, 165.6938)),\n ('horizontal', '50.234', (192.9173, 176.6938), (168.4669, 176.6938), (180.6921, 165.6938))\n]\n\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; _ds.dxf.dimasz = 2.5\n _ds.dxf.dimexe = 1.25; _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\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\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,\n angle=(0 if d[0] == \"horizontal\" else 90),\n 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,\n 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,\n 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,\n text=text, dimstyle=\"EZDXF\").render()\n\n doc.saveas(out_path)\n\n\nif __name__ == \"__main__\":\n out = sys.argv[1] if len(sys.argv) > 1 else \"0082_00827274_gt.dxf\"\n draw(out)\n print(\"wrote\", out)\n```"}], "images": ["images/0082_00827274.png"], "id": "0082_00827274"} {"messages": [{"role": "user", "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 21.41 mm, featuring a circular hole of diameter 8.92 mm. It is extruded to a thickness of 7.63 mm. A union feature: The part is a circular plate with diameter 21.41 mm, featuring a circular hole of diameter 8.92 mm. It is extruded to a thickness of 7.63 mm. A union feature: The part is a rectangular plate 9.47 mm wide and 100 mm tall. It is extruded to a thickness of 4.24 mm."}, {"role": "assistant", "content": "```python\n#!/usr/bin/env python3\n# -*- coding: utf-8 -*-\n# Ground-truth 2D engineering drawing for part: 0087_00872517\n# Self-contained: reproduces the three-view DXF via ezdxf, NO FreeCAD needed.\n# Coordinates are A4 page millimetres (scale=0.6507284808215142, page=[297.0, 210.0]).\n# visible edges -> solid (layer OUTLINE); hidden edges -> dashed (layer HIDDEN)\n# dimensions -> real movable DIMENSION entities (text = true mm value)\n# Run: python 0087_00872517_gt.py [out.dxf]\nimport sys\nimport ezdxf\nimport math\n\nSCALE = 0.6507284808215142\nPAGE = [297.0, 210.0]\n\nVISIBLE_SEGMENTS = [\n (130.361326, 162.086349, 130.361326, 97.842705),\n (136.526122, 97.428103, 136.526122, 162.500951),\n (139.88135, 70.396119, 139.88135, 65.432936),\n (139.88135, 65.432936, 125.949607, 65.432936),\n (139.88135, 70.396119, 125.949607, 70.396119),\n (125.949607, 65.432936, 125.949607, 70.396119),\n (156.638674, 162.086349, 153.88135, 162.086349),\n (158.844533, 175.532936, 158.844533, 161.601193),\n (153.88135, 175.532936, 153.88135, 162.086349),\n (153.88135, 162.086349, 153.88135, 97.842705),\n (153.88135, 97.842705, 153.88135, 84.396119),\n (156.638674, 162.086349, 156.638674, 97.842705),\n (156.638674, 97.842705, 153.88135, 97.842705),\n (158.844533, 98.327862, 158.844533, 84.396119),\n (158.844533, 175.532936, 153.88135, 175.532936),\n (158.844533, 161.601193, 156.638674, 161.601193),\n (158.844533, 98.327862, 156.638674, 98.327862),\n (158.844533, 84.396119, 153.88135, 84.396119)\n]\nVISIBLE_CIRCLES = [\n (132.915479, 168.567064, 6.965871),\n (132.915479, 168.567064, 2.902446),\n (132.915479, 91.36199, 6.965871),\n (132.915479, 91.36199, 2.902446)\n]\nVISIBLE_ARCS = [\n (133.443724, 91.112623, 7.027551, 63.984375, 73.164497),\n (133.443724, 168.816432, 7.027551, -73.164497, -63.984375)\n]\nHIDDEN_SEGMENTS = [\n (135.4791, 162.0901, 130.3613, 162.0863),\n (135.4791, 162.0901, 139.8813, 168.5671),\n (139.8813, 168.5671, 130.3613, 162.0863),\n (130.3613, 97.8427, 139.8813, 91.362),\n (139.8813, 91.362, 135.4791, 97.839),\n (130.3613, 97.8427, 135.4791, 97.839),\n (130.3613, 67.6388, 130.3613, 70.3961),\n (135.4791, 67.6388, 130.3613, 67.6388),\n (135.4791, 67.6388, 135.4791, 70.3961),\n (135.4791, 67.6388, 136.5261, 67.6388),\n (136.5261, 70.3961, 136.5261, 67.6388),\n (135.8179, 70.3961, 135.8179, 65.4329),\n (130.013, 65.4329, 130.013, 70.3961),\n (158.8445, 171.4695, 153.8814, 171.4695),\n (158.8445, 165.6646, 153.8814, 165.6646),\n (158.8445, 94.2644, 153.8814, 94.2644),\n (158.8445, 88.4595, 153.8814, 88.4595)\n]\n# (orient, text, p1, p2, base) for linear; (orient, text, center, radius, angle) for diameter\nDIMENSIONS = [\n ('diameter', '%%c21.4095', (132.9155, 168.5671), 6.9659, 45),\n ('diameter', '%%c8.9206', (132.9155, 168.5671), 2.9024, 135),\n ('diameter', '%%c21.4095', (132.9155, 91.362), 6.9659, 45),\n ('diameter', '%%c8.9206', (132.9155, 91.362), 2.9024, 135),\n ('horizontal', '9.4737', (130.3613, 97.4281), (136.5261, 97.4281), (133.4437, 108.4281)),\n ('vertical', '100', (136.5261, 97.4281), (136.5261, 162.5009), (125.5261, 129.9645)),\n ('radius', 'R10.7995', (133.4438, 91.1126), 7.0275, 45),\n ('horizontal', '4.2373', (153.8814, 168.5671), (158.8445, 168.5671), (156.3629, 179.5671)),\n ('horizontal', '7.6271', (153.8814, 91.362), (158.8445, 91.362), (156.3629, 112.362))\n]\n\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; _ds.dxf.dimasz = 2.5\n _ds.dxf.dimexe = 1.25; _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\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\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,\n angle=(0 if d[0] == \"horizontal\" else 90),\n 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,\n 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,\n 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,\n text=text, dimstyle=\"EZDXF\").render()\n\n doc.saveas(out_path)\n\n\nif __name__ == \"__main__\":\n out = sys.argv[1] if len(sys.argv) > 1 else \"0087_00872517_gt.dxf\"\n draw(out)\n print(\"wrote\", out)\n```"}], "images": ["images/0087_00872517.png"], "id": "0087_00872517"} {"messages": [{"role": "user", "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 84.15 mm tall, featuring a circular hole of diameter 39.02 mm. It is extruded to a thickness of 20.44 mm. A union feature: The part is a circular plate with diameter 38.57 mm, featuring a circular hole of diameter 31.33 mm. It is extruded to a thickness of 20.44 mm. A union feature: The part is a circular plate with diameter 38.57 mm, featuring a circular hole of diameter 31.33 mm. It is extruded to a thickness of 27.26 mm."}, {"role": "assistant", "content": "```python\n#!/usr/bin/env python3\n# -*- coding: utf-8 -*-\n# Ground-truth 2D engineering drawing for part: 0087_00878364\n# Self-contained: reproduces the three-view DXF via ezdxf, NO FreeCAD needed.\n# Coordinates are A4 page millimetres (scale=0.8626104314226999, page=[297.0, 210.0]).\n# visible edges -> solid (layer OUTLINE); hidden edges -> dashed (layer HIDDEN)\n# dimensions -> real movable DIMENSION entities (text = true mm value)\n# Run: python 0087_00878364_gt.py [out.dxf]\nimport sys\nimport ezdxf\nimport math\n\nSCALE = 0.8626104314226999\nPAGE = [297.0, 210.0]\n\nVISIBLE_SEGMENTS = [\n (74.993479, 99.464488, 161.254522, 99.464488),\n (161.254522, 172.05, 74.993479, 172.05),\n (174.492033, 85.464488, 161.254522, 85.464488),\n (161.254522, 85.464488, 161.254522, 67.828622),\n (174.492033, 67.828622, 161.254522, 67.828622),\n (161.254522, 67.828622, 74.993479, 67.828622),\n (74.993479, 85.464488, 74.993479, 67.828622),\n (161.254522, 85.464488, 74.993479, 85.464488),\n (74.993479, 85.464488, 61.755968, 85.464488),\n (74.993479, 67.828622, 61.755968, 67.828622),\n (135.301953, 67.828622, 135.301953, 61.95),\n (135.301953, 61.95, 102.03514, 61.95),\n (174.492033, 67.828622, 174.492033, 85.464488),\n (61.755968, 67.828622, 61.755968, 85.464488),\n (102.03514, 61.95, 102.03514, 67.828622),\n (188.492033, 99.464488, 206.127899, 99.464488),\n (188.492033, 172.05, 206.127899, 172.05),\n (188.492033, 172.05, 188.492033, 99.464488),\n (206.127899, 172.05, 206.127899, 99.464488),\n (212.006521, 152.545351, 212.006521, 119.278538),\n (212.006521, 152.545351, 206.127899, 152.545351),\n (212.006521, 119.278538, 206.127899, 119.278538)\n]\nVISIBLE_CIRCLES = [\n (118.668546, 135.911945, 16.633406),\n (118.668546, 135.911945, 13.514643),\n (118.124, 136.283226, 16.831423)\n]\nVISIBLE_ARCS = [\n (118.122077, 135.757244, 56.369956, -40.078125, 40.078125),\n (118.125924, 135.757244, 56.369956, 139.921875, -139.921875)\n]\nHIDDEN_SEGMENTS = [\n (131.5386, 146.4491, 135.302, 135.9119),\n (135.302, 135.9119, 113.5611, 120.0821),\n (113.5611, 67.8286, 113.5611, 85.4645),\n (131.5386, 67.8286, 131.5386, 85.4645),\n (132.1832, 85.4645, 132.1832, 61.95),\n (101.2926, 67.8286, 101.2926, 85.4645),\n (105.1539, 61.95, 105.1539, 85.4645),\n (206.1279, 120.0821, 188.492, 120.0821),\n (206.1279, 146.4491, 188.492, 146.4491),\n (206.1279, 153.1146, 188.492, 153.1146),\n (212.0065, 149.4266, 188.492, 149.4266),\n (212.0065, 122.3973, 188.492, 122.3973)\n]\n# (orient, text, p1, p2, base) for linear; (orient, text, center, radius, angle) for diameter\nDIMENSIONS = [\n ('horizontal', '100', (161.2545, 172.05), (74.9935, 172.05), (118.124, 161.05)),\n ('vertical', '84.1463', (161.2545, 99.4645), (161.2545, 172.05), (150.2545, 135.7572)),\n ('diameter', '%%c39.0244', (118.124, 136.2832), 16.8314, 45),\n ('horizontal', '50', (74.9935, 136.2832), (118.124, 136.2832), (96.5588, 147.2832)),\n ('vertical', '42.6829', (118.124, 99.4645), (118.124, 136.2832), (107.124, 117.8739)),\n ('radius', 'R65.3481', (118.1221, 135.7573), 56.37, 135),\n ('diameter', '%%c38.5653', (118.6686, 135.9119), 16.6334, 225),\n ('diameter', '%%c31.3343', (118.6686, 135.9119), 13.5146, 315),\n ('diameter', '%%c38.5653', (118.6686, 135.9119), 16.6334, 90),\n ('diameter', '%%c31.3343', (118.6686, 135.9119), 13.5146, 0),\n ('horizontal', '20.4448', (188.492, 99.4645), (206.1279, 99.4645), (197.31, 110.4645)),\n ('horizontal', '20.4448', (188.492, 135.9119), (206.1279, 135.9119), (197.31, 146.9119)),\n ('horizontal', '20.4448', (188.492, 135.9119), (212.0065, 135.9119), (200.2493, 156.9119))\n]\n\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; _ds.dxf.dimasz = 2.5\n _ds.dxf.dimexe = 1.25; _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\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\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,\n angle=(0 if d[0] == \"horizontal\" else 90),\n 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,\n 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,\n 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,\n text=text, dimstyle=\"EZDXF\").render()\n\n doc.saveas(out_path)\n\n\nif __name__ == \"__main__\":\n out = sys.argv[1] if len(sys.argv) > 1 else \"0087_00878364_gt.dxf\"\n draw(out)\n print(\"wrote\", out)\n```"}], "images": ["images/0087_00878364.png"], "id": "0087_00878364"} {"messages": [{"role": "user", "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 97.89 mm tall. It is extruded to a thickness of 174.55 mm. A union feature: The part is a polygonal plate with 2 straight edges. It is extruded to a thickness of 174.55 mm."}, {"role": "assistant", "content": "```python\n#!/usr/bin/env python3\n# -*- coding: utf-8 -*-\n# Ground-truth 2D engineering drawing for part: 0088_00887470\n# Self-contained: reproduces the three-view DXF via ezdxf, NO FreeCAD needed.\n# Coordinates are A4 page millimetres (scale=0.29803976851165304, page=[297.0, 210.0]).\n# visible edges -> solid (layer OUTLINE); hidden edges -> dashed (layer HIDDEN)\n# dimensions -> real movable DIMENSION entities (text = true mm value)\n# Run: python 0088_00887470_gt.py [out.dxf]\nimport sys\nimport ezdxf\nimport math\n\nSCALE = 0.29803976851165304\nPAGE = [297.0, 210.0]\n\nVISIBLE_SEGMENTS = [\n (125.391245, 146.598972, 125.391245, 175.775497),\n (125.391245, 175.775497, 95.587268, 175.775497),\n (95.587268, 175.775497, 95.587268, 146.598972),\n (125.391245, 117.696984, 125.391245, 65.675497),\n (125.391245, 65.675497, 95.587268, 65.675497),\n (95.587268, 117.696984, 95.587268, 65.675497),\n (125.391245, 117.696984, 95.587268, 117.696984),\n (139.391245, 146.598972, 139.391245, 131.696984),\n (191.412732, 146.598972, 191.412732, 131.696984),\n (139.391245, 175.775497, 191.412732, 175.775497),\n (139.391245, 175.775497, 139.391245, 146.598972),\n (191.412732, 175.775497, 191.412732, 146.598972),\n (191.412732, 131.696984, 139.391245, 131.696984),\n (139.391245, 146.598972, 191.412732, 146.598972)\n]\nVISIBLE_CIRCLES = [\n\n]\nVISIBLE_ARCS = [\n (110.489256, 146.598972, 14.901988, 180.0, -0.0)\n]\nHIDDEN_SEGMENTS = [\n\n]\n# (orient, text, p1, p2, base) for linear; (orient, text, center, radius, angle) for diameter\nDIMENSIONS = [\n ('horizontal', '100', (125.3912, 175.7755), (95.5873, 175.7755), (110.4893, 164.7755)),\n ('vertical', '97.8947', (125.3912, 146.599), (125.3912, 175.7755), (114.3912, 161.1872)),\n ('radius', 'R50', (110.4893, 146.599), 14.902, 45),\n ('horizontal', '174.546', (139.3912, 146.599), (191.4127, 146.599), (165.402, 157.599)),\n ('horizontal', '174.546', (139.3912, 146.599), (191.4127, 146.599), (165.402, 157.599))\n]\n\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; _ds.dxf.dimasz = 2.5\n _ds.dxf.dimexe = 1.25; _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\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\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,\n angle=(0 if d[0] == \"horizontal\" else 90),\n 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,\n 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,\n 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,\n text=text, dimstyle=\"EZDXF\").render()\n\n doc.saveas(out_path)\n\n\nif __name__ == \"__main__\":\n out = sys.argv[1] if len(sys.argv) > 1 else \"0088_00887470_gt.dxf\"\n draw(out)\n print(\"wrote\", out)\n```"}], "images": ["images/0088_00887470.png"], "id": "0088_00887470"} {"messages": [{"role": "user", "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 11 straight edges. It is extruded to a thickness of 2.98 mm. The outline includes one or more oblique (angled) edges. A union feature: The part is a polygonal plate with 13 straight edges. It is extruded to a thickness of 2.98 mm. The outline includes one or more oblique (angled) edges."}, {"role": "assistant", "content": "```python\n#!/usr/bin/env python3\n# -*- coding: utf-8 -*-\n# Ground-truth 2D engineering drawing for part: 0090_00907056\n# Self-contained: reproduces the three-view DXF via ezdxf, NO FreeCAD needed.\n# Coordinates are A4 page millimetres (scale=0.8013539723219082, page=[297.0, 210.0]).\n# visible edges -> solid (layer OUTLINE); hidden edges -> dashed (layer HIDDEN)\n# dimensions -> real movable DIMENSION entities (text = true mm value)\n# Run: python 0090_00907056_gt.py [out.dxf]\nimport sys\nimport ezdxf\nimport math\n\nSCALE = 0.8013539723219082\nPAGE = [297.0, 210.0]\n\nVISIBLE_SEGMENTS = [\n (107.629164, 170.984147, 162.985853, 170.984147),\n (162.985853, 170.984147, 162.985853, 120.899523),\n (162.985853, 120.899523, 149.805689, 120.899523),\n (149.805689, 116.506135, 162.985853, 116.506135),\n (162.985853, 116.506135, 162.985853, 91.024485),\n (162.985853, 91.024485, 162.458647, 90.940132),\n (162.458647, 90.940132, 162.458647, 79.400836),\n (162.458647, 79.400836, 107.629164, 79.400836),\n (107.629164, 79.400836, 107.629164, 159.536233),\n (107.629164, 159.536233, 128.76819, 162.788391),\n (128.76819, 162.788391, 128.717427, 163.076048),\n (128.717427, 163.076048, 107.629164, 159.561338),\n (107.629164, 159.561338, 107.629164, 170.984147),\n (133.989493, 133.20101, 133.021692, 138.685213),\n (133.021692, 138.685213, 133.77861, 133.386787),\n (133.77861, 133.386787, 121.125652, 133.386787),\n (121.125652, 130.012665, 133.989493, 130.012665),\n (133.989493, 130.012665, 133.989493, 133.20101),\n (107.629164, 63.015853, 162.985853, 63.015853),\n (107.629164, 63.015853, 107.629164, 65.400835),\n (107.629164, 65.400835, 162.985853, 65.400835),\n (162.985853, 63.015853, 162.985853, 65.400835),\n (179.370836, 79.400836, 179.370836, 159.536233),\n (179.370836, 159.536233, 179.370836, 159.561338),\n (179.370836, 159.561338, 179.370836, 170.984147),\n (179.370836, 170.984147, 176.985853, 170.984147),\n (179.370836, 159.561338, 176.985853, 159.561338),\n (176.985853, 159.561338, 176.985853, 170.984147),\n (179.370836, 159.536233, 176.985853, 159.536233),\n (176.985853, 159.536233, 176.985853, 159.561338),\n (179.370836, 79.400836, 176.985853, 79.400836),\n (176.985853, 159.536233, 176.985853, 79.400836)\n]\nVISIBLE_CIRCLES = [\n\n]\nVISIBLE_ARCS = [\n (149.805689, 118.702829, 2.196694, 90.0, -90.0),\n (121.125652, 131.699726, 1.687061, 90.0, -90.0)\n]\nHIDDEN_SEGMENTS = [\n (128.7174, 63.0159, 128.7174, 65.4008),\n (128.7682, 65.4008, 128.7682, 63.0159),\n (133.9895, 63.0159, 133.9895, 65.4008),\n (133.0217, 63.0159, 133.0217, 65.4008),\n (162.4586, 63.0159, 162.4586, 65.4008),\n (133.7786, 63.0159, 133.7786, 65.4008),\n (147.609, 65.4008, 147.609, 63.0159),\n (119.4386, 65.4008, 119.4386, 63.0159),\n (179.3708, 163.076, 176.9859, 163.076),\n (176.9859, 162.7884, 179.3708, 162.7884),\n (179.3708, 133.201, 176.9859, 133.201),\n (179.3708, 138.6852, 176.9859, 138.6852),\n (176.9859, 130.0127, 179.3708, 130.0127),\n (179.3708, 91.0245, 176.9859, 91.0245),\n (179.3708, 90.9401, 176.9859, 90.9401),\n (179.3708, 116.5061, 176.9859, 116.5061),\n (179.3708, 120.8995, 176.9859, 120.8995),\n (179.3708, 133.3868, 176.9859, 133.3868)\n]\n# (orient, text, p1, p2, base) for linear; (orient, text, center, radius, angle) for diameter\nDIMENSIONS = [\n ('horizontal', '15.7895', (133.7786, 133.3868), (121.1257, 133.3868), (127.4521, 122.3868)),\n ('horizontal', '68.4211', (162.4586, 79.4008), (107.6292, 79.4008), (135.0439, 68.4008)),\n ('vertical', '4.2105', (121.1257, 133.3868), (121.1257, 130.0126), (132.1257, 131.6997)),\n ('vertical', '100', (107.6292, 79.4008), (107.6292, 159.5362), (96.6292, 119.4685)),\n ('radius', 'R2.1053', (121.1257, 131.6997), 1.6871, 45),\n ('horizontal', '69.0789', (107.6292, 170.9842), (162.9858, 170.9842), (135.3075, 181.9842)),\n ('vertical', '104.167', (162.9858, 170.9842), (162.9858, 87.5098), (173.9858, 129.247)),\n ('vertical', '0', (107.6292, 162.9104), (107.6292, 162.9104), (107.6292, 162.9104)),\n ('vertical', '10.0752', (107.6292, 162.9104), (107.6292, 170.9842), (96.6292, 166.9473)),\n ('aligned', '37.8567', (133.9895, 133.201), (128.7174, 163.076), (120.5208, 146.2269)),\n ('aligned', '26.6788', (128.7174, 163.076), (107.6292, 159.5614), (119.9817, 150.4684)),\n ('radius', 'R2.7412', (149.8057, 118.7028), 2.1967, 45),\n ('horizontal', '2.9762', (179.3708, 170.9842), (176.9858, 170.9842), (178.1783, 159.9842))\n]\n\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; _ds.dxf.dimasz = 2.5\n _ds.dxf.dimexe = 1.25; _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\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\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,\n angle=(0 if d[0] == \"horizontal\" else 90),\n 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,\n 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,\n 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,\n text=text, dimstyle=\"EZDXF\").render()\n\n doc.saveas(out_path)\n\n\nif __name__ == \"__main__\":\n out = sys.argv[1] if len(sys.argv) > 1 else \"0090_00907056_gt.dxf\"\n draw(out)\n print(\"wrote\", out)\n```"}], "images": ["images/0090_00907056.png"], "id": "0090_00907056"} {"messages": [{"role": "user", "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, featuring 3 circular holes (diameters 9.88, 39.51 mm). It is extruded to a thickness of 70.37 mm. The outline includes one or more oblique (angled) edges. A cut feature: The part is a square plate 52.78 x 52.78 mm. It is extruded to a thickness of -93.83 mm."}, {"role": "assistant", "content": "```python\n#!/usr/bin/env python3\n# -*- coding: utf-8 -*-\n# Ground-truth 2D engineering drawing for part: 0091_00918379\n# Self-contained: reproduces the three-view DXF via ezdxf, NO FreeCAD needed.\n# Coordinates are A4 page millimetres (scale=0.5121118421052857, page=[297.0, 210.0]).\n# visible edges -> solid (layer OUTLINE); hidden edges -> dashed (layer HIDDEN)\n# dimensions -> real movable DIMENSION entities (text = true mm value)\n# Run: python 0091_00918379_gt.py [out.dxf]\nimport sys\nimport ezdxf\nimport math\n\nSCALE = 0.5121118421052857\nPAGE = [297.0, 210.0]\n\nVISIBLE_SEGMENTS = [\n (140.925658, 172.05, 140.925658, 120.838816),\n (96.036842, 172.05, 140.925658, 172.05),\n (132.074342, 111.9875, 104.888158, 111.9875),\n (96.036842, 120.838816, 96.036842, 172.05),\n (140.925658, 61.95, 140.925658, 97.9875),\n (96.036842, 61.95, 96.036842, 97.9875),\n (96.036842, 97.9875, 140.925658, 97.9875),\n (96.036842, 61.95, 140.925658, 61.95),\n (190.963158, 172.05, 154.925658, 172.05),\n (190.963158, 111.9875, 190.963158, 120.838816),\n (190.963158, 120.838816, 190.963158, 172.05),\n (154.925658, 111.9875, 154.925658, 120.838816),\n (154.925658, 120.838816, 154.925658, 172.05),\n (190.963158, 111.9875, 154.925658, 111.9875),\n (190.963158, 120.838816, 154.925658, 120.838816)\n]\nVISIBLE_CIRCLES = [\n (118.797368, 137.276974, 10.115789),\n (118.797368, 153.715132, 2.528947),\n (118.797368, 120.838816, 2.528947)\n]\nVISIBLE_ARCS = [\n (132.074342, 120.838816, 8.851316, -90.0, -0.0),\n (104.888158, 120.838816, 8.851316, -180.0, -90.0)\n]\nHIDDEN_SEGMENTS = [\n (132.0743, 111.9875, 132.0743, 160.0375),\n (105.0462, 160.0375, 132.0743, 160.0375),\n (105.0462, 111.9875, 105.0462, 160.0375),\n (132.0743, 70.9594, 132.0743, 97.9875),\n (132.0743, 70.9594, 105.0462, 70.9594),\n (105.0462, 70.9594, 105.0462, 97.9875),\n (128.9132, 61.95, 128.9132, 70.9594),\n (121.3263, 61.95, 121.3263, 70.9594),\n (108.6816, 70.9594, 108.6816, 61.95),\n (116.2684, 70.9594, 116.2684, 61.95),\n (154.9257, 160.0375, 181.9538, 160.0375),\n (181.9538, 111.9875, 181.9538, 160.0375),\n (181.9538, 127.1612, 190.9632, 127.1612),\n (181.9538, 147.3928, 190.9632, 147.3928),\n (181.9538, 151.1862, 190.9632, 151.1862),\n (181.9538, 156.2441, 190.9632, 156.2441),\n (181.9538, 118.3099, 190.9632, 118.3099),\n (181.9538, 123.3678, 190.9632, 123.3678)\n]\n# (orient, text, p1, p2, base) for linear; (orient, text, center, radius, angle) for diameter\nDIMENSIONS = [\n ('horizontal', '53.0864', (132.0743, 111.9875), (104.8882, 111.9875), (118.4813, 100.9875)),\n ('horizontal', '87.6543', (96.0368, 172.05), (140.9256, 172.05), (118.4812, 183.05)),\n ('vertical', '100', (140.9256, 172.05), (140.9256, 120.8388), (151.9256, 146.4444)),\n ('diameter', '%%c39.5062', (118.7974, 137.277), 10.1158, 45),\n ('horizontal', '52.7778', (96.0368, 137.277), (118.7974, 137.277), (107.4171, 148.277)),\n ('vertical', '49.3827', (118.7974, 172.05), (118.7974, 137.277), (129.7974, 154.6635)),\n ('diameter', '%%c9.8765', (118.7974, 153.7151), 2.5289, 45),\n ('vertical', '32.0988', (118.7974, 172.05), (118.7974, 153.7151), (129.7974, 162.8826)),\n ('diameter', '%%c9.8765', (118.7974, 120.8388), 2.5289, 45),\n ('vertical', '64.1975', (118.7974, 172.05), (118.7974, 120.8388), (129.7974, 146.4444)),\n ('radius', 'R17.284', (132.0743, 120.8388), 8.8513, 45),\n ('horizontal', '70.3704', (190.9632, 172.05), (154.9256, 172.05), (172.9444, 161.05)),\n ('vertical', '93.8272', (154.9256, 111.9875), (154.9256, 160.0375), (143.9256, 136.0125)),\n ('vertical', '70.3704', (132.0743, 97.9875), (132.0743, 70.9594), (143.0743, 84.4734))\n]\n\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; _ds.dxf.dimasz = 2.5\n _ds.dxf.dimexe = 1.25; _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\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\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,\n angle=(0 if d[0] == \"horizontal\" else 90),\n 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,\n 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,\n 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,\n text=text, dimstyle=\"EZDXF\").render()\n\n doc.saveas(out_path)\n\n\nif __name__ == \"__main__\":\n out = sys.argv[1] if len(sys.argv) > 1 else \"0091_00918379_gt.dxf\"\n draw(out)\n print(\"wrote\", out)\n```"}], "images": ["images/0091_00918379.png"], "id": "0091_00918379"} {"messages": [{"role": "user", "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 4.35 mm. The outline includes one or more oblique (angled) edges. A union feature: The part is a rectangular plate 39.13 mm wide and 29.24 mm tall. It is extruded to a thickness of 4.35 mm. A union feature: The part is a polygonal plate with 6 straight edges. It is extruded to a thickness of 4.35 mm. The outline includes one or more oblique (angled) edges."}, {"role": "assistant", "content": "```python\n#!/usr/bin/env python3\n# -*- coding: utf-8 -*-\n# Ground-truth 2D engineering drawing for part: 0098_00987561\n# Self-contained: reproduces the three-view DXF via ezdxf, NO FreeCAD needed.\n# Coordinates are A4 page millimetres (scale=0.675389192666454, page=[297.0, 210.0]).\n# visible edges -> solid (layer OUTLINE); hidden edges -> dashed (layer HIDDEN)\n# dimensions -> real movable DIMENSION entities (text = true mm value)\n# Run: python 0098_00987561_gt.py [out.dxf]\nimport sys\nimport ezdxf\nimport math\n\nSCALE = 0.675389192666454\nPAGE = [297.0, 210.0]\n\nVISIBLE_SEGMENTS = [\n (141.919599, 85.848152, 145.855505, 87.160121),\n (141.589889, 172.05, 141.589889, 122.104077),\n (114.069454, 86.768591, 101.458068, 83.09027),\n (101.458068, 83.09027, 101.458068, 78.886475),\n (141.919599, 85.717642, 141.919599, 85.848152),\n (168.605457, 126.261601, 168.605457, 153.277169),\n (168.605457, 153.277169, 168.018162, 153.277169),\n (168.018162, 153.277169, 168.018162, 172.05),\n (168.018162, 172.05, 141.589889, 172.05),\n (141.589889, 64.886475, 137.190329, 64.886475),\n (137.190329, 64.886475, 114.069454, 64.886475),\n (114.069454, 64.886475, 101.458068, 64.886475),\n (168.605457, 64.886475, 168.018162, 64.886475),\n (168.018162, 64.886475, 141.589889, 64.886475),\n (141.589889, 61.95, 137.190329, 61.95),\n (137.190329, 61.95, 114.069454, 61.95),\n (114.069454, 61.95, 101.458068, 61.95),\n (168.605457, 61.95, 168.018162, 61.95),\n (168.018162, 61.95, 141.589889, 61.95),\n (168.605457, 64.886475, 168.605457, 61.95),\n (141.589889, 64.886475, 141.589889, 61.95),\n (168.018162, 64.886475, 168.018162, 61.95),\n (137.190329, 64.886475, 137.190329, 61.95),\n (101.458068, 64.886475, 101.458068, 61.95),\n (114.069454, 64.886475, 114.069454, 61.95),\n (182.605457, 122.104077, 182.605457, 172.05),\n (182.605457, 122.104077, 182.605457, 103.583773),\n (182.605457, 103.583773, 182.605457, 86.768591),\n (182.605457, 86.768591, 182.605457, 83.09027),\n (182.605457, 83.09027, 182.605457, 78.886475),\n (185.541932, 172.05, 185.541932, 122.104077),\n (185.541932, 122.104077, 185.541932, 103.583773),\n (185.541932, 103.583773, 185.541932, 86.768591),\n (185.541932, 86.768591, 185.541932, 83.09027),\n (185.541932, 83.09027, 185.541932, 78.886475),\n (185.541932, 122.104077, 182.605457, 122.104077),\n (182.605457, 172.05, 185.541932, 172.05),\n (182.605457, 78.886475, 185.541932, 78.886475),\n (182.605457, 103.583773, 185.541932, 103.583773),\n (182.605457, 83.09027, 185.541932, 83.09027),\n (182.605457, 86.768591, 185.541932, 86.768591)\n]\nVISIBLE_CIRCLES = [\n\n]\nVISIBLE_ARCS = [\n (132.858054, 119.656181, 34.998966, -68.200068, -16.168818),\n (93.815718, 127.701924, 74.803607, -13.759533, -1.103283),\n (71.819329, 128.895591, 70.100327, -21.16653, -5.559695),\n (100.179751, 130.170126, 45.569914, -72.253877, -35.691377),\n (100.461022, 208.036019, 129.153393, -89.55768, -71.27643)\n]\nHIDDEN_SEGMENTS = [\n (166.4726, 64.8865, 166.4726, 61.95),\n (145.8555, 64.8865, 145.8555, 61.95),\n (182.6055, 109.9101, 185.5419, 109.9101),\n (182.6055, 85.8482, 185.5419, 85.8482),\n (182.6055, 126.2616, 185.5419, 126.2616),\n (182.6055, 85.7176, 185.5419, 85.7176),\n (182.6055, 153.2772, 185.5419, 153.2772)\n]\n# (orient, text, p1, p2, base) for linear; (orient, text, center, radius, angle) for diameter\nDIMENSIONS = [\n ('vertical', '40', (168.6055, 126.2616), (168.6055, 153.2771), (157.6055, 139.7694)),\n ('radius', 'R51.8204', (132.8581, 119.6562), 34.9989, 45),\n ('radius', 'R110.756', (93.8157, 127.7019), 74.8036, 45),\n ('horizontal', '39.1304', (141.5899, 152.2984), (168.0181, 152.2984), (154.804, 163.2984)),\n ('vertical', '29.2448', (168.0181, 152.2984), (168.0181, 172.05), (157.0181, 162.1742)),\n ('vertical', '0', (141.5899, 85.7382), (141.5899, 85.7382), (141.5899, 85.7382)),\n ('vertical', '98.5508', (141.5899, 85.7382), (141.5899, 152.2984), (130.5899, 119.0183)),\n ('horizontal', '59.9085', (101.4581, 78.8865), (141.9196, 78.8865), (121.6888, 89.8865)),\n ('vertical', '73.913', (141.9196, 78.8865), (141.9196, 128.8065), (130.9196, 103.8465)),\n ('horizontal', '59.4203', (141.5899, 85.7382), (101.4581, 85.7382), (121.524, 74.7382)),\n ('vertical', '10.1449', (101.4581, 85.7382), (101.4581, 78.8865), (112.4581, 82.3124)),\n ('aligned', '19.4508', (114.0695, 86.7686), (101.4581, 83.0903), (110.8438, 74.3694)),\n ('radius', 'R191.228', (100.461, 208.036), 129.1534, 45),\n ('radius', 'R103.793', (71.8194, 128.8956), 70.1003, 45),\n ('radius', 'R67.4721', (100.1798, 130.1701), 45.5699, 45),\n ('horizontal', '4.3478', (182.6055, 87.1601), (185.5419, 87.1601), (184.0737, 98.1601)),\n ('horizontal', '4.3478', (182.6055, 78.8865), (185.5419, 78.8865), (184.0737, 89.8865))\n]\n\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; _ds.dxf.dimasz = 2.5\n _ds.dxf.dimexe = 1.25; _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\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\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,\n angle=(0 if d[0] == \"horizontal\" else 90),\n 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,\n 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,\n 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,\n text=text, dimstyle=\"EZDXF\").render()\n\n doc.saveas(out_path)\n\n\nif __name__ == \"__main__\":\n out = sys.argv[1] if len(sys.argv) > 1 else \"0098_00987561_gt.dxf\"\n draw(out)\n print(\"wrote\", out)\n```"}], "images": ["images/0098_00987561.png"], "id": "0098_00987561"} {"messages": [{"role": "user", "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 75 mm. It is extruded to a thickness of 1707.03 mm. A union feature: The part is a circular plate with diameter 75 mm. It is extruded to a thickness of 2375 mm."}, {"role": "assistant", "content": "```python\n#!/usr/bin/env python3\n# -*- coding: utf-8 -*-\n# Ground-truth 2D engineering drawing for part: 0001_00012817\n# Self-contained: reproduces the three-view DXF via ezdxf, NO FreeCAD needed.\n# Coordinates are A4 page millimetres (scale=0.059369696969696975, page=[297.0, 210.0]).\n# visible edges -> solid (layer OUTLINE); hidden edges -> dashed (layer HIDDEN)\n# dimensions -> real movable DIMENSION entities (text = true mm value)\n# Run: python 0001_00012817_gt.py [out.dxf]\nimport sys\nimport ezdxf\nimport math\n\nSCALE = 0.059369696969696975\nPAGE = [297.0, 210.0]\n\nVISIBLE_SEGMENTS = [\n (68.134016, 177.919014, 62.197046, 177.919014),\n (68.134016, 177.919014, 68.134016, 76.573086),\n (68.134016, 76.573086, 62.197046, 76.573086),\n (68.118555, 76.573086, 68.118555, 36.915984),\n (68.118555, 36.915984, 63.665828, 36.915984),\n (62.197046, 76.573086, 62.197046, 177.919014),\n (63.665828, 36.915984, 63.665828, 76.573086),\n (82.134016, 197.855984, 82.134016, 191.919014),\n (183.479944, 197.855984, 183.479944, 191.919014),\n (223.137046, 197.113863, 223.137046, 192.661136),\n (183.479944, 197.855984, 82.134016, 197.855984),\n (183.479944, 191.919014, 82.134016, 191.919014),\n (223.137046, 197.113863, 183.479944, 197.113863),\n (223.137046, 192.661136, 183.479944, 192.661136)\n]\nVISIBLE_CIRCLES = [\n (65.165531, 194.887499, 2.968485),\n (65.892191, 194.887499, 2.226364),\n (65.165531, 194.887499, 2.226364)\n]\nVISIBLE_ARCS = [\n\n]\nHIDDEN_SEGMENTS = [\n (65.5289, 197.084, 68.1186, 194.8875),\n (68.1186, 194.8875, 65.5289, 192.691),\n (65.5289, 76.5731, 65.5289, 177.919),\n (62.9392, 76.5731, 62.9392, 177.919)\n]\n# (orient, text, p1, p2, base) for linear; (orient, text, center, radius, angle) for diameter\nDIMENSIONS = [\n ('diameter', '%%c100', (65.1655, 194.8875), 2.9685, 45),\n ('diameter', '%%c75', (65.1655, 194.8875), 2.2264, 135),\n ('diameter', '%%c75', (65.8922, 194.8875), 2.2264, 225),\n ('horizontal', '1707.03', (82.134, 194.8875), (223.137, 194.8875), (152.6355, 215.8875))\n]\n\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; _ds.dxf.dimasz = 2.5\n _ds.dxf.dimexe = 1.25; _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\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\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,\n angle=(0 if d[0] == \"horizontal\" else 90),\n 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,\n 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,\n 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,\n text=text, dimstyle=\"EZDXF\").render()\n\n doc.saveas(out_path)\n\n\nif __name__ == \"__main__\":\n out = sys.argv[1] if len(sys.argv) > 1 else \"0001_00012817_gt.dxf\"\n draw(out)\n print(\"wrote\", out)\n```"}], "images": ["images/0001_00012817.png"], "id": "0001_00012817"} {"messages": [{"role": "user", "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 12.5 mm. It is extruded to a thickness of 24.74 mm. A union feature: The part is a circular plate with diameter 13.02 mm. It is extruded to a thickness of 49.48 mm. A union feature: The part is a circular plate with diameter 12.75 mm. It is extruded to a thickness of 49.48 mm. A union feature: The part is a circular plate with diameter 13.02 mm. It is extruded to a thickness of 49.48 mm. A union feature: The part is a circular plate with diameter 12.75 mm. It is extruded to a thickness of 49.48 mm. A union feature: The part is a circular plate with diameter 13.02 mm. It is extruded to a thickness of 49.48 mm. A union feature: The part is a circular plate with diameter 12.75 mm. It is extruded to a thickness of 49.48 mm. A union feature: The part is a circular plate with diameter 13.02 mm. It is extruded to a thickness of 49.48 mm. A union feature: The part is a circular plate with diameter 12.75 mm. It is extruded to a thickness of 49.48 mm."}, {"role": "assistant", "content": "```python\n#!/usr/bin/env python3\n# -*- coding: utf-8 -*-\n# Ground-truth 2D engineering drawing for part: 0037_00373111\n# Self-contained: reproduces the three-view DXF via ezdxf, NO FreeCAD needed.\n# Coordinates are A4 page millimetres (scale=0.6428989547038313, page=[297.0, 210.0]).\n# visible edges -> solid (layer OUTLINE); hidden edges -> dashed (layer HIDDEN)\n# dimensions -> real movable DIMENSION entities (text = true mm value)\n# Run: python 0037_00373111_gt.py [out.dxf]\nimport sys\nimport ezdxf\nimport math\n\nSCALE = 0.6428989547038313\nPAGE = [297.0, 210.0]\n\nVISIBLE_SEGMENTS = [\n (149.570221, 98.069467, 85.280325, 98.069467),\n (149.570221, 98.069467, 149.570221, 82.164414),\n (149.570221, 82.164414, 85.280325, 82.164414),\n (96.302247, 66.259362, 89.587944, 66.259362),\n (144.680115, 82.164414, 144.680115, 66.259362),\n (144.680115, 66.259362, 137.965811, 66.259362),\n (104.49893, 82.164414, 104.49893, 66.259362),\n (104.49893, 66.259362, 96.302247, 66.259362),\n (121.485247, 82.164414, 121.485247, 66.259362),\n (121.485247, 66.259362, 113.114167, 66.259362),\n (137.965811, 82.164414, 137.965811, 66.259362),\n (137.965811, 66.259362, 129.769128, 66.259362),\n (85.280325, 82.164414, 85.280325, 98.069467),\n (89.587944, 66.259362, 89.587944, 82.164414),\n (96.302247, 66.259362, 96.302247, 82.164414),\n (113.114167, 66.259362, 113.114167, 82.164414),\n (129.769128, 66.259362, 129.769128, 82.164414),\n (163.570221, 176.359362, 163.570221, 112.069467),\n (179.475273, 176.359362, 179.475273, 112.069467),\n (195.380325, 131.744993, 195.380325, 123.548311),\n (195.380325, 148.399955, 195.380325, 140.028875),\n (195.380325, 123.548311, 195.380325, 116.502651),\n (195.380325, 164.880519, 195.380325, 156.683836),\n (195.380325, 171.926178, 195.380325, 164.880519),\n (179.475273, 176.359362, 163.570221, 176.359362),\n (179.475273, 112.069467, 163.570221, 112.069467),\n (195.380325, 131.744993, 179.475273, 131.744993),\n (195.380325, 123.548311, 179.475273, 123.548311),\n (195.380325, 148.399955, 179.475273, 148.399955),\n (195.380325, 140.028875, 179.475273, 140.028875),\n (195.380325, 116.502651, 179.475273, 116.502651),\n (195.380325, 164.880519, 179.475273, 164.880519),\n (195.380325, 156.683836, 179.475273, 156.683836),\n (195.380325, 171.926178, 179.475273, 171.926178)\n]\nVISIBLE_CIRCLES = [\n (117.425273, 144.214415, 32.144948),\n (117.425273, 144.214415, 4.018118),\n (100.400589, 127.646652, 4.098341),\n (93.773484, 144.214415, 4.18554),\n (117.299707, 120.688192, 4.18554),\n (133.86747, 127.646652, 4.098341),\n (140.494575, 144.214415, 4.18554),\n (100.400589, 160.782177, 4.098341),\n (117.299707, 167.740638, 4.18554),\n (133.86747, 160.782177, 4.098341)\n]\nVISIBLE_ARCS = [\n\n]\nHIDDEN_SEGMENTS = [\n (97.959, 82.1644, 97.959, 66.2594),\n (136.309, 66.2594, 136.309, 82.1644),\n (195.3803, 124.8737, 179.4753, 124.8737),\n (195.3803, 163.5551, 179.4753, 163.5551)\n]\n# (orient, text, p1, p2, base) for linear; (orient, text, center, radius, angle) for diameter\nDIMENSIONS = [\n ('diameter', '%%c100', (117.4253, 144.2144), 32.1449, 45),\n ('diameter', '%%c12.5', (117.4253, 144.2144), 4.0181, 135),\n ('diameter', '%%c13.0208', (117.2997, 167.7407), 4.1855, 45),\n ('diameter', '%%c12.7496', (100.4006, 160.7822), 4.0984, 45),\n ('diameter', '%%c13.0208', (93.7735, 144.2144), 4.1855, 45),\n ('diameter', '%%c12.7496', (100.4006, 127.6467), 4.0984, 45),\n ('diameter', '%%c13.0208', (117.2997, 120.6882), 4.1855, 45),\n ('diameter', '%%c12.7496', (133.8675, 127.6467), 4.0984, 45),\n ('diameter', '%%c13.0208', (140.4946, 144.2144), 4.1855, 45),\n ('diameter', '%%c12.7496', (133.8675, 160.7822), 4.0984, 45),\n ('horizontal', '24.7396', (163.5702, 144.2144), (179.4753, 144.2144), (171.5228, 155.2144)),\n ('horizontal', '24.7396', (163.5702, 120.6882), (195.3803, 120.6882), (179.4753, 181.6882)),\n ('horizontal', '24.7396', (163.5702, 144.2144), (195.3803, 144.2144), (179.4753, 225.2144)),\n ('horizontal', '24.7396', (163.5702, 160.7822), (195.3803, 160.7822), (179.4753, 251.7822))\n]\n\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; _ds.dxf.dimasz = 2.5\n _ds.dxf.dimexe = 1.25; _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\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\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,\n angle=(0 if d[0] == \"horizontal\" else 90),\n 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,\n 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,\n 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,\n text=text, dimstyle=\"EZDXF\").render()\n\n doc.saveas(out_path)\n\n\nif __name__ == \"__main__\":\n out = sys.argv[1] if len(sys.argv) > 1 else \"0037_00373111_gt.dxf\"\n draw(out)\n print(\"wrote\", out)\n```"}], "images": ["images/0037_00373111.png"], "id": "0037_00373111"} {"messages": [{"role": "user", "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 70.59 mm. It is extruded to a thickness of 558.82 mm. A union feature: The part is a circular plate with diameter 100 mm. It is extruded to a thickness of 558.82 mm."}, {"role": "assistant", "content": "```python\n#!/usr/bin/env python3\n# -*- coding: utf-8 -*-\n# Ground-truth 2D engineering drawing for part: 0043_00438274\n# Self-contained: reproduces the three-view DXF via ezdxf, NO FreeCAD needed.\n# Coordinates are A4 page millimetres (scale=0.14399118619171428, page=[297.0, 210.0]).\n# visible edges -> solid (layer OUTLINE); hidden edges -> dashed (layer HIDDEN)\n# dimensions -> real movable DIMENSION entities (text = true mm value)\n# Run: python 0043_00438274_gt.py [out.dxf]\nimport sys\nimport ezdxf\nimport math\n\nSCALE = 0.14399118619171428\nPAGE = [297.0, 210.0]\n\nVISIBLE_SEGMENTS = [\n (102.150277, 65.58819, 87.751159, 65.58819),\n (102.150277, 146.053853, 87.751159, 146.053853),\n (87.751159, 146.053853, 87.751159, 65.58819),\n (102.150277, 146.053853, 102.150277, 65.58819),\n (196.61594, 175.68819, 196.61594, 162.446711),\n (196.61594, 160.053853, 196.61594, 162.446711),\n (116.150277, 162.446711, 196.61594, 162.446711),\n (116.150277, 175.68819, 116.150277, 162.446711),\n (116.150277, 160.053853, 116.150277, 162.446711),\n (116.150277, 175.68819, 196.61594, 175.68819),\n (116.150277, 160.053853, 196.61594, 160.053853)\n]\nVISIBLE_CIRCLES = [\n (95.347752, 165.135895, 5.082042),\n (94.950718, 168.488631, 7.199559)\n]\nVISIBLE_ARCS = [\n\n]\nHIDDEN_SEGMENTS = [\n (91.0355, 146.0539, 91.0355, 65.5882),\n (100.1688, 146.0539, 100.1688, 65.5882),\n (116.1503, 163.5283, 196.6159, 163.5283)\n]\n# (orient, text, p1, p2, base) for linear; (orient, text, center, radius, angle) for diameter\nDIMENSIONS = [\n ('diameter', '%%c70.5882', (95.3477, 165.1359), 5.082, 45),\n ('diameter', '%%c100', (94.9507, 168.4886), 7.1996, 45),\n ('horizontal', '558.823', (196.6159, 165.1359), (116.1503, 165.1359), (156.3831, 154.1359)),\n ('horizontal', '558.823', (196.6159, 168.4886), (116.1503, 168.4886), (156.3831, 147.4886))\n]\n\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; _ds.dxf.dimasz = 2.5\n _ds.dxf.dimexe = 1.25; _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\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\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,\n angle=(0 if d[0] == \"horizontal\" else 90),\n 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,\n 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,\n 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,\n text=text, dimstyle=\"EZDXF\").render()\n\n doc.saveas(out_path)\n\n\nif __name__ == \"__main__\":\n out = sys.argv[1] if len(sys.argv) > 1 else \"0043_00438274_gt.dxf\"\n draw(out)\n print(\"wrote\", out)\n```"}], "images": ["images/0043_00438274.png"], "id": "0043_00438274"} {"messages": [{"role": "user", "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 87.5 mm. It is extruded to a thickness of 113.1 mm. A union feature: The part is a circular plate with diameter 19.82 mm. It is extruded to a thickness of 70.68 mm. A union feature: The part is a circular plate with diameter 19.05 mm. It is extruded to a thickness of 70.68 mm."}, {"role": "assistant", "content": "```python\n#!/usr/bin/env python3\n# -*- coding: utf-8 -*-\n# Ground-truth 2D engineering drawing for part: 0055_00552173\n# Self-contained: reproduces the three-view DXF via ezdxf, NO FreeCAD needed.\n# Coordinates are A4 page millimetres (scale=0.45097206703918674, page=[297.0, 210.0]).\n# visible edges -> solid (layer OUTLINE); hidden edges -> dashed (layer HIDDEN)\n# dimensions -> real movable DIMENSION entities (text = true mm value)\n# Run: python 0055_00552173_gt.py [out.dxf]\nimport sys\nimport ezdxf\nimport math\n\nSCALE = 0.45097206703918674\nPAGE = [297.0, 210.0]\n\nVISIBLE_SEGMENTS = [\n (89.4818, 154.798809, 89.4818, 177.347412),\n (89.4818, 132.250205, 89.4818, 154.798809),\n (140.484593, 154.798809, 140.484593, 177.347412),\n (140.484593, 132.250205, 140.484593, 154.798809),\n (89.4818, 132.250205, 140.484593, 132.250205),\n (89.4818, 177.347412, 140.484593, 177.347412),\n (107.403006, 73.152998, 89.4818, 73.152998),\n (89.4818, 73.152998, 89.4818, 118.250205),\n (140.484593, 73.152998, 133.136164, 73.152998),\n (124.54622, 73.152998, 115.75183, 73.152998),\n (140.484593, 73.152998, 140.484593, 118.250205),\n (133.136164, 74.073046, 133.040731, 74.359072),\n (133.040731, 74.359072, 132.845364, 74.59301),\n (132.845364, 74.59301, 132.611416, 74.789139),\n (132.611416, 74.789139, 132.357459, 74.958778),\n (132.357459, 74.958778, 132.090884, 75.10789),\n (132.090884, 75.10789, 131.815377, 75.239814),\n (131.815377, 75.239814, 131.53309, 75.356552),\n (131.53309, 75.356552, 131.24543, 75.45936),\n (131.24543, 75.45936, 130.953411, 75.549049),\n (130.953411, 75.549049, 130.657817, 75.626151),\n (130.657817, 75.626151, 130.359298, 75.691018),\n (130.359298, 75.691018, 130.058419, 75.743878),\n (130.058419, 75.743878, 129.755695, 75.784878),\n (129.755695, 75.784878, 129.45161, 75.814111),\n (129.45161, 75.814111, 129.146624, 75.831632),\n (129.146624, 75.831632, 128.841192, 75.837469),\n (128.841192, 75.837469, 128.53576, 75.831632),\n (128.53576, 75.831632, 128.230775, 75.814111),\n (128.230775, 75.814111, 127.926689, 75.784878),\n (127.926689, 75.784878, 127.623965, 75.743878),\n (127.623965, 75.743878, 127.323087, 75.691018),\n (127.323087, 75.691018, 127.024567, 75.626151),\n (127.024567, 75.626151, 126.728973, 75.549049),\n (126.728973, 75.549049, 126.436954, 75.459359),\n (126.436954, 75.459359, 126.149295, 75.356552),\n (126.149295, 75.356552, 125.867007, 75.239814),\n (125.867007, 75.239814, 125.5915, 75.10789),\n (125.5915, 75.10789, 125.324925, 74.958778),\n (125.324925, 74.958778, 125.070968, 74.789139),\n (125.070968, 74.789139, 124.83702, 74.593009),\n (124.83702, 74.593009, 124.641654, 74.359072),\n (124.641654, 74.359072, 124.546221, 74.073046),\n (116.045755, 73.152998, 116.045755, 64.059737),\n (116.045755, 64.059737, 107.109081, 64.059737),\n (133.136164, 74.073046, 133.136164, 64.059737),\n (133.136164, 64.059737, 124.54622, 64.059737),\n (89.4818, 118.250205, 140.484593, 118.250205),\n (107.109081, 64.059737, 107.109081, 73.152998),\n (124.54622, 64.059737, 124.54622, 74.073046),\n (208.675061, 157.673308, 208.675061, 148.736634),\n (208.675061, 165.46913, 208.675061, 157.673308),\n (176.798315, 157.673308, 176.798315, 148.736634),\n (176.798315, 165.46913, 176.798315, 157.673308),\n (199.537143, 153.380391, 199.556557, 153.732174),\n (199.556557, 153.732174, 199.569961, 154.068212),\n (199.5818, 154.798809, 199.569961, 154.068212),\n (199.483741, 152.698194, 199.351102, 151.581571),\n (199.483741, 152.698194, 199.51622, 153.080334),\n (208.675061, 157.673308, 199.397829, 157.673308),\n (208.675061, 148.736634, 198.751612, 148.736634),\n (208.675061, 165.46913, 196.897329, 165.46913),\n (196.552706, 157.673308, 176.798315, 157.673308),\n (195.80882, 148.736634, 176.798315, 148.736634),\n (193.628926, 165.46913, 176.798315, 165.46913)\n]\nVISIBLE_CIRCLES = [\n (111.577418, 153.204971, 4.468337),\n (128.841192, 161.174158, 4.294972),\n (177.033197, 154.798809, 22.548603),\n (177.033197, 154.798809, 19.730028)\n]\nVISIBLE_ARCS = [\n (111.577418, 25.885113, 47.451856, 84.953079, 95.046921),\n (177.033165, 154.798799, 22.548633, -12.71527, -8.202928)\n]\nHIDDEN_SEGMENTS = [\n (133.1362, 161.174, 133.1362, 161.1742),\n (133.1362, 161.1742, 133.0553, 162.0034),\n (133.0553, 162.0034, 132.9954, 162.2648),\n (132.9954, 162.2648, 132.7755, 162.897),\n (132.5752, 163.2964, 132.4974, 163.4278),\n (132.4974, 163.4278, 131.8095, 164.2783),\n (131.8095, 164.2783, 129.8582, 165.347),\n (130.7922, 165.0004, 129.8581, 165.347),\n (129.8581, 165.347, 129.7032, 165.3817),\n (129.7032, 165.3817, 128.3052, 165.4356),\n (125.9454, 164.3461, 125.256, 163.5391),\n (125.256, 163.5391, 125.1902, 163.4362),\n (125.1902, 163.4362, 125.0423, 163.178),\n (125.0068, 159.2392, 125.2157, 158.8714),\n (125.2157, 158.8714, 125.749, 158.1934),\n (125.749, 158.1934, 126.0504, 157.9095),\n (89.4818, 135.0688, 140.4846, 135.0688),\n (89.4818, 174.5288, 140.4846, 174.5288),\n (116.0458, 76.0361, 115.7518, 75.9716),\n (107.403, 75.9716, 107.1091, 76.0361),\n (107.1091, 76.0361, 116.0458, 76.0361),\n (107.403, 75.9716, 89.4818, 75.9716),\n (115.7518, 75.9716, 107.403, 75.9716),\n (140.4846, 75.9716, 115.7518, 75.9716),\n (133.1362, 77.03, 124.5462, 77.03),\n (124.5462, 77.03, 133.1362, 77.03),\n (116.0458, 95.9365, 116.0458, 76.0361),\n (116.0458, 95.9365, 107.1091, 95.9365),\n (133.1362, 95.9365, 133.1362, 77.03),\n (133.1362, 95.9365, 124.5462, 95.9365),\n (89.4818, 115.4316, 140.4846, 115.4316),\n (107.1091, 76.0361, 107.1091, 95.9365),\n (124.5462, 77.03, 124.5462, 95.9365),\n (208.6751, 156.8792, 199.4856, 156.8792),\n (196.6532, 156.8792, 176.7983, 156.8792)\n]\n# (orient, text, p1, p2, base) for linear; (orient, text, center, radius, angle) for diameter\nDIMENSIONS = [\n ('diameter', '%%c19.8165', (111.5774, 153.205), 4.4683, 45),\n ('diameter', '%%c19.0476', (128.8412, 161.1742), 4.295, 45),\n ('diameter', '%%c100', (177.0332, 154.7988), 22.5486, 45),\n ('diameter', '%%c87.5', (177.0332, 154.7988), 19.73, 135),\n ('horizontal', '0.4514', (140.4846, 95.7016), (89.4818, 95.7016), (114.9832, 84.7016))\n]\n\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; _ds.dxf.dimasz = 2.5\n _ds.dxf.dimexe = 1.25; _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\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\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,\n angle=(0 if d[0] == \"horizontal\" else 90),\n 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,\n 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,\n 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,\n text=text, dimstyle=\"EZDXF\").render()\n\n doc.saveas(out_path)\n\n\nif __name__ == \"__main__\":\n out = sys.argv[1] if len(sys.argv) > 1 else \"0055_00552173_gt.dxf\"\n draw(out)\n print(\"wrote\", out)\n```"}], "images": ["images/0055_00552173.png"], "id": "0055_00552173"} {"messages": [{"role": "user", "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 62.5 mm. It is extruded to a thickness of 209.79 mm. A union feature: The part is a circular plate with diameter 64 mm. It is extruded to a thickness of 209.79 mm. A union feature: The part is a circular plate with diameter 56 mm. It is extruded to a thickness of 170.21 mm."}, {"role": "assistant", "content": "```python\n#!/usr/bin/env python3\n# -*- coding: utf-8 -*-\n# Ground-truth 2D engineering drawing for part: 0002_00021176\n# Self-contained: reproduces the three-view DXF via ezdxf, NO FreeCAD needed.\n# Coordinates are A4 page millimetres (scale=0.20020833333333335, page=[297.0, 210.0]).\n# visible edges -> solid (layer OUTLINE); hidden edges -> dashed (layer HIDDEN)\n# dimensions -> real movable DIMENSION entities (text = true mm value)\n# Run: python 0002_00021176_gt.py [out.dxf]\nimport sys\nimport ezdxf\nimport math\n\nSCALE = 0.20020833333333335\nPAGE = [297.0, 210.0]\n\nVISIBLE_SEGMENTS = [\n (105.474526, 140.06604, 85.453693, 140.06604),\n (105.474526, 140.06604, 105.474526, 98.064),\n (105.474526, 98.064, 85.453693, 98.064),\n (100.627816, 98.064, 100.627816, 63.986874),\n (100.627816, 63.986874, 89.416149, 63.986874),\n (85.453693, 98.064, 85.453693, 140.06604),\n (89.416149, 63.986874, 89.416149, 98.064),\n (119.474526, 174.086874, 119.474526, 154.06604),\n (161.476566, 174.086874, 161.476566, 154.06604),\n (195.553693, 169.68229, 195.553693, 158.470624),\n (161.476566, 174.086874, 119.474526, 174.086874),\n (161.476566, 154.06604, 119.474526, 154.06604),\n (195.553693, 169.68229, 161.476566, 169.68229),\n (195.553693, 158.470624, 161.476566, 158.470624)\n]\nVISIBLE_CIRCLES = [\n (95.46411, 164.076457, 10.010417),\n (95.021983, 164.076457, 5.605833),\n (95.46411, 164.076457, 6.25651),\n (95.030325, 164.076457, 6.406667)\n]\nVISIBLE_ARCS = [\n\n]\nHIDDEN_SEGMENTS = [\n (97.4389, 98.064, 97.4389, 140.066),\n (101.7206, 98.064, 101.7206, 140.066),\n (101.437, 98.064, 101.437, 140.066)\n]\n# (orient, text, p1, p2, base) for linear; (orient, text, center, radius, angle) for diameter\nDIMENSIONS = [\n ('diameter', '%%c100', (95.4641, 164.0765), 10.0104, 45),\n ('diameter', '%%c62.5', (95.4641, 164.0765), 6.2565, 135),\n ('diameter', '%%c64', (95.0303, 164.0765), 6.4067, 225),\n ('diameter', '%%c56', (95.022, 164.0765), 5.6058, 315),\n ('horizontal', '380', (161.4766, 164.0765), (195.5537, 164.0765), (178.5151, 195.0765))\n]\n\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; _ds.dxf.dimasz = 2.5\n _ds.dxf.dimexe = 1.25; _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\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\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,\n angle=(0 if d[0] == \"horizontal\" else 90),\n 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,\n 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,\n 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,\n text=text, dimstyle=\"EZDXF\").render()\n\n doc.saveas(out_path)\n\n\nif __name__ == \"__main__\":\n out = sys.argv[1] if len(sys.argv) > 1 else \"0002_00021176_gt.dxf\"\n draw(out)\n print(\"wrote\", out)\n```"}], "images": ["images/0002_00021176.png"], "id": "0002_00021176"} {"messages": [{"role": "user", "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 73.44 mm, featuring a circular hole of diameter 59.67 mm. It is extruded to a thickness of 74.22 mm. A union feature: The 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 4.64 mm."}, {"role": "assistant", "content": "```python\n#!/usr/bin/env python3\n# -*- coding: utf-8 -*-\n# Ground-truth 2D engineering drawing for part: 0002_00027922\n# Self-contained: reproduces the three-view DXF via ezdxf, NO FreeCAD needed.\n# Coordinates are A4 page millimetres (scale=0.5516053811659193, page=[297.0, 210.0]).\n# visible edges -> solid (layer OUTLINE); hidden edges -> dashed (layer HIDDEN)\n# dimensions -> real movable DIMENSION entities (text = true mm value)\n# Run: python 0002_00027922_gt.py [out.dxf]\nimport sys\nimport ezdxf\nimport math\n\nSCALE = 0.5516053811659193\nPAGE = [297.0, 210.0]\n\nVISIBLE_SEGMENTS = [\n (132.620402, 116.679596, 77.459864, 116.679596),\n (132.620402, 116.679596, 132.620402, 114.12088),\n (132.620402, 114.12088, 77.459864, 114.12088),\n (125.218081, 75.740134, 84.709561, 75.740134),\n (125.218081, 114.12088, 125.218081, 75.740134),\n (77.459864, 114.12088, 77.459864, 116.679596),\n (84.709561, 75.740134, 84.709561, 114.12088),\n (146.620403, 185.840135, 146.620403, 130.679597),\n (149.179119, 185.840135, 149.179119, 130.679597),\n (187.559864, 178.514126, 187.559864, 138.005605),\n (149.179119, 185.840135, 146.620403, 185.840135),\n (149.179119, 130.679597, 146.620403, 130.679597),\n (187.559864, 178.514126, 149.179119, 178.514126),\n (187.559864, 138.005605, 149.179119, 138.005605)\n]\nVISIBLE_CIRCLES = [\n (105.040133, 158.259866, 27.580269),\n (104.963821, 158.259866, 16.456586),\n (104.963821, 158.259866, 20.25426)\n]\nVISIBLE_ARCS = [\n\n]\nHIDDEN_SEGMENTS = [\n (121.4204, 116.6796, 121.4204, 75.7401),\n (88.5072, 75.7401, 88.5072, 116.6796),\n (187.5599, 174.7165, 146.6204, 174.7165),\n (187.5599, 141.8033, 146.6204, 141.8033)\n]\n# (orient, text, p1, p2, base) for linear; (orient, text, center, radius, angle) for diameter\nDIMENSIONS = [\n ('diameter', '%%c73.4375', (104.9638, 158.2599), 20.2543, 45),\n ('diameter', '%%c59.668', (104.9638, 158.2599), 16.4566, 135),\n ('diameter', '%%c100', (105.0401, 158.2599), 27.5803, 45),\n ('diameter', '%%c72.9167', (105.0401, 158.2599), 20.1106, 135),\n ('horizontal', '4.6387', (146.6204, 158.2599), (187.5599, 158.2599), (167.0901, 169.2599)),\n ('horizontal', '74.2188', (146.6204, 158.2599), (149.1791, 158.2599), (147.8998, 179.2599))\n]\n\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; _ds.dxf.dimasz = 2.5\n _ds.dxf.dimexe = 1.25; _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\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\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,\n angle=(0 if d[0] == \"horizontal\" else 90),\n 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,\n 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,\n 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,\n text=text, dimstyle=\"EZDXF\").render()\n\n doc.saveas(out_path)\n\n\nif __name__ == \"__main__\":\n out = sys.argv[1] if len(sys.argv) > 1 else \"0002_00027922_gt.dxf\"\n draw(out)\n print(\"wrote\", out)\n```"}], "images": ["images/0002_00027922.png"], "id": "0002_00027922"} {"messages": [{"role": "user", "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 107.95 mm. A union feature: The part is a circular plate with diameter 100 mm. It is extruded to a thickness of -107.95 mm."}, {"role": "assistant", "content": "```python\n#!/usr/bin/env python3\n# -*- coding: utf-8 -*-\n# Ground-truth 2D engineering drawing for part: 0011_00117181\n# Self-contained: reproduces the three-view DXF via ezdxf, NO FreeCAD needed.\n# Coordinates are A4 page millimetres (scale=0.3042014388489699, page=[297.0, 210.0]).\n# visible edges -> solid (layer OUTLINE); hidden edges -> dashed (layer HIDDEN)\n# dimensions -> real movable DIMENSION entities (text = true mm value)\n# Run: python 0011_00117181_gt.py [out.dxf]\nimport sys\nimport ezdxf\nimport math\n\nSCALE = 0.3042014388489699\nPAGE = [297.0, 210.0]\n\nVISIBLE_SEGMENTS = [\n (111.265108, 102.394964, 111.265108, 69.555036),\n (111.265108, 69.555036, 80.844964, 69.555036),\n (111.265108, 102.394964, 111.265108, 135.234892),\n (111.265108, 135.234892, 80.844964, 135.234892),\n (80.844964, 69.555036, 80.844964, 102.394964),\n (80.844964, 135.234892, 80.844964, 102.394964),\n (190.944964, 179.655036, 190.944964, 149.234892),\n (125.265108, 179.655036, 125.265108, 149.234892),\n (190.944964, 179.655036, 158.105036, 179.655036),\n (190.944964, 149.234892, 158.105036, 149.234892),\n (125.265108, 149.234892, 158.105036, 149.234892),\n (125.265108, 179.655036, 158.105036, 179.655036)\n]\nVISIBLE_CIRCLES = [\n (96.055036, 164.444964, 15.210072)\n]\nVISIBLE_ARCS = [\n\n]\nHIDDEN_SEGMENTS = [\n\n]\n# (orient, text, p1, p2, base) for linear; (orient, text, center, radius, angle) for diameter\nDIMENSIONS = [\n ('diameter', '%%c100', (96.055, 164.445), 15.2101, 45),\n ('diameter', '%%c100', (96.055, 164.445), 15.2101, 135),\n ('horizontal', '215.909', (158.105, 164.445), (190.945, 164.445), (174.525, 175.445)),\n ('horizontal', '107.954', (158.105, 164.445), (125.2651, 164.445), (141.6851, 143.445))\n]\n\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; _ds.dxf.dimasz = 2.5\n _ds.dxf.dimexe = 1.25; _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\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\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,\n angle=(0 if d[0] == \"horizontal\" else 90),\n 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,\n 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,\n 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,\n text=text, dimstyle=\"EZDXF\").render()\n\n doc.saveas(out_path)\n\n\nif __name__ == \"__main__\":\n out = sys.argv[1] if len(sys.argv) > 1 else \"0011_00117181_gt.dxf\"\n draw(out)\n print(\"wrote\", out)\n```"}], "images": ["images/0011_00117181.png"], "id": "0011_00117181"} {"messages": [{"role": "user", "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 395.83 mm. A union feature: The part is a circular plate with diameter 100 mm. It is extruded to a thickness of 395.83 mm."}, {"role": "assistant", "content": "```python\n#!/usr/bin/env python3\n# -*- coding: utf-8 -*-\n# Ground-truth 2D engineering drawing for part: 0012_00122765\n# Self-contained: reproduces the three-view DXF via ezdxf, NO FreeCAD needed.\n# Coordinates are A4 page millimetres (scale=0.10777570093458386, page=[297.0, 210.0]).\n# visible edges -> solid (layer OUTLINE); hidden edges -> dashed (layer HIDDEN)\n# dimensions -> real movable DIMENSION entities (text = true mm value)\n# Run: python 0012_00122765_gt.py [out.dxf]\nimport sys\nimport ezdxf\nimport math\n\nSCALE = 0.10777570093458386\nPAGE = [297.0, 210.0]\n\nVISIBLE_SEGMENTS = [\n (96.533177, 107.305607, 96.533177, 64.644392),\n (96.533177, 64.644392, 85.755607, 64.644392),\n (96.533177, 107.305607, 96.533177, 149.966822),\n (96.533177, 149.966822, 85.755607, 149.966822),\n (85.755607, 64.644392, 85.755607, 107.305607),\n (85.755607, 149.966822, 85.755607, 107.305607),\n (195.855608, 174.744393, 195.855608, 163.966823),\n (110.533178, 174.744393, 110.533178, 163.966823),\n (195.855608, 174.744393, 153.194393, 174.744393),\n (195.855608, 163.966823, 153.194393, 163.966823),\n (110.533178, 163.966823, 153.194393, 163.966823),\n (110.533178, 174.744393, 153.194393, 174.744393)\n]\nVISIBLE_CIRCLES = [\n (91.144392, 169.355608, 5.388785)\n]\nVISIBLE_ARCS = [\n\n]\nHIDDEN_SEGMENTS = [\n\n]\n# (orient, text, p1, p2, base) for linear; (orient, text, center, radius, angle) for diameter\nDIMENSIONS = [\n ('diameter', '%%c100', (91.1444, 169.3556), 5.3888, 45),\n ('diameter', '%%c100', (91.1444, 169.3556), 5.3888, 135),\n ('horizontal', '791.667', (110.5332, 169.3556), (195.8556, 169.3556), (153.1944, 180.3556)),\n ('horizontal', '791.667', (110.5332, 169.3556), (195.8556, 169.3556), (153.1944, 190.3556))\n]\n\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; _ds.dxf.dimasz = 2.5\n _ds.dxf.dimexe = 1.25; _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\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\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,\n angle=(0 if d[0] == \"horizontal\" else 90),\n 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,\n 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,\n 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,\n text=text, dimstyle=\"EZDXF\").render()\n\n doc.saveas(out_path)\n\n\nif __name__ == \"__main__\":\n out = sys.argv[1] if len(sys.argv) > 1 else \"0012_00122765_gt.dxf\"\n draw(out)\n print(\"wrote\", out)\n```"}], "images": ["images/0012_00122765.png"], "id": "0012_00122765"} {"messages": [{"role": "user", "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 47.42 mm. A union feature: The part is a circular plate with diameter 70.83 mm, featuring a circular hole of diameter 38.37 mm. It is extruded to a thickness of 121.64 mm."}, {"role": "assistant", "content": "```python\n#!/usr/bin/env python3\n# -*- coding: utf-8 -*-\n# Ground-truth 2D engineering drawing for part: 0014_00148170\n# Self-contained: reproduces the three-view DXF via ezdxf, NO FreeCAD needed.\n# Coordinates are A4 page millimetres (scale=0.3571776092918271, page=[297.0, 210.0]).\n# visible edges -> solid (layer OUTLINE); hidden edges -> dashed (layer HIDDEN)\n# dimensions -> real movable DIMENSION entities (text = true mm value)\n# Run: python 0014_00148170_gt.py [out.dxf]\nimport sys\nimport ezdxf\nimport math\n\nSCALE = 0.3571776092918271\nPAGE = [297.0, 210.0]\n\nVISIBLE_SEGMENTS = [\n (118.028771, 131.261679, 82.31101, 131.261679),\n (118.028771, 131.261679, 118.028771, 114.325198),\n (118.028771, 114.325198, 82.31101, 114.325198),\n (112.765672, 114.325198, 112.765672, 70.87944),\n (112.765672, 70.87944, 87.465591, 70.87944),\n (82.31101, 114.325198, 82.31101, 131.261679),\n (87.465591, 70.87944, 87.465591, 114.325198),\n (132.028771, 180.97944, 132.028771, 145.261679),\n (148.965253, 180.97944, 148.965253, 145.261679),\n (192.41101, 175.7706, 192.41101, 150.47052),\n (148.965253, 180.97944, 132.028771, 180.97944),\n (148.965253, 145.261679, 132.028771, 145.261679),\n (192.41101, 175.7706, 148.965253, 175.7706),\n (192.41101, 150.47052, 148.965253, 150.47052)\n]\nVISIBLE_CIRCLES = [\n (100.16989, 163.12056, 17.85888),\n (100.16989, 163.12056, 6.69708),\n (100.115631, 163.12056, 12.65004),\n (100.115631, 163.12056, 6.852105)\n]\nVISIBLE_ARCS = [\n\n]\nHIDDEN_SEGMENTS = [\n (106.867, 131.2617, 106.867, 114.3252),\n (106.9677, 114.3252, 106.9677, 70.8794),\n (93.4728, 114.3252, 93.4728, 131.2617),\n (93.2635, 70.8794, 93.2635, 114.3252),\n (148.9653, 169.8176, 132.0288, 169.8176),\n (148.9653, 156.4235, 132.0288, 156.4235),\n (192.411, 169.9727, 148.9653, 169.9727),\n (192.411, 156.2685, 148.9653, 156.2685)\n]\n# (orient, text, p1, p2, base) for linear; (orient, text, center, radius, angle) for diameter\nDIMENSIONS = [\n ('diameter', '%%c100', (100.1699, 163.1206), 17.8589, 45),\n ('diameter', '%%c37.5', (100.1699, 163.1206), 6.6971, 135),\n ('diameter', '%%c70.8333', (100.1156, 163.1206), 12.65, 225),\n ('diameter', '%%c38.3681', (100.1156, 163.1206), 6.8521, 315),\n ('horizontal', '169.054', (132.0288, 163.1206), (148.9652, 163.1206), (140.497, 174.1206))\n]\n\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; _ds.dxf.dimasz = 2.5\n _ds.dxf.dimexe = 1.25; _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\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\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,\n angle=(0 if d[0] == \"horizontal\" else 90),\n 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,\n 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,\n 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,\n text=text, dimstyle=\"EZDXF\").render()\n\n doc.saveas(out_path)\n\n\nif __name__ == \"__main__\":\n out = sys.argv[1] if len(sys.argv) > 1 else \"0014_00148170_gt.dxf\"\n draw(out)\n print(\"wrote\", out)\n```"}], "images": ["images/0014_00148170.png"], "id": "0014_00148170"} {"messages": [{"role": "user", "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 262.75 mm. A union feature: The part is a circular plate with diameter 37.93 mm. It is extruded to a thickness of 10.24 mm."}, {"role": "assistant", "content": "```python\n#!/usr/bin/env python3\n# -*- coding: utf-8 -*-\n# Ground-truth 2D engineering drawing for part: 0015_00156460\n# Self-contained: reproduces the three-view DXF via ezdxf, NO FreeCAD needed.\n# Coordinates are A4 page millimetres (scale=0.25764869029276255, page=[297.0, 210.0]).\n# visible edges -> solid (layer OUTLINE); hidden edges -> dashed (layer HIDDEN)\n# dimensions -> real movable DIMENSION entities (text = true mm value)\n# Run: python 0015_00156460_gt.py [out.dxf]\nimport sys\nimport ezdxf\nimport math\n\nSCALE = 0.25764869029276255\nPAGE = [297.0, 210.0]\n\nVISIBLE_SEGMENTS = [\n (110.01327, 138.726348, 84.248401, 138.726348),\n (110.01327, 138.726348, 110.01327, 71.028785),\n (110.01327, 71.028785, 84.248401, 71.028785),\n (101.054796, 71.028785, 101.054796, 68.391217),\n (101.054796, 68.391217, 91.281914, 68.391217),\n (84.248401, 71.028785, 84.248401, 138.726348),\n (91.281914, 68.391217, 91.281914, 71.028785),\n (124.013271, 178.491217, 124.013271, 152.726348),\n (191.710834, 178.491217, 191.710834, 152.726348),\n (194.348401, 170.495224, 194.348401, 160.722342),\n (191.710834, 178.491217, 124.013271, 178.491217),\n (191.710834, 152.726348, 124.013271, 152.726348),\n (194.348401, 170.495224, 191.710834, 170.495224),\n (194.348401, 160.722342, 191.710834, 160.722342)\n]\nVISIBLE_CIRCLES = [\n (97.130836, 165.608783, 12.882435),\n (96.168355, 165.608783, 4.886441)\n]\nVISIBLE_ARCS = [\n\n]\nHIDDEN_SEGMENTS = [\n\n]\n# (orient, text, p1, p2, base) for linear; (orient, text, center, radius, angle) for diameter\nDIMENSIONS = [\n ('diameter', '%%c100', (97.1308, 165.6088), 12.8824, 45),\n ('diameter', '%%c37.931', (96.1684, 165.6088), 4.8864, 45),\n ('horizontal', '262.751', (124.0133, 165.6088), (191.7108, 165.6088), (157.862, 176.6088)),\n ('horizontal', '272.988', (191.7108, 165.6088), (194.3484, 165.6088), (193.0296, 186.6088))\n]\n\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; _ds.dxf.dimasz = 2.5\n _ds.dxf.dimexe = 1.25; _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\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\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,\n angle=(0 if d[0] == \"horizontal\" else 90),\n 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,\n 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,\n 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,\n text=text, dimstyle=\"EZDXF\").render()\n\n doc.saveas(out_path)\n\n\nif __name__ == \"__main__\":\n out = sys.argv[1] if len(sys.argv) > 1 else \"0015_00156460_gt.dxf\"\n draw(out)\n print(\"wrote\", out)\n```"}], "images": ["images/0015_00156460.png"], "id": "0015_00156460"} {"messages": [{"role": "user", "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 197.92 mm. A union feature: The part is a circular plate with diameter 31.25 mm, featuring a circular hole of diameter 15.62 mm. It is extruded to a thickness of -8.25 mm. A union feature: The part is a circular plate with diameter 16.67 mm. It is extruded to a thickness of -63.91 mm."}, {"role": "assistant", "content": "```python\n#!/usr/bin/env python3\n# -*- coding: utf-8 -*-\n# Ground-truth 2D engineering drawing for part: 0016_00169037\n# Self-contained: reproduces the three-view DXF via ezdxf, NO FreeCAD needed.\n# Coordinates are A4 page millimetres (scale=0.2655963533857622, page=[297.0, 210.0]).\n# visible edges -> solid (layer OUTLINE); hidden edges -> dashed (layer HIDDEN)\n# dimensions -> real movable DIMENSION entities (text = true mm value)\n# Run: python 0016_00169037_gt.py [out.dxf]\nimport sys\nimport ezdxf\nimport math\n\nSCALE = 0.2655963533857622\nPAGE = [297.0, 210.0]\n\nVISIBLE_SEGMENTS = [\n (85.482948, 84.667357, 112.042583, 84.667357),\n (112.042583, 84.667357, 112.042583, 137.233302),\n (85.482948, 137.233302, 112.042583, 137.233302),\n (102.543825, 84.667357, 102.543825, 82.477109),\n (94.243939, 82.477109, 102.543825, 82.477109),\n (100.860792, 82.477109, 100.860792, 67.692937),\n (96.434186, 67.692937, 100.860792, 67.692937),\n (85.482948, 137.233302, 85.482948, 84.667357),\n (94.243939, 82.477109, 94.243939, 84.667357),\n (96.434186, 67.692937, 96.434186, 82.477109),\n (178.608528, 151.233302, 178.608528, 177.792938),\n (126.042583, 151.233302, 126.042583, 177.792938),\n (180.798776, 160.363177, 180.798776, 168.663063),\n (195.582948, 162.299817, 195.582948, 166.726423),\n (126.042583, 151.233302, 178.608528, 151.233302),\n (126.042583, 177.792938, 178.608528, 177.792938),\n (180.798776, 168.663063, 178.608528, 168.663063),\n (180.798776, 160.363177, 178.608528, 160.363177),\n (195.582948, 166.726423, 180.798776, 166.726423),\n (195.582948, 162.299817, 180.798776, 162.299817)\n]\nVISIBLE_CIRCLES = [\n (98.762766, 164.51312, 13.279818),\n (98.393882, 164.51312, 4.149943),\n (98.647489, 164.51312, 2.213303)\n]\nVISIBLE_ARCS = [\n (98.393882, 164.51312, 2.074972, 120.16721, -120.16721)\n]\nHIDDEN_SEGMENTS = [\n (100.8608, 164.5131, 97.3512, 162.7192),\n (97.3512, 166.3071, 100.8608, 164.5131),\n (97.3512, 82.4771, 97.3512, 84.6674)\n]\n# (orient, text, p1, p2, base) for linear; (orient, text, center, radius, angle) for diameter\nDIMENSIONS = [\n ('diameter', '%%c100', (98.7628, 164.5131), 13.2798, 45),\n ('diameter', '%%c31.25', (98.3939, 164.5131), 4.1499, 135),\n ('diameter', '%%c15.625', (98.3939, 164.5131), 2.075, 225),\n ('diameter', '%%c16.6667', (98.6475, 164.5131), 2.2133, 315),\n ('horizontal', '206.163', (178.6085, 164.5131), (126.0426, 164.5131), (152.3256, 153.5131)),\n ('horizontal', '8.2465', (178.6085, 164.5131), (180.7988, 164.5131), (179.7036, 185.5131)),\n ('horizontal', '8.2465', (178.6085, 164.5131), (195.583, 164.5131), (187.0957, 195.5131))\n]\n\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; _ds.dxf.dimasz = 2.5\n _ds.dxf.dimexe = 1.25; _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\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\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,\n angle=(0 if d[0] == \"horizontal\" else 90),\n 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,\n 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,\n 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,\n text=text, dimstyle=\"EZDXF\").render()\n\n doc.saveas(out_path)\n\n\nif __name__ == \"__main__\":\n out = sys.argv[1] if len(sys.argv) > 1 else \"0016_00169037_gt.dxf\"\n draw(out)\n print(\"wrote\", out)\n```"}], "images": ["images/0016_00169037.png"], "id": "0016_00169037"} {"messages": [{"role": "user", "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 351.85 mm. A union feature: The part is a circular plate with diameter 100 mm. It is extruded to a thickness of -351.85 mm."}, {"role": "assistant", "content": "```python\n#!/usr/bin/env python3\n# -*- coding: utf-8 -*-\n# Ground-truth 2D engineering drawing for part: 0019_00196723\n# Self-contained: reproduces the three-view DXF via ezdxf, NO FreeCAD needed.\n# Coordinates are A4 page millimetres (scale=0.11957142857143656, page=[297.0, 210.0]).\n# visible edges -> solid (layer OUTLINE); hidden edges -> dashed (layer HIDDEN)\n# dimensions -> real movable DIMENSION entities (text = true mm value)\n# Run: python 0019_00196723_gt.py [out.dxf]\nimport sys\nimport ezdxf\nimport math\n\nSCALE = 0.11957142857143656\nPAGE = [297.0, 210.0]\n\nVISIBLE_SEGMENTS = [\n (97.417857, 107.010714, 97.417857, 149.082143),\n (85.460714, 149.082143, 97.417857, 149.082143),\n (97.417857, 107.010714, 97.417857, 64.939286),\n (85.460714, 64.939286, 97.417857, 64.939286),\n (85.460714, 149.082143, 85.460714, 107.010714),\n (85.460714, 64.939286, 85.460714, 107.010714),\n (111.417857, 163.082143, 111.417857, 175.039286),\n (195.560714, 163.082143, 195.560714, 175.039286),\n (111.417857, 163.082143, 153.489286, 163.082143),\n (111.417857, 175.039286, 153.489286, 175.039286),\n (195.560714, 175.039286, 153.489286, 175.039286),\n (195.560714, 163.082143, 153.489286, 163.082143)\n]\nVISIBLE_CIRCLES = [\n (91.439286, 169.060714, 5.978571)\n]\nVISIBLE_ARCS = [\n\n]\nHIDDEN_SEGMENTS = [\n\n]\n# (orient, text, p1, p2, base) for linear; (orient, text, center, radius, angle) for diameter\nDIMENSIONS = [\n ('diameter', '%%c100', (91.4393, 169.0607), 5.9786, 45),\n ('diameter', '%%c100', (91.4393, 169.0607), 5.9786, 135),\n ('horizontal', '703.704', (153.4893, 169.0607), (111.4179, 169.0607), (132.4536, 158.0607)),\n ('horizontal', '351.852', (153.4893, 169.0607), (195.5607, 169.0607), (174.525, 190.0607))\n]\n\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; _ds.dxf.dimasz = 2.5\n _ds.dxf.dimexe = 1.25; _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\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\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,\n angle=(0 if d[0] == \"horizontal\" else 90),\n 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,\n 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,\n 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,\n text=text, dimstyle=\"EZDXF\").render()\n\n doc.saveas(out_path)\n\n\nif __name__ == \"__main__\":\n out = sys.argv[1] if len(sys.argv) > 1 else \"0019_00196723_gt.dxf\"\n draw(out)\n print(\"wrote\", out)\n```"}], "images": ["images/0019_00196723.png"], "id": "0019_00196723"} {"messages": [{"role": "user", "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": "assistant", "content": "```python\n#!/usr/bin/env python3\n# -*- coding: utf-8 -*-\n# Ground-truth 2D engineering drawing for part: 0021_00214983\n# Self-contained: reproduces the three-view DXF via ezdxf, NO FreeCAD needed.\n# Coordinates are A4 page millimetres (scale=0.579012552301256, page=[297.0, 210.0]).\n# visible edges -> solid (layer OUTLINE); hidden edges -> dashed (layer HIDDEN)\n# dimensions -> real movable DIMENSION entities (text = true mm value)\n# Run: python 0021_00214983_gt.py [out.dxf]\nimport sys\nimport ezdxf\nimport math\n\nSCALE = 0.579012552301256\nPAGE = [297.0, 210.0]\n\nVISIBLE_SEGMENTS = [\n (134.135257, 114.624058, 76.234002, 114.624058),\n (134.135257, 114.624058, 134.135257, 98.785555),\n (134.135257, 98.785555, 76.234002, 98.785555),\n (125.097993, 98.785555, 125.097993, 76.425314),\n (125.097993, 76.425314, 85.084931, 76.425314),\n (76.234002, 98.785555, 76.234002, 114.624058),\n (85.084931, 76.425314, 85.084931, 98.785555),\n (148.135258, 186.525314, 148.135258, 128.624059),\n (163.973761, 186.525314, 163.973761, 128.624059),\n (186.334002, 177.581218, 186.334002, 137.568155),\n (163.973761, 186.525314, 148.135258, 186.525314),\n (163.973761, 128.624059, 148.135258, 128.624059),\n (186.334002, 177.581218, 163.973761, 177.581218),\n (186.334002, 137.568155, 163.973761, 137.568155)\n]\nVISIBLE_CIRCLES = [\n (105.18463, 157.574686, 28.950628),\n (105.091462, 157.574686, 20.006531)\n]\nVISIBLE_ARCS = [\n\n]\nHIDDEN_SEGMENTS = [\n\n]\n# (orient, text, p1, p2, base) for linear; (orient, text, center, radius, angle) for diameter\nDIMENSIONS = [\n ('diameter', '%%c100', (105.1847, 157.5747), 28.9506, 45),\n ('diameter', '%%c69.1057', (105.0915, 157.5747), 20.0065, 135),\n ('horizontal', '27.3543', (148.1353, 157.5747), (163.9737, 157.5747), (156.0545, 168.5747)),\n ('horizontal', '65.9722', (163.9737, 157.5747), (186.334, 157.5747), (175.1539, 178.5747))\n]\n\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; _ds.dxf.dimasz = 2.5\n _ds.dxf.dimexe = 1.25; _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\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\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,\n angle=(0 if d[0] == \"horizontal\" else 90),\n 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,\n 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,\n 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,\n text=text, dimstyle=\"EZDXF\").render()\n\n doc.saveas(out_path)\n\n\nif __name__ == \"__main__\":\n out = sys.argv[1] if len(sys.argv) > 1 else \"0021_00214983_gt.dxf\"\n draw(out)\n print(\"wrote\", out)\n```"}], "images": ["images/0021_00214983.png"], "id": "0021_00214983"} {"messages": [{"role": "user", "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": "assistant", "content": "```python\n#!/usr/bin/env python3\n# -*- coding: utf-8 -*-\n# Ground-truth 2D engineering drawing for part: 0024_00242270\n# Self-contained: reproduces the three-view DXF via ezdxf, NO FreeCAD needed.\n# Coordinates are A4 page millimetres (scale=0.579012552301256, page=[297.0, 210.0]).\n# visible edges -> solid (layer OUTLINE); hidden edges -> dashed (layer HIDDEN)\n# dimensions -> real movable DIMENSION entities (text = true mm value)\n# Run: python 0024_00242270_gt.py [out.dxf]\nimport sys\nimport ezdxf\nimport math\n\nSCALE = 0.579012552301256\nPAGE = [297.0, 210.0]\n\nVISIBLE_SEGMENTS = [\n (134.135257, 114.624058, 76.234002, 114.624058),\n (134.135257, 114.624058, 134.135257, 98.785555),\n (134.135257, 98.785555, 76.234002, 98.785555),\n (125.097993, 98.785555, 125.097993, 76.425314),\n (125.097993, 76.425314, 85.084931, 76.425314),\n (76.234002, 98.785555, 76.234002, 114.624058),\n (85.084931, 76.425314, 85.084931, 98.785555),\n (148.135258, 186.525314, 148.135258, 128.624059),\n (163.973761, 186.525314, 163.973761, 128.624059),\n (186.334002, 177.581218, 186.334002, 137.568155),\n (163.973761, 186.525314, 148.135258, 186.525314),\n (163.973761, 128.624059, 148.135258, 128.624059),\n (186.334002, 177.581218, 163.973761, 177.581218),\n (186.334002, 137.568155, 163.973761, 137.568155)\n]\nVISIBLE_CIRCLES = [\n (105.18463, 157.574686, 28.950628),\n (105.091462, 157.574686, 20.006531)\n]\nVISIBLE_ARCS = [\n\n]\nHIDDEN_SEGMENTS = [\n\n]\n# (orient, text, p1, p2, base) for linear; (orient, text, center, radius, angle) for diameter\nDIMENSIONS = [\n ('diameter', '%%c100', (105.1847, 157.5747), 28.9506, 45),\n ('diameter', '%%c69.1057', (105.0915, 157.5747), 20.0065, 135),\n ('horizontal', '27.3543', (148.1353, 157.5747), (163.9737, 157.5747), (156.0545, 168.5747)),\n ('horizontal', '65.9722', (163.9737, 157.5747), (186.334, 157.5747), (175.1539, 178.5747))\n]\n\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; _ds.dxf.dimasz = 2.5\n _ds.dxf.dimexe = 1.25; _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\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\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,\n angle=(0 if d[0] == \"horizontal\" else 90),\n 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,\n 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,\n 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,\n text=text, dimstyle=\"EZDXF\").render()\n\n doc.saveas(out_path)\n\n\nif __name__ == \"__main__\":\n out = sys.argv[1] if len(sys.argv) > 1 else \"0024_00242270_gt.dxf\"\n draw(out)\n print(\"wrote\", out)\n```"}], "images": ["images/0024_00242270.png"], "id": "0024_00242270"} {"messages": [{"role": "user", "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 5.15 mm. A union feature: 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 -5.15 mm."}, {"role": "assistant", "content": "```python\n#!/usr/bin/env python3\n# -*- coding: utf-8 -*-\n# Ground-truth 2D engineering drawing for part: 0026_00266416\n# Self-contained: reproduces the three-view DXF via ezdxf, NO FreeCAD needed.\n# Coordinates are A4 page millimetres (scale=0.8711957505410208, page=[297.0, 210.0]).\n# visible edges -> solid (layer OUTLINE); hidden edges -> dashed (layer HIDDEN)\n# dimensions -> real movable DIMENSION entities (text = true mm value)\n# Run: python 0026_00266416_gt.py [out.dxf]\nimport sys\nimport ezdxf\nimport math\n\nSCALE = 0.8711957505410208\nPAGE = [297.0, 210.0]\n\nVISIBLE_SEGMENTS = [\n (159.234655, 88.220106, 159.234655, 83.729894),\n (159.234655, 83.729894, 72.11508, 83.729894),\n (159.234655, 88.220106, 159.234655, 92.710319),\n (159.234655, 92.710319, 72.11508, 92.710319),\n (72.11508, 83.729894, 72.11508, 88.220106),\n (72.11508, 92.710319, 72.11508, 88.220106),\n (182.21508, 193.829894, 182.21508, 106.710319),\n (173.234655, 193.829894, 173.234655, 106.710319),\n (182.21508, 193.829894, 177.724867, 193.829894),\n (182.21508, 106.710319, 177.724867, 106.710319),\n (173.234655, 106.710319, 177.724867, 106.710319),\n (173.234655, 193.829894, 177.724867, 193.829894)\n]\nVISIBLE_CIRCLES = [\n (115.674867, 150.270106, 43.559788),\n (115.674867, 150.270106, 21.779894)\n]\nVISIBLE_ARCS = [\n\n]\nHIDDEN_SEGMENTS = [\n (137.4548, 88.2201, 137.4548, 83.7299),\n (137.4548, 88.2201, 137.4548, 92.7103),\n (93.895, 83.7299, 93.895, 88.2201),\n (93.895, 92.7103, 93.895, 88.2201),\n (182.2151, 172.05, 177.7249, 172.05),\n (182.2151, 128.4902, 177.7249, 128.4902),\n (173.2347, 128.4902, 177.7249, 128.4902),\n (173.2347, 172.05, 177.7249, 172.05)\n]\n# (orient, text, p1, p2, base) for linear; (orient, text, center, radius, angle) for diameter\nDIMENSIONS = [\n ('diameter', '%%c100', (115.6748, 150.2701), 43.5598, 45),\n ('diameter', '%%c50', (115.6748, 150.2701), 21.7799, 135),\n ('diameter', '%%c100', (115.6748, 150.2701), 43.5598, 225),\n ('diameter', '%%c50', (115.6748, 150.2701), 21.7799, 315),\n ('horizontal', '10.3082', (177.7249, 150.2701), (182.2151, 150.2701), (179.97, 161.2701))\n]\n\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; _ds.dxf.dimasz = 2.5\n _ds.dxf.dimexe = 1.25; _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\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\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,\n angle=(0 if d[0] == \"horizontal\" else 90),\n 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,\n 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,\n 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,\n text=text, dimstyle=\"EZDXF\").render()\n\n doc.saveas(out_path)\n\n\nif __name__ == \"__main__\":\n out = sys.argv[1] if len(sys.argv) > 1 else \"0026_00266416_gt.dxf\"\n draw(out)\n print(\"wrote\", out)\n```"}], "images": ["images/0026_00266416.png"], "id": "0026_00266416"} {"messages": [{"role": "user", "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 58.8 mm. A union feature: The part is a circular plate with diameter 39.13 mm. It is extruded to a thickness of 78.88 mm."}, {"role": "assistant", "content": "```python\n#!/usr/bin/env python3\n# -*- coding: utf-8 -*-\n# Ground-truth 2D engineering drawing for part: 0027_00275375\n# Self-contained: reproduces the three-view DXF via ezdxf, NO FreeCAD needed.\n# Coordinates are A4 page millimetres (scale=0.4043231707317071, page=[297.0, 210.0]).\n# visible edges -> solid (layer OUTLINE); hidden edges -> dashed (layer HIDDEN)\n# dimensions -> real movable DIMENSION entities (text = true mm value)\n# Run: python 0027_00275375_gt.py [out.dxf]\nimport sys\nimport ezdxf\nimport math\n\nSCALE = 0.4043231707317071\nPAGE = [297.0, 210.0]\n\nVISIBLE_SEGMENTS = [\n (122.027623, 127.725762, 81.595306, 127.725762),\n (122.027623, 127.725762, 122.027623, 103.951023),\n (122.027623, 103.951023, 81.595306, 103.951023),\n (109.014081, 103.951023, 109.014081, 72.058079),\n (109.014081, 72.058079, 93.19274, 72.058079),\n (81.595306, 103.951023, 81.595306, 127.725762),\n (93.19274, 72.058079, 93.19274, 103.951023),\n (136.027623, 182.158079, 136.027623, 141.725762),\n (159.802363, 182.158079, 159.802363, 141.725762),\n (191.695306, 169.852592, 191.695306, 154.03125),\n (159.802363, 182.158079, 136.027623, 182.158079),\n (159.802363, 141.725762, 136.027623, 141.725762),\n (191.695306, 169.852592, 159.802363, 169.852592),\n (191.695306, 154.03125, 159.802363, 154.03125)\n]\nVISIBLE_CIRCLES = [\n (101.811465, 161.941921, 20.216159),\n (101.103411, 161.941921, 7.910671)\n]\nVISIBLE_ARCS = [\n\n]\nHIDDEN_SEGMENTS = [\n\n]\n# (orient, text, p1, p2, base) for linear; (orient, text, center, radius, angle) for diameter\nDIMENSIONS = [\n ('diameter', '%%c100', (101.8115, 161.9419), 20.2162, 45),\n ('diameter', '%%c39.1304', (101.1034, 161.9419), 7.9107, 135),\n ('horizontal', '58.8013', (136.0276, 161.9419), (159.8024, 161.9419), (147.915, 172.9419)),\n ('horizontal', '137.681', (159.8024, 161.9419), (191.6953, 161.9419), (175.7488, 182.9419))\n]\n\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; _ds.dxf.dimasz = 2.5\n _ds.dxf.dimexe = 1.25; _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\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\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,\n angle=(0 if d[0] == \"horizontal\" else 90),\n 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,\n 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,\n 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,\n text=text, dimstyle=\"EZDXF\").render()\n\n doc.saveas(out_path)\n\n\nif __name__ == \"__main__\":\n out = sys.argv[1] if len(sys.argv) > 1 else \"0027_00275375_gt.dxf\"\n draw(out)\n print(\"wrote\", out)\n```"}], "images": ["images/0027_00275375.png"], "id": "0027_00275375"} {"messages": [{"role": "user", "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 -2.3 mm. A union feature: The part is a circular plate with diameter 62.79 mm. It is extruded to a thickness of 220.93 mm."}, {"role": "assistant", "content": "```python\n#!/usr/bin/env python3\n# -*- coding: utf-8 -*-\n# Ground-truth 2D engineering drawing for part: 0028_00284398\n# Self-contained: reproduces the three-view DXF via ezdxf, NO FreeCAD needed.\n# Coordinates are A4 page millimetres (scale=0.297310050213595, page=[297.0, 210.0]).\n# visible edges -> solid (layer OUTLINE); hidden edges -> dashed (layer HIDDEN)\n# dimensions -> real movable DIMENSION entities (text = true mm value)\n# Run: python 0028_00284398_gt.py [out.dxf]\nimport sys\nimport ezdxf\nimport math\n\nSCALE = 0.297310050213595\nPAGE = [297.0, 210.0]\n\nVISIBLE_SEGMENTS = [\n (112.145496, 135.06753, 112.145496, 135.751746),\n (112.145496, 135.751746, 82.414491, 135.751746),\n (112.145496, 135.06753, 82.414491, 135.06753),\n (106.556528, 135.06753, 106.556528, 69.382751),\n (106.556528, 69.382751, 87.888222, 69.382751),\n (82.414491, 135.751746, 82.414491, 135.06753),\n (87.888222, 69.382751, 87.888222, 135.06753),\n (126.145496, 179.482751, 126.145496, 149.751746),\n (126.829712, 179.482751, 126.829712, 149.751746),\n (192.514491, 173.951402, 192.514491, 155.283096),\n (126.145496, 149.751746, 126.829712, 149.751746),\n (126.145496, 179.482751, 126.829712, 179.482751),\n (192.514491, 173.951402, 126.829712, 173.951402),\n (192.514491, 155.283096, 126.829712, 155.283096)\n]\nVISIBLE_CIRCLES = [\n (97.279993, 164.617249, 14.865503),\n (97.222375, 164.617249, 9.334153)\n]\nVISIBLE_ARCS = [\n\n]\nHIDDEN_SEGMENTS = [\n\n]\n# (orient, text, p1, p2, base) for linear; (orient, text, center, radius, angle) for diameter\nDIMENSIONS = [\n ('diameter', '%%c100', (97.28, 164.6172), 14.8655, 45),\n ('diameter', '%%c62.7907', (97.2224, 164.6172), 9.3342, 135),\n ('horizontal', '2.3014', (126.8297, 164.6172), (126.1455, 164.6172), (126.4876, 153.6172)),\n ('horizontal', '220.93', (126.8297, 164.6172), (192.5145, 164.6172), (159.6721, 185.6172))\n]\n\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; _ds.dxf.dimasz = 2.5\n _ds.dxf.dimexe = 1.25; _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\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\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,\n angle=(0 if d[0] == \"horizontal\" else 90),\n 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,\n 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,\n 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,\n text=text, dimstyle=\"EZDXF\").render()\n\n doc.saveas(out_path)\n\n\nif __name__ == \"__main__\":\n out = sys.argv[1] if len(sys.argv) > 1 else \"0028_00284398_gt.dxf\"\n draw(out)\n print(\"wrote\", out)\n```"}], "images": ["images/0028_00284398.png"], "id": "0028_00284398"} {"messages": [{"role": "user", "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 49.99 mm. A union feature: The part is a circular plate with diameter 100 mm. It is extruded to a thickness of -49.99 mm."}, {"role": "assistant", "content": "```python\n#!/usr/bin/env python3\n# -*- coding: utf-8 -*-\n# Ground-truth 2D engineering drawing for part: 0033_00330914\n# Self-contained: reproduces the three-view DXF via ezdxf, NO FreeCAD needed.\n# Coordinates are A4 page millimetres (scale=0.4805260702078202, page=[297.0, 210.0]).\n# visible edges -> solid (layer OUTLINE); hidden edges -> dashed (layer HIDDEN)\n# dimensions -> real movable DIMENSION entities (text = true mm value)\n# Run: python 0033_00330914_gt.py [out.dxf]\nimport sys\nimport ezdxf\nimport math\n\nSCALE = 0.4805260702078202\nPAGE = [297.0, 210.0]\n\nVISIBLE_SEGMENTS = [\n (124.489455, 97.986848, 124.489455, 122.010545),\n (76.436848, 122.010545, 124.489455, 122.010545),\n (124.489455, 97.986848, 124.489455, 73.963152),\n (76.436848, 73.963152, 124.489455, 73.963152),\n (76.436848, 122.010545, 76.436848, 97.986848),\n (76.436848, 73.963152, 76.436848, 97.986848),\n (138.489455, 136.010545, 138.489455, 184.063152),\n (186.536848, 136.010545, 186.536848, 184.063152),\n (138.489455, 136.010545, 162.513152, 136.010545),\n (138.489455, 184.063152, 162.513152, 184.063152),\n (186.536848, 184.063152, 162.513152, 184.063152),\n (186.536848, 136.010545, 162.513152, 136.010545)\n]\nVISIBLE_CIRCLES = [\n (100.463152, 160.036848, 24.026304)\n]\nVISIBLE_ARCS = [\n\n]\nHIDDEN_SEGMENTS = [\n\n]\n# (orient, text, p1, p2, base) for linear; (orient, text, center, radius, angle) for diameter\nDIMENSIONS = [\n ('diameter', '%%c100', (100.4631, 160.0368), 24.0263, 45),\n ('diameter', '%%c100', (100.4631, 160.0368), 24.0263, 135),\n ('horizontal', '99.9891', (162.5132, 160.0368), (138.4894, 160.0368), (150.5013, 149.0368)),\n ('horizontal', '49.9946', (162.5132, 160.0368), (186.5369, 160.0368), (174.525, 181.0368))\n]\n\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; _ds.dxf.dimasz = 2.5\n _ds.dxf.dimexe = 1.25; _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\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\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,\n angle=(0 if d[0] == \"horizontal\" else 90),\n 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,\n 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,\n 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,\n text=text, dimstyle=\"EZDXF\").render()\n\n doc.saveas(out_path)\n\n\nif __name__ == \"__main__\":\n out = sys.argv[1] if len(sys.argv) > 1 else \"0033_00330914_gt.dxf\"\n draw(out)\n print(\"wrote\", out)\n```"}], "images": ["images/0033_00330914.png"], "id": "0033_00330914"} {"messages": [{"role": "user", "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 19.59 mm. A union feature: The part is a circular plate with diameter 50 mm. It is extruded to a thickness of 19.59 mm."}, {"role": "assistant", "content": "```python\n#!/usr/bin/env python3\n# -*- coding: utf-8 -*-\n# Ground-truth 2D engineering drawing for part: 0033_00331004\n# Self-contained: reproduces the three-view DXF via ezdxf, NO FreeCAD needed.\n# Coordinates are A4 page millimetres (scale=0.6905173865585552, page=[297.0, 210.0]).\n# visible edges -> solid (layer OUTLINE); hidden edges -> dashed (layer HIDDEN)\n# dimensions -> real movable DIMENSION entities (text = true mm value)\n# Run: python 0033_00331004_gt.py [out.dxf]\nimport sys\nimport ezdxf\nimport math\n\nSCALE = 0.6905173865585552\nPAGE = [297.0, 210.0]\n\nVISIBLE_SEGMENTS = [\n (144.599493, 106.261196, 75.547754, 106.261196),\n (144.599493, 106.261196, 144.599493, 92.737065),\n (144.599493, 92.737065, 75.547754, 92.737065),\n (127.156736, 92.737065, 127.156736, 79.212935),\n (127.156736, 79.212935, 92.630867, 79.212935),\n (75.547754, 92.737065, 75.547754, 106.261196),\n (92.630867, 79.212935, 92.630867, 92.737065),\n (158.599493, 189.312935, 158.599493, 120.261196),\n (172.123624, 189.312935, 172.123624, 120.261196),\n (185.647755, 172.05, 185.647755, 137.524131),\n (172.123624, 189.312935, 158.599493, 189.312935),\n (172.123624, 120.261196, 158.599493, 120.261196),\n (185.647755, 172.05, 172.123624, 172.05),\n (185.647755, 137.524131, 172.123624, 137.524131)\n]\nVISIBLE_CIRCLES = [\n (110.073624, 154.787065, 34.525869),\n (109.893802, 154.787065, 17.262935)\n]\nVISIBLE_ARCS = [\n\n]\nHIDDEN_SEGMENTS = [\n\n]\n# (orient, text, p1, p2, base) for linear; (orient, text, center, radius, angle) for diameter\nDIMENSIONS = [\n ('diameter', '%%c100', (110.0736, 154.7871), 34.5259, 45),\n ('diameter', '%%c50', (109.8938, 154.7871), 17.2629, 135),\n ('horizontal', '19.5855', (158.5995, 154.7871), (172.1236, 154.7871), (165.3616, 165.7871)),\n ('horizontal', '39.171', (172.1236, 154.7871), (185.6477, 154.7871), (178.8857, 175.7871))\n]\n\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; _ds.dxf.dimasz = 2.5\n _ds.dxf.dimexe = 1.25; _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\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\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,\n angle=(0 if d[0] == \"horizontal\" else 90),\n 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,\n 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,\n 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,\n text=text, dimstyle=\"EZDXF\").render()\n\n doc.saveas(out_path)\n\n\nif __name__ == \"__main__\":\n out = sys.argv[1] if len(sys.argv) > 1 else \"0033_00331004_gt.dxf\"\n draw(out)\n print(\"wrote\", out)\n```"}], "images": ["images/0033_00331004.png"], "id": "0033_00331004"} {"messages": [{"role": "user", "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 77.08 mm. It is extruded to a thickness of 32.99 mm. A union feature: The part is a circular plate with diameter 77.08 mm, featuring a circular hole of diameter 67.45 mm. It is extruded to a thickness of 32.99 mm."}, {"role": "assistant", "content": "```python\n#!/usr/bin/env python3\n# -*- coding: utf-8 -*-\n# Ground-truth 2D engineering drawing for part: 0048_00486367\n# Self-contained: reproduces the three-view DXF via ezdxf, NO FreeCAD needed.\n# Coordinates are A4 page millimetres (scale=0.7226318537859013, page=[297.0, 210.0]).\n# visible edges -> solid (layer OUTLINE); hidden edges -> dashed (layer HIDDEN)\n# dimensions -> real movable DIMENSION entities (text = true mm value)\n# Run: python 0048_00486367_gt.py [out.dxf]\nimport sys\nimport ezdxf\nimport math\n\nSCALE = 0.7226318537859013\nPAGE = [297.0, 210.0]\n\nVISIBLE_SEGMENTS = [\n (151.691069, 89.92691, 79.427883, 89.92691),\n (151.691069, 89.92691, 151.691069, 66.090095),\n (151.691069, 66.090095, 79.427883, 66.090095),\n (79.427883, 66.090095, 79.427883, 89.92691),\n (165.691069, 176.190095, 165.691069, 103.92691),\n (189.527883, 176.190095, 189.527883, 103.92691),\n (189.527883, 176.190095, 165.691069, 176.190095),\n (189.527883, 103.92691, 165.691069, 103.92691)\n]\nVISIBLE_CIRCLES = [\n (115.559476, 140.058502, 36.131593),\n (115.473224, 140.058502, 24.370007),\n (115.559476, 140.058502, 27.851436)\n]\nVISIBLE_ARCS = [\n (115.473224, 140.058502, 27.851436, -89.911282, 89.911282)\n]\nHIDDEN_SEGMENTS = [\n (115.5164, 66.0901, 115.5164, 89.9269),\n (139.8432, 89.9269, 139.8432, 66.0901),\n (143.4109, 66.0901, 143.4109, 89.9269),\n (143.3247, 66.0901, 143.3247, 89.9269),\n (91.1032, 66.0901, 91.1032, 89.9269),\n (189.5279, 167.9099, 165.6911, 167.9099),\n (189.5279, 112.2071, 165.6911, 112.2071),\n (189.5279, 167.9099, 165.6911, 167.9099),\n (189.5279, 112.2071, 165.6911, 112.2071),\n (189.5279, 164.4285, 165.6911, 164.4285),\n (189.5279, 115.6885, 165.6911, 115.6885)\n]\n# (orient, text, p1, p2, base) for linear; (orient, text, center, radius, angle) for diameter\nDIMENSIONS = [\n ('diameter', '%%c100', (115.5595, 140.0585), 36.1316, 45),\n ('diameter', '%%c77.0833', (115.5595, 140.0585), 27.8514, 135),\n ('diameter', '%%c77.0833', (115.4732, 140.0585), 27.8514, 225),\n ('diameter', '%%c67.4479', (115.4732, 140.0585), 24.37, 315)\n]\n\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; _ds.dxf.dimasz = 2.5\n _ds.dxf.dimexe = 1.25; _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\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\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,\n angle=(0 if d[0] == \"horizontal\" else 90),\n 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,\n 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,\n 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,\n text=text, dimstyle=\"EZDXF\").render()\n\n doc.saveas(out_path)\n\n\nif __name__ == \"__main__\":\n out = sys.argv[1] if len(sys.argv) > 1 else \"0048_00486367_gt.dxf\"\n draw(out)\n print(\"wrote\", out)\n```"}], "images": ["images/0048_00486367.png"], "id": "0048_00486367"} {"messages": [{"role": "user", "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 161.7 mm. A union feature: The part is a circular plate with diameter 100 mm. It is extruded to a thickness of 161.7 mm."}, {"role": "assistant", "content": "```python\n#!/usr/bin/env python3\n# -*- coding: utf-8 -*-\n# Ground-truth 2D engineering drawing for part: 0053_00532182\n# Self-contained: reproduces the three-view DXF via ezdxf, NO FreeCAD needed.\n# Coordinates are A4 page millimetres (scale=0.3672113821139256, page=[297.0, 210.0]).\n# visible edges -> solid (layer OUTLINE); hidden edges -> dashed (layer HIDDEN)\n# dimensions -> real movable DIMENSION entities (text = true mm value)\n# Run: python 0053_00532182_gt.py [out.dxf]\nimport sys\nimport ezdxf\nimport math\n\nSCALE = 0.3672113821139256\nPAGE = [297.0, 210.0]\n\nVISIBLE_SEGMENTS = [\n (79.269715, 71.130284, 115.990854, 71.130284),\n (115.990854, 71.130284, 115.990854, 130.509146),\n (79.269715, 130.509146, 115.990854, 130.509146),\n (79.269715, 130.509146, 79.269715, 71.130284),\n (189.369716, 144.509146, 189.369716, 181.230285),\n (129.990854, 144.509146, 129.990854, 181.230285),\n (129.990854, 144.509146, 189.369716, 144.509146),\n (129.990854, 181.230285, 189.369716, 181.230285)\n]\nVISIBLE_CIRCLES = [\n (97.630284, 162.869716, 18.360569)\n]\nVISIBLE_ARCS = [\n\n]\nHIDDEN_SEGMENTS = [\n\n]\n# (orient, text, p1, p2, base) for linear; (orient, text, center, radius, angle) for diameter\nDIMENSIONS = [\n ('diameter', '%%c100', (97.6303, 162.8697), 18.3606, 45),\n ('diameter', '%%c100', (97.6303, 162.8697), 18.3606, 135),\n ('horizontal', '161.702', (189.3697, 162.8697), (129.9909, 162.8697), (159.6803, 151.8697)),\n ('horizontal', '161.702', (189.3697, 162.8697), (129.9909, 162.8697), (159.6803, 141.8697))\n]\n\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; _ds.dxf.dimasz = 2.5\n _ds.dxf.dimexe = 1.25; _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\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\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,\n angle=(0 if d[0] == \"horizontal\" else 90),\n 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,\n 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,\n 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,\n text=text, dimstyle=\"EZDXF\").render()\n\n doc.saveas(out_path)\n\n\nif __name__ == \"__main__\":\n out = sys.argv[1] if len(sys.argv) > 1 else \"0053_00532182_gt.dxf\"\n draw(out)\n print(\"wrote\", out)\n```"}], "images": ["images/0053_00532182.png"], "id": "0053_00532182"} {"messages": [{"role": "user", "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 9.79 mm. A union feature: The part is a circular plate with diameter 100 mm. It is extruded to a thickness of 9.79 mm."}, {"role": "assistant", "content": "```python\n#!/usr/bin/env python3\n# -*- coding: utf-8 -*-\n# Ground-truth 2D engineering drawing for part: 0064_00642609\n# Self-contained: reproduces the three-view DXF via ezdxf, NO FreeCAD needed.\n# Coordinates are A4 page millimetres (scale=0.8752854672135206, page=[297.0, 210.0]).\n# visible edges -> solid (layer OUTLINE); hidden edges -> dashed (layer HIDDEN)\n# dimensions -> real movable DIMENSION entities (text = true mm value)\n# Run: python 0064_00642609_gt.py [out.dxf]\nimport sys\nimport ezdxf\nimport math\n\nSCALE = 0.8752854672135206\nPAGE = [297.0, 210.0]\n\nVISIBLE_SEGMENTS = [\n (154.09641, 92.40359, 66.567863, 92.40359),\n (154.09641, 92.40359, 154.09641, 83.832137),\n (154.09641, 83.832137, 66.567863, 83.832137),\n (66.567863, 83.832137, 66.567863, 92.40359),\n (168.09641, 193.932137, 168.09641, 106.40359),\n (176.667863, 193.932137, 176.667863, 106.40359),\n (176.667863, 193.932137, 168.09641, 193.932137),\n (176.667863, 106.40359, 168.09641, 106.40359)\n]\nVISIBLE_CIRCLES = [\n (110.332137, 150.167863, 43.764273)\n]\nVISIBLE_ARCS = [\n\n]\nHIDDEN_SEGMENTS = [\n\n]\n# (orient, text, p1, p2, base) for linear; (orient, text, center, radius, angle) for diameter\nDIMENSIONS = [\n ('diameter', '%%c100', (110.3321, 150.1679), 43.7643, 45),\n ('diameter', '%%c100', (110.3321, 150.1679), 43.7643, 135),\n ('horizontal', '9.7928', (168.0964, 150.1679), (176.6679, 150.1679), (172.3822, 161.1679)),\n ('horizontal', '9.7928', (168.0964, 150.1679), (176.6679, 150.1679), (172.3822, 171.1679))\n]\n\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; _ds.dxf.dimasz = 2.5\n _ds.dxf.dimexe = 1.25; _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\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\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,\n angle=(0 if d[0] == \"horizontal\" else 90),\n 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,\n 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,\n 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,\n text=text, dimstyle=\"EZDXF\").render()\n\n doc.saveas(out_path)\n\n\nif __name__ == \"__main__\":\n out = sys.argv[1] if len(sys.argv) > 1 else \"0064_00642609_gt.dxf\"\n draw(out)\n print(\"wrote\", out)\n```"}], "images": ["images/0064_00642609.png"], "id": "0064_00642609"} {"messages": [{"role": "user", "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 118.75 mm. A union feature: The part is a circular plate with diameter 92.5 mm. It is extruded to a thickness of 118.75 mm."}, {"role": "assistant", "content": "```python\n#!/usr/bin/env python3\n# -*- coding: utf-8 -*-\n# Ground-truth 2D engineering drawing for part: 0066_00664625\n# Self-contained: reproduces the three-view DXF via ezdxf, NO FreeCAD needed.\n# Coordinates are A4 page millimetres (scale=0.28474074074074074, page=[297.0, 210.0]).\n# visible edges -> solid (layer OUTLINE); hidden edges -> dashed (layer HIDDEN)\n# dimensions -> real movable DIMENSION entities (text = true mm value)\n# Run: python 0066_00664625_gt.py [out.dxf]\nimport sys\nimport ezdxf\nimport math\n\nSCALE = 0.28474074074074074\nPAGE = [297.0, 210.0]\n\nVISIBLE_SEGMENTS = [\n (110.163335, 136.694444, 81.689261, 136.694444),\n (110.163335, 136.694444, 110.163335, 102.881481),\n (110.163335, 102.881481, 81.689261, 102.881481),\n (108.732216, 102.881481, 108.732216, 69.068518),\n (108.732216, 69.068518, 82.393698, 69.068518),\n (81.689261, 102.881481, 81.689261, 136.694444),\n (82.393698, 69.068518, 82.393698, 102.881481),\n (124.163335, 179.168519, 124.163335, 150.694445),\n (157.976298, 179.168519, 157.976298, 150.694445),\n (191.789261, 178.100741, 191.789261, 151.762222),\n (157.976298, 179.168519, 124.163335, 179.168519),\n (157.976298, 150.694445, 124.163335, 150.694445),\n (191.789261, 178.100741, 157.976298, 178.100741),\n (191.789261, 151.762222, 157.976298, 151.762222)\n]\nVISIBLE_CIRCLES = [\n (95.926298, 164.931482, 14.237037),\n (95.562957, 164.931482, 13.169259)\n]\nVISIBLE_ARCS = [\n\n]\nHIDDEN_SEGMENTS = [\n\n]\n# (orient, text, p1, p2, base) for linear; (orient, text, center, radius, angle) for diameter\nDIMENSIONS = [\n ('diameter', '%%c100', (95.9263, 164.9315), 14.237, 45),\n ('diameter', '%%c92.5', (95.563, 164.9315), 13.1693, 135),\n ('horizontal', '118.75', (124.1633, 164.9315), (157.9763, 164.9315), (141.0698, 175.9315)),\n ('horizontal', '237.5', (157.9763, 164.9315), (191.7893, 164.9315), (174.8828, 185.9315))\n]\n\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; _ds.dxf.dimasz = 2.5\n _ds.dxf.dimexe = 1.25; _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\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\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,\n angle=(0 if d[0] == \"horizontal\" else 90),\n 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,\n 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,\n 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,\n text=text, dimstyle=\"EZDXF\").render()\n\n doc.saveas(out_path)\n\n\nif __name__ == \"__main__\":\n out = sys.argv[1] if len(sys.argv) > 1 else \"0066_00664625_gt.dxf\"\n draw(out)\n print(\"wrote\", out)\n```"}], "images": ["images/0066_00664625.png"], "id": "0066_00664625"} {"messages": [{"role": "user", "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 282.21 mm. A union feature: The part is a circular plate with diameter 14.81 mm. It is extruded to a thickness of 69.64 mm."}, {"role": "assistant", "content": "```python\n#!/usr/bin/env python3\n# -*- coding: utf-8 -*-\n# Ground-truth 2D engineering drawing for part: 0072_00723440\n# Self-contained: reproduces the three-view DXF via ezdxf, NO FreeCAD needed.\n# Coordinates are A4 page millimetres (scale=0.21268032786885335, page=[297.0, 210.0]).\n# visible edges -> solid (layer OUTLINE); hidden edges -> dashed (layer HIDDEN)\n# dimensions -> real movable DIMENSION entities (text = true mm value)\n# Run: python 0072_00723440_gt.py [out.dxf]\nimport sys\nimport ezdxf\nimport math\n\nSCALE = 0.21268032786885335\nPAGE = [297.0, 210.0]\n\nVISIBLE_SEGMENTS = [\n (106.786704, 142.098975, 85.518671, 142.098975),\n (106.786704, 142.098975, 106.786704, 82.077502),\n (106.786704, 82.077502, 85.518671, 82.077502),\n (97.243987, 82.077502, 97.243987, 67.267008),\n (97.243987, 67.267008, 94.093167, 67.267008),\n (85.518671, 82.077502, 85.518671, 142.098975),\n (94.093167, 67.267008, 94.093167, 82.077502),\n (120.786704, 177.367008, 120.786704, 156.098976),\n (180.808178, 177.367008, 180.808178, 156.098976),\n (195.618671, 168.308402, 195.618671, 165.157582),\n (180.808178, 177.367008, 120.786704, 177.367008),\n (180.808178, 156.098976, 120.786704, 156.098976),\n (195.618671, 168.308402, 180.808178, 168.308402),\n (195.618671, 165.157582, 180.808178, 165.157582)\n]\nVISIBLE_CIRCLES = [\n (96.152687, 166.732992, 10.634016),\n (95.668577, 166.732992, 1.57541)\n]\nVISIBLE_ARCS = [\n\n]\nHIDDEN_SEGMENTS = [\n\n]\n# (orient, text, p1, p2, base) for linear; (orient, text, center, radius, angle) for diameter\nDIMENSIONS = [\n ('diameter', '%%c100', (96.1527, 166.733), 10.634, 45),\n ('diameter', '%%c14.8148', (95.6686, 166.733), 1.5754, 135),\n ('horizontal', '282.214', (120.7867, 166.733), (180.8082, 166.733), (150.7974, 177.733)),\n ('horizontal', '351.852', (180.8082, 166.733), (195.6187, 166.733), (188.2134, 187.733))\n]\n\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; _ds.dxf.dimasz = 2.5\n _ds.dxf.dimexe = 1.25; _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\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\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,\n angle=(0 if d[0] == \"horizontal\" else 90),\n 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,\n 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,\n 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,\n text=text, dimstyle=\"EZDXF\").render()\n\n doc.saveas(out_path)\n\n\nif __name__ == \"__main__\":\n out = sys.argv[1] if len(sys.argv) > 1 else \"0072_00723440_gt.dxf\"\n draw(out)\n print(\"wrote\", out)\n```"}], "images": ["images/0072_00723440.png"], "id": "0072_00723440"} {"messages": [{"role": "user", "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 union feature: The part is a circular plate with diameter 100 mm. It is extruded to a thickness of 500 mm."}, {"role": "assistant", "content": "```python\n#!/usr/bin/env python3\n# -*- coding: utf-8 -*-\n# Ground-truth 2D engineering drawing for part: 0077_00770030\n# Self-contained: reproduces the three-view DXF via ezdxf, NO FreeCAD needed.\n# Coordinates are A4 page millimetres (scale=0.16016666666666668, page=[297.0, 210.0]).\n# visible edges -> solid (layer OUTLINE); hidden edges -> dashed (layer HIDDEN)\n# dimensions -> real movable DIMENSION entities (text = true mm value)\n# Run: python 0077_00770030_gt.py [out.dxf]\nimport sys\nimport ezdxf\nimport math\n\nSCALE = 0.16016666666666668\nPAGE = [297.0, 210.0]\n\nVISIBLE_SEGMENTS = [\n (84.445833, 65.954167, 100.4625, 65.954167),\n (100.4625, 65.954167, 100.4625, 146.0375),\n (84.445833, 146.0375, 100.4625, 146.0375),\n (84.445833, 146.0375, 84.445833, 65.954167),\n (194.545833, 160.0375, 194.545833, 176.054167),\n (114.4625, 160.0375, 114.4625, 176.054167),\n (114.4625, 160.0375, 194.545833, 160.0375),\n (114.4625, 176.054167, 194.545833, 176.054167)\n]\nVISIBLE_CIRCLES = [\n (92.454167, 168.045833, 8.008333)\n]\nVISIBLE_ARCS = [\n\n]\nHIDDEN_SEGMENTS = [\n\n]\n# (orient, text, p1, p2, base) for linear; (orient, text, center, radius, angle) for diameter\nDIMENSIONS = [\n ('diameter', '%%c100', (92.4542, 168.0458), 8.0083, 45),\n ('diameter', '%%c100', (92.4542, 168.0458), 8.0083, 135),\n ('horizontal', '500', (194.5458, 168.0458), (114.4625, 168.0458), (154.5042, 157.0458)),\n ('horizontal', '500', (194.5458, 168.0458), (114.4625, 168.0458), (154.5042, 147.0458))\n]\n\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; _ds.dxf.dimasz = 2.5\n _ds.dxf.dimexe = 1.25; _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\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\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,\n angle=(0 if d[0] == \"horizontal\" else 90),\n 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,\n 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,\n 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,\n text=text, dimstyle=\"EZDXF\").render()\n\n doc.saveas(out_path)\n\n\nif __name__ == \"__main__\":\n out = sys.argv[1] if len(sys.argv) > 1 else \"0077_00770030_gt.dxf\"\n draw(out)\n print(\"wrote\", out)\n```"}], "images": ["images/0077_00770030.png"], "id": "0077_00770030"} {"messages": [{"role": "user", "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 249.1 mm. A union feature: The part is a circular plate with diameter 13.79 mm. It is extruded to a thickness of 78.48 mm. A union feature: The part is a circular plate with diameter 27.59 mm, featuring a circular hole of diameter 12.64 mm. It is extruded to a thickness of 6.82 mm."}, {"role": "assistant", "content": "```python\n#!/usr/bin/env python3\n# -*- coding: utf-8 -*-\n# Ground-truth 2D engineering drawing for part: 0078_00781818\n# Self-contained: reproduces the three-view DXF via ezdxf, NO FreeCAD needed.\n# Coordinates are A4 page millimetres (scale=0.22475000000000092, page=[297.0, 210.0]).\n# visible edges -> solid (layer OUTLINE); hidden edges -> dashed (layer HIDDEN)\n# dimensions -> real movable DIMENSION entities (text = true mm value)\n# Run: python 0078_00781818_gt.py [out.dxf]\nimport sys\nimport ezdxf\nimport math\n\nSCALE = 0.22475000000000092\nPAGE = [297.0, 210.0]\n\nVISIBLE_SEGMENTS = [\n (107.849219, 141.19375, 85.374219, 141.19375),\n (107.849219, 141.19375, 107.849219, 85.208073),\n (107.849219, 85.208073, 85.374219, 85.208073),\n (99.243489, 85.208073, 99.243489, 83.674219),\n (99.243489, 83.674219, 93.043489, 83.674219),\n (97.677344, 83.674219, 97.677344, 67.56875),\n (97.677344, 67.56875, 94.577344, 67.56875),\n (85.374219, 85.208073, 85.374219, 141.19375),\n (93.043489, 83.674219, 93.043489, 85.208073),\n (94.577344, 67.56875, 94.577344, 83.674219),\n (121.849219, 177.66875, 121.849219, 155.19375),\n (177.834896, 177.66875, 177.834896, 155.19375),\n (179.36875, 169.53125, 179.36875, 163.33125),\n (195.474219, 167.98125, 195.474219, 164.88125),\n (177.834896, 177.66875, 121.849219, 177.66875),\n (177.834896, 155.19375, 121.849219, 155.19375),\n (179.36875, 169.53125, 177.834896, 169.53125),\n (179.36875, 163.33125, 177.834896, 163.33125),\n (195.474219, 167.98125, 179.36875, 167.98125),\n (195.474219, 164.88125, 179.36875, 164.88125)\n]\nVISIBLE_CIRCLES = [\n (96.611719, 166.43125, 11.2375),\n (96.143489, 166.43125, 3.1),\n (96.127344, 166.43125, 1.55)\n]\nVISIBLE_ARCS = [\n\n]\nHIDDEN_SEGMENTS = [\n\n]\n# (orient, text, p1, p2, base) for linear; (orient, text, center, radius, angle) for diameter\nDIMENSIONS = [\n ('diameter', '%%c100', (96.6117, 166.4313), 11.2375, 45),\n ('diameter', '%%c13.7931', (96.1273, 166.4313), 1.55, 135),\n ('diameter', '%%c27.5862', (96.1435, 166.4313), 3.1, 225),\n ('diameter', '%%c12.6437', (96.1435, 166.4313), 1.4208, 315),\n ('horizontal', '249.102', (121.8492, 166.4313), (177.8349, 166.4313), (149.8421, 177.4313)),\n ('horizontal', '71.6595', (177.8349, 166.4313), (195.4742, 166.4313), (186.6546, 187.4313)),\n ('horizontal', '249.102', (177.8349, 166.4313), (179.3687, 166.4313), (178.6018, 197.4313))\n]\n\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; _ds.dxf.dimasz = 2.5\n _ds.dxf.dimexe = 1.25; _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\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\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,\n angle=(0 if d[0] == \"horizontal\" else 90),\n 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,\n 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,\n 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,\n text=text, dimstyle=\"EZDXF\").render()\n\n doc.saveas(out_path)\n\n\nif __name__ == \"__main__\":\n out = sys.argv[1] if len(sys.argv) > 1 else \"0078_00781818_gt.dxf\"\n draw(out)\n print(\"wrote\", out)\n```"}], "images": ["images/0078_00781818.png"], "id": "0078_00781818"} {"messages": [{"role": "user", "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 -153.23 mm. A union feature: The part is a circular plate with diameter 16.13 mm. It is extruded to a thickness of 9.58 mm."}, {"role": "assistant", "content": "```python\n#!/usr/bin/env python3\n# -*- coding: utf-8 -*-\n# Ground-truth 2D engineering drawing for part: 0080_00805466\n# Self-contained: reproduces the three-view DXF via ezdxf, NO FreeCAD needed.\n# Coordinates are A4 page millimetres (scale=0.3656739547372636, page=[297.0, 210.0]).\n# visible edges -> solid (layer OUTLINE); hidden edges -> dashed (layer HIDDEN)\n# dimensions -> real movable DIMENSION entities (text = true mm value)\n# Run: python 0080_00805466_gt.py [out.dxf]\nimport sys\nimport ezdxf\nimport math\n\nSCALE = 0.3656739547372636\nPAGE = [297.0, 210.0]\n\nVISIBLE_SEGMENTS = [\n (119.749159, 74.593767, 119.749159, 130.624453),\n (119.749159, 130.624453, 83.181764, 130.624453),\n (119.749159, 74.593767, 83.181764, 74.593767),\n (104.254708, 74.593767, 104.254708, 71.091849),\n (104.254708, 71.091849, 98.356741, 71.091849),\n (83.181764, 130.624453, 83.181764, 74.593767),\n (98.356741, 71.091849, 98.356741, 74.593767),\n (133.749159, 181.191849, 133.749159, 144.624453),\n (189.779846, 181.191849, 189.779846, 144.624453),\n (193.281764, 165.857135, 193.281764, 159.959168),\n (133.749159, 144.624453, 189.779846, 144.624453),\n (133.749159, 181.191849, 189.779846, 181.191849),\n (193.281764, 165.857135, 189.779846, 165.857135),\n (193.281764, 159.959168, 189.779846, 159.959168)\n]\nVISIBLE_CIRCLES = [\n (101.465461, 162.908151, 18.283698),\n (101.305725, 162.908151, 2.948984)\n]\nVISIBLE_ARCS = [\n\n]\nHIDDEN_SEGMENTS = [\n\n]\n# (orient, text, p1, p2, base) for linear; (orient, text, center, radius, angle) for diameter\nDIMENSIONS = [\n ('diameter', '%%c100', (101.4654, 162.9082), 18.2837, 45),\n ('diameter', '%%c16.129', (101.3057, 162.9082), 2.949, 135),\n ('horizontal', '153.226', (189.7798, 162.9082), (133.7492, 162.9082), (161.7645, 151.9082)),\n ('horizontal', '9.5766', (189.7798, 162.9082), (193.2818, 162.9082), (191.5308, 183.9082))\n]\n\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; _ds.dxf.dimasz = 2.5\n _ds.dxf.dimexe = 1.25; _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\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\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,\n angle=(0 if d[0] == \"horizontal\" else 90),\n 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,\n 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,\n 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,\n text=text, dimstyle=\"EZDXF\").render()\n\n doc.saveas(out_path)\n\n\nif __name__ == \"__main__\":\n out = sys.argv[1] if len(sys.argv) > 1 else \"0080_00805466_gt.dxf\"\n draw(out)\n print(\"wrote\", out)\n```"}], "images": ["images/0080_00805466.png"], "id": "0080_00805466"} {"messages": [{"role": "user", "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 395.83 mm. A union feature: The part is a circular plate with diameter 20 mm. It is extruded to a thickness of 79.17 mm."}, {"role": "assistant", "content": "```python\n#!/usr/bin/env python3\n# -*- coding: utf-8 -*-\n# Ground-truth 2D engineering drawing for part: 0082_00820479\n# Self-contained: reproduces the three-view DXF via ezdxf, NO FreeCAD needed.\n# Coordinates are A4 page millimetres (scale=0.25554782608695653, page=[297.0, 210.0]).\n# visible edges -> solid (layer OUTLINE); hidden edges -> dashed (layer HIDDEN)\n# dimensions -> real movable DIMENSION entities (text = true mm value)\n# Run: python 0082_00820479_gt.py [out.dxf]\nimport sys\nimport ezdxf\nimport math\n\nSCALE = 0.25554782608695653\nPAGE = [297.0, 210.0]\n\nVISIBLE_SEGMENTS = [\n (84.778185, 164.303913, 59.223402, 164.303913),\n (84.778185, 164.303913, 84.778185, 63.149565),\n (84.778185, 63.149565, 59.223402, 63.149565),\n (74.449793, 63.149565, 74.449793, 42.918696),\n (74.449793, 42.918696, 69.338837, 42.918696),\n (59.223402, 63.149565, 59.223402, 164.303913),\n (69.338837, 42.918696, 69.338837, 63.149565),\n (98.778185, 203.858696, 98.778185, 178.303913),\n (199.932533, 203.858696, 199.932533, 178.303913),\n (220.163402, 193.636783, 220.163402, 188.525826),\n (199.932533, 203.858696, 98.778185, 203.858696),\n (199.932533, 178.303913, 98.778185, 178.303913),\n (220.163402, 193.636783, 199.932533, 193.636783),\n (220.163402, 188.525826, 199.932533, 188.525826)\n]\nVISIBLE_CIRCLES = [\n (72.000793, 191.081304, 12.777391),\n (71.894315, 191.081304, 2.555478)\n]\nVISIBLE_ARCS = [\n\n]\nHIDDEN_SEGMENTS = [\n\n]\n# (orient, text, p1, p2, base) for linear; (orient, text, center, radius, angle) for diameter\nDIMENSIONS = [\n ('diameter', '%%c100', (72.0008, 191.0813), 12.7774, 45),\n ('diameter', '%%c20', (71.8943, 191.0813), 2.5555, 135),\n ('horizontal', '395.833', (98.7782, 191.0813), (199.9325, 191.0813), (149.3554, 202.0813)),\n ('horizontal', '475', (199.9325, 191.0813), (220.1634, 191.0813), (210.048, 212.0813))\n]\n\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; _ds.dxf.dimasz = 2.5\n _ds.dxf.dimexe = 1.25; _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\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\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,\n angle=(0 if d[0] == \"horizontal\" else 90),\n 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,\n 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,\n 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,\n text=text, dimstyle=\"EZDXF\").render()\n\n doc.saveas(out_path)\n\n\nif __name__ == \"__main__\":\n out = sys.argv[1] if len(sys.argv) > 1 else \"0082_00820479_gt.dxf\"\n draw(out)\n print(\"wrote\", out)\n```"}], "images": ["images/0082_00820479.png"], "id": "0082_00820479"} {"messages": [{"role": "user", "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 178.12 mm. A union feature: The part is a circular plate with diameter 40 mm. It is extruded to a thickness of 59.38 mm."}, {"role": "assistant", "content": "```python\n#!/usr/bin/env python3\n# -*- coding: utf-8 -*-\n# Ground-truth 2D engineering drawing for part: 0089_00890871\n# Self-contained: reproduces the three-view DXF via ezdxf, NO FreeCAD needed.\n# Coordinates are A4 page millimetres (scale=0.28474074074074074, page=[297.0, 210.0]).\n# visible edges -> solid (layer OUTLINE); hidden edges -> dashed (layer HIDDEN)\n# dimensions -> real movable DIMENSION entities (text = true mm value)\n# Run: python 0089_00890871_gt.py [out.dxf]\nimport sys\nimport ezdxf\nimport math\n\nSCALE = 0.28474074074074074\nPAGE = [297.0, 210.0]\n\nVISIBLE_SEGMENTS = [\n (111.963356, 136.694444, 83.489282, 136.694444),\n (111.963356, 136.694444, 111.963356, 85.975),\n (111.963356, 85.975, 83.489282, 85.975),\n (103.332153, 85.975, 103.332153, 69.068518),\n (103.332153, 69.068518, 91.942523, 69.068518),\n (83.489282, 85.975, 83.489282, 136.694444),\n (91.942523, 69.068518, 91.942523, 85.975),\n (125.963357, 179.168519, 125.963357, 150.694445),\n (176.682801, 179.168519, 176.682801, 150.694445),\n (193.589283, 170.626296, 193.589283, 159.236667),\n (176.682801, 179.168519, 125.963357, 179.168519),\n (176.682801, 150.694445, 125.963357, 150.694445),\n (193.589283, 170.626296, 176.682801, 170.626296),\n (193.589283, 159.236667, 176.682801, 159.236667)\n]\nVISIBLE_CIRCLES = [\n (97.726319, 164.931482, 14.237037),\n (97.637338, 164.931482, 5.694815)\n]\nVISIBLE_ARCS = [\n\n]\nHIDDEN_SEGMENTS = [\n\n]\n# (orient, text, p1, p2, base) for linear; (orient, text, center, radius, angle) for diameter\nDIMENSIONS = [\n ('diameter', '%%c100', (97.7263, 164.9315), 14.237, 45),\n ('diameter', '%%c40', (97.6373, 164.9315), 5.6948, 135),\n ('horizontal', '178.125', (125.9634, 164.9315), (176.6828, 164.9315), (151.3231, 175.9315)),\n ('horizontal', '237.5', (176.6828, 164.9315), (193.5893, 164.9315), (185.136, 185.9315))\n]\n\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; _ds.dxf.dimasz = 2.5\n _ds.dxf.dimexe = 1.25; _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\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\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,\n angle=(0 if d[0] == \"horizontal\" else 90),\n 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,\n 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,\n 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,\n text=text, dimstyle=\"EZDXF\").render()\n\n doc.saveas(out_path)\n\n\nif __name__ == \"__main__\":\n out = sys.argv[1] if len(sys.argv) > 1 else \"0089_00890871_gt.dxf\"\n draw(out)\n print(\"wrote\", out)\n```"}], "images": ["images/0089_00890871.png"], "id": "0089_00890871"} {"messages": [{"role": "user", "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 89.93 mm, featuring a circular hole of diameter 84.31 mm. It is extruded to a thickness of 63.76 mm. A union feature: The part is a circular plate with diameter 100 mm, featuring a circular hole of diameter 83.33 mm. It is extruded to a thickness of 2.66 mm."}, {"role": "assistant", "content": "```python\n#!/usr/bin/env python3\n# -*- coding: utf-8 -*-\n# Ground-truth 2D engineering drawing for part: 0091_00917411\n# Self-contained: reproduces the three-view DXF via ezdxf, NO FreeCAD needed.\n# Coordinates are A4 page millimetres (scale=0.5868401639344261, page=[297.0, 210.0]).\n# visible edges -> solid (layer OUTLINE); hidden edges -> dashed (layer HIDDEN)\n# dimensions -> real movable DIMENSION entities (text = true mm value)\n# Run: python 0091_00917411_gt.py [out.dxf]\nimport sys\nimport ezdxf\nimport math\n\nSCALE = 0.5868401639344261\nPAGE = [297.0, 210.0]\n\nVISIBLE_SEGMENTS = [\n (133.685596, 114.036988, 75.001579, 114.036988),\n (133.685596, 114.036988, 133.685596, 112.477988),\n (133.685596, 112.477988, 75.001579, 112.477988),\n (130.895808, 112.477988, 130.895808, 76.621004),\n (130.895808, 76.621004, 78.119578, 76.621004),\n (75.001579, 112.477988, 75.001579, 114.036988),\n (78.119578, 76.621004, 78.119578, 112.477988),\n (147.685596, 186.721004, 147.685596, 128.036988),\n (149.244595, 186.721004, 149.244595, 128.036988),\n (185.10158, 183.767111, 185.10158, 130.990881),\n (149.244595, 186.721004, 147.685596, 186.721004),\n (149.244595, 128.036988, 147.685596, 128.036988),\n (185.10158, 183.767111, 149.244595, 183.767111),\n (185.10158, 130.990881, 149.244595, 130.990881)\n]\nVISIBLE_CIRCLES = [\n (104.343588, 157.378996, 29.342008),\n (104.343588, 157.378996, 24.451673),\n (104.507693, 157.378996, 26.388115),\n (104.507693, 157.378996, 24.738858)\n]\nVISIBLE_ARCS = [\n\n]\nHIDDEN_SEGMENTS = [\n (128.7953, 114.037, 128.7953, 112.478),\n (129.2466, 112.478, 129.2466, 76.621),\n (79.8919, 112.478, 79.8919, 114.037),\n (79.7688, 76.621, 79.7688, 112.478),\n (149.2446, 181.8307, 147.6856, 181.8307),\n (149.2446, 132.9273, 147.6856, 132.9273),\n (185.1016, 182.1179, 149.2446, 182.1179),\n (185.1016, 132.6401, 149.2446, 132.6401)\n]\n# (orient, text, p1, p2, base) for linear; (orient, text, center, radius, angle) for diameter\nDIMENSIONS = [\n ('diameter', '%%c89.9329', (104.5077, 157.379), 26.3881, 45),\n ('diameter', '%%c84.3121', (104.5077, 157.379), 24.7389, 135),\n ('diameter', '%%c100', (104.3436, 157.379), 29.342, 225),\n ('diameter', '%%c83.3333', (104.3436, 157.379), 24.4517, 315),\n ('horizontal', '2.6566', (147.6856, 157.379), (185.1016, 157.379), (166.3936, 168.379))\n]\n\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; _ds.dxf.dimasz = 2.5\n _ds.dxf.dimexe = 1.25; _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\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\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,\n angle=(0 if d[0] == \"horizontal\" else 90),\n 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,\n 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,\n 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,\n text=text, dimstyle=\"EZDXF\").render()\n\n doc.saveas(out_path)\n\n\nif __name__ == \"__main__\":\n out = sys.argv[1] if len(sys.argv) > 1 else \"0091_00917411_gt.dxf\"\n draw(out)\n print(\"wrote\", out)\n```"}], "images": ["images/0091_00917411.png"], "id": "0091_00917411"} {"messages": [{"role": "user", "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 75 mm. It is extruded to a thickness of 11.7 mm. A union feature: The part is a circular plate with diameter 75.45 mm, featuring a circular hole of diameter 62.88 mm. It is extruded to a thickness of 86.36 mm."}, {"role": "assistant", "content": "```python\n#!/usr/bin/env python3\n# -*- coding: utf-8 -*-\n# Ground-truth 2D engineering drawing for part: 0093_00935902\n# Self-contained: reproduces the three-view DXF via ezdxf, NO FreeCAD needed.\n# Coordinates are A4 page millimetres (scale=0.5156585365853669, page=[297.0, 210.0]).\n# visible edges -> solid (layer OUTLINE); hidden edges -> dashed (layer HIDDEN)\n# dimensions -> real movable DIMENSION entities (text = true mm value)\n# Run: python 0093_00935902_gt.py [out.dxf]\nimport sys\nimport ezdxf\nimport math\n\nSCALE = 0.5156585365853669\nPAGE = [297.0, 210.0]\n\nVISIBLE_SEGMENTS = [\n (131.699573, 110.46012, 80.133719, 110.46012),\n (131.699573, 110.46012, 131.699573, 104.429454),\n (131.699573, 104.429454, 80.133719, 104.429454),\n (125.073165, 104.429454, 125.073165, 65.925973),\n (125.073165, 65.925973, 86.164385, 65.925973),\n (80.133719, 104.429454, 80.133719, 110.46012),\n (86.164385, 65.925973, 86.164385, 104.429454),\n (145.699573, 176.025973, 145.699573, 124.46012),\n (151.730239, 176.025973, 151.730239, 124.46012),\n (190.233719, 169.697437, 190.233719, 130.788656),\n (151.730239, 176.025973, 145.699573, 176.025973),\n (151.730239, 124.46012, 145.699573, 124.46012),\n (190.233719, 169.697437, 151.730239, 169.697437),\n (190.233719, 130.788656, 151.730239, 130.788656)\n]\nVISIBLE_CIRCLES = [\n (105.916646, 150.243047, 25.782927),\n (105.618775, 150.243047, 19.45439),\n (105.618775, 150.243047, 16.211992)\n]\nVISIBLE_ARCS = [\n (105.916646, 150.243047, 19.337195, -67.236213, 67.236213)\n]\nHIDDEN_SEGMENTS = [\n (113.3988, 132.4121, 125.0732, 150.243),\n (125.0732, 150.243, 113.3988, 168.074),\n (113.3988, 104.4295, 113.3988, 110.4601),\n (121.8308, 110.4601, 121.8308, 65.926),\n (89.4068, 65.926, 89.4068, 110.4601),\n (151.7302, 168.074, 145.6996, 168.074),\n (151.7302, 132.4121, 145.6996, 132.4121),\n (190.2337, 166.455, 145.6996, 166.455),\n (190.2337, 134.0311, 145.6996, 134.0311)\n]\n# (orient, text, p1, p2, base) for linear; (orient, text, center, radius, angle) for diameter\nDIMENSIONS = [\n ('diameter', '%%c100', (105.9166, 150.243), 25.7829, 45),\n ('diameter', '%%c75', (105.9166, 150.243), 19.3372, 135),\n ('diameter', '%%c75.4545', (105.6188, 150.243), 19.4544, 225),\n ('diameter', '%%c62.8788', (105.6188, 150.243), 16.212, 315),\n ('horizontal', '11.6951', (145.6996, 150.243), (190.2337, 150.243), (167.9666, 171.243))\n]\n\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; _ds.dxf.dimasz = 2.5\n _ds.dxf.dimexe = 1.25; _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\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\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,\n angle=(0 if d[0] == \"horizontal\" else 90),\n 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,\n 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,\n 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,\n text=text, dimstyle=\"EZDXF\").render()\n\n doc.saveas(out_path)\n\n\nif __name__ == \"__main__\":\n out = sys.argv[1] if len(sys.argv) > 1 else \"0093_00935902_gt.dxf\"\n draw(out)\n print(\"wrote\", out)\n```"}], "images": ["images/0093_00935902.png"], "id": "0093_00935902"} {"messages": [{"role": "user", "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 75 mm. It is extruded to a thickness of 11.7 mm. A union feature: The part is a circular plate with diameter 75.45 mm, featuring a circular hole of diameter 62.88 mm. It is extruded to a thickness of 86.36 mm."}, {"role": "assistant", "content": "```python\n#!/usr/bin/env python3\n# -*- coding: utf-8 -*-\n# Ground-truth 2D engineering drawing for part: 0095_00954243\n# Self-contained: reproduces the three-view DXF via ezdxf, NO FreeCAD needed.\n# Coordinates are A4 page millimetres (scale=0.5156585365853669, page=[297.0, 210.0]).\n# visible edges -> solid (layer OUTLINE); hidden edges -> dashed (layer HIDDEN)\n# dimensions -> real movable DIMENSION entities (text = true mm value)\n# Run: python 0095_00954243_gt.py [out.dxf]\nimport sys\nimport ezdxf\nimport math\n\nSCALE = 0.5156585365853669\nPAGE = [297.0, 210.0]\n\nVISIBLE_SEGMENTS = [\n (131.699573, 110.46012, 80.133719, 110.46012),\n (131.699573, 110.46012, 131.699573, 104.429454),\n (131.699573, 104.429454, 80.133719, 104.429454),\n (125.073165, 104.429454, 125.073165, 65.925973),\n (125.073165, 65.925973, 86.164385, 65.925973),\n (80.133719, 104.429454, 80.133719, 110.46012),\n (86.164385, 65.925973, 86.164385, 104.429454),\n (145.699573, 176.025973, 145.699573, 124.46012),\n (151.730239, 176.025973, 151.730239, 124.46012),\n (190.233719, 169.697437, 190.233719, 130.788656),\n (151.730239, 176.025973, 145.699573, 176.025973),\n (151.730239, 124.46012, 145.699573, 124.46012),\n (190.233719, 169.697437, 151.730239, 169.697437),\n (190.233719, 130.788656, 151.730239, 130.788656)\n]\nVISIBLE_CIRCLES = [\n (105.916646, 150.243047, 25.782927),\n (105.618775, 150.243047, 19.45439),\n (105.618775, 150.243047, 16.211992)\n]\nVISIBLE_ARCS = [\n (105.916646, 150.243047, 19.337195, -67.236213, 67.236213)\n]\nHIDDEN_SEGMENTS = [\n (113.3988, 132.4121, 125.0732, 150.243),\n (125.0732, 150.243, 113.3988, 168.074),\n (113.3988, 104.4295, 113.3988, 110.4601),\n (121.8308, 110.4601, 121.8308, 65.926),\n (89.4068, 65.926, 89.4068, 110.4601),\n (151.7302, 168.074, 145.6996, 168.074),\n (151.7302, 132.4121, 145.6996, 132.4121),\n (190.2337, 166.455, 145.6996, 166.455),\n (190.2337, 134.0311, 145.6996, 134.0311)\n]\n# (orient, text, p1, p2, base) for linear; (orient, text, center, radius, angle) for diameter\nDIMENSIONS = [\n ('diameter', '%%c100', (105.9166, 150.243), 25.7829, 45),\n ('diameter', '%%c75', (105.9166, 150.243), 19.3372, 135),\n ('diameter', '%%c75.4545', (105.6188, 150.243), 19.4544, 225),\n ('diameter', '%%c62.8788', (105.6188, 150.243), 16.212, 315),\n ('horizontal', '11.6951', (145.6996, 150.243), (190.2337, 150.243), (167.9666, 171.243))\n]\n\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; _ds.dxf.dimasz = 2.5\n _ds.dxf.dimexe = 1.25; _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\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\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,\n angle=(0 if d[0] == \"horizontal\" else 90),\n 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,\n 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,\n 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,\n text=text, dimstyle=\"EZDXF\").render()\n\n doc.saveas(out_path)\n\n\nif __name__ == \"__main__\":\n out = sys.argv[1] if len(sys.argv) > 1 else \"0095_00954243_gt.dxf\"\n draw(out)\n print(\"wrote\", out)\n```"}], "images": ["images/0095_00954243.png"], "id": "0095_00954243"} {"messages": [{"role": "user", "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.37 mm. A union feature: The part is a circular plate with diameter 46.87 mm. It is extruded to a thickness of 42.26 mm. A union feature: The part is a circular plate with diameter 29.17 mm. It is extruded to a thickness of 44.33 mm. A cut feature: The part is a circular plate with diameter 14.58 mm. It is extruded to a thickness of 19.59 mm. A cut feature: The part is a circular plate with diameter 14.58 mm. It is extruded to a thickness of -98.96 mm."}, {"role": "assistant", "content": "```python\n#!/usr/bin/env python3\n# -*- coding: utf-8 -*-\n# Ground-truth 2D engineering drawing for part: 0010_00105829\n# Self-contained: reproduces the three-view DXF via ezdxf, NO FreeCAD needed.\n# Coordinates are A4 page millimetres (scale=0.4830157068062835, page=[297.0, 210.0]).\n# visible edges -> solid (layer OUTLINE); hidden edges -> dashed (layer HIDDEN)\n# dimensions -> real movable DIMENSION entities (text = true mm value)\n# Run: python 0010_00105829_gt.py [out.dxf]\nimport sys\nimport ezdxf\nimport math\n\nSCALE = 0.4830157068062835\nPAGE = [297.0, 210.0]\n\nVISIBLE_SEGMENTS = [\n (129.887098, 118.763172, 81.585527, 118.763172),\n (129.887098, 118.763172, 129.887098, 112.788368),\n (129.887098, 112.788368, 81.585527, 112.788368),\n (116.674396, 112.788368, 116.674396, 92.374456),\n (116.674396, 92.374456, 94.033035, 92.374456),\n (112.602096, 70.964743, 98.514137, 70.964743),\n (112.602096, 92.374456, 112.602096, 70.964743),\n (81.585527, 112.788368, 81.585527, 118.763172),\n (94.033035, 92.374456, 94.033035, 112.788368),\n (98.514137, 70.964743, 98.514137, 92.374456),\n (143.887098, 181.064743, 143.887098, 132.763172),\n (149.861902, 181.064743, 149.861902, 132.763172),\n (170.275814, 168.234638, 170.275814, 145.593277),\n (191.685527, 163.957937, 191.685527, 149.869979),\n (189.232522, 163.957937, 189.232713, 163.957841),\n (182.188734, 163.957841, 182.188925, 163.957937),\n (189.232522, 149.869979, 189.232713, 149.870074),\n (182.188734, 149.870074, 182.188925, 149.869978),\n (149.861902, 181.064743, 143.887098, 181.064743),\n (149.861902, 132.763172, 143.887098, 132.763172),\n (170.275814, 168.234638, 149.861902, 168.234638),\n (170.275814, 145.593277, 149.861902, 145.593277),\n (191.685527, 163.957937, 189.232522, 163.957937),\n (182.188925, 163.957937, 170.275814, 163.957937),\n (191.685527, 149.869979, 189.232522, 149.869979),\n (182.188925, 149.869979, 170.275814, 149.869979)\n]\nVISIBLE_CIRCLES = [\n (105.736312, 156.913958, 24.150785),\n (105.353715, 156.913958, 11.320681),\n (105.558116, 156.913958, 7.043979),\n (105.521429, 76.939546, 3.52199)\n]\nVISIBLE_ARCS = [\n (185.325637, 171.687665, 8.660973, -87.451659, -63.186312),\n (185.710724, 169.845987, 6.840446, -120.88572, -59.11428),\n (186.095808, 171.687656, 8.660964, -116.813702, -92.548328),\n (185.325637, 142.14025, 8.660973, 63.186312, 87.451659),\n (185.710724, 143.981928, 6.840446, 59.11428, 120.88572),\n (186.095808, 142.140259, 8.660964, 92.548328, 116.813702)\n]\nHIDDEN_SEGMENTS = [\n (109.0434, 150.7927, 109.0434, 163.0353),\n (101.9994, 162.9929, 101.9994, 150.835),\n (182.1887, 163.9578, 182.1887, 149.8701),\n (189.2327, 163.9578, 189.2327, 149.8701)\n]\n# (orient, text, p1, p2, base) for linear; (orient, text, center, radius, angle) for diameter\nDIMENSIONS = [\n ('diameter', '%%c100', (105.7363, 156.914), 24.1508, 45),\n ('diameter', '%%c46.875', (105.3537, 156.914), 11.3207, 135),\n ('diameter', '%%c29.1667', (105.5581, 156.914), 7.044, 225),\n ('horizontal', '12.3698', (143.8871, 156.914), (149.8619, 156.914), (146.8745, 167.914)),\n ('horizontal', '44.3251', (149.8619, 156.914), (170.2758, 156.914), (160.0689, 177.914)),\n ('horizontal', '12.3698', (170.2758, 156.914), (191.6855, 156.914), (180.9807, 187.914)),\n ('diameter', '%%c14.5833', (105.5215, 76.9396), 3.522, 45),\n ('diameter', '%%c14.5833', (105.5215, 76.9396), 3.522, 135)\n]\n\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; _ds.dxf.dimasz = 2.5\n _ds.dxf.dimexe = 1.25; _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\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\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,\n angle=(0 if d[0] == \"horizontal\" else 90),\n 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,\n 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,\n 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,\n text=text, dimstyle=\"EZDXF\").render()\n\n doc.saveas(out_path)\n\n\nif __name__ == \"__main__\":\n out = sys.argv[1] if len(sys.argv) > 1 else \"0010_00105829_gt.dxf\"\n draw(out)\n print(\"wrote\", out)\n```"}], "images": ["images/0010_00105829.png"], "id": "0010_00105829"} {"messages": [{"role": "user", "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 24.74 mm. A cut feature: The part is a circular plate with diameter 55.21 mm. It is extruded to a thickness of -24.74 mm."}, {"role": "assistant", "content": "```python\n#!/usr/bin/env python3\n# -*- coding: utf-8 -*-\n# Ground-truth 2D engineering drawing for part: 0010_00106144\n# Self-contained: reproduces the three-view DXF via ezdxf, NO FreeCAD needed.\n# Coordinates are A4 page millimetres (scale=0.7704050104384155, page=[297.0, 210.0]).\n# visible edges -> solid (layer OUTLINE); hidden edges -> dashed (layer HIDDEN)\n# dimensions -> real movable DIMENSION entities (text = true mm value)\n# Run: python 0010_00106144_gt.py [out.dxf]\nimport sys\nimport ezdxf\nimport math\n\nSCALE = 0.7704050104384155\nPAGE = [297.0, 210.0]\n\nVISIBLE_SEGMENTS = [\n (150.588773, 100.269624, 73.548272, 100.269624),\n (150.588773, 100.269624, 150.588773, 81.210125),\n (150.588773, 81.210125, 73.548272, 81.210125),\n (73.548272, 81.210125, 73.548272, 100.269624),\n (164.588773, 191.310125, 164.588773, 114.269624),\n (183.648272, 191.310125, 183.648272, 114.269624),\n (183.648272, 191.310125, 164.588773, 191.310125),\n (183.648272, 114.269624, 164.588773, 114.269624)\n]\nVISIBLE_CIRCLES = [\n (112.068523, 152.789875, 38.520251),\n (111.888795, 152.789875, 21.266388)\n]\nVISIBLE_ARCS = [\n\n]\nHIDDEN_SEGMENTS = [\n (133.1552, 81.2101, 133.1552, 100.2696),\n (90.6224, 100.2696, 90.6224, 81.2101),\n (164.5888, 131.5235, 183.6483, 131.5235),\n (164.5888, 174.0563, 183.6483, 174.0563)\n]\n# (orient, text, p1, p2, base) for linear; (orient, text, center, radius, angle) for diameter\nDIMENSIONS = [\n ('diameter', '%%c100', (112.0685, 152.7899), 38.5203, 45),\n ('diameter', '%%c55.2083', (111.8888, 152.7899), 21.2664, 135),\n ('horizontal', '24.7396', (164.5888, 152.7899), (183.6483, 152.7899), (174.1185, 163.7899))\n]\n\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; _ds.dxf.dimasz = 2.5\n _ds.dxf.dimexe = 1.25; _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\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\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,\n angle=(0 if d[0] == \"horizontal\" else 90),\n 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,\n 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,\n 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,\n text=text, dimstyle=\"EZDXF\").render()\n\n doc.saveas(out_path)\n\n\nif __name__ == \"__main__\":\n out = sys.argv[1] if len(sys.argv) > 1 else \"0010_00106144_gt.dxf\"\n draw(out)\n print(\"wrote\", out)\n```"}], "images": ["images/0010_00106144.png"], "id": "0010_00106144"} {"messages": [{"role": "user", "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 1187.5 mm. A cut feature: The part is a circular plate with diameter 25 mm. It is extruded to a thickness of -519.53 mm."}, {"role": "assistant", "content": "```python\n#!/usr/bin/env python3\n# -*- coding: utf-8 -*-\n# Ground-truth 2D engineering drawing for part: 0015_00159594\n# Self-contained: reproduces the three-view DXF via ezdxf, NO FreeCAD needed.\n# Coordinates are A4 page millimetres (scale=0.07463696203608784, page=[297.0, 210.0]).\n# visible edges -> solid (layer OUTLINE); hidden edges -> dashed (layer HIDDEN)\n# dimensions -> real movable DIMENSION entities (text = true mm value)\n# Run: python 0015_00159594_gt.py [out.dxf]\nimport sys\nimport ezdxf\nimport math\n\nSCALE = 0.07463696203608784\nPAGE = [297.0, 210.0]\n\nVISIBLE_SEGMENTS = [\n (94.757238, 62.008004, 94.757238, 150.639396),\n (87.293542, 150.639396, 94.757238, 150.639396),\n (87.293542, 62.008004, 94.757238, 62.008004),\n (87.293542, 150.639396, 87.293542, 62.008004),\n (108.757238, 164.639399, 108.757238, 172.103095),\n (197.388631, 164.639399, 197.388631, 172.103095),\n (183.549238, 172.103097, 183.549694, 172.102983),\n (181.68377, 172.102983, 181.684226, 172.103097),\n (183.549238, 164.639397, 183.549694, 164.639511),\n (181.68377, 164.639511, 181.684226, 164.639397),\n (108.757238, 164.639399, 181.684226, 164.639399),\n (183.549238, 164.639399, 197.388631, 164.639399),\n (108.757238, 172.103095, 181.684226, 172.103095),\n (183.549238, 172.103095, 197.388631, 172.103095)\n]\nVISIBLE_CIRCLES = [\n (91.02539, 168.371247, 3.731848),\n (90.996235, 76.779903, 0.932962)\n]\nVISIBLE_ARCS = [\n (182.590215, 176.101398, 4.110041, -89.630289, -76.511978),\n (182.616732, 175.492812, 3.515872, -105.388177, -74.611823),\n (182.643237, 176.101409, 4.110051, -103.48782, -90.369538),\n (182.590219, 160.641092, 4.110045, 76.512051, 89.63035),\n (182.616732, 161.249682, 3.515872, 74.611823, 105.388177),\n (182.643245, 160.641091, 4.110046, 90.369656, 103.487954)\n]\nHIDDEN_SEGMENTS = [\n (91.9292, 171.992, 91.9292, 164.7505),\n (90.0633, 171.9769, 90.0633, 164.7656),\n (181.6838, 172.103, 181.6838, 164.6395),\n (183.5497, 172.103, 183.5497, 164.6395)\n]\n# (orient, text, p1, p2, base) for linear; (orient, text, center, radius, angle) for diameter\nDIMENSIONS = [\n ('diameter', '%%c100', (91.0254, 168.3712), 3.7318, 45),\n ('horizontal', '1187.5', (197.3886, 168.3712), (108.7572, 168.3712), (153.0729, 157.3712)),\n ('vertical', '99.997', (182.6167, 129.595), (182.6167, 207.1475), (161.6167, 168.3712)),\n ('diameter', '%%c25', (90.9962, 76.7799), 0.933, 45)\n]\n\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; _ds.dxf.dimasz = 2.5\n _ds.dxf.dimexe = 1.25; _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\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\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,\n angle=(0 if d[0] == \"horizontal\" else 90),\n 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,\n 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,\n 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,\n text=text, dimstyle=\"EZDXF\").render()\n\n doc.saveas(out_path)\n\n\nif __name__ == \"__main__\":\n out = sys.argv[1] if len(sys.argv) > 1 else \"0015_00159594_gt.dxf\"\n draw(out)\n print(\"wrote\", out)\n```"}], "images": ["images/0015_00159594.png"], "id": "0015_00159594"} {"messages": [{"role": "user", "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 87.16 mm. A cut feature: The part is a circular plate with diameter 77.06 mm. It is extruded to a thickness of -79.89 mm."}, {"role": "assistant", "content": "```python\n#!/usr/bin/env python3\n# -*- coding: utf-8 -*-\n# Ground-truth 2D engineering drawing for part: 0020_00208234\n# Self-contained: reproduces the three-view DXF via ezdxf, NO FreeCAD needed.\n# Coordinates are A4 page millimetres (scale=0.5134754901960792, page=[297.0, 210.0]).\n# visible edges -> solid (layer OUTLINE); hidden edges -> dashed (layer HIDDEN)\n# dimensions -> real movable DIMENSION entities (text = true mm value)\n# Run: python 0020_00208234_gt.py [out.dxf]\nimport sys\nimport ezdxf\nimport math\n\nSCALE = 0.5134754901960792\nPAGE = [297.0, 210.0]\n\nVISIBLE_SEGMENTS = [\n (128.389845, 119.539338, 77.042296, 119.539338),\n (128.389845, 119.539338, 128.389845, 74.786887),\n (128.389845, 74.786887, 77.042296, 74.786887),\n (77.042296, 74.786887, 77.042296, 119.539338),\n (142.389845, 184.886887, 142.389845, 133.539338),\n (187.142296, 184.886887, 187.142296, 133.539338),\n (187.142296, 184.886887, 142.389845, 184.886887),\n (187.142296, 133.539338, 142.389845, 133.539338)\n]\nVISIBLE_CIRCLES = [\n (102.71607, 159.213113, 25.673775),\n (102.887818, 159.213113, 19.785294)\n]\nVISIBLE_ARCS = [\n\n]\nHIDDEN_SEGMENTS = [\n (122.6731, 74.7869, 122.6731, 115.81),\n (122.6731, 115.81, 83.1025, 115.81),\n (83.1025, 115.81, 83.1025, 74.7869),\n (146.1192, 178.9984, 146.1192, 139.4278),\n (146.1192, 139.4278, 187.1423, 139.4278),\n (146.1192, 178.9984, 187.1423, 178.9984)\n]\n# (orient, text, p1, p2, base) for linear; (orient, text, center, radius, angle) for diameter\nDIMENSIONS = [\n ('diameter', '%%c100', (102.7161, 159.2131), 25.6738, 45),\n ('diameter', '%%c77.0642', (102.8878, 159.2131), 19.7853, 135),\n ('horizontal', '87.156', (142.3898, 159.2131), (187.1423, 159.2131), (164.7661, 170.2131))\n]\n\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; _ds.dxf.dimasz = 2.5\n _ds.dxf.dimexe = 1.25; _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\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\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,\n angle=(0 if d[0] == \"horizontal\" else 90),\n 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,\n 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,\n 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,\n text=text, dimstyle=\"EZDXF\").render()\n\n doc.saveas(out_path)\n\n\nif __name__ == \"__main__\":\n out = sys.argv[1] if len(sys.argv) > 1 else \"0020_00208234_gt.dxf\"\n draw(out)\n print(\"wrote\", out)\n```"}], "images": ["images/0020_00208234.png"], "id": "0020_00208234"} {"messages": [{"role": "user", "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 28.35 mm. A cut feature: The part is a circular plate with diameter 10.71 mm. It is extruded to a thickness of 65.46 mm. A cut feature: The part is a circular plate with diameter 10.71 mm. It is extruded to a thickness of 65.46 mm. A cut feature: The part is a circular plate with diameter 10.71 mm. It is extruded to a thickness of 65.46 mm. A cut feature: The part is a circular plate with diameter 10.71 mm. It is extruded to a thickness of 65.46 mm."}, {"role": "assistant", "content": "```python\n#!/usr/bin/env python3\n# -*- coding: utf-8 -*-\n# Ground-truth 2D engineering drawing for part: 0029_00299310\n# Self-contained: reproduces the three-view DXF via ezdxf, NO FreeCAD needed.\n# Coordinates are A4 page millimetres (scale=0.7347, page=[297.0, 210.0]).\n# visible edges -> solid (layer OUTLINE); hidden edges -> dashed (layer HIDDEN)\n# dimensions -> real movable DIMENSION entities (text = true mm value)\n# Run: python 0029_00299310_gt.py [out.dxf]\nimport sys\nimport ezdxf\nimport math\n\nSCALE = 0.7347\nPAGE = [297.0, 210.0]\n\nVISIBLE_SEGMENTS = [\n (86.890211, 65.882923, 160.360211, 65.882923),\n (160.360211, 65.882923, 160.360211, 86.709787),\n (86.890211, 86.709787, 160.360211, 86.709787),\n (86.890211, 86.709787, 86.890211, 65.882923),\n (195.187075, 100.709787, 195.187075, 174.179787),\n (174.360212, 100.709787, 174.360212, 174.179787),\n (174.360212, 100.709787, 195.187075, 100.709787),\n (174.360212, 174.179787, 195.187075, 174.179787)\n]\nVISIBLE_CIRCLES = [\n (123.625211, 137.444787, 36.735),\n (92.801453, 137.444787, 3.934185),\n (123.473743, 106.772497, 3.934185),\n (123.473743, 168.117077, 3.934185),\n (154.146033, 137.444787, 3.934185)\n]\nVISIBLE_ARCS = [\n\n]\nHIDDEN_SEGMENTS = [\n (96.7356, 65.8829, 96.7356, 86.7098),\n (127.4079, 65.8829, 127.4079, 86.7098),\n (158.0802, 65.8829, 158.0802, 86.7098),\n (88.8673, 86.7098, 88.8673, 65.8829),\n (119.5396, 86.7098, 119.5396, 65.8829),\n (150.2118, 86.7098, 150.2118, 65.8829),\n (174.3602, 133.5106, 195.1871, 133.5106),\n (174.3602, 141.379, 195.1871, 141.379),\n (174.3602, 102.8383, 195.1871, 102.8383),\n (174.3602, 110.7067, 195.1871, 110.7067),\n (174.3602, 164.1829, 195.1871, 164.1829),\n (174.3602, 172.0513, 195.1871, 172.0513)\n]\n# (orient, text, p1, p2, base) for linear; (orient, text, center, radius, angle) for diameter\nDIMENSIONS = [\n ('diameter', '%%c100', (123.6252, 137.4448), 36.735, 45),\n ('diameter', '%%c10.7096', (123.4738, 106.7725), 3.9342, 45),\n ('diameter', '%%c10.7096', (154.146, 137.4448), 3.9342, 45),\n ('diameter', '%%c10.7096', (92.8014, 137.4448), 3.9342, 45),\n ('diameter', '%%c10.7096', (123.4738, 168.117), 3.9342, 45),\n ('horizontal', '28.3474', (195.1871, 137.4448), (147.096, 137.4448), (171.1415, 106.4448))\n]\n\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; _ds.dxf.dimasz = 2.5\n _ds.dxf.dimexe = 1.25; _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\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\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,\n angle=(0 if d[0] == \"horizontal\" else 90),\n 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,\n 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,\n 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,\n text=text, dimstyle=\"EZDXF\").render()\n\n doc.saveas(out_path)\n\n\nif __name__ == \"__main__\":\n out = sys.argv[1] if len(sys.argv) > 1 else \"0029_00299310_gt.dxf\"\n draw(out)\n print(\"wrote\", out)\n```"}], "images": ["images/0029_00299310.png"], "id": "0029_00299310"} {"messages": [{"role": "user", "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 23.19 mm. A cut feature: The part is a circular plate with diameter 40.62 mm. It is extruded to a thickness of -23.19 mm."}, {"role": "assistant", "content": "```python\n#!/usr/bin/env python3\n# -*- coding: utf-8 -*-\n# Ground-truth 2D engineering drawing for part: 0033_00331125\n# Self-contained: reproduces the three-view DXF via ezdxf, NO FreeCAD needed.\n# Coordinates are A4 page millimetres (scale=0.7800745144669045, page=[297.0, 210.0]).\n# visible edges -> solid (layer OUTLINE); hidden edges -> dashed (layer HIDDEN)\n# dimensions -> real movable DIMENSION entities (text = true mm value)\n# Run: python 0033_00331125_gt.py [out.dxf]\nimport sys\nimport ezdxf\nimport math\n\nSCALE = 0.7800745144669045\nPAGE = [297.0, 210.0]\n\nVISIBLE_SEGMENTS = [\n (152.805513, 99.544411, 74.798061, 99.544411),\n (152.805513, 99.544411, 152.805513, 81.451863),\n (152.805513, 81.451863, 74.798061, 81.451863),\n (74.798061, 81.451863, 74.798061, 99.544411),\n (166.805513, 191.551863, 166.805513, 113.544412),\n (184.898061, 191.551863, 184.898061, 113.544412),\n (184.898061, 191.551863, 166.805513, 191.551863),\n (184.898061, 113.544412, 166.805513, 113.544412)\n]\nVISIBLE_CIRCLES = [\n (113.801787, 152.548137, 39.003726),\n (113.560553, 152.548137, 15.845264)\n]\nVISIBLE_ARCS = [\n\n]\nHIDDEN_SEGMENTS = [\n (129.4058, 81.4519, 129.4058, 99.5444),\n (97.7153, 99.5444, 97.7153, 81.4519),\n (166.8055, 136.7029, 184.8981, 136.7029),\n (166.8055, 168.3934, 184.8981, 168.3934)\n]\n# (orient, text, p1, p2, base) for linear; (orient, text, center, radius, angle) for diameter\nDIMENSIONS = [\n ('diameter', '%%c100', (113.8018, 152.5481), 39.0037, 45),\n ('diameter', '%%c40.625', (113.5606, 152.5481), 15.8453, 135),\n ('horizontal', '23.1934', (166.8055, 152.5481), (184.8981, 152.5481), (175.8518, 163.5481))\n]\n\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; _ds.dxf.dimasz = 2.5\n _ds.dxf.dimexe = 1.25; _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\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\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,\n angle=(0 if d[0] == \"horizontal\" else 90),\n 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,\n 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,\n 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,\n text=text, dimstyle=\"EZDXF\").render()\n\n doc.saveas(out_path)\n\n\nif __name__ == \"__main__\":\n out = sys.argv[1] if len(sys.argv) > 1 else \"0033_00331125_gt.dxf\"\n draw(out)\n print(\"wrote\", out)\n```"}], "images": ["images/0033_00331125.png"], "id": "0033_00331125"} {"messages": [{"role": "user", "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 8.76 mm. A cut feature: The part is a circular plate with diameter 1.53 mm. It is extruded to a thickness of -8.76 mm. A cut feature: The part is a circular plate with diameter 1.53 mm. It is extruded to a thickness of -8.76 mm. A cut feature: The part is a circular plate with diameter 1.53 mm. It is extruded to a thickness of -8.76 mm. A cut feature: The part is a circular plate with diameter 1.53 mm. It is extruded to a thickness of -8.76 mm."}, {"role": "assistant", "content": "```python\n#!/usr/bin/env python3\n# -*- coding: utf-8 -*-\n# Ground-truth 2D engineering drawing for part: 0034_00349498\n# Self-contained: reproduces the three-view DXF via ezdxf, NO FreeCAD needed.\n# Coordinates are A4 page millimetres (scale=0.883581184217089, page=[297.0, 210.0]).\n# visible edges -> solid (layer OUTLINE); hidden edges -> dashed (layer HIDDEN)\n# dimensions -> real movable DIMENSION entities (text = true mm value)\n# Run: python 0034_00349498_gt.py [out.dxf]\nimport sys\nimport ezdxf\nimport math\n\nSCALE = 0.883581184217089\nPAGE = [297.0, 210.0]\n\nVISIBLE_SEGMENTS = [\n (169.180088, 79.257779, 80.82197, 79.257779),\n (169.180088, 79.257779, 169.180088, 71.515898),\n (169.180088, 71.515898, 80.82197, 71.515898),\n (80.82197, 71.515898, 80.82197, 79.257779),\n (183.180088, 181.615898, 183.180088, 93.257779),\n (190.92197, 181.615898, 190.92197, 93.257779),\n (190.92197, 181.615898, 183.180088, 181.615898),\n (190.92197, 93.257779, 183.180088, 93.257779)\n]\nVISIBLE_CIRCLES = [\n (125.001029, 137.436839, 44.179059),\n (110.658174, 112.389575, 0.675917),\n (136.616248, 112.389575, 0.675917),\n (110.658174, 162.484102, 0.675917),\n (136.616248, 162.484102, 0.675917)\n]\nVISIBLE_ARCS = [\n\n]\nHIDDEN_SEGMENTS = [\n (111.3341, 71.5159, 111.3341, 79.2578),\n (137.2922, 71.5159, 137.2922, 79.2578),\n (109.9823, 79.2578, 109.9823, 71.5159),\n (135.9403, 79.2578, 135.9403, 71.5159),\n (183.1801, 111.7137, 190.922, 111.7137),\n (183.1801, 113.0655, 190.922, 113.0655),\n (183.1801, 161.8082, 190.922, 161.8082),\n (183.1801, 163.16, 190.922, 163.16)\n]\n# (orient, text, p1, p2, base) for linear; (orient, text, center, radius, angle) for diameter\nDIMENSIONS = [\n ('diameter', '%%c100', (125.001, 137.4368), 44.1791, 45),\n ('diameter', '%%c1.5299', (110.6582, 162.4841), 0.6759, 45),\n ('diameter', '%%c1.5299', (110.6582, 112.3896), 0.6759, 45),\n ('diameter', '%%c1.5299', (136.6162, 112.3896), 0.6759, 45),\n ('diameter', '%%c1.5299', (136.6162, 162.4841), 0.6759, 45),\n ('horizontal', '8.7619', (183.1801, 137.4368), (190.9219, 137.4368), (187.051, 148.4368)),\n ('horizontal', '8.7619', (190.9219, 162.4841), (183.1801, 162.4841), (187.051, 141.4841)),\n ('horizontal', '8.7619', (190.9219, 112.3896), (183.1801, 112.3896), (187.051, 81.3896)),\n ('horizontal', '8.7619', (190.9219, 112.3896), (183.1801, 112.3896), (187.051, 71.3896)),\n ('horizontal', '8.7619', (190.9219, 162.4841), (183.1801, 162.4841), (187.051, 111.4841))\n]\n\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; _ds.dxf.dimasz = 2.5\n _ds.dxf.dimexe = 1.25; _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\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\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,\n angle=(0 if d[0] == \"horizontal\" else 90),\n 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,\n 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,\n 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,\n text=text, dimstyle=\"EZDXF\").render()\n\n doc.saveas(out_path)\n\n\nif __name__ == \"__main__\":\n out = sys.argv[1] if len(sys.argv) > 1 else \"0034_00349498_gt.dxf\"\n draw(out)\n print(\"wrote\", out)\n```"}], "images": ["images/0034_00349498.png"], "id": "0034_00349498"} {"messages": [{"role": "user", "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 95.83 mm. It is extruded to a thickness of 37.62 mm. A cut feature: The part is a circular plate with diameter 10.42 mm. It is extruded to a thickness of 65.46 mm. A cut feature: The part is a circular plate with diameter 10.42 mm. It is extruded to a thickness of -65.97 mm."}, {"role": "assistant", "content": "```python\n#!/usr/bin/env python3\n# -*- coding: utf-8 -*-\n# Ground-truth 2D engineering drawing for part: 0056_00562225\n# Self-contained: reproduces the three-view DXF via ezdxf, NO FreeCAD needed.\n# Coordinates are A4 page millimetres (scale=0.6981872042843369, page=[297.0, 210.0]).\n# visible edges -> solid (layer OUTLINE); hidden edges -> dashed (layer HIDDEN)\n# dimensions -> real movable DIMENSION entities (text = true mm value)\n# Run: python 0056_00562225_gt.py [out.dxf]\nimport sys\nimport ezdxf\nimport math\n\nSCALE = 0.6981872042843369\nPAGE = [297.0, 210.0]\n\nVISIBLE_SEGMENTS = [\n (127.02367, 145.696121, 57.20495, 145.696121),\n (127.02367, 171.965263, 127.02367, 145.696121),\n (127.02367, 171.965263, 57.20495, 171.965263),\n (94.461646, 152.839527, 94.397643, 152.907164),\n (93.427736, 153.620172, 93.410632, 153.628753),\n (91.797138, 154.010569, 91.706865, 154.009661),\n (88.485479, 151.895065, 88.364774, 151.599382),\n (88.321848, 151.472061, 88.303272, 151.411582),\n (88.152175, 150.385183, 88.153479, 150.2762),\n (88.153523, 150.274567, 88.192753, 149.832346),\n (91.67929, 146.739438, 91.853274, 146.738372),\n (91.855054, 146.738404, 92.18834, 146.75984),\n (95.041681, 148.749231, 95.229873, 149.199182),\n (57.20495, 145.696121, 57.20495, 171.965263),\n (210.842391, 145.696121, 141.023671, 145.696121),\n (210.842391, 171.965263, 141.023671, 171.965263),\n (141.02367, 153.995958, 141.02519, 154.010579),\n (141.02519, 146.737796, 141.02367, 146.752417),\n (210.842391, 166.950603, 210.840871, 166.965224),\n (210.840871, 159.692441, 210.842391, 159.707063),\n (210.842391, 145.696121, 210.842391, 159.707063),\n (210.842391, 166.950603, 210.842391, 171.965263),\n (141.023671, 145.696121, 141.023671, 146.752417),\n (141.023671, 153.995958, 141.023671, 171.965263)\n]\nVISIBLE_CIRCLES = [\n (91.78855, 163.328833, 3.636391),\n (92.11431, 96.786761, 34.90936),\n (92.11431, 96.786761, 33.454804),\n (91.788555, 150.374189, 3.636387)\n]\nVISIBLE_ARCS = [\n (91.788563, 150.374206, 3.63637, 64.743612, 78.578772),\n (91.788548, 150.37419, 3.636389, 91.29854, 152.531559),\n (91.788546, 150.374187, 3.636388, -154.696609, -144.946976),\n (91.78853, 150.374153, 3.636353, -116.828924, -102.940159),\n (97.646972, 150.219223, 43.535506, 0.203951, 4.976097),\n (111.628404, 150.374187, 29.620844, -7.051684, 7.051684),\n (97.646983, 150.529146, 43.535496, -4.976089, -0.203942),\n (254.21909, 163.17387, 43.535507, 175.023906, 179.796052),\n (240.237658, 163.328833, 29.620844, 172.948316, -172.948316),\n (254.219088, 163.483797, 43.535505, -179.79605, -175.023904)\n]\nHIDDEN_SEGMENTS = [\n (93.4106, 166.5834, 92.3776, 166.9172),\n (90.195, 166.5975, 89.2288, 165.9117),\n (88.8157, 165.423, 88.2843, 164.3004),\n (125.5691, 171.9653, 125.5691, 145.6961),\n (58.6595, 145.6961, 58.6595, 171.9653),\n (95.4249, 130.0774, 95.4249, 131.5388),\n (95.4249, 63.4962, 95.4249, 62.0347),\n (88.1522, 131.4705, 88.1522, 130.0061),\n (88.1522, 62.103, 88.1522, 63.5674),\n (142.6424, 150.3742, 142.4782, 153.996),\n (142.4782, 153.996, 142.4798, 154.0106),\n (142.4798, 154.0106, 142.4798, 146.7378),\n (142.4798, 146.7378, 142.4782, 146.7524),\n (142.4782, 146.7524, 142.6424, 150.3742),\n (209.2236, 163.3288, 209.3878, 166.9506),\n (209.3878, 166.9506, 209.3862, 166.9652),\n (209.3862, 166.9652, 209.3862, 159.6924),\n (209.3862, 159.6924, 209.3878, 159.7071),\n (209.3878, 159.7071, 209.2236, 163.3288),\n (141.0252, 146.7378, 142.4798, 146.7378),\n (141.0252, 154.0106, 142.4798, 154.0106),\n (210.8409, 166.9652, 209.3862, 166.9652),\n (210.8409, 159.6924, 209.3862, 159.6924),\n (209.3878, 145.6961, 209.3878, 159.7071),\n (209.3878, 166.9506, 209.3878, 171.9653),\n (142.4782, 145.6961, 142.4782, 146.7524),\n (142.4782, 153.996, 142.4782, 171.9653)\n]\n# (orient, text, p1, p2, base) for linear; (orient, text, center, radius, angle) for diameter\nDIMENSIONS = [\n ('diameter', '%%c10.4167', (91.7886, 163.3288), 3.6364, 45),\n ('diameter', '%%c10.4167', (91.7886, 150.3742), 3.6364, 45),\n ('vertical', '37.6248', (175.933, 171.9653), (175.933, 145.6961), (186.933, 158.8307)),\n ('horizontal', '0.2352', (175.933, 163.3288), (221.6341, 163.3288), (198.7836, 184.3288)),\n ('diameter', '%%c100', (92.1143, 96.7868), 34.9094, 45),\n ('diameter', '%%c95.8333', (92.1143, 96.7868), 33.4548, 135)\n]\n\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; _ds.dxf.dimasz = 2.5\n _ds.dxf.dimexe = 1.25; _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\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\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,\n angle=(0 if d[0] == \"horizontal\" else 90),\n 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,\n 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,\n 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,\n text=text, dimstyle=\"EZDXF\").render()\n\n doc.saveas(out_path)\n\n\nif __name__ == \"__main__\":\n out = sys.argv[1] if len(sys.argv) > 1 else \"0056_00562225_gt.dxf\"\n draw(out)\n print(\"wrote\", out)\n```"}], "images": ["images/0056_00562225.png"], "id": "0056_00562225"} {"messages": [{"role": "user", "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 8.42 mm. A cut feature: The part is a circular plate with diameter 22.92 mm. It is extruded to a thickness of 90.54 mm."}, {"role": "assistant", "content": "```python\n#!/usr/bin/env python3\n# -*- coding: utf-8 -*-\n# Ground-truth 2D engineering drawing for part: 0063_00633363\n# Self-contained: reproduces the three-view DXF via ezdxf, NO FreeCAD needed.\n# Coordinates are A4 page millimetres (scale=0.7347, page=[297.0, 210.0]).\n# visible edges -> solid (layer OUTLINE); hidden edges -> dashed (layer HIDDEN)\n# dimensions -> real movable DIMENSION entities (text = true mm value)\n# Run: python 0063_00633363_gt.py [out.dxf]\nimport sys\nimport ezdxf\nimport math\n\nSCALE = 0.7347\nPAGE = [297.0, 210.0]\n\nVISIBLE_SEGMENTS = [\n (85.456099, 83.511232, 158.926099, 83.511232),\n (158.926099, 83.511232, 158.926099, 89.698865),\n (85.456099, 89.698865, 158.926099, 89.698865),\n (85.456099, 89.698865, 85.456099, 83.511232),\n (179.113732, 103.698865, 179.113732, 177.168865),\n (172.926099, 103.698865, 172.926099, 177.168865),\n (172.926099, 103.698865, 179.113732, 103.698865),\n (172.926099, 177.168865, 179.113732, 177.168865)\n]\nVISIBLE_CIRCLES = [\n (122.191099, 140.433865, 36.735),\n (121.898, 120.324058, 8.418437)\n]\nVISIBLE_ARCS = [\n\n]\nHIDDEN_SEGMENTS = [\n (130.3164, 83.5112, 130.3164, 89.6989),\n (113.4796, 89.6989, 113.4796, 83.5112),\n (172.9261, 111.9056, 179.1137, 111.9056),\n (172.9261, 128.7425, 179.1137, 128.7425)\n]\n# (orient, text, p1, p2, base) for linear; (orient, text, center, radius, angle) for diameter\nDIMENSIONS = [\n ('diameter', '%%c100', (122.1911, 140.4338), 36.735, 45),\n ('diameter', '%%c22.9167', (121.898, 120.3241), 8.4184, 45),\n ('horizontal', '8.422', (179.1137, 140.4338), (172.9261, 140.4338), (176.0199, 129.4338)),\n ('horizontal', '8.422', (179.1137, 120.3241), (112.5967, 120.3241), (145.8552, 99.3241))\n]\n\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; _ds.dxf.dimasz = 2.5\n _ds.dxf.dimexe = 1.25; _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\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\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,\n angle=(0 if d[0] == \"horizontal\" else 90),\n 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,\n 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,\n 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,\n text=text, dimstyle=\"EZDXF\").render()\n\n doc.saveas(out_path)\n\n\nif __name__ == \"__main__\":\n out = sys.argv[1] if len(sys.argv) > 1 else \"0063_00633363_gt.dxf\"\n draw(out)\n print(\"wrote\", out)\n```"}], "images": ["images/0063_00633363.png"], "id": "0063_00633363"} {"messages": [{"role": "user", "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 148.44 mm. A cut feature: The part is a circular plate with diameter 29.69 mm. It is extruded to a thickness of 98.96 mm."}, {"role": "assistant", "content": "```python\n#!/usr/bin/env python3\n# -*- coding: utf-8 -*-\n# Ground-truth 2D engineering drawing for part: 0075_00759509\n# Self-contained: reproduces the three-view DXF via ezdxf, NO FreeCAD needed.\n# Coordinates are A4 page millimetres (scale=0.38681761006289306, page=[297.0, 210.0]).\n# visible edges -> solid (layer OUTLINE); hidden edges -> dashed (layer HIDDEN)\n# dimensions -> real movable DIMENSION entities (text = true mm value)\n# Run: python 0075_00759509_gt.py [out.dxf]\nimport sys\nimport ezdxf\nimport math\n\nSCALE = 0.38681761006289306\nPAGE = [297.0, 210.0]\n\nVISIBLE_SEGMENTS = [\n (82.289501, 71.62044, 120.971262, 71.62044),\n (120.971262, 71.62044, 120.971262, 129.038679),\n (82.289501, 129.038679, 120.971262, 129.038679),\n (82.289501, 129.038679, 82.289501, 71.62044),\n (192.389502, 143.038679, 192.389502, 181.72044),\n (134.971263, 143.038679, 134.971263, 181.72044),\n (134.971263, 143.038679, 192.389502, 143.038679),\n (134.971263, 181.72044, 192.389502, 181.72044)\n]\nVISIBLE_CIRCLES = [\n (101.630382, 162.37956, 19.340881),\n (101.189672, 162.37956, 5.741824)\n]\nVISIBLE_ARCS = [\n\n]\nHIDDEN_SEGMENTS = [\n (106.9315, 71.6204, 106.9315, 109.8993),\n (106.9315, 109.8993, 95.4478, 109.8993),\n (95.4478, 109.8993, 95.4478, 71.6204),\n (154.1107, 156.6377, 154.1107, 168.1214),\n (154.1107, 156.6377, 192.3895, 156.6377),\n (154.1107, 168.1214, 192.3895, 168.1214)\n]\n# (orient, text, p1, p2, base) for linear; (orient, text, center, radius, angle) for diameter\nDIMENSIONS = [\n ('diameter', '%%c100', (101.6304, 162.3796), 19.3409, 45),\n ('diameter', '%%c29.6875', (101.1897, 162.3796), 5.7418, 135),\n ('horizontal', '148.438', (192.3895, 162.3796), (134.9713, 162.3796), (163.6804, 151.3796))\n]\n\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; _ds.dxf.dimasz = 2.5\n _ds.dxf.dimexe = 1.25; _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\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\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,\n angle=(0 if d[0] == \"horizontal\" else 90),\n 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,\n 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,\n 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,\n text=text, dimstyle=\"EZDXF\").render()\n\n doc.saveas(out_path)\n\n\nif __name__ == \"__main__\":\n out = sys.argv[1] if len(sys.argv) > 1 else \"0075_00759509_gt.dxf\"\n draw(out)\n print(\"wrote\", out)\n```"}], "images": ["images/0075_00759509.png"], "id": "0075_00759509"} {"messages": [{"role": "user", "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 24.74 mm. A cut feature: The part is a circular plate with diameter 25.52 mm. It is extruded to a thickness of -49.99 mm."}, {"role": "assistant", "content": "```python\n#!/usr/bin/env python3\n# -*- coding: utf-8 -*-\n# Ground-truth 2D engineering drawing for part: 0081_00812292\n# Self-contained: reproduces the three-view DXF via ezdxf, NO FreeCAD needed.\n# Coordinates are A4 page millimetres (scale=0.7704050104384155, page=[297.0, 210.0]).\n# visible edges -> solid (layer OUTLINE); hidden edges -> dashed (layer HIDDEN)\n# dimensions -> real movable DIMENSION entities (text = true mm value)\n# Run: python 0081_00812292_gt.py [out.dxf]\nimport sys\nimport ezdxf\nimport math\n\nSCALE = 0.7704050104384155\nPAGE = [297.0, 210.0]\n\nVISIBLE_SEGMENTS = [\n (153.427844, 100.269624, 76.387343, 100.269624),\n (153.427844, 100.269624, 153.427844, 81.210125),\n (153.427844, 81.210125, 76.387343, 81.210125),\n (76.387343, 81.210125, 76.387343, 100.269624),\n (167.427845, 191.310125, 167.427845, 114.269624),\n (186.487344, 191.310125, 186.487344, 114.269624),\n (186.487344, 191.310125, 167.427845, 191.310125),\n (186.487344, 114.269624, 167.427845, 114.269624)\n]\nVISIBLE_CIRCLES = [\n (114.907594, 152.789875, 38.520251),\n (114.807281, 152.789875, 9.830689)\n]\nVISIBLE_ARCS = [\n\n]\nHIDDEN_SEGMENTS = [\n (124.638, 81.2101, 124.638, 100.2696),\n (104.9766, 100.2696, 104.9766, 81.2101),\n (167.4278, 142.9592, 186.4873, 142.9592),\n (167.4278, 162.6206, 186.4873, 162.6206)\n]\n# (orient, text, p1, p2, base) for linear; (orient, text, center, radius, angle) for diameter\nDIMENSIONS = [\n ('diameter', '%%c100', (114.9076, 152.7899), 38.5203, 45),\n ('diameter', '%%c25.5208', (114.8073, 152.7899), 9.8307, 135),\n ('horizontal', '24.7396', (167.4278, 152.7899), (186.4874, 152.7899), (176.9576, 163.7899))\n]\n\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; _ds.dxf.dimasz = 2.5\n _ds.dxf.dimexe = 1.25; _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\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\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,\n angle=(0 if d[0] == \"horizontal\" else 90),\n 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,\n 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,\n 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,\n text=text, dimstyle=\"EZDXF\").render()\n\n doc.saveas(out_path)\n\n\nif __name__ == \"__main__\":\n out = sys.argv[1] if len(sys.argv) > 1 else \"0081_00812292_gt.dxf\"\n draw(out)\n print(\"wrote\", out)\n```"}], "images": ["images/0081_00812292.png"], "id": "0081_00812292"} {"messages": [{"role": "user", "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 20.37 mm. A union feature: The part is a circular plate with diameter 37.5 mm. It is extruded to a thickness of 49.48 mm. A cut feature: The part is a circular plate with diameter 25 mm. It is extruded to a thickness of -20.37 mm."}, {"role": "assistant", "content": "```python\n#!/usr/bin/env python3\n# -*- coding: utf-8 -*-\n# Ground-truth 2D engineering drawing for part: 0082_00826558\n# Self-contained: reproduces the three-view DXF via ezdxf, NO FreeCAD needed.\n# Coordinates are A4 page millimetres (scale=0.5657835497835484, page=[297.0, 210.0]).\n# visible edges -> solid (layer OUTLINE); hidden edges -> dashed (layer HIDDEN)\n# dimensions -> real movable DIMENSION entities (text = true mm value)\n# Run: python 0082_00826558_gt.py [out.dxf]\nimport sys\nimport ezdxf\nimport math\n\nSCALE = 0.5657835497835484\nPAGE = [297.0, 210.0]\n\nVISIBLE_SEGMENTS = [\n (136.243239, 111.557436, 79.664884, 111.557436),\n (136.243239, 111.557436, 136.243239, 100.03029),\n (136.243239, 100.03029, 79.664884, 100.03029),\n (118.584171, 100.03029, 118.584171, 72.035791),\n (118.584171, 72.035791, 97.367288, 72.035791),\n (79.664884, 100.03029, 79.664884, 111.557436),\n (97.367288, 72.035791, 97.367288, 100.03029),\n (150.243239, 182.135791, 150.243239, 125.557436),\n (161.770386, 182.135791, 161.770386, 125.557436),\n (189.764884, 164.455055, 189.764884, 143.238172),\n (175.767635, 161.964209, 176.00472, 161.967552),\n (176.00472, 161.967552, 176.241616, 161.97756),\n (176.241616, 161.97756, 176.478141, 161.994178),\n (176.478141, 161.994178, 176.714119, 162.017312),\n (176.714119, 162.017312, 176.949382, 162.046835),\n (176.949382, 162.046835, 177.18378, 162.08259),\n (177.18378, 162.08259, 177.417175, 162.124395),\n (177.417175, 162.124395, 177.649447, 162.172046),\n (177.649447, 162.172046, 177.880494, 162.225323),\n (177.880494, 162.225323, 178.110232, 162.283991),\n (178.110232, 162.283991, 178.338593, 162.34781),\n (178.338593, 162.34781, 178.565527, 162.416533),\n (178.565527, 162.416533, 178.790999, 162.489913),\n (178.790999, 162.489913, 179.014987, 162.567704),\n (179.014987, 162.567704, 179.237484, 162.649663),\n (179.237484, 162.649663, 179.458494, 162.735555),\n (179.458494, 162.735555, 179.678028, 162.825149),\n (179.678028, 162.825149, 179.896111, 162.918224),\n (179.896111, 162.918224, 180.112771, 163.014563),\n (180.112771, 163.014563, 180.328045, 163.113962),\n (180.328045, 163.113962, 180.541977, 163.216218),\n (180.541977, 163.216218, 180.754614, 163.321141),\n (180.754614, 163.321141, 180.966011, 163.428539),\n (180.966011, 163.428539, 181.176231, 163.538226),\n (181.176231, 163.538226, 181.38534, 163.650014),\n (181.38534, 163.650014, 181.593422, 163.763705),\n (181.593422, 163.763705, 181.800574, 163.879082),\n (181.800574, 163.879082, 182.006924, 163.995886),\n (182.006924, 163.995886, 182.212662, 164.113767),\n (182.212662, 164.113767, 182.418111, 164.232149),\n (182.418111, 164.232149, 182.62404, 164.349695),\n (182.62404, 164.349695, 182.835765, 164.455055),\n (182.835765, 164.455055, 182.83993, 164.452279),\n (182.83993, 164.452279, 182.460737, 164.1496),\n (182.460737, 164.1496, 182.061069, 163.871789),\n (182.061069, 163.871789, 181.654364, 163.604377),\n (181.654364, 163.604377, 181.241423, 163.346698),\n (181.241423, 163.346698, 180.822271, 163.099253),\n (180.822271, 163.099253, 180.396695, 162.863035),\n (180.396695, 162.863035, 179.96439, 162.639376),\n (179.96439, 162.639376, 179.525041, 162.429902),\n (179.525041, 162.429902, 179.078381, 162.236524),\n (179.078381, 162.236524, 178.624254, 162.061416),\n (178.624254, 162.061416, 178.162699, 161.906974),\n (178.162699, 161.906974, 177.694028, 161.775737),\n (177.694028, 161.775737, 177.218906, 161.670262),\n (177.218906, 161.670262, 176.738413, 161.592912),\n (176.738413, 161.592912, 176.254043, 161.545635),\n (176.254043, 161.545635, 175.767635, 161.529727),\n (175.767635, 161.529727, 175.281227, 161.545636),\n (175.281227, 161.545636, 174.796857, 161.592912),\n (174.796857, 161.592912, 174.316363, 161.670261),\n (174.316363, 161.670261, 173.841241, 161.775738),\n (173.841241, 161.775738, 173.37257, 161.906974),\n (173.37257, 161.906974, 172.911015, 162.061415),\n (172.911015, 162.061415, 172.456889, 162.236525),\n (172.456889, 162.236525, 172.010229, 162.429903),\n (172.010229, 162.429903, 171.57088, 162.639376),\n (171.57088, 162.639376, 171.138575, 162.863035),\n (171.138575, 162.863035, 170.712998, 163.099253),\n (170.712998, 163.099253, 170.293847, 163.346698),\n (170.293847, 163.346698, 169.880906, 163.604377),\n (169.880906, 163.604377, 169.4742, 163.871789),\n (169.4742, 163.871789, 169.074533, 164.1496),\n (169.074533, 164.1496, 168.69534, 164.45228),\n (168.69534, 164.45228, 168.699505, 164.455056),\n (175.767635, 145.729018, 176.00472, 145.725676),\n (176.00472, 145.725676, 176.241616, 145.715667),\n (176.241616, 145.715667, 176.478141, 145.699049),\n (176.478141, 145.699049, 176.714119, 145.675915),\n (176.714119, 145.675915, 176.949382, 145.646393),\n (176.949382, 145.646393, 177.18378, 145.610637),\n (177.18378, 145.610637, 177.417175, 145.568832),\n (177.417175, 145.568832, 177.649447, 145.521181),\n (177.649447, 145.521181, 177.880494, 145.467905),\n (177.880494, 145.467905, 178.110232, 145.409236),\n (178.110232, 145.409236, 178.338593, 145.345417),\n (178.338593, 145.345417, 178.565527, 145.276694),\n (178.565527, 145.276694, 178.790999, 145.203314),\n (178.790999, 145.203314, 179.014987, 145.125524),\n (179.014987, 145.125524, 179.237484, 145.043564),\n (179.237484, 145.043564, 179.458494, 144.957672),\n (179.458494, 144.957672, 179.678028, 144.868078),\n (179.678028, 144.868078, 179.896111, 144.775004),\n (179.896111, 144.775004, 180.112771, 144.678664),\n (180.112771, 144.678664, 180.328045, 144.579266),\n (180.328045, 144.579266, 180.541977, 144.477009),\n (180.541977, 144.477009, 180.754614, 144.372087),\n (180.754614, 144.372087, 180.966011, 144.264688),\n (180.966011, 144.264688, 181.176231, 144.155001),\n (181.176231, 144.155001, 181.38534, 144.043213),\n (181.38534, 144.043213, 181.593422, 143.929522),\n (181.593422, 143.929522, 181.800574, 143.814145),\n (181.800574, 143.814145, 182.006924, 143.697341),\n (182.006924, 143.697341, 182.212662, 143.57946),\n (182.212662, 143.57946, 182.418111, 143.461078),\n (182.418111, 143.461078, 182.62404, 143.343532),\n (182.62404, 143.343532, 182.835765, 143.238172),\n (182.835765, 143.238172, 182.83993, 143.240948),\n (182.83993, 143.240948, 182.460737, 143.543627),\n (182.460737, 143.543627, 182.061069, 143.821439),\n (182.061069, 143.821439, 181.654364, 144.08885),\n (181.654364, 144.08885, 181.241423, 144.34653),\n (181.241423, 144.34653, 180.822271, 144.593974),\n (180.822271, 144.593974, 180.396695, 144.830192),\n (180.396695, 144.830192, 179.96439, 145.053852),\n (179.96439, 145.053852, 179.525041, 145.263325),\n (179.525041, 145.263325, 179.078381, 145.456704),\n (179.078381, 145.456704, 178.624254, 145.631811),\n (178.624254, 145.631811, 178.162699, 145.786254),\n (178.162699, 145.786254, 177.694028, 145.91749),\n (177.694028, 145.91749, 177.218906, 146.022966),\n (177.218906, 146.022966, 176.738413, 146.100315),\n (176.738413, 146.100315, 176.254043, 146.147592),\n (176.254043, 146.147592, 175.767635, 146.1635),\n (175.767635, 146.1635, 175.281227, 146.147592),\n (175.281227, 146.147592, 174.796857, 146.100315),\n (174.796857, 146.100315, 174.316363, 146.022966),\n (174.316363, 146.022966, 173.841241, 145.917489),\n (173.841241, 145.917489, 173.37257, 145.786254),\n (173.37257, 145.786254, 172.911015, 145.631812),\n (172.911015, 145.631812, 172.456889, 145.456702),\n (172.456889, 145.456702, 172.010229, 145.263324),\n (172.010229, 145.263324, 171.57088, 145.053851),\n (171.57088, 145.053851, 171.138575, 144.830192),\n (171.138575, 144.830192, 170.712998, 144.593974),\n (170.712998, 144.593974, 170.293847, 144.346529),\n (170.293847, 144.346529, 169.880906, 144.08885),\n (169.880906, 144.08885, 169.4742, 143.821438),\n (169.4742, 143.821438, 169.074533, 143.543627),\n (169.074533, 143.543627, 168.69534, 143.240948),\n (168.69534, 143.240948, 168.699505, 143.238171),\n (161.770386, 182.135791, 150.243239, 182.135791),\n (161.770386, 125.557436, 150.243239, 125.557436),\n (189.764884, 164.455055, 182.835765, 164.455055),\n (168.699505, 164.455055, 161.770386, 164.455055),\n (189.764884, 143.238172, 182.835765, 143.238172),\n (168.699505, 143.238172, 161.770386, 143.238172)\n]\nVISIBLE_CIRCLES = [\n (107.954062, 153.846614, 28.289177),\n (107.975729, 153.846614, 10.608442),\n (107.733052, 86.03304, 7.072294)\n]\nVISIBLE_ARCS = [\n (177.549546, 178.294468, 16.42719, -122.598143, -96.227314),\n (177.549546, 129.398759, 16.42719, 96.227314, 122.598143)\n]\nHIDDEN_SEGMENTS = [\n (114.8053, 161.9642, 114.8053, 145.729),\n (100.6608, 161.5297, 100.6608, 146.1635),\n (168.6953, 164.4523, 168.6953, 143.2409),\n (182.8399, 164.4523, 182.8399, 143.2409)\n]\n# (orient, text, p1, p2, base) for linear; (orient, text, center, radius, angle) for diameter\nDIMENSIONS = [\n ('diameter', '%%c100', (107.954, 153.8466), 28.2892, 45),\n ('diameter', '%%c37.5', (107.9757, 153.8466), 10.6084, 135),\n ('horizontal', '20.3738', (150.2432, 153.8466), (161.7704, 153.8466), (156.0068, 164.8466)),\n ('horizontal', '37.2396', (161.7704, 153.8466), (189.7649, 153.8466), (175.7677, 174.8466)),\n ('vertical', '37.4902', (175.7677, 142.3195), (175.7677, 165.3738), (144.7677, 153.8466)),\n ('diameter', '%%c25', (107.733, 86.033), 7.0723, 45)\n]\n\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; _ds.dxf.dimasz = 2.5\n _ds.dxf.dimexe = 1.25; _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\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\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,\n angle=(0 if d[0] == \"horizontal\" else 90),\n 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,\n 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,\n 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,\n text=text, dimstyle=\"EZDXF\").render()\n\n doc.saveas(out_path)\n\n\nif __name__ == \"__main__\":\n out = sys.argv[1] if len(sys.argv) > 1 else \"0082_00826558_gt.dxf\"\n draw(out)\n print(\"wrote\", out)\n```"}], "images": ["images/0082_00826558.png"], "id": "0082_00826558"} {"messages": [{"role": "user", "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 48.63 mm, featuring a circular hole of diameter 24.32 mm. It is extruded to a thickness of 34.22 mm. A cut feature: The part is a circular plate with diameter 100 mm. It is extruded to a thickness of -68.45 mm."}, {"role": "assistant", "content": "```python\n#!/usr/bin/env python3\n# -*- coding: utf-8 -*-\n# Ground-truth 2D engineering drawing for part: 0086_00862775\n# Self-contained: reproduces the three-view DXF via ezdxf, NO FreeCAD needed.\n# Coordinates are A4 page millimetres (scale=1.5326888248579138, page=[297.0, 210.0]).\n# visible edges -> solid (layer OUTLINE); hidden edges -> dashed (layer HIDDEN)\n# dimensions -> real movable DIMENSION entities (text = true mm value)\n# Run: python 0086_00862775_gt.py [out.dxf]\nimport sys\nimport ezdxf\nimport math\n\nSCALE = 1.5326888248579138\nPAGE = [297.0, 210.0]\n\nVISIBLE_SEGMENTS = [\n (141.158629, 153.420287, 141.158629, 131.877552),\n (141.158629, 153.420287, 66.62057, 153.420287),\n (66.62057, 131.858345, 66.62057, 153.420287),\n (229.696687, 141.540782, 227.504954, 140.496282),\n (227.504954, 140.496282, 225.293333, 139.494566),\n (225.293333, 139.494566, 223.061928, 138.537741),\n (223.061928, 138.537741, 220.810459, 137.62915),\n (220.810459, 137.62915, 218.538767, 136.772392),\n (218.538767, 136.772392, 216.246874, 135.971261),\n (216.246874, 135.971261, 213.93503, 135.229692),\n (213.93503, 135.229692, 211.603756, 134.551706),\n (211.603756, 134.551706, 209.25388, 133.941341),\n (209.25388, 133.941341, 206.886575, 133.402559),\n (206.886575, 133.402559, 204.503377, 132.939151),\n (204.503377, 132.939151, 202.106197, 132.554616),\n (202.106197, 132.554616, 199.697306, 132.252042),\n (199.697306, 132.252042, 197.279305, 132.033983),\n (197.279305, 132.033983, 194.855066, 131.902355),\n (194.855066, 131.902355, 192.427658, 131.858345),\n (192.427658, 131.858345, 190.000249, 131.902355),\n (190.000249, 131.902355, 187.576011, 132.033983),\n (187.576011, 132.033983, 185.15801, 132.252042),\n (185.15801, 132.252042, 182.749119, 132.554616),\n (182.749119, 132.554616, 180.351939, 132.939151),\n (180.351939, 132.939151, 177.968741, 133.402559),\n (177.968741, 133.402559, 175.601436, 133.941341),\n (175.601436, 133.941341, 173.25156, 134.551706),\n (173.25156, 134.551706, 170.920286, 135.229692),\n (170.920286, 135.229692, 168.608442, 135.971261),\n (168.608442, 135.971261, 166.316549, 136.772392),\n (166.316549, 136.772392, 164.044857, 137.62915),\n (164.044857, 137.62915, 161.793388, 138.537741),\n (161.793388, 138.537741, 159.561983, 139.494566),\n (159.561983, 139.494566, 157.350361, 140.496282),\n (157.350361, 140.496282, 155.158629, 141.540782),\n (229.696687, 153.420287, 155.158629, 153.420287),\n (229.696687, 141.540782, 229.696687, 153.420287),\n (155.158629, 141.540782, 155.158629, 153.420287)\n]\nVISIBLE_CIRCLES = [\n (103.889599, 80.589316, 37.269029),\n (103.889599, 80.589316, 18.634515),\n (103.906854, 64.906343, 76.634441)\n]\nVISIBLE_ARCS = [\n\n]\nHIDDEN_SEGMENTS = [\n (83.3917, 138.7438, 87.3031, 139.7205),\n (120.1703, 139.7952, 115.2719, 140.6934),\n (92.1381, 140.6317, 87.5923, 139.7841),\n (96.8542, 141.2156, 110.9408, 141.2173),\n (122.5241, 153.4203, 122.5241, 139.245),\n (92.2657, 140.6515, 96.5955, 141.1912),\n (96.5955, 141.1912, 99.9428, 141.4382),\n (102.6273, 141.5301, 99.9428, 141.4382),\n (120.1869, 139.7916, 120.4111, 139.7425),\n (120.4111, 139.7425, 122.5241, 139.245),\n (115.8372, 140.6064, 120.1869, 139.7916),\n (85.2551, 139.2363, 85.2551, 153.4203),\n (192.4277, 131.8776, 229.6967, 141.5408),\n (155.1586, 141.5408, 192.4277, 131.8776),\n (192.4277, 139.245, 211.0622, 141.5408),\n (173.7932, 141.5408, 192.4277, 139.245),\n (211.0622, 141.5408, 211.0622, 153.4203),\n (173.7931, 141.5408, 173.7931, 153.4203)\n]\n# (orient, text, p1, p2, base) for linear; (orient, text, center, radius, angle) for diameter\nDIMENSIONS = [\n ('diameter', '%%c100', (103.9069, 64.9063), 76.6344, 45),\n ('vertical', '6.3048', (192.4277, 153.4203), (192.4277, 100.9675), (203.4277, 127.1939)),\n ('horizontal', '24.3161', (150.6294, 64.9063), (255.5348, 64.9063), (203.0821, 85.9063)),\n ('diameter', '%%c48.6322', (103.8896, 80.5893), 37.269, 45),\n ('diameter', '%%c24.3161', (103.8896, 80.5893), 18.6345, 135)\n]\n\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; _ds.dxf.dimasz = 2.5\n _ds.dxf.dimexe = 1.25; _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\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\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,\n angle=(0 if d[0] == \"horizontal\" else 90),\n 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,\n 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,\n 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,\n text=text, dimstyle=\"EZDXF\").render()\n\n doc.saveas(out_path)\n\n\nif __name__ == \"__main__\":\n out = sys.argv[1] if len(sys.argv) > 1 else \"0086_00862775_gt.dxf\"\n draw(out)\n print(\"wrote\", out)\n```"}], "images": ["images/0086_00862775.png"], "id": "0086_00862775"} {"messages": [{"role": "user", "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 78.65 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 25.77 mm. A cut feature: The part is a circular plate with diameter 52.08 mm. It is extruded to a thickness of 54.63 mm."}, {"role": "assistant", "content": "```python\n#!/usr/bin/env python3\n# -*- coding: utf-8 -*-\n# Ground-truth 2D engineering drawing for part: 0092_00926855\n# Self-contained: reproduces the three-view DXF via ezdxf, NO FreeCAD needed.\n# Coordinates are A4 page millimetres (scale=0.6428989547038313, page=[297.0, 210.0]).\n# visible edges -> solid (layer OUTLINE); hidden edges -> dashed (layer HIDDEN)\n# dimensions -> real movable DIMENSION entities (text = true mm value)\n# Run: python 0092_00926855_gt.py [out.dxf]\nimport sys\nimport ezdxf\nimport math\n\nSCALE = 0.6428989547038313\nPAGE = [297.0, 210.0]\n\nVISIBLE_SEGMENTS = [\n (140.55823, 109.832578, 76.268334, 109.832578),\n (140.55823, 109.832578, 140.55823, 93.264816),\n (140.55823, 93.264816, 76.268334, 93.264816),\n (133.788119, 78.022474, 83.226795, 78.022474),\n (133.788119, 93.264816, 133.788119, 78.022474),\n (76.268334, 93.264816, 76.268334, 109.832578),\n (83.226795, 78.022474, 83.226795, 93.264816),\n (154.55823, 188.122474, 154.55823, 123.832578),\n (171.125993, 188.122474, 171.125993, 123.832578),\n (186.368335, 181.258188, 186.368335, 130.696864),\n (171.125993, 188.122474, 154.55823, 188.122474),\n (171.125993, 123.832578, 154.55823, 123.832578),\n (186.368335, 181.258188, 171.125993, 181.258188),\n (186.368335, 130.696864, 171.125993, 130.696864)\n]\nVISIBLE_CIRCLES = [\n (108.413282, 155.977526, 32.144948),\n (108.252836, 155.977526, 16.74216),\n (108.507457, 155.977526, 25.280662)\n]\nVISIBLE_ARCS = [\n\n]\nHIDDEN_SEGMENTS = [\n (124.995, 109.8326, 124.995, 78.0225),\n (91.5107, 78.0225, 91.5107, 109.8326),\n (186.3683, 172.7197, 154.5582, 172.7197),\n (186.3683, 139.2354, 154.5582, 139.2354)\n]\n# (orient, text, p1, p2, base) for linear; (orient, text, center, radius, angle) for diameter\nDIMENSIONS = [\n ('diameter', '%%c78.6458', (108.5074, 155.9775), 25.2807, 45),\n ('diameter', '%%c100', (108.4133, 155.9775), 32.1449, 135),\n ('diameter', '%%c52.0833', (108.2529, 155.9775), 16.7421, 225),\n ('horizontal', '25.7704', (154.5582, 155.9775), (186.3684, 155.9775), (170.4633, 166.9775)),\n ('horizontal', '49.4792', (154.5582, 155.9775), (171.126, 155.9775), (162.8421, 176.9775)),\n ('horizontal', '49.4792', (154.5582, 155.9775), (189.6819, 155.9775), (172.12, 186.9775))\n]\n\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; _ds.dxf.dimasz = 2.5\n _ds.dxf.dimexe = 1.25; _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\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\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,\n angle=(0 if d[0] == \"horizontal\" else 90),\n 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,\n 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,\n 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,\n text=text, dimstyle=\"EZDXF\").render()\n\n doc.saveas(out_path)\n\n\nif __name__ == \"__main__\":\n out = sys.argv[1] if len(sys.argv) > 1 else \"0092_00926855_gt.dxf\"\n draw(out)\n print(\"wrote\", out)\n```"}], "images": ["images/0092_00926855.png"], "id": "0092_00926855"} {"messages": [{"role": "user", "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 41.67 mm. It is extruded to a thickness of 31.96 mm. A cut feature: The part is a circular plate with diameter 92.31 mm, featuring a circular hole of diameter 47.14 mm. It is extruded to a thickness of -1.55 mm. A cut feature: The part is a circular plate with diameter 92.31 mm, featuring a circular hole of diameter 47.14 mm. It is extruded to a thickness of -1.55 mm."}, {"role": "assistant", "content": "```python\n#!/usr/bin/env python3\n# -*- coding: utf-8 -*-\n# Ground-truth 2D engineering drawing for part: 0093_00938308\n# Self-contained: reproduces the three-view DXF via ezdxf, NO FreeCAD needed.\n# Coordinates are A4 page millimetres (scale=0.7282769509086914, page=[297.0, 210.0]).\n# visible edges -> solid (layer OUTLINE); hidden edges -> dashed (layer HIDDEN)\n# dimensions -> real movable DIMENSION entities (text = true mm value)\n# Run: python 0093_00938308_gt.py [out.dxf]\nimport sys\nimport ezdxf\nimport math\n\nSCALE = 0.7282769509086914\nPAGE = [297.0, 210.0]\n\nVISIBLE_SEGMENTS = [\n (87.88696, 80.156924, 160.714655, 80.156924),\n (160.714655, 80.156924, 160.714655, 103.429229),\n (87.88696, 103.429229, 160.714655, 103.429229),\n (87.88696, 103.429229, 87.88696, 80.156924),\n (197.98696, 117.429229, 197.98696, 190.256924),\n (174.714656, 117.429229, 174.714656, 190.256924),\n (174.714656, 117.429229, 197.98696, 117.429229),\n (174.714656, 190.256924, 197.98696, 190.256924)\n]\nVISIBLE_CIRCLES = [\n (124.300808, 153.843076, 36.413848),\n (123.751597, 153.843076, 33.612478),\n (123.751597, 153.843076, 17.163819),\n (124.300808, 153.843076, 15.172436)\n]\nVISIBLE_ARCS = [\n\n]\nHIDDEN_SEGMENTS = [\n (90.1391, 80.1569, 90.1391, 81.283),\n (90.1391, 81.283, 157.3641, 81.283),\n (157.7039, 103.4292, 157.7039, 102.3031),\n (157.7039, 102.3031, 90.4789, 102.3031),\n (106.5878, 80.1569, 106.5878, 81.283),\n (141.2552, 103.4292, 141.2552, 102.3031),\n (139.4732, 80.1569, 139.4732, 103.4292),\n (157.3641, 81.283, 157.3641, 80.1569),\n (90.4789, 102.3031, 90.4789, 103.4292),\n (140.9154, 81.283, 140.9154, 80.1569),\n (106.9276, 102.3031, 106.9276, 103.4292),\n (109.1284, 103.4292, 109.1284, 80.1569),\n (196.8609, 120.2306, 196.8609, 187.4556),\n (175.8407, 120.2306, 175.8407, 187.4556),\n (196.8609, 120.2306, 197.987, 120.2306),\n (196.8609, 187.4556, 197.987, 187.4556),\n (175.8407, 187.4556, 174.7147, 187.4556),\n (175.8407, 120.2306, 174.7147, 120.2306),\n (196.8609, 136.6793, 197.987, 136.6793),\n (196.8609, 171.0069, 197.987, 171.0069),\n (175.8407, 171.0069, 174.7147, 171.0069),\n (175.8407, 136.6793, 174.7147, 136.6793),\n (174.7147, 138.6706, 197.987, 138.6706),\n (174.7147, 169.0155, 197.987, 169.0155)\n]\n# (orient, text, p1, p2, base) for linear; (orient, text, center, radius, angle) for diameter\nDIMENSIONS = [\n ('diameter', '%%c100', (124.3008, 153.8431), 36.4138, 45),\n ('diameter', '%%c41.6667', (124.3008, 153.8431), 15.1724, 135),\n ('diameter', '%%c92.3069', (124.0914, 153.8431), 33.6125, 225),\n ('diameter', '%%c47.1354', (124.0914, 153.8431), 17.1638, 315),\n ('diameter', '%%c92.3069', (123.7516, 153.8431), 33.6125, 90),\n ('diameter', '%%c47.1354', (123.7516, 153.8431), 17.1638, 0)\n]\n\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; _ds.dxf.dimasz = 2.5\n _ds.dxf.dimexe = 1.25; _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\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\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,\n angle=(0 if d[0] == \"horizontal\" else 90),\n 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,\n 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,\n 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,\n text=text, dimstyle=\"EZDXF\").render()\n\n doc.saveas(out_path)\n\n\nif __name__ == \"__main__\":\n out = sys.argv[1] if len(sys.argv) > 1 else \"0093_00938308_gt.dxf\"\n draw(out)\n print(\"wrote\", out)\n```"}], "images": ["images/0093_00938308.png"], "id": "0093_00938308"} {"messages": [{"role": "user", "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 27.66 mm. It is extruded to a thickness of 25.27 mm. A cut feature: The part is a circular plate with diameter 100 mm, featuring a circular hole of diameter 27.66 mm. It is extruded to a thickness of -63.16 mm."}, {"role": "assistant", "content": "```python\n#!/usr/bin/env python3\n# -*- coding: utf-8 -*-\n# Ground-truth 2D engineering drawing for part: 0099_00999127\n# Self-contained: reproduces the three-view DXF via ezdxf, NO FreeCAD needed.\n# Coordinates are A4 page millimetres (scale=0.7347, page=[297.0, 210.0]).\n# visible edges -> solid (layer OUTLINE); hidden edges -> dashed (layer HIDDEN)\n# dimensions -> real movable DIMENSION entities (text = true mm value)\n# Run: python 0099_00999127_gt.py [out.dxf]\nimport sys\nimport ezdxf\nimport math\n\nSCALE = 0.7347\nPAGE = [297.0, 210.0]\n\nVISIBLE_SEGMENTS = [\n (78.759614, 82.35105, 152.229614, 82.35105),\n (152.229614, 82.35105, 152.229614, 100.913949),\n (78.759614, 100.913949, 152.229614, 100.913949),\n (78.759614, 100.913949, 78.759614, 82.35105),\n (184.792513, 114.91395, 184.792513, 188.38395),\n (166.229614, 114.91395, 166.229614, 188.38395),\n (166.229614, 114.91395, 184.792513, 114.91395),\n (166.229614, 188.38395, 184.792513, 188.38395)\n]\nVISIBLE_CIRCLES = [\n (115.494614, 151.64895, 36.735),\n (115.494614, 151.64895, 10.160745)\n]\nVISIBLE_ARCS = [\n\n]\nHIDDEN_SEGMENTS = [\n (125.6554, 82.3511, 125.6554, 100.9139),\n (105.3339, 100.9139, 105.3339, 82.3511),\n (166.2296, 141.4882, 184.7925, 141.4882),\n (166.2296, 161.8097, 184.7925, 161.8097)\n]\n# (orient, text, p1, p2, base) for linear; (orient, text, center, radius, angle) for diameter\nDIMENSIONS = [\n ('diameter', '%%c100', (115.4946, 151.6489), 36.735, 45),\n ('diameter', '%%c27.6596', (115.4946, 151.6489), 10.1608, 135),\n ('diameter', '%%c100', (115.4946, 151.6489), 36.735, 225),\n ('diameter', '%%c27.6596', (115.4946, 151.6489), 10.1608, 315),\n ('horizontal', '25.266', (184.7925, 151.6489), (166.2296, 151.6489), (175.511, 140.6489))\n]\n\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; _ds.dxf.dimasz = 2.5\n _ds.dxf.dimexe = 1.25; _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\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\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,\n angle=(0 if d[0] == \"horizontal\" else 90),\n 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,\n 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,\n 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,\n text=text, dimstyle=\"EZDXF\").render()\n\n doc.saveas(out_path)\n\n\nif __name__ == \"__main__\":\n out = sys.argv[1] if len(sys.argv) > 1 else \"0099_00999127_gt.dxf\"\n draw(out)\n print(\"wrote\", out)\n```"}], "images": ["images/0099_00999127.png"], "id": "0099_00999127"} {"messages": [{"role": "user", "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 12 edges within a 100 x 45.68 mm bounding box. It is extruded to a thickness of 11.47 mm. A cut feature: The part is a circular plate with diameter 4.51 mm. It is extruded to a thickness of -28.68 mm. A cut feature: The part is a circular plate with diameter 4.51 mm. It is extruded to a thickness of -28.68 mm."}, {"role": "assistant", "content": "```python\n#!/usr/bin/env python3\n# -*- coding: utf-8 -*-\n# Ground-truth 2D engineering drawing for part: 0007_00075391\n# Self-contained: reproduces the three-view DXF via ezdxf, NO FreeCAD needed.\n# Coordinates are A4 page millimetres (scale=0.5766000000000333, page=[297.0, 210.0]).\n# visible edges -> solid (layer OUTLINE); hidden edges -> dashed (layer HIDDEN)\n# dimensions -> real movable DIMENSION entities (text = true mm value)\n# Run: python 0007_00075391_gt.py [out.dxf]\nimport sys\nimport ezdxf\nimport math\n\nSCALE = 0.5766000000000333\nPAGE = [297.0, 210.0]\n\nVISIBLE_SEGMENTS = [\n (107.209607, 113.070764, 107.209607, 139.409283),\n (99.379237, 113.070764, 107.209607, 113.070764),\n (107.209607, 139.409283, 159.174793, 139.409283),\n (159.174793, 139.409283, 159.174793, 113.070764),\n (159.174793, 113.070764, 167.005163, 113.070764),\n (167.005163, 113.070764, 167.005163, 115.918172),\n (167.005163, 115.918172, 162.0222, 115.918172),\n (162.0222, 115.918172, 162.0222, 141.544838),\n (162.0222, 141.544838, 104.3622, 141.544838),\n (104.3622, 141.544838, 104.3622, 115.918172),\n (104.3622, 115.918172, 99.379237, 115.918172),\n (99.379237, 115.918172, 99.379237, 113.070764),\n (167.005163, 99.070764, 162.0222, 99.070764),\n (162.0222, 99.070764, 104.3622, 99.070764),\n (104.3622, 99.070764, 99.379237, 99.070764),\n (167.005163, 92.455185, 162.0222, 92.455185),\n (162.0222, 92.455185, 104.3622, 92.455185),\n (104.3622, 92.455185, 99.379237, 92.455185),\n (99.379237, 99.070764, 99.379237, 92.455185),\n (167.005163, 99.070764, 167.005163, 92.455185),\n (162.0222, 99.070764, 162.0222, 92.455185),\n (104.3622, 99.070764, 104.3622, 92.455185),\n (181.005163, 113.070764, 187.620743, 113.070764),\n (181.005163, 141.544838, 181.005163, 115.918172),\n (181.005163, 115.918172, 181.005163, 113.070764),\n (187.620743, 141.544838, 187.620743, 115.918172),\n (187.620743, 115.918172, 187.620743, 113.070764),\n (181.005163, 115.918172, 187.620743, 115.918172),\n (181.005163, 141.544838, 187.620743, 141.544838)\n]\nVISIBLE_CIRCLES = [\n (101.951962, 95.9332, 1.299903),\n (164.432438, 95.9332, 1.299903)\n]\nVISIBLE_ARCS = [\n\n]\nHIDDEN_SEGMENTS = [\n (103.2519, 113.0708, 103.2519, 115.9182),\n (100.6521, 113.0708, 100.6521, 115.9182),\n (165.7324, 113.0708, 165.7324, 115.9182),\n (163.1325, 113.0708, 163.1325, 115.9182),\n (107.2096, 99.0708, 107.2096, 92.4552),\n (159.1748, 99.0708, 159.1748, 92.4552),\n (181.0052, 139.4093, 187.6208, 139.4093),\n (185.4426, 115.9182, 185.4426, 113.0708),\n (182.8428, 113.0708, 182.8428, 115.9182)\n]\n# (orient, text, p1, p2, base) for linear; (orient, text, center, radius, angle) for diameter\nDIMENSIONS = [\n ('horizontal', '8.642', (167.0052, 115.9181), (162.0222, 115.9181), (164.5137, 104.9181)),\n ('horizontal', '13.5802', (159.1748, 113.0708), (167.0052, 113.0708), (163.09, 124.0708)),\n ('horizontal', '90.1235', (107.2096, 139.4093), (159.1748, 139.4093), (133.1922, 150.4093)),\n ('horizontal', '100', (162.0222, 141.5448), (104.3622, 141.5448), (133.1922, 130.5448)),\n ('vertical', '4.9383', (167.0052, 113.0708), (167.0052, 115.9181), (156.0052, 114.4945)),\n ('vertical', '44.4444', (162.0222, 115.9181), (162.0222, 141.5448), (151.0222, 128.7315)),\n ('vertical', '45.679', (107.2096, 113.0708), (107.2096, 139.4093), (96.2096, 126.24)),\n ('horizontal', '11.4734', (181.0052, 113.0708), (187.6207, 113.0708), (184.313, 124.0708)),\n ('vertical', '4.9383', (184.1427, 116.011), (184.1427, 99.4721), (195.1427, 107.7415)),\n ('diameter', '%%c4.5089', (164.4324, 95.9332), 1.2999, 45),\n ('vertical', '11.4734', (164.4324, 99.0708), (164.4324, 99.0708), (164.4324, 99.0708)),\n ('diameter', '%%c4.5089', (101.952, 95.9332), 1.2999, 45),\n ('horizontal', '112.822', (99.3793, 99.0708), (101.952, 99.0708), (100.6656, 110.0708))\n]\n\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; _ds.dxf.dimasz = 2.5\n _ds.dxf.dimexe = 1.25; _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\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\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,\n angle=(0 if d[0] == \"horizontal\" else 90),\n 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,\n 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,\n 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,\n text=text, dimstyle=\"EZDXF\").render()\n\n doc.saveas(out_path)\n\n\nif __name__ == \"__main__\":\n out = sys.argv[1] if len(sys.argv) > 1 else \"0007_00075391_gt.dxf\"\n draw(out)\n print(\"wrote\", out)\n```"}], "images": ["images/0007_00075391.png"], "id": "0007_00075391"} {"messages": [{"role": "user", "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 union feature: The part is a circular plate with diameter 38.33 mm. It is extruded to a thickness of 10.34 mm."}, {"role": "assistant", "content": "```python\n#!/usr/bin/env python3\n# -*- coding: utf-8 -*-\n# Ground-truth 2D engineering drawing for part: 0007_00075529\n# Self-contained: reproduces the three-view DXF via ezdxf, NO FreeCAD needed.\n# Coordinates are A4 page millimetres (scale=0.4568688524590314, page=[297.0, 210.0]).\n# visible edges -> solid (layer OUTLINE); hidden edges -> dashed (layer HIDDEN)\n# dimensions -> real movable DIMENSION entities (text = true mm value)\n# Run: python 0007_00075529_gt.py [out.dxf]\nimport sys\nimport ezdxf\nimport math\n\nSCALE = 0.4568688524590314\nPAGE = [297.0, 210.0]\n\nVISIBLE_SEGMENTS = [\n (134.136835, 126.363089, 134.136835, 172.049974),\n (88.449949, 126.363089, 134.136835, 126.363089),\n (134.136835, 172.049974, 88.449949, 172.049974),\n (88.449949, 172.049974, 88.449949, 126.363089),\n (134.136835, 112.363089, 134.136835, 66.676204),\n (134.136835, 66.676204, 88.449949, 66.676204),\n (88.449949, 112.363089, 88.449949, 66.676204),\n (134.136835, 112.363089, 88.449949, 112.363089),\n (120.140562, 66.676204, 120.140562, 61.949974),\n (120.140562, 61.949974, 119.593314, 61.949974),\n (119.593314, 61.949974, 119.046067, 61.949974),\n (119.046067, 61.949974, 118.498819, 61.949974),\n (118.498819, 61.949974, 117.951572, 61.949974),\n (117.951572, 61.949974, 117.404324, 61.949974),\n (117.404324, 61.949974, 116.857076, 61.949974),\n (116.857076, 61.949974, 116.309829, 61.949974),\n (116.309829, 61.949974, 115.762581, 61.949974),\n (115.762581, 61.949974, 115.215333, 61.949974),\n (115.215333, 61.949974, 114.668086, 61.949974),\n (114.668086, 61.949974, 114.120838, 61.949974),\n (114.120838, 61.949974, 113.573591, 61.949974),\n (113.573591, 61.949974, 113.026343, 61.949974),\n (113.026343, 61.949974, 112.479095, 61.949974),\n (112.479095, 61.949974, 111.931848, 61.949974),\n (111.931848, 61.949974, 111.3846, 61.949974),\n (111.3846, 61.949974, 110.837352, 61.949974),\n (110.837352, 61.949974, 110.290105, 61.949974),\n (110.290105, 61.949974, 109.742857, 61.949974),\n (109.742857, 61.949974, 109.195609, 61.949974),\n (109.195609, 61.949974, 108.648362, 61.949974),\n (108.648362, 61.949974, 108.101114, 61.949974),\n (108.101114, 61.949974, 107.553867, 61.949974),\n (107.553867, 61.949974, 107.006619, 61.949974),\n (107.006619, 61.949974, 106.459371, 61.949974),\n (106.459371, 61.949974, 105.912124, 61.949974),\n (105.912124, 61.949974, 105.364876, 61.949974),\n (105.364876, 61.949974, 104.817628, 61.949974),\n (104.817628, 61.949974, 104.270381, 61.949974),\n (104.270381, 61.949974, 103.723133, 61.949974),\n (103.723133, 61.949974, 103.175886, 61.949974),\n (103.175886, 61.949974, 102.628638, 61.949974),\n (102.628638, 61.949974, 102.628638, 66.676204),\n (148.136835, 126.363089, 193.82372, 126.363089),\n (148.136835, 172.049974, 193.82372, 172.049974),\n (148.136835, 172.049974, 148.136835, 126.363089),\n (193.82372, 172.049974, 193.82372, 126.363089),\n (198.549949, 158.225062, 198.549949, 157.677814),\n (198.549949, 157.677814, 198.549949, 157.130567),\n (198.549949, 157.130567, 198.549949, 156.583319),\n (198.549949, 156.583319, 198.549949, 156.036072),\n (198.549949, 156.036072, 198.549949, 155.488824),\n (198.549949, 155.488824, 198.549949, 154.941576),\n (198.549949, 154.941576, 198.549949, 154.394329),\n (198.549949, 154.394329, 198.549949, 153.847081),\n (198.549949, 153.847081, 198.549949, 153.299833),\n (198.549949, 153.299833, 198.549949, 152.752586),\n (198.549949, 152.752586, 198.549949, 152.205338),\n (198.549949, 152.205338, 198.549949, 151.658091),\n (198.549949, 151.658091, 198.549949, 151.110843),\n (198.549949, 151.110843, 198.549949, 150.563595),\n (198.549949, 150.563595, 198.549949, 150.016348),\n (198.549949, 150.016348, 198.549949, 149.4691),\n (198.549949, 149.4691, 198.549949, 148.921852),\n (198.549949, 148.921852, 198.549949, 148.374605),\n (198.549949, 148.374605, 198.549949, 147.827357),\n (198.549949, 147.827357, 198.549949, 147.280109),\n (198.549949, 147.280109, 198.549949, 146.732862),\n (198.549949, 146.732862, 198.549949, 146.185614),\n (198.549949, 146.185614, 198.549949, 145.638367),\n (198.549949, 145.638367, 198.549949, 145.091119),\n (198.549949, 145.091119, 198.549949, 144.543871),\n (198.549949, 144.543871, 198.549949, 143.996624),\n (198.549949, 143.996624, 198.549949, 143.449376),\n (198.549949, 143.449376, 198.549949, 142.902128),\n (198.549949, 142.902128, 198.549949, 142.354881),\n (198.549949, 142.354881, 198.549949, 141.807633),\n (198.549949, 141.807633, 198.549949, 141.260386),\n (198.549949, 141.260386, 198.549949, 140.713138),\n (198.549949, 158.225062, 193.82372, 158.225062),\n (198.549949, 140.713138, 193.82372, 140.713138)\n]\nVISIBLE_CIRCLES = [\n (111.3846, 149.4691, 8.755962)\n]\nVISIBLE_ARCS = [\n\n]\nHIDDEN_SEGMENTS = [\n\n]\n# (orient, text, p1, p2, base) for linear; (orient, text, center, radius, angle) for diameter\nDIMENSIONS = [\n ('horizontal', '100', (134.1369, 172.05), (88.45, 172.05), (111.2934, 161.05)),\n ('vertical', '100', (134.1369, 126.3631), (134.1369, 172.05), (123.1369, 149.2066)),\n ('diameter', '%%c38.3303', (111.3846, 149.4691), 8.756, 45),\n ('horizontal', '100', (148.1369, 126.3631), (193.8238, 126.3631), (170.9803, 137.3631)),\n ('horizontal', '10.3448', (193.8238, 149.4691), (198.55, 149.4691), (196.1869, 160.4691))\n]\n\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; _ds.dxf.dimasz = 2.5\n _ds.dxf.dimexe = 1.25; _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\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\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,\n angle=(0 if d[0] == \"horizontal\" else 90),\n 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,\n 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,\n 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,\n text=text, dimstyle=\"EZDXF\").render()\n\n doc.saveas(out_path)\n\n\nif __name__ == \"__main__\":\n out = sys.argv[1] if len(sys.argv) > 1 else \"0007_00075529_gt.dxf\"\n draw(out)\n print(\"wrote\", out)\n```"}], "images": ["images/0007_00075529.png"], "id": "0007_00075529"} {"messages": [{"role": "user", "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 12.69 mm. The outline includes one or more oblique (angled) edges. A cut feature: The part is a circular plate with diameter 10.04 mm. It is extruded to a thickness of -50.75 mm."}, {"role": "assistant", "content": "```python\n#!/usr/bin/env python3\n# -*- coding: utf-8 -*-\n# Ground-truth 2D engineering drawing for part: 0008_00086807\n# Self-contained: reproduces the three-view DXF via ezdxf, NO FreeCAD needed.\n# Coordinates are A4 page millimetres (scale=0.363455191037987, page=[297.0, 210.0]).\n# visible edges -> solid (layer OUTLINE); hidden edges -> dashed (layer HIDDEN)\n# dimensions -> real movable DIMENSION entities (text = true mm value)\n# Run: python 0008_00086807_gt.py [out.dxf]\nimport sys\nimport ezdxf\nimport math\n\nSCALE = 0.363455191037987\nPAGE = [297.0, 210.0]\n\nVISIBLE_SEGMENTS = [\n (119.244019, 131.858605, 107.283786, 159.196279),\n (93.614949, 117.335466, 119.244019, 131.858605),\n (107.283786, 159.196279, 135.475763, 141.255931),\n (135.475763, 141.255931, 167.084949, 159.196279),\n (167.084949, 159.196279, 154.270414, 130.15),\n (154.270414, 130.15, 174.77367, 117.335466),\n (174.77367, 117.335466, 148.290298, 117.335466),\n (148.290298, 117.335466, 137.184368, 93.415),\n (137.184368, 93.415, 126.078437, 117.335466),\n (126.078437, 117.335466, 93.614949, 117.335466),\n (107.283786, 74.803709, 107.283786, 79.415),\n (93.614949, 74.803709, 93.614949, 79.415),\n (93.614949, 79.415, 107.283786, 79.415),\n (93.614949, 74.803709, 107.283786, 74.803709),\n (107.283786, 79.415, 135.475763, 79.415),\n (135.475763, 74.803709, 135.475763, 79.415),\n (107.283786, 74.803709, 135.475763, 74.803709),\n (135.475763, 74.803709, 167.084949, 74.803709),\n (167.084949, 74.803709, 174.77367, 74.803709),\n (135.475763, 79.415, 167.084949, 79.415),\n (167.084949, 79.415, 174.77367, 79.415),\n (167.084949, 74.803709, 167.084949, 79.415),\n (174.77367, 74.803709, 174.77367, 79.415),\n (193.384961, 131.858605, 188.77367, 131.858605),\n (188.77367, 131.858605, 188.77367, 159.196279),\n (193.384961, 159.196279, 188.77367, 159.196279),\n (193.384961, 131.858605, 193.384961, 159.196279),\n (193.384961, 117.335466, 188.77367, 117.335466),\n (188.77367, 117.335466, 188.77367, 131.858605),\n (193.384961, 117.335466, 193.384961, 131.858605),\n (193.384961, 93.415, 193.384961, 117.335466),\n (188.77367, 93.415, 188.77367, 117.335466),\n (193.384961, 93.415, 188.77367, 93.415)\n]\nVISIBLE_CIRCLES = [\n (136.9805, 109.9574, 1.8251)\n]\nVISIBLE_ARCS = [\n\n]\nHIDDEN_SEGMENTS = [\n (119.2441, 74.8037, 119.2441, 79.415),\n (126.0785, 74.8037, 126.0785, 79.415),\n (137.1844, 74.8037, 137.1844, 79.415),\n (154.2705, 74.8037, 154.2705, 79.415),\n (148.2903, 74.8037, 148.2903, 79.415),\n (138.8056, 79.415, 138.8056, 74.8037),\n (193.385, 141.2559, 188.7737, 141.2559),\n (193.385, 130.15, 188.7737, 130.15),\n (193.385, 111.7825, 188.7737, 111.7825),\n (193.385, 108.1323, 188.7737, 108.1323)\n]\n# (orient, text, p1, p2, base) for linear; (orient, text, center, radius, angle) for diameter\nDIMENSIONS = [\n ('horizontal', '72.8656', (174.7737, 117.3355), (148.2904, 117.3355), (161.532, 106.3355)),\n ('horizontal', '89.3191', (126.0785, 117.3355), (93.615, 117.3355), (109.8467, 106.3355)),\n ('aligned', '82.0995', (119.2441, 131.8586), (107.2838, 159.1963), (103.1862, 141.1184)),\n ('aligned', '91.9404', (107.2838, 159.1963), (135.4758, 141.256), (127.2854, 159.5064)),\n ('aligned', '100', (135.4758, 141.256), (167.085, 159.1963), (145.8507, 159.7927)),\n ('aligned', '87.3489', (167.085, 159.1963), (154.2705, 130.15), (170.7418, 140.2331)),\n ('aligned', '66.5238', (154.2705, 130.15), (174.7737, 117.3355), (170.3521, 133.0707)),\n ('aligned', '72.5617', (148.2904, 117.3355), (137.1844, 93.415), (152.7145, 100.743)),\n ('aligned', '72.5617', (137.1844, 93.415), (126.0785, 117.3355), (121.6543, 100.743)),\n ('aligned', '81.0497', (93.615, 117.3355), (119.2441, 131.8586), (101.0064, 134.1673)),\n ('diameter', '%%c10.0431', (136.9805, 109.9574), 1.8251, 45),\n ('horizontal', '119.315', (93.615, 159.1963), (136.9805, 159.1963), (115.2978, 170.1963)),\n ('vertical', '135.474', (136.9805, 159.1963), (136.9805, 109.9574), (147.9805, 134.5768)),\n ('horizontal', '12.6874', (193.385, 131.8586), (188.7737, 131.8586), (191.0794, 120.8586)),\n ('horizontal', '12.6874', (188.7737, 109.9574), (207.2189, 109.9574), (197.9963, 120.9574))\n]\n\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; _ds.dxf.dimasz = 2.5\n _ds.dxf.dimexe = 1.25; _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\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\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,\n angle=(0 if d[0] == \"horizontal\" else 90),\n 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,\n 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,\n 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,\n text=text, dimstyle=\"EZDXF\").render()\n\n doc.saveas(out_path)\n\n\nif __name__ == \"__main__\":\n out = sys.argv[1] if len(sys.argv) > 1 else \"0008_00086807_gt.dxf\"\n draw(out)\n print(\"wrote\", out)\n```"}], "images": ["images/0008_00086807.png"], "id": "0008_00086807"} {"messages": [{"role": "user", "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 30.95 mm. A cut feature: The part is a circular plate with diameter 33.68 mm. It is extruded to a thickness of -22.22 mm. A cut feature: The part is a circular plate with diameter 38.5 mm. It is extruded to a thickness of -22.22 mm."}, {"role": "assistant", "content": "```python\n#!/usr/bin/env python3\n# -*- coding: utf-8 -*-\n# Ground-truth 2D engineering drawing for part: 0010_00106611\n# Self-contained: reproduces the three-view DXF via ezdxf, NO FreeCAD needed.\n# Coordinates are A4 page millimetres (scale=0.9092696229547167, page=[297.0, 210.0]).\n# visible edges -> solid (layer OUTLINE); hidden edges -> dashed (layer HIDDEN)\n# dimensions -> real movable DIMENSION entities (text = true mm value)\n# Run: python 0010_00106611_gt.py [out.dxf]\nimport sys\nimport ezdxf\nimport math\n\nSCALE = 0.9092696229547167\nPAGE = [297.0, 210.0]\n\nVISIBLE_SEGMENTS = [\n (167.891437, 104.094, 167.891437, 172.04994),\n (76.964475, 104.094, 167.891437, 104.094),\n (167.891437, 172.04994, 76.964475, 172.04994),\n (76.964475, 172.04994, 76.964475, 104.094),\n (167.891437, 90.094, 167.891437, 61.94994),\n (167.891437, 61.94994, 76.964475, 61.94994),\n (76.964475, 90.094, 76.964475, 61.94994),\n (167.891437, 90.094, 76.964475, 90.094),\n (181.891437, 104.094, 210.035497, 104.094),\n (181.891437, 172.04994, 210.035497, 172.04994),\n (181.891437, 172.04994, 181.891437, 104.094),\n (210.035497, 172.04994, 210.035497, 104.094)\n]\nVISIBLE_CIRCLES = [\n (103.103128, 138.0112, 15.314015),\n (141.372972, 138.0112, 17.501731)\n]\nVISIBLE_ARCS = [\n\n]\nHIDDEN_SEGMENTS = [\n (118.4172, 61.95, 118.4172, 82.156),\n (118.4172, 82.156, 87.7891, 82.156),\n (158.8747, 61.95, 158.8747, 82.156),\n (158.8747, 82.156, 123.8713, 82.156),\n (87.7891, 82.156, 87.7891, 61.95),\n (123.8713, 82.156, 123.8713, 61.95),\n (189.8295, 155.513, 189.8295, 120.5095),\n (189.8295, 153.3253, 189.8295, 138.0113),\n (189.8295, 138.0113, 189.8295, 122.6972),\n (189.8295, 153.3253, 189.8295, 155.513),\n (189.8295, 122.6972, 210.0355, 122.6972),\n (189.8295, 153.3253, 210.0355, 153.3253),\n (189.8295, 120.5095, 210.0355, 120.5095),\n (189.8295, 155.513, 210.0355, 155.513)\n]\n# (orient, text, p1, p2, base) for linear; (orient, text, center, radius, angle) for diameter\nDIMENSIONS = [\n ('horizontal', '100', (167.8914, 172.05), (76.9645, 172.05), (122.4279, 161.05)),\n ('vertical', '74.7368', (167.8914, 104.0941), (167.8914, 172.05), (156.8914, 138.072)),\n ('diameter', '%%c33.6842', (103.1032, 138.0112), 15.314, 45),\n ('horizontal', '28.7469', (76.9645, 104.0941), (103.1032, 104.0941), (90.0338, 115.0941)),\n ('vertical', '37.3015', (103.1032, 104.0941), (103.1032, 138.0112), (92.1032, 121.0527)),\n ('diameter', '%%c38.4962', (141.3729, 138.0112), 17.5017, 45),\n ('horizontal', '70.8354', (76.9645, 104.0941), (141.3729, 104.0941), (109.1687, 115.0941)),\n ('vertical', '37.3015', (141.3729, 104.0941), (141.3729, 138.0112), (130.3729, 121.0527)),\n ('horizontal', '30.9524', (181.8915, 104.0941), (210.0355, 104.0941), (195.9635, 115.0941))\n]\n\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; _ds.dxf.dimasz = 2.5\n _ds.dxf.dimexe = 1.25; _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\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\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,\n angle=(0 if d[0] == \"horizontal\" else 90),\n 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,\n 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,\n 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,\n text=text, dimstyle=\"EZDXF\").render()\n\n doc.saveas(out_path)\n\n\nif __name__ == \"__main__\":\n out = sys.argv[1] if len(sys.argv) > 1 else \"0010_00106611_gt.dxf\"\n draw(out)\n print(\"wrote\", out)\n```"}], "images": ["images/0010_00106611.png"], "id": "0010_00106611"} {"messages": [{"role": "user", "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 40 mm tall. It is extruded to a thickness of 19.79 mm. A cut feature: The part is a circular plate with diameter 23.16 mm. It is extruded to a thickness of 19.79 mm."}, {"role": "assistant", "content": "```python\n#!/usr/bin/env python3\n# -*- coding: utf-8 -*-\n# Ground-truth 2D engineering drawing for part: 0013_00136690\n# Self-contained: reproduces the three-view DXF via ezdxf, NO FreeCAD needed.\n# Coordinates are A4 page millimetres (scale=1.0495714285714286, page=[297.0, 210.0]).\n# visible edges -> solid (layer OUTLINE); hidden edges -> dashed (layer HIDDEN)\n# dimensions -> real movable DIMENSION entities (text = true mm value)\n# Run: python 0013_00136690_gt.py [out.dxf]\nimport sys\nimport ezdxf\nimport math\n\nSCALE = 1.0495714285714286\nPAGE = [297.0, 210.0]\n\nVISIBLE_SEGMENTS = [\n (178.592161, 155.377871, 178.592161, 113.395014),\n (73.635018, 155.377871, 178.592161, 155.377871),\n (178.592161, 113.395014, 73.635018, 113.395014),\n (73.635018, 113.395014, 73.635018, 155.377871),\n (178.592161, 78.622246, 178.592161, 99.395014),\n (73.635018, 78.622246, 73.635018, 99.395014),\n (73.635018, 99.395014, 178.592161, 99.395014),\n (73.635018, 78.622246, 178.592161, 78.622246),\n (213.364928, 155.377871, 192.592161, 155.377871),\n (213.364928, 113.395014, 192.592161, 113.395014),\n (213.364928, 113.395014, 213.364928, 155.377871),\n (192.592161, 113.395014, 192.592161, 155.377871)\n]\nVISIBLE_CIRCLES = [\n (101.0942, 133.5118, 12.152932)\n]\nVISIBLE_ARCS = [\n\n]\nHIDDEN_SEGMENTS = [\n (113.2472, 78.6222, 113.2472, 99.395),\n (88.9413, 99.395, 88.9413, 78.6222),\n (192.5922, 121.3588, 213.365, 121.3588),\n (192.5922, 145.6647, 213.365, 145.6647)\n]\n# (orient, text, p1, p2, base) for linear; (orient, text, center, radius, angle) for diameter\nDIMENSIONS = [\n ('horizontal', '100', (178.5922, 113.395), (73.635, 113.395), (126.1136, 102.395)),\n ('vertical', '40', (178.5922, 155.3778), (178.5922, 113.395), (189.5922, 134.3864)),\n ('diameter', '%%c23.1579', (101.0942, 133.5118), 12.1529, 45),\n ('horizontal', '26.1623', (73.635, 155.3778), (101.0942, 155.3778), (87.3646, 166.3778)),\n ('vertical', '20.8333', (101.0942, 155.3778), (101.0942, 133.5118), (112.0942, 144.4448)),\n ('horizontal', '19.7917', (213.365, 155.3778), (192.5922, 155.3778), (202.9786, 144.3778)),\n ('horizontal', '19.7917', (213.365, 133.5118), (192.5922, 133.5118), (202.9786, 122.5118))\n]\n\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; _ds.dxf.dimasz = 2.5\n _ds.dxf.dimexe = 1.25; _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\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\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,\n angle=(0 if d[0] == \"horizontal\" else 90),\n 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,\n 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,\n 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,\n text=text, dimstyle=\"EZDXF\").render()\n\n doc.saveas(out_path)\n\n\nif __name__ == \"__main__\":\n out = sys.argv[1] if len(sys.argv) > 1 else \"0013_00136690_gt.dxf\"\n draw(out)\n print(\"wrote\", out)\n```"}], "images": ["images/0013_00136690.png"], "id": "0013_00136690"} {"messages": [{"role": "user", "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 an L-shaped (stepped) plate within a 40.4 x 100 mm bounding box. It is extruded to a thickness of 16.81 mm. A cut feature: The part is a rectangular plate 8.13 mm wide and 6.76 mm tall. It is extruded to a thickness of -69.39 mm. A cut feature: The part is a circular plate with diameter 3.83 mm. It is extruded to a thickness of -34.7 mm. A cut feature: The part is a circular plate with diameter 3.83 mm. It is extruded to a thickness of -34.7 mm."}, {"role": "assistant", "content": "```python\n#!/usr/bin/env python3\n# -*- coding: utf-8 -*-\n# Ground-truth 2D engineering drawing for part: 0015_00155383\n# Self-contained: reproduces the three-view DXF via ezdxf, NO FreeCAD needed.\n# Coordinates are A4 page millimetres (scale=0.6844532374101323, page=[297.0, 210.0]).\n# visible edges -> solid (layer OUTLINE); hidden edges -> dashed (layer HIDDEN)\n# dimensions -> real movable DIMENSION entities (text = true mm value)\n# Run: python 0015_00155383_gt.py [out.dxf]\nimport sys\nimport ezdxf\nimport math\n\nSCALE = 0.6844532374101323\nPAGE = [297.0, 210.0]\n\nVISIBLE_SEGMENTS = [\n (136.970628, 161.208883, 136.970628, 95.529027),\n (116.920988, 161.208883, 136.970628, 161.208883),\n (136.970628, 95.529027, 144.575664, 95.529027),\n (144.575664, 95.529027, 144.575664, 163.97435),\n (144.575664, 163.97435, 116.920988, 163.97435),\n (116.920988, 163.97435, 116.920988, 161.208883),\n (144.575664, 81.529027, 144.556134, 81.529027),\n (144.556134, 81.529027, 139.927491, 81.529027),\n (139.927491, 81.529027, 116.920988, 81.529027),\n (144.575664, 70.025775, 116.920988, 70.025775),\n (116.920988, 81.529027, 116.920988, 70.025775),\n (144.575664, 81.529027, 144.575664, 70.025775),\n (139.927491, 75.962937, 139.927491, 81.529027),\n (144.556134, 75.962937, 139.927491, 75.962937),\n (144.556134, 81.529027, 144.556134, 75.962937),\n (170.078916, 161.208883, 170.078916, 95.529027),\n (158.575664, 95.529027, 170.078916, 95.529027),\n (158.575664, 161.208883, 158.575664, 95.529027),\n (158.575664, 161.208883, 170.078916, 161.208883),\n (158.575664, 163.97435, 158.575664, 161.208883),\n (170.078916, 163.97435, 170.078916, 161.208883),\n (158.575664, 163.97435, 170.078916, 163.97435)\n]\nVISIBLE_CIRCLES = [\n (167.2822, 151.560994, 1.312425),\n (167.2822, 106.661206, 1.312425)\n]\nVISIBLE_ARCS = [\n\n]\nHIDDEN_SEGMENTS = [\n (144.5562, 116.6801, 139.9275, 116.6801),\n (139.9275, 163.9743, 139.9275, 116.6801),\n (136.9707, 150.2485, 144.3804, 150.2485),\n (136.9707, 152.8734, 144.3804, 152.8734),\n (136.9707, 105.3487, 144.3804, 105.3487),\n (136.9707, 107.9736, 144.3804, 107.9736),\n (136.9707, 81.529, 136.9707, 70.0257),\n (144.3804, 74.1349, 136.9707, 74.1349),\n (136.9707, 71.51, 144.3804, 71.51),\n (158.5757, 116.6801, 164.1418, 116.6801),\n (164.1418, 163.9743, 164.1418, 116.6801)\n]\n# (orient, text, p1, p2, base) for linear; (orient, text, center, radius, angle) for diameter\nDIMENSIONS = [\n ('horizontal', '11.1111', (136.9707, 95.5289), (144.5757, 95.5289), (140.7732, 106.5289)),\n ('horizontal', '29.2929', (116.921, 161.2088), (136.9707, 161.2088), (126.9458, 172.2088)),\n ('horizontal', '40.404', (144.5757, 163.9743), (116.921, 163.9743), (130.7484, 152.9743)),\n ('vertical', '4.0404', (116.921, 163.9743), (116.921, 161.2088), (127.921, 162.5915)),\n ('vertical', '95.9596', (136.9707, 161.2088), (136.9707, 95.5289), (147.9707, 128.3689)),\n ('vertical', '100', (144.5757, 95.5289), (144.5757, 163.9743), (133.5757, 129.7516)),\n ('horizontal', '16.8065', (158.5757, 161.2088), (170.079, 161.2088), (164.3273, 172.2088)),\n ('diameter', '%%c3.835', (167.2822, 151.561), 1.3124, 45),\n ('vertical', '100', (158.5757, 95.5289), (158.5757, 151.561), (147.5757, 123.5449)),\n ('diameter', '%%c3.835', (167.2822, 106.6612), 1.3124, 45),\n ('vertical', '81.8639', (158.5757, 95.5289), (158.5757, 106.6612), (147.5757, 101.0951)),\n ('vertical', '16.8065', (139.9276, 81.529), (139.9276, 75.9629), (150.9276, 78.7459))\n]\n\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; _ds.dxf.dimasz = 2.5\n _ds.dxf.dimexe = 1.25; _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\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\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,\n angle=(0 if d[0] == \"horizontal\" else 90),\n 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,\n 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,\n 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,\n text=text, dimstyle=\"EZDXF\").render()\n\n doc.saveas(out_path)\n\n\nif __name__ == \"__main__\":\n out = sys.argv[1] if len(sys.argv) > 1 else \"0015_00155383_gt.dxf\"\n draw(out)\n print(\"wrote\", out)\n```"}], "images": ["images/0015_00155383.png"], "id": "0015_00155383"} {"messages": [{"role": "user", "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 38.95 mm tall. It is extruded to a thickness of 8.24 mm. A union feature: The part is a circular plate with diameter 6.4 mm. It is extruded to a thickness of 8.24 mm. A union feature: The part is a circular plate with diameter 6.54 mm. It is extruded to a thickness of 8.24 mm. A union feature: The part is a circular plate with diameter 6.4 mm. It is extruded to a thickness of 8.24 mm."}, {"role": "assistant", "content": "```python\n#!/usr/bin/env python3\n# -*- coding: utf-8 -*-\n# Ground-truth 2D engineering drawing for part: 0017_00177319\n# Self-contained: reproduces the three-view DXF via ezdxf, NO FreeCAD needed.\n# Coordinates are A4 page millimetres (scale=1.2616060606061055, page=[297.0, 210.0]).\n# visible edges -> solid (layer OUTLINE); hidden edges -> dashed (layer HIDDEN)\n# dimensions -> real movable DIMENSION entities (text = true mm value)\n# Run: python 0017_00177319_gt.py [out.dxf]\nimport sys\nimport ezdxf\nimport math\n\nSCALE = 1.2616060606061055\nPAGE = [297.0, 210.0]\n\nVISIBLE_SEGMENTS = [\n (189.190608, 109.821573, 189.190608, 158.957809),\n (63.030002, 109.821573, 189.190608, 109.821573),\n (189.190608, 158.957809, 63.030002, 158.957809),\n (63.030002, 158.957809, 63.030002, 109.821573),\n (189.190608, 95.821573, 189.190608, 85.431876),\n (189.190608, 85.431876, 63.030002, 85.431876),\n (63.030002, 95.821573, 63.030002, 85.431876),\n (189.190608, 95.821573, 63.030002, 95.821573),\n (121.743507, 85.431876, 121.743507, 75.042179),\n (121.743507, 75.042179, 121.485718, 75.042179),\n (121.485718, 75.042179, 121.227928, 75.042179),\n (121.227928, 75.042179, 120.970139, 75.042179),\n (120.970139, 75.042179, 120.712349, 75.042179),\n (120.712349, 75.042179, 120.45456, 75.042179),\n (120.45456, 75.042179, 120.19677, 75.042179),\n (120.19677, 75.042179, 119.938981, 75.042179),\n (119.938981, 75.042179, 119.681191, 75.042179),\n (119.681191, 75.042179, 119.423402, 75.042179),\n (119.423402, 75.042179, 119.165612, 75.042179),\n (119.165612, 75.042179, 118.907823, 75.042179),\n (118.907823, 75.042179, 118.650033, 75.042179),\n (118.650033, 75.042179, 118.392244, 75.042179),\n (118.392244, 75.042179, 118.134455, 75.042179),\n (118.134455, 75.042179, 117.876665, 75.042179),\n (117.876665, 75.042179, 117.618876, 75.042179),\n (117.618876, 75.042179, 117.361086, 75.042179),\n (117.361086, 75.042179, 117.103297, 75.042179),\n (117.103297, 75.042179, 116.845507, 75.042179),\n (116.845507, 75.042179, 116.587718, 75.042179),\n (116.587718, 75.042179, 116.329928, 75.042179),\n (116.329928, 75.042179, 116.072139, 75.042179),\n (116.072139, 75.042179, 115.814349, 75.042179),\n (115.814349, 75.042179, 115.55656, 75.042179),\n (115.55656, 75.042179, 115.29877, 75.042179),\n (115.29877, 75.042179, 115.040981, 75.042179),\n (115.040981, 75.042179, 114.783191, 75.042179),\n (114.783191, 75.042179, 114.525402, 75.042179),\n (114.525402, 75.042179, 114.267612, 75.042179),\n (114.267612, 75.042179, 114.009823, 75.042179),\n (114.009823, 75.042179, 113.752033, 75.042179),\n (113.752033, 75.042179, 113.494244, 75.042179),\n (184.651951, 85.431876, 184.651951, 75.042179),\n (184.651951, 75.042179, 184.399532, 75.042179),\n (184.399532, 75.042179, 184.147113, 75.042179),\n (184.147113, 75.042179, 183.894694, 75.042179),\n (183.894694, 75.042179, 183.642275, 75.042179),\n (183.642275, 75.042179, 183.389856, 75.042179),\n (183.389856, 75.042179, 183.137437, 75.042179),\n (183.137437, 75.042179, 182.885019, 75.042179),\n (182.885019, 75.042179, 182.6326, 75.042179),\n (182.6326, 75.042179, 182.380181, 75.042179),\n (182.380181, 75.042179, 182.127762, 75.042179),\n (182.127762, 75.042179, 181.875343, 75.042179),\n (181.875343, 75.042179, 181.622924, 75.042179),\n (181.622924, 75.042179, 181.370505, 75.042179),\n (181.370505, 75.042179, 181.118087, 75.042179),\n (181.118087, 75.042179, 180.865668, 75.042179),\n (180.865668, 75.042179, 180.613249, 75.042179),\n (180.613249, 75.042179, 180.36083, 75.042179),\n (180.36083, 75.042179, 180.108411, 75.042179),\n (180.108411, 75.042179, 179.855992, 75.042179),\n (179.855992, 75.042179, 179.603573, 75.042179),\n (179.603573, 75.042179, 179.351155, 75.042179),\n (179.351155, 75.042179, 179.098736, 75.042179),\n (179.098736, 75.042179, 178.846317, 75.042179),\n (178.846317, 75.042179, 178.593898, 75.042179),\n (178.593898, 75.042179, 178.341479, 75.042179),\n (178.341479, 75.042179, 178.08906, 75.042179),\n (178.08906, 75.042179, 177.836641, 75.042179),\n (177.836641, 75.042179, 177.584222, 75.042179),\n (177.584222, 75.042179, 177.331804, 75.042179),\n (177.331804, 75.042179, 177.079385, 75.042179),\n (177.079385, 75.042179, 176.826966, 75.042179),\n (176.826966, 75.042179, 176.574547, 75.042179),\n (72.677577, 85.431876, 72.677577, 75.042179),\n (72.677577, 75.042179, 72.425158, 75.042179),\n (72.425158, 75.042179, 72.17274, 75.042179),\n (72.17274, 75.042179, 71.920321, 75.042179),\n (71.920321, 75.042179, 71.667902, 75.042179),\n (71.667902, 75.042179, 71.415483, 75.042179),\n (71.415483, 75.042179, 71.163064, 75.042179),\n (71.163064, 75.042179, 70.910645, 75.042179),\n (70.910645, 75.042179, 70.658226, 75.042179),\n (70.658226, 75.042179, 70.405808, 75.042179),\n (70.405808, 75.042179, 70.153389, 75.042179),\n (70.153389, 75.042179, 69.90097, 75.042179),\n (69.90097, 75.042179, 69.648551, 75.042179),\n (69.648551, 75.042179, 69.396132, 75.042179),\n (69.396132, 75.042179, 69.143713, 75.042179),\n (69.143713, 75.042179, 68.891294, 75.042179),\n (68.891294, 75.042179, 68.638876, 75.042179),\n (68.638876, 75.042179, 68.386457, 75.042179),\n (68.386457, 75.042179, 68.134038, 75.042179),\n (68.134038, 75.042179, 67.881619, 75.042179),\n (67.881619, 75.042179, 67.6292, 75.042179),\n (67.6292, 75.042179, 67.376781, 75.042179),\n (67.376781, 75.042179, 67.124362, 75.042179),\n (67.124362, 75.042179, 66.871944, 75.042179),\n (66.871944, 75.042179, 66.619525, 75.042179),\n (66.619525, 75.042179, 66.367106, 75.042179),\n (66.367106, 75.042179, 66.114687, 75.042179),\n (66.114687, 75.042179, 65.862268, 75.042179),\n (65.862268, 75.042179, 65.609849, 75.042179),\n (65.609849, 75.042179, 65.35743, 75.042179),\n (65.35743, 75.042179, 65.105012, 75.042179),\n (65.105012, 75.042179, 64.852593, 75.042179),\n (64.852593, 75.042179, 64.600174, 75.042179),\n (113.494244, 75.042179, 113.494244, 85.431876),\n (176.574547, 75.042179, 176.574547, 85.431876),\n (64.600174, 75.042179, 64.600174, 85.431876),\n (203.190608, 109.821573, 213.580305, 109.821573),\n (203.190608, 158.957809, 213.580305, 158.957809),\n (203.190608, 158.957809, 203.190608, 109.821573),\n (213.580305, 158.957809, 213.580305, 109.821573),\n (223.970002, 131.757113, 223.970002, 131.499324),\n (223.970002, 131.499324, 223.970002, 131.241534),\n (223.970002, 131.241534, 223.970002, 130.983745),\n (223.970002, 130.983745, 223.970002, 130.725956),\n (223.970002, 130.725956, 223.970002, 130.468166),\n (223.970002, 130.468166, 223.970002, 130.210377),\n (223.970002, 130.210377, 223.970002, 129.952587),\n (223.970002, 129.952587, 223.970002, 129.694798),\n (223.970002, 129.694798, 223.970002, 129.437008),\n (223.970002, 129.437008, 223.970002, 129.179219),\n (223.970002, 129.179219, 223.970002, 128.921429),\n (223.970002, 128.921429, 223.970002, 128.66364),\n (223.970002, 128.66364, 223.970002, 128.40585),\n (223.970002, 128.40585, 223.970002, 128.148061),\n (223.970002, 128.148061, 223.970002, 127.890271),\n (223.970002, 127.890271, 223.970002, 127.632482),\n (223.970002, 127.632482, 223.970002, 127.374692),\n (223.970002, 127.374692, 223.970002, 127.116903),\n (223.970002, 127.116903, 223.970002, 126.859113),\n (223.970002, 126.859113, 223.970002, 126.601324),\n (223.970002, 126.601324, 223.970002, 126.343534),\n (223.970002, 126.343534, 223.970002, 126.085745),\n (223.970002, 126.085745, 223.970002, 125.827956),\n (223.970002, 125.827956, 223.970002, 125.570166),\n (223.970002, 125.570166, 223.970002, 125.312377),\n (223.970002, 125.312377, 223.970002, 125.054587),\n (223.970002, 125.054587, 223.970002, 124.796798),\n (223.970002, 124.796798, 223.970002, 124.539008),\n (223.970002, 124.539008, 223.970002, 124.281219),\n (223.970002, 124.281219, 223.970002, 124.023429),\n (223.970002, 124.023429, 223.970002, 123.76564),\n (223.970002, 123.76564, 223.970002, 123.50785),\n (223.970002, 123.50785, 223.970002, 123.41777),\n (223.970002, 123.41777, 223.970002, 123.327691),\n (223.970002, 123.327691, 223.970002, 123.237611),\n (223.970002, 123.237611, 223.970002, 123.147531),\n (223.970002, 123.147531, 223.970002, 123.057451),\n (223.970002, 123.057451, 223.970002, 122.967371),\n (223.970002, 122.967371, 223.970002, 122.877291),\n (223.970002, 122.877291, 223.970002, 122.787211),\n (223.970002, 122.787211, 223.970002, 122.697132),\n (223.970002, 122.697132, 223.970002, 122.607052),\n (223.970002, 122.607052, 223.970002, 122.516972),\n (223.970002, 122.516972, 223.970002, 122.426892),\n (223.970002, 122.426892, 223.970002, 122.336812),\n (223.970002, 122.336812, 223.970002, 122.246732),\n (223.970002, 122.246732, 223.970002, 122.156653),\n (223.970002, 122.156653, 223.970002, 122.066573),\n (223.970002, 122.066573, 223.970002, 121.976493),\n (223.970002, 121.976493, 223.970002, 121.886413),\n (223.970002, 121.886413, 223.970002, 121.796333),\n (223.970002, 121.796333, 223.970002, 121.706253),\n (223.970002, 121.706253, 223.970002, 121.616174),\n (223.970002, 121.616174, 223.970002, 121.526094),\n (223.970002, 121.526094, 223.970002, 121.436014),\n (223.970002, 121.436014, 223.970002, 121.345934),\n (223.970002, 121.345934, 223.970002, 121.255854),\n (223.970002, 121.255854, 223.970002, 121.165774),\n (223.970002, 121.165774, 223.970002, 121.075694),\n (223.970002, 121.075694, 223.970002, 120.985615),\n (223.970002, 120.985615, 223.970002, 120.895535),\n (223.970002, 120.895535, 223.970002, 120.805455),\n (223.970002, 120.805455, 223.970002, 120.715375),\n (223.970002, 120.715375, 223.970002, 120.625295),\n (223.970002, 143.545123, 223.970002, 143.292704),\n (223.970002, 143.292704, 223.970002, 143.040285),\n (223.970002, 143.040285, 223.970002, 142.787866),\n (223.970002, 142.787866, 223.970002, 142.535448),\n (223.970002, 142.535448, 223.970002, 142.283029),\n (223.970002, 142.283029, 223.970002, 142.03061),\n (223.970002, 142.03061, 223.970002, 141.778191),\n (223.970002, 141.778191, 223.970002, 141.525772),\n (223.970002, 141.525772, 223.970002, 141.273353),\n (223.970002, 141.273353, 223.970002, 141.020934),\n (223.970002, 141.020934, 223.970002, 140.768516),\n (223.970002, 140.768516, 223.970002, 140.516097),\n (223.970002, 140.516097, 223.970002, 140.263678),\n (223.970002, 140.263678, 223.970002, 140.011259),\n (223.970002, 140.011259, 223.970002, 139.75884),\n (223.970002, 139.75884, 223.970002, 139.506421),\n (223.970002, 139.506421, 223.970002, 139.254002),\n (223.970002, 139.254002, 223.970002, 139.001583),\n (223.970002, 139.001583, 223.970002, 138.749165),\n (223.970002, 138.749165, 223.970002, 138.496746),\n (223.970002, 138.496746, 223.970002, 138.244327),\n (223.970002, 138.244327, 223.970002, 137.991908),\n (223.970002, 137.991908, 223.970002, 137.739489),\n (223.970002, 137.739489, 223.970002, 137.48707),\n (223.970002, 137.48707, 223.970002, 137.234651),\n (223.970002, 137.234651, 223.970002, 136.982233),\n (223.970002, 136.982233, 223.970002, 136.729814),\n (223.970002, 136.729814, 223.970002, 136.477395),\n (223.970002, 136.477395, 223.970002, 136.224976),\n (223.970002, 136.224976, 223.970002, 135.972557),\n (223.970002, 135.972557, 223.970002, 135.720138),\n (223.970002, 135.720138, 223.970002, 135.467719),\n (223.970002, 131.757113, 213.580305, 131.757113),\n (223.970002, 123.50785, 213.580305, 123.50785),\n (223.970002, 120.625295, 213.580305, 120.625295),\n (223.970002, 143.545123, 213.580305, 143.545123),\n (223.970002, 135.467719, 213.580305, 135.467719)\n]\nVISIBLE_CIRCLES = [\n (117.618876, 127.632482, 4.124632),\n (180.613249, 124.663997, 4.038702),\n (68.638876, 139.506421, 4.038702)\n]\nVISIBLE_ARCS = [\n\n]\nHIDDEN_SEGMENTS = [\n (223.97, 128.7027, 213.5803, 128.7027)\n]\n# (orient, text, p1, p2, base) for linear; (orient, text, center, radius, angle) for diameter\nDIMENSIONS = [\n ('horizontal', '100', (189.1906, 158.9578), (63.03, 158.9578), (126.1103, 147.9578)),\n ('vertical', '38.9474', (189.1906, 109.8215), (189.1906, 158.9578), (178.1906, 134.3897)),\n ('diameter', '%%c6.4025', (68.6388, 139.5065), 4.0387, 45),\n ('diameter', '%%c6.5387', (117.6189, 127.6325), 4.1246, 45),\n ('diameter', '%%c6.4025', (180.6133, 124.6639), 4.0387, 45),\n ('horizontal', '8.2353', (203.1906, 109.8215), (213.5803, 109.8215), (208.3855, 120.8215))\n]\n\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; _ds.dxf.dimasz = 2.5\n _ds.dxf.dimexe = 1.25; _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\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\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,\n angle=(0 if d[0] == \"horizontal\" else 90),\n 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,\n 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,\n 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,\n text=text, dimstyle=\"EZDXF\").render()\n\n doc.saveas(out_path)\n\n\nif __name__ == \"__main__\":\n out = sys.argv[1] if len(sys.argv) > 1 else \"0017_00177319_gt.dxf\"\n draw(out)\n print(\"wrote\", out)\n```"}], "images": ["images/0017_00177319.png"], "id": "0017_00177319"} {"messages": [{"role": "user", "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 100 mm. A cut feature: The part is a square plate 35.42 x 35.42 mm. It is extruded to a thickness of -50 mm."}, {"role": "assistant", "content": "```python\n#!/usr/bin/env python3\n# -*- coding: utf-8 -*-\n# Ground-truth 2D engineering drawing for part: 0018_00186673\n# Self-contained: reproduces the three-view DXF via ezdxf, NO FreeCAD needed.\n# Coordinates are A4 page millimetres (scale=0.32033333333333336, page=[297.0, 210.0]).\n# visible edges -> solid (layer OUTLINE); hidden edges -> dashed (layer HIDDEN)\n# dimensions -> real movable DIMENSION entities (text = true mm value)\n# Run: python 0018_00186673_gt.py [out.dxf]\nimport sys\nimport ezdxf\nimport math\n\nSCALE = 0.32033333333333336\nPAGE = [297.0, 210.0]\n\nVISIBLE_SEGMENTS = [\n (117.980767, 99.1554, 117.980767, 67.122066),\n (85.947433, 67.122066, 86.948475, 67.122066),\n (86.948475, 67.122066, 87.949517, 67.122066),\n (87.949517, 67.122066, 88.950558, 67.122066),\n (88.950558, 67.122066, 89.9516, 67.122066),\n (89.9516, 67.122066, 90.952642, 67.122066),\n (90.952642, 67.122066, 91.953683, 67.122066),\n (91.953683, 67.122066, 92.954725, 67.122066),\n (92.954725, 67.122066, 93.955767, 67.122066),\n (93.955767, 67.122066, 94.956808, 67.122066),\n (94.956808, 67.122066, 95.95785, 67.122066),\n (95.95785, 67.122066, 96.958892, 67.122066),\n (96.958892, 67.122066, 97.959933, 67.122066),\n (97.959933, 67.122066, 98.960975, 67.122066),\n (98.960975, 67.122066, 99.962017, 67.122066),\n (99.962017, 67.122066, 100.963058, 67.122066),\n (100.963058, 67.122066, 101.9641, 67.122066),\n (101.9641, 67.122066, 102.965142, 67.122066),\n (102.965142, 67.122066, 103.966183, 67.122066),\n (103.966183, 67.122066, 104.967225, 67.122066),\n (104.967225, 67.122066, 105.968267, 67.122066),\n (105.968267, 67.122066, 106.969308, 67.122066),\n (106.969308, 67.122066, 107.97035, 67.122066),\n (107.97035, 67.122066, 108.971392, 67.122066),\n (108.971392, 67.122066, 109.972433, 67.122066),\n (109.972433, 67.122066, 110.973475, 67.122066),\n (110.973475, 67.122066, 111.974517, 67.122066),\n (111.974517, 67.122066, 112.975558, 67.122066),\n (112.975558, 67.122066, 113.9766, 67.122066),\n (113.9766, 67.122066, 114.977642, 67.122066),\n (114.977642, 67.122066, 115.978683, 67.122066),\n (115.978683, 67.122066, 116.979725, 67.122066),\n (116.979725, 67.122066, 117.980767, 67.122066),\n (117.980767, 99.1554, 117.980767, 131.188733),\n (85.947433, 131.188733, 86.948475, 131.188733),\n (86.948475, 131.188733, 87.949517, 131.188733),\n (87.949517, 131.188733, 88.950558, 131.188733),\n (88.950558, 131.188733, 89.9516, 131.188733),\n (89.9516, 131.188733, 90.952642, 131.188733),\n (90.952642, 131.188733, 91.953683, 131.188733),\n (91.953683, 131.188733, 92.954725, 131.188733),\n (92.954725, 131.188733, 93.955767, 131.188733),\n (93.955767, 131.188733, 94.956808, 131.188733),\n (94.956808, 131.188733, 95.95785, 131.188733),\n (95.95785, 131.188733, 96.958892, 131.188733),\n (96.958892, 131.188733, 97.959933, 131.188733),\n (97.959933, 131.188733, 98.960975, 131.188733),\n (98.960975, 131.188733, 99.962017, 131.188733),\n (99.962017, 131.188733, 100.963058, 131.188733),\n (100.963058, 131.188733, 101.9641, 131.188733),\n (101.9641, 131.188733, 102.965142, 131.188733),\n (102.965142, 131.188733, 103.966183, 131.188733),\n (103.966183, 131.188733, 104.967225, 131.188733),\n (104.967225, 131.188733, 105.968267, 131.188733),\n (105.968267, 131.188733, 106.969308, 131.188733),\n (106.969308, 131.188733, 107.97035, 131.188733),\n (107.97035, 131.188733, 108.971392, 131.188733),\n (108.971392, 131.188733, 109.972433, 131.188733),\n (109.972433, 131.188733, 110.973475, 131.188733),\n (110.973475, 131.188733, 111.974517, 131.188733),\n (111.974517, 131.188733, 112.975558, 131.188733),\n (112.975558, 131.188733, 113.9766, 131.188733),\n (113.9766, 131.188733, 114.977642, 131.188733),\n (114.977642, 131.188733, 115.978683, 131.188733),\n (115.978683, 131.188733, 116.979725, 131.188733),\n (116.979725, 131.188733, 117.980767, 131.188733),\n (85.947433, 67.122066, 85.947433, 99.1554),\n (85.947433, 131.188733, 85.947433, 99.1554),\n (131.980767, 177.222067, 131.980767, 176.221025),\n (131.980767, 176.221025, 131.980767, 175.219983),\n (131.980767, 175.219983, 131.980767, 174.218942),\n (131.980767, 174.218942, 131.980767, 173.2179),\n (131.980767, 173.2179, 131.980767, 172.216858),\n (131.980767, 172.216858, 131.980767, 171.215817),\n (131.980767, 171.215817, 131.980767, 170.214775),\n (131.980767, 170.214775, 131.980767, 169.213733),\n (131.980767, 169.213733, 131.980767, 168.212692),\n (131.980767, 168.212692, 131.980767, 167.21165),\n (131.980767, 167.21165, 131.980767, 166.210608),\n (131.980767, 166.210608, 131.980767, 165.209567),\n (131.980767, 165.209567, 131.980767, 164.208525),\n (131.980767, 164.208525, 131.980767, 163.207483),\n (131.980767, 163.207483, 131.980767, 162.206442),\n (131.980767, 162.206442, 131.980767, 161.2054),\n (131.980767, 161.2054, 131.980767, 160.204358),\n (131.980767, 160.204358, 131.980767, 159.203317),\n (131.980767, 159.203317, 131.980767, 158.202275),\n (131.980767, 158.202275, 131.980767, 157.201233),\n (131.980767, 157.201233, 131.980767, 156.200192),\n (131.980767, 156.200192, 131.980767, 155.19915),\n (131.980767, 155.19915, 131.980767, 154.198108),\n (131.980767, 154.198108, 131.980767, 153.197067),\n (131.980767, 153.197067, 131.980767, 152.196025),\n (131.980767, 152.196025, 131.980767, 151.194983),\n (131.980767, 151.194983, 131.980767, 150.193942),\n (131.980767, 150.193942, 131.980767, 149.1929),\n (131.980767, 149.1929, 131.980767, 148.191858),\n (131.980767, 148.191858, 131.980767, 147.190817),\n (131.980767, 147.190817, 131.980767, 146.189775),\n (131.980767, 146.189775, 131.980767, 145.188733),\n (196.047434, 177.222067, 196.047434, 176.221025),\n (196.047434, 176.221025, 196.047434, 175.219983),\n (196.047434, 175.219983, 196.047434, 174.218942),\n (196.047434, 174.218942, 196.047434, 173.2179),\n (196.047434, 173.2179, 196.047434, 172.216858),\n (196.047434, 172.216858, 196.047434, 171.215817),\n (196.047434, 171.215817, 196.047434, 170.214775),\n (196.047434, 170.214775, 196.047434, 169.213733),\n (196.047434, 169.213733, 196.047434, 168.212692),\n (196.047434, 168.212692, 196.047434, 167.21165),\n (196.047434, 167.21165, 196.047434, 166.210608),\n (196.047434, 166.210608, 196.047434, 165.209567),\n (196.047434, 165.209567, 196.047434, 164.208525),\n (196.047434, 164.208525, 196.047434, 163.207483),\n (196.047434, 163.207483, 196.047434, 162.206442),\n (196.047434, 162.206442, 196.047434, 161.2054),\n (196.047434, 161.2054, 196.047434, 160.204358),\n (196.047434, 160.204358, 196.047434, 159.203317),\n (196.047434, 159.203317, 196.047434, 158.202275),\n (196.047434, 158.202275, 196.047434, 157.201233),\n (196.047434, 157.201233, 196.047434, 156.200192),\n (196.047434, 156.200192, 196.047434, 155.19915),\n (196.047434, 155.19915, 196.047434, 154.198108),\n (196.047434, 154.198108, 196.047434, 153.197067),\n (196.047434, 153.197067, 196.047434, 152.196025),\n (196.047434, 152.196025, 196.047434, 151.194983),\n (196.047434, 151.194983, 196.047434, 150.193942),\n (196.047434, 150.193942, 196.047434, 149.1929),\n (196.047434, 149.1929, 196.047434, 148.191858),\n (196.047434, 148.191858, 196.047434, 147.190817),\n (196.047434, 147.190817, 196.047434, 146.189775),\n (196.047434, 146.189775, 196.047434, 145.188733),\n (131.980767, 177.222067, 164.0141, 177.222067),\n (131.980767, 145.188733, 164.0141, 145.188733),\n (196.047434, 145.188733, 164.0141, 145.188733),\n (196.047434, 177.222067, 164.0141, 177.222067)\n]\nVISIBLE_CIRCLES = [\n (101.9641, 161.2054, 16.016667)\n]\nVISIBLE_ARCS = [\n\n]\nHIDDEN_SEGMENTS = [\n (107.303, 166.878, 107.303, 155.5328),\n (95.9578, 166.878, 107.303, 166.878),\n (95.9578, 155.5328, 95.9578, 166.878),\n (107.303, 155.5328, 95.9578, 155.5328),\n (107.303, 131.1887, 107.303, 115.172),\n (107.303, 115.172, 95.9578, 115.172),\n (95.9578, 131.1887, 95.9578, 115.172),\n (131.9807, 166.878, 147.9974, 166.878),\n (147.9974, 166.878, 147.9974, 155.5328),\n (131.9807, 155.5328, 147.9974, 155.5328)\n]\n# (orient, text, p1, p2, base) for linear; (orient, text, center, radius, angle) for diameter\nDIMENSIONS = [\n ('diameter', '%%c100', (101.9641, 161.2054), 16.0167, 45),\n ('vertical', '35.4167', (107.3029, 166.8779), (107.3029, 155.5328), (118.3029, 161.2054)),\n ('horizontal', '200', (196.0474, 161.2054), (131.9807, 161.2054), (164.0141, 150.2054)),\n ('horizontal', '50', (131.9807, 166.8779), (147.9974, 166.8779), (139.9891, 177.8779))\n]\n\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; _ds.dxf.dimasz = 2.5\n _ds.dxf.dimexe = 1.25; _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\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\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,\n angle=(0 if d[0] == \"horizontal\" else 90),\n 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,\n 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,\n 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,\n text=text, dimstyle=\"EZDXF\").render()\n\n doc.saveas(out_path)\n\n\nif __name__ == \"__main__\":\n out = sys.argv[1] if len(sys.argv) > 1 else \"0018_00186673_gt.dxf\"\n draw(out)\n print(\"wrote\", out)\n```"}], "images": ["images/0018_00186673.png"], "id": "0018_00186673"} {"messages": [{"role": "user", "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 3 circular holes (diameters 12.5, 16.67 mm). It is extruded to a thickness of 25.25 mm. A cut feature: The part is a square plate 12.37 x 12.37 mm. It is extruded to a thickness of -0.52 mm."}, {"role": "assistant", "content": "```python\n#!/usr/bin/env python3\n# -*- coding: utf-8 -*-\n# Ground-truth 2D engineering drawing for part: 0019_00195789\n# Self-contained: reproduces the three-view DXF via ezdxf, NO FreeCAD needed.\n# Coordinates are A4 page millimetres (scale=0.7672348940962473, page=[297.0, 210.0]).\n# visible edges -> solid (layer OUTLINE); hidden edges -> dashed (layer HIDDEN)\n# dimensions -> real movable DIMENSION entities (text = true mm value)\n# Run: python 0019_00195789_gt.py [out.dxf]\nimport sys\nimport ezdxf\nimport math\n\nSCALE = 0.7672348940962473\nPAGE = [297.0, 210.0]\n\nVISIBLE_SEGMENTS = [\n (125.163367, 116.785354, 125.163367, 126.275889),\n (115.672831, 116.785354, 125.163367, 116.785354),\n (115.672831, 126.275889, 115.672831, 116.785354),\n (115.672831, 126.275889, 125.163367, 126.275889),\n (159.179445, 93.290655, 156.781836, 93.290655),\n (156.781836, 93.290655, 154.384227, 93.290655),\n (154.384227, 93.290655, 151.986618, 93.290655),\n (151.986618, 93.290655, 149.589009, 93.290655),\n (149.589009, 93.290655, 147.1914, 93.290655),\n (147.1914, 93.290655, 144.793791, 93.290655),\n (144.793791, 93.290655, 142.396182, 93.290655),\n (142.396182, 93.290655, 139.998573, 93.290655),\n (139.998573, 93.290655, 137.600964, 93.290655),\n (137.600964, 93.290655, 135.203355, 93.290655),\n (135.203355, 93.290655, 132.805746, 93.290655),\n (132.805746, 93.290655, 130.408137, 93.290655),\n (130.408137, 93.290655, 128.010528, 93.290655),\n (128.010528, 93.290655, 125.612919, 93.290655),\n (125.612919, 93.290655, 123.21531, 93.290655),\n (123.21531, 93.290655, 120.817701, 93.290655),\n (120.817701, 93.290655, 118.420092, 93.290655),\n (118.420092, 93.290655, 116.022483, 93.290655),\n (116.022483, 93.290655, 113.624874, 93.290655),\n (113.624874, 93.290655, 111.227265, 93.290655),\n (111.227265, 93.290655, 108.829656, 93.290655),\n (108.829656, 93.290655, 106.432046, 93.290655),\n (106.432046, 93.290655, 104.034437, 93.290655),\n (104.034437, 93.290655, 101.636828, 93.290655),\n (101.636828, 93.290655, 99.239219, 93.290655),\n (99.239219, 93.290655, 96.84161, 93.290655),\n (96.84161, 93.290655, 94.444001, 93.290655),\n (94.444001, 93.290655, 92.046392, 93.290655),\n (92.046392, 93.290655, 89.648783, 93.290655),\n (89.648783, 93.290655, 87.251174, 93.290655),\n (87.251174, 93.290655, 84.853565, 93.290655),\n (84.853565, 93.290655, 82.455956, 93.290655),\n (159.179445, 93.290655, 159.179445, 73.914145),\n (159.179445, 73.914145, 156.781836, 73.914145),\n (156.781836, 73.914145, 154.384227, 73.914145),\n (154.384227, 73.914145, 151.986618, 73.914145),\n (151.986618, 73.914145, 149.589009, 73.914145),\n (149.589009, 73.914145, 147.1914, 73.914145),\n (147.1914, 73.914145, 144.793791, 73.914145),\n (144.793791, 73.914145, 142.396182, 73.914145),\n (142.396182, 73.914145, 139.998573, 73.914145),\n (139.998573, 73.914145, 137.600964, 73.914145),\n (137.600964, 73.914145, 135.203355, 73.914145),\n (135.203355, 73.914145, 132.805746, 73.914145),\n (132.805746, 73.914145, 130.408137, 73.914145),\n (130.408137, 73.914145, 128.010528, 73.914145),\n (128.010528, 73.914145, 125.612919, 73.914145),\n (125.612919, 73.914145, 123.21531, 73.914145),\n (123.21531, 73.914145, 120.817701, 73.914145),\n (120.817701, 73.914145, 118.420092, 73.914145),\n (118.420092, 73.914145, 116.022483, 73.914145),\n (116.022483, 73.914145, 113.624874, 73.914145),\n (113.624874, 73.914145, 111.227265, 73.914145),\n (111.227265, 73.914145, 108.829656, 73.914145),\n (108.829656, 73.914145, 106.432046, 73.914145),\n (106.432046, 73.914145, 104.034437, 73.914145),\n (104.034437, 73.914145, 101.636828, 73.914145),\n (101.636828, 73.914145, 99.239219, 73.914145),\n (99.239219, 73.914145, 96.84161, 73.914145),\n (96.84161, 73.914145, 94.444001, 73.914145),\n (94.444001, 73.914145, 92.046392, 73.914145),\n (92.046392, 73.914145, 89.648783, 73.914145),\n (89.648783, 73.914145, 87.251174, 73.914145),\n (87.251174, 73.914145, 84.853565, 73.914145),\n (84.853565, 73.914145, 82.455956, 73.914145),\n (82.455956, 73.914145, 82.455956, 93.290655),\n (173.179446, 184.014145, 173.179446, 181.616536),\n (173.179446, 181.616536, 173.179446, 179.218927),\n (173.179446, 179.218927, 173.179446, 176.821318),\n (173.179446, 176.821318, 173.179446, 174.423709),\n (173.179446, 174.423709, 173.179446, 172.026099),\n (173.179446, 172.026099, 173.179446, 169.62849),\n (173.179446, 169.62849, 173.179446, 167.230881),\n (173.179446, 167.230881, 173.179446, 164.833272),\n (173.179446, 164.833272, 173.179446, 162.435663),\n (173.179446, 162.435663, 173.179446, 160.038054),\n (173.179446, 160.038054, 173.179446, 157.640445),\n (173.179446, 157.640445, 173.179446, 155.242836),\n (173.179446, 155.242836, 173.179446, 152.845227),\n (173.179446, 152.845227, 173.179446, 150.447618),\n (173.179446, 150.447618, 173.179446, 148.050009),\n (173.179446, 148.050009, 173.179446, 145.6524),\n (173.179446, 145.6524, 173.179446, 143.254791),\n (173.179446, 143.254791, 173.179446, 140.857182),\n (173.179446, 140.857182, 173.179446, 138.459573),\n (173.179446, 138.459573, 173.179446, 136.061964),\n (173.179446, 136.061964, 173.179446, 133.664355),\n (173.179446, 133.664355, 173.179446, 131.266746),\n (173.179446, 131.266746, 173.179446, 128.869137),\n (173.179446, 128.869137, 173.179446, 126.471528),\n (173.179446, 126.471528, 173.179446, 124.073919),\n (173.179446, 124.073919, 173.179446, 121.67631),\n (173.179446, 121.67631, 173.179446, 119.278701),\n (173.179446, 119.278701, 173.179446, 116.881091),\n (173.179446, 116.881091, 173.179446, 114.483482),\n (173.179446, 114.483482, 173.179446, 112.085873),\n (173.179446, 112.085873, 173.179446, 109.688264),\n (173.179446, 109.688264, 173.179446, 107.290655),\n (192.555956, 184.014145, 192.555956, 181.616536),\n (192.555956, 181.616536, 192.555956, 179.218927),\n (192.555956, 179.218927, 192.555956, 176.821318),\n (192.555956, 176.821318, 192.555956, 174.423709),\n (192.555956, 174.423709, 192.555956, 172.026099),\n (192.555956, 172.026099, 192.555956, 169.62849),\n (192.555956, 169.62849, 192.555956, 167.230881),\n (192.555956, 167.230881, 192.555956, 164.833272),\n (192.555956, 164.833272, 192.555956, 162.435663),\n (192.555956, 162.435663, 192.555956, 160.038054),\n (192.555956, 160.038054, 192.555956, 157.640445),\n (192.555956, 157.640445, 192.555956, 155.242836),\n (192.555956, 155.242836, 192.555956, 152.845227),\n (192.555956, 152.845227, 192.555956, 150.447618),\n (192.555956, 150.447618, 192.555956, 148.050009),\n (192.555956, 148.050009, 192.555956, 145.6524),\n (192.555956, 145.6524, 192.555956, 143.254791),\n (192.555956, 143.254791, 192.555956, 140.857182),\n (192.555956, 140.857182, 192.555956, 138.459573),\n (192.555956, 138.459573, 192.555956, 136.061964),\n (192.555956, 136.061964, 192.555956, 133.664355),\n (192.555956, 133.664355, 192.555956, 131.266746),\n (192.555956, 131.266746, 192.555956, 128.869137),\n (192.555956, 128.869137, 192.555956, 126.471528),\n (192.555956, 126.471528, 192.555956, 124.073919),\n (192.555956, 124.073919, 192.555956, 121.67631),\n (192.555956, 121.67631, 192.555956, 119.278701),\n (192.555956, 119.278701, 192.555956, 116.881091),\n (192.555956, 116.881091, 192.555956, 114.483482),\n (192.555956, 114.483482, 192.555956, 112.085873),\n (192.555956, 112.085873, 192.555956, 109.688264),\n (192.555956, 109.688264, 192.555956, 107.290655),\n (192.555956, 184.014145, 173.179446, 184.014145),\n (192.555956, 107.290655, 173.179446, 107.290655)\n]\nVISIBLE_CIRCLES = [\n (120.817701, 145.6524, 38.361745),\n (101.636828, 145.6524, 4.795218),\n (120.817701, 145.6524, 6.393624),\n (139.19937, 145.6524, 4.795218)\n]\nVISIBLE_ARCS = [\n\n]\nHIDDEN_SEGMENTS = [\n (106.4321, 93.2906, 106.4321, 73.9141),\n (127.2113, 93.2906, 127.2113, 73.9141),\n (143.9946, 93.2906, 143.9946, 73.9141),\n (96.8416, 73.9141, 96.8416, 93.2906),\n (114.4241, 73.9141, 114.4241, 93.2906),\n (134.4042, 73.9141, 134.4042, 93.2906),\n (192.556, 150.4476, 173.1795, 150.4476),\n (192.556, 140.8571, 173.1795, 140.8571),\n (192.556, 152.046, 173.1795, 152.046),\n (192.556, 139.2587, 173.1795, 139.2587)\n]\n# (orient, text, p1, p2, base) for linear; (orient, text, center, radius, angle) for diameter\nDIMENSIONS = [\n ('diameter', '%%c100', (120.8177, 145.6524), 38.3617, 45),\n ('diameter', '%%c12.5', (101.6368, 145.6524), 4.7952, 45),\n ('horizontal', '25', (120.8177, 145.6524), (101.6368, 145.6524), (111.2273, 134.6524)),\n ('diameter', '%%c16.6667', (120.8177, 145.6524), 6.3936, 135),\n ('diameter', '%%c12.5', (139.1994, 145.6524), 4.7952, 45),\n ('horizontal', '23.9584', (120.8177, 145.6524), (139.1994, 145.6524), (130.0086, 156.6524)),\n ('horizontal', '12.3698', (115.6728, 116.7853), (125.1634, 116.7853), (120.4181, 127.7853)),\n ('vertical', '12.3698', (125.1634, 116.7853), (125.1634, 126.2758), (114.1634, 121.5306)),\n ('vertical', '0.5154', (192.556, 116.7853), (192.1606, 116.7853), (192.3583, 105.7853))\n]\n\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; _ds.dxf.dimasz = 2.5\n _ds.dxf.dimexe = 1.25; _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\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\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,\n angle=(0 if d[0] == \"horizontal\" else 90),\n 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,\n 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,\n 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,\n text=text, dimstyle=\"EZDXF\").render()\n\n doc.saveas(out_path)\n\n\nif __name__ == \"__main__\":\n out = sys.argv[1] if len(sys.argv) > 1 else \"0019_00195789_gt.dxf\"\n draw(out)\n print(\"wrote\", out)\n```"}], "images": ["images/0019_00195789.png"], "id": "0019_00195789"} {"messages": [{"role": "user", "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 95.45 mm wide and 100 mm tall, featuring a circular hole of diameter 427.27 mm. It is extruded to a thickness of 287.88 mm. A union feature: The part is a square plate 97.08 x 97.08 mm. It is extruded to a thickness of 143.94 mm."}, {"role": "assistant", "content": "```python\n#!/usr/bin/env python3\n# -*- coding: utf-8 -*-\n# Ground-truth 2D engineering drawing for part: 0023_00236386\n# Self-contained: reproduces the three-view DXF via ezdxf, NO FreeCAD needed.\n# Coordinates are A4 page millimetres (scale=0.13437711864407065, page=[297.0, 210.0]).\n# visible edges -> solid (layer OUTLINE); hidden edges -> dashed (layer HIDDEN)\n# dimensions -> real movable DIMENSION entities (text = true mm value)\n# Run: python 0023_00236386_gt.py [out.dxf]\nimport sys\nimport ezdxf\nimport math\n\nSCALE = 0.13437711864407065\nPAGE = [297.0, 210.0]\n\nVISIBLE_SEGMENTS = [\n (104.941744, 147.617844, 104.941744, 161.055556),\n (117.768651, 147.617844, 104.941744, 147.617844),\n (117.768651, 161.055556, 117.768651, 147.617844),\n (104.941744, 161.055556, 117.768651, 161.055556),\n (117.768651, 148.039252, 104.941744, 148.039252),\n (140.368439, 72.944539, 138.574199, 72.944539),\n (138.574199, 72.944539, 136.779959, 72.944539),\n (136.779959, 72.944539, 134.985719, 72.944539),\n (134.985719, 72.944539, 133.191479, 72.944539),\n (133.191479, 72.944539, 131.397239, 72.944539),\n (131.397239, 72.944539, 129.602999, 72.944539),\n (129.602999, 72.944539, 127.808759, 72.944539),\n (127.808759, 72.944539, 126.014519, 72.944539),\n (126.014519, 72.944539, 124.22028, 72.944539),\n (124.22028, 72.944539, 122.42604, 72.944539),\n (122.42604, 72.944539, 120.6318, 72.944539),\n (120.6318, 72.944539, 118.83756, 72.944539),\n (118.83756, 72.944539, 117.04332, 72.944539),\n (117.04332, 72.944539, 115.24908, 72.944539),\n (115.24908, 72.944539, 113.45484, 72.944539),\n (113.45484, 72.944539, 111.6606, 72.944539),\n (111.6606, 72.944539, 109.86636, 72.944539),\n (109.86636, 72.944539, 108.07212, 72.944539),\n (108.07212, 72.944539, 106.27788, 72.944539),\n (106.27788, 72.944539, 104.48364, 72.944539),\n (104.48364, 72.944539, 102.6894, 72.944539),\n (102.6894, 72.944539, 100.89516, 72.944539),\n (100.89516, 72.944539, 99.10092, 72.944539),\n (99.10092, 72.944539, 97.306681, 72.944539),\n (97.306681, 72.944539, 95.512441, 72.944539),\n (95.512441, 72.944539, 93.718201, 72.944539),\n (93.718201, 72.944539, 91.923961, 72.944539),\n (91.923961, 72.944539, 90.129721, 72.944539),\n (90.129721, 72.944539, 88.335481, 72.944539),\n (88.335481, 72.944539, 86.541241, 72.944539),\n (86.541241, 72.944539, 84.747001, 72.944539),\n (84.747001, 72.944539, 82.952761, 72.944539),\n (140.368439, 72.944539, 140.368439, 111.628861),\n (140.368439, 111.628861, 138.574199, 111.628861),\n (138.574199, 111.628861, 136.779959, 111.628861),\n (136.779959, 111.628861, 134.985719, 111.628861),\n (134.985719, 111.628861, 133.191479, 111.628861),\n (133.191479, 111.628861, 131.397239, 111.628861),\n (131.397239, 111.628861, 129.602999, 111.628861),\n (129.602999, 111.628861, 127.808759, 111.628861),\n (127.808759, 111.628861, 126.014519, 111.628861),\n (126.014519, 111.628861, 124.22028, 111.628861),\n (124.22028, 111.628861, 122.42604, 111.628861),\n (122.42604, 111.628861, 120.6318, 111.628861),\n (120.6318, 111.628861, 118.83756, 111.628861),\n (118.83756, 111.628861, 117.04332, 111.628861),\n (117.04332, 111.628861, 115.24908, 111.628861),\n (115.24908, 111.628861, 113.45484, 111.628861),\n (113.45484, 111.628861, 111.6606, 111.628861),\n (111.6606, 111.628861, 109.86636, 111.628861),\n (109.86636, 111.628861, 108.07212, 111.628861),\n (108.07212, 111.628861, 106.27788, 111.628861),\n (106.27788, 111.628861, 104.48364, 111.628861),\n (104.48364, 111.628861, 102.6894, 111.628861),\n (102.6894, 111.628861, 100.89516, 111.628861),\n (100.89516, 111.628861, 99.10092, 111.628861),\n (99.10092, 111.628861, 97.306681, 111.628861),\n (97.306681, 111.628861, 95.512441, 111.628861),\n (95.512441, 111.628861, 93.718201, 111.628861),\n (93.718201, 111.628861, 91.923961, 111.628861),\n (91.923961, 111.628861, 90.129721, 111.628861),\n (90.129721, 111.628861, 88.335481, 111.628861),\n (88.335481, 111.628861, 86.541241, 111.628861),\n (86.541241, 111.628861, 84.747001, 111.628861),\n (84.747001, 111.628861, 82.952761, 111.628861),\n (82.952761, 111.628861, 82.952761, 72.944539),\n (154.368439, 125.628861, 154.368439, 127.423101),\n (154.368439, 127.423101, 154.368439, 129.217341),\n (154.368439, 129.217341, 154.368439, 131.011581),\n (154.368439, 131.011581, 154.368439, 132.805821),\n (154.368439, 132.805821, 154.368439, 134.600061),\n (154.368439, 134.600061, 154.368439, 136.394301),\n (154.368439, 136.394301, 154.368439, 138.188541),\n (154.368439, 138.188541, 154.368439, 139.982781),\n (154.368439, 139.982781, 154.368439, 141.77702),\n (154.368439, 141.77702, 154.368439, 143.57126),\n (154.368439, 143.57126, 154.368439, 145.3655),\n (154.368439, 145.3655, 154.368439, 147.15974),\n (154.368439, 147.15974, 154.368439, 148.95398),\n (154.368439, 148.95398, 154.368439, 150.74822),\n (154.368439, 150.74822, 154.368439, 152.54246),\n (154.368439, 152.54246, 154.368439, 154.3367),\n (154.368439, 154.3367, 154.368439, 156.13094),\n (154.368439, 156.13094, 154.368439, 157.92518),\n (154.368439, 157.92518, 154.368439, 159.71942),\n (154.368439, 159.71942, 154.368439, 161.51366),\n (154.368439, 161.51366, 154.368439, 163.3079),\n (154.368439, 163.3079, 154.368439, 165.10214),\n (154.368439, 165.10214, 154.368439, 166.89638),\n (154.368439, 166.89638, 154.368439, 168.690619),\n (154.368439, 168.690619, 154.368439, 170.484859),\n (154.368439, 170.484859, 154.368439, 172.279099),\n (154.368439, 172.279099, 154.368439, 174.073339),\n (154.368439, 174.073339, 154.368439, 175.867579),\n (154.368439, 175.867579, 154.368439, 177.661819),\n (154.368439, 177.661819, 154.368439, 179.456059),\n (154.368439, 179.456059, 154.368439, 181.250299),\n (154.368439, 181.250299, 154.368439, 183.044539),\n (193.052761, 125.628861, 193.052761, 127.423101),\n (193.052761, 127.423101, 193.052761, 129.217341),\n (193.052761, 129.217341, 193.052761, 131.011581),\n (193.052761, 131.011581, 193.052761, 132.805821),\n (193.052761, 132.805821, 193.052761, 134.600061),\n (193.052761, 134.600061, 193.052761, 136.394301),\n (193.052761, 136.394301, 193.052761, 138.188541),\n (193.052761, 138.188541, 193.052761, 139.982781),\n (193.052761, 139.982781, 193.052761, 141.77702),\n (193.052761, 141.77702, 193.052761, 143.57126),\n (193.052761, 143.57126, 193.052761, 145.3655),\n (193.052761, 145.3655, 193.052761, 147.15974),\n (193.052761, 147.15974, 193.052761, 148.95398),\n (193.052761, 148.95398, 193.052761, 150.74822),\n (193.052761, 150.74822, 193.052761, 152.54246),\n (193.052761, 152.54246, 193.052761, 154.3367),\n (193.052761, 154.3367, 193.052761, 156.13094),\n (193.052761, 156.13094, 193.052761, 157.92518),\n (193.052761, 157.92518, 193.052761, 159.71942),\n (193.052761, 159.71942, 193.052761, 161.51366),\n (193.052761, 161.51366, 193.052761, 163.3079),\n (193.052761, 163.3079, 193.052761, 165.10214),\n (193.052761, 165.10214, 193.052761, 166.89638),\n (193.052761, 166.89638, 193.052761, 168.690619),\n (193.052761, 168.690619, 193.052761, 170.484859),\n (193.052761, 170.484859, 193.052761, 172.279099),\n (193.052761, 172.279099, 193.052761, 174.073339),\n (193.052761, 174.073339, 193.052761, 175.867579),\n (193.052761, 175.867579, 193.052761, 177.661819),\n (193.052761, 177.661819, 193.052761, 179.456059),\n (193.052761, 179.456059, 193.052761, 181.250299),\n (193.052761, 181.250299, 193.052761, 183.044539),\n (193.052761, 125.628861, 154.368439, 125.628861),\n (193.052761, 183.044539, 154.368439, 183.044539)\n]\nVISIBLE_CIRCLES = [\n (111.6606, 154.3367, 28.707839)\n]\nVISIBLE_ARCS = [\n\n]\nHIDDEN_SEGMENTS = [\n (104.9417, 111.6288, 104.9417, 72.9445),\n (117.7686, 111.6288, 117.7686, 72.9445),\n (104.9417, 92.2867, 117.7686, 92.2867),\n (154.3684, 161.0555, 193.0528, 161.0555),\n (173.7106, 147.6178, 193.0528, 147.6178),\n (173.7106, 160.6341, 173.7106, 147.6178),\n (173.7106, 160.6341, 154.3684, 160.6341)\n]\n# (orient, text, p1, p2, base) for linear; (orient, text, center, radius, angle) for diameter\nDIMENSIONS = [\n ('horizontal', '95.4545', (117.7686, 161.0555), (104.9417, 161.0555), (111.3552, 150.0555)),\n ('diameter', '%%c427.273', (111.6606, 154.3367), 28.7078, 45),\n ('horizontal', '50', (104.9417, 154.3367), (111.6606, 154.3367), (108.3012, 165.3367)),\n ('vertical', '50', (111.6606, 147.6178), (111.6606, 154.3367), (100.6606, 150.9772)),\n ('horizontal', '97.0754', (104.8328, 147.5894), (117.8775, 147.5894), (111.3552, 158.5894)),\n ('vertical', '97.0754', (117.8775, 147.5894), (117.8775, 160.6341), (106.8775, 154.1117)),\n ('vertical', '0.2114', (104.8328, 147.6178), (104.8328, 147.5894), (115.8328, 147.6036))\n]\n\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; _ds.dxf.dimasz = 2.5\n _ds.dxf.dimexe = 1.25; _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\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\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,\n angle=(0 if d[0] == \"horizontal\" else 90),\n 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,\n 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,\n 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,\n text=text, dimstyle=\"EZDXF\").render()\n\n doc.saveas(out_path)\n\n\nif __name__ == \"__main__\":\n out = sys.argv[1] if len(sys.argv) > 1 else \"0023_00236386_gt.dxf\"\n draw(out)\n print(\"wrote\", out)\n```"}], "images": ["images/0023_00236386.png"], "id": "0023_00236386"} {"messages": [{"role": "user", "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 66.67 x 66.67 mm, featuring a circular hole of diameter 42.11 mm. It is extruded to a thickness of 16.67 mm. A union feature: The part is a square plate 100 x 100 mm, featuring a rectangular cutout 66.32 x 66.32 mm. It is extruded to a thickness of -33.33 mm. A union feature: The part is a square plate 66.67 x 66.67 mm, featuring a circular hole of diameter 42.11 mm. It is extruded to a thickness of -33.33 mm."}, {"role": "assistant", "content": "```python\n#!/usr/bin/env python3\n# -*- coding: utf-8 -*-\n# Ground-truth 2D engineering drawing for part: 0025_00250801\n# Self-contained: reproduces the three-view DXF via ezdxf, NO FreeCAD needed.\n# Coordinates are A4 page millimetres (scale=0.6406666666666965, page=[297.0, 210.0]).\n# visible edges -> solid (layer OUTLINE); hidden edges -> dashed (layer HIDDEN)\n# dimensions -> real movable DIMENSION entities (text = true mm value)\n# Run: python 0025_00250801_gt.py [out.dxf]\nimport sys\nimport ezdxf\nimport math\n\nSCALE = 0.6406666666666965\nPAGE = [297.0, 210.0]\n\nVISIBLE_SEGMENTS = [\n (152.516638, 172.050029, 152.516638, 107.983362),\n (88.449971, 172.050029, 152.516638, 172.050029),\n (152.516638, 107.983362, 88.449971, 107.983362),\n (88.449971, 107.983362, 88.449971, 172.050029),\n (141.83886, 83.305584, 141.83886, 93.983362),\n (99.127749, 83.305584, 99.127749, 93.983362),\n (99.127749, 93.983362, 141.83886, 93.983362),\n (88.449971, 83.305584, 152.516638, 83.305584),\n (152.516638, 83.305584, 152.516638, 61.950029),\n (88.449971, 83.305584, 88.449971, 61.950029),\n (88.449971, 61.950029, 152.516638, 61.950029),\n (177.194416, 161.372251, 166.516638, 161.372251),\n (177.194416, 118.66114, 166.516638, 118.66114),\n (177.194416, 107.983362, 177.194416, 172.050029),\n (166.516638, 118.66114, 166.516638, 161.372251),\n (177.194416, 172.050029, 198.549971, 172.050029),\n (177.194416, 107.983362, 198.549971, 107.983362),\n (198.549971, 107.983362, 198.549971, 172.050029)\n]\nVISIBLE_CIRCLES = [\n (120.7081, 139.7919, 13.487719)\n]\nVISIBLE_ARCS = [\n\n]\nHIDDEN_SEGMENTS = [\n (141.8389, 161.3722, 141.8389, 118.6611),\n (99.1278, 161.3722, 141.8389, 161.3722),\n (141.8389, 118.6611, 99.1278, 118.6611),\n (99.1278, 118.6611, 99.1278, 161.3722),\n (134.1958, 93.9833, 134.1958, 61.95),\n (107.2204, 93.9833, 107.2204, 61.95),\n (166.5167, 126.3042, 198.55, 126.3042),\n (166.5167, 153.2796, 198.55, 153.2796)\n]\n# (orient, text, p1, p2, base) for linear; (orient, text, center, radius, angle) for diameter\nDIMENSIONS = [\n ('horizontal', '66.6667', (141.8389, 118.6611), (99.1278, 118.6611), (120.4833, 107.6611)),\n ('vertical', '66.6667', (141.8389, 161.3722), (141.8389, 118.6611), (152.8389, 140.0167)),\n ('diameter', '%%c42.1053', (120.7081, 139.7919), 13.4877, 45),\n ('vertical', '66.6667', (120.7081, 161.3722), (120.7081, 139.7919), (131.7081, 150.582)),\n ('horizontal', '33.6842', (88.45, 172.05), (152.5167, 172.05), (120.4833, 183.05)),\n ('vertical', '33.6842', (152.5167, 172.05), (152.5167, 107.9833), (163.5167, 140.0167)),\n ('horizontal', '100', (99.1278, 161.3722), (88.45, 161.3722), (93.7889, 150.3722)),\n ('vertical', '100', (88.45, 161.3722), (88.45, 172.05), (77.45, 166.7111)),\n ('horizontal', '16.6667', (99.2402, 161.2598), (141.7265, 161.2598), (120.4833, 172.2598)),\n ('vertical', '16.6667', (99.2402, 161.2598), (99.2402, 118.7735), (110.2402, 140.0167)),\n ('horizontal', '66.3158', (88.45, 161.2598), (99.2402, 161.2598), (93.8451, 172.2598)),\n ('vertical', '66.3158', (99.2402, 172.05), (99.2402, 161.2598), (110.2402, 166.6549)),\n ('horizontal', '16.8421', (99.1278, 161.3722), (141.8389, 161.3722), (120.4833, 172.3722)),\n ('vertical', '16.8421', (141.8389, 161.3722), (141.8389, 118.6611), (152.8389, 140.0167)),\n ('vertical', '0', (99.1278, 161.3722), (99.1278, 161.3722), (99.1278, 161.3722)),\n ('vertical', '66.6667', (99.1278, 161.3722), (99.1278, 161.3722), (99.1278, 161.3722)),\n ('diameter', '%%c42.1053', (120.7081, 139.7919), 13.4877, 135),\n ('horizontal', '16.6667', (177.1944, 161.3722), (166.5166, 161.3722), (171.8555, 150.3722)),\n ('horizontal', '33.3333', (177.1944, 172.05), (198.55, 172.05), (187.8722, 183.05))\n]\n\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; _ds.dxf.dimasz = 2.5\n _ds.dxf.dimexe = 1.25; _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\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\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,\n angle=(0 if d[0] == \"horizontal\" else 90),\n 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,\n 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,\n 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,\n text=text, dimstyle=\"EZDXF\").render()\n\n doc.saveas(out_path)\n\n\nif __name__ == \"__main__\":\n out = sys.argv[1] if len(sys.argv) > 1 else \"0025_00250801_gt.dxf\"\n draw(out)\n print(\"wrote\", out)\n```"}], "images": ["images/0025_00250801.png"], "id": "0025_00250801"} {"messages": [{"role": "user", "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 60 mm. A cut feature: The part is a circular plate with diameter 66.53 mm. It is extruded to a thickness of -60 mm."}, {"role": "assistant", "content": "```python\n#!/usr/bin/env python3\n# -*- coding: utf-8 -*-\n# Ground-truth 2D engineering drawing for part: 0025_00256115\n# Self-contained: reproduces the three-view DXF via ezdxf, NO FreeCAD needed.\n# Coordinates are A4 page millimetres (scale=0.6006250000000263, page=[297.0, 210.0]).\n# visible edges -> solid (layer OUTLINE); hidden edges -> dashed (layer HIDDEN)\n# dimensions -> real movable DIMENSION entities (text = true mm value)\n# Run: python 0025_00256115_gt.py [out.dxf]\nimport sys\nimport ezdxf\nimport math\n\nSCALE = 0.6006250000000263\nPAGE = [297.0, 210.0]\n\nVISIBLE_SEGMENTS = [\n (148.512499, 111.987533, 148.512499, 172.050033),\n (88.449999, 111.987533, 148.512499, 111.987533),\n (148.512499, 172.050033, 88.449999, 172.050033),\n (88.449999, 172.050033, 88.449999, 111.987533),\n (148.512499, 97.987533, 148.512499, 61.950033),\n (148.512499, 61.950033, 88.449999, 61.950033),\n (88.449999, 97.987533, 88.449999, 61.950033),\n (148.512499, 97.987533, 88.449999, 97.987533),\n (162.512499, 111.987533, 198.549999, 111.987533),\n (162.512499, 172.050033, 198.549999, 172.050033),\n (162.512499, 172.050033, 162.512499, 111.987533),\n (198.549999, 172.050033, 198.549999, 111.987533)\n]\nVISIBLE_CIRCLES = [\n (118.4391, 140.0167, 19.978684)\n]\nVISIBLE_ARCS = [\n\n]\nHIDDEN_SEGMENTS = [\n (138.4178, 61.95, 138.4178, 97.9875),\n (98.4604, 97.9875, 98.4604, 61.95),\n (162.5125, 120.038, 198.55, 120.038),\n (162.5125, 159.9954, 198.55, 159.9954)\n]\n# (orient, text, p1, p2, base) for linear; (orient, text, center, radius, angle) for diameter\nDIMENSIONS = [\n ('horizontal', '100', (148.5125, 172.05), (88.45, 172.05), (118.4812, 161.05)),\n ('vertical', '100', (148.5125, 111.9875), (148.5125, 172.05), (137.5125, 142.0187)),\n ('diameter', '%%c66.5263', (118.4391, 140.0167), 19.9787, 45),\n ('horizontal', '49.9299', (88.45, 111.9875), (118.4391, 111.9875), (103.4446, 122.9875)),\n ('vertical', '46.6667', (118.4391, 111.9875), (118.4391, 140.0167), (107.4391, 126.0021)),\n ('horizontal', '60', (162.5125, 111.9875), (198.55, 111.9875), (180.5312, 122.9875)),\n ('horizontal', '60', (198.55, 140.0167), (162.5125, 140.0167), (180.5312, 129.0167))\n]\n\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; _ds.dxf.dimasz = 2.5\n _ds.dxf.dimexe = 1.25; _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\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\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,\n angle=(0 if d[0] == \"horizontal\" else 90),\n 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,\n 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,\n 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,\n text=text, dimstyle=\"EZDXF\").render()\n\n doc.saveas(out_path)\n\n\nif __name__ == \"__main__\":\n out = sys.argv[1] if len(sys.argv) > 1 else \"0025_00256115_gt.dxf\"\n draw(out)\n print(\"wrote\", out)\n```"}], "images": ["images/0025_00256115.png"], "id": "0025_00256115"} {"messages": [{"role": "user", "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": "assistant", "content": "```python\n#!/usr/bin/env python3\n# -*- coding: utf-8 -*-\n# Ground-truth 2D engineering drawing for part: 0028_00283314\n# Self-contained: reproduces the three-view DXF via ezdxf, NO FreeCAD needed.\n# Coordinates are A4 page millimetres (scale=0.577115281501345, page=[297.0, 210.0]).\n# visible edges -> solid (layer OUTLINE); hidden edges -> dashed (layer HIDDEN)\n# dimensions -> real movable DIMENSION entities (text = true mm value)\n# Run: python 0028_00283314_gt.py [out.dxf]\nimport sys\nimport ezdxf\nimport math\n\nSCALE = 0.577115281501345\nPAGE = [297.0, 210.0]\n\nVISIBLE_SEGMENTS = [\n (101.361344, 172.049966, 136.037447, 172.049966),\n (83.654398, 141.8006, 101.361344, 172.049966),\n (136.037447, 172.049966, 153.744393, 141.8006),\n (153.744393, 141.8006, 136.037447, 111.551234),\n (136.037447, 111.551234, 101.361344, 111.551234),\n (101.361344, 111.551234, 83.654398, 141.8006),\n (83.654398, 61.949966, 83.654398, 85.684145),\n (153.744393, 61.949966, 153.744393, 85.684145),\n (153.744393, 61.949966, 136.037447, 61.949966),\n (136.037447, 61.949966, 101.361344, 61.949966),\n (101.361344, 61.949966, 83.654398, 61.949966),\n (153.744393, 85.684145, 136.037447, 85.684145),\n (136.037447, 85.684145, 101.361344, 85.684145),\n (101.361344, 85.684145, 83.654398, 85.684145),\n (101.361344, 61.949966, 101.361344, 85.684145),\n (136.037447, 61.949966, 136.037447, 85.684145),\n (148.041164, 85.684145, 148.041164, 97.551234),\n (148.041164, 97.551234, 146.237679, 97.551234),\n (146.237679, 97.551234, 144.434194, 97.551234),\n (144.434194, 97.551234, 142.630708, 97.551234),\n (142.630708, 97.551234, 140.827223, 97.551234),\n (140.827223, 97.551234, 139.023738, 97.551234),\n (139.023738, 97.551234, 137.220253, 97.551234),\n (137.220253, 97.551234, 135.416767, 97.551234),\n (135.416767, 97.551234, 133.613282, 97.551234),\n (133.613282, 97.551234, 131.809797, 97.551234),\n (131.809797, 97.551234, 130.006312, 97.551234),\n (130.006312, 97.551234, 128.202826, 97.551234),\n (128.202826, 97.551234, 126.399341, 97.551234),\n (126.399341, 97.551234, 124.595856, 97.551234),\n (124.595856, 97.551234, 122.792371, 97.551234),\n (122.792371, 97.551234, 120.988885, 97.551234),\n (120.988885, 97.551234, 119.1854, 97.551234),\n (119.1854, 97.551234, 117.381915, 97.551234),\n (117.381915, 97.551234, 115.578429, 97.551234),\n (115.578429, 97.551234, 113.774944, 97.551234),\n (113.774944, 97.551234, 111.971459, 97.551234),\n (111.971459, 97.551234, 110.167974, 97.551234),\n (110.167974, 97.551234, 108.364488, 97.551234),\n (108.364488, 97.551234, 106.561003, 97.551234),\n (106.561003, 97.551234, 104.757518, 97.551234),\n (104.757518, 97.551234, 102.954033, 97.551234),\n (102.954033, 97.551234, 101.150547, 97.551234),\n (101.150547, 97.551234, 99.347062, 97.551234),\n (99.347062, 97.551234, 97.543577, 97.551234),\n (97.543577, 97.551234, 95.740092, 97.551234),\n (95.740092, 97.551234, 93.936606, 97.551234),\n (93.936606, 97.551234, 92.133121, 97.551234),\n (92.133121, 97.551234, 90.329636, 97.551234),\n (90.329636, 97.551234, 90.329636, 85.684145),\n (167.744393, 172.049966, 191.478572, 172.049966),\n (167.744393, 141.8006, 191.478572, 141.8006),\n (191.478572, 141.8006, 191.478572, 172.049966),\n (167.744393, 141.8006, 167.744393, 172.049966),\n (167.744393, 111.551234, 167.744393, 141.8006),\n (191.478572, 111.551234, 191.478572, 141.8006),\n (167.744393, 111.551234, 191.478572, 111.551234),\n (203.345661, 112.944836, 203.345661, 114.748321),\n (203.345661, 114.748321, 203.345661, 116.551806),\n (203.345661, 116.551806, 203.345661, 118.355292),\n (203.345661, 118.355292, 203.345661, 120.158777),\n (203.345661, 120.158777, 203.345661, 121.962262),\n (203.345661, 121.962262, 203.345661, 123.765747),\n (203.345661, 123.765747, 203.345661, 125.569233),\n (203.345661, 125.569233, 203.345661, 127.372718),\n (203.345661, 127.372718, 203.345661, 129.176203),\n (203.345661, 129.176203, 203.345661, 130.979688),\n (203.345661, 130.979688, 203.345661, 132.783174),\n (203.345661, 132.783174, 203.345661, 134.586659),\n (203.345661, 134.586659, 203.345661, 136.390144),\n (203.345661, 136.390144, 203.345661, 138.193629),\n (203.345661, 138.193629, 203.345661, 139.997115),\n (203.345661, 139.997115, 203.345661, 141.8006),\n (203.345661, 141.8006, 203.345661, 143.604085),\n (203.345661, 143.604085, 203.345661, 145.407571),\n (203.345661, 145.407571, 203.345661, 147.211056),\n (203.345661, 147.211056, 203.345661, 149.014541),\n (203.345661, 149.014541, 203.345661, 150.818026),\n (203.345661, 150.818026, 203.345661, 152.621512),\n (203.345661, 152.621512, 203.345661, 154.424997),\n (203.345661, 154.424997, 203.345661, 156.228482),\n (203.345661, 156.228482, 203.345661, 158.031967),\n (203.345661, 158.031967, 203.345661, 159.835453),\n (203.345661, 159.835453, 203.345661, 161.638938),\n (203.345661, 161.638938, 203.345661, 163.442423),\n (203.345661, 163.442423, 203.345661, 165.245908),\n (203.345661, 165.245908, 203.345661, 167.049394),\n (203.345661, 167.049394, 203.345661, 168.852879),\n (203.345661, 168.852879, 203.345661, 170.656364),\n (203.345661, 112.944836, 191.478572, 112.944836),\n (203.345661, 170.656364, 191.478572, 170.656364)\n]\nVISIBLE_CIRCLES = [\n (119.1854, 141.8006, 28.855764)\n]\nVISIBLE_ARCS = [\n\n]\nHIDDEN_SEGMENTS = [\n\n]\n# (orient, text, p1, p2, base) for linear; (orient, text, center, radius, angle) for diameter\nDIMENSIONS = [\n ('horizontal', '60.0852', (101.3613, 111.5513), (136.0374, 111.5513), (118.6994, 122.5513)),\n ('aligned', '60.7345', (136.0374, 111.5513), (153.7443, 141.8006), (135.3977, 132.2329)),\n ('aligned', '60.7345', (153.7443, 141.8006), (136.0374, 172.05), (135.3977, 151.3684)),\n ('aligned', '60.7345', (101.3613, 172.05), (83.6544, 141.8006), (102.001, 151.3684)),\n ('aligned', '60.7345', (83.6544, 141.8006), (101.3613, 111.5513), (102.001, 132.2329)),\n ('diameter', '%%c100', (119.1854, 141.8006), 28.8558, 45),\n ('horizontal', '41.1255', (167.7444, 111.5513), (191.4785, 111.5513), (179.6114, 122.5513)),\n ('horizontal', '20.5628', (191.4785, 141.8006), (203.3456, 141.8006), (197.4121, 152.8006))\n]\n\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; _ds.dxf.dimasz = 2.5\n _ds.dxf.dimexe = 1.25; _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\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\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,\n angle=(0 if d[0] == \"horizontal\" else 90),\n 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,\n 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,\n 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,\n text=text, dimstyle=\"EZDXF\").render()\n\n doc.saveas(out_path)\n\n\nif __name__ == \"__main__\":\n out = sys.argv[1] if len(sys.argv) > 1 else \"0028_00283314_gt.dxf\"\n draw(out)\n print(\"wrote\", out)\n```"}], "images": ["images/0028_00283314.png"], "id": "0028_00283314"} {"messages": [{"role": "user", "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 45.26 mm tall. It is extruded to a thickness of -4.17 mm. A union feature: The part is a rectangular plate 100 mm wide and 2.11 mm tall. It is extruded to a thickness of -4.17 mm. A cut feature: The part is a rectangular plate 100 mm wide and 2.11 mm tall. It is extruded to a thickness of -2.08 mm. A cut feature: The part is a circular plate with diameter 0.53 mm. It is extruded to a thickness of -2.08 mm. A cut feature: The part is a circular plate with diameter 0.53 mm. It is extruded to a thickness of -2.08 mm. A cut feature: The part is a circular plate with diameter 0.53 mm. It is extruded to a thickness of -2.08 mm. A cut feature: The part is a circular plate with diameter 0.53 mm. It is extruded to a thickness of -2.08 mm. A cut feature: The part is a circular plate with diameter 0.53 mm. It is extruded to a thickness of -2.08 mm. A cut feature: The part is a circular plate with diameter 0.53 mm. It is extruded to a thickness of -2.08 mm."}, {"role": "assistant", "content": "```python\n#!/usr/bin/env python3\n# -*- coding: utf-8 -*-\n# Ground-truth 2D engineering drawing for part: 0029_00293423\n# Self-contained: reproduces the three-view DXF via ezdxf, NO FreeCAD needed.\n# Coordinates are A4 page millimetres (scale=0.6545177551249013, page=[297.0, 210.0]).\n# visible edges -> solid (layer OUTLINE); hidden edges -> dashed (layer HIDDEN)\n# dimensions -> real movable DIMENSION entities (text = true mm value)\n# Run: python 0029_00293423_gt.py [out.dxf]\nimport sys\nimport ezdxf\nimport math\n\nSCALE = 0.6545177551249013\nPAGE = [297.0, 210.0]\n\nVISIBLE_SEGMENTS = [\n (167.86048, 110.039472, 167.86048, 111.417404),\n (167.86048, 140.687697, 167.86048, 111.417404),\n (102.408704, 111.417404, 102.408704, 110.039472),\n (102.408704, 110.039472, 167.86048, 110.039472),\n (167.86048, 111.417404, 102.408704, 111.417404),\n (102.408704, 140.687697, 102.408704, 111.417404),\n (167.86048, 140.687697, 102.408704, 140.687697),\n (167.86048, 93.312315, 167.86048, 96.039472),\n (167.86048, 96.039472, 102.408704, 96.039472),\n (167.86048, 93.312315, 102.408704, 93.312315),\n (102.408704, 93.312315, 102.408704, 96.039472),\n (183.224058, 111.417404, 183.224058, 110.039472),\n (183.224058, 110.039472, 181.86048, 110.039472),\n (184.587637, 111.417404, 183.224058, 111.417404),\n (181.86048, 110.039472, 181.86048, 140.687697),\n (184.587637, 140.687697, 184.587637, 111.417404),\n (184.587637, 140.687697, 181.86048, 140.687697)\n]\nVISIBLE_CIRCLES = [\n (183.3963, 115.493787, 0.172242),\n (183.3963, 139.356413, 0.172242),\n (183.3963, 127.4251, 0.172242)\n]\nVISIBLE_ARCS = [\n\n]\nHIDDEN_SEGMENTS = [\n (166.4987, 115.666, 166.4987, 115.3215),\n (166.4987, 127.5973, 166.4987, 127.2529),\n (166.4987, 139.5286, 166.4987, 139.1842),\n (103.7741, 115.666, 103.7741, 115.3215),\n (103.7741, 139.5286, 103.7741, 139.1842),\n (103.7741, 127.5973, 103.7741, 127.2529),\n (166.4987, 115.3215, 167.8623, 115.3215),\n (166.4987, 115.666, 167.8623, 115.666),\n (166.4987, 127.2529, 167.8623, 127.2529),\n (166.4987, 127.5973, 167.8623, 127.5973),\n (166.4987, 139.1842, 167.8623, 139.1842),\n (166.4987, 139.5286, 167.8623, 139.5286),\n (103.7741, 115.666, 102.4105, 115.666),\n (103.7741, 115.3215, 102.4105, 115.3215),\n (103.7741, 139.5286, 102.4105, 139.5286),\n (103.7741, 139.1842, 102.4105, 139.1842),\n (103.7741, 127.5973, 102.4105, 127.5973),\n (103.7741, 127.2529, 102.4105, 127.2529),\n (167.8623, 94.6759, 102.4105, 94.6759),\n (167.8623, 94.6795, 166.4987, 94.6795),\n (166.4987, 94.6795, 166.4987, 94.335),\n (102.4105, 94.3314, 103.7741, 94.3314),\n (103.7741, 94.3314, 103.7741, 94.6759),\n (166.4987, 94.335, 167.8623, 94.335),\n (103.7741, 94.6759, 102.4105, 94.6759)\n]\n# (orient, text, p1, p2, base) for linear; (orient, text, center, radius, angle) for diameter\nDIMENSIONS = [\n ('horizontal', '100', (167.8623, 140.6877), (102.4105, 140.6877), (135.1364, 129.6877)),\n ('vertical', '0.5263', (167.8623, 110.0395), (167.8623, 111.4174), (156.8623, 110.7284)),\n ('vertical', '0.5263', (102.4105, 111.0622), (102.4105, 110.0395), (113.4105, 110.5508)),\n ('diameter', '%%c0.5263', (183.3981, 139.3564), 0.1722, 45),\n ('diameter', '%%c0.5263', (183.3981, 115.4938), 0.1722, 45),\n ('vertical', '18.2292', (184.5895, 111.0622), (184.5895, 115.4938), (173.5895, 113.278)),\n ('diameter', '%%c0.5263', (183.3981, 127.4251), 0.1722, 45),\n ('diameter', '%%c0.5263', (183.3945, 139.3564), 0.1722, 135),\n ('vertical', '43.2291', (184.5895, 111.0622), (184.5895, 139.3564), (173.5895, 125.2093)),\n ('diameter', '%%c0.5263', (183.3945, 127.4251), 0.1722, 135),\n ('vertical', '43.2291', (184.5895, 111.0622), (184.5895, 111.0622), (184.5895, 111.0622)),\n ('vertical', '6.7708', (184.5895, 111.0622), (184.5895, 127.4251), (173.5895, 119.2436)),\n ('diameter', '%%c0.5263', (183.3945, 115.4938), 0.1722, 135),\n ('vertical', '25', (184.5895, 111.0622), (184.5895, 111.0622), (184.5895, 111.0622)),\n ('horizontal', '100', (102.4105, 94.5037), (103.7741, 94.5037), (103.0923, 105.5037)),\n ('horizontal', '2.0833', (167.8623, 94.5073), (166.4988, 94.5073), (167.1805, 83.5073)),\n ('horizontal', '2.0833', (167.8623, 94.5073), (166.4988, 94.5073), (167.1805, 83.5073)),\n ('horizontal', '2.0833', (167.8623, 94.5073), (166.4988, 94.5073), (167.1805, 83.5073))\n]\n\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; _ds.dxf.dimasz = 2.5\n _ds.dxf.dimexe = 1.25; _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\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\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,\n angle=(0 if d[0] == \"horizontal\" else 90),\n 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,\n 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,\n 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,\n text=text, dimstyle=\"EZDXF\").render()\n\n doc.saveas(out_path)\n\n\nif __name__ == \"__main__\":\n out = sys.argv[1] if len(sys.argv) > 1 else \"0029_00293423_gt.dxf\"\n draw(out)\n print(\"wrote\", out)\n```"}], "images": ["images/0029_00293423.png"], "id": "0029_00293423"} {"messages": [{"role": "user", "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 13.54 mm. The outline includes one or more oblique (angled) edges. A union feature: The part is a rectangular plate 17.96 mm wide and 65.62 mm tall. It is extruded to a thickness of 13.54 mm. A union feature: The part is a circular plate with diameter 46.38 mm. It is extruded to a thickness of 2.08 mm."}, {"role": "assistant", "content": "```python\n#!/usr/bin/env python3\n# -*- coding: utf-8 -*-\n# Ground-truth 2D engineering drawing for part: 0032_00328177\n# Self-contained: reproduces the three-view DXF via ezdxf, NO FreeCAD needed.\n# Coordinates are A4 page millimetres (scale=0.4532878200155015, page=[297.0, 210.0]).\n# visible edges -> solid (layer OUTLINE); hidden edges -> dashed (layer HIDDEN)\n# dimensions -> real movable DIMENSION entities (text = true mm value)\n# Run: python 0032_00328177_gt.py [out.dxf]\nimport sys\nimport ezdxf\nimport math\n\nSCALE = 0.4532878200155015\nPAGE = [297.0, 210.0]\n\nVISIBLE_SEGMENTS = [\n (130.918424, 139.171735, 130.918424, 100.990188),\n (136.972202, 139.171735, 136.315196, 139.171735),\n (136.315196, 139.171735, 135.65819, 139.171735),\n (135.65819, 139.171735, 135.001183, 139.171735),\n (135.001183, 139.171735, 134.344177, 139.171735),\n (134.344177, 139.171735, 133.68717, 139.171735),\n (133.68717, 139.171735, 133.030164, 139.171735),\n (133.030164, 139.171735, 132.373158, 139.171735),\n (132.373158, 139.171735, 131.716151, 139.171735),\n (131.716151, 139.171735, 131.059145, 139.171735),\n (131.059145, 139.171735, 130.402138, 139.171735),\n (130.402138, 139.171735, 129.745132, 139.171735),\n (129.745132, 139.171735, 129.088126, 139.171735),\n (129.088126, 139.171735, 128.431119, 139.171735),\n (128.431119, 139.171735, 127.774113, 139.171735),\n (127.774113, 139.171735, 127.117106, 139.171735),\n (127.117106, 139.171735, 126.4601, 139.171735),\n (126.4601, 139.171735, 125.803094, 139.171735),\n (125.803094, 139.171735, 125.146087, 139.171735),\n (125.146087, 139.171735, 124.489081, 139.171735),\n (124.489081, 139.171735, 123.832074, 139.171735),\n (123.832074, 139.171735, 123.175068, 139.171735),\n (123.175068, 139.171735, 122.518062, 139.171735),\n (122.518062, 139.171735, 121.861055, 139.171735),\n (121.861055, 139.171735, 121.204049, 139.171735),\n (121.204049, 139.171735, 120.547042, 139.171735),\n (120.547042, 139.171735, 119.890036, 139.171735),\n (119.890036, 139.171735, 119.23303, 139.171735),\n (119.23303, 139.171735, 118.576023, 139.171735),\n (118.576023, 139.171735, 117.919017, 139.171735),\n (117.919017, 139.171735, 117.26201, 139.171735),\n (117.26201, 139.171735, 116.605004, 139.171735),\n (116.605004, 139.171735, 115.947998, 139.171735),\n (130.918424, 100.990188, 122.806958, 94.787302),\n (122.806958, 139.171735, 122.806958, 94.787302),\n (136.972202, 140.116084, 136.972202, 139.171735),\n (136.972202, 140.116084, 136.972202, 141.060434),\n (136.972202, 141.060434, 136.315196, 141.060434),\n (136.315196, 141.060434, 135.65819, 141.060434),\n (135.65819, 141.060434, 135.001183, 141.060434),\n (135.001183, 141.060434, 134.344177, 141.060434),\n (134.344177, 141.060434, 133.68717, 141.060434),\n (133.68717, 141.060434, 133.030164, 141.060434),\n (133.030164, 141.060434, 132.373158, 141.060434),\n (132.373158, 141.060434, 131.716151, 141.060434),\n (131.716151, 141.060434, 131.059145, 141.060434),\n (131.059145, 141.060434, 130.402138, 141.060434),\n (130.402138, 141.060434, 129.745132, 141.060434),\n (129.745132, 141.060434, 129.088126, 141.060434),\n (129.088126, 141.060434, 128.431119, 141.060434),\n (128.431119, 141.060434, 127.774113, 141.060434),\n (127.774113, 141.060434, 127.117106, 141.060434),\n (127.117106, 141.060434, 126.4601, 141.060434),\n (126.4601, 141.060434, 125.803094, 141.060434),\n (125.803094, 141.060434, 125.146087, 141.060434),\n (125.146087, 141.060434, 124.489081, 141.060434),\n (124.489081, 141.060434, 123.832074, 141.060434),\n (123.832074, 141.060434, 123.175068, 141.060434),\n (123.175068, 141.060434, 122.518062, 141.060434),\n (122.518062, 141.060434, 121.861055, 141.060434),\n (121.861055, 141.060434, 121.204049, 141.060434),\n (121.204049, 141.060434, 120.547042, 141.060434),\n (120.547042, 141.060434, 119.890036, 141.060434),\n (119.890036, 141.060434, 119.23303, 141.060434),\n (119.23303, 141.060434, 118.576023, 141.060434),\n (118.576023, 141.060434, 117.919017, 141.060434),\n (117.919017, 141.060434, 117.26201, 141.060434),\n (117.26201, 141.060434, 116.605004, 141.060434),\n (116.605004, 141.060434, 115.947998, 141.060434),\n (130.948246, 169.863098, 130.948246, 141.060434),\n (122.806958, 169.863098, 122.806958, 141.060434),\n (122.806958, 169.863098, 130.948246, 169.863098),\n (115.947998, 139.171735, 115.947998, 140.116084),\n (115.947998, 141.060434, 115.947998, 140.116084),\n (130.948246, 76.885647, 130.948246, 64.609102),\n (122.806958, 64.609102, 130.948246, 64.609102),\n (122.806958, 76.885647, 122.806958, 64.609102),\n (122.806958, 76.885647, 130.948246, 76.885647),\n (171.996407, 139.171735, 171.339401, 139.171735),\n (171.339401, 139.171735, 170.682395, 139.171735),\n (170.682395, 139.171735, 170.025388, 139.171735),\n (170.025388, 139.171735, 169.368382, 139.171735),\n (169.368382, 139.171735, 168.711375, 139.171735),\n (168.711375, 139.171735, 168.054369, 139.171735),\n (168.054369, 139.171735, 167.397363, 139.171735),\n (167.397363, 139.171735, 166.740356, 139.171735),\n (166.740356, 139.171735, 166.08335, 139.171735),\n (166.08335, 139.171735, 165.426343, 139.171735),\n (165.426343, 139.171735, 164.769337, 139.171735),\n (164.769337, 139.171735, 164.112331, 139.171735),\n (164.112331, 139.171735, 163.455324, 139.171735),\n (163.455324, 139.171735, 162.798318, 139.171735),\n (162.798318, 139.171735, 162.141311, 139.171735),\n (162.141311, 139.171735, 161.484305, 139.171735),\n (161.484305, 139.171735, 160.827299, 139.171735),\n (160.827299, 139.171735, 160.170292, 139.171735),\n (160.170292, 139.171735, 159.513286, 139.171735),\n (159.513286, 139.171735, 158.856279, 139.171735),\n (158.856279, 139.171735, 158.199273, 139.171735),\n (158.199273, 139.171735, 157.542267, 139.171735),\n (157.542267, 139.171735, 156.88526, 139.171735),\n (156.88526, 139.171735, 156.228254, 139.171735),\n (156.228254, 139.171735, 155.571247, 139.171735),\n (155.571247, 139.171735, 154.914241, 139.171735),\n (154.914241, 139.171735, 154.257235, 139.171735),\n (154.257235, 139.171735, 153.600228, 139.171735),\n (153.600228, 139.171735, 152.943222, 139.171735),\n (152.943222, 139.171735, 152.286215, 139.171735),\n (152.286215, 139.171735, 151.629209, 139.171735),\n (151.629209, 139.171735, 150.972203, 139.171735),\n (167.150403, 139.171735, 167.150403, 94.787302),\n (167.150403, 94.787302, 154.873858, 94.787302),\n (154.873858, 94.787302, 154.873858, 139.171735),\n (171.996407, 141.060434, 171.339401, 141.060434),\n (171.339401, 141.060434, 170.682395, 141.060434),\n (170.682395, 141.060434, 170.025388, 141.060434),\n (170.025388, 141.060434, 169.368382, 141.060434),\n (169.368382, 141.060434, 168.711375, 141.060434),\n (168.711375, 141.060434, 168.054369, 141.060434),\n (168.054369, 141.060434, 167.397363, 141.060434),\n (167.397363, 141.060434, 166.740356, 141.060434),\n (166.740356, 141.060434, 166.08335, 141.060434),\n (166.08335, 141.060434, 165.426343, 141.060434),\n (165.426343, 141.060434, 164.769337, 141.060434),\n (164.769337, 141.060434, 164.112331, 141.060434),\n (164.112331, 141.060434, 163.455324, 141.060434),\n (163.455324, 141.060434, 162.798318, 141.060434),\n (162.798318, 141.060434, 162.141311, 141.060434),\n (162.141311, 141.060434, 161.484305, 141.060434),\n (161.484305, 141.060434, 160.827299, 141.060434),\n (160.827299, 141.060434, 160.170292, 141.060434),\n (160.170292, 141.060434, 159.513286, 141.060434),\n (159.513286, 141.060434, 158.856279, 141.060434),\n (158.856279, 141.060434, 158.199273, 141.060434),\n (158.199273, 141.060434, 157.542267, 141.060434),\n (157.542267, 141.060434, 156.88526, 141.060434),\n (156.88526, 141.060434, 156.228254, 141.060434),\n (156.228254, 141.060434, 155.571247, 141.060434),\n (155.571247, 141.060434, 154.914241, 141.060434),\n (154.914241, 141.060434, 154.257235, 141.060434),\n (154.257235, 141.060434, 153.600228, 141.060434),\n (153.600228, 141.060434, 152.943222, 141.060434),\n (152.943222, 141.060434, 152.286215, 141.060434),\n (152.286215, 141.060434, 151.629209, 141.060434),\n (151.629209, 141.060434, 150.972203, 141.060434),\n (167.150403, 169.863098, 167.150403, 141.060434),\n (154.873858, 141.060434, 154.873858, 169.863098),\n (154.873858, 169.863098, 167.150403, 169.863098),\n (171.996407, 139.171735, 171.996407, 140.116084),\n (150.972203, 139.171735, 150.972203, 140.116084),\n (150.972203, 141.060434, 150.972203, 140.116084),\n (171.996407, 141.060434, 171.996407, 140.116084)\n]\nVISIBLE_CIRCLES = [\n (126.4601, 70.2752, 10.512102)\n]\nVISIBLE_ARCS = [\n\n]\nHIDDEN_SEGMENTS = [\n (167.1504, 100.9902, 154.8738, 100.9902)\n]\n# (orient, text, p1, p2, base) for linear; (orient, text, center, radius, angle) for diameter\nDIMENSIONS = [\n ('aligned', '22.5273', (130.9184, 100.9902), (122.8069, 94.7873), (133.5446, 89.1508)),\n ('horizontal', '17.9605', (122.8069, 169.8631), (130.9482, 169.8631), (126.8776, 180.8631)),\n ('vertical', '65.625', (130.9482, 169.8631), (130.9482, 140.1161), (141.9482, 154.9896)),\n ('vertical', '0', (122.8069, 140.1161), (122.8069, 140.1161), (122.8069, 140.1161)),\n ('vertical', '65.625', (122.8069, 140.1161), (122.8069, 169.8631), (111.8069, 154.9896)),\n ('horizontal', '27.0833', (167.1504, 169.8631), (154.8738, 169.8631), (161.0121, 158.8631)),\n ('diameter', '%%c46.3816', (126.4601, 70.2752), 10.5121, 45)\n]\n\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; _ds.dxf.dimasz = 2.5\n _ds.dxf.dimexe = 1.25; _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\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\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,\n angle=(0 if d[0] == \"horizontal\" else 90),\n 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,\n 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,\n 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,\n text=text, dimstyle=\"EZDXF\").render()\n\n doc.saveas(out_path)\n\n\nif __name__ == \"__main__\":\n out = sys.argv[1] if len(sys.argv) > 1 else \"0032_00328177_gt.dxf\"\n draw(out)\n print(\"wrote\", out)\n```"}], "images": ["images/0032_00328177.png"], "id": "0032_00328177"} {"messages": [{"role": "user", "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 31.58 mm tall. It is extruded to a thickness of 53.13 mm. A cut feature: The part is a rectangular plate 94.79 mm wide and 47.89 mm tall. It is extruded to a thickness of -26.04 mm. A cut feature: The part is a circular plate with diameter 3.16 mm. It is extruded to a thickness of -78.12 mm. A cut feature: The part is a circular plate with diameter 3.16 mm. It is extruded to a thickness of -78.12 mm."}, {"role": "assistant", "content": "```python\n#!/usr/bin/env python3\n# -*- coding: utf-8 -*-\n# Ground-truth 2D engineering drawing for part: 0034_00343807\n# Self-contained: reproduces the three-view DXF via ezdxf, NO FreeCAD needed.\n# Coordinates are A4 page millimetres (scale=1.1167440000000004, page=[297.0, 210.0]).\n# visible edges -> solid (layer OUTLINE); hidden edges -> dashed (layer HIDDEN)\n# dimensions -> real movable DIMENSION entities (text = true mm value)\n# Run: python 0034_00343807_gt.py [out.dxf]\nimport sys\nimport ezdxf\nimport math\n\nSCALE = 1.1167440000000004\nPAGE = [297.0, 210.0]\n\nVISIBLE_SEGMENTS = [\n (162.673645, 171.29625, 162.673645, 136.03065),\n (50.999245, 171.29625, 162.673645, 171.29625),\n (162.673645, 136.03065, 50.999245, 136.03065),\n (50.999245, 136.03065, 50.999245, 171.29625),\n (162.673645, 62.703625, 162.673645, 122.03065),\n (50.999245, 62.703625, 50.999245, 122.03065),\n (50.999245, 122.03065, 162.673645, 122.03065),\n (50.999245, 62.703625, 162.673645, 62.703625),\n (236.00067, 171.29625, 176.673645, 171.29625),\n (236.00067, 136.03065, 176.673645, 136.03065),\n (236.00067, 136.03065, 236.00067, 171.29625),\n (176.673645, 136.03065, 176.673645, 171.29625)\n]\nVISIBLE_CIRCLES = [\n (74.86475, 159.6635, 1.76328),\n (140.00815, 159.6635, 1.76328)\n]\nVISIBLE_ARCS = [\n\n]\nHIDDEN_SEGMENTS = [\n (54.4891, 171.2963, 53.7754, 142.2232),\n (160.2834, 168.6992, 159.5697, 139.6261),\n (161.5956, 168.667, 160.8819, 139.5939),\n (55.8013, 171.2641, 55.0876, 142.191),\n (55.0876, 142.191, 53.7754, 142.2232),\n (160.2834, 168.6992, 161.5956, 168.667),\n (159.5697, 139.6261, 160.8819, 139.5939),\n (53.7754, 142.2232, 55.0876, 142.191),\n (55.0876, 142.191, 159.5697, 139.6261),\n (160.8819, 139.5939, 159.5697, 139.6261),\n (55.8013, 171.2641, 160.2834, 168.6992),\n (161.5956, 168.667, 160.2834, 168.6992),\n (76.6281, 65.6432, 73.1015, 65.7297),\n (73.1015, 65.7297, 76.6281, 65.6432),\n (76.6281, 65.6432, 76.6281, 62.7037),\n (141.7715, 64.0445, 138.2449, 64.131),\n (138.2449, 64.131, 141.7715, 64.0445),\n (141.7715, 64.0445, 141.7715, 62.7037),\n (76.6281, 122.0307, 76.6281, 119.1455),\n (76.6281, 119.1455, 73.1015, 119.232),\n (73.1015, 119.232, 76.6281, 119.1455),\n (141.7715, 122.0307, 141.7715, 117.5468),\n (141.7715, 117.5468, 138.2449, 117.6333),\n (138.2449, 117.6333, 141.7715, 117.5468),\n (54.4891, 66.1935, 53.7754, 66.1935),\n (53.7754, 66.1935, 159.5697, 63.5956),\n (160.2834, 63.5956, 159.5697, 63.5956),\n (54.4891, 66.1935, 160.2834, 63.5956),\n (161.5956, 117.0657, 160.8819, 117.0657),\n (160.8819, 117.0657, 55.0876, 119.6636),\n (55.8013, 119.6636, 55.0876, 119.6636),\n (161.5956, 117.0657, 55.8013, 119.6636),\n (55.0876, 119.6636, 53.7754, 66.1935),\n (55.8013, 119.6636, 54.4891, 66.1935),\n (160.2834, 63.5956, 161.5956, 117.0657),\n (159.5697, 63.5956, 160.8819, 117.0657),\n (73.1015, 62.7037, 73.1015, 65.7297),\n (138.2449, 62.7037, 138.2449, 64.131),\n (73.1015, 119.232, 73.1015, 122.0307),\n (138.2449, 117.6333, 138.2449, 122.0307),\n (233.0612, 159.6636, 233.0169, 161.4268),\n (233.0169, 161.4268, 233.019, 157.9003),\n (233.019, 157.9003, 233.0612, 159.6636),\n (234.6599, 159.6636, 234.6156, 161.4268),\n (234.6156, 161.4268, 234.6177, 157.9003),\n (234.6177, 157.9003, 234.6599, 159.6636),\n (179.5589, 159.6636, 179.5167, 157.9003),\n (179.5167, 157.9003, 179.5146, 161.4268),\n (179.5146, 161.4268, 179.5589, 159.6636),\n (181.1576, 159.6636, 181.1154, 157.9003),\n (181.1154, 157.9003, 181.1133, 161.4268),\n (181.1133, 161.4268, 181.1576, 159.6636),\n (232.5109, 171.2963, 232.5109, 142.2232),\n (232.5109, 142.2232, 235.1088, 139.6261),\n (235.1088, 168.6992, 235.1088, 139.6261),\n (232.5109, 171.2963, 235.1088, 168.6992),\n (181.6387, 168.667, 181.6387, 139.5939),\n (181.6387, 139.5939, 179.0408, 142.191),\n (179.0408, 171.2641, 179.0408, 142.191),\n (181.6387, 168.667, 179.0408, 171.2641),\n (179.0408, 142.191, 232.5109, 142.2232),\n (235.1088, 168.6992, 181.6387, 168.667),\n (235.1088, 139.6261, 181.6387, 139.5939),\n (236.0007, 161.4268, 233.0169, 161.4268),\n (236.0007, 157.9003, 233.019, 157.9003),\n (181.1133, 161.4268, 176.6737, 161.4268),\n (181.1154, 157.9003, 176.6737, 157.9003)\n]\n# (orient, text, p1, p2, base) for linear; (orient, text, center, radius, angle) for diameter\nDIMENSIONS = [\n ('horizontal', '100', (162.6737, 136.0308), (50.9993, 136.0308), (106.8365, 125.0308)),\n ('vertical', '31.5789', (162.6737, 171.2963), (162.6737, 136.0308), (173.6737, 153.6635)),\n ('diameter', '%%c3.1579', (74.8648, 159.6635), 1.7633, 45),\n ('horizontal', '0.6391', (50.9993, 171.2963), (74.8648, 171.2963), (62.932, 182.2963)),\n ('vertical', '26.0338', (74.8648, 171.2963), (74.8648, 159.6635), (85.8648, 165.4799)),\n ('diameter', '%%c3.1579', (140.0081, 159.6635), 1.7633, 45),\n ('horizontal', '0.6391', (50.9993, 171.2963), (140.0081, 171.2963), (95.5037, 182.2963)),\n ('vertical', '26.0338', (140.0081, 171.2963), (140.0081, 159.6635), (151.0081, 165.4799)),\n ('horizontal', '53.125', (236.0007, 171.2963), (176.6737, 171.2963), (206.3372, 160.2963)),\n ('vertical', '26.0417', (235.1088, 168.6992), (235.1088, 139.6261), (246.1088, 154.1627)),\n ('horizontal', '1.4694', (176.6737, 159.6635), (263.9193, 159.6635), (220.2965, 170.6635)),\n ('aligned', '3.1588', (54.4891, 66.1935), (160.2834, 63.5956), (107.6563, 75.8913)),\n ('aligned', '58.3457', (160.2834, 63.5956), (161.5956, 117.0657), (149.9428, 90.6005))\n]\n\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; _ds.dxf.dimasz = 2.5\n _ds.dxf.dimexe = 1.25; _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\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\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,\n angle=(0 if d[0] == \"horizontal\" else 90),\n 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,\n 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,\n 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,\n text=text, dimstyle=\"EZDXF\").render()\n\n doc.saveas(out_path)\n\n\nif __name__ == \"__main__\":\n out = sys.argv[1] if len(sys.argv) > 1 else \"0034_00343807_gt.dxf\"\n draw(out)\n print(\"wrote\", out)\n```"}], "images": ["images/0034_00343807.png"], "id": "0034_00343807"} {"messages": [{"role": "user", "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 83.16 mm tall. It is extruded to a thickness of 8.33 mm. A cut feature: The part is a circular plate with diameter 3.16 mm. It is extruded to a thickness of -16.67 mm. A cut feature: The part is a circular plate with diameter 3.16 mm. It is extruded to a thickness of -16.67 mm. A cut feature: The part is a circular plate with diameter 3.16 mm. It is extruded to a thickness of -16.67 mm. A cut feature: The part is a circular plate with diameter 3.16 mm. It is extruded to a thickness of -16.67 mm."}, {"role": "assistant", "content": "```python\n#!/usr/bin/env python3\n# -*- coding: utf-8 -*-\n# Ground-truth 2D engineering drawing for part: 0034_00349497\n# Self-contained: reproduces the three-view DXF via ezdxf, NO FreeCAD needed.\n# Coordinates are A4 page millimetres (scale=0.8022586206896861, page=[297.0, 210.0]).\n# visible edges -> solid (layer OUTLINE); hidden edges -> dashed (layer HIDDEN)\n# dimensions -> real movable DIMENSION entities (text = true mm value)\n# Run: python 0034_00349497_gt.py [out.dxf]\nimport sys\nimport ezdxf\nimport math\n\nSCALE = 0.8022586206896861\nPAGE = [297.0, 210.0]\n\nVISIBLE_SEGMENTS = [\n (99.729849, 130.755857, 93.044361, 130.755857),\n (93.044361, 130.755857, 93.044361, 197.469995),\n (99.729849, 197.469995, 93.044361, 197.469995),\n (99.729849, 130.755857, 99.729849, 197.469995),\n (99.729849, 36.529995, 93.044361, 36.529995),\n (99.729849, 36.529995, 99.729849, 116.755857),\n (93.044361, 36.529995, 93.044361, 116.755857),\n (99.729849, 116.755857, 93.044361, 116.755857),\n (193.955711, 130.755857, 193.955711, 197.469995),\n (113.729849, 130.755857, 193.955711, 130.755857),\n (193.955711, 197.469995, 113.729849, 197.469995),\n (113.729849, 197.469995, 113.729849, 130.755857)\n]\nVISIBLE_CIRCLES = [\n (96.4003, 187.58251, 1.266724),\n (96.4003, 140.78409, 1.266724)\n]\nVISIBLE_ARCS = [\n\n]\nHIDDEN_SEGMENTS = [\n (97.667, 36.53, 97.667, 49.901),\n (97.667, 49.901, 95.1335, 49.901),\n (95.1335, 49.901, 95.1335, 36.53),\n (180.5847, 188.8492, 180.5847, 186.3158),\n (180.5847, 142.0508, 180.5847, 139.5174),\n (180.5847, 186.3158, 193.9557, 186.3158),\n (180.5847, 188.8492, 193.9557, 188.8492),\n (180.5847, 139.5174, 193.9557, 139.5174),\n (180.5847, 142.0508, 193.9557, 142.0508)\n]\n# (orient, text, p1, p2, base) for linear; (orient, text, center, radius, angle) for diameter\nDIMENSIONS = [\n ('diameter', '%%c3.1579', (96.4003, 187.5825), 1.2667, 45),\n ('vertical', '70.8334', (99.7298, 130.7558), (99.7298, 187.5825), (88.7298, 159.1692)),\n ('diameter', '%%c3.1579', (96.4003, 140.7841), 1.2667, 45),\n ('vertical', '12.5', (99.7298, 130.7558), (99.7298, 140.7841), (88.7298, 135.77)),\n ('diameter', '%%c3.1579', (96.4003, 187.5825), 1.2667, 135),\n ('vertical', '70.8334', (99.7298, 130.7558), (99.7298, 187.5825), (88.7298, 159.1692)),\n ('diameter', '%%c3.1579', (96.4003, 140.7841), 1.2667, 135),\n ('vertical', '12.5', (99.7298, 130.7558), (99.7298, 140.7841), (88.7298, 135.77)),\n ('horizontal', '100', (193.9557, 197.47), (113.7298, 197.47), (153.8427, 186.47)),\n ('vertical', '83.1579', (193.9557, 130.7558), (193.9557, 197.47), (182.9557, 164.1129)),\n ('horizontal', '8.3333', (99.7298, 36.53), (93.0444, 36.53), (96.3871, 25.53))\n]\n\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; _ds.dxf.dimasz = 2.5\n _ds.dxf.dimexe = 1.25; _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\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\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,\n angle=(0 if d[0] == \"horizontal\" else 90),\n 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,\n 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,\n 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,\n text=text, dimstyle=\"EZDXF\").render()\n\n doc.saveas(out_path)\n\n\nif __name__ == \"__main__\":\n out = sys.argv[1] if len(sys.argv) > 1 else \"0034_00349497_gt.dxf\"\n draw(out)\n print(\"wrote\", out)\n```"}], "images": ["images/0034_00349497.png"], "id": "0034_00349497"} {"messages": [{"role": "user", "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": "assistant", "content": "```python\n#!/usr/bin/env python3\n# -*- coding: utf-8 -*-\n# Ground-truth 2D engineering drawing for part: 0037_00378212\n# Self-contained: reproduces the three-view DXF via ezdxf, NO FreeCAD needed.\n# Coordinates are A4 page millimetres (scale=0.6884776119403001, page=[297.0, 210.0]).\n# visible edges -> solid (layer OUTLINE); hidden edges -> dashed (layer HIDDEN)\n# dimensions -> real movable DIMENSION entities (text = true mm value)\n# Run: python 0037_00378212_gt.py [out.dxf]\nimport sys\nimport ezdxf\nimport math\n\nSCALE = 0.6884776119403001\nPAGE = [297.0, 210.0]\n\nVISIBLE_SEGMENTS = [\n (145.702303, 172.049981, 145.702303, 103.202219),\n (100.045366, 172.049981, 113.814918, 172.049981),\n (113.814918, 172.049981, 145.702303, 172.049981),\n (145.702303, 103.202219, 113.814918, 103.202219),\n (113.814918, 103.202219, 100.045366, 103.202219),\n (113.814918, 172.049981, 113.814918, 103.202219),\n (100.045366, 103.202219, 100.045366, 172.049981),\n (145.702303, 61.949981, 145.702303, 89.202219),\n (145.702303, 61.949981, 100.045366, 61.949981),\n (145.702303, 89.202219, 113.814918, 89.202219),\n (113.814918, 89.202219, 113.814918, 75.5761),\n (113.814918, 75.5761, 100.045366, 75.5761),\n (100.045366, 61.949981, 100.045366, 75.5761),\n (159.702303, 172.049981, 173.328422, 172.049981),\n (186.954541, 172.049981, 173.328422, 172.049981),\n (186.954541, 103.202219, 173.328422, 103.202219),\n (159.702303, 103.202219, 173.328422, 103.202219),\n (159.702303, 103.202219, 159.702303, 172.049981),\n (186.954541, 172.049981, 186.954541, 103.202219),\n (173.328422, 103.202219, 173.328422, 172.049981)\n]\nVISIBLE_CIRCLES = [\n (130.2644, 137.6261, 9.421273)\n]\nVISIBLE_ARCS = [\n\n]\nHIDDEN_SEGMENTS = [\n (139.6857, 61.95, 139.6857, 89.2022),\n (120.8432, 89.2022, 120.8432, 61.95),\n (159.7023, 128.2048, 186.9546, 128.2048),\n (159.7023, 147.0474, 186.9546, 147.0474)\n]\n# (orient, text, p1, p2, base) for linear; (orient, text, center, radius, angle) for diameter\nDIMENSIONS = [\n ('horizontal', '66.3158', (145.7024, 172.05), (100.0454, 172.05), (122.8739, 161.05)),\n ('vertical', '100', (145.7024, 103.2022), (145.7024, 172.05), (134.7024, 137.6261)),\n ('horizontal', '20', (100.0454, 103.2022), (113.815, 103.2022), (106.9302, 114.2022)),\n ('vertical', '100', (113.815, 103.2022), (113.815, 172.05), (102.815, 137.6261)),\n ('diameter', '%%c27.3684', (130.2644, 137.6261), 9.4213, 45),\n ('horizontal', '43.8925', (100.0454, 103.2022), (130.2644, 103.2022), (115.1549, 114.2022)),\n ('vertical', '50', (130.2644, 103.2022), (130.2644, 137.6261), (119.2644, 120.4142)),\n ('horizontal', '39.5833', (159.7023, 103.2022), (186.9546, 103.2022), (173.3285, 114.2022)),\n ('horizontal', '19.7917', (186.9546, 103.2022), (173.3284, 103.2022), (180.1415, 92.2022)),\n ('horizontal', '39.5833', (186.9546, 137.6261), (95.1576, 137.6261), (141.0561, 126.6261))\n]\n\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; _ds.dxf.dimasz = 2.5\n _ds.dxf.dimexe = 1.25; _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\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\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,\n angle=(0 if d[0] == \"horizontal\" else 90),\n 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,\n 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,\n 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,\n text=text, dimstyle=\"EZDXF\").render()\n\n doc.saveas(out_path)\n\n\nif __name__ == \"__main__\":\n out = sys.argv[1] if len(sys.argv) > 1 else \"0037_00378212_gt.dxf\"\n draw(out)\n print(\"wrote\", out)\n```"}], "images": ["images/0037_00378212.png"], "id": "0037_00378212"} {"messages": [{"role": "user", "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 7 straight edges. It is extruded to a thickness of 27.65 mm. The outline includes one or more oblique (angled) edges. A cut feature: The part is a circular plate with diameter 52.24 mm. It is extruded to a thickness of -57.71 mm."}, {"role": "assistant", "content": "```python\n#!/usr/bin/env python3\n# -*- coding: utf-8 -*-\n# Ground-truth 2D engineering drawing for part: 0038_00382045\n# Self-contained: reproduces the three-view DXF via ezdxf, NO FreeCAD needed.\n# Coordinates are A4 page millimetres (scale=0.38276363958039405, page=[297.0, 210.0]).\n# visible edges -> solid (layer OUTLINE); hidden edges -> dashed (layer HIDDEN)\n# dimensions -> real movable DIMENSION entities (text = true mm value)\n# Run: python 0038_00382045_gt.py [out.dxf]\nimport sys\nimport ezdxf\nimport math\n\nSCALE = 0.38276363958039405\nPAGE = [297.0, 210.0]\n\nVISIBLE_SEGMENTS = [\n (119.306247, 86.534176, 156.333739, 95.350245),\n (89.331612, 110.337563, 119.306247, 86.534176),\n (156.333739, 95.350245, 173.084271, 129.732916),\n (173.084271, 129.732916, 156.333739, 164.115586),\n (156.333739, 164.115586, 119.306247, 172.050049),\n (119.306247, 172.050049, 89.331612, 148.246662),\n (89.331612, 148.246662, 89.331612, 110.337563),\n (173.084271, 72.534176, 173.084271, 61.950049),\n (173.084271, 72.534176, 156.333739, 72.534176),\n (156.333739, 72.534176, 119.306247, 72.534176),\n (119.306247, 72.534176, 89.331612, 72.534176),\n (173.084271, 61.950049, 156.333739, 61.950049),\n (156.333739, 61.950049, 119.306247, 61.950049),\n (119.306247, 61.950049, 89.331612, 61.950049),\n (89.331612, 72.534176, 89.331612, 61.950049),\n (156.333739, 72.534176, 156.333739, 61.950049),\n (119.306247, 72.534176, 119.306247, 61.950049),\n (187.084271, 86.534176, 197.668398, 86.534176),\n (187.084271, 110.337563, 197.668398, 110.337563),\n (197.668398, 110.337563, 197.668398, 86.534176),\n (187.084271, 110.337563, 187.084271, 86.534176),\n (187.084271, 172.050049, 187.084271, 148.246662),\n (187.084271, 148.246662, 187.084271, 110.337563),\n (197.668398, 172.050049, 197.668398, 148.246662),\n (197.668398, 148.246662, 197.668398, 110.337563),\n (187.084271, 148.246662, 197.668398, 148.246662),\n (187.084271, 172.050049, 197.668398, 172.050049)\n]\nVISIBLE_CIRCLES = [\n (128.7811, 129.6651, 9.998004)\n]\nVISIBLE_ARCS = [\n\n]\nHIDDEN_SEGMENTS = [\n (138.7791, 61.95, 138.7791, 72.5341),\n (118.7831, 72.5341, 118.7831, 61.95),\n (187.0843, 95.3502, 197.6684, 95.3502),\n (187.0843, 129.7329, 197.6684, 129.7329),\n (187.0843, 164.1155, 197.6684, 164.1155),\n (187.0843, 119.667, 197.6684, 119.667),\n (187.0843, 139.6631, 197.6684, 139.6631)\n]\n# (orient, text, p1, p2, base) for linear; (orient, text, center, radius, angle) for diameter\nDIMENSIONS = [\n ('vertical', '99.0405', (89.3316, 148.2466), (89.3316, 110.3375), (100.3316, 129.2921)),\n ('aligned', '99.4414', (119.3063, 86.5341), (156.3337, 95.3502), (135.2722, 101.643)),\n ('aligned', '99.9204', (156.3337, 95.3502), (173.0843, 129.7329), (154.8201, 117.3592)),\n ('aligned', '99.9204', (173.0843, 129.7329), (156.3337, 164.1155), (154.8201, 142.1065)),\n ('aligned', '98.9333', (156.3337, 164.1155), (119.3063, 172.05), (135.5152, 157.3269)),\n ('aligned', '100', (119.3063, 172.05), (89.3316, 148.2466), (111.1596, 151.5341)),\n ('aligned', '100', (89.3316, 110.3375), (119.3063, 86.5341), (111.1596, 107.05)),\n ('diameter', '%%c52.2411', (128.7811, 129.6651), 9.998, 45),\n ('horizontal', '103.065', (89.3316, 86.5341), (128.7811, 86.5341), (109.0564, 97.5341)),\n ('vertical', '112.683', (128.7811, 86.5341), (128.7811, 129.6651), (117.7811, 108.0996)),\n ('horizontal', '27.6519', (187.0843, 86.5341), (197.6684, 86.5341), (192.3763, 97.5341)),\n ('horizontal', '27.6519', (197.6684, 129.6651), (175.5798, 129.6651), (186.6241, 118.6651))\n]\n\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; _ds.dxf.dimasz = 2.5\n _ds.dxf.dimexe = 1.25; _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\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\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,\n angle=(0 if d[0] == \"horizontal\" else 90),\n 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,\n 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,\n 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,\n text=text, dimstyle=\"EZDXF\").render()\n\n doc.saveas(out_path)\n\n\nif __name__ == \"__main__\":\n out = sys.argv[1] if len(sys.argv) > 1 else \"0038_00382045_gt.dxf\"\n draw(out)\n print(\"wrote\", out)\n```"}], "images": ["images/0038_00382045.png"], "id": "0038_00382045"} {"messages": [{"role": "user", "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 5.23 mm. The outline includes one or more oblique (angled) edges. A union feature: The part is a rectangular plate 78.38 mm wide and 61.05 mm tall. It is extruded to a thickness of 5.23 mm. A cut feature: The part is a circular plate with diameter 10.56 mm. It is extruded to a thickness of -10.45 mm. A cut feature: The part is a polygonal plate with 4 straight edges. It is extruded to a thickness of -10.45 mm. The outline includes one or more oblique (angled) edges. A cut feature: The part is a rectangular plate 60.09 mm wide and 34.16 mm tall. It is extruded to a thickness of -10.45 mm."}, {"role": "assistant", "content": "```python\n#!/usr/bin/env python3\n# -*- coding: utf-8 -*-\n# Ground-truth 2D engineering drawing for part: 0038_00385700\n# Self-contained: reproduces the three-view DXF via ezdxf, NO FreeCAD needed.\n# Coordinates are A4 page millimetres (scale=0.4109934203367719, page=[297.0, 210.0]).\n# visible edges -> solid (layer OUTLINE); hidden edges -> dashed (layer HIDDEN)\n# dimensions -> real movable DIMENSION entities (text = true mm value)\n# Run: python 0038_00385700_gt.py [out.dxf]\nimport sys\nimport ezdxf\nimport math\n\nSCALE = 0.4109934203367719\nPAGE = [297.0, 210.0]\n\nVISIBLE_SEGMENTS = [\n (119.32015, 93.129863, 151.53244, 93.129863),\n (119.32015, 93.129863, 119.32015, 118.221541),\n (151.53244, 93.129863, 151.53244, 118.221541),\n (119.445073, 118.221541, 119.32015, 118.221541),\n (151.53244, 118.221541, 151.373609, 118.221541),\n (131.696451, 157.017572, 119.445073, 118.221541),\n (151.373609, 118.221541, 139.122231, 157.017572),\n (139.122231, 157.017572, 131.696451, 157.017572),\n (146.203284, 121.584053, 137.96937, 146.817013),\n (124.688865, 121.584053, 146.203284, 121.584053),\n (137.96937, 146.817013, 132.657168, 146.817013),\n (132.657168, 146.817013, 124.688865, 121.584053),\n (147.77434, 100.109192, 147.77434, 114.146969),\n (147.77434, 114.146969, 123.07825, 114.146969),\n (123.07825, 114.146969, 123.07825, 100.109192),\n (123.07825, 100.109192, 147.77434, 100.109192),\n (151.53244, 79.129863, 151.373609, 79.129863),\n (151.373609, 79.129863, 139.122231, 79.129863),\n (139.122231, 79.129863, 131.696451, 79.129863),\n (131.696451, 79.129863, 119.445073, 79.129863),\n (119.445073, 79.129863, 119.32015, 79.129863),\n (119.32015, 79.129863, 119.32015, 76.982377),\n (151.53244, 79.129863, 151.53244, 76.982377),\n (119.445073, 76.982377, 119.445073, 79.129863),\n (119.445073, 76.982377, 119.32015, 76.982377),\n (151.53244, 76.982377, 151.373609, 76.982377),\n (151.373609, 79.129863, 151.373609, 76.982377),\n (131.696451, 79.129863, 131.696451, 76.982377),\n (131.696451, 76.982377, 119.445073, 76.982377),\n (151.373609, 76.982377, 139.122231, 76.982377),\n (139.122231, 79.129863, 139.122231, 76.982377),\n (139.122231, 76.982377, 131.696451, 76.982377),\n (165.53244, 157.017572, 165.53244, 118.221541),\n (165.53244, 93.129863, 165.53244, 118.221541),\n (165.53244, 93.129863, 167.679926, 93.129863),\n (165.53244, 118.221541, 167.679926, 118.221541),\n (167.679926, 93.129863, 167.679926, 118.221541),\n (165.53244, 157.017572, 167.679926, 157.017572),\n (167.679926, 157.017572, 167.679926, 118.221541)\n]\nVISIBLE_CIRCLES = [\n (135.4489, 152.7226, 2.170091)\n]\nVISIBLE_ARCS = [\n\n]\nHIDDEN_SEGMENTS = [\n (146.2032, 76.9824, 146.2032, 79.1299),\n (137.9693, 76.9824, 137.9693, 79.1299),\n (124.6888, 76.9824, 124.6888, 79.1299),\n (132.6571, 76.9824, 132.6571, 79.1299),\n (137.619, 76.9824, 137.619, 79.1299),\n (147.7743, 76.9824, 147.7743, 79.1299),\n (123.0782, 76.9824, 123.0782, 79.1299),\n (133.2788, 79.1299, 133.2788, 76.9824),\n (167.6799, 121.5841, 165.5324, 121.5841),\n (167.6799, 146.817, 165.5324, 146.817),\n (167.6799, 100.1092, 165.5324, 100.1092),\n (167.6799, 114.147, 165.5324, 114.147),\n (165.5324, 150.5525, 167.6799, 150.5525),\n (165.5324, 154.8927, 167.6799, 154.8927)\n]\n# (orient, text, p1, p2, base) for linear; (orient, text, center, radius, angle) for diameter\nDIMENSIONS = [\n ('horizontal', '18.0679', (139.1222, 157.0176), (131.6964, 157.0176), (135.4093, 146.0176)),\n ('horizontal', '78.3767', (119.3201, 93.1299), (151.5324, 93.1299), (135.4263, 104.1299)),\n ('vertical', '61.0513', (151.5324, 93.1299), (151.5324, 118.2216), (140.5324, 105.6757)),\n ('vertical', '0', (119.3201, 117.826), (119.3201, 117.826), (119.3201, 117.826)),\n ('vertical', '60.0888', (119.3201, 117.826), (119.3201, 93.1299), (130.3201, 105.4779)),\n ('diameter', '%%c10.5602', (135.4489, 152.7226), 2.1701, 45),\n ('horizontal', '39.2433', (119.3201, 117.826), (135.4489, 117.826), (127.3845, 128.826)),\n ('vertical', '84.908', (135.4489, 117.826), (135.4489, 152.7226), (124.4489, 135.2743)),\n ('horizontal', '52.3474', (124.6888, 121.5841), (146.2032, 121.5841), (135.446, 132.5841)),\n ('vertical', '61.3951', (146.2032, 121.5841), (146.2032, 146.817), (135.2032, 134.2006)),\n ('horizontal', '13.0627', (119.3201, 117.826), (124.6888, 117.826), (122.0045, 128.826)),\n ('vertical', '9.1439', (124.6888, 117.826), (124.6888, 121.5841), (113.6888, 119.705)),\n ('aligned', '64.5811', (146.2032, 121.5841), (137.9693, 146.817), (131.629, 130.7882)),\n ('aligned', '64.3836', (132.6571, 146.817), (124.6888, 121.5841), (139.1624, 130.8881)),\n ('horizontal', '60.0888', (123.0782, 100.1092), (147.7743, 100.1092), (135.4263, 111.1092)),\n ('vertical', '34.1557', (147.7743, 100.1092), (147.7743, 114.147), (136.7743, 107.1281)),\n ('horizontal', '9.1439', (119.3201, 117.826), (123.0782, 117.826), (121.1992, 128.826)),\n ('vertical', '43.1072', (123.0782, 117.826), (123.0782, 100.1092), (134.0782, 108.9676)),\n ('horizontal', '5.2251', (165.5324, 93.1299), (167.6799, 93.1299), (166.6061, 104.1299)),\n ('horizontal', '5.2251', (167.6799, 152.7226), (163.3849, 152.7226), (165.5324, 141.7226))\n]\n\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; _ds.dxf.dimasz = 2.5\n _ds.dxf.dimexe = 1.25; _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\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\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,\n angle=(0 if d[0] == \"horizontal\" else 90),\n 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,\n 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,\n 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,\n text=text, dimstyle=\"EZDXF\").render()\n\n doc.saveas(out_path)\n\n\nif __name__ == \"__main__\":\n out = sys.argv[1] if len(sys.argv) > 1 else \"0038_00385700_gt.dxf\"\n draw(out)\n print(\"wrote\", out)\n```"}], "images": ["images/0038_00385700.png"], "id": "0038_00385700"} {"messages": [{"role": "user", "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 29.47 mm wide and 100 mm tall. It is extruded to a thickness of 7.84 mm. A union feature: The part is a rectangular plate 98.04 mm wide and 88.75 mm tall, featuring a circular hole of diameter 20.64 mm. It is extruded to a thickness of 7.84 mm."}, {"role": "assistant", "content": "```python\n#!/usr/bin/env python3\n# -*- coding: utf-8 -*-\n# Ground-truth 2D engineering drawing for part: 0039_00393076\n# Self-contained: reproduces the three-view DXF via ezdxf, NO FreeCAD needed.\n# Coordinates are A4 page millimetres (scale=0.4901100000000176, page=[297.0, 210.0]).\n# visible edges -> solid (layer OUTLINE); hidden edges -> dashed (layer HIDDEN)\n# dimensions -> real movable DIMENSION entities (text = true mm value)\n# Run: python 0039_00393076_gt.py [out.dxf]\nimport sys\nimport ezdxf\nimport math\n\nSCALE = 0.4901100000000176\nPAGE = [297.0, 210.0]\n\nVISIBLE_SEGMENTS = [\n (110.553005, 79.794011, 158.603005, 79.794011),\n (110.553005, 123.291905, 110.553005, 79.794011),\n (110.553005, 123.291905, 126.890005, 123.291905),\n (141.335353, 123.291905, 158.603005, 123.291905),\n (158.603005, 79.794011, 158.603005, 123.291905),\n (126.890005, 172.050011, 126.890005, 123.291905),\n (141.335353, 172.050011, 126.890005, 172.050011),\n (141.335353, 123.291905, 141.335353, 172.050011),\n (158.603005, 65.794011, 141.335353, 65.794011),\n (141.335353, 65.794011, 126.890005, 65.794011),\n (126.890005, 65.794011, 110.553005, 65.794011),\n (110.553005, 65.794011, 110.553005, 61.950011),\n (110.553005, 61.950011, 126.890005, 61.950011),\n (158.603005, 65.794011, 158.603005, 61.950011),\n (141.335353, 61.950011, 158.603005, 61.950011),\n (126.890005, 65.794011, 126.890005, 61.950011),\n (141.335353, 65.794011, 141.335353, 61.950011),\n (141.335353, 61.950011, 126.890005, 61.950011),\n (172.603005, 172.050011, 172.603005, 123.291905),\n (172.603005, 123.291905, 172.603005, 79.794011),\n (172.603005, 79.794011, 176.447005, 79.794011),\n (172.603005, 123.291905, 176.447005, 123.291905),\n (176.447005, 123.291905, 176.447005, 79.794011),\n (172.603005, 172.050011, 176.447005, 172.050011),\n (176.447005, 172.050011, 176.447005, 123.291905)\n]\nVISIBLE_CIRCLES = [\n (134.8309, 89.9098, 5.057895)\n]\nVISIBLE_ARCS = [\n\n]\nHIDDEN_SEGMENTS = [\n (139.8888, 65.794, 139.8888, 61.95),\n (129.773, 61.95, 129.773, 65.794),\n (176.447, 94.9677, 172.603, 94.9677),\n (176.447, 84.8519, 172.603, 84.8519)\n]\n# (orient, text, p1, p2, base) for linear; (orient, text, center, radius, angle) for diameter\nDIMENSIONS = [\n ('horizontal', '29.4737', (141.3353, 172.05), (126.89, 172.05), (134.1127, 161.05)),\n ('horizontal', '98.0392', (110.553, 79.794), (158.603, 79.794), (134.578, 90.794)),\n ('vertical', '88.7513', (158.603, 79.794), (158.603, 123.2919), (147.603, 101.5429)),\n ('horizontal', '33.3333', (126.89, 123.039), (110.553, 123.039), (118.7215, 112.039)),\n ('vertical', '88.2353', (110.553, 123.039), (110.553, 79.794), (121.553, 101.4165)),\n ('diameter', '%%c20.6398', (134.8309, 89.9098), 5.0579, 45),\n ('horizontal', '49.5356', (110.553, 89.9098), (134.8309, 89.9098), (122.6919, 100.9098)),\n ('vertical', '20.6398', (134.8309, 79.794), (134.8309, 89.9098), (123.8309, 84.8519)),\n ('horizontal', '7.8431', (172.603, 79.794), (176.447, 79.794), (174.525, 90.794))\n]\n\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; _ds.dxf.dimasz = 2.5\n _ds.dxf.dimexe = 1.25; _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\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\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,\n angle=(0 if d[0] == \"horizontal\" else 90),\n 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,\n 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,\n 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,\n text=text, dimstyle=\"EZDXF\").render()\n\n doc.saveas(out_path)\n\n\nif __name__ == \"__main__\":\n out = sys.argv[1] if len(sys.argv) > 1 else \"0039_00393076_gt.dxf\"\n draw(out)\n print(\"wrote\", out)\n```"}], "images": ["images/0039_00393076.png"], "id": "0039_00393076"} {"messages": [{"role": "user", "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 41.05 mm wide and 100 mm tall. It is extruded to a thickness of 0.52 mm. A cut feature: The part is a circular plate with diameter 0.52 mm. It is extruded to a thickness of -6.77 mm. A cut feature: The part is a circular plate with diameter 0.52 mm. It is extruded to a thickness of -6.77 mm. A cut feature: The part is a circular plate with diameter 0.52 mm. It is extruded to a thickness of -6.77 mm. A cut feature: The part is a circular plate with diameter 0.52 mm. It is extruded to a thickness of -6.77 mm. A cut feature: The part is a circular plate with diameter 0.52 mm. It is extruded to a thickness of -6.77 mm. A cut feature: The part is a circular plate with diameter 0.52 mm. It is extruded to a thickness of -6.77 mm. A cut feature: The part is a circular plate with diameter 0.53 mm. It is extruded to a thickness of -6.77 mm."}, {"role": "assistant", "content": "```python\n#!/usr/bin/env python3\n# -*- coding: utf-8 -*-\n# Ground-truth 2D engineering drawing for part: 0041_00418086\n# Self-contained: reproduces the three-view DXF via ezdxf, NO FreeCAD needed.\n# Coordinates are A4 page millimetres (scale=0.9560207253886043, page=[297.0, 210.0]).\n# visible edges -> solid (layer OUTLINE); hidden edges -> dashed (layer HIDDEN)\n# dimensions -> real movable DIMENSION entities (text = true mm value)\n# Run: python 0041_00418086_gt.py [out.dxf]\nimport sys\nimport ezdxf\nimport math\n\nSCALE = 0.9560207253886043\nPAGE = [297.0, 210.0]\n\nVISIBLE_SEGMENTS = [\n (155.874654, 172.050008, 155.874654, 76.447935),\n (116.627487, 172.050008, 155.874654, 172.050008),\n (155.874654, 76.447935, 116.627487, 76.447935),\n (116.627487, 76.447935, 116.627487, 172.050008),\n (155.874654, 61.950008, 155.874654, 62.447935),\n (155.874654, 62.447935, 116.627487, 62.447935),\n (116.627487, 61.950008, 116.627487, 62.447935),\n (155.874654, 61.950008, 116.627487, 61.950008),\n (169.874654, 172.050008, 170.372582, 172.050008),\n (169.874654, 76.447935, 170.372582, 76.447935),\n (169.874654, 76.447935, 169.874654, 172.050008),\n (170.372582, 76.447935, 170.372582, 172.050008)\n]\nVISIBLE_CIRCLES = [\n (120.364564, 169.56037, 0.246343),\n (120.364564, 124.248971, 0.246343),\n (152.231922, 169.56037, 0.246343),\n (136.298243, 124.248971, 0.251584),\n (152.231922, 124.248971, 0.246343),\n (120.364564, 78.937572, 0.246343),\n (152.231922, 78.937572, 0.246343)\n]\nVISIBLE_ARCS = [\n\n]\nHIDDEN_SEGMENTS = [\n\n]\n# (orient, text, p1, p2, base) for linear; (orient, text, center, radius, angle) for diameter\nDIMENSIONS = [\n ('horizontal', '41.0526', (155.8746, 172.05), (116.6275, 172.05), (136.2511, 161.05)),\n ('vertical', '100', (155.8746, 76.4479), (155.8746, 172.05), (144.8746, 124.249)),\n ('diameter', '%%c0.5154', (120.3646, 169.5603), 0.2464, 45),\n ('horizontal', '3.909', (116.6275, 76.4479), (120.3646, 76.4479), (118.496, 87.4479)),\n ('vertical', '97.3958', (120.3646, 76.4479), (120.3646, 169.5603), (109.3646, 123.0041)),\n ('diameter', '%%c0.5154', (152.2319, 169.5603), 0.2464, 45),\n ('horizontal', '37.2423', (116.6275, 76.4479), (152.2319, 76.4479), (134.4297, 87.4479)),\n ('vertical', '97.3958', (152.2319, 76.4479), (152.2319, 169.5603), (141.2319, 123.0041)),\n ('diameter', '%%c0.5154', (120.3646, 78.9376), 0.2464, 45),\n ('horizontal', '3.909', (116.6275, 76.4479), (120.3646, 76.4479), (118.496, 87.4479)),\n ('vertical', '2.6042', (120.3646, 76.4479), (120.3646, 78.9376), (109.3646, 77.6928)),\n ('diameter', '%%c0.5154', (152.2319, 78.9376), 0.2464, 45),\n ('horizontal', '37.2423', (116.6275, 76.4479), (152.2319, 76.4479), (134.4297, 87.4479)),\n ('vertical', '2.6042', (152.2319, 76.4479), (152.2319, 78.9376), (141.2319, 77.6928)),\n ('diameter', '%%c0.5154', (120.3646, 124.249), 0.2464, 45),\n ('horizontal', '3.909', (116.6275, 76.4479), (120.3646, 76.4479), (118.496, 87.4479)),\n ('vertical', '50', (120.3646, 76.4479), (120.3646, 124.249), (109.3646, 100.3484)),\n ('diameter', '%%c0.5154', (152.2319, 124.249), 0.2464, 45),\n ('horizontal', '37.2423', (116.6275, 76.4479), (152.2319, 76.4479), (134.4297, 87.4479)),\n ('vertical', '50', (152.2319, 76.4479), (152.2319, 124.249), (141.2319, 100.3484)),\n ('diameter', '%%c0.5263', (136.2982, 124.249), 0.2516, 45),\n ('horizontal', '20.5756', (116.6275, 76.4479), (136.2982, 76.4479), (126.4628, 87.4479)),\n ('vertical', '50', (136.2982, 76.4479), (136.2982, 124.249), (125.2982, 100.3484)),\n ('vertical', '0.5208', (169.8746, 76.4479), (170.3725, 76.4479), (170.1236, 87.4479)),\n ('horizontal', '0.5208', (170.3725, 169.5603), (163.8995, 169.5603), (167.136, 158.5603)),\n ('horizontal', '0.5208', (170.3725, 169.5603), (163.8995, 169.5603), (167.136, 158.5603)),\n ('horizontal', '0.5208', (170.3725, 78.9376), (163.8995, 78.9376), (167.136, 67.9376)),\n ('horizontal', '0.5208', (170.3725, 78.9376), (163.8995, 78.9376), (167.136, 67.9376)),\n ('horizontal', '0.5208', (170.3725, 124.249), (163.8995, 124.249), (167.136, 113.249)),\n ('horizontal', '0.5208', (170.3725, 124.249), (163.8995, 124.249), (167.136, 113.249)),\n ('horizontal', '0.5208', (170.3725, 124.249), (163.8995, 124.249), (167.136, 113.249))\n]\n\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; _ds.dxf.dimasz = 2.5\n _ds.dxf.dimexe = 1.25; _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\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\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,\n angle=(0 if d[0] == \"horizontal\" else 90),\n 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,\n 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,\n 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,\n text=text, dimstyle=\"EZDXF\").render()\n\n doc.saveas(out_path)\n\n\nif __name__ == \"__main__\":\n out = sys.argv[1] if len(sys.argv) > 1 else \"0041_00418086_gt.dxf\"\n draw(out)\n print(\"wrote\", out)\n```"}], "images": ["images/0041_00418086.png"], "id": "0041_00418086"} {"messages": [{"role": "user", "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 60 mm tall. It is extruded to a thickness of 15.3 mm. A cut feature: The part is a circular plate with diameter 20.01 mm. It is extruded to a thickness of -20.22 mm. A cut feature: The part is a square plate 20.22 x 20.22 mm. It is extruded to a thickness of -39.89 mm."}, {"role": "assistant", "content": "```python\n#!/usr/bin/env python3\n# -*- coding: utf-8 -*-\n# Ground-truth 2D engineering drawing for part: 0043_00435141\n# Self-contained: reproduces the three-view DXF via ezdxf, NO FreeCAD needed.\n# Coordinates are A4 page millimetres (scale=0.9183750000000688, page=[297.0, 210.0]).\n# visible edges -> solid (layer OUTLINE); hidden edges -> dashed (layer HIDDEN)\n# dimensions -> real movable DIMENSION entities (text = true mm value)\n# Run: python 0043_00435141_gt.py [out.dxf]\nimport sys\nimport ezdxf\nimport math\n\nSCALE = 0.9183750000000688\nPAGE = [297.0, 210.0]\n\nVISIBLE_SEGMENTS = [\n (175.392868, 158.577034, 175.392868, 103.474534),\n (83.555368, 158.577034, 175.392868, 158.577034),\n (175.392868, 103.474534, 83.555368, 103.474534),\n (83.555368, 103.474534, 83.555368, 158.577034),\n (161.843073, 140.008797, 161.843073, 121.440559),\n (143.274836, 140.008797, 161.843073, 140.008797),\n (143.274836, 121.440559, 143.274836, 140.008797),\n (161.843073, 121.440559, 143.274836, 121.440559),\n (175.392868, 75.422895, 175.392868, 89.474534),\n (83.555368, 75.422895, 83.555368, 89.474534),\n (83.555368, 89.474534, 175.392868, 89.474534),\n (83.555368, 75.422895, 175.392868, 75.422895),\n (203.444508, 158.577034, 189.392868, 158.577034),\n (203.444508, 103.474534, 189.392868, 103.474534),\n (203.444508, 103.474534, 203.444508, 158.577034),\n (189.392868, 103.474534, 189.392868, 158.577034)\n]\nVISIBLE_CIRCLES = [\n (102.9741, 130.9756, 9.186391)\n]\nVISIBLE_ARCS = [\n\n]\nHIDDEN_SEGMENTS = [\n (112.1606, 89.4746, 112.1606, 75.4229),\n (161.8431, 89.4746, 161.8431, 75.4229),\n (143.2749, 89.4746, 143.2749, 75.4229),\n (93.7878, 75.4229, 93.7878, 89.4746),\n (189.3929, 140.0088, 203.4446, 140.0088),\n (189.3929, 121.4406, 203.4446, 121.4406),\n (203.4446, 140.162, 189.3929, 140.162),\n (203.4446, 121.7892, 189.3929, 121.7892)\n]\n# (orient, text, p1, p2, base) for linear; (orient, text, center, radius, angle) for diameter\nDIMENSIONS = [\n ('horizontal', '100', (175.3929, 103.4745), (83.5554, 103.4745), (129.4742, 92.4745)),\n ('vertical', '60', (175.3929, 158.577), (175.3929, 103.4745), (186.3929, 131.0258)),\n ('diameter', '%%c20.0058', (102.9741, 130.9756), 9.1864, 45),\n ('horizontal', '21.1446', (83.5554, 158.577), (102.9741, 158.577), (93.2648, 169.577)),\n ('vertical', '30.0546', (102.9741, 158.577), (102.9741, 130.9756), (113.9741, 144.7763)),\n ('horizontal', '20.2186', (143.2749, 140.0089), (161.8431, 140.0089), (152.559, 151.0089)),\n ('vertical', '20.2186', (161.8431, 140.0089), (161.8431, 121.4406), (172.8431, 130.7247)),\n ('horizontal', '65.0273', (83.5554, 158.577), (143.2749, 158.577), (113.4152, 169.577)),\n ('vertical', '20.2185', (143.2749, 158.577), (143.2749, 140.0089), (154.2749, 149.293)),\n ('horizontal', '15.3005', (203.4446, 158.577), (189.393, 158.577), (196.4188, 147.577)),\n ('horizontal', '15.3005', (189.393, 130.9756), (207.9612, 130.9756), (198.6771, 141.9756))\n]\n\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; _ds.dxf.dimasz = 2.5\n _ds.dxf.dimexe = 1.25; _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\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\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,\n angle=(0 if d[0] == \"horizontal\" else 90),\n 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,\n 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,\n 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,\n text=text, dimstyle=\"EZDXF\").render()\n\n doc.saveas(out_path)\n\n\nif __name__ == \"__main__\":\n out = sys.argv[1] if len(sys.argv) > 1 else \"0043_00435141_gt.dxf\"\n draw(out)\n print(\"wrote\", out)\n```"}], "images": ["images/0043_00435141.png"], "id": "0043_00435141"} {"messages": [{"role": "user", "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 23.16 mm wide and 100 mm tall. It is extruded to a thickness of 5.21 mm. A union feature: The part is a circular plate with diameter 5.26 mm. It is extruded to a thickness of 16.67 mm."}, {"role": "assistant", "content": "```python\n#!/usr/bin/env python3\n# -*- coding: utf-8 -*-\n# Ground-truth 2D engineering drawing for part: 0044_00440591\n# Self-contained: reproduces the three-view DXF via ezdxf, NO FreeCAD needed.\n# Coordinates are A4 page millimetres (scale=0.780299145299165, page=[297.0, 210.0]).\n# visible edges -> solid (layer OUTLINE); hidden edges -> dashed (layer HIDDEN)\n# dimensions -> real movable DIMENSION entities (text = true mm value)\n# Run: python 0044_00440591_gt.py [out.dxf]\nimport sys\nimport ezdxf\nimport math\n\nSCALE = 0.780299145299165\nPAGE = [297.0, 210.0]\n\nVISIBLE_SEGMENTS = [\n (137.000574, 93.519559, 137.000574, 171.549473),\n (118.930488, 93.519559, 137.000574, 93.519559),\n (137.000574, 171.549473, 118.930488, 171.549473),\n (118.930488, 171.549473, 118.930488, 93.519559),\n (137.000574, 79.519559, 137.000574, 75.455501),\n (137.000574, 75.455501, 118.930488, 75.455501),\n (118.930488, 79.519559, 118.930488, 75.455501),\n (137.000574, 79.519559, 118.930488, 79.519559),\n (129.539819, 75.455501, 129.539819, 62.450515),\n (129.539819, 62.450515, 129.41148, 62.450515),\n (129.41148, 62.450515, 129.283141, 62.450515),\n (129.283141, 62.450515, 129.154803, 62.450515),\n (129.154803, 62.450515, 129.026464, 62.450515),\n (129.026464, 62.450515, 128.898125, 62.450515),\n (128.898125, 62.450515, 128.769787, 62.450515),\n (128.769787, 62.450515, 128.641448, 62.450515),\n (128.641448, 62.450515, 128.513109, 62.450515),\n (128.513109, 62.450515, 128.384771, 62.450515),\n (128.384771, 62.450515, 128.256432, 62.450515),\n (128.256432, 62.450515, 128.128093, 62.450515),\n (128.128093, 62.450515, 127.999755, 62.450515),\n (127.999755, 62.450515, 127.871416, 62.450515),\n (127.871416, 62.450515, 127.743077, 62.450515),\n (127.743077, 62.450515, 127.614739, 62.450515),\n (127.614739, 62.450515, 127.4864, 62.450515),\n (127.4864, 62.450515, 127.358061, 62.450515),\n (127.358061, 62.450515, 127.229723, 62.450515),\n (127.229723, 62.450515, 127.101384, 62.450515),\n (127.101384, 62.450515, 126.973045, 62.450515),\n (126.973045, 62.450515, 126.844707, 62.450515),\n (126.844707, 62.450515, 126.716368, 62.450515),\n (126.716368, 62.450515, 126.588029, 62.450515),\n (126.588029, 62.450515, 126.459691, 62.450515),\n (126.459691, 62.450515, 126.331352, 62.450515),\n (126.331352, 62.450515, 126.203013, 62.450515),\n (126.203013, 62.450515, 126.074675, 62.450515),\n (126.074675, 62.450515, 125.946336, 62.450515),\n (125.946336, 62.450515, 125.817997, 62.450515),\n (125.817997, 62.450515, 125.689659, 62.450515),\n (125.689659, 62.450515, 125.56132, 62.450515),\n (125.56132, 62.450515, 125.432981, 62.450515),\n (125.432981, 62.450515, 125.432981, 75.455501),\n (151.000574, 93.519559, 155.064632, 93.519559),\n (151.000574, 171.549473, 155.064632, 171.549473),\n (151.000574, 171.549473, 151.000574, 93.519559),\n (155.064632, 171.549473, 155.064632, 93.519559),\n (168.069618, 126.459819, 168.069618, 126.33148),\n (168.069618, 126.33148, 168.069618, 126.203141),\n (168.069618, 126.203141, 168.069618, 126.074803),\n (168.069618, 126.074803, 168.069618, 125.946464),\n (168.069618, 125.946464, 168.069618, 125.818125),\n (168.069618, 125.818125, 168.069618, 125.689787),\n (168.069618, 125.689787, 168.069618, 125.561448),\n (168.069618, 125.561448, 168.069618, 125.433109),\n (168.069618, 125.433109, 168.069618, 125.304771),\n (168.069618, 125.304771, 168.069618, 125.176432),\n (168.069618, 125.176432, 168.069618, 125.048093),\n (168.069618, 125.048093, 168.069618, 124.919755),\n (168.069618, 124.919755, 168.069618, 124.791416),\n (168.069618, 124.791416, 168.069618, 124.663077),\n (168.069618, 124.663077, 168.069618, 124.534739),\n (168.069618, 124.534739, 168.069618, 124.4064),\n (168.069618, 124.4064, 168.069618, 124.278061),\n (168.069618, 124.278061, 168.069618, 124.149723),\n (168.069618, 124.149723, 168.069618, 124.021384),\n (168.069618, 124.021384, 168.069618, 123.893045),\n (168.069618, 123.893045, 168.069618, 123.764707),\n (168.069618, 123.764707, 168.069618, 123.636368),\n (168.069618, 123.636368, 168.069618, 123.508029),\n (168.069618, 123.508029, 168.069618, 123.379691),\n (168.069618, 123.379691, 168.069618, 123.251352),\n (168.069618, 123.251352, 168.069618, 123.123013),\n (168.069618, 123.123013, 168.069618, 122.994675),\n (168.069618, 122.994675, 168.069618, 122.866336),\n (168.069618, 122.866336, 168.069618, 122.737997),\n (168.069618, 122.737997, 168.069618, 122.609659),\n (168.069618, 122.609659, 168.069618, 122.48132),\n (168.069618, 122.48132, 168.069618, 122.352981),\n (168.069618, 126.459819, 155.064632, 126.459819),\n (168.069618, 122.352981, 155.064632, 122.352981)\n]\nVISIBLE_CIRCLES = [\n (127.4864, 124.4064, 2.053419)\n]\nVISIBLE_ARCS = [\n\n]\nHIDDEN_SEGMENTS = [\n\n]\n# (orient, text, p1, p2, base) for linear; (orient, text, center, radius, angle) for diameter\nDIMENSIONS = [\n ('horizontal', '23.1579', (137.0006, 171.5495), (118.9305, 171.5495), (127.9655, 160.5495)),\n ('vertical', '100', (137.0006, 93.5196), (137.0006, 171.5495), (126.0006, 132.5345)),\n ('diameter', '%%c5.2632', (127.4864, 124.4064), 2.0534, 45),\n ('horizontal', '5.2083', (151.0005, 93.5196), (155.0646, 93.5196), (153.0325, 104.5196)),\n ('horizontal', '16.6667', (155.0646, 124.4064), (168.0696, 124.4064), (161.5671, 135.4064))\n]\n\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; _ds.dxf.dimasz = 2.5\n _ds.dxf.dimexe = 1.25; _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\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\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,\n angle=(0 if d[0] == \"horizontal\" else 90),\n 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,\n 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,\n 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,\n text=text, dimstyle=\"EZDXF\").render()\n\n doc.saveas(out_path)\n\n\nif __name__ == \"__main__\":\n out = sys.argv[1] if len(sys.argv) > 1 else \"0044_00440591_gt.dxf\"\n draw(out)\n print(\"wrote\", out)\n```"}], "images": ["images/0044_00440591.png"], "id": "0044_00440591"} {"messages": [{"role": "user", "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 12 edges within a 100 x 34.74 mm bounding box, featuring a circular hole of diameter 23.16 mm. It is extruded to a thickness of 25 mm. A union feature: The part is a rectangular plate 100 mm wide and 50.53 mm tall, featuring a circular hole of diameter 25.26 mm. It is extruded to a thickness of 25 mm. A union feature: The part is a rectangular plate 18.75 mm wide and 29.69 mm tall. It is extruded to a thickness of 50 mm. A union feature: The part is a rectangular plate 18.75 mm wide and 29.69 mm tall. It is extruded to a thickness of 50 mm."}, {"role": "assistant", "content": "```python\n#!/usr/bin/env python3\n# -*- coding: utf-8 -*-\n# Ground-truth 2D engineering drawing for part: 0050_00503794\n# Self-contained: reproduces the three-view DXF via ezdxf, NO FreeCAD needed.\n# Coordinates are A4 page millimetres (scale=0.4805, page=[297.0, 210.0]).\n# visible edges -> solid (layer OUTLINE); hidden edges -> dashed (layer HIDDEN)\n# dimensions -> real movable DIMENSION entities (text = true mm value)\n# Run: python 0050_00503794_gt.py [out.dxf]\nimport sys\nimport ezdxf\nimport math\n\nSCALE = 0.4805\nPAGE = [297.0, 210.0]\n\nVISIBLE_SEGMENTS = [\n (148.512505, 140.691082, 148.512505, 99.975029),\n (100.462505, 99.975029, 148.512505, 99.975029),\n (109.566716, 140.691082, 100.462505, 140.691082),\n (100.462505, 140.691082, 100.462505, 99.975029),\n (148.512505, 140.691082, 139.408295, 140.691082),\n (139.408295, 140.691082, 139.408295, 155.358976),\n (139.408295, 155.358976, 139.50313, 155.358976),\n (148.512505, 155.532841, 148.512505, 172.050029),\n (148.512505, 172.050029, 100.462505, 172.050029),\n (100.462505, 172.050029, 100.462505, 155.532841),\n (109.47188, 155.358976, 109.566716, 155.358976),\n (109.566716, 155.358976, 109.566716, 140.691082),\n (109.47188, 141.267998, 109.47188, 155.532841),\n (100.462505, 141.267998, 109.47188, 141.267998),\n (100.462505, 155.532841, 100.462505, 141.267998),\n (148.512505, 141.267998, 148.512505, 155.532841),\n (109.47188, 155.532841, 100.462505, 155.532841),\n (148.512505, 155.532841, 139.50313, 155.532841),\n (139.50313, 155.532841, 139.50313, 141.267998),\n (139.50313, 141.267998, 148.512505, 141.267998),\n (148.512505, 85.975029, 100.462505, 85.975029),\n (148.512505, 73.962529, 100.462505, 73.962529),\n (109.47188, 73.962529, 109.47188, 61.950029),\n (100.462505, 85.975029, 100.462505, 73.962529),\n (100.462505, 73.962529, 100.462505, 61.950029),\n (148.512505, 85.975029, 148.512505, 73.962529),\n (148.512505, 73.962529, 148.512505, 61.950029),\n (109.47188, 61.950029, 100.462505, 61.950029),\n (148.512505, 61.950029, 139.50313, 61.950029),\n (139.50313, 73.962529, 139.50313, 61.950029),\n (162.512505, 99.975029, 162.512505, 140.691082),\n (162.512505, 141.267998, 162.512505, 172.050029),\n (162.512505, 141.267998, 162.512505, 140.691082),\n (162.512505, 99.975029, 174.525005, 99.975029),\n (174.525005, 140.691082, 174.525005, 99.975029),\n (174.525005, 172.050029, 174.525005, 155.532841),\n (174.525005, 141.267998, 174.525005, 140.691082),\n (162.512505, 140.691082, 174.525005, 140.691082),\n (162.512505, 141.267998, 186.537505, 141.267998),\n (162.512505, 172.050029, 174.525005, 172.050029),\n (174.525005, 155.532841, 186.537505, 155.532841),\n (186.537505, 155.532841, 186.537505, 141.267998)\n]\nVISIBLE_CIRCLES = [\n (124.7404, 112.113976, 6.069474),\n (124.7404, 148.277924, 5.563684)\n]\nVISIBLE_ARCS = [\n\n]\nHIDDEN_SEGMENTS = [\n (130.8099, 85.975, 130.8099, 73.9625),\n (130.3041, 85.975, 130.3041, 73.9625),\n (118.6709, 73.9625, 118.6709, 85.975),\n (119.1767, 73.9625, 119.1767, 85.975),\n (174.525, 118.1834, 162.5125, 118.1834),\n (174.525, 106.0445, 162.5125, 106.0445),\n (174.525, 153.8416, 162.5125, 153.8416),\n (174.525, 142.7142, 162.5125, 142.7142)\n]\n# (orient, text, p1, p2, base) for linear; (orient, text, center, radius, angle) for diameter\nDIMENSIONS = [\n ('horizontal', '18.9474', (148.5125, 140.691), (139.4083, 140.691), (143.9604, 129.691)),\n ('horizontal', '100', (148.5125, 172.05), (100.4625, 172.05), (124.4875, 161.05)),\n ('vertical', '30.5263', (139.4083, 140.691), (139.4083, 155.359), (128.4083, 148.025)),\n ('diameter', '%%c23.1579', (124.7404, 148.2779), 5.5637, 45),\n ('horizontal', '50.5263', (100.4625, 148.2779), (124.7404, 148.2779), (112.6014, 159.2779)),\n ('vertical', '50.5263', (124.7404, 124.0), (124.7404, 148.2779), (113.7404, 136.1389)),\n ('horizontal', '100', (100.4625, 99.975), (148.5125, 99.975), (124.4875, 110.975)),\n ('vertical', '50.5263', (148.5125, 99.975), (148.5125, 124.2529), (137.5125, 112.1139)),\n ('vertical', '50', (100.4625, 124.0), (100.4625, 99.975), (111.4625, 111.9875)),\n ('diameter', '%%c25.2632', (124.7404, 112.114), 6.0695, 45),\n ('horizontal', '50.5263', (100.4625, 112.114), (124.7404, 112.114), (112.6014, 123.114)),\n ('vertical', '25.2632', (124.7404, 99.975), (124.7404, 112.114), (113.7404, 106.0445)),\n ('horizontal', '18.75', (100.4625, 141.268), (109.4719, 141.268), (104.9672, 152.268)),\n ('vertical', '29.6875', (109.4719, 141.268), (109.4719, 155.5328), (98.4719, 148.4004)),\n ('vertical', '35.9375', (100.4625, 124.0), (100.4625, 141.268), (89.4625, 132.634)),\n ('horizontal', '18.75', (139.5031, 141.268), (148.5125, 141.268), (144.0078, 152.268)),\n ('vertical', '29.6875', (148.5125, 141.268), (148.5125, 155.5328), (137.5125, 148.4004)),\n ('horizontal', '81.25', (100.4625, 124.0), (139.5031, 124.0), (119.9828, 135.0)),\n ('vertical', '35.9375', (139.5031, 124.0), (139.5031, 141.268), (128.5031, 132.634)),\n ('horizontal', '25', (162.5125, 99.975), (174.525, 99.975), (168.5188, 110.975)),\n ('horizontal', '50', (162.5125, 141.268), (186.5375, 141.268), (174.525, 152.268)),\n ('horizontal', '50', (162.5125, 141.268), (186.5375, 141.268), (174.525, 152.268))\n]\n\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; _ds.dxf.dimasz = 2.5\n _ds.dxf.dimexe = 1.25; _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\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\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,\n angle=(0 if d[0] == \"horizontal\" else 90),\n 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,\n 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,\n 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,\n text=text, dimstyle=\"EZDXF\").render()\n\n doc.saveas(out_path)\n\n\nif __name__ == \"__main__\":\n out = sys.argv[1] if len(sys.argv) > 1 else \"0050_00503794_gt.dxf\"\n draw(out)\n print(\"wrote\", out)\n```"}], "images": ["images/0050_00503794.png"], "id": "0050_00503794"} {"messages": [{"role": "user", "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 3 straight edges. It is extruded to a thickness of 11.44 mm. The outline includes one or more oblique (angled) edges. A union feature: The part is a polygonal plate with 3 straight edges. It is extruded to a thickness of 4.82 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 -22.89 mm. The outline includes one or more oblique (angled) edges. A cut feature: The part is a circular plate with diameter 7.91 mm. It is extruded to a thickness of -22.89 mm."}, {"role": "assistant", "content": "```python\n#!/usr/bin/env python3\n# -*- coding: utf-8 -*-\n# Ground-truth 2D engineering drawing for part: 0051_00514510\n# Self-contained: reproduces the three-view DXF via ezdxf, NO FreeCAD needed.\n# Coordinates are A4 page millimetres (scale=0.936977722834287, page=[297.0, 210.0]).\n# visible edges -> solid (layer OUTLINE); hidden edges -> dashed (layer HIDDEN)\n# dimensions -> real movable DIMENSION entities (text = true mm value)\n# Run: python 0051_00514510_gt.py [out.dxf]\nimport sys\nimport ezdxf\nimport math\n\nSCALE = 0.936977722834287\nPAGE = [297.0, 210.0]\n\nVISIBLE_SEGMENTS = [\n (175.722363, 91.187422, 129.374326, 172.049955),\n (82.04016, 91.187422, 175.722363, 91.187422),\n (129.374326, 172.049955, 82.04016, 91.187422),\n (113.079444, 127.305861, 113.270121, 126.973192),\n (113.464855, 127.305861, 113.079444, 127.305861),\n (128.714927, 100.026935, 129.047597, 100.026935),\n (113.270121, 126.973192, 128.714927, 100.026935),\n (129.047597, 100.026935, 144.683079, 127.305861),\n (144.683079, 127.305861, 113.464855, 127.305861),\n (161.049247, 99.652681, 129.499077, 154.697658),\n (97.277627, 99.652681, 161.049247, 99.652681),\n (129.499077, 154.697658, 113.464855, 127.305861),\n (113.270121, 126.973192, 97.277627, 99.652681),\n (175.722363, 77.187422, 175.722363, 66.46476),\n (175.722363, 66.46476, 129.374326, 66.46476),\n (129.374326, 77.187422, 129.374326, 66.46476),\n (175.722363, 77.187422, 129.374326, 77.187422),\n (82.04016, 77.187422, 82.04016, 66.46476),\n (129.374326, 66.46476, 82.04016, 66.46476),\n (129.374326, 77.187422, 82.04016, 77.187422),\n (113.270121, 61.949955, 113.464855, 61.949955),\n (113.270121, 61.949955, 113.270121, 66.46476),\n (113.464855, 66.46476, 113.464855, 61.949955),\n (161.049247, 66.46476, 161.049247, 61.949955),\n (161.049247, 61.949955, 129.499077, 61.949955),\n (129.499077, 66.46476, 129.499077, 61.949955),\n (97.277627, 66.46476, 97.277627, 61.949955),\n (129.499077, 61.949955, 113.464855, 61.949955),\n (113.270121, 61.949955, 97.277627, 61.949955),\n (189.722363, 172.049955, 200.445025, 172.049955),\n (189.722363, 91.187422, 200.445025, 91.187422),\n (200.445025, 172.049955, 200.445025, 91.187422),\n (189.722363, 172.049955, 189.722363, 91.187422),\n (204.95983, 126.973192, 200.445025, 126.973192),\n (204.95983, 126.973192, 204.95983, 127.305861),\n (200.445025, 127.305861, 204.95983, 127.305861),\n (200.445025, 154.697658, 204.95983, 154.697658),\n (200.445025, 99.652681, 204.95983, 99.652681),\n (204.95983, 154.697658, 204.95983, 127.305861),\n (204.95983, 126.973192, 204.95983, 99.652681)\n]\nVISIBLE_CIRCLES = [\n (128.6377, 162.2956, 3.706893)\n]\nVISIBLE_ARCS = [\n\n]\nHIDDEN_SEGMENTS = [\n (128.7149, 61.95, 128.7149, 77.1875),\n (144.6831, 61.95, 144.6831, 77.1875),\n (132.3446, 66.4648, 132.3446, 77.1875),\n (124.9308, 77.1875, 124.9308, 66.4648),\n (189.7224, 158.5888, 200.445, 158.5888),\n (189.7224, 166.0025, 200.445, 166.0025)\n]\n# (orient, text, p1, p2, base) for linear; (orient, text, center, radius, angle) for diameter\nDIMENSIONS = [\n ('horizontal', '99.9834', (82.0402, 91.1874), (175.7224, 91.1874), (128.8813, 102.1874)),\n ('aligned', '99.4725', (175.7224, 91.1874), (129.3743, 172.05), (143.0048, 126.1487)),\n ('aligned', '100', (129.3743, 172.05), (82.0402, 91.1874), (115.2004, 126.0618)),\n ('horizontal', '68.061', (97.2777, 99.6527), (161.0492, 99.6527), (129.1634, 110.6527)),\n ('vertical', '58.7474', (161.0492, 99.6527), (161.0492, 154.6977), (150.0492, 127.1752)),\n ('horizontal', '16.2624', (82.0402, 91.1874), (97.2777, 91.1874), (89.6589, 102.1874)),\n ('vertical', '9.0347', (97.2777, 91.1874), (97.2777, 99.6527), (86.2777, 95.4201)),\n ('aligned', '67.7132', (161.0492, 99.6527), (129.4991, 154.6977), (135.7306, 121.7052)),\n ('aligned', '68.0723', (129.4991, 154.6977), (97.2777, 99.6527), (122.8815, 121.6183)),\n ('horizontal', '33.7294', (113.0794, 100.027), (144.6831, 100.027), (128.8813, 111.027)),\n ('vertical', '29.1138', (144.6831, 100.027), (144.6831, 127.306), (133.6831, 113.6665)),\n ('horizontal', '33.127', (82.0402, 91.1874), (113.0794, 91.1874), (97.5598, 102.1874)),\n ('vertical', '9.4341', (113.0794, 91.1874), (113.0794, 100.027), (102.0794, 95.6072)),\n ('aligned', '33.557', (129.0476, 100.027), (144.6831, 127.306), (127.3218, 119.1365)),\n ('diameter', '%%c7.9124', (128.6377, 162.2956), 3.7069, 45),\n ('horizontal', '49.7318', (82.0402, 91.1874), (128.6377, 91.1874), (105.339, 102.1874)),\n ('vertical', '75.891', (128.6377, 91.1874), (128.6377, 162.2956), (117.6377, 126.7415)),\n ('horizontal', '11.4439', (189.7224, 91.1874), (200.445, 91.1874), (195.0837, 102.1874)),\n ('horizontal', '4.8185', (200.445, 99.6527), (204.9599, 99.6527), (202.7025, 110.6527)),\n ('horizontal', '16.2624', (200.445, 162.2956), (178.9997, 162.2956), (189.7224, 151.2956))\n]\n\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; _ds.dxf.dimasz = 2.5\n _ds.dxf.dimexe = 1.25; _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\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\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,\n angle=(0 if d[0] == \"horizontal\" else 90),\n 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,\n 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,\n 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,\n text=text, dimstyle=\"EZDXF\").render()\n\n doc.saveas(out_path)\n\n\nif __name__ == \"__main__\":\n out = sys.argv[1] if len(sys.argv) > 1 else \"0051_00514510_gt.dxf\"\n draw(out)\n print(\"wrote\", out)\n```"}], "images": ["images/0051_00514510.png"], "id": "0051_00514510"} {"messages": [{"role": "user", "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 7 straight edges, featuring 4 circular holes, each of diameter 5.88 mm. It is extruded to a thickness of 9.37 mm. The outline includes one or more oblique (angled) edges. A union feature: The part is a polygonal plate with 6 straight edges. It is extruded to a thickness of 40.06 mm. The outline includes one or more oblique (angled) edges."}, {"role": "assistant", "content": "```python\n#!/usr/bin/env python3\n# -*- coding: utf-8 -*-\n# Ground-truth 2D engineering drawing for part: 0053_00538513\n# Self-contained: reproduces the three-view DXF via ezdxf, NO FreeCAD needed.\n# Coordinates are A4 page millimetres (scale=0.6431088223435949, page=[297.0, 210.0]).\n# visible edges -> solid (layer OUTLINE); hidden edges -> dashed (layer HIDDEN)\n# dimensions -> real movable DIMENSION entities (text = true mm value)\n# Run: python 0053_00538513_gt.py [out.dxf]\nimport sys\nimport ezdxf\nimport math\n\nSCALE = 0.6431088223435949\nPAGE = [297.0, 210.0]\n\nVISIBLE_SEGMENTS = [\n (106.679836, 172.049991, 138.835277, 172.049991),\n (102.266344, 167.636499, 106.679836, 172.049991),\n (138.835277, 172.049991, 138.835277, 107.739109),\n (138.835277, 107.739109, 106.679836, 107.739109),\n (106.679836, 107.739109, 102.266344, 112.152601),\n (102.266344, 112.152601, 130.008294, 139.89455),\n (130.008294, 139.89455, 102.266344, 167.636499),\n (138.835277, 139.628993, 138.94447, 139.517659),\n (138.94447, 139.517659, 138.835277, 139.408467),\n (106.679836, 61.949991, 106.679836, 67.973192),\n (106.679836, 67.973192, 138.835277, 67.973192),\n (138.835277, 61.949991, 138.835277, 67.973192),\n (106.679836, 61.949991, 138.835277, 61.949991),\n (102.266344, 61.949991, 102.266344, 67.973192),\n (102.266344, 67.973192, 106.679836, 67.973192),\n (102.266344, 61.949991, 106.679836, 61.949991),\n (105.277945, 67.973192, 105.277945, 93.739109),\n (138.835277, 67.973192, 138.94447, 67.973192),\n (105.277945, 93.739109, 109.842898, 93.739109),\n (109.842898, 67.973192, 109.842898, 93.739109),\n (109.842898, 93.739109, 138.94447, 93.739109),\n (138.94447, 67.973192, 138.94447, 93.739109),\n (184.733588, 172.049991, 178.710387, 172.049991),\n (184.733588, 167.636499, 178.710387, 167.636499),\n (178.710387, 167.636499, 178.710387, 172.049991),\n (184.733588, 167.636499, 184.733588, 172.049991),\n (184.733588, 107.739109, 184.733588, 112.152601),\n (184.733588, 112.152601, 184.733588, 139.89455),\n (184.733588, 139.89455, 184.733588, 167.636499),\n (178.710387, 164.624898, 178.710387, 167.636499),\n (184.733588, 139.89455, 178.710387, 139.89455),\n (178.710387, 139.517659, 152.94447, 139.517659),\n (152.94447, 139.517659, 152.94447, 164.624898),\n (178.710387, 164.624898, 152.94447, 164.624898),\n (178.710387, 107.739109, 178.710387, 112.152601),\n (178.710387, 112.152601, 178.710387, 139.89455),\n (184.733588, 107.739109, 178.710387, 107.739109),\n (184.733588, 112.152601, 178.710387, 112.152601),\n (152.94447, 164.624898, 152.94447, 169.189851),\n (178.710387, 169.189851, 152.94447, 169.189851),\n (178.710387, 110.416087, 152.94447, 110.416087),\n (152.94447, 110.416087, 152.94447, 114.981039),\n (178.710387, 114.981039, 152.94447, 114.981039),\n (152.94447, 114.981039, 152.94447, 139.517659)\n]\nVISIBLE_CIRCLES = [\n (122.442308, 163.853506, 1.891497),\n (122.442308, 115.935594, 1.891497),\n (130.638792, 155.657021, 1.891497),\n (130.638792, 123.50158, 1.891497)\n]\nVISIBLE_ARCS = [\n\n]\nHIDDEN_SEGMENTS = [\n (105.278, 164.6249, 109.8429, 169.1899),\n (105.278, 114.981, 130.3852, 139.5177),\n (109.8429, 110.4161, 105.278, 114.981),\n (130.0083, 61.95, 130.0083, 67.9732),\n (130.3852, 67.9732, 130.3852, 93.7391),\n (124.3338, 61.95, 124.3338, 67.9732),\n (132.5303, 61.95, 132.5303, 67.9732),\n (120.5508, 67.9732, 120.5508, 61.95),\n (128.7473, 67.9732, 128.7473, 61.95),\n (178.7104, 161.962, 184.7336, 161.962),\n (178.7104, 165.745, 184.7336, 165.745),\n (178.7104, 114.0441, 184.7336, 114.0441),\n (178.7104, 117.8271, 184.7336, 117.8271),\n (178.7104, 153.7655, 184.7336, 153.7655),\n (178.7104, 157.5485, 184.7336, 157.5485),\n (178.7104, 121.6101, 184.7336, 121.6101),\n (178.7104, 125.3931, 184.7336, 125.3931)\n]\n# (orient, text, p1, p2, base) for linear; (orient, text, center, radius, angle) for diameter\nDIMENSIONS = [\n ('horizontal', '50', (106.6799, 172.05), (138.8353, 172.05), (122.7576, 183.05)),\n ('vertical', '100', (138.8353, 172.05), (138.8353, 107.7391), (149.8353, 139.8946)),\n ('aligned', '9.7054', (106.6799, 107.7391), (102.2664, 112.1526), (96.695, 102.1677)),\n ('aligned', '61.0053', (102.2664, 112.1526), (130.0083, 139.8946), (108.3592, 133.8017)),\n ('aligned', '61.0053', (130.0083, 139.8946), (102.2664, 167.6365), (108.3592, 145.9873)),\n ('aligned', '9.7054', (102.2664, 167.6365), (106.6799, 172.05), (96.6949, 177.6214)),\n ('diameter', '%%c5.8824', (122.4423, 163.8535), 1.8915, 45),\n ('horizontal', '7.0983', (102.2664, 163.8535), (122.4423, 163.8535), (112.3544, 174.8535)),\n ('vertical', '38.1531', (122.4423, 172.05), (122.4423, 163.8535), (133.4423, 167.9518)),\n ('diameter', '%%c5.8824', (122.4423, 115.9356), 1.8915, 45),\n ('horizontal', '11.7811', (102.2664, 115.9356), (122.4423, 115.9356), (112.3544, 126.9356)),\n ('vertical', '12.7451', (122.4423, 172.05), (122.4423, 115.9356), (133.4423, 143.9928)),\n ('diameter', '%%c5.8824', (130.6388, 155.657), 1.8915, 45),\n ('horizontal', '31.3725', (102.2664, 155.657), (130.6388, 155.657), (116.4526, 166.657)),\n ('vertical', '87.2549', (130.6388, 172.05), (130.6388, 155.657), (141.6388, 163.8535)),\n ('diameter', '%%c5.8824', (130.6388, 123.5016), 1.8915, 45),\n ('horizontal', '31.3725', (102.2664, 123.5016), (130.6388, 123.5016), (116.4526, 134.5016)),\n ('vertical', '25.4902', (130.6388, 172.05), (130.6388, 123.5016), (141.6388, 147.7758)),\n ('horizontal', '44.1176', (105.278, 169.1898), (138.9445, 169.1898), (122.1112, 180.1898)),\n ('vertical', '75.4902', (138.9445, 169.1898), (138.9445, 110.4161), (149.9445, 139.803)),\n ('horizontal', '39.4348', (102.2664, 172.05), (105.278, 172.05), (103.7722, 183.05)),\n ('aligned', '64.6256', (109.8429, 169.1898), (138.9445, 139.5176), (132.247, 162.056)),\n ('aligned', '63.9951', (138.9445, 139.5176), (109.8429, 110.4161), (132.1719, 117.1887)),\n ('aligned', '10.0385', (109.8429, 110.4161), (105.278, 114.981), (99.7823, 104.9204)),\n ('aligned', '54.5877', (105.278, 114.981), (130.3852, 139.5176), (110.1434, 135.1164)),\n ('aligned', '55.2115', (130.3852, 139.5176), (105.278, 164.6249), (110.0534, 144.2931)),\n ('aligned', '10.0385', (105.278, 164.6249), (109.8429, 169.1898), (99.7823, 174.6856)),\n ('horizontal', '9.3658', (184.7336, 172.05), (178.7104, 172.05), (181.722, 161.05)),\n ('horizontal', '40.0646', (178.7104, 169.1898), (152.9445, 169.1898), (165.8274, 158.1898))\n]\n\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; _ds.dxf.dimasz = 2.5\n _ds.dxf.dimexe = 1.25; _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\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\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,\n angle=(0 if d[0] == \"horizontal\" else 90),\n 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,\n 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,\n 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,\n text=text, dimstyle=\"EZDXF\").render()\n\n doc.saveas(out_path)\n\n\nif __name__ == \"__main__\":\n out = sys.argv[1] if len(sys.argv) > 1 else \"0053_00538513_gt.dxf\"\n draw(out)\n print(\"wrote\", out)\n```"}], "images": ["images/0053_00538513.png"], "id": "0053_00538513"} {"messages": [{"role": "user", "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 5.26 mm tall. It is extruded to a thickness of 12.5 mm. A union feature: The part is a circular plate with diameter 15.26 mm, featuring a circular hole of diameter 10.18 mm. It is extruded to a thickness of 25 mm. A union feature: The part is a circular plate with diameter 15.26 mm, featuring a circular hole of diameter 10.18 mm. It is extruded to a thickness of 25 mm. A union feature: The part is a circular plate with diameter 15.26 mm, featuring a circular hole of diameter 10.18 mm. It is extruded to a thickness of 25 mm."}, {"role": "assistant", "content": "```python\n#!/usr/bin/env python3\n# -*- coding: utf-8 -*-\n# Ground-truth 2D engineering drawing for part: 0056_00566716\n# Self-contained: reproduces the three-view DXF via ezdxf, NO FreeCAD needed.\n# Coordinates are A4 page millimetres (scale=1.1284991999999943, page=[297.0, 210.0]).\n# visible edges -> solid (layer OUTLINE); hidden edges -> dashed (layer HIDDEN)\n# dimensions -> real movable DIMENSION entities (text = true mm value)\n# Run: python 0056_00566716_gt.py [out.dxf]\nimport sys\nimport ezdxf\nimport math\n\nSCALE = 1.1284991999999943\nPAGE = [297.0, 210.0]\n\nVISIBLE_SEGMENTS = [\n (175.879869, 155.15124, 175.879869, 126.93876),\n (175.879869, 126.93876, 63.029949, 126.93876),\n (63.029949, 155.15124, 63.029949, 126.93876),\n (175.879869, 155.15124, 63.029949, 155.15124),\n (175.879869, 112.93876, 175.879869, 106.99929),\n (63.029949, 112.93876, 175.879869, 112.93876),\n (175.879869, 106.99929, 63.029949, 106.99929),\n (63.029949, 106.99929, 63.029949, 112.93876),\n (166.067371, 106.99929, 166.067371, 78.84868),\n (166.067371, 78.84868, 165.529106, 78.84868),\n (165.529106, 78.84868, 164.990842, 78.84868),\n (164.990842, 78.84868, 164.452577, 78.84868),\n (164.452577, 78.84868, 163.914313, 78.84868),\n (163.914313, 78.84868, 163.376049, 78.84868),\n (163.376049, 78.84868, 162.837784, 78.84868),\n (162.837784, 78.84868, 162.29952, 78.84868),\n (162.29952, 78.84868, 161.761255, 78.84868),\n (161.761255, 78.84868, 161.222991, 78.84868),\n (161.222991, 78.84868, 160.684727, 78.84868),\n (160.684727, 78.84868, 160.146462, 78.84868),\n (160.146462, 78.84868, 159.608198, 78.84868),\n (159.608198, 78.84868, 159.069933, 78.84868),\n (159.069933, 78.84868, 158.531669, 78.84868),\n (158.531669, 78.84868, 157.993404, 78.84868),\n (157.993404, 78.84868, 157.45514, 78.84868),\n (157.45514, 78.84868, 156.916876, 78.84868),\n (156.916876, 78.84868, 156.378611, 78.84868),\n (156.378611, 78.84868, 155.840347, 78.84868),\n (155.840347, 78.84868, 155.302082, 78.84868),\n (155.302082, 78.84868, 154.763818, 78.84868),\n (154.763818, 78.84868, 154.225553, 78.84868),\n (154.225553, 78.84868, 153.687289, 78.84868),\n (153.687289, 78.84868, 153.149025, 78.84868),\n (153.149025, 78.84868, 152.61076, 78.84868),\n (152.61076, 78.84868, 152.072496, 78.84868),\n (152.072496, 78.84868, 151.534231, 78.84868),\n (151.534231, 78.84868, 150.995967, 78.84868),\n (150.995967, 78.84868, 150.457703, 78.84868),\n (150.457703, 78.84868, 149.919438, 78.84868),\n (149.919438, 78.84868, 149.381174, 78.84868),\n (149.381174, 78.84868, 148.842909, 78.84868),\n (128.450731, 106.99929, 128.450731, 78.84868),\n (128.450731, 78.84868, 127.912466, 78.84868),\n (127.912466, 78.84868, 127.374202, 78.84868),\n (127.374202, 78.84868, 126.835937, 78.84868),\n (126.835937, 78.84868, 126.297673, 78.84868),\n (126.297673, 78.84868, 125.759409, 78.84868),\n (125.759409, 78.84868, 125.221144, 78.84868),\n (125.221144, 78.84868, 124.68288, 78.84868),\n (124.68288, 78.84868, 124.144615, 78.84868),\n (124.144615, 78.84868, 123.606351, 78.84868),\n (123.606351, 78.84868, 123.068087, 78.84868),\n (123.068087, 78.84868, 122.529822, 78.84868),\n (122.529822, 78.84868, 121.991558, 78.84868),\n (121.991558, 78.84868, 121.453293, 78.84868),\n (121.453293, 78.84868, 120.915029, 78.84868),\n (120.915029, 78.84868, 120.376764, 78.84868),\n (120.376764, 78.84868, 119.8385, 78.84868),\n (119.8385, 78.84868, 119.300236, 78.84868),\n (119.300236, 78.84868, 118.761971, 78.84868),\n (118.761971, 78.84868, 118.223707, 78.84868),\n (118.223707, 78.84868, 117.685442, 78.84868),\n (117.685442, 78.84868, 117.147178, 78.84868),\n (117.147178, 78.84868, 116.608913, 78.84868),\n (116.608913, 78.84868, 116.070649, 78.84868),\n (116.070649, 78.84868, 115.532385, 78.84868),\n (115.532385, 78.84868, 114.99412, 78.84868),\n (114.99412, 78.84868, 114.455856, 78.84868),\n (114.455856, 78.84868, 113.917591, 78.84868),\n (113.917591, 78.84868, 113.379327, 78.84868),\n (113.379327, 78.84868, 112.841063, 78.84868),\n (112.841063, 78.84868, 112.302798, 78.84868),\n (112.302798, 78.84868, 111.764534, 78.84868),\n (111.764534, 78.84868, 111.226269, 78.84868),\n (90.834091, 106.99929, 90.834091, 78.84868),\n (90.834091, 78.84868, 90.295826, 78.84868),\n (90.295826, 78.84868, 89.757562, 78.84868),\n (89.757562, 78.84868, 89.219297, 78.84868),\n (89.219297, 78.84868, 88.681033, 78.84868),\n (88.681033, 78.84868, 88.142769, 78.84868),\n (88.142769, 78.84868, 87.604504, 78.84868),\n (87.604504, 78.84868, 87.06624, 78.84868),\n (87.06624, 78.84868, 86.527975, 78.84868),\n (86.527975, 78.84868, 85.989711, 78.84868),\n (85.989711, 78.84868, 85.451447, 78.84868),\n (85.451447, 78.84868, 84.913182, 78.84868),\n (84.913182, 78.84868, 84.374918, 78.84868),\n (84.374918, 78.84868, 83.836653, 78.84868),\n (83.836653, 78.84868, 83.298389, 78.84868),\n (83.298389, 78.84868, 82.760124, 78.84868),\n (82.760124, 78.84868, 82.22186, 78.84868),\n (82.22186, 78.84868, 81.683596, 78.84868),\n (81.683596, 78.84868, 81.145331, 78.84868),\n (81.145331, 78.84868, 80.607067, 78.84868),\n (80.607067, 78.84868, 80.068802, 78.84868),\n (80.068802, 78.84868, 79.530538, 78.84868),\n (79.530538, 78.84868, 78.992273, 78.84868),\n (78.992273, 78.84868, 78.454009, 78.84868),\n (78.454009, 78.84868, 77.915745, 78.84868),\n (77.915745, 78.84868, 77.37748, 78.84868),\n (77.37748, 78.84868, 76.839216, 78.84868),\n (76.839216, 78.84868, 76.300951, 78.84868),\n (76.300951, 78.84868, 75.762687, 78.84868),\n (75.762687, 78.84868, 75.224423, 78.84868),\n (75.224423, 78.84868, 74.686158, 78.84868),\n (74.686158, 78.84868, 74.147894, 78.84868),\n (74.147894, 78.84868, 73.609629, 78.84868),\n (148.842909, 78.84868, 148.842909, 106.99929),\n (111.226269, 78.84868, 111.226269, 106.99929),\n (73.609629, 78.84868, 73.609629, 106.99929),\n (189.879869, 126.93876, 189.879869, 155.15124),\n (195.819339, 126.93876, 189.879869, 126.93876),\n (195.819339, 155.15124, 195.819339, 126.93876),\n (195.819339, 155.15124, 189.879869, 155.15124),\n (223.969949, 149.657231, 223.969949, 149.118966),\n (223.969949, 149.118966, 223.969949, 148.580702),\n (223.969949, 148.580702, 223.969949, 148.042437),\n (223.969949, 148.042437, 223.969949, 147.504173),\n (223.969949, 147.504173, 223.969949, 146.965909),\n (223.969949, 146.965909, 223.969949, 146.427644),\n (223.969949, 146.427644, 223.969949, 145.88938),\n (223.969949, 145.88938, 223.969949, 145.351115),\n (223.969949, 145.351115, 223.969949, 144.812851),\n (223.969949, 144.812851, 223.969949, 144.274587),\n (223.969949, 144.274587, 223.969949, 143.736322),\n (223.969949, 143.736322, 223.969949, 143.198058),\n (223.969949, 143.198058, 223.969949, 142.659793),\n (223.969949, 142.659793, 223.969949, 142.121529),\n (223.969949, 142.121529, 223.969949, 141.583264),\n (223.969949, 141.583264, 223.969949, 141.045),\n (223.969949, 141.045, 223.969949, 140.506736),\n (223.969949, 140.506736, 223.969949, 139.968471),\n (223.969949, 139.968471, 223.969949, 139.430207),\n (223.969949, 139.430207, 223.969949, 138.891942),\n (223.969949, 138.891942, 223.969949, 138.353678),\n (223.969949, 138.353678, 223.969949, 137.815413),\n (223.969949, 137.815413, 223.969949, 137.277149),\n (223.969949, 137.277149, 223.969949, 136.738885),\n (223.969949, 136.738885, 223.969949, 136.20062),\n (223.969949, 136.20062, 223.969949, 135.662356),\n (223.969949, 135.662356, 223.969949, 135.124091),\n (223.969949, 135.124091, 223.969949, 134.585827),\n (223.969949, 134.585827, 223.969949, 134.047563),\n (223.969949, 134.047563, 223.969949, 133.509298),\n (223.969949, 133.509298, 223.969949, 132.971034),\n (223.969949, 132.971034, 223.969949, 132.432769),\n (223.969949, 149.657231, 195.819339, 149.657231),\n (223.969949, 132.432769, 195.819339, 132.432769)\n]\nVISIBLE_CIRCLES = [\n (157.45514, 141.045, 8.612231),\n (119.8385, 141.045, 8.612231),\n (82.22186, 141.045, 8.612231),\n (157.45514, 141.045, 5.741487),\n (119.8385, 141.045, 5.741487),\n (82.22186, 141.045, 5.741487)\n]\nVISIBLE_ARCS = [\n\n]\nHIDDEN_SEGMENTS = [\n (163.1967, 106.9993, 163.1967, 78.8487),\n (125.58, 106.9993, 125.58, 78.8487),\n (87.9634, 106.9993, 87.9634, 78.8487),\n (151.7137, 78.8487, 151.7137, 106.9993),\n (114.0971, 78.8487, 114.0971, 106.9993),\n (76.4804, 78.8487, 76.4804, 106.9993),\n (223.97, 146.7865, 195.8194, 146.7865),\n (223.97, 135.3036, 195.8194, 135.3036)\n]\n# (orient, text, p1, p2, base) for linear; (orient, text, center, radius, angle) for diameter\nDIMENSIONS = [\n ('diameter', '%%c15.2632', (82.2219, 141.045), 8.6123, 45),\n ('diameter', '%%c10.1754', (82.2219, 141.045), 5.7415, 135),\n ('diameter', '%%c15.2632', (119.8385, 141.045), 8.6123, 45),\n ('diameter', '%%c10.1754', (119.8385, 141.045), 5.7415, 135),\n ('diameter', '%%c15.2632', (157.4551, 141.045), 8.6123, 45),\n ('diameter', '%%c10.1754', (157.4551, 141.045), 5.7415, 135),\n ('vertical', '25', (189.8799, 155.1513), (189.8799, 126.9388), (200.8799, 141.045)),\n ('horizontal', '24.9452', (195.7576, 141.045), (223.97, 141.045), (209.8638, 152.045)),\n ('horizontal', '24.9452', (195.7576, 141.045), (223.97, 141.045), (209.8638, 152.045)),\n ('horizontal', '25', (195.7576, 141.045), (223.97, 141.045), (209.8638, 152.045)),\n ('horizontal', '100', (175.8799, 106.9993), (63.03, 106.9993), (119.455, 95.9993)),\n ('vertical', '5.2632', (175.8799, 112.9388), (175.8799, 106.9993), (186.8799, 109.9691))\n]\n\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; _ds.dxf.dimasz = 2.5\n _ds.dxf.dimexe = 1.25; _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\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\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,\n angle=(0 if d[0] == \"horizontal\" else 90),\n 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,\n 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,\n 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,\n text=text, dimstyle=\"EZDXF\").render()\n\n doc.saveas(out_path)\n\n\nif __name__ == \"__main__\":\n out = sys.argv[1] if len(sys.argv) > 1 else \"0056_00566716_gt.dxf\"\n draw(out)\n print(\"wrote\", out)\n```"}], "images": ["images/0056_00566716.png"], "id": "0056_00566716"} {"messages": [{"role": "user", "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 91.58 mm tall. It is extruded to a thickness of 4.17 mm. A cut feature: The part is a circular plate with diameter 7.73 mm. It is extruded to a thickness of -7.81 mm. A cut feature: The part is a circular plate with diameter 7.89 mm. It is extruded to a thickness of -7.81 mm."}, {"role": "assistant", "content": "```python\n#!/usr/bin/env python3\n# -*- coding: utf-8 -*-\n# Ground-truth 2D engineering drawing for part: 0057_00573462\n# Self-contained: reproduces the three-view DXF via ezdxf, NO FreeCAD needed.\n# Coordinates are A4 page millimetres (scale=1.0037013284471197, page=[297.0, 210.0]).\n# visible edges -> solid (layer OUTLINE); hidden edges -> dashed (layer HIDDEN)\n# dimensions -> real movable DIMENSION entities (text = true mm value)\n# Run: python 0057_00573462_gt.py [out.dxf]\nimport sys\nimport ezdxf\nimport math\n\nSCALE = 1.0037013284471197\nPAGE = [297.0, 210.0]\n\nVISIBLE_SEGMENTS = [\n (184.593962, 80.132089, 184.593962, 172.05),\n (84.22383, 80.132089, 184.593962, 80.132089),\n (184.593962, 172.05, 84.22383, 172.05),\n (84.22383, 172.05, 84.22383, 80.132089),\n (184.593962, 66.132089, 184.593962, 61.95),\n (184.593962, 61.95, 84.22383, 61.95),\n (84.22383, 66.132089, 84.22383, 61.95),\n (184.593962, 66.132089, 84.22383, 66.132089),\n (198.593962, 80.132089, 202.776051, 80.132089),\n (198.593962, 172.05, 202.776051, 172.05),\n (198.593962, 172.05, 198.593962, 80.132089),\n (202.776051, 172.05, 202.776051, 80.132089)\n]\nVISIBLE_CIRCLES = [\n (134.188786, 126.135067, 3.961979),\n (100.209314, 148.091033, 3.879438)\n]\nVISIBLE_ARCS = [\n\n]\nHIDDEN_SEGMENTS = [\n (138.1508, 61.95, 138.1508, 66.1321),\n (104.0888, 61.95, 104.0888, 66.1321),\n (130.2269, 66.1321, 130.2269, 61.95),\n (96.3299, 66.1321, 96.3299, 61.95),\n (198.594, 122.1731, 202.7761, 122.1731),\n (198.594, 130.097, 202.7761, 130.097),\n (198.594, 144.2116, 202.7761, 144.2116),\n (198.594, 151.9705, 202.7761, 151.9705)\n]\n# (orient, text, p1, p2, base) for linear; (orient, text, center, radius, angle) for diameter\nDIMENSIONS = [\n ('horizontal', '100', (184.594, 172.05), (84.2239, 172.05), (134.409, 161.05)),\n ('vertical', '91.5789', (184.594, 80.1321), (184.594, 172.05), (173.594, 126.0911)),\n ('diameter', '%%c7.7303', (100.2093, 148.091), 3.8795, 45),\n ('horizontal', '15.9265', (84.2239, 80.1321), (100.2093, 80.1321), (92.2166, 91.1321)),\n ('vertical', '67.7083', (100.2093, 80.1321), (100.2093, 148.091), (89.2093, 114.1116)),\n ('diameter', '%%c7.8947', (134.1888, 126.1351), 3.962, 45),\n ('horizontal', '49.7807', (84.2239, 80.1321), (134.1888, 80.1321), (109.2064, 91.1321)),\n ('vertical', '45.8333', (134.1888, 80.1321), (134.1888, 126.1351), (123.1888, 103.1336)),\n ('horizontal', '4.1667', (198.594, 80.1321), (202.7761, 80.1321), (200.6851, 91.1321)),\n ('horizontal', '4.1667', (202.7761, 148.091), (194.9347, 148.091), (198.8554, 137.091)),\n ('horizontal', '4.1667', (202.7761, 126.1351), (194.9347, 126.1351), (198.8554, 115.1351))\n]\n\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; _ds.dxf.dimasz = 2.5\n _ds.dxf.dimexe = 1.25; _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\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\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,\n angle=(0 if d[0] == \"horizontal\" else 90),\n 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,\n 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,\n 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,\n text=text, dimstyle=\"EZDXF\").render()\n\n doc.saveas(out_path)\n\n\nif __name__ == \"__main__\":\n out = sys.argv[1] if len(sys.argv) > 1 else \"0057_00573462_gt.dxf\"\n draw(out)\n print(\"wrote\", out)\n```"}], "images": ["images/0057_00573462.png"], "id": "0057_00573462"} {"messages": [{"role": "user", "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 -2.92 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 rectangular cutout 122.27 x 123.74 mm. It is extruded to a thickness of 5.83 mm. The outline includes one or more oblique (angled) edges. A union feature: The part is a circular plate with diameter 18.75 mm, featuring a circular hole of diameter 7.98 mm. It is extruded to a thickness of 2.92 mm."}, {"role": "assistant", "content": "```python\n#!/usr/bin/env python3\n# -*- coding: utf-8 -*-\n# Ground-truth 2D engineering drawing for part: 0058_00586780\n# Self-contained: reproduces the three-view DXF via ezdxf, NO FreeCAD needed.\n# Coordinates are A4 page millimetres (scale=0.6399494121902931, page=[297.0, 210.0]).\n# visible edges -> solid (layer OUTLINE); hidden edges -> dashed (layer HIDDEN)\n# dimensions -> real movable DIMENSION entities (text = true mm value)\n# Run: python 0058_00586780_gt.py [out.dxf]\nimport sys\nimport ezdxf\nimport math\n\nSCALE = 0.6399494121902931\nPAGE = [297.0, 210.0]\n\nVISIBLE_SEGMENTS = [\n (133.229902, 81.547443, 133.701269, 82.01881),\n (88.921379, 126.7987, 133.229902, 81.547443),\n (178.481159, 126.7987, 134.172636, 172.049957),\n (134.172636, 172.049957, 88.921379, 126.7987),\n (134.172636, 81.547443, 178.481159, 126.7987),\n (88.921379, 126.7987, 134.172636, 81.547443),\n (134.172636, 166.39355, 94.577786, 126.7987),\n (172.824752, 126.7987, 134.172636, 166.39355),\n (134.172636, 87.20385, 172.824752, 126.7987),\n (94.577786, 126.7987, 134.172636, 87.20385),\n (178.481159, 65.681614, 178.481159, 67.547443),\n (88.921379, 65.681614, 88.921379, 67.547443),\n (178.481159, 67.547443, 134.172636, 67.547443),\n (134.172636, 67.547443, 134.172636, 61.949957),\n (178.481159, 61.949957, 134.172636, 61.949957),\n (178.481159, 65.681614, 178.481159, 61.949957),\n (134.172636, 67.547443, 88.921379, 67.547443),\n (88.921379, 65.681614, 88.921379, 61.949957),\n (134.172636, 61.949957, 88.921379, 61.949957),\n (194.346987, 81.547443, 192.481159, 81.547443),\n (194.346987, 126.7987, 192.481159, 126.7987),\n (192.481159, 126.7987, 192.481159, 81.547443),\n (194.346987, 126.7987, 194.346987, 81.547443),\n (192.481159, 172.049957, 198.078645, 172.049957),\n (192.481159, 172.049957, 192.481159, 126.7987),\n (194.346987, 126.7987, 198.078645, 126.7987),\n (198.078645, 172.049957, 198.078645, 126.7987),\n (198.078645, 126.7987, 198.078645, 81.547443),\n (194.346987, 81.547443, 198.078645, 81.547443)\n]\nVISIBLE_CIRCLES = [\n (133.7651, 126.7987, 6.000112),\n (133.7651, 126.7987, 2.553239)\n]\nVISIBLE_ARCS = [\n\n]\nHIDDEN_SEGMENTS = [\n (133.2299, 65.6817, 133.2299, 67.5475),\n (94.5778, 65.6817, 94.5778, 61.95),\n (172.8247, 65.6817, 172.8247, 61.95),\n (127.765, 65.6817, 139.7652, 65.6817),\n (139.7652, 65.6817, 139.7652, 63.8158),\n (139.7652, 63.8158, 127.765, 63.8158),\n (136.3183, 65.6817, 136.3183, 63.8158),\n (134.1726, 65.6817, 178.4811, 65.6817),\n (133.7013, 65.6817, 94.5778, 65.6817),\n (88.9214, 65.6817, 94.5778, 65.6817),\n (94.5778, 65.6817, 133.7013, 65.6817),\n (172.8247, 65.6817, 139.7652, 65.6817),\n (139.7652, 65.6817, 134.1726, 65.6817),\n (134.1726, 65.6817, 127.765, 65.6817),\n (127.765, 63.8158, 127.765, 65.6817),\n (131.2118, 63.8158, 131.2118, 65.6817),\n (194.347, 166.3936, 198.0786, 166.3936),\n (194.347, 87.2039, 198.0786, 87.2039),\n (196.2128, 132.7989, 196.2128, 120.7986),\n (194.347, 166.3936, 194.347, 129.352),\n (196.2128, 132.7989, 194.347, 132.7989),\n (196.2128, 120.7986, 194.347, 120.7986),\n (196.2128, 129.352, 194.347, 129.352),\n (196.2128, 124.2455, 194.347, 124.2455)\n]\n# (orient, text, p1, p2, base) for linear; (orient, text, center, radius, angle) for diameter\nDIMENSIONS = [\n ('aligned', '100', (133.2299, 81.5475), (178.4811, 126.7987), (148.0773, 111.9513)),\n ('aligned', '98.9638', (88.9214, 126.7987), (133.2299, 81.5475), (118.9352, 111.869)),\n ('horizontal', '139.948', (88.9214, 81.5475), (178.4811, 81.5475), (133.7013, 92.5475)),\n ('vertical', '141.421', (178.4811, 81.5475), (178.4811, 172.05), (167.4811, 126.7987)),\n ('vertical', '0', (88.9214, 81.5475), (88.9214, 81.5475), (88.9214, 81.5475)),\n ('vertical', '0', (88.9214, 81.5475), (88.9214, 81.5475), (88.9214, 81.5475)),\n ('aligned', '98.9638', (134.1726, 81.5475), (178.4811, 126.7987), (148.4673, 111.869)),\n ('aligned', '100', (88.9214, 126.7987), (134.1726, 81.5475), (119.3252, 111.9513)),\n ('horizontal', '122.271', (94.5778, 87.2039), (172.8248, 87.2039), (133.7013, 98.2039)),\n ('vertical', '123.744', (94.5778, 87.2039), (94.5778, 166.3936), (83.5778, 126.7987)),\n ('horizontal', '8.8388', (88.9214, 87.2039), (94.5778, 87.2039), (91.7496, 98.2039)),\n ('vertical', '8.8389', (94.5778, 81.5475), (94.5778, 87.2039), (83.5778, 84.3757)),\n ('diameter', '%%c18.7518', (133.7651, 126.7987), 6.0001, 45),\n ('diameter', '%%c7.9795', (133.7651, 126.7987), 2.5532, 135),\n ('horizontal', '2.9156', (194.347, 81.5475), (192.4811, 81.5475), (193.4141, 70.5475)),\n ('horizontal', '5.8312', (194.347, 81.5475), (198.0786, 81.5475), (196.2128, 92.5475)),\n ('horizontal', '5.8312', (194.347, 126.7987), (196.2128, 126.7987), (195.2799, 137.7987))\n]\n\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; _ds.dxf.dimasz = 2.5\n _ds.dxf.dimexe = 1.25; _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\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\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,\n angle=(0 if d[0] == \"horizontal\" else 90),\n 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,\n 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,\n 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,\n text=text, dimstyle=\"EZDXF\").render()\n\n doc.saveas(out_path)\n\n\nif __name__ == \"__main__\":\n out = sys.argv[1] if len(sys.argv) > 1 else \"0058_00586780_gt.dxf\"\n draw(out)\n print(\"wrote\", out)\n```"}], "images": ["images/0058_00586780.png"], "id": "0058_00586780"} {"messages": [{"role": "user", "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 12 edges within a 100 x 45.68 mm bounding box. It is extruded to a thickness of 11.47 mm. A cut feature: The part is a circular plate with diameter 4.51 mm. It is extruded to a thickness of -28.68 mm. A cut feature: The part is a circular plate with diameter 4.51 mm. It is extruded to a thickness of -28.68 mm."}, {"role": "assistant", "content": "```python\n#!/usr/bin/env python3\n# -*- coding: utf-8 -*-\n# Ground-truth 2D engineering drawing for part: 0059_00591344\n# Self-contained: reproduces the three-view DXF via ezdxf, NO FreeCAD needed.\n# Coordinates are A4 page millimetres (scale=0.5766000000000333, page=[297.0, 210.0]).\n# visible edges -> solid (layer OUTLINE); hidden edges -> dashed (layer HIDDEN)\n# dimensions -> real movable DIMENSION entities (text = true mm value)\n# Run: python 0059_00591344_gt.py [out.dxf]\nimport sys\nimport ezdxf\nimport math\n\nSCALE = 0.5766000000000333\nPAGE = [297.0, 210.0]\n\nVISIBLE_SEGMENTS = [\n (107.209607, 113.070764, 107.209607, 139.409283),\n (99.379237, 113.070764, 107.209607, 113.070764),\n (107.209607, 139.409283, 159.174793, 139.409283),\n (159.174793, 139.409283, 159.174793, 113.070764),\n (159.174793, 113.070764, 167.005163, 113.070764),\n (167.005163, 113.070764, 167.005163, 115.918172),\n (167.005163, 115.918172, 162.0222, 115.918172),\n (162.0222, 115.918172, 162.0222, 141.544838),\n (162.0222, 141.544838, 104.3622, 141.544838),\n (104.3622, 141.544838, 104.3622, 115.918172),\n (104.3622, 115.918172, 99.379237, 115.918172),\n (99.379237, 115.918172, 99.379237, 113.070764),\n (167.005163, 99.070764, 162.0222, 99.070764),\n (162.0222, 99.070764, 104.3622, 99.070764),\n (104.3622, 99.070764, 99.379237, 99.070764),\n (167.005163, 92.455185, 162.0222, 92.455185),\n (162.0222, 92.455185, 104.3622, 92.455185),\n (104.3622, 92.455185, 99.379237, 92.455185),\n (99.379237, 99.070764, 99.379237, 92.455185),\n (167.005163, 99.070764, 167.005163, 92.455185),\n (162.0222, 99.070764, 162.0222, 92.455185),\n (104.3622, 99.070764, 104.3622, 92.455185),\n (181.005163, 113.070764, 187.620743, 113.070764),\n (181.005163, 141.544838, 181.005163, 115.918172),\n (181.005163, 115.918172, 181.005163, 113.070764),\n (187.620743, 141.544838, 187.620743, 115.918172),\n (187.620743, 115.918172, 187.620743, 113.070764),\n (181.005163, 115.918172, 187.620743, 115.918172),\n (181.005163, 141.544838, 187.620743, 141.544838)\n]\nVISIBLE_CIRCLES = [\n (101.951962, 95.9332, 1.299903),\n (164.432438, 95.9332, 1.299903)\n]\nVISIBLE_ARCS = [\n\n]\nHIDDEN_SEGMENTS = [\n (103.2519, 113.0708, 103.2519, 115.9182),\n (100.6521, 113.0708, 100.6521, 115.9182),\n (165.7324, 113.0708, 165.7324, 115.9182),\n (163.1325, 113.0708, 163.1325, 115.9182),\n (107.2096, 99.0708, 107.2096, 92.4552),\n (159.1748, 99.0708, 159.1748, 92.4552),\n (181.0052, 139.4093, 187.6208, 139.4093),\n (185.4426, 115.9182, 185.4426, 113.0708),\n (182.8428, 113.0708, 182.8428, 115.9182)\n]\n# (orient, text, p1, p2, base) for linear; (orient, text, center, radius, angle) for diameter\nDIMENSIONS = [\n ('horizontal', '8.642', (167.0052, 115.9181), (162.0222, 115.9181), (164.5137, 104.9181)),\n ('horizontal', '13.5802', (159.1748, 113.0708), (167.0052, 113.0708), (163.09, 124.0708)),\n ('horizontal', '90.1235', (107.2096, 139.4093), (159.1748, 139.4093), (133.1922, 150.4093)),\n ('horizontal', '100', (162.0222, 141.5448), (104.3622, 141.5448), (133.1922, 130.5448)),\n ('vertical', '4.9383', (167.0052, 113.0708), (167.0052, 115.9181), (156.0052, 114.4945)),\n ('vertical', '44.4444', (162.0222, 115.9181), (162.0222, 141.5448), (151.0222, 128.7315)),\n ('vertical', '45.679', (107.2096, 113.0708), (107.2096, 139.4093), (96.2096, 126.24)),\n ('horizontal', '11.4734', (181.0052, 113.0708), (187.6207, 113.0708), (184.313, 124.0708)),\n ('vertical', '4.9383', (184.1427, 116.011), (184.1427, 99.4721), (195.1427, 107.7415)),\n ('diameter', '%%c4.5089', (164.4324, 95.9332), 1.2999, 45),\n ('vertical', '11.4734', (164.4324, 99.0708), (164.4324, 99.0708), (164.4324, 99.0708)),\n ('diameter', '%%c4.5089', (101.952, 95.9332), 1.2999, 45),\n ('horizontal', '112.822', (99.3793, 99.0708), (101.952, 99.0708), (100.6656, 110.0708))\n]\n\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; _ds.dxf.dimasz = 2.5\n _ds.dxf.dimexe = 1.25; _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\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\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,\n angle=(0 if d[0] == \"horizontal\" else 90),\n 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,\n 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,\n 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,\n text=text, dimstyle=\"EZDXF\").render()\n\n doc.saveas(out_path)\n\n\nif __name__ == \"__main__\":\n out = sys.argv[1] if len(sys.argv) > 1 else \"0059_00591344_gt.dxf\"\n draw(out)\n print(\"wrote\", out)\n```"}], "images": ["images/0059_00591344.png"], "id": "0059_00591344"} {"messages": [{"role": "user", "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 12 edges within a 100 x 20 mm bounding box. It is extruded to a thickness of 61.85 mm. A cut feature: The part is a circular plate with diameter 20 mm. It is extruded to a thickness of -136.07 mm. A cut feature: The part is a circular plate with diameter 20 mm. It is extruded to a thickness of -136.07 mm. A cut feature: The part is a circular plate with diameter 19.58 mm. It is extruded to a thickness of -136.07 mm. A cut feature: The part is a circular plate with diameter 19.58 mm. It is extruded to a thickness of -136.07 mm."}, {"role": "assistant", "content": "```python\n#!/usr/bin/env python3\n# -*- coding: utf-8 -*-\n# Ground-truth 2D engineering drawing for part: 0059_00595102\n# Self-contained: reproduces the three-view DXF via ezdxf, NO FreeCAD needed.\n# Coordinates are A4 page millimetres (scale=0.515578947368421, page=[297.0, 210.0]).\n# visible edges -> solid (layer OUTLINE); hidden edges -> dashed (layer HIDDEN)\n# dimensions -> real movable DIMENSION entities (text = true mm value)\n# Run: python 0059_00595102_gt.py [out.dxf]\nimport sys\nimport ezdxf\nimport math\n\nSCALE = 0.515578947368421\nPAGE = [297.0, 210.0]\n\nVISIBLE_SEGMENTS = [\n (110.888864, 144.455326, 110.888864, 152.18901),\n (59.330969, 144.455326, 110.888864, 144.455326),\n (110.888864, 152.18901, 130.223074, 152.18901),\n (130.223074, 152.18901, 130.223074, 144.455326),\n (130.223074, 144.455326, 181.780969, 144.455326),\n (181.780969, 144.455326, 181.780969, 138.010589),\n (181.780969, 138.010589, 130.223074, 138.010589),\n (130.223074, 138.010589, 130.223074, 127.69901),\n (130.223074, 127.69901, 110.888864, 127.69901),\n (110.888864, 127.69901, 110.888864, 138.010589),\n (110.888864, 138.010589, 59.330969, 138.010589),\n (59.330969, 138.010589, 59.330969, 144.455326),\n (110.888864, 81.81099, 110.888864, 113.69901),\n (59.330969, 81.81099, 59.330969, 113.69901),\n (59.330969, 113.69901, 110.888864, 113.69901),\n (59.330969, 81.81099, 110.888864, 81.81099),\n (110.888864, 113.69901, 130.223074, 113.69901),\n (130.223074, 81.81099, 130.223074, 113.69901),\n (110.888864, 81.81099, 130.223074, 81.81099),\n (130.223074, 81.81099, 181.780969, 81.81099),\n (130.223074, 113.69901, 181.780969, 113.69901),\n (181.780969, 81.81099, 181.780969, 113.69901),\n (195.780969, 144.455326, 195.780969, 152.18901),\n (227.66899, 152.18901, 195.780969, 152.18901),\n (227.66899, 144.455326, 227.66899, 152.18901),\n (227.66899, 144.455326, 195.780969, 144.455326),\n (227.66899, 127.69901, 227.66899, 138.010589),\n (227.66899, 138.010589, 227.66899, 144.455326),\n (195.780969, 127.69901, 195.780969, 138.010589),\n (195.780969, 138.010589, 195.780969, 144.455326),\n (227.66899, 138.010589, 195.780969, 138.010589),\n (227.66899, 127.69901, 195.780969, 127.69901)\n]\nVISIBLE_CIRCLES = [\n (69.588842, 103.494844, 5.155789),\n (88.721654, 103.494844, 5.155789),\n (152.497696, 92.015156, 5.048377),\n (171.630508, 92.015156, 5.048377)\n]\nVISIBLE_ARCS = [\n\n]\nHIDDEN_SEGMENTS = [\n (74.7447, 138.0777, 74.7447, 144.4553),\n (93.8775, 138.0777, 93.8775, 144.4553),\n (157.5461, 138.0777, 157.5461, 144.4553),\n (176.6789, 138.0777, 176.6789, 144.4553),\n (64.4331, 144.4553, 64.4331, 138.0777),\n (83.5659, 144.4553, 83.5659, 138.0777),\n (147.4493, 144.4553, 147.4493, 138.0777),\n (166.5822, 144.4553, 166.5822, 138.0777),\n (200.8294, 144.4553, 200.8294, 138.0777),\n (211.1409, 144.4553, 211.1409, 138.0777),\n (212.4165, 144.4553, 212.4165, 138.0777),\n (222.5132, 144.4553, 222.5132, 138.0777)\n]\n# (orient, text, p1, p2, base) for linear; (orient, text, center, radius, angle) for diameter\nDIMENSIONS = [\n ('horizontal', '37.5', (110.8889, 152.189), (130.2231, 152.189), (120.556, 163.189)),\n ('horizontal', '100', (130.2231, 144.4553), (181.781, 144.4553), (156.002, 155.4553)),\n ('vertical', '12.5', (181.781, 144.4553), (181.781, 138.0106), (192.781, 141.233)),\n ('vertical', '15', (110.8889, 144.4553), (110.8889, 152.189), (99.8889, 148.3222)),\n ('vertical', '20', (130.2231, 138.0106), (130.2231, 127.699), (141.2231, 132.8548)),\n ('horizontal', '61.849', (227.669, 144.4553), (195.781, 144.4553), (211.725, 133.4553)),\n ('diameter', '%%c20', (69.5888, 103.4948), 5.1558, 45),\n ('horizontal', '19.8958', (59.331, 81.811), (69.5888, 81.811), (64.4599, 92.811)),\n ('diameter', '%%c20', (88.7217, 103.4948), 5.1558, 45),\n ('horizontal', '57.0052', (59.331, 81.811), (88.7217, 81.811), (74.0263, 92.811)),\n ('diameter', '%%c19.5833', (152.4977, 92.0152), 5.0484, 45),\n ('horizontal', '180.703', (59.331, 81.811), (152.4977, 81.811), (105.9143, 92.811)),\n ('diameter', '%%c19.5833', (171.6305, 92.0152), 5.0484, 45),\n ('horizontal', '217.812', (59.331, 81.811), (171.6305, 81.811), (115.4808, 92.811))\n]\n\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; _ds.dxf.dimasz = 2.5\n _ds.dxf.dimexe = 1.25; _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\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\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,\n angle=(0 if d[0] == \"horizontal\" else 90),\n 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,\n 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,\n 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,\n text=text, dimstyle=\"EZDXF\").render()\n\n doc.saveas(out_path)\n\n\nif __name__ == \"__main__\":\n out = sys.argv[1] if len(sys.argv) > 1 else \"0059_00595102_gt.dxf\"\n draw(out)\n print(\"wrote\", out)\n```"}], "images": ["images/0059_00595102.png"], "id": "0059_00595102"} {"messages": [{"role": "user", "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 12 edges within a 100 x 34.74 mm bounding box, featuring a circular hole of diameter 23.16 mm. It is extruded to a thickness of 25 mm. A union feature: The part is a rectangular plate 100 mm wide and 50.53 mm tall, featuring a circular hole of diameter 25.26 mm. It is extruded to a thickness of 25 mm. A union feature: The part is a rectangular plate 18.75 mm wide and 29.69 mm tall. It is extruded to a thickness of 50 mm. A union feature: The part is a rectangular plate 18.75 mm wide and 29.69 mm tall. It is extruded to a thickness of 50 mm."}, {"role": "assistant", "content": "```python\n#!/usr/bin/env python3\n# -*- coding: utf-8 -*-\n# Ground-truth 2D engineering drawing for part: 0059_00598249\n# Self-contained: reproduces the three-view DXF via ezdxf, NO FreeCAD needed.\n# Coordinates are A4 page millimetres (scale=0.4805, page=[297.0, 210.0]).\n# visible edges -> solid (layer OUTLINE); hidden edges -> dashed (layer HIDDEN)\n# dimensions -> real movable DIMENSION entities (text = true mm value)\n# Run: python 0059_00598249_gt.py [out.dxf]\nimport sys\nimport ezdxf\nimport math\n\nSCALE = 0.4805\nPAGE = [297.0, 210.0]\n\nVISIBLE_SEGMENTS = [\n (148.512505, 140.691082, 148.512505, 99.975029),\n (100.462505, 99.975029, 148.512505, 99.975029),\n (109.566716, 140.691082, 100.462505, 140.691082),\n (100.462505, 140.691082, 100.462505, 99.975029),\n (148.512505, 140.691082, 139.408295, 140.691082),\n (139.408295, 140.691082, 139.408295, 155.358976),\n (139.408295, 155.358976, 139.50313, 155.358976),\n (148.512505, 155.532841, 148.512505, 172.050029),\n (148.512505, 172.050029, 100.462505, 172.050029),\n (100.462505, 172.050029, 100.462505, 155.532841),\n (109.47188, 155.358976, 109.566716, 155.358976),\n (109.566716, 155.358976, 109.566716, 140.691082),\n (109.47188, 141.267998, 109.47188, 155.532841),\n (100.462505, 141.267998, 109.47188, 141.267998),\n (100.462505, 155.532841, 100.462505, 141.267998),\n (148.512505, 141.267998, 148.512505, 155.532841),\n (109.47188, 155.532841, 100.462505, 155.532841),\n (148.512505, 155.532841, 139.50313, 155.532841),\n (139.50313, 155.532841, 139.50313, 141.267998),\n (139.50313, 141.267998, 148.512505, 141.267998),\n (148.512505, 85.975029, 100.462505, 85.975029),\n (148.512505, 73.962529, 100.462505, 73.962529),\n (109.47188, 73.962529, 109.47188, 61.950029),\n (100.462505, 85.975029, 100.462505, 73.962529),\n (100.462505, 73.962529, 100.462505, 61.950029),\n (148.512505, 85.975029, 148.512505, 73.962529),\n (148.512505, 73.962529, 148.512505, 61.950029),\n (109.47188, 61.950029, 100.462505, 61.950029),\n (148.512505, 61.950029, 139.50313, 61.950029),\n (139.50313, 73.962529, 139.50313, 61.950029),\n (162.512505, 99.975029, 162.512505, 140.691082),\n (162.512505, 141.267998, 162.512505, 172.050029),\n (162.512505, 141.267998, 162.512505, 140.691082),\n (162.512505, 99.975029, 174.525005, 99.975029),\n (174.525005, 140.691082, 174.525005, 99.975029),\n (174.525005, 172.050029, 174.525005, 155.532841),\n (174.525005, 141.267998, 174.525005, 140.691082),\n (162.512505, 140.691082, 174.525005, 140.691082),\n (162.512505, 141.267998, 186.537505, 141.267998),\n (162.512505, 172.050029, 174.525005, 172.050029),\n (174.525005, 155.532841, 186.537505, 155.532841),\n (186.537505, 155.532841, 186.537505, 141.267998)\n]\nVISIBLE_CIRCLES = [\n (124.7404, 112.113976, 6.069474),\n (124.7404, 148.277924, 5.563684)\n]\nVISIBLE_ARCS = [\n\n]\nHIDDEN_SEGMENTS = [\n (130.8099, 85.975, 130.8099, 73.9625),\n (130.3041, 85.975, 130.3041, 73.9625),\n (118.6709, 73.9625, 118.6709, 85.975),\n (119.1767, 73.9625, 119.1767, 85.975),\n (174.525, 118.1834, 162.5125, 118.1834),\n (174.525, 106.0445, 162.5125, 106.0445),\n (174.525, 153.8416, 162.5125, 153.8416),\n (174.525, 142.7142, 162.5125, 142.7142)\n]\n# (orient, text, p1, p2, base) for linear; (orient, text, center, radius, angle) for diameter\nDIMENSIONS = [\n ('horizontal', '18.9474', (148.5125, 140.691), (139.4083, 140.691), (143.9604, 129.691)),\n ('horizontal', '100', (148.5125, 172.05), (100.4625, 172.05), (124.4875, 161.05)),\n ('vertical', '30.5263', (139.4083, 140.691), (139.4083, 155.359), (128.4083, 148.025)),\n ('diameter', '%%c23.1579', (124.7404, 148.2779), 5.5637, 45),\n ('horizontal', '50.5263', (100.4625, 148.2779), (124.7404, 148.2779), (112.6014, 159.2779)),\n ('vertical', '50.5263', (124.7404, 124.0), (124.7404, 148.2779), (113.7404, 136.1389)),\n ('horizontal', '100', (100.4625, 99.975), (148.5125, 99.975), (124.4875, 110.975)),\n ('vertical', '50.5263', (148.5125, 99.975), (148.5125, 124.2529), (137.5125, 112.1139)),\n ('vertical', '50', (100.4625, 124.0), (100.4625, 99.975), (111.4625, 111.9875)),\n ('diameter', '%%c25.2632', (124.7404, 112.114), 6.0695, 45),\n ('horizontal', '50.5263', (100.4625, 112.114), (124.7404, 112.114), (112.6014, 123.114)),\n ('vertical', '25.2632', (124.7404, 99.975), (124.7404, 112.114), (113.7404, 106.0445)),\n ('horizontal', '18.75', (100.4625, 141.268), (109.4719, 141.268), (104.9672, 152.268)),\n ('vertical', '29.6875', (109.4719, 141.268), (109.4719, 155.5328), (98.4719, 148.4004)),\n ('vertical', '35.9375', (100.4625, 124.0), (100.4625, 141.268), (89.4625, 132.634)),\n ('horizontal', '18.75', (139.5031, 141.268), (148.5125, 141.268), (144.0078, 152.268)),\n ('vertical', '29.6875', (148.5125, 141.268), (148.5125, 155.5328), (137.5125, 148.4004)),\n ('horizontal', '81.25', (100.4625, 124.0), (139.5031, 124.0), (119.9828, 135.0)),\n ('vertical', '35.9375', (139.5031, 124.0), (139.5031, 141.268), (128.5031, 132.634)),\n ('horizontal', '25', (162.5125, 99.975), (174.525, 99.975), (168.5188, 110.975)),\n ('horizontal', '50', (162.5125, 141.268), (186.5375, 141.268), (174.525, 152.268)),\n ('horizontal', '50', (162.5125, 141.268), (186.5375, 141.268), (174.525, 152.268))\n]\n\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; _ds.dxf.dimasz = 2.5\n _ds.dxf.dimexe = 1.25; _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\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\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,\n angle=(0 if d[0] == \"horizontal\" else 90),\n 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,\n 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,\n 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,\n text=text, dimstyle=\"EZDXF\").render()\n\n doc.saveas(out_path)\n\n\nif __name__ == \"__main__\":\n out = sys.argv[1] if len(sys.argv) > 1 else \"0059_00598249_gt.dxf\"\n draw(out)\n print(\"wrote\", out)\n```"}], "images": ["images/0059_00598249.png"], "id": "0059_00598249"} {"messages": [{"role": "user", "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 20 mm tall. It is extruded to a thickness of 9.9 mm. A cut feature: The part is a circular plate with diameter 12.63 mm. It is extruded to a thickness of 19.79 mm. A cut feature: The part is a circular plate with diameter 12.63 mm. It is extruded to a thickness of 19.79 mm. A cut feature: The part is a circular plate with diameter 12.63 mm. It is extruded to a thickness of 19.79 mm."}, {"role": "assistant", "content": "```python\n#!/usr/bin/env python3\n# -*- coding: utf-8 -*-\n# Ground-truth 2D engineering drawing for part: 0060_00602788\n# Self-contained: reproduces the three-view DXF via ezdxf, NO FreeCAD needed.\n# Coordinates are A4 page millimetres (scale=1.2245, page=[297.0, 210.0]).\n# visible edges -> solid (layer OUTLINE); hidden edges -> dashed (layer HIDDEN)\n# dimensions -> real movable DIMENSION entities (text = true mm value)\n# Run: python 0060_00602788_gt.py [out.dxf]\nimport sys\nimport ezdxf\nimport math\n\nSCALE = 1.2245\nPAGE = [297.0, 210.0]\n\nVISIBLE_SEGMENTS = [\n (191.666274, 142.303748, 191.666274, 117.813748),\n (69.216274, 142.303748, 191.666274, 142.303748),\n (191.666274, 117.813748, 69.216274, 117.813748),\n (69.216274, 117.813748, 69.216274, 142.303748),\n (191.666274, 91.6963, 191.666274, 103.813748),\n (69.216274, 91.6963, 69.216274, 103.813748),\n (69.216274, 103.813748, 191.666274, 103.813748),\n (69.216274, 91.6963, 191.666274, 91.6963),\n (217.783722, 142.303748, 205.666274, 142.303748),\n (217.783722, 117.813748, 205.666274, 117.813748),\n (217.783722, 117.813748, 217.783722, 142.303748),\n (205.666274, 117.813748, 205.666274, 142.303748)\n]\nVISIBLE_CIRCLES = [\n (87.791885, 130.1863, 7.733684),\n (130.521833, 130.1863, 7.733684),\n (173.251781, 130.1863, 7.733684)\n]\nVISIBLE_ARCS = [\n\n]\nHIDDEN_SEGMENTS = [\n (95.5256, 91.6963, 95.5256, 103.8137),\n (138.2555, 91.6963, 138.2555, 103.8137),\n (180.9855, 91.6963, 180.9855, 103.8137),\n (80.0582, 103.8137, 80.0582, 91.6963),\n (122.7882, 103.8137, 122.7882, 91.6963),\n (165.5181, 103.8137, 165.5181, 91.6963),\n (205.6663, 122.4526, 217.7837, 122.4526),\n (205.6663, 137.92, 217.7837, 137.92)\n]\n# (orient, text, p1, p2, base) for linear; (orient, text, center, radius, angle) for diameter\nDIMENSIONS = [\n ('horizontal', '100', (191.6663, 117.8137), (69.2163, 117.8137), (130.4413, 106.8137)),\n ('vertical', '20', (191.6663, 142.3037), (191.6663, 117.8137), (202.6663, 130.0587)),\n ('diameter', '%%c12.6316', (130.5218, 130.1863), 7.7337, 45),\n ('horizontal', '50.0658', (69.2163, 142.3037), (130.5218, 142.3037), (99.8691, 153.3037)),\n ('vertical', '9.8958', (130.5218, 142.3037), (130.5218, 130.1863), (141.5218, 136.245)),\n ('diameter', '%%c12.6316', (87.7919, 130.1863), 7.7337, 45),\n ('horizontal', '15.17', (69.2163, 142.3037), (87.7919, 142.3037), (78.5041, 153.3037)),\n ('vertical', '9.8958', (87.7919, 142.3037), (87.7919, 130.1863), (98.7919, 136.245)),\n ('diameter', '%%c12.6316', (173.2518, 130.1863), 7.7337, 45),\n ('horizontal', '84.9616', (69.2163, 142.3037), (173.2518, 142.3037), (121.234, 153.3037)),\n ('vertical', '9.8958', (173.2518, 142.3037), (173.2518, 130.1863), (184.2518, 136.245)),\n ('horizontal', '9.8958', (217.7837, 142.3037), (205.6663, 142.3037), (211.725, 131.3037)),\n ('horizontal', '9.8958', (217.7837, 130.1863), (193.5488, 130.1863), (205.6663, 119.1863)),\n ('horizontal', '9.8958', (217.7837, 130.1863), (193.5488, 130.1863), (205.6663, 119.1863)),\n ('horizontal', '19.7917', (217.7837, 130.1863), (193.5488, 130.1863), (205.6663, 119.1863))\n]\n\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; _ds.dxf.dimasz = 2.5\n _ds.dxf.dimexe = 1.25; _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\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\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,\n angle=(0 if d[0] == \"horizontal\" else 90),\n 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,\n 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,\n 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,\n text=text, dimstyle=\"EZDXF\").render()\n\n doc.saveas(out_path)\n\n\nif __name__ == \"__main__\":\n out = sys.argv[1] if len(sys.argv) > 1 else \"0060_00602788_gt.dxf\"\n draw(out)\n print(\"wrote\", out)\n```"}], "images": ["images/0060_00602788.png"], "id": "0060_00602788"} {"messages": [{"role": "user", "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": "assistant", "content": "```python\n#!/usr/bin/env python3\n# -*- coding: utf-8 -*-\n# Ground-truth 2D engineering drawing for part: 0065_00652168\n# Self-contained: reproduces the three-view DXF via ezdxf, NO FreeCAD needed.\n# Coordinates are A4 page millimetres (scale=0.577115281501345, page=[297.0, 210.0]).\n# visible edges -> solid (layer OUTLINE); hidden edges -> dashed (layer HIDDEN)\n# dimensions -> real movable DIMENSION entities (text = true mm value)\n# Run: python 0065_00652168_gt.py [out.dxf]\nimport sys\nimport ezdxf\nimport math\n\nSCALE = 0.577115281501345\nPAGE = [297.0, 210.0]\n\nVISIBLE_SEGMENTS = [\n (101.361344, 172.049966, 136.037447, 172.049966),\n (83.654398, 141.8006, 101.361344, 172.049966),\n (136.037447, 172.049966, 153.744393, 141.8006),\n (153.744393, 141.8006, 136.037447, 111.551234),\n (136.037447, 111.551234, 101.361344, 111.551234),\n (101.361344, 111.551234, 83.654398, 141.8006),\n (83.654398, 61.949966, 83.654398, 85.684145),\n (153.744393, 61.949966, 153.744393, 85.684145),\n (153.744393, 61.949966, 136.037447, 61.949966),\n (136.037447, 61.949966, 101.361344, 61.949966),\n (101.361344, 61.949966, 83.654398, 61.949966),\n (153.744393, 85.684145, 136.037447, 85.684145),\n (136.037447, 85.684145, 101.361344, 85.684145),\n (101.361344, 85.684145, 83.654398, 85.684145),\n (101.361344, 61.949966, 101.361344, 85.684145),\n (136.037447, 61.949966, 136.037447, 85.684145),\n (148.041164, 85.684145, 148.041164, 97.551234),\n (148.041164, 97.551234, 146.237679, 97.551234),\n (146.237679, 97.551234, 144.434194, 97.551234),\n (144.434194, 97.551234, 142.630708, 97.551234),\n (142.630708, 97.551234, 140.827223, 97.551234),\n (140.827223, 97.551234, 139.023738, 97.551234),\n (139.023738, 97.551234, 137.220253, 97.551234),\n (137.220253, 97.551234, 135.416767, 97.551234),\n (135.416767, 97.551234, 133.613282, 97.551234),\n (133.613282, 97.551234, 131.809797, 97.551234),\n (131.809797, 97.551234, 130.006312, 97.551234),\n (130.006312, 97.551234, 128.202826, 97.551234),\n (128.202826, 97.551234, 126.399341, 97.551234),\n (126.399341, 97.551234, 124.595856, 97.551234),\n (124.595856, 97.551234, 122.792371, 97.551234),\n (122.792371, 97.551234, 120.988885, 97.551234),\n (120.988885, 97.551234, 119.1854, 97.551234),\n (119.1854, 97.551234, 117.381915, 97.551234),\n (117.381915, 97.551234, 115.578429, 97.551234),\n (115.578429, 97.551234, 113.774944, 97.551234),\n (113.774944, 97.551234, 111.971459, 97.551234),\n (111.971459, 97.551234, 110.167974, 97.551234),\n (110.167974, 97.551234, 108.364488, 97.551234),\n (108.364488, 97.551234, 106.561003, 97.551234),\n (106.561003, 97.551234, 104.757518, 97.551234),\n (104.757518, 97.551234, 102.954033, 97.551234),\n (102.954033, 97.551234, 101.150547, 97.551234),\n (101.150547, 97.551234, 99.347062, 97.551234),\n (99.347062, 97.551234, 97.543577, 97.551234),\n (97.543577, 97.551234, 95.740092, 97.551234),\n (95.740092, 97.551234, 93.936606, 97.551234),\n (93.936606, 97.551234, 92.133121, 97.551234),\n (92.133121, 97.551234, 90.329636, 97.551234),\n (90.329636, 97.551234, 90.329636, 85.684145),\n (167.744393, 172.049966, 191.478572, 172.049966),\n (167.744393, 141.8006, 191.478572, 141.8006),\n (191.478572, 141.8006, 191.478572, 172.049966),\n (167.744393, 141.8006, 167.744393, 172.049966),\n (167.744393, 111.551234, 167.744393, 141.8006),\n (191.478572, 111.551234, 191.478572, 141.8006),\n (167.744393, 111.551234, 191.478572, 111.551234),\n (203.345661, 112.944836, 203.345661, 114.748321),\n (203.345661, 114.748321, 203.345661, 116.551806),\n (203.345661, 116.551806, 203.345661, 118.355292),\n (203.345661, 118.355292, 203.345661, 120.158777),\n (203.345661, 120.158777, 203.345661, 121.962262),\n (203.345661, 121.962262, 203.345661, 123.765747),\n (203.345661, 123.765747, 203.345661, 125.569233),\n (203.345661, 125.569233, 203.345661, 127.372718),\n (203.345661, 127.372718, 203.345661, 129.176203),\n (203.345661, 129.176203, 203.345661, 130.979688),\n (203.345661, 130.979688, 203.345661, 132.783174),\n (203.345661, 132.783174, 203.345661, 134.586659),\n (203.345661, 134.586659, 203.345661, 136.390144),\n (203.345661, 136.390144, 203.345661, 138.193629),\n (203.345661, 138.193629, 203.345661, 139.997115),\n (203.345661, 139.997115, 203.345661, 141.8006),\n (203.345661, 141.8006, 203.345661, 143.604085),\n (203.345661, 143.604085, 203.345661, 145.407571),\n (203.345661, 145.407571, 203.345661, 147.211056),\n (203.345661, 147.211056, 203.345661, 149.014541),\n (203.345661, 149.014541, 203.345661, 150.818026),\n (203.345661, 150.818026, 203.345661, 152.621512),\n (203.345661, 152.621512, 203.345661, 154.424997),\n (203.345661, 154.424997, 203.345661, 156.228482),\n (203.345661, 156.228482, 203.345661, 158.031967),\n (203.345661, 158.031967, 203.345661, 159.835453),\n (203.345661, 159.835453, 203.345661, 161.638938),\n (203.345661, 161.638938, 203.345661, 163.442423),\n (203.345661, 163.442423, 203.345661, 165.245908),\n (203.345661, 165.245908, 203.345661, 167.049394),\n (203.345661, 167.049394, 203.345661, 168.852879),\n (203.345661, 168.852879, 203.345661, 170.656364),\n (203.345661, 112.944836, 191.478572, 112.944836),\n (203.345661, 170.656364, 191.478572, 170.656364)\n]\nVISIBLE_CIRCLES = [\n (119.1854, 141.8006, 28.855764)\n]\nVISIBLE_ARCS = [\n\n]\nHIDDEN_SEGMENTS = [\n\n]\n# (orient, text, p1, p2, base) for linear; (orient, text, center, radius, angle) for diameter\nDIMENSIONS = [\n ('horizontal', '60.0852', (101.3613, 111.5513), (136.0374, 111.5513), (118.6994, 122.5513)),\n ('aligned', '60.7345', (136.0374, 111.5513), (153.7443, 141.8006), (135.3977, 132.2329)),\n ('aligned', '60.7345', (153.7443, 141.8006), (136.0374, 172.05), (135.3977, 151.3684)),\n ('aligned', '60.7345', (101.3613, 172.05), (83.6544, 141.8006), (102.001, 151.3684)),\n ('aligned', '60.7345', (83.6544, 141.8006), (101.3613, 111.5513), (102.001, 132.2329)),\n ('diameter', '%%c100', (119.1854, 141.8006), 28.8558, 45),\n ('horizontal', '41.1255', (167.7444, 111.5513), (191.4785, 111.5513), (179.6114, 122.5513)),\n ('horizontal', '20.5628', (191.4785, 141.8006), (203.3456, 141.8006), (197.4121, 152.8006))\n]\n\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; _ds.dxf.dimasz = 2.5\n _ds.dxf.dimexe = 1.25; _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\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\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,\n angle=(0 if d[0] == \"horizontal\" else 90),\n 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,\n 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,\n 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,\n text=text, dimstyle=\"EZDXF\").render()\n\n doc.saveas(out_path)\n\n\nif __name__ == \"__main__\":\n out = sys.argv[1] if len(sys.argv) > 1 else \"0065_00652168_gt.dxf\"\n draw(out)\n print(\"wrote\", out)\n```"}], "images": ["images/0065_00652168.png"], "id": "0065_00652168"} {"messages": [{"role": "user", "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 33.67 mm. A union feature: The part is a square plate 67.35 x 67.35 mm. It is extruded to a thickness of 33.67 mm. A cut feature: The part is a circular plate with diameter 18.17 mm. It is extruded to a thickness of -36.73 mm."}, {"role": "assistant", "content": "```python\n#!/usr/bin/env python3\n# -*- coding: utf-8 -*-\n# Ground-truth 2D engineering drawing for part: 0065_00652289\n# Self-contained: reproduces the three-view DXF via ezdxf, NO FreeCAD needed.\n# Coordinates are A4 page millimetres (scale=0.574256097561007, page=[297.0, 210.0]).\n# visible edges -> solid (layer OUTLINE); hidden edges -> dashed (layer HIDDEN)\n# dimensions -> real movable DIMENSION entities (text = true mm value)\n# Run: python 0065_00652289_gt.py [out.dxf]\nimport sys\nimport ezdxf\nimport math\n\nSCALE = 0.574256097561007\nPAGE = [297.0, 210.0]\n\nVISIBLE_SEGMENTS = [\n (145.582611, 153.29879, 145.582611, 172.05001),\n (88.157001, 114.6244, 107.494196, 114.6244),\n (107.494196, 114.6244, 146.168587, 114.6244),\n (145.582611, 172.05001, 88.157001, 172.05001),\n (88.157001, 172.05001, 88.157001, 114.6244),\n (107.494196, 153.29879, 107.494196, 114.6244),\n (146.168587, 114.6244, 146.168587, 153.29879),\n (146.168587, 153.29879, 107.494196, 153.29879),\n (145.582611, 100.6244, 145.582611, 81.287205),\n (145.582611, 81.287205, 88.157001, 81.287205),\n (88.157001, 100.6244, 88.157001, 81.287205),\n (145.582611, 100.6244, 88.157001, 100.6244),\n (146.168587, 81.287205, 145.582611, 81.287205),\n (107.494196, 81.287205, 107.494196, 61.95001),\n (146.168587, 61.95001, 107.494196, 61.95001),\n (146.168587, 81.287205, 146.168587, 61.95001),\n (160.168587, 114.6244, 179.505782, 114.6244),\n (179.505782, 114.6244, 198.842977, 114.6244),\n (160.168587, 172.05001, 179.505782, 172.05001),\n (160.168587, 172.05001, 160.168587, 114.6244),\n (179.505782, 172.05001, 179.505782, 114.6244),\n (179.505782, 153.29879, 198.842977, 153.29879),\n (198.842977, 153.29879, 198.842977, 114.6244)\n]\nVISIBLE_CIRCLES = [\n (98.1741, 162.6744, 5.218267)\n]\nVISIBLE_ARCS = [\n\n]\nHIDDEN_SEGMENTS = [\n (103.3924, 81.2872, 103.3924, 100.6244),\n (92.9558, 100.6244, 92.9558, 81.2872),\n (160.1686, 157.4561, 179.5058, 157.4561),\n (160.1686, 167.8927, 179.5058, 167.8927)\n]\n# (orient, text, p1, p2, base) for linear; (orient, text, center, radius, angle) for diameter\nDIMENSIONS = [\n ('horizontal', '100', (145.5826, 172.05), (88.157, 172.05), (116.8698, 161.05)),\n ('vertical', '100', (145.5826, 114.6244), (145.5826, 172.05), (134.5826, 143.3372)),\n ('horizontal', '66.3265', (107.4942, 114.6244), (146.1686, 114.6244), (126.8314, 125.6244)),\n ('horizontal', '101.02', (88.157, 114.6244), (107.4942, 114.6244), (97.8256, 125.6244)),\n ('vertical', '0', (107.4942, 114.6244), (107.4942, 114.6244), (107.4942, 114.6244)),\n ('diameter', '%%c18.174', (98.1741, 162.6744), 5.2183, 45),\n ('horizontal', '33.6735', (88.157, 114.6244), (98.1741, 114.6244), (93.1656, 125.6244)),\n ('horizontal', '33.6735', (160.1686, 114.6244), (179.5058, 114.6244), (169.8372, 125.6244)),\n ('horizontal', '33.6735', (179.5058, 114.6244), (198.843, 114.6244), (189.1744, 125.6244)),\n ('horizontal', '33.6735', (179.5058, 162.6744), (158.4107, 162.6744), (168.9582, 151.6744))\n]\n\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; _ds.dxf.dimasz = 2.5\n _ds.dxf.dimexe = 1.25; _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\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\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,\n angle=(0 if d[0] == \"horizontal\" else 90),\n 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,\n 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,\n 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,\n text=text, dimstyle=\"EZDXF\").render()\n\n doc.saveas(out_path)\n\n\nif __name__ == \"__main__\":\n out = sys.argv[1] if len(sys.argv) > 1 else \"0065_00652289_gt.dxf\"\n draw(out)\n print(\"wrote\", out)\n```"}], "images": ["images/0065_00652289.png"], "id": "0065_00652289"} {"messages": [{"role": "user", "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 82.11 mm tall. It is extruded to a thickness of 16.5 mm. A union feature: The part is a circular plate with diameter 86.34 mm. It is extruded to a thickness of 65.05 mm. A cut feature: The part is a circular plate with diameter 55.92 mm. It is extruded to a thickness of 85.44 mm. A union feature: The part is a polygonal plate with 3 straight edges. It is extruded to a thickness of -24.27 mm. The outline includes one or more oblique (angled) edges."}, {"role": "assistant", "content": "```python\n#!/usr/bin/env python3\n# -*- coding: utf-8 -*-\n# Ground-truth 2D engineering drawing for part: 0065_00653644\n# Self-contained: reproduces the three-view DXF via ezdxf, NO FreeCAD needed.\n# Coordinates are A4 page millimetres (scale=0.6348062512657779, page=[297.0, 210.0]).\n# visible edges -> solid (layer OUTLINE); hidden edges -> dashed (layer HIDDEN)\n# dimensions -> real movable DIMENSION entities (text = true mm value)\n# Run: python 0065_00653644_gt.py [out.dxf]\nimport sys\nimport ezdxf\nimport math\n\nSCALE = 0.6348062512657779\nPAGE = [297.0, 210.0]\n\nVISIBLE_SEGMENTS = [\n (65.954446, 119.432788, 129.354693, 119.432788),\n (65.954446, 171.553722, 65.954446, 119.432788),\n (129.435071, 171.231184, 129.435071, 171.553722),\n (129.435071, 171.553722, 65.954446, 171.553722),\n (97.367138, 152.713893, 97.367138, 137.305974),\n (111.962449, 152.713893, 97.367138, 152.713893),\n (112.14301, 137.305974, 97.367138, 137.305974),\n (165.752347, 103.914703, 164.617432, 103.914703),\n (164.617432, 103.914703, 163.482517, 103.914703),\n (163.482517, 103.914703, 162.347602, 103.914703),\n (162.347602, 103.914703, 161.212687, 103.914703),\n (161.212687, 103.914703, 160.077772, 103.914703),\n (160.077772, 103.914703, 158.942857, 103.914703),\n (158.942857, 103.914703, 157.807943, 103.914703),\n (157.807943, 103.914703, 156.673028, 103.914703),\n (156.673028, 103.914703, 155.538113, 103.914703),\n (155.538113, 103.914703, 154.403198, 103.914703),\n (154.403198, 103.914703, 153.268283, 103.914703),\n (153.268283, 103.914703, 152.133368, 103.914703),\n (152.133368, 103.914703, 150.998453, 103.914703),\n (150.998453, 103.914703, 149.863539, 103.914703),\n (149.863539, 103.914703, 148.728624, 103.914703),\n (148.728624, 103.914703, 147.593709, 103.914703),\n (147.593709, 103.914703, 146.458794, 103.914703),\n (146.458794, 103.914703, 145.323879, 103.914703),\n (145.323879, 103.914703, 144.188964, 103.914703),\n (144.188964, 103.914703, 143.054049, 103.914703),\n (143.054049, 103.914703, 141.919135, 103.914703),\n (141.919135, 103.914703, 140.78422, 103.914703),\n (140.78422, 103.914703, 139.649305, 103.914703),\n (139.649305, 103.914703, 138.51439, 103.914703),\n (138.51439, 103.914703, 137.379475, 103.914703),\n (137.379475, 103.914703, 136.24456, 103.914703),\n (136.24456, 103.914703, 135.109645, 103.914703),\n (135.109645, 103.914703, 133.974731, 103.914703),\n (133.974731, 103.914703, 132.839816, 103.914703),\n (132.839816, 103.914703, 131.704901, 103.914703),\n (131.704901, 103.914703, 130.569986, 103.914703),\n (130.569986, 103.914703, 129.435071, 103.914703),\n (129.435071, 103.914703, 65.954446, 103.914703),\n (165.752347, 62.62148, 164.039635, 62.62148),\n (164.039635, 62.62148, 162.326923, 62.62148),\n (162.326923, 62.62148, 160.614211, 62.62148),\n (160.614211, 62.62148, 158.901499, 62.62148),\n (158.901499, 62.62148, 157.188788, 62.62148),\n (157.188788, 62.62148, 155.476076, 62.62148),\n (155.476076, 62.62148, 153.763364, 62.62148),\n (153.763364, 62.62148, 152.050652, 62.62148),\n (152.050652, 62.62148, 150.33794, 62.62148),\n (150.33794, 62.62148, 148.625229, 62.62148),\n (148.625229, 62.62148, 146.912517, 62.62148),\n (146.912517, 62.62148, 145.199805, 62.62148),\n (145.199805, 62.62148, 143.487093, 62.62148),\n (143.487093, 62.62148, 141.774381, 62.62148),\n (141.774381, 62.62148, 140.061669, 62.62148),\n (140.061669, 62.62148, 138.348958, 62.62148),\n (138.348958, 62.62148, 136.636246, 62.62148),\n (136.636246, 62.62148, 134.923534, 62.62148),\n (134.923534, 62.62148, 133.210822, 62.62148),\n (133.210822, 62.62148, 131.49811, 62.62148),\n (131.49811, 62.62148, 129.785399, 62.62148),\n (129.785399, 62.62148, 128.072687, 62.62148),\n (128.072687, 62.62148, 126.359975, 62.62148),\n (126.359975, 62.62148, 124.647263, 62.62148),\n (124.647263, 62.62148, 122.934551, 62.62148),\n (122.934551, 62.62148, 121.22184, 62.62148),\n (121.22184, 62.62148, 119.509128, 62.62148),\n (119.509128, 62.62148, 117.796416, 62.62148),\n (117.796416, 62.62148, 116.083704, 62.62148),\n (116.083704, 62.62148, 114.370992, 62.62148),\n (114.370992, 62.62148, 112.658281, 62.62148),\n (112.658281, 62.62148, 110.945569, 62.62148),\n (165.752347, 103.914703, 165.752347, 62.62148),\n (111.962449, 78.686737, 111.962449, 93.437318),\n (65.954446, 103.914703, 65.954446, 93.437318),\n (129.435071, 103.914703, 129.435071, 93.437318),\n (129.435071, 93.437318, 65.954446, 93.437318),\n (111.962449, 78.686737, 97.367138, 93.437318),\n (110.945569, 62.62148, 110.945569, 79.714427),\n (179.752347, 119.432788, 179.752347, 119.385348),\n (179.752347, 119.385348, 179.752347, 119.337908),\n (179.752347, 119.337908, 179.752347, 119.290468),\n (179.752347, 119.290468, 179.752347, 119.243027),\n (179.752347, 119.243027, 179.752347, 119.195587),\n (179.752347, 119.195587, 179.752347, 119.148147),\n (179.752347, 119.148147, 179.752347, 119.100707),\n (179.752347, 119.100707, 179.752347, 119.053267),\n (179.752347, 119.053267, 179.752347, 119.005827),\n (179.752347, 119.005827, 179.752347, 118.958386),\n (179.752347, 118.958386, 179.752347, 118.910946),\n (179.752347, 118.910946, 179.752347, 118.863506),\n (179.752347, 118.863506, 179.752347, 118.816066),\n (179.752347, 118.816066, 179.752347, 118.768626),\n (179.752347, 118.768626, 179.752347, 118.721186),\n (179.752347, 118.721186, 179.752347, 118.673745),\n (179.752347, 118.673745, 179.752347, 118.626305),\n (179.752347, 118.626305, 179.752347, 118.578865),\n (179.752347, 118.578865, 179.752347, 118.531425),\n (179.752347, 118.531425, 179.752347, 118.483985),\n (179.752347, 118.483985, 179.752347, 118.436545),\n (179.752347, 118.436545, 179.752347, 118.389104),\n (179.752347, 118.389104, 179.752347, 118.341664),\n (179.752347, 118.341664, 179.752347, 118.294224),\n (179.752347, 118.294224, 179.752347, 118.246784),\n (179.752347, 118.246784, 179.752347, 118.199344),\n (179.752347, 118.199344, 179.752347, 118.151904),\n (179.752347, 118.151904, 179.752347, 118.104463),\n (179.752347, 118.104463, 179.752347, 118.057023),\n (179.752347, 118.057023, 179.752347, 118.009583),\n (179.752347, 118.009583, 179.752347, 117.962143),\n (179.752347, 117.962143, 179.752347, 117.914703),\n (179.752347, 172.721481, 179.752347, 172.684988),\n (179.752347, 172.684988, 179.752347, 172.648496),\n (179.752347, 172.648496, 179.752347, 172.612003),\n (179.752347, 172.612003, 179.752347, 172.575511),\n (179.752347, 172.575511, 179.752347, 172.539018),\n (179.752347, 172.539018, 179.752347, 172.502526),\n (179.752347, 172.502526, 179.752347, 172.466033),\n (179.752347, 172.466033, 179.752347, 172.429541),\n (179.752347, 172.429541, 179.752347, 172.393049),\n (179.752347, 172.393049, 179.752347, 172.356556),\n (179.752347, 172.356556, 179.752347, 172.320064),\n (179.752347, 172.320064, 179.752347, 172.283571),\n (179.752347, 172.283571, 179.752347, 172.247079),\n (179.752347, 172.247079, 179.752347, 172.210586),\n (179.752347, 172.210586, 179.752347, 172.174094),\n (179.752347, 172.174094, 179.752347, 172.137602),\n (179.752347, 172.137602, 179.752347, 172.101109),\n (179.752347, 172.101109, 179.752347, 172.064617),\n (179.752347, 172.064617, 179.752347, 172.028124),\n (179.752347, 172.028124, 179.752347, 171.991632),\n (179.752347, 171.991632, 179.752347, 171.955139),\n (179.752347, 171.955139, 179.752347, 171.918647),\n (179.752347, 171.918647, 179.752347, 171.882154),\n (179.752347, 171.882154, 179.752347, 171.845662),\n (179.752347, 171.845662, 179.752347, 171.80917),\n (179.752347, 171.80917, 179.752347, 171.772677),\n (179.752347, 171.772677, 179.752347, 171.736185),\n (179.752347, 171.736185, 179.752347, 171.699692),\n (179.752347, 171.699692, 179.752347, 171.6632),\n (179.752347, 171.6632, 179.752347, 171.626707),\n (179.752347, 171.626707, 179.752347, 171.590215),\n (179.752347, 171.590215, 179.752347, 171.553722),\n (179.752347, 171.553722, 179.752347, 119.432788),\n (221.045569, 172.721481, 221.045569, 171.008769),\n (221.045569, 171.008769, 221.045569, 169.296057),\n (221.045569, 169.296057, 221.045569, 167.583345),\n (221.045569, 167.583345, 221.045569, 165.870633),\n (221.045569, 165.870633, 221.045569, 164.157922),\n (221.045569, 164.157922, 221.045569, 162.44521),\n (221.045569, 162.44521, 221.045569, 160.732498),\n (221.045569, 160.732498, 221.045569, 159.019786),\n (221.045569, 159.019786, 221.045569, 157.307074),\n (221.045569, 157.307074, 221.045569, 155.594362),\n (221.045569, 155.594362, 221.045569, 153.881651),\n (221.045569, 153.881651, 221.045569, 152.168939),\n (221.045569, 152.168939, 221.045569, 150.456227),\n (221.045569, 150.456227, 221.045569, 148.743515),\n (221.045569, 148.743515, 221.045569, 147.030803),\n (221.045569, 147.030803, 221.045569, 145.318092),\n (221.045569, 145.318092, 221.045569, 143.60538),\n (221.045569, 143.60538, 221.045569, 141.892668),\n (221.045569, 141.892668, 221.045569, 140.179956),\n (221.045569, 140.179956, 221.045569, 138.467244),\n (221.045569, 138.467244, 221.045569, 136.754533),\n (221.045569, 136.754533, 221.045569, 135.041821),\n (221.045569, 135.041821, 221.045569, 133.329109),\n (221.045569, 133.329109, 221.045569, 131.616397),\n (221.045569, 131.616397, 221.045569, 129.903685),\n (221.045569, 129.903685, 221.045569, 128.190974),\n (221.045569, 128.190974, 221.045569, 126.478262),\n (221.045569, 126.478262, 221.045569, 124.76555),\n (221.045569, 124.76555, 221.045569, 123.052838),\n (221.045569, 123.052838, 221.045569, 121.340126),\n (221.045569, 121.340126, 221.045569, 119.627415),\n (221.045569, 119.627415, 221.045569, 117.914703),\n (179.752347, 119.432788, 190.229731, 119.432788),\n (179.752347, 171.553722, 190.229731, 171.553722),\n (190.229731, 171.553722, 190.229731, 119.432788),\n (204.980312, 152.713893, 190.229731, 152.713893),\n (205.162794, 137.305974, 190.229731, 137.305974),\n (221.045569, 172.721481, 179.752347, 172.721481),\n (221.045569, 117.914703, 179.752347, 117.914703)\n]\nVISIBLE_CIRCLES = [\n (138.348958, 145.318092, 27.403389),\n (137.940242, 145.934408, 17.749922)\n]\nVISIBLE_ARCS = [\n (231.079362, 145.317954, 27.126746, 164.178352, -162.821262)\n]\nHIDDEN_SEGMENTS = [\n (129.3547, 119.4328, 165.7523, 145.3181),\n (165.7523, 145.3181, 129.4351, 171.2312),\n (111.9624, 152.7139, 129.4351, 171.2312),\n (111.9624, 152.7139, 112.143, 137.306),\n (129.3547, 119.4328, 112.143, 137.306),\n (155.6902, 103.9147, 155.6902, 62.6215),\n (120.1903, 62.6215, 120.1903, 103.9147),\n (221.0456, 163.6843, 179.7523, 163.6843),\n (221.0456, 128.1845, 179.7523, 128.1845)\n]\n# (orient, text, p1, p2, base) for linear; (orient, text, center, radius, angle) for diameter\nDIMENSIONS = [\n ('horizontal', '100', (129.4351, 171.5537), (65.9544, 171.5537), (97.6947, 160.5537)),\n ('diameter', '%%c86.3362', (138.3489, 145.3181), 27.4034, 45),\n ('diameter', '%%c55.9223', (137.9403, 145.9344), 17.7499, 135),\n ('horizontal', '113.398', (65.9544, 119.4328), (137.9403, 119.4328), (101.9473, 130.4328)),\n ('vertical', '41.7475', (137.9403, 119.4328), (137.9403, 145.9344), (126.9403, 132.6836)),\n ('horizontal', '16.5049', (179.7523, 145.3181), (221.0455, 145.3181), (200.3989, 156.3181)),\n ('vertical', '16.5049', (117.4915, 95.2863), (117.4915, 73.0988), (128.4915, 84.1926))\n]\n\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; _ds.dxf.dimasz = 2.5\n _ds.dxf.dimexe = 1.25; _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\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\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,\n angle=(0 if d[0] == \"horizontal\" else 90),\n 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,\n 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,\n 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,\n text=text, dimstyle=\"EZDXF\").render()\n\n doc.saveas(out_path)\n\n\nif __name__ == \"__main__\":\n out = sys.argv[1] if len(sys.argv) > 1 else \"0065_00653644_gt.dxf\"\n draw(out)\n print(\"wrote\", out)\n```"}], "images": ["images/0065_00653644.png"], "id": "0065_00653644"} {"messages": [{"role": "user", "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 2.26 mm. The outline includes one or more oblique (angled) edges. A cut feature: The part is a circular plate with diameter 5.13 mm. It is extruded to a thickness of -37.81 mm. A cut feature: The part is a circular plate with diameter 5.13 mm. It is extruded to a thickness of -37.81 mm. A cut feature: The part is a circular plate with diameter 5.03 mm. It is extruded to a thickness of -37.81 mm. A cut feature: The part is a circular plate with diameter 5.03 mm. It is extruded to a thickness of -37.81 mm."}, {"role": "assistant", "content": "```python\n#!/usr/bin/env python3\n# -*- coding: utf-8 -*-\n# Ground-truth 2D engineering drawing for part: 0067_00670965\n# Self-contained: reproduces the three-view DXF via ezdxf, NO FreeCAD needed.\n# Coordinates are A4 page millimetres (scale=1.1498532338308538, page=[297.0, 210.0]).\n# visible edges -> solid (layer OUTLINE); hidden edges -> dashed (layer HIDDEN)\n# dimensions -> real movable DIMENSION entities (text = true mm value)\n# Run: python 0067_00670965_gt.py [out.dxf]\nimport sys\nimport ezdxf\nimport math\n\nSCALE = 1.1498532338308538\nPAGE = [297.0, 210.0]\n\nVISIBLE_SEGMENTS = [\n (190.167841, 78.545441, 190.167841, 83.599741),\n (75.182517, 78.545441, 190.167841, 78.545441),\n (190.167841, 83.599741, 195.222141, 87.390466),\n (195.222141, 87.390466, 195.222141, 145.514915),\n (195.222141, 145.514915, 190.167841, 149.30564),\n (190.167841, 149.30564, 190.167841, 172.04999),\n (190.167841, 172.04999, 75.182517, 172.04999),\n (75.182517, 172.04999, 75.182517, 78.545441),\n (195.222141, 64.545441, 190.167841, 64.545441),\n (190.167841, 64.545441, 75.182517, 64.545441),\n (195.222141, 61.94999, 190.167841, 61.94999),\n (190.167841, 61.94999, 75.182517, 61.94999),\n (75.182517, 64.545441, 75.182517, 61.94999),\n (195.222141, 64.545441, 195.222141, 61.94999),\n (190.167841, 64.545441, 190.167841, 61.94999),\n (209.222141, 78.545441, 211.817592, 78.545441),\n (209.222141, 172.04999, 209.222141, 78.545441),\n (211.817592, 172.04999, 211.817592, 78.545441),\n (209.222141, 172.04999, 211.817592, 172.04999)\n]\nVISIBLE_CIRCLES = [\n (99.545609, 83.087481, 2.950618),\n (190.973797, 91.522698, 2.889147),\n (101.492198, 167.439649, 2.950618),\n (190.973797, 140.836273, 2.889147)\n]\nVISIBLE_ARCS = [\n\n]\nHIDDEN_SEGMENTS = [\n (102.4962, 61.95, 102.4962, 64.5455),\n (193.8629, 61.95, 193.8629, 64.5455),\n (104.4428, 61.95, 104.4428, 64.5455),\n (96.5949, 64.5455, 96.5949, 61.95),\n (188.0846, 64.5455, 188.0846, 61.95),\n (98.5415, 64.5455, 98.5415, 61.95),\n (209.2221, 83.5998, 211.8175, 83.5998),\n (209.2221, 87.3905, 211.8175, 87.3905),\n (209.2221, 145.5149, 211.8175, 145.5149),\n (209.2221, 149.3057, 211.8175, 149.3057),\n (209.2221, 80.1369, 211.8175, 80.1369),\n (209.2221, 86.0381, 211.8175, 86.0381),\n (209.2221, 88.6336, 211.8175, 88.6336),\n (209.2221, 94.4119, 211.8175, 94.4119),\n (209.2221, 164.489, 211.8175, 164.489),\n (209.2221, 170.3903, 211.8175, 170.3903),\n (209.2221, 137.9471, 211.8175, 137.9471),\n (209.2221, 143.7254, 211.8175, 143.7254)\n]\n# (orient, text, p1, p2, base) for linear; (orient, text, center, radius, angle) for diameter\nDIMENSIONS = [\n ('horizontal', '100', (190.1677, 172.05), (75.1824, 172.05), (132.6751, 161.05)),\n ('vertical', '4.3956', (190.1677, 78.5455), (190.1677, 83.5998), (179.1677, 81.0726)),\n ('vertical', '19.7802', (190.1677, 149.3056), (190.1677, 172.05), (179.1677, 160.6778)),\n ('vertical', '50.5495', (195.2221, 87.3905), (195.2221, 145.5149), (184.2221, 116.4527)),\n ('vertical', '81.3187', (75.1824, 172.05), (75.1824, 78.5455), (86.1824, 125.2977)),\n ('aligned', '5.4945', (190.1677, 83.5998), (195.2221, 87.3905), (186.095, 94.2952)),\n ('aligned', '5.4945', (195.2221, 145.5149), (190.1677, 149.3056), (186.095, 138.6102)),\n ('diameter', '%%c5.1322', (101.4922, 167.4396), 2.9506, 45),\n ('horizontal', '22.881', (75.1824, 78.5455), (101.4922, 78.5455), (88.3373, 89.5455)),\n ('vertical', '77.3091', (101.4922, 78.5455), (101.4922, 167.4396), (90.4922, 122.9926)),\n ('diameter', '%%c5.1322', (99.5456, 83.0875), 2.9506, 45),\n ('horizontal', '21.1881', (75.1824, 78.5455), (99.5456, 78.5455), (87.364, 89.5455)),\n ('vertical', '3.9501', (99.5456, 78.5455), (99.5456, 83.0875), (88.5456, 80.8165)),\n ('diameter', '%%c5.0252', (190.9738, 91.5227), 2.8891, 45),\n ('horizontal', '100.701', (75.1824, 78.5455), (190.9738, 78.5455), (133.0781, 89.5455)),\n ('vertical', '11.286', (190.9738, 78.5455), (190.9738, 91.5227), (179.9738, 85.0341)),\n ('diameter', '%%c5.0252', (190.9738, 140.8363), 2.8891, 45),\n ('horizontal', '100.701', (75.1824, 78.5455), (190.9738, 78.5455), (133.0781, 89.5455)),\n ('vertical', '54.1728', (190.9738, 78.5455), (190.9738, 140.8363), (179.9738, 109.6909)),\n ('horizontal', '2.2572', (209.2221, 78.5455), (211.8175, 78.5455), (210.5198, 89.5455)),\n ('horizontal', '2.2572', (211.8175, 167.4396), (168.3438, 167.4396), (190.0807, 156.4396)),\n ('horizontal', '2.2572', (211.8175, 83.0875), (168.3438, 83.0875), (190.0807, 72.0875))\n]\n\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; _ds.dxf.dimasz = 2.5\n _ds.dxf.dimexe = 1.25; _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\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\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,\n angle=(0 if d[0] == \"horizontal\" else 90),\n 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,\n 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,\n 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,\n text=text, dimstyle=\"EZDXF\").render()\n\n doc.saveas(out_path)\n\n\nif __name__ == \"__main__\":\n out = sys.argv[1] if len(sys.argv) > 1 else \"0067_00670965_gt.dxf\"\n draw(out)\n print(\"wrote\", out)\n```"}], "images": ["images/0067_00670965.png"], "id": "0067_00670965"} {"messages": [{"role": "user", "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 12.63 mm tall. It is extruded to a thickness of 12.5 mm. A cut feature: The part is a circular plate with diameter 5.67 mm. It is extruded to a thickness of -62.5 mm. A cut feature: The part is a circular plate with diameter 5.67 mm. It is extruded to a thickness of -62.5 mm."}, {"role": "assistant", "content": "```python\n#!/usr/bin/env python3\n# -*- coding: utf-8 -*-\n# Ground-truth 2D engineering drawing for part: 0068_00680596\n# Self-contained: reproduces the three-view DXF via ezdxf, NO FreeCAD needed.\n# Coordinates are A4 page millimetres (scale=1.3046074766355187, page=[297.0, 210.0]).\n# visible edges -> solid (layer OUTLINE); hidden edges -> dashed (layer HIDDEN)\n# dimensions -> real movable DIMENSION entities (text = true mm value)\n# Run: python 0068_00680596_gt.py [out.dxf]\nimport sys\nimport ezdxf\nimport math\n\nSCALE = 1.3046074766355187\nPAGE = [297.0, 210.0]\n\nVISIBLE_SEGMENTS = [\n (193.576544, 140.393397, 193.576544, 123.914144),\n (63.115796, 140.393397, 193.576544, 140.393397),\n (193.576544, 123.914144, 63.115796, 123.914144),\n (63.115796, 123.914144, 63.115796, 140.393397),\n (193.576544, 93.606551, 193.576544, 109.914144),\n (63.115796, 93.606551, 63.115796, 109.914144),\n (63.115796, 109.914144, 193.576544, 109.914144),\n (63.115796, 93.606551, 193.576544, 93.606551),\n (223.884137, 140.393397, 207.576544, 140.393397),\n (223.884137, 123.914144, 207.576544, 123.914144),\n (223.884137, 123.914144, 223.884137, 140.393397),\n (207.576544, 123.914144, 207.576544, 140.393397)\n]\nVISIBLE_CIRCLES = [\n (76.405054, 132.2396, 3.697818),\n (181.045446, 132.2396, 3.697818)\n]\nVISIBLE_ARCS = [\n\n]\nHIDDEN_SEGMENTS = [\n (80.1029, 109.9142, 80.1029, 93.6066),\n (184.7433, 109.9142, 184.7433, 93.6066),\n (72.7073, 93.6066, 72.7073, 109.9142),\n (177.3477, 93.6066, 177.3477, 109.9142),\n (223.8842, 135.9374, 207.5766, 135.9374),\n (223.8842, 128.5418, 207.5766, 128.5418)\n]\n# (orient, text, p1, p2, base) for linear; (orient, text, center, radius, angle) for diameter\nDIMENSIONS = [\n ('horizontal', '100', (193.5766, 123.9141), (63.1158, 123.9141), (128.3462, 112.9141)),\n ('vertical', '12.6316', (193.5766, 140.3934), (193.5766, 123.9141), (204.5766, 132.1538)),\n ('diameter', '%%c5.6689', (76.4051, 132.2396), 3.6978, 45),\n ('horizontal', '10.1864', (63.1158, 140.3934), (76.4051, 140.3934), (69.7605, 151.3934)),\n ('vertical', '6.25', (76.4051, 140.3934), (76.4051, 132.2396), (87.4051, 136.3165)),\n ('diameter', '%%c5.6689', (181.0454, 132.2396), 3.6978, 45),\n ('horizontal', '90.3947', (63.1158, 140.3934), (181.0454, 140.3934), (122.0806, 151.3934)),\n ('vertical', '6.25', (181.0454, 140.3934), (181.0454, 132.2396), (192.0454, 136.3165)),\n ('horizontal', '12.5', (223.8842, 140.3934), (207.5766, 140.3934), (215.7304, 129.3934)),\n ('horizontal', '12.5', (207.5766, 132.2396), (289.1145, 132.2396), (248.3456, 143.2396)),\n ('horizontal', '12.5', (207.5766, 132.2396), (289.1145, 132.2396), (248.3456, 143.2396))\n]\n\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; _ds.dxf.dimasz = 2.5\n _ds.dxf.dimexe = 1.25; _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\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\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,\n angle=(0 if d[0] == \"horizontal\" else 90),\n 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,\n 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,\n 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,\n text=text, dimstyle=\"EZDXF\").render()\n\n doc.saveas(out_path)\n\n\nif __name__ == \"__main__\":\n out = sys.argv[1] if len(sys.argv) > 1 else \"0068_00680596_gt.dxf\"\n draw(out)\n print(\"wrote\", out)\n```"}], "images": ["images/0068_00680596.png"], "id": "0068_00680596"} {"messages": [{"role": "user", "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 2.11 mm wide and 100 mm tall. It is extruded to a thickness of 2.08 mm. A union feature: The part is a rectangular plate 2.11 mm wide and 100 mm tall. It is extruded to a thickness of 2.08 mm. A cut feature: The part is a circular plate with diameter 0.53 mm. It is extruded to a thickness of -2.6 mm. A cut feature: The part is a circular plate with diameter 0.53 mm. It is extruded to a thickness of -2.6 mm. A cut feature: The part is a circular plate with diameter 0.53 mm. It is extruded to a thickness of -2.6 mm."}, {"role": "assistant", "content": "```python\n#!/usr/bin/env python3\n# -*- coding: utf-8 -*-\n# Ground-truth 2D engineering drawing for part: 0070_00703811\n# Self-contained: reproduces the three-view DXF via ezdxf, NO FreeCAD needed.\n# Coordinates are A4 page millimetres (scale=0.9413877551020439, page=[297.0, 210.0]).\n# visible edges -> solid (layer OUTLINE); hidden edges -> dashed (layer HIDDEN)\n# dimensions -> real movable DIMENSION entities (text = true mm value)\n# Run: python 0070_00703811_gt.py [out.dxf]\nimport sys\nimport ezdxf\nimport math\n\nSCALE = 0.9413877551020439\nPAGE = [297.0, 210.0]\n\nVISIBLE_SEGMENTS = [\n (136.510329, 172.050046, 136.510329, 77.911271),\n (134.52846, 172.050046, 136.510329, 172.050046),\n (136.510329, 77.911271, 134.52846, 77.911271),\n (134.52846, 77.911271, 134.52846, 172.050046),\n (136.510329, 61.950046, 136.510329, 63.911271),\n (136.510329, 63.911271, 134.52846, 63.911271),\n (134.52846, 61.950046, 134.52846, 63.911271),\n (136.510329, 61.950046, 134.52846, 61.950046),\n (150.510329, 172.050046, 152.471554, 172.050046),\n (150.510329, 77.911271, 152.471554, 77.911271),\n (150.510329, 77.911271, 150.510329, 172.050046),\n (152.471554, 77.911271, 152.471554, 172.050046)\n]\nVISIBLE_CIRCLES = [\n (135.2665, 171.069434, 0.247734),\n (135.2665, 78.891883, 0.247734)\n]\nVISIBLE_ARCS = [\n\n]\nHIDDEN_SEGMENTS = [\n (135.5142, 61.95, 135.5142, 63.9112),\n (150.5103, 78.6441, 152.4715, 78.6441),\n (150.5103, 79.1396, 152.4715, 79.1396),\n (150.5103, 170.8217, 152.4715, 170.8217),\n (150.5103, 171.3171, 152.4715, 171.3171)\n]\n# (orient, text, p1, p2, base) for linear; (orient, text, center, radius, angle) for diameter\nDIMENSIONS = [\n ('horizontal', '2.1053', (136.5103, 172.05), (134.5284, 172.05), (135.5194, 161.05)),\n ('vertical', '100', (136.5103, 77.9112), (136.5103, 172.05), (125.5103, 124.9806)),\n ('horizontal', '2.1053', (134.5284, 77.9112), (136.5103, 77.9112), (135.5194, 88.9112)),\n ('vertical', '100', (136.5103, 77.9112), (136.5103, 172.05), (125.5103, 124.9806)),\n ('vertical', '0', (134.5284, 77.9112), (134.5284, 77.9112), (134.5284, 77.9112)),\n ('diameter', '%%c0.5263', (135.2665, 78.8919), 0.2477, 45),\n ('horizontal', '0.784', (134.5284, 77.9112), (135.2665, 77.9112), (134.8974, 88.9112)),\n ('vertical', '1.0417', (135.2665, 77.9112), (135.2665, 78.8919), (124.2665, 78.4015)),\n ('diameter', '%%c0.5263', (135.2665, 78.8919), 0.2477, 135),\n ('horizontal', '0.784', (134.5284, 77.9112), (135.2665, 77.9112), (134.8974, 88.9112)),\n ('vertical', '1.0417', (135.2665, 77.9112), (135.2665, 78.8919), (124.2665, 78.4015)),\n ('diameter', '%%c0.5263', (135.2665, 171.0694), 0.2477, 45),\n ('horizontal', '0.784', (134.5284, 77.9112), (135.2665, 77.9112), (134.8974, 88.9112)),\n ('vertical', '98.9583', (135.2665, 77.9112), (135.2665, 171.0694), (124.2665, 124.4903)),\n ('horizontal', '2.0833', (150.5103, 77.9112), (152.4715, 77.9112), (151.4909, 88.9112)),\n ('horizontal', '2.0833', (150.5103, 77.9112), (152.4715, 77.9112), (151.4909, 88.9112)),\n ('horizontal', '2.0833', (152.4715, 78.8919), (150.02, 78.8919), (151.2457, 67.8919)),\n ('horizontal', '2.0833', (152.4715, 78.8919), (150.02, 78.8919), (151.2457, 67.8919)),\n ('horizontal', '2.0833', (152.4715, 171.0694), (150.02, 171.0694), (151.2457, 160.0694))\n]\n\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; _ds.dxf.dimasz = 2.5\n _ds.dxf.dimexe = 1.25; _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\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\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,\n angle=(0 if d[0] == \"horizontal\" else 90),\n 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,\n 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,\n 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,\n text=text, dimstyle=\"EZDXF\").render()\n\n doc.saveas(out_path)\n\n\nif __name__ == \"__main__\":\n out = sys.argv[1] if len(sys.argv) > 1 else \"0070_00703811_gt.dxf\"\n draw(out)\n print(\"wrote\", out)\n```"}], "images": ["images/0070_00703811.png"], "id": "0070_00703811"} {"messages": [{"role": "user", "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": "assistant", "content": "```python\n#!/usr/bin/env python3\n# -*- coding: utf-8 -*-\n# Ground-truth 2D engineering drawing for part: 0072_00720422\n# Self-contained: reproduces the three-view DXF via ezdxf, NO FreeCAD needed.\n# Coordinates are A4 page millimetres (scale=0.577115281501345, page=[297.0, 210.0]).\n# visible edges -> solid (layer OUTLINE); hidden edges -> dashed (layer HIDDEN)\n# dimensions -> real movable DIMENSION entities (text = true mm value)\n# Run: python 0072_00720422_gt.py [out.dxf]\nimport sys\nimport ezdxf\nimport math\n\nSCALE = 0.577115281501345\nPAGE = [297.0, 210.0]\n\nVISIBLE_SEGMENTS = [\n (101.361344, 172.049966, 136.037447, 172.049966),\n (83.654398, 141.8006, 101.361344, 172.049966),\n (136.037447, 172.049966, 153.744393, 141.8006),\n (153.744393, 141.8006, 136.037447, 111.551234),\n (136.037447, 111.551234, 101.361344, 111.551234),\n (101.361344, 111.551234, 83.654398, 141.8006),\n (83.654398, 61.949966, 83.654398, 85.684145),\n (153.744393, 61.949966, 153.744393, 85.684145),\n (153.744393, 61.949966, 136.037447, 61.949966),\n (136.037447, 61.949966, 101.361344, 61.949966),\n (101.361344, 61.949966, 83.654398, 61.949966),\n (153.744393, 85.684145, 136.037447, 85.684145),\n (136.037447, 85.684145, 101.361344, 85.684145),\n (101.361344, 85.684145, 83.654398, 85.684145),\n (101.361344, 61.949966, 101.361344, 85.684145),\n (136.037447, 61.949966, 136.037447, 85.684145),\n (148.041164, 85.684145, 148.041164, 97.551234),\n (148.041164, 97.551234, 146.237679, 97.551234),\n (146.237679, 97.551234, 144.434194, 97.551234),\n (144.434194, 97.551234, 142.630708, 97.551234),\n (142.630708, 97.551234, 140.827223, 97.551234),\n (140.827223, 97.551234, 139.023738, 97.551234),\n (139.023738, 97.551234, 137.220253, 97.551234),\n (137.220253, 97.551234, 135.416767, 97.551234),\n (135.416767, 97.551234, 133.613282, 97.551234),\n (133.613282, 97.551234, 131.809797, 97.551234),\n (131.809797, 97.551234, 130.006312, 97.551234),\n (130.006312, 97.551234, 128.202826, 97.551234),\n (128.202826, 97.551234, 126.399341, 97.551234),\n (126.399341, 97.551234, 124.595856, 97.551234),\n (124.595856, 97.551234, 122.792371, 97.551234),\n (122.792371, 97.551234, 120.988885, 97.551234),\n (120.988885, 97.551234, 119.1854, 97.551234),\n (119.1854, 97.551234, 117.381915, 97.551234),\n (117.381915, 97.551234, 115.578429, 97.551234),\n (115.578429, 97.551234, 113.774944, 97.551234),\n (113.774944, 97.551234, 111.971459, 97.551234),\n (111.971459, 97.551234, 110.167974, 97.551234),\n (110.167974, 97.551234, 108.364488, 97.551234),\n (108.364488, 97.551234, 106.561003, 97.551234),\n (106.561003, 97.551234, 104.757518, 97.551234),\n (104.757518, 97.551234, 102.954033, 97.551234),\n (102.954033, 97.551234, 101.150547, 97.551234),\n (101.150547, 97.551234, 99.347062, 97.551234),\n (99.347062, 97.551234, 97.543577, 97.551234),\n (97.543577, 97.551234, 95.740092, 97.551234),\n (95.740092, 97.551234, 93.936606, 97.551234),\n (93.936606, 97.551234, 92.133121, 97.551234),\n (92.133121, 97.551234, 90.329636, 97.551234),\n (90.329636, 97.551234, 90.329636, 85.684145),\n (167.744393, 172.049966, 191.478572, 172.049966),\n (167.744393, 141.8006, 191.478572, 141.8006),\n (191.478572, 141.8006, 191.478572, 172.049966),\n (167.744393, 141.8006, 167.744393, 172.049966),\n (167.744393, 111.551234, 167.744393, 141.8006),\n (191.478572, 111.551234, 191.478572, 141.8006),\n (167.744393, 111.551234, 191.478572, 111.551234),\n (203.345661, 112.944836, 203.345661, 114.748321),\n (203.345661, 114.748321, 203.345661, 116.551806),\n (203.345661, 116.551806, 203.345661, 118.355292),\n (203.345661, 118.355292, 203.345661, 120.158777),\n (203.345661, 120.158777, 203.345661, 121.962262),\n (203.345661, 121.962262, 203.345661, 123.765747),\n (203.345661, 123.765747, 203.345661, 125.569233),\n (203.345661, 125.569233, 203.345661, 127.372718),\n (203.345661, 127.372718, 203.345661, 129.176203),\n (203.345661, 129.176203, 203.345661, 130.979688),\n (203.345661, 130.979688, 203.345661, 132.783174),\n (203.345661, 132.783174, 203.345661, 134.586659),\n (203.345661, 134.586659, 203.345661, 136.390144),\n (203.345661, 136.390144, 203.345661, 138.193629),\n (203.345661, 138.193629, 203.345661, 139.997115),\n (203.345661, 139.997115, 203.345661, 141.8006),\n (203.345661, 141.8006, 203.345661, 143.604085),\n (203.345661, 143.604085, 203.345661, 145.407571),\n (203.345661, 145.407571, 203.345661, 147.211056),\n (203.345661, 147.211056, 203.345661, 149.014541),\n (203.345661, 149.014541, 203.345661, 150.818026),\n (203.345661, 150.818026, 203.345661, 152.621512),\n (203.345661, 152.621512, 203.345661, 154.424997),\n (203.345661, 154.424997, 203.345661, 156.228482),\n (203.345661, 156.228482, 203.345661, 158.031967),\n (203.345661, 158.031967, 203.345661, 159.835453),\n (203.345661, 159.835453, 203.345661, 161.638938),\n (203.345661, 161.638938, 203.345661, 163.442423),\n (203.345661, 163.442423, 203.345661, 165.245908),\n (203.345661, 165.245908, 203.345661, 167.049394),\n (203.345661, 167.049394, 203.345661, 168.852879),\n (203.345661, 168.852879, 203.345661, 170.656364),\n (203.345661, 112.944836, 191.478572, 112.944836),\n (203.345661, 170.656364, 191.478572, 170.656364)\n]\nVISIBLE_CIRCLES = [\n (119.1854, 141.8006, 28.855764)\n]\nVISIBLE_ARCS = [\n\n]\nHIDDEN_SEGMENTS = [\n\n]\n# (orient, text, p1, p2, base) for linear; (orient, text, center, radius, angle) for diameter\nDIMENSIONS = [\n ('horizontal', '60.0852', (101.3613, 111.5513), (136.0374, 111.5513), (118.6994, 122.5513)),\n ('aligned', '60.7345', (136.0374, 111.5513), (153.7443, 141.8006), (135.3977, 132.2329)),\n ('aligned', '60.7345', (153.7443, 141.8006), (136.0374, 172.05), (135.3977, 151.3684)),\n ('aligned', '60.7345', (101.3613, 172.05), (83.6544, 141.8006), (102.001, 151.3684)),\n ('aligned', '60.7345', (83.6544, 141.8006), (101.3613, 111.5513), (102.001, 132.2329)),\n ('diameter', '%%c100', (119.1854, 141.8006), 28.8558, 45),\n ('horizontal', '41.1255', (167.7444, 111.5513), (191.4785, 111.5513), (179.6114, 122.5513)),\n ('horizontal', '20.5628', (191.4785, 141.8006), (203.3456, 141.8006), (197.4121, 152.8006))\n]\n\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; _ds.dxf.dimasz = 2.5\n _ds.dxf.dimexe = 1.25; _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\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\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,\n angle=(0 if d[0] == \"horizontal\" else 90),\n 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,\n 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,\n 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,\n text=text, dimstyle=\"EZDXF\").render()\n\n doc.saveas(out_path)\n\n\nif __name__ == \"__main__\":\n out = sys.argv[1] if len(sys.argv) > 1 else \"0072_00720422_gt.dxf\"\n draw(out)\n print(\"wrote\", out)\n```"}], "images": ["images/0072_00720422.png"], "id": "0072_00720422"} {"messages": [{"role": "user", "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 77.89 mm tall. It is extruded to a thickness of 29.35 mm. A union feature: The part is a circular plate with diameter 41.95 mm, featuring a circular hole of diameter 25.88 mm. It is extruded to a thickness of 35.87 mm."}, {"role": "assistant", "content": "```python\n#!/usr/bin/env python3\n# -*- coding: utf-8 -*-\n# Ground-truth 2D engineering drawing for part: 0073_00732458\n# Self-contained: reproduces the three-view DXF via ezdxf, NO FreeCAD needed.\n# Coordinates are A4 page millimetres (scale=0.6715014390793419, page=[297.0, 210.0]).\n# visible edges -> solid (layer OUTLINE); hidden edges -> dashed (layer HIDDEN)\n# dimensions -> real movable DIMENSION entities (text = true mm value)\n# Run: python 0073_00732458_gt.py [out.dxf]\nimport sys\nimport ezdxf\nimport math\n\nSCALE = 0.6715014390793419\nPAGE = [297.0, 210.0]\n\nVISIBLE_SEGMENTS = [\n (148.178298, 119.7436, 148.178298, 172.050027),\n (81.028154, 119.7436, 148.178298, 119.7436),\n (148.178298, 172.050027, 81.028154, 172.050027),\n (81.028154, 172.050027, 81.028154, 119.7436),\n (148.178298, 105.743599, 148.178298, 86.036492),\n (148.178298, 86.036492, 81.028154, 86.036492),\n (81.028154, 105.743599, 81.028154, 86.036492),\n (148.178298, 105.743599, 81.028154, 105.743599),\n (138.689691, 86.036492, 138.689691, 61.950027),\n (138.689691, 61.950027, 137.809498, 61.950027),\n (137.809498, 61.950027, 136.929304, 61.950027),\n (136.929304, 61.950027, 136.049111, 61.950027),\n (136.049111, 61.950027, 135.168918, 61.950027),\n (135.168918, 61.950027, 134.288725, 61.950027),\n (134.288725, 61.950027, 133.408532, 61.950027),\n (133.408532, 61.950027, 132.528339, 61.950027),\n (132.528339, 61.950027, 131.648145, 61.950027),\n (131.648145, 61.950027, 130.767952, 61.950027),\n (130.767952, 61.950027, 129.887759, 61.950027),\n (129.887759, 61.950027, 129.007566, 61.950027),\n (129.007566, 61.950027, 128.127373, 61.950027),\n (128.127373, 61.950027, 127.24718, 61.950027),\n (127.24718, 61.950027, 126.366986, 61.950027),\n (126.366986, 61.950027, 125.486793, 61.950027),\n (125.486793, 61.950027, 124.6066, 61.950027),\n (124.6066, 61.950027, 123.726407, 61.950027),\n (123.726407, 61.950027, 122.846214, 61.950027),\n (122.846214, 61.950027, 121.96602, 61.950027),\n (121.96602, 61.950027, 121.085827, 61.950027),\n (121.085827, 61.950027, 120.205634, 61.950027),\n (120.205634, 61.950027, 119.325441, 61.950027),\n (119.325441, 61.950027, 118.445248, 61.950027),\n (118.445248, 61.950027, 117.565055, 61.950027),\n (117.565055, 61.950027, 116.684861, 61.950027),\n (116.684861, 61.950027, 115.804668, 61.950027),\n (115.804668, 61.950027, 114.924475, 61.950027),\n (114.924475, 61.950027, 114.044282, 61.950027),\n (114.044282, 61.950027, 113.164089, 61.950027),\n (113.164089, 61.950027, 112.283896, 61.950027),\n (112.283896, 61.950027, 111.403702, 61.950027),\n (111.403702, 61.950027, 110.523509, 61.950027),\n (110.523509, 61.950027, 110.523509, 86.036492),\n (162.178298, 119.7436, 181.885406, 119.7436),\n (162.178298, 172.050027, 181.885406, 172.050027),\n (162.178298, 172.050027, 162.178298, 119.7436),\n (181.885406, 172.050027, 181.885406, 119.7436),\n (205.97187, 164.482191, 205.97187, 163.601998),\n (205.97187, 163.601998, 205.97187, 162.721804),\n (205.97187, 162.721804, 205.97187, 161.841611),\n (205.97187, 161.841611, 205.97187, 160.961418),\n (205.97187, 160.961418, 205.97187, 160.081225),\n (205.97187, 160.081225, 205.97187, 159.201032),\n (205.97187, 159.201032, 205.97187, 158.320839),\n (205.97187, 158.320839, 205.97187, 157.440645),\n (205.97187, 157.440645, 205.97187, 156.560452),\n (205.97187, 156.560452, 205.97187, 155.680259),\n (205.97187, 155.680259, 205.97187, 154.800066),\n (205.97187, 154.800066, 205.97187, 153.919873),\n (205.97187, 153.919873, 205.97187, 153.03968),\n (205.97187, 153.03968, 205.97187, 152.159486),\n (205.97187, 152.159486, 205.97187, 151.279293),\n (205.97187, 151.279293, 205.97187, 150.3991),\n (205.97187, 150.3991, 205.97187, 149.518907),\n (205.97187, 149.518907, 205.97187, 148.638714),\n (205.97187, 148.638714, 205.97187, 147.75852),\n (205.97187, 147.75852, 205.97187, 146.878327),\n (205.97187, 146.878327, 205.97187, 145.998134),\n (205.97187, 145.998134, 205.97187, 145.117941),\n (205.97187, 145.117941, 205.97187, 144.237748),\n (205.97187, 144.237748, 205.97187, 143.357555),\n (205.97187, 143.357555, 205.97187, 142.477361),\n (205.97187, 142.477361, 205.97187, 141.597168),\n (205.97187, 141.597168, 205.97187, 140.716975),\n (205.97187, 140.716975, 205.97187, 139.836782),\n (205.97187, 139.836782, 205.97187, 138.956589),\n (205.97187, 138.956589, 205.97187, 138.076396),\n (205.97187, 138.076396, 205.97187, 137.196202),\n (205.97187, 137.196202, 205.97187, 136.316009),\n (205.97187, 164.482191, 181.885406, 164.482191),\n (205.97187, 136.316009, 181.885406, 136.316009)\n]\nVISIBLE_CIRCLES = [\n (124.6066, 150.3991, 14.083091),\n (124.6066, 150.3991, 8.689567)\n]\nVISIBLE_ARCS = [\n\n]\nHIDDEN_SEGMENTS = [\n (133.2962, 86.0365, 133.2962, 61.95),\n (115.917, 61.95, 115.917, 86.0365),\n (205.9719, 159.0886, 181.8854, 159.0886),\n (205.9719, 141.7095, 181.8854, 141.7095)\n]\n# (orient, text, p1, p2, base) for linear; (orient, text, center, radius, angle) for diameter\nDIMENSIONS = [\n ('horizontal', '100', (148.1783, 172.05), (81.0282, 172.05), (114.6032, 161.05)),\n ('vertical', '77.8947', (148.1783, 119.7436), (148.1783, 172.05), (137.1783, 145.8968)),\n ('diameter', '%%c41.9451', (124.6066, 150.3991), 14.0831, 45),\n ('diameter', '%%c25.881', (124.6066, 150.3991), 8.6896, 135),\n ('horizontal', '29.3478', (162.1783, 119.7436), (181.8854, 119.7436), (172.0318, 130.7436))\n]\n\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; _ds.dxf.dimasz = 2.5\n _ds.dxf.dimexe = 1.25; _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\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\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,\n angle=(0 if d[0] == \"horizontal\" else 90),\n 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,\n 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,\n 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,\n text=text, dimstyle=\"EZDXF\").render()\n\n doc.saveas(out_path)\n\n\nif __name__ == \"__main__\":\n out = sys.argv[1] if len(sys.argv) > 1 else \"0073_00732458_gt.dxf\"\n draw(out)\n print(\"wrote\", out)\n```"}], "images": ["images/0073_00732458.png"], "id": "0073_00732458"} {"messages": [{"role": "user", "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 12.5 mm. A cut feature: The part is a circular plate with diameter 37.89 mm. It is extruded to a thickness of 12.5 mm."}, {"role": "assistant", "content": "```python\n#!/usr/bin/env python3\n# -*- coding: utf-8 -*-\n# Ground-truth 2D engineering drawing for part: 0074_00749122\n# Self-contained: reproduces the three-view DXF via ezdxf, NO FreeCAD needed.\n# Coordinates are A4 page millimetres (scale=1.1015987933635012, page=[297.0, 210.0]).\n# visible edges -> solid (layer OUTLINE); hidden edges -> dashed (layer HIDDEN)\n# dimensions -> real movable DIMENSION entities (text = true mm value)\n# Run: python 0074_00749122_gt.py [out.dxf]\nimport sys\nimport ezdxf\nimport math\n\nSCALE = 1.1015987933635012\nPAGE = [297.0, 210.0]\n\nVISIBLE_SEGMENTS = [\n (184.695019, 89.719945, 184.695019, 172.04996),\n (74.53514, 89.719945, 184.695019, 89.719945),\n (184.695019, 172.04996, 74.53514, 172.04996),\n (74.53514, 172.04996, 74.53514, 89.719945),\n (184.695019, 75.719945, 184.695019, 61.94996),\n (184.695019, 61.94996, 74.53514, 61.94996),\n (74.53514, 75.719945, 74.53514, 61.94996),\n (184.695019, 75.719945, 74.53514, 75.719945),\n (198.695019, 89.719945, 212.465004, 89.719945),\n (198.695019, 172.04996, 212.465004, 172.04996),\n (198.695019, 172.04996, 198.695019, 89.719945),\n (212.465004, 172.04996, 212.465004, 89.719945)\n]\nVISIBLE_CIRCLES = [\n (129.8325, 131.0299, 20.872398)\n]\nVISIBLE_ARCS = [\n\n]\nHIDDEN_SEGMENTS = [\n (150.7048, 75.72, 150.7048, 61.95),\n (108.96, 61.95, 108.96, 75.72),\n (212.4649, 151.9023, 198.6949, 151.9023),\n (212.4649, 110.1575, 198.6949, 110.1575)\n]\n# (orient, text, p1, p2, base) for linear; (orient, text, center, radius, angle) for diameter\nDIMENSIONS = [\n ('horizontal', '100', (184.6949, 172.05), (74.5351, 172.05), (129.615, 161.05)),\n ('vertical', '74.7368', (184.6949, 89.72), (184.6949, 172.05), (173.6949, 130.885)),\n ('diameter', '%%c37.8947', (129.8325, 131.0299), 20.8724, 45),\n ('horizontal', '50.1974', (74.5351, 89.72), (129.8325, 89.72), (102.1838, 100.72)),\n ('vertical', '37.5', (129.8325, 89.72), (129.8325, 131.0299), (118.8325, 110.375)),\n ('horizontal', '12.5', (198.6949, 89.72), (212.4649, 89.72), (205.5799, 100.72)),\n ('horizontal', '12.5', (198.6949, 131.0299), (212.4649, 131.0299), (205.5799, 142.0299))\n]\n\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; _ds.dxf.dimasz = 2.5\n _ds.dxf.dimexe = 1.25; _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\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\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,\n angle=(0 if d[0] == \"horizontal\" else 90),\n 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,\n 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,\n 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,\n text=text, dimstyle=\"EZDXF\").render()\n\n doc.saveas(out_path)\n\n\nif __name__ == \"__main__\":\n out = sys.argv[1] if len(sys.argv) > 1 else \"0074_00749122_gt.dxf\"\n draw(out)\n print(\"wrote\", out)\n```"}], "images": ["images/0074_00749122.png"], "id": "0074_00749122"} {"messages": [{"role": "user", "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 circular hole of diameter 63.16 mm. It is extruded to a thickness of 17.71 mm. A union feature: The part is a rectangular plate 100 mm wide and 17.89 mm tall. It is extruded to a thickness of 17.71 mm. A union feature: The part is a rectangular plate 100 mm wide and 82.11 mm tall. It is extruded to a thickness of 17.71 mm."}, {"role": "assistant", "content": "```python\n#!/usr/bin/env python3\n# -*- coding: utf-8 -*-\n# Ground-truth 2D engineering drawing for part: 0075_00753176\n# Self-contained: reproduces the three-view DXF via ezdxf, NO FreeCAD needed.\n# Coordinates are A4 page millimetres (scale=0.4417945357394907, page=[297.0, 210.0]).\n# visible edges -> solid (layer OUTLINE); hidden edges -> dashed (layer HIDDEN)\n# dimensions -> real movable DIMENSION entities (text = true mm value)\n# Run: python 0075_00753176_gt.py [out.dxf]\nimport sys\nimport ezdxf\nimport math\n\nSCALE = 0.4417945357394907\nPAGE = [297.0, 210.0]\n\nVISIBLE_SEGMENTS = [\n (132.588303, 172.050052, 132.588303, 127.95295),\n (132.588303, 172.050052, 88.40885, 172.050052),\n (88.40885, 172.050052, 88.40885, 127.95295),\n (88.40885, 127.95295, 132.588303, 127.95295),\n (132.588303, 113.95295, 132.588303, 61.950052),\n (132.588303, 61.950052, 88.40885, 61.950052),\n (88.40885, 113.95295, 88.40885, 61.950052),\n (88.40885, 113.95295, 132.588303, 113.95295),\n (146.588303, 172.050052, 198.591202, 172.050052),\n (198.591202, 172.050052, 198.591202, 127.95295),\n (190.767757, 164.226607, 146.588303, 164.226607),\n (146.588303, 172.050052, 146.588303, 164.226607),\n (190.767757, 127.95295, 198.591202, 127.95295),\n (190.767757, 164.226607, 190.767757, 127.95295)\n]\nVISIBLE_CIRCLES = [\n (110.7311, 91.6307, 13.951406)\n]\nVISIBLE_ARCS = [\n\n]\nHIDDEN_SEGMENTS = [\n (132.5883, 164.2266, 88.4088, 164.2266),\n (124.6825, 172.05, 124.6825, 164.2266),\n (96.7797, 164.2266, 96.7797, 172.05),\n (132.5883, 69.7734, 88.4088, 69.7734),\n (182.8619, 164.2266, 182.8619, 172.05),\n (154.9591, 164.2266, 154.9591, 172.05)\n]\n# (orient, text, p1, p2, base) for linear; (orient, text, center, radius, angle) for diameter\nDIMENSIONS = [\n ('horizontal', '100', (132.5883, 172.05), (88.4088, 172.05), (110.4986, 161.05)),\n ('vertical', '17.7083', (88.4088, 172.05), (88.4088, 164.1442), (99.4088, 168.0971)),\n ('vertical', '17.7083', (146.5883, 172.05), (146.5883, 164.2266), (157.5883, 168.1383)),\n ('diameter', '%%c63.1579', (110.7311, 91.6307), 13.9514, 45),\n ('horizontal', '100', (88.4088, 91.6307), (110.7311, 91.6307), (99.5699, 102.6307))\n]\n\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; _ds.dxf.dimasz = 2.5\n _ds.dxf.dimexe = 1.25; _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\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\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,\n angle=(0 if d[0] == \"horizontal\" else 90),\n 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,\n 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,\n 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,\n text=text, dimstyle=\"EZDXF\").render()\n\n doc.saveas(out_path)\n\n\nif __name__ == \"__main__\":\n out = sys.argv[1] if len(sys.argv) > 1 else \"0075_00753176_gt.dxf\"\n draw(out)\n print(\"wrote\", out)\n```"}], "images": ["images/0075_00753176.png"], "id": "0075_00753176"} {"messages": [{"role": "user", "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 34.81 mm. The outline includes one or more oblique (angled) edges. A union feature: The part is a circular plate with diameter 67.24 mm. It is extruded to a thickness of 34.81 mm."}, {"role": "assistant", "content": "```python\n#!/usr/bin/env python3\n# -*- coding: utf-8 -*-\n# Ground-truth 2D engineering drawing for part: 0076_00760439\n# Self-contained: reproduces the three-view DXF via ezdxf, NO FreeCAD needed.\n# Coordinates are A4 page millimetres (scale=0.3849882539595325, page=[297.0, 210.0]).\n# visible edges -> solid (layer OUTLINE); hidden edges -> dashed (layer HIDDEN)\n# dimensions -> real movable DIMENSION entities (text = true mm value)\n# Run: python 0076_00760439_gt.py [out.dxf]\nimport sys\nimport ezdxf\nimport math\n\nSCALE = 0.3849882539595325\nPAGE = [297.0, 210.0]\n\nVISIBLE_SEGMENTS = [\n (107.567176, 102.750447, 145.004855, 106.733179),\n (85.263878, 133.815755, 107.567176, 102.750447),\n (145.004855, 106.733179, 160.935783, 141.781219),\n (160.935783, 141.781219, 138.632484, 172.04998),\n (138.632484, 172.04998, 101.194805, 168.863795),\n (101.194805, 168.863795, 85.263878, 133.815755),\n (85.263878, 88.750447, 85.263878, 75.350214),\n (160.935783, 88.750447, 160.935783, 75.350214),\n (160.935783, 88.750447, 138.632484, 88.750447),\n (138.632484, 88.750447, 101.194805, 88.750447),\n (101.194805, 88.750447, 85.263878, 88.750447),\n (160.935783, 75.350214, 138.632484, 75.350214),\n (138.632484, 75.350214, 101.194805, 75.350214),\n (101.194805, 75.350214, 85.263878, 75.350214),\n (101.194805, 88.750447, 101.194805, 75.350214),\n (138.632484, 88.750447, 138.632484, 75.350214),\n (135.981478, 75.350214, 135.981478, 61.94998),\n (135.981478, 61.94998, 135.172486, 61.94998),\n (135.172486, 61.94998, 134.363494, 61.94998),\n (134.363494, 61.94998, 133.554501, 61.94998),\n (133.554501, 61.94998, 132.745509, 61.94998),\n (132.745509, 61.94998, 131.936516, 61.94998),\n (131.936516, 61.94998, 131.127524, 61.94998),\n (131.127524, 61.94998, 130.318532, 61.94998),\n (130.318532, 61.94998, 129.509539, 61.94998),\n (129.509539, 61.94998, 128.700547, 61.94998),\n (128.700547, 61.94998, 127.891554, 61.94998),\n (127.891554, 61.94998, 127.082562, 61.94998),\n (127.082562, 61.94998, 126.27357, 61.94998),\n (126.27357, 61.94998, 125.464577, 61.94998),\n (125.464577, 61.94998, 124.655585, 61.94998),\n (124.655585, 61.94998, 123.846592, 61.94998),\n (123.846592, 61.94998, 123.0376, 61.94998),\n (123.0376, 61.94998, 122.228608, 61.94998),\n (122.228608, 61.94998, 121.419615, 61.94998),\n (121.419615, 61.94998, 120.610623, 61.94998),\n (120.610623, 61.94998, 119.80163, 61.94998),\n (119.80163, 61.94998, 118.992638, 61.94998),\n (118.992638, 61.94998, 118.183646, 61.94998),\n (118.183646, 61.94998, 117.374653, 61.94998),\n (117.374653, 61.94998, 116.565661, 61.94998),\n (116.565661, 61.94998, 115.756668, 61.94998),\n (115.756668, 61.94998, 114.947676, 61.94998),\n (114.947676, 61.94998, 114.138684, 61.94998),\n (114.138684, 61.94998, 113.329691, 61.94998),\n (113.329691, 61.94998, 112.520699, 61.94998),\n (112.520699, 61.94998, 111.711706, 61.94998),\n (111.711706, 61.94998, 110.902714, 61.94998),\n (110.902714, 61.94998, 110.093722, 61.94998),\n (110.093722, 61.94998, 110.093722, 75.350214),\n (174.935783, 102.750447, 188.336016, 102.750447),\n (174.935783, 133.815755, 188.336016, 133.815755),\n (188.336016, 133.815755, 188.336016, 102.750447),\n (174.935783, 133.815755, 174.935783, 102.750447),\n (174.935783, 172.04998, 174.935783, 168.863795),\n (174.935783, 168.863795, 174.935783, 133.815755),\n (188.336016, 172.04998, 188.336016, 168.863795),\n (188.336016, 168.863795, 188.336016, 133.815755),\n (174.935783, 168.863795, 188.336016, 168.863795),\n (174.935783, 172.04998, 188.336016, 172.04998),\n (201.736249, 150.700878, 201.736249, 149.891886),\n (201.736249, 149.891886, 201.736249, 149.082894),\n (201.736249, 149.082894, 201.736249, 148.273901),\n (201.736249, 148.273901, 201.736249, 147.464909),\n (201.736249, 147.464909, 201.736249, 146.655916),\n (201.736249, 146.655916, 201.736249, 145.846924),\n (201.736249, 145.846924, 201.736249, 145.037932),\n (201.736249, 145.037932, 201.736249, 144.228939),\n (201.736249, 144.228939, 201.736249, 143.419947),\n (201.736249, 143.419947, 201.736249, 142.610954),\n (201.736249, 142.610954, 201.736249, 141.801962),\n (201.736249, 141.801962, 201.736249, 140.99297),\n (201.736249, 140.99297, 201.736249, 140.183977),\n (201.736249, 140.183977, 201.736249, 139.374985),\n (201.736249, 139.374985, 201.736249, 138.565992),\n (201.736249, 138.565992, 201.736249, 137.757),\n (201.736249, 137.757, 201.736249, 136.948008),\n (201.736249, 136.948008, 201.736249, 136.139015),\n (201.736249, 136.139015, 201.736249, 135.330023),\n (201.736249, 135.330023, 201.736249, 134.52103),\n (201.736249, 134.52103, 201.736249, 133.712038),\n (201.736249, 133.712038, 201.736249, 132.903046),\n (201.736249, 132.903046, 201.736249, 132.094053),\n (201.736249, 132.094053, 201.736249, 131.285061),\n (201.736249, 131.285061, 201.736249, 130.476068),\n (201.736249, 130.476068, 201.736249, 129.667076),\n (201.736249, 129.667076, 201.736249, 128.858084),\n (201.736249, 128.858084, 201.736249, 128.049091),\n (201.736249, 128.049091, 201.736249, 127.240099),\n (201.736249, 127.240099, 201.736249, 126.431106),\n (201.736249, 126.431106, 201.736249, 125.622114),\n (201.736249, 125.622114, 201.736249, 124.813122),\n (201.736249, 150.700878, 188.336016, 150.700878),\n (201.736249, 124.813122, 188.336016, 124.813122)\n]\nVISIBLE_CIRCLES = [\n (123.0376, 137.757, 12.943878)\n]\nVISIBLE_ARCS = [\n\n]\nHIDDEN_SEGMENTS = [\n (107.5671, 88.7505, 107.5671, 75.3502),\n (145.0048, 88.7505, 145.0048, 75.3502),\n (174.9357, 106.7332, 188.336, 106.7332),\n (174.9357, 141.7812, 188.336, 141.7812)\n]\n# (orient, text, p1, p2, base) for linear; (orient, text, center, radius, angle) for diameter\nDIMENSIONS = [\n ('aligned', '97.7924', (107.5671, 102.7505), (145.0048, 106.7332), (125.1223, 115.6801)),\n ('aligned', '100', (145.0048, 106.7332), (160.9357, 141.7812), (142.9562, 128.809)),\n ('aligned', '97.661', (160.9357, 141.7812), (138.6324, 172.05), (140.9285, 150.3904)),\n ('aligned', '97.5952', (138.6324, 172.05), (101.1947, 168.8638), (120.8464, 159.4965)),\n ('aligned', '100', (101.1947, 168.8638), (85.2638, 133.8158), (103.2433, 146.788)),\n ('aligned', '99.3343', (85.2638, 133.8158), (107.5671, 102.7505), (105.351, 124.6984)),\n ('diameter', '%%c67.243', (123.0376, 137.757), 12.9439, 45),\n ('horizontal', '34.8069', (174.9357, 102.7505), (188.336, 102.7505), (181.6358, 113.7505)),\n ('horizontal', '34.8069', (188.336, 137.757), (201.7362, 137.757), (195.0361, 148.757))\n]\n\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; _ds.dxf.dimasz = 2.5\n _ds.dxf.dimexe = 1.25; _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\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\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,\n angle=(0 if d[0] == \"horizontal\" else 90),\n 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,\n 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,\n 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,\n text=text, dimstyle=\"EZDXF\").render()\n\n doc.saveas(out_path)\n\n\nif __name__ == \"__main__\":\n out = sys.argv[1] if len(sys.argv) > 1 else \"0076_00760439_gt.dxf\"\n draw(out)\n print(\"wrote\", out)\n```"}], "images": ["images/0076_00760439.png"], "id": "0076_00760439"} {"messages": [{"role": "user", "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 82.11 mm tall. It is extruded to a thickness of 63.58 mm. A cut feature: The part is a circular plate with diameter 36.81 mm. It is extruded to a thickness of -45.7 mm."}, {"role": "assistant", "content": "```python\n#!/usr/bin/env python3\n# -*- coding: utf-8 -*-\n# Ground-truth 2D engineering drawing for part: 0077_00774766\n# Self-contained: reproduces the three-view DXF via ezdxf, NO FreeCAD needed.\n# Coordinates are A4 page millimetres (scale=0.6596585797684444, page=[297.0, 210.0]).\n# visible edges -> solid (layer OUTLINE); hidden edges -> dashed (layer HIDDEN)\n# dimensions -> real movable DIMENSION entities (text = true mm value)\n# Run: python 0077_00774766_gt.py [out.dxf]\nimport sys\nimport ezdxf\nimport math\n\nSCALE = 0.6596585797684444\nPAGE = [297.0, 210.0]\n\nVISIBLE_SEGMENTS = [\n (148.51359, 117.888541, 148.51359, 172.049982),\n (82.547732, 117.888541, 148.51359, 117.888541),\n (148.51359, 172.049982, 82.547732, 172.049982),\n (82.547732, 172.049982, 82.547732, 117.888541),\n (148.51359, 103.888541, 148.51359, 61.949982),\n (148.51359, 61.949982, 82.547732, 61.949982),\n (82.547732, 103.888541, 82.547732, 61.949982),\n (148.51359, 103.888541, 82.547732, 103.888541),\n (162.51359, 117.888541, 204.452148, 117.888541),\n (162.51359, 172.049982, 204.452148, 172.049982),\n (162.51359, 172.049982, 162.51359, 117.888541),\n (204.452148, 172.049982, 204.452148, 117.888541)\n]\nVISIBLE_CIRCLES = [\n (116.9677, 144.537, 12.140109)\n]\nVISIBLE_ARCS = [\n\n]\nHIDDEN_SEGMENTS = [\n (129.1079, 61.95, 129.1079, 92.0933),\n (129.1079, 92.0933, 104.8277, 92.0933),\n (104.8277, 92.0933, 104.8277, 61.95),\n (174.3089, 156.6771, 174.3089, 132.3969),\n (174.3089, 132.3969, 204.4522, 132.3969),\n (174.3089, 156.6771, 204.4522, 156.6771)\n]\n# (orient, text, p1, p2, base) for linear; (orient, text, center, radius, angle) for diameter\nDIMENSIONS = [\n ('horizontal', '100', (148.5137, 172.05), (82.5478, 172.05), (115.5307, 161.05)),\n ('vertical', '82.1053', (148.5137, 117.8886), (148.5137, 172.05), (137.5137, 144.9693)),\n ('diameter', '%%c36.8072', (116.9677, 144.537), 12.1401, 45),\n ('horizontal', '52.1784', (82.5478, 117.8886), (116.9677, 117.8886), (99.7578, 128.8886)),\n ('vertical', '40.3973', (116.9677, 117.8886), (116.9677, 144.537), (105.9677, 131.2128)),\n ('horizontal', '63.5762', (162.5136, 117.8886), (204.4522, 117.8886), (183.4829, 128.8886))\n]\n\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; _ds.dxf.dimasz = 2.5\n _ds.dxf.dimexe = 1.25; _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\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\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,\n angle=(0 if d[0] == \"horizontal\" else 90),\n 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,\n 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,\n 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,\n text=text, dimstyle=\"EZDXF\").render()\n\n doc.saveas(out_path)\n\n\nif __name__ == \"__main__\":\n out = sys.argv[1] if len(sys.argv) > 1 else \"0077_00774766_gt.dxf\"\n draw(out)\n print(\"wrote\", out)\n```"}], "images": ["images/0077_00774766.png"], "id": "0077_00774766"} {"messages": [{"role": "user", "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. It is extruded to a thickness of 24.84 mm. The outline includes one or more oblique (angled) edges. A cut feature: The part is a circular plate with diameter 25.1 mm. It is extruded to a thickness of -62.75 mm."}, {"role": "assistant", "content": "```python\n#!/usr/bin/env python3\n# -*- coding: utf-8 -*-\n# Ground-truth 2D engineering drawing for part: 0083_00831802\n# Self-contained: reproduces the three-view DXF via ezdxf, NO FreeCAD needed.\n# Coordinates are A4 page millimetres (scale=0.7698062827225027, page=[297.0, 210.0]).\n# visible edges -> solid (layer OUTLINE); hidden edges -> dashed (layer HIDDEN)\n# dimensions -> real movable DIMENSION entities (text = true mm value)\n# Run: python 0083_00831802_gt.py [out.dxf]\nimport sys\nimport ezdxf\nimport math\n\nSCALE = 0.7698062827225027\nPAGE = [297.0, 210.0]\n\nVISIBLE_SEGMENTS = [\n (159.758349, 172.050016, 159.758349, 124.240994),\n (94.122235, 172.050016, 159.758349, 172.050016),\n (159.758349, 124.240994, 140.310612, 95.069387),\n (140.310612, 95.069387, 94.122235, 95.069387),\n (94.122235, 95.069387, 94.122235, 172.050016),\n (159.758349, 61.950016, 159.758349, 81.069387),\n (94.122235, 61.950016, 94.122235, 81.069387),\n (94.122235, 81.069387, 159.758349, 81.069387),\n (94.122235, 61.950016, 159.758349, 61.950016),\n (192.877721, 172.050016, 173.758349, 172.050016),\n (192.877721, 95.069387, 192.877721, 172.050016),\n (173.758349, 95.069387, 173.758349, 172.050016),\n (192.877721, 95.069387, 173.758349, 95.069387)\n]\nVISIBLE_CIRCLES = [\n (115.3548, 129.283, 9.660314)\n]\nVISIBLE_ARCS = [\n\n]\nHIDDEN_SEGMENTS = [\n (140.3106, 61.95, 140.3106, 81.0694),\n (125.0151, 81.0694, 125.0151, 61.95),\n (105.6945, 61.95, 105.6945, 81.0694),\n (192.8777, 124.241, 173.7584, 124.241),\n (192.8777, 138.9433, 173.7584, 138.9433),\n (192.8777, 119.6227, 173.7584, 119.6227)\n]\n# (orient, text, p1, p2, base) for linear; (orient, text, center, radius, angle) for diameter\nDIMENSIONS = [\n ('horizontal', '60', (140.3107, 95.0694), (94.1223, 95.0694), (117.2165, 84.0694)),\n ('horizontal', '85.2632', (94.1223, 172.05), (159.7583, 172.05), (126.9403, 183.05)),\n ('vertical', '62.1053', (159.7583, 172.05), (159.7583, 124.241), (170.7583, 148.1455)),\n ('vertical', '100', (94.1223, 95.0694), (94.1223, 172.05), (83.1223, 133.5597)),\n ('aligned', '45.5438', (159.7583, 124.241), (140.3107, 95.0694), (159.1871, 103.5535)),\n ('diameter', '%%c25.098', (115.3548, 129.283), 9.6603, 45),\n ('horizontal', '27.5817', (94.1223, 172.05), (115.3548, 172.05), (104.7386, 183.05)),\n ('vertical', '55.5556', (115.3548, 172.05), (115.3548, 129.283), (126.3548, 150.6665)),\n ('horizontal', '24.8366', (192.8777, 172.05), (173.7584, 172.05), (183.3181, 161.05)),\n ('horizontal', '24.8366', (173.7584, 129.283), (222.0599, 129.283), (197.9092, 140.283))\n]\n\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; _ds.dxf.dimasz = 2.5\n _ds.dxf.dimexe = 1.25; _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\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\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,\n angle=(0 if d[0] == \"horizontal\" else 90),\n 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,\n 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,\n 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,\n text=text, dimstyle=\"EZDXF\").render()\n\n doc.saveas(out_path)\n\n\nif __name__ == \"__main__\":\n out = sys.argv[1] if len(sys.argv) > 1 else \"0083_00831802_gt.dxf\"\n draw(out)\n print(\"wrote\", out)\n```"}], "images": ["images/0083_00831802.png"], "id": "0083_00831802"} {"messages": [{"role": "user", "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 an L-shaped (stepped) plate within a 100 x 66.32 mm bounding box. It is extruded to a thickness of 1.04 mm. A cut feature: The part is a circular plate with diameter 6.32 mm. It is extruded to a thickness of -8.33 mm."}, {"role": "assistant", "content": "```python\n#!/usr/bin/env python3\n# -*- coding: utf-8 -*-\n# Ground-truth 2D engineering drawing for part: 0083_00836424\n# Self-contained: reproduces the three-view DXF via ezdxf, NO FreeCAD needed.\n# Coordinates are A4 page millimetres (scale=1.426716587986323, page=[297.0, 210.0]).\n# visible edges -> solid (layer OUTLINE); hidden edges -> dashed (layer HIDDEN)\n# dimensions -> real movable DIMENSION entities (text = true mm value)\n# Run: python 0083_00836424_gt.py [out.dxf]\nimport sys\nimport ezdxf\nimport math\n\nSCALE = 1.426716587986323\nPAGE = [297.0, 210.0]\n\nVISIBLE_SEGMENTS = [\n (207.092828, 77.436181, 207.092828, 101.465092),\n (64.421169, 77.436181, 207.092828, 77.436181),\n (207.092828, 101.465092, 178.558496, 101.465092),\n (178.558496, 101.465092, 178.558496, 172.050018),\n (178.558496, 172.050018, 64.421169, 172.050018),\n (64.421169, 172.050018, 64.421169, 77.436181),\n (207.092828, 63.436181, 207.092828, 61.950018),\n (207.092828, 61.950018, 178.558496, 61.950018),\n (207.092828, 63.436181, 178.558496, 63.436181),\n (178.558496, 63.436181, 64.421169, 63.436181),\n (178.558496, 61.950018, 64.421169, 61.950018),\n (64.421169, 63.436181, 64.421169, 61.950018),\n (178.558496, 63.436181, 178.558496, 61.950018),\n (221.092828, 77.436181, 222.578991, 77.436181),\n (221.092828, 172.050018, 221.092828, 77.436181),\n (222.578991, 172.050018, 222.578991, 77.436181),\n (221.092828, 172.050018, 222.578991, 172.050018)\n]\nVISIBLE_CIRCLES = [\n (92.7052, 153.2305, 4.505421)\n]\nVISIBLE_ARCS = [\n\n]\nHIDDEN_SEGMENTS = [\n (97.2105, 61.95, 97.2105, 63.4362),\n (88.1997, 63.4362, 88.1997, 61.95),\n (221.0927, 101.4651, 222.5789, 101.4651),\n (221.0927, 148.7251, 222.5789, 148.7251),\n (221.0927, 157.7359, 222.5789, 157.7359)\n]\n# (orient, text, p1, p2, base) for linear; (orient, text, center, radius, angle) for diameter\nDIMENSIONS = [\n ('horizontal', '20', (207.0927, 101.4651), (178.5584, 101.4651), (192.8256, 90.4651)),\n ('horizontal', '80', (178.5584, 172.05), (64.4211, 172.05), (121.4898, 161.05)),\n ('horizontal', '100', (64.4211, 77.4362), (207.0927, 77.4362), (135.7569, 88.4362)),\n ('vertical', '16.8421', (207.0927, 77.4362), (207.0927, 101.4651), (196.0927, 89.4506)),\n ('vertical', '49.4737', (178.5584, 101.4651), (178.5584, 172.05), (167.5584, 136.7575)),\n ('vertical', '66.3158', (64.4211, 172.05), (64.4211, 77.4362), (75.4211, 124.7431)),\n ('diameter', '%%c6.3158', (92.7052, 153.2305), 4.5054, 45),\n ('horizontal', '19.8246', (64.4211, 77.4362), (92.7052, 77.4362), (78.5631, 88.4362)),\n ('vertical', '53.125', (92.7052, 77.4362), (92.7052, 153.2305), (81.7052, 115.3333)),\n ('horizontal', '1.0417', (221.0927, 77.4362), (222.579, 77.4362), (221.8359, 88.4362)),\n ('horizontal', '1.0417', (222.579, 153.2305), (210.6897, 153.2305), (216.6343, 142.2305))\n]\n\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; _ds.dxf.dimasz = 2.5\n _ds.dxf.dimexe = 1.25; _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\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\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,\n angle=(0 if d[0] == \"horizontal\" else 90),\n 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,\n 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,\n 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,\n text=text, dimstyle=\"EZDXF\").render()\n\n doc.saveas(out_path)\n\n\nif __name__ == \"__main__\":\n out = sys.argv[1] if len(sys.argv) > 1 else \"0083_00836424_gt.dxf\"\n draw(out)\n print(\"wrote\", out)\n```"}], "images": ["images/0083_00836424.png"], "id": "0083_00836424"} {"messages": [{"role": "user", "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 15.79 mm tall. It is extruded to a thickness of 15.29 mm. A cut feature: The part is a circular plate with diameter 3.78 mm. It is extruded to a thickness of -15.29 mm. A cut feature: The part is a circular plate with diameter 3.78 mm. It is extruded to a thickness of -15.29 mm."}, {"role": "assistant", "content": "```python\n#!/usr/bin/env python3\n# -*- coding: utf-8 -*-\n# Ground-truth 2D engineering drawing for part: 0085_00851590\n# Self-contained: reproduces the three-view DXF via ezdxf, NO FreeCAD needed.\n# Coordinates are A4 page millimetres (scale=1.2690272727273442, page=[297.0, 210.0]).\n# visible edges -> solid (layer OUTLINE); hidden edges -> dashed (layer HIDDEN)\n# dimensions -> real movable DIMENSION entities (text = true mm value)\n# Run: python 0085_00851590_gt.py [out.dxf]\nimport sys\nimport ezdxf\nimport math\n\nSCALE = 1.2690272727273442\nPAGE = [297.0, 210.0]\n\nVISIBLE_SEGMENTS = [\n (190.251802, 143.718173, 190.251802, 123.6809),\n (63.349074, 143.718173, 190.251802, 143.718173),\n (190.251802, 123.6809, 63.349074, 123.6809),\n (63.349074, 123.6809, 63.349074, 143.718173),\n (190.251802, 90.281757, 190.251802, 109.6809),\n (63.349074, 90.281757, 63.349074, 109.6809),\n (63.349074, 109.6809, 190.251802, 109.6809),\n (63.349074, 90.281757, 190.251802, 90.281757),\n (223.650945, 143.718173, 204.251802, 143.718173),\n (223.650945, 123.6809, 204.251802, 123.6809),\n (223.650945, 123.6809, 223.650945, 143.718173),\n (204.251802, 123.6809, 204.251802, 143.718173)\n]\nVISIBLE_CIRCLES = [\n (131.2716, 129.168815, 2.399368),\n (131.2716, 139.676685, 2.399368)\n]\nVISIBLE_ARCS = [\n\n]\nHIDDEN_SEGMENTS = [\n (133.671, 109.6809, 133.671, 90.2818),\n (128.8722, 90.2818, 128.8722, 109.6809),\n (223.6509, 131.5682, 204.2518, 131.5682),\n (223.6509, 126.7695, 204.2518, 126.7695),\n (223.6509, 142.0761, 204.2518, 142.0761),\n (223.6509, 137.2774, 204.2518, 137.2774)\n]\n# (orient, text, p1, p2, base) for linear; (orient, text, center, radius, angle) for diameter\nDIMENSIONS = [\n ('horizontal', '100', (190.2518, 123.6809), (63.3491, 123.6809), (126.8004, 112.6809)),\n ('vertical', '15.7895', (190.2518, 143.7182), (190.2518, 123.6809), (201.2518, 133.6995)),\n ('diameter', '%%c3.7814', (131.2716, 129.1688), 2.3993, 45),\n ('horizontal', '53.5233', (63.3491, 143.7182), (131.2716, 143.7182), (97.3103, 154.7182)),\n ('vertical', '11.465', (131.2716, 143.7182), (131.2716, 129.1688), (142.2716, 136.4435)),\n ('diameter', '%%c3.7814', (131.2716, 139.6767), 2.3993, 45),\n ('horizontal', '53.5233', (63.3491, 143.7182), (131.2716, 143.7182), (97.3103, 154.7182)),\n ('vertical', '3.1847', (131.2716, 143.7182), (131.2716, 139.6767), (142.2716, 141.6975)),\n ('horizontal', '15.2866', (223.6509, 143.7182), (204.2518, 143.7182), (213.9514, 132.7182)),\n ('horizontal', '15.2866', (204.2518, 129.1688), (223.6509, 129.1688), (213.9514, 140.1688)),\n ('horizontal', '15.2866', (204.2518, 139.6767), (223.6509, 139.6767), (213.9514, 150.6767))\n]\n\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; _ds.dxf.dimasz = 2.5\n _ds.dxf.dimexe = 1.25; _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\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\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,\n angle=(0 if d[0] == \"horizontal\" else 90),\n 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,\n 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,\n 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,\n text=text, dimstyle=\"EZDXF\").render()\n\n doc.saveas(out_path)\n\n\nif __name__ == \"__main__\":\n out = sys.argv[1] if len(sys.argv) > 1 else \"0085_00851590_gt.dxf\"\n draw(out)\n print(\"wrote\", out)\n```"}], "images": ["images/0085_00851590.png"], "id": "0085_00851590"} {"messages": [{"role": "user", "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, featuring a rectangular cutout 22.11 x 13.68 mm. It is extruded to a thickness of 0.7 mm. A cut feature: The part is a circular plate with diameter 0.71 mm. It is extruded to a thickness of -0.7 mm. A cut feature: The part is a circular plate with diameter 0.7 mm. It is extruded to a thickness of -0.7 mm. A cut feature: The part is a circular plate with diameter 0.7 mm. It is extruded to a thickness of -0.7 mm. A cut feature: The part is a circular plate with diameter 0.7 mm. It is extruded to a thickness of -0.7 mm. A cut feature: The part is a circular plate with diameter 0.7 mm. It is extruded to a thickness of -0.7 mm. A cut feature: The part is a circular plate with diameter 0.7 mm. It is extruded to a thickness of -0.7 mm. A cut feature: The part is a circular plate with diameter 0.7 mm. It is extruded to a thickness of -0.7 mm."}, {"role": "assistant", "content": "```python\n#!/usr/bin/env python3\n# -*- coding: utf-8 -*-\n# Ground-truth 2D engineering drawing for part: 0090_00909172\n# Self-contained: reproduces the three-view DXF via ezdxf, NO FreeCAD needed.\n# Coordinates are A4 page millimetres (scale=0.88350000000007, page=[297.0, 210.0]).\n# visible edges -> solid (layer OUTLINE); hidden edges -> dashed (layer HIDDEN)\n# dimensions -> real movable DIMENSION entities (text = true mm value)\n# Run: python 0090_00909172_gt.py [out.dxf]\nimport sys\nimport ezdxf\nimport math\n\nSCALE = 0.88350000000007\nPAGE = [297.0, 210.0]\n\nVISIBLE_SEGMENTS = [\n (165.483921, 168.486095, 165.483921, 80.136095),\n (106.893921, 168.486095, 165.483921, 168.486095),\n (165.483921, 80.136095, 106.893921, 80.136095),\n (106.893921, 80.136095, 106.893921, 168.486095),\n (126.423921, 95.016095, 126.423921, 107.106095),\n (145.953921, 95.016095, 126.423921, 95.016095),\n (145.953921, 107.106095, 145.953921, 95.016095),\n (126.423921, 107.106095, 145.953921, 107.106095),\n (165.483921, 65.513912, 165.483921, 66.136095),\n (106.893921, 65.513912, 106.893921, 66.136095),\n (106.893921, 66.136095, 165.483921, 66.136095),\n (106.893921, 65.513912, 165.483921, 65.513912),\n (180.106104, 168.486095, 179.483921, 168.486095),\n (180.106104, 80.136095, 179.483921, 80.136095),\n (180.106104, 80.136095, 180.106104, 168.486095),\n (179.483921, 80.136095, 179.483921, 168.486095)\n]\nVISIBLE_CIRCLES = [\n (125.251597, 93.824124, 0.307817),\n (125.251597, 100.668138, 0.307817),\n (125.251597, 107.512152, 0.307817),\n (136.450893, 91.957574, 0.314366),\n (147.028005, 93.824124, 0.307817),\n (147.028005, 100.668138, 0.307817),\n (147.028005, 107.512152, 0.307817)\n]\nVISIBLE_ARCS = [\n\n]\nHIDDEN_SEGMENTS = [\n (125.5594, 66.1361, 125.5594, 65.5139),\n (136.7652, 66.1361, 136.7652, 65.5139),\n (147.3358, 66.1361, 147.3358, 65.5139),\n (126.4239, 65.5139, 126.4239, 66.1361),\n (145.9539, 65.5139, 145.9539, 66.1361),\n (124.9438, 65.5139, 124.9438, 66.1361),\n (136.1365, 65.5139, 136.1365, 66.1361),\n (146.7202, 65.5139, 146.7202, 66.1361),\n (180.1061, 95.0161, 179.4839, 95.0161),\n (180.1061, 107.1061, 179.4839, 107.1061),\n (180.1061, 94.1319, 179.4839, 94.1319),\n (180.1061, 93.5163, 179.4839, 93.5163),\n (180.1061, 100.976, 179.4839, 100.976),\n (180.1061, 100.3603, 179.4839, 100.3603),\n (180.1061, 107.82, 179.4839, 107.82),\n (180.1061, 107.2043, 179.4839, 107.2043),\n (180.1061, 92.2719, 179.4839, 92.2719),\n (180.1061, 91.6432, 179.4839, 91.6432)\n]\n# (orient, text, p1, p2, base) for linear; (orient, text, center, radius, angle) for diameter\nDIMENSIONS = [\n ('horizontal', '66.3158', (165.4839, 80.1361), (106.8939, 80.1361), (136.1889, 69.1361)),\n ('vertical', '100', (165.4839, 168.4861), (165.4839, 80.1361), (176.4839, 124.3111)),\n ('horizontal', '22.1053', (126.4239, 107.106), (145.9539, 107.106), (136.1889, 118.106)),\n ('vertical', '13.6842', (126.4239, 107.106), (126.4239, 95.0161), (137.4239, 101.0611)),\n ('horizontal', '22.1053', (106.8939, 107.106), (126.4239, 107.106), (116.6589, 118.106)),\n ('vertical', '69.4737', (126.4239, 168.4861), (126.4239, 107.106), (137.4239, 137.7961)),\n ('diameter', '%%c0.7116', (136.4509, 91.9576), 0.3143, 45),\n ('horizontal', '33.4544', (106.8939, 168.4861), (136.4509, 168.4861), (121.6724, 179.4861)),\n ('vertical', '86.6197', (136.4509, 168.4861), (136.4509, 91.9576), (147.4509, 130.2218)),\n ('diameter', '%%c0.6968', (125.2516, 93.8241), 0.3078, 45),\n ('horizontal', '20.7784', (106.8939, 168.4861), (125.2516, 168.4861), (116.0728, 179.4861)),\n ('vertical', '84.507', (125.2516, 168.4861), (125.2516, 93.8241), (136.2516, 131.1551)),\n ('diameter', '%%c0.6968', (125.2516, 100.6682), 0.3078, 45),\n ('horizontal', '20.7784', (106.8939, 168.4861), (125.2516, 168.4861), (116.0728, 179.4861)),\n ('vertical', '76.7605', (125.2516, 168.4861), (125.2516, 100.6682), (136.2516, 134.5771)),\n ('diameter', '%%c0.6968', (125.2516, 107.5121), 0.3078, 45),\n ('horizontal', '20.7784', (106.8939, 168.4861), (125.2516, 168.4861), (116.0728, 179.4861)),\n ('vertical', '69.0141', (125.2516, 168.4861), (125.2516, 107.5121), (136.2516, 137.9991)),\n ('diameter', '%%c0.6968', (147.028, 107.5121), 0.3078, 45),\n ('horizontal', '45.4263', (106.8939, 168.4861), (147.028, 168.4861), (126.961, 179.4861)),\n ('vertical', '69.0141', (147.028, 168.4861), (147.028, 107.5121), (158.028, 137.9991)),\n ('diameter', '%%c0.6968', (147.028, 93.8241), 0.3078, 45),\n ('horizontal', '45.4263', (106.8939, 168.4861), (147.028, 168.4861), (126.961, 179.4861)),\n ('vertical', '84.507', (147.028, 168.4861), (147.028, 93.8241), (158.028, 131.1551)),\n ('diameter', '%%c0.6968', (147.028, 100.6682), 0.3078, 45),\n ('horizontal', '45.4263', (106.8939, 168.4861), (147.028, 168.4861), (126.961, 179.4861)),\n ('vertical', '76.7605', (147.028, 168.4861), (147.028, 100.6682), (158.028, 134.5771)),\n ('horizontal', '0.7042', (180.1061, 168.4861), (179.4839, 168.4861), (179.795, 157.4861)),\n ('horizontal', '0.7042', (179.4839, 91.9576), (180.1061, 91.9576), (179.795, 102.9576)),\n ('horizontal', '0.7042', (179.4839, 93.8241), (180.1061, 93.8241), (179.795, 104.8241)),\n ('horizontal', '0.7042', (179.4839, 100.6682), (180.1061, 100.6682), (179.795, 111.6682)),\n ('horizontal', '0.7042', (179.4839, 107.5121), (180.1061, 107.5121), (179.795, 118.5121)),\n ('horizontal', '0.7042', (179.4839, 107.5121), (180.1061, 107.5121), (179.795, 118.5121)),\n ('horizontal', '0.7042', (179.4839, 93.8241), (180.1061, 93.8241), (179.795, 104.8241)),\n ('horizontal', '0.7042', (179.4839, 100.6682), (180.1061, 100.6682), (179.795, 111.6682))\n]\n\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; _ds.dxf.dimasz = 2.5\n _ds.dxf.dimexe = 1.25; _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\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\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,\n angle=(0 if d[0] == \"horizontal\" else 90),\n 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,\n 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,\n 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,\n text=text, dimstyle=\"EZDXF\").render()\n\n doc.saveas(out_path)\n\n\nif __name__ == \"__main__\":\n out = sys.argv[1] if len(sys.argv) > 1 else \"0090_00909172_gt.dxf\"\n draw(out)\n print(\"wrote\", out)\n```"}], "images": ["images/0090_00909172.png"], "id": "0090_00909172"} {"messages": [{"role": "user", "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 3 straight edges. It is extruded to a thickness of 0.74 mm. The outline includes one or more oblique (angled) edges. A cut feature: The part is a circular plate with diameter 1.49 mm. It is extruded to a thickness of -4.42 mm. A cut feature: The part is a circular plate with diameter 1.46 mm. It is extruded to a thickness of -4.42 mm. A cut feature: The part is a circular plate with diameter 1.46 mm. It is extruded to a thickness of -4.42 mm. A cut feature: The part is a circular plate with diameter 1.49 mm. It is extruded to a thickness of -4.42 mm."}, {"role": "assistant", "content": "```python\n#!/usr/bin/env python3\n# -*- coding: utf-8 -*-\n# Ground-truth 2D engineering drawing for part: 0091_00911873\n# Self-contained: reproduces the three-view DXF via ezdxf, NO FreeCAD needed.\n# Coordinates are A4 page millimetres (scale=1.3450483135081626, page=[297.0, 210.0]).\n# visible edges -> solid (layer OUTLINE); hidden edges -> dashed (layer HIDDEN)\n# dimensions -> real movable DIMENSION entities (text = true mm value)\n# Run: python 0091_00911873_gt.py [out.dxf]\nimport sys\nimport ezdxf\nimport math\n\nSCALE = 1.3450483135081626\nPAGE = [297.0, 210.0]\n\nVISIBLE_SEGMENTS = [\n (183.559233, 76.940733, 88.449954, 172.050011),\n (88.449954, 76.940733, 183.559233, 76.940733),\n (88.449954, 172.050011, 88.449954, 76.940733),\n (183.559233, 62.940733, 183.559233, 61.950011),\n (183.559233, 61.950011, 88.449954, 61.950011),\n (88.449954, 62.940733, 88.449954, 61.950011),\n (183.559233, 62.940733, 88.449954, 62.940733),\n (197.559233, 172.050011, 198.549954, 172.050011),\n (197.559233, 76.940733, 198.549954, 76.940733),\n (198.549954, 172.050011, 198.549954, 76.940733),\n (197.559233, 172.050011, 197.559233, 76.940733)\n]\nVISIBLE_CIRCLES = [\n (98.367599, 86.847949, 1.00115),\n (135.024301, 86.847949, 0.980293),\n (98.367599, 123.504651, 1.00115),\n (135.024301, 123.504651, 0.980293)\n]\nVISIBLE_ARCS = [\n\n]\nHIDDEN_SEGMENTS = [\n (99.3688, 61.95, 99.3688, 62.9407),\n (136.0046, 61.95, 136.0046, 62.9407),\n (97.3665, 62.9407, 97.3665, 61.95),\n (134.0441, 62.9407, 134.0441, 61.95),\n (197.5593, 85.8468, 198.55, 85.8468),\n (197.5593, 87.8491, 198.55, 87.8491),\n (197.5593, 85.8676, 198.55, 85.8676),\n (197.5593, 87.8282, 198.55, 87.8282),\n (197.5593, 122.5035, 198.55, 122.5035),\n (197.5593, 124.5058, 198.55, 124.5058),\n (197.5593, 122.5243, 198.55, 122.5243),\n (197.5593, 124.4849, 198.55, 124.4849)\n]\n# (orient, text, p1, p2, base) for linear; (orient, text, center, radius, angle) for diameter\nDIMENSIONS = [\n ('horizontal', '70.7107', (88.45, 76.9407), (183.5593, 76.9407), (136.0047, 87.9407)),\n ('vertical', '70.7107', (88.45, 172.05), (88.45, 76.9407), (99.45, 124.4954)),\n ('aligned', '100', (183.5593, 76.9407), (88.45, 172.05), (128.2265, 116.7172)),\n ('diameter', '%%c1.4886', (98.3676, 123.5047), 1.0011, 45),\n ('horizontal', '7.3734', (88.45, 76.9407), (98.3676, 76.9407), (93.4088, 87.9407)),\n ('vertical', '34.6188', (98.3676, 76.9407), (98.3676, 123.5047), (87.3676, 100.2227)),\n ('diameter', '%%c1.4576', (135.0243, 123.5047), 0.9803, 45),\n ('horizontal', '34.6265', (88.45, 76.9407), (135.0243, 76.9407), (111.7372, 87.9407)),\n ('vertical', '34.6188', (135.0243, 76.9407), (135.0243, 123.5047), (124.0243, 100.2227)),\n ('diameter', '%%c1.4576', (135.0243, 86.8479), 0.9803, 45),\n ('horizontal', '34.6265', (88.45, 76.9407), (135.0243, 76.9407), (111.7372, 87.9407)),\n ('vertical', '7.3657', (135.0243, 76.9407), (135.0243, 86.8479), (124.0243, 81.8943)),\n ('diameter', '%%c1.4886', (98.3676, 86.8479), 1.0011, 45),\n ('horizontal', '7.3734', (88.45, 76.9407), (98.3676, 76.9407), (93.4088, 87.9407)),\n ('vertical', '7.3657', (98.3676, 76.9407), (98.3676, 86.8479), (87.3676, 81.8943)),\n ('horizontal', '0.7366', (197.5593, 76.9407), (198.55, 76.9407), (198.0547, 87.9407)),\n ('horizontal', '0.7366', (198.55, 123.5047), (192.6057, 123.5047), (195.5779, 112.5047)),\n ('horizontal', '0.7366', (198.55, 123.5047), (192.6057, 123.5047), (195.5779, 112.5047)),\n ('horizontal', '0.7366', (198.55, 86.8479), (192.6057, 86.8479), (195.5779, 75.8479)),\n ('horizontal', '0.7366', (198.55, 86.8479), (192.6057, 86.8479), (195.5779, 75.8479))\n]\n\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; _ds.dxf.dimasz = 2.5\n _ds.dxf.dimexe = 1.25; _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\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\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,\n angle=(0 if d[0] == \"horizontal\" else 90),\n 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,\n 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,\n 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,\n text=text, dimstyle=\"EZDXF\").render()\n\n doc.saveas(out_path)\n\n\nif __name__ == \"__main__\":\n out = sys.argv[1] if len(sys.argv) > 1 else \"0091_00911873_gt.dxf\"\n draw(out)\n print(\"wrote\", out)\n```"}], "images": ["images/0091_00911873.png"], "id": "0091_00911873"} {"messages": [{"role": "user", "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 union feature: The part is a rectangular plate 4.88 mm wide and 30.92 mm tall. It is extruded to a thickness of 15.46 mm."}, {"role": "assistant", "content": "```python\n#!/usr/bin/env python3\n# -*- coding: utf-8 -*-\n# Ground-truth 2D engineering drawing for part: 0091_00913461\n# Self-contained: reproduces the three-view DXF via ezdxf, NO FreeCAD needed.\n# Coordinates are A4 page millimetres (scale=0.807087620175879, page=[297.0, 210.0]).\n# visible edges -> solid (layer OUTLINE); hidden edges -> dashed (layer HIDDEN)\n# dimensions -> real movable DIMENSION entities (text = true mm value)\n# Run: python 0091_00913461_gt.py [out.dxf]\nimport sys\nimport ezdxf\nimport math\n\nSCALE = 0.807087620175879\nPAGE = [297.0, 210.0]\n\nVISIBLE_SEGMENTS = [\n (120.781402, 158.112482, 120.781402, 133.153718),\n (120.781402, 133.153718, 116.840545, 133.153718),\n (116.840545, 133.153718, 116.840545, 158.112482),\n (116.840545, 158.112482, 120.781402, 158.112482),\n (159.695181, 75.887481, 157.173032, 75.887481),\n (157.173032, 75.887481, 154.650883, 75.887481),\n (154.650883, 75.887481, 152.128735, 75.887481),\n (152.128735, 75.887481, 149.606586, 75.887481),\n (149.606586, 75.887481, 147.084437, 75.887481),\n (147.084437, 75.887481, 144.562288, 75.887481),\n (144.562288, 75.887481, 142.040139, 75.887481),\n (142.040139, 75.887481, 139.517991, 75.887481),\n (139.517991, 75.887481, 136.995842, 75.887481),\n (136.995842, 75.887481, 134.473693, 75.887481),\n (134.473693, 75.887481, 131.951544, 75.887481),\n (131.951544, 75.887481, 129.429395, 75.887481),\n (129.429395, 75.887481, 126.907246, 75.887481),\n (126.907246, 75.887481, 124.385098, 75.887481),\n (124.385098, 75.887481, 121.862949, 75.887481),\n (121.862949, 75.887481, 119.3408, 75.887481),\n (119.3408, 75.887481, 116.818651, 75.887481),\n (116.818651, 75.887481, 114.296502, 75.887481),\n (114.296502, 75.887481, 111.774354, 75.887481),\n (111.774354, 75.887481, 109.252205, 75.887481),\n (109.252205, 75.887481, 106.730056, 75.887481),\n (106.730056, 75.887481, 104.207907, 75.887481),\n (104.207907, 75.887481, 101.685758, 75.887481),\n (101.685758, 75.887481, 99.163609, 75.887481),\n (99.163609, 75.887481, 96.641461, 75.887481),\n (96.641461, 75.887481, 94.119312, 75.887481),\n (94.119312, 75.887481, 91.597163, 75.887481),\n (91.597163, 75.887481, 89.075014, 75.887481),\n (89.075014, 75.887481, 86.552865, 75.887481),\n (86.552865, 75.887481, 84.030717, 75.887481),\n (84.030717, 75.887481, 81.508568, 75.887481),\n (81.508568, 75.887481, 78.986419, 75.887481),\n (159.695181, 75.887481, 159.695181, 78.799337),\n (159.695181, 78.799337, 157.173032, 78.799337),\n (157.173032, 78.799337, 154.650883, 78.799337),\n (154.650883, 78.799337, 152.128735, 78.799337),\n (152.128735, 78.799337, 149.606586, 78.799337),\n (149.606586, 78.799337, 147.084437, 78.799337),\n (147.084437, 78.799337, 144.562288, 78.799337),\n (144.562288, 78.799337, 142.040139, 78.799337),\n (142.040139, 78.799337, 139.517991, 78.799337),\n (139.517991, 78.799337, 136.995842, 78.799337),\n (136.995842, 78.799337, 134.473693, 78.799337),\n (134.473693, 78.799337, 131.951544, 78.799337),\n (131.951544, 78.799337, 129.429395, 78.799337),\n (129.429395, 78.799337, 126.907246, 78.799337),\n (126.907246, 78.799337, 124.385098, 78.799337),\n (124.385098, 78.799337, 121.862949, 78.799337),\n (121.862949, 78.799337, 119.3408, 78.799337),\n (119.3408, 78.799337, 116.818651, 78.799337),\n (116.818651, 78.799337, 114.296502, 78.799337),\n (114.296502, 78.799337, 111.774354, 78.799337),\n (111.774354, 78.799337, 109.252205, 78.799337),\n (109.252205, 78.799337, 106.730056, 78.799337),\n (106.730056, 78.799337, 104.207907, 78.799337),\n (104.207907, 78.799337, 101.685758, 78.799337),\n (101.685758, 78.799337, 99.163609, 78.799337),\n (99.163609, 78.799337, 96.641461, 78.799337),\n (96.641461, 78.799337, 94.119312, 78.799337),\n (94.119312, 78.799337, 91.597163, 78.799337),\n (91.597163, 78.799337, 89.075014, 78.799337),\n (89.075014, 78.799337, 86.552865, 78.799337),\n (86.552865, 78.799337, 84.030717, 78.799337),\n (84.030717, 78.799337, 81.508568, 78.799337),\n (81.508568, 78.799337, 78.986419, 78.799337),\n (120.781402, 78.799337, 120.781402, 91.278719),\n (120.781402, 91.278719, 116.840545, 91.278719),\n (116.840545, 78.799337, 116.840545, 91.278719),\n (78.986419, 78.799337, 78.986419, 75.887481),\n (173.695181, 105.278719, 173.695181, 107.800868),\n (173.695181, 107.800868, 173.695181, 110.323017),\n (173.695181, 110.323017, 173.695181, 112.845165),\n (173.695181, 112.845165, 173.695181, 115.367314),\n (173.695181, 115.367314, 173.695181, 117.889463),\n (173.695181, 117.889463, 173.695181, 120.411612),\n (173.695181, 120.411612, 173.695181, 122.933761),\n (173.695181, 122.933761, 173.695181, 125.455909),\n (173.695181, 125.455909, 173.695181, 127.978058),\n (173.695181, 127.978058, 173.695181, 130.500207),\n (173.695181, 130.500207, 173.695181, 133.022356),\n (173.695181, 133.022356, 173.695181, 135.544505),\n (173.695181, 135.544505, 173.695181, 138.066654),\n (173.695181, 138.066654, 173.695181, 140.588802),\n (173.695181, 140.588802, 173.695181, 143.110951),\n (173.695181, 143.110951, 173.695181, 145.6331),\n (173.695181, 145.6331, 173.695181, 148.155249),\n (173.695181, 148.155249, 173.695181, 150.677398),\n (173.695181, 150.677398, 173.695181, 153.199546),\n (173.695181, 153.199546, 173.695181, 155.721695),\n (173.695181, 155.721695, 173.695181, 158.243844),\n (173.695181, 158.243844, 173.695181, 160.765993),\n (173.695181, 160.765993, 173.695181, 163.288142),\n (173.695181, 163.288142, 173.695181, 165.810291),\n (173.695181, 165.810291, 173.695181, 168.332439),\n (173.695181, 168.332439, 173.695181, 170.854588),\n (173.695181, 170.854588, 173.695181, 173.376737),\n (173.695181, 173.376737, 173.695181, 175.898886),\n (173.695181, 175.898886, 173.695181, 178.421035),\n (173.695181, 178.421035, 173.695181, 180.943183),\n (173.695181, 180.943183, 173.695181, 183.465332),\n (173.695181, 183.465332, 173.695181, 185.987481),\n (176.607037, 105.278719, 176.607037, 107.800868),\n (176.607037, 107.800868, 176.607037, 110.323017),\n (176.607037, 110.323017, 176.607037, 112.845165),\n (176.607037, 112.845165, 176.607037, 115.367314),\n (176.607037, 115.367314, 176.607037, 117.889463),\n (176.607037, 117.889463, 176.607037, 120.411612),\n (176.607037, 120.411612, 176.607037, 122.933761),\n (176.607037, 122.933761, 176.607037, 125.455909),\n (176.607037, 125.455909, 176.607037, 127.978058),\n (176.607037, 127.978058, 176.607037, 130.500207),\n (176.607037, 130.500207, 176.607037, 133.022356),\n (176.607037, 133.022356, 176.607037, 135.544505),\n (176.607037, 135.544505, 176.607037, 138.066654),\n (176.607037, 138.066654, 176.607037, 140.588802),\n (176.607037, 140.588802, 176.607037, 143.110951),\n (176.607037, 143.110951, 176.607037, 145.6331),\n (176.607037, 145.6331, 176.607037, 148.155249),\n (176.607037, 148.155249, 176.607037, 150.677398),\n (176.607037, 150.677398, 176.607037, 153.199546),\n (176.607037, 153.199546, 176.607037, 155.721695),\n (176.607037, 155.721695, 176.607037, 158.243844),\n (176.607037, 158.243844, 176.607037, 160.765993),\n (176.607037, 160.765993, 176.607037, 163.288142),\n (176.607037, 163.288142, 176.607037, 165.810291),\n (176.607037, 165.810291, 176.607037, 168.332439),\n (176.607037, 168.332439, 176.607037, 170.854588),\n (176.607037, 170.854588, 176.607037, 173.376737),\n (176.607037, 173.376737, 176.607037, 175.898886),\n (176.607037, 175.898886, 176.607037, 178.421035),\n (176.607037, 178.421035, 176.607037, 180.943183),\n (176.607037, 180.943183, 176.607037, 183.465332),\n (176.607037, 183.465332, 176.607037, 185.987481),\n (176.607037, 133.153718, 189.086419, 133.153718),\n (189.086419, 133.153718, 189.086419, 158.112482),\n (176.607037, 158.112482, 189.086419, 158.112482),\n (176.607037, 105.278719, 173.695181, 105.278719),\n (176.607037, 185.987481, 173.695181, 185.987481)\n]\nVISIBLE_CIRCLES = [\n (119.3408, 145.6331, 40.354381)\n]\nVISIBLE_ARCS = [\n\n]\nHIDDEN_SEGMENTS = [\n\n]\n# (orient, text, p1, p2, base) for linear; (orient, text, center, radius, angle) for diameter\nDIMENSIONS = [\n ('diameter', '%%c100', (119.3408, 145.6331), 40.3544, 45),\n ('horizontal', '4.8828', (116.8406, 133.1538), (120.7815, 133.1538), (118.8111, 144.1538)),\n ('vertical', '30.9245', (120.7815, 133.1538), (120.7815, 158.1125), (109.7815, 145.6331)),\n ('horizontal', '3.6079', (173.6952, 145.6331), (176.6071, 145.6331), (175.1512, 156.6331)),\n ('horizontal', '15.4622', (176.6071, 133.1538), (189.0865, 133.1538), (182.8468, 144.1538))\n]\n\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; _ds.dxf.dimasz = 2.5\n _ds.dxf.dimexe = 1.25; _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\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\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,\n angle=(0 if d[0] == \"horizontal\" else 90),\n 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,\n 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,\n 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,\n text=text, dimstyle=\"EZDXF\").render()\n\n doc.saveas(out_path)\n\n\nif __name__ == \"__main__\":\n out = sys.argv[1] if len(sys.argv) > 1 else \"0091_00913461_gt.dxf\"\n draw(out)\n print(\"wrote\", out)\n```"}], "images": ["images/0091_00913461.png"], "id": "0091_00913461"} {"messages": [{"role": "user", "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 48.42 mm tall, featuring 2 circular holes, each of diameter 8.42 mm. It is extruded to a thickness of 13.02 mm. A union feature: The part is a rectangular plate 65.62 mm wide and 48.36 mm tall. It is extruded to a thickness of 24.48 mm."}, {"role": "assistant", "content": "```python\n#!/usr/bin/env python3\n# -*- coding: utf-8 -*-\n# Ground-truth 2D engineering drawing for part: 0092_00921928\n# Self-contained: reproduces the three-view DXF via ezdxf, NO FreeCAD needed.\n# Coordinates are A4 page millimetres (scale=1.0686545454545455, page=[297.0, 210.0]).\n# visible edges -> solid (layer OUTLINE); hidden edges -> dashed (layer HIDDEN)\n# dimensions -> real movable DIMENSION entities (text = true mm value)\n# Run: python 0092_00921928_gt.py [out.dxf]\nimport sys\nimport ezdxf\nimport math\n\nSCALE = 1.0686545454545455\nPAGE = [297.0, 210.0]\n\nVISIBLE_SEGMENTS = [\n (169.895427, 118.164611, 169.895427, 169.909989),\n (63.029973, 118.164611, 81.397473, 118.164611),\n (81.397473, 118.164611, 151.527927, 118.164611),\n (151.527927, 118.164611, 169.895427, 118.164611),\n (169.895427, 169.909989, 63.029973, 169.909989),\n (63.029973, 169.909989, 63.029973, 118.164611),\n (151.527927, 118.164611, 151.527927, 169.839683),\n (151.527927, 169.839683, 81.397473, 169.839683),\n (81.397473, 169.839683, 81.397473, 118.164611),\n (169.895427, 104.164611, 169.895427, 90.249838),\n (169.895427, 90.249838, 63.029973, 90.249838),\n (63.029973, 104.164611, 63.029973, 90.249838),\n (169.895427, 104.164611, 63.029973, 104.164611),\n (151.527927, 90.249838, 151.527927, 64.090066),\n (151.527927, 64.090066, 81.397473, 64.090066),\n (81.397473, 90.249838, 81.397473, 64.090066),\n (183.895427, 118.164611, 197.8102, 118.164611),\n (197.8102, 118.164611, 223.969973, 118.164611),\n (183.895427, 169.909989, 197.8102, 169.909989),\n (183.895427, 169.909989, 183.895427, 118.164611),\n (197.8102, 169.909989, 197.8102, 118.164611),\n (197.8102, 169.839683, 223.969973, 169.839683),\n (223.969973, 169.839683, 223.969973, 118.164611)\n]\nVISIBLE_CIRCLES = [\n (69.77937, 144.0373, 4.499598),\n (163.14603, 144.0373, 4.499598)\n]\nVISIBLE_ARCS = [\n\n]\nHIDDEN_SEGMENTS = [\n (74.279, 104.1646, 74.279, 90.2498),\n (167.6457, 104.1646, 167.6457, 90.2498),\n (65.2798, 90.2498, 65.2798, 104.1646),\n (158.6465, 90.2498, 158.6465, 104.1646),\n (197.8102, 148.5369, 183.8955, 148.5369),\n (197.8102, 139.5377, 183.8955, 139.5377)\n]\n# (orient, text, p1, p2, base) for linear; (orient, text, center, radius, angle) for diameter\nDIMENSIONS = [\n ('horizontal', '100', (169.8955, 169.91), (63.03, 169.91), (116.4627, 158.91)),\n ('vertical', '48.4211', (169.8955, 118.1645), (169.8955, 169.91), (158.8955, 144.0373)),\n ('diameter', '%%c8.4211', (69.7794, 144.0373), 4.4996, 45),\n ('horizontal', '6.3158', (63.03, 144.0373), (69.7794, 144.0373), (66.4047, 155.0373)),\n ('vertical', '24.2106', (69.7794, 118.1645), (69.7794, 144.0373), (58.7794, 131.1009)),\n ('diameter', '%%c8.4211', (163.146, 144.0373), 4.4996, 45),\n ('horizontal', '93.6842', (63.03, 144.0373), (163.146, 144.0373), (113.088, 155.0373)),\n ('vertical', '24.2106', (163.146, 118.1645), (163.146, 144.0373), (152.146, 131.1009)),\n ('horizontal', '65.625', (81.3975, 118.1645), (151.528, 118.1645), (116.4627, 129.1645)),\n ('vertical', '48.3553', (151.528, 118.1645), (151.528, 169.8397), (140.528, 144.0021)),\n ('horizontal', '17.1875', (63.03, 118.1645), (81.3975, 118.1645), (72.2137, 129.1645)),\n ('vertical', '0', (81.3975, 118.1645), (81.3975, 118.1645), (81.3975, 118.1645)),\n ('horizontal', '13.0208', (183.8955, 118.1645), (197.8102, 118.1645), (190.8528, 129.1645)),\n ('horizontal', '24.4792', (197.8102, 118.1645), (223.97, 118.1645), (210.8901, 129.1645))\n]\n\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; _ds.dxf.dimasz = 2.5\n _ds.dxf.dimexe = 1.25; _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\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\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,\n angle=(0 if d[0] == \"horizontal\" else 90),\n 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,\n 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,\n 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,\n text=text, dimstyle=\"EZDXF\").render()\n\n doc.saveas(out_path)\n\n\nif __name__ == \"__main__\":\n out = sys.argv[1] if len(sys.argv) > 1 else \"0092_00921928_gt.dxf\"\n draw(out)\n print(\"wrote\", out)\n```"}], "images": ["images/0092_00921928.png"], "id": "0092_00921928"} {"messages": [{"role": "user", "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 66.32 mm tall. It is extruded to a thickness of 1.04 mm. A cut feature: The part is a circular plate with diameter 1.03 mm. It is extruded to a thickness of -8.85 mm. A cut feature: The part is a circular plate with diameter 1.03 mm. It is extruded to a thickness of -8.85 mm. A cut feature: The part is a circular plate with diameter 1.03 mm. It is extruded to a thickness of -8.85 mm. A cut feature: The part is a circular plate with diameter 1.03 mm. It is extruded to a thickness of -8.85 mm. A cut feature: The part is a circular plate with diameter 1.03 mm. It is extruded to a thickness of -8.85 mm. A cut feature: The part is a circular plate with diameter 1.03 mm. It is extruded to a thickness of -8.85 mm."}, {"role": "assistant", "content": "```python\n#!/usr/bin/env python3\n# -*- coding: utf-8 -*-\n# Ground-truth 2D engineering drawing for part: 0092_00925599\n# Self-contained: reproduces the three-view DXF via ezdxf, NO FreeCAD needed.\n# Coordinates are A4 page millimetres (scale=1.4267165879863868, page=[297.0, 210.0]).\n# visible edges -> solid (layer OUTLINE); hidden edges -> dashed (layer HIDDEN)\n# dimensions -> real movable DIMENSION entities (text = true mm value)\n# Run: python 0092_00925599_gt.py [out.dxf]\nimport sys\nimport ezdxf\nimport math\n\nSCALE = 1.4267165879863868\nPAGE = [297.0, 210.0]\n\nVISIBLE_SEGMENTS = [\n (207.092718, 77.436161, 207.092718, 172.049998),\n (64.421059, 77.436161, 207.092718, 77.436161),\n (207.092718, 172.049998, 64.421059, 172.049998),\n (64.421059, 172.049998, 64.421059, 77.436161),\n (207.092718, 63.436161, 207.092718, 61.949998),\n (207.092718, 61.949998, 64.421059, 61.949998),\n (64.421059, 63.436161, 64.421059, 61.949998),\n (207.092718, 63.436161, 64.421059, 63.436161),\n (221.092718, 77.436161, 222.578881, 77.436161),\n (221.092718, 172.049998, 222.578881, 172.049998),\n (221.092718, 172.049998, 221.092718, 77.436161),\n (222.578881, 172.049998, 222.578881, 77.436161)\n]\nVISIBLE_CIRCLES = [\n (90.436736, 165.119785, 0.73526),\n (98.610633, 165.119785, 0.73526),\n (172.175707, 165.119785, 0.73526),\n (180.349604, 165.119785, 0.73526),\n (94.895225, 167.34903, 0.73526),\n (176.634196, 167.34903, 0.73526)\n]\nVISIBLE_ARCS = [\n\n]\nHIDDEN_SEGMENTS = [\n (91.172, 61.95, 91.172, 63.4362),\n (99.3459, 61.95, 99.3459, 63.4362),\n (172.911, 61.95, 172.911, 63.4362),\n (181.0849, 61.95, 181.0849, 63.4362),\n (95.6305, 61.95, 95.6305, 63.4362),\n (177.3695, 61.95, 177.3695, 63.4362),\n (89.7015, 63.4362, 89.7015, 61.95),\n (97.8754, 63.4362, 97.8754, 61.95),\n (171.4405, 63.4362, 171.4405, 61.95),\n (179.6144, 63.4362, 179.6144, 61.95),\n (94.16, 63.4362, 94.16, 61.95),\n (175.899, 63.4362, 175.899, 61.95),\n (221.0927, 164.3845, 222.5789, 164.3845),\n (221.0927, 165.855, 222.5789, 165.855),\n (221.0927, 166.6138, 222.5789, 166.6138),\n (221.0927, 168.0843, 222.5789, 168.0843)\n]\n# (orient, text, p1, p2, base) for linear; (orient, text, center, radius, angle) for diameter\nDIMENSIONS = [\n ('horizontal', '100', (207.0927, 172.0501), (64.4211, 172.0501), (135.7569, 161.0501)),\n ('vertical', '66.3158', (207.0927, 77.4362), (207.0927, 172.0501), (196.0927, 124.7431)),\n ('diameter', '%%c1.0307', (90.4367, 165.1198), 0.7353, 45),\n ('horizontal', '18.2346', (64.4211, 77.4362), (90.4367, 77.4362), (77.4289, 88.4362)),\n ('vertical', '61.4583', (90.4367, 77.4362), (90.4367, 165.1198), (79.4367, 121.278)),\n ('diameter', '%%c1.0307', (176.6342, 167.349), 0.7353, 45),\n ('horizontal', '78.6513', (64.4211, 77.4362), (176.6342, 77.4362), (120.5276, 88.4362)),\n ('vertical', '63.0208', (176.6342, 77.4362), (176.6342, 167.349), (165.6342, 122.3926)),\n ('diameter', '%%c1.0307', (94.8952, 167.349), 0.7353, 45),\n ('horizontal', '21.3596', (64.4211, 77.4362), (94.8952, 77.4362), (79.6581, 88.4362)),\n ('vertical', '63.0208', (94.8952, 77.4362), (94.8952, 167.349), (83.8952, 122.3926)),\n ('diameter', '%%c1.0307', (98.6106, 165.1198), 0.7353, 45),\n ('horizontal', '23.9638', (64.4211, 77.4362), (98.6106, 77.4362), (81.5159, 88.4362)),\n ('vertical', '61.4583', (98.6106, 77.4362), (98.6106, 165.1198), (87.6106, 121.278)),\n ('diameter', '%%c1.0307', (180.3497, 165.1198), 0.7353, 45),\n ('horizontal', '81.2555', (64.4211, 77.4362), (180.3497, 77.4362), (122.3854, 88.4362)),\n ('vertical', '61.4583', (180.3497, 77.4362), (180.3497, 165.1198), (169.3497, 121.278)),\n ('diameter', '%%c1.0307', (172.1757, 165.1198), 0.7353, 45),\n ('horizontal', '75.5263', (64.4211, 77.4362), (172.1757, 77.4362), (118.2984, 88.4362)),\n ('vertical', '61.4583', (172.1757, 77.4362), (172.1757, 165.1198), (161.1757, 121.278)),\n ('horizontal', '1.0417', (221.0927, 77.4362), (222.579, 77.4362), (221.8359, 88.4362)),\n ('horizontal', '1.0417', (222.579, 165.1198), (209.9465, 165.1198), (216.2627, 154.1198)),\n ('horizontal', '1.0417', (222.579, 167.349), (209.9465, 167.349), (216.2627, 156.349)),\n ('horizontal', '1.0417', (222.579, 167.349), (209.9465, 167.349), (216.2627, 156.349)),\n ('horizontal', '1.0417', (222.579, 165.1198), (209.9465, 165.1198), (216.2627, 154.1198)),\n ('horizontal', '8.8542', (222.579, 165.1198), (209.9465, 165.1198), (216.2627, 154.1198)),\n ('horizontal', '8.8542', (222.579, 165.1198), (209.9465, 165.1198), (216.2627, 154.1198))\n]\n\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; _ds.dxf.dimasz = 2.5\n _ds.dxf.dimexe = 1.25; _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\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\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,\n angle=(0 if d[0] == \"horizontal\" else 90),\n 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,\n 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,\n 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,\n text=text, dimstyle=\"EZDXF\").render()\n\n doc.saveas(out_path)\n\n\nif __name__ == \"__main__\":\n out = sys.argv[1] if len(sys.argv) > 1 else \"0092_00925599_gt.dxf\"\n draw(out)\n print(\"wrote\", out)\n```"}], "images": ["images/0092_00925599.png"], "id": "0092_00925599"} {"messages": [{"role": "user", "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 10.53 mm wide and 100 mm tall, featuring a rectangular cutout 6.32 x 66.32 mm. It is extruded to a thickness of 8.05 mm. A union feature: The part is a rectangular plate 7.02 mm wide and 66.67 mm tall. It is extruded to a thickness of 8.05 mm. A union feature: The part is a rectangular plate 10.53 mm wide and 100 mm tall, featuring a rectangular cutout 6.32 x 66.32 mm. It is extruded to a thickness of -3.45 mm. A cut feature: The part is a circular plate with diameter 6.97 mm. It is extruded to a thickness of -33.33 mm."}, {"role": "assistant", "content": "```python\n#!/usr/bin/env python3\n# -*- coding: utf-8 -*-\n# Ground-truth 2D engineering drawing for part: 0094_00948169\n# Self-contained: reproduces the three-view DXF via ezdxf, NO FreeCAD needed.\n# Coordinates are A4 page millimetres (scale=0.8619278350516022, page=[297.0, 210.0]).\n# visible edges -> solid (layer OUTLINE); hidden edges -> dashed (layer HIDDEN)\n# dimensions -> real movable DIMENSION entities (text = true mm value)\n# Run: python 0094_00948169_gt.py [out.dxf]\nimport sys\nimport ezdxf\nimport math\n\nSCALE = 0.8619278350516022\nPAGE = [297.0, 210.0]\n\nVISIBLE_SEGMENTS = [\n (136.082924, 85.857191, 136.082924, 172.049974),\n (127.009999, 85.857191, 136.082924, 85.857191),\n (136.082924, 172.049974, 127.009999, 172.049974),\n (127.009999, 172.049974, 127.009999, 85.857191),\n (136.082924, 71.857191, 136.082924, 61.949974),\n (136.082924, 61.949974, 127.009999, 61.949974),\n (127.009999, 71.857191, 127.009999, 61.949974),\n (136.082924, 71.857191, 127.009999, 71.857191),\n (159.99014, 85.857191, 150.082924, 85.857191),\n (159.99014, 172.049974, 159.99014, 85.857191),\n (150.082924, 172.049974, 159.99014, 172.049974),\n (150.082924, 172.049974, 150.082924, 85.857191)\n]\nVISIBLE_CIRCLES = [\n (130.9416, 65.4175, 3.003451)\n]\nVISIBLE_ARCS = [\n\n]\nHIDDEN_SEGMENTS = [\n (128.8245, 157.5333, 128.8245, 100.3739),\n (134.2683, 157.5333, 128.8245, 157.5333),\n (134.2683, 100.3739, 134.2683, 157.5333),\n (128.8245, 100.3739, 134.2683, 100.3739),\n (127.9381, 172.05, 127.9381, 143.3191),\n (127.9381, 143.3191, 133.945, 143.3191),\n (133.945, 143.3191, 133.945, 172.05),\n (128.8245, 68.8851, 128.8245, 71.8572),\n (134.2683, 68.8851, 134.2683, 71.8572),\n (134.2683, 68.8851, 128.8245, 68.8851),\n (159.526, 143.3191, 153.5191, 143.3191),\n (153.055, 157.5333, 150.0829, 157.5333),\n (153.055, 100.3739, 150.0829, 100.3739),\n (153.055, 157.5333, 153.055, 100.3739),\n (153.5191, 143.3191, 153.5191, 172.05)\n]\n# (orient, text, p1, p2, base) for linear; (orient, text, center, radius, angle) for diameter\nDIMENSIONS = [\n ('vertical', '66.3158', (128.8245, 100.3739), (128.8245, 157.5333), (117.8245, 128.9536)),\n ('vertical', '33.3333', (128.8245, 85.8572), (128.8245, 100.3739), (117.8245, 93.1155)),\n ('horizontal', '6.3158', (128.496, 100.2227), (134.5447, 100.2227), (131.5203, 111.2227)),\n ('vertical', '66.3158', (134.5447, 100.2227), (134.5447, 157.6845), (123.5447, 128.9536)),\n ('horizontal', '2.1052', (127.01, 85.8572), (128.496, 85.8572), (127.753, 96.8572)),\n ('vertical', '16.8421', (128.496, 85.8572), (128.496, 100.2227), (117.496, 93.04)),\n ('horizontal', '7.0176', (127.01, 85.8572), (136.0829, 85.8572), (131.5464, 96.8572)),\n ('vertical', '66.6666', (136.0829, 85.8572), (136.0829, 172.05), (125.0829, 128.9536)),\n ('vertical', '0', (127.01, 85.8572), (127.01, 85.8572), (127.01, 85.8572)),\n ('vertical', '16.6667', (127.01, 85.8572), (127.01, 85.8572), (127.01, 85.8572)),\n ('horizontal', '10.5263', (128.8245, 100.3739), (134.2682, 100.3739), (131.5464, 111.3739)),\n ('vertical', '100', (128.8245, 100.3739), (128.8245, 157.5333), (117.8245, 128.9536)),\n ('diameter', '%%c6.9691', (130.9416, 65.4175), 3.0034, 45),\n ('vertical', '3.4483', (130.9416, 68.8851), (130.9416, 68.8851), (130.9416, 68.8851))\n]\n\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; _ds.dxf.dimasz = 2.5\n _ds.dxf.dimexe = 1.25; _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\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\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,\n angle=(0 if d[0] == \"horizontal\" else 90),\n 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,\n 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,\n 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,\n text=text, dimstyle=\"EZDXF\").render()\n\n doc.saveas(out_path)\n\n\nif __name__ == \"__main__\":\n out = sys.argv[1] if len(sys.argv) > 1 else \"0094_00948169_gt.dxf\"\n draw(out)\n print(\"wrote\", out)\n```"}], "images": ["images/0094_00948169.png"], "id": "0094_00948169"}