question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

boolean-contains not always true for results of intersect using same parent zone

See original GitHub issue

Consider the following case:

const coverage = [[[-75.77768325805664, 42.46399280017058], [-69.57040786743164, 40.697299008636755], [-77.08505630493164, 40.772221877329024], [-75.77768325805664, 42.46399280017058]]];
const allowedCoordinates = [[[-74.3994140625, 43.14107810634587], [-70.46630859375, 40.47202439692057], [-76.387939453125, 39.2492708462234], [-76.871337890625, 42.73087427928485], [-74.3994140625, 43.14107810634587]]];
const allowedCoverage = Polygon(allowedCoordinates);
const intendedCoverage = Polygon(coverage);
const resultingShape = Intersect(allowedCoverage, intendedCoverage);

const isContained = BooleanContains(allowedCoverage, resultingShape);// -> false

In my test case above I expected the resultingShape will be contained.

Issue Analytics

  • State:open
  • Created 5 years ago
  • Reactions:1
  • Comments:11 (4 by maintainers)

github_iconTop GitHub Comments

1reaction
gtzinoscommented, Apr 8, 2019

Any update ?

0reactions
ggayowskycommented, Aug 21, 2018

Confirmed that my test case fails because of lack of precision in the onBoundary calculation with inRing() in booleanPointInPolygon. In particular because of this check:

pt[1] * (xi - xj) + yi * (xj - pt[0]) + yj * (pt[0] - xi) === 0

Don’t really have an idea of how to solve that at this point. If you have some thoughts I would be happy to take a stab at a PR

Read more comments on GitHub >

github_iconTop Results From Across the Web

Boolean Operations - Figma Help Center
Boolean operations combine any set of shape layers through one of four formulas: Union, Subtract, Intersect, and Exclude. Boolean groups are treated as...
Read more >
Boolean Compound Object | 3ds Max 2021
A Boolean object combines two or more objects into a single mesh by performing a Boolean operation on them.
Read more >
XPath and XQuery Functions and Operators 3.1 - W3C
In the case of namespace nodes, however, the result is always an empty sequence — it does not depend on the base URI...
Read more >
Intersection Observer API - MDN Web Docs
The Intersection Observer API provides a way to asynchronously observe changes in the intersection of a target element with an ancestor ...
Read more >
Reference guide for expression functions - Azure Logic Apps
For example, if you use non-string values where strings are expected ... true or false, Boolean, Return true when all expressions are true....
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found