diff --git a/MachineTool/DemoBuildMachineTool.cs b/MachineTool/DemoBuildMachineTool.cs
index 5ed259c..6c93ea1 100644
--- a/MachineTool/DemoBuildMachineTool.cs
+++ b/MachineTool/DemoBuildMachineTool.cs
@@ -39,10 +39,11 @@ namespace Sample.MachineTool
/// A configured machine tool model.
public static GeneralXyzabcMachineTool GenXyzabcMachineTool()
{
- CodeXyzabcChain chain = new CodeXyzabcChain("[O][Y][X][C][w];[O][Z][B][S][t]");
- if (chain.ToolBuckleTransformer is StaticTranslation st)
+ GeneralXyzabcMachineTool dst = GeneralXyzabcMachineTool.CreateFromChainCode(
+ "[O][Y][X][C][w];[O][Z][B][S][t]");
+ if (dst.ToolBuckleTransformer is StaticTranslation st)
st.Trans = new Vec3d(-72.40, 72.40, 176.44);
- chain.TransformerB.Pivot = new Vec3d(-72.4, -177.4, 225.94);
+ dst.TransformerB.Pivot = new Vec3d(-72.4, -177.4, 225.94);
Dictionary solidMap = new Dictionary()
{
["O"] = new Solid(new Stl("MachineTool/base.stl")),
@@ -53,10 +54,8 @@ namespace Sample.MachineTool
["C"] = new Solid(new Stl("MachineTool/C.stl")),
["S"] = new Solid(new Stl("MachineTool/spindle.stl")),
};
- chain.AnchorToSolid.BuildAnchorToSolid(
- chain.Asmb.DescendantAnchors(), solidMap);
-
- GeneralXyzabcMachineTool dst = new GeneralXyzabcMachineTool(chain);
+ dst.AnchorToSolid.BuildAnchorToSolid(
+ dst.Asmb.DescendantAnchors(), solidMap);
dst.GenerateCollisionIndexPairs();
return dst;
}
diff --git a/MachineTool/DemoBuildMachineToolWithoutGeometrys.cs b/MachineTool/DemoBuildMachineToolWithoutGeometrys.cs
index d813812..bf9c378 100644
--- a/MachineTool/DemoBuildMachineToolWithoutGeometrys.cs
+++ b/MachineTool/DemoBuildMachineToolWithoutGeometrys.cs
@@ -20,10 +20,10 @@ public static class DemoBuildMachineToolWithoutGeometrys
/// A configured but empty machine tool without solids.
public static GeneralXyzabcMachineTool GenEmptyMachineTool()
{
- CodeXyzabcChain chain = new CodeXyzabcChain("[O][C][w];[O][X][Y][Z][B][S][t]");
- if (chain.ToolBuckleTransformer is StaticTranslation st)
+ GeneralXyzabcMachineTool xyzabcMachineTool = GeneralXyzabcMachineTool.CreateFromChainCode(
+ "[O][C][w];[O][X][Y][Z][B][S][t]");
+ if (xyzabcMachineTool.ToolBuckleTransformer is StaticTranslation st)
st.Trans = new Vec3d(-200, 200, 400);
- GeneralXyzabcMachineTool xyzabcMachineTool = new GeneralXyzabcMachineTool(chain);
return xyzabcMachineTool;
}
}