Drawing an arc using SCNShape and UIBezierPath

I am trying to draw a piece of cake in SCNShapeusing the following code:

UIBezierPath *piePiece = [UIBezierPath bezierPath];
[piePiece addArcWithCenter: CGPointZero radius:  0.150 startAngle: 0.0 endAngle: M_PI/6  clockwise: YES];
[piePiece closePath];
SCNShape *pieShape = [SCNShape shapeWithPath: piePiece extrusionDepth: 0];
pieShape.firstMaterial.diffuse.contents = [UIColor blueColor];
pieShape.firstMaterial.doubleSided = YES;
SCNNode *pieNode = [SCNNode nodeWithGeometry: pieShape];

But I get the following form:

Example I do not see an arc. What am I doing wrong?

thank

+4
source share

Source: https://habr.com/ru/post/1687921/


All Articles