Cross-Section / Cut-Out Shader

Hi there!

I am attempting to make a cross-section shader using location based opacity where the edges are ‘capped’ and the geometry appears solid rather than hollow. After following some guides online (none of which show a cross-section) I have made a shader which successfully clips geometry using a box mask in a custom material function but I require that the geometry to be capped and appear solid.
Without using ‘Slice procedural mesh’ function, is there a way to achieve this effect within the shader?

Thanks in advance!