update ISO coordinate rendering for 3+2axis machine.

This commit is contained in:
2026-04-06 15:09:05 +08:00
parent 809a250c44
commit 96eb6ad050
9 changed files with 559 additions and 570 deletions
+33 -35
View File
@@ -3,40 +3,38 @@ using System.Collections.Generic;
using Hi.Geom;
using Hi.Mech.Topo;
namespace Sample.Geom
{
/// <summary>
/// Demonstrates the creation and manipulation of geometric objects in HiAPI.
/// Shows how to create and transform various geometry types including boxes, cylindroids, and STL files.
/// </summary>
/// <remarks>
/// ### Source Code
/// [!code-csharp[SampleCode](~/../Hi.Sample/Geom/DemoBuildGeom.cs)]
/// </remarks>
public static class DemoBuildGeom
{
/// <summary>
/// Generates a collection of geometric objects for demonstration purposes.
/// Creates various geometry types including boxes, cylindroids, STL files, and transformed geometries.
/// </summary>
/// <returns>A list of geometries implementing the IGetStl interface</returns>
public static List<IGetStl> GenGeoms()
{
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");
StlFile stlFile = new StlFile("geom.stl");
TransformationGeom transformationGeom = new TransformationGeom()
{
Transformer = new GeneralTransform(1,
new StaticRotation(new Vec3d(0, 0, 1), MathUtil.ToRad(15), new Vec3d(0, 0, 0)),
new StaticTranslation(new Vec3d(0, 0, 0))),
Geom = stl
};
GeomCombination geomCombination = new GeomCombination(stlFile, transformationGeom);
return new List<IGetStl>([box, cylindroid, stl, stlFile, transformationGeom]);
}
}
namespace Sample.Geom;
/// <summary>
/// Demonstrates the creation and manipulation of geometric objects in HiAPI.
/// Shows how to create and transform various geometry types including boxes, cylindroids, and STL files.
/// </summary>
/// <remarks>
/// ### Source Code
/// [!code-csharp[SampleCode](~/../Hi.Sample/Geom/DemoBuildGeom.cs)]
/// </remarks>
public static class DemoBuildGeom
{
/// <summary>
/// Generates a collection of geometric objects for demonstration purposes.
/// Creates various geometry types including boxes, cylindroids, STL files, and transformed geometries.
/// </summary>
/// <returns>A list of geometries implementing the IGetStl interface</returns>
public static List<IGetStl> GenGeoms()
{
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");
StlFile stlFile = new StlFile("geom.stl");
TransformationGeom transformationGeom = new TransformationGeom()
{
Transformer = new GeneralTransform(1,
new StaticRotation(new Vec3d(0, 0, 1), MathUtil.ToRad(15), new Vec3d(0, 0, 0)),
new StaticTranslation(new Vec3d(0, 0, 0))),
Geom = stl
};
GeomCombination geomCombination = new GeomCombination(stlFile, transformationGeom);
return new List<IGetStl>([box, cylindroid, stl, stlFile, transformationGeom]);
}
}
+21 -22
View File
@@ -1,28 +1,27 @@
using Hi.Geom;
using System;
namespace Sample.Geom
{
/// <summary>
/// Demonstrates how to create and calculate bounding boxes for different geometric objects.
/// Shows the use of Box3d to encompass multiple geometric elements with a single boundary.
/// </summary>
/// <remarks>
/// ### Source Code
/// [!code-csharp[SampleCode](~/../Hi.Sample/Geom/DemoIExpandToBox3d.cs)]
/// </remarks>
public static class DemoIExpandToBox3d
{
static void Main()
{
#region DocSite.CountBoundingBox
Box3d objA = new Box3d(0, 0, 0, 1, 1, 1);
Box3d objB = new Box3d(-1, -2, -3, 3, 2, 1);
Vec3d objC = new Vec3d(-2, 3, -5);
namespace Sample.Geom;
Box3d boundingbox = new Box3d(objA, objB, objC);
Console.WriteLine("boundingbox: " + boundingbox);
#endregion
}
/// <summary>
/// Demonstrates how to create and calculate bounding boxes for different geometric objects.
/// Shows the use of Box3d to encompass multiple geometric elements with a single boundary.
/// </summary>
/// <remarks>
/// ### Source Code
/// [!code-csharp[SampleCode](~/../Hi.Sample/Geom/DemoIExpandToBox3d.cs)]
/// </remarks>
public static class DemoIExpandToBox3d
{
static void Main()
{
#region DocSite.CountBoundingBox
Box3d objA = new Box3d(0, 0, 0, 1, 1, 1);
Box3d objB = new Box3d(-1, -2, -3, 3, 2, 1);
Vec3d objC = new Vec3d(-2, 3, -5);
Box3d boundingbox = new Box3d(objA, objB, objC);
Console.WriteLine("boundingbox: " + boundingbox);
#endregion
}
}