Revision: 76321
          http://sourceforge.net/p/brlcad/code/76321
Author:   starseeker
Date:     2020-07-14 14:08:18 +0000 (Tue, 14 Jul 2020)
Log Message:
-----------
Allow NULL matrix specifications - just use the identity matrix in that case.

Modified Paths:
--------------
    brlcad/trunk/src/libbg/polygon_op.cpp

Modified: brlcad/trunk/src/libbg/polygon_op.cpp
===================================================================
--- brlcad/trunk/src/libbg/polygon_op.cpp       2020-07-13 23:36:05 UTC (rev 
76320)
+++ brlcad/trunk/src/libbg/polygon_op.cpp       2020-07-14 14:08:18 UTC (rev 
76321)
@@ -447,6 +447,7 @@
     size_t j, k, n;
     ClipperLib::Polygon curr_poly;
     fastf_t vZ = 1.0;
+    mat_t idmat = MAT_INIT_IDN;
 
     for (j = 0; j < gpoly->num_contours; ++j) {
        n = gpoly->contour[j].num_points;
@@ -455,7 +456,11 @@
            point_t vpoint;
 
            /* Convert to view coordinates */
-           MAT4X3PNT(vpoint, mat, gpoly->contour[j].point[k]);
+           if (mat) {
+               MAT4X3PNT(vpoint, mat, gpoly->contour[j].point[k]);
+           } else {
+               MAT4X3PNT(vpoint, idmat, gpoly->contour[j].point[k]);
+           }
            vZ = vpoint[Z];
 
            curr_poly[k].X = (ClipperLib::long64)(vpoint[X] * sf);
@@ -493,6 +498,7 @@
     size_t i, j, k, n;
     size_t num_contours = 0;
     struct bg_polygon *result_poly;
+    mat_t idmat = MAT_INIT_IDN;
 
     /* Count up the number of contours. */
     for (i = 0; i < clipper_polys.size(); ++i)
@@ -522,7 +528,11 @@
            VSET(vpoint, (fastf_t)(clipper_polys[i].outer[j].X) * sf, 
(fastf_t)(clipper_polys[i].outer[j].Y) * sf, vZ);
 
            /* Convert to model coordinates */
-           MAT4X3PNT(result_poly->contour[n].point[j], mat, vpoint);
+           if (mat) {
+               MAT4X3PNT(result_poly->contour[n].point[j], mat, vpoint);
+           } else {
+               MAT4X3PNT(result_poly->contour[n].point[j], idmat, vpoint);
+           }
        }
 
        ++n;

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