Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to increase the thickness of the extrude geometry along x and z axis - Three.js

I had created a shape using extrude geometry , and now with the extrude settings i need to increase the thickness i had used bevelThickness it increases the thickness along y axis , but need to increase it along x and z axis.

Here my working jsfiddle

Below is my code for extrude settings ,

var extrusionSettings = {
            curveSegments:5,
            steps: 10,
            amount: 10,
            bevelEnabled: true,
            bevelThickness: 120,
            bevelSize: 0,
            bevelSegments: 8,
            material: 0,
            extrudeMaterial: 1
        };

        var geometry1 = new THREE.ExtrudeGeometry( shape1, extrusionSettings );

        var materialLeft = new THREE.MeshLambertMaterial({
            color: 0xd6d6d6,// red  
            transparent:true,
            side: THREE.DoubleSide,
            ambient: 0xea6767,
            opacity:-0.5
        });
        var materialRight = new THREE.MeshLambertMaterial({
            color: 0xcc49c3,//violet                
            side: THREE.DoubleSide,
            ambient: 0xcc49c3
        });         

        var materials = [  materialLeft, materialRight                               
                            ];

        var material = new THREE.MeshFaceMaterial( materials );
        var mesh1 = new THREE.Mesh( geometry1, material );          
        object.add( mesh1 );
        object.rotation.x = Math.PI / 2;

        scene.add( object );

Below is sample image enter image description here

is there any setting to increase it ? Can any one guide me ?

like image 650
Roobena Avatar asked Oct 09 '14 07:10

Roobena


1 Answers

Finally i did the trick to fix it, What i did is just i cloned a Mesh add added the position to cloned mesh, so i got the wall nearby another inner wall, by this way i have added multiple clone with the loop, multiple inner wall nearby other created the wall thickens,

Demo : Fiddle

//outer wall mesh 
var mesh1 = new THREE.Mesh( geometry1, material );
  object.add( mesh1 );

  var mesh_arr=new Array();
  for(i=0.1;i<15;i++)
  {

      //cloned mesh,add position to the cloning mesh
      mesh_arr[i] = mesh1.clone();
      mesh_arr[i].position.set(i,i,i);
      mesh_arr[i].updateMatrix();
      object.add( mesh_arr[i] );

  } 

Result

like image 167
Jothi Kannan Avatar answered Nov 12 '22 22:11

Jothi Kannan