How to use the meshcat.geometry.PointsGeometry function in meshcat

To help you get started, we’ve selected a few meshcat examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github danieljfarrell / pvtrace / pvtrace / scene / renderer.py View on Github external
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
github rdeits / meshcat-python / src / meshcat / examples / points.py View on Github external
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()
github danieljfarrell / pvtrace / pvtrace / scene / renderer.py View on Github external
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