Grasshopper

algorithmic modeling for Rhino

Which is the simplest way to have the distance from a surface with sign depending on the normals of the surface?

I tried the "surface closest point" node but it doesn't have the sign.

Views: 1510

Replies to This Discussion

Being 'N' as the normal at 'cPt' on surface and 'V' the vector from cPt to Pt, if the dot product of N and V is positive, then Pt is above, if not is below the surface.

If N·V>0 then Distance * 1 else Distance * -1

thanks! it would be useful to have a toggle to make all this calculation at once in the "surface closest point" node

Make and post a GH model!  ALWAYS.

Measure the angle between the normal vector and the 'Vec2Pt'.  If it's at (or near) zero, the sign is positive.  If it's at (or near) Pi, the sign is negative.

P.S.  What Daniel said works too; I don't remember what 'Dot Product' means, but it works.

Attachments:

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