Hooks

DeviceLayout.HookType
abstract type Hook{T} <: AbstractGeometry{T}

Contains information describing how one component can attach to others.

source
DeviceLayout.PointHookType
PointHook(p::Point, in_direction)
PointHook(x, y, in_direction)

Hook defined by a point and a direction (an angle CCW from the positive x axis).

Attaching two PointHooks will match the points, oriented so the angles are opposite. By convention, hooks point inward.

source
DeviceLayout.HandedPointHookType
HandedPointHook{T} <: Hook{T}
    h::PointHook{T}
    right_handed::Bool

A PointHook augmented with handedness.

In addition to translation and rotation, which are used to fuse one PointHook to another, a HandedPointHook being fused to another HandedPointHook will apply a reflection if necessary to match its handedness.

source
DeviceLayout.in_directionFunction
in_direction(h::Hook)

The inward-pointing direction stored by the PointHook (angle CCW from the positive x axis)

source
DeviceLayout.transformationMethod
transformation(h1::Hook, h2::Hook)

Return a CoordinateTransformation to align h2 to h1.

Given hooks h1, h2 relative to CoordinateSystems h1cs, h2cs respectively, if you reference h2cs inside h1cs with push!(h1cs.refs, sref(h2cs, origin, rot=rotation, xrefl=xrefl)), then relative to h1cs, h2 will lie on top of h1 with its in_direction pointing opposite to that of h1 (and matching handedness, if applicable).

source
DeviceLayout.compassFunction
compass(;p0=Point(0μm, 0μm))

An 8-point compass of PointHooks at p0.

The NamedTuple (:east = PointHook(p0, 0°), :northeast = PointHook(p0, 45°), ... for all cardinal and primary intercardinal directions (every 45°). (The in_direction of each hook points in its compass direction.)

source