package module#

class PackageBody(*, height)[source]#

Bases: Kinematic

Component package body base class

This class is the representation of the 3D footprint of a component. Do not instantiate directly, but use on of the subclasses instead.

Parameters:

height (Toleranced)

height: Toleranced#

Height of the package body

final envelope(density_level)[source]#

Compute the envelope of the package body

This method returns the 2D envelope of the package body at the given density level.

Parameters:

density_level (DensityLevel) – density level to compute the envelope for

Return type:

Shape

Returns:

The envelope of the package body at the given density level

property dims: tuple[Toleranced, Toleranced]#

Get the axis aligned bounding box dimensions of the package body.

class RectanglePackage(width, length, *, height)[source]#

Bases: PackageBody

Rectangular PackageBody

This class represents a rectangular prism bounding box. For a cylindrical package body, use CylinderPackage instead.

The body is drawn as width along the X-axis by length along the Y-axis. On a dual package with pin 1 at the top left, length runs along the rows of leads and width across them. height is typically A on the package drawing. A leadless drawing (QFN, SON) gives the body as D and E, and which of them runs along each axis varies between drawings. A leaded drawing typically gives the body width as E1 (and, on a QFP, the body length as D1), with E and D the overall dimensions across the leads, which belong in span.

Parameters:
width: Toleranced#

Width of the package body

length: Toleranced#

Length of the package body

property dims: tuple[Toleranced, Toleranced]#

Get the axis aligned bounding box dimensions of the package body.

class CylinderPackage(diameter, *, height)[source]#

Bases: PackageBody

Cylindrical PackageBody

This class represents a cylindrical bounding box. For a rectangular package body, use RectanglePackage instead.

Parameters:
diameter: Toleranced#

Diameter of the package body

property dims: tuple[Toleranced, Toleranced]#

Get the axis aligned bounding box dimensions of the package body.

class PackageBodyMixin[source]#

Bases: object

Mixin class for components that have a package body

package_body(body)[source]#

Set the package body of the component

Return type:

Self

Parameters:

body (PackageBody)