public static List <Vector2> tessellateBezier(float x1, float y1, float x2, float y2, float x3, float y3, float x4, float y4, float tessTol) { var key = new TessellationKey(x1, y1, x2, y2, x3, y3, x4, y4, tessTol); _tessellations.TryGetValue(key, out var tessellationInfo); if (tessellationInfo != null) { tessellationInfo.touch(); return(tessellationInfo.points); } var points = _tessellateBezier(x1, y1, x2, y2, x3, y3, x4, y4, tessTol); _tessellations[key] = new TessellationInfo(key, points); return(points); }
public TessellationInfo(TessellationKey key, List <Vector2> points, int timeToLive = 5) { this.points = points; this.key = key; this.touch(timeToLive); }