Axonometry#
- class Axonometry(*angles: float, ref_planes_distance: float = 100.0, trihedron_size: float = 100.0, trihedron_position: tuple[float, float] = (0, 0), page_size: Literal['A1'] | tuple[float, float] = 'A1', orientation: str = 'portrait')[source]#
Bases:
PlaneAxonometry by intersection setup.
This class helps to set up the axonometry. From there one can start to use its method to add geometries (mostly
Line).To set up the necessary projection planes, the class first instatiates a
Trihedronobject which calculates the tilt to produce the threeReferencePlaneobjects. These, and theAxonometrycan then be used to draw, i.e.draw_line().As an attribute, this class instantiates a
Drawingobject which collects, or so to say records, all the drawing and projection operations (draw_line(),project()).Note
When adding objects, and they have only two of the x y z, it means they are projecitons in a reference plane.
- Parameters:
angles (float) – Architectural notation axonometry angle pair.
trihedron_position (tuple[float, float]) – Position of trihedron on the paper.
ref_planes_distance (float) – Reference plane transolation distance.
trihedron_size (float) – Coordinate axes size.
page_size (Literal['A1'] | tuple[float, float])
orientation (str)
Methods
Add a
Lineto the current plane.Add a
Pointto the current plane.Add a COMPAS Mesh object's lines to the axonometry.
Generate valid axonometric angles and initialize the Axonometry object.
Toggle recording of frames at each modification of geometry.
Save drawing to PNG file.
Save drawing to file SVG.
Show the drawing paths with the vpype viewer.
Not Implemented.
Attributes
Class 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.
X coordinate vector.
Get the Axonometry's XY
ReferencePlaneobject.Y coordinate vector.
Get the Axonometry's YZ
ReferencePlaneobject.Z coordinate vector.
Get the Axonometry's ZX
ReferencePlaneobject.
Methods#
- Axonometry.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:
- Axonometry.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.
- Axonometry.import_mesh(mesh_object: Mesh, ref_plane_keys: list[Literal['xy', 'yz', 'zx']] = ['xy', 'yz', 'zx'], layer_nr: int | None = None) None[source]#
Add a COMPAS Mesh object’s lines to the axonometry.
The only data extracted from the OBJ file are lines. The resulting drawing will be a wireframe. Lines are drawn with the regular
Plane.draw_line()method. When calling the method, auxilary projection planes are chosen based on threshold paramters which are evaluating the lines positions in space.- Parameters:
- Return type:
None
auxiliary projections when adding a line on the axonometric picture plane, defaults to all three i.e. [“xy”, “yz”, “zx”]. :returns: None.
- static Axonometry.random_angles(trihedron_position: tuple[float, float] = (0, 0), ref_planes_distance: float = 100.0, trihedron_size: float = 100.0, page_size: Literal['A1'] | tuple[float, float] = 'A1', orientation: str = 'portrait') Axonometry[source]#
Generate valid axonometric angles and initialize the Axonometry object.
- Axonometry.record_frames() None[source]#
Toggle recording of frames at each modification of geometry.
- Return type:
None
- Axonometry.save_png(filename: str, directory: str = './output/') str[source]#
Save drawing to PNG file.
This function first makes an SVG file (cropped) with
save_svg(). Then converts it withcairosvg.svg2png().
- Axonometry.save_svg(filename: str, directory: str = './output/', *, crop: bool = False, center: bool = False) str[source]#
Save drawing to file SVG.
Attributes#
- Axonometry.drawing = None#
Class attribute set by
Axonometry.
- Axonometry.lines#
All lines contained in the current plane.
- Axonometry.objects#
Collection of points and lines in current plane.
- Axonometry.points#
All points contained in the current plane.
- Axonometry.x#
X coordinate vector.
- Axonometry.xy#
Get the Axonometry’s XY
ReferencePlaneobject.
- Axonometry.y#
Y coordinate vector.
- Axonometry.yz#
Get the Axonometry’s YZ
ReferencePlaneobject.
- Axonometry.z#
Z coordinate vector.
- Axonometry.zx#
Get the Axonometry’s ZX
ReferencePlaneobject.