hp
toc

Nine marching rectangles

2022-05-14, post № 259

graphics, #text-graphics

Rasterizing the continuous most often proves to be a delicate enterprise. Going from the unfathomable depths of the reals to a mere finite amount of toggled bits already zaps both completeness as well as dense ordering. Adding to that, the miniscule amount of pixels contemporary displays have to offer makes sharp jumps a frequent occurrence, breaking the illusion of continuity entirely.

With a queasy feeling about the meaning of continuous perception lurking in the back of my mind, at a recent Bill Frisell concert I was inspired to try myself at more organically conducive discrete productions. Layered in between a mighty bass and a whisked drum, both innately transferring their pristinely real movement for me to hear, Mr. Frisell — illuminated by slowly wafting curvy patches — tuned some knobs of digital effects and managed not to break the fake.
A fan of monospaced 2:1 text, I decided to try and imitate the patches’ feel in a more blatently discrete manner. As such, I wrote a marching-squares-based character-targeting renderer for graph slabs \pi^{3\to2}_{\bullet\bullet\circ}(\left]-\varepsilon,\varepsilon\right[\ \cap\ \mathrm{graph}\,f) which uses only the symbols \._+| @^/.

       ..                .\_.                                                   
     ..                   .^\.                                                  
    ./.                     ||                                                  
    ||                      .\.                                                 
    ||                       ||                                                 
    ..                      .+|                                                 
     ..                     |@|                                                 
     .\_.                  .++.                                                 
      .^\.                .+@|                                                  
        ..._.           ._+@+.                                                  
          .^\___________+@@+.                                                   
            .^^^+@@@@@@@@@+.            .______________.                        
                .^^^^^^^^^.       ._____/^^^^^^^^^^^^^^. ._.                    
                            ._____+@@+^^.                .^...                  
                       .____+@@@@@+^^.                      ....                
                   .___+@@@@@@@@+^.                           .\.               
                .__+@@@@@@@@@+^^.                              .\.              
             .__+@@+^^^^^^^^^.                                  .\.             
          .__/^^^^^.                                             ||             
        ._/^^.                                                   ||             
      ._/^.                                                      ||             
     ./^.                                                       ./.             
   ._/.                                                        ./.              
   |+.                                                        ./.               
  ./.                                                       ....                
  ||                                                     ._...                  
  ||                                  .________________. .^.                    
  ||                               .__++^^^^^^^^^^^^^^^.                        
  ||                             ._++^^.                                        
  .\.                           .++^.                                           
   .\.                        ._/^.                                             
    .\_.                    ._/^.                                               
     .^...               ._..^.                                                 
        .. .__.     .__. .^.                                                    
           .^^.     .^^.                                                        
                                                                                
                                                                                
                                                                                
                                                                                
                                                                                

Source: nine-marching-rectangles.cpp

Jonathan Frech's blog; built 2024/12/19 23:13:08 CET