I have a question about drawing lines/paths on my own. I use a combination of C#/WPF/Cudafy for UI and some calculations (e.g. the paths). Now I have a Byte[] array that should be filled with 'colors'/values (array-length = 4 * width * height of the result image).
I got some startpoints for the lines and one endpoint (somewhere between the startpoints). First I calculated some paths from those startpoints to the endpoints and then want to 'draw' them to the array (that will be used to construct a WriteableBitmap). The point coordinates are present in a 'reduced environment' though (since calculation of the paths needed to run a Dijkstra algorithm).
My paths are now defined by Tuples holding the point-coordinates (reduced size) and a 'linewidth'.
Since some paths may 'overlap' I thought I will do the following steps to ensure a nice looking of the result:
- Merge the paths: For that I will take one path and just keep it. Then I take the second and check if the path-points are somewhere near a path already added (like a near-neighbor search). I want to do this because in the end, I want to widen the line-width where paths overlap (3rd Tuple value).
- When finished, I want to 'interpolate' the paths: I don't really know how I should do that, since every path has a point at every (reduced-size) pixel. One possibility would be to clear out all those path-coortinates of the paths that 'lie on a line' (and are not really necessary) and then do something like a Bezier - Interpolation. But all these steps seem to be overkill to me.
Don't you think there might be a better way to do this? If so, please share your thoughts :)
Thank's for any help!
Here's a link to an image of how it looks right now: CPVL Application