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
11f09fca
Commit
11f09fca
authored
Jul 16, 2026
by
Pries
Browse files
little changes in first Version of sweep-utility-classes
parent
eb56cfd9
Pipeline
#12420
failed with stage
in 2 minutes and 26 seconds
Changes
2
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
CityDoctorParent/Extensions/CityDoctorHealer/src/main/java/de/hft/stuttgart/citydoctor2/healing/SweepUtilities.java
View file @
11f09fca
...
...
@@ -45,18 +45,22 @@ public class SweepUtilities {
private
double
epsIntersection
=
0.001
;
//Epsilon fuer Winkel zwischen Kante und Ebene
private
List
<
SweepVertex
>
verts
=
new
ArrayList
<>()
;
private
List
<
SweepVertex
>
verts
;
public
SweepUtilities
(
NonPlanarPolygonDistancePlaneError
err
)
{
targetPlane
=
err
.
getPlane
();
pol
=
err
.
getPolygon
();
collectSweepVertices
(
pol
);
}
public
void
initialize
()
{
int
nVerts
=
countSweepVertices
(
pol
);
verts
=
new
ArrayList
<>(
nVerts
);
collectSweepVertices
(
pol
);
for
(
SweepVertex
v
:
verts
)
{
v
.
collectOutgoingEdges
(
pol
/* todo: weitere Uebergabeparameter hinzufuegen */
,
epsPointDist
);
v
.
initStatus
(
targetPlane
,
epsPlaneDist
);
...
...
@@ -66,6 +70,10 @@ public class SweepUtilities {
public
boolean
calculate
()
{
// if there are no vertices --> no calculations
if
(
null
==
verts
)
return
false
;
//if there is already an error vertex --> no calculations
if
(
!
canHeal
()
)
return
false
;
...
...
@@ -86,7 +94,7 @@ public class SweepUtilities {
if
(
!
bError
)
{
for
(
SweepVertex
v
:
verts
)
{
v
.
calculateNewPoint
(
targetPlane
,
epsPointDist
);
v
.
calculateNewPoint
(
targetPlane
,
pol
,
epsPointDist
);
}
}
...
...
@@ -112,7 +120,17 @@ public class SweepUtilities {
}
private
int
countSweepVertices
(
Polygon
p
)
{
int
nVerts
=
p
.
getExteriorRing
().
getVertices
().
size
();
for
(
LinearRing
lr
:
p
.
getInnerRings
())
{
nVerts
+=
lr
.
getVertices
().
size
();
}
return
nVerts
;
}
private
void
collectSweepVertices
(
Polygon
p
)
{
collectSweepVertices
(
p
.
getExteriorRing
());
for
(
LinearRing
lr
:
p
.
getInnerRings
())
{
collectSweepVertices
(
lr
);
...
...
@@ -120,6 +138,7 @@ public class SweepUtilities {
}
private
void
collectSweepVertices
(
LinearRing
ring
)
{
for
(
Vertex
v
:
ring
.
getVertices
())
{
verts
.
add
(
new
SweepVertex
(
v
));
}
...
...
CityDoctorParent/Extensions/CityDoctorHealer/src/main/java/de/hft/stuttgart/citydoctor2/healing/SweepVertex.java
View file @
11f09fca
package
de.hft.stuttgart.citydoctor2.healing
;
import
java.util.
Array
List
;
import
java.util.
Linked
List
;
import
java.util.List
;
import
de.hft.stuttgart.citydoctor2.datastructure.Vertex
;
import
de.hft.stuttgart.citydoctor2.datastructure.Edge
;
import
de.hft.stuttgart.citydoctor2.datastructure.Polygon
;
import
de.hft.stuttgart.citydoctor2.math.Plane
;
import
de.hft.stuttgart.citydoctor2.math.Vector3d
;
...
...
@@ -22,7 +23,7 @@ public class SweepVertex {
private
Vertex
vert
;
private
Vector3d
newPoint
;
private
List
<
Sweep
Edge
>
outgoingEdges
=
new
Array
List
<>();
private
List
<
Edge
>
outgoingEdges
=
new
Linked
List
<>();
public
SweepVertex
(
Vertex
v
)
{
...
...
@@ -59,7 +60,7 @@ public class SweepVertex {
}
public
void
calculateNewPoint
(
Plane
targetPlane
,
double
epsPointDist
)
{
public
void
calculateNewPoint
(
Plane
targetPlane
,
Polygon
p
,
double
epsPointDist
)
{
if
(
SweepVertexStatus
.
PROJECT
==
status
)
{
newPoint
=
targetPlane
.
projectPointToPlane
(
vert
);
...
...
@@ -69,6 +70,7 @@ public class SweepVertex {
status
=
SweepVertexStatus
.
ERROR
;
}
else
{
SweepEdge
e
=
new
SweepEdge
(
outgoingEdges
.
getFirst
(),
p
,
epsPointDist
);
//todo: Schnittpunkt der outgoing Edge mit der targePlane berechnen
//todo: dafuer Hilfsklasse SweepEdge fuer Parameterdarstellung usw. nutzen
//todo: Parameter des Schnittpunkts auf der Edge berechnen
...
...
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