Repository navigation
Viewpoint XML: write an enabled section box only as section_box - #133
Merged
Merged
Conversation
Its six planes were also written to clip_planes, where the reader takes every entry as a section plane, so each save and load added six more planes with indices 0..5 next to the restored box. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
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 #59
NwcXmlViewpointSerializer.Serializewrote an enabled section box twice: its six planes into<clip_planes>and the box itself as<section_box>. The reader takes every<clip_plane>as a section plane and also restores the box, so each round trip added six more planes with indices 0..5.<clip_planes>now holds onlyvp.SectionPlanes, and the box is written only as<section_box>, the first option in the issue.Deserializeis unchanged. Two consequences worth knowing:<clip_planes>at all.<clip_planes>, so reading it once still gives six extra planes. They stop multiplying after the next save.I didn't add a marker for the box planes, because nothing in the repo reads them back from
<clip_planes>: the IFC, BCF and clipper paths callSectionBox.ToSectionPlanes()themselves.Test:
Serialize_SectionBoxAndPlane_RoundTripsUnchanged(XmlViewpointSerializerTests) round-trips a viewpoint with an enabled box and oneCreateTopplane at index 7 three times. Each time it checks that there is still one plane with the same index, normal, distance and alignment, and the same enabled box. Without the change there are 7 planes after the first round trip.dotnet build NwcIO.slnxsucceeds, andNwcIO.Testspasses locally: 228 passed, and 2 skipped because they need private Navisworks files (.NET 10.0.400 on Windows, withglobal.jsonpinned down to it temporarily; not committed).🤖 Generated with Claude Code