Fill an object with material

Is it in Blender (or any other 3D Modelling program) possible to fill an object, e.g. a cube with a material in the same color like the mesh on the outside?
The aim is to export this as glTF and use it in another program and apply clipping planes to it. The object should look like a solid object (a stone, a layer, or maybe like a cake). And wherever the object gets clipped, the inner material should be visible.

Do you mean like this?
Image result for slicing a cake before and after

Something like that, yes.
The difference here is that the cut in the target application can be made at any point and the object must always be filled, since the cutting plane is movable. Here it may be that the cut has been designed into the cake and the objects are basically hollow inside.

You mean something like this?

You can just create the round watermelon mesh as usual, and then create the slicing texture for the slicing which will be generated on the fly inside your program. The slicing texture will be different from different angles and depth if there such cases, it can be configured inside the code of the program.

Blender is a polygonal modeler, and polygonal modeling is a surface type modeling paradigm. What you imply is solid modeling. Blender can use a boolean object and take its material on the cut surfaces, but it is a surface. What the target application can and can’t do is up to that application, no one can suggest a workaround from Blender side before knowing what that application and the use case is.

1 Like

Its in CesiumJS, a subsurface layer with a certain thickness should me modelled. A clipping plane is assigned to it in order to generate cuts into the terrain and underlying surfaces. This plane is movable through the whole layer. And at the intersection of the plane and the layer there shouldn’t be an “empty” layer visible.