Next Gen STEP AP242 Native-ish BREP Geometric Modeling Kernel
Route sheet metal validation through the domain compiler
Yuechen Li4ea76f5b423c
diff --git a/Aetheris.CLI.Tests/SheetMetalCliTests.cs b/Aetheris.CLI.Tests/SheetMetalCliTests.csindex d3be1420..b1bcee6a 100644--- a/Aetheris.CLI.Tests/SheetMetalCliTests.cs+++ b/Aetheris.CLI.Tests/SheetMetalCliTests.cs@@ -43,6 +43,16 @@ public sealed class SheetMetalCliTestsfinally{if(File.Exists(temp))File.Delete(temp);}}+ [Fact]+ public void ValidateRoutesModuleShapedSheetMetalThroughDomainCompiler()+ {+ var output=new StringWriter();var error=new StringWriter();var input=Path.Combine(RepoRoot,"docs/modules/sheetmetal/artifacts/m8/ctc03-final.firmament");+ var exit=CliRunner.Run(["validate",input,"--json"],output,error);+ Assert.Equal(0,exit);Assert.Empty(error.ToString());+ using var json=JsonDocument.Parse(output.ToString());var validation=json.RootElement.GetProperty("sheetMetalValidation");+ Assert.Equal("valid",validation.GetProperty("status").GetString());Assert.Equal(7,validation.GetProperty("summary").GetProperty("bends").GetInt32());Assert.True(validation.GetProperty("summary").GetProperty("exactBlank").GetBoolean());+ }+[Fact]public void FlattenCtc03_WritesReimportableStepAndRecompilableRecoveredFirmament(){diff --git a/Aetheris.CLI/CliRunner.cs b/Aetheris.CLI/CliRunner.csindex 6a5500cf..2fbbb452 100644--- a/Aetheris.CLI/CliRunner.cs+++ b/Aetheris.CLI/CliRunner.cs@@ -1512,9 +1512,25 @@ Model CanonicalPanel {return 1;}+ var validationSource=File.ReadAllText(sourcePath);+ if(SheetMetalFirmament.LooksLikeSheetMetal(validationSource))+ {+ var sheet=SheetMetalFirmament.Compile(validationSource,Path.GetFullPath(sourcePath));+ var status=sheet.IsSuccess?"valid":"invalid";+ var payload=new+ {+ source=sourcePath,status,domain="SheetMetal",+ summary=new{fatalDiagnosticCount=sheet.Diagnostics.Count(x=>x.Severity==SheetMetalDiagnosticSeverity.Error),warningDiagnosticCount=sheet.Diagnostics.Count(x=>x.Severity==SheetMetalDiagnosticSeverity.Warning),regions=sheet.Part?.Regions.Count??0,bends=sheet.Part?.Bends.Count??0,features=sheet.Part?.Features.Count??0,exactBlank=sheet.FlatPattern?.ExactBlankContour is not null},+ diagnostics=sheet.Diagnostics+ };+ if(json)stdout.WriteLine(JsonSerializer.Serialize(new{sheetMetalValidation=payload},JsonOptions));+ else stdout.WriteLine($"Sheet Metal validation: {status} ({payload.summary.fatalDiagnosticCount} fatal, {payload.summary.warningDiagnosticCount} warning)");+ return sheet.IsSuccess?0:1;+ }+var runtimeConfiguration = CreateValidateForgeRuntimeConfiguration(forgePackPaths);var parse = FirmamentV2Parser.Parse(- File.ReadAllText(sourcePath),+ validationSource,Path.GetDirectoryName(Path.GetFullPath(sourcePath)),runtimeConfiguration.Catalog);var runtimeValidation = FirmamentV2RuntimeConceptValidation.Validate(parse.Document, runtimeConfiguration);diff --git a/Aetheris.SheetMetal.Tests/SheetMetalM11Tests.cs b/Aetheris.SheetMetal.Tests/SheetMetalM11Tests.csnew file mode 100644index 00000000..a4061d8a--- /dev/null+++ b/Aetheris.SheetMetal.Tests/SheetMetalM11Tests.cs@@ -0,0 +1,117 @@+using Aetheris.Kernel.Core.Brep;+using Aetheris.Kernel.Firmament.FirmamentV2;+using Aetheris.Kernel.Firmament.Materializer;+using Aetheris.Kernel.Core.Step242;+using Xunit;++namespace Aetheris.SheetMetal.Tests;++public sealed class SheetMetalM11Tests+{+ private const string ExplicitCoupon="""+ SheetMetal TerminationCoupon {+ Thickness: 1mm;+ Base Deck { Profile: Rectangle { Width: 80mm; Height: 50mm; }; }+ Flange Wall { From: Deck.Front; Height: 16mm; Angle: 90deg; Radius: 2mm; Direction: Up;+ StartTermination: Rounded; StartTerminationRadius: 2mm;+ EndTermination: Trimmed; EndTerminationSetback: 2mm; EndTerminationDepth: 1.5mm;+ }+ }+ """;++ [Fact]+ public void Explicit_terminations_are_stable_sheet_metal_semantics_with_profile_delta_lowering()+ {+ var result=SheetMetalFirmament.Compile(ExplicitCoupon);+ Assert.True(result.IsSuccess,string.Join('\n',result.Diagnostics.Select(x=>x.Message)));+ var bend=Assert.Single(result.Part!.Bends);+ Assert.Equal("WallBend.StartTermination",bend.StartTermination!.StableId);+ Assert.Equal(SheetBendTerminationTreatment.Rounded,bend.StartTermination.ResolvedTreatment);+ Assert.Equal(SheetBendTerminationTreatment.Trimmed,bend.EndTermination!.ResolvedTreatment);+ Assert.NotNull(bend.StartTermination.LoweredProfileDelta);+ Assert.Contains(bend.StartTermination.LoweredProfileDelta!.Members,x=>x.Kind==SemanticProfileDeltaMemberKind.Round);+ Assert.True(BrepExportPreflight.Validate(result.Part.FormedBody!).IsValid);+ Assert.Equal(FlatPatternStatus.Valid,result.FlatPattern!.Status);+ Assert.NotNull(result.FlatPattern.ExactBlankContour);+ var paths=SheetMetalConceptPaths.Inspect(result.Spec!,result.Part,result.FlatPattern).Select(x=>x.Path).ToArray();+ Assert.Contains("WallBend.StartTermination",paths);+ Assert.Contains("WallBend.EndTermination.Finish",paths);+ Assert.Equal(SheetMetalDfmStatus.Pass,SheetMetalDfm.Evaluate(result.Part,result.FlatPattern).Overall);+ var formedStep=Step242Exporter.ExportBody(result.Part.FormedBody!);Assert.True(formedStep.IsSuccess);Assert.True(Step242Importer.ImportBody(formedStep.Value).IsSuccess);+ var flatBody=SheetMetalManufacturingArtifacts.BuildFlatBody(result.Part,result.FlatPattern);Assert.True(flatBody.IsSuccess,string.Join('\n',flatBody.Diagnostics.Select(x=>x.Message)));+ var flatStep=Step242Exporter.ExportBody(flatBody.Body!);Assert.True(flatStep.IsSuccess);Assert.True(Step242Importer.ImportBody(flatStep.Value).IsSuccess);+ }++ [Fact]+ public void Auto_is_bounded_and_natural_remains_explicit()+ {+ const string source="""+ SheetMetal AutoCoupon {+ Thickness: 1mm;+ Base Deck { Profile: Rectangle { Width: 80mm; Height: 50mm; }; }+ Flange Wall { From: Deck.Front; Height: 16mm; Angle: 90deg; Radius: 2mm;+ StartTermination: Auto; EndTermination: Natural;+ }+ }+ """;+ var result=SheetMetalFirmament.Compile(source);+ Assert.True(result.IsSuccess,string.Join('\n',result.Diagnostics.Select(x=>x.Message)));+ var bend=Assert.Single(result.Part!.Bends);+ Assert.True(bend.StartTermination!.IsPolicyDerived);+ Assert.Equal(SheetBendTerminationTreatment.Rounded,bend.StartTermination.ResolvedTreatment);+ Assert.Equal(SheetBendTerminationTreatment.Natural,bend.EndTermination!.ResolvedTreatment);+ Assert.Null(bend.EndTermination.LoweredProfileDelta);+ }++ [Fact]+ public void Auto_refuses_when_no_safe_treatment_fits_and_corner_conflict_names_both_operations()+ {+ const string refused="""+ SheetMetal UnsafeCoupon {+ Thickness: 1mm;+ Base Deck { Profile: Rectangle { Width: 8mm; Height: 8mm; }; }+ Flange Wall { From: Deck.Front; Height: 3.1mm; Angle: 90deg; Radius: 2mm; StartTermination: Auto; StartTerminationRadius: 4mm; }+ }+ """;+ var rejected=SheetMetalFirmament.Compile(refused);+ Assert.False(rejected.IsSuccess);+ Assert.Contains(rejected.Diagnostics,x=>x.Code=="sheetmetal-bend-termination-auto-refused"&&x.Message.Contains("WallBend.StartTermination",StringComparison.Ordinal));++ const string conflict="""+ Concept Struct Layout { CornerProfile Wall.RootStart { Round Manual { Radius: 2mm; } } }+ SheetMetal ConflictCoupon {+ Thickness: 1mm;+ Base Deck { Profile: Rectangle { Width: 80mm; Height: 50mm; }; }+ Flange Wall { From: Deck.Front; Height: 16mm; Angle: 90deg; Radius: 2mm; StartTermination: Rounded; StartTerminationRadius: 2mm; }+ }+ """;+ var conflicted=SheetMetalFirmament.Compile(conflict);+ Assert.False(conflicted.IsSuccess);+ Assert.Contains(conflicted.Diagnostics,x=>x.Code=="sheetmetal-bend-termination-conflict"&&x.Message.Contains("WallBend.StartTermination",StringComparison.Ordinal)&&x.Message.Contains("Layout.Wall.RootStart",StringComparison.Ordinal));++ const string deltaConflict="""+ ProfileDelta ManualRootTrim { On: Wall.Root; Anchor: FromStart 0mm; Side: Inward; Level Carrier { Offset: 0mm; } Level Cut { Offset: 1mm; } Transition Enter { Kind: Diagonal; Run: 1mm; To: Cut; } Transition Exit { Kind: Step; To: Carrier; } }+ SheetMetal DeltaConflictCoupon { Thickness: 1mm; Base Deck { Profile: Rectangle { Width: 80mm; Height: 50mm; }; } Flange Wall { From: Deck.Front; Height: 16mm; Angle: 90deg; Radius: 2mm; StartTermination: Trimmed; StartTerminationSetback: 1mm; } }+ """;+ var deltaConflicted=SheetMetalFirmament.Compile(deltaConflict);+ Assert.False(deltaConflicted.IsSuccess);+ Assert.Contains(deltaConflicted.Diagnostics,x=>x.Code=="sheetmetal-bend-termination-profile-delta-conflict"&&x.Message.Contains("ManualRootTrim",StringComparison.Ordinal)&&x.Message.Contains("WallBend.StartTermination",StringComparison.Ordinal));+ }++ [Fact]+ public void Ctc03_owns_four_side_wall_bend_terminations_without_feature_or_bend_regression()+ {+ var root=FindRepoRoot();var path=Path.Combine(root,"docs/modules/sheetmetal/artifacts/m8/ctc03-final.firmament");+ var result=SheetMetalFirmament.CompileFile(path);+ Assert.True(result.IsSuccess,string.Join('\n',result.Diagnostics.Select(x=>x.Message)));+ var terminations=result.Part!.Bends.SelectMany(x=>new[]{x.StartTermination,x.EndTermination}).OfType<SheetBendTerminationIr>().ToArray();+ Assert.Equal(4,terminations.Length);Assert.All(terminations,x=>Assert.Equal(SheetBendTerminationTreatment.Trimmed,x.ResolvedTreatment));+ Assert.Equal(7,result.Part.Bends.Count);Assert.Equal(17,result.Part.Features.Count);+ Assert.Equal(FlatPatternStatus.Valid,result.FlatPattern!.Status);Assert.NotNull(result.FlatPattern.ExactBlankContour);+ Assert.True(BrepExportPreflight.Validate(result.Part.FormedBody!).IsValid);+ Assert.Contains("source-independent",result.Part.Provenance,StringComparison.OrdinalIgnoreCase);+ Assert.Equal(SheetMetalDfmStatus.Pass,SheetMetalDfm.Evaluate(result.Part,result.FlatPattern).Overall);+ }++ private static string FindRepoRoot(){var dir=new DirectoryInfo(AppContext.BaseDirectory);while(dir is not null&&!File.Exists(Path.Combine(dir.FullName,"Aetheris.slnx")))dir=dir.Parent;return dir?.FullName??throw new InvalidOperationException("Repo root not found.");}+}diff --git a/Aetheris.SheetMetal/SheetMetalAuthoredLowering.cs b/Aetheris.SheetMetal/SheetMetalAuthoredLowering.csindex 2284921b..79e7f46f 100644--- a/Aetheris.SheetMetal/SheetMetalAuthoredLowering.cs+++ b/Aetheris.SheetMetal/SheetMetalAuthoredLowering.cs@@ -23,7 +23,10 @@ public sealed record AuthoredSheetFlangeSpec(string Name, string ParentRegion, string EdgeName, double Length, double AngleRadians,double InsideRadius, SheetBendDirection Direction, SheetCornerPolicy CornerPolicy,SheetReliefPolicy ReliefPolicy, double? ReliefWidth = null, double? ReliefDepth = null,- double? SpanLength = null, double SpanOffset = 0d);+ double? SpanLength = null, double SpanOffset = 0d,+ AuthoredSheetTerminationSpec? StartTermination = null, AuthoredSheetTerminationSpec? EndTermination = null);+public sealed record AuthoredSheetTerminationSpec(+ SheetBendTerminationTreatment Treatment,double? Setback=null,double? Depth=null,double? Radius=null);public sealed record AuthoredSheetCutSpec(string Name, string RegionName, SheetFeatureKind Kind, double X, double Y,double? Diameter, double? Width, double? Length, bool ExactCapsule = false);@@ -117,6 +120,25 @@ internal static class AuthoredSheetMetalCompilerScalar(block.Body, "ReliefDepth", "mm", out var reliefDepth);var hasSpan=Scalar(block.Body, "Span", "mm", out var spanLength);var hasSpanOffset=Scalar(block.Body, "SpanOffset", "mm", out var spanOffset);+ AuthoredSheetTerminationSpec? Termination(string end)+ {+ var token=Token(block.Body,$"{end}Termination");if(token is null)return null;+ var treatment=token.ToLowerInvariant() switch+ {+ "natural" or "none"=>SheetBendTerminationTreatment.Natural,+ "trimmed" or "trim"=>SheetBendTerminationTreatment.Trimmed,+ "rounded" or "round"=>SheetBendTerminationTreatment.Rounded,+ "auto"=>SheetBendTerminationTreatment.Auto,+ _=>throw new FormatException($"Flange '{block.Name}' has unsupported {end}Termination '{token}'. Supported: Natural, Trimmed, Rounded, Auto.")+ };+ Scalar(block.Body,$"{end}TerminationSetback","mm",out var setback);+ Scalar(block.Body,$"{end}TerminationDepth","mm",out var depth);+ Scalar(block.Body,$"{end}TerminationRadius","mm",out var terminationRadius);+ return new(treatment,setback>0?setback:null,depth>0?depth:null,terminationRadius>0?terminationRadius:null);+ }+ AuthoredSheetTerminationSpec? startTermination;AuthoredSheetTerminationSpec? endTermination;+ try{startTermination=Termination("Start");endTermination=Termination("End");}+ catch(FormatException ex){return Fail(ex.Message,"sheetmetal-bend-termination-treatment-invalid");}if(radius<0||degrees is <=0 or >=180)return Fail($"Flange '{block.Name}' has an invalid radius or bend angle.");if(length<=radius+thickness)return Fail($"Flange '{block.Name}' length {length:G6} mm is not greater than inside radius + thickness ({radius+thickness:G6} mm). Increase `{block.Name}` Height/Length above {radius+thickness:G6} mm.",legacyBase.Success?"sheetmetal-firmament-invalid":SheetMetalDiagnosticCodes.FlangeBelowMinimum);if(hasSpan&&spanLength<=0)return Fail($"Flange '{block.Name}' Span must be positive when supplied.","sheetmetal-flange-span-invalid");@@ -125,7 +147,7 @@ internal static class AuthoredSheetMetalCompilerflanges.Add(new(block.Name, parentName, NormalizeEdge(authoredMember), length,degrees * Math.PI / 180d, radius, direction, corner, relief,reliefWidth > 0 ? reliefWidth : null, reliefDepth > 0 ? reliefDepth : null,- spanLength > 0 ? spanLength : null, spanOffset));+ spanLength > 0 ? spanLength : null, spanOffset,startTermination,endTermination));}if (flanges.Count == 0) return Fail("At least one Flange is required.");var duplicate = flanges.GroupBy(f => (f.ParentRegion.ToLowerInvariant(), f.EdgeName.ToLowerInvariant())).FirstOrDefault(g => g.Count() > 1);@@ -276,6 +298,10 @@ internal static class AuthoredSheetMetalLowering// base corner, but must not silently shorten this authored flange edge.if((spec.SemanticLayout.Corners??[]).Any(c=>c.Region.Equals(flange.Name,StringComparison.OrdinalIgnoreCase)&&(c.Corner.Equals("OuterEnd",StringComparison.OrdinalIgnoreCase)||c.Corner.Equals("RootStart",StringComparison.OrdinalIgnoreCase))))gapStart=0;if((spec.SemanticLayout.Corners??[]).Any(c=>c.Region.Equals(flange.Name,StringComparison.OrdinalIgnoreCase)&&(c.Corner.Equals("OuterStart",StringComparison.OrdinalIgnoreCase)||c.Corner.Equals("RootEnd",StringComparison.OrdinalIgnoreCase))))gapEnd=0;+ // A first-class bend-end treatment is the final authority for+ // finite root extent, after ordinary profile-corner compatibility.+ if(flange.StartTermination is { } start)gapStart=start.Treatment==SheetBendTerminationTreatment.Natural?0:start.Setback??start.Radius??t;+ if(flange.EndTermination is { } end)gapEnd=end.Treatment==SheetBendTerminationTreatment.Natural?0:end.Setback??end.Radius??t;}if (gapStart + gapEnd >= edgeLength - 1e-8) return Failure($"Corner trims consume base edge {spec.Base.Name}.{edgeName}.", SheetMetalDiagnosticCodes.ImpossibleTopology);var axis = Unit(edge.B - edge.A); var a = edge.A + axis * gapStart; var b = edge.B - axis * gapEnd;@@ -349,6 +375,38 @@ internal static class AuthoredSheetMetalLoweringvar rootEndProgram=cornerPrograms.SingleOrDefault(x=>x.Corner.Equals("RootEnd",StringComparison.OrdinalIgnoreCase));var outerStartProgram=cornerPrograms.SingleOrDefault(x=>x.Corner.Equals("OuterStart",StringComparison.OrdinalIgnoreCase));var outerEndProgram=cornerPrograms.SingleOrDefault(x=>x.Corner.Equals("OuterEnd",StringComparison.OrdinalIgnoreCase));+ var bendSemanticId=spec.LegacySyntax?$"bend-{flange.EdgeName.ToLowerInvariant()}":$"{flange.Name}Bend";+ (AuthoredSheetTerminationSpec Authored,SheetBendTerminationTreatment Resolved,double Setback,double Depth,double? Radius,SemanticProfileDeltaIr? Delta,SheetMetalSemanticCornerProfile? Corner) ResolveTermination(AuthoredSheetTerminationSpec authored,SheetBendEnd bendEnd)+ {+ var resolved=authored.Treatment==SheetBendTerminationTreatment.Auto?SheetBendTerminationTreatment.Rounded:authored.Treatment;+ double? radius=resolved==SheetBendTerminationTreatment.Rounded?(authored.Radius??Math.Min(flange.InsideRadius,Math.Min(flange.Length/4d,(edge.B-edge.A).Length/4d))):null;+ var setback=authored.Setback??radius??t;var depth=authored.Depth??radius??t;+ if(!double.IsFinite(setback)||!double.IsFinite(depth)||setback<=0||depth<=0||setback>=flange.Length-1e-8||depth>=(edge.B-edge.A).Length-1e-8||radius is <=0)+ throw new InvalidOperationException($"{bendSemanticId}.{bendEnd}Termination has no safe bounded {resolved} treatment: setback={setback:G9}, depth={depth:G9}, radius={radius:G9}; the treatment must remain inside the finite root and adjacent flange profile.");+ if(authored.Treatment==SheetBendTerminationTreatment.Auto&&radius<t/2d)+ throw new InvalidOperationException($"{bendSemanticId}.{bendEnd}Termination Auto refused: no rounded candidate with radius at least {t/2d:G9} mm fits the bounded root neighborhood.");+ if(resolved==SheetBendTerminationTreatment.Natural)return(authored,resolved,0,0,null,null,null);+ var path=$"{bendSemanticId}.{bendEnd}Termination";var finish=$"{path}.Finish";+ var levels=new[]{new SemanticProfileDeltaLevelIr("Carrier",$"{path}.Carrier",0,"Sheet Metal bend termination"),new SemanticProfileDeltaLevelIr("Trimmed",$"{path}.Trimmed",depth,"Sheet Metal bend termination")};+ SemanticProfileDeltaMemberIr[] members=resolved==SheetBendTerminationTreatment.Rounded+ ?[new("EnterRound",$"{path}.EnterRound",SemanticProfileDeltaMemberKind.Round,setback,"Trimmed",null,[],"Sheet Metal bend termination",radius),new("Return",$"{path}.Return",SemanticProfileDeltaMemberKind.Step,0,"Carrier",null,[],"Sheet Metal bend termination")]+ :[new("Enter",$"{path}.Enter",SemanticProfileDeltaMemberKind.Diagonal,setback,"Trimmed",null,[],"Sheet Metal bend termination"),new("Return",$"{path}.Return",SemanticProfileDeltaMemberKind.Step,0,"Carrier",null,[],"Sheet Metal bend termination")];+ var anchor=new SemanticEdgeAnchorIr(bendEnd==SheetBendEnd.Start?SemanticEdgeAnchorKind.FromStart:SemanticEdgeAnchorKind.FromEnd,0);+ var delta=new SemanticProfileDeltaIr($"{bendEnd}Termination",path,anchor,-1,levels,members,"Sheet Metal bend/root termination treatment");+ var operation=resolved==SheetBendTerminationTreatment.Rounded?"Round":"NotchCorner";+ var corner=resolved==SheetBendTerminationTreatment.Rounded?new SheetMetalSemanticCornerProfile(path,finish,flange.Name,bendEnd==SheetBendEnd.Start?"RootStart":"RootEnd",operation,radius!.Value,radius.GetValueOrDefault()):null;+ return(authored,resolved,setback,depth,radius,delta,corner);+ }+ (AuthoredSheetTerminationSpec Authored,SheetBendTerminationTreatment Resolved,double Setback,double Depth,double? Radius,SemanticProfileDeltaIr? Delta,SheetMetalSemanticCornerProfile? Corner)? startTermination=null,endTermination=null;+ try+ {+ if(flange.StartTermination is not null)startTermination=ResolveTermination(flange.StartTermination,SheetBendEnd.Start);+ if(flange.EndTermination is not null)endTermination=ResolveTermination(flange.EndTermination,SheetBendEnd.End);+ }+ catch(InvalidOperationException ex){return Failure(ex.Message,"sheetmetal-bend-termination-auto-refused");}+ if(startTermination?.Corner is not null&&rootStartProgram is not null)return Failure($"Bend termination '{bendSemanticId}.StartTermination' conflicts with CornerProfile '{rootStartProgram.CornerPath}'; explicit overlapping semantic profile operations are not composed silently.","sheetmetal-bend-termination-conflict");+ if(endTermination?.Corner is not null&&rootEndProgram is not null)return Failure($"Bend termination '{bendSemanticId}.EndTermination' conflicts with CornerProfile '{rootEndProgram.CornerPath}'; explicit overlapping semantic profile operations are not composed silently.","sheetmetal-bend-termination-conflict");+ rootStartProgram=startTermination?.Corner??rootStartProgram;rootEndProgram=endTermination?.Corner??rootEndProgram;ResolvedSemanticCornerProfileIr? ResolveCorner(SheetMetalSemanticCornerProfile? program){if(program is null)return null;@@ -425,15 +483,28 @@ internal static class AuthoredSheetMetalLoweringregions.Add(new(flangeId, SheetRegionKind.Planar, Developable("Authored planar flange."), plane, null, boundary, (edge.B-edge.A).Length * flange.Length+fragmentArea, source, evidence,exactContour));patches.Add(PlanePatch(flangeId, SheetRegionKind.Planar, boundary, normal, t,plane,exactContour));- var bendId = spec.LegacySyntax ? $"bend-{flange.EdgeName.ToLowerInvariant()}" : $"{flange.Name}Bend"; var bendRegionId = spec.LegacySyntax ? $"region-{flange.EdgeName.ToLowerInvariant()}-bend" : $"{flange.Name}BendRegion"; var centerA = edge.A + parentNormal * (sign * rMid); var center = Mid(centerA, edge.B + parentNormal * (sign * rMid));+ var bendId = bendSemanticId; var bendRegionId = spec.LegacySyntax ? $"region-{flange.EdgeName.ToLowerInvariant()}-bend" : $"{flange.Name}BendRegion"; var centerA = edge.A + parentNormal * (sign * rMid); var center = Mid(centerA, edge.B + parentNormal * (sign * rMid));var cylinder = new SheetCylinderReference(center, axis, rMid, flange.InsideRadius, angle, (edge.B-edge.A).Length, sign > 0);var bendBoundary = new[] { edge.A, edge.B, tangentB, tangentA };regions.Add(new(bendRegionId, SheetRegionKind.CylindricalBend, Developable("Authored analytic cylindrical bend."), null, cylinder, bendBoundary, angle * rMid * cylinder.AxisLength, source, evidence));+ SheetBendTerminationIr? Termination((AuthoredSheetTerminationSpec Authored,SheetBendTerminationTreatment Resolved,double Setback,double Depth,double? Radius,SemanticProfileDeltaIr? Delta,SheetMetalSemanticCornerProfile? Corner)? value,SheetBendEnd bendEnd,Point3D point)+ {+ if(value is null)return null;var v=value.Value;var path=$"{bendId}.{bendEnd}Termination";+ var neighbor=flange.ParentRegion.Equals(spec.Base.Name,StringComparison.OrdinalIgnoreCase)?$"{spec.Base.Name}.{(bendEnd==SheetBendEnd.Start?Previous(flange.EdgeName):Next(flange.EdgeName))}":$"{flange.ParentRegion}.{flange.EdgeName}.{bendEnd}";+ return new(path,bendId,bendEnd,point,stableRegions[flange.ParentRegion],neighbor,v.Authored.Treatment,v.Resolved,v.Setback,v.Depth,v.Radius,v.Authored.Treatment==SheetBendTerminationTreatment.Auto,v.Delta,source,+ [new(v.Authored.Treatment==SheetBendTerminationTreatment.Auto?SheetEvidenceKind.Derived:SheetEvidenceKind.Authored,"bend-end-termination",v.Authored.Treatment==SheetBendTerminationTreatment.Auto?$"Bounded Auto selected {v.Resolved}; invalid candidates are rejected before selection.":$"Explicit {v.Resolved} bend-end treatment.",v.Radius??v.Setback)]);+ }+ var startTerminationIr=Termination(startTermination,SheetBendEnd.Start,edge.A);var endTerminationIr=Termination(endTermination,SheetBendEnd.End,edge.B);bends.Add(new(bendId, center, axis, angle, flange.InsideRadius, t, flange.Direction, stableRegions[flange.ParentRegion], flangeId, SheetNeutralAxisPolicy.KFactorPolicy(spec.KFactor), source,- [new(SheetEvidenceKind.Authored, "bend-intent", "Axis, angle, inside radius, direction, and adjacency derive from the high-level flange declaration.")]));+ [new(SheetEvidenceKind.Authored, "bend-intent", "Axis, angle, inside radius, direction, and adjacency derive from the high-level flange declaration.")],startTerminationIr,endTerminationIr));patches.Add(BendPatch(bendRegionId, edge, parentNormal, flange, t));correspondence.Add(new(flange.Name, "Region", flangeId, $"flat-{flangeId}"));correspondence.Add(new(bendId, "Bend", bendRegionId, $"flat-{bendId}"));+ foreach(var termination in new[]{startTerminationIr,endTerminationIr}.OfType<SheetBendTerminationIr>())+ {+ correspondence.Add(new(termination.StableId,"BendTermination",termination.StableId,$"flat-{termination.StableId}"));+ if(termination.LoweredProfileDelta is not null)foreach(var member in termination.LoweredProfileDelta.Members)correspondence.Add(new(member.StableId,"BendTerminationProfileDeltaMember",member.StableId,$"flat-{member.StableId}"));+ }}if (!progressed) break;}diff --git a/Aetheris.SheetMetal/SheetMetalConceptPaths.cs b/Aetheris.SheetMetal/SheetMetalConceptPaths.csindex 84ddb2a3..8fa8237c 100644--- a/Aetheris.SheetMetal/SheetMetalConceptPaths.cs+++ b/Aetheris.SheetMetal/SheetMetalConceptPaths.cs@@ -33,6 +33,13 @@ public static class SheetMetalConceptPathsAdd($"{flange.Name}.LeftCorner","SheetCorner",$"{flange.Name}.LeftCorner",region?.StableId,$"flat-{region?.StableId}","canonical flange endpoint","CornerAdjacent");Add($"{flange.Name}.RightCorner","SheetCorner",$"{flange.Name}.RightCorner",region?.StableId,$"flat-{region?.StableId}","canonical flange endpoint","CornerAdjacent");Add($"{flange.Name}.Bend","SheetBend",$"{flange.Name}.Bend",bend?.StableId,$"flat-{bend?.StableId}","authored flange bend","BendBoundary","FlatCorrespondent");+ foreach(var termination in new[]{bend?.StartTermination,bend?.EndTermination}.OfType<SheetBendTerminationIr>())+ {+ Add(termination.StableId,"SheetBendTermination",termination.StableId,termination.BendId,$"flat-{termination.StableId}","stable finite bend/root endpoint treatment authority","BendEnd","ManufacturingContour","StableSemanticIdentity","DrawingAnchor");+ Add($"{termination.StableId}.Finish","SheetBendTerminationFinish",$"{termination.StableId}.Finish",termination.AdjacentRegionId,$"flat-{termination.StableId}.Finish",$"{termination.ResolvedTreatment} treatment lowered through semantic ProfileDelta","ManufacturingContour","StableSemanticIdentity");+ if(termination.LoweredProfileDelta is not null)foreach(var member in termination.LoweredProfileDelta.Members)+ Add(member.StableId,"SemanticProfileDeltaMember",member.StableId,termination.AdjacentRegionId,$"flat-{member.StableId}","exact descendant of bend termination ProfileDelta lowering","ManufacturingContour","StableSemanticIdentity");+ }}foreach(var cut in spec.Cuts){@@ -74,6 +81,7 @@ public static class SheetMetalConceptPaths{"SheetRegion.Rectangle"=>["Front","Right","Rear","Left","Center"],"SheetFlange"=>["Root","Outer","Left","Right","LeftCorner","RightCorner","Bend"],+ "SheetBend"=>["StartTermination","EndTermination"],_=>[]};}diff --git a/Aetheris.SheetMetal/SheetMetalDfm.cs b/Aetheris.SheetMetal/SheetMetalDfm.csindex 8b43a912..2d679617 100644--- a/Aetheris.SheetMetal/SheetMetalDfm.cs+++ b/Aetheris.SheetMetal/SheetMetalDfm.cs@@ -6,7 +6,9 @@ public sealed record SheetMetalDfmPolicy(double MinimumInsideRadiusRatio = 1d,double MinimumHoleToBendDistanceFactor = 2d,double MinimumEdgeDistanceFactor = 1.5d,- double MinimumFlangeBeyondTangentFactor = 1d);+ double MinimumFlangeBeyondTangentFactor = 1d,+ bool ProhibitNaturalBendTerminations = false,+ double MinimumTerminationRadiusFactor = 0.5d);public enum SheetMetalDfmStatus { Pass, Warning, Fail, NotEvaluated }@@ -37,6 +39,17 @@ public static class SheetMetalDfmfindings.Add(new("sheetmetal-dfm-inside-radius-ratio",pass?SheetMetalDfmStatus.Pass:SheetMetalDfmStatus.Warning,$"Inside-radius/thickness ratio {ratio:G4} {(pass?"meets":"is below")} the parameterized experimental policy {policy.MinimumInsideRadiusRatio:G4}.",bend.StableId,ratio,policy.MinimumInsideRadiusRatio));var flange=part.Regions.FirstOrDefault(r=>r.StableId==bend.AdjacentRegionB);var axisLength=part.Regions.Where(r=>r.Cylinder is not null).OrderBy(r=>Math.Abs(r.Cylinder!.InsideRadius-bend.InsideRadius)+(1-Math.Abs(r.Cylinder.AxisDirection.Dot(bend.AxisDirection)))*1000).FirstOrDefault()?.Cylinder?.AxisLength??0;var flangeLength=flange is null||axisLength<=0?double.NaN:flange.ApproximateArea/axisLength;var requiredFlange=bend.InsideRadius+part.Thickness*policy.MinimumFlangeBeyondTangentFactor;var flangePass=double.IsNaN(flangeLength)||flangeLength>=requiredFlange;findings.Add(new("sheetmetal-dfm-minimum-flange-length",double.IsNaN(flangeLength)?SheetMetalDfmStatus.NotEvaluated:flangePass?SheetMetalDfmStatus.Pass:SheetMetalDfmStatus.Warning,double.IsNaN(flangeLength)?$"'{bend.AdjacentRegionB}' flange length could not be derived.":$"'{bend.AdjacentRegionB}' tangent-to-edge length is {flangeLength:G4} mm; policy requires {requiredFlange:G4} mm.",bend.AdjacentRegionB,double.IsNaN(flangeLength)?null:flangeLength,requiredFlange,!flangePass?$"Increase {bend.AdjacentRegionB} Height/Length by at least {requiredFlange-flangeLength:G4} mm.":null));+ foreach(var termination in new[]{bend.StartTermination,bend.EndTermination}.OfType<SheetBendTerminationIr>())+ {+ var natural=termination.ResolvedTreatment==SheetBendTerminationTreatment.Natural;+ var required=part.Thickness*policy.MinimumTerminationRadiusFactor;+ var measured=termination.ResolvedTreatment==SheetBendTerminationTreatment.Rounded?termination.Radius:termination.Setback;+ var valid=natural?!policy.ProhibitNaturalBendTerminations:measured is not null&&measured>=required&&termination.LoweredProfileDelta is not null;+ findings.Add(new("sheetmetal-dfm-bend-end-termination",valid?SheetMetalDfmStatus.Pass:SheetMetalDfmStatus.Warning,+ natural?(valid?$"'{termination.StableId}' intentionally preserves its natural bend end.":$"'{termination.StableId}' uses Natural treatment while policy prohibits an untreated sharp termination."):+ valid?$"'{termination.StableId}' has bounded {termination.ResolvedTreatment} treatment with exact ProfileDelta ancestry.":$"'{termination.StableId}' has insufficient {termination.ResolvedTreatment} treatment.",+ termination.StableId,measured,required,valid?null:natural?$"Use Rounded with radius >= {required:G4} mm or an engineer-approved Trimmed treatment.":$"Increase {termination.StableId}.Finish to at least {required:G4} mm without intersecting neighboring features."));+ }}foreach(var corner in part.Corners??[]){diff --git a/Aetheris.SheetMetal/SheetMetalFlattener.cs b/Aetheris.SheetMetal/SheetMetalFlattener.csindex 18b66026..35181a97 100644--- a/Aetheris.SheetMetal/SheetMetalFlattener.cs+++ b/Aetheris.SheetMetal/SheetMetalFlattener.cs@@ -299,10 +299,15 @@ public static class SheetMetalFlattenerif(a[ai].Geometry is not LineArcLineSegment2D al)continue;for(var bi=0;bi<b.Count;bi++){- if(b[bi].Geometry is not LineArcLineSegment2D bl||!Near(al.Start,bl.End)||!Near(al.End,bl.Start))continue;+ if(b[bi].Geometry is not LineArcLineSegment2D bl)continue;+ var exact=Near(al.Start,bl.End)&&Near(al.End,bl.Start);+ var partial=!exact&&OppositeCollinearSubset(al,bl,out var atEnd,out var atStart);+ if(!exact&&!partial)continue;var segments=new List<PlanarContourSegment2>(a.Count+b.Count-2);for(var offset=1;offset<a.Count;offset++)segments.Add(a[(ai+offset)%a.Count]);+ if(partial&&!Near(al.Start,bl.End))segments.Add(a[ai] with { StableId=$"{a[ai].StableId}.termination-before",Geometry=new LineArcLineSegment2D(al.Start,bl.End) });for(var offset=1;offset<b.Count;offset++)segments.Add(b[(bi+offset)%b.Count]);+ if(partial&&!Near(bl.Start,al.End))segments.Add(a[ai] with { StableId=$"{a[ai].StableId}.termination-after",Geometry=new LineArcLineSegment2D(bl.Start,al.End) });var candidate=accumulated with{OuterLoop=accumulated.OuterLoop with { Segments=segments },@@ -314,6 +319,15 @@ public static class SheetMetalFlattener}merged=accumulated;return false;static bool Near((double X,double Y) x,(double X,double Y) y)=>Math.Abs(x.X-y.X)<=tolerance&&Math.Abs(x.Y-y.Y)<=tolerance;+ static bool OppositeCollinearSubset(LineArcLineSegment2D carrier,LineArcLineSegment2D attached,out double attachedEnd,out double attachedStart)+ {+ attachedEnd=attachedStart=0;var dx=carrier.End.X-carrier.Start.X;var dy=carrier.End.Y-carrier.Start.Y;var length2=dx*dx+dy*dy;if(length2<=tolerance*tolerance)return false;+ double Cross((double X,double Y) p)=>(p.X-carrier.Start.X)*dy-(p.Y-carrier.Start.Y)*dx;+ if(Math.Abs(Cross(attached.Start))>tolerance*Math.Sqrt(length2)||Math.Abs(Cross(attached.End))>tolerance*Math.Sqrt(length2))return false;+ double T((double X,double Y) p)=>((p.X-carrier.Start.X)*dx+(p.Y-carrier.Start.Y)*dy)/length2;+ attachedEnd=T(attached.End);attachedStart=T(attached.Start);+ return attachedEnd>=-tolerance&&attachedEnd<=1+tolerance&&attachedStart>=-tolerance&&attachedStart<=1+tolerance&&attachedEnd<attachedStart-tolerance;+ }}private static IReadOnlyList<SheetPoint2> ContourVertices(PlanarContour2 contour)=>contour.OuterLoop.Segments.Select(segment=>segment.Geometry switch{diff --git a/Aetheris.SheetMetal/SheetMetalIr.cs b/Aetheris.SheetMetal/SheetMetalIr.csindex e11c921e..597f3be6 100644--- a/Aetheris.SheetMetal/SheetMetalIr.cs+++ b/Aetheris.SheetMetal/SheetMetalIr.cs@@ -1,6 +1,7 @@using Aetheris.Kernel.Core.Brep;using Aetheris.Kernel.Core.Math;using Aetheris.Kernel.Firmament.Materializer;+using Aetheris.Kernel.Firmament.FirmamentV2;using Aetheris.Surfacing;namespace Aetheris.SheetMetal;@@ -22,6 +23,8 @@ public enum SheetCornerPolicy { Open, Mitered, RectangularRelief, RoundRelief, Rpublic enum SheetReliefPolicy { None, Auto, Rectangular, Round }public enum SheetFlangeLengthMode { TangentToEdge }public enum SheetPathCapability { FlangeAttachable, BendAttachable, FeatureAttachable }+public enum SheetBendEnd { Start, End }+public enum SheetBendTerminationTreatment { Natural, Trimmed, Rounded, Auto }public static class SheetMetalDiagnosticCodes{@@ -126,6 +129,30 @@ public sealed record SheetBendIr(string AdjacentRegionB,SheetNeutralAxisPolicy NeutralAxisPolicy,SheetSourceBinding Source,+ IReadOnlyList<SheetEvidence> Evidence,+ SheetBendTerminationIr? StartTermination = null,+ SheetBendTerminationIr? EndTermination = null);++/// <summary>+/// Stable semantic identity for the end of a finite bend/root. The treatment is+/// Sheet Metal intent; LoweredProfileDelta records the exact, reusable 2D contour+/// program selected for the adjacent planar profile.+/// </summary>+public sealed record SheetBendTerminationIr(+ string StableId,+ string BendId,+ SheetBendEnd End,+ Point3D RootPoint,+ string AdjacentRegionId,+ string NeighborBoundary,+ SheetBendTerminationTreatment AuthoredTreatment,+ SheetBendTerminationTreatment ResolvedTreatment,+ double Setback,+ double Depth,+ double? Radius,+ bool IsPolicyDerived,+ SemanticProfileDeltaIr? LoweredProfileDelta,+ SheetSourceBinding Source,IReadOnlyList<SheetEvidence> Evidence);public sealed record SheetFeatureIr(diff --git a/Aetheris.SheetMetal/SheetMetalModule.cs b/Aetheris.SheetMetal/SheetMetalModule.csindex 611d5e07..d10a2fa5 100644--- a/Aetheris.SheetMetal/SheetMetalModule.cs+++ b/Aetheris.SheetMetal/SheetMetalModule.cs@@ -17,6 +17,7 @@ public static class SheetMetalModuleCapability("SheetMetal.ExactPlanarContour", "Shared native line/arc/circle outer/inner contour IR with bounded intersection, trim, split, offset, composition, and manufacturing validation."),Capability("SheetMetal.StitchedAuthoredFlat", "Authored graph traversal, shared bend allowance, exact profile composition when admitted, mapped analytic cuts/reliefs, physical flat AP242, and SVG."),Capability("SheetMetal.CornerRelief", "Bounded adjacent-flange Open, Mitered, RectangularRelief, and RoundRelief semantics with deterministic automatic dimensions and correspondence."),+ Capability("SheetMetal.BendTermination", "Stable finite-bend StartTermination/EndTermination semantics with Natural, Trimmed, Rounded, and bounded Auto treatments lowered through semantic ProfileDelta ancestry."),Capability("SheetMetal.ConceptPaths", "Canonical base/flange/corner/bend and formed/flat public paths with typed capabilities and CLI inspection."),Capability("SheetMetal.Templates", "Module-owned LBracket, UChannel, and FourWallTray engineering-parameter generators using ordinary Sheet Metal lowering and DFM."),Capability("SheetMetal.IntentRecovery", "Two-layer forensic recovery and explicit human/LLM reconstructed authority with bounded nominal/grouping suggestions."),diff --git a/Aetheris.SheetMetal/SheetMetalSemanticLayout.cs b/Aetheris.SheetMetal/SheetMetalSemanticLayout.csindex 4c9d1f5a..f93a4dbf 100644--- a/Aetheris.SheetMetal/SheetMetalSemanticLayout.cs+++ b/Aetheris.SheetMetal/SheetMetalSemanticLayout.cs@@ -102,7 +102,14 @@ internal static class SheetMetalSemanticLayoutParserif(!parsedDeltas.IsSuccess)return Fail("sheetmetal-profile-delta-parse",string.Join("; ",parsedDeltas.Diagnostics));foreach(var parsed in parsedDeltas.Deltas){- var owner=Regex.Match(parsed.OwnerPath,@"^(?<region>[A-Za-z_][A-Za-z0-9_]*)\.(?<edge>Outer)$",Rx);+ var owner=Regex.Match(parsed.OwnerPath,@"^(?<region>[A-Za-z_][A-Za-z0-9_]*)\.(?<edge>Outer|Root)$",Rx);+ if(owner.Success&&owner.Groups["edge"].Value.Equals("Root",StringComparison.OrdinalIgnoreCase))+ {+ var flange=flanges.FirstOrDefault(x=>x.Name.Equals(owner.Groups["region"].Value,StringComparison.OrdinalIgnoreCase));+ var termination=flange?.StartTermination is not null?$"{flange.Name}Bend.StartTermination":flange?.EndTermination is not null?$"{flange.Name}Bend.EndTermination":null;+ if(termination is not null)return Fail("sheetmetal-bend-termination-profile-delta-conflict",$"ProfileDelta '{parsed.Delta.StableId}' on '{parsed.OwnerPath}' conflicts with bend termination '{termination}'; root ownership cannot be double-trimmed.");+ return Fail("sheetmetal-profile-delta-owner",$"ProfileDelta '{parsed.Delta.StableId}' targets '{parsed.OwnerPath}', but root ProfileDelta is reserved for Sheet Metal bend termination lowering.");+ }if(!owner.Success||!regionSizes.TryGetValue(owner.Groups["region"].Value,out var size))return Fail("sheetmetal-profile-delta-owner",$"ProfileDelta '{parsed.Delta.StableId}' requires On: <planar-region>.Outer.");var length=size.Width;var span=parsed.Delta.Span;diff --git a/docs/language/sheetmetal-bend-terminations-m11.md b/docs/language/sheetmetal-bend-terminations-m11.mdnew file mode 100644index 00000000..eb6209e2--- /dev/null+++ b/docs/language/sheetmetal-bend-terminations-m11.md@@ -0,0 +1,56 @@+# Sheet Metal bend termination++A profile corner is where two segments of one planar material boundary meet. A+Sheet Metal corner/relief resolves adjacent flange material. A bend termination+is different: it is the stable start or end of a finite bend/root relative to a+neighboring physical boundary. Sheet Metal owns that engineering reason even+though its exact fabrication result is represented by profile contour machinery.++Each authored flange bend exposes `<Flange>Bend.StartTermination` and+`<Flange>Bend.EndTermination` when declared. Treatments are `Natural`, `Trimmed`,+`Rounded`, and `Auto`.++```firmament+Flange Wall {+ From: Deck.Front;+ Height: 16mm;+ Angle: 90deg;+ Radius: 2mm;+ StartTermination: Rounded;+ StartTerminationRadius: 2mm;+ EndTermination: Trimmed;+ EndTerminationSetback: 1mm;+ EndTerminationDepth: 1mm;+}+```++`Natural` keeps the raw finite root. `Trimmed` consumes the declared bounded root+setback. `Rounded` retains an analytic arc in the adjacent exact profile.+`Auto` is deliberately narrow: it resolves only a known bend endpoint, selects+the bounded rounded construction from thickness/radius/available-root constraints,+and refuses when it cannot fit. It never scans or optimizes unrelated geometry.++The lowering is:++```text+SheetBendIr+ ├─ StartTermination: SheetBendTerminationIr+ └─ EndTermination: SheetBendTerminationIr+ ↓ treatment resolution+ SemanticProfileDeltaIr (stable levels/members/provenance)+ ↓ bounded root/profile adapter+ exact planar contour + exact flat blank+ ↓ refold/materialize+ formed analytic BRep+```++A manually authored `CornerProfile` at the same root conflicts before BRep+construction. A manually authored root `ProfileDelta` is likewise rejected with+both semantic owners named; root ProfileDelta ownership is reserved for bend+termination lowering. Outer-edge ProfileDelta programs remain composable because+they occupy a distinct physical edge.++No `JudgmentEngine` call is used for explicit treatment. Current `Auto` has one+admissible construction family after hard constraints, so deterministic policy is+clearer than utility scoring. Judgment becomes appropriate only when two or more+genuinely valid manufacturing families are implemented.diff --git a/docs/modules/sheet-metal.md b/docs/modules/sheet-metal.mdindex 9c1fb9b3..06b9d591 100644--- a/docs/modules/sheet-metal.md+++ b/docs/modules/sheet-metal.md@@ -125,6 +125,8 @@ The [M8 CTC-03 evidence bundle](sheetmetal/artifacts/m8/README.md) records fullThe [M10 generic profile-programming report](sheetmetal/artifacts/m10/README.md) documents typed `ProfileDelta` template specialization, reusable `Tab<T>`/`Recess<T>` library dogfood, the materialized CTC-03 right-wall service profile, and the remaining non-right-wall contour residuals.+The [M11 bend-termination report](sheetmetal/artifacts/m11/README.md) adds stable finite-bend start/end identities, explicit and bounded automatic treatment, semantic ProfileDelta ancestry, conflict/DFM behavior, and the source-backed CTC-03 side-root completion.+The [recognized-import recovery M1 report](sheetmetal/artifacts/recovery-m1/README.md) separates detected bend candidates from accepted recognition authority and adds direct imported-body geometric mid-surface unfolding. Its CTC-03 run preserves exact per-region line/arc contours, all 17 source openings, seven bend lines, and source edge ancestry before any native reconstruction. Exact single-loop stitching remains partial at three source point-tangent junctions and is reported as such.## Bounded capability verdictdiff --git a/docs/modules/sheetmetal/artifacts/m10/README.md b/docs/modules/sheetmetal/artifacts/m10/README.mdindex 87772847..1a1c564a 100644--- a/docs/modules/sheetmetal/artifacts/m10/README.md+++ b/docs/modules/sheetmetal/artifacts/m10/README.md@@ -69,11 +69,9 @@ sampled historical per-region boundaries still differ at shared/released edges.Therefore M10 completes the generic substrate and this review's explicit corrections,but not full CTC-03 geometric parity.-The generic `aetheris validate` entry point still routes this module-shaped source to-an older parser fallback and reports `firmament-v2-phase3-edge-finish-syntax-invalid`.-The authoritative Sheet Metal `build`, `inspect`, `paths`, and `flatten` paths all-recognize and materialize it. This command-routing inconsistency remains open and is-not treated as a geometry failure.+M11 corrected the generic `aetheris validate` routing inconsistency: module-shaped+Sheet Metal source now uses the same domain compiler as `build`, `inspect`, `paths`,+and `flatten` instead of the unrelated edge-finish parser fallback.## Follow-up profile/corner reviewdiff --git a/docs/modules/sheetmetal/artifacts/m11/README.md b/docs/modules/sheetmetal/artifacts/m11/README.mdnew file mode 100644index 00000000..074bd069--- /dev/null+++ b/docs/modules/sheetmetal/artifacts/m11/README.md@@ -0,0 +1,79 @@+# Sheet Metal M11 — finite bend/root termination++Status: **meaningful progression**. Aetheris now represents finite bend endpoints+as stable Sheet Metal semantics with explicit and bounded automatic treatment,+generic ProfileDelta ancestry, exact formed/flat dogfood, DFM, conflicts, and STEP+round-trip coverage. CTC-03's formed bidirectional residuals improve after the+four pictured side-root ends receive semantic treatments, but endpoint-local+parity is not proven and the part remains `NeedsReview`: unrelated global+base-region contour detail still has an 8.945 mm maximum residual.++## Architecture and diagnosis++The orange-circled geometry is owned by `LeftWallBend` and `RightWallBend`, not+by an ordinary outer-profile corner. Recovered flat evidence shows both side bend+strips are bounded rectangles whose roots reach to thickness-scale offsets from+the front/rear boundaries. The previous native construction let generic profile+corner compatibility override root extent, producing the formed wedges. M11 makes+the bend endpoint the final authority for that extent.++Real types are `SheetBendEnd`, `SheetBendTerminationTreatment`,+`SheetBendTerminationIr`, and the optional `SheetBendIr.StartTermination` /+`EndTermination`. Each non-natural termination retains a+`SemanticProfileDeltaIr` with stable level/member descendants. `Trimmed` changes+the finite root extent; `Rounded` uses the existing analytic semantic-corner+adapter at the adjacent planar profile; `Natural` emits no modification.++Current paths are:++- `LeftWallBend.StartTermination` / `.Finish`+- `LeftWallBend.EndTermination` / `.Finish`+- `RightWallBend.StartTermination` / `.Finish`+- `RightWallBend.EndTermination` / `.Finish`++The CTC source explicitly uses `Trimmed` with 0.9525 mm (half nominal thickness)+at all four ends. It retains seven bends, 17 openings, one exact connected blank,+17 inner loops, no relief loops, and source-independent native construction.++## Auto and judgment++`Auto` currently admits one bounded rounded family after checking finite setback,+depth, minimum half-thickness radius, and available root/profile extent. Unsafe+requests refuse before geometry. `JudgmentEngine` verdict: **Partial / not yet+used**. The problem shape is compatible with JudgmentEngine once multiple valid+treatment families exist, but scoring a single admissible construction would add+ceremony without a competing interpretation.++## CTC comparison++Against the corrected M10 baseline:++| Measure | M10 | M11 |+|---|---:|---:|+| formed source→native RMS | 3.546889 | 3.485097 |+| formed source→native max | 9.141310 | 8.991475 |+| formed native→source RMS | 2.667873 | 2.573147 |+| flat source→native RMS | 2.886221 | 2.872865 |+| flat source→native max | 9.094054 | 8.945201 |+| flat native→source RMS | 2.384335 | 2.413599 |+| bounds width / height residual | 0.002447 / 0.007820 | 0.002447 / 0.007820 |++The left-wall local flat residual improves from 1.90637 to 0.95387 mm. The+right-wall aggregate remains influenced by its service recess and regresses from+3.80101 to 4.75351 mm, so this report does not claim local contour completion.+The formed bidirectional RMS and former dominant maximum both improve, which is+meaningful progression but not sufficient evidence to declare all four pictured+ends visually exact.++CTC-03 is therefore not declared complete. The exact remaining manufactured+discrepancy is the main-deck/shared-boundary outer contour (`region-p-0065-0069`,+8.9452 mm maximum) plus right-wall aggregate service-boundary residual; neither+is silently assigned to bend termination.++## Validation scope++`SheetMetalM11Tests` covers explicit Rounded/Trimmed, Natural, bounded Auto,+Auto refusal, CornerProfile conflict, root ProfileDelta conflict, stable paths,+DFM, exact flat, formed preflight, formed and flat STEP export/reimport, CTC+inventory, and source isolation. The full repository build/test result and final+CLI timings/hashes are recorded in the task report that produced this bundle.diff --git a/docs/modules/sheetmetal/artifacts/m8/ctc03-final.firmament b/docs/modules/sheetmetal/artifacts/m8/ctc03-final.firmamentindex d7f616b1..4d0204c0 100644--- a/docs/modules/sheetmetal/artifacts/m8/ctc03-final.firmament+++ b/docs/modules/sheetmetal/artifacts/m8/ctc03-final.firmament@@ -223,8 +223,11 @@ SheetMetal Ctc03 : Ctc03ManufacturedIntent {Flange FrontWall { From: MainDeck.Front; Height: 61.59254mm; Angle: 90deg; Radius: 6.35mm; Direction: Down; }Flange RearWall { From: MainDeck.Rear; Height: 61.59254mm; Angle: 90deg; Radius: 6.35mm; Direction: Down; }- Flange LeftWall { From: MainDeck.Left; Height: 44.45mm; Angle: 90deg; Radius: 6.35mm; Direction: Up; }- Flange RightWall { From: MainDeck.Right; Height: 31.75254mm; Angle: 90deg; Radius: 6.35mm; Direction: Up; }+ // The four finite side-wall bend ends meet front/rear material boundaries.+ // Their source-backed thickness-scale root finish is bend termination intent, not+ // anonymous base-profile edits or corner-relief cut loops.+ Flange LeftWall { From: MainDeck.Left; Height: 44.45mm; Angle: 90deg; Radius: 6.35mm; Direction: Up; StartTermination: Trimmed; StartTerminationSetback: 0.9525mm; EndTermination: Trimmed; EndTerminationSetback: 0.9525mm; }+ Flange RightWall { From: MainDeck.Right; Height: 31.75254mm; Angle: 90deg; Radius: 6.35mm; Direction: Up; StartTermination: Trimmed; StartTerminationSetback: 0.9525mm; EndTermination: Trimmed; EndTerminationSetback: 0.9525mm; }Flange FrontMountingFlange { From: FrontWall.Outer; Length: 43.47972mm; Angle: 90deg; Radius: 6.35mm; Direction: Up; }Flange RearMountingFlange { From: RearWall.Outer; Length: 44.45mm; Angle: 90deg; Radius: 6.35mm; Direction: Up; }