Navigation

    • Register
    • Login
    • Search
    • Categories
    • Recent
    • Tags
    • Users
    • Groups
    • Solved
    • Unsolved
    • Search
    1. Home
    2. djrrb
    3. Best
    • Profile
    • Following
    • Followers
    • Topics
    • Posts
    • Best
    • Groups

    Best posts made by djrrb

    • RE: image patterns as shape fill

      This is an old post I realize, but since I just happened to stumble upon it and it didn’t get any responses, I’ll just mention that you can use clipPath() and then looping through a grid and drawing an image.

      # make an image that we’ll tile
      im = ImageObject()
      im.sunbeamsGenerator(
          (100, 100),  # size
          (0, 0),  # center
          )
      
      # draw a single tile in the lower left, for reference
      image(im, (0, 0))
      
      # get the size 
      imWidth, imHeight = im.size()
      rows = int(ceil(height()/imHeight))
      cols = int(ceil(width()/imWidth))
      
      # make a shape
      shape = BezierPath()
      shape.oval(100, 100, 800, 800)
      shape.rect(500, 500, 400, 400)
      
      # i always like to save state before clip path
      with savedState():
          # clip the path using the shape
          clipPath(shape)
          # loop through y and x to make a grid
          for y in range(rows):
              for x in range(cols):
                  # draw the image a bunch of times
                  image(im, (x*imWidth, y*imHeight))
      
      posted in General Discussion
      djrrb
      djrrb
    • RE: Markdown syntax for FormattedString?

      I hope you don’t mind me reviving this...I’ve been trying to work with @frederik’s gist from march, and cannot seem to get beyond this error after installing markdown using the package manager. Usually I would just ascribe this to my weird python setup, but since Drawbot is its own self-contained universe, I wonder if there is something obvious I am missing?

      Drawbot Version 3.126, MacOS 10.15.7 (19H2)

      Many thanks!

      Traceback (most recent call last):
        File "<untitled>", line 72, in <module>
        File "<untitled>", line 14, in appendMarkdown
        File "/Users/david/Library/Application Support/DrawBot/Python3.7/markdown/__init__.py", line 29, in <module>
        File "/Users/david/Library/Application Support/DrawBot/Python3.7/markdown/core.py", line 27, in <module>
        File "/Users/david/Library/Application Support/DrawBot/Python3.7/markdown/preprocessors.py", line 29, in <module>
        File "/Users/david/Library/Application Support/DrawBot/Python3.7/markdown/htmlparser.py", line 31, in <module>
      AttributeError: 'zipimport.zipimporter' object has no attribute 'exec_module'
      
      posted in Feature Requests
      djrrb
      djrrb