Find MidBoundary between two polylines.
Wish List complete. Experimental phase over! Thanks to Guenther Bittner. Guenther has done an excellent job revamping this code! The program is now ready for release.
Rolling_Ball - This program was an experiment to find the mid-boundary between two polylines using the rolling ball theory. Experiment Complete!
The rolling ball theory: The mid-boundary should be a line running from center to center of the largest ball possible rolling between two boundaries. Illustration:
The red lines above are the boundaries. The yellow circles represent the ball rolling between the two boundaries. The blue line is the mid-boundary.
This program asks you to select the starting end of the first and second boundaries. It then asks for the increment for the ball movement each check. This is shown in the drawing below.
The program starts at the end of boundary 1 and draws a circle. The circle touches boundary 1 and grows outward perpendicular to boundary 1. It checks for an intersection with boundaries 1 & 2. If no intersection is found, the size if the circle is increased.
This process continues until an intersection is found. If it intersects with boundary 1, the process is stopped and it starts over at the next point down boundary 1. In th illustration below, an intersection point was found on boundary 2.
If an intersection with boundary 2 is found, the program begins to decrease the circle size in smaller increments. This continues until an intersection is not found. The last valid intersection point is stored.
The white intersection point below represents the last valid intersection point stored. The program then finds a new point down boundary 1 to start the process over.
This continues until we reach the end of boundary 1. The illustration below shows the valid mid-boundary points found along with the final mid-boundary line.
You can decrease the increment to check for intersections and decrease the increment to move down boundary 1 to get better results.
Wish List complete. Thanks to Guenther Bittner. Guenther has done an excellent job revamping this code. The program is now ready for release.
To Download the program click <here>.
If you have any questions about the program click here.
All questions/complaints/suggestions should be sent to JefferyPSanders.com
Last Updated April 1st, 2013
Copyright 2002-2013 JefferyPSanders.com. All rights reserved.