Raytracing BRep API

Hello, I want to know some fundamentals of how OCCT raytrace the BRep. For exmaple, raytracing triangle meshes is well understood and the most basic operation is ray-triangle intersect. How does OCCT handles ray-surface intersection with primitives like NURBS? Can someone point out where to look at?
Thanks you very mcuh.

Kirill Gavrilov's picture

If you are talking about TKOpenGl and it's Ray-Tracing engine, then it doesn't render NURBS, it renders triangulation (the same as prepared from TopoDS_Shape for a usual rasterization renderer).

Theoretically Ray-Tracing renderer might be implemented quite efficiently with some simple analytical surfaces like spheres and cones (and CSG), but I have some doubts about hypothetical rendering performance of arbitrary complex NURBS, and considering arbitrary boundaries.

As for Modeling component, it does implement some algorithms for ray/surface intersection, and surface adaptors like Adaptor3d_Surface cache polynomial coefficients of BSpline surfaces for better performance.

cqd123123's picture

"As for Modeling component, it does implement some algorithms for ray/surface intersection". So I found the class GeomAPI_IntCS can compute the intersection between a curve and a surface. Is that what you are referring to? Since curves are extension of straight lines. Does it implement some root finding algorithms to find the intersection? For example, in this work: https://citeseerx.ist.psu.edu/viewdoc/download?doi=10.1.1.74.307&rep=rep... Thank you very much.