-
Notifications
You must be signed in to change notification settings - Fork 66
trying to add a text geometry, stuck in JavaScript #28
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
Comments
Hey Shen! It would be much easier to figure out what's going on if you can show me your actual code and the full error message. Can you open a Pull Request with whatever you have now? From what you've said, though, I'm guessing that your TextGeometry's |
Thanks for the quick reply, Robin! I've opened a Pull Request #29, the |
Here's the JavaScript console error I wasn't able to reproduce the exact uuid error on my home computer (will try reproduce on the lab computer later), instead I had a different uuid problem. But it seems so low level I feel it's probably not relevant to the issue. Regarding this JS error, mrdoob/three.js#9905 seems very relevant. On the MeshCat side, I'm guessing I should mimic https://github.com/rdeits/meshcat/blob/c7dcbca3af0e76f3c22573076a8d8e54b52dff67/src/index.js#L182? I tried a dumb else if (geom.type == "TextGeometry") {
var loader = new THREE.FontLoader();
loader.load( 'fonts/helvetiker_bold.typeface.json', function ( font ) {
} );
let obj = loader.parse("data:text/plain," + geom.data);
let loaded_geom = obj.children[0].geometry;
loaded_geom.uuid = geom.uuid;
let json = loaded_geom.toJSON();
for (let child of obj.children) {
dispose(child);
}
return json;
} and sadly it didn't magically work... |
Huh, I think you've run into a python bug: python/cpython#5254 and https://bugs.python.org/issue32502 . It looks like we could use As for the JS code, I think we should actually try not to mimic that function: the way I handle .OBJ meshes is kind of gross (loading them, then calling |
Hi Robin, sorry for the delay in response, I'm having a few deadlines. I kind of get it now. So |
I think I've made some progress on the JS side. Created a PR meshcat-dev/meshcat#41 . Now the I know the returned object is passed to From the other end, when I trace down the error message, it seems in between the I first tried in the debug mode, manually force adding a Btw, since this is now purely about JS, would you prefer we have the discussion in the |
Hello, |
+1 Would also love a text geometry feature in MeshCat - would be great to display text alongside animations for self contained demonstrations |
+1, this would be nice. |
Separately, i'm getting a similar error when trying to add a
@shensquared, @rdeits was there a solution to the issue with the textgeometry attempt? Otherwise, any ideas on how I can get this to work? Thanks
|
Hi Robin, I'm trying to add a text geometry where I can put short description of the scene like 'new initialization', so it'd be easier for audience to interpret my animation.
I added a
TextGeometry
in thegeometry.py
file, similar to all the box/sphere. By reading this https://threejs.org/docs/#api/en/geometries/TextGeometry documentation, not much is needed other than passing in params, and I'm almost sure I've done this part correctly.But when declaring a new
TextGeomotry
, python throws error saying 'uuid' not defined. Looking into some threejs documentation, this seems to be potentially caused by missing ofThree.FontLoader()
dependency, but then I'm stuck. I have a vague sense the JS files under the viewer folder is what I should modify but I don't know exactly how?The text was updated successfully, but these errors were encountered: