Revision: 49357
http://brlcad.svn.sourceforge.net/brlcad/?rev=49357&view=rev
Author: brlcad
Date: 2012-02-08 21:41:50 +0000 (Wed, 08 Feb 2012)
Log Message:
-----------
the Triangulate() function doesn't seem to be used or very useful in its
current state. remove outright.
Modified Paths:
--------------
brlcad/trunk/src/proc-db/brepintersect.cpp
Modified: brlcad/trunk/src/proc-db/brepintersect.cpp
===================================================================
--- brlcad/trunk/src/proc-db/brepintersect.cpp 2012-02-08 21:33:58 UTC (rev
49356)
+++ brlcad/trunk/src/proc-db/brepintersect.cpp 2012-02-08 21:41:50 UTC (rev
49357)
@@ -640,82 +640,6 @@
}
/**
- * takes an array of PolyLines and gives the resulting polygon
- * triangulated. there are a number of contraints on the input which
- * are the callers responsibility. the points must all lie within the
- * same plane, none of the Polylines can intersect all polyline must
- * be closed. one another all paths must be within the first path and
- * no path can be inside of 2 paths.
- */
-int Triangulate(
- ON_ClassArray<ON_Polyline>& paths,
- ON_SimpleArray<ON_3dPoint[3]>& UNUSED(triangles)
- )
-{
- /* first we need to link the paths together */
- int i, j, k, l;
- bool intersectfree;
- while (paths.Count() > 1) {
- /* we're going to merge paths[0] with some other path */
- for (i = 1; i < paths.Count(); i++) {
- for (j = 0; j < paths[0].Count(); j++) { /* try connecting each
point in paths[1] */
- for (k = 0; k < paths[i].Count(); k++) { /* with each point in
paths[i] */
- /* now we need to check that this line doesn't intersect
any other polyline */
- intersectfree = true;
- for (l = 0; l < paths.Count(); l++) {
-#if 0
- /* FIXME: compiler doesn't like that the first
- * arguments is passing NULL as a non-pointer
- * parameter. commented out until someone
- * fixes it.
- */
- if (SegmentPolylineIntersect(paths[0][j], paths[i][k],
paths[l], NULL, 1E-9) != 0) {
- intersectfree = false;
- break;
- }
-#endif
- }
- if (intersectfree) {
- for (l = 0; l < paths[0].Count(); l++) {
- paths[i].Insert(k + l, paths[0][(j + l) %
paths[0].Count()]);
- }
- } else {
- break;
- }
- }
- }
- }
- }
-
-#if 0
- /* Now we have one continous path and we need to triangulate it
- * I'm pretty sure it's true that given a planer path there exist
- * 3 consecutive points a, b, c s.t. ac doesn't intersect any line
- * in the polyline, perhaps I'll include a proof in a bit, but for
- * right now it seems pretty good.
- */
- while (paths[0].Count() > 4) { /* remember start pt is stored twice, so 4
indicates a triangle */
- for (i = 0; i < (paths[0].Count() - 1); i++) {
- /* we check that the intersection is 4 because the segment shares
end points with 4 different pline segments */
- ON_3dPoint mid = (paths[0][i] + paths[0][i + 2])/2;
- /* FIXME: compiler doesn't like that the first
- * arguments is passing NULL as a non-pointer
- * parameter. commented out until someone
- * fixes it.
- */
- if (SegmentPolylineIntersect(paths[0][i], paths[0][(i + 2) %
paths[0].Count()], paths[0], NULL, 1E-9) == 4 && PointInPolyline(mid, paths[0],
1E-9)) {
- /* ON_3dPoint tri[3] = {paths[0][i], paths[i + 1], paths[(i +
2) % paths[0].Count()]};
- triangles.Append(tri);
- paths[0].Remove(i + 1); */
- }
- }
- }
-#endif
-
- return 0;
-}
-
-/**
* This class has the responsibility of keeping track of the points
* that intersect the edges and eventually chopping the edges up into
* little lines for the intersected mesh this is actually a somewhat
This was sent by the SourceForge.net collaborative development platform, the
world's largest Open Source development site.
------------------------------------------------------------------------------
Keep Your Developer Skills Current with LearnDevNow!
The most comprehensive online learning library for Microsoft developers
is just $99.99! Visual Studio, SharePoint, SQL - plus HTML5, CSS3, MVC3,
Metro Style Apps, more. Free future releases when you subscribe now!
http://p.sf.net/sfu/learndevnow-d2d
_______________________________________________
BRL-CAD Source Commits mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/brlcad-commits