weighted_offset_polygon

compas_cgal.straight_skeleton_2.weighted_offset_polygon(points, offset, weights)

Compute the offset from a 2D polygon with weights.

Parameters:
pointslist of point coordinates or compas.geometry.Polygon

The points of the 2D polygon.

offsetfloat

The offset distance. If negative, the offset is outside the polygon, otherwise inside.

weightslist of float

The weights for each edge, starting with the edge between the last and the first point.

Returns:
list[Polygon]

The offset polygon(s).

Raises:
ValueError

If the normal of the polygon is not directed vertically upwards like [0, 0, 1].

ValueError

If the number of weights does not match the number of points.