2
$\begingroup$

I am plotting a surface using ParametricPlot3D. Is there a way that only the region with negative Gaussian curvature is plotted?

$\endgroup$
3
  • 2
    $\begingroup$ Try RegionFunction! It would be very helpful if you provide a minimal example. $\endgroup$ Commented Aug 10, 2020 at 7:50
  • $\begingroup$ @UlrichNeumann Thank you for your reply. supposing that I am plotting a cyclide ParametricPlot3D[ ResourceFunction["Cyclide"][.3, 1.5, {u, v}], {u, -\[Pi], \[Pi]}, {v, -2 \[Pi], 2 \[Pi]}] and I only wanted to plot the regions with negative Gaussian curvature. I wasn't sure how to use RegionFunction. thank you for your reply! $\endgroup$
    – brndt
    Commented Aug 10, 2020 at 8:01
  • 3
    $\begingroup$ If you know the curvature curv[u,v] try ParametricPlot3D[…,RegionFunction->Function[{u,v},curv[u,v]<0]] $\endgroup$ Commented Aug 10, 2020 at 8:13

1 Answer 1

9
$\begingroup$

There is a ResourceFunction that can compute Gaussian curvature which allows you to incorporate the comment by Ulrich Neumann

Clear[surf, curv]
surf[u_, v_] = ResourceFunction["Cyclide"][.3, 1.5, {u, v}];
curv[u_, v_] = 
  ResourceFunction["GaussianCurvature"][#, {u, v}] &@surf[u, v];
ParametricPlot3D[
 surf[u, v], {u, -\[Pi], \[Pi]}, {v, -2 \[Pi], 2 \[Pi]}, 
 RegionFunction -> Function[{u, v}, curv[u, v] < 0]]

Regions of negative curvature of a cyclide

$\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.