Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Complex shapes docs #587

Merged
merged 154 commits into from
Aug 12, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
154 commits
Select commit Hold shift + click to select a range
0edce50
winding number proof of concept 2D
LasNikas Jul 20, 2023
957dd25
faces and edges with `NTuples`
LasNikas Jul 22, 2023
3bf316f
change directory
LasNikas Jul 24, 2023
95a9d18
Merge branch 'main' into proof-of-concept
LasNikas Jul 28, 2023
bce8a50
Merge branch 'main' into proof-of-concept
LasNikas Sep 4, 2023
6628593
remove `@unpack`
LasNikas Sep 4, 2023
3de16ba
Merge branch 'main' into proof-of-concept
LasNikas Oct 30, 2023
5da9f29
modify
LasNikas Oct 30, 2023
fa37e22
Merge branch 'main' into proof-of-concept
LasNikas Jan 22, 2024
0461645
return `InitialCondition`
LasNikas Jan 22, 2024
ceac8d9
add examples
LasNikas Jan 23, 2024
e459754
first working API
LasNikas Jan 24, 2024
195aa65
add complex tank example
LasNikas Jan 24, 2024
ee83165
fix typos
LasNikas Jan 24, 2024
49a98b6
thread parallel
LasNikas Jan 25, 2024
53ba366
optional winding number range
LasNikas Jan 25, 2024
ad78833
Merge branch 'main' into readin-complex-shapes
LasNikas Jan 25, 2024
0755c31
Merge branch 'main' into readin-complex-shapes
LasNikas Jan 29, 2024
38902d9
add `UpdateCallback`
LasNikas Feb 22, 2024
cc3477c
fix typo
LasNikas Feb 22, 2024
daa7a0e
Merge branch 'main' into readin-complex-shapes
LasNikas Mar 5, 2024
77b120b
Merge branch 'main' into update-callback
LasNikas Mar 5, 2024
983080a
Merge branch 'main' into update-callback
LasNikas Mar 5, 2024
c6c0b11
apply formatter
LasNikas Mar 5, 2024
e3d72a9
Merge branch 'main' into update-callback
LasNikas Mar 16, 2024
f1a7758
Merge branch 'main' into update-callback
LasNikas Apr 2, 2024
b73b5a4
Merge branch 'main' into update-callback
LasNikas Apr 5, 2024
f4611a3
Merge branch 'main' into readin-complex-shapes
LasNikas Apr 11, 2024
f8ded26
simplify triangle mesh
LasNikas Apr 12, 2024
942772c
Merge branch 'update-callback' into readin-complex-shapes
LasNikas Apr 15, 2024
d4dfa0a
rework data types
LasNikas Apr 15, 2024
38c4138
Merge branch 'main' into readin-complex-shapes
LasNikas Apr 26, 2024
27338d5
restructure
LasNikas Apr 26, 2024
044bf16
SVector min-max-box
LasNikas Apr 26, 2024
56fe3fb
make `TriangleMesh` faster
LasNikas Apr 29, 2024
37134f7
fix vertex normal
LasNikas Apr 29, 2024
b301367
add IO
LasNikas May 15, 2024
58b17a6
Merge branch 'main' into readin-complex-shapes
LasNikas May 15, 2024
12d4257
add hierarchical winding
LasNikas May 15, 2024
8b1f8e1
store winding number
LasNikas May 22, 2024
fd0bc67
Merge branch 'main' into readin-complex-shapes
LasNikas May 24, 2024
a8fa94c
clean up TriangleMesh
LasNikas May 26, 2024
ba404e6
Merge branch 'main' into readin-complex-shapes
LasNikas Jun 17, 2024
36817d0
modify shapes
LasNikas Jun 17, 2024
8aaac64
change ELTYPE in IO
LasNikas Jun 17, 2024
2e359a3
Merge branch 'main' into readin-complex-shapes
LasNikas Jun 18, 2024
00a1f5d
add files and remove `scale_factor`
LasNikas Jun 18, 2024
f27370c
add shape and `complexShape` tests
LasNikas Jun 18, 2024
29492bd
remove complex tank example
LasNikas Jun 19, 2024
6e9f4f3
add docs for `complexShapes`
LasNikas Jun 19, 2024
044ba29
Merge branch 'main' into readin-complex-shapes
LasNikas Jun 19, 2024
71bd58c
add docs for the algorithms
LasNikas Jun 19, 2024
8879a76
Merge branch 'main' into readin-complex-shapes
LasNikas Jun 19, 2024
b61302b
add test data
LasNikas Jun 20, 2024
4db3a15
Merge branch 'main' into readin-complex-shapes
LasNikas Jun 20, 2024
2d26204
add tests for sampled shapes
LasNikas Jun 20, 2024
a82bc45
data path relative to module
LasNikas Jun 21, 2024
40e6ea9
Merge branch 'main' into readin-complex-shapes
LasNikas Jun 21, 2024
bea77a2
use `Threads.@threads` instead of `threaded`
LasNikas Jun 21, 2024
d2237de
fix @threaded
LasNikas Jun 21, 2024
53d95e5
fix tests
LasNikas Jun 21, 2024
abb74fa
fix wrong directory
LasNikas Jun 21, 2024
e30625f
use `@threaded` again
LasNikas Jun 21, 2024
c8fb3a8
change winding number factor for julia 1.9
LasNikas Jun 21, 2024
9c4f42c
fix tests
LasNikas Jun 21, 2024
c44a297
add stl files
LasNikas Jun 28, 2024
f78ab21
Merge branch 'main' into readin-complex-shapes
LasNikas Jun 28, 2024
0d6e8be
Merge branch 'main' into readin-complex-shapes
LasNikas Jun 30, 2024
3176287
Merge branch 'main' into readin-complex-shapes
LasNikas Jul 11, 2024
60f62d3
implement suggestions
LasNikas Jul 11, 2024
9958734
Merge branch 'main' into readin-complex-shapes
LasNikas Jul 11, 2024
5ea6fcf
Merge branch 'main' into readin-complex-shapes
LasNikas Jul 15, 2024
e5604e5
rename kwargs
LasNikas Jul 15, 2024
d90ad55
add comments
LasNikas Jul 15, 2024
6ac6301
apply formatter
LasNikas Jul 15, 2024
68fa382
implement suggestion
LasNikas Jul 15, 2024
8cf5dc0
fix tests
LasNikas Jul 15, 2024
0ae45b4
Merge branch 'main' into readin-complex-shapes
LasNikas Jul 15, 2024
dda2202
remove abstract type `Shapes`
LasNikas Jul 16, 2024
e8cba1e
fix tests
LasNikas Jul 16, 2024
46e4647
make type stable
LasNikas Jul 16, 2024
eeec66a
implement suggestions
LasNikas Jul 16, 2024
44ce444
add `unique_soted`
LasNikas Jul 17, 2024
a97b210
add comment
LasNikas Jul 17, 2024
09c6462
implement suggestions
LasNikas Jul 18, 2024
6d61e91
RADME and NEWS entry
LasNikas Jul 18, 2024
24af5f8
adapt docs
LasNikas Jul 18, 2024
2c767de
`for` instead of `while`
LasNikas Jul 19, 2024
73485b9
Merge branch 'main' into readin-complex-shapes
LasNikas Jul 23, 2024
f8c9e20
Merge branch 'main' into readin-complex-shapes
LasNikas Jul 23, 2024
86f65c5
rename `shape` to `geometry`
LasNikas Jul 23, 2024
41ebe70
rename again
LasNikas Jul 23, 2024
608a699
implement suggestions
LasNikas Jul 23, 2024
22438e7
Merge branch 'main' into readin-complex-shapes
LasNikas Jul 23, 2024
13e9f26
fix typo
LasNikas Jul 23, 2024
7c1db9b
implement suggestions
LasNikas Jul 24, 2024
7784bbc
Merge branch 'main' into readin-complex-shapes
LasNikas Jul 24, 2024
36076f9
adapt example files
LasNikas Jul 24, 2024
f97e9d9
sum-init with `zero(eltype))`
LasNikas Jul 24, 2024
dd6fd9b
Merge branch 'main' into readin-complex-shapes
LasNikas Jul 24, 2024
b6d7bb0
Merge branch 'main' into readin-complex-shapes
LasNikas Jul 25, 2024
50b8592
implement suggestions
LasNikas Jul 27, 2024
71eb74e
construct hierarchy in constructor
LasNikas Jul 27, 2024
93b8444
use ASCII characters
LasNikas Jul 27, 2024
0809869
minor changes
LasNikas Jul 29, 2024
a936ef9
add 2d hierarchical winding
LasNikas Jul 29, 2024
8a334ac
minor changes
LasNikas Jul 29, 2024
2a4b91c
change function name
LasNikas Jul 29, 2024
ed6e043
fix
LasNikas Jul 29, 2024
9ebce06
Merge branch 'hierarchical-winding-2d' into readin-complex-shapes
LasNikas Jul 29, 2024
5390b26
implement suggestions
LasNikas Jul 29, 2024
031bbb7
fix typo
LasNikas Jul 29, 2024
bd34134
apply formatter
LasNikas Jul 29, 2024
20b724f
fix typo
LasNikas Jul 29, 2024
bee9a26
add `deleteat!`
LasNikas Jul 30, 2024
0c6f974
circle example eps() -> 0
LasNikas Jul 31, 2024
4b76fbc
start docs
LasNikas Jul 31, 2024
c7d82d0
first doc version
LasNikas Jul 31, 2024
bdce356
add docs
LasNikas Aug 1, 2024
b8c9ba0
Merge branch 'main' into readin-complex-shapes
LasNikas Aug 1, 2024
2ee255a
Merge branch 'main' into complex-shapes-docs
LasNikas Aug 1, 2024
826f036
simplify
LasNikas Aug 1, 2024
19b2c6c
implement suggestions
LasNikas Aug 1, 2024
ac029ef
fix docs
LasNikas Aug 1, 2024
6cab982
fix tests
LasNikas Aug 1, 2024
32b392b
fix tests
LasNikas Aug 1, 2024
a142f10
minor changes
LasNikas Aug 1, 2024
dff23e2
typo
LasNikas Aug 1, 2024
e130849
fix
LasNikas Aug 1, 2024
206a9d6
fix again
LasNikas Aug 1, 2024
a581b32
fx
LasNikas Aug 1, 2024
9d198a9
typo
LasNikas Aug 1, 2024
2789b21
fix tests
LasNikas Aug 2, 2024
7a87141
fix again
LasNikas Aug 2, 2024
eb4edbd
implement suggestions
LasNikas Aug 2, 2024
80aff81
modify NEWS.md
LasNikas Aug 2, 2024
3818263
Merge branch 'readin-complex-shapes' into complex-shapes-docs
LasNikas Aug 2, 2024
2d34d3a
modify again
LasNikas Aug 2, 2024
263ec98
Merge branch 'readin-complex-shapes' into complex-shapes-docs
LasNikas Aug 5, 2024
3ebddfe
implement suggestions
LasNikas Aug 5, 2024
be404fa
add sentence to docs
LasNikas Aug 5, 2024
4ccf4c6
typo
LasNikas Aug 6, 2024
6cae23f
Merge branch 'readin-complex-shapes' into complex-shapes-docs
LasNikas Aug 6, 2024
d5a7ad0
Merge branch 'main' into complex-shapes-docs
LasNikas Aug 6, 2024
febfcc3
Merge branch 'main' into complex-shapes-docs
LasNikas Aug 6, 2024
c4de604
Merge branch 'main' into complex-shapes-docs
LasNikas Aug 7, 2024
4fcf74d
Merge branch 'main' into complex-shapes-docs
LasNikas Aug 7, 2024
63418cf
minor changes
LasNikas Aug 7, 2024
47eab7e
implement suggestions
LasNikas Aug 8, 2024
c56e388
fix stupid replacing typo
LasNikas Aug 9, 2024
eb07671
implement suggestions
LasNikas Aug 9, 2024
5e0d052
modify sentence
LasNikas Aug 12, 2024
b85cbb7
update
LasNikas Aug 12, 2024
0903c62
Merge branch 'main' into complex-shapes-docs
LasNikas Aug 12, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions docs/make.jl
Original file line number Diff line number Diff line change
Expand Up @@ -104,8 +104,8 @@ makedocs(sitename="TrixiParticles.jl",
"Tutorial" => "tutorial.md",
"Examples" => "examples.md",
"Visualization" => "visualization.md",
"preprocessing" => [
"Sample Geometries" => joinpath("preprocessing", "preprocessing.md"),
"Preprocessing" => [
"Sampling of Geometries" => joinpath("preprocessing", "preprocessing.md"),
],
"Components" => [
"Overview" => "overview.md",
Expand Down
242 changes: 240 additions & 2 deletions docs/src/preprocessing/preprocessing.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,245 @@
# Sampling of Geometries

TODO
Generating the initial configuration of a simulation requires filling volumes (3D) or surfaces (2D) of complex geometries with particles.
The algorithm to sample a complex geometry should be robust and fast,
since for large problems (large numbers of particles) or complex geometries (many geometry faces),
generating the initial configuration is not trivial and can be very expensive in terms of computational cost.
We therefore use a [winding number](https://en.wikipedia.org/wiki/Winding_number) approach for an inside-outside segmentation of an object.
The winding number ``w(\mathbf{p})`` is a signed integer-valued function of a point ``\mathbf{p}`` and is defined as

```math
w(\mathbf{p}) = \frac{1}{2 \pi} \sum^n_{i=1} \Theta_i.
```

Here, ``\Theta_i`` is the *signed* angle between ``\mathbf{c}_i - \mathbf{p}`` and ``\mathbf{c}_{i+1} - \mathbf{p}`` where ``\mathbf{c}_i`` and ``\mathbf{c}_{i+1}`` are two consecutive vertices on a curve.
In 3D, we refer to the solid angle of an *oriented* triangle with respect to ``\mathbf{p}``.

We provide the following methods to calculate ``w(\mathbf{p})``:
- Horman et al. (2001) evaluate the winding number combined with an even-odd rule, but only for 2D polygons (see [WindingNumberHorman](@ref)).
- Naive winding: Jacobson et al. (2013) generalized the winding number so that the algorithm can be applied for both 2D and 3D geometries (see [WindingNumberJacobson](@ref)).
- Hierarchical winding: Jacobson et al. (2013) also introduced a fast hierarchical evaluation of the winding number. For further information see the description below.

## [Hierarchical Winding](@id hierarchical_winding)
LasNikas marked this conversation as resolved.
Show resolved Hide resolved
According to Jacobson et al. (2013) the winding number with respect to a polygon (2D) or triangle mesh (3D) is the sum of the winding numbers with respect to each edge (2D) or face (3D).
We can show this with the following example in which we determine the winding number for each edge of a triangle separately and sum them up:

```julia
using TrixiParticles
using Plots

triangle = [125.0 375.0 250.0 125.0;
175.0 175.0 350.0 175.0]

# Delete all edges but one
edge1 = deleteat!(TrixiParticles.Polygon(triangle), [2, 3])
LasNikas marked this conversation as resolved.
Show resolved Hide resolved
edge2 = deleteat!(TrixiParticles.Polygon(triangle), [1, 3])
edge3 = deleteat!(TrixiParticles.Polygon(triangle), [1, 2])

algorithm = WindingNumberJacobson()

grid = hcat(([x, y] for x in 1:500, y in 1:500)...)

_, w1 = algorithm(edge1, grid; store_winding_number=true)
_, w2 = algorithm(edge2, grid; store_winding_number=true)
_, w3 = algorithm(edge3, grid; store_winding_number=true)

w = w1 + w2 + w3

heatmap(1:500, 1:500, reshape(w1, 500, 500)', color=:coolwarm, showaxis=false,
tickfontsize=12, size=(570, 500), margin=6 * Plots.mm)
heatmap(1:500, 1:500, reshape(w2, 500, 500)', color=:coolwarm, showaxis=false,
tickfontsize=12, size=(570, 500), margin=6 * Plots.mm)
heatmap(1:500, 1:500, reshape(w3, 500, 500)', color=:coolwarm, showaxis=false,
tickfontsize=12, size=(570, 500), margin=6 * Plots.mm)
heatmap(1:500, 1:500, reshape(w, 500, 500)', color=:coolwarm, showaxis=false,
tickfontsize=12, size=(570, 500), margin=6 * Plots.mm, clims=(-1, 1))

```

```@raw html
<figure>
<img src="https://github.com/user-attachments/assets/bf491b2d-740e-4136-8a7b-e321f26f86fd" alt="triangle"/>
</figure>
```

This summation property has some interesting consequences that we can utilize for an efficient computation of the winding number.
Let ``\mathcal{S}`` be an open surface and ``\bar{\mathcal{S}}`` an arbitrary closing surface, such that

```math
\partial \bar{\mathcal{S}} = \partial \mathcal{S}
```

and ``\mathcal{B} = \bar{\mathcal{S}} \cup \mathcal{S}`` is some closed oriented surface.
For any query point ``\mathbf{p}`` outside of ``\mathcal{B}``, we know that

```math
w_{\mathcal{S}}(\mathbf{p}) + w_{\bar{\mathcal{S}}}(\mathbf{p}) = w_{\mathcal{B}}(\mathbf{p}) = 0.
```

This means

```math
w_{\mathcal{S}}(\mathbf{p}) = - w_{\bar{\mathcal{S}}}(\mathbf{p}),
```

regardless of how ``\bar{\mathcal{S}}`` is constructed (as long as ``\mathbf{p}`` is outside of ``\mathcal{B}``).

We can use this property in the discrete case to efficiently compute the winding number of a query point
by partitioning the polygon or mesh in a "small" part (as in consisting of a small number of edges/faces) and a "large" part.
For the small part we just compute the winding number, and for the large part we construct a small closing and compute its winding number.
The partitioning is based on a hierarchical construction of bounding boxes.

### Bounding volume hierarchy

To efficiently find a "small part" and a "large part" as mentioned above, we construct a hierarchy of bounding boxes by starting with the whole domain and recursively splitting it in two equally sized boxes.
The resulting hierarchy is a binary tree.

The algorithm by Jacobsen et al. (Algorithm 2, p. 5) traverses this binary tree recursively until we find the leaf in which the query point is located.
The recursion stops with the following criteria:

- if the bounding box ``T`` is a leaf then ``T.\mathcal{S} = \mathcal{S} \cap T``, the part of ``\mathcal{S}``
that lies inside ``T``, is the "small part" mentioned above, so evaluate the winding number naively as ``w(\mathbf{p}, T.\mathcal{S})``.
- else if ``\mathbf{p}`` is outside ``T`` then ``T.\mathcal{S}`` is the "large part", so evaluate the winding number naively
as ``-w(\mathbf{p}, T.\bar{\mathcal{S}})``, where ``T.\bar{\mathcal{S}}`` is the closing surface of ``T.\mathcal{S}``.

#### Continuous example

Now consider the following continuous (not discretized to a polygon) 2D example.
We compute the winding number of the point ``\mathbf{p}`` with respect to ``\mathcal{S}`` using the depicted hierarchy of bounding boxes.

```@raw html
<figure>
<img src="https://github.com/user-attachments/assets/0ca2f475-6dd5-43f9-8b0c-87a0612ecdf4" alt="continuous closing"/>
</figure>
```

(1):
- Recurse left: ``w_{\text{left}} = \text{\texttt{hierarchical\_winding}} (\mathbf{p}, T.\text{left})``
- Recurse right: ``w_{\text{right}} = \text{\texttt{hierarchical\_winding}} (\mathbf{p},T.\text{right})``

(2):
- Query point ``\mathbf{p}`` is outside bounding box ``T``, so don't recurse deeper.
- Compute ``w_{\mathcal{S}}(\mathbf{p}) = - w_{\bar{\mathcal{S}}}(\mathbf{p})`` with the closure ``T.\bar{\mathcal{S}}``, which is generally much smaller (fewer edges in the discrete version) than ``T.\mathcal{S}``:

```math
w_{\text{left}} = -\text{\texttt{naive\_winding}} (\mathbf{p}, T.\bar{\mathcal{S}})
```

(3):
- Bounding box ``T`` is a leaf. Use open surface ``T.\mathcal{S}``:

```math
w_{\text{right}} = \text{\texttt{naive\_winding}} (\mathbf{p}, T.\mathcal{S})
```

The reconstructed surface will then look as in the following image.

```@raw html
<figure>
<img src="https://github.com/user-attachments/assets/920bb4f1-1336-4e77-b06d-d5b46ca0d8d5" alt="reconstructed surface"/>
</figure>
```

We finally sum up the winding numbers

```math
w = w_{\text{left}} + w_{\text{right} } = -w_{T_{\text{left}}.\bar{\mathcal{S}}} + w_{T_{\text{right}}.\mathcal{S}}
```

#### Discrete example

We will now go through the discrete version of the example above.

```@raw html
<figure>
<img src="https://github.com/user-attachments/assets/a9b59cc3-5421-40af-b0b0-f4c18a5a7078" alt="discrete geometry"/>
</figure>
```

To construct the hierarchy for the discrete piecewise-linear example in (1), we have to do the following.

(2):
Each edge is distributed to the child whose box contains the edge's barycenter (red dots in (2)).
Splitting stops when the number of a box's edges slips below a
threshold (usually ``\approx 100`` faces in 3D, here: 6 edges).

(3):
For the closure, Jacobson et al. (2013) define *exterior vertices* (*exterior edges* in 3D)
as boundary vertices of such a segmentation (red dots in (3)).
To find them, we traverse around each edge (face in 3D) in order, and
increment or decrement for each vertex (edge) a specific counter.

```julia
v1 = edge_vertices_ids[edge][1]
v2 = edge_vertices_ids[edge][2]

vertex_count[v1] += 1
vertex_count[v2] -= 1
```

In 2D, a vertex is declared as exterior if `vertex_count(vertex) != 0`, so there is not the same amount of edges in this box going into versus out of the vertex.
To construct the closing surface, the exterior vertices are then connected to one arbitrary
exterior vertex using appropriately oriented line segments:

```julia
edge = vertex_count[v] > 0 ? (closing_vertex, v) : (v, closing_vertex)
```

The resulting closed surface ``T.S \cup T.\bar{S}`` then has the same number of edges going into and out of each vertex.

#### Incorrect evaluation

If we follow the algorithm, we know that recursion stops if

- the bounding box ``T`` is a leaf or
- the query point ``\mathbf{p}`` is outside the box.

```@raw html
<figure>
<img src="https://github.com/user-attachments/assets/7bae164a-8d5b-4761-9d54-9abf99fca94a" alt="incorrect evaluation"/>
</figure>
```
LasNikas marked this conversation as resolved.
Show resolved Hide resolved

(1): The query point ``\mathbf{p}`` is outside the box, so we calculate the winding number with the (red) closure of the box.

(2): The query point ``\mathbf{p}`` is inside the box, so we use the (blue) edges distributed to the box.

(3): In this case, it leads to an incorrect evaluation of the winding number.
The query point is clearly inside the box, but not inside the reconstructed surface.
This is because the property ``w_{\mathcal{S}}(\mathbf{p}) = - w_{\bar{\mathcal{S}}}(\mathbf{p})``
only holds when ``\mathbf{p}`` is outside of ``\mathcal{B}``, which is not the case here.

#### Correct evaluation
Jacobson et al. (2013) don't mention this problem or provide a solution to it.
We contacted the authors and found that they know about this problem and solve it
by resizing the bounding box to fully include the closing surface
of the neighboring box, since it doesn't matter if the boxes overlap.

```@raw html
<figure>
<img src="https://github.com/user-attachments/assets/097f01f4-1f37-48e4-968a-4c0970548b24" alt="correct evaluation resizing"/>
</figure>
```

To avoid resizing, we take a different approach and calculate the closure of the bounding box differently:
- Exclude intersecting edges in the calculation of the exterior vertices.
- This way, all exterior vertices are inside the bounding box, and so will be the closing surface.
- The intersecting edges are later added with flipped orientation,
so that the closing is actually a closing of the exterior plus intersecting edges.

```@raw html
<figure>
<img src="https://github.com/user-attachments/assets/a8ff9a7e-e6d6-44d1-9a29-7debddf2803d" alt="correct evaluation intersecting" width=60%/>
</figure>
```

The evaluation then looks as follows.

```@raw html
<figure>
<img src="https://github.com/user-attachments/assets/9bb2d2ad-14e8-4bd0-a9bd-3c824932affd" alt="correct evaluation intersecting 2"/>
</figure>
```

```@autodocs
Modules = [TrixiParticles]
Expand All @@ -17,7 +256,6 @@ Modules = [TrixiParticles]
Pages = [joinpath("preprocessing", "geometries", "io.jl")]
```


### [References](@id references_complex_shape)
- Alec Jacobson, Ladislav Kavan, and Olga Sorkine-Hornung "Robust inside-outside segmentation using generalized winding numbers".
In: ACM Transactions on Graphics, 32.4 (2013), pages 1--12.
Expand Down
2 changes: 0 additions & 2 deletions src/preprocessing/point_in_poly/winding_number_horman.jl
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,6 @@
Algorithm for inside-outside segmentation of a complex geometry proposed by [Horman et al. (2001)](@ref references_complex_shape).
It is only supported for 2D geometries.
[`WindingNumberHorman`](@ref) might handle edge cases a bit better, since the winding number is an integer value.
Also, it is faster than [`WindingNumberJacobson`](@ref) for 2D geometries with more than about 100 edges.


!!! warning "Experimental Implementation"
This is an experimental feature and may change in any future releases.
Expand Down
2 changes: 1 addition & 1 deletion src/preprocessing/point_in_poly/winding_number_jacobson.jl
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ Algorithm for inside-outside segmentation of a complex geometry proposed by Jaco
- `geometry`: Complex geometry returned by [`load_geometry`](@ref) and is only required when using
`hierarchical_winding=true`.
- `hierarchical_winding`: If set to `true`, an optimized hierarchical approach will be used,
which gives a significant speedup.
which gives a significant speedup. For further information see [Hierarchical Winding](@ref hierarchical_winding).
- `winding_number_factor`: For leaky geometries, a factor of `0.4` will give a better inside-outside segmentation.

!!! warning "Experimental Implementation"
Expand Down
Loading