// TailFins Script - User selects object to use as tail fin // N copies of the original are made and positioned for // the radius of the rocket (User is asked for N and radius) scene = window.getScene(); sel = scene.getSelection(); // Find out what user selected // Check to make sure user really did select 1 object if (sel.length != 1 ) { new MessageDialog(window, "Please select an object aligned as the first tail fin."); return; } info = scene.getObject(sel[0]); mesh = info.object; // Ask the user how many tail fins and what radius to use. numFinsField = new ValueField(3, ValueField.POSITIVE); bodyRadiusField = new ValueField(0.5, ValueField.POSITIVE); dlg = new ComponentsDialog(window, "How many rocket tail fins & radius", new Widget [] {numFinsField, bodyRadiusField}, new String [] {"Number?", "Body Radius?"}); if (!dlg.clickedOk()) return; numFins = numFinsField.getValue(); bodyRadius = bodyRadiusField.getValue(); rotDelta = 360.0/numFins; rotDeltaRad = Math.PI* rotDelta/180; orginalCoord = info.getCoords(); for (i=0; i