Hi everyone,

Is there any component in Grasshopper that draws an arc based on start point, end point and the radius?

And if not, do you have any suggestions?

thanks in advance

Hi everyone,

Is there any component in Grasshopper that draws an arc based on start point, end point and the radius?

And if not, do you have any suggestions?

thanks in advance

Most of the time simple thinks in Rhino have no counterpart in Grasshopper has in Grasshopper there is no user interaction (choice of a view, mouse movement â€¦).

The best for you is to make a component from Arc SED (2 points and a vector) and calculate the vector depending on the plane, direction you want and radius.

Or use this plugin

1 Like

Use math to find the point if you choose start,end,radius or vector if you choose arc sed.

Of course a component to do that is better.

arc.gh (18.2 KB)

1 Like

How do you know itâ€™s the short arc instead of the long one? What if you want that arc to be in a different plane?

I donâ€™t understand what you mean by short and long arc.

Itâ€™s based on 2 points.

I wrote an algorithm, I know itâ€™s not so clean and the shortest way, but for me it worksâ€¦

But I canâ€™t understand why the curve doesnâ€™t shatterâ€¦ARC,Start,End,Radius.gh (18.3 KB)

An arc is part of a circle. So when you cut a circle at two points, you get two arcs. So even in 2d, two points and a radius actually describe two different circles and thus four different arcs. How do you pick between these four outcomes?

```
private void RunScript(Plane plane, Point3d start, Point3d end, double radius, ref object A, ref object B, ref object C, ref object D)
{
var line = new Line(start, end);
var vec = Vector3d.CrossProduct(line.Direction, plane.ZAxis);
vec.Unitize();
var d = Math.Sqrt(Math.Pow(radius, 2.0) - Math.Pow(line.Length, 2.0) / 4.0);
A = new Arc(start, line.PointAt(0.5) + vec * (radius - d), end);
B = new Arc(start, line.PointAt(0.5) - vec * (radius - d), end);
C = new Arc(start, line.PointAt(0.5) + vec * (radius + d), end);
D = new Arc(start, line.PointAt(0.5) - vec * (radius + d), end);
}
```

Arc.gh (5.9 KB)

2 Likes

I donâ€™t cut a circle, i draw a line between two points than offset its middle point , the maximum offset is the Radius.

There is a mathematical relation between the middle point of arc and the radius which used to create it.

1 Like

This is a python component to create arc from 2 points and Radius

arc SER.ghpy (31.5 KB)

```
import rhinoscriptsyntax as rs
import math
if S and E:
V = rs.VectorCreate(S,E)
L = rs.VectorLength(V)
if R < L/2 or R == None:
R = L/2
if D == True:
if A == True:
ang = math.degrees(math.asin(L/(2*R)))
else:
ang = math.degrees(-math.asin(L/(2*R)))
else:
if A == True:
ang = math.degrees(math.asin(L/(2*R))-math.pi)
else:
ang = math.degrees(math.pi-math.asin(L/(2*R)))
d = rs.VectorRotate(V,ang,[0,0,1])
Arc = rs.AddArcPtTanPt(S,d,E)
C = rs.ArcCenterPoint(Arc)
```

1 Like

Great as always,

thanks so much.

Hi, I try to use this function in my Grasshopper. I struggle to get an Arc output.

Any ideas what went wrong?

I canâ€™t know without the file

This is the file. The left part makes problems. The right part was simply to double check the functionality.

ArcPPR.gh (11.7 KB)

Thank you, that solved the issue.