Closed YouGuess1114 closed 2 months ago
Is this the right way?
minX = maxX = outerNode->x;
minY = maxY = outerNode->y;
Node* p = outerNode->next;
do
{
x = p->x;
y = p->y;
minX = std::min<double>(minX, x);
minY = std::min<double>(minY, y);
maxX = std::max<double>(maxX, x);
maxY = std::max<double>(maxY, y);
p = p->next;
} while (p != outerNode);
Hi @YouGuess1114 . This bug has already been fixed in v2.2.4. See #56 and f4be3db809d2cf9133ef54c685fb6bb5a463c115
Node* p = outerNode->next; minX = maxX = p->x; minY = maxY = p->y; do { x = p->x; y = p->y; minX = std::min(minX, x);
minY = std::min(minY, y);
maxX = std::max(maxX, x);
maxY = std::max(maxY, y);
p = p->next;
} while (p != outerNode);
Question: The node of outerNode is missing?please check
Otherwise, y here would be less than 0.
// z-order of a Vertex given coords and size of the data bounding box template
int32t Earcut::zOrder(const double x , const double y_)
{
// coords are transformed into non-negative 15-bit integer range
int32_t x = static_cast(32767.0 (x_ - minX) inv_size);
int32_t y = static_cast(32767.0 (y_ - minY) inv_size);
}