Skip to content

Next Gen STEP AP242 Native-ish BREP Geometric Modeling Kernel

Add concise note for deferred boolean scope

Yuechen Lif0d57f0c99aa
diff --git a/Aetheris.Kernel.Core/Brep/Boolean/BrepBooleanAnalyticSurfaceRecognition.cs b/Aetheris.Kernel.Core/Brep/Boolean/BrepBooleanAnalyticSurfaceRecognition.cs
index 11730a65..8e4b7d90 100644
--- a/Aetheris.Kernel.Core/Brep/Boolean/BrepBooleanAnalyticSurfaceRecognition.cs
+++ b/Aetheris.Kernel.Core/Brep/Boolean/BrepBooleanAnalyticSurfaceRecognition.cs
@@ -106,6 +106,7 @@ public static class BrepBooleanAnalyticSurfaceRecognition
var axis = coneSurface.Axis;
var axisVector = axis.ToVector();
+ var capCircles = new List<Circle3Curve>(2);
foreach (var edgeBinding in body.Bindings.EdgeBindings)
{
var edgeCurve = body.Geometry.GetCurve(edgeBinding.CurveGeometryId);
@@ -114,6 +115,17 @@ public static class BrepBooleanAnalyticSurfaceRecognition
reason = "cone recognition requires one line seam and circular cap edges only.";
return false;
}
+
+ if (edgeCurve.Kind == CurveGeometryKind.Circle3 && edgeCurve.Circle3 is Circle3Curve circle)
+ {
+ capCircles.Add(circle);
+ }
+ }
+
+ if (capCircles.Count is < 1 or > 2 || capCircles.Count != planeBindings.Count)
+ {
+ reason = "cone recognition requires one line seam and one or two circular cap edges.";
+ return false;
}
var samples = new List<(double AxisParameter, double Radius)>(2);
@@ -127,7 +139,18 @@ public static class BrepBooleanAnalyticSurfaceRecognition
return false;
}
- var centerOffset = plane.Origin - coneSurface.Apex;
+ }
+
+ foreach (var circle in capCircles)
+ {
+ var normalDot = circle.Normal.ToVector().Dot(axisVector);
+ if (!ToleranceMath.AlmostEqual(double.Abs(normalDot), 1d, tolerance))
+ {
+ reason = "cone recognition requires cap circle normals parallel to the cone axis.";
+ return false;
+ }
+
+ var centerOffset = circle.Center - coneSurface.Apex;
var axisParameter = centerOffset.Dot(axisVector);
var radialOffset = centerOffset - (axisVector * axisParameter);
if (radialOffset.Length > tolerance.Linear)
@@ -136,7 +159,7 @@ public static class BrepBooleanAnalyticSurfaceRecognition
return false;
}
- samples.Add((axisParameter, System.Math.Abs(axisParameter) * System.Math.Tan(coneSurface.SemiAngleRadians)));
+ samples.Add((axisParameter, circle.Radius));
}
if (planeBindings.Count == 1)
diff --git a/Aetheris.Kernel.Core/Brep/Boolean/BrepBooleanCylinderRecognition.cs b/Aetheris.Kernel.Core/Brep/Boolean/BrepBooleanCylinderRecognition.cs
index f1f0236e..824a007a 100644
--- a/Aetheris.Kernel.Core/Brep/Boolean/BrepBooleanCylinderRecognition.cs
+++ b/Aetheris.Kernel.Core/Brep/Boolean/BrepBooleanCylinderRecognition.cs
@@ -265,12 +265,6 @@ public static class BrepBooleanCylinderRecognition
{
profile = default;
diagnostic = null;
- if (!IsAxisAlignedWithWorldZ(cone.Axis, tolerance))
- {
- diagnostic = CreateAxisNotAlignedDiagnostic(BooleanOperation.Subtract.ToString(), featureId, "currently defers arbitrary-axis cone subtract in the safe family; only world-Z cone subtract is supported in this milestone.");
- return false;
- }
-
if (!TryResolveBoundaryAxisParameter(cone.AxisOrigin, cone.Axis, box.MinZ, tolerance, out var bottomAxisParameter)
|| !TryResolveBoundaryAxisParameter(cone.AxisOrigin, cone.Axis, box.MaxZ, tolerance, out var topAxisParameter))
{
@@ -310,6 +304,12 @@ public static class BrepBooleanCylinderRecognition
if (coversTop && !coversBottom)
{
+ if (!IsAxisAlignedWithWorldZ(cone.Axis, tolerance))
+ {
+ diagnostic = CreateNotFullySpanningDiagnostic(BooleanOperation.Subtract.ToString(), featureId, "currently supports arbitrary-axis cone subtract only for through-holes; blind arbitrary-axis cone holes remain deferred in this milestone.");
+ return false;
+ }
+
var minEndIsLower = cone.MinCenter.Z <= cone.MaxCenter.Z;
var terminationZ = System.Math.Min(cone.MinCenter.Z, cone.MaxCenter.Z);
if (terminationZ <= (box.MinZ + tolerance.Linear) || terminationZ >= (box.MaxZ - tolerance.Linear))
@@ -339,6 +339,12 @@ public static class BrepBooleanCylinderRecognition
if (coversBottom && !coversTop)
{
+ if (!IsAxisAlignedWithWorldZ(cone.Axis, tolerance))
+ {
+ diagnostic = CreateNotFullySpanningDiagnostic(BooleanOperation.Subtract.ToString(), featureId, "currently supports arbitrary-axis cone subtract only for through-holes; blind arbitrary-axis cone holes remain deferred in this milestone.");
+ return false;
+ }
+
var maxEndIsHigher = cone.MaxCenter.Z >= cone.MinCenter.Z;
var terminationZ = System.Math.Max(cone.MinCenter.Z, cone.MaxCenter.Z);
if (terminationZ <= (box.MinZ + tolerance.Linear) || terminationZ >= (box.MaxZ - tolerance.Linear))
diff --git a/docs/boolean-deferred.md b/docs/boolean-deferred.md
new file mode 100644
index 00000000..d7dc52b4
--- /dev/null
+++ b/docs/boolean-deferred.md
@@ -0,0 +1,45 @@
+# Boolean deferred pile (safe-family snapshot)
+
+This note records the current boolean scope so deferred items can be revisited later without losing context.
+
+## Current supported subset (safe family)
+
+The current supported boolean subset is intentionally narrow and family-specific:
+
+- box − cylinder through-hole
+- box − cone through-hole
+- box − cylinder blind hole
+- box − cone blind hole
+- box − sphere cavity
+- rotated cylinder through-hole
+- safe-family composition for the currently supported through-hole family
+
+## Current deferred boolean pile
+
+The following items remain deferred:
+
+- rotated cone through-hole
+- rotated blind cylinder hole
+- rotated blind cone hole
+- arbitrary-axis blind-hole composition chaining
+- torus booleans
+- broad add/intersect expansion outside the current narrow box-box subset
+- general BRep booleans
+
+## Known blocker: rotated cone through-hole
+
+Rotated cone through-hole is deferred due to a **section-curve representation mismatch in the builder/export path**.
+
+## Architectural framing
+
+- The current boolean system is a **family-specific safe boolean framework**.
+- It is **not** a general boolean engine.
+- Deferred items should be revisited only if product scope or real usage justifies them.
+
+## Return criteria
+
+Revisit this deferred pile when at least one of these is true:
+
+- Real product usage hits a blocked case.
+- A milestone explicitly targets widening the safe family.
+- There is an explicit decision to invest in more general boolean foundations.