Issue with multiple trimmed surfaces

Anyway … since you asked for it I’m posting the salvation (or the torture ?) here instead on a PM basis (because maybe others could find it useful). (141.1 KB)
Brep_ReflectionsRefractions_V1.3dm (2.2 MB)

Info panel informs you about some basic stuff:

Some tips:

  1. You can assign different R values for any valid solid Brep present in the bList. geomRList samples these values. If is empty (as delivered) the 1.31 is assosiated to every solid. If geomRList has less values than the solids present then these are consumed in order and the last is assosiated with the remaining solids. If overrideR is != 0 then that value is assosiated with every solid. You can add any R value (but avoid R > 2.5).
  2. The total Ray length (the length of the polyline, that is) is managed via the RL parameter. If some segment length is < document tolerance => segment is discarded.
  3. The max hits is managed via the reflections parameter (should be named: hits or bounces, but anyway). So if you see some weird results increase that limit.
  4. 2 Modes are available: Reflection or Refraction (solids) + Reflection (non solids). If a given ray segment can’t escape then a Reflection is made.
  5. Rays are either grid like or radial. They are made internally (that’s not very user friendly … I could add a few lines more in order to accept any user collection).
  6. The critical angle is auto managed internally (acc the angleIn, the state of ray (in/out) and the R value per Brep).
  7. Connectivity (as explained above) is also made: what Brep caused the bounce per node (ordered) per polyline ray.
  8. R values are in fact complex numbers (real + imaginary) … but … let’s deal with the entry level case first.
  9. Nurbs type of Breps yield bigger Elapsed times (for obvious reasons).
  10. Use the best quality of espresso (and cigars) when playing with the thing.

All in all: you can pretend that this is some kind of add-on … or … learn C#, double click it and discover the big rabbit hole called coding. But why bother? in a few years from now an AI computer could do it for you (rendering you obsolete - no pain no gain).

1 Like