add docfx samples.
This commit is contained in:
@@ -0,0 +1,49 @@
|
||||
using Hi.Geom;
|
||||
using System;
|
||||
using Hi.Disp;
|
||||
|
||||
namespace Sample.Disp
|
||||
{
|
||||
/// <remarks>
|
||||
/// ### Source Code
|
||||
/// [!code-csharp[SampleCode](~/../Hi.Sample.Wpf/Disp/DemoStl.cs)]
|
||||
/// </remarks>
|
||||
public static class DemoStl
|
||||
{
|
||||
internal static void TransformStl()
|
||||
{
|
||||
#region DocSite.TransformStl
|
||||
Stl stl;
|
||||
|
||||
stl = new Stl("Demo/cubic.stl");
|
||||
//scale the stl to 100x.
|
||||
stl.Transform(new Mat4d(100));
|
||||
//create a new stl file.
|
||||
stl.WriteBin("big_cubic.stl");
|
||||
|
||||
stl = new Stl("Demo/cubic.stl");
|
||||
//move the stl by (100,0,0)
|
||||
stl.Transform(new Mat4d(new Vec3d(100, 0, 0)));
|
||||
//create a new stl file.
|
||||
stl.WriteBin("offset_x100_cubic.stl");
|
||||
#endregion
|
||||
}
|
||||
|
||||
internal static void DemoCommonUsage()
|
||||
{
|
||||
#region DocSite.CommonUsage
|
||||
Stl stl = new Stl("Disp/cubic.stl");
|
||||
Box3d bouindingbox = new Box3d(stl);
|
||||
Console.WriteLine("bouindingbox.Min: " + bouindingbox.Min);
|
||||
Console.WriteLine("bouindingbox.Max: " + bouindingbox.Max);
|
||||
Console.WriteLine("bouindingbox.Center: " + bouindingbox.Center);
|
||||
DispUtil.CallRenderingFrame("DemoForm", stl.ToFaceDrawing());
|
||||
#endregion
|
||||
}
|
||||
|
||||
static void Main()
|
||||
{
|
||||
DemoCommonUsage();
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user