Comments (5)
Perfect! Sorry for the noise.
For the records, since I'm not supporting holes in my application, I opted to send std::span<std::vector<glm::vec2>, 1>{std::addressof(points), 1}
, where points is a std::vector<glm::vec2>
from earcut.hpp.
I think there's some confusion about the types.
The input type for earcut has a structure like vector<vector<point>>
. For the point type, it's sufficient if nth<0, ...> and nth<1, ...> is defined. For the vector type, it's necessary to define container methods such as 'size', operator[] etc.
Namely, the functions Earcut::operator() and Earcut::linkedList are using points[i].size(), but it is documented that specializing the nth is enough to make it compatible.
points[i] would be a vector, therefore points[i].size() is the number of points of the polygon/point-list/vector with the index i.
from earcut.hpp.
Hmm, right now I'm trying to send a std::vector<glm::vec2>
. I would need to send a std::vector<std::vector<glm::vec2>>
? What is the second dimension is supposed to represent? I'm not sure how to layout my data
from earcut.hpp.
Ah! I see, this is to support holes inside a polygon?
from earcut.hpp.
Yes, to support holes. The first vector<point>
is the main surrounding polygon, further point-lists define holes.
std::vector<std::vector<glm::vec2>>
would work.
from earcut.hpp.
Related Issues (20)
- 'cut' introduced in complex polygon HOT 1
- New test “issue142” in 2.2.4 fails on aarch64, ppc64le, s390x HOT 1
- Helper function for earcutting just a std::vector<> of points HOT 1
- Incorrect Triangulation HOT 1
- missing triangle HOT 2
- Builds wrong indices array for concave polygon HOT 2
- The Ear Point judgment HOT 2
- Coverity scan fails HOT 1
- Transfer Appveyor project to Mapbox? HOT 4
- Clang-Tidy static analysis warning: dereference of a null pointer HOT 2
- Issues with triangulating a polygon with 3d coords HOT 1
- How to clip with an outside polygon HOT 1
- Infinite loop in cureLocalIntersections HOT 2
- When I use Clipper to cut polygons, sometimes I get some separated polygons and some holes. How can I use earcut to process these separated polygons? HOT 8
- Endless loop in the filterPoints function HOT 1
- Any way to make this use even-odd rule? HOT 1
- Port infinite loop fix HOT 1
- Please consider adding a version tag on commit 6d18edf0ce046023a7cb55e69c4cd9ba90e2c716 or later HOT 4
- Test “self_touching” fails on aarch64, ppc64le, s390x HOT 5
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from earcut.hpp.