Skip to content

Qualified curved PDF fills (#4406)

These are three original CC0 control pages generated by tools/texture-authoring/pdf-curved-fill-controls.py using ReportLab 4.4.3. Source PDF SHA-256: 5791eb490f70e1e55f9a62febe52bf322500384f072a79f821884b67f6b5e670. The pages contain an ellipse, an elliptical hole, and a sheared/nonuniformly scaled ellipse. Calibration is an explicitly declared synthetic control scale of 30 PDF units per model metre; it is not a measured building scale.

The committed requests come from the pinned PDF.js decoder. Native subdivision uses a declared 0.02 m tolerance (0.0025 m reserved for flattening), unchanged shared work/transport limits, canonical IFC fill authoring and mesh production. The finer 0.01 m request for the hole refused the shared work limit; the planner did not silently coarsen it. These are bounded controls, not proof that arbitrary curved building plans fit the current budget.

pdf-curved-fill-oracle.py independently reads original cubic paths through MuPDF, samples them using a separate uniform-subdivision implementation with a second-derivative error bound, and compares them with boundaries read from the exported IFC. It also compares filled support at every control pixel centre. The source curves and native vertices meet the declared tolerance in these checks. Pages ½ have identical sampled support. Page 3 has 14 differing pixel centres, all within about 1.33 mm of the independent source boundary. This is reported approximation, not a claim of exact source-pixel identity. Source RGB and decoded/native RGB differ by at most one 8-bit quantization step.

IfcOpenShell 0.8.2 independently reopens actual StoreEditor/StepExporter output, checks annotation Name, containment, fill styles and hole count, and produces matching triangle counts. Original PDF/IFC artifacts remain outside git; small screenshots, decoded requests and oracle results are committed. The PNG source uses normal MuPDF antialiasing; the support image shows native triangle coverage.

Reproduce from a built checkout with fresh WASM, ReportLab 4.4.3, PyMuPDF 1.26.5, IfcOpenShell 0.8.2, NumPy and Pillow:

python tools/texture-authoring/pdf-curved-fill-controls.py /tmp/pdf-curves.pdf
TSX_TSCONFIG_PATH=apps/viewer/tsconfig.json node --import tsx --import ./apps/viewer/src/test/vite-module-hooks.mjs tools/texture-authoring/pdf-fill-evidence.mjs /tmp/pdf-curves.pdf /tmp/pdf-curves-proof 3 0.02
python tools/texture-authoring/pdf-curved-fill-oracle.py /tmp/pdf-curves-proof /tmp/pdf-curves.pdf

Qualification is deliberately sufficient, not exhaustive. Each Bezier piece must have a convex (or exactly monotone collinear) control polygon. Distinct piece hulls must be provably separated, with explicit shared endpoint/chord cases. Other rings, paint boundaries and the CropBox must remain outside the flattening error envelope. Unresolved hull overlap, crossings, contacts or precision refuse the entire page. No points are snapped to make the qualification pass.

Final validation passed the full native workspace and strict all-target clippy, root typecheck/build, fresh WASM contracts (with their existing optional skips), and an independently installed PyO3 wheel against all four committed quick-lane parity references. The existing halfspace density advisory remains. Raw native load samples and identical mesh fingerprints are in native-load.json; they do not measure curved-page throughput or establish zero overhead.

After integrating main ae8533851 (including full-target transfer capacity), combined source 3c4f8c738 passed 21 PDF and 10 transfer native tests, a freshly built WASM contract run (88 passed, three existing optional skips), and all five straight/curved PDF export and independent-reader controls. IFC DATA sections remain byte-identical to the prior runs; only export timestamps differ. combined-validation.json records the exact source and resulting export hashes.