Skip to content

id:361232 svg generation issue - layers, text viewbox, mirrored ARC/ELLIPSE positions#5

Open
NicholasPhillips wants to merge 6 commits into
masterfrom
feature/361232_SvgGenerationIssueLayers
Open

id:361232 svg generation issue - layers, text viewbox, mirrored ARC/ELLIPSE positions#5
NicholasPhillips wants to merge 6 commits into
masterfrom
feature/361232_SvgGenerationIssueLayers

Conversation

@NicholasPhillips
Copy link
Copy Markdown

No description provided.

@NicholasPhillips NicholasPhillips marked this pull request as ready for review May 19, 2026 10:59
Copilot AI review requested due to automatic review settings May 19, 2026 10:59
Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR significantly extends programs/dwg2SVG.c to address layering issues in the generated SVG output. The most substantive change is a new "block clone" mechanism that emits one <defs> <symbol> per (block_handle, effective_layer) combination so AutoCAD's "layer 0 inside a block inherits the INSERT's layer" rule is honoured. Several rendering improvements (ARC/ELLIPSE for mirrored extrusions, full SPLINE support via de Boor / fit-point sampling, MTEXT/ATTRIB bbox estimation, per-block origin shift to keep path coordinates in a precision-safe range) ride along.

Changes:

  • Add BlockCombo table, collect_block_combos*, insert_effective_layer, effective_layer_name, and layer-0 inheritance plumbing; emit per-combo <symbol-{handle}-{eff_layer}> clones, and refactor output_BLOCK_HEADER into INSERT-emit (Pass 2a) + per-layer entity/ATTRIB-emit (Pass 2b) passes.
  • Add output_SPLINE (de Boor evaluation, fit-point fallback), rewrite output_ARC / output_ELLIPSE to handle mirrored extrusions and partial elliptical arcs, and add MTEXT/ATTRIB/TEXT bbox estimation via extents_add_text_bbox / extents_add_rotated_bbox.
  • Introduce current_block_offset_x/y (subtracted by transform_X/Y inside block defs) plus matching R·S·offset compensation in the <use> translate so large-coordinate blocks remain precision-safe; split output_INSERT_attribs out so attached ATTRIBs are emitted by the layer-aware caller rather than inline.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread programs/dwg2SVG.c Outdated
Comment thread programs/dwg2SVG.c Outdated
Comment thread programs/dwg2SVG.c Outdated
Comment thread programs/dwg2SVG.c
Comment thread programs/dwg2SVG.c Outdated
Comment thread programs/dwg2SVG.c Outdated
@NicholasPhillips NicholasPhillips changed the title id:361232 Svg Generation - Issue Layers id:361232 svg generation issue - layers, text viewbox, mirrored ARC/ELLIPSE positions May 22, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants