Next Gen STEP AP242 Native-ish BREP Geometric Modeling Kernel
Add OpenUSD export for executable assemblies
Yuechen Lif7af9277e086
diff --git a/Aetheris.CLI.Tests/AssemblyUsdCommandTests.cs b/Aetheris.CLI.Tests/AssemblyUsdCommandTests.csnew file mode 100644index 00000000..ab80d095--- /dev/null+++ b/Aetheris.CLI.Tests/AssemblyUsdCommandTests.cs@@ -0,0 +1,26 @@+namespace Aetheris.CLI.Tests;++public sealed class AssemblyUsdCommandTests+{+ [Fact]+ public void RealCliExportsPosedSliderAndKeepsExistingOutputOnInvalidState()+ {+ var root = new DirectoryInfo(AppContext.BaseDirectory);+ while (root is not null && !File.Exists(Path.Combine(root.FullName, "Aetheris.slnx"))) root = root.Parent;+ Assert.NotNull(root);+ var fixture = Path.Combine(root!.FullName, "fixtures/Canonical/AssemblyInterfaces/external-step-slider.firmament");+ var output = Path.Combine(root.FullName, "artifacts/local/tests/usd", Guid.NewGuid().ToString("N") + ".usda");+ var stdout = new StringWriter(); var stderr = new StringWriter();+ var result = CliRunner.Run(["asm", "export-usd", fixture, output, "--state", "Travel=24", "--json"], stdout, stderr);+ Assert.True(result == 0, stderr.ToString());+ var valid = File.ReadAllText(output);+ Assert.Contains("PhysicsPrismaticJoint", valid);+ Assert.Contains("aetheris:state = 24", valid);+ foreach (var extra in new[] { new[] { "--state", "Typo=1" }, new[] { "--sample", "0:Travel=NaN" }, new[] { "--evidence", output } })+ {+ result = CliRunner.Run(["asm", "export-usd", fixture, output, .. extra], stdout, stderr);+ Assert.NotEqual(0, result);+ Assert.Equal(valid, File.ReadAllText(output));+ }+ }+}diff --git a/Aetheris.CLI/AssemblyUsdCommand.cs b/Aetheris.CLI/AssemblyUsdCommand.csnew file mode 100644index 00000000..190a7f46--- /dev/null+++ b/Aetheris.CLI/AssemblyUsdCommand.cs@@ -0,0 +1,91 @@+using System.Diagnostics;+using System.Globalization;+using System.Text.Json;+using Aetheris.Kernel.Firmament.Assembly;+using Aetheris.SheetMetal;++namespace Aetheris.CLI;++internal static class AssemblyUsdCommand+{+ internal const string Usage = "aetheris asm export-usd <assembly.firmament|assembly.firmasm> [out.usda] [--state Joint=value] [--sample time:Joint=value,Joint=value] [--materials appearance.json] [--evidence evidence.json] [--json]";++ internal static int Run(string[] args, TextWriter stdout, TextWriter stderr)+ {+ if (args.Length == 0 || args[0] is "--help" or "-h") { (args.Length == 0 ? stderr : stdout).WriteLine(Usage); return args.Length == 0 ? 1 : 0; }+ try+ {+ var path = args[0];+ var output = Path.Combine("artifacts", "local", "usd", Path.GetFileNameWithoutExtension(path) + ".usda");+ var state = new Dictionary<string, double>(StringComparer.Ordinal);+ var samples = new List<AssemblyUsdSample>();+ string? materialPath = null, evidencePath = null;+ var json = false;+ for (var i = 1; i < args.Length; i++)+ {+ if (i == 1 && !args[i].StartsWith('-')) output = args[i];+ else if (args[i] == "--json") json = true;+ else if (args[i] == "--state" && i + 1 < args.Length) ReadState(args[++i], state);+ else if (args[i] == "--sample" && i + 1 < args.Length)+ {+ var value = args[++i]; var colon = value.IndexOf(':');+ if (colon < 0) throw new ArgumentException("USD sample requires time:Joint=value,Joint=value.");+ var sampleState = new Dictionary<string, double>(StringComparer.Ordinal);+ ReadState(value[(colon + 1)..], sampleState);+ samples.Add(new(double.Parse(value[..colon], CultureInfo.InvariantCulture), sampleState));+ }+ else if (args[i] == "--materials" && i + 1 < args.Length) materialPath = args[++i];+ else if (args[i] == "--evidence" && i + 1 < args.Length) evidencePath = args[++i];+ else throw new ArgumentException("Unknown or incomplete USD option: " + args[i]);+ }+ if (!string.Equals(Path.GetExtension(output), ".usda", StringComparison.OrdinalIgnoreCase)) throw new ArgumentException("X0 writes readable .usda files; use external usdcat to convert to .usdc.");+ var materials = materialPath is null ? null : JsonSerializer.Deserialize<Dictionary<string, AssemblyUsdMaterial>>(File.ReadAllText(materialPath), new JsonSerializerOptions { PropertyNameCaseInsensitive = true });+ var compilation = Path.GetExtension(path).Equals(".firmasm", StringComparison.OrdinalIgnoreCase)+ ? new FirmamentAssemblyDocumentCompiler().CompileFile(path).Compilation+ : new AssemblyM1Pipeline().CompileFile(path, File.ReadAllText(path).Contains("Use SheetMetal.ProductFamilies", StringComparison.Ordinal) ? EnclosureProductFamilies.MaterializeAssemblyPart : null);+ if (!compilation.IsSuccess) throw new InvalidOperationException(string.Join("\n", compilation.Diagnostics.Select(d => d.Code + ": " + d.Message)));+ var pose = AssemblyKinematics.Evaluate(compilation.Ir!, state);+ var watch = Stopwatch.StartNew();+ var mesh = AssemblyDisplayMeshExporter.Export(compilation, pose: pose);+ var meshMilliseconds = watch.Elapsed.TotalMilliseconds;+ watch.Restart();+ var usd = AssemblyUsdExporter.Serialize(compilation.Ir!, mesh, new(state, samples, materials), pose.State);+ var serializationMilliseconds = watch.Elapsed.TotalMilliseconds;+ var fullOutput = Path.GetFullPath(output);+ if (fullOutput.Equals(Path.GetFullPath(path), StringComparison.OrdinalIgnoreCase)+ || (materialPath is not null && fullOutput.Equals(Path.GetFullPath(materialPath), StringComparison.OrdinalIgnoreCase)))+ throw new ArgumentException("USD output must differ from source inputs.");+ var fullEvidence = evidencePath is null ? null : Path.GetFullPath(evidencePath);+ if (fullEvidence is not null && (fullEvidence.Equals(fullOutput, StringComparison.OrdinalIgnoreCase)+ || fullEvidence.Equals(Path.GetFullPath(path), StringComparison.OrdinalIgnoreCase)+ || (materialPath is not null && fullEvidence.Equals(Path.GetFullPath(materialPath), StringComparison.OrdinalIgnoreCase))))+ throw new ArgumentException("Evidence output must differ from USD and source inputs.");+ Directory.CreateDirectory(Path.GetDirectoryName(fullOutput)!);+ File.WriteAllText(fullOutput, usd, new System.Text.UTF8Encoding(false));+ var report = new { success = true, output = fullOutput, units = "mm", metersPerUnit = .001, upAxis = "Z", handedness = "rightHanded", definitions = mesh.Definitions.Count,+ occurrences = mesh.Occurrences.Count, joints = compilation.Ir!.Joints?.Count ?? 0, samples = samples.Count,+ meshMilliseconds, serializationMilliseconds, bytes = new FileInfo(fullOutput).Length, state = pose.State };+ if (fullEvidence is not null)+ {+ Directory.CreateDirectory(Path.GetDirectoryName(fullEvidence)!);+ File.WriteAllText(fullEvidence, JsonSerializer.Serialize(new { report, mesh, joints = compilation.Ir.Joints, geometry = compilation.Geometry!.Artifact,+ samplePoses = samples.Select(s => new { s.Time, pose = AssemblyKinematics.Evaluate(compilation.Ir, s.State) }) }, CliRunner.JsonOptions));+ }+ stdout.WriteLine(json ? JsonSerializer.Serialize(report, CliRunner.JsonOptions) : $"USD exported: {fullOutput}; {mesh.Definitions.Count} shared definitions, {mesh.Occurrences.Count} occurrences.");+ return 0;+ }+ catch (Exception ex) when (ex is ArgumentException or InvalidOperationException or IOException or JsonException or FormatException or OverflowException)+ { stderr.WriteLine("assembly-usd-export-failed: " + ex.Message); return 1; }+ }++ private static void ReadState(string value, Dictionary<string, double> state)+ {+ foreach (var entry in value.Split(',', StringSplitOptions.RemoveEmptyEntries))+ {+ var pair = entry.Split('=');+ if (pair.Length != 2 || string.IsNullOrWhiteSpace(pair[0]) || !double.TryParse(pair[1], NumberStyles.Float, CultureInfo.InvariantCulture, out var scalar) || !double.IsFinite(scalar))+ throw new ArgumentException("USD state requires Joint=finite-value (degrees or mm).");+ if (!state.TryAdd(pair[0], scalar)) throw new ArgumentException("Duplicate USD state: " + pair[0]);+ }+ }+}diff --git a/Aetheris.CLI/CliRunner.cs b/Aetheris.CLI/CliRunner.csindex d04d3213..9310a0de 100644--- a/Aetheris.CLI/CliRunner.cs+++ b/Aetheris.CLI/CliRunner.cs@@ -3731,6 +3731,8 @@ Model CanonicalPanel {return RunAsmImportStep(args.Skip(1).ToArray(), stdout, stderr);if (string.Equals(args[0], "export-ap242", StringComparison.Ordinal))return RunAsmExportAp242(args.Skip(1).ToArray(), stdout, stderr);+ if (string.Equals(args[0], "export-usd", StringComparison.Ordinal))+ return AssemblyUsdCommand.Run(args.Skip(1).ToArray(), stdout, stderr);stderr.WriteLine($"Unknown asm subcommand '{args[0]}'.");stderr.WriteLine(AsmExecUsage);@@ -5403,6 +5405,7 @@ Model CanonicalPanel {stdout.WriteLine($" or: {AsmInspectUsage[7..]}");stdout.WriteLine($" or: {AsmImportStepUsage[7..]}");stdout.WriteLine($" or: {AsmExportAp242Usage[7..]}");+ stdout.WriteLine($" or: {AssemblyUsdCommand.Usage}");stdout.WriteLine();stdout.WriteLine("Options:");stdout.WriteLine(" --out <path> Required for 'asm export'; output directory for package artifacts.");diff --git a/Aetheris.Kernel.Core/Brep/Tessellation/DisplayTessellationResult.cs b/Aetheris.Kernel.Core/Brep/Tessellation/DisplayTessellationResult.csindex 35f98297..6c889dcc 100644--- a/Aetheris.Kernel.Core/Brep/Tessellation/DisplayTessellationResult.cs+++ b/Aetheris.Kernel.Core/Brep/Tessellation/DisplayTessellationResult.cs@@ -14,6 +14,7 @@ public enum DisplayMeshPipeline{LegacyTessellator,SurfaceMeshIr,+ StructuredSpline,}public enum DisplayFaceMeshSourcediff --git a/Aetheris.Kernel.Core/Brep/Tessellation/RectangularSplineDisplayTessellator.cs b/Aetheris.Kernel.Core/Brep/Tessellation/RectangularSplineDisplayTessellator.csnew file mode 100644index 00000000..82accddb--- /dev/null+++ b/Aetheris.Kernel.Core/Brep/Tessellation/RectangularSplineDisplayTessellator.cs@@ -0,0 +1,149 @@+using Aetheris.Kernel.Core.Geometry;+using Aetheris.Kernel.Core.Geometry.Curves;+using Aetheris.Kernel.Core.Geometry.Surfaces;+using Aetheris.Kernel.Core.Math;+using Aetheris.Kernel.Core.Topology;++namespace Aetheris.Kernel.Core.Brep.Tessellation;++/// <summary>+/// Bounded display lane for natural rectangular spline patches and convex planar caps.+/// Samples each source edge once; every face reuses those boundary positions. Arbitrary+/// trimmed splines, concave caps and holes remain outside this lane. Never alters BRep.+/// </summary>+public static class RectangularSplineDisplayTessellator+{+ private const double BoundaryTolerance = 1e-5;++ public static bool TryTessellate(BrepBody body, DisplayTessellationOptions options, out DisplayTessellationResult result)+ {+ result = default!;+ if (options.Validate().Count != 0 || options.MaximumSegments > 256+ || !body.Geometry.Surfaces.Any(s => s.Value.Kind == SurfaceGeometryKind.BSplineSurfaceWithKnots)+ || body.Geometry.Surfaces.Any(s => s.Value.Kind is not (SurfaceGeometryKind.Plane or SurfaceGeometryKind.BSplineSurfaceWithKnots))) return false;+ for (var segments = options.MinimumSegments; ; segments = int.Min(segments * 2, options.MaximumSegments))+ {+ if (!TryBuild(body, options, segments, out result, out var withinTolerance)) return false;+ if (withinTolerance) return true;+ if (segments == options.MaximumSegments) { result = default!; return false; }+ }+ }++ private static bool TryBuild(BrepBody body, DisplayTessellationOptions options, int segments,+ out DisplayTessellationResult result, out bool withinTolerance)+ {+ result = default!;+ withinTolerance = true;+ var edges = new Dictionary<EdgeId, Point3D[]>();+ foreach (var edge in body.Topology.Edges)+ {+ if (!body.Bindings.TryGetEdgeBinding(edge.Id, out var binding) || binding.TrimInterval is not { } interval+ || !body.TryGetEdgeCurveGeometry(edge.Id, out var curve)) return false;+ Func<double, Point3D>? evaluate = curve?.Kind switch+ {+ CurveGeometryKind.Line3 => curve.Line3!.Value.Evaluate,+ CurveGeometryKind.BSpline3 => curve.BSpline3!.Value.Evaluate,+ _ => null+ };+ if (evaluate is null) return false;+ var points = Enumerable.Range(0, segments + 1).Select(i => evaluate(interval.Start + (interval.End - interval.Start) * i / segments)).ToArray();+ if (!body.TryGetVertexPoint(edge.StartVertexId, out var start) || !body.TryGetVertexPoint(edge.EndVertexId, out var end)+ || (points[0] - start).Length > BoundaryTolerance || (points[^1] - end).Length > BoundaryTolerance) return false;+ points[0] = start; points[^1] = end;+ edges.Add(edge.Id, points);+ }+ var patches = new List<DisplayFaceMeshPatch>();+ foreach (var face in body.Topology.Faces.OrderBy(f => f.Id.Value))+ {+ if (!body.Bindings.TryGetFaceBinding(face.Id, out var binding) || !body.TryGetFaceSurfaceGeometry(face.Id, out var support)) return false;+ var loops = body.GetLoopIds(face.Id).ToArray();+ if (loops.Length != 1) return false;+ var coedges = body.GetCoedgeIds(loops[0]).Select(body.Topology.GetCoedge).ToArray();+ var sign = binding.Orientation.IsAlignedWithSurface ? 1d : -1d;+ if (support?.Plane is { } plane)+ {+ var boundary = coedges.SelectMany(c => (c.IsReversed ? edges[c.EdgeId].Reverse() : edges[c.EdgeId]).Take(segments)).ToArray();+ if (boundary.Length < 3) return false;+ var center = new Point3D(boundary.Average(p => p.X), boundary.Average(p => p.Y), boundary.Average(p => p.Z));+ var normal = plane.Normal.ToVector() * sign;+ // A centroid fan is admitted only for a strictly star-shaped convex cap.+ var winding = 0;+ for (var i = 0; i < boundary.Length; i++)+ {+ if (double.Abs((boundary[i] - plane.Origin).Dot(plane.Normal.ToVector())) > BoundaryTolerance) return false;+ var cross = (boundary[i] - center).Cross(boundary[(i + 1) % boundary.Length] - center).Dot(normal);+ if (double.Abs(cross) < 1e-12) return false;+ var direction = System.Math.Sign(cross);+ if (winding != 0 && winding != direction) return false;+ winding = direction;+ var a = boundary[(i + 1) % boundary.Length] - boundary[i];+ var b = boundary[(i + 2) % boundary.Length] - boundary[(i + 1) % boundary.Length];+ if (a.Cross(b).Dot(normal) * winding < -1e-8) return false;+ }+ var positions = boundary.Append(center).ToArray();+ var indices = new List<int>();+ for (var i = 0; i < boundary.Length; i++) AddTriangle(indices, boundary.Length, i, (i + 1) % boundary.Length, positions, normal);+ patches.Add(new(face.Id, positions, Enumerable.Repeat(normal, positions.Length).ToArray(), indices));+ continue;+ }+ if (support?.BSplineSurfaceWithKnots is not { } spline || coedges.Length != 4) return false;+ Point3D Evaluate(double u, double v) => spline.Evaluate(spline.DomainStartU + (spline.DomainEndU - spline.DomainStartU) * u,+ spline.DomainStartV + (spline.DomainEndV - spline.DomainStartV) * v);+ Vector3D Normal(double u, double v)+ {+ const double h = 1e-5;+ var du = Evaluate(double.Min(1, u + h), v) - Evaluate(double.Max(0, u - h), v);+ var dv = Evaluate(u, double.Min(1, v + h)) - Evaluate(u, double.Max(0, v - h));+ if (!du.TryNormalize(out du) || !dv.TryNormalize(out dv) || !du.Cross(dv).TryNormalize(out var n)) return default;+ return n * sign;+ }+ var pointsGrid = new Point3D[(segments + 1) * (segments + 1)];+ var normals = new Vector3D[pointsGrid.Length];+ int Id(int u, int v) => v * (segments + 1) + u;+ for (var v = 0; v <= segments; v++) for (var u = 0; u <= segments; u++)+ {+ pointsGrid[Id(u, v)] = Evaluate((double)u / segments, (double)v / segments);+ normals[Id(u, v)] = Normal((double)u / segments, (double)v / segments);+ if (normals[Id(u, v)].Length < .5) return false;+ }+ var sides = new[] {+ Enumerable.Range(0,segments+1).Select(i=>Id(i,0)).ToArray(),+ Enumerable.Range(0,segments+1).Select(i=>Id(segments,i)).ToArray(),+ Enumerable.Range(0,segments+1).Select(i=>Id(i,segments)).ToArray(),+ Enumerable.Range(0,segments+1).Select(i=>Id(0,i)).ToArray() };+ var used = new HashSet<EdgeId>();+ foreach (var side in sides)+ {+ var matched = false;+ foreach (var coedge in coedges.Where(c => !used.Contains(c.EdgeId)))+ {+ var edge = edges[coedge.EdgeId];+ var reverse = (pointsGrid[side[0]] - edge[^1]).Length < BoundaryTolerance;+ if (side.Where((id, i) => (pointsGrid[id] - edge[reverse ? segments - i : i]).Length > BoundaryTolerance).Any()) continue;+ for (var i = 0; i <= segments; i++) pointsGrid[side[i]] = edge[reverse ? segments - i : i];+ used.Add(coedge.EdgeId); matched = true; break;+ }+ if (!matched) return false;+ }+ var triangles = new List<int>();+ for (var v = 0; v < segments; v++) for (var u = 0; u < segments; u++)+ {+ var a = Id(u, v); var b = Id(u + 1, v); var c = Id(u + 1, v + 1); var d = Id(u, v + 1);+ var midpoint = Evaluate((u + .5) / segments, (v + .5) / segments);+ var linear = pointsGrid[a] + (pointsGrid[c] - pointsGrid[a]) * .5;+ var normal = Normal((u + .5) / segments, (v + .5) / segments);+ if ((midpoint - linear).Length > options.ChordTolerance || new[] { a, b, c, d }.Any(i => normals[i].Dot(normal) < double.Cos(options.AngularToleranceRadians))) withinTolerance = false;+ AddTriangle(triangles, a, b, c, pointsGrid, normal); AddTriangle(triangles, a, c, d, pointsGrid, normal);+ }+ patches.Add(new(face.Id, pointsGrid, normals, triangles));+ }+ result = new(patches, edges.Select(e => new DisplayEdgePolyline(e.Key, e.Value, false)).ToArray(), MeshPipeline: DisplayMeshPipeline.StructuredSpline);+ return true;+ }++ private static void AddTriangle(List<int> indices, int a, int b, int c, IReadOnlyList<Point3D> points, Vector3D normal)+ {+ if ((points[b] - points[a]).Cross(points[c] - points[a]).Dot(normal) < 0) (b, c) = (c, b);+ indices.Add(a); indices.Add(b); indices.Add(c);+ }+}diff --git a/Aetheris.Kernel.Firmament.Tests/Assembly/AssemblyUsdExportTests.cs b/Aetheris.Kernel.Firmament.Tests/Assembly/AssemblyUsdExportTests.csnew file mode 100644index 00000000..61350000--- /dev/null+++ b/Aetheris.Kernel.Firmament.Tests/Assembly/AssemblyUsdExportTests.cs@@ -0,0 +1,113 @@+using Aetheris.Kernel.Firmament.Assembly;++namespace Aetheris.Kernel.Firmament.Tests.Assembly;++public sealed class AssemblyUsdExportTests+{+ [Fact]+ public void IndustrialSplineHousingsHaveClosedMeshesAndOutwardNormals()+ {+ var compiled = Compile("IndustrialAtlas/atlas-industrial.firmament");+ var mesh = AssemblyDisplayMeshExporter.Export(compiled);+ var housings = mesh.Definitions.Where(d => d.Identity.StartsWith("SectionChainFile", StringComparison.Ordinal)).ToArray();+ Assert.Equal(2, housings.Length);+ foreach (var housing in housings)+ {+ Assert.Equal("StructuredSpline", housing.MeshPipeline);+ var edges = new Dictionary<(string, string), int>();+ string Point(int i) => string.Join(",", housing.Positions.Skip(i * 3).Take(3).Select(v => Math.Round(v, 7).ToString("G17", System.Globalization.CultureInfo.InvariantCulture)));+ Aetheris.Kernel.Core.Math.Point3D Position(int i) => new(housing.Positions[i*3],housing.Positions[i*3+1],housing.Positions[i*3+2]);+ var volume = 0d;+ for (var t = 0; t < housing.Indices.Length; t += 3)+ {+ var ids = housing.Indices.Skip(t).Take(3).ToArray();+ for (var i = 0; i < 3; i++)+ {+ var a = Point(ids[i]); var b = Point(ids[(i+1)%3]);+ var edge = string.CompareOrdinal(a,b) < 0 ? (a,b) : (b,a);+ edges[edge] = edges.GetValueOrDefault(edge) + 1;+ }+ var pa = Position(ids[0]); var pb = Position(ids[1]); var pc = Position(ids[2]);+ var cross = (pb-pa).Cross(pc-pa);+ var normal = new Aetheris.Kernel.Core.Math.Vector3D(housing.Normals[ids[0]*3],housing.Normals[ids[0]*3+1],housing.Normals[ids[0]*3+2]);+ Assert.True(cross.Dot(normal) > 0, "Triangle winding must agree with the outward face normal.");+ volume += (pa - new Aetheris.Kernel.Core.Math.Point3D(0,0,0)).Dot((pb-new Aetheris.Kernel.Core.Math.Point3D(0,0,0)).Cross(pc-new Aetheris.Kernel.Core.Math.Point3D(0,0,0))) / 6;+ }+ Assert.All(edges.Values, uses => Assert.Equal(2, uses));+ Assert.True(volume > 0, "Closed product mesh must enclose positive volume.");+ }+ Assert.Equal(24, mesh.Definitions.Count);+ Assert.Equal(64, mesh.Occurrences.Count);+ Assert.Equal(59, compiled.Ir!.Joints!.Count);+ }++ [Fact]+ public void PosedArmReusesGeometryAndSerializesDeterministicallyAcrossCultures()+ {+ var compiled = Compile("two-link-arm-usd.firmament");+ var state = new Dictionary<string, double> { ["Shoulder"] = 35, ["Elbow"] = 65 };+ var pose = AssemblyKinematics.Evaluate(compiled.Ir!, state);+ var mesh = AssemblyDisplayMeshExporter.Export(compiled, pose: pose);+ var options = new AssemblyUsdOptions(state, [new(0, new Dictionary<string, double>()), new(48, state)]);+ var source = AssemblyUsdExporter.Serialize(compiled.Ir!, mesh, options, pose.State);+ var originalCulture = System.Globalization.CultureInfo.CurrentCulture;+ try+ {+ System.Globalization.CultureInfo.CurrentCulture = System.Globalization.CultureInfo.GetCultureInfo("fr-FR");+ Assert.Equal(source, AssemblyUsdExporter.Export(compiled, options));+ }+ finally { System.Globalization.CultureInfo.CurrentCulture = originalCulture; }+ Assert.Equal(2, mesh.Definitions.Count);+ Assert.Contains("metersPerUnit = 0.001", source);+ Assert.Contains("upAxis = \"Z\"", source);+ Assert.Contains("PhysicsRevoluteJoint", source);+ Assert.Contains("quatd xformOp:orient.timeSamples", source);+ Assert.DoesNotContain("matrix4d xformOp:transform.timeSamples", source);+ Assert.Equal(3, source.Split("instanceable = true").Length - 1);+ }++ [Fact]+ public void ImportedSliderAndNestedDemoKeepEveryAcceptedJointFamily()+ {+ var slider = Compile("external-step-slider.firmament");+ Assert.Single(slider.Geometry!.DefinitionBodies);+ Assert.Contains("PhysicsPrismaticJoint", AssemblyUsdExporter.Export(slider, new(new Dictionary<string, double> { ["Travel"] = 24 })));+ var occtSlider = Compile("external-occt-slider-usd.firmament");+ Assert.Single(occtSlider.Geometry!.DefinitionBodies);+ Assert.Contains("PhysicsPrismaticJoint", AssemblyUsdExporter.Export(occtSlider));+ var fixedNested = Compile("fixed-nested-usd.firmament");+ Assert.Single(fixedNested.Geometry!.DefinitionBodies);+ Assert.Contains("PhysicsFixedJoint", AssemblyUsdExporter.Export(fixedNested));+ var demo = Compile("physical-ai-demo.firmament");+ var usd = AssemblyUsdExporter.Export(demo);+ Assert.Contains("PhysicsFixedJoint", usd);+ Assert.Contains("PhysicsRevoluteJoint", usd);+ Assert.Contains("PhysicsPrismaticJoint", usd);+ Assert.Contains("aetheris:sourcePath = \"Atlas.UpperArm.Housing\"", usd);+ Assert.Equal(6, demo.Geometry!.DefinitionBodies.Count);+ Assert.Equal(8, demo.Ir!.Joints!.Count);+ }++ [Fact]+ public void InvalidStateSamplesUnitsAndReflectionFailBeforeSerialization()+ {+ var compiled = Compile("two-link-arm-usd.firmament");+ Assert.Throws<InvalidOperationException>(() => AssemblyUsdExporter.Export(compiled, new(new Dictionary<string, double> { ["Typo"] = 1 })));+ Assert.Throws<InvalidOperationException>(() => AssemblyUsdExporter.Export(compiled, new(Samples: [new(0, new Dictionary<string, double>()), new(0, new Dictionary<string, double>())])));+ Assert.Throws<InvalidOperationException>(() => AssemblyUsdExporter.Export(compiled, new(Samples: [new(0, new Dictionary<string, double> { ["Shoulder"] = double.NaN })])));+ var mesh = AssemblyDisplayMeshExporter.Export(compiled);+ Assert.Throws<InvalidOperationException>(() => AssemblyUsdExporter.Serialize(compiled.Ir!, mesh with { Units = "m" }));+ Assert.Throws<InvalidOperationException>(() => AssemblyUsdExporter.Serialize(compiled.Ir!, mesh, new(new Dictionary<string, double> { ["Shoulder"] = 45 })));+ Assert.Throws<InvalidOperationException>(() => AssemblyUsdExporter.Export(compiled,+ new(DefinitionMaterials: new Dictionary<string, AssemblyUsdMaterial> { ["Typo"] = new() })));+ var reflected = mesh.Occurrences.Select((o, i) => i != 0 ? o : o with { Transform = [-1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1] }).ToArray();+ Assert.Throws<InvalidOperationException>(() => AssemblyUsdExporter.Serialize(compiled.Ir!, mesh with { Occurrences = reflected }));+ }++ private static AssemblyM1CompilationResult Compile(string fixture)+ {+ var result = new AssemblyM1Pipeline().CompileFile(FirmamentCorpusHarness.ResolveFixtureFullPath("fixtures/Canonical/AssemblyInterfaces/" + fixture));+ Assert.True(result.IsSuccess, string.Join("\n", result.Diagnostics.Select(d => d.Code + ": " + d.Message)));+ return result;+ }+}diff --git a/Aetheris.Kernel.Firmament/Assembly/AssemblyDisplayMeshExporter.cs b/Aetheris.Kernel.Firmament/Assembly/AssemblyDisplayMeshExporter.csindex 1f9c3eb8..fad4c8f0 100644--- a/Aetheris.Kernel.Firmament/Assembly/AssemblyDisplayMeshExporter.cs+++ b/Aetheris.Kernel.Firmament/Assembly/AssemblyDisplayMeshExporter.cs@@ -55,7 +55,11 @@ public static class AssemblyDisplayMeshExportervar useSurfaceMeshIr = body.Topology.Faces.All(face =>body.TryGetFaceSurfaceGeometry(face.Id, out var surface)&& surface?.Kind is SurfaceGeometryKind.Plane or SurfaceGeometryKind.Cylinder);- var tessellation = useSurfaceMeshIr+ var structuredSpline = !useSurfaceMeshIr && RectangularSplineDisplayTessellator.TryTessellate(body, effectiveOptions, out var splineMesh)+ ? splineMesh : null;+ var tessellation = structuredSpline is not null+ ? Aetheris.Kernel.Core.Results.KernelResult<DisplayTessellationResult>.Success(structuredSpline)+ : useSurfaceMeshIr? BrepDisplayTessellator.TessellateSurfaceMeshIr(body, effectiveOptions): BrepDisplayTessellator.TessellateBounded(body, effectiveOptions);if (!tessellation.IsSuccess || tessellation.Value.FacePatches.Count != body.Topology.Faces.Count())diff --git a/Aetheris.Kernel.Firmament/Assembly/AssemblyUsdExporter.cs b/Aetheris.Kernel.Firmament/Assembly/AssemblyUsdExporter.csnew file mode 100644index 00000000..daccb219--- /dev/null+++ b/Aetheris.Kernel.Firmament/Assembly/AssemblyUsdExporter.cs@@ -0,0 +1,205 @@+using System.Globalization;+using System.Text;+using System.Text.Json;+using Aetheris.Kernel.Core.Math;++namespace Aetheris.Kernel.Firmament.Assembly;++/// <summary>Downstream preview appearance, never engineering material or density authority.</summary>+public sealed record AssemblyUsdMaterial(double Red = .48, double Green = .55, double Blue = .63,+ double Metallic = .8, double Roughness = .28);+public sealed record AssemblyUsdSample(double Time, IReadOnlyDictionary<string, double> State);+public sealed record AssemblyUsdOptions(IReadOnlyDictionary<string, double>? State = null,+ IReadOnlyList<AssemblyUsdSample>? Samples = null,+ IReadOnlyDictionary<string, AssemblyUsdMaterial>? DefinitionMaterials = null);++/// <summary>Bounded USDA lowering of the accepted assembly and production display mesh.+/// STEP/BRep and the Interface compiler remain authoritative. No USD dependency or solver.</summary>+public static class AssemblyUsdExporter+{+ public static string Export(AssemblyM1CompilationResult compilation, AssemblyUsdOptions? options = null)+ {+ options ??= new();+ if (!compilation.IsSuccess || compilation.Ir is null) throw new InvalidOperationException("assembly-usd-invalid-compilation");+ var pose = AssemblyKinematics.Evaluate(compilation.Ir, options.State ?? new Dictionary<string, double>());+ var mesh = AssemblyDisplayMeshExporter.Export(compilation, pose: pose);+ return Serialize(compilation.Ir, mesh, options, pose.State);+ }++ /// <summary>Serialize already prepared geometry; useful for repeated poses without tessellating again.</summary>+ public static string Serialize(AssemblyIr ir, AssemblyDisplayMeshDocument mesh, AssemblyUsdOptions? options = null,+ IReadOnlyDictionary<string, double>? evaluatedState = null)+ {+ options ??= new();+ if (mesh.Units != "mm" || mesh.Occurrences.Count != ir.Instances.Count+ || !mesh.Occurrences.Select(o => o.Id).ToHashSet(StringComparer.Ordinal).SetEquals(ir.Instances.Select(i => i.StableId)))+ throw new InvalidOperationException("assembly-usd-document-mismatch");+ var occurrences = mesh.Occurrences.ToDictionary(o => o.Id, StringComparer.Ordinal);+ var definitions = mesh.Definitions.OrderBy(d => d.Id, StringComparer.Ordinal).ToArray();+ var declaredPose = AssemblyKinematics.Evaluate(ir, evaluatedState ?? options.State ?? new Dictionary<string, double>());+ if (!declaredPose.IsSuccess || declaredPose.Instances.Any(instance => instance.ResolvedTransform is null+ || occurrences[instance.StableId].Transform.Length != 16+ || occurrences[instance.StableId].Transform.Any(value => !double.IsFinite(value))+ || occurrences[instance.StableId].Transform.Zip(instance.ResolvedTransform.Matrix, (a,b) => Math.Abs(a-b)).Any(delta => delta > 1e-9)))+ throw new InvalidOperationException("assembly-usd-mesh-state-mismatch");+ if (options.DefinitionMaterials is not null && options.DefinitionMaterials.Keys.Any(identity => !definitions.Any(d => d.Identity == identity)))+ throw new InvalidOperationException("assembly-usd-material-definition-unknown");+ var paths = new Dictionary<string, string>(StringComparer.Ordinal);+ // Sibling ordinal suffixes preserve every identity even when USD sanitization collides.+ void Assign(string id, string path)+ {+ paths.Add(id, path);+ var children = mesh.Occurrences.Where(o => o.ParentId == id).OrderBy(o => o.Path, StringComparer.Ordinal).ToArray();+ for (var i = 0; i < children.Length; i++) Assign(children[i].Id, path + "/" + Identifier(children[i].Path.Split('.').Last()) + "_" + i);+ }+ Assign(ir.RootInstanceStableId, "/Assembly");+ if (paths.Count != occurrences.Count) throw new InvalidOperationException("assembly-usd-invalid-hierarchy");+ var definitionPaths = definitions.Select((d, i) => (d.Id, Path: "/Definitions/D_" + i)).ToDictionary(p => p.Id, p => p.Path);+ var samples = (options.Samples ?? []).OrderBy(s => s.Time).ToArray();+ if (samples.Any(s => !double.IsFinite(s.Time)) || samples.Select(s => s.Time).Distinct().Count() != samples.Length)+ throw new InvalidOperationException("assembly-usd-invalid-sample-time");+ var poses = samples.Select(s => (s.Time, Pose: AssemblyKinematics.Evaluate(ir, s.State))).ToArray();+ if (poses.Any(p => !p.Pose.IsSuccess)) throw new InvalidOperationException("assembly-usd-invalid-sample-state");+ var text = new StringBuilder();+ void Line(string value = "") => text.Append(value).Append('\n');+ Line("#usda 1.0");+ Line("("); Line(" defaultPrim = \"Assembly\""); Line(" metersPerUnit = 0.001"); Line(" upAxis = \"Z\"");+ if (samples.Length > 0)+ { Line($" startTimeCode = {F(samples[0].Time)}"); Line($" endTimeCode = {F(samples[^1].Time)}"); Line(" timeCodesPerSecond = 24"); }+ Line(")");+ Line("class Scope \"Definitions\" {");+ for (var i = 0; i < definitions.Length; i++)+ {+ var d = definitions[i];+ if (d.Positions.Length == 0 || d.Positions.Length % 3 != 0 || d.Normals.Length != d.Positions.Length+ || d.Indices.Length == 0 || d.Indices.Length % 3 != 0 || d.Indices.Any(n => n < 0 || n >= d.Positions.Length / 3))+ throw new InvalidOperationException("assembly-usd-invalid-mesh:" + d.Identity);+ Line($" def Xform \"D_{i}\" {{");+ Line($" custom string aetheris:definitionIdentity = {Q(d.Identity)}");+ Line($" def Mesh \"Mesh\" (prepend apiSchemas = [\"MaterialBindingAPI\"]) {{");+ Line(" uniform token subdivisionScheme = \"none\""); Line(" uniform token orientation = \"rightHanded\"");+ Line($" point3f[] points = {Vectors(d.Positions)}");+ Line($" normal3f[] normals = {Vectors(d.Normals)} (interpolation = \"vertex\")");+ Line($" int[] faceVertexCounts = [{string.Join(", ", Enumerable.Repeat("3", d.Indices.Length / 3))}]");+ Line($" int[] faceVertexIndices = [{string.Join(", ", d.Indices)}]");+ Line($" rel material:binding = </Looks/M_{i}>");+ var material = options.DefinitionMaterials?.GetValueOrDefault(d.Identity) ?? new();+ ValidateMaterial(material);+ Line($" color3f[] primvars:displayColor = [({F(material.Red)}, {F(material.Green)}, {F(material.Blue)})]");+ Line(" }"); Line(" }");+ }+ Line("}"); Line("def Scope \"Looks\" {");+ for (var i = 0; i < definitions.Length; i++)+ {+ var m = options.DefinitionMaterials?.GetValueOrDefault(definitions[i].Identity) ?? new();+ Line($" def Material \"M_{i}\" {{");+ Line($" token outputs:surface.connect = </Looks/M_{i}/Shader.outputs:surface>");+ Line(" def Shader \"Shader\" {"); Line(" uniform token info:id = \"UsdPreviewSurface\"");+ Line($" color3f inputs:diffuseColor = ({F(m.Red)}, {F(m.Green)}, {F(m.Blue)})");+ Line($" float inputs:metallic = {F(m.Metallic)}"); Line($" float inputs:roughness = {F(m.Roughness)}");+ Line(" token outputs:surface"); Line(" }"); Line(" }");+ }+ Line("}");+ var joints = ir.Joints ?? [];+ var bodies = joints.SelectMany(j => new[] { j.ParentOccurrenceId, j.ChildOccurrenceId }).ToHashSet();+ void WriteOccurrence(string id, int depth)+ {+ var o = occurrences[id]; var indent = new string(' ', depth * 4);+ var api = new List<string>();+ if (id == ir.RootInstanceStableId && joints.Count > 0) api.Add("PhysicsArticulationRootAPI");+ if (bodies.Contains(id)) api.Add("PhysicsRigidBodyAPI");+ Line($"{indent}def Xform {Q(paths[id].Split('/').Last())}" + (api.Count == 0 ? "" : $" (prepend apiSchemas = [{string.Join(", ", api.Select(Q))}])") + " {");+ Line($"{indent} custom string aetheris:occurrenceIdentity = {Q(id)}");+ Line($"{indent} custom string aetheris:sourcePath = {Q(o.Path)}");+ Line($"{indent} custom string aetheris:definitionIdentity = {Q(ir.Instances.Single(i => i.StableId == id).DefinitionIdentity)}");+ if (bodies.Contains(id)) { Line($"{indent} bool physics:rigidBodyEnabled = true"); Line($"{indent} bool physics:kinematicEnabled = true"); }+ if (id == ir.RootInstanceStableId) Line($"{indent} custom string aetheris:sourceName = {Q(ir.Name)}");+ double[] Local(double[] world, double[]? parent) => parent is null ? world :+ (Transform3D.FromRowMajor(world) * Transform3D.FromRowMajor(parent).Inverse()).ToRowMajor();+ var local = Local(o.Transform, o.ParentId is null ? null : occurrences[o.ParentId].Transform);+ Line($"{indent} double3 xformOp:translate = {Translation(local)}");+ Line($"{indent} quatd xformOp:orient = {Quaternion(local)}");+ Line($"{indent} uniform token[] xformOpOrder = [\"xformOp:translate\", \"xformOp:orient\"]");+ if (poses.Length > 0)+ {+ var localSamples = new List<(double Time, double[] Matrix)>();+ foreach (var p in poses)+ {+ var instance = p.Pose.Instances.Single(i => i.StableId == id);+ var parent = o.ParentId is null ? null : p.Pose.Instances.Single(i => i.StableId == o.ParentId).ResolvedTransform!.Matrix;+ localSamples.Add((p.Time, Local(instance.ResolvedTransform!.Matrix, parent)));+ }+ Line($"{indent} double3 xformOp:translate.timeSamples = {{");+ foreach (var s in localSamples) Line($"{indent} {F(s.Time)}: {Translation(s.Matrix)},");+ Line($"{indent} }}");+ Line($"{indent} quatd xformOp:orient.timeSamples = {{");+ foreach (var s in localSamples) Line($"{indent} {F(s.Time)}: {Quaternion(s.Matrix)},");+ Line($"{indent} }}");+ }+ if (o.DefinitionId is not null)+ {+ Line($"{indent} def Xform \"Geometry\" (prepend references = <{definitionPaths[o.DefinitionId]}>; instanceable = true) {{}}");+ }+ foreach (var child in mesh.Occurrences.Where(c => c.ParentId == id).OrderBy(c => c.Path, StringComparer.Ordinal)) WriteOccurrence(child.Id, depth + 1);+ Line(indent + "}");+ }+ WriteOccurrence(ir.RootInstanceStableId, 0);+ Line("def Scope \"Joints\" {");+ foreach (var (j, i) in joints.OrderBy(j => j.Name, StringComparer.Ordinal).Select((j, i) => (j, i)))+ {+ var type = j.Family switch { MechanicalInterfaceFamily.Fixed => "PhysicsFixedJoint", MechanicalInterfaceFamily.Revolute => "PhysicsRevoluteJoint", MechanicalInterfaceFamily.Prismatic => "PhysicsPrismaticJoint", _ => throw new InvalidOperationException("assembly-usd-unsupported-joint") };+ Line($" def {type} {Q(Identifier(j.Name) + "_" + i)} {{");+ Line($" rel physics:body0 = <{paths[j.ParentOccurrenceId]}>"); Line($" rel physics:body1 = <{paths[j.ChildOccurrenceId]}>");+ if (j.DegreesOfFreedom == 1) Line(" uniform token physics:axis = \"Z\"");+ void Frame(int n, AssemblyTransform frame)+ {+ var m = frame.Matrix;+ Line($" point3f physics:localPos{n} = ({F(m[12])}, {F(m[13])}, {F(m[14])})");+ Line($" quatf physics:localRot{n} = {Quaternion(m)}");+ Line($" custom matrix4d aetheris:zeroFrame{n} = {Matrix(m)}");+ }+ Frame(0, j.ParentLocalFrame); Frame(1, j.ChildLocalFrame);+ Line($" custom string aetheris:interfaceName = {Q(j.Name)}"); Line($" custom string aetheris:interfaceFamily = {Q(j.Family.ToString())}");+ Line($" custom string aetheris:parentOccurrence = {Q(j.ParentOccurrenceId)}"); Line($" custom string aetheris:childOccurrence = {Q(j.ChildOccurrenceId)}");+ Line($" custom string aetheris:parentFrameSemantic = {Q(j.ParentFrameSemanticId)}"); Line($" custom string aetheris:childFrameSemantic = {Q(j.ChildFrameSemanticId)}");+ Line($" custom double aetheris:zeroState = {F(j.DefaultState)}");+ Line($" custom double aetheris:state = {F((evaluatedState ?? options.State)?.GetValueOrDefault(j.Name, j.DefaultState) ?? j.DefaultState)}");+ Line($" custom token aetheris:stateUnit = {Q(j.Family == MechanicalInterfaceFamily.Revolute ? "degree" : j.Family == MechanicalInterfaceFamily.Prismatic ? "mm" : "fixed")}");+ if (poses.Length > 0)+ { Line(" custom double aetheris:state.timeSamples = {"); foreach (var p in poses) Line($" {F(p.Time)}: {F(p.Pose.State.GetValueOrDefault(j.Name, j.DefaultState))},"); Line(" }"); }+ Line(" }");+ }+ Line("}");+ return text.ToString();+ }++ private static void ValidateMaterial(AssemblyUsdMaterial m)+ {+ if (new[] { m.Red, m.Green, m.Blue, m.Metallic, m.Roughness }.Any(v => !double.IsFinite(v) || v < 0 || v > 1))+ throw new InvalidOperationException("assembly-usd-invalid-material");+ }+ private static string Identifier(string value) => "N_" + new string(value.Select(c => char.IsAsciiLetterOrDigit(c) || c == '_' ? c : '_').ToArray());+ private static string Q(string value) => JsonSerializer.Serialize(value);+ private static string F(double value) => double.IsFinite(value) ? value.ToString("G17", CultureInfo.InvariantCulture) : throw new InvalidOperationException("assembly-usd-nonfinite");+ private static string Vectors(double[] values) => "[" + string.Join(", ", Enumerable.Range(0, values.Length / 3).Select(i => $"({F(values[3*i])}, {F(values[3*i+1])}, {F(values[3*i+2])})")) + "]";+ private static string Translation(double[] m) => $"({F(m[12])}, {F(m[13])}, {F(m[14])})";+ private static string Matrix(double[] m)+ {+ var t = Transform3D.FromRowMajor(m);+ if (t.Apply(new Vector3D(1,0,0)).Cross(t.Apply(new Vector3D(0,1,0))).Dot(t.Apply(new Vector3D(0,0,1))) < 0)+ throw new InvalidOperationException("assembly-usd-left-handed-transform");+ return "(" + string.Join(", ", Enumerable.Range(0, 4).Select(r => "(" + string.Join(", ", m.Skip(r * 4).Take(4).Select(F)) + ")")) + ")";+ }+ // Gf and Aetheris both use row vectors. Quaternion extraction uses the transpose of the usual column convention.+ private static string Quaternion(double[] m)+ {+ Matrix(m);+ double w, x, y, z;+ var trace = m[0] + m[5] + m[10];+ if (trace > 0) { var s = Math.Sqrt(trace + 1) * 2; w = s / 4; x = (m[6]-m[9])/s; y = (m[8]-m[2])/s; z = (m[1]-m[4])/s; }+ else if (m[0] > m[5] && m[0] > m[10]) { var s = Math.Sqrt(1+m[0]-m[5]-m[10])*2; w=(m[6]-m[9])/s; x=s/4; y=(m[4]+m[1])/s; z=(m[8]+m[2])/s; }+ else if (m[5] > m[10]) { var s = Math.Sqrt(1+m[5]-m[0]-m[10])*2; w=(m[8]-m[2])/s; x=(m[4]+m[1])/s; y=s/4; z=(m[9]+m[6])/s; }+ else { var s = Math.Sqrt(1+m[10]-m[0]-m[5])*2; w=(m[1]-m[4])/s; x=(m[8]+m[2])/s; y=(m[9]+m[6])/s; z=s/4; }+ return $"({F(w)}, {F(x)}, {F(y)}, {F(z)})";+ }+}diff --git a/docs/public/firmament/assemblies.md b/docs/public/firmament/assemblies.mdindex f38626ab..57950068 100644--- a/docs/public/firmament/assemblies.md+++ b/docs/public/firmament/assemblies.md@@ -2,6 +2,8 @@Firmament assemblies have two independent structures: the product tree owns definition/occurrence identity, while the Interface graph owns mechanical relationships. Tree nesting never implies a Mate.+Executable assemblies can also [export to OpenUSD](openusd.md), preserving nested hierarchy, shared display geometry, occurrence placement, and the accepted frame-based Fixed/Revolute/Prismatic contracts. STEP remains the engineering/manufacturing interchange output.+`Concept<T>` describes truths that make one semantic object valid. `Interface<T>` describes truths that make several objects valid together. `Subassembly` is a reusable, locally solved Assembly definition. `Expose` names the small public semantic contract visible to a parent.## Compiler-owned interface familiesdiff --git a/docs/public/firmament/openusd.md b/docs/public/firmament/openusd.mdnew file mode 100644index 00000000..d73dc193--- /dev/null+++ b/docs/public/firmament/openusd.md@@ -0,0 +1,67 @@+# Export assemblies to OpenUSD++Aetheris exports executable Firmament assemblies as readable USDA through the same shared-definition production display mesh used by its assembly viewer. STEP/BRep and Firmament Interface semantics remain engineering authority. USD is a downstream scene and kinematic visualization output; STEP remains the manufacturing output.++```powershell+dotnet run --project Aetheris.CLI -c Release -- asm export-usd `+ fixtures/Canonical/AssemblyInterfaces/two-link-arm-usd.firmament `+ artifacts/local/usd/arm.usda --state Shoulder=35 --state Elbow=65+```++The first argument is an executable `.firmament` or `.firmasm` assembly. The optional second argument is the `.usda` output; its default is `artifacts/local/usd/<source-name>.usda`. A semantics-only assembly must supply actual materializable part definitions before exporting. No USD SDK is required to write USDA.++`--state Joint=value` accepts finite degrees for Revolute and millimetres for Prismatic; omitted state is the compiler's default. Unknown names and duplicate state assignments fail. `--sample time:Joint=value,Joint=value` adds an evaluated pose at that USD time code; omitted joints use their defaults in each sample. Samples use 24 time codes per second. USD interpolates translations and quaternions between samples. Use dense samples when intermediate joint-constrained motion matters: interpolation of occurrence poses is not a substitute for the Aetheris kinematics evaluator.++```powershell+dotnet run --project Aetheris.CLI -c Release -- asm export-usd `+ fixtures/Canonical/AssemblyInterfaces/two-link-arm-usd.firmament `+ artifacts/local/usd/arm.usda `+ --sample 0:Shoulder=0,Elbow=0 `+ --sample 48:Shoulder=35,Elbow=65 `+ --sample 96:Shoulder=-20,Elbow=35+```++`--materials file.json` supplies downstream preview appearances keyed by the exact compiled definition identity. Each appearance has `red`, `green`, `blue`, `metallic`, and `roughness` in `[0,1]`. Unknown definitions fail. The preset is visual presentation, not an engineering material or density declaration. Without a preset, parts receive a neutral metallic preview material and display color. `--evidence file.json` writes the authoritative display data, poses, and joint frames for independent external verification. `--json` prints counts, file size, and measured mesh/serialization timings.++The API is `AssemblyUsdExporter.Export(compilation, options)`. `Serialize(ir, mesh, options, evaluatedState)` reuses a prepared mesh; its occurrence transforms must match the declared state. The exporter rejects mismatched states, invalid meshes, unresolved placement, and reflected transforms. It never drops a failed part or replaces a failed mesh with debug geometry.++## Scene contract++| Aetheris | USD |+|---|---|+| Assembly root and nested product groups | Nested `Xform` prims under `/Assembly` |+| Shared part definition | One mesh in abstract `/Definitions`; native instanceable references on occurrence `Geometry` children |+| Occurrence world placement | Local translation and quaternion derived relative to its product parent |+| Millimetres | `metersPerUnit = 0.001`; coordinates retain mm |+| Coordinate convention | Z-up, right-handed; no axis swap |+| Sharp production face normals | Vertex normals on separated face patches; `subdivisionScheme = "none"` |+| Preview appearance | `UsdPreviewSurface`, `MaterialBindingAPI`, and `primvars:displayColor` |+| Fixed / Revolute / Prismatic | `PhysicsFixedJoint` / `PhysicsRevoluteJoint` / `PhysicsPrismaticJoint` |+| Accepted joint zero frames | `physics:localPos0/1`, `physics:localRot0/1`; motion axis `Z` |+| Posed state and identities | Namespaced `aetheris:*` attributes, plus optional pose/state time samples |++Joint endpoints receive `PhysicsRigidBodyAPI` with `physics:kinematicEnabled = true`; the assembly root receives `PhysicsArticulationRootAPI`. The exported scene presents Aetheris-authored motion. It does not introduce a dynamics solver, collision decomposition, IK, USD import, or robot control. The accepted assembly IR does not currently supply per-occurrence density, mass, or principal inertia, so the exporter does not invent those properties. Limits are omitted because the Interface X0 contract has no authored limits. Legacy axis/seat-only Revolute declarations lack a deterministic angular zero and do not gain state-driven joints from this export.++Metre authoring is deferred: changing `Units: mm` to `Units: m` alone would not convert typed dimensions, template values, PMI, and geometry parsers consistently. This release keeps the accepted millimetre engineering convention and explicitly declares its physical USD scale.++## External verification and demo++On Windows, the qualification script installs the pinned NVIDIA-provided OpenUSD 25.08 distribution locally if needed, builds Aetheris, exports the witnesses, runs external USD validation, and captures the real `usdview` window and Hydra viewport. It creates no background service and keeps generated output under `artifacts/local/`.++```powershell+pwsh -File scripts/qualify-usd-export-x0.ps1+# Optional: capture a four-second motion clip; requires ffmpeg on PATH.+pwsh -File scripts/qualify-usd-export-x0.ps1 -CaptureMotion+```++ATLAS uses exact Aetheris pedestal, perforated housings, shared collars, and a two-finger gripper. The separate studio USD layer adds lights, camera, stage, and a reflective sphere; those are presentation-only. See [the milestone evidence report](../../release/USD-EXPORT-X0.md) for the pinned tool, source provenance, screenshots, physical-scale checks, and limits.++The refined industrial ATLAS witness is authored in `fixtures/Canonical/AssemblyInterfaces/IndustrialAtlas/atlas-industrial.firmament`. Its tapered G1 housings use `SectionChainFile` definitions, alongside ordinary exact drums, rings, rounded panels and parallel jaws. Native shared instances retain the repeated fasteners. The assembly display exporter has a bounded structured tessellation lane for natural rectangular spline patches with convex planar caps: adjacent faces share sampled BRep edges, and sharp cap normals remain separate. General trimmed spline remeshing is outside that lane.++After the solution build and installation above, reproduce its external validation and slide render with:++```powershell+pwsh -File scripts/qualify-industrial-atlas.ps1 -Render -Motion+```++`-Render` and `-Motion` require Blender with Cycles; the script accepts `-Blender <executable>`. Motion encoding also needs ffmpeg. The default output is `artifacts/local/usd-industrial/`. Engineering solids are modeled in Aetheris and exported both as STEP and USD. Blender imports the actual USD and supplies the final studio render. The printed maker mark, floor, chrome target, camera and lights are downstream presentation; the mark is not BRep engraving. See [the industrial styling evidence](../../release/USD-INDUSTRIAL-ATLAS-X0.md).diff --git a/docs/release/USD-EXPORT-X0.md b/docs/release/USD-EXPORT-X0.mdnew file mode 100644index 00000000..9b58fb21--- /dev/null+++ b/docs/release/USD-EXPORT-X0.md@@ -0,0 +1,121 @@+# USD-EXPORT-X0 — assembly interoperability evidence++## Executive verdict++**Accepted for X0's preferred external validation target: official OpenUSD usdview, distributed by NVIDIA.** Aetheris assemblies export to valid USD with hierarchy, shared instances, rigid placements, explicit physical scale, and standard Fixed/Revolute/Prismatic joint schemas. The files open and render in the real external viewer. The articulated ATLAS studio witness and motion clip are produced.++This is OpenUSD/Hydra Storm validation using NVIDIA's official tool distribution. Omniverse Kit, Isaac Sim, NVIDIA RTX rendering, and dynamics execution were not qualified. The result does not claim those separate capabilities. NVIDIA-specific simulation validation remains pending; the requested preferred OpenUSD viewer path is qualified.++STEP remains manufacturing/engineering interchange. USD is downstream scene, digital-twin, robotics visualization, and simulation interchange. Neither the exporter nor the studio layer changes Aetheris engineering authority.++## External validation report++- **Tool:** OpenUSD `usdview`, `usdchecker`, and the `pxr` SDK from NVIDIA's Windows prebuilt distribution; actual viewport renderer `HdStormRendererPlugin` (Hydra Storm / OpenGL).+- **Version:** OpenUSD 25.08 (`Usd.GetVersion() == (0,25,8)`); archive build `v25.08.71e038c1`, with bundled Python 3.12.+- **Source/download:** [NVIDIA OpenUSD developer resources](https://developer.nvidia.com/openusd), [pinned Windows archive](https://developer.nvidia.com/downloads/usd/usd_binaries/25.08/usd.py312.windows-x86_64.usdview.release-v25.08.71e038c1.zip). Installation is extraction into ignored `artifacts/local/usd-x0/tools/openusd`; no global SDK or Python modifications.+- **Archive SHA-256:** `61BAE28D18C873871047E7A8B3FE1FFE2188FB88FDDE113BE429812D27F0C8B4`.+- **USD files:** `artifacts/local/usd-x0/{fixed,arm,slider,occt-slider,demo,demo-studio}.usda`.+- **Opened successfully:** yes, all five assembly witnesses and the composed studio stage. External `usdchecker` reports `Success!` for every file. Composition errors: zero.+- **Warnings:** final viewer/checker runs contain no schema, composition, or rendering errors. During capture-script development, an incorrect time API call raised a Python exception and produced OpenGL teardown errors; the corrected scripts complete normally. Those failed attempts were not counted as validation.+- **Joint metadata visible:** yes; the real viewer hierarchy identifies the standard joint type, and the selected joint's properties show Aetheris family, endpoint identities, semantic frames, and state. The external SDK verifies all standard body relationships and local joint frames.+- **Screenshot paths:** `artifacts/local/usd-x0/<witness>-captures/{hierarchy,render-0}.png`, arm poses at frames 0/48/96, studio poses at frames 0/48/96. Compact durable screenshots are below and under `docs/release/usd-export-x0/`.+- **Motion:** `artifacts/local/usd-x0/atlas-motion.mp4`, encoded from actual external-viewer captures of the 97-pose exported scene; four seconds at 24 time codes/second.++The tool/workflow follows [NVIDIA's usdview quickstart](https://docs.omniverse.nvidia.com/usd/latest/usdview/quickstart.html). To open the final studio interactively:++```powershell+artifacts/local/usd-x0/tools/openusd/scripts/usdview.bat `+ artifacts/local/usd-x0/demo-studio.usda --camera /Presentation/HeroCamera+```++++++## Lowering and schemas++The API is `AssemblyUsdExporter.Export(AssemblyM1CompilationResult, AssemblyUsdOptions)`; `Serialize` reuses prepared production geometry without tessellating again. The CLI is `aetheris asm export-usd <source> [out.usda]`. All geometry comes through `AssemblyM1Pipeline`/the `.firmasm` document compiler and `AssemblyDisplayMeshExporter`. Failed geometry, unresolved transforms, mismatched pose metadata, non-finite data, reflected transforms, and unknown material definitions fail visibly. Geometry is never inferred from joint labels.++| Source authority | USD representation |+|---|---|+| Product tree | Nested `/Assembly` `Xform` prims; local transforms derived as world × inverse(parent-world) |+| Reusable part BRep definition | One production mesh per definition in abstract `/Definitions`; occurrence `Geometry` has an internal instanceable reference |+| Occurrence / definition identity | `aetheris:occurrenceIdentity`, `aetheris:definitionIdentity`, `aetheris:sourcePath` |+| Source assembly | `aetheris:sourceName` |+| Display mesh | Triangle `Mesh`, vertex normals retaining sharp face boundaries, right-handed orientation, no subdivision |+| Preview color / metal / roughness | `UsdPreviewSurface`, `MaterialBindingAPI`, and display-color primvar |+| Fixed | `PhysicsFixedJoint` |+| Revolute | `PhysicsRevoluteJoint`, `physics:axis = "Z"` |+| Prismatic | `PhysicsPrismaticJoint`, `physics:axis = "Z"` |+| Parent / child | `physics:body0/1` relationships to original occurrence prims |+| Authored zero frames | `physics:localPos0/1`, `physics:localRot0/1`; original double matrices retained as `aetheris:zeroFrame0/1` |+| Family / scalar state | Namespaced interface name/family, semantic frame IDs, zero state, current state, and degree/mm state unit |+| Kinematic body / articulation | `PhysicsRigidBodyAPI` with kinematic enabled on joint endpoints; `PhysicsArticulationRootAPI` on assembly root |+| Optional motion | Evaluated translation/quaternion and scalar-state time samples |++The audit used the official [USD Physics overview](https://openusd.org/release/api/usd_physics_page_front.html), [joint schema](https://openusd.org/release/api/class_usd_physics_joint.html), [RevoluteJoint](https://openusd.org/release/api/class_usd_physics_revolute_joint.html), [PrismaticJoint](https://openusd.org/release/api/class_usd_physics_prismatic_joint.html), and [NVIDIA's joint-schema support](https://docs.omniverse.nvidia.com/usd/code-docs/usd-exchange-sdk/latest/api/group__physicsjoints.html). These standard schemas directly fit the accepted Interface frame model; no Aetheris semantic redesign or geometry-based joint inference was necessary.++The current accepted assembly IR does not carry engineering material density, per-occurrence mass, center of mass, or principal inertia. Those properties are therefore omitted rather than synthesized. USD Physics MassAPI can represent them when authoritative inputs are available. Authored limits are absent in Interface X0 and are not invented. Collision geometry is unnecessary for the qualified viewer path and is not authored. No collision decomposition, dynamics, IK, or trajectory planner was added.++## Units and coordinates++Aetheris geometry and state remain millimetres. The stage explicitly authors `metersPerUnit = 0.001`, `upAxis = "Z"`, and right-handed mesh orientation. Transform translation values retain millimetres; rotations are unitless quaternions. No implicit 1 mm = 1 metre interpretation or axis swap occurs. Revolute state is degrees; Prismatic state is mm. Joint local positions are stage units, matching their body geometry.++The OCCT rod has a 10 mm diameter and 200 mm length: it represents 0.010 m × 0.200 m in USD. Its carriage moves 120 mm (0.120 m). The fixed witness includes a 45-degree nested parent rotation and a translated parent, so relative composition is tested beyond identity groups. External `UsdGeom.XformCache` verifies every occurrence world transform against Aetheris, and quaternion interpolation is checked for rigid intermediate frames.++The late request for metre authoring was explicitly conditional on being easy. It is **deferred**: typed literal classification, template and static evaluation, PMI, policy lengths, and multiple geometry profiles currently require mm. Merely accepting `Units: m` would produce inconsistent engineering scale. The bounded exporter does not introduce such a parser patch. Public documentation calls out this limitation.++## Witnesses and provenance++| Witness source under `fixtures/Canonical/AssemblyInterfaces/` | Evidence |+|---|---|+| `fixed-nested-usd.firmament` | Fixed schema, three uses of one sleeve definition, nested rotated/translated product group |+| `two-link-arm-usd.firmament` | Same ports, frames, and joint graph as canonical `two-link-arm.firmament`, with ordinary exact part templates added for materialization; two links share one definition |+| `external-step-slider.firmament` | Accepted Interface witness and its existing STEP-file intake path |+| `external-occt-slider-usd.firmament` | Same Prismatic contract using actual third-party `testdata/step242/OCCT/rod.step`; STEP header identifies FreeCAD / Open CASCADE STEP processor 7.8 |+| `physical-ai-demo.firmament` | ATLAS nested assembly, 6 definitions / 9 part occurrences / 12 total occurrences, 8 joints, 97 evaluated poses |++The accepted slider's original STEP file identifies Aetheris as its producer. It is useful regression evidence for file intake but is not third-party authorship evidence. The separate OCCT witness corrects that distinction without rewriting the accepted Interface fixture.++++## Investor demo++ATLAS is a compact pedestal manipulator with a visibly articulated two-link arm, perforated mechanical housings, repeated cyan joint collars, and a two-finger translating gripper around a chrome target. The metal palette, studio reflections, nested mechanical parts, and obvious motion make the interoperability result usable on a slide without a long technical explanation.++Aetheris exercises exact circle/rectangle profiles, multi-loop perforated extrusions, shared definitions, nested occurrence hierarchy, datum frames, Fixed/Revolute/Prismatic interfaces, and deterministic state-to-pose. The assembly's exact geometry and kinematic frames are engineering authority. The appearance JSON is a downstream preview preset. The separate USD studio layer contains presentation-only floor, lighting, camera, and chrome sphere. The sphere follows the wrist as visual choreography; it does not claim contact simulation or physical grasping.++Motion changes Shoulder 5→25→5 degrees, Elbow 20→80→20 degrees, and both finger slides 14→8→14 mm over 97 frames. Every authored frame comes from Aetheris kinematics. USD translation/quaternion interpolation remains rigid, but sparse occurrence interpolation does not guarantee exact joint-constrained trajectories between authored frames; the demo uses one authoritative sample per frame.++## Qualification and reproduction++```powershell+pwsh -File scripts/qualify-usd-export-x0.ps1 -CaptureMotion+dotnet build Aetheris.slnx -c Release --no-restore -m:1+dotnet test Aetheris.Kernel.Core.Tests -c Release --no-build --filter "Category!=SlowCorpus"+dotnet test Aetheris.slnx -c Release --no-build -m:1 -- RunConfiguration.MaxCpuCount=1+```++`-UsdRoot <existing-install>` reuses a local NVIDIA OpenUSD distribution. `-OutDir` changes the otherwise ignored output directory. `-SkipBuild` is appropriate after the listed build. The installer verifies the pinned archive hash. `-CaptureMotion` also needs `ffmpeg`; the core export/viewer qualification does not.++The external Python qualification checks composition errors, units, up-axis, hierarchy, exact occurrence identities, shared native prototypes, material bindings, triangle/normals preservation, standard joint types/endpoints/local frames, default and sampled world transforms, display bounds, and welded triangle closure. All exported definitions have zero unmatched mesh edges. Tight transformed display bounds agree within 0.0001 mm; USD's conservative scene bounds agree with independently transformed Aetheris local display bounds within the same threshold. Conservative bounds can exceed tight bounds for a rotated cylindrical collar; that is normal bounding-box behavior, not changed part placement.++Measured results are recorded in `artifacts/local/usd-x0/qualification-summary.json`. The committed compact summary retains bounded validation/performance evidence; raw meshes, USD files, logs, tool installation, HDR asset, and video stay ignored/local. Screenshot byte stability is not promised across GPU/driver/platform versions; they are direct captures of the real external viewer, with the scripts and source files above providing provenance.++Final validation on this checkout: Release solution build passed (7 existing WebAssembly/SQLite interop warnings); fast lane passed 1,005 tests; full serial solution gate passed all 4,009 discovered tests, zero failures and skips. FrictionLab exposes no discoverable tests. The USD regression tests exercise posed definition reuse, culture-independent serialization, actual OCCT intake, nested Fixed placement, all accepted joint families, and fail-closed invalid state/appearance paths. Existing Interface/assembly/corpus tests remain green. Repository layout and `git diff --check` passed.++| Witness | Display mesh ms | USDA serialization ms | File bytes | External SDK load ms | Maximum world-matrix error |+|---|---:|---:|---:|---:|---:|+| fixed | 108.96 | 10.37 | 37,598 | 14.54 | 4.4e-16 |+| arm | 66.08 | 12.60 | 22,425 | 14.77 | 5e-16 |+| slider | 7.59 | 12.43 | 24,610 | 14.91 | 0 |+| occt-slider | 77.20 | 9.98 | 14,589 | 12.40 | 0 |+| demo | 185.42 | 28.29 | 348,199 | 24.14 | 1.6e-15 |++These are one-run development measurements, not optimized benchmarks. The demo contains 2,584 triangles across 6 shared definitions and 97 authored poses; nine part occurrences reuse those definitions. Its studio stage opened in usdview in about 0.06 seconds, with UI startup around 0.9 seconds. The compact [qualification summary](usd-export-x0/qualification-summary.json) records the measured errors and counts. Floating display-point conversion contributes at most 0.000000563 mm of tight-bounds discrepancy in these witnesses; every occurrence default/sample matrix agrees within 1.7e-15. No optimization was required.++## Known boundaries++The follow-on [industrial ATLAS styling round](USD-INDUSTRIAL-ATLAS-X0.md) adds a separate smooth exact housing witness and a direct Cycles render of the USD import. The original X0 witnesses and their measurements above remain the first milestone record.++One-way export only. No full BRep USD encoding, import/roundtrip, dynamics, IK, general material system, collision engine, robot control, or USD ecosystem implementation. Preview meshes use USD float positions/normals, while occurrence placement and preserved zero-frame matrices use doubles. Standard joint positions/quaternions use the schema's float types and are verified within 1e-6. Legacy axis/seat-only Revolute forms do not acquire an invented angular zero. Unresolved group placement must be authored/compiled before display export. Mass/density/inertia and limits need authoritative assembly inputs. Separate Omniverse/Isaac/RTX simulation validation remains pending.diff --git a/docs/release/USD-INDUSTRIAL-ATLAS-X0.md b/docs/release/USD-INDUSTRIAL-ATLAS-X0.mdnew file mode 100644index 00000000..7b23f20b--- /dev/null+++ b/docs/release/USD-INDUSTRIAL-ATLAS-X0.md@@ -0,0 +1,77 @@+# Industrial ATLAS — one bounded styling round++Verdict: **Success** for the requested modeling, USD and slide-asset round. The original rectangular/perforated ATLAS remains the technical X0 witness. This separate industrial assembly adds smooth tapered housings, black circular joint covers, machined rings, shared fasteners, a bolted pedestal, a cleaner parallel gripper and a maker plate.++The intent is an original compact industrial elbow arm. KUKA's [KR IONTEC product images](https://www.kuka.com/en-gb/products/robotics-system/industrial-robots/kr-iontec), [Foundry application image](https://www.kuka.com/en-us/company/press/news/2022/10/kuka-supplies-36-robots-to-zf), and the three user-supplied references guided the orange/graphite palette, circular motor covers and enclosed housings. This is a two-link demonstrator, not a replica or a six-axis KUKA mechanism.++The built-in image generator produced a concept before CAD work. Its full prompt is preserved in [concept-prompt.txt](usd-industrial-atlas/concept-prompt.txt); the generated concept remains `artifacts/local/usd-industrial/design-concept.png`. It is design direction only. The image below is a direct **Cycles render of the exported USD import**, not a generated concept or an edited render.++++## What was modeled++Source: `fixtures/Canonical/AssemblyInterfaces/IndustrialAtlas/atlas-industrial.firmament`, with `upper-housing.firmament`, `fore-housing.firmament` and `appearance.json` beside it.++Both housings are capped five-section G1 SectionChains. Rounded profile normalization and smooth loft selection are existing Aetheris capabilities; their STEP materialization/reimport remains the assembly definition path. Ordinary exact circle/ring/rounded-rectangle extrusions supply the pedestal, mounting plate, drums, caps, rings, jaw bodies, cover plates, standoffs and fasteners. All 60 part occurrences use 24 shared definitions; four product groups bring the USD occurrence count to 64. The accepted Interface model supplies two Revolute joints, two Prismatic slides and 55 Fixed relationships. No joints are inferred from geometry.++The upright elbow silhouette and short gripper replace the flat SCARA presentation. Satin orange enamel, graphite covers, silver rings, broad studio reflections and a dark floor make the construction legible. The camera leaves useful negative space for a slide title. The maker plate reads **GPT 6.1 SOL CODEX** with an AETHERIS / ATLAS-02 subtitle.++Engineering authority: the Aetheris solids, shared definitions, occurrence hierarchy, datum frames and deterministic joint states. `atlas.step` is the exact AP242 engineering assembly at its reference configuration; `atlas.usda` is the posed/animated downstream scene. Appearance is a preview preset, not density or a manufacturing material specification.++The assembly STEP extraction/reimport succeeds with 24 definitions, 60 part bodies, three nested subassemblies and 36 repeated instances. Single-part `analyze` correctly rejects this multi-root assembly; validation uses `asm import-step` instead.++Presentation: floor, chrome sphere, lighting, camera and printed maker-label texture live in a separate USD layer. The maker plate itself is an exact solid, but its printed letters are a downstream texture, not engraved BRep geometry. The sphere follows the gripper for visual choreography; this is not simulated grasp/contact physics.++## Capability extension and verification++The first G1 export revealed 688 unmatched display edges on the forearm. Independent UV grids on adjoining patches did not share subdivisions. `RectangularSplineDisplayTessellator` adds a bounded display route for natural rectangular B-spline patches and single-loop convex planar caps. It checks that each patch's four natural sides match source BRep edges, samples each edge once, reuses those positions on every incident face, and preserves separate face normals. A common grid is refined against sampled chord/normal checks, capped at 256 segments. It does not alter exact geometry or support arbitrary trimmed splines, holes, concave caps or generic remeshing.++The regression test checks both real housings for two triangle uses per welded edge, triangle/normal orientation and positive enclosed volume. External OpenUSD checks cover hierarchy, native instancing, materials, schema types, joint frames, all 97 authored poses plus the default pose, physical scale, bounds and closure. Every definition now has **zero unmatched display edges**. Maximum world-matrix error is **8.89e-16**; tight display bounds differ by **1.77e-6 mm**, inside the 0.0001 mm check tolerance. USD explicitly declares millimetres (`metersPerUnit = 0.001`), Z-up and right-handed geometry.++## External validation++Tool: NVIDIA-distributed official OpenUSD **usdview**, Hydra Storm renderer, plus **usdchecker** and the external `pxr` SDK.++Version: **OpenUSD 25.08**, runtime `(0,25,8)`.++Source/download: [NVIDIA OpenUSD Windows Python 3.12 distribution](https://developer.nvidia.com/downloads/usd/usd_binaries/25.08/usd.py312.windows-x86_64.usdview.release-v25.08.71e038c1.zip). Installation and checksum are pinned in [USD-EXPORT-X0](USD-EXPORT-X0.md).++USD file: `artifacts/local/usd-industrial/atlas.usda`; presentation layer `atlas-studio.usda` references it.++Opened successfully: **Yes**, actual usdview window and Hydra viewport; both product and studio layers pass usdchecker. Default and sampled world transforms agree with Aetheris.++Warnings: final usdchecker and usdview logs contain no schema/composition warnings. The label's primvar-reader input initially used `token`; usdchecker required the standard `string` type, which was corrected. Blender logs contain a `World.use_nodes` deprecation warning, with successful rendering.++Joint metadata visible: **Yes**, the actual selected Elbow prim is a `PhysicsRevoluteJoint`, with endpoint relationships, frames and Aetheris state metadata. Fixed and Prismatic schemas also pass independent SDK inspection.++Screenshot path: [usdview-hierarchy.png](usd-industrial-atlas/usdview-hierarchy.png). Viewer frames 0, 48 and 96 remain under `artifacts/local/usd-industrial/usdview/`.++++Final render tool: installed **Blender 5.2.2 LTS**, build `d13f752e3b9c`, Cycles / NVIDIA OptiX on **RTX 3070**. Blender imports the actual USD through `bpy.ops.wm.usd_import`, with instancing and preview materials. The hero is 2560×1440, 192 samples with denoising. The imported engineering meshes are unchanged. Separate Omniverse/Isaac/RTX simulation qualification remains outside this styling round.++Two reader-specific presentation issues were isolated: Blender dropped material bindings on imported Cube/Sphere shape primitives, so the studio layer uses explicit presentation meshes. It also left imported RectLight transforms/dimensions in mm while camera/meshes converted to metres; the bounded renderer script corrects only those presentation lights and records their Cycles energies (Key 80 W, Rim 80 W, Fill 40 W). No Aetheris transform or unit contract was changed for one renderer.++## Reproduction and evidence++```powershell+dotnet build Aetheris.slnx -c Release --no-restore -m:1+pwsh -File scripts/qualify-usd-export-x0.ps1 -SkipBuild+pwsh -File scripts/qualify-industrial-atlas.ps1 -Render -Motion+dotnet test Aetheris.Kernel.Core.Tests -c Release --no-build --filter "Category!=SlowCorpus"+dotnet test Aetheris.slnx -c Release --no-build -m:1 -- RunConfiguration.MaxCpuCount=1+```++The first qualification script installs the pinned NVIDIA SDK. `-UsdRoot` reuses an existing installation; `-Blender` selects an executable. All generated files default to ignored `artifacts/local/`. The exact viewer command, under that SDK's PATH/PYTHONPATH, is:++```powershell+python scripts/capture-usd-export-x0.py artifacts/local/usd-industrial/atlas-studio.usda --camera /Presentation/HeroCamera --defaultsettings --timing+```++`qualify-industrial-atlas.ps1` sets frames 0,48,96 and captures the real viewer. It exports 97 smooth evaluated states over 0–96 time codes, renders 25 sampled frames in Cycles, and encodes a four-second H.264 clip at `artifacts/local/usd-industrial/atlas-motion.mp4`. Shoulder/elbow and parallel jaws move without IK. The final pose at time 48 matches the default exported hero state: Shoulder −75°, Elbow −140°, both jaw slides 10 mm.++One-run measurements: display mesh preparation **352 ms**, USDA serialization including 97 poses **142 ms**, product file **2,900,033 bytes**, external SDK stage load **101 ms**, usdview stage load **128 ms**, UI startup **965 ms**. Cycles USD import/scene preparation took **0.20 s**, final hero render **96.1 s**. These are development measurements, not optimized benchmarks.++Release build passed with seven existing WebAssembly/SQLite warnings; the fast lane passed 1,005 tests; the final full serial gate passed **all 4,010 tests**, zero failures/skips. The first full attempt, concurrent with Cycles rendering, passed 4,008 and failed two existing legacy display-budget tests: `TwoLocalHoles_ShareOneTrimmedHostAndRoundTrip` exceeded its 10-second budget after 12,541 ms, and `DisplayPrepare_Ftc07_ReturnsPartialDisplayInsteadOfWholeBodyFailure` had no patches within its five-second budget. These tests do not call the new structured spline lane. Both passed together in two seconds after rendering finished, and the identical full gate then passed without source changes or increased time budgets. Resource contention is the supported explanation; both attempts remain in the local logs and compact record.++The motion clip contains 100 encoded frames at 1280×720 over **4.166667 seconds** (352,126 bytes), from 25 directly rendered USD poses; motion rendering took 77 seconds. The [compact qualification summary](usd-industrial-atlas/qualification-summary.json) preserves counts, timings, errors and test evidence. Screenshot/render bytes can vary by GPU/driver; sources, exact workflows and settings above provide reproduction. Raw logs, detailed mesh/pose evidence, STEP/USD, .blend, textures, concept image and video remain local.diff --git a/docs/release/usd-export-x0/atlas-hierarchy.png b/docs/release/usd-export-x0/atlas-hierarchy.pngnew file mode 100644index 00000000..f0421d48Binary files /dev/null and b/docs/release/usd-export-x0/atlas-hierarchy.png differdiff --git a/docs/release/usd-export-x0/atlas-render.png b/docs/release/usd-export-x0/atlas-render.pngnew file mode 100644index 00000000..dbd53539Binary files /dev/null and b/docs/release/usd-export-x0/atlas-render.png differdiff --git a/docs/release/usd-export-x0/occt-slider-hierarchy.png b/docs/release/usd-export-x0/occt-slider-hierarchy.pngnew file mode 100644index 00000000..34ae4545Binary files /dev/null and b/docs/release/usd-export-x0/occt-slider-hierarchy.png differdiff --git a/docs/release/usd-export-x0/qualification-summary.json b/docs/release/usd-export-x0/qualification-summary.jsonnew file mode 100644index 00000000..51ce49d6--- /dev/null+++ b/docs/release/usd-export-x0/qualification-summary.json@@ -0,0 +1,144 @@+{+ "milestone": "USD-EXPORT-X0",+ "tool": "NVIDIA-distributed OpenUSD usdview / Hydra Storm",+ "source": "https://developer.nvidia.com/downloads/usd/usd_binaries/25.08/usd.py312.windows-x86_64.usdview.release-v25.08.71e038c1.zip",+ "archiveSha256": "61BAE28D18C873871047E7A8B3FE1FFE2188FB88FDDE113BE429812D27F0C8B4",+ "witnesses": [+ {+ "witness": "fixed",+ "source": "fixtures/Canonical/AssemblyInterfaces/fixed-nested-usd.firmament",+ "usd": "fixed.usda",+ "meshMilliseconds": 108.9552,+ "serializationMilliseconds": 10.3709,+ "bytes": 37598,+ "version": "0.25.8",+ "openedSuccessfully": true,+ "compositionErrors": [],+ "externalLoadMilliseconds": 14.540300006046891,+ "occurrences": 5,+ "sharedPrototypes": 1,+ "jointFamilies": [+ "Fixed"+ ],+ "maxWorldTransformError": 4.440892098500626e-16,+ "authoredPosesChecked": 1,+ "bboxErrorMm": 3.85763001986561e-07,+ "conservativeSceneBoundsErrorMm": 2.842170943040401e-14,+ "metersPerUnit": 0.001,+ "upAxis": "Z",+ "unmatchedDisplayMeshEdges": 0+ },+ {+ "witness": "arm",+ "source": "fixtures/Canonical/AssemblyInterfaces/two-link-arm-usd.firmament",+ "usd": "arm.usda",+ "meshMilliseconds": 66.0788,+ "serializationMilliseconds": 12.5997,+ "bytes": 22425,+ "version": "0.25.8",+ "openedSuccessfully": true,+ "compositionErrors": [],+ "externalLoadMilliseconds": 14.769000001251698,+ "occurrences": 4,+ "sharedPrototypes": 2,+ "jointFamilies": [+ "Revolute",+ "Revolute"+ ],+ "maxWorldTransformError": 4.996003610813204e-16,+ "authoredPosesChecked": 4,+ "bboxErrorMm": 3.552713678800501e-15,+ "conservativeSceneBoundsErrorMm": 3.552713678800501e-15,+ "metersPerUnit": 0.001,+ "upAxis": "Z",+ "unmatchedDisplayMeshEdges": 0+ },+ {+ "witness": "slider",+ "source": "fixtures/Canonical/AssemblyInterfaces/external-step-slider.firmament",+ "usd": "slider.usda",+ "meshMilliseconds": 7.5906,+ "serializationMilliseconds": 12.4322,+ "bytes": 24610,+ "version": "0.25.8",+ "openedSuccessfully": true,+ "compositionErrors": [],+ "externalLoadMilliseconds": 14.911800040863454,+ "occurrences": 3,+ "sharedPrototypes": 1,+ "jointFamilies": [+ "Prismatic"+ ],+ "maxWorldTransformError": 0.0,+ "authoredPosesChecked": 1,+ "bboxErrorMm": 0.0,+ "conservativeSceneBoundsErrorMm": 0.0,+ "metersPerUnit": 0.001,+ "upAxis": "Z",+ "unmatchedDisplayMeshEdges": 0+ },+ {+ "witness": "occt-slider",+ "source": "fixtures/Canonical/AssemblyInterfaces/external-occt-slider-usd.firmament",+ "usd": "occt-slider.usda",+ "meshMilliseconds": 77.1952,+ "serializationMilliseconds": 9.9776,+ "bytes": 14589,+ "version": "0.25.8",+ "openedSuccessfully": true,+ "compositionErrors": [],+ "externalLoadMilliseconds": 12.40079989656806,+ "occurrences": 3,+ "sharedPrototypes": 1,+ "jointFamilies": [+ "Prismatic"+ ],+ "maxWorldTransformError": 0.0,+ "authoredPosesChecked": 1,+ "bboxErrorMm": 2.5001334336138825e-11,+ "conservativeSceneBoundsErrorMm": 2.5001334336138825e-11,+ "metersPerUnit": 0.001,+ "upAxis": "Z",+ "unmatchedDisplayMeshEdges": 0+ },+ {+ "witness": "demo",+ "source": "fixtures/Canonical/AssemblyInterfaces/physical-ai-demo.firmament",+ "usd": "demo.usda",+ "meshMilliseconds": 185.4173,+ "serializationMilliseconds": 28.2858,+ "bytes": 348199,+ "version": "0.25.8",+ "openedSuccessfully": true,+ "compositionErrors": [],+ "externalLoadMilliseconds": 24.140399997122586,+ "occurrences": 12,+ "sharedPrototypes": 6,+ "jointFamilies": [+ "Revolute",+ "Fixed",+ "Prismatic",+ "Prismatic",+ "Revolute",+ "Fixed",+ "Fixed",+ "Fixed"+ ],+ "maxWorldTransformError": 1.6237011735142914e-15,+ "authoredPosesChecked": 98,+ "bboxErrorMm": 5.628928647638531e-07,+ "conservativeSceneBoundsErrorMm": 2.842170943040401e-14,+ "metersPerUnit": 0.001,+ "upAxis": "Z",+ "unmatchedDisplayMeshEdges": 0+ }+ ],+ "dotnet": {+ "build": "passed",+ "fastLanePassed": 1005,+ "fullSerialPassed": 4009,+ "failed": 0,+ "skipped": 0,+ "existingWasmWarnings": 7+ }+}diff --git a/docs/release/usd-industrial-atlas/atlas-hero.png b/docs/release/usd-industrial-atlas/atlas-hero.pngnew file mode 100644index 00000000..2897d91eBinary files /dev/null and b/docs/release/usd-industrial-atlas/atlas-hero.png differdiff --git a/docs/release/usd-industrial-atlas/concept-prompt.txt b/docs/release/usd-industrial-atlas/concept-prompt.txtnew file mode 100644index 00000000..c887ba19--- /dev/null+++ b/docs/release/usd-industrial-atlas/concept-prompt.txt@@ -0,0 +1,4 @@+Built-in image generator. Design concept only; generated before CAD modeling.+Reference: user-supplied three-view orange industrial robot image, used as style inspiration.++Create a photorealistic industrial design concept image for an Aetheris CAD modeling exercise and investor slide, landscape 16:9. Use the supplied KUKA robot reference ONLY as inspiration for industrial proportions, orange painted housings and black circular joint caps; design an original compact TWO-LINK pedestal manipulator, not a KUKA replica. Two substantial tapered rounded orange link housings, shoulder and elbow circular black motor covers, subtle machined silver rings, neat recessed service panels with visible fasteners. Upright bent elbow silhouette, short forearm pointing diagonally down toward a chrome sphere held between a tidy two-finger parallel gripper. Gripper black body, narrow silver jaws, realistic compact scale. Dark graphite bolted pedestal. Restrained industrial detail, no decorative neon strips, no sci-fi spikes. Small clean maker plate on forearm reads exactly 'GPT 6.1 SOL CODEX'; a small AETHERIS label on the base. Expensive contemporary product photography, satin orange enamel, graphite anodized metal, brushed aluminum, soft broad key light, warm highlights, cool subtle rim, dark charcoal seamless studio, believable contact shadow and restrained reflections. Strong three-quarter camera composition, robot fills right 65 percent, dark clean negative space on left, all geometry in frame. This is a design concept, not evidence of a simulation; no diagram or captions. No KUKA logos.diff --git a/docs/release/usd-industrial-atlas/qualification-summary.json b/docs/release/usd-industrial-atlas/qualification-summary.jsonnew file mode 100644index 00000000..de0b53ac--- /dev/null+++ b/docs/release/usd-industrial-atlas/qualification-summary.json@@ -0,0 +1,86 @@+{+ "verdict": "Success",+ "source": "fixtures/Canonical/AssemblyInterfaces/IndustrialAtlas/atlas-industrial.firmament",+ "engineering": {+ "definitions": 24,+ "occurrences": 64,+ "partOccurrences": 60,+ "joints": 59,+ "samples": 97,+ "trianglesAcrossDefinitions": 20396,+ "stepReimport": {+ "definitions": 24,+ "partBodies": 60,+ "nestedSubassemblies": 3,+ "repeatedInstances": 36+ }+ },+ "usd": {+ "tool": "NVIDIA-distributed OpenUSD usdview / Hydra Storm",+ "version": "25.08",+ "checker": "Success",+ "units": "mm",+ "metersPerUnit": 0.001,+ "upAxis": "Z",+ "handedness": "rightHanded",+ "maxWorldTransformError": 8.881784197001252e-16,+ "bboxErrorMm": 1.7695030152253821e-06,+ "authoredPosesChecked": 98,+ "unmatchedEdges": 0+ },+ "performance": {+ "meshMilliseconds": 352.0137,+ "serializationMilliseconds": 142.239,+ "bytes": 2900033,+ "externalLoadMilliseconds": 101.25059995334595+ },+ "render": {+ "tool": "Blender",+ "version": "5.2.2 LTS",+ "engine": "Cycles",+ "device": "GPU",+ "devices": [+ "NVIDIA GeForce RTX 3070"+ ],+ "loadSeconds": 0.19978020002599806,+ "renderSeconds": 96.1011558000464,+ "resolution": [+ 2560,+ 1440+ ],+ "samples": 192+ },+ "motion": {+ "renderSeconds": 76.99994489992969,+ "resolution": [+ 1280,+ 720+ ],+ "samples": 24,+ "renderedPoses": 25,+ "encodedFrames": 100,+ "durationSeconds": 4.166667,+ "bytes": 352126+ },+ "tests": {+ "build": "passed; 7 existing WASM/SQLite warnings",+ "fastPassed": 1005,+ "fullPassed": 4010,+ "fullFailed": 0,+ "firstFullAttempt": {+ "passed": 4008,+ "failed": 2,+ "condition": "concurrent Cycles rendering",+ "failures": [+ "TwoLocalHoles_ShareOneTrimmedHostAndRoundTrip: bounded tessellation timeout after 12541 ms",+ "DisplayPrepare_Ftc07_ReturnsPartialDisplayInsteadOfWholeBodyFailure: no face patches within 5 s budget"+ ]+ },+ "isolation": "Both passed together in 2 s after rendering ended; same full command passed without code/test-budget changes"+ },+ "limits": [+ "Original two-link demo, no six-axis control or dynamics",+ "Printed maker texture and studio assets are presentation-only",+ "Omniverse/Isaac simulation validation remains pending"+ ]+}diff --git a/docs/release/usd-industrial-atlas/usdview-hierarchy.png b/docs/release/usd-industrial-atlas/usdview-hierarchy.pngnew file mode 100644index 00000000..0a2685c3Binary files /dev/null and b/docs/release/usd-industrial-atlas/usdview-hierarchy.png differdiff --git a/fixtures/Canonical/AssemblyInterfaces/IndustrialAtlas/appearance.json b/fixtures/Canonical/AssemblyInterfaces/IndustrialAtlas/appearance.jsonnew file mode 100644index 00000000..db34ce15--- /dev/null+++ b/fixtures/Canonical/AssemblyInterfaces/IndustrialAtlas/appearance.json@@ -0,0 +1,170 @@+{+ "Drum<R:55mm,H:70mm>": {+ "red": 0.026,+ "green": 0.031,+ "blue": 0.039,+ "metallic": 0.55,+ "roughness": 0.3+ },+ "Panel<L:150mm,W:130mm,H:8mm,R:14mm>": {+ "red": 0.026,+ "green": 0.031,+ "blue": 0.039,+ "metallic": 0.55,+ "roughness": 0.3+ },+ "Drum<R:57mm,H:8mm>": {+ "red": 0.6,+ "green": 0.64,+ "blue": 0.7,+ "metallic": 0.9,+ "roughness": 0.23+ },+ "Drum<R:44mm,H:27mm>": {+ "red": 0.95,+ "green": 0.21,+ "blue": 0.012,+ "metallic": 0.12,+ "roughness": 0.27+ },+ "Drum<R:4mm,H:5mm>": {+ "red": 0.6,+ "green": 0.64,+ "blue": 0.7,+ "metallic": 0.9,+ "roughness": 0.23+ },+ "SectionChainFile<\"upper-housing.firmament\">": {+ "red": 0.95,+ "green": 0.21,+ "blue": 0.012,+ "metallic": 0.12,+ "roughness": 0.27+ },+ "SectionChainFile<\"fore-housing.firmament\">": {+ "red": 0.95,+ "green": 0.21,+ "blue": 0.012,+ "metallic": 0.12,+ "roughness": 0.27+ },+ "Drum<R:44mm,H:76mm>": {+ "red": 0.95,+ "green": 0.21,+ "blue": 0.012,+ "metallic": 0.12,+ "roughness": 0.27+ },+ "Ring<R:44mm,Bore:38mm,H:4mm>": {+ "red": 0.6,+ "green": 0.64,+ "blue": 0.7,+ "metallic": 0.9,+ "roughness": 0.23+ },+ "Drum<R:39mm,H:5mm>": {+ "red": 0.026,+ "green": 0.031,+ "blue": 0.039,+ "metallic": 0.55,+ "roughness": 0.3+ },+ "Drum<R:2.2mm,H:2mm>": {+ "red": 0.6,+ "green": 0.64,+ "blue": 0.7,+ "metallic": 0.9,+ "roughness": 0.23+ },+ "Drum<R:35mm,H:62mm>": {+ "red": 0.95,+ "green": 0.21,+ "blue": 0.012,+ "metallic": 0.12,+ "roughness": 0.27+ },+ "Ring<R:35mm,Bore:29mm,H:4mm>": {+ "red": 0.6,+ "green": 0.64,+ "blue": 0.7,+ "metallic": 0.9,+ "roughness": 0.23+ },+ "Drum<R:30mm,H:5mm>": {+ "red": 0.026,+ "green": 0.031,+ "blue": 0.039,+ "metallic": 0.55,+ "roughness": 0.3+ },+ "Drum<R:24mm,H:44mm>": {+ "red": 0.95,+ "green": 0.21,+ "blue": 0.012,+ "metallic": 0.12,+ "roughness": 0.27+ },+ "Ring<R:24mm,Bore:18mm,H:4mm>": {+ "red": 0.6,+ "green": 0.64,+ "blue": 0.7,+ "metallic": 0.9,+ "roughness": 0.23+ },+ "Drum<R:19mm,H:5mm>": {+ "red": 0.026,+ "green": 0.031,+ "blue": 0.039,+ "metallic": 0.55,+ "roughness": 0.3+ },+ "Panel<L:92mm,W:27mm,H:2mm,R:6mm>": {+ "red": 0.026,+ "green": 0.031,+ "blue": 0.039,+ "metallic": 0.55,+ "roughness": 0.3+ },+ "Panel<L:84mm,W:18mm,H:2mm,R:3mm>": {+ "red": 0.6,+ "green": 0.64,+ "blue": 0.7,+ "metallic": 0.9,+ "roughness": 0.23+ },+ "Drum<R:2.5mm,H:15mm>": {+ "red": 0.6,+ "green": 0.64,+ "blue": 0.7,+ "metallic": 0.9,+ "roughness": 0.23+ },+ "Drum<R:1.5mm,H:1.5mm>": {+ "red": 0.6,+ "green": 0.64,+ "blue": 0.7,+ "metallic": 0.9,+ "roughness": 0.23+ },+ "Panel<L:30mm,W:50mm,H:28mm,R:7mm>": {+ "red": 0.026,+ "green": 0.031,+ "blue": 0.039,+ "metallic": 0.55,+ "roughness": 0.3+ },+ "Panel<L:56mm,W:7mm,H:10mm,R:3mm>": {+ "red": 0.6,+ "green": 0.64,+ "blue": 0.7,+ "metallic": 0.9,+ "roughness": 0.23+ },+ "Panel<L:10mm,W:7mm,H:2mm,R:2mm>": {+ "red": 0.026,+ "green": 0.031,+ "blue": 0.039,+ "metallic": 0.55,+ "roughness": 0.3+ }+}diff --git a/fixtures/Canonical/AssemblyInterfaces/IndustrialAtlas/atlas-industrial.firmament b/fixtures/Canonical/AssemblyInterfaces/IndustrialAtlas/atlas-industrial.firmamentnew file mode 100644index 00000000..51b116df--- /dev/null+++ b/fixtures/Canonical/AssemblyInterfaces/IndustrialAtlas/atlas-industrial.firmament@@ -0,0 +1,335 @@+// Original compact industrial elbow arm, inspired by orange factory manipulators.+// All product geometry is exact Aetheris geometry; USD is downstream appearance.+Template<R: Length, H: Length> Struct Drum {+ Circle2 Outline { Center: [0mm,0mm] Radius: R }+ Profile Section { Loop Outer { Outline |> TraceLoop } }+ Extrude Body { Profile: Section From: 0mm To: H }+}+Template<R: Length, Bore: Length, H: Length> Struct Ring {+ Circle2 Outside { Center: [0mm,0mm] Radius: R }+ Circle2 Inside { Center: [0mm,0mm] Radius: Bore }+ Profile Section { Loop Outer { Outside |> TraceLoop } Loop Inner { Inside As BoreBoundary |> TraceLoop } }+ Extrude Body { Profile: Section From: 0mm To: H }+}+Template<L: Length, W: Length, H: Length, R: Length> Struct Panel {+ RoundedRect2 Outline { Center: [L / 2,0mm] Size: [L,W] Radius: R }+ Profile Section { Loop Outer { Outline |> TraceLoop } }+ Extrude Body { Profile: Section From: 0mm To: H }+}+Assembly AtlasIndustrial {+ <Assembly AtlasIndustrial>+ <Part Base = Drum<R:55mm,H:70mm>>+ Semantic Mount { DatumFrame Frame = [0,0,0] x [1,0,0] y [0,1,0] z [0,0,1]; }+ Semantic Hinge { DatumFrame Frame = [0,0,105] x [1,0,0] y [0,0,-1] z [0,1,0]; }+ Semantic FootSeat { DatumFrame Frame = [-75,0,-8] x [1,0,0] y [0,1,0] z [0,0,1]; }+ Semantic TurntableSeat { DatumFrame Frame = [0,0,70] x [1,0,0] y [0,1,0] z [0,0,1]; }+ Semantic ShoulderPlinthSeat { DatumFrame Frame = [0,0,78] x [1,0,0] y [0,1,0] z [0,0,1]; }+ Semantic FootBolt1Seat { DatumFrame Frame = [-60,-50,0] x [1,0,0] y [0,1,0] z [0,0,1]; }+ Semantic FootBolt2Seat { DatumFrame Frame = [60,-50,0] x [1,0,0] y [0,1,0] z [0,0,1]; }+ Semantic FootBolt3Seat { DatumFrame Frame = [-60,50,0] x [1,0,0] y [0,1,0] z [0,0,1]; }+ Semantic FootBolt4Seat { DatumFrame Frame = [60,50,0] x [1,0,0] y [0,1,0] z [0,0,1]; }+ </Part>+ <Part Foot = Panel<L:150mm,W:130mm,H:8mm,R:14mm>>+ Semantic Mount { DatumFrame Frame = [0,0,0] x [1,0,0] y [0,1,0] z [0,0,1]; }+ </Part>+ <Part Turntable = Drum<R:57mm,H:8mm>>+ Semantic Mount { DatumFrame Frame = [0,0,0] x [1,0,0] y [0,1,0] z [0,0,1]; }+ </Part>+ <Part ShoulderPlinth = Drum<R:44mm,H:27mm>>+ Semantic Mount { DatumFrame Frame = [0,0,0] x [1,0,0] y [0,1,0] z [0,0,1]; }+ </Part>+ <Part FootBolt1 = Drum<R:4mm,H:5mm>>+ Semantic Mount { DatumFrame Frame = [0,0,0] x [1,0,0] y [0,1,0] z [0,0,1]; }+ </Part>+ <Part FootBolt2 = Drum<R:4mm,H:5mm>>+ Semantic Mount { DatumFrame Frame = [0,0,0] x [1,0,0] y [0,1,0] z [0,0,1]; }+ </Part>+ <Part FootBolt3 = Drum<R:4mm,H:5mm>>+ Semantic Mount { DatumFrame Frame = [0,0,0] x [1,0,0] y [0,1,0] z [0,0,1]; }+ </Part>+ <Part FootBolt4 = Drum<R:4mm,H:5mm>>+ Semantic Mount { DatumFrame Frame = [0,0,0] x [1,0,0] y [0,1,0] z [0,0,1]; }+ </Part>+ <Assembly UpperArm>+ Placement LegacyExplicit = [1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1];+ <Part Housing = SectionChainFile<"upper-housing.firmament">>+ Semantic Mount { DatumFrame Frame = [0,0,0] x [1,0,0] y [0,1,0] z [0,0,1]; }+ Semantic Input { DatumFrame Frame = [0,0,0] x [1,0,0] y [0,0,-1] z [0,1,0]; }+ Semantic Output { DatumFrame Frame = [200,0,0] x [1,0,0] y [0,0,-1] z [0,1,0]; }+ Semantic UpperArmShoulderDrumSeat { DatumFrame Frame = [0,38.0,0] x [1,0,0] y [0,0,1] z [0,-1,0]; }+ Semantic UpperArmShoulderRingSeat { DatumFrame Frame = [0,-38.0,0] x [1,0,0] y [0,0,1] z [0,-1,0]; }+ Semantic UpperArmShoulderCapSeat { DatumFrame Frame = [0,-42.0,0] x [1,0,0] y [0,0,1] z [0,-1,0]; }+ Semantic UpperArmShoulderBolt1Seat { DatumFrame Frame = [34.0,-47.0,0.0] x [1,0,0] y [0,0,1] z [0,-1,0]; }+ Semantic UpperArmShoulderBolt2Seat { DatumFrame Frame = [17.0,-47.0,29.44486] x [1,0,0] y [0,0,1] z [0,-1,0]; }+ Semantic UpperArmShoulderBolt3Seat { DatumFrame Frame = [-17.0,-47.0,29.44486] x [1,0,0] y [0,0,1] z [0,-1,0]; }+ Semantic UpperArmShoulderBolt4Seat { DatumFrame Frame = [-34.0,-47.0,0.0] x [1,0,0] y [0,0,1] z [0,-1,0]; }+ Semantic UpperArmShoulderBolt5Seat { DatumFrame Frame = [-17.0,-47.0,-29.44486] x [1,0,0] y [0,0,1] z [0,-1,0]; }+ Semantic UpperArmShoulderBolt6Seat { DatumFrame Frame = [17.0,-47.0,-29.44486] x [1,0,0] y [0,0,1] z [0,-1,0]; }+ Semantic UpperArmEndDrumSeat { DatumFrame Frame = [200,31.0,0] x [1,0,0] y [0,0,1] z [0,-1,0]; }+ Semantic UpperArmEndRingSeat { DatumFrame Frame = [200,-31.0,0] x [1,0,0] y [0,0,1] z [0,-1,0]; }+ Semantic UpperArmEndCapSeat { DatumFrame Frame = [200,-35.0,0] x [1,0,0] y [0,0,1] z [0,-1,0]; }+ Semantic UpperArmEndBolt1Seat { DatumFrame Frame = [225.0,-40.0,0.0] x [1,0,0] y [0,0,1] z [0,-1,0]; }+ Semantic UpperArmEndBolt2Seat { DatumFrame Frame = [212.5,-40.0,21.65064] x [1,0,0] y [0,0,1] z [0,-1,0]; }+ Semantic UpperArmEndBolt3Seat { DatumFrame Frame = [187.5,-40.0,21.65064] x [1,0,0] y [0,0,1] z [0,-1,0]; }+ Semantic UpperArmEndBolt4Seat { DatumFrame Frame = [175.0,-40.0,0.0] x [1,0,0] y [0,0,1] z [0,-1,0]; }+ Semantic UpperArmEndBolt5Seat { DatumFrame Frame = [187.5,-40.0,-21.65064] x [1,0,0] y [0,0,1] z [0,-1,0]; }+ Semantic UpperArmEndBolt6Seat { DatumFrame Frame = [212.5,-40.0,-21.65064] x [1,0,0] y [0,0,1] z [0,-1,0]; }+ Semantic ServicePanelSeat { DatumFrame Frame = [53,-32,0] x [1,0,0] y [0,0,1] z [0,-1,0]; }+ Semantic UpperArmPanelStandoff1Seat { DatumFrame Frame = [58,-20,-6] x [1,0,0] y [0,0,1] z [0,-1,0]; }+ Semantic UpperArmPanelBolt1Seat { DatumFrame Frame = [58,-34,-6] x [1,0,0] y [0,0,1] z [0,-1,0]; }+ Semantic UpperArmPanelStandoff2Seat { DatumFrame Frame = [138,-20,-6] x [1,0,0] y [0,0,1] z [0,-1,0]; }+ Semantic UpperArmPanelBolt2Seat { DatumFrame Frame = [138,-34,-6] x [1,0,0] y [0,0,1] z [0,-1,0]; }+ Semantic UpperArmPanelStandoff3Seat { DatumFrame Frame = [58,-20,6] x [1,0,0] y [0,0,1] z [0,-1,0]; }+ Semantic UpperArmPanelBolt3Seat { DatumFrame Frame = [58,-34,6] x [1,0,0] y [0,0,1] z [0,-1,0]; }+ Semantic UpperArmPanelStandoff4Seat { DatumFrame Frame = [138,-20,6] x [1,0,0] y [0,0,1] z [0,-1,0]; }+ Semantic UpperArmPanelBolt4Seat { DatumFrame Frame = [138,-34,6] x [1,0,0] y [0,0,1] z [0,-1,0]; }+ </Part>+ <Part UpperArmShoulderDrum = Drum<R:44mm,H:76mm>>+ Semantic Mount { DatumFrame Frame = [0,0,0] x [1,0,0] y [0,1,0] z [0,0,1]; }+ </Part>+ <Part UpperArmShoulderRing = Ring<R:44mm,Bore:38mm,H:4mm>>+ Semantic Mount { DatumFrame Frame = [0,0,0] x [1,0,0] y [0,1,0] z [0,0,1]; }+ </Part>+ <Part UpperArmShoulderCap = Drum<R:39mm,H:5mm>>+ Semantic Mount { DatumFrame Frame = [0,0,0] x [1,0,0] y [0,1,0] z [0,0,1]; }+ </Part>+ <Part UpperArmShoulderBolt1 = Drum<R:2.2mm,H:2mm>>+ Semantic Mount { DatumFrame Frame = [0,0,0] x [1,0,0] y [0,1,0] z [0,0,1]; }+ </Part>+ <Part UpperArmShoulderBolt2 = Drum<R:2.2mm,H:2mm>>+ Semantic Mount { DatumFrame Frame = [0,0,0] x [1,0,0] y [0,1,0] z [0,0,1]; }+ </Part>+ <Part UpperArmShoulderBolt3 = Drum<R:2.2mm,H:2mm>>+ Semantic Mount { DatumFrame Frame = [0,0,0] x [1,0,0] y [0,1,0] z [0,0,1]; }+ </Part>+ <Part UpperArmShoulderBolt4 = Drum<R:2.2mm,H:2mm>>+ Semantic Mount { DatumFrame Frame = [0,0,0] x [1,0,0] y [0,1,0] z [0,0,1]; }+ </Part>+ <Part UpperArmShoulderBolt5 = Drum<R:2.2mm,H:2mm>>+ Semantic Mount { DatumFrame Frame = [0,0,0] x [1,0,0] y [0,1,0] z [0,0,1]; }+ </Part>+ <Part UpperArmShoulderBolt6 = Drum<R:2.2mm,H:2mm>>+ Semantic Mount { DatumFrame Frame = [0,0,0] x [1,0,0] y [0,1,0] z [0,0,1]; }+ </Part>+ <Part UpperArmEndDrum = Drum<R:35mm,H:62mm>>+ Semantic Mount { DatumFrame Frame = [0,0,0] x [1,0,0] y [0,1,0] z [0,0,1]; }+ </Part>+ <Part UpperArmEndRing = Ring<R:35mm,Bore:29mm,H:4mm>>+ Semantic Mount { DatumFrame Frame = [0,0,0] x [1,0,0] y [0,1,0] z [0,0,1]; }+ </Part>+ <Part UpperArmEndCap = Drum<R:30mm,H:5mm>>+ Semantic Mount { DatumFrame Frame = [0,0,0] x [1,0,0] y [0,1,0] z [0,0,1]; }+ </Part>+ <Part UpperArmEndBolt1 = Drum<R:2.2mm,H:2mm>>+ Semantic Mount { DatumFrame Frame = [0,0,0] x [1,0,0] y [0,1,0] z [0,0,1]; }+ </Part>+ <Part UpperArmEndBolt2 = Drum<R:2.2mm,H:2mm>>+ Semantic Mount { DatumFrame Frame = [0,0,0] x [1,0,0] y [0,1,0] z [0,0,1]; }+ </Part>+ <Part UpperArmEndBolt3 = Drum<R:2.2mm,H:2mm>>+ Semantic Mount { DatumFrame Frame = [0,0,0] x [1,0,0] y [0,1,0] z [0,0,1]; }+ </Part>+ <Part UpperArmEndBolt4 = Drum<R:2.2mm,H:2mm>>+ Semantic Mount { DatumFrame Frame = [0,0,0] x [1,0,0] y [0,1,0] z [0,0,1]; }+ </Part>+ <Part UpperArmEndBolt5 = Drum<R:2.2mm,H:2mm>>+ Semantic Mount { DatumFrame Frame = [0,0,0] x [1,0,0] y [0,1,0] z [0,0,1]; }+ </Part>+ <Part UpperArmEndBolt6 = Drum<R:2.2mm,H:2mm>>+ Semantic Mount { DatumFrame Frame = [0,0,0] x [1,0,0] y [0,1,0] z [0,0,1]; }+ </Part>+ <Part ServicePanel = Panel<L:92mm,W:27mm,H:2mm,R:6mm>>+ Semantic Mount { DatumFrame Frame = [0,0,0] x [1,0,0] y [0,1,0] z [0,0,1]; }+ </Part>+ <Part UpperArmPanelStandoff1 = Drum<R:2.5mm,H:15mm>>+ Semantic Mount { DatumFrame Frame = [0,0,0] x [1,0,0] y [0,1,0] z [0,0,1]; }+ </Part>+ <Part UpperArmPanelBolt1 = Drum<R:1.5mm,H:1.5mm>>+ Semantic Mount { DatumFrame Frame = [0,0,0] x [1,0,0] y [0,1,0] z [0,0,1]; }+ </Part>+ <Part UpperArmPanelStandoff2 = Drum<R:2.5mm,H:15mm>>+ Semantic Mount { DatumFrame Frame = [0,0,0] x [1,0,0] y [0,1,0] z [0,0,1]; }+ </Part>+ <Part UpperArmPanelBolt2 = Drum<R:1.5mm,H:1.5mm>>+ Semantic Mount { DatumFrame Frame = [0,0,0] x [1,0,0] y [0,1,0] z [0,0,1]; }+ </Part>+ <Part UpperArmPanelStandoff3 = Drum<R:2.5mm,H:15mm>>+ Semantic Mount { DatumFrame Frame = [0,0,0] x [1,0,0] y [0,1,0] z [0,0,1]; }+ </Part>+ <Part UpperArmPanelBolt3 = Drum<R:1.5mm,H:1.5mm>>+ Semantic Mount { DatumFrame Frame = [0,0,0] x [1,0,0] y [0,1,0] z [0,0,1]; }+ </Part>+ <Part UpperArmPanelStandoff4 = Drum<R:2.5mm,H:15mm>>+ Semantic Mount { DatumFrame Frame = [0,0,0] x [1,0,0] y [0,1,0] z [0,0,1]; }+ </Part>+ <Part UpperArmPanelBolt4 = Drum<R:1.5mm,H:1.5mm>>+ Semantic Mount { DatumFrame Frame = [0,0,0] x [1,0,0] y [0,1,0] z [0,0,1]; }+ </Part>+ </Assembly>+ <Assembly ForeArm>+ Placement LegacyExplicit = [1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1];+ <Part Housing = SectionChainFile<"fore-housing.firmament">>+ Semantic Mount { DatumFrame Frame = [0,0,0] x [1,0,0] y [0,1,0] z [0,0,1]; }+ Semantic Input { DatumFrame Frame = [0,0,0] x [1,0,0] y [0,0,-1] z [0,1,0]; }+ Semantic Output { DatumFrame Frame = [180,0,0] x [1,0,0] y [0,1,0] z [0,0,1]; }+ Semantic ForeArmEndDrumSeat { DatumFrame Frame = [180,22.0,0] x [1,0,0] y [0,0,1] z [0,-1,0]; }+ Semantic ForeArmEndRingSeat { DatumFrame Frame = [180,-22.0,0] x [1,0,0] y [0,0,1] z [0,-1,0]; }+ Semantic ForeArmEndCapSeat { DatumFrame Frame = [180,-26.0,0] x [1,0,0] y [0,0,1] z [0,-1,0]; }+ Semantic ForeArmEndBolt1Seat { DatumFrame Frame = [194.0,-31.0,0.0] x [1,0,0] y [0,0,1] z [0,-1,0]; }+ Semantic ForeArmEndBolt2Seat { DatumFrame Frame = [187.0,-31.0,12.12436] x [1,0,0] y [0,0,1] z [0,-1,0]; }+ Semantic ForeArmEndBolt3Seat { DatumFrame Frame = [173.0,-31.0,12.12436] x [1,0,0] y [0,0,1] z [0,-1,0]; }+ Semantic ForeArmEndBolt4Seat { DatumFrame Frame = [166.0,-31.0,0.0] x [1,0,0] y [0,0,1] z [0,-1,0]; }+ Semantic ForeArmEndBolt5Seat { DatumFrame Frame = [173.0,-31.0,-12.12436] x [1,0,0] y [0,0,1] z [0,-1,0]; }+ Semantic ForeArmEndBolt6Seat { DatumFrame Frame = [187.0,-31.0,-12.12436] x [1,0,0] y [0,0,1] z [0,-1,0]; }+ Semantic MakerPlateSeat { DatumFrame Frame = [40,-27,0] x [1,0,0] y [0,0,1] z [0,-1,0]; }+ Semantic ForeArmPanelStandoff1Seat { DatumFrame Frame = [44,-15,-6] x [1,0,0] y [0,0,1] z [0,-1,0]; }+ Semantic ForeArmPanelBolt1Seat { DatumFrame Frame = [44,-29,-6] x [1,0,0] y [0,0,1] z [0,-1,0]; }+ Semantic ForeArmPanelStandoff2Seat { DatumFrame Frame = [120,-15,-6] x [1,0,0] y [0,0,1] z [0,-1,0]; }+ Semantic ForeArmPanelBolt2Seat { DatumFrame Frame = [120,-29,-6] x [1,0,0] y [0,0,1] z [0,-1,0]; }+ Semantic ForeArmPanelStandoff3Seat { DatumFrame Frame = [44,-15,6] x [1,0,0] y [0,0,1] z [0,-1,0]; }+ Semantic ForeArmPanelBolt3Seat { DatumFrame Frame = [44,-29,6] x [1,0,0] y [0,0,1] z [0,-1,0]; }+ Semantic ForeArmPanelStandoff4Seat { DatumFrame Frame = [120,-15,6] x [1,0,0] y [0,0,1] z [0,-1,0]; }+ Semantic ForeArmPanelBolt4Seat { DatumFrame Frame = [120,-29,6] x [1,0,0] y [0,0,1] z [0,-1,0]; }+ </Part>+ <Part ForeArmEndDrum = Drum<R:24mm,H:44mm>>+ Semantic Mount { DatumFrame Frame = [0,0,0] x [1,0,0] y [0,1,0] z [0,0,1]; }+ </Part>+ <Part ForeArmEndRing = Ring<R:24mm,Bore:18mm,H:4mm>>+ Semantic Mount { DatumFrame Frame = [0,0,0] x [1,0,0] y [0,1,0] z [0,0,1]; }+ </Part>+ <Part ForeArmEndCap = Drum<R:19mm,H:5mm>>+ Semantic Mount { DatumFrame Frame = [0,0,0] x [1,0,0] y [0,1,0] z [0,0,1]; }+ </Part>+ <Part ForeArmEndBolt1 = Drum<R:2.2mm,H:2mm>>+ Semantic Mount { DatumFrame Frame = [0,0,0] x [1,0,0] y [0,1,0] z [0,0,1]; }+ </Part>+ <Part ForeArmEndBolt2 = Drum<R:2.2mm,H:2mm>>+ Semantic Mount { DatumFrame Frame = [0,0,0] x [1,0,0] y [0,1,0] z [0,0,1]; }+ </Part>+ <Part ForeArmEndBolt3 = Drum<R:2.2mm,H:2mm>>+ Semantic Mount { DatumFrame Frame = [0,0,0] x [1,0,0] y [0,1,0] z [0,0,1]; }+ </Part>+ <Part ForeArmEndBolt4 = Drum<R:2.2mm,H:2mm>>+ Semantic Mount { DatumFrame Frame = [0,0,0] x [1,0,0] y [0,1,0] z [0,0,1]; }+ </Part>+ <Part ForeArmEndBolt5 = Drum<R:2.2mm,H:2mm>>+ Semantic Mount { DatumFrame Frame = [0,0,0] x [1,0,0] y [0,1,0] z [0,0,1]; }+ </Part>+ <Part ForeArmEndBolt6 = Drum<R:2.2mm,H:2mm>>+ Semantic Mount { DatumFrame Frame = [0,0,0] x [1,0,0] y [0,1,0] z [0,0,1]; }+ </Part>+ <Part MakerPlate = Panel<L:84mm,W:18mm,H:2mm,R:3mm>>+ Semantic Mount { DatumFrame Frame = [0,0,0] x [1,0,0] y [0,1,0] z [0,0,1]; }+ </Part>+ <Part ForeArmPanelStandoff1 = Drum<R:2.5mm,H:15mm>>+ Semantic Mount { DatumFrame Frame = [0,0,0] x [1,0,0] y [0,1,0] z [0,0,1]; }+ </Part>+ <Part ForeArmPanelBolt1 = Drum<R:1.5mm,H:1.5mm>>+ Semantic Mount { DatumFrame Frame = [0,0,0] x [1,0,0] y [0,1,0] z [0,0,1]; }+ </Part>+ <Part ForeArmPanelStandoff2 = Drum<R:2.5mm,H:15mm>>+ Semantic Mount { DatumFrame Frame = [0,0,0] x [1,0,0] y [0,1,0] z [0,0,1]; }+ </Part>+ <Part ForeArmPanelBolt2 = Drum<R:1.5mm,H:1.5mm>>+ Semantic Mount { DatumFrame Frame = [0,0,0] x [1,0,0] y [0,1,0] z [0,0,1]; }+ </Part>+ <Part ForeArmPanelStandoff3 = Drum<R:2.5mm,H:15mm>>+ Semantic Mount { DatumFrame Frame = [0,0,0] x [1,0,0] y [0,1,0] z [0,0,1]; }+ </Part>+ <Part ForeArmPanelBolt3 = Drum<R:1.5mm,H:1.5mm>>+ Semantic Mount { DatumFrame Frame = [0,0,0] x [1,0,0] y [0,1,0] z [0,0,1]; }+ </Part>+ <Part ForeArmPanelStandoff4 = Drum<R:2.5mm,H:15mm>>+ Semantic Mount { DatumFrame Frame = [0,0,0] x [1,0,0] y [0,1,0] z [0,0,1]; }+ </Part>+ <Part ForeArmPanelBolt4 = Drum<R:1.5mm,H:1.5mm>>+ Semantic Mount { DatumFrame Frame = [0,0,0] x [1,0,0] y [0,1,0] z [0,0,1]; }+ </Part>+ </Assembly>+ <Assembly Gripper>+ Placement LegacyExplicit = [1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1];+ <Part Body = Panel<L:30mm,W:50mm,H:28mm,R:7mm>>+ Semantic Mount { DatumFrame Frame = [0,0,0] x [1,0,0] y [0,1,0] z [0,0,1]; }+ Semantic Input { DatumFrame Frame = [0,0,14] x [1,0,0] y [0,1,0] z [0,0,1]; }+ Semantic Left { DatumFrame Frame = [13,16,14] x [1,0,0] y [0,0,-1] z [0,1,0]; }+ Semantic Right { DatumFrame Frame = [13,-16,14] x [1,0,0] y [0,0,1] z [0,-1,0]; }+ </Part>+ <Part LeftJaw = Panel<L:56mm,W:7mm,H:10mm,R:3mm>>+ Semantic Mount { DatumFrame Frame = [0,0,0] x [1,0,0] y [0,1,0] z [0,0,1]; }+ Semantic Slide { DatumFrame Frame = [0,0,5] x [1,0,0] y [0,0,-1] z [0,1,0]; }+ Semantic LeftPadSeat { DatumFrame Frame = [42,0,10] x [1,0,0] y [0,1,0] z [0,0,1]; }+ </Part>+ <Part RightJaw = Panel<L:56mm,W:7mm,H:10mm,R:3mm>>+ Semantic Mount { DatumFrame Frame = [0,0,0] x [1,0,0] y [0,1,0] z [0,0,1]; }+ Semantic Slide { DatumFrame Frame = [0,0,5] x [1,0,0] y [0,0,1] z [0,-1,0]; }+ Semantic RightPadSeat { DatumFrame Frame = [42,0,10] x [1,0,0] y [0,1,0] z [0,0,1]; }+ </Part>+ <Part LeftPad = Panel<L:10mm,W:7mm,H:2mm,R:2mm>>+ Semantic Mount { DatumFrame Frame = [0,0,0] x [1,0,0] y [0,1,0] z [0,0,1]; }+ </Part>+ <Part RightPad = Panel<L:10mm,W:7mm,H:2mm,R:2mm>>+ Semantic Mount { DatumFrame Frame = [0,0,0] x [1,0,0] y [0,1,0] z [0,0,1]; }+ </Part>+ </Assembly>+ </Assembly>+ Anchor: AtlasIndustrial.Base.Hinge;+ Interface<Revolute> Shoulder { A: AtlasIndustrial.Base.Hinge; B: AtlasIndustrial.UpperArm.Housing.Input; }+ Interface<Revolute> Elbow { A: AtlasIndustrial.UpperArm.Housing.Output; B: AtlasIndustrial.ForeArm.Housing.Input; }+ Interface<Fixed> WristMount { A: AtlasIndustrial.ForeArm.Housing.Output; B: AtlasIndustrial.Gripper.Body.Input; }+ Interface<Prismatic> GripLeft { A: AtlasIndustrial.Gripper.Body.Left; B: AtlasIndustrial.Gripper.LeftJaw.Slide; }+ Interface<Prismatic> GripRight { A: AtlasIndustrial.Gripper.Body.Right; B: AtlasIndustrial.Gripper.RightJaw.Slide; }+ Interface<Fixed> FootMount { A: AtlasIndustrial.Base.FootSeat; B: AtlasIndustrial.Foot.Mount; }+ Interface<Fixed> TurntableMount { A: AtlasIndustrial.Base.TurntableSeat; B: AtlasIndustrial.Turntable.Mount; }+ Interface<Fixed> ShoulderPlinthMount { A: AtlasIndustrial.Base.ShoulderPlinthSeat; B: AtlasIndustrial.ShoulderPlinth.Mount; }+ Interface<Fixed> FootBolt1Mount { A: AtlasIndustrial.Base.FootBolt1Seat; B: AtlasIndustrial.FootBolt1.Mount; }+ Interface<Fixed> FootBolt2Mount { A: AtlasIndustrial.Base.FootBolt2Seat; B: AtlasIndustrial.FootBolt2.Mount; }+ Interface<Fixed> FootBolt3Mount { A: AtlasIndustrial.Base.FootBolt3Seat; B: AtlasIndustrial.FootBolt3.Mount; }+ Interface<Fixed> FootBolt4Mount { A: AtlasIndustrial.Base.FootBolt4Seat; B: AtlasIndustrial.FootBolt4.Mount; }+ Interface<Fixed> UpperArmShoulderDrumMount { A: AtlasIndustrial.UpperArm.Housing.UpperArmShoulderDrumSeat; B: AtlasIndustrial.UpperArm.UpperArmShoulderDrum.Mount; }+ Interface<Fixed> UpperArmShoulderRingMount { A: AtlasIndustrial.UpperArm.Housing.UpperArmShoulderRingSeat; B: AtlasIndustrial.UpperArm.UpperArmShoulderRing.Mount; }+ Interface<Fixed> UpperArmShoulderCapMount { A: AtlasIndustrial.UpperArm.Housing.UpperArmShoulderCapSeat; B: AtlasIndustrial.UpperArm.UpperArmShoulderCap.Mount; }+ Interface<Fixed> UpperArmShoulderBolt1Mount { A: AtlasIndustrial.UpperArm.Housing.UpperArmShoulderBolt1Seat; B: AtlasIndustrial.UpperArm.UpperArmShoulderBolt1.Mount; }+ Interface<Fixed> UpperArmShoulderBolt2Mount { A: AtlasIndustrial.UpperArm.Housing.UpperArmShoulderBolt2Seat; B: AtlasIndustrial.UpperArm.UpperArmShoulderBolt2.Mount; }+ Interface<Fixed> UpperArmShoulderBolt3Mount { A: AtlasIndustrial.UpperArm.Housing.UpperArmShoulderBolt3Seat; B: AtlasIndustrial.UpperArm.UpperArmShoulderBolt3.Mount; }+ Interface<Fixed> UpperArmShoulderBolt4Mount { A: AtlasIndustrial.UpperArm.Housing.UpperArmShoulderBolt4Seat; B: AtlasIndustrial.UpperArm.UpperArmShoulderBolt4.Mount; }+ Interface<Fixed> UpperArmShoulderBolt5Mount { A: AtlasIndustrial.UpperArm.Housing.UpperArmShoulderBolt5Seat; B: AtlasIndustrial.UpperArm.UpperArmShoulderBolt5.Mount; }+ Interface<Fixed> UpperArmShoulderBolt6Mount { A: AtlasIndustrial.UpperArm.Housing.UpperArmShoulderBolt6Seat; B: AtlasIndustrial.UpperArm.UpperArmShoulderBolt6.Mount; }+ Interface<Fixed> UpperArmEndDrumMount { A: AtlasIndustrial.UpperArm.Housing.UpperArmEndDrumSeat; B: AtlasIndustrial.UpperArm.UpperArmEndDrum.Mount; }+ Interface<Fixed> UpperArmEndRingMount { A: AtlasIndustrial.UpperArm.Housing.UpperArmEndRingSeat; B: AtlasIndustrial.UpperArm.UpperArmEndRing.Mount; }+ Interface<Fixed> UpperArmEndCapMount { A: AtlasIndustrial.UpperArm.Housing.UpperArmEndCapSeat; B: AtlasIndustrial.UpperArm.UpperArmEndCap.Mount; }+ Interface<Fixed> UpperArmEndBolt1Mount { A: AtlasIndustrial.UpperArm.Housing.UpperArmEndBolt1Seat; B: AtlasIndustrial.UpperArm.UpperArmEndBolt1.Mount; }+ Interface<Fixed> UpperArmEndBolt2Mount { A: AtlasIndustrial.UpperArm.Housing.UpperArmEndBolt2Seat; B: AtlasIndustrial.UpperArm.UpperArmEndBolt2.Mount; }+ Interface<Fixed> UpperArmEndBolt3Mount { A: AtlasIndustrial.UpperArm.Housing.UpperArmEndBolt3Seat; B: AtlasIndustrial.UpperArm.UpperArmEndBolt3.Mount; }+ Interface<Fixed> UpperArmEndBolt4Mount { A: AtlasIndustrial.UpperArm.Housing.UpperArmEndBolt4Seat; B: AtlasIndustrial.UpperArm.UpperArmEndBolt4.Mount; }+ Interface<Fixed> UpperArmEndBolt5Mount { A: AtlasIndustrial.UpperArm.Housing.UpperArmEndBolt5Seat; B: AtlasIndustrial.UpperArm.UpperArmEndBolt5.Mount; }+ Interface<Fixed> UpperArmEndBolt6Mount { A: AtlasIndustrial.UpperArm.Housing.UpperArmEndBolt6Seat; B: AtlasIndustrial.UpperArm.UpperArmEndBolt6.Mount; }+ Interface<Fixed> ForeArmEndDrumMount { A: AtlasIndustrial.ForeArm.Housing.ForeArmEndDrumSeat; B: AtlasIndustrial.ForeArm.ForeArmEndDrum.Mount; }+ Interface<Fixed> ForeArmEndRingMount { A: AtlasIndustrial.ForeArm.Housing.ForeArmEndRingSeat; B: AtlasIndustrial.ForeArm.ForeArmEndRing.Mount; }+ Interface<Fixed> ForeArmEndCapMount { A: AtlasIndustrial.ForeArm.Housing.ForeArmEndCapSeat; B: AtlasIndustrial.ForeArm.ForeArmEndCap.Mount; }+ Interface<Fixed> ForeArmEndBolt1Mount { A: AtlasIndustrial.ForeArm.Housing.ForeArmEndBolt1Seat; B: AtlasIndustrial.ForeArm.ForeArmEndBolt1.Mount; }+ Interface<Fixed> ForeArmEndBolt2Mount { A: AtlasIndustrial.ForeArm.Housing.ForeArmEndBolt2Seat; B: AtlasIndustrial.ForeArm.ForeArmEndBolt2.Mount; }+ Interface<Fixed> ForeArmEndBolt3Mount { A: AtlasIndustrial.ForeArm.Housing.ForeArmEndBolt3Seat; B: AtlasIndustrial.ForeArm.ForeArmEndBolt3.Mount; }+ Interface<Fixed> ForeArmEndBolt4Mount { A: AtlasIndustrial.ForeArm.Housing.ForeArmEndBolt4Seat; B: AtlasIndustrial.ForeArm.ForeArmEndBolt4.Mount; }+ Interface<Fixed> ForeArmEndBolt5Mount { A: AtlasIndustrial.ForeArm.Housing.ForeArmEndBolt5Seat; B: AtlasIndustrial.ForeArm.ForeArmEndBolt5.Mount; }+ Interface<Fixed> ForeArmEndBolt6Mount { A: AtlasIndustrial.ForeArm.Housing.ForeArmEndBolt6Seat; B: AtlasIndustrial.ForeArm.ForeArmEndBolt6.Mount; }+ Interface<Fixed> ServicePanelMount { A: AtlasIndustrial.UpperArm.Housing.ServicePanelSeat; B: AtlasIndustrial.UpperArm.ServicePanel.Mount; }+ Interface<Fixed> MakerPlateMount { A: AtlasIndustrial.ForeArm.Housing.MakerPlateSeat; B: AtlasIndustrial.ForeArm.MakerPlate.Mount; }+ Interface<Fixed> UpperArmPanelStandoff1Mount { A: AtlasIndustrial.UpperArm.Housing.UpperArmPanelStandoff1Seat; B: AtlasIndustrial.UpperArm.UpperArmPanelStandoff1.Mount; }+ Interface<Fixed> UpperArmPanelBolt1Mount { A: AtlasIndustrial.UpperArm.Housing.UpperArmPanelBolt1Seat; B: AtlasIndustrial.UpperArm.UpperArmPanelBolt1.Mount; }+ Interface<Fixed> UpperArmPanelStandoff2Mount { A: AtlasIndustrial.UpperArm.Housing.UpperArmPanelStandoff2Seat; B: AtlasIndustrial.UpperArm.UpperArmPanelStandoff2.Mount; }+ Interface<Fixed> UpperArmPanelBolt2Mount { A: AtlasIndustrial.UpperArm.Housing.UpperArmPanelBolt2Seat; B: AtlasIndustrial.UpperArm.UpperArmPanelBolt2.Mount; }+ Interface<Fixed> UpperArmPanelStandoff3Mount { A: AtlasIndustrial.UpperArm.Housing.UpperArmPanelStandoff3Seat; B: AtlasIndustrial.UpperArm.UpperArmPanelStandoff3.Mount; }+ Interface<Fixed> UpperArmPanelBolt3Mount { A: AtlasIndustrial.UpperArm.Housing.UpperArmPanelBolt3Seat; B: AtlasIndustrial.UpperArm.UpperArmPanelBolt3.Mount; }+ Interface<Fixed> UpperArmPanelStandoff4Mount { A: AtlasIndustrial.UpperArm.Housing.UpperArmPanelStandoff4Seat; B: AtlasIndustrial.UpperArm.UpperArmPanelStandoff4.Mount; }+ Interface<Fixed> UpperArmPanelBolt4Mount { A: AtlasIndustrial.UpperArm.Housing.UpperArmPanelBolt4Seat; B: AtlasIndustrial.UpperArm.UpperArmPanelBolt4.Mount; }+ Interface<Fixed> ForeArmPanelStandoff1Mount { A: AtlasIndustrial.ForeArm.Housing.ForeArmPanelStandoff1Seat; B: AtlasIndustrial.ForeArm.ForeArmPanelStandoff1.Mount; }+ Interface<Fixed> ForeArmPanelBolt1Mount { A: AtlasIndustrial.ForeArm.Housing.ForeArmPanelBolt1Seat; B: AtlasIndustrial.ForeArm.ForeArmPanelBolt1.Mount; }+ Interface<Fixed> ForeArmPanelStandoff2Mount { A: AtlasIndustrial.ForeArm.Housing.ForeArmPanelStandoff2Seat; B: AtlasIndustrial.ForeArm.ForeArmPanelStandoff2.Mount; }+ Interface<Fixed> ForeArmPanelBolt2Mount { A: AtlasIndustrial.ForeArm.Housing.ForeArmPanelBolt2Seat; B: AtlasIndustrial.ForeArm.ForeArmPanelBolt2.Mount; }+ Interface<Fixed> ForeArmPanelStandoff3Mount { A: AtlasIndustrial.ForeArm.Housing.ForeArmPanelStandoff3Seat; B: AtlasIndustrial.ForeArm.ForeArmPanelStandoff3.Mount; }+ Interface<Fixed> ForeArmPanelBolt3Mount { A: AtlasIndustrial.ForeArm.Housing.ForeArmPanelBolt3Seat; B: AtlasIndustrial.ForeArm.ForeArmPanelBolt3.Mount; }+ Interface<Fixed> ForeArmPanelStandoff4Mount { A: AtlasIndustrial.ForeArm.Housing.ForeArmPanelStandoff4Seat; B: AtlasIndustrial.ForeArm.ForeArmPanelStandoff4.Mount; }+ Interface<Fixed> ForeArmPanelBolt4Mount { A: AtlasIndustrial.ForeArm.Housing.ForeArmPanelBolt4Seat; B: AtlasIndustrial.ForeArm.ForeArmPanelBolt4.Mount; }+ Interface<Fixed> LeftPadMount { A: AtlasIndustrial.Gripper.LeftJaw.LeftPadSeat; B: AtlasIndustrial.Gripper.LeftPad.Mount; }+ Interface<Fixed> RightPadMount { A: AtlasIndustrial.Gripper.RightJaw.RightPadSeat; B: AtlasIndustrial.Gripper.RightPad.Mount; }+}diff --git a/fixtures/Canonical/AssemblyInterfaces/IndustrialAtlas/fore-housing.firmament b/fixtures/Canonical/AssemblyInterfaces/IndustrialAtlas/fore-housing.firmamentnew file mode 100644index 00000000..011419bc--- /dev/null+++ b/fixtures/Canonical/AssemblyInterfaces/IndustrialAtlas/fore-housing.firmament@@ -0,0 +1,55 @@+// Smooth, tapered mechanical housing. Exact capped SectionChain; millimetres.+Model AtlasForeHousing {+ Units: mm+ Concept Struct Stations {+ A: Plane { Origin: [0mm,0mm,0mm] Normal: [1,0,0] Up: [0,0,1] }+ B: Plane { Origin: [25mm,0mm,0mm] Normal: [1,0,0] Up: [0,0,1] }+ C: Plane { Origin: [90mm,0mm,0mm] Normal: [1,0,0] Up: [0,0,1] }+ D: Plane { Origin: [160mm,0mm,0mm] Normal: [1,0,0] Up: [0,0,1] }+ E: Plane { Origin: [180mm,0mm,0mm] Normal: [1,0,0] Up: [0,0,1] }+ }+ Construction Plane FA { Trace: Stations.A }+ Construction Plane FB { Trace: Stations.B }+ Construction Plane FC { Trace: Stations.C }+ Construction Plane FD { Trace: Stations.D }+ Construction Plane FE { Trace: Stations.E }+ RoundedRect2 Root { Center: [0mm,0mm] Size: [48mm,52mm] Radius: 12mm }+ RoundedRect2 Belly { Center: [0mm,0mm] Size: [50mm,56mm] Radius: 12mm }+ RoundedRect2 Waist { Center: [0mm,0mm] Size: [34mm,34mm] Radius: 10mm }+ RoundedRect2 Tip { Center: [0mm,0mm] Size: [32mm,36mm] Radius: 10mm }+ Profile PRoot { Loop Outer { Root |> TraceLoop } }+ Profile PBelly { Loop Outer { Belly |> TraceLoop } }+ Profile PWaist { Loop Outer { Waist |> TraceLoop } }+ Profile PTip { Loop Outer { Tip |> TraceLoop } }+ SectionChain Housing {+ Continuity: G1+ ApproximationTolerance: 0.0001mm+ Section A {+ Frame: FA+ Profile: PRoot+ Seam: Bottom+ }+ Section B {+ Frame: FB+ Profile: PBelly+ Seam: Bottom+ }+ Section C {+ Frame: FC+ Profile: PWaist+ Seam: Bottom+ }+ Section D {+ Frame: FD+ Profile: PTip+ Seam: Bottom+ }+ Section E {+ Frame: FE+ Profile: PTip+ Seam: Bottom+ }+ Start: Cap+ End: Cap+ }+}diff --git a/fixtures/Canonical/AssemblyInterfaces/IndustrialAtlas/upper-housing.firmament b/fixtures/Canonical/AssemblyInterfaces/IndustrialAtlas/upper-housing.firmamentnew file mode 100644index 00000000..efaeee92--- /dev/null+++ b/fixtures/Canonical/AssemblyInterfaces/IndustrialAtlas/upper-housing.firmament@@ -0,0 +1,55 @@+// Smooth, tapered mechanical housing. Exact capped SectionChain; millimetres.+Model AtlasUpperHousing {+ Units: mm+ Concept Struct Stations {+ A: Plane { Origin: [0mm,0mm,0mm] Normal: [1,0,0] Up: [0,0,1] }+ B: Plane { Origin: [32mm,0mm,0mm] Normal: [1,0,0] Up: [0,0,1] }+ C: Plane { Origin: [105mm,0mm,0mm] Normal: [1,0,0] Up: [0,0,1] }+ D: Plane { Origin: [175mm,0mm,0mm] Normal: [1,0,0] Up: [0,0,1] }+ E: Plane { Origin: [200mm,0mm,0mm] Normal: [1,0,0] Up: [0,0,1] }+ }+ Construction Plane FA { Trace: Stations.A }+ Construction Plane FB { Trace: Stations.B }+ Construction Plane FC { Trace: Stations.C }+ Construction Plane FD { Trace: Stations.D }+ Construction Plane FE { Trace: Stations.E }+ RoundedRect2 Root { Center: [0mm,0mm] Size: [62mm,66mm] Radius: 16mm }+ RoundedRect2 Belly { Center: [0mm,0mm] Size: [60mm,72mm] Radius: 16mm }+ RoundedRect2 Waist { Center: [0mm,0mm] Size: [42mm,48mm] Radius: 12mm }+ RoundedRect2 Tip { Center: [0mm,0mm] Size: [48mm,52mm] Radius: 14mm }+ Profile PRoot { Loop Outer { Root |> TraceLoop } }+ Profile PBelly { Loop Outer { Belly |> TraceLoop } }+ Profile PWaist { Loop Outer { Waist |> TraceLoop } }+ Profile PTip { Loop Outer { Tip |> TraceLoop } }+ SectionChain Housing {+ Continuity: G1+ ApproximationTolerance: 0.0001mm+ Section A {+ Frame: FA+ Profile: PRoot+ Seam: Bottom+ }+ Section B {+ Frame: FB+ Profile: PBelly+ Seam: Bottom+ }+ Section C {+ Frame: FC+ Profile: PWaist+ Seam: Bottom+ }+ Section D {+ Frame: FD+ Profile: PTip+ Seam: Bottom+ }+ Section E {+ Frame: FE+ Profile: PTip+ Seam: Bottom+ }+ Start: Cap+ End: Cap+ }+}diff --git a/fixtures/Canonical/AssemblyInterfaces/external-occt-slider-usd.firmament b/fixtures/Canonical/AssemblyInterfaces/external-occt-slider-usd.firmamentnew file mode 100644index 00000000..18d5bef1--- /dev/null+++ b/fixtures/Canonical/AssemblyInterfaces/external-occt-slider-usd.firmament@@ -0,0 +1,15 @@+// USD witness: third-party OCCT STEP, preserving the accepted Prismatic Interface contract.+// One external STEP definition is reused by both occurrence identities.+// Firmament owns the authored interface ports; the STEP part needs no mate metadata.+Assembly ExternalSlider {+ <Assembly ExternalSlider>+ <Part Rail = ExternalStep<"../../../testdata/step242/OCCT/rod.step">>+ Semantic Slide { DatumFrame Frame = [0,0,0] x [1,0,0] y [0,1,0] z [0,0,1]; }+ </Part>+ <Part Carriage = ExternalStep<"../../../testdata/step242/OCCT/rod.step">>+ Semantic Slide { DatumFrame Frame = [0,0,0] x [1,0,0] y [0,1,0] z [0,0,1]; }+ </Part>+ </Assembly>+ Anchor: ExternalSlider.Rail.Slide;+ Interface<Prismatic> Travel { A: ExternalSlider.Rail.Slide; B: ExternalSlider.Carriage.Slide; }+}diff --git a/fixtures/Canonical/AssemblyInterfaces/fixed-nested-usd.firmament b/fixtures/Canonical/AssemblyInterfaces/fixed-nested-usd.firmamentnew file mode 100644index 00000000..2a56507b--- /dev/null+++ b/fixtures/Canonical/AssemblyInterfaces/fixed-nested-usd.firmament@@ -0,0 +1,26 @@+Template < R: Length > Struct Sleeve {+ Circle2 Outside { Center: [0mm,0mm] Radius: R }+ Circle2 Inside { Center: [0mm,0mm] Radius: 15mm }+ Profile Section { Loop Outer { Outside |> TraceLoop } Loop Inner { Inside As InnerBoundary |> TraceLoop } }+ Extrude Body { Profile: Section From: -10mm To: 10mm }+}+Assembly FixedNested {+ <Assembly FixedNested>+ <Part Base = Sleeve<R: 20mm>>+ Placement LegacyExplicit = [1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1];+ </Part>+ <Assembly Module>+ Placement LegacyExplicit = [0.7071067811865476,0.7071067811865475,0,0,-0.7071067811865475,0.7071067811865476,0,0,0,0,1,0,40,10,3,1];+ <Part First = Sleeve<R: 20mm>>+ Placement LegacyExplicit = [1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1];+ Semantic Mount { DatumFrame Frame = [0,0,0] x [1,0,0] y [0,1,0] z [0,0,1]; }+ Semantic Output { DatumFrame Frame = [60,0,0] x [1,0,0] y [0,1,0] z [0,0,1]; }+ </Part>+ <Part Second = Sleeve<R: 20mm>>+ Semantic Mount { DatumFrame Frame = [0,0,0] x [1,0,0] y [0,1,0] z [0,0,1]; }+ </Part>+ </Assembly>+ </Assembly>+ Anchor: FixedNested;+ Interface<Fixed> Seat { A: FixedNested.Module.First.Output; B: FixedNested.Module.Second.Mount; }+}diff --git a/fixtures/Canonical/AssemblyInterfaces/physical-ai-demo.appearance.json b/fixtures/Canonical/AssemblyInterfaces/physical-ai-demo.appearance.jsonnew file mode 100644index 00000000..9dc8a5ce--- /dev/null+++ b/fixtures/Canonical/AssemblyInterfaces/physical-ai-demo.appearance.json@@ -0,0 +1,8 @@+{+ "Pedestal<R: 50mm, H: 60mm>": { "red": 0.12, "green": 0.15, "blue": 0.21, "metallic": 0.8, "roughness": 0.24 },+ "GuardLink<L: 160mm, W: 44mm, H: 22mm>": { "red": 0.54, "green": 0.61, "blue": 0.72, "metallic": 0.85, "roughness": 0.22 },+ "GuardLink<L: 130mm, W: 34mm, H: 16mm>": { "red": 0.28, "green": 0.38, "blue": 0.49, "metallic": 0.8, "roughness": 0.26 },+ "JointRing<R: 26mm>": { "red": 0.04, "green": 0.57, "blue": 0.63, "metallic": 0.55, "roughness": 0.2 },+ "GripperHead<W: 54mm>": { "red": 0.11, "green": 0.14, "blue": 0.2, "metallic": 0.8, "roughness": 0.25 },+ "Finger<L: 45mm>": { "red": 0.64, "green": 0.69, "blue": 0.74, "metallic": 0.95, "roughness": 0.18 }+}diff --git a/fixtures/Canonical/AssemblyInterfaces/physical-ai-demo.firmament b/fixtures/Canonical/AssemblyInterfaces/physical-ai-demo.firmamentnew file mode 100644index 00000000..4f40c1c6--- /dev/null+++ b/fixtures/Canonical/AssemblyInterfaces/physical-ai-demo.firmament@@ -0,0 +1,88 @@+// ATLAS: exact Aetheris SCARA demonstrator. Appearance is a downstream USD override.+Template<R: Length, H: Length> Struct Pedestal {+ Circle2 Outside { Center: [0mm,0mm] Radius: R }+ Circle2 Inside { Center: [0mm,0mm] Radius: 36mm }+ Profile Section { Loop Outer { Outside |> TraceLoop } Loop Inner { Inside As InnerBoundary |> TraceLoop } }+ Extrude Body { Profile: Section From: 0mm To: H }+}+Template<L: Length, W: Length, H: Length> Struct GuardLink {+ Rect2 Stock { Center: [70mm,0mm] Size: [L,W] }+ Circle2 Vent1 { Center: [40mm,0mm] Radius: 7mm }+ Circle2 Vent2 { Center: [60mm,0mm] Radius: 7mm }+ Circle2 Vent3 { Center: [80mm,0mm] Radius: 7mm }+ Profile Section {+ Loop Outer { Stock.Bottom |> Stock.Right |> Stock.Top |> Stock.Left |> Close }+ Loop Vent1 { Vent1 As Vent1Boundary |> TraceLoop }+ Loop Vent2 { Vent2 As Vent2Boundary |> TraceLoop }+ Loop Vent3 { Vent3 As Vent3Boundary |> TraceLoop }+ }+ Extrude Body { Profile: Section From: 0mm To: H }+}+Template<R: Length> Struct JointRing {+ Circle2 Outside { Center: [0mm,0mm] Radius: R }+ Circle2 Inside { Center: [0mm,0mm] Radius: 13mm }+ Profile Section { Loop Outer { Outside |> TraceLoop } Loop Inner { Inside As InnerBoundary |> TraceLoop } }+ Extrude Body { Profile: Section From: -3mm To: 3mm }+}+Template<W: Length> Struct GripperHead {+ Rect2 Stock { Center: [0mm,0mm] Size: [28mm,W] }+ Profile Section { Loop Outer { Stock.Bottom |> Stock.Right |> Stock.Top |> Stock.Left |> Close } }+ Extrude Body { Profile: Section From: 0mm To: 18mm }+}+Template<L: Length> Struct Finger {+ Rect2 Stock { Center: [22.5mm,0mm] Size: [L,8mm] }+ Profile Section { Loop Outer { Stock.Bottom |> Stock.Right |> Stock.Top |> Stock.Left |> Close } }+ Extrude Body { Profile: Section From: -20mm To: 0mm }+}+Assembly Atlas {+ <Assembly Atlas>+ <Part Base = Pedestal<R: 50mm, H: 60mm>>+ Semantic Hinge { DatumFrame Frame = [0,0,60] x [1,0,0] y [0,1,0] z [0,0,1]; }+ </Part>+ <Assembly UpperArm>+ Placement LegacyExplicit = [1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1];+ <Part Housing = GuardLink<L: 160mm, W: 44mm, H: 22mm>>+ Semantic Input { DatumFrame Frame = [0,0,0] x [1,0,0] y [0,1,0] z [0,0,1]; }+ Semantic Output { DatumFrame Frame = [150,0,24] x [1,0,0] y [0,1,0] z [0,0,1]; }+ Semantic Collar { DatumFrame Frame = [0,0,24] x [1,0,0] y [0,1,0] z [0,0,1]; }+ </Part>+ <Part ShoulderCollar = JointRing<R: 26mm>>+ Semantic Mount { DatumFrame Frame = [0,0,0] x [1,0,0] y [0,1,0] z [0,0,1]; }+ </Part>+ <Part ElbowCollar = JointRing<R: 26mm>>+ Semantic Mount { DatumFrame Frame = [0,0,0] x [1,0,0] y [0,1,0] z [0,0,1]; }+ </Part>+ </Assembly>+ <Assembly ForeArm>+ Placement LegacyExplicit = [1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1];+ <Part Housing = GuardLink<L: 130mm, W: 34mm, H: 16mm>>+ Semantic Input { DatumFrame Frame = [0,0,0] x [1,0,0] y [0,1,0] z [0,0,1]; }+ Semantic Output { DatumFrame Frame = [130,0,20] x [1,0,0] y [0,1,0] z [0,0,1]; }+ Semantic Collar { DatumFrame Frame = [0,0,20] x [1,0,0] y [0,1,0] z [0,0,1]; }+ </Part>+ <Part WristCollar = JointRing<R: 26mm>>+ Semantic Mount { DatumFrame Frame = [0,0,0] x [1,0,0] y [0,1,0] z [0,0,1]; }+ </Part>+ </Assembly>+ <Part Wrist = GripperHead<W: 54mm>>+ Semantic Mount { DatumFrame Frame = [0,0,0] x [1,0,0] y [0,1,0] z [0,0,1]; }+ Semantic Left { DatumFrame Frame = [0,12,0] x [1,0,0] y [0,0,-1] z [0,1,0]; }+ Semantic Right { DatumFrame Frame = [0,-12,0] x [1,0,0] y [0,0,1] z [0,-1,0]; }+ </Part>+ <Part LeftFinger = Finger<L: 45mm>>+ Semantic Slide { DatumFrame Frame = [0,0,0] x [1,0,0] y [0,0,-1] z [0,1,0]; }+ </Part>+ <Part RightFinger = Finger<L: 45mm>>+ Semantic Slide { DatumFrame Frame = [0,0,0] x [1,0,0] y [0,0,1] z [0,-1,0]; }+ </Part>+ </Assembly>+ Anchor: Atlas.Base.Hinge;+ Interface<Revolute> Shoulder { A: Atlas.Base.Hinge; B: Atlas.UpperArm.Housing.Input; }+ Interface<Revolute> Elbow { A: Atlas.UpperArm.Housing.Output; B: Atlas.ForeArm.Housing.Input; }+ Interface<Fixed> WristMount { A: Atlas.ForeArm.Housing.Output; B: Atlas.Wrist.Mount; }+ Interface<Prismatic> GripLeft { A: Atlas.Wrist.Left; B: Atlas.LeftFinger.Slide; }+ Interface<Prismatic> GripRight { A: Atlas.Wrist.Right; B: Atlas.RightFinger.Slide; }+ Interface<Fixed> ShoulderTrim { A: Atlas.UpperArm.Housing.Collar; B: Atlas.UpperArm.ShoulderCollar.Mount; }+ Interface<Fixed> ElbowTrim { A: Atlas.UpperArm.Housing.Output; B: Atlas.UpperArm.ElbowCollar.Mount; }+ Interface<Fixed> WristTrim { A: Atlas.ForeArm.Housing.Output; B: Atlas.ForeArm.WristCollar.Mount; }+}diff --git a/fixtures/Canonical/AssemblyInterfaces/two-link-arm-usd.firmament b/fixtures/Canonical/AssemblyInterfaces/two-link-arm-usd.firmamentnew file mode 100644index 00000000..5c487513--- /dev/null+++ b/fixtures/Canonical/AssemblyInterfaces/two-link-arm-usd.firmament@@ -0,0 +1,28 @@+// Production geometry for the canonical Interface-only arm witness.+Template<R: Length> Struct ArmBase {+ Circle2 Outside { Center: [0mm,0mm] Radius: R }+ Profile Section { Loop Outer { Outside |> TraceLoop } }+ Extrude Body { Profile: Section From: -4mm To: 0mm }+}+Template<L: Length> Struct ArmLink {+ Rect2 Stock { Center: [10mm,0mm] Size: [L,5mm] }+ Profile Section { Loop Outer { Stock.Bottom |> Stock.Right |> Stock.Top |> Stock.Left |> Close } }+ Extrude Body { Profile: Section From: 0mm To: 3mm }+}+Assembly TwoLinkArm {+ <Assembly TwoLinkArm>+ <Part Base = ArmBase<R: 8mm>>+ Semantic Hinge { DatumFrame Frame = [0,0,0] x [1,0,0] y [0,1,0] z [0,0,1]; }+ </Part>+ <Part Link1 = ArmLink<L: 20mm>>+ Semantic Input { DatumFrame Frame = [0,0,0] x [1,0,0] y [0,1,0] z [0,0,1]; }+ Semantic Output { DatumFrame Frame = [20,0,0] x [1,0,0] y [0,1,0] z [0,0,1]; }+ </Part>+ <Part Link2 = ArmLink<L: 20mm>>+ Semantic Input { DatumFrame Frame = [0,0,0] x [1,0,0] y [0,1,0] z [0,0,1]; }+ </Part>+ </Assembly>+ Anchor: TwoLinkArm.Base.Hinge;+ Interface<Revolute> Shoulder { A: TwoLinkArm.Base.Hinge; B: TwoLinkArm.Link1.Input; }+ Interface<Revolute> Elbow { A: TwoLinkArm.Link1.Output; B: TwoLinkArm.Link2.Input; }+}diff --git a/scripts/capture-usd-export-x0.py b/scripts/capture-usd-export-x0.pynew file mode 100644index 00000000..120f0933--- /dev/null+++ b/scripts/capture-usd-export-x0.py@@ -0,0 +1,62 @@+"""Capture the real usdview window and Hydra viewport via usdview's own API.++USD_X0_CAPTURE_DIR sets output (default artifacts/local/usd-x0/captures).+USD_X0_FRAMES sets comma-separated frames (default 0,48,96).+Pass ordinary usdview arguments, including --camera for a presentation stage.+"""+import json+import os+import time+from pathlib import Path+from pxr import Usd, Usdviewq+++class Capture(Usdviewq.Launcher):+ def LaunchProcess(self, args, app, controller):+ api = controller._usdviewApi+ output = Path(os.getenv("USD_X0_CAPTURE_DIR", "artifacts/local/usd-x0/captures"))+ output.mkdir(parents=True, exist_ok=True)+ api.qMainWindow.resize(1600, 1000)+ api.dataModel.viewSettings.showBBoxes = False+ api.dataModel.viewSettings.showHUD = False+ api.dataModel.viewSettings.domeLightTexturesVisible = False+ controller._ui.primView.expandAll()+ if not api.cameraPrim:+ api.dataModel.viewSettings.freeCamera.rotTheta = -25+ api.dataModel.viewSettings.freeCamera.rotPhi = 55+ api.viewerMode = True+ frames = [float(f) for f in os.getenv("USD_X0_FRAMES", "0,48,96").split(",")]+ for frame in frames:+ if controller._timeSamples:+ controller.setFrame(frame)+ for _ in range(30):+ app.processEvents()+ api.UpdateViewport()+ time.sleep(.04)+ assert api.GrabViewportShot().save(str(output / f"render-{frame:g}.png"))+ # Select a real joint so the properties pane proves its schema/relationships.+ joint = next((p for p in api.stage.Traverse() if p.HasAttribute("aetheris:interfaceFamily")), None)+ api.viewerMode = False+ for prim in api.stage.Traverse():+ if prim.GetName() == "Geometry":+ controller._getItemAtPath(prim.GetPath()).setExpanded(False)+ for path in ["/Looks", "/Presentation"]:+ if api.stage.GetPrimAtPath(path):+ controller._getItemAtPath(path).setExpanded(False)+ if joint:+ api.dataModel.selection.setPrimPath(joint.GetPath())+ api.UpdateGUI()+ controller._ui.primView.scrollToItem(controller._getItemAtPath(joint.GetPath(), ensureExpanded=True))+ for _ in range(10):+ app.processEvents()+ time.sleep(.03)+ assert api.GrabWindowShot().save(str(output / "hierarchy.png"))+ report = dict(tool="usdview", version=Usd.GetVersion(), stage=api.stageIdentifier,+ renderer=api.GetViewportCurrentRendererId(), capturedFrames=frames,+ jointPrim=str(joint.GetPath()) if joint else None)+ (output / "viewer.json").write_text(json.dumps(report, indent=2) + "\n")+ print(json.dumps(report))+ app.closeAllWindows()+++Capture().Run()diff --git a/scripts/prepare-industrial-atlas-studio.py b/scripts/prepare-industrial-atlas-studio.pynew file mode 100644index 00000000..af183be1--- /dev/null+++ b/scripts/prepare-industrial-atlas-studio.py@@ -0,0 +1,136 @@+"""Compose a presentation layer over the exact IndustrialAtlas USD export.++The floor, lights, camera, chrome target and printed maker label are presentation+assets. Product solids, hierarchy, instancing and motion are unchanged.+Run with NVIDIA's OpenUSD Python distribution, as in qualify-usd-export-x0.ps1.+"""+import argparse+import importlib.util+import math+import os+from pathlib import Path+from pxr import Gf, Sdf, Usd, UsdGeom, UsdLux, UsdShade+_spec = importlib.util.spec_from_file_location("studio", Path(__file__).with_name("prepare-usd-x0-studio.py"))+_studio = importlib.util.module_from_spec(_spec)+_spec.loader.exec_module(_studio)+material = _studio.material+++def maker_texture(path):+ # Deterministic typography from the same bundled font used by Aetheris.+ from PySide6.QtGui import QFont, QFontDatabase, QImage, QPainter, QColor+ from PySide6.QtWidgets import QApplication+ app = QApplication.instance() or QApplication([])+ font_path = Path(__file__).resolve().parents[1] / "Aetheris.Kernel.Firmament/Resources/Inter-Regular.ttf"+ font_id = QFontDatabase.addApplicationFont(str(font_path))+ assert font_id >= 0+ family = QFontDatabase.applicationFontFamilies(font_id)[0]+ image = QImage(1024, 192, QImage.Format_RGB32)+ image.fill(QColor(192, 200, 211))+ painter = QPainter(image)+ painter.setRenderHint(QPainter.Antialiasing)+ painter.setPen(QColor(24, 30, 39))+ font = QFont(family); font.setPixelSize(78)+ painter.setFont(font); painter.drawText(48, 98, "GPT 6.1 SOL CODEX")+ font.setPixelSize(30); painter.setFont(font)+ painter.drawText(51, 157, "AETHERIS / ATLAS-02 / EXACT CAD")+ painter.end()+ assert image.save(str(path))+++def prepare(source, output):+ source, output = Path(source).resolve(), Path(output).resolve()+ assert source != output+ output.parent.mkdir(parents=True, exist_ok=True)+ stage = Usd.Stage.CreateNew(str(output))+ stage.GetRootLayer().subLayerPaths = [os.path.relpath(source, output.parent).replace("\\", "/")]+ product = Usd.Stage.Open(str(source))+ for set_value, get_value in [(stage.SetStartTimeCode, product.GetStartTimeCode),+ (stage.SetEndTimeCode, product.GetEndTimeCode),+ (stage.SetTimeCodesPerSecond, product.GetTimeCodesPerSecond)]:+ set_value(get_value())+ UsdGeom.SetStageMetersPerUnit(stage, UsdGeom.GetStageMetersPerUnit(product))+ UsdGeom.SetStageUpAxis(stage, UsdGeom.GetStageUpAxis(product))+ stage.SetDefaultPrim(stage.GetPrimAtPath("/Assembly"))+ UsdGeom.Xform.Define(stage, "/Presentation").GetPrim().CreateAttribute("aetheris:authority", Sdf.ValueTypeNames.String).Set("presentation-only")+ # Explicit presentation meshes keep material bindings across USD readers;+ # Blender 5.2 currently drops bindings on imported Cube/Sphere primitives.+ floor = UsdGeom.Mesh.Define(stage, "/Presentation/Floor")+ floor.CreatePointsAttr([Gf.Vec3f(-10000,-10000,-8),Gf.Vec3f(10000,-10000,-8),Gf.Vec3f(10000,10000,-8),Gf.Vec3f(-10000,10000,-8)])+ floor.CreateFaceVertexCountsAttr([4]); floor.CreateFaceVertexIndicesAttr([0,1,2,3])+ floor.CreateSubdivisionSchemeAttr("none"); floor.CreateNormalsAttr([Gf.Vec3f(0,0,1)]*4)+ UsdShade.MaterialBindingAPI.Apply(floor.GetPrim()).Bind(material(stage, "Graphite", (.018, .022, .03), .08, .31))+ gripper = next(p for p in stage.Traverse() if p.GetAttribute("aetheris:sourcePath").Get() == "AtlasIndustrial.Gripper.Body")+ sphere = UsdGeom.Mesh.Define(stage, "/Presentation/ChromeTarget")+ normals = [Gf.Vec3f(0,0,1)]+ for latitude in range(1,32):+ theta=math.pi*latitude/32+ for longitude in range(64):+ phi=2*math.pi*longitude/64+ normals.append(Gf.Vec3f(math.sin(theta)*math.cos(phi),math.sin(theta)*math.sin(phi),math.cos(theta)))+ normals.append(Gf.Vec3f(0,0,-1))+ points=[n*22 for n in normals]; faces=[]+ for i in range(64): faces.extend([0,1+i,1+(i+1)%64])+ for ring in range(30):+ for i in range(64):+ a=1+ring*64+i;b=1+ring*64+(i+1)%64;c=a+64;d=b+64+ faces.extend([a,c,b,b,c,d])+ for i in range(64): faces.extend([len(points)-1,1+30*64+(i+1)%64,1+30*64+i])+ sphere.CreatePointsAttr(points);sphere.CreateNormalsAttr(normals)+ sphere.CreateFaceVertexCountsAttr([3]*(len(faces)//3));sphere.CreateFaceVertexIndicesAttr(faces)+ sphere.CreateSubdivisionSchemeAttr("none");sphere.SetNormalsInterpolation("vertex")+ translate = sphere.AddTranslateOp()+ translate.Set(UsdGeom.XformCache().GetLocalToWorldTransform(gripper).Transform(Gf.Vec3d(58, 0, 14)))+ for frame in range(int(stage.GetStartTimeCode()), int(stage.GetEndTimeCode()) + 1):+ translate.Set(UsdGeom.XformCache(frame).GetLocalToWorldTransform(gripper).Transform(Gf.Vec3d(58, 0, 14)), frame)+ UsdShade.MaterialBindingAPI.Apply(sphere.GetPrim()).Bind(material(stage, "Chrome", (.8, .84, .9), 1, .07))+ maker = next(p for p in stage.Traverse() if p.GetAttribute("aetheris:sourcePath").Get() == "AtlasIndustrial.ForeArm.MakerPlate")+ label = UsdGeom.Mesh.Define(stage, str(maker.GetPath()) + "/PrintedLabel")+ label.CreatePointsAttr([Gf.Vec3f(4, -7, 2.3), Gf.Vec3f(80, -7, 2.3), Gf.Vec3f(80, 7, 2.3), Gf.Vec3f(4, 7, 2.3)])+ label.CreateFaceVertexCountsAttr([4]); label.CreateFaceVertexIndicesAttr([0, 1, 2, 3])+ label.CreateSubdivisionSchemeAttr("none")+ label.CreateNormalsAttr([Gf.Vec3f(0, 0, 1)] * 4)+ UsdGeom.PrimvarsAPI(label).CreatePrimvar("st", Sdf.ValueTypeNames.TexCoord2fArray, "vertex").Set([Gf.Vec2f(1, 1), Gf.Vec2f(0, 1), Gf.Vec2f(0, 0), Gf.Vec2f(1, 0)])+ label.GetPrim().CreateAttribute("aetheris:authority", Sdf.ValueTypeNames.String).Set("presentation-only printed maker mark")+ texture = output.parent / "maker-label.png"+ maker_texture(texture)+ m = material(stage, "MakerLabel", (.6, .64, .7), .45, .3)+ shader = UsdShade.Shader(stage.GetPrimAtPath(str(m.GetPath()) + "/Surface"))+ reader = UsdShade.Shader.Define(stage, str(m.GetPath()) + "/UV")+ reader.CreateIdAttr("UsdPrimvarReader_float2")+ reader.CreateInput("varname", Sdf.ValueTypeNames.String).Set("st")+ reader.CreateOutput("result", Sdf.ValueTypeNames.Float2)+ tex = UsdShade.Shader.Define(stage, str(m.GetPath()) + "/Texture")+ tex.CreateIdAttr("UsdUVTexture")+ tex.CreateInput("file", Sdf.ValueTypeNames.Asset).Set(Sdf.AssetPath(texture.name))+ tex.CreateInput("sourceColorSpace", Sdf.ValueTypeNames.Token).Set("sRGB")+ tex.CreateInput("st", Sdf.ValueTypeNames.Float2).ConnectToSource(reader.ConnectableAPI(), "result")+ tex.CreateOutput("rgb", Sdf.ValueTypeNames.Float3)+ shader.GetInput("diffuseColor").ConnectToSource(tex.ConnectableAPI(), "rgb")+ UsdShade.MaterialBindingAPI.Apply(label.GetPrim()).Bind(m)+ target = Gf.Vec3d(30, 0, 170)+ for name, position, intensity, color, size in [+ ("Key", (160, -330, 650), 4, (1, .9, .78), 300),+ ("Rim", (-240, 260, 440), 3, (.68, .8, 1), 250),+ ("Fill", (300, -400, 230), 1.8, (1, .98, .93), 200)]:+ light = UsdLux.RectLight.Define(stage, "/Presentation/Lights/" + name)+ light.CreateIntensityAttr(intensity); light.CreateColorAttr(Gf.Vec3f(*color))+ light.CreateWidthAttr(size); light.CreateHeightAttr(size)+ light.AddTransformOp().Set(Gf.Matrix4d().SetLookAt(Gf.Vec3d(*position), target, Gf.Vec3d(0, 0, 1)).GetInverse())+ dome = UsdLux.DomeLight.Define(stage, "/Presentation/Lights/Environment")+ dome.CreateIntensityAttr(.15); dome.CreateColorAttr(Gf.Vec3f(.3, .36, .46))+ camera = UsdGeom.Camera.Define(stage, "/Presentation/HeroCamera")+ camera.AddTransformOp().Set(Gf.Matrix4d().SetLookAt(Gf.Vec3d(-430, -900, 390), Gf.Vec3d(-125, 0, 145), Gf.Vec3d(0, 0, 1)).GetInverse())+ camera.CreateFocalLengthAttr(48)+ camera.CreateHorizontalApertureAttr(36); camera.CreateVerticalApertureAttr(20.25)+ camera.CreateClippingRangeAttr(Gf.Vec2f(.1, 10000))+ stage.GetRootLayer().Save()+ print(output)+++if __name__ == "__main__":+ parser = argparse.ArgumentParser(description=__doc__)+ parser.add_argument("source")+ parser.add_argument("output", nargs="?", default="artifacts/local/usd-industrial/atlas-studio.usda")+ args = parser.parse_args()+ prepare(args.source, args.output)diff --git a/scripts/prepare-usd-x0-studio.py b/scripts/prepare-usd-x0-studio.pynew file mode 100644index 00000000..c5e14bc6--- /dev/null+++ b/scripts/prepare-usd-x0-studio.py@@ -0,0 +1,81 @@+"""Add presentation-only studio, camera, lights and chrome sphere as a separate USD layer.++Engineering geometry and motion remain referenced from the unmodified exported assembly.+Run using the external OpenUSD SDK. No physics or engineering model is authored here.+"""+import argparse+from pathlib import Path+from pxr import Gf, Sdf, Usd, UsdGeom, UsdLux, UsdShade+++def material(stage, name, color, metallic, roughness):+ m = UsdShade.Material.Define(stage, "/Presentation/Looks/" + name)+ shader = UsdShade.Shader.Define(stage, str(m.GetPath()) + "/Surface")+ shader.CreateIdAttr("UsdPreviewSurface")+ shader.CreateInput("diffuseColor", Sdf.ValueTypeNames.Color3f).Set(Gf.Vec3f(*color))+ shader.CreateInput("metallic", Sdf.ValueTypeNames.Float).Set(metallic)+ shader.CreateInput("roughness", Sdf.ValueTypeNames.Float).Set(roughness)+ m.CreateSurfaceOutput().ConnectToSource(shader.ConnectableAPI(), "surface")+ return m+++def prepare(source, output, environment=None):+ source, output = Path(source).resolve(), Path(output).resolve()+ assert source != output+ output.parent.mkdir(parents=True, exist_ok=True)+ stage = Usd.Stage.CreateNew(str(output))+ import os+ stage.GetRootLayer().subLayerPaths = [os.path.relpath(source, output.parent).replace("\\", "/")]+ assembly_stage = Usd.Stage.Open(str(source))+ stage.SetStartTimeCode(assembly_stage.GetStartTimeCode())+ stage.SetEndTimeCode(assembly_stage.GetEndTimeCode())+ stage.SetTimeCodesPerSecond(assembly_stage.GetTimeCodesPerSecond())+ UsdGeom.SetStageMetersPerUnit(stage, UsdGeom.GetStageMetersPerUnit(assembly_stage))+ UsdGeom.SetStageUpAxis(stage, UsdGeom.GetStageUpAxis(assembly_stage))+ stage.SetDefaultPrim(stage.GetPrimAtPath("/Assembly"))+ UsdGeom.Xform.Define(stage, "/Presentation").GetPrim().CreateAttribute("aetheris:authority", Sdf.ValueTypeNames.String).Set("presentation-only")+ floor = UsdGeom.Cube.Define(stage, "/Presentation/Stage")+ floor.CreateSizeAttr(1)+ floor.AddTranslateOp().Set(Gf.Vec3d(70,75,-8))+ floor.AddScaleOp().Set(Gf.Vec3d(470,430,12))+ UsdShade.MaterialBindingAPI.Apply(floor.GetPrim()).Bind(material(stage,"Stage",(.025,.035,.055),.15,.32))+ # Sphere is a visual target; it is deliberately outside Aetheris's product tree.+ sphere = UsdGeom.Sphere.Define(stage, "/Presentation/ChromeTarget")+ sphere.CreateRadiusAttr(14)+ target = sphere.AddTranslateOp()+ wrist = next(p for p in stage.Traverse() if p.GetAttribute("aetheris:sourcePath").Get() == "Atlas.Wrist")+ target.Set(UsdGeom.XformCache().GetLocalToWorldTransform(wrist).Transform(Gf.Vec3d(28,0,-12)))+ for frame in range(int(stage.GetStartTimeCode()),int(stage.GetEndTimeCode())+1):+ target.Set(UsdGeom.XformCache(frame).GetLocalToWorldTransform(wrist).Transform(Gf.Vec3d(28,0,-12)),frame)+ UsdShade.MaterialBindingAPI.Apply(sphere.GetPrim()).Bind(material(stage,"Chrome",(.82,.86,.92),1,.09))+ for name, position, intensity, color, scale in [+ ("Key",(40,-180,400),3,(.85,.92,1),180),+ ("Rim",(0,360,300),2,(.3,.8,1),120),+ ("Fill",(350,80,240),1,(1,.8,.6),150)]:+ light=UsdLux.RectLight.Define(stage,"/Presentation/Lights/"+name)+ light.CreateIntensityAttr(intensity)+ light.CreateColorAttr(Gf.Vec3f(*color))+ light.CreateWidthAttr(scale);light.CreateHeightAttr(scale)+ light.AddTransformOp().Set(Gf.Matrix4d().SetLookAt(Gf.Vec3d(*position),Gf.Vec3d(85,100,55),Gf.Vec3d(0,0,1)).GetInverse())+ dome=UsdLux.DomeLight.Define(stage,"/Presentation/Lights/SoftEnvironment")+ dome.CreateIntensityAttr(.5)+ if environment:+ import shutil+ asset = output.parent / "studio-environment.hdr"+ shutil.copyfile(environment,asset)+ dome.CreateTextureFileAttr(Sdf.AssetPath(asset.name))+ camera=UsdGeom.Camera.Define(stage,"/Presentation/HeroCamera")+ camera.AddTransformOp().Set(Gf.Matrix4d().SetLookAt(Gf.Vec3d(440,510,400),Gf.Vec3d(100,100,65),Gf.Vec3d(0,0,1)).GetInverse())+ camera.CreateFocalLengthAttr(35)+ camera.CreateClippingRangeAttr(Gf.Vec2f(.1,10000))+ stage.GetRootLayer().Save()+ print(output)+++if __name__ == "__main__":+ parser=argparse.ArgumentParser(description=__doc__)+ parser.add_argument("source")+ parser.add_argument("output",nargs="?",default="artifacts/local/usd-x0/demo-studio.usda")+ parser.add_argument("--environment",help="Optional local HDR supplied by the installed NVIDIA tool distribution")+ args=parser.parse_args()+ prepare(args.source,args.output,args.environment)diff --git a/scripts/qualify-industrial-atlas.ps1 b/scripts/qualify-industrial-atlas.ps1new file mode 100644index 00000000..f1b1eb85--- /dev/null+++ b/scripts/qualify-industrial-atlas.ps1@@ -0,0 +1,69 @@+[CmdletBinding()]+param(+ [string]$OutDir = 'artifacts/local/usd-industrial',+ [string]$UsdRoot = 'artifacts/local/usd-x0/tools/openusd',+ [string]$Blender = 'C:/Program Files/Blender Foundation/Blender 5.2/blender.exe',+ [switch]$Render,+ [switch]$Motion+)+$ErrorActionPreference = 'Stop'+$repoRoot = Split-Path -Parent $PSScriptRoot+$priorPath = $env:PATH+$priorPython = $env:PYTHONPATH+$priorCapture = $env:USD_X0_CAPTURE_DIR+$priorFrames = $env:USD_X0_FRAMES+Push-Location $repoRoot+try {+ $out = [IO.Path]::GetFullPath($OutDir)+ $usd = [IO.Path]::GetFullPath($UsdRoot)+ $python = Join-Path $usd 'python/python.exe'+ if (!(Test-Path -LiteralPath $python)) { throw 'Install the pinned NVIDIA OpenUSD SDK with scripts/qualify-usd-export-x0.ps1 first, or provide -UsdRoot.' }+ New-Item -ItemType Directory -Force $out | Out-Null+ $env:PATH = "$usd/python;$usd/lib;$usd/bin;$usd/plugin/usd;" + $env:PATH+ $env:PYTHONPATH = "$usd/lib/python;$usd/pip-packages"+ function Invoke-Logged([string]$Program, [string[]]$Arguments, [string]$Log) {+ & $Program @Arguments *> $Log+ if ($LASTEXITCODE -ne 0) { throw "Command failed ($LASTEXITCODE): $Program. See $Log" }+ }+ $fixture = 'fixtures/Canonical/AssemblyInterfaces/IndustrialAtlas'+ $assembly = Join-Path $out 'atlas.usda'+ $evidence = Join-Path $out 'atlas.json'+ $exportArgs = @('Aetheris.CLI/bin/Release/net10.0/aetheris.dll','asm','export-usd',"$fixture/atlas-industrial.firmament",$assembly,+ '--materials',"$fixture/appearance.json",'--state','Shoulder=-75','--state','Elbow=-140','--state','GripLeft=10','--state','GripRight=10',+ '--evidence',$evidence,'--json')+ for ($frame=0; $frame -le 96; $frame++) {+ $blend = (1-[Math]::Cos(2*[Math]::PI*$frame/96))/2+ $shoulder = (-65-10*$blend).ToString('G17',[cultureinfo]::InvariantCulture)+ $elbow = (-120-20*$blend).ToString('G17',[cultureinfo]::InvariantCulture)+ $grip = (13-3*$blend).ToString('G17',[cultureinfo]::InvariantCulture)+ $exportArgs += @('--sample',"${frame}:Shoulder=$shoulder,Elbow=$elbow,GripLeft=$grip,GripRight=$grip")+ }+ Invoke-Logged 'dotnet' $exportArgs (Join-Path $out 'atlas-export.json')+ Invoke-Logged 'dotnet' @('Aetheris.CLI/bin/Release/net10.0/aetheris.dll','asm','export-ap242',"$fixture/atlas-industrial.firmament",'--out',(Join-Path $out 'atlas.step'),'--json') (Join-Path $out 'atlas-step-export.json')+ Invoke-Logged (Join-Path $usd 'bin/usdchecker.exe') @($assembly) (Join-Path $out 'atlas-checker.log')+ Invoke-Logged $python @('scripts/qualify-usd-export-x0.py',$assembly,$evidence,'--out',(Join-Path $out 'validation.json')) (Join-Path $out 'validation.log')+ $studio = Join-Path $out 'atlas-studio.usda'+ Invoke-Logged $python @('scripts/prepare-industrial-atlas-studio.py',$assembly,$studio) (Join-Path $out 'studio-prepare.log')+ Invoke-Logged (Join-Path $usd 'bin/usdchecker.exe') @($studio) (Join-Path $out 'studio-checker.log')+ $env:USD_X0_CAPTURE_DIR = Join-Path $out 'usdview'+ $env:USD_X0_FRAMES = '0,48,96'+ Invoke-Logged $python @('scripts/capture-usd-export-x0.py',$studio,'--camera','/Presentation/HeroCamera','--defaultsettings','--timing') (Join-Path $out 'viewer.log')+ if ($Render) {+ Invoke-Logged $Blender @('--background','--factory-startup','--python','scripts/render-industrial-atlas.py','--',$studio,(Join-Path $out 'atlas-hero.png')) (Join-Path $out 'blender-hero.log')+ }+ if ($Motion) {+ Invoke-Logged $Blender @('--background','--factory-startup','--python','scripts/render-industrial-atlas.py','--',$studio,(Join-Path $out 'atlas-motion.png'),'--motion') (Join-Path $out 'blender-motion.log')+ $frameList = Join-Path $out 'motion-frames.txt'+ $lines = 0..24 | ForEach-Object { "file '$((Join-Path $out ('motion-{0:d3}.png' -f ($_*4))).Replace('\','/'))'`nduration 0.166666667`n" }+ [IO.File]::WriteAllText($frameList,($lines -join ''))+ Invoke-Logged 'ffmpeg' @('-hide_banner','-y','-f','concat','-safe','0','-i',$frameList,'-r','24','-c:v','libx264','-crf','18','-pix_fmt','yuv420p',(Join-Path $out 'atlas-motion.mp4')) (Join-Path $out 'ffmpeg.log')+ }+ Write-Host "Qualified IndustrialAtlas artifacts: $out"+}+finally {+ $env:PATH=$priorPath+ $env:PYTHONPATH=$priorPython+ $env:USD_X0_CAPTURE_DIR=$priorCapture+ $env:USD_X0_FRAMES=$priorFrames+ Pop-Location+}diff --git a/scripts/qualify-usd-export-x0.ps1 b/scripts/qualify-usd-export-x0.ps1new file mode 100644index 00000000..a19851b5--- /dev/null+++ b/scripts/qualify-usd-export-x0.ps1@@ -0,0 +1,96 @@+[CmdletBinding()]+param(+ [string]$OutDir = 'artifacts/local/usd-x0',+ [string]$UsdRoot,+ [switch]$SkipBuild,+ [switch]$CaptureMotion+)+$ErrorActionPreference = 'Stop'+$repoRoot = Split-Path -Parent $PSScriptRoot+$previousPath = $env:PATH+$previousPythonPath = $env:PYTHONPATH+$previousCaptureDir = $env:USD_X0_CAPTURE_DIR+$previousFrames = $env:USD_X0_FRAMES+Push-Location $repoRoot+try {+ $out = [IO.Path]::GetFullPath($OutDir)+ New-Item -ItemType Directory -Force $out | Out-Null+ if (!$UsdRoot) { $UsdRoot = Join-Path $out 'tools/openusd' }+ $UsdRoot = [IO.Path]::GetFullPath($UsdRoot)+ $download = 'https://developer.nvidia.com/downloads/usd/usd_binaries/25.08/usd.py312.windows-x86_64.usdview.release-v25.08.71e038c1.zip'+ $sha256 = '61BAE28D18C873871047E7A8B3FE1FFE2188FB88FDDE113BE429812D27F0C8B4'+ if (!(Test-Path -LiteralPath (Join-Path $UsdRoot 'python/python.exe'))) {+ $zip = Join-Path $out 'tools/openusd-25.08.zip'+ New-Item -ItemType Directory -Force (Split-Path -Parent $zip) | Out-Null+ if (!(Test-Path -LiteralPath $zip)) { Invoke-WebRequest -Uri $download -OutFile $zip }+ if ((Get-FileHash -LiteralPath $zip -Algorithm SHA256).Hash -ne $sha256) { throw 'OpenUSD download checksum mismatch.' }+ Expand-Archive -LiteralPath $zip -DestinationPath $UsdRoot -Force+ }+ $env:PATH = "$UsdRoot/python;$UsdRoot/lib;$UsdRoot/bin;$UsdRoot/plugin/usd;" + $env:PATH+ $env:PYTHONPATH = "$UsdRoot/lib/python;$UsdRoot/pip-packages"+ $python = Join-Path $UsdRoot 'python/python.exe'+ function Invoke-Logged([string]$Program, [string[]]$Arguments, [string]$Log) {+ & $Program @Arguments *> $Log+ if ($LASTEXITCODE -ne 0) { throw "Command failed ($LASTEXITCODE): $Program. See $Log" }+ }+ if (!$SkipBuild) { Invoke-Logged 'dotnet' @('build','Aetheris.slnx','-c','Release','--no-restore','-m:1') (Join-Path $out 'build.log') }+ $cli = 'Aetheris.CLI/bin/Release/net10.0/aetheris.dll'+ $fixture = 'fixtures/Canonical/AssemblyInterfaces'+ $witnesses = @(+ @{ Name='fixed'; Source='fixed-nested-usd.firmament'; Options=@() },+ @{ Name='arm'; Source='two-link-arm-usd.firmament'; Options=@('--state','Shoulder=35','--state','Elbow=65','--sample','0:Shoulder=0,Elbow=0','--sample','48:Shoulder=35,Elbow=65','--sample','96:Shoulder=-20,Elbow=35') },+ @{ Name='slider'; Source='external-step-slider.firmament'; Options=@('--state','Travel=24') },+ @{ Name='occt-slider'; Source='external-occt-slider-usd.firmament'; Options=@('--state','Travel=120') },+ @{ Name='demo'; Source='physical-ai-demo.firmament'; Options=@('--state','Shoulder=25','--state','Elbow=80','--state','GripLeft=8','--state','GripRight=8','--materials',"$fixture/physical-ai-demo.appearance.json") }+ )+ for ($frame=0; $frame -le 96; $frame++) {+ $blend = if ($frame -le 48) { $frame / 48.0 } else { (96-$frame) / 48.0 }+ $shoulder=(5+20*$blend).ToString('G17',[cultureinfo]::InvariantCulture)+ $elbow=(20+60*$blend).ToString('G17',[cultureinfo]::InvariantCulture)+ $grip=(14-6*$blend).ToString('G17',[cultureinfo]::InvariantCulture)+ $witnesses[-1].Options += @('--sample',"${frame}:Shoulder=$shoulder,Elbow=$elbow,GripLeft=$grip,GripRight=$grip")+ }+ $reports = @()+ foreach ($witness in $witnesses) {+ $name = $witness.Name+ $usd = Join-Path $out "$name.usda"+ $evidence = Join-Path $out "$name.json"+ $exportLog = Join-Path $out "$name-export.json"+ Invoke-Logged 'dotnet' (@($cli,'asm','export-usd',"$fixture/$($witness.Source)",$usd,'--evidence',$evidence,'--json') + $witness.Options) $exportLog+ Invoke-Logged (Join-Path $UsdRoot 'bin/usdchecker.exe') @($usd) (Join-Path $out "$name-checker.log")+ $validation = Join-Path $out "$name-validation.json"+ Invoke-Logged $python @('scripts/qualify-usd-export-x0.py',$usd,$evidence,'--out',$validation) (Join-Path $out "$name-validation.log")+ $env:USD_X0_CAPTURE_DIR = Join-Path $out "$name-captures"+ $env:USD_X0_FRAMES = if ($name -eq 'arm') { '0,48,96' } else { '0' }+ Invoke-Logged $python @('scripts/capture-usd-export-x0.py',$usd,'--defaultsettings','--timing') (Join-Path $out "$name-viewer.log")+ $result = Get-Content -LiteralPath $validation -Raw | ConvertFrom-Json+ $metrics = Get-Content -LiteralPath $exportLog -Raw | ConvertFrom-Json+ $reports += @{ witness=$name; source="$fixture/$($witness.Source)"; usd="$name.usda"; meshMilliseconds=$metrics.meshMilliseconds; serializationMilliseconds=$metrics.serializationMilliseconds; bytes=$metrics.bytes; external=$result }+ Write-Host "$name passed: $($result.occurrences) occurrences, $($result.sharedPrototypes) shared prototypes."+ }+ $studio = Join-Path $out 'demo-studio.usda'+ Invoke-Logged $python @('scripts/prepare-usd-x0-studio.py',(Join-Path $out 'demo.usda'),$studio,'--environment',(Join-Path $UsdRoot 'resources/Lights/table_mountain.hdr')) (Join-Path $out 'studio-prepare.log')+ Invoke-Logged (Join-Path $UsdRoot 'bin/usdchecker.exe') @($studio) (Join-Path $out 'studio-checker.log')+ $env:USD_X0_CAPTURE_DIR = Join-Path $out 'demo-captures'+ $env:USD_X0_FRAMES = '0,48,96'+ Invoke-Logged $python @('scripts/capture-usd-export-x0.py',$studio,'--camera','/Presentation/HeroCamera','--defaultsettings','--timing') (Join-Path $out 'demo-studio-viewer.log')+ if ($CaptureMotion) {+ $env:USD_X0_CAPTURE_DIR = Join-Path $out 'demo-motion'+ $env:USD_X0_FRAMES = (0..24 | ForEach-Object { $_*4 }) -join ','+ Invoke-Logged $python @('scripts/capture-usd-export-x0.py',$studio,'--camera','/Presentation/HeroCamera','--defaultsettings','--timing') (Join-Path $out 'demo-motion.log')+ $frames = 0..24 | ForEach-Object { "file '$((Join-Path $out "demo-motion/render-$($_*4).png").Replace('\','/'))'`nduration 0.166666667`n" }+ $frameList = Join-Path $out 'motion-frames.txt'+ [IO.File]::WriteAllText($frameList,($frames -join ''))+ Invoke-Logged 'ffmpeg' @('-hide_banner','-y','-f','concat','-safe','0','-i',$frameList,'-vf','scale=1280:-2','-r','24','-c:v','libx264','-crf','18','-pix_fmt','yuv420p',(Join-Path $out 'atlas-motion.mp4')) (Join-Path $out 'ffmpeg.log')+ }+ @{ milestone='USD-EXPORT-X0'; tool='NVIDIA-distributed OpenUSD usdview / Hydra Storm'; source=$download; archiveSha256=$sha256; witnesses=$reports } |+ ConvertTo-Json -Depth 30 | Set-Content -LiteralPath (Join-Path $out 'qualification-summary.json')+ Write-Host "Qualified files and external screenshots: $out"+}+finally {+ $env:PATH=$previousPath+ $env:PYTHONPATH=$previousPythonPath+ $env:USD_X0_CAPTURE_DIR=$previousCaptureDir+ $env:USD_X0_FRAMES=$previousFrames+ Pop-Location+}diff --git a/scripts/qualify-usd-export-x0.py b/scripts/qualify-usd-export-x0.pynew file mode 100644index 00000000..614e1994--- /dev/null+++ b/scripts/qualify-usd-export-x0.py@@ -0,0 +1,153 @@+"""Validate an Aetheris USDA/evidence pair using the external OpenUSD SDK.++Run with NVIDIA's bundled Python and its lib/python + pip-packages on PYTHONPATH.+Evidence is produced by `aetheris asm export-usd --evidence`.+"""+import argparse+import json+import time+from collections import Counter+from pathlib import Path+from pxr import Gf, Usd, UsdGeom, UsdPhysics, UsdShade+++def matrix(values):+ return Gf.Matrix4d(*values)+++def error(a, b):+ return max(abs(a[r][c] - b[r][c]) for r in range(4) for c in range(4))+++def bounds(points):+ return [[min(p[c] for p in points) for c in range(3)],+ [max(p[c] for p in points) for c in range(3)]]+++def validate(usd_file, evidence_file):+ evidence = json.loads(Path(evidence_file).read_text())+ start = time.perf_counter()+ stage = Usd.Stage.Open(str(usd_file))+ load_ms = (time.perf_counter() - start) * 1000+ assert stage, "Stage did not open"+ assert not stage.GetCompositionErrors(), stage.GetCompositionErrors()+ assert UsdGeom.GetStageMetersPerUnit(stage) == .001+ assert UsdGeom.GetStageUpAxis(stage) == "Z"+ assert stage.GetDefaultPrim().GetPath() == "/Assembly"+ occurrences = {p.GetAttribute("aetheris:occurrenceIdentity").Get(): p+ for p in stage.Traverse() if p.HasAttribute("aetheris:occurrenceIdentity")}+ mesh = evidence["mesh"]+ assert set(occurrences) == {o["id"] for o in mesh["occurrences"]}+ definitions = {d["id"]: d for d in mesh["definitions"]}+ checks = [(Usd.TimeCode.Default(), mesh["occurrences"])]+ for sample in evidence["samplePoses"]:+ checks.append((Usd.TimeCode(sample["time"]), [dict(id=i["stableId"], transform=i["resolvedTransform"]["matrix"])+ for i in sample["pose"]["instances"]]))+ transform_errors = []+ for frame, expected in checks:+ cache = UsdGeom.XformCache(frame)+ for o in expected:+ delta = error(cache.GetLocalToWorldTransform(occurrences[o["id"]]), matrix(o["transform"]))+ assert delta < 1e-9, (str(frame), o["id"], delta)+ transform_errors.append(delta)+ # Proper quaternion interpolation preserves rigid frames between authored poses.+ if len(checks) > 2:+ mid = (checks[1][0].GetValue() + checks[2][0].GetValue()) / 2+ cache = UsdGeom.XformCache(mid)+ for p in occurrences.values():+ m = cache.GetLocalToWorldTransform(p)+ assert abs(m.GetDeterminant() - 1) < 1e-9+ expected_points, usd_points, conservative_points = [], [], []+ cache = UsdGeom.XformCache(Usd.TimeCode.Default())+ prototypes = {}+ for o in mesh["occurrences"]:+ prim = occurrences[o["id"]]+ if o["parentId"] is not None:+ assert prim.GetParent() == occurrences[o["parentId"]]+ if o["definitionId"] is None:+ continue+ geometry = stage.GetPrimAtPath(str(prim.GetPath()) + "/Geometry")+ assert geometry.IsInstance()+ prototype = geometry.GetPrototype().GetPath()+ assert prototypes.setdefault(o["definitionId"], prototype) == prototype+ d = definitions[o["definitionId"]]+ usd_mesh = UsdGeom.Mesh(stage.GetPrimAtPath(str(geometry.GetPath()) + "/Mesh"))+ assert usd_mesh.GetSubdivisionSchemeAttr().Get() == "none"+ assert usd_mesh.GetOrientationAttr().Get() == "rightHanded"+ assert usd_mesh.GetNormalsInterpolation() == "vertex"+ assert list(usd_mesh.GetFaceVertexIndicesAttr().Get()) == d["indices"]+ assert all(n == 3 for n in usd_mesh.GetFaceVertexCountsAttr().Get())+ assert len(usd_mesh.GetNormalsAttr().Get()) == len(d["normals"]) // 3+ assert UsdShade.MaterialBindingAPI(usd_mesh).ComputeBoundMaterial()[0]+ world = matrix(o["transform"])+ points = [Gf.Vec3d(*d["positions"][i:i+3]) for i in range(0, len(d["positions"]), 3)]+ expected_points.extend(world.Transform(p) for p in points)+ local_bounds = bounds(points)+ conservative_points.extend(world.Transform(Gf.Vec3d(x,y,z))+ for x in [local_bounds[0][0],local_bounds[1][0]]+ for y in [local_bounds[0][1],local_bounds[1][1]]+ for z in [local_bounds[0][2],local_bounds[1][2]])+ usd_world = cache.GetLocalToWorldTransform(usd_mesh.GetPrim())+ usd_points.extend(usd_world.Transform(Gf.Vec3d(p)) for p in usd_mesh.GetPointsAttr().Get())+ aetheris_bounds, usd_bounds = bounds(expected_points), bounds(usd_points)+ bbox_error = max(abs(a-b) for aa, bb in zip(aetheris_bounds, usd_bounds) for a, b in zip(aa, bb))+ assert bbox_error < .0001, bbox_error+ # Independent USD bounds service, rather than only recomputing positions.+ bound = UsdGeom.BBoxCache(Usd.TimeCode.Default(), [UsdGeom.Tokens.default_]).ComputeWorldBound(stage.GetDefaultPrim()).ComputeAlignedRange()+ conservative_bounds = [list(bound.GetMin()), list(bound.GetMax())]+ aetheris_conservative_bounds = bounds(conservative_points)+ conservative_error = max(abs(a-b) for aa,bb in zip(aetheris_conservative_bounds,conservative_bounds) for a,b in zip(aa,bb))+ assert conservative_error < .0001, conservative_error+ joints = {p.GetAttribute("aetheris:interfaceName").Get(): p+ for p in stage.Traverse() if p.IsA(UsdPhysics.Joint)}+ assert len(joints) == len(evidence["joints"] or [])+ families = []+ for j in evidence["joints"] or []:+ p = joints[j["name"]]+ family = p.GetAttribute("aetheris:interfaceFamily").Get()+ assert j["family"] == family+ schema = {"Fixed": UsdPhysics.FixedJoint, "Revolute": UsdPhysics.RevoluteJoint, "Prismatic": UsdPhysics.PrismaticJoint}[family]+ assert p.IsA(schema)+ joint = UsdPhysics.Joint(p)+ assert joint.GetBody0Rel().GetTargets() == [occurrences[j["parentOccurrenceId"]].GetPath()]+ assert joint.GetBody1Rel().GetTargets() == [occurrences[j["childOccurrenceId"]].GetPath()]+ for n, field in enumerate(["parentLocalFrame", "childLocalFrame"]):+ expected = matrix(j[field]["matrix"])+ quat = p.GetAttribute(f"physics:localRot{n}").Get()+ rot = Gf.Matrix4d().SetRotate(Gf.Quatd(quat))+ rot.SetTranslateOnly(Gf.Vec3d(p.GetAttribute(f"physics:localPos{n}").Get()))+ assert error(rot, expected) < 1e-6+ if family != "Fixed":+ assert p.GetAttribute("physics:axis").Get() == "Z"+ families.append(family)+ topology = []+ for d in mesh["definitions"]:+ # Weld equal face-boundary vertices solely for mesh closure verification.+ points = [tuple(round(v, 7) for v in d["positions"][i:i+3]) for i in range(0, len(d["positions"]), 3)]+ edges = Counter()+ for i in range(0, len(d["indices"]), 3):+ a,b,c = [points[n] for n in d["indices"][i:i+3]]+ for u,v in [(a,b),(b,c),(c,a)]:+ edges[tuple(sorted((u,v)))] += 1+ bad = sum(count != 2 for count in edges.values())+ assert bad == 0, (d["identity"], "nonmanifold or open display edges", bad)+ topology.append(dict(definition=d["identity"], triangles=len(d["indices"])//3, unmatchedEdges=bad))+ return dict(tool="NVIDIA-distributed OpenUSD", version=".".join(map(str, Usd.GetVersion())), openedSuccessfully=True,+ compositionErrors=[], externalLoadMilliseconds=load_ms, occurrences=len(occurrences),+ sharedPrototypes=len(prototypes), jointFamilies=families, maxWorldTransformError= max(transform_errors),+ authoredPosesChecked=len(checks), bboxErrorMm=bbox_error, aetherisDisplayBoundsMm=aetheris_bounds,+ usdDisplayBoundsMm=usd_bounds, usdConservativeSceneBoundsMm=conservative_bounds,+ conservativeSceneBoundsErrorMm=conservative_error,+ metersPerUnit=.001, upAxis="Z", meshClosure=topology)+++if __name__ == "__main__":+ parser = argparse.ArgumentParser(description=__doc__)+ parser.add_argument("usd")+ parser.add_argument("evidence")+ parser.add_argument("--out", default="artifacts/local/usd-x0/external-validation.json")+ args = parser.parse_args()+ report = validate(args.usd, args.evidence)+ Path(args.out).parent.mkdir(parents=True, exist_ok=True)+ Path(args.out).write_text(json.dumps(report, indent=2) + "\n")+ print(json.dumps(report, indent=2))diff --git a/scripts/render-industrial-atlas.py b/scripts/render-industrial-atlas.pynew file mode 100644index 00000000..03858882--- /dev/null+++ b/scripts/render-industrial-atlas.py@@ -0,0 +1,79 @@+"""Render the real USD import in Blender Cycles; no replacement product meshes.++blender --background --factory-startup --python scripts/render-industrial-atlas.py --+ artifacts/local/usd-industrial/atlas-studio.usda artifacts/local/usd-industrial/atlas-hero.png+"""+import bpy+import json+import sys+import time+from pathlib import Path++args = sys.argv[sys.argv.index("--") + 1:]+source, output = (Path(p).resolve() for p in args[:2])+preview = "--preview" in args+motion = "--motion" in args+start = time.perf_counter()+bpy.ops.wm.read_factory_settings(use_empty=True)+bpy.ops.wm.usd_import(filepath=str(source), support_scene_instancing=True,+ import_materials=True, import_usd_preview=True, apply_unit_conversion_scale=True)+load_seconds = time.perf_counter() - start+scene = bpy.context.scene+camera = next(o for o in scene.objects if o.type == "CAMERA" and "HeroCamera" in o.name)+scene.camera = camera+scene.render.engine = "CYCLES"+scene.cycles.samples = 24 if motion else 32 if preview else 192+scene.cycles.use_denoising = True+prefs = bpy.context.preferences.addons["cycles"].preferences+prefs.compute_device_type = "OPTIX"+prefs.get_devices()+for device in prefs.devices:+ device.use = device.type == "OPTIX"+scene.cycles.device = "GPU" if any(d.use for d in prefs.devices) else "CPU"+# USD light intensities are renderer-dependent. These are presentation settings,+# recorded here, applied only after import; every engineering mesh stays intact.+for obj in scene.objects:+ if obj.type == "LIGHT":+ # Blender 5.2 imports this mm stage's camera/meshes in metres, but leaves+ # RectLight positions and dimensions in stage units. Correct only the+ # presentation lights; this script is specifically for our .001 stage.+ transform = obj.matrix_world.copy()+ transform.translation *= .001+ obj.matrix_world = transform+ obj.data.size *= .001+ obj.data.size_y *= .001+ obj.data.energy = {"Key": 80, "Rim": 80, "Fill": 40}.get(obj.name, 8)+if scene.world is None:+ scene.world = bpy.data.worlds.new("StudioWorld")+scene.world.use_nodes = True+background = scene.world.node_tree.nodes.get("Background")+if background:+ background.inputs["Color"].default_value = (.035, .044, .06, 1)+ background.inputs["Strength"].default_value = .35+scene.render.resolution_x = 1280 if preview or motion else 2560+scene.render.resolution_y = 720 if preview or motion else 1440+scene.render.resolution_percentage = 100+scene.view_settings.view_transform = "AgX"+scene.view_settings.look = "AgX - Medium High Contrast"+scene.render.image_settings.file_format = "PNG"+scene.render.filepath = str(output)+scene.frame_set(48 if scene.frame_end >= 48 else 0)+output.parent.mkdir(parents=True, exist_ok=True)+bpy.ops.wm.save_as_mainfile(filepath=str(output.with_suffix(".blend")))+render_start = time.perf_counter()+if motion:+ for frame in range(0,97,4):+ scene.frame_set(frame)+ scene.render.filepath = str(output.parent / f"motion-{frame:03d}.png")+ bpy.ops.render.render(write_still=True)+else:+ bpy.ops.render.render(write_still=True)+report = dict(tool="Blender", version=bpy.app.version_string, input=str(source),+ engine="Cycles", device=scene.cycles.device,+ devices=[d.name for d in prefs.devices if d.use],+ loadSeconds=load_seconds, renderSeconds=time.perf_counter()-render_start,+ meshObjects=sum(o.type == "MESH" for o in scene.objects),+ resolution=[scene.render.resolution_x, scene.render.resolution_y],+ samples=scene.cycles.samples, output=str(output))+output.with_suffix(".json").write_text(json.dumps(report, indent=2) + "\n")+print(json.dumps(report))