Ray Kholodovsky - <trace from=".R1 > .pin...

<trace
from=".R1 > .pin1"
to=".MP1 > .pin1"
width="0.2mm"
/>
<trace
from=".R1 > .pin1"
to=".MP1 > .pin1"
width="0.2mm"
/>
this doesn't appear to be making a trace at all? and width is giving me an error? trying to follow basic docs here: https://docs.tscircuit.com/elements/trace#net-vs-direct-connections
<trace /> | tscircuit docs
The <trace /> element represents an electrical connection between two or more points in your circuit. Traces can connect components, nets, or specific pins on components.
No description
No description
No description
No description
88 Replies
Seve
Seve2mo ago
because it's packed so tightly, the autorouter is probably confused (unfortunately) I would specify the trace manually for this particular case https://docs.tscircuit.com/elements/trace#manual-pcb-paths
<trace /> | tscircuit docs
The <trace /> element represents an electrical connection between two or more points in your circuit. Traces can connect components, nets, or specific pins on components.
Ray Kholodovsky
Ray KholodovskyOP2mo ago
ok so the trace is rendering after all, and it's just this error with width which does not appear to be respected
No description
No description
Seve
Seve2mo ago
width is only respected with the autorouter="auto-cloud" right now (which uses freerouting). trace width isn't supported yet with the tscircuit autorouter in general freerouting is a bit more deterministic since it's non-topological
Ray Kholodovsky
Ray KholodovskyOP2mo ago
oh ok. is there any way I can make things really dumb cuz in this case I literally just need a straight line from A to B with a certain width
Seve
Seve2mo ago
yea i would use pcbPath you'll just need to specify pcbPath={[{x:0,y:0 }, {x:1,y:0}]}
Ray Kholodovsky
Ray KholodovskyOP2mo ago
right, and per our earlier convo there's no way that I can query MP1 x and y center positions or more specifically MP1 pin1 center pos to make that easier ?
Seve
Seve2mo ago
so because the pcbPath is relative to the pad, I think in this case you would just need to have the x: traceLength and it should be correct. there is a feature called route hints that does what you want but yea probably not working with our autorouter There are basically two issues here, the tscircuit-autorouter doesn't know what to do with overlapping pads and doesn't support trace width
Ray Kholodovsky
Ray KholodovskyOP2mo ago
There are basically two issues here, the tscircuit-autorouter doesn't know what to do with overlapping pads and doesn't support trace width
right, and I actually see those 2 errors for overlap but it's ok for us. It's important to know when to ignore DRC errors 🙂
No description
Seve
Seve2mo ago
hmm i don't even think it should be throwing those if they are specified as connected 🤔
Ray Kholodovsky
Ray KholodovskyOP2mo ago
they aren't specific as connected beyond the <trace I am trying to do. do I have to do some net thing first?
Seve
Seve2mo ago
no doing the trace should be enough seems like a bug where the connectivity of pads isn't considered for overlap i mean technically there could be a CAD/Assembly issue but the error should be related to assembly in that case alright 3 issues
Ray Kholodovsky
Ray KholodovskyOP2mo ago
pcbPathRelativeTo=".MP1 > .pin1"
pcbPath={[
{ x: 0, y: 10 },
]}
pcbPathRelativeTo=".MP1 > .pin1"
pcbPath={[
{ x: 0, y: 10 },
]}
so just trying to draw any trace to see if this pcbPath works and it doesn't like my RelativeTo MP
No description
Ray Kholodovsky
Ray KholodovskyOP2mo ago
No description
Ray Kholodovsky
Ray KholodovskyOP2mo ago
fixed my syntax mistakes to best of my ability.
No description
Ray Kholodovsky
Ray KholodovskyOP2mo ago
the "port" is the in between guy that my MP is missing? but I do have a plated hole. so it shouldn't not work
return (
<chip
footprint={
<footprint>
<platedhole
portHints={["1"]}
pcbX="0mm"
pcbY="0mm"
outerDiameter={holeOD}
holeDiameter={holeID}
shape="circle"
/>
<silkscreentext
pcbX={0}
pcbY={0}
anchorAlignment="center"
fontSize={0.5}
text={props.name}
/>

</footprint>
}


cadModel={<cadmodel modelUrl={glbPath} modelUnitToMmScale={1000} ////rayfix hardcoded modelUnitToMmScale={1000}
positionOffset={{ x: 0, y: 0, z: 0.2 }} />} //rayfix hardcoded z+ offset for 1.6mm pcb thickness assumed for now


{...props}
/>
)
return (
<chip
footprint={
<footprint>
<platedhole
portHints={["1"]}
pcbX="0mm"
pcbY="0mm"
outerDiameter={holeOD}
holeDiameter={holeID}
shape="circle"
/>
<silkscreentext
pcbX={0}
pcbY={0}
anchorAlignment="center"
fontSize={0.5}
text={props.name}
/>

</footprint>
}


cadModel={<cadmodel modelUrl={glbPath} modelUnitToMmScale={1000} ////rayfix hardcoded modelUnitToMmScale={1000}
positionOffset={{ x: 0, y: 0, z: 0.2 }} />} //rayfix hardcoded z+ offset for 1.6mm pcb thickness assumed for now


{...props}
/>
)
under the hood this is what MP is built as so there is chip --> footprint -->plated hole
Ray Kholodovsky
Ray KholodovskyOP2mo ago
basic traces do appear once I rotated it some.
No description
Seve
Seve2mo ago
Not ideal. Are you looking for a particular shape btw, im working on a repro for this in the repo
Ray Kholodovsky
Ray KholodovskyOP2mo ago
btw I think even with the overlapping pads traces are still being drawn, they were just impossible to see (without more width) in the original horizontal case.
No description
Ray Kholodovsky
Ray KholodovskyOP2mo ago
a straight line is all I need here in the original horizontal case
Seve
Seve2mo ago
Okay thats better than missing I think we could potentially support selectors inside pcbPath That actually seems pretty nice imo so you would literally say pcbPath={[{x:0,y:0}, "MP1.pin1"]}
Ray Kholodovsky
Ray KholodovskyOP2mo ago
inspecting json, I do get traces for each (I think) pic1, 10 deg rot
No description
Ray Kholodovsky
Ray KholodovskyOP2mo ago
pic2, back to original horizontal no rot
No description
Seve
Seve2mo ago
fwiw schematic_trace is different you need to find the pcb_trace, not source_trace or schematic_trace it's set up like a SQL database with relational tables, that's why there's different objects for different things it can be hard to find the appropriate one sometimes
Ray Kholodovsky
Ray KholodovskyOP2mo ago
oh. source trace is described as pcb_trace hence my confusion
Seve
Seve2mo ago
yea it has references internally
Ray Kholodovsky
Ray KholodovskyOP2mo ago
oh right so I just opened the wrong thing for pic 2
No description
Ray Kholodovsky
Ray KholodovskyOP2mo ago
pcb_trace inside source_trace
Seve
Seve2mo ago
That title is weird
Ray Kholodovsky
Ray KholodovskyOP2mo ago
they appear to be there even in horizontal case. both cases have overlap
Seve
Seve2mo ago
Bug in the json viewer…
Ray Kholodovsky
Ray KholodovskyOP2mo ago
No description
Ray Kholodovsky
Ray KholodovskyOP2mo ago
see bottom of white screen: source_trace_0_0 is indeed what I found / opened I would ideally want to say pcbPath={[ {R1.pin1}, "MP1.pin1"] } to indicate a straight line from A to B
Seve
Seve2mo ago
Yea That seems good Ok we’ll make it happen, shouldn’t take long
Ray Kholodovsky
Ray KholodovskyOP2mo ago
ok so 3 or more issues 🙂
Seve
Seve2mo ago
Ill bet @Stéphane Alnet would like this syntax as well
Ray Kholodovsky
Ray KholodovskyOP2mo ago
also, it looks like the tscircuit built in router defaults to 0.15mm traces, is there something very "hardcoded built into the logic" like training on that specific size? or could you just pass width down to it somewhat easily?
Seve
Seve2mo ago
The hyperparameters for a topological autorouter have to be calibrated for approximate trace widths, we only calibrated for 0.15 atm. We have a couple operations like “trace inflation” that should allow us to have mixed trace widths
Ray Kholodovsky
Ray KholodovskyOP2mo ago
understood
Stéphane Alnet
Stéphane Alnet2mo ago
I cheated, I used {x:0,y:0} to get straight paths 😉
Seve
Seve2mo ago
pcbPath with selectors is now supported !
No description
Ray Kholodovsky
Ray KholodovskyOP2mo ago
I’m trying to get a better handle on ports and port selectors so I’m reading this: https://docs.tscircuit.com/guides/tscircuit-essentials/port-and-net-selectors I’m confused about whether a component can have a port , like is that the thing that’s in the middle of ".R1 > .pin1" that > is allowing you to skip over ?
Port and Net Selectors | tscircuit docs
Selectors are a string used to reference a port, net or any component. They're most
Seve
Seve2mo ago
It's CSS selector syntax, I would keep it simple and use the shorthand "R1.pin1" which means "Component name R1 and port name pin1" it works for any port name e.g. U1.VCC > means "direct child of" the "." means "with a class name of" our shorthand syntax is not a valid CSS selector, but ai was hallucinating the short form syntax so much we added it
Ray Kholodovsky
Ray KholodovskyOP2mo ago
right, that is simple and makes the most sense I was using > because a lot of examples have that, and because in my debugging view the popover shows the in between guy between MP1 and pin1 , for example. Bu direct child means that > isn't a bridge over the middle guy?
means "direct child of" the "." means "with a class name of"
I read the docs 🙂
Ray Kholodovsky
Ray KholodovskyOP2mo ago
so the simplest question is do I have to address the .unnamed_platedhole_1 in between there or can I still say MP1.pin1 ?
No description
Seve
Seve2mo ago
in this case, it's saying that both selectors are valid but it shouldn't even show the unnamed selector 🤦‍♂️
Ray Kholodovsky
Ray KholodovskyOP2mo ago
Ok so that was the cause of my confusion. I don’t think it was “Ray needs CSS fundamentals lesson” - although, appreciated, and the docs you quoted are super helpful and relevant I was trying to understand what a port means in the context of a component in your world. Cuz in kicad equivalent, my screenshot above would be interpreted as: “MP1 is a footprint” The footprint contains a “pad” which in this case is a plated hole. The plated hole has a pin, 1 pin, named “pin1” or whatever (I’m going off memory and will double check this at computer shortly)
Seve
Seve2mo ago
yea this is changing soon currently going upstream it's not going to show unnamed etc.
Ray Kholodovsky
Ray KholodovskyOP2mo ago
Ok cool beans then the pedantia doesn’t matter 🙂 ok revisiting this to see if any progress and
<trace
from="R1.pin2"
to="MP2.pin1"
/>
<trace
from="R1.pin2"
to="MP2.pin1"
/>
<trace
from="R1.pin2"
to="MP2.pin1"
pcbPathRelativeTo="MP2.pin1"
pcbPath={["R1.pin2"]}
/>
<trace
from="R1.pin2"
to="MP2.pin1"
pcbPathRelativeTo="MP2.pin1"
pcbPath={["R1.pin2"]}
/>
these both give me the same result, and width="0.4mm" still appears to be an unsupported property. Is there a way I can set a width for a manually defined trace now?
Ray Kholodovsky
Ray KholodovskyOP2mo ago
No description
Seve
Seve2mo ago
!trace width is supposed to be supported! taking a look can you try thickness
Ray Kholodovsky
Ray KholodovskyOP2mo ago
no error but I don't see any change
No description
Seve
Seve2mo ago
ok i'm on it ASAP ok so this is dumb but if you add the start and end to your pcbPath (e.g. pcbPath={["R1.pin2", "MP2.pin1"]}) it will work i'm patching this but 🤷 that's why it is working in our tests, apparently if a pcbPath doesn't contain 2+ we don't use it(?)
Ray Kholodovsky
Ray KholodovskyOP2mo ago
I don't see a difference
No description
Ray Kholodovsky
Ray KholodovskyOP2mo ago
tried with and without pcbPathRelativeTo
Seve
Seve2mo ago
is the pcb viewer possibly stale fixing all of these issues....
Ray Kholodovsky
Ray KholodovskyOP2mo ago
I had already refreshed the window and just did again and commented out the other trace and see that change, to be sure of all
No description
Seve
Seve2mo ago
fml ok sorry about that, lots of fixes coming although it looks like you have thickness commented out in your screenshot fwiw
Ray Kholodovsky
Ray KholodovskyOP2mo ago
yeah was trying a lot of options, screenshot got the tail end of them. (it wasn't working when thickness was in)
No description
Ray Kholodovsky
Ray KholodovskyOP2mo ago
seve I just updated to tscircuit@0.0.809 please be aware of these errors which might be additional clues as to why it's still not working for me. I just submitted a bug report if that helps you.
No description
Seve
Seve2mo ago
Thanks yes that is very helpful!!!!
Ray Kholodovsky
Ray KholodovskyOP2mo ago
if I go back to the "older" syntax from=".R1 > .pin2" to=".MP2 > .pin1" then I can make the 3rd error go away, I am down to 2 errors, and no change in behaviour.
No description
Ray Kholodovsky
Ray KholodovskyOP2mo ago
I think that 3rd error, the pcb_trace_error, is kind of outdated/ not actually true in my situation? like I'm getting the same trace with the same behaviour regardless of which syntax I use, .R1 > .pin2 or R1.pin2
Seve
Seve2mo ago
I wonder if its related to the kicad footprint
Ray Kholodovsky
Ray KholodovskyOP2mo ago
boom! footprint="0402" AND pcbPath={["R1.pin2", "MP2.pin1"]} and width changes
Ray Kholodovsky
Ray KholodovskyOP2mo ago
No description
Seve
Seve2mo ago
😕 ok so seems like a selector resolution problem with kicad footprints
Ray Kholodovsky
Ray KholodovskyOP2mo ago
No description
Ray Kholodovsky
Ray KholodovskyOP2mo ago
temporarily happy for now 🙂
No description
Seve
Seve2mo ago
Will get that sorted asap, easily defined issue!!!!
Ray Kholodovsky
Ray KholodovskyOP2mo ago
woohoo!
Seve
Seve2mo ago
@Linear make an issue I have no idea if that works
Ray Kholodovsky
Ray KholodovskyOP2mo ago
making the robots do our bidding, I see
Seve
Seve2mo ago
One more try
Linear
Linear2mo ago
Could not find the provided team. Be sure to select one from the suggested options.
Ray Kholodovsky
Ray KholodovskyOP2mo ago
I'll write your issue by hand, which repo?
Seve
Seve2mo ago
You can create any issue against the tscircuit/tscircuit repo We’ll transfer as needed
Linear
Linear2mo ago
Issue TSC-38 created.
Seve
Seve2mo ago
ok not synced to github tho 🤔
Abse
Abse2mo ago
@Seve is there any issue isn't solved (I'm looking for issues)
Seve
Seve2mo ago
@Abse yea there's tons of issues, will get you a good one in a sec. But also consider doing some reviews which also gets you contribution points!!
Abse
Abse2mo ago
ok
Seve
Seve2mo ago
In general I could use a hand verifying the GLB and STEP export is working end to end https://github.com/tscircuit/tscircuit/issues/1075 Also I think we've introduced a LOT of new circuit-json features that don't have Gerber export and would love it if someone could test that before it becomes a user reported issue e.g. I'm not sure if properties like is_cover_with_solder_mask work or if hole_offset_x works etc.
GitHub
circuit-json-to-gltf models aren't rotated properly when importing ...
(To replicate, export a GLB from RunFrame)
Seve
Seve2mo ago
GitHub
GitHub - tscircuit/circuit-json-to-gerber: Convert Circuit JSON to ...
Convert Circuit JSON to Gerber. Contribute to tscircuit/circuit-json-to-gerber development by creating an account on GitHub.
Ray Kholodovsky
Ray KholodovskyOP2mo ago
before it becomes a user reported issue
the user in this example likely being me 😁
Abse
Abse2mo ago
I will check it end to end + that will make sure it's ready to order the RP2040 boards when ready
Seve
Seve2mo ago
tyty

Did you find this page helpful?