Skip to main content
Зв'язатися

QSketchMetric: Parametric DXF, Rendered by Code

F
Formamind team

QSketchMetric is our open‑source bridge between parametric CAD and Python. It reads DXF files with variables and expressions, substitutes values, and renders fully parameterized 2D drawings you can reproduce and automate.

Featured image for QSketchMetric: Parametric DXF, Rendered by Code
The promise of parametric design has always been simple: draw the rules once, then let the variables do the work. With QSketchMetric, we bring that promise directly into the Python toolbelt, turning the humble DXF into a flexible, programmable artifact you can regenerate on demand.
QSketchMetric is an open‑source Python library that interprets and renders parametric 2D DXF CAD files. Instead of freezing geometry at a single size, it reads drawings whose entities are defined by mathematical expressions and variables, then produces fully rendered DXF output based on input parameters. The result is a repeatable way to generate exact variants of a design without redrawing them by hand.
The workflow begins in QCAD Professional, where you prepare a parametrized DXF: dimensions, offsets, and relationships are expressed with variables and formulas. QSketchMetric reads that file, substitutes values, evaluates the expressions, and generates the resulting geometry. Under the hood it works directly against the drawing’s definitions, supporting many standard DXF entities, so the output remains a proper DXF you can open, share, and manufacture from.
Because the parameters are the inputs, programmatic control is straightforward. Change a width or radius, iterate a hole count, or tie features together with equations—then render a fresh DXF for each case. The drawing becomes a compact spec that encodes intent as math, and Python becomes the engine that breathes life into it.
This makes common CAD pains—manual resizing, tedious variant creation, inconsistent edits—largely a thing of the past. Design once, and regenerate confidently. Batch out a family of parts with consistent rules. Keep geometry under version control and capture decisions as variables instead of scattered edits. When you need to adapt a design to new constraints, you change inputs, not sketches.
Getting started is as simple as installing the library and pointing it at a parametrized DXF prepared with QCAD Professional. From there, your script provides the parameters, QSketchMetric does the substitution and evaluation, and the output is a clean, fully rendered DXF ready for the next step in your toolchain.
javascript
We built QSketchMetric to let designers and developers meet in the same artifact: a DXF that encodes geometry as expressions, rendered by Python on demand. If your work lives at the intersection of CAD and code, this is a practical way to close the loop between intent and output—precise, reproducible, and ready to automate.