Opened 10 years ago
Closed 10 years ago
#1511 closed enhancement (fixed)
[with patch, positive review] Export 3d objects in jmol format
Reported by: | robertwb | Owned by: | robertwb |
---|---|---|---|
Priority: | major | Milestone: | sage-2.9 |
Component: | graphics | Keywords: | |
Cc: | Merged in: | ||
Authors: | Reviewers: | ||
Report Upstream: | Work issues: | ||
Branch: | Commit: | ||
Dependencies: | Stopgaps: |
Description
http://jmol.sourceforge.net/ may be a promising answer to 3d graphics in Sage.
Attachments (2)
Change History (10)
comment:1 Changed 10 years ago by
- Owner changed from was to robertwb
- Status changed from new to assigned
comment:2 Changed 10 years ago by
- Summary changed from Export 3d objects in jmol format to [with patch] Export 3d objects in jmol format
comment:3 Changed 10 years ago by
sage: from sage.plot.plot3d.shapes import * sage: from sage.plot.plot3d.plot3d import plot3d sage: S = Sphere(.5, color='yellow') sage: S += Cone(.5, .5, color='red').translate(0,0,.3) sage: S += Sphere(.1, color='white').translate(.45,-.1,.15) + Sphere(.05, color='black').translate(.51,-.1,.17) sage: S += Sphere(.1, color='white').translate(.45, .1,.15) + Sphere(.05, color='black').translate(.51, .1,.17) sage: S += Sphere(.1, color='yellow').translate(.5, 0, -.2) sage: def f(x,y): return math.exp(x/5)*math.cos(y)
sage: P = plot3d(f,(-5,5),(-5,5), ['red','yellow'], max_depth=10) sage: cape_man = P.scale(.2)+S.translate(1,0,0) sage: cape_man.export_jmol('/path/to/a.script')
Then, after downloading jmol, do
./jmol /path/to/a.script
Changed 10 years ago by
comment:4 Changed 10 years ago by
It works perfectly!!! Of course, it needs some doctests...
Try this out, it's awesome:
sage: from sage.plot.plot3d.shapes import * sage: from sage.plot.plot3d.plot3d import plot3d sage: S = Sphere(.5, color='yellow') sage: S += Cone(.5, .5, color='red').translate(0,0,.3) sage: S += Sphere(.1, color='white').translate(.45,-.1,.15) + Sphere(.05, color='black').translate(.51,-.1,.17) sage: S += Sphere(.1, color='white').translate(.45, .1,.15) + Sphere(.05, color='black').translate(.51, .1,.17) sage: S += Sphere(.1, color='yellow').translate(.5, 0, -.2) sage: def f(x,y): return math.exp(x/5)*math.cos(y) sage: P = plot3d(f,(-200,20),(-200,20), ['red','yellow'], max_depth=10) sage: cape_man = P.scale(.2)+S.translate(1,0,0) sage: cape_man.export_jmol('/Users/was/sage-2.9.alpha7/jmol/a.script')
comment:5 Changed 10 years ago by
See #1516 for future work.
comment:6 Changed 10 years ago by
- Summary changed from [with patch] Export 3d objects in jmol format to [with patch, positive review] Export 3d objects in jmol format
Positi
comment:7 Changed 10 years ago by
- Milestone changed from sage-2.9.1 to sage-2.9
Changed 10 years ago by
comment:8 Changed 10 years ago by
- Resolution set to fixed
- Status changed from assigned to closed
Merged in 2.9.rc2.
Note: See
TracTickets for help on using
tickets.
Bundle also contains #1473