On Friday, March 18, 2016 at 9:44:13 AM UTC, [email protected] wrote: > > Hello, > > For a project i am working on, i need to compute the intersection of > tetrahedra from 2 tetrahedral meshes, and compute the volume. > For that purpose, i create a list of Polyhedron from each mesh, and i > compute the pairwise intersection of elements from these lists before i > compute the volume, using the interesection(other) and the volume() methods. > On some pairs, it creates a ZeroDivisionError with the following message : > input matrix must be nonsingular. > For instance, > p = Polyhedron([(0.01, 0.0011111, 0.0011111),(0.01, 0.0011111, 0.0),(0.01, > 0.0, 0.0),(0.0011111, 0.01, 0.0011111),(0.0011111, 0.01, 0.0),(0.0, 0.01, > 0.0)], base_ring=RDF) > p.volume() > would create this error. >
you compute with limited precision of RDF. In fact, if you rescale, you get an answer: sage: Polyhedron(map(lambda t: 1000*vector(t),p.vertices())).volume() 5.715482396456333 > It seems that the intersection() method creates polyhedra with incorrect > properties somehow. > Is there a way to avoid this behavior? > > I run sage 7.0 on a Windows 10 computer. > > Thank you, > > Benoit Legouis > > -- You received this message because you are subscribed to the Google Groups "sage-support" group. To unsubscribe from this group and stop receiving emails from it, send an email to [email protected]. To post to this group, send email to [email protected]. Visit this group at https://groups.google.com/group/sage-support. For more options, visit https://groups.google.com/d/optout.
