Skip to content

Conversation

@raykholo
Copy link

@raykholo raykholo commented Oct 26, 2025

/claim #40

Key points:

  • 4 corner "pacman" are individually hardcoded while polygon rotation is being implemented
  • Vias are all correctly placed but not named
  • copperpour is defined but does not appear to render? and outline/ clearance props are broken?
  • bottom text is silkscreen for now since I don't think copper text exists in tscircuit
image image

…unctionality

Key points:

-4 corner "pacman" are individually hardcoded while polygon rotation is implemented
- Vias are all correctly placed but not named
- copperpour is defined but does not appear to render? and outline/ clearance props are broken?
- bottom text is silkscreen for now since I don't think copper text exists in tsc
@vercel
Copy link

vercel bot commented Oct 26, 2025

@raykholo is attempting to deploy a commit to the tscircuit Team on Vercel.

A member of the Team first needs to authorize it.

...rest,
}) as {
boardProps: any
chipProps: Record<string, any>
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

is this type casting necessary? (CC @Abse2001 if so we should patch this)

Copy link
Author

@raykholo raykholo Oct 26, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@seveibar lines 14 through 27 are a direct copy from the Arduino Shield in this repo. You said "there's an existing pattern in that tscircuit/common repo" which I interpreted as this so I copied it over directly. I don't use anything like this in the similar "userland" stuff I have been doing, but I defer to you to determine what is ultimately necessary or not for everything to work properly. However, it is important to deal with passing BoardProps and children into the that ViaGridBoard encompasses. So some variation of all this seems necessary.

Copy link
Contributor

@seveibar seveibar left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

generally looking good! A couple thoughts

for claims (i'm not sure if you claimed) the full board is required (ready-to-be-used), this is in part how we incentive people to "dive deeper" into fixes

Comment on lines 59 to 62
//radius="2.5mm"

//width="5mm"
//height="5mm"
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
//radius="2.5mm"
//width="5mm"
//height="5mm"

/>

{pacmanGridCells.map((cell) => (
<chip
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

not as clear as it could be:

{["TL", "BL", "BR", "TR"].map(cornerPositionName => {
  const cornerPosition = getCornerPosition(cornerPositionName)
  return <SemiCircleCorner name={`${cornerPositionName}_CORNER`} pcbX={cornerPosition.x} pcbY={cornerPosition.y} cornerPositionName={cornerPositionName} />
)}

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

severely cleaned this up in latest commits

/>
))}

<ViaGridPlus pcbX={30} pcbY={25} />
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

every via should have some kind of reference i think (is this in the standard?)

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

In kicad, vias do not get designators like "via1". they just get assigned to a net they are connected to, typically automatically, as part of routing. In tsc, I don't see how to give vias a name in the docs, but I do see that they have a name option in the type definition. The larger question is how will the end user ultimately refer to these pre-placed vias? Should I scriptologically give them names and the user can then use name.pin1 type syntax to connect a trace to the target via?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I looked into how we would do this in our autorouter and we would just need them to have a property like "netIsAssignable" I think, but I think for debugging purposes they should have deterministic names otherwise it'll be difficult to refer to them consistently in logs etc.

// { x: 5, y: 60 },
// { x: 95, y: 60 },
// { x: 95, y: 5 }
// ]
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

CC @ShiboSoftwareDev we should get this working!

{ x: -2.5, y: -0.2 },

{ x: 0.2, y: -0.2 },
]
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

you'll want to define an arc function, that should be an example of doing this in this codebase e.g.

buildOutline()
  .moveTo(0,0)
  .arcTo(25,25, ...)
  .lineTo(0, 50)

this will allow you to define an arbitrary shape.

I don't know if semi-circles will make it into the spec, we need to see more usage

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@seveibar @raykholo we have an arcTo method check the other boards one of them using it

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@seveibar @Abse2001 sorry I'm not clear on exactly what you want me to do here. I found the function in question and the arcTo declaration:


Are you asking me to implement this syntax into polygon? or are you simply suggesting I can use this code to generate my list of points as above programmatically?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

yep you can use this function to give you proper arcs!

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

err for more clarity, the function can be used to get a list of points. But just for additional clarity we shouldn't see the XY positions of every point, the function is run at runtime (this is how the other board works)

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

perfect, love it, implemented and working now!

{ x: -0.2, y: -0.2 }, // Back to center/origin - closes the shape

]
*/
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

some ghost code here

@Abse2001
Copy link
Contributor

@raykholo use bunx tsci snapshot --update --3d to add snapshots to your PR

Copy link
Contributor

@Abse2001 Abse2001 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this looks good just make sure to address all comments by Seve

Nice work

@raykholo
Copy link
Author

@raykholo use bunx tsci snapshot --update --3d to add snapshots to your PR

I got some fun console results when I ran that, possibly due to things we are in the process of fixing.
2D view is good, 3D view is butchered.

ViaGridBoard circuit-pcb snap

ViaGridBoard circuit-3d snap
ray@MacBookPro ViaGridBoard % bunx tsci snapshot --update --3d
Each child in a list should have a unique "key" prop.

Check the render method of `board`. It was passed a child from ViaGridBoard. See https://react.dev/link/warning-keys for more information.
Async effect error in PcbCopperPourRender "PcbCopperPourRender":
Error: Net "net.GND" not found for copper pour
    at renderError (/Users/ray/Documents/GitHub/tscircuit/common/node_modules/@tscircuit/core/dist/index.js:360:17)
    at <anonymous> (/Users/ray/Documents/GitHub/tscircuit/common/node_modules/@tscircuit/core/dist/index.js:15777:14)
    at <anonymous> (/Users/ray/Documents/GitHub/tscircuit/common/node_modules/@tscircuit/core/dist/index.js:15772:51)
    at _queueAsyncEffect (/Users/ray/Documents/GitHub/tscircuit/common/node_modules/@tscircuit/core/dist/index.js:210:16)
    at doInitialPcbCopperPourRender (/Users/ray/Documents/GitHub/tscircuit/common/node_modules/@tscircuit/core/dist/index.js:15772:10)
    at runRenderPhase (/Users/ray/Documents/GitHub/tscircuit/common/node_modules/@tscircuit/core/dist/index.js:348:24)
    at runRenderPhaseForChildren (/Users/ray/Documents/GitHub/tscircuit/common/node_modules/@tscircuit/core/dist/index.js:355:13)
    at runRenderCycle (/Users/ray/Documents/GitHub/tscircuit/common/node_modules/@tscircuit/core/dist/index.js:302:12)
    at render (/Users/ray/Documents/GitHub/tscircuit/common/node_modules/@tscircuit/core/dist/index.js:17404:16)
    at renderUntilSettled (/Users/ray/Documents/GitHub/tscircuit/common/node_modules/@tscircuit/core/dist/index.js:17415:10)
Generating PCB texture...
Failed to load native svg-to-png, falling back to browser method: error: Cannot find module '@resvg/resvg-js' from '/Users/ray/Documents/GitHub/tscircuit/common/node_modules/circuit-json-to-gltf/dist/svg-to-png-FCHG2ZUX.js'
Failed to load native svg-to-png, falling back to browser method: error: Cannot find module '@resvg/resvg-js' from '/Users/ray/Documents/GitHub/tscircuit/common/node_modules/circuit-json-to-gltf/dist/svg-to-png-FCHG2ZUX.js'
Failed to render board textures: ReferenceError: document is not defined
      at <anonymous> (/Users/ray/Documents/GitHub/tscircuit/common/node_modules/circuit-json-to-gltf/dist/index.js:14571:20)
      at new Promise (1:11)
      at convertSvgToCanvasBrowser (/Users/ray/Documents/GitHub/tscircuit/common/node_modules/circuit-json-to-gltf/dist/index.js:14570:10)
      at convertSvgToCanvasBrowser (/Users/ray/Documents/GitHub/tscircuit/common/node_modules/circuit-json-to-gltf/dist/index.js:14569:42)
      at async renderBoardLayer (/Users/ray/Documents/GitHub/tscircuit/common/node_modules/circuit-json-to-gltf/dist/index.js:14548:16)
      at async renderBoardTextures (/Users/ray/Documents/GitHub/tscircuit/common/node_modules/circuit-json-to-gltf/dist/index.js:14596:39)
      at async convertCircuitJsonTo3D (/Users/ray/Documents/GitHub/tscircuit/common/node_modules/circuit-json-to-gltf/dist/index.js:14906:32)
      at async convertCircuitJsonToGltf (/Users/ray/Documents/GitHub/tscircuit/common/node_modules/circuit-json-to-gltf/dist/index.js:16414:25)
      at async <anonymous> (/Users/ray/Documents/GitHub/tscircuit/common/node_modules/@tscircuit/cli/dist/main.js:196145:33)
      at async <anonymous> (/Users/ray/Documents/GitHub/tscircuit/common/node_modules/@tscircuit/cli/dist/main.js:196251:11)

✅ __snapshots__/ViaGridBoard.circuit-pcb.snap.svg
✅ __snapshots__/ViaGridBoard.circuit-schematic.snap.svg
✅ __snapshots__/ViaGridBoard.circuit-3d.snap.png
Created snapshots

@seveibar
Copy link
Contributor

@raykholo that resvg error should be fixed in the latest versions of tscircuit, might require a dep update to tscircuit, but resvg-js is now included as a dep inside tscircuit

@raykholo
Copy link
Author

raykholo commented Oct 26, 2025

Ok, I think I got as much as I am able done and IMO nothing is a blocker from being "end user ready!"

  • cleaned corner pacmans with OutlineBuilder and arcTo, now proper round shapes, and with pcbRotation for each position.
  • all vias now have unique names
  • Added GND net to fix errors, snapshots work now.
  • copper pour is rendering, we just need to uncomment the outline once that is supported in tsc!
  • snapshots added. note that the snapshot is not showing the pacman pcbRotation correctly. However, it is correct locally.

Ready for review!

@vercel
Copy link

vercel bot commented Oct 26, 2025

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Preview Comments Updated (UTC)
tscircuit-common Error Error Oct 26, 2025 3:46pm

@seveibar
Copy link
Contributor

Any ideas on the vercel build error?

image

@seveibar
Copy link
Contributor

Let’s hide the pacmans and top rect in the schematic, i think there’s a property for this but not 100% sure, something like noSchematicRepresentation (it isnt documented yet it seems)

image

@seveibar
Copy link
Contributor

Cc @techmmanih @Abse2001 we should figure out this 3d snapshot camera and why its wrong (maybe a cli issue i have no idea)

@raykholo
Copy link
Author

Any ideas on the vercel build error?

image

unsure, not seeing anything named 'ms' in this entire project

Let’s hide the pacmans and top rect in the schematic, i think there’s a property for this but not 100% sure, something like noSchematicRepresentation (it isnt documented yet it seems)

done, committed.

@raykholo
Copy link
Author

I added the export to index.tsx which seems to be the last step!

the build command works fine on my machine:
image

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants