Jump to content
This forum will be closing down. Please move to the respective dedicated project forums.

Find point on curve


futterbool
 Share

Recommended Posts

That's all we have on bezier curves:

https://github.com/pixijs/pixi.js/blob/dev/src/core/graphics/Graphics.js#L365

https://github.com/pixijs/pixi.js/blob/dev/src/core/graphics/utils/bezierCurveTo.js

It converts path to polygon and then it you can do an estimation, just see what's stored in "graphics.graphicsData" and do some computations based on it.

Link to comment
Share on other sites

3 hours ago, m9dfukc said:

I just needed the same functionality and found this http://pomax.github.io/bezierjs/ ... works pretty well combined with PIXI ;)

@m9dfukc absolutely perfect, thank you very much. From a brief scan of the documents I take it you just recreated the curve in that library (just in memory, no visual) then used it for the mathematical calculations?

Link to comment
Share on other sites

On 14.10.2017 at 12:52 PM, futterbool said:

@m9dfukc absolutely perfect, thank you very much. From a brief scan of the documents I take it you just recreated the curve in that library (just in memory, no visual) then used it for the mathematical calculations?

yep, exactly. I actually use it together with https://opentype.js.org/ which spills out bezier curves for the outline of the font. I then feed these to bezierjs and "resample" along the outline with `.getLUT(steps)`.

.getLUT(steps)

  

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...