3DM clipping flickering

I have loaded a 3DM model and wanted to add clipping stencil as shown in this example three.js examples

But it is flickering badly while rotating. Any idea what is wrong?

Demo: Edit fiddle - JSFiddle - Code Playground

Thanks in advance.

Also there is a problem with a Z plane which doesn’t flicker, but there is only half of it.

Demo 2: Edit fiddle - JSFiddle - Code Playground

I’m not understanding why, but in this second example there is a piece of plane near the object.

I have a question, why did you set this command renderer.clippingPlanes = planes?
I have always found mesh.material.clippingPlanes = planes or directly in the material of the mesh clippingPlanes: planes. Maybe I’m wrong but I’m curious.

For this, maybe it can be helpful this link Z fighting & polygon offset - threejs
about the issue you have.
I’m working on a very similar case, but the difference is the loader. I create the object and then I apply the clipping. I have the flickering problem too.
colored-clipping - CodeSandbox

I have just used the code from the example three.js examples and made a few modifications such as loading 3DM model instead of TorusKnotGeometry.

I have read a lot of articles about z-fighting, sadly none of the fixes worked :frowning:

Maybe I’m wrong is it possible that the load function is asynchronous?
Have you had the possibility to load the object and then clip it? Maybe through a button.

The clipping is added inside the load callback, after the model is already loaded.

Sorry but I never used the 3dmLoader. I used the stl loader, I did a test with my code and your stl model. And It works fine. If you want to try this is the live code clipping-with-loader - CodeSandbox
In your case I’m not sure of renderer.clippingPlanes = planes; I think that the clippingPlanes is related to the model not to the render. But at the same time, it seems no possible to add the clippingPlanes to the model in the 3dmLoader. Hence my question about loading the object first and then clipping.