X-Git-Url: https://git.piment-noir.org/?a=blobdiff_plain;f=ShaheenGandhi.pde;h=ff6ce2edcf82d4ce840eb105eaff462a5bda97a2;hb=2a7c5e4d2e998420a6417156e428e45ce14b2462;hp=5e2c88cd1c3bdfeac7a3822ae85bb226335b94f6;hpb=f904d86b4d872db19645a8b2109cf34837e0b955;p=SugarCubes.git diff --git a/ShaheenGandhi.pde b/ShaheenGandhi.pde index 5e2c88c..ff6ce2e 100644 --- a/ShaheenGandhi.pde +++ b/ShaheenGandhi.pde @@ -106,9 +106,16 @@ class HelixPattern extends SCPattern { } color colorOfPoint(final PVector p) { + float t = axis.getTValue(p); + + // For performance reasons, cut out points that are outside of + // the tube where the toroidal coil lives. + if (abs(PVector.dist(p, axis.getPointAt(t)) - radius) > girth*.5f) { + return color(0,0,0); + } + // Find the appropriate point for the current rotation // of the helix. - float t = axis.getTValue(p); PVector toroidPoint = pointOnToroidalAxis(t); // The rotated point represents the middle of the girth of