private boolean needTri(double xp, double yp, TriMesh.Tri tri) { if (tri==null || _mesh.isMarked(tri)) return false; TriMesh.Node na = tri.nodeA(); TriMesh.Node nb = tri.nodeB(); TriMesh.Node nc = tri.nodeC(); double xa = na.xp(), ya = na.yp(); double xb = nb.xp(), yb = nb.yp(); double xc = nc.xp(), yc = nc.yp(); return Geometry.inCircle(xa,ya,xb,yb,xc,yc,xp,yp)>0.0; }
/** * Gets an array of tet nabors of the specified node. * @param node the node for which to get nabors. * @return the array of nabors. */ public synchronized Tet[] getTetNabors(Node node) { TetList nabors = new TetList(); getTetNabors(node,nabors); return nabors.trim(); }
private boolean needTet(double xp, double yp, double zp, TetMesh.Tet tet) { if (tet==null || _mesh.isMarked(tet)) return false; TetMesh.Node na = tet.nodeA(); TetMesh.Node nb = tet.nodeB(); TetMesh.Node nc = tet.nodeC(); TetMesh.Node nd = tet.nodeD(); double xa = na.xp(), ya = na.yp(), za = na.zp(); double xb = nb.xp(), yb = nb.yp(), zb = nb.zp(); double xc = nc.xp(), yc = nc.yp(), zc = nc.zp(); double xd = nd.xp(), yd = nd.yp(), zd = nd.zp(); return Geometry.inSphere(xa,ya,za,xb,yb,zb,xc,yc,zc,xd,yd,zd,xp,yp,zp)>0.0; }
private boolean getNaturalNabors(float x, float y, float z) { _mesh.clearNodeMarks(); _mesh.clearTetMarks(); _nodeList.clear(); _tetList.clear(); TetMesh.PointLocation pl = _mesh.locatePoint(x,y,z); if (pl.isOutside()) return false; addTet(x,y,z,pl.tet()); return true; } private void addTet(double xp, double yp, double zp, TetMesh.Tet tet) {
public void testLeftOfPlaneSpecial() { double[] pa = {99.50000003392293,125.85383672388726,4.712236446160304}; double[] pb = {91.50000003119546,125.85383641401195,4.712236443259705}; double[] pc = {107.5000000366504,125.85383703376256,4.712236449060903}; double[] pd = {27.50000030246409,125.8538208916998,122.28777353807229}; double ra = Geometry.leftOfPlane(pa,pb,pc,pd); double rf = Geometry.leftOfPlaneFast(pa,pb,pc,pd); assertTrue(ra==0.0); assertTrue(rf!=0.0); }
/** * Gets an array of tri nabors of the specified node. * @param node the node for which to get nabors. * @return the array of nabors. */ public synchronized Tri[] getTriNabors(Node node) { TriList nabors = new TriList(); getTriNabors(node,nabors); return nabors.trim(); }
/** * Gets an array of node nabors of the specified node. * @param node the node for which to get nabors. * @return the array of nabors. */ public synchronized Node[] getNodeNabors(Node node) { NodeList nabors = new NodeList(); getNodeNabors(node,nabors); return nabors.trim(); }
private TetMesh.Edge findMeshEdge(Node nodeA, Node nodeB) { TetMesh.Node meshNodeA = nodeA._meshNode; TetMesh.Node meshNodeB = nodeB._meshNode; TetMesh.Edge meshEdge = _mesh.findEdge(meshNodeA,meshNodeB); if (meshEdge!=null && meshNodeA!=meshEdge.nodeA()) meshEdge = meshEdge.mate(); return meshEdge; }
/** * Gets an array of node nabors of the specified node. * @param node the node for which to get nabors. * @return the array of nabors. */ public synchronized Node[] getNodeNabors(Node node) { NodeList nabors = new NodeList(); getNodeNabors(node,nabors); return nabors.trim(); }
private void validate() { assert _meshEdge!=null; assert _faceLeft==null || _faceLeft.references(nodeA(),nodeB()); assert _faceRight==null || _faceRight.references(nodeA(),nodeB()); } private Edge(TetMesh.Edge meshEdge, Face face) {
/** * Removes the specified node from this surface, if present. * @param node the node. * @return true, if node was removed; false, otherwise. */ public synchronized boolean removeNode(Node node) { boolean removed = _mesh.removeNode(node._meshNode); if (removed) rebuild(); return removed; }
/** * Determines whether the specified nodes would form a valid face. * Assumes that nodes A and B are a boundary edge. Node C is the * other node that would form the face in question. */ private boolean validForFace(Node nodeA, Node nodeB, Node nodeC) { return !nodeC.isInSurface() || nodeC.isOnBoundary() && !hasInternalEdge(nodeB,nodeC) && !hasInternalEdge(nodeC,nodeA); }
/** * Gets an array of face nabors of the specified node. * @param node the node for which to get nabors. * @return the array of nabors. */ public synchronized Face[] getFaceNabors(Node node) { FaceList nabors = new FaceList(); getFaceNabors(node,nabors); return nabors.trim(); }
/** * Determines whether the specified face is an inner face. * @param face a face. * @return true, if inner; false, otherwise. */ public boolean isInner(Face face) { Tet tetLeft = face.tetLeft(); if (tetLeft!=null && isInner(tetLeft)) return true; Tet tetRight = face.tetRight(); return tetRight!=null && isInner(tetRight); }
public void testLeftOfPlaneSpecial2() { double[] pa = {111.50000056515266,125.85385176546224,4.712249324321081}; double[] pb = {123.50000062597627,125.85385229716680,4.712249325708733}; double[] pc = {105.50000053474086,125.85385224976321,4.712249323627476}; double[] pd = { 93.50000047391725,125.85385171805865,4.712249322239824}; double ra = Geometry.leftOfPlane(pa,pb,pc,pd); double rf = Geometry.leftOfPlaneFast(pa,pb,pc,pd); assertTrue(ra==0.0); assertTrue(rf!=0.0); }
/** * Gets an array of tet nabors of the specified edge. * @param edge the edge for which to get nabors. * @return the array of nabors. */ public synchronized Tet[] getTetNabors(Edge edge) { TetList nabors = new TetList(); getTetNabors(edge,nabors); return nabors.trim(); }
/** * Gets an array of tri nabors of the specified edge. * @param edge the edge for which to get nabors. * @return the array of nabors. */ public synchronized Tri[] getTriNabors(Edge edge) { TriList nabors = new TriList(); getTriNabors(edge,nabors); return nabors.trim(); }
/** * Gets an array of tet nabors of the specified face. * @param face the face for which to get nabors. * @return the array of nabors. */ public synchronized Tet[] getTetNabors(Face face) { TetList nabors = new TetList(); getTetNabors(face,nabors); return nabors.trim(); }