Jump to content
Developer Wiki and Function Reference Links ×

Radius from 3 points


Recommended Posts

Hi Sam,

   Manually? Draw lines between points 1&2, and between 2&3. Rotate each line 90° (CMD-L). Extend the lines until they intersect. That is the center of the arc through those 3 points. Measure the distance from the intersection point to any one of the original points. That is your radius.

 

   Do you need an answer in script form?

 

Raymond

Link to comment

Almost done with the script.

 

As far as I know, the only set of 3 points that do not form an arc are 3 collinear points, unless you are willing to entertain arcs with infinite radii.

 

Back shortly with a script...  I guess now is a good time to ask, "Are you looking for a 2D solution, or one for 3D?"

 

Raymond

Link to comment

2D.   This is for plan view light plots.  A 3D solution would be interesting, but I do not foresee a need.  Interesting in that they would form a working plane and the solution would be on that plane.  That would confuse my current need, but interesting.

Link to comment

"As far as I know, the only set of 3 points that do not form an arc are 3 collinear points"

 

!  I thought that would be the case, but I drew some weird configurations that I thought would not work.  I just tested your manual solution.  Wow.  Who knew?  Well I guess everyone who did better in high school math knew.  I wish my trig and geometry instructors had been a little more creative in their assignments.  When I started drafting 20, no 30, no 40 years ago, I had to start re-teaching myself trig and then even geometry.  I was fairly successful, but some of the holes are pretty gaping.

 

Thanks again.

S

 

Link to comment

Hi Sam

Can it be a python script?

#Python Script. Returns connecting radius from 3 selected points
pts = []; h= vs.FSActLayer()
for i in range(3): #Get the first 3 selected objects
    pts.append(vs.GetLocPt(h))
    h = vs.NextSObj(h)

c = vs.ThreePtCenter(*pts)
d = vs.Distance(c[0], c[1], pts[0][0], pts[0][1])
vs.AlrtDialog('Your Radius is '+str(d))

vs.ArcByCenter(c[0],c[1],d,360,360)

 

If you are more familiar with pascal syntax than me:

ThreePtCenter() and Distance() should do the job

 

 

 

Edited by DomC
Link to comment

Dom,

   In Sam's original post he said he wanted the RADIUS of an ARC formed by 3 points. Your solution provides a CIRCLE through those points. With my inability to read things precisely the first few times through, I thought he also wanted the ARC defined by those points. I finally finished a script that returns the ARC that starts at the 1st point, proceeds through the 2nd point and ends at the 3rd point. If Sam doesn't need it, maybe somebody else will. I should have quit with the RADIUS solution.

 

   Here's a VW 2014 file with my script loaded in a script palette.  Arc By 3 Points v2014.vwx   Run the script and click in the drawing 3 times to provide 3 points. The script will draw the ARC passing through those points and place 2D Loci at the three click points and at the arc's center, then it will wait for you to click 3 more times for another arc. To end, press the ESC key or click 3x in the same place.

 

   If anyone can find a way to simplify this solution please post back here.

 

Raymond

 

Link to comment

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...