What is a Brep in Grasshopper?

What is a Brep in Grasshopper - Featured Image
Contents

Brep, short for Boundary Representation, is a method used by 3D modeling and CAD applications to represent 3D objects by defining the limits of their volume.

Imagine a 3D object as a solid entity. A Brep focuses on the boundaries that encase this solid. Unlike other representations that might use polygons or vertices, a Brep is defined by the mathematical relationships between its surfaces. This mathematical precision allows for a more accurate representation of complex shapes and contours.

In the context of Rhino and Grasshopper, you can think of a Brep as the same as a ‘Polysurface‘.

The Building Blocks of a Brep

A Brep is like a patchwork; it’s made up of several pieces that come together to form a whole. These pieces are the topological components of the Brep, which include faces, edges, and vertices. A face is a bounded portion of a surface, an edge is a bounded piece of a curve, and a vertex lies at a point. These elements are connected in a way that they define the boundary of a 3D object.

Components of  a Brep: Faces, Edges and Vertices

Just like Polysurfaces, Breps can be categorized into two types: open and closed.

An open Brep has at least one exposed edge, while a closed Brep is sealed off completely. Think of an open box versus a closed one.

Open and Closed Breps Visualized

The type of Brep affects the kind of geometrical operations you can perform in Rhino as well as in Grasshopper.

A fully enclosed 3D object or Brep is also called a “Solid” in Grasshopper. Boolean operations – the subtraction, union or intersection of closed 3D objects in Rhino – Grasshopper refers to them as “Solid” operations.

Boolean Operations / Solid Operations in Rhino and Grasshopper

Why Use Breps?

Breps’ mathematical precision is their superpower. This precision allows designers and engineers to create “perfect” representations of their designs. Especially in manufacturing applications, or 3D-printing, where accuracy is paramount, Breps are invaluable.

Brep vs Mesh

Now, you might be wondering how Brep differs from meshes. While meshes are made up of polygons, Brep uses mathematical representations to define surfaces.

Imagine zooming into a bent surface. With a mesh, the surface starts to look blocky, but with a Brep, the surface remains smooth no matter how much you zoom in. This makes Breps ideal for representing complex 3D objects with curved surfaces.

Limitations of Breps

However, every superhero has its kryptonite. For Breps, it’s the heavy file formats and the processing power required for visualization. Brep files store a lot of metadata, which can take up significant disk space. Additionally, rendering or animating Brep objects can be resource-intensive.

Moreover, Brep might not be the best choice for organic or natural objects. The precise mathematical formulas can make it challenging to recreate more fluid shapes.

Essential Brep Components in Grasshopper

Brep is not just a theoretical concept; it’s at the core of everything we model in Rhino and Grasshopper. In Grasshopper, you can perform a range of geometrical operations using Breps. Some components result in Breps (for example extruding a surface) others operate on the Breps themselves.

The Brep Data Type in Grasshopper

In Grasshopper, Breps have their own data type. This means that certain objects, like boxes, can only be referenced through the Brep data container. The Brep Container component is located in the ‘Params‘ component tab, under ‘Geometry‘.

Finding the Brep Data Container

Here are five essential Brep components in Grasshopper:

Deconstruct Brep

Everything that is assembled can be disassembled. The Deconstruct Brep component acts like a 3D puzzle solver, taking apart any Brep input into its fundamental building blocks: Faces, Edges, and Vertices. Put simply, it breaks down the complex structure into Surfaces, Curves, and Points, giving you the elemental pieces to work with.

Application Example:

Use this component for selecting a particular sub-element of a Brep, for example one of its surfaces. To select the top surface of a cube, for instance, use the Deconstruct Brep component to get a list output of all the Surfaces the Brep is composed of, and then select the one you want with the ListItem component.

Example of the Deconstruct Brep component in GH

Point in Brep

The Point in Brep (BrepInc) component is part of a group of analysis components. The premise is simple: the component helps us to find out if a point is in a Brep or not. When provided with a closed Brep and a list of points, it will output a list of Boolean Values. If a point in contained in the list, the value will be True, and otherwise False.

The Point in Brep component can thus be used to select objects that are contained in a given Brep volume. In the example below I used the ‘Cull Pattern’ component to process the list of points with the True/False values.

Example of the Point in B-rep component in GH

Solid Difference

This one may be tricky to find at first, because coming from Rhino, one would look for a ‘Boolean Difference’ to subtract a closed 3D object from another. Instead, in Grasshopper the components are called Solid Difference, Intersection, and Union respectively.

Example of the Solid Difference component in GH

Brep Closest Point

The Brep Closest Point component is part of the family of closest point components. These components find the closest point on a geometry as calculated from a list of points, in this case from a Brep.

Provided a Brep and a list of Points, the Brep Closest Point component will output the closest points on the brep, the Normal to the Brep at those points, and the Distance.

Example of the Brep Closest Point component in GH

Brep | Brep Intersection

The intersection components in Grasshopper have their own component tab and contain intersection components for all different combinations of geometry types. Shown below is the Brep | Brep Intersection component. As the name suggests, given two Brep inputs A and B, the component will output the Intersection Curve (C), as well as eventual Intersection Points (P).

Example of the B-rep Intersection component in GH

These are just a handful of the Brep commands available in Grasshopper. Double-click on the canvas and type ‘Brep’ into the search bar to see what other Brep components Grasshopper has in store!

Keep in mind that commands in Rhino and Grasshopper sometimes use different terminology to refer to the same commands. Some components might go by different names even though they perform the same function.

Happy designing!

Grasshopper Pro

Followed this tutorial? Learn to build the next one yourself.

Grasshopper Pro is a four-module course for architects, built on one method: Design → Logic → Grasshopper. Start with the design intent, turn it into logic, then build it. You'll work on massing studies, façades and patterns, from a blank canvas.

70% of students who finish rate their Grasshopper skills as intermediate or advanced · 22 Trustpilot reviews, every one 5-star

See the curriculum →

$197 one-time · lifetime access · 30-day refund

Article by

Picture of Thomas Jeremy Tait
Thomas Jeremy Tait
Founder of Hopific. Expert in parametric design for architecture. An architect who spent 10 years at Snøhetta, where Grasshopper was his main design tool on projects.

Quickstart Guide to Grasshopper

Download your free guide and transform your designs today.

More Great Reads