@Abse if you want a fairly difficult
@Abse if you want a fairly difficult project, we need to integrate footprinter models into circuit-json-to-gltf. It requires converting jscad-planner objects into GLTF/OBJ objects. Sort of on the hard end
47 Replies
ok
can I get quick brief
circuit json represents some 3d models with cad_component.footprinter_string
you can see this in e.g. the usb-c-flashlight


we need to incorporate these footprinter_string models into the gltf output
to do that, you have to use
jscad-electronics
to get the jscad representation
then you have to convert the jscad representation into the gltf format
jscad-electronics also annoyingly requires React, a good side quest is to build a version of jscad-electronics that doesn't require react by creating a custom h
function (pragma function) so that you can just do import { getJscadModelForFootprint } from "jscad-electronics/vanilla"
jscad-fiber
could also export that pragma@Seve I used a lot of ai help with jscad without react , I think I got something , need your review I will draft a PR soon
cool
to be honest I'm not sure if this is breaking anything or not , should we do more tests ?
yea you should try yalc'ing this in 3d-viewer probablyu
just to make sure nothing breaks
ok
also the test files look insane, i'm not sure why you need all that complexity. But the result is pretty good
the way it's used is so weird i'm not sure it works
also why is there a useMemo shim
it's generally correct i'm just confused
i would try to build it, then create a fresh project, yalc add it, then see if you can import the vanilla without react being in your project or installed in any way
will I had alot of Ai help and I'm not sure I 100% understand the code too lol , I will clean it I just want to know that I'm on the right way
yea i think you did it right
3d viewer is working fine




new empty repo and this test passes
it only had
@Seve
the file is too long , etc
Woah crazy
Alright yea lmk if you feel like its clean and we can do a review and try to ship?
I will also do some basic testing. Awesome contrib
I was wondering should I leave or remove the tests in the current PR ?
yeah can I get another review + I'm not sure how to handle the types ( too much any ?)
Yea the tests are crazy, why dont you just make that importVanilla a tests/fixtures/importVanilla.js? would increase readability
Will definitely test stuff tonight and can probably push some of my own contribs
@Seve we are getting somewhere
still need work tho
DUDE!!!!!!
WTFFF!!!!! AMAZINGT!!@!!!!!!
using yalc
btw the issue you're having looks like back face culling
the back faces are showing as front faces
ai can usually fix that pretty quick if that is the issue
nice thanks for the help
ofc
at some point we might want to move some stuff around on that project, like i almost think
jscad-fiber
should expose the h
function then it could be imported from jscad-electronics
but not a huge deal, just super happy that we don't need React to render the footprint models
major simplificationai one shot it lol

awesome
now the type c is gone
i think the resistors might be "sunk" and need to be offset by the board height 🤔
need to get it back
oh weird

so the size is off right ?
No that looks about right imo, the pads are usually bigger
It is off center
Also the button is also supposed to be a footprinter string 🤔
will test it
repro in jscad etc
@Seve are we using zod 4 now ?
no not yet
we haven't even started the migration, and adding zod 4 will generally break everything

circuit json util shouldn't have zod 4
this will fix it

and I'm getting a zod parser error when using footprint string
pushbutton
yea we need to get zod 4 outta there
we will upgrade but probably not in August
I will fix it