Asymptote is a TeX-aware vector graphics language with built-in 3D capabilities. This tag, which is compatible with [tag:diagrams], may be used for questions about drawing diagrams. It is also appropriate for questions about the asymptote package, which allows Asymptote code to be included directly ...

learn more… | top users | synonyms

3
votes
1answer
39 views

Asymptote: spring along an arc

I wish to know how to draw a spring along an arc using Asymptote Using import spring and drawspring(length,label) can only draw a spring along a straight line. In TikZ this drawing an spring along an ...
1
vote
0answers
44 views

How to improve the 3d effect of sphere in asymptote?

I try to use asymptote to plot the lattice. But the 3d effect of sphere is not so good. I need to use opacity(0.3) function, since I need to plot inside the sphere other elements. Currently, it looks ...
6
votes
1answer
77 views

Baffling interaction of Asymptote and Transparency

Context: I'm trying to use Asymptote to draw explanatory arrows and comments atop a semitransparent lstlisting environment. In the course of doing so I've encountered a bizarre interaction between ...
1
vote
2answers
89 views

Tikz curve without control points

Is there a way in Tikz to draw a smooth curve that passes through some specified points without the need of specifying control points, like you can do in Asymptote? For example, in Asymptote I can do ...
4
votes
1answer
31 views

Control distance of label from point in asymptote

I'm making a diagram for a solution on the AoPS wiki and some of the labels are a little too close for comfort. Is there a way I can move a label farther from what I'm labeling? I have the following ...
7
votes
1answer
109 views

Automatically draw hidden portions of paths with dashed lines in asymptote

In a great answer to another question of mine about asymptote, @Paolo Brasolin managed to draw the hidden portion of a path with dashed lines. But, as far as I understand, it is not automated and ...
2
votes
1answer
28 views

Aligned pictures in Asymptote depending on Label?

I have a confusing problem with Asymptote. I want to draw a contour plot and a surface plot side-by-side and try this code: settings.outformat="pdf"; settings.render=8; settings.prc=false; import ...
2
votes
1answer
66 views

font() pen only works once, then falls back to default font

I'm trying to draw a bunch of labels with a custom font, installed in ~/Library/Fonts. To do this, I create a pen using font() and then use that pen with label(): pen font_pen = font("DejaVuSans", ...
2
votes
1answer
25 views

Set absolute page size without scaling in asymptote

This is not the first time trying to solve this problem, which is why I'm writing a self-answered question, after spending another hour to re-discover a solution. How do I force Asymptote to output a ...
19
votes
2answers
376 views

Illustrating Stokes theorem with asymptote

I want to use asymptote to illustrate Stokes theorem as in the following figure. Here is what I've done so far. import three; size(6cm,0); path path2D = (1, 0) .. (2, 1) .. (0, 2) .. (-2.25, 1) ...
3
votes
0answers
41 views

Asymptote: Label a point on surface

I have the code for planes intersecting a hyperboloid from a previous thread (see below) and I now want to label the upper point where the hyperboloid intersects the vertical axis as A. If I try to ...
7
votes
2answers
206 views

How to draw a ruby laser

I would like to draw a ruby laser like in images bellow or What I did so far is taken from How can I draw nucleosomes with wrapped DNA in tikz or pstricks?. The problem is that the glass tube around ...
4
votes
1answer
180 views

How to draw a real corkscrew

I would like to draw a real screw like in image below. Any codes in tikz, asymptote or pstricks are welcomed! In order do not confuse with my linked question about laser who as well is based on ...
3
votes
1answer
150 views

Algebraic curves in TikZ or Asymptote

I want to draw algebraic curves in asymptote, but I do not know how this works. Has anyone an example? If we want to plot for example k[x,y]/\langle x^2+y^2-1\rangle, where can I input the equation ...
7
votes
1answer
146 views

Render stl files in asymptote

I want to draw a propeller in 3D for my fluid dynamics lecture. I found a 3D model of a propeller that can be downloaded as a stl file. I found a python library numpy-stl that can read and draw, with ...
2
votes
1answer
46 views

Asymptote and Exsheets

How can I use asymptote language inside an exsheets question? For example, the code below will compile perfectly fine. But if the asypicture environment is moved inside the exsheets question ...
0
votes
1answer
50 views

