/// <summary> /// Create Edge (Line) from Dynamo NurbsCurve. /// </summary> public static Geometry.Edge FromDynamoLinearNurbsCurve(Autodesk.DesignScript.Geometry.NurbsCurve obj) { FdPoint3d startPoint = FdPoint3d.FromDynamo(obj.StartPoint); FdPoint3d endPoint = FdPoint3d.FromDynamo(obj.EndPoint); // lcs FdCoordinateSystem cs = FdCoordinateSystem.FromDynamoCurve(obj); // return return(new Geometry.Edge(startPoint, endPoint, cs)); }
/// <summary> /// Create Edge (Circle) from Dynamo Circle. /// </summary> public static Geometry.Edge FromDynamoCircle(Autodesk.DesignScript.Geometry.Circle obj) { double radius = obj.Radius; FdPoint3d centerPoint = FdPoint3d.FromDynamo(obj.CenterPoint); // lcs FdCoordinateSystem cs = FdCoordinateSystem.FromDynamoCurve(obj); // return return(new Geometry.Edge(radius, centerPoint, cs)); }
/// <summary> /// Create Edge (Arc2) from Dynamo Arc. /// Used for bar definition. /// </summary> public static Geometry.Edge FromDynamoArc2(Autodesk.DesignScript.Geometry.Arc obj) { FdPoint3d p0 = FdPoint3d.FromDynamo(obj.StartPoint); FdPoint3d p1 = FdPoint3d.FromDynamo(obj.PointAtParameter(0.5)); FdPoint3d p2 = FdPoint3d.FromDynamo(obj.EndPoint); // lcs FdCoordinateSystem cs = FdCoordinateSystem.FromDynamoCurve(obj); // return return(new Geometry.Edge(p0, p1, p2, cs)); }
/// <summary> /// Create Edge (Arc1) from Dynamo Arc. /// </summary> public static Geometry.Edge FromDynamoArc1(Autodesk.DesignScript.Geometry.Arc obj) { double radius = obj.Radius; double startAngle = 0; double endAngle = startAngle + Degree.ToRadians(obj.SweepAngle); FdPoint3d centerPoint = FdPoint3d.FromDynamo(obj.CenterPoint); FdVector3d xAxis = new FdVector3d(centerPoint, FdPoint3d.FromDynamo(obj.StartPoint)).Normalize(); // lcs FdCoordinateSystem cs = FdCoordinateSystem.FromDynamoCurve(obj); // return return(new Geometry.Edge(radius, startAngle, endAngle, centerPoint, xAxis, cs)); }