Object with custom opacity gradient I would like to create an object with a custom gradient in opacity. 

I start with a curve (or more generally, a function of all three coordinates) that contains opacity values for the object I want to display. So for e.g. a cube extending from 0 to 1 in all three dimensions, that function would spit out the opacity value I want for each point in the cube. That way, I can model a cube with exponentially falling opacity or even an opacity that falls and rises  again when going away from the center.

Does anyone have an idea how to achieve this? 
Thank you!
I expect you want more than this.. but it's a start ..

In principle, you can just make the color or density of a volume absorption shader a function of your chosen texture space. Here, Object Space is used. Its origin is at the object's origin, and is measured in Blender units along the object's local axes. So this default cube has 0 a its center and runs from -1 to 1 in all directions.



The function here is e^ -(x^2 + y^2 + z^2)..



Instead of mapping to a gradient, you could put in a threshold, map to Alpha instead.. all sorts, it depends exactly what you want..