Question

here's a simple Manipulate Menu created with Mathematica:

SphereSection[d_, h_] :=
    RegionPlot3D[(x^2 / d) + (y^2 / d) + (z^2 / h) <= 1, 
    {x, -5, 5}, {y, -5, 5}, {z, 0, 5},
    AxesLabel->{"Lunghezza Km" , "Larghezza  Km", "Profondità Km"},
    PlotLabel->Style[Framed["Semisfera di riferimento"],25]]

 Manipulate[
  {diameter,highness,estimatedPorosity,waterSaturation,netOnGross,bg},             
  {diameter, 0, 200},{highness,0,200},{estimatedPorosity,0,100},
  {waterSaturation, 0, 100}, {netOnGross, 0, 100}, {bg, 0, 1},
   Button["GO", SphereSection[diameter, highness]]]

When I set the diameter and highness with the graphic menu, I expect that the function SphereSection is called after I've pressed the button but nothing happens...instead if I call directly

SphereSection[2,3]

then it draws the section of the sphere correctly...how can I link the two?

Was it helpful?

Solution

Does this do what you want?

   Manipulate[SphereSection[diameter, highness],
       {{diameter, 100}, 0, 200},
       {{highness, 100}, 0, 200},
       {estimatedPorosity, 0, 100},
       {waterSaturation, 0, 100},
       {netOnGross, 0, 100},
       {bg, 0, 1}]

If you actually want the result held until you press a button that's a little harder. This is quick and dirty approach. Note you need to "use" the dummy variable update in order for it to wrok as a TrackedSymbol

 Manipulate[update; SphereSection[diameter, highness],
    {{diameter, 100}, 0, 200},
    {{highness, 100}, 0, 200},
    {estimatedPorosity, 0, 100},
    {waterSaturation, 0, 100},
    {netOnGross, 0, 100},
    {bg, 0, 1}, {update, {True, False}}, TrackedSymbols :> {update}]
Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top