ReferencePlane#
- class ReferencePlane(line_pair: list[compas.geometry.Line], projection_vector: compas.geometry.Vector)[source]#
Bases:
PlaneTilted 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
Add a
Lineto the current plane.Add a
Pointto the current plane.Get an external svg and add it to current reference plane.
Attributes
Attribute on
AxonometryconstructionClass attribute set by
Axonometry.All lines contained in the current plane.
Collection of points and lines in current plane.
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
Lineto 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:
- 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:
- ReferencePlane.draw_point(point: Point, ref_plane_keys: list[Literal['xy', 'yz', 'zx']] = ['xy', 'yz', 'zx']) Point[source]#
Add a
Pointto the current plane.Note
The
Lineobject operations are basically performed on its points, this method is extensively called indraw_line()andproject(), withLine.startandLine.endas parameters.
- 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)
Attributes#
- ReferencePlane.axo: Axonometry | None = None#
Attribute on
Axonometryconstruction
- 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.