← Back to community index
# contributor·Active

Seve - The traces arent correctly routing in th...

The traces arent correctly routing in this doc with assignable vias, can someone take a look? The traces are missing segments (cc mention ) https://docs.tscircuit.com/guides/tscircuit essentials/using viagrid prefabricated vias with autorouter

Started by SeveJun 13, 202677 messages

Discussion

Last active 19 days ago · plain text
Seveoriginal post
The traces arent correctly routing in this doc with assignable vias, can someone take a look? The traces are missing segments (cc <@809856037376491570> ) https://docs.tscircuit.com/guides/tscircuit-essentials/using-viagrid-prefabricated-vias-with-autorouter
Abse
Shared an attachment
Abse
which has a messing sgement ?
Abse
the one in the bottom looks like its doing 180 deg turn
Rishabh
Yeah, something looks weird. I am taking a look
Abse
let me know if u want me to take a look
Rishabh
<@757706909351411845> It's because of effortLevel, I removed the `10x` effortLevel and it solves correctly
Rishabh
Something with the effortLevel is causing this bug
Rishabh
I am removing that prop from the doc now, and taking a look into the bug
Seve
Hmm strange
Abse
<@809856037376491570> https://github.com/tscircuit/footprinter/pull/659
Abse
<@757706909351411845>
Abse
<@809856037376491570> https://github.com/tscircuit/kicad-mod-cache/pull/24
Abse
I used eval in the dev dep to render the foot print generated from this pr is this a good repro for the issue ?
Abse
or can u give me a better way if this is not the right way
Rishabh
Yeah, I don't like this. This test was failing in eval. So, just use that footprint string and snapshot the test output
Rishabh
This was gettting flipped, just make sure that footprint's silkscreen text is not getting flipped
Abse
so the issue is not the kicad-mod-cache ?
Rishabh
No
Abse
oh ok mb
Abse
I will check it rn
Abse
<@809856037376491570> I managed to repro in eval and this should fix the issue in kicad to circuit json https://github.com/tscircuit/kicad-to-circuit-json/pull/150
Abse
but not sure if we can push the kicad mod code to our repo ?
Abse
maybe copyrighted, I can remove it after u take a look
Abse
<@809856037376491570> wehn u got time plz take a look
Rishabh
Taking a look
Rishabh
After you merge the kicad-mod-cache migration PR, also run the test Ci in eval after that
Abse
OK
Abse
can we merge the kicad mode code or I should remove it ?
Rishabh
Remove it I guess
Abse
k
Abse
<@809856037376491570> can I get another review on this so we can merge https://github.com/tscircuit/kicad-mod-cache/pull/24
Abse
<@809856037376491570> https://github.com/tscircuit/kicad-mod-cache/pull/24
Abse
<@809856037376491570> can I get a reivew ?
Abse
<@809856037376491570> so the text is bigger now for kicad Ref In kicad-to-circuit-json, the footprint text path does: const fontSize = kicadFontSize * KICAD_TEXT_HEIGHT_TO_CIRCUIT_JSON_FONT_SIZE `The old kicad-component-converter used the KiCad font size directly: font_size: fp_text.effects?.font?.size[0] ?? 1` So a KiCad silkscreen ref text with size 1 used to become font_size: 1, but now becomes font_size: 1.5. The reason in the new converter is documented in its comment: it is trying to be inverse-compatible with circuit-json-to-kicad, which apparently divides by 1.5 when going the other direction.
Abse
should we change kicd to circuit json to use the kicad font size or keep the current 1.5 ?
Rishabh
I think we should keep the size to be inverse compatible. Not so sure. <@757706909351411845> ?
Seve
Hmm, i dont really know whats reasonable here but if you convert kicad to circuit json it should be the right size in the snapshot (after unit conversions)
Seve
Anything else is strange no?
Abse
<@809856037376491570> I think I should just make the font as it was before ( that looks better imo)
Rishabh
but also figure out why the conversion scale is not 1.5 times, this might become an annoying bug
Abse
why do we sacle the text I'm not sure ?
Abse
https://github.com/tscircuit/kicad-to-circuit-json/pull/154
Abse
also can u review <@809856037376491570>
Rishabh
Scaling text makes sense for the schematic's cause what we see in our schematic viewer and what we see in the schematic's in the A3 size or something then it does needs scaling
Abse
I see so will this create bugs later for sch ?
Rishabh
I am not sure, run tests
Abse
we have another issue <@809856037376491570> Some KiCad cache requests return 500 Internal Server Error during footprint conversion. Example failing URLs: https://kicad-mod-cache.tscircuit.com/Package_TO_SOT_SMD.pretty/SOT-23-3.circuit.json https://kicad-mod-cache.tscircuit.com/Package_SO.pretty/SOIC-8_3.9x4.9mm_P1.27mm.circuit.json should we Update kicad-to-circuit-json so fp_poly parsing does not require uuid or tstamp. If both are missing, generate a deterministic fallback id from the polygon data, Then update the cache service to use the fixed converter ?
Rishabh
Yeah, repro this inside `kicad-to-circuit-json` and then create a fix for it
Rishabh
After that update the kicad-mod-cache
Abse
<@809856037376491570>
Abse
https://github.com/tscircuit/kicad-to-circuit-json/pull/155
Abse
bun linked to kicad mode cashe and tested it works
Abse
<@809856037376491570> turns out the issue is in kicadts rejects valid KiCad fp_poly nodes that lack both uuid and tstamp
Abse
should we make FpPoly.fromSexprPrimitives allow missing uuid/tstamp, same as KiCad itself does ?
Abse
Shared an attachment
Abse
wdyt ?
Abse
but should we generate a random id or not <@809856037376491570> <@757706909351411845>
Abse
or just parse it without one
Rishabh
Yeah, kicadts should be the place where you should be fixing it. Don't generate one
Rishabh
The file is the source of truth, don't add anything extra
Abse
ok sounds good
Abse
<@809856037376491570> https://github.com/tscircuit/kicadts/pull/55
Abse
<@809856037376491570> can i get another review on this ty https://github.com/tscircuit/kicad-to-circuit-json/pull/155
Abse
<@809856037376491570> https://github.com/tscircuit/kicad-mod-cache/pull/27
Abse
<@809856037376491570> <@757706909351411845> I checked the difference between the old `tscircuit/kicad-component-converter` and the current `kicad-to-circuit-json` parsing for KiCad reference text. The old converter had special handling for the font size of `property "Reference"` text. Instead of using the property’s own KiCad font size, it looked at `fp_text` entries: - Prefer reference-like `fp_text` on `F.SilkS` - If not found, fall back to reference-like `fp_text` on `F.Fab` - Use that `fp_text.effects.font.size` as the font size for the emitted `pcb_silkscreen_text` That matters for footprints like `R_0402_1005Metric`, where KiCad has: - `property "Reference" "REF**"` on `F.SilkS` with `(size 1 1)` - `fp_text user "${REFERENCE}"` on `F.Fab` with `(size 0.26 0.26)` The old converter would use `0.26` from the `${REFERENCE}` `fp_text` fallback. The current `kicad-to-circuit-json` preserves the `property "Reference"` font size directly, so it emits `pcb_silkscreen_text` with `font_size: 1`. Then `@tscircuit/core` consumes that footprint text and adds `+0.2` via `_footprinterFontSize = elm.font_size + 0.2`, making the rendered refdes `1.2mm`. That’s why example 18’s `R1` is much larger now. So the core behavior difference is: Old converter: `property Reference` font size came from small reference-like `fp_text`, often `0.26`. New converter: `property Reference` font size comes from the KiCad property itself, often `1`. This is why the ref text changed size after moving to `kicad-to-circuit-json`.
Abse
should we change kicad to circuit json to do the same ?
Abse
on the left is when we used kicad component converter
Seve
this is a nice analysis, i mean what does this look like in kicad? I think KiCad has ridiculously large fab text
Seve
if kicad has giant fab text, then the right side with the large fab text is correct
Seve
likewise, silkscreen is often much bigger than people would expect for small components. This is because silkscreen often cannot print very small
Seve
so ultimately the answer is however kicad displays it!!!
Abse
I will check kicad but I do believe big is right , u can also ask Sangit when debugging the pico small fps like 0402 silkscreen in unreadable
Abse
kicad is using big font
Abse
<@757706909351411845>
Seve
Then thats it
Abse
sounds good, will see if anything needs updating

Want to add to the conversation?

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