Beispiel #1
0
        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);
        }
Beispiel #2
0
        public void BuildLBarShape(Plane insertPlane, double height, double width, BendingRoller bendingRoller)
        {
            List <Point3d> shapePoints = RebarPoints.CreateForLBarShape(height, width, Props);

            PolylineCurve polyline         = new PolylineCurve(shapePoints);
            Curve         filletedPolyline = CreateFilletPolylineWithBendingRoller(polyline, bendingRoller);

            RebarCurve = CreateRebarCurveInAnotherPlane(filletedPolyline, Plane.WorldXY, insertPlane);
            RebarMesh  = CreateRebarMesh(RebarCurve, Props.Radius);
        }
Beispiel #3
0
        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);
        }
Beispiel #4
0
        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);
        }
Beispiel #5
0
        public void PolylineToRebarShape(Curve rebarCurve, BendingRoller bendingRoller)
        {
            if (!rebarCurve.TryGetPolyline(out Polyline rebarPolyline))
            {
                throw new ArgumentException("Input curve is not a polyline");
            }
            if (rebarPolyline.Count < 3)
            {
                throw new ArgumentException("Polyline has to contain at least 3 points");
            }

            RebarCurve = CreateFilletPolylineWithBendingRoller(rebarCurve, bendingRoller);
            RebarMesh  = CreateRebarMesh(RebarCurve, Props.Radius);
        }
Beispiel #6
0
        private Curve CreateFilletPolylineWithBendingRoller(Curve rebarCurve, BendingRoller bendingRoller)
        {
            Curve filletedCurve = Curve.CreateFilletCornersCurve(rebarCurve, bendingRoller.Diameter / 2.0 + Props.Radius, bendingRoller.Tolerance, bendingRoller.AngleTolerance);

            if (filletedCurve == null)
            {
                throw new Exception("Cannot create fillets for this parameters. Try to change Bending Roller or shape.");
            }
            if (filletedCurve.IsPolyline())
            {
                throw new Exception("Rebar curve cannot be a polyline - check if Bending Roller is set properly");
            }

            return(filletedCurve);
        }