topologicpy.Polyskel module

class topologicpy.Polyskel.Subtree(source, height, sinks)

Bases: tuple

Attributes
height

Alias for field number 1

sinks

Alias for field number 2

source

Alias for field number 0

Methods

count(value, /)

Return number of occurrences of value.

index(value[, start, stop])

Return first index of value.

height

Alias for field number 1

sinks

Alias for field number 2

source

Alias for field number 0

topologicpy.Polyskel.bisector(v1, v2, v3)

Compute the bisector direction at vertex v2 formed by edges (v1-v2) and (v2-v3).

topologicpy.Polyskel.distance(v1, v2)
topologicpy.Polyskel.normalize(v)
topologicpy.Polyskel.skeletonize(polygon, holes=None)

Compute the straight skeleton of a polygon using TopologicPy.

polygon: List of (x, y) tuples defining the outer boundary in CCW order. holes: List of inner boundaries (holes), each defined in CW order.

Returns: List of Subtrees representing the skeleton.