[rebased] Text rendering: python-side #111
Conversation
src/meshcat/geometry.py
Outdated
|
|
||
| class TextTexture(Texture): | ||
| def __init__(self, text, font_size=100, font_face='sans-serif', | ||
| width=200, height=100, position=[10, 10]): |
There was a problem hiding this comment.
width, height, position are not used. Should I delete them ?
|
Hi maintainers (@rdeits and @shensquared ?), a gentle reminder of this PR waiting for your feedback :) Also, while thinking about it, I was wondering how hard it would be to be able to extend this work and apply a texture only on some faces of 3D shapes (especially boxes). An illustration explaining why is below: This is a screenshot of a little project I did to visualize the position of some frames of a robot. I draw 3 cylinders for each frame pointing in the X,Y,Z directions. I wanted to add the frame name on the X cylinder (colored red). Ideally I would have liked to have this text readable on all 4 sides of the cylinder, for now I only did it on 2 opposite sides, by creating a transparent box around the red cylinder, and having the frame name painted as a
I highlighted 2 small issues with the current solution:
I feel that those 2 issues could be solved by:
Despite those slight inconvenience (for which there is maybe an already existing solution ?), I'd be very happy if we could merge this first PR into |
rdeits
left a comment
There was a problem hiding this comment.
Sorry for forgetting about this, and thanks for the contribution. If you can delete those unused attributes I'm happy to get this merged.
src/meshcat/geometry.py
Outdated
|
|
||
| class TextTexture(Texture): | ||
| def __init__(self, text, font_size=100, font_face='sans-serif', | ||
| width=200, height=100, position=[10, 10]): |
|
@rdeits I removed the attributes :) |
|
Install from source works for me: |

I do not claim any credit for this work, I merely squashed & rebased @shensquared's work in #32. The only "intelligent" change I had to do is remove a use of
unicodesince we're python3 now.I tested the relevant
demo.ipynband was able to reproduce the results. Here's the state after the final cell is run:I hope this will save you some work, and help merge this nice feature to
meshcat:)