Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.java.programmer > #39944

Re: Looking for curve generating functionality

From Arne Vajhøj <arne@vajhoej.dk>
Newsgroups comp.lang.java.programmer
Subject Re: Looking for curve generating functionality
Date 2023-04-16 20:00 -0400
Organization A noiseless patient Spider
Message-ID <u1i27b$2nhk4$1@dont-email.me> (permalink)
References <u14ve4$2o5pr$1@dont-email.me> <u15aok$2t5ma$1@dont-email.me>

Show all headers | View raw


On 4/12/2023 12:06 AM, Jeff Higgins wrote:
> 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.

Google also found:

https://commons.apache.org/proper/commons-math/javadocs/api-3.6.1/org/apache/commons/math3/analysis/interpolation/SplineInterpolator.html

Arne

Back to comp.lang.java.programmer | Previous | Next — Previous in thread | Find similar | Unroll thread


Thread

Looking for curve generating functionality Jeff Higgins <jeff@example.com> - 2023-04-12 00:53 +0000
  Re: Looking for curve generating functionality Jeff Higgins <jeff@example.com> - 2023-04-12 04:06 +0000
    Re: Looking for curve generating functionality Arne Vajhøj <arne@vajhoej.dk> - 2023-04-16 20:00 -0400

csiph-web