Polygon
A polygon is an arbitrary shape that is defined by a series of points. This is similar to the line object, however, a polygon can be filled.
Property | Description |
---|---|
Fill | Fill Color. If the shape is not closed, the filled area will be bounded by an invisible line between the start and end points. |
Path | A list of points that defines the outline of the shape. The path does not need to end at the origin. |
Stroke | Outline Color |
Thickness | Width of the outline |
View Example
{
"$type": "Polygon",
"Name": "MyPolygon",
"Path": "0,0,150,120,300,0,180,150,300,300,150,180,0,300,120,150,0,0",
"Stroke":"#000000",
"Fill":"#FFFF00",
"Thickness":"2",
"X":"100",
"Y":"100"
}
Python Example
from Omniview.Python import *
path = [
Vector2(10,10),
Vector2(10,300),
Vector2(300,300),
Vector2(300,10),
Vector2(150,150),
Vector2(10,10)
]
myPolygon = Polygon(path)
myPolygon.Name = "MyPolygon"
myPolygon.Stroke = Color('#000000')
myPolygon.Fill = Color("#00FF00")
myPolygon.Thickness = 1
myPolygon.X = 100
myPolygon.Y = 100
Omniview.Windows[0].Content.AddViewObject(myPolygon)