Thursday, December 8, 2016

On the Road to Splines 3

I continued work on splines a little bit at a time over the past few days.  The results aren't perfect, but can at least be shown.  Instead of mere thin black lines, we now have roads and railroads.

As you can see from the screenshot below, there are a few areas that need to be addressed.  The left-most roads were drawn using the polyline tool.  You can see the problems at the corners.  Less obvious are the smaller artifacts along the spline.  These need to be addressed to get a smooth shape.

Railroads and roads drawn using lines, polylines, and splines

The other big areas that obviously need to be addressed are the intersections and crossings.  Where roads intersect other roads, or tracks intersect other tracks, additional rendering logic is required. Where roads and tracks cross, there is also the need for more rendering logic.  At the moment, all they do is overlap.

Related to the last paragraph is the current total lack of any topological representation.  Each line segment, polyline, spline, or polygon is essentially independent of all others.  A graph structure for each type is required to add some semblance of order and contribute to improves in the areas mentioned above.
Road, railroad, river, and a trio of buildings

Just a quick note about current rendering.  The example application is implemented in C# and Windows Forms, with the graphics being rendered using GDI+.  That's not necessarily the long-term solution, as I hope to integrate this code with the 3D stuff I've also posted about here.  It may work well enough for basic editing operations, though - in which case I need some zooming and panning controls, as well as the ability to load and save what has been drawn.

I'll post more on this when there's been more progress worth sharing.

No comments:

Post a Comment