Compare commits

...
42 Commits
Author SHA1 Message Date
Clifford Yapp c1d9f19e10 Merge from trunk - r77772 through r78208
svn:revision:78213
svn:branch:nurbs
svn:account:starseeker
2021-02-07 23:27:52 +00:00
Clifford Yapp b5e2c227ac Merge from trunk - r77303 through r77772
svn:revision:77775
svn:branch:nurbs
svn:account:starseeker
2020-11-20 22:50:04 +00:00
Clifford Yapp 01bbb62e7b Merge from trunk - r77237 through r77302
svn:revision:77307
svn:branch:nurbs
svn:account:starseeker
2020-10-01 13:27:28 +00:00
Clifford Yapp 92c4056186 Merge from trunk r76151 through r77237, except for src/librt/primitives/brep/brep.cpp
svn:revision:77238
svn:branch:nurbs
svn:account:starseeker
2020-09-25 19:43:15 +00:00
Clifford Yapp 91b30d4928 Merge from trunk through r76151, except for src/librt/primitives/brep/brep.cpp
svn:revision:76155
svn:branch:nurbs
svn:account:starseeker
2020-06-18 17:12:19 +00:00
Clifford Yapp 0527a47180 Sync with trunk through r71980
svn:revision:71987
svn:branch:nurbs
svn:account:starseeker
2018-10-17 18:05:28 +00:00
Clifford Yapp 86888b09aa Sync with trunk thru r69929
svn:revision:69933
svn:branch:nurbs
svn:account:starseeker
2017-06-22 18:20:35 +00:00
Clifford Yapp 7693e0c573 Sync with trunk thru r69860, except for src/librt/primitives/brep/brep.cpp which needs its differences evaluated manually.
svn:revision:69863
svn:branch:nurbs
svn:account:starseeker
2017-05-31 16:51:35 +00:00
Clifford Yapp 5f9b783cbf Sync with trunk thru r69558, except for src/librt/primitives/brep/brep.cpp which needs its differences evaluated manually.
svn:revision:69566
svn:branch:nurbs
svn:account:starseeker
2017-03-24 02:20:40 +00:00
Keith Boman 17eb24e841 Merging trunk back into branch with changes just before allowing trims to extend over closed seam r:59385:60178
svn:revision:60192
svn:branch:nurbs
svn:account:indianlarry
2014-03-25 09:22:07 +00:00
Keith Boman 1064c96df6 Merging changes from trunk into branch 'nurbs' r:58142:59385
svn:revision:59386
svn:branch:nurbs
svn:account:indianlarry
2014-01-15 12:25:56 +00:00
Keith Boman 27274edc04 new pullpack integrated back into watertight mode where points on the 3d edge are pulled back to nearest UV point of referencing trims, the actual 3d edge point will be used whenever point on 2d trim is referenced forcing adjacent faces to share points along there shared edge. still a bit of debug code to clean up
svn:revision:58150
svn:branch:nurbs
svn:account:indianlarry
2013-10-09 20:29:35 +00:00
Keith Boman 4ee6debad6 Just merging trunk into branch 'nurbs' r:58097:58142
svn:revision:58144
svn:branch:nurbs
svn:account:indianlarry
2013-10-08 12:44:42 +00:00
Keith Boman 64a9ad5824 added 'quadrant' hint to surf_getclosestpoint() , using quadrant hint and surface closure information return better 2d UV mapping
svn:revision:58143
svn:branch:nurbs
svn:account:indianlarry
2013-10-08 12:32:52 +00:00
Keith Boman 6b46dc6ed5 Just merging trunk into branch 'nurbs' r:57777:58097
svn:revision:58099
svn:branch:nurbs
svn:account:indianlarry
2013-10-04 19:31:06 +00:00
Keith Boman f4c7d68fda for trim_getclosestpoint() saw floating point fuzz where max dist less than min dist so added check to fix that case, also removed some debug blather with prepro
svn:revision:58098
svn:branch:nurbs
svn:account:indianlarry
2013-10-04 19:01:50 +00:00
Keith Boman e37ce93f33 hybrid get closest point pullback working for hood but not getting through all of the M1025 geometry need to lookat, still WIP with a lot of debug code
svn:revision:57783
svn:branch:nurbs
svn:account:indianlarry
2013-09-20 19:43:14 +00:00
Keith Boman 1d08ea407e Merging trunk into branch 'nurbs' r:57745:57777
svn:revision:57778
svn:branch:nurbs
svn:account:indianlarry
2013-09-20 09:31:15 +00:00
Keith Boman 4004865448 working subdivision back into parts of first order pullback that fail, getting close but currently recursing to deep based on normals at edges, WIP
svn:revision:57761
svn:branch:nurbs
svn:account:indianlarry
2013-09-19 20:00:53 +00:00
Keith Boman f89bdd9be2 Merging trunk into branch 'nurbs' r:57712:57745
svn:revision:57748
svn:branch:nurbs
svn:account:indianlarry
2013-09-19 13:18:13 +00:00
Keith Boman cdfd33488b More cleanup in surface_GetClosestPoint3dFirstOrder()
svn:revision:57747
svn:branch:nurbs
svn:account:indianlarry
2013-09-19 13:05:39 +00:00
Keith Boman 97545aaba8 Cleaning up recursive bailouts for forced subdivision pullback need to work on tolerences then work back into FIRST order pullback, WIP
svn:revision:57746
svn:branch:nurbs
svn:account:indianlarry
2013-09-19 12:24:22 +00:00
Keith Boman 347671de7a Added surface_GetBoundingBox() which currently makes use of static variable to reuse surface memory and allows user to get surface bounds over specific U,V intervals. WIP, need to replace static with per cpu memory similar to whats done in libbu's heap.c.
svn:revision:57732
svn:branch:nurbs
svn:account:indianlarry
2013-09-18 20:23:38 +00:00
Keith Boman 003008c89f Merging trunk into branch 'nurbs' r:57686:57712
svn:revision:57713
svn:branch:nurbs
svn:account:indianlarry
2013-09-18 13:32:59 +00:00
Keith Boman dd1b85dddd Merging trunk into branch 'nurbs' r:57668:57686
svn:revision:57687
svn:branch:nurbs
svn:account:indianlarry
2013-09-17 12:08:59 +00:00
Keith Boman 35f53aef2c Merging trunk into branch 'nurbs' r:57630:57668
svn:revision:57669
svn:branch:nurbs
svn:account:indianlarry
2013-09-15 22:57:07 +00:00
Keith Boman 919585d7b7 Merging trunk into branch 'nurbs' r:57498:57630
svn:revision:57631
svn:branch:nurbs
svn:account:indianlarry
2013-09-13 16:10:35 +00:00
Keith Boman 7988524f2d Merging trunk into branch 'nurbs' r:57491:57498
svn:revision:57499
svn:branch:nurbs
svn:account:indianlarry
2013-09-09 12:36:58 +00:00
Keith Boman b19822edc7 Merging trunk into branch 'nurbs' r:57462:57491
svn:revision:57492
svn:branch:nurbs
svn:account:indianlarry
2013-09-08 17:50:22 +00:00
Keith Boman ce0625b2cc playing with surf subdivision and reusing surface without malloc still WIP
svn:revision:57479
svn:branch:nurbs
svn:account:indianlarry
2013-09-06 20:02:51 +00:00
Keith Boman 90b1df9fdf Merging trunk into branch 'nurbs' r:57357:57462
svn:revision:57463
svn:branch:nurbs
svn:account:indianlarry
2013-09-06 09:28:11 +00:00
Keith Boman 132e8f09ba breakout UV interval min/max distance checks, add bailout when first order walk vector less than tol, misc debugging code still WIP
svn:revision:57437
svn:branch:nurbs
svn:account:indianlarry
2013-09-04 20:04:38 +00:00
Keith Boman c56c08f2e8 Merging trunk into branch 'nurbs' r:57224:57357
svn:revision:57359
svn:branch:nurbs
svn:account:indianlarry
2013-08-31 16:37:17 +00:00
Keith Boman 03aa2a76f4 just added some debugging code ; currently just hanging up on surface with a singularity so should be pretty easy to work through
svn:revision:57275
svn:branch:nurbs
svn:account:indianlarry
2013-08-29 19:57:11 +00:00
Keith Boman e9f06be38a Merging trunk into branch 'nurbs' r:57224:57257
svn:revision:57259
svn:branch:nurbs
svn:account:indianlarry
2013-08-29 10:05:14 +00:00
Keith Boman 5941c70967 added UV interval assignments for BANode class variables m_u,m_v in constructor, these were being used without being assigned. since we split the trim curve interval on Horz/Vert tangents we can use the m_start/m_end points to bound the curve the trim
svn:revision:57258
svn:branch:nurbs
svn:account:indianlarry
2013-08-29 09:24:19 +00:00
Keith Boman a27f7d25a5 first attempt to brute force those points that don't have jacobian inverse through subdivsion, if jacobian fails then subdivide around current failing u,v then recurse trying first order walk again. Passes through previous failed points but the recursion is dog slow and need to rework.
svn:revision:57234
svn:branch:nurbs
svn:account:indianlarry
2013-08-28 20:05:46 +00:00
Keith Boman 4101ae9bac Initial pullback using first order derivative (WIP currently tetsing resolving known trim points still have a handful of points that don't resolve generally due to singularities in the Jacobian plan to brute force those points through subdivsion for now )
svn:revision:57223
svn:branch:nurbs
svn:account:indianlarry
2013-08-28 14:24:01 +00:00
Keith Boman 8992737d2e Merging trunk into branch 'nurbs' r:57144:57221
svn:revision:57222
svn:branch:nurbs
svn:account:indianlarry
2013-08-28 13:43:32 +00:00
Keith Boman 2b4aa1792a Merging trunk into branch 'nurbs' r:57137:57142
svn:revision:57143
svn:branch:nurbs
svn:account:indianlarry
2013-08-26 16:52:00 +00:00
Keith Boman d9c076e4ed Merging trunk into branch 'nurbs' r:57107:57135
svn:revision:57136
svn:branch:nurbs
svn:account:indianlarry
2013-08-26 09:55:22 +00:00
Christopher Sean Morrison 523cdbeb32 create a branch where indianlarry can commit nurbs work in progress without any interference to/from trunk development.
svn:revision:57107
svn:branch:nurbs
svn:account:brlcad
2013-08-23 18:59:11 +00:00
36 changed files with 4898 additions and 1229 deletions
View File
Regular → Executable
View File
+214
View File
@@ -0,0 +1,214 @@
/* T E S T _ D I F F . C
* BRL-CAD
*
* Copyright (c) 2014 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 <string.h>
#include "analyze.h"
/* Debugging function for printing *everything*
void
gdiff_print(void *result)
{
struct bu_vls tmp = BU_VLS_INIT_ZERO;
struct directory *dp = diff_info_dp(result, DIFF_ORIG);
if (diff_type(result) == DIFF_ADDED) {
dp = diff_info_dp(result, DIFF_NEW);
}
bu_log("\n\n%s(%d): (internal type: %d)\n", dp->d_namep, diff_status(result), diff_type(result));
bu_vls_sprintf(&tmp, "Internal parameters: shared (%s)", dp->d_namep);
bu_avs_print(diff_result(result, DIFF_SHARED_PARAM), bu_vls_addr(&tmp));
bu_vls_sprintf(&tmp, "Internal parameters: orig_only (%s)", dp->d_namep);
bu_avs_print(diff_result(result, DIFF_ORIG_ONLY_PARAM), bu_vls_addr(&tmp));
bu_vls_sprintf(&tmp, "Internal parameters: new_only (%s)", dp->d_namep);
bu_avs_print(diff_result(result, DIFF_NEW_ONLY_PARAM), bu_vls_addr(&tmp));
bu_vls_sprintf(&tmp, "Internal parameters: orig_diff (%s)", dp->d_namep);
bu_avs_print(diff_result(result, DIFF_CHANGED_ORIG_PARAM), bu_vls_addr(&tmp));
bu_vls_sprintf(&tmp, "Internal parameters: new_diff (%s)", dp->d_namep);
bu_avs_print(diff_result(result, DIFF_CHANGED_NEW_PARAM), bu_vls_addr(&tmp));
bu_vls_sprintf(&tmp, "Additional parameters: shared (%s)", dp->d_namep);
bu_avs_print(diff_result(result, DIFF_SHARED_ATTR), bu_vls_addr(&tmp));
bu_vls_sprintf(&tmp, "Additional parameters: orig_only (%s)", dp->d_namep);
bu_avs_print(diff_result(result, DIFF_ORIG_ONLY_ATTR), bu_vls_addr(&tmp));
bu_vls_sprintf(&tmp, "Additional parameters: new_only (%s)", dp->d_namep);
bu_avs_print(diff_result(result, DIFF_NEW_ONLY_ATTR), bu_vls_addr(&tmp));
bu_vls_sprintf(&tmp, "Additional parameters: orig_diff (%s)", dp->d_namep);
bu_avs_print(diff_result(result, DIFF_CHANGED_ORIG_ATTR), bu_vls_addr(&tmp));
bu_vls_sprintf(&tmp, "Additional parameters: new_diff (%s)", dp->d_namep);
bu_avs_print(diff_result(result, DIFF_CHANGED_NEW_ATTR), bu_vls_addr(&tmp));
}
void
diff_summarize(struct bu_ptbl *results_table)
{
int i = 0;
for (i = 0; i < (int)BU_PTBL_LEN(results_table); i++) {
gdiff_print(BU_PTBL_GET(results_table, i));
}
}
*/
void
attrs_summary(struct bu_vls *attr_log, void *result)
{
struct bu_attribute_value_pair *avpp;
struct bu_attribute_value_set *orig_only = diff_result(result, DIFF_ORIG_ONLY_ATTR);
struct bu_attribute_value_set *new_only = diff_result(result, DIFF_NEW_ONLY_ATTR);
struct bu_attribute_value_set *orig_diff = diff_result(result, DIFF_CHANGED_ORIG_ATTR);
struct bu_attribute_value_set *new_diff = diff_result(result, DIFF_CHANGED_NEW_ATTR);
if (orig_only->count > 0) {
bu_vls_printf(attr_log, " Attributes removed:\n");
for (BU_AVS_FOR(avpp, orig_only)) {
bu_vls_printf(attr_log, " %s\n", avpp->name);
}
}
if (new_only->count > 0) {
bu_vls_printf(attr_log, " Attributes added:\n");
for (BU_AVS_FOR(avpp, new_only)) {
bu_vls_printf(attr_log, " %s: %s\n", avpp->name, avpp->value);
}
}
if (orig_diff->count > 0) {
bu_vls_printf(attr_log, " Attribute parameters changed:\n");
for (BU_AVS_FOR(avpp, orig_diff)) {
bu_vls_printf(attr_log, " %s: \"%s\" -> \"%s\"\n", avpp->name, avpp->value, bu_avs_get(new_diff, avpp->name));
}
}
}
void
diff_summarize(struct bu_vls *diff_log, struct bu_ptbl *results_table)
{
int i = 0;
struct bu_vls params = BU_VLS_INIT_ZERO;
struct bu_vls added = BU_VLS_INIT_ZERO;
struct bu_vls removed = BU_VLS_INIT_ZERO;
struct bu_vls typechanged = BU_VLS_INIT_ZERO;
struct bu_vls same = BU_VLS_INIT_ZERO;
struct bu_attribute_value_pair *avpp;
for (i = 0; i < (int)BU_PTBL_LEN(results_table); i++) {
void *result = BU_PTBL_GET(results_table, i);
struct directory *dp = diff_info_dp(result, DIFF_ORIG);
if (diff_type(result) == DIFF_ADDED) {
dp = diff_info_dp(result, DIFF_NEW);
}
switch(diff_type(result)) {
case DIFF_NONE:
break;
case DIFF_REMOVED:
bu_vls_printf(&removed, "%s was removed.\n\n", dp->d_namep);
break;
case DIFF_ADDED:
bu_vls_printf(&added, "%s was added.\n\n", dp->d_namep);
break;
case DIFF_TYPECHANGE:
bu_vls_printf(&typechanged, "%s changed from type \"%s\" to type \"%s\".\n", dp->d_namep, diff_info_intern(result, DIFF_ORIG)->idb_meth->ft_label, diff_info_intern(result, DIFF_NEW)->idb_meth->ft_label);
attrs_summary(&typechanged, result);
bu_vls_printf(&typechanged, "\n");
break;
case DIFF_BINARY:
bu_vls_printf(&params, "%s exhibits a binary difference.\n", dp->d_namep);
attrs_summary(&params, result);
bu_vls_printf(&params, "\n");
break;
case DIFF:
bu_vls_printf(&params, "%s changed:\n", dp->d_namep);
for (BU_AVS_FOR(avpp, diff_result(result, DIFF_CHANGED_ORIG_PARAM))) {
bu_vls_printf(&params, " %s: \"%s\" -> \"%s\"\n", avpp->name, avpp->value, bu_avs_get(diff_result(result, DIFF_CHANGED_NEW_PARAM), avpp->name));
}
attrs_summary(&params, result);
bu_vls_printf(&params, "\n");
break;
default:
break;
}
}
bu_vls_trunc(diff_log, 0);
if (strlen(bu_vls_addr(&same)) > 0) bu_vls_printf(diff_log, "%s", bu_vls_addr(&same));
if (strlen(bu_vls_addr(&removed)) > 0) bu_vls_printf(diff_log, "%s", bu_vls_addr(&removed));
if (strlen(bu_vls_addr(&added)) > 0) bu_vls_printf(diff_log, "%s", bu_vls_addr(&added));
if (strlen(bu_vls_addr(&typechanged)) > 0) bu_vls_printf(diff_log, "%s", bu_vls_addr(&typechanged));
if (strlen(bu_vls_addr(&params)) > 0) bu_vls_printf(diff_log, "%s", bu_vls_addr(&params));
}
int
main(int argc, char **argv)
{
struct bu_ptbl *results;
struct db_i *dbip1 = DBI_NULL;
struct db_i *dbip2 = DBI_NULL;
struct bu_vls diff_log = BU_VLS_INIT_ZERO;
if (argc != 3) {
bu_log("Error - please specify two .g files\n");
bu_exit(EXIT_FAILURE, NULL);
}
if (!bu_file_exists(argv[1], NULL)) {
bu_exit(1, "Cannot stat file %s\n", argv[1]);
}
if (!bu_file_exists(argv[2], NULL)) {
bu_exit(1, "Cannot stat file %s\n", argv[2]);
}
if ((dbip1 = db_open(argv[1], DB_OPEN_READONLY)) == DBI_NULL) {
bu_exit(1, "Cannot open geometry database file %s\n", argv[1]);
}
RT_CK_DBI(dbip1);
if (db_dirbuild(dbip1) < 0) {
db_close(dbip1);
bu_exit(1, "db_dirbuild failed on geometry database file %s\n", argv[1]);
}
if ((dbip2 = db_open(argv[2], DB_OPEN_READONLY)) == DBI_NULL) {
bu_exit(1, "Cannot open geometry database file %s\n", argv[2]);
}
RT_CK_DBI(dbip2);
if (db_dirbuild(dbip2) < 0) {
db_close(dbip1);
db_close(dbip2);
bu_exit(1, "db_dirbuild failed on geometry database file %s\n", argv[1]);
}
results = diff_dbip(dbip1, dbip2);
diff_summarize(&diff_log, results);
diff_free_ptbl(results);
bu_log("%s", bu_vls_addr(&diff_log));
db_close(dbip1);
db_close(dbip2);
return 0;
}
/*
* Local Variables:
* tab-width: 8
* mode: C
* indent-tabs-mode: t
* c-file-style: "stroustrup"
* End:
* ex: shiftwidth=4 tabstop=8
*/
Regular → Executable
View File
Regular → Executable
View File
File diff suppressed because it is too large Load Diff
View File
Regular → Executable
View File
View File
View File
View File
View File
View File
View File
View File
View File
View File
View File
View File
View File
View File
View File
View File
View File
View File
View File
View File
View File
View File
View File
View File
View File
View File
View File
View File
View File