Here the bounding box of the triangle is not getting attached correctly to the ends of the triangle ,same is the case for all regular polygons.So when we are trying to snap shapes ,shapes are not getting snapped to the ends of regular polygons correctly due to the above mentioned issue.
Here is the link:- https://codesandbox.io/s/react-konva-basic-demo-btuum?file=/index.js