• Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
    Dedicated community for Japanese speakers
  • 한국 커뮤니티
    Dedicated community for Korean speakers
Exit
0

Electric Polar Vector

Engaged ,
Jan 01, 2023 Jan 01, 2023

Copy link to clipboard

Copied

Does anybody know how to recreate this electric polar vector in Ai? (It seems the Blend tool doesn't work! Cause it reshapes the lines' thickness). I think a script would do the job. Any help?

 

ss.png

TOPICS
Draw and design

Views

521

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines

correct answers 1 Correct answer

Guide , Jan 03, 2023 Jan 03, 2023

That was indeed a poor script.  Here's version 2.0. 

var n = prompt("Enter square root (side):", 15, " ");
if (n > 30) n = 30;
var distance = 10;
var increment = distance / (0.5 * n);
var doc = app.activeDocument;
var x =   doc.width / 2;
var y = - doc.height / 2;
var group = doc.groupItems.add();
if (n % 2) {
    var start1 = start2 = 0;
} else {
    var start1 = distance / 2;
    var start2 = increment;
}
drawQuadrent(-1,  1);
drawQuadrent(-1, -1);
drawQuadrent( 1,  1);
drawQuadrent( 1, -1);
fu
...

Votes

Translate

Translate
Adobe
Community Expert ,
Jan 01, 2023 Jan 01, 2023

Copy link to clipboard

Copied

It would work creating this with a blend. But before you blend them, you would have to make the dots in both groups the same size. For this, you will have to mesure one dot in each group. Then do the math. Then lock one of the groups. Ungroup the other one and then use Object  > Transform > Transform each to make the dots the same size. Then group them again.

 

Then unlock the other group, and blend both the groups.

 

And since the mention of blend can be misunderstood, here's how I interpreted it: https://shared-assets.adobe.com/link/2d3df8ea-42dd-484d-4e36-95cee60c36ff  (probably too many steps in the blend)

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Engaged ,
Jan 02, 2023 Jan 02, 2023

Copy link to clipboard

Copied

Too complicated (of course, for me!). I am reverse engineering your Ai file. Thanks for sharing.

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Jan 01, 2023 Jan 01, 2023

Copy link to clipboard

Copied

You could create a grid of dots, group it and apply the Classic 3D Extrude effect with perspective.

Screenshot 2023-01-01 at 16.49.53.png

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Jan 01, 2023 Jan 01, 2023

Copy link to clipboard

Copied

Nice one, Ton. Looks great.

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Jan 01, 2023 Jan 01, 2023

Copy link to clipboard

Copied

Thanks Larry, a little fireworks to start the new year 🙂

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Engaged ,
Jan 02, 2023 Jan 02, 2023

Copy link to clipboard

Copied

Great idea, but it doesn't work for me! Because it changes shapes perspective too (shapes at the end of the square). I need all of them to be one size.

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Jan 03, 2023 Jan 03, 2023

Copy link to clipboard

Copied

Great!

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Jan 01, 2023 Jan 01, 2023

Copy link to clipboard

Copied

A simple blend with at least one little blemish.

 

Electric Polar Sample Blend

 

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Engaged ,
Jan 02, 2023 Jan 02, 2023

Copy link to clipboard

Copied

Thanks. I am reverse engineering your file. That's what exactly I want.👍

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Guide ,
Jan 01, 2023 Jan 01, 2023

Copy link to clipboard

Copied

This is not ideal but works OK with square numbers with even roots (e.g. 100 or 400). 

 

var doc = app.activeDocument;
var group = doc.groupItems.add();
var n = prompt("Enter number:", 100, " ");
if (n > 1000) n = 1000;
var m = Math.sqrt(n);
var x1 = 0;
var f2 = 0.1, f1 = (m / 2) * f2;
for (var i = 0; i < m; i++) {
x1 += 10;
if (i < m / 2) x2 = x1 - m * f1, f1 -= 0.1;
else x2 = x1 + m * f2, f2 += 0.1;
var y1 = 0;
var f4 = 0.1, f3 = (m / 2) * f4;
for (var j = 0; j < m; j++) {
y1 -= 10;
if (j < m / 2) y2 = y1 + m * f3, f3 -= 0.1;
else y2 = y1 - m * f4, f4 += 0.1;
var path1 = activeDocument.pathItems.add();
path1.setEntirePath([[x1, y1], [x2, y2]]);
path1.moveToEnd(group);
}
}
group.position = [
(doc.width / 2) - (group.width / 2),
(-doc.height / 2) + (group.height / 2)
];

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Engaged ,
Jan 02, 2023 Jan 02, 2023

Copy link to clipboard

Copied

Thanks. I think you solved it most mathematically! Can I ask for a bit more help?
I have to make a JS script from your codes and then apply it to a circle/dot. Is it right?

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Guide ,
Jan 02, 2023 Jan 02, 2023

Copy link to clipboard

Copied

Sorry, I don't understand the question. The script has no requirements other than having an open document.  By the off chance that you're asking how to run a script:  Copy and paste it in a jsx file. (You can create a txt file and change the extension to jsx.)  Then, while your document is open in Illustrator, go to File > Scripts > Other Script (Ctrl+F12). Find your script and open it.

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Engaged ,
Jan 03, 2023 Jan 03, 2023

Copy link to clipboard

Copied

I am aware of creating a script from a code and running it from Ai. I did it, but I changed the extension to JS instead of JSX. I thought I had to draw a shape (circle or rectangle) and then apply the script to it. Yes! I realized the script does not need any shape (just an open doc). Great script, many thanks. 

I have another question. There is a problem, even if I enter a big number like 225 (15*15), the centre column and row are not an exact horizontal/vertical (0/90 degree) line.

 

ss.png

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Guide ,
Jan 03, 2023 Jan 03, 2023

Copy link to clipboard

Copied

That was indeed a poor script.  Here's version 2.0. 

var n = prompt("Enter square root (side):", 15, " ");
if (n > 30) n = 30;
var distance = 10;
var increment = distance / (0.5 * n);
var doc = app.activeDocument;
var x =   doc.width / 2;
var y = - doc.height / 2;
var group = doc.groupItems.add();
if (n % 2) {
    var start1 = start2 = 0;
} else {
    var start1 = distance / 2;
    var start2 = increment;
}
drawQuadrent(-1,  1);
drawQuadrent(-1, -1);
drawQuadrent( 1,  1);
drawQuadrent( 1, -1);
function drawQuadrent(horizontal, vertical/*direction*/) {
    var x1 = x + (horizontal * start1);
    var x2 = x1 + (horizontal * (start2 * 0.5));
    for (var i = 0; i < n / 2; i++) {
        var y1 = y + (vertical * start1);
        var y2 = y1 + (vertical * (start2 * 0.5));
        for (var j = 0; j < n / 2; j++) {
            drawVector(x1, y1, x2, y2);
            y1 = y1 + (vertical * distance);
            y2 = y1 + (vertical * (increment * (j + 1)));
        }
        x1 = x1 + (horizontal * distance);
        x2 = x1 + (horizontal * (increment * (i + 1)));
    }
}
function drawVector(x1, y1, x2, y2) {
    var path1 = doc.pathItems.add();
    path1.setEntirePath([[x1, y1], [x2, y2]]);
    path1.moveToEnd(group);
}

Untitled1.pngUntitled2.png

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Engaged ,
Jan 04, 2023 Jan 04, 2023

Copy link to clipboard

Copied

LATEST

Many thanks. That's it! I am wondering how you did that (calculating and writing the code). 👌👍🙏

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines