meshcat-dev / meshcat

Remotely-controllable 3D viewer, built on top of three.js
MIT License
250 stars 44 forks source link

Add back extension codes for Uint8Array and Int32Array #172

Closed jwnimmer-tri closed 7 months ago

jwnimmer-tri commented 7 months ago

These were accidentally lost in the switch to msgpack-javascript (#132).

Closes #138.

+@SeanCurtis-TRI for both reviews, please.


It's not really practical to test this with an HTML file in this repository. The problem is with the msgpack decoding, which we usually don't test here (we author JSON in tests, not msgpack).

Instead, I tested it manually with this Python program that uses meshcat-python:

import meshcat
import meshcat.geometry as g

vis = meshcat.Visualizer()
vis["path"].set_object(
    g.StlMeshGeometry.from_file("/home/jwnimmer/jwnimmer-tri/drake/geometry/test/quad_cube.stl"),
    g.MeshPhongMaterial())

import time
time.sleep(60)

With the master branch meshcat, it errors out with no cube (the browser console has an error message). With this branch, the browser shows the cube.

I didn't test the int32 decoder. (I can't find anywhere its used.) Hopefully the visual inspection and copy-paste from Uint32 is sufficient.


This change is Reviewable