change: to use local variable for readability reasons.
change: branchoff has been renamed to segment2edge.
add: static inline function branchoff has been added.
fix: segment should split or change segment type if path is node-path.