Comments (3)
I don't completely understand what happens here, but if you scale down the amplitude of your randomness it gets better. Also a parametric curve for your circle seems to be a better choice, since a circle object in Manim does not contain many points.
class Test(Scene):
def construct(self):
#circle = Circle()
circle = ParametricFunction(
lambda t: np.array([np.cos(t),np.sin(t),0]),
t_range=[0,2*PI,0.2]
)
# circle.apply_complex_function(
# lambda z: z*2
# )
circle.apply_complex_function(
lambda z: z*np.random.uniform(1.975, 2.025)
)
self.add(circle)
from manim.
Thanks @uwezi ,My purpose is to generate an irregular shape, and now I've found a way.
from manim import *
import random
class IrregularShapeDemo(Scene):
stroke_color = TEAL
fill_color = BLUE_E
fill_opacity = 1
height = 2
def construct(self):
plane = NumberPlane()
blob = VMobject()
blob.set_points_as_corners([
(1 + 0.3 * random.random()) * p
for p in compass_directions(12)
])
blob.close_path()
blob.set_fill(self.fill_color, self.fill_opacity)
blob.set_stroke(self.stroke_color)
blob.set(height=self.height)
blob.make_smooth()
blob.center().shift(UP+RIGHT)
self.add(plane, blob)
from manim.
looks nice!
I didn't know that already VMobject()
had the method .make_smooth()
from manim.
Related Issues (20)
- How do I set the background color of code in Manim? HOT 1
- SurroundingRectangle supports *mobjects
- Improvement on the python-dev version
- Trying to make a vector field, I got a message telling me to make a bug report HOT 1
- Axes don't work correctly HOT 3
- Tex-Mobject width and font_size arguments affect eachother HOT 4
- Updaters not refreshing between animations HOT 1
- Axes and the unit_size HOT 3
- Uhhh... help? HOT 1
- Manim HOT 1
- Manim render command leads to "cannot import name 'DEFAULT_DASH_LENGTH' from 'manim.mobject.geometry'" error HOT 1
- Color palette format and builder
- LaggedStart animation bugs when z-index of animated mobject is non-positive HOT 4
- Text repr to display current text
- ParametricFunction: wrong type hint HOT 1
- Transparent background with Opengl
- Intersection and difference bug HOT 3
- ValueTracker bug HOT 1
- Arabic text with less than 3 characters is not displayed
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from manim.