Re: [fxtf-drafts] [geometry-2] Proposal: Geometry Utility Methods (#602)

I want to 2nd Chris' suggestions though I think hit detection might need rethinking.

I also want to 2nd the mention of a `DOMPolygon` interface and would value this a lot more than `DOMCircle` as it is a nice continuation of the straight line geometry of rects and quads. The web *almost* has the building blocks for rich geometry in the form of spatial canvases, hand drawing without a <canvas> or simple physics sims. With a `DOMPolygon` interface and a few basic geometry utilities it would reduce the need to continually reimplement these basic affordances especially when you need them for rects, quads, and other geometry.

As a matter of preference, I prefer the direction of static methods like `Geometry.intersects()` though I can see the benefit for both.

I've also been wondering about a `DOMPath` interface, which could equally (and perhaps better) be served by an `isClosed` property on a `DOMPolygon` interface. For the sake of completion, an `isSimple` property would round out the most basic geometry attributes.

<img width="927" height="671" alt="Image" src="https://github.com/user-attachments/assets/b02ebd1a-3fc8-4046-a6ad-9f085316e006" />

-- 
GitHub Notification of comment by OrionReed
Please view or discuss this issue at https://github.com/w3c/fxtf-drafts/issues/602#issuecomment-3040363550 using your GitHub account


-- 
Sent via github-notify-ml as configured in https://github.com/w3c/github-notify-ml-config

Received on Saturday, 5 July 2025 22:49:16 UTC