internal bool IsLineCurve(Dyn.Curve c) { double lenC = c.Length; Dyn.Line ln = Dyn.Line.ByStartPointEndPoint(c.StartPoint, c.EndPoint); double lenL = ln.Length; ln.Dispose(); if (Math.Abs(lenC - lenL) < 0.001) { return(true); } else { return(false); } }
internal sCurve TosCurve(Dyn.Curve dc) { sCurve sc = null; Dyn.Line dl = dc as Dyn.Line; if (dl != null) { sc = TosLine(dl); sc.curveType = eCurveType.LINE; dl.Dispose(); } Dyn.PolyCurve pc = dc as Dyn.PolyCurve; if (pc != null) { if (pc.NumberOfCurves == 1) { //// //what if this segement is nurbsCurve?????? //PolyCurve can be joined nurbsCurve!!!!!!!!! /// Dyn.Line dtl = Dyn.Line.ByStartPointEndPoint(pc.StartPoint, pc.EndPoint); sc = TosLine(dtl); sc.curveType = eCurveType.LINE; dtl.Dispose(); } else { sc = TosPolyLine(pc); sc.curveType = eCurveType.POLYLINE; } pc.Dispose(); } // Dyn.NurbsCurve nc = dc as Dyn.NurbsCurve; // if(nc != null) // { // // } return(sc); }