Building an offline CAD tool that can also turn photos into 3D meshes
I originally put PolyForge together as a ChatGPT skill, just for OpenSCAD, so I could describe a bracket or an enclosure and get back something I could actually print on my modified Ender 3 V2 or my QALAM Pro 400, instead of hand modeling every mount and shelf myself. It worked fine, but it only worked in ChatGPT, and it needed an agent and an API bill in the loop even for a plain shelf bracket.…
PolyForge is a standalone Python package originally designed as a ChatGPT skill for OpenSCAD, allowing users to describe brackets or enclosures and receive printable files. The tool was rebuilt as a standalone package, functioning independently of any language model or API. PolyForge provides a small library of parametric part templates, including box, wall shelf, corner bracket, cable comb, and standoff mount.
These templates are filled in with text using keyword matching and regex extraction, then rendered using CAD backends like OpenSCAD, FreeCAD, or Blender. All three produce the same geometry for the same template and parameters, and each template is compile tested against the real binaries.
Recently, PolyForge added a fourth capability: offline photogrammetry. The tool can reconstruct a mesh from a folder of overlapping photos of a real object entirely offline, without relying on a cloud API. The pipeline utilizes COLMAP for structure from motion, which also includes a dense reconstruction stage that would typically require a GPU. However, the pipeline runs COLMAP for its CPU-capable sparse reconstruction and then hands the result to OpenMVS, which builds the dense mesh CPU-only by default.
The development process for OpenMVS involved three patches to build it on a rolling release system with a newer OpenCV than the package expected. These patches addressed issues with the data schema, OpenCV template specializations, and a removed constant in the imgproc module. The reconstruction process has its limitations, such as a lack of absolute scale and a non-watertight mesh due to the constraints of photogrammetry.
Despite these limitations, PolyForge stands as a tool capable of generating parts from text across three CAD backends and offline photogrammetry, without a cloud API or GPU. The code for PolyForge is publicly available on GitHub.
Written by urgent.news from Dev.to's reporting — not their text. Machine-written — may contain errors; check the original before relying on it.