-
Notifications
You must be signed in to change notification settings - Fork 625
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
Prism geometry rendering artifacts #1523
Comments
The artifact seems to be caused by floating-point rounding error in the |
Thanks for looking into this! Applying the following function:
to the geometry:
does seem to eliminate the artifact: Perhaps the calculation in |
The point in polygon problem (which is how Long story short, if your polygon is too complicated (lots of vertices, several concave sides, etc.) it may fail to properly render. There are some very robust (and slow) libraries that can handle these corner cases well, but often it's easier to do a little geometry preprocessing. |
Is the example that I've shown above an edge case though? The last message of the issue you linked seems to indicate that a floating point round off bug still persists. That seems to be what's going on here. |
Sorry, I should clarify. In addition to my previous comment, I don't think our current algorithm is backwards stable which is why it's so sensitive to round off error and floating point precision. By edge cases, I mean anything that triggers this sensitivity (similar to Gaussian Elimination or Gram-Schmidt). As I mentioned, this is a common issue with this particular problem. Mainstream libraries, like CGAL, get around this by doing lots of checking. Of course, this induces a lot of slow branching. In other words, I don't think this is a bug, but rather a consequence of the algorithm. But I'd be happy if I were wrong! |
Fixed by NanoComp/libctl#59? |
No. That just prevents segfaults under certain circumstances.
…On Tue, Nov 9, 2021 at 8:12 PM Ardavan Oskooi ***@***.***> wrote:
Fixed by NanoComp/libctl#59 <NanoComp/libctl#59>?
—
You are receiving this because you are subscribed to this thread.
Reply to this email directly, view it on GitHub
<#1523 (comment)>, or
unsubscribe
<https://github.com/notifications/unsubscribe-auth/AA4VK535AH26ZQ2L2Z6J4JLULHWJHANCNFSM4Y4LO74A>
.
|
I am encountering some strange artifacts in Meep's rendering of Prism geometries onto the simulation grid. Consider the case shown below. The prism vertices are traced on the left and the Meep simulation domain is shown on the right, with the same vertices overlaid as x's.
You can see that there is an artifact around the lower left part of the cutout. This seems to be coming from the extra vertex that sits on that diagonal interface. While this vertex is not strictly necessary to describe the outline of this prism, I would not have expected Meep to render this geometry as shown in the image.
The code for reproducing the result shown above is provided below:
The text was updated successfully, but these errors were encountered: