How to use the vpype.LineCollection function in vpype

To help you get started, we’ve selected a few vpype examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github abey79 / hatched / hatched / vpype_plugin.py View on Github external
):
    """
    Generate hatched pattern from an image.

    The hatches generated are in the coordinate of the input image. For example, a 100x100px
    image with generate hatches whose bounding box coordinates are (0, 0, 100, 100). The
    `--scale` option, by resampling the input image, indirectly affects the generated bounding
    box. The `--pitch` parameter sets the densest hatching frequency,
    """
    logging.info(f"generating hatches from {filename}")

    interp = cv2.INTER_LINEAR
    if interpolation == "nearest":
        interp = cv2.INTER_NEAREST

    return LineCollection(
        hatched.hatch(
            file_path=filename,
            levels=levels,
            image_scale=scale,
            interpolation=interp,
            blur_radius=blur,
            hatch_pitch=pitch,
            invert=invert,
            circular=circular,
            show_plot=show_plot,
            h_mirror=False,  # this is best handled by vpype
            save_svg=False,  # this is best handled by vpype
        )

vpype

The Swiss Army knife of vector graphics for pen plotters

MIT
Latest version published 12 months ago

Package Health Score

69 / 100
Full package analysis