I am trying to draw a piece of pie in SCNShape
using 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 shape:
Sample I don't see the arc. What am I doing wrong?
Thanks
You must change the flatness of the UIBezierPath to a lower value. In Swift:
pieShape.flatness = 0.0003
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With