Thank you for the comments daniel. I have made most of the changes you had
asked me to.(eg. fastf_t instead of floats, removal of unnecessary parts of
code etc)
I had included the <=0.0 in the comparison as i got "comparing floating
point with == or != is unsafe" error otherwise.
Also, I think i misunderstood one of our earlier discussions due to which I
included the voxel array for all voxels. I will rectify that error too so
that only the information of a single ray is stored in memory at any time.
Regards,
On Thu, Jun 14, 2012 at 1:45 PM, Daniel Roßberg <
[email protected]> wrote:
> Anurag,
>
> some thoughts about your g-voxel:
>
> - Why do you use float instead of fastf_t?
> - You could do the " - 1.0" in lines 96 and 97 at once.
> - The expression in line 102 can never be smaller than 0.
> You should test "== 0.0" there. This prevents the section from
> having 0 length but it could be still very small. The definition of
> "small" is let to the caller, e.g. by having a threshold.
> And maybe you should use fmod(~, 1.) here to clarify your intention.
> - "numVoxel[1] * numVoxel[2]" is allways the same big number and i
> think you don't need it there. (See line 238.)
> - rayInfo should carry more information, e.g. the regions hit.
> - You shouldn't allocate voxelArray for all voxels. E.g. for a car 4
> x 2 x 1.5 m^3 with your voxel size of 1 mm and your current float
> values you would need 45 GByte to store it. If you store only one ray
> with fastf_t values you need only 32 kByte. To do this you have to
> put the fprintf()s inside the j-loop.
>
> Daniel
>
>
> ------------------------------------------------------------------------------
> Live Security Virtual Conference
> Exclusive live event will cover all the ways today's security and
> threat landscape has changed and how IT managers can respond. Discussions
> will include endpoint security, mobile security and the latest in malware
> threats. http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/
> _______________________________________________
> BRL-CAD Developer mailing list
> [email protected]
> https://lists.sourceforge.net/lists/listinfo/brlcad-devel
>
--
Anurag Murty
------------------------------------------------------------------------------
Live Security Virtual Conference
Exclusive live event will cover all the ways today's security and
threat landscape has changed and how IT managers can respond. Discussions
will include endpoint security, mobile security and the latest in malware
threats. http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/
_______________________________________________
BRL-CAD Developer mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/brlcad-devel