Closed yodfz closed 10 months ago
// basic pieces
const cylinder1 = new Brush( new THREE.CylinderGeometry( 0.5, 0.5, 6, 45 ), blueMaterial );
cylinder1.updateMatrixWorld();
const cylinder2 = new Brush( new THREE.CylinderGeometry( 0.5, 0.5, 6, 45 ), blueMaterial );
cylinder2.rotation.x = Math.PI / 2;
cylinder2.updateMatrixWorld();
const cylinder3 = new Brush( new THREE.CylinderGeometry( 0.5, 0.5, 6, 45 ), blueMaterial );
cylinder3.rotation.z = Math.PI / 2;
cylinder3.updateMatrixWorld();
const sphere = new Brush( new THREE.SphereGeometry( 1, 50, 50 ), greenMaterial );
sphere.updateMatrixWorld();
const box = new Brush( new THREE.BoxGeometry( 1.5, 1.5, 1.5 ), redMaterial );
box.updateMatrixWorld();
// processing
const evaluator = new Evaluator();
let result;
result = evaluator.evaluate( cylinder1, cylinder2, ADDITION );
result = evaluator.evaluate( result, cylinder3, ADDITION );
result = evaluator.evaluate( sphere, result, SUBTRACTION );
result = evaluator.evaluate( box, result, INTERSECTION );
i know!can't read geometry,load brush?
const brush= new Brush(newGeometry); const brush3 = new Brush(g2); const result2= csgEvaluator.evaluate(brush1, brush3, SUBTRACTION);
You are using brush1
again in the second evaluation.
i know!can't read geometry,load brush?
I'm not sure what you mean by this.
I can't do that。Something's wrong with him。