From 0e6dc98dc1302818889bdcddda20c93293f6144e Mon Sep 17 00:00:00 2001 From: codeanticode Date: Fri, 18 Oct 2013 21:09:38 -0400 Subject: [PATCH] update PShape tessellation when requesting vertex codes --- core/src/processing/opengl/PShapeOpenGL.java | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/core/src/processing/opengl/PShapeOpenGL.java b/core/src/processing/opengl/PShapeOpenGL.java index b04575c5e..b23435535 100644 --- a/core/src/processing/opengl/PShapeOpenGL.java +++ b/core/src/processing/opengl/PShapeOpenGL.java @@ -2347,6 +2347,11 @@ public class PShapeOpenGL extends PShape { public int[] getVertexCodes() { if (family == GROUP) return null; else { + if (family == PRIMITIVE || family == PATH) { + // the input geometry of primitive and path shapes is built during + // tessellation + updateTessellation(); + } if (inGeo.codes == null) return null; return inGeo.codes; } @@ -2356,7 +2361,14 @@ public class PShapeOpenGL extends PShape { @Override public int getVertexCodeCount() { if (family == GROUP) return 0; - else return inGeo.codeCount; + else { + if (family == PRIMITIVE || family == PATH) { + // the input geometry of primitive and path shapes is built during + // tessellation + updateTessellation(); + } + return inGeo.codeCount; + } }