Answered by:
Create a "rounded corner rectangle" polyline/polygon
Question

Hello guys,
I'd like to create a polygon/polyline with a curve in it. Just like a rectangle with rounded corners, for example.
This is of course basically a mathematical issue; but I don't know how to do that anyways. Perfect would be an algorithm with a "start point" and and "end point" and maybe even a target angle that defines the curve (Standard rectangle would be 90°, but it would be awesome to be also able to define a 70° angle etc...)
Do you have any sources or ideas how to achieve this?
Thanks and best regards,
Adrian
Answers

Take a look at this article: http://www.codeproject.com/Articles/128705/WPFroundedcornerspolygon
What I would suggest doing is converting the coordinates of your polygon to pixel coordinates on the map using the tryLocationToPixel method this way you are working with basic 2D data. Then run the algorithm to calculate the rounded corners. Then convert the pixel coordinates back to spatial coordinates using tryPixelToLocation.
http://rbrundritt.wordpress.com
 Marked as answer by Ricky_Brundritt Tuesday, September 4, 2012 10:14 AM
All replies

Take a look at this article: http://www.codeproject.com/Articles/128705/WPFroundedcornerspolygon
What I would suggest doing is converting the coordinates of your polygon to pixel coordinates on the map using the tryLocationToPixel method this way you are working with basic 2D data. Then run the algorithm to calculate the rounded corners. Then convert the pixel coordinates back to spatial coordinates using tryPixelToLocation.
http://rbrundritt.wordpress.com
 Marked as answer by Ricky_Brundritt Tuesday, September 4, 2012 10:14 AM


I can't get this working. The solution you provided doesn't calculate new pointobjects for the PointCollection/LocationCollection. Instead it just takes all the points and draws a rounded shape. The algorithm basically runs with Shapes, Segments and Paths but all the PointObjects remain the same.
Yet i haven't figured out how to use this algorithm to produce more Points for the PointCollection/LocationCollection.
@Adrian: Have you already figured out how to make rounded MapPolygons? bzw. hast du schon rausgefunden, wie man mappolygone mit runden ecken hinkriegt?
Best regards from Munich ;)