/// <summary> /// This is the method that actually does the work. /// </summary> /// <param name="DA">The DA object can be used to retrieve data from input parameters and /// to store data in output parameters.</param> protected override void SolveInstance(IGH_DataAccess DA) { Position basePosi = new Position(); SpiralSpecs dimension = new SpiralSpecs(); SpiralPart p1 = new SpiralPart(); if (DA.GetData(0, ref basePosi) && DA.GetData(1, ref dimension)) { p1 = new SpiralPart(basePosi, dimension); } DA.SetData(0, p1); DA.SetData(1, p1.EndPst); }
private static List <Point3d> CreatPoints(Position strPst, SpiralSpecs dimension, double radius) { List <Point3d> plist = new List <Point3d>(); int stepCount = dimension.StepCount; double stepAngle = dimension.RotateAngle / stepCount; Point3d basePt = strPst.BasePoint; double strAngle = strPst.Angle; for (int i = 0; i < stepCount + 1; i++) { double angleRotate = (strAngle + dimension.DirMultiple * i * stepAngle) * Math.PI / 180; double x = basePt.X + radius * Math.Cos(angleRotate); double y = basePt.Y + radius * Math.Sin(angleRotate); double z = basePt.Z + i * dimension.StepH; Point3d pt = new Point3d(x, y, z); plist.Add(pt); } return(plist); }
/// <summary> /// This is the method that actually does the work. /// </summary> /// <param name="DA">The DA object is used to retrieve from inputs and store in outputs.</param> protected override void SolveInstance(IGH_DataAccess DA) { Double radius = new double(); Double width = new double(); Double angle = new double(); Double height = new double(); int counts = new int(); Boolean boolDir = true; DA.GetData(0, ref radius); DA.GetData(1, ref width); DA.GetData(2, ref angle); DA.GetData(3, ref height); DA.GetData(4, ref counts); DA.GetData(5, ref boolDir); SpiralSpecs dimension = new SpiralSpecs(radius, width, angle, height, counts, boolDir); DA.SetData(0, dimension); }
/// <summary> /// 螺旋段构造函数,主要使用起点参数和螺旋段规格参数 /// </summary> /// <param name="strPosition"></param> /// <param name="spiralDimension">螺旋段规格参数:包含内半径、宽度、旋转角度、踏步高度、踏步数量</param> public SpiralPart(Position strPosition, SpiralSpecs spiralDimension) : base(strPosition, spiralDimension) { SetEndPst(); }
protected StairBase(Position strPst, SpiralSpecs spirDim) { StartPst = strPst; SpiralDimension = spirDim; }