Roadmap 0.9, Fixes

FX.157 CadCraft: objects moved against each other while zooming in a drawing at distant coordinates (a stray object near 0,0 made hatches slide off their outlines)

  • Fix
  • Built · Live
  • CadCraft

A member sent a screen recording: a hatch and its outline drifted apart as they zoomed, in a drawing near E 830000 / N 4480000. They guessed a 32-bit float problem, and it is one. A canvas Path2D keeps its points as 32-bit floats and the matrix that draws them is 32-bit too. CadCraft stores paths relative to an origin, but the origin was the middle of the whole drawing's extents: with one object left near 0,0 it sat 2.3 million units from the geometry on screen, so zoomed in the digits were gone. Measured in the released 0.9 build (new tools/cadcraft-test/browser-far-coords.mjs, the real view.js in Chromium): a hatch edge 1 px off at 20 px per unit, 22 px at 200, 94 px at 1000, fill gone at 2000; without the stray object, or with one 20 km away, exact. Only the picture was wrong; coordinates, snaps, measurements and saved files are 64-bit. Fix (view.js): the cache is rebuilt around the view center once the origin is more than 160,000 px from it (FAR_PX), also for the model shown in a sheet viewport; ordinary drawings never rebuild. The test fails on 0.9 (99 px) and passes in the lab (0 px at every zoom); bin/test-cadcraft.mjs 2847 passed. /accuracy had the old origin down as keeping values small: now a 32-bit policy, Drawing far from the origin, on screen, with the measurements and an open item to test BimCraft dwg-view.js, TakeoffCraft cadset.js and CivilCraft view.js (same pattern). Installed 0.9.0 desktop builds carry their own view.js and need 0.9.1.

Waits on: The reporter to try it in /lab (send the file or a lab pass); the 0.9.1 build; the other three apps tested for the same pattern.

From: Discord community

Add a comment

Community comments

No comments yet

Add detail as we go: how you would use it, files or steps that show the problem, what other programs do. The team reads every comment.

Sign in or create a free account to add a comment.