Skip to content

The objetive is to do a iteractive method of learn about space filling curves and recursive language Lindenmayer Systems

License

Notifications You must be signed in to change notification settings

thigs0/space-filling-curves_python

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

43 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

space-filling-curves_python

To product a video about Space-filling curve, a make a code based on Lindenmayer system, with objective animate with python

It can be used to teach about recursive functions, to product video and teach childrens about the turtle power.

To construct the curve faster, use https://github.com/PrincetonLIPS/numpy-hilbert-curve

Corrigir:

  • The 3d curves have a error at constants. At both

  • The Gosper_Flowsnake_curve have a little erro that make the iteraction >3 colapse in some lines Plus

    • Add proprietis to change colors with make the iteractions
    • Add the options which Letter start

    How to use

    • Install the package

    pip install L-SpaceCurves

from L_SpaceCurves import L_SpaceCurves as ls

l = ls.L_SpaceCurves(leng=10, speed=0, iter=2, origin=(0, 0))
# leng is the size of each line to construct the curve
# speed is the speed to contruct the curve. 0 fast, 10 sloow
# iter is the total of iteractions that you wish (more iteractions is more time)
$ origin is a tuple that set the origin of curve ( nor always the center od curve is the center od figure)
  • to plot in 2D, only select the start letter. Choose one below
Function Starts letters
sierspinski_curve S R Z P
hilbert_curve C H A B
peano_curve P Q R S
gosper_Flowsnake_curve G R
pablo_curve A B C D
  • to plot in 3D, select the start letter and call the function "plot()"
function Letters
hilbert_3D A B C D E F G H I J K L
peano_3D S P R Q

At 2D, was used the Turtle

2D Curves

  • sierspinski_curve

  • Hilbert_curve hilbert_curve

  • Peano_curve Peano_curve

  • Gosper_Flowsnake_curve Gosper_curve

  • dragon curve

  • Pablo curve, that a create to a friend

pablo_curve

At 3d, was used the aplications matplotlib

3D Curves

  • Hilbert curve hilbert_3d

  • Peano curve peano_3d

About

The objetive is to do a iteractive method of learn about space filling curves and recursive language Lindenmayer Systems

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages