From 1c4bb69e35674d4dc00c0a261664e770c2c84186 Mon Sep 17 00:00:00 2001 From: "Mr.doob" Date: Tue, 13 Oct 2015 17:05:33 -0400 Subject: [PATCH] ExtrudeGeometry: Reverted face.material removal. See #7332. --- src/extras/geometries/ExtrudeGeometry.js | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/src/extras/geometries/ExtrudeGeometry.js b/src/extras/geometries/ExtrudeGeometry.js index 8950520c22..23027eecf9 100644 --- a/src/extras/geometries/ExtrudeGeometry.js +++ b/src/extras/geometries/ExtrudeGeometry.js @@ -84,6 +84,9 @@ THREE.ExtrudeGeometry.prototype.addShape = function ( shape, options ) { var extrudePath = options.extrudePath; var extrudePts, extrudeByPath = false; + var material = options.material; + var extrudeMaterial = options.extrudeMaterial; + // Use default WorldUVGenerator if no UV generators are specified. var uvgen = options.UVGenerator !== undefined ? options.UVGenerator : THREE.ExtrudeGeometry.WorldUVGenerator; @@ -628,7 +631,7 @@ THREE.ExtrudeGeometry.prototype.addShape = function ( shape, options ) { b += shapesOffset; c += shapesOffset; - scope.faces.push( new THREE.Face3( a, b, c ) ); + scope.faces.push( new THREE.Face3( a, b, c, null, null, material ) ); var uvs = uvgen.generateTopUV( scope, a, b, c ); @@ -643,8 +646,8 @@ THREE.ExtrudeGeometry.prototype.addShape = function ( shape, options ) { c += shapesOffset; d += shapesOffset; - scope.faces.push( new THREE.Face3( a, b, d ) ); - scope.faces.push( new THREE.Face3( b, c, d ) ); + scope.faces.push( new THREE.Face3( a, b, d, null, null, extrudeMaterial ) ); + scope.faces.push( new THREE.Face3( b, c, d, null, null, extrudeMaterial ) ); var uvs = uvgen.generateSideWallUV( scope, a, b, c, d ); -- GitLab