Welcome to the Onshape forum! Ask questions and join in the discussions about everything Onshape.

First time visiting? Here are some places to start:

1. Looking for a certain topic? Check out the categories filter or use Search (upper right).
2. Need support? Ask a question to our Community Support category.
3. Please submit support tickets for bugs but you can request improvements in the Product Feedback category.
4. Be respectful, on topic and if you see a problem, Flag it.

If you would like to contact our Community Manager personally, feel free to send a private message or an email.

# Bisecting an angle with a plane

EDUMember Posts: 35 EDU
I'm working on a feature to create a simple miter between two overlapped rectangular solids (like in a picture frame). My current approach is to have the user select the two inner faces of the parts that form the mitered corner. Then, I compute the angle between the two faces using plane normals.

I'd like to be able to create a plane that bisects that angle and use a split operation (deleting the waste bodies) to create the miter.  My current approach is to create a new coordinate system from the intersection line formed by the two faces and the x axis of one of the two planes created from the faces of the bodies. The normal for the "splitting plane" should then be rotated from the x axis of that coordinate system by half the angle between the two original faces.

In practice, my splitting plane winds up not actually bisecting the angle, and it appears to be angled slightly off vertical (~0.5 degrees) despite the fact that the dot product of its normal and the world z direction is zero. I've been struggling with this for a while, and I can't seem to figure exactly why this is happening.

Is there a better way to do this robustly (so that results aren't dependent on the position and orientation of the two bodies w.r.t. the world frame)?

The relevant code is in the cutDovetailMiterwKey function in this (admittedly jumbled mess of a) FeatureScript: https://cad.onshape.com/documents/23dc8ff499026deeed6aa19e/w/0031df2b6d633ae1a21ed033/e/ecf25bb128148651d6f2a998