Do you think it's better to report it as a bug?
Loïc
PS: A little program that draws Menger's sponge
def menger(size,p,x,y,z,start):
if(p>0):
start+=1
newsize=size/3
graphic=menger(newsize,p-1,x+newsize,y+newsize,z,start)
l=[(x+newsize,y-newsize,z),(x-newsize,y-newsize,z),
(x-newsize,y+newsize,z),(x+newsize,y-newsize,z+newsize),(x
+newsize,y+newsize,z+newsize),(x-newsize,y+newsize,z+newsize),(x-
newsize,y-newsize,z+newsize),(x,y-newsize,z+newsize),(x,y+newsize,z
+newsize),(x+newsize,y,z+newsize),
(x-newsize,y,z+newsize),(x+newsize,y-newsize,z-newsize),(x
+newsize,y+newsize,z-newsize),(x-newsize,y+newsize,z-newsize),(x-
newsize,y-newsize,z-newsize),(x,y-newsize,z-newsize),(x,y+newsize,z-
newsize),(x+newsize,y,z-newsize),(x-newsize,y,z-newsize)]
for k in l:
graphic+=menger(newsize,p-1,k[0],k[1],k[2],start)
else:
graphic=cube(center=(x*3^start,y*3^start,z*3^start),size=size,color=('purple','pink','red'),opacity=1)
return graphic
a=menger(1,3,0,0,0,0)
show(a,viewer='tachyon')
On 30 jan, 12:06, Robert Bradshaw <[email protected]>
wrote:
> On Sun, Jan 30, 2011 at 2:55 AM, Loïc <[email protected]> wrote:
> > Thanks you very much for your reply
>
> > You're right, size affects the center too.
> > Not very intuituive but now, I know it.
>
> > I think this behaviour is quite surprising.
> > For example, with sphere, size doesn't affect center ....
>
> I might go so far to call it a bug...
>
> > On 29 jan, 20:04, Francois Maltey <[email protected]> wrote:
> >> Hello,
>
> >> > 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()
>
> >> It seems that sage multiplies by size all the coordinates of the cube,
> >> even the center, not only the length.
>
> >> Try size=1, size=10 and size=0.1. The center of the cube changes.
>
> >> F.
>
> > --
> > To post to this group, send email to [email protected]
> > To unsubscribe from this group, send email to
> > [email protected]
> > For more options, visit this group
> > athttp://groups.google.com/group/sage-support
> > URL:http://www.sagemath.org
--
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/sage-support
URL: http://www.sagemath.org