cadrev 0.3.0__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -0,0 +1,8 @@
1
+ .venv/
2
+ __pycache__/
3
+ *.egg-info/
4
+ .pytest_cache/
5
+ build/
6
+ .DS_Store
7
+ .scratch/
8
+ .*.swp
cadrev-0.3.0/LICENSE ADDED
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2026 Vini Rezanejad
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
cadrev-0.3.0/PKG-INFO ADDED
@@ -0,0 +1,135 @@
1
+ Metadata-Version: 2.5
2
+ Name: cadrev
3
+ Version: 0.3.0
4
+ Summary: Reverse-engineer CAD from a paper, with every dimension traceable to a quoted source.
5
+ Project-URL: Repository, https://github.com/Vini-41/cad-reverse-engineer
6
+ License-Expression: MIT
7
+ License-File: LICENSE
8
+ Requires-Python: <3.15,>=3.12
9
+ Requires-Dist: anytree==2.13.0
10
+ Requires-Dist: asttokens==3.0.2
11
+ Requires-Dist: bd-materials==0.2.4
12
+ Requires-Dist: build123d==0.13.0
13
+ Requires-Dist: cadquery-ocp-novtk==8.0.1.1.0
14
+ Requires-Dist: cadquery-ocp-proxy==8.0.1.1.0
15
+ Requires-Dist: certifi==2026.7.22
16
+ Requires-Dist: charset-normalizer==3.5.2
17
+ Requires-Dist: cloudpickle==3.1.2
18
+ Requires-Dist: colorama==0.4.6; sys_platform == 'win32'
19
+ Requires-Dist: contourpy==1.4.0
20
+ Requires-Dist: cycler==0.12.1
21
+ Requires-Dist: dataclasses-json==0.6.7
22
+ Requires-Dist: deprecated==3.0.0
23
+ Requires-Dist: executing==2.3.0
24
+ Requires-Dist: ezdxf==1.4.5
25
+ Requires-Dist: fonttools==4.67.0
26
+ Requires-Dist: idna==3.20
27
+ Requires-Dist: ipython-pygments-lexers==1.1.1
28
+ Requires-Dist: ipython==9.17.1
29
+ Requires-Dist: jedi==0.20.1
30
+ Requires-Dist: joblib==1.6.0
31
+ Requires-Dist: kiwisolver==1.5.1
32
+ Requires-Dist: lib3mf==2.5.0; platform_machine != 'aarch64' or sys_platform != 'linux'
33
+ Requires-Dist: marshmallow==3.26.2
34
+ Requires-Dist: matplotlib-inline==0.2.2
35
+ Requires-Dist: matplotlib==3.11.2
36
+ Requires-Dist: mpmath==1.3.0
37
+ Requires-Dist: mujoco-core==4.0.1
38
+ Requires-Dist: mypy-extensions==1.1.0
39
+ Requires-Dist: narwhals==2.27.1
40
+ Requires-Dist: numpy==2.5.4
41
+ Requires-Dist: ocp-gordon==0.3.1
42
+ Requires-Dist: ocpsvg==0.7.0
43
+ Requires-Dist: packaging==26.3
44
+ Requires-Dist: parso==0.8.7
45
+ Requires-Dist: pexpect==4.9.0; sys_platform != 'emscripten' and sys_platform != 'win32'
46
+ Requires-Dist: pillow==13.0.0
47
+ Requires-Dist: platformdirs==4.13.4
48
+ Requires-Dist: prompt-toolkit==3.0.53
49
+ Requires-Dist: psutil==7.2.2; sys_platform != 'cygwin' and sys_platform != 'emscripten'
50
+ Requires-Dist: ptyprocess==0.7.0; sys_platform != 'emscripten' and sys_platform != 'win32'
51
+ Requires-Dist: pure-eval==0.2.4
52
+ Requires-Dist: py-lib3mf==2.5.0; platform_machine == 'aarch64' and sys_platform == 'linux'
53
+ Requires-Dist: pygltflib==1.16.5
54
+ Requires-Dist: pygments==2.21.0
55
+ Requires-Dist: pyparsing==3.3.3
56
+ Requires-Dist: pypdfium2==5.15.2
57
+ Requires-Dist: python-dateutil==2.9.0.post0
58
+ Requires-Dist: pyyaml==6.0.3
59
+ Requires-Dist: requests==2.34.2
60
+ Requires-Dist: scikit-learn==1.9.1
61
+ Requires-Dist: scipy==1.18.1
62
+ Requires-Dist: six==1.17.0
63
+ Requires-Dist: stack-data==0.6.3
64
+ Requires-Dist: svgelements==1.9.6
65
+ Requires-Dist: svgpathtools==1.8.0
66
+ Requires-Dist: svgwrite==1.4.3
67
+ Requires-Dist: sympy==1.14.0
68
+ Requires-Dist: threadpoolctl==3.7.0
69
+ Requires-Dist: threejs-materials==1.2.5
70
+ Requires-Dist: traitlets==5.16.1
71
+ Requires-Dist: trianglesolver==1.2
72
+ Requires-Dist: typing-extensions==4.16.0
73
+ Requires-Dist: typing-inspect==0.9.0
74
+ Requires-Dist: urllib3==2.8.0
75
+ Requires-Dist: wcwidth==0.9.2
76
+ Requires-Dist: webcolors==24.8.0
77
+ Requires-Dist: wrapt==2.5.1
78
+ Description-Content-Type: text/markdown
79
+
80
+ # cad-reverse-engineer
81
+
82
+ Three skills that turn a paper, patent or datasheet into parametric CAD, with every dimension traced to where it came from. Give your coding agent the documents a device was published in, and it builds:
83
+
84
+ - **CAD you can open and change**: a STEP file per part and one for the assembly, from a parametric build123d model whose every dimension is a named value in `params.yaml`.
85
+ - **A mechanism that moves**: joints, gear ratios and lead screws exported to MuJoCo, with stated motion checked on the model.
86
+ - **A drawing of each part**: three views and an isometric one, dimensioned with the checked values, with screw threads named from the ISO metric or Unified table.
87
+ - **A report of where each dimension came from**: quoted from a document, read off a file the authors released, or proposed because nothing states it, beside the question that would settle it.
88
+ - **A plan to make it**: how each part is made, what to buy and the assembly sequence, which `cadrev check` holds to the model.
89
+
90
+ ## The skills
91
+
92
+ - **`noob`** comes first, for every object. It tells you what the documents state and leave open and what cadrev does not cover, has you confirm what it read off the figures, and asks metric or US, the material, whether to follow the design or the function, and known first or the complete model.
93
+ - **`build-model`** starts from that project and builds the parts the documents settle first. For the complete model it then proposes what they leave open from standard sizes: a thread from the table, a screw in a length you can buy. Under **known first** it stops at the settled parts, with what waits listed as questions.
94
+ - **`ask-machinist`** reviews the model as the person who has to make it, part by part, and writes the plan.
95
+
96
+ *"Reverse-engineer the gripper in this paper"* starts with `noob`, and *"with nothing guessed"* chooses known first. Say "build now" and `noob` answers its questions from the documents. `noob` and `build-model` each end by naming the line to run next: clear the context and run it, and the project's files carry everything across.
97
+
98
+ ## Install
99
+
100
+ Claude Code:
101
+
102
+ ```
103
+ /plugin marketplace add Vini-41/cad-reverse-engineer
104
+ /plugin install cad-reverse-engineer@cad-reverse-engineer
105
+ ```
106
+
107
+ Codex:
108
+
109
+ ```
110
+ codex plugin marketplace add Vini-41/cad-reverse-engineer
111
+ codex plugin add cad-reverse-engineer@cad-reverse-engineer
112
+ ```
113
+
114
+ Codex's default sandbox blocks network access, which the CLI needs to download its dependencies. Allow it in `~/.codex/config.toml`:
115
+
116
+ ```toml
117
+ [sandbox_workspace_write]
118
+ network_access = true
119
+ ```
120
+
121
+ Any agent that reads skills: `npx skills add Vini-41/cad-reverse-engineer --skill '*'`. Install all three, since `noob` and `ask-machinist` read the file formats that `build-model` holds.
122
+
123
+ Built for Fable 5.2, and [benchmarked](https://github.com/Vini-41/cad-reverse-engineer/blob/main/docs/benchmark.md) across Anthropic's and OpenAI's frontier models on the flow before 0.3.0.
124
+
125
+ ## The CLI
126
+
127
+ The skills run the `cadrev` CLI on your machine. It needs [uv](https://docs.astral.sh/uv/), which can install the Python 3.12 to 3.14 it runs on. To run it yourself, with no clone:
128
+
129
+ ```bash
130
+ uvx --python '>=3.12,<3.15' cadrev==0.3.0 check my-project
131
+ ```
132
+
133
+ Its first run downloads the package, build123d, OCC and MuJoCo from PyPI (about a minute), each at an exact version. Under Codex, allow network access as above.
134
+
135
+ Four worked examples you can run, and the rest of the documentation: https://github.com/Vini-41/cad-reverse-engineer. MIT license.
@@ -0,0 +1,56 @@
1
+ # cad-reverse-engineer
2
+
3
+ Three skills that turn a paper, patent or datasheet into parametric CAD, with every dimension traced to where it came from. Give your coding agent the documents a device was published in, and it builds:
4
+
5
+ - **CAD you can open and change**: a STEP file per part and one for the assembly, from a parametric build123d model whose every dimension is a named value in `params.yaml`.
6
+ - **A mechanism that moves**: joints, gear ratios and lead screws exported to MuJoCo, with stated motion checked on the model.
7
+ - **A drawing of each part**: three views and an isometric one, dimensioned with the checked values, with screw threads named from the ISO metric or Unified table.
8
+ - **A report of where each dimension came from**: quoted from a document, read off a file the authors released, or proposed because nothing states it, beside the question that would settle it.
9
+ - **A plan to make it**: how each part is made, what to buy and the assembly sequence, which `cadrev check` holds to the model.
10
+
11
+ ## The skills
12
+
13
+ - **`noob`** comes first, for every object. It tells you what the documents state and leave open and what cadrev does not cover, has you confirm what it read off the figures, and asks metric or US, the material, whether to follow the design or the function, and known first or the complete model.
14
+ - **`build-model`** starts from that project and builds the parts the documents settle first. For the complete model it then proposes what they leave open from standard sizes: a thread from the table, a screw in a length you can buy. Under **known first** it stops at the settled parts, with what waits listed as questions.
15
+ - **`ask-machinist`** reviews the model as the person who has to make it, part by part, and writes the plan.
16
+
17
+ *"Reverse-engineer the gripper in this paper"* starts with `noob`, and *"with nothing guessed"* chooses known first. Say "build now" and `noob` answers its questions from the documents. `noob` and `build-model` each end by naming the line to run next: clear the context and run it, and the project's files carry everything across.
18
+
19
+ ## Install
20
+
21
+ Claude Code:
22
+
23
+ ```
24
+ /plugin marketplace add Vini-41/cad-reverse-engineer
25
+ /plugin install cad-reverse-engineer@cad-reverse-engineer
26
+ ```
27
+
28
+ Codex:
29
+
30
+ ```
31
+ codex plugin marketplace add Vini-41/cad-reverse-engineer
32
+ codex plugin add cad-reverse-engineer@cad-reverse-engineer
33
+ ```
34
+
35
+ Codex's default sandbox blocks network access, which the CLI needs to download its dependencies. Allow it in `~/.codex/config.toml`:
36
+
37
+ ```toml
38
+ [sandbox_workspace_write]
39
+ network_access = true
40
+ ```
41
+
42
+ Any agent that reads skills: `npx skills add Vini-41/cad-reverse-engineer --skill '*'`. Install all three, since `noob` and `ask-machinist` read the file formats that `build-model` holds.
43
+
44
+ Built for Fable 5.2, and [benchmarked](https://github.com/Vini-41/cad-reverse-engineer/blob/main/docs/benchmark.md) across Anthropic's and OpenAI's frontier models on the flow before 0.3.0.
45
+
46
+ ## The CLI
47
+
48
+ The skills run the `cadrev` CLI on your machine. It needs [uv](https://docs.astral.sh/uv/), which can install the Python 3.12 to 3.14 it runs on. To run it yourself, with no clone:
49
+
50
+ ```bash
51
+ uvx --python '>=3.12,<3.15' cadrev==0.3.0 check my-project
52
+ ```
53
+
54
+ Its first run downloads the package, build123d, OCC and MuJoCo from PyPI (about a minute), each at an exact version. Under Codex, allow network access as above.
55
+
56
+ Four worked examples you can run, and the rest of the documentation: https://github.com/Vini-41/cad-reverse-engineer. MIT license.
@@ -0,0 +1,112 @@
1
+ [project]
2
+ name = "cadrev"
3
+ version = "0.3.0"
4
+ description = "Reverse-engineer CAD from a paper, with every dimension traceable to a quoted source."
5
+ readme = "plugin/README.md"
6
+ license = "MIT"
7
+ # One resolution: every Python in this range installs the versions scripts/check runs.
8
+ requires-python = ">=3.12,<3.15"
9
+ dependencies = [
10
+ "build123d==0.13.0",
11
+ "pyyaml==6.0.3",
12
+ # Reads a PDF's text, renders its pages and extracts its images: PDFium, under a permissive
13
+ # license. Quotes are matched against the text it extracts, so a new major is taken on purpose.
14
+ "pypdfium2==5.15.2",
15
+ # The drawings, and the plots a run's own scripts draw (`cadrev python`).
16
+ "matplotlib==3.11.2",
17
+ # MuJoCo's bindings without its viewer: the kinematics motion.py poses a mechanism with.
18
+ "mujoco-core==4.0.1",
19
+ # Imported by name, though build123d and matplotlib bring them in too: distance.py's and
20
+ # motion.py's arrays, a shape check's nearest-sample bound, `cadrev crop` and `figures`.
21
+ "numpy==2.5.4",
22
+ "scipy==1.18.1",
23
+ "pillow==13.0.0",
24
+ # A cut file's SVG: svgelements reads it, ocpsvg turns its contours into wires.
25
+ "ocpsvg==0.7.0",
26
+ "svgelements==1.9.6",
27
+ # What those bring in, OCC among them. uvx reads no lockfile, so these pins are what give
28
+ # every user the versions the checks ran on: the lock's runtime packages, held by a test.
29
+ "anytree==2.13.0",
30
+ "asttokens==3.0.2",
31
+ "bd-materials==0.2.4",
32
+ "cadquery-ocp-novtk==8.0.1.1.0",
33
+ "cadquery-ocp-proxy==8.0.1.1.0",
34
+ "certifi==2026.7.22",
35
+ "charset-normalizer==3.5.2",
36
+ "cloudpickle==3.1.2",
37
+ "colorama==0.4.6 ; sys_platform == 'win32'",
38
+ "contourpy==1.4.0",
39
+ "cycler==0.12.1",
40
+ "dataclasses-json==0.6.7",
41
+ "deprecated==3.0.0",
42
+ "executing==2.3.0",
43
+ "ezdxf==1.4.5",
44
+ "fonttools==4.67.0",
45
+ "idna==3.20",
46
+ "ipython==9.17.1",
47
+ "ipython-pygments-lexers==1.1.1",
48
+ "jedi==0.20.1",
49
+ "joblib==1.6.0",
50
+ "kiwisolver==1.5.1",
51
+ "lib3mf==2.5.0 ; platform_machine != 'aarch64' or sys_platform != 'linux'",
52
+ "marshmallow==3.26.2",
53
+ "matplotlib-inline==0.2.2",
54
+ "mpmath==1.3.0",
55
+ "mypy-extensions==1.1.0",
56
+ "narwhals==2.27.1",
57
+ "ocp-gordon==0.3.1",
58
+ "packaging==26.3",
59
+ "parso==0.8.7",
60
+ "pexpect==4.9.0 ; sys_platform != 'emscripten' and sys_platform != 'win32'",
61
+ "platformdirs==4.13.4",
62
+ "prompt-toolkit==3.0.53",
63
+ "psutil==7.2.2 ; sys_platform != 'cygwin' and sys_platform != 'emscripten'",
64
+ "ptyprocess==0.7.0 ; sys_platform != 'emscripten' and sys_platform != 'win32'",
65
+ "pure-eval==0.2.4",
66
+ "py-lib3mf==2.5.0 ; platform_machine == 'aarch64' and sys_platform == 'linux'",
67
+ "pygltflib==1.16.5",
68
+ "pygments==2.21.0",
69
+ "pyparsing==3.3.3",
70
+ "python-dateutil==2.9.0.post0",
71
+ "requests==2.34.2",
72
+ "scikit-learn==1.9.1",
73
+ "six==1.17.0",
74
+ "stack-data==0.6.3",
75
+ "svgpathtools==1.8.0",
76
+ "svgwrite==1.4.3",
77
+ "sympy==1.14.0",
78
+ "threadpoolctl==3.7.0",
79
+ "threejs-materials==1.2.5",
80
+ "traitlets==5.16.1",
81
+ "trianglesolver==1.2",
82
+ "typing-extensions==4.16.0",
83
+ "typing-inspect==0.9.0",
84
+ "urllib3==2.8.0",
85
+ "wcwidth==0.9.2",
86
+ "webcolors==24.8.0",
87
+ "wrapt==2.5.1",
88
+ ]
89
+
90
+ [project.scripts]
91
+ cadrev = "cadrev.cli:main"
92
+
93
+ [project.urls]
94
+ Repository = "https://github.com/Vini-41/cad-reverse-engineer"
95
+
96
+ [dependency-groups]
97
+ dev = [
98
+ "pyright>=1.1.414",
99
+ "pytest>=8",
100
+ "pytest-xdist>=3",
101
+ "ruff>=0.17.1",
102
+ ]
103
+
104
+ [build-system]
105
+ requires = ["hatchling"]
106
+ build-backend = "hatchling.build"
107
+
108
+ [tool.hatch.build.targets.wheel]
109
+ packages = ["src/cadrev"]
110
+
111
+ [tool.hatch.build.targets.sdist]
112
+ include = ["src", "plugin/README.md"]
@@ -0,0 +1,11 @@
1
+ """cadrev: verifiable CAD reconstruction from papers."""
2
+
3
+
4
+ class Fault(Exception):
5
+ """Why one entry of a project cannot be read or evaluated. Whatever reads the entry catches it
6
+ and files it as a finding under `rule`, or under its own rule where the fault names none. One
7
+ with no message repeats a finding already filed."""
8
+
9
+ def __init__(self, message: str = "", rule: str | None = None):
10
+ super().__init__(message)
11
+ self.message, self.rule = message, rule