Ask Your Question
1

Polyhedron does not like too much accuracy for vertices

asked 2026-04-06 09:33:30 +0200

ortollj gravatar image

Hi

just to point out an oddity.

I have to reduce the precision of the vertex location in order to print the tetrahedron.

if I comment the line in the code below : tetrahedronLoc=roundMap(tetrahedronLoc,precis=5) I got an error.

https://sagecell.sagemath.org/?q=rossmq (sorry but I forgot how to put code in a post !)

edit retag flag offensive close merge delete

Comments

When writing the post, I didn't see the '101' tags to position to enclose the code !!. (sorry)

ortollj gravatar imageortollj ( 2026-04-07 07:15:10 +0200 )edit

Bug in Polyhedron.

azerbajdzan gravatar imageazerbajdzan ( 2026-04-08 12:22:34 +0200 )edit

1 Answer

Sort by ยป oldest newest most voted
0

answered 2026-04-08 12:37:31 +0200

azerbajdzan gravatar image

Rationalizing tetraVertices by QQ solves the problem. I think it is a bug in Polyhedron.

tetrahedron=[4, 5, 11, 14]
tetrahedronLoc={4: (-0.6220125751978625, -0.39433530191701094, 2.4390024379557733),
         5: (0.7440142276738531, -0.5773554766481435, 2.122015514128518),
         11: (0.244011652475991, -0.14434077856515382, 2.8720179520842914),
         14: (-0.6220027261487862, -1.2603675416886693, 2.9389962970029573)}
tetraHedronColor='black'

tetraVertices=[tetrahedronLoc.get(v) for v in tetrahedron]

tetraVertices = [[QQ(c) for c in p] for p in tetraVertices]

plt=Graphics()
plt+=Polyhedron(tetraVertices).plot(color=tetraHedronColor,opacity=0.75)
show(plt)
edit flag offensive delete link more

Your Answer

Please start posting anonymously - your entry will be published after you log in or create a new account.

Add Answer

Question Tools

1 follower

Stats

Asked: 2026-04-06 09:33:30 +0200

Seen: 40 times

Last updated: 1 hour ago