Skip to content

Offset with holes #300

Discussion options

You must be logged in to vote

I'm going to answer my own question here. Just took some searching.

In Clipper2, we can't be as loose with adding holes. They need to be grouped with a specific path. So, changing the Clipper2 code to the following seems to work.

for( const POLYGON& poly : m_polys )
{
    Paths64 paths;

    for( size_t i = 0; i < poly.size(); i++ )
        paths.push_back( poly[i].convertToClipper2( i == 0, zValues, arcBuffer ) );

    c.AddPaths( paths, joinType, EndType::Polygon );
}

Replies: 2 comments

Comment options

You must be logged in to vote
0 replies
Answer selected by sethhillbrand
Comment options

You must be logged in to vote
0 replies
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants