Joints are hard
Published on 18 September 2025
One of the things that typically takes a lot of work in CAD software is drawing joints. Personally, I often don't bother with the effort: I just draw butt joints everywhere and take notes or make a paper sketch for the actual joints I will use when building. But that's a shame. I'm not making those joints for fun: they can make a big difference in the look of the design. And having an incomplete model can lead to mistakes when building.
What drawing a joint should look like
When you're designing a piece of furniture, you're mostly working with rectangular pieces: boards, beams and panels. That's easy to draw. But adding joints requires small details that need to align just right. It's not hard to do, but it takes time. And if you're not working parametrically, once you've added a joint it often becomes hard or impossible to change the dimensions of your part without redrawing it, joint and all. Who has time for that?
In Maqet, we want to make it easy to add joints to your design. Select two parts, and choose how you want them to be joined. That's it. As we've said before: we don't want you to have to think about how to do it, you just do it.

But from a technical standpoint, that's easier said than done. Since you're not telling the program how the parts should be joined exactly, it has to figure it out by itself. If I show you two boards held together in a certain way, it will immediately be obvious to you how they should be joined. But translating that into a program that always chooses the correct joint is harder than it looks.
Computers are dumb
Let's look at a simpler geometric problem first to see how dumb computers are. Imagine a polygon and a point on a flat surface, like in the image below. Does the point lie inside the polygon, or outside? For us humans, answering the question is so easy that it's almost ridiculous to ask.

For a computer, a common way to answer the question is to draw a straight line from the point to infinity (we call this a "ray") and count how many times the ray intersects with the polygon. If the number is odd, the point is inside the polygon; otherwise it's outside.

The pseudocode for this algorithm might look like this:
function isPointInsidePolygon(point, polygon):
ray = getRandomRayFromPoint(point)
crossings = 0
for edge in polygon:
if intersects(ray, edge):
crossings = crossings + 1
return isOdd(crossings)
So even for a trivial task like this, the computer has to do quite a bit of work. And we haven't even talked about (literal) edge cases, like when the point lies exactly on the edge of the polygon, or the ray happens to coincide with an edge of the polygon.
Joints are even harder
Back to our original problem: how do we calculate the joint between two boards?
Let's answer a different question first. Say you have two boards of 1 by 8 by 20 cm. How many different ways are there to join these boards together with a miter joint at a right angle? I'd say probably three that you would actually use. But for the computer, the answer is 45:

Most of these joints don't make any sense, of course. Look at this abomination:

No one will build that. I know that, and you know that. But the computer doesn't. So we have to find a way to filter out all the nonsense joints.
Calculating a joint from 2 planes
Calculating the geometry of a joint is actually quite simple once you know its orientation. When jointing two boards like in the image below, you start from the planes that align with the backsides of the boards. For a miter joint, you calculate the angle between these planes (90° in this case), create a new plane at half that angle (45°), and use that to cut the boards. For a rabbet joint, you raise the bottom plane by half the thickness of the bottom board and use that to cut the right board.

When the boards are lying flat, like in a picture frame, you can use exactly the same method. This time the planes we need for our calculation are the ones that align with the top side of the top board and the right side of the right board.

Finding the correct planes
Disclaimer: this section contains some math. If you're not interested in the details, you can skip to the next section.
So the challenge is figuring out which planes to use. Each board has six planes: top, bottom, left, right, front, and back. Which ones do we need? If you pick the wrong plane, you may get a joint that is geometrically correct but doesn't make sense to build, like our dear friend the abomination above.
We found a procedure that works in all the cases we've tested, and it goes as follows. Say we have two boards A and B.
- Find the area where the two boards overlap (the red area in the image below) and calculate the centerpoint of that area.
- For each board, calculate the direction from the board's centerpoint to the overlap's centerpoint. Call these
vAOandvBO. - For board A, consider the three planes
planeA,x,planeA,y, andplaneA,zthat cross the center of the board. (So instead of considering the top and bottom planes separately, we only consider the plane that lies in the middle between them. Same for left/right and front/back.)- Each plane gets a priority: the plane parallel to the top/bottom of the board gets
priorityA,z = 1, the other two getpriorityA,x = 2andpriorityA,y = 2. (For beams, like 2x4s, we have two planes with priority 1 and only one plane with priority 2. Other than that, the procedure is the same.) - For each plane of board A, calculate the angle between
vBOand the plane normal (the arrow perpendicular to the plane) as a number between 0° and 90°. Call theseαA,x,αA,y, andαA,z. - Do the same for board B.
- Each plane gets a priority: the plane parallel to the top/bottom of the board gets
- Finally, we have nine pairs of planes: three from board A times three from board B. For example,
pairx,ycontainsplaneA,xandplaneB,y.- Dismiss all the pairs where the two planes are parallel, we can't create a joint from them.
- For each of the remaining pairs, calculate a priority as follows:
priorityx,y = max(priorityA,x, priorityB,y). If there are any pairs with priority 1, dismiss all pairs with priority 2. - For each of the remaining pairs, calculate a score as follows:
scorex,y = αA,x * αB,y. The pair with the lowest score is the one we will use to construct the joint.

Wrapping up
It took us quite a while to come up with this procedure. We found a few forum posts about people struggling with the same problem but haven't come across any solution general enough to be useful for us. We're pretty sure we've found a procedure that works in almost all real-world scenarios. If you find a case where it doesn't, please let us know! There may also be situations where there are two or more possible joints. If that's the case, we'll probably add a way to override the default orientation in the future. But for now, we're really happy that we found a solution that finds the right joint without any help from the user. One step closer to simplifying woodworking design!