From bf92ed257e0a8888c4fee4874129b9bae8d51136 Mon Sep 17 00:00:00 2001 From: Robert Marskar Date: Thu, 3 Mar 2022 09:18:33 +0100 Subject: [PATCH 1/6] Update docs --- README.md | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index d8cd92f0..0151b773 100644 --- a/README.md +++ b/README.md @@ -1,7 +1,18 @@ EBGeometry ---------- -Support for signed-distance functions of tesselated surfaces. Used with embedded-boundary (EB) codes. +Support for signed-distance functions of tesselated surfaces. Used with embedded-boundary (EB) codes. + +Usage +----- + +The library is header-only, simple make EBGeometry.hpp visible to your code and include it. + +Features +-------- + +EBGeometry is a compact code for creating signed distance functions from watertight 3D surface tesselations. +The surface mesh is stored in a doubly-connected edge list (DCEL), i.e. a half-edge data structure. License ------- From c1f66cbc579088424b65cf35a47a4a1972c3b708 Mon Sep 17 00:00:00 2001 From: Robert Marskar Date: Thu, 3 Mar 2022 09:20:36 +0100 Subject: [PATCH 2/6] More docs --- README.md | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index 0151b773..1b433e1e 100644 --- a/README.md +++ b/README.md @@ -12,7 +12,9 @@ Features -------- EBGeometry is a compact code for creating signed distance functions from watertight 3D surface tesselations. -The surface mesh is stored in a doubly-connected edge list (DCEL), i.e. a half-edge data structure. +The surface mesh is stored in a doubly-connected edge list (DCEL), i.e. a half-edge data structure. +Since the distance to any feature (facet, edge, vertex) in a surface mesh is well defined, the distance to the mesh can be computed from any point in space. +For computing the *signed License ------- From 6522c64bbb43b0a3c943fc217fdf27c0f6d42a03 Mon Sep 17 00:00:00 2001 From: Robert Marskar Date: Thu, 3 Mar 2022 09:27:13 +0100 Subject: [PATCH 3/6] More --- README.md | 25 ++++++++++++++++++------- 1 file changed, 18 insertions(+), 7 deletions(-) diff --git a/README.md b/README.md index 1b433e1e..68813565 100644 --- a/README.md +++ b/README.md @@ -3,18 +3,29 @@ EBGeometry Support for signed-distance functions of tesselated surfaces. Used with embedded-boundary (EB) codes. +EBGeometry is a compact code for creating signed distance functions from watertight 3D surface tesselations. +The surface mesh is stored in a doubly-connected edge list (DCEL), i.e. a half-edge data structure. +Since the distance to any feature (facet, edge, vertex) in a surface mesh is well defined, the distance to the mesh can be computed from any point in space. +Naively, this can be done by computing the shortest distance to every facet/edge/vertex in the surface mesh. +For computing the signed distance one needs to define a suitable normal vector for edges and vertices. + +EBGeometry provides bounding volume hierarchies (BVHs) for bounding geometric primitives in space. +The BVHs are tree structures which permit accelerated closest-point searches. +We point out that the BVHs in EBGeometry are shallow implementations without deep performance optimizations. +In the DCEL context the BVHs are used for bounding the facets on the surface mesh. +Querying the distance to the mesh through the BVH is much faster than directly computing the distance. +On average, if the mesh consists of N facets then a BVH has O(log(N)) complexity while a direct search has O(N) complexity. + +Requirements +------------ + +C++14 + Usage ----- The library is header-only, simple make EBGeometry.hpp visible to your code and include it. -Features --------- - -EBGeometry is a compact code for creating signed distance functions from watertight 3D surface tesselations. -The surface mesh is stored in a doubly-connected edge list (DCEL), i.e. a half-edge data structure. -Since the distance to any feature (facet, edge, vertex) in a surface mesh is well defined, the distance to the mesh can be computed from any point in space. -For computing the *signed License ------- From 29045bd6893602e1f31dfbaf956d9b0edc2dbef9 Mon Sep 17 00:00:00 2001 From: Robert Marskar Date: Thu, 3 Mar 2022 09:30:32 +0100 Subject: [PATCH 4/6] Shut up warnings --- Examples/Sphere/example.cpp | 1 - README.md | 1 + Source/EBGeometry_DcelFaceImplem.hpp | 2 +- Source/EBGeometry_DcelParserImplem.hpp | 2 +- 4 files changed, 3 insertions(+), 3 deletions(-) diff --git a/Examples/Sphere/example.cpp b/Examples/Sphere/example.cpp index e8265751..7b4608b2 100644 --- a/Examples/Sphere/example.cpp +++ b/Examples/Sphere/example.cpp @@ -19,7 +19,6 @@ int main() { // Aliases for cutting down on typing. using BV = BoundingVolumes::AABBT; using Vec3 = Vec3T; - using Mesh = MeshT; using Face = FaceT; using slowSDF = SignedDistanceDcel; using fastSDF = SignedDistanceBVH; diff --git a/README.md b/README.md index 68813565..b5c936ec 100644 --- a/README.md +++ b/README.md @@ -25,6 +25,7 @@ Usage ----- The library is header-only, simple make EBGeometry.hpp visible to your code and include it. +Examples are given in Examples. License diff --git a/Source/EBGeometry_DcelFaceImplem.hpp b/Source/EBGeometry_DcelFaceImplem.hpp index fc3a8d12..c343b175 100644 --- a/Source/EBGeometry_DcelFaceImplem.hpp +++ b/Source/EBGeometry_DcelFaceImplem.hpp @@ -99,7 +99,7 @@ namespace Dcel { // This computes the area of any N-side polygon. const auto vertices = this->gatherVertices(); - for (int i = 0; i < vertices.size() - 1; i++){ + for (unsigned int i = 0; i < vertices.size() - 1; i++){ const auto& v1 = vertices[i] ->getPosition(); const auto& v2 = vertices[i+1]->getPosition(); m_area += m_normal.dot(v2.cross(v1)); diff --git a/Source/EBGeometry_DcelParserImplem.hpp b/Source/EBGeometry_DcelParserImplem.hpp index a11182b6..7fdde155 100644 --- a/Source/EBGeometry_DcelParserImplem.hpp +++ b/Source/EBGeometry_DcelParserImplem.hpp @@ -192,7 +192,7 @@ namespace Dcel { // Associate next/previous for the half edges inside the current face. Wish we had a circular iterator // but this will have to do. - for (int i = 0; i < halfEdges.size(); i++){ + for (unsigned int i = 0; i < halfEdges.size(); i++){ auto& curEdge = halfEdges[i]; auto& nextEdge = halfEdges[(i+1)%halfEdges.size()]; From 3f8e96ea84c9df78df9c161f6394315643ed4a08 Mon Sep 17 00:00:00 2001 From: Robert Marskar Date: Thu, 3 Mar 2022 09:31:14 +0100 Subject: [PATCH 5/6] moremoremore --- Copyright.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Copyright.txt b/Copyright.txt index f7fabc9d..d617ae4d 100644 --- a/Copyright.txt +++ b/Copyright.txt @@ -1,3 +1,3 @@ -Copyright © 2022 Robert Marskars +Copyright © 2022 Robert Marskar See LICENSE for redistribution rights. From 71b479381e02c23243aa8127b23690e2ba033c46 Mon Sep 17 00:00:00 2001 From: Robert Marskar Date: Thu, 3 Mar 2022 09:49:44 +0100 Subject: [PATCH 6/6] Add caveats --- README.md | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index b5c936ec..899e0981 100644 --- a/README.md +++ b/README.md @@ -12,7 +12,7 @@ For computing the signed distance one needs to define a suitable normal vector f EBGeometry provides bounding volume hierarchies (BVHs) for bounding geometric primitives in space. The BVHs are tree structures which permit accelerated closest-point searches. We point out that the BVHs in EBGeometry are shallow implementations without deep performance optimizations. -In the DCEL context the BVHs are used for bounding the facets on the surface mesh. +In the DCEL context the BVHs are used for bounding the facets on the surface mesh, but there are no fundamental limitations on which objects that can be bounded. Querying the distance to the mesh through the BVH is much faster than directly computing the distance. On average, if the mesh consists of N facets then a BVH has O(log(N)) complexity while a direct search has O(N) complexity. @@ -25,8 +25,13 @@ Usage ----- The library is header-only, simple make EBGeometry.hpp visible to your code and include it. -Examples are given in Examples. +Examples are given in Examples. +Caveats +------- + +EBGeometry takes, as input, a watertight and orientable surface. +Although EBGeometry will process grids that contain self-intersections, it does not warn about these, and the signed distance functions is not well-defined either. License -------