Nice trash cans come with a ring that goes around the ring to keep the bag in place and not hanging out the sides. Have a not-nice trash can? Print this and upgrade.
Don't print the STL - instead, open Trashcan Ring - Parametric.scad in OpenSCAD. You'll see a sidebar on the left called “Parameters.” Fill that in, press F6 to render the model, once that's done press F7 to export an STL.
The photo “measurements” shows what to measure for each parameter: the diameter of the trash can for outer_d , the width of the rim (on which the printed ring will sit) for rim_w, both in millimeters. Making the ring a bit too small is better than making it a bit too big, as a too big ring won't fit and a too small ring will simply move around a bit when putting it in place.
Flip the model upside down so it doesn't need supports.
Print with as large a layer size as you'd like - this isn't a precision model, it's two cylinders with another cylinder cut out of them.
This is only for round trash cans at the moment because I'm not sure how to mathematically describe or even accurately measure the other common shape, a rounded rectangle.
This needs a print bed as big as the diameter of the trash can. The trash can I wanted to make this for was just barely small enough to fit on my Ender 3. If you want this but your print bed is too small, leave a comment and I'll make a version that prints in quarters and sticks together with pegs.
The author hasn't provided the model origin yet.