Beispiel #1
0
        protected override void SolveInstance(IGH_DataAccess DA)
        {
            Curve                  curve                 = null;
            Motions                motions               = null;
            Rotations              rotations             = null;
            MotionsPlasticLimits   motionsPlasticLimit   = null;
            RotationsPlasticLimits rotationsPlasticLimit = null;
            bool movingLocal = false;

            if (!DA.GetData(0, ref curve))
            {
                return;
            }
            if (!DA.GetData(1, ref motions))
            {
                return;
            }
            if (!DA.GetData(2, ref rotations))
            {
                return;
            }
            DA.GetData(3, ref motionsPlasticLimit);
            DA.GetData(4, ref rotationsPlasticLimit);
            DA.GetData(5, ref movingLocal);
            Vector3d v = Vector3d.Zero;

            DA.GetData(6, ref v);

            bool orientLCS = true;

            DA.GetData(7, ref orientLCS);

            string identifier = "S";

            DA.GetData(8, ref identifier);

            if (curve == null || identifier == null)
            {
                return;
            }

            Geometry.Edge edge = Convert.FromRhinoLineOrArc1(curve);
            var           obj  = new Supports.LineSupport(edge, motions, motionsPlasticLimit, rotations, rotationsPlasticLimit, movingLocal, identifier);

            // Set local y-axis
            if (!v.Equals(Vector3d.Zero))
            {
                obj.Group.LocalY = v.FromRhino();
            }
            else // Orient coordinate system to GCS
            {
                if (orientLCS)
                {
                    obj.Group.OrientCoordinateSystemToGCS();
                }
            }

            DA.SetData(0, obj);
        }
Beispiel #2
0
        protected override void SolveInstance(IGH_DataAccess DA)
        {
            Brep    surface = null;
            Motions motions = null;
            MotionsPlasticLimits motionsPlasticLimit = null;

            Rhino.Geometry.Vector3d x = Vector3d.Zero;
            Rhino.Geometry.Vector3d z = Vector3d.Zero;
            string identifier         = "S";

            if (!DA.GetData(0, ref surface))
            {
                return;
            }
            if (!DA.GetData(1, ref motions))
            {
                return;
            }
            DA.GetData(2, ref motionsPlasticLimit);
            DA.GetData(3, ref x);
            DA.GetData(4, ref z);
            DA.GetData(5, ref identifier);

            if (surface == null || motions == null || identifier == null)
            {
                return;
            }

            Geometry.Region         region = surface.FromRhino();
            Supports.SurfaceSupport obj    = new Supports.SurfaceSupport(region, motions, motionsPlasticLimit, identifier);

            // Set local x-axis
            if (!x.Equals(Vector3d.Zero))
            {
                obj.CoordinateSystem.SetXAroundZ(x.FromRhino());
            }

            // Set local z-axis
            if (!z.Equals(Vector3d.Zero))
            {
                obj.CoordinateSystem.SetZAroundX(z.FromRhino());
            }

            DA.SetData(0, obj);
        }
Beispiel #3
0
        public static SurfaceSupport SurfaceSupportDefine(Autodesk.DesignScript.Geometry.Surface surface, Motions motions, [DefaultArgument("MotionsPlasticLimits.Default()")] MotionsPlasticLimits motionsPlasticLimits, [DefaultArgument("Autodesk.DesignScript.Geometry.Vector.ByCoordinates(0,0,0)")] Autodesk.DesignScript.Geometry.Vector localX, [DefaultArgument("Autodesk.DesignScript.Geometry.Vector.ByCoordinates(0,0,0)")] Autodesk.DesignScript.Geometry.Vector localZ, [DefaultArgument("S")] string identifier)
        {
            // convert geometry
            Geometry.Region region = Geometry.Region.FromDynamo(surface);

            // create new surface support
            SurfaceSupport obj = new SurfaceSupport(region, motions, motionsPlasticLimits, identifier);

            // set local x-axis
            if (!localX.Equals(Autodesk.DesignScript.Geometry.Vector.ByCoordinates(0, 0, 0)))
            {
                obj.CoordinateSystem.SetXAroundZ(FemDesign.Geometry.FdVector3d.FromDynamo(localX));
            }

            // set local z-axis
            if (!localZ.Equals(Autodesk.DesignScript.Geometry.Vector.ByCoordinates(0, 0, 0)))
            {
                obj.CoordinateSystem.SetZAroundX(FemDesign.Geometry.FdVector3d.FromDynamo(localZ));
            }

            return(obj);
        }
