[HN Gopher] Asymptote: 2D and 3D TeX-Aware Vector Graphics Language
       ___________________________________________________________________
        
       Asymptote: 2D and 3D TeX-Aware Vector Graphics Language
        
       Author : smartmic
       Score  : 63 points
       Date   : 2023-05-12 16:29 UTC (6 hours ago)
        
 (HTM) web link (asymptote.sourceforge.io)
 (TXT) w3m dump (asymptote.sourceforge.io)
        
       | rjrodger wrote:
       | This is pretty fun - used it to generate diagrams for my book!
        
         | a_e_k wrote:
         | Yep! I used it for all of the diagrams in my chapter (Ch. 31)
         | in Ray Tracing Gems 2.
         | 
         | My diagrams were showing lens optics and it was really nice to
         | be able to parameterize the main inputs (e.g., focal length,
         | sensor distance, object placement, etc.) and then let Asymptote
         | derive everything from there.
         | 
         | I could tweak the parameters and have it instantly recalculate
         | the diagram until I found something that looked good. All while
         | keeping everything placed consistently.
         | 
         | The other thing I did was to start by creating a single master
         | diagram that was super messy and cluttered but contained
         | _everything_ that I might want. Then I copied that and
         | selectively commented out parts, leaving just the elements that
         | I wanted to highlight.
         | 
         | I think I'd have gone crazy if I was trying to calculate and
         | draw everything to scale manually in Illustrator or something
         | like that, while making tweaks across all the figures to keep
         | them consistent.
         | 
         | And all was driven from a Makefile, of course.
        
       | hgsgm wrote:
       | Is asymptote easier than LaTeX TikZ?
       | 
       | https://www.overleaf.com/learn/latex/TikZ_package
        
         | arjvik wrote:
         | Tikz has a LaTeX-inspired syntax that's hard to understand
         | unless you're very competent with LaTeX. You will find yourself
         | constantly looking up syntax for things like loops until you're
         | used to Tikz.
         | 
         | Asymptote has a C-like syntax that's very easy to understand
         | and remember. Essentially the only new thing is the data types
         | (i.e. pair, pen) and literals for those types that Asymptote
         | introduces.
        
           | aziis98 wrote:
           | Yeah, I really like how they do operators. The ".."
           | concatenation operator is very nice to use and works well
           | even when used in "imperative" code. It's also nice that all
           | operators can be overloaded and the default overloads for
           | pairs and triples can make constructing 2d and 3d shapes very
           | concise.
           | 
           | It's a small language but with very reasonable syntax
           | decisions.
        
         | jimhefferon wrote:
         | I like it better. I used it for all the diagrams in my latest
         | book. I especially like the 3D. (BTW, the tutorial is first
         | rate.)
        
       ___________________________________________________________________
       (page generated 2023-05-12 23:00 UTC)