View Single Post
  #2  
Old 13-05-2020, 12:19
VyperOne VyperOne is offline
Member
 
Join Date: Feb 2003
Posts: 37
Default

This is possible. I did something like that a while back, where you loop through a node range comparing one node to another and if it is within your tolerance it will join the two nodes thus closing the gap and eliminating a node.

Goes something like this:

Code:
 For Each nNode As CorelDRAW.Node In nr
           
            nLoopCount = 1
            If nNode.IsEnding = True Then

                For Each n_loop As CorelDRAW.Node In nr_loop
                    If n_loop.IsEnding = True Then

                        nodeDistance = nNode.GetDistanceFrom(n_loop)

                        If (nodeDistance <= dTolerance) And (nNode.AbsoluteIndex <> n_loop.AbsoluteIndex) Then

                            nNode.JoinWith(n_loop)

                            njoined += 1

                            Me.lbl_Removed.Text = "Number of Nodes Removed: " & njoined.ToString

                            My.Application.DoEvents()
                        End If
                    End If

                    nLoopCount = nLoopCount + 1

                Next n_loop
                
            End If
Reply With Quote