How to add new segments to any orthogonal Link?

Hello Walter, there are some few user cases where a node is placed at the very center through which a lot of links pass. The links are orthogonal in nature.

Sometimes, the ideal way is too resegment the links and make them pass sideways. I’ve used the following to redirect the pathshape of the link programmatically:

link.setPointAt(index, x, y)

Is there any method to insert new Point objects in the existing link Points object to create new segments?

In general it’s a matter of making a copy of the Link.points List, inserting or removing or modifying some Points, and then setting Link.points.

An example of this is in the implementation of the PolylineLinkingTool,
provided in: https://gojs.net/latest/extensions/PolylineLinkingTool.js
or: https://gojs.net/latest/extensionsTS/PolylineLinkingTool.ts
and demonstrated at: Polyline Linking Tool

If you want to maintain orthogonality, you will always need to add or remove a pair of consecutive points at a time.

Also, you really cannot remove the first two and the last two points, since they provide the end segments that connect the link path with the nodes.