/** * Returns a face that references the specified nodes. * @param node1 a node. * @param node2 a node. * @param node3 a node. * @return a face that references the specified nodes; or null, * if a node is not in the surface or the surface has no faces. */ public synchronized Face findFace(Node node1, Node node2, Node node3) { Face face = findFace(node1,node2); // if (face!=null) { // clearFaceMarks(); // face = findFace(face,node1,node2,node3); // } if (face!=null) { if (face.references(node3)) return face; face = face.faceNabor(node3); if (face!=null && face.references(node3)) return face; } return null; }
private Edge(TetMesh.Edge meshEdge, Face face) { _meshEdge = meshEdge; Node nodeA = (Node)meshEdge.nodeA().data; Node nodeB = (Node)meshEdge.nodeB().data; Node nodeC = (face!=null)?otherNode(face,nodeA,nodeB):null; Check.argument(face==null || nodeC!=null,"face references edge"); if (nodeC!=null) { if (nodesInOrder(face,nodeA,nodeB,nodeC)) { _faceLeft = face; _faceRight = face.faceNabor(nodeC); } else { _faceLeft = face.faceNabor(nodeC); _faceRight = face; } } } }
/** * Determines whether the specified nodes are an internal edge. * An internal edge is not on the boundary; it has two nabor faces. */ private boolean hasInternalEdge(Node nodeA, Node nodeB) { Face face = findFace(nodeA,nodeB); if (face==null) return false; face = face.faceNabor(otherNode(face,nodeA,nodeB)); if (face==null) return false; return true; }