To draw this, drawing a horizontal line and set the width of it to zero, then set the stroke cap type to the Round Cap.

This method enables to seve the number of anchors as compared with drawing a circle with 4 anchors.
Additionally, if you set Resize tool's option to keep the stroke width, you can adjust the density of dots without scaling each of them.
To use the dot, I usually drag it into Brush palette, and register as a scatter brush.
Then I drag on the artboard.

... Looks dirty. Let's clean it by removing the overlapped dots with a script.

Now looks OK.
Before using the following script, you must expand the brush and then ungroup it so that every item is appeared as <Path> in the Layers palette. (You may have to ungroup twice after expand it.)
Then remove useless path (the track of the brush).
If I write a script for general purpose, I'll automate this ungroup process, and insert the error handling to avoid baffling abending.
But this time, I wrote this for one-time use and for my own use.
I often write small scripts like this to automate the boring part of daily work.
// removes overlapped dots
var sel = activeDocument.selection;
var j;
var vb = sel[0].visibleBounds;
var w = vb[2] - vb[0]; // right - left
w *= 1.25; // adds margin
w *= w; // for comparison of squared distance
for(var i = sel.length - 1; i > 0; i--){
for(j = i - 1; j >= 0; j--){
if( dist2(sel[i].pathPoints[0].anchor,
sel[j].pathPoints[0].anchor) <= w ){
sel[i].remove();
break;
}
}
}
// -------
function dist2(p, q){
return Math.pow(p[1] - q[1], 2)
+ Math.pow(p[0] - q[0], 2);
}
No comments:
Post a Comment
Note: Only a member of this blog may post a comment.