polyhedron pb
Hi
It seems that the polyhedron function does not appreciate having a point too close to [0,0,0]
edited:16h36 20/08/2023 remove variable shiftv in textToPlt which was not set in my code snippet below,sorry.
def addAxis(plt,textToPlt,xBound,yBound,zBound) :
# add axis for real part
plt += arrow3d((0, 0, 0), (xBound, 0, 0), color='blue',width=1,radius=0.01)
plt += text3d("X", (xBound, 0, 0), fontsize='200%', color='blue')
plt += arrow3d((0, 0, 0), (0, yBound, 0), color='green',width=1,radius=0.01)
plt += text3d("Y", (0, yBound, 0), fontsize='200%', color='green')
plt += arrow3d((0, 0, 0), (0, 0, zBound), color='red',width=1,radius=0.01)
plt += text3d("Z", (0,0, zBound), fontsize='200%', color='red')
plt+=textToPlt
return plt
xBound=1 ;yBound=1 ;zBound=1
textToPlt = text3d("triangle",vector( (xBound, yBound, zBound)), fontsize='300%', fontweight=800)
# this one is ok
PL=[[-0.01850472408517678, -0.0001969154774790170-0.1, 0],
[0.528252049962465, 0.518079657915348, 1],
[0.700606532965328, -0.1802168993960041, 0]]
# but this one is KO
PL=[[-0.01850472408517678, -0.0001969154774790170, 0],
[0.528252049962465, 0.518079657915348, 1],
[0.700606532965328, -0.1802168993960041, 0]]
plt=Graphics()
plt+= point3d(PL, color='black',size=20)
plt=addAxis(plt,textToPlt,xBound,yBound,zBound)
show(plt)
P=Polyhedron(PL)
Pc=P.centroid()
I forgot to precise: Sagemath 10.0 ,Ubuntu 22.04.2 LTS ,WSL2 ,W11
Apparently it's a known issue ? :sage support google
stanford polyhedra tutorial
The tutorial you mention is not the "stanford polyhedra tutorial" but the Sage polyhedra tutorial.
It turns out a copy (dating back to Sage 9.3.beta9) is hosted at Stanford.
But the more natural link would be: