Copy link to clipboard
Copied
Adobe's documentation explains very little about this process. What is the easiest way to use a JS script to draw consective connected anchor points up to an arbitrary number?
Copy link to clipboard
Copied
Copy link to clipboard
Copied
Again sorry you're bothered with the reposts, the system keeps deleting them so I have to keep reposting them.
I literally just copied and pasting the code and it didn't compile, I'm not sure why that occured.
What I did just try as well though is copying only the first segment and the function definition, and somehow that semi-worked. Photoshop compiled the script successfully, but didn't render anything. It seems as though it processed the locations of these points somewhere, but it wasn't told to render anything with them.
The difficulty is not its incomprehensibility, it's a lack explanation in each of the components. As I have been saying all along, the issue is communication based. If I could construct a path as easily as saying something like app.activeDocument.addPoints(<type>,<location>,<handle location>,<connected = (boolean expression)>,<closed = (boolean expression)>) then I think it would be straight forward and I wouldn't be here, but for some reason it's more complicated than that.
It seems an array needs to be created manually (for each...path? Or maybe each subpath too?) instead of implicitly in the hard code and it looks like somehow specific indices in that array need to be referenced to make the points do anything. I'm not really sure how to predict which element I will need when it looks like 4 different points have the same index. I'm not entirely sure what the function you defined is doing.
What I aim to work with eventually once I get the hang of generating points is generating them in very precisely spaced locations, like for instance "every 100 pixels" according to the document length, so I might not need a push function which seems based more on relative position rather than absolute position, though if that is what it's doing, it's good to know about.
Copy link to clipboard
Copied
Again sorry you're bothered with the reposts, the system keeps deleting them so I have to keep reposting them.
I literally just copied and pasting the code and it didn't compile, I'm not sure why that occured.
What I did just try as well though is copying only the first segment and the function definition, and somehow that semi-worked. Photoshop compiled the script successfully, but didn't render anything. It seems as though it processed the locations of these points somewhere, but it wasn't told to render anything with them.
The difficulty is not its incomprehensibility, it's a lack explanation in each of the components. As I have been saying all along, the issue is communication based. If I could construct a path as easily as saying something like app.activeDocument.addPoints(<type>,<location>,<handle location>,<connected = (boolean expression)>,<closed = (boolean expression)>) then I think it would be straight forward and I wouldn't be here, but for some reason it's more complicated than that.
It seems an array needs to be created manually (for each...path? Or maybe each subpath too?) instead of implicitly in the hard code and it looks like somehow specific indices in that array need to be referenced to make the points do anything. I'm not really sure how to predict which element I will need when it looks like 4 different points have the same index. I'm not entirely sure what the function you defined is doing.
What I aim to work with eventually once I get the hang of generating points is generating them in very precisely spaced locations, like for instance "every 100 pixels" according to the document length, so I might not need a push function which seems based more on relative position rather than absolute position, though if that is what it's doing, it's good to know about.