Grasshopper

algorithmic modeling for Rhino

Conceptual Question - how to tell if a surface normal points in or out relative to itself

I am working on a script to add fireproofing to columns. In order to offset the correct surfaces, I need to remove the ones pointed inwards for the hollow shapes (HSS). I am able to cull out the top and bottom based on area, but what would you suggest I do to figure out if the surface points inwards or outwards? I was thinking of comparing the centroid of the object with the direction of the normal but I am not sure if that is a correct approach. 

It's a conceptual question, so please don't bother writing scripts as an answer, just a tip/idea would be nice.

Thank you so much. 

Views: 514

Replies to This Discussion



Create a point (perhaps using the top right corner of the bounding box), project it to all surfaces and obtain the normals in those UV coordinates. Then calculate the dot product of those vectors with respect to the X axis of the world (this direction is coherent taking a point at the right of the bbox), and if the result is less than a positive tolerance or threshold, then those surfaces must be eliminated. I'm not sure, but I think it would work in those geometries if you choose the correct point and direction to do the dot.

Another option is to project a point (or create a line) from each surface in normal direction in that uv position, if it intersects with the geometry then it is an inner face.

Hi! Try with this. 

Attachments:

RSS

About

Translate

Search

Videos

  • Add Videos
  • View All

© 2024   Created by Scott Davidson.   Powered by

Badges  |  Report an Issue  |  Terms of Service