4

I have a cylinder below and on the top a sphere. I want the sphere should align on the cylinder so that the sphere below part goes inside the cylinder.

Below is the reference image drawing. enter image description here

enter image description here

I tried with the snapping but not work perfect. May i know which snapping will work perfect with the drawing. Any suggestion or help. Thanks

atek
  • 10,006
  • 29
  • 91
  • 195
  • @moonboots: uhm...i am also using Blender for more than 3 days now...but i couldn't reproduce your comment...can u pls elaborate a bit more? – Chris Aug 26 '23 at 08:33
  • @Chris OK I think I misunderstood the question – moonboots Aug 26 '23 at 08:41
  • ah ok ;) now it makes sense ;) – Chris Aug 26 '23 at 08:47
  • @moonboots i want to cut the sphere base as per the diagram, how can i align with the various snapping tools, so that it comes down and add a boolean modifier later. as per the diagram the sphere is inside the cylinder. i dont want to manually move down and adjust it. with the snapping how it can move perfectly. hope it make sense – atek Aug 26 '23 at 12:16

3 Answers3

4

you can use this geometry node setup for your sphere, to move it down to the cylinder.

enter image description here

Note: this only works with your very simple setup and very simple geometry. So your sphere and your cylinder must be on one axis (z) so that it works. Your cylinder must be a "normal" unrotated cylinder (but yes, it also would work with a cube).

So you can add that GN node to your sphere and apply it.

Result:

enter image description here

What the node tree does, is raycast from the cylinder to the sphere. It just "remembers" the shortest distance for every raycast from every point of the cylinder to the sphere. Then the sphere will be moved down by exactly that value.

Chris
  • 59,454
  • 6
  • 30
  • 84
  • Thanks for the effort, but im really sorry im really afraid and never understood the nodes untill know, When seen node i just close the blender, is there any other way other than GeoNodes, with snapping. – atek Aug 26 '23 at 12:18
  • @atek: you don't have to understand it. just rebuild the node tree, apply it. ready. – Chris Aug 26 '23 at 13:37
4

how can i align with the various snapping tools, so that it comes down and add a boolean modifier later. as per the diagram the sphere is inside the cylinder. i don't want to manually move down and adjust it. with the snapping how it can move perfectly.

Instead of trying to snap the sphere to the top edge of the cylinder change the snapping mode to Face Project and Closest and then snap the cylinder to the sphere.

But first duplicate a vertex of the cylinder and move it to the side a little. This vertex will be used to snap the cylinder (along with the sphere) back to its original Z position. (Snapping mode to Vertex and Closest).

In the gif below the Ctrl key is being used to activate the snap tool.

enter image description here

3fingeredfrog
  • 5,670
  • 9
  • 12
2

Here's pretty much what Chris is doing in geonodes, but without geonodes:

  1. Copy the $z$ dimension of your cylinder, and write it somewhere:

here: $0.416085 m$

  1. Select the top ring of the cylinder (shouldn't matter if there's a face), and assign it to a new vertex group:

  1. In Object mode, add a Shrinkwrap modifier to the cylinder; non-default settings marked green:

  1. Copy the $z$ dimension of the cylinder again

$0.921714 m$

  1. Subtract from the old dimension, the new dimension:

$$0.921714 m - 0.416085 m = 0.505629 m$$

  1. Disable (delete) the Shrinkwrap modifier, and move your sphere down by that much:

(I moved it first by whatever, and then pressed F9 key to paste the value)

Markus von Broady
  • 36,563
  • 3
  • 30
  • 99