Skip to content

Pad Generators

Package name: jsl/landpatterns/pads

Tools for creating pads of different types.

This package contains the implementation of various utilities for creating pcb-pad types. The functions in this package are organized with the following function names:

All of the functions in this package use millimeters for units.

Plated Holes:

Functions will have names in the following format:

defn <HOLE>-pth-<LAND>-pad (...)

Where:

  • &#60;HOLE> (String) = The shape of the drilled hole
  • pth = Pads must be plated through by default.
  • &#60;LAND> (String) = The shape of the pad (copper)

The HOLE string can be one of:

  • oval - Capsule
  • circle - Circle

The LAND string can be one of:

  • oval - Capsule
  • circle - Circle
  • rect - Rectangle
  • round-rect - Rectangle with radial rounded corners
  • cham-rect - Rectangle with chamfered corner edges
  • dshape - a D shaped pad with one set of corners rounded.
  • general-round-rect - Generalized Rounded Rectangle
  • general-cham-rect - Generalized Chamfered Rectangle

Each function also accepts a mask and paste overriding value. This value can be either a parameterization of the pad shape for that function or a completely different shape.

SMD Pads

The surface mount pad functions come in the form:

defn <SHAPE>-smd-pad (...)

Where the &#60;SHAPE> string can be one of:

  • oval - Capsule
  • circle - Circle
  • rect - Rectangle
  • round-rect - Rectangle with radial rounded corners
  • cham-rect - Rectangle with chamfered corner edges
  • dshape - a D shaped pad with one set of corners rounded.
  • general-round-rect - Generalized Rounded Rectangle
  • general-cham-rect - Generalized Chamfered Rectangle

Each function also accepts a mask and paste overriding value. This value can be either a parameterization of the pad shape for that function or a completely different shape.

Summary

PasteMaskStyle

Paste Mask Opening Style

General Definitions

Function Description
make-non-plated-hole Generator for creating a non-plated hole
dshape-smd-pad
circle-pth-cham-rect-pad
oval-pth-cham-rect-pad
testpoint-pad (+ 1)
make-non-plated-courtyard Create the courtyard for a non-plated hole
round-rect-smd-pad
general-round-rect-smd-pad (+ 1)
smd-pad (+ 2) PCB Pad Definition for SMD device
circle-smd-pad
oval-smd-pad
oval-npth-pad
non-plated-hole-landpattern (+ 1) Construct a Non-Plated Hole via a Landpattern Definition
circle-npth-pad Create a circular NPTH pad
circle-pth-general-cham-rect-pad (+ 1)
oval-pth-general-cham-rect-pad (+ 1) Create a oval-shaped plated through-hole with ShapeType pad.
make-pastemask (+ 1) Generate a paste mask opening by using this explicit shape.
cham-rect-smd-pad
oval-pth-dshape-pad
circle-pth-dshape-pad
pth-pad (+ 1) Create a Plated Through-Hole (PTH) Pad Definition
make-soldermask (+ 1) Generator to apply a soldermask shape to a pcb-pad
oval-pth-round-rect-pad
circle-pth-round-rect-pad
oval-pth-general-round-rect-pad (+ 1) Create a oval-shaped plated through-hole with ShapeType pad.
circle-pth-general-round-rect-pad (+ 1)
get-default-soldermask-amount
oval-pth-circle-pad
npth-pad Create a Non-Plated Through-Hole (NPTH) pad
circle-pth-circle-pad
oval-pth-oval-pad
make-thermal-pad Generate a Thermal Pad for a Package
general-cham-rect-smd-pad (+ 1)
circle-pth-oval-pad
Variable Description
NPTH_DEF_OBS_LAYERS Default Observed Layers for NPTH Courtyard Generation

Definitions

PasteMaskStyle

Paste Mask Opening Style

public defenum PasteMaskStyle <: Equalable & Hashable

  • NominalPasteMask

  • NoPasteMask

This enum provides flags that can indicate the style of pastemask to generate. This can often be useful for generating a pastemask layer that conforms to certain norms.

General Definitions

make-non-plated-hole

Generator for creating a non-plated hole

