Next Gen STEP AP242 Native-ish BREP Geometric Modeling Kernel
using System.Text.Json.Serialization;
using Aetheris.Kernel.Core.Brep;
using Aetheris.Kernel.Firmament.Materializer;
namespace Aetheris.Kernel.Firmament;
public sealed record FirmamentStepExportResult(
string StepText,
string ExportedFeatureId,
int ExportedOpIndex,
string ExportedBodyCategory,
string? ExportedFeatureKind = null,
string ExportBodyPolicy = FirmamentStepExporter.LastExecutedGeometricBodyPolicy,
string ExportBodySelectionReason = FirmamentStepExporter.LastExecutedGeometricBodySelectionReason,
IReadOnlyList<FirmamentPmiInspectionDatum>? DatumInspection = null,
IReadOnlyList<FirmamentPmiInspectionDimension>? DimensionInspection = null,
Aetheris.Kernel.Firmament.FirmamentV2.InlineStepMigrationReport? InlineStepMigration = null,
Aetheris.Kernel.Firmament.FirmamentV2.InlineStepReplacementAssistReport? InlineStepReplacementAssist = null,
FirmamentAirChamferReport? Air = null,
Aetheris.Kernel.Firmament.FirmamentV2.ConceptIrDocument? ConceptIr = null,
IReadOnlyList<FirmamentHoleFeatureReport>? Features = null,
FirmamentRoundedBoxReport? RoundedBox = null,
FirmamentHollowBodyReport? Hollow = null,
FirmamentStandaloneLatticeReport? Lattice = null,
FirmamentCombinedFeaturePlanReport? Combined = null,
IReadOnlyList<Aetheris.Kernel.Firmament.FirmamentV2.FirmamentV2VolumeAssertionResult>? Assertions = null,
FirmamentStandardPartReport? StandardPart = null,
IReadOnlyList<FirmamentEngineeringFeatureReport>? EngineeringFeatures = null,
FirmamentWireFormReport? WireForm = null,
FirmamentSweepReport? Sweep = null,
IReadOnlyList<FirmamentSemanticPatternReport>? Patterns = null,
Aetheris.Kernel.Firmament.Structural.StructuralReport? Structural = null,
Aetheris.Kernel.Firmament.Piping.PipingReport? Piping = null,
FirmamentRevolveReport? Revolve = null,
FirmamentGearReport? Gear = null,
Aetheris.Kernel.Firmament.FirmamentV2.FirmamentPlateauReport? Plateau = null,
FirmamentPerforationReport? Perforation = null,
FirmamentThreadReport? Thread = null)
{
public string? DocumentName { get; init; }
public IReadOnlyList<FirmamentFeatureReceipt> MaterializedFeatures { get; init; } = [];
public FirmamentImportedHoleRevisionReport? ImportedHoleRevision { get; init; }
public FirmamentImportedHoleRemovalReport? ImportedHoleRemoval { get; init; }
// Lowerer-owned receipts distinguish generated feature PMI from authored projections.
[JsonIgnore] public IReadOnlyList<Aetheris.Kernel.Core.Step242.Step242SemanticPmi> GeneratedSemanticPmi { get; init; } = [];
public IReadOnlyList<FirmamentV2.FirmamentGeometryAssertionResult> GeometryAssertions { get; init; } = [];
// In-process display can use the exact body that was exported to STEP.
// It is intentionally absent from CLI/JSON artifact serialization.
[JsonIgnore] public BrepBody? RuntimeBody { get; init; }
[JsonIgnore] public SemanticTopologyCorrespondence? RuntimeCorrespondence { get; init; }
// Named product identity supplied by the actual native materializer. Separate
// from diagnostic feature ids such as "gear:Name" and primitive bridge names.
[JsonIgnore] public string? RuntimeBodySourceName { get; init; }
[JsonIgnore] internal Aetheris.Kernel.Firmament.FirmamentV2.FirmamentV2Document? RuntimeAdmissionDocument { get; init; }
[JsonIgnore] internal IReadOnlyList<Aetheris.Kernel.Firmament.FirmamentV2.ConceptIrStructInstance> ConceptDisplayValues { get; init; } = [];
public FirmamentCirRetention? Cir { get; init; }
public FirmamentMakerMarkReport? MakerMark { get; init; }
public ProfileEdgeFinishEvidence? EdgeFinishPlanning { get; init; }
public RibPlanningReport? RibPlanning { get; init; }
}
public sealed record FirmamentMakerMarkReport(string Content, double HeightMm, double DepthMm, int CounterCount);
public sealed record FirmamentThreadReport(
string FeatureId, string Support, double MajorDiameterMm, double RootDiameterMm,
double PitchMm, double LeadMm, double LengthMm, double StartOffsetMm, double AxialStartMm,
string Hand, string ProfileFamily, int Turns,
int Faces, int Edges, int Vertices, int SeamSplits,
double ConstructionMilliseconds, double StepExportMilliseconds, string StepSha256)
{
public string Construction { get; init; } = "stock-minus-groove";
public double HeadSideLandMm { get; init; }
public double TipSideLandMm { get; init; }
}
public sealed record FirmamentPerforationReport(
string FeatureId, string Support, string Layout, double Diameter, double Pitch,
double Margin, double MinimumLigament, int InstanceCount,
IReadOnlyList<string> InstanceIds, int Vertices, int Edges, int Faces,
bool Manifold, bool StepReimportedManifold, string StepSha256)
{
public int? Rows { get; init; }
public int? Columns { get; init; }
public double? AngularPitchRadians { get; init; }
public double? RealizedCircumferentialPitch { get; init; }
public double? MarginTop { get; init; }
public double? MarginBottom { get; init; }
public double? MaximumCurveBoundMm { get; init; }
public double? MaximumPcurveBoundMm { get; init; }
public double? PatternBuildMilliseconds { get; init; }
public double? StepExportMilliseconds { get; init; }
public double? StepReimportMilliseconds { get; init; }
/// <summary>How the STEP text was verified: "full-reimport", or "congruent-specimens" (one- and two-opening
/// specimens round-tripped, plus an exact per-entity count of the full file).</summary>
public string? VerificationBasis { get; init; }
}
public sealed record FirmamentGearItemReport(
string Name,
string Family,
int? Teeth,
double? Module,
double? PressureAngle,
double? PitchDiameter,
double? BaseDiameter,
double? OutsideDiameter,
double? RootDiameter,
double FaceWidth,
double BoreDiameter,
double Phase,
double Backlash,
double? PitchConeAngle,
IReadOnlyList<double> Axis,
int ToothProfileCurveCount,
int InvoluteSpanCount,
double MaximumInvoluteApproximationError,
string ToothConstruction,
IReadOnlyList<string> StableToothIds);
public sealed record FirmamentGearInterfaceReport(
string Name,
string GearA,
string GearB,
string Kind,
bool Compatible,
double? ExpectedCenterDistance,
double? Ratio,
int RotationSign,
string AxisRelation,
double? ShaftAngle,
double? EngagementPhase,
string? AllowedDirection,
IReadOnlyList<string> RejectionReasons);
public sealed record FirmamentGearReport(
string Model,
IReadOnlyList<FirmamentGearItemReport> Gears,
IReadOnlyList<FirmamentGearInterfaceReport> Interfaces,
int Vertices,
int Edges,
int Faces,
int Planes,
int Cylinders,
int Cones,
int BSplineSurfaces,
int LinearExtrusionSurfaces,
bool EnclosedManifold,
bool StepReimportSucceeded,
bool StepReimportedManifold,
string StepSha256,
string Representation,
string Qualification);
public sealed record FirmamentRevolveReport(
string Profile, string Axis, double SweepRadians, double SweepDegrees, string? Alias,
string Direction, string Classification, string DeterministicSignature, IReadOnlyList<string> SurfaceRoles,
int Vertices, int Edges, int Faces, int Planes, int Cylinders, int Cones, int Spheres, int Tori,
int SurfacesOfRevolution, bool StepReimportedManifold, string StepSha256);
public sealed record FirmamentWireStateReport(
IReadOnlyList<double> Position, IReadOnlyList<double> Tangent, IReadOnlyList<double> Up,
IReadOnlyList<double> Right, double AccumulatedLengthMm);
public sealed record FirmamentWireOperationReport(
int Ordinal, string Name, string Kind, double LengthMm, double? RadiusMm, double? AngleDegrees,
string? Plane, string StableId, FirmamentWireStateReport Input, FirmamentWireStateReport Output,
string CenterlineSegment, string SweepSurface,
string? CoilKind = null, double? Turns = null, string? Handedness = null, double? PitchMm = null,
double? HeightMm = null, double? StartPhaseDegrees = null, string? Support = null, string? Side = null,
string? ProgressionLaw = null, double? MinimumSelfClearanceMm = null, double? SupportClearanceMm = null,
double? CenterlineApproximationToleranceMm = null, int? CenterlineApproximationSegmentCount = null,
double? CenterlineApproximationMaxErrorMm = null, double? CenterlineApproximationRmsErrorMm = null,
string? KnotFamily = null, int? P = null, int? Q = null, int? ComponentCount = null, bool? Closed = null,
double? ScaleMm = null, double? MajorRadiusMm = null, double? MinorRadiusMm = null,
double? MinimumNonlocalCenterlineDistanceMm = null, double? MinimumLocalCurvatureRadiusMm = null,
double? TubeRadiusLimitMm = null, double? RawClosureRotationRadians = null,
double? AppliedDistributedCorrectionRadians = null, double? FinalClosureRotationErrorRadians = null,
double? KnotApproximationMaxErrorMm = null, double? KnotApproximationRmsErrorMm = null,
double? ClosestParameter1 = null, double? ClosestParameter2 = null,
FirmamentWireAxisDatum? AxisDatum = null);
/// <summary>The actual winding axis, independent of the wire start tangent and part origin.</summary>
public sealed record FirmamentWireAxisDatum(IReadOnlyList<double> Origin, IReadOnlyList<double> Direction,
IReadOnlyList<double> Radial, double ClearDiameterMm);
public sealed record FirmamentWireTerminalReport(
string Name, IReadOnlyList<double> Position, IReadOnlyList<double> Tangent, IReadOnlyList<double> Up, double DiameterMm);
public sealed record FirmamentWireFormReport(
string WireFormId, double DiameterMm, string Material, int OperationCount, int StraightCount, int BendCount,
double TotalStraightLengthMm, double TotalBendLengthMm, double TotalWireLengthMm, double VolumeMm3,
double MassKilograms, FirmamentWireTerminalReport StartTerminal, FirmamentWireTerminalReport EndTerminal,
double MinimumBendRadiusMm, string BendRadiusSemantics, string MinimumBendRadiusValidation,
string SelfIntersectionValidation, string FrameTransportPolicy, IReadOnlyList<FirmamentWireOperationReport> Operations,
IReadOnlyList<double> Bounds, int Cylinders, int Tori, int Planes, int OtherSurfaces,
int RationalProductSurfaces, int FacetedFallback, bool EnclosedManifold, string StepSha256,
bool StepReimportSucceeded, bool StepReimportedManifold,
int CoilCount = 0, double TotalCoilLengthMm = 0d, double? MinimumSelfClearanceMm = null,
int NonRationalBSplineSurfaces = 0, int MaximumPolynomialDegree = 0,
string CoilRepresentation = "NotApplicable", int KnotCount = 0, string? KnotFamily = null,
double? MinimumNonlocalCenterlineDistanceMm = null, double? MinimumLocalCurvatureRadiusMm = null,
double? TubeRadiusLimitMm = null, double? FinalFrameClosureErrorRadians = null,
int Vertices = 0, int Edges = 0, int Faces = 0, int PcurveCount = 0, double MaximumPcurveErrorMm = 0d);
public sealed record FirmamentSemanticPatternReport(
string Name,
string Source,
string Generator,
int Count,
IReadOnlyList<string> GeneratedInstances,
string Distribution,
string Status = "PreservedThroughFeatureAir;InstancesMaterializedAtBRepPlan",
IReadOnlyList<FirmamentV2.FirmamentV2PatternAssociation>? Associations = null);
public sealed record FirmamentSweepReport(
string Path,
int SegmentCount,
double Diameter,
double CenterlineLength,
double Volume,
double MassKilograms,
IReadOnlyList<double> Bounds,
string Material,
int Cylinders,
int Tori,
int Planes,
bool EnclosedManifold,
string StepSha256,
bool StepReimportSucceeded,
bool StepReimportedManifold,
string SelfIntersectionPolicy,
FirmamentSweepTimingReport Timings);
public sealed record FirmamentSweepTimingReport(
double TemplateBindMilliseconds,
double CanonicalParseMilliseconds,
double AirLoweringMilliseconds,
double BrepConstructionMilliseconds,
double StepExportMilliseconds,
double StepReimportMilliseconds);
/// <summary>Public semantic feature inventory; geometry implementation details are deliberately omitted.</summary>
public sealed record FirmamentEngineeringFeatureReport(
string Name,
string Kind,
string FeatureId,
string Host,
string Support,
string Profile,
double Extent,
string ExtentKind,
string MaterialEffect,
double? RemainingFloor = null,
double? MinimumFloorThickness = null,
string? PolicySource = null,
string MaterializationRoute = "PrismaticSectionStack",
string? SupportSpan = null,
string? ParentSupport = null,
string? ToolFamily = null,
string? Direction = null,
string? Termination = null,
IReadOnlyList<double>? AuthorizedRegion = null,
string Validity = "Valid");
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(
string Route,
string Disposition,
string HostPlanId,
IReadOnlyList<string> OrderedStages,
string FinalPlanId,
string Interaction,
int HoleDescendantCount,
int EdgeFinishDescendantCount,
double HostVolume,
double HoleRemovedVolume,
double FinalAnalyticVolume,
string StepSha256,
int Vertices,
int Edges,
int Faces,
int Planes,
int Cylinders,
bool ReimportSucceeded,
bool ReimportedManifold);
public sealed record FirmamentStandaloneLatticeReport(
string Template,
string Pattern,
IReadOnlyList<int> Cells,
double CellSize,
double StrutRadius,
double NodeRadius,
IReadOnlyList<double> DomainSize,
string Placement,
int Nodes,
int Members,
int Seams,
int Valence3,
int Valence4,
int Valence5,
int Valence6,
bool AuthoritativePlan,
string Signature,
int Vertices,
int Edges,
int Faces,
int SphericalFaces,
int CylindricalFaces,
double AnalyticVolume,
double BrepVolume,
double VolumeDelta,
double SurfaceArea,
IReadOnlyList<double> Centroid,
string StepSha256,
bool ReimportSucceeded,
bool ReimportedManifold,
bool LegacyFallback = false);
/// <summary>Export evidence for the generic Primitive<Hollow> path.</summary>
public sealed record FirmamentHollowBodyReport(
string Primitive,
string ConstructionPolicy,
double WallThickness,
IReadOnlyList<string> Openings,
string WitnessKind,
bool WitnessExact,
string ThicknessPolicy,
bool ThicknessVerified,
string BRepPlanKind,
bool AuthoritativePlan,
string Signature,
int Vertices,
int Edges,
int Faces,
int Planes,
int Cylinders,
int Cones,
int RimFaces,
string AnalyticVolume,
string StepSha256,
bool ReimportSucceeded,
bool ReimportedManifold,
bool LegacyFallback = false);
public sealed record FirmamentRoundedBoxReport(
FirmamentRoundedBoxPrimitiveReport Primitive,
FirmamentRoundedBoxEdgeFinishReport? EdgeFinish,
FirmamentRoundedBoxPlanReport BRepPlan,
FirmamentRoundedBoxGeometryReport Geometry,
FirmamentRoundedBoxStepReport Step);
public sealed record FirmamentRoundedBoxPrimitiveReport(string FeatureAir, string ConstructionAir, double Width, double Depth, double Height, double CornerRadius, int PlanarSideFaces, int CylindricalCornerWallFaces, bool LegacyFallback);
public sealed record FirmamentRoundedBoxEdgeFinishReport(string Target, string Kind, double Radius, int CylindricalStraightFaces, int ToroidalCornerFaces, double ToroidalMajorRadius, double ToroidalMinorRadius, string Derivation);
public sealed record FirmamentRoundedBoxPlanReport(bool Authoritative, string Signature, int Vertices, int Edges, int Faces, int Loops, int Coedges, IReadOnlyList<string> Roles);
public sealed record FirmamentRoundedBoxGeometryReport(string Bounds, bool EnclosedManifold, int Planes, int Cylinders, int Tori, double AnalyticVolume, string Preflight);
public sealed record FirmamentRoundedBoxStepReport(string Sha256, bool ReimportSucceeded, bool ReimportedManifold, int ReimportedFaces, string ReimportedBounds);
public sealed record FirmamentHoleFeatureReport(
string Name,
string Kind,
string FeatureId,
double Diameter,
double LocalU,
double LocalV,
IReadOnlyList<double>? ResolvedPoint3,
string? CenterSource,
string? CenterStableId,
int? PointOrdinal,
string PlacementFace,
string? SourceSpan,
string MaterializationRoute,
string? ConstructionKind = null,
string? StackKind = null,
string? WitnessSummary = null,
int CylindricalFaces = 0,
int ConicalFaces = 0,
int PlanarFaces = 0,
string? StepSha256 = null,
bool StepReimportSucceeded = false,
string? SupportSpan = null,
string? ParentSupport = null,
double? SupportBoundaryMargin = null);
public sealed record FirmamentAirChamferReport(
FirmamentAirChamferFeatureReport Feature,
FirmamentAirChamferConstructionReport Construction,
FirmamentAirChamferBRepPlanReport BRepPlan,
FirmamentAirChamferMaterializationReport Materialization,
FirmamentAirChamferStepReport Step,
FirmamentLocalizedChamferTrace? LocalizedChamfer = null,
FirmamentLocalizedFilletTrace? LocalizedFillet = null,
FirmamentLocalizedEdgeFinishTrace? LocalizedEdgeFinish = null,
FirmamentLocalizedEdgeJunctionTrace? LocalizedEdgeJunction = null);
/// <summary>Evidence for the combined two-edge realization; both replacements share one plan.</summary>
public sealed record FirmamentLocalizedEdgeJunctionTrace(
IReadOnlyList<string> Edges,
string FinishKind,
string Rule,
double Value,
string SelectionMode,
string Construction,
string CornerPatch,
int ReplacementFaces,
int JunctionFaces,
FirmamentLocalizedChamferPlanTrace BRepPlan,
string Preflight,
bool LegacyFallback,
int CandidatePlans,
int HardValidPlans,
FirmamentLocalizedJunctionClosureTrace? Closure = null);
public sealed record FirmamentLocalizedJunctionClosureTrace(
string Kind,
string SurfaceA,
string SurfaceB,
string CurveKind,
bool Exact,
int SharedEdges,
string Branch);
/// <summary>Authoritative shared semantic evidence for localized edge replacement routes.</summary>
public sealed record FirmamentLocalizedEdgeFinishTrace(
string Kind,
string Selection,
string RuleKind,
double Value,
string Construction,
string ReplacementGeometry,
string SelectionMode,
int RetainedFaces,
int ReplacementFaces,
string EndpointPolicy,
FirmamentLocalizedChamferPlanTrace BRepPlan,
string Preflight,
bool LegacyFallback);
/// <summary>Bounded report of the localized AIR path; it is evidence, never input to emission.</summary>
public sealed record FirmamentLocalizedChamferTrace(
string Selection,
string Construction,
string SelectionMode,
int RetainedFaces,
int ReplacementFaces,
string EndpointPolicy,
FirmamentLocalizedChamferPlanTrace BRepPlan,
string Preflight,
bool LegacyFallback);
public sealed record FirmamentLocalizedChamferPlanTrace(bool Authoritative, string Signature);
/// <summary>Evidence emitted by the narrow AIR-FILLET-LOCALIZED-M1 production route.</summary>
public sealed record FirmamentLocalizedFilletTrace(
string Selection,
string Rule,
double Radius,
string Construction,
string Profile,
string Sweep,
string SelectionMode,
int RetainedFaces,
int ReplacementFaces,
string EndpointPolicy,
FirmamentLocalizedChamferPlanTrace BRepPlan,
string Preflight,
bool LegacyFallback);
public sealed record FirmamentAirChamferFeatureReport(string Kind, string Body, string FeatureId, string FeatureName, string Selection, double Distance, string Unit, string SourceSpan, string Admission, string AdmissionReason, IReadOnlyDictionary<string, string>? Provenance = null);
public sealed record FirmamentAirChamferConstructionReport(
string Kind,
int SectionCount,
IReadOnlyList<double> SectionZ,
string Correspondence,
string SplitPolicy,
string? WitnessSummary = null,
bool CompilerGeneratedWitness = false,
IReadOnlyList<IReadOnlyList<double>>? SharpProfile = null,
IReadOnlyList<IReadOnlyList<double>>? ReplacementProfile = null);
public sealed record FirmamentAirChamferBRepPlanReport(bool Authoritative, int ExpectedVertices, int ExpectedEdges, int ExpectedFaces, int ExpectedLoops, int ExpectedCoedges, int ChamferFaces, string SplitPolicy, string DeterministicSignature, string? PlanKind = null);
public sealed record FirmamentAirChamferMaterializationReport(string Route, bool LegacyFallback, bool EnclosedManifold, int Vertices, int Edges, int Faces, string Bounds, double MeasuredTopInsetX, double MeasuredTopInsetY, int CylindricalFaces = 0, int ConicalFaces = 0, int PlanarFaces = 0, int SphericalFaces = 0);
public sealed record FirmamentAirChamferStepReport(string Schema, string Sha256, bool ReimportSucceeded, int ReimportedVertices, int ReimportedEdges, int ReimportedFaces, string ReimportedBounds, bool ReimportedManifold);
public sealed record FirmamentPmiInspectionDatum(
string Label,
string DatumType,
string Target);
public sealed record FirmamentPmiInspectionDimension(
string Kind,
string Target,
string? Datum,
double Value,
string? SourceTag,
string? CandidateName = null);