Polygon.from_data

classmethod Polygon.from_data(data)[source]

Construct a polygon from its data representation.

Parameters

data (dict) – The data dictionary.

Returns

compas.geometry.Polygon – The constructed polygon.

Examples

>>> polygon = Polygon.from_data({'points': [[0.0, 0.0, 0.0], [1.0, 0.0, 0.0], [1.0, 1.0, 0.0], [0.0, 1.0, 1.0]]})
>>> polygon.points[0]
Point(0.000, 0.000, 0.000)