Exemplo n.º 1
0
Arquivo: geo.py Projeto: kloppen/ezdxf
def _boundaries_to_polygons(boundaries, ocs, elevation):
    paths = (Path.from_hatch_boundary_path(boundary, ocs, elevation)
             for boundary in boundaries)
    for polygon in nesting.fast_bbox_detection(paths):
        exterior = polygon[0]
        # only take exterior path of level 1 holes, nested holes are ignored
        yield exterior, [hole[0] for hole in polygon[1:]]
Exemplo n.º 2
0
def _hatch_primitives(
        hatch: 'Hatch',
        max_flattening_distance=None) -> Iterable[AbstractPrimitive]:
    """ Yield all HATCH boundary paths as separated Path() objects. """
    ocs = hatch.ocs()
    elevation = hatch.dxf.elevation.z
    for boundary in hatch.paths:
        yield PathPrimitive(
            Path.from_hatch_boundary_path(boundary, ocs, elevation), hatch,
            max_flattening_distance)
Exemplo n.º 3
0
Arquivo: geo.py Projeto: kloppen/ezdxf
 def boundary_to_vertices(boundary) -> List[Vector]:
     path = Path.from_hatch_boundary_path(boundary, ocs, elevation)
     return path_to_vertices(path)
Exemplo n.º 4
0
 def to_path(p):
     path = Path.from_hatch_boundary_path(p, ocs, elevation)
     path.close()
     return path