Hooks
DeviceLayout.Hook — Typeabstract type Hook{T} <: AbstractGeometry{T}Contains information describing how one component can attach to others.
DeviceLayout.PointHook — TypePointHook(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.
DeviceLayout.HandedPointHook — TypeHandedPointHook{T} <: Hook{T}
h::PointHook{T}
right_handed::BoolA 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.
DeviceLayout.Paths.p0_hook — Functionp0_hook(pa::Path) = PointHook(p0(pa), α0(pa))A PointHook looking into the start of path pa.
DeviceLayout.Paths.p1_hook — Functionp1_hook(pa::Path) = PointHook(p1(pa), α1(pa) + π)A PointHook looking into the end of path pa.
DeviceLayout.in_direction — Functionin_direction(h::Hook)The inward-pointing direction stored by the PointHook (angle CCW from the positive x axis)
DeviceLayout.out_direction — Functionout_direction(h::PointHook)The outward-pointing angle opposite to the direction stored by the PointHook
DeviceLayout.Paths.path_in — Functionpath_in(h::PointHook)A Path starting at h, pointing along its inward direction.
DeviceLayout.Paths.path_out — Functionpath_out(h::PointHook)A Path starting at h, pointing along its outward direction.
DeviceLayout.transformation — Methodtransformation(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).
DeviceLayout.compass — Functioncompass(;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.)