Skip to content

Commit 65517a4

Browse files
authored
Fix export algo
1 parent 850d26c commit 65517a4

File tree

1 file changed

+9
-1
lines changed

1 file changed

+9
-1
lines changed

apps/studio/src/studio/formats/project/BBModelExporter.ts

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -374,7 +374,7 @@ const convertCube = (cube: DCMCube, positionCache: WorldPositionCache): CubeElem
374374
name: `${cube.name.value}_cube`,
375375
rescale: false,
376376
locked: false,
377-
from: from,
377+
from: minusArray(from, cubeGrow),
378378
to: plusArr(from, plusArr(dimension, cubeGrow)),
379379
autouv: 0,
380380
color: 1,
@@ -471,6 +471,14 @@ const plusArr = (arr1: NumArray, arr2: NumArray): NumArray => {
471471
]
472472
}
473473

474+
const minusArray = (arr1: NumArray, arr2: NumArray): NumArray => {
475+
return [
476+
arr1[0] - arr2[0],
477+
arr1[1] - arr2[1],
478+
arr1[2] - arr2[2],
479+
]
480+
}
481+
474482
const _cloneArr = <T>(lo: LO<T>): T => {
475483
return Array.from(lo.value as any) as any
476484
}

0 commit comments

Comments
 (0)