public defn make-non-plated-hole (hole:Shape, mask?:Maybe<Shape|Double>)

  • hole: Shape - Cutout Hole Shape
  • mask?: Maybe<Shape|Double> - Optional soldermask opening configuration. If not provided, then this function uses the default SolderMaskRegistration clearance rule to determine the opening minimum size. If a Shape is provided, we will use that shape explicitly. If Double is provided, then we will create an opening that expands the hole shape by mask? millimeters radially. This mask is applied on both the top and bottom layers.

This function must be called within a pcb-landpattern context. This function will construct layer data on Cutout, SolderMask(Top) and SolderMask(Bottom) for a non-plated hole.

dshape-smd-pad

public defn dshape-smd-pad (pad-rect:Dims, pad-r:Double -- mask:Dims|Shape|False = ?, paste:Dims|Shape|False = ?, anchor:Anchor = ?)

circle-pth-cham-rect-pad

public defn circle-pth-cham-rect-pad (hole-diam:Double, pad-rect:Dims, pad-r:Double -- mask:Dims|Shape|False = ?, paste:Dims|Shape|False = ?, anchor:Anchor = ?)

oval-pth-cham-rect-pad

public defn oval-pth-cham-rect-pad (hole-size:Dims, pad-rect:Dims, pad-r:Double -- mask:Dims|Shape|False = ?, paste:Dims|Shape|False = ?, anchor:Anchor = ?)

testpoint-pad

public pcb-pad testpoint-pad (testpoint-shape:Shape)

testpoint-pad

public defn testpoint-pad (diameter:Double -- anchor:Anchor = ?)

make-non-plated-courtyard

Create the courtyard for a non-plated hole

public defn make-non-plated-courtyard (obs-layers:Tuple<LayerSpecifier> = ? -- courtyard-excess:Double = ?)

  • obs-layers: Tuple<LayerSpecifier> - Set of layers to inspect for shape data when constructing the courtyard outline. The union of these shapes is the base shape for the courtyard.
  • courtyard-excess: Double - Expansion amount in mm. Default is 0.25mm
  • Throws ArgumentError - If courtyard-excess is less than zero.
  • Throws ValueError - If no shape data can be found to create the union.

This is a generator that expects to be called from a pcb-landpattern context.

This function constructs a courtyard outline as the union of all of the shapes found on obs-layers and then expands that definition by courtyard-excess mm.

round-rect-smd-pad

public defn round-rect-smd-pad (pad-rect:Dims, pad-r:Double -- mask:Dims|Shape|False = ?, paste:Dims|Shape|False = ?, anchor:Anchor = ?)

general-round-rect-smd-pad

public defn general-round-rect-smd-pad (pad-rect:Dims, pad-rs:Tuple<Double> -- mask:Dims|Shape|False = ?, paste:Dims|Shape|False = ?, anchor:Anchor = ?)

general-round-rect-smd-pad

public defn general-round-rect-smd-pad (pad-rect:Dims, pad-r:Double, m:CornerModifier -- mask:Dims|Shape|False = ?, paste:Dims|Shape|False = ?, anchor:Anchor = ?)

smd-pad

PCB Pad Definition for SMD device

public pcb-pad smd-pad (copper:Shape, mask:Shape|Double|False = ?, paste:Shape|False = ?)

  • copper: Shape - Defines the shape of the copper layer for this pad.
  • mask: Shape|Double|False - Defines the shape fo the soldermask opening for this pad. If this value is false then no soldermask opening will be created. If this value is a Double, then this value defines how much the soldermask will be expanded/shrunk from the copper shape. The default is based on the SolderMaskRegistration rule from the current ruleset. If this value is a Shape - then that shape will be used directly in the soldermask layer.
  • paste: Shape|False - Defines the shape of the pastemask opening for this pad. If this value is false then no pastemask opening is created. By default, the pastemask opening is 1:1 with the copper shape. TODO - add a rule for default pastemask contraction rules?

TODO - Create a diagram here for the pad definition

smd-pad

Create a Rectangular PCB Pad Definition

public defn smd-pad (width:Double, height:Double -- anchor:Anchor = ?)

  • width: Double - X dimension of the pad shape
  • height: Double - Y dimension of the pad shape
  • anchor: Anchor - Origin of the pad definition. By default this function uses the pad center as its anchor.

smd-pad

public defn smd-pad (d:Dims -- anchor:Anchor = ?)

circle-smd-pad

