Grasshopper

algorithmic modeling for Rhino

How to find normals at intersection of a curve and surface?

Hi all, interesting problem here.

I have a grid of points, which define lines going down in the Z direction.  I then find the  intersections of these with a topographical surface below (a Brep, collection of surfaces).  How can I find the normals at these intersections, so that if I distribute a planar object to these points they will orient to the topography?  I have tried Surface CP, and Evaluate Surface, but they return results for each surface in the Brep, not at the specific intersections.

Help!

Thanks,

JP

Views: 1832

Replies to This Discussion

Hi Mays,

Can you post/draw a screenshot of what you want to achieve?
Thank you.

Attachments:

Chris, this is what I am trying to achieve, but the problem is the Closest point returns too many values, not equal to the number of points in the intersection.

My surface started as a mesh that I imported from Revit, and then converted to a polysurface.  However, Grasshopper doesn't recognize it as one surface, so I used a Brep container.

Here are the points intersected with my surface, then the normals created, and then the script:

Attachments:

JP, 

I think the problem is that the Surface CP will return the closest point on EVERY surface to each specific point from which you are searching. From this longer list, you need to find the point that has the smallest distance as this will be the one that is on the specific surface that is under your point on the grid. You can does this by using the List Sort component and the distances output by the Surface CP. Using the distance as the Sort key,  input the list of Surface CP points and the list of surfaces into two of the Sort inputs so that these lists get sorted in sync. The output of this sort component at index 0 will be the a) the smallest distance, b) the point that corresponds to that smallest point, and c) the surface on which that point exists.

Since your curves are all lines, SCX (mathematical Surface-Line-Intersection) would be more appropriate and lines don't need to physically intersect the surface any more.

Explode your BRep (since it is a kind of flat surface anyway) to get all the single surfaces. Failing intersections will get you "null" results all valid intersections return point of intersection and surface normal vector. Nulls can be removed with CleanTree.

RSS

About

Translate

Search

Videos

  • Add Videos
  • View All

© 2024   Created by Scott Davidson.   Powered by

Badges  |  Report an Issue  |  Terms of Service