Skip to content

Commit 23279c5

Browse files
nikhilaravifacebook-github-bot
authored andcommitted
Utils for clipping mesh faces partially behind the image plane
Summary: Instead of culling faces behind the camera, partially clip them if they intersect with the image plane. This diff implements the utils functions for clipping. There are 4 cases for the mesh faces which are all handled: ``` Case 1: the triangle is completely in front of the clipping plane (it is left unchanged) Case 2: the triangle is completely behind the clipping plane (it is culled) Case 3: the triangle has exactly two vertices behind the clipping plane (it is clipped into a smaller triangle) Case 4: the triangle has exactly one vertex behind the clipping plane (it is clipped into a smaller quadrilateral and divided into two triangular faces) ``` Reviewed By: jcjohnson Differential Revision: D23108673 fbshipit-source-id: 550a8b6a982d06065dff10aba10d47e8b144ae52
1 parent db6fbfa commit 23279c5

File tree

3 files changed

+953
-0
lines changed

3 files changed

+953
-0
lines changed

pytorch3d/renderer/mesh/__init__.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
# Copyright (c) Facebook, Inc. and its affiliates. All rights reserved.
22

33

4+
from .clip import ClipFrustum, ClippedFaces, clip_faces
45
from .rasterize_meshes import rasterize_meshes
56
from .rasterizer import MeshRasterizer, RasterizationSettings
67
from .renderer import MeshRenderer

0 commit comments

Comments
 (0)