public sFrameSectionResult DuplicatesFrameSectionResult() { sFrameSectionResult newvr = new sFrameSectionResult(); newvr.ID = this.ID; newvr.location = this.location.DuplicatesXYZ(); newvr.stress_Axial_X = this.stress_Axial_X; newvr.stress_Axial_Y = this.stress_Axial_Y; newvr.stress_Axial_Z = this.stress_Axial_Z; newvr.stress_Moment_X = this.stress_Moment_X; newvr.stress_Moment_Y = this.stress_Moment_Y; newvr.stress_Moment_Z = this.stress_Moment_Z; newvr.stress_Combined = this.stress_Combined; if (this.deflection_mm != null) { newvr.deflection_mm = this.deflection_mm.DuplicatesXYZ(); } return(newvr); }
public sMesh ConstructBeamColorMesh(sRange dataRange, eColorMode colorMode, sRange threshold, double du) { sMesh sm = new sMesh(); int vertexID = 0; for (int i = 0; i < this.results.Count; ++i) { sFrameResult br = this.results[i]; for (int j = 0; j < br.sectionResults.Count; ++j) { sFrameSectionResult sr = br.sectionResults[j]; sColor vcol = this.GetBeamResultColor(dataRange, colorMode, i, j, 255, threshold); sXYZ deflectionVec = du * (sr.deflection_mm * 0.001); sXYZ deflectedPt = sr.location + deflectionVec; sm.SetVertex(vertexID, deflectedPt, vcol); //or //sm.SetVertex(vertexID, sr.point, vcol); sr.ID = vertexID; vertexID++; } } int vertexCountPerFace = this.results[0].sectionResults.Count; int faceIndex = 0; for (int i = 0; i < this.results.Count - 1; ++i) { sFrameResult br_this = this.results[i]; sFrameResult br_next = this.results[i + 1]; for (int j = 0; j < br_this.sectionResults.Count; ++j) { int id0 = 0; int id1 = 0; int id2 = 0; int id3 = 0; if (j < br_this.sectionResults.Count - 1) { id0 = br_this.sectionResults[j].ID; id1 = br_next.sectionResults[j].ID; id2 = br_next.sectionResults[j + 1].ID; id3 = br_this.sectionResults[j + 1].ID; } else { id0 = br_this.sectionResults[j].ID; id1 = br_next.sectionResults[j].ID; id2 = br_next.sectionResults[0].ID; id3 = br_this.sectionResults[0].ID; } sm.SetFace(faceIndex, faceIndex + 1, id0, id1, id2, id3); faceIndex += 2; } } sm.ComputeNormals(); return(sm); }