1 Reply Latest reply on Dec 13, 2017 9:30 PM by maheshthambe123

    Problems constructing a gradient mesh

    JKasper Level 1


      I have been trying some time now to create a gradient mesh with the Illustrator CC2017 SDK.


      I have the following code, but the result is just segments/lines that goes on for "infinity" (the color on the segments are correct though).

      My code:

      sAIArt->NewArt(kMeshArt, kPlaceAboveAll, NULL, &fRenderArt);
      sAIMesh->InitCartesian(fRenderArt, 1, 1); //Set it to 1x1 for testing
      int I, J;
      sAIMesh->GetSize(fRenderArt, &I, &J);
      AIColor color;
      for (long i = 0; i <= I; ++i) {
         for (long j = 0; j <= J; ++j) {
            AIRealPoint point;
            point.v = 50 * i;
            point.h = 100 * j;
            AIMeshVertexIterator vertex;
            sAIMesh->GetNode(fRenderArt, i, j, &vertex);
            sAIMeshVertexIter->SetColor(vertex, &color);
            sAIMeshVertexIter->SetPoint(vertex, &point);


      Screenshot of result:




      Thank you for any help.