Skip to content

Commit

Permalink
Merge remote-tracking branch 'origin' into msvc-support-make
Browse files Browse the repository at this point in the history
  • Loading branch information
jamievlin committed Aug 16, 2024
2 parents 1796553 + c2e57e1 commit 315d795
Show file tree
Hide file tree
Showing 17 changed files with 38 additions and 103 deletions.
2 changes: 1 addition & 1 deletion configure.ac
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
# this file.

AC_PREREQ(2)
AC_INIT([Asymptote],[2.91git],[https://github.com/vectorgraphics/asymptote/issues])
AC_INIT([Asymptote],[2.92git],[https://github.com/vectorgraphics/asymptote/issues])
VERSION=$PACKAGE_VERSION
AC_SUBST(VERSION)
m4_include([ax_pthread.m4])
Expand Down
8 changes: 4 additions & 4 deletions doc/asymptote.texi
Original file line number Diff line number Diff line change
Expand Up @@ -201,7 +201,7 @@ Labels and equations are typeset with @code{LaTeX}, for overall document
consistency, yielding the same high-quality level of typesetting that
@code{LaTeX} provides for scientific text. By default it produces
@code{PostScript} output, but it can also generate @code{OpenGL}, @code{PDF},
@code{SVG}, @code{WebGL}, @code{V3D}, and @code{PRC} vector graphics,
@code{SVG}, @code{WebGL}, @code{V3D}, and legacy @code{PRC} vector graphics,
along with any format that the @code{ImageMagick} package can
produce. You can even try it out in your Web browser without
installing it, using the @code{Asymptote Web Application}
Expand Down Expand Up @@ -8219,7 +8219,7 @@ options to the surface drawing routines, via arguments such as:
bool defaultnames; // assign default names to unnamed objects
interaction interaction; // billboard interaction mode
@end verbatim
along with the rendering parameters for the legacy PRC format
along with the rendering parameters for the legacy @acronym{PRC} format
described in @code{three.asy}.

@cindex image-based lighting
Expand Down Expand Up @@ -8253,7 +8253,7 @@ The examples @code{@uref{https://asymptote.sourceforge.io/gallery/3Dwebgl/vertex
vertex-dependent colors, which are supported by
@code{Asymptote}'s native @code{OpenGL}/@code{WebGL} renderers
and the two-dimensional vector output format (@code{settings.render=0}). Since
the @acronym{PRC} output format does not currently support vertex
the legacy @acronym{PRC} output format does not support vertex
shading of Bezier surfaces, @acronym{PRC} patches are shaded with the mean of the four vertex colors.

@cindex @code{surface}
Expand Down Expand Up @@ -8467,7 +8467,7 @@ with the setting @code{iconify=true}.

@cindex @code{prc}
@cindex @code{views}
@item Embed the 3D @acronym{PRC} format in a @acronym{PDF} file
@item Embed the 3D legacy @acronym{PRC} format in a @acronym{PDF} file
and view the resulting @acronym{PDF} file with
version @code{9.0} or later of @code{Adobe Reader}.
This requires @code{settings.outformat="pdf"} and @code{settings.prc=true},
Expand Down
75 changes: 14 additions & 61 deletions doc/extra/intro.asy
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
orientation=Landscape;

settings.tex="pdflatex";

orientation=Landscape;

import slide;
import three;
import animate;
Expand All @@ -10,14 +10,15 @@ bool long=true;

usepackage("mflogo");

usersetting();

viewportsize=pagewidth-2pagemargin;

// To generate bibliographic references:
usersetting();

// Commands to generate optional bibtex citations:
// asy -k intro
// bibtex intro_
// bibtex intro_
// asy -k intro

bibliographystyle("alpha");

itempen=fontsize(22pt);
Expand All @@ -30,7 +31,7 @@ titlepage(long ? "Asymptote: The Vector Graphics Language" :
"Department of Mathematical and Statistical Sciences\\
University of Alberta\\
%and Instituto Nacional de Matem\'atica Pura e Aplicada (IMPA)
\medskip\Green{Collaborators: Orest Shardt, Michail Vidiassov}",
\smallskip\Green{Collaborators: Orest Shardt, Michail Vidiassov}",
"June 30, 2010",
"https://asymptote.sourceforge.io/intro.pdf");

Expand Down Expand Up @@ -196,6 +197,7 @@ draw(g--cycle,dashed);
add(output, currentpicture.fit(), (+0.5inch, 0), E);
restore();
erase(); // Suppress implicit shipout of currentpicture.
shipout(output);
"));

Expand Down Expand Up @@ -350,7 +352,7 @@ item("The resulting shape may be adjusted by modifying optional {\it tension\/}
title("Hobby's 2D Control Point Algorithm");
item("Having prescribed outgoing and incoming path directions $e^{i\theta}$
at node~$z_0$ and $e^{i\phi}$ at node $z_1$ relative to the
vector $z_1-z_0$, the control points are determined as:");
vector $z_1-z_0$, the control points are determined as:");

equations("u&=&z_0+e^{i\theta}(z_1-z_0)f(\theta,-\phi),\nonumber\\
v&=&z_1-e^{i\phi}(z_1-z_0)f(-\phi,\theta),");
Expand Down Expand Up @@ -390,7 +392,7 @@ item("Must reduce to 2D algorithm in planar case.");
item("Determine directions by applying Hobby's algorithm in the plane containing $z_{k-1}$, $z_k$, $z_{k+1}$.");

// Reformulate Hobby's equations in terms of the angle $\psi_k=$
item("The only ambiguity that can arise is the overall sign of the angles, which relates to viewing each 2D plane from opposing normal directions.");
item("The only ambiguity that can arise is the overall sign of the angles, which relates to viewing each 2D plane from opposing normal directions.");

item("A reference vector based on the mean unit normal of successive segments can be used to resolve such ambiguities \cite{Bowman07,Bowman09}");

Expand Down Expand Up @@ -436,65 +438,15 @@ title("Smooth 3D surfaces");
asyinclude("../examples/sinc",25cm);

title("Curved 3D Arrows");
asyinclude("../examples/arrows3",20cm);
asyinclude("../examples/arrows3",16cm);

title("Slide Presentations");
item("Asymptote has a module for preparing slides.");
item("It even supports embedded high-resolution PDF movies.");

code('
title("Slide Presentations");
item("Asymptote has a module for preparing slides.");
item("It even supports embedded high-resolution PDF movies.");
');
remark("\quad\ldots");

import graph;

pen p=linewidth(1);
pen dotpen=linewidth(5);

pair wheelpoint(real t) {return (t+cos(t),-sin(t));}

guide wheel(guide g=nullpath, real a, real b, int n)
{
real width=(b-a)/n;
for(int i=0; i <= n; ++i) {
real t=a+width*i;
g=g--wheelpoint(t);
}
return g;
}

real t1=0;
real t2=t1+2*pi;

picture base;
draw(base,circle((0,0),1),p);
draw(base,wheel(t1,t2,100),p+linetype("0 2"));
yequals(base,Label("$y=-1$",1.0),-1,extend=true,p+linetype("4 4"));
xaxis(base,Label("$x$",align=3SW),0,p);
yaxis(base,"$y$",0,1.3,p);
pair z1=wheelpoint(t1);
pair z2=wheelpoint(t2);
dot(base,z1,dotpen);
dot(base,z2,dotpen);

animation a;

int n=25;
real dt=(t2-t1)/n;
for(int i=0; i <= n; ++i) {
picture pic;
size(pic,24cm);
real t=t1+dt*i;
add(pic,base);
draw(pic,circle((t,0),1),p+red);
dot(pic,wheelpoint(t),dotpen);
a.add(pic);
}

display(a.pdf(delay=150,"controls"));

title("Automatic Sizing");
item("Figures can be specified in user coordinates, then
Expand Down Expand Up @@ -584,6 +536,7 @@ pen p=fontsize(30pt);
frame f;
label(f, \"$E=mc^2$\", p);
draw(f, box(min(f),max(f)));
erase(); // Suppress implicit shipout of currentpicture.
shipout(f);
"));

Expand Down Expand Up @@ -681,7 +634,7 @@ item("Rest arguments allow one to write a function that takes an arbitrary
number of arguments:");
code("
int sum(... int[] nums) {
int total=0;
int total=0;
for(int i=0; i < nums.length; ++i)
total += nums[i];
return total;
Expand Down
1 change: 0 additions & 1 deletion examples/RiemannSphere.asy
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@ import graph3;
import solids;

currentlight=White;
defaultrender.merge=true;

size(10cm,0);

Expand Down
2 changes: 0 additions & 2 deletions examples/arrows3.asy
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,6 @@ import three;

size(15cm);

defaultrender.merge=true;

currentprojection=perspective(24,14,13);
currentlight=light(gray(0.5),specularfactor=3,
(0.5,-0.5,-0.25),(0.5,0.5,0.25),(0.5,0.5,1),(-0.5,-0.5,-1));
Expand Down
3 changes: 0 additions & 3 deletions examples/clockarray.asy
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,6 @@ int ny=4;
real xmargin=1cm;
real ymargin=xmargin;

size(settings.paperwidth,settings.paperheight);

picture pic;
real width=settings.paperwidth/nx-xmargin;
real height=settings.paperheight/ny-ymargin;
Expand Down Expand Up @@ -36,4 +34,3 @@ pair size=size(f)+(xmargin,ymargin);
for(int i=0; i < nx; ++i)
for(int j=0; j < ny; ++j)
add(shift(realmult(size,(i,j)))*f);

4 changes: 0 additions & 4 deletions examples/cyclohexane.asy
Original file line number Diff line number Diff line change
Expand Up @@ -36,16 +36,13 @@ triple h12=rotate(120,c6,c5)*h11;

pen Black=gray(0.4);

defaultrender=render(compression=Zero,merge=true);

draw(shift(c1)*carbon,Black);
draw(shift(c2)*carbon,Black);
draw(shift(c3)*carbon,Black);
draw(shift(c4)*carbon,Black);
draw(shift(c5)*carbon,Black);
draw(shift(c6)*carbon,Black);


material White=material(diffusepen=gray(0.4),emissivepen=gray(0.6));

draw(shift(h1)*hydrogen,White);
Expand All @@ -61,7 +58,6 @@ draw(shift(h10)*hydrogen,White);
draw(shift(h11)*hydrogen,White);
draw(shift(h12)*hydrogen,White);


pen thick=linewidth(10);

draw(c1--c2--c3--c4--c5--c6--cycle,thick);
Expand Down
2 changes: 0 additions & 2 deletions examples/elevation.asy
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,6 @@ currentprojection=orthographic(0.8,1,1);

size(400,300,IgnoreAspect);

defaultrender.merge=true;

real f(pair z) {return cos(2*pi*z.x)*sin(2*pi*z.y);}

surface s=surface(f,(-1/2,-1/2),(1/2,1/2),50,Spline);
Expand Down
2 changes: 0 additions & 2 deletions examples/extrudedcontour.asy
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,6 @@ import contour;
import palette;
import graph3;

defaultrender.merge=true;

currentprojection=orthographic(dir(60,25));
size(0,12cm);
real a=3;
Expand Down
5 changes: 3 additions & 2 deletions examples/pdb.asy
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,9 @@ import cpkcolors;
currentlight=White;
//currentlight=nolight;

defaultrender.merge=true; // Fast low-quality rendering
//defaultrender.merge=false; // Slow high-quality rendering
//defaultrender.merge=true; // Fast low-quality PRC rendering
//defaultrender.merge=false; // Slow high-quality PRC rendering

bool pixel=false; // Set to true to draw dots as pixels.
real width=6;

Expand Down
2 changes: 2 additions & 0 deletions examples/slidedemo.asy
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
settings.tex="pdflatex";

// Slide demo.
// Command-line options to enable stepping and/or reverse video:
// asy [-u stepping=true] [-u reverse=true] [-u itemstep=true] slidedemo
Expand Down
2 changes: 0 additions & 2 deletions examples/soccerball.asy
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,6 @@ size(400);
currentlight.background=palegreen;
settings.digits=15;

defaultrender=render(compression=Zero,merge=true);

real c=(1+sqrt(5))/2;

triple[] z={(c,1,0),(-c,1,0),(-c,-1,0),(c,-1,0)};
Expand Down
2 changes: 0 additions & 2 deletions examples/splitpatch.asy
Original file line number Diff line number Diff line change
Expand Up @@ -80,8 +80,6 @@ triple[][] B=

split S=split(B,A);

defaultrender.merge=true;

for(int i=0; i < S.S[0].s.length; ++i)
draw(surface(S.S[0].s[i]),Pen(i));

Expand Down
5 changes: 0 additions & 5 deletions examples/truncatedIcosahedron.asy
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,6 @@ import graph3;

size(200);

defaultrender.merge=true;

real c=(1+sqrt(5))/2;

triple[] z={(c,1,0),(-c,1,0),(-c,-1,0),(c,-1,0)};
Expand Down Expand Up @@ -64,6 +62,3 @@ for(int i=0; i < P.length; ++i) {
draw(surface(reverse(operator--(...fiveout)--cycle)^^
operator--(...fivein)--cycle,planar=true),cyan);
}



2 changes: 0 additions & 2 deletions examples/twistedtubes.asy
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,6 @@ s2.colors(palette(s2.map(f),Rainbow));
s3.colors(palette(s3.map(f),Rainbow));
s4.colors(palette(s4.map(f),Rainbow));

defaultrender.merge=true;

draw(s1);
draw(s2);
draw(s3);
Expand Down
12 changes: 8 additions & 4 deletions runsystem.in
Original file line number Diff line number Diff line change
Expand Up @@ -212,7 +212,10 @@ Int convert(string args=emptystring, string file=emptystring,
{
string name=convertname(file,format);
mem::vector<string> cmd;
cmd.push_back(getSetting<string>("convert"));
string s=getSetting<string>("convert");
cmd.push_back(s);
if(s == "magick")
cmd.push_back("convert");
push_split(cmd,args);
cmd.push_back(name);
bool quiet=verbose <= 1;
Expand All @@ -238,16 +241,17 @@ Int convert(string args=emptystring, string file=emptystring,
Int animate(string args=emptystring, string file=emptystring,
string format=emptystring)
{
#ifndef __MSDOS__
string name=convertname(file,format);
if(view()) {
mem::vector<string> cmd;
cmd.push_back(getSetting<string>("animate"));
string s=getSetting<string>("animate");
cmd.push_back(s);
if(s == "magick")
cmd.push_back("animate");
push_split(cmd,args);
cmd.push_back(name);
return System(cmd,0,false,"animate","your animated GIF viewer");
}
#endif
return 0;
}

Expand Down
Loading

0 comments on commit 315d795

Please sign in to comment.