5
$\begingroup$

How do I fit an array inside a shape so that it doesn’t truncate at the edges? See image below. I’ve tried with a bool, and it truncates. I don’t think fit to curve works for this?

example image

$\endgroup$
4
  • $\begingroup$ Did you try with geometry nodes? Should be pretty easy… $\endgroup$
    – Chris
    Oct 22 at 18:19
  • $\begingroup$ Ah no, hadn’t occurred to me! Will give it a go $\endgroup$
    – tomh
    Oct 22 at 18:20
  • $\begingroup$ Re geonodes: How do I evenly distribute across the geometry nodes, with nice separation? I can do "Point distribute random", but it's not array-like... And do I need to apply it to a cylinder to achieve the example above, as a circle doesn't seem to work? (sorry for dumb follow ups). Please add an example answer if you can! $\endgroup$
    – tomh
    Oct 22 at 18:35
  • $\begingroup$ the "trick" here is to use instance on points nodes (see my answer) $\endgroup$
    – Chris
    Oct 23 at 1:55
8
$\begingroup$

Old school solution: You could use Instancing: Let's say you want to duplicate Suzanne. Create a tiny plane, array it on X and Y (Constant Offset mode), activate Object properties panel > Instancing > Faces, give it a Boolean (Intersect mode) with a cylinder as Object. Parent Suzanne to your plane. If there is a glitch when you scale the cylinder it's because the plane and the cylinder are intersecting, make sure that the plane is very small and it won't glitch.

enter image description here

$\endgroup$
2
  • $\begingroup$ Whether I choose Fast or Exact on the Boolean, some of the Suzannes are rotated in he Z axis at the intersection with the Boolean, unlike in your example. $\endgroup$
    – tomh
    Oct 23 at 15:30
  • $\begingroup$ Actually with both the 2 solutions there may be a little "glitch" when the face is at the intersection of the boolean, I don't know if it's avoidable, but make sure the faces are very very small, and it looks like it becomes unnoticeable... $\endgroup$
    – moonboots
    Oct 23 at 15:31
6
$\begingroup$

update:

node setup for 2.93:

enter image description here

enter image description here

node setup for 3.0 alpha:

New school solution:

Add a plane, subdivided it as much as you need it.

Add a cylinder as cutter object.

Apply boolean modifier to plane with cylinder as object -> intersect.

So you got this:

enter image description here

Add another cylinder as Instance object (scale it in edit mode as much as you need it).

Add yet another cylinder (you can hide it later) in the middle of your plane (will be used for midpoint calculation, but could also just calculate the distance from the position if your plane is on 0/0/0 anyway). This cylinder is called Cylinder.001 in my example. Of course you could also use a sphere here...

Add a geometry nodes modifier to your plane with this node setup:

enter image description here

by changing the threshold you can cut off the ugly edge vertices:

enter image description here

result:

enter image description here

$\endgroup$
9
  • $\begingroup$ Thanks for your answer! I can't find some of the nodes in your diagram, e.g. "Separate Geometry" and "Position". Am I doing something wrong? I'm using Blender 2.93.4. Am I missing an add-on? From your list: Position NO Object info YES Distance NO Less Than NO (attribute compare?) Separate Geometry (attribute separate XYZ?) Instance on Points (Point Instance?) $\endgroup$
    – tomh
    Oct 23 at 10:44
  • $\begingroup$ Oh ok, sorry, i used the newest 3.0 alpha version…didn’t know you are using 2.93 $\endgroup$
    – Chris
    Oct 23 at 11:15
  • $\begingroup$ Is it possible to do it with 2.93? Would rather not sit on the bleeding edge if possible! $\endgroup$
    – tomh
    Oct 23 at 15:44
  • $\begingroup$ yes it is, i update my answer. $\endgroup$
    – Chris
    Oct 23 at 16:04
  • 1
    $\begingroup$ Many thanks, it worked! I had to add an "Attribute Random - scale" node before the Point Instance node in order to shrink the repeating objects down - they were coming out massive for some reason. $\endgroup$
    – tomh
    Oct 23 at 16:19

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.