Skip to main content
This topic is closed to new replies. Start a new post to keep the conversation going.
Monika Gause
Monika GauseCorrect answer
Community Expert
Nov 2, 2024 11:12 PM UTC

You have to make a duplicate of a path and move it down and to the right.

Then select the teo paths and then run the script.

8 replies

renél80416020
Inspiring
Nov 2, 2024 9:28 PM UTC

Bonjour @JoostintheHouse,

En faite, il s'agit d'une perspective cavalière légèrement penchée.

A partir de deux profils décalés, Il s'agit de créer les facettes latérales.

René, un script peut aider à faire cela...

Remarque: Les tracés doivent être du type PathItem

 

 

 

 

 

// Auteur Landry René
// Sat, 2 November 2024 21:26:16 GMT
// Sélectioonnez deux tracés ayant le même nombre de points
// INIT --------------------
var couleur = macmykColor(0,62.18,94.12,0);
var ep =1;
// ------------------------
  var doc = activeDocument,
      sel = selection;   alert(sel);
  var nb0, nb1, par, pjxy0, pjxy1, pJxy0, pJxy1, ch;
          if (sel.length == 2) {
            nb0 = sel[0].pathPoints.length;
            nb1 = sel[1].pathPoints.length;
            alert(nb0+"    "+nb1)
            if (nb0 == nb1) {
              repereGroup = doc.groupItems.add();

               for (var j = 0; j < nb0-1; j++){
                  par = repereGroup.pathItems.add();
                  pjxy0 = sel[0].pathPoints[j].anchor;
                  pjxy1 = sel[1].pathPoints[j].anchor;
                  pJxy0 = sel[0].pathPoints[j+1].anchor;;
                  pJxy1 = sel[1].pathPoints[j+1].anchor;
                  ch = [pjxy0,pjxy1,pJxy1,pJxy0];
                  atttribut(par,ch);
               }
              par = repereGroup.pathItems.add();
              ch = [pJxy1,sel[1].pathPoints[0].anchor,sel[0].pathPoints[0].anchor,pJxy0];
              atttribut(par,ch);
            }
          }
// -------
function atttribut(obj,ch) {
    with(obj){
      setEntirePath(ch);
      filled = false;
      strokeColor = couleur;
      strokeWidth = ep;
      closed = true;
    }
}
// -------
function macmykColor(c,m,j,k)
{ //crée une nouvelle couleur CMJN
  var cmykColor = new CMYKColor();
    with (cmykColor) {
      cyan = c;
      magenta = m;
      yellow = j;
      black = k;
    }
  return cmykColor;
}
// -------

 

 

J'ai fait au plus simple.

René

 

 

Translate
Kurt Gold
Community Expert
Community Expert
Nov 2, 2024 10:43 PM UTC

Thanks for your approach, René.

 

Is that script supposed to work in the latest versions of Illustrator?

 

I tried it in version 29.0.1 (probably not thoroughly enough), but it does not work at all.

Translate
Monika Gause
Community Expert
Monika GauseCommunity ExpertCorrect answer
Community Expert
Nov 2, 2024 11:12 PM UTC

You have to make a duplicate of a path and move it down and to the right.

Then select the teo paths and then run the script.

Translate
Monika Gause
Community Expert
Community Expert
Oct 31, 2024 5:17 PM UTC

You could check out this tutorial: https://youtu.be/SD1HARFrszs 

Translate