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

forcing NURBS to mesh causes "naked edges" #175

Open
wpwrak opened this issue Jan 28, 2017 · 14 comments
Open

forcing NURBS to mesh causes "naked edges" #175

wpwrak opened this issue Jan 28, 2017 · 14 comments

Comments

@wpwrak
Copy link
Contributor

wpwrak commented Jan 28, 2017

SolveSpace at commit d4b052d

The following design produces complaints about 864 naked edges, which makes SolveSpace very unhappy:
https://gitlab.com/anelok/mexp/raw/016367ea70960daac4d8bb94a5740d84a3f5e900/alt13/aaa-minus-weirdly-broken.slvs

I found that turning off NURBS to mesh in g00b-spring makes the naked edges go away.

Before I noticed that I had NURBS to mesh selected, I tried removing the rectangular blocks on the side, the hole, the "dimple", ... none of which helped to get rid of the naked edges.

@whitequark whitequark added the bug label Jan 28, 2017
@Evil-Spirit Evil-Spirit added this to indev in Evil-Spirit tasks Jan 30, 2017
@Evil-Spirit Evil-Spirit moved this from indev to todev in Evil-Spirit tasks Jan 30, 2017
@whitequark
Copy link
Contributor

Triage: still an issue after baf9dc0, although I get many fewer problematic edges (different chord tolerance?).

@whitequark
Copy link
Contributor

Triage: per discussion in Evil-Spirit@51616bc#commitcomment-21277921, switching from ear-triangulation to Delaunay will help here.

@Evil-Spirit Evil-Spirit moved this from todev to indev in Evil-Spirit tasks May 16, 2017
@Evil-Spirit
Copy link
Collaborator

@whitequark
What about using https://www.geometrictools.com/Samples/Geometrics.html?
Occasionally, my friend @bazhenovc made cmake building for this https://github.com/bazhenovc/WildMagic/commits/master

@Evil-Spirit
Copy link
Collaborator

@bazhenovc
What do you know about this library? Is this the best choice?

@bazhenovc
Copy link

Oh hello there.

I can say that this library does the job and the code is of high quality - so yes, I'd recommend it. I'd suggest to extract the needed classes rather then using the whole WM5/GTE - it's quite huge and you'll probably never need the whole package.

@whitequark
Copy link
Contributor

@bazhenovc Thanks for chiming in!

@Evil-Spirit This uses the Boost license, so it's compatible. It will remove a massive chunk of code from SolveSpace, if I understand correctly (exactly which?). Seems easy to integrate, though I think using a submodule is preferable to copying files (history is lost, upgrades are painful, etc).

@bazhenovc
Copy link

History will be lost no matter what you'll do - their source code is distributed in zip archives.

@whitequark
Copy link
Contributor

In these cases I normally import releases into git version by version (which is quite easy with a script), so we can still easily bisect, and also easily track/rebase our changes on top of their classes.

@Evil-Spirit
Copy link
Collaborator

@bazhenovc
Thanks for information!

@whitequark
At least we can use Delaunay triangulation.

@whitequark
Copy link
Contributor

Anything else?

@Evil-Spirit
Copy link
Collaborator

there is CORK, some library for booleans.
Not sure this is production ready
http://arc-team-open-research.blogspot.ru/2014/10/boolean-operations-powerful-cork.html

@whitequark
Copy link
Contributor

whitequark commented Sep 30, 2017

There's this issue with it:

WARNING: Unfortunately, there are a number of known problems with Cork. I have zero time to work on the library since I'm currently busy working on a thesis. (March 2016) If you would like to pay me large sums of money to improve this library, maybe we should talk. Otherwise, I'm really quite sorry to say I don't have time.

It might still be better than our current booleans, but I'm not sure of a good way to compare them.

It also uses LGPL so this creates obvious distribution issues for us, but that's comparatively minor.

@whitequark whitequark removed this from the 3.0 milestone May 23, 2019
@phkahler phkahler linked a pull request Aug 13, 2020 that will close this issue
@phkahler phkahler removed a link to a pull request Aug 13, 2020
@phkahler
Copy link
Member

phkahler commented Sep 9, 2020

Using current master (dbf5a8d) with default setting this gives me 8 bad edges. Switching it back to NURBS produces zero bad edges even if I increase max_segments to 100 and lower chord tolerance to 0.01 percent. It is always best not to use triangle mesh unless something goes wrong with a NURBS boolean operation. Maybe at the time this issue was opened that was necessary.

This is still an issue and a fairly simple test sketch.

@phkahler
Copy link
Member

phkahler commented Feb 6, 2022

I just revisited this model with commit 61cc28f (late in 3.0 prior to 3.1) and the problem is still there. I noticed that switching to NURBS and then back to triangle mesh often changes the number of bad edges. Anywhere from zero up to 126 but typically about 30. There seem to be some randomness in the boolean operations on triangle meshes.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
No open projects
Development

No branches or pull requests

5 participants