Interconnected curved lines

NanoByte

New Member
Given a series of JSON co-ordinates typically in the format:\[code\]{from: {x:0, y:0}, to: {x:0, y:10}, ...}\[/code\]I would like to draw a series of dotted lines (points) which are connected with simple, fixed radius rounded corners. I have been looking at Slope Intercept Form to calculate the points along the straight line but I am a little perplexed as to the approach for calcualting the points along the (Bezier?) curves.e.g. I want to draw curves between p1 and p2 and p3 and p4. Despite what the poor mockup might imply I am happy for the corners to be a fixed radius e.g. 10px
j1uTA.png
I would like to abstract out the drawing logic and therefore am seeking a generalised approach to returning a JavaScript point array which I can then render in a number of ways (hence I am avoiding using any inbuilt functions provided by SVG, Canvas etc).
 
Back
Top