Skip to content
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

Update meshcat to get better .DAE handling #104

Merged
merged 2 commits into from
Jul 1, 2019
Merged

Update meshcat to get better .DAE handling #104

merged 2 commits into from
Jul 1, 2019

Conversation

rdeits
Copy link
Owner

@rdeits rdeits commented May 19, 2019

@codecov-io
Copy link

codecov-io commented May 19, 2019

Codecov Report

Merging #104 into master will increase coverage by 2.04%.
The diff coverage is 95.12%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master     #104      +/-   ##
==========================================
+ Coverage    75.2%   77.25%   +2.04%     
==========================================
  Files          13       14       +1     
  Lines         363      400      +37     
==========================================
+ Hits          273      309      +36     
- Misses         90       91       +1
Impacted Files Coverage Δ
src/geometry.jl 95.65% <ø> (+2.31%) ⬆️
src/objects.jl 100% <ø> (ø) ⬆️
src/MeshCat.jl 30.43% <ø> (ø) ⬆️
src/lowering.jl 81.69% <100%> (+0.26%) ⬆️
src/mesh_files.jl 95% <95%> (ø)
src/arrow_visualizer.jl 100% <0%> (ø) ⬆️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update f40c4aa...cf3649d. Read the comment docs.

@rdeits
Copy link
Owner Author

rdeits commented Jun 17, 2019

Ok, made a bunch of progress on this today. I ended up having to introduce a new type: MeshFileObject, which is similar to MeshFileGeometry in that you can load it from a mesh file, but different in that it treats that file as representing an entire scene (an "object" in threejs speak), complete with textures, materials, and potentially multiple objects (for .dae files).

The way this works is that you can either create a MeshFileGeometry if you just want to treat the file as if it contains a single blob of geometry (for example, if you want to apply your own material), or you can create a MeshFileObject if you want to let the mesh set its own materials and so on.

For our URDF loading, I think we should always use MeshFileObject for .obj and .dae files. I've included enough logic on the Julia side to take an .obj file, parse it to figure out which .mtl file it uses, and then parse that .mtl file to figure out which image textures it needs, and then wrap up all of those and send them to javascript. I've done the same for .dae files, although at least they don't do the silly .mtl nonsense.

@rdeits
Copy link
Owner Author

rdeits commented Jun 17, 2019

On the way, I had to do some hacking at the threejs internals (it doesn't actually expose the callbacks we need), and I even learned how to write meshes with image textures by hand. Whee!

@tkoolen
Copy link
Collaborator

tkoolen commented Jun 22, 2019

This all looks great to me!

@rdeits rdeits merged commit 3b5533f into master Jul 1, 2019
@rdeits rdeits deleted the rd/meshcat-dae branch July 1, 2019 02:30
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants