Mobile app version of vmapp.org
Login or Join
Jessie844

: How to bend multiple lines of a graph in AI CS5? I have created a radar chart with three axes, and I would like to make all the lines in the graph curved instead of straight. I havent

@Jessie844

Posted in: #AdobeIllustrator #IllustratorScripting #InformationGraphics #Path

I have created a radar chart with three axes, and I would like to make all the lines in the graph curved instead of straight. I havent found a satisfying way to bend all the paths (i.e. the edges of the triangles) in a way that looks homogenous. I can of course use the reshape tool, but then the degree to which each line is curved looks just random.
The Envelope distort tool looks promising, but it changes the position of the corners(the anchors) of my graph as well, which is obviously not acceptable. Is there any way to achieve this in an easy and reproducible way? (I need to create several graphs which should be comparable).

note that I am not (necessarily) trying to create perfect circles as shwon on the image below. The goal is rather to go from straight lines to (slightly) curved ones.

this is how my graph looks right now:
and this is more or less how I want it to look:

thanks

10.02% popularity Vote Up Vote Down


Login to follow query

More posts by @Jessie844

2 Comments

Sorted by latest first Latest Oldest Best

 

@Cugini998

Here is another solution entirely. Based on your comments which you should edit into the question.
#target illustrator

// jooBloat.jsx
//
// Copyright (c) 2015 Janne Ojala
// License: opensource.org/licenses/MIT
main();

function main(){
handlePaths(activeDocument.selection);
}

function bloatPoint(path, amount) {
var pts = path.pathPoints;
for(var i = 0; i < pts.length; i++){
var pos_prev = pts[(pts.length+i-1)%pts.length].anchor;
var pos = pts[i].anchor;
var pos_next = pts[(i+1)%pts.length].anchor;

pts[i].pointType = PointType.SMOOTH;
pts[i].rightDirection = add(pos,smul(0.33,sub(pos_next, pos_prev)));
pts[i].leftDirection = add(pos,smul(0.33,sub(pos_prev,pos_next)));
}
}

function sub(a, b){
arr=Array(2);
arr[0]=a[0]-b[0];
arr[1]=a[1]-b[1];
return arr;
}
function add(a, b){
arr=Array(2);
arr[0]=a[0]+b[0];
arr[1]=a[1]+b[1];
return arr;
}

function smul(a, b){
arr=Array(2);
arr[0]=a*b[0];
arr[1]=a*b[1];
return arr;
}


function handlePaths(sel) {
for(var i = 0; i < sel.length; i++){
if(sel[i].typename == "PathItem"){
bloatPoint(sel[i]);
}
}
}


Select any number of closed paths, and execute script. Results in:



Image 1: Before and after running script on triangles.

10% popularity Vote Up Vote Down


 

@Gail6891361

How to fit a triangle to 3 points is described in this post




Image 2: Three point arc

So it turns out that you can use a few properties of circles, lines and >triangles. You can always form a circle that hits 2 points by drawing the >center of the circle on the midpoint normal of the connecting line. You can >find the midpoint by drawing any circles that cross each other. They will >cross ate the center so if you connect the intersections you will get the >center normal. Now because 3 points have to satisfy two of these the ONLY >circles center lies at the intersection of the 2 normals.


There is a script by Hiryoki Sato called circumcircle that does this a bit faster than manually drawing lines.

10% popularity Vote Up Vote Down


Back to top | Use Dark Theme