Grasshopper

algorithmic modeling for Rhino

I'm hoping the solution is embarrassingly simple.

I have 2 points and want to draw an arc with a given radius.

I posted in this section thinking it may be a simple solution.

 

Otherwise, with a scripting approach, I couldn't find a suitable arc constructor for this in Rhinocommon. Please correct me if I'm wrong.

What I found was:

 

Arc(Circle, Interval) Create a new arc from a base circle and an interval of angles.Arc(Circle, Double) Create a new arc from a base circle and an angle.

Arc(Plane, Double, Double) Create a new arc from a base plane, a radius value and an angle.

Arc(Point3d, Point3d, Point3d) Create a new arc through three points. If the points are coincident or colinear, this will result in an Invalid arc.

Arc(Point3d, Vector3d, Point3d) Create a new arc from end points and a tangent vector. If the tangent is parallel with the endpoints this will result in an Invalid arc.

Arc(Point3d, Double, Double) Create a new horizontal arc at the given center point, with a custom radius and angle.

Arc(Plane, Point3d, Double, Double) Create a new aligned arc at the given center point, with a custom radius and angle.

Views: 24047

Replies to This Discussion

Hi Santiago,

 

two points and a radius define an infinite number of arcs in 3D, and two possible arcs in 2D. You're going to have to specify some additional information. What else do you know about these arcs?

 

--

David Rutten

david@mcneel.com

Poprad, Slovakia

Hi Dave,

I also know the plane orientation. That should reduce all possibilities to 2 arcs.

A boolean input such as "positive/negative" would allow me to choose one of the 2 2d solutions.

For the purpose of learning, I'll work on a VB.net component that achieves this, and post it in the VB.net and C# corner.

Here's an attempt that takes your Start Pt, End Pt and a Radius (plus you need to choose a direction option). Then it creates a pt for your centre. After doing this it then creates a Third input pt for the GH Arcs Component.

Attachments:

Thanks Danny,

It looks like the solution is not simple after all.

I can work with this, but I'd really like to write a VB.net component for it.

This gives me ideas of some secondary outputs for the component.

This is another approach.To explain it briefly:


 

x is how much we move point C perpendicular to AB.

OCA is always a right triangle. Hence, from the Pytagorean theorem;

r² = (r-x)² + y²

x = r - sqrt(r²-y²)

 




Attachments:

Hi Caglar,

Thanks for the solution.

In order to choose from the 2 possible solutions, I can either reverse the vector being rotated, or I can change the quadratic equation to its negative solution.

I'll use this criteria as well to write the component, and post in the VB.net and C# corner, unless someone beats me to it! Hopefully I'll find time to write it today.

 

Thanks again, you guys are awesome.

Hello Santiago,

Here is the VB component.

Attachments:

Great! Thanks Caglar.

I added the plane input, to replace your default Z vector for rotation.

The actual type hint is a vector3d, since only the Z of the plane is required.

 

 

Thanks again for your help!

Attachments:

Sorry for my English!
How to make the length of the arc was as variable? And the radius is calculated within the program? Maybe dichotomy.
I'm not a programmer, I would be very grateful if someone can help me.
I could do it with the help of the Galapagos, but better a modified script as did Santiago Diaz (arc2ptVB_(with plane).ghx - Awesome!!).

RSS

About

Translate

Search

Photos

  • Add Photos
  • View All

Videos

  • Add Videos
  • View All

© 2024   Created by Scott Davidson.   Powered by

Badges  |  Report an Issue  |  Terms of Service