Process hardware cliping using implicit function

vtkAbstractMapper provides a function,SetClippingPlanes, to cut the actor at hardware level,which might be several magnitudes faster. But I can’t set implicit function to it to get specific shape like below.

    vtkNew<vtkImplicitBoolean> boolean;
    boolean->SetOperationTypeToIntersection();
    boolean->AddFunction(p1);
    boolean->AddFunction(p2);
    boolean->AddFunction(p3);
    boolean->AddFunction(p4);

If there are any methods to do so please let me know.

Please check this out:

I post a gif below to to show the result that the implicit function with four planes cuts a piece of mass out of a sphere.
And I tested the function you provided with the same planes, nothing was left in the renderer, much the same with what I experienced before.
want

Maybe you need to create your own shader for this class
https://vtk.org/doc/nightly/html/classvtkOpenGLPolyDataMapper.html

I guess you would need to give different scalar values to the inside and the outside regions

Edit:

I’m not sure you can achieve want you want with a a mapper.
Unless you are rendering a tetrahedral mesh maybe.
Maybe you want to use a vtkClipPolyData and a vtkAppendFilter, but I’m not sure if it will work at the end

That’s pretty hardcore for me. I’m looking for a solution to process cliping faster than vtkTableBasedClipDataSet with 10 milions of cells rendering together and dynamically updating the result after per cliping.