Next Gen STEP AP242 Native-ish BREP Geometric Modeling Kernel
Add V2-X4 profile boolean normalization lab
Yuechen Li6c5f1ff78901
diff --git a/Aetheris.Firmament.FrictionLab/CIRLab/ProfileBooleanNormalizationLab.cs b/Aetheris.Firmament.FrictionLab/CIRLab/ProfileBooleanNormalizationLab.csnew file mode 100644index 00000000..f2ed9445--- /dev/null+++ b/Aetheris.Firmament.FrictionLab/CIRLab/ProfileBooleanNormalizationLab.cs@@ -0,0 +1,169 @@+namespace Aetheris.Firmament.FrictionLab.CIRLab;++public enum ProfileBooleanRecommendation+{+ profile_boolean_normalized,+ profile_boolean_invalid_rejected,+ profile_boolean_deferred_topology,+ profile_boolean_needs_bounded_clipping_lab+}++public abstract record ProfileBooleanExpr2D;+public sealed record ProfileBooleanRectangle(double CenterX, double CenterY, double Width, double Height) : ProfileBooleanExpr2D;+public sealed record ProfileBooleanCircle(double CenterX, double CenterY, double Radius) : ProfileBooleanExpr2D;+public sealed record ProfileBooleanCapsule(double CenterX, double CenterY, double Length, double Radius) : ProfileBooleanExpr2D;+public sealed record ProfileBooleanUnsupportedPrimitive(string Name) : ProfileBooleanExpr2D;+public sealed record ProfileBooleanDifference(ProfileBooleanExpr2D Left, IReadOnlyList<ProfileBooleanExpr2D> Rights) : ProfileBooleanExpr2D;+public sealed record ProfileBooleanUnion(IReadOnlyList<ProfileBooleanExpr2D> Operands) : ProfileBooleanExpr2D;+public sealed record ProfileBooleanIntersection(ProfileBooleanExpr2D Left, ProfileBooleanExpr2D Right) : ProfileBooleanExpr2D;++public sealed record ProfileBooleanNormalizeResult(+ LabProfileStatus Status,+ LabResolvedProfile2D? Profile,+ IReadOnlyList<string> Diagnostics,+ ProfileBooleanRecommendation Recommendation);++public sealed record ProfileBooleanNormalizationArtifact(+ string CaseName,+ string ExpressionSummary,+ LabProfileStatus Status,+ LabResolvedProfile2D? NormalizedProfile,+ int OuterLoopCount,+ int HoleCount,+ int CurveCount,+ string BoundingBox,+ IReadOnlyList<string> Diagnostics,+ ProfileBooleanRecommendation Recommendation);++public static class ProfileBooleanNormalizationLab+{+ private const double Tol = 1e-6;++ public static IReadOnlyList<ProfileBooleanNormalizationArtifact> RunAll() =>+ [+ Row("success-rect-minus-circle", new ProfileBooleanDifference(Rect(0,0,20,20), [Circle(0,0,3)])),+ Row("success-rect-minus-offcenter-circle", new ProfileBooleanDifference(Rect(0,0,30,20), [Circle(5,2,2)])),+ Row("success-rect-minus-two-circles", new ProfileBooleanDifference(Rect(0,0,30,20), [Circle(-5,0,2), Circle(5,0,2)])),+ Row("success-union-identical-rectangles", new ProfileBooleanUnion([Rect(0,0,20,20), Rect(0,0,20,20)])),+ Row("success-union-contained-rectangles", new ProfileBooleanUnion([Rect(0,0,30,20), Rect(0,0,10,5)])),+ Row("success-intersect-contained-rectangles", new ProfileBooleanIntersection(Rect(0,0,30,20), Rect(0,0,10,5))),+ Row("invalid-circle-outside", new ProfileBooleanDifference(Rect(0,0,20,20), [Circle(20,20,2)])),+ Row("invalid-circle-touches-boundary", new ProfileBooleanDifference(Rect(0,0,20,20), [Circle(7,0,3)])),+ Row("invalid-circles-overlap", new ProfileBooleanDifference(Rect(0,0,30,20), [Circle(0,0,3), Circle(4,0,3)])),+ Row("invalid-circle-radius", new ProfileBooleanDifference(Rect(0,0,20,20), [Circle(0,0,0)])),+ Row("invalid-rectangle-dimensions", new ProfileBooleanDifference(Rect(0,0,0,20), [Circle(0,0,2)])),+ Row("invalid-unsupported-primitive", new ProfileBooleanDifference(Rect(0,0,20,20), [new ProfileBooleanUnsupportedPrimitive("triangle")])),+ Row("deferred-multiple-islands", new ProfileBooleanDifference(Rect(0,0,20,20), [new ProfileBooleanRectangle(0,0,2,40)])),+ Row("deferred-disjoint-union", new ProfileBooleanUnion([Rect(-20,0,10,10), Rect(20,0,10,10)])),+ Row("deferred-partial-overlap-union", new ProfileBooleanUnion([Rect(0,0,20,20), Rect(5,0,20,20)])),+ Row("deferred-partial-overlap-intersection", new ProfileBooleanIntersection(Rect(0,0,20,20), Rect(9,0,20,20))),+ Row("deferred-nested-topology-expression", new ProfileBooleanDifference(new ProfileBooleanDifference(Rect(0,0,20,20), [Circle(0,0,4)]), [Circle(0,0,2)])),+ Row("deferred-capsule", new ProfileBooleanDifference(Rect(0,0,20,20), [new ProfileBooleanCapsule(0,0,10,2)]))+ ];++ public static ProfileBooleanNormalizeResult Normalize(ProfileBooleanExpr2D expr)+ {+ var diagnostics = new List<string> { "profile-boolean-normalization-started", "profile-boolean-no-3d-boolean-used" };+ switch (expr)+ {+ case ProfileBooleanDifference(var left, var rights): return NormalizeDifference(left, rights, diagnostics);+ case ProfileBooleanUnion(var operands): return NormalizeUnion(operands, diagnostics);+ case ProfileBooleanIntersection(var left, var right): return NormalizeIntersection(left, right, diagnostics);+ default:+ diagnostics.Add("profile-boolean-unsupported-operation");+ return Fail(diagnostics, ProfileBooleanRecommendation.profile_boolean_invalid_rejected);+ }+ }++ private static ProfileBooleanNormalizeResult NormalizeDifference(ProfileBooleanExpr2D left, IReadOnlyList<ProfileBooleanExpr2D> rights, List<string> diagnostics)+ {+ if (left is ProfileBooleanDifference) { diagnostics.Add("profile-boolean-nested-topology-deferred"); return Defer(diagnostics, ProfileBooleanRecommendation.profile_boolean_deferred_topology); }+ if (left is not ProfileBooleanRectangle r || !ValidRectangle(r)) { diagnostics.Add("profile-boolean-invalid-primitive"); return Fail(diagnostics, ProfileBooleanRecommendation.profile_boolean_invalid_rejected); }+ if (rights.Count == 0) { diagnostics.Add("profile-boolean-invalid-expression"); return Fail(diagnostics, ProfileBooleanRecommendation.profile_boolean_invalid_rejected); }+ if (rights.Any(x => x is ProfileBooleanDifference)) { diagnostics.Add("profile-boolean-nested-topology-deferred"); return Defer(diagnostics, ProfileBooleanRecommendation.profile_boolean_deferred_topology); }+ if (rights.Any(x => x is ProfileBooleanCapsule)) { diagnostics.Add("profile-boolean-capsule-deferred"); return Defer(diagnostics, ProfileBooleanRecommendation.profile_boolean_deferred_topology); }+ if (rights.Any(x => x is ProfileBooleanRectangle)) { diagnostics.Add("profile-boolean-multiple-islands-deferred"); return Defer(diagnostics, ProfileBooleanRecommendation.profile_boolean_deferred_topology); }+ var circles = new List<ProfileBooleanCircle>();+ foreach (var x in rights)+ {+ if (x is ProfileBooleanUnsupportedPrimitive) { diagnostics.Add("profile-boolean-invalid-primitive"); return Fail(diagnostics, ProfileBooleanRecommendation.profile_boolean_invalid_rejected); }+ if (x is not ProfileBooleanCircle c) { diagnostics.Add("profile-boolean-unsupported-operation"); return Fail(diagnostics, ProfileBooleanRecommendation.profile_boolean_invalid_rejected); }+ if (c.Radius <= Tol) { diagnostics.Add("profile-boolean-invalid-primitive"); return Fail(diagnostics, ProfileBooleanRecommendation.profile_boolean_invalid_rejected); }+ if (!CircleInsideRectangle(c, r)) { diagnostics.Add("profile-boolean-circle-outside-rectangle"); return Fail(diagnostics, ProfileBooleanRecommendation.profile_boolean_invalid_rejected); }+ if (CircleTouchesBoundary(c, r)) { diagnostics.Add("profile-boolean-circle-touches-boundary"); return Fail(diagnostics, ProfileBooleanRecommendation.profile_boolean_invalid_rejected); }+ circles.Add(c);+ }+ for (var i = 0; i < circles.Count; i++) for (var j = i + 1; j < circles.Count; j++) if (Distance(circles[i], circles[j]) <= circles[i].Radius + circles[j].Radius + Tol)+ { diagnostics.Add("profile-boolean-circles-overlap"); return Fail(diagnostics, ProfileBooleanRecommendation.profile_boolean_invalid_rejected); }+ diagnostics.Add(circles.Count == 1 ? "profile-boolean-difference-rectangle-circle-recognized" : "profile-boolean-difference-rectangle-multicircle-recognized");+ var profile = RectangleWithCircleHoles(r, circles);+ diagnostics.Add("profile-boolean-normalized-to-resolved-profile");+ return Success(profile, diagnostics);+ }++ private static ProfileBooleanNormalizeResult NormalizeUnion(IReadOnlyList<ProfileBooleanExpr2D> operands, List<string> diagnostics)+ {+ if (operands.Count != 2 || operands.Any(x => x is not ProfileBooleanRectangle)) { diagnostics.Add("profile-boolean-union-normalization-deferred"); return Defer(diagnostics, ProfileBooleanRecommendation.profile_boolean_needs_bounded_clipping_lab); }+ var a = (ProfileBooleanRectangle)operands[0]; var b = (ProfileBooleanRectangle)operands[1];+ if (!ValidRectangle(a) || !ValidRectangle(b)) { diagnostics.Add("profile-boolean-invalid-primitive"); return Fail(diagnostics, ProfileBooleanRecommendation.profile_boolean_invalid_rejected); }+ if (SameRect(a,b)) { var p = RectangleWithCircleHoles(a, []); diagnostics.Add("profile-boolean-normalized-to-resolved-profile"); return Success(p, diagnostics); }+ if (Contains(a,b)) { var p=RectangleWithCircleHoles(a,[]); diagnostics.Add("profile-boolean-normalized-to-resolved-profile"); return Success(p, diagnostics); }+ if (Contains(b,a)) { var p=RectangleWithCircleHoles(b,[]); diagnostics.Add("profile-boolean-normalized-to-resolved-profile"); return Success(p, diagnostics); }+ diagnostics.Add("profile-boolean-union-normalization-deferred");+ return Defer(diagnostics, ProfileBooleanRecommendation.profile_boolean_needs_bounded_clipping_lab);+ }++ private static ProfileBooleanNormalizeResult NormalizeIntersection(ProfileBooleanExpr2D left, ProfileBooleanExpr2D right, List<string> diagnostics)+ {+ if (left is not ProfileBooleanRectangle a || right is not ProfileBooleanRectangle b || !ValidRectangle(a) || !ValidRectangle(b)) { diagnostics.Add("profile-boolean-invalid-primitive"); return Fail(diagnostics, ProfileBooleanRecommendation.profile_boolean_invalid_rejected); }+ if (Contains(a,b)) { var p=RectangleWithCircleHoles(b,[]); diagnostics.Add("profile-boolean-normalized-to-resolved-profile"); return Success(p, diagnostics); }+ if (Contains(b,a)) { var p=RectangleWithCircleHoles(a,[]); diagnostics.Add("profile-boolean-normalized-to-resolved-profile"); return Success(p, diagnostics); }+ diagnostics.Add("profile-boolean-intersection-normalization-deferred");+ return Defer(diagnostics, ProfileBooleanRecommendation.profile_boolean_needs_bounded_clipping_lab);+ }++ private static ProfileBooleanNormalizationArtifact Row(string caseName, ProfileBooleanExpr2D expr)+ {+ var result = Normalize(expr);+ var profile = result.Profile;+ var holes = profile?.Loops.Skip(1).Count() ?? 0;+ var outer = profile is null ? 0 : 1;+ var curves = profile?.Loops.Sum(l => l.Curves.Count) ?? 0;+ var bbox = profile is null ? "empty" : ResolvedProfile2DLab.Evaluate(caseName, profile).BoundingBox;+ return new(caseName, expr.ToString() ?? expr.GetType().Name, result.Status, profile, outer, holes, curves, bbox, result.Diagnostics, result.Recommendation);+ }++ private static ProfileBooleanNormalizeResult Success(LabResolvedProfile2D p, List<string> d) => new(LabProfileStatus.Succeeded, p, d.Distinct().OrderBy(x => x).ToArray(), ProfileBooleanRecommendation.profile_boolean_normalized);+ private static ProfileBooleanNormalizeResult Fail(List<string> d, ProfileBooleanRecommendation r) => new(LabProfileStatus.Failed, null, d.Distinct().OrderBy(x => x).ToArray(), r);+ private static ProfileBooleanNormalizeResult Defer(List<string> d, ProfileBooleanRecommendation r) => new(LabProfileStatus.Deferred, null, d.Distinct().OrderBy(x => x).ToArray(), r);++ private static LabResolvedProfile2D RectangleWithCircleHoles(ProfileBooleanRectangle rect, IReadOnlyList<ProfileBooleanCircle> holes)+ {+ var x0 = rect.CenterX - rect.Width / 2d; var x1 = rect.CenterX + rect.Width / 2d; var y0 = rect.CenterY - rect.Height / 2d; var y1 = rect.CenterY + rect.Height / 2d;+ var loops = new List<LabAirLoop2D> { new([new LabAirLineSegment2D((x0,y0),(x1,y0)), new LabAirLineSegment2D((x1,y0),(x1,y1)), new LabAirLineSegment2D((x1,y1),(x0,y1)), new LabAirLineSegment2D((x0,y1),(x0,y0))], "outer") };+ loops.AddRange(holes.Select(h => new LabAirLoop2D([new LabAirFullCircle2D((h.CenterX, h.CenterY), h.Radius, false)], "hole")));+ return new(loops);+ }++ private static bool ValidRectangle(ProfileBooleanRectangle r) => r.Width > Tol && r.Height > Tol;+ private static bool CircleInsideRectangle(ProfileBooleanCircle c, ProfileBooleanRectangle r)+ {+ var x0 = r.CenterX - r.Width / 2d; var x1 = r.CenterX + r.Width / 2d; var y0 = r.CenterY - r.Height / 2d; var y1 = r.CenterY + r.Height / 2d;+ return c.CenterX - c.Radius >= x0 - Tol && c.CenterX + c.Radius <= x1 + Tol && c.CenterY - c.Radius >= y0 - Tol && c.CenterY + c.Radius <= y1 + Tol;+ }+ private static bool CircleTouchesBoundary(ProfileBooleanCircle c, ProfileBooleanRectangle r)+ {+ var x0 = r.CenterX - r.Width / 2d; var x1 = r.CenterX + r.Width / 2d; var y0 = r.CenterY - r.Height / 2d; var y1 = r.CenterY + r.Height / 2d;+ return Math.Abs((c.CenterX - c.Radius) - x0) <= Tol || Math.Abs((c.CenterX + c.Radius) - x1) <= Tol || Math.Abs((c.CenterY - c.Radius) - y0) <= Tol || Math.Abs((c.CenterY + c.Radius) - y1) <= Tol;+ }+ private static double Distance(ProfileBooleanCircle a, ProfileBooleanCircle b) => Math.Sqrt((a.CenterX - b.CenterX)*(a.CenterX - b.CenterX)+(a.CenterY - b.CenterY)*(a.CenterY - b.CenterY));+ private static ProfileBooleanRectangle Rect(double x,double y,double w,double h)=>new(x,y,w,h);+ private static ProfileBooleanCircle Circle(double x,double y,double r)=>new(x,y,r);+ private static bool SameRect(ProfileBooleanRectangle a, ProfileBooleanRectangle b) => Math.Abs(a.CenterX-b.CenterX)<=Tol && Math.Abs(a.CenterY-b.CenterY)<=Tol && Math.Abs(a.Width-b.Width)<=Tol && Math.Abs(a.Height-b.Height)<=Tol;+ private static bool Contains(ProfileBooleanRectangle outer, ProfileBooleanRectangle inner)+ {+ var ox0 = outer.CenterX - outer.Width/2d; var ox1 = outer.CenterX + outer.Width/2d; var oy0 = outer.CenterY - outer.Height/2d; var oy1 = outer.CenterY + outer.Height/2d;+ var ix0 = inner.CenterX - inner.Width/2d; var ix1 = inner.CenterX + inner.Width/2d; var iy0 = inner.CenterY - inner.Height/2d; var iy1 = inner.CenterY + inner.Height/2d;+ return ix0 >= ox0 - Tol && ix1 <= ox1 + Tol && iy0 >= oy0 - Tol && iy1 <= oy1 + Tol;+ }+}diff --git a/Aetheris.FrictionLab.Tests/CIRLab/ProfileBooleanNormalizationLabTests.cs b/Aetheris.FrictionLab.Tests/CIRLab/ProfileBooleanNormalizationLabTests.csnew file mode 100644index 00000000..4b27151d--- /dev/null+++ b/Aetheris.FrictionLab.Tests/CIRLab/ProfileBooleanNormalizationLabTests.cs@@ -0,0 +1,70 @@+using Aetheris.Firmament.FrictionLab.CIRLab;++namespace Aetheris.FrictionLab.Tests.CIRLab;++public class ProfileBooleanNormalizationLabTests+{+ [Fact]+ public void DeterministicAcrossRuns()+ {+ var a = ProfileBooleanNormalizationLab.RunAll().Select(x => (x.CaseName, x.Status, x.OuterLoopCount, x.HoleCount, x.CurveCount, x.BoundingBox, Diagnostics: string.Join("|", x.Diagnostics), x.Recommendation));+ var b = ProfileBooleanNormalizationLab.RunAll().Select(x => (x.CaseName, x.Status, x.OuterLoopCount, x.HoleCount, x.CurveCount, x.BoundingBox, Diagnostics: string.Join("|", x.Diagnostics), x.Recommendation));+ Assert.Equal(a, b);+ }++ [Fact]+ public void RectangleMinusCircle_NormalizesToOneHole_AndValidates()+ {+ var row = ProfileBooleanNormalizationLab.RunAll().Single(x => x.CaseName == "success-rect-minus-circle");+ Assert.Equal(LabProfileStatus.Succeeded, row.Status);+ Assert.Equal(1, row.OuterLoopCount);+ Assert.Equal(1, row.HoleCount);+ Assert.Contains("profile-boolean-no-3d-boolean-used", row.Diagnostics);+ var validation = ResolvedProfile2DLab.Evaluate(row.CaseName, row.NormalizedProfile!);+ Assert.Equal(LabProfileStatus.Succeeded, validation.Status);+ }++ [Fact]+ public void RectangleMinusTwoCircles_NormalizesToTwoHoles()+ {+ var row = ProfileBooleanNormalizationLab.RunAll().Single(x => x.CaseName == "success-rect-minus-two-circles");+ Assert.Equal(LabProfileStatus.Succeeded, row.Status);+ Assert.Equal(2, row.HoleCount);+ }++ [Theory]+ [InlineData("invalid-circle-outside", "profile-boolean-circle-outside-rectangle")]+ [InlineData("invalid-circle-touches-boundary", "profile-boolean-circle-touches-boundary")]+ [InlineData("invalid-circles-overlap", "profile-boolean-circles-overlap")]+ [InlineData("invalid-circle-radius", "profile-boolean-invalid-primitive")]+ [InlineData("invalid-rectangle-dimensions", "profile-boolean-invalid-primitive")]+ [InlineData("invalid-unsupported-primitive", "profile-boolean-invalid-primitive")]+ public void InvalidCasesRejected(string caseName, string diagnostic)+ {+ var row = ProfileBooleanNormalizationLab.RunAll().Single(x => x.CaseName == caseName);+ Assert.Equal(LabProfileStatus.Failed, row.Status);+ Assert.Contains(diagnostic, row.Diagnostics);+ }++ [Theory]+ [InlineData("deferred-multiple-islands", "profile-boolean-multiple-islands-deferred")]+ [InlineData("deferred-disjoint-union", "profile-boolean-union-normalization-deferred")]+ [InlineData("deferred-partial-overlap-union", "profile-boolean-union-normalization-deferred")]+ [InlineData("deferred-partial-overlap-intersection", "profile-boolean-intersection-normalization-deferred")]+ [InlineData("deferred-nested-topology-expression", "profile-boolean-nested-topology-deferred")]+ [InlineData("deferred-capsule", "profile-boolean-capsule-deferred")]+ public void DeferredCasesExplicit(string caseName, string diagnostic)+ {+ var row = ProfileBooleanNormalizationLab.RunAll().Single(x => x.CaseName == caseName);+ Assert.Equal(LabProfileStatus.Deferred, row.Status);+ Assert.Contains(diagnostic, row.Diagnostics);+ }++ [Fact]+ public void Recommendations_AreFiniteAllowedSet()+ {+ var allowed = Enum.GetValues<ProfileBooleanRecommendation>().ToHashSet();+ foreach (var row in ProfileBooleanNormalizationLab.RunAll())+ Assert.Contains(row.Recommendation, allowed);+ }+}diff --git a/docs/frictionlab/v2-x4-profile-boolean-normalization-lab.md b/docs/frictionlab/v2-x4-profile-boolean-normalization-lab.mdnew file mode 100644index 00000000..a704d56c--- /dev/null+++ b/docs/frictionlab/v2-x4-profile-boolean-normalization-lab.md@@ -0,0 +1,69 @@+# V2-X4 — Bounded 2D Profile Boolean Normalization Lab++## Purpose and scope+Lab-only experiment proving compile-time profile Boolean normalization for a bounded expression subset, producing `LabResolvedProfile2D` before any 3D emission.++References:+- V2 doctrine: `docs/aetheris-v2-sweep-first-architecture.md`+- V2-A1 resolved contract: `docs/aetheris-v2-a1-resolved-profile2d-contract.md`+- V2-X1 profile contract lab: `docs/frictionlab/v2-x1-resolved-profile2d-lab.md`+- V2-X3 profile-hole extrusion lab: `docs/frictionlab/v2-x3-profile-with-hole-extrude-lab.md`++## Compile-time Boolean thesis+This lab evaluates profile intent structurally in 2D and normalizes accepted cases into one outer loop plus hole loops before 3D topology. It intentionally avoids runtime 3D topology discovery and all 3D Boolean operations.++## Supported subset+- `Difference(Rectangle, CircleInside)`.+- `Difference(Rectangle, CircleInside...)` where circles are strictly inside, non-touching boundary, and non-overlapping.+- `Union(Rectangle, Rectangle)` only for identical or strict containment.+- `Intersect(Rectangle, Rectangle)` only for strict containment.++## Normalization rules+- Accepted difference cases emit rectangle outer loop and CW full-circle hole loops.+- Accepted union/intersection containment cases emit one rectangle loop.+- All accepted outputs include `profile-boolean-no-3d-boolean-used`.+- Unsupported topology is explicitly deferred with deterministic diagnostics.++## Diagnostics contract+Representative diagnostics:+- start/completion: `profile-boolean-normalization-started`, `profile-boolean-normalized-to-resolved-profile`.+- recognized: `profile-boolean-difference-rectangle-circle-recognized`, `profile-boolean-difference-rectangle-multicircle-recognized`.+- invalid: `profile-boolean-invalid-expression`, `profile-boolean-invalid-primitive`, `profile-boolean-circle-outside-rectangle`, `profile-boolean-circle-touches-boundary`, `profile-boolean-circles-overlap`.+- deferred: `profile-boolean-capsule-deferred`, `profile-boolean-union-normalization-deferred`, `profile-boolean-intersection-normalization-deferred`, `profile-boolean-multiple-islands-deferred`, `profile-boolean-nested-topology-deferred`.++Recommendations are finite:+- `profile_boolean_normalized`+- `profile_boolean_invalid_rejected`+- `profile_boolean_deferred_topology`+- `profile_boolean_needs_bounded_clipping_lab`++## Test cases and results+Implemented rows cover requested successful, invalid, and deferred scenarios in lab artifacts and tests (`ProfileBooleanNormalizationLabTests`). Successful normalized profiles are additionally validated through V2-X1 `ResolvedProfile2DLab.Evaluate`.++## Deferred/rejected cases+Deferred examples:+- rectangle subtraction by rectangle (multiple-island risk),+- disjoint/partial-overlap union,+- partial-overlap intersection,+- nested difference expression,+- capsule subtraction.++Rejected examples:+- invalid primitive dimensions,+- circles outside or touching rectangle boundary,+- overlapping circles,+- unsupported primitive.++## Optional chained evidence+Not implemented in this milestone. Chaining into V2-X3 profile-hole extrude remains optional and lab-only.++## Non-goals+- No production routing changes.+- No full 2D clipping engine.+- No sketch solver.+- No required BRep emission.+- No STEP importer/exporter changes.+- No Boolean core changes.++## Recommended next step+Run a bounded clipping lab for rectangle-rectangle overlap normalization, or a dedicated slot/capsule profile normalization+extrusion lab before any production expression-routing decisions.