toWwkPolygon

fun DrawnPolygon.toWwkPolygon(): Polygon

Maps a DrawnPolygon to the WWK renderable that actually draws it on the globe.

Polygon.altitudeMode and Polygon.isFollowTerrain are set together deliberately: WWK only treats a shape as a terrain-draped "surface shape" (rendered flat against the ground, ignoring elevation) when both are set this way. With either left at its default, the polygon is placed at literal sea-level height and normal terrain (e.g. mountains) depth-tests it away — invisible even though it "exists".

A polygon of several rings (see DrawnPolygon) is ONE WWK Polygon with a boundary for each ring: WWK fills it with the even-odd rule, so a ring inside another one is a hole, and separate rings are separate parts, as in the model (checked on an emulator).

Long edges get their great-circle points from densifiedWwkPositions rather than from WWK, which would set aside memory for 63 of them on every edge (see there).

DrawnPolygon.outlineStyle/DrawnPolygon.outlineWidth reuse toWwkLineAttributes (the same conversion com.tcsappdev.worldwinddraw.core.geometry.DrawnPolyline uses for its stroke) and get merged onto the interior attributes toWwkShapeAttributes already built — a Polygon's Polygon.attributes is one object carrying both interior and outline settings, unlike core's model where they're two separate styles (see DrawnPolygon's KDoc for why).