Comments (5)
p.s. I'm referring to Java version of Poly2tri library.
Original comment by [email protected]
on 1 May 2014 at 4:38
from poly2tri.
Well when adding holes what you actually do is add points and constraints for
the triangulation. This data you should already have before using poly2tri to
triangulate so I don't see why you need poly2tri to return these holes?
Outer hull, holes and steiner points are all just bunched up as a list of
points and constraints when triangulating. What you get in return is the
triangles that are considered to be inside of the polygon.
addHole is just a convenient way of adding points and edges to the
triangulation context. There is really no holes to return after triangulation.
Original comment by [email protected]
on 2 May 2014 at 9:59
- Changed state: WontFix
from poly2tri.
I know that getHoles() would return the same points that I gave it using
addHole() method, and yes I could just save those points somewhere else in my
program and use Hashtable to match it with any given Polygon object, but why
are you forcing this inconvenience on us??
I need getHoles() for my own calculations. For example, I add holes in one part
of my code and in a different part I need to read the holes and adjust them to
ensure they don't collide with each other.
You already have a getPoints() method, why not add a getHoles() method too?
It's standard practice that every setter would have a getter so that you don't
lose access your own input data.
Original comment by [email protected]
on 10 May 2014 at 5:24
from poly2tri.
I'm not really happy with the API interface. I had plans to make a Polygon
manipulation library and have the Polygon class be used by several different
tools not just triangulation.
Since that didn't come to fruition I would rather have seen Polygon class just
as a context for for passing data to the triangulator.
To solve your issue just do
package org.poly2tri.geometry.polygon;
public class MyPolygon implements Polygon
{
public List<Polygon> getHoles()
{
return _holes;
}
}
and use that instead of Polygon
Original comment by [email protected]
on 10 May 2014 at 10:58
from poly2tri.
Your solution is actually what I had already implemented. But still, I think
many of your non-pro users wouldn't recognize that _holes is protected and can
be access this way. Also is add one more class to project that was otherwise
unnecessary.
Furthermore, it's inconsistent with the current API. You have getPoints()
methods but not getHoles(). If you decided to make Polygon just a context for
passing data, are you going to remove getPoints() as well? That'd be even more
inconvenient but at least consistent with not having any getters.
My thoughts is that the majority of the users of your library expect getters
and are surprised that there is a missing getter. A simple shortcoming like
that could deprive you of thousands of potential users because most would
assume that missing basic getters is a sign that library is not complete and/or
reliable. Whereas in reality I think it's a fantastic library.
Original comment by [email protected]
on 17 May 2014 at 2:18
from poly2tri.
Related Issues (20)
- Java source unbuildable in 1.7+
- Build failed when compliling with -we4715
- Java findbugs - nullcheck of value previously dereferenced HOT 1
- [java] Tessellation with hole error HOT 4
- Polygon with hole HOT 10
- [java] Missing triangle in non-constrained delaunay HOT 3
- Problem building library
- the EPSILON value is not exported in the python/cython version HOT 1
- Compilation fails with MSVC
- CMake build script
- Inconsistent behavior with holes that share a point HOT 17
- add typedef for "double"
- add typedef for std::vector<Point*>, std::vector<Triangle*> and other containers
- Triangulate crashes in sweep.cc:703 HOT 3
- java version compile error HOT 3
- poly2tri crashes on a very simple geometry HOT 1
- crash with attached polygon HOT 2
- Crash when triangulating a polygon HOT 1
- crash with square polygon HOT 1
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 poly2tri.