Comments (2)
Created a JSbin with your code, and modified it so it doesn't pretend what you're doing with bezierjs is even remotely the same as what you're doing in SVG: http://jsbin.com/fiyiyivefa/edit?js,output
Note that because bezier.js does not have a "get point at some distance" function, this is not a perfect match: we would have to find the point at i-step/2
and at i
, and then we would have to do a second check in side of that range to find the exact point T
for which curve.get(T)
yields the point at 20% distance along the curve.
from bezierjs.
yes, obviously those are different points: Bezier curves are non-linear, evaluated based on a parameter of time, not a parameter of distance, so we cannot assume that t=0.2
lies at 20% of the total length of the curve, or that t=0.75
lies at 75% of the total length of the curve (read the previous link for a much more detailed explanation on why).
As such, get(0.2)
and getPointAtLength(0.2 * totalLength)
are completely different things, and even if we make the curve looks like a straight line, it is still defined as a non-linear plot, and so it is trivial to prove that .get(n)
and getAtLength(total * n)
always differ except at n=0
and n=1
and a possible handful of singleton points (where the number of points for where this is true depends on the order of the curve and the number of inflections expressed on it)
from bezierjs.
Related Issues (20)
- Get the length of the curve at some `t` HOT 1
- _lut caching doesn't work: steps is off by one HOT 5
- Release v6.1.2 broken HOT 3
- Why get(t = 0.5) point is not the middle point of the curve? HOT 5
- Find optmal D1 - Bezier.cubicFromPoints HOT 1
- PolyBezier is not exported correct for ES Module. HOT 3
- Rational Bezier Curve Support HOT 1
- Example usage of `dist/bezier.js` HOT 4
- How to make a "strict" version of bezier.project(point)? HOT 2
- Should bezier.lineIntersects(line) work for line-line intersections? HOT 3
- intersects bug Bezier to Bezier HOT 3
- Suspicious line in `utils.compute()` HOT 2
- The intersection of the two bezier is empty HOT 10
- The intersection of two identical curves HOT 2
- Intersect line method does not always return existing intersections HOT 6
- Ability to get and estimate the centerline of a list of 3D points HOT 3
- PR for extending API to interpolate values along curve and find point on curve at distance?
- Artifact when offsetting an SVG path
- Split curves do not follow old curve. HOT 2
- Missing LICENSE file HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from bezierjs.