6

In Asymptote 3D, I need to draw surfaces with more than 4 vertices, but when I do, either it simply doesn't work (I can't reproduce this in a simple example, but can provide a more complicated case where this happens if it is helpful) or a seam appears, as in the example below:

settings.prc = false;
defaultpen(fontsize(10pt));
import three;
import graph3;
import patterns;
size(11cm,0);

currentprojection=perspective((10,-20,10));
currentlight = (3,-2,3);

render render = render(compression=Low, merge = true);

draw(surface((0,0,0) -- (1,0,0) -- (1,1,0) -- (0.5,1.5,0) -- (0,1,0) -- cycle), lightblue+opacity(0.5), render);

Running this command

asy -noprc -render 0 -f pdf example.asy

gives the following image:

"House" generated by the code.

Is there a way to get rid of the dark blue "seam?"

fltfan
  • 175
  • Currently this doesn't look like a tex question - asymptote and tex are not the same thing. Please add some more detail and include a minimal working example. –  Sep 22 '14 at 21:47
  • Hello, I compiled your example and I had no "seam" (in the OpenGL 3D-render, and in the final eps/png file) ? Could you precise asymptote version, system ? – O.G. Oct 28 '14 at 21:35
  • What command do you use to render this? Also, if you are generating a "vector" PDF it seems that is natural for overlaps to appear. I found this with TikZ/pgfplots for example: http://tex.stackexchange.com/questions/58227/is-there-any-way-to-remove-mesh-lines-completely-in-a-pgfplots-faceted-3d-plot – alfC Nov 13 '14 at 02:43
  • @Andrew Did you notice the asymptote tag? –  Dec 12 '14 at 21:11

1 Answers1

3

It seems that the "seam behavior" depends on the pdf viewer and the -render option. "Seam" problems appear with opacity and -render=0 option: depending on the pdf viewer the superposition of a common border of the two patches creates such a behavior.

With -noprc and -render=0, we have "seam" with Okular, acroread, gv (the image is vectorised). No "seam" with evince, mupdf, zathura. I have transparency problems with evince and zathura. mupdf is fine.

With -noprc (so the OpenGL render is used and a bitmap image is produced) there is no "seam" at all.

To be precise, all the version are up-to-date Debian Sid.

As explain in the documentation, -render=0 is very limited.

Paul Gessler
  • 29,607
O.G.
  • 3,375
  • Interesting, thank you. See my edited question to see the result when I get rid of "-render 0". – fltfan Feb 24 '15 at 13:14
  • Try the option -glOptions=-indirect. See the documentation http://asymptote.sourceforge.net/doc/three.html#three about some OpenGL driver problems. Try also asy -V interactive mode and keyboard e to export. – O.G. Feb 25 '15 at 20:56
  • I just tried it again, and apparently asy -noprc -f pdf example.asy works fine suddenly. (Adding -glOptions=-indirect works too, but apparently is not necessary.) Perhaps system updates fixed it? – fltfan Feb 27 '15 at 00:52