Skip to content
Discussion options

You must be logged in to vote

This is a simple but not bulletproof way to archive this. Test that the center of the path's bounding box is inside the previous path's bounding box:

from ezdxf.math import BoundingBox2d

def outer_paths(paths):
    prev = None
    for path in paths:
        if prev is None:
            prev = BoundingBox2d(path.control_vertices())
            yield path
            continue
        bbox = BoundingBox2d(path.control_vertices())
        if not prev.inside(bbox.center):
            yield path
        prev = bbox


def inner_paths(paths):
    prev = None
    for path in paths:
        if prev is None:
            prev = BoundingBox2d(path.control_vertices())
            continue
        bbox = 

Replies: 1 comment 4 replies

Comment options

You must be logged in to vote
4 replies
@jkraehling
Comment options

@changkeke
Comment options

@mozman
Comment options

@changkeke
Comment options

Answer selected by jkraehling
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
3 participants