示例#1
0
        public static List <ICurve> ReinforcementLayout(this Bar bar)
        {
            if (bar.IsNull())
            {
                return(null);
            }

            List <ICurve>   barLocations = new List <ICurve>();
            ConcreteSection section      = bar.SectionProperty as ConcreteSection;

            List <ICurve> outerProfileEdges;
            List <ICurve> innerProfileEdges;
            List <LongitudinalReinforcement> longReif;
            List <TransverseReinforcement>   tranReif;
            double longCover, tranCover;

            if (section.CheckSectionAndExtractParameters(out outerProfileEdges, out innerProfileEdges, out longReif, out tranReif, out longCover, out tranCover))
            {
                TransformMatrix transformation = bar.BarSectionTranformation();
                double          length         = bar.Length();

                foreach (LongitudinalReinforcement reif in longReif)
                {
                    barLocations.AddRange(ReinforcementLayout(reif, longCover, outerProfileEdges, innerProfileEdges, length, transformation));
                }

                foreach (TransverseReinforcement reif in tranReif)
                {
                    barLocations.AddRange(ReinforcementLayout(reif, tranCover, outerProfileEdges, innerProfileEdges, length, transformation));
                }
            }

            return(barLocations);
        }
示例#2
0
        /***************************************************/
        /**** Public Methods                            ****/
        /***************************************************/

        public static List <IGeometry> Extrude(this Bar bar, bool simple = false)
        {
            System.Reflection.PropertyInfo prop = bar.SectionProperty.GetType().GetProperty("SectionProfile");

            IProfile profile;

            if (prop != null)
            {
                profile = prop.GetValue(bar.SectionProperty) as IProfile;
            }
            else
            {
                return(null);// bar.Geometry();
            }
            List <ICurve> secCurves = profile.Edges.ToList();

            Vector tan = bar.Tangent();

            TransformMatrix totalTransform = bar.BarSectionTranformation();

            if (simple)
            {
                return(ExtrudeSimple(secCurves, totalTransform, tan));
            }
            else
            {
                return(ExtrudeFullCurves(secCurves, totalTransform, tan));
            }
        }
示例#3
0
        public static List <IGeometry> Extrude(this Bar bar, bool simple = false)
        {
            if (bar.IsNull())
            {
                return(null);
            }

            if (bar.SectionProperty == null || !(bar.SectionProperty is IGeometricalSection))
            {
                return(new List <IGeometry>());
            }

            IProfile profile = (bar.SectionProperty as IGeometricalSection).SectionProfile;

            List <ICurve> secCurves = profile.Edges.ToList();

            Vector tan = bar.Tangent();

            TransformMatrix totalTransform = bar.BarSectionTranformation();

            if (simple)
            {
                return(ExtrudeSimple(secCurves, totalTransform, tan));
            }
            else
            {
                return(ExtrudeFullCurves(secCurves, totalTransform, tan));
            }
        }
示例#4
0
        public static List <IReinforcingBar> ReinforcingBars(this Bar bar)
        {
            if (bar.IsNull())
            {
                return(null);
            }

            List <IReinforcingBar> rebars  = new List <IReinforcingBar>();
            ConcreteSection        section = bar.SectionProperty as ConcreteSection;

            List <ICurve> outerProfileEdges;
            List <ICurve> innerProfileEdges;
            List <LongitudinalReinforcement> longReif;
            List <TransverseReinforcement>   tranReif;
            double longCover, tranCover;

            if (section.CheckSectionAndExtractParameters(out outerProfileEdges, out innerProfileEdges, out longReif, out tranReif, out longCover, out tranCover))
            {
                TransformMatrix transformation = bar.BarSectionTranformation();
                double          length         = bar.Length();

                List <IBarReinforcement> barReinf = new List <IBarReinforcement>();
                barReinf.AddRange(longReif);
                barReinf.AddRange(tranReif);

                foreach (IBarReinforcement reif in barReinf)
                {
                    Material material;
                    if (reif.Material != null)
                    {
                        material = Physical.Create.Material(reif.Material);
                    }
                    else
                    {
                        material = new Material();
                    }

                    if (reif is LongitudinalReinforcement)
                    {
                        foreach (ICurve centreLine in reif.IReinforcementLayout(longCover, outerProfileEdges, innerProfileEdges, length, transformation))
                        {
                            PrimaryReinforcingBar rebar = Physical.Create.PrimaryReinforcingBar(centreLine, reif.Diameter, material);
                            rebars.Add(rebar);
                        }
                    }
                    else if (reif is TransverseReinforcement)
                    {
                        foreach (ICurve centreLine in reif.IReinforcementLayout(tranCover, outerProfileEdges, innerProfileEdges, length, transformation))
                        {
                            Stirrup rebar = Physical.Create.Stirrup(centreLine, reif.Diameter, material);
                            rebars.Add(rebar);
                        }
                    }
                }
            }

            return(rebars);
        }