How to set the origin of a procedurally created mesh in Geometry Nodes?

In blender 3.0, I made a wire-like mesh using Mesh Line. So, the geometries default origin is the beginning of the mesh line which later, causes problems. I wondered if there's a way to set the position of the origin?

It would be great if I can set the origin to the center of the Geometry. Is there a way for blender to calculate the center automatically in Geometry nodes?

I needed something similar but a bit more specific. I ended up with the following Node Group: (make sure to limit the input on x, y and z from -1 to 1).

I can set the origin based on values from -1 to 1, where 0.5 is the center.

Just like in the answer of Gorgious https://blender.stackexchange.com/a/247902/21443, The mesh is being transformed, not the origin. I think at this point it is not possible to transform only the origin.

You can use the Bounding Box node which outputs a mesh's enclosing (bounding) box, as well as the minimum point and the maximum point of the box in the 3 axes.

Then take the mean value of the Min and Max to get the origin of the box. Translate the mesh by this amount to center the origin to geometry.

Hit CTRL + G while the new nodes are selected to create a handy node group you can use later to center the origin on other meshes.

• Cool, you transformed the the mesh not the origin. Thinking outside the box Commented Dec 23, 2021 at 19:38

I really don't want to be a smart-ass about this, but here's how I would solve it:

The node Attribute Statistic returns the mean value of the positions of a geometry. Turn this value around and then you have the offset to the center of the geometry.

...or have I understood this a little too simply?

• Briliant as always :) Commented Jan 16, 2023 at 15:01
• Note this will be biased towards the parts where the geometry is more dense on the mesh. Which is indeed how the "Origin to Geometry" operation works by default in Blender. Commented Feb 19, 2023 at 18:37

This one works on mesh, edges, and splines but could be used to handle others. Translate moves the origin but once you apply the geometry nodes modifier, the origin always reverts to the origin of the object passed in, until this is integrated fully into Geo Nodes, this is an option tho. So you may need to manually apply Origins on anything generated from this but it seems to be usable.

if you leave the translation alone on the duplicate you still end up with the intended origin but it does work on instances within geo nodes or as an array modifier combo.

Works by altering the position of the base mesh which effects the origin like moving the object in edit mode does. duplicate and transform/set position node makes an instance copy that you can then move around and rotate on the new origin.

Hope this helps,

Thanks to all Blender youtubers but special thanks to Johnny Matthews: https://www.youtube.com/watch?v=llJdazdLmBU

Finally starting to understand fields .. a BIT ;)

Edit to the above:

fixed issue with realized instances losing their origin, made it more reusable? potentially. instances revert to their parent origin once realized it seems. same as when the nodes modifier gets applied. this seems to solve setup seems to solve the issue tho. takes origin line moves origin on instance to middle. moves line location back to original position and rotates on new origin. then takes instance with origin still applied and manipulates scale and rotation along modified origin. scale was broken on this step previously from above