Proper orientation for voltage regulator on a PCB

I'm thinking about ordering some custom PCBs and I'm using KiCad for the first time. I downloaded digi-key's symbol and footprint library to use, but as far as I could tell it only included the symbol for the LD1117V33 and not the footprint. I downloaded this footprint from Snapeda, and I've attached an image of the 3D view. Based on this footprint, it looks like I should bend the pins at 90 degrees so the regulator is lying flat on the PCB and the circle will act as a heat sink. Would that be the case?

I'm just now learning about traces, but I'd imagine I'd have at least one running through that space. I wouldn't imagine lying the regulator over a trace would be a great idea.

KiCAD has heaps of footprints of common and not so common packages built in, and most parts come in standard packages. You have to select the correct package (the LD1117V33 is available in at least TO-220, DPAK, SOT-223 and SO-8 packages). The three holes and silkscreen suggest you’ve picked a TO-220 package and intend to bend it flat on the PCB.

It is in general OK to have traces run behind parts. Resistors and capacitors make for great jumpers. Of course it depends on the part, not all parts will be happy with traces behind them, and I also wouldn’t do it behind parts that can get particularly hot, even more so when they use the PCB as heat sink.

If my assessment is correct for the TO-220, I’d avoid routing behind it. The back of that part is exposed metal, minor damage to the soldermask may cause problems. In your case however you picked the trace of pin 2 to go behind it, that’s connected to the tab so such accidental contact would not cause a problem in this particular situation. Heat from the part may still be an issue.

If you are going to lay the regulator flat, might as well get a regulator that lays flat by design. Some TO-252-3 components are perfect for this, and are easy to solder and a lot cleaner to look at.

Here's an example from mouser

Looking at the datasheet, I do have the TO-220 version, but I've always stood them up straight on solderable breadboards. I found this other footprint online which seems to be for standing the TO-220 up straight, but I also noticed the 3D view shows holes drawn on the pcb, but not drilled through for the pins. As I get closer to finalizing the designs and researching what I need to do to order, I'll have to see if this will be a problem or not.

Nevermind. I found it in Package_TO_SOT_THT.

I love KiCad. The only problem I have with it is finding the correct parts. What a nightmare.
Since JLCPCB offers SMD service, I am tempted to try surface-mount parts sometime, but even then the parts selection is not straightforward.

I rarely have an issue - all standard footprints are present (and most come with a nice 3D image with it), and custom ones well they're custom so you just have to create them yourself. I don't remember doing anything special to get all those part libraries installed with it.