micycle1 / PGS

Processing Geometry Suite
https://micycle1.github.io/PGS/
167 stars 13 forks source link

Not working with `P2D` #39

Closed matheplica closed 2 years ago

matheplica commented 2 years ago

When I used with P2D mode. I've got always a NullPointerException that block the script.

micycle1 commented 2 years ago

Could you provide the code you're running and the stack trace of the error?

There is one known limitation with the P2D renderer, which causes an error like this:

java.lang.ArrayIndexOutOfBoundsException: arraycopy: last source index 37 out of bounds for float[2]

This occurs because P2D actually uses PShapeOpenGL for PShapes, rather than PShape (the kind that PGS creates). This exception only effects shapes whose family is GEOMETRY (such as POINTS, etc.).


The code currently returns a GEOMETRY PShape when the shape to convert from is null. This will be amended for the next version, 1.2.0.

micycle1 commented 2 years ago

In 1.2.0, output PShapes are now always created with a shape family of PATH (rather than GEOMETRY) to maximise compatibility with the P2D renderer.