Open sethrj opened 5 months ago
Question for @paulromano : on-the-fly sense evaluation works for "point in volume" but might be difficult for "distance to boundary" in the case with internal surface crossings. To do that right now, we precalculate all the surfaces with the starting point, progressively move through nearest surfaces, flip the senses as we cross them, and evaluate "inside" at each one of those points. For the internal surface case, do you re-evaluate at every internal surface crossing? (I guess we could probably cache just a single surface state rather than all of them...?)
Based off some still unpublished but available research by @paulromano et al., there could be substantial savings in the way that we evaluate point-in-volume for initialization and surface crossing in ORANGE. (It's also used for distance-to-boundary for "complex" and "background" volumes since internal surface crossings have to be evaluated.)
I think we can break it down into the following steps:
InfixEvaluator
that applies a functionf(literal) -> bool
(whereliteral
usually means a surface index possibly with negation) and returns the evaulated result, using short circuit logic. (#1286)join
s with the opposite kind ofjoin
using DeMorgan's laws. (#1289)After using the infix evalutor and comparing performance, then we can replace the "precalculate surface senses" operation with "on-the-fly surface senses".