This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* Interpolates a Catmull-Rom Spline through a series of x/y points | |
* Converts the CR Spline to Cubic Beziers for use with SVG items | |
* | |
* If 'alpha' is 0.5 then the 'Centripetal' variant is used | |
* If 'alpha' is 1 then the 'Chordal' variant is used | |
* | |
* | |
* @param {Array} data - Array of points, each point in object literal holding x/y values | |
* @return {String} d - SVG string with cubic bezier curves representing the Catmull-Rom Spline |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!doctype html> | |
<html> | |
<title>Flatten.js, General SVG Flattener</title> | |
<head> | |
<script> | |
/* | |
Random path and shape generator, flattener test base: http://jsfiddle.net/xqq5w/embedded/result/ | |
Basic usage example: http://jsfiddle.net/Nv78L/3/embedded/result/ |