2
$\begingroup$

I've been looking all over the place and I can't seem to find the right constraint for this. I have a circle that needs to be constrained to a triangles area.

Limit Distance Constraint doesn't seem to work because it limits it to a sphere which can go out of the bounds of the triangle.

Limit Location Constraint doesn't seem to work because if my triangle's vertices are (0,0,0),(2.5,5,0),(5,0,0) and I max out x at 5 and y at 5 the object can go to (4.9,4.9,0) which is not in the triangle.

Any help would be greatly appreciated.

$\endgroup$
1
$\begingroup$

Create a new mesh shaped in the way you require the object to be constrained - in your case a single triangular face - and add a Shrinkwrap constraint to your object set to Closest Surface Point with Target set to the mesh. This will constrain the location to the closest point on that mesh. This will work for any shape of constraint.

To demonstrate, here a Copy Location constraint has been added to Suzanne to move her to the location of an empty. In addition, the Shrinkwrap constraint has been added and targetted at the triangular mesh.

constraints

Moving the Empty causes Suzanne to follow, but only within the bounds of the triangle mesh :

constrained to triangle

$\endgroup$
  • 1
    $\begingroup$ excellent thank you! I ended up constraining it by doing the math and making sure the points picked were always less than the lines of the triangle. This will definitely come in handy down the road. $\endgroup$ – sf8193 Mar 12 '18 at 2:52

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.