I write an answer as proposed to by @SHikhaMittal. Though, still not sure this is the wanted result.
As this is about "any shape", have used an image, like a decal, to drive the displacement.
The shape is colored with "wireframe" node, so that we can see the result of the displacement in term of geometry.
Bottom part is the ...
You could avoid doing the trigonometric stuff the Gradient > Radial node has already done for you, by, instead of avoiding the discontinuity at 0, using it as the start of your segment:
At its most primitive, the start-angle is measured out of 1, clockwise from 9 o'clock, and the segment is anticlockwise from there.This set-up works round the clock, ...
Use a Vector Math node set to Multiply by (-1, -1, -1) to get the opposite of the input Vector. You can also use a mapping node to do the same thing with the Scale fields.
Also, FYI semantically, the inverse and the opposite are not the same thing.
Very close to your settings:
Use the rotation of the mapping node to rotate
Get an absolute value to get ride of the seam
Change the map range in consequence
Use a color ramp to tune the width of the angle
Eventually change the color ramp mode to "constant" to have a sharp transition
If you want to make simple shapes here is a recommendation - https://www.youtube.com/watch?v=BqijDcTdfZ8 but i can explain here , if you separate the xyz of texture coordinate using a Separate xyz node and then connecting it to a compare node(math) , you can get a black strip on a black plane , this could be used to make a square by subtracting another such ...
In your tree, the 'True Normal', (which is the unsmoothed, geometric normal in World space), is being used as the color of a Diffuse BSDF, before the light-response of the BSDF is extracted as a color, put through a B/W ramp, and used as a mask.
The True Normal is the direction of the geometric normal at the shading-point, encoded as a color in this case, ...
Ok so as you're using a MixRGB, you can indeed mix the 2 Image Texture nodes into the MixRGB, then you need to plug the MixRGB into a Diffuse, then the Diffuse into an Output:
MixRGB is used to mix 2 colors and/or images, but you need to tell Blender what kind of shader it is supposed to be, between Diffuse (which will be affected by light and shadows) and ...
This answer is based on Omar Emara's Answer
, so be sure to read it before you move on as I won't explain everything that have been answered there.
This is the loop to generate polygon
However, this loop doesn't take the distances between vertex points into account so I modify the loop to use the Distances output from Find Nearest Points node. As per ...
Gorgious very helpfully pointed me towards the API documents I was struggling to find as well as an example script generating node trees in Blender. In essence my question boiled down to "where are the relevant API docs, I can't find them", and they provided exactly that in the comments of my question.