Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 3 additions & 2 deletions lib/shared/export-snippet.ts
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,7 @@ import { getPlatformConfigWithCliDefaults } from "lib/shared/get-platform-config
import { loadLocalStepModelFsMap } from "lib/shared/load-local-step-model-fs-map"
import { mergePlatformConfigs } from "lib/shared/platform-config-utils"
import { convertCircuitJsonToSchematicPdf } from "./convert-circuit-json-to-schematic-pdf"
import { convertModelUrlsToFileUrls } from "../../cli/build/convert-model-urls-to-file-urls"
import { convertToKicadLibrary } from "./convert-to-kicad-library"
import { importFromUserLand } from "./importFromUserLand"
import { isCircuitJsonFile } from "./is-circuit-json-file"
Expand Down Expand Up @@ -348,7 +349,7 @@ export const exportSnippet = async ({
case "gltf":
outputContent = JSON.stringify(
await convertCircuitJsonToGltf(
circuitJson,
convertModelUrlsToFileUrls(circuitJson),
getCircuitJsonToGltfOptions({ format: "gltf" }),
),
null,
Expand All @@ -358,7 +359,7 @@ export const exportSnippet = async ({
case "glb":
outputContent = Buffer.from(
(await convertCircuitJsonToGltf(
circuitJson,
convertModelUrlsToFileUrls(circuitJson),
getCircuitJsonToGltfOptions({ format: "glb" }),
)) as ArrayBuffer,
)
Expand Down
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
6 changes: 1 addition & 5 deletions tests/cli/export/export-glb-relative-step-model.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -47,11 +47,7 @@ test(
[...stderr.matchAll(/Failed to load STEP from [^:]+/g)].map(
([message]) => message,
),
).toMatchInlineSnapshot(`
[
"Failed to load STEP from ./libraries/model.step",
]
`)
).toMatchInlineSnapshot(`[]`)
const glb = await readFile(path.join(tmpDir, "export.glb"))
await expect(
renderGLTFToPNGFromGLB(glb, GLB_SNAPSHOT_CAMERA),
Expand Down
Loading