Skip to content

plycutter.geometry.geom2d

plycutter.geometry.geom2d.Geom2D

A set of semi-open convex polygons.

(called regularized polygons in CGAL)

Supports the set operations &, |, ^, - as well as ~..

Like Geom1D, we get a convenient set of properties by asserting that the enclosing lines and the contents are in different spaces ( e.g. rationals and rationals + sqrt(2)) so that unions and differences work in the most natural way possible.

Methods

all_segments(self)

Iterate over all line segments defining this geom. Depending on representation, may include internal segments that are not actual external boundary.

exterior(self)

Get the outer boundary as a list of vertices, provided this is a single polygon.

holes(self)

Iterator over the vertex lists of holes, provided this is a single polygon.

locate(self, pt)

Locate point wrt polyset

1 = in -1 = out 0 = indeterminate, possibly on edge, possibly on internal, virtual edge

polygons(self)

Iterate over all distinct polygons (with holes) in this geom.

repro(self)

This gets so long that it is not the default

show2d(self, ax, color, alpha=1.0, label=None, linewidth=0) inherited

Plot this Geom2D onto the given matplotlib Axes object.

to_mpatch(self, color='red', alpha=1.0, label=None, linewidth=0, ax=None) inherited

Convert to matplotlib.patches.PathPatch