Revision: 56663
http://sourceforge.net/p/brlcad/code/56663
Author: phoenixyjll
Date: 2013-08-07 14:04:27 +0000 (Wed, 07 Aug 2013)
Log Message:
-----------
Remove the duplicated first segment at last before we generate the rest
sub-face. And output some debug info for the surface splitting result.
Modified Paths:
--------------
brlcad/trunk/src/libbrep/boolean.cpp
Modified: brlcad/trunk/src/libbrep/boolean.cpp
===================================================================
--- brlcad/trunk/src/libbrep/boolean.cpp 2013-08-07 13:40:21 UTC (rev
56662)
+++ brlcad/trunk/src/libbrep/boolean.cpp 2013-08-07 14:04:27 UTC (rev
56663)
@@ -37,7 +37,9 @@
#include "brep.h"
#include "raytrace.h"
+#define DEBUG 1
+
struct TrimmedFace {
ON_SimpleArray<ON_Curve*> outerloop;
std::vector<ON_SimpleArray<ON_Curve*> > innerloop;
@@ -358,9 +360,14 @@
out.Append(newface);
}
+ // Remove the duplicated first segment.
+ if (sorted_pointers.Count())
+ outerloop.Remove();
+
if (out.Count() == 0) {
out.Append(in->Duplicate());
} else {
+ // The remaining part after splitting some parts out.
TrimmedFace *newface = new TrimmedFace();
newface->face = in->face;
newface->outerloop = outerloop;
@@ -370,6 +377,33 @@
}
bu_log("Split to %d faces.\n", out.Count());
+ if (DEBUG) {
+ for (int i = 0; i < out.Count(); i++) {
+ bu_log("Trimmed Face %d:\n", i);
+ bu_log("outerloop:\n");
+ ON_wString wstr;
+ ON_TextLog textlog(wstr);
+ textlog.PushIndent();
+ for (int j = 0; j < out[i]->outerloop.Count(); j++) {
+ textlog.Print("Curve %d\n", j);
+ out[i]->outerloop[j]->Dump(textlog);
+ }
+ bu_log(ON_String(wstr).Array());
+
+ for (unsigned int j = 0; j < out[i]->innerloop.size(); j++) {
+ bu_log("innerloop %d:\n", j);
+ ON_wString wstr;
+ ON_TextLog textlog(wstr);
+ textlog.PushIndent();
+ for (int k = 0; k < out[i]->innerloop[j].Count(); k++) {
+ textlog.Print("Curve %d\n", k);
+ out[i]->innerloop[j][k]->Dump(textlog);
+ }
+ bu_log(ON_String(wstr).Array());
+ }
+ }
+ }
+
return 0;
}
This was sent by the SourceForge.net collaborative development platform, the
world's largest Open Source development site.
------------------------------------------------------------------------------
Get 100% visibility into Java/.NET code with AppDynamics Lite!
It's a free troubleshooting tool designed for production.
Get down to code-level detail for bottlenecks, with <2% overhead.
Download for free and get started troubleshooting in minutes.
http://pubads.g.doubleclick.net/gampad/clk?id=48897031&iu=/4140/ostg.clktrk
_______________________________________________
BRL-CAD Source Commits mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/brlcad-commits