如何使同心圆之间的距离相等?

平面设计 adobe-illustrator 形状
2022-02-13 06:35:21

一段时间以来,我一直在反对这一点。环未对齐的原因是因为我最初是在 Photoshop 中启动该项目的。

如何将环之间的距离更改为统一测量?

这是戒指的特写。现在你可以看到有些比其他的更接近。

在此处输入图像描述

这是完整图像的照片:

在此处输入图像描述

4个回答

我想说这样的事情最好用自动化来完成。想象一下你的收藏中间的一个项目的宽度发生了变化,你将不得不重建一半的圆圈。或者你需要把所有的圆圈加宽 50%。天啊!

我不知道 Illustrator 脚本,但在 Photoshop 中它非常简单。基本上,我有一个具有,data等属性的数组name并且我有一个函数可以在具有特定半径的特定坐标中创建形状图层。另外,我还有几个附加参数,例如圆之间的间隙、圆的最大宽度和起始半径。valuecolor

使用这些数据,我在一个循环中为每个数据条目创建一个圆圈。中心始终是文档中心,宽度是根据最大宽度和找到的最大数据值线性计算的,半径是根据宽度、先前半径和间隙计算的。

以下是基于间隙、起始半径和最大宽度的不同设置的不同结果:

在此处输入图像描述

我使用的代码:

