3
$\begingroup$

I would like to select in python the visible perimeter of a mesh. My idea is to get only the external vertices, not all visible.

Any idea or link that can help me?

$\endgroup$
3
$\begingroup$

BMEdge.is_boundary


Can select boundary edges using BMEdge.is_boundary Below is a test script, run in edit mode

import bpy
import bmesh
context = bpy.context

obj = context.edit_object
me = obj.data
bm = bmesh.from_edit_mesh(me)
bm.select_mode |= {'EDGE'}
for e in bm.edges:
    e.select = e.is_boundary
bm.select_flush_mode()   
me.update()

Not sure here if you are after the "silhouette" verts. As in your question here

| improve this answer | |
$\endgroup$
0
$\begingroup$

If your mesh is not very complex, you can do this manually.

  1. Switch to Edit Vertex mode.
  2. Hold Ctrl and LMB and move the mouse. You will notice the dynamic selection region appears.
  3. Try drawing a circular selection region with some radius. Don't release Ctrl and LMB.
  4. Once the circle is complete, don not release Ctrl and LMB, pick a larger radius and do that again. You will see that the inner circle is now inverted and your selection region looks like a donut. Vertices inside that area are selected.

Second way is to enable the LoopTools add-on in User Preferences (search for it as LoopTools - without space). This extension brings new menu items in the 3d-view.

Select a few consequent vertices that belong to the perimeter and then try Select / Edge Loops. This may or may not work, depends on your mesh. Works well on spheres.

| improve this answer | |
$\endgroup$
  • $\begingroup$ The mesh can be very complex and I want to do all with python. More or less, I want the same you get when select an object in the viewport and you see a highlight color in the perimeter, including internal holes. $\endgroup$ – Antonioya Feb 18 '16 at 17:59

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.