private void makeLinks(string direction, StructuralCell c) { List <Vector3d> vectors = makeLinkVectors(direction, c.fillerCell); Vector3d linkDirection = new Vector3d(); switch (direction) { case "x": linkDirection = referencePlane.XAxis; break; case "y": linkDirection = referencePlane.YAxis; break; case "z": linkDirection = referencePlane.ZAxis; break; } Transform xform = Transform.PlaneToPlane(Plane.WorldXY, referencePlane); foreach (Vector3d v in vectors) { v.Transform(xform); Line link = new Line(c.centroid + v, linkDirection, parameters.memberSize); if (!StructuralCell.curveIsInsideMesh(link.ToNurbsCurve(), slice)) { linkElements.Add(link); } } }
//public DiagonalMember(int dNum,Brep bound) //{ // dnum = dNum; // switch (dNum) // { // case 0: // endpoints.Add(bound.Vertices[1].Location); // endpoints.Add(bound.Vertices[6].Location); // points.Add(bound.Vertices[1].Location); // points.Add(bound.Vertices[0].Location); // points.Add(bound.Vertices[6].Location); // points.Add(bound.Vertices[7].Location); // break; // case 1: // endpoints.Add(bound.Vertices[2].Location); // endpoints.Add(bound.Vertices[6].Location); // points.Add(bound.Vertices[0].Location); // points.Add(bound.Vertices[2].Location); // points.Add(bound.Vertices[4].Location); // points.Add(bound.Vertices[6].Location); // break; // case 2: // endpoints.Add(bound.Vertices[2].Location); // endpoints.Add(bound.Vertices[5].Location); // points.Add(bound.Vertices[3].Location); // points.Add(bound.Vertices[2].Location); // points.Add(bound.Vertices[4].Location); // points.Add(bound.Vertices[5].Location); // break; // case 3: // endpoints.Add(bound.Vertices[5].Location); // endpoints.Add(bound.Vertices[1].Location); // points.Add(bound.Vertices[1].Location); // points.Add(bound.Vertices[3].Location); // points.Add(bound.Vertices[5].Location); // points.Add(bound.Vertices[7].Location); // break; // case 4: // endpoints.Add(bound.Vertices[1].Location); // endpoints.Add(bound.Vertices[2].Location); // points.Add(bound.Vertices[1].Location); // points.Add(bound.Vertices[0].Location); // points.Add(bound.Vertices[2].Location); // points.Add(bound.Vertices[3].Location); // break; // case 5: // endpoints.Add(bound.Vertices[5].Location); // endpoints.Add(bound.Vertices[6].Location); // points.Add(bound.Vertices[4].Location); // points.Add(bound.Vertices[5].Location); // points.Add(bound.Vertices[7].Location); // points.Add(bound.Vertices[6].Location); // break; // } // diagonal = new Line(endpoints[0], endpoints[1]); //} public void trim(Mesh m) { if (StructuralCell.curveIsInsideMesh(diagonal.ToNurbsCurve(), m)) { needed = false; } else { int[] faceIds; Point3d[] points = Rhino.Geometry.Intersect.Intersection.MeshLine(m, diagonal, out faceIds); if (points.Length > 0) { //try find new diagonal newDiagonal(m); } } }