function main()
{

    //data definitions
    var center = {
        x: activeDocument.width.as("px") / 2,
        y: activeDocument.height.as("px") / 2
    };
    var gap = 3; // gap between circles
    var startRad = 200; // starting radius
    var maxWidth = 15; // maximum width
    var maxValue = -1; // stores maximum value found
    var width, i;

    var data = [
    {
        color: [223,41,53],
        value: 22,
        name: "Jerelyn Pinkbeard"
    },
    {
        color: [65,39,34],
        value: 13,
        name: "Spiteful Christine Black"
    },
    {
        color: [223,160,110],
        value: 44,
        name: "Generous Christi"
    },
    {
        color: [12,243,187],
        value: 4,
        name: "Scrawny Tiphanie"
    },
    {
        color: [134,186,144],
        value: 12,
        name: "Cutthroat Deena The Spiteful"
    },
    {
        color: [5,47,95],
        value: 22,
        name: "Jerilyn Blackhate"
    },
    {
        color: [0,83,119],
        value: 60,
        name: "Tiphanie Generousparrot"
    },
    {
        color: [6,167,125],
        value: 33,
        name: "First Mate Christa The Scrawny"
    },
    {
        color: [213,198,122],
        value: 12,
        name: "Dread Pirate Geraldine"
    }];

    /////////////////////////////////////////////////////////////////////////////////////
    // START

    // first calculating maximum value of all data properties to use it later for linear transforms
    for (i = 0; i < data.length; i++)
    {
        if (data[i].value > maxValue) maxValue = data[i].value;
    }

    // creating circles
    for (i = 0; i < data.length; i++)
    {
        //calculating width lineary based on maximum value found and maximum width possible
        width = linear(data[i].value, 0, maxValue, 0, maxWidth);

        createCircle(
        {
            x: center.x, // X center of the document
            y: center.y, // Y center of the document
            color: data[i].color, // color from my data
            width: width, // calculated width
            radius: startRad, // starting radius
            name: data[i].name // and a name
        });

        startRad += width + gap; // updating starting radius with width and gap
    }

    function createCircle(data)
    {
        var desc2 = new ActionDescriptor();
        var ref1 = new ActionReference();
        ref1.putClass(sTID('contentLayer'));
        desc2.putReference(cTID('null'), ref1);
        var desc3 = new ActionDescriptor();
        var desc4 = new ActionDescriptor();
        var desc5 = new ActionDescriptor();
        desc5.putDouble(cTID('Rd  '), 45.000001);
        desc5.putDouble(cTID('Grn '), 77.000003);
        desc5.putDouble(cTID('Bl  '), 113.000001);
        desc4.putObject(cTID('Clr '), cTID('RGBC'), desc5);
        desc3.putObject(cTID('Type'), sTID('solidColorLayer'), desc4);
        var desc6 = new ActionDescriptor();
        desc6.putInteger(sTID('unitValueQuadVersion'), 1);
        desc6.putUnitDouble(cTID('Top '), cTID('#Pxl'), data.y - data.radius);
        desc6.putUnitDouble(cTID('Left'), cTID('#Pxl'), data.x - data.radius);
        desc6.putUnitDouble(cTID('Btom'), cTID('#Pxl'), data.y + data.radius);
        desc6.putUnitDouble(cTID('Rght'), cTID('#Pxl'), data.x + data.radius);
        desc3.putObject(cTID('Shp '), cTID('Elps'), desc6);
        var desc7 = new ActionDescriptor();
        desc7.putInteger(sTID('strokeStyleVersion'), 2);
        desc7.putBoolean(sTID('strokeEnabled'), true);
        desc7.putBoolean(sTID('fillEnabled'), false);
        desc7.putUnitDouble(sTID('strokeStyleLineWidth'), cTID('#Pxl'), data.width);
        desc7.putUnitDouble(sTID('strokeStyleLineDashOffset'), cTID('#Pnt'), 0.000000);
        desc7.putDouble(sTID('strokeStyleMiterLimit'), 100.000000);
        desc7.putEnumerated(sTID('strokeStyleLineCapType'), sTID('strokeStyleLineCapType'), sTID('strokeStyleButtCap'));
        desc7.putEnumerated(sTID('strokeStyleLineJoinType'), sTID('strokeStyleLineJoinType'), sTID('strokeStyleMiterJoin'));
        desc7.putEnumerated(sTID('strokeStyleLineAlignment'), sTID('strokeStyleLineAlignment'), sTID('strokeStyleAlignOutside'));
        desc7.putBoolean(sTID('strokeStyleScaleLock'), false);
        desc7.putBoolean(sTID('strokeStyleStrokeAdjust'), false);
        var list1 = new ActionList();
        desc7.putList(sTID('strokeStyleLineDashSet'), list1);
        desc7.putEnumerated(sTID('strokeStyleBlendMode'), cTID('BlnM'), cTID('Nrml'));
        desc7.putUnitDouble(sTID('strokeStyleOpacity'), cTID('#Prc'), 100.000000);
        var desc8 = new ActionDescriptor();
        var desc9 = new ActionDescriptor();
        desc9.putDouble(cTID('Rd  '), data.color[0]);
        desc9.putDouble(cTID('Grn '), data.color[1]);
        desc9.putDouble(cTID('Bl  '), data.color[2]);
        desc8.putObject(cTID('Clr '), cTID('RGBC'), desc9);
        desc7.putObject(sTID('strokeStyleContent'), sTID('solidColorLayer'), desc8);
        desc7.putDouble(sTID('strokeStyleResolution'), 72.000000);
        desc3.putObject(sTID('strokeStyle'), sTID('strokeStyle'), desc7);
        desc2.putObject(cTID('Usng'), sTID('contentLayer'), desc3);
        desc2.putInteger(cTID('LyrI'), 2);
        executeAction(cTID('Mk  '), desc2, DialogModes.NO);

        if (data.name != undefined)
        {
            var desc = new ActionDescriptor();
            var ref = new ActionReference();
            ref.putEnumerated(cTID("Lyr "), cTID("Ordn"), cTID("Trgt"));
            desc.putReference(cTID('null'), ref);
            var descName = new ActionDescriptor();
            descName.putString(cTID('Nm  '), data.name);
            desc.putObject(cTID('T   '), cTID('Lyr '), descName);
            executeAction(cTID('setd'), desc, DialogModes.NO);
        }
    } // end of createCircle()

    function linear(X, A, B, C, D)
    {
        var Y = (X - A) / (B - A) * (D - C) + C
        return Y;
    };

    function cTID(s)
    {
        return app.charIDToTypeID(s);
    }

    function sTID(s)
    {
        return app.stringIDToTypeID(s);
    }

}
app.activeDocument.suspendHistory("create circles", "main()");

很遗憾,您还没有在 Illustrator 中开始您的项目。Photoshop 不适合此类工作,因为输出将是光栅,而不是矢量。我想你可以重新开始。正如 Scott 所说,除了找到(或编写)脚本之外,Illustrator 和 Photoshop 都没有任何自动缩放各种宽度的同心圆的方法,以便事后它们之间的间隙相同。

在 Illustrator 中,创建一个极坐标网格并使用 Live Paint 桶填充单元格非常容易。

例如:

在此处输入图像描述

  • 全选

  • 垂直居中对齐

  • 水平居中对齐

当然,这不会改变圆的直径

如果您希望每个之间的距离相等,则需要使用合适尺寸的直径。

在那种情况下......老实说,重新开始可能更容易。看这里。

在 Illustrator 中重新启动。制作一个包含每个环的矩形片的艺术画笔。将画笔应用于圆形笔划:

在此处输入图像描述

我画了5个矩形。它们的宽度 = 想要的环宽度。它们被全部选中并拖到画笔集合中。在定义对话框中,我选择了“艺术画笔”。查看定义对话框:

在此处输入图像描述

我画了一个直径 = 环的平均直径的圆,然后将新刷子应用到它上面。它在第一个附加图像的左侧。