vsketch.display#

Overview#

Function#

display(document, page_size, center, show_axes, show_grid, show_pen_up, colorful, unit, fig_size)

Display a layout with vector data using the best method given the environment.

Attributes#

COLORS

-

Functions#

vsketch.display.display(document: vpype.Document, page_size: tuple[float, float] | None = None, center: bool = False, show_axes: bool = True, show_grid: bool = False, show_pen_up: bool = False, colorful: bool = False, unit: str = 'px', fig_size: tuple[float, float] | None = None) None#

Display a layout with vector data using the best method given the environment.

Supported modes:

“matplotlib”: use matplotlib to render the preview “ipython”: use SVG with zoom/pan capability (requires IPython)

Note: all options are not necessarily implemented by all display modes.

Parameters:
  • document -- the document to display

  • page_size -- size of the page in pixels

  • center -- if True, the geometries are centered on the page

  • show_axes -- if True, display axes

  • show_grid -- if True, display a grid

  • show_pen_up -- if True, display pen-up trajectories

  • colorful -- if True, use one color per path instead of per layer

  • unit -- display unit

  • fig_size -- if provided, set the matplotlib figure size

Attributes#

vsketch.display.COLORS = [(0, 0, 1), (0, 0.5, 0), (1, 0, 0), (0, 0.75, 0.75), (0, 1, 0), (0.75, 0, 0.75), (0.75, 0.75,...#