And the printer doesn't really know what the model is. It would have to reverse the gcode instructions back into a model somehow. The printer isn't really the place to detect and prevent this sort of thing imo. Especially with how cheap some 3d printers are getting, they often don't really have much compute power in them. They just move things around as instructed by the g-code. If the g-code is malformed it can even break the printer in some instances, or at least really screw up your print.
There are even scripts that modify the gcode to do weird things the printer really isn't designed for, like print something and then have the printer move in such a way to crash into and push the printed object off the plate, and then start over and print another print. The printer will just follow these instructions blindly.
Making tiny modifications isn't just a method of circumvention, it's like part of the main workflow of using a 3d model.
GCODE is mostly about pure maths and geometry (well, there's other stuff but in principle). They would forbid math? "Euclid is illegal."
- a washer if run on a small machine in metric w/ flood coolant
- a lamp base if run on a larger router in Imperial w/ a tool changer
and that deriving what will be made by a given G-code file in 3D is a problem which the industry hasn't solved in decades, the solution of which would be worthy of a Turing Award _and_ a Fields Medal, I don't see this happening.
A further question, just attempting it will require collecting a set of 3D models for making firearms --- who will persuade every firearms manufacturer to submit said parts, where/how will they be stored, and how will they be secured so that they are not used/available as a resource for making firearms?
A more reasonable bit of legislation would be that persons legally barred from owning firearms are barred from owning 3D printers and CNC equipment unless there is a mechanism to submit parts to their parole officer for approval before manufacturing, since that's the only class of folks which the 2nd Amendment doesn't apply to, and a reasonable argument is:
1st Amendment + 2nd Amendment == The Right to 3D Print and Bear Arms
Maybe gcode watermarked and slicer signed? I can't remember. Something silly, that is for sure.
Since such a printer is incapable of determining whether or not this gcode represents a legislatively-restricted item and then blocking its production, then that machine becomes illegal to sell in New York. Easy-peasy. It just takes a quick vote or two and the stroke of a pen, and it is done.
You're probably thinking something like "But that doesn't work at all," and I agree. But sometimes legislators just don't care that they've thrown out the baby along with the bathwater.