Is there a way to check if two irregularly shaped objects intersect? Both would be using a coordinate system with each vertex logged. For example, I'd like to know if a triangle is poking into a square, or vice-versa. Is this possible? I've looked into the JavaFX Node.intersects()
but it doesn't seem like it would work.
Asked
Active
Viewed 23 times
0

protocol_1903
- 5
- 2
-
1What do you mean by "it doesn't seem like it would work"? – Oboe Apr 11 '22 at 17:49
-
1Perhaps, [`Shape.intersect(shape1, shape2)`](https://openjfx.io/javadoc/17/javafx.graphics/javafx/scene/shape/Shape.html#intersect(javafx.scene.shape.Shape,javafx.scene.shape.Shape)), then check the bounding box of the resultant shape. See [Checking Collision of Shapes with JavaFX](https://stackoverflow.com/questions/15013913/checking-collision-of-shapes-with-javafx). Whether that is applicable or something like the topology library suggested me mipa is appropriate depends on your requirements. – jewelsea Apr 11 '22 at 20:27
-
1Mipa’s link to [jts](https://github.com/locationtech/jts) was unfortunately deleted by mods, so reposted here. – jewelsea Apr 12 '22 at 04:52