Revision: 73175
http://sourceforge.net/p/brlcad/code/73175
Author: starseeker
Date: 2019-05-24 17:17:17 +0000 (Fri, 24 May 2019)
Log Message:
-----------
Add some graphical comments to help make it more apparent what the various
breakdowns of the surfaces are doing.
Modified Paths:
--------------
brlcad/trunk/src/libbrep/cdt_surf.cpp
Modified: brlcad/trunk/src/libbrep/cdt_surf.cpp
===================================================================
--- brlcad/trunk/src/libbrep/cdt_surf.cpp 2019-05-24 14:53:11 UTC (rev
73174)
+++ brlcad/trunk/src/libbrep/cdt_surf.cpp 2019-05-24 17:17:17 UTC (rev
73175)
@@ -647,6 +647,38 @@
} else {
cos_within_ang = cos(ON_PI / 2.0);
}
+
+
+
+ /**
+ * Sample portions of the surface to collect sufficient points
+ * to capture the surface shape according to the settings
+ *
+ * M = max
+ * m = min
+ * o = mid
+ *
+ * umvM------uovM-------uMvM
+ * | | |
+ * | | |
+ * | | |
+ * umvo------uovo-------uMvo
+ * | | |
+ * | | |
+ * | | |
+ * umvm------uovm-------uMvm
+ *
+ * left bottom = umvm
+ * left midy = umvo
+ * left top = umvM
+ * midx bottom = uovm
+ * midx midy = uovo
+ * midx top = uovM
+ * right bottom = uMvm
+ * right midy = uMvo
+ * right top = uMvM
+ */
+
ON_BOOL32 uclosed = s->IsClosed(0);
ON_BOOL32 vclosed = s->IsClosed(1);
if (uclosed && vclosed) {
@@ -654,18 +686,29 @@
double midx = (min.x + max.x) / 2.0;
double midy = (min.y + max.y) / 2.0;
- //bottom left
+ //left bottom
p.Set(min.x, min.y);
on_surf_points.Append(p);
- //midy left
+ //left midy
p.Set(min.x, midy);
on_surf_points.Append(p);
+ /*
+ * #--------------------#
+ * | | |
+ * | | |
+ * | | |
+ * umvo------uovo--------#
+ * | | |
+ * | | |
+ * | | |
+ * umvm------uovm--------#
+ */
getSurfacePoints(s_cdt, &sinfo, min.x, midx, min.y, midy, min_dist,
within_dist,
cos_within_ang, on_surf_points, true, true);
- //bottom midx
+ //midx bottom
p.Set(midx, min.y);
on_surf_points.Append(p);
@@ -673,119 +716,211 @@
p.Set(midx, midy);
on_surf_points.Append(p);
+
+ /*
+ * #----------#---------#
+ * | | |
+ * | | |
+ * | | |
+ * #--------uovo-------uMvo
+ * | | |
+ * | | |
+ * | | |
+ * #--------uovm-------uMvm
+ */
getSurfacePoints(s_cdt, &sinfo, midx, max.x, min.y, midy, min_dist,
within_dist,
cos_within_ang, on_surf_points, false, true);
- //bottom right
+ //right bottom
p.Set(max.x, min.y);
on_surf_points.Append(p);
- //right midy
+ //right midy
p.Set(max.x, midy);
on_surf_points.Append(p);
- //top left
+ //left top
p.Set(min.x, max.y);
on_surf_points.Append(p);
+ /*
+ * umvM------uovM--------#
+ * | | |
+ * | | |
+ * | | |
+ * umvo------uovo--------#
+ * | | |
+ * | | |
+ * | | |
+ * #----------#---------#
+ */
getSurfacePoints(s_cdt, &sinfo, min.x, midx, midy, max.y, min_dist,
within_dist,
cos_within_ang, on_surf_points, true, false);
- //top midx
+ //midx top
p.Set(midx, max.y);
on_surf_points.Append(p);
+ /*
+ * #--------uovM------ uMvM
+ * | | |
+ * | | |
+ * | | |
+ * #--------uovo-------uMvo
+ * | | |
+ * | | |
+ * | | |
+ * #----------#---------#
+ */
getSurfacePoints(s_cdt, &sinfo, midx, max.x, midy, max.y, min_dist,
within_dist,
cos_within_ang, on_surf_points, false, false);
- //top left
+ //left top
p.Set(max.x, max.y);
on_surf_points.Append(p);
+
} else if (uclosed) {
ON_2dPoint p(0.0, 0.0);
double midx = (min.x + max.x) / 2.0;
- //bottom left
+ //left bottom
p.Set(min.x, min.y);
on_surf_points.Append(p);
- //top left
+ //left top
p.Set(min.x, max.y);
on_surf_points.Append(p);
+ /*
+ * umvM------uovM--------#
+ * | | |
+ * | | |
+ * | | |
+ * #----------#---------#
+ * | | |
+ * | | |
+ * | | |
+ * umvm------uovm--------#
+ */
getSurfacePoints(s_cdt, &sinfo, min.x, midx, min.y, max.y, min_dist,
within_dist, cos_within_ang, on_surf_points, true,
true);
- //bottom midx
+ //midx bottom
p.Set(midx, min.y);
on_surf_points.Append(p);
- //top midx
+ //midx top
p.Set(midx, max.y);
on_surf_points.Append(p);
+ /*
+ * #--------uovM------ uMvM
+ * | | |
+ * | | |
+ * | | |
+ * #----------#---------#
+ * | | |
+ * | | |
+ * | | |
+ * #--------uovm-------uMvm
+ */
getSurfacePoints(s_cdt, &sinfo, midx, max.x, min.y, max.y, min_dist,
within_dist, cos_within_ang, on_surf_points,
false, true);
- //bottom right
+ //right bottom
p.Set(max.x, min.y);
on_surf_points.Append(p);
- //top right
+ //right top
p.Set(max.x, max.y);
on_surf_points.Append(p);
+
} else if (vclosed) {
+
ON_2dPoint p(0.0, 0.0);
double midy = (min.y + max.y) / 2.0;
- //bottom left
+ //left bottom
p.Set(min.x, min.y);
on_surf_points.Append(p);
- //left midy
+ //midy left
p.Set(min.x, midy);
on_surf_points.Append(p);
+ /*
+ * #----------#---------#
+ * | | |
+ * | | |
+ * | | |
+ * umvo--------#--------uMvo
+ * | | |
+ * | | |
+ * | | |
+ * umvm--------#--------uMvm
+ */
getSurfacePoints(s_cdt, &sinfo, min.x, max.x, min.y, midy, min_dist,
within_dist, cos_within_ang, on_surf_points, true,
true);
- //bottom right
+ //right bottom
p.Set(max.x, min.y);
on_surf_points.Append(p);
- //right midy
+ //midy right
p.Set(max.x, midy);
on_surf_points.Append(p);
+ /*
+ * umvM--------#------- uMvM
+ * | | |
+ * | | |
+ * | | |
+ * umvo--------#--------uMvo
+ * | | |
+ * | | |
+ * | | |
+ * #----------#---------#
+ */
getSurfacePoints(s_cdt, &sinfo, min.x, max.x, midy, max.y, min_dist,
within_dist, cos_within_ang, on_surf_points, true,
false);
- // top left
+ //left top
p.Set(min.x, max.y);
on_surf_points.Append(p);
- //top right
+ //right top
p.Set(max.x, max.y);
on_surf_points.Append(p);
} else {
ON_2dPoint p(0.0, 0.0);
- //bottom left
+ //left bottom
p.Set(min.x, min.y);
on_surf_points.Append(p);
- //top left
+ //left top
p.Set(min.x, max.y);
on_surf_points.Append(p);
+ /*
+ * umvM--------#------- uMvM
+ * | | |
+ * | | |
+ * | | |
+ * #----------#---------#
+ * | | |
+ * | | |
+ * | | |
+ * umvm--------#--------uMvm
+ */
getSurfacePoints(s_cdt, &sinfo, min.x, max.x, min.y, max.y,
min_dist,
within_dist, cos_within_ang, on_surf_points, true,
true);
- //bottom right
+ //right bottom
p.Set(max.x, min.y);
on_surf_points.Append(p);
- //top right
+ //right top
p.Set(max.x, max.y);
on_surf_points.Append(p);
}
This was sent by the SourceForge.net collaborative development platform, the
world's largest Open Source development site.
_______________________________________________
BRL-CAD Source Commits mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/brlcad-commits