   Calculate the top side of a 2d polygon
  I have written an C# editor for a 2d platformer where polygons are drawn and then exported to data for use with the Box2D physics engine. The poly's are limited to 8 sides, counter-clockwise winding, convex poly's. My software automatically converts the poly's to this format using an ear clipping algorithm for convex decomposition.We have encounterd a problem in our game where we want to have single sided platforms. The main problem is oddly shaped platforms such as a sloped platform. The Box2D example only shows how to turn off detection for a square platform.I have come to the conclusion the only way to solve this problem is to convert all the poygon's to two "edges" which can be set to only detect on one side. This means I need to split all the polygons for all the level's we have already created (some are marked single sided so those are the ones I need to split). I am looking for an algorithm to loop through the points in a poly and determine if it's a point for the top-side of the platform or the bottom-side.Also if you feel there is a better way to solve this issue, feel free to post about it here.   
  I did not understand most of what you said.. But the last part I think I understood..If you want to know if a point belongs to the underside without some extra criteria it is difficult.But if you look at two points connected with an edge and then compute the normal of this edge and check if it points down or up. Down would be bottom side, up would be top side.Or easier look if the tangent points left or right.If you go around the polygon and take the difference of the X coordinate (left right) it will change sign depending on if it points up or down.   ;  Thanks for the reply unfortunately I've discovered that edges are not in the latest Box2D SVN so can't really use them at the moment.What I've done is add an "angle" variable to all our single-sided platforms and am using that to calculate if the player is jumping form the bottom to filter it out.This seems to be working the way I want for now.   ;  I did not mean to use a real edge I meant check if the sign between the x-coordinate of one polygon corner and the next (x2-x1) is positive or negative.(Keeping the same order..thus go around in one direction of the polygon)That is slightly easier than using an angle.   