Just wanted to know is it possible (I know it is, but how) to draw dashed line in ARSCNView like in the Measure app? Maybe there is a way to use scene nodes out of the box, idk.
I've been using the SCNCylinder to draw a straight line and IDK is it possible to reuse it and adjust or we have to use a really different way to make the dashed line.
import SceneKit
class CylinderLineNode: SCNNode {
private(set) var cylinder: SCNCylinder
private(set) var positionA: SCNVector3
private(set) var positionB: SCNVector3
init(with positionA: SCNVector3, positionB: SCNVector3, radius: CGFloat = 0.02, color: UIColor = .red) {
self.positionA = positionA
self.positionB = positionB
let vector = positionB - positionA
let height = vector.length()
cylinder = SCNCylinder(radius: radius, height: CGFloat(height))
cylinder.radialSegmentCount = 8
cylinder.firstMaterial?.diffuse.contents = color
super.init()
geometry = cylinder
position = (positionB + positionA) / 2
eulerAngles = SCNVector3.lineEulerAngles(vector: vector)
}
...
}