Skip to content

Commit 1c4bb69

Browse files
committed
ExtrudeGeometry: Reverted face.material removal. See mrdoob#7332.
1 parent 9776d27 commit 1c4bb69

File tree

1 file changed

+6
-3
lines changed

1 file changed

+6
-3
lines changed

src/extras/geometries/ExtrudeGeometry.js

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -84,6 +84,9 @@ THREE.ExtrudeGeometry.prototype.addShape = function ( shape, options ) {
8484
var extrudePath = options.extrudePath;
8585
var extrudePts, extrudeByPath = false;
8686

87+
var material = options.material;
88+
var extrudeMaterial = options.extrudeMaterial;
89+
8790
// Use default WorldUVGenerator if no UV generators are specified.
8891
var uvgen = options.UVGenerator !== undefined ? options.UVGenerator : THREE.ExtrudeGeometry.WorldUVGenerator;
8992

@@ -628,7 +631,7 @@ THREE.ExtrudeGeometry.prototype.addShape = function ( shape, options ) {
628631
b += shapesOffset;
629632
c += shapesOffset;
630633

631-
scope.faces.push( new THREE.Face3( a, b, c ) );
634+
scope.faces.push( new THREE.Face3( a, b, c, null, null, material ) );
632635

633636
var uvs = uvgen.generateTopUV( scope, a, b, c );
634637

@@ -643,8 +646,8 @@ THREE.ExtrudeGeometry.prototype.addShape = function ( shape, options ) {
643646
c += shapesOffset;
644647
d += shapesOffset;
645648

646-
scope.faces.push( new THREE.Face3( a, b, d ) );
647-
scope.faces.push( new THREE.Face3( b, c, d ) );
649+
scope.faces.push( new THREE.Face3( a, b, d, null, null, extrudeMaterial ) );
650+
scope.faces.push( new THREE.Face3( b, c, d, null, null, extrudeMaterial ) );
648651

649652
var uvs = uvgen.generateSideWallUV( scope, a, b, c, d );
650653

0 commit comments

Comments
 (0)