geometry
-
How to Check If Two Triangles Intersect: Geometric Algorithms Explained
I’ve looked at a lot of triangle-triangle intersection code across different projects. And every time, one thing stood out: there’s no single implementation that covers all the edge cases. That’s not surprising. The requirements vary wildly depending on the use case – fast-and-loose for games, watertight for CAD, approximated for physics engines. But in this Continue reading
-
Is the Point Inside the Triangle?
Today we’re tackling something that seems simple: how do you tell if a point is inside a triangle? I’ve got five things I want to do here: Make it a storyThis post will be long, with some detours and extra thoughts. But I think that’s the best way to get tricky stuff. A story keeps Continue reading
-
Mesh Stitching: Techniques for Repairing Gaps and Cracks in 3D Models
Today, I’d like to dedicate a post to the topic of mesh stitching.Stitching meshes is usually necessary when they contain gaps, cracks, or thin, narrow holes that can be stitched together instead of being filled. Such cracks might appear due to incorrect data conversion or as a result of geometric algorithms – for example, merging Continue reading
-
Mesh Clipping Operations with OpenMesh Library
In this post, I will discuss the process of clipping operations on meshes using the OpenMesh library. For the purpose of this demonstration, we’ll utilize the OpenMesh library to represent our mesh. For those unfamiliar, OpenMesh provides extensive tools for manipulating polygonal meshes. We will be working with a triangulated mesh version for simplicity. Refer Continue reading
-
Half-Edge Data Structure. Part 1

In this post I’ll describe my favorite mesh data structure called half-edge data structure. It’s used primarily in Mesh/CAD applications and helps to make various advanced operations on the mesh such as subdivision or simplification. Let’s start with the vertex and index buffer described in the previous post. The simplest way to display a model Continue reading
-
Techniques for Showing and Hiding Triangles in 3D Meshes
In this post, I want to discuss how to hide and show triangles in a 3D meshes. This serves as a precursor to my next post, which will delve into my favorite sophisticated data structure: the half-edge data structure. I want to mention that I will be using some “abstract rendering API” for this post, Continue reading