ictdesigntools.draw.drawing¶
A drawing: its frame, shapes, layers and named styles, and the walk every output shares.
Layer
dataclass
¶
A CAD layer: an AutoCAD colour index and an optional linetype.
Drawing
dataclass
¶
Drawing(
view: tuple[float, float, float, float] = (
0.0,
0.0,
100.0,
100.0,
),
items: list = list(),
title: str = "",
desc: str = "",
units: str = "mm",
stroke: float = 0.35,
font: float = 2.5,
layers: dict[str, Layer] = dict(),
styles: dict[str, Style] = dict(),
)
A drawing in units ("mm", the default, or "in"), framed by view
(x, y, width, height; fit() sets it from the content).
style ¶
The look of a shape: its own values, then its named style (from theme first,
then the drawing's), then the defaults.
Source code in src/ictdesigntools/draw/drawing.py
components ¶
Every component placed, inner ones first, each once.
Source code in src/ictdesigntools/draw/drawing.py
walk ¶
Every shape with its transform to the drawing and its layer, components expanded.
bounds ¶
The content's extent (x0, y0, x1, y1), or None when empty.
Source code in src/ictdesigntools/draw/drawing.py
fit ¶
Frame the content with margin around it.
Source code in src/ictdesigntools/draw/drawing.py
hex6 ¶
A CSS hex colour as #rrggbb (#abc is expanded), for outputs that need six digits.
arrowheads ¶
Filled triangles at a line's ends, size long.
Source code in src/ictdesigntools/draw/drawing.py
earth_strokes ¶
The EARTH pattern as line segments, clipped to the area and around the holes.
Source code in src/ictdesigntools/draw/drawing.py
earth_pieces ¶
The earth rectangle cut into rectangles that leave out its holes (bands above and below each hole, and pieces either side of it).
Source code in src/ictdesigntools/draw/drawing.py
dim_geometry ¶
Dimension line, extension lines, tick marks and text position (x, y, rotation).
Source code in src/ictdesigntools/draw/drawing.py
rect_points ¶
The outline of a rectangle, its corners rounded to rx with steps per corner.
Source code in src/ictdesigntools/draw/drawing.py
outline ¶
Points that bound a shape in its own coordinates (circles as their bounding square).