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

1
vote
0answers
50 views

Can't select text in PDF created using Asymptote

I am making 3D diagrams using Asymptote, export them as PDF and then use them in LaTeX documents. I cannot select the text/labels inserted in the pictures/diagram in the final PDF of the LaTeX ...
1
vote
0answers
34 views

Asymptote or pst-solides3d for 3d figure

I want to draw three dimensional figures and diagrams for my physics classes. Some examples of drawing can be various crystal structures in various orientations, various planes in them, three ...
10
votes
3answers
124 views

Draw border of a line

I have a line like this: line.tex: \documentclass[12pt]{article} \usepackage{asymptote} \begin{document} \begin{asy} unitsize(1cm); defaultpen(0.5cm); draw((0,0)--(1,1)); \end{asy} \end{document} ...
1
vote
0answers
20 views

After use of \def\asydir{filename} asymptote cannot find files

After I use \def\asydir{asyfiles}, asymptote cannot seem to find the .asy files any more. I have tried asy.exe asyfiles/[filename]-*.asy, but it doesn't work (both \ and /). Could someone please tell ...
1
vote
1answer
42 views

Asymptote Files

Whenever I use Asymptote with Latex, each instance of the environment gets its own new file. This creates a large amount of files. Is there any way to get all of these files placed into another folder ...
5
votes
0answers
54 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 ...
2
votes
0answers
88 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
33 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
53 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
53 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
90 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
47 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
77 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
145 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
85 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
50 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
93 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
71 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
40 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
54 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
47 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 ...
4
votes
1answer
56 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
118 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
77 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
68 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
77 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 http://asymptote.sourceforge.net/doc/...
3
votes
1answer
56 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
93 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
98 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
108 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
54 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
151 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
43 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", 24)...
2
votes
1answer
53 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
463 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
67 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
270 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
232 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
204 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
273 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
71 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
76 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
59 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
111 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
107 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
128 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
127 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 Library\...
3
votes
1answer
93 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 (xmin,...
5
votes
2answers
153 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 t){...