Why is a drawing looking correct insufficient?
A browser viewer can draw recognizable lines yet report the wrong distance because of incorrect units or incomplete transforms. A part scaled by a factor of two may still fill the same window after automatic zoom-to-fit, hiding the error from the reviewer. Evaluate visual resemblance, geometric correctness and supported file scope separately. Opening a file establishes a parsing and display result; it does not explain which coordinates a measurement tool uses or whether every relevant entity has been interpreted.
Suppose a supplier review uses the distance between two holes in a bracket. Establish whether the result comes from original geometry, displayed dimension text or two points selected on the screen. Those routes have different failure modes. The calculations here are simplified two-dimensional examples, not a statement that CadFlux supports every file type, entity or numerical accuracy target. Its research-stage scope needs separate confirmation against the actual drawings and review tasks a team intends to use.
Does one drawing unit really mean one millimeter?
The coordinate value 100 does not intrinsically carry a physical unit. Consider file metadata, referenced content and the authoring team's conventions together. Autodesk's DXF header reference lists unit codes in $INSUNITS, but the field alone does not prove that every entity has the correct physical scale in every circumstance. Expose unresolved assumptions for unitless or contradictory files. Fitting a drawing into a window, changing zoom and applying a print scale are also different operations from converting model units.
Dimension text deserves separate scrutiny: an annotation can be overridden, scaled by a style or rounded for presentation. Seeing '100' on screen does not necessarily mean the associated endpoints are exactly 100 model units apart. A review tool may need to expose geometric distance, annotation text and interpreted unit separately. Once a unit conversion is agreed, record where it is applied so reopening a file or inserting a block cannot accidentally apply the same conversion again.
Section references: Autodesk — DXF HEADER reference ↗
Why do nested blocks make measurements difficult?
A block has local coordinates and can be scaled, rotated and translated when inserted. Nested blocks compose transforms in an established order; exchanging translation and rotation changes the result. Autodesk's INSERT reference describes axis scales and rotation fields. In a simplified two-dimensional column-vector convention, a world point can be written as T × R × S × p_local. That expression depends on the stated convention. A codebase using row vectors or different matrix layout must explicitly define its own order rather than copying a formula without its assumptions.
Negative scale can mirror geometry, while different axis scales can turn a circle into an ellipse. Multiplying a local arc length by one scale factor is then not a general solution. Block base points, external-reference transforms and entity coordinate systems need to be addressed within the supported file scope. Silently ignoring an unsupported transform while presenting a plausible picture is a poor measurement contract. Explain why a result is unavailable or cannot be trusted for that entity instead of manufacturing a precise-looking number.
Section references: Autodesk — DXF INSERT reference ↗
How can an inch-to-millimeter transform be verified?
Choose a fully specified example: local coordinates in inches, world coordinates in millimeters, a scale of 25.4, rotation of 30 degrees and translation of (1000, 500) mm. Local point (2, 1) maps to approximately (1031.294090512, 547.397045256) mm. The local segment from (0, 0) to (3, 0) becomes 76.2 mm long. Rotation and translation preserve length; in this example only the uniform unit scale changes it. These known results provide direct numerical checks rather than requiring a reviewer to infer correctness from an image.
The Node.js example checks both point position and length. Its 1e-9 tolerance is an arithmetic check for a small constructed example, not a production measurement specification or a physical manufacturing tolerance. Set real acceptance bounds using file precision, coordinate magnitude and intended use. Add inverse-transform, nested-block and mirrored variants as separate fixtures. This is not a DXF parser: it isolates assumptions in the geometry layer so they can be tested independently from file parsing and browser rendering.
const assert = require('node:assert/strict');
const angle = Math.PI / 6;
const scale = 25.4;
function toWorld([x, y]) {
return [
1000 + scale * (x * Math.cos(angle) - y * Math.sin(angle)),
500 + scale * (x * Math.sin(angle) + y * Math.cos(angle))
];
}
const p = toWorld([2, 1]);
assert(Math.abs(p[0] - 1031.2940905122496) < 1e-9);
assert(Math.abs(p[1] - 547.3970452561248) < 1e-9);
const start = toWorld([0, 0]);
const end = toWorld([3, 0]);
const length = Math.hypot(end[0] - start[0], end[1] - start[1]);
assert(Math.abs(length - 76.2) < 1e-9);
// Subtract the origin BEFORE converting to float32.
const origin = 1_000_000_000;
const x = origin + 10;
const wrong = Math.fround(x) - Math.fround(origin);
const local = Math.fround(x - origin);
assert.equal(wrong, 0);
assert.equal(local, 10);
console.log({ point: p, length, wrong, local });Can screen pixels provide precise measurements?
Assume a 12,000 mm-wide model region occupies 1,200 CSS pixels. One horizontal CSS pixel then corresponds to approximately 10 mm. At device pixel ratio two, more physical pixels are drawn, but pointer coordinates in CSS space do not automatically become twice as accurate geometrically. A sharper image can still select the wrong model point. Zoom changes the mapping, and the same object occupies different numbers of pixels across devices. This makes screenshot or cursor-distance measurement a different operation from querying model geometry.
A measurement tool should map a screen candidate back through the view transform and apply defined snapping rules to supported geometry, such as endpoints, centers or intersections. Showing the selected entity and snap type lets the user check what was measured. A large pixel-only tolerance can select a nearby but unintended object. Touch target enlargement, magnification and explicit selection confirmation can improve interaction, but none substitutes for the geometry calculation or establishes that the intended feature was selected.
How can large coordinates erase small details?
JavaScript numbers and the representation passed into a rendering path may have different precision. In the example, independently rounding 1,000,000,000 and 1,000,000,010 to float32 makes their difference zero. Subtracting the shared origin first and then converting the remaining 10 preserves the detail in this case. The final assertions demonstrate the result directly. MDN documents Math.fround's rounding to a 32-bit representation. This illustrates one numerical failure mode; it does not claim that all browser graphics implementations use an identical internal path.
Separate retained model data from local coordinates prepared for rendering where appropriate. Keep global coordinates in a suitable calculation representation and render relative to a nearby origin. Selection, labels and references must follow that same origin change. Reduced visual jitter does not establish correct measurement. Known model distances should remain invariant across origins and zoom levels. Also define an absolute bound for near-zero lengths, where relative error alone becomes an unsuitable acceptance metric. Treat precision as a budget across parsing, transforms, calculation and presentation.
Section references: MDN — Math.fround ↗
Which geometry classes need separate verification?
Correct line-segment measurement does not establish correctness for arcs, curves, dimensions or nested blocks. Define support and expected outcomes per entity class. The tessellation used to display a curve may not provide the accuracy required to measure its length, and merely adding visual segments is not a general measurement algorithm. Area tools need explicit handling of closure, holes and self-intersecting boundaries. Unsupported or ambiguous geometry should produce a clear limitation rather than a number that looks authoritative because it has many decimal places.
An almost singular transform can make inverse mapping unstable or undefined, which selection logic must handle. Mirroring can change orientation and signed area. If units and geometry are transformed in different layers, retain a test of the composed result rather than testing only each layer in isolation. The matrix below is an example acceptance inventory, not a statement that every viewer or CadFlux supports all listed entities. Its purpose is to make supported scope and unavailable behavior explicit.
| Case | Check | Expected behavior |
|---|---|---|
| Uniform scale and rotation | Known endpoints and length | Example length 76.2 mm |
| Nested block | Composed transform order | Match an independent reference |
| Ambiguous units | Metadata and user assumption | Expose the unresolved assumption |
| Unsupported curve | Entity type | Explicit limitation rather than silent approximation |
What should be tested beyond screenshots?
Prepare small fixtures with analytically known results. Isolate units, base points, rotation, mirroring, nesting and large coordinates. Store expected entity identities, endpoints and lengths in machine-comparable form. Add representative real files afterward, but avoid making the output of an unverified application the sole definition of correctness. Record how each reference value was obtained. This keeps the test corpus useful when an imported file looks plausible yet exercises a numerical path that screenshots cannot evaluate.
Repeat the interactions at several zoom levels and screen sizes: model length should stay constant while presentation changes. Add interface checks for selection, keyboard use and unsupported-entity notices. Opening performance is another dimension; record file size, entity count, parsing time and rendering time separately. A viewer that opens quickly by dropping unsupported entities has changed scope. Its speed result should not be presented as a like-for-like success without identifying the omitted geometry and its impact on the intended review task.
- Measurement is based on geometry, not assumed from screen pixels or annotation text.
- Unit assumptions, transform scope and unsupported entities remain visible.
- A known length stays invariant across zoom levels and screen sizes.
How should a CadFlux evaluation be prepared?
CadFlux is positioned as open-source research into browser-based CAD viewing and editing tooling. This article does not verify all DWG/DXF versions, full AutoCAD equivalence or production measurement accuracy. Prepare shareable sample drawings, required entity classes, unit conventions, known reference dimensions and target devices. This turns a general file-opening demonstration into a review of whether the available functions are adequate for a defined engineering task, with explicit gaps where additional implementation or validation is needed.
Industrial software engineering is relevant when drawing review must connect to work orders, document revisions or approvals. Visual Data Core is a separate research product for operational visualization, not an assumed CAD measurement engine. A useful pilot tests geometry, user interaction and the surrounding workflow on a bounded set of drawings and tasks. Its report should distinguish demonstrable existing product scope from required development and validation, rather than allowing a successful visual demonstration to imply every numerical or integration requirement has been satisfied.
Technical references
Want to apply this approach to your system?
Discuss your technical requirements →