> I believe that users could input the density properties of the material into 
> the properties file by writing the coefficients of the function in some 
> predefined way. For example, the function I used in my example could be an 
> entry in the file like this:   3; 2; 3; -5

But what function and how would it be specified?  Would it be obvious or 
intuitive how many arguments are required or something dynamic?

> I imagine that one way users can input the information though a helper-script 
> is to indicate specific densities at different points in the body, and then 
> indicating if the change is linear, quadratic... etc, for each direction.

Okay!  That is getting somewhere..  The actual input method (e.g. Script or 
commands or whatever) aren't as important as the "what" being specified.
> Example: a cylinder which is dense in the bottom and not so much in the top, 
> but constant in the horizontal plane. We could tell the script something 
> like: bottom is 30 g/cm3, and top is 10g/cm3. As we go from bottom to top, 
> density changes in a linear fashion. If we move in the horizontal plane, 
> there is no change.

So that sounds like test case #3 perhaps.  Can you write all three up as a 
(language agnostic) statement?  For example, specifying a radial property on a 
sphere might look like something like this in quasi-pseudocode:

make sphere
set sphere density 0 @ 0,0,0 linear 1 @ 1,0,0 

> However, one problem I see here is that, depending where the object is placed 
> and what it's dimensions are, the densities that it ends up having are 
> completely different. If one models a density function for a specific sword, 
> It would not be possible to use the same material for other swords of 
> different shapes and sizes. May it be better to define the function as 
> RELATIVE to the position of the body?

All entities have a local reference system that I think the points would/could 
be relative to by specification.  See the V parameter on most primitives, or 
some other position that is considered their key point (origin).  They also 
have a bounding box and natural orientation.

> For example, 0,0,0 for the bottom front left of the object, and 1,1,1 for the 
> top back right? What are your thoughts on this?

Check out the Mged tutorial series, and look at the appendix at the end for a 
list of primitives.  Loves keep this simple for now just considering a box, 
cylinder, or sphere.

> To the question of how we would be able to see the different density values 
> as we go through the object: No matter from which direction and in which 
> point of the object we go though, in the end the ray is a line in a three 
> dimensional space. We just need to join the two equations that define the ray 
> with the density function, and we will obtain a function that returns the 
> density for each point of the ray that is inside the region. This function is 
> also single-variable, since we only need to know the distance to the origin 
> of the ray to choose a point (thus, geometry-agnostic, as you mentioned?). Is 
> this what you meant?
It is exactly.  What that means on a box and how to handle it is where is gets 
a bit tricky.  We need a concrete example.

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

Reply via email to