T-Junctions re-visited


Re: T-Junctions re-visited
#31
This may be a result of an oversight I made. For small triangles the algorithm might find a false hit. Try replacing
Code:
# O (N_Edges N_Points)
for I,J in Edges
  for K in Points
    DIJ=Dist(P(I),P(J))
    DIK=Dist(P(I),P(K))
    DJK=Dist(P(I),P(K))
    if (abs(DIJ-(DIK+DJK))<TOL)
      # K is on the line between I & J
      PushLineTrio(I,J;K)
    endif
  endfor
endfor
by (here RTOL should be something like 1e-4, adjust to taste)
Code:
# O (N_Edges N_Points)
for I,J in Edges
  for K in Points
    DIJ=Dist(P(I),P(J))
    DIK=Dist(P(I),P(K))
    DJK=Dist(P(I),P(K))
    if ((abs(DIJ/(DIK+DJK)-1.0)<RTOL) && (abs(DIJ-(DIK+DJK))<TOL))# CHANGED TO INCLUDE A RELATIVE CHECK TOO
      # K is on the line between I & J
      PushLineTrio(I,J;K)
    endif
  endfor
endfor
Reply
« Next Oldest | Next Newest »



Messages In This Thread
T-Junctions re-visited - by Travis Cobbs - 2013-03-12, 5:38
Re: T-Junctions re-visited - by Tim Gould - 2013-03-12, 6:31
Re: T-Junctions re-visited - by Ben Supnik - 2013-03-12, 18:17
Re: T-Junctions re-visited - by Ben Supnik - 2013-03-12, 18:32
Re: T-Junctions re-visited - by Ben Supnik - 2013-03-12, 18:55
Re: T-Junctions re-visited - by Travis Cobbs - 2013-03-13, 18:27
Re: T-Junctions re-visited - by Allen Smith - 2013-03-12, 21:01
Re: T-Junctions re-visited - by Ben Supnik - 2013-03-13, 17:37
Re: T-Junctions re-visited - by Tim Gould - 2013-03-13, 21:31
Re: T-Junctions re-visited - by Ben Supnik - 2013-03-17, 15:43
Re: T-Junctions re-visited - by Ben Supnik - 2013-03-17, 16:02
Re: T-Junctions re-visited - by Ben Supnik - 2013-03-18, 14:30
Re: T-Junctions re-visited - by Travis Cobbs - 2013-03-18, 17:57
Re: T-Junctions re-visited - by Ben Supnik - 2013-03-18, 18:27
Re: T-Junctions re-visited - by Travis Cobbs - 2013-03-18, 19:23
Re: T-Junctions re-visited - by Ben Supnik - 2013-03-18, 20:41
Re: T-Junctions re-visited - by Travis Cobbs - 2013-03-18, 21:59
Re: T-Junctions re-visited - by Ben Supnik - 2013-03-19, 1:09
Re: T-Junctions re-visited - by Ben Supnik - 2013-03-19, 18:43
Re: T-Junctions re-visited - by Tim Gould - 2013-03-20, 10:56
Re: T-Junctions re-visited - by Travis Cobbs - 2013-03-20, 17:13
Re: T-Junctions re-visited - by Ben Supnik - 2013-03-20, 17:23
Re: T-Junctions re-visited - by Travis Cobbs - 2013-03-20, 17:29
Re: T-Junctions re-visited - by Travis Cobbs - 2013-03-20, 17:26
Re: T-Junctions re-visited - by Ben Supnik - 2013-03-20, 18:18
Re: T-Junctions re-visited - by Ben Supnik - 2013-03-20, 13:42
Re: T-Junctions re-visited - by Ben Supnik - 2013-03-20, 13:58
Re: T-Junctions re-visited - by Allen Smith - 2013-03-20, 16:08
Re: T-Junctions re-visited - by Ben Supnik - 2013-03-20, 18:50
Re: T-Junctions re-visited - by Tim Gould - 2013-03-13, 22:56
Re: T-Junctions re-visited - by Sergio Reano - 2013-03-13, 22:51
Re: T-Junctions re-visited - by Tim Gould - 2013-03-14, 0:10
Re: T-Junctions re-visited - by Ben Supnik - 2013-03-15, 3:17
Re: T-Junctions re-visited - by Tim Gould - 2013-03-15, 3:41
Re: T-Junctions re-visited - by Ben Supnik - 2013-03-15, 17:56
Re: T-Junctions re-visited - by Ben Supnik - 2013-03-14, 1:58
Re: T-Junctions re-visited - by Ben Supnik - 2013-03-14, 2:37
Re: T-Junctions re-visited - by Ben Supnik - 2013-03-14, 3:18
Re: T-Junctions re-visited - by Travis Cobbs - 2013-03-14, 22:23
Re: T-Junctions re-visited - by Tim Gould - 2013-03-14, 22:41
Re: T-Junctions re-visited - by Tim Gould - 2013-03-14, 2:43
Re: T-Junctions re-visited - by Tim Gould - 2013-03-14, 3:18
Re: T-Junctions re-visited - by Ben Supnik - 2013-03-15, 3:15
Re: T-Junctions re-visited - by Travis Cobbs - 2013-03-15, 19:27
Re: T-Junctions re-visited - by Ben Supnik - 2013-03-16, 0:08
Re: T-Junctions re-visited - by Ben Supnik - 2013-03-17, 15:58
Re: T-Junctions re-visited - by Travis Cobbs - 2013-03-18, 19:28
Re: T-Junctions re-visited - by Travis Cobbs - 2013-03-18, 19:32
Re: T-Junctions re-visited - by Sergio Reano - 2013-03-26, 21:46
Re: T-Junctions re-visited - by Sergio Reano - 2013-03-27, 20:48

Forum Jump:


Users browsing this thread: 2 Guest(s)