|
 |
|
|
I got some really bad triangulation errors triangulating a point cloud NOT as polygon compiling with VC6.
The Problem is the mInd in HGrdPnt. You are not always setting the Index through rIndex() properly. In Debug-Mode everything works fine because all int are initialized the same, which was apparently enough. In Release Mode everything is uninitialized and occasinally the uninitialized int's were set to an valid index. So mInd schould be initialized with INT_MIN or something similar, so you can determine which triangles are valid in release mode, too. just like this:
if ( HgrdPolygon->mtabCell[i].Index(0) < NrOfPoints && HgrdPolygon->mtabCell[i].Index(1) < NrOfPoints && HgrdPolygon->mtabCell[i].Index(2) < NrOfPoints )
I hope anyone understands what I am trying to tell. Its explained a bit confused...
|
| Sign In·View Thread·PermaLink | |
|
|
|
 |
|
|
Hi!
At first glance this piece of code looks great. However after a day of testing, debugging etc, I have but one question.
I modified the main function acording to the instructions. My changes are shown below:
int main( int argc, char *argv[]) { try { HPolygon poly;
/* if ( argc != 3 ) { printf ( "usage: hgrd [input file with points] [output tecplot file]\n"); return 1; }*/ poly.Init( "data/ci_hynet.pnt"); poly.Triangulate(); poly.WriteTEC( "data/output.dat"); } catch ( Except *pe) { ASSERT( pe); TRACE_EXCEPTION( *pe); TRACE_TO_STDERR( *pe); delete pe; }
return 0; }
Perhaps im just doing it wrong? In any case, the feedback in cmd window is as follows: "Reading file: data/ci_hynet.pnt" "Triangulation started"
And nothing happens.. What am I doing wrong?
I did try several more severe modifications, and had several obstacles in my way. Got it to work somehow, but still got the wrong output.
|
| Sign In·View Thread·PermaLink | 3.00/5 (1 vote) |
|
|
|
 |
