When engineer Gary Brown designed his house in Brooklyn Center 20 years ago, he had to overcome one tricky requirement.

There could be no plumbing running through the exterior walls, he explains, “so the train would fit.”

Brown has created a detailed miniature railroad world in his basement, complete with bridges, mountains, a wedding underway by the church and a buzz saw spinning at the sawmill. All around the outside walls, cutting through tunnels that run right through the bathroom, some of his 1,000 hand-painted and decaled model trains whir and chug.

Six main lines are interconnected, with passenger streamliner trains and freighters tripping signals on the eight volts of AC current. The train cars — replicas from the Union Pacific, Penn Central, Mesabi, Missouri Pacific, Great Northern — are all so-called S-gauge, built to a scale of three-sixteenths of an inch to a foot.

“To me it’s art — a fun passion,” he says, standing at his multiple joystick controls.

He collected his first American Flyer train car 62 years ago when he was 4, growing up in Prairie du Chien, Wis. His late father, Myrl, was a World War II vet, fire marshal, postal worker and TV repairman who collected model trains to “keep his three boys out of trouble.”

When Myrl died 14 years ago, his collection sold for $90,000, but only after Gary hand-picked his favorite $8,500 worth to seed his collection. That collection recently topped 1,000 tiny model train cars worth about $75,000.

Many of those cars he bought for $5, scratched and chipped in boxes at garage sales or junk shops. With his decal handiwork and precise painting, those cars would now fetch $50 from obsessive model train aficionados. But Brown spurns most offers from collectors hoping to buy his train cars.

In the 35 years since Lionel trains bought out the American Flyer molds and dyes from the defunct A.C. Gilbert Co., his hobby has exploded nationwide.

“They started selling like hot cakes,” he says.

Brown studied engineering at the University of Wisconsin-Platteville and worked for the departments of transportation in both Wisconsin and Minnesota, helping build interstates.

By 26, he was Winona’s utilities director. That led to jobs as city engineer and administrator in Worthington and Hastings.

He sprinkled in a decade of private consulting, building Target and Walgreens stores, before becoming Brooklyn Park’s engineering director and chief building inspector. He retired in 2009, only to be lured back to work by Pinnacle Engineering.

Somehow during the last 17 years, he’s carved out time to tinker with all his trains and tracks in the basement. His layout includes Styrofoam mountains modeled after the Mississippi River bluffs near Trempealeau, Wis.

He uses metal screen and plaster of Paris to shape his miniature landscape. One weekend, he used actual telephone wires, upside-down shelving brackets and plywood to construct a two-tiered railroad bridge modeled after the Mississippi crossing in Prairie du Chien.

His wife of 20 years, Julie, smiles, shrugs and politely declines to dust. Brown uses a brush from his basement billiards table for that task.