Jump to content

  • Log In with Google      Sign In   
  • Create Account

casefc3s

Member Since 27 Dec 2009
Offline Last Active Apr 01 2013 01:45 PM

Posts I've Made

In Topic: Method to Create a Mesh that is Inset by a Specific Distance

29 August 2012 - 12:07 AM

Well, this only applies to a simple polygon; it can be concave or convex, but not cross itself or have "holes". What I ended up doing was tracing the perimeter as all vertices in this circumstance are on the border of the poly plane. I took the normal of the 'edge' vector between the current vertex to the last, and then the normal of the edge vector from the current to the next, scaled each by the amount of inset needed and then stored that offset in a temp array, which was then applied after looping through them all. This wouldn't work exactly as desired for concave polys and would create a translation that was in the wrong direction, so I just did a 'point in polygon' check and if was out of the original poly's surface space I used the inverse of that translation to get it in the right position. This should work with 3d and complex polygons as well with a little more effort, I just didn't go that far this time. Thanks for the help everyone!

PARTNERS