1 rendering.viewing_crop

rendering.viewing_crop

Conservative geometry selection for target-local candidate rasterization.

The world AABB of all current camera centres and the expanded target corners contains every camera-to-target segment. Retaining whole triangles whose AABBs intersect that region therefore preserves potential foreground occluders. This is conservative broad-phase selection, not exact frustum or triangle clipping; background pixels outside the target support may change. Scoring support remains owned by the caller, and selected factual observations must use the full mesh.

1.1 Classes

Name Description
ViewingCropMesh Copied world geometry and provenance for one current candidate table.

1.1.1 ViewingCropMesh

rendering.viewing_crop.ViewingCropMesh(
    verts_world,
    faces,
    original_face_indices,
)

Copied world geometry and provenance for one current candidate table.

Tensors remain on the original mesh device. Geometry selection is discrete; gathered vertices retain autograd connectivity but do not share input storage. Callers must not mutate tensors while a render consumes them.

1.1.1.1 Attributes

Name Description
verts_world World metres Tensor["V_crop 3", float], preserving vertex dtype.
faces Remapped triangles Tensor["F_crop 3", int64] in original face order.
original_face_indices Original mesh face rows Tensor["F_crop", int64] for audit joins.

1.2 Functions

Name Description
crop_mesh_for_views Select whole faces that may obstruct current camera-to-target rays.

1.2.1 crop_mesh_for_views

rendering.viewing_crop.crop_mesh_for_views(
    mesh_verts_world,
    mesh_faces,
    target_obb_world,
    camera_centers_world,
    *,
    margin_m,
    face_chunk_size=200000,
)

Select whole faces that may obstruct current camera-to-target rays.

1.2.1.1 Parameters

Name Type Description Default
mesh_verts_world torch.Tensor Finite world metres Tensor["V 3", float]. required
mesh_faces torch.Tensor Nonempty valid vertex indices Tensor["F 3", int64] on the mesh vertex device. required
target_obb_world ObbTW One finite world-frame OBB, unbatched or singleton. required
camera_centers_world torch.Tensor Nonempty finite world camera centres Tensor["C 3", float]; converted to mesh dtype/device. required
margin_m float Finite nonnegative expansion of each object-frame box bound, including the caller’s scoring margin and rendering halo. required
face_chunk_size int | None Positive screening batch size, or None for vectorized screening. 200000

1.2.1.2 Returns

Name Type Description
ViewingCropMesh Copied retained geometry with deterministic ascending vertex remapping.
ViewingCropMesh Face order and original face identity are preserved; inputs are unchanged.

1.2.1.3 Raises

Name Type Description
ValueError Invalid geometry, cameras, box, controls, or no retained faces.

1.2.1.4 Notes

Closed AABB intersection admits touching and crossing triangles even when every vertex lies outside. Temporary scalar-coordinate storage is bounded by face_chunk_size when provided rather than the number of cameras times mesh faces. Hard rasterization is required for the camera-ray conservation argument; soft raster support and fusion halos remain the scoring owner’s contract.

Back to top