BooleanUnion 2D Mesh Surface

by Clark Cheng


Posted on August 24, 2013 at 9:00 PM


Icon

SideFX's HoudiniFX is known for its expansive VFX capabilities and procedural techniques. Luckily, Houdini has pretty nifty solutions on 2D merging.

In many workflows, especially when working with 2D shapes that need to be combined, it's useful to have a fast and reliable method for union, intersection, and subtraction operations. Houdini offers several approaches for 2D boolean operations, depending on whether you are working with curves, polygons, or volumes.

For basic 2D geometry, the Boolean SOP node provides a straightforward solution. By setting the operation to "Shatter" and working with flat, planar surfaces, you can merge two shapes together efficiently. Houdini treats the surfaces as thin volumes, which helps avoid common problems like self-intersections or incorrectly calculated overlaps.

Basic Setup for 2D Booleans:
1. Create two 2D shapes, such as circles, rectangles, or custom curves.
2. Use a PolyExtrude SOP with a very small extrusion depth to give them slight thickness if needed.
3. Connect the shapes to a Boolean SOP.
4. Set the Boolean SOP to the "Union" operation mode.

The result will be a cleanly merged 2D surface. You can flatten the result back onto a single plane by using a Transform SOP to reset any extrusion depth.

For more procedural control, Houdini’s VDB tools can be adapted for 2D shapes by converting them into fog volumes and using VDB Combine. This method is heavier but gives flexibility for complex or noisy outlines.

Description of the image Description of the image


          // Your JavaScript code goes here
          using System;
          using System.Collections.Generic;
          
          class Program
          {
          static void Main()
          {
          // Create an empty list of strings
          List emptyList = new List();
          
              // Print the initial count of the list
              Console.WriteLine("Initial Count: " + emptyList.Count);
          
              // Add some elements to the list
              emptyList.Add("Item 1");
              emptyList.Add("Item 2");
          
              // Print the count after adding elements
              Console.WriteLine("Count after adding items: " + emptyList.Count);
          
              // Display all items in the list
              foreach (var item in emptyList)
              {
              Console.WriteLine(item);
              }
          
              // Remove an element and print the updated list
              emptyList.Remove("Item 1");
              Console.WriteLine("\nList after removing 'Item 1':");
              foreach (var item in emptyList)
              {
              Console.WriteLine(item);
              }
              }
              }

            


          // Your VEX code goes here
          if (@Cd.r<0.5)
            {
              @group_dark=1;
            }

          


          # Your python code goes here
          # Create an empty list
          my_list = []
          
          # Print the initial list and its length
          print("Initial list:", my_list)
          print("Initial length:", len(my_list))