kigadgets.drawing¶
Drawing shape handling module for KiCad PCB objects.
This module provides pythonic wrappers for KiCad’s native drawing shapes. Each shape class (Segment, Circle, Arc, Rectangle, Polygon) - inherits from Drawing base class - wraps a pcbnew.Shape native object
There are two ways to instantiate a Drawing: - Pre-existing SWIG objects are wrapped using a factory pattern for type detection - New Drawings can be instantiated directly using __init__ methods
All objects support geohashing for geometric comparison and testing capabilities.
Attributes¶
Classes¶
Base class of shape drawings, not including text |
|
Base class of shape drawings, not including text |
|
Base class of shape drawings, not including text |
|
Base class of shape drawings, not including text |
|
Base class of shape drawings, not including text |
|
Base class of shape drawings, not including text |
|
Inherits x,y get/set from HasPosition |
|
Mixin for layer handling based on strings (like 'F.Cu', 'B.Silkscreen', 'User.12', etc.). |
Functions¶
|
Handles anything found in BOARD.GetDrawings |
Module Contents¶
- kigadgets.drawing.wrap_drawing(instance: Any) Segment | Circle | Arc | Rectangle | Polygon | TextPCB¶
Handles anything found in BOARD.GetDrawings Feeds through to shape wrap methods based on the type of shape.
It also detects and feeds through text, which are handled separately from geometric shapes.
- class kigadgets.drawing.Drawing¶
Bases:
digraph inheritanceeaf772aa20 { bgcolor=transparent; rankdir=LR; size="8.0, 12.0"; "BoardItem" [URL="../item/index.html#kigadgets.item.BoardItem",fillcolor=white,fontname="Vera Sans, DejaVu Sans, Liberation Sans, Arial, Helvetica, sans",fontsize=10,height=0.25,shape=box,style="setlinewidth(0.5),filled",target="_top",tooltip="Base class for all PCB board items."]; "GeoHashable" -> "BoardItem" [arrowsize=0.5,style="setlinewidth(0.5)"]; "Drawing" [URL="#kigadgets.drawing.Drawing",fillcolor=white,fontname="Vera Sans, DejaVu Sans, Liberation Sans, Arial, Helvetica, sans",fontsize=10,height=0.25,shape=box,style="setlinewidth(0.5),filled",target="_top",tooltip="Base class of shape drawings, not including text"]; "HasLayer" -> "Drawing" [arrowsize=0.5,style="setlinewidth(0.5)"]; "HasPosition" -> "Drawing" [arrowsize=0.5,style="setlinewidth(0.5)"]; "HasWidth" -> "Drawing" [arrowsize=0.5,style="setlinewidth(0.5)"]; "Selectable" -> "Drawing" [arrowsize=0.5,style="setlinewidth(0.5)"]; "BoardItem" -> "Drawing" [arrowsize=0.5,style="setlinewidth(0.5)"]; "GeoHashable" [URL="../item/index.html#kigadgets.item.GeoHashable",fillcolor=white,fontname="Vera Sans, DejaVu Sans, Liberation Sans, Arial, Helvetica, sans",fontsize=10,height=0.25,shape=box,style="setlinewidth(0.5),filled",target="_top",tooltip="Base class for objects that can be geometrically hashed."]; "HasLayer" [URL="../item/index.html#kigadgets.item.HasLayer",fillcolor=white,fontname="Vera Sans, DejaVu Sans, Liberation Sans, Arial, Helvetica, sans",fontsize=10,height=0.25,shape=box,style="setlinewidth(0.5),filled",target="_top",tooltip="Mixin for layer handling based on *strings* (like `'F.Cu'`, `'B.Silkscreen'`, `'User.12'`, etc.)."]; "GeoHashable" -> "HasLayer" [arrowsize=0.5,style="setlinewidth(0.5)"]; "HasPosition" [URL="../item/index.html#kigadgets.item.HasPosition",fillcolor=white,fontname="Vera Sans, DejaVu Sans, Liberation Sans, Arial, Helvetica, sans",fontsize=10,height=0.25,shape=box,style="setlinewidth(0.5),filled",target="_top",tooltip="Mixin for board items with position properties."]; "GeoHashable" -> "HasPosition" [arrowsize=0.5,style="setlinewidth(0.5)"]; "HasWidth" [URL="../item/index.html#kigadgets.item.HasWidth",fillcolor=white,fontname="Vera Sans, DejaVu Sans, Liberation Sans, Arial, Helvetica, sans",fontsize=10,height=0.25,shape=box,style="setlinewidth(0.5),filled",target="_top",tooltip="Mixin for board items with width properties."]; "GeoHashable" -> "HasWidth" [arrowsize=0.5,style="setlinewidth(0.5)"]; "Selectable" [URL="../item/index.html#kigadgets.item.Selectable",fillcolor=white,fontname="Vera Sans, DejaVu Sans, Liberation Sans, Arial, Helvetica, sans",fontsize=10,height=0.25,shape=box,style="setlinewidth(0.5),filled",target="_top",tooltip="Mixin for board items that can be selected in the GUI."]; "GeoHashable" -> "Selectable" [arrowsize=0.5,style="setlinewidth(0.5)"]; }kigadgets.item.HasLayer,kigadgets.item.HasPosition,kigadgets.item.HasWidth,kigadgets.item.Selectable,kigadgets.item.BoardItemBase class of shape drawings, not including text
- property layer: str¶
- geohash() int¶
- property position: kigadgets.Point¶
- property x: float¶
- property y: float¶
- property width: float¶
- property is_selected: bool¶
- select(value: bool = True) None¶
Selecting changes the appearance and also plays a role in determining what will be the subject of a subsequent command (delete, move to layer, etc.)
- deselect() None¶
- brighten(value: bool = True) None¶
Brightening gives a bright green appearance
- property native_obj: Any¶
- property board: kigadgets.board.Board | None¶
- class kigadgets.drawing.Segment(start: kigadgets.units.CoordinateLike, end: kigadgets.units.CoordinateLike, layer: str = 'F.SilkS', width: float = 0.15, board: Board | None = None)¶
Bases:
digraph inheritancec59cacdf2b { bgcolor=transparent; rankdir=LR; size="8.0, 12.0"; "BoardItem" [URL="../item/index.html#kigadgets.item.BoardItem",fillcolor=white,fontname="Vera Sans, DejaVu Sans, Liberation Sans, Arial, Helvetica, sans",fontsize=10,height=0.25,shape=box,style="setlinewidth(0.5),filled",target="_top",tooltip="Base class for all PCB board items."]; "GeoHashable" -> "BoardItem" [arrowsize=0.5,style="setlinewidth(0.5)"]; "Drawing" [URL="#kigadgets.drawing.Drawing",fillcolor=white,fontname="Vera Sans, DejaVu Sans, Liberation Sans, Arial, Helvetica, sans",fontsize=10,height=0.25,shape=box,style="setlinewidth(0.5),filled",target="_top",tooltip="Base class of shape drawings, not including text"]; "HasLayer" -> "Drawing" [arrowsize=0.5,style="setlinewidth(0.5)"]; "HasPosition" -> "Drawing" [arrowsize=0.5,style="setlinewidth(0.5)"]; "HasWidth" -> "Drawing" [arrowsize=0.5,style="setlinewidth(0.5)"]; "Selectable" -> "Drawing" [arrowsize=0.5,style="setlinewidth(0.5)"]; "BoardItem" -> "Drawing" [arrowsize=0.5,style="setlinewidth(0.5)"]; "GeoHashable" [URL="../item/index.html#kigadgets.item.GeoHashable",fillcolor=white,fontname="Vera Sans, DejaVu Sans, Liberation Sans, Arial, Helvetica, sans",fontsize=10,height=0.25,shape=box,style="setlinewidth(0.5),filled",target="_top",tooltip="Base class for objects that can be geometrically hashed."]; "HasLayer" [URL="../item/index.html#kigadgets.item.HasLayer",fillcolor=white,fontname="Vera Sans, DejaVu Sans, Liberation Sans, Arial, Helvetica, sans",fontsize=10,height=0.25,shape=box,style="setlinewidth(0.5),filled",target="_top",tooltip="Mixin for layer handling based on *strings* (like `'F.Cu'`, `'B.Silkscreen'`, `'User.12'`, etc.)."]; "GeoHashable" -> "HasLayer" [arrowsize=0.5,style="setlinewidth(0.5)"]; "HasPosition" [URL="../item/index.html#kigadgets.item.HasPosition",fillcolor=white,fontname="Vera Sans, DejaVu Sans, Liberation Sans, Arial, Helvetica, sans",fontsize=10,height=0.25,shape=box,style="setlinewidth(0.5),filled",target="_top",tooltip="Mixin for board items with position properties."]; "GeoHashable" -> "HasPosition" [arrowsize=0.5,style="setlinewidth(0.5)"]; "HasWidth" [URL="../item/index.html#kigadgets.item.HasWidth",fillcolor=white,fontname="Vera Sans, DejaVu Sans, Liberation Sans, Arial, Helvetica, sans",fontsize=10,height=0.25,shape=box,style="setlinewidth(0.5),filled",target="_top",tooltip="Mixin for board items with width properties."]; "GeoHashable" -> "HasWidth" [arrowsize=0.5,style="setlinewidth(0.5)"]; "Segment" [URL="#kigadgets.drawing.Segment",fillcolor=white,fontname="Vera Sans, DejaVu Sans, Liberation Sans, Arial, Helvetica, sans",fontsize=10,height=0.25,shape=box,style="setlinewidth(0.5),filled",target="_top"]; "Drawing" -> "Segment" [arrowsize=0.5,style="setlinewidth(0.5)"]; "Selectable" [URL="../item/index.html#kigadgets.item.Selectable",fillcolor=white,fontname="Vera Sans, DejaVu Sans, Liberation Sans, Arial, Helvetica, sans",fontsize=10,height=0.25,shape=box,style="setlinewidth(0.5),filled",target="_top",tooltip="Mixin for board items that can be selected in the GUI."]; "GeoHashable" -> "Selectable" [arrowsize=0.5,style="setlinewidth(0.5)"]; }DrawingBase class of shape drawings, not including text
- property start: kigadgets.Point¶
- property end: kigadgets.Point¶
- layer = 'F.SilkS'¶
- width = 0.15¶
- geohash() int¶
- property position: kigadgets.Point¶
- property x: float¶
- property y: float¶
- property is_selected: bool¶
- select(value: bool = True) None¶
Selecting changes the appearance and also plays a role in determining what will be the subject of a subsequent command (delete, move to layer, etc.)
- deselect() None¶
- brighten(value: bool = True) None¶
Brightening gives a bright green appearance
- property native_obj: Any¶
- property board: kigadgets.board.Board | None¶
- class kigadgets.drawing.Circle(center: kigadgets.units.CoordinateLike, radius: float, layer: str = 'F.SilkS', width: float = 0.15, board: Board | None = None)¶
Bases:
digraph inheritancef4cf6285ff { bgcolor=transparent; rankdir=LR; size="8.0, 12.0"; "BoardItem" [URL="../item/index.html#kigadgets.item.BoardItem",fillcolor=white,fontname="Vera Sans, DejaVu Sans, Liberation Sans, Arial, Helvetica, sans",fontsize=10,height=0.25,shape=box,style="setlinewidth(0.5),filled",target="_top",tooltip="Base class for all PCB board items."]; "GeoHashable" -> "BoardItem" [arrowsize=0.5,style="setlinewidth(0.5)"]; "Circle" [URL="#kigadgets.drawing.Circle",fillcolor=white,fontname="Vera Sans, DejaVu Sans, Liberation Sans, Arial, Helvetica, sans",fontsize=10,height=0.25,shape=box,style="setlinewidth(0.5),filled",target="_top"]; "Drawing" -> "Circle" [arrowsize=0.5,style="setlinewidth(0.5)"]; "Drawing" [URL="#kigadgets.drawing.Drawing",fillcolor=white,fontname="Vera Sans, DejaVu Sans, Liberation Sans, Arial, Helvetica, sans",fontsize=10,height=0.25,shape=box,style="setlinewidth(0.5),filled",target="_top",tooltip="Base class of shape drawings, not including text"]; "HasLayer" -> "Drawing" [arrowsize=0.5,style="setlinewidth(0.5)"]; "HasPosition" -> "Drawing" [arrowsize=0.5,style="setlinewidth(0.5)"]; "HasWidth" -> "Drawing" [arrowsize=0.5,style="setlinewidth(0.5)"]; "Selectable" -> "Drawing" [arrowsize=0.5,style="setlinewidth(0.5)"]; "BoardItem" -> "Drawing" [arrowsize=0.5,style="setlinewidth(0.5)"]; "GeoHashable" [URL="../item/index.html#kigadgets.item.GeoHashable",fillcolor=white,fontname="Vera Sans, DejaVu Sans, Liberation Sans, Arial, Helvetica, sans",fontsize=10,height=0.25,shape=box,style="setlinewidth(0.5),filled",target="_top",tooltip="Base class for objects that can be geometrically hashed."]; "HasLayer" [URL="../item/index.html#kigadgets.item.HasLayer",fillcolor=white,fontname="Vera Sans, DejaVu Sans, Liberation Sans, Arial, Helvetica, sans",fontsize=10,height=0.25,shape=box,style="setlinewidth(0.5),filled",target="_top",tooltip="Mixin for layer handling based on *strings* (like `'F.Cu'`, `'B.Silkscreen'`, `'User.12'`, etc.)."]; "GeoHashable" -> "HasLayer" [arrowsize=0.5,style="setlinewidth(0.5)"]; "HasPosition" [URL="../item/index.html#kigadgets.item.HasPosition",fillcolor=white,fontname="Vera Sans, DejaVu Sans, Liberation Sans, Arial, Helvetica, sans",fontsize=10,height=0.25,shape=box,style="setlinewidth(0.5),filled",target="_top",tooltip="Mixin for board items with position properties."]; "GeoHashable" -> "HasPosition" [arrowsize=0.5,style="setlinewidth(0.5)"]; "HasWidth" [URL="../item/index.html#kigadgets.item.HasWidth",fillcolor=white,fontname="Vera Sans, DejaVu Sans, Liberation Sans, Arial, Helvetica, sans",fontsize=10,height=0.25,shape=box,style="setlinewidth(0.5),filled",target="_top",tooltip="Mixin for board items with width properties."]; "GeoHashable" -> "HasWidth" [arrowsize=0.5,style="setlinewidth(0.5)"]; "Selectable" [URL="../item/index.html#kigadgets.item.Selectable",fillcolor=white,fontname="Vera Sans, DejaVu Sans, Liberation Sans, Arial, Helvetica, sans",fontsize=10,height=0.25,shape=box,style="setlinewidth(0.5),filled",target="_top",tooltip="Mixin for board items that can be selected in the GUI."]; "GeoHashable" -> "Selectable" [arrowsize=0.5,style="setlinewidth(0.5)"]; }DrawingBase class of shape drawings, not including text
- property center: kigadgets.Point¶
- width = 0.15¶
- layer = 'F.SilkS'¶
- property start: kigadgets.Point¶
- property radius: float¶
- geohash() int¶
- property position: kigadgets.Point¶
- property x: float¶
- property y: float¶
- property is_selected: bool¶
- select(value: bool = True) None¶
Selecting changes the appearance and also plays a role in determining what will be the subject of a subsequent command (delete, move to layer, etc.)
- deselect() None¶
- brighten(value: bool = True) None¶
Brightening gives a bright green appearance
- property native_obj: Any¶
- property board: kigadgets.board.Board | None¶
- class kigadgets.drawing.Arc_v5(center: kigadgets.units.CoordinateLike, radius: float, start_angle: float, stop_angle: float, layer: str = 'F.SilkS', width: float = 0.15, board: Board | None = None)¶
Bases:
digraph inheritance8d6615897a { bgcolor=transparent; rankdir=LR; size="8.0, 12.0"; "Arc_v5" [URL="#kigadgets.drawing.Arc_v5",fillcolor=white,fontname="Vera Sans, DejaVu Sans, Liberation Sans, Arial, Helvetica, sans",fontsize=10,height=0.25,shape=box,style="setlinewidth(0.5),filled",target="_top"]; "Drawing" -> "Arc_v5" [arrowsize=0.5,style="setlinewidth(0.5)"]; "BoardItem" [URL="../item/index.html#kigadgets.item.BoardItem",fillcolor=white,fontname="Vera Sans, DejaVu Sans, Liberation Sans, Arial, Helvetica, sans",fontsize=10,height=0.25,shape=box,style="setlinewidth(0.5),filled",target="_top",tooltip="Base class for all PCB board items."]; "GeoHashable" -> "BoardItem" [arrowsize=0.5,style="setlinewidth(0.5)"]; "Drawing" [URL="#kigadgets.drawing.Drawing",fillcolor=white,fontname="Vera Sans, DejaVu Sans, Liberation Sans, Arial, Helvetica, sans",fontsize=10,height=0.25,shape=box,style="setlinewidth(0.5),filled",target="_top",tooltip="Base class of shape drawings, not including text"]; "HasLayer" -> "Drawing" [arrowsize=0.5,style="setlinewidth(0.5)"]; "HasPosition" -> "Drawing" [arrowsize=0.5,style="setlinewidth(0.5)"]; "HasWidth" -> "Drawing" [arrowsize=0.5,style="setlinewidth(0.5)"]; "Selectable" -> "Drawing" [arrowsize=0.5,style="setlinewidth(0.5)"]; "BoardItem" -> "Drawing" [arrowsize=0.5,style="setlinewidth(0.5)"]; "GeoHashable" [URL="../item/index.html#kigadgets.item.GeoHashable",fillcolor=white,fontname="Vera Sans, DejaVu Sans, Liberation Sans, Arial, Helvetica, sans",fontsize=10,height=0.25,shape=box,style="setlinewidth(0.5),filled",target="_top",tooltip="Base class for objects that can be geometrically hashed."]; "HasLayer" [URL="../item/index.html#kigadgets.item.HasLayer",fillcolor=white,fontname="Vera Sans, DejaVu Sans, Liberation Sans, Arial, Helvetica, sans",fontsize=10,height=0.25,shape=box,style="setlinewidth(0.5),filled",target="_top",tooltip="Mixin for layer handling based on *strings* (like `'F.Cu'`, `'B.Silkscreen'`, `'User.12'`, etc.)."]; "GeoHashable" -> "HasLayer" [arrowsize=0.5,style="setlinewidth(0.5)"]; "HasPosition" [URL="../item/index.html#kigadgets.item.HasPosition",fillcolor=white,fontname="Vera Sans, DejaVu Sans, Liberation Sans, Arial, Helvetica, sans",fontsize=10,height=0.25,shape=box,style="setlinewidth(0.5),filled",target="_top",tooltip="Mixin for board items with position properties."]; "GeoHashable" -> "HasPosition" [arrowsize=0.5,style="setlinewidth(0.5)"]; "HasWidth" [URL="../item/index.html#kigadgets.item.HasWidth",fillcolor=white,fontname="Vera Sans, DejaVu Sans, Liberation Sans, Arial, Helvetica, sans",fontsize=10,height=0.25,shape=box,style="setlinewidth(0.5),filled",target="_top",tooltip="Mixin for board items with width properties."]; "GeoHashable" -> "HasWidth" [arrowsize=0.5,style="setlinewidth(0.5)"]; "Selectable" [URL="../item/index.html#kigadgets.item.Selectable",fillcolor=white,fontname="Vera Sans, DejaVu Sans, Liberation Sans, Arial, Helvetica, sans",fontsize=10,height=0.25,shape=box,style="setlinewidth(0.5),filled",target="_top",tooltip="Mixin for board items that can be selected in the GUI."]; "GeoHashable" -> "Selectable" [arrowsize=0.5,style="setlinewidth(0.5)"]; }DrawingBase class of shape drawings, not including text
- property center: kigadgets.Point¶
- property radius: float¶
- property start: kigadgets.Point¶
- property end: kigadgets.Point¶
- property angle: float¶
- geohash() int¶
- property layer: str¶
- property position: kigadgets.Point¶
- property x: float¶
- property y: float¶
- property width: float¶
- property is_selected: bool¶
- select(value: bool = True) None¶
Selecting changes the appearance and also plays a role in determining what will be the subject of a subsequent command (delete, move to layer, etc.)
- deselect() None¶
- brighten(value: bool = True) None¶
Brightening gives a bright green appearance
- property native_obj: Any¶
- property board: kigadgets.board.Board | None¶
- class kigadgets.drawing.Arc_v6(center: kigadgets.units.CoordinateLike, radius: float, start_angle: float, stop_angle: float, layer: str = 'F.SilkS', width: float = 0.15, board: Board | None = None)¶
Bases:
digraph inheritance6a6b952213 { bgcolor=transparent; rankdir=LR; size="8.0, 12.0"; "Arc_v6" [URL="#kigadgets.drawing.Arc_v6",fillcolor=white,fontname="Vera Sans, DejaVu Sans, Liberation Sans, Arial, Helvetica, sans",fontsize=10,height=0.25,shape=box,style="setlinewidth(0.5),filled",target="_top"]; "Drawing" -> "Arc_v6" [arrowsize=0.5,style="setlinewidth(0.5)"]; "BoardItem" [URL="../item/index.html#kigadgets.item.BoardItem",fillcolor=white,fontname="Vera Sans, DejaVu Sans, Liberation Sans, Arial, Helvetica, sans",fontsize=10,height=0.25,shape=box,style="setlinewidth(0.5),filled",target="_top",tooltip="Base class for all PCB board items."]; "GeoHashable" -> "BoardItem" [arrowsize=0.5,style="setlinewidth(0.5)"]; "Drawing" [URL="#kigadgets.drawing.Drawing",fillcolor=white,fontname="Vera Sans, DejaVu Sans, Liberation Sans, Arial, Helvetica, sans",fontsize=10,height=0.25,shape=box,style="setlinewidth(0.5),filled",target="_top",tooltip="Base class of shape drawings, not including text"]; "HasLayer" -> "Drawing" [arrowsize=0.5,style="setlinewidth(0.5)"]; "HasPosition" -> "Drawing" [arrowsize=0.5,style="setlinewidth(0.5)"]; "HasWidth" -> "Drawing" [arrowsize=0.5,style="setlinewidth(0.5)"]; "Selectable" -> "Drawing" [arrowsize=0.5,style="setlinewidth(0.5)"]; "BoardItem" -> "Drawing" [arrowsize=0.5,style="setlinewidth(0.5)"]; "GeoHashable" [URL="../item/index.html#kigadgets.item.GeoHashable",fillcolor=white,fontname="Vera Sans, DejaVu Sans, Liberation Sans, Arial, Helvetica, sans",fontsize=10,height=0.25,shape=box,style="setlinewidth(0.5),filled",target="_top",tooltip="Base class for objects that can be geometrically hashed."]; "HasLayer" [URL="../item/index.html#kigadgets.item.HasLayer",fillcolor=white,fontname="Vera Sans, DejaVu Sans, Liberation Sans, Arial, Helvetica, sans",fontsize=10,height=0.25,shape=box,style="setlinewidth(0.5),filled",target="_top",tooltip="Mixin for layer handling based on *strings* (like `'F.Cu'`, `'B.Silkscreen'`, `'User.12'`, etc.)."]; "GeoHashable" -> "HasLayer" [arrowsize=0.5,style="setlinewidth(0.5)"]; "HasPosition" [URL="../item/index.html#kigadgets.item.HasPosition",fillcolor=white,fontname="Vera Sans, DejaVu Sans, Liberation Sans, Arial, Helvetica, sans",fontsize=10,height=0.25,shape=box,style="setlinewidth(0.5),filled",target="_top",tooltip="Mixin for board items with position properties."]; "GeoHashable" -> "HasPosition" [arrowsize=0.5,style="setlinewidth(0.5)"]; "HasWidth" [URL="../item/index.html#kigadgets.item.HasWidth",fillcolor=white,fontname="Vera Sans, DejaVu Sans, Liberation Sans, Arial, Helvetica, sans",fontsize=10,height=0.25,shape=box,style="setlinewidth(0.5),filled",target="_top",tooltip="Mixin for board items with width properties."]; "GeoHashable" -> "HasWidth" [arrowsize=0.5,style="setlinewidth(0.5)"]; "Selectable" [URL="../item/index.html#kigadgets.item.Selectable",fillcolor=white,fontname="Vera Sans, DejaVu Sans, Liberation Sans, Arial, Helvetica, sans",fontsize=10,height=0.25,shape=box,style="setlinewidth(0.5),filled",target="_top",tooltip="Mixin for board items that can be selected in the GUI."]; "GeoHashable" -> "Selectable" [arrowsize=0.5,style="setlinewidth(0.5)"]; }DrawingBase class of shape drawings, not including text
- property center: kigadgets.Point¶
- property start: kigadgets.Point¶
- property angle: float¶
- layer = 'F.SilkS'¶
- width = 0.15¶
- property radius: float¶
- property end: kigadgets.Point¶
- geohash() int¶
- property position: kigadgets.Point¶
- property x: float¶
- property y: float¶
- property is_selected: bool¶
- select(value: bool = True) None¶
Selecting changes the appearance and also plays a role in determining what will be the subject of a subsequent command (delete, move to layer, etc.)
- deselect() None¶
- brighten(value: bool = True) None¶
Brightening gives a bright green appearance
- property native_obj: Any¶
- property board: kigadgets.board.Board | None¶
- kigadgets.drawing.Arc¶
- class kigadgets.drawing.Polygon(coords: List[kigadgets.units.CoordinateLike], layer: str = 'F.SilkS', width: float = 0.15, board: Board | None = None)¶
Bases:
digraph inheritancefe9ce198bc { bgcolor=transparent; rankdir=LR; size="8.0, 12.0"; "BoardItem" [URL="../item/index.html#kigadgets.item.BoardItem",fillcolor=white,fontname="Vera Sans, DejaVu Sans, Liberation Sans, Arial, Helvetica, sans",fontsize=10,height=0.25,shape=box,style="setlinewidth(0.5),filled",target="_top",tooltip="Base class for all PCB board items."]; "GeoHashable" -> "BoardItem" [arrowsize=0.5,style="setlinewidth(0.5)"]; "Drawing" [URL="#kigadgets.drawing.Drawing",fillcolor=white,fontname="Vera Sans, DejaVu Sans, Liberation Sans, Arial, Helvetica, sans",fontsize=10,height=0.25,shape=box,style="setlinewidth(0.5),filled",target="_top",tooltip="Base class of shape drawings, not including text"]; "HasLayer" -> "Drawing" [arrowsize=0.5,style="setlinewidth(0.5)"]; "HasPosition" -> "Drawing" [arrowsize=0.5,style="setlinewidth(0.5)"]; "HasWidth" -> "Drawing" [arrowsize=0.5,style="setlinewidth(0.5)"]; "Selectable" -> "Drawing" [arrowsize=0.5,style="setlinewidth(0.5)"]; "BoardItem" -> "Drawing" [arrowsize=0.5,style="setlinewidth(0.5)"]; "GeoHashable" [URL="../item/index.html#kigadgets.item.GeoHashable",fillcolor=white,fontname="Vera Sans, DejaVu Sans, Liberation Sans, Arial, Helvetica, sans",fontsize=10,height=0.25,shape=box,style="setlinewidth(0.5),filled",target="_top",tooltip="Base class for objects that can be geometrically hashed."]; "HasLayer" [URL="../item/index.html#kigadgets.item.HasLayer",fillcolor=white,fontname="Vera Sans, DejaVu Sans, Liberation Sans, Arial, Helvetica, sans",fontsize=10,height=0.25,shape=box,style="setlinewidth(0.5),filled",target="_top",tooltip="Mixin for layer handling based on *strings* (like `'F.Cu'`, `'B.Silkscreen'`, `'User.12'`, etc.)."]; "GeoHashable" -> "HasLayer" [arrowsize=0.5,style="setlinewidth(0.5)"]; "HasPosition" [URL="../item/index.html#kigadgets.item.HasPosition",fillcolor=white,fontname="Vera Sans, DejaVu Sans, Liberation Sans, Arial, Helvetica, sans",fontsize=10,height=0.25,shape=box,style="setlinewidth(0.5),filled",target="_top",tooltip="Mixin for board items with position properties."]; "GeoHashable" -> "HasPosition" [arrowsize=0.5,style="setlinewidth(0.5)"]; "HasWidth" [URL="../item/index.html#kigadgets.item.HasWidth",fillcolor=white,fontname="Vera Sans, DejaVu Sans, Liberation Sans, Arial, Helvetica, sans",fontsize=10,height=0.25,shape=box,style="setlinewidth(0.5),filled",target="_top",tooltip="Mixin for board items with width properties."]; "GeoHashable" -> "HasWidth" [arrowsize=0.5,style="setlinewidth(0.5)"]; "Polygon" [URL="#kigadgets.drawing.Polygon",fillcolor=white,fontname="Vera Sans, DejaVu Sans, Liberation Sans, Arial, Helvetica, sans",fontsize=10,height=0.25,shape=box,style="setlinewidth(0.5),filled",target="_top"]; "Drawing" -> "Polygon" [arrowsize=0.5,style="setlinewidth(0.5)"]; "Selectable" [URL="../item/index.html#kigadgets.item.Selectable",fillcolor=white,fontname="Vera Sans, DejaVu Sans, Liberation Sans, Arial, Helvetica, sans",fontsize=10,height=0.25,shape=box,style="setlinewidth(0.5),filled",target="_top",tooltip="Mixin for board items that can be selected in the GUI."]; "GeoHashable" -> "Selectable" [arrowsize=0.5,style="setlinewidth(0.5)"]; }DrawingBase class of shape drawings, not including text
- layer = 'F.SilkS'¶
- width = 0.15¶
- property filled: bool¶
- get_vertices() List[kigadgets.Point]¶
- fillet(radius_mm: float, tol_mm: float = 0.01) None¶
- contains(point: kigadgets.units.CoordinateLike) bool¶
Does this shape contain the point
- Parameters:
point (tuple, Point) – the point as a tuple or kigadgets.Point
- Returns:
True if contained
- Return type:
bool
- geohash() int¶
- property position: kigadgets.Point¶
- property x: float¶
- property y: float¶
- property is_selected: bool¶
- select(value: bool = True) None¶
Selecting changes the appearance and also plays a role in determining what will be the subject of a subsequent command (delete, move to layer, etc.)
- deselect() None¶
- brighten(value: bool = True) None¶
Brightening gives a bright green appearance
- property native_obj: Any¶
- property board: kigadgets.board.Board | None¶
- class kigadgets.drawing.Rectangle(corner_nw: kigadgets.units.CoordinateLike, corner_se: kigadgets.units.CoordinateLike, layer: str = 'F.SilkS', width: float = 0.15, board: Board | None = None)¶
Bases:
digraph inheritance6cf2082c71 { bgcolor=transparent; rankdir=LR; size="8.0, 12.0"; "BoardItem" [URL="../item/index.html#kigadgets.item.BoardItem",fillcolor=white,fontname="Vera Sans, DejaVu Sans, Liberation Sans, Arial, Helvetica, sans",fontsize=10,height=0.25,shape=box,style="setlinewidth(0.5),filled",target="_top",tooltip="Base class for all PCB board items."]; "GeoHashable" -> "BoardItem" [arrowsize=0.5,style="setlinewidth(0.5)"]; "Drawing" [URL="#kigadgets.drawing.Drawing",fillcolor=white,fontname="Vera Sans, DejaVu Sans, Liberation Sans, Arial, Helvetica, sans",fontsize=10,height=0.25,shape=box,style="setlinewidth(0.5),filled",target="_top",tooltip="Base class of shape drawings, not including text"]; "HasLayer" -> "Drawing" [arrowsize=0.5,style="setlinewidth(0.5)"]; "HasPosition" -> "Drawing" [arrowsize=0.5,style="setlinewidth(0.5)"]; "HasWidth" -> "Drawing" [arrowsize=0.5,style="setlinewidth(0.5)"]; "Selectable" -> "Drawing" [arrowsize=0.5,style="setlinewidth(0.5)"]; "BoardItem" -> "Drawing" [arrowsize=0.5,style="setlinewidth(0.5)"]; "GeoHashable" [URL="../item/index.html#kigadgets.item.GeoHashable",fillcolor=white,fontname="Vera Sans, DejaVu Sans, Liberation Sans, Arial, Helvetica, sans",fontsize=10,height=0.25,shape=box,style="setlinewidth(0.5),filled",target="_top",tooltip="Base class for objects that can be geometrically hashed."]; "HasLayer" [URL="../item/index.html#kigadgets.item.HasLayer",fillcolor=white,fontname="Vera Sans, DejaVu Sans, Liberation Sans, Arial, Helvetica, sans",fontsize=10,height=0.25,shape=box,style="setlinewidth(0.5),filled",target="_top",tooltip="Mixin for layer handling based on *strings* (like `'F.Cu'`, `'B.Silkscreen'`, `'User.12'`, etc.)."]; "GeoHashable" -> "HasLayer" [arrowsize=0.5,style="setlinewidth(0.5)"]; "HasPosition" [URL="../item/index.html#kigadgets.item.HasPosition",fillcolor=white,fontname="Vera Sans, DejaVu Sans, Liberation Sans, Arial, Helvetica, sans",fontsize=10,height=0.25,shape=box,style="setlinewidth(0.5),filled",target="_top",tooltip="Mixin for board items with position properties."]; "GeoHashable" -> "HasPosition" [arrowsize=0.5,style="setlinewidth(0.5)"]; "HasWidth" [URL="../item/index.html#kigadgets.item.HasWidth",fillcolor=white,fontname="Vera Sans, DejaVu Sans, Liberation Sans, Arial, Helvetica, sans",fontsize=10,height=0.25,shape=box,style="setlinewidth(0.5),filled",target="_top",tooltip="Mixin for board items with width properties."]; "GeoHashable" -> "HasWidth" [arrowsize=0.5,style="setlinewidth(0.5)"]; "Polygon" [URL="#kigadgets.drawing.Polygon",fillcolor=white,fontname="Vera Sans, DejaVu Sans, Liberation Sans, Arial, Helvetica, sans",fontsize=10,height=0.25,shape=box,style="setlinewidth(0.5),filled",target="_top"]; "Drawing" -> "Polygon" [arrowsize=0.5,style="setlinewidth(0.5)"]; "Rectangle" [URL="#kigadgets.drawing.Rectangle",fillcolor=white,fontname="Vera Sans, DejaVu Sans, Liberation Sans, Arial, Helvetica, sans",fontsize=10,height=0.25,shape=box,style="setlinewidth(0.5),filled",target="_top",tooltip="Inherits x,y get/set from HasPosition"]; "Polygon" -> "Rectangle" [arrowsize=0.5,style="setlinewidth(0.5)"]; "Selectable" [URL="../item/index.html#kigadgets.item.Selectable",fillcolor=white,fontname="Vera Sans, DejaVu Sans, Liberation Sans, Arial, Helvetica, sans",fontsize=10,height=0.25,shape=box,style="setlinewidth(0.5),filled",target="_top",tooltip="Mixin for board items that can be selected in the GUI."]; "GeoHashable" -> "Selectable" [arrowsize=0.5,style="setlinewidth(0.5)"]; }PolygonInherits x,y get/set from HasPosition
- layer = 'F.SilkS'¶
- width = 0.15¶
- classmethod from_centersize(xcent: float, ycent: float, xsize: float, ysize: float, layer: str = 'F.SilkS', width: float = 0.15, board: Board | None = None) Rectangle¶
- get_vertices() List[kigadgets.Point]¶
- property size: Tuple[float, float]¶
- fillet(radius_mm: float, tol_mm: float = 0.01) None¶
Deletes the rectangle but that is ok in most situations It can be undone IF it is run inside an action plugin
- contains(point: kigadgets.units.CoordinateLike) bool¶
Does this shape contain the point
- Parameters:
point (tuple, Point) – the point as a tuple or kigadgets.Point
- Returns:
True if contained
- Return type:
bool
- property filled: bool¶
- geohash() int¶
- property position: kigadgets.Point¶
- property x: float¶
- property y: float¶
- property is_selected: bool¶
- select(value: bool = True) None¶
Selecting changes the appearance and also plays a role in determining what will be the subject of a subsequent command (delete, move to layer, etc.)
- deselect() None¶
- brighten(value: bool = True) None¶
Brightening gives a bright green appearance
- property native_obj: Any¶
- property board: kigadgets.board.Board | None¶
- class kigadgets.drawing.TextPCB(position: kigadgets.units.CoordinateLike, text: str | None = None, layer: str = 'F.SilkS', size: float = 1.0, thickness: float = 0.15, justification: str | Tuple[str, str] | None = None, mirrored: bool = False, board: Board | None = None)¶
Bases:
digraph inheritancec319b2e9b5 { bgcolor=transparent; rankdir=LR; size="8.0, 12.0"; "BoardItem" [URL="../item/index.html#kigadgets.item.BoardItem",fillcolor=white,fontname="Vera Sans, DejaVu Sans, Liberation Sans, Arial, Helvetica, sans",fontsize=10,height=0.25,shape=box,style="setlinewidth(0.5),filled",target="_top",tooltip="Base class for all PCB board items."]; "GeoHashable" -> "BoardItem" [arrowsize=0.5,style="setlinewidth(0.5)"]; "GeoHashable" [URL="../item/index.html#kigadgets.item.GeoHashable",fillcolor=white,fontname="Vera Sans, DejaVu Sans, Liberation Sans, Arial, Helvetica, sans",fontsize=10,height=0.25,shape=box,style="setlinewidth(0.5),filled",target="_top",tooltip="Base class for objects that can be geometrically hashed."]; "HasLayer" [URL="../item/index.html#kigadgets.item.HasLayer",fillcolor=white,fontname="Vera Sans, DejaVu Sans, Liberation Sans, Arial, Helvetica, sans",fontsize=10,height=0.25,shape=box,style="setlinewidth(0.5),filled",target="_top",tooltip="Mixin for layer handling based on *strings* (like `'F.Cu'`, `'B.Silkscreen'`, `'User.12'`, etc.)."]; "GeoHashable" -> "HasLayer" [arrowsize=0.5,style="setlinewidth(0.5)"]; "HasPosition" [URL="../item/index.html#kigadgets.item.HasPosition",fillcolor=white,fontname="Vera Sans, DejaVu Sans, Liberation Sans, Arial, Helvetica, sans",fontsize=10,height=0.25,shape=box,style="setlinewidth(0.5),filled",target="_top",tooltip="Mixin for board items with position properties."]; "GeoHashable" -> "HasPosition" [arrowsize=0.5,style="setlinewidth(0.5)"]; "Selectable" [URL="../item/index.html#kigadgets.item.Selectable",fillcolor=white,fontname="Vera Sans, DejaVu Sans, Liberation Sans, Arial, Helvetica, sans",fontsize=10,height=0.25,shape=box,style="setlinewidth(0.5),filled",target="_top",tooltip="Mixin for board items that can be selected in the GUI."]; "GeoHashable" -> "Selectable" [arrowsize=0.5,style="setlinewidth(0.5)"]; "TextEsque" [URL="../item/index.html#kigadgets.item.TextEsque",fillcolor=white,fontname="Vera Sans, DejaVu Sans, Liberation Sans, Arial, Helvetica, sans",fontsize=10,height=0.25,shape=box,style="setlinewidth(0.5),filled",target="_top",tooltip="Base class for items with text-like properties"]; "GeoHashable" -> "TextEsque" [arrowsize=0.5,style="setlinewidth(0.5)"]; "TextPCB" [URL="#kigadgets.drawing.TextPCB",fillcolor=white,fontname="Vera Sans, DejaVu Sans, Liberation Sans, Arial, Helvetica, sans",fontsize=10,height=0.25,shape=box,style="setlinewidth(0.5),filled",target="_top"]; "HasLayer" -> "TextPCB" [arrowsize=0.5,style="setlinewidth(0.5)"]; "HasPosition" -> "TextPCB" [arrowsize=0.5,style="setlinewidth(0.5)"]; "Selectable" -> "TextPCB" [arrowsize=0.5,style="setlinewidth(0.5)"]; "BoardItem" -> "TextPCB" [arrowsize=0.5,style="setlinewidth(0.5)"]; "TextEsque" -> "TextPCB" [arrowsize=0.5,style="setlinewidth(0.5)"]; }kigadgets.item.HasLayer,kigadgets.item.HasPosition,kigadgets.item.Selectable,kigadgets.item.BoardItem,kigadgets.item.TextEsqueMixin for layer handling based on strings (like ‘F.Cu’, ‘B.Silkscreen’, ‘User.12’, etc.). If the layer is not present, it will be caught at runtime, rather than disallowed.
- position¶
- layer = 'F.SilkS'¶
- size = 1.0¶
- thickness = 0.15¶
- mirrored = False¶
- geohash() int¶
- property x: float¶
- property y: float¶
- property is_selected: bool¶
- select(value: bool = True) None¶
Selecting changes the appearance and also plays a role in determining what will be the subject of a subsequent command (delete, move to layer, etc.)
- deselect() None¶
- brighten(value: bool = True) None¶
Brightening gives a bright green appearance
- property native_obj: Any¶
- property board: kigadgets.board.Board | None¶
- justification_lookups¶
- property text: str¶
- property orientation: float¶
Rotation of the item in degrees.
- property justification: Tuple[str, str]¶