ManimCommunity / ManimCommunity/manim

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

Open
#2,916 1 comment 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

new feature
Dominant language
Python
Stars
40.9k
Forks
3.1k
Avg merge
3d 12h
Merged PRs (30d)
25

Description

## 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

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start with VGroup.__getitem__ and compare it with the existing Group behavior described in the issue. Reproduce the two-dimensional example a[1:4, 2:4] and investigate the reported effects on other functions. Done means multidimensional slicing works for nested VGroups without breaking existing indexing behavior.

Written by the indexing model from the issue text.

Assessment

Tech stack
python
Domain
api
Issue type
Feature
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
30/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.