mirror of
				https://github.com/zenorogue/hyperrogue.git
				synced 2025-10-31 05:52:59 +00:00 
			
		
		
		
	aperiodic hat: formulas for the shape, better centering
This commit is contained in:
		| @@ -400,27 +400,33 @@ struct hrmap_hat : hrmap { | |||||||
|   vector<hyperpoint> hatcorners[2]; |   vector<hyperpoint> hatcorners[2]; | ||||||
|  |  | ||||||
|   void init() { |   void init() { | ||||||
|     auto pt = hpxy; |  | ||||||
|     hatcorners[0] = { |     transmatrix T = Id; | ||||||
|      pt(-1.1160254038,1.4330127019), |  | ||||||
|      pt(-0.0915063509,2.0245190528), |     auto move = [&] (ld angle, ld dist) { | ||||||
|      pt(0.2500000000,1.4330127019), |       hatcorners[0].push_back(T * C0); | ||||||
|      pt(-0.0915063509,0.8415063509), |       T = T * spin(angle * degree); | ||||||
|      pt(0.9330127019,0.2500000000), |       T = T * xpush(dist); | ||||||
|      pt(0.9330127019,-0.9330127019), |  | ||||||
|      pt(0.2500000000,-0.9330127019), |  | ||||||
|      pt(-0.0915063509,-1.5245190528), |  | ||||||
|      pt(-1.1160254038,-0.9330127019), |  | ||||||
|      pt(-2.1405444566,-1.5245190528), |  | ||||||
|      pt(-2.4820508076,-0.9330127019), |  | ||||||
|      pt(0,0), |  | ||||||
|      pt(-1.7990381057,0.2500000000), |  | ||||||
|      pt(-1.1160254038,0.2500000000), |  | ||||||
|       }; |       }; | ||||||
|     hatcorners[0][11] = mid(hatcorners[0][10], hatcorners[0][12]); |  | ||||||
|  |     ld eshort = 0.5; | ||||||
|  |     ld elong = sqrt(3) * eshort; | ||||||
|  |  | ||||||
|  |     move(-90, eshort); move( 60, eshort); move(  0, eshort); | ||||||
|  |     move( 60, eshort); move( 90, elong);  move(-60, elong); | ||||||
|  |     move( 90, eshort); move(-60, eshort); move( 90, elong); | ||||||
|  |     move( 60, elong);  move(-90, eshort); move( 60, eshort); | ||||||
|  |     move( 90, elong);  move(60, elong); | ||||||
|  |  | ||||||
|  |     hyperpoint ctr = C0; | ||||||
|  |     for(auto h: hatcorners[0]) ctr += h; | ||||||
|  |     ctr /= isize(hatcorners[0]); | ||||||
|  |     normalize(ctr); | ||||||
|  |     for(auto& h: hatcorners[0]) h = gpushxto0(ctr) * h; | ||||||
|  |  | ||||||
|     hatcorners[1] = hatcorners[0]; |     hatcorners[1] = hatcorners[0]; | ||||||
|     for(auto& h: hatcorners[1]) h = MirrorX * h; |     for(auto& h: hatcorners[1]) h = MirrorX * h; | ||||||
|     reverse(hatcorners[0].begin(), hatcorners[0].end()); |     reverse(hatcorners[1].begin(), hatcorners[1].end()); | ||||||
|     } |     } | ||||||
|  |  | ||||||
|   constexpr static int relations = 34; |   constexpr static int relations = 34; | ||||||
|   | |||||||
		Reference in New Issue
	
	Block a user
	 Zeno Rogue
					Zeno Rogue