circuit-json-to-gltf 0.0.11 → 0.0.12

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (2) hide show
  1. package/dist/index.js +5 -1
  2. package/package.json +2 -2
package/dist/index.js CHANGED
@@ -900,7 +900,11 @@ async function convertCircuitJsonTo3D(circuitJson, options = {}) {
900
900
  const cadComponents = db.cad_component?.list?.() ?? [];
901
901
  const pcbComponentIdsWith3D = /* @__PURE__ */ new Set();
902
902
  for (const cad of cadComponents) {
903
- const { model_stl_url, model_obj_url, model_glb_url } = cad;
903
+ let { model_stl_url, model_obj_url, model_glb_url } = cad;
904
+ const hasModelUrl = Boolean(model_stl_url || model_obj_url || model_glb_url);
905
+ if (!hasModelUrl && cad.footprinter_string) {
906
+ model_glb_url = `https://modelcdn.tscircuit.com/jscad_models/${cad.footprinter_string}.glb`;
907
+ }
904
908
  if (!model_stl_url && !model_obj_url && !model_glb_url) continue;
905
909
  pcbComponentIdsWith3D.add(cad.pcb_component_id);
906
910
  const pcbComponent = db.pcb_component.get(cad.pcb_component_id);
package/package.json CHANGED
@@ -2,7 +2,7 @@
2
2
  "name": "circuit-json-to-gltf",
3
3
  "main": "dist/index.js",
4
4
  "type": "module",
5
- "version": "0.0.11",
5
+ "version": "0.0.12",
6
6
  "scripts": {
7
7
  "test": "bun test tests/",
8
8
  "format": "biome format --write .",
@@ -28,7 +28,7 @@
28
28
  "circuit-json": "^0.0.267",
29
29
  "circuit-to-svg": "^0.0.175",
30
30
  "looks-same": "^9.0.1",
31
- "poppygl": "^0.0.6",
31
+ "poppygl": "^0.0.9",
32
32
  "react": "^19.1.1",
33
33
  "react-cosmos": "^7.0.0",
34
34
  "react-cosmos-plugin-vite": "^7.0.0",