Revision: 76549
http://sourceforge.net/p/brlcad/code/76549
Author: brlcad
Date: 2020-07-28 07:37:26 +0000 (Tue, 28 Jul 2020)
Log Message:
-----------
plot files are binary
Modified Paths:
--------------
brlcad/trunk/src/libbg/polygon.c
brlcad/trunk/src/libbg/polygon_triangulate.cpp
brlcad/trunk/src/libbg/tests/chull.c
brlcad/trunk/src/libbg/tests/obr.c
brlcad/trunk/src/libbg/trimesh_isect.cpp
Modified: brlcad/trunk/src/libbg/polygon.c
===================================================================
--- brlcad/trunk/src/libbg/polygon.c 2020-07-28 06:24:10 UTC (rev 76548)
+++ brlcad/trunk/src/libbg/polygon.c 2020-07-28 07:37:26 UTC (rev 76549)
@@ -230,7 +230,7 @@
bg_polygon_plot_2d(const char *filename, const point2d_t *pnts, int npnts, int
r, int g, int b)
{
point_t bnp;
- FILE* plot_file = fopen(filename, "w");
+ FILE* plot_file = fopen(filename, "wb");
pl_color(plot_file, r, g, b);
VSET(bnp, pnts[0][X], pnts[0][Y], 0);
@@ -251,7 +251,7 @@
bg_polygon_plot(const char *filename, const point_t *pnts, int npnts, int r,
int g, int b)
{
point_t bnp;
- FILE* plot_file = fopen(filename, "w");
+ FILE* plot_file = fopen(filename, "wb");
pl_color(plot_file, r, g, b);
VSET(bnp, pnts[0][X], pnts[0][Y], 0);
Modified: brlcad/trunk/src/libbg/polygon_triangulate.cpp
===================================================================
--- brlcad/trunk/src/libbg/polygon_triangulate.cpp 2020-07-28 06:24:10 UTC
(rev 76548)
+++ brlcad/trunk/src/libbg/polygon_triangulate.cpp 2020-07-28 07:37:26 UTC
(rev 76549)
@@ -274,7 +274,7 @@
extern "C" void
bg_tri_plot_2d(const char *filename, const int *faces, int num_faces, const
point2d_t *pnts, int r, int g, int b)
{
- FILE* plot_file = fopen(filename, "w");
+ FILE* plot_file = fopen(filename, "wb");
pl_color(plot_file, r, g, b);
for (int k = 0; k < num_faces; k++) {
Modified: brlcad/trunk/src/libbg/tests/chull.c
===================================================================
--- brlcad/trunk/src/libbg/tests/chull.c 2020-07-28 06:24:10 UTC (rev
76548)
+++ brlcad/trunk/src/libbg/tests/chull.c 2020-07-28 07:37:26 UTC (rev
76549)
@@ -37,7 +37,7 @@
FILE *plot_file = NULL;
bu_vls_init(&name);
bu_vls_printf(&name, "chull_test_%.3d.plot3", test_num);
- plot_file = fopen(bu_vls_addr(&name), "w");
+ plot_file = fopen(bu_vls_addr(&name), "wb");
pl_color(plot_file, 0, 255, 0);
for (i = 0; i < pnt_cnt; i++) {
pdv_3move(plot_file, pnt_array[i]);
@@ -60,7 +60,7 @@
point_t p3d;
bu_vls_init(&name);
bu_vls_printf(&name, "chull_test_%.3d.plot3", test_num);
- plot_file = fopen(bu_vls_addr(&name), "w");
+ plot_file = fopen(bu_vls_addr(&name), "wb");
pl_color(plot_file, 0, 255, 0);
for (i = 0; i < pnt_cnt; i++) {
VSET(p3d, pnt_array[i][X], pnt_array[i][Y], 0);
@@ -85,7 +85,7 @@
FILE *plot_file = NULL;
bu_vls_init(&name);
bu_vls_printf(&name, "chull2_test_%.3d.plot3", test_num);
- plot_file = fopen(bu_vls_addr(&name), "w");
+ plot_file = fopen(bu_vls_addr(&name), "wb");
pl_color(plot_file, 0, 255, 0);
for (i = 0; i < pnt_cnt; i++) {
pdv_3move(plot_file, pnt_array[hull[i]]);
@@ -108,7 +108,7 @@
point_t p3d;
bu_vls_init(&name);
bu_vls_printf(&name, "chull2_test_%.3d.plot3", test_num);
- plot_file = fopen(bu_vls_addr(&name), "w");
+ plot_file = fopen(bu_vls_addr(&name), "wb");
pl_color(plot_file, 0, 255, 0);
for (i = 0; i < pnt_cnt; i++) {
VSET(p3d, pnt_array[hull[i]][X], pnt_array[hull[i]][Y], 0);
Modified: brlcad/trunk/src/libbg/tests/obr.c
===================================================================
--- brlcad/trunk/src/libbg/tests/obr.c 2020-07-28 06:24:10 UTC (rev 76548)
+++ brlcad/trunk/src/libbg/tests/obr.c 2020-07-28 07:37:26 UTC (rev 76549)
@@ -37,7 +37,7 @@
FILE *plot_file = NULL;
bu_vls_init(&name);
bu_vls_printf(&name, "obr_test_%.3d.pl", test_num);
- plot_file = fopen(bu_vls_addr(&name), "w");
+ plot_file = fopen(bu_vls_addr(&name), "wb");
pl_color(plot_file, 0, 255, 0);
for (i = 0; i < pnt_cnt; i++) {
pdv_3move(plot_file, pnt_array[i]);
Modified: brlcad/trunk/src/libbg/trimesh_isect.cpp
===================================================================
--- brlcad/trunk/src/libbg/trimesh_isect.cpp 2020-07-28 06:24:10 UTC (rev
76548)
+++ brlcad/trunk/src/libbg/trimesh_isect.cpp 2020-07-28 07:37:26 UTC (rev
76549)
@@ -50,7 +50,7 @@
plot_faces(const char *fname, std::set<int> *faces, int *f, point_t *v)
{
std::set<int>::iterator f_it;
- FILE* plot_file = fopen(fname, "w");
+ FILE* plot_file = fopen(fname, "wb");
int r = int(256*drand48() + 100.0);
int g = int(256*drand48() + 100.0);
int b = int(256*drand48() + 100.0);
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