title: Why Geometry intersection does not give the expected result with polylines with more than one line?
body: <p>I need to calculate the intersection between two geometries to check if one is fully inside the other or not.</p>
  
  <p>The Geometry "container", based on a <code>System.Windows.Shapes.Polygon</code>, is created as follows:</p>
  
  <pre><code>List&lt;PathSegment&gt; basePolygonSegments = new List&lt;PathSegment&gt; {  
             new PolyLineSegment(basePolygon.Points, true) };
  PathGeometry baseGeometry = new PathGeometry();
     baseGeometry.Figures.Add(
         new PathFigure(basePolygon.Points[0], basePolygonSegments, true));
  </code></pre>
  
  <p>The Geometry "contained" can be:</p>
  
  <ul>
  <li>another <code>System.Windows.Shapes.Polygon</code></li>
  <li>a <code>System.Windows.Shapes.Polyline</code>, that can have only one line or three lines (the shape is a |_|, or U)</li>
  </ul>
  
  <p>The Polyline is created as follows:</p>
  
  <pre><code>Polyline bracketDrawingPolyline = new Polyline();
  foreach(Point p in listOfPoints)
  bracketDrawingPolyline.Points.Add(p);
  
  LineGeometry lineGeometry = 
       new LineGeometry(
        bracketDrawingPolyline.Points[0],
        bracketDrawingPolyline.Points[bracketDrawingPolyline.Points.Count - 1]);
  PathGeometry bracketGeometry = new PathGeometry();
  bracketGeometry = lineGeometry.GetWidenedPathGeometry(
           new Pen(Brushes.Black, 1.0));
  </code></pre>
  
  <p>To understand if the "contained" Geometry is contained in the "container", I do the following:</p>
  
  <pre><code>CombinedGeometry intersectionGeometry = 
    new CombinedGeometry(GeometryCombineMode.Intersect, 
       baseGeometry, bracketGeometry);
  
  double intersectionArea = 
       intersectionGeometry.GetArea(0.0001, ToleranceType.Absolute);
  double bracketArea = bracketGeometry.GetArea(0.0001, ToleranceType.Absolute);
  
  
  if (intersectionArea &lt; bracketArea)
  {
     //the second Geometry is not fully contained in the "container" Geometry
  }
  
  else
  //it is fully contained
  ....
  </code></pre>
  
  <p>In case of Polygon or Polyline with only one line everything works as expected. But with Polyline U, <code>intersectionArea</code> and <code>bracketArea</code> are always the same.</p>
  
  <p>I've also tried to perform the following checks:</p>
  
  <pre><code>bool result = baseGeometry.FillContains(bracketGeometry);
  IntersectionDetail idtl =  
           baseGeometry.FillContainsWithDetail(bracketGeometry);
  </code></pre>
  
  <p>but I have the same results.</p>