Revision: 41296
          http://brlcad.svn.sourceforge.net/brlcad/?rev=41296&view=rev
Author:   indianlarry
Date:     2010-11-09 11:11:38 +0000 (Tue, 09 Nov 2010)

Log Message:
-----------
Fixed under sized arrays used in reporting intersects in four corner solver. 
This under size was causing stack corruption issues when a subdivision surface 
was hit more than twice. Added definition MAX_BREP_SUBDIVISION_INTERSECTS and 
currently set to 5, four corners and center are currently being tested for 
possible intersects. The fact that we are getting more than two intersects 
means that we need to check our near flat criteria for the subdivision but 
arrays still need to be dimensioned to max possible intersects.

Modified Paths:
--------------
    brlcad/trunk/src/librt/primitives/brep/brep.cpp

Modified: brlcad/trunk/src/librt/primitives/brep/brep.cpp
===================================================================
--- brlcad/trunk/src/librt/primitives/brep/brep.cpp     2010-11-09 11:02:26 UTC 
(rev 41295)
+++ brlcad/trunk/src/librt/primitives/brep/brep.cpp     2010-11-09 11:11:38 UTC 
(rev 41296)
@@ -1121,13 +1121,13 @@
     return false;
 }
 
-
+#define MAX_BREP_SUBDIVISION_INTERSECTS 5
 int
-utah_brep_intersect_test(const BBNode* sbv, const ON_BrepFace* face, const 
ON_Surface* surf, pt2d_t uv, ON_Ray& ray, HitList& hits)
+utah_brep_intersect_test(const BBNode* sbv, const ON_BrepFace* face, const 
ON_Surface* surf, pt2d_t& uv, ON_Ray& ray, HitList& hits)
 {
-    ON_3dVector N[2];
-    double t[2];
-    ON_2dPoint ouv[2];
+    ON_3dVector N[MAX_BREP_SUBDIVISION_INTERSECTS];
+    double t[MAX_BREP_SUBDIVISION_INTERSECTS];
+    ON_2dPoint ouv[MAX_BREP_SUBDIVISION_INTERSECTS];
     int found = BREP_INTERSECT_ROOT_DIVERGED;
     bool converged = false;
     int numhits;


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

------------------------------------------------------------------------------
The Next 800 Companies to Lead America's Growth: New Video Whitepaper
David G. Thomson, author of the best-selling book "Blueprint to a 
Billion" shares his insights and actions to help propel your 
business during the next growth cycle. Listen Now!
http://p.sf.net/sfu/SAP-dev2dev
_______________________________________________
BRL-CAD Source Commits mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/brlcad-commits

Reply via email to