Skip to content

Next Gen STEP AP242 Native-ish BREP Geometric Modeling Kernel

Fix torus normalization and validate with .NET 8 test runs

Yuechen Li0693b523601e
diff --git a/Aetheris.Kernel.Core.Tests/Geometry/SurfacePrimitivesTests.cs b/Aetheris.Kernel.Core.Tests/Geometry/SurfacePrimitivesTests.cs
index 7f95ae2b..8eafe00d 100644
--- a/Aetheris.Kernel.Core.Tests/Geometry/SurfacePrimitivesTests.cs
+++ b/Aetheris.Kernel.Core.Tests/Geometry/SurfacePrimitivesTests.cs
@@ -121,6 +121,42 @@ public sealed class SurfacePrimitivesTests
Assert.True(normal.X > 0);
}
+
+ [Theory]
+ [InlineData(0, 1)]
+ [InlineData(1, 0)]
+ [InlineData(double.NaN, 1)]
+ [InlineData(1, double.PositiveInfinity)]
+ public void Torus_InvalidRadii_Throws(double majorRadius, double minorRadius)
+ {
+ Assert.Throws<ArgumentOutOfRangeException>(() =>
+ new TorusSurface(Point3D.Origin, Direction3D.Create(new Vector3D(0, 0, 1)), majorRadius, minorRadius, Direction3D.Create(new Vector3D(1, 0, 0))));
+ }
+
+ [Fact]
+ public void Torus_EvaluateAndNormal_AreCorrect()
+ {
+ var torus = new TorusSurface(
+ center: Point3D.Origin,
+ axis: Direction3D.Create(new Vector3D(0, 0, 1)),
+ majorRadius: 3,
+ minorRadius: 1,
+ referenceAxis: Direction3D.Create(new Vector3D(1, 0, 0)));
+
+ AssertPoint(torus.Evaluate(0, 0), new Point3D(4, 0, 0));
+ AssertPoint(torus.Evaluate(double.Pi / 2d, 0), new Point3D(0, 4, 0));
+ AssertPoint(torus.Evaluate(0, double.Pi / 2d), new Point3D(3, 0, 1));
+
+ var point = torus.Evaluate(1.1, -0.7);
+ var xy = new Vector3D(point.X, point.Y, 0);
+ Assert.True(xy.TryNormalize(out var majorDir));
+ var ringCenter = Point3D.Origin + (majorDir * torus.MajorRadius);
+ Assert.True(ToleranceMath.AlmostEqual((point - ringCenter).Length, torus.MinorRadius, ToleranceContext.Default));
+
+ var normal = torus.Normal(1.1, -0.7).ToVector();
+ Assert.True(ToleranceMath.AlmostEqual(normal.Length, 1, ToleranceContext.Default));
+ }
+
private static void AssertPoint(Point3D actual, Point3D expected) => AssertVector(actual - expected, Vector3D.Zero);
private static void AssertVector(Vector3D actual, Vector3D expected)
diff --git a/Aetheris.Kernel.Core.Tests/Step242/Step242ImporterTests.cs b/Aetheris.Kernel.Core.Tests/Step242/Step242ImporterTests.cs
index 3e346936..bb61355f 100644
--- a/Aetheris.Kernel.Core.Tests/Step242/Step242ImporterTests.cs
+++ b/Aetheris.Kernel.Core.Tests/Step242/Step242ImporterTests.cs
@@ -62,18 +62,18 @@ public sealed class Step242ImporterTests
}
[Fact]
- public void ImportBody_UnsupportedEntityInParseableText_ReturnsNotImplementedDiagnostic()
+ public void ImportBody_ToroidalSurfaceEntity_IsNoLongerRejectedAsUnsupportedFamily()
{
- var unsupported = Step242FixtureCorpus.UnsupportedToroidalSurface;
+ var toroidalOnly = Step242FixtureCorpus.UnsupportedToroidalSurface;
- var import = Step242Importer.ImportBody(unsupported);
+ var import = Step242Importer.ImportBody(toroidalOnly);
Assert.False(import.IsSuccess);
var diagnostic = Assert.Single(import.Diagnostics);
Assert.Equal(KernelDiagnosticCode.NotImplemented, diagnostic.Code);
Assert.Equal(KernelDiagnosticSeverity.Error, diagnostic.Severity);
- Assert.Equal("Importer.EntityFamily", diagnostic.Source);
- Assert.Contains("unsupported", diagnostic.Message, StringComparison.OrdinalIgnoreCase);
+ Assert.Equal("Importer.TopologyRoot", diagnostic.Source);
+ Assert.DoesNotContain("TOROIDAL_SURFACE", diagnostic.Message, StringComparison.OrdinalIgnoreCase);
}
[Fact]
@@ -367,6 +367,34 @@ public sealed class Step242ImporterTests
}
}
+
+ [Fact]
+ public void Step242_ToroidalFixture_ImportsAndTessellates()
+ {
+ var text = LoadFixture("testdata/step242/generated/v0-required/toroid.step");
+
+ var import = Step242Importer.ImportBody(text);
+ Assert.True(import.IsSuccess);
+ Assert.Contains(import.Value.Geometry.Surfaces, s => s.Value.Kind == SurfaceGeometryKind.Torus);
+
+ var tessellation = BrepDisplayTessellator.Tessellate(import.Value);
+ Assert.True(tessellation.IsSuccess);
+ Assert.NotEmpty(tessellation.Value.FacePatches);
+ }
+
+ [Fact]
+ public void Step242_NistFile_WithToroidalSurface_AdvancesPastToroidalBlocker()
+ {
+ var text = LoadFixture("testdata/step242/nist/FTC/nist_ftc_06_asme1_ap242-e2.stp");
+
+ var import = Step242Importer.ImportBody(text);
+
+ Assert.False(import.IsSuccess);
+ Assert.NotEmpty(import.Diagnostics);
+ var first = import.Diagnostics[0];
+ Assert.DoesNotContain("TOROIDAL_SURFACE", first.Message, StringComparison.OrdinalIgnoreCase);
+ }
+
private static double NormalizeToZeroTwoPi(double angle)
{
var twoPi = 2d * double.Pi;
diff --git a/Aetheris.Kernel.Core/Brep/Tessellation/BrepDisplayTessellator.cs b/Aetheris.Kernel.Core/Brep/Tessellation/BrepDisplayTessellator.cs
index ea86c8f2..a86aa69f 100644
--- a/Aetheris.Kernel.Core/Brep/Tessellation/BrepDisplayTessellator.cs
+++ b/Aetheris.Kernel.Core/Brep/Tessellation/BrepDisplayTessellator.cs
@@ -77,6 +77,7 @@ public static class BrepDisplayTessellator
SurfaceGeometryKind.Cylinder => TessellateCylinderFace(body, faceId, surface.Cylinder!.Value, options),
SurfaceGeometryKind.Cone => TessellateConeFace(body, faceId, surface.Cone!.Value, options),
SurfaceGeometryKind.Sphere => TessellateSphereFace(body, faceId, surface.Sphere!.Value, options),
+ SurfaceGeometryKind.Torus => TessellateTorusFace(body, faceId, surface.Torus!.Value, options),
_ => KernelResult<DisplayFaceMeshPatch>.Failure([CreateNotImplemented($"Face {faceId.Value} has unsupported surface kind '{surface.Kind}'.")]),
};
}
@@ -321,6 +322,25 @@ public static class BrepDisplayTessellator
return KernelResult<DisplayFaceMeshPatch>.Success(new DisplayFaceMeshPatch(faceId, positions, normals, indices));
}
+
+ private static KernelResult<DisplayFaceMeshPatch> TessellateTorusFace(BrepBody body, FaceId faceId, TorusSurface torus, DisplayTessellationOptions options)
+ {
+ var parameters = GetRevolvedFaceParameters(body, faceId, options, radiusHint: torus.MajorRadius + torus.MinorRadius);
+ if (!parameters.IsSuccess)
+ {
+ return KernelResult<DisplayFaceMeshPatch>.Failure(parameters.Diagnostics);
+ }
+
+ return KernelResult<DisplayFaceMeshPatch>.Success(CreatePeriodicGridPatch(
+ faceId,
+ parameters.Value.AngularSegments,
+ parameters.Value.AxialSegments,
+ (u, v) => torus.Evaluate(u, v),
+ (u, v) => torus.Normal(u, v).ToVector(),
+ parameters.Value.VStart,
+ parameters.Value.VEnd));
+ }
+
private static KernelResult<(double VStart, double VEnd, int AngularSegments, int AxialSegments)> GetRevolvedFaceParameters(
BrepBody body,
FaceId faceId,
diff --git a/Aetheris.Kernel.Core/Geometry/SurfaceGeometry.cs b/Aetheris.Kernel.Core/Geometry/SurfaceGeometry.cs
index 40c0d583..0ae442a8 100644
--- a/Aetheris.Kernel.Core/Geometry/SurfaceGeometry.cs
+++ b/Aetheris.Kernel.Core/Geometry/SurfaceGeometry.cs
@@ -8,6 +8,7 @@ public enum SurfaceGeometryKind
Cylinder,
Cone,
Sphere,
+ Torus,
}
/// <summary>
@@ -20,13 +21,15 @@ public sealed record SurfaceGeometry
PlaneSurface? plane,
CylinderSurface? cylinder,
ConeSurface? cone,
- SphereSurface? sphere)
+ SphereSurface? sphere,
+ TorusSurface? torus)
{
Kind = kind;
Plane = plane;
Cylinder = cylinder;
Cone = cone;
Sphere = sphere;
+ Torus = torus;
}
public SurfaceGeometryKind Kind { get; }
@@ -39,11 +42,15 @@ public sealed record SurfaceGeometry
public SphereSurface? Sphere { get; }
- public static SurfaceGeometry FromPlane(PlaneSurface plane) => new(SurfaceGeometryKind.Plane, plane, null, null, null);
+ public TorusSurface? Torus { get; }
- public static SurfaceGeometry FromCylinder(CylinderSurface cylinder) => new(SurfaceGeometryKind.Cylinder, null, cylinder, null, null);
+ public static SurfaceGeometry FromPlane(PlaneSurface plane) => new(SurfaceGeometryKind.Plane, plane, null, null, null, null);
- public static SurfaceGeometry FromCone(ConeSurface cone) => new(SurfaceGeometryKind.Cone, null, null, cone, null);
+ public static SurfaceGeometry FromCylinder(CylinderSurface cylinder) => new(SurfaceGeometryKind.Cylinder, null, cylinder, null, null, null);
- public static SurfaceGeometry FromSphere(SphereSurface sphere) => new(SurfaceGeometryKind.Sphere, null, null, null, sphere);
+ public static SurfaceGeometry FromCone(ConeSurface cone) => new(SurfaceGeometryKind.Cone, null, null, cone, null, null);
+
+ public static SurfaceGeometry FromSphere(SphereSurface sphere) => new(SurfaceGeometryKind.Sphere, null, null, null, sphere, null);
+
+ public static SurfaceGeometry FromTorus(TorusSurface torus) => new(SurfaceGeometryKind.Torus, null, null, null, null, torus);
}
diff --git a/Aetheris.Kernel.Core/Geometry/Surfaces/TorusSurface.cs b/Aetheris.Kernel.Core/Geometry/Surfaces/TorusSurface.cs
new file mode 100644
index 00000000..eeaacd89
--- /dev/null
+++ b/Aetheris.Kernel.Core/Geometry/Surfaces/TorusSurface.cs
@@ -0,0 +1,78 @@
+using Aetheris.Kernel.Core.Math;
+
+namespace Aetheris.Kernel.Core.Geometry.Surfaces;
+
+public readonly record struct TorusSurface
+{
+ private readonly Direction3D _xAxis;
+ private readonly Direction3D _yAxis;
+
+ public TorusSurface(Point3D center, Direction3D axis, double majorRadius, double minorRadius, Direction3D referenceAxis)
+ {
+ if (double.IsNaN(majorRadius) || double.IsInfinity(majorRadius) || majorRadius <= 0d)
+ {
+ throw new ArgumentOutOfRangeException(nameof(majorRadius), "Major radius must be positive and finite.");
+ }
+
+ if (double.IsNaN(minorRadius) || double.IsInfinity(minorRadius) || minorRadius <= 0d)
+ {
+ throw new ArgumentOutOfRangeException(nameof(minorRadius), "Minor radius must be positive and finite.");
+ }
+
+ Center = center;
+ Axis = axis;
+ MajorRadius = majorRadius;
+ MinorRadius = minorRadius;
+
+ var rawU = referenceAxis.ToVector();
+ if (!rawU.TryNormalize(out var u))
+ {
+ throw new ArgumentException("Reference axis must be non-degenerate.", nameof(referenceAxis));
+ }
+ var z = axis.ToVector();
+ var v = z.Cross(u);
+ if (v.LengthSquared <= 1e-24d)
+ {
+ throw new ArgumentException("Reference axis must not be collinear with axis.", nameof(referenceAxis));
+ }
+
+ _xAxis = Direction3D.Create(u);
+ _yAxis = Direction3D.Create(v);
+ }
+
+ public Point3D Center { get; }
+
+ public Direction3D Axis { get; }
+
+ public double MajorRadius { get; }
+
+ public double MinorRadius { get; }
+
+ public Direction3D XAxis => _xAxis;
+
+ public Direction3D YAxis => _yAxis;
+
+ public Point3D Evaluate(double u, double v)
+ {
+ var cosU = double.Cos(u);
+ var sinU = double.Sin(u);
+ var cosV = double.Cos(v);
+ var sinV = double.Sin(v);
+
+ var majorDirection = (_xAxis.ToVector() * cosU) + (_yAxis.ToVector() * sinU);
+ var radialDistance = MajorRadius + (MinorRadius * cosV);
+ return Center + (majorDirection * radialDistance) + (Axis.ToVector() * (MinorRadius * sinV));
+ }
+
+ public Direction3D Normal(double u, double v)
+ {
+ var cosU = double.Cos(u);
+ var sinU = double.Sin(u);
+ var cosV = double.Cos(v);
+ var sinV = double.Sin(v);
+
+ var majorDirection = (_xAxis.ToVector() * cosU) + (_yAxis.ToVector() * sinU);
+ var normal = (majorDirection * cosV) + (Axis.ToVector() * sinV);
+ return Direction3D.Create(normal);
+ }
+}
diff --git a/Aetheris.Kernel.Core/Step242/Step242Importer.cs b/Aetheris.Kernel.Core/Step242/Step242Importer.cs
index ffafd338..80c2058e 100644
--- a/Aetheris.Kernel.Core/Step242/Step242Importer.cs
+++ b/Aetheris.Kernel.Core/Step242/Step242Importer.cs
@@ -42,12 +42,6 @@ public static class Step242Importer
private static KernelResult<BrepBody> MapSubset(Step242ParsedDocument document)
{
- var unsupportedEntity = document.Entities.FirstOrDefault(IsClearlyUnsupportedEntity);
- if (unsupportedEntity is not null)
- {
- return Failure($"Entity family '{unsupportedEntity.Name}' is unsupported in M23 import subset.", SourceFor(unsupportedEntity.Id, "Importer.EntityFamily"));
- }
-
var manifoldSolidBreps = document.Entities
.Where(e => string.Equals(e.Name, "MANIFOLD_SOLID_BREP", StringComparison.OrdinalIgnoreCase))
.ToList();
@@ -438,11 +432,6 @@ public static class Step242Importer
return KernelResult<(VertexId VertexId, Point3D Point)>.Success(vertex);
}
- private static bool IsClearlyUnsupportedEntity(Step242ParsedEntity entity)
- {
- return string.Equals(entity.Name, "TOROIDAL_SURFACE", StringComparison.OrdinalIgnoreCase);
- }
-
private static KernelResult<(CurveGeometry CurveGeometry, ParameterInterval TrimInterval)> DecodeCurveGeometry(
Step242ParsedDocument document,
Step242ParsedEntity curveEntity,
@@ -586,6 +575,17 @@ public static class Step242Importer
return KernelResult<(SurfaceGeometryId SurfaceGeometryId, SurfaceGeometry SurfaceGeometry)>.Success((geometryId, SurfaceGeometry.FromCone(coneResult.Value)));
}
+ if (string.Equals(normalizedName, "TOROIDAL_SURFACE", StringComparison.Ordinal))
+ {
+ var torusResult = Step242SubsetDecoder.ReadToroidalSurface(document, surfaceToDecode);
+ if (!torusResult.IsSuccess)
+ {
+ return KernelResult<(SurfaceGeometryId SurfaceGeometryId, SurfaceGeometry SurfaceGeometry)>.Failure(torusResult.Diagnostics);
+ }
+
+ return KernelResult<(SurfaceGeometryId SurfaceGeometryId, SurfaceGeometry SurfaceGeometry)>.Success((geometryId, SurfaceGeometry.FromTorus(torusResult.Value)));
+ }
+
return FailureSurfaceBinding($"ADVANCED_FACE surface '{surfaceName}' is unsupported.", SourceFor(surfaceToDecode.Id, "Importer.EntityFamily"));
}
@@ -599,7 +599,8 @@ public static class Step242Importer
if (!string.Equals(surfaceName, "PLANE", StringComparison.Ordinal)
&& !string.Equals(surfaceName, "CYLINDRICAL_SURFACE", StringComparison.Ordinal)
&& !string.Equals(surfaceName, "CONICAL_SURFACE", StringComparison.Ordinal)
- && !string.Equals(surfaceName, "SPHERICAL_SURFACE", StringComparison.Ordinal))
+ && !string.Equals(surfaceName, "SPHERICAL_SURFACE", StringComparison.Ordinal)
+ && !string.Equals(surfaceName, "TOROIDAL_SURFACE", StringComparison.Ordinal))
{
return FailureInlineSurface<Step242ParsedEntity>($"ADVANCED_FACE surface: inline constructor '{surfaceName}' is not supported in this subset.", SourceFor(faceEntityId, "Importer.StepSyntax.InlineEntity"));
}
@@ -738,6 +739,41 @@ public static class Step242Importer
return FailureInlineSurface<IReadOnlyList<Step242Value>>("Inline ADVANCED_FACE.surface constructor 'SPHERICAL_SURFACE' has unsupported argument shape.", SourceFor(faceEntityId, "Importer.StepSyntax.InlineEntity"));
}
+ if (string.Equals(surfaceName, "TOROIDAL_SURFACE", StringComparison.Ordinal))
+ {
+ if (inlineArguments.Count == 3)
+ {
+ if (inlineArguments[0] is not Step242EntityReference
+ || inlineArguments[1] is not Step242NumberValue
+ || inlineArguments[2] is not Step242NumberValue)
+ {
+ return FailureInlineSurface<IReadOnlyList<Step242Value>>("Inline ADVANCED_FACE.surface constructor 'TOROIDAL_SURFACE' has unsupported argument shape.", SourceFor(faceEntityId, "Importer.StepSyntax.InlineEntity"));
+ }
+
+ return KernelResult<IReadOnlyList<Step242Value>>.Success([
+ Step242OmittedValue.Instance,
+ inlineArguments[0],
+ inlineArguments[1],
+ inlineArguments[2]
+ ]);
+ }
+
+ if (inlineArguments.Count == 4)
+ {
+ if (inlineArguments[0] is not Step242OmittedValue
+ || inlineArguments[1] is not Step242EntityReference
+ || inlineArguments[2] is not Step242NumberValue
+ || inlineArguments[3] is not Step242NumberValue)
+ {
+ return FailureInlineSurface<IReadOnlyList<Step242Value>>("Inline ADVANCED_FACE.surface constructor 'TOROIDAL_SURFACE' has unsupported argument shape.", SourceFor(faceEntityId, "Importer.StepSyntax.InlineEntity"));
+ }
+
+ return KernelResult<IReadOnlyList<Step242Value>>.Success(inlineArguments);
+ }
+
+ return FailureInlineSurface<IReadOnlyList<Step242Value>>("Inline ADVANCED_FACE.surface constructor 'TOROIDAL_SURFACE' has unsupported argument shape.", SourceFor(faceEntityId, "Importer.StepSyntax.InlineEntity"));
+ }
+
return KernelResult<IReadOnlyList<Step242Value>>.Success(inlineArguments);
}
diff --git a/Aetheris.Kernel.Core/Step242/Step242SubsetDecoder.cs b/Aetheris.Kernel.Core/Step242/Step242SubsetDecoder.cs
index 93af798d..c5326c43 100644
--- a/Aetheris.Kernel.Core/Step242/Step242SubsetDecoder.cs
+++ b/Aetheris.Kernel.Core/Step242/Step242SubsetDecoder.cs
@@ -298,6 +298,37 @@ internal static class Step242SubsetDecoder
}
}
+
+ public static KernelResult<TorusSurface> ReadToroidalSurface(Step242ParsedDocument document, Step242ParsedEntity torusEntity)
+ {
+ var placementResult = ReadAxis2Placement3D(document, torusEntity, 1, "TOROIDAL_SURFACE position", "Importer.Geometry.Torus");
+ if (!placementResult.IsSuccess)
+ {
+ return KernelResult<TorusSurface>.Failure(placementResult.Diagnostics);
+ }
+
+ var majorRadiusResult = ReadPositiveNumber(torusEntity, 2, "TOROIDAL_SURFACE major_radius", "Importer.Geometry.Torus");
+ if (!majorRadiusResult.IsSuccess)
+ {
+ return KernelResult<TorusSurface>.Failure(majorRadiusResult.Diagnostics);
+ }
+
+ var minorRadiusResult = ReadPositiveNumber(torusEntity, 3, "TOROIDAL_SURFACE minor_radius", "Importer.Geometry.Torus");
+ if (!minorRadiusResult.IsSuccess)
+ {
+ return KernelResult<TorusSurface>.Failure(minorRadiusResult.Diagnostics);
+ }
+
+ try
+ {
+ return KernelResult<TorusSurface>.Success(new TorusSurface(placementResult.Value.Origin, placementResult.Value.Axis, majorRadiusResult.Value, minorRadiusResult.Value, placementResult.Value.ReferenceAxis));
+ }
+ catch (ArgumentException)
+ {
+ return FailureTorus("Invalid TOROIDAL_SURFACE placement produced degenerate frame.", "Importer.Geometry.Torus");
+ }
+ }
+
public static KernelResult<Circle3Curve> ReadCircleCurve(Step242ParsedDocument document, Step242ParsedEntity circleEntity)
{
var placementResult = ReadAxis2Placement3D(document, circleEntity, 1, "CIRCLE position", "Importer.Geometry.Circle");
@@ -676,6 +707,8 @@ internal static class Step242SubsetDecoder
private static KernelResult<SphereSurface> FailureSphere(string message, string source) => Failure<SphereSurface>(KernelDiagnosticCode.InvalidArgument, message, source);
+ private static KernelResult<TorusSurface> FailureTorus(string message, string source) => Failure<TorusSurface>(KernelDiagnosticCode.InvalidArgument, message, source);
+
private static KernelResult<ConeSurface> FailureCone(string message, string source) => Failure<ConeSurface>(KernelDiagnosticCode.InvalidArgument, message, source);
private static KernelResult<(Point3D Origin, Direction3D Axis, Direction3D ReferenceAxis)> FailureAxisPlacement(string message, string source)
diff --git a/testdata/step242/generated/v0-required/toroid.step b/testdata/step242/generated/v0-required/toroid.step
new file mode 100644
index 00000000..235ec96b
--- /dev/null
+++ b/testdata/step242/generated/v0-required/toroid.step
@@ -0,0 +1,43 @@
+ISO-10303-21;
+HEADER;
+ENDSEC;
+DATA;
+#1=MANIFOLD_SOLID_BREP('toroid_patch',#2);
+#2=CLOSED_SHELL($,(#3));
+#3=ADVANCED_FACE((#4),#6,.T.);
+#4=FACE_OUTER_BOUND($,#7,.T.);
+#6=TOROIDAL_SURFACE($,#9,3.0,1.0);
+#7=EDGE_LOOP($,(#10,#11,#12,#13));
+#9=AXIS2_PLACEMENT_3D($,#90,#91,#92);
+#10=ORIENTED_EDGE($,$,$,#20,.T.);
+#11=ORIENTED_EDGE($,$,$,#21,.T.);
+#12=ORIENTED_EDGE($,$,$,#22,.F.);
+#13=ORIENTED_EDGE($,$,$,#23,.F.);
+#20=EDGE_CURVE($,#30,#31,#40,.T.);
+#21=EDGE_CURVE($,#31,#32,#41,.T.);
+#22=EDGE_CURVE($,#33,#32,#42,.T.);
+#23=EDGE_CURVE($,#30,#33,#43,.T.);
+#30=VERTEX_POINT($,#50);
+#31=VERTEX_POINT($,#51);
+#32=VERTEX_POINT($,#52);
+#33=VERTEX_POINT($,#53);
+#40=CIRCLE($,#60,3.7071067811865475);
+#41=LINE($,#51,#81);
+#42=CIRCLE($,#62,3.7071067811865475);
+#43=LINE($,#50,#80);
+#50=CARTESIAN_POINT($,(3.7071067811865475,0.0,-0.7071067811865475));
+#51=CARTESIAN_POINT($,(0.0,3.7071067811865475,-0.7071067811865475));
+#52=CARTESIAN_POINT($,(0.0,3.7071067811865475,0.7071067811865475));
+#53=CARTESIAN_POINT($,(3.7071067811865475,0.0,0.7071067811865475));
+#60=AXIS2_PLACEMENT_3D($,#93,#91,#92);
+#62=AXIS2_PLACEMENT_3D($,#94,#91,#92);
+#80=VECTOR($,#82,1.0);
+#81=VECTOR($,#82,1.0);
+#82=DIRECTION($,(0.0,0.0,1.0));
+#93=CARTESIAN_POINT($,(0.0,0.0,-0.7071067811865475));
+#94=CARTESIAN_POINT($,(0.0,0.0,0.7071067811865475));
+#90=CARTESIAN_POINT($,(0.0,0.0,0.0));
+#91=DIRECTION($,(0.0,0.0,1.0));
+#92=DIRECTION($,(1.0,0.0,0.0));
+ENDSEC;
+END-ISO-10303-21;
diff --git a/testdata/step242/manifests/nist.v0.report.json b/testdata/step242/manifests/nist.v0.report.json
index f30d7988..61cf7ada 100644
--- a/testdata/step242/manifests/nist.v0.report.json
+++ b/testdata/step242/manifests/nist.v0.report.json
@@ -76,11 +76,11 @@
"path": "testdata/step242/nist/CTC/nist_ctc_04_asme1_ap242-e1.stp",
"sizeBytes": 1265846,
"status": "importFail",
- "firstFailureLayer": "importer-topology",
+ "firstFailureLayer": "importer-geometry",
"firstDiagnostic": {
- "code": "NotImplemented",
- "source": "Importer.EntityFamily",
- "messagePrefix": "Entity family \u0027TOROIDAL_SURFACE\u0027 is unsupported in M23 import subset."
+ "code": "InvalidArgument",
+ "source": "Importer.Geometry.Cone",
+ "messagePrefix": "CONICAL_SURFACE radius"
},
"diagnosticCount": 1,
"exceptionEscaped": false,
@@ -102,9 +102,9 @@
"status": "importFail",
"firstFailureLayer": "importer-topology",
"firstDiagnostic": {
- "code": "NotImplemented",
- "source": "Importer.EntityFamily",
- "messagePrefix": "Entity family \u0027TOROIDAL_SURFACE\u0027 is unsupported in M23 import subset."
+ "code": "ValidationFailed",
+ "source": "Importer.LoopRole.DegenerateLoop",
+ "messagePrefix": "Loop projection is degenerate."
},
"diagnosticCount": 1,
"exceptionEscaped": false,
@@ -128,7 +128,7 @@
"firstDiagnostic": {
"code": "NotImplemented",
"source": "Importer.EntityFamily",
- "messagePrefix": "Entity family \u0027TOROIDAL_SURFACE\u0027 is unsupported in M23 import subset."
+ "messagePrefix": "EDGE_CURVE geometry \u0027BOUNDED_CURVE\u0027 is unsupported."
},
"diagnosticCount": 1,
"exceptionEscaped": false,
@@ -152,7 +152,7 @@
"firstDiagnostic": {
"code": "NotImplemented",
"source": "Importer.EntityFamily",
- "messagePrefix": "Entity family \u0027TOROIDAL_SURFACE\u0027 is unsupported in M23 import subset."
+ "messagePrefix": "EDGE_CURVE geometry \u0027B_SPLINE_CURVE_WITH_KNOTS\u0027 is unsupported."
},
"diagnosticCount": 1,
"exceptionEscaped": false,
@@ -198,9 +198,9 @@
"status": "importFail",
"firstFailureLayer": "importer-topology",
"firstDiagnostic": {
- "code": "NotImplemented",
- "source": "Importer.EntityFamily",
- "messagePrefix": "Entity family \u0027TOROIDAL_SURFACE\u0027 is unsupported in M23 import subset."
+ "code": "ValidationFailed",
+ "source": "Importer.Orientation.EdgeCurveSense",
+ "messagePrefix": "EDGE_CURVE same_sense semantics unsupported for this edge"
},
"diagnosticCount": 1,
"exceptionEscaped": false,
@@ -246,9 +246,9 @@
"status": "importFail",
"firstFailureLayer": "importer-topology",
"firstDiagnostic": {
- "code": "NotImplemented",
- "source": "Importer.EntityFamily",
- "messagePrefix": "Entity family \u0027TOROIDAL_SURFACE\u0027 is unsupported in M23 import subset."
+ "code": "ValidationFailed",
+ "source": "Importer.LoopRole.InnerNotContained",
+ "messagePrefix": "Inner loop is not contained by outer loop."
},
"diagnosticCount": 1,
"exceptionEscaped": false,
@@ -272,7 +272,7 @@
"firstDiagnostic": {
"code": "NotImplemented",
"source": "Importer.EntityFamily",
- "messagePrefix": "Entity family \u0027TOROIDAL_SURFACE\u0027 is unsupported in M23 import subset."
+ "messagePrefix": "EDGE_CURVE geometry \u0027B_SPLINE_CURVE_WITH_KNOTS\u0027 is unsupported."
},
"diagnosticCount": 1,
"exceptionEscaped": false,
@@ -294,9 +294,9 @@
"status": "importFail",
"firstFailureLayer": "importer-topology",
"firstDiagnostic": {
- "code": "NotImplemented",
- "source": "Importer.EntityFamily",
- "messagePrefix": "Entity family \u0027TOROIDAL_SURFACE\u0027 is unsupported in M23 import subset."
+ "code": "ValidationFailed",
+ "source": "Importer.LoopRole.DegenerateLoop",
+ "messagePrefix": "Loop projection is degenerate."
},
"diagnosticCount": 1,
"exceptionEscaped": false,
@@ -319,8 +319,8 @@
"firstFailureLayer": "importer-topology",
"firstDiagnostic": {
"code": "NotImplemented",
- "source": "Importer.EntityFamily",
- "messagePrefix": "Entity family \u0027TOROIDAL_SURFACE\u0027 is unsupported in M23 import subset."
+ "source": "Entity:227",
+ "messagePrefix": "AXIS2_PLACEMENT_3D ref direction"
},
"diagnosticCount": 1,
"exceptionEscaped": false,
@@ -340,18 +340,18 @@
"path": "testdata/step242/nist/STC/nist_stc_08_asme1_ap242-e3.stp",
"sizeBytes": 2239112,
"status": "importFail",
- "firstFailureLayer": "importer-topology",
+ "firstFailureLayer": "tessellator",
"firstDiagnostic": {
"code": "NotImplemented",
- "source": "Importer.EntityFamily",
- "messagePrefix": "Entity family \u0027TOROIDAL_SURFACE\u0027 is unsupported in M23 import subset."
+ "source": "",
+ "messagePrefix": "Face 46 sphere tessellation supports only untrimmed sphere faces with zero loops."
},
"diagnosticCount": 1,
"exceptionEscaped": false,
"topologyCounts": {
- "vertices": 0,
- "edges": 0,
- "faces": 0
+ "vertices": 442,
+ "edges": 705,
+ "faces": 270
},
"tessellationCounts": {
"facePatches": 0,
@@ -388,11 +388,11 @@
"path": "testdata/step242/nist/STC/nist_stc_10_asme1_ap242-e2.stp",
"sizeBytes": 4807322,
"status": "importFail",
- "firstFailureLayer": "importer-topology",
+ "firstFailureLayer": "importer-geometry",
"firstDiagnostic": {
- "code": "NotImplemented",
- "source": "Importer.EntityFamily",
- "messagePrefix": "Entity family \u0027TOROIDAL_SURFACE\u0027 is unsupported in M23 import subset."
+ "code": "ValidationFailed",
+ "source": "Importer.Geometry.CircleTrim",
+ "messagePrefix": "Unable to compute circle trim from supplied vertices."
},
"diagnosticCount": 1,
"exceptionEscaped": false,
diff --git a/testdata/step242/manifests/v0.corpus.json b/testdata/step242/manifests/v0.corpus.json
index 0bc4a8bc..ea3119fc 100644
--- a/testdata/step242/manifests/v0.corpus.json
+++ b/testdata/step242/manifests/v0.corpus.json
@@ -26,6 +26,12 @@
"group": "deferred",
"notes": "Sphere faces fixture is tracked but not required for v0 gate while loopless export support remains deferred (tracked in corpus, deferred from v0 pass gate until canonical export supports non-planar faces)"
},
+ {
+ "id": "gen_toroid_v0",
+ "path": "testdata/step242/generated/v0-required/toroid.step",
+ "group": "deferred",
+ "notes": "Toroidal face fixture for AP242 TOROIDAL_SURFACE import+tessellation regression coverage"
+ },
{
"id": "gen_hole_v0",
"path": "testdata/step242/generated/v0-required/gen_hole_v0.step",
@@ -42,16 +48,6 @@
"messagePrefix": "Multiple MANIFOLD_SOLID_BREP roots are unsupported"
}
},
- {
- "id": "exp_toroidal_surface",
- "path": "testdata/step242/generated/v0-expectedfail/toroidal_surface.step",
- "group": "expectedFail",
- "expectedFirstDiagnostic": {
- "code": "NotImplemented",
- "source": "Importer.EntityFamily",
- "messagePrefix": "Entity family 'TOROIDAL_SURFACE' is unsupported"
- }
- },
{
"id": "exp_cylinder_hole_unsupported",
"path": "testdata/step242/generated/v0-expectedfail/cylinder_hole_unsupported.step",