Drawing#
- class Drawing(page_size: Literal['A1'] | tuple[float, float] = 'A1', orientation: str = 'portrait')[source]#
Bases:
objectRecords all drawing and projection operations to be rendered.
A wrapper class for
vpype.Documentandcompas.scene.Scene. Instantiated inAxonometry.drawing. Methods mostly called with theadd_*()methods at thePlanelevel.Attention
On user-level, geometries are added to
Planeobjects, ex. withPlane.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 a
PointorLineto embeddedvpype.Document.Combine several instances of
Axonometry.Add a compas
PointorLinecollection to embeddedvpype.Document.- 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
PointorLineto embeddedvpype.Document.Pass
Point.dataandLine.datatoadd_compas_geometry().
- 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:
axonometry (Axonometry)
- 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
PointorLinecollection to embeddedvpype.Document.Converts a list of
compas.geometry.Pointandcompas.geometry.Lineinto avpype.LineCollection. Then added to thevpype.Document.- Parameters:
compas_data (list[compas.geometry.Line | compas.geometry.Point | compas.geometry.Polyline]) – Add
compas.geometry.Pointandcompas.geometry.Lineobjects directly, or receive the attributesPoint.dataandLine.datawhen callingDrawing.add().layer_id (int | None) – Define the layer number for the added geometry, usually handled upstream.
- Return type:
None