68
$\begingroup$

I have a mesh which I have imported from an OBJ file. I would like to apply Material A to the section of the mesh which is on one side of a given plane, and apply Material B to the section of the mesh which is on the other side of that plane. A potential plane is indicated here as a blue line. Note that it does not necessarily intersect the centre.

To do this, I need to split the any faces which intersect this plane, and select all faces on one side of the plane so that I can apply a material to them. How can I do this in the current versions of Blender?


I've tried using the K knife tool in Z cut-through mode, but the cuts haven't been reliable. Even when they were, after the cut was finished I couldn't figure out how to select only the faces on one side of the cut. (The details were too fine to be reliably selected with any tools I know, such as the C circle select tool.) I tried using the B selection tool, but it only selected the faces on the near-side of the mesh.

We used to have a procedure to cut a mesh using a plane in Blender 2.4, but it involved using mesh boolean tools which appear to have been replaced, and I can't figure out how to adapt it.

$\endgroup$
2
  • $\begingroup$ Another use for this is for deleting one side before creating a mirrored object. $\endgroup$ Feb 18, 2014 at 21:11
  • $\begingroup$ If i may point to blender.stackexchange.com/questions/143100/…, i answered there with my (free) add-on, that does exactly what was asked there and if i read it right, here too, using a plane to cut (non-destructive). $\endgroup$
    – Xylvier
    Nov 21, 2019 at 16:43

6 Answers 6

84
$\begingroup$

I would recommend using the bisect tool (new in Blender 2.69):

  1. Enter edit mode (Tab), then press Space and type in Bisect, or select Bisect from the toolshelf (under Add).
  2. Click and drag, to bisect the object. enter image description here
  3. Press F6 to bring up the options for the tool, and select clear inner, or clear outer depending on which half you don't want. enter image description here

If you don't want to delete half, but just want to select it:

  1. Instead of step 3, press H to hide the loop: enter image description here
  2. Hover over the half you want and press L to select linked vertices under the cursor: enter image description here
  3. Unhide everything (AltH), leaving you with one half of the object selected: enter image description here
$\endgroup$
8
  • $\begingroup$ Thank you, that's incredibly helpful! Do you know if there's a way to just select the other half, instead of deleting it? $\endgroup$
    – Jeremy
    Dec 5, 2013 at 20:32
  • 1
    $\begingroup$ @JeremyBanks yep, added the process to the answer. $\endgroup$
    – CharlesL
    Dec 5, 2013 at 20:35
  • 1
    $\begingroup$ Thank you very much. That almost works, but unfortunately the selections created with <kbd>L</kbd> sometimes cross over the bisection, even with the middle parts hidden. I'll keep trying to figure it out. Even if I can't get it perfect, you've helped me get a much better result than I had so far. $\endgroup$
    – Jeremy
    Dec 5, 2013 at 21:19
  • 2
    $\begingroup$ @JeremyBanks I think you are looking for Select > Select Loop Inner Region. $\endgroup$ Dec 6, 2013 at 5:03
  • 1
    $\begingroup$ Note that this feature was added in Blender 2.69, which is at present newer than the version in the Ubuntu repositories. You can get a newer version from a PPA: askubuntu.com/questions/4586/… $\endgroup$ Feb 18, 2014 at 21:09
20
$\begingroup$

A recommended workflow here would be:

  1. KZC, then drag a perfect vertical line. (Optional for C)
  2. Menu: Select > Select Loop Inner Region, to select one side of the cut result.(F6 > Select Bigger to select the other side)
  3. Assign a second material for the selection. Done.

As shown below: enter image description here

$\endgroup$
5
  • $\begingroup$ @Jeremy Banks, have you solved it? $\endgroup$ Mar 24, 2014 at 1:08
  • 1
    $\begingroup$ I'd prefer this version over CharlesL's, because I had to cut in the perfect middle and with K + Ctrl you can snap to the exact center of an edge and thus keep full precision. $\endgroup$
    – Jan
    Dec 21, 2014 at 15:21
  • 2
    $\begingroup$ A better answer would explain what KZC is, because in my version I don't think it is the same. $\endgroup$
    – Octopus
    Apr 11, 2020 at 0:58
  • $\begingroup$ K Z C has no effect for me in blender 2.8 $\endgroup$
    – ivanzoid
    Jan 2, 2021 at 9:56
  • $\begingroup$ @ivanzoid @Octopus i know this is an older question but you need to be in Edit mode for an object. k = Knife. Z = Pass Through option. C = constrain angle option $\endgroup$
    – g19fanatic
    Jun 3, 2021 at 20:50
