It was, indeed, just a problem of printing. Numbers are big so it didn't
fit in %d. I used %lld now and I got acceptable results.

After looking a bit over viewweight again, there are two concepts that I
would like to know more about.

How does hypersampling work, and what does the variable hypersample exactly
contain?

The region struct seems to have a line of sight value that is expressed in
percentage and is then converted to a factor. Its then multiplied together
with volume and density to obtain the final weight value. What exactly is
line of sight?

Mario.



2017-07-26 18:14 GMT+02:00 Christopher Sean Morrison <brl...@mac.com>:

>
>
> On Jul 26, 2017, at 10:59 AM, Mario Meissner <mr.rash....@gmail.com>
> wrote:
>
> Sean,
>
> Today I started modifying rtexample.c so that it simulates a ray crossing
> several regions (tried with the goblet example) and returning the mass it
> saw as it crossed each region. I assumed most stuff with predefined
> constant values for now.
>
>
> Sounds good!
>
> I wonder why the last result is negative? Segment distance seems to be the
> cause, although OutHIT dist = 10134 and InHIT dist = 10114, so my
> subtraction should be returning a positive result. Will keep working on it.
>
>
> At first glance, notice how the length and volume values are the same.
> This implies maybe a data type printing problem.  What are the types of
> those variables?  I suspect you need %zd or %lld instead of %d.  I would
> definitely figure out what is going on there before moving on.  You
> obviously need non-negative lengths. :)
>
> Cheers!
> Sean
>
>
>
> Mario.
>
> 2017-07-26 15:39 GMT+02:00 Christopher Sean Morrison <brl...@mac.com>:
>
>>
>> I think I can follow you, but I'm not sure how to put contributions
>> together. In the blade example you seem to be taking the mean value between
>> them. I'll assume that's the case.
>> Attached goes a simple box with two vectors. Should the density at point
>> a be 5?
>>
>>
>> Let’s see.  The gist of the original formula (which had a segment error
>> in the denominator, looking back) is to calculate the density contribution
>> from VA, the density contribution of VB, and then take their average (i.e.,
>> assume simple linear contributions from each).  Simple looking at your
>> gridding without any equations, we can see that:
>>
>> contrib(a, VA) is 3.5
>> contrib(b, VB) is 6.5
>>
>> Adding them up and taking the average is thus density 5.  So yes. ;)
>>
>> Likewise, would point b have a density of 6 then?
>>
>>
>> Yes.  8 + 4 / 2.
>>
>> I'm not sure if I calculated the contributions correctly either, but this
>> is the way that would make the most sense to me.
>>
>>
>> I think it’s as good a starting point as any and is relatively easy to
>> implement.
>>
>> That said, note that this method does have a potential flaw in that we’re
>> treating the density contributions uniformly when in reality, they should
>> probably be weighted by distance to the vector.
>>
>> In your example, they’re equidistant, so it works out.  But consider the
>> implication of box that is 100 times taller, for example.  Instead of 4 x
>> 4, it’s 4 x 400.  Point b should be a value far closer to 8 than 4,
>> certainly not 6.  That’s a problem that can be dealt with later, but
>> something to keep in mind.
>>
>> Cheers!
>> Sean
>>
>>
>> ------------------------------------------------------------
>> ------------------
>> Check out the vibrant tech community on one of the world's most
>> engaging tech sites, Slashdot.org! http://sdm.link/slashdot
>> _______________________________________________
>> BRL-CAD Developer mailing list
>> brlcad-devel@lists.sourceforge.net
>> https://lists.sourceforge.net/lists/listinfo/brlcad-devel
>>
>>
> <rtexample.c>
>
> ------------------------------------------------------------
> ------------------
> Check out the vibrant tech community on one of the world's most
> engaging tech sites, Slashdot.org! http://sdm.link/slashdot
>
> _______________________________________________
> BRL-CAD Developer mailing list
> brlcad-devel@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/brlcad-devel
>
>
> ------------------------------------------------------------
> ------------------
> Check out the vibrant tech community on one of the world's most
> engaging tech sites, Slashdot.org! http://sdm.link/slashdot
> _______________________________________________
> BRL-CAD Developer mailing list
> brlcad-devel@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/brlcad-devel
>
>
------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot
_______________________________________________
BRL-CAD Developer mailing list
brlcad-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/brlcad-devel

Reply via email to