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()
|
||||
{
|
||||
Geom = new Box3d(new Vec3d(-40, -40, 0), new Vec3d(40, 40, 10)),
|
||||
GeomToWorkpieceTransformer = new StaticTranslation(new Vec3d(0, 0, 10)),
|
||||
};
|
||||
//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
|
||||
//transformer of the branch to it: on top of the 10 mm thick fixture geom.
|
||||
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()
|
||||
{
|
||||
InitResolution = 0.25,
|
||||
InitGeom = new Box3d(0, 0, -50, 70, 50, 0),
|
||||
IdealGeom = null,
|
||||
WorkpieceGeomToFixtureBuckleTransformer = new StaticTranslation(new Vec3d(0, 0, 0)),
|
||||
};
|
||||
//The default shape already leads from the geometry anchor to the fixture
|
||||
//buckle and to program zero by zero translations.
|
||||
Workpiece workpiece = Workpiece.CreateDefault();
|
||||
workpiece.InitResolution = 0.25;
|
||||
workpiece.InitGeom = new Box3d(0, 0, -50, 70, 50, 0);
|
||||
workpiece.IdealGeom = null;
|
||||
localProjectService.Workpiece = workpiece;
|
||||
|
||||
IProgress<object> progress = null;
|
||||
localProjectService.MachiningChain
|
||||
|
||||
Reference in New Issue
Block a user