Navigation

    • Register
    • Login
    • Search
    • Categories
    • Recent
    • Tags
    • Users
    • Groups
    • Solved
    • Unsolved
    • Search
    1. Home
    2. General Discussion
    Log in to post

    General Discussion

    • mrrouge

      UNSOLVED Random Lines with no intersection
      randomness • • mrrouge  

      4
      0
      Votes
      4
      Posts
      448
      Views

      jo

      @mrrouge ok if i got you right you want the function to return a value — in your case the height of the legs. this value could then be used in a while loop. while loops are quite helpful but might run forever if done incorrect. I adapted the code a bit so the legs function returns the length of the legs which is then added to the y value in the while loop. There is a check inside the while loop so it will run for a maximum of 3000 times. # ------------- # settings pw = ph = 500 amount_x = 10 cell_w = pw / amount_x max_h = 50 gap = max_h * .2 # ------------- # fucntion(s) def legs(pos, max_w, max_h): x, y = pos length = random() * max_h step_s = random() * max_w polygon((x - step_s, y) , (x, y + length), (x + step_s, y), close = False) return length # ------------- # drawings newPage(pw, ph) fill(None) stroke(0) strokeWidth(2) for x in range(amount_x): count = 0 y = -random() * max_h while y < ph: y += legs((x * cell_w + cell_w/2, y), cell_w/2, max_h) y += gap count += 1 if count > 3000: break and the while loop without the check: for x in range(amount_x): y = -random() * max_h while y < ph: y += legs((x * cell_w + cell_w/2, y), cell_w/2, max_h) y += gap
    • MauriceMeilleur

      SOLVED Overlapping paths
      bezierpath remove overlap • • MauriceMeilleur  

      9
      0
      Votes
      9
      Posts
      537
      Views

      MauriceMeilleur

      I can't say for sure, but just thinking about the editing I'd been doing when I ran into the problem, open paths would be the more likely explanation. Anyway, it's working now—time to move on to new problems.
    • mrrouge

      SOLVED determine centerpoint in irregular rectangle / create "composition"
      geometry • • mrrouge  

      5
      0
      Votes
      5
      Posts
      355
      Views

      mrrouge

      thanks @}->--
    • mrrouge

      SOLVED Hi can somebody help me randomize shapes within a loop ?
      randomness • • mrrouge  

      3
      0
      Votes
      3
      Posts
      299
      Views

      mrrouge

      Cool thanks for your help ! Iam really struggling to find the right information in the reference
    • ThunderNixon

      SOLVED Update font family in FormattedString
      text • • ThunderNixon  

      2
      0
      Votes
      2
      Posts
      299
      Views

      frederik

      Setting a font in a formatted string will only be used for text appended afterwards: txt.font(...) will not alter the font attribute for existing texts in the formatted string. For each page you will need to create a fresh formatted string.
    • mrrouge

      SOLVED Moving Anchor point of a Primitive to its middle ?
      transformations geometry • • mrrouge  

      3
      0
      Votes
      3
      Posts
      346
      Views

      mrrouge

      thanks a lot
    • Maarten Idema

      SOLVED Using a virtualenv in Drawbot
      modules drawbot as module • • Maarten Idema  

      12
      0
      Votes
      12
      Posts
      3571
      Views

      justvanrossum

      Oh, I've been trapped by a bot it seems Still, my answer may be useful
    • geancarle

      SOLVED which fonts compatible with variations?
      variable fonts • • geancarle  

      3
      0
      Votes
      3
      Posts
      376
      Views

      gferreira

      hi. see also v-fonts.com
    • FutureDays

      SOLVED Entering Font Properties into Existing Python Code
      animation text • • FutureDays  

      3
      0
      Votes
      3
      Posts
      459
      Views

      FutureDays

      Hello, Once again, thank you for being so helpful. Enjoy the day. Best. Robert
    • micahmicah

      SOLVED Plot objects along a path
      bezierpath • • micahmicah  

      3
      0
      Votes
      3
      Posts
      443
      Views

      micahmicah

      @gferreira wondrful! Thank you so much!
    • micahmicah

      This topic is deleted!
      • micahmicah  

      2
      0
      Votes
      2
      Posts
      2
      Views
    • jb

      UNSOLVED Create forms in PDF
      • jb  

      2
      0
      Votes
      2
      Posts
      307
      Views

      frederik

      so far there is no support for any kind of forms.
    • fooness

      SOLVED Animate in Drawbot, without exporting .gif …
      animation • • fooness  

      7
      0
      Votes
      7
      Posts
      1069
      Views

      andyclymer

      While I'm working on an animation I run the script once to save the .gif file to the disk, then I select the file and hit the space bar to open it in Quick Look to preview the animation. I leave this preview window open in the Finder while I continue to work on editing the script in DrawBot — every time the file gets updated with a newly saved .gif it will automatically start previewing the new version. Kind of a strange technique but it works!
    • dyb

      SOLVED BezierPath: Contours and Segments
      bezierpath • • dyb  

      5
      0
      Votes
      5
      Posts
      540
      Views

      dyb

      I was comparing a different fonts apparently, my bad.The paths are indeed going the right way.
    • FutureDays

      SOLVED Changing Squares to Five Point Stars with JVR Code
      animation geometry • • FutureDays  

      6
      0
      Votes
      6
      Posts
      706
      Views

      FutureDays

      @gferreira Hello gferreira, Thank you so much the reply has been very helpful. I can see that I was thinking too much about modifying all areas of the code instead of changing a small component. Enjoy the day. Best. Robert
    • MishaHeesakkers

      SOLVED When exporting a large amount of frames is there a possibility to track the duration of this process?
      animation • • MishaHeesakkers  

      5
      0
      Votes
      5
      Posts
      633
      Views

      frederik

      oh, there is indeed no progress callback on saveImage(..) Doing some googling on 'progress' and 'ffmpeg' does not results in a clear solution. DrawBot has a small wrapper around ffmpeg to generate movies: see https://github.com/typemytype/drawbot/blob/master/drawBot/context/tools/mp4Tools.py
    • MishaHeesakkers

      SOLVED Are there any tutorials on how to build Drawbot python files via Sublime?
      drawbot as module • • MishaHeesakkers  

      4
      0
      Votes
      4
      Posts
      523
      Views

      gferreira

      @MishaHeesakkers animated gifs can be viewed with a browser. see this example
    • brintown

      SOLVED Masking
      clipping • • brintown  

      4
      0
      Votes
      4
      Posts
      517
      Views

      brintown

      thanks @frederik and @gferreira for the helpful hints!
    • micahmicah

      SOLVED Typographic white space?
      text • • micahmicah  

      3
      0
      Votes
      3
      Posts
      511
      Views

      micahmicah

      @frederik wonderful! Thank you!
    • MauriceMeilleur

      SOLVED while()
      • MauriceMeilleur  

      4
      0
      Votes
      4
      Posts
      939
      Views

      frederik

      see also http://pythonfordesigners.com/how-to-keep-doing-things-until-you-need-to/ http://robofont.com/documentation/building-tools/python/collections-loops/#while-loops
    Drawing With Python