Single 2D Truss mesh

To create your mesh, you can use external software such as pygmsh which is a python wrapper for gmsh, or use the gmsh GUI directly.
There are many examples on how to export meshes from gmsh to dolfin, see: Transitioning from mesh.xml to mesh.xdmf, from dolfin-convert to meshio .
For setting boundary conditions at nodes, see for instance: Pointsource on specific points python