提交 a38e937c 编写于 作者: J Jonathan Brandel

added line node

上级 4416d9ee
......@@ -74,6 +74,10 @@ THREE.SVGLoader.prototype = {
paths.push( parseEllipseNode( node ) );
break;
case 'line':
paths.push( parseLineNode( node ) );
break;
default:
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
function getReflection( a, b ) {
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册