R Codes for an Assemblage of Bars in 3D space