MeshLib
 
Loading...
Searching...
No Matches
Offset

Example of Offset

using MR.DotNet;
using System;
using System.Globalization;
using System.Reflection;
class Program
{
static void Main(string[] args)
{
if (args.Length != 2 && args.Length != 3)
{
Console.WriteLine("Usage: {0} OFFSET_VALUE INPUT [OUTPUT]", Assembly.GetExecutingAssembly().GetName().Name);
return;
}
try
{
float offsetValue = float.Parse(args[0],
System.Globalization.NumberStyles.AllowThousands,
CultureInfo.InvariantCulture);
string input = args[1];
string output = args.Length == 3 ? args[2] : args[1];
MeshPart mp = new MeshPart();
mp.mesh = Mesh.FromAnySupportedFormat( args[1] );
op.voxelSize = Offset.SuggestVoxelSize(mp, 1e6f);
var result = Offset.OffsetMesh(mp, offsetValue, op);
Mesh.ToAnySupportedFormat(result, output);
}
catch (Exception e)
{
Console.WriteLine("Error: {0}", e.Message);
}
}
}
represents a mesh, including topology (connectivity) information and point coordinates,
Definition MRDotNet/MRMesh.h:30
static void ToAnySupportedFormat(Mesh^ mesh, System::String^ path)
saves mesh to file of any supported format
static Mesh FromAnySupportedFormat(System::String^ path)
loads mesh from file of any supported format
Definition MRDotNet/MROffset.h:20
Definition MRDotNet/MROffset.h:74
static Mesh OffsetMesh(MeshPart mp, float offset, OffsetParameters^ parameters)
static float SuggestVoxelSize(MeshPart mp, float approxNumVoxels)
computes size of a cubical voxel to get approximately given number of voxels during rasterization
Definition MRDotNet/MRMesh.h:20