Skip to content
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

Fix "not watertight" error in 3D trimming operation #831

Merged
merged 7 commits into from
Jun 12, 2024

Conversation

gertjanvanzwieten
Copy link
Contributor

No description provided.

@joostvanzwieten
Copy link
Member

>>> from nutils import element
>>> import numpy
>>> element.getsimplex(3).slice(numpy.array([ 0.12818456, -0.00017979,  0.06756571, -0.03730343]), 8)
NotImplementedError

This patch fixes an assertion in the MosaicReference constructor that checks
that the edge transforms of the new edges coinside with the edge transforms of
the edges of the base reference. Here `nedges` was mistaken for `nverts`, which
worked because in dimensions 1 and 2 the two are often equal, but which was
technically incorrect.
This patch changes the implementation of Element.volume to use degree=1 gauss
quadrature points, rather than _centroid. Though the two are often equal, the
new implementation is robust against the situation that an element has zero
quadrature points. It also avoids the unnecessary computation of the centroid
coordinate which is not used for the volume.
This patch adds a special case to MosaicReference.getpoints for the situation
that its simplices are empty, in which case ConcatPoints crashed as it tried to
establish the dimension. The new implementation creates a CoordsWeightsPoints
instance of zero points.
This patch changes the sign test in Reference.slice that results in an early
return if the levelset values are all of the same sign. By focusing this tests
on the vertices used by simplices, rather than all vertices (some of which may
not play a role due to earlier slicing) more cases might be caught here rather
than in the later edge test, which is now restricted to ndims >= 2.
This patch fixes a ndivisions-related trimming issue where, due to rouding,
adjoining edges of a newly formed mosaic are incompatible. The patch fixes this
by retaining degenerate mosaics if they serve the purpose of completing the rib
skeleton.
This patch introduces the cached Reference._ribs property that allows an
element's edge-edge relations to be reused in the formation of new mosaic
elements.
This patch declares the edge_vertices and orientation lists to outside the
if-block in which they are populated, for reasons of readibility.
@gertjanvanzwieten gertjanvanzwieten merged commit 1eaf3c9 into master Jun 12, 2024
21 checks passed
@gertjanvanzwieten gertjanvanzwieten deleted the fixtrim branch June 12, 2024 19:52
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants