ManimCommunity / manim

A community-maintained Python framework for creating mathematical animations.
https://www.manim.community
MIT License
26.93k stars 1.85k forks source link

bounded_graph argument of the get_area() method #3470

Open brbisheng opened 1 year ago

brbisheng commented 1 year ago

perhaps I am wrong, but it seems to me that the bounded_graph argument of the get_area() method should have its behavior updated, since class ParametricFunction has no longer the t_min and t_max attributes.

Errors as below:

File /usr/local/lib/python3.8/site-packages/manim/mobject/graphing/coordinate_systems.py:1331, in CoordinateSystem.get_area(self, graph, x_range, color, opacity, bounded_graph, **kwargs) 1329 a, b = x_range 1330 if bounded_graph is not None: -> 1331 if bounded_graph.t_min > b: 1332 raise ValueError( 1333 f"Ranges not matching: {bounded_graph.t_min} < {b}", 1334 ) 1335 if bounded_graph.t_max < a:

AttributeError: 'function' object has no attribute 't_min'

Thank you for the brilliant Manim.

behackl commented 1 year ago

Indeed, thanks for the report! Fixing this would be a good first contribution, in case you are interested. :-)

brbisheng commented 1 year ago

Thank you also for the timely reply, I could try.. 😏 (although I am quite unfamiliar with the process.)

behackl commented 1 year ago

Feel free to try! We have a written guide to get started at https://docs.manim.community/en/stable/contributing/development.html -- and we've had a short session on contribution at our latest community meeting, you can find that to follow along here: https://youtu.be/JbUjqf4GVdM.

brbisheng commented 1 year ago

Thank you. 😎

vitesse206 commented 1 year ago

I would like to take a shot at it aswell. Is this possible (I am new to open-source)?

MrDiver commented 1 year ago

If @brbisheng is working on it then theres no need for 2 people to do the same work, but yes it's possible to contribute and we happily search for devs to help us.

Just take a look at the links mentioned above, otherwise you can just search for an issue that you might be interested in, and if you have questions regarding the dev process we are available on discord but if you write in dev-chat if you have questions for the process someone will answer! @vitesse206

brbisheng commented 1 year ago

Hello, everyone, it is ok, please work on it if you would like to!

MontroyJosh commented 8 months ago

In the functions.py file from manim/mobject/graphing/function.py, there appears to be an initialization of t_min on line 120. Does this issue persist? @brbisheng

Screenshot 2024-04-01 at 1 29 35 PM
acremers22 commented 8 months ago

I'm looking into a solution for this issue.

acremers22 commented 7 months ago

@behackl @brbisheng Following up.. we are still looking into this issue but are wondering if you have any additional details? To us, it seems that t_min and t_max are initialized in the ParametricFunction class in functions.py? Does this issue persist?