This function is broken, because it merge segments having different widths or without any connectivity test. 2 collinear segments can be merged only if no other segment or via is connected to the common point and if they have the same width. See cleanup.cpp for merge functions and consider MarkTrace() to locate segments that can be merged
Store sheet file names with full path, either relative to project path or absolute path. The current design always assumes subsheet files are located in the project folder which may or may not be desirable.