Hi Marco, yes I think it's possible to use the Fillet factory to get corner points, there is a custom method .generateVertices() on the fillet factory, you can use it like this to get an object list of point objects, one at each sharp corner of the curve:
code:
function GetCorners( crvs )
{
var factory = moi.command.createFactory( 'fillet' );
factory.setInput( 0, crvs ); // Set an object list with one curve in it.
factory.generateVertices();
var corners = factory.getCreatedObjects();
factory.cancel();
return corners;
}
function TestGetCorners()
{
var crvs = moi.geometryDatabase.getSelectedObjects().getCurves();
if ( crvs.length != 1 )
{
moi.ui.alert( 'Select a curve before running this command.' );
return;
}
var corners = GetCorners( crvs );
moi.ui.alert( 'Got ' + corners.length + ' corners' );
}
TestGetCorners();
- Michael
|