@tscircuit/cli 0.1.1289 → 0.1.1291
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/dist/cli/build/build.worker.js +5 -2
- package/dist/cli/main.js +874 -597
- package/dist/lib/index.js +2 -1
- package/package.json +2 -1
|
@@ -11953,7 +11953,10 @@ var resolveImageFormatSelection = (options) => {
|
|
|
11953
11953
|
// cli/build/worker-output-generators.ts
|
|
11954
11954
|
import fs9 from "node:fs";
|
|
11955
11955
|
import path12 from "node:path";
|
|
11956
|
-
import {
|
|
11956
|
+
import {
|
|
11957
|
+
convertCircuitJsonToGltf,
|
|
11958
|
+
getBestCameraPosition
|
|
11959
|
+
} from "circuit-json-to-gltf";
|
|
11957
11960
|
import {
|
|
11958
11961
|
convertCircuitJsonToPcbSvg,
|
|
11959
11962
|
convertCircuitJsonToSchematicSvg
|
|
@@ -13552,7 +13555,7 @@ var writeImageAssetsFromCircuitJson = async (circuitJson, options) => {
|
|
|
13552
13555
|
const circuitJsonWithFileUrls = convertModelUrlsToFileUrls(circuitJson);
|
|
13553
13556
|
const glbBuffer = await convertCircuitJsonToGltf(circuitJsonWithFileUrls, getCircuitJsonToGltfOptions({ format: "glb" }));
|
|
13554
13557
|
const glbArrayBuffer = await normalizeToArrayBuffer(glbBuffer);
|
|
13555
|
-
const pngBuffer = await renderGLTFToPNGBufferFromGLBBuffer(glbArrayBuffer);
|
|
13558
|
+
const pngBuffer = await renderGLTFToPNGBufferFromGLBBuffer(glbArrayBuffer, getBestCameraPosition(circuitJson));
|
|
13556
13559
|
fs9.writeFileSync(path12.join(outputDir, "3d.png"), Buffer.from(normalizeToUint8Array(pngBuffer)));
|
|
13557
13560
|
}
|
|
13558
13561
|
};
|