How to use the ExtrudeGeometry function from three

Find comprehensive JavaScript three.ExtrudeGeometry code examples handpicked from public code repositorys.

124
125
126
127
128
129
130
131
132
//   side: THREE.BackSide,
//   opacity: 0})

var materials = [materialCeil, materialWall]//, materialFloor]

var geometry = new THREE.ExtrudeGeometry(shape, extrudeSettings)
var mesh = new THREE.Mesh(geometry, materials)
// mesh.layers.set(layer)
mesh.rotation.x = Math.PI / 2
fork icon263
star icon0
watch icon2

+ 3 other calls in file

152
153
154
155
156
157
158
159
160
161
    extrudePath: pathThree,
    bevelEnabled: false,
    steps,
};

const geometry = new THREE.ExtrudeGeometry(shapeThree, extrudeSettings);
const xyz = [], uv = [], normal = [], faces = [];
const faceVertexUv = geometry.faceVertexUvs[0];
geometry.faces.forEach((f, index) => {
    // xyz.push(
fork icon15
star icon132
watch icon9

+ 3 other calls in file

51
52
53
54
55
56
57
58
59
60
var ex = shapeCoords[0];

if(shapeCoords.length > 3) {
  var shape = new THREE.Shape(shapeCoords);
  var extrusionSettings = {amount: 10, bevelEnabled: false};
  var geometry = new THREE.ExtrudeGeometry(shape, extrusionSettings);
  var material = new THREE.MeshPhongMaterial({color: 0xcccccc});  
  var mesh = new THREE.Mesh(geometry,material );
  scene.add(mesh);
}
fork icon6
star icon0
watch icon1

+ 3 other calls in file

97
98
99
100
101
102
103
104
105
106
if(shape.actions.length === 0){
        return false;
}

//extrude & make mesh
var geometry = new THREE.ExtrudeGeometry( shape, extrusionSettings );
group.geometry.merge( geometry );
geometry.dispose();
shape = undefined;
pos = undefined;
fork icon2
star icon11
watch icon4

53
54
55
56
57
58
59
60
61
62
oneShape.lineTo(-3, -4);
oneShape.lineTo(-3, -3);
oneShape.lineTo(-1, -3);
oneShape.lineTo(-1, 2);
oneShape.bezierCurveTo(-0.8, 1.8, -2.8, 0.8, -3, 1);
let oneGeometry = new THREE.ExtrudeGeometry(oneShape, extrudeOptions);
let oneMesh = new THREE.Mesh(oneGeometry, this.coinMaterial);

// scale and position the "1" mesh to jut out of the coin
oneMesh.position.z -= (extrudeThickness / 2) * textScale; // center
fork icon2
star icon7
watch icon1

+ 5 other calls in file

92
93
94
95
96
97
98
99
100
101
  extrudeOptions = {
    amount: options.extrude,
    bevelEnabled: false,
    ignoreLidFaces: options.ignoreLidFaces
  };
  return new THREE.ExtrudeGeometry(shape, extrudeOptions);
};

MeshFactory.mergeMeshes = function(geoms) {
  var geometry;
fork icon0
star icon2
watch icon3

157
158
159
160
161
162
163
164
165
166
 * @param {*} rz 
 * @param {*} s 
 */
function addShape(group, shape, extrudeSettings, material, color, x, y, z, rx, ry, rz, s) {
    try{
        var geometry = new THREE.ExtrudeGeometry(shape, extrudeSettings);

        var mesh = new THREE.Mesh(geometry, materials[material](color));

        // Add shadows
fork icon3
star icon0
watch icon4

30
31
32
33
34
35
36
37
38
39

if (shape.curves.length>0 || shape.holes.length>0)
{
    var amount = 6 + group.children.length*0.2;
    try {
        var geometry = new THREE.ExtrudeGeometry( shape, {
            amount: amount,
            bevelEnabled: this.stack == 0
        } );
        for (var i=0;i<geometry.vertices.length;i++) 
fork icon0
star icon0
watch icon1

171
172
173
174
175
176
177
178
179
180
  // need to make sure we explicitly lengthen the bone.
  totalLength += bone.transition;
});
var uvgen = new BoneUVGenerator(stops);

var geom = new THREE.ExtrudeGeometry(
  opts.shape,
  {
    // 3 intra points per 90 deg
    curveSegments: opts.curveSegments || 16,
fork icon0
star icon0
watch icon1

44
45
46
47
48
49
50
51
52
53
}
if (this.form === 'hexagonal') {
    shape = tileHelper.getHexagonalShape(this.radius - this.height / 2);
}

let geometry = new THREE.ExtrudeGeometry(shape, {
    steps: 2,
    amount: this.height / 2,
    bevelEnabled: true,
    bevelThickness: this.height / 4,
fork icon0
star icon0
watch icon2

51
52
53
54
55
56
57
58
59
60

const group = new THREE.Group();

for (const [i,obj] of objects.entries()) {
  const shape = ShapeFromJSONObject(obj.shape);
  const geometry = new THREE.ExtrudeGeometry(shape, {bevelEnabled, amount});
  const fill = new THREE.Mesh(geometry, material);
  fill.name = obj.id;
  fill.position.x += obj.translation.x;
  fill.position.y += obj.translation.y;
fork icon0
star icon0
watch icon2

+ 11 other calls in file

Other functions in three

Sorted by popularity

function icon

three.Vector3 is the most popular function in three (22341 examples)