Repository navigation
fix(geometry): Triangle3D.Reverse reverses the stored vertex order (Q4) - #228
Merged
Merged
Conversation
Triangle3D.Reverse() called points.Reverse() on its Point3D[]. With System.Linq in scope that binds to Enumerable.Reverse, whose result was discarded, so the method never changed anything. Its two callers, Query.Volume(Shell) and Create.Mesh3D(Shell), rely on it to correct triangle winding against the parent face normal, so both silently kept whatever winding the triangulation produced. Use Array.Reverse(points) so the stored order is reversed in place. Signature, JSON schema, coordinates, tolerances, area filters and shell-normal conventions are unchanged. Adds Triangle3DReverseTests (132 cases): reversal contract (order, normal, signed volume, double reversal, area, centroid, bounds, segments, clone, JSON, Triangle3DObject) and both callers on analytically known closed solids with mixed face winding, translations and rotations. Generated by Michal Dengusiak and CodeClaude Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
…ted content d7a00b6) Generated by Michal Dengusiak and CodeClaude Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
…ix is unchanged (review) Generated by Michal Dengusiak and CodeClaude Co-Authored-By: Claude Sonnet 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.
Summary
Triangle3D.Reverse()calledpoints.Reverse()on aPoint3D[], which binds to LINQEnumerable.Reverseand discards its result: a no-op.Query.Volume(Shell)andCreate.Mesh3D(Shell)rely on it to correct triangle winding, so neither did. Fix:Array.Reverse(points)(one line). No signature, JSON schema, coordinate, tolerance, area-filter or shell-normal change.Evidence (record:
documentation/Triangle3D-Reverse-Q4.md)d7a00b6c(fix + tests); the later commit is docs/evidence only. Base9d8961ec(sow/2026-Q4).Triangle3DReverseTests(132 cases): red on unchanged source 76 fail / 56 pass; green 132/132. The Box and triangular-prism volume rows pass on old source (consistently wound triangulation) and stay as compatibility guards.Shell.VolumeandMesh3D(Shell); none in sibling repositories.SAM.Tests3975/3975;SAM.Core.Grasshopper.Tests87/87 (local, not hosted CI). No existing expectation or golden changed.31.23669/36.178925; fixed build gives31.242936/36.17268, within 1e-5 m3 of the independent volume. Only those two cells change. This fully explains the saved ±0.006 m3 defect; no remaining mechanism found.Limits and recommendations
Triangle2D.Reverse()has the same no-op, no callers, left alone.Transform3D.GetRotation(axis, angle)is non-orthonormal (existing, unrelated). 7 open-shell cells return NaN in every build (unchanged).SAM.Geometry.dllredeploy; SAM_OCCT#84 pins are a separate decision.PROJECT_PROGRESS.mduntouched (post-merge closeout only).Generated by Michal Dengusiak and CodeClaude
🤖 Generated with Claude Code