Ask Your Question

Revision history [back]

a little weird workarround !

PrL=[]
for pt in PL:
    ptr=[]
    for v in pt :
        ptr.append(RDF((v.n(20)*10^8)/10^8))
        #ptr.append(RDF(v.n(20)))
    PrL.append(ptr)

plt=Graphics()
plt+= point3d(PL, color='black',size=20)
plt=addAxis(plt,textToPlt,xBound,yBound,zBound)
P=Polyhedron(PrL)
Pc=P.centroid()
plt+= point3d(Pc, color='red',size=20) 
show(plt)

a little weird workarround !

PrL=[]
for pt in PL:
    ptr=[]
    for v in pt :
        ptr.append(RDF((v.n(20)*10^8)/10^8))
        #ptr.append(RDF(v.n(20)))
    PrL.append(ptr)

plt=Graphics()
plt+= point3d(PL, color='black',size=20)
plt=addAxis(plt,textToPlt,xBound,yBound,zBound)
P=Polyhedron(PrL)
Pc=P.centroid()
plt+= point3d(Pc, color='red',size=20) 
show(plt)

edited :21/08/23 : much more simple the solution is given in the post sage google support in the comment above:

P=Polyhedron(PL,backend='ppl', base_ring=QQ)

a little weird workarround !

PrL=[]
for pt in PL:
    ptr=[]
    for v in pt :
        ptr.append(RDF((v.n(20)*10^8)/10^8))
        #ptr.append(RDF(v.n(20)))
    PrL.append(ptr)

plt=Graphics()
plt+= point3d(PL, color='black',size=20)
plt=addAxis(plt,textToPlt,xBound,yBound,zBound)
P=Polyhedron(PrL)
Pc=P.centroid()
plt+= point3d(Pc, color='red',size=20) 
show(plt)

edited :21/08/23 : much more simple the solution is given in the post sage google support (link in the comment above:above) :

P=Polyhedron(PL,backend='ppl', base_ring=QQ)