Possible bug in Plane/Segment3D intersection

19 views
Skip to first unread message

Carson Farmer

unread,
Jun 22, 2015, 7:28:41 PM6/22/15
to sy...@googlegroups.com
The following does not seem correct (in that p.intersection(s) should return an empty list but it doesn't):

from simply.geometry import Plane, Segment3D, Point3D
p = Plane(Point3D(0, 0, 1), Point3D(1, 0, 1), Point3D(0, 1, 1))
s = Segment3D(Point3D(.5, .5, 0), Point3D(.5, .5, .5))
i = p.intersection(s)
assert i[0] in p  # This assertion is True (which is correct)
assert i[0] in s  # This one is not (which is correct)

Am I missing something, or is this a bug?
Where instead of:
if p not in self:
It should read:
if p not in self or p not in o
Should I submit a pull request? It seems pretty minor...


Cheers

Jason Moore

unread,
Jun 22, 2015, 7:30:24 PM6/22/15
to sy...@googlegroups.com
Please send a PR and make sure to include a unit test that checks for the fixed bug. You can probably use the code you pasted above for the unit test.

--
You received this message because you are subscribed to the Google Groups "sympy" group.
To unsubscribe from this group and stop receiving emails from it, send an email to sympy+un...@googlegroups.com.
To post to this group, send email to sy...@googlegroups.com.
Visit this group at http://groups.google.com/group/sympy.
To view this discussion on the web visit https://groups.google.com/d/msgid/sympy/f82f17b9-c693-4544-b14d-4759fb4e7ab6%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply all
Reply to author
Forward
0 new messages