UIBezierPath intersect

前端 未结 2 1594
鱼传尺愫
鱼传尺愫 2020-12-03 22:49

I\'ve been searching for an answer for hours but have trouble finding anything on the topic.

I have a question related to Objective-c. I\'m making an application in

2条回答
  •  [愿得一人]
    2020-12-03 23:21

    I've found another workaround to check if the line intersect it self. With SceneKit framework it possible to create shape from UIBezierPath. But if the path intersects then bounding box of the node will be zeroed.

       let path = UIBezierPath()
    
        //...
    
        let testGeometry = SCNShape(path:path, extrusionDepth: 0.5)
        let testNode = SCNNode(geometry: testGeometry)
    
        if (testNode.boundingBox.max - testNode.boundingBox.min).length() > 0 {
        // No intersection (or empty)
       }
    

提交回复
热议问题