Skip to main content
This topic has been closed for replies.
Correct answer Monika Gause

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.

2 replies

renél80416020
Inspiring
November 2, 2024

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é

 

 

Kurt Gold
Community Expert
Community Expert
November 2, 2024

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.

Kurt Gold
Community Expert
Community Expert
November 2, 2024

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.


I think I did understand that already, Monika.

Monika Gause
Community Expert
Community Expert
October 31, 2024

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