Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Menu
Open sidebar
CityDoctor
CityDoctor2
Commits
2799ce51
Commit
2799ce51
authored
Sep 01, 2026
by
Numanoglu
Browse files
Require explicit sweep tolerances
parent
7088483b
Changes
5
Hide whitespace changes
Inline
Side-by-side
CityDoctorParent/Extensions/CityDoctorHealer/src/main/java/de/hft/stuttgart/citydoctor2/healing/HealPlanarPolygonSweep.java
View file @
2799ce51
...
@@ -29,7 +29,7 @@ public class HealPlanarPolygonSweep implements HealingMethod {
...
@@ -29,7 +29,7 @@ public class HealPlanarPolygonSweep implements HealingMethod {
return
false
;
return
false
;
}
}
SweepUtilities
utils
=
new
SweepUtilities
(
err
);
SweepUtilities
utils
=
new
SweepUtilities
(
err
,
0.001
,
0.001
);
utils
.
initialize
();
utils
.
initialize
();
if
(
utils
.
calculate
())
{
if
(
utils
.
calculate
())
{
utils
.
doHeal
();
utils
.
doHeal
();
...
...
CityDoctorParent/Extensions/CityDoctorHealer/src/main/java/de/hft/stuttgart/citydoctor2/healing/SweepUtilities.java
View file @
2799ce51
...
@@ -15,20 +15,23 @@ import de.hft.stuttgart.citydoctor2.math.Plane;
...
@@ -15,20 +15,23 @@ import de.hft.stuttgart.citydoctor2.math.Plane;
public
class
SweepUtilities
{
public
class
SweepUtilities
{
private
static
final
Logger
logger
=
LogManager
.
getLogger
(
SweepUtilities
.
class
);
private
static
final
Logger
logger
=
LogManager
.
getLogger
(
SweepUtilities
.
class
);
private
static
final
double
PI
=
Math
.
PI
;
private
Plane
targetPlane
;
private
Plane
targetPlane
;
private
Polygon
errorPolygon
;
private
Polygon
errorPolygon
;
// todo: Toleranzen passend initialisieren
private
double
minSweepEdgeLength
;
private
double
minSweepEdgeLength
=
0.001
;
// Mindestlaenge einer Kante
private
double
pointOnPlaneTolerance
;
private
double
maxPointPlaneDistance
=
0.001
;
// Maximalabstand zur Ebene
private
double
minLinePlaneAngle
;
private
double
minLinePlaneAngle
=
PI
/
180.0
;
// Mindestwinkel zwischen Gerade und Ebene im Bogenmass
private
List
<
SweepVertex
>
sweepVertices
;
private
List
<
SweepVertex
>
sweepVertices
;
public
SweepUtilities
(
NonPlanarPolygonDistancePlaneError
err
)
{
public
SweepUtilities
(
NonPlanarPolygonDistancePlaneError
err
,
double
pointOnPlaneTolerance
,
double
sweepEdgeAndAngleTolerance
)
{
this
.
pointOnPlaneTolerance
=
pointOnPlaneTolerance
;
minSweepEdgeLength
=
sweepEdgeAndAngleTolerance
;
minLinePlaneAngle
=
sweepEdgeAndAngleTolerance
;
if
(
err
==
null
)
{
if
(
err
==
null
)
{
return
;
return
;
...
@@ -54,7 +57,7 @@ public class SweepUtilities {
...
@@ -54,7 +57,7 @@ public class SweepUtilities {
for
(
SweepVertex
v
:
sweepVertices
)
{
for
(
SweepVertex
v
:
sweepVertices
)
{
v
.
collectOutgoingEdges
(
errorPolygon
,
minSweepEdgeLength
);
v
.
collectOutgoingEdges
(
errorPolygon
,
minSweepEdgeLength
);
v
.
initStatus
(
targetPlane
,
maxP
ointPlane
Dist
ance
);
v
.
initStatus
(
targetPlane
,
p
oint
On
Plane
Toler
ance
);
}
}
}
}
...
@@ -78,7 +81,7 @@ public class SweepUtilities {
...
@@ -78,7 +81,7 @@ public class SweepUtilities {
/*
/*
// If there is a new target plane, new initialization of status is necessary:
// If there is a new target plane, new initialization of status is necessary:
for (SweepVertex v : verts) {
for (SweepVertex v : verts) {
v.initStatus(targetPlane,
maxP
ointPlane
Dist
ance);
v.initStatus(targetPlane,
p
oint
On
Plane
Toler
ance);
}
}
*/
*/
...
...
CityDoctorParent/Extensions/CityDoctorHealer/src/main/java/de/hft/stuttgart/citydoctor2/healing/SweepVertex.java
View file @
2799ce51
...
@@ -71,14 +71,14 @@ public class SweepVertex {
...
@@ -71,14 +71,14 @@ public class SweepVertex {
}
}
}
}
public
void
initStatus
(
Plane
targetPlane
,
double
maxP
ointPlane
Dist
ance
)
{
public
void
initStatus
(
Plane
targetPlane
,
double
p
oint
On
Plane
Toler
ance
)
{
if
(
targetPlane
==
null
)
{
if
(
targetPlane
==
null
)
{
status
=
SweepVertexStatus
.
ERROR
;
status
=
SweepVertexStatus
.
ERROR
;
return
;
return
;
}
}
if
(
targetPlane
.
getDistance
(
sweepVertex
)
<
maxP
ointPlane
Dist
ance
)
{
if
(
targetPlane
.
getDistance
(
sweepVertex
)
<
p
oint
On
Plane
Toler
ance
)
{
status
=
SweepVertexStatus
.
ON_PLANE
;
status
=
SweepVertexStatus
.
ON_PLANE
;
}
}
else
if
(
outgoingEdges
.
size
()
==
0
)
{
else
if
(
outgoingEdges
.
size
()
==
0
)
{
...
...
CityDoctorParent/Extensions/CityDoctorHealer/src/test/java/de/hft/stuttgart/citydoctor2/healing/SweepUtilitiesStepTest.java
View file @
2799ce51
...
@@ -345,7 +345,7 @@ public class SweepUtilitiesStepTest {
...
@@ -345,7 +345,7 @@ public class SweepUtilitiesStepTest {
private
SweepUtilities
createSweepUtilities
(
Polygon
sweepPolygon
,
Plane
targetPlane
)
{
private
SweepUtilities
createSweepUtilities
(
Polygon
sweepPolygon
,
Plane
targetPlane
)
{
NonPlanarPolygonDistancePlaneError
error
=
new
NonPlanarPolygonDistancePlaneError
(
sweepPolygon
,
0
,
null
,
NonPlanarPolygonDistancePlaneError
error
=
new
NonPlanarPolygonDistancePlaneError
(
sweepPolygon
,
0
,
null
,
targetPlane
);
targetPlane
);
return
new
SweepUtilities
(
error
);
return
new
SweepUtilities
(
error
,
0.001
,
0.001
);
}
}
private
Polygon
getPolygonAtIndex
(
Building
building
,
int
index
)
{
private
Polygon
getPolygonAtIndex
(
Building
building
,
int
index
)
{
...
...
CityDoctorParent/Extensions/CityDoctorHealer/src/test/java/de/hft/stuttgart/citydoctor2/healing/SweepUtilitiesSyntheticTest.java
View file @
2799ce51
...
@@ -111,7 +111,7 @@ public class SweepUtilitiesSyntheticTest {
...
@@ -111,7 +111,7 @@ public class SweepUtilitiesSyntheticTest {
private
boolean
runSweep
(
Polygon
sweepPolygon
,
Plane
targetPlane
)
{
private
boolean
runSweep
(
Polygon
sweepPolygon
,
Plane
targetPlane
)
{
NonPlanarPolygonDistancePlaneError
error
=
new
NonPlanarPolygonDistancePlaneError
(
sweepPolygon
,
0
,
null
,
NonPlanarPolygonDistancePlaneError
error
=
new
NonPlanarPolygonDistancePlaneError
(
sweepPolygon
,
0
,
null
,
targetPlane
);
targetPlane
);
SweepUtilities
utilities
=
new
SweepUtilities
(
error
);
SweepUtilities
utilities
=
new
SweepUtilities
(
error
,
0.001
,
0.001
);
utilities
.
initialize
();
utilities
.
initialize
();
if
(!
utilities
.
calculate
())
{
if
(!
utilities
.
calculate
())
{
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment