Compare commits
3
Commits
1b834cff0d
...
master
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
a03aa1c1ff | ||
|
|
46bfea4a87 | ||
|
|
734ed008b0 |
@@ -6,7 +6,7 @@ namespace Sample.Disp
|
|||||||
/// <summary>
|
/// <summary>
|
||||||
/// Demonstrates a simple solar system animation using <see cref="IDisplayee"/> interface.
|
/// 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
|
/// 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>
|
/// </summary>
|
||||||
/// <remarks>
|
/// <remarks>
|
||||||
/// ### Source Code
|
/// ### Source Code
|
||||||
@@ -30,12 +30,12 @@ namespace Sample.Disp
|
|||||||
{
|
{
|
||||||
sun.Display(bind);
|
sun.Display(bind);
|
||||||
bind.ModelMatStack.Push();
|
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_t(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 vec3d_t(12, 0, 0)));
|
||||||
earth.Display(bind);
|
earth.Display(bind);
|
||||||
bind.ModelMatStack.Push();
|
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_t(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 vec3d_t(4, 0, 0)));
|
||||||
moon.Display(bind);
|
moon.Display(bind);
|
||||||
bind.ModelMatStack.Pop();
|
bind.ModelMatStack.Pop();
|
||||||
bind.ModelMatStack.Pop();
|
bind.ModelMatStack.Pop();
|
||||||
|
|||||||
@@ -22,7 +22,7 @@ public static class DemoBuildGeom
|
|||||||
/// <returns>A list of geometries implementing the IGetStl interface</returns>
|
/// <returns>A list of geometries implementing the IGetStl interface</returns>
|
||||||
public static List<IGetStl> GenGeoms()
|
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),
|
Cylindroid cylindroid = new Cylindroid([ new PairZr(0,12),new PairZr(20,12),
|
||||||
new PairZr(20,16),new PairZr(30,16)]);
|
new PairZr(20,16),new PairZr(30,16)]);
|
||||||
Stl stl = new Stl("geom.stl");
|
Stl stl = new Stl("geom.stl");
|
||||||
|
|||||||
@@ -43,6 +43,9 @@ namespace Sample.MachineTool
|
|||||||
"[O][Y][X][C][w];[O][Z][B][S][t]");
|
"[O][Y][X][C][w];[O][Z][B][S][t]");
|
||||||
if (dst.ToolMountTransformer is StaticTranslation st)
|
if (dst.ToolMountTransformer is StaticTranslation st)
|
||||||
st.Trans = new vec3d_t(-72.40, 72.40, 176.44);
|
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);
|
dst.TransformerB.Pivot = new vec3d_t(-72.4, -177.4, 225.94);
|
||||||
Dictionary<string, Solid> solidMap = new Dictionary<string, Solid>()
|
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
|
//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.
|
//transformer of the branch to it: on top of the 10 mm thick fixture geom.
|
||||||
Fixture fixture = Fixture.CreateDefault();
|
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
|
Branch.Get(fixture.GeomAnchor, fixture.WorkpieceMount).Transformer
|
||||||
= new StaticTranslation(new vec3d_t(0, 0, 10));
|
= new StaticTranslation(new vec3d_t(0, 0, 10));
|
||||||
localProjectService.Fixture = fixture;
|
localProjectService.Fixture = fixture;
|
||||||
@@ -83,7 +83,7 @@ public static class DemoBuildGeomOnlyMachiningProject
|
|||||||
//mount and to program zero by zero translations.
|
//mount and to program zero by zero translations.
|
||||||
Workpiece workpiece = Workpiece.CreateDefault();
|
Workpiece workpiece = Workpiece.CreateDefault();
|
||||||
workpiece.InitResolution = 0.25;
|
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.IdealGeom = null;
|
||||||
localProjectService.Workpiece = workpiece;
|
localProjectService.Workpiece = workpiece;
|
||||||
|
|
||||||
|
|||||||
@@ -187,7 +187,7 @@ public static class DemoBuildMachiningProject
|
|||||||
//geometry anchor to each mount, so the workpiece mount is placed by the
|
//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.
|
//transformer of the branch to it: on top of the 10 mm thick fixture geom.
|
||||||
Fixture fixture = Fixture.CreateDefault();
|
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
|
Branch.Get(fixture.GeomAnchor, fixture.WorkpieceMount).Transformer
|
||||||
= new StaticTranslation(new vec3d_t(0, 0, 10));
|
= new StaticTranslation(new vec3d_t(0, 0, 10));
|
||||||
localProjectService.Fixture = fixture;
|
localProjectService.Fixture = fixture;
|
||||||
@@ -198,7 +198,7 @@ public static class DemoBuildMachiningProject
|
|||||||
//mount and to program zero by zero translations.
|
//mount and to program zero by zero translations.
|
||||||
Workpiece workpiece = Workpiece.CreateDefault();
|
Workpiece workpiece = Workpiece.CreateDefault();
|
||||||
workpiece.InitResolution = 0.25;
|
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.IdealGeom = null;
|
||||||
workpiece.CuttingPara = XFactory.GenByFile<ICuttingPara>(
|
workpiece.CuttingPara = XFactory.GenByFile<ICuttingPara>(
|
||||||
"Resource/CuttingParameter", "Al6061T6.default.mp", progress);
|
"Resource/CuttingParameter", "Al6061T6.default.mp", progress);
|
||||||
|
|||||||
+2
-2
@@ -44,9 +44,9 @@ public static class DemoTopo1
|
|||||||
brnB.Step = MathUtil.ToRad(-60);
|
brnB.Step = MathUtil.ToRad(-60);
|
||||||
|
|
||||||
//Get and show the transform matrices relative to O.
|
//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:");
|
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}");
|
Console.WriteLine($"{keyValue.Key.Name} : {keyValue.Value}");
|
||||||
#endregion
|
#endregion
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user