Improve crossing check for the layout algorithm.

This commit is contained in:
Roman Telezhynskyi 2020-11-26 19:55:02 +02:00
parent f2624692e3
commit 3ce704d039
2 changed files with 5 additions and 3 deletions

View File

@ -2,6 +2,7 @@
- Bug fixes.
- Improve canceling nesting.
- Fix incorrect nesting status for valid cases.
- Improve crossing check for the layout algorithm.
# Version 0.7.40 Nov 23, 2020
- New function Warning.

View File

@ -480,10 +480,11 @@ VPosition::CrossingType VPosition::Crossing(const VLayoutPiece &detail) const
for(auto &position : m_data.positionsCache)
{
if (position.boundingRect.intersects(layoutBoundingRect) || position.boundingRect.contains(detailBoundingRect))
if (position.boundingRect.intersects(layoutBoundingRect) || position.boundingRect.contains(detailBoundingRect)
|| detailBoundingRect.contains(position.boundingRect))
{
if (position.layoutAllowancePath.contains(contourPath) ||
position.layoutAllowancePath.intersects(layoutAllowancePath))
if (position.layoutAllowancePath.contains(contourPath) || contourPath.contains(position.layoutAllowancePath)
|| position.layoutAllowancePath.intersects(layoutAllowancePath))
{
return CrossingType::Intersection;
}