ReferencePlane#

class ReferencePlane(line_pair: list[compas.geometry.Line], projection_vector: compas.geometry.Vector)[source]#

Bases: Plane

Tilted coordinate plane in which to draw, project into and from.

Parameters:
  • line_pair (list[compas.geometry.Line]) – The two lines making up the reference plane axes.

  • projection_vector (compas.geometry.Vector) – The projection direction towards the axonometric picture plane; reverse direction than the reference plane translation.

Methods

draw_line

Add a Line to the current plane.

draw_point

Add a Point to the current plane.

import_svg_file

Get an external svg and add it to current reference plane.

Attributes

axo

Attribute on Axonometry construction

drawing

Class attribute set by Axonometry.

lines

All lines contained in the current plane.

objects

Collection of points and lines in current plane.

points

All points contained in the current plane.

Methods#

ReferencePlane.draw_line(line: Line, layer_nr: int | None = None, ref_plane_keys: list[Literal['xy', 'yz', 'zx']] = ['xy', 'yz', 'zx']) Line[source]#

Add a Line to the current plane.

By inheritence, two main cases occur, each handled by a set of operations:

  • Adding a line into the axonometric picture plane.

  • Adding the line into one of the three reference planes.

Parameters:
  • line (Line) – The new line to be added.

  • ref_plane_keys (list[Literal['xy', 'yz', 'zx']]) – The reference planes on which to construct the auxiliary projections when adding a line on the axonometric picture plane, defaults to all three i.e. [“xy”, “yz”, “zx”].

  • layer_nr (int | None)

Returns:

The newly added line. If an identical line already exists in the planes’ objects, the existing line is returned instead of a new object.

Return type:

Line

ReferencePlane.draw_point(point: Point, ref_plane_keys: list[Literal['xy', 'yz', 'zx']] = ['xy', 'yz', 'zx']) Point[source]#

Add a Point to the current plane.

Note

The Line object operations are basically performed on its points, this method is extensively called in draw_line() and project(), with Line.start and Line.end as parameters.

Parameters:
Return type:

Point

ReferencePlane.import_svg_file(file: str, scale: float | None = None)[source]#

Get an external svg and add it to current reference plane.

An SVG is treated as a collection of lines. Read the svg. Parse the line coordinates. Add each line to the current plane.

Import the SVG and convert it to a MultiLineString.

Roughly the code should be as follow:

for line in collection:
    self.draw_line(Line(line))  # this will call the matrix
doc = self.drawing.convert_svg_vpype_doc(svg_file)
Parameters:

Attributes#

ReferencePlane.axo: Axonometry | None = None#

Attribute on Axonometry construction

ReferencePlane.drawing = None#

Class attribute set by Axonometry.

ReferencePlane.lines#

All lines contained in the current plane.

ReferencePlane.objects#

Collection of points and lines in current plane.

ReferencePlane.points#

All points contained in the current plane.