2
$\begingroup$

I have to find, with Mathematica, the intersection between the curve defined by a knot and a plane defined by three points, in 3D space.

I tried to find the intersection with RegionIntersection, but I don't know how to operate with the curve as a region.

I also tried to use Solve to find the points that are elements both of the curve and the plane, but unsuccesfully.

The problem is, I think, that the parametric equations that I obtain using "SpaceCurve" are not the usual parametric equations, but InterpolatingFunction (the knot is {7,4}).

How do I find the intersection? How could I use "true" parametric equations to find it? Can I transform that knot into a sort of region to use in RegionIntersection?

Sorry for my English, and thank you for your attention.

$\endgroup$

2 Answers 2

4
$\begingroup$
sc = KnotData["FigureEight", "SpaceCurve"];

You can use sc in ParametricPlot3D as follows:

zvals = {1};
Show[ParametricPlot3D[sc[t], {t, -Pi, Pi}, MeshFunctions -> {#3 &}, 
   Mesh -> {zvals}, MeshStyle -> Directive[PointSize[Large], Red]], 
  Plot3D[zvals, {x, -3, 3}, {y, -3, 3}, Mesh -> None, 
   PlotStyle -> Opacity[.5], BoundaryStyle -> None]] /. 
 {Point -> (Sphere[#, .2] &), Line -> (Tube[#, .1] &)}

enter image description here

Using zvals = {-1, .5}; and PlotStyle -> (Opacity[.5, #] & /@ {LightBlue, Yellow}) in Plot: enter image description here

Update: Using RegionIntersection and InfinitePlane

pp = ParametricPlot3D[sc[t], {t, -Pi, Pi}, Mesh -> None];
scurve = Cases[Normal@pp, _Line, ∞][[1]];
threepoints = {{0, 0, 0}, {{1, 0, 0}, {1, Cos[π / 4], Sin[π / 4]}}};
plane = InfinitePlane @@ threepoints;
intersections = RegionIntersection[scurve, plane];

Show[pp, Graphics3D @ {Red, PointSize @ Large, intersections, 
 Yellow, Opacity @ .5, EdgeForm[], plane}]

enter image description here

For sc = KnotData[{7,4}, "SpaceCurve"]; we get enter image description here

$\endgroup$
2
  • $\begingroup$ Thank you! Very helpful answer! $\endgroup$ Commented Dec 29, 2017 at 17:25
  • $\begingroup$ @Francesco, my pleasure. Thank you for the accept. $\endgroup$
    – kglr
    Commented Dec 29, 2017 at 20:12
3
$\begingroup$

For completeness, here is how to use the MeshFunctions approach in the general case of a plane defined by three noncollinear points:

sc = KnotData["FigureEight", "SpaceCurve"];
threepoints = N[{{0, 0, 0}, {1, 0, 0}, {1, Cos[π/4], Sin[π/4]}}];
v = Flatten[Last[SingularValueDecomposition[threepoints, -1]]];
c = Mean[threepoints];

Show[ParametricPlot3D[sc[t], {t, -π, π}, MeshFunctions -> {v.({#1, #2, #3} - c) &},
                      Mesh -> {{0}}, MeshStyle -> Directive[PointSize[Large], Red]], 
     Graphics3D[{Directive[Opacity[.5, Yellow], EdgeForm[]], InfinitePlane[threepoints]}]]

knot and plane intersections


Another possibility is to use Plot[]'s MeshFunctions option to isolate the parameter values corresponding to the intersections. Using the same definitions as above:

tvals = Cases[Normal[Plot[v.(sc[t] - c), {t, -π, π}, Mesh -> {{0}}, 
                          MeshFunctions -> {#2 &}, MeshStyle -> {}]], 
              Point[{x_, y_}] :> x, ∞]
   {-1.712323422790644, -3.0398127789179785, 1.387684574684945,
    -0.8060547287830133, 0.5790217532175918, 0.41948543880299466}

Then,

Show[ParametricPlot3D[sc[t], {t, -π, π}], 
     Graphics3D[{{Directive[Opacity[.5, Yellow], EdgeForm[]], InfinitePlane[threepoints]},
                 {Red, Sphere[sc /@ tvals, 0.08]}}]]

knot and plane intersections, method 2

$\endgroup$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.