public RectangularCrossSection(ModelOptions modelOption, double x, double y, double depth)
        {
            //Position of the 2D rectangular section (Will remain fixed).
            CartesianPoint2D  p           = CartesianPoint2D.Origin(modelOption.Model);
            DirectionVector2D v           = DirectionVector2D.UnitX(modelOption.Model);
            PlacementAxis2D   postion     = new PlacementAxis2D(modelOption.Model, p, v);
            RectangleProfile  rectProfile = new RectangleProfile(modelOption.Model, x, y, Xbim.Ifc2x3.ProfileResource.IfcProfileTypeEnum.AREA, postion);


            //Local placement of the 3D definition shape of the column(Will remain fixed).
            CartesianPoint3D    Expoint        = CartesianPoint3D.Origin(modelOption.Model);
            DirectionVector3D   exMain         = DirectionVector3D.UnitZ(modelOption.Model);
            DirectionVector3D   exReff         = DirectionVector3D.UnitX(modelOption.Model);
            PlacementAxis3D     Exaxis         = new PlacementAxis3D(modelOption.Model, Expoint, exMain, exReff);
            DirectionVector3D   extVec         = DirectionVector3D.UnitZ(modelOption.Model);
            ExtrudedAreaSolid   solid          = new ExtrudedAreaSolid(modelOption.Model, depth, rectProfile, extVec, Exaxis);
            ShapeRepresentation representation = new ShapeRepresentation(modelOption.Model, modelOption.Environment.SubContext, new List <ExtrudedAreaSolid>()
            {
                solid
            });

            ProductShape = new ProductionDefinitionShape(modelOption.Model, new List <ShapeRepresentation>()
            {
                representation
            });



            //Local placement of the object placement of the column (This will be manipulated according to Autodesk Revit readings).
            CartesianPoint3D  point     = CartesianPoint3D.Origin(modelOption.Model);
            DirectionVector3D main      = DirectionVector3D.UnitZ(modelOption.Model);
            DirectionVector3D reff      = DirectionVector3D.UnitX(modelOption.Model);
            PlacementAxis3D   axis      = new PlacementAxis3D(modelOption.Model, point, main, reff);
            LocalPlacement    placement = new LocalPlacement(modelOption.Model, modelOption.Environment.Stories.FirstOrDefault().LocalPlacement, axis);
        }
예제 #2
0
파일: Opening.cs 프로젝트: BHoM/BHoM_Engine
        public static Opening Opening(Cartesian coordinateSystem, double height, double width, double depth)
        {
            RectangleProfile profile = BH.Engine.Spatial.Create.RectangleProfile(height, width);

            return(new Opening {
                CoordinateSystem = coordinateSystem, Profile = profile, Depth = depth
            });
        }
예제 #3
0
        /***************************************************/

        public static RectangleProfile InterpolateProfile(RectangleProfile startProfile, RectangleProfile endProfile, double parameter, int interpolationOrder,
                                                          double domainStart = 0, double domainEnd = 1)
        {
            return(Create.RectangleProfile(
                       Interpolate(startProfile.Height, endProfile.Height, parameter, interpolationOrder, domainStart, domainEnd),
                       Interpolate(startProfile.Width, endProfile.Width, parameter, interpolationOrder, domainStart, domainEnd),
                       Interpolate(startProfile.CornerRadius, endProfile.CornerRadius, parameter, interpolationOrder, domainStart, domainEnd)));
        }
예제 #4
0
        public static string Description(this RectangleProfile profile)
        {
            if (profile == null)
            {
                return("null profile");
            }

            return($"Rectangle {profile.Height:G3}x{profile.Width:G3}x{profile.CornerRadius:G3}");
        }
예제 #5
0
        /***************************************************/

        public static double TorsionalConstant(this RectangleProfile profile)
        {
            if (Math.Abs(profile.Height - profile.Width) < Tolerance.Distance)
            {
                return(2.25 * Math.Pow(profile.Height / 2, 4));
            }
            else
            {
                double a = Math.Max(profile.Height, profile.Width) / 2;
                double b = Math.Min(profile.Height, profile.Width) / 2;
                return(a * Math.Pow(b, 3) * (16 / 3 - 3.36 * b / a * (1 - Math.Pow(b, 4) / (12 * Math.Pow(a, 4)))));
            }
        }
