Hacker News new | past | comments | ask | show | jobs | submit login
Asymptote: 2D and 3D TeX-Aware Vector Graphics Language (asymptote.sourceforge.io)
109 points by smartmic on May 12, 2023 | hide | past | favorite | 9 comments



I love Asymptote, however, I still miss one feature: imagine a line and a surface, the line interects the surface; and I want to draw a picture where invsible part of the line is dashed.

There are discussions about the feature (solids?). As I underatand, for now, there's no built-in solution.

(I could calculate coordinates of invisible part of the line, but it requires some time)


Is asymptote easier than LaTeX TikZ?

https://www.overleaf.com/learn/latex/TikZ_package


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.


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.


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.)


Ah proud to see another great product from my alma mater - University of Alberta.


This is pretty fun - used it to generate diagrams for my book!


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.


Oh man; I'm checking this out. Plaudits!!!!




Join us for AI Startup School this June 16-17 in San Francisco!

Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: