Copyright and trademark are limited by the functionality doctrine which is the legal principle that denies trademark and copyright the ability to restrict the reproduction of purely functional features.
17 U.S.C. §101 defines the notion of a "useful article":
A "useful article" is an article having an intrinsic utilitarian function that is not merely to portray the appearance of the article or to convey information.
17 U.S.C §103(b) limits the applicability of copyright on useful articles:
This title does not afford, to the owner of copyright in a work that portrays a useful article as such, any greater or lesser rights with respect to the making, distribution, or display of the useful article so portrayed than those afforded to such works under the law...
In other words, you cannot stop someone from making and distributing a useful article merely because you have previously expressed the useful article in a copyrighted work.
For trademark, the most significant court case is TrafFix Devices, Inc. v. Marketing Displays, Inc., which held that trademark cannot restrict distribution of functional components. The plaintiff in that case claimed that their product's spring mechanism was legally protected as a visually distinctive part of their product's trade dress, but the Supreme Court held that the spring mechanism was ineligible for trademark protection insofar as it was a functional component of the product.