Beispiel #4
0
        public static LineSupport Define(Autodesk.DesignScript.Geometry.Curve curve, Motions motions, [DefaultArgument("MotionsPlasticLimits.Default()")] MotionsPlasticLimits motionsPlasticLimits, Rotations rotations, [DefaultArgument("RotationsPlasticLimits.Default()")] RotationsPlasticLimits rotationsPlasticLimits, [DefaultArgument("false")] bool movingLocal, [DefaultArgument("Autodesk.DesignScript.Geometry.Vector.ByCoordinates(0,0,0)")] Autodesk.DesignScript.Geometry.Vector localY, [DefaultArgument("true")] bool orientLCS, [DefaultArgument("S")] string identifier)
        {
            Geometry.Edge edge = Geometry.Edge.FromDynamoLineOrArc1(curve);
            FemDesign.Supports.LineSupport obj = new LineSupport(edge, motions, motionsPlasticLimits, rotations, rotationsPlasticLimits, movingLocal, identifier);

            // set local y-axis
            if (!localY.Equals(Autodesk.DesignScript.Geometry.Vector.ByCoordinates(0, 0, 0)))
            {
                obj.Group.LocalY = FemDesign.Geometry.FdVector3d.FromDynamo(localY);
            }

            // else orient coordinate system to GCS
            else
            {
                if (orientLCS)
                {
                    obj.Group.OrientCoordinateSystemToGCS();
                }
            }

            return(obj);
        }
Beispiel #5
0
 public static PointSupport Define(Autodesk.DesignScript.Geometry.Point point, Motions motions, [DefaultArgument("MotionsPlasticLimits.Default()")] MotionsPlasticLimits motionsPlasticLimits, Rotations rotations, [DefaultArgument("RotationsPlasticLimits.Default()")] RotationsPlasticLimits rotationsPlasticLimits, [DefaultArgument("S")] string identifier)
 {
     return(new PointSupport(Geometry.FdPoint3d.FromDynamo(point), motions, motionsPlasticLimits, rotations, rotationsPlasticLimits, identifier));
 }
Beispiel #6
0
 /// <summary>
 /// Constructor by edge and rigidity. Used to create group for point support
 /// </summary>
 internal Group(Geometry.FdVector3d localX, Geometry.FdVector3d localY, Motions motions, MotionsPlasticLimits motionsPlasticLimits, Rotations rotations, RotationsPlasticLimits rotationsPlasticLimits)
 {
     this._localX  = localX;
     this._localY  = localY;
     this.Rigidity = new RigidityDataType3(motions, motionsPlasticLimits, rotations, rotationsPlasticLimits);
 }
Beispiel #7
0
 /// <summary>
 /// Constructor by edge and rigidity. Used to create group for line support
 /// </summary>
 internal Group(Geometry.FdCoordinateSystem coordSystem, Motions motions, MotionsPlasticLimits motionsPlasticLimits, Rotations rotations, RotationsPlasticLimits rotationsPlasticLimits)
 {
     this.CoordinateSystem = coordSystem;
     this.Rigidity         = new RigidityDataType3(motions, motionsPlasticLimits, rotations, rotationsPlasticLimits);
 }
        /// <summary>
        /// Create a connected point between 2 points with rigidity (motions, rotations) and plastic limits (forces, moments).
        /// </summary>
        public ConnectedPoints(FdPoint3d firstPoint, FdPoint3d secondPoint, Motions motions, MotionsPlasticLimits motionsPlasticLimits, Rotations rotations, RotationsPlasticLimits rotationsPlasticLimits, GuidListType[] references, string identifier = "CP")
        {
            RigidityDataType2 rigidity = new RigidityDataType2(motions, motionsPlasticLimits, rotations, rotationsPlasticLimits);

            Initialize(firstPoint, secondPoint, rigidity, references, identifier);
        }
        /// <summary>
        /// Create a connected point between 2 points with rigidity (motions, rotations) and plastic limits (forces, moments).
        /// </summary>
        public ConnectedPoints(FdPoint3d firstPoint, FdPoint3d secondPoint, Motions motions, MotionsPlasticLimits motionsPlasticLimits, Rotations rotations, RotationsPlasticLimits rotationsPlasticLimits, IEnumerable <EntityBase> references, string identifier = "CP")
        {
            GuidListType[]    refs     = references.Select(r => new GuidListType(r)).ToArray();
            RigidityDataType2 rigidity = new RigidityDataType2(motions, motionsPlasticLimits, rotations, rotationsPlasticLimits);

            Initialize(firstPoint, secondPoint, rigidity, refs, identifier);
        }
Beispiel #10
0
        /// <summary>
        /// Create surface support with only translation rigidity and force plastic limits defined.
        /// </summary>
        public SurfaceSupport(Geometry.Region region, Motions motions, MotionsPlasticLimits motionsPlasticLimits, string identifier = "S")
        {
            var rigidity = new RigidityDataType1(motions, motionsPlasticLimits);

            Initialize(region, rigidity, identifier);
        }