components module#
One walk of the design, feeding both fab files.
The BOM and the pick-and-place file are generated from the same records on purpose. JLCPCB only recognises a component that appears in both, and a designator in one and not the other is a documented upload failure, so the two files are built from one enumeration rather than from two walks that have to be kept in agreement.
- DEFAULT_ORIENTATION = 0.0#
Correction applied to a component with no explicit orientation, in degrees.
Zero, deliberately. There is no single offset between JITX’s landpattern generators and the orientation JLCPCB takes as zero: measured against their placement preview on one board, an SOIC-8 needed -90, a 0603 LED needed +90, and a through-hole header needed something else again. A part’s zero is its tape-and-reel orientation, which is a property of the catalogue part rather than of the landpattern it is placed on, so no constant can be right for all of them.
A revision of this file did default to -90, from an observation that every part on one board needed turning 90 degrees clockwise. That observation was confounded: the board’s chip resistors are symmetric under a half turn and so look correct at either value, and its header turned out to be the wrong part. Correcting by a constant that is right for one package and 180 degrees wrong for another is worse than correcting nothing, because a wrong rotation that looks deliberate survives review.
So corrections are per part, via LCSCPart(orientation=…), and are measurements rather than guesses. The order sheet lists every part relying on this default so the placement preview has a checklist.
- class Part(designator, comment, footprint, lcsc, x, y, rotation, side, through_hole, footprint_guessed, orientation_default)[source]#
Bases:
objectOne component, as both fab files need it.
- Parameters:
- footprint_guessed: bool#
The footprint came from a landpattern class name, which JLCPCB will most likely flag with a package-verification warning.
- class Inventory(parts, not_soldered)[source]#
Bases:
objectEverything the packet says about the design’s components.
- rotation(degrees, side)[source]#
The pick-and-place rotation for a placement, counter-clockwise.
Top side is the placement rotation. Bottom side is its negation, which is the conversion between JITX’s frame and the one JLCPCB’s recommended KiCad plugin emits: JITX composes a placement as R(r) . diag(sx, sy) and a bottom placement sets sx = -1, so a bottom part is R(r) . diag(-1, 1). The plugin’s frame mirrors about the other axis, R(t) . diag(1, -1), and diag(-1, 1) = R(180) . diag(1, -1), so t = r + 180. The plugin writes 180 - t, which is -r.
This is emphatically not 180 - r: the two differ by 180 degrees at every angle. See plans/jlcpcb-export-plan.md section 5.4.