1
$\begingroup$

If I make a grid of 10x10 instances, and then draw a shape, how can I make the instances only appear within that shape?

Instances are just made from collection instances. Nothing fancy, no arrays, no scatters, no particles. yet.

In other software, I'd use a 'kill' element that would destroy particles or references outside the the 'kill' object, but I can't seem to find the Blender equivalent

$\endgroup$
6
  • $\begingroup$ Add more details to your question.How are you making the grid? Are you using an array, Geometry nodes, Particle system (like hairs), duplicates? $\endgroup$
    – Emir
    Commented Jan 23, 2023 at 15:48
  • $\begingroup$ Hi, Andrew .. Blender has many possible equivalents.. which ones to recommend will depend on how your instances were created, and represented in the scene, and how you want to use the result. Please help us narrow this down, by providing those details. $\endgroup$
    – Robin Betts
    Commented Jan 23, 2023 at 16:37
  • $\begingroup$ ok question is updated $\endgroup$ Commented Jan 24, 2023 at 21:51
  • $\begingroup$ @AndrewLazarus, are you talking about camera culling? $\endgroup$ Commented Jan 24, 2023 at 22:33
  • $\begingroup$ No. I'm surprised that the blender community don't know about kill boundaries - Objects that fall outside of a defined area are destroyed (never instanced or rendered) $\endgroup$ Commented Feb 9, 2023 at 8:44

2 Answers 2

2
$\begingroup$

Your setup and goal is not exactly clear from your wording, but if you mean you have a bunch of objects in a Collection, and you'd like to delete or hide the ones that falls outside the volume of a certain object, you can do that with a simple Geometry Nodes setup like below. In the scene I have a 3D-array of individual spheres (simply duplicated with Shift + D), all in a collection called OBJECTS, which is hidden. Then you have your "kill" object, in this case a torus, which hosts the Geometry Nodes modifier. We hid the OBJECTS collection because we're gonna re-create it inside Geometry Nodes—we need to do that because since Geometry Nodes is just a modifier, it can only affect the object it is being hosted on.

In the Geometry Nodes setup, you simply send rays (Raycast) from each instance origin (Position) to the torus' mesh, and compare those position vectors to the normals (direction) of the faces the rays hit. If they align (face the same directionDot Product), it means the instances are inside the volume, if they don't align (Not) it means they're outside, and can be deleted (Delete Geometry):

enter image description here

$\endgroup$
1
  • $\begingroup$ This is the right interpretation of what i'm asking for - Being able to remove objects that are outside of a boundry $\endgroup$ Commented Feb 8, 2023 at 11:07
2
$\begingroup$

Kuboa's answer is exactly what I needed, but as of 3.5.1, Raycast needs to look a little different. Also, you don't need the dot product. All you want is to see if Raycast returns a nonzero value. To do this, simply connect Hit Normal to a Boolean Math node (set to Not), which will interpolate the values to a boolean value. Based on this behavior, I assume Raycast returns $0$ if no intersection is detected. Also, if you use a direction vector value of $(0,0,-1)$, you can put a single plane under the object and use that as a trim object for grass, etc.

enter image description here

$\endgroup$

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .