Hello,

This is definitely a bug. Thanks for the report. I opened
the ticket #30319 to track the issue, see

    https://trac.sagemath.org/ticket/30319

Note that if you use rational coordinates, it looks fine. With

a = Polyhedron([[0, -1, 1], [1, -1, 1], [1, 1, -1]])
b = Polyhedron([[0, -1/2, 3/2], [1, -1/2, 3/2], [1, 3/2, -1/2]])
c = a.intersection(b)

the polyhedron c is empty.

Best
Vincent

Le 08/08/2020 à 05:20, Noah Toyonaga a écrit :
Hello,

I have found that sage finds a non-zero intersection between polygons when
they are parallel but non-intersecting. A reproducible example:
```
# Define parallel polygons.
a = Polyhedron([[0, -1, 1], [1, -1, 1], [1, 1, -1]])
b = Polyhedron([[0.0, -0.5, 1.5], [1.0, -0.5, 1.5], [1.0, 1.5, -0.5]])

# Intersection.
c = a.intersection(b)

# c ->
# `A 2-dimensional polyhedron in RDF^3 defined as the convex hull of 3
# vertices (use the .plot() method to plot)`

a.plot(fill='green') + b.plot(fill='red') + c.plot(fill='orange')
```

However, when the polygons are made non-parallel the correct answer (zero
intersection) is found.

```
# Define parallel polygons.
a = Polyhedron([[0, -1, 1], [1, -1, 1], [1, 1, -1]])
b = Polyhedron([[0.0, -0.15, 1.5], [1.0, -0.5, 1.5], [1.0, 1.5, -0.5]])

# Intersection.
c = a.intersection(b)

# c ->
# `The empty polyhedron in RDF^3 (use the .plot() method to plot)

a.plot(fill='green') + b.plot(fill='red') + c.plot(fill='orange')
```

Noah


--
You received this message because you are subscribed to the Google Groups 
"sage-devel" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to sage-devel+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/sage-devel/c7d7117b-1e2d-9962-0811-896e44b33f49%40gmail.com.

Reply via email to