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


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

Re: Looking for curve generating functionality

From Jeff Higgins <jeff@example.com>
Newsgroups comp.lang.java.programmer
Subject Re: Looking for curve generating functionality
Date 2023-04-12 04:06 +0000
Organization A noiseless patient Spider
Message-ID <u15aok$2t5ma$1@dont-email.me> (permalink)
References <u14ve4$2o5pr$1@dont-email.me>

Show all headers | View raw


On Wed, 12 Apr 2023 00:53:24 -0000 (UTC), Jeff Higgins wrote:

> Hi all.

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.

Back to comp.lang.java.programmer | Previous | Next — Previous in thread | Next 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