コード例 #1
0
ファイル: geo.py プロジェクト: 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:]]
コード例 #2
0
ファイル: disassemble.py プロジェクト: mhenr18/ezdxf
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)
コード例 #3
0
ファイル: geo.py プロジェクト: kloppen/ezdxf
 def boundary_to_vertices(boundary) -> List[Vector]:
     path = Path.from_hatch_boundary_path(boundary, ocs, elevation)
     return path_to_vertices(path)
コード例 #4
0
ファイル: frontend.py プロジェクト: ebrahimraeyat/ezdxf
 def to_path(p):
     path = Path.from_hatch_boundary_path(p, ocs, elevation)
     path.close()
     return path