Skip to content
Snippets Groups Projects
Commit 3e2caaac authored by Radek Ošlejšek's avatar Radek Ošlejšek
Browse files

Symmetry estimator extended with a constructor enabling to reuse existing curvatures

parent e42bb2f3
No related branches found
No related tags found
No related merge requests found
......@@ -51,6 +51,7 @@ public class EfficiencyTests {
printSymmetryPlane(face1, false, printDetails, false);
printSymmetryPlane(face1, false, printDetails, true);
/*
System.out.println();
System.out.println(measureKdTreeCreation(face1) + "\tmsec:\tKd-tree creation of first face");
System.out.println(measureKdTreeCreation(face2) + "\tmsec:\tKd-tree creation of second face");
......@@ -66,6 +67,7 @@ public class EfficiencyTests {
testAndPrint(face1, new HausdorffDistance(face2.getMeshModel(), Strategy.POINT_TO_POINT_ABSOLUTE, false, false, true), printDetails);
testAndPrint(face1, new HausdorffDistance(face2.getMeshModel(), Strategy.POINT_TO_POINT, relativeDist, false, true), printDetails);
testAndPrint(face1, new HausdorffDistance(face2.getMeshModel(), Strategy.POINT_TO_TRIANGLE_APPROXIMATE, relativeDist, false, true), printDetails);
*/
}
protected static void testAndPrint(HumanFace face, HausdorffDistance vis, boolean printDetails) {
......
......@@ -37,7 +37,6 @@ public class SymmetryEstimator {
private final MeshFacet facet;
private final Config config;
private final boolean maxCurvatureAlg;
// results:
private List<Double> curvatures;
......@@ -63,7 +62,30 @@ public class SymmetryEstimator {
}
this.facet = facet;
this.config = config;
this.maxCurvatureAlg = maxCurvatureAlg;
this.curvatures = calculateCurvatures(facet, maxCurvatureAlg);
}
/**
* Constructor.
*
* @param facet Mesh facet for which the symmetry plane is calculated
* @param config Algorighm options
* @param curvatures Precomputed curvature values. Must not be null or empty.
* @throws IllegalArgumentException if some input paramter is missing
*/
public SymmetryEstimator(MeshFacet facet, Config config, List<Double> curvatures) {
if (facet == null) {
throw new IllegalArgumentException("facet");
}
if (config == null) {
throw new IllegalArgumentException("config");
}
if (curvatures == null || curvatures.isEmpty()) {
throw new IllegalArgumentException("curvatures");
}
this.facet = facet;
this.config = config;
this.curvatures = curvatures;
}
/**
......@@ -74,7 +96,6 @@ public class SymmetryEstimator {
public void calculateSymmetryPlane(boolean concurrently) {
List<Plane> planes = new ArrayList<>();
curvatures = calculateCurvatures(facet, maxCurvatureAlg);
final SignificantPoints sigPoints = new SignificantPoints(curvatures, config.getSignificantPointCount());
sigPoints.cacheData(facet);
final double maxDistance = calculateMaxRelativeDistance(facet, config);
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment