There wouldn't seem to be any algorithm that could recognize any part that could be assembled into a device. A gun for instance can take on almost infinite forms and be divided into arbitrary unrecognizable modules.
We could enforce pre-approval by a government engineer of any part that may possibly become such a device. But such an engineer would have to generate a large amount of false positives to be at all effective. And the requirement for skilled human intervention would make it slow and expensive.
Bottom line, if there exists a device that you insist must be prohibited, then you will want to ban the free use of 3D printers that can make it.
So what's that threshold for you? Keep in mind that a box cutter was used as a WMD, killing thousands. Do we ban 3D printers that can make a box cutter? Let's posit a lower limit of a box cutter and an upper limit of a fusion bomb. Are gunpowder projectile devices the right compromise?
How dangerous does a printable device have to be before we must stand athwart technology, yelling Stop?