refactor(demos): build the fixture and the workpiece with CreateDefault() and set the workpiece-buckle offset on the fixture's branch
Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
This commit is contained in:
@@ -70,19 +70,22 @@ public static class DemoBuildGeomOnlyMachiningProject
|
|||||||
},
|
},
|
||||||
};
|
};
|
||||||
|
|
||||||
localProjectService.Fixture = new Fixture()
|
//The fixture topology is free; the default shape has one branch from the
|
||||||
{
|
//geometry anchor to each buckle, so the workpiece buckle is placed by the
|
||||||
Geom = new Box3d(new Vec3d(-40, -40, 0), new Vec3d(40, 40, 10)),
|
//transformer of the branch to it: on top of the 10 mm thick fixture geom.
|
||||||
GeomToWorkpieceTransformer = new StaticTranslation(new Vec3d(0, 0, 10)),
|
Fixture fixture = Fixture.CreateDefault();
|
||||||
};
|
fixture.Geom = new Box3d(new Vec3d(-40, -40, 0), new Vec3d(40, 40, 10));
|
||||||
|
Branch.Get(fixture.GeomAnchor, fixture.WorkpieceBuckle).Transformer
|
||||||
|
= new StaticTranslation(new Vec3d(0, 0, 10));
|
||||||
|
localProjectService.Fixture = fixture;
|
||||||
|
|
||||||
localProjectService.Workpiece = new Workpiece()
|
//The default shape already leads from the geometry anchor to the fixture
|
||||||
{
|
//buckle and to program zero by zero translations.
|
||||||
InitResolution = 0.25,
|
Workpiece workpiece = Workpiece.CreateDefault();
|
||||||
InitGeom = new Box3d(0, 0, -50, 70, 50, 0),
|
workpiece.InitResolution = 0.25;
|
||||||
IdealGeom = null,
|
workpiece.InitGeom = new Box3d(0, 0, -50, 70, 50, 0);
|
||||||
WorkpieceGeomToFixtureBuckleTransformer = new StaticTranslation(new Vec3d(0, 0, 0)),
|
workpiece.IdealGeom = null;
|
||||||
};
|
localProjectService.Workpiece = workpiece;
|
||||||
|
|
||||||
IProgress<object> progress = null;
|
IProgress<object> progress = null;
|
||||||
localProjectService.MachiningChain
|
localProjectService.MachiningChain
|
||||||
|
|||||||
@@ -183,25 +183,28 @@ public static class DemoBuildMachiningProject
|
|||||||
#endregion
|
#endregion
|
||||||
|
|
||||||
#region ConfigureFixture
|
#region ConfigureFixture
|
||||||
localProjectService.Fixture = new Fixture()
|
//The fixture topology is free; the default shape has one branch from the
|
||||||
{
|
//geometry anchor to each buckle, so the workpiece buckle is placed by the
|
||||||
Geom = new Box3d(new Vec3d(-40, -40, 0), new Vec3d(40, 40, 10)),
|
//transformer of the branch to it: on top of the 10 mm thick fixture geom.
|
||||||
GeomToWorkpieceTransformer = new StaticTranslation(new Vec3d(0, 0, 10)),
|
Fixture fixture = Fixture.CreateDefault();
|
||||||
};
|
fixture.Geom = new Box3d(new Vec3d(-40, -40, 0), new Vec3d(40, 40, 10));
|
||||||
|
Branch.Get(fixture.GeomAnchor, fixture.WorkpieceBuckle).Transformer
|
||||||
|
= new StaticTranslation(new Vec3d(0, 0, 10));
|
||||||
|
localProjectService.Fixture = fixture;
|
||||||
#endregion
|
#endregion
|
||||||
|
|
||||||
#region ConfigureWorkpiece
|
#region ConfigureWorkpiece
|
||||||
localProjectService.Workpiece = new Workpiece()
|
//The default shape already leads from the geometry anchor to the fixture
|
||||||
{
|
//buckle and to program zero by zero translations.
|
||||||
InitResolution = 0.25,
|
Workpiece workpiece = Workpiece.CreateDefault();
|
||||||
InitGeom = new Box3d(0, 0, -50, 70, 50, 0),
|
workpiece.InitResolution = 0.25;
|
||||||
IdealGeom = null,
|
workpiece.InitGeom = new Box3d(0, 0, -50, 70, 50, 0);
|
||||||
WorkpieceGeomToFixtureBuckleTransformer = new StaticTranslation(new Vec3d(0, 0, 0)),
|
workpiece.IdealGeom = null;
|
||||||
CuttingPara = XFactory.GenByFile<ICuttingPara>(
|
workpiece.CuttingPara = XFactory.GenByFile<ICuttingPara>(
|
||||||
"Resource/CuttingParameter", "Al6061T6.default.mp", progress),
|
"Resource/CuttingParameter", "Al6061T6.default.mp", progress);
|
||||||
WorkpieceMaterial = XFactory.GenByFile<WorkpieceMaterial>(
|
workpiece.WorkpieceMaterial = XFactory.GenByFile<WorkpieceMaterial>(
|
||||||
"Resource/WorkpieceMaterial", "Al6061T6.default.WorkpieceMaterial", progress),
|
"Resource/WorkpieceMaterial", "Al6061T6.default.WorkpieceMaterial", progress);
|
||||||
};
|
localProjectService.Workpiece = workpiece;
|
||||||
#endregion
|
#endregion
|
||||||
|
|
||||||
#region ConfigureMachineChain
|
#region ConfigureMachineChain
|
||||||
|
|||||||
Reference in New Issue
Block a user