How do i get these vertices to align perfectly? The left image is the actual wall of the center shape. Every vertices of the 6 external walls are calculated to stand on the radius of a sphere. I can rotate the mesh 60 degrees at a time and all the vertices of the walls always end up at the exact same X,Y,Z position. Therefor, theoretically, i should be able to tile this shape side by side and form a sphere. The problem is that blender doesn't allow a true edge hinge. I can snap a vertex from both shape and then use it as a pivot point to snap the opposing vertices, in essence snapping, let say, the upper edges together. This part is easy even when i reach far from the actual X,Y,Z axes. But then i have to align the bottom edge and that is where it all goes to smurf! Even on the exact axes it doesn't align perfectly, so the further i go from the X or Y or Z axes the more i get drifting. By the time i have filled a sixth ring around the central shape, when i try to merge the shapes into a single mesh, the vertex merger begins to create zig-zags. If i select two opposing vertices on the upper edges, after aligning it, i can only get a pivot "POINT" in the middle of the 2. The problem with that is that the mesh can swivel in every direction from a "POINT". I need a way to pivot from the entire edge. Either by keeping the 2 points as simultaneous pivot or by having an actual "EDGE HING" instead of a "POINT HING". Been searching everywhere for a solution but haven't found anything that can achieve this easily, and i have to put a lot of them together to form a sphere.(by ring it is: 1, 6, 12, 18, 24, 30, 36 and by then i already have 127 copies and not even a quarter of the final mesh completed). (The shape is actually made up of 4 different meshes which are parented to their top part, so they moves as one mesh.) So if anyone can provide me with a solution i would greatly appreciate it! p.s. i am not looking for a geometry lesson, as you can clearly see it does tile perfectly. there is no need for you to understand exactly what i am trying to do this since what i'm asking is how to achieve the equivalent of using an entire edge as a swivel instead of just a point, you know like a door hinge does. or how to get the four opposing vertices of one wall of one shape to all line up perfectly with their equivalent vertices on the other shape as that shape gets copied and displaced in 3d space.
If I've got you right, you're looking for snapping a rotation about an arbitrary hinge? When you create a Custom Orientation from an edge, or any 2 vertices, the Y axis of the orientation is the line between them.
Starting worst-case, no alignment.
- Set Pivot to 3D Cursor, Snap to 'To': 'Vertex', and 'With': 'Active'
- ShiftS Put the 3D Cursor at one end of your hinge.
- Create a Custom Orientation from your hinge-edge, and make sure it's being used. (Mine is in my Quick Menu, with 'Use After Creation', and 'Overwrite Previous' set.)
- G snap a suitable active vertex to one end of your hinge.
- With the other end-vertex active, snap to the other end of your hinge, by rotating in the non-Y dimensions of your hinge-orientation.. (X, then Z, or Z, then X)
- Now, RY will rotate about the hinge-edge, and you can make another vertex active, to snap about the hinge to another target.
I've solved this via scripting.
Make a vertex group for each of 3 of the points on the first object.
Make a vertex group for the corresponding 3 points on the second object in the same order. Make sure the vertex group of a point has the same name as the vertex group of the other object containg the point it should land on.
Make a new text file in the script editor. Paste the script.
Select the two objects. The active object (selected last) will land on the other object.
Run the script.
import bpy from mathutils import Matrix selected = bpy.context.selected_objects assert len(selected) == 2 obj1 = bpy.context.active_object obj0 = [obj for obj in selected if obj != obj0] # get the coordinates of the points from the vertex groups def get_coords(obj): pts =  for vg_name in ["Group", "Group.001", "Group.002"]: # group names for v in obj.data.vertices: if obj.vertex_groups[vg_name].index in [i.group for i in v.groups]: pts.append(v.co) break return pts pts0 = get_coords(obj0) pts1 = get_coords(obj1) # construct a matrix for each object: def make_matrix(o, b, c): x_axis_dir = b-o z_axis = x_axis_dir.cross(c-o).normalized() y_axis = z_axis.cross(x_axis_dir).normalized() x_axis = x_axis_dir.normalized() mx = Matrix([x_axis, y_axis, z_axis]).transposed() return Matrix.Translation(o) @ mx.to_4x4() mx0 = obj0.matrix_world @ make_matrix(*pts0) mx1 = obj1.matrix_world @ make_matrix(*pts1) # place the object from the first to the second matrix obj1.matrix_world = mx0 @ mx1.inverted() @ obj1.matrix_world