Work Name: 【Hole in a Cube】

Source Code


const mesh01J2EAQB46615C8Z5N5PF53HXV = BABYLON.MeshBuilder.CreateBox('01J2EAQB46615C8Z5N5PF53HXV', {}, scene);
mesh01J2EAQB46615C8Z5N5PF53HXV.position = new BABYLON.Vector3(
  1.0675358772277832,
  -2.257681369781494,
  0.6504718065261841,
);
mesh01J2EAQB46615C8Z5N5PF53HXV.rotationQuaternion = new BABYLON.Quaternion(
  0.13715518604897695,
  -0.22905092534031798,
  -0.06464249889549782,
  0.9615328782091438,
);
mesh01J2EAQB46615C8Z5N5PF53HXV.scaling = new BABYLON.Vector3(
  5.002093678056937,
  5.002092958585234,
  7.734201586391976,
);

const mesh01J2EARTGZX03GM3PASDMWTSJW = BABYLON.MeshBuilder.CreateSphere('01J2EARTGZX03GM3PASDMWTSJW', { segments: 3 }, scene);
mesh01J2EARTGZX03GM3PASDMWTSJW.position = new BABYLON.Vector3(
  -3.698008566033195e-10,
  -9.940446688005977e-9,
  2.570987689409776e-8,
);
mesh01J2EARTGZX03GM3PASDMWTSJW.rotationQuaternion = new BABYLON.Quaternion(
  -1.0179520781861129e-8,
  5.652954770951624e-9,
  -1.5468025749143521e-9,
  1,
);
mesh01J2EARTGZX03GM3PASDMWTSJW.scaling = new BABYLON.Vector3(
  5.000000476837158,
  5.000000000000001,
  5.000000000000002,
);

const subCSG = BABYLON.CSG.FromMesh(mesh01J2EAQB46615C8Z5N5PF53HXV);
subCSG['subtractInPlace'](BABYLON.CSG.FromMesh(mesh01J2EARTGZX03GM3PASDMWTSJW));
subCSG.toMesh("csg", undefined, scene, true);

mesh01J2EAQB46615C8Z5N5PF53HXV.dispose();
mesh01J2EARTGZX03GM3PASDMWTSJW.dispose();