Message Boards Message Boards

AnimationVideo fails with same arguments as working Animate

Posted 2 years ago

What must I change in the Animate arguments to get AnimationVideo to work?

POSTED BY: James Bowery
7 Replies

This seems to work:

AnimationVideo[
 Graphics3D[
  MeshPrimitives[
   DiscretizeRegion@
    RegionIntersection[Sphere[{0, 0, 0}, 2], 
     InfinitePlane[{0, 0, z}, {{1, 0, 0}, {0, 1, 0}}]], 1], 
  ViewPoint -> {2, 2, 2}, 
  PlotRange -> {{-2, 2}, {-2, 2}, {-2, 2}}], {z, -1.95, 1.95, .5}]

I really I knew an easier way to turn a Region into Graphics3D.

POSTED BY: Gianluca Gorni
Posted 2 years ago

That works! Thanks!

PS: I'm not sure what Wolfram uses for a theoretic underpinning for its type system, but it would seem that type -- or at least protocol -- inference may afford a friendlier experience. I know there are differing opinions among language designers on how much automated inference the language should be permitted, but given the original purpose of Mathematica, one would expect it to err on the side of inference.

POSTED BY: James Bowery

If you really want to be lazy, Rasterize can convert any expression in the forntend to an Image So AnimationVideo[Rasterize[whaterver]] will always work.

AnimationVideo[
 Rasterize@
  Region[RegionIntersection[Sphere[{0, 0, 0}, 2], 
    InfinitePlane[{0, 0, z}, {{1, 0, 0}, {0, 1, 0}}]], 
   ViewPoint -> {2, 2, 2}, 
   PlotRange -> {{-2, 2}, {-2, 2}, {-2, 2}}], {z, -1.95, 1.95}]
POSTED BY: Martijn Froeling

Animation video only takes Head Image or Graphics. Your result outputs Head Region.

RegionPlot3D outputs Head Graphics and therefore works.

Or more cumbersome you could use DiscretizeRegion to extract the mesh primitives and make your own graphics.

POSTED BY: Martijn Froeling

I meant, instead of Region.

POSTED BY: Gianluca Gorni
Posted 2 years ago

Doing that substitution at least produces a video but it consists only of a bounding cube. It doesn't contain the animated circle when played.

POSTED BY: James Bowery

Try RegionPlot3D

POSTED BY: Gianluca Gorni
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