Revision: 57041
          http://sourceforge.net/p/brlcad/code/57041
Author:   starseeker
Date:     2013-08-21 19:56:23 +0000 (Wed, 21 Aug 2013)
Log Message:
-----------
orient the start and end points according to whether the edge is flipped 
according to the trim... still not sure I've got this right, but the 'closed 
curve' in 3 space actually did re-use the edge...

Modified Paths:
--------------
    brlcad/trunk/src/conv/step/g-step/ON_Brep.cpp

Modified: brlcad/trunk/src/conv/step/g-step/ON_Brep.cpp
===================================================================
--- brlcad/trunk/src/conv/step/g-step/ON_Brep.cpp       2013-08-21 18:40:00 UTC 
(rev 57040)
+++ brlcad/trunk/src/conv/step/g-step/ON_Brep.cpp       2013-08-21 19:56:23 UTC 
(rev 57041)
@@ -227,11 +227,16 @@
        oriented_edge->name_("''");
        SdaiEdge_curve *e_curve = (SdaiEdge_curve 
*)edge_curves->at(edge->EdgeCurveIndexOf());
        oriented_edge->edge_element_((SdaiEdge *)e_curve);
-       oriented_edge->edge_start_(((SdaiVertex 
*)vertex_pnts->at(edge->Vertex(0)->m_vertex_index)));
-       oriented_edge->edge_end_(((SdaiVertex 
*)vertex_pnts->at(edge->Vertex(1)->m_vertex_index)));
-       //TODO - do I need to check 3d points here?
+       if (trim->m_bRev3d) {
+           oriented_edge->edge_start_(((SdaiVertex 
*)vertex_pnts->at(edge->Vertex(1)->m_vertex_index)));
+           oriented_edge->edge_end_(((SdaiVertex 
*)vertex_pnts->at(edge->Vertex(0)->m_vertex_index)));
+           std::cout << "Verts " << edge->Vertex(1)->m_vertex_index << "," << 
edge->Vertex(0)->m_vertex_index << "\n";
+       } else {
+           oriented_edge->edge_start_(((SdaiVertex 
*)vertex_pnts->at(edge->Vertex(0)->m_vertex_index)));
+           oriented_edge->edge_end_(((SdaiVertex 
*)vertex_pnts->at(edge->Vertex(1)->m_vertex_index)));
+           std::cout << "Verts " << edge->Vertex(0)->m_vertex_index << "," << 
edge->Vertex(1)->m_vertex_index << "\n";
+       }
        oriented_edge->orientation_((Boolean)!trim->m_bRev3d);
-       if (edge->EdgeCurveOf()->IsClosed()) oriented_edge->orientation_(BTrue);
        instance_list->Append(new_oriented_edge, completeSE);
        oriented_edges->push_back(new_oriented_edge);
        i = oriented_edges->size() - 1;
@@ -576,8 +581,6 @@
        // output.
        SdaiPath *e_loop_path = (SdaiPath *)edge_loops.at(i)->GetNextMiEntity();
        for (int l = 0; l < loop->TrimCount(); ++l) {
-           // FIXME - trims in a loop will not necessarily map back uniquely 
to edge curves for
-           // a given loop.  The Add_Edge approach is inadequate - need to 
rethink this
            int trim_edge = Add_Edge(loop->Trim(l), registry, instance_list, 
&oriented_edges, &edge_curves, &vertex_pnts);
            if (trim_edge >= 0)
                e_loop_path->edge_list_()->AddNode(new 
EntityNode((SDAI_Application_instance *)(oriented_edges.at(trim_edge))));

This was sent by the SourceForge.net collaborative development platform, the 
world's largest Open Source development site.


------------------------------------------------------------------------------
Introducing Performance Central, a new site from SourceForge and 
AppDynamics. Performance Central is your source for news, insights, 
analysis and resources for efficient Application Performance Management. 
Visit us today!
http://pubads.g.doubleclick.net/gampad/clk?id=48897511&iu=/4140/ostg.clktrk
_______________________________________________
BRL-CAD Source Commits mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/brlcad-commits

Reply via email to