intersect.ray_tracer green
- Layer
- 32
- Upstream lines
- 1,246
- Functions
- 13
- Rust module
intersect::ray_tracer
Status history
- todo 1,246 lines
- partial 1,246 lines
- green 1,246 lines
Source: crates/solidcore/src/intersect/ray_tracer.rs
Upstream: source/SMLib/inc/SmRayTracer.h, source/SMLib/src/SmRayTracer.cpp
Port-plan notes
These notes preserve historical port measurements and limitations, not current CI results.
partial: 421 cases, 310 pass, 0 fail, 111 deferred (surface.surface_p8 SmSurface::LocalLineIntersect x108, surface.surface_p6 SmSurface::CalculateContinuities x3 via the surface cache); surface_leaf matches upstream SE on degenerate patches (2 fixtures); SmSurface::EvaluateNormalSection wired to surface.surface_p3 (no case reaches it yet past the deferrals); UNPORTED stubs also for SmFace::PointClassify (query.face_p2), poly types (query.poly); CO-PORTED in intersect.ray_tracer (PR #48): SmSurfaceGridElement data members -> geom::grid::SurfaceGridElement (+ Grid::add_surface_element), SmRayRenderer/SmLightSource -> intersect::ray_tracer; 13 fns; largest: SmLSI3LocalSolver::LocalSolve, SmRayTracer::FireRay, sm_FindAdditionalTangentGuess, sm_FindPolyHit; cycle back-edges (call into later units; stub or co-port): query.poly(7), topology.topology(2), query.face_p2(1); unit-SCC #22 (220 units); 317 upstream test entry points reach this unit Re-run (PR #118, LocalLineIntersect wired by surface.surface_p8): 421 cases, 415 pass, 6 deferred (surface.surface_p2). LocalSolve sets the solution node marker as upstream does. GREEN (wire: AddSurfaceToGrid): RayTracer::add_surface_to_grid builds the surface cache (nodes hold the surface by its tracer index) and expands it with Grid::expand_hierarchy_with, reading each leaf's patch data, pseudo box and polar box from the cache; the shim now runs the real SmRayTracer::AddSurfaceToGrid and the record compares status, leaf count and per leaf the domain, box, mid-point data, pseudo box and polar box (a polar box that stayed uninitialised was caught this way); the generator puts add_surface before the rays; 421 cases, 421 pass, 0 fail, 0 deferred, max_rel_err 0e0, no absolute floors; 6000 extra seeds clean. SurfaceGridElement::init / from_leaf_data (formerly surface_leaf) and Grid::expand_hierarchy (now taking the surface cache) moved to geom::grid with the geom.grid wiring (geom.grid green); add_surface_to_grid calls Grid::expand_hierarchy; unit numbers unchanged: 421 cases, 421 pass, 0 deferred, max_rel_err 0e0. WIRED (PR #1273, query.poly back-edges): AddPolyBrepToGrid (SmPolyBrep::Notify SM_NO_PRE_EDIT, the poly B-rep SmBrepCache, one polygon element per surface-tree leaf) and sm_FindPolyHit (sphere reject, LinePlaneIntersect, PointInPolygon 3D, hit-any exit, parent walk as a bounded loop); FireRay's polygon branch now fills the solution as upstream (SM_ST_SINGLE_VALUE, t, BIG uv, point, face normal, the face in objects 0 and 1; it only moved the hit parameter before) and the per-context mark locks are a per-ray tested-face set. The shim builds real SmPolyBreps (add_poly_brep op; the solution record names poly faces); fixtures/intersect.ray_tracer/poly_breps.json (harness/fixturegen/ray_tracer_poly.py): upstream smTessTest test 10 (Extrusion.pbp, 296 faces) and 11 built cases (holes, notch, coincident faces in two poly B-reps, a face on an inner tree node, poly and surface, normals, degenerate face, expansions, render with shadows); the generator appends poly B-reps to about a third of the cases. No UNPORTED stubs left in this unit.
Goldens
This is committed inventory, not a runtime result or a correctness proof. A golden records what solidcore produced when blessed. Current results require the canonical CI gate, not these counts.
- Golden records
- 433
- Stored error outcomes
- 0
- Stored deferrals
- 0
- Stored harness rejections
- 0
- Known-failure entries
- 0
Metadata counts describe fields in the stored records; they are not passes or live failures.
Source at f9704ee3b:
golden JSONL ·
known-failure list.
Dependencies
Depends on: geom.context green geom.extent1d green geom.extent2d green geom.extent3d green geom.geom_utility_p1 green geom.grid green geom.object green geom.pseudo_box green geom.vector2d green geom.vector3d green intersect.point_class green surface.surface_p2 partial
Soft dependencies: curve.curve_p2 green curve.line green geom.polar_box green geom.solution_array green geom.tol green geom.tree green surface.surface_cache_p3 green surface.surface_p1 green surface.surface_p3 green surface.surface_p7 green surface.surface_p8 green
Dependents: blend.hcr green
Soft dependents: none
Upstream functions
| Upstream function | Defined at | Lines | Rust (from the file header) |
|---|---|---|---|
SmLightSource::~SmLightSource | SmRayTracer.h:68 | 1 | Drop (implicit) |
SmRayTracer::SetSolverTolerance | SmRayTracer.h:166 | 1 | [RayTracer::set_solver_tolerance] |
sm_LinePlaneIntersect | SmRayTracer.cpp:54 | 28 | line_plane_intersect (private) |
SmRayRenderer::~SmRayRenderer | SmRayTracer.cpp:114 | 15 | Drop (implicit) |
sm_IsPointValid | SmRayTracer.cpp:435 | 51 | is_point_valid (private) |
sm_ConvertToParameterDelta | SmRayTracer.cpp:541 | 11 | convert_to_parameter_delta (private) |
sm_FindAdditionalTangentGuess | SmRayTracer.cpp:558 | 201 | find_additional_tangent_guess (private) |
SmRayTracer::SmRayTracer | SmRayTracer.cpp:768 | 19 | [RayTracer], [RayTracer::new] |
SmRayTracer::~SmRayTracer | SmRayTracer.cpp:793 | 6 | Drop (implicit) |
SmLSI3LocalSolver::LocalSolve | SmRayTracer.cpp:841 | 386 | [Lsi3LocalSolver::local_solve], [LocalSolveResult] |
sm_FindPolyHit | SmRayTracer.cpp:1234 | 90 | find_poly_hit (private) |
SmRayTracer::FireRay | SmRayTracer.cpp:1332 | 369 | [RayTracer::fire_ray], [RayHit] |
SmRayTracer::AddSurfaceToGrid | SmRayTracer.cpp:1711 | 68 | [RayTracer::add_surface_to_grid], [RayTracer::add_surface_with_bbox], [RayTracer::add_surface_with_fetched_cache] |
Module file-header table (22 rows)
| Rust | Upstream |
|---|---|
[LightSource], [LightSource::new] | SmLightSource, its constructor |
Drop (implicit) | ~SmLightSource |
[Lsi3LocalSolver], [Lsi3LocalSolver::new] | SmLSI3LocalSolver, its constructors |
[Lsi3LocalSolver::local_solve], [LocalSolveResult] | SmLSI3LocalSolver::LocalSolve |
[RayTracer], [RayTracer::new] | SmRayTracer, SmRayTracer::SmRayTracer |
Drop (implicit) | ~SmRayTracer |
[RayTracer::set_solver_tolerance] | SmRayTracer::SetSolverTolerance |
[RayTracer::fire_ray], [RayHit] | SmRayTracer::FireRay |
[RayTracer::add_surface_to_grid], [RayTracer::add_surface_with_bbox], [RayTracer::add_surface_with_fetched_cache] | SmRayTracer::AddSurfaceToGrid |
[RayTracer::add_poly_brep_to_grid] | SmRayTracer::AddPolyBrepToGrid |
[RayTracer::poly_brep], [RayTracer::poly_brep_count] | m_sPolyBreps |
[RayRenderer], [RayRenderer::new] | SmRayRenderer, SmRayRenderer::SmRayRenderer |
Drop (implicit) | ~SmRayRenderer |
[RayRenderer::do_render], [RayRenderer::render_pixel], [RayRenderer::render_ray] | SmRayRenderer::DoRender, RenderPixel, RenderRay |
[RayRenderer::set_sample_rate], [RayRenderer::add_light_source], [RayRenderer::pixels_shaded] | SetSampleRate, AddLightSource, GetPixelsShaded |
[RayObject] | the SmObject* of SmSolution::m_apObjects |
[SurfaceGridElement::from_leaf_data], [SurfaceGridElement::init] | SmSurfaceGridElement::Init (ported in geom::grid) |
line_plane_intersect (private) | sm_LinePlaneIntersect |
is_point_valid (private) | sm_IsPointValid |
convert_to_parameter_delta (private) | sm_ConvertToParameterDelta |
find_additional_tangent_guess (private) | sm_FindAdditionalTangentGuess |
find_poly_hit (private) | sm_FindPolyHit |
Upstream tests reaching this unit
prog_test:my_test_surface_closest_point, prog_test:my_test_drop_point, prog_test:my_test_matrix, prog_test:my_test_reversed_line_join, SM_API_test:TestSmCreateRectangle, SM_API_test:TestSmCreateRegularPolygon