Files
Hi.Sample/MachineTool/DemoBuildMachineToolWithoutGeometrys.cs
T
iambossandClaude Opus 5 7beb671352 refactor(demos): build sample machine tools as GeneralXyzabcMachineTool
Follows the CodeXyzabcMachineTool retirement in HiMech. DemoBuildMachineTool
drops IGetCodeXyzabcMachineTool, which no longer exists, and spells out the
doc comments the inherited interface used to supply.

The two GenByFile<CodeXyzabcMachineTool> call sites are fixed rather than
merely renamed: they read Resource machine tools rooted at
<GeneralXyzabcMachineTool>, so the factory's `as` cast handed back null and
the demo project got no machining chain at all.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
2026-08-28 19:57:54 +08:00

30 lines
950 B
C#

using Hi.Geom;
using Hi.Mech.Topo;
using Hi.NcMech.Xyzabc;
using Hi.Numerical.Xyzabc;
namespace Sample.MachineTool;
/// <summary>
/// Demo Build Machine Tool without gemetries setting.
/// </summary>
/// <remarks>
/// ### Source Code
/// [!code-csharp[SampleCode](~/../Hi.Sample/MachineTool/DemoBuildMachineToolWithoutGeometrys.cs)]
/// </remarks>
public static class DemoBuildMachineToolWithoutGeometrys
{
/// <summary>
/// Generates an empty machine tool with basic configuration.
/// </summary>
/// <returns>A configured but empty machine tool without solids.</returns>
public static GeneralXyzabcMachineTool GenEmptyMachineTool()
{
CodeXyzabcChain chain = new CodeXyzabcChain("[O][C][w];[O][X][Y][Z][B][S][t]");
if (chain.ToolBuckleTransformer is StaticTranslation st)
st.Trans = new Vec3d(-200, 200, 400);
GeneralXyzabcMachineTool xyzabcMachineTool = new GeneralXyzabcMachineTool(chain);
return xyzabcMachineTool;
}
}