Coordinates of centers of circles or arcs in a script
All  1-2  3-6

Previous
Next
 From:  Larry Fahnoe (FAHNOE)
9875.3 In reply to 9875.2 
Thank you for the clarification Cemortan_Tudor, I will look into the distinction of segments vs. a joined curve.

My main question is *how* do I get the coordinates of the center of either a circle or arc?

code:
    var curves = moi.geometryDatabase.getSelectedObjects().getCurves();
    for (var i = 0; i < curves.length; ++i) {
        for (var j = 0; j <= curves.item(i).getSubObjects().length; ++j) {
        if ( curves.item(i).getSubObjects().item(j).isCircle || curves.item(i).getSubObjects().item(j).isArc)
           // How do I get the center point?
        }
    }


--Larry
  Reply Reply More Options
Post Options
Reply as PM Reply as PM
Print Print
Mark as unread Mark as unread
Relationship Relationship
IP Logged

Previous
Next
 From:  Cemortan_Tudor
9875.4 In reply to 9875.3 
curves.item(i).getSubObjects().item(j).conicFrame.origin;
ex:
var pointfactory = moi.command.createFactory('point');
pointfactory.setInput(0, curves.item(i).getSubObjects().item(j).conicFrame.origin);
pointfactory.commit();
- Tudor -
  Reply Reply More Options
Post Options
Reply as PM Reply as PM
Print Print
Mark as unread Mark as unread
Relationship Relationship
IP Logged

Previous
Next
 From:  Larry Fahnoe (FAHNOE)
9875.5 In reply to 9875.4 
Thank you Tudor! Your code examples helped me to solve the puzzle, much appreciated.

--Larry
  Reply Reply More Options
Post Options
Reply as PM Reply as PM
Print Print
Mark as unread Mark as unread
Relationship Relationship
IP Logged

Previous
 From:  Larry Fahnoe (FAHNOE)
9875.6 In reply to 9875.5 
  Reply Reply More Options
Post Options
Reply as PM Reply as PM
Print Print
Mark as unread Mark as unread
Relationship Relationship
IP Logged
 

Reply to All Reply to All

 

 
 
Show messages: All  1-2  3-6