public defn circle-smd-pad (pad-diam:Double -- mask:Double|Shape|False = ?, paste:Double|Shape|False = ?, anchor:Anchor = ?)

oval-smd-pad

public defn oval-smd-pad (pad-size:Dims -- mask:Dims|Shape|False = ?, paste:Dims|Shape|False = ?, anchor:Anchor = ?)

oval-npth-pad

public defn oval-npth-pad (hole-size:Dims -- anchor:Anchor = ?)

non-plated-hole-landpattern

Construct a Non-Plated Hole via a Landpattern Definition

public defn non-plated-hole-landpattern (hole:Shape, mask?:Shape|Double = ? -- name-lp:String = ?, courtyard-excess:Double = ?) -> LandPattern

  • hole: Shape - Cutout Hole Shape - Circle and Capsule are suggested but any shape can be applied here. If not using Circle or Capsule - confirm that the board fabricator that the hole shape you want is possible in their process.
  • mask?: Shape|Double - Optional soldermask opening configuration. If not provided, then this function uses the default SolderMaskRegistration clearance rule to determine the opening minimum size. If a Shape is provided, we will use that shape explicitly. If Double is provided, then we will create an opening that expands the hole shape by mask? millimeters radially. This mask is applied on both the top and bottom layers.
  • name-lp: String - Optional name for the landpattern definition. Default is "NPTH"
  • courtyard-excess: Double - Optional courtyard excess in millimeters. Default is 0.25mm. The courtyard is applied on both top and bottom layers and expands radially from the overall size of the landpattern.
  • Returns LandPattern - LandPattern definition to be used in a pcb-component.

The pcb-pad definition has a restriction where it cannot created non-plated through holes. This function allows us to create a non-plated through hole and customize its appearance. We must use a landpattern to create this non-plated through hole which mandates that we have a wrapping pcb-component instance.

This function uses constituent generator functions make-non-plated-hole and make-non-plated-courtyard which can be used to customize the creation of a non-plated hole.

non-plated-hole-landpattern

Create a Circular Non-Plated Hole as a LandPattern

public defn non-plated-hole-landpattern (drill-d:Double, mask-d:Double = ? -- name-lp:String = ?, courtyard-excess:Double = ?)

  • drill-d: Double - Drill Diameter in mm
  • mask-d: Double - Soldermask opening diameter in mm. By default this is the drill diameter + the SolderMaskRegistration clearance requirement.
  • name-lp: String - Optional name for the landpattern definition. Default is "NPTH"
  • courtyard-excess: Double - Optional courtyard excess in millimeters. Default is 0.25mm. The courtyard is applied on both top and bottom layers and expands radially from the overall size of the landpattern.

circle-npth-pad

Create a circular NPTH pad

public defn circle-npth-pad (hole-diam:Double -- anchor:Anchor = ?)

  • hole-diam: Double - Create a circular hole with this diameter.
  • anchor: Anchor - Origin of the pad definition. By default this function uses the pad center as its anchor.

circle-pth-general-cham-rect-pad

public defn circle-pth-general-cham-rect-pad (hole-diam:Double, pad-rect:Dims, pad-rs:Tuple<Double> -- mask:Dims|Shape|False = ?, paste:Dims|Shape|False = ?, anchor:Anchor = ?)

circle-pth-general-cham-rect-pad

public defn circle-pth-general-cham-rect-pad (hole-diam:Double, pad-rect:Dims, pad-r:Double, m:CornerModifier -- mask:Dims|Shape|False = ?, paste:Dims|Shape|False = ?, anchor:Anchor = ?)

oval-pth-general-cham-rect-pad

Create a oval-shaped plated through-hole with ShapeType pad.

public defn oval-pth-general-cham-rect-pad (hole-size:Dims, pad-rect:Dims, pad-rs:Tuple<Double> -- mask:Dims|Shape|False = ?, paste:Dims|Shape|False = ?, anchor:Anchor = ?)

oval-pth-general-cham-rect-pad

public defn oval-pth-general-cham-rect-pad (hole-size:Dims, pad-rect:Dims, pad-r:Double, m:CornerModifier -- mask:Dims|Shape|False = ?, paste:Dims|Shape|False = ?, anchor:Anchor = ?)

make-pastemask

