> On Jul 18, 2017, at 6:01 AM, Mario Meissner <mr.rash....@gmail.com> wrote: > > Hereby goes blade with a box (arb8) on top, intersected with with an arb6 > that narrows towards the tip, and another arb6 added below and also > intersected with the other arb6, that makes the bottom of the blade sharp. If > we now also manage to model that curve, it should look pretty similar to the > Distal Taper.
That looks much better! It’s possible that flattened ellipsoids, intersected, will give a good result for the taper, but that looks complex enough to serve as a test case. > thank you for the extensive explanation, and sorry for the misunderstanding. No need to apologize. > • During ray-tracing, the calling code prepares the application and > ray-tracing instance and shoots rays at the geometry. The library code > containing the hit, miss and other functions handles the information it > receives when a ray hits geometry. Yes. > • The hit function receives a set of partitions in a circular linked > list, (taken from the example:) "each [partition] describing one in and out > segment of one region for each region encountered". So each partition is > basically a set of segments, and all partitions together tell us all the > stuff the ray went through. I assume there are many different "partitions" > because we put the segments of different regions in different partitions, but > also partitions can have more than one segment because we can cross a region > more than once with a ray. Yes. Good understanding too … this is a common stumbling block. > • In rtweight specifically, each ray gets fired some distance away from > the other rays, in a grid. Thus we can think of the rays as a square tube, > that has 2mm side length for the square and goes through the geometry (I > assume these are the "cells" that appear in the code of viewweight.c) All the > volume captured inside will be handled by one call of the hit function. > Looping through all the partitions and obtaining the volume we crossed, and > the density assigned to the region, we compute the mass for each partition > and store it in some data structure (which seems to be this "datapoint" > thing). Finally we just need to add it all up and obtain our total mass. Yes except that the grid cell size isn’t necessarily 2mm. It’s configurable and by default is derived from a 512x512 grid centered on the object’s bounding box. > • In order to support heterogeneous densities we need a representation > that allows us to provide the necessary information to the hit function, who > will query our representation to obtain the density of the in and out points, > and possibly the rate of change between the two. We then > integrate/interpolate to obtain the "average" density of our segment, so that > we can continue the same way we did in the point above. Yes! There are certainly other possibilities, but that will be a minimal set of code changes, achievable in the project timeframe, and easy to validate. > • I guess the biggest "difficulty" here is to define a proper way of > telling the hit function what this rate of change between the points is. Also > storing a proper definition of the material density that allows for this > information to be queried easily. This is why storing functions and taking > derivatives is not a good idea. It’s not that it’s not a good idea, it’s fine … but then we need to talk what that code is and looks like. I was imagining that you would end up with a functional description of the density change. In code, though, most density functions I can think of are described by point values and interpolation methods (i.e., linear for now). > Instead we may want to store vectors that tell the rate of change in several > directions. Density at a specific point could be retrieved by combining > vectors and the rate of change between two arbitrary points can be obtained > through the vectors as well. Can you describe an example? Describing rate of change might be difficult for a user if that’s not commonly available information. For our knife example, I can easily look up the density for hardened and unhardened steel and describe a transition between them over some distance that would likely be based in actual measurements. Whether it transitions fast (cubic) or slow (linear) or in steps (discontinuous) becomes a specification. 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