This is a response to a question in this thread, trying to keep one question per thread.
I’ve added this example scene, which may help: https://polygonjs.com/demo?example=bynode/sop/data/advancedwithcopy
And one thing that’s probably not clear in Polygonjs yet is which parameter can take an expression that varries per point, and which cannot. So I still have to make examples/docs explaining that.
But in short, the sop/point, sop/attribCreate are not that can take per-point expressions (where you can use @P
to refer to the position of that point, or @ptnum
to its index), but the sop/transform or sop/polarTransform cannot.
And that choice of which node can or cannot is mostly done for performance reasons.
(If the polarTransform was able to use per-point expressions, then you could replace the index 0 by @ptnum
, but that will not have any effect at the moment.)
So then the question is how to we get around that. And that’s where a node like the sop/copy can really help. It’s not just useful to duplicate objects, but also to iterate over a list. That’s mainly what the example above shows.
Basically, the points created by the sop/data node are not the ones that end up being displayed. They are just used as reference by other nodes.
In the left branch, the data node is read. And in the right branch, those are the displayed point, and the point and polarTransform nodes have expression that use the copy
expression, which returns the index of the current copy created. This is what allows the point and polarTransform to apply a different operation per point.