Generate a paste mask opening by using this explicit shape.

public defn make-pastemask (mask-shape:Shape, side:Side = ?)

  • mask-shape: Shape - Shape for the pastemask opening.
  • side: Side - Which side of the board to apply the paste mask opening. By default this is the top-side (convention).

make-pastemask

Generate a paste mask opening by expanding/shrinking the copper shape.

public defn make-pastemask (amount:Double, side:Side = ?)

  • amount: Double - Amount in mm to expand/shrink the current copper pad shape to generate the paste mask opening. If this value is positive, then the paste mask opening is expanded. If this value is negative, then the paste mask opening is shrunk.
  • side: Side - Which side of the board to apply the paste mask opening. By default this is the top-side (convention when constructing pads).

cham-rect-smd-pad

public defn cham-rect-smd-pad (pad-rect:Dims, pad-r:Double -- mask:Dims|Shape|False = ?, paste:Dims|Shape|False = ?, anchor:Anchor = ?)

oval-pth-dshape-pad

public defn oval-pth-dshape-pad (hole-size:Dims, pad-rect:Dims, pad-r:Double -- mask:Dims|Shape|False = ?, paste:Dims|Shape|False = ?, anchor:Anchor = ?)

circle-pth-dshape-pad

public defn circle-pth-dshape-pad (hole-diam:Double, pad-rect:Dims, pad-r:Double -- mask:Dims|Shape|False = ?, paste:Dims|Shape|False = ?, anchor:Anchor = ?)

pth-pad

Create a Plated Through-Hole (PTH) Pad Definition

public pcb-pad pth-pad (hole:Shape, copper:Shape, mask:Shape|Double|False = ?, paste:Shape|False = ?)

  • hole: Shape - Plated Through-Hole shape for this pad.
  • copper: Shape - Shape of the copper land surrounding the hole. This shape is applied to both the top and bottom layers but not to the internal layers if any.

TODO- make the same as smd-pad - mask: Shape|Double|False - Defines the shape fo the soldermask opening for this pad. If this value is false then no soldermask opening will be created. If this value is a Double, then this value defines how much the soldermask will be expanded/shrunk from the copper shape. The default is based on the SolderMaskRegistration rule from the current ruleset. If a Shape is provided then that shape will be directly applied to the soldermask layer. - paste: Shape|False - Defines the shape of the pastemask opening for this pad. If this value is false then no pastemask opening is created. The default value is false meaning no pastemask opening is applied.

TODO - Create a diagram here for the pad definition

pth-pad

Create a circular Plated Through-Hole (PTH) Pad

public defn pth-pad (hole-diam:Double, pad-diam:Double = ? -- anchor:Anchor = ?)

  • hole-diam: Double - Diameter of the hole for the PTH pad.
  • pad-diam: Double - Diameter of the plated copper around the hole.
  • anchor: Anchor - Origin of the pad definition. By default this function uses the pad center as its anchor.
  • Throws ValueError - When the pad-diam is smaller than the hole-diam.

This function uses the default soldermask and pastemask definitions as defined by the pth-pad generator.

make-soldermask

Generator to apply a soldermask shape to a pcb-pad

public defn make-soldermask (mask-shape:Shape)

  • mask-shape: Shape - Creates an opening of this shape in the soldermask layer of the pad. If the pad is though-hole, then the soldermask shape is applied to bot top and bottom soldermask layers.

This generator must be called from within a pcb-pad definition.

make-soldermask

Generator to apply a soldermask by expansion of the current pad shape.

public defn make-soldermask (amount:Double = ?)

  • amount: Double - The soldermask opening will be created with a shape that is an expansion of the current shape in all directions by amount. By default, the SolderMaskRegistration rule setting is used to set the default expansion amount.

This generator must be called from within a pcb-pad definition.

TODO - Need a diagram here showing the expansion characteristics for different shapes - specifically rectangle and non-convex pad shapes

oval-pth-round-rect-pad

public defn oval-pth-round-rect-pad (hole-size:Dims, pad-rect:Dims, pad-r:Double -- mask:Dims|Shape|False = ?, paste:Dims|Shape|False = ?, anchor:Anchor = ?)

circle-pth-round-rect-pad

