Bases: Rtrace
singleton wrapper for c++ raytraverse.crenderer.cRtrace class
this class sets default arguments, helps with initialization and setting cpu limits of the cRtrace instance. see raytraverse.crenderer.cRtrace for more details.
rayargs (str, optional) – argument string (options and flags only) raises ValueError if arguments are not recognized by cRtrace.
scene (str, optional) – path to octree
nproc (int, optional) – if None, sets nproc to cpu count, or the RAYTRAVERSE_PROC_CAP environment variable
default_args (bool, optional) – if True, prepend default args to rayargs parameter
direct (bool, optional) – if True use Rtrace.directargs in place of default (also if True, sets default_args to True.
Examples
Basic Initialization and call:
r = renderer.Rtrace(args, scene)
ans = r(vecs)
# ans.shape -> (vecs.shape[0], 1)
If rayargs include cache files (ambient cache or photon map) be careful with updating sources. If you are going to swap sources, update the arguments as well with the new paths:
r = renderer.Rtrace(args, scene)
r.set_args(args.replace("temp.amb", "temp2.amb"))
r.load_source(srcdef)
Note that if you are using ambient caching, you must give an ambient file, because without a file ambient values are not shared across processes or successive calls to the instance.
craytraverse.crenderer.cRtrace
prepare arguments to call engine instance initialization
args (str) – rendering options
nproc (int, optional) – cpu limit
return default arguments of the class
reset engine instance and unset associated attributes
returns source information
sources (np.array) – x,y,z,v,a distant: direction, view angle, solid angle not distant: location, max radius, area
distant (np.arrary) – booleans, true if source type is distant
Bases: Rcontrib
singleton wrapper for c++ raytrraverse.crenderer.cRcontrib class
this class sets default arguments, helps with initialization and setting cpu limits of the cRcontrib instance. see raytrraverse.crenderer.cRcontrib for more details.
rayargs (str, optional) – argument string (options and flags only) raises ValueError if arguments are not recognized by cRtrace.
scene (str, optional) – path to octree
nproc (int, optional) – if None, sets nproc to cpu count, or the RAYTRAVERSE_PROC_CAP environment variable
skyres (int, optional) – resolution of sky patches (sqrt(patches / hemisphere)). So if skyres=18, each patch will be 100 sq. degrees (0.03046174197 steradians) and there will be 18 * 18 = 324 sky patches.
modname (str, optional) – passed the -m option of cRcontrib initialization
ground (bool, optional) – if True include a ground source (included as a final bin)
default_args (bool, optional) – if True, prepend default args to rayargs parameter
adpatch (int, optional) – when using default_args, ad is set to this times srcn
Examples
Basic Initialization and call:
r = renderer.Rcontrib(args, scene)
ans = r(vecs)
# ans.shape -> (vecs.shape[0], 325)
prepare arguments to call engine instance initialization
args (str) – rendering options
nproc (int, optional) – cpu limit
set class attributes for proper argument initialization
scene (str, optional) – path to octree
ground (bool, optional) – if True include a ground source (included as a final bin)
modname (str, optional) – passed the -m option of cRcontrib initialization
skyres (float, optional) – resolution of sky patches (sqrt(patches / hemisphere)). So if skyres=10, each patch will be 100 sq. degrees (0.03046174197 steradians) and there will be 18 * 18 = 324 sky patches.
scene – path to scene with added sky definition
str
construct default arguments