circuit-json-to-gltf 0.0.18 → 0.0.20
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.
- package/README.md +1 -1
- package/dist/index.js +3 -3
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -4,7 +4,7 @@ Converts circuit JSON to 3D GLTF files. Used for exporting circuits as 3D models
|
|
|
4
4
|
|
|
5
5
|
[Online Playground](https://circuit-json-to-gltf.vercel.app/renderer.html?fixtureId=%7B%22path%22%3A%22CircuitToGltfDemo.fixture.tsx%22%7D&locked=true)
|
|
6
6
|
|
|
7
|
-
<img width="2424" height="1854" alt="image" src="https://github.com/user-attachments/assets/
|
|
7
|
+
<img width="2424" height="1854" alt="image" src="https://github.com/user-attachments/assets/cb0862aa-2034-4d06-abcc-9a4d1e5a6041" />
|
|
8
8
|
|
|
9
9
|
## Features
|
|
10
10
|
|
package/dist/index.js
CHANGED
|
@@ -1323,14 +1323,14 @@ async function convertCircuitJsonTo3D(circuitJson, options = {}) {
|
|
|
1323
1323
|
const pcbComponentIdsWith3D = /* @__PURE__ */ new Set();
|
|
1324
1324
|
for (const cad of cadComponents) {
|
|
1325
1325
|
let { model_stl_url, model_obj_url, model_glb_url, model_gltf_url } = cad;
|
|
1326
|
-
|
|
1326
|
+
let hasModelUrl = Boolean(
|
|
1327
1327
|
model_stl_url || model_obj_url || model_glb_url || model_gltf_url
|
|
1328
1328
|
);
|
|
1329
1329
|
if (!hasModelUrl && cad.footprinter_string) {
|
|
1330
1330
|
model_glb_url = `https://modelcdn.tscircuit.com/jscad_models/${cad.footprinter_string}.glb`;
|
|
1331
|
+
hasModelUrl = true;
|
|
1331
1332
|
}
|
|
1332
|
-
if (!
|
|
1333
|
-
continue;
|
|
1333
|
+
if (!hasModelUrl) continue;
|
|
1334
1334
|
pcbComponentIdsWith3D.add(cad.pcb_component_id);
|
|
1335
1335
|
const pcbComponent = db.pcb_component.get(cad.pcb_component_id);
|
|
1336
1336
|
const isBottomLayer = pcbComponent?.layer === "bottom";
|