Repository navigation
Painters, aliases, configurations and the new PHYSICS types - #3
Merged
Merged
Conversation
PAINTER <name> draws a part's body with a painter the app registers under that name, in place of an SVG. Only the drawing is code: pins, properties, behaviour and physics stay in the .pdl, and VISUALS still draw over it. It is for artwork that arrives as vector paths from a design tool rather than as an SVG file. A part now needs an SVG, a PAINTER or VISUALS, and SVG with PAINTER is rejected since both would draw the body. ALIAS "<name>", repeatable, is another name a part answers to, so a renamed part's old .cdl type token still resolves. PDL.md documents both, and its complete example is the LDR again, now drawn by a PAINTER and aliased to the Photoresistor it shipped as. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
A bipolar transistor maps `c`, `b`, `e` and a MOSFET `d`, `g`, `s`; a part's numeric PHYSICS parameters are SPICE model parameters over the engine's defaults, so `bf = 300` makes a higher-gain part. PDL.md documents them, lists the four transistor parts, and notes that one PAINTER can serve several parts, as the transistors' does. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
A Darlington maps `c`, `b`, `e` like one bipolar transistor and is built as two, the first driving the second's base, with a resistor across each base-emitter junction as in a TIP120 (`r1`, `r2`). PDL.md documents them, notes that the power MOSFET parts are plain `nmos`/`pmos` with their own `vto` and `kp`, and lists the TO-220 parts and their shared PAINTER. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
`rgbLed` maps three anodes, `r`, `g`, `b`, and their shared cathode `k`: a common-cathode RGB LED built as three measured dies, so a LOGIC reads each colour's current at its pin. PDL.md documents it, lists the electrolytic capacitor and the RGB LED among the bundled parts, and notes that a PAINTER receives the part's state, which is how the RGB LED's lights up. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
A `diode` part's numeric PHYSICS parameters (`is`, `n`) are now its SPICE model numbers. PDL.md lists the 1N4007 rectifier and 1N5819 Schottky beside the 1N4148, and their shared axial-diode PAINTER. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
`spdt` maps a common pole `c` and throws `a` and `b`: two resistors, one closed and one open, swapped by a single alterable `position` (0 for a, 1 for b), so a `physics.position` rule throws it mid-run. PDL.md lists it and the slide_switch_spdt part. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
`ledArray` is any number of LED dies on one cathode: every mapped role but `k` is a die from its pin to the cathode, measured like a single LED, and another `k…` role is a second cathode pin tied inside. `is` and `n` set the dies' model; red by default. PDL.md documents it and lists the seven_segment part. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
A CONFIGURATION <property> "<option>" block starts one configuration of a part picked by an enum property: the transistor that is NPN, PNP or a MOSFET by its Type. Lines before the first block are shared; each block is read as the shared lines followed by its own, so it adds pins, rules and parameters, and its single-value directives replace shared ones. Other blocks' lines are blanked rather than removed, so diagnostics keep their real line numbers, and a problem on a shared line is reported once. Each configuration parses to a complete PartDefinition with an ID of its own and a PartConfiguration naming the part, the property and its option; the property defaults to that option on it. PdlParseResult gains definitions, every configuration in option order, with definition the default one. The parser rejects a block without an ID, an option without a block, a block for no option, and a non-enum choosing property. PDL.md documents it, and lists the shipped transistor as one part. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
The format work behind PinBench's new parts (PinBench/pinbench#8).
PAINTER: a part can draw its body with a Dart painter instead of SVG, and answer toALIASnames (the LDR asPhotoresistor)..pdlcan describe a part in several configurations — the transistors are one part picked by its Type.npn,pnp,nmos,pmos; DarlingtonnpnDarlington/pnpDarlington;rgbLed;spdt(slide switch);ledArray(7-segment display); diode model parameters.dart test: 66 passing. PinBench'spinbench_partsandpinbench_simresolve this package frommain, so their CI needs this merged.🤖 Generated with Claude Code