Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
white.
Returns
-------
identifier : str
The string identifier used to add the line to the scene.
"""
vis = self.vis
line = (start, end)
self._will_add_expendable_to_scene(line)
vertices = np.column_stack(line)
assert vertices.shape[0] == 3 # easy to get this wrong
identifier = self.get_next_identifer()
vis[identifier].set_object(
g.Line(
g.PointsGeometry(vertices),
g.MeshBasicMaterial(color=colour, transparency=False, opacity=1),
)
)
self._did_add_expendable_to_scene(identifier)
return identifier
import time
import numpy as np
import meshcat
import meshcat.geometry as g
verts = np.random.random((3, 100000)).astype(np.float32)
vis = meshcat.Visualizer().open()
vis.set_object(g.Points(
g.PointsGeometry(verts, color=verts),
g.PointsMaterial()
))
vis.close()
add_ray_path : Draws the line using individual line segments. Use this
method when each line segment needs to be drawn with a different colour.
Returns
-------
identifier : str
The string identifier used to add the line to the scene.
"""
vis = self.vis
self._will_add_expendable_to_scene(vertices)
vertices = np.array(vertices)
assert vertices.shape[0] == 3 # easy to get this wrong
identifier = self.get_next_identifer()
vis[identifier].set_object(
g.Line(
g.PointsGeometry(vertices),
g.MeshBasicMaterial(color=colour, transparency=False, opacity=1.0),
)
)
self._did_add_expendable_to_scene(identifier)
return identifier