Skip to content

Commit 9a93bec

Browse files
authored
Update documentation (#69)
1 parent 5e7340f commit 9a93bec

File tree

3 files changed

+26
-6
lines changed

3 files changed

+26
-6
lines changed

Docs/Sphinx/source/ImplemBVH.rst

+19
Original file line numberDiff line numberDiff line change
@@ -278,6 +278,12 @@ If the traversal decides to visit a node, it immediately computes the specified
278278
Traversal examples
279279
__________________
280280

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+
281287
The DCEL mesh distance fields use a traversal pattern based on
282288

283289
* Only visit bounding volumes that are closer than the minimum distance computed (so far).
@@ -291,3 +297,16 @@ These rules are given below.
291297
:lines: 97-132
292298
:caption: Tree traversal criterion for computing the signed distance to a DCEL mesh using the BVH accelerator.
293299
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.
307+
308+
.. literalinclude:: ../../../Source/EBGeometry_CSGImplem.hpp
309+
:language: c++
310+
:lines: 369-415
311+
:caption: Tree traversal when computing the smooth CSG union.
312+
See :file:`Source/EBGeometry_CSGImplem.hpp` for details.

Docs/Sphinx/source/Parsers.rst

+6-5
Original file line numberDiff line numberDiff line change
@@ -3,25 +3,26 @@
33
Reading data
44
============
55

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``.
77
The source code is implemented in :file:`Source/EBGeometry_Parser.hpp`.
88

99
.. warning::
1010

1111
``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`).
1313

1414
Quickstart
1515
----------
1616

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
1818

1919
.. code-block:: c++
2020

2121
std::vector<std::string> files; // <---- List of file names.
2222

2323
const auto distanceFields = EBGeometry::Parser::readIntoLinearBVH<float>(files);
2424

25+
This will build DCEL meshes for each input file, and wrap the meshes in BVHs.
2526
See :ref:`Chap:LinearSTL` for further details.
2627

2728
Reading STL files
@@ -79,7 +80,7 @@ To read one or multiple STL files and turn it into signed distance representatio
7980
From soups to DCEL
8081
------------------
8182

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.
8384
A triangle soup is represented as
8485

8586
.. code-block:: c++
@@ -95,7 +96,7 @@ To turn this into a DCEL mesh, one should compress the triangle soup (get rid of
9596
:language: c++
9697
:lines: 146-165
9798

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.
99100
This function will also compute the vertex and edge normal vectors.
100101

101102
.. warning::

Source/EBGeometry_Parser.hpp

+1-1
Original file line numberDiff line numberDiff line change
@@ -154,7 +154,7 @@ namespace Parser {
154154

155155
/*!
156156
@brief Turn raw vertices into DCEL vertices.
157-
@param[out] a_verticesDCEL DCEL vertices
157+
@param[out] a_mesh Output DCEL mesh.
158158
@param[in] a_verticesRaw Raw vertices
159159
@param[in] a_facets Facets
160160
*/

0 commit comments

Comments
 (0)