1
$\begingroup$

I want to find out how the art brush in adobe illustrator works.

It looks like it's taking some vector art and applying it to a smooth line.

enter image description here

How can I go about implementing this?

$\endgroup$

1 Answer 1

3
$\begingroup$

These rely on a transformation from global coordinates to path local coordinates, where the local axes are along and out (or more often u and v). In essence this all works on a principle similar to how offset works.

enter image description here

Image 1: Depiction of local axes.

Now the first one ($A$) is a sweep of an oval. Which is technically the most challenging of the four. In essence You offset edges directionally and cap them with a fixed directional oval. Although this has all kinds of interesting edge cases. A lot of mathematical lore is known about sweeping shapes as this is somewhat hard to do in 3D and doing so with an arbitrary shape is useful for the cad crowd. At it simplest its just sampling many times, which allows for change in shape along line, but quite sophisticated approaches are available.

enter image description here

Image 2: Oval sweep.

The second is simply (bombing) a shape in random places in the new coordinate system. Mathematically this is pretty simple. Generate a number in along direction then find that point. Then generate a second number and multiply that by the normal direction vector of your path then add this to the point.

The third and fourth just do this for a lot of points read in form a Cartesian template object. Again you should familiarize yourself with how offset and graduated offset is done. You can find a lot of references but one of my favorite online resource for Béziers is in the Pomax Bézier primer. Its just lot of small offset lines to transform from.

$\endgroup$
0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.