Fix: SVG Depth Ordering for Projections and Material Fills (Fix #7902)#7923
Draft
dipayansardar73-decode wants to merge 1 commit intoIfcOpenShell:v0.8.0from
Draft
Conversation
IfcOpenShell#7902) Two critical fixes for SVG depth ordering in the drawing pipeline: 1. `move_projection_to_bottom` previously reversed the depth order of all background projections by repeatedly inserting at index 0. Replaced with `enumerate` to preserve the proper Z-depth sorting intended by the C++ engine. 2. `generate_material_layers` previously appended cut hatch fills to the absolute end of the SVG group, forcing them to render on top of both projections and cut outlines. Replaced with `el.addprevious(g)` to place the fill properly beneath its respective cut outline.
Member
|
Got the following error when trying Converting this to a 'draft' so it doesn't get pushed to the BleedingEdge build. |
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.
Fixes #7902
This PR addresses two critical Z-depth sorting bugs in the Bonsai drawing pipeline that caused projection lines to disappear behind material fills or background objects.
Changes:
move_projection_to_bottompreviously pushed all projections to absolute index 0 sequentially, which effectively reversed the background-to-foreground sorting order originally established byIfcConvert. By usingenumerate(projections)and inserting ati, the intended depth sorting is perfectly maintained.generate_material_layerspreviously appended the solid grey cut fills to the absolute end of the SVG group. In standard SVG drawing order, this forced fills to render on top of both the projection lines AND the thick foreground cut outlines. The logic now leveragesel.addprevious(g)to strictly insert the material fill intimately beneath its corresponding cut outline group.These changes ensure all deck joists, low walls, and overlapping elements render correctly without losing their visual boundaries to hatch occlusion.