erreur de compilation 3D : stack overflow

Pour toute demande d'aide sur des exemples non finalisés, c'est ici.
Les exemples aboutis et intéressants seront ajoutés aux sous-forums qui suivent.

Règles du forum
Pour toute demande d'aide pour la conception (ou la confirmation d'un code) d'une figure Asymptote, c'est ici.

J'invite ceux qui ont régulièrement des questions à poser à aller dans leur panneau de l'utilisateur pour indiquer dans la signature de leurs messages :

  1. Nom du système d'exploitation (W7 ou Ubuntu 12.04 ou ...)
  2. Version d'Asymptote et éditeur utilisé pour les figures Asymptote
  3. Distribution LaTeX et éditeur utilisé pour les tex.


On va gagner du temps dans les réponses !
Avatar du membre
GM
Administrateur du site
Administrateur du site
Messages : 1512
Enregistré le : dim. 7 mars 2010, 14:50

Re: erreur de compilation 3D : stack overflow

Message non lu par GM » mer. 30 juin 2010, 16:58

chellier a écrit :Non... :(


J'essaie de me souvenir de ce que j'ai fait à ma dernière installation sous linux, sachant que c'était particulier, puisque c'était sous windows7/virtualbox... et comme je ne sais plus, je vais devoir recommencer.

Sans rien connaitre à glut, je lance une idée : libglut3 n'est pas une librairie satisfaisante... il faut obligatoirement freeglut dont parle la doc.

Je cite deux passages de la doc :

2.6 Compiling from UNIX source

To compile and install a UNIX executable from a source release x.xx, first execute the commands:

Code : Tout sélectionner

gunzip asymptote-x.xx.src.tgz
tar -xf asymptote-x.xx.src.tar
cd asymptote-x.xx

By default the system version of the Boehm garbage collector will be used; if it is old we recommend first putting
http://www.hpl.hp.com/personal/Hans_Boehm/gc/gc_source/gc-7.1.tar.gz in the Asymptote source directory.

If your graphics card supports multisampling, we recommend using version 2.6.0-rc1 (or later) of freeglut to support antialiasing in Asymptote’s adaptive OpenGL 3D renderer (MacOS X users can skip this step since Asymptote is configured to use the native glut library on that platform).
Download http://prdownloads.sourceforge.net/freeglut/freeglut-2.6.0.tar.gz
and type (as the root user):

Code : Tout sélectionner

tar -zxf freeglut-2.6.0.tar.gz
cd freeglut-2.6.0
./configure --prefix=/usr
make install
cd ..
Then compile Asymptote with the commands

Code : Tout sélectionner

./configure
make all
make install

Be sure to use GNU make (on non-GNU systems this command may be called gmake).
To build the documentation, you may need to install the texinfo-tex package.
If you get errors from a broken texinfo or pdftex installation, simply put http://asymptote.sourceforge.net/asymptote.pdf in the directory doc and repeat the command make all.
For a (default) system-wide installation, the last command should be done as the root user.

To install without root privileges, change the

Code : Tout sélectionner

./configure
command to

Code : Tout sélectionner

./configure --prefix=$HOME/asymptote


One can disable use of the Boehm garbage collector by configuring with ./configure --disable-gc.

For a list of other configuration options, say ./configure --help.

For example, one can tell configure to look for header files and libraries in nonstandard locations:
./configure CFLAGS=-I/opt/usr/include LDFLAGS=-L/opt/usr/lib

If you are compiling Asymptote with gcc, you will need a relatively recent version (e.g. 3.4.4 or later). For full interactive functionality, you will need version 4.3 or later of the GNU readline library.

The file gcc3.3.2curses.patch in the patches directory can be used to patch the broken curses.h header file (or a local copy thereof in the current directory) on some AIX and IRIX systems.

The FFTW library is only required if you want Asymptote to be able to take Fourier transforms of data (say, to compute an audio power spectrum).

The GSL library is only required if you require the special functions that it supports.

If you don’t want to install Asymptote system wide, just make sure the compiled binary asy and GUI script xasy are in your path and set the configuration variable dir to point to the directory base (in the top level directory of the Asymptote source code).



4 façons d'afficher de la 3D :

There are four choices for viewing 3D Asymptote output:

1.
Use the native Asymptote adaptive OpenGL-based renderer (with the command-line option -V and the default settings outformat="" and render=-1).

Ajout par GM : " Un commentaire personnel : il faut l'option -V sous unix (car l'option par défaut est -noV)........... mais pour les utilisateurs de Windows, c'est le contraire : -V est l'option par défaut et donc il pourra être utile de connaitre -noV par moments.

If you encounter warnings from your graphics card driver, try specifying -glOptions=-indirect on the command line.

On UNIX systems with graphics support for multisampling, we recommend installing the latest SVN (antialiased) version of the freeglut library
(see [multisampling], page 6); the sample width can be controlled with the setting multisample.
An initial screen position can be specified with the pair setting position, where negative values are interpreted as relative to the corresponding
maximum screen dimension.

The default settings

Code : Tout sélectionner

import settings;
leftbutton=new string[] {"rotate","zoom","shift","pan"};
middlebutton=new string[] {"menu"};
rightbutton=new string[] {"zoom/menu","rotateX","rotateY","rotateZ"};
wheelup=new string[] {"zoomin"};
wheeldown=new string[] {"zoomout"};

bind the mouse buttons as follows:
  • Left: rotate
  • Shift Left: zoom
  • Ctrl Left: shift viewport
  • Alt Left: pan
  • Middle: menu (must be unmodified; ignores Shift, Ctrl, and Alt)
  • Wheel Up: zoom in
  • Wheel Down: zoom out
  • Right: zoom/menu (must be unmodified)
  • Right double click: menu
  • Shift Right: rotate about the X axis
  • Ctrl Right: rotate about the Y axis
  • Alt Right: rotate about the Z axis
The keyboard shortcuts are:
  • h: home
  • f: toggle fitscreen
  • x: spin about the X axis
  • y: spin about the Y axis
  • z: spin about the Z axis
  • s: stop spinning
  • m: rendering mode (solid/mesh/patch)
  • e: export
  • c: show camera parameters
  • p: play animation
  • r: reverse animation
  • : step animation
  • +: expand
  • =: expand
  • >: expand
  • -: shrink
  • : shrink
  • <: shrink
  • q: exit
  • Ctrl-q: exit

2.
Render the scene to a specified rasterized format outformat at the resolution of n pixels per bp, as specified by the setting render=n.
A negative value of n is interpreted as |2n| for EPS and PDF formats and |n| for other formats.
The default value of render is -1.
By default, the scene is internally rendered at twice the specified resolution; this can be disabled by setting antialias=1.
High resolution rendering is done by tiling the image.
If your graphics card allows it, the rendering can be made more efficient by increasing the maximum tile size maxtile beyond the screen dimensions (indicated by maxtile=(0,0).
If your video card generates unwanted black stripes in the output, try setting the horizontal and vertical components of maxtiles to something less than
your screen dimensions.
The tile size is also limited by the setting maxviewport, which restricts the maximum width and height of the viewport.
On UNIX systems some graphics drivers support batch mode (-noV) rendering in an iconified window; this can be enabled with the setting iconify=true.
Some (broken) UNIX graphics drivers may require the command line setting -glOptions=-indirect, which requests (slower) indirect rendering.

3.
Embed the 3D PRC format in a PDF file and view the resulting PDF file with version 9.0 or later of Adobe Reader.
In addition to the default settings.prc=true, this requires settings.outformat="pdf", which can be specified by the command line option -f pdf, put in the Asymptote configuration file (see [configuration file], page 158), or specified in the script before three.asy (or graph3.asy) is imported.
Version 2008/10/08 or later of the movie15 package is also required (see Section 8.17 [embed], page 93).
The example pdb.asy illustrates how one can generate a list of predefined views (see 100d.views).
A stationary preview image with a resolution of n pixels per bp can be embedded with the setting render=n; this allows the file to be
viewed with other PDF viewers.
Alternatively, the file externalprc.tex illustrates how the resulting PRC and rendered image files can be extracted and processed in a separate
LaTeX file.
However, see Chapter 7 [LaTeX usage], page 82 for an easier way to embed three-dimensional Asymptote pictures within LaTeX.
The open-source PRC specification is available from
http://livedocs.adobe.com/acrobat_sdk/9/Acrobat9_HTMLHelp/API_References/PRCReference/PRC_Format_Specification/.

4.
Project the scene to a two-dimensional vector (EPS or PDF) format with render=0.
Only limited hidden surface removal facilities are currently available with this approach (see [PostScript3D], page 138).
Index des fonctions - Exemple de lien donnant le résultat d'une recherche sur les mots 'arc' et 'triple' : http://asy.marris.fr/indexasy/?filtre=arc triple
Mes configurations (le 24/02/21) :
PC n°1 :Windows 10 - Asymptote(2.82)+MikTeX2.9 - Editeurs : Notepad++, TeXworks, Visual Studio Code.
PC n°2 : Ubuntu 20.04LTS - Asymptote(2.67-?? git) + TexLive2020
Mon serveur : Debian Stretch- Asymptote(2.68-16 git) + TexLive2018
Merci de préciser la votre !

Avatar du membre
chellier
Messages : 104
Enregistré le : jeu. 18 mars 2010, 17:30

Re: erreur de compilation 3D : stack overflow

Message non lu par chellier » mer. 30 juin 2010, 17:09

En fait, de mémoire, freeglut s'installe avec libglut3, mais c'est la version des dépôts, et n'est donc pas la dernière. Il va falloir que j'essaye avec la dernière. .. mais pas tout de suite, je suis dans la salle d'attente du médecin avec une dizaine de personnes devant moi :mrgreen:

Christophe

gilles
Messages : 6
Enregistré le : sam. 19 juin 2010, 09:28

Re: erreur de compilation 3D : stack overflow

Message non lu par gilles » mer. 30 juin 2010, 17:47

Formidable !
la compilation par asy -V render -1 ouvre effectivement une fenêtre de visualisation, extrêmement fluide !
[img]
http://img641.imageshack.us/img641/1881/conef.jpg
[/img]
J'avais vainement cherché ce passage sur les différents modes de compilation dans la doc sans le trouver. Il faudra que je creuse.
Mes problèmes à moi sont donc résolus !
Merci à tous.

Gilles

Avatar du membre
GM
Administrateur du site
Administrateur du site
Messages : 1512
Enregistré le : dim. 7 mars 2010, 14:50

Re: erreur de compilation 3D : stack overflow

Message non lu par GM » mer. 30 juin 2010, 17:58

gilles a écrit :Formidable !
la compilation par asy -V render -1 ouvre effectivement une fenêtre de visualisation, extrêmement fluide !


En lisant cela, je viens de me souvenir ! Le comportement par défaut est différent sous windows et linux !!

JCBowman a écrit :P.S. I forgot that under MSWindows you also have to add the -noV option or -f eps option to force 3D output to be rendered to a 2D eps file. (Under UNIX, which I use exclusively, -noV is the default.)


gilles a écrit :asy -V render -1

Tu as voulu écrire -render au lieu de render...

... mais asy -V doit être suffisant, non ? (si tu ne mets pas de settings.render dans tes exemples, et si tu n'en as pas dans ton fichier de configuration config.asy)
Index des fonctions - Exemple de lien donnant le résultat d'une recherche sur les mots 'arc' et 'triple' : http://asy.marris.fr/indexasy/?filtre=arc triple
Mes configurations (le 24/02/21) :
PC n°1 :Windows 10 - Asymptote(2.82)+MikTeX2.9 - Editeurs : Notepad++, TeXworks, Visual Studio Code.
PC n°2 : Ubuntu 20.04LTS - Asymptote(2.67-?? git) + TexLive2020
Mon serveur : Debian Stretch- Asymptote(2.68-16 git) + TexLive2018
Merci de préciser la votre !

Avatar du membre
chellier
Messages : 104
Enregistré le : jeu. 18 mars 2010, 17:30

Re: erreur de compilation 3D : stack overflow

Message non lu par chellier » mer. 30 juin 2010, 19:05

GM a écrit :... mais asy -V doit être suffisant, non ?


En effet ! Je viens de comprendre plein de trucs d'un coup, notamment comment tu arrivais à obtenir les paramètres de la caméra :idea:

Christophe

Avatar du membre
GM
Administrateur du site
Administrateur du site
Messages : 1512
Enregistré le : dim. 7 mars 2010, 14:50

Re: erreur de compilation 3D : stack overflow

Message non lu par GM » mer. 30 juin 2010, 19:41

chellier a écrit :Je viens de comprendre plein de trucs d'un coup, notamment comment tu arrivais à obtenir les paramètres de la caméra :idea:
:D

Je n'ai percuté de suite pour le problème du -V, désolé... du fait que je n'ai jamais eu à le mettre personnellement.

Maitriser la bête sur son propre système, c'est déjà difficile... mais bien conseiller ceux des autres systèmes (quand le matériel a une importance, quand les installations sont aussi pointues et quand les comportements par défaut peuvent être différents) l'est encore plus.

Il va falloir que j'écrive noir sur blanc toutes ces subtilités avant la formation Asymptote que je vais devoir assumer en juin 2011.
Je songe même à traduire les passages de la doc rappelés dans mon message précédent pour les mettre en bonne place sur une page internet que l'on pourra mentionner aux nouveaux utilisateurs.

----------

Je crois que le sujet "erreur de compilation 3D : stack overflow" est clos depuis longtemps... et on s'en est écarté pas mal. :mrgreen:
Index des fonctions - Exemple de lien donnant le résultat d'une recherche sur les mots 'arc' et 'triple' : http://asy.marris.fr/indexasy/?filtre=arc triple
Mes configurations (le 24/02/21) :
PC n°1 :Windows 10 - Asymptote(2.82)+MikTeX2.9 - Editeurs : Notepad++, TeXworks, Visual Studio Code.
PC n°2 : Ubuntu 20.04LTS - Asymptote(2.67-?? git) + TexLive2020
Mon serveur : Debian Stretch- Asymptote(2.68-16 git) + TexLive2018
Merci de préciser la votre !

Avatar du membre
chellier
Messages : 104
Enregistré le : jeu. 18 mars 2010, 17:30

Re: erreur de compilation 3D : stack overflow

Message non lu par chellier » mer. 30 juin 2010, 21:52

En tout cas, merci Gaétan, j'ai pu résoudre mon problème de bandes noires dans la sortie pdf des figures 3D (sans prc) :
Dans le code :

Code : Tout sélectionner

settings.render=4;  // sinon la qualité n'est pas terrible
settings.outformat="pdf"; // ou rien si on veut un eps


Compilation : asy -V + export par la touche "e"

Y a pas à dire, on apprend des truc sur ce forum ;)

Christophe

Avatar du membre
GM
Administrateur du site
Administrateur du site
Messages : 1512
Enregistré le : dim. 7 mars 2010, 14:50

Re: erreur de compilation 3D : stack overflow

Message non lu par GM » jeu. 1 juil. 2010, 10:19

GM a écrit :Et, donc nous sommes bien trois à constater cet écart incroyable de durée pour l'apparition (quand on clique pour l'activer) de l'image PRC... selon que l'on a 1bp ou 2 bp. Je vais attendre de voir comment réagit JCBowman à mon premier message avant d'aller lui donner nos durées.

Sa réponse :

You can greatly speed up the loading in Adobe Reader of the second example like this:

Code : Tout sélectionner

import three; size(7.5cm,0);
defaultrender.merge=true;
path3 g=(1,0,0)..(0,1,1)..(-1,0,0)..(0,-1,1)..cycle;
draw(g,2bp+.8red);


C'est vrai qu'il n'y a pas photo... pour la rapidité, mais j'aurais préféré une réponse du style : "il y a un bogue que j'ai résolu dans la nouvelle version".
Index des fonctions - Exemple de lien donnant le résultat d'une recherche sur les mots 'arc' et 'triple' : http://asy.marris.fr/indexasy/?filtre=arc triple
Mes configurations (le 24/02/21) :
PC n°1 :Windows 10 - Asymptote(2.82)+MikTeX2.9 - Editeurs : Notepad++, TeXworks, Visual Studio Code.
PC n°2 : Ubuntu 20.04LTS - Asymptote(2.67-?? git) + TexLive2020
Mon serveur : Debian Stretch- Asymptote(2.68-16 git) + TexLive2018
Merci de préciser la votre !

Répondre