Git Product home page Git Product logo

pablopacheco / superturtle Goto Github PK

View Code? Open in Web Editor NEW
0.0 1.0 0.0 803 KB

Convert the Python turtle into a class called SuperTurtle, which provides new functionalities by executing/creating methods within the SuperTurtle class. Create new drawings, including circles, polygons, Cartesian and polar arrays of various shapes, fractals (recursive and L-system-based), and arrays of figures positioned at specific coordinates.

Python 100.00%
dibujo draw drawing fractal fractales fractals l-system l-systems python python-3

superturtle's Introduction

Super Turtle

Pablo Pacheco Pérez

Convert the Python turtle into a class called SuperTurtle, which provides new functionalities by executing/creating methods within the SuperTurtle class. Create new drawings, including circles, polygons, Cartesian and polar arrays of various shapes, fractals (both recursive and L-system-based), and arrays of figures positioned at specific coordinates.

  • Convert the classic Python turtle into a class called superTurtle.
  • It will gain new functionalities by executing/creating methods of the superTurtle class.
  • Use the methods of the superTurtle class to quickly create new drawings, such as:
    • Circles drawn from the center.
    • Polygons.
    • Cartesian arrays of different shapes (which can be created using other methods of the same class).
    • Polar arrays of shapes.
    • Geometric figures.
    • Fractals using recursive functions.
    • Fractals using the L-system method.
    • Arrays of figures on points with established coordinates.

Some of the elements:

Circle: (circulo2)

  • Function Name: circulo
  • radio
  • steps: number of lines that compose the circle
  • colorRelleno: fillColor

Polar Array (polararray)

  • nrad: number of elements in the radial direction
  • nang: number of elements in the angular direction
  • l0r1:
    • if 0, the array is created counterclockwise
    • if 1, the array is created clockwise
  • ang: angle/arc covered by the elements
  • ang0: initial angle of inclination of the array
  • radio0: initial radius where the elements of the array start

Poligon (poligon)

  • n: number of sides
  • lado: side length
  • vertex: True or False, whether the polygon starts from the edge or the vertex

Cartesian Array (xyarray)

  • lx: length of the array in X
  • ly: length of the array in Y
  • nx: number of elements in the array in X
  • ny: number of elements in the array in Y
  • center: False or True, whether the array is centered at the initial point

Line Array (linearray)

  • nlines: number of lines
  • lline: line length
  • startangle: initial angle of inclination of the array
  • totalangle: angle/arc covered by the elements
  • l0r1:
    • if 0, the array is created counterclockwise
    • if 1, the array is created clockwise

Requirements

It works for me with the following versions:

svg-turtle 0.4.1
numpy 1.21.5
pandas 1.4.4
python 3.9.13 matplotlib 3.5.2

Examples

Check the examples folder, you will find ipynb files with a wide variety.

superturtle's People

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.