mirror of
https://github.com/3b1b/manim.git
synced 2025-09-01 00:48:45 +00:00
Updated fractals to be more vectorized
This commit is contained in:
parent
a7720f308d
commit
bfce74522a
1 changed files with 10 additions and 13 deletions
|
@ -19,15 +19,16 @@ class SpaceFillingCurve(VMobject):
|
||||||
CONFIG = {
|
CONFIG = {
|
||||||
"radius" : 3,
|
"radius" : 3,
|
||||||
"order" : 5,
|
"order" : 5,
|
||||||
"start_color" : RED,
|
"colors" : [RED, GREEN],
|
||||||
"end_color" : GREEN,
|
|
||||||
}
|
}
|
||||||
|
|
||||||
def generate_points(self):
|
def generate_points(self):
|
||||||
points = self.get_anchor_points()
|
points = self.get_anchor_points()
|
||||||
for pair in zip(points, points[1:]):
|
for triplet in zip(points, points[1:], points[2:]):
|
||||||
self.add(Line(*pair))
|
corner = VMobject()
|
||||||
self.gradient_highlight(self.start_color, self.end_color)
|
corner.set_points_as_corners(triplet)
|
||||||
|
self.add(corner)
|
||||||
|
self.gradient_highlight(*self.colors)
|
||||||
|
|
||||||
def get_anchor_points(self):
|
def get_anchor_points(self):
|
||||||
raise Exception("Not implemented")
|
raise Exception("Not implemented")
|
||||||
|
@ -151,8 +152,7 @@ class HilbertCurve3D(SelfSimilarSpaceFillingCurve):
|
||||||
|
|
||||||
class PeanoCurve(SelfSimilarSpaceFillingCurve):
|
class PeanoCurve(SelfSimilarSpaceFillingCurve):
|
||||||
CONFIG = {
|
CONFIG = {
|
||||||
"start_color" : PURPLE,
|
"colors" : [PURPLE, TEAL],
|
||||||
"end_color" : TEAL,
|
|
||||||
"offsets" : [
|
"offsets" : [
|
||||||
LEFT+DOWN,
|
LEFT+DOWN,
|
||||||
LEFT,
|
LEFT,
|
||||||
|
@ -177,8 +177,7 @@ class PeanoCurve(SelfSimilarSpaceFillingCurve):
|
||||||
|
|
||||||
class TriangleFillingCurve(SelfSimilarSpaceFillingCurve):
|
class TriangleFillingCurve(SelfSimilarSpaceFillingCurve):
|
||||||
CONFIG = {
|
CONFIG = {
|
||||||
"start_color" : MAROON,
|
"colors" : [MAROON, YELLOW],
|
||||||
"end_color" : YELLOW,
|
|
||||||
"offsets" : [
|
"offsets" : [
|
||||||
LEFT/4.+DOWN/6.,
|
LEFT/4.+DOWN/6.,
|
||||||
ORIGIN,
|
ORIGIN,
|
||||||
|
@ -219,8 +218,7 @@ class TriangleFillingCurve(SelfSimilarSpaceFillingCurve):
|
||||||
|
|
||||||
class UtahFillingCurve(SelfSimilarSpaceFillingCurve):
|
class UtahFillingCurve(SelfSimilarSpaceFillingCurve):
|
||||||
CONFIG = {
|
CONFIG = {
|
||||||
"start_color" : WHITE,
|
"colors" : [WHITE, BLUE_D],
|
||||||
"end_color" : BLUE_D,
|
|
||||||
"axis_offset_pairs" : [
|
"axis_offset_pairs" : [
|
||||||
|
|
||||||
],
|
],
|
||||||
|
@ -231,8 +229,7 @@ class UtahFillingCurve(SelfSimilarSpaceFillingCurve):
|
||||||
|
|
||||||
class FlowSnake(LindenmayerCurve):
|
class FlowSnake(LindenmayerCurve):
|
||||||
CONFIG = {
|
CONFIG = {
|
||||||
"start_color" : YELLOW,
|
"colors" : [YELLOW, GREEN],
|
||||||
"end_color" : GREEN,
|
|
||||||
"axiom" : "A",
|
"axiom" : "A",
|
||||||
"rule" : {
|
"rule" : {
|
||||||
"A" : "A-B--B+A++AA+B-",
|
"A" : "A-B--B+A++AA+B-",
|
||||||
|
|
Loading…
Add table
Reference in a new issue