In January 2021 we will introduce a 10 GB quota for project repositories. Higher limits for individual projects will be available on request. Please see https://doku.lrz.de/display/PUBLIC/GitLab for more information.

Commit 3b6c15c5 authored by Benedikt Zoennchen's avatar Benedikt Zoennchen Committed by Benedikt Zoennchen

flipping problem is now fixed

parent 4d14df94
......@@ -316,8 +316,6 @@ kernel void computeCompleteSF(__const int size, __global double2* qlengths, __lo
if(lid == 0) {
//*scaleFactor = qlengths[10].s0;
//*scaleFactor = partialSums[0].s0;
*scaleFactor = sqrt(partialSums[0].s0 / partialSums[0].s1);
}
}
......
......@@ -63,10 +63,10 @@ public class CLGatherer {
edgeBuffer.put(index, edge.getEnd());
index++;
if(mesh.isBoundary(mesh.getFace(edge))) {
edgeBuffer.put(index, mesh.getFace(mesh.getTwin(edge)).getId());
index++;
edgeBuffer.put(index, -1);
index++;
edgeBuffer.put(index, mesh.getFace(mesh.getTwin(edge)).getId());
index++;
if(mesh.isBoundary(mesh.getFace(mesh.getTwin(edge)))) {
throw new IllegalArgumentException("invalid mesh!");
}
......
......@@ -174,6 +174,7 @@ public class CLPSMeshing implements IPSMeshing {
}
triangulation = ITriangulation.createATriangulation(IPointLocator.Type.DELAUNAY_HIERARCHY, clDistMesh.getResult(), (x, y) -> new MeshPoint(x, y, false));
removeTrianglesInsideObstacles();
removeLowQualityTriangles();
triangulation.finalize();
}
......
......@@ -44,7 +44,7 @@ public class TestEnhancedVersion4 extends JFrame {
while (counter < 1) {
while (counter < 100) {
//obscuteTriangles = meshGenerator.getTriangles().stream().filter(tri -> tri.isNonAcute()).count();
//PriorityQueue<PFace<MeshPoint>> priorityQueue = meshGenerator.getQuailties();
//avgQuality = priorityQueue.stream().reduce(0.0, (aDouble, meshPointPFace) -> aDouble + meshGenerator.faceToQuality(meshPointPFace), (d1, d2) -> d1 + d2) / priorityQueue.size();
......@@ -57,7 +57,9 @@ public class TestEnhancedVersion4 extends JFrame {
long ms = System.currentTimeMillis();
//meshGenerator.refresh();
//meshGenerator.retriangulate();
if(meshGenerator.step(true)) {
boolean retriangulation = meshGenerator.step(true);
ms = System.currentTimeMillis() - ms;
if(retriangulation) {
//meshGenerator.refresh();
meshGenerator.retriangulate();
}
......@@ -68,7 +70,7 @@ public class TestEnhancedVersion4 extends JFrame {
meshGenerator.retriangulate();
}*/
ms = System.currentTimeMillis() - ms;
time += ms;
System.out.println("Step-Time: " + ms);
......
......@@ -39,5 +39,18 @@ public class TestGeometryUtils {
assertFalse(!GeometryUtils.isRightOf(p2, p1, t));
}
@Test
public void testCircumcenterOrder() {
double eps = 0.000001;
VPoint r = new VPoint(5, 0.5);
VPoint q = new VPoint(5, -0.5);
VPoint t = new VPoint(-5, -0.5);
VPoint c1 = GeometryUtils.getCircumcenter(r, q, t);
VPoint c2 = GeometryUtils.getCircumcenter(r, t, q);
VPoint c3 = GeometryUtils.getCircumcenter(t, r, q);
assertTrue(c1.distance(c2) < eps);
assertTrue(c2.distance(c3) < eps);
}
}
......@@ -8,13 +8,10 @@ import org.apache.log4j.LogManager;
import org.apache.log4j.Logger;
import org.junit.Before;
import org.junit.Test;
import org.vadere.util.geometry.GeometryUtils;
import org.vadere.util.geometry.mesh.gen.*;
import org.vadere.util.geometry.mesh.impl.VPTriangulation;
import org.vadere.util.geometry.mesh.inter.IFace;
import org.vadere.util.geometry.mesh.inter.IHalfEdge;
import org.vadere.util.geometry.mesh.inter.IPointLocator;
import org.vadere.util.geometry.mesh.inter.ITriangulation;
import org.vadere.util.geometry.mesh.inter.IVertex;
import org.vadere.util.geometry.mesh.inter.*;
import org.vadere.util.geometry.shapes.IPoint;
import org.vadere.util.geometry.shapes.VPoint;
import org.vadere.util.geometry.shapes.VRectangle;
......@@ -117,8 +114,12 @@ public class TestBoyerWatson {
points.add(p3);
ITriangulation<VPoint, PVertex<VPoint>, PHalfEdge<VPoint>, PFace<VPoint>> delaunayTriangulation = ITriangulation.createPTriangulation(IPointLocator.Type.BASE, points, (x, y) -> new VPoint(x, y));
PFace<VPoint> face = delaunayTriangulation.locateFace(centerPoint).get();
IMesh<VPoint, PVertex<VPoint>, PHalfEdge<VPoint>, PFace<VPoint>> mesh = delaunayTriangulation.getMesh();
PHalfEdge<VPoint> edge = mesh.getEdge(face);
// triangulations are always ccw ordered!
assertTrue(GeometryUtils.isCCW(mesh.getVertex(edge), mesh.getVertex(mesh.getNext(edge)), mesh.getVertex(mesh.getPrev(edge))));
delaunayTriangulation.splitTriangle(face, centerPoint);
delaunayTriangulation.finalize();
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment