This generator creates a rounded box. It is used as a building block of most of the other models. Click on a snapshot to open it online.
import { RoundBox } from "3d-assets/round-box.js";
var model = new RoundBox ({
x: 1,
y: 1,
z: 1,
f0: true,
f1: true,
f2: true,
f3: true,
f4: true,
f5: true,
r0: true,
r1: true,
r2: true,
r3: true,
r4: true,
r5: true,
c0: true,
c1: true,
c2: true,
c3: true,
c4: true,
c5: true,
roundness: .2,
roundDetail: 3,
flat: false,
simple: false,
});
x
– [ 0. 1]y
– [ 0. 1]z
– [ 0. 1]f<i>
– if false the i
-th face will not be added to the model, booleanr<i>
– if true the i
-th face will be rounded, booleanc<i>
– if false the i
-th face will have a hole in its center, booleanroundness
– size of the bevels on the box, [ 0, 1]roundDetail
– detail of the bevels on the box, [1, 10]simple
– if true the complexity of the profile is reduced, booleanflat
– if true flat shading is used, booleanAn instance of RoundBox
is a THREE.Group
with one submesh.