private void setInnerBound() { centroid = MeshTools.meshCentroid(boundary); Mesh offset = MeshTools.makeCuboid(cellPlane, xDim - memberSize, yDim - memberSize, zDim - memberSize); innerBoundary = Brep.CreateFromMesh(offset, false); foreach (BrepVertex p in innerBoundary.Vertices) { nodeGrid.Add(p.Location); } nodeGrid.Add(new Line(nodeGrid[0], nodeGrid[2]).PointAt(0.5)); nodeGrid.Add(new Line(nodeGrid[1], nodeGrid[3]).PointAt(0.5)); nodeGrid.Add(new Line(nodeGrid[6], nodeGrid[4]).PointAt(0.5)); nodeGrid.Add(new Line(nodeGrid[7], nodeGrid[5]).PointAt(0.5)); setCentreLines(); //foreach(BrepEdge be in innerBoundary.Edges) //{ // untrimmedCentreLines.Add(be.DuplicateCurve()); //} ////add diagonals for (int d = 0; d < 11; d++) { diagonalMembers.Add(new DiagonalMember(d, nodeGrid)); } //set the faceboundaries setBoundaryGeometry(); }
private void defineSkinCells() { foreach (List <StructuralCell> sc in voxels) { foreach (StructuralCell c in sc) { if (c.id == cellDebugId) { int g = 0; } Mesh extendSplitter = MeshTools.makeCuboid(c.cellPlane, c.xDim, c.yDim, c.zDim); var intersectCurve = Rhino.Geometry.Intersect.Intersection.MeshMeshAccurate(slice, extendSplitter, RhinoDoc.ActiveDoc.ModelAbsoluteTolerance); if (intersectCurve != null) { if (intersectCurve.Length > 0) { //we know there is defintely an intersection if we have result from MeshMesh Mesh caveface = MeshTools.findIntersection(slice, c); if (caveface == null) { return; } MeshTools.matchOrientation(slice, ref caveface); c.setSkinCell(caveface); } } } } }
public StructuralCell(Plane cellplane, double xdim, double ydim, double zdim, double memberDim, string ID, bool filler, Color c) { cellPlane = cellplane; xDim = xdim; yDim = ydim; zDim = zdim; boundary = MeshTools.makeCuboid(cellPlane, xDim, yDim, zDim); boundary.FaceNormals.ComputeFaceNormals(); memberSize = memberDim; cellType = CellType.Undefined; id = ID; setPositionFromID(); fillerCell = filler; displayColor = c; setInnerBound(); centreLines = untrimmedCentreLines; storeDiagonals(); }