Skip to content

Next Gen STEP AP242 Native-ish BREP Geometric Modeling Kernel

Reject a missing wire frame body and exercise packaged NativeAOT Forge

Yuechen Lid4e80c228536
diff --git a/.github/workflows/dotnet.yml b/.github/workflows/dotnet.yml
index 897f7cb0..65f6e3e4 100644
--- a/.github/workflows/dotnet.yml
+++ b/.github/workflows/dotnet.yml
@@ -187,6 +187,11 @@ jobs:
& $cli build smoke.firmament
& $cli inspect smoke.firmament
& $cli verify smoke.firmament
+ $forge = (Resolve-Path extracted/Aetheris-win-x64/forge-host/Aetheris.Forge.Host.exe)
+ & $forge info
+ & $forge list
+ & $forge invoke Standard.SheetMetal.ElectronicsEnclosure --request extracted/Aetheris-win-x64/samples/forge-interop-x1/request.json --out forge-out
+ if (-not (Test-Path forge-out/*.step) -or -not (Test-Path forge-out/*.svg)) { throw 'NativeAOT Forge artifacts missing.' }
Copy-Item '${{ github.workspace }}/fixtures/Regression/Assembly/bearing-module-family-with-legacy-placement.firmament' assembly.firmament
& $cli asm inspect assembly.firmament --json
Copy-Item '${{ github.workspace }}/fixtures/Canonical/Drawings/bearing-block-production-drawing.firmament' drawing.firmament
diff --git a/Aetheris.Kernel.Firmament.Tests/WireFormTests.cs b/Aetheris.Kernel.Firmament.Tests/WireFormTests.cs
index 2a01a4fe..4ad793c1 100644
--- a/Aetheris.Kernel.Firmament.Tests/WireFormTests.cs
+++ b/Aetheris.Kernel.Firmament.Tests/WireFormTests.cs
@@ -7,6 +7,14 @@ namespace Aetheris.Kernel.Firmament.Tests;
public sealed class WireFormTests
{
+ [Fact]
+ public void MissingStartFrameBodyProducesAnActionableRefusal()
+ {
+ var result = WireFormAuthoring.Parse("Model Invalid { units: mm WireForm Wire { Diameter: 2mm StartFrame Empty; Straight Body { Length: 20mm } } }");
+ Assert.False(result.IsSuccess);
+ Assert.Contains(result.Diagnostics, d => d.Message.Contains("StartFrame requires a body", StringComparison.Ordinal));
+ }
+
[Fact]
public void ThinGuitarStringNutBreakKeepsItsTangentJoinAndExactSweep()
{
diff --git a/Aetheris.Kernel.Firmament/Materializer/WireForm.cs b/Aetheris.Kernel.Firmament/Materializer/WireForm.cs
index 9ad072b2..737c96a5 100644
--- a/Aetheris.Kernel.Firmament/Materializer/WireForm.cs
+++ b/Aetheris.Kernel.Firmament/Materializer/WireForm.cs
@@ -181,7 +181,9 @@ public static class WireFormAuthoring
var frameFields = wireFields;
if (startFrames.Length == 1)
{
- var frame = startFrames[0].Body!.ContentSpan;
+ if (startFrames[0].Body is not { } frameBody)
+ return Fail("wireform-start-frame-invalid", "StartFrame requires a body containing Origin, Tangent and Up.");
+ var frame = frameBody.ContentSpan;
frameFields = new WireFormFields("StartFrame", ("WireForm {\n" + body + "\n}").Substring(frame.Start, frame.Length));
}