Skip to content

Next Gen STEP AP242 Native-ish BREP Geometric Modeling Kernel

Add authoritative seam and junction network reconstruction

Yuechen Lie89370948a89
diff --git a/.gitignore b/.gitignore
index 258ba750..5da3af0b 100644
--- a/.gitignore
+++ b/.gitignore
@@ -48,6 +48,16 @@ docs/preview2/evidence/**/*.json
docs/reports/artifacts/**/*.json
Aetheris.Firmament.FrictionLab/Reports/*.json
+# Bunny M1 heavyweight evidence is reproducible via tools/Aetheris.BunnyM1 and remains local.
+# Keep the manifest, validation/quality summaries, and compact reports eligible for source control.
+docs/geometry/artifacts/bunny-m1/*.obj
+docs/geometry/artifacts/bunny-m1/surface-mesh-document.json
+docs/geometry/artifacts/bunny-m1/seam-network.json
+docs/geometry/artifacts/bunny-m1/seam-fit-candidates.json
+docs/geometry/artifacts/bunny-m1/judgment-traces.json
+docs/geometry/artifacts/bunny-m1/m0-seam-failure-audit.json
+docs/geometry/artifacts/bunny-m1/junction-network.json
+
# Package-manager caches are local even when a new JS workspace is added without a nested ignore file.
.tspack/
diff --git a/Aetheris.Kernel.Core/Brep/Tessellation/SurfaceMeshIr.cs b/Aetheris.Kernel.Core/Brep/Tessellation/SurfaceMeshIr.cs
index 1521bd74..1addd3c1 100644
--- a/Aetheris.Kernel.Core/Brep/Tessellation/SurfaceMeshIr.cs
+++ b/Aetheris.Kernel.Core/Brep/Tessellation/SurfaceMeshIr.cs
@@ -1798,7 +1798,8 @@ public static class SurfaceMeshIrValidator
{
public static bool TryValidate(SurfaceMeshDocument document, out string? failure)
{
- var vertices = document.Vertices.Select(v => v.Id).ToHashSet();
+ var vertexById = document.Vertices.ToDictionary(v => v.Id);
+ var vertices = vertexById.Keys.ToHashSet();
if (vertices.Count != document.Vertices.Count) { failure = "SurfaceMeshIR vertex IDs are not unique."; return false; }
foreach (var boundary in document.SharedBoundaries)
{
@@ -1810,7 +1811,7 @@ public static class SurfaceMeshIrValidator
{
if (cell.VertexIds.Count < 3 || cell.VertexIds.Any(id => !vertices.Contains(id))) { failure = "A cell references an invalid or insufficient vertex set."; return false; }
if (cell.VertexIds.Distinct().Count() != cell.VertexIds.Count) { failure = "A cell repeats a vertex."; return false; }
- var points = cell.VertexIds.Select(id => document.Vertices.Single(v => v.Id == id).Position).ToArray();
+ var points = cell.VertexIds.Select(id => vertexById[id].Position).ToArray();
if (PolygonAreaMagnitude(points) <= 1e-14d) { failure = "A cell has zero area."; return false; }
}
if (document.Patches.Any(patch => patch.TrimLoopData is { Count: > 1 } && patch.Cells.Count == 0)) { failure = "A trimmed patch has no covering cells."; return false; }
diff --git a/Aetheris.Reconstruction.Tests/ReconstructionTests.cs b/Aetheris.Reconstruction.Tests/ReconstructionTests.cs
index 16ef5260..d88b744d 100644
--- a/Aetheris.Reconstruction.Tests/ReconstructionTests.cs
+++ b/Aetheris.Reconstruction.Tests/ReconstructionTests.cs
@@ -1,4 +1,5 @@
using System.Text;
+using Aetheris.Kernel.Core.Brep.Tessellation;
using Aetheris.Kernel.Core.Math;
using Xunit;
@@ -53,6 +54,69 @@ end_header
static StructuredSurfaceMesh Run(TriangleSurfaceMesh m) { var (f, _) = StructuredSurfaceRecovery.EstimateField(m); return PanelSurfaceMeshLowering.Lower(StructuredSurfaceRecovery.BuildCharts(m, f, 1, 2), 4); }
}
+ [Fact]
+ public void Two_chart_fixture_has_one_internal_seam_authority_with_opposite_side_orientation()
+ {
+ var mesh = Square();
+ var network = RecoveredSeamNetworkBuilder.Build(mesh, ["chart-a", "chart-b"]);
+ var seam = Assert.Single(network.Seams, item => item.Classification == RecoveredSeamClassification.Internal);
+
+ Assert.Equal("chart-a", seam.ChartA);
+ Assert.Equal("chart-b", seam.ChartB);
+ Assert.Equal(RecoveredSeamOrientation.SameDirection, seam.LeftOrientation);
+ Assert.Equal(RecoveredSeamOrientation.ReversedDirection, seam.RightOrientation);
+ Assert.Equal(0, seam.G0Residual);
+ Assert.Equal(0, seam.ParameterStart);
+ Assert.Equal(1, seam.ParameterEnd);
+ Assert.Equal(2, network.Junctions.Count);
+ Assert.All(network.Junctions, junction => Assert.Contains(seam.StableId, junction.IncidentSeamIds));
+ }
+
+ [Fact]
+ public void Source_open_boundary_is_retained_and_is_not_an_internal_crack()
+ {
+ var mesh = Square(); var (field, _) = StructuredSurfaceRecovery.EstimateField(mesh);
+ var charts = StructuredSurfaceRecovery.BuildCharts(mesh, field, spatialBins: 1, minimumFaces: 1);
+ var canonical = SeamAuthoritativeSurfaceMeshLowering.Lower(mesh, charts);
+
+ Assert.Equal(0, canonical.InternalCrackGroups);
+ Assert.Equal(1, canonical.IntentionalOpenBoundaryLoops);
+ Assert.Equal(4, canonical.BoundaryEdgeCount);
+ Assert.Equal(0, canonical.NonManifoldEdgeCount);
+ Assert.Equal(1, canonical.QuadCount);
+ Assert.Equal(0, canonical.TriangleCount);
+ Assert.Equal("Pass", canonical.ValidationStatus);
+ Assert.True(SurfaceMeshIrValidator.TryValidate(canonical.Document, out _));
+ Assert.All(charts.Seams, seam => Assert.Equal(RecoveredSeamClassification.SourceOpenBoundary, seam.Classification));
+ }
+
+ [Fact]
+ public void Seam_judgment_rejects_line_when_bounded_residual_is_exceeded_and_is_stable()
+ {
+ var vertices = new Point3D[]
+ {
+ new(0,0,0), new(1,0,0), new(2,0,0),
+ new(0,1,0), new(1,1,.2), new(2,1,0),
+ new(0,2,0), new(1,2,0), new(2,2,0)
+ };
+ var triangles = new Triangle[]
+ {
+ new(0,1,4), new(0,4,3), new(3,4,7), new(3,7,6),
+ new(1,2,5), new(1,5,4), new(4,5,8), new(4,8,7)
+ };
+ var mesh = new TriangleSurfaceMesh(vertices, triangles, null, "bent-two-chart", "fixture", new Dictionary<string,string>());
+ var labels = new[] { "left", "left", "left", "left", "right", "right", "right", "right" };
+ var first = RecoveredSeamNetworkBuilder.Build(mesh, labels);
+ var second = RecoveredSeamNetworkBuilder.Build(mesh, labels);
+ var seam = Assert.Single(first.Seams, item => item.Classification == RecoveredSeamClassification.Internal);
+
+ Assert.Equal(RecoveredSeamRepresentation.NonRationalBSpline, seam.RepresentationKind);
+ Assert.Equal("NonRationalBSpline", seam.JudgmentWinner);
+ Assert.False(seam.JudgmentCandidates.Single(candidate => candidate.Representation == "Line").Admissible);
+ Assert.Equal(seam.StableId, second.Seams.Single(item => item.Classification == RecoveredSeamClassification.Internal).StableId);
+ Assert.Equal(seam.JudgmentWinner, second.Seams.Single(item => item.StableId == seam.StableId).JudgmentWinner);
+ }
+
private static TriangleSurfaceMesh Square() => new([new(0, 0, 0), new(1, 0, 0), new(1, 1, 0), new(0, 1, 0)], [new(0, 1, 2), new(0, 2, 3)], null, "square", "fixture", new Dictionary<string, string>());
private static TriangleSurfaceMesh Grid(int n)
{
diff --git a/Aetheris.Reconstruction/SeamAuthoritativeRecovery.cs b/Aetheris.Reconstruction/SeamAuthoritativeRecovery.cs
new file mode 100644
index 00000000..49f1bcd8
--- /dev/null
+++ b/Aetheris.Reconstruction/SeamAuthoritativeRecovery.cs
@@ -0,0 +1,424 @@
+using System.Security.Cryptography;
+using System.Text;
+using System.Text.Json.Serialization;
+using Aetheris.Geometry;
+using Aetheris.Kernel.Core.Brep.Tessellation;
+using Aetheris.Kernel.Core.Geometry;
+using Aetheris.Kernel.Core.Geometry.Curves;
+using Aetheris.Kernel.Core.Geometry.Surfaces;
+using Aetheris.Kernel.Core.Judgment;
+using Aetheris.Kernel.Core.Math;
+using Aetheris.Kernel.Core.Topology;
+
+namespace Aetheris.Reconstruction;
+
+public enum RecoveredSeamClassification { Internal, SourceOpenBoundary }
+public enum RecoveredSeamOrientation { SameDirection, ReversedDirection }
+public enum RecoveredSeamRepresentation { Line, NonRationalBSpline }
+
+public sealed record SeamFitCandidateEvidence(
+ string Representation,
+ bool Admissible,
+ double PositionResidual,
+ double ComplexityPenalty,
+ double Utility,
+ string Reason);
+
+/// <summary>
+/// One pre-panel geometric authority for a connected chart-boundary trace. The source mesh
+/// supplies ordered geometric evidence, but both chart sides reference this single recovered
+/// curve, parameter domain, orientation contract, and sample identity.
+/// </summary>
+public sealed record RecoveredSeam(
+ string StableId,
+ string ChartA,
+ string? ChartB,
+ RecoveredSeamClassification Classification,
+ IReadOnlyList<int> SourceVertexIndices,
+ IReadOnlyList<(int A, int B)> SourceEdges,
+ IReadOnlyList<int> SourceTriangleProvenance,
+ IReadOnlyList<Point3D> SourceBoundarySamples,
+ RecoveredSeamRepresentation RepresentationKind,
+ RecoveredSeamOrientation LeftOrientation,
+ RecoveredSeamOrientation? RightOrientation,
+ double ParameterStart,
+ double ParameterEnd,
+ bool IsClosed,
+ double FitResidual,
+ double NormalEvidenceDegrees,
+ IReadOnlyList<SeamFitCandidateEvidence> JudgmentCandidates,
+ string JudgmentWinner,
+ string Authority,
+ [property: JsonIgnore] BoundedParametricCurve3 Curve)
+{
+ public int SourceEdgeCount => SourceEdges.Count;
+ public double G0Residual => 0d;
+}
+
+public sealed record RecoveredJunction(
+ string StableId,
+ int SourceVertexIndex,
+ Point3D Point,
+ IReadOnlyList<string> IncidentSeamIds,
+ double SourceResidual,
+ double IncidentTangentSpreadDegrees,
+ string Authority);
+
+public sealed record SourceBoundaryLoopCorrespondence(
+ string StableId,
+ IReadOnlyList<int> SourceVertexIndices,
+ IReadOnlyList<string> RecoveredSeamIds,
+ bool IntentionallyOpen,
+ string Correspondence);
+
+public sealed record RecoveredSeamNetwork(
+ IReadOnlyList<RecoveredSeam> Seams,
+ IReadOnlyList<RecoveredJunction> Junctions,
+ IReadOnlyList<SourceBoundaryLoopCorrespondence> SourceBoundaryLoops);
+
+public static class RecoveredSeamNetworkBuilder
+{
+ private sealed record EdgeUse(int Face, int From, int To);
+ private sealed record RawEdge(int A, int B, string ChartA, string? ChartB, RecoveredSeamClassification Classification, IReadOnlyList<EdgeUse> Uses);
+ private sealed record FitResult(BoundedParametricCurve3 Curve, RecoveredSeamRepresentation Kind, double Residual, IReadOnlyList<SeamFitCandidateEvidence> Candidates, string Winner);
+
+ public static RecoveredSeamNetwork Build(TriangleSurfaceMesh mesh, IReadOnlyList<RecoveredChart> charts, IReadOnlyList<int> faceChart)
+ {
+ ArgumentNullException.ThrowIfNull(mesh);
+ if (faceChart.Count != mesh.Triangles.Count) throw new ArgumentException("Every source triangle must have one chart assignment.", nameof(faceChart));
+ return Build(mesh, faceChart.Select(index => charts[index].StableId).ToArray());
+ }
+
+ /// <summary>Fixture/tooling entry point when chart decomposition already exists as stable per-face identities.</summary>
+ public static RecoveredSeamNetwork Build(TriangleSurfaceMesh mesh, IReadOnlyList<string> faceChartIds)
+ {
+ ArgumentNullException.ThrowIfNull(mesh);
+ if (faceChartIds.Count != mesh.Triangles.Count) throw new ArgumentException("Every source triangle must have one chart assignment.", nameof(faceChartIds));
+
+ var edgeUses = new SortedDictionary<(int A, int B), List<EdgeUse>>();
+ for (var face = 0; face < mesh.Triangles.Count; face++)
+ {
+ foreach (var (from, to) in mesh.Triangles[face].DirectedEdges())
+ {
+ var key = from < to ? (from, to) : (to, from);
+ if (!edgeUses.TryGetValue(key, out var uses)) edgeUses[key] = uses = [];
+ uses.Add(new(face, from, to));
+ }
+ }
+
+ var groups = new SortedDictionary<string, List<RawEdge>>(StringComparer.Ordinal);
+ foreach (var (edge, uses) in edgeUses)
+ {
+ if (uses.Count == 2 && faceChartIds[uses[0].Face] != faceChartIds[uses[1].Face])
+ {
+ var ca = faceChartIds[uses[0].Face];
+ var cb = faceChartIds[uses[1].Face];
+ if (StringComparer.Ordinal.Compare(ca, cb) > 0) (ca, cb) = (cb, ca);
+ Add($"I:{ca}:{cb}", new(edge.A, edge.B, ca, cb, RecoveredSeamClassification.Internal, uses));
+ }
+ else if (uses.Count == 1)
+ {
+ var ca = faceChartIds[uses[0].Face];
+ Add($"B:{ca}", new(edge.A, edge.B, ca, null, RecoveredSeamClassification.SourceOpenBoundary, uses));
+ }
+ }
+
+ var seams = new List<RecoveredSeam>();
+ foreach (var (_, raw) in groups)
+ {
+ foreach (var path in Trace(raw))
+ {
+ var ordered = Canonicalize(path);
+ var firstEdge = Find(raw, ordered[0], ordered[1]);
+ var samples = ordered.Select(index => mesh.Vertices[index]).ToArray();
+ var idPayload = $"{firstEdge.Classification}|{firstEdge.ChartA}|{firstEdge.ChartB}|{string.Join(',', ordered)}";
+ var stableId = "seam-" + Hash(idPayload)[..16];
+ var fit = Fit(samples, mesh.Bounds.Size.Length, stableId);
+ // Canonical seam order is the left-side contract. A consistently oriented
+ // manifold transition necessarily traverses the same geometric edge in the
+ // opposite direction on its right chart.
+ var left = RecoveredSeamOrientation.SameDirection;
+ RecoveredSeamOrientation? right = firstEdge.ChartB is null ? null : RecoveredSeamOrientation.ReversedDirection;
+ var provenance = raw.Where(edge => ContainsPathEdge(ordered, edge.A, edge.B)).SelectMany(edge => edge.Uses.Select(use => use.Face)).Distinct().Order().ToArray();
+ var edges = Enumerable.Range(0, ordered.Count - 1).Select(i => (ordered[i], ordered[i + 1])).ToArray();
+ seams.Add(new(stableId, firstEdge.ChartA, firstEdge.ChartB, firstEdge.Classification, ordered, edges, provenance, samples,
+ fit.Kind, left, right, 0, 1, ordered[0] == ordered[^1], fit.Residual, NormalDiscontinuity(mesh, firstEdge), fit.Candidates,
+ fit.Winner, "one recovered curve evaluated in canonical t=[0,1]; all incident chart sides consume this identity", fit.Curve));
+ }
+ }
+ seams.Sort((a, b) => StringComparer.Ordinal.Compare(a.StableId, b.StableId));
+
+ var incident = new SortedDictionary<int, SortedSet<string>>();
+ foreach (var seam in seams)
+ {
+ foreach (var vertex in seam.SourceVertexIndices.Distinct())
+ {
+ if (!incident.TryGetValue(vertex, out var ids)) incident[vertex] = ids = new(StringComparer.Ordinal);
+ ids.Add(seam.StableId);
+ }
+ }
+ var byId = seams.ToDictionary(seam => seam.StableId, StringComparer.Ordinal);
+ var junctions = incident.Where(pair => pair.Value.Count >= 3 || pair.Value.Any(id => IsEndpoint(byId[id], pair.Key)) && pair.Value.Count >= 2)
+ .Select(pair => new RecoveredJunction("junction-" + Hash(pair.Key + "|" + string.Join(',', pair.Value))[..16], pair.Key, mesh.Vertices[pair.Key], pair.Value.ToArray(), 0,
+ TangentSpread(mesh.Vertices[pair.Key], pair.Value.Select(id => byId[id])), "one source-supported endpoint point shared by every incident recovered seam"))
+ .OrderBy(junction => junction.StableId, StringComparer.Ordinal).ToArray();
+
+ var validation = TriangleSurfaceValidator.Validate(mesh);
+ var boundaryLoops = validation.BoundaryLoops.Select((loop, index) =>
+ {
+ var vertices = loop.ToHashSet();
+ var ids = seams.Where(seam => seam.Classification == RecoveredSeamClassification.SourceOpenBoundary && seam.SourceEdges.Any(edge => vertices.Contains(edge.A) && vertices.Contains(edge.B)))
+ .Select(seam => seam.StableId).Order(StringComparer.Ordinal).ToArray();
+ return new SourceBoundaryLoopCorrespondence($"source-loop-{index:D2}", loop, ids, true, "source boundary edge membership; external side intentionally unmatched");
+ }).ToArray();
+ return new(seams, junctions, boundaryLoops);
+
+ void Add(string key, RawEdge edge)
+ {
+ if (!groups.TryGetValue(key, out var list)) groups[key] = list = [];
+ list.Add(edge);
+ }
+ }
+
+ private static IReadOnlyList<IReadOnlyList<int>> Trace(IReadOnlyList<RawEdge> edges)
+ {
+ var unused = new SortedSet<(int A, int B)>(edges.Select(edge => (edge.A, edge.B)));
+ var adjacency = new SortedDictionary<int, SortedSet<int>>();
+ foreach (var edge in edges)
+ {
+ if (!adjacency.TryGetValue(edge.A, out var a)) adjacency[edge.A] = a = [];
+ if (!adjacency.TryGetValue(edge.B, out var b)) adjacency[edge.B] = b = [];
+ a.Add(edge.B); b.Add(edge.A);
+ }
+ var result = new List<IReadOnlyList<int>>();
+ foreach (var start in adjacency.Where(pair => pair.Value.Count != 2).Select(pair => pair.Key).ToArray())
+ while (adjacency[start].Any(next => unused.Contains(Key(start, next)))) result.Add(Walk(start));
+ while (unused.Count > 0) result.Add(Walk(unused.Min.A));
+ return result;
+
+ IReadOnlyList<int> Walk(int start)
+ {
+ var path = new List<int> { start }; var previous = -1; var current = start;
+ while (true)
+ {
+ var next = adjacency[current].Where(n => n != previous && unused.Contains(Key(current, n))).DefaultIfEmpty(-1).First();
+ if (next < 0) break;
+ unused.Remove(Key(current, next)); path.Add(next); previous = current; current = next;
+ if (current == start || (path.Count > 1 && adjacency[current].Count != 2)) break;
+ }
+ return path;
+ }
+ }
+
+ private static IReadOnlyList<int> Canonicalize(IReadOnlyList<int> path)
+ {
+ if (path.Count < 2) return path;
+ if (path[0] == path[^1])
+ {
+ var core = path.Take(path.Count - 1).ToArray();
+ var min = core.Min(); var candidates = new List<int[]>();
+ foreach (var direction in new[] { core, core.Reverse().ToArray() })
+ foreach (var index in Enumerable.Range(0, direction.Length).Where(i => direction[i] == min))
+ candidates.Add(Enumerable.Range(0, direction.Length).Select(offset => direction[(index + offset) % direction.Length]).Append(min).ToArray());
+ return candidates.OrderBy(candidate => string.Join(",", candidate), StringComparer.Ordinal).First();
+ }
+ var reverse = path.Reverse().ToArray();
+ return Lexical(path, reverse) <= 0 ? path.ToArray() : reverse;
+ }
+
+ private static FitResult Fit(IReadOnlyList<Point3D> points, double scale, string seamId)
+ {
+ var parameters = ChordParameters(points);
+ var lineAllowed = (points[0] - points[^1]).Length > 1e-14;
+ var lineDelta = points[^1] - points[0];
+ var line = lineAllowed ? BoundedParametricCurve3.Procedural(seamId + ":curve:line", new ParameterDomain1(0, 1),
+ t => (points[0] + lineDelta * t, lineDelta), "shared source trace", representation: GeometryRepresentationKind.ProceduralParametric) : null;
+ var lineResidual = lineAllowed ? points.Select((point, index) => (point - line!.Evaluate(parameters[index])).Length).Max() : double.PositiveInfinity;
+ var tolerance = double.Max(1e-10, scale * 1e-4);
+ var splineGeometry = PolylineSpline(points, parameters);
+ var spline = BoundedParametricCurve3.FromCurveGeometry(seamId + ":curve:bspline", CurveGeometry.FromBSpline(splineGeometry), 0, 1, "shared source trace; non-rational degree-one spline");
+ var context = new SeamChoiceContext(lineResidual, tolerance, points.Count);
+ var candidates = new[]
+ {
+ new JudgmentCandidate<SeamChoiceContext>("Line", c => double.IsFinite(c.LineResidual) && c.LineResidual <= c.Tolerance, c => -(c.LineResidual / c.Tolerance) - .001,
+ c => $"line residual {c.LineResidual:R} exceeds hard tolerance {c.Tolerance:R}", 0),
+ new JudgmentCandidate<SeamChoiceContext>("NonRationalBSpline", _ => true, c => -.002 * c.SampleCount, null, 1)
+ };
+ var result = new JudgmentEngine<SeamChoiceContext>().Evaluate(context, candidates);
+ if (!result.IsSuccess) throw new InvalidOperationException("No admissible recovered seam representation.");
+ var winner = result.Selection!.Value.Candidate.Name;
+ var evidence = candidates.Select(candidate =>
+ {
+ var admissible = candidate.IsAdmissible(context); var utility = admissible ? candidate.Score(context) : 0d;
+ return new SeamFitCandidateEvidence(candidate.Name, admissible, candidate.Name == "Line" && double.IsFinite(lineResidual) ? lineResidual : 0,
+ candidate.Name == "Line" ? .001 : .002 * points.Count, utility,
+ admissible ? "finite curve, matching authoritative endpoints, bounded residual" : candidate.RejectionReason!(context));
+ }).ToArray();
+ return winner == "Line"
+ ? new(line!, RecoveredSeamRepresentation.Line, lineResidual, evidence, winner)
+ : new(spline, RecoveredSeamRepresentation.NonRationalBSpline, 0, evidence, winner);
+ }
+
+ private sealed record SeamChoiceContext(double LineResidual, double Tolerance, int SampleCount);
+
+ private static BSpline3Curve PolylineSpline(IReadOnlyList<Point3D> input, IReadOnlyList<double> parameters)
+ {
+ var points = input.Count == 2 ? input : input.ToArray();
+ var knots = parameters.ToArray();
+ var multiplicities = Enumerable.Repeat(1, knots.Length).ToArray(); multiplicities[0] = 2; multiplicities[^1] = 2;
+ return new(1, points, multiplicities, knots, "POLYLINE", false, false, "PIECEWISE_LINEAR");
+ }
+
+ private static double[] ChordParameters(IReadOnlyList<Point3D> points)
+ {
+ var values = new double[points.Count];
+ for (var i = 1; i < points.Count; i++) values[i] = values[i - 1] + (points[i] - points[i - 1]).Length;
+ if (values[^1] <= 1e-15) return Enumerable.Range(0, points.Count).Select(i => i / (double)(points.Count - 1)).ToArray();
+ for (var i = 1; i < values.Length; i++) values[i] /= values[^1];
+ return values;
+ }
+
+ private static RawEdge Find(IReadOnlyList<RawEdge> edges, int a, int b) => edges.Single(edge => Key(edge.A, edge.B) == Key(a, b));
+ private static bool ContainsPathEdge(IReadOnlyList<int> path, int a, int b) => Enumerable.Range(0, path.Count - 1).Any(i => Key(path[i], path[i + 1]) == Key(a, b));
+ private static (int A, int B) Key(int a, int b) => a < b ? (a, b) : (b, a);
+ private static int Lexical(IReadOnlyList<int> a, IReadOnlyList<int> b) { for (var i = 0; i < a.Count; i++) { var c = a[i].CompareTo(b[i]); if (c != 0) return c; } return 0; }
+ private static string Hash(string value) => Convert.ToHexString(SHA256.HashData(Encoding.UTF8.GetBytes(value))).ToLowerInvariant();
+ private static bool IsEndpoint(RecoveredSeam seam, int vertex) => !seam.IsClosed && (seam.SourceVertexIndices[0] == vertex || seam.SourceVertexIndices[^1] == vertex);
+ private static double NormalDiscontinuity(TriangleSurfaceMesh mesh, RawEdge edge)
+ {
+ if (edge.Uses.Count != 2) return 0;
+ Vector3D N(int face) { var t = mesh.Triangles[face]; var n = (mesh.Vertices[t.B] - mesh.Vertices[t.A]).Cross(mesh.Vertices[t.C] - mesh.Vertices[t.A]); return n.TryNormalize(out n) ? n : Vector3D.Zero; }
+ return double.Acos(double.Clamp(N(edge.Uses[0].Face).Dot(N(edge.Uses[1].Face)), -1, 1)) * 180 / double.Pi;
+ }
+ private static double TangentSpread(Point3D point, IEnumerable<RecoveredSeam> seams)
+ {
+ var tangents = seams.Select(seam =>
+ {
+ var samples = seam.SourceBoundarySamples;
+ var index = Enumerable.Range(0, samples.Count).OrderBy(i => (samples[i] - point).Length).First();
+ var neighbor = index == 0 ? 1 : index == samples.Count - 1 ? samples.Count - 2 : index - 1;
+ var vector = seam.SourceBoundarySamples[neighbor] - point; return vector.TryNormalize(out vector) ? vector : Vector3D.Zero;
+ }).Where(vector => vector.Length > 0).ToArray();
+ var max = 0d; for (var i = 0; i < tangents.Length; i++) for (var j = i + 1; j < tangents.Length; j++) max = double.Max(max, double.Acos(double.Clamp(double.Abs(tangents[i].Dot(tangents[j])), -1, 1)) * 180 / double.Pi);
+ return max;
+ }
+}
+
+public sealed record CanonicalReconstructionMesh(
+ SurfaceMeshDocument Document,
+ int InternalCrackGroups,
+ int IntentionalOpenBoundaryLoops,
+ int BoundaryEdgeCount,
+ int NonManifoldEdgeCount,
+ int QuadCount,
+ int TriangleCount,
+ string ValidationStatus,
+ string DeterministicHash);
+
+/// <summary>
+/// Canonical topology-conforming lowering. Interior vertices sample recovered Panel supports;
+/// seam vertices are evaluated once from RecoveredSeam and reused by both chart patches.
+/// It deliberately retains source-cell adjacency as meshing evidence, not semantic geometry.
+/// </summary>
+public static class SeamAuthoritativeSurfaceMeshLowering
+{
+ public static CanonicalReconstructionMesh Lower(TriangleSurfaceMesh source, ChartNetwork network)
+ {
+ var chartByFace = new int[source.Triangles.Count];
+ for (var chart = 0; chart < network.Charts.Count; chart++) foreach (var face in network.Charts[chart].SourceTriangles) chartByFace[face] = chart;
+ var chartMembership = Enumerable.Range(0, source.Vertices.Count).Select(_ => new SortedSet<int>()).ToArray();
+ for (var face = 0; face < source.Triangles.Count; face++) foreach (var vertex in Vertices(source.Triangles[face])) chartMembership[vertex].Add(chartByFace[face]);
+ var positions = new Point3D[source.Vertices.Count];
+ for (var vertex = 0; vertex < positions.Length; vertex++)
+ {
+ if (chartMembership[vertex].Count == 0) { positions[vertex] = source.Vertices[vertex]; continue; }
+ var chart = network.Charts[chartMembership[vertex].First()]; var d = source.Vertices[vertex] - chart.Origin;
+ var u = double.Clamp((d.Dot(chart.UAxis) - chart.UMin) / (chart.UMax - chart.UMin), 0, 1);
+ var v = double.Clamp((d.Dot(chart.VAxis) - chart.VMin) / (chart.VMax - chart.VMin), 0, 1);
+ positions[vertex] = chart.Patch.EvaluatePoint(u, v);
+ }
+ foreach (var seam in network.Seams)
+ {
+ var parameters = ChordParameters(seam.SourceBoundarySamples);
+ for (var i = 0; i < seam.SourceVertexIndices.Count; i++) positions[seam.SourceVertexIndices[i]] = seam.Curve.Evaluate(parameters[i]);
+ }
+
+ var vertices = positions.Select((point, index) => new SurfaceMeshVertex(index + 1, point)).ToArray();
+ var patches = new List<SurfacePatch>(); var quadCount = 0; var triangleCount = 0;
+ for (var chartIndex = 0; chartIndex < network.Charts.Count; chartIndex++)
+ {
+ var chart = network.Charts[chartIndex]; var faces = chart.SourceTriangles.ToHashSet(); var unused = new SortedSet<int>(faces); var cells = new List<SurfaceMeshCell>();
+ while (unused.Count > 0)
+ {
+ var face = unused.Min; unused.Remove(face); var triangle = source.Triangles[face];
+ var mate = unused.Where(other => SharedVertexCount(triangle, source.Triangles[other]) == 2).DefaultIfEmpty(-1).First();
+ if (mate >= 0 && TryQuad(triangle, source.Triangles[mate], out var quad))
+ {
+ unused.Remove(mate); cells.Add(new QuadCell(quad.Select(id => id + 1).ToArray())); quadCount++;
+ }
+ else { cells.Add(new TriangleCell(Vertices(triangle).Select(id => id + 1).ToArray())); triangleCount++; }
+ }
+ var support = new SurfaceMeshSupport(SurfaceMeshSupportKind.Plane, new PlaneSurface(chart.Origin, Direction3D.Create(chart.Normal), Direction3D.Create(chart.UAxis)));
+ patches.Add(new(new FaceId(chartIndex + 1), support, [], cells, true, "recovered-panel", ChartId: chart.StableId, PlanarPlannerPath: "seam-authoritative topology-conforming sampled Panel lowering"));
+ }
+ var boundaries = network.Seams.Select((seam, index) =>
+ {
+ var samples = seam.SourceVertexIndices.Select(id => vertices[id]).ToArray();
+ var uses = new List<FaceBoundaryUse> { Use(seam.ChartA, false, index, 0) };
+ if (seam.ChartB is not null) uses.Add(Use(seam.ChartB, seam.RightOrientation == RecoveredSeamOrientation.ReversedDirection, index, 1));
+ return new SharedEdgeSamplePlan(new EdgeId(index + 1), seam.RepresentationKind == RecoveredSeamRepresentation.Line ? CurveGeometryKind.Line3 : CurveGeometryKind.BSpline3,
+ new ParameterInterval(0, 1), samples, uses, seam.IsClosed, seam.FitResidual);
+ }).ToArray();
+
+ var topology = CellTopology(patches.SelectMany(patch => patch.Cells), vertices);
+ var payload = string.Join('|', vertices.Select(v => $"{v.Id}:{v.Position.X:R},{v.Position.Y:R},{v.Position.Z:R}")) + ";" + string.Join('|', patches.SelectMany(p => p.Cells).Select(c => $"{c.Kind}:{string.Join(',', c.VertexIds)}"));
+ var hash = Convert.ToHexString(SHA256.HashData(Encoding.UTF8.GetBytes(payload))).ToLowerInvariant();
+ var metrics = new SurfaceMeshMetrics(patches.Count, boundaries.Length, quadCount + triangleCount, quadCount, triangleCount, triangleCount, 0,
+ network.Seams.Select(s => s.FitResidual).DefaultIfEmpty().Max(), 0, topology.MinLength, topology.MaxLength, hash, 0, topology.NonManifold, triangleCount + quadCount * 2);
+ var document = new SurfaceMeshDocument(vertices, patches, boundaries, metrics);
+ var valid = SurfaceMeshIrValidator.TryValidate(document, out var failure);
+ return new(document, 0, network.SourceBoundaryLoops.Count, topology.Boundary, topology.NonManifold, quadCount, triangleCount,
+ valid ? "Pass" : "Fail: " + failure, hash);
+
+ FaceBoundaryUse Use(string chartId, bool reversed, int seamIndex, int side)
+ {
+ var chartIndex = network.Charts.ToList().FindIndex(chart => chart.StableId == chartId);
+ return new(new FaceId(chartIndex + 1), new LoopId(chartIndex + 1), new CoedgeId(seamIndex * 2 + side + 1), reversed);
+ }
+ }
+
+ private static int[] Vertices(Triangle triangle) => [triangle.A, triangle.B, triangle.C];
+ private static int SharedVertexCount(Triangle a, Triangle b) => Vertices(a).Intersect(Vertices(b)).Count();
+ private static bool TryQuad(Triangle a, Triangle b, out int[] quad)
+ {
+ var directed = a.DirectedEdges().Concat(b.DirectedEdges()).ToArray();
+ var boundary = directed.Where(edge => directed.Count(other => Key(edge.A, edge.B) == Key(other.A, other.B)) == 1).ToArray();
+ if (boundary.Length != 4) { quad = []; return false; }
+ var ordered = new List<int> { boundary[0].A, boundary[0].B }; var current = boundary[0].B;
+ while (ordered.Count < 4)
+ {
+ var next = boundary.FirstOrDefault(edge => edge.A == current && !ordered.Contains(edge.B));
+ if (next == default) { quad = []; return false; }
+ ordered.Add(next.B); current = next.B;
+ }
+ quad = ordered.ToArray(); return quad.Distinct().Count() == 4;
+ }
+ private static (int, int) Key(int a, int b) => a < b ? (a, b) : (b, a);
+ private static double[] ChordParameters(IReadOnlyList<Point3D> points)
+ {
+ var values = new double[points.Count]; for (var i = 1; i < points.Count; i++) values[i] = values[i - 1] + (points[i] - points[i - 1]).Length;
+ if (values[^1] <= 1e-15) return Enumerable.Range(0, points.Count).Select(i => i / (double)(points.Count - 1)).ToArray();
+ for (var i = 1; i < values.Length; i++) values[i] /= values[^1]; return values;
+ }
+ private static (int Boundary, int NonManifold, double MinLength, double MaxLength) CellTopology(IEnumerable<SurfaceMeshCell> cells, IReadOnlyList<SurfaceMeshVertex> vertices)
+ {
+ var pointById = vertices.ToDictionary(vertex => vertex.Id, vertex => vertex.Position);
+ var edges = new Dictionary<(int, int), (int Count, double Length)>();
+ foreach (var cell in cells) for (var i = 0; i < cell.VertexIds.Count; i++)
+ {
+ var key = Key(cell.VertexIds[i], cell.VertexIds[(i + 1) % cell.VertexIds.Count]);
+ edges[key] = (edges.GetValueOrDefault(key).Count + 1, (pointById[key.Item1] - pointById[key.Item2]).Length);
+ }
+ return (edges.Count(edge => edge.Value.Count == 1), edges.Count(edge => edge.Value.Count > 2), edges.Values.Min(edge => edge.Length), edges.Values.Max(edge => edge.Length));
+ }
+}
diff --git a/Aetheris.Reconstruction/SpatialAndRecovery.cs b/Aetheris.Reconstruction/SpatialAndRecovery.cs
index c87140fa..6b4d9ee4 100644
--- a/Aetheris.Reconstruction/SpatialAndRecovery.cs
+++ b/Aetheris.Reconstruction/SpatialAndRecovery.cs
@@ -80,8 +80,13 @@ public static class AdaptiveSurfaceAnalyzer
public sealed record DifferentialSample(int TriangleIndex, Point3D Point, Vector3D Normal, Vector3D PrincipalDirection, Vector3D CrossDirection, double CurvatureProxy, double Conditioning, bool DirectionKnown, string EvidenceClass);
public sealed record CrossFieldSummary(int SampleCount, int KnownDirectionCount, int UnknownDirectionCount, int SingularityCount, double MeanNeighborMismatchDegrees, string Representation, string Propagation);
public sealed record RecoveredChart(string StableId, int[] SourceTriangles, Point3D Origin, Vector3D Normal, Vector3D UAxis, Vector3D VAxis, double UMin, double UMax, double VMin, double VMax, double[] HeightCoefficients, double RmsResidual, double MaxResidual, double? AngleDistortionP95, double? AreaDistortionP95, int Foldovers, string Status, BoundedParametricPatch3 Patch);
-public sealed record ChartNetwork(IReadOnlyList<RecoveredChart> Charts, IReadOnlyList<RecoveredSeam> Seams, IReadOnlyList<ReconstructionDiagnostic> Diagnostics, IReadOnlyDictionary<string, double> ObjectiveWeights);
-public sealed record RecoveredSeam(string StableId, string ChartA, string ChartB, int SourceEdgeCount, double G0Residual, string Authority);
+public sealed record ChartNetwork(
+ IReadOnlyList<RecoveredChart> Charts,
+ IReadOnlyList<RecoveredSeam> Seams,
+ IReadOnlyList<RecoveredJunction> Junctions,
+ IReadOnlyList<SourceBoundaryLoopCorrespondence> SourceBoundaryLoops,
+ IReadOnlyList<ReconstructionDiagnostic> Diagnostics,
+ IReadOnlyDictionary<string, double> ObjectiveWeights);
public static class StructuredSurfaceRecovery
{
@@ -121,9 +126,9 @@ public static class StructuredSurfaceRecovery
}
var ordered = Enumerable.Range(0, groups.Count).GroupBy(Root).Select(g => g.SelectMany(i => groups[i]).Order().ToList()).OrderBy(g => g.Min()).ToArray(); var charts = new List<RecoveredChart>(); var faceChart = new int[mesh.Triangles.Count]; Array.Fill(faceChart, -1); var diagnostics = new List<ReconstructionDiagnostic>();
for (var ci = 0; ci < ordered.Length; ci++) { var chart = FitChart(mesh, field, ordered[ci], $"chart-{ci:D4}", minimumFaces); charts.Add(chart); foreach (var f in ordered[ci]) faceChart[f] = ci; if (chart.Status != "Accepted") diagnostics.Add(new(ReconstructionDiagnosticCode.PoorLocalSupport, "Warning", $"{chart.StableId}: {chart.Status}", ordered[ci].Min())); }
- var seamCounts = new SortedDictionary<(int, int), int>(); foreach (var (a, neighbors) in adjacency.Select((n, i) => (i, n))) foreach (var b in neighbors) if (a < b && faceChart[a] != faceChart[b]) { var key = faceChart[a] < faceChart[b] ? (faceChart[a], faceChart[b]) : (faceChart[b], faceChart[a]); seamCounts[key] = seamCounts.GetValueOrDefault(key) + 1; }
- var seams = seamCounts.Select((p, i) => new RecoveredSeam($"seam-{i:D4}", charts[p.Key.Item1].StableId, charts[p.Key.Item2].StableId, p.Value, 0, "single source-evidence seam polyline; neighboring fitted boundaries require future reconciliation")).ToArray();
- return new(charts, seams, diagnostics, new Dictionary<string, double> { ["normalDiscontinuity"] = 4, ["fieldMismatch"] = 2, ["spatialCompactness"] = 1, ["panelCountPenalty"] = .05, ["poorSupportPenalty"] = 10 });
+ var seamNetwork = RecoveredSeamNetworkBuilder.Build(mesh, charts, faceChart);
+ return new(charts, seamNetwork.Seams, seamNetwork.Junctions, seamNetwork.SourceBoundaryLoops, diagnostics,
+ new Dictionary<string, double> { ["normalDiscontinuity"] = 4, ["fieldMismatch"] = 2, ["spatialCompactness"] = 1, ["panelCountPenalty"] = .05, ["poorSupportPenalty"] = 10 });
}
private static RecoveredChart FitChart(TriangleSurfaceMesh mesh, IReadOnlyList<DifferentialSample> field, List<int> faces, string id, int minimumFaces)
diff --git a/Aetheris.slnx b/Aetheris.slnx
index db95992a..8ae4e7b5 100644
--- a/Aetheris.slnx
+++ b/Aetheris.slnx
@@ -34,6 +34,7 @@
<Project Path="tools/Aetheris.Geometry.M4Evidence/Aetheris.Geometry.M4Evidence.csproj" />
<Project Path="tools/Aetheris.Geometry.M5Evidence/Aetheris.Geometry.M5Evidence.csproj" />
<Project Path="tools/Aetheris.BunnyM0/Aetheris.BunnyM0.csproj" />
+ <Project Path="tools/Aetheris.BunnyM1/Aetheris.BunnyM1.csproj" />
<Project Path="tools/Aetheris.Continuum.AttentionE0/Aetheris.Continuum.AttentionE0.csproj" />
<Project Path="tools/Aetheris.Continuum.AttentionE1/Aetheris.Continuum.AttentionE1.csproj" />
<Project Path="Aetheris.Forge/Aetheris.Forge.csproj" />
diff --git a/docs/geometry/artifacts/bunny-m1/README.md b/docs/geometry/artifacts/bunny-m1/README.md
new file mode 100644
index 00000000..dd97a7c8
--- /dev/null
+++ b/docs/geometry/artifacts/bunny-m1/README.md
@@ -0,0 +1,8 @@
+# AETHERIS-BUNNY-M1 evidence
+
+```text
+TriangleSurfaceMesh → chart network → authoritative recovered seam/junction network
+ → sampled boundary-conforming Panel supports → canonical SurfaceMeshDocument
+```
+
+This run closes internal mesh cracks by sampling each recovered seam once and reusing its vertex identities. It preserves source-open boundaries. It does not claim full M1 success: the M0 chart decomposition is not a quadrilateral atlas, so strict four-boundary `PanelIr` construction remains blocked on chart topology and boundary-aligned parameterization. No post-hoc welding or hole filling is used.
\ No newline at end of file
diff --git a/docs/geometry/artifacts/bunny-m1/manifest.json b/docs/geometry/artifacts/bunny-m1/manifest.json
new file mode 100644
index 00000000..fe4d1c44
--- /dev/null
+++ b/docs/geometry/artifacts/bunny-m1/manifest.json
@@ -0,0 +1,102 @@
+{
+ "milestone": "AETHERIS-BUNNY-M1",
+ "sourceMeshHash": "88d635a8709c1c570ff47c80ef6340fe8a8da58c1f3e2c96975ff428276cbde0",
+ "seamNetworkHash": "c00c4d91f8c1647e5786a9f07f0457409d5b3d2344b3a4bce0705e3dd8fd0a8c",
+ "surfaceMeshHash": "ac66525e9f8f15aa147181a18d3a51cd4266326632b141f950a588406043135a",
+ "deterministic": true,
+ "excludedObservationalFiles": [
+ "performance.json"
+ ],
+ "files": [
+ {
+ "path": "README.md",
+ "sha256": "44a52129ef7ccba0f9709594c69918207777d2206f2aaf7aedd6aac5ded7d568",
+ "bytes": 634
+ },
+ {
+ "path": "authoritative-seams.obj",
+ "sha256": "b88dbd73e6eaad00d375244cbed3c121a131c428f0ba010ed379ba30274b27b9",
+ "bytes": 393969
+ },
+ {
+ "path": "chart-colored.obj",
+ "sha256": "a88978a0bd29a8d49bb75a0ea4164f2fa90fe4a50105602509865be3fdb962e5",
+ "bytes": 3578784
+ },
+ {
+ "path": "judgment-traces.json",
+ "sha256": "371934b470d56b88f0521dfaa8b9216343a086a6aa7b3b7936a9389a48b0a664",
+ "bytes": 663858
+ },
+ {
+ "path": "junction-network.json",
+ "sha256": "6db5303fd1ef7323ae1d96852580dfade771bc29006e51336f1b583e7c894b75",
+ "bytes": 290438
+ },
+ {
+ "path": "m0-seam-failure-audit.json",
+ "sha256": "62079c7a4bb6718f8354b8bf527a57285c2854330c4f156ac650326738fc1478",
+ "bytes": 585257
+ },
+ {
+ "path": "normal-error.json",
+ "sha256": "c47924c319669af25ce2c8c3966550cc80c48aeceb1e09438772f5b8739ba5f4",
+ "bytes": 451
+ },
+ {
+ "path": "panel-continuity.json",
+ "sha256": "e12ac72eb6fa1115ee80857d5072e116d110076a089059e11d2cefb3fafe2180",
+ "bytes": 454
+ },
+ {
+ "path": "panel-joint-fit.json",
+ "sha256": "a2a3e116dd08a45e88d9c6fa31e76a4ebd2e314482be0396f326e01a9be15634",
+ "bytes": 584
+ },
+ {
+ "path": "reconstruction-error.json",
+ "sha256": "1484a85cdf169ba3f874a8555c4cac42f7b0dabeb0e1b842ef5aae8136a60b5e",
+ "bytes": 842
+ },
+ {
+ "path": "seam-fit-candidates.json",
+ "sha256": "c079e11b778320a409c17b59e70213bd8936c42159e9582a5914e94e1a4549d6",
+ "bytes": 663688
+ },
+ {
+ "path": "seam-network.json",
+ "sha256": "188e4b2513ec6aa55831359b9d992395a53b093e94ed322b17c9d6fe3d1c09bb",
+ "bytes": 1626196
+ },
+ {
+ "path": "source-boundary-loops.json",
+ "sha256": "bf465c93c9c43833b10a5f5184cc6cd488dfe99d414ad2a0068c1f43fa9843e5",
+ "bytes": 5945
+ },
+ {
+ "path": "structured-remesh.obj",
+ "sha256": "2960b7bddd5094b39e7447d54dc99dc392dd265c3e51d2a96215d8c13336e11d",
+ "bytes": 2989964
+ },
+ {
+ "path": "surface-mesh-document.json",
+ "sha256": "588510f082517e1c4a881256ed617cee13c767955b2d4bcabe90b3462218f22a",
+ "bytes": 21388115
+ },
+ {
+ "path": "surface-mesh-summary.json",
+ "sha256": "4c9c0ab6c1df850f5e375cffee32b158a868946536596496ddf15d948e9bb9a5",
+ "bytes": 502
+ },
+ {
+ "path": "validation-report.json",
+ "sha256": "21b6dc46fb2589c7131a8b2bd3e83681bb71e8e3922412d613215323c4670936",
+ "bytes": 898
+ },
+ {
+ "path": "worst-regions.json",
+ "sha256": "d958223e8dcce60caace83cba28640e61d71603d2a1b9ff5d0890a588f290119",
+ "bytes": 19831
+ }
+ ]
+}
\ No newline at end of file
diff --git a/docs/geometry/artifacts/bunny-m1/normal-error.json b/docs/geometry/artifacts/bunny-m1/normal-error.json
new file mode 100644
index 00000000..05684511
--- /dev/null
+++ b/docs/geometry/artifacts/bunny-m1/normal-error.json
@@ -0,0 +1,17 @@
+{
+ "normalAngleDegrees": {
+ "mean": 11.456890403481678,
+ "maximum": 90,
+ "rms": 18.77884279304215,
+ "p50": 7.33781309397067,
+ "p90": 21.405065330940506,
+ "p95": 30.822269132228165,
+ "p99": 90
+ },
+ "baselineM0": {
+ "mean": 11.456890403481678,
+ "rms": 18.77884279304215,
+ "maximum": 90
+ },
+ "localization": "per-chart source-centroid evaluation; seam source-normal discontinuity in seam-network.json"
+}
\ No newline at end of file
diff --git a/docs/geometry/artifacts/bunny-m1/panel-continuity.json b/docs/geometry/artifacts/bunny-m1/panel-continuity.json
new file mode 100644
index 00000000..81f2c020
--- /dev/null
+++ b/docs/geometry/artifacts/bunny-m1/panel-continuity.json
@@ -0,0 +1,24 @@
+{
+ "seamCount": 858,
+ "g0": {
+ "pass": 858,
+ "fail": 0,
+ "maximumResidual": 0
+ },
+ "g1": {
+ "pass": 0,
+ "fail": 0,
+ "unknown": 858,
+ "evidence": "strict Panel-side tangent evidence awaits boundary-constrained PanelIr",
+ "sourceNormalAngularProxy": {
+ "within5Degrees": 318,
+ "over5Degrees": 540
+ }
+ },
+ "g2": {
+ "pass": 0,
+ "fail": 0,
+ "unknown": 858
+ },
+ "featureSeams": 126
+}
\ No newline at end of file
diff --git a/docs/geometry/artifacts/bunny-m1/panel-joint-fit.json b/docs/geometry/artifacts/bunny-m1/panel-joint-fit.json
new file mode 100644
index 00000000..7d6e5aab
--- /dev/null
+++ b/docs/geometry/artifacts/bunny-m1/panel-joint-fit.json
@@ -0,0 +1,9 @@
+{
+ "strictBoundaryConstrainedPanelCount": 0,
+ "sampledTopologyConformingPanelCount": 333,
+ "algorithm": "interior vertices evaluate recovered quadratic supports; boundary vertices evaluate one authoritative seam and are shared",
+ "strictPanelStatus": "Blocked",
+ "rejection": "M0 chart boundaries are not a four-sided atlas, so their rectangular PanelIr supports cannot truthfully bind the recovered multi-side seam cycles.",
+ "nextBlocker": "quadrilateral chart topology and boundary-aligned parameterization before BoundaryPatch lowering",
+ "silentSeamDrift": false
+}
\ No newline at end of file
diff --git a/docs/geometry/artifacts/bunny-m1/performance.json b/docs/geometry/artifacts/bunny-m1/performance.json
new file mode 100644
index 00000000..dcff8082
--- /dev/null
+++ b/docs/geometry/artifacts/bunny-m1/performance.json
@@ -0,0 +1,15 @@
+{
+ "timingsMilliseconds": {
+ "canonicalSurfaceMeshLowering": 815.5519,
+ "chartAndSeamRecovery": 1401.3826,
+ "errorEvaluation": 992.1962,
+ "fieldRecovery": 473.3413,
+ "geometryDogfood": 31.925,
+ "seamExtractionRepeat": 1045.191,
+ "sourceLoad": 66.716,
+ "sourceValidation": 111.8699,
+ "spatialIndex": 1288.6474,
+ "total": 6316.0495
+ },
+ "approximateWorkingSetBytes": 172539904
+}
\ No newline at end of file
diff --git a/docs/geometry/artifacts/bunny-m1/reconstruction-error.json b/docs/geometry/artifacts/bunny-m1/reconstruction-error.json
new file mode 100644
index 00000000..dadb0a80
--- /dev/null
+++ b/docs/geometry/artifacts/bunny-m1/reconstruction-error.json
@@ -0,0 +1,27 @@
+{
+ "sourceToPanels": {
+ "mean": 0.00024307087545630173,
+ "maximum": 0.0032993837537705043,
+ "rms": 0.00036256811738685383,
+ "p50": 0.00015418071070672155,
+ "p90": 0.0005802937783412499,
+ "p95": 0.0007642005580378718,
+ "p99": 0.0012856805046987166
+ },
+ "remeshToSource": {
+ "mean": 0.00017826962217444735,
+ "maximum": 0.0021861873979109265,
+ "rms": 0.00029103244442774703,
+ "p50": 9.409746856225915E-05,
+ "p90": 0.0004837921977281724,
+ "p95": 0.0006456197447519454,
+ "p99": 0.001020339066206189
+ },
+ "sampledBidirectionalHausdorff": 0.0032993837537705043,
+ "baselineM0": {
+ "sourceToPanelsRms": 0.00036256811738685383,
+ "sourceToPanelsMax": 0.0032993837537705043,
+ "remeshToSourceRms": 0.0011799706833783676,
+ "remeshToSourceMax": 0.014510655135104078
+ }
+}
\ No newline at end of file
diff --git a/docs/geometry/artifacts/bunny-m1/source-boundary-loops.json b/docs/geometry/artifacts/bunny-m1/source-boundary-loops.json
new file mode 100644
index 00000000..5a10e242
--- /dev/null
+++ b/docs/geometry/artifacts/bunny-m1/source-boundary-loops.json
@@ -0,0 +1,306 @@
+{
+ "sourceLoops": 5,
+ "reconstructedLoops": 5,
+ "unintendedLoops": 0,
+ "automaticFilling": false,
+ "correspondence": [
+ {
+ "stableId": "source-loop-00",
+ "sourceVertexIndices": [
+ 1884,
+ 18288,
+ 18839,
+ 20618,
+ 21207,
+ 1969,
+ 18741,
+ 18740,
+ 13564,
+ 21116,
+ 21115,
+ 21114,
+ 21113,
+ 19910,
+ 34384,
+ 34521,
+ 34649,
+ 34777,
+ 34907,
+ 35036,
+ 35165,
+ 18299,
+ 1884
+ ],
+ "recoveredSeamIds": [
+ "seam-be4f100792ea6c75",
+ "seam-e3342cffd708022a",
+ "seam-ecaee07119d63f99"
+ ],
+ "intentionallyOpen": true,
+ "correspondence": "source boundary edge membership; external side intentionally unmatched"
+ },
+ {
+ "stableId": "source-loop-01",
+ "sourceVertexIndices": [
+ 31771,
+ 31772,
+ 31879,
+ 31880,
+ 31982,
+ 31983,
+ 32084,
+ 32085,
+ 32186,
+ 32187,
+ 32188,
+ 32290,
+ 32291,
+ 32395,
+ 32396,
+ 32502,
+ 32503,
+ 32613,
+ 32728,
+ 32841,
+ 32950,
+ 33057,
+ 33056,
+ 32949,
+ 32840,
+ 32727,
+ 32612,
+ 32611,
+ 32501,
+ 32500,
+ 32394,
+ 32393,
+ 32289,
+ 32288,
+ 32287,
+ 32185,
+ 32184,
+ 32083,
+ 32082,
+ 31981,
+ 31980,
+ 31878,
+ 31771
+ ],
+ "recoveredSeamIds": [
+ "seam-12410bc14c2442ff",
+ "seam-7194c8f3df7d7095",
+ "seam-c0e31a972d80e9aa",
+ "seam-c51ed0a8451901fe",
+ "seam-e08cae8454bf3f07"
+ ],
+ "intentionallyOpen": true,
+ "correspondence": "source boundary edge membership; external side intentionally unmatched"
+ },
+ {
+ "stableId": "source-loop-02",
+ "sourceVertexIndices": [
+ 31822,
+ 31823,
+ 31824,
+ 31825,
+ 31826,
+ 31827,
+ 31828,
+ 31829,
+ 31928,
+ 31929,
+ 31930,
+ 32028,
+ 32029,
+ 32127,
+ 32228,
+ 32330,
+ 32434,
+ 32541,
+ 32653,
+ 32774,
+ 32773,
+ 32772,
+ 32771,
+ 32770,
+ 32769,
+ 32768,
+ 32767,
+ 32652,
+ 32651,
+ 32650,
+ 32540,
+ 32539,
+ 32433,
+ 32329,
+ 32227,
+ 32126,
+ 32026,
+ 32027,
+ 31927,
+ 31822
+ ],
+ "recoveredSeamIds": [
+ "seam-06968806add9df2a",
+ "seam-20a90eadd3ebda50",
+ "seam-a78331e1da113dd2",
+ "seam-e6310fd9d1e2456f"
+ ],
+ "intentionallyOpen": true,
+ "correspondence": "source boundary edge membership; external side intentionally unmatched"
+ },
+ {
+ "stableId": "source-loop-03",
+ "sourceVertexIndices": [
+ 32710,
+ 32711,
+ 32712,
+ 32713,
+ 32714,
+ 32715,
+ 32716,
+ 32717,
+ 32830,
+ 32831,
+ 32832,
+ 32941,
+ 32942,
+ 33049,
+ 33155,
+ 33260,
+ 33370,
+ 33483,
+ 33601,
+ 33727,
+ 33726,
+ 33725,
+ 33724,
+ 33857,
+ 33856,
+ 33855,
+ 33854,
+ 33853,
+ 33852,
+ 33723,
+ 33722,
+ 33600,
+ 33482,
+ 33369,
+ 33259,
+ 33154,
+ 33048,
+ 32940,
+ 32828,
+ 32829,
+ 32710
+ ],
+ "recoveredSeamIds": [
+ "seam-3294d35639f54b0e",
+ "seam-65ece03bac3cd408",
+ "seam-a54c6b50a4efa551",
+ "seam-b4248e496a4f6d03",
+ "seam-edbd409e4d1560e3",
+ "seam-fab83a29691384f5"
+ ],
+ "intentionallyOpen": true,
+ "correspondence": "source boundary edge membership; external side intentionally unmatched"
+ },
+ {
+ "stableId": "source-loop-04",
+ "sourceVertexIndices": [
+ 33772,
+ 33773,
+ 33774,
+ 33775,
+ 33908,
+ 33907,
+ 33906,
+ 34040,
+ 34039,
+ 34174,
+ 34173,
+ 34172,
+ 34309,
+ 34308,
+ 34307,
+ 34444,
+ 34443,
+ 34442,
+ 34578,
+ 34577,
+ 34576,
+ 34703,
+ 34702,
+ 34701,
+ 34828,
+ 34827,
+ 34826,
+ 34825,
+ 34824,
+ 34823,
+ 34822,
+ 34821,
+ 34820,
+ 34819,
+ 34818,
+ 34817,
+ 34688,
+ 34687,
+ 34686,
+ 34557,
+ 34556,
+ 34418,
+ 34417,
+ 34278,
+ 34279,
+ 34280,
+ 34419,
+ 34420,
+ 34558,
+ 34559,
+ 34560,
+ 34689,
+ 34690,
+ 34691,
+ 34692,
+ 34693,
+ 34694,
+ 34695,
+ 34696,
+ 34697,
+ 34698,
+ 34699,
+ 34700,
+ 34573,
+ 34574,
+ 34575,
+ 34439,
+ 34440,
+ 34441,
+ 34304,
+ 34305,
+ 34306,
+ 34169,
+ 34170,
+ 34171,
+ 34036,
+ 34037,
+ 34038,
+ 33904,
+ 33905,
+ 33772
+ ],
+ "recoveredSeamIds": [
+ "seam-51a76e0e8303975e",
+ "seam-5cd3322694dbf66e",
+ "seam-a1d7458b6aea7bd9",
+ "seam-ae31bb5c1a5dc664",
+ "seam-b0b21a6aa0168685",
+ "seam-d3e5ab8849f7f058",
+ "seam-e366ad5d04b82668"
+ ],
+ "intentionallyOpen": true,
+ "correspondence": "source boundary edge membership; external side intentionally unmatched"
+ }
+ ]
+}
\ No newline at end of file
diff --git a/docs/geometry/artifacts/bunny-m1/surface-mesh-summary.json b/docs/geometry/artifacts/bunny-m1/surface-mesh-summary.json
new file mode 100644
index 00000000..3b9f632f
--- /dev/null
+++ b/docs/geometry/artifacts/bunny-m1/surface-mesh-summary.json
@@ -0,0 +1,15 @@
+{
+ "representation": "canonical topology-conforming sampled Panel mesh with shared RecoveredSeam vertices",
+ "vertices": 35947,
+ "cells": 37568,
+ "quads": 31883,
+ "triangles": 5685,
+ "nGons": 0,
+ "quadPercentage": 84.86744037478705,
+ "internalCrackGroups": 0,
+ "intentionalOpenLoops": 5,
+ "boundaryEdgeCount": 223,
+ "nonManifoldEdgeCount": 0,
+ "surfaceMeshDocumentValidation": "Pass",
+ "deterministicHash": "ac66525e9f8f15aa147181a18d3a51cd4266326632b141f950a588406043135a"
+}
\ No newline at end of file
diff --git a/docs/geometry/artifacts/bunny-m1/validation-report.json b/docs/geometry/artifacts/bunny-m1/validation-report.json
new file mode 100644
index 00000000..e332851d
--- /dev/null
+++ b/docs/geometry/artifacts/bunny-m1/validation-report.json
@@ -0,0 +1,25 @@
+{
+ "milestone": "AETHERIS-BUNNY-M1",
+ "status": "MeaningfulProgression",
+ "seamAuthority": true,
+ "sharedJunctionAuthority": true,
+ "canonicalCrackFree": true,
+ "sourceOpenLoopsPreserved": true,
+ "canonicalSurfaceMeshValid": true,
+ "strictJointPanelNetwork": false,
+ "blocker": "the current chart decomposition is not a boundary-aligned quadrilateral atlas; strict four-boundary PanelIr reconstruction would require chart-topology work, not welding",
+ "geometryDogfood": {
+ "seam": "seam-004a083509922d4c",
+ "chart": "chart-0022",
+ "jet1": "Available",
+ "jet2": "Regular",
+ "curvature": "Available",
+ "curvatureEvidence": "ToleranceBounded",
+ "closestPoint": "Unknown",
+ "closestPointEvidence": "Unknown",
+ "intersection": "Unknown",
+ "intersectionEvidence": "Unknown",
+ "contact": "Unknown",
+ "contactEvidence": "Unknown"
+ }
+}
\ No newline at end of file
diff --git a/docs/geometry/artifacts/bunny-m1/worst-regions.json b/docs/geometry/artifacts/bunny-m1/worst-regions.json
new file mode 100644
index 00000000..968c5756
--- /dev/null
+++ b/docs/geometry/artifacts/bunny-m1/worst-regions.json
@@ -0,0 +1,638 @@
+{
+ "worstCharts": [
+ {
+ "stableId": "chart-0229",
+ "rmsResidual": 0.0004372156088555771,
+ "maxResidual": 0.0037478611113775364,
+ "cause": "quadratic support capacity / chart parameter domain"
+ },
+ {
+ "stableId": "chart-0013",
+ "rmsResidual": 0.0012317238822135452,
+ "maxResidual": 0.003662899837826052,
+ "cause": "quadratic support capacity / chart parameter domain"
+ },
+ {
+ "stableId": "chart-0014",
+ "rmsResidual": 0.0010346664962895679,
+ "maxResidual": 0.0035474993594757846,
+ "cause": "quadratic support capacity / chart parameter domain"
+ },
+ {
+ "stableId": "chart-0117",
+ "rmsResidual": 0.0005482150457851572,
+ "maxResidual": 0.003340073086684597,
+ "cause": "quadratic support capacity / chart parameter domain"
+ },
+ {
+ "stableId": "chart-0153",
+ "rmsResidual": 0.0009920486705206728,
+ "maxResidual": 0.00329242571337985,
+ "cause": "quadratic support capacity / chart parameter domain"
+ },
+ {
+ "stableId": "chart-0028",
+ "rmsResidual": 0.0005707072770551663,
+ "maxResidual": 0.0027966171747853467,
+ "cause": "quadratic support capacity / chart parameter domain"
+ },
+ {
+ "stableId": "chart-0182",
+ "rmsResidual": 0.0007696231348638361,
+ "maxResidual": 0.0027523813764706723,
+ "cause": "quadratic support capacity / chart parameter domain"
+ },
+ {
+ "stableId": "chart-0329",
+ "rmsResidual": 0.0007503260237949672,
+ "maxResidual": 0.002711202313875862,
+ "cause": "quadratic support capacity / chart parameter domain"
+ },
+ {
+ "stableId": "chart-0119",
+ "rmsResidual": 0.0007957596524019243,
+ "maxResidual": 0.002683512480091904,
+ "cause": "quadratic support capacity / chart parameter domain"
+ },
+ {
+ "stableId": "chart-0073",
+ "rmsResidual": 0.0005279600394864852,
+ "maxResidual": 0.0026507007582698104,
+ "cause": "quadratic support capacity / chart parameter domain"
+ },
+ {
+ "stableId": "chart-0114",
+ "rmsResidual": 0.0009407359585872111,
+ "maxResidual": 0.0024598794405404265,
+ "cause": "quadratic support capacity / chart parameter domain"
+ },
+ {
+ "stableId": "chart-0202",
+ "rmsResidual": 0.0006859783351474674,
+ "maxResidual": 0.002458877291938786,
+ "cause": "quadratic support capacity / chart parameter domain"
+ },
+ {
+ "stableId": "chart-0037",
+ "rmsResidual": 0.0007472579991160752,
+ "maxResidual": 0.002321333322655577,
+ "cause": "quadratic support capacity / chart parameter domain"
+ },
+ {
+ "stableId": "chart-0113",
+ "rmsResidual": 0.000691933847577622,
+ "maxResidual": 0.0023076889214109,
+ "cause": "quadratic support capacity / chart parameter domain"
+ },
+ {
+ "stableId": "chart-0068",
+ "rmsResidual": 0.0007045062209223668,
+ "maxResidual": 0.0022844222846435075,
+ "cause": "quadratic support capacity / chart parameter domain"
+ },
+ {
+ "stableId": "chart-0098",
+ "rmsResidual": 0.0004141699711706131,
+ "maxResidual": 0.0022449776953364625,
+ "cause": "quadratic support capacity / chart parameter domain"
+ },
+ {
+ "stableId": "chart-0149",
+ "rmsResidual": 0.0004441862249154883,
+ "maxResidual": 0.002240641900664327,
+ "cause": "quadratic support capacity / chart parameter domain"
+ },
+ {
+ "stableId": "chart-0089",
+ "rmsResidual": 0.0003843897077598283,
+ "maxResidual": 0.002236195894393304,
+ "cause": "quadratic support capacity / chart parameter domain"
+ },
+ {
+ "stableId": "chart-0094",
+ "rmsResidual": 0.00039179446352363164,
+ "maxResidual": 0.0021975413461031664,
+ "cause": "quadratic support capacity / chart parameter domain"
+ },
+ {
+ "stableId": "chart-0022",
+ "rmsResidual": 0.0004407818860128724,
+ "maxResidual": 0.002177959019212556,
+ "cause": "quadratic support capacity / chart parameter domain"
+ }
+ ],
+ "worstSeams": [
+ {
+ "stableId": "seam-fe6dd79d8efb0c76",
+ "chartA": "chart-0054",
+ "chartB": "chart-0329",
+ "fitResidual": 0,
+ "normalEvidenceDegrees": 97.83191100812198,
+ "cause": "possible feature seam or noisy support"
+ },
+ {
+ "stableId": "seam-bc69f3a862d24149",
+ "chartA": "chart-0210",
+ "chartB": "chart-0291",
+ "fitResidual": 0,
+ "normalEvidenceDegrees": 97.53725493097812,
+ "cause": "possible feature seam or noisy support"
+ },
+ {
+ "stableId": "seam-011ff120855169f5",
+ "chartA": "chart-0033",
+ "chartB": "chart-0159",
+ "fitResidual": 0,
+ "normalEvidenceDegrees": 90,
+ "cause": "possible feature seam or noisy support"
+ },
+ {
+ "stableId": "seam-04e5c9b1658aa464",
+ "chartA": "chart-0005",
+ "chartB": "chart-0213",
+ "fitResidual": 0,
+ "normalEvidenceDegrees": 90,
+ "cause": "possible feature seam or noisy support"
+ },
+ {
+ "stableId": "seam-07f3bdf6b8513bae",
+ "chartA": "chart-0077",
+ "chartB": "chart-0082",
+ "fitResidual": 0,
+ "normalEvidenceDegrees": 90,
+ "cause": "possible feature seam or noisy support"
+ },
+ {
+ "stableId": "seam-089936573950f6a9",
+ "chartA": "chart-0001",
+ "chartB": "chart-0287",
+ "fitResidual": 0,
+ "normalEvidenceDegrees": 90,
+ "cause": "possible feature seam or noisy support"
+ },
+ {
+ "stableId": "seam-0bb75ac0be6ee368",
+ "chartA": "chart-0218",
+ "chartB": "chart-0240",
+ "fitResidual": 0,
+ "normalEvidenceDegrees": 90,
+ "cause": "possible feature seam or noisy support"
+ },
+ {
+ "stableId": "seam-0d0077a17d52aaae",
+ "chartA": "chart-0006",
+ "chartB": "chart-0050",
+ "fitResidual": 0,
+ "normalEvidenceDegrees": 90,
+ "cause": "possible feature seam or noisy support"
+ },
+ {
+ "stableId": "seam-0f24ab2059b36eb4",
+ "chartA": "chart-0035",
+ "chartB": "chart-0067",
+ "fitResidual": 0,
+ "normalEvidenceDegrees": 90,
+ "cause": "possible feature seam or noisy support"
+ },
+ {
+ "stableId": "seam-10b633a0de10d45e",
+ "chartA": "chart-0173",
+ "chartB": "chart-0197",
+ "fitResidual": 0,
+ "normalEvidenceDegrees": 90,
+ "cause": "possible feature seam or noisy support"
+ },
+ {
+ "stableId": "seam-181dc7bfb25651e3",
+ "chartA": "chart-0112",
+ "chartB": "chart-0205",
+ "fitResidual": 0,
+ "normalEvidenceDegrees": 90,
+ "cause": "possible feature seam or noisy support"
+ },
+ {
+ "stableId": "seam-1b4156bdab666ab9",
+ "chartA": "chart-0034",
+ "chartB": "chart-0035",
+ "fitResidual": 0,
+ "normalEvidenceDegrees": 90,
+ "cause": "possible feature seam or noisy support"
+ },
+ {
+ "stableId": "seam-1cb2619fb44fcd64",
+ "chartA": "chart-0013",
+ "chartB": "chart-0193",
+ "fitResidual": 0,
+ "normalEvidenceDegrees": 90,
+ "cause": "possible feature seam or noisy support"
+ },
+ {
+ "stableId": "seam-1cd9d3b9b5d53a34",
+ "chartA": "chart-0112",
+ "chartB": "chart-0308",
+ "fitResidual": 0,
+ "normalEvidenceDegrees": 90,
+ "cause": "possible feature seam or noisy support"
+ },
+ {
+ "stableId": "seam-1d21d8e3a85b45af",
+ "chartA": "chart-0027",
+ "chartB": "chart-0102",
+ "fitResidual": 0,
+ "normalEvidenceDegrees": 90,
+ "cause": "possible feature seam or noisy support"
+ },
+ {
+ "stableId": "seam-2241d59eb67082fd",
+ "chartA": "chart-0052",
+ "chartB": "chart-0084",
+ "fitResidual": 0,
+ "normalEvidenceDegrees": 90,
+ "cause": "possible feature seam or noisy support"
+ },
+ {
+ "stableId": "seam-305e9df4fb434724",
+ "chartA": "chart-0043",
+ "chartB": "chart-0117",
+ "fitResidual": 0,
+ "normalEvidenceDegrees": 90,
+ "cause": "possible feature seam or noisy support"
+ },
+ {
+ "stableId": "seam-333f8f5caed0a6de",
+ "chartA": "chart-0039",
+ "chartB": "chart-0179",
+ "fitResidual": 0,
+ "normalEvidenceDegrees": 90,
+ "cause": "possible feature seam or noisy support"
+ },
+ {
+ "stableId": "seam-33b59c2403c57de6",
+ "chartA": "chart-0018",
+ "chartB": "chart-0187",
+ "fitResidual": 0,
+ "normalEvidenceDegrees": 90,
+ "cause": "possible feature seam or noisy support"
+ },
+ {
+ "stableId": "seam-346b092d6f1e2402",
+ "chartA": "chart-0155",
+ "chartB": "chart-0224",
+ "fitResidual": 0,
+ "normalEvidenceDegrees": 90,
+ "cause": "possible feature seam or noisy support"
+ }
+ ],
+ "worstJunctions": [
+ {
+ "stableId": "junction-80b22949dd9964d9",
+ "sourceVertexIndex": 7674,
+ "point": {
+ "x": -0.0147714,
+ "y": 0.163994,
+ "z": -0.0109737
+ },
+ "incidentSeamIds": [
+ "seam-09d2771889bc102b",
+ "seam-36e217d4da7ec54c",
+ "seam-85f03b836135d52a"
+ ],
+ "sourceResidual": 0,
+ "incidentTangentSpreadDegrees": 89.99992391237123,
+ "authority": "one source-supported endpoint point shared by every incident recovered seam"
+ },
+ {
+ "stableId": "junction-760c520887fc9ea7",
+ "sourceVertexIndex": 17954,
+ "point": {
+ "x": -0.0856354,
+ "y": 0.143297,
+ "z": 0.0395519
+ },
+ "incidentSeamIds": [
+ "seam-d037cb63c22bc705",
+ "seam-d7a5d66896074d5d",
+ "seam-f5fdaf292661a167"
+ ],
+ "sourceResidual": 0,
+ "incidentTangentSpreadDegrees": 89.99794400664007,
+ "authority": "one source-supported endpoint point shared by every incident recovered seam"
+ },
+ {
+ "stableId": "junction-3bdf11b57ba384c6",
+ "sourceVertexIndex": 19817,
+ "point": {
+ "x": -0.081252,
+ "y": 0.0993542,
+ "z": 0.0322994
+ },
+ "incidentSeamIds": [
+ "seam-2bcea663f63bcdd0",
+ "seam-aa4d546f803320bb",
+ "seam-ed59ea2bc0fedddb"
+ ],
+ "sourceResidual": 0,
+ "incidentTangentSpreadDegrees": 89.98901129918097,
+ "authority": "one source-supported endpoint point shared by every incident recovered seam"
+ },
+ {
+ "stableId": "junction-e1f713b53e8ced1c",
+ "sourceVertexIndex": 19623,
+ "point": {
+ "x": -0.023276,
+ "y": 0.0768174,
+ "z": 0.0529315
+ },
+ "incidentSeamIds": [
+ "seam-29665fb87a4dfcc0",
+ "seam-b4d0ee53e6602539",
+ "seam-cb7aa0713f5c2f06",
+ "seam-e40058bf31e3b064"
+ ],
+ "sourceResidual": 0,
+ "incidentTangentSpreadDegrees": 89.98833220605678,
+ "authority": "one source-supported endpoint point shared by every incident recovered seam"
+ },
+ {
+ "stableId": "junction-7a7439d7b9640a9d",
+ "sourceVertexIndex": 2659,
+ "point": {
+ "x": 0.016279,
+ "y": 0.127286,
+ "z": 0.0242335
+ },
+ "incidentSeamIds": [
+ "seam-5a8d188fe9de9c04",
+ "seam-90557a026144016e",
+ "seam-b6ecf90e85796d1f"
+ ],
+ "sourceResidual": 0,
+ "incidentTangentSpreadDegrees": 89.97662594166127,
+ "authority": "one source-supported endpoint point shared by every incident recovered seam"
+ },
+ {
+ "stableId": "junction-76b7c75cbbd02039",
+ "sourceVertexIndex": 7559,
+ "point": {
+ "x": -0.0283728,
+ "y": 0.156641,
+ "z": -0.000811787
+ },
+ "incidentSeamIds": [
+ "seam-0c6a2bf449c3dc2b",
+ "seam-b09a20c22ad49bf7",
+ "seam-c65b4e2d82f36665",
+ "seam-ebe99d605f46e2b4"
+ ],
+ "sourceResidual": 0,
+ "incidentTangentSpreadDegrees": 89.97380380043549,
+ "authority": "one source-supported endpoint point shared by every incident recovered seam"
+ },
+ {
+ "stableId": "junction-69cc753d3bc46b00",
+ "sourceVertexIndex": 5289,
+ "point": {
+ "x": -0.00549542,
+ "y": 0.0965711,
+ "z": 0.0536823
+ },
+ "incidentSeamIds": [
+ "seam-1e59341651a372fc",
+ "seam-40860b70408bb2b1",
+ "seam-47def14a0b47a4b0",
+ "seam-b5746ba7fdd66ebc"
+ ],
+ "sourceResidual": 0,
+ "incidentTangentSpreadDegrees": 89.97374002236455,
+ "authority": "one source-supported endpoint point shared by every incident recovered seam"
+ },
+ {
+ "stableId": "junction-2a990f68472d50d5",
+ "sourceVertexIndex": 23867,
+ "point": {
+ "x": 0.0162842,
+ "y": 0.118981,
+ "z": -0.0122323
+ },
+ "incidentSeamIds": [
+ "seam-6a5a99954a7aaf3c",
+ "seam-80914ab9dbf057e1",
+ "seam-ae09ccd10e204a43",
+ "seam-c26f09d74ba31da9"
+ ],
+ "sourceResidual": 0,
+ "incidentTangentSpreadDegrees": 89.97364551756833,
+ "authority": "one source-supported endpoint point shared by every incident recovered seam"
+ },
+ {
+ "stableId": "junction-80c58ec069d8c400",
+ "sourceVertexIndex": 13106,
+ "point": {
+ "x": -0.0329051,
+ "y": 0.0359381,
+ "z": 0.0496011
+ },
+ "incidentSeamIds": [
+ "seam-82942e469cabd005",
+ "seam-a1c68a99adc55296",
+ "seam-a8ed1bb8ae4aaaac"
+ ],
+ "sourceResidual": 0,
+ "incidentTangentSpreadDegrees": 89.97287859827996,
+ "authority": "one source-supported endpoint point shared by every incident recovered seam"
+ },
+ {
+ "stableId": "junction-528aa8db6cb2dec5",
+ "sourceVertexIndex": 32917,
+ "point": {
+ "x": -0.089438,
+ "y": 0.113514,
+ "z": 0.0412091
+ },
+ "incidentSeamIds": [
+ "seam-061b858efae1619d",
+ "seam-6b4346a678a29e83",
+ "seam-9c6e6f6e64044470"
+ ],
+ "sourceResidual": 0,
+ "incidentTangentSpreadDegrees": 89.9724718402403,
+ "authority": "one source-supported endpoint point shared by every incident recovered seam"
+ },
+ {
+ "stableId": "junction-7556ab8934fa95d4",
+ "sourceVertexIndex": 134,
+ "point": {
+ "x": -0.0725041,
+ "y": 0.146981,
+ "z": 0.0423864
+ },
+ "incidentSeamIds": [
+ "seam-0f24ab2059b36eb4",
+ "seam-65942c86467145ec",
+ "seam-66bd24d9f9485e22",
+ "seam-6855cb85de99fb14"
+ ],
+ "sourceResidual": 0,
+ "incidentTangentSpreadDegrees": 89.96756327083423,
+ "authority": "one source-supported endpoint point shared by every incident recovered seam"
+ },
+ {
+ "stableId": "junction-fd36acce47003d89",
+ "sourceVertexIndex": 33456,
+ "point": {
+ "x": -0.0896796,
+ "y": 0.114349,
+ "z": 0.0422656
+ },
+ "incidentSeamIds": [
+ "seam-8349ec260576e4dc",
+ "seam-8b54879150f6c033",
+ "seam-9c6e6f6e64044470"
+ ],
+ "sourceResidual": 0,
+ "incidentTangentSpreadDegrees": 89.95632678043944,
+ "authority": "one source-supported endpoint point shared by every incident recovered seam"
+ },
+ {
+ "stableId": "junction-c0dda22171f69b72",
+ "sourceVertexIndex": 18164,
+ "point": {
+ "x": -0.053021,
+ "y": 0.0473885,
+ "z": 0.0142865
+ },
+ "incidentSeamIds": [
+ "seam-61b76984ba2da0e5",
+ "seam-8f012e9f61c56f3b",
+ "seam-f1c028e9ceaf4c24"
+ ],
+ "sourceResidual": 0,
+ "incidentTangentSpreadDegrees": 89.9503206700953,
+ "authority": "one source-supported endpoint point shared by every incident recovered seam"
+ },
+ {
+ "stableId": "junction-4d764680baf1cd34",
+ "sourceVertexIndex": 13772,
+ "point": {
+ "x": 0.0437866,
+ "y": 0.098742,
+ "z": 0.00716534
+ },
+ "incidentSeamIds": [
+ "seam-87fe6e8cac2805e8",
+ "seam-937c4a4e5b034035",
+ "seam-a9344ef254ecfcaa",
+ "seam-fc17850855380433"
+ ],
+ "sourceResidual": 0,
+ "incidentTangentSpreadDegrees": 89.93995633619039,
+ "authority": "one source-supported endpoint point shared by every incident recovered seam"
+ },
+ {
+ "stableId": "junction-128640cf965296ce",
+ "sourceVertexIndex": 15008,
+ "point": {
+ "x": -0.0720698,
+ "y": 0.176015,
+ "z": -0.0442709
+ },
+ "incidentSeamIds": [
+ "seam-93a52ec5e37e9b99",
+ "seam-b2a5387651fd990f",
+ "seam-d8541ed424a05370"
+ ],
+ "sourceResidual": 0,
+ "incidentTangentSpreadDegrees": 89.93282069429068,
+ "authority": "one source-supported endpoint point shared by every incident recovered seam"
+ },
+ {
+ "stableId": "junction-b74cc7d989e752ae",
+ "sourceVertexIndex": 9929,
+ "point": {
+ "x": 0.0163312,
+ "y": 0.0767998,
+ "z": 0.0535416
+ },
+ "incidentSeamIds": [
+ "seam-1e0248a68f3101e6",
+ "seam-22d2ca494acffcdd",
+ "seam-6321f7accbbcd2bf",
+ "seam-ac1c15382e7c1bcb"
+ ],
+ "sourceResidual": 0,
+ "incidentTangentSpreadDegrees": 89.91863422547014,
+ "authority": "one source-supported endpoint point shared by every incident recovered seam"
+ },
+ {
+ "stableId": "junction-3e848d69b7daede6",
+ "sourceVertexIndex": 1053,
+ "point": {
+ "x": -0.0744916,
+ "y": 0.146991,
+ "z": 0.0423999
+ },
+ "incidentSeamIds": [
+ "seam-4665ac0787be4e92",
+ "seam-65942c86467145ec",
+ "seam-c710b0c72fc75b25"
+ ],
+ "sourceResidual": 0,
+ "incidentTangentSpreadDegrees": 89.91711103814993,
+ "authority": "one source-supported endpoint point shared by every incident recovered seam"
+ },
+ {
+ "stableId": "junction-4eeb8c29b1d8da25",
+ "sourceVertexIndex": 14769,
+ "point": {
+ "x": -0.0663498,
+ "y": 0.172859,
+ "z": -0.0450539
+ },
+ "incidentSeamIds": [
+ "seam-2c9e7db4ab55fe7d",
+ "seam-2cb104d3d10aa0c6",
+ "seam-93a52ec5e37e9b99",
+ "seam-b5af39ac9f54b8e7"
+ ],
+ "sourceResidual": 0,
+ "incidentTangentSpreadDegrees": 89.91099353324496,
+ "authority": "one source-supported endpoint point shared by every incident recovered seam"
+ },
+ {
+ "stableId": "junction-5553be7c1c4a62e5",
+ "sourceVertexIndex": 5513,
+ "point": {
+ "x": -0.050497,
+ "y": 0.0987878,
+ "z": 0.0435099
+ },
+ "incidentSeamIds": [
+ "seam-8bd6246586c70ca5",
+ "seam-bfdee66d81d5dcd3",
+ "seam-f5fce8d5affe3f7b",
+ "seam-fdbede55e99435f2"
+ ],
+ "sourceResidual": 0,
+ "incidentTangentSpreadDegrees": 89.90693708617259,
+ "authority": "one source-supported endpoint point shared by every incident recovered seam"
+ },
+ {
+ "stableId": "junction-e2b7cc84381cc30a",
+ "sourceVertexIndex": 17890,
+ "point": {
+ "x": -0.0899083,
+ "y": 0.121615,
+ "z": 0.0458595
+ },
+ "incidentSeamIds": [
+ "seam-0d0fd078bdd67da0",
+ "seam-1561274f530cfc68",
+ "seam-278ff944cce1c9ea",
+ "seam-4105dc9689a050b5"
+ ],
+ "sourceResidual": 0,
+ "incidentTangentSpreadDegrees": 89.90690632573761,
+ "authority": "one source-supported endpoint point shared by every incident recovered seam"
+ }
+ ]
+}
\ No newline at end of file
diff --git a/docs/geometry/surface-reconstruction.md b/docs/geometry/surface-reconstruction.md
index bea6e6dd..ff4cba7b 100644
--- a/docs/geometry/surface-reconstruction.md
+++ b/docs/geometry/surface-reconstruction.md
@@ -10,10 +10,12 @@ Adaptive Surface Analysis
Unoriented Tangent Cross Field
↓ geometric objective
Chart Network
- ↓ bounded fitting
-Recovered PanelIr Network
- ↓ shared-seam tessellation (incomplete in M0)
-SurfaceMeshIR
+ ↓ ordered chart-transition traces
+Recovered Seam + Junction Network
+ ↓ fixed boundary authorities
+Boundary-constrained Panel Network
+ ↓ sample every seam once
+Canonical SurfaceMeshDocument
```
This path is distinct from `TriangleMesh → Continuum CutCells → FEA`. CutCells describe geometry embedded in a computational volume; reconstruction recovers structure on the surface itself.
@@ -28,7 +30,34 @@ The M0 patch fallback is a non-rational quadratic expression. It exposes exact f
Load order, BVH splitting, lattice traversal, four-fold field transport, chart growth, fitting pivots, IDs, and tessellation order use stable ordering. Performance observations are inherently nondeterministic and are marked separately from deterministic geometry hashes in the artifact manifest.
-## M0 limitation
+## Seam authority law
+
+> A chart adjacency has one reconstructed seam authority. Neighboring Panels reference that seam; they do not independently fit duplicate boundaries and weld them later.
+
+`RecoveredSeam` distinguishes internal seams (exactly two chart sides) from source-open-boundary seams (one chart side). Its stable identity is derived from canonical chart ordering and ordered source provenance. It owns a normalized `[0,1]` parameter domain, an explicit direction mapping for each side, one recovered curve, and one sample/vertex identity sequence. `RecoveredJunction` similarly owns the point shared by all incident seam endpoints. The source transition edges provide ordered geometric and topological evidence; they do not become semantic CAD edges.
+
+The canonical topology-conforming lowering evaluates interior vertices on the recovered chart support and seam vertices on `RecoveredSeam` exactly once. Both adjacent patches then refer to the same `SurfaceMeshVertex` IDs and `SharedEdgeSamplePlan`. This is construction-time sharing, not post-hoc positional welding. Source-open seam chains retain a single `FaceBoundaryUse`, and source loop correspondence remains explicit.
+
+## Judgment use
+
+Seam representation selection is a bounded `JudgmentEngine` decision between a line and a non-rational degree-one B-spline fallback. Before utility scoring, candidates must be finite, preserve authoritative endpoints, and (for a line) remain within `1e-4` of the source bounding-box diagonal. Utilities are:
+
+```text
+line = -(position residual / tolerance) - 0.001
+spline = -0.002 * source sample count
+```
+
+This makes the residual/complexity trade explicit and deterministic. Candidate scores, rejections, winners, and weights are persisted in `seam-fit-candidates.json` and `judgment-traces.json`. Exact trace ordering, junction identity, same/reversed side orientation, shared sampling, and source boundary classification use deterministic invariants instead of Judgment because no competing interpretation is needed.
+
+## M1 convergence status
+
+M1 removes the M0 seam-data loss: all 845 Bunny chart adjacencies now resolve to authoritative ordered seam objects (858 connected traces after branch/component splitting), with shared junctions and canonical sampling. The resulting `SurfaceMeshDocument` has zero internal crack groups, five intentional open loops, and passes validation.
+
+Strict jointly constrained `PanelIr` construction is not yet complete. The M0 chart decomposition produces general multi-sided chart boundaries rather than a quadrilateral atlas. Existing `BoundaryPatch` can enforce four recovered curves exactly, but applying it to these charts would require inventing or discarding sides. The next architectural step is therefore boundary-aligned quadrilateral chart topology and parameterization, not welding or a richer surface representation.
+
+Canonical M1 evidence is in [the bunny M1 artifact directory](artifacts/bunny-m1/README.md).
+
+## M0 baseline
The fitted chart interiors work, but chart boundaries are rectangular bounding domains rather than jointly optimized trim curves. The experimental structured output is therefore all quads but has one unreconciled crack group per chart seam and does not yet pass through canonical crack-free `SurfaceMeshDocument` validation. The next implementation must jointly parameterize/reconcile shared chart boundaries while preserving the Stanford Bunny's five open source loops. No implicit `FillHole`, `BridgeBoundary`, or `InferMissingSurface` policy is applied.
diff --git a/tools/Aetheris.BunnyM1/Aetheris.BunnyM1.csproj b/tools/Aetheris.BunnyM1/Aetheris.BunnyM1.csproj
new file mode 100644
index 00000000..46402252
--- /dev/null
+++ b/tools/Aetheris.BunnyM1/Aetheris.BunnyM1.csproj
@@ -0,0 +1,4 @@
+<Project Sdk="Microsoft.NET.Sdk">
+ <PropertyGroup><OutputType>Exe</OutputType><TargetFramework>net10.0</TargetFramework><ImplicitUsings>enable</ImplicitUsings><Nullable>enable</Nullable></PropertyGroup>
+ <ItemGroup><ProjectReference Include="..\..\Aetheris.Reconstruction\Aetheris.Reconstruction.csproj" /><ProjectReference Include="..\..\Aetheris.Geometry\Aetheris.Geometry.csproj" /></ItemGroup>
+</Project>
diff --git a/tools/Aetheris.BunnyM1/Program.cs b/tools/Aetheris.BunnyM1/Program.cs
new file mode 100644
index 00000000..13803433
--- /dev/null
+++ b/tools/Aetheris.BunnyM1/Program.cs
@@ -0,0 +1,119 @@
+using System.Diagnostics;
+using System.Security.Cryptography;
+using System.Text;
+using System.Text.Json;
+using Aetheris.Geometry;
+using Aetheris.Kernel.Core.Brep.Tessellation;
+using Aetheris.Reconstruction;
+
+var root = FindRoot();
+var sourcePath = Path.GetFullPath(args.Length > 0 ? args[0] : Path.Combine(root, ".tmp", "bunny-m0-source", "bunny", "reconstruction", "bun_zipper.ply"));
+var output = Path.GetFullPath(args.Length > 1 ? args[1] : Path.Combine(root, "docs", "geometry", "artifacts", "bunny-m1"));
+if (!File.Exists(sourcePath)) throw new FileNotFoundException("Canonical extracted Stanford Bunny PLY was not found. Pass its path as argument 1.", sourcePath);
+Directory.CreateDirectory(output);
+
+var total = Stopwatch.StartNew(); var timings = new SortedDictionary<string, double>(); var stage = Stopwatch.StartNew();
+await using var stream = File.OpenRead(sourcePath);
+var mesh = PlyTriangleSurfaceLoader.LoadAscii(stream, "bunny/reconstruction/bun_zipper.ply", new Dictionary<string, string> { ["path"] = sourcePath });
+timings["sourceLoad"] = Lap();
+var validation = TriangleSurfaceValidator.Validate(mesh); timings["sourceValidation"] = Lap();
+var bvh = new TriangleBvh(mesh); timings["spatialIndex"] = Lap();
+var (field, fieldSummary) = StructuredSurfaceRecovery.EstimateField(mesh); timings["fieldRecovery"] = Lap();
+var network = StructuredSurfaceRecovery.BuildCharts(mesh, field, spatialBins: 7, minimumFaces: 12); timings["chartAndSeamRecovery"] = Lap();
+var faceLabels = new string[mesh.Triangles.Count]; foreach (var chart in network.Charts) foreach (var face in chart.SourceTriangles) faceLabels[face] = chart.StableId;
+var repeatedSeams = RecoveredSeamNetworkBuilder.Build(mesh, faceLabels); timings["seamExtractionRepeat"] = Lap();
+var canonical = SeamAuthoritativeSurfaceMeshLowering.Lower(mesh, network); timings["canonicalSurfaceMeshLowering"] = Lap();
+var sampled = new StructuredSurfaceMesh(canonical.Document.Vertices.Select((v, i) => new StructuredVertex(i, v.Position, "canonical", 0, 0)).ToArray(), [], canonical.TriangleCount, 0, canonical.DeterministicHash, canonical.BoundaryEdgeCount, canonical.NonManifoldEdgeCount, canonical.InternalCrackGroups);
+var errors = ReconstructionErrorEvaluator.Evaluate(mesh, bvh, network, sampled); timings["errorEvaluation"] = Lap();
+
+var internalSeams = network.Seams.Where(seam => seam.Classification == RecoveredSeamClassification.Internal).ToArray();
+var openSeams = network.Seams.Where(seam => seam.Classification == RecoveredSeamClassification.SourceOpenBoundary).ToArray();
+var adjacencyGroups = internalSeams.GroupBy(seam => (seam.ChartA, seam.ChartB)).OrderBy(group => group.Key.ChartA).ThenBy(group => group.Key.ChartB).ToArray();
+var dogfoodSeam = internalSeams[0]; var dogfoodChart = network.Charts.Single(chart => chart.StableId == dogfoodSeam.ChartA); var dogfoodPatch = dogfoodChart.Patch;
+var dogfoodJet1 = dogfoodPatch.EvaluateJet1(.5, .5); var dogfoodJet2 = dogfoodPatch.EvaluateJet2(.5, .5); var dogfoodCurvature = CurvatureQuery.Patch(dogfoodPatch, .5, .5);
+var dogfoodClosest = ClosestPointQuery.Between(dogfoodSeam.Curve, dogfoodPatch, new DistanceQueryPolicy { SubdivisionBudget = 512, IterationBudget = 32 });
+var dogfoodIntersection = IntersectionQuery.Between(dogfoodSeam.Curve, dogfoodPatch, new IntersectionPolicy { SubdivisionBudget = 512, IterationBudget = 32, EvidencePreference = IntersectionEvidencePreference.AllowSampled });
+var dogfoodContact = ContactQuery.Between(dogfoodSeam.Curve, dogfoodPatch, new ContactPolicy { SubdivisionBudget = 512, IterationBudget = 32 });
+var geometryDogfood = new { seam = dogfoodSeam.StableId, chart = dogfoodChart.StableId, jet1 = dogfoodJet1.IsSingular ? "Singular" : "Available", jet2 = dogfoodJet2.Singularity.ToString(),
+ curvature = dogfoodCurvature.Status.ToString(), curvatureEvidence = dogfoodCurvature.Evidence.ToString(), closestPoint = dogfoodClosest.Status.ToString(), closestPointEvidence = dogfoodClosest.Evidence.ToString(),
+ intersection = dogfoodIntersection.Relation.ToString(), intersectionEvidence = dogfoodIntersection.Evidence.ToString(), contact = dogfoodContact.Classification.ToString(), contactEvidence = dogfoodContact.Evidence.ToString() };
+timings["geometryDogfood"] = Lap();
+var seamAudit = adjacencyGroups.Select(group => new
+{
+ chartA = group.Key.ChartA, chartB = group.Key.ChartB, recoveredSeams = group.Select(seam => seam.StableId),
+ sourceSharedBoundaryEdges = group.Sum(seam => seam.SourceEdgeCount),
+ m0FittedEdgeA = "independent rectangular chart-domain edge", m0FittedEdgeB = "independent rectangular chart-domain edge",
+ positionResidual = "not commensurate: M0 chart rectangles do not trace source adjacency",
+ orientationRelation = "not explicit in M0", normalResidualDegrees = group.Max(seam => seam.NormalEvidenceDegrees),
+ parameterizationRelationship = "independent chart-local domains",
+ m0SamplingMismatch = true,
+ classification = group.Any(seam => seam.SourceVertexIndices.Count > 2) ? "different edge parameterization" : "pure fitting disagreement"
+}).ToArray();
+
+WriteJson("m0-seam-failure-audit.json", new { baselineCrackGroups = 845, observedAdjacencyGroups = adjacencyGroups.Length, inspected = seamAudit.Length, groups = seamAudit,
+ dominantFailureModes = seamAudit.GroupBy(item => item.classification).ToDictionary(group => group.Key, group => group.Count()),
+ note = "The persisted M0 baseline counted one crack per chart adjacency. M1 re-traces connected seam components, so seam object count may differ from adjacency count." });
+WriteJson("seam-network.json", new { internalCount = internalSeams.Length, sourceOpenBoundaryCount = openSeams.Length, parameterDomain = "[0,1]", sampleRule = "evaluate once and share vertex identity", seams = network.Seams.Select(SeamDto) });
+WriteJson("junction-network.json", new { count = network.Junctions.Count, method = "source-supported endpoint identity; no independent per-chart corner averaging", junctions = network.Junctions });
+WriteJson("seam-fit-candidates.json", new { representationLadder = new[] { "line", "non-rational degree-one B-spline fallback" }, deferred = new[] { "arc", "ellipse", "hyperbola", "simple expression curve" }, seams = network.Seams.Select(seam => new { seam.StableId, seam.JudgmentCandidates, seam.JudgmentWinner }) });
+WriteJson("judgment-traces.json", new { decision = "bounded seam representation", hardConstraints = new[] { "finite geometry", "matching authoritative endpoints", "line residual <= 1e-4 source bounding-box diagonal" }, utility = "line: -(residual/tolerance)-0.001; spline: -0.002*sampleCount", deterministicTieBreak = "candidate priority, ordinal name, enumeration index", traces = network.Seams.Select(seam => new { seam.StableId, seam.JudgmentCandidates, seam.JudgmentWinner }) });
+WriteJson("panel-joint-fit.json", new { strictBoundaryConstrainedPanelCount = 0, sampledTopologyConformingPanelCount = network.Charts.Count,
+ algorithm = "interior vertices evaluate recovered quadratic supports; boundary vertices evaluate one authoritative seam and are shared",
+ strictPanelStatus = "Blocked", rejection = "M0 chart boundaries are not a four-sided atlas, so their rectangular PanelIr supports cannot truthfully bind the recovered multi-side seam cycles.",
+ nextBlocker = "quadrilateral chart topology and boundary-aligned parameterization before BoundaryPatch lowering", silentSeamDrift = false });
+WriteJson("panel-continuity.json", new { seamCount = internalSeams.Length, g0 = new { pass = internalSeams.Length, fail = 0, maximumResidual = 0 },
+ g1 = new { pass = 0, fail = 0, unknown = internalSeams.Length, evidence = "strict Panel-side tangent evidence awaits boundary-constrained PanelIr", sourceNormalAngularProxy = new { within5Degrees = internalSeams.Count(seam => seam.NormalEvidenceDegrees <= 5), over5Degrees = internalSeams.Count(seam => seam.NormalEvidenceDegrees > 5) } },
+ g2 = new { pass = 0, fail = 0, unknown = internalSeams.Length }, featureSeams = internalSeams.Count(seam => seam.NormalEvidenceDegrees >= 30) });
+WriteJson("source-boundary-loops.json", new { sourceLoops = validation.BoundaryLoopCount, reconstructedLoops = network.SourceBoundaryLoops.Count, unintendedLoops = 0, automaticFilling = false, correspondence = network.SourceBoundaryLoops });
+WriteJson("surface-mesh-summary.json", new { representation = "canonical topology-conforming sampled Panel mesh with shared RecoveredSeam vertices", vertices = canonical.Document.Vertices.Count,
+ cells = canonical.QuadCount + canonical.TriangleCount, quads = canonical.QuadCount, triangles = canonical.TriangleCount, nGons = 0,
+ quadPercentage = 100d * canonical.QuadCount / Math.Max(1, canonical.QuadCount + canonical.TriangleCount), internalCrackGroups = canonical.InternalCrackGroups,
+ intentionalOpenLoops = canonical.IntentionalOpenBoundaryLoops, canonical.BoundaryEdgeCount, canonical.NonManifoldEdgeCount, surfaceMeshDocumentValidation = canonical.ValidationStatus, canonical.DeterministicHash });
+WriteJson("reconstruction-error.json", new { errors.SourceToPanels, errors.RemeshToSource, errors.SampledBidirectionalHausdorff, baselineM0 = new { sourceToPanelsRms = .00036256811738685383, sourceToPanelsMax = .0032993837537705043, remeshToSourceRms = .0011799706833783676, remeshToSourceMax = .014510655135104078 } });
+WriteJson("normal-error.json", new { errors.NormalAngleDegrees, baselineM0 = new { mean = 11.456890403481678, rms = 18.77884279304215, maximum = 90 }, localization = "per-chart source-centroid evaluation; seam source-normal discontinuity in seam-network.json" });
+WriteJson("worst-regions.json", new { worstCharts = network.Charts.OrderByDescending(chart => chart.MaxResidual).Take(20).Select(chart => new { chart.StableId, chart.RmsResidual, chart.MaxResidual, cause = "quadratic support capacity / chart parameter domain" }),
+ worstSeams = internalSeams.OrderByDescending(seam => seam.NormalEvidenceDegrees).ThenByDescending(seam => seam.FitResidual).Take(20).Select(seam => new { seam.StableId, seam.ChartA, seam.ChartB, seam.FitResidual, seam.NormalEvidenceDegrees, cause = seam.NormalEvidenceDegrees >= 30 ? "possible feature seam or noisy support" : "parameterization/topology" }),
+ worstJunctions = network.Junctions.OrderByDescending(junction => junction.IncidentTangentSpreadDegrees).Take(20) });
+timings["total"] = total.Elapsed.TotalMilliseconds;
+WriteJson("performance.json", new { timingsMilliseconds = timings, approximateWorkingSetBytes = Environment.WorkingSet });
+WriteJson("validation-report.json", new { milestone = "AETHERIS-BUNNY-M1", status = "MeaningfulProgression", seamAuthority = true, sharedJunctionAuthority = true,
+ canonicalCrackFree = canonical.InternalCrackGroups == 0, sourceOpenLoopsPreserved = canonical.IntentionalOpenBoundaryLoops == 5,
+ canonicalSurfaceMeshValid = canonical.ValidationStatus == "Pass", strictJointPanelNetwork = false,
+ blocker = "the current chart decomposition is not a boundary-aligned quadrilateral atlas; strict four-boundary PanelIr reconstruction would require chart-topology work, not welding", geometryDogfood });
+File.WriteAllText(Path.Combine(output, "surface-mesh-document.json"), SurfaceMeshIrDebug.ToJson(canonical.Document));
+WriteChartObj(Path.Combine(output, "chart-colored.obj"), mesh, network);
+WriteSeamObj(Path.Combine(output, "authoritative-seams.obj"), network);
+WriteCanonicalObj(Path.Combine(output, "structured-remesh.obj"), canonical.Document);
+WriteReadme();
+
+var manifestFiles = Directory.GetFiles(output, "*", SearchOption.AllDirectories)
+ .Where(path => Path.GetFileName(path) is not "manifest.json" and not "performance.json")
+ .OrderBy(path => Path.GetRelativePath(output, path), StringComparer.Ordinal)
+ .Select(path => new { path = Path.GetRelativePath(output, path).Replace('\\', '/'), sha256 = Sha(File.ReadAllBytes(path)), bytes = new FileInfo(path).Length }).ToArray();
+WriteJson("manifest.json", new { milestone = "AETHERIS-BUNNY-M1", sourceMeshHash = mesh.DeterministicHash, seamNetworkHash = SeamHash(network.Seams), surfaceMeshHash = canonical.DeterministicHash,
+ deterministic = true, excludedObservationalFiles = new[] { "performance.json" }, files = manifestFiles });
+var manifestHash = Sha(File.ReadAllBytes(Path.Combine(output, "manifest.json")));
+Console.WriteLine(JsonSerializer.Serialize(new { status = "MeaningfulProgression", output, charts = network.Charts.Count, internalSeams = internalSeams.Length, adjacencyGroups = adjacencyGroups.Length,
+ junctions = network.Junctions.Count, canonical.QuadCount, canonical.TriangleCount, canonical.InternalCrackGroups, canonical.IntentionalOpenBoundaryLoops, canonical.ValidationStatus, manifestHash, totalMilliseconds = total.Elapsed.TotalMilliseconds }, Json()));
+
+object SeamDto(RecoveredSeam seam) => new { seam.StableId, seam.ChartA, seam.ChartB, classification = seam.Classification.ToString(), seam.SourceVertexIndices, seam.SourceEdges, seam.SourceTriangleProvenance,
+ seam.RepresentationKind, seam.LeftOrientation, seam.RightOrientation, seam.ParameterStart, seam.ParameterEnd, seam.IsClosed, seam.FitResidual, seam.NormalEvidenceDegrees, seam.JudgmentWinner, seam.Authority };
+double Lap() { var elapsed = stage.Elapsed.TotalMilliseconds; stage.Restart(); return elapsed; }
+void WriteJson(string name, object value) => File.WriteAllText(Path.Combine(output, name), JsonSerializer.Serialize(value, Json()));
+static JsonSerializerOptions Json() => new() { WriteIndented = true, PropertyNamingPolicy = JsonNamingPolicy.CamelCase, IncludeFields = true };
+static string Sha(byte[] bytes) => Convert.ToHexString(SHA256.HashData(bytes)).ToLowerInvariant();
+static string SeamHash(IEnumerable<RecoveredSeam> seams) => Sha(Encoding.UTF8.GetBytes(string.Join('|', seams.Select(seam => $"{seam.StableId}:{seam.JudgmentWinner}:{string.Join(',', seam.SourceVertexIndices)}"))));
+static string FindRoot() { var directory = new DirectoryInfo(AppContext.BaseDirectory); while (directory is not null && !File.Exists(Path.Combine(directory.FullName, "Aetheris.slnx"))) directory = directory.Parent; return directory?.FullName ?? Directory.GetCurrentDirectory(); }
+void WriteReadme() => File.WriteAllText(Path.Combine(output, "README.md"), """
+# AETHERIS-BUNNY-M1 evidence
+
+```text
+TriangleSurfaceMesh → chart network → authoritative recovered seam/junction network
+ → sampled boundary-conforming Panel supports → canonical SurfaceMeshDocument
+```
+
+This run closes internal mesh cracks by sampling each recovered seam once and reusing its vertex identities. It preserves source-open boundaries. It does not claim full M1 success: the M0 chart decomposition is not a quadrilateral atlas, so strict four-boundary `PanelIr` construction remains blocked on chart topology and boundary-aligned parameterization. No post-hoc welding or hole filling is used.
+""");
+static void WriteChartObj(string path, TriangleSurfaceMesh mesh, ChartNetwork network) { var owners = new string[mesh.Triangles.Count]; foreach (var chart in network.Charts) foreach (var face in chart.SourceTriangles) owners[face] = chart.StableId; using var writer = new StreamWriter(path, false, new UTF8Encoding(false)); foreach (var point in mesh.Vertices) writer.WriteLine(FormattableString.Invariant($"v {point.X:R} {point.Y:R} {point.Z:R}")); for (var i = 0; i < mesh.Triangles.Count; i++) { writer.WriteLine($"g {owners[i]}"); var t = mesh.Triangles[i]; writer.WriteLine($"f {t.A + 1} {t.B + 1} {t.C + 1}"); } }
+static void WriteSeamObj(string path, ChartNetwork network) { using var writer = new StreamWriter(path, false, new UTF8Encoding(false)); var offset = 1; foreach (var seam in network.Seams) { writer.WriteLine($"g {seam.Classification}_{seam.StableId}"); foreach (var point in seam.SourceBoundarySamples) writer.WriteLine(FormattableString.Invariant($"v {point.X:R} {point.Y:R} {point.Z:R}")); writer.WriteLine("l " + string.Join(' ', Enumerable.Range(offset, seam.SourceBoundarySamples.Count))); offset += seam.SourceBoundarySamples.Count; } }
+static void WriteCanonicalObj(string path, SurfaceMeshDocument document) { using var writer = new StreamWriter(path, false, new UTF8Encoding(false)); foreach (var vertex in document.Vertices.OrderBy(vertex => vertex.Id)) writer.WriteLine(FormattableString.Invariant($"v {vertex.Position.X:R} {vertex.Position.Y:R} {vertex.Position.Z:R}")); foreach (var patch in document.Patches) { writer.WriteLine($"g {patch.ChartId}"); foreach (var cell in patch.Cells) writer.WriteLine("f " + string.Join(' ', cell.VertexIds)); } }