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

5
votes
0answers
35 views

Export matplotlib triangle mesh to an asymptote surface

This is a followup of a question of mine at stackoverflow partially reproduced here for clarity. I'm playing a bit with scikit-image marching cubes algorithm. Here is a simplified version of the ...
1
vote
0answers
80 views

Plane intersecting sphere

I have made this in matematica, but I need similar picture in metapost. Any ideas how to do so? sl3d1 = Graphics3D[{{Opacity[.5], Sphere[{0, 0, 0}, 1]}, {PointSize[.02], ...
1
vote
0answers
25 views

Asymptote out-of-memory error when plotting many points

I am using Asymptote 2.37 on Windows 7. I'm trying to make some large scatter plots but get a memory error. When trying to process the following MWE unitsize(10inch); for (int i = 0; i < 140000; ...
2
votes
0answers
47 views

How to use Asymptote system() command

Edit: I have since upgraded to release 2.37 with the same result. I'm running asymptote 2.15 on Windows 7. I'm trying to use the int system(string s) command for the first time to call a system ...
1
vote
1answer
43 views

Asymptote (XeLaTeX): Use custom-defined colors/Call drawing functions from external file

I'm quite new to Asymptote, although it's great to manipulate vector graphics within LaTeX. Specifically, I'm using XeLaTeX. What I'm trying to do is to change the color of a vector graphic to ...
5
votes
1answer
88 views

Asyptote Unofficial package arrows_pi.asy not respecting order of points for vertical arrows

For example draw((0.5,0)--(.5,1), EdgeArrows(), p=red); and draw((0.5,1)--(.5,0), EdgeArrows(), p=red); give identical results. Website: corrected after this question original package (before ...
3
votes
1answer
45 views

Draw a 3D SrTiO3 structure

I want to draw a Strontium titanate structure by modifying the code given by @strpeter and @PatrickT at page Draw a 3D diamond structure . But unfortunately the rod between the Ti and the bottom O ...
8
votes
2answers
71 views

Asymptote slopefield

The optional arrows in slopefield.asy do not work correctly for dy/dx=-x/y. I can't think of a generic (elegant) way to make them work using its current methodology. Here is an mwe adapted from k.gov: ...
1
vote
0answers
139 views

configuring MiKTeX and asymptote

I recently installed and used MiKTeX successfully on a brand new Windows 10 laptop. However, I had trouble with Asymptote. The first time I ran Asymptote from the command line, I typed this: asy -f ...
4
votes
1answer
82 views

Patterns in SVG

I am trying to fill an irregular 2D shape with the hatch pattern in Asymptote and output it as svg. The result is a low resolution pixelated raster image. Is there a way to produce a vector pattern ...
2
votes
0answers
44 views

How to embed Asymptote 3D objects in Latex code when using Overleaf?

This is my MWE: \documentclass{minimal} \usepackage[inline]{asymptote} \begin{document} Test. \begin{asydef} usepackage("bm"); texpreamble("\def\V#1{\bm{#1}}"); \end{asydef} 2d figure: ...
2
votes
1answer
81 views

using Asymptote with Miktek, Texmaker, Windows7, ASYalign undefined

I'm am new to Latex and Texmaker, and loving it. I'm using the MikTek distribution on Windows 7. Now I want to integrate Asymptote figures into my documents. I installed Asymptote from here: ...
2
votes
0answers
68 views

Force acrobat to render asymptote's figure with antialias [closed]

Does anybody know how to force Acrobat to display interactive 3D objects created by Asymptote with nice antialiasing? (during PRC interaction). In Acrobat Linux 9.4, I see this (note the pixelated ...
0
votes
1answer
39 views

Sublime Text 3 with LaTeXTools failed to handle tex with asymptote

I'm using sublime with Latextools addon to edit my tex files, if the tex file includes \begin{asy}\end{asy} environment, the Asymptote codes will not work with a warning, Package asymptote Warning: ...
4
votes
1answer
51 views

Asymptote: have stuff outside the box

I'm using Asymptote to draw my graphics. I am making a graph of arctan. I want to label the graph, but I want the label to poke outside the bounding box. I want this because if I just let ...
3
votes
0answers
45 views

Search an element in array in Asymptote

In asymptote, I have two arrays int[ ] a = {1, 2, 3, 4 }; int[] b = {2, 3 }; I would like to get the intersection of these two arrays i.e 1, 4. I can write a function to do this, but is there a ...
3
votes
1answer
53 views

How to write a function in Asymptote

I have a code that draws a couple of rings on a plane and I would like to be able to define a function, taking the radius, center and color as an argument to be able to draw a substantial number of ...
6
votes
1answer
101 views

Asymptote Shading Gradient in HSV Color Space

Using asymptote I'm trying to fill shapes with gradient shading in the HSV color space. Unfortunately, I think that HSV is not an available color space in asymptote. However, asymptote does have the ...
3
votes
1answer
73 views

Fill sector of ellipse with asymptote

I've already got an ellipse in Asymptote in nice need polar coordinates, but I am trying to illustrate Kepler's Second Law, and it would be nice to fill sectors from one of the foci. I've already got ...
2
votes
0answers
59 views

how to have transparent background in 3d plot of asymptote?

how to have transparent background in 3d plot of asymptote? Any idea? Suppose we save the output in png format, we can have transparent background in 2d plot of asymptote using the following, ...
2
votes
2answers
73 views

tree (sequence) diagram in Asymptote

I want to draw tree diagram with Asymptote. But have some problems. I searched and found 2 hints on the web. http://asymptote.sourceforge.net/FAQ/section4.html ...
3
votes
1answer
54 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
84 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
96 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
105 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
53 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 ...
8
votes
1answer
146 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
40 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
75 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
45 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
448 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
63 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
265 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 ...
3
votes
1answer
224 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
191 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
252 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
64 views

Asymptote and Exsheets [duplicate]

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
71 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 ...
1
vote
0answers
58 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
2answers
99 views

Integrating Asymptote into TeXShop

I'm trying to integrate Asymptote into my TeXShop, which I have been unsuccessful in so far. I've tried the instructions given in the document Integrating Asymptote and TeXShop for Mac OS X, but once ...
3
votes
1answer
96 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 ...
2
votes
0answers
123 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
122 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
92 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
150 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
158 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
122 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
86 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
96 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
69 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} ...