/// <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)); }
/// <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; }
public static ConnectedPoints Define(Autodesk.DesignScript.Geometry.Point firstPoint, Autodesk.DesignScript.Geometry.Point secondPoint, Releases.Motions motions, Releases.Rotations rotations, System.Guid[] references, string identifier) { // convert geometry Geometry.FdPoint3d p1 = Geometry.FdPoint3d.FromDynamo(firstPoint); Geometry.FdPoint3d p2 = Geometry.FdPoint3d.FromDynamo(secondPoint); // rigidity Releases.RigidityDataType2 rigidity = new Releases.RigidityDataType2(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 ConnectedPoints(p1, p2, rigidity, refs, identifier)); }
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)); }
private static Shells.Slab AddStraightReinfToSlab(Shells.Slab slab, List <SurfaceReinforcement> srfReinfs) { // assert layout if (SurfaceReinforcement.AllStraight(srfReinfs)) { } else { throw new System.ArgumentException("Not all passed surface reinforcement objects are of layout type straight"); } // assert layers if (SurfaceReinforcement.MixedLayers(srfReinfs)) { throw new System.ArgumentException("Can't add mixed layers to the same slab"); } // single layer? var singleLayer = SurfaceReinforcement.AllSingleLayer(srfReinfs); // check if surface reinf parameters are set to slab SurfaceReinforcementParameters srfReinfParams; if (slab.SurfaceReinforcementParameters == null) { srfReinfParams = SurfaceReinforcementParameters.Straight(slab, singleLayer); slab.SurfaceReinforcementParameters = srfReinfParams; } // any surfaceReinforcementParameter set to slab will be overwritten // any surfaceReinforcement with option "centric" will be removed else if (slab.SurfaceReinforcementParameters.Center.PolarSystem == true) { srfReinfParams = SurfaceReinforcementParameters.Straight(slab); slab.SurfaceReinforcementParameters = srfReinfParams; foreach (SurfaceReinforcement item in slab.SurfaceReinforcement) { if (item.Centric != null) { slab.SurfaceReinforcement.Remove(item); } } } // use surface parameters already set to slab else { srfReinfParams = slab.SurfaceReinforcementParameters; } // add surface reinforcement GuidListType baseShell = new GuidListType(slab.SlabPart.Guid); FemDesign.GuidListType surfaceReinforcementParametersGuidReference = new FemDesign.GuidListType(slab.SurfaceReinforcementParameters.Guid); foreach (SurfaceReinforcement item in srfReinfs) { // add references to item item.BaseShell = baseShell; item.SurfaceReinforcementParametersGuid = surfaceReinforcementParametersGuidReference; // check if region item exists if (item.Region == null) { item.Region = Geometry.Region.FromSlab(slab); } // add item to slab slab.SurfaceReinforcement.Add(item); } // return return(slab); }