public defn circle-pth-round-rect-pad (hole-diam:Double, pad-rect:Dims, pad-r:Double -- mask:Dims|Shape|False = ?, paste:Dims|Shape|False = ?, anchor:Anchor = ?)

oval-pth-general-round-rect-pad

Create a oval-shaped plated through-hole with ShapeType pad.

public defn oval-pth-general-round-rect-pad (hole-size:Dims, pad-rect:Dims, pad-rs:Tuple<Double> -- mask:Dims|Shape|False = ?, paste:Dims|Shape|False = ?, anchor:Anchor = ?)

oval-pth-general-round-rect-pad

public defn oval-pth-general-round-rect-pad (hole-size:Dims, pad-rect:Dims, pad-r:Double, m:CornerModifier -- mask:Dims|Shape|False = ?, paste:Dims|Shape|False = ?, anchor:Anchor = ?)

circle-pth-general-round-rect-pad

public defn circle-pth-general-round-rect-pad (hole-diam:Double, pad-rect:Dims, pad-rs:Tuple<Double> -- mask:Dims|Shape|False = ?, paste:Dims|Shape|False = ?, anchor:Anchor = ?)

circle-pth-general-round-rect-pad

public defn circle-pth-general-round-rect-pad (hole-diam:Double, pad-rect:Dims, pad-r:Double, m:CornerModifier -- mask:Dims|Shape|False = ?, paste:Dims|Shape|False = ?, anchor:Anchor = ?)

get-default-soldermask-amount

public defn get-default-soldermask-amount () -> Double

  • Returns Double

oval-pth-circle-pad

public defn oval-pth-circle-pad (hole-size:Dims, pad-diam:Double -- mask:Double|Shape|False = ?, paste:Double|Shape|False = ?, anchor:Anchor = ?)

npth-pad

Create a Non-Plated Through-Hole (NPTH) pad

public pcb-pad npth-pad (hole:Shape, mask:Shape|False = ?)

  • hole: Shape - Shape for the non-plated hole of this pad.
  • mask: Shape|False - Defines the shape fo the soldermask opening for this npth pad. If this value is false then the soldermask will be created using default expansion rules from the passed hole shape.

No copper pad is created surrounding this hole and

circle-pth-circle-pad

public defn circle-pth-circle-pad (hole-diam:Double, pad-diam:Double -- mask:Double|Shape|False = ?, paste:Double|Shape|False = ?, anchor:Anchor = ?)

oval-pth-oval-pad

public defn oval-pth-oval-pad (hole-size:Dims, pad-size:Dims -- mask:Dims|Shape|False = ?, paste:Dims|Shape|False = ?, anchor:Anchor = ?)

make-thermal-pad

Generate a Thermal Pad for a Package

public defn make-thermal-pad (shape?:False|Shape, pad-num:Int -- location:Pose = ?)

  • shape?: False|Shape - Shape for the thermal pad that will be created by this generator. If false, no thermal pad is generated. TODO - we should make this also accept a Ref type.
  • pad-num: Int - Pad Index that will be used to create the thermal pad for the package.
  • location: Pose - Optional pose for the landpattern. The default location will be at (0,0) in the landpatterns frame of reference.

general-cham-rect-smd-pad

public defn general-cham-rect-smd-pad (pad-rect:Dims, pad-rs:Tuple<Double> -- mask:Dims|Shape|False = ?, paste:Dims|Shape|False = ?, anchor:Anchor = ?)

general-cham-rect-smd-pad

public defn general-cham-rect-smd-pad (pad-rect:Dims, pad-r:Double, m:CornerModifier -- mask:Dims|Shape|False = ?, paste:Dims|Shape|False = ?, anchor:Anchor = ?)

circle-pth-oval-pad

public defn circle-pth-oval-pad (hole-diam:Double, pad-size:Dims -- mask:Dims|Shape|False = ?, paste:Dims|Shape|False = ?, anchor:Anchor = ?)

NPTH_DEF_OBS_LAYERS

Default Observed Layers for NPTH Courtyard Generation

public val NPTH_DEF_OBS_LAYERS

This is the default argument for make-non-plated-courtyard.

It consists of:

  • Cutout
  • SolderMask(Top)
  • SolderMask(Bottom)

Related Packages

Forwarded by packages: jsl/landpatterns/framework, jsl/landpatterns