Welcome! Log In Create A New Profile

Re: T-Junctions re-visited
 March 14, 2013 03:41PM Website Administrator Steering Committee Member LDraw Part Author/Reviewer Registered: 4 years agoPosts: 1,112
This may be a result of an oversight I made. For small triangles the algorithm might find a false hit. Try replacing
```# 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)
```# 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
```

Edited 4 time(s). Last edit at 2013-03-14 03:44PM by Tim Gould.
SubjectAuthorViewsPosted
Travis Cobbs1111March 11, 2013 10:38PM
Tim Gould586March 11, 2013 11:31PM
Roland Melkert488March 12, 2013 11:17AM
Ben Supnik523March 12, 2013 11:17AM
Roland Melkert498March 12, 2013 11:22AM
Ben Supnik480March 12, 2013 11:32AM
Roland Melkert474March 12, 2013 11:41AM
Ben Supnik475March 12, 2013 11:55AM
Roland Melkert483March 13, 2013 10:08AM
Travis Cobbs505March 13, 2013 11:27AM
Allen Smith503March 12, 2013 02:01PM
Michael Heidemann498March 13, 2013 09:27AM
Ben Supnik475March 13, 2013 10:37AM
Tim Gould483March 13, 2013 02:31PM
Michael Heidemann466March 13, 2013 03:42PM
Michael Heidemann493March 17, 2013 04:35AM
Ben Supnik431March 17, 2013 08:43AM
Michael Heidemann438March 17, 2013 08:59AM
Ben Supnik413March 17, 2013 09:02AM
Magnus Forsberg448March 17, 2013 09:15AM
Travis Cobbs508March 17, 2013 10:09PM
Ben Supnik492March 18, 2013 07:30AM
Travis Cobbs492March 18, 2013 10:57AM
Ben Supnik485March 18, 2013 11:27AM
Travis Cobbs470March 18, 2013 12:23PM
Ben Supnik563March 18, 2013 01:41PM
Roland Melkert560March 18, 2013 02:51PM
Travis Cobbs547March 18, 2013 02:59PM
Roland Melkert600March 18, 2013 03:41PM
Ben Supnik602March 18, 2013 06:09PM
Roland Melkert538March 19, 2013 11:38AM
Ben Supnik533March 19, 2013 11:43AM
Roland Melkert568March 19, 2013 07:07PM
Travis Cobbs561March 19, 2013 10:13PM
Tim Gould555March 20, 2013 03:56AM
Travis Cobbs515March 20, 2013 10:13AM
Ben Supnik523March 20, 2013 10:23AM
Travis Cobbs562March 20, 2013 10:29AM
Travis Cobbs507March 20, 2013 10:26AM
Ben Supnik483March 20, 2013 11:18AM
Ben Supnik493March 20, 2013 06:42AM
Roland Melkert482March 20, 2013 11:36AM
Philippe Hurbain506March 20, 2013 06:36AM
Ben Supnik516March 20, 2013 06:58AM
Allen Smith576March 20, 2013 09:08AM
Roland Melkert648March 20, 2013 11:35AM
Ben Supnik1058March 20, 2013 11:50AM
Michael Heidemann562March 18, 2013 03:54PM
Roland Melkert480March 13, 2013 10:03AM
Tim Gould439March 13, 2013 03:56PM
Sergio Reano435March 13, 2013 03:51PM
Roland Melkert514March 13, 2013 04:36PM
Tim Gould454March 13, 2013 05:10PM
Ben Supnik553March 14, 2013 08:17PM
Tim Gould581March 14, 2013 08:41PM
Ben Supnik520March 15, 2013 10:56AM
Roland Melkert494March 15, 2013 11:36AM
Ben Supnik417March 13, 2013 06:58PM
Roland Melkert434March 13, 2013 07:27PM
Ben Supnik419March 13, 2013 07:37PM
Roland Melkert490March 13, 2013 07:59PM
Ben Supnik493March 13, 2013 08:18PM
Travis Cobbs588March 14, 2013 03:23PM
Roland Melkert592March 14, 2013 03:34PM
Tim Gould567March 14, 2013 03:41PM
Roland Melkert539March 15, 2013 11:33AM
Tim Gould469March 13, 2013 07:43PM
Roland Melkert483March 13, 2013 08:08PM
Tim Gould505March 13, 2013 08:18PM
Ben Supnik588March 14, 2013 08:15PM
Roland Melkert559March 15, 2013 11:29AM
Travis Cobbs505March 15, 2013 12:27PM
Ben Supnik496March 15, 2013 05:08PM
Travis Cobbs520March 16, 2013 11:29PM
Ben Supnik443March 17, 2013 08:58AM
Roland Melkert425March 17, 2013 12:35PM
Travis Cobbs460March 18, 2013 12:28PM
Travis Cobbs583March 18, 2013 12:32PM
Roland Melkert527March 18, 2013 05:00PM
Travis Cobbs571March 18, 2013 11:05PM
Roland Melkert632March 19, 2013 11:38AM
Sergio Reano554March 26, 2013 02:46PM
Roland Melkert468March 27, 2013 11:19AM
Sergio Reano569March 27, 2013 01:48PM

Sorry, only registered users may post in this forum.