svgen.shapes package#
Submodules#
svgen.shapes.chip module#
A module for adding circuit chips to SVG documents.
- svgen.shapes.chip.add_chip(box: Rectangle, body_color: str = 'black', pin_color: str = 'gray', circle_color: str = None, pin_count: int = 3, debug: bool = False) tuple[list[Element], Rect] [source]#
Add a circuit chip to the document based on the provided rectangle and other configurations.
- svgen.shapes.chip.add_outline_chip(box: Rectangle, pin_color: str = 'gray', circle_color: str = None, pin_count: int = 3, debug: bool = False, stroke_width: int | float = 3.0) tuple[list[Element], Rect] [source]#
Add a circuit chip to the document based on the provided rectangle and other configurations (outline variant).
svgen.shapes.pins module#
A module for adding pin elements to circuit chips.
- svgen.shapes.pins.add_pins(rect: Rect, count: int, color: str) list[Element] [source]#
Add some number of pins to a rectangle.
- svgen.shapes.pins.corners_translated(rect: Rect, width: float, height: float) Iterator[tuple[RectangleCorner, Point]] [source]#
Iterate over corners and translate the origin point.
- svgen.shapes.pins.translate_maps(width: float, height: float) tuple[dict[RectangleCorner, float | int], dict[RectangleCorner, float | int]] [source]#
Get translation mappings for x/y based on rectangle corner.