8000 Misc changes by pca006132 · Pull Request #1162 · elalish/manifold · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

Misc changes #1162

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

Merged
merged 5 commits into from
Feb 23, 2025
Merged

Misc changes #1162

merged 5 commits into from
Feb 23, 2025

Conversation

pca006132
Copy link
Collaborator
@pca006132 pca006132 commented Feb 22, 2025
  1. Avoid uploading to PyPI when manual triggering the python build CI. This should allow us to test the release PR before actually doing a release. Closes python CI test for all python versions #1161.
  2. Update dependencies, some are quite old now.
  3. Re-enable Samples.CondensedMatter16 test with triangulation check disabled. It can produce bad triangulation, but the output looks kind of fine.

To test 1, we need to merge this PR first because manually triggering CI uses the file in the master branch iirc.

@pca006132
Copy link
Collaborator Author
pca006132 commented Feb 22, 2025

@elalish FYI this is the bad polygon causing the triangulation error:

image

There are two simple polygons here, both are winding in CCW direction. Probably a bug in our boolean.

import numpy as np
import matplotlib.pyplot as plt
array = np.array
show = lambda x: plt.plot(*np.hsplit(np.append(x, x[0, :].reshape((1, 2)), axis=0), 2), marker='.')

show(array([
  [3.49327, 8.14635],
  [3.18819, 7.67361],
  [3.2871, 7.67361],
  [3.2871, 7.67361],
  [3.30402, 7.68686],
  [3.49327, 8.14635],
  [3.18819, 7.67361],
  [3.49327, 8.14635],
  [3.49327, 8.14635],
  [3.49327, 8.14635],
  [3.49327, 8.14635],
  [3.49327, 8.14635],
  [3.49327, 8.14635],
  [3.58896, 7.67361],
  [3.49327, 8.14635],
  [3.47349, 7.69348],
  [3.49006, 7.67361],
  [3.49006, 7.67361],
  [3.58896, 7.67361],
]))
show(array([
  [3.4011, 7.73014],
  [3.4197, 7.72455],
  [3.49327, 8.14635],
  [3.38002, 7.72455],
  [3.4011, 7.73014],
]))

plt.show()

Copy link
codecov bot commented Feb 22, 2025

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 91.70%. Comparing base (f178cd1) to head (216b611).
Report is 2 commits behind head on master.

Additional details and impacted files
@@            Coverage Diff             @@
##           master    #1162      +/-   ##
==========================================
+ Coverage   91.69%   91.70%   +0.01%     
==========================================
  Files          30       32       +2     
  Lines        5959     5980      +21     
==========================================
+ Hits         5464     5484      +20     
- Misses        495      496       +1     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@pca006132
Copy link
Collaborator Author

btw, should we keep both ManifoldParams and PolygonParams? I don't think we are using processOverlaps in ManifoldParams, and it can get a bit confusing.

@elalish
Copy link
Owner
elalish commented Feb 22, 2025

btw, should we keep both ManifoldParams and PolygonParams?

👍 Let's unify them.

Copy link
Owner
@elalish elalish left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks!

Manifold result =
Manifold::Cube().Rotate(-0.10000000000000001, 0.10000000000000001, -1.) +
Manifold::Cube() -
Manifold::Cube().Rotate(-0.10000000000000001, -0.10000000000066571, -1.);
EXPECT_EQ(result.Status(), Manifold::Error::NoError);
ManifoldParams().intermediateChecks = false;
ManifoldParams().processOverlaps = true;
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What's the trouble with this test?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It produces self-intersecting results (more than epsilon):

image

TEST(Samples, CondensedMatter16) {
// FIXME: Triangulation can be invalid
bool old = PolygonParams().processOverlaps;
PolygonParams().processOverlaps = true;
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

As for the bad triangulation - did you output that poly with full precision? It says they exactly share a vertex position, but I'm guessing they actually overlap slightly? Because otherwise I think the triangulator should work. When you find polys like this and they turn out to actually be epsilon-valid, go ahead and add them to our polygon test corpus.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just updated, but it is indeed sharing the exact same vertex position:

Polygon 0 2.306422737411849e-11 2
18
3.493267459305203 8.14635
3.188192877073223 7.673607122926777
3.287098975966871 7.673607122926777
3.287098975966871 7.673607122926777
3.304015665365264 7.686855769635112
3.493267459305203 8.14635
3.188192877073223 7.673607122926777
3.493267459305203 8.14635
3.493267459305203 8.14635
3.493267459305203 8.14635
3.493267459305203 8.14635
3.493267459305203 8.14635
3.493267459305203 8.14635
3.5889649365369 7.673607122926777
3.493267459305203 8.14635
3.47348551191873 7.693480092989279
3.49005883764325 7.673607122926777
3.5889649365369 7.673607122926777
5
3.401099121578296 7.730144750127856
3.419703476450267 7.724547521102497
3.493267459305203 8.14635
3.380015762439546 7.724547521102497
3.401099121578296 7.730144750127856
# ... 
show(array([
  [3.493267459305203, 8.14635],
  [3.188192877073223, 7.673607122926777],
  [3.287098975966871, 7.673607122926777],
  [3.287098975966871, 7.673607122926777],
  [3.304015665365264, 7.686855769635112],
  [3.493267459305203, 8.14635],
  [3.188192877073223, 7.673607122926777],
  [3.493267459305203, 8.14635],
  [3.493267459305203, 8.14635],
  [3.493267459305203, 8.14635],
  [3.493267459305203, 8.14635],
  [3.493267459305203, 8.14635],
  [3.493267459305203, 8.14635],
  [3.5889649365369, 7.673607122926777],
  [3.493267459305203, 8.14635],
  [3.47348551191873, 7.693480092989279],
  [3.49005883764325, 7.673607122926777],
  [3.5889649365369, 7.673607122926777],
]))
show(array([
  [3.401099121578296, 7.730144750127856],
  [3.419703476450267, 7.724547521102497],
  [3.493267459305203, 8.14635],
  [3.380015762439546, 7.724547521102497],
  [3.401099121578296, 7.730144750127856],
]))

Copy link
Owner
8000

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

That looks like a good test for the corpus. I need to come back and debug that one.

@@ -55,6 +55,7 @@ jobs:
url: https://pypi.org/p/manifold3d
permissions:
id-token: write # IMPORTANT: this permission is mandatory for trusted publishing
if: ${{ github.event_name == 'release' }}
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Want to add instructions to our release checklist?

@pca006132
Copy link
Collaborator Author

btw, should we keep both ManifoldParams and PolygonParams?

👍 Let's unify them.

Hmm, looking at it, we want to enable intermediate checks for polygons but not manifold. Maybe we can make a checkSelfIntersection flag after unifying them.

And is this considered a breaking change? I think some users may use these params and removing PolygonParams may break things. Maybe update the PolygonParams function to give the ManifoldParams but also mark is as deprecated? In case people expecting these two to be different, they will be notified.

I think I will do that in another PR.

@elalish
Copy link
Owner
elalish commented Feb 23, 2025

Yeah, good call on deprecation, though honestly I hope no one is changing those values in production.

@pca006132 pca006132 merged commit 5399bd4 into master Feb 23, 2025
27 checks passed
@elalish elalish deleted the misc branch February 24, 2025 08:28
@elalish elalish mentioned this pull request May 14, 2025
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.

python CI test for all python versions
2 participants
0