Commit 5da02385 authored by Numanoglu's avatar Numanoglu
Browse files

Angle Tolerance between Plane and Line

parent 9d8e0e40
Pipeline #12431 failed with stage
......@@ -41,9 +41,9 @@ public class SweepEdge {
this.direction = direction;
}
public Vector3d intersection(Plane plane, double minLinePlaneAngleRatio) {
public Vector3d intersection(Plane plane, double minLinePlaneAngle) {
if (!hasIntersectionPoint(plane, minLinePlaneAngleRatio)) {
if (!hasIntersectionPoint(plane, minLinePlaneAngle)) {
return null;
}
......@@ -52,23 +52,24 @@ public class SweepEdge {
return referencePoint.plus(direction.mult(lineParameter));
}
public boolean hasIntersectionPoint(Plane plane, double minLinePlaneAngleRatio) {
public boolean hasIntersectionPoint(Plane plane, double minLinePlaneAngle) {
if (plane == null) {
return false;
}
double denominator = plane.getNormal().dot(direction);
return Math.abs(denominator) >= minLinePlaneAngleRatio;
double linePlaneAngle = Math.asin(Math.min(1.0, Math.abs(denominator)));
return linePlaneAngle >= minLinePlaneAngle;
}
public boolean intersection(Plane plane, Vector3d intersectionPoint, double minLinePlaneAngleRatio) {
public boolean intersection(Plane plane, Vector3d intersectionPoint, double minLinePlaneAngle) {
if (intersectionPoint == null) {
return false;
}
Vector3d point = intersection(plane, minLinePlaneAngleRatio);
Vector3d point = intersection(plane, minLinePlaneAngle);
if (point == null) {
return false;
}
......
......@@ -22,8 +22,7 @@ public class SweepUtilities {
// todo: Toleranzen passend initialisieren
private double minSweepEdgeLength = 0.001; // Mindestlaenge einer Kante
private double maxPointPlaneDistance = 0.001; // Maximalabstand zur Ebene
// TODO Transformiere mit arcsin() um dem Nenner den kompl.Winkel zuzuordnen
private double minLinePlaneAngleRatio = 0.001; // MindestNeigung: vgl. <EbenenenNormale,GeradenRichtVektor>
private double minLinePlaneAngle = Math.toRadians(1.0); // Mindestwinkel zwischen Gerade und Ebene
private List<SweepVertex> sweepVertices;
......@@ -83,7 +82,7 @@ public class SweepUtilities {
*/
for (SweepVertex v : sweepVertices) {
v.calculateNewPoint(targetPlane, errorPolygon, minSweepEdgeLength, minLinePlaneAngleRatio);
v.calculateNewPoint(targetPlane, errorPolygon, minSweepEdgeLength, minLinePlaneAngle);
}
return canHeal();
......
......@@ -118,7 +118,7 @@ public class SweepVertex {
}
public void calculateNewPoint (Plane targetPlane, Polygon p, double minSweepEdgeLength, double minLinePlaneAngleRatio) {
public void calculateNewPoint (Plane targetPlane, Polygon p, double minSweepEdgeLength, double minLinePlaneAngle) {
newPoint = null;
......@@ -156,7 +156,7 @@ public class SweepVertex {
return;
}
Vector3d intersectionPoint = sweepEdge.intersection(targetPlane, minLinePlaneAngleRatio);
Vector3d intersectionPoint = sweepEdge.intersection(targetPlane, minLinePlaneAngle);
if (intersectionPoint == null) {
status = SweepVertexStatus.ERROR;
return;
......
Supports Markdown
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