Exemple #1
0
        internal static void GetSection(ref K2SSecSteelItems secSteel, Model kModel, int croSecId)
        {
            switch (kModel.crosecs[croSecId])
            {
            case KCroSec.CroSec_Trapezoid secTrapezoid:
                AddTrapezoidSection(ref secSteel, secTrapezoid);
                break;

            case KCroSec.CroSec_Box secBox:
                AddBoxSection(ref secSteel, secBox);
                break;

            case KCroSec.CroSec_T secT:
                AddTShapeSection(ref secSteel, secT);
                break;

            case KCroSec.CroSec_I secH:
                AddHShapeSection(ref secSteel, secH);
                break;

            case KCroSec.CroSec_Circle secCircle:
                AddCircleSection(ref secSteel, secCircle);
                break;

            default:
                AddUnsupportedSection(ref secSteel, kModel, croSecId);
                break;
            }
        }
Exemple #2
0
        private void ModelTrussToStbBrace(List <StbSecBrace_S> secBrace_S, K2SSecSteelItems secSteel, ICollection <StbBrace> braces, ModelTruss modelTruss)
        {
            int trussCroSecId = _croSecNames.IndexOf(modelTruss.crosec.name);

            braces.Add(K2StbMemberItems.CreateBrace(modelTruss, trussCroSecId));
            if (_registeredCroSecId[2].IndexOf(trussCroSecId) < 0)
            {
                AddBraceSection(secBrace_S, secSteel, trussCroSecId, _tagNum[2]++);
            }
        }
Exemple #3
0
        private void AddBraceSection(ICollection <StbSecBrace_S> secBrace_S, K2SSecSteelItems secSteel, int croSecId, int vNum)
        {
            secBrace_S.Add(K2StbSections.BraceSteel(croSecId, vNum, _kModel));
            _registeredCroSecId[2].Add(croSecId);

            if (_registeredCroSecName[2].IndexOf(_kModel.crosecs[croSecId].name) < 0)
            {
                K2StbSecSteel.GetSection(ref secSteel, _kModel, croSecId);
                _registeredCroSecName[2].Add(_kModel.crosecs[croSecId].name);
            }
        }
Exemple #4
0
        private static void AddCircleSection(ref K2SSecSteelItems secSteel, KCroSec.CroSec_Circle secCircle)
        {
            var pipe = new StbSecPipe
            {
                name = secCircle.name,
                D    = secCircle.getHeight() * 1000,
                t    = secCircle.thick * 1000
            };

            if (secSteel.SecPipes == null)
            {
                secSteel.SecPipes = new List <StbSecPipe>();
            }
            secSteel.SecPipes.Add(pipe);
        }
Exemple #5
0
        private static void AddTrapezoidSection(ref K2SSecSteelItems secSteel, KCroSec.CroSec_Trapezoid secTrapezoid)
        {
            var trapezoid = new StbSecFlatBar
            {
                name = secTrapezoid.name,
                B    = secTrapezoid._height * 1000,
                t    = secTrapezoid.uf_width * 1000
            };

            if (secSteel.SecFlatBars == null)
            {
                secSteel.SecFlatBars = new List <StbSecFlatBar>();
            }
            secSteel.SecFlatBars.Add(trapezoid);
        }
Exemple #6
0
        public StbModel SetByAngle(double colMaxAngle)
        {
            // TODO: リストが大量にあるの直す
            var columns      = new List <StbColumn>();
            var girders      = new List <StbGirder>();
            var braces       = new List <StbBrace>();
            var secBeams_S   = new List <StbSecBeam_S>();
            var secBeams_Rc  = new List <StbSecBeam_RC>();
            var secColumn_S  = new List <StbSecColumn_S>();
            var secColumn_Rc = new List <StbSecColumn_RC>();
            var secBrace_S   = new List <StbSecBrace_S>();
            var secSteel     = new K2SSecSteelItems();

            foreach (ModelElement elem in _kModel.elems)
            {
                if (!(elem is ModelElementStraightLine))
                {
                    continue;
                }
                Karamba.Geometry.Point3 to   = _kModel.nodes[elem.node_inds[0]].pos;
                Karamba.Geometry.Point3 from = _kModel.nodes[elem.node_inds[1]].pos;
                var    elemLine = new Line(new Point3d(to.X, to.Y, to.Z), new Point3d(from.X, from.Y, from.Z));
                double pAngle   = Vector3d.VectorAngle(elemLine.Direction, Vector3d.ZAxis);
                double nAngle   = Vector3d.VectorAngle(elemLine.Direction, -Vector3d.ZAxis);

                switch (elem)
                {
                case ModelBeam modelBeam:
                    ModelBeamToStbColumnAndGirder(secBeams_Rc, secBeams_S, secColumn_Rc, secColumn_S, secSteel, colMaxAngle, columns, girders, pAngle, nAngle, modelBeam);
                    break;

                case ModelTruss modelTruss:
                    ModelTrussToStbBrace(secBrace_S, secSteel, braces, modelTruss);
                    break;

                default:
                    throw new ArgumentException("Karamba3D model parse error.");
                }
            }

            StbMembers  members  = BindMemberProps(columns, girders, braces);
            StbSections sections = BindSectionProps(secBeams_S, secBeams_Rc, secColumn_S, secColumn_Rc, secBrace_S, secSteel);

            return(new StbModel()
            {
                StbNodes = _kModel.nodes.ToStb(), StbMembers = members, StbSections = sections
            });
        }
Exemple #7
0
 private static StbSections BindSectionProps(
     IEnumerable <StbSecBeam_S> secBeams_S, IEnumerable <StbSecBeam_RC> secBeams_Rc,
     IEnumerable <StbSecColumn_S> secColumn_S, IEnumerable <StbSecColumn_RC> secColumn_Rc,
     IEnumerable <StbSecBrace_S> secBrace_S,
     K2SSecSteelItems secSteelItems)
 {
     return(new StbSections
     {
         StbSecColumn_S = secColumn_S.ToArray(),
         StbSecColumn_RC = secColumn_Rc.ToArray(),
         StbSecBeam_S = secBeams_S.ToArray(),
         StbSecBeam_RC = secBeams_Rc.ToArray(),
         StbSecBrace_S = secBrace_S.ToArray(),
         StbSecSteel = secSteelItems.ToStb(),
     });
 }
Exemple #8
0
        private static void AddUnsupportedSection(ref K2SSecSteelItems secSteel, Model kModel, int croSecId)
        {
            var unsupported = new StbSecPipe
            {
                name = kModel.crosecs[croSecId].name,
                D    = 10,
                t    = 1
            };

            if (secSteel.SecPipes == null)
            {
                secSteel.SecPipes = new List <StbSecPipe>();
            }

            secSteel.SecPipes.Add(unsupported);
        }
Exemple #9
0
        private static void AddTShapeSection(ref K2SSecSteelItems secSteel, KCroSec.CroSec_T secT)
        {
            var tShape = new StbSecRollT
            {
                name = secT.name,
                A    = secT._height * 1000,
                B    = secT.maxWidth() * 1000,
                r    = secT.fillet_r * 1000,
                t1   = secT.w_thick * 1000,
                t2   = secT.uf_thick * 1000,
                type = StbSecRollTType.T,
            };

            if (secSteel.SecRollTs == null)
            {
                secSteel.SecRollTs = new List <StbSecRollT>();
            }
            secSteel.SecRollTs.Add(tShape);
        }
Exemple #10
0
        private static void AddHShapeSection(ref K2SSecSteelItems secSteel, KCroSec.CroSec_I secH)
        {
            var hShape = new StbSecRollH
            {
                name = secH.name,
                A    = secH._height * 1000,
                B    = secH.maxWidth() * 1000,
                r    = secH.fillet_r * 1000,
                t1   = secH.w_thick * 1000,
                t2   = secH.uf_thick * 1000,
                type = StbSecRollHType.H
            };

            if (secSteel.SecRollHs == null)
            {
                secSteel.SecRollHs = new List <StbSecRollH>();
            }
            secSteel.SecRollHs.Add(hShape);
        }
Exemple #11
0
        private static void AddBoxSection(ref K2SSecSteelItems secSteel, KCroSec.CroSec_Box secBox)
        {
            double[] thickness = { secBox.w_thick, secBox.uf_thick, secBox.lf_thick };
            var      box       = new StbSecRollBOX
            {
                name = secBox.name,
                A    = secBox._height * 1000,
                B    = secBox.maxWidth() * 1000,
                r    = secBox.fillet_r * 1000,
                t    = thickness.Max() * 1000,
                type = StbSecRollBOXType.ELSE,
            };

            if (secSteel.SecRollBoxes == null)
            {
                secSteel.SecRollBoxes = new List <StbSecRollBOX>();
            }
            secSteel.SecRollBoxes.Add(box);
        }
Exemple #12
0
        private void AddColumnSection(ICollection <StbSecColumn_S> secColumns_S, ICollection <StbSecColumn_RC> secColumns_RC, K2SSecSteelItems secSteel, StbColumnKind_structure kind, int croSecId, int cNum)
        {
            switch (kind)
            {
            case StbColumnKind_structure.S:
                secColumns_S.Add(K2StbSections.ColumnSteel(croSecId, cNum, _kModel));

                if (_registeredCroSecName[0].IndexOf(_kModel.crosecs[croSecId].name) < 0)
                {
                    K2StbSecSteel.GetSection(ref secSteel, _kModel, croSecId);
                    _registeredCroSecName[0].Add(_kModel.crosecs[croSecId].name);
                }
                break;

            case StbColumnKind_structure.RC:
                secColumns_RC.Add(K2StbSections.ColumnRc(croSecId, cNum, _kModel));
                break;

            default:
                throw new ArgumentException("Make sure that the family name of the material is \"Concrete\" or \"Steel\".");
            }
            _registeredCroSecId[0].Add(croSecId);
        }
Exemple #13
0
        private void ModelBeamToStbColumnAndGirder(
            List <StbSecBeam_RC> secBeams_RC, List <StbSecBeam_S> secBeams_S, List <StbSecColumn_RC> secColumn_RC, List <StbSecColumn_S> secColumn_S, K2SSecSteelItems secSteel,
            double colMaxAngle, ICollection <StbColumn> columns, ICollection <StbGirder> girders, double pAngle, double nAngle, ModelBeam modelBeam)
        {
            int  croSecId = _croSecNames.IndexOf(modelBeam.crosec.name);
            bool positive = pAngle <= colMaxAngle && pAngle >= -1d * colMaxAngle;
            bool negative = nAngle <= colMaxAngle && nAngle >= -1d * colMaxAngle;

            if (positive || negative)
            {
                var kind = GetColumnStructureKind(modelBeam.crosec.material.family);
                columns.Add(K2StbMemberItems.CreateColumn(modelBeam, croSecId, kind));
                if (_registeredCroSecId[0].IndexOf(croSecId) < 0)
                {
                    AddColumnSection(secColumn_S, secColumn_RC, secSteel, kind, croSecId, _tagNum[0]++);
                }
            }
            else
            {
                var kind = GetGirderStructureKind(modelBeam.crosec.material.family);
                girders.Add(K2StbMemberItems.CreateGirder(modelBeam, croSecId, kind));
                if (_registeredCroSecId[1].IndexOf(croSecId) < 0)
                {
                    AddBeamSection(secBeams_S, secBeams_RC, secSteel, kind, croSecId, _tagNum[1]++);
                }
            }
        }