Skip to content

How to create splines, bezier curves etc.? #2

@nextlevelshit

Description

@nextlevelshit

I was wondering how you made these curves so smooth: https://stardustjs.github.io/examples/parametric-functions/

And later I've found out you are just generating a bunch of (to be exact 100000) circles with a radius of 1. And the smooth shapes of the curves coming most probably from the parametric functions inside Stardust.scale.custom().

I used to work with D3js and there you're already getting all this wonderfull helpers to adjust any line to a bezier curve: https://github.com/d3/d3-shape/blob/master/src/curve/basis.js#L12

Now I'd try to build this up for my guilloche application. I am having some randomly spread points on and off the canvas, connecting them and adding this bezier curve flavour to them. I think I will figure it out, but is it really the best approach to increase the density of the points on the graph till it looks like a line?

The main objection, that I've got is, what are doing if the length of a line is not predictable? Would you add a "risk" factor to never run out of points and avoid getting gaps?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions