Skip to content

Commit

Permalink
Merge pull request #248 from glotzerlab/fix_edge_case_for_convex_poly…
Browse files Browse the repository at this point in the history
…hedron

Fix edge case for intersect function for convex polyhedron
  • Loading branch information
joaander authored Aug 19, 2024
2 parents 8309d91 + b8782be commit 5866a31
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 2 deletions.
4 changes: 4 additions & 0 deletions CHANGELOG.rst
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,10 @@ fresnel_ releases follow `semantic versioning`_.
0.x
----

*Changed*

* Fixed a bug in the intersect function for an edge case.

0.13.6 (2024-05-31)
^^^^^^^^^^^^^^^^^^^

Expand Down
3 changes: 3 additions & 0 deletions doc/credits.rst
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,9 @@ The following people contributed to **fresnel**.
* Mike Henry, Boise State University
* Jenny Fothergill, Boise State University
* Corwin Kerr, University of Michigan
* Domagoj Fijan, University of Michigan
* Charlotte Zhao, University of Michigan
* Philipp Schönhöfer, University of Michigan

Libraries
---------
Expand Down
2 changes: 1 addition & 1 deletion fresnel/cpu/GeometryConvexPolyhedron.cc
Original file line number Diff line number Diff line change
Expand Up @@ -163,7 +163,7 @@ void GeometryConvexPolyhedron::intersect(const struct RTCIntersectFunctionNArgum
vec3<float> t0_n_local(0, 0, 0), t0_p_local(0, 0, 0);
vec3<float> t1_n_local(0, 0, 0), t1_p_local(0, 0, 0);
int t0_plane_hit = 0, t1_plane_hit = 0;
for (int i = 0; i < n_planes && t0 < t1; ++i)
for (int i = 0; i < n_planes && t0 <= t1; ++i)
{
vec3<float> n = geom->m_plane_normal[i];
vec3<float> p = geom->m_plane_origin[i];
Expand Down
2 changes: 1 addition & 1 deletion fresnel/gpu/GeometryConvexPolyhedron.cu
Original file line number Diff line number Diff line change
Expand Up @@ -132,7 +132,7 @@ RT_PROGRAM void intersect(int item)
vec3<float> t0_n_local(0, 0, 0), t0_p_local(0, 0, 0);
vec3<float> t1_n_local(0, 0, 0), t1_p_local(0, 0, 0);
int t0_plane_hit = 0, t1_plane_hit = 0;
for (int i = 0; i < n_planes && t0 < t1; ++i)
for (int i = 0; i < n_planes && t0 <= t1; ++i)
{
vec3<float> n = vec3<float>(convex_polyhedron_plane_normal[i]);
vec3<float> p = vec3<float>(convex_polyhedron_plane_origin[i]);
Expand Down

0 comments on commit 5866a31

Please sign in to comment.