Well … I have a variety of stuff that does this (mostly geared to Generative Components/ AECOSim - blame BIM and the likes) but is strictly internal (it handles non planar pieces “by design” … meaning K2 and other mysterious/ominous things like packing for minimal fabrication loss). Why? because when I write something I have “any” situation in mind … thus the simple may become very challenging … meaning that I should examine what I can remove and what I can post.
Other than that you need divisions on brep faces with some offset here (the panel gap + the openings/end gap that is not the same) yielding “pieces” and NOT at all a tree with iso curves that just respect the trim (as in that very simple/naive demo C#). Plus … you need a variable division policy since there’s no guarantee that the openings comply with some U/V “whole/same” panel deployment policy (having the general case in mind, that is).
So a “simple” thing may become … you know what.