parameters for Arc2PR ecma script

Use this forum to ask questions about how to do things in QCAD.

Moderator: andrew

Forum rules

Always indicate your operating system and QCAD version.

Attach drawing files and screenshots.

Post one question per topic.

Post Reply
roland29
Registered Member
Posts: 2
Joined: Thu Jul 02, 2015 3:37 pm

parameters for Arc2PR ecma script

Post by roland29 » Fri Jul 03, 2015 2:40 pm

I'm looking for an example to draw an arc through 2 points and the radius with the ecma script function Arc2PR, the docu from the ecma script is in that case not very useful.

User avatar
andrew
Site Admin
Posts: 9037
Joined: Fri Mar 30, 2007 6:07 am

Re: parameters for Arc2PR ecma script

Post by andrew » Sun Jul 05, 2015 12:15 pm

Are you trying to draw an arc though 2 points using the QCAD application (i.e. point and click with the mouse) or are you developing a script which should at one point programmatically create an arc from 2 points? Thanks for your clarification.

roland29
Registered Member
Posts: 2
Joined: Thu Jul 02, 2015 3:37 pm

Re: parameters for Arc2PR ecma script

Post by roland29 » Tue Jul 07, 2015 12:03 pm

I'm trying to create programmatically an arc through 2 points and the given radius

User avatar
andrew
Site Admin
Posts: 9037
Joined: Fri Mar 30, 2007 6:07 am

Re: parameters for Arc2PR ecma script

Post by andrew » Mon Jul 13, 2015 8:06 am

You could call getArc2PR of class Arc2PR directly:
var obj = {};
obj.point1 = new RVector(50,50);
obj.point2 = new RVector(75,100);
obj.radius = 50;
obj.reversed = false;     // true for clockwise
obj.alternativeSolution = false;     // true for longer of the two possible arcs
var arc = Arc2PR.prototype.getArc2PR.call(obj, false);

Post Reply

Return to “QCAD 'How Do I' Questions”