I think what you’re looking for is called “clippping”, and there are a few demos of this in the examples section. This doesn’t provide the outline you require, though, since the clipping is calculated in the shaders, so you don’t really have access to the points or vertices on the JavaScript side. You might get the edge as a post-process pass with this effect created by Omar.
If you need the outline as points or a separate geometry object, then it might require more complex math calculations.