repositories
/
SugarCubes.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (from parent 1:
f904d86
)
[Helix][perf] Do not process points outside of the coil area
author
Shaheen Gandhi
<shaheen@fb.com>
Mon, 19 Aug 2013 01:03:12 +0000
(18:03 -0700)
committer
Shaheen Gandhi
<shaheen@fb.com>
Mon, 19 Aug 2013 01:03:12 +0000
(18:03 -0700)
ShaheenGandhi.pde
patch
|
blob
|
blame
|
history
diff --git
a/ShaheenGandhi.pde
b/ShaheenGandhi.pde
index 5e2c88cd1c3bdfeac7a3822ae85bb226335b94f6..ff6ce2edcf82d4ce840eb105eaff462a5bda97a2 100644
(file)
--- a/
ShaheenGandhi.pde
+++ b/
ShaheenGandhi.pde
@@
-106,9
+106,16
@@
class HelixPattern extends SCPattern {
}
color colorOfPoint(final PVector p) {
}
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.
// 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
PVector toroidPoint = pointOnToroidalAxis(t);
// The rotated point represents the middle of the girth of