Message Boards Message Boards

Oloid under ConvexHullMesh

Posted 6 years ago

An Oloid is the convex hull of two circles in perpendicular planes, each going through the center of the other one.

Remove[schatzOloid]
schatzOloid[\[Delta]_Integer, \[Phi]_?NumericQ, \[Omega]_?NumericQ] :=
  Block[{px = 
     Table[{0, Cos[o], Sin[o]}, {o, 0, 
       2 \[Pi] - \[Pi]/Mod[\[Delta], 100, 1], 
       N[\[Pi]/Mod[\[Delta], 100, 1]]}],
    m1 = {{Cos[\[Phi]], 0, -Sin[\[Phi]]}, {0, 1, 0}, {Sin[\[Phi]], 0, 
       Cos[\[Phi]]}},
    m2 = {{1, 0, 0}, {0, Cos[\[Omega]], -Sin[\[Omega]]}, {0, 
       Sin[\[Omega]], Cos[\[Omega]]}}, x},
   x = Join[Plus[#, {0, 0, 1}] & /@ (Dot[m1, #] & /@ px), 
     Dot[m2, #] & /@ (Permute[#, {2, 1, 3}] & /@ px)
     ];
   ConvexHullMesh[x,
    PlotTheme -> "SmoothShading", Boxed -> True, Axes -> True, 
    AxesLabel -> {"X", "Y", "Z"}, Ticks -> None
] /; \[Delta] > 2

Use it to poke fun at ConvexHullMesh, so it works

enter image description here

this is an artefact, clearly (the Support is aware of it)

enter image description here

now apply the rotation matrices

(* 37 is freaky *)
Animate[schatzOloid[23, \[Phi], \[Omega]], {\[Phi], 
  0, \[Pi]}, {\[Omega], 0, \[Pi]}, AnimationRunning -> False]
    ]

and after a while you will see that

enter image description here

seemingly the definition got lost, Animate[] continues to print the name schatzOloid[] instead of calling what the name defined

or that

enter image description here

not so clear what is meant by this, because it runs under Mathematica 11.2.0.0 (Windows 10 Prof. (update 1709)) for minutes, before either the definition got lost or a formatting beep stopped the show.

POSTED BY: Udo Krause
5 Replies
Posted 6 years ago

FWIW, a workaround for the time being seems to be to translate the coordinates away from the y-axis before finding the convex hull:

schatzOloid[\[Delta]_Integer, \[Phi]_?NumericQ, \[Omega]_?NumericQ] :=
  Block[{px = 
     Table[{0, Cos[o], Sin[o]}, {o, 0, 
       2 \[Pi] - \[Pi]/Mod[\[Delta], 100, 1], 
       N[\[Pi]/Mod[\[Delta], 100, 1]]}],
    m1 = {{Cos[\[Phi]], 0, -Sin[\[Phi]]}, {0, 1, 0}, {Sin[\[Phi]], 0, 
       Cos[\[Phi]]}},
    m2 = {{1, 0, 0}, {0, Cos[\[Omega]], -Sin[\[Omega]]}, {0, 
       Sin[\[Omega]], Cos[\[Omega]]}}, x},
   x = Join[Plus[#, {0, 0, 1}] & /@ (Dot[m1, #] & /@ px), 
     Dot[m2, #] & /@ (Permute[#, {2, 1, 3}] & /@ px)
     ];
   res = TransformedRegion[ConvexHullMesh[{#1 + .1, ##2} & @@@ x], TranslationTransform[{-.1, 0, 0}]];
   BoundaryMeshRegion[res, PlotTheme -> "SmoothShading", Boxed -> True, 
    Axes -> True, AxesLabel -> {"X", "Y", "Z"}, Ticks -> None]
] /; \[Delta] > 2

schatzOloid[37, 0, 0]

enter image description here

POSTED BY: Greg Hurst

Okay, thank you; take your version as schatzOloid1; interestingly it runs under Animate (after the animation arrows have been clicked, of course (just for the logs))

Animate[schatzOloid1[23, \[Phi], \[Omega]], {\[Phi],   0, \[Pi]}, {\[Omega], 0, \[Pi]}, AnimationRunning -> False]

longer - for about 3 minutes - but then again Mathematica looses the definition.

POSTED BY: Udo Krause
POSTED BY: Daniel Lichtblau
Attachments:
POSTED BY: Udo Krause

I ran the following from the notebook.

Remove[schatzOloid0]
schatzOloid0[\[Delta]_Integer, \[Omega]_?NumericQ] := 
 Block[{px = 
     Table[{0, Cos[o], 1 + Sin[o]}, {o, 0, 
       2 \[Pi] - \[Pi]/Mod[\[Delta], 100, 1], 
       N[\[Pi]/Mod[\[Delta], 100, 1]]}],
    py = Table[{Cos[o], 0, Sin[o]}, {o, 0, 
       2 \[Pi] - \[Pi]/Mod[\[Delta], 100, 1], \[Pi]/
        Mod[\[Delta], 100, 1]}], 
    m = {{1, 0, 0}, {0, Cos[\[Omega]], -Sin[\[Omega]]}, {0, 
       Sin[\[Omega]], Cos[\[Omega]]}}, x},
   x = Join[px, Dot[m, #] & /@ py];
   ConvexHullMesh[x,
    PlotTheme -> "SmoothShading", Boxed -> True, Axes -> True, 
    AxesLabel -> {"X", "Y", "Z"}, Ticks -> None
    ]
   ] /; \[Delta] > 2

Animate[schatzOloid0[37, \[Omega]], {\[Omega], 0, \[Pi]}, 
 AnimationRunning -> False]

I then hit the play button and let it go for a couple of minutes. This is in version 11.2, running under Linux. I did not notice it stop and did not get an error message window. During this time I twice reevaluated the definition cell and also stopped/restarted the animation. Assuming I ran this as you expected, I do not know if it is platform dependent issue or if something else weird is going on (this remark is only with reference to the Animate issue, not the other one noted regarding parameters that are zero).

POSTED BY: Daniel Lichtblau
Reply to this discussion
Community posts can be styled and formatted using the Markdown syntax.
Reply Preview
Attachments
Remove
or Discard

Group Abstract Group Abstract