public static Slab PlateVariableThickness(Autodesk.DesignScript.Geometry.Surface surface, List <Thickness> thickness, Materials.Material material, [DefaultArgument("ShellEccentricity.Default()")] ShellEccentricity shellEccentricity, [DefaultArgument("ShellOrthotropy.Default()")] ShellOrthotropy shellOrthotropy, [DefaultArgument("EdgeConnection.Default()")] EdgeConnection shellEdgeConnection, [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, string identifier = "P") { // create FlatSurface Geometry.Region region = Geometry.Region.FromDynamo(surface); // check length of thickness if (thickness.Count != 3) { throw new System.ArgumentException("Thickness must contain exactly 3 items."); } // create shell Slab slab = Slab.Plate(identifier, material, region, shellEdgeConnection, shellEccentricity, shellOrthotropy, thickness); // set local x-axis if (!localX.Equals(Autodesk.DesignScript.Geometry.Vector.ByCoordinates(0, 0, 0))) { slab.SlabPart.LocalX = FemDesign.Geometry.FdVector3d.FromDynamo(localX); } // set local z-axis if (!localZ.Equals(Autodesk.DesignScript.Geometry.Vector.ByCoordinates(0, 0, 0))) { slab.SlabPart.LocalZ = FemDesign.Geometry.FdVector3d.FromDynamo(localZ); } return(slab); }
public static Slab Wall(Autodesk.DesignScript.Geometry.Surface surface, double thickness, Materials.Material material, [DefaultArgument("ShellEccentricity.Default()")] ShellEccentricity shellEccentricity, [DefaultArgument("ShellOrthotropy.Default()")] ShellOrthotropy shellOrthotropy, [DefaultArgument("EdgeConnection.Default()")] EdgeConnection shellEdgeConnection, [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, string identifier = "W") { // create FlatSurface Geometry.Region region = Geometry.Region.FromDynamo(surface); // create Thickness object List <Thickness> _thickness = new List <Thickness>(); _thickness.Add(new Thickness(region.CoordinateSystem.Origin, thickness)); // check if surface is vertical if (Math.Abs(region.CoordinateSystem.LocalZ.Z) > FemDesign.Tolerance.Point3d) { throw new System.ArgumentException("Wall is not vertical! Create plate instead."); } // create shell Slab slab = Slab.Wall(identifier, material, region, shellEdgeConnection, shellEccentricity, shellOrthotropy, _thickness); // set local x-axis if (!localX.Equals(Autodesk.DesignScript.Geometry.Vector.ByCoordinates(0, 0, 0))) { slab.SlabPart.LocalX = FemDesign.Geometry.FdVector3d.FromDynamo(localX); } // set local z-axis if (!localZ.Equals(Autodesk.DesignScript.Geometry.Vector.ByCoordinates(0, 0, 0))) { slab.SlabPart.LocalZ = FemDesign.Geometry.FdVector3d.FromDynamo(localZ); } return(slab); }
public static Slab Plate(Autodesk.DesignScript.Geometry.Surface surface, double thickness, Materials.Material material, [DefaultArgument("ShellEccentricity.Default()")] ShellEccentricity shellEccentricity, [DefaultArgument("ShellOrthotropy.Default()")] ShellOrthotropy shellOrthotropy, [DefaultArgument("EdgeConnection.Default()")] EdgeConnection shellEdgeConnection, [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, string identifier = "P") { // create FlatSurface Geometry.Region region = Geometry.Region.FromDynamo(surface); // create Thickness object List <Thickness> _thickness = new List <Thickness>(); _thickness.Add(new Thickness(region.CoordinateSystem.Origin, thickness)); // create shell Slab slab = Slab.Plate(identifier, material, region, shellEdgeConnection, shellEccentricity, shellOrthotropy, _thickness); // set local x-axis if (!localX.Equals(Autodesk.DesignScript.Geometry.Vector.ByCoordinates(0, 0, 0))) { slab.SlabPart.LocalX = FemDesign.Geometry.FdVector3d.FromDynamo(localX); } // set local z-axis if (!localZ.Equals(Autodesk.DesignScript.Geometry.Vector.ByCoordinates(0, 0, 0))) { slab.SlabPart.LocalZ = FemDesign.Geometry.FdVector3d.FromDynamo(localZ); } return(slab); }
public static Slab Plate(string identifier, Materials.Material material, Geometry.Region region, EdgeConnection shellEdgeConnection, ShellEccentricity eccentricity, ShellOrthotropy orthotropy, List <Thickness> thickness) { Slab._plateInstance++; SlabType type = SlabType.Plate; string name = identifier + "." + Slab._plateInstance.ToString() + ".1"; SlabPart slabPart = SlabPart.Define(name, region, thickness, material, shellEdgeConnection, eccentricity, orthotropy); Slab shell = new Slab(type, name, slabPart, material); return(shell); }
/// <summary> /// Set average mesh size to slab. /// </summary> /// <remarks>Action</remarks> /// <param name="slab">Slab.</param> /// <param name="avgMeshSize">Average mesh size.</param> /// <returns></returns> public static Slab AverageSurfaceElementSize(Slab slab, double avgMeshSize) { // deep clone. downstreams objs will contain changes made in this method, upstream objs will not. // downstream and uppstream objs will share guid. Slab slabClone = slab.DeepClone(); // slabClone.SlabPart.MeshSize = avgMeshSize; // return return(slabClone); }
public Slab SetLocalAxes(Autodesk.DesignScript.Geometry.Vector localX, Autodesk.DesignScript.Geometry.Vector localZ) { // deep clone. downstreams objs will contain changes made in this method, upstream objs will not. // downstream and uppstream objs will share guid. Slab slab = this.DeepClone(); // set local x and local z slab.SlabPart.LocalX = Geometry.FdVector3d.FromDynamo(localX); slab.SlabPart.LocalZ = Geometry.FdVector3d.FromDynamo(localZ); // return(slab); }
/// <summary> /// Set EdgeConnections by indices. /// </summary> /// <param name="slab">Slab.</param> /// <param name="shellEdgeConnection">EdgeConnection.</param> /// <param name="index">Index of edge to set.</param> public static Slab EdgeConnection(Slab slab, EdgeConnection shellEdgeConnection, int index) { // deep clone. downstreams objs will contain changes made in this method, upstream objs will not. // downstream and uppstream objs will share guid. Slab slabClone = slab.DeepClone(); if (index < 0 & index >= slabClone.SlabPart.GetEdgeConnections().Count) { throw new System.ArgumentException("Index is out of bounds."); } slabClone.SlabPart.Region.SetEdgeConnection(shellEdgeConnection, index); return(slabClone); }
public static Slab Wall(string identifier, Materials.Material material, Geometry.Region region, EdgeConnection shellEdgeConnection, ShellEccentricity eccentricity, ShellOrthotropy orthotropy, List <Thickness> thickness) { // check if surface is vertical if (Math.Abs(region.CoordinateSystem.LocalZ.Z) > FemDesign.Tolerance.Point3d) { throw new System.ArgumentException("Wall is not vertical! Create plate instead."); } Slab._wallInstance++; SlabType type = SlabType.Wall; string name = identifier + "." + Slab._wallInstance.ToString() + ".1"; SlabPart slabPart = SlabPart.Define(name, region, thickness, material, shellEdgeConnection, eccentricity, orthotropy); Slab shell = new Slab(type, name, slabPart, material); return(shell); }
/// <summary> /// Set average mesh size to slab. /// </summary> /// <remarks>Action</remarks> /// <param name="slab">Slab.</param> /// <param name="avgMeshSize">Average mesh size.</param> /// <returns></returns> public static Slab SetAverageSurfaceElementSize(Slab slab, double avgMeshSize) { return(AverageSurfaceElementSize(slab, avgMeshSize)); }
/// <summary> /// Set EdgeConnections by indices. /// </summary> /// <param name="slab">Slab.</param> /// <param name="shellEdgeConnection">EdgeConnection.</param> /// <param name="indices">Index. List of items. Use SlabDeconstruct to extract index for each respective edge.</param> public static Slab SetEdgeConnection(Slab slab, EdgeConnection shellEdgeConnection, List <int> indices) { return(EdgeConnection(slab, shellEdgeConnection, indices)); }