Exemple #1
0
        public static FictitiousShell Define(Autodesk.DesignScript.Geometry.Surface surface, StiffnessMatrix4Type d, StiffnessMatrix4Type k, StiffnessMatrix2Type h, double density, double t1, double t2, double alpha1, double alpha2, bool ignoreInStImpCalc, [DefaultArgument("EdgeConnection.Default()")] Shells.EdgeConnection edgeConnection, [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, double avgSrfElemSize = 0, string identifier = "FS")
        {
            // convert geometry
            Geometry.Region     region = Geometry.Region.FromDynamo(surface);
            Geometry.FdVector3d x      = Geometry.FdVector3d.FromDynamo(localX);
            Geometry.FdVector3d z      = Geometry.FdVector3d.FromDynamo(localZ);

            // add edge connections to region
            region.SetEdgeConnections(edgeConnection);

            //
            FictitiousShell obj = new FictitiousShell(region, d, k, h, density, t1, t2, alpha1, alpha2, ignoreInStImpCalc, avgSrfElemSize, identifier);

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

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

            // return
            return(obj);
        }
        public static SurfaceTemperatureLoad Define(Autodesk.DesignScript.Geometry.Surface surface, Autodesk.DesignScript.Geometry.Vector direction, List <TopBotLocationValue> tempLocValue, LoadCase loadCase, string comment = "")
        {
            // convert geometry
            Geometry.Region     region = Geometry.Region.FromDynamo(surface);
            Geometry.FdVector3d dir    = Geometry.FdVector3d.FromDynamo(direction);

            // return
            return(new SurfaceTemperatureLoad(region, dir, tempLocValue, loadCase, comment));
        }
Exemple #3
0
 /// <summary>
 /// Internal constructor accessed by static methods.
 /// </summary>
 public PointLoad(Geometry.FdPoint3d point, Geometry.FdVector3d force, LoadCase loadCase, string comment, ForceLoadType type)
 {
     this.EntityCreated();
     this.LoadCase  = loadCase.Guid;
     this.Comment   = comment;
     this.LoadType  = type;
     this.Direction = force.Normalize();
     this.Load      = new LoadLocationValue(point, force.Length());
 }
 /// <summary>
 /// Construct a surface temperature load by region and temperature location values (top/bottom)
 /// </summary>
 /// <param name="region">Region</param>
 /// <param name="direction">Direction of load</param>
 /// <param name="tempLocValue">List of top bottom location value. List should have 1 or 3 elements.></param>
 /// <param name="loadCase">LoadCase.</param>
 /// <param name="comment">Comment.</param>
 public SurfaceTemperatureLoad(Geometry.Region region, Geometry.FdVector3d direction, List <TopBotLocationValue> tempLocValue, LoadCase loadCase, string comment)
 {
     this.EntityCreated();
     this.Region       = region;
     this.LocalZ       = direction;
     this.TopBotLocVal = tempLocValue;
     this.LoadCase     = loadCase.Guid;
     this.Comment      = comment;
 }
        /// <summary>
        /// Straight reinforcement layout on slab.
        /// </summary>
        public static SurfaceReinforcementParameters Straight(Shells.Slab slab, bool singleLayerReinforcement = false)
        {
            GuidListType baseShell = new GuidListType(slab.SlabPart.Guid);
            Center       center    = Center.Straight();

            Geometry.FdVector3d xDirection = slab.SlabPart.LocalX;
            Geometry.FdVector3d yDirection = slab.SlabPart.LocalY;
            return(new SurfaceReinforcementParameters(singleLayerReinforcement, baseShell, center, xDirection, yDirection));
        }
Exemple #6
0
 /// <summary>
 /// Internal constructor.
 /// </summary>
 /// <param name="origo">Origo of storey.</param>
 /// <param name="direction">Direction of storey x'-axis. Optional, default value isGCS x-axis.</param>
 /// <param name="dimensionX">Dimension in x'-direction.</param>
 /// <param name="dimensionY">Dimension in y'-direction.</param>
 /// <param name="name">Name of storey.</param>
 public Storey(Geometry.FdPoint3d origo, Geometry.FdVector3d direction, double dimensionX, double dimensionY, string name)
 {
     this.EntityCreated();
     this.Origo      = origo;
     this.Direction  = direction;
     this.DimensionX = dimensionX;
     this.DimensionY = dimensionY;
     this.Name       = name;
 }
 /// <summary>
 /// Construct a uniform or variable line stress load
 /// </summary>
 /// <param name="edge">Underlying edge of line load. Line or Arc.</param>
 /// <param name="direction">Direction of load.</param>
 /// <param name="topBotLocVal">List of 2 top bottom location values</param>
 public LineStressLoad(Geometry.Edge edge, Geometry.FdVector3d direction, List <TopBotLocationValue> topBotLocVals, LoadCase loadCase, string comment)
 {
     this.EntityCreated();
     this.Edge         = edge;
     this.Direction    = direction;
     this.TopBotLocVal = topBotLocVals;
     this.LoadCase     = loadCase.Guid;
     this.Comment      = comment;
 }
Exemple #8
0
        /// <summary>
        /// Create variable SurfaceLoad
        /// </summary>
        /// <param name="region"></param>
        /// <param name="direction"></param>
        /// <param name="loadLocationValue"></param>
        /// <param name="loadCase"></param>
        /// <param name="loadProjection">False: Intensity meant along action line (eg. dead load). True: Intensity meant perpendicular to direction of load (eg. snow load).</param>
        /// <param name="comment"></param>
        /// <returns></returns>
        public static SurfaceLoad Variable(Geometry.Region region, Geometry.FdVector3d direction, List <LoadLocationValue> loadLocationValue, LoadCase loadCase, bool loadProjection = false, string comment = "")
        {
            if (loadLocationValue.Count != 3)
            {
                throw new System.ArgumentException("loadLocationValue must contain 3 items");
            }

            return(new SurfaceLoad(region, loadLocationValue, direction, loadCase, loadProjection, comment));
        }
        public static SurfaceLoad Uniform(Autodesk.DesignScript.Geometry.Surface surface, Autodesk.DesignScript.Geometry.Vector force, LoadCase loadCase, string comment = "")
        {
            Geometry.Region     region = Geometry.Region.FromDynamo(surface);
            Geometry.FdVector3d _force = Geometry.FdVector3d.FromDynamo(force);

            SurfaceLoad surfaceLoad = SurfaceLoad.Uniform(region, _force, loadCase, false, comment);

            return(surfaceLoad);
        }
Exemple #10
0
        public static LineTemperatureLoad Define(Autodesk.DesignScript.Geometry.Curve curve, [DefaultArgument("Autodesk.DesignScript.Geometry.Vector.ByCoordinates(0,0,1)")] Autodesk.DesignScript.Geometry.Vector direction, List <TopBotLocationValue> topBottomLocationValues, LoadCase loadCase, string comments = "")
        {
            // convert geometry
            Geometry.Edge       edge = Geometry.Edge.FromDynamoLineOrArc1(curve);
            Geometry.FdVector3d v    = Geometry.FdVector3d.FromDynamo(direction);

            // return
            return(new LineTemperatureLoad(edge, v, topBottomLocationValues, loadCase, comments));
        }
Exemple #11
0
        public static Storey Define(string name, Autodesk.DesignScript.Geometry.Point origo, [DefaultArgument("Autodesk.DesignScript.Geometry.Vector.XAxis()")] Autodesk.DesignScript.Geometry.Vector direction, double dimensionX = 50, double dimensionY = 30)
        {
            // convert geometry
            Geometry.FdPoint3d  p = Geometry.FdPoint3d.FromDynamo(origo);
            Geometry.FdVector3d v = Geometry.FdVector3d.FromDynamo(direction);

            // return
            return(new Storey(p, v, dimensionX, dimensionY, name));
        }
Exemple #12
0
        public static LineLoad Moment(Autodesk.DesignScript.Geometry.Curve curve, Autodesk.DesignScript.Geometry.Vector startForce, Autodesk.DesignScript.Geometry.Vector endForce, LoadCase loadCase, [DefaultArgument("true")] bool constLoadDir, string comment = "")
        {
            // convert geometry
            Geometry.Edge       edge        = Geometry.Edge.FromDynamoLineOrArc1(curve);
            Geometry.FdVector3d _startForce = Geometry.FdVector3d.FromDynamo(startForce);
            Geometry.FdVector3d _endForce   = Geometry.FdVector3d.FromDynamo(endForce);

            return(new LineLoad(edge, _startForce, _endForce, loadCase, ForceLoadType.Moment, comment, constLoadDir, loadProjection: false));
        }
 /// <summary>
 /// Construct surface temperature load by region, top value and bottom value.
 /// </summary>
 /// <param name="region">Region</param>
 /// <param name="direction">Direction of load</param>
 /// <param name="topVal">Top value, temperature in celsius</param>
 /// <param name="bottomVal">Bottom value, temperature in celsius</param>
 /// <param name="loadCase">LoadCase.</param>
 /// <param name="comment">Comment.</param>
 public SurfaceTemperatureLoad(Geometry.Region region, Geometry.FdVector3d direction, double topVal, double bottomVal, LoadCase loadCase, string comment)
 {
     this.EntityCreated();
     this.Region       = region;
     this.LocalZ       = direction;
     this.TopBotLocVal = new List <TopBotLocationValue> {
         new TopBotLocationValue(region.CoordinateSystem.Origin, topVal, bottomVal)
     };
     this.LoadCase = loadCase.Guid;
     this.Comment  = comment;
 }
Exemple #14
0
        protected override void SolveInstance(IGH_DataAccess DA)
        {
            // get data
            Curve crv = null;

            if (!DA.GetData(0, ref crv))
            {
                return;
            }

            Vector3d dir = Vector3d.ZAxis;

            if (!DA.GetData(1, ref dir))
            {
                // pass
            }

            List <Loads.TopBotLocationValue> vals = new List <Loads.TopBotLocationValue>();

            if (!DA.GetDataList(2, vals))
            {
                return;
            }

            Loads.LoadCase lc = null;
            if (!DA.GetData(3, ref lc))
            {
                return;
            }

            string comment = null;

            if (!DA.GetData(4, ref comment))
            {
                // pass;
            }

            if (crv == null || vals == null || lc == null)
            {
                return;
            }

            // convert geometry
            Geometry.Edge       edge = crv.FromRhinoLineOrArc1();
            Geometry.FdVector3d v    = dir.FromRhino();

            // create obj
            Loads.LineTemperatureLoad obj = new Loads.LineTemperatureLoad(edge, v, vals, lc, comment);


            // return
            DA.SetData(0, obj);
        }
Exemple #15
0
 public LineLoad(Geometry.Edge edge, Geometry.FdVector3d constantForce, LoadCase loadCase, ForceLoadType loadType, string comment = "", bool constLoadDir = true, bool loadProjection = false)
 {
     this.EntityCreated();
     this.LoadCase = loadCase.Guid;
     this.Comment  = comment;
     this.ConstantLoadDirection = constLoadDir;
     this.LoadProjection        = loadProjection;
     this.LoadType = loadType;
     this.Edge     = edge;
     this.Normal   = edge.CoordinateSystem.LocalZ; // Note that LineLoad normal and Edge normal are not necessarily the same.
     this.SetStartAndEndForces(constantForce, constantForce);
 }
Exemple #16
0
        protected override void SolveInstance(IGH_DataAccess DA)
        {
            // get data
            Brep brep = null;

            if (!DA.GetData(0, ref brep))
            {
                return;
            }

            Vector3d direction = Vector3d.Zero;

            if (!DA.GetData(1, ref direction))
            {
                return;
            }

            List <Loads.TopBotLocationValue> vals = new List <Loads.TopBotLocationValue>();

            if (!DA.GetDataList(2, vals))
            {
                return;
            }

            Loads.LoadCase lc = null;
            if (!DA.GetData(3, ref lc))
            {
                return;
            }

            string comment = null;

            if (!DA.GetData(4, ref comment))
            {
                // pass;
            }

            if (brep == null || vals == null || lc == null)
            {
                return;
            }

            // convert geometry
            Geometry.Region     region = brep.FromRhino();
            Geometry.FdVector3d dir    = direction.FromRhino();

            // create obj
            Loads.SurfaceTemperatureLoad obj = new Loads.SurfaceTemperatureLoad(region, dir, vals, lc, comment);

            // return
            DA.SetData(0, obj);
        }
Exemple #17
0
        public static PressureLoad Define(Autodesk.DesignScript.Geometry.Surface surface, Autodesk.DesignScript.Geometry.Vector direction, double z0, double q0, double qh, LoadCase loadCase, string comment = "")
        {
            // get fdGeometry
            Geometry.Region region = Geometry.Region.FromDynamo(surface);

            // normalize direction
            Geometry.FdVector3d _loadDirection = Geometry.FdVector3d.FromDynamo(direction).Normalize();

            // create SurfaceLoad
            PressureLoad _pressureLoad = new PressureLoad(region, _loadDirection, z0, q0, qh, loadCase, comment, false, ForceLoadType.Force);

            return(_pressureLoad);
        }
Exemple #18
0
 /// <summary>
 /// Internal constructor.
 /// </summary>
 public FictitiousBar(Geometry.Edge edge, Geometry.FdVector3d localY, Bars.Connectivity startConnectivity, Bars.Connectivity endConnectivity, string name, double ae, double itg, double i1e, double i2e)
 {
     this.EntityCreated();
     this.Edge              = edge;
     this.LocalY            = localY;
     this.StartConnectivity = startConnectivity;
     this.EndConnectivity   = endConnectivity;
     this.Name              = name;
     this.AE  = ae;
     this.ItG = itg;
     this.I1E = i1e;
     this.I2E = i2e;
 }
Exemple #19
0
 /// <summary>
 /// Variable surface load
 /// </summary>
 public SurfaceLoad(Geometry.Region region, List <LoadLocationValue> loads, Geometry.FdVector3d loadDirection, LoadCase loadCase, bool loadProjection = false, string comment = "")
 {
     this.EntityCreated();
     this.LoadCase       = loadCase.Guid;
     this.Comment        = comment;
     this.LoadProjection = loadProjection;
     this.LoadType       = ForceLoadType.Force;
     this.Region         = region;
     this.Direction      = loadDirection;
     foreach (LoadLocationValue _load in loads)
     {
         this.Loads.Add(_load);
     }
 }
Exemple #20
0
        public static SurfaceLoad Variable(Autodesk.DesignScript.Geometry.Surface surface, Autodesk.DesignScript.Geometry.Vector direction, List <LoadLocationValue> loadLocationValue, LoadCase loadCase, string comment = "")
        {
            if (loadLocationValue.Count != 3)
            {
                throw new System.ArgumentException("loads must contain 3 items");
            }

            Geometry.Region     region        = Geometry.Region.FromDynamo(surface);
            Geometry.FdVector3d loadDirection = Geometry.FdVector3d.FromDynamo(direction).Normalize();

            SurfaceLoad surfaceLoad = SurfaceLoad.Variable(region, loadDirection, loadLocationValue, loadCase, false, comment);

            return(surfaceLoad);
        }
Exemple #21
0
        public static LineLoad MomentUniform(Autodesk.DesignScript.Geometry.Curve curve, Autodesk.DesignScript.Geometry.Vector force, LoadCase loadCase, [DefaultArgument("true")] bool constLoadDir, string comment = "")
        {
            // convert geometry
            Geometry.Edge       edge        = Geometry.Edge.FromDynamoLineOrArc1(curve);
            Geometry.FdVector3d _startForce = Geometry.FdVector3d.FromDynamo(force);
            Geometry.FdVector3d _endForce   = _startForce;

            // check zero vector
            if (_startForce.IsZero())
            {
                throw new System.ArgumentException($"Force is zero.");
            }

            return(new LineLoad(edge, _startForce, _endForce, loadCase, ForceLoadType.Moment, comment, constLoadDir, loadProjection: false));
        }
        /// <summary>
        /// Pressure load
        /// </summary>
        /// <param name="region"></param>
        /// <param name="loadDirection">Vector. Direction of force.</param>
        /// <param name="z0">Surface level of soil/water (on the global Z axis).</param>
        /// <param name="q0">Load intensity at the surface level.</param>
        /// <param name="qh">Increment of load intensity per meter (along the global Z axis).</param>
        /// <param name="loadCase">LoadCase.</param>
        /// <param name="comment">Comment.</param>
        /// <param name="loadProjection"></param>
        /// <param name="loadType"></param>
        public PressureLoad(Geometry.Region region, Geometry.FdVector3d loadDirection, double z0, double q0, double qh, LoadCase loadCase, string comment, bool loadProjection, ForceLoadType loadType)
        {
            // base
            this.EntityCreated();
            this.LoadCase       = loadCase.Guid;
            this.Comment        = comment;
            this.LoadProjection = loadProjection;
            this.LoadType       = loadType;
            this.Region         = region;
            this.Direction      = loadDirection;

            // specific
            this.Z0 = z0;
            this.Q0 = q0;
            this.Qh = qh;
        }
 /// <summary>
 /// Constructor
 /// </summary>
 public ConnectedLines(Geometry.Edge firstEdge, Geometry.Edge secondEdge, Geometry.FdVector3d localX, Geometry.FdVector3d localY, Releases.RigidityDataType3 rigidity, GuidListType[] references, string identifier, bool movingLocal, double interfaceStart, double interfaceEnd)
 {
     this.EntityCreated();
     this.Edges = new Geometry.Edge[2]
     {
         firstEdge,
         secondEdge
     };
     this.LocalX         = localX;
     this.LocalY         = localY;
     this.Rigidity       = rigidity;
     this.References     = references;
     this.Identifier     = identifier;
     this.MovingLocal    = movingLocal;
     this.InterfaceStart = interfaceStart;
     this.InterfaceEnd   = interfaceEnd;
 }
        /// <summary>
        /// Private constructor accessed by static methods.
        /// </summary>
        private SurfaceReinforcementParameters(bool singleLayerReinforcement, GuidListType baseShell, Center center, Geometry.FdVector3d xDirection, Geometry.FdVector3d yDirection)
        {
            // object information
            this.EntityCreated();

            // single layer reinforcement?
            if (singleLayerReinforcement)
            {
                this.SingleLayerReinforcement = singleLayerReinforcement;
            }

            // other properties
            this.BaseShell  = baseShell;
            this.Center     = center;
            this.XDirection = xDirection;
            this.YDirection = yDirection;
        }
Exemple #25
0
        /// <summary>
        /// Create a fictitious bar element.
        /// </summary>
        /// <param name="curve">Line or Arc.</param>
        /// <param name="AE">AE</param>
        /// <param name="ItG">ItG</param>
        /// <param name="I1E">I1E</param>
        /// <param name="I2E">I2E</param>
        /// <param name="connectivity">Connectivity. If 1 item this item defines both start and end connectivity. If two items the first item defines the start connectivity and the last item defines the end connectivity.</param>
        /// <param name="localY">Set local y-axis. Vector must be perpendicular to Curve mid-point local x-axis. This parameter overrides OrientLCS</param>
        /// <param name="orientLCS">Orient LCS to GCS? If true the LCS of this object will be oriented to the GCS trying to align local z to global z if possible or align local y to global y if possible (if object is vertical). If false local y-axis from Curve coordinate system at mid-point will be used.</param>
        /// <param name="identifier">Identifier. Optional.</param>
        /// <returns></returns>
        public static FictitiousBar Define(Autodesk.DesignScript.Geometry.Curve curve, [DefaultArgument("10000000")] double AE, [DefaultArgument("10000000")] double ItG, [DefaultArgument("10000000")] double I1E, [DefaultArgument("10000000")] double I2E, [DefaultArgument("FemDesign.Bars.Connectivity.Default()")] List <Bars.Connectivity> connectivity, [DefaultArgument("Autodesk.DesignScript.Geometry.Vector.ByCoordinates(0,0,0)")] Autodesk.DesignScript.Geometry.Vector localY, [DefaultArgument("true")] bool orientLCS, string identifier = "BF")
        {
            // convert geometry
            Geometry.Edge       edge = Geometry.Edge.FromDynamoLineOrArc2(curve);
            Geometry.FdVector3d y    = Geometry.FdVector3d.FromDynamo(localY);

            // get connectivity
            Bars.Connectivity startConnectivity;
            Bars.Connectivity endConnectivity;
            if (connectivity.Count == 1)
            {
                startConnectivity = connectivity[0];
                endConnectivity   = connectivity[0];
            }
            else if (connectivity.Count == 2)
            {
                startConnectivity = connectivity[0];
                endConnectivity   = connectivity[1];
            }
            else
            {
                throw new System.ArgumentException($"Connectivity must contain 1 or 2 items. Number of items is {connectivity.Count}");
            }

            // create virtual bar
            FictitiousBar bar = new FictitiousBar(edge, edge.CoordinateSystem.LocalY, startConnectivity, endConnectivity, identifier, AE, ItG, I1E, I2E);

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

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

            // return
            return(bar);
        }
Exemple #26
0
 /// <summary>
 /// Construct SlabPart.
 /// </summary>
 public SlabPart(string name, Geometry.Region region, List <Thickness> thickness, Materials.Material complexMaterial, ShellEccentricity alignment, ShellOrthotropy orthotropy)
 {
     this.EntityCreated();
     this.Name                    = name;
     this.Region                  = region;
     this.ComplexMaterial         = complexMaterial.Guid;
     this.Alignment               = alignment.Alignment;
     this.AlignOffset             = alignment.Eccentricity;
     this.OrthoAlfa               = orthotropy.OrthoAlfa;
     this.OrthoRatio              = orthotropy.OrthoRatio;
     this.EccentricityCalculation = alignment.EccentricityCalculation;
     this.EccentricityByCracking  = alignment.EccentricityByCracking;
     this.Thickness               = thickness;
     this.LocalPos                = region.CoordinateSystem.Origin;
     this._localX                 = region.CoordinateSystem.LocalX;
     this._localY                 = region.CoordinateSystem.LocalY;
     this.End = "";
 }
Exemple #27
0
        /// <summary>
        /// Set Z-axis and rotate coordinate system accordingly around X-axis
        /// </summary>
        public void SetZAroundX(FdVector3d vector)
        {
            // try to set axis
            Geometry.FdVector3d val = vector.Normalize();
            Geometry.FdVector3d x   = this.LocalX;

            double dot = x.Dot(val);

            if (Math.Abs(dot) < Tolerance.DotProduct)
            {
                this._localZ = val;
                this._localY = val.Cross(x); // follows right-hand-rule
            }

            else
            {
                throw new System.ArgumentException($"Z-axis is not perpendicular to X-axis. The dot-product is {dot}, but should be 0");
            }
        }
Exemple #28
0
        internal void SetStartAndEndForces(Geometry.FdVector3d startForce, Geometry.FdVector3d endForce)
        {
            if (startForce.IsZero() && !endForce.IsZero())
            {
                this.Direction = endForce.Normalize();
                this.StartLoad = 0;
                this.EndLoad   = endForce.Length();
            }

            else if (!startForce.IsZero() && endForce.IsZero())
            {
                this.Direction = startForce.Normalize();
                this.StartLoad = startForce.Length();
                this.EndLoad   = 0;
            }

            else if (startForce.IsZero() && endForce.IsZero())
            {
                throw new System.ArgumentException($"Both StartForce and EndForce are zero vectors. Can't set direction of LineLoad.");
            }

            // if no zero vectors - check if vectors are parallel
            else
            {
                Geometry.FdVector3d v0 = startForce.Normalize();
                Geometry.FdVector3d v1 = endForce.Normalize();
                double q0 = startForce.Length();
                double q1 = endForce.Length();

                int par = v0.Parallel(v1);
                if (par != 0)
                {
                    this.Direction = v0;
                    this.StartLoad = q0;
                    this.EndLoad   = par * q1;
                }
                else
                {
                    throw new System.ArgumentException($"StartForce and EndForce must be parallel or antiparallel.");
                }
            }
        }
        public static ConnectedLines Define(Autodesk.DesignScript.Geometry.Curve firstCurve, Autodesk.DesignScript.Geometry.Curve secondCurve, Autodesk.DesignScript.Geometry.Vector localX, Autodesk.DesignScript.Geometry.Vector localY, Releases.Motions motions, Releases.Rotations rotations, System.Guid[] references, string identifier, bool movingLocal, double interfaceStart, double interfaceEnd)
        {
            // convert geometry
            Geometry.Edge       edge0 = Geometry.Edge.FromDynamoLineOrArc2(firstCurve);
            Geometry.Edge       edge1 = Geometry.Edge.FromDynamoLineOrArc2(secondCurve);
            Geometry.FdVector3d x     = Geometry.FdVector3d.FromDynamo(localX);
            Geometry.FdVector3d y     = Geometry.FdVector3d.FromDynamo(localY);

            // rigidity
            Releases.RigidityDataType3 rigidity = new Releases.RigidityDataType3(motions, rotations);

            // references
            GuidListType[] refs = new GuidListType[references.Length];
            for (int idx = 0; idx < refs.Length; idx++)
            {
                refs[idx] = new GuidListType(references[idx]);
            }

            return(new ConnectedLines(edge0, edge1, x, y, rigidity, refs, identifier, movingLocal, interfaceStart, interfaceEnd));
        }
        protected override void SolveInstance(IGH_DataAccess DA)
        {
            // get input
            Brep surface = null;

            if (!DA.GetData("Surface", ref surface))
            {
                return;
            }

            Materials.TimberPanelType timberPlateMaterialData = null;
            if (!DA.GetData("TimberPlateMaterial", ref timberPlateMaterialData))
            {
                return;
            }

            Vector3d spanDirection = new Vector3d();

            if (!DA.GetData("SpanDirection", ref spanDirection))
            {
                return;
            }

            double panelWidth = 1.5;

            DA.GetData("PanelWidth", ref panelWidth);

            Shells.ShellEccentricity eccentricity = Shells.ShellEccentricity.GetDefault();
            DA.GetData("ShellEccentricity", ref eccentricity);

            Shells.EdgeConnection edgeConnection = Shells.EdgeConnection.GetHinged();
            DA.GetData("BorderEdgeConnection", ref edgeConnection);

            Rhino.Geometry.Vector3d x = Vector3d.Zero;
            DA.GetData("LocalX", ref x);

            Rhino.Geometry.Vector3d z = Vector3d.Zero;
            DA.GetData("LocalZ", ref z);

            double meshSize = 0;

            DA.GetData("AvgMeshSize", ref meshSize);

            string identifier = "PP";

            DA.GetData("Identifier", ref identifier);

            if (surface == null || timberPlateMaterialData == null || eccentricity == null || edgeConnection == null || identifier == null)
            {
                return;
            }


            Geometry.Region     region = surface.FromRhino();
            Geometry.FdVector3d dir    = spanDirection.FromRhino();
            Shells.Panel        obj    = Shells.Panel.DefaultTimberContinuous(region, timberPlateMaterialData, dir, edgeConnection, identifier, eccentricity, panelWidth);

            // set local x-axis
            if (!x.Equals(Vector3d.Zero))
            {
                obj.LocalX = x.FromRhino();
            }

            // set local z-axis
            if (!z.Equals(Vector3d.Zero))
            {
                obj.LocalZ = z.FromRhino();
            }

            // set uniform average mesh size
            obj.UniformAvgMeshSize = meshSize;

            // return
            DA.SetData(0, obj);
        }