未验证 提交 06333e48 编写于 作者: T Tom Valkeneers 提交者: GitHub

SVGLoader: Remove paths with a length less than 2 points. (#21752)

* SVGLOADER remove paths with a length less than 2 points.

* added extra test
上级 31d1746a
......@@ -1873,7 +1873,7 @@
};
} );
simplePaths = simplePaths.filter( sp => sp.points.length > 0 ); // check if path is solid or a hole
simplePaths = simplePaths.filter( sp => sp.points.length > 1 ); // check if path is solid or a hole
const isAHole = simplePaths.map( p => isHoleTo( p, simplePaths, scanlineMinX, scanlineMaxX, shapePath.userData.style.fillRule ) );
const shapesToReturn = [];
......
......@@ -2047,7 +2047,7 @@ class SVGLoader extends Loader {
} );
simplePaths = simplePaths.filter( sp => sp.points.length > 0 );
simplePaths = simplePaths.filter( sp => sp.points.length > 1 );
// check if path is solid or a hole
const isAHole = simplePaths.map( p => isHoleTo( p, simplePaths, scanlineMinX, scanlineMaxX, shapePath.userData.style.fillRule ) );
......
此差异已折叠。
......@@ -92,6 +92,7 @@
"Three.js": 'models/svg/threejs.svg',
"Joins and caps": 'models/svg/lineJoinsAndCaps.svg',
"Hexagon": 'models/svg/hexagon.svg',
"Energy": 'models/svg/energy.svg',
"Test 1": 'models/svg/tests/1.svg',
"Test 2": 'models/svg/tests/2.svg',
"Test 3": 'models/svg/tests/3.svg',
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册