How to set up latex-suite to compile asymptote in tex files?

I am using vim with latex-suite to compile to pdf. With the following in filename.tex: \usepackage{asymptote} ... \begin{asy} ... \end{asy} ... The file filename-1.asy is produced (and the log ...
0
votes
0answers
125 views

Draw a simplicial complex

In a paper I'm writing using TeX I would like to include some pictures of Euclidean simplicial complexes. How can I draw an Euclidean simplicial complex embedded in R^3? That is, given a set of ...
1
vote
0answers
56 views

Asymptote in plain TeX [closed]

Is there a way to directly embed Asymptote code in plain TeX as it can be done in LaTeX? (For example by using miniltx or something like that?) Can labels in figures be typeset using plain TeX instead ...
0
votes
1answer
57 views

Integrating Asymptote into Latex

Well, I'm trying to integrate Asymptote into my TexShop, which I have been unsuccessful in so far. I've tried http://asymptote.sourceforge.net/TeXShopAndAsymptote.pdf But once I get to the cd ...
3
votes
1answer
66 views

Draw ontop of a graphic inserted using label(graphic(…), …)

I'd like to use Asymptote to compose an existing EPS file and draw some stuff onto it. I'm doing this using the suggested method of using label() and graphic() to place the EPS file on the canvas. The ...
1
vote
0answers
91 views

Asymptote: Intersect Line with Plane, z-order not correct

Hello TeX Stackoverflow! I have a question about 3D plotting in Asymptote. I want to produce a very simple 3D sketch of a line intersecting two planes, but I have trouble making it look "realistic": ...
2
votes
1answer
93 views

Installing the olympiad package on Mac

I've been trying to install the [Olympiad package][1] for asymptote on my Mac to use in TexShop, but I have no idea where to install it. I've tried to move the olympiad.asy file into the ...
3
votes
1answer
87 views

Adjust axes to plotted surface in Asymptote

I am plotting several parametric surfaces with Asymptote. When I change the parameters (tyMax in the MWE below), the value of the function can change significantly so I have to adjust the axes ...
5
votes
2answers
128 views

Solving an ODE in Asymptote

I am trying to graph a space curve from its curvature and torsion using Asymptote but cannot get the ODE solver to work in this case: import ode; real kappa(real t){return 1;} real tau(real ...
2
votes
1answer
101 views

Asymptote error in plain_Label.asy

I'm trying to compile the Asymptote script fig0090.asy from http://www.piprime.fr/files/asymptote/graph3/index.html by running asy fig0090.asy in the command line but I get the error ...
1
vote
0answers
97 views

Asymptote Animations

I am trying to define a type animation with Asymptote as follows. animation interf(real lambda,int n=20, int M=2, pair xyMin, pair xyMax){ animation A; // picture pic; pen[] ...
3
votes
1answer
69 views

How do I run Asymptote in batch mode, without creating windows?

I am using asymptote to generate lots of images in a LaTeX document. The images are translated from asymptote to PDF as this: pdflatex text.tex asy text-*.asy pdflatex text.tex However, asymptote ...
4
votes
1answer
65 views

asymptote multiple graphics in single file

One of the features I've liked in metapost and missed in asymptote is the fact that (in metapost) I can write the code for many figures in a single file. metapost then generates indexed set of figures ...
3
votes
1answer
54 views

Latexmk and the location of Asymptote's generated files

I am trying out Asymptote with latexmk and I would like to automate the interaction. Consider the following latex document test.tex: \documentclass{minimal} \usepackage{asymptote} ...
3
votes
2answers
140 views

Asymptote: How can I mix two colours

In latex, I can mix two colours like RoyalBlue!25!white. In asymptote I want to use the same color. How do I do this? MWE where I would like to replace the RoyalBlue color of the material by the ...
6
votes
1answer
448 views

Asymptote: Why are objects closer to the camera smaller

In the following example you can see that the atom that is closest to the camera, is acutally smaller than the rest, even though it should be the other way around. Shouldn't it? Here the MWE: ...
1
vote
1answer
111 views

Asymptote: Arrow3 only has 3D arrow head

If I draw a Arrow3, it does not really look 3D-ish because the line is not shaded like a cylinder. How do I change this? Probably drawing the cylinder and arrow head manually together? How? Here is a ...
1
vote
1answer
43 views

Including an existing asymptote picture in a LaTeX document

I have a project laid out like this: a parent folder, a subfolder named Main where the parts for my projects as well as the macros used throughout are, and another Figures subfolder containing my ...
0
votes
1answer
38 views

Why does this elementary Asymptote code returns an error?

I have spent several hours on understanding why my code eventually produced an error (for a large enough number of loops). I reduced the problem to the following MWE: file fout=stdout; // to write on ...
4
votes
0answers
142 views

Transparent background in Asymptote animation

In my TeX distribution there are two Asymptote examples named inlinemovie.tex and inlinemovie3.tex. (They are also available here.) Quick question The two animations in inlinemovie.tex have ...
1
vote
0answers
79 views

Change font in Asymptote

How can I to change the font in Asymptote (to Palatino) with TeXMaker? If I try usepackage{"mathpazo"}; I get this error message: test.asy: 4.11: cannot call 'guide operator spec(pair z, int p)' ...
23
votes
5answers
628 views

Recreate the sphere in TeX.SX logo

I'm trying to recreate this But looking in this Meta question the only code provided doesn't give that output %!TEX TS-program = xelatex \documentclass{minimal} \usepackage{pst-solides3d} ...
2
votes
0answers
34 views

Wrong subpath with end intersection points

Apologies upfront for cross-posting. I've posted the same question in asymptote discussion forums. I'm trying to find out the outline of two intersecting triangles. I'm expecting the outline of ...
19
votes
8answers
987 views

Compute and draw a convex hull

How can I use TikZ (+ LuaTeX), PSTricks, MetaPost, Asymptote, etc. to draw the convex hull of a set of points specified in no particular order? Here's an example where the convex hull was computed by ...
3
votes
2answers
120 views

How to center a label inside a closed path in Asymptote?

I am new to Asymptote and I need a little help. I would like to place a label exactly in the center of a closed path, for example in a triangle: unitsize(1cm); size(4cm); draw((0, 0) -- (0, 3) -- (3, ...
1
vote
0answers
90 views

Asymptote label is messing up image in latex document

I'm a newbie to asymptote, using it to create geometry figures. I'm creating an eps file from asymptote code, and include that in tex document instead of including the entire code in asy environment. ...
3
votes
1answer
86 views

Reading and Writing Asymptote Paths to File

I want to read/write asymptote cyclic path definitions from/to files. For example, while running asymptote code, I want to build up an arbitrary cyclic path and write that path information to an ...
4
votes
1answer
117 views

Asymptote: re-use picture

I have drawn a picture using the asymptote package (\usepackage{asymptote}), and the environment \begin{asy}...\end{asy}. I want to recycle the code in the {asy} environment without have to copy-paste ...
2
votes
1answer
148 views

Include LaTeX commands from external file in asymptote file

I have many asymptote drawings in a .asy file whose generated pdf is included in a main.tex. I have many user-defined commands, like \vec or \vxi which I use in my current main.tex and I want to use ...
2
votes
1answer
90 views

Include section of existing drawing in a new Asymptote file

Experts, I have created a drawing using Asymptote. Now I would like to include a specific section of this drawing in a new .asy-File to make it larger and add some additional lines. Is there a smart ...
7
votes
2answers
139 views

Draw multiple curves at a constant distance from one another in asymptote

In asymptote, I would like to draw arbitrary paths as in the following image, but with multiple colors. In the example, the path shown in black is also drawn with two parallel red lines. I would ...
3
votes
0answers
77 views

Old asymptote code in LaTeX document does not work after asymptote upgrad

I have a LaTeX-document with embedded Asymptote code that works fine. That is, in Asymptote 2.15. When I upgraded to 2.32 and rerun, the program gets stuck on working on one of the graphs. Stuck, no ...
5
votes
2answers
230 views

How to draw a line between two circles?

I want to create a graph using Asymptote and this graph consists of quite some circles with lines between them. Let me give a small example using two circles. pair a1=(4.5,2); pair a2=(0,0); real ...
3
votes
1answer
124 views

“If” statement inside of Asymptote function

I want to plot the function f(x,y)=cos(y)sin(x)/x even when x=0 (the function is continuous at such points). I can create a function in Asymptote that plots this surface with triple f(pair t) {return ...