|
[Sponsors] |
octreeLine.getIntersections() causes compile error in OF 1.7.x |
|
LinkBack | Thread Tools | Search this Thread | Display Modes |
June 7, 2011, 17:03 |
octreeLine.getIntersections() causes compile error in OF 1.7.x
|
#1 |
New Member
Ryan Danks
Join Date: Jan 2011
Posts: 20
Rep Power: 15 |
Hi Foamers,
I'm trying to do some simple shadowing in openFOAM using ray-casting. Obviously, I'd rather use the built in octree classes to speed this process up rather than doing a brute force check of every patch face against the points I want to get shading data for. To this end I tried to impliment the octreeLine class with it's getIntersections() method, (http://foam.sourceforge.net/doc/Doxy...ctreeLine.html) to get a list of the cells intersected by a given line. I followed the exact same setup as shown on octreeLine's Doxygen page but whenever I compile I get all kinds of errors that look like they reside in the base OF code. (See attachment for the output) Has anyone successfully used this method or is this a bug in the code? Thanks! |
|
June 8, 2011, 09:55 |
Fixed it
|
#2 |
New Member
Ryan Danks
Join Date: Jan 2011
Posts: 20
Rep Power: 15 |
Hey everyone,
After a night's rest I found the problem. The pointHitSort class didn't have a " < " operator defined in pointHitSort.H, the std::sort algorithm needs this to sort the intersections the lineSearch finds. If you add the following to pointHitSort.H everything compiles fine... Code:
bool operator<(const pointHitSort& rhs) const { return inter_.distance() < rhs.inter().distance(); } |
|
July 19, 2011, 05:41 |
|
#3 |
New Member
Andreas Otto
Join Date: Sep 2009
Posts: 12
Rep Power: 16 |
Hi,
i also want to include some ray-casting in OF. Up to now I used some brute force searching with findcell. Have you been successful with using getintersections and is it possible to get some more information on your implementation (or at best some code snippets)? |
|
July 19, 2011, 08:25 |
|
#4 |
New Member
Ryan Danks
Join Date: Jan 2011
Posts: 20
Rep Power: 15 |
Hi Andreas,
Basically my implementation is the same as one outlined on the Doxygen page for the octreeLine class... Code:
octree<octreeDataFace> oc( .. ); octreeLine<octreeDataFace> lineSearch(oc, pStart, pEnd); while (lineSearch.getIntersection()) { const point& pt = lineSearch.hitInfo().hitPoint(); .. } There's not much more to it than that. The built in octree classes are quite fast and I've had some good results working with it. |
|
July 19, 2011, 09:28 |
|
#5 |
New Member
Andreas Otto
Join Date: Sep 2009
Posts: 12
Rep Power: 16 |
Hi Ryan,
thanks for the quick answer. How do you generate those octrees? Up to now I don't have any experience in working with octree-classes and there is merely any discussion on this topic in the forum. Thanks Andreas |
|
|
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
ATTN ALL: SOLUTON TO UDF COMPILE PROBLEM | Rizwan | Fluent UDF and Scheme Programming | 40 | March 18, 2018 06:05 |
star4ToFoam Segfault on Mac OS X 10.6.5 / OF 1.7.x | sushant | OpenFOAM Installation | 1 | December 25, 2010 19:38 |
PV3FoamReader compile error.... | PEM_GUY | OpenFOAM Installation | 6 | April 5, 2010 17:22 |
Error compile file udf | czfluent | Fluent UDF and Scheme Programming | 24 | September 26, 2009 13:24 |
Can someone PLEASE document the development version installation | bernd | OpenFOAM Installation | 76 | November 14, 2008 21:51 |