Bladeren bron

SVGLoader: Make createShapes() retain curves (#22778)

georgpukk 3 jaren geleden
bovenliggende
commit
a39e849862
1 gewijzigde bestanden met toevoegingen van 7 en 4 verwijderingen
  1. 7 4
      examples/jsm/loaders/SVGLoader.js

+ 7 - 4
examples/jsm/loaders/SVGLoader.js

@@ -2084,7 +2084,7 @@ class SVGLoader extends Loader {
 
 
 			}
 			}
 
 
-			return { points: points, isCW: ShapeUtils.isClockWise( points ), identifier: identifier ++, boundingBox: new Box2( new Vector2( minX, minY ), new Vector2( maxX, maxY ) ) };
+			return { curves: p.curves, points: points, isCW: ShapeUtils.isClockWise( points ), identifier: identifier ++, boundingBox: new Box2( new Vector2( minX, minY ), new Vector2( maxX, maxY ) ) };
 
 
 		} );
 		} );
 
 
@@ -2101,12 +2101,15 @@ class SVGLoader extends Loader {
 
 
 			if ( ! amIAHole.isHole ) {
 			if ( ! amIAHole.isHole ) {
 
 
-				const shape = new Shape( p.points );
+				const shape = new Shape();
+				shape.curves = p.curves;
 				const holes = isAHole.filter( h => h.isHole && h.for === p.identifier );
 				const holes = isAHole.filter( h => h.isHole && h.for === p.identifier );
 				holes.forEach( h => {
 				holes.forEach( h => {
 
 
-					const path = simplePaths[ h.identifier ];
-					shape.holes.push( new Path( path.points ) );
+					const hole = simplePaths[ h.identifier ];
+					const path = new Path();
+					path.curves = hole.curves;
+					shape.holes.push( path );
 
 
 				} );
 				} );
 				shapesToReturn.push( shape );
 				shapesToReturn.push( shape );