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); }
/// <summary> /// Set EdgeConnection by indices. /// </summary> /// <param name="fictShell">Fictitious Shell</param> /// <param name="edgeConnection">EdgeConnection</param> /// <param name="indices">Index. List of items. Deconstruct fictitious shell to extract index for each respective edge.</param> /// <returns></returns> public static FictitiousShell UpdateEdgeConnection(FictitiousShell fictShell, Shells.EdgeConnection edgeConnection, List <int> indices) { // deep clone. downstreams objs will contain changes made in this method, upstream objs will not. // downstream and uppstream objs will share guid. FictitiousShell clone = fictShell.DeepClone(); foreach (int index in indices) { if (index >= 0 & index < fictShell.Region.GetEdgeConnections().Count) { // pass } else { throw new System.ArgumentException("Index is out of bounds."); } // clone.Region.SetEdgeConnection(edgeConnection, index); } // return(clone); }
public static FictitiousShell SetEdgeConnection(FictitiousShell fictShell, Shells.EdgeConnection edgeConnection, List <int> indices) { return(UpdateEdgeConnection(fictShell, edgeConnection, indices)); }