Compare commits

...
3 Commits
6 changed files with 15 additions and 12 deletions
+5 -5
View File
@@ -6,7 +6,7 @@ namespace Sample.Disp
/// <summary>
/// Demonstrates a simple solar system animation using <see cref="IDisplayee"/> interface.
/// Shows how to create a hierarchical transform structure with sun, earth and moon using
/// <see cref="Mat4d"/> matrices and model matrix stack transformations.
/// <see cref="mat4d_t"/> matrices and model matrix stack transformations.
/// </summary>
/// <remarks>
/// ### Source Code
@@ -30,12 +30,12 @@ namespace Sample.Disp
{
sun.Display(bind);
bind.ModelMatStack.Push();
bind.ModelMatStack.Mul(new Mat4d(new AxisAngle4d(new vec3d_t(0, 0, 1), angle_earth += 0.03)));
bind.ModelMatStack.Mul(new Mat4d(new vec3d_t(12, 0, 0)));
bind.ModelMatStack.Mul(new mat4d_t(new AxisAngle4d(new vec3d_t(0, 0, 1), angle_earth += 0.03)));
bind.ModelMatStack.Mul(new mat4d_t(new vec3d_t(12, 0, 0)));
earth.Display(bind);
bind.ModelMatStack.Push();
bind.ModelMatStack.Mul(new Mat4d(new AxisAngle4d(new vec3d_t(0, 0, 1), angle_moon += 0.02)));
bind.ModelMatStack.Mul(new Mat4d(new vec3d_t(4, 0, 0)));
bind.ModelMatStack.Mul(new mat4d_t(new AxisAngle4d(new vec3d_t(0, 0, 1), angle_moon += 0.02)));
bind.ModelMatStack.Mul(new mat4d_t(new vec3d_t(4, 0, 0)));
moon.Display(bind);
bind.ModelMatStack.Pop();
bind.ModelMatStack.Pop();
+1 -1
View File
@@ -22,7 +22,7 @@ public static class DemoBuildGeom
/// <returns>A list of geometries implementing the IGetStl interface</returns>
public static List<IGetStl> GenGeoms()
{
box3d_t box = new box3d_t(0, 0, -50, 70, 50, 0);
Box3d box = new Box3d(0, 0, -50, 70, 50, 0);
Cylindroid cylindroid = new Cylindroid([ new PairZr(0,12),new PairZr(20,12),
new PairZr(20,16),new PairZr(30,16)]);
Stl stl = new Stl("geom.stl");
+3
View File
@@ -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<string, Solid> solidMap = new Dictionary<string, Solid>()
{
@@ -74,7 +74,7 @@ public static class DemoBuildGeomOnlyMachiningProject
//geometry anchor to each mount, so the workpiece mount 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_t(new vec3d_t(-40, -40, 0), new vec3d_t(40, 40, 10));
fixture.Geom = new Box3d(new vec3d_t(-40, -40, 0), new vec3d_t(40, 40, 10));
Branch.Get(fixture.GeomAnchor, fixture.WorkpieceMount).Transformer
= new StaticTranslation(new vec3d_t(0, 0, 10));
localProjectService.Fixture = fixture;
@@ -83,7 +83,7 @@ public static class DemoBuildGeomOnlyMachiningProject
//mount and to program zero by zero translations.
Workpiece workpiece = Workpiece.CreateDefault();
workpiece.InitResolution = 0.25;
workpiece.InitGeom = new box3d_t(0, 0, -50, 70, 50, 0);
workpiece.InitGeom = new Box3d(0, 0, -50, 70, 50, 0);
workpiece.IdealGeom = null;
localProjectService.Workpiece = workpiece;
+2 -2
View File
@@ -187,7 +187,7 @@ public static class DemoBuildMachiningProject
//geometry anchor to each mount, so the workpiece mount 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_t(new vec3d_t(-40, -40, 0), new vec3d_t(40, 40, 10));
fixture.Geom = new Box3d(new vec3d_t(-40, -40, 0), new vec3d_t(40, 40, 10));
Branch.Get(fixture.GeomAnchor, fixture.WorkpieceMount).Transformer
= new StaticTranslation(new vec3d_t(0, 0, 10));
localProjectService.Fixture = fixture;
@@ -198,7 +198,7 @@ public static class DemoBuildMachiningProject
//mount and to program zero by zero translations.
Workpiece workpiece = Workpiece.CreateDefault();
workpiece.InitResolution = 0.25;
workpiece.InitGeom = new box3d_t(0, 0, -50, 70, 50, 0);
workpiece.InitGeom = new Box3d(0, 0, -50, 70, 50, 0);
workpiece.IdealGeom = null;
workpiece.CuttingPara = XFactory.GenByFile<ICuttingPara>(
"Resource/CuttingParameter", "Al6061T6.default.mp", progress);
+2 -2
View File
@@ -44,9 +44,9 @@ public static class DemoTopo1
brnB.Step = MathUtil.ToRad(-60);
//Get and show the transform matrices relative to O.
Dictionary<Anchor, Mat4d> matMap = asmb.GetMat4dMap(O);
Dictionary<Anchor, mat4d_t> matMap = asmb.GetMat4dMap(O);
Console.WriteLine("Transform Matrix relative to O:");
foreach (KeyValuePair<Anchor, Mat4d> keyValue in matMap)
foreach (KeyValuePair<Anchor, mat4d_t> keyValue in matMap)
Console.WriteLine($"{keyValue.Key.Name} : {keyValue.Value}");
#endregion