manim icon indicating copy to clipboard operation
manim copied to clipboard

Hope to add multi-dimensional slicing function for VGroup like Numpy.Array

Open zg-young opened this issue 3 years ago • 1 comments

Description of proposed feature

A slice function like Numpy.Array,for example:

a = VGroup(Vgroup(..), ...) # 2 dim vgroup a[1:4, 2:4] # slice

How can the new feature be used?

Slice function will make great sense for 2 dim mobject vgroup,if 2 dim Square vgroup represents a image, I want to get a part of image(that is a patch),but there is no simple method to impIement it, I have tried many times to overwrite Vgroup's method getitem(succeed to Group),but there is bug, which will affect other functions.

Additional comments

zg-young avatar Aug 07 '22 01:08 zg-young

The only problem I see with this is that, unlike in NumPy where all rows would have the same length, there's nothing enforcing that all the internal Groups or Mobjects have the same amount of submobjects, so one can easily index out of bounds.

Otherwise, I like this idea!

chopan050 avatar Dec 02 '24 13:12 chopan050