jeudi 3 mai 2018

How do I cut the existing geometry in three.js

I have drawn a shape something like this https://jsfiddle.net/cdu96z3c/ and I would wan to make look something like the image below. Preserving the current corrugation and properties.the required shape`

var geom = new THREE.BoxGeometry(50,-.1,150,1,1,150 * 10); 
geom.vertices.forEach(function(v){
    x_val = Math.abs(v.z);
    if((x_val % 9) < 0.75 || (x_val % 9) > 8.25){
      var m = parseInt(x_val/9) *9;
      var l = 0.75 - (m - x_val);
      v.y =  v.y + 0.75 * Math.sin(l* Math.PI/1.5);
    }
    else if(x_val % 3 < 0.25 || (x_val % 3) > 2.75){
      var m = parseInt(x_val/3) * 3;
      var l = 0.25 - (m - x_val);
      v.y =  v.y + 0.25 * Math.sin(l * Math.PI / 0.5);
    }
});`

Aucun commentaire:

Enregistrer un commentaire