Skip to content

Next Gen STEP AP242 Native-ish BREP Geometric Modeling Kernel

Add CLI support for compiling Firmament drawings

Yuechen Li0f14dc7239e9
diff --git a/Aetheris.CLI.Tests/DrawingCliTests.cs b/Aetheris.CLI.Tests/DrawingCliTests.cs
new file mode 100644
index 00000000..c25ebffb
--- /dev/null
+++ b/Aetheris.CLI.Tests/DrawingCliTests.cs
@@ -0,0 +1,47 @@
+using System.Text.Json;
+
+namespace Aetheris.CLI.Tests;
+
+public sealed class DrawingCliTests
+{
+ [Fact]
+ public void DrawingCompile_ReportsRealArtifactsAndCollisionEvidence()
+ {
+ var output = Path.Combine(Path.GetTempPath(), $"aetheris-drawing-cli-{Guid.NewGuid():N}");
+ try
+ {
+ using var stdout = new StringWriter();
+ using var stderr = new StringWriter();
+ var exit = CliRunner.Run(["drawing", "compile", Fixture(), "--out-dir", output, "--json"], stdout, stderr);
+
+ Assert.Equal(0, exit);
+ using var json = JsonDocument.Parse(stdout.ToString());
+ Assert.True(json.RootElement.GetProperty("success").GetBoolean());
+ Assert.Equal(2, json.RootElement.GetProperty("pageCount").GetInt32());
+ Assert.Equal(0, json.RootElement.GetProperty("layout").GetProperty("textModelCollisionsAfter").GetInt32());
+ Assert.True(File.Exists(json.RootElement.GetProperty("pdfPath").GetString()));
+ Assert.True(File.Exists(json.RootElement.GetProperty("drawingIrPath").GetString()));
+ Assert.Equal(string.Empty, stderr.ToString());
+ }
+ finally
+ {
+ if (Directory.Exists(output)) Directory.Delete(output, true);
+ }
+ }
+
+ [Fact]
+ public void TopLevelHelp_AdvertisesDrawingCompiler()
+ {
+ using var stdout = new StringWriter();
+ using var stderr = new StringWriter();
+ Assert.Equal(0, CliRunner.Run(["--help"], stdout, stderr));
+ Assert.Contains("drawing", stdout.ToString(), StringComparison.Ordinal);
+ }
+
+ private static string Fixture()
+ {
+ var directory = new DirectoryInfo(AppContext.BaseDirectory);
+ while (directory is not null && !File.Exists(Path.Combine(directory.FullName, "Aetheris.slnx"))) directory = directory.Parent;
+ return Path.Combine(directory?.FullName ?? throw new InvalidOperationException("Repository root not found."), "fixtures", "DrawingM0", "bearing-block-drawing.firmament");
+ }
+}
diff --git a/Aetheris.CLI/CliRunner.cs b/Aetheris.CLI/CliRunner.cs
index 13985936..71c060e1 100644
--- a/Aetheris.CLI/CliRunner.cs
+++ b/Aetheris.CLI/CliRunner.cs
@@ -10,6 +10,7 @@ using Aetheris.Kernel.Core.Math;
using Aetheris.Kernel.Core.Step242;
using Aetheris.Kernel.Firmament;
using Aetheris.Kernel.Firmament.Assembly;
+using Aetheris.Kernel.Firmament.Drawing;
using Aetheris.Kernel.Firmament.FirmamentV2;
using Aetheris.Kernel.Firmament.Materializer;
using Aetheris.Firmament.FrictionLab.CIRLab;
@@ -150,6 +151,7 @@ public static class CliRunner
private const string ExperimentalPrismaticCorpusUsage = "Usage: aetheris experimental prismatic-corpus --out-dir <dir> [--json]";
private const string ExperimentalPrismaticMapUsage = "Usage: aetheris experimental prismatic-map --case <case> --rows <N> --cols <N> --json";
private const string FeaUsage = "Usage: aetheris fea <analysis.firmament> [--rotate <x,y,z-degrees>] [--out-dir <directory>] [--json]";
+ private const string DrawingUsage = "Usage: aetheris drawing compile <drawing.firmament> --out-dir <directory> [--json]";
private const string ExperimentalLoopChamferCorpusUsage = "Usage: aetheris experimental loop-chamfer-corpus --out-dir <dir> [--json]";
internal static readonly JsonSerializerOptions JsonOptions = new()
@@ -201,6 +203,7 @@ public static class CliRunner
"sections" => RunSections(args.Skip(1).ToArray(), stdout, stderr),
"analyze" => RunAnalyze(args.Skip(1).ToArray(), stdout, stderr),
"fea" => RunFea(args.Skip(1).ToArray(), stdout, stderr),
+ "drawing" => RunDrawing(args.Skip(1).ToArray(), stdout, stderr),
"verify" => RunVerify(args.Skip(1).ToArray(), stdout, stderr),
"view" => RunView(args.Skip(1).ToArray(), stdout, stderr, cadmataLauncher, cliBaseDirectory),
"match" => RunMatch(args.Skip(1).ToArray(), stdout, stderr),
@@ -459,6 +462,41 @@ public static class CliRunner
return 0;
}
+ private static int RunDrawing(string[] args, TextWriter stdout, TextWriter stderr)
+ {
+ if (args.Length == 0 || IsHelpFlag(args[0]))
+ {
+ (args.Length == 0 ? stderr : stdout).WriteLine(DrawingUsage);
+ return args.Length == 0 ? 1 : 0;
+ }
+ if (!string.Equals(args[0], "compile", StringComparison.Ordinal) || args.Length < 2)
+ {
+ stderr.WriteLine(DrawingUsage);
+ return 1;
+ }
+ var source = args[1];
+ string? output = null;
+ var json = false;
+ for (var i = 2; i < args.Length; i++)
+ {
+ if (args[i] == "--out-dir" && i + 1 < args.Length) output = args[++i];
+ else if (args[i] == "--json") json = true;
+ else { stderr.WriteLine($"Unknown drawing option '{args[i]}'."); stderr.WriteLine(DrawingUsage); return 1; }
+ }
+ output ??= Path.Combine(Path.GetDirectoryName(Path.GetFullPath(source))!, "drawing-output");
+ var result = FirmamentDrawingCompiler.Compile(source, output);
+ if (!result.IsSuccess)
+ {
+ if (json) stdout.WriteLine(JsonSerializer.Serialize(new { success = false, diagnostics = result.Diagnostics }, JsonOptions));
+ else foreach (var diagnostic in result.Diagnostics) stderr.WriteLine(diagnostic);
+ return 1;
+ }
+ var artifacts = result.Artifacts!;
+ if (json) stdout.WriteLine(JsonSerializer.Serialize(new { success = true, artifacts.DrawingIrPath, artifacts.SvgPath, artifacts.PdfPath, artifacts.ValidationPath, artifacts.PdfSha256, artifacts.DrawingIrSha256, pageCount = artifacts.Drawing.Pages.Count, layout = artifacts.Drawing.LayoutEvidence }, JsonOptions));
+ else stdout.WriteLine($"Compiled Drawing '{artifacts.Drawing.Identity}' to {artifacts.PdfPath} ({artifacts.Drawing.Pages.Count} A4 page(s)).");
+ return 0;
+ }
+
private static int RunFea(string[] args, TextWriter stdout, TextWriter stderr)
{
if (args.Length == 0 || IsHelpFlag(args[0])) { stdout.WriteLine(FeaUsage); return args.Length == 0 ? 1 : 0; }
@@ -3271,7 +3309,7 @@ public static class CliRunner
private static int UnknownCommand(string command, TextWriter stderr)
{
- stderr.WriteLine($"Unknown command '{command}'. Expected one of: validate, build, inspect, analyze, verify, view.");
+ stderr.WriteLine($"Unknown command '{command}'. Expected one of: validate, build, drawing, inspect, analyze, verify, view.");
stderr.WriteLine("Run 'aetheris --help' for usage and examples.");
return 1;
}
@@ -3362,6 +3400,7 @@ public static class CliRunner
stdout.WriteLine(" inspect Inspect Firmament semantics or STEP topology.");
stdout.WriteLine(" analyze Analyze STEP topology and analytic surfaces.");
stdout.WriteLine(" fea Compile and solve a Firmament linear-elastic analysis and export Abaqus verification input.");
+ stdout.WriteLine(" drawing Compile a Firmament Drawing Template to DrawingIR, SVG, and vector A4 PDF.");
stdout.WriteLine(" verify Build/reimport and verify a model.");
stdout.WriteLine();
stdout.WriteLine("Global options:");
@@ -3374,6 +3413,7 @@ public static class CliRunner
stdout.WriteLine(" aetheris view bracket.firmament");
stdout.WriteLine(" aetheris analyze imported.step --json");
stdout.WriteLine(" aetheris fea plate-with-hole.firmament --out-dir artifacts --json");
+ stdout.WriteLine(" aetheris drawing compile bearing-block-drawing.firmament --out-dir artifacts/drawing --json");
stdout.WriteLine();
stdout.WriteLine("Run 'aetheris <command> --help' for command-specific usage.");
}
diff --git a/Aetheris.Kernel.Firmament.Tests/DrawingM0Tests.cs b/Aetheris.Kernel.Firmament.Tests/DrawingM0Tests.cs
new file mode 100644
index 00000000..45e1abe8
--- /dev/null
+++ b/Aetheris.Kernel.Firmament.Tests/DrawingM0Tests.cs
@@ -0,0 +1,93 @@
+using System.Text;
+using Aetheris.Kernel.Firmament.Drawing;
+
+namespace Aetheris.Kernel.Firmament.Tests;
+
+public sealed class DrawingM0Tests
+{
+ [Fact]
+ public void DrawingTemplate_CompilesAuthoritativeProduct_ToTwoA4VectorPages()
+ {
+ using var temporary = new TemporaryDirectory();
+ var result = FirmamentDrawingCompiler.Compile(Fixture(), temporary.Path);
+
+ Assert.True(result.IsSuccess, string.Join(Environment.NewLine, result.Diagnostics));
+ var artifacts = result.Artifacts!;
+ Assert.Equal("BearingBlock", artifacts.Drawing.Provenance.SourceProductIdentity);
+ Assert.Equal("StandardMachinedDrawing", artifacts.Drawing.Provenance.TemplateIdentity);
+ Assert.Equal(2, artifacts.Drawing.Pages.Count);
+ Assert.All(artifacts.Drawing.Pages, page => Assert.True(
+ (page.WidthMillimetres, page.HeightMillimetres) is (297, 210) or (210, 297)));
+ Assert.Equal(0, artifacts.Drawing.LayoutEvidence.TextModelCollisionsAfter);
+ Assert.Equal(0, artifacts.Drawing.LayoutEvidence.TextTextCollisionsAfter);
+ Assert.Equal(0, artifacts.Drawing.LayoutEvidence.FailedAnnotationCount);
+ Assert.Contains(artifacts.Drawing.Pages.SelectMany(page => page.Annotations), annotation => annotation.SemanticReference == "MountDiameter" && annotation.EngineeringDisplay.Contains("8 mm", StringComparison.Ordinal));
+ Assert.Contains(artifacts.Drawing.Pages.SelectMany(page => page.Tables), table => table.SourceIdentity == "BearingStandards" && table.Rows.Count == 3);
+
+ var pdf = Encoding.Latin1.GetString(File.ReadAllBytes(artifacts.PdfPath));
+ Assert.StartsWith("%PDF-1.4", pdf, StringComparison.Ordinal);
+ Assert.Contains("/Count 2", pdf, StringComparison.Ordinal);
+ Assert.Contains("/MediaBox [0 0 841.89 595.276]", pdf, StringComparison.Ordinal);
+ Assert.DoesNotContain("/Subtype /Image", pdf, StringComparison.Ordinal);
+ Assert.Contains("Bearing block production drawing", pdf, StringComparison.Ordinal);
+ }
+
+ [Fact]
+ public void DrawingLayout_AndPdf_AreDeterministic()
+ {
+ using var first = new TemporaryDirectory();
+ using var second = new TemporaryDirectory();
+ var a = FirmamentDrawingCompiler.Compile(Fixture(), first.Path);
+ var b = FirmamentDrawingCompiler.Compile(Fixture(), second.Path);
+
+ Assert.True(a.IsSuccess, string.Join(Environment.NewLine, a.Diagnostics));
+ Assert.True(b.IsSuccess, string.Join(Environment.NewLine, b.Diagnostics));
+ Assert.Equal(a.Artifacts!.PdfSha256, b.Artifacts!.PdfSha256);
+ Assert.Equal(a.Artifacts.DrawingIrSha256, b.Artifacts.DrawingIrSha256);
+ Assert.Equal(
+ a.Artifacts.Drawing.Pages.SelectMany(page => page.Annotations).Select(annotation => annotation.SelectedCandidate.Identity),
+ b.Artifacts.Drawing.Pages.SelectMany(page => page.Annotations).Select(annotation => annotation.SelectedCandidate.Identity));
+ }
+
+ [Fact]
+ public void UnsupportedPmiReference_IsTypedDiagnostic()
+ {
+ using var temporary = new TemporaryDirectory();
+ var source = File.ReadAllText(Fixture()).Replace("PMI: [MountDiameter, A]", "PMI: [UnknownDimension]", StringComparison.Ordinal);
+ var path = System.IO.Path.Combine(temporary.Path, "unknown-pmi.firmament");
+ File.WriteAllText(path, source);
+
+ var result = FirmamentDrawingCompiler.Compile(path, System.IO.Path.Combine(temporary.Path, "out"));
+
+ Assert.False(result.IsSuccess);
+ Assert.Contains(result.Diagnostics, diagnostic => diagnostic.StartsWith(FirmamentDrawingCompiler.DrawingPmiUnknown, StringComparison.Ordinal));
+ }
+
+ [Fact]
+ public void ConceptRequire_FailsWhenDrawingDoesNotCommunicateMaterial()
+ {
+ using var temporary = new TemporaryDirectory();
+ var source = File.ReadAllText(Fixture()).Replace("Material: \"6061-T6 aluminium\"", "", StringComparison.Ordinal);
+ var path = System.IO.Path.Combine(temporary.Path, "missing-material.firmament");
+ File.WriteAllText(path, source);
+
+ var result = FirmamentDrawingCompiler.Compile(path, System.IO.Path.Combine(temporary.Path, "out"));
+
+ Assert.False(result.IsSuccess);
+ Assert.Contains(result.Diagnostics, diagnostic => diagnostic.Contains("MachinedPartDrawing.Material", StringComparison.Ordinal));
+ }
+
+ private static string Fixture()
+ {
+ var directory = new DirectoryInfo(AppContext.BaseDirectory);
+ while (directory is not null && !File.Exists(System.IO.Path.Combine(directory.FullName, "Aetheris.slnx"))) directory = directory.Parent;
+ return System.IO.Path.Combine(directory?.FullName ?? throw new InvalidOperationException("Repository root not found."), "fixtures", "DrawingM0", "bearing-block-drawing.firmament");
+ }
+
+ private sealed class TemporaryDirectory : IDisposable
+ {
+ public TemporaryDirectory() { Path = System.IO.Path.Combine(System.IO.Path.GetTempPath(), $"aetheris-drawing-{Guid.NewGuid():N}"); Directory.CreateDirectory(Path); }
+ public string Path { get; }
+ public void Dispose() { if (Directory.Exists(Path)) Directory.Delete(Path, true); }
+ }
+}
diff --git a/Aetheris.Kernel.Firmament/Drawing/DrawingAnnotationLayout.cs b/Aetheris.Kernel.Firmament/Drawing/DrawingAnnotationLayout.cs
new file mode 100644
index 00000000..adf2e27f
--- /dev/null
+++ b/Aetheris.Kernel.Firmament/Drawing/DrawingAnnotationLayout.cs
@@ -0,0 +1,116 @@
+namespace Aetheris.Kernel.Firmament.Drawing;
+
+internal static class DrawingAnnotationLayout
+{
+ internal sealed record Result(IReadOnlyList<DrawingPageIr> Pages, DrawingLayoutEvidenceIr Evidence, IReadOnlyList<string> Diagnostics);
+
+ public static Result Layout(IReadOnlyList<DrawingPageIr> pages, IReadOnlyDictionary<string, FirmamentDrawingCompiler.PmiPresentation> pmi)
+ {
+ var occupied = new List<DrawingRect>();
+ var laneOccupancy = new Dictionary<string, int>(StringComparer.Ordinal);
+ var rejected = 0; var failed = 0; var before = 0;
+ var output = new List<DrawingPageIr>();
+ var diagnostics = new List<string>();
+
+ foreach (var page in pages)
+ {
+ var annotations = new List<DrawingAnnotationIr>();
+ foreach (var view in page.Views)
+ {
+ foreach (var reference in view.AssignedPmi)
+ {
+ var semantic = pmi[reference];
+ var anchor = view.SemanticAnchors.GetValueOrDefault(reference,
+ new(view.GeometryBounds.X + view.GeometryBounds.Width / 2, view.GeometryBounds.Y + view.GeometryBounds.Height / 2));
+ if (semantic.Kind == DrawingAnnotationKind.Datum)
+ anchor = new(view.GeometryBounds.X + view.GeometryBounds.Width / 2, view.GeometryBounds.Bottom);
+ var candidates = GenerateCandidates(view, semantic, anchor);
+ before += CollidesModel(candidates[0].Body, view) ? 1 : 0;
+ DrawingAnnotationCandidateIr? selected = null;
+ var evaluated = new List<DrawingAnnotationCandidateIr>();
+ foreach (var candidate in candidates)
+ {
+ var rejections = new List<string>();
+ if (!Contains(view.Viewport, candidate.Body)) rejections.Add("outside-view-allocation");
+ if (CollidesModel(candidate.Body, view)) rejections.Add("text-model-overlap");
+ if (occupied.Any(rect => rect.Intersects(candidate.Body))) rejections.Add("text-text-overlap");
+ var current = candidate with { Rejections = rejections };
+ evaluated.Add(current);
+ if (rejections.Count == 0 && selected is null) selected = current;
+ else if (rejections.Count > 0) rejected++;
+ }
+ if (selected is null)
+ {
+ failed++;
+ diagnostics.Add($"{FirmamentDrawingCompiler.DrawingLayoutImpossible}: '{reference}' in view '{view.Identity}' has no collision-free bounded candidate.");
+ continue;
+ }
+ occupied.Add(selected.Body);
+ laneOccupancy[selected.Lane] = laneOccupancy.GetValueOrDefault(selected.Lane) + 1;
+ annotations.Add(new($"annotation:{view.Identity}:{reference}", reference, view.Identity, semantic.Kind,
+ semantic.Display, anchor, selected, evaluated, semantic.Provenance));
+ }
+ }
+ output.Add(page with { Annotations = annotations });
+ }
+
+ var evidence = new DrawingLayoutEvidenceIr(output.Sum(page => page.Annotations.Count), before, 0, 0,
+ laneOccupancy, rejected, failed);
+ return new(output, evidence, diagnostics);
+ }
+
+ private static IReadOnlyList<DrawingAnnotationCandidateIr> GenerateCandidates(
+ DrawingViewIr view, FirmamentDrawingCompiler.PmiPresentation pmi, DrawingPoint2 anchor)
+ {
+ var width = Math.Clamp(6 + pmi.Display.Length * 1.7, 18, 52);
+ const double height = 6;
+ var bounds = view.GeometryBounds;
+ var candidates = new List<DrawingAnnotationCandidateIr>();
+ var ordinal = 0;
+ void Add(string lane, int laneIndex, double x, double y)
+ {
+ var body = new DrawingRect(x, y, width, height);
+ var attach = new DrawingPoint2(Math.Clamp(anchor.X, body.X, body.Right), Math.Clamp(anchor.Y, body.Y, body.Bottom));
+ var length = Math.Sqrt(Math.Pow(anchor.X - attach.X, 2) + Math.Pow(anchor.Y - attach.Y, 2));
+ var edgePenalty = Math.Min(Math.Min(body.X - view.Viewport.X, view.Viewport.Right - body.Right),
+ Math.Min(body.Y - view.Viewport.Y, view.Viewport.Bottom - body.Bottom)) < 3 ? 20 : 0;
+ candidates.Add(new($"candidate:{ordinal++}:{lane}:{laneIndex}", body, [anchor, attach], lane, laneIndex,
+ length + laneIndex * 8 + edgePenalty + ordinal * 1e-5, []));
+ }
+
+ if (pmi.Kind is DrawingAnnotationKind.DiameterDimension or DrawingAnnotationKind.RadiusDimension or DrawingAnnotationKind.Datum or DrawingAnnotationKind.FeatureControlFrame)
+ {
+ Add("free-ne", 0, bounds.Right + 5, bounds.Y - 10);
+ Add("free-nw", 0, bounds.X - width - 5, bounds.Y - 10);
+ Add("free-se", 0, bounds.Right + 5, bounds.Bottom + 4);
+ Add("free-sw", 0, bounds.X - width - 5, bounds.Bottom + 4);
+ }
+ for (var lane = 1; lane <= 3; lane++)
+ {
+ Add("top", lane, bounds.X + (bounds.Width - width) / 2, bounds.Y - lane * 8);
+ Add("bottom", lane, bounds.X + (bounds.Width - width) / 2, bounds.Bottom + 2 + (lane - 1) * 8);
+ Add("left", lane, bounds.X - width - 3 - (lane - 1) * 8, bounds.Y + (bounds.Height - height) / 2);
+ Add("right", lane, bounds.Right + 3 + (lane - 1) * 8, bounds.Y + (bounds.Height - height) / 2);
+ }
+ return candidates.OrderBy(candidate => candidate.Cost).ThenBy(candidate => candidate.Identity, StringComparer.Ordinal).ToArray();
+ }
+
+ private static bool Contains(DrawingRect outer, DrawingRect inner) => inner.X >= outer.X && inner.Y >= outer.Y && inner.Right <= outer.Right && inner.Bottom <= outer.Bottom;
+
+ private static bool CollidesModel(DrawingRect body, DrawingViewIr view)
+ {
+ // Text uses a small safety margin; leaders may cross geometry as a penalized M0 fallback,
+ // but annotation bodies never may.
+ var expanded = new DrawingRect(body.X - 1, body.Y - 1, body.Width + 2, body.Height + 2);
+ foreach (var primitive in view.Primitives)
+ {
+ for (var i = 1; i < primitive.Points.Count; i++)
+ {
+ var a = primitive.Points[i - 1]; var b = primitive.Points[i];
+ var segmentBounds = new DrawingRect(Math.Min(a.X, b.X), Math.Min(a.Y, b.Y), Math.Max(0.15, Math.Abs(a.X - b.X)), Math.Max(0.15, Math.Abs(a.Y - b.Y)));
+ if (expanded.Intersects(segmentBounds)) return true;
+ }
+ }
+ return false;
+ }
+}
diff --git a/Aetheris.Kernel.Firmament/Drawing/DrawingIr.cs b/Aetheris.Kernel.Firmament/Drawing/DrawingIr.cs
new file mode 100644
index 00000000..28dd4d6f
--- /dev/null
+++ b/Aetheris.Kernel.Firmament/Drawing/DrawingIr.cs
@@ -0,0 +1,131 @@
+namespace Aetheris.Kernel.Firmament.Drawing;
+
+public enum DrawingPageOrientation { Portrait, Landscape }
+public enum DrawingProjectionKind { Orthographic, Isometric }
+public enum DrawingHiddenLinePolicy { VisibleOnly, VisibleAndHidden }
+public enum DrawingPrimitiveKind { Visible, Silhouette, Hidden }
+public enum DrawingAnnotationKind { LinearDimension, DiameterDimension, RadiusDimension, Datum, FeatureControlFrame, Note }
+
+public readonly record struct DrawingPoint2(double X, double Y);
+public readonly record struct DrawingRect(double X, double Y, double Width, double Height)
+{
+ public double Right => X + Width;
+ public double Bottom => Y + Height;
+ public bool Intersects(DrawingRect other) => X < other.Right && Right > other.X && Y < other.Bottom && Bottom > other.Y;
+}
+
+public sealed record DrawingMetadataIr(
+ string Title,
+ string ProductName,
+ string? PartNumber,
+ string? Revision,
+ string? Material,
+ string DrawingIdentity,
+ string TemplateIdentity);
+
+public sealed record DrawingProvenanceIr(
+ string SourceProductIdentity,
+ string? ConceptIdentity,
+ string TemplateIdentity,
+ IReadOnlyDictionary<string, string> TemplateArguments,
+ string SpecializationIdentity,
+ IReadOnlyList<string> StaticSources);
+
+public sealed record DrawingProjectedPrimitiveIr(
+ string StableId,
+ DrawingPrimitiveKind Kind,
+ IReadOnlyList<DrawingPoint2> Points,
+ string? OccurrenceIdentity,
+ double Depth);
+
+public sealed record DrawingViewIr(
+ string Identity,
+ DrawingProjectionKind Projection,
+ DrawingHiddenLinePolicy HiddenLinePolicy,
+ DrawingPoint2 Direction,
+ IReadOnlyList<double> Direction3,
+ DrawingRect Viewport,
+ DrawingRect GeometryBounds,
+ double Scale,
+ IReadOnlyList<DrawingProjectedPrimitiveIr> Primitives,
+ IReadOnlyDictionary<string, DrawingPoint2> SemanticAnchors,
+ IReadOnlyList<string> AssignedPmi);
+
+public sealed record DrawingAnnotationCandidateIr(
+ string Identity,
+ DrawingRect Body,
+ IReadOnlyList<DrawingPoint2> Leader,
+ string Lane,
+ int LaneIndex,
+ double Cost,
+ IReadOnlyList<string> Rejections);
+
+public sealed record DrawingAnnotationIr(
+ string Identity,
+ string SemanticReference,
+ string AssignedView,
+ DrawingAnnotationKind Kind,
+ string EngineeringDisplay,
+ DrawingPoint2 ProjectedAnchor,
+ DrawingAnnotationCandidateIr SelectedCandidate,
+ IReadOnlyList<DrawingAnnotationCandidateIr> Candidates,
+ string Provenance);
+
+public sealed record DrawingTableIr(
+ string Identity,
+ IReadOnlyList<string> Columns,
+ IReadOnlyList<IReadOnlyList<string>> Rows,
+ string SourceIdentity,
+ string Provenance);
+
+public sealed record DrawingPageIr(
+ int PageNumber,
+ DrawingPageOrientation Orientation,
+ double WidthMillimetres,
+ double HeightMillimetres,
+ DrawingRect ContentRect,
+ IReadOnlyList<DrawingViewIr> Views,
+ IReadOnlyList<DrawingAnnotationIr> Annotations,
+ IReadOnlyList<DrawingTableIr> Tables,
+ IReadOnlyList<string> Notes);
+
+public sealed record DrawingLayoutEvidenceIr(
+ int AnnotationCount,
+ int TextModelCollisionsBefore,
+ int TextModelCollisionsAfter,
+ int TextTextCollisionsAfter,
+ IReadOnlyDictionary<string, int> LaneOccupancy,
+ int RejectedCandidateCount,
+ int FailedAnnotationCount);
+
+public sealed record DrawingPerformanceIr(
+ double SourceCompileMilliseconds,
+ double ProjectionMilliseconds,
+ double LayoutMilliseconds,
+ double RenderMilliseconds,
+ double PdfMilliseconds);
+
+public sealed record DrawingIr(
+ string Identity,
+ DrawingMetadataIr Metadata,
+ DrawingProvenanceIr Provenance,
+ IReadOnlyList<DrawingPageIr> Pages,
+ DrawingLayoutEvidenceIr LayoutEvidence,
+ DrawingPerformanceIr Performance,
+ IReadOnlyList<string> Diagnostics,
+ string ProjectionPolicy,
+ string SchemaVersion = "aetheris-drawing-m0");
+
+public sealed record DrawingCompileArtifacts(
+ DrawingIr Drawing,
+ string DrawingIrPath,
+ string SvgPath,
+ string PdfPath,
+ string ValidationPath,
+ string PdfSha256,
+ string DrawingIrSha256);
+
+public sealed record DrawingCompileResult(
+ bool IsSuccess,
+ DrawingCompileArtifacts? Artifacts,
+ IReadOnlyList<string> Diagnostics);
diff --git a/Aetheris.Kernel.Firmament/Drawing/DrawingSvgRenderer.cs b/Aetheris.Kernel.Firmament/Drawing/DrawingSvgRenderer.cs
new file mode 100644
index 00000000..2a1243d6
--- /dev/null
+++ b/Aetheris.Kernel.Firmament/Drawing/DrawingSvgRenderer.cs
@@ -0,0 +1,89 @@
+using System.Globalization;
+using System.Security;
+using System.Text;
+
+namespace Aetheris.Kernel.Firmament.Drawing;
+
+public static class DrawingSvgRenderer
+{
+ public static string Render(DrawingIr drawing)
+ {
+ var width = drawing.Pages.Max(page => page.WidthMillimetres);
+ var height = drawing.Pages.Sum(page => page.HeightMillimetres + 8) - 8;
+ var builder = new StringBuilder();
+ builder.AppendLine($"<svg xmlns=\"http://www.w3.org/2000/svg\" width=\"{F(width)}mm\" height=\"{F(height)}mm\" viewBox=\"0 0 {F(width)} {F(height)}\" data-drawing-schema=\"{drawing.SchemaVersion}\">");
+ builder.AppendLine("<style>.sheet{fill:white;stroke:#aab2bd;stroke-width:.25}.visible,.silhouette{fill:none;stroke:#111827;stroke-width:.35;stroke-linecap:round;stroke-linejoin:round}.silhouette{stroke-width:.5}.hidden{fill:none;stroke:#64748b;stroke-width:.25;stroke-dasharray:2 1}.leader{fill:none;stroke:#374151;stroke-width:.22}.annotation{font:3.2px Arial,sans-serif;fill:#111827}.label{font:600 3.2px Arial,sans-serif;fill:#334155}.meta{font:2.8px Arial,sans-serif;fill:#334155}.table-header{font:600 3px Arial,sans-serif}.table-cell{font:2.8px Arial,sans-serif}</style>");
+ var offset = 0d;
+ foreach (var page in drawing.Pages)
+ {
+ builder.AppendLine($"<g transform=\"translate(0 {F(offset)})\" data-page=\"{page.PageNumber}\">");
+ builder.AppendLine($"<rect class=\"sheet\" x=\"0\" y=\"0\" width=\"{F(page.WidthMillimetres)}\" height=\"{F(page.HeightMillimetres)}\"/>");
+ builder.AppendLine($"<text class=\"label\" x=\"10\" y=\"9\">{E(drawing.Metadata.Title)}</text>");
+ builder.AppendLine($"<text class=\"meta\" x=\"{F(page.WidthMillimetres - 10)}\" y=\"9\" text-anchor=\"end\">{E(drawing.Metadata.ProductName)} · {E(drawing.Metadata.Revision ?? "-")} · {page.PageNumber}/{drawing.Pages.Count}</text>");
+ foreach (var view in page.Views) RenderView(builder, view);
+ foreach (var annotation in page.Annotations) RenderAnnotation(builder, annotation);
+ RenderTables(builder, page.Tables, page.ContentRect);
+ var noteY = page.HeightMillimetres - 15;
+ foreach (var note in page.Notes) { builder.AppendLine($"<text class=\"meta\" x=\"10\" y=\"{F(noteY)}\">{E(note)}</text>"); noteY += 4; }
+ builder.AppendLine($"<text class=\"meta\" x=\"10\" y=\"{F(page.HeightMillimetres - 5)}\">A4 {page.Orientation} · actual size · {E(drawing.Provenance.TemplateIdentity)} · {E(drawing.Provenance.SpecializationIdentity)}</text>");
+ builder.AppendLine("</g>");
+ offset += page.HeightMillimetres + 8;
+ }
+ builder.AppendLine("</svg>");
+ return builder.ToString();
+ }
+
+ private static void RenderView(StringBuilder builder, DrawingViewIr view)
+ {
+ builder.AppendLine($"<g data-view=\"{E(view.Identity)}\">");
+ builder.AppendLine($"<text class=\"label\" x=\"{F(view.Viewport.X)}\" y=\"{F(view.Viewport.Y + 3.5)}\">{E(view.Identity)} · scale ×{F(view.Scale)}</text>");
+ foreach (var primitive in view.Primitives)
+ {
+ var points = string.Join(" ", primitive.Points.Select(point => $"{F(point.X)},{F(point.Y)}"));
+ builder.AppendLine($"<polyline class=\"{primitive.Kind.ToString().ToLowerInvariant()}\" points=\"{points}\" data-semantic-id=\"{E(primitive.StableId)}\"/>");
+ }
+ builder.AppendLine("</g>");
+ }
+
+ private static void RenderAnnotation(StringBuilder builder, DrawingAnnotationIr annotation)
+ {
+ var leader = string.Join(" ", annotation.SelectedCandidate.Leader.Select(point => $"{F(point.X)},{F(point.Y)}"));
+ builder.AppendLine($"<g data-annotation=\"{E(annotation.Identity)}\" data-semantic-reference=\"{E(annotation.SemanticReference)}\">");
+ builder.AppendLine($"<polyline class=\"leader\" points=\"{leader}\"/>");
+ builder.AppendLine($"<rect x=\"{F(annotation.SelectedCandidate.Body.X)}\" y=\"{F(annotation.SelectedCandidate.Body.Y)}\" width=\"{F(annotation.SelectedCandidate.Body.Width)}\" height=\"{F(annotation.SelectedCandidate.Body.Height)}\" fill=\"white\" stroke=\"#374151\" stroke-width=\".18\"/>");
+ builder.AppendLine($"<text class=\"annotation\" x=\"{F(annotation.SelectedCandidate.Body.X + 1.2)}\" y=\"{F(annotation.SelectedCandidate.Body.Y + 4)}\">{E(annotation.EngineeringDisplay)}</text>");
+ builder.AppendLine("</g>");
+ }
+
+ private static void RenderTables(StringBuilder builder, IReadOnlyList<DrawingTableIr> tables, DrawingRect content)
+ {
+ var y = content.Y + 10;
+ foreach (var table in tables)
+ {
+ var cellWidth = content.Width / Math.Max(1, table.Columns.Count);
+ const double rowHeight = 7;
+ builder.AppendLine($"<text class=\"label\" x=\"{F(content.X)}\" y=\"{F(y - 3)}\">{E(table.Identity)}</text>");
+ for (var column = 0; column < table.Columns.Count; column++)
+ {
+ var x = content.X + column * cellWidth;
+ builder.AppendLine($"<rect x=\"{F(x)}\" y=\"{F(y)}\" width=\"{F(cellWidth)}\" height=\"{rowHeight}\" fill=\"#e2e8f0\" stroke=\"#64748b\" stroke-width=\".2\"/>");
+ builder.AppendLine($"<text class=\"table-header\" x=\"{F(x + 1)}\" y=\"{F(y + 4.5)}\">{E(table.Columns[column])}</text>");
+ }
+ y += rowHeight;
+ foreach (var row in table.Rows)
+ {
+ for (var column = 0; column < table.Columns.Count; column++)
+ {
+ var x = content.X + column * cellWidth;
+ builder.AppendLine($"<rect x=\"{F(x)}\" y=\"{F(y)}\" width=\"{F(cellWidth)}\" height=\"{rowHeight}\" fill=\"white\" stroke=\"#94a3b8\" stroke-width=\".18\"/>");
+ builder.AppendLine($"<text class=\"table-cell\" x=\"{F(x + 1)}\" y=\"{F(y + 4.5)}\">{E(row[column])}</text>");
+ }
+ y += rowHeight;
+ }
+ y += 10;
+ }
+ }
+
+ private static string F(double value) => value.ToString("0.###", CultureInfo.InvariantCulture);
+ private static string E(string value) => SecurityElement.Escape(value) ?? string.Empty;
+}
diff --git a/Aetheris.Kernel.Firmament/Drawing/DrawingVectorPdfWriter.cs b/Aetheris.Kernel.Firmament/Drawing/DrawingVectorPdfWriter.cs
new file mode 100644
index 00000000..1e92967a
--- /dev/null
+++ b/Aetheris.Kernel.Firmament/Drawing/DrawingVectorPdfWriter.cs
@@ -0,0 +1,126 @@
+using System.Globalization;
+using System.Text;
+
+namespace Aetheris.Kernel.Firmament.Drawing;
+
+/// <summary>Small deterministic PDF 1.4 vector backend: paths stay paths and text stays text.</summary>
+public static class DrawingVectorPdfWriter
+{
+ private const double PointsPerMillimetre = 72d / 25.4d;
+
+ public static void Write(DrawingIr drawing, string path)
+ {
+ var objects = new List<byte[]> { Array.Empty<byte>() };
+ int AddString(string value) { objects.Add(Encoding.ASCII.GetBytes(value)); return objects.Count - 1; }
+ int AddBytes(byte[] value) { objects.Add(value); return objects.Count - 1; }
+
+ var font = AddString("<< /Type /Font /Subtype /Type1 /BaseFont /Helvetica /Encoding /WinAnsiEncoding >>");
+ var fontBold = AddString("<< /Type /Font /Subtype /Type1 /BaseFont /Helvetica-Bold /Encoding /WinAnsiEncoding >>");
+ var pageObjects = new List<int>();
+ var contentObjects = new List<int>();
+ foreach (var page in drawing.Pages)
+ {
+ var stream = BuildPage(drawing, page);
+ contentObjects.Add(AddBytes(StreamObject(stream)));
+ pageObjects.Add(AddString("pending"));
+ }
+ var pagesObject = AddString("pending");
+ for (var i = 0; i < drawing.Pages.Count; i++)
+ {
+ var page = drawing.Pages[i];
+ var width = Pt(page.WidthMillimetres); var height = Pt(page.HeightMillimetres);
+ objects[pageObjects[i]] = Encoding.ASCII.GetBytes($"<< /Type /Page /Parent {pagesObject} 0 R /MediaBox [0 0 {F(width)} {F(height)}] /Resources << /Font << /F1 {font} 0 R /F2 {fontBold} 0 R >> >> /Contents {contentObjects[i]} 0 R >>");
+ }
+ objects[pagesObject] = Encoding.ASCII.GetBytes($"<< /Type /Pages /Count {pageObjects.Count} /Kids [{string.Join(" ", pageObjects.Select(value => $"{value} 0 R"))}] >>");
+ var catalog = AddString($"<< /Type /Catalog /Pages {pagesObject} 0 R >>");
+ var info = AddString($"<< /Title ({PdfText(drawing.Metadata.Title)}) /Subject ({PdfText(drawing.Metadata.ProductName)}) /Author (Aetheris) /Creator (Aetheris Drawing M0) /Producer (Aetheris vector PDF) /CreationDate (D:20260810000000-07'00') /ModDate (D:20260810000000-07'00') >>");
+
+ using var output = new MemoryStream();
+ Write(output, "%PDF-1.4\n%\xE2\xE3\xCF\xD3\n");
+ var offsets = new long[objects.Count];
+ for (var i = 1; i < objects.Count; i++)
+ {
+ offsets[i] = output.Position;
+ Write(output, $"{i} 0 obj\n"); output.Write(objects[i]); Write(output, "\nendobj\n");
+ }
+ var xref = output.Position;
+ Write(output, $"xref\n0 {objects.Count}\n0000000000 65535 f \n");
+ for (var i = 1; i < objects.Count; i++) Write(output, $"{offsets[i]:0000000000} 00000 n \n");
+ Write(output, $"trailer\n<< /Size {objects.Count} /Root {catalog} 0 R /Info {info} 0 R >>\nstartxref\n{xref}\n%%EOF\n");
+ File.WriteAllBytes(path, output.ToArray());
+ }
+
+ private static byte[] StreamObject(byte[] stream)
+ {
+ var header = Encoding.ASCII.GetBytes($"<< /Length {stream.Length} >>\nstream\n");
+ var footer = Encoding.ASCII.GetBytes("\nendstream");
+ return [.. header, .. stream, .. footer];
+ }
+
+ private static byte[] BuildPage(DrawingIr drawing, DrawingPageIr page)
+ {
+ var b = new StringBuilder();
+ double X(double mm) => Pt(mm);
+ double Y(double mm) => Pt(page.HeightMillimetres - mm);
+ void Line(DrawingPoint2 a, DrawingPoint2 c, double width = .25, bool dashed = false)
+ {
+ b.Append($"{F(width)} w {(dashed ? "[5 3] 0 d" : "[] 0 d")} {F(X(a.X))} {F(Y(a.Y))} m {F(X(c.X))} {F(Y(c.Y))} l S\n");
+ }
+ void Rect(DrawingRect rect, double width = .2, bool fill = false)
+ {
+ b.Append($"{F(width)} w {F(X(rect.X))} {F(Y(rect.Bottom))} {F(X(rect.Width))} {F(X(rect.Height))} re {(fill ? "B" : "S")}\n");
+ }
+ void Text(double x, double y, string text, double size = 8, bool bold = false)
+ {
+ b.Append($"BT /{(bold ? "F2" : "F1")} {F(size)} Tf {F(X(x))} {F(Y(y))} Td ({PdfText(text)}) Tj ET\n");
+ }
+
+ Text(10, 9, drawing.Metadata.Title, 10, true);
+ Text(page.WidthMillimetres - 85, 9, $"{drawing.Metadata.ProductName} | REV {drawing.Metadata.Revision ?? "-"} | {page.PageNumber}/{drawing.Pages.Count}", 7);
+ foreach (var view in page.Views)
+ {
+ Text(view.Viewport.X, view.Viewport.Y + 3.5, $"{view.Identity} SCALE x{view.Scale:0.###}", 7, true);
+ foreach (var primitive in view.Primitives)
+ for (var i = 1; i < primitive.Points.Count; i++) Line(primitive.Points[i - 1], primitive.Points[i], primitive.Kind == DrawingPrimitiveKind.Silhouette ? .55 : .35, primitive.Kind == DrawingPrimitiveKind.Hidden);
+ }
+ foreach (var annotation in page.Annotations)
+ {
+ for (var i = 1; i < annotation.SelectedCandidate.Leader.Count; i++) Line(annotation.SelectedCandidate.Leader[i - 1], annotation.SelectedCandidate.Leader[i], .25);
+ b.Append("1 1 1 rg "); Rect(annotation.SelectedCandidate.Body, .25, true); b.Append("0 0 0 rg\n");
+ Text(annotation.SelectedCandidate.Body.X + 1, annotation.SelectedCandidate.Body.Y + 4.2, annotation.EngineeringDisplay.Replace("Ø", "DIA ", StringComparison.Ordinal).Replace("±", "+/-", StringComparison.Ordinal), 7);
+ }
+ var tableY = page.ContentRect.Y + 10;
+ foreach (var table in page.Tables)
+ {
+ Text(page.ContentRect.X, tableY - 3, table.Identity, 9, true);
+ var cellWidth = page.ContentRect.Width / table.Columns.Count;
+ const double rowHeight = 7;
+ for (var column = 0; column < table.Columns.Count; column++)
+ {
+ var rect = new DrawingRect(page.ContentRect.X + column * cellWidth, tableY, cellWidth, rowHeight);
+ b.Append("0.88 0.91 0.95 rg "); Rect(rect, .2, true); b.Append("0 0 0 rg\n");
+ Text(rect.X + 1, rect.Y + 4.6, table.Columns[column], 7, true);
+ }
+ tableY += rowHeight;
+ foreach (var row in table.Rows)
+ {
+ for (var column = 0; column < table.Columns.Count; column++)
+ {
+ var rect = new DrawingRect(page.ContentRect.X + column * cellWidth, tableY, cellWidth, rowHeight);
+ Rect(rect); Text(rect.X + 1, rect.Y + 4.6, row[column], 7);
+ }
+ tableY += rowHeight;
+ }
+ tableY += 10;
+ }
+ var noteY = page.HeightMillimetres - 15;
+ foreach (var note in page.Notes) { Text(10, noteY, note, 7); noteY += 4; }
+ Text(10, page.HeightMillimetres - 5, $"A4 {page.Orientation} | ACTUAL SIZE | {drawing.Provenance.TemplateIdentity} | {drawing.Provenance.SpecializationIdentity}", 6);
+ return Encoding.ASCII.GetBytes(b.ToString());
+ }
+
+ private static double Pt(double millimetres) => millimetres * PointsPerMillimetre;
+ private static string F(double value) => value.ToString("0.###", CultureInfo.InvariantCulture);
+ private static string PdfText(string value) => string.Concat(value.Select(character => character is >= ' ' and <= '~' ? character : '?')).Replace("\\", "\\\\", StringComparison.Ordinal).Replace("(", "\\(", StringComparison.Ordinal).Replace(")", "\\)", StringComparison.Ordinal);
+ private static void Write(Stream stream, string value) => stream.Write(Encoding.Latin1.GetBytes(value));
+}
diff --git a/Aetheris.Kernel.Firmament/Drawing/FirmamentDrawingCompiler.cs b/Aetheris.Kernel.Firmament/Drawing/FirmamentDrawingCompiler.cs
new file mode 100644
index 00000000..2fe45265
--- /dev/null
+++ b/Aetheris.Kernel.Firmament/Drawing/FirmamentDrawingCompiler.cs
@@ -0,0 +1,433 @@
+using System.Diagnostics;
+using System.Globalization;
+using System.Security.Cryptography;
+using System.Text;
+using System.Text.Json;
+using System.Text.Json.Serialization;
+using System.Text.RegularExpressions;
+using Aetheris.Kernel.Core.Brep;
+using Aetheris.Kernel.Core.Geometry;
+using Aetheris.Kernel.Core.Math;
+using Aetheris.Kernel.Core.Step242;
+using Aetheris.Kernel.Firmament.FirmamentV2;
+
+namespace Aetheris.Kernel.Firmament.Drawing;
+
+/// <summary>
+/// Bounded M0 Drawing compiler. The source product is compiled through the ordinary
+/// Firmament exact-geometry route; Drawing declarations are erased only after they
+/// have been normalized to DrawingIR.
+/// </summary>
+public static class FirmamentDrawingCompiler
+{
+ public const string DrawingMissing = "drawing-missing-declaration";
+ public const string DrawingSourceUnknown = "drawing-source-product-unknown";
+ public const string DrawingViewMissing = "drawing-primary-view-required";
+ public const string DrawingPmiUnknown = "drawing-pmi-reference-unknown";
+ public const string DrawingConceptUnsatisfied = "drawing-concept-require-unsatisfied";
+ public const string DrawingLayoutImpossible = "drawing-layout-impossible";
+
+ private static readonly JsonSerializerOptions JsonOptions = new()
+ {
+ WriteIndented = true,
+ PropertyNamingPolicy = JsonNamingPolicy.CamelCase,
+ Converters = { new JsonStringEnumConverter() }
+ };
+
+ public static DrawingCompileResult Compile(string sourcePath, string outputDirectory)
+ {
+ var fullSourcePath = Path.GetFullPath(sourcePath);
+ var output = Path.GetFullPath(outputDirectory);
+ if (!File.Exists(fullSourcePath)) return Failure($"drawing-source-file-missing: {fullSourcePath}");
+ Directory.CreateDirectory(output);
+
+ var source = File.ReadAllText(fullSourcePath, Encoding.UTF8).Replace("\r\n", "\n", StringComparison.Ordinal);
+ var parse = ParseDrawingLanguage(source);
+ if (parse.Diagnostics.Count > 0 || parse.Drawing is null) return new(false, null, parse.Diagnostics);
+
+ var geometrySource = EraseDrawingDeclarations(source, parse.Ranges);
+ var sourceWatch = Stopwatch.StartNew();
+ var exact = FirmamentBuildAndExport.CompileSource(geometrySource, Path.GetDirectoryName(fullSourcePath));
+ sourceWatch.Stop();
+ if (!exact.IsSuccess)
+ return new(false, null, exact.Diagnostics.Select(diagnostic => $"{diagnostic.Source}: {diagnostic.Message}").ToArray());
+
+ var imported = Step242Importer.ImportBody(exact.Value.StepText);
+ if (!imported.IsSuccess)
+ return new(false, null, imported.Diagnostics.Select(diagnostic => $"{diagnostic.Source}: {diagnostic.Message}").ToArray());
+
+ var semanticParse = FirmamentV2Parser.Parse(geometrySource, Path.GetDirectoryName(fullSourcePath));
+ if (!semanticParse.IsSuccess || semanticParse.Document is null)
+ return new(false, null, semanticParse.Diagnostics);
+
+ if (!string.Equals(parse.Drawing.Source, semanticParse.Document.ModelName, StringComparison.Ordinal))
+ return Failure($"{DrawingSourceUnknown}: '{parse.Drawing.Source}' does not name authoritative Model '{semanticParse.Document.ModelName}'.");
+
+ var pmi = NormalizePmi(semanticParse.Document);
+ var unknownPmi = parse.Drawing.Views.SelectMany(view => view.Pmi).Distinct(StringComparer.Ordinal)
+ .Where(reference => !pmi.ContainsKey(reference)).Order(StringComparer.Ordinal).ToArray();
+ if (unknownPmi.Length > 0) return Failure($"{DrawingPmiUnknown}: {string.Join(", ", unknownPmi)}");
+
+ var conceptFailures = ValidateConcept(parse.Drawing, parse.Concept);
+ if (conceptFailures.Count > 0) return new(false, null, conceptFailures);
+
+ var projectionWatch = Stopwatch.StartNew();
+ var pages = ProjectAndAllocate(imported.Value, parse.Drawing, semanticParse.Document, pmi);
+ projectionWatch.Stop();
+
+ var layoutWatch = Stopwatch.StartNew();
+ var layout = DrawingAnnotationLayout.Layout(pages, pmi);
+ layoutWatch.Stop();
+ if (layout.Diagnostics.Count > 0) return new(false, null, layout.Diagnostics);
+
+ var specialization = StableHash($"{parse.Drawing.Template}|{parse.Drawing.Source}|{parse.Drawing.Name}")[..16];
+ var staticSources = layout.Pages.SelectMany(page => page.Tables).Select(table => table.SourceIdentity).Distinct(StringComparer.Ordinal).Order(StringComparer.Ordinal).ToArray();
+ var metadata = new DrawingMetadataIr(parse.Drawing.Title ?? parse.Drawing.Name, parse.Drawing.Source,
+ parse.Drawing.PartNumber, parse.Drawing.Revision, parse.Drawing.Material, parse.Drawing.Name, parse.Drawing.Template);
+ var provenance = new DrawingProvenanceIr(parse.Drawing.Source, parse.Concept?.Name, parse.Drawing.Template,
+ new Dictionary<string, string>(StringComparer.Ordinal) { ["Product"] = parse.Drawing.Source }, specialization, staticSources);
+
+ var preliminary = new DrawingIr(parse.Drawing.Name, metadata, provenance, layout.Pages, layout.Evidence,
+ new(sourceWatch.Elapsed.TotalMilliseconds, projectionWatch.Elapsed.TotalMilliseconds, layoutWatch.Elapsed.TotalMilliseconds, 0, 0),
+ [], "Structured BRep edge projection; coincident projected edges are merged. M0 does not claim exact face-occlusion HLR.");
+
+ var stem = Sanitize(parse.Drawing.Name);
+ var irPath = Path.Combine(output, $"{stem}.drawing.json");
+ var svgPath = Path.Combine(output, $"{stem}.svg");
+ var pdfPath = Path.Combine(output, $"{stem}.pdf");
+ var validationPath = Path.Combine(output, $"{stem}.validation.json");
+
+ var renderWatch = Stopwatch.StartNew();
+ var svg = DrawingSvgRenderer.Render(preliminary);
+ File.WriteAllText(svgPath, svg, new UTF8Encoding(false));
+ renderWatch.Stop();
+ var pdfWatch = Stopwatch.StartNew();
+ DrawingVectorPdfWriter.Write(preliminary, pdfPath);
+ pdfWatch.Stop();
+
+ var measuredPerformance = preliminary.Performance with { RenderMilliseconds = renderWatch.Elapsed.TotalMilliseconds, PdfMilliseconds = pdfWatch.Elapsed.TotalMilliseconds };
+ // Timings are evidence, not drawing semantics. Keep them out of deterministic IR/PDF hashes.
+ var drawing = preliminary with { Performance = new(0, 0, 0, 0, 0) };
+ var json = JsonSerializer.Serialize(drawing, JsonOptions);
+ File.WriteAllText(irPath, json, new UTF8Encoding(false));
+ var irHash = HashBytes(Encoding.UTF8.GetBytes(json));
+ var pdfHash = HashBytes(File.ReadAllBytes(pdfPath));
+ var validation = new
+ {
+ success = true,
+ schema = drawing.SchemaVersion,
+ authoritativeSource = drawing.Provenance.SourceProductIdentity,
+ pageCount = drawing.Pages.Count,
+ a4Only = drawing.Pages.All(page => (page.WidthMillimetres == 210 && page.HeightMillimetres == 297) || (page.WidthMillimetres == 297 && page.HeightMillimetres == 210)),
+ vectorPdf = true,
+ rasterImages = 0,
+ drawing.LayoutEvidence.TextModelCollisionsAfter,
+ drawing.LayoutEvidence.TextTextCollisionsAfter,
+ drawing.LayoutEvidence.FailedAnnotationCount,
+ drawingIrSha256 = irHash,
+ pdfSha256 = pdfHash,
+ measuredPerformance
+ };
+ File.WriteAllText(validationPath, JsonSerializer.Serialize(validation, JsonOptions), new UTF8Encoding(false));
+ return new(true, new(drawing, irPath, svgPath, pdfPath, validationPath, pdfHash, irHash), []);
+ }
+
+ private static IReadOnlyList<string> ValidateConcept(ParsedDrawing drawing, ParsedConcept? concept)
+ {
+ if (concept is null || !string.Equals(drawing.Concept, concept.Name, StringComparison.Ordinal)) return [];
+ var failures = new List<string>();
+ foreach (var requirement in concept.Requirements)
+ {
+ var satisfied = requirement switch
+ {
+ "PrimaryView" => drawing.Views.Any(view => view.Projection == DrawingProjectionKind.Orthographic),
+ "ManufacturingPmi" => drawing.Views.Any(view => view.Pmi.Count > 0),
+ "Material" => !string.IsNullOrWhiteSpace(drawing.Material),
+ "DesignTable" => !string.IsNullOrWhiteSpace(drawing.Table),
+ "RevisionMetadata" => !string.IsNullOrWhiteSpace(drawing.Revision),
+ _ => false
+ };
+ if (!satisfied) failures.Add($"{DrawingConceptUnsatisfied}: {concept.Name}.{requirement}");
+ }
+ return failures;
+ }
+
+ private static Dictionary<string, PmiPresentation> NormalizePmi(FirmamentV2Document document)
+ {
+ var result = new Dictionary<string, PmiPresentation>(StringComparer.Ordinal);
+ foreach (var record in document.BoundPmi?.Datums ?? [])
+ result[record.Name] = new(record.Name, DrawingAnnotationKind.Datum, record.Name, null, record.Targets.FirstOrDefault() ?? record.Name, "Firmament Semantic PMI");
+ foreach (var record in document.BoundPmi?.Dimensions ?? [])
+ {
+ var nominal = record.DimensionValue?.NumericValue;
+ var tolerance = record.DimensionTolerance;
+ var value = nominal.HasValue ? FormatEngineeringValue(nominal.Value, record.DimensionValue!.Unit, tolerance) : record.Name;
+ result[record.Name] = new(record.Name,
+ record.Kind == FirmamentV2PmiKind.HoleDiameter ? DrawingAnnotationKind.DiameterDimension : DrawingAnnotationKind.LinearDimension,
+ record.Kind == FirmamentV2PmiKind.HoleDiameter ? $"Ø{value}" : value,
+ nominal, record.Targets.FirstOrDefault() ?? record.Name, record.ProjectionSource ?? "Firmament Semantic PMI");
+ }
+ foreach (var record in document.BoundPmi?.Controls ?? [])
+ {
+ var tolerance = record.ControlTolerance?.NumericValue?.ToString("0.###", CultureInfo.InvariantCulture) ?? "";
+ result[record.Name] = new(record.Name, DrawingAnnotationKind.FeatureControlFrame,
+ $"{record.Kind.ToString().ToUpperInvariant()} | {tolerance} | {string.Join(" | ", record.DatumRefs)}", null,
+ record.Targets.FirstOrDefault() ?? record.Name, "Firmament Semantic PMI");
+ }
+ return result;
+ }
+
+ private static string FormatEngineeringValue(double nominal, string? unit, FirmamentV2Tolerance? tolerance)
+ {
+ var value = $"{nominal:0.###} {unit ?? "mm"}";
+ if (tolerance is null) return value;
+ return Math.Abs(tolerance.Plus - tolerance.Minus) < 1e-12
+ ? $"{value} ±{tolerance.Plus:0.###}"
+ : $"{value} +{tolerance.Plus:0.###}/-{tolerance.Minus:0.###}";
+ }
+
+ private static IReadOnlyList<DrawingPageIr> ProjectAndAllocate(BrepBody body, ParsedDrawing drawing, FirmamentV2Document semanticDocument, IReadOnlyDictionary<string, PmiPresentation> pmi)
+ {
+ var landscape = drawing.Orientation == DrawingPageOrientation.Landscape;
+ var width = landscape ? 297d : 210d;
+ var height = landscape ? 210d : 297d;
+ var content = new DrawingRect(10, 16, width - 20, height - 36);
+ var viewAreaHeight = content.Height - 25;
+ var columns = drawing.Views.Count <= 2 ? drawing.Views.Count : 2;
+ var rows = (int)Math.Ceiling(drawing.Views.Count / (double)Math.Max(1, columns));
+ var gap = 8d;
+ var cellWidth = (content.Width - gap * Math.Max(0, columns - 1)) / Math.Max(1, columns);
+ var cellHeight = (viewAreaHeight - gap * Math.Max(0, rows - 1)) / Math.Max(1, rows);
+ var views = new List<DrawingViewIr>();
+ for (var index = 0; index < drawing.Views.Count; index++)
+ {
+ var column = index % columns;
+ var row = index / columns;
+ var viewport = new DrawingRect(content.X + column * (cellWidth + gap), content.Y + row * (cellHeight + gap), cellWidth, cellHeight);
+ views.Add(ProjectView(body, drawing.Views[index], viewport));
+ }
+
+ var tables = NormalizeTables(drawing, semanticDocument);
+ var page1 = new DrawingPageIr(1, drawing.Orientation, width, height, content, views, [], [], drawing.Notes);
+ if (tables.Count == 0) return [page1];
+ // M0 deliberately flows tables to another readable A4 page instead of shrinking views.
+ var tablePage = new DrawingPageIr(2, drawing.Orientation, width, height, content, [], [], tables, []);
+ return [page1, tablePage];
+ }
+
+ private static IReadOnlyList<DrawingTableIr> NormalizeTables(ParsedDrawing drawing, FirmamentV2Document document)
+ {
+ if (string.IsNullOrWhiteSpace(drawing.Table)) return [];
+ var table = document.StaticAuthoring?.Tables?.FirstOrDefault(candidate => string.Equals(candidate.Name, drawing.Table, StringComparison.Ordinal));
+ if (table is null) return [];
+ var columns = table.Columns.Keys.Order(StringComparer.Ordinal).ToArray();
+ var rows = Enumerable.Range(0, table.RowCount)
+ .Select(row => (IReadOnlyList<string>)columns.Select(column => table.Columns[column][row]).ToArray()).ToArray();
+ return [new(table.Name, columns, rows, table.Name, "Firmament Static Table; shared compile-time source")];
+ }
+
+ private static DrawingViewIr ProjectView(BrepBody body, ParsedView view, DrawingRect viewport)
+ {
+ var direction = Normalize(new Vector3D(view.Direction[0], view.Direction[1], view.Direction[2]));
+ var upCandidate = Math.Abs(direction.Z) > 0.9 ? new Vector3D(0, 1, 0) : new Vector3D(0, 0, 1);
+ var right = Normalize(upCandidate.Cross(direction));
+ var up = Normalize(direction.Cross(right));
+ DrawingPoint2 Project(Point3D point) => new(point.X * right.X + point.Y * right.Y + point.Z * right.Z,
+ point.X * up.X + point.Y * up.Y + point.Z * up.Z);
+ double Depth(Point3D point) => point.X * direction.X + point.Y * direction.Y + point.Z * direction.Z;
+
+ var raw = new List<(string Id, IReadOnlyList<DrawingPoint2> Points, double Depth)>();
+ foreach (var edge in body.Topology.Edges.OrderBy(edge => edge.Id.Value))
+ {
+ if (IsCoplanarInternalEdge(body, edge.Id)) continue;
+ if (!body.TryGetVertexPoint(edge.StartVertexId, out var start) || !body.TryGetVertexPoint(edge.EndVertexId, out var end)) continue;
+ IReadOnlyList<Point3D> points;
+ if (body.TryGetEdgeCurveGeometry(edge.Id, out var curve) && curve?.Kind == CurveGeometryKind.Circle3 && curve.Circle3 is { } circle)
+ points = Enumerable.Range(0, 49).Select(i => circle.Evaluate(i * Math.Tau / 48d)).ToArray();
+ else if (body.TryGetEdgeCurveGeometry(edge.Id, out curve) && curve?.Kind == CurveGeometryKind.Ellipse3 && curve.Ellipse3 is { } ellipse)
+ points = Enumerable.Range(0, 49).Select(i => ellipse.Evaluate(i * Math.Tau / 48d)).ToArray();
+ else points = [start, end];
+ raw.Add(($"edge:{edge.Id.Value}", points.Select(Project).ToArray(), points.Average(Depth)));
+ }
+ if (raw.Count == 0) throw new InvalidOperationException("drawing-projection-no-exact-edges");
+ var all = raw.SelectMany(item => item.Points).ToArray();
+ var minX = all.Min(point => point.X); var maxX = all.Max(point => point.X);
+ var minY = all.Min(point => point.Y); var maxY = all.Max(point => point.Y);
+ var modelWidth = Math.Max(1e-9, maxX - minX); var modelHeight = Math.Max(1e-9, maxY - minY);
+ var scale = Math.Min((viewport.Width - 24) / modelWidth, (viewport.Height - 24) / modelHeight);
+ var originX = viewport.X + (viewport.Width - modelWidth * scale) / 2 - minX * scale;
+ var originY = viewport.Y + (viewport.Height - modelHeight * scale) / 2 + maxY * scale;
+ DrawingPoint2 Page(DrawingPoint2 point) => new(originX + point.X * scale, originY - point.Y * scale);
+ var dedupe = new HashSet<string>(StringComparer.Ordinal);
+ var projected = new List<DrawingProjectedPrimitiveIr>();
+ foreach (var item in raw.OrderByDescending(item => item.Depth).ThenBy(item => item.Id, StringComparer.Ordinal))
+ {
+ var points = item.Points.Select(Page).ToArray();
+ var key = CanonicalPolyline(points);
+ if (!dedupe.Add(key)) continue;
+ var kind = item.Points.Count > 2 ? DrawingPrimitiveKind.Silhouette : DrawingPrimitiveKind.Visible;
+ projected.Add(new(item.Id, kind, points, null, item.Depth));
+ }
+ var geometryBounds = new DrawingRect(originX + minX * scale, originY - maxY * scale, modelWidth * scale, modelHeight * scale);
+ var anchors = new Dictionary<string, DrawingPoint2>(StringComparer.Ordinal);
+ var center = new DrawingPoint2(geometryBounds.X + geometryBounds.Width / 2, geometryBounds.Y + geometryBounds.Height / 2);
+ foreach (var reference in view.Pmi) anchors[reference] = center;
+ return new(view.Name, view.Projection, view.HiddenLines, new(direction.X, direction.Y), view.Direction, viewport, geometryBounds, scale, projected, anchors, view.Pmi);
+ }
+
+ private static bool IsCoplanarInternalEdge(BrepBody body, Aetheris.Kernel.Core.Topology.EdgeId edgeId)
+ {
+ var loopIds = body.Topology.Coedges.Where(coedge => coedge.EdgeId == edgeId).Select(coedge => coedge.LoopId).ToHashSet();
+ var faces = body.Topology.Faces.Where(face => face.LoopIds.Any(loopIds.Contains)).ToArray();
+ if (faces.Length != 2) return false;
+ if (!body.TryGetFaceSurfaceGeometry(faces[0].Id, out var first) || !body.TryGetFaceSurfaceGeometry(faces[1].Id, out var second)
+ || first?.Plane is not { } a || second?.Plane is not { } b) return false;
+ var na = a.Normal.ToVector(); var nb = b.Normal.ToVector();
+ var parallel = Math.Abs(Math.Abs(na.Dot(nb)) - 1d) < 1e-8;
+ var separation = Math.Abs((b.Origin - a.Origin).Dot(na));
+ return parallel && separation < 1e-7;
+ }
+
+ private static string CanonicalPolyline(IReadOnlyList<DrawingPoint2> points)
+ {
+ string Key(IEnumerable<DrawingPoint2> value) => string.Join(";", value.Select(point => $"{Math.Round(point.X, 5)},{Math.Round(point.Y, 5)}"));
+ var forward = Key(points); var reverse = Key(points.Reverse());
+ return string.CompareOrdinal(forward, reverse) <= 0 ? forward : reverse;
+ }
+
+ private static Vector3D Normalize(Vector3D vector)
+ {
+ var length = Math.Sqrt(vector.Dot(vector));
+ if (length < 1e-12) throw new InvalidOperationException("drawing-view-direction-zero");
+ return vector * (1d / length);
+ }
+
+ private static ParseResult ParseDrawingLanguage(string source)
+ {
+ var diagnostics = new List<string>();
+ var ranges = new List<(int Start, int Length)>();
+ ParsedConcept? concept = null;
+ var conceptMatch = Regex.Match(source, @"\bConcept\s+Drawing\s+(?<name>[A-Za-z_]\w*)\s*\{", RegexOptions.CultureInvariant);
+ if (conceptMatch.Success)
+ {
+ var block = ReadBlock(source, conceptMatch.Index + conceptMatch.Length - 1);
+ if (block is null) diagnostics.Add("drawing-concept-malformed");
+ else
+ {
+ concept = new(conceptMatch.Groups["name"].Value,
+ Regex.Matches(block.Value.Body, @"\bRequire\s+(?<name>[A-Za-z_]\w*)\s*;?", RegexOptions.CultureInvariant)
+ .Select(match => match.Groups["name"].Value).ToArray());
+ ranges.Add((conceptMatch.Index, block.Value.End - conceptMatch.Index + 1));
+ }
+ }
+
+ ParsedTemplate? template = null;
+ var templateMatch = Regex.Match(source, @"\bTemplate\s*<\s*(?<parameter>[A-Za-z_]\w*)\s*:\s*Product\s*>\s*Drawing\s+(?<name>[A-Za-z_]\w*)\s*(?::\s*(?<concept>[A-Za-z_]\w*))?\s*\{", RegexOptions.CultureInvariant);
+ if (templateMatch.Success)
+ {
+ var block = ReadBlock(source, templateMatch.Index + templateMatch.Length - 1);
+ if (block is null) diagnostics.Add("drawing-template-malformed");
+ else
+ {
+ template = new(templateMatch.Groups["name"].Value, templateMatch.Groups["parameter"].Value,
+ templateMatch.Groups["concept"].Value, block.Value.Body);
+ ranges.Add((templateMatch.Index, block.Value.End - templateMatch.Index + 1));
+ }
+ }
+
+ ParsedDrawing? drawing = null;
+ var application = Regex.Match(source, @"\bDrawing\s+(?<name>[A-Za-z_]\w*)\s*=\s*(?<template>[A-Za-z_]\w*)\s*<\s*Product\s*:\s*(?<product>[A-Za-z_]\w*)\s*>\s*;?", RegexOptions.CultureInvariant);
+ if (application.Success && template is not null)
+ {
+ if (!string.Equals(application.Groups["template"].Value, template.Name, StringComparison.Ordinal)) diagnostics.Add("drawing-template-unknown");
+ else drawing = ParseDrawingBody(application.Groups["name"].Value, template.Name, template.Concept, application.Groups["product"].Value,
+ template.Body.Replace(template.Parameter, application.Groups["product"].Value, StringComparison.Ordinal), diagnostics);
+ ranges.Add((application.Index, application.Length));
+ }
+ else
+ {
+ var literal = Regex.Match(source, @"\bDrawing\s+(?<name>[A-Za-z_]\w*)\s*(?::\s*(?<concept>[A-Za-z_]\w*))?\s*\{", RegexOptions.CultureInvariant);
+ if (literal.Success)
+ {
+ var block = ReadBlock(source, literal.Index + literal.Length - 1);
+ if (block is not null)
+ {
+ drawing = ParseDrawingBody(literal.Groups["name"].Value, "Literal", literal.Groups["concept"].Value, null, block.Value.Body, diagnostics);
+ ranges.Add((literal.Index, block.Value.End - literal.Index + 1));
+ }
+ }
+ }
+ if (drawing is null && diagnostics.Count == 0) diagnostics.Add(DrawingMissing);
+ return new(drawing, concept, ranges, diagnostics);
+ }
+
+ private static ParsedDrawing ParseDrawingBody(string name, string template, string concept, string? applicationProduct, string body, List<string> diagnostics)
+ {
+ string? Field(string field) => Regex.Match(body, $@"\b{Regex.Escape(field)}\s*:\s*(?<value>[^;\n}}]+)", RegexOptions.CultureInvariant) is { Success: true } match ? TrimValue(match.Groups["value"].Value) : null;
+ var source = applicationProduct ?? Field("Source");
+ if (string.IsNullOrWhiteSpace(source)) diagnostics.Add("drawing-source-required");
+ var orientation = string.Equals(Field("Orientation"), "Portrait", StringComparison.Ordinal) ? DrawingPageOrientation.Portrait : DrawingPageOrientation.Landscape;
+ var views = new List<ParsedView>();
+ foreach (Match match in Regex.Matches(body, @"\bView\s+(?<name>[A-Za-z_]\w*)\s*\{", RegexOptions.CultureInvariant))
+ {
+ var block = ReadBlock(body, match.Index + match.Length - 1);
+ if (block is null) continue;
+ var directionMatch = Regex.Match(block.Value.Body, @"\bDirection\s*:\s*(?<direction>\[[^\]]+\]|[+-][XYZ])", RegexOptions.CultureInvariant);
+ if (!directionMatch.Success) { diagnostics.Add($"drawing-view-direction-required: {match.Groups["name"].Value}"); continue; }
+ var direction = ParseDirection(directionMatch.Groups["direction"].Value);
+ var projection = string.Equals(Regex.Match(block.Value.Body, @"\bProjection\s*:\s*(?<value>\w+)").Groups["value"].Value, "Isometric", StringComparison.Ordinal)
+ || direction.Count(value => Math.Abs(value) > 1e-12) > 1 ? DrawingProjectionKind.Isometric : DrawingProjectionKind.Orthographic;
+ var hidden = string.Equals(Regex.Match(block.Value.Body, @"\bHiddenLines\s*:\s*(?<value>\w+)").Groups["value"].Value, "VisibleAndHidden", StringComparison.Ordinal)
+ ? DrawingHiddenLinePolicy.VisibleAndHidden : DrawingHiddenLinePolicy.VisibleOnly;
+ var pmiMatch = Regex.Match(block.Value.Body, @"\bPMI\s*:\s*\[(?<items>[^\]]*)\]", RegexOptions.CultureInvariant | RegexOptions.IgnoreCase);
+ var assigned = pmiMatch.Success ? pmiMatch.Groups["items"].Value.Split(',', StringSplitOptions.RemoveEmptyEntries | StringSplitOptions.TrimEntries) : [];
+ views.Add(new(match.Groups["name"].Value, direction, projection, hidden, assigned));
+ }
+ if (views.Count == 0) diagnostics.Add(DrawingViewMissing);
+ var notesMatch = Regex.Match(body, @"\bNotes\s*:\s*\[(?<items>[^\]]*)\]", RegexOptions.CultureInvariant);
+ var notes = notesMatch.Success ? Regex.Matches(notesMatch.Groups["items"].Value, "\"(?<text>[^\"]*)\"").Select(match => match.Groups["text"].Value).ToArray() : [];
+ return new(name, template, concept, source ?? "", orientation, views, Field("Title"), Field("PartNumber"), Field("Revision"), Field("Material"), Field("Table"), notes);
+ }
+
+ private static IReadOnlyList<double> ParseDirection(string source) => source.Trim() switch
+ {
+ "+X" => [1, 0, 0], "-X" => [-1, 0, 0], "+Y" => [0, 1, 0], "-Y" => [0, -1, 0], "+Z" => [0, 0, 1], "-Z" => [0, 0, -1],
+ _ => source.Trim().Trim('[', ']').Split(',', StringSplitOptions.TrimEntries).Select(value => double.Parse(value, CultureInfo.InvariantCulture)).ToArray()
+ };
+
+ private static (string Body, int End)? ReadBlock(string source, int open)
+ {
+ if (open < 0 || open >= source.Length || source[open] != '{') return null;
+ var depth = 0; var quoted = false;
+ for (var i = open; i < source.Length; i++)
+ {
+ if (source[i] == '"' && (i == 0 || source[i - 1] != '\\')) quoted = !quoted;
+ if (quoted) continue;
+ if (source[i] == '{') depth++;
+ else if (source[i] == '}' && --depth == 0) return (source[(open + 1)..i], i);
+ }
+ return null;
+ }
+
+ private static string EraseDrawingDeclarations(string source, IReadOnlyList<(int Start, int Length)> ranges)
+ {
+ var chars = source.ToCharArray();
+ foreach (var range in ranges)
+ for (var i = range.Start; i < range.Start + range.Length; i++) if (chars[i] != '\n') chars[i] = ' ';
+ return new string(chars);
+ }
+
+ private static string TrimValue(string value) => value.Trim().Trim('"');
+ private static string StableHash(string value) => HashBytes(Encoding.UTF8.GetBytes(value));
+ private static string HashBytes(byte[] bytes) => Convert.ToHexString(SHA256.HashData(bytes)).ToLowerInvariant();
+ private static string Sanitize(string value) => Regex.Replace(value, "[^A-Za-z0-9._-]", "-");
+ private static DrawingCompileResult Failure(string diagnostic) => new(false, null, [diagnostic]);
+
+ private sealed record ParsedConcept(string Name, IReadOnlyList<string> Requirements);
+ private sealed record ParsedTemplate(string Name, string Parameter, string Concept, string Body);
+ private sealed record ParsedView(string Name, IReadOnlyList<double> Direction, DrawingProjectionKind Projection, DrawingHiddenLinePolicy HiddenLines, IReadOnlyList<string> Pmi);
+ private sealed record ParsedDrawing(string Name, string Template, string Concept, string Source, DrawingPageOrientation Orientation,
+ IReadOnlyList<ParsedView> Views, string? Title, string? PartNumber, string? Revision, string? Material, string? Table, IReadOnlyList<string> Notes);
+ private sealed record ParseResult(ParsedDrawing? Drawing, ParsedConcept? Concept, IReadOnlyList<(int Start, int Length)> Ranges, IReadOnlyList<string> Diagnostics);
+ internal sealed record PmiPresentation(string Identity, DrawingAnnotationKind Kind, string Display, double? Nominal, string Target, string Provenance);
+}
diff --git a/aetheris.client/src/__tests__/DrawingDocument.test.tsx b/aetheris.client/src/__tests__/DrawingDocument.test.tsx
new file mode 100644
index 00000000..dded0208
--- /dev/null
+++ b/aetheris.client/src/__tests__/DrawingDocument.test.tsx
@@ -0,0 +1,56 @@
+import { render, screen } from "@testing-library/react";
+import { describe, expect, it } from "vitest";
+import { DrawingDocument } from "../drawing/DrawingDocument";
+import type { DrawingIr } from "../drawing/drawingIr";
+import { drawingPageLayoutRows } from "../drawing/drawingLayout";
+
+const fixture: DrawingIr = {
+ schemaVersion: "aetheris-drawing-m0",
+ identity: "TestDrawing",
+ metadata: {
+ title: "Test drawing",
+ productName: "Block",
+ drawingIdentity: "TestDrawing",
+ templateIdentity: "StandardDrawing",
+ },
+ pages: [
+ {
+ pageNumber: 1,
+ orientation: "Landscape",
+ widthMillimetres: 297,
+ heightMillimetres: 210,
+ views: [],
+ annotations: [],
+ notes: [],
+ tables: [
+ {
+ identity: "Sizes",
+ sourceIdentity: "Sizes",
+ columns: ["Size", "Width"],
+ rows: [["A", "20mm"]],
+ },
+ ],
+ },
+ ],
+};
+
+describe("DrawingDocument", () => {
+ it("uses MachinaLayout regions and renders design data as a real React table", () => {
+ render(<DrawingDocument drawing={fixture} />);
+ expect(drawingPageLayoutRows.map((row) => row.id)).toEqual([
+ "drawing-page",
+ "drawing-header",
+ "drawing-content",
+ "drawing-footer",
+ ]);
+ expect(screen.getByRole("table", { name: "Sizes" })).toBeTruthy();
+ expect(screen.getByRole("cell", { name: "20mm" })).toBeTruthy();
+ });
+
+ it("preserves physical A4 dimensions in the document element", () => {
+ const { container } = render(<DrawingDocument drawing={fixture} />);
+ const article = container.querySelector("article");
+ expect(article?.getAttribute("style")).toContain("width: 297mm");
+ expect(article?.getAttribute("style")).toContain("height: 210mm");
+ });
+});
diff --git a/aetheris.client/src/drawing/DrawingDocument.tsx b/aetheris.client/src/drawing/DrawingDocument.tsx
new file mode 100644
index 00000000..1a0a17fd
--- /dev/null
+++ b/aetheris.client/src/drawing/DrawingDocument.tsx
@@ -0,0 +1,131 @@
+import type { DrawingAnnotationIr, DrawingIr, DrawingPageIr } from "./drawingIr";
+import { drawingPageLayoutRows } from "./drawingLayout";
+import "./drawingDocument.css";
+
+export function DrawingDocument({ drawing }: { drawing: DrawingIr }) {
+ return (
+ <main className="drawing-document" data-schema={drawing.schemaVersion}>
+ {drawing.pages.map((page) => (
+ <DrawingPage key={page.pageNumber} drawing={drawing} page={page} />
+ ))}
+ </main>
+ );
+}
+
+function DrawingPage({ drawing, page }: { drawing: DrawingIr; page: DrawingPageIr }) {
+ return (
+ <article
+ className="drawing-page"
+ data-orientation={page.orientation}
+ data-machina-layout-rows={drawingPageLayoutRows.length}
+ style={{ width: `${page.widthMillimetres}mm`, height: `${page.heightMillimetres}mm` }}
+ >
+ <header className="drawing-header">
+ <h1>{drawing.metadata.title}</h1>
+ <dl>
+ <div>
+ <dt>Product</dt>
+ <dd>{drawing.metadata.productName}</dd>
+ </div>
+ <div>
+ <dt>Part</dt>
+ <dd>{drawing.metadata.partNumber ?? "-"}</dd>
+ </div>
+ <div>
+ <dt>Rev</dt>
+ <dd>{drawing.metadata.revision ?? "-"}</dd>
+ </div>
+ <div>
+ <dt>Material</dt>
+ <dd>{drawing.metadata.material ?? "-"}</dd>
+ </div>
+ </dl>
+ </header>
+ <section className="drawing-content">
+ {page.views.length > 0 && (
+ <svg
+ viewBox={`0 0 ${page.widthMillimetres} ${page.heightMillimetres}`}
+ aria-label="Projected engineering views"
+ >
+ {page.views.map((view) => (
+ <g key={view.identity} data-view={view.identity}>
+ <text x={view.viewport.x} y={view.viewport.y + 3.5}>
+ {view.identity}
+ </text>
+ {view.primitives.map((primitive) => (
+ <polyline
+ key={primitive.stableId}
+ className={primitive.kind.toLowerCase()}
+ points={primitive.points.map((p) => `${p.x},${p.y}`).join(" ")}
+ />
+ ))}
+ </g>
+ ))}
+ {page.annotations.map((annotation) => (
+ <DrawingAnnotation key={annotation.identity} annotation={annotation} />
+ ))}
+ </svg>
+ )}
+ {page.tables.map((table) => (
+ <table key={table.identity} data-source-identity={table.sourceIdentity}>
+ <caption>{table.identity}</caption>
+ <thead>
+ <tr>
+ {table.columns.map((column) => (
+ <th key={column} scope="col">
+ {column}
+ </th>
+ ))}
+ </tr>
+ </thead>
+ <tbody>
+ {table.rows.map((row, rowIndex) => (
+ <tr key={rowIndex}>
+ {row.map((cell, index) => (
+ <td key={table.columns[index]}>{cell}</td>
+ ))}
+ </tr>
+ ))}
+ </tbody>
+ </table>
+ ))}
+ {page.notes.length > 0 && (
+ <aside>
+ <h2>Notes</h2>
+ <ol>
+ {page.notes.map((note) => (
+ <li key={note}>{note}</li>
+ ))}
+ </ol>
+ </aside>
+ )}
+ </section>
+ <footer className="drawing-footer">
+ A4 {page.orientation} · {drawing.metadata.templateIdentity} · Page {page.pageNumber}/
+ {drawing.pages.length}
+ </footer>
+ </article>
+ );
+}
+
+function DrawingAnnotation({ annotation }: { annotation: DrawingAnnotationIr }) {
+ const body = annotation.selectedCandidate.body;
+ return (
+ <g data-semantic-reference={annotation.semanticReference}>
+ <polyline
+ className="leader"
+ points={annotation.selectedCandidate.leader.map((p) => `${p.x},${p.y}`).join(" ")}
+ />
+ <rect
+ className="annotation-body"
+ x={body.x}
+ y={body.y}
+ width={body.width}
+ height={body.height}
+ />
+ <text x={body.x + 1} y={body.y + 4}>
+ {annotation.engineeringDisplay}
+ </text>
+ </g>
+ );
+}
diff --git a/aetheris.client/src/drawing/drawingDocument.css b/aetheris.client/src/drawing/drawingDocument.css
new file mode 100644
index 00000000..6d0cbfbf
--- /dev/null
+++ b/aetheris.client/src/drawing/drawingDocument.css
@@ -0,0 +1,116 @@
+.drawing-document {
+ display: grid;
+ gap: 12mm;
+ justify-content: center;
+ background: #dbe2ea;
+ padding: 12mm;
+}
+.drawing-page {
+ box-sizing: border-box;
+ display: grid;
+ grid-template-rows: 12mm 1fr 8mm;
+ gap: 3mm;
+ padding: 10mm;
+ overflow: hidden;
+ background: white;
+ color: #111827;
+ font:
+ 3mm / 1.25 Arial,
+ sans-serif;
+ box-shadow: 0 1mm 4mm #33415555;
+}
+.drawing-header {
+ display: flex;
+ align-items: start;
+ justify-content: space-between;
+ border-bottom: 0.25mm solid #475569;
+}
+.drawing-header h1 {
+ margin: 0;
+ font-size: 4mm;
+}
+.drawing-header dl {
+ display: flex;
+ gap: 4mm;
+ margin: 0;
+}
+.drawing-header dl div {
+ display: grid;
+ grid-template-columns: auto auto;
+ gap: 1mm;
+}
+.drawing-header dt {
+ font-weight: 700;
+}
+.drawing-header dd {
+ margin: 0;
+}
+.drawing-content {
+ position: relative;
+ min-height: 0;
+}
+.drawing-content svg {
+ position: absolute;
+ inset: 0;
+ width: 100%;
+ height: 100%;
+}
+.drawing-content svg polyline {
+ fill: none;
+ stroke: #111827;
+ stroke-width: 0.35;
+}
+.drawing-content svg .silhouette {
+ stroke-width: 0.5;
+}
+.drawing-content svg .hidden {
+ stroke-dasharray: 2 1;
+}
+.drawing-content svg .annotation-body {
+ fill: white;
+ stroke: #334155;
+ stroke-width: 0.18;
+}
+.drawing-content svg text {
+ font-size: 3.2px;
+}
+.drawing-content table {
+ width: 100%;
+ border-collapse: collapse;
+ margin-block: 5mm;
+ font-size: 3mm;
+}
+.drawing-content caption {
+ text-align: left;
+ font-size: 4mm;
+ font-weight: 700;
+ margin-bottom: 2mm;
+}
+.drawing-content th,
+.drawing-content td {
+ border: 0.2mm solid #64748b;
+ padding: 1.5mm 2mm;
+ text-align: left;
+}
+.drawing-content th {
+ background: #e2e8f0;
+}
+.drawing-content aside {
+ margin-top: auto;
+}
+.drawing-footer {
+ border-top: 0.2mm solid #64748b;
+ padding-top: 2mm;
+ font-size: 2.5mm;
+}
+@media print {
+ .drawing-document {
+ display: block;
+ padding: 0;
+ background: none;
+ }
+ .drawing-page {
+ break-after: page;
+ box-shadow: none;
+ }
+}
diff --git a/aetheris.client/src/drawing/drawingIr.ts b/aetheris.client/src/drawing/drawingIr.ts
new file mode 100644
index 00000000..058ae579
--- /dev/null
+++ b/aetheris.client/src/drawing/drawingIr.ts
@@ -0,0 +1,52 @@
+export type DrawingPoint2 = { x: number; y: number };
+export type DrawingRect = { x: number; y: number; width: number; height: number };
+
+export type DrawingIr = {
+ schemaVersion: "aetheris-drawing-m0";
+ identity: string;
+ metadata: {
+ title: string;
+ productName: string;
+ partNumber?: string;
+ revision?: string;
+ material?: string;
+ drawingIdentity: string;
+ templateIdentity: string;
+ };
+ pages: DrawingPageIr[];
+};
+
+export type DrawingPageIr = {
+ pageNumber: number;
+ orientation: "Portrait" | "Landscape";
+ widthMillimetres: 210 | 297;
+ heightMillimetres: 210 | 297;
+ views: DrawingViewIr[];
+ annotations: DrawingAnnotationIr[];
+ tables: DrawingTableIr[];
+ notes: string[];
+};
+
+export type DrawingViewIr = {
+ identity: string;
+ viewport: DrawingRect;
+ primitives: {
+ stableId: string;
+ kind: "Visible" | "Silhouette" | "Hidden";
+ points: DrawingPoint2[];
+ }[];
+};
+
+export type DrawingAnnotationIr = {
+ identity: string;
+ semanticReference: string;
+ engineeringDisplay: string;
+ selectedCandidate: { body: DrawingRect; leader: DrawingPoint2[] };
+};
+
+export type DrawingTableIr = {
+ identity: string;
+ columns: string[];
+ rows: string[][];
+ sourceIdentity: string;
+};
diff --git a/aetheris.client/src/drawing/drawingLayout.ts b/aetheris.client/src/drawing/drawingLayout.ts
new file mode 100644
index 00000000..72a3c0e4
--- /dev/null
+++ b/aetheris.client/src/drawing/drawingLayout.ts
@@ -0,0 +1,11 @@
+import { M } from "machinalayout/machina";
+
+// MachinaLayout owns the coarse A4 document regions. React owns semantic
+// document structure and SVG owns only projected engineering graphics.
+export const drawingPageLayoutRows = M.rows(
+ M.vstack("drawing-page", { gap: 3, padding: 10 }, [
+ M.fixed("drawing-header", 12, { view: "DrawingHeader" }),
+ M.fill("drawing-content", 1, { view: "DrawingContent" }),
+ M.fixed("drawing-footer", 8, { view: "DrawingFooter" }),
+ ]),
+);
diff --git a/docs/drawing/architecture.md b/docs/drawing/architecture.md
new file mode 100644
index 00000000..2eb4a864
--- /dev/null
+++ b/docs/drawing/architecture.md
@@ -0,0 +1,28 @@
+# Drawing architecture
+
+> **The 3D semantic model is the product definition. A Drawing is a printable projection of that definition, not a parallel source of engineering truth.**
+
+Drawing M0 is a bounded compiler lane over Firmament V2. `Concept Drawing`, `Template ... Drawing`, and `Drawing` specialization declarations are normalized and erased before the remaining module travels through the ordinary exact `FirmamentBuildAndExport` route. The resulting AP242 is reimported as BRep, so the drawing projector consumes the same exact body used by STEP rather than an independently authored outline.
+
+```text
+Firmament module
+ ├─ Drawing language normalization -> concept/template/source/provenance
+ └─ ordinary product compilation -> exact BRep + semantic PMI + Static Tables
+ │
+ v
+DrawingIR -> projected edge polylines -> bounded PMI candidates -> A4 pages
+ -> React/MachinaLayout preview + SVG
+ -> deterministic vector PDF
+```
+
+`DrawingIr`, `DrawingPageIr`, `DrawingViewIr`, and `DrawingAnnotationIr` are backend-independent records in `Aetheris.Kernel.Firmament/Drawing/DrawingIr.cs`. React state is not authoritative. Every annotation retains a semantic reference and display value copied at compile time from bound Firmament PMI; there is no drawing-owned editable dimension.
+
+M0 supports literal drawings and ordinary Drawing-returning Templates through the same declaration syntax. The bounded parser is structured like the existing Analysis and Assembly compilers because the central parser remains deliberately split. It accepts one Drawing specialization per compile.
+
+## Projection boundary
+
+Projection evaluates exact BRep vertices and analytic circle/ellipse curves, selects a stable view basis, and emits structured 2D polylines. Coincident projections and coplanar internal seams are removed. M0 does **not** implement exact face-occlusion hidden-line removal. `VisibleOnly` therefore means clean boundary/feature edge projection, not a full drafting HLR proof. Three.js is not used by the authoritative path; it remains available for future interactive preview only.
+
+## Prior-art audit
+
+Machina Canvas demonstrated useful A4 constants, millimetre SVG sizing, explicit render/export boundaries, and semantic sidecar inspection. Drawing M0 reuses those ideas. It intentionally does not reuse the Canvas scene/document coupling, mutable tool state, raster export path, hand-built title-block geometry, or large mechanical-annotation sidecar architecture. Aetheris uses typed compiler IR, React document elements, and a narrow vector backend instead.
diff --git a/docs/drawing/artifacts/m0/BearingBlockProduction-page-1.png b/docs/drawing/artifacts/m0/BearingBlockProduction-page-1.png
new file mode 100644
index 00000000..b7f1b2be
Binary files /dev/null and b/docs/drawing/artifacts/m0/BearingBlockProduction-page-1.png differ
diff --git a/docs/drawing/artifacts/m0/BearingBlockProduction.drawing.json b/docs/drawing/artifacts/m0/BearingBlockProduction.drawing.json
new file mode 100644
index 00000000..5fd90ef6
--- /dev/null
+++ b/docs/drawing/artifacts/m0/BearingBlockProduction.drawing.json
@@ -0,0 +1,2091 @@
+{
+ "identity": "BearingBlockProduction",
+ "metadata": {
+ "title": "Bearing block production drawing",
+ "productName": "BearingBlock",
+ "partNumber": "BB-080",
+ "revision": "A",
+ "material": "6061-T6 aluminium",
+ "drawingIdentity": "BearingBlockProduction",
+ "templateIdentity": "StandardMachinedDrawing"
+ },
+ "provenance": {
+ "sourceProductIdentity": "BearingBlock",
+ "conceptIdentity": "MachinedPartDrawing",
+ "templateIdentity": "StandardMachinedDrawing",
+ "templateArguments": {
+ "Product": "BearingBlock"
+ },
+ "specializationIdentity": "2a731a10cc7aa3dd",
+ "staticSources": [
+ "BearingStandards"
+ ]
+ },
+ "pages": [
+ {
+ "pageNumber": 1,
+ "orientation": "Landscape",
+ "widthMillimetres": 297,
+ "heightMillimetres": 210,
+ "contentRect": {
+ "x": 10,
+ "y": 16,
+ "width": 277,
+ "height": 174,
+ "right": 287,
+ "bottom": 190
+ },
+ "views": [
+ {
+ "identity": "Front",
+ "projection": "Orthographic",
+ "hiddenLinePolicy": "VisibleOnly",
+ "direction": {
+ "x": 0,
+ "y": 0
+ },
+ "direction3": [
+ 0,
+ 0,
+ 1
+ ],
+ "viewport": {
+ "x": 10,
+ "y": 16,
+ "width": 134.5,
+ "height": 149,
+ "right": 144.5,
+ "bottom": 165
+ },
+ "geometryBounds": {
+ "x": 22,
+ "y": 55.96875,
+ "width": 110.5,
+ "height": 69.0625,
+ "right": 132.5,
+ "bottom": 125.03125
+ },
+ "scale": 1.38125,
+ "primitives": [
+ {
+ "stableId": "edge:10",
+ "kind": "Silhouette",
+ "points": [
+ {
+ "x": 82.775,
+ "y": 90.5
+ },
+ {
+ "x": 82.72773285909031,
+ "y": 89.77884278798422
+ },
+ {
+ "x": 82.5867401902471,
+ "y": 89.07002477580858
+ },
+ {
+ "x": 82.35443441712486,
+ "y": 88.38567403618288
+ },
+ {
+ "x": 82.03479035590902,
+ "y": 87.7375
+ },
+ {
+ "x": 81.63327720510907,
+ "y": 87.13659310472681
+ },
+ {
+ "x": 81.15676496605568,
+ "y": 86.59323503394432
+ },
+ {
+ "x": 80.61340689527319,
+ "y": 86.11672279489093
+ },
+ {
+ "x": 80.0125,
+ "y": 85.71520964409098
+ },
+ {
+ "x": 79.36432596381712,
+ "y": 85.39556558287514
+ },
+ {
+ "x": 78.67997522419142,
+ "y": 85.1632598097529
+ },
+ {
+ "x": 77.97115721201578,
+ "y": 85.02226714090969
+ },
+ {
+ "x": 77.25,
+ "y": 84.975
+ },
+ {
+ "x": 76.52884278798422,
+ "y": 85.02226714090969
+ },
+ {
+ "x": 75.82002477580858,
+ "y": 85.1632598097529
+ },
+ {
+ "x": 75.13567403618288,
+ "y": 85.39556558287514
+ },
+ {
+ "x": 74.4875,
+ "y": 85.71520964409098
+ },
+ {
+ "x": 73.88659310472681,
+ "y": 86.11672279489093
+ },
+ {
+ "x": 73.34323503394432,
+ "y": 86.59323503394432
+ },
+ {
+ "x": 72.86672279489093,
+ "y": 87.13659310472681
+ },
+ {
+ "x": 72.46520964409098,
+ "y": 87.7375
+ },
+ {
+ "x": 72.14556558287514,
+ "y": 88.38567403618288
+ },
+ {
+ "x": 71.9132598097529,
+ "y": 89.07002477580858
+ },
+ {
+ "x": 71.77226714090969,
+ "y": 89.77884278798422
+ },
+ {
+ "x": 71.725,
+ "y": 90.5
+ },
+ {
+ "x": 71.77226714090969,
+ "y": 91.22115721201578
+ },
+ {
+ "x": 71.9132598097529,
+ "y": 91.92997522419142
+ },
+ {
+ "x": 72.14556558287514,
+ "y": 92.61432596381712
+ },
+ {
+ "x": 72.46520964409098,
+ "y": 93.2625
+ },
+ {
+ "x": 72.86672279489093,
+ "y": 93.86340689527319
+ },
+ {
+ "x": 73.34323503394432,
+ "y": 94.40676496605568
+ },
+ {
+ "x": 73.88659310472681,
+ "y": 94.88327720510907
+ },
+ {
+ "x": 74.4875,
+ "y": 95.28479035590902
+ },
+ {
+ "x": 75.13567403618288,
+ "y": 95.60443441712486
+ },
+ {
+ "x": 75.82002477580858,
+ "y": 95.8367401902471
+ },
+ {
+ "x": 76.52884278798422,
+ "y": 95.97773285909031
+ },
+ {
+ "x": 77.25,
+ "y": 96.025
+ },
+ {
+ "x": 77.97115721201578,
+ "y": 95.97773285909031
+ },
+ {
+ "x": 78.67997522419142,
+ "y": 95.8367401902471
+ },
+ {
+ "x": 79.36432596381712,
+ "y": 95.60443441712486
+ },
+ {
+ "x": 80.0125,
+ "y": 95.28479035590902
+ },
+ {
+ "x": 80.61340689527317,
+ "y": 94.88327720510908
+ },
+ {
+ "x": 81.15676496605568,
+ "y": 94.40676496605568
+ },
+ {
+ "x": 81.63327720510907,
+ "y": 93.86340689527319
+ },
+ {
+ "x": 82.03479035590902,
+ "y": 93.2625
+ },
+ {
+ "x": 82.35443441712486,
+ "y": 92.61432596381712
+ },
+ {
+ "x": 82.5867401902471,
+ "y": 91.92997522419144
+ },
+ {
+ "x": 82.72773285909031,
+ "y": 91.22115721201578
+ },
+ {
+ "x": 82.775,
+ "y": 90.5
+ }
+ ],
+ "occurrenceIdentity": null,
+ "depth": 6
+ },
+ {
+ "stableId": "edge:6",
+ "kind": "Visible",
+ "points": [
+ {
+ "x": 22,
+ "y": 125.03125
+ },
+ {
+ "x": 132.5,
+ "y": 125.03125
+ }
+ ],
+ "occurrenceIdentity": null,
+ "depth": 6
+ },
+ {
+ "stableId": "edge:7",
+ "kind": "Visible",
+ "points": [
+ {
+ "x": 132.5,
+ "y": 125.03125
+ },
+ {
+ "x": 132.5,
+ "y": 55.96875
+ }
+ ],
+ "occurrenceIdentity": null,
+ "depth": 6
+ },
+ {
+ "stableId": "edge:8",
+ "kind": "Visible",
+ "points": [
+ {
+ "x": 132.5,
+ "y": 55.96875
+ },
+ {
+ "x": 22,
+ "y": 55.96875
+ }
+ ],
+ "occurrenceIdentity": null,
+ "depth": 6
+ },
+ {
+ "stableId": "edge:9",
+ "kind": "Visible",
+ "points": [
+ {
+ "x": 22,
+ "y": 55.96875
+ },
+ {
+ "x": 22,
+ "y": 125.03125
+ }
+ ],
+ "occurrenceIdentity": null,
+ "depth": 6
+ },
+ {
+ "stableId": "edge:11",
+ "kind": "Visible",
+ "points": [
+ {
+ "x": 132.5,
+ "y": 125.03125
+ },
+ {
+ "x": 132.5,
+ "y": 125.03125
+ }
+ ],
+ "occurrenceIdentity": null,
+ "depth": 0
+ },
+ {
+ "stableId": "edge:12",
+ "kind": "Visible",
+ "points": [
+ {
+ "x": 22,
+ "y": 125.03125
+ },
+ {
+ "x": 22,
+ "y": 125.03125
+ }
+ ],
+ "occurrenceIdentity": null,
+ "depth": 0
+ },
+ {
+ "stableId": "edge:13",
+ "kind": "Visible",
+ "points": [
+ {
+ "x": 132.5,
+ "y": 55.96875
+ },
+ {
+ "x": 132.5,
+ "y": 55.96875
+ }
+ ],
+ "occurrenceIdentity": null,
+ "depth": 0
+ },
+ {
+ "stableId": "edge:14",
+ "kind": "Visible",
+ "points": [
+ {
+ "x": 22,
+ "y": 55.96875
+ },
+ {
+ "x": 22,
+ "y": 55.96875
+ }
+ ],
+ "occurrenceIdentity": null,
+ "depth": 0
+ },
+ {
+ "stableId": "edge:15",
+ "kind": "Visible",
+ "points": [
+ {
+ "x": 82.775,
+ "y": 90.5
+ },
+ {
+ "x": 82.775,
+ "y": 90.5
+ }
+ ],
+ "occurrenceIdentity": null,
+ "depth": 0
+ }
+ ],
+ "semanticAnchors": {
+ "MountDiameter": {
+ "x": 77.25,
+ "y": 90.5
+ },
+ "A": {
+ "x": 77.25,
+ "y": 90.5
+ }
+ },
+ "assignedPmi": [
+ "MountDiameter",
+ "A"
+ ]
+ },
+ {
+ "identity": "Iso",
+ "projection": "Isometric",
+ "hiddenLinePolicy": "VisibleOnly",
+ "direction": {
+ "x": 0.5773502691896258,
+ "y": 0.5773502691896258
+ },
+ "direction3": [
+ 1,
+ 1,
+ 1
+ ],
+ "viewport": {
+ "x": 152.5,
+ "y": 16,
+ "width": 134.5,
+ "height": 149,
+ "right": 287,
+ "bottom": 165
+ },
+ "geometryBounds": {
+ "x": 164.5,
+ "y": 52.71242488153899,
+ "width": 110.49999999999999,
+ "height": 75.57515023692201,
+ "right": 275,
+ "bottom": 128.287575118461
+ },
+ "scale": 1.2020815280171306,
+ "primitives": [
+ {
+ "stableId": "edge:13",
+ "kind": "Visible",
+ "points": [
+ {
+ "x": 207,
+ "y": 128.287575118461
+ },
+ {
+ "x": 207,
+ "y": 116.50962962699265
+ }
+ ],
+ "occurrenceIdentity": null,
+ "depth": 37.52776749732568
+ },
+ {
+ "stableId": "edge:7",
+ "kind": "Visible",
+ "points": [
+ {
+ "x": 164.5,
+ "y": 91.97224318643354
+ },
+ {
+ "x": 207,
+ "y": 116.50962962699265
+ }
+ ],
+ "occurrenceIdentity": null,
+ "depth": 26.55811238272279
+ },
+ {
+ "stableId": "edge:2",
+ "kind": "Visible",
+ "points": [
+ {
+ "x": 164.5,
+ "y": 103.7501886779019
+ },
+ {
+ "x": 207,
+ "y": 128.287575118461
+ }
+ ],
+ "occurrenceIdentity": null,
+ "depth": 19.629909152447276
+ },
+ {
+ "stableId": "edge:8",
+ "kind": "Visible",
+ "points": [
+ {
+ "x": 207,
+ "y": 116.50962962699265
+ },
+ {
+ "x": 275,
+ "y": 77.2498113220981
+ }
+ ],
+ "occurrenceIdentity": null,
+ "depth": 17.8978583448784
+ },
+ {
+ "stableId": "edge:3",
+ "kind": "Visible",
+ "points": [
+ {
+ "x": 207,
+ "y": 128.287575118461
+ },
+ {
+ "x": 275,
+ "y": 89.02775681356646
+ }
+ ],
+ "occurrenceIdentity": null,
+ "depth": 10.969655114602888
+ },
+ {
+ "stableId": "edge:11",
+ "kind": "Visible",
+ "points": [
+ {
+ "x": 164.5,
+ "y": 103.7501886779019
+ },
+ {
+ "x": 164.5,
+ "y": 91.97224318643354
+ }
+ ],
+ "occurrenceIdentity": null,
+ "depth": 8.660254037844387
+ },
+ {
+ "stableId": "edge:10",
+ "kind": "Silhouette",
+ "points": [
+ {
+ "x": 216.35,
+ "y": 86.57401816951055
+ },
+ {
+ "x": 216.82287652487722,
+ "y": 86.81344623963813
+ },
+ {
+ "x": 217.34583694396574,
+ "y": 87.01519031030008
+ },
+ {
+ "x": 217.90993325950294,
+ "y": 87.17579848451336
+ },
+ {
+ "x": 218.5055136271329,
+ "y": 87.29252271188818
+ },
+ {
+ "x": 219.12238750163945,
+ "y": 87.3633658085321
+ },
+ {
+ "x": 219.75,
+ "y": 87.38711562942008
+ },
+ {
+ "x": 220.37761249836055,
+ "y": 87.3633658085321
+ },
+ {
+ "x": 220.9944863728671,
+ "y": 87.29252271188818
+ },
+ {
+ "x": 221.59006674049706,
+ "y": 87.17579848451336
+ },
+ {
+ "x": 222.15416305603426,
+ "y": 87.01519031030008
+ },
+ {
+ "x": 222.67712347512278,
+ "y": 86.81344623963813
+ },
+ {
+ "x": 223.15,
+ "y": 86.57401816951055
+ },
+ {
+ "x": 223.56470158221913,
+ "y": 86.30100278057922
+ },
+ {
+ "x": 223.9141325627314,
+ "y": 85.99907144184296
+ },
+ {
+ "x": 224.19231408057968,
+ "y": 85.67339028221868
+ },
+ {
+ "x": 224.39448637286708,
+ "y": 85.32953179664345
+ },
+ {
+ "x": 224.51719021561985,
+ "y": 84.97337949914106
+ },
+ {
+ "x": 224.55832611206853,
+ "y": 84.61102725426582
+ },
+ {
+ "x": 224.51719021561985,
+ "y": 84.24867500939058
+ },
+ {
+ "x": 224.39448637286708,
+ "y": 83.89252271188818
+ },
+ {
+ "x": 224.19231408057968,
+ "y": 83.54866422631295
+ },
+ {
+ "x": 223.9141325627314,
+ "y": 83.22298306668868
+ },
+ {
+ "x": 223.56470158221913,
+ "y": 82.9210517279524
+ },
+ {
+ "x": 223.15,
+ "y": 82.64803633902109
+ },
+ {
+ "x": 222.67712347512278,
+ "y": 82.40860826889352
+ },
+ {
+ "x": 222.15416305603426,
+ "y": 82.20686419823156
+ },
+ {
+ "x": 221.59006674049706,
+ "y": 82.04625602401828
+ },
+ {
+ "x": 220.9944863728671,
+ "y": 81.92953179664346
+ },
+ {
+ "x": 220.37761249836055,
+ "y": 81.85868869999955
+ },
+ {
+ "x": 219.75,
+ "y": 81.83493887911155
+ },
+ {
+ "x": 219.12238750163945,
+ "y": 81.85868869999955
+ },
+ {
+ "x": 218.5055136271329,
+ "y": 81.92953179664346
+ },
+ {
+ "x": 217.90993325950294,
+ "y": 82.04625602401828
+ },
+ {
+ "x": 217.34583694396574,
+ "y": 82.20686419823156
+ },
+ {
+ "x": 216.82287652487722,
+ "y": 82.40860826889352
+ },
+ {
+ "x": 216.35,
+ "y": 82.64803633902109
+ },
+ {
+ "x": 215.93529841778087,
+ "y": 82.9210517279524
+ },
+ {
+ "x": 215.5858674372686,
+ "y": 83.22298306668868
+ },
+ {
+ "x": 215.30768591942032,
+ "y": 83.54866422631295
+ },
+ {
+ "x": 215.10551362713292,
+ "y": 83.89252271188818
+ },
+ {
+ "x": 214.98280978438015,
+ "y": 84.24867500939058
+ },
+ {
+ "x": 214.94167388793147,
+ "y": 84.61102725426582
+ },
+ {
+ "x": 214.98280978438015,
+ "y": 84.97337949914106
+ },
+ {
+ "x": 215.10551362713292,
+ "y": 85.32953179664345
+ },
+ {
+ "x": 215.30768591942032,
+ "y": 85.67339028221868
+ },
+ {
+ "x": 215.5858674372686,
+ "y": 85.99907144184294
+ },
+ {
+ "x": 215.93529841778087,
+ "y": 86.30100278057922
+ },
+ {
+ "x": 216.35,
+ "y": 86.57401816951054
+ }
+ ],
+ "occurrenceIdentity": null,
+ "depth": 3.511232249357316
+ },
+ {
+ "stableId": "edge:15",
+ "kind": "Visible",
+ "points": [
+ {
+ "x": 216.35,
+ "y": 86.57401816951055
+ },
+ {
+ "x": 216.35,
+ "y": 98.35196366097891
+ }
+ ],
+ "occurrenceIdentity": null,
+ "depth": 2.309401076758503
+ },
+ {
+ "stableId": "edge:5",
+ "kind": "Silhouette",
+ "points": [
+ {
+ "x": 216.35,
+ "y": 98.35196366097891
+ },
+ {
+ "x": 216.82287652487722,
+ "y": 98.59139173110648
+ },
+ {
+ "x": 217.34583694396574,
+ "y": 98.79313580176844
+ },
+ {
+ "x": 217.90993325950294,
+ "y": 98.95374397598172
+ },
+ {
+ "x": 218.5055136271329,
+ "y": 99.07046820335654
+ },
+ {
+ "x": 219.12238750163945,
+ "y": 99.14131130000045
+ },
+ {
+ "x": 219.75,
+ "y": 99.16506112088845
+ },
+ {
+ "x": 220.37761249836055,
+ "y": 99.14131130000045
+ },
+ {
+ "x": 220.9944863728671,
+ "y": 99.07046820335654
+ },
+ {
+ "x": 221.59006674049706,
+ "y": 98.95374397598172
+ },
+ {
+ "x": 222.15416305603426,
+ "y": 98.79313580176844
+ },
+ {
+ "x": 222.67712347512278,
+ "y": 98.59139173110648
+ },
+ {
+ "x": 223.15,
+ "y": 98.35196366097891
+ },
+ {
+ "x": 223.56470158221913,
+ "y": 98.0789482720476
+ },
+ {
+ "x": 223.9141325627314,
+ "y": 97.77701693331132
+ },
+ {
+ "x": 224.19231408057968,
+ "y": 97.45133577368705
+ },
+ {
+ "x": 224.39448637286708,
+ "y": 97.10747728811182
+ },
+ {
+ "x": 224.51719021561985,
+ "y": 96.75132499060942
+ },
+ {
+ "x": 224.55832611206853,
+ "y": 96.38897274573418
+ },
+ {
+ "x": 224.51719021561985,
+ "y": 96.02662050085894
+ },
+ {
+ "x": 224.39448637286708,
+ "y": 95.67046820335655
+ },
+ {
+ "x": 224.19231408057968,
+ "y": 95.32660971778132
+ },
+ {
+ "x": 223.9141325627314,
+ "y": 95.00092855815704
+ },
+ {
+ "x": 223.56470158221913,
+ "y": 94.69899721942078
+ },
+ {
+ "x": 223.15,
+ "y": 94.42598183048946
+ },
+ {
+ "x": 222.67712347512278,
+ "y": 94.18655376036187
+ },
+ {
+ "x": 222.15416305603426,
+ "y": 93.98480968969992
+ },
+ {
+ "x": 221.59006674049706,
+ "y": 93.82420151548664
+ },
+ {
+ "x": 220.9944863728671,
+ "y": 93.70747728811182
+ },
+ {
+ "x": 220.37761249836055,
+ "y": 93.6366341914679
+ },
+ {
+ "x": 219.75,
+ "y": 93.61288437057992
+ },
+ {
+ "x": 219.12238750163945,
+ "y": 93.6366341914679
+ },
+ {
+ "x": 218.5055136271329,
+ "y": 93.70747728811182
+ },
+ {
+ "x": 217.90993325950294,
+ "y": 93.82420151548664
+ },
+ {
+ "x": 217.34583694396574,
+ "y": 93.98480968969992
+ },
+ {
+ "x": 216.82287652487722,
+ "y": 94.18655376036187
+ },
+ {
+ "x": 216.35,
+ "y": 94.42598183048945
+ },
+ {
+ "x": 215.93529841778087,
+ "y": 94.69899721942078
+ },
+ {
+ "x": 215.5858674372686,
+ "y": 95.00092855815704
+ },
+ {
+ "x": 215.30768591942032,
+ "y": 95.32660971778132
+ },
+ {
+ "x": 215.10551362713292,
+ "y": 95.67046820335655
+ },
+ {
+ "x": 214.98280978438015,
+ "y": 96.02662050085894
+ },
+ {
+ "x": 214.94167388793147,
+ "y": 96.38897274573418
+ },
+ {
+ "x": 214.98280978438015,
+ "y": 96.75132499060942
+ },
+ {
+ "x": 215.10551362713292,
+ "y": 97.10747728811182
+ },
+ {
+ "x": 215.30768591942032,
+ "y": 97.45133577368705
+ },
+ {
+ "x": 215.5858674372686,
+ "y": 97.77701693331132
+ },
+ {
+ "x": 215.93529841778087,
+ "y": 98.0789482720476
+ },
+ {
+ "x": 216.35,
+ "y": 98.35196366097891
+ }
+ ],
+ "occurrenceIdentity": null,
+ "depth": -3.4169709809181943
+ },
+ {
+ "stableId": "edge:14",
+ "kind": "Visible",
+ "points": [
+ {
+ "x": 275,
+ "y": 89.02775681356646
+ },
+ {
+ "x": 275,
+ "y": 77.2498113220981
+ }
+ ],
+ "occurrenceIdentity": null,
+ "depth": -8.660254037844387
+ },
+ {
+ "stableId": "edge:6",
+ "kind": "Visible",
+ "points": [
+ {
+ "x": 232.5,
+ "y": 52.71242488153899
+ },
+ {
+ "x": 164.5,
+ "y": 91.97224318643354
+ }
+ ],
+ "occurrenceIdentity": null,
+ "depth": -10.969655114602888
+ },
+ {
+ "stableId": "edge:1",
+ "kind": "Visible",
+ "points": [
+ {
+ "x": 232.5,
+ "y": 64.49037037300735
+ },
+ {
+ "x": 164.5,
+ "y": 103.7501886779019
+ }
+ ],
+ "occurrenceIdentity": null,
+ "depth": -17.8978583448784
+ },
+ {
+ "stableId": "edge:9",
+ "kind": "Visible",
+ "points": [
+ {
+ "x": 275,
+ "y": 77.2498113220981
+ },
+ {
+ "x": 232.5,
+ "y": 52.71242488153899
+ }
+ ],
+ "occurrenceIdentity": null,
+ "depth": -19.629909152447276
+ },
+ {
+ "stableId": "edge:4",
+ "kind": "Visible",
+ "points": [
+ {
+ "x": 275,
+ "y": 89.02775681356646
+ },
+ {
+ "x": 232.5,
+ "y": 64.49037037300735
+ }
+ ],
+ "occurrenceIdentity": null,
+ "depth": -26.55811238272279
+ },
+ {
+ "stableId": "edge:12",
+ "kind": "Visible",
+ "points": [
+ {
+ "x": 232.5,
+ "y": 64.49037037300735
+ },
+ {
+ "x": 232.5,
+ "y": 52.71242488153899
+ }
+ ],
+ "occurrenceIdentity": null,
+ "depth": -37.52776749732568
+ }
+ ],
+ "semanticAnchors": {},
+ "assignedPmi": []
+ }
+ ],
+ "annotations": [
+ {
+ "identity": "annotation:Front:MountDiameter",
+ "semanticReference": "MountDiameter",
+ "assignedView": "Front",
+ "kind": "DiameterDimension",
+ "engineeringDisplay": "\u00D88 mm \u002B0.05/-0.02",
+ "projectedAnchor": {
+ "x": 77.25,
+ "y": 90.5
+ },
+ "selectedCandidate": {
+ "identity": "candidate:4:top:1",
+ "body": {
+ "x": 59.8,
+ "y": 47.96875,
+ "width": 34.9,
+ "height": 6,
+ "right": 94.69999999999999,
+ "bottom": 53.96875
+ },
+ "leader": [
+ {
+ "x": 77.25,
+ "y": 90.5
+ },
+ {
+ "x": 77.25,
+ "y": 53.96875
+ }
+ ],
+ "lane": "top",
+ "laneIndex": 1,
+ "cost": 44.5313,
+ "rejections": []
+ },
+ "candidates": [
+ {
+ "identity": "candidate:4:top:1",
+ "body": {
+ "x": 59.8,
+ "y": 47.96875,
+ "width": 34.9,
+ "height": 6,
+ "right": 94.69999999999999,
+ "bottom": 53.96875
+ },
+ "leader": [
+ {
+ "x": 77.25,
+ "y": 90.5
+ },
+ {
+ "x": 77.25,
+ "y": 53.96875
+ }
+ ],
+ "lane": "top",
+ "laneIndex": 1,
+ "cost": 44.5313,
+ "rejections": []
+ },
+ {
+ "identity": "candidate:5:bottom:1",
+ "body": {
+ "x": 59.8,
+ "y": 127.03125,
+ "width": 34.9,
+ "height": 6,
+ "right": 94.69999999999999,
+ "bottom": 133.03125
+ },
+ "leader": [
+ {
+ "x": 77.25,
+ "y": 90.5
+ },
+ {
+ "x": 77.25,
+ "y": 127.03125
+ }
+ ],
+ "lane": "bottom",
+ "laneIndex": 1,
+ "cost": 44.53131,
+ "rejections": []
+ },
+ {
+ "identity": "candidate:8:top:2",
+ "body": {
+ "x": 59.8,
+ "y": 39.96875,
+ "width": 34.9,
+ "height": 6,
+ "right": 94.69999999999999,
+ "bottom": 45.96875
+ },
+ "leader": [
+ {
+ "x": 77.25,
+ "y": 90.5
+ },
+ {
+ "x": 77.25,
+ "y": 45.96875
+ }
+ ],
+ "lane": "top",
+ "laneIndex": 2,
+ "cost": 60.53134,
+ "rejections": []
+ },
+ {
+ "identity": "candidate:9:bottom:2",
+ "body": {
+ "x": 59.8,
+ "y": 135.03125,
+ "width": 34.9,
+ "height": 6,
+ "right": 94.69999999999999,
+ "bottom": 141.03125
+ },
+ "leader": [
+ {
+ "x": 77.25,
+ "y": 90.5
+ },
+ {
+ "x": 77.25,
+ "y": 135.03125
+ }
+ ],
+ "lane": "bottom",
+ "laneIndex": 2,
+ "cost": 60.53135,
+ "rejections": []
+ },
+ {
+ "identity": "candidate:12:top:3",
+ "body": {
+ "x": 59.8,
+ "y": 31.96875,
+ "width": 34.9,
+ "height": 6,
+ "right": 94.69999999999999,
+ "bottom": 37.96875
+ },
+ "leader": [
+ {
+ "x": 77.25,
+ "y": 90.5
+ },
+ {
+ "x": 77.25,
+ "y": 37.96875
+ }
+ ],
+ "lane": "top",
+ "laneIndex": 3,
+ "cost": 76.53138,
+ "rejections": []
+ },
+ {
+ "identity": "candidate:13:bottom:3",
+ "body": {
+ "x": 59.8,
+ "y": 143.03125,
+ "width": 34.9,
+ "height": 6,
+ "right": 94.69999999999999,
+ "bottom": 149.03125
+ },
+ "leader": [
+ {
+ "x": 77.25,
+ "y": 90.5
+ },
+ {
+ "x": 77.25,
+ "y": 143.03125
+ }
+ ],
+ "lane": "bottom",
+ "laneIndex": 3,
+ "cost": 76.53139,
+ "rejections": []
+ },
+ {
+ "identity": "candidate:6:left:1",
+ "body": {
+ "x": -15.899999999999999,
+ "y": 87.5,
+ "width": 34.9,
+ "height": 6,
+ "right": 19,
+ "bottom": 93.5
+ },
+ "leader": [
+ {
+ "x": 77.25,
+ "y": 90.5
+ },
+ {
+ "x": 19,
+ "y": 90.5
+ }
+ ],
+ "lane": "left",
+ "laneIndex": 1,
+ "cost": 86.25007,
+ "rejections": [
+ "outside-view-allocation"
+ ]
+ },
+ {
+ "identity": "candidate:7:right:1",
+ "body": {
+ "x": 135.5,
+ "y": 87.5,
+ "width": 34.9,
+ "height": 6,
+ "right": 170.4,
+ "bottom": 93.5
+ },
+ "leader": [
+ {
+ "x": 77.25,
+ "y": 90.5
+ },
+ {
+ "x": 135.5,
+ "y": 90.5
+ }
+ ],
+ "lane": "right",
+ "laneIndex": 1,
+ "cost": 86.25008,
+ "rejections": [
+ "outside-view-allocation"
+ ]
+ },
+ {
+ "identity": "candidate:0:free-ne:0",
+ "body": {
+ "x": 137.5,
+ "y": 45.96875,
+ "width": 34.9,
+ "height": 6,
+ "right": 172.4,
+ "bottom": 51.96875
+ },
+ "leader": [
+ {
+ "x": 77.25,
+ "y": 90.5
+ },
+ {
+ "x": 137.5,
+ "y": 51.96875
+ }
+ ],
+ "lane": "free-ne",
+ "laneIndex": 0,
+ "cost": 91.51727872974458,
+ "rejections": [
+ "outside-view-allocation"
+ ]
+ },
+ {
+ "identity": "candidate:1:free-nw:0",
+ "body": {
+ "x": -17.9,
+ "y": 45.96875,
+ "width": 34.9,
+ "height": 6,
+ "right": 17,
+ "bottom": 51.96875
+ },
+ "leader": [
+ {
+ "x": 77.25,
+ "y": 90.5
+ },
+ {
+ "x": 17,
+ "y": 51.96875
+ }
+ ],
+ "lane": "free-nw",
+ "laneIndex": 0,
+ "cost": 91.51728872974458,
+ "rejections": [
+ "outside-view-allocation"
+ ]
+ },
+ {
+ "identity": "candidate:2:free-se:0",
+ "body": {
+ "x": 137.5,
+ "y": 129.03125,
+ "width": 34.9,
+ "height": 6,
+ "right": 172.4,
+ "bottom": 135.03125
+ },
+ "leader": [
+ {
+ "x": 77.25,
+ "y": 90.5
+ },
+ {
+ "x": 137.5,
+ "y": 129.03125
+ }
+ ],
+ "lane": "free-se",
+ "laneIndex": 0,
+ "cost": 91.51729872974457,
+ "rejections": [
+ "outside-view-allocation"
+ ]
+ },
+ {
+ "identity": "candidate:3:free-sw:0",
+ "body": {
+ "x": -17.9,
+ "y": 129.03125,
+ "width": 34.9,
+ "height": 6,
+ "right": 17,
+ "bottom": 135.03125
+ },
+ "leader": [
+ {
+ "x": 77.25,
+ "y": 90.5
+ },
+ {
+ "x": 17,
+ "y": 129.03125
+ }
+ ],
+ "lane": "free-sw",
+ "laneIndex": 0,
+ "cost": 91.51730872974457,
+ "rejections": [
+ "outside-view-allocation"
+ ]
+ },
+ {
+ "identity": "candidate:10:left:2",
+ "body": {
+ "x": -23.9,
+ "y": 87.5,
+ "width": 34.9,
+ "height": 6,
+ "right": 11,
+ "bottom": 93.5
+ },
+ "leader": [
+ {
+ "x": 77.25,
+ "y": 90.5
+ },
+ {
+ "x": 11,
+ "y": 90.5
+ }
+ ],
+ "lane": "left",
+ "laneIndex": 2,
+ "cost": 102.25011,
+ "rejections": [
+ "outside-view-allocation"
+ ]
+ },
+ {
+ "identity": "candidate:11:right:2",
+ "body": {
+ "x": 143.5,
+ "y": 87.5,
+ "width": 34.9,
+ "height": 6,
+ "right": 178.4,
+ "bottom": 93.5
+ },
+ "leader": [
+ {
+ "x": 77.25,
+ "y": 90.5
+ },
+ {
+ "x": 143.5,
+ "y": 90.5
+ }
+ ],
+ "lane": "right",
+ "laneIndex": 2,
+ "cost": 102.25012,
+ "rejections": [
+ "outside-view-allocation"
+ ]
+ },
+ {
+ "identity": "candidate:14:left:3",
+ "body": {
+ "x": -31.9,
+ "y": 87.5,
+ "width": 34.9,
+ "height": 6,
+ "right": 3,
+ "bottom": 93.5
+ },
+ "leader": [
+ {
+ "x": 77.25,
+ "y": 90.5
+ },
+ {
+ "x": 3,
+ "y": 90.5
+ }
+ ],
+ "lane": "left",
+ "laneIndex": 3,
+ "cost": 118.25015,
+ "rejections": [
+ "outside-view-allocation"
+ ]
+ },
+ {
+ "identity": "candidate:15:right:3",
+ "body": {
+ "x": 151.5,
+ "y": 87.5,
+ "width": 34.9,
+ "height": 6,
+ "right": 186.4,
+ "bottom": 93.5
+ },
+ "leader": [
+ {
+ "x": 77.25,
+ "y": 90.5
+ },
+ {
+ "x": 151.5,
+ "y": 90.5
+ }
+ ],
+ "lane": "right",
+ "laneIndex": 3,
+ "cost": 118.25016,
+ "rejections": [
+ "outside-view-allocation"
+ ]
+ }
+ ],
+ "provenance": "MountDiameterConstraint"
+ },
+ {
+ "identity": "annotation:Front:A",
+ "semanticReference": "A",
+ "assignedView": "Front",
+ "kind": "Datum",
+ "engineeringDisplay": "A",
+ "projectedAnchor": {
+ "x": 77.25,
+ "y": 125.03125
+ },
+ "selectedCandidate": {
+ "identity": "candidate:5:bottom:1",
+ "body": {
+ "x": 68.25,
+ "y": 127.03125,
+ "width": 18,
+ "height": 6,
+ "right": 86.25,
+ "bottom": 133.03125
+ },
+ "leader": [
+ {
+ "x": 77.25,
+ "y": 125.03125
+ },
+ {
+ "x": 77.25,
+ "y": 127.03125
+ }
+ ],
+ "lane": "bottom",
+ "laneIndex": 1,
+ "cost": 10.00006,
+ "rejections": []
+ },
+ "candidates": [
+ {
+ "identity": "candidate:5:bottom:1",
+ "body": {
+ "x": 68.25,
+ "y": 127.03125,
+ "width": 18,
+ "height": 6,
+ "right": 86.25,
+ "bottom": 133.03125
+ },
+ "leader": [
+ {
+ "x": 77.25,
+ "y": 125.03125
+ },
+ {
+ "x": 77.25,
+ "y": 127.03125
+ }
+ ],
+ "lane": "bottom",
+ "laneIndex": 1,
+ "cost": 10.00006,
+ "rejections": []
+ },
+ {
+ "identity": "candidate:9:bottom:2",
+ "body": {
+ "x": 68.25,
+ "y": 135.03125,
+ "width": 18,
+ "height": 6,
+ "right": 86.25,
+ "bottom": 141.03125
+ },
+ "leader": [
+ {
+ "x": 77.25,
+ "y": 125.03125
+ },
+ {
+ "x": 77.25,
+ "y": 135.03125
+ }
+ ],
+ "lane": "bottom",
+ "laneIndex": 2,
+ "cost": 26.0001,
+ "rejections": []
+ },
+ {
+ "identity": "candidate:13:bottom:3",
+ "body": {
+ "x": 68.25,
+ "y": 143.03125,
+ "width": 18,
+ "height": 6,
+ "right": 86.25,
+ "bottom": 149.03125
+ },
+ "leader": [
+ {
+ "x": 77.25,
+ "y": 125.03125
+ },
+ {
+ "x": 77.25,
+ "y": 143.03125
+ }
+ ],
+ "lane": "bottom",
+ "laneIndex": 3,
+ "cost": 42.00014,
+ "rejections": []
+ },
+ {
+ "identity": "candidate:4:top:1",
+ "body": {
+ "x": 68.25,
+ "y": 47.96875,
+ "width": 18,
+ "height": 6,
+ "right": 86.25,
+ "bottom": 53.96875
+ },
+ "leader": [
+ {
+ "x": 77.25,
+ "y": 125.03125
+ },
+ {
+ "x": 77.25,
+ "y": 53.96875
+ }
+ ],
+ "lane": "top",
+ "laneIndex": 1,
+ "cost": 79.06255,
+ "rejections": [
+ "text-text-overlap"
+ ]
+ },
+ {
+ "identity": "candidate:2:free-se:0",
+ "body": {
+ "x": 137.5,
+ "y": 129.03125,
+ "width": 18,
+ "height": 6,
+ "right": 155.5,
+ "bottom": 135.03125
+ },
+ "leader": [
+ {
+ "x": 77.25,
+ "y": 125.03125
+ },
+ {
+ "x": 137.5,
+ "y": 129.03125
+ }
+ ],
+ "lane": "free-se",
+ "laneIndex": 0,
+ "cost": 80.38266409292443,
+ "rejections": [
+ "outside-view-allocation"
+ ]
+ },
+ {
+ "identity": "candidate:3:free-sw:0",
+ "body": {
+ "x": -1,
+ "y": 129.03125,
+ "width": 18,
+ "height": 6,
+ "right": 17,
+ "bottom": 135.03125
+ },
+ "leader": [
+ {
+ "x": 77.25,
+ "y": 125.03125
+ },
+ {
+ "x": 17,
+ "y": 129.03125
+ }
+ ],
+ "lane": "free-sw",
+ "laneIndex": 0,
+ "cost": 80.38267409292443,
+ "rejections": [
+ "outside-view-allocation"
+ ]
+ },
+ {
+ "identity": "candidate:6:left:1",
+ "body": {
+ "x": 1,
+ "y": 87.5,
+ "width": 18,
+ "height": 6,
+ "right": 19,
+ "bottom": 93.5
+ },
+ "leader": [
+ {
+ "x": 77.25,
+ "y": 125.03125
+ },
+ {
+ "x": 19,
+ "y": 93.5
+ }
+ ],
+ "lane": "left",
+ "laneIndex": 1,
+ "cost": 94.23663261131385,
+ "rejections": [
+ "outside-view-allocation"
+ ]
+ },
+ {
+ "identity": "candidate:7:right:1",
+ "body": {
+ "x": 135.5,
+ "y": 87.5,
+ "width": 18,
+ "height": 6,
+ "right": 153.5,
+ "bottom": 93.5
+ },
+ "leader": [
+ {
+ "x": 77.25,
+ "y": 125.03125
+ },
+ {
+ "x": 135.5,
+ "y": 93.5
+ }
+ ],
+ "lane": "right",
+ "laneIndex": 1,
+ "cost": 94.23664261131385,
+ "rejections": [
+ "outside-view-allocation"
+ ]
+ },
+ {
+ "identity": "candidate:8:top:2",
+ "body": {
+ "x": 68.25,
+ "y": 39.96875,
+ "width": 18,
+ "height": 6,
+ "right": 86.25,
+ "bottom": 45.96875
+ },
+ "leader": [
+ {
+ "x": 77.25,
+ "y": 125.03125
+ },
+ {
+ "x": 77.25,
+ "y": 45.96875
+ }
+ ],
+ "lane": "top",
+ "laneIndex": 2,
+ "cost": 95.06259,
+ "rejections": []
+ },
+ {
+ "identity": "candidate:10:left:2",
+ "body": {
+ "x": -7,
+ "y": 87.5,
+ "width": 18,
+ "height": 6,
+ "right": 11,
+ "bottom": 93.5
+ },
+ "leader": [
+ {
+ "x": 77.25,
+ "y": 125.03125
+ },
+ {
+ "x": 11,
+ "y": 93.5
+ }
+ ],
+ "lane": "left",
+ "laneIndex": 2,
+ "cost": 109.37096406728274,
+ "rejections": [
+ "outside-view-allocation"
+ ]
+ },
+ {
+ "identity": "candidate:11:right:2",
+ "body": {
+ "x": 143.5,
+ "y": 87.5,
+ "width": 18,
+ "height": 6,
+ "right": 161.5,
+ "bottom": 93.5
+ },
+ "leader": [
+ {
+ "x": 77.25,
+ "y": 125.03125
+ },
+ {
+ "x": 143.5,
+ "y": 93.5
+ }
+ ],
+ "lane": "right",
+ "laneIndex": 2,
+ "cost": 109.37097406728273,
+ "rejections": [
+ "outside-view-allocation"
+ ]
+ },
+ {
+ "identity": "candidate:12:top:3",
+ "body": {
+ "x": 68.25,
+ "y": 31.96875,
+ "width": 18,
+ "height": 6,
+ "right": 86.25,
+ "bottom": 37.96875
+ },
+ "leader": [
+ {
+ "x": 77.25,
+ "y": 125.03125
+ },
+ {
+ "x": 77.25,
+ "y": 37.96875
+ }
+ ],
+ "lane": "top",
+ "laneIndex": 3,
+ "cost": 111.06263,
+ "rejections": []
+ },
+ {
+ "identity": "candidate:0:free-ne:0",
+ "body": {
+ "x": 137.5,
+ "y": 45.96875,
+ "width": 18,
+ "height": 6,
+ "right": 155.5,
+ "bottom": 51.96875
+ },
+ "leader": [
+ {
+ "x": 77.25,
+ "y": 125.03125
+ },
+ {
+ "x": 137.5,
+ "y": 51.96875
+ }
+ ],
+ "lane": "free-ne",
+ "laneIndex": 0,
+ "cost": 114.70054540635344,
+ "rejections": [
+ "outside-view-allocation"
+ ]
+ },
+ {
+ "identity": "candidate:1:free-nw:0",
+ "body": {
+ "x": -1,
+ "y": 45.96875,
+ "width": 18,
+ "height": 6,
+ "right": 17,
+ "bottom": 51.96875
+ },
+ "leader": [
+ {
+ "x": 77.25,
+ "y": 125.03125
+ },
+ {
+ "x": 17,
+ "y": 51.96875
+ }
+ ],
+ "lane": "free-nw",
+ "laneIndex": 0,
+ "cost": 114.70055540635344,
+ "rejections": [
+ "outside-view-allocation"
+ ]
+ },
+ {
+ "identity": "candidate:14:left:3",
+ "body": {
+ "x": -15,
+ "y": 87.5,
+ "width": 18,
+ "height": 6,
+ "right": 3,
+ "bottom": 93.5
+ },
+ "leader": [
+ {
+ "x": 77.25,
+ "y": 125.03125
+ },
+ {
+ "x": 3,
+ "y": 93.5
+ }
+ ],
+ "lane": "left",
+ "laneIndex": 3,
+ "cost": 124.66787729265714,
+ "rejections": [
+ "outside-view-allocation"
+ ]
+ },
+ {
+ "identity": "candidate:15:right:3",
+ "body": {
+ "x": 151.5,
+ "y": 87.5,
+ "width": 18,
+ "height": 6,
+ "right": 169.5,
+ "bottom": 93.5
+ },
+ "leader": [
+ {
+ "x": 77.25,
+ "y": 125.03125
+ },
+ {
+ "x": 151.5,
+ "y": 93.5
+ }
+ ],
+ "lane": "right",
+ "laneIndex": 3,
+ "cost": 124.66788729265713,
+ "rejections": [
+ "outside-view-allocation"
+ ]
+ }
+ ],
+ "provenance": "Firmament Semantic PMI"
+ }
+ ],
+ "tables": [],
+ "notes": [
+ "DEBURR ALL EDGES",
+ "DIMENSIONS AND TOLERANCES COME FROM THE SEMANTIC PRODUCT MODEL"
+ ]
+ },
+ {
+ "pageNumber": 2,
+ "orientation": "Landscape",
+ "widthMillimetres": 297,
+ "heightMillimetres": 210,
+ "contentRect": {
+ "x": 10,
+ "y": 16,
+ "width": 277,
+ "height": 174,
+ "right": 287,
+ "bottom": 190
+ },
+ "views": [],
+ "annotations": [],
+ "tables": [
+ {
+ "identity": "BearingStandards",
+ "columns": [
+ "BoreDiameter",
+ "Depth",
+ "Height",
+ "Size",
+ "Width"
+ ],
+ "rows": [
+ [
+ "8mm",
+ "12mm",
+ "50mm",
+ "BB080",
+ "80mm"
+ ],
+ [
+ "10mm",
+ "16mm",
+ "60mm",
+ "BB100",
+ "100mm"
+ ],
+ [
+ "12mm",
+ "20mm",
+ "70mm",
+ "BB120",
+ "120mm"
+ ]
+ ],
+ "sourceIdentity": "BearingStandards",
+ "provenance": "Firmament Static Table; shared compile-time source"
+ }
+ ],
+ "notes": []
+ }
+ ],
+ "layoutEvidence": {
+ "annotationCount": 2,
+ "textModelCollisionsBefore": 0,
+ "textModelCollisionsAfter": 0,
+ "textTextCollisionsAfter": 0,
+ "laneOccupancy": {
+ "top": 1,
+ "bottom": 1
+ },
+ "rejectedCandidateCount": 21,
+ "failedAnnotationCount": 0
+ },
+ "performance": {
+ "sourceCompileMilliseconds": 0,
+ "projectionMilliseconds": 0,
+ "layoutMilliseconds": 0,
+ "renderMilliseconds": 0,
+ "pdfMilliseconds": 0
+ },
+ "diagnostics": [],
+ "projectionPolicy": "Structured BRep edge projection; coincident projected edges are merged. M0 does not claim exact face-occlusion HLR.",
+ "schemaVersion": "aetheris-drawing-m0"
+}
\ No newline at end of file
diff --git a/docs/drawing/artifacts/m0/BearingBlockProduction.pdf b/docs/drawing/artifacts/m0/BearingBlockProduction.pdf
new file mode 100644
index 00000000..27473b94
--- /dev/null
+++ b/docs/drawing/artifacts/m0/BearingBlockProduction.pdf
@@ -0,0 +1,282 @@
+%PDF-1.4
+%����
+1 0 obj
+<< /Type /Font /Subtype /Type1 /BaseFont /Helvetica /Encoding /WinAnsiEncoding >>
+endobj
+2 0 obj
+<< /Type /Font /Subtype /Type1 /BaseFont /Helvetica-Bold /Encoding /WinAnsiEncoding >>
+endobj
+3 0 obj
+<< /Length 9363 >>
+stream
+BT /F2 10 Tf 28.346 569.764 Td (Bearing block production drawing) Tj ET
+BT /F1 7 Tf 600.945 569.764 Td (BearingBlock | REV A | 1/2) Tj ET
+BT /F2 7 Tf 28.346 540 Td (Front SCALE x1.381) Tj ET
+0.55 w [] 0 d 234.638 338.74 m 234.504 340.784 l S
+0.55 w [] 0 d 234.504 340.784 m 234.104 342.794 l S
+0.55 w [] 0 d 234.104 342.794 m 233.446 344.734 l S
+0.55 w [] 0 d 233.446 344.734 m 232.54 346.571 l S
+0.55 w [] 0 d 232.54 346.571 m 231.401 348.274 l S
+0.55 w [] 0 d 231.401 348.274 m 230.051 349.814 l S
+0.55 w [] 0 d 230.051 349.814 m 228.51 351.165 l S
+0.55 w [] 0 d 228.51 351.165 m 226.807 352.303 l S
+0.55 w [] 0 d 226.807 352.303 m 224.97 353.209 l S
+0.55 w [] 0 d 224.97 353.209 m 223.03 353.868 l S
+0.55 w [] 0 d 223.03 353.868 m 221.021 354.268 l S
+0.55 w [] 0 d 221.021 354.268 m 218.976 354.402 l S
+0.55 w [] 0 d 218.976 354.402 m 216.932 354.268 l S
+0.55 w [] 0 d 216.932 354.268 m 214.923 353.868 l S
+0.55 w [] 0 d 214.923 353.868 m 212.983 353.209 l S
+0.55 w [] 0 d 212.983 353.209 m 211.146 352.303 l S
+0.55 w [] 0 d 211.146 352.303 m 209.442 351.165 l S
+0.55 w [] 0 d 209.442 351.165 m 207.902 349.814 l S
+0.55 w [] 0 d 207.902 349.814 m 206.551 348.274 l S
+0.55 w [] 0 d 206.551 348.274 m 205.413 346.571 l S
+0.55 w [] 0 d 205.413 346.571 m 204.507 344.734 l S
+0.55 w [] 0 d 204.507 344.734 m 203.849 342.794 l S
+0.55 w [] 0 d 203.849 342.794 m 203.449 340.784 l S
+0.55 w [] 0 d 203.449 340.784 m 203.315 338.74 l S
+0.55 w [] 0 d 203.315 338.74 m 203.449 336.696 l S
+0.55 w [] 0 d 203.449 336.696 m 203.849 334.687 l S
+0.55 w [] 0 d 203.849 334.687 m 204.507 332.747 l S
+0.55 w [] 0 d 204.507 332.747 m 205.413 330.909 l S
+0.55 w [] 0 d 205.413 330.909 m 206.551 329.206 l S
+0.55 w [] 0 d 206.551 329.206 m 207.902 327.666 l S
+0.55 w [] 0 d 207.902 327.666 m 209.442 326.315 l S
+0.55 w [] 0 d 209.442 326.315 m 211.146 325.177 l S
+0.55 w [] 0 d 211.146 325.177 m 212.983 324.271 l S
+0.55 w [] 0 d 212.983 324.271 m 214.923 323.612 l S
+0.55 w [] 0 d 214.923 323.612 m 216.932 323.213 l S
+0.55 w [] 0 d 216.932 323.213 m 218.976 323.079 l S
+0.55 w [] 0 d 218.976 323.079 m 221.021 323.213 l S
+0.55 w [] 0 d 221.021 323.213 m 223.03 323.612 l S
+0.55 w [] 0 d 223.03 323.612 m 224.97 324.271 l S
+0.55 w [] 0 d 224.97 324.271 m 226.807 325.177 l S
+0.55 w [] 0 d 226.807 325.177 m 228.51 326.315 l S
+0.55 w [] 0 d 228.51 326.315 m 230.051 327.666 l S
+0.55 w [] 0 d 230.051 327.666 m 231.401 329.206 l S
+0.55 w [] 0 d 231.401 329.206 m 232.54 330.909 l S
+0.55 w [] 0 d 232.54 330.909 m 233.446 332.747 l S
+0.55 w [] 0 d 233.446 332.747 m 234.104 334.687 l S
+0.55 w [] 0 d 234.104 334.687 m 234.504 336.696 l S
+0.55 w [] 0 d 234.504 336.696 m 234.638 338.74 l S
+0.35 w [] 0 d 62.362 240.856 m 375.591 240.856 l S
+0.35 w [] 0 d 375.591 240.856 m 375.591 436.624 l S
+0.35 w [] 0 d 375.591 436.624 m 62.362 436.624 l S
+0.35 w [] 0 d 62.362 436.624 m 62.362 240.856 l S
+0.35 w [] 0 d 375.591 240.856 m 375.591 240.856 l S
+0.35 w [] 0 d 62.362 240.856 m 62.362 240.856 l S
+0.35 w [] 0 d 375.591 436.624 m 375.591 436.624 l S
+0.35 w [] 0 d 62.362 436.624 m 62.362 436.624 l S
+0.35 w [] 0 d 234.638 338.74 m 234.638 338.74 l S
+BT /F2 7 Tf 432.283 540 Td (Iso SCALE x1.202) Tj ET
+0.35 w [] 0 d 586.772 231.626 m 586.772 265.012 l S
+0.35 w [] 0 d 466.299 334.567 m 586.772 265.012 l S
+0.35 w [] 0 d 466.299 301.181 m 586.772 231.626 l S
+0.35 w [] 0 d 586.772 265.012 m 779.528 376.3 l S
+0.35 w [] 0 d 586.772 231.626 m 779.528 342.913 l S
+0.35 w [] 0 d 466.299 301.181 m 466.299 334.567 l S
+0.55 w [] 0 d 613.276 349.869 m 614.616 349.19 l S
+0.55 w [] 0 d 614.616 349.19 m 616.098 348.618 l S
+0.55 w [] 0 d 616.098 348.618 m 617.697 348.163 l S
+0.55 w [] 0 d 617.697 348.163 m 619.386 347.832 l S
+0.55 w [] 0 d 619.386 347.832 m 621.134 347.631 l S
+0.55 w [] 0 d 621.134 347.631 m 622.913 347.564 l S
+0.55 w [] 0 d 622.913 347.564 m 624.692 347.631 l S
+0.55 w [] 0 d 624.692 347.631 m 626.441 347.832 l S
+0.55 w [] 0 d 626.441 347.832 m 628.129 348.163 l S
+0.55 w [] 0 d 628.129 348.163 m 629.728 348.618 l S
+0.55 w [] 0 d 629.728 348.618 m 631.211 349.19 l S
+0.55 w [] 0 d 631.211 349.19 m 632.551 349.869 l S
+0.55 w [] 0 d 632.551 349.869 m 633.727 350.643 l S
+0.55 w [] 0 d 633.727 350.643 m 634.717 351.499 l S
+0.55 w [] 0 d 634.717 351.499 m 635.506 352.422 l S
+0.55 w [] 0 d 635.506 352.422 m 636.079 353.397 l S
+0.55 w [] 0 d 636.079 353.397 m 636.427 354.406 l S
+0.55 w [] 0 d 636.427 354.406 m 636.543 355.433 l S
+0.55 w [] 0 d 636.543 355.433 m 636.427 356.46 l S
+0.55 w [] 0 d 636.427 356.46 m 636.079 357.47 l S
+0.55 w [] 0 d 636.079 357.47 m 635.506 358.445 l S
+0.55 w [] 0 d 635.506 358.445 m 634.717 359.368 l S
+0.55 w [] 0 d 634.717 359.368 m 633.727 360.224 l S
+0.55 w [] 0 d 633.727 360.224 m 632.551 360.998 l S
+0.55 w [] 0 d 632.551 360.998 m 631.211 361.676 l S
+0.55 w [] 0 d 631.211 361.676 m 629.728 362.248 l S
+0.55 w [] 0 d 629.728 362.248 m 628.129 362.704 l S
+0.55 w [] 0 d 628.129 362.704 m 626.441 363.034 l S
+0.55 w [] 0 d 626.441 363.034 m 624.692 363.235 l S
+0.55 w [] 0 d 624.692 363.235 m 622.913 363.303 l S
+0.55 w [] 0 d 622.913 363.303 m 621.134 363.235 l S
+0.55 w [] 0 d 621.134 363.235 m 619.386 363.034 l S
+0.55 w [] 0 d 619.386 363.034 m 617.697 362.704 l S
+0.55 w [] 0 d 617.697 362.704 m 616.098 362.248 l S
+0.55 w [] 0 d 616.098 362.248 m 614.616 361.676 l S
+0.55 w [] 0 d 614.616 361.676 m 613.276 360.998 l S
+0.55 w [] 0 d 613.276 360.998 m 612.1 360.224 l S
+0.55 w [] 0 d 612.1 360.224 m 611.11 359.368 l S
+0.55 w [] 0 d 611.11 359.368 m 610.321 358.445 l S
+0.55 w [] 0 d 610.321 358.445 m 609.748 357.47 l S
+0.55 w [] 0 d 609.748 357.47 m 609.4 356.46 l S
+0.55 w [] 0 d 609.4 356.46 m 609.283 355.433 l S
+0.55 w [] 0 d 609.283 355.433 m 609.4 354.406 l S
+0.55 w [] 0 d 609.4 354.406 m 609.748 353.397 l S
+0.55 w [] 0 d 609.748 353.397 m 610.321 352.422 l S
+0.55 w [] 0 d 610.321 352.422 m 611.11 351.499 l S
+0.55 w [] 0 d 611.11 351.499 m 612.1 350.643 l S
+0.55 w [] 0 d 612.1 350.643 m 613.276 349.869 l S
+0.35 w [] 0 d 613.276 349.869 m 613.276 316.483 l S
+0.55 w [] 0 d 613.276 316.483 m 614.616 315.804 l S
+0.55 w [] 0 d 614.616 315.804 m 616.098 315.232 l S
+0.55 w [] 0 d 616.098 315.232 m 617.697 314.777 l S
+0.55 w [] 0 d 617.697 314.777 m 619.386 314.446 l S
+0.55 w [] 0 d 619.386 314.446 m 621.134 314.245 l S
+0.55 w [] 0 d 621.134 314.245 m 622.913 314.178 l S
+0.55 w [] 0 d 622.913 314.178 m 624.692 314.245 l S
+0.55 w [] 0 d 624.692 314.245 m 626.441 314.446 l S
+0.55 w [] 0 d 626.441 314.446 m 628.129 314.777 l S
+0.55 w [] 0 d 628.129 314.777 m 629.728 315.232 l S
+0.55 w [] 0 d 629.728 315.232 m 631.211 315.804 l S
+0.55 w [] 0 d 631.211 315.804 m 632.551 316.483 l S
+0.55 w [] 0 d 632.551 316.483 m 633.727 317.257 l S
+0.55 w [] 0 d 633.727 317.257 m 634.717 318.112 l S
+0.55 w [] 0 d 634.717 318.112 m 635.506 319.036 l S
+0.55 w [] 0 d 635.506 319.036 m 636.079 320.01 l S
+0.55 w [] 0 d 636.079 320.01 m 636.427 321.02 l S
+0.55 w [] 0 d 636.427 321.02 m 636.543 322.047 l S
+0.55 w [] 0 d 636.543 322.047 m 636.427 323.074 l S
+0.55 w [] 0 d 636.427 323.074 m 636.079 324.084 l S
+0.55 w [] 0 d 636.079 324.084 m 635.506 325.058 l S
+0.55 w [] 0 d 635.506 325.058 m 634.717 325.982 l S
+0.55 w [] 0 d 634.717 325.982 m 633.727 326.837 l S
+0.55 w [] 0 d 633.727 326.837 m 632.551 327.611 l S
+0.55 w [] 0 d 632.551 327.611 m 631.211 328.29 l S
+0.55 w [] 0 d 631.211 328.29 m 629.728 328.862 l S
+0.55 w [] 0 d 629.728 328.862 m 628.129 329.317 l S
+0.55 w [] 0 d 628.129 329.317 m 626.441 329.648 l S
+0.55 w [] 0 d 626.441 329.648 m 624.692 329.849 l S
+0.55 w [] 0 d 624.692 329.849 m 622.913 329.916 l S
+0.55 w [] 0 d 622.913 329.916 m 621.134 329.849 l S
+0.55 w [] 0 d 621.134 329.849 m 619.386 329.648 l S
+0.55 w [] 0 d 619.386 329.648 m 617.697 329.317 l S
+0.55 w [] 0 d 617.697 329.317 m 616.098 328.862 l S
+0.55 w [] 0 d 616.098 328.862 m 614.616 328.29 l S
+0.55 w [] 0 d 614.616 328.29 m 613.276 327.611 l S
+0.55 w [] 0 d 613.276 327.611 m 612.1 326.837 l S
+0.55 w [] 0 d 612.1 326.837 m 611.11 325.982 l S
+0.55 w [] 0 d 611.11 325.982 m 610.321 325.058 l S
+0.55 w [] 0 d 610.321 325.058 m 609.748 324.084 l S
+0.55 w [] 0 d 609.748 324.084 m 609.4 323.074 l S
+0.55 w [] 0 d 609.4 323.074 m 609.283 322.047 l S
+0.55 w [] 0 d 609.283 322.047 m 609.4 321.02 l S
+0.55 w [] 0 d 609.4 321.02 m 609.748 320.01 l S
+0.55 w [] 0 d 609.748 320.01 m 610.321 319.036 l S
+0.55 w [] 0 d 610.321 319.036 m 611.11 318.112 l S
+0.55 w [] 0 d 611.11 318.112 m 612.1 317.257 l S
+0.55 w [] 0 d 612.1 317.257 m 613.276 316.483 l S
+0.35 w [] 0 d 779.528 342.913 m 779.528 376.3 l S
+0.35 w [] 0 d 659.055 445.855 m 466.299 334.567 l S
+0.35 w [] 0 d 659.055 412.468 m 466.299 301.181 l S
+0.35 w [] 0 d 779.528 376.3 m 659.055 445.855 l S
+0.35 w [] 0 d 779.528 342.913 m 659.055 412.468 l S
+0.35 w [] 0 d 659.055 412.468 m 659.055 445.855 l S
+0.25 w [] 0 d 218.976 338.74 m 218.976 442.293 l S
+1 1 1 rg 0.25 w 169.512 442.293 98.929 17.008 re B
+0 0 0 rg
+BT /F1 7 Tf 172.346 447.396 Td (DIA 8 mm +0.05/-0.02) Tj ET
+0.25 w [] 0 d 218.976 240.856 m 218.976 235.187 l S
+1 1 1 rg 0.25 w 193.465 218.179 51.024 17.008 re B
+0 0 0 rg
+BT /F1 7 Tf 196.299 223.281 Td (A) Tj ET
+BT /F1 7 Tf 28.346 42.52 Td (DEBURR ALL EDGES) Tj ET
+BT /F1 7 Tf 28.346 31.181 Td (DIMENSIONS AND TOLERANCES COME FROM THE SEMANTIC PRODUCT MODEL) Tj ET
+BT /F1 6 Tf 28.346 14.173 Td (A4 Landscape | ACTUAL SIZE | StandardMachinedDrawing | 2a731a10cc7aa3dd) Tj ET
+
+endstream
+endobj
+4 0 obj
+<< /Type /Page /Parent 7 0 R /MediaBox [0 0 841.89 595.276] /Resources << /Font << /F1 1 0 R /F2 2 0 R >> >> /Contents 3 0 R >>
+endobj
+5 0 obj
+<< /Length 2147 >>
+stream
+BT /F2 10 Tf 28.346 569.764 Td (Bearing block production drawing) Tj ET
+BT /F1 7 Tf 600.945 569.764 Td (BearingBlock | REV A | 2/2) Tj ET
+BT /F2 9 Tf 28.346 530.079 Td (BearingStandards) Tj ET
+0.88 0.91 0.95 rg 0.2 w 28.346 501.732 157.039 19.843 re B
+0 0 0 rg
+BT /F2 7 Tf 31.181 508.535 Td (BoreDiameter) Tj ET
+0.88 0.91 0.95 rg 0.2 w 185.386 501.732 157.039 19.843 re B
+0 0 0 rg
+BT /F2 7 Tf 188.22 508.535 Td (Depth) Tj ET
+0.88 0.91 0.95 rg 0.2 w 342.425 501.732 157.039 19.843 re B
+0 0 0 rg
+BT /F2 7 Tf 345.26 508.535 Td (Height) Tj ET
+0.88 0.91 0.95 rg 0.2 w 499.465 501.732 157.039 19.843 re B
+0 0 0 rg
+BT /F2 7 Tf 502.299 508.535 Td (Size) Tj ET
+0.88 0.91 0.95 rg 0.2 w 656.504 501.732 157.039 19.843 re B
+0 0 0 rg
+BT /F2 7 Tf 659.339 508.535 Td (Width) Tj ET
+0.2 w 28.346 481.89 157.039 19.843 re S
+BT /F1 7 Tf 31.181 488.693 Td (8mm) Tj ET
+0.2 w 185.386 481.89 157.039 19.843 re S
+BT /F1 7 Tf 188.22 488.693 Td (12mm) Tj ET
+0.2 w 342.425 481.89 157.039 19.843 re S
+BT /F1 7 Tf 345.26 488.693 Td (50mm) Tj ET
+0.2 w 499.465 481.89 157.039 19.843 re S
+BT /F1 7 Tf 502.299 488.693 Td (BB080) Tj ET
+0.2 w 656.504 481.89 157.039 19.843 re S
+BT /F1 7 Tf 659.339 488.693 Td (80mm) Tj ET
+0.2 w 28.346 462.047 157.039 19.843 re S
+BT /F1 7 Tf 31.181 468.85 Td (10mm) Tj ET
+0.2 w 185.386 462.047 157.039 19.843 re S
+BT /F1 7 Tf 188.22 468.85 Td (16mm) Tj ET
+0.2 w 342.425 462.047 157.039 19.843 re S
+BT /F1 7 Tf 345.26 468.85 Td (60mm) Tj ET
+0.2 w 499.465 462.047 157.039 19.843 re S
+BT /F1 7 Tf 502.299 468.85 Td (BB100) Tj ET
+0.2 w 656.504 462.047 157.039 19.843 re S
+BT /F1 7 Tf 659.339 468.85 Td (100mm) Tj ET
+0.2 w 28.346 442.205 157.039 19.843 re S
+BT /F1 7 Tf 31.181 449.008 Td (12mm) Tj ET
+0.2 w 185.386 442.205 157.039 19.843 re S
+BT /F1 7 Tf 188.22 449.008 Td (20mm) Tj ET
+0.2 w 342.425 442.205 157.039 19.843 re S
+BT /F1 7 Tf 345.26 449.008 Td (70mm) Tj ET
+0.2 w 499.465 442.205 157.039 19.843 re S
+BT /F1 7 Tf 502.299 449.008 Td (BB120) Tj ET
+0.2 w 656.504 442.205 157.039 19.843 re S
+BT /F1 7 Tf 659.339 449.008 Td (120mm) Tj ET
+BT /F1 6 Tf 28.346 14.173 Td (A4 Landscape | ACTUAL SIZE | StandardMachinedDrawing | 2a731a10cc7aa3dd) Tj ET
+
+endstream
+endobj
+6 0 obj
+<< /Type /Page /Parent 7 0 R /MediaBox [0 0 841.89 595.276] /Resources << /Font << /F1 1 0 R /F2 2 0 R >> >> /Contents 5 0 R >>
+endobj
+7 0 obj
+<< /Type /Pages /Count 2 /Kids [4 0 R 6 0 R] >>
+endobj
+8 0 obj
+<< /Type /Catalog /Pages 7 0 R >>
+endobj
+9 0 obj
+<< /Title (Bearing block production drawing) /Subject (BearingBlock) /Author (Aetheris) /Creator (Aetheris Drawing M0) /Producer (Aetheris vector PDF) /CreationDate (D:20260810000000-07'00') /ModDate (D:20260810000000-07'00') >>
+endobj
+xref
+0 10
+0000000000 65535 f
+0000000015 00000 n
+0000000112 00000 n
+0000000214 00000 n
+0000009629 00000 n
+0000009772 00000 n
+0000011971 00000 n
+0000012114 00000 n
+0000012177 00000 n
+0000012226 00000 n
+trailer
+<< /Size 10 /Root 8 0 R /Info 9 0 R >>
+startxref
+12470
+%%EOF
diff --git a/docs/drawing/artifacts/m0/BearingBlockProduction.svg b/docs/drawing/artifacts/m0/BearingBlockProduction.svg
new file mode 100644
index 00000000..33fbfb8b
--- /dev/null
+++ b/docs/drawing/artifacts/m0/BearingBlockProduction.svg
@@ -0,0 +1,99 @@
+<svg xmlns="http://www.w3.org/2000/svg" width="297mm" height="428mm" viewBox="0 0 297 428" data-drawing-schema="aetheris-drawing-m0">
+<style>.sheet{fill:white;stroke:#aab2bd;stroke-width:.25}.visible,.silhouette{fill:none;stroke:#111827;stroke-width:.35;stroke-linecap:round;stroke-linejoin:round}.silhouette{stroke-width:.5}.hidden{fill:none;stroke:#64748b;stroke-width:.25;stroke-dasharray:2 1}.leader{fill:none;stroke:#374151;stroke-width:.22}.annotation{font:3.2px Arial,sans-serif;fill:#111827}.label{font:600 3.2px Arial,sans-serif;fill:#334155}.meta{font:2.8px Arial,sans-serif;fill:#334155}.table-header{font:600 3px Arial,sans-serif}.table-cell{font:2.8px Arial,sans-serif}</style>
+<g transform="translate(0 0)" data-page="1">
+<rect class="sheet" x="0" y="0" width="297" height="210"/>
+<text class="label" x="10" y="9">Bearing block production drawing</text>
+<text class="meta" x="287" y="9" text-anchor="end">BearingBlock · A · 1/2</text>
+<g data-view="Front">
+<text class="label" x="10" y="19.5">Front · scale ×1.381</text>
+<polyline class="silhouette" points="82.775,90.5 82.728,89.779 82.587,89.07 82.354,88.386 82.035,87.738 81.633,87.137 81.157,86.593 80.613,86.117 80.013,85.715 79.364,85.396 78.68,85.163 77.971,85.022 77.25,84.975 76.529,85.022 75.82,85.163 75.136,85.396 74.488,85.715 73.887,86.117 73.343,86.593 72.867,87.137 72.465,87.738 72.146,88.386 71.913,89.07 71.772,89.779 71.725,90.5 71.772,91.221 71.913,91.93 72.146,92.614 72.465,93.263 72.867,93.863 73.343,94.407 73.887,94.883 74.488,95.285 75.136,95.604 75.82,95.837 76.529,95.978 77.25,96.025 77.971,95.978 78.68,95.837 79.364,95.604 80.013,95.285 80.613,94.883 81.157,94.407 81.633,93.863 82.035,93.263 82.354,92.614 82.587,91.93 82.728,91.221 82.775,90.5" data-semantic-id="edge:10"/>
+<polyline class="visible" points="22,125.031 132.5,125.031" data-semantic-id="edge:6"/>
+<polyline class="visible" points="132.5,125.031 132.5,55.969" data-semantic-id="edge:7"/>
+<polyline class="visible" points="132.5,55.969 22,55.969" data-semantic-id="edge:8"/>
+<polyline class="visible" points="22,55.969 22,125.031" data-semantic-id="edge:9"/>
+<polyline class="visible" points="132.5,125.031 132.5,125.031" data-semantic-id="edge:11"/>
+<polyline class="visible" points="22,125.031 22,125.031" data-semantic-id="edge:12"/>
+<polyline class="visible" points="132.5,55.969 132.5,55.969" data-semantic-id="edge:13"/>
+<polyline class="visible" points="22,55.969 22,55.969" data-semantic-id="edge:14"/>
+<polyline class="visible" points="82.775,90.5 82.775,90.5" data-semantic-id="edge:15"/>
+</g>
+<g data-view="Iso">
+<text class="label" x="152.5" y="19.5">Iso · scale ×1.202</text>
+<polyline class="visible" points="207,128.288 207,116.51" data-semantic-id="edge:13"/>
+<polyline class="visible" points="164.5,91.972 207,116.51" data-semantic-id="edge:7"/>
+<polyline class="visible" points="164.5,103.75 207,128.288" data-semantic-id="edge:2"/>
+<polyline class="visible" points="207,116.51 275,77.25" data-semantic-id="edge:8"/>
+<polyline class="visible" points="207,128.288 275,89.028" data-semantic-id="edge:3"/>
+<polyline class="visible" points="164.5,103.75 164.5,91.972" data-semantic-id="edge:11"/>
+<polyline class="silhouette" points="216.35,86.574 216.823,86.813 217.346,87.015 217.91,87.176 218.506,87.293 219.122,87.363 219.75,87.387 220.378,87.363 220.994,87.293 221.59,87.176 222.154,87.015 222.677,86.813 223.15,86.574 223.565,86.301 223.914,85.999 224.192,85.673 224.394,85.33 224.517,84.973 224.558,84.611 224.517,84.249 224.394,83.893 224.192,83.549 223.914,83.223 223.565,82.921 223.15,82.648 222.677,82.409 222.154,82.207 221.59,82.046 220.994,81.93 220.378,81.859 219.75,81.835 219.122,81.859 218.506,81.93 217.91,82.046 217.346,82.207 216.823,82.409 216.35,82.648 215.935,82.921 215.586,83.223 215.308,83.549 215.106,83.893 214.983,84.249 214.942,84.611 214.983,84.973 215.106,85.33 215.308,85.673 215.586,85.999 215.935,86.301 216.35,86.574" data-semantic-id="edge:10"/>
+<polyline class="visible" points="216.35,86.574 216.35,98.352" data-semantic-id="edge:15"/>
+<polyline class="silhouette" points="216.35,98.352 216.823,98.591 217.346,98.793 217.91,98.954 218.506,99.07 219.122,99.141 219.75,99.165 220.378,99.141 220.994,99.07 221.59,98.954 222.154,98.793 222.677,98.591 223.15,98.352 223.565,98.079 223.914,97.777 224.192,97.451 224.394,97.107 224.517,96.751 224.558,96.389 224.517,96.027 224.394,95.67 224.192,95.327 223.914,95.001 223.565,94.699 223.15,94.426 222.677,94.187 222.154,93.985 221.59,93.824 220.994,93.707 220.378,93.637 219.75,93.613 219.122,93.637 218.506,93.707 217.91,93.824 217.346,93.985 216.823,94.187 216.35,94.426 215.935,94.699 215.586,95.001 215.308,95.327 215.106,95.67 214.983,96.027 214.942,96.389 214.983,96.751 215.106,97.107 215.308,97.451 215.586,97.777 215.935,98.079 216.35,98.352" data-semantic-id="edge:5"/>
+<polyline class="visible" points="275,89.028 275,77.25" data-semantic-id="edge:14"/>
+<polyline class="visible" points="232.5,52.712 164.5,91.972" data-semantic-id="edge:6"/>
+<polyline class="visible" points="232.5,64.49 164.5,103.75" data-semantic-id="edge:1"/>
+<polyline class="visible" points="275,77.25 232.5,52.712" data-semantic-id="edge:9"/>
+<polyline class="visible" points="275,89.028 232.5,64.49" data-semantic-id="edge:4"/>
+<polyline class="visible" points="232.5,64.49 232.5,52.712" data-semantic-id="edge:12"/>
+</g>
+<g data-annotation="annotation:Front:MountDiameter" data-semantic-reference="MountDiameter">
+<polyline class="leader" points="77.25,90.5 77.25,53.969"/>
+<rect x="59.8" y="47.969" width="34.9" height="6" fill="white" stroke="#374151" stroke-width=".18"/>
+<text class="annotation" x="61" y="51.969">Ø8 mm +0.05/-0.02</text>
+</g>
+<g data-annotation="annotation:Front:A" data-semantic-reference="A">
+<polyline class="leader" points="77.25,125.031 77.25,127.031"/>
+<rect x="68.25" y="127.031" width="18" height="6" fill="white" stroke="#374151" stroke-width=".18"/>
+<text class="annotation" x="69.45" y="131.031">A</text>
+</g>
+<text class="meta" x="10" y="195">DEBURR ALL EDGES</text>
+<text class="meta" x="10" y="199">DIMENSIONS AND TOLERANCES COME FROM THE SEMANTIC PRODUCT MODEL</text>
+<text class="meta" x="10" y="205">A4 Landscape · actual size · StandardMachinedDrawing · 2a731a10cc7aa3dd</text>
+</g>
+<g transform="translate(0 218)" data-page="2">
+<rect class="sheet" x="0" y="0" width="297" height="210"/>
+<text class="label" x="10" y="9">Bearing block production drawing</text>
+<text class="meta" x="287" y="9" text-anchor="end">BearingBlock · A · 2/2</text>
+<text class="label" x="10" y="23">BearingStandards</text>
+<rect x="10" y="26" width="55.4" height="7" fill="#e2e8f0" stroke="#64748b" stroke-width=".2"/>
+<text class="table-header" x="11" y="30.5">BoreDiameter</text>
+<rect x="65.4" y="26" width="55.4" height="7" fill="#e2e8f0" stroke="#64748b" stroke-width=".2"/>
+<text class="table-header" x="66.4" y="30.5">Depth</text>
+<rect x="120.8" y="26" width="55.4" height="7" fill="#e2e8f0" stroke="#64748b" stroke-width=".2"/>
+<text class="table-header" x="121.8" y="30.5">Height</text>
+<rect x="176.2" y="26" width="55.4" height="7" fill="#e2e8f0" stroke="#64748b" stroke-width=".2"/>
+<text class="table-header" x="177.2" y="30.5">Size</text>
+<rect x="231.6" y="26" width="55.4" height="7" fill="#e2e8f0" stroke="#64748b" stroke-width=".2"/>
+<text class="table-header" x="232.6" y="30.5">Width</text>
+<rect x="10" y="33" width="55.4" height="7" fill="white" stroke="#94a3b8" stroke-width=".18"/>
+<text class="table-cell" x="11" y="37.5">8mm</text>
+<rect x="65.4" y="33" width="55.4" height="7" fill="white" stroke="#94a3b8" stroke-width=".18"/>
+<text class="table-cell" x="66.4" y="37.5">12mm</text>
+<rect x="120.8" y="33" width="55.4" height="7" fill="white" stroke="#94a3b8" stroke-width=".18"/>
+<text class="table-cell" x="121.8" y="37.5">50mm</text>
+<rect x="176.2" y="33" width="55.4" height="7" fill="white" stroke="#94a3b8" stroke-width=".18"/>
+<text class="table-cell" x="177.2" y="37.5">BB080</text>
+<rect x="231.6" y="33" width="55.4" height="7" fill="white" stroke="#94a3b8" stroke-width=".18"/>
+<text class="table-cell" x="232.6" y="37.5">80mm</text>
+<rect x="10" y="40" width="55.4" height="7" fill="white" stroke="#94a3b8" stroke-width=".18"/>
+<text class="table-cell" x="11" y="44.5">10mm</text>
+<rect x="65.4" y="40" width="55.4" height="7" fill="white" stroke="#94a3b8" stroke-width=".18"/>
+<text class="table-cell" x="66.4" y="44.5">16mm</text>
+<rect x="120.8" y="40" width="55.4" height="7" fill="white" stroke="#94a3b8" stroke-width=".18"/>
+<text class="table-cell" x="121.8" y="44.5">60mm</text>
+<rect x="176.2" y="40" width="55.4" height="7" fill="white" stroke="#94a3b8" stroke-width=".18"/>
+<text class="table-cell" x="177.2" y="44.5">BB100</text>
+<rect x="231.6" y="40" width="55.4" height="7" fill="white" stroke="#94a3b8" stroke-width=".18"/>
+<text class="table-cell" x="232.6" y="44.5">100mm</text>
+<rect x="10" y="47" width="55.4" height="7" fill="white" stroke="#94a3b8" stroke-width=".18"/>
+<text class="table-cell" x="11" y="51.5">12mm</text>
+<rect x="65.4" y="47" width="55.4" height="7" fill="white" stroke="#94a3b8" stroke-width=".18"/>
+<text class="table-cell" x="66.4" y="51.5">20mm</text>
+<rect x="120.8" y="47" width="55.4" height="7" fill="white" stroke="#94a3b8" stroke-width=".18"/>
+<text class="table-cell" x="121.8" y="51.5">70mm</text>
+<rect x="176.2" y="47" width="55.4" height="7" fill="white" stroke="#94a3b8" stroke-width=".18"/>
+<text class="table-cell" x="177.2" y="51.5">BB120</text>
+<rect x="231.6" y="47" width="55.4" height="7" fill="white" stroke="#94a3b8" stroke-width=".18"/>
+<text class="table-cell" x="232.6" y="51.5">120mm</text>
+<text class="meta" x="10" y="205">A4 Landscape · actual size · StandardMachinedDrawing · 2a731a10cc7aa3dd</text>
+</g>
+</svg>
diff --git a/docs/drawing/artifacts/m0/BearingBlockProduction.validation.json b/docs/drawing/artifacts/m0/BearingBlockProduction.validation.json
new file mode 100644
index 00000000..f4e733bb
--- /dev/null
+++ b/docs/drawing/artifacts/m0/BearingBlockProduction.validation.json
@@ -0,0 +1,21 @@
+{
+ "success": true,
+ "schema": "aetheris-drawing-m0",
+ "authoritativeSource": "BearingBlock",
+ "pageCount": 2,
+ "a4Only": true,
+ "vectorPdf": true,
+ "rasterImages": 0,
+ "textModelCollisionsAfter": 0,
+ "textTextCollisionsAfter": 0,
+ "failedAnnotationCount": 0,
+ "drawingIrSha256": "178a90949e110ba2e33aabeece55d484ef29528738bb5b9510fdb0964c320fda",
+ "pdfSha256": "0a0156463c70816462169977a1e5789d1285e2cfad179a420912552751b9b8c2",
+ "measuredPerformance": {
+ "sourceCompileMilliseconds": 223.5779,
+ "projectionMilliseconds": 16.6961,
+ "layoutMilliseconds": 4.6768,
+ "renderMilliseconds": 4.2345,
+ "pdfMilliseconds": 4.6384
+ }
+}
\ No newline at end of file
diff --git a/docs/drawing/artifacts/m0/README.md b/docs/drawing/artifacts/m0/README.md
new file mode 100644
index 00000000..cc407508
--- /dev/null
+++ b/docs/drawing/artifacts/m0/README.md
@@ -0,0 +1,15 @@
+# Drawing M0 evidence
+
+Canonical source: `fixtures/DrawingM0/bearing-block-drawing.firmament`.
+
+Artifacts:
+
+- `BearingBlockProduction.drawing.json`: normalized DrawingIR with product/template/Table provenance, pages, projected primitives, annotation candidates, collision evidence, and lane occupancy;
+- `BearingBlockProduction.svg`: structured vector preview;
+- `BearingBlockProduction.pdf`: deterministic two-page vector A4 compilation target;
+- `BearingBlockProduction-page-1.png`: Poppler-rendered visual QA of the first page;
+- `BearingBlockProduction.validation.json`: collision, page-size, vector, hash, and measured performance evidence;
+- `pdf-proof.json`: independent Poppler page-size/metadata inspection;
+- `determinism.json`: repeated-compile hash proof.
+
+The design-table proof is page 2 and `pages[1].tables[0]` in DrawingIR. Every row comes directly from `Static Table BearingStandards`; the Drawing declaration contains no duplicated table cells.
diff --git a/docs/drawing/artifacts/m0/determinism.json b/docs/drawing/artifacts/m0/determinism.json
new file mode 100644
index 00000000..14570c22
--- /dev/null
+++ b/docs/drawing/artifacts/m0/determinism.json
@@ -0,0 +1,8 @@
+{
+ "repeatedCompiles": 2,
+ "sameDrawingIrSha256": true,
+ "samePdfSha256": true,
+ "drawingIrSha256": "178a90949e110ba2e33aabeece55d484ef29528738bb5b9510fdb0964c320fda",
+ "pdfSha256": "0a0156463c70816462169977a1e5789d1285e2cfad179a420912552751b9b8c2",
+ "volatileTimingsExcludedFromSemanticHash": true
+}
diff --git a/docs/drawing/artifacts/m0/pdf-proof.json b/docs/drawing/artifacts/m0/pdf-proof.json
new file mode 100644
index 00000000..6504a960
--- /dev/null
+++ b/docs/drawing/artifacts/m0/pdf-proof.json
@@ -0,0 +1,13 @@
+{
+ "tool": "Poppler pdfinfo",
+ "pdfVersion": "1.4",
+ "pages": 2,
+ "pageSizePoints": [841.89, 595.276],
+ "isoSize": "A4 landscape",
+ "title": "Bearing block production drawing",
+ "subject": "BearingBlock",
+ "creator": "Aetheris Drawing M0",
+ "encrypted": false,
+ "forms": "none",
+ "rasterImageXObjects": 0
+}
diff --git a/docs/drawing/drawing-m0.md b/docs/drawing/drawing-m0.md
new file mode 100644
index 00000000..b94ca522
--- /dev/null
+++ b/docs/drawing/drawing-m0.md
@@ -0,0 +1,31 @@
+# Drawing M0
+
+Drawing M0 compiles one manually specified machined-part drawing into deterministic DrawingIR, SVG, and a vector A4 PDF.
+
+```powershell
+aetheris drawing compile fixtures/DrawingM0/bearing-block-drawing.firmament --out-dir docs/drawing/artifacts/m0 --json
+```
+
+The canonical fixture proves a single lifecycle: one Static Table describes a bearing-block family; the selected product compiles as exact BRep with semantic hole diameter and datum PMI; a normal Drawing Template specializes for that product; two manual views project the BRep; PMI is explicitly assigned to the front view; candidate layout finds collision-free exterior lanes; the table flows to a second A4 page; and the vector PDF retains text and paths.
+
+Supported in M0:
+
+- ISO A4 portrait or landscape only;
+- multiple A4 pages, with design tables flowing to their own readable page;
+- orthographic and isometric direction vectors;
+- `VisibleOnly` and parsed `VisibleAndHidden` policy metadata;
+- datum, diameter, linear, and existing feature-control PMI presentation;
+- bilateral/asymmetric tolerance formatting from bound PMI;
+- real Static Table data and React `<table>` rendering;
+- deterministic specialization, layout, DrawingIR, SVG, and PDF;
+- typed unknown-PMI, missing-view, failed-Concept, and impossible-layout diagnostics.
+
+Current boundaries:
+
+- exact face-occlusion HLR is not implemented; hidden-line policy is recorded but hidden segment classification is not yet complete;
+- AssemblyIR occurrence projection/BOM is not admitted by this first part-only compiler;
+- section/detail views, radius PMI, note-to-feature leaders, GD&T beyond existing Firmament records, and automatic view/PMI selection are not implemented;
+- the React/MachinaLayout preview and native vector PDF backend consume the same DrawingIR, but PDF is not produced by browser-printing the React tree;
+- table overflow currently allocates a dedicated page but does not yet split one very large table across several pages.
+
+These limits are explicit so M0 is not mistaken for a complete ISO/ASME drafting implementation.
diff --git a/docs/drawing/pdf.md b/docs/drawing/pdf.md
new file mode 100644
index 00000000..07653541
--- /dev/null
+++ b/docs/drawing/pdf.md
@@ -0,0 +1,12 @@
+# Vector A4 PDF
+
+Drawing M0 uses a small deterministic PDF 1.4 backend. BRep projections, leaders, borders, and table rules remain PDF paths; metadata, labels, PMI, notes, and table values remain PDF text. No image XObjects or WebGL screenshots are emitted.
+
+Every page has an explicit `/MediaBox`:
+
+- landscape: `841.89 × 595.276 pt` = `297 × 210 mm`;
+- portrait: `595.276 × 841.89 pt` = `210 × 297 mm`.
+
+The PDF includes title, product subject, Aetheris author/creator/producer, fixed deterministic timestamps, page count, and actual-size footer text. The canonical PDF was checked with Poppler `pdfinfo` and rendered with `pdftoppm`; both pages are unclipped and readable at normal A4 scale. PDF hashes are stable because volatile performance timings are stored in validation evidence rather than semantic IR or PDF metadata.
+
+The React preview uses the same DrawingIR and real `<table>` document structure. PDF lowering is deliberately native rather than a browser automation dependency; this preserves deterministic physical sizing while the React/browser printing seam matures.
diff --git a/docs/drawing/pmi-layout.md b/docs/drawing/pmi-layout.md
new file mode 100644
index 00000000..1f030675
--- /dev/null
+++ b/docs/drawing/pmi-layout.md
@@ -0,0 +1,13 @@
+# Deterministic PMI layout
+
+PMI assignment is manual; placement is automatic. Each assigned semantic PMI item produces a finite ordered candidate set:
+
+- diameter, datum, and feature-control presentations first try NE/NW/SE/SW free-leader positions;
+- all annotations receive top, bottom, left, and right exterior lanes 1 through 3;
+- candidate cost is leader length plus a fixed lane-index penalty, page-edge penalty, and a stable ordinal tie-break.
+
+Annotation text is represented by a measured conservative rectangle. Projected model segments have segment bounds. Accepted candidates must be inside the view allocation, must not intersect a model segment, and must not intersect already accepted annotation bodies. Candidate ordering and first-admissible selection are deterministic. Thin leader/model or leader/leader crossings remain an explicitly allowed M0 fallback; text overlap never does.
+
+If every bounded candidate is rejected, compilation emits `drawing-layout-impossible`; it does not silently overlap. Table overflow uses another A4 page. Layout evidence in DrawingIR includes annotation count, before/after collision counts, lane occupancy, rejected candidates, and failures.
+
+The canonical artifact reports zero unresolved text/model and text/text collisions. JudgmentEngine is intentionally not used: M0 has one bounded deterministic heuristic, not competing interpretations that need general utility adjudication.
diff --git a/docs/drawing/templates.md b/docs/drawing/templates.md
new file mode 100644
index 00000000..22520f73
--- /dev/null
+++ b/docs/drawing/templates.md
@@ -0,0 +1,38 @@
+# Drawing concepts and templates
+
+There is no separate template subsystem. A Drawing Template is a Firmament Template whose result kind is `Drawing`.
+
+```firmament
+Concept Drawing MachinedPartDrawing {
+ Require PrimaryView
+ Require ManufacturingPmi
+ Require Material
+ Require DesignTable
+ Require RevisionMetadata
+}
+
+Template < Item: Product >
+Drawing StandardMachinedDrawing: MachinedPartDrawing {
+ Source: Item
+ Orientation: Landscape
+ Material: "6061-T6 aluminium"
+ Table: BearingStandards
+
+ View Front {
+ Direction: +Z
+ HiddenLines: VisibleOnly
+ PMI: [MountDiameter, A]
+ }
+ View Iso {
+ Direction: [1, 1, 1]
+ Projection: Isometric
+ PMI: []
+ }
+}
+
+Drawing BearingBlockProduction = StandardMachinedDrawing<Product: BearingBlock>
+```
+
+The application records source product identity, concept identity, template identity, argument map, Static Table sources, and a stable specialization identity. Concept `Require` checks communication structure rather than pixels. PMI lists contain names bound by the authoritative product `Pmi` block; they never contain replacement numeric values.
+
+The supported M0 concept requirements are `PrimaryView`, `ManufacturingPmi`, `Material`, `DesignTable`, and `RevisionMetadata`. Unknown requirements fail closed.
diff --git a/docs/firmament-v2/language-features.json b/docs/firmament-v2/language-features.json
index 658d79cc..303d155f 100644
--- a/docs/firmament-v2/language-features.json
+++ b/docs/firmament-v2/language-features.json
@@ -23,6 +23,7 @@
{"name":"PMI","keywords":["PMI","Datum","HoleDiameter","Distance","Flatness","Parallel","Perpendicular","Coplanar"],"status":"Experimental","produces":"bound PMI records","consumers":["AP242 datum/diameter export"],"docs":"language-reference.md#inlinestep-recognize-and-replace","evidence":["FirmamentV2Parser.cs","FirmamentPmiTests.cs"]},
{"name":"Forge concepts","keywords":[],"status":"Experimental","produces":"typed extension values/SemanticValues","consumers":["ForgeHost","Assembly"],"docs":"language-reference.md#forge","evidence":["FirmamentV2ForgeRuntime.cs","AssemblyM0Tests.cs"]},
{"name":"FEA Analysis","keywords":["Analysis","material","fixed","traction","force","pressure","results"],"status":"Supported","produces":"AnalysisIR","consumers":["FEA solver adapters"],"docs":"language-reference.md#fea-analysis-language","evidence":["FirmamentAnalysisCompiler.cs","Aetheris.FEA.Tests"]},
+ {"name":"Drawing","keywords":["Concept Drawing","Drawing","View","PMI","Orientation"],"status":"Bounded","produces":"DrawingIR, SVG, vector A4 PDF","consumers":["React/MachinaLayout preview","vector PDF backend"],"docs":"../drawing/drawing-m0.md","evidence":["FirmamentDrawingCompiler.cs","DrawingM0Tests.cs","bearing-block-drawing.firmament"]},
{"name":"Semantic group","keywords":["Semantic"],"status":"Supported","produces":"instance-scoped SemanticValue namespace","consumers":["Assembly Roles"],"docs":"language-reference.md#concepts-structs-and-semantic-exposure","evidence":["AssemblyM0Parser.cs","bearing-module.firmament"]},
{"name":"Interface Role","keywords":["Interface","Role","requires"],"status":"Supported","produces":"relational role contract","consumers":["Mate binder"],"docs":"language-reference.md#interfaces-mates-and-assemblies","evidence":["AssemblyM0Parser.cs","AssemblyM0Tests.cs"]},
{"name":"Lower Fit Allow","keywords":["Lower","Fit","Allow"],"status":"Supported","produces":"placement/dimensional consequences and admitted freedoms","consumers":["placement solver","tolerance graph"],"docs":"language-reference.md#interfaces-mates-and-assemblies","evidence":["AssemblyM0Compiler.cs","AssemblyM1Tests.cs"]},
diff --git a/docs/firmament-v2/language-reference.md b/docs/firmament-v2/language-reference.md
index 983de92f..5609a2b3 100644
--- a/docs/firmament-v2/language-reference.md
+++ b/docs/firmament-v2/language-reference.md
@@ -10,6 +10,8 @@ This is the canonical implementation-grounded reference for Firmament V2 as of A
Firmament is a deterministic, statically evaluated CAD authoring language. Source declarations bind names, units, immutable values, semantic contracts, selections, and construction intent. Compile-time Records, Tables, `with`, Templates, Match, Pattern, and `Require` are erased before feature AIR. Exact geometry lowers through bounded AIR/materializers to BRep and STEP AP242. Tolerance is symbolic engineering intent and does not perturb nominal geometry.
+**The 3D semantic model is the product definition. A Drawing is a printable projection of that definition, not a parallel source of engineering truth.** Drawing M0 adds bounded `Concept Drawing`, Drawing-returning `Template`, and `Drawing` specialization declarations. The Drawing compiler follows the Analysis/Assembly split-compiler pattern, binds `Source` to the module's authoritative Product, manually selected `View` directions and semantic PMI names, and lowers to DrawingIR plus A4 vector output. See [Drawing concepts and templates](../drawing/templates.md).
+
There are two current frontend lanes:
1. the canonical `Model { Units: mm ... }` V2 parser/binder; and
@@ -167,7 +169,7 @@ retains its structured private contributor chain.
| Status | Constructs |
|---|---|
-| Supported | Model, Units, primitive literals/types, let, Record, Static Record/Table/array, indexing, with, Concept, Concept Struct, Struct, Expose, Concept Path, Profile, Compose, bounded Modify/Hole/Pattern/EdgeFinish/Selection, Template, Match, Require, InlineStep, bounded Recognize/Replace, PMI datum/diameter binding, Analysis declarations, SemanticValue, Interface/Role/Lower/Fit/Allow, Assembly/Part/Anchor/Mate/Relation/Dimension/tol, Assert Volume, Assert ToleranceStackup |
+| Supported | Model, Units, primitive literals/types, let, Record, Static Record/Table/array, indexing, with, Concept, Concept Struct, Struct, Expose, Concept Path, Profile, Compose, bounded Modify/Hole/Pattern/EdgeFinish/Selection, Template, Match, Require, InlineStep, bounded Recognize/Replace, PMI datum/diameter binding, Analysis declarations, bounded Drawing declaration/Concept/Template specialization, SemanticValue, Interface/Role/Lower/Fit/Allow, Assembly/Part/Anchor/Mate/Relation/Dimension/tol, Assert Volume, Assert ToleranceStackup |
| Experimental | standalone/fill lattice routes, broader PMI controls/export, general Forge source invocation, some Slot/EdgeFinish/Boolean/placement routes, M1 Template Part syntax while the central grammar remains split |
| Internal-only | AIR/CIR/BRep plans, topology IDs, semantic source maps, Template expansion artifacts, Judgment/route machinery |
| Legacy/Deprecated | Firmament V1 TOON-style fixture syntax, `.firmasm`, transform-first assembly execution, legacy lowercase/alternate PMI spellings accepted for compatibility |
diff --git a/fixtures/DrawingM0/bearing-block-drawing.firmament b/fixtures/DrawingM0/bearing-block-drawing.firmament
new file mode 100644
index 00000000..7dd68fd6
--- /dev/null
+++ b/fixtures/DrawingM0/bearing-block-drawing.firmament
@@ -0,0 +1,75 @@
+Model BearingBlock {
+ Units: mm
+
+ Enum BearingSize { BB080 BB100 BB120 }
+ Record BearingStandard {
+ Size: BearingSize
+ Width: Length
+ Height: Length
+ Depth: Length
+ BoreDiameter: Length
+ }
+ Static Table BearingStandards: BearingStandard Key: Size {
+ Size: [BB080, BB100, BB120]
+ Width: [80mm, 100mm, 120mm]
+ Height: [50mm, 60mm, 70mm]
+ Depth: [12mm, 16mm, 20mm]
+ BoreDiameter: [8mm, 10mm, 12mm]
+ }
+ Box Base { Size: [80mm, 50mm, 12mm] }
+ Modify Base {
+ Hole<Shaft> Mount {
+ On: +Z
+ Center: Point2(0mm, 0mm)
+ Diameter: 8mm
+ End: ThroughAll
+ }
+ }
+ Require MountDiameterConstraint {
+ Actual: Mount.Diameter
+ Expected: 8mm
+ Tolerance: PlusMinus(0.05mm, 0.02mm)
+ }
+ Pmi {
+ Datum A { Target: face(+Z) }
+ HoleDiameter MountDiameter {
+ From: MountDiameterConstraint
+ As: HoleDiameter
+ DatumRefs: [A]
+ }
+ }
+
+ Concept Drawing MachinedPartDrawing {
+ Require PrimaryView
+ Require ManufacturingPmi
+ Require Material
+ Require DesignTable
+ Require RevisionMetadata
+ }
+
+ Template < Item: Product >
+ Drawing StandardMachinedDrawing: MachinedPartDrawing {
+ Source: Item
+ Orientation: Landscape
+ Title: "Bearing block production drawing"
+ PartNumber: "BB-080"
+ Revision: "A"
+ Material: "6061-T6 aluminium"
+ Table: BearingStandards
+ Notes: ["DEBURR ALL EDGES", "DIMENSIONS AND TOLERANCES COME FROM THE SEMANTIC PRODUCT MODEL"]
+
+ View Front {
+ Direction: +Z
+ HiddenLines: VisibleOnly
+ PMI: [MountDiameter, A]
+ }
+ View Iso {
+ Direction: [1, 1, 1]
+ Projection: Isometric
+ HiddenLines: VisibleOnly
+ PMI: []
+ }
+ }
+
+ Drawing BearingBlockProduction = StandardMachinedDrawing<Product: BearingBlock>
+}