From a03aa1c1ff22180f7d71ae5c23ace3d8ebb74cf6 Mon Sep 17 00:00:00 2001 From: iamboss Date: Tue, 29 Sep 2026 16:42:52 +0800 Subject: [PATCH] fix(demos): DemoBuildMachineTool puts the spindle's pivot on the tool-mount offset CreateFromChainCode now seeds S with a DynamicRotation about -Z through S's origin (the spindle role); the sample moves the tool mount to (-72.40, 72.40, 176.44) right after, so it moves the spindle's pivot there too -- otherwise turning the spindle would swing the tool around S's origin. Co-Authored-By: Claude Fable 5.1 --- MachineTool/DemoBuildMachineTool.cs | 3 +++ 1 file changed, 3 insertions(+) diff --git a/MachineTool/DemoBuildMachineTool.cs b/MachineTool/DemoBuildMachineTool.cs index 6990d23..ce66233 100644 --- a/MachineTool/DemoBuildMachineTool.cs +++ b/MachineTool/DemoBuildMachineTool.cs @@ -43,6 +43,9 @@ namespace Sample.MachineTool "[O][Y][X][C][w];[O][Z][B][S][t]"); if (dst.ToolMountTransformer is StaticTranslation st) st.Trans = new vec3d_t(-72.40, 72.40, 176.44); + //the spindle turns the tool about its own axis: the rotation's pivot + //sits on the tool mount's origin, where the offset above moved it. + dst.SpindleTransformer.Pivot = new vec3d_t(-72.40, 72.40, 176.44); dst.TransformerB.Pivot = new vec3d_t(-72.4, -177.4, 225.94); Dictionary solidMap = new Dictionary() {