Hello bemfarmer,
no, I haven't any papers of the calculation. The idea is to calculate the Center of an arc given by 3 Points - the length is the radius - 1/R is the curvature. So I try to explain what the script should do:
In a first step it gets an Array of Points lying on the curve. Then it calculates the direction-vectors from the first to the second an from second to third Point. Half them and add the startpoint, you will have a Point for a plane. The direction-vector is the perpendicular vector of the plane. Then you can create a third plane by make a cross-product (axb) of the two normal-vectors (direction vectors). The intersection of the 3 planes is the centerpoint of the arc. You can make an Linear Equations System from the components of the 3 given planes. It is solved with cramers rule (implementin a gauss algorithm in Java-script isn't possible for me at this time). The determinants are solved with saurrus rule. If you have the Center you can calculate the Spikes with some vectormath.
Let me know how it works!
Kind regard
Karsten
|