using System.Globalization;
using System.Reflection;
public class MeshOffsetExample
{
public static void Run(string[] args)
{
if (args.Length != 2)
{
Console.WriteLine("Usage: {0} MeshOffsetExample OFFSET_VALUE", Assembly.GetExecutingAssembly().GetName().Name);
return;
}
try
{
float offsetValue = float.Parse(args[1],
System.Globalization.NumberStyles.AllowDecimalPoint,
CultureInfo.InvariantCulture);
var mesh =
MR.
MeshLoad.FromAnySupportedFormat(
"mesh.stl");
MR.MeshPart mp = new(mesh);
op.VoxelSize =
MR.SuggestVoxelSize(mp, 1e6f);
var result =
MR.OffsetMesh(mp, offsetValue, op);
MR.
MeshSave.ToAnySupportedFormat(result,
"mesh_offset.stl");
}
catch (Exception e)
{
Console.WriteLine("Error: {0}", e.Message);
}
}
}
Source mesh