Grasshopper

algorithmic modeling for Rhino

I want to be able to define whether a given curve (or just a point on the curve) is concave or convex, with respect to an 'observer' point away from the curve. I'm at a bit of a loss as to where to start.


Any ideas?

Views: 2500

Replies to This Discussion

How about:

1) find closest point on curve from observer
2) get curvature of curve at that parameter
3) measure the angle between the curvature-direction and the observer-cp vector
4) if the angle is larger than 0.5 Pi, it will be concave.


If your direction of observation is fixed (as the arrows in your image suggest), you shouldn't use Curve CP, but Curve|Line intersection instead.

--
David Rutten
david@mcneel.com
Poprad, Slovakia
I tried a different way:

Using Curve CP I compared the distance to the centre of Curvature from the Observer with the Radius and thereby determined Convex or Concave.

The other thing I tried to do is make the definition multiple Points friendly.


NB: This method does not work for a line without curvature where as I think David's would be able to.
Thanks David, your def was a big help, and I got what I was after... a way to analyze the curvature of a curve, but make a distinction between concave and convex. See image:


Obviously, this will be reversed if you flip the curve. the 'observation side' is based on the curve normals at the division points.

This is part of a bigger project, of course... i'll post the results when I'm done :D

here's the def:
Attachments:

RSS

About

Translate

Search

© 2024   Created by Scott Davidson.   Powered by

Badges  |  Report an Issue  |  Terms of Service