Revision: 55887
http://sourceforge.net/p/brlcad/code/55887
Author: phoenixyjll
Date: 2013-06-28 06:43:56 +0000 (Fri, 28 Jun 2013)
Log Message:
-----------
According to openNURBS's declaration, for ccx_point events, m_a[0] should be
equal to m_a[1] (m_b[0] == m_b[1], m_A[0] == m_A[1], m_B[0] == m_B[1]...). And
change the logic so that if it's not an overlap event, two ccx_point events may
be generated.
Modified Paths:
--------------
brlcad/trunk/src/libbrep/intersect.cpp
Modified: brlcad/trunk/src/libbrep/intersect.cpp
===================================================================
--- brlcad/trunk/src/libbrep/intersect.cpp 2013-06-27 19:56:07 UTC (rev
55886)
+++ brlcad/trunk/src/libbrep/intersect.cpp 2013-06-28 06:43:56 UTC (rev
55887)
@@ -674,10 +674,10 @@
t_b = i->second->m_t.ParameterAt(t_lineB);
ON_X_EVENT* Event = new ON_X_EVENT;
- Event->m_A[0] = lineA.PointAt(t_lineA);
- Event->m_B[0] = lineB.PointAt(t_lineB);
- Event->m_a[0] = t_a;
- Event->m_b[0] = t_b;
+ Event->m_A[0] = Event->m_A[1] = lineA.PointAt(t_lineA);
+ Event->m_B[0] = Event->m_B[1] = lineB.PointAt(t_lineB);
+ Event->m_a[0] = Event->m_a[1] = t_a;
+ Event->m_b[0] = Event->m_b[1] = t_b;
Event->m_type = ON_X_EVENT::ccx_point;
tmp_x.Append(*Event);
}
@@ -709,10 +709,10 @@
// Check the validity of the solution
if (distance < intersection_tolerance) {
ON_X_EVENT *Event = new ON_X_EVENT;
- Event->m_A[0] = pointA;
- Event->m_B[0] = pointB;
- Event->m_a[0] = t_a1;
- Event->m_b[0] = t_b1;
+ Event->m_A[0] = Event->m_A[1] = pointA;
+ Event->m_B[0] = Event->m_B[1] = pointB;
+ Event->m_a[0] = Event->m_a[1] = t_a1;
+ Event->m_b[0] = Event->m_b[1] = t_b1;
Event->m_type = ON_X_EVENT::ccx_point;
tmp_x.Append(*Event);
}
@@ -754,27 +754,31 @@
if (!ON_Intersect(test_point, *curveA, pci_x,
overlap_tolerance))
break;
}
- if (j != CCI_OVERLAP_TEST_POINTS)
- Event->m_type = ON_X_EVENT::ccx_point;
- else
+ if (j == CCI_OVERLAP_TEST_POINTS) {
Event->m_type = ON_X_EVENT::ccx_overlap;
- tmp_x.Append(*Event);
- } else if (distance1 < intersection_tolerance) {
+ tmp_x.Append(*Event);
+ continue;
+ }
+ // if j != CCI_OVERLAP_TEST_POINTS, two ccx_point events
should
+ // be generated. Fall through.
+ }
+ if (distance1 < intersection_tolerance) {
// in case that the second one was not correct
ON_X_EVENT *Event = new ON_X_EVENT;
- Event->m_A[0] = pointA1;
- Event->m_B[0] = pointB1;
- Event->m_a[0] = t_a1;
- Event->m_b[0] = t_b1;
+ Event->m_A[0] = Event->m_A[1] = pointA1;
+ Event->m_B[0] = Event->m_B[1] = pointB1;
+ Event->m_a[0] = Event->m_a[1] = t_a1;
+ Event->m_b[0] = Event->m_b[1] = t_b1;
Event->m_type = ON_X_EVENT::ccx_point;
tmp_x.Append(*Event);
- } else if (distance2 < intersection_tolerance) {
+ }
+ if (distance2 < intersection_tolerance) {
// in case that the first one was not correct
ON_X_EVENT *Event = new ON_X_EVENT;
- Event->m_A[0] = pointA2;
- Event->m_B[0] = pointB2;
- Event->m_a[0] = t_a2;
- Event->m_b[0] = t_b2;
+ Event->m_A[0] = Event->m_A[1] = pointA2;
+ Event->m_B[0] = Event->m_B[1] = pointB2;
+ Event->m_a[0] = Event->m_a[1] = t_a2;
+ Event->m_b[0] = Event->m_b[1] = t_b2;
Event->m_type = ON_X_EVENT::ccx_point;
tmp_x.Append(*Event);
}
This was sent by the SourceForge.net collaborative development platform, the
world's largest Open Source development site.
------------------------------------------------------------------------------
This SF.net email is sponsored by Windows:
Build for Windows Store.
http://p.sf.net/sfu/windows-dev2dev
_______________________________________________
BRL-CAD Source Commits mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/brlcad-commits