示例#1
0
        public static TransverseReinforcement TransverseReinforcement(ICurveLayout curveLayout, double diameter, double spacing, bool adjustSpacingToFit = true, double startLocation = 0, double endLocation = 1, IMaterialFragment material = null)
        {
            if (curveLayout.IsNull())
            {
                return(null);
            }
            else if (diameter < Tolerance.Distance || spacing < Tolerance.Distance)
            {
                Reflection.Compute.RecordError("The diameter or spacing is less than the tolerance. Please check your inputs.");
                return(null);
            }


            CheckEndLocations(ref startLocation, ref endLocation);
            return(new TransverseReinforcement
            {
                CenterlineLayout = curveLayout,
                Diameter = diameter,
                Spacing = spacing,
                AdjustSpacingToFit = adjustSpacingToFit,
                Material = material ?? Query.Default(MaterialType.Rebar),
                StartLocation = startLocation,
                EndLocation = endLocation,
            });
        }
 public static TransverseReinforcement TransverseReinforcement(ICurveLayout curveLayout, double diameter, double spacing, bool adjustSpacingToFit, double startLocation = 0, double endLocation = 1, IMaterialFragment material = null)
 {
     CheckEndLocations(ref startLocation, ref endLocation);
     return(new TransverseReinforcement
     {
         CenterlineLayout = curveLayout,
         Diameter = diameter,
         Spacing = spacing,
         AdjustSpacingToFit = adjustSpacingToFit,
         Material = material ?? Query.Default(MaterialType.Rebar),
         StartLocation = startLocation,
         EndLocation = endLocation,
     });
 }
示例#3
0
        public static bool IsNull(this ICurveLayout layout, string msg = "", [CallerMemberName] string methodName = "")
        {
            if (layout == null)
            {
                if (string.IsNullOrEmpty(methodName))
                {
                    methodName = "Method";
                }
                Reflection.Compute.RecordError($"Cannot evaluate {methodName} because the CurveLayout failed a null check. {msg}");

                return(true);
            }

            return(false);
        }
示例#4
0
 public static List <ICurve> ICurveLayout(this ICurveLayout curveLayout, IEnumerable <ICurve> hostRegionCurves, IEnumerable <ICurve> openingCurves = null, double minOffset = 0)
 {
     return(CurveLayout(curveLayout as dynamic, hostRegionCurves, openingCurves, minOffset));
 }