3b1b / 3b1b/manim

Minor issue related to rotate method.

未關閉
#2,451 0 則留言 0 個 reaction 已指派 0 人 在 GitHub 檢視
主要語言
Python
星號
93.9k
分支
7.7k
平均合併
2 天 13 小時
30 天內合併 PR
4

描述

I just wanted to comment on a minor issue I just ran into while using the `rotate()` method of mobjects. I understand the reason why `apply_points_function()` in `rotate()` by default has the option `works_on_bounding_box=False`. This is because rotation with respect to an object's center does not alter it's fixed hitbox. However it leads to some funny issues when you don't update the hitbox and the rotation is not with respect to the object's own center. Maybe the method should include some logic to automatically determine if the bounding box should be updated?
In my case I needed to keep track of the center of an object that was rotating with respect to the origin and do some operations with that position vector through an updater function. Since it calculates the center of an object through the hitbox the calculated center was always the initial position despite the object rotating. Then I realized I had to pass `works_on_bounding_box=True` so that it updates. It is not that big of a deal but I can see it leading to some annoying head scratcher moments for manim newbies like myself.

貢獻指南

這個儲存庫沒有索引到貢獻指南

研究方向

查看mobjects.py中的rotate方法,特別是apply_points_function是如何被呼叫的。了解bounding box更新邏輯以及works_on_bounding_box何時被設置。測試圍繞物件中心以外的點進行旋轉來查看問題。判斷是否可行在何時更新bounding box的自動偵測。

由索引模型根據 Issue 內容生成。

評估

領域
backend-api-design
Issue 類型
缺陷
難度
3/5
預估耗時
1-2 天
活躍度
停滯
描述清晰度
基本清楚
新手友好度
45/100

把新 issue 寄到你的電子郵件信箱

精選適合新手參與的 GitHub issue 摘要。