# Arc - BothSides?

_Arc - BothSides

i could of used that a few times lately.
so just making a low level suggestion and/or seeing if anybody else would have uses for it.

(pick center point then the start point is actually the midpoint of the arc)

2 Likes

Hi Jeff
Try the below Python script:

``````# Python script Arc_BothSides
# Write by Ing. Vittorio Carlotto
# carlottovittorio@gmail.comn

import rhinoscriptsyntax as rs

def  Arc_BothSides():
arrplane=rs.ViewCPlane()
rs.Command("_Arc")
result=rs.LastCommandResult()
if result==0:
arc_id=rs.FirstObject()
pc=rs.ArcCenterPoint(arc_id)
ps=rs.CurveStartPoint(arc_id)
pe=rs.CurveEndPoint(arc_id)
angle=rs.ArcAngle(arc_id)
matrot=rs.XformRotation2(angle,arrplane.ZAxis,pc)
pb=rs.PointTransform(ps,matrot)
result_2=rs.PointCompare(pe,pb)
if result_2==True:
matrot=rs.XformRotation2(angle,-arrplane.ZAxis,pc)
pb=rs.PointTransform(ps,matrot)
rs.DeleteObject(arc_id)
else:
return
Arc_BothSides()```
Ciao Vittorio``````
1 Like

Dang, Vittorio, you beat me to itâ€¦

However, I decided to use this as my first entry in the club of dynamic drawing scripts. Itâ€™s actually inspired from one of your scripts Vittorio !! Â (the half circle) You set a center point and a midpoint (you can enter a value to constrain the midpoint to a radius as usual), then drag the arc to where you want it. You can alternatively type in an angle value and enter. I used the total included angle, not the half angle - donâ€™t know whatâ€™s more convenient, but itâ€™s easy to change.

So, here it is, I havenâ€™t tested it extensively, and not at all on Mac, so @jeff_hammondÂ let me know if it works for youâ€¦

â€“Mitch

(updated againâ€¦ better initial plane control)

ArcFromMidpoint.py (2.7 KB)

1 Like

Hi Mitch
Thanks for your version.
There is an error at line 69:
I modified :
sPt=rs.PointTransform(gp.Point(),xFormR)
with
sPt=rs.PointTransform(mp,xFormR)

Ciao Vittorio

1 Like

nice fellas.
Iâ€™m drawing a little later today. Iâ€™ll try it out then. thanks

Hi Vittorio,

Yeah, dumb error, sorryâ€¦ Thanks for checking! I updated the original scriptâ€¦

Cheers, --Mitch

1 Like

Hi Mitch
The attached script is a modifycation of your script
Ciao Vittorio
ArcFromStartPoint_BothSides.py (2.5 KB)

1 Like

Ah, interesting variation, thanks Vittorio!

@jeff_hammond I updated the script again with some minor improvementsâ€¦ and it runs on Mac!

â€“Mitch

1 Like

finally got a chance to try it and itâ€™s great. (the one from the 3rd post in this thread at the time of me posting this).
also, i really like the live feedback/dynamic aspects.

thanks a ton @vittorio @Helvetosaur !
this one is definitely getting an alias

â€”â€”â€”â€”

i imagine both would have uses but i think youâ€™ve written it the dominant wayâ€¦ the things i currently want to do with it are via inferencing but who knows, i might be bumping the topic in a few months asking how to switch it to 1/2 angle.