Ask Your Question

Revision history [back]

click to hide/show revision 1
initial version

polyhedron pb

Hi

It seems that the polyhedron function does not appreciate having a point too close to [0,0,0]

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))+shiftV, 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()

polyhedron pb

Hi

It seems that the polyhedron function does not appreciate having a point too close to [0,0,0][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))+shiftV, 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()

polyhedron pb

Hi

It seems that the polyhedron function does not appreciate having a point too close to [0,0,0] [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()