public static SurfaceReinforcement BySurface(Surface surface, Straight straight, Wire wire)
        {
            // convert geometry
            Geometry.Region region = Geometry.Region.FromDynamo(surface);

            // return
            return(SurfaceReinforcement.DefineStraightSurfaceReinforcement(region, straight, wire));
        }
Exemple #2
0
        /// <summary>
        /// Private constructor accessed by static methods.
        /// </summary>
        private SurfaceReinforcement(Geometry.Region region, Straight straight, Centric centric, Wire wire)
        {
            // object information
            this.EntityCreated();

            // other properties
            this.Straight = straight;
            this.Centric  = centric;
            this.Wire     = wire;
            this.Region   = region;
        }
        protected override void SolveInstance(IGH_DataAccess DA)
        {
            // get data
            string direction = null;
            double space     = 0;
            string face      = null;
            double cover     = 0;

            if (!DA.GetData(0, ref direction))
            {
                return;
            }
            if (!DA.GetData(1, ref space))
            {
                return;
            }
            if (!DA.GetData(2, ref face))
            {
                return;
            }
            if (!DA.GetData(3, ref cover))
            {
                return;
            }
            if (direction == null || face == null)
            {
                return;
            }

            Face _face = EnumParser.Parse <Face>(face);
            ReinforcementDirection _direction = EnumParser.Parse <ReinforcementDirection>(direction);

            FemDesign.Reinforcement.Straight obj = new FemDesign.Reinforcement.Straight(_direction, space, _face, cover);

            // return
            DA.SetData(0, obj);
        }
Exemple #4
0
        /// <summary>
        /// Create straight lay-out surface reinforcement.
        /// Internal static method used by GH components and Dynamo nodes.
        /// </summary>
        public static SurfaceReinforcement DefineStraightSurfaceReinforcement(Geometry.Region region, Straight straight, Wire wire)
        {
            // set straight (e.g. centric == null)
            Centric centric = null;

            // new surfaceReinforcement
            SurfaceReinforcement obj = new SurfaceReinforcement(region, straight, centric, wire);

            // return
            return(obj);
        }