HI Michael
I'm doing a script called _ApolloniusCircles, which, given 3 circles with non-collinear centers selected by the user, using code from LineWeb.
This would place tangent circles/spheres inside a Ring Dupin Cyclide, and do "gaskets."
It is necessary to find the center of the circles using script.
BoundingBoxCenter works, but the question is, can the center of a circle be found like the following var x1 = code which does not work:
// Select 3 xy circles: Good code from LineWeb:
var ObjectPicker = moi.ui.createObjectPicker();
// ObjectPicker.allowStandaloneCurves(); //From LineWeb.
if ( !GetObjects( ObjectPicker ) )
return;
var circles = ObjectPicker.objects;
circles.sortBySelectionOrder();
if ( circles.length < 3 )
return;
// Get circle centers and radii.
var c1 = circles.item(0); //OK
var c2 = circles.item(1); //OK
var c3 = circles.item(2); //OK
// radius seems to work.
var r1 = c1.radius; OK?>>>>>Bad code:
var x1 = c1.frame.center.x;
var x1 = c1.frame.x;
var x1 = c1.getCenterPt.x;
var x1 = c1.pt.x;
var x1 = c1.getCenterPt.x;
var x1 = c1.center.pt.x;
var x1 = c1.centerpt().x;
var x1 = c1.centerpt.x;
var x1 = c1.centerPt.x;
var x1 = c1.center.x
var x1 = c1.getCenterPt().x
var x1 = c1.getCenter().x
var x1 = c1.getcenterPt().x;
Second question, is the c1.radius code OK?
Third question, is a circle just another curve, or is there objectpicker code to restrict selection to circles?
Thank you
- Brian
Edit: Looks like I'll pursue the var bbox = objects.getHighAccuracyBoundingBox(); var pt = bbox.center;
http://moi3d.com/forum/index.php?webtag=MOI&msg=5440.1