-
Notifications
You must be signed in to change notification settings - Fork 108
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
SurfaceMeshBuilder + Sphere Circular Dependency issue in build #18
Comments
Sphere#toMesh issue now only appears in rare use as an individual AMD module before using the require.js build process, at times of latency. |
I'm having a problem with SurfaceMeshBuilder: var mesh = new toxi.geom.Sphere(80).toMesh(null, 20); line 5671 in toxiclibs.js var builder = new SurfaceMeshBuilder(new SphereFunction(this)); |
It appears to me that you are using v0.1.0, can you please try the v0.1.1 (the current master) and confirm you are still experiencing this issue? this has been a tricky one. |
Okay, I just downloaded the current master f54bd6a and I'm still getting the error. |
Ok, I am able to recreate the error on my side. I've put a possible temporary workaround in this gist: https://gist.github.com/2377350 the error only persists if the mesh is constructed within the first second after window.onload is called. if there is any sort of delay first (or say the mesh is intended to be constructed by a user interaction) then it works successfully. The error occurs because at that time the module 'toxi/geom/mesh/TriangleMesh' has not yet been resolved. this is high priority for the next release. |
Having a hard time putting this down :) I am able to get the whole thing working (without any delay) by making TriangleMesh#getBoundingSphere an asynchronous call, which isn't a perfect solution, but might be the best possible for this type of circular dependency. So, https://github.com/hapticdata/toxiclibsjs/tree/issue_18 the build file in that should work fine, however if in slim-chance you are going to need TriangleMesh#getBoundingSphere you will need to use it like so:
|
This issue has been resolved in the develop branch, without the use of asynchronous functions. It will be merged to master soon with the next release. |
this was merged to master for v0.1.3 |
Currently there is a circular dependency issue between
toxi.geom.mesh.SurfaceMeshBuilder
andtoxi.geom.Sphere
in the toxiclibs.js or toxiclibs.min.js builds. This can cause toxi.geom.Sphere#toMesh to fail.The text was updated successfully, but these errors were encountered: