[Python]: Basic drawing script

Discussion in 'Off Topic' started by el01, Jun 27, 2018.

  1. el01

    el01 King of Cable Management
    Thread Starter

    Hello all!
    Here is my very barebones and very basic Python drawing script, potentially useful for basic 2d drawings of anything with lots of straight lines. Hope you like it!
    http://py3.codeskulptor.org/#user301_SQe9434ET6_3.py

    Notes:
    Menu functions: STR means Store, RCL means recall, DEL means delete.
    Render times are in seconds.
    More documentation is inside the code.

    -el01
     
    Soul_Est and confusis like this.
  2. el01

    el01 King of Cable Management
    Thread Starter

    @Soul_Est
    Does it work well enough to be considered "not trash"? I tried a couple different scenarios, not sure how it performs for you.
     
  3. Soul_Est

    Soul_Est SFF Guru
    Silver Supporter

    It works very well with the points that I entered. The coordinates were not given a numerical order though. They came up as 0, 0, 2, and 2. It still worked though. May have to try this in Chromium to see if it's the rendering engine.
     
  4. el01

    el01 King of Cable Management
    Thread Starter

    Thanks for the feedback! On Chrome, it seems to work for me, but I will try to see what may cause this issue.
     
  5. el01

    el01 King of Cable Management
    Thread Starter

    @Soul_Est

    Sorry if I am disturbing your day, but I tested it further in Chrome, and it worked fine. However, it would be nice if you could take a screenshot and send it to me so I could figure out what is causing the problem.


    On the other hand, here is an updated version (which includes circle functionality, point definitions so you can see your points, and small improvements to the way information is displayed):
    http://py3.codeskulptor.org/#user301_SQe9434ET6_4.py
     
    Soul_Est likes this.
  6. Soul_Est

    Soul_Est SFF Guru
    Silver Supporter

    Not at all. Thanks for the update. I'll check it out after I get home from work and post a picture of what I get in Firefox.
     
  7. GuilleAcoustic

    GuilleAcoustic SFF Guru
    Moderator LOSIAS

    I didn't read the script at all, stopped at while 1==1, but here are my 2 cents as an experienced developper:
    • please use a main function: def main
    • never use infinite loop (while true), leave the opportunity to end the program with something else than Ctrl-C or process killing.
    Take a look at this prehistoric language called LOGO. This is basically what you are doing ;-)
     
    el01 likes this.
  8. jtd871

    jtd871 SFF Guru

    I miss the turtle....
     
    j├śrd and el01 like this.
  9. el01

    el01 King of Cable Management
    Thread Starter

    Will do tomorrow. Thanks!

    I will name the "end" command "PURGE" because Ubuntu makes deleting programs fun ;)

    @jtd871 If you want a rush of nostalgia, use Trinket.IO. You'll see what I mean after viewing some of their content.
     
  10. el01

    el01 King of Cable Management
    Thread Starter

    Finally, I am back from my short trip.
    http://py3.codeskulptor.org/#user301_SQe9434ET6_6.py

    I have thought of a way to make the images 3D: Essentially you shift points down, clone the shape, and make rectangles to fill the side.
    Work on said script will start in a few days and end in a few more days.