Hi , i have tried to find a object within a polygon area using the logic from the link you send.(How to check if a given point lies inside or outside a polygon? - GeeksforGeeks)
So i am using the method " isInside(polygon, n, p)" where polygon = points of polygon, n= number of segment and p = location of the node(point to check)
according to the image,
polygon: go.Point[]= [new go.Point(0,0),new go.Point(348,0), new go.Point(348,139) ,new go.Point(124,139) ,new go.Point(124, 107) ,new go.Point(0,107)]
n = 6 and
p = new go.Point(331,200) getting by node.location
So, from the image you can see the points of the node is not inside the polygon.
in diagram if i draw a Polygon in any location, always it start from (0,0) i.e. its point is calculating by different way from the node location point in gojs.
Forget what I suggested regarding “reverse offset”. Just do what I suggested: “Offset the Geometry’s points by the Part.position”, meaning to add the point.
It seems to me that it would be better to make your own custom tool class, starting by copying PolygonDrawingTool.js, renaming the file and the class name, and then making whatever changes you want.
I think you want to make a lot more changes than just setting { isGroup: true } on the PolygonDrawingTool.archetypePartData, which is all you would need to do to strictly answer your question.