We are about to switch to a new forum software. Until then we have removed the registration on this forum.
Hi,
I have an issue with arrayLists.
What I want to do is delete vertices ("drawPolygon2DVertices(p, 5)") from inputPolys Arraylist, when intersectPolys ArrayList points have the same location coordinates and inputPolys ArrayList.
I know the script I am dealing with works with Hemesh library, but maybe there is specific function for arrayLists to achieve, this?
I have 1st arrayList:
ArrayList<WB_Polygon2D> inputPolys = new ArrayList<WB_Polygon2D>();
for (WB_Polygon2D p : inputPolys) {
render.drawPolygon2DVertices(p, 5);
}
Then 2nd arrayList:
List<WB_Polygon2D> intersectPolys = new ArrayList<WB_Polygon2D>();
for (WB_Polygon2D p : intersectPolys){
render.drawPolygon2DVertices(p, 5);
}//for
Thanks, Petras
Comments
See Processing reference on ArrayLists for a quick reference (they mention the remove() method), and Java's ArrayList for a more complete reference.
Is that what you were looking for?
Dear PhiLho,
Thank you for an answer.
But, I could not find a solution I wanted, as I am working with Hemesh Library.
What I want to do is even one step behind removing objects from ArrayList. I want to have acces to polygons points.
I was working with Hemesh and I know by documentation that I can access polygons points, --> //points1.add(p.points);
I work with eclipse, as a result, I see these functions but cannot make them work... The code is pretty much simple as I am working with basic hemesh functions.
If you have some time, may you look at my code?