I’m having difficulty making custom vector brushes that behave the way I expect. I failed more often than I succeeded, so I decided to take a close look at this kind of brush.
Looking back, I’ve learned some useful things, got some surprises, and found things that appear to be broken and need some attention from Serif/Affinity.
I started by scouring the Help and the forums. I found several informative threads about making vector brushes, especially this one started by @AnnieW
I learned a lot from this exercise and I hope this information will help others. I also found repeatable unexpected behavior that I don’t understand, so I’m hoping someone can help, please.
After reading AnnieW’s epic thread, I made some brushes and started to examine their behavior closely. To keep things simple, I decided to start with just one kind of brush, Textured Intensity Brushes that produce repeating patterns.
I made 3 Textured Intensity brushes based on the same graphic at different sizes (128px, 256px and 512px). Brush Editor details are: 3X 128px Brush:
Nozzle: Combined 3 copies of the 128px source image.
Width 128px, Head offset 128px, Tail offset 256px, Body set to REPEAT
3X 256px Brush:
Nozzle: Combined 3 copies of the 256px source image.
Width 256px, Head offset 256px, Tail offset 512px, Body set to REPEAT
1X 512px Brush:
Nozzle: 1 copy of the 512px source image.
Width 512px, Head offset 0px, Tail offset 512px, Body set to REPEAT - so this brush essentially has neither Head nor Tail.
This is all in one file with 4 Artboards. There is one dartboard for each of the 3 brushes described above, and a fourth for some other brush. The Artboards are named for the subject brush. I also exported the brushes, and attached them in a .AFBrush file.
Each Artboard contains
The exported nozzle .PNG image (only for the 3 brushes described above), and
Several curves with the brush applied, with Stroke Width set to the Width of the brush, except for Artboard 4. All of the curves are “simple” with just two nodes, no complex curve geometry. All curves have Scale with Object ON.
a set of straight curves in lengths that are multiples of the brush width - hoping these would show the simplest brush behavior (no need to deform to the curve, simple numbers of repeats)
a set of gently twisted curves of different lengths to examine how the brush deforms to follow the curve.
The uploaded file represents the initial state for each of these tests. I can reproduce these behaviors at will. You can explore in any order, just be sure to start from the initial state (re-load the file or flush the history). Behavior on iPad and MacBook is the same unless otherwise noted.
Artboards 1, 2 and 3
Behavior on the “Straight” curves - In Order (2 and 3 have Scale with Object ON)
Scale with Object: Varying this setting changes the appearance of the brush stroke - but sometimes in surprising ways. This is with the file in its initial state, no edits required to trigger the behavior described.
turning this setting OFF deforms the stroke, with severe horizontal compression at what appears to be the correct stroke width.
Enabling it produces a result that looks good to me.
Same as iPad, but the degree of deformation clearly varies with the length of the curve.
Choice of Brush: The way the 1X 512px brush changes differs from the way the other two brushes change (idifferent nozzle structure).
Scale with Object ON appears to insert fewer repeats than the short curves can accommodate.
Scale with Object OFF is better but also fails for the shortest curve
I’m surprised Scale with Object has any effect in these circumstances as we’re not changing the size of the object. Surely it needs a “before” size and an “after“ size to figure out how to adjust the stroke width? This behavior persists even if you re-apply the brush to the curve.
I checked, and I can’t reproduce this behavior on a new curve in a new document with the same brushes, no matter the value of Scale with Object at the time the curve is created. I’m going to inspect that more closely later.
Cap: Varying the choice of Cap for the stroke also makes a difference.
Both Round and Square Caps essentially destroy this particular brush stroke - repeatably. Butt Cap is the only option that preserves the appearance of the brush. I’ve experimented with Cap many times on other brushes, this is the only time I’ve seen it destroy a stroke, so I’m rather surprised. What’s up - is there a BUG somewhere?
Length of Curve: Varying the length of the curves seems to be an adventure in its own right
If you extend a curve by dragging an end node, the appearance of the stroke changes slightly. If you observe closely, you can see the repeats get stretched/compressed as you drag an end node until an apparent threshold at which point another repeat gets added and all the repeats resize accordingly. Very good. Except for the fact that Scale with Object is ON - see next para.
If you extend a curve by dragging an end node, and then use Transform to shorten it, the appearance of the stroke changes dramatically. By selecting the Node tool you can see that Transform adjusted stroke Width (seems to be expected with Scale with Object set ON) .
If you extend one of the curves using Transform the Stroke Width gets bigger (I anchored the left end, extended to the right, but this does not seem to matter). Well, since we have Scale with Object ON, that’s probably what should happen. But it appears this does not happen when you lengthen the curve by dragging the right-end node.
Why does it matter how you change the length of a curve/size of an object? Seems Transform has it correct, dragging a node is not so smart,
Stroke Width: Varying stroke width to values smaller than the defined width of the brush generally seems to improve the appearance of the result - it looks more like the brush nozzle image. The bounded range of the Stroke Width slider limits testing, so it is hard to see what happens at Widths above 100px.
Behaviour on the “Bent” curves (2 and 3 have Scale with Object ON)
I’m aware that AD has to deform a brush stroke to adapt to bent curves, but I’d like to have a better understanding of how that affects the final appearance of the stroke and what, if anything, I can do to reduce the deformation. I guess some brushes are not going to work well on acute bends.
Scale with Object: ON consistently produces a better result than OFF for all brushes. Is this really correct?
Cap: Butt Cap is consistently better than Round or Square. Round and Square Caps both tend to fragment the nozzle image at the ends of the curve. Fewer repeats (Body) lead to more fragmentation.
Length of Curve: For variation in length I relied on multiple copies of a source curve, Transformed to different sizes preserving shape and aspect ratio. Stroke width was set to the height of the nozzle .PNG.
Scaling the Bent curves with Transform seems to behave correctly; Stroke Width scales up and down with object size.
I'm not sure how to compare dragging a node versus Transform for these curves.
Stroke Width: Varying stroke width to values smaller than the defined width of the brush generally seems to improve the appearance of the result - it looks more like the brush nozzle image. The bounded range of the Stroke Width slider limits testing, so its hard to see what happens at Widths above 100px
Someone I know told me that the best bugs are at the keyboard, so I decided to experiment with someone else’s brushes. I played with some of AnnieW’s brushes (see threads 106307 and 106308 in this forum) using the same structure as above.
I used @AnnieW;s Zigzag Stacked 5 brush with the Stroke Width set to 200px to go with a set of straight curves measuring 500px, 1000px, 2000px and 4000px (set to these lengths using Transform).
Scale with Object: ON consistently produces a better result than OFF which mangles the nozzle image, especially for the shorter curves.
Straight Curves: Butt Cap is the only choice that produces a good result. Round and Square Caps both essentially destroy the stroke (Sorry, AnnieW).
Bent Curves: Round and Square caps improved, Butt Cap is still the best.
Stroke Width: I varied Stroke Width to see if that affects Cap. In my opinion, Width of 200px produces better results than 80px, even though that is the native size of the brush.
Length of Curve
Straight Curves: Behavior is the same as for the 128px brush. Changing curve length by dragging a node does not change the stroke width to adapt, but if you use Transform to change curve lengths, stroke Width does adapt.
Bent Curves: With Transform the Stroke Width changes with increasing/decreasing Object size.
Stroke Width: Varying stroke width to values smaller than the defined width of the brush generally seems to improve the appearance of the result - it looks more like the brush nozzle image. The bounded range of the Stroke Width slider limits testing, so its hard to see what happens at Widths above 100px.
So, I learned some things and got a few surprises.
I think the questions that need answers are
Why does Scale with Object have any effect under these initial conditions? I didn't trigger it by changing the size/length of the curves.
Why does it matter how you change the length of a curve/Object size? (Transform vs drag node)
Why do Round and Square Caps destroy these brush strokes?
The shorted straight curve in Artboard 3 is long enough to fit 2 repeats, but you only get 1. Why?
Thanks in advance
I'm running the most current versions of AD on MacBook (Catalina) and iPad (latest)
Textured Intensity Brushes - Tests 01 Other Brushes No History.afdesign Textured Intensity - Aspect Ratio Test.afbrushes