Grasshopper

algorithmic modeling for Rhino

I know there are easy enough ways to replicate snap commands in VB with .PointAt and .GetClosestPoint and getting intersections and whatever but there is one that has me stuck. I need to get the quadrant of user generated curves. 

 

Here are my thoughts:

1) Get tangets at a ton of points and get the point where the numbers go from positive to negative... Very inefficient

2) Check where the tangent is equal to the X-Axis. Not sure how to check for that

3) Tell the thing to get tangents with a Delta Y equal to 0... don't know how to do that either

 

I can access this:

rhino.ApplicationSettings.OSnapModes.Quadrant

 

which seems about as useless as it looks so any help would be greatly appreciated. 

Views: 1241

Replies to This Discussion

I started typing on a naive divide+conquer algorithm, but I can already see that even if I get the remaining bugs out it won't find all the solutions. I'll ask around in Seattle if we can make the quad-finder public.

 

I attached my intermediate results, though it's probably not that useful.

 

--

David Rutten

david@mcneel.com

Poprad, Slovakia

Attachments:
Thanks for the news. I tried to do something similar and it seemed pretty ridiculous to me too. Best

Hello,

I was looking for the same thing and went about it almost exactly as you described, and it works quite well.  It does seem to require a little "jiggling" of the inputs at times for all of the quads to show up, but it does work on 3d curves.  The easiest way I could find to check tangents was to take the dot product of the "t" points with the desired vector that was closest to zero, average if it returned multiple, then take the closest point.

I hope someone can get some mileage from this!

-Ben

Attachments:

RSS

About

Translate

Search

Photos

  • Add Photos
  • View All

© 2024   Created by Scott Davidson.   Powered by

Badges  |  Report an Issue  |  Terms of Service