Ask Your Question

Revision history [back]

click to hide/show revision 1
initial version

answered 1 year ago

ortollj gravatar image
click to hide/show revision 2
No.2 Revision

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)
click to hide/show revision 3
No.3 Revision

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)
click to hide/show revision 4
No.4 Revision

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)