Hole programming / empty space in three.js

I would like to program something like a hole in three.js. it should be, for example, a 3x3x3 cube with a 1x1x1 hole in it. is it possible that I first use something like kubegeometry, and then another "geometry" that cuts off the material that I want to remove? removal geometry ?: D

Thanks:)

+4
source share
1 answer

If you want to “cut” things in certain forms, you may be interested in this post in the library of constructive solid geometry. It comes with a wrapper for THREE.js objects.

It allows you to do things like this:

var cube = new CSG.cube(); var sphere = CSG.sphere({radius: 1.3, stacks: 16}); var geometry = cube.subtract(sphere); 

=>

enter image description here

Here is another short tutorial on this.

+9
source

All Articles