I have two points, for instance {1, 1, 1} and {10, 11, 15} that connected to form a line. I also have an enclosed surface region got by a contour plot. How can I find the coordinate of the intersection of the line and the surface? I tried the function RegionIntersection but it doesn't work I guess because the two regions have different embedded dimensions. And even if it works I don't know how to extract the coordinate.

Could somebody help me with this?

enter image description here

The code to get the region is like:

    Iso = ListContourPlot3D[DataTable, Contours -> 
          {0.5}, ContourStyle -> {Yellow, Opacity[0.7]}, DataRange -> 
          {{x0,x1}, {y0,y1}, {z0,z1}}, Mesh -> None, BoxRatios -> {x1- 
          x0, y1-y0, z1-z0}];

    RegionSurface = RegionBoundary[BoundaryDiscretizeGraphics[Iso]];

    RegionIntersection[RegionSurface, Region[Line[{{0, 0, 0}, {10, 11, 

where the DataTable is a 3D table containing volumetric data read in from a file. One example of the RegionSurface is given by the following picture:

enter image description here

  • 3
    $\begingroup$ Solve[ x^2 - y^2 - z == 0 && (1 - t)*{1, 1, 1} + t*{10, 11, 15} == {x, y, z} ] $\endgroup$
    – cvgmt
    Aug 8 '20 at 5:08
  • $\begingroup$ The hard part is that I don't have an expression for the enclosed surface region. It is got by a contour plot of a 3D volumetric data and applying "RegionBoundary[BoundaryDiscretizeGraphics[ ]] " $\endgroup$
    – Dennis
    Aug 8 '20 at 14:27
  • $\begingroup$ You need to post your code about the region. $\endgroup$
    – cvgmt
    Aug 8 '20 at 15:27
  • $\begingroup$ This is an example from the [reference.wolfram.com/language/ref/RegionIntersection.html] page in the section Scope > Special Regions. The solution is: Line[{{-(3/Sqrt[14]), -3 Sqrt[2/7], -(9/Sqrt[14])}, {3/Sqrt[14], 3 Sqrt[2/7], 9/Sqrt[14]}}]. Have a look there. $\endgroup$ Aug 8 '20 at 16:56
  • 1
    $\begingroup$ @CA Trevillian Sorry, my fault, just got into Mathematica Stack Exchange and haven't been familiar with how to properly post questions... And I added my code in the description which should be clear now :) $\endgroup$
    – Dennis
    Aug 9 '20 at 15:28

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.