Extend Faces of an Open Polyhedron

I’ve created a definition that takes a polyhedron that’s been trimmed with planes, and then extends all the surfaces at their naked edges to create a new volume. (this definition relies on Parakeet, because it’s the only place I could find an extend surface component. Everything else is native GH.)

I would like help finding a way to do this that is less of a memory hog than my solution. More on that below. Here’s the definition: Polyhedron Split and Extend.gh (78.6 KB) (thanks to @HS_Kim for a little help with part of it.)

Examples of what it does below, input brep is yellow, extension is blue:

The only way I could figure out to get decent results was to use create solid in a way that actually creates a lot of garbage output that I waste processor time on. I would like advice on how to avoid this and/or how to avoid using the Parakeet extend surface. Part of the problem is that this component untrims the surfaces, which is how I get garbage output from create solid.

In Rhino, _ExtendSrf maintains the trim of the surfaces. Could a python script achieve this? If it can, I could abandon create solid and just use brep join. @DavidRutten posted an Extend Surface component years ago, here, but the download link is now dead.

Or is there a way to achieve the same results using planes instead of surface extensions? I worry about the planes intersecting in unexpected ways, just like the untrimmed surfaces.

The Create Solid is also from Parakeet.

The methods of those components are these that you could replace in C# components if you want to be without the plugin. Will look more in depth when I have more time.

https://developer.rhino3d.com/api/RhinoCommon/html/M_Rhino_Geometry_Surface_Extend.htm

https://developer.rhino3d.com/api/RhinoCommon/html/M_Rhino_Geometry_Brep_CreateSolid.htm