Render 2D cross sections of 3D Objects

Hello I would like to expand upon a previous post Create Cross Sections and 2D planes in Blender

I am able to follow the steps outlined in the excellent tutorial linked above, but I am having trouble rendering the resulting 2D slices in a serialized way. I am hoping I can be guided to a resource that will help me understand what I need to do to execute what I'd like to do.

What I'd like to do is render each slice as a 2D image with each image having an identical image size, and all images in frame with respect to each other. The result should be a series of 2D images resembling a CT scan.

Ideally this could be done with some level of automation instead of manually adjusting the camera and object for each slice as there will be ~200 slices.

Above is an example of the series of 2D slices in 3D space

And above is an example of a rendered image I would like to produce. However this was a screen shot. And I need to make sure that my images are exactly in frame with each other and rendered at a constant distance from the camera.

Also I should add that I am comfortable writing scripts, but I have no experience programming specifically for blender. Thank you for your help

UPDATE: The below answer worked great for what I was trying to do, and was a much better solution than using boolean expressions to render slices as I had been trying. I simply rendered images of the primary model per the animation shown below. Thank you for your help

• Why the Python tag in your question? Do you just want to render the slices, an image for each slice? Sep 19 '20 at 21:55
• Yes just to render an image for each slice. Thank you so much for this detailed explanation. I will follow up once I have had a chance try implementing. I tagged python because I was unsure if there was an efficient way to do this within the blender GUI Sep 20 '20 at 1:06

That can be done using shader driven by the current frame.

The node settings:

The generated texture coordinates is between 0 and 1.

Value nodes: one is driven by the current frame, the other is the amount of frames (here 100).

We then test if the model part is between frame and frame + 1 / number of frames.

If yes, emission surface and emission volume. If not transparent.

The driver is based on the scene and its current frame:

All is done with Cycles.

Depending on the camera settings, that can be perspective or orthographique (so constant size).

• The variable frame is known to the driver namespace. The driver above can be created on a property by simply typing #frame directly into the property box. Sep 20 '20 at 4:55

I also would like to generate several 2D slices of a volume and the method proposed by lemon is very good but is it possible to do the same thing while keeping the colors and the shadows of the original volume?