# How do I scale an instancer by proximity? Not the instance itself

My problem is simple. A box travels on a chain of conveyors. To achieve the effect, we use a curve modifier, and instance the box on a plane traveling down the belt. The trouble is that the instancing plane will cut the top corner. If the instancer were tiny, the problem would happen at the first joint instead of the second. I want the instancing plane to scale down so that it doesn't cut the top corner, by using a proximity node. What's wrong with my node setup? Perhaps it complicates things that my instancer has a curve mod after the geo node mod.

• If you shrink the instancer than the instances shrink with it, because children matrix is calculated based on the parent matrix. You can of course scale the children up as you scale the parent down, but then the question is: what do you want to achieve? Also it's not clear what "resume its scale" means. Restore its scale? If you check proximity, you can't distinguish before/after, it's always just distance. You can clamp size in order to avoid collision, but from your images it's not clearly at all if that's what you're after. Commented May 13, 2023 at 21:06
• Thanks for the reply. To clarify: treat the shrinker as a normal proxy scale object, but only scale the instancer and not the instance. I thought that preceding the instancing with the transform node, that everything would be fine. I thought that pathology mattered in the chain of nodes. Commented May 13, 2023 at 21:31

This is an example of a node setup that allows you to scale the instancer without scaling the instances:

That's how scaling the instancer looks with such setup:

## Update

My current understand of your problem is that you just want to animate a face following a curve, while also scaling the face to never intersect another, vertical plane. This is a problem that doesn't have a generalized solution in geonodes, because it's known as Collision Detection, and Collision Resolution, simulation-like processes. For example, here's a node tree that animates some triangles and then tries to scale them down as little as possible while guaranteeing they don't intersect another shape:

It has some archaic nodes, but you can open the nodes in newer Blender to convert Transfer Attribute nodes to newer equivalent…

You can see sometimes triangles still intersect, because the check was only done on vertices:

Instead you could raycast from one vertex to another to check edge intersection, but what if the triangle is impaled through its middle? Then only subdivision can help a little.

Fortunately in your case the problem seems simple: you can raycast along the curve (and backwards to support scaling on both sides of the obstacle), and scale based on the ray length:

• That's cool. Vertices cannot be scaled so this makes sense. Let us instance at the face and scale via proximity to a plane. Commented May 15, 2023 at 12:08
• @JBRiley maybe what you want to do is scale the instancer, while countering the scale by transforming the mesh inside of the instancer? It's really not clear at all to me what you're trying to do. Commented May 15, 2023 at 12:13
• As the box travels down the conveyors, it will cut the corner. Do you see it cuts the top corner? It wouldn't cut the corner if the instancer was tiny, but the problem would happen instead at the first junction - so the problem would not be solved. I need to shrink the instancer at the top junction only. Commented May 15, 2023 at 13:20
• @JBRiley If the plane's vertices are snapped to the surface of the conveyor, then it it was tiny, it would fit in the valley ⊃⊂ below the general surface level, and so spawned cube would still overlap. I think a better question would be "how to animate a cube sliding over uneven terrain", and the answer is probably preparing a curve defining the path of the movement, or calculating that curve dynamically (but it's arbitrary which parts of geometry you want to ignore, here the rounded ends, and so you can't avoid manual tuning of the animation) Commented May 15, 2023 at 14:45
• It must not be clear, but that instancer has a curve modifier, so it is faking contact between the belt and box. An instancer is traveling on a curve, and when it hits a turn, it cuts the corner - which is sometimes fine and sometimes not. let us scale it down when it is not ok Commented May 15, 2023 at 14:53