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

Updated builds.

上级 66f8bfc7
...@@ -29041,8 +29041,8 @@ THREE.Path.prototype.quadraticCurveTo = function( aCPx, aCPy, aX, aY ) { ...@@ -29041,8 +29041,8 @@ THREE.Path.prototype.quadraticCurveTo = function( aCPx, aCPy, aX, aY ) {
}; };
THREE.Path.prototype.bezierCurveTo = function( aCP1x, aCP1y, THREE.Path.prototype.bezierCurveTo = function( aCP1x, aCP1y,
aCP2x, aCP2y, aCP2x, aCP2y,
aX, aY ) { aX, aY ) {
var args = Array.prototype.slice.call( arguments ); var args = Array.prototype.slice.call( arguments );
...@@ -29090,14 +29090,14 @@ THREE.Path.prototype.arc = function ( aX, aY, aRadius, ...@@ -29090,14 +29090,14 @@ THREE.Path.prototype.arc = function ( aX, aY, aRadius,
this.absarc(aX + x0, aY + y0, aRadius, this.absarc(aX + x0, aY + y0, aRadius,
aStartAngle, aEndAngle, aClockwise ); aStartAngle, aEndAngle, aClockwise );
}; };
THREE.Path.prototype.absarc = function ( aX, aY, aRadius, THREE.Path.prototype.absarc = function ( aX, aY, aRadius,
aStartAngle, aEndAngle, aClockwise ) { aStartAngle, aEndAngle, aClockwise ) {
this.absellipse(aX, aY, aRadius, aRadius, aStartAngle, aEndAngle, aClockwise); this.absellipse(aX, aY, aRadius, aRadius, aStartAngle, aEndAngle, aClockwise);
}; };
THREE.Path.prototype.ellipse = function ( aX, aY, xRadius, yRadius, THREE.Path.prototype.ellipse = function ( aX, aY, xRadius, yRadius,
aStartAngle, aEndAngle, aClockwise ) { aStartAngle, aEndAngle, aClockwise ) {
...@@ -29109,7 +29109,7 @@ THREE.Path.prototype.ellipse = function ( aX, aY, xRadius, yRadius, ...@@ -29109,7 +29109,7 @@ THREE.Path.prototype.ellipse = function ( aX, aY, xRadius, yRadius,
aStartAngle, aEndAngle, aClockwise ); aStartAngle, aEndAngle, aClockwise );
}; };
THREE.Path.prototype.absellipse = function ( aX, aY, xRadius, yRadius, THREE.Path.prototype.absellipse = function ( aX, aY, xRadius, yRadius,
aStartAngle, aEndAngle, aClockwise ) { aStartAngle, aEndAngle, aClockwise ) {
...@@ -29223,7 +29223,7 @@ THREE.Path.prototype.getPoints = function( divisions, closedPath ) { ...@@ -29223,7 +29223,7 @@ THREE.Path.prototype.getPoints = function( divisions, closedPath ) {
points.push( new THREE.Vector2( tx, ty ) ); points.push( new THREE.Vector2( tx, ty ) );
} }
break; break;
...@@ -29373,7 +29373,7 @@ THREE.Path.prototype.getPoints = function( divisions, closedPath ) { ...@@ -29373,7 +29373,7 @@ THREE.Path.prototype.getPoints = function( divisions, closedPath ) {
var lastPoint = points[ points.length - 1]; var lastPoint = points[ points.length - 1];
var EPSILON = 0.0000000001; var EPSILON = 0.0000000001;
if ( Math.abs(lastPoint.x - points[ 0 ].x) < EPSILON && if ( Math.abs(lastPoint.x - points[ 0 ].x) < EPSILON &&
Math.abs(lastPoint.y - points[ 0 ].y) < EPSILON) Math.abs(lastPoint.y - points[ 0 ].y) < EPSILON)
points.splice( points.length - 1, 1); points.splice( points.length - 1, 1);
if ( closedPath ) { if ( closedPath ) {
...@@ -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.
先完成此消息的编辑!
想要评论请 注册