|
|
I am getting similar errors to those described in an earlier post about VS2005 errors:
src/hgrid.h:99: error: default argument for parameter of type ‘const std::_List_iterator&’ has type ‘int’ src/hgrid.h: In member function ‘void HGrdTri::DumpTri()’: src/hgrid.h:193: error: no match for ‘operator!=’ in ‘HGrdTri::Cell(((const MGInt&)((const MGInt*)(&0)))) != 0’ /usr/lib/gcc/i386-redhat-linux/4.1.1/../../../../include/c++/4.1.1/bits/stl_list.h:173: note: candidates are: bool std::_List_iterator<_Tp>::operator!=(const std::_List_iterator<_Tp>&) const [with _Tp = HGrdTri*] ...
Is there any fix for this? (The fix for VS2005 doesn't work here.)
Thanks!
|
| Sign In·View Thread·PermaLink | 5.00/5 (1 vote) |
|
|
|
 |
|
|
hey i was wondering if u could help me get started up for triangulation . i am trying to implement triangulation as a project in my college . but i dont have any thing to study or no refrence algorithm . i would be greatful if u could help me . i dont want u to spoon feed me but just point me in the right direction .. thanks .
pp
|
| Sign In·View Thread·PermaLink | |
|
|
|
 |
|
|
The code compiles fine in Debug mode, but when compiling in Release mode I get the following:
hgrid.h(99) : error C2440: 'default argument' : cannot convert from 'int' to 'const HGrdTri::IterGCell &' Reason: cannot convert from 'int' to 'const HGrdTri::IterGCell' No constructor could take the source type, or constructor overload resolution was ambiguous
The line corresponding to the error is "IterGCell NextCell( HFroSeg *pseg, const IterGCell& iclprv=NULL);"
If I remove the =NULL part it sets off a bunch of other errors all concerned with either default arguments or comparisons using NULL.
If I just run in debug mode, it will get to "if ( Cell(0) != NULL)" in HGridTri::NextCell and throw an error. "Debug Assertion Failed... [filepath]\list... Line: 309... Expression: list iterators incompatable"
Ran the included demo in debug mode (without following it with breakpoints like above) and it bailed and wrote a blank trace.txt.
Any ideas?
-- modified at 19:58 Tuesday 24th April, 2007
|
| Sign In·View Thread·PermaLink | 2.00/5 (1 vote) |
|
|
|
 |
|
|
At this moment I don't see an easy and fast solution. I think that it can be solved by adding to the list (e.g. at the begining of the list) a dummy invalid element. The iterator to this element should be then used instead of NULL.
|
| Sign In·View Thread·PermaLink | 2.00/5 (3 votes) |
|
|
|
 |
|
|
Hello,
Normally, using NULL for iterators seems not to be allowed.
Nevertheless, the solution for compiling is to add :
//See http://forums.microsoft.com/MSDN/ShowPost.aspx?PostID=1413506&SiteId=1 #ifndef _HAS_ITERATOR_DEBUGGING #define _HAS_ITERATOR_DEBUGGING 0 #endif #ifndef _SECURE_SCL #define _SECURE_SCL 0 #endif
in the beginning of stldecl.h file (just after #ifndef __STLDECL_H__ #define __STLDECL_H__ and before #include )
Theses 6 lines allows compiling to work fine.
Regards,
DevGisRX
|
| Sign In·View Thread·PermaLink | |
|
|
|
 |
|
|
Hello,
Normally, using NULL for iterators seems not to be allowed.
Nevertheless, the solution for compiling is to add :
//See http://forums.microsoft.com/MSDN/ShowPost.aspx?PostID=1413506&SiteId=1 #ifndef _HAS_ITERATOR_DEBUGGING #define _HAS_ITERATOR_DEBUGGING 0 #endif #ifndef _SECURE_SCL #define _SECURE_SCL 0 #endif
in the beginning of stldecl.h file (just after #ifndef __STLDECL_H__ #define __STLDECL_H__ and before #include )
Theses 6 lines allows compiling to work fine.
Regards,
DevGisRX
|
| Sign In·View Thread·PermaLink | 1.00/5 (1 vote) |
|
|
|
 |
|
|
Hi! Nice code. Can I modify algorithm to make a volume fragmentaion (3d) with tetrahedron as simplex element?
|
| Sign In·View Thread·PermaLink | 1.50/5 (2 votes) |
|
|
|
 |
|
|
Sure, you can but it will be IMHO much easier to write this from scratch and even then it will be not easy...
|
| Sign In·View Thread·PermaLink | 1.00/5 (1 vote) |
|
|
|
 |
|
|
 |
|
|
I don't know what exactly you mean but I guess that you want to insert additional points laying inside a domain. To do this you should store the points inside a collection CollGPnt and then add them by calling InsertPointIntoMesh(...). Adding inner points should be done in Generate function after FlagOuterTris(). Hope it helps and I have not forgotten anything essential...
|
| Sign In·View Thread·PermaLink | 2.00/5 (1 vote) |
|
|
|
 |
|
|
Hi I have taken the hgrd_demo and when I compiled it in Microsoft visual c++ 6.0 I experienced with many error messages. All the errors are from the head file vect.h . I appreciate if you give the solution of the problem. thanks
|
| Sign In·View Thread·PermaLink | 1.86/5 (5 votes) |
|
|
|
 |
|
|
Hi have just found a slight problem where the code asserts due to a shared edge. I'm looking into it but if anyone else wants to have a go also, here is the test file I used
co_lin_squares.pnt
2 5 0 0 10 0 10 10 0 10 0 0 5 10 2 16 2 16 8 10 8 10 2
The best way to fix it that I have found so far is to split the longer co-linear line segment into 3 sections giving the following file
2 7 0 0 10 0 10 2 <--- These two points 10 8 <--- are duplicates... 10 10 0 10 0 0 5 10 2 <-- ...of these two 16 2 16 8 10 8 <-- 10 2
Looks like co-linear points may have to be checked for and added to automatically split up line segments.
|
| Sign In·View Thread·PermaLink | 1.75/5 (4 votes) |
|
|
|
 |
|
|
Nice bit of code. Too bad GPL renders it fairly useless to those of us who like to make money with our code .
|
| Sign In·View Thread·PermaLink | 5.00/5 (3 votes) |
|
|
|
 |
|
|
I, too, was sad to see that this is GPL.
Changing the license to be LGPL, rather than GPL would probably make it more palatable to people who are interested in using it in their own projects. Just a suggestion
|
| Sign In·View Thread·PermaLink | |
|
|
|
 |
|
|
 |
|
|
Hi So what news for the LGPL Licence? because it's a very nice code and il will be interesting for me if it is LGPL
|
| Sign In·View Thread·PermaLink | |
|
|
|
 |
|
|
 |
|
|
 |
|
|
 |
|
|
 |
|
|
 |
|
|
 |
|
|
Dear _qqq_,
Can you please add a section to your article on a practicle use of tringulation (at least just for noobs like me). I know that this is how textures are applied to compex 3D models but I'm also interested in 2D uses. Stas.
|
| Sign In·View Thread·PermaLink | 1.67/5 (2 votes) |
|
|
|
 |