How to clip a screw mesh to visualize only the part outside the vertebral cortical bone in vtk.js?

Hi everyone,

I am developing a new feature using vtk.js and need to implement a technical visualization for ‘cortical breach’ detection.

Currently, I can detect the intersection between a screw (represented as a cylinder/PolyData) and a vertebra (complex mesh). To improve diagnostic accuracy, I want to selectively render only the portion of the screw that exceeds the cortical boundary.

The goal is for the part of the screw inside the bone volume to maintain its standard appearance, while the segment protruding outside the vertebral mesh is displayed as a separate actor (or a mesh segment) highlighted in red.

I have tried several methods to segment the geometry, but I haven’t achieved a clean result. Is it possible to perform this type of geometric ‘clipping’ in vtk.js? If so, what would be the best approach to achieve this?

Any guidance or suggestions would be greatly appreciated. Thanks!