Problem with radial array trying to be cut out as a cube

I'm going to try to explain as good as I can. I'm trying to create a radial array of a rectangular cube. It needs to be cut out like a cube, but all of the rectangular cubes' height needs to be at the same level. The rectangular cubes need to be rotated upwards to the middle.

I succeeded into creating the radial array using an array modifier with an object offset using an empty. I then rotated the rectangular cube so it points upwards. I have then added a boolean modifier set to difference and used a cube which has a cube within it to get the rectangular cut out I need.

The problem I have is that the height of the rectangular cubes aren't at the same level. In the screenshot you can see they are following the blue line, I want them to be cut at the red line. Any idea how I can achieve this?

From the top view it's correct:

If it's still not clear to you what I want, maybe I can show you this reference image. https://i.pinimg.com/originals/a2/47/d9/a247d9deab4a7bb9f8d0612109d10695.jpg

In the reference image you can see right under the roof rectangular cubes, I'm trying to create that.

• Hello and welcome. Instead of having users go through links and external sites please use the builtin tools to embed images in your post. See How to upload an image to a post? or GIF Commented Jul 19, 2023 at 14:25
• Try Cast modifier (cuboid, factor 1), but if you want the geometry on ends to stay squares, I think the technique needs to be more complicated. i.imgur.com/9kQqugU.png Commented Jul 19, 2023 at 14:36
• @MarkusvonBroady That works, never used that modifier before. Thank you!!! Commented Jul 19, 2023 at 14:38

It seems like Cast modifier in Cuboid mode will work for you. In the below example I moved the default cube in Edit mode so one of the sides ends on the world origin, then I moved the opposite side away, and scaled it all down (S,⬆ ShiftX to not scale on $$x$$ axis which in my case is the axis the cuboid was aligned with), then added an array modifier, an empty with a driver rotating it by $${360°\over \text{count}}$$, and then moved the face touching world origin up for a conical shape: