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

3d graphics: unintentional mutation #17258

Closed
williamstein opened this issue Oct 30, 2014 · 8 comments
Closed

3d graphics: unintentional mutation #17258

williamstein opened this issue Oct 30, 2014 · 8 comments

Comments

@williamstein
Copy link
Contributor

This is a significant bug in the 3d graphics that Theron Hitchman found. It's easy to replicate on the command line, and doesn't involve actually rendering anything. Basically, in some cases, if g and h are 3d scenes, then doing "k = g+h" actually mutates g itself. This ends up breaking multi-step constructions of scenes (e.g., [1]).

sage: g = point3d([0,-2,-2]); g += point3d([2,-2,-2])
sage: print len(g.all)
2
sage: h = g + arrow([0,-2,-2], [2,-2,-2])   # this should *NOT* change g
sage: print len(g.all)   # it changed g
3

[1] https://cloud.sagemath.com/projects/d115ee6d-f378-4f70-b400-0f2aba16f10c/files/ProjectionOntoAPlane.sagews

Component: graphics

Author: Frédéric Chapoton

Branch/Commit: 7b1682a

Reviewer: Karl-Dieter Crisman

Issue created by migration from https://trac.sagemath.org/ticket/17258

@williamstein williamstein added this to the sage-6.4 milestone Oct 30, 2014
@fchapoton
Copy link
Contributor

Commit: 7b1682a

@fchapoton
Copy link
Contributor

Branch: u/chapoton/17258

@fchapoton
Copy link
Contributor

New commits:

7b1682atrac #17258 add method of Graphic3dGroup should copy its argument

@fchapoton
Copy link
Contributor

Author: Frédéric Chapoton

@kcrisman
Copy link
Member

comment:2

Wow, interesting bug, and relatively subtle since people usually just add plots willy-nilly. I'll try to confirm this works right in a few minutes, but the code seems fine.

@kcrisman
Copy link
Member

comment:3

Great, this is very helpful. I don't see any problems with this.

@kcrisman
Copy link
Member

Reviewer: Karl-Dieter Crisman

@vbraun
Copy link
Member

vbraun commented Nov 15, 2014

Changed branch from u/chapoton/17258 to 7b1682a

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

No branches or pull requests

4 participants