Introducing Boundary Representation Modeling

Does anyone have good implementation strategies or resources to build a b-rep simulation system?

OpenCascade is apparently a good b-rep modeling library (used by FreeCad and PythonOCC, very cool), but the library is huge, complex, and perhaps not a good starting point to learn about b-rep modeling mechanisms.

I have done quite a bit of research, and while fundamental mathematics is useful for understanding why everything works, it left me with some implementation issues.

half edge data- structure seems to be the preferred way to store body information in b-rep implementations.

So, a few questions in a specific order:

  • Using a semi-task data structure, how is the rendering usually done? Hard Boundary Triangulation?

  • How are circular surfaces / curved surfaces typically implemented? For example, the cylinder in one basic introduction to b-rep, which I read, was internally stored as a prism. The extruded triangle IE and metadata were stored around the edge of the caps, indicating that they were truly circular.

  • How are logical operations usually performed? I read about generating a BSP tree along intersection curves, then combining these trees to generate new geometry. Are there other ways to implement logical operations and what kind of pro / con do they have?

Thanks!

If you want to provide an example code, don’t worry about the language - the questions are more about implementation details of the algorithmic / data structure.

+4
source share
1 answer

I am working on a B-Rep model in C # (I am at a very early stage: this is a huge project), so I ask myself the same questions as you. Here are my answers:

  • Triangulation: I did not do this, but the strategy that I think of is this: project the borders of the face in the parameter space to get two-dimensional polygons (with holes), triangulate using the ear trimming algorithm, and then reverse engineer triangular vertices in three-dimensional space. For curved surfaces, I need to divide the polygons with a grid to keep track of the surface;
  • There are 3 ribs for a cylinder: two circulars and one segment. I have classes for each type of curve ( Segment3d , Circle3d ...), and each half-edge has an instance of one of these classes. Each face contains an instance of a surface object (plane, cylinder, sphere ...);
  • There is an interesting project here based on the BSP-Tree, but it uses the CSG method, not the B-rep. I'm still researching how to do this, but I don’t think I need a BSP tree. The difficulty lies in calculating intersections and topology.

The best books I've found on this topic are:

0
source

All Articles