MeshLib
 
Loading...
Searching...
No Matches
Mesh boolean

///

Example of Boolean operation

using MR.DotNet;
using System;
using System.Reflection;
class Program
{
static void Main(string[] args)
{
if (args.Length != 4)
Console.WriteLine( "Usage: {0} {{unite | intersect}} INPUT1 INPUT2 OUTPUT", Assembly.GetExecutingAssembly().GetName().Name );
switch (args[0])
{
case "unite":
op = BooleanOperation.Union;
break;
case "intersect":
op = BooleanOperation.Intersection;
break;
default:
Console.WriteLine( "Unknown operation: {0}", args[0] );
return;
}
try
{
Mesh meshA = Mesh.FromAnySupportedFormat(args[1]);
Mesh meshB = Mesh.FromAnySupportedFormat(args[2]);
var res = MeshBoolean.Boolean(meshA, meshB, op);
Mesh.ToAnySupportedFormat(res.mesh, args[3]);
}
catch (Exception e)
{
Console.WriteLine( "Error: {0}", e.Message );
}
}
}
BooleanOperation
enumeration of all possible boolean operations
Definition MRDotNet/MRMeshBoolean.h:8
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 MeshBoolean.dox.py:1