Challenge 1: Where do I specify a shape property?

I added a Tube to my scene with the following code (this works):

    case .Tube:
        shapeGeometry = SCNTube( innerRadius: 0.65, outerRadius: 0.8, height: 1.0)
        node = SCNNode(geometry: shapeGeometry)
        node.position = SCNVector3( 0.0, 0.0, -1.5 )

The documentation shows that a tube can also have the properties radialSegmentCount and heightSegmentCount but I can’t find where to put them. The possibilities I could think don’t compile. Such as:

 shapeGeometry.radialSegmentCount = 5
 node.radialSegmentCount = 5
 or as a 4th arg in SCNTube()

How do these properties get specified?

The reason why you’re not able to set those specific properties on shapeGeometry is because it’s not of type SCNTube, it’s actually of the parent type SCNGeometry. You either need to cast it back into a SCNTube or create a separate variable as a proper SCNTube then set shapeGeometry to it once you’ve set all the properties.

I tried that and I see that it works as you say. That led to trying to use SCNMaterials and related things I see in the documentation, which didn’t work as I expected. I see you cover materials later in the book so I’ll wait till I get up to that to try to understand it. It will be a while because I have to take a major pause to do my income tax return.