Solid straight PDF strokes, including round contours (#4406)¶
Seven original CC0 pages generated by tools/texture-authoring/pdf-stroke-controls.py
with ReportLab 4.4.3 exercise butt/miter, square/bevel, miter-limit fallback,
combined fill and stroke, affine shear/nonuniform scale, round caps and round
joins. The original PDF
SHA-256 is recorded in oracle.json. The scale of 30 PDF units per model metre
is an explicitly synthetic calibration, not measured building alignment.
Requests preserve actual pinned PDF.js decoded operators. The existing native PDF annotation planner outlines in construction space before applying the full affine transform, composes opaque paint in order, and creates canonical styled IfcAnnotationFillArea geometry. The existing StoreEditor/StepExporter writes the IFC. No Python IFC writer or alternate viewer load path is involved.
pdf-stroke-oracle.py independently renders the original PDF with MuPDF 1.26.5
(antialiasing disabled), compares every pixel centre against native triangle
support/colour, and reads exported IFC with IfcOpenShell 0.8.2. One 8-bit RGB
quantization step is allowed. Boundary differences are reported, not excluded;
the sheared control has 85 differing pixels, within 0.464 pixel of a native
boundary. This raster test does not establish the requested metric tolerance.
Separate analytic areas, including the shear determinant, agree with independent
IFC mesh areas; the native test suite additionally covers reflection, closed
holes, both turn signs, cap extent, near reversals, metric distance after affine
transforms, numerical-precision refusal, miter cutoff, unsupported paint and
collapsed offsets.
Original PDF and exported IFC remain outside git. The committed requests, screenshots and oracle report reproduce the bounded controls. Run from a built checkout with fresh WASM and the named independent reader versions:
python tools/texture-authoring/pdf-stroke-controls.py /tmp/strokes.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/strokes.pdf /tmp/stroke-proof 7 0.0001
python tools/texture-authoring/pdf-stroke-oracle.py /tmp/stroke-proof /tmp/strokes.pdf
The stroke scope deliberately refuses hairlines, curved and zero-containing dash forms, curved strokes, degenerate/reversing segments, offset collapse, and offset-boundary self-contact/intersection. It does not repair a complex stroke arrangement or silently omit unsupported paint. Output is visual filled geometry, not editable centreline stroke semantics or preserved PDF text. Positive dash patterns on open and closed straight subpaths are covered by the open-path evidence and closed-path evidence.