public void BuildStirrupShape(Plane plane, double height, double width, BendingRoller bendingRoller, int hooksType, double hookLength) { Rectangle3d rectangle = new Rectangle3d(plane, width, height); CoverDimensions coverDimensions = new CoverDimensions(0.0, 0.0, 0.0, 0.0); BuildRectangleToStirrupShape(rectangle, bendingRoller, hooksType, coverDimensions, hookLength); }
public void BuildRectangleToUBarShape(Rectangle3d rectangle, BendingRoller bendingRoller, int position, CoverDimensions coverDimensions, double hookLength) { List <Point3d> shapePoints = RebarPoints.CreateForUBarFromRectangle(rectangle, position, coverDimensions, hookLength, Props); PolylineCurve polyline = new PolylineCurve(shapePoints); Curve filletedPolyline = CreateFilletPolylineWithBendingRoller(polyline, bendingRoller); RebarCurve = CreateRebarCurveInAnotherPlane(filletedPolyline, Plane.WorldXY, rectangle.Plane); RebarMesh = CreateRebarMesh(RebarCurve, Props.Radius); }
public static List <Point3d> CreateForUBarFromRectangle(Rectangle3d rectangle, int position, CoverDimensions coverDimensions, double hookLength, RebarProperties props) { if (hookLength <= 0) { throw new ArgumentException("Hook Length should be > 0"); } Point3d topLeft; Point3d bottomLeft; Point3d bottomRight; Point3d topRight; if (position == 0) { topLeft = new Point3d(rectangle.X.Min + coverDimensions.Left + props.Radius, rectangle.Y.Max - coverDimensions.Top - hookLength, 0); bottomLeft = new Point3d(rectangle.X.Min + coverDimensions.Left + props.Radius, rectangle.Y.Max - coverDimensions.Top - props.Radius, 0); bottomRight = new Point3d(rectangle.X.Max - coverDimensions.Right - props.Radius, rectangle.Y.Max - coverDimensions.Top - props.Radius, 0); topRight = new Point3d(rectangle.X.Max - coverDimensions.Right - props.Radius, rectangle.Y.Max - coverDimensions.Top - hookLength, 0); } else if (position == 1) { topLeft = new Point3d(rectangle.X.Max - coverDimensions.Right - hookLength, rectangle.Y.Min + coverDimensions.Bottom + props.Radius, 0); bottomLeft = new Point3d(rectangle.X.Max - coverDimensions.Right - props.Radius, rectangle.Y.Min + coverDimensions.Bottom + props.Radius, 0); bottomRight = new Point3d(rectangle.X.Max - coverDimensions.Right - props.Radius, rectangle.Y.Max - coverDimensions.Top - props.Radius, 0); topRight = new Point3d(rectangle.X.Max - coverDimensions.Right - hookLength, rectangle.Y.Max - coverDimensions.Top - props.Radius, 0); } else if (position == 2) { topLeft = new Point3d(rectangle.X.Min + coverDimensions.Left + props.Radius, rectangle.Y.Min + coverDimensions.Bottom + hookLength, 0); bottomLeft = new Point3d(rectangle.X.Min + coverDimensions.Left + props.Radius, rectangle.Y.Min + coverDimensions.Bottom + props.Radius, 0); bottomRight = new Point3d(rectangle.X.Max - coverDimensions.Right - props.Radius, rectangle.Y.Min + coverDimensions.Bottom + props.Radius, 0); topRight = new Point3d(rectangle.X.Max - coverDimensions.Right - props.Radius, rectangle.Y.Min + coverDimensions.Bottom + hookLength, 0); } else if (position == 3) { topLeft = new Point3d(rectangle.X.Min + coverDimensions.Left + hookLength, rectangle.Y.Max - coverDimensions.Top - props.Radius, 0); bottomLeft = new Point3d(rectangle.X.Min + coverDimensions.Left + props.Radius, rectangle.Y.Max - coverDimensions.Top - props.Radius, 0); bottomRight = new Point3d(rectangle.X.Min + coverDimensions.Left + props.Radius, rectangle.Y.Min + coverDimensions.Bottom + props.Radius, 0); topRight = new Point3d(rectangle.X.Min + coverDimensions.Left + hookLength, rectangle.Y.Min + coverDimensions.Bottom + props.Radius, 0); } else { throw new ArgumentException("Position should be between 0 and 3"); } return(new List <Point3d> { topLeft, bottomLeft, bottomRight, topRight }); }
public static List <Point3d> CreateForLineFromRectangle(Rectangle3d rectangle, int position, CoverDimensions coverDimensions, RebarProperties props) { Point3d startPoint; Point3d endPoint; if (position == 0) { startPoint = new Point3d(rectangle.X.Min + coverDimensions.Left, rectangle.Y.Max - coverDimensions.Top - props.Radius, 0); endPoint = new Point3d(rectangle.X.Max - coverDimensions.Right, rectangle.Y.Max - coverDimensions.Top - props.Radius, 0); } else if (position == 1) { startPoint = new Point3d(rectangle.X.Max - coverDimensions.Right - props.Radius, rectangle.Y.Max - coverDimensions.Top, 0); endPoint = new Point3d(rectangle.X.Max - coverDimensions.Right - props.Radius, rectangle.Y.Min + coverDimensions.Bottom, 0); } else if (position == 2) { startPoint = new Point3d(rectangle.X.Min + coverDimensions.Left, rectangle.Y.Min + coverDimensions.Bottom + props.Radius, 0); endPoint = new Point3d(rectangle.X.Max - coverDimensions.Right, rectangle.Y.Min + coverDimensions.Bottom + props.Radius, 0); } else if (position == 3) { startPoint = new Point3d(rectangle.X.Min + coverDimensions.Left + props.Radius, rectangle.Y.Min + coverDimensions.Bottom, 0); endPoint = new Point3d(rectangle.X.Min + coverDimensions.Left + props.Radius, rectangle.Y.Max - coverDimensions.Top, 0); } else { throw new ArgumentException("Position should be between 0 and 3"); } return(new List <Point3d> { startPoint, endPoint }); }
public static List <Point3d> CreateStirrupFromRectangleShape(Rectangle3d rectangle, int hooksType, BendingRoller bendingRoller, CoverDimensions coverDimensions, double hookLength, RebarProperties props) { if (hookLength <= 0) { throw new ArgumentException("Hook Length should be > 0"); } List <Point3d> stirrupPoints = new List <Point3d>(); double bendingRollerRadius = bendingRoller.Diameter / 2.0; double yBottom = rectangle.Y.Min + coverDimensions.Bottom + props.Radius; double yTop = rectangle.Y.Max - coverDimensions.Top - props.Radius; double xLeft = rectangle.X.Min + coverDimensions.Left + props.Radius; double xRight = rectangle.X.Max - coverDimensions.Right - props.Radius; if (hooksType == 0) { stirrupPoints.Add(new Point3d(xLeft + hookLength - props.Radius, yTop, -props.Radius)); stirrupPoints.Add(new Point3d(xLeft, yTop, -props.Radius)); stirrupPoints.Add(new Point3d(xLeft, yBottom, -props.Radius)); stirrupPoints.Add(new Point3d(xRight, yBottom, -props.Radius)); stirrupPoints.Add(new Point3d(xRight, yTop, props.Radius)); stirrupPoints.Add(new Point3d(xLeft, yTop, props.Radius)); stirrupPoints.Add(new Point3d(xLeft, yTop - hookLength + props.Radius, props.Radius)); } else if (hooksType == 1) { double polylinePointOffsetForHook = (bendingRollerRadius + props.Radius) * Math.Sqrt(2); double hookEndPointOffset = ((Math.Sqrt(2) - 1) * (bendingRollerRadius + props.Radius) - props.Radius + hookLength + (bendingRollerRadius + props.Radius)) / Math.Sqrt(2); stirrupPoints.Add(new Point3d(xLeft + hookEndPointOffset, yTop + polylinePointOffsetForHook - hookEndPointOffset, -props.Radius)); stirrupPoints.Add(new Point3d(xLeft, yTop + polylinePointOffsetForHook, -props.Radius)); stirrupPoints.Add(new Point3d(xLeft, yBottom, -props.Radius)); stirrupPoints.Add(new Point3d(xRight, yBottom, -props.Radius)); stirrupPoints.Add(new Point3d(xRight, yTop, props.Radius)); stirrupPoints.Add(new Point3d(xLeft - polylinePointOffsetForHook, yTop, props.Radius)); stirrupPoints.Add(new Point3d(xLeft - polylinePointOffsetForHook + hookEndPointOffset, yTop - hookEndPointOffset, props.Radius)); } else { throw new ArgumentException("Hooks Type should be between 0 and 1"); } return(stirrupPoints); }
public void BuildRectangleToLineBarShape(Rectangle3d rectangle, int position, CoverDimensions coverDimensions) { List <Point3d> shapePoints = RebarPoints.CreateForLineFromRectangle(rectangle, position, coverDimensions, Props); LineCurve line = new LineCurve(shapePoints[0], shapePoints[1]); RebarCurve = CreateRebarCurveInAnotherPlane(line, Plane.WorldXY, rectangle.Plane); RebarMesh = CreateRebarMesh(RebarCurve, Props.Radius); }