Skip to main content
Commonmark migration
Source Link

###Edit

Edit

###Edit

Edit

deleted 59 characters in body
Source Link
m_goldberg
  • 108.1k
  • 16
  • 104
  • 259
Manipulate[
 With[{Models = {{
      Graphics3D[{Blue, Sphere[{0.5*Cos[0], 0.5*Sin[0], 0}, 0.2]}, 
       Boxed -> False],
      SphericalPlot3D[
       1 + 2 Cos[2 \[Theta]]θ], {\[Theta]θ, 0, \[Pi]π}, {\[Phi]ϕ, 0, 
        2 \[Pi]π}, PlotStyle -> Blue, Mesh -> None, Boxed -> False, 
       Axes -> False]
      },
     {
      Graphics3D[{Red, Sphere[{1*Cos[0], 1*Sin[0], 0}, 0.2]}, 
       Boxed -> False],
      SphericalPlot3D[
       Evaluate@
        Abs@SphericalHarmonicY[3, 1, \[Theta]θ, \[Phi]]ϕ], {\[Theta]θ, 
        0, \[Pi]π}, {\[Phi]ϕ, 0, 2 \[Pi]π}, PlotStyle -> Red, 
       Mesh -> None, Boxed -> False, Axes -> False]
      },
     {
      Graphics3D[{Green, Sphere[{1.5*Cos[0], 1.5*Sin[0], 0}, 0.2]}, 
       Boxed -> False],
      ParametricPlot3D[{Cos[
          u] (3 + Cos[u/2] Sin[v] - Sin[u/2] Sin[2 v]), 
        Sin[u] (3 + Cos[u/2] Sin[v] - Sin[u/2] Sin[2 v]), 
        Sin[u/2] Sin[v] + Cos[u/2] Sin[2 v]}, {u, 0, 2 Pi}, {v, 0, 
        2 Pi}, PlotStyle -> FaceForm[Green, Green], Mesh -> None, 
       Boxed -> False, Axes -> False]
      },
     {
      Graphics3D[{Orange, Sphere[{2*Cos[0], 2*Sin[0], 0}, 0.2]}, 
       Boxed -> False],
      RevolutionPlot3D[{2 + Cos[t], Sin[t]}, {t, 0, 2 Pi}, 
       PlotStyle -> Orange, Mesh -> None, Boxed -> False, 
       Axes -> False]
      }}},
  Column[{
    Graphics3D[{
      If[FreeQ[u, #[[2]]],
         Button[#[[1]], AppendTo[u, #[[2]]]], 
         Button[#[[1]], u = DeleteCases[u, #[[2]]]]] & /@ 
       Models}, ImageSize -> 300, Boxed -> False],
    Row[{Pane[Graphics3D[{#}, Boxed -> False], {300, 300}, 
         Alignment -> {Center, Center}]}] &[Union@u]}]], {{u, {}}, 
  ControlType -> None}, SaveDefinitions -> True]
Manipulate[
 With[{Models = {{
      Graphics3D[{Blue, Sphere[{0.5*Cos[0], 0.5*Sin[0], 0}, 0.2]}, 
       Boxed -> False],
      SphericalPlot3D[
       1 + 2 Cos[2 \[Theta]], {\[Theta], 0, \[Pi]}, {\[Phi], 0, 
        2 \[Pi]}, PlotStyle -> Blue, Mesh -> None, Boxed -> False, 
       Axes -> False]
      },
     {
      Graphics3D[{Red, Sphere[{1*Cos[0], 1*Sin[0], 0}, 0.2]}, 
       Boxed -> False],
      SphericalPlot3D[
       Evaluate@
        Abs@SphericalHarmonicY[3, 1, \[Theta], \[Phi]], {\[Theta], 
        0, \[Pi]}, {\[Phi], 0, 2 \[Pi]}, PlotStyle -> Red, 
       Mesh -> None, Boxed -> False, Axes -> False]
      },
     {
      Graphics3D[{Green, Sphere[{1.5*Cos[0], 1.5*Sin[0], 0}, 0.2]}, 
       Boxed -> False],
      ParametricPlot3D[{Cos[
          u] (3 + Cos[u/2] Sin[v] - Sin[u/2] Sin[2 v]), 
        Sin[u] (3 + Cos[u/2] Sin[v] - Sin[u/2] Sin[2 v]), 
        Sin[u/2] Sin[v] + Cos[u/2] Sin[2 v]}, {u, 0, 2 Pi}, {v, 0, 
        2 Pi}, PlotStyle -> FaceForm[Green, Green], Mesh -> None, 
       Boxed -> False, Axes -> False]
      },
     {
      Graphics3D[{Orange, Sphere[{2*Cos[0], 2*Sin[0], 0}, 0.2]}, 
       Boxed -> False],
      RevolutionPlot3D[{2 + Cos[t], Sin[t]}, {t, 0, 2 Pi}, 
       PlotStyle -> Orange, Mesh -> None, Boxed -> False, 
       Axes -> False]
      }}},
  Column[{
    Graphics3D[{
      If[FreeQ[u, #[[2]]],
         Button[#[[1]], AppendTo[u, #[[2]]]], 
         Button[#[[1]], u = DeleteCases[u, #[[2]]]]] & /@ 
       Models}, ImageSize -> 300, Boxed -> False],
    Row[{Pane[Graphics3D[{#}, Boxed -> False], {300, 300}, 
         Alignment -> {Center, Center}]}] &[Union@u]}]], {{u, {}}, 
  ControlType -> None}, SaveDefinitions -> True]
Manipulate[
 With[{Models = {{
      Graphics3D[{Blue, Sphere[{0.5*Cos[0], 0.5*Sin[0], 0}, 0.2]}, 
       Boxed -> False],
      SphericalPlot3D[
       1 + 2 Cos[2 θ], {θ, 0, π}, {ϕ, 0, 
        2 π}, PlotStyle -> Blue, Mesh -> None, Boxed -> False, 
       Axes -> False]
      },
     {
      Graphics3D[{Red, Sphere[{1*Cos[0], 1*Sin[0], 0}, 0.2]}, 
       Boxed -> False],
      SphericalPlot3D[
       Evaluate@
        Abs@SphericalHarmonicY[3, 1, θ, ϕ], {θ, 
        0, π}, {ϕ, 0, 2 π}, PlotStyle -> Red, 
       Mesh -> None, Boxed -> False, Axes -> False]
      },
     {
      Graphics3D[{Green, Sphere[{1.5*Cos[0], 1.5*Sin[0], 0}, 0.2]}, 
       Boxed -> False],
      ParametricPlot3D[{Cos[
          u] (3 + Cos[u/2] Sin[v] - Sin[u/2] Sin[2 v]), 
        Sin[u] (3 + Cos[u/2] Sin[v] - Sin[u/2] Sin[2 v]), 
        Sin[u/2] Sin[v] + Cos[u/2] Sin[2 v]}, {u, 0, 2 Pi}, {v, 0, 
        2 Pi}, PlotStyle -> FaceForm[Green, Green], Mesh -> None, 
       Boxed -> False, Axes -> False]
      },
     {
      Graphics3D[{Orange, Sphere[{2*Cos[0], 2*Sin[0], 0}, 0.2]}, 
       Boxed -> False],
      RevolutionPlot3D[{2 + Cos[t], Sin[t]}, {t, 0, 2 Pi}, 
       PlotStyle -> Orange, Mesh -> None, Boxed -> False, 
       Axes -> False]
      }}},
  Column[{
    Graphics3D[{
      If[FreeQ[u, #[[2]]],
         Button[#[[1]], AppendTo[u, #[[2]]]], 
         Button[#[[1]], u = DeleteCases[u, #[[2]]]]] & /@ 
       Models}, ImageSize -> 300, Boxed -> False],
    Row[{Pane[Graphics3D[{#}, Boxed -> False], {300, 300}, 
         Alignment -> {Center, Center}]}] &[Union@u]}]], {{u, {}}, 
  ControlType -> None}, SaveDefinitions -> True]
Improved formatting
Source Link
m_goldberg
  • 108.1k
  • 16
  • 104
  • 259
Manipulate[
  Column[{
    Graphics3D[
      Map[
        If[FreeQ[u, #[[1]]], 
          Button[#[[1]], AppendTo[u, #[[1]]]], 
          Button[#[[1]], u = DeleteCases[u, #[[1]]]]] &, 
        Solar], 
      ImageSize -> 300, Boxed -> False], 
    Pane[Graphics3D[uGraphics3D[u, Boxed
      ImageSize -> False], {300, 300}]Boxed -> False]}],
  {{u, {}}, ControlType -> None},
  Initialization :> (
    Solar = 
      {Graphics3D[{Blue, Sphere[{0.5, 0., 0.}, 0.2]}, Boxed -> False], 
       Graphics3D[{Green, Sphere[{1., 0., 0.}, 0.2]}, Boxed -> False], 
       Graphics3D[{Red, Sphere[{1.5, 0., 0.}, 0.2]}, Boxed -> False], 
       Graphics3D[{Orange, Sphere[{2., 0., 0.}, 0.2]}, Boxed -> False]}),
  SaveDefinitions -> True]
Manipulate[
  Column[{
    Graphics3D[
      Map[
        If[FreeQ[u, #[[1]]], 
          Button[#[[1]], AppendTo[u, #[[1]]]], 
          Button[#[[1]], u = DeleteCases[u, #[[1]]]]] &, 
        Solar], 
      ImageSize -> 300, Boxed -> False], 
    Pane[Graphics3D[u, Boxed -> False], {300, 300}]}],
  {{u, {}}, ControlType -> None},
  Initialization :> (
    Solar = 
      {Graphics3D[{Blue, Sphere[{0.5, 0., 0.}, 0.2]}, Boxed -> False], 
       Graphics3D[{Green, Sphere[{1., 0., 0.}, 0.2]}, Boxed -> False], 
       Graphics3D[{Red, Sphere[{1.5, 0., 0.}, 0.2]}, Boxed -> False], 
       Graphics3D[{Orange, Sphere[{2., 0., 0.}, 0.2]}, Boxed -> False]}),
  SaveDefinitions -> True]
Manipulate[
  Column[{
    Graphics3D[
      Map[
        If[FreeQ[u, #[[1]]], 
          Button[#[[1]], AppendTo[u, #[[1]]]], 
          Button[#[[1]], u = DeleteCases[u, #[[1]]]]] &, 
        Solar], 
      ImageSize -> 300, Boxed -> False], 
    Graphics3D[u, 
      ImageSize -> 300, Boxed -> False]}],
  {{u, {}}, ControlType -> None},
  Initialization :> (
    Solar = 
      {Graphics3D[{Blue, Sphere[{0.5, 0., 0.}, 0.2]}, Boxed -> False], 
       Graphics3D[{Green, Sphere[{1., 0., 0.}, 0.2]}, Boxed -> False], 
       Graphics3D[{Red, Sphere[{1.5, 0., 0.}, 0.2]}, Boxed -> False], 
       Graphics3D[{Orange, Sphere[{2., 0., 0.}, 0.2]}, Boxed -> False]}),
  SaveDefinitions -> True]
added 79 characters in body
Source Link
RandomEli
  • 241
  • 1
  • 6
Loading
Added minimal working example
Source Link
m_goldberg
  • 108.1k
  • 16
  • 104
  • 259
Loading
Added another sample image
Source Link
RandomEli
  • 241
  • 1
  • 6
Loading
Routine clean-up
Source Link
m_goldberg
  • 108.1k
  • 16
  • 104
  • 259
Loading
fixed grammer
Source Link
RandomEli
  • 241
  • 1
  • 6
Loading
Source Link
RandomEli
  • 241
  • 1
  • 6
Loading