← Back to community index
# contributor·Active

Seve - @Abse bitmap probing

If the ai isnt populating internallyConnectedPins, then we should warn when a pushbutton has four pins and doesn’t explicitly say internallyConnectedPins

Started by SeveJul 3, 202699 messages

Discussion

Last active 8 days ago · plain text
Seveoriginal post
If the ai isnt populating internallyConnectedPins, then we should warn when a pushbutton has four pins and doesn’t explicitly say internallyConnectedPins
Seve
Standard missing prop warning
Abse
ok on which repo should this warning be , also we are using chips for the imported pushbuttons how can we detect if it's a pushbutton ?
Abse
circuit json to gerber does not have gerber rasterization to pixels
Seve
Svg to png is fine
Seve
Core
Seve
Pushbuttons should be imported with the name <pushbutton /> or <switch /> when imported from jlcpcb
Seve
If a user specifies the name as PB* or SW* but they use a chip- we should warn about reference designator convention (which needs a new circuit JSON warning)
Abse
ok I'm lost haha , should I start with easyeda converter to make sure we use pushbutton or switch componet when importing ?
Seve
Yea i mean all these things have to come together
Seve
You can start anywhere but the methodology is just to warn the user to add precision until we fully understand how the chip is configured
Seve
Its like in typescript- you can keep adding types until you fully pass typecheck or you can ignore them
Abse
ok for the svg to png should we use @resvg/resvg-js ?
Seve
Use @tscircuit/image-utils if possible? If not yea
Seve
I think image utils handles the browser/node issues
Seve
Because you have to use wasm sometimes for it to run in browser
Seve
We should have an svg to png in image utils for sure that manages all the annoying compat issues
Abse
@tscircuit/image-utils don't do svg to png on it's own
Abse
Shared an attachment
Seve
Yea maybe expose it from image utils
Abse
ok
Seve
It might be easier to use resvg just to get things moving
Abse
we should do @tscircuit/image-utils/resvg
Abse
I can start it
Seve
Yea its not very dangerous because all the exports have their own folder
Seve
So i dont see how you could break things
Seve
Idk also
Seve
Bundling can be weird with wasm
Abse
your scaring me haha , is it a vital dep that can break things ?
Seve
So you might want to use the wasm version only
Seve
It cant break things because you have a subdir
Seve
@tscircuit/image-utils/resvg
Seve
But like, resvg-js doesnt work in browsers
Abse
so we need a good repro and prove that we fixed it
Seve
Maybe just focus on the gerber stuff haha
Seve
Yea
Seve
Rushabh did some work on this cc <@452450065941004289>
Abse
ok so I will go with resvg for this pr and we can make it cleaner with time ig ?
Seve
Yea
Seve
Otherwise you would need to use playwright and check bundle sizes which is annoying
Seve
I think resvg is great but i think we could probably create a slower clone of it that is vanilla js
Seve
That works for our subset of svgs
Seve
Eventually
Abse
<@757706909351411845> https://github.com/tscircuit/check-shorts/pull/5 I used resvg and tried to split code into smaller files
Abse
also `<switch /> ` doesn’t take `pinLabels` the way `<chip /> ` and `<pushbutton />` do
Abse
should we add it ? to make the import possible with <switch / > ?
Seve
Yea for sure we should add it
Seve
pinLabels on everything mosy
Abse
still messing the <switch / > with pinLabels will add then tag you for review
Abse
https://github.com/tscircuit/easyeda-converter/pull/402
Abse
<@757706909351411845> `source_simple_switch` is extending `source_component_base` , should we add pin labels there ?
Seve
pinLabels is a props thing
Abse
omg haha I'm lost
Abse
```tsx export interface CommonComponentProps<PinLabel extends string = string> extends CommonLayoutProps { key?: any name: string displayName?: string datasheetUrl?: string pinAttributes?: Record<PinLabel, PinAttributeMap> supplierPartNumbers?: SupplierPartNumbers cadModel?: CadModelProp kicadFootprintMetadata?: KicadFootprintMetadata kicadSymbolMetadata?: KicadSymbolMetadata children?: any symbolName?: string doNotPlace?: boolean /** * Allows the PCB component to hang off the board (e.g. for USB ports or displays) */ allowOffBoard?: boolean /** * Does this component take up all the space within its bounds on a layer. This is generally true * except for when separated pin headers are being represented by a single component (in which case, * chips can be placed between the pin headers) or for tall modules where chips fit underneath. */ obstructsWithinBounds?: boolean /** * Whether to show this component's CAD model as translucent in the 3D viewer. */ showAsTranslucentModel?: boolean mfn?: string manufacturerPartNumber?: string /** * This component will be drawn as part of this section e.g. "Power" */ schSectionName?: string /** * This component will be drawn as part of this sheet e.g. "Main" */ schSheetName?: string } ```
Abse
we don't want pinlables to be added to CommonComponentProps ?
Seve
Probably
Abse
probably no ?
Abse
so we only add it to switch props ?
Seve
Probably yes but idk
Seve
I think so
Seve
Idk why we havent
Abse
ok will add it to CommonComponentProps
Abse
<@757706909351411845> can we merge this ?
Abse
https://github.com/tscircuit/check-shorts/pull/5
Seve
Yea go nuts
Seve
Ill do a more comprehensive review of the repo at some point but as long as there are readable analysis pngs ur probably good
Abse
sg
Abse
<@757706909351411845> We’re adding pinLabels to common component props so <switch /> can use the same pin label map style as <chip />. I moved the shared pin label type/parser out of chip.ts into common code, then had both chip and common props use it. Chip keeps the same exports, so nothing should break. pin-header stays special because it also supports array labels like ["VCC", "GND"].
Abse
should all support array labels like ["VCC", "GND"] ? or just keep it for pin headers only
Seve
kk
Seve
uhh
Seve
so one thing i'd be cautious about is certain elements have more precise pinLabels
Seve
that might be why it's separated
Seve
we want to make sure we're still able to do type autocomplete i think
Seve
i like the idea of introducing a side1/side2 alias for pushbuttons 🤔
Seve
i.e. pinLabels={{ side1: "..." }} might be type safe for some types of elements
Seve
i can't remember
Seve
i mean fwiw you could just quickly add pinLabels to switch or pushbutton if there's a type issue and we can just figure out the design later
Abse
https://github.com/tscircuit/props/pull/717
Abse
<@757706909351411845> https://github.com/tscircuit/core/pull/2580
Abse
<@757706909351411845> what is the concern with the PR?
Seve
How do we map pin numbers to the symbol ports
Abse
I'm not sure, I can check tomorrow? I went to bed, although I thought this was handled before in core I just updated the package and made the test
Seve
Yea its ok- just preparing for a future issue
Abse
So what should I change to make this acceptable to merge?
Abse
I couldn't sleep thinking about this 🤣
Seve
It’s OK to merge, but we’re probably gonna have to change it and we should keep that in mind
Seve
We need to make sure that when the JC footprints come in that we’re able to match them so that the symbol is correct
Seve
The schematic symbol
Abse
<@757706909351411845> eval is not updated in tscircuit https://github.com/tscircuit/tscircuit
Abse
Shared an attachment
Seve
hmm
Seve
i thought we were creating auto-merge prs for these changes
Seve
i just added tscircuitbot being able to bypass that rule- but this repo isn't set up like our other repos that require a pull request
Seve
CC <@809856037376491570>
Abse
<@757706909351411845> <@809856037376491570> https://github.com/tscircuit/tscircuit.com/pull/3831
Abse
<@757706909351411845> https://github.com/tscircuit/easyeda-converter/pull/405
Abse
one of the gameboy diodes had (_NEG) we need this to only let a-z 0-9 and + - only

Want to add to the conversation?

Reply in Discord so your notes stay connected to the source.
Continue in Discord ↗