Revision: 52975
http://brlcad.svn.sourceforge.net/brlcad/?rev=52975&view=rev
Author: starseeker
Date: 2012-10-10 20:06:30 +0000 (Wed, 10 Oct 2012)
Log Message:
-----------
Write out subdivided faces as a new bot.
Modified Paths:
--------------
brlcad/trunk/src/librt/test_subdivision.cpp
Modified: brlcad/trunk/src/librt/test_subdivision.cpp
===================================================================
--- brlcad/trunk/src/librt/test_subdivision.cpp 2012-10-10 19:55:32 UTC (rev
52974)
+++ brlcad/trunk/src/librt/test_subdivision.cpp 2012-10-10 20:06:30 UTC (rev
52975)
@@ -248,6 +248,27 @@
fclose(plot_file);
}
+ wdbp = wdb_dbopen(dbip, RT_WDB_TYPE_DB_DISK);
+
+ fastf_t *vertices = (fastf_t *)bu_malloc(sizeof(fastf_t) *
mesh->points_p0.Count() * 3, "new verts");
+ int *faces = (int *)bu_malloc(sizeof(int) * mesh->face_pts.size() * 3,
"new faces");
+ for(size_t v = 0; v < (size_t)mesh->points_p0.Count(); v++) {
+ vertices[v*3] = mesh->points_p0[v].x;
+ vertices[v*3+1] = mesh->points_p0[v].y;
+ vertices[v*3+2] = mesh->points_p0[v].z;
+ }
+ std::map<size_t, std::vector<size_t> >::iterator f_it;
+ std::vector<size_t>::iterator l_it;
+ for(f_it = mesh->face_pts.begin(); f_it != mesh->face_pts.end(); f_it++) {
+ l_it = (*f_it).second.begin();
+ faces[(*f_it).first*3] = (*l_it);
+ faces[(*f_it).first*3+1] = (*(l_it + 1));
+ faces[(*f_it).first*3+2] = (*(l_it + 2));
+ }
+
+ mk_bot(wdbp, "sph_refined.bot", RT_BOT_SOLID, RT_BOT_UNORIENTED, 0,
mesh->points_p0.Count(), mesh->face_pts.size(), vertices, faces, (fastf_t
*)NULL, (struct bu_bitv *)NULL);
+ wdb_close(wdbp);
+
return 0;
}
This was sent by the SourceForge.net collaborative development platform, the
world's largest Open Source development site.
------------------------------------------------------------------------------
Don't let slow site performance ruin your business. Deploy New Relic APM
Deploy New Relic app performance management and know exactly
what is happening inside your Ruby, Python, PHP, Java, and .NET app
Try New Relic at no cost today and get our sweet Data Nerd shirt too!
http://p.sf.net/sfu/newrelic-dev2dev
_______________________________________________
BRL-CAD Source Commits mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/brlcad-commits