File tree Expand file tree Collapse file tree 3 files changed +65
-18
lines changed Expand file tree Collapse file tree 3 files changed +65
-18
lines changed Original file line number Diff line number Diff line change @@ -23003,6 +23003,29 @@ THREE.GeometryUtils = {
23003
23003
23004
23004
},
23005
23005
23006
+ removeMaterials: function ( geometry, materialIndexArray ) {
23007
+
23008
+ var materialIndexMap = {};
23009
+
23010
+ for ( var i = 0, il = materialIndexArray.length; i < il; i ++ ) {
23011
+
23012
+ materialIndexMap[ materialIndexArray[i] ] = true;
23013
+
23014
+ }
23015
+
23016
+ var face, newFaces = [];
23017
+
23018
+ for ( var i = 0, il = geometry.faces.length; i < il; i ++ ) {
23019
+
23020
+ face = geometry.faces[ i ];
23021
+ if ( ! ( face.materialIndex in materialIndexMap ) ) newFaces.push( face );
23022
+
23023
+ }
23024
+
23025
+ geometry.faces = newFaces;
23026
+
23027
+ },
23028
+
23006
23029
// Get random point in triangle (via barycentric coordinates)
23007
23030
// (uniform distribution)
23008
23031
// http://www.cgafaq.info/wiki/Random_Point_In_Triangle
You can’t perform that action at this time.
0 commit comments