Three D Departments Inc., the loss-ridden Costa Mesa retailer of bed, bath and home accessories, filed for reorganization in U.S. Bankruptcy Court in Santa Ana. The company said it has been having trouble obtaining credit recently, preventing it from restocking stores. This also has led to lower sales and more losses. The retailer, which operates 21 stores in California, Arizona and Connecticut, hasn’t posted an annual profit in seven years. The company’s chief executive, Donald L. Abrams, said Three D seeks court approval to tap a $10-million line of credit it has arranged with Foothill Capital Corp. In recent years, the family-controlled company has struggled to find its financial footing. During the recession of the early ‘90s, it cut prices but couldn’t stimulate sales. It also continues to face competition from huge, well-financed rivals such as Linens & Things and Bed, Bath & Beyond.