//public BeamProperties(double matStiff, double poison, string section, WR_ReleaseBeam3d stRel, WR_ReleaseBeam3d enRel) //{ // // _stRel = stRel; // _enRel = enRel; // _section = CrossSectionFormString(section); // } public BeamProperties(BeamProperties other) { _mat = other._mat.Copy(); _section = other._section; _stRel = other._stRel.Copy(); _enRel = other._enRel.Copy(); }
protected override void SolveInstance(IGH_DataAccess DA) { // string crossSection = ""; WR_IXSec xSec= null; WR_ReleaseBeam3d stREl = null; WR_ReleaseBeam3d enREl = null; WR_Material mat = null; WR_Element3dOptProp optProp = null; if (!DA.GetData(0, ref xSec)) { return; } if (!DA.GetData(1, ref stREl)) { return; } if (!DA.GetData(2, ref enREl)) { return; } if (!DA.GetData(3, ref mat)) { return; } // Check releases if (!CheckReleases(stREl, enREl)) return; BeamProperties beamProp; if (!DA.GetData(4, ref optProp)) beamProp = new BeamProperties(mat, xSec, stREl, enREl); else beamProp = new BeamProperties(mat, xSec, stREl, enREl, optProp); DA.SetData(0, beamProp); }
protected override void SolveInstance(IGH_DataAccess DA) { // string crossSection = ""; WR_IXSec xSec = null; WR_ReleaseBeam3d stREl = null; WR_ReleaseBeam3d enREl = null; WR_Material mat = null; WR_Element3dOptProp optProp = null; if (!DA.GetData(0, ref xSec)) { return; } if (!DA.GetData(1, ref stREl)) { return; } if (!DA.GetData(2, ref enREl)) { return; } if (!DA.GetData(3, ref mat)) { return; } // Check releases if (!CheckReleases(stREl, enREl)) { return; } BeamProperties beamProp; if (!DA.GetData(4, ref optProp)) { beamProp = new BeamProperties(mat, xSec, stREl, enREl); } else { beamProp = new BeamProperties(mat, xSec, stREl, enREl, optProp); } DA.SetData(0, beamProp); }
protected override void SolveInstance(IGH_DataAccess DA) { BeamProperties prop = null; Line ln = Line.Unset; Vector3d norm = Vector3d.Unset; if (!DA.GetData(0, ref ln)) { return; } if (!DA.GetData(1, ref prop)) { return; } if (!DA.GetData(2, ref norm)) { return; } norm.Unitize(); //Check if angle between tangent and normal is less than 1 degree if (Vector3d.VectorAngle(norm, ln.UnitTangent) < 0.0174 || Vector3d.VectorAngle(-norm, ln.UnitTangent) < 0.0174) { AddRuntimeMessage(GH_RuntimeMessageLevel.Error, "The given normal is within 1 degree of the tangent of the centre line. Please adjust normal"); return; } double factor = Utilities.GetScalingFactorFromRhino(); WR_Vector wrNorm = new WR_Vector(norm.X, norm.Y, norm.Z); WR_XYZ st = new WR_XYZ(ln.FromX * factor, ln.FromY * factor, ln.FromZ * factor); WR_XYZ en = new WR_XYZ(ln.ToX * factor, ln.ToY * factor, ln.ToZ * factor); WR_Elem3dRcp beam = new WR_Elem3dRcp(st, en, prop.StartRelease, prop.EndRelease, prop.CrossSection, prop.Material, wrNorm, prop.OptimizationProperties); DA.SetData(0, beam); }