meshcat-dev / meshcat-python

WebGL-based 3D visualizer for Python
MIT License
259 stars 63 forks source link

Added basic support of Line, LineSegment and LineLoop #43

Closed danieljfarrell closed 5 years ago

danieljfarrell commented 5 years ago

The changes were trivial in the end. I just added the following,

class Line(Object):
    _type = u"Line"

class LineSegments(Object):
    _type = u"LineSegments"

class LineLoop(Object):
    _type = u"LineLoop"

Rendering with LineSegment, Line and LineLoop

I spend most of the time testing the different rending options (Line, LineSegement and LineLoop) in the included lines.ipynb. In this notebook I also played around a little with using materials to give the lines different colours. It seems they can be rendered using standard mesh materials.

Rending lines with different materials

I also thought about adding https://threejs.org/docs/#api/en/materials/LineBasicMaterial and https://threejs.org/docs/#api/en/materials/LineDashMaterial but decided against it so as to keep this pull request simple.

codecov-io commented 5 years ago

Codecov Report

Merging #43 into master will decrease coverage by 13.22%. The diff coverage is 94.23%.

Impacted file tree graph

@@             Coverage Diff             @@
##           master      #43       +/-   ##
===========================================
- Coverage   87.35%   74.13%   -13.23%     
===========================================
  Files           8        8               
  Lines         609      661       +52     
===========================================
- Hits          532      490       -42     
- Misses         77      171       +94
Impacted Files Coverage Δ
src/meshcat/geometry.py 62.23% <92.3%> (-24.73%) :arrow_down:
src/meshcat/tests/test_drawing.py 71.31% <96.15%> (-24.8%) :arrow_down:

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 d26423c...22f108d. Read the comment docs.