Using a shape as a mask for another shape

I’m trying to get this small black circle to stay within the bounds of the larger white circle, using the white circle as a clipping mask for the black circle. These are two separate objects. I’d like to achieve this with compositing as I can’t use the Shrinkwrap modifier since they are both Bezier Circles. If there’s a way to achieve this in the viewport that’d be even better, thanks in advance to anyone who can help!

See the post on the link

Thank you, but that’s not quite what I was looking for. I’ve decided to just make the larger circle a mesh and shrinkwrap the smaller one to it.

I wouldn’t use two circles for this- just take your white circle and add the black circle procedurally using shader nodes. It’ll be masked and far easier to control.

The shader nodes to make a perfect circle are:

Texture Coordinate (object) → Mapping → separate XYZ

On the X and Y outputs, add a math (power) node with exponent two. Add those math nodes together with a third math node, than take the square root of that with a fourth. Perfect circle. You can move it by changing the location values of the mapping node

4 Likes

An even simpler method would be to create a spherical mask using the length of the Object Vector from the Texture Coordinate node and check if it’s less than a specific value (that will be the radius of the sphere):

2 Likes

That’s exactly what I needed! Thank you!

1 Like