Skip to content

Next Gen STEP AP242 Native-ish BREP Geometric Modeling Kernel

Add planar loop flattening for mixed line/arc tessellation

Yuechen Li1c9a2acb6ab3
diff --git a/Aetheris.Kernel.Core.Tests/Step242/Step242TessellationRobustnessTests.cs b/Aetheris.Kernel.Core.Tests/Step242/Step242TessellationRobustnessTests.cs
index ea0beba7..b9da76ca 100644
--- a/Aetheris.Kernel.Core.Tests/Step242/Step242TessellationRobustnessTests.cs
+++ b/Aetheris.Kernel.Core.Tests/Step242/Step242TessellationRobustnessTests.cs
@@ -49,6 +49,44 @@ public sealed class Step242TessellationRobustnessTests
Assert.DoesNotContain(tessellation.Diagnostics, d => d.Message.Contains("requires a convex polygon", StringComparison.Ordinal));
}
+
+ [Fact]
+ public void Step242_Tessellate_PlanarFace_LinePlusArcLoop_Succeeds()
+ {
+ var text = LoadFixture("testdata/step242/tessellation-robustness/planar-rect-with-filleted-corners.step");
+
+ var import = Step242Importer.ImportBody(text);
+
+ Assert.True(import.IsSuccess);
+
+ var tessellation = BrepDisplayTessellator.Tessellate(import.Value);
+
+ Assert.True(tessellation.IsSuccess);
+ Assert.DoesNotContain(tessellation.Diagnostics, d => d.Message.Contains("supports only all-line loops or a single circle loop", StringComparison.Ordinal));
+
+ var facePatch = Assert.Single(tessellation.Value.FacePatches);
+ Assert.NotEmpty(facePatch.TriangleIndices);
+ }
+
+ [Fact]
+ public void Step242_Tessellate_PlanarFace_UnsupportedCurve_FailsDeterministically()
+ {
+ var text = LoadFixture("testdata/step242/tessellation-robustness/planar-loop-unsupported-curve.step");
+
+ var import = Step242Importer.ImportBody(text);
+
+ Assert.True(import.IsSuccess);
+
+ var tessellation = BrepDisplayTessellator.Tessellate(import.Value);
+
+ Assert.False(tessellation.IsSuccess);
+
+ var diagnostic = Assert.Single(tessellation.Diagnostics);
+ Assert.Equal(KernelDiagnosticCode.NotImplemented, diagnostic.Code);
+ Assert.Equal("Viewer.Tessellation.PlanarCurveFlatteningUnsupported", diagnostic.Source);
+ Assert.Contains("AETHERIS_PLANAR_UNSUPPORTED_CURVE", diagnostic.Message, StringComparison.OrdinalIgnoreCase);
+ }
+
[Fact]
public void Step242_Tessellate_PlanarFace_DegenerateLoop_FailsDeterministically()
{
diff --git a/Aetheris.Kernel.Core/Brep/Tessellation/BrepDisplayTessellator.cs b/Aetheris.Kernel.Core/Brep/Tessellation/BrepDisplayTessellator.cs
index 0871d742..1cf15f92 100644
--- a/Aetheris.Kernel.Core/Brep/Tessellation/BrepDisplayTessellator.cs
+++ b/Aetheris.Kernel.Core/Brep/Tessellation/BrepDisplayTessellator.cs
@@ -11,6 +11,8 @@ namespace Aetheris.Kernel.Core.Brep.Tessellation;
public static class BrepDisplayTessellator
{
private const double LoopEndpointTolerance = 1e-6d;
+ private const string PlanarCurveFlatteningUnsupportedSource = "Viewer.Tessellation.PlanarCurveFlatteningUnsupported";
+ private const string PlanarCurveFlatteningFailedSource = "Viewer.Tessellation.PlanarCurveFlatteningFailed";
public static KernelResult<DisplayTessellationResult> Tessellate(BrepBody body, DisplayTessellationOptions? options = null)
{
@@ -88,46 +90,33 @@ public static class BrepDisplayTessellator
.Select(id => body.Topology.GetCoedge(id))
.ToArray();
- if (coedges.All(c => body.GetEdgeCurve(c.EdgeId).Kind == CurveGeometryKind.Line3))
+ var polygonPointsResult = BuildFlattenedPlanarLoopPoints(body, coedges, faceId, plane, options);
+ if (!polygonPointsResult.IsSuccess)
{
- var polygonPointsResult = BuildOrderedPlanarLoopPoints(body, coedges, faceId);
- if (!polygonPointsResult.IsSuccess)
- {
- return KernelResult<DisplayFaceMeshPatch>.Failure(polygonPointsResult.Diagnostics);
- }
-
- var polygonPoints = polygonPointsResult.Value;
-
- if (polygonPoints.Count < 3)
- {
- return KernelResult<DisplayFaceMeshPatch>.Failure([CreateNotImplemented($"Face {faceId.Value} planar loop must contain at least three line coedges.")]);
- }
+ return KernelResult<DisplayFaceMeshPatch>.Failure(polygonPointsResult.Diagnostics);
+ }
- if (!PlanarPolygonTriangulator.TryTriangulate(polygonPoints, plane.Normal.ToVector(), out var indices, out var failure))
- {
- return failure switch
- {
- PlanarPolygonTriangulationFailure.Degenerate => KernelResult<DisplayFaceMeshPatch>.Failure([
- CreateInvalidArgument($"Face {faceId.Value} planar loop is degenerate and cannot be triangulated.", "Viewer.Tessellation.PlanarPolygonDegenerate")]),
- PlanarPolygonTriangulationFailure.NonSimple => KernelResult<DisplayFaceMeshPatch>.Failure([
- CreateNotImplemented($"Face {faceId.Value} planar loop triangulation failed because the polygon is not simple.", "Viewer.Tessellation.PlanarNonConvexTriangulationFailed")]),
- _ => KernelResult<DisplayFaceMeshPatch>.Failure([
- CreateNotImplemented($"Face {faceId.Value} planar loop triangulation failed.", "Viewer.Tessellation.PlanarNonConvexTriangulationFailed")]),
- };
- }
+ var polygonPoints = polygonPointsResult.Value;
- return KernelResult<DisplayFaceMeshPatch>.Success(CreatePlanarPatch(faceId, polygonPoints, plane.Normal.ToVector(), indices), successDiagnostics);
+ if (polygonPoints.Count < 3)
+ {
+ return KernelResult<DisplayFaceMeshPatch>.Failure([CreateInvalidArgument($"Face {faceId.Value} planar loop flattening produced fewer than three unique points.", PlanarCurveFlatteningFailedSource)]);
}
- if (coedges.Length == 1 && body.GetEdgeCurve(coedges[0].EdgeId).Kind == CurveGeometryKind.Circle3)
+ if (!PlanarPolygonTriangulator.TryTriangulate(polygonPoints, plane.Normal.ToVector(), out var indices, out var failure))
{
- var circlePatch = TessellatePlanarCircleFace(body, faceId, coedges[0], plane, options);
- return circlePatch.IsSuccess
- ? KernelResult<DisplayFaceMeshPatch>.Success(circlePatch.Value, successDiagnostics.Concat(circlePatch.Diagnostics))
- : circlePatch;
+ return failure switch
+ {
+ PlanarPolygonTriangulationFailure.Degenerate => KernelResult<DisplayFaceMeshPatch>.Failure([
+ CreateInvalidArgument($"Face {faceId.Value} planar loop is degenerate and cannot be triangulated.", "Viewer.Tessellation.PlanarPolygonDegenerate")]),
+ PlanarPolygonTriangulationFailure.NonSimple => KernelResult<DisplayFaceMeshPatch>.Failure([
+ CreateNotImplemented($"Face {faceId.Value} planar loop triangulation failed because the polygon is not simple.", "Viewer.Tessellation.PlanarNonConvexTriangulationFailed")]),
+ _ => KernelResult<DisplayFaceMeshPatch>.Failure([
+ CreateNotImplemented($"Face {faceId.Value} planar loop triangulation failed.", "Viewer.Tessellation.PlanarNonConvexTriangulationFailed")]),
+ };
}
- return KernelResult<DisplayFaceMeshPatch>.Failure([CreateNotImplemented($"Face {faceId.Value} planar tessellation supports only all-line loops or a single circle loop.")]);
+ return KernelResult<DisplayFaceMeshPatch>.Success(CreatePlanarPatch(faceId, polygonPoints, plane.Normal.ToVector(), indices), successDiagnostics);
}
private static LoopId SelectPlanarPrimaryLoop(BrepBody body, FaceId faceId, PlaneSurface plane, IReadOnlyList<LoopId> loopIds)
@@ -146,12 +135,7 @@ public static class BrepDisplayTessellator
.Select(id => body.Topology.GetCoedge(id))
.ToArray();
- if (!coedges.All(c => body.GetEdgeCurve(c.EdgeId).Kind == CurveGeometryKind.Line3))
- {
- continue;
- }
-
- var pointsResult = BuildOrderedPlanarLoopPoints(body, coedges, faceId);
+ var pointsResult = BuildFlattenedPlanarLoopPoints(body, coedges, faceId, plane, DisplayTessellationOptions.Default);
if (!pointsResult.IsSuccess)
{
continue;
@@ -417,7 +401,12 @@ public static class BrepDisplayTessellator
return new DisplayFaceMeshPatch(faceId, polygonPoints.ToArray(), normals, triangleIndices.ToArray());
}
- private static KernelResult<IReadOnlyList<Point3D>> BuildOrderedPlanarLoopPoints(BrepBody body, IReadOnlyList<Coedge> coedges, FaceId faceId)
+ private static KernelResult<IReadOnlyList<Point3D>> BuildFlattenedPlanarLoopPoints(
+ BrepBody body,
+ IReadOnlyList<Coedge> coedges,
+ FaceId faceId,
+ PlaneSurface plane,
+ DisplayTessellationOptions options)
{
var vertexPointsResult = BuildLoopVertexPointLookup(body, coedges, faceId);
if (!vertexPointsResult.IsSuccess)
@@ -438,38 +427,159 @@ public static class BrepDisplayTessellator
orientedEndpoints.Add(endpoints.Value);
}
- var orderedVertices = new List<Point3D>(coedges.Count);
+ var orderedIndices = new List<int>(coedges.Count) { 0 };
var used = new bool[coedges.Count];
- var currentIndex = 0;
- used[currentIndex] = true;
-
- var currentEdge = orientedEndpoints[currentIndex];
- orderedVertices.Add(currentEdge.Start);
- var currentEnd = currentEdge.End;
+ used[0] = true;
+ var currentEnd = orientedEndpoints[0].End;
for (var step = 1; step < coedges.Count; step++)
{
- var nextIndex = FindNextCoedgeIndex(orientedEndpoints, used, currentEnd, out var nextStart, out var nextEnd);
+ var nextIndex = FindNextCoedgeIndex(orientedEndpoints, used, currentEnd, out _, out var nextEnd);
if (nextIndex < 0)
{
- return KernelResult<IReadOnlyList<Point3D>>.Failure([CreateNotImplemented($"Face {faceId.Value} planar loop line coedges do not form a contiguous chain.")]);
+ return KernelResult<IReadOnlyList<Point3D>>.Failure([CreateInvalidArgument($"Face {faceId.Value} planar loop coedges do not form a contiguous chain.", PlanarCurveFlatteningFailedSource)]);
}
used[nextIndex] = true;
- if (!PointsAlmostEqual(orderedVertices[^1], nextStart))
+ orderedIndices.Add(nextIndex);
+ currentEnd = nextEnd;
+ }
+
+ if (!PointsAlmostEqual(orientedEndpoints[orderedIndices[0]].Start, currentEnd))
+ {
+ return KernelResult<IReadOnlyList<Point3D>>.Failure([CreateInvalidArgument($"Face {faceId.Value} planar loop coedges did not close after chaining.", PlanarCurveFlatteningFailedSource)]);
+ }
+
+ var flattened = new List<Point3D>();
+ AppendUniquePoint(flattened, orientedEndpoints[orderedIndices[0]].Start);
+
+ foreach (var index in orderedIndices)
+ {
+ var coedge = coedges[index];
+ var (segmentStart, segmentEnd) = orientedEndpoints[index];
+ var curve = body.GetEdgeCurve(coedge.EdgeId);
+
+ switch (curve.Kind)
{
- orderedVertices.Add(nextStart);
+ case CurveGeometryKind.Line3:
+ AppendUniquePoint(flattened, segmentEnd);
+ break;
+ case CurveGeometryKind.Circle3:
+ var arcPointsResult = SampleCircleArc(body, coedge, curve.Circle3!.Value, segmentStart, segmentEnd, plane, faceId, options);
+ if (!arcPointsResult.IsSuccess)
+ {
+ return KernelResult<IReadOnlyList<Point3D>>.Failure(arcPointsResult.Diagnostics);
+ }
+
+ foreach (var point in arcPointsResult.Value)
+ {
+ AppendUniquePoint(flattened, point);
+ }
+
+ break;
+ default:
+ var curveKind = curve.UnsupportedKind ?? curve.Kind.ToString();
+ return KernelResult<IReadOnlyList<Point3D>>.Failure([
+ CreateNotImplemented($"Face {faceId.Value} planar curve flattening does not support curve kind '{curveKind}'.", PlanarCurveFlatteningUnsupportedSource)]);
}
+ }
- currentEnd = nextEnd;
+ if (flattened.Count > 1 && PointsAlmostEqual(flattened[0], flattened[^1]))
+ {
+ flattened.RemoveAt(flattened.Count - 1);
}
- if (PointsAlmostEqual(orderedVertices[0], currentEnd))
+ return KernelResult<IReadOnlyList<Point3D>>.Success(flattened);
+ }
+
+ private static KernelResult<IReadOnlyList<Point3D>> SampleCircleArc(
+ BrepBody body,
+ Coedge coedge,
+ Circle3Curve circle,
+ Point3D start,
+ Point3D end,
+ PlaneSurface plane,
+ FaceId faceId,
+ DisplayTessellationOptions options)
+ {
+ var deltaResult = ResolveArcDelta(body, coedge, circle, start, end, plane, faceId);
+ if (!deltaResult.IsSuccess)
{
- return KernelResult<IReadOnlyList<Point3D>>.Success(orderedVertices);
+ return KernelResult<IReadOnlyList<Point3D>>.Failure(deltaResult.Diagnostics);
}
- return KernelResult<IReadOnlyList<Point3D>>.Failure([CreateNotImplemented($"Face {faceId.Value} planar loop line coedges did not close after chaining.")]);
+ var (startAngle, delta) = deltaResult.Value;
+ var segmentCount = System.Math.Clamp(System.Math.Max(8, (int)double.Ceiling(double.Abs(delta) / (10d * (double.Pi / 180d)))), 8, System.Math.Min(256, options.MaximumSegments));
+ var points = new List<Point3D>(segmentCount);
+ for (var i = 1; i <= segmentCount; i++)
+ {
+ var t = (double)i / segmentCount;
+ points.Add(circle.Evaluate(startAngle + (delta * t)));
+ }
+
+ return KernelResult<IReadOnlyList<Point3D>>.Success(points);
+ }
+
+ private static KernelResult<(double StartAngle, double Delta)> ResolveArcDelta(
+ BrepBody body,
+ Coedge coedge,
+ Circle3Curve circle,
+ Point3D start,
+ Point3D end,
+ PlaneSurface plane,
+ FaceId faceId)
+ {
+ var startAngle = AngleOnCircle(circle, start);
+ var endAngle = AngleOnCircle(circle, end);
+
+ if (body.Bindings.TryGetEdgeBinding(coedge.EdgeId, out var binding) && binding.TrimInterval is ParameterInterval trim)
+ {
+ var trimStart = coedge.IsReversed ? trim.End : trim.Start;
+ var trimEnd = coedge.IsReversed ? trim.Start : trim.End;
+ var trimDelta = trimEnd - trimStart;
+ if (double.IsFinite(trimDelta) && double.Abs(trimDelta) > 1e-9d)
+ {
+ return KernelResult<(double, double)>.Success((trimStart, trimDelta));
+ }
+ }
+
+ var delta = NormalizeToSignedPi(endAngle - startAngle);
+ if (double.Abs(delta) < 1e-9d)
+ {
+ return KernelResult<(double, double)>.Failure([
+ CreateInvalidArgument($"Face {faceId.Value} planar arc flattening detected a degenerate circle arc.", PlanarCurveFlatteningFailedSource)]);
+ }
+
+ var orientation = circle.Normal.ToVector().Dot(plane.Normal.ToVector());
+ if (orientation < 0d)
+ {
+ delta = -delta;
+ }
+
+ return KernelResult<(double, double)>.Success((startAngle, delta));
+ }
+
+ private static double AngleOnCircle(Circle3Curve circle, Point3D point)
+ {
+ var offset = point - circle.Center;
+ var x = offset.Dot(circle.XAxis.ToVector());
+ var y = offset.Dot(circle.YAxis.ToVector());
+ return double.Atan2(y, x);
+ }
+
+ private static double NormalizeToSignedPi(double angle)
+ {
+ while (angle <= -double.Pi)
+ {
+ angle += 2d * double.Pi;
+ }
+
+ while (angle > double.Pi)
+ {
+ angle -= 2d * double.Pi;
+ }
+
+ return angle;
}
private static int FindNextCoedgeIndex(
@@ -511,6 +621,20 @@ public static class BrepDisplayTessellator
return matchIndex;
}
+ private static void AppendUniquePoint(List<Point3D> points, Point3D point)
+ {
+ if (points.Count == 0)
+ {
+ points.Add(point);
+ return;
+ }
+
+ if (!PointsAlmostEqual(points[^1], point))
+ {
+ points.Add(point);
+ }
+ }
+
private static bool PointsAlmostEqual(Point3D left, Point3D right)
=> (left - right).LengthSquared <= (LoopEndpointTolerance * LoopEndpointTolerance);
@@ -622,9 +746,9 @@ public static class BrepDisplayTessellator
private static KernelResult<Point3D> EvaluateEdgeEndpoint(BrepBody body, EdgeId edgeId, bool useStart)
{
- if (!body.TryGetEdgeCurveGeometry(edgeId, out var curve) || curve is null || curve.Kind != CurveGeometryKind.Line3)
+ if (!body.TryGetEdgeCurveGeometry(edgeId, out var curve) || curve is null)
{
- return KernelResult<Point3D>.Failure([CreateNotImplemented($"Edge {edgeId.Value} planar polygon tessellation requires line geometry.")]);
+ return KernelResult<Point3D>.Failure([CreateNotImplemented($"Edge {edgeId.Value} is missing bound curve geometry.")]);
}
if (!body.Bindings.TryGetEdgeBinding(edgeId, out var binding))
@@ -634,7 +758,12 @@ public static class BrepDisplayTessellator
var interval = binding.TrimInterval ?? new ParameterInterval(0d, 1d);
var parameter = useStart ? interval.Start : interval.End;
- return KernelResult<Point3D>.Success(curve.Line3!.Value.Evaluate(parameter));
+ return curve.Kind switch
+ {
+ CurveGeometryKind.Line3 => KernelResult<Point3D>.Success(curve.Line3!.Value.Evaluate(parameter)),
+ CurveGeometryKind.Circle3 => KernelResult<Point3D>.Success(curve.Circle3!.Value.Evaluate(parameter)),
+ _ => KernelResult<Point3D>.Failure([CreateNotImplemented($"Edge {edgeId.Value} endpoint evaluation does not support curve kind '{curve.UnsupportedKind ?? curve.Kind.ToString()}'.", PlanarCurveFlatteningUnsupportedSource)]),
+ };
}
private static KernelResult<(Point3D Start, Point3D End)> GetEdgeEndpoints(
@@ -643,11 +772,6 @@ public static class BrepDisplayTessellator
bool reversed,
IReadOnlyDictionary<VertexId, Point3D> vertexPoints)
{
- if (!body.TryGetEdgeCurveGeometry(edgeId, out var curve) || curve is null || curve.Kind != CurveGeometryKind.Line3)
- {
- return KernelResult<(Point3D, Point3D)>.Failure([CreateNotImplemented($"Edge {edgeId.Value} planar polygon tessellation requires line geometry.")]);
- }
-
if (!body.TryGetEdgeVertices(edgeId, out var startVertexId, out var endVertexId))
{
return KernelResult<(Point3D, Point3D)>.Failure([CreateNotImplemented($"Edge {edgeId.Value} is missing topology endpoints.")]);
diff --git a/Aetheris.Kernel.Core/Geometry/CurveGeometry.cs b/Aetheris.Kernel.Core/Geometry/CurveGeometry.cs
index febf7658..e62b39e5 100644
--- a/Aetheris.Kernel.Core/Geometry/CurveGeometry.cs
+++ b/Aetheris.Kernel.Core/Geometry/CurveGeometry.cs
@@ -6,6 +6,7 @@ public enum CurveGeometryKind
{
Line3,
Circle3,
+ Unsupported,
}
/// <summary>
@@ -13,11 +14,12 @@ public enum CurveGeometryKind
/// </summary>
public sealed record CurveGeometry
{
- private CurveGeometry(CurveGeometryKind kind, Line3Curve? line3, Circle3Curve? circle3)
+ private CurveGeometry(CurveGeometryKind kind, Line3Curve? line3, Circle3Curve? circle3, string? unsupportedKind)
{
Kind = kind;
Line3 = line3;
Circle3 = circle3;
+ UnsupportedKind = unsupportedKind;
}
public CurveGeometryKind Kind { get; }
@@ -26,7 +28,11 @@ public sealed record CurveGeometry
public Circle3Curve? Circle3 { get; }
- public static CurveGeometry FromLine(Line3Curve line) => new(CurveGeometryKind.Line3, line, null);
+ public string? UnsupportedKind { get; }
- public static CurveGeometry FromCircle(Circle3Curve circle) => new(CurveGeometryKind.Circle3, null, circle);
+ public static CurveGeometry FromLine(Line3Curve line) => new(CurveGeometryKind.Line3, line, null, null);
+
+ public static CurveGeometry FromCircle(Circle3Curve circle) => new(CurveGeometryKind.Circle3, null, circle, null);
+
+ public static CurveGeometry FromUnsupported(string kindName) => new(CurveGeometryKind.Unsupported, null, null, kindName);
}
diff --git a/Aetheris.Kernel.Core/Step242/Step242Importer.cs b/Aetheris.Kernel.Core/Step242/Step242Importer.cs
index 1fd7e8be..2342f717 100644
--- a/Aetheris.Kernel.Core/Step242/Step242Importer.cs
+++ b/Aetheris.Kernel.Core/Step242/Step242Importer.cs
@@ -498,6 +498,13 @@ public static class Step242Importer
trimResult.Value));
}
+ if (string.Equals(curveEntity.Name, "AETHERIS_PLANAR_UNSUPPORTED_CURVE", StringComparison.OrdinalIgnoreCase))
+ {
+ return KernelResult<(CurveGeometry CurveGeometry, ParameterInterval TrimInterval)>.Success((
+ CurveGeometry.FromUnsupported(curveEntity.Name),
+ new ParameterInterval(0d, 1d)));
+ }
+
return FailureCurveBinding($"EDGE_CURVE geometry '{curveEntity.Name}' is unsupported.", SourceFor(curveEntity.Id, "Importer.EntityFamily"));
}
@@ -1117,7 +1124,8 @@ public static class Step242Importer
points = [circle.Evaluate(trim.Start), circle.Evaluate(mid), circle.Evaluate(trim.End)];
break;
default:
- return LoopRoleFailure<IReadOnlyList<Point3D>>("Unsupported curve kind for loop sampling.", "Importer.LoopRole.WindingConflict");
+ points = [];
+ break;
}
if (isReversed)
diff --git a/testdata/step242/manifests/nist.v0.report.json b/testdata/step242/manifests/nist.v0.report.json
index 20d6ea20..f30d7988 100644
--- a/testdata/step242/manifests/nist.v0.report.json
+++ b/testdata/step242/manifests/nist.v0.report.json
@@ -52,11 +52,11 @@
"path": "testdata/step242/nist/CTC/nist_ctc_03_asme1_ap242-e2.stp",
"sizeBytes": 667521,
"status": "importFail",
- "firstFailureLayer": "tessellator",
+ "firstFailureLayer": "exporter",
"firstDiagnostic": {
"code": "NotImplemented",
- "source": "",
- "messagePrefix": "Face 72 planar tessellation supports only all-line loops or a single circle loop."
+ "source": "Face:1",
+ "messagePrefix": "Unsupported surface kind \u0027Cylinder\u0027. M22 supports planar faces only."
},
"diagnosticCount": 1,
"exceptionEscaped": false,
@@ -66,8 +66,8 @@
"faces": 120
},
"tessellationCounts": {
- "facePatches": 0,
- "edgePolylines": 0
+ "facePatches": 120,
+ "edgePolylines": 354
},
"canonicalSha256": null
},
diff --git a/testdata/step242/tessellation-robustness/planar-loop-unsupported-curve.step b/testdata/step242/tessellation-robustness/planar-loop-unsupported-curve.step
new file mode 100644
index 00000000..bcd83352
--- /dev/null
+++ b/testdata/step242/tessellation-robustness/planar-loop-unsupported-curve.step
@@ -0,0 +1,44 @@
+ISO-10303-21;
+HEADER;
+ENDSEC;
+DATA;
+#1=MANIFOLD_SOLID_BREP('solid',#2);
+#2=CLOSED_SHELL($,(#3));
+#3=ADVANCED_FACE((#4),#5,.T.);
+#4=FACE_OUTER_BOUND($,#6,.T.);
+#5=PLANE($,#7);
+#6=EDGE_LOOP($,(#10,#11,#12,#13));
+#7=AXIS2_PLACEMENT_3D($,#70,#71,#72);
+#10=ORIENTED_EDGE($,$,$,#20,.T.);
+#11=ORIENTED_EDGE($,$,$,#21,.T.);
+#12=ORIENTED_EDGE($,$,$,#22,.T.);
+#13=ORIENTED_EDGE($,$,$,#23,.T.);
+#20=EDGE_CURVE($,#30,#31,#40,.T.);
+#21=EDGE_CURVE($,#31,#32,#41,.T.);
+#22=EDGE_CURVE($,#32,#33,#42,.T.);
+#23=EDGE_CURVE($,#33,#30,#43,.T.);
+#30=VERTEX_POINT($,#50);
+#31=VERTEX_POINT($,#51);
+#32=VERTEX_POINT($,#52);
+#33=VERTEX_POINT($,#53);
+#40=AETHERIS_PLANAR_UNSUPPORTED_CURVE($,#90);
+#41=LINE($,#51,#80);
+#42=LINE($,#52,#81);
+#43=LINE($,#53,#82);
+#50=CARTESIAN_POINT($,(0,0,0));
+#51=CARTESIAN_POINT($,(10,0,0));
+#52=CARTESIAN_POINT($,(10,5,0));
+#53=CARTESIAN_POINT($,(0,5,0));
+#70=CARTESIAN_POINT($,(0,0,0));
+#71=DIRECTION($,(0,0,1));
+#72=DIRECTION($,(1,0,0));
+#80=VECTOR($,#84,1.0);
+#81=VECTOR($,#85,1.0);
+#82=VECTOR($,#86,1.0);
+#84=DIRECTION($,(0,1,0));
+#85=DIRECTION($,(-1,0,0));
+#86=DIRECTION($,(0,-1,0));
+#90=AXIS2_PLACEMENT_3D($,#91,#71,#72);
+#91=CARTESIAN_POINT($,(5,0,0));
+ENDSEC;
+END-ISO-10303-21;
diff --git a/testdata/step242/tessellation-robustness/planar-rect-with-filleted-corners.step b/testdata/step242/tessellation-robustness/planar-rect-with-filleted-corners.step
new file mode 100644
index 00000000..26240196
--- /dev/null
+++ b/testdata/step242/tessellation-robustness/planar-rect-with-filleted-corners.step
@@ -0,0 +1,72 @@
+ISO-10303-21;
+HEADER;
+ENDSEC;
+DATA;
+#1=MANIFOLD_SOLID_BREP('solid',#2);
+#2=CLOSED_SHELL($,(#3));
+#3=ADVANCED_FACE((#4),#5,.T.);
+#4=FACE_OUTER_BOUND($,#6,.T.);
+#5=PLANE($,#7);
+#6=EDGE_LOOP($,(#10,#11,#12,#13,#14,#15,#16,#17));
+#7=AXIS2_PLACEMENT_3D($,#70,#71,#72);
+#10=ORIENTED_EDGE($,$,$,#20,.T.);
+#11=ORIENTED_EDGE($,$,$,#21,.T.);
+#12=ORIENTED_EDGE($,$,$,#22,.T.);
+#13=ORIENTED_EDGE($,$,$,#23,.T.);
+#14=ORIENTED_EDGE($,$,$,#24,.T.);
+#15=ORIENTED_EDGE($,$,$,#25,.T.);
+#16=ORIENTED_EDGE($,$,$,#26,.T.);
+#17=ORIENTED_EDGE($,$,$,#27,.T.);
+#20=EDGE_CURVE($,#30,#31,#40,.T.);
+#21=EDGE_CURVE($,#31,#32,#41,.T.);
+#22=EDGE_CURVE($,#32,#33,#42,.T.);
+#23=EDGE_CURVE($,#33,#34,#43,.T.);
+#24=EDGE_CURVE($,#34,#35,#44,.T.);
+#25=EDGE_CURVE($,#35,#36,#45,.T.);
+#26=EDGE_CURVE($,#36,#37,#46,.T.);
+#27=EDGE_CURVE($,#37,#30,#47,.T.);
+#30=VERTEX_POINT($,#50);
+#31=VERTEX_POINT($,#51);
+#32=VERTEX_POINT($,#52);
+#33=VERTEX_POINT($,#53);
+#34=VERTEX_POINT($,#54);
+#35=VERTEX_POINT($,#55);
+#36=VERTEX_POINT($,#56);
+#37=VERTEX_POINT($,#57);
+#40=LINE($,#50,#80);
+#41=CIRCLE($,#90,1.0);
+#42=LINE($,#52,#81);
+#43=CIRCLE($,#91,1.0);
+#44=LINE($,#54,#82);
+#45=CIRCLE($,#92,1.0);
+#46=LINE($,#56,#83);
+#47=CIRCLE($,#93,1.0);
+#50=CARTESIAN_POINT($,(1,0,0));
+#51=CARTESIAN_POINT($,(9,0,0));
+#52=CARTESIAN_POINT($,(10,1,0));
+#53=CARTESIAN_POINT($,(10,9,0));
+#54=CARTESIAN_POINT($,(9,10,0));
+#55=CARTESIAN_POINT($,(1,10,0));
+#56=CARTESIAN_POINT($,(0,9,0));
+#57=CARTESIAN_POINT($,(0,1,0));
+#70=CARTESIAN_POINT($,(0,0,0));
+#71=DIRECTION($,(0,0,1));
+#72=DIRECTION($,(1,0,0));
+#80=VECTOR($,#84,1.0);
+#81=VECTOR($,#85,1.0);
+#82=VECTOR($,#86,1.0);
+#83=VECTOR($,#87,1.0);
+#84=DIRECTION($,(1,0,0));
+#85=DIRECTION($,(0,1,0));
+#86=DIRECTION($,(-1,0,0));
+#87=DIRECTION($,(0,-1,0));
+#90=AXIS2_PLACEMENT_3D($,#94,#71,#72);
+#91=AXIS2_PLACEMENT_3D($,#95,#71,#72);
+#92=AXIS2_PLACEMENT_3D($,#96,#71,#72);
+#93=AXIS2_PLACEMENT_3D($,#97,#71,#72);
+#94=CARTESIAN_POINT($,(9,1,0));
+#95=CARTESIAN_POINT($,(9,9,0));
+#96=CARTESIAN_POINT($,(1,9,0));
+#97=CARTESIAN_POINT($,(1,1,0));
+ENDSEC;
+END-ISO-10303-21;