Create custom geometry shapes in port of a node

Untitled
I want to create a port like this below

 go.Shape.defineFigureGenerator("CShape", function (shape, w, h) {
    return new go.Geometry()
      .add(
        new go.PathFigure(w - 10, 0, false)
          .add(new go.PathSegment(go.PathSegment.Line, w, 0))
          .add(new go.PathSegment(go.PathSegment.Line, w, h))
          .add(new go.PathSegment(go.PathSegment.Line, w - 10, h))
      );
  });

the above is the code for the shape which creates Square bracket shape but when i use that in port

image

it looks like this, which obviously because of the angle, how do i change the angle of the shape based on the 4 ports provided on the shape,
the ports are located on the center of all the 4 sides of rectangle shape

I don’t understand why you don’t have:

        new go.PathFigure(0, 0, false)
          .add(new go.PathSegment(go.PathSegment.Line, w, 0))
          .add(new go.PathSegment(go.PathSegment.Line, w, h))
          .add(new go.PathSegment(go.PathSegment.Line, 0, h))

Then you’ll need to rotate the shape according to the side that you want.