Hi all.
On Wed, 12 Apr 2023 00:53:24 -0000 (UTC), Jeff Higgins wrote:
Actually the code that generates the curve is not shown in the article.
var d3CurvedLine = d3_shape.line().curve(d3_shape.curveBasis);
var piecePathData = function(piece) {
return piece.map(function(edge) {
return d3CurvedLine(edge);
}).join(" ");
};
When I look at the D3 documentation:
https://github.com/d3/d3-shape#curves
I see that d3.curveBasis
"Produces a cubic basis spline using the specified control points.
The first and last points are triplicated such that the spline starts
at the first point and ends at the last point, and is tangent to the
line between the first and second points, and to the line between
the penultimate and last points."
And using the nugget of info here: https://stackoverflow.com/a/26707244/17085543
I believe that what I have is a cubic basis spline of degree 2
with six knots and four control points. Which is Greek to me.
But - allowed me to find TinySpline:
https://github.com/msteinbeck/tinyspline
Which promises Java bindings.
And may provide what I'm looking for ... I'll see.
Sysop: | Keyop |
---|---|
Location: | Huddersfield, West Yorkshire, UK |
Users: | 360 |
Nodes: | 16 (2 / 14) |
Uptime: | 130:35:02 |
Calls: | 7,686 |
Files: | 12,828 |
Messages: | 5,711,233 |