feature module#
Feature definitions#
This module provides feature classes for representing board elements
like cutouts, keepouts, silkscreen, and other board features. Notably, this
does not include copper shapes, see the copper module for that.
- class Feature(shape)[source]#
Bases:
CriticalBase class for board features.
- Parameters:
shape (Shape)
- class OverlappableCopper(shape, layer)[source]#
Bases:
FeatureCopper element on a layer index that is not associated with a net.
Represents a copper element with a defined shape on a particular layer index. It will be ignored by router and overlap checks. This can be used to define a net-tie that overlaps pads from two different nets, or an antenna, or more generally where an overlap is needed, but it does not cleanly fit the model and gets flagged as an error.
>>> self.copper = PhantomCopper(Circle(diameter=2.0), layer=0)
- class Cutout(shape)[source]#
Bases:
FeatureCutout element for holes and slots. Through-hole pads will include their hole definition using a Cutout.
>>> cutout = Cutout(Circle(radius=1.0))
- Parameters:
shape (Shape)
- class MultiLayerFeature(shape, layers)[source]#
Bases:
FeatureFeature that spans multiple board layers.
- class KeepOut(shape, layers, *, pour=False, via=False, route=False)[source]#
Bases:
MultiLayerFeatureConstruct keepout regions on a range of layers.
>>> # Keep out pours and vias on the top layer >>> keepout = KeepOut(layers=LayerSet(0), pour=True, via=True, route=False)
- class SurfaceFeature(shape, side=Side.Top)[source]#
Bases:
FeatureSurface features are features that apply to either top or bottom side of the board, but not to internal layers. This class should not be used directly, instead use one of the subclasses.
- class Silkscreen(shape, side=Side.Top)[source]#
Bases:
SurfaceFeatureAdd a shape to the silkscreen layer
>>> silkscreen = Silkscreen(rectangle(2, 3), side=Side.Bottom)
- class Soldermask(shape, side=Side.Top)[source]#
Bases:
SurfaceFeatureAdd a shape to the solder mask layer
>>> soldermask = Soldermask(rectangle(2, 1), side=Side.Top)
- class Paste(shape, side=Side.Top)[source]#
Bases:
SurfaceFeatureAdd a shape to the paste application layer
>>> paste = Paste(circle(diameter=1))
- class Glue(shape, side=Side.Top)[source]#
Bases:
SurfaceFeatureAdd a shape to the glue application layer
>>> glue = Glue(circle(diameter=1), side=Side.Bottom)
- class Finish(shape, side=Side.Top)[source]#
Bases:
SurfaceFeatureAdd a shape to the glue application layer
>>> finish = Finish(rectangle(1, 1))
- class Courtyard(shape, side=Side.Top)[source]#
Bases:
SurfaceFeatureCourtyards are used to indicate land pattern bounds.
>>> courtyard = Courtyard(rectangle(3, 3))