Show messages: 1-11 12-31 32-42
function GetCurveControlPoints(curve) { var gd = moi.geometryDatabase; var obj = gd.getObjects(); obj.setProperty( 'showPoints', false); curve.showPoints = true; gd.selectAll(); obj.setProperty( 'selected', false); var objectpicker = moi.ui.createObjectPicker(); objectpicker.allowEditPoints(); objectpicker.done(); gd.copyToClipboardCommand( objectpicker.objects ); gd.pasteFromClipboard(); var points = gd.getSelectedObjects(); gd.removeObjects(points); curve.showPoints = false; return points; } /* example */ var curves = moi.geometryDatabase.getSelectedObjects().getCurves(); if (curves.length === 1) { pts = GetCurveControlPoints(curves.item(0)); /* let's build polyline through control points */ var factory = moi.command.createFactory( 'curve' ); for ( var p = 0; p < pts.length; ++p) { factory.createInput('point'); factory.setInput(factory.numInputs - 1, pts.item(p).pt); // point factory.createInput('bool'); factory.setInput(factory.numInputs - 1, true); // corner } if (curves.item(0).isClosed) { factory.createInput('point'); factory.setInput(factory.numInputs - 1, pts.item(0).pt); factory.createInput('bool'); factory.setInput(factory.numInputs - 1, true); } factory.commit(); }
Message 6257.17 was deleted
function GetCurveControlPoints(curve) { var gd = moi.geometryDatabase; var obj = gd.getObjects(); obj.setProperty( 'showPoints', false); curve.showPoints = true; gd.selectAll(); obj.setProperty( 'selected', false); var objectpicker = moi.ui.createObjectPicker(); objectpicker.allowEditPoints(); objectpicker.done(); gd.copyToClipboardCommand( objectpicker.objects ); gd.pasteFromClipboard(); var points = gd.getSelectedObjects(); gd.removeObjects(points); curve.showPoints = false; return points; } var curves = moi.geometryDatabase.getObjects().getCurves(); for ( var f = 0; f < curves.length; ++f) { pts = GetCurveControlPoints(curves.item(f)); for ( var p = 0; p < pts.length; ++p) { var factory = moi.command.createFactory( 'text' ); factory.setInput(0, moi.VectorMath.createFrame ( pts.item(p).pt) ); factory.setInput(1, ' xyz('+ Math.round(pts.item(p).pt.x*10)/10 + ', ' + Math.round(pts.item(p).pt.y*10)/10 + ', ' + Math.round(pts.item(p).pt.z*10)/10+ ')'); factory.setInput(2, 'Arial'); factory.setInput(5, 'curves' ); factory.setInput(6, 0.5); factory.setInput(7, 1); factory.commit(); } }
Image Attachments:
on_the_curve.jpg
Message 6257.22 was deleted