Concave polygons not working even after I installed poly-decomp (node server)
See original GitHub issueI’ve installed poly-decomp
with npm install poly-decomp
. I then put decomp = require('poly-decomp')
above matter = require('matter-js')
, when I run my code, it still says poly-decomp.js required
. I dug in matter.js
code and changed line 6541 to decomp = require('poly-decomp')
. It doesn’t give the same message anymore, but my shape is still just convex.
I ran console.log(decomp)
after line 6541, and it returned
{ decomp: [Function: polygonDecomp],
quickDecomp: [Function: polygonQuickDecomp],
isSimple: [Function: polygonIsSimple],
removeCollinearPoints: [Function: polygonRemoveCollinearPoints],
makeCCW: [Function: polygonMakeCCW] }
which I think is what it should return. I dug even farther and made sure that line 6763 was being run, and it is. Although, when I console.log(decomp.makeCCW(concave));
on line 6769, it returns undefined
. What should I do to make it work? Right now it isn’t giving me the error message, but it isn’t making the shape concave.
Issue Analytics
- State:
- Created 6 years ago
- Reactions:4
- Comments:28 (10 by maintainers)
Top Results From Across the Web
A brand new website interface for an even better experience!
Concave polygons not working even after I installed poly-decomp (node server)
Read more >How can I clean/fix polygons in a Node.js application?
Although I am not cleaning up Polygons I have found a better approach. ... fix everything, you can try repairing it once it's...
Read more >poly-decomp - npm
poly-decomp.js ... Create a concave polygon var concave = new decomp. ... Make sure you have git, Node.js, NPM and grunt installed.
Read more >Use of GL_STENCIL_TEST to render concave polygons
In fact, the context enabled by Quartz Composer doesn't implement a stencil buffer. It seems impossible to render directly in OpenGL with the ......
Read more >poly-decomp.js
js. Decomposition of 2D polygons into convex pieces in JavaScript. See the Github repo. Try drawing a polygon below!
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Thanks for the info guys, sorry that this is still an issue. While I look into it more, I think this temporary fix should work with the latest version. Make sure you put it somewhere early on, before you use
Bodies.fromVertices
:Using
global.decomp = require('poly-decomp')
is working for me with Webpack