Using toJava2D()
with group shapes
#91
-
Hi..
|
Beta Was this translation helpful? Give feedback.
Replies: 2 comments
-
The output of the triangulation is a group-type PShape, which consists of multiple child shapes, each representing a triangle in the triangulated geometry. The To work with the triangulation, you have two options:
|
Beta Was this translation helpful? Give feedback.
-
thanks! for the reply, it is clear now, it seems a bit more complicated than I initially have thought, but I will give it a try, probably by creating lists of path2D objects through GeometryCollectionShape. If I will figure out a solution I will post it here. |
Beta Was this translation helpful? Give feedback.
The output of the triangulation is a group-type PShape, which consists of multiple child shapes, each representing a triangle in the triangulated geometry.
The
toJava2D()
method converts group shapes (multipolygons) to a JTSGeometryCollectionShape
type, which implementsjava.awt.shape
. However, since the original shape contains multiple paths, it cannot be directly converted to aPath2D
.To work with the triangulation, you have two options:
toJava2D()
to a(GeometryCollectionShape)
instead, and then use itsgetPathIterator()
method...toJava2D()
that should return a Path2D representing t…