There are lots of good resources related to CSG type applications. I would personally start by looking at signed distance functions and rendering those (popular technique in the demoscene) since CSG with functional primitives is in my opinion the simplest to understand. Good resources for this would be iq's distance function page, and Mercury's sdf library. Antimony is another neat project from a research group at MIT that uses CSG. It's on GitHub if you feel up to reading source code.