Skip to content

Integrate Mapbox earcut.hpp for robust triangluation - #298

Merged
syoyo merged 6 commits into
masterfrom
mapbox-earcut
Jul 29, 2021
Merged

Integrate Mapbox earcut.hpp for robust triangluation#298
syoyo merged 6 commits into
masterfrom
mapbox-earcut

Conversation

@syoyo

@syoyo syoyo commented Feb 28, 2021

Copy link
Copy Markdown
Collaborator

Integrate mapbox/earcut.hpp for robust polygon trinagulation. It should be battle-tested and reliable https://github.com/mapbox/earcut.hpp

Its optional. To enable mapbox/earcut.hpp, define TINYOBJLOADER_USE_MAPBOX_EARCUT.

For python binding, minimum C++ requirement is C++11 so we can enable it by default.

@syoyo

syoyo commented Feb 28, 2021

Copy link
Copy Markdown
Collaborator Author

It also contains possible fix of existing triangulation code. #156 (comment)

@syoyo

syoyo commented Jul 29, 2021

Copy link
Copy Markdown
Collaborator Author

Enabled MAPBOX_EARCUT for Python binding.

@syoyo
syoyo merged commit db7454c into master Jul 29, 2021
@syoyo
syoyo deleted the mapbox-earcut branch July 29, 2021 07:55
Comment thread tiny_obj_loader.h
/*
ISC License

Copyright (c) 2015, Mapbox

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Could I ask you to incorporate this new license text into the top-level LICENSE file in this repository (so that there are two license stanzas in that one file)?

I would like to redistribute object code that uses tinyobjloader, so I'll need to incorporate this license text into my redistributed notices. Doing so is a little bit annoying if the license text is embedded into the C++ header, instead of as a separate file.

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

I see. It'd be better to separate mapbox earcut file into a separate file. Will create PR soon. Also we'll add ISC license to LICENSE file.

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

PR is ready: #313

@syoyo syoyo mentioned this pull request Aug 4, 2021
syoyo added a commit that referenced this pull request Nov 10, 2025
* Use simple triangulation rule for the quad face when triangulation. This partially solves issue no. 295.

* Embed mapbox/earcut.hpp code(for robust triangulation)

* Use mapbox/earcut.hpp for the polygon tessellation(for a polygon with 5 or more vertices).

* Use Mapbox earcut(robust triangulation) by default for python binding.

* Fix compile of Mapbox earcut code path.
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