Skip to content

Next Gen STEP AP242 Native-ish BREP Geometric Modeling Kernel

Add StandardPart parsing and STEP export support

Yuechen Li95195c4668f8
diff --git a/Aetheris.CLI/CliRunner.cs b/Aetheris.CLI/CliRunner.cs
index 4497e89b..6806e062 100644
--- a/Aetheris.CLI/CliRunner.cs
+++ b/Aetheris.CLI/CliRunner.cs
@@ -422,6 +422,7 @@ public static class CliRunner
hollow = build.Value.Export.Hollow,
lattice = build.Value.Export.Lattice,
combined = build.Value.Export.Combined,
+ standardPart = build.Value.Export.StandardPart,
assertions = build.Value.Export.Assertions,
features = build.Value.Export.Features,
inlineStepMigration = build.Value.Export.InlineStepMigration,
@@ -438,6 +439,8 @@ public static class CliRunner
stdout.WriteLine($"Built {Path.GetFileName(build.Value.SourcePath)}");
stdout.WriteLine($"STEP: {build.Value.OutputPath}");
stdout.WriteLine($"Model: {build.Value.Export.ExportedFeatureId}");
+ if (build.Value.Export.StandardPart is { } standardPart)
+ stdout.WriteLine($"Standard part: {standardPart.Family} via {standardPart.Template ?? "direct record"} ({standardPart.SemanticDescendants.Count} semantic descendants)");
}
return 0;
diff --git a/Aetheris.Kernel.Core/Step242/Step242Exporter.cs b/Aetheris.Kernel.Core/Step242/Step242Exporter.cs
index fbbb1e46..8831899b 100644
--- a/Aetheris.Kernel.Core/Step242/Step242Exporter.cs
+++ b/Aetheris.Kernel.Core/Step242/Step242Exporter.cs
@@ -65,8 +65,9 @@ public static class Step242Exporter
var bsplineIds = new Dictionary<EdgeId, string>();
var ellipseIds = new Dictionary<EdgeId, string>();
var hyperbolaIds = new Dictionary<EdgeId, string>();
+ var surfaceIds = new Dictionary<SurfaceGeometryId, string>();
- var outerClosedShellId = BuildClosedShell(writer, body, model, shellRepresentation.OuterShellId, vertexPoints, cartesianPointIds, vertexPointIds, edgeCurveIds, orientedEdgeIds, lineIds, circleIds, bsplineIds, ellipseIds, hyperbolaIds, options.EmitFullCircleTrimmedCurves);
+ var outerClosedShellId = BuildClosedShell(writer, body, model, shellRepresentation.OuterShellId, vertexPoints, cartesianPointIds, vertexPointIds, edgeCurveIds, orientedEdgeIds, lineIds, circleIds, bsplineIds, ellipseIds, hyperbolaIds, surfaceIds, options.EmitFullCircleTrimmedCurves);
EmitAuxiliaryVertexPointForVertexlessAnalyticBody(writer, body, model);
if (outerClosedShellId is null)
{
@@ -83,7 +84,7 @@ public static class Step242Exporter
var orientedVoidShellIds = new List<string>();
foreach (var innerShellId in shellRepresentation.InnerShellIds.OrderBy(id => id.Value))
{
- var innerClosedShellId = BuildClosedShell(writer, body, model, innerShellId, vertexPoints, cartesianPointIds, vertexPointIds, edgeCurveIds, orientedEdgeIds, lineIds, circleIds, bsplineIds, ellipseIds, hyperbolaIds, options.EmitFullCircleTrimmedCurves);
+ var innerClosedShellId = BuildClosedShell(writer, body, model, innerShellId, vertexPoints, cartesianPointIds, vertexPointIds, edgeCurveIds, orientedEdgeIds, lineIds, circleIds, bsplineIds, ellipseIds, hyperbolaIds, surfaceIds, options.EmitFullCircleTrimmedCurves);
if (innerClosedShellId is null)
{
return Failure($"Shell {innerShellId.Value} could not be exported.", $"Shell:{innerShellId.Value}");
@@ -161,6 +162,7 @@ public static class Step242Exporter
Dictionary<EdgeId, string> bsplineIds,
Dictionary<EdgeId, string> ellipseIds,
Dictionary<EdgeId, string> hyperbolaIds,
+ Dictionary<SurfaceGeometryId, string> surfaceIds,
bool emitFullCircleTrimmedCurves)
{
if (!model.TryGetShell(shellId, out var shell) || shell is null)
@@ -186,10 +188,12 @@ public static class Step242Exporter
return null;
}
- var surfaceIdResult = BuildSurface(writer, surface, face.Id);
- if (!surfaceIdResult.IsSuccess)
+ if (!surfaceIds.TryGetValue(faceBinding.SurfaceGeometryId, out var surfaceEntityId))
{
- return null;
+ var surfaceIdResult = BuildSurface(writer, surface, face.Id);
+ if (!surfaceIdResult.IsSuccess) return null;
+ surfaceEntityId = surfaceIdResult.Value;
+ surfaceIds[faceBinding.SurfaceGeometryId] = surfaceEntityId;
}
var loopBoundIds = new List<string>();
@@ -238,7 +242,7 @@ public static class Step242Exporter
"ADVANCED_FACE",
Step242TextWriter.String(string.Empty),
Step242TextWriter.List(loopBoundIds.ToArray()),
- Step242TextWriter.Ref(surfaceIdResult.Value),
+ Step242TextWriter.Ref(surfaceEntityId),
Step242TextWriter.BooleanLogical(faceBinding.SameSense));
faceIds.Add(advancedFaceId);
diff --git a/Aetheris.Kernel.Firmament.Tests/HexBoltStandardLibraryM1Tests.cs b/Aetheris.Kernel.Firmament.Tests/HexBoltStandardLibraryM1Tests.cs
new file mode 100644
index 00000000..4472f57e
--- /dev/null
+++ b/Aetheris.Kernel.Firmament.Tests/HexBoltStandardLibraryM1Tests.cs
@@ -0,0 +1,150 @@
+using System.Security.Cryptography;
+using System.Text;
+using System.Text.RegularExpressions;
+using Aetheris.Kernel.Core.Brep;
+using Aetheris.Kernel.Core.Geometry;
+using Aetheris.Kernel.Core.Geometry.Curves;
+using Aetheris.Kernel.Core.Step242;
+using Aetheris.Kernel.Firmament.FirmamentV2;
+using Aetheris.Kernel.StandardLibrary;
+
+namespace Aetheris.Kernel.Firmament.Tests;
+
+public sealed class HexBoltStandardLibraryM1Tests
+{
+ private static HexBoltDefinition Reference()
+ {
+ var result = HexBoltBuilder.Create(McMasterHexBoltSpecs.Reference91180A151, "McMaster91180A151");
+ Assert.True(result.IsSuccess, string.Join(Environment.NewLine, result.Diagnostics));
+ return result.Value;
+ }
+
+ [Fact]
+ public void RegularHex_DerivesReferenceDimensions()
+ {
+ var dimensions = HexBoltBuilder.Derive(McMasterHexBoltSpecs.Reference91180A151);
+ Assert.Equal(6.5d, dimensions.HeadApothem, 12);
+ Assert.Equal(13d / Math.Sqrt(3d), dimensions.HeadCircumradius, 12);
+ Assert.Equal(6.175d, dimensions.TopFlatRadius, 12);
+ Assert.Equal(65d, dimensions.TopConeSemiAngleDegrees, 12);
+ Assert.Equal(34.0625d, dimensions.TipChamferStartX, 12);
+ Assert.True(dimensions.TopConeCornerX < 0d);
+ }
+
+ [Fact]
+ public void ReferenceBody_IsExactManifoldWithHyperbolicConeHexTrims()
+ {
+ var bolt = Reference();
+ Assert.True(BrepExportPreflight.Validate(bolt.Body).IsValid);
+ Assert.Equal(6, bolt.Body.Geometry.Curves.Count(pair => pair.Value.Kind == CurveGeometryKind.Hyperbola3));
+ Assert.Equal(0, bolt.Body.Geometry.Curves.Count(pair => pair.Value.Kind == CurveGeometryKind.BSpline3));
+ Assert.Equal(6, bolt.Body.Topology.Faces.Count(face =>
+ bolt.Body.TryGetFaceSurfaceGeometry(face.Id, out var surface)
+ && surface?.Kind == SurfaceGeometryKind.Cone
+ && Math.Abs(surface.Cone!.Value.SemiAngleRadians - 65d * Math.PI / 180d) < 1e-12));
+ Assert.Single(bolt.Body.Geometry.Surfaces.Select(pair => pair.Value), surface =>
+ surface.Kind == SurfaceGeometryKind.Cone
+ && Math.Abs(surface.Cone!.Value.SemiAngleRadians - 65d * Math.PI / 180d) < 1e-12);
+ }
+
+ [Fact]
+ public void ReferenceBody_HasStableSemanticDescendantsAndThreadIsCylinderOnly()
+ {
+ var bolt = Reference();
+ var ids = bolt.Semantics.Descendants.Select(descendant => descendant.StableId).ToArray();
+ Assert.Contains("McMaster91180A151.Head.TopFlat", ids);
+ Assert.Contains("McMaster91180A151.Head.TopChamfer", ids);
+ Assert.Contains("McMaster91180A151.Head.Side[5]", ids);
+ Assert.Contains("McMaster91180A151.Shank", ids);
+ Assert.Contains("McMaster91180A151.ThreadRegion", ids);
+ Assert.Contains("McMaster91180A151.TipChamfer", ids);
+ Assert.Contains("McMaster91180A151.TipFace", ids);
+ var thread = Assert.Single(bolt.Semantics.Descendants, descendant => descendant.StableId.EndsWith(".ThreadRegion", StringComparison.Ordinal));
+ Assert.Contains("material-geometry=Cylinder", thread.Metadata, StringComparison.Ordinal);
+ Assert.Equal("M8 x 1.25", bolt.Semantics.Metadata["ThreadDesignation"]);
+ Assert.Equal("8.8", bolt.Semantics.Metadata["PropertyClass"]);
+ }
+
+ [Fact]
+ public void ReferenceStep_IsDeterministicAndReimportsWithoutNurbs()
+ {
+ var bolt = Reference();
+ var first = Step242Exporter.ExportBody(bolt.Body);
+ var second = Step242Exporter.ExportBody(bolt.Body);
+ Assert.True(first.IsSuccess, string.Join(Environment.NewLine, first.Diagnostics));
+ Assert.True(second.IsSuccess, string.Join(Environment.NewLine, second.Diagnostics));
+ Assert.Equal(Hash(first.Value), Hash(second.Value));
+ Assert.Contains("HYPERBOLA(", first.Value, StringComparison.Ordinal);
+ Assert.Equal(6, Regex.Matches(first.Value, "HYPERBOLA\\(", RegexOptions.CultureInvariant).Count);
+ Assert.Equal(2, Regex.Matches(first.Value, "CONICAL_SURFACE\\(", RegexOptions.CultureInvariant).Count);
+ Assert.Single(Regex.Matches(first.Value, "CYLINDRICAL_SURFACE\\(", RegexOptions.CultureInvariant).Cast<Match>());
+ Assert.Single(Regex.Matches(first.Value, "TOROIDAL_SURFACE\\(", RegexOptions.CultureInvariant).Cast<Match>());
+ Assert.DoesNotContain("B_SPLINE_SURFACE", first.Value, StringComparison.Ordinal);
+ Assert.DoesNotContain("B_SPLINE_CURVE", first.Value, StringComparison.Ordinal);
+ var imported = Step242Importer.ImportBody(first.Value);
+ Assert.True(imported.IsSuccess, string.Join(Environment.NewLine, imported.Diagnostics));
+ Assert.Single(imported.Value.Topology.Bodies);
+ Assert.Single(imported.Value.Topology.Shells);
+ Assert.Equal(0, imported.Value.Geometry.Surfaces.Count(pair => pair.Value.Kind == SurfaceGeometryKind.BSplineSurfaceWithKnots));
+ }
+
+ [Fact]
+ public void InvalidHeadAndTipParameters_AreTypedRejections()
+ {
+ var reference = McMasterHexBoltSpecs.Reference91180A151;
+ var topOutside = HexBoltBuilder.Validate(reference with { TopFlatDiameter = 13d });
+ Assert.Contains(topOutside, diagnostic => diagnostic.Code == HexBoltAdmissionCode.TopFlatOutsideHex);
+ var consumed = HexBoltBuilder.Validate(reference with { HeadHeight = 0.1d });
+ Assert.Contains(consumed, diagnostic => diagnostic.Code == HexBoltAdmissionCode.TopChamferConsumesHead);
+ var tip = HexBoltBuilder.Validate(reference with { TipDiameter = 8d });
+ Assert.Contains(tip, diagnostic => diagnostic.Code == HexBoltAdmissionCode.TipChamferInvalid);
+ }
+
+ [Fact]
+ public void ParameterChangeDogfood_ChangesLengthAndDiameterWithoutGeometryCode()
+ {
+ var changed = McMasterHexBoltSpecs.Reference91180A151 with
+ {
+ NominalDiameter = 10d,
+ Length = 50d,
+ HeadAcrossFlats = 17d,
+ HeadHeight = 6.4d,
+ TopFlatDiameter = 16d,
+ TipDiameter = 8d,
+ ThreadLength = 26d,
+ ThreadDesignation = "M10 x 1.5"
+ };
+ var result = HexBoltBuilder.Create(changed, "DogfoodM10x50");
+ Assert.True(result.IsSuccess, string.Join(Environment.NewLine, result.Diagnostics));
+ Assert.Equal(49.0625d, result.Value.Dimensions.TipChamferStartX, 12);
+ Assert.NotEqual(Reference().DeterministicSignature, result.Value.DeterministicSignature);
+ Assert.True(Step242Importer.ImportBody(Step242Exporter.ExportBody(result.Value.Body).Value).IsSuccess);
+ }
+
+ [Fact]
+ public void CanonicalFirmamentFixture_MaterializesStandardLibraryBoltAndPublishesSemantics()
+ {
+ var sourcePath = Path.GetFullPath(Path.Combine(AppContext.BaseDirectory, "../../../../testdata/firmament/examples/mcmaster_91180a151_threadless_hex_bolt.firmament"));
+ var source = File.ReadAllText(sourcePath);
+ var parse = FirmamentV2Parser.Parse(source, Path.GetDirectoryName(sourcePath));
+ Assert.True(parse.IsSuccess, string.Join(Environment.NewLine, parse.Diagnostics));
+ Assert.IsType<FirmamentV2StandardPartRecord>(Assert.Single(parse.Document!.Solids).Primitive);
+ Assert.Equal("HexBoltSpec", Assert.Single(parse.Document.StaticAuthoring!.RecordTypes).Name);
+ Assert.Equal("HexBolt", Assert.Single(parse.Document.StaticAuthoring.Templates).Name);
+
+ var output = Path.Combine(Path.GetTempPath(), $"aetheris-hexbolt-{Guid.NewGuid():N}.step");
+ try
+ {
+ var build = FirmamentBuildAndExport.Run(sourcePath, output);
+ Assert.True(build.IsSuccess, string.Join(Environment.NewLine, build.Diagnostics.Select(diagnostic => diagnostic.Message)));
+ var report = Assert.IsType<FirmamentStandardPartReport>(build.Value.Export.StandardPart);
+ Assert.Equal("HexBolt", report.Family);
+ Assert.Equal("HexBolt", report.Template);
+ Assert.Contains(report.SemanticDescendants, descendant => descendant.StableId == "McMaster91180A151.Head.TopChamfer");
+ Assert.True(Step242Importer.ImportBody(build.Value.Export.StepText).IsSuccess);
+ }
+ finally { if (File.Exists(output)) File.Delete(output); }
+ }
+
+ private static string Hash(string text) => Convert.ToHexString(SHA256.HashData(Encoding.UTF8.GetBytes(text))).ToLowerInvariant();
+}
diff --git a/Aetheris.Kernel.Firmament/FirmamentBuildAndExport.cs b/Aetheris.Kernel.Firmament/FirmamentBuildAndExport.cs
index 2cc26941..05db532c 100644
--- a/Aetheris.Kernel.Firmament/FirmamentBuildAndExport.cs
+++ b/Aetheris.Kernel.Firmament/FirmamentBuildAndExport.cs
@@ -17,6 +17,7 @@ using Aetheris.Kernel.Core.Topology;
using Aetheris.Kernel.Firmament.Execution;
using Aetheris.Kernel.Firmament.FirmamentV2;
using Aetheris.Kernel.Firmament.Materializer;
+using Aetheris.Kernel.StandardLibrary;
namespace Aetheris.Kernel.Firmament;
@@ -192,6 +193,11 @@ public static class FirmamentBuildAndExport
return roundedBoxExport;
}
+ if (TryExportV2StandardPart(v2Parse.Document) is { } standardPartExport)
+ {
+ return standardPartExport;
+ }
+
// Do not let the existing semantic-hole route silently export the unmodified host.
// M9 has an explicit AIR/graph contract, but the authoritative single-body merge
// (retained box-with-void plus analytic struts/nodes/bonds) is not yet materialized.
@@ -283,6 +289,44 @@ public static class FirmamentBuildAndExport
return FirmamentStepExporter.Export(new FirmamentCompileRequest(new FirmamentSourceDocument(sourceText)));
}
+ private static KernelResult<FirmamentStepExportResult>? TryExportV2StandardPart(FirmamentV2Document document)
+ {
+ if (document.Solids.Count != 1 || document.Solid.StandardPart is not { } authored) return null;
+ var definition = StandardLibraryReusableParts.TryCreate(authored.Family, authored.Parameters);
+ if (!definition.IsSuccess) return KernelResult<FirmamentStepExportResult>.Failure(definition.Diagnostics);
+ if (definition.Value.HexBolt is not { } bolt)
+ {
+ return KernelResult<FirmamentStepExportResult>.Failure([new Kernel.Core.Diagnostics.KernelDiagnostic(
+ Kernel.Core.Diagnostics.KernelDiagnosticCode.NotImplemented,
+ Kernel.Core.Diagnostics.KernelDiagnosticSeverity.Error,
+ $"Firmament V2 StandardPart family '{authored.Family}' does not publish a typed part definition.",
+ "FirmamentV2.StandardPart")]);
+ }
+
+ var step = Step242Exporter.ExportBody(definition.Value.Body);
+ if (!step.IsSuccess) return KernelResult<FirmamentStepExportResult>.Failure(step.Diagnostics);
+ var semantics = bolt.Semantics.Descendants.Select(descendant => new FirmamentStandardPartSemanticReport(
+ descendant.StableId,
+ descendant.Kind.ToString(),
+ descendant.ParentStableId,
+ descendant.Face?.Value,
+ descendant.Metadata)).ToArray();
+ var report = new FirmamentStandardPartReport(
+ authored.Family,
+ document.StaticAuthoring?.Templates.SingleOrDefault()?.Name,
+ bolt.DeterministicSignature,
+ authored.Parameters,
+ semantics);
+ return KernelResult<FirmamentStepExportResult>.Success(new FirmamentStepExportResult(
+ step.Value,
+ bolt.Semantics.BodyStableId,
+ 0,
+ "standard-part",
+ authored.Family,
+ ConceptIr: document.ConceptIr,
+ StandardPart: report));
+ }
+
private static KernelResult<FirmamentStepExportResult> ExportComposedSemanticTopBoundaryChamfer(
string source, PrismaticProfileCompositionParseResult parsed, PrismaticSectionStackConstruction stack, PrismaticSectionStackEmissionResult emitted,
FirmamentV2Document? canonicalDocument)
diff --git a/Aetheris.Kernel.Firmament/FirmamentStepExportResult.cs b/Aetheris.Kernel.Firmament/FirmamentStepExportResult.cs
index 907e7669..f969328b 100644
--- a/Aetheris.Kernel.Firmament/FirmamentStepExportResult.cs
+++ b/Aetheris.Kernel.Firmament/FirmamentStepExportResult.cs
@@ -19,7 +19,22 @@ public sealed record FirmamentStepExportResult(
FirmamentHollowBodyReport? Hollow = null,
FirmamentStandaloneLatticeReport? Lattice = null,
FirmamentCombinedFeaturePlanReport? Combined = null,
- IReadOnlyList<Aetheris.Kernel.Firmament.FirmamentV2.FirmamentV2VolumeAssertionResult>? Assertions = null);
+ IReadOnlyList<Aetheris.Kernel.Firmament.FirmamentV2.FirmamentV2VolumeAssertionResult>? Assertions = null,
+ FirmamentStandardPartReport? StandardPart = null);
+
+public sealed record FirmamentStandardPartReport(
+ string Family,
+ string? Template,
+ string DeterministicSignature,
+ IReadOnlyDictionary<string, string> Parameters,
+ IReadOnlyList<FirmamentStandardPartSemanticReport> SemanticDescendants);
+
+public sealed record FirmamentStandardPartSemanticReport(
+ string StableId,
+ string Kind,
+ string? ParentStableId,
+ int? FaceId,
+ string? Metadata);
/// <summary>Compact inspection evidence for the bounded X1 composed feature route.</summary>
public sealed record FirmamentCombinedFeaturePlanReport(
diff --git a/Aetheris.Kernel.Firmament/FirmamentV2/CanonicalStaticAuthoring.cs b/Aetheris.Kernel.Firmament/FirmamentV2/CanonicalStaticAuthoring.cs
index 04d8eb2e..df3892c9 100644
--- a/Aetheris.Kernel.Firmament/FirmamentV2/CanonicalStaticAuthoring.cs
+++ b/Aetheris.Kernel.Firmament/FirmamentV2/CanonicalStaticAuthoring.cs
@@ -160,7 +160,7 @@ internal static class CanonicalStaticAuthoring
private static string? Instantiate(Template template, IReadOnlyDictionary<string, string> values, string id, bool patterned, List<string> diagnostics)
{
- var declaration = Regex.Match(template.Body, @"\b(?<kind>Hole\s*<\s*Shaft\s*>|Slot\s*<\s*(?:Capsule|RoundedRectangle)\s*>|Profile)\s+(?<name>[A-Za-z_]\w*)(?<tail>\s+Using\s+[A-Za-z_]\w*)?\s*\{", RegexOptions.CultureInvariant);
+ var declaration = Regex.Match(template.Body, @"\b(?<kind>Hole\s*<\s*Shaft\s*>|Slot\s*<\s*(?:Capsule|RoundedRectangle)\s*>|Profile|StandardPart)\s+(?<name>[A-Za-z_]\w*)(?<tail>\s+Using\s+[A-Za-z_]\w*)?\s*\{", RegexOptions.CultureInvariant);
if (!declaration.Success) { diagnostics.Add(Prefix + "template-output-unsupported:" + template.Name); return null; }
var kind = declaration.Groups["kind"].Value;
if (patterned && string.Equals(kind, "Profile", StringComparison.Ordinal))
@@ -177,7 +177,7 @@ internal static class CanonicalStaticAuthoring
: id.Replace("[", "_", StringComparison.Ordinal).Replace("]", string.Empty, StringComparison.Ordinal);
return $"{kind} {outputName}{declaration.Groups["tail"].Value} {{{body}}}";
}
- private static Dictionary<string, string> Fields(string body) => Regex.Matches(body, @"\b(?<name>[A-Za-z_]\w*)\s*:\s*(?<value>(?:Point2|Vector2|PlusMinus)\s*\([^)]*\)|[-+]?\d+(?:\.\d+)?(?:mm|deg)?)", RegexOptions.CultureInvariant)
+ private static Dictionary<string, string> Fields(string body) => Regex.Matches(body, "\\b(?<name>[A-Za-z_]\\w*)\\s*:\\s*(?<value>\"[^\"]*\"|(?:Point2|Vector2|PlusMinus)\\s*\\([^)]*\\)|[A-Za-z_]\\w*|[-+]?\\d+(?:\\.\\d+)?(?:mm|deg)?)", RegexOptions.CultureInvariant)
.Cast<Match>().ToDictionary(m => m.Groups["name"].Value, m => m.Groups["value"].Value, StringComparer.Ordinal);
private static Dictionary<string, string> RequireFields(string body) => Regex.Matches(body, @"(?<name>[A-Za-z_]\w*)\s*:\s*(?<value>.*?)(?=\s+[A-Za-z_]\w*\s*:|$)", RegexOptions.CultureInvariant | RegexOptions.Singleline)
.Cast<Match>().ToDictionary(m => m.Groups["name"].Value, m => m.Groups["value"].Value.Trim(), StringComparer.Ordinal);
diff --git a/Aetheris.Kernel.Firmament/FirmamentV2/FirmamentV2Ast.cs b/Aetheris.Kernel.Firmament/FirmamentV2/FirmamentV2Ast.cs
index 18010d20..333d2942 100644
--- a/Aetheris.Kernel.Firmament/FirmamentV2/FirmamentV2Ast.cs
+++ b/Aetheris.Kernel.Firmament/FirmamentV2/FirmamentV2Ast.cs
@@ -57,6 +57,7 @@ public sealed record FirmamentV2SolidBinding(string Name, string RecordType, Fir
public FirmamentV2TorusRecord? Torus => Primitive as FirmamentV2TorusRecord;
public FirmamentV2RoundedBoxRecord? RoundedBox => Primitive as FirmamentV2RoundedBoxRecord;
public FirmamentV2InlineStepRecord? InlineStep => Primitive as FirmamentV2InlineStepRecord;
+ public FirmamentV2StandardPartRecord? StandardPart => Primitive as FirmamentV2StandardPartRecord;
}
public abstract record FirmamentV2PrimitiveRecord;
@@ -71,6 +72,10 @@ public sealed record FirmamentV2RoundedBoxRecord(IReadOnlyList<double> Size, dou
public sealed record FirmamentV2FrustumRecord(double BottomRadius, double TopRadius, double Height) : FirmamentV2PrimitiveRecord;
/// <summary>Resolved by the profile/composition materialization routes rather than primitive lowering.</summary>
public sealed record FirmamentV2AdvancedMaterialRecord(string Kind) : FirmamentV2PrimitiveRecord;
+/// <summary>Record-shaped V2 invocation of a reusable StandardLibrary part family.</summary>
+public sealed record FirmamentV2StandardPartRecord(
+ string Family,
+ IReadOnlyDictionary<string, string> Parameters) : FirmamentV2PrimitiveRecord;
public sealed record FirmamentV2InlineStepRecord(string SourcePath, string NormalizedPath, string ContentHash, bool CanonicalInput, string CanonicalEvidence, ImportedStepTopologyMap TopologyMap) : FirmamentV2PrimitiveRecord;
public sealed record ImportedStepTopologyMap(IReadOnlyDictionary<string, string> FaceEntityToFaceId, IReadOnlyDictionary<string, string> FaceIdToFaceEntity)
{
diff --git a/Aetheris.Kernel.Firmament/FirmamentV2/FirmamentV2Parser.cs b/Aetheris.Kernel.Firmament/FirmamentV2/FirmamentV2Parser.cs
index 9e67ec0f..e89985f4 100644
--- a/Aetheris.Kernel.Firmament/FirmamentV2/FirmamentV2Parser.cs
+++ b/Aetheris.Kernel.Firmament/FirmamentV2/FirmamentV2Parser.cs
@@ -280,7 +280,7 @@ public static class FirmamentV2Parser
private static readonly Regex FillRegionHeaderRegex = new(@"\bregion\s+(?<name>[A-Za-z_][A-Za-z0-9_]*)\s*\{", RegexOptions.CultureInvariant);
private static readonly Regex FillHeaderRegex = new(@"\bfill\s+(?<name>[A-Za-z_][A-Za-z0-9_]*)\s*\{", RegexOptions.CultureInvariant);
private static readonly Regex CanonicalModelRegex = new(@"^\s*Model\s+(?<name>[A-Za-z_][A-Za-z0-9_]*)\s*\{", RegexOptions.CultureInvariant);
- private static readonly Regex CanonicalPrimitiveHeaderRegex = new(@"\b(?<type>Box|Cylinder|RoundedBox|Frustum)\s+(?<name>[A-Za-z_][A-Za-z0-9_]*)\s*\{", RegexOptions.CultureInvariant);
+ private static readonly Regex CanonicalPrimitiveHeaderRegex = new(@"\b(?<type>Box|Cylinder|RoundedBox|Frustum|StandardPart)\s+(?<name>[A-Za-z_][A-Za-z0-9_]*)\s*\{", RegexOptions.CultureInvariant);
private static readonly Regex CanonicalInlineStepHeaderRegex = new(@"\bInlineStep\s+(?<name>[A-Za-z_][A-Za-z0-9_]*)\s*\{", RegexOptions.CultureInvariant);
private static readonly Regex CanonicalModifyHeaderRegex = new(@"\bModify\s+(?<target>[A-Za-z_][A-Za-z0-9_]*)\s*\{", RegexOptions.CultureInvariant);
// Match the declaration-shaped header first; variant admission belongs in the
@@ -884,7 +884,7 @@ public static class FirmamentV2Parser
var known = new HashSet<string>(StringComparer.Ordinal)
{
- "Box", "Cylinder", "RoundedBox", "Frustum", "Concept", "Struct", "Construction", "Profile", "Compose", "EdgeFinish",
+ "Box", "Cylinder", "RoundedBox", "Frustum", "StandardPart", "Concept", "Struct", "Construction", "Profile", "Compose", "EdgeFinish",
"Record", "Static", "Template", "Selection", "InlineStep", "Recognize", "Replace", "Pmi", "Modify", "Match", "Require", "Assert"
};
var compatibilityOnly = new HashSet<string>(StringComparer.Ordinal)
@@ -1361,12 +1361,24 @@ public static class FirmamentV2Parser
var parsed = values.Select(ParsePhase3Length).ToArray();
return parsed.Length == 3 && parsed.All(v => double.IsFinite(v) && v > 0d) ? parsed : null;
}
+ FirmamentV2StandardPartRecord? StandardPart()
+ {
+ var matches = Regex.Matches(body, "\\b(?<name>[A-Za-z_]\\w*)\\s*:\\s*(?<value>\"[^\"]*\"|[A-Za-z_]\\w*|[-+]?\\d+(?:\\.\\d+)?(?:mm|deg)?)", RegexOptions.CultureInvariant).Cast<Match>().ToArray();
+ if (matches.Length == 0 || matches.Select(match => match.Groups["name"].Value).Distinct(StringComparer.Ordinal).Count() != matches.Length)
+ return null;
+ var fields = matches.ToDictionary(match => match.Groups["name"].Value, match => match.Groups["value"].Value, StringComparer.Ordinal);
+ if (!fields.Remove("Family", out var family)) return null;
+ family = family.Trim();
+ if (family.Length >= 2 && family[0] == '"' && family[^1] == '"') family = family[1..^1];
+ return string.IsNullOrWhiteSpace(family) ? null : new FirmamentV2StandardPartRecord(family, fields);
+ }
return type switch
{
"Box" when Size() is { } size => new FirmamentV2BoxRecord(size, []),
"Cylinder" when Number("Radius") is var radius && Number("Height") is var height && double.IsFinite(radius) && double.IsFinite(height) => new FirmamentV2CylinderRecord(radius, height),
"RoundedBox" when Size() is { } roundedSize && Number("CornerRadius") is var corner && double.IsFinite(corner) && corner < double.Min(roundedSize[0], roundedSize[1]) / 2d => new FirmamentV2RoundedBoxRecord(roundedSize, corner),
"Frustum" when Number("BottomRadius") is var bottom && Number("TopRadius") is var top && Number("Height") is var frustumHeight && double.IsFinite(bottom) && double.IsFinite(top) && double.IsFinite(frustumHeight) && double.Abs(bottom - top) > 1e-12d => new FirmamentV2FrustumRecord(bottom, top, frustumHeight),
+ "StandardPart" => StandardPart(),
_ => null
};
}
diff --git a/Aetheris.Kernel.StandardLibrary/HexBolt.cs b/Aetheris.Kernel.StandardLibrary/HexBolt.cs
new file mode 100644
index 00000000..152a3154
--- /dev/null
+++ b/Aetheris.Kernel.StandardLibrary/HexBolt.cs
@@ -0,0 +1,398 @@
+using System.Security.Cryptography;
+using System.Text;
+using Aetheris.Kernel.Core.Brep;
+using Aetheris.Kernel.Core.Diagnostics;
+using Aetheris.Kernel.Core.Geometry;
+using Aetheris.Kernel.Core.Geometry.Curves;
+using Aetheris.Kernel.Core.Geometry.Surfaces;
+using Aetheris.Kernel.Core.Math;
+using Aetheris.Kernel.Core.Results;
+using Aetheris.Kernel.Core.Topology;
+
+namespace Aetheris.Kernel.StandardLibrary;
+
+/// <summary>
+/// Engineering parameters for a threadless material representation of a hex-head bolt.
+/// Length values are millimetres and angles are degrees. Thread fields are semantic only.
+/// </summary>
+public sealed record HexBoltSpec(
+ double NominalDiameter,
+ double Length,
+ double HeadAcrossFlats,
+ double HeadHeight,
+ double TopFlatDiameter,
+ double TopChamferAngle,
+ double TipChamferLength,
+ double TipDiameter,
+ double ThreadLength,
+ string ThreadDesignation,
+ string PropertyClass,
+ double UnderHeadRadius = 0d);
+
+public static class McMasterHexBoltSpecs
+{
+ public const string ReferencePartNumber = "91180A151";
+
+ /// <summary>Audited from McMaster-Carr 91180A151_NO THREADS.STEP.</summary>
+ public static HexBoltSpec Reference91180A151 { get; } = new(
+ NominalDiameter: 8d,
+ Length: 35d,
+ HeadAcrossFlats: 13d,
+ HeadHeight: 5.3d,
+ TopFlatDiameter: 12.35d,
+ TopChamferAngle: 25d,
+ TipChamferLength: 0.9375d,
+ TipDiameter: 6.125d,
+ ThreadLength: 22d,
+ ThreadDesignation: "M8 x 1.25",
+ PropertyClass: "8.8",
+ UnderHeadRadius: 0.2d);
+}
+
+public enum HexBoltAdmissionCode
+{
+ NonFiniteOrNonPositiveDimension,
+ ThreadLengthOutsideShank,
+ TopFlatOutsideHex,
+ TopChamferConsumesHead,
+ TipChamferInvalid,
+ UnderHeadRadiusInvalid,
+ EmptySemanticMetadata
+}
+
+public sealed record HexBoltAdmissionDiagnostic(HexBoltAdmissionCode Code, string Field, string Message);
+
+public sealed record HexBoltDerivedDimensions(
+ double HeadApothem,
+ double HeadCircumradius,
+ double TopFlatRadius,
+ double TopConeSemiAngleDegrees,
+ double TopConeApexX,
+ double TopConeSideMidpointX,
+ double TopConeCornerX,
+ double TipChamferStartX);
+
+public enum HexBoltSemanticKind { Part, Region, Face }
+
+public sealed record HexBoltSemanticDescendant(
+ string StableId,
+ HexBoltSemanticKind Kind,
+ FaceId? Face = null,
+ string? ParentStableId = null,
+ string? Metadata = null);
+
+public sealed record HexBoltSemanticModel(
+ string BodyStableId,
+ IReadOnlyList<HexBoltSemanticDescendant> Descendants,
+ IReadOnlyDictionary<string, string> Metadata);
+
+public sealed record HexBoltDefinition(
+ HexBoltSpec Spec,
+ HexBoltDerivedDimensions Dimensions,
+ BrepBody Body,
+ HexBoltSemanticModel Semantics,
+ string DeterministicSignature);
+
+/// <summary>
+/// Exact bounded construction for the first StandardLibrary hex-bolt family. The top
+/// treatment is one coaxial cone trimmed by six analytic hyperbola edges.
+/// </summary>
+public static class HexBoltBuilder
+{
+ private const double Tolerance = 1e-9d;
+ private static readonly Direction3D PlusX = Direction3D.Create(new Vector3D(1d, 0d, 0d));
+ private static readonly Direction3D MinusX = Direction3D.Create(new Vector3D(-1d, 0d, 0d));
+ private static readonly Direction3D PlusY = Direction3D.Create(new Vector3D(0d, 1d, 0d));
+
+ public static IReadOnlyList<HexBoltAdmissionDiagnostic> Validate(HexBoltSpec spec)
+ {
+ ArgumentNullException.ThrowIfNull(spec);
+ var diagnostics = new List<HexBoltAdmissionDiagnostic>();
+ var positive = new (string Name, double Value)[]
+ {
+ (nameof(spec.NominalDiameter), spec.NominalDiameter),
+ (nameof(spec.Length), spec.Length),
+ (nameof(spec.HeadAcrossFlats), spec.HeadAcrossFlats),
+ (nameof(spec.HeadHeight), spec.HeadHeight),
+ (nameof(spec.TopFlatDiameter), spec.TopFlatDiameter),
+ (nameof(spec.TipDiameter), spec.TipDiameter)
+ };
+ foreach (var (name, value) in positive)
+ {
+ if (!double.IsFinite(value) || value <= Tolerance)
+ diagnostics.Add(new(HexBoltAdmissionCode.NonFiniteOrNonPositiveDimension, name, $"{name} must be finite and positive."));
+ }
+
+ if (!double.IsFinite(spec.TopChamferAngle) || spec.TopChamferAngle <= Tolerance || spec.TopChamferAngle >= 90d - Tolerance)
+ diagnostics.Add(new(HexBoltAdmissionCode.NonFiniteOrNonPositiveDimension, nameof(spec.TopChamferAngle), "TopChamferAngle must be in (0, 90) degrees."));
+ if (!double.IsFinite(spec.ThreadLength) || spec.ThreadLength < 0d || spec.ThreadLength > spec.Length + Tolerance)
+ diagnostics.Add(new(HexBoltAdmissionCode.ThreadLengthOutsideShank, nameof(spec.ThreadLength), "ThreadLength must lie in [0, Length]."));
+ if (!double.IsFinite(spec.UnderHeadRadius) || spec.UnderHeadRadius < 0d || spec.UnderHeadRadius >= spec.NominalDiameter / 2d)
+ diagnostics.Add(new(HexBoltAdmissionCode.UnderHeadRadiusInvalid, nameof(spec.UnderHeadRadius), "UnderHeadRadius must be non-negative and smaller than the shank radius."));
+ if (string.IsNullOrWhiteSpace(spec.ThreadDesignation) || string.IsNullOrWhiteSpace(spec.PropertyClass))
+ diagnostics.Add(new(HexBoltAdmissionCode.EmptySemanticMetadata, nameof(spec.ThreadDesignation), "ThreadDesignation and PropertyClass must be non-empty semantic metadata."));
+
+ if (diagnostics.Count > 0) return diagnostics;
+
+ var apothem = spec.HeadAcrossFlats / 2d;
+ var circumradius = spec.HeadAcrossFlats / double.Sqrt(3d);
+ var topRadius = spec.TopFlatDiameter / 2d;
+ if (topRadius >= apothem - Tolerance)
+ diagnostics.Add(new(HexBoltAdmissionCode.TopFlatOutsideHex, nameof(spec.TopFlatDiameter), "The top-flat circle must lie strictly inside the hex apothem."));
+
+ var coneSlope = 1d / double.Tan(spec.TopChamferAngle * double.Pi / 180d);
+ var axialToCorner = (circumradius - topRadius) / coneSlope;
+ if (axialToCorner >= spec.HeadHeight - Tolerance)
+ diagnostics.Add(new(HexBoltAdmissionCode.TopChamferConsumesHead, nameof(spec.HeadHeight), "The cone/hex corner intersection must remain above the under-head plane with non-zero side remnants."));
+
+ if (!double.IsFinite(spec.TipChamferLength) || spec.TipChamferLength <= Tolerance || spec.TipChamferLength >= spec.Length - spec.UnderHeadRadius - Tolerance
+ || spec.TipDiameter >= spec.NominalDiameter - Tolerance)
+ diagnostics.Add(new(HexBoltAdmissionCode.TipChamferInvalid, nameof(spec.TipChamferLength), "Tip chamfer must have positive axial length, leave a cylindrical shank, and reduce the tip diameter."));
+ return diagnostics;
+ }
+
+ public static KernelResult<HexBoltDefinition> Create(HexBoltSpec spec, string bodyStableId = "HexBolt")
+ {
+ var admission = Validate(spec);
+ if (admission.Count > 0)
+ return KernelResult<HexBoltDefinition>.Failure(admission.Select(d => new KernelDiagnostic(
+ KernelDiagnosticCode.InvalidArgument,
+ KernelDiagnosticSeverity.Error,
+ d.Message,
+ $"StandardLibrary.HexBolt.{d.Code}:{d.Field}")));
+
+ var dimensions = Derive(spec);
+ var realization = Build(spec, dimensions, bodyStableId);
+ var preflight = BrepExportPreflight.Validate(realization.Body);
+ if (!preflight.IsValid)
+ return KernelResult<HexBoltDefinition>.Failure(preflight.Diagnostics
+ .Where(d => d.Severity == BrepExportPreflightSeverity.Error)
+ .Select(d => new KernelDiagnostic(KernelDiagnosticCode.ValidationFailed, KernelDiagnosticSeverity.Error, d.Message, d.Context)));
+
+ return KernelResult<HexBoltDefinition>.Success(realization);
+ }
+
+ public static HexBoltDerivedDimensions Derive(HexBoltSpec spec)
+ {
+ var apothem = spec.HeadAcrossFlats / 2d;
+ var circumradius = spec.HeadAcrossFlats / double.Sqrt(3d);
+ var topRadius = spec.TopFlatDiameter / 2d;
+ var semiAngle = 90d - spec.TopChamferAngle;
+ var slope = double.Tan(semiAngle * double.Pi / 180d);
+ var topX = -spec.HeadHeight;
+ var apexX = topX - topRadius / slope;
+ return new(apothem, circumradius, topRadius, semiAngle, apexX,
+ apexX + apothem / slope,
+ apexX + circumradius / slope,
+ spec.Length - spec.TipChamferLength);
+ }
+
+ private static HexBoltDefinition Build(HexBoltSpec spec, HexBoltDerivedDimensions d, string bodyStableId)
+ {
+ var topology = new TopologyBuilder();
+ var geometry = new BrepGeometryStore();
+ var bindings = new BrepBindingModel();
+ var points = new Dictionary<VertexId, Point3D>();
+ var faces = new List<FaceId>();
+
+ VertexId Vertex(Point3D point) { var id = topology.AddVertex(); points[id] = point; return id; }
+ EdgeId CurveEdge(VertexId start, VertexId end, CurveGeometry curve, double t0, double t1)
+ {
+ var edge = topology.AddEdge(start, end);
+ var curveId = new CurveGeometryId(geometry.Curves.Count() + 1);
+ geometry.AddCurve(curveId, curve);
+ bindings.AddEdgeBinding(new EdgeGeometryBinding(edge, curveId, new ParameterInterval(t0, t1)));
+ return edge;
+ }
+ EdgeId Line(VertexId start, VertexId end)
+ {
+ var a = points[start]; var b = points[end]; var vector = b - a;
+ return CurveEdge(start, end, CurveGeometry.FromLine(new Line3Curve(a, Direction3D.Create(vector))), 0d, vector.Length);
+ }
+ Ring CircleRing(double x, double radius)
+ {
+ var positive = Vertex(new Point3D(x, radius, 0d));
+ var negative = Vertex(new Point3D(x, -radius, 0d));
+ var support = new Circle3Curve(new Point3D(x, 0d, 0d), PlusX, radius, PlusY);
+ return new Ring(positive, negative,
+ CurveEdge(positive, negative, CurveGeometry.FromCircle(support), 0d, double.Pi),
+ CurveEdge(negative, positive, CurveGeometry.FromCircle(support), double.Pi, 2d * double.Pi));
+ }
+ FaceId Face(IReadOnlyList<IReadOnlyList<Use>> loops, SurfaceGeometry surface, bool sameSense = true, SurfaceGeometryId? sharedSurfaceId = null)
+ {
+ var loopIds = new List<LoopId>();
+ foreach (var uses in loops)
+ {
+ var loop = topology.AllocateLoopId();
+ var coedges = uses.Select(_ => topology.AllocateCoedgeId()).ToArray();
+ for (var i = 0; i < coedges.Length; i++)
+ topology.AddCoedge(new Coedge(coedges[i], uses[i].Edge, loop, coedges[(i + 1) % coedges.Length], coedges[(i + coedges.Length - 1) % coedges.Length], uses[i].Reversed));
+ topology.AddLoop(new Loop(loop, coedges)); loopIds.Add(loop);
+ }
+ var face = topology.AddFace(loopIds);
+ var surfaceId = sharedSurfaceId ?? new SurfaceGeometryId(geometry.Surfaces.Count() + 1);
+ if (sharedSurfaceId is null) geometry.AddSurface(surfaceId, surface);
+ bindings.AddFaceBinding(new FaceGeometryBinding(face, surfaceId, sameSense));
+ faces.Add(face); return face;
+ }
+
+ var lower = new VertexId[6]; var upper = new VertexId[6];
+ for (var i = 0; i < 6; i++)
+ {
+ var angle = (30d + i * 60d) * double.Pi / 180d;
+ var y = d.HeadCircumradius * double.Cos(angle);
+ var z = d.HeadCircumradius * double.Sin(angle);
+ lower[i] = Vertex(new Point3D(0d, y, z));
+ upper[i] = Vertex(new Point3D(d.TopConeCornerX, y, z));
+ }
+
+ var lowerHex = new EdgeId[6]; var upperHyperbolas = new EdgeId[6]; var vertical = new EdgeId[6];
+ for (var i = 0; i < 6; i++)
+ {
+ lowerHex[i] = Line(lower[i], lower[(i + 1) % 6]);
+ vertical[i] = Line(lower[i], upper[i]);
+
+ var normalAngle = (60d + i * 60d) * double.Pi / 180d;
+ var normal = new Vector3D(0d, double.Cos(normalAngle), double.Sin(normalAngle));
+ var tangent = new Vector3D(0d, -double.Sin(normalAngle), double.Cos(normalAngle));
+ var center = new Point3D(d.TopConeApexX, normal.Y * d.HeadApothem, normal.Z * d.HeadApothem);
+ var support = new Hyperbola3Curve(center, Direction3D.Create(normal), PlusX,
+ d.HeadApothem / double.Tan(d.TopConeSemiAngleDegrees * double.Pi / 180d), d.HeadApothem, HyperbolaBranch.PositiveAxisU);
+ var tStart = ProjectHyperbolaParameter(support, points[upper[i]]);
+ var tEnd = ProjectHyperbolaParameter(support, points[upper[(i + 1) % 6]]);
+ if (tEnd < tStart)
+ {
+ support = support.Reverse();
+ tStart = ProjectHyperbolaParameter(support, points[upper[i]]);
+ tEnd = ProjectHyperbolaParameter(support, points[upper[(i + 1) % 6]]);
+ }
+ upperHyperbolas[i] = CurveEdge(upper[i], upper[(i + 1) % 6], CurveGeometry.FromHyperbola(support), tStart, tEnd);
+ }
+
+ var shankRadius = spec.NominalDiameter / 2d;
+ var underHeadOuterRadius = shankRadius + spec.UnderHeadRadius;
+ var torusEndX = spec.UnderHeadRadius;
+ var topVertices = new VertexId[6];
+ for (var i = 0; i < 6; i++)
+ {
+ var angle = (30d + i * 60d) * double.Pi / 180d;
+ topVertices[i] = Vertex(new Point3D(-spec.HeadHeight, d.TopFlatRadius * double.Cos(angle), d.TopFlatRadius * double.Sin(angle)));
+ }
+ var topArcs = new EdgeId[6]; var coneGenerators = new EdgeId[6];
+ var topCircleSupport = new Circle3Curve(new Point3D(-spec.HeadHeight, 0d, 0d), PlusX, d.TopFlatRadius, PlusY);
+ for (var i = 0; i < 6; i++)
+ {
+ var startAngle = (30d + i * 60d) * double.Pi / 180d;
+ topArcs[i] = CurveEdge(topVertices[i], topVertices[(i + 1) % 6], CurveGeometry.FromCircle(topCircleSupport), startAngle, startAngle + double.Pi / 3d);
+ coneGenerators[i] = Line(topVertices[i], upper[i]);
+ }
+ var underHeadRing = CircleRing(0d, underHeadOuterRadius);
+ var shankStartRing = spec.UnderHeadRadius > Tolerance ? CircleRing(torusEndX, shankRadius) : underHeadRing;
+ var tipStartRing = CircleRing(d.TipChamferStartX, shankRadius);
+ var tipRing = CircleRing(spec.Length, spec.TipDiameter / 2d);
+
+ var sideFaces = new FaceId[6];
+ for (var i = 0; i < 6; i++)
+ {
+ var a = points[lower[i]]; var b = points[lower[(i + 1) % 6]];
+ var tangent = Direction3D.Create(b - a);
+ var outward = Direction3D.Create(tangent.ToVector().Cross(PlusX.ToVector()));
+ sideFaces[i] = Face([[new(lowerHex[i], false), new(vertical[(i + 1) % 6], false), new(upperHyperbolas[i], true), new(vertical[i], true)]],
+ SurfaceGeometry.FromPlane(new PlaneSurface(a, outward, PlusX)));
+ }
+
+ var cone = new ConeSurface(new Point3D(d.TopConeApexX, 0d, 0d), PlusX,
+ d.TopConeSemiAngleDegrees * double.Pi / 180d, PlusY);
+ var coneSurfaceId = new SurfaceGeometryId(geometry.Surfaces.Count() + 1);
+ geometry.AddSurface(coneSurfaceId, SurfaceGeometry.FromCone(cone));
+ var topChamferFaces = new FaceId[6];
+ for (var i = 0; i < 6; i++)
+ topChamferFaces[i] = Face([[new(topArcs[i], false), new(coneGenerators[(i + 1) % 6], false), new(upperHyperbolas[i], true), new(coneGenerators[i], true)]], SurfaceGeometry.FromCone(cone), sharedSurfaceId: coneSurfaceId);
+ var topFlat = Face([topArcs.Select(e => new Use(e, false)).ToArray()], SurfaceGeometry.FromPlane(new PlaneSurface(new Point3D(-spec.HeadHeight, 0d, 0d), MinusX, PlusY)));
+ var underHead = Face([lowerHex.Reverse().Select(e => new Use(e, true)).ToArray(), [new(underHeadRing.Arc0, false), new(underHeadRing.Arc1, false)]],
+ SurfaceGeometry.FromPlane(new PlaneSurface(Point3D.Origin, PlusX, PlusY)));
+
+ var underHeadBlendFaces = new List<FaceId>();
+ if (spec.UnderHeadRadius > Tolerance)
+ {
+ var plusCenter = new Point3D(spec.UnderHeadRadius, underHeadOuterRadius, 0d);
+ var minusCenter = new Point3D(spec.UnderHeadRadius, -underHeadOuterRadius, 0d);
+ var plusSeam = CurveEdge(underHeadRing.Positive, shankStartRing.Positive,
+ CurveGeometry.FromCircle(new Circle3Curve(plusCenter, Direction3D.Create(new Vector3D(0d, 0d, 1d)), spec.UnderHeadRadius, MinusX)), 0d, double.Pi / 2d);
+ var minusSeam = CurveEdge(underHeadRing.Negative, shankStartRing.Negative,
+ CurveGeometry.FromCircle(new Circle3Curve(minusCenter, Direction3D.Create(new Vector3D(0d, 0d, -1d)), spec.UnderHeadRadius, MinusX)), 0d, double.Pi / 2d);
+ var torusSupport = SurfaceGeometry.FromTorus(new TorusSurface(new Point3D(spec.UnderHeadRadius, 0d, 0d), PlusX, underHeadOuterRadius, spec.UnderHeadRadius, PlusY));
+ var torusSurfaceId = new SurfaceGeometryId(geometry.Surfaces.Count() + 1); geometry.AddSurface(torusSurfaceId, torusSupport);
+ underHeadBlendFaces.Add(Face([[new(underHeadRing.Arc0, false), new(minusSeam, false), new(shankStartRing.Arc0, true), new(plusSeam, true)]], torusSupport, sharedSurfaceId: torusSurfaceId));
+ underHeadBlendFaces.Add(Face([[new(underHeadRing.Arc1, false), new(plusSeam, false), new(shankStartRing.Arc1, true), new(minusSeam, true)]], torusSupport, sharedSurfaceId: torusSurfaceId));
+ }
+ var shankPlusSeam = Line(shankStartRing.Positive, tipStartRing.Positive);
+ var shankMinusSeam = Line(shankStartRing.Negative, tipStartRing.Negative);
+ var cylinderSupport = SurfaceGeometry.FromCylinder(new CylinderSurface(new Point3D(torusEndX, 0d, 0d), PlusX, shankRadius, PlusY));
+ var cylinderSurfaceId = new SurfaceGeometryId(geometry.Surfaces.Count() + 1); geometry.AddSurface(cylinderSurfaceId, cylinderSupport);
+ var shankFaces = new[]
+ {
+ Face([[new(shankStartRing.Arc0, false), new(shankMinusSeam, false), new(tipStartRing.Arc0, true), new(shankPlusSeam, true)]], cylinderSupport, sharedSurfaceId: cylinderSurfaceId),
+ Face([[new(shankStartRing.Arc1, false), new(shankPlusSeam, false), new(tipStartRing.Arc1, true), new(shankMinusSeam, true)]], cylinderSupport, sharedSurfaceId: cylinderSurfaceId)
+ };
+ var tipSlope = (shankRadius - spec.TipDiameter / 2d) / spec.TipChamferLength;
+ var tipApexX = d.TipChamferStartX + shankRadius / tipSlope;
+ var tipPlusSeam = Line(tipStartRing.Positive, tipRing.Positive);
+ var tipMinusSeam = Line(tipStartRing.Negative, tipRing.Negative);
+ var tipSupport = SurfaceGeometry.FromCone(new ConeSurface(new Point3D(tipApexX, 0d, 0d), MinusX, double.Atan(tipSlope), PlusY));
+ var tipSurfaceId = new SurfaceGeometryId(geometry.Surfaces.Count() + 1); geometry.AddSurface(tipSurfaceId, tipSupport);
+ var tipChamferFaces = new[]
+ {
+ Face([[new(tipStartRing.Arc0, false), new(tipMinusSeam, false), new(tipRing.Arc0, true), new(tipPlusSeam, true)]], tipSupport, sharedSurfaceId: tipSurfaceId),
+ Face([[new(tipStartRing.Arc1, false), new(tipPlusSeam, false), new(tipRing.Arc1, true), new(tipMinusSeam, true)]], tipSupport, sharedSurfaceId: tipSurfaceId)
+ };
+ var tipFace = Face([[new(tipRing.Arc1, true), new(tipRing.Arc0, true)]], SurfaceGeometry.FromPlane(new PlaneSurface(new Point3D(spec.Length, 0d, 0d), PlusX, PlusY)));
+
+ var shell = topology.AddShell(faces); topology.AddBody([shell]);
+ var body = new BrepBody(topology.Model, geometry, bindings, points);
+ var descendants = new List<HexBoltSemanticDescendant>
+ {
+ new(bodyStableId, HexBoltSemanticKind.Part),
+ new($"{bodyStableId}.Head", HexBoltSemanticKind.Region, ParentStableId: bodyStableId),
+ new($"{bodyStableId}.Head.TopChamfer", HexBoltSemanticKind.Region, ParentStableId: $"{bodyStableId}.Head"),
+ new($"{bodyStableId}.Head.TopFlat", HexBoltSemanticKind.Face, topFlat, $"{bodyStableId}.Head"),
+ new($"{bodyStableId}.Head.UnderHead", HexBoltSemanticKind.Face, underHead, $"{bodyStableId}.Head"),
+ new($"{bodyStableId}.Shank", HexBoltSemanticKind.Region, ParentStableId: bodyStableId),
+ new($"{bodyStableId}.ThreadRegion", HexBoltSemanticKind.Region, ParentStableId: bodyStableId, Metadata: $"{spec.ThreadDesignation};length={spec.ThreadLength:R}mm;material-geometry=Cylinder"),
+ new($"{bodyStableId}.TipChamfer", HexBoltSemanticKind.Region, ParentStableId: bodyStableId),
+ new($"{bodyStableId}.TipFace", HexBoltSemanticKind.Face, tipFace, bodyStableId)
+ };
+ for (var i = 0; i < sideFaces.Length; i++) descendants.Add(new($"{bodyStableId}.Head.Side[{i}]", HexBoltSemanticKind.Face, sideFaces[i], $"{bodyStableId}.Head"));
+ for (var i = 0; i < topChamferFaces.Length; i++) descendants.Add(new($"{bodyStableId}.Head.TopChamfer.Face[{i}]", HexBoltSemanticKind.Face, topChamferFaces[i], $"{bodyStableId}.Head.TopChamfer"));
+ for (var i = 0; i < shankFaces.Length; i++) descendants.Add(new($"{bodyStableId}.Shank.Face[{i}]", HexBoltSemanticKind.Face, shankFaces[i], $"{bodyStableId}.Shank"));
+ for (var i = 0; i < shankFaces.Length; i++) descendants.Add(new($"{bodyStableId}.ThreadRegion.Face[{i}]", HexBoltSemanticKind.Face, shankFaces[i], $"{bodyStableId}.ThreadRegion"));
+ for (var i = 0; i < tipChamferFaces.Length; i++) descendants.Add(new($"{bodyStableId}.TipChamfer.Face[{i}]", HexBoltSemanticKind.Face, tipChamferFaces[i], $"{bodyStableId}.TipChamfer"));
+ for (var i = 0; i < underHeadBlendFaces.Count; i++) descendants.Add(new($"{bodyStableId}.Head.UnderHeadBlend.Face[{i}]", HexBoltSemanticKind.Face, underHeadBlendFaces[i], $"{bodyStableId}.Head"));
+
+ var metadata = new Dictionary<string, string>(StringComparer.Ordinal)
+ {
+ ["NominalDiameter"] = $"{spec.NominalDiameter:R}mm",
+ ["ThreadLength"] = $"{spec.ThreadLength:R}mm",
+ ["ThreadDesignation"] = spec.ThreadDesignation,
+ ["PropertyClass"] = spec.PropertyClass,
+ ["ThreadGeometry"] = "deferred-semantic-cylinder"
+ };
+ var signatureSource = string.Join("|", new[]
+ {
+ spec.NominalDiameter, spec.Length, spec.HeadAcrossFlats, spec.HeadHeight, spec.TopFlatDiameter,
+ spec.TopChamferAngle, spec.TipChamferLength, spec.TipDiameter, spec.ThreadLength, spec.UnderHeadRadius
+ }.Select(x => x.ToString("R", System.Globalization.CultureInfo.InvariantCulture))) + $"|{spec.ThreadDesignation}|{spec.PropertyClass}";
+ var signature = Convert.ToHexString(SHA256.HashData(Encoding.UTF8.GetBytes(signatureSource))).ToLowerInvariant();
+ return new(spec, d, body, new(bodyStableId, descendants, metadata), signature);
+ }
+
+ private static double ProjectHyperbolaParameter(Hyperbola3Curve curve, Point3D point)
+ {
+ var relative = point - curve.Center;
+ var sinh = relative.Dot(curve.AxisV.ToVector()) / curve.SemiAxisB;
+ return double.Asinh(sinh);
+ }
+
+ private readonly record struct Ring(VertexId Positive, VertexId Negative, EdgeId Arc0, EdgeId Arc1);
+ private readonly record struct Use(EdgeId Edge, bool Reversed);
+}
diff --git a/Aetheris.Kernel.StandardLibrary/HexBoltParameterBinding.cs b/Aetheris.Kernel.StandardLibrary/HexBoltParameterBinding.cs
new file mode 100644
index 00000000..4b91eb70
--- /dev/null
+++ b/Aetheris.Kernel.StandardLibrary/HexBoltParameterBinding.cs
@@ -0,0 +1,52 @@
+using System.Globalization;
+using Aetheris.Kernel.Core.Diagnostics;
+using Aetheris.Kernel.Core.Results;
+
+namespace Aetheris.Kernel.StandardLibrary;
+
+/// <summary>Typed boundary from record-shaped authoring fields to a HexBoltSpec.</summary>
+public static class HexBoltParameterBinding
+{
+ public static readonly IReadOnlyList<string> RequiredFields =
+ [
+ "NominalDiameter", "Length", "HeadAcrossFlats", "HeadHeight", "TopFlatDiameter",
+ "TopChamferAngle", "TipChamferLength", "TipDiameter", "ThreadLength",
+ "ThreadDesignation", "PropertyClass", "UnderHeadRadius"
+ ];
+
+ public static KernelResult<HexBoltSpec> Bind(IReadOnlyDictionary<string, string> fields)
+ {
+ var missing = RequiredFields.Where(field => !fields.TryGetValue(field, out var value) || string.IsNullOrWhiteSpace(value)).ToArray();
+ if (missing.Length > 0) return Failure($"Missing required HexBolt parameter(s): {string.Join(", ", missing)}.", "MissingField");
+
+ var allowed = RequiredFields.Append("StableId").ToHashSet(StringComparer.Ordinal);
+ var unknown = fields.Keys.Where(field => !allowed.Contains(field)).ToArray();
+ if (unknown.Length > 0) return Failure($"Unknown HexBolt parameter(s): {string.Join(", ", unknown)}.", "UnknownField");
+
+ var numericNames = RequiredFields.Where(field => field is not ("ThreadDesignation" or "PropertyClass")).ToArray();
+ var values = new Dictionary<string, double>(StringComparer.Ordinal);
+ foreach (var field in numericNames)
+ {
+ var raw = fields[field].Trim();
+ if (raw.EndsWith("mm", StringComparison.Ordinal)) raw = raw[..^2].Trim();
+ if (raw.EndsWith("deg", StringComparison.Ordinal)) raw = raw[..^3].Trim();
+ if (!double.TryParse(raw, NumberStyles.Float, CultureInfo.InvariantCulture, out var value))
+ return Failure($"HexBolt parameter '{field}' must be a numeric scalar with its declared mm/deg unit.", "InvalidScalar");
+ values[field] = value;
+ }
+
+ return KernelResult<HexBoltSpec>.Success(new(
+ values["NominalDiameter"], values["Length"], values["HeadAcrossFlats"], values["HeadHeight"],
+ values["TopFlatDiameter"], values["TopChamferAngle"], values["TipChamferLength"], values["TipDiameter"],
+ values["ThreadLength"], Text(fields["ThreadDesignation"]), Text(fields["PropertyClass"]), values["UnderHeadRadius"]));
+ }
+
+ public static string Text(string value)
+ {
+ var text = value.Trim();
+ return text.Length >= 2 && text[0] == '"' && text[^1] == '"' ? text[1..^1] : text;
+ }
+
+ private static KernelResult<HexBoltSpec> Failure(string message, string code) =>
+ KernelResult<HexBoltSpec>.Failure([new KernelDiagnostic(KernelDiagnosticCode.InvalidArgument, KernelDiagnosticSeverity.Error, message, $"StandardLibrary.HexBolt.Parameters.{code}")]);
+}
diff --git a/Aetheris.Kernel.StandardLibrary/StandardLibraryReusableParts.cs b/Aetheris.Kernel.StandardLibrary/StandardLibraryReusableParts.cs
index ee033c8b..af838cde 100644
--- a/Aetheris.Kernel.StandardLibrary/StandardLibraryReusableParts.cs
+++ b/Aetheris.Kernel.StandardLibrary/StandardLibraryReusableParts.cs
@@ -8,6 +8,7 @@ namespace Aetheris.Kernel.StandardLibrary;
public static class StandardLibraryReusableParts
{
public const string CubeWithCylindricalHolePartName = "cube_with_cylindrical_hole";
+ public const string HexBoltPartName = "HexBolt";
public static KernelResult<BrepBody> TryCreate(string partName)
{
@@ -21,6 +22,34 @@ public static class StandardLibraryReusableParts
]);
}
+ public static KernelResult<StandardLibraryPartDefinition> TryCreate(
+ string partName,
+ IReadOnlyDictionary<string, string> parameters)
+ {
+ if (string.Equals(partName, CubeWithCylindricalHolePartName, StringComparison.Ordinal))
+ {
+ var cube = CreateCubeWithCylindricalHole();
+ return cube.IsSuccess
+ ? KernelResult<StandardLibraryPartDefinition>.Success(new(cube.Value, null))
+ : KernelResult<StandardLibraryPartDefinition>.Failure(cube.Diagnostics);
+ }
+
+ if (!string.Equals(partName, HexBoltPartName, StringComparison.Ordinal))
+ return KernelResult<StandardLibraryPartDefinition>.Failure([new KernelDiagnostic(
+ KernelDiagnosticCode.InvalidArgument, KernelDiagnosticSeverity.Error,
+ $"StandardLibrary part '{partName}' was not found.")]);
+
+ var parsed = HexBoltParameterBinding.Bind(parameters);
+ if (!parsed.IsSuccess) return KernelResult<StandardLibraryPartDefinition>.Failure(parsed.Diagnostics);
+ var bodyStableId = parameters.TryGetValue("StableId", out var authoredId) && !string.IsNullOrWhiteSpace(authoredId)
+ ? HexBoltParameterBinding.Text(authoredId)
+ : "HexBolt";
+ var bolt = HexBoltBuilder.Create(parsed.Value, bodyStableId);
+ return bolt.IsSuccess
+ ? KernelResult<StandardLibraryPartDefinition>.Success(new(bolt.Value.Body, bolt.Value))
+ : KernelResult<StandardLibraryPartDefinition>.Failure(bolt.Diagnostics);
+ }
+
public static KernelResult<BrepBody> CreateCubeWithCylindricalHole()
{
const double cubeSize = 20d;
@@ -42,3 +71,5 @@ public static class StandardLibraryReusableParts
return BrepBoolean.Subtract(cubeResult.Value, holeResult.Value);
}
}
+
+public sealed record StandardLibraryPartDefinition(BrepBody Body, HexBoltDefinition? HexBolt);
diff --git a/Aetheris.Server.Tests/KernelApiIntegrationTests.cs b/Aetheris.Server.Tests/KernelApiIntegrationTests.cs
index 2825a094..54111003 100644
--- a/Aetheris.Server.Tests/KernelApiIntegrationTests.cs
+++ b/Aetheris.Server.Tests/KernelApiIntegrationTests.cs
@@ -891,6 +891,7 @@ public sealed class KernelApiIntegrationTests : IClassFixture<WebApplicationFact
[InlineData("split-compose-chamfer", "profile:BaseProfile.Outer.South")]
[InlineData("ctc-01-x3", "profile:CentralHex.Outer.SouthEast")]
[InlineData("ctc-01-x4", "hole:Ctc01PrismaticBlockoutX4.LeftTopMount")]
+ [InlineData("hexbolt-m1", "McMaster91180A151.Head.TopChamfer")]
public async Task CadmataFixture_LoadsCompilerBodyAndPublishedCorrespondence(string fixtureId, string expectedEntityId)
{
var document = await CreateDocumentAsync("/api/v1/documents");
@@ -910,6 +911,24 @@ public sealed class KernelApiIntegrationTests : IClassFixture<WebApplicationFact
Assert.True(Guid.TryParse(loaded.Data.BodyId, out _));
}
+ [Fact]
+ public async Task CadmataHexBoltV2Fixture_PublishesTemplateParametersAndGeneratedFaceOwnership()
+ {
+ var document = await CreateDocumentAsync("/api/v1/documents");
+ var response = await _client.PostAsync($"/api/v1/documents/{document.Data!.DocumentId}/cadmata/fixtures/hexbolt-m1", null);
+ response.EnsureSuccessStatusCode();
+ var loaded = await response.Content.ReadFromJsonAsync<ApiResponseDto<CadmataFixtureLoadResponseDto>>();
+ Assert.True(loaded!.Success);
+ var entities = loaded.Data!.Visualization.Entities;
+ var instance = Assert.Single(entities, entity => entity.Kind == "TemplateInstance");
+ Assert.Equal("HexBolt", instance.Metadata!["template"]);
+ Assert.Equal("35mm", instance.Metadata["parameter.Length"]);
+ var chamfer = Assert.Single(entities, entity => entity.StableId == "McMaster91180A151.Head.TopChamfer");
+ Assert.Equal(6, chamfer.Topology!.FaceIds!.Count);
+ Assert.All(chamfer.Topology.FaceIds!, faceId => Assert.Contains(entities, entity => entity.StableId == $"brep:face:{faceId}" && entity.ParentIds!.Any(parent => parent.StartsWith("McMaster91180A151.Head.TopChamfer.Face[", StringComparison.Ordinal))));
+ Assert.Equal(1, loaded.Data.Visualization.Metrics["templateCount"]);
+ }
+
[Fact]
public async Task CadmataProjectedPmiFixture_PublishesConstraintProvenanceAndFaceOwnership()
{
diff --git a/Aetheris.Server/Api/CadmataFixtureService.cs b/Aetheris.Server/Api/CadmataFixtureService.cs
index dcddfc9d..f358db20 100644
--- a/Aetheris.Server/Api/CadmataFixtureService.cs
+++ b/Aetheris.Server/Api/CadmataFixtureService.cs
@@ -26,6 +26,7 @@ internal static class CadmataFixtureService
["semantic-capsule-slot"] = "fixtures/FirmamentV2/ProfileComposition/valid/semantic-capsule-slot-through.firmament",
["profile-compose-l-bracket-counterbore-pmi"] = "fixtures/FirmamentV2/Canonical/valid/profile-compose-l-bracket-counterbore-pmi.firmament",
["pmi-projected-hole-diameter"] = "fixtures/FirmamentV2/Canonical/valid/pmi-projected-hole-diameter.firmament",
+ ["hexbolt-m1"] = "testdata/firmament/examples/mcmaster_91180a151_threadless_hex_bolt.firmament",
};
public static bool TryLoad(string fixtureId, DocumentSession document, out CadmataFixtureLoadResponseDto? response, out string error)
@@ -37,6 +38,8 @@ internal static class CadmataFixtureService
var source = File.ReadAllText(sourcePath);
if (fixtureId == "pmi-projected-hole-diameter")
return TryLoadProjectedPmiFixture(fixtureId, relative, sourcePath, source, document, out response, out error);
+ if (fixtureId == "hexbolt-m1")
+ return TryLoadStandardPartFixture(fixtureId, relative, sourcePath, source, document, out response, out error);
BrepBody? body = null; SemanticTopologyCorrespondence? correspondence = null; IReadOnlyList<ResolvedProfile2D> profiles = []; IReadOnlyList<PrismaticShaftHoleFeature> shaftHoles = []; IReadOnlyList<PrismaticCapsuleSlotFeature> capsuleSlots = []; IReadOnlyList<PrismaticRoundedRectangleSlotFeature> roundedRectangleSlots = [];
var diagnostics = new List<string>(); SemanticHoleSourceInspectionEvidence? semanticHoleEvidence = null;
if (fixtureId is "semantic-shaft-hole" or "construction-plane-through-hole" or "construction-plane-blind-drillpoint")
@@ -75,6 +78,79 @@ internal static class CadmataFixtureService
return true;
}
+ private static bool TryLoadStandardPartFixture(string fixtureId, string sourcePath, string fullSourcePath, string source, DocumentSession document, out CadmataFixtureLoadResponseDto? response, out string error)
+ {
+ response = null; error = string.Empty;
+ var parsed = FirmamentV2Parser.Parse(source, Path.GetDirectoryName(fullSourcePath));
+ if (!parsed.IsSuccess || parsed.Document is null) { error = string.Join("; ", parsed.Diagnostics); return false; }
+ var output = Path.Combine(Path.GetTempPath(), $"aetheris-cadmata-{Guid.NewGuid():N}.step");
+ try
+ {
+ var built = FirmamentBuildAndExport.Run(fullSourcePath, output);
+ if (!built.IsSuccess || built.Value?.Export.StandardPart is not { } report) { error = string.Join("; ", built.Diagnostics.Select(item => item.Message)); return false; }
+ var imported = Step242Importer.ImportBody(built.Value.Export.StepText);
+ if (!imported.IsSuccess || imported.Value is null) { error = string.Join("; ", imported.Diagnostics.Select(item => item.Message)); return false; }
+ var body = imported.Value;
+ var added = document.AddBody(body, $"Cadmata: {fixtureId}");
+ var artifact = BuildStandardPartArtifact(fixtureId, sourcePath, parsed.Document, body, report);
+ response = new(document.Id.ToString(), added.OccurrenceId.ToString(), added.DefinitionId.ToString(), fixtureId, artifact);
+ return true;
+ }
+ finally { if (File.Exists(output)) File.Delete(output); }
+ }
+
+ private static CadmataVisualizationArtifactDto BuildStandardPartArtifact(string fixtureId, string sourcePath, FirmamentV2Document document, BrepBody body, FirmamentStandardPartReport report)
+ {
+ var entities = new List<CadmataVisualizationEntityDto>();
+ var descendants = report.SemanticDescendants;
+ foreach (var semantic in descendants)
+ {
+ var children = descendants.Where(candidate => candidate.ParentStableId == semantic.StableId).Select(candidate => candidate.StableId).ToArray();
+ var materialFaces = descendants.Where(candidate => candidate.FaceId is not null && (candidate.StableId == semantic.StableId || candidate.StableId.StartsWith(semantic.StableId + ".", StringComparison.Ordinal))).Select(candidate => candidate.FaceId!.Value).Distinct().Order().ToArray();
+ var metadata = new Dictionary<string, string>(StringComparer.Ordinal)
+ {
+ ["family"] = report.Family,
+ ["template"] = report.Template ?? string.Empty,
+ ["semanticKind"] = semantic.Kind,
+ ["sourceForm"] = "FirmamentV2.Record/Static/Template"
+ };
+ if (semantic.Metadata is not null) metadata["engineeringMetadata"] = semantic.Metadata;
+ if (semantic.Kind == "Part")
+ foreach (var parameter in report.Parameters) metadata["parameter." + parameter.Key] = parameter.Value;
+ entities.Add(new(
+ semantic.StableId,
+ semantic.Kind == "Part" ? "TemplateInstance" : semantic.Kind == "Region" ? "PartRegion" : "GeneratedFace",
+ semantic.StableId[(semantic.StableId.LastIndexOf('.') + 1)..],
+ semantic.Kind == "Face" ? "selections" : "conceptAxes",
+ semantic.Kind,
+ null,
+ document.StaticAuthoring?.Templates.SingleOrDefault()?.SourceSpan.ToString(),
+ semantic.ParentStableId is null ? null : [semantic.ParentStableId],
+ children,
+ null,
+ children,
+ materialFaces.Length == 0 ? null : new CadmataTopologyDto(materialFaces),
+ null,
+ "StandardLibrary.HexBoltBuilder",
+ null,
+ metadata));
+ }
+ foreach (var face in body.Topology.Faces.OrderBy(item => item.Id.Value))
+ {
+ var owners = descendants.Where(item => item.FaceId == face.Id.Value).Select(item => item.StableId).ToArray();
+ entities.Add(new($"brep:face:{face.Id.Value}", "BRepFace", $"Face {face.Id.Value}", "brepFaces", "MaterialFace", null, null, owners, null, null, null, new CadmataTopologyDto([face.Id.Value]), null, null, null, null));
+ }
+ var regions = descendants.Where(item => item.Kind == "Region").Select(item => item.StableId).ToArray();
+ var selection = new CadmataVisualizationSelectionDto($"selection:{fixtureId}", "generated StandardLibrary regions", "SemanticRegionSet", regions, regions, false, []);
+ return new("cadmata-concept-viz-x1", fixtureId, sourcePath, entities, [selection], [], new Dictionary<string, double>
+ {
+ ["entityCount"] = entities.Count,
+ ["faceCount"] = body.Topology.Faces.Count(),
+ ["semanticDescendantCount"] = descendants.Count,
+ ["templateCount"] = document.StaticAuthoring?.Templates.Count ?? 0
+ });
+ }
+
private static bool TryLoadProjectedPmiFixture(string fixtureId, string sourcePath, string fullSourcePath, string source, DocumentSession document, out CadmataFixtureLoadResponseDto? response, out string error)
{
response = null; error = string.Empty;
diff --git a/aetheris.client/src/App.tsx b/aetheris.client/src/App.tsx
index b613c81e..b3765fc4 100644
--- a/aetheris.client/src/App.tsx
+++ b/aetheris.client/src/App.tsx
@@ -1009,6 +1009,7 @@ function App() {
"ctc-01-x4",
"profile-compose-l-bracket-counterbore-pmi",
"pmi-projected-hole-diameter",
+ "hexbolt-m1",
].map((fixtureId) => (
<Button
key={fixtureId}
diff --git a/docs/preview2/evidence/hexbolt-m1/README.md b/docs/preview2/evidence/hexbolt-m1/README.md
new file mode 100644
index 00000000..433f8867
--- /dev/null
+++ b/docs/preview2/evidence/hexbolt-m1/README.md
@@ -0,0 +1,33 @@
+# HexBolt M1 visual and CAD evidence
+
+Reference: McMaster-Carr `91180A151_NO THREADS_Medium-Strength Class 8.8 Steel Hex Head Screw.STEP`.
+
+The `reference-*` images are FreeCAD 1.0 renders of the supplied STEP. The
+`generated-*` images are FreeCAD 1.0 renders of the deterministic Firmament export
+`artifacts/hexbolt-m1/mcmaster-91180a151.step`. The views use the same renderer and
+camera presets. `*-head.png` and `*-head-opposite.png` preserve both axial directions;
+the isometric and side images are the useful shape comparison.
+
+FreeCAD/OCCT import result for the generated artifact:
+
+- objects 1, solids 1, shells 1
+- closed `true`, valid `true`
+- healing invoked `false`
+- surface faces: Plane 9, Cone 8, Cylinder 2, Toroid 2
+- volume: 2526.679304884845 mm³
+
+The supplied reference volume in the same FreeCAD process is
+2519.532295447053 mm³. The generated sharp-corner semantic hex is 7.147009437792
+mm³ (+0.284%) larger; this is consistent with deliberately omitting the supplied
+0.26 mm longitudinal head-corner rounds. The reference markings are also omitted.
+
+Cadmata imported the initial exact export as a complete 18-face mixed-fallback
+document, but its viewport omitted periodic full-circle shank patches. That finding
+caused the final construction to split the torus, cylinder, and tip cone into ordinary
+half patches sharing their analytic supports. The final V2 `hexbolt-m1` Cadmata
+fixture now loads the 21-face body through the production build/reimport path and
+publishes the `HexBolt` Template instance, its parameter table, all semantic regions,
+generated descendants, and BRep face ownership. Server integration tests verify the
+six-face top-chamfer ownership. The earlier browser screenshot could not be recaptured
+because the in-app browser blocked localhost reload; the persisted FreeCAD views and
+the Cadmata endpoint test are the final visual/topology evidence.
diff --git a/docs/preview2/evidence/hexbolt-m1/generated-head-opposite.png b/docs/preview2/evidence/hexbolt-m1/generated-head-opposite.png
new file mode 100644
index 00000000..5b0a98de
Binary files /dev/null and b/docs/preview2/evidence/hexbolt-m1/generated-head-opposite.png differ
diff --git a/docs/preview2/evidence/hexbolt-m1/generated-head.png b/docs/preview2/evidence/hexbolt-m1/generated-head.png
new file mode 100644
index 00000000..79c31b1e
Binary files /dev/null and b/docs/preview2/evidence/hexbolt-m1/generated-head.png differ
diff --git a/docs/preview2/evidence/hexbolt-m1/generated-isometric.png b/docs/preview2/evidence/hexbolt-m1/generated-isometric.png
new file mode 100644
index 00000000..23b17d6f
Binary files /dev/null and b/docs/preview2/evidence/hexbolt-m1/generated-isometric.png differ
diff --git a/docs/preview2/evidence/hexbolt-m1/generated-side.png b/docs/preview2/evidence/hexbolt-m1/generated-side.png
new file mode 100644
index 00000000..1c3933ec
Binary files /dev/null and b/docs/preview2/evidence/hexbolt-m1/generated-side.png differ
diff --git a/docs/preview2/evidence/hexbolt-m1/reference-head-opposite.png b/docs/preview2/evidence/hexbolt-m1/reference-head-opposite.png
new file mode 100644
index 00000000..519e735b
Binary files /dev/null and b/docs/preview2/evidence/hexbolt-m1/reference-head-opposite.png differ
diff --git a/docs/preview2/evidence/hexbolt-m1/reference-head.png b/docs/preview2/evidence/hexbolt-m1/reference-head.png
new file mode 100644
index 00000000..9f2a869a
Binary files /dev/null and b/docs/preview2/evidence/hexbolt-m1/reference-head.png differ
diff --git a/docs/preview2/evidence/hexbolt-m1/reference-isometric.png b/docs/preview2/evidence/hexbolt-m1/reference-isometric.png
new file mode 100644
index 00000000..acd54e2c
Binary files /dev/null and b/docs/preview2/evidence/hexbolt-m1/reference-isometric.png differ
diff --git a/docs/preview2/evidence/hexbolt-m1/reference-side.png b/docs/preview2/evidence/hexbolt-m1/reference-side.png
new file mode 100644
index 00000000..5985306e
Binary files /dev/null and b/docs/preview2/evidence/hexbolt-m1/reference-side.png differ
diff --git a/docs/preview2/hexbolt-standard-library-m1.md b/docs/preview2/hexbolt-standard-library-m1.md
new file mode 100644
index 00000000..2a2700b0
--- /dev/null
+++ b/docs/preview2/hexbolt-standard-library-m1.md
@@ -0,0 +1,205 @@
+# P2-TEMPLATE-PART-M1 — StandardLibrary HexBolt foundation
+
+## Outcome
+
+One real McMaster-style threadless hex bolt is now authored through Firmament and
+materialized by `Aetheris.Kernel.StandardLibrary` as a deterministic analytic AP242
+solid. The top treatment is an actual coaxial cone. Its six sharp-hex side
+intersections are exact bounded `HYPERBOLA` curves; no loft, mesh, B-spline, or NURBS
+is used as source geometry.
+
+## Supplied STEP audit
+
+The supplied file is McMaster-Carr part `91180A151`, an M8 × 35 class 8.8 bolt model
+with physical threads suppressed. Aetheris reports one body, one shell, 66 faces,
+164 edges, 108 vertices, an enclosed manifold, and bounds
+`X=[-5.3,35]`, `Y=[-7.4304979645,7.4304979645]`,
+`Z=[-6.5,6.5]` mm. The reference SHA-256 is
+`e90d61aead58021db75855aa1f3f5b78606e743c25a857427e0cbb1bace08953`.
+
+Audited dimensions:
+
+| Invariant | Reference |
+|---|---:|
+| nominal/shank diameter | 8 mm |
+| under-head length | 35 mm |
+| total length | 40.3 mm |
+| head height | 5.3 mm |
+| head across flats | 13 mm |
+| rounded-head radial bound | 7.4304979645 mm |
+| ideal sharp-hex circumradius | 7.5055534995 mm |
+| top-flat diameter | 12.35 mm |
+| top cone semi-angle | 65° (25° to top plane) |
+| top cone apex X | -8.1794497891 mm |
+| under-head blend | torus, major 4.2 mm, minor 0.2 mm |
+| longitudinal head-corner radius | 0.26 mm |
+| tip chamfer | 45°, X=34.0625..35 mm |
+| tip diameter | 6.125 mm |
+
+Reference surface faces are Plane 20, Cylinder 8, Cone 4, Torus 2, and
+`BSplineSurfaceWithKnots` 32; Sphere is 0. The 32 B-spline faces are the embossed
+head markings. Reference edge curves are Line 68, Circle 18, and BSpline 78. The
+reference has no `HYPERBOLA` STEP entity: its exporter encoded cone/rounded-side
+intersection trims as splines. Geometrically the head uses one coherent cone support
+split into two faces. Its sharp-side limit is the expected hyperbolic conic section.
+
+## Engineering interpretation
+
+M1 intentionally reconstructs engineering intent instead of copying reference
+topology. It retains the measured M8 shank, 13 mm hex, 5.3 mm head, 12.35 mm top
+flat, 65° cone, 0.2 mm under-head torus, and 45° tip. It omits class/manufacturer
+marking geometry and the tiny 0.26 mm longitudinal head-corner rounds. The latter
+keeps the requested regular-hex semantic profile and makes the cone/side boundary
+the exact reusable hyperbola needed by the family. Property class `8.8` remains
+metadata.
+
+## StandardLibrary architecture
+
+`HexBoltSpec` owns the typed parameter data (repository-native millimetre doubles
+and degrees): nominal diameter, length, head across flats, head height, top-flat
+diameter, top-chamfer angle, tip-chamfer length/diameter, thread length/designation,
+property class, and under-head radius. `HexBoltBuilder` separates admission,
+dimensional derivation, exact topology construction, semantic publication, and a
+deterministic signature. `McMasterHexBoltSpecs.Reference91180A151` is the explicit
+reference instantiation. `HexBoltParameterBinding` is the typed boundary from the
+record-shaped Firmament V2 fields to the spec; geometry code contains no M8-only
+literals.
+
+The canonical authoring fixture is
+`testdata/firmament/examples/mcmaster_91180a151_threadless_hex_bolt.firmament`:
+
+```firmament
+Record HexBoltSpec {
+ StableId: String
+ NominalDiameter: Length
+ Length: Length
+ // remaining typed engineering fields
+}
+Static Bolts: HexBoltSpec[] = [
+ HexBoltSpec { StableId: "McMaster91180A151" NominalDiameter: 8mm Length: 35mm /* ... */ }
+]
+Template HexBolt(HexBoltSpec spec) {
+ StandardPart Bolt {
+ Family: HexBolt
+ StableId: spec.StableId
+ NominalDiameter: spec.NominalDiameter
+ Length: spec.Length
+ // remaining fields
+ }
+}
+HexBolt(Bolts[0])
+```
+
+This is canonical Firmament V2. `Record`, `Static`, and `Template` expose and bind
+the parameters; the generic `StandardPart` record is the reusable StandardLibrary
+invocation boundary. Static expansion produces a normalized
+`FirmamentV2StandardPartRecord`, and the V2 build dispatcher calls the typed
+StandardLibrary builder before generic primitive lowering. No deprecated V1
+`library_part` execution and no bolt-specific grammar such as `Bolt<Hex>` is used.
+
+## Exact construction
+
+The head starts from a regular hex with apothem `S/2` and circumradius
+`S/sqrt(3)`. Six planar side faces run from the under-head plane to the cone
+intersection. The top cone has apex
+`topX - topRadius/tan(semiAngle)` and is represented once in the geometry store.
+Six face sectors share that support. Each sector is bounded by a circular top arc,
+two cone generators, and one exact hyperbola against a vertical hex-side plane.
+The six top arcs also bound one planar circular top face.
+
+The underside is planar outside the under-head blend. Two toroidal half faces share
+one torus support, two cylindrical half faces share one shank support, and two
+45-degree conical half faces share one tip support. Periodic faces are split only for
+ordinary downstream topology; their analytic supports remain coherent.
+
+Admission rejects non-finite/non-positive dimensions, a top circle at or outside
+the apothem, a cone consuming all head-side height, invalid tip reductions, an
+invalid under-head radius, thread length outside `[0, Length]`, and empty thread or
+property metadata. Diagnostics use typed `HexBoltAdmissionCode` values and stable
+StandardLibrary sources.
+
+## Semantics and thread policy
+
+Stable descendants include `Head`, `Head.TopFlat`, `Head.TopChamfer`,
+`Head.TopChamfer.Face[0..5]`, `Head.Side[0..5]`, `Head.UnderHead`, `Shank`,
+`ThreadRegion`, `TipChamfer`, and `TipFace`. Periodic face children are published
+where a region owns two or six faces. Firmament V2 carries these identities, parent
+relationships, face ownership, parameter metadata, the template name, and the
+deterministic signature into `FirmamentStandardPartReport`.
+
+Cadmata exposes the fixture as `hexbolt-m1`. Its concept-visualization artifact has
+one `TemplateInstance`, inspectable V2 parameter metadata, semantic `PartRegion`
+entities, generated-face entities, and BRep face ownership. The server integration
+test proves the top-chamfer region owns its six conical faces. This stays within the
+existing concept-visualization infrastructure; no separate TemplateInstance UI or
+browser-side topology matching was introduced.
+
+`ThreadRegion` aliases the cylindrical shank faces semantically. It carries
+`M8 x 1.25`, 22 mm, and `material-geometry=Cylinder`. No helix exists. Head markings
+are not material geometry; `PropertyClass=8.8` is metadata.
+
+## Generated result and comparison
+
+Final Aetheris reimport: one body, one shell, 21 faces, 44 edges, 26 vertices,
+enclosed manifold. Faces are Plane 9, Cylinder 2, Cone 8, Torus 2, with zero spline
+surfaces. Edge curves contain 6 Hyperbola, 22 Line, and 16 Circle curves. Raw STEP
+contains 6 `HYPERBOLA`, 2 `CONICAL_SURFACE` support entities (one shared by all six
+head sectors and one shared by both tip sectors), 1 shared `CYLINDRICAL_SURFACE`,
+1 shared `TOROIDAL_SURFACE`, and zero B-spline curve/surface entities. Face-family
+counts remain Cone 8, Cylinder 2, and Torus 2 because multiple trimmed faces refer
+to each coherent analytic support.
+
+Generated bounds are `X=[-5.3,35]`, `Y=[-6.5,6.5]`,
+`Z=[-7.5055534995,7.5055534995]` mm. This is the same 40.3 mm total length,
+8 mm shank, 13 mm across flats, and ideal regular-hex circumradius; the reference
+radial corner bound is 0.075055535 mm smaller because its six corners are rounded.
+
+The generated SHA-256 is
+`7221a75bbf8d21a72080dede80d9253f65d66986419c224f0a8b50682dec1a85`.
+Two independent rebuilds produced the identical hash. FreeCAD 1.0 imported one
+closed valid solid/shell without healing and preserved Plane/Cone/Cylinder/Toroid
+families. FreeCAD volumes are 2526.679304884845 mm³ generated versus
+2519.532295447053 mm³ reference (+0.284%, explained by sharp versus 0.26 mm rounded
+head corners and omitted markings). Aetheris `verify` reimport succeeds and reports
+orientation-consistent enclosed topology.
+
+Visual comparisons are under `docs/preview2/evidence/hexbolt-m1/`. The generated
+isometric and side views show the circular-flat/conical hex head, cylindrical shank,
+under-head blend, and tip chamfer. The evidence README records the bounded Cadmata
+viewer finding and final FreeCAD capture.
+
+## Tests and parameter dogfood
+
+Focused tests cover regular-hex derivation, across-flats/circumradius, top-flat and
+head-height admission, exact hyperbola trims, one coherent head-cone support,
+preflight/manifold topology, stable semantic IDs, deterministic STEP, reimport,
+zero NURBS, tip chamfer, reference dimensions, V2 record/static/template expansion,
+V2 StandardPart materialization, and Cadmata descendant publication. A second
+M10 × 50 spec changes diameter, length, head dimensions, tip, thread length, and
+designation without changing geometry code and reimports successfully.
+
+## Validation
+
+The canonical V2 fixture passes `aetheris validate`, `aetheris build`, and
+`aetheris verify`. Three V2 outputs (two explicit builds and the checked-in fixture
+STEP) are byte-identical at SHA-256
+`7221a75bbf8d21a72080dede80d9253f65d66986419c224f0a8b50682dec1a85`.
+CLI JSON publishes `standardPart.family=HexBolt`, `template=HexBolt`, the complete
+parameter record, deterministic spec signature, and semantic descendants.
+
+Repository validation on .NET 10.0 completed with zero build warnings:
+
+- restore: all projects up to date
+- build: success, 0 warnings, 0 errors
+- tests: CLI 348, Core 994, Firmament 1035, Server/Cadmata 48; 2425 passed total
+- FrictionLab: no discoverable tests (existing project state)
+- frontend: production build, ESLint, and all 69 Vitest tests passed
+
+## M2 recommendation
+
+Proceed with `P2-TEMPLATE-PART-M2 — general HexBolt Template + semantic/template-
+instance inspection`: generalize the V2 template/preset layer around this unchanged
+builder, promote the current metadata table into the normal interactive parameter
+editor, add standards data as a separate layer, and decide whether rounded-corner
+head treatment is an optional family parameter. Do not add physical threads by
+default.
diff --git a/testdata/firmament/examples/README.md b/testdata/firmament/examples/README.md
index 7c8c8711..5d71632a 100644
--- a/testdata/firmament/examples/README.md
+++ b/testdata/firmament/examples/README.md
@@ -16,6 +16,7 @@ Other combinations may fail and are intentionally not supported yet.
- `rounded_corner_box_basic.firmament` — minimal single rounded-corner-box export example using Forge-backed rounded-rectangle atomics under StandardLibrary; helper export path: `testdata/firmament/exports/rounded_corner_box_basic.step`.
- `slot_cut_basic.firmament` — minimal single slot-cut export example using the same Forge rounded-rectangle atomic seam under StandardLibrary; helper export path: `testdata/firmament/exports/slot_cut_basic.step`.
- `library_part_cube_with_hole_basic.firmament` — connector-routed standard library reusable part example for `standard_library/cube_with_cylindrical_hole`; helper export path: `testdata/firmament/exports/library_part_cube_with_hole_basic.step`.
+- `mcmaster_91180a151_threadless_hex_bolt.firmament` — canonical V2 `Record`/`Static`/`Template` instance routed through the generic `StandardPart` record to `StandardLibrary.HexBolt`, with an exact conical head treatment, hyperbolic cone/hex trims, semantic thread region, and no modeled threads or markings.
- `composed_part_with_slot.firmament` — bounded composability probe combining connector part import (`standard_library/cube_with_cylindrical_hole`) and lane-routed `slot_cut` subtract in one model; currently documents a real bounded-safe-composition blocker rather than a successful export.
- `box_add_basic.firmament` — minimal supported box-plus-box boolean add example; helper export path: `testdata/firmament/exports/box_add_basic.step`.
- `boolean_add_basic.firmament` — canonical proven boolean add example for the current box/box single-box subset; helper export path: `testdata/firmament/exports/boolean_add_basic.step`.
diff --git a/testdata/firmament/examples/mcmaster_91180a151_threadless_hex_bolt.firmament b/testdata/firmament/examples/mcmaster_91180a151_threadless_hex_bolt.firmament
new file mode 100644
index 00000000..0f7eb3ba
--- /dev/null
+++ b/testdata/firmament/examples/mcmaster_91180a151_threadless_hex_bolt.firmament
@@ -0,0 +1,58 @@
+Model McMaster91180A151ThreadlessHexBolt {
+ Units: mm
+
+ Record HexBoltSpec {
+ StableId: String
+ NominalDiameter: Length
+ Length: Length
+ HeadAcrossFlats: Length
+ HeadHeight: Length
+ TopFlatDiameter: Length
+ TopChamferAngle: Angle
+ TipChamferLength: Length
+ TipDiameter: Length
+ ThreadLength: Length
+ ThreadDesignation: String
+ PropertyClass: String
+ UnderHeadRadius: Length
+ }
+
+ Static Bolts: HexBoltSpec[] = [
+ HexBoltSpec {
+ StableId: "McMaster91180A151"
+ NominalDiameter: 8mm
+ Length: 35mm
+ HeadAcrossFlats: 13mm
+ HeadHeight: 5.3mm
+ TopFlatDiameter: 12.35mm
+ TopChamferAngle: 25deg
+ TipChamferLength: 0.9375mm
+ TipDiameter: 6.125mm
+ ThreadLength: 22mm
+ ThreadDesignation: "M8 x 1.25"
+ PropertyClass: "8.8"
+ UnderHeadRadius: 0.2mm
+ }
+ ]
+
+ Template HexBolt(HexBoltSpec spec) {
+ StandardPart Bolt {
+ Family: HexBolt
+ StableId: spec.StableId
+ NominalDiameter: spec.NominalDiameter
+ Length: spec.Length
+ HeadAcrossFlats: spec.HeadAcrossFlats
+ HeadHeight: spec.HeadHeight
+ TopFlatDiameter: spec.TopFlatDiameter
+ TopChamferAngle: spec.TopChamferAngle
+ TipChamferLength: spec.TipChamferLength
+ TipDiameter: spec.TipDiameter
+ ThreadLength: spec.ThreadLength
+ ThreadDesignation: spec.ThreadDesignation
+ PropertyClass: spec.PropertyClass
+ UnderHeadRadius: spec.UnderHeadRadius
+ }
+ }
+
+ HexBolt(Bolts[0])
+}
diff --git a/testdata/firmament/examples/mcmaster_91180a151_threadless_hex_bolt.step b/testdata/firmament/examples/mcmaster_91180a151_threadless_hex_bolt.step
new file mode 100644
index 00000000..71539f53
--- /dev/null
+++ b/testdata/firmament/examples/mcmaster_91180a151_threadless_hex_bolt.step
@@ -0,0 +1,558 @@
+ISO-10303-21;
+HEADER;
+FILE_DESCRIPTION(('Aetheris AP242 subset export'),'2;1');
+FILE_NAME('aetheris_export.step','1970-01-01T00:00:00',('Aetheris'),('Aetheris'),'Aetheris.Kernel','Aetheris.Kernel','');
+FILE_SCHEMA(('AP242_MANAGED_MODEL_BASED_3D_ENGINEERING_MIM_LF'));
+ENDSEC;
+DATA;
+#1=CARTESIAN_POINT($,(0,6.5,3.75277674973257));
+#2=DIRECTION($,(-0,0.5,0.866025403784439));
+#3=DIRECTION($,(1,0,0));
+#4=AXIS2_PLACEMENT_3D($,#1,#2,#3);
+#5=PLANE($,#4);
+#6=CARTESIAN_POINT($,(-0,6.5,3.75277674973257));
+#7=VERTEX_POINT($,#6);
+#8=CARTESIAN_POINT($,(0,0.000000000000001,7.50555349946514));
+#9=VERTEX_POINT($,#8);
+#10=CARTESIAN_POINT($,(-0,6.5,3.75277674973257));
+#11=DIRECTION($,(0,-0.866025403784439,0.5));
+#12=VECTOR($,#11,1);
+#13=LINE($,#10,#12);
+#14=EDGE_CURVE($,#7,#9,#13,.T.);
+#15=ORIENTED_EDGE($,$,$,#14,.T.);
+#16=CARTESIAN_POINT($,(-4.67955271361447,0,7.50555349946514));
+#17=VERTEX_POINT($,#16);
+#18=CARTESIAN_POINT($,(0,0.000000000000001,7.50555349946514));
+#19=DIRECTION($,(-1,0,0));
+#20=VECTOR($,#19,1);
+#21=LINE($,#18,#20);
+#22=EDGE_CURVE($,#9,#17,#21,.T.);
+#23=ORIENTED_EDGE($,$,$,#22,.T.);
+#24=CARTESIAN_POINT($,(-4.67955271361447,6.5,3.75277674973257));
+#25=VERTEX_POINT($,#24);
+#26=CARTESIAN_POINT($,(-8.17944978910712,3.25,5.62916512459885));
+#27=DIRECTION($,(-0,-0.5,-0.866025403784439));
+#28=DIRECTION($,(1,0,0));
+#29=AXIS2_PLACEMENT_3D($,#26,#27,#28);
+#30=HYPERBOLA($,#29,3.03099977800749,6.5);
+#31=TRIMMED_CURVE($,#30,(PARAMETER_VALUE(-0.549306144334055)),(PARAMETER_VALUE(0.549306144334055)),.T.,.PARAMETER.);
+#32=EDGE_CURVE($,#25,#17,#31,.T.);
+#33=ORIENTED_EDGE($,$,$,#32,.F.);
+#34=CARTESIAN_POINT($,(-0,6.5,3.75277674973257));
+#35=DIRECTION($,(-1,0,0));
+#36=VECTOR($,#35,1);
+#37=LINE($,#34,#36);
+#38=EDGE_CURVE($,#7,#25,#37,.T.);
+#39=ORIENTED_EDGE($,$,$,#38,.F.);
+#40=EDGE_LOOP($,(#15,#23,#33,#39));
+#41=FACE_OUTER_BOUND('',#40,.T.);
+#42=ADVANCED_FACE('',(#41),#5,.T.);
+#43=CARTESIAN_POINT($,(0,0,7.50555349946513));
+#44=DIRECTION($,(0,-0.5,0.866025403784439));
+#45=DIRECTION($,(1,0,0));
+#46=AXIS2_PLACEMENT_3D($,#43,#44,#45);
+#47=PLANE($,#46);
+#48=CARTESIAN_POINT($,(0,-6.5,3.75277674973257));
+#49=VERTEX_POINT($,#48);
+#50=CARTESIAN_POINT($,(0,0.000000000000001,7.50555349946514));
+#51=DIRECTION($,(0,-0.866025403784439,-0.5));
+#52=VECTOR($,#51,1);
+#53=LINE($,#50,#52);
+#54=EDGE_CURVE($,#9,#49,#53,.T.);
+#55=ORIENTED_EDGE($,$,$,#54,.T.);
+#56=CARTESIAN_POINT($,(-4.67955271361447,-6.5,3.75277674973257));
+#57=VERTEX_POINT($,#56);
+#58=CARTESIAN_POINT($,(0,-6.5,3.75277674973257));
+#59=DIRECTION($,(-1,0,0));
+#60=VECTOR($,#59,1);
+#61=LINE($,#58,#60);
+#62=EDGE_CURVE($,#49,#57,#61,.T.);
+#63=ORIENTED_EDGE($,$,$,#62,.T.);
+#64=CARTESIAN_POINT($,(-8.17944978910712,-3.25,5.62916512459885));
+#65=DIRECTION($,(-0,0.5,-0.866025403784439));
+#66=DIRECTION($,(1,0,0));
+#67=AXIS2_PLACEMENT_3D($,#64,#65,#66);
+#68=HYPERBOLA($,#67,3.03099977800749,6.5);
+#69=TRIMMED_CURVE($,#68,(PARAMETER_VALUE(-0.549306144334055)),(PARAMETER_VALUE(0.549306144334055)),.T.,.PARAMETER.);
+#70=EDGE_CURVE($,#17,#57,#69,.T.);
+#71=ORIENTED_EDGE($,$,$,#70,.F.);
+#72=ORIENTED_EDGE($,$,$,#22,.F.);
+#73=EDGE_LOOP($,(#55,#63,#71,#72));
+#74=FACE_OUTER_BOUND('',#73,.T.);
+#75=ADVANCED_FACE('',(#74),#47,.T.);
+#76=CARTESIAN_POINT($,(0,-6.5,3.75277674973257));
+#77=DIRECTION($,(0,-1,-0));
+#78=DIRECTION($,(1,0,0));
+#79=AXIS2_PLACEMENT_3D($,#76,#77,#78);
+#80=PLANE($,#79);
+#81=CARTESIAN_POINT($,(0,-6.5,-3.75277674973257));
+#82=VERTEX_POINT($,#81);
+#83=CARTESIAN_POINT($,(0,-6.5,3.75277674973257));
+#84=DIRECTION($,(0,0,-1));
+#85=VECTOR($,#84,1);
+#86=LINE($,#83,#85);
+#87=EDGE_CURVE($,#49,#82,#86,.T.);
+#88=ORIENTED_EDGE($,$,$,#87,.T.);
+#89=CARTESIAN_POINT($,(-4.67955271361447,-6.5,-3.75277674973257));
+#90=VERTEX_POINT($,#89);
+#91=CARTESIAN_POINT($,(0,-6.5,-3.75277674973257));
+#92=DIRECTION($,(-1,0,0));
+#93=VECTOR($,#92,1);
+#94=LINE($,#91,#93);
+#95=EDGE_CURVE($,#82,#90,#94,.T.);
+#96=ORIENTED_EDGE($,$,$,#95,.T.);
+#97=CARTESIAN_POINT($,(-8.17944978910712,-6.5,0.000000000000001));
+#98=DIRECTION($,(-0,1,-0));
+#99=DIRECTION($,(1,0,0));
+#100=AXIS2_PLACEMENT_3D($,#97,#98,#99);
+#101=HYPERBOLA($,#100,3.03099977800749,6.5);
+#102=TRIMMED_CURVE($,#101,(PARAMETER_VALUE(-0.549306144334055)),(PARAMETER_VALUE(0.549306144334055)),.T.,.PARAMETER.);
+#103=EDGE_CURVE($,#57,#90,#102,.T.);
+#104=ORIENTED_EDGE($,$,$,#103,.F.);
+#105=ORIENTED_EDGE($,$,$,#62,.F.);
+#106=EDGE_LOOP($,(#88,#96,#104,#105));
+#107=FACE_OUTER_BOUND('',#106,.T.);
+#108=ADVANCED_FACE('',(#107),#80,.T.);
+#109=CARTESIAN_POINT($,(0,-6.5,-3.75277674973257));
+#110=DIRECTION($,(0,-0.5,-0.866025403784439));
+#111=DIRECTION($,(1,0,0));
+#112=AXIS2_PLACEMENT_3D($,#109,#110,#111);
+#113=PLANE($,#112);
+#114=CARTESIAN_POINT($,(0,-0.000000000000002,-7.50555349946513));
+#115=VERTEX_POINT($,#114);
+#116=CARTESIAN_POINT($,(0,-6.5,-3.75277674973257));
+#117=DIRECTION($,(0,0.866025403784439,-0.5));
+#118=VECTOR($,#117,1);
+#119=LINE($,#116,#118);
+#120=EDGE_CURVE($,#82,#115,#119,.T.);
+#121=ORIENTED_EDGE($,$,$,#120,.T.);
+#122=CARTESIAN_POINT($,(-4.67955271361447,-0.000000000000002,-7.50555349946514));
+#123=VERTEX_POINT($,#122);
+#124=CARTESIAN_POINT($,(0,-0.000000000000002,-7.50555349946513));
+#125=DIRECTION($,(-1,0,0));
+#126=VECTOR($,#125,1);
+#127=LINE($,#124,#126);
+#128=EDGE_CURVE($,#115,#123,#127,.T.);
+#129=ORIENTED_EDGE($,$,$,#128,.T.);
+#130=CARTESIAN_POINT($,(-8.17944978910712,-3.25,-5.62916512459885));
+#131=DIRECTION($,(-0,0.5,0.866025403784438));
+#132=DIRECTION($,(1,0,0));
+#133=AXIS2_PLACEMENT_3D($,#130,#131,#132);
+#134=HYPERBOLA($,#133,3.03099977800749,6.5);
+#135=TRIMMED_CURVE($,#134,(PARAMETER_VALUE(-0.549306144334054)),(PARAMETER_VALUE(0.549306144334055)),.T.,.PARAMETER.);
+#136=EDGE_CURVE($,#90,#123,#135,.T.);
+#137=ORIENTED_EDGE($,$,$,#136,.F.);
+#138=ORIENTED_EDGE($,$,$,#95,.F.);
+#139=EDGE_LOOP($,(#121,#129,#137,#138));
+#140=FACE_OUTER_BOUND('',#139,.T.);
+#141=ADVANCED_FACE('',(#140),#113,.T.);
+#142=CARTESIAN_POINT($,(0,-0.000000000000001,-7.50555349946513));
+#143=DIRECTION($,(0,0.5,-0.866025403784439));
+#144=DIRECTION($,(1,0,0));
+#145=AXIS2_PLACEMENT_3D($,#142,#143,#144);
+#146=PLANE($,#145);
+#147=CARTESIAN_POINT($,(0,6.5,-3.75277674973257));
+#148=VERTEX_POINT($,#147);
+#149=CARTESIAN_POINT($,(0,-0.000000000000002,-7.50555349946513));
+#150=DIRECTION($,(0,0.866025403784439,0.5));
+#151=VECTOR($,#150,1);
+#152=LINE($,#149,#151);
+#153=EDGE_CURVE($,#115,#148,#152,.T.);
+#154=ORIENTED_EDGE($,$,$,#153,.T.);
+#155=CARTESIAN_POINT($,(-4.67955271361448,6.5,-3.75277674973257));
+#156=VERTEX_POINT($,#155);
+#157=CARTESIAN_POINT($,(0,6.5,-3.75277674973257));
+#158=DIRECTION($,(-1,0,0));
+#159=VECTOR($,#158,1);
+#160=LINE($,#157,#159);
+#161=EDGE_CURVE($,#148,#156,#160,.T.);
+#162=ORIENTED_EDGE($,$,$,#161,.T.);
+#163=CARTESIAN_POINT($,(-8.17944978910712,3.25,-5.62916512459885));
+#164=DIRECTION($,(-0,-0.5,0.866025403784439));
+#165=DIRECTION($,(1,0,0));
+#166=AXIS2_PLACEMENT_3D($,#163,#164,#165);
+#167=HYPERBOLA($,#166,3.03099977800749,6.5);
+#168=TRIMMED_CURVE($,#167,(PARAMETER_VALUE(-0.549306144334055)),(PARAMETER_VALUE(0.549306144334054)),.T.,.PARAMETER.);
+#169=EDGE_CURVE($,#123,#156,#168,.T.);
+#170=ORIENTED_EDGE($,$,$,#169,.F.);
+#171=ORIENTED_EDGE($,$,$,#128,.F.);
+#172=EDGE_LOOP($,(#154,#162,#170,#171));
+#173=FACE_OUTER_BOUND('',#172,.T.);
+#174=ADVANCED_FACE('',(#173),#146,.T.);
+#175=CARTESIAN_POINT($,(0,6.5,-3.75277674973257));
+#176=DIRECTION($,(0,1,-0));
+#177=DIRECTION($,(1,0,0));
+#178=AXIS2_PLACEMENT_3D($,#175,#176,#177);
+#179=PLANE($,#178);
+#180=CARTESIAN_POINT($,(0,6.5,-3.75277674973257));
+#181=DIRECTION($,(0,0,1));
+#182=VECTOR($,#181,1);
+#183=LINE($,#180,#182);
+#184=EDGE_CURVE($,#148,#7,#183,.T.);
+#185=ORIENTED_EDGE($,$,$,#184,.T.);
+#186=ORIENTED_EDGE($,$,$,#38,.T.);
+#187=CARTESIAN_POINT($,(-8.17944978910712,6.5,-0.000000000000002));
+#188=DIRECTION($,(-0,-1,0));
+#189=DIRECTION($,(1,0,0));
+#190=AXIS2_PLACEMENT_3D($,#187,#188,#189);
+#191=HYPERBOLA($,#190,3.03099977800749,6.5);
+#192=TRIMMED_CURVE($,#191,(PARAMETER_VALUE(-0.549306144334055)),(PARAMETER_VALUE(0.549306144334055)),.T.,.PARAMETER.);
+#193=EDGE_CURVE($,#156,#25,#192,.T.);
+#194=ORIENTED_EDGE($,$,$,#193,.F.);
+#195=ORIENTED_EDGE($,$,$,#161,.F.);
+#196=EDGE_LOOP($,(#185,#186,#194,#195));
+#197=FACE_OUTER_BOUND('',#196,.T.);
+#198=ADVANCED_FACE('',(#197),#179,.T.);
+#199=CARTESIAN_POINT($,(-8.17944978910712,0,0));
+#200=DIRECTION($,(1,0,0));
+#201=DIRECTION($,(0,1,0));
+#202=AXIS2_PLACEMENT_3D($,#199,#200,#201);
+#203=CONICAL_SURFACE($,#202,0,1.13446401379631);
+#204=CARTESIAN_POINT($,(-5.3,5.34770686836891,3.0875));
+#205=VERTEX_POINT($,#204);
+#206=CARTESIAN_POINT($,(-5.3,0,6.175));
+#207=VERTEX_POINT($,#206);
+#208=CARTESIAN_POINT($,(-5.3,0,0));
+#209=DIRECTION($,(1,0,0));
+#210=DIRECTION($,(0,1,0));
+#211=AXIS2_PLACEMENT_3D($,#208,#209,#210);
+#212=CIRCLE($,#211,6.175);
+#213=TRIMMED_CURVE($,#212,(PARAMETER_VALUE(0.523598775598299)),(PARAMETER_VALUE(1.5707963267949)),.T.,.PARAMETER.);
+#214=EDGE_CURVE($,#205,#207,#213,.T.);
+#215=ORIENTED_EDGE($,$,$,#214,.T.);
+#216=CARTESIAN_POINT($,(-5.3,0,6.175));
+#217=DIRECTION($,(0.4226182617407,0,0.90630778703665));
+#218=VECTOR($,#217,1);
+#219=LINE($,#216,#218);
+#220=EDGE_CURVE($,#207,#17,#219,.T.);
+#221=ORIENTED_EDGE($,$,$,#220,.T.);
+#222=ORIENTED_EDGE($,$,$,#32,.F.);
+#223=CARTESIAN_POINT($,(-5.3,5.34770686836891,3.0875));
+#224=DIRECTION($,(0.4226182617407,0.784885567221396,0.453153893518325));
+#225=VECTOR($,#224,1);
+#226=LINE($,#223,#225);
+#227=EDGE_CURVE($,#205,#25,#226,.T.);
+#228=ORIENTED_EDGE($,$,$,#227,.F.);
+#229=EDGE_LOOP($,(#215,#221,#222,#228));
+#230=FACE_OUTER_BOUND('',#229,.T.);
+#231=ADVANCED_FACE('',(#230),#203,.T.);
+#232=CARTESIAN_POINT($,(-5.3,-5.34770686836891,3.0875));
+#233=VERTEX_POINT($,#232);
+#234=CARTESIAN_POINT($,(-5.3,0,0));
+#235=DIRECTION($,(1,0,0));
+#236=DIRECTION($,(0,1,0));
+#237=AXIS2_PLACEMENT_3D($,#234,#235,#236);
+#238=CIRCLE($,#237,6.175);
+#239=TRIMMED_CURVE($,#238,(PARAMETER_VALUE(1.5707963267949)),(PARAMETER_VALUE(2.61799387799149)),.T.,.PARAMETER.);
+#240=EDGE_CURVE($,#207,#233,#239,.T.);
+#241=ORIENTED_EDGE($,$,$,#240,.T.);
+#242=CARTESIAN_POINT($,(-5.3,-5.34770686836891,3.0875));
+#243=DIRECTION($,(0.4226182617407,-0.784885567221396,0.453153893518325));
+#244=VECTOR($,#243,1);
+#245=LINE($,#242,#244);
+#246=EDGE_CURVE($,#233,#57,#245,.T.);
+#247=ORIENTED_EDGE($,$,$,#246,.T.);
+#248=ORIENTED_EDGE($,$,$,#70,.F.);
+#249=ORIENTED_EDGE($,$,$,#220,.F.);
+#250=EDGE_LOOP($,(#241,#247,#248,#249));
+#251=FACE_OUTER_BOUND('',#250,.T.);
+#252=ADVANCED_FACE('',(#251),#203,.T.);
+#253=CARTESIAN_POINT($,(-5.3,-5.34770686836891,-3.0875));
+#254=VERTEX_POINT($,#253);
+#255=CARTESIAN_POINT($,(-5.3,0,0));
+#256=DIRECTION($,(1,0,0));
+#257=DIRECTION($,(0,1,0));
+#258=AXIS2_PLACEMENT_3D($,#255,#256,#257);
+#259=CIRCLE($,#258,6.175);
+#260=TRIMMED_CURVE($,#259,(PARAMETER_VALUE(2.61799387799149)),(PARAMETER_VALUE(3.66519142918809)),.T.,.PARAMETER.);
+#261=EDGE_CURVE($,#233,#254,#260,.T.);
+#262=ORIENTED_EDGE($,$,$,#261,.T.);
+#263=CARTESIAN_POINT($,(-5.3,-5.34770686836891,-3.0875));
+#264=DIRECTION($,(0.4226182617407,-0.784885567221396,-0.453153893518325));
+#265=VECTOR($,#264,1);
+#266=LINE($,#263,#265);
+#267=EDGE_CURVE($,#254,#90,#266,.T.);
+#268=ORIENTED_EDGE($,$,$,#267,.T.);
+#269=ORIENTED_EDGE($,$,$,#103,.F.);
+#270=ORIENTED_EDGE($,$,$,#246,.F.);
+#271=EDGE_LOOP($,(#262,#268,#269,#270));
+#272=FACE_OUTER_BOUND('',#271,.T.);
+#273=ADVANCED_FACE('',(#272),#203,.T.);
+#274=CARTESIAN_POINT($,(-5.3,-0.000000000000001,-6.175));
+#275=VERTEX_POINT($,#274);
+#276=CARTESIAN_POINT($,(-5.3,0,0));
+#277=DIRECTION($,(1,0,0));
+#278=DIRECTION($,(0,1,0));
+#279=AXIS2_PLACEMENT_3D($,#276,#277,#278);
+#280=CIRCLE($,#279,6.175);
+#281=TRIMMED_CURVE($,#280,(PARAMETER_VALUE(3.66519142918809)),(PARAMETER_VALUE(4.71238898038469)),.T.,.PARAMETER.);
+#282=EDGE_CURVE($,#254,#275,#281,.T.);
+#283=ORIENTED_EDGE($,$,$,#282,.T.);
+#284=CARTESIAN_POINT($,(-5.3,-0.000000000000001,-6.175));
+#285=DIRECTION($,(0.4226182617407,-0,-0.90630778703665));
+#286=VECTOR($,#285,1);
+#287=LINE($,#284,#286);
+#288=EDGE_CURVE($,#275,#123,#287,.T.);
+#289=ORIENTED_EDGE($,$,$,#288,.T.);
+#290=ORIENTED_EDGE($,$,$,#136,.F.);
+#291=ORIENTED_EDGE($,$,$,#267,.F.);
+#292=EDGE_LOOP($,(#283,#289,#290,#291));
+#293=FACE_OUTER_BOUND('',#292,.T.);
+#294=ADVANCED_FACE('',(#293),#203,.T.);
+#295=CARTESIAN_POINT($,(-5.3,5.34770686836891,-3.0875));
+#296=VERTEX_POINT($,#295);
+#297=CARTESIAN_POINT($,(-5.3,0,0));
+#298=DIRECTION($,(1,0,0));
+#299=DIRECTION($,(0,1,0));
+#300=AXIS2_PLACEMENT_3D($,#297,#298,#299);
+#301=CIRCLE($,#300,6.175);
+#302=TRIMMED_CURVE($,#301,(PARAMETER_VALUE(4.71238898038469)),(PARAMETER_VALUE(5.75958653158129)),.T.,.PARAMETER.);
+#303=EDGE_CURVE($,#275,#296,#302,.T.);
+#304=ORIENTED_EDGE($,$,$,#303,.T.);
+#305=CARTESIAN_POINT($,(-5.3,5.34770686836891,-3.0875));
+#306=DIRECTION($,(0.4226182617407,0.784885567221395,-0.453153893518325));
+#307=VECTOR($,#306,1);
+#308=LINE($,#305,#307);
+#309=EDGE_CURVE($,#296,#156,#308,.T.);
+#310=ORIENTED_EDGE($,$,$,#309,.T.);
+#311=ORIENTED_EDGE($,$,$,#169,.F.);
+#312=ORIENTED_EDGE($,$,$,#288,.F.);
+#313=EDGE_LOOP($,(#304,#310,#311,#312));
+#314=FACE_OUTER_BOUND('',#313,.T.);
+#315=ADVANCED_FACE('',(#314),#203,.T.);
+#316=CARTESIAN_POINT($,(-5.3,0,0));
+#317=DIRECTION($,(1,0,0));
+#318=DIRECTION($,(0,1,0));
+#319=AXIS2_PLACEMENT_3D($,#316,#317,#318);
+#320=CIRCLE($,#319,6.175);
+#321=TRIMMED_CURVE($,#320,(PARAMETER_VALUE(5.75958653158129)),(PARAMETER_VALUE(6.80678408277788)),.T.,.PARAMETER.);
+#322=EDGE_CURVE($,#296,#205,#321,.T.);
+#323=ORIENTED_EDGE($,$,$,#322,.T.);
+#324=ORIENTED_EDGE($,$,$,#227,.T.);
+#325=ORIENTED_EDGE($,$,$,#193,.F.);
+#326=ORIENTED_EDGE($,$,$,#309,.F.);
+#327=EDGE_LOOP($,(#323,#324,#325,#326));
+#328=FACE_OUTER_BOUND('',#327,.T.);
+#329=ADVANCED_FACE('',(#328),#203,.T.);
+#330=CARTESIAN_POINT($,(-5.3,0,0));
+#331=DIRECTION($,(-1,0,0));
+#332=DIRECTION($,(0,1,0));
+#333=AXIS2_PLACEMENT_3D($,#330,#331,#332);
+#334=PLANE($,#333);
+#335=ORIENTED_EDGE($,$,$,#214,.T.);
+#336=ORIENTED_EDGE($,$,$,#240,.T.);
+#337=ORIENTED_EDGE($,$,$,#261,.T.);
+#338=ORIENTED_EDGE($,$,$,#282,.T.);
+#339=ORIENTED_EDGE($,$,$,#303,.T.);
+#340=ORIENTED_EDGE($,$,$,#322,.T.);
+#341=EDGE_LOOP($,(#335,#336,#337,#338,#339,#340));
+#342=FACE_OUTER_BOUND('',#341,.T.);
+#343=ADVANCED_FACE('',(#342),#334,.T.);
+#344=CARTESIAN_POINT($,(0,0,0));
+#345=DIRECTION($,(1,0,0));
+#346=DIRECTION($,(0,1,0));
+#347=AXIS2_PLACEMENT_3D($,#344,#345,#346);
+#348=PLANE($,#347);
+#349=ORIENTED_EDGE($,$,$,#184,.F.);
+#350=ORIENTED_EDGE($,$,$,#153,.F.);
+#351=ORIENTED_EDGE($,$,$,#120,.F.);
+#352=ORIENTED_EDGE($,$,$,#87,.F.);
+#353=ORIENTED_EDGE($,$,$,#54,.F.);
+#354=ORIENTED_EDGE($,$,$,#14,.F.);
+#355=EDGE_LOOP($,(#349,#350,#351,#352,#353,#354));
+#356=FACE_OUTER_BOUND('',#355,.T.);
+#357=CARTESIAN_POINT($,(0,4.2,0));
+#358=VERTEX_POINT($,#357);
+#359=CARTESIAN_POINT($,(0,-4.2,0.000000000000001));
+#360=VERTEX_POINT($,#359);
+#361=CARTESIAN_POINT($,(0,0,0));
+#362=DIRECTION($,(1,0,0));
+#363=DIRECTION($,(0,1,0));
+#364=AXIS2_PLACEMENT_3D($,#361,#362,#363);
+#365=CIRCLE($,#364,4.2);
+#366=TRIMMED_CURVE($,#365,(PARAMETER_VALUE(0)),(PARAMETER_VALUE(3.14159265358979)),.T.,.PARAMETER.);
+#367=EDGE_CURVE($,#358,#360,#366,.T.);
+#368=ORIENTED_EDGE($,$,$,#367,.T.);
+#369=CARTESIAN_POINT($,(0,0,0));
+#370=DIRECTION($,(1,0,0));
+#371=DIRECTION($,(0,1,0));
+#372=AXIS2_PLACEMENT_3D($,#369,#370,#371);
+#373=CIRCLE($,#372,4.2);
+#374=TRIMMED_CURVE($,#373,(PARAMETER_VALUE(3.14159265358979)),(PARAMETER_VALUE(6.28318530717959)),.T.,.PARAMETER.);
+#375=EDGE_CURVE($,#360,#358,#374,.T.);
+#376=ORIENTED_EDGE($,$,$,#375,.T.);
+#377=EDGE_LOOP($,(#368,#376));
+#378=FACE_BOUND('',#377,.T.);
+#379=ADVANCED_FACE('',(#356,#378),#348,.T.);
+#380=CARTESIAN_POINT($,(0.2,0,0));
+#381=DIRECTION($,(1,0,0));
+#382=DIRECTION($,(0,1,0));
+#383=AXIS2_PLACEMENT_3D($,#380,#381,#382);
+#384=TOROIDAL_SURFACE($,#383,4.2,0.2);
+#385=ORIENTED_EDGE($,$,$,#367,.T.);
+#386=CARTESIAN_POINT($,(0.2,-4,0));
+#387=VERTEX_POINT($,#386);
+#388=CARTESIAN_POINT($,(0.2,-4.2,0));
+#389=DIRECTION($,(0,0,-1));
+#390=DIRECTION($,(-1,0,0));
+#391=AXIS2_PLACEMENT_3D($,#388,#389,#390);
+#392=CIRCLE($,#391,0.2);
+#393=TRIMMED_CURVE($,#392,(PARAMETER_VALUE(0)),(PARAMETER_VALUE(1.5707963267949)),.T.,.PARAMETER.);
+#394=EDGE_CURVE($,#360,#387,#393,.T.);
+#395=ORIENTED_EDGE($,$,$,#394,.T.);
+#396=CARTESIAN_POINT($,(0.2,4,0));
+#397=VERTEX_POINT($,#396);
+#398=CARTESIAN_POINT($,(0.2,0,0));
+#399=DIRECTION($,(1,0,0));
+#400=DIRECTION($,(0,1,0));
+#401=AXIS2_PLACEMENT_3D($,#398,#399,#400);
+#402=CIRCLE($,#401,4);
+#403=TRIMMED_CURVE($,#402,(PARAMETER_VALUE(0)),(PARAMETER_VALUE(3.14159265358979)),.T.,.PARAMETER.);
+#404=EDGE_CURVE($,#397,#387,#403,.T.);
+#405=ORIENTED_EDGE($,$,$,#404,.F.);
+#406=CARTESIAN_POINT($,(0.2,4.2,0));
+#407=DIRECTION($,(0,0,1));
+#408=DIRECTION($,(-1,0,0));
+#409=AXIS2_PLACEMENT_3D($,#406,#407,#408);
+#410=CIRCLE($,#409,0.2);
+#411=TRIMMED_CURVE($,#410,(PARAMETER_VALUE(0)),(PARAMETER_VALUE(1.5707963267949)),.T.,.PARAMETER.);
+#412=EDGE_CURVE($,#358,#397,#411,.T.);
+#413=ORIENTED_EDGE($,$,$,#412,.F.);
+#414=EDGE_LOOP($,(#385,#395,#405,#413));
+#415=FACE_OUTER_BOUND('',#414,.T.);
+#416=ADVANCED_FACE('',(#415),#384,.T.);
+#417=ORIENTED_EDGE($,$,$,#375,.T.);
+#418=ORIENTED_EDGE($,$,$,#412,.T.);
+#419=CARTESIAN_POINT($,(0.2,0,0));
+#420=DIRECTION($,(1,0,0));
+#421=DIRECTION($,(0,1,0));
+#422=AXIS2_PLACEMENT_3D($,#419,#420,#421);
+#423=CIRCLE($,#422,4);
+#424=TRIMMED_CURVE($,#423,(PARAMETER_VALUE(3.14159265358979)),(PARAMETER_VALUE(6.28318530717959)),.T.,.PARAMETER.);
+#425=EDGE_CURVE($,#387,#397,#424,.T.);
+#426=ORIENTED_EDGE($,$,$,#425,.F.);
+#427=ORIENTED_EDGE($,$,$,#394,.F.);
+#428=EDGE_LOOP($,(#417,#418,#426,#427));
+#429=FACE_OUTER_BOUND('',#428,.T.);
+#430=ADVANCED_FACE('',(#429),#384,.T.);
+#431=CARTESIAN_POINT($,(0.2,0,0));
+#432=DIRECTION($,(1,0,0));
+#433=DIRECTION($,(0,1,0));
+#434=AXIS2_PLACEMENT_3D($,#431,#432,#433);
+#435=CYLINDRICAL_SURFACE($,#434,4);
+#436=ORIENTED_EDGE($,$,$,#404,.T.);
+#437=CARTESIAN_POINT($,(34.0625,-4,0));
+#438=VERTEX_POINT($,#437);
+#439=CARTESIAN_POINT($,(0.2,-4,0));
+#440=DIRECTION($,(1,0,0));
+#441=VECTOR($,#440,1);
+#442=LINE($,#439,#441);
+#443=EDGE_CURVE($,#387,#438,#442,.T.);
+#444=ORIENTED_EDGE($,$,$,#443,.T.);
+#445=CARTESIAN_POINT($,(34.0625,4,0));
+#446=VERTEX_POINT($,#445);
+#447=CARTESIAN_POINT($,(34.0625,0,0));
+#448=DIRECTION($,(1,0,0));
+#449=DIRECTION($,(0,1,0));
+#450=AXIS2_PLACEMENT_3D($,#447,#448,#449);
+#451=CIRCLE($,#450,4);
+#452=TRIMMED_CURVE($,#451,(PARAMETER_VALUE(0)),(PARAMETER_VALUE(3.14159265358979)),.T.,.PARAMETER.);
+#453=EDGE_CURVE($,#446,#438,#452,.T.);
+#454=ORIENTED_EDGE($,$,$,#453,.F.);
+#455=CARTESIAN_POINT($,(0.2,4,0));
+#456=DIRECTION($,(1,0,0));
+#457=VECTOR($,#456,1);
+#458=LINE($,#455,#457);
+#459=EDGE_CURVE($,#397,#446,#458,.T.);
+#460=ORIENTED_EDGE($,$,$,#459,.F.);
+#461=EDGE_LOOP($,(#436,#444,#454,#460));
+#462=FACE_OUTER_BOUND('',#461,.T.);
+#463=ADVANCED_FACE('',(#462),#435,.T.);
+#464=ORIENTED_EDGE($,$,$,#425,.T.);
+#465=ORIENTED_EDGE($,$,$,#459,.T.);
+#466=CARTESIAN_POINT($,(34.0625,0,0));
+#467=DIRECTION($,(1,0,0));
+#468=DIRECTION($,(0,1,0));
+#469=AXIS2_PLACEMENT_3D($,#466,#467,#468);
+#470=CIRCLE($,#469,4);
+#471=TRIMMED_CURVE($,#470,(PARAMETER_VALUE(3.14159265358979)),(PARAMETER_VALUE(6.28318530717959)),.T.,.PARAMETER.);
+#472=EDGE_CURVE($,#438,#446,#471,.T.);
+#473=ORIENTED_EDGE($,$,$,#472,.F.);
+#474=ORIENTED_EDGE($,$,$,#443,.F.);
+#475=EDGE_LOOP($,(#464,#465,#473,#474));
+#476=FACE_OUTER_BOUND('',#475,.T.);
+#477=ADVANCED_FACE('',(#476),#435,.T.);
+#478=CARTESIAN_POINT($,(38.0625,0,0));
+#479=DIRECTION($,(-1,0,0));
+#480=DIRECTION($,(0,1,0));
+#481=AXIS2_PLACEMENT_3D($,#478,#479,#480);
+#482=CONICAL_SURFACE($,#481,0,0.785398163397448);
+#483=ORIENTED_EDGE($,$,$,#453,.T.);
+#484=CARTESIAN_POINT($,(35,-3.0625,0));
+#485=VERTEX_POINT($,#484);
+#486=CARTESIAN_POINT($,(34.0625,-4,0));
+#487=DIRECTION($,(0.707106781186548,0.707106781186548,0));
+#488=VECTOR($,#487,1);
+#489=LINE($,#486,#488);
+#490=EDGE_CURVE($,#438,#485,#489,.T.);
+#491=ORIENTED_EDGE($,$,$,#490,.T.);
+#492=CARTESIAN_POINT($,(35,3.0625,0));
+#493=VERTEX_POINT($,#492);
+#494=CARTESIAN_POINT($,(35,0,0));
+#495=DIRECTION($,(1,0,0));
+#496=DIRECTION($,(0,1,0));
+#497=AXIS2_PLACEMENT_3D($,#494,#495,#496);
+#498=CIRCLE($,#497,3.0625);
+#499=TRIMMED_CURVE($,#498,(PARAMETER_VALUE(0)),(PARAMETER_VALUE(3.14159265358979)),.T.,.PARAMETER.);
+#500=EDGE_CURVE($,#493,#485,#499,.T.);
+#501=ORIENTED_EDGE($,$,$,#500,.F.);
+#502=CARTESIAN_POINT($,(34.0625,4,0));
+#503=DIRECTION($,(0.707106781186548,-0.707106781186548,0));
+#504=VECTOR($,#503,1);
+#505=LINE($,#502,#504);
+#506=EDGE_CURVE($,#446,#493,#505,.T.);
+#507=ORIENTED_EDGE($,$,$,#506,.F.);
+#508=EDGE_LOOP($,(#483,#491,#501,#507));
+#509=FACE_OUTER_BOUND('',#508,.T.);
+#510=ADVANCED_FACE('',(#509),#482,.T.);
+#511=ORIENTED_EDGE($,$,$,#472,.T.);
+#512=ORIENTED_EDGE($,$,$,#506,.T.);
+#513=CARTESIAN_POINT($,(35,0,0));
+#514=DIRECTION($,(1,0,0));
+#515=DIRECTION($,(0,1,0));
+#516=AXIS2_PLACEMENT_3D($,#513,#514,#515);
+#517=CIRCLE($,#516,3.0625);
+#518=TRIMMED_CURVE($,#517,(PARAMETER_VALUE(3.14159265358979)),(PARAMETER_VALUE(6.28318530717959)),.T.,.PARAMETER.);
+#519=EDGE_CURVE($,#485,#493,#518,.T.);
+#520=ORIENTED_EDGE($,$,$,#519,.F.);
+#521=ORIENTED_EDGE($,$,$,#490,.F.);
+#522=EDGE_LOOP($,(#511,#512,#520,#521));
+#523=FACE_OUTER_BOUND('',#522,.T.);
+#524=ADVANCED_FACE('',(#523),#482,.T.);
+#525=CARTESIAN_POINT($,(35,0,0));
+#526=DIRECTION($,(1,0,0));
+#527=DIRECTION($,(0,1,0));
+#528=AXIS2_PLACEMENT_3D($,#525,#526,#527);
+#529=PLANE($,#528);
+#530=ORIENTED_EDGE($,$,$,#519,.F.);
+#531=ORIENTED_EDGE($,$,$,#500,.F.);
+#532=EDGE_LOOP($,(#530,#531));
+#533=FACE_OUTER_BOUND('',#532,.T.);
+#534=ADVANCED_FACE('',(#533),#529,.T.);
+#535=CLOSED_SHELL($,(#42,#75,#108,#141,#174,#198,#231,#252,#273,#294,#315,#329,#343,#379,#416,#430,#463,#477,#510,#524,#534));
+#536=MANIFOLD_SOLID_BREP('AetherisBody',#535);
+#537=APPLICATION_CONTEXT('mechanical design');
+#538=PRODUCT_CONTEXT('',#537,'mechanical');
+#539=PRODUCT('AETHERIS','AetherisBody','',(#538));
+#540=PRODUCT_DEFINITION_FORMATION('','',#539);
+#541=PRODUCT_DEFINITION_CONTEXT('design',#537,'design');
+#542=PRODUCT_DEFINITION('','',#540,#541);
+#543=PRODUCT_DEFINITION_SHAPE('','',#542);
+#544=(LENGTH_UNIT()NAMED_UNIT(*)SI_UNIT(.MILLI.,.METRE.));
+#545=(NAMED_UNIT(*)PLANE_ANGLE_UNIT()SI_UNIT($,.RADIAN.));
+#546=(NAMED_UNIT(*)SI_UNIT($,.STERADIAN.)SOLID_ANGLE_UNIT());
+#547=(GEOMETRIC_REPRESENTATION_CONTEXT(3)GLOBAL_UNIT_ASSIGNED_CONTEXT((#544,#545,#546))REPRESENTATION_CONTEXT('3','3D'));
+#548=SHAPE_REPRESENTATION('AetherisBody',(#536),#547);
+#549=SHAPE_DEFINITION_REPRESENTATION(#543,#548);
+ENDSEC;
+END-ISO-10303-21;