Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ArrowHead3 not properly rotated in some non-pdf outputs #46

Closed
Doeme opened this issue Oct 30, 2017 · 8 comments
Closed

ArrowHead3 not properly rotated in some non-pdf outputs #46

Doeme opened this issue Oct 30, 2017 · 8 comments

Comments

@Doeme
Copy link

Doeme commented Oct 30, 2017

Hi

The TeXHead2 from three.asy looks rather ugly when rendered to PDF. Other outputs like .svg and .eps are fine though, as are .pdfs generated from .eps with epstopdf.

I attached a testfile, with a pdf and an eps rendering.
I'm using asymptote-2.41 and ghostscript-9.21 with Gentoo Linux.

Edit: Other ArrowHeads2 are affected too, not only TeXHead2
Edit2: Additionally, it seems that ArrowHeads3 (like DefaultHead3) aren't rotated properly in .eps-output

@charlesstaats
Copy link
Contributor

The way TeXHead2 (and other ArrowHeads2) work is to literally draw 3d paths (or surfaces) approximating an arrowhead. It's not going to look good when the arrow is pointed toward or away from the camera (as in your example), but it will look okay when the arrow is pointed roughly perpendicular to the camera. Also it will look bad if you have interactive rotation.

The "good" appearance with the eps rendering is the actual bug here.

(Now, perhaps it would be nice to be able to specify an arrowhead that doesn't rotate, as in the eps version. But that's a feature request, not a bug report.)

@Doeme Doeme changed the title Ugly TeXHead2 in PDF-output ArrowHead3 not properly rotated in some non-pdf outputs Oct 31, 2017
@Doeme
Copy link
Author

Doeme commented Oct 31, 2017

Ah, yes, I see. I guess manual billboarding (i.e. EndArrow3(TeXHead2(normal=cameranormal))) would yield the better looking behaviour.

Also, I changed the title to match the actual bug.

@Doeme
Copy link
Author

Doeme commented Apr 3, 2018

When I rerun the test (modifying it to include settings.render=0, which I guess has not been necessary before), the problem seems to be still there.

With settings.render=10, it is fine though.

@johncbowman
Copy link
Member

Perhaps you are asking that TeXHead2 be drawn with billboard interaction (like labels)?
But which way should the arrowhead point when the stem is pointed directly at you?

If you want to interactively rotate the 3D diagram, you should use a proper 3D Arrowhead.

@Doeme
Copy link
Author

Doeme commented Apr 4, 2018

The "good" appearance with the eps rendering is the actual bug here.

Should I open up a new bug? I changed the bug title to match the actual bug, but if that is insufficient I'll happily open up a new one.

@johncbowman
Copy link
Member

I don't think there is a bug here but I think I found what is confusing you. You are comparing a
3D interactive vector (PRC) pdf file (with a vector preview of the 3D scene) to a 2D (flattened) eps file.

Here is how to get consistent 2D (flattened) output for eps and pdf:

asy -V test -f eps -render=0
asy -V test -f pdf -render=0 -noprc

PDF is a special case because by default (without -noprc) 3D PRC content gets embedded, with a matching preview image.

If you view your test.pdf file with Acrobat Reader and click on it to activate it, you will see that the preview image must appear as it is in order to match the 3D content.

@Doeme
Copy link
Author

Doeme commented Apr 4, 2018

Ah, yes, in deed, you're right. Setting -noprc results in the same output on both eps and pdf.

Yet, this still leaves a discrepancy between -render=0 and -render=10.

Render 0

render0

Render 10

render10

@johncbowman
Copy link
Member

See the discussion about render=0 throughout the manual. It is intended as a rough attempt to flatten a 3D scene to a 2D vector format (without rendering) and is far from complete (for example, no hidden surface removal). Try using render=0 on the teapot example and you will see that this option is not intended for general use.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants