|
@@ -74,6 +74,10 @@ THREE.SVGLoader.prototype = {
|
|
paths.push( parseEllipseNode( node ) );
|
|
paths.push( parseEllipseNode( node ) );
|
|
break;
|
|
break;
|
|
|
|
|
|
|
|
+ case 'line':
|
|
|
|
+ paths.push( parseLineNode( node ) );
|
|
|
|
+ break;
|
|
|
|
+
|
|
default:
|
|
default:
|
|
console.log( node );
|
|
console.log( node );
|
|
|
|
|
|
@@ -422,6 +426,22 @@ THREE.SVGLoader.prototype = {
|
|
|
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
+ function parseLineNode( node ) {
|
|
|
|
+
|
|
|
|
+ var x1 = parseFloat( node.getAttribute( 'x1' ) );
|
|
|
|
+ var y1 = parseFloat( node.getAttribute( 'y1' ) );
|
|
|
|
+ var x2 = parseFloat( node.getAttribute( 'x2' ) );
|
|
|
|
+ var y2 = parseFloat( node.getAttribute( 'y2' ) );
|
|
|
|
+
|
|
|
|
+ var path = new THREE.ShapePath();
|
|
|
|
+ path.moveTo( x1, y1 );
|
|
|
|
+ path.lineTo( x2, y2 );
|
|
|
|
+ path.currentPath.autoClose = false;
|
|
|
|
+
|
|
|
|
+ return path;
|
|
|
|
+
|
|
|
|
+ }
|
|
|
|
+
|
|
// http://www.w3.org/TR/SVG11/implnote.html#PathElementImplementationNotes
|
|
// http://www.w3.org/TR/SVG11/implnote.html#PathElementImplementationNotes
|
|
|
|
|
|
function getReflection( a, b ) {
|
|
function getReflection( a, b ) {
|