2

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: my graph and this is more or less how I want it to look: how it should look

thanks

2

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: http://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:

enter image description here

Image 1: Before and after running script on triangles.

  • thanks, both are excellent answers. Now I have to decide which one is better for my purpose... – 5mark Sep 1 '15 at 19:28
1

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

3_point_arc

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.

  • thanks, a simple and cool script, and from the pictures i posted, It is the correct answer. I was actually not going to go for perfect circles though. Just curved lines, so I will leave the question open in hope that there is another possible solution. – 5mark Sep 1 '15 at 17:38
  • @you can add noise to the circle with Effect -> Roughen – joojaa Sep 1 '15 at 17:52
  • @5mark then you might want to edit your question. – joojaa Sep 1 '15 at 17:57

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.