public static List <Line> ReinforcementLayout(this LongitudinalReinforcement reinforcement, double cover, List <ICurve> outerProfileEdges, List <ICurve> innerProfileEdges, double length, TransformMatrix transformation) { if (reinforcement.IsNull() || outerProfileEdges.Any(x => x.IsNull()) || transformation.IsNull()) { return(null); } else if (length < Tolerance.MicroDistance) { Reflection.Compute.RecordError("The length provided is less than or equal to the tolerance."); return(null); } List <Point> planLayout = ReinforcementLayout(reinforcement, cover, outerProfileEdges, innerProfileEdges); double start = reinforcement.StartLocation * length; double end = reinforcement.EndLocation * length; List <Line> rebarLines = new List <Line>(); foreach (Point pt in planLayout) { Point startPoint = new Point { X = pt.X, Y = pt.Y, Z = start }; Point endPoint = new Point { X = pt.X, Y = pt.Y, Z = end }; rebarLines.Add((new Line { Start = startPoint, End = endPoint }).Transform(transformation)); } return(rebarLines); }
public static List <ICurve> IReinforcementLayout(this IBarReinforcement reinforcement, double cover, List <ICurve> outerProfileEdges, List <ICurve> innerProfileEdges, double length, TransformMatrix transformation) { if (reinforcement.IsNull() || outerProfileEdges.Any(x => x.IsNull()) || transformation.IsNull()) { return(null); } else if (length <= Tolerance.MicroDistance) { Reflection.Compute.RecordError("The length provided is less than or equal to the tolerance."); return(null); } return(new List <ICurve>(ReinforcementLayout(reinforcement as dynamic, cover, outerProfileEdges, innerProfileEdges, length, transformation))); }
public static List <ICurve> ReinforcementLayout(this TransverseReinforcement reinforcement, double cover, List <ICurve> outerProfileEdges, List <ICurve> innerProfileEdges, double length, TransformMatrix transformation) { if (reinforcement.IsNull() || outerProfileEdges.Any(x => x.IsNull()) || transformation.IsNull()) { return(null); } else if (length <= Tolerance.MicroDistance) { Reflection.Compute.RecordError("The length provided is less than or equal to the tolerance."); return(null); } List <ICurve> rebarLines = new List <ICurve>(); List <ICurve> stirrupOutline = reinforcement.ReinforcementLayout(cover, outerProfileEdges, innerProfileEdges); Vector dir = Vector.ZAxis.Transform(transformation); double stirrupRange = (reinforcement.EndLocation - reinforcement.StartLocation) * length - (2 * cover + reinforcement.Diameter); int count; double spacing = reinforcement.Spacing; if (reinforcement.AdjustSpacingToFit) { count = (int)Math.Ceiling(stirrupRange / reinforcement.Spacing); spacing = stirrupRange / count; } else { count = (int)Math.Floor(stirrupRange / reinforcement.Spacing); } if (stirrupOutline.Count != 0) { for (int k = 0; k < stirrupOutline.Count; k++) { rebarLines.Add(stirrupOutline[k].ITransform(transformation).ITranslate(dir * (reinforcement.StartLocation * length + cover + reinforcement.Diameter / 2))); for (int i = 0; i < count; i++) { rebarLines.Add(rebarLines.Last().ITranslate(dir * spacing)); } } } return(rebarLines); }