예제 #6
0
        /***************************************************/

        private bool CreateProfile(string name, RectangleProfile profile)
        {
            List <double> dimensionList = new List <double> {
                profile.Width, profile.Height
            };

            double[] dimensionArray = dimensionList.ToArray();

            //List<string> valueList = new List<string> { "B", "D" };

            int lusasType = 1;

            CreateLibrarySection(name, dimensionArray, lusasType);

            return(true);
        }
예제 #7
0
        /***************************************************/

        public static string Description(this RectangleProfile profile)
        {
            return("Rectangle " + profile.Height + "x" + profile.Width + "x" + profile.CornerRadius);
        }
예제 #8
0
 public static double WarpingConstant(this RectangleProfile profile)
 {
     return(profile.IsNull() ? 0 : 0);
 }
예제 #9
0
 public static double WarpingConstant(this RectangleProfile profile)
 {
     return(0);
 }
예제 #10
0
        /***************************************************/

        private bool SetProfile(RectangleProfile bhomProfile, string sectionName, string matName)
        {
            int ret = m_model.PropFrame.SetRectangle(sectionName, matName, bhomProfile.Height, bhomProfile.Width);

            return(ret == 0);
        }
예제 #11
0
 private static void SetSpecificDimensions(RectangleProfile dimensions, string sectionName, IMaterialFragment material, cSapModel model)
 {
     model.PropFrame.SetRectangle(sectionName, material.Name, dimensions.Height, dimensions.Width);
 }
예제 #12
0
 private (double[], int, string) GetProfileDimensions(RectangleProfile profile)
 {
     return(new double[] { profile.Width, profile.Height, 0, 0, 0, 0 }, St7.bsSquareSolid, profile.Name);
 }
예제 #13
0
        /***************************************************/

        private bool SetProfile(RectangleProfile profile, string sectionName, IMaterialFragment material)
        {
            return(m_model.PropFrame.SetRectangle(sectionName, material?.DescriptionOrName() ?? "", profile.Height, profile.Width) == 0);
        }
예제 #14
0
        public static CompositeGeometry Layout(this PerimeterReinforcement reinforcement, RectangleProfile dimensions, ConcreteSection property)
        {
            double       h           = dimensions.Height;
            double       w           = dimensions.Width;
            double       tieDiameter = property.TieDiameter();
            List <Point> location    = new List <Point>();

            int    topCount  = 0;
            int    sideCount = 0;
            double tieOffset = tieDiameter + Math.Cos(Math.PI / 4) * (2 * tieDiameter * (Math.Sqrt(2) - 1) + reinforcement.Diameter / 2) - reinforcement.Diameter / 2;

            switch (reinforcement.Pattern)
            {
            case ReinforcementPattern.Equispaced:
                topCount  = (int)(reinforcement.BarCount * w / (2 * w + 2 * h) + 1);
                sideCount = (reinforcement.BarCount - 2 * topCount) / 2 + 2;
                break;

            case ReinforcementPattern.Horizontal:
                topCount  = reinforcement.BarCount / 2;
                sideCount = 2;
                break;

            case ReinforcementPattern.Vertical:
                topCount  = 2;
                sideCount = reinforcement.BarCount / 2;
                break;
            }
            double verticalSpacing = (h - 2 * property.MinimumCover - reinforcement.Diameter - 2 * tieOffset) / (sideCount - 1);
            double depth           = property.MinimumCover + reinforcement.Diameter / 2 + tieOffset;

            for (int i = 0; i < sideCount; i++)
            {
                int    count        = topCount;
                double currentDepth = depth + i * verticalSpacing;
                if (i > 0 && i < sideCount - 1)
                {
                    count = 2;
                }
                List <IGeometry> layout = ((CompositeGeometry) new LayerReinforcement {
                    Diameter = reinforcement.Diameter, Depth = currentDepth, BarCount = count
                }.Layout(property)).Elements;

                foreach (IGeometry geom in layout)
                {
                    location.Add(geom as Point);
                }
            }
            return(new CompositeGeometry {
                Elements = location.ToList <IGeometry>()
            });
        }