6
$\begingroup$

What is the best way to recover the extrusion you have performed to your object? enter image description here

Above is just an example, but should describe the case. And I'm not looking for answer like: draw a new sphere. Also "undo (Ctrl+Z)" is not an option (noticed the design error too late).

So far I have found two options:

  1. I select all of those faces and delete. But then I get hole on my sphere. I can fill the cap by F or Alt+F, but the surface is not the same anymore.

  2. Other option that comes to mind is lowering this close enough to the surface, and then using merge vertices. But then those two vertices on middle of those six faces are not meltdown to anywhere, and again surface does not look correct.

$\endgroup$
1
  • 2
    $\begingroup$ delete this part then you have a hole that you fill with ctrl F > Grid Fill (and tweak the parameters in the Operator box if necessary) $\endgroup$
    – moonboots
    Aug 20, 2020 at 20:19

4 Answers 4

4
$\begingroup$

Script version.

enter image description here

Un-Extrude along face normals

  • Finds the average normal of all selected faces.
  • Finds the average edge length of extruded edges.
  • Translates all vertices back
  • Removes Doubles. (From the collapsed edges)

In edit mode select the faces, then run script.

import bpy
import bmesh
from mathutils import Vector

ob = bpy.context.object
me = ob.data

bm = bmesh.from_edit_mesh(me)
faces = [f for f in bm.faces if f.select]
verts = set(v for f in faces for v in f.verts ) # or from selected verts
edges = [e for v in verts for e in v.link_edges
            if not e.select ]
norm = (sum((f.normal for f in faces), Vector()) / len(faces)).normalized()
norm.negate()
d = sum(e.calc_length() for e in edges) / len(edges)

bmesh.ops.translate(
        bm,
        verts=list(verts),
        vec=d * norm,
        )            
bmesh.ops.remove_doubles(
        bm,
        verts=[v for e in edges for v in e.verts],
        dist=1e-5,
        )   
for f in faces:
    f.select_set(True)                 
bmesh.update_edit_mesh(me)

Notes

An improvement would be to find all the selected face islands within the selection and "unextrude" on an island by island basis.

This is "unextruding" an extrusion along face normal. Instead of the average face normal, the vector defined by any (or an average of all) edges would be a better fit.

Any direction un-extrude

enter image description here

After extruding the created extruded edges will (AFAIK) all be the extrusion vector.

import bpy
import bmesh
from mathutils import Vector

ob = bpy.context.object
me = ob.data

bm = bmesh.from_edit_mesh(me)
faces = [f for f in bm.faces if f.select]
verts = set(v for f in faces for v in f.verts ) # or from selected verts
edges = [e for v in verts for e in v.link_edges
            if not e.select ]

v0, v1 = sorted(edges[0].verts[:], key=lambda v:v.select)
bmesh.ops.translate(
        bm,
        verts=list(verts),
        vec=v0.co - v1.co,
        )            

bmesh.ops.remove_doubles(
        bm,
        verts=[v for e in edges for v in e.verts],
        dist=1e-5,
        )  
for f in faces:
    f.select_set(True)          
bmesh.update_edit_mesh(me)

enter image description here Added a test on Suzanne. The remove doubles has effect of unselecting a face depending on which edge vert was removed.... have updated script to restore selection

$\endgroup$
9
$\begingroup$

This is an even extrusion, no scaling. So..

  • Alt-select the ring of generated faces, X delete them
  • Hover - L select the isolated patch
  • With Snap set to 'Vertex', 'Active', the whole patch selected, and a convenient vertex made active, just G snap the patch back into place..
  • All verts selected, M merge > By Distance.
$\endgroup$
6
$\begingroup$

Delete the extrusion, select the hole edge loop, press CtrlF > Grid Fill, it will fill the hole and respect the topology (you can tweak some parameters in the Operator box):

enter image description here

$\endgroup$
3
$\begingroup$
  1. Set the transform orientation to "Normal"
  2. Select extruded face patch
  3. Press G to grab and Z to constrain to the normal direction
  4. Do your best to return the face patch to its original position (Snap should help, but I can't ever get it to work for me)
  5. Merge the vertices by distance.
$\endgroup$

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .