6
$\begingroup$

I have a mesh where the faces should connect at the center in a single vertex, but the top is cut off at the moment (like a pyramid without its top). I want to add this top now, but I don't know how to correctly align it. Here is an illustration of what I want to achieve:

enter image description here And a second question: How would I know resize this pyramid-like shape? I mean, the base should stay the size it is, but the rest should go higher or lower. It is obviously easy if every side of the pyramid is only a single face, but since my sides contain multiple faces, I don't know how to preserve the angles. Again an image, since I'm really bad at describing. enter image description here

Thank you.

$\endgroup$
  • $\begingroup$ For this particular case, it's better to do it in reverse, meaning make it a full pyramid shape first, then connect the vertices and make the cuts you need $\endgroup$ – Georges Jun 19 '16 at 10:47
  • $\begingroup$ But still, shouldn't this be possible somehow? Both are not that absurd actions. Basically I just want to align two edges like its a single one. $\endgroup$ – leyren Jun 19 '16 at 11:02
  • $\begingroup$ It's doable, I'm just pointing out to the easiest way. You can use custom transform for each edge and move snap vertex to the center, keeping a straight line, all depends on the level of accuracy you need $\endgroup$ – Georges Jun 19 '16 at 11:05
  • $\begingroup$ I'll post a detailed answer as soon as I get to my computer, if you can upload a .blend file, would be much better $\endgroup$ – Georges Jun 19 '16 at 11:18
  • $\begingroup$ Not directly related, but you might found some good ways there - blender.stackexchange.com/questions/2976/… $\endgroup$ – Mr Zak Jun 19 '16 at 12:29
4
$\begingroup$

This probably needs more work, but will do the trick in the case presented above.

enter image description here

To use this script:

  1. Open a text editor window, create a new file and paste the code below there.
  2. First select the two vertices that define the edge you want to align the 3rd vertex with.
  3. AFTER these two verts, select the 3rd vert you want to move to align with the edge.
  4. Run the script.

Here's the code:

import bpy, bmesh
from mathutils import Vector, geometry

bm = bmesh.from_edit_mesh( bpy.context.object.data )
mw = bpy.context.object.matrix_world

if len( bm.select_history ) == 3:
    v1, v2, v3 = [ mw * v.co for v in bm.select_history ]
    edgeVec = v2 - v1

    v4 = v3 + Vector((0,0,1000))

    intersections = geometry.intersect_line_line(v1, v2, v3, v4)

    bm.select_history[2].co = intersections[0]
$\endgroup$
  • $\begingroup$ Not necessarily, it depends on the angle of the edge and the distance to the vertex being aligned with it. $\endgroup$ – TLousky Jun 19 '16 at 14:30
  • 1
    $\begingroup$ this needs to be added into blender, pitch the idea on developer.blender.org $\endgroup$ – eromod Jun 19 '16 at 15:08
  • $\begingroup$ This is a quick and dirty solution, it needs a whole lot of work before it could be universally useful, but it could be a starting point for anyone who wants to implement it :) $\endgroup$ – TLousky Jun 19 '16 at 15:36
  • $\begingroup$ what if all it does is make that one vertex without making all the faces. Is that a whole lot of work too? $\endgroup$ – eromod Jun 19 '16 at 16:17
  • $\begingroup$ Not sure I understood @eromod. Move only the vertex without the faces attached to it? (that would be impossible unless you duplicate the vertex, and then, what's the point?) $\endgroup$ – TLousky Jun 19 '16 at 21:05
7
$\begingroup$

Use aligning viewport to selected mesh elements (in this case, edge of the pyramid). This is faster than creating custom transform orientation, however you should keep track of viewport angle.

  1. Select one of pyramid's edges. Set Selection mode to Edge.
  2. Press Shift+Numpad 3 to enter Side Ortho view for selected edge.
  3. Enable Snap during transform, set Type of element to snap to Vertex.
  4. Select vertex to be aligned to the top. Press Alt+Space and select View to set transform orientation to View and to move selection along it.
  5. Grab vertex while choosing for tranform only X or Y axes. Depending on the view press Y or X twice for that. Hover mouse over vertices of pyramid's edges to align selection to them.

(Addition - if the pyramid doesn't have perpendicular side edges)

  1. Set transform orientation to Normal. Set Pivot Point to Active Element. With the top vertex still selected, select one more, which was hovered over while aligning in the step 5.
  2. S to scale based on location of the last selected vertex. Lock normal X axis by pressing Shift+X twice. Hover mouse over top vertex of the side edge of the pyramid which is seen in the middle of the pyramid (in Side Ortho view).

    aligning vertex on two converging but not intersecting edges GIF

While this method is a bit more complex, it provides exact aligning of the top vertex making all the side edges of the same length; thus no faces will be splitted in the middle of the pyramid and the shading will be better. You can preview the gif for simple case in the version history.

See also How do I align the viewport to a face normal?

$\endgroup$
  • $\begingroup$ For information, I was not able to make it work except if the pyramid edges are at orthogonal. What is wrong for me ? $\endgroup$ – lemon Jun 20 '16 at 7:04
  • $\begingroup$ @MrZak what I meant is in your example the pyramid edges are orthogonal and all is ok. But if they are not, I was not able to apply this method $\endgroup$ – lemon Jun 20 '16 at 10:12
4
$\begingroup$

You could flatten the top with the base (scale to Z - 0) to allign all of the vertices (if they are not already linear, obviously), then use proportional editing (in your header menu) with a linear falloff and drag only the vertex that reprisents the top of the pyramid (make sure all the other vertices you wish to translate are within the UI circle - MMB by default to scale the circle). EDIT: And after that, adjust the Z values of the vertices that refuse to allign.

Linear Falloff

But if your model looks anything like in your example above it might be more efficient to simply merge the top vertices into a single vertex and drag that one.

$\endgroup$
  • $\begingroup$ The "real" vertices stay like they should, but the vertices in between those (in the example above; the vertices at the bottom center of each face) still move up. When I merge the top vertices to a single vertex (Alt+M), the structure of my existing faces will be destroyed. $\endgroup$ – leyren Jun 19 '16 at 12:02
  • $\begingroup$ What about adjusting the Z position values of the incorrect vertices to match the correct ones? I know its a workaround, but at least it should solve the problem. $\endgroup$ – Dennis Jun 19 '16 at 12:22
  • $\begingroup$ No problem, just ensure to check the stuff eromod just posted, he might have a better sollution. $\endgroup$ – Dennis Jun 19 '16 at 12:57
0
$\begingroup$

As "trick and tips", another solution to find the aligned top pyramid vertex :

  • 1 Select and duplicate an edge
  • 2 Scale it so that it goes over the middle of the pyramid
  • 3 Use W then "Symetrize"
  • The wanted point is on 4

enter image description here

$\endgroup$

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.