Skip to content

Update Mesh Path points #139

Description

@PrashantKT

I am using this to create mesh from path

   func createLineMesh(generatedNode: SCNNode?, points3d: [simd_float3], color: Color, radius: CGFloat = 0.08, name: String) {
        guard let generatedNode = generatedNode, !points3d.isEmpty else { return }
        
        if let existingNode = generatedNode.childNode(withName: name, recursively: false) {
            existingNode.removeFromParentNode()
        }
        
        let pathPoint = points3d.map{ PathPoint(Vector($0), texcoord: nil, color: color, isCurved: true)}
        let path = Path.curve(pathPoint)
        let mesh =  Mesh.stroke(path, width: radius, detail: 4)
        let node = SCNNode(geometry: SCNGeometry(mesh))
        node.name = name
        generatedNode.addChildNode(node)
        
    }

Can we update PathPoint in mesh to modify curve without recreating whole mesh ?

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions