//This method creates memberhinges private static MemberHinge[] MemberHinges(List <Karamba.CrossSections.CroSec_Joint> kJoints) { List <MemberHinge> rMemberHinges = new List <MemberHinge>(); foreach (Karamba.CrossSections.CroSec_Joint kJoint in kJoints) { if (Array.FindIndex(kJoint.props, k => k != null) < 6) { MemberHinge rMemberHinge = new MemberHinge(); setMemberHinges(ref rMemberHinge, kJoint, 0); rMemberHinge.No = 100 + (int)kJoint.ind; rMemberHinges.Add(rMemberHinge); } int i = 6; Boolean test = true; while (i < 12) { if (kJoint.props[i] != null) { test = false; } i++; } if (!test) { MemberHinge rMemberHinge = new MemberHinge(); setMemberHinges(ref rMemberHinge, kJoint, 6); rMemberHinge.No = 200 + (int)kJoint.ind; rMemberHinges.Add(rMemberHinge); } } return(rMemberHinges.ToArray()); }
//this method sets memberhinge releases private static void setMemberHinges(ref MemberHinge rHinge, CroSec_Joint kJoint, int i) { if (kJoint.props[i] != null) { rHinge.TranslationalConstantX = (double)kJoint.props[i] * 1000; } else { rHinge.TranslationalConstantX = -1; } if (kJoint.props[i + 1] != null) { rHinge.TranslationalConstantY = (double)kJoint.props[i + 1] * 1000; } else { rHinge.TranslationalConstantY = -1; } if (kJoint.props[i + 2] != null) { rHinge.TranslationalConstantZ = (double)kJoint.props[i + 2] * 1000; } else { rHinge.TranslationalConstantZ = -1; } if (kJoint.props[i + 3] != null) { rHinge.RotationalConstantX = (double)kJoint.props[i + 3] * 1000; } else { rHinge.RotationalConstantX = -1; } if (kJoint.props[i + 4] != null) { rHinge.RotationalConstantY = (double)kJoint.props[i + 4] * 1000; } else { rHinge.RotationalConstantY = -1; } if (kJoint.props[i + 5] != null) { rHinge.RotationalConstantZ = (double)kJoint.props[i + 5] * 1000; } else { rHinge.RotationalConstantZ = -1; } }
public RFMemberHinge(MemberHinge hinge) { Comment = hinge.Comment; ID = hinge.ID; IsValid = hinge.IsValid; No = hinge.No; Tag = hinge.Tag; Rx = hinge.RotationalConstantX / 1000; Ry = hinge.RotationalConstantY / 1000; Rz = hinge.RotationalConstantZ / 1000; Tx = hinge.TranslationalConstantX / 1000; Ty = hinge.TranslationalConstantY / 1000; Tz = hinge.TranslationalConstantZ / 1000; ToModify = false; ToDelete = false; }