Hi,
In one of mine applications I am dealing with graphics objects. I am using open source GPC library to clip/merge two shapes. To improve accuracy I am sampling (adding multiple points between two edges) existing shapes. But before displaying back the merged shape I need to remove all the points between two edges.
But I am not able to find an efficient algorithm that will remove all points between two edges which has same slope with minimum CPU utilization. Currently all points are of type
PointF
I am calculating slope using following function
private float Slope(PointF point1, PointF point2)
{
return (point2.Y - point1.Y) / (point2.X - point1.X);
}
Any pointer on this will be a great help.