11
$\begingroup$

If you want to create two identical halves from a symmetrical mesh, all you need to do is to tab into Edit Mode and press Numpad 5 then Numpad 1. Now you can press B for Box Select and drag over the vertices to one side of the center line, then delete those vertices.

GIF Illustration

This method can be used to make Vertex Groups for easy selection, so you can assign materials. Notice that your selection will be limited to the vertex locations, and no new geometry will be created to ensure a straight line.

$\endgroup$
1
  • $\begingroup$ What if I have keyboard without Numpads? $\endgroup$
    – ivanzoid
    Jan 2, 2021 at 9:57
4
$\begingroup$

Just to add a more procedural way to do this cutting thing. This is one solution if using Sverchok Add-On. The cutting is done using Bisect Node, very similar to Blender's Modeling own Bisect operation.

enter image description here

enter image description here

https://gist.github.com/d6149321dfa1cce9db64347f48a33bf5

You will end up with 2 new objects in this case, but you can join them if you like.

$\endgroup$
2
  • $\begingroup$ What is the 2nd picture? $\endgroup$
    – kyb
    Mar 24, 2018 at 22:50
  • 1
    $\begingroup$ 2nd picture is Sverchok node tree. You need to install this addon. $\endgroup$ Mar 25, 2018 at 10:40
1
$\begingroup$

If you just want to do a temporary bisect you can also use the Bool Modifier.

Create an object with the shape of the cut you want to make, call your object cutout just for easy reference, then select the object you want to cut, add Modifier > Generate > Boolean and on the object select cutout, then select the type of operation you want to make, Intersect, Union or Diference...

Since this is a Modifier, the changes are not applied until you do so, and if you make a copy of the object, you can apply the same Modifier with opposite operation to create the effect you are looking for.

$\endgroup$
0
$\begingroup$

2.8x bmesh version. Using cursor for plane coords

This one popped up today so what the hey. a blatant attempt to improve my people reached

enter image description here A plane has been used as a visual tied to cursor orientation

Extended the bmesh bisect plane operator to return the left and right faces, and the cut's edges.

import bpy
import bmesh
from mathutils.geometry import distance_point_to_plane as dp2p

def bisect(bm, plane_co=(0, 0, 0), plane_no=(1, 0, 0)):
    ret = bmesh.ops.bisect_plane(bm,
            geom=bm.faces[:] + bm.edges[:] + bm.verts[:],
            plane_co=plane_co,
            plane_no=plane_no
            )

    cut = [e for e in  ret["geom_cut"] if isinstance(e, bmesh.types.BMEdge)]

    left = []
    right = []

    for f in ret["geom"]:
        if not isinstance(f, bmesh.types.BMFace):
            continue
        left.append(f) if dp2p(f.calc_center_median(), plane_co, plane_no) > 0 else right.append(f)
        continue
    return left, cut, right

For the case in question to create new edges at cut and set materials left and right.

Example script append to above and run in object mode

context = bpy.context
scene = context.scene
cu = scene.cursor
ob = context.object

# convert cursor coordinates to object space 
mwi = ob.matrix_world.inverted()
plane_co = mwi @ cu.location
plane_no = mwi.to_3x3() @ cu.matrix.to_3x3().transposed()[2]
# create a bmesh from context object
me = ob.data
bm = bmesh.new()
bm.from_mesh(me)
left, cut, right = bisect(bm, plane_co, plane_no)

# do something 
for f in left:
    f.material_index = 1
for f in right:
    f.material_index = 2
bm.to_mesh(me)
me.update()

Split the cut edges

bmesh.ops.split_edges(bm, edges=cut) 

List of all vert indices in left faces, assigned to a new vertex group

# all left verts
left_verts = [v.index for v in set(v for f in left for v in f.verts)]
# create and assign to vertex group
vg = ob.vertex_groups.new(name="Left")
vg.add(left_verts, 1.0, 'REPLACE')
$\endgroup$

You must log in to answer this question.

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