tri3d.plot

tri3d.plot.plot_bboxes_3d(plot, transforms, sizes, c=None, *kargs, **kwargs)

Add 3D boxes to a k3d plot.

Parameters:
  • plot (Plot) – k3d plot

  • transform – N object local to scene coordinate transformations.

  • sizes (ndarray) – N by 3 array of object sizes

  • c (int | Tuple[int, ...] | None) – edge colors, either as a single or per box value.

  • transforms (List[Transformation])

tri3d.plot.gen_discrete_cmap(n)

Return a matplotlib discrete colormap for n classes.

tri3d.plot.to_k3d_colors(colors)

Convert RGB color triplets into int32 values.

tri3d.plot.plot_bbox_cam(transform, size, img_size, **kwargs)

Add a 3D box to a matplotlib plot.

Parameters:
  • transform (Transformation) – transformation from box local to image coordinates

  • size (ndarray) – object size (length, width height)

  • img_size (Tuple[int, int]) – plot size (width, height)

  • kwargs – arguments forwarded to plt.plot()

tri3d.plot.auto_range(x, percentile=0.1, nticks=7, start=None, stop=None)

Propose histogram bins (start, stop, step) which best describe data.

Parameters:
  • x – a list of scalar values

  • percentilepercentage of edge values that can be ignored, or two values to distinguish left and right margins

  • nticks – number of ticks to aim for

  • start – overrides the start value from automatic range

  • stop – overrides the stop value from automatic range