add interfacing to javascript side 2d text rendering#32
add interfacing to javascript side 2d text rendering#32shensquared wants to merge 15 commits intomeshcat-dev:masterfrom
Conversation
add text geometry (and PEP8 autofomat) add set_text() method and supporting logics split the texture from the rest of the object_json streamline material initialization demo WIP WIP add transparency parameter to differentiate scene and object texts fix transparent args and disentangle font size with face (for resizing) remove alphas finalizing
Codecov Report
@@ Coverage Diff @@
## master #32 +/- ##
==========================================
- Coverage 87.47% 85.96% -1.52%
==========================================
Files 8 8
Lines 615 634 +19
==========================================
+ Hits 538 545 +7
- Misses 77 89 +12
Continue to review full report at Codecov.
|
src/meshcat/commands.py
Outdated
| else: | ||
| if texts is not None: | ||
| material.map = TextTexture(texts) | ||
| material.needsUpdate = True |
There was a problem hiding this comment.
Do we still need this code?
There was a problem hiding this comment.
Right, they only serve to simplify the call a little, but it's not too verbose otherwise either. Removed them.
src/meshcat/geometry.py
Outdated
|
|
||
|
|
||
| def SceneText(text, **kwargs): | ||
| if 'width' in kwargs and 'height' in kwargs: |
There was a problem hiding this comment.
I don't think this is quite right. If the user only provides width or height then that argument will be ignored. Can't we just do:
def SceneText(text, width=10, height=10, **kwargs):
...?
There was a problem hiding this comment.
Yep, agreed. Changed it.
src/meshcat/visualizer.py
Outdated
|
|
||
| def set_object(self, geometry, material=None): | ||
| return self.window.send(SetObject(geometry, material, self.path)) | ||
| def set_object(self, geometry, material=None, texts=None): |
There was a problem hiding this comment.
Can we get rid of the texts argument here as well?
|
Hey @shensquared, @rdeits ! When looking for ways to display text in meshcat via python I got to this MR, that is still open. I'd be glad to help get this merge if I can ! Do you need anything ? |
|
This MR was re-ported and merged in #111 so it should probably be closed |
accompanying the javascript side PR meshcat-dev/meshcat#43
still some clean up needed