vibe-sketcherDocumentation

vibesketcher.render.pages

Where a drawing falls on physical pages, and what does not fit (#163).

Page setup places the drawing; it never scales it. One bond is the style preset’s bond length in points on paper, exactly as in the cropped export. The canvas origin sits at the top-left corner of the first page’s content area (inside the margins), or the drawing’s extent is centred on the page grid. A grid of columns x rows pages tiles the drawing content area by content area, so page (row r, column c) shows the drawing region [c w, (c + 1) w] x [r h, (r + 1) h] after that offset, w x h being one content area. Pages are numbered in reading order: left to right, then top to bottom.

Object extents are those the export crops to (vibesketcher.render.scene.scene_boxes()). An object outside the grid is overflow and is reported, never shrunk; an object across an inner page edge is reported as split.

Module Attributes

PT_PER_MM

Points per millimetre (1 pt = 1/72 inch, 1 inch = 25.4 mm).

Functions

page_layout(document[, setup, style, ...])

The pages, the objects on each, and every object split across or outside them.

render_pages(document, fmt, *, pages, page, ...)

Export a captured document at paper size, clipping without scaling.

vibesketcher.render.pages.PT_PER_MM = 2.834645669291339

Points per millimetre (1 pt = 1/72 inch, 1 inch = 25.4 mm).

vibesketcher.render.pages.page_layout(document, setup=None, *, style=None, stereo_labels=False, sequences=False, math_text=False)[source]

The pages, the objects on each, and every object split across or outside them.

setup defaults to the document’s style.page; pass one to try a setup before storing it. The figure options are those of the export.

Parameters:
  • document (Document)

  • setup (PageSetup | None)

  • style (str | None)

  • stereo_labels (bool)

  • sequences (bool)

  • math_text (bool)

Return type:

dict[str, Any]

vibesketcher.render.pages.render_pages(document, fmt, *, pages, page, style, dpi, stereo_labels, sequences, math_text)[source]

Export a captured document at paper size, clipping without scaling.

Called with a deep snapshot by render. Render the scene once, then translate that same scene onto each page, including empty pages.

Parameters:
Return type:

bytes