コード例 #1
0
        public void CorrectData(double diameter, Material material)
        {
            RebarProperties testObject = new RebarProperties(diameter, material);

            Assert.Equal(diameter, testObject.Diameter);
            Assert.Equal(material, testObject.Material);
        }
コード例 #2
0
ファイル: StirrupBarShapeGH.cs プロジェクト: paireks/T-Rex
        protected override void SolveInstance(IGH_DataAccess DA)
        {
            Plane           insertPlane   = Plane.Unset;
            double          height        = 0.0;
            double          width         = 0.0;
            int             hooksType     = 0;
            double          hookLength    = 0.0;
            RebarProperties properties    = null;
            BendingRoller   bendingRoller = null;

            DA.GetData(0, ref insertPlane);
            DA.GetData(1, ref height);
            DA.GetData(2, ref width);
            DA.GetData(3, ref hooksType);
            DA.GetData(4, ref hookLength);
            DA.GetData(5, ref properties);
            DA.GetData(6, ref bendingRoller);

            RebarShape rebarShape = new RebarShape(properties);

            rebarShape.BuildStirrupShape(insertPlane, height, width, bendingRoller, hooksType, hookLength);

            DA.SetData(0, rebarShape);
            DA.SetData(1, rebarShape.RebarMesh);
        }
コード例 #3
0
 public static dynamic GetTSObject(RebarProperties dynObject)
 {
     if (dynObject is null)
     {
         return(null);
     }
     return(dynObject.teklaObject);
 }
コード例 #4
0
        public void TestToString()
        {
            RebarProperties testObject = new RebarProperties(10.02, new Material("Name", "Grade", 10.0));

            string expectedToString = "Rebar Properties" + Environment.NewLine +
                                      "Diameter: 10,02" + Environment.NewLine +
                                      "Material: Name";

            Assert.Equal(expectedToString, testObject.ToString());
        }
コード例 #5
0
ファイル: RebarPropertiesGH.cs プロジェクト: paireks/T-Rex
        protected override void SolveInstance(IGH_DataAccess DA)
        {
            double   diameter = 0.0;
            Material material = null;

            DA.GetData(0, ref diameter);
            DA.GetData(1, ref material);

            RebarProperties prop = new RebarProperties(diameter, material);

            DA.SetData(0, prop);
        }
コード例 #6
0
        protected override void SolveInstance(IGH_DataAccess DA)
        {
            Curve           rebarCurve = null;
            RebarProperties props      = null;

            DA.GetData(0, ref rebarCurve);
            DA.GetData(1, ref props);

            RebarShape rebarShape = new RebarShape(props);

            rebarShape.CurveToRebarShape(rebarCurve);

            DA.SetData(0, rebarShape);
            DA.SetData(1, rebarShape.RebarMesh);
        }
コード例 #7
0
        protected override void SolveInstance(IGH_DataAccess DA)
        {
            Curve           rebarCurve    = null;
            RebarProperties props         = null;
            BendingRoller   bendingRoller = null;

            DA.GetData(0, ref rebarCurve);
            DA.GetData(1, ref props);
            DA.GetData(2, ref bendingRoller);

            RebarShape rebarShape = new RebarShape(props);

            rebarShape.PolylineToRebarShape(rebarCurve, bendingRoller);

            DA.SetData(0, rebarShape);
            DA.SetData(1, rebarShape.RebarMesh);
        }
コード例 #8
0
        protected override void SolveInstance(IGH_DataAccess DA)
        {
            Rectangle3d     rectangle       = Rectangle3d.Unset;
            RebarProperties properties      = null;
            int             position        = 0;
            CoverDimensions coverDimensions = null;

            DA.GetData(0, ref rectangle);
            DA.GetData(1, ref properties);
            DA.GetData(2, ref position);
            DA.GetData(3, ref coverDimensions);

            RebarShape rebarShape = new RebarShape(properties);

            rebarShape.BuildRectangleToLineBarShape(rectangle, position, coverDimensions);

            DA.SetData(0, rebarShape);
            DA.SetData(1, rebarShape.RebarMesh);
        }
コード例 #9
0
        protected override void SolveInstance(IGH_DataAccess DA)
        {
            Rectangle3d     rectangle       = Rectangle3d.Unset;
            RebarProperties properties      = null;
            BendingRoller   bendingRoller   = null;
            int             hooksType       = 0;
            CoverDimensions coverDimensions = null;
            double          hookLength      = 0.0;

            DA.GetData(0, ref rectangle);
            DA.GetData(1, ref properties);
            DA.GetData(2, ref bendingRoller);
            DA.GetData(3, ref hooksType);
            DA.GetData(4, ref hookLength);
            DA.GetData(5, ref coverDimensions);

            RebarShape rebarShape = new RebarShape(properties);

            rebarShape.BuildRectangleToStirrupShape(rectangle, bendingRoller, hooksType, coverDimensions, hookLength);

            DA.SetData(0, rebarShape);
            DA.SetData(1, rebarShape.RebarMesh);
        }
コード例 #10
0
        public void TestRadius_Diameter0001()
        {
            RebarProperties testObject = new RebarProperties(0.001, new Material("", "", 10.0));

            Assert.Equal(0.0005, testObject.Radius);
        }
コード例 #11
0
        public void TestRadius_Diameter20()
        {
            RebarProperties testObject = new RebarProperties(20.00, new Material("", "", 10.0));

            Assert.Equal(10.00, testObject.Radius);
        }