Consider these simple exampes of two overlapping lines:
RegionIntersection[Line[{{0, 0}, {2, 0}}], Line[{{1 , 0}, {2, 0}}]]
(*Line[{{1, 0}, {2, 0}}]*)
RegionIntersection[Line[{{0, 0}, {2, 0}}], Line[{{1 , 0}, {3, 0}}]]
(*Line[{{{1, 0}, {2, 0}}}]*)
In both examples Mathematica evaluates the intersection as expected. Surprisingly in the second example with extra curly brackets .
My questions: What's the reason for this behavior? How to avoid or remove the outer curly brackets?
Thanks
Line
can represent a collection of lines. If you want to drop the extra list wrapper you can rewrite this specific case:Line[{{{1, 0}, {2, 0}}}] /. Line[{l_List}] :> Line[l]
$\rightarrow$(* Line[{{1, 0}, {2, 0}}] *)
. This doesn't modify the first result. $\endgroup$