Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

terrain example not working #548

Closed
openfoamtutorials opened this issue Dec 25, 2017 · 8 comments
Closed

terrain example not working #548

openfoamtutorials opened this issue Dec 25, 2017 · 8 comments

Comments

@openfoamtutorials
Copy link

The terrain example is not working (perhaps due to outdated API call?):
matter.js:7486 Uncaught TypeError: path.getPathSegAtLength is not a function
at Object.Svg.pathToVertices (matter.js:7486)
at SVGPathElement. (terrain.js:43)
at Function.each (jquery-3.1.1.js:368)
at jQuery.fn.init.each (jquery-3.1.1.js:157)
at Object. (terrain.js:42)
at fire (jquery-3.1.1.js:3305)
at Object.fireWith [as resolveWith] (jquery-3.1.1.js:3435)
at done (jquery-3.1.1.js:9242)
at XMLHttpRequest. (jquery-3.1.1.js:9484)

@liabru
Copy link
Owner

liabru commented Jan 9, 2018

Did you try using the pathseg polyfill? Also see #196.

@deathmood
Copy link

deathmood commented Jan 10, 2018

it also does not work on the official demo page

image

@liabru
Copy link
Owner

liabru commented Jan 10, 2018

Oh looks like the pathseg polyfill is broken on Chrome 62 and above. I've left an issue on the author's repo here progers/pathseg#22. Hopefully he can fix.

Thanks for reporting this!

@liabru liabru added bug and removed need-more-info labels Jan 10, 2018
@yuanzhhh
Copy link

+1
I met the same bug

@pavle-goloskokovic
Copy link

+1

@liabru
Copy link
Owner

liabru commented Feb 10, 2018

The solution is to use the latest version of pathseg rather than the one used in the examples. I'll get it updated in the examples soon.

@Zeyu-Li
Copy link

Zeyu-Li commented Aug 7, 2020

So do SVGs work with matter.js?
If so, can someone point me to the right direction b/c I have been looking into this for like 2.5 hours

@liabru
Copy link
Owner

liabru commented Sep 15, 2020

Check out the SVG example, though support is basic and more a proof of concept than anything. If you need something more, the general idea is to cut the shape into convex parts to form a compound body.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

6 participants