About aplha shapes

Posts regarding potential bugs, enhancement requests, and general feedback on use of dyn4j
DmitryMedvedev
Posts: 4
Joined: Mon Nov 14, 2016 9:01 am

About aplha shapes

Postby DmitryMedvedev » Mon Nov 14, 2016 9:24 am

Hello, friends!
I need some help with concave shape.
I have random set of points(>300 points) with high density which i want to turn in concave shape.
The problem appears when i try to do it with one of dyn4j Decomposer.
SweepLine.decompose and Bayazit gives me exceptions
Smth like this

Code: Select all

java.lang.NullPointerException
   at org.dyn4j.geometry.decompose.SweepLine.regular(SweepLine.java:258)
   at org.dyn4j.geometry.decompose.SweepLine.createTriangulation(SweepLine.java:128)
   at org.dyn4j.geometry.decompose.SweepLine.triangulate(SweepLine.java:79)

or this

Code: Select all

java.lang.IllegalArgumentException: A simple polygon cannot have crossing edges.


Even triangulation falls with exception.

Looks like i have "wrong" input points, right?

I beleive any cloud of points can be turned to concave polygon through maybe aplha shape method. Is dyn4j support it?
If not how can i get decomposition for my points clowd closest to alpha shape? Should i implement delaunay triangulation or this is already done in dyn4j? Any help very appreciated!

William
Site Admin
Posts: 345
Joined: Sat Feb 06, 2010 10:23 pm

Re: About aplha shapes

Postby William » Mon Nov 14, 2016 10:10 am

The dyn4j decomposition algorithms only support Simple Polygons without holes, not point clouds. There's no algorithm in dyn4j to build concave shapes from point clouds (there are classes to build convex shapes, but I don't think that's what you are looking for).

If you'd like to contribute a Delaunay triangulation that would be awesome.

William

DmitryMedvedev
Posts: 4
Joined: Mon Nov 14, 2016 9:01 am

Re: About aplha shapes

Postby DmitryMedvedev » Tue Nov 15, 2016 2:17 am

Thx for fast responce! I like dyn4j and even it hasn't what i need i will try to do it by myself. I am newby user of this library, but if i will have acceptable solution for alpha shape i will make a contribution to support this lib.


Return to “Bugs, Enhancements, Feedback”

Who is online

Users browsing this forum: No registered users and 1 guest