class FChar extends FPoly { RShape m_shape; RShape m_poly; boolean m_bodyCreated; FChar(char chr){ super(); String txt = ""; txt += chr; RG.textFont(font, (int)random(72, 120)); m_shape = RG.getText(txt); m_poly = RG.polygonize(m_shape); if (m_poly.countChildren() < 1) return; m_poly = m_poly.children[0]; // Find the longest contour of our letter float maxLength = 0.0; int maxIndex = -1; for (int i = 0; i < m_poly.countPaths(); i++) { float currentLength = m_poly.paths[i].getCurveLength(); if (currentLength > maxLength) { maxLength = currentLength; maxIndex = i; } } if (maxIndex == -1) return; RPoint[] points = m_poly.paths[maxIndex].getPoints(); for (int i=0; i