My first attempt to write a script for MoI & I’m looking for some advice. My goal is to extract model information to assist during manual machining operations. Traditional CAM doesn't really apply since neither I nor my machines speak g-code, so I’m thinking of creating something that might be considered a "manual tool path". To achieve this I would add circles representing a cutter at various positions in the model and then extract the coordinates of the centers of those circles. I would then use those coordinates as I position the spindle to make various cuts. While my DRO does have cutter offsets, I thought this would be a good puzzle to solve with a script.
I’m starting with the framework from the SavePointFile script as that would produce acceptable output, but maybe later on I can generate either leaders or annotations. I’ve been using David Morrill’s documentation from Max’s site, the V4 beta release notes and various scripts as examples, but I’m stumbling over how to get the coordinates of the center of a circle or arc. As I have not found a “center” property my current thought is that the new crv.conicFrame or crv.conicRadius properties may get me closer, but I have not figured out how to use these.
Assuming Curves is the selected circles and arcs…
code:
for ( var i=0; i < Curves.length; i++ )
{
if ( Curves.item( i).isCircle || Curves.item( i).isArc)
{
// Get the center point
}
}
Any advice or help is gratefully appreciated.
--Larry
|