original_docstring: Draws a laser wireframe onto the plotly Figure.
docstring: Draws a laser wireframe onto the plotly Figure.
docstring_tokens: Draws a laser wireframe onto the plotly Figure .
code: def draw_laser_wireframe(fig: go.Figure, wireframe: Wireframe) -> None:
    """Draws a laser wireframe onto the plotly Figure."""
    for line in wireframe.lines:
      points = np.stack([line.start, line.end], axis=0)
      fig.add_trace(
          go.Scatter3d(
              mode='lines',
              x=points[:, 0],
              y=points[:, 1],
              z=points[:, 2],
              line=dict(color=line.color, width=line.width)))
    dot_coords = np.stack([d.location for d in wireframe.dots], axis=0)
    fig.add_trace(
        go.Scatter3d(
            text=[d.name for d in wireframe.dots],
            mode='markers',
            x=dot_coords[:, 0],
            y=dot_coords[:, 1],
            z=dot_coords[:, 2],
            marker=dict(
                color=[d.color for d in wireframe.dots],
                size=[d.size for d in wireframe.dots],
                line=dict(
                    width=OCCLUDED_BORDER_WIDTH,
                    color=[d.actual_border_color for d in wireframe.dots]))))
code_tokens: def draw_laser_wireframe ( fig : go . Figure , wireframe : Wireframe ) -> None : for line in wireframe . lines : points = np . stack ( [ line . start , line . end ] , axis = 0 ) fig . add_trace ( go . Scatter3d ( mode = 'lines' , x = points [ : , 0 ] , y = points [ : , 1 ] , z = points [ : , 2 ] , line = dict ( color = line . color , width = line . width ) ) ) dot_coords = np . stack ( [ d . location for d in wireframe . dots ] , axis = 0 ) fig . add_trace ( go . Scatter3d ( text = [ d . name for d in wireframe . dots ] , mode = 'markers' , x = dot_coords [ : , 0 ] , y = dot_coords [ : , 1 ] , z = dot_coords [ : , 2 ] , marker = dict ( color = [ d . color for d in wireframe . dots ] , size = [ d . size for d in wireframe . dots ] , line = dict ( width = OCCLUDED_BORDER_WIDTH , color = [ d . actual_border_color for d in wireframe . dots ] ) ) ) )
short_docstring: Draws a laser wireframe onto the plotly Figure.
short_docstring_tokens: Draws a laser wireframe onto the plotly Figure .
comment: """Draws a laser wireframe onto the plotly Figure."""