[brlcad-commits] SF.net SVN: brlcad:[41688] brlcad/branches/cmake
Open Source Solid Modeling CAD
Brought to you by:
brlcad
From: <sta...@us...> - 2010-12-17 13:23:07
|
Revision: 41688 http://brlcad.svn.sourceforge.net/brlcad/?rev=41688&view=rev Author: starseeker Date: 2010-12-17 13:23:00 +0000 (Fri, 17 Dec 2010) Log Message: ----------- Update cmake branch to trunk r41687 Modified Paths: -------------- brlcad/branches/cmake/include/opennurbs_ext.h brlcad/branches/cmake/misc/win32-msvc8/tclsh/library/installTree.tcl brlcad/branches/cmake/src/libbn/bntester.c brlcad/branches/cmake/src/libbn/bntester.dat brlcad/branches/cmake/src/libbu/vls.c brlcad/branches/cmake/src/librt/opennurbs_ext.cpp brlcad/branches/cmake/src/mged/tedit.c brlcad/branches/cmake/src/other/openNURBS/opennurbs_revsurface.cpp brlcad/branches/cmake/src/other/tcl/generic/tclPlatDecls.h Property Changed: ---------------- brlcad/branches/cmake/ brlcad/branches/cmake/src/other/tkhtml/ Property changes on: brlcad/branches/cmake ___________________________________________________________________ Modified: svn:mergeinfo - /brlcad/trunk:37932-39894 + /brlcad/trunk:37932-39894,41673-41687 Modified: brlcad/branches/cmake/include/opennurbs_ext.h =================================================================== --- brlcad/branches/cmake/include/opennurbs_ext.h 2010-12-17 13:09:02 UTC (rev 41687) +++ brlcad/branches/cmake/include/opennurbs_ext.h 2010-12-17 13:23:00 UTC (rev 41688) @@ -77,7 +77,8 @@ #define BREP_MAX_LN_DEPTH 20 #define SIGN(x) ((x) >= 0 ? 1 : -1) /* Surface flatness parameter, Abert says between 0.8-0.9 */ -#define BREP_SURFACE_FLATNESS 0.8 +#define BREP_SURFACE_FLATNESS 0.85 +#define BREP_SURFACE_STRAIGHTNESS 0.75 /* Max newton iterations when finding closest point */ #define BREP_MAX_FCP_ITERATIONS 50 /* Root finding epsilon */ @@ -1425,6 +1426,7 @@ private: bool isFlat(const ON_Surface* surf, ON_Plane frames[], ON_3dVector normals[], ON_3dPoint corners[], const ON_Interval& u, const ON_Interval& v); + bool isStraight(const ON_Surface* surf, ON_Plane frames[], ON_3dVector normals[], ON_3dPoint corners[], const ON_Interval& u, const ON_Interval& v); fastf_t isFlatU(const ON_Surface* surf, ON_Plane frames[], ON_3dVector normals[], ON_3dPoint corners[], const ON_Interval& u, const ON_Interval& v); fastf_t isFlatV(const ON_Surface* surf, ON_Plane frames[], ON_3dVector normals[], ON_3dPoint corners[], const ON_Interval& u, const ON_Interval& v); BBNode* subdivideSurfaceByKnots(const ON_Surface *localsurf, const ON_Interval& u, const ON_Interval& v, ON_Plane frames[], ON_3dPoint corners[], ON_3dVector normals[], int depth, int depthLimit); Modified: brlcad/branches/cmake/misc/win32-msvc8/tclsh/library/installTree.tcl =================================================================== --- brlcad/branches/cmake/misc/win32-msvc8/tclsh/library/installTree.tcl 2010-12-17 13:09:02 UTC (rev 41687) +++ brlcad/branches/cmake/misc/win32-msvc8/tclsh/library/installTree.tcl 2010-12-17 13:23:00 UTC (rev 41688) @@ -305,11 +305,21 @@ puts "\[12 of 15] COPYING REDIST FILES" catch { if {[info exists "C:/Program Files/Microsoft Visual Studio 8/VC/redist/x86/Microsoft.VC80.CRT"]} { - copy_stuff "C:/Program Files/Microsoft Visual Studio 8/VC/redist/x86/Microsoft.VC80.CRT" [file join $installDir bin] - copy_stuff "C:/Program Files/Microsoft Visual Studio 8/VC/redist/x86/Microsoft.VC80.MFC" [file join $installDir bin] + if {$platform == "x64"} { + copy_stuff "C:/Program Files/Microsoft Visual Studio 8/VC/redist/amd64/Microsoft.VC80.CRT" [file join $installDir bin] + copy_stuff "C:/Program Files/Microsoft Visual Studio 8/VC/redist/amd64/Microsoft.VC80.MFC" [file join $installDir bin] + } else { + copy_stuff "C:/Program Files/Microsoft Visual Studio 8/VC/redist/x86/Microsoft.VC80.CRT" [file join $installDir bin] + copy_stuff "C:/Program Files/Microsoft Visual Studio 8/VC/redist/x86/Microsoft.VC80.MFC" [file join $installDir bin] + } } else { - copy_stuff "C:/Program Files (x86)/Microsoft Visual Studio 8/VC/redist/x86/Microsoft.VC80.CRT" [file join $installDir bin] - copy_stuff "C:/Program Files (x86)/Microsoft Visual Studio 8/VC/redist/x86/Microsoft.VC80.MFC" [file join $installDir bin] + if {$platform == "x64"} { + copy_stuff "C:/Program Files (x86)/Microsoft Visual Studio 8/VC/redist/amd64/Microsoft.VC80.CRT" [file join $installDir bin] + copy_stuff "C:/Program Files (x86)/Microsoft Visual Studio 8/VC/redist/amd64/Microsoft.VC80.MFC" [file join $installDir bin] + } else { + copy_stuff "C:/Program Files (x86)/Microsoft Visual Studio 8/VC/redist/x86/Microsoft.VC80.CRT" [file join $installDir bin] + copy_stuff "C:/Program Files (x86)/Microsoft Visual Studio 8/VC/redist/x86/Microsoft.VC80.MFC" [file join $installDir bin] + } } } Modified: brlcad/branches/cmake/src/libbn/bntester.c =================================================================== --- brlcad/branches/cmake/src/libbn/bntester.c 2010-12-17 13:09:02 UTC (rev 41687) +++ brlcad/branches/cmake/src/libbn/bntester.c 2010-12-17 13:23:00 UTC (rev 41688) @@ -29,15 +29,277 @@ #include "bn.h" +static char *usage="Usage: bntester [-c test_case_number] [-f function_number] -i input_file -o output_file\n"; + int -main(int argc, char **argv) +parse_case(char *buf_p, int *i, long *l, double *d, unsigned long *u, char *fmt_str, int line_num, int case_idx) { - bu_log("%s: %d args\n", argv[0], argc); + int i_idx; + int l_idx; + int d_idx; + int u_idx; + int idx; + int fmt_str_len; + char *endp; + fmt_str_len = strlen(fmt_str); + + for (idx = 0 ; idx < fmt_str_len ; idx++) { + buf_p = strtok(NULL, ","); + + if ((buf_p == NULL) && (idx != fmt_str_len-1)) { + bu_log("missing parameter(s) for test case %d on line %d\n", case_idx, line_num); + return EXIT_FAILURE; + } + + switch (fmt_str[idx]) { + case 'd' : /* double */ + d[d_idx] = strtod(buf_p, &endp); + if (!((buf_p != endp) && (*endp == '\0'))) { + /* 2 is added to idx since the user numbers the parameters + * starting with 1 but internally they start at 0, also idx + * starts a the 2nd parameter in the data file since the first + * parameter is always the function number, so we need to add + * again to the idx to correspond to the parameter in the data + * file + */ + bu_log("Convert to double failed, line %d test case %d parameter %d string '%s'\n", + line_num, case_idx, idx+2, buf_p); + return EXIT_FAILURE; + } + d_idx++; + break; + case 'l' : /* long int */ + l[l_idx] = strtol(buf_p, &endp, 10); + if (!((buf_p != endp) && (*endp == '\0'))) { + bu_log("Convert to long int failed, line %d test case %d parameter %d string '%s'\n", + line_num, case_idx, idx+2, buf_p); + return EXIT_FAILURE; + } + l_idx++; + break; + default: + bu_log("unknown data type '%c'\n", fmt_str[idx]); + return EXIT_FAILURE; + break; + } /* end of data format switch */ + } /* end of for loop traversing data format string */ + return 0; } +int +main(int argc, char **argv) +{ + char buf[BUFSIZ]; + char input_file_name[BUFSIZ]; + char output_file_name[BUFSIZ]; + int input_file_name_defined = 0; + int output_file_name_defined = 0; + FILE *fp_in; + FILE *fp_out; + char *endp; + long int case_num; + int process_single_case = 0; + int function_num_defined = 0; + long int function_num; + int string_length; + char c; + int early_exit = 0; + int found_eof = 0; + int i[50]; + long l[50]; + double d[50]; + unsigned long u[50]; + char io_fmt[50]; /* input-output format string */ + char dt_fmt[50]; /* data type format string */ + int ret = 0; + char *buf_p1; + char *buf_p; + int case_idx = 0; + int line_num = 0; + struct bn_tol tol; + + tol.magic = BN_TOL_MAGIC; + tol.dist = 0.0005; + tol.dist_sq = tol.dist * tol.dist; + tol.perp = 1e-6; + tol.para = 1.0 - tol.perp; + + + if (argc < 3) { + bu_log("Too few parameters, %d specified, at least 2 required\n", argc - 1); + bu_exit(EXIT_FAILURE, usage); + } + + while ((c = bu_getopt(argc, argv, "c:f:i:o:")) != EOF) { + switch (c) { + case 'c': /* test case number */ + case_num = strtol(bu_optarg, &endp, 10); + if ((bu_optarg != endp) && (*endp == '\0')) { + /* convert to long integer success */ + process_single_case = 1; + } else { + /* convert to long integer failed */ + bu_exit(EXIT_FAILURE, usage); + } + break; + case 'f': /* function number */ + function_num = strtol(bu_optarg, &endp, 10); + if ((bu_optarg != endp) && (*endp == '\0')) { + /* convert to long integer success */ + function_num_defined = 1; + } else { + /* convert to long integer failed */ + bu_exit(EXIT_FAILURE, usage); + } + break; + case 'i': /* input file name */ + if (string_length = strlen(bu_optarg) >= BUFSIZ) { + bu_log("Input file name too long, length was %d but must be less than %d\n", + string_length, BUFSIZ); + bu_exit(EXIT_FAILURE, usage); + } + strcpy(input_file_name,bu_optarg); + input_file_name_defined = 1; + break; + case 'o': /* output file name */ + if (string_length = strlen(bu_optarg) >= BUFSIZ) { + bu_log("Output file name too long, length was %d but must be less than %d\n", + string_length, BUFSIZ); + bu_exit(EXIT_FAILURE, usage); + } + strcpy(output_file_name,bu_optarg); + output_file_name_defined = 1; + break; + default: + bu_log("Invalid option '%c'.\n", c); + bu_exit(EXIT_FAILURE, usage); + break; + } + } + + if (process_single_case && function_num_defined) { + bu_log("Can not specify both test case number and function number.\n"); + early_exit = 1; + } + + if (!input_file_name_defined) { + bu_log("Input file name is required but was not specified.\n"); + early_exit = 1; + } + if (!output_file_name_defined) { + bu_log("Output file name is required but was not specified.\n"); + early_exit = 1; + } + + if (early_exit) { + bu_exit(EXIT_FAILURE, usage); + } + + bu_log("Using input path and file name: '%s'\n", input_file_name); + bu_log("Using output path and file name: '%s'\n", output_file_name); + + if (process_single_case) { + bu_log("Processing only test case: '%d'\n", case_num); + } + + if (function_num_defined) { + bu_log("Processing all test cases for function number: '%ld'\n", function_num); + } + + if (!process_single_case && !function_num_defined) { + bu_log("Processing all test cases.\n"); + } + + if ((fp_in = fopen(input_file_name, "r")) == NULL) { + bu_log("Cannot open input file (%s)\n", input_file_name); + return EXIT_FAILURE; + } + + if ((fp_out = fopen(output_file_name, "w")) == NULL) { + bu_log("Cannot create output file (%s)\n", output_file_name); + if (fclose(fp_in) != 0) { + bu_log("Unable to close input file.\n"); + } + return EXIT_FAILURE; + } + + while (!found_eof) { + line_num++; + (void)fgets(buf, BUFSIZ, fp_in); + if (feof(fp_in)) { + if (ferror(fp_in)) { + perror("ERROR: Problem reading file, system error message"); + fclose(fp_in); + return EXIT_FAILURE; + } else { + found_eof = 1; + } + } else { + if ((buf[0] != '#') && (buf[0] != '\n')) { + case_idx++; + buf_p1 = strtok(buf, "\n"); + buf_p = strtok(buf_p1, ","); + + /* the 1st parameter is alway a long int which represents the function number */ + l[0] = strtol(buf_p, &endp, 10); + if (!((bu_optarg != endp) && (*endp == '\0'))) { + /* convert to long integer failed */ + bu_log("read function number failed, line number '%d' case number '%d' string '%s'\n", + line_num, case_idx, buf_p); + if (fclose(fp_in) != 0) { + bu_log("Unable to close input file.\n"); + } + return EXIT_FAILURE; + } + + switch (l[0]) { + case 1: /* function number 'bn_distsq_line3_pt3' */ + + /* data type string indicating data type of + * function parameters + */ + strcpy(dt_fmt, "dddddddddd"); + + if (parse_case(buf_p, i, l, d, u, dt_fmt, line_num, case_idx)) { + bu_log("skipped line %d test case %d\n", line_num, case_idx); + ret = 1; + } else { + double result; + + result = bn_distsq_line3_pt3(&d[0], &d[3], &d[6]); + if (!NEAR_ZERO(result - d[9], SMALL_FASTF)) { + ret = 1; + bu_log("failed test case %d on line %d expected = %.15lf result = %.15lf\n", + case_idx, line_num, d[9], result); + } else { + bu_log("success test case %d on line %d expected = %.15lf result = %.15lf\n", + case_idx, line_num, d[9], result); + } + } + + break; + default: + bu_log("unknown function number '%ld'\n", l[0]); + return EXIT_FAILURE; + break; + } /* end of function number switch */ + } /* end of if statement skipping lines start with '#' */ + } + } /* end of while loop reading lines from data file */ + + if (fclose(fp_in) != 0) { + bu_log("Unable to close input file.\n"); + } + if (fclose(fp_out) != 0) { + bu_log("Unable to close output file.\n"); + } + + exit(ret); +} + /** @} */ /* * Local Variables: Modified: brlcad/branches/cmake/src/libbn/bntester.dat =================================================================== --- brlcad/branches/cmake/src/libbn/bntester.dat 2010-12-17 13:09:02 UTC (rev 41687) +++ brlcad/branches/cmake/src/libbn/bntester.dat 2010-12-17 13:23:00 UTC (rev 41688) @@ -1 +1,30 @@ -# test data for bntester +1, 11.288220793951543541311366425361484289169311523, 23.000000000000000000000000000000000000000000000, 3.926354830241924442901790825999341905117034912, -2.239735021510274037837007199414074420928955078, -0.000000000000003552713678800500929355621337891, -5.407198665052103336847721948288381099700927734, 13.527955815461817579148373624775558710098266602, 31.000000000000003552713678800500929355621337891, 9.333553495294024671125043823849409818649291992, 64.000000000000000000000000000000000000000000000 +1, 11.288220793951543541311366425361484289169311523, 23.000000000000000000000000000000000000000000000, 3.926354830241924442901790825999341905117034912, -2.239735021510274037837007199414074420928955078, -0.000000000000003552713678800500929355621337891, -5.407198665052103336847721948288381099700927734, 14.230576635161234833049093140289187431335449219, 23.000000000000000000000000000000000000000000000, 3.341083864193539643139274630811996757984161377, 8.657457896300790878285624785348773002624511719 +1, 11.288220793951543541311366425361484289169311523, 23.000000000000000000000000000000000000000000000, 3.926354830241924442901790825999341905117034912, -2.239735021510274037837007199414074420928955078, -0.000000000000003552713678800500929355621337891, -5.407198665052103336847721948288381099700927734, 14.230576635161234833049093140289187431335449219, 28.000000000000000000000000000000000000000000000, 3.341083864193537866782435230561532080173492432, 33.657457896300790878285624785348773002624511719 +1, 11.288220793951543541311366425361484289169311523, 23.000000000000000000000000000000000000000000000, 3.926354830241924442901790825999341905117034912, -2.239735021510274037837007199414074420928955078, -0.000000000000003552713678800500929355621337891, -5.407198665052103336847721948288381099700927734, 14.230576635161236609405932540539652109146118164, 23.000000000000000000000000000000000000000000000, -1.341083864193544084031373131438158452510833740, 22.412118072196079765490139834582805633544921875 +1, 11.288220793951543541311366425361484289169311523, 23.000000000000000000000000000000000000000000000, 3.926354830241924442901790825999341905117034912, -2.239735021510274037837007199414074420928955078, -0.000000000000003552713678800500929355621337891, -5.407198665052103336847721948288381099700927734, 16.022364652369454063318698899820446968078613281, 23.000000000000003552713678800500929355621337891, 7.666842796235222579070978099480271339416503906, 8.657457896300780220144588383845984935760498047 +1, 11.288220793951543541311366425361484289169311523, 23.000000000000000000000000000000000000000000000, 3.926354830241924442901790825999341905117034912, -2.239735021510274037837007199414074420928955078, -0.000000000000003552713678800500929355621337891, -5.407198665052103336847721948288381099700927734, 16.022364652369454063318698899820446968078613281, 28.000000000000003552713678800500929355621337891, 7.666842796235220802714138699229806661605834961, 33.657457896300797983712982386350631713867187500 +1, 11.288220793951543541311366425361484289169311523, 23.000000000000000000000000000000000000000000000, 3.926354830241924442901790825999341905117034912, -2.239735021510274037837007199414074420928955078, -0.000000000000003552713678800500929355621337891, -5.407198665052103336847721948288381099700927734, 17.666446504705966447090759174898266792297363281, 23.000000000000003552713678800500929355621337891, 13.472044184538178868137947574723511934280395508, 5.016412966579693488711200188845396041870117188 +1, 11.288220793951543541311366425361484289169311523, 23.000000000000000000000000000000000000000000000, 3.926354830241924442901790825999341905117034912, -2.239735021510274037837007199414074420928955078, -0.000000000000003552713678800500929355621337891, -5.407198665052103336847721948288381099700927734, 17.666446504705966447090759174898266792297363281, 31.000000000000003552713678800500929355621337891, 13.472044184538175315424268774222582578659057617, 69.016412966579608223582908976823091506958007812 +1, 11.288220793951543541311366425361484289169311523, 23.000000000000000000000000000000000000000000000, 3.926354830241924442901790825999341905117034912, -2.239735021510274037837007199414074420928955078, -0.000000000000003552713678800500929355621337891, -5.407198665052103336847721948288381099700927734, 19.333157203764773868215343100018799304962158203, 28.000000000000003552713678800500929355621337891, 10.977635347630540607610782899428158998489379883, 47.412118072196065554635424632579088211059570312 +1, 11.288220793951543541311366425361484289169311523, 23.000000000000000000000000000000000000000000000, 3.926354830241924442901790825999341905117034912, -2.239735021510274037837007199414074420928955078, -0.000000000000003552713678800500929355621337891, -5.407198665052103336847721948288381099700927734, 32.666842796235229684498335700482130050659179688, 27.999999999999996447286321199499070644378662109, -8.977635347630545936681301100179553031921386719, 634.567191003416496641875710338354110717773437500 +1, 11.288220793951543541311366425361484289169311523, 23.000000000000000000000000000000000000000000000, 3.926354830241924442901790825999341905117034912, -2.239735021510274037837007199414074420928955078, -0.000000000000003552713678800500929355621337891, -5.407198665052103336847721948288381099700927734, 35.977635347630545936681301100179553031921386719, 22.999999999999996447286321199499070644378662109, -5.666842796235223467249397799605503678321838379, 701.254089600364068246562965214252471923828125000 +1, 11.288220793951543541311366425361484289169311523, 23.000000000000000000000000000000000000000000000, 3.926354830241924442901790825999341905117034912, -2.239735021510274037837007199414074420928955078, -0.000000000000003552713678800500929355621337891, -5.407198665052103336847721948288381099700927734, 35.977635347630545936681301100179553031921386719, 27.999999999999996447286321199499070644378662109, -5.666842796235225243606237199855968356132507324, 726.254089600364068246562965214252471923828125000 +1, 11.288220793951543541311366425361484289169311523, 23.000000000000000000000000000000000000000000000, 3.926354830241924442901790825999341905117034912, -2.239735021510274037837007199414074420928955078, -0.000000000000003552713678800500929355621337891, -5.407198665052103336847721948288381099700927734, 37.769423364838765166950906859710812568664550781, 23.000000000000000000000000000000000000000000000, -1.341083864193538310871645080624148249626159668, 701.254089600363954559725243598222732543945312500 +1, 11.288220793951543541311366425361484289169311523, 23.000000000000000000000000000000000000000000000, 3.926354830241924442901790825999341905117034912, -2.239735021510274037837007199414074420928955078, -0.000000000000003552713678800500929355621337891, -5.407198665052103336847721948288381099700927734, 37.769423364838765166950906859710812568664550781, 23.000000000000000000000000000000000000000000000, 3.341083864193540087228484480874612927436828613, 609.567191003416496641875710338354110717773437500 +1, 11.288220793951543541311366425361484289169311523, 23.000000000000000000000000000000000000000000000, 3.926354830241924442901790825999341905117034912, -2.239735021510274037837007199414074420928955078, -0.000000000000003552713678800500929355621337891, -5.407198665052103336847721948288381099700927734, 37.769423364838765166950906859710812568664550781, 28.000000000000000000000000000000000000000000000, -1.341083864193540087228484480874612927436828613, 726.254089600363954559725243598222732543945312500 +1, 11.288220793951543541311366425361484289169311523, 31.000000000000000000000000000000000000000000000, 3.926354830241921334277321875561028718948364258, 0.000000000000000000000000000000000000000000000, 8.000000000000000000000000000000000000000000000, -0.000000000000003108624468950438313186168670654, 13.527955815461817579148373624775558710098266602, 31.000000000000003552713678800500929355621337891, 9.333553495294024671125043823849409818649291992, 34.254210369920876644300733460113406181335449219 +1, 11.288220793951543541311366425361484289169311523, 31.000000000000000000000000000000000000000000000, 3.926354830241921334277321875561028718948364258, 0.000000000000000000000000000000000000000000000, 8.000000000000000000000000000000000000000000000, -0.000000000000003108624468950438313186168670654, 14.230576635161234833049093140289187431335449219, 28.000000000000000000000000000000000000000000000, 3.341083864193537866782435230561532080173492432, 9.000000000000001776356839400250464677810668945 +1, 11.288220793951543541311366425361484289169311523, 31.000000000000000000000000000000000000000000000, 3.926354830241921334277321875561028718948364258, 0.000000000000000000000000000000000000000000000, 8.000000000000000000000000000000000000000000000, -0.000000000000003108624468950438313186168670654, 14.230576635161236609405932540539652109146118164, 28.000000000000000000000000000000000000000000000, -1.341083864193545860388212531688623130321502686, 36.403368295936836318560381187126040458679199219 +1, 11.288220793951543541311366425361484289169311523, 31.000000000000000000000000000000000000000000000, 3.926354830241921334277321875561028718948364258, 0.000000000000000000000000000000000000000000000, 8.000000000000000000000000000000000000000000000, -0.000000000000003108624468950438313186168670654, 16.022364652369454063318698899820446968078613281, 28.000000000000003552713678800500929355621337891, 7.666842796235220802714138699229806661605834961, 36.403368295936708420867944369092583656311035156 +1, 11.288220793951543541311366425361484289169311523, 31.000000000000000000000000000000000000000000000, 3.926354830241921334277321875561028718948364258, 0.000000000000000000000000000000000000000000000, 8.000000000000000000000000000000000000000000000, -0.000000000000003108624468950438313186168670654, 16.022364652369457616032377700321376323699951172, 27.999999999999996447286321199499070644378662109, -5.666842796235227908141496300231665372848510742, 114.441558772842896019028557930141687393188476562 +1, 11.288220793951543541311366425361484289169311523, 31.000000000000000000000000000000000000000000000, 3.926354830241921334277321875561028718948364258, 0.000000000000000000000000000000000000000000000, 8.000000000000000000000000000000000000000000000, -0.000000000000003108624468950438313186168670654, 17.666446504705966447090759174898266792297363281, 31.000000000000003552713678800500929355621337891, 13.472044184538175315424268774222582578659057617, 131.801948466053602260217303410172462463378906250 +1, 11.288220793951543541311366425361484289169311523, 31.000000000000000000000000000000000000000000000, 3.926354830241921334277321875561028718948364258, 0.000000000000000000000000000000000000000000000, 8.000000000000000000000000000000000000000000000, -0.000000000000003108624468950438313186168670654, 19.333157203764773868215343100018799304962158203, 28.000000000000003552713678800500929355621337891, 10.977635347630540607610782899428158998489379883, 114.441558772842881808173842728137969970703125000 +1, 11.288220793951543541311366425361484289169311523, 31.000000000000000000000000000000000000000000000, 3.926354830241921334277321875561028718948364258, 0.000000000000000000000000000000000000000000000, 8.000000000000000000000000000000000000000000000, -0.000000000000003108624468950438313186168670654, 19.333157203764777420929021900519728660583496094, 27.999999999999996447286321199499070644378662109, -8.977635347630547713038140500430017709732055664, 231.233964348567837987502571195363998413085937500 +1, 11.288220793951543541311366425361484289169311523, 31.000000000000000000000000000000000000000000000, 3.926354830241921334277321875561028718948364258, 0.000000000000000000000000000000000000000000000, 8.000000000000000000000000000000000000000000000, -0.000000000000003108624468950438313186168670654, 23.073645169758069783938481123186647891998291016, 31.000000000000007105427357601001858711242675781, 15.711779206048451129618115373887121677398681641, 277.792455435709371158736757934093475341796875000 +1, 11.288220793951543541311366425361484289169311523, 31.000000000000000000000000000000000000000000000, 3.926354830241921334277321875561028718948364258, 0.000000000000000000000000000000000000000000000, 8.000000000000000000000000000000000000000000000, -0.000000000000003108624468950438313186168670654, 23.658916135806457248236256418749690055847167969, 28.000000000000003552713678800500929355621337891, 12.769423364838761614237228059209883213043212891, 231.233964348567553770408267155289649963378906250 +1, 11.288220793951543541311366425361484289169311523, 31.000000000000000000000000000000000000000000000, 3.926354830241921334277321875561028718948364258, 0.000000000000000000000000000000000000000000000, 8.000000000000000000000000000000000000000000000, -0.000000000000003108624468950438313186168670654, 23.658916135806460800949935219250619411468505859, 27.999999999999996447286321199499070644378662109, -10.769423364838766943307746259961277246475219727, 369.000000000000000000000000000000000000000000000 +1, 11.288220793951543541311366425361484289169311523, 31.000000000000000000000000000000000000000000000, 3.926354830241921334277321875561028718948364258, 0.000000000000000000000000000000000000000000000, 8.000000000000000000000000000000000000000000000, -0.000000000000003108624468950438313186168670654, 28.341083864193539199050064780749380588531494141, 23.000000000000003552713678800500929355621337891, 12.769423364838765166950906859710812568664550781, 369.000000000000000000000000000000000000000000000 +1, 11.288220793951543541311366425361484289169311523, 31.000000000000000000000000000000000000000000000, 3.926354830241921334277321875561028718948364258, 0.000000000000000000000000000000000000000000000, 8.000000000000000000000000000000000000000000000, -0.000000000000003108624468950438313186168670654, 28.341083864193542751763743581250309944152832031, 27.999999999999996447286321199499070644378662109, -10.769423364838766943307746259961277246475219727, 506.766035651432275699335150420665740966796875000 +1, 11.288220793951543541311366425361484289169311523, 31.000000000000000000000000000000000000000000000, 3.926354830241921334277321875561028718948364258, 0.000000000000000000000000000000000000000000000, 8.000000000000000000000000000000000000000000000, -0.000000000000003108624468950438313186168670654, 28.926354830241923110634161275811493396759033203, 23.000000000000007105427357601001858711242675781, 15.711779206048456458688633574638515710830688477, 450.000000000000056843418860808014869689941406250 +1, 11.288220793951543541311366425361484289169311523, 31.000000000000000000000000000000000000000000000, 3.926354830241921334277321875561028718948364258, 0.000000000000000000000000000000000000000000000, 8.000000000000000000000000000000000000000000000, -0.000000000000003108624468950438313186168670654, 32.666842796235229684498335700482130050659179688, 27.999999999999996447286321199499070644378662109, -8.977635347630545936681301100179553031921386719, 623.558441227157118191826157271862030029296875000 Modified: brlcad/branches/cmake/src/libbu/vls.c =================================================================== --- brlcad/branches/cmake/src/libbu/vls.c 2010-12-17 13:09:02 UTC (rev 41687) +++ brlcad/branches/cmake/src/libbu/vls.c 2010-12-17 13:23:00 UTC (rev 41688) @@ -501,6 +501,7 @@ { int argc = 0; /* number of words seen */ int skip = 0; + int quoted = 0; if (UNLIKELY(!argv)) { /* do this instead of crashing */ @@ -528,8 +529,33 @@ for (; *lp != '\0'; lp++) { + if (*lp == '"') { + if (!quoted) { + /* start collecting quoted string */ + quoted = 1; + + /* skip past the quote character */ + argv[argc] = lp + 1; + continue; + } + + /* end qoute */ + quoted = 0; + *lp++ = '\0'; + + /* skip leading whitespace */ + while (*lp != '\0' && isspace(*lp)) { + /* null out spaces */ + *lp = '\0'; + lp++; + } + + skip = 0; + goto nextword; + } + /* skip over current word */ - if (!isspace(*lp)) + if (quoted || !isspace(*lp)) continue; skip = 0; @@ -545,6 +571,7 @@ if (*(lp + skip) == '\0') break; + nextword: /* make sure argv[] isn't full, need room for NULL */ if (argc >= lim-1) break; Modified: brlcad/branches/cmake/src/librt/opennurbs_ext.cpp =================================================================== --- brlcad/branches/cmake/src/librt/opennurbs_ext.cpp 2010-12-17 13:09:02 UTC (rev 41687) +++ brlcad/branches/cmake/src/librt/opennurbs_ext.cpp 2010-12-17 13:23:00 UTC (rev 41688) @@ -747,16 +747,16 @@ ON_BoundingBox bbox = localsurf->BoundingBox(); VSETALL(buffer, BREP_EDGE_MISS_TOLERANCE); - VSETALL(min, MAX_FASTF); - VSETALL(max, -MAX_FASTF); - for (int i = 0; i < 9; i++) { - VMINMAX(min, max, ((double*)m_corners[i])); + //VSETALL(min, MAX_FASTF); + //VSETALL(max, -MAX_FASTF); + //for (int i = 0; i < 9; i++) { + //VMINMAX(min, max, ((double*)m_corners[i])); //bu_log("in c%d_%d sph %f %f %f %f\n", bb_cnt, i, m_corners[i].x, m_corners[i].y, m_corners[i].z, 1.0); - } + //} //bu_log("in bb%d rpp %f %f %f %f %f %f\n", bb_cnt, min[0], max[0], min[1], max[1], min[2], max[2]); - //VMOVE(min,bbox.Min()); - //VMOVE(max,bbox.Max()); + VMOVE(min,bbox.Min()); + VMOVE(max,bbox.Max()); //bu_log("in b%d rpp %f %f %f %f %f %f\n", bb_cnt++, bbox.m_min.x, bbox.m_max.x, bbox.m_min.y, bbox.m_max.y, bbox.m_min.z, bbox.m_max.z); //bu_log("in bc%d rpp %f %f %f %f %f %f\n", bb_cnt++, min[0], max[0], min[1], max[1], min[2], max[2]); @@ -777,11 +777,11 @@ VSUB2(min, min, buffer); VADD2(max, max, buffer); - VSUB2(delta, max, min); +/* VSUB2(delta, max, min); VSCALE(delta, delta, BBOX_GROW_3D); VSUB2(min, min, delta); VADD2(max, max, delta); - +*/ TRACE("creating leaf: u(" << u.Min() << ", " << u.Max() << ") v(" << v.Min() << ", " << v.Max() << ")"); node = new BBNode(ctree, ON_BoundingBox(ON_3dPoint(min), @@ -1417,6 +1417,7 @@ } else { //return surfaceBBox(localsurf, true, corners, normals, u, v); //parent->addChild(subdivideSurface(localsurf, u, v, frames, corners, normals,0)); + ((ON_Surface *)localsurf)->ClearBoundingBox(); return subdivideSurface(localsurf, u, v, frames, corners, normals,0, depthLimit); } delete [] spanu; @@ -1468,8 +1469,9 @@ double width,height; double ratio = 5.0; localsurf->GetSurfaceSize(&width, &height); - if (((width/height < ratio) && (width/height > 1.0/ratio)) - && (isFlat(localsurf, frames, normals, corners, u, v)) || (divDepth >= depthLimit)) { //BREP_MAX_FT_DEPTH))) { + if ((((width/height < ratio) && (width/height > 1.0/ratio)) + && isFlat(localsurf, frames, normals, corners, u, v) + && isStraight(localsurf, frames, normals, corners, u, v)) || (divDepth >= depthLimit)) { //BREP_MAX_FT_DEPTH))) { return surfaceBBox(localsurf, true, corners, normals, u, v); } else { fastf_t uflat = isFlatU(localsurf, frames, normals, corners, u, v); @@ -2078,6 +2080,7 @@ bool SurfaceTree::isFlat(const ON_Surface* UNUSED(surf), ON_Plane *frames, ON_3dVector *m_normals, ON_3dPoint *corners, const ON_Interval& UNUSED(u), const ON_Interval& UNUSED(v)) { + /* ON_3dVector normals[8]; for (int i = 0; i < 4; i++) { normals[i] = m_normals[i]; @@ -2125,43 +2128,8 @@ dvec<4> dots = xa * xb + ya * yb + za * zb; product *= dots.foldr(1, dvec<4>::mul(), 3); } - /////////////////////////////////////////////////////////////////////// - double Xdot = frames[0].xaxis * frames[1].xaxis; - Xdot = Xdot * (frames[0].xaxis * frames[2].xaxis); - Xdot = Xdot * (frames[0].xaxis * frames[3].xaxis); - Xdot = Xdot * (frames[0].xaxis * frames[4].xaxis); - Xdot = Xdot * (frames[0].xaxis * frames[5].xaxis); - Xdot = Xdot * (frames[0].xaxis * frames[6].xaxis); - Xdot = Xdot * (frames[0].xaxis * frames[7].xaxis); - Xdot = Xdot * (frames[0].xaxis * frames[8].xaxis); - Xdot = Xdot * (frames[1].xaxis * frames[2].xaxis); - Xdot = Xdot * (frames[1].xaxis * frames[3].xaxis); - Xdot = Xdot * (frames[1].xaxis * frames[4].xaxis); - Xdot = Xdot * (frames[1].xaxis * frames[5].xaxis); - Xdot = Xdot * (frames[1].xaxis * frames[6].xaxis); - Xdot = Xdot * (frames[1].xaxis * frames[7].xaxis); - Xdot = Xdot * (frames[1].xaxis * frames[8].xaxis); - Xdot = Xdot * (frames[2].xaxis * frames[3].xaxis); - Xdot = Xdot * (frames[2].xaxis * frames[4].xaxis); - Xdot = Xdot * (frames[2].xaxis * frames[5].xaxis); - Xdot = Xdot * (frames[2].xaxis * frames[6].xaxis); - Xdot = Xdot * (frames[2].xaxis * frames[7].xaxis); - Xdot = Xdot * (frames[2].xaxis * frames[8].xaxis); - Xdot = Xdot * (frames[3].xaxis * frames[4].xaxis); - Xdot = Xdot * (frames[3].xaxis * frames[5].xaxis); - Xdot = Xdot * (frames[3].xaxis * frames[6].xaxis); - Xdot = Xdot * (frames[3].xaxis * frames[7].xaxis); - Xdot = Xdot * (frames[3].xaxis * frames[8].xaxis); - Xdot = Xdot * (frames[4].xaxis * frames[5].xaxis); - Xdot = Xdot * (frames[4].xaxis * frames[6].xaxis); - Xdot = Xdot * (frames[4].xaxis * frames[7].xaxis); - Xdot = Xdot * (frames[4].xaxis * frames[8].xaxis); - Xdot = Xdot * (frames[5].xaxis * frames[6].xaxis); - Xdot = Xdot * (frames[5].xaxis * frames[7].xaxis); - Xdot = Xdot * (frames[5].xaxis * frames[8].xaxis); - Xdot = Xdot * (frames[6].xaxis * frames[7].xaxis); - Xdot = Xdot * (frames[6].xaxis * frames[8].xaxis); - Xdot = Xdot * (frames[7].xaxis * frames[8].xaxis); + return product >= BREP_SURFACE_FLATNESS; + */ double Ndot = frames[0].zaxis * frames[1].zaxis; Ndot = Ndot * (frames[0].zaxis * frames[2].zaxis); @@ -2200,25 +2168,51 @@ Ndot = Ndot * (frames[6].zaxis * frames[8].zaxis); Ndot = Ndot * (frames[7].zaxis * frames[8].zaxis); - ON_3dVector udir0,udir1,vdir0,vdir1; - udir0 = frames[0].origin - frames[3].origin; - udir0.Unitize(); - udir1 = frames[1].origin - frames[2].origin; - udir1.Unitize(); - vdir0 = frames[1].origin - frames[0].origin; - vdir0.Unitize(); - vdir1 = frames[2].origin - frames[3].origin; - vdir1.Unitize(); + return (fabs(Ndot) >= BREP_SURFACE_FLATNESS); // && fabs(uvdot) >= BREP_SURFACE_FLATNESS; - double uvdot = 1.0 - fabs(udir0 * vdir0); - uvdot = uvdot*(1.0 - fabs(udir0 * vdir1)); - uvdot = uvdot*(1.0 - fabs(udir1 * vdir0)); - uvdot = uvdot*(1.0 - fabs(udir1 * vdir1)); +} - product = fabs(Xdot*Ndot); +bool +SurfaceTree::isStraight(const ON_Surface* UNUSED(surf), ON_Plane *frames, ON_3dVector *m_normals, ON_3dPoint *corners, const ON_Interval& UNUSED(u), const ON_Interval& UNUSED(v)) +{ + double Xdot = frames[0].xaxis * frames[1].xaxis; + Xdot = Xdot * (frames[0].xaxis * frames[2].xaxis); + Xdot = Xdot * (frames[0].xaxis * frames[3].xaxis); + Xdot = Xdot * (frames[0].xaxis * frames[4].xaxis); + Xdot = Xdot * (frames[0].xaxis * frames[5].xaxis); + Xdot = Xdot * (frames[0].xaxis * frames[6].xaxis); + Xdot = Xdot * (frames[0].xaxis * frames[7].xaxis); + Xdot = Xdot * (frames[0].xaxis * frames[8].xaxis); + Xdot = Xdot * (frames[1].xaxis * frames[2].xaxis); + Xdot = Xdot * (frames[1].xaxis * frames[3].xaxis); + Xdot = Xdot * (frames[1].xaxis * frames[4].xaxis); + Xdot = Xdot * (frames[1].xaxis * frames[5].xaxis); + Xdot = Xdot * (frames[1].xaxis * frames[6].xaxis); + Xdot = Xdot * (frames[1].xaxis * frames[7].xaxis); + Xdot = Xdot * (frames[1].xaxis * frames[8].xaxis); + Xdot = Xdot * (frames[2].xaxis * frames[3].xaxis); + Xdot = Xdot * (frames[2].xaxis * frames[4].xaxis); + Xdot = Xdot * (frames[2].xaxis * frames[5].xaxis); + Xdot = Xdot * (frames[2].xaxis * frames[6].xaxis); + Xdot = Xdot * (frames[2].xaxis * frames[7].xaxis); + Xdot = Xdot * (frames[2].xaxis * frames[8].xaxis); + Xdot = Xdot * (frames[3].xaxis * frames[4].xaxis); + Xdot = Xdot * (frames[3].xaxis * frames[5].xaxis); + Xdot = Xdot * (frames[3].xaxis * frames[6].xaxis); + Xdot = Xdot * (frames[3].xaxis * frames[7].xaxis); + Xdot = Xdot * (frames[3].xaxis * frames[8].xaxis); + Xdot = Xdot * (frames[4].xaxis * frames[5].xaxis); + Xdot = Xdot * (frames[4].xaxis * frames[6].xaxis); + Xdot = Xdot * (frames[4].xaxis * frames[7].xaxis); + Xdot = Xdot * (frames[4].xaxis * frames[8].xaxis); + Xdot = Xdot * (frames[5].xaxis * frames[6].xaxis); + Xdot = Xdot * (frames[5].xaxis * frames[7].xaxis); + Xdot = Xdot * (frames[5].xaxis * frames[8].xaxis); + Xdot = Xdot * (frames[6].xaxis * frames[7].xaxis); + Xdot = Xdot * (frames[6].xaxis * frames[8].xaxis); + Xdot = Xdot * (frames[7].xaxis * frames[8].xaxis); - /////////////////////////////////////////////////////////////////////// - return (fabs(Xdot) >= BREP_SURFACE_FLATNESS) && (fabs(Ndot) >= BREP_SURFACE_FLATNESS); // && fabs(uvdot) >= BREP_SURFACE_FLATNESS; + return (fabs(Xdot) >= BREP_SURFACE_STRAIGHTNESS); } fastf_t Modified: brlcad/branches/cmake/src/mged/tedit.c =================================================================== --- brlcad/branches/cmake/src/mged/tedit.c 2010-12-17 13:09:02 UTC (rev 41687) +++ brlcad/branches/cmake/src/mged/tedit.c 2010-12-17 13:23:00 UTC (rev 41688) @@ -51,7 +51,7 @@ extern int classic_mged; /* editors to test, in order of discovery preference (EDITOR overrides) */ -#define WIN_EDITOR "c:/Program Files/Windows NT/Accessories/wordpad" +#define WIN_EDITOR "\"c:/Program Files/Windows NT/Accessories/wordpad\"" #define MAC_EDITOR "/Applications/TextEdit.app/Contents/MacOS/TextEdit" #define EMACS_EDITOR "emacs" #define JOVE_EDITOR "jove" Modified: brlcad/branches/cmake/src/other/openNURBS/opennurbs_revsurface.cpp =================================================================== --- brlcad/branches/cmake/src/other/openNURBS/opennurbs_revsurface.cpp 2010-12-17 13:09:02 UTC (rev 41687) +++ brlcad/branches/cmake/src/other/openNURBS/opennurbs_revsurface.cpp 2010-12-17 13:23:00 UTC (rev 41688) @@ -1493,7 +1493,13 @@ rc = m_curve->GetBoundingBox( cbox ); if (rc) { - bbox = cbox; +#if 1 + /* + * does not account for start angle of revolve + */ +#else + bbox = cbox; +#endif ON_3dPointArray corners; cbox.GetCorners(corners); ON_3dPoint P; @@ -1522,7 +1528,21 @@ if ( arc.IsValid() ) { abox = arc.BoundingBox(); - bbox.Union(abox); +#if 1 + /* + * modified so that first time through corner loop arc bbox initializes + * overall surface bbox since arc already accounts for start and stop angles + * of revolve + */ + if (i==0) { + bbox = abox; + } else { + bbox.Union(abox); + } + +#else + bbox.Union(abox); +#endif } } } Modified: brlcad/branches/cmake/src/other/tcl/generic/tclPlatDecls.h =================================================================== --- brlcad/branches/cmake/src/other/tcl/generic/tclPlatDecls.h 2010-12-17 13:09:02 UTC (rev 41687) +++ brlcad/branches/cmake/src/other/tcl/generic/tclPlatDecls.h 2010-12-17 13:23:00 UTC (rev 41688) @@ -26,13 +26,19 @@ /* * Pull in the typedef of TCHAR for windows. */ -#if defined(__WIN32__) && !defined(_TCHAR_DEFINED) +#if defined(__CYGWIN__) + typedef char TCHAR; +#elif defined(__WIN32__) && !defined(_TCHAR_DEFINED) # include <tchar.h> # ifndef _TCHAR_DEFINED /* Borland seems to forget to set this. */ - typedef _TCHAR TCHAR; + typedef _TCHAR TCHAR; # define _TCHAR_DEFINED # endif +# if defined(_MSC_VER) && defined(__STDC__) + /* MSVC++ misses this. */ + typedef _TCHAR TCHAR; +# endif #endif /* !BEGIN!: Do not edit below this line. */ Property changes on: brlcad/branches/cmake/src/other/tkhtml ___________________________________________________________________ Modified: svn:mergeinfo - /brlcad/trunk/src/other/tkhtml:37932-39894,40417 + /brlcad/trunk/src/other/tkhtml:37932-39894,40417,41673-41687 This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |