From dbba704d1caefae4d86204bd7cf24e0193b66c52 Mon Sep 17 00:00:00 2001 From: Zeno Rogue Date: Thu, 8 Nov 2018 22:21:46 +0100 Subject: [PATCH] linepatterns:: added circles, radii, meridians, parallels --- hyper.h | 6 +++++- pattern2.cpp | 44 ++++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 49 insertions(+), 1 deletion(-) diff --git a/hyper.h b/hyper.h index 617074c5..9fbf0ce6 100644 --- a/hyper.h +++ b/hyper.h @@ -2225,7 +2225,11 @@ namespace linepatterns { patBigRings, patHorocycles, patTriOther, - patDual + patDual, + patMeridians, + patParallels, + patCircles, + patRadii }; void clearAll(); diff --git a/pattern2.cpp b/pattern2.cpp index 23f5f59c..06b4bfc9 100644 --- a/pattern2.cpp +++ b/pattern2.cpp @@ -1938,6 +1938,10 @@ namespace linepatterns { {patTriTree, "triangle grid: tree edges", 0xFFFFFF00}, {patTriOther, "triangle grid: other edges", 0xFFFFFF00}, + {patCircles, "circles", 0xFFFFFF00}, + {patRadii, "radii", 0xFFFFFF00}, + {patMeridians, "meridians", 0xFFFFFF00}, + {patParallels, "parallels", 0xFFFFFF00}, }; void clearAll() { @@ -2193,6 +2197,46 @@ namespace linepatterns { drawPattern(lp.id, col, c, V); } } + + transmatrix V = gmatrix[cwt.at]; + for(auto& lp: patterns) { + color_t col = lp.color; + if(!(col & 255)) continue; + if(lp.id == patCircles) + for(int i=15; i<=180; i+=15) { + for(int j=0; j<360; j+=15) { + for(int k=0; k<=15; k++) + curvepoint(xspinpush0((j+k) * degree, i * degree)); + queuecurve(col, 0, PPR::LINE).V=V; + } + } + if(lp.id == patRadii) + for(int i=0; i<360; i+=15) { + for(int j=0; j<180; j+=15) { + for(int k=0; k<=15; k++) + curvepoint(xspinpush0(i * degree, (j+k) * degree)); + queuecurve(col, 0, PPR::LINE).V=V; + } + } + if(lp.id == patMeridians) { + for(int j=-180; j<=180; j+=15) { + for(int i=-90; i<90; i+=15) { + for(int k=0; k<=15; k++) + curvepoint(V * xpush(j * degree) * ypush0((i+k) * degree)); + queuecurve(col, 0, PPR::LINE).V=V; + } + } + } + if(lp.id == patParallels) { + for(int i=-90; i<=90; i += 15) { + for(int j=-180; j<180; j+=15) { + for(int k=0; k<=15; k++) + curvepoint(V * xpush((j+k) * degree) * ypush0(i * degree)); + queuecurve(col, 0, PPR::LINE).V=V; + } + } + } + } } int numpat = 0;