Skip to content

Feat: useq.GridFromPolygon #223

@rlokkie

Description

@rlokkie

Coming back on the discussion below:
Originally posted by @rlokkie in #42

So I want to create tile positions based on a polygon, currently I have some very wip code.
That creates a grid from the bounding box, and then retains the points-in-polygon by ray casting which seems to work*.

However I did find that the best results are achieved by using some kind of polygon-offsetting/dilation/buffering.
Also shifting the point.x,point.y with respect to the fov.width and overlap gives a cleaner result.

Offsetting is easily done using shapely, but then you import a library for 1 function.
So maybe a python rewrite in useq._utils.py would be preferred.
Or should anything that even affects (e.g. convex hull) the polygon shape happen outside of useq?

*When using reasonable number of tiles, it takes a minute or two to plot all the tiles when creating 300k+ tiles, maybe a check on tiles isn't a bad idea?

Image

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions