... | ... | @@ -223,7 +223,7 @@ mesh.getFace(mesh.getTwin(mesh.getEdge(mesh.getFace()))); |
|
|
First we get access to some (arbitrary) face f of the mesh.
|
|
|
Via the second call we access some (arbitrary) edge e of the face f.
|
|
|
Then we get the twin half-edge et of this edge. And finally we access the face ft of the twin half-edge et.
|
|
|
Therefore, we access a neighboring face of $f$.
|
|
|
Therefore, we access a neighboring face of f.
|
|
|
|
|
|
#### Iterators and streams
|
|
|
To simplify certain access pattern such as accessing all edges of a specific face the library offers different ``Iterator``s and ``Stream``s to go over
|
... | ... | @@ -581,6 +581,39 @@ Mesh before (left) and after (right) of the smoothing stage. |
|
|
|
|
|
![randomDelaunay](uploads/a10ceae64a53cbeb316e69e5eb487073/randomDelaunay.png)
|
|
|
|
|
|
### Example 6 (Urban environment)
|
|
|
|
|
|
In the last example we mesh an urban environment (600m x 250m) which is in fact a geometry used in Vadere.
|
|
|
|
|
|
```java
|
|
|
// (1) read the PSLG from a file / an input stream
|
|
|
final InputStream inputStream = MeshExamples.class.getResourceAsStream("/poly/kaiserslautern.poly");
|
|
|
PSLG pslg = PolyGenerator.toPSLGtoVShapes(inputStream);
|
|
|
|
|
|
// (2) construct a distance function d out of the PSLG
|
|
|
Collection<VPolygon> holes = pslg.getHoles();
|
|
|
VPolygon segmentBound = pslg.getSegmentBound();
|
|
|
IDistanceFunction d = IDistanceFunction.create(segmentBound, holes);
|
|
|
|
|
|
// (3) use EikMesh to construct the mesh
|
|
|
IPointConstructor<EikMeshPoint> pointConstructor = (x, y) -> new EikMeshPoint(x, y);
|
|
|
double h0 = 5.0;
|
|
|
var meshImprover = new PEikMeshGen<EikMeshPoint, Double, Double>(
|
|
|
d,
|
|
|
p -> h0 + 0.3 * Math.abs(d.apply(p)),
|
|
|
h0,
|
|
|
new VRectangle(segmentBound.getBounds2D()),
|
|
|
pslg.getHoles(),
|
|
|
pointConstructor
|
|
|
);
|
|
|
meshImprover.generate();
|
|
|
````
|
|
|
****Remark****: Since the distance function d is complicated the mesh generation is quite slow because d has to be evaluated for each iteration of the smoothing process for almost any mesh element. To reduce the complexity of the evaluation one can construct a background mesh using, for example, Ruppert's algorithm and approximate d via the interpolation on the background mesh.
|
|
|
|
|
|
### Result:
|
|
|
|
|
|
![kaiserslautern](uploads/af46213c0e9e02f254c740e71e0709d8/kaiserslautern.png)
|
|
|
|
|
|
## Videos
|
|
|
|
|
|
To get a good understanding of how EikMesh works, we constructed some videos of the meshing process which can be found at [vadere.org](http://www.vadere.org/the-eikmesh-library/). |
|
|
\ No newline at end of file |