I have been playing with the SDF nodes from FieldTrip, and have been quite happy. But now, I want to add a “wedge” primitive, but can’t quite figure out how to program it.
So, basically what I want is a primitive that looks like one of those Trivial Pursuit pieces - here, the red, yellow and blue:
So, what I would like is something similar to the Segment (DX11.Geometry) node, but that returns
SDF2D that I can then extrude, with inner radius, cycles and phase inputs. I need help writing the shader code!
Yeah… I understand the basic math/geometry that describes a sector of a circle.
Basically, this is what I have now:
So, the “Inner Radius” part can be handled by CombineSDF boolean operations. However, I’m not smart enough to translate my understanding of a sector into the SDF function of a wedge!
The shader code for a cylinder is: