提交 c7ededa6 编写于 作者: M Mr.doob

Updated builds.

上级 66f8bfc7
...@@ -29387,7 +29387,7 @@ THREE.Path.prototype.getPoints = function( divisions, closedPath ) { ...@@ -29387,7 +29387,7 @@ THREE.Path.prototype.getPoints = function( divisions, closedPath ) {
// Breaks path into shapes // Breaks path into shapes
THREE.Path.prototype.toShapes = function() { THREE.Path.prototype.toShapes = function( isCCW ) {
var i, il, item, action, args; var i, il, item, action, args;
...@@ -29425,19 +29425,23 @@ THREE.Path.prototype.toShapes = function() { ...@@ -29425,19 +29425,23 @@ THREE.Path.prototype.toShapes = function() {
if ( subPaths.length == 0 ) return []; if ( subPaths.length == 0 ) return [];
var tmpPath, tmpShape, shapes = []; var solid, tmpPath, tmpShape, shapes = [];
var holesFirst = !THREE.Shape.Utils.isClockWise( subPaths[ 0 ].getPoints() );
// console.log("Holes first", holesFirst);
if ( subPaths.length == 1) { if ( subPaths.length == 1) {
tmpPath = subPaths[0]; tmpPath = subPaths[0];
tmpShape = new THREE.Shape(); tmpShape = new THREE.Shape();
tmpShape.actions = tmpPath.actions; tmpShape.actions = tmpPath.actions;
tmpShape.curves = tmpPath.curves; tmpShape.curves = tmpPath.curves;
shapes.push( tmpShape ); shapes.push( tmpShape );
return shapes; return shapes;
};
}
var holesFirst = !THREE.Shape.Utils.isClockWise( subPaths[ 0 ].getPoints() );
holesFirst = isCCW ? !holesFirst : holesFirst;
// console.log("Holes first", holesFirst);
if ( holesFirst ) { if ( holesFirst ) {
...@@ -29446,8 +29450,10 @@ THREE.Path.prototype.toShapes = function() { ...@@ -29446,8 +29450,10 @@ THREE.Path.prototype.toShapes = function() {
for ( i = 0, il = subPaths.length; i < il; i ++ ) { for ( i = 0, il = subPaths.length; i < il; i ++ ) {
tmpPath = subPaths[ i ]; tmpPath = subPaths[ i ];
solid = THREE.Shape.Utils.isClockWise( tmpPath.getPoints() );
solid = isCCW ? !solid : solid;
if ( THREE.Shape.Utils.isClockWise( tmpPath.getPoints() ) ) { if ( solid ) {
tmpShape.actions = tmpPath.actions; tmpShape.actions = tmpPath.actions;
tmpShape.curves = tmpPath.curves; tmpShape.curves = tmpPath.curves;
...@@ -29470,13 +29476,15 @@ THREE.Path.prototype.toShapes = function() { ...@@ -29470,13 +29476,15 @@ THREE.Path.prototype.toShapes = function() {
} else { } else {
// Shapes first // Shapes first
tmpShape = undefined;
for ( i = 0, il = subPaths.length; i < il; i ++ ) { for ( i = 0, il = subPaths.length; i < il; i ++ ) {
tmpPath = subPaths[ i ]; tmpPath = subPaths[ i ];
solid = THREE.Shape.Utils.isClockWise( tmpPath.getPoints() );
solid = isCCW ? !solid : solid;
if ( THREE.Shape.Utils.isClockWise( tmpPath.getPoints() ) ) { if ( solid ) {
if ( tmpShape ) shapes.push( tmpShape ); if ( tmpShape ) shapes.push( tmpShape );
......
因为 它太大了无法显示 source diff 。你可以改为 查看blob
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册