Revision: 73835
http://sourceforge.net/p/brlcad/code/73835
Author: starseeker
Date: 2019-09-05 15:32:58 +0000 (Thu, 05 Sep 2019)
Log Message:
-----------
NIST7-10 Solid1.s Face 24 is exposing a bookkeeping problem of some sort.
Modified Paths:
--------------
brlcad/trunk/src/libbrep/cdt.cpp
brlcad/trunk/src/libbrep/cdt_mesh.cpp
Modified: brlcad/trunk/src/libbrep/cdt.cpp
===================================================================
--- brlcad/trunk/src/libbrep/cdt.cpp 2019-09-05 13:16:14 UTC (rev 73834)
+++ brlcad/trunk/src/libbrep/cdt.cpp 2019-09-05 15:32:58 UTC (rev 73835)
@@ -665,7 +665,15 @@
double old_trim_start = bseg->tseg2->trim_start;
double old_trim_end = bseg->tseg2->trim_end;
poly2->remove_ordered_edge(cdt_mesh::edge_t(v[0], v[1]));
+ size_t csize = poly2->pnts_2d.size();
long poly2_2dind = poly2->add_point(trim2_mid_2d, f2_ind2d);
+ if (fmesh2->f_id == 24) {
+ if (csize >= poly2->pnts_2d.size()) {
+ std::cout << "add_point FAILED!\n";
+ } else {
+ std::cout << "Adding point " << poly2_2dind << "\n";
+ }
+ }
struct cdt_mesh::edge_t poly2_edge1(v[0], poly2_2dind);
poly2_ne1 = poly2->add_ordered_edge(poly2_edge1);
poly2_ne1->trim_ind = trim_ind;
@@ -1408,6 +1416,10 @@
}
}
}
+ if (fmesh->f_id == 24) {
+ fmesh->polygon_plot_2d(&fmesh->outer_loop, "oloop_orig.plot3");
+ std::cout << "Polygon point count: " <<
fmesh->outer_loop.pnts_2d.size() << "\n";
+ }
}
std::map<int, std::set<cdt_mesh::bedge_seg_t *>>::iterator epoly_it;
@@ -1433,9 +1445,26 @@
std::set<cdt_mesh::bedge_seg_t *> wsegs = epoly_it->second;
for (seg_it = wsegs.begin(); seg_it != wsegs.end(); seg_it++) {
cdt_mesh::bedge_seg_t *bseg = *seg_it;
+
+ bool doplot = false;
+ if
((s_cdt->brep->m_T[bseg->tseg1->trim_ind].Face()->m_face_index == 24) ||
+
(s_cdt->brep->m_T[bseg->tseg2->trim_ind].Face()->m_face_index == 24)) {
+ cdt_mesh::cdt_mesh_t *fmesh = &s_cdt->fmeshes[24];
+ std::cout << "Polygon point count: " <<
fmesh->outer_loop.pnts_2d.size() << "\n";
+ fmesh->polygon_plot_2d(&fmesh->outer_loop, "oloop.plot3");
+ doplot = true;
+ }
+
if (!initialize_edge_segs(s_cdt, bseg)) {
std::cout << "Initialization failed for edge " <<
epoly_it->first << "\n";
}
+
+ if (doplot) {
+ cdt_mesh::cdt_mesh_t *fmesh = &s_cdt->fmeshes[24];
+ std::cout << "Polygon point count: " <<
fmesh->outer_loop.pnts_2d.size() << "\n";
+ fmesh->polygon_plot_2d(&fmesh->outer_loop, "oloop.plot3");
+ }
+
}
}
@@ -1447,6 +1476,14 @@
fmesh->f_id = face.m_face_index;
fmesh->m_bRev = face.m_bRev;
+ if (fmesh->f_id == 24) {
+ fmesh->outer_loop.print();
+ fmesh->polygon_plot_2d(&fmesh->outer_loop, "oloop.plot3");
+ }
+
+ if (!fmesh->outer_loop.closed()) {
+ std::cout << "Warning - loop not closed\n";
+ }
if (fmesh->cdt()) {
// List singularities
Modified: brlcad/trunk/src/libbrep/cdt_mesh.cpp
===================================================================
--- brlcad/trunk/src/libbrep/cdt_mesh.cpp 2019-09-05 13:16:14 UTC (rev
73834)
+++ brlcad/trunk/src/libbrep/cdt_mesh.cpp 2019-09-05 15:32:58 UTC (rev
73835)
@@ -3534,13 +3534,13 @@
cpolyedge_t *efirst = *(polygon->poly.begin());
cpolyedge_t *ecurr = NULL;
- ppnt.x = polygon->pnts_2d[efirst->v[0]].first;
- ppnt.y = polygon->pnts_2d[efirst->v[0]].second;
+ ppnt.x = m_pnts_2d[polygon->p2o[efirst->v[0]]].first;
+ ppnt.y = m_pnts_2d[polygon->p2o[efirst->v[0]]].second;
VSET(bnp, ppnt.x, ppnt.y, 0);
pdv_3move(plot_file, bnp);
VMINMAX(pmin, pmax, bnp);
- ppnt.x = polygon->pnts_2d[efirst->v[1]].first;
- ppnt.y = polygon->pnts_2d[efirst->v[1]].second;
+ ppnt.x = m_pnts_2d[polygon->p2o[efirst->v[1]]].first;
+ ppnt.y = m_pnts_2d[polygon->p2o[efirst->v[1]]].second;
VSET(bnp, ppnt.x, ppnt.y, 0);
pdv_3cont(plot_file, bnp);
VMINMAX(pmin, pmax, bnp);
@@ -3549,8 +3549,8 @@
while (ecurr != efirst && ecnt < polygon->poly.size()+1) {
ecnt++;
ecurr = (!ecurr) ? efirst->next : ecurr->next;
- ppnt.x = polygon->pnts_2d[polygon->p2o[ecurr->v[1]]].first;
- ppnt.y = polygon->pnts_2d[polygon->p2o[ecurr->v[1]]].second;
+ ppnt.x = m_pnts_2d[polygon->p2o[ecurr->v[1]]].first;
+ ppnt.y = m_pnts_2d[polygon->p2o[ecurr->v[1]]].second;
VSET(bnp, ppnt.x, ppnt.y, 0);
pdv_3cont(plot_file, bnp);
VMINMAX(pmin, pmax, bnp);
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