Skip to content

jsl/landpatterns/grid-planner

Package name: jsl/landpatterns/grid-planner

Summary

Data Types

GridPlanner

Pad Grid Pose Planner

Constructors

Function Description
GridPlanner (+ 1) Constructor for defstruct GridPlanner

Multis

Function Description
rows Number of Rows in the Grid
grid Grid Generator

Methods

Function Description
grid Default Grid Generator

Functions

Function Description
GridPlanner Construct GridPlanner with Anchor

StaggerPhase

Stagger Phase Definition

Functions

Function Description
stagger-pattern Stagger Pattern for Marking Active Pads

GridPosition

Constructors

Function Description
GridPosition Constructor for defstruct GridPosition

Multis

Function Description
grid Grid Generator

Methods

Function Description
grid Default Grid Generator

General Definitions

Function Description
equilateral-triangle-pitch Construct the asymmetric pitch for an equilateral triangle grid.

Definitions

GridPlanner

Pad Grid Pose Planner

public defstruct GridPlanner
    columns: Int
    pitch: Double|Dims
    pose: Pose
    rows: Int

  • columns: Int - Number of Columns in the Grid This value is expected to be a positive integer The columns traverse the X dimension.

  • pitch: Double|Dims - Compute the Pitch (inter-pad distance) for the grid. The interpretation of the pitch is up to the GridPlanner implementation. For example a Equilateral Triangle grid generator may interpret the pitch as being non-orthonormal and instead be the equidistant distance between pads.

    By default this is a field but could be implemented as a defmethod if needed.

  • pose: Pose - Optional Pose Rotation for the Grid This can be useful when we want to orientate the grid differently from how we construct it.

  • rows: Int - Number of Rows in the Grid This value is expected to be a positive integer The rows traverse the Y dimension.

    This value should be used when there is no uneven-ness in the grid.

This type defines the interface for the grid creation of a land pattern. The most obvious package with a grid is a Ball Grid Array (BGA) which is typically 2D orthonormal. But there is a wide diversity of different land pattern grids even within BGAs.

In JSL, the land pattern framework assumes that all land patterns have a grid. Some of those grids may be quite trivial - ie a single row or column with N pins. Others can be quite complex with Uneven sides, unpopulated grid locations, among other idiosyncracies.

The Grid Planner type allows us to define typical grid patterns in a common reusable way so that we don't have to copy and paste the same implementations over and over.

Constructors

GridPlanner

Constructor for defstruct GridPlanner

public defn GridPlanner (pitch:Double|Dims, columns:Int, rows:Int, pose:Pose)

GridPlanner

Constructor for defstruct GridPlanner

public defn GridPlanner ( -- pitch:Double|Dims, columns:Int, rows:Int, pose:Pose = ?)

Multis

rows

Number of Rows in the Grid

public defmulti rows (g:GridPlanner, c:Int) -> Int

  • c: Int - In some grids, the number of rows is variable. This means that from column to column the row count might change. The optional c argument identifies the column which may or may not be used.
  • Returns Int

This value is expected to be a positive integer The rows traverse the Y dimension.

grid

Grid Generator

public defmulti grid (g:GridPlanner) -> Seq<GridPosition>

  • g: GridPlanner - This Grid Planner
  • Returns Seq<GridPosition> - The generated grid consists of GridPosition objects which provide the row index, column index, and a Pose object for identifying the location of that grid position.

This method constructs a sequence of Pose locations for the desired grid.

This method must be implemented by the derived grid type to generate this sequence.

Methods

grid

Default Grid Generator

defmethod grid (g:GridPlanner) -> Seq<GridPosition>

  • Returns Seq<GridPosition>

This default implementation creates either a regular or irregular grid leveraging the grid-locs function.

Functions

GridPlanner

Construct GridPlanner with Anchor

public defn GridPlanner ( -- pitch:Double|Dims, columns:Int, rows:Int, anchor:Anchor) -> GridPlanner

  • Returns GridPlanner

StaggerPhase

Stagger Phase Definition

public defenum StaggerPhase <: Equalable & Hashable

This type is used to construct Staggered Grid implementations. The phase indicates whether the first row pad 0 is empty or populated.

In the following examples, the X indicates a location where the pad is not populated. An O indicates a location where the pad is populated.

Pattern #1 - Odd-Phase :

  X | O | X  ...
  O | X | O  ...
  ...

Pattern #2 - Even-Phase :

  O | X | O  ...
  X | O | X  ...
  ...

Functions

stagger-pattern

Stagger Pattern for Marking Active Pads

public defn stagger-pattern (phase:StaggerPhase, row:Int, column:Int) -> True|False

  • phase: StaggerPhase - This indicates the ordering of when a location is populated or not.
  • row: Int - Row index (zero-based)
  • column: Int - Column index (zero-based)
  • Returns True|False

This function is a re-usable pattern generator for the staggered phase grid approach.

GridPosition

public defstruct GridPosition
    column: Int
    pose: Pose
    row: Int

  • column: Int

  • pose: Pose

  • row: Int

Constructors

GridPosition

Constructor for defstruct GridPosition

public defn GridPosition (row:Int, column:Int, pose:Pose)

Multis

grid

Grid Generator

public defmulti grid (g:GridPlanner) -> Seq<GridPosition>

  • g: GridPlanner - This Grid Planner
  • Returns Seq<GridPosition> - The generated grid consists of GridPosition objects which provide the row index, column index, and a Pose object for identifying the location of that grid position.

This method constructs a sequence of Pose locations for the desired grid.

This method must be implemented by the derived grid type to generate this sequence.

Methods

grid

Default Grid Generator

defmethod grid (g:GridPlanner) -> Seq<GridPosition>

  • Returns Seq<GridPosition>

This default implementation creates either a regular or irregular grid leveraging the grid-locs function.

General Definitions

equilateral-triangle-pitch

Construct the asymmetric pitch for an equilateral triangle grid.

public defn equilateral-triangle-pitch (p:Double) -> Dims

  • p: Double - Side length of the equilateral triangle.
  • Returns Dims - A two dimensional pitch where the row pitch is the height of an equilateral triangle and the col span is p / 2.0. Every skipped pad in a stagger-pattern creates a full length side of the equilateral triangle.

This function assumes that you will use the stagger-pattern for constructing the active pads.

This constructs a pad pattern in the form of a grid where every 3 pads creates a equilateral triangle.

Related Packages

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