You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: Docs/Sphinx/source/ImplemBVH.rst
+19
Original file line number
Diff line number
Diff line change
@@ -278,6 +278,12 @@ If the traversal decides to visit a node, it immediately computes the specified
278
278
Traversal examples
279
279
__________________
280
280
281
+
Below, we consider two examples for BVH traversal.
282
+
The examples show how we compute the signed distance from a DCEL mesh, and how to perform a *smooth* CSG union where the search for the two closest objects is done by BVH traversal.
283
+
284
+
Signed distance
285
+
^^^^^^^^^^^^^^^
286
+
281
287
The DCEL mesh distance fields use a traversal pattern based on
282
288
283
289
* Only visit bounding volumes that are closer than the minimum distance computed (so far).
@@ -291,3 +297,16 @@ These rules are given below.
291
297
:lines: 97-132
292
298
:caption: Tree traversal criterion for computing the signed distance to a DCEL mesh using the BVH accelerator.
293
299
See :file:`Source/EBGeometry_MeshDistanceFunctionsImplem.hpp` for details.
300
+
301
+
CSG Union
302
+
^^^^^^^^^
303
+
304
+
Combinations of implicit functions in ``EBGeometry`` into aggregate objects can be done by means of CSG unions.
305
+
One such union is known as the *smooth union*, in which the transition between two objects is gradual rather than abrupt.
306
+
Below, we show the traversal code for this union, where we traverse through the tree and obtains the distance to the *two* closest objects rather than a single one.
Copy file name to clipboardExpand all lines: Docs/Sphinx/source/Parsers.rst
+6-5
Original file line number
Diff line number
Diff line change
@@ -3,25 +3,26 @@
3
3
Reading data
4
4
============
5
5
6
-
Routines for parsing surface files from grids into ``EBGeometry``'s DCEL grids are given in the namespace ``EBGeometry::Parser``.
6
+
Routines for parsing surface grid from files into ``EBGeometry``'s DCEL grids are given in the namespace ``EBGeometry::Parser``.
7
7
The source code is implemented in :file:`Source/EBGeometry_Parser.hpp`.
8
8
9
9
.. warning::
10
10
11
11
``EBGeometry`` is currently limited to reading binary and ASCII STL files and reconstructing DCEL grids from those.
12
-
However, it is a simple matter to also reconstructor DCEL grids from triangle soups read using third-party codes (see :ref:`Chap:ThirdPartyParser`).
12
+
However, it is also possible to build DCEL grids from polygon soups read using third-party codes (see :ref:`Chap:ThirdPartyParser`).
13
13
14
14
Quickstart
15
15
----------
16
16
17
-
If you have one of multiple STL files, you can quickly turn them into implicit functions with
17
+
If you have one or multiple STL files, you can quickly turn them into signed distance fields using
18
18
19
19
.. code-block:: c++
20
20
21
21
std::vector<std::string> files; // <---- List of file names.
22
22
23
23
const auto distanceFields = EBGeometry::Parser::readIntoLinearBVH<float>(files);
24
24
25
+
This will build DCEL meshes for each input file, and wrap the meshes in BVHs.
25
26
See :ref:`Chap:LinearSTL` for further details.
26
27
27
28
Reading STL files
@@ -79,7 +80,7 @@ To read one or multiple STL files and turn it into signed distance representatio
79
80
From soups to DCEL
80
81
------------------
81
82
82
-
``EBGeometry`` also supports the creation of DCEL grids from polygon soups, which can then be later turned into an SDF representation.
83
+
``EBGeometry`` also supports the creation of DCEL grids from polygon soups, which can then later be turned into an SDF representation.
83
84
A triangle soup is represented as
84
85
85
86
.. code-block:: c++
@@ -95,7 +96,7 @@ To turn this into a DCEL mesh, one should compress the triangle soup (get rid of
95
96
:language: c++
96
97
:lines: 146-165
97
98
98
-
The ``compress`` function will discard duplicate vertices from the soup, while the ``soupToDCEL`` will simply turn the remaining polygon soup into a DCEL mesh.
99
+
The ``compress`` function will discard duplicate vertices from the soup, while the ``soupToDCEL`` will tie the remaining polygons into a DCEL mesh.
99
100
This function will also compute the vertex and edge normal vectors.
0 commit comments