瀏覽代碼

Tune up curveToPoints for Arcs

Luis Fraguada 4 年之前
父節點
當前提交
39aa03a402
共有 1 個文件被更改,包括 12 次插入2 次删除
  1. 12 2
      examples/jsm/loaders/3DMLoader.js

+ 12 - 2
examples/jsm/loaders/3DMLoader.js

@@ -1052,7 +1052,6 @@ Rhino3dmLoader.Rhino3dmWorker = function () {
 				var pts = curveToPoints( _geometry, 100 );
 				var pts = curveToPoints( _geometry, 100 );
 
 
 				var position = {};
 				var position = {};
-				var color = {};
 				var attributes = {};
 				var attributes = {};
 				var data = {};
 				var data = {};
 
 
@@ -1265,9 +1264,20 @@ Rhino3dmLoader.Rhino3dmWorker = function () {
 
 
 		}
 		}
 
 
+		if ( curve instanceof rhino.ArcCurve ) {
+
+			pointCount = Math.floor( curve.angleDegrees / 5 );
+			pointCount = pointCount < 1 ? 2 : pointCount;
+
+		}
+
 		if ( curve instanceof rhino.NurbsCurve && curve.degree === 1 ) {
 		if ( curve instanceof rhino.NurbsCurve && curve.degree === 1 ) {
 
 
-			// console.info( 'degree 1 curve' );
+			if ( curve.segmentCount === undefined || curve.segmentCount === 1 ) {
+
+				return [ curve.pointAtStart, curve.pointAtEnd ];
+
+			}
 
 
 		}
 		}