on the end I did my own UI and it worked fantastic, thanks for the great work!
Posts made by jansindl3r
-
RE: conditional control UI
-
Copy Page Data
Hi, is it possible to copy page data to another drawing? I am doing an animation where background stays and foreground refreshes. Just thought to save some computation to reusing the background drawing. Thanks!
-
RE: conditional control UI
@monomonnik thanks for the idea! It seems like too much custom work for the given budget. I think I will just split it into individual files then. But good to know it might be possible to do, hopefully will use that in some other project
-
conditional control UI
Hello,
I am want to provide a drawbot script to a client that allows them to execute and choose from a variety of image filters to apply to the canvas. Each image filter comes with distinct settings, and I've encountered difficulty in implementing a dropdown/radio input mechanism that dynamically updates the inputs within the drawbot control UI. Let's say I have filter A and B, filter A has settings M N O and filter B has just settings X Y. If it's not possible, I would just split the image filters into individual files.
Thanks, Jan
-
Find out whether a point is placed within an area
Hi, is there a function that finds out whether a point is placed on a path? Let's say we have a square and we want to know if a and b are on that square or outside.. like this ->
|--------| | | b | | | a | | | |--------|
a is on/in a square, b is not
-
RE: How can I split a path into multiple segments?
Hi @gferreira such distribution is not very even. I am sending result using svg.path, I will try to have a look on it. It seems like an interesting excercise for my drawBot class.
Thanks, Jan
-
RE: How can I split a path into multiple segments?
Thanks @gferreira !
I see that this is not ideal, you can only have one segment for this formula. Though in this result some of the segments seem a bit off.I am sharing result that works fine with use of svg.path, code is included. It is used outside of DrawBot IDE, because I didn't want to bother finding out how to install it there... sorry for that quick dirty parse of the SVG path from string...
import cmath import drawBot as db from svg.path import parse_path path = parse_path('M 300 100 C 100 100 200 200 200 300 L 250 350 L100 950') def points(): for i in range(10 + 1): i = i * 0.1 num = complex(path.point(i)) x, y = num.real, num.imag yield (x, y) db.newDrawing() x, y = [1000] * 2 db.newPage(x, y) db.fill(1) db.rect(0,0,x,y) db.fill(None) db.stroke(0) bezier = db.BezierPath() bezier.moveTo((300, 100)) bezier.curveTo((100, 100), (200, 200), (200, 300)) bezier.lineTo((250, 350)) bezier.lineTo((100, 950)) db.drawPath(bezier) db.fill(0) _points = points() for order, point in enumerate(_points): db.oval(*[val - 5 for val in point], 10, 10) db.saveImage('testje.png')
-
How can I split a path into multiple segments?
Hello,
please, as title questions.. How can I distribute points along a path? Let's say I have a path with two points and I need to equally place 20 points on it, how can I achieve it? Thanks, Jan!! -
RE: How to get width of text, including metrics?
@gferreira I also believe that you meant
textSize('string')
-
RE: How to get width of text, including metrics?
Hi @gferreira thanks a lot! Perfect..
Jan -
How to get width of text, including metrics?
Hi, I need to get width of text, including its metrics. When I use this underneath method, it gets width of text, but without metrics. Please, how can I get the full width, please? I need it to animate the text below to move exactly one width of letter.
font_name = 'monaco' string = 'HHHH' font_size = 300 fontSize(font_size) font(font_name) path = BezierPath() path.text(string, (0, 0), fontSize=font_size, font=font_name) left, bottom, right, top = path.bounds() stroke(0) strokeWidth(0.1) for i in range(100): for j in range(100): line((i * 10, 0), (i * 10, 700)) stroke(1, 0, 0) strokeWidth(2) line((left, 0), (left, 700)) line((right, 0), (right, 700)) stroke(None) text_width = right - left text_height = top - bottom text(string, (text_width/4,0)) text(string, (0,300)) saveImage('bug.png')
-
Place stroke on a shape's contour, with no offset
Please, how can I achieve this? I need the stroke to go along letter's contour, not offsetted to be outside of the letter/shape. Thanks!