title: SCNGeometry with polygon as primitiveType
body: <p>Trying to figure out how I create a SCNGeometry with polygon as primitiveType,
  My goal is to add polygon shaped node as a child of a sphere node, and make it look like MKPolygon for map kit, <a href="https://www.raywenderlich.com/87008/overlay-views-mapkit-swift-tutorial" rel="noreferrer">like in this example</a>.</p>
  
  <p><a href="https://i.stack.imgur.com/ns4FH.png" rel="noreferrer"><img src="https://i.stack.imgur.com/ns4FH.png" alt="MKPolygon"></a></p>
  
  <p>My current code is:</p>
  
  <pre><code>//Take an arbitrary array of vectors
  let vertices: [SCNVector3] = [
  SCNVector3Make(-0.1304485, 0.551937, 0.8236193),
  SCNVector3Make(0.01393811, 0.601815, 0.7985139),
  SCNVector3Make(0.2971005, 0.5591929, 0.7739732),
  SCNVector3Make(0.4516893, 0.5150381, 0.7285002),
  SCNVector3Make(0.4629132, 0.4383712, 0.7704169),
  SCNVector3Make(0.1333823, 0.5224985, 0.8421428),
  SCNVector3Make(-0.1684743, 0.4694716, 0.8667254)]
  
  //Does polygon shape require indices?
  let indices: [Int] = [0,1,2,3,4,5,6]
  
  let vertexSource = SCNGeometrySource(vertices: vertices)
  let indexData = Data(bytes: indices, count: indices.count * MemoryLayout&lt;Int&gt;.size)
  
  //Note!!! I get compiler error if primitiveCount is greater than 0
  let element = SCNGeometryElement(data: indexData, primitiveType: .polygon, primitiveCount: 0, bytesPerIndex: MemoryLayout&lt;Int&gt;.size)
  let geometry = SCNGeometry(sources: [vertexSource], elements: [element])
  
  let material = SCNMaterial()
  material.diffuse.contents = UIColor.purple.withAlphaComponent(0.75)
  material.isDoubleSided = true
  geometry.firstMaterial = material
  
  let node = SCNNode(geometry: geometry)
  </code></pre>
  
  <p>When using <strong>SCNGeometryElement</strong> like this I get an empty node.</p>