3
$\begingroup$

For a presentation, I'd like to include a 3D plot of a function of two variables x,y with the properties that (a) it looks "smooth" i.e. without jagged edges and (b) has support equal to a given smooth domain R.

Ideally I would want to have some flexibility in what R could be - say, a region whose boundary is a given BSplineCurve.

Any ideas how to represent the interior of a spline curve as a region, or, once this is done, how to define the function with the desired properties?

$\endgroup$

closed as off-topic by m_goldberg, bbgodfrey, Bob Hanlon, Dr. belisarius, rcollyer Apr 29 '15 at 12:34

This question appears to be off-topic. The users who voted to close gave this specific reason:

  • "This question cannot be answered without additional information. Questions on problems in code must describe the specific problem and include valid code to reproduce it. Any data used for programming examples should be embedded in the question or code to generate the (fake) data must be included." – m_goldberg, bbgodfrey, Bob Hanlon, Dr. belisarius, rcollyer
If this question can be reworded to fit the rules in the help center, please edit the question.

  • $\begingroup$ Welcome to Mathematica.SE! I suggest the following: 1) As you receive help, try to give it too, by answering questions in your area of expertise. 2) Read the faq! 3) When you see good questions and answers, vote them up by clicking the gray triangles, because the credibility of the system is based on the reputation gained by users sharing their knowledge. Also, please remember to accept the answer, if any, that solves your problem, by clicking the checkmark sign! $\endgroup$ – Michael E2 Apr 28 '15 at 23:35
  • $\begingroup$ Some example code for the BSplineCurve would encourage folks to copy/paste it into their Mathematica to try out their ideas for a solution. $\endgroup$ – Michael E2 Apr 28 '15 at 23:37
9
$\begingroup$
reg = BoundaryDiscretizeGraphics@
  ParametricPlot[
   BSplineFunction[{{0, 0}, {1, 0}, {2, .5}, {1, 1}, {0, 1}}, 
     SplineClosed -> True][t], {t, 0, 1}]

Mathematica graphics

Plot3D[Sin[6 x y], {x, y} ∈ reg]

Mathematica graphics

$\endgroup$
0
$\begingroup$

BoundaryDiscretizeGraphics was a very helpful function. I was able to take it from there. The following code achieved what I wanted:

boundaryPoints={{0, 0}, {4, 4}, {8, 1}, {12, 0}, {8, -1}, {4, -4}};
bsc = BSplineFunction[boundaryPoints,SplineClosed->True];
reg = BoundaryDiscretizeGraphics @ ParametricPlot[bsc[t],{t,0,1}];
regBdry = RegionBoundary[reg];
f[x_,y_]:=RegionDistance[regBdry,{x,y}];
Plot3D[f[x,y]^2,{x,y} ∈ reg]

My desired bump function

$\endgroup$

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