A dual-layer hernia mesh can be configured according to a three-dimensional map of a hernia defect(s) and a hernia volume(s) of a patient. The front portion of the mesh can be configured utilizing, for example, a three dimensional map of hernia sac volumes obtained from a CT scan. The front portion of the mesh exactly fits into the hernia sac. The back portion of the hernia mesh is a sheet of mesh material that overlaps over onto the normal muscles and fascia. A “foam” collapsible mesh and/or a flat mesh with expandable hydrogel deposited in variable thickness according to the hernia defect can be utilized as a dual-layer hernia mesh for repair. The hydrogel mesh when combined with water or saline expands and fits into the hernia defect or defects. Both “foam” and hydrogel meshes adhere to the tissues of the hernia sac and then contracts over time. The hernia sac volume slowly disappears, restoring a more normal contour to the abdominal wall.