Drawing#

class Drawing(page_size: Literal['A1'] | tuple[float, float] = 'A1', orientation: str = 'portrait')[source]#

Bases: object

Records all drawing and projection operations to be rendered.

A wrapper class for vpype.Document and compas.scene.Scene. Instantiated in Axonometry.drawing. Methods mostly called with the add_*() methods at the Plane level.

Attention

On user-level, geometries are added to Plane objects, ex. with Plane.draw_line(). Because the necessary updates of the plane and geometry metadata (i.e. Plane.objects, Line.projections, etc.) is handled by these upstream functions.

Methods

add

Add a Point or Line to embedded vpype.Document.

add_axonometry

Combine several instances of Axonometry.

add_compas_geometry

Add a compas Point or Line collection to embedded vpype.Document.

record_frames

Parameters:
  • page_size (Literal['A1'] | tuple[float, float])

  • orientation (str)

Methods#

Drawing.add(item: Point | Line, layer_id: int | None = None) None[source]#

Add a Point or Line to embedded vpype.Document.

Pass Point.data and Line.data to add_compas_geometry().

Parameters:
  • layer_id (int | None) – Define the layer number for the added geometry, usually handled upstream.

  • item (Point | Line)

Return type:

None

Drawing.add_axonometry(axonometry: Axonometry, position: tuple[float, float] | None = None) None[source]#

Combine several instances of Axonometry.

Caution

Not fully implemented yet.

>>> from axonometry import Axonometry, Drawing
>>> drawing = Drawing()
>>> axo1 = Axonometry(47.5, 15)
>>> axo2 = Axonometry(30, 30)
>>> drawing.add_axonometry(axo1)
>>> drawing.add_axonometry(axo2)
Parameters:
Return type:

None

Drawing.add_compas_geometry(compas_data: list[compas.geometry.Line | compas.geometry.Point | compas.geometry.Polyline], layer_id: int | None = None) None[source]#

Add a compas Point or Line collection to embedded vpype.Document.

Converts a list of compas.geometry.Point and compas.geometry.Line into a vpype.LineCollection. Then added to the vpype.Document.

Parameters:
Return type:

None

Drawing.record_frames()[source]#