You can also doing this using the built-in cube in the polyhedra
module.  Polyhedra can be rescaled and translated; this does something
close to what it looked like you were trying:

sage: c = polytopes.n_cube(3)
sage: c2 = c*2
sage: p = point((2/3,2/3,0),color='green',size=10)
sage: c3 = (1/3)*c + vector([2/3,2/3,0])
sage: combo = p + c2.render_solid(opacity=0.1, rgbcolor='red')
sage: combo += c3.render_solid(opacity=0.8, rgbcolor='blue')
sage: show(combo)

-Marshall Hampton

On Jan 29, 11:47 am, Loïc <xl...@free.fr> wrote:
> Hello list,
>
> I was making some tries with 3D.
> I don't succeed to make cube correctly:
> Here is my code:
>
> c=cube((0,0,0),size=2,opacity=0.1,color='red')
> c+=point((2/3,2/3,0),color='green',size=10)
> c+=cube(center=(2/3,2/3,0),size=1/3,opacity=0.8)
> show(c)
>
> I draw a point with coord (2/3,2/3,0)
> Then I draw a cube centered on this point with size 1/3
>
> When I display with JMol, the point is outside the cube...
>
> Is it a bug ? Perhaps I've missed something with the instruction
> cube()
>
> Thanks in advance
>
> Loïc

-- 
To post to this group, send email to sage-support@googlegroups.com
To unsubscribe from this group, send email to 
sage-support+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/sage-support
URL: http://www.sagemath.org

Reply via email to