id:361232 svg generation issue - layers, text viewbox, mirrored ARC/ELLIPSE positions#5
Open
NicholasPhillips wants to merge 6 commits into
Open
id:361232 svg generation issue - layers, text viewbox, mirrored ARC/ELLIPSE positions#5NicholasPhillips wants to merge 6 commits into
NicholasPhillips wants to merge 6 commits into
Conversation
There was a problem hiding this comment.
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
BlockCombotable,collect_block_combos*,insert_effective_layer,effective_layer_name, and layer-0 inheritance plumbing; emit per-combo<symbol-{handle}-{eff_layer}>clones, and refactoroutput_BLOCK_HEADERinto INSERT-emit (Pass 2a) + per-layer entity/ATTRIB-emit (Pass 2b) passes. - Add
output_SPLINE(de Boor evaluation, fit-point fallback), rewriteoutput_ARC/output_ELLIPSEto handle mirrored extrusions and partial elliptical arcs, and add MTEXT/ATTRIB/TEXT bbox estimation viaextents_add_text_bbox/extents_add_rotated_bbox. - Introduce
current_block_offset_x/y(subtracted bytransform_X/Yinside block defs) plus matchingR·S·offsetcompensation in the<use>translate so large-coordinate blocks remain precision-safe; splitoutput_INSERT_attribsout 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.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
No description provided.