title: HitTest and RayMeshGeometry3DHitTestResult programmatically in a window-less console application
body: <p>I need to perform the intersection of a line and a triangle mesh.</p>
  
  <p>That operation would be very conveniently performed if I could use <code>VistualTreeHelper.HitTest</code> method, that would return a <code>RayMeshGeometry3DHitTestResult</code> structure.</p>
  
  <p>The problem is: <code>VisualTreeHelper.HitTest</code> requires a <code>Visual</code> and a <code>Point</code>, while I have only a <code>Visual3D</code> whose <code>Geometry</code> property is a <code>MeshGeometry3D</code> and a <code>Ray</code> custom class made from a <code>Point3D</code> (its origin) and a <code>Vector3D</code> (its direction).</p>
  
  <p>So what I would like is:</p>
  
  <pre><code>Point3D intersection = GetIntersection(MeshGeometry3D mesh, Point3D rayOrigin, Vector3D rayD
  </code></pre>
  
  <p>irection);</p>
  
  <p>But the framework offers me:</p>
  
  <pre><code>HitTestResult result = VisualTreeHelper.HitTest(model, point);
  if (result is RayMeshGeometry3DHitTestResult hitTestResult)]
  {
      Point3D intersection = result.PointHit;
  }
  </code></pre>
  
  <p>From what I've read, usually the desired <code>Visual3D</code> would be put inside a <code>ViewPort3DVisual</code>, and the <code>Point</code> would be somehow transformed into a ray by the viewport transform, or something like that.</p>
  
  <p>Since I don't have any Window so that I could have a ViewPort3D to put inside it, etc., I am clueless as to how I could use these helpers to get what I need.</p>
  
  <p>Alternatively, if there is a library that would do that, I could gladly use it instead of WPF's 3D methods.</p>