Revision: 55046
http://brlcad.svn.sourceforge.net/brlcad/?rev=55046&view=rev
Author: starseeker
Date: 2013-04-04 13:35:00 +0000 (Thu, 04 Apr 2013)
Log Message:
-----------
Rename file for bn_tri_tri_isect_coplanar test and update test names
Modified Paths:
--------------
brlcad/trunk/src/libbn/tests/CMakeLists.txt
Added Paths:
-----------
brlcad/trunk/src/libbn/tests/bn_tri_tri_isect_coplanar.c
Removed Paths:
-------------
brlcad/trunk/src/libbn/tests/bn_coplanar_tri_tri_isect.c
Modified: brlcad/trunk/src/libbn/tests/CMakeLists.txt
===================================================================
--- brlcad/trunk/src/libbn/tests/CMakeLists.txt 2013-04-04 13:31:29 UTC (rev
55045)
+++ brlcad/trunk/src/libbn/tests/CMakeLists.txt 2013-04-04 13:35:00 UTC (rev
55046)
@@ -1,10 +1,10 @@
-BRLCAD_ADDEXEC(tester_bn_coplanar_tri_tri_isect bn_coplanar_tri_tri_isect.c
"libbu;libbn" NO_INSTALL LOCAL)
+BRLCAD_ADDEXEC(tester_bn_tri_tri_isect_coplanar bn_tri_tri_isect_coplanar.c
"libbu;libbn" NO_INSTALL LOCAL)
BRLCAD_ADDEXEC(tester_bn_tri_tri_isect bn_tri_tri_isect.c "libbu;libbn"
NO_INSTALL LOCAL)
BRLCAD_ADDEXEC(tester_bn_list bn_list.c "libbu;libbn" NO_INSTALL LOCAL)
-# For tester_bn_coplanar_tri_tri_isect, the input format is as follows:
+# For tester_bn_tri_tri_isect_coplanar, the input format is as follows:
#
-# tester_bn_coplanar_tri_tri_isect V0 V1 V2 U0 U1 U2 <area_flag> <expected
result>
+# tester_bn_tri_tri_isect_coplanar V0 V1 V2 U0 U1 U2 <area_flag> <expected
result>
#
# where P and Q are the two triangles in question. An individual point
# is three integer or floating point numbers separated by commas. The area
@@ -12,16 +12,16 @@
# overlap in coplanar cases.
# TODO - need some tests with floating point vertices that are down around the
EPSILON threshold - that's
-# where the NEAR_ZERO components of the bn_coplanar_tri_tri_isect logic become
important.
+# where the NEAR_ZERO components of the bn_tri_tri_isect_coplanar logic become
important.
-add_test(bn_coplanar_tri_tri_isect_null_noarea
tester_bn_coplanar_tri_tri_isect 0,0,0 1,0,0 1,1,0 1.00001,0,0 2,0,0
1.00001,1,0 0 0)
-add_test(bn_coplanar_tri_tri_isect_vertex_noarea
tester_bn_coplanar_tri_tri_isect 0,0,0 1,0,0 1,1,0 1.00001,0,0 2,0,0 1,1,0
0 1)
-add_test(bn_coplanar_tri_tri_isect_edge_noarea
tester_bn_coplanar_tri_tri_isect 0,0,0 1,0,0 1,1,0 1,0,0 2,0,0 1,1,0
0 1)
-add_test(bn_coplanar_tri_tri_isect_full_noarea
tester_bn_coplanar_tri_tri_isect 0,0,0 1,0,0 1,1,0 1,0,0 2,0,0
0.7,0.8,0 0 1)
-add_test(bn_coplanar_tri_tri_isect_null_area
tester_bn_coplanar_tri_tri_isect 0,0,0 1,0,0 1,1,0 1.00001,0,0 2,0,0
1.00001,1,0 1 0)
-add_test(bn_coplanar_tri_tri_isect_vertex_area
tester_bn_coplanar_tri_tri_isect 0,0,0 1,0,0 1,1,0 1.00001,0,0 2,0,0 1,1,0
1 0)
-add_test(bn_coplanar_tri_tri_isect_edge_area
tester_bn_coplanar_tri_tri_isect 0,0,0 1,0,0 1,1,0 1,0,0 2,0,0 1,1,0
1 0)
-add_test(bn_coplanar_tri_tri_isect_full_area
tester_bn_coplanar_tri_tri_isect 0,0,0 1,0,0 1,1,0 1,0,0 2,0,0
0.7,0.8,0 1 1)
+add_test(bn_tri_tri_isect_coplanar_null_noarea
tester_bn_tri_tri_isect_coplanar 0,0,0 1,0,0 1,1,0 1.00001,0,0 2,0,0
1.00001,1,0 0 0)
+add_test(bn_tri_tri_isect_coplanar_vertex_noarea
tester_bn_tri_tri_isect_coplanar 0,0,0 1,0,0 1,1,0 1.00001,0,0 2,0,0 1,1,0
0 1)
+add_test(bn_tri_tri_isect_coplanar_edge_noarea
tester_bn_tri_tri_isect_coplanar 0,0,0 1,0,0 1,1,0 1,0,0 2,0,0 1,1,0
0 1)
+add_test(bn_tri_tri_isect_coplanar_full_noarea
tester_bn_tri_tri_isect_coplanar 0,0,0 1,0,0 1,1,0 1,0,0 2,0,0
0.7,0.8,0 0 1)
+add_test(bn_tri_tri_isect_coplanar_null_area
tester_bn_tri_tri_isect_coplanar 0,0,0 1,0,0 1,1,0 1.00001,0,0 2,0,0
1.00001,1,0 1 0)
+add_test(bn_tri_tri_isect_coplanar_vertex_area
tester_bn_tri_tri_isect_coplanar 0,0,0 1,0,0 1,1,0 1.00001,0,0 2,0,0 1,1,0
1 0)
+add_test(bn_tri_tri_isect_coplanar_edge_area
tester_bn_tri_tri_isect_coplanar 0,0,0 1,0,0 1,1,0 1,0,0 2,0,0 1,1,0
1 0)
+add_test(bn_tri_tri_isect_coplanar_full_area
tester_bn_tri_tri_isect_coplanar 0,0,0 1,0,0 1,1,0 1,0,0 2,0,0
0.7,0.8,0 1 1)
# For tester_bn_tri_tri_isect, the input format is as follows:
#
@@ -31,10 +31,10 @@
# is three integer or floating point numbers separated by commas.
# Test coplanar triangles
-add_test(bn_tri_tri_isect_coplanar_null tester_bn_tri_tri_isect 0,0,0 1,0,0
1,1,0 1.00001,0,0 2,0,0 1.00001,1,0 0)
-add_test(bn_tri_tri_isect_coplanar_vertex tester_bn_tri_tri_isect 0,0,0 1,0,0
1,1,0 1.00001,0,0 2,0,0 1,1,0 1)
-add_test(bn_tri_tri_isect_coplanar_edge tester_bn_tri_tri_isect 0,0,0 1,0,0
1,1,0 1,0,0 2,0,0 1,1,0 1)
-add_test(bn_tri_tri_isect_coplanar_full tester_bn_tri_tri_isect 0,0,0 1,0,0
1,1,0 1,0,0 2,0,0 0.7,0.8,0 1)
+add_test(bn_tri_tri_isect_cp_null tester_bn_tri_tri_isect 0,0,0 1,0,0 1,1,0
1.00001,0,0 2,0,0 1.00001,1,0 0)
+add_test(bn_tri_tri_isect_cp_vertex tester_bn_tri_tri_isect 0,0,0 1,0,0 1,1,0
1.00001,0,0 2,0,0 1,1,0 1)
+add_test(bn_tri_tri_isect_cp_edge tester_bn_tri_tri_isect 0,0,0 1,0,0 1,1,0
1,0,0 2,0,0 1,1,0 1)
+add_test(bn_tri_tri_isect_cp_full tester_bn_tri_tri_isect 0,0,0 1,0,0 1,1,0
1,0,0 2,0,0 0.7,0.8,0 1)
# Test more general triangles
add_test(bn_tri_tri_isect_null tester_bn_tri_tri_isect 0,0,0 1,0,0 1,1,0
1,0,1 1,0,1 1,1,1 0)
Deleted: brlcad/trunk/src/libbn/tests/bn_coplanar_tri_tri_isect.c
===================================================================
--- brlcad/trunk/src/libbn/tests/bn_coplanar_tri_tri_isect.c 2013-04-04
13:31:29 UTC (rev 55045)
+++ brlcad/trunk/src/libbn/tests/bn_coplanar_tri_tri_isect.c 2013-04-04
13:35:00 UTC (rev 55046)
@@ -1,84 +0,0 @@
-/* B N _ C O P L A N A R _ T R I _ T R I _ ISECT . C
- * BRL-CAD
- *
- * Copyright (c) 2011-2013 United States Government as represented by
- * the U.S. Army Research Laboratory.
- *
- * This library is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public License
- * version 2.1 as published by the Free Software Foundation.
- *
- * This library is distributed in the hope that it will be useful, but
- * WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this file; see the file named COPYING for more
- * information.
- */
-
-#include "common.h"
-
-#include <stdlib.h>
-#include <stdio.h>
-#include <string.h>
-
-#include "bu.h"
-#include "bn.h"
-
-
-int
-main(int argc, char **argv)
-{
- int expected_result = 0;
- int actual_result = 0;
- int area_flag = 0;
- float f1, f2, f3 = 0.0;
- point_t V0 = VINIT_ZERO;
- point_t V1 = VINIT_ZERO;
- point_t V2 = VINIT_ZERO;
- point_t U0 = VINIT_ZERO;
- point_t U1 = VINIT_ZERO;
- point_t U2 = VINIT_ZERO;
-
- if (argc != 9)
- bu_exit(1, "ERROR: input format is V0x,V0y,V0z V1x,V1y,V1z V2x,V2y,V2z
U0x,U0y,U0z U1x,U1y,U1z U2x,U2y,U2z area_flag expected_result [%s]\n", argv[0]);
-
- sscanf(argv[1], "%f,%f,%f", &f1, &f2, &f3);
- V0[0] = f1; V0[1] = f2; V0[2] = f3;
- sscanf(argv[2], "%f,%f,%f", &f1, &f2, &f3);
- V1[0] = f1; V1[1] = f2; V1[2] = f3;
- sscanf(argv[3], "%f,%f,%f", &f1, &f2, &f3);
- V2[0] = f1; V2[1] = f2; V2[2] = f3;
- sscanf(argv[4], "%f,%f,%f", &f1, &f2, &f3);
- U0[0] = f1; U0[1] = f2; U0[2] = f3;
- sscanf(argv[5], "%f,%f,%f", &f1, &f2, &f3);
- U1[0] = f1; U1[1] = f2; U1[2] = f3;
- sscanf(argv[6], "%f,%f,%f", &f1, &f2, &f3);
- U2[0] = f1; U2[1] = f2; U2[2] = f3;
- sscanf(argv[7], "%d", &area_flag);
- sscanf(argv[8], "%d", &expected_result);
-
- actual_result = bn_tri_tri_isect_coplanar(V0,V1,V2,U0,U1,U2,area_flag);
-
- bu_log("result: %d\n", actual_result);
-
- if(expected_result == actual_result) {
- return 0;
- } else {
- return -1;
- }
-}
-
-
-/** @} */
-/*
- * Local Variables:
- * mode: C
- * tab-width: 8
- * indent-tabs-mode: t
- * c-file-style: "stroustrup"
- * End:
- * ex: shiftwidth=4 tabstop=8
- */
Copied: brlcad/trunk/src/libbn/tests/bn_tri_tri_isect_coplanar.c (from rev
55045, brlcad/trunk/src/libbn/tests/bn_coplanar_tri_tri_isect.c)
===================================================================
--- brlcad/trunk/src/libbn/tests/bn_tri_tri_isect_coplanar.c
(rev 0)
+++ brlcad/trunk/src/libbn/tests/bn_tri_tri_isect_coplanar.c 2013-04-04
13:35:00 UTC (rev 55046)
@@ -0,0 +1,84 @@
+/* B N _ C O P L A N A R _ T R I _ T R I _ ISECT . C
+ * BRL-CAD
+ *
+ * Copyright (c) 2011-2013 United States Government as represented by
+ * the U.S. Army Research Laboratory.
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public License
+ * version 2.1 as published by the Free Software Foundation.
+ *
+ * This library is distributed in the hope that it will be useful, but
+ * WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this file; see the file named COPYING for more
+ * information.
+ */
+
+#include "common.h"
+
+#include <stdlib.h>
+#include <stdio.h>
+#include <string.h>
+
+#include "bu.h"
+#include "bn.h"
+
+
+int
+main(int argc, char **argv)
+{
+ int expected_result = 0;
+ int actual_result = 0;
+ int area_flag = 0;
+ float f1, f2, f3 = 0.0;
+ point_t V0 = VINIT_ZERO;
+ point_t V1 = VINIT_ZERO;
+ point_t V2 = VINIT_ZERO;
+ point_t U0 = VINIT_ZERO;
+ point_t U1 = VINIT_ZERO;
+ point_t U2 = VINIT_ZERO;
+
+ if (argc != 9)
+ bu_exit(1, "ERROR: input format is V0x,V0y,V0z V1x,V1y,V1z V2x,V2y,V2z
U0x,U0y,U0z U1x,U1y,U1z U2x,U2y,U2z area_flag expected_result [%s]\n", argv[0]);
+
+ sscanf(argv[1], "%f,%f,%f", &f1, &f2, &f3);
+ V0[0] = f1; V0[1] = f2; V0[2] = f3;
+ sscanf(argv[2], "%f,%f,%f", &f1, &f2, &f3);
+ V1[0] = f1; V1[1] = f2; V1[2] = f3;
+ sscanf(argv[3], "%f,%f,%f", &f1, &f2, &f3);
+ V2[0] = f1; V2[1] = f2; V2[2] = f3;
+ sscanf(argv[4], "%f,%f,%f", &f1, &f2, &f3);
+ U0[0] = f1; U0[1] = f2; U0[2] = f3;
+ sscanf(argv[5], "%f,%f,%f", &f1, &f2, &f3);
+ U1[0] = f1; U1[1] = f2; U1[2] = f3;
+ sscanf(argv[6], "%f,%f,%f", &f1, &f2, &f3);
+ U2[0] = f1; U2[1] = f2; U2[2] = f3;
+ sscanf(argv[7], "%d", &area_flag);
+ sscanf(argv[8], "%d", &expected_result);
+
+ actual_result = bn_tri_tri_isect_coplanar(V0,V1,V2,U0,U1,U2,area_flag);
+
+ bu_log("result: %d\n", actual_result);
+
+ if(expected_result == actual_result) {
+ return 0;
+ } else {
+ return -1;
+ }
+}
+
+
+/** @} */
+/*
+ * Local Variables:
+ * mode: C
+ * tab-width: 8
+ * indent-tabs-mode: t
+ * c-file-style: "stroustrup"
+ * End:
+ * ex: shiftwidth=4 tabstop=8
+ */
This was sent by the SourceForge.net collaborative development platform, the
world's largest Open Source development site.
------------------------------------------------------------------------------
Minimize network downtime and maximize team effectiveness.
Reduce network management and security costs.Learn how to hire
the most talented Cisco Certified professionals. Visit the
Employer Resources Portal
http://www.cisco.com/web/learning/employer_resources/index.html
_______________________________________________
BRL-CAD Source Commits mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/brlcad-commits