Revision: 73882
          http://sourceforge.net/p/brlcad/code/73882
Author:   starseeker
Date:     2019-09-10 17:45:32 +0000 (Tue, 10 Sep 2019)
Log Message:
-----------
Set up to plot individual surface patch bboxes in 2D.

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-09-10 16:40:24 UTC (rev 
73881)
+++ brlcad/trunk/src/libbrep/cdt_surf.cpp       2019-09-10 17:45:32 UTC (rev 
73882)
@@ -101,6 +101,8 @@
            vmax = v2;
        }
 
+       void plot(const char *filename);
+
        double umin;
        double umax;
        double vmin;
@@ -107,6 +109,31 @@
        double vmax;
 };
 
+void SPatch::plot(const char *filename)
+{
+    FILE* plot_file = fopen(filename, "w");
+    struct bu_color c = BU_COLOR_INIT_ZERO;
+    bu_color_rand(&c, BU_COLOR_RANDOM_LIGHTENED);
+    pl_color_buc(plot_file, &c);
+
+    ON_2dPoint p2dmin(umin, vmin);
+    ON_2dPoint p2dmax(umax, vmax);
+    ON_Line line(p2dmin, p2dmax);
+    ON_BoundingBox bb = line.BoundingBox();
+    fastf_t pt[4][3];                  
+    VSET(pt[0], bb.Max().x, bb.Min().y, 0);    
+    VSET(pt[1], bb.Max().x, bb.Max().y, 0);    
+    VSET(pt[2], bb.Min().x, bb.Max().y, 0);    
+    VSET(pt[3], bb.Min().x, bb.Min().y, 0);    
+    pdv_3move(plot_file, pt[0]); 
+    pdv_3cont(plot_file, pt[1]); 
+    pdv_3cont(plot_file, pt[2]); 
+    pdv_3cont(plot_file, pt[3]); 
+    pdv_3cont(plot_file, pt[0]); 
+
+    fclose(plot_file); 
+}
+
 static double
 uline_len_est(struct cdt_surf_info *sinfo, double u1, double u2, double v)
 {

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

Reply via email to