Repository navigation
How to create a swept volume of a cutting tool with a complex shape using C# #7539
Replies: 1 comment
|
Hi, all three steps can be done with MeshLib from C# (NuGet package 1. Swept volume For 3-axis paths (the tool axis is constant) there is a built-in function,
These functions do not take tool axis vectors, so for 4/5-axis paths build the swept volume from tool instances. For each CL segment, interpolate the position and the axis (slerp) with a step smaller than the needed accuracy, place the tool with var R = MR.Matrix3f.rotation(MR.Vector3f.plusZ(), axis); // tool Z -> CL axis vector
var xf = MR.AffineXf3f.translation(clPoint) * MR.AffineXf3f.linear(R);and unite the instances. Uniting thousands of meshes one by one is slow, so do it in voxels: write the instances into one mesh ( 2. Subtracting from the workpiece var res = MR.boolean(workpiece, sweptVolume, MR.BooleanOperation.DifferenceAB);
if (!res.valid())
throw new Exception(res.errorString);
var machined = res.mesh;
3. Cutter-workpiece engagement MeshLib has no ready CWE function, but it can be computed by simulating the cut, pose by pose, on the in-process workpiece: var mapper = new MR.BooleanResultMapper();
var p = new MR.BooleanParameters();
p.mapper = mapper;
var res = MR.boolean(inProcess, toolAtPose, MR.BooleanOperation.DifferenceAB, p);
// faces of the result that came from the tool = the surface the tool is cutting right now
var engaged = mapper.map(toolAtPose.topology.getValidFaces(), MR.BooleanResultMapper.MapObject.B);
float engagedArea = res.mesh.area(engaged);
inProcess = res.mesh;
For long paths, a faster variant is to keep the in-process workpiece as a voxel distance volume (or a The functions above are all exposed in C#, the names are the same as in C++. If you share a sample tool and a CL file, we can check the approach on your data. |
Uh oh!
There was an error while loading. Please reload this page.
1.How to generate a tool swept volume based on cutter location (CL) points and tool axis vectors
2.How to subtract the swept volume from the workpiece
3.How to calculate the actual Cutter-Workpiece Engagement (CWE) at each cutter location point
All reactions