A factory was a place where items were manufactured.
History and specifics
In an alternate timeline caused by Na'kuhl interference with the history of the planet Earth's 20th century, Trip Tucker and Travis Mayweather, trapped in the alternate past due to time travel, were briefly held by the Na'kuhl in their construction facility in New York on that world's North American continent. Silik, disguised as Trip, described it as a sort of factory when he posed as Trip during a debriefing after the pair were supposedly rescued. (ENT episode: "Storm Front, Part II")
One factory on Earth was PlexiCorp's facility in San Francisco. In the year 1986, time travelers Leonard McCoy and Scotty were able to bargain information for some of the factory's time in producing transparent aluminum for the construction of a whale tank in the cargo bay of their bird-of-prey starship, the HMS Bounty. (TOS movie, novelization & comic adaptation: The Voyage Home)
In 2003, another factory was visited by less friendly time travelers. A group of Xindi-Reptilians took over a factory in Detroit on Earth in order to conduct experiments on a biological weapon to be used to eradicate 21st century Human civilization. To this end, they had Loomis bring a number of patients from his clinic to the factory uner cover of darkness. (ENT episode: "Carpenter Street")
In 2154, when surveying one of the Spheres made by the Sphere Builders, noting the precision in which they were constructed to be completely identical, Trip Tucker joked that he'd "like to see the factory that made these". (ENT episode: "Chosen Realm")
In 2265, Niklon, who ran the robot production plants on his world before conquering it, boasted that he now lived in luxury while the rest of his people worked in the fields and the factories. (TOS comic: "Dark Traveler")
In 2267, describing the dehumanized nature of civilization on Beta III, Spock called their beatific outlook on harmony as "the peace of the factory, the tranquility of the machine" to underline the horror of the situation. (TOS episode: "The Return of the Archons")
In 2268, when bargaining with Bela Okmyx of Sigma Iotia II, Captain James T. Kirk criticized the gang leadership of the world, calling it "run like a piecework factory", as a metaphor to describe the lack of organization caused by the gang wars. (TOS episode: "A Piece of the Action")
When afflicted by a deadly virus in 2365, Katherine Pulaski called herself "not up to factory specs" when asked about her condition by Data, jokingly describing her medical condition in mechanical terms as a jibe against his nature as an android. (TNG episode: "Unnatural Selection")
- TOS episode: "The Return of the Archons"
- TOS episode: "Shore Leave"
- TOS comic: "Dark Traveler"
- TOS episode: "A Piece of the Action"
- TAS episode: "The Practical Joker"
- TOS movie, novelization & comic adaptation: The Voyage Home
- TNG episode: "Unnatural Selection"
- ENT episode: "Carpenter Street"
- ENT episode: "Chosen Realm"
- ENT episode: "Storm Front, Part II"