Skip to content

Commit 1fa6bce

Browse files
authored
Fix bounding box on exploded view (#521)
* Fix bounding box on exploded view * Fix bounding box on exploded view * Adding bounding box to mesh not required anymore * What was I removing? 🧐 * What object I was searching for again? 🥸
1 parent 0aff0ce commit 1fa6bce

File tree

1 file changed

+6
-4
lines changed

1 file changed

+6
-4
lines changed

packages/base/src/3dview/mainview.tsx

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -995,9 +995,11 @@ export class MainView extends React.Component<IProps, IStates> {
995995
selectedMesh.material.color = originalColor;
996996
}
997997

998-
const boundingBox = selectedMesh.getObjectByName(SELECTION_BOUNDING_BOX);
999-
if (boundingBox) {
1000-
selectedMesh.remove(boundingBox);
998+
const groupBoundingBox = this._meshGroup?.getObjectByName(
999+
SELECTION_BOUNDING_BOX
1000+
);
1001+
if (groupBoundingBox) {
1002+
this._meshGroup?.remove(groupBoundingBox);
10011003
}
10021004

10031005
const material = selectedMesh.material as THREE.Material & {
@@ -1063,7 +1065,7 @@ export class MainView extends React.Component<IProps, IStates> {
10631065
bbox.getCenter(center);
10641066
boundingBox.position.copy(center);
10651067

1066-
selectedMesh.add(boundingBox);
1068+
this._meshGroup?.add(boundingBox);
10671069
}
10681070
}
10691071
}

0 commit comments

Comments
 (0)