1
$\begingroup$

I have a mesh stored in ply file (or the obj equivalent). I'd like to do the following operation:

  1. If all the vertices are numbered (like v0,...vn) I'd like to specify a set indices to select those instead of selecting them manually.
  2. Once I select such vertices I'd like to remove all the other ones and keep those.

The idea would be to keep a small square region of the mesh (which essentially is an height map).

Is there a quick way to do such job?

I'm not a blender expert and sometimes the interface is a bit hard to understand.

I'm aware that If I press the B button I can select using a box, but unless I align the camera correctly I always miss some of the points and include others that I don't actually need.

Any suggestion?

As example consider the following grid, and I'd like to crop it from 10x10 (original size) to, say, 4x4.

ply
format ascii 1.0
comment Created by Blender 2.79 (sub 0) - www.blender.org, source file: ''
element vertex 100
property float x
property float y
property float z
property float nx
property float ny
property float nz
element face 81
property list uchar uint vertex_indices
end_header
-10.000000 -10.000000 0.000000 0.000000 0.000000 1.000000
-7.777778 -10.000000 0.000000 0.000000 0.000000 1.000000
-7.777778 -7.777778 0.000000 0.000000 0.000000 1.000000
-10.000000 -7.777778 0.000000 0.000000 0.000000 1.000000
-5.555556 -10.000000 0.000000 0.000000 0.000000 1.000000
-5.555556 -7.777778 0.000000 0.000000 0.000000 1.000000
-3.333333 -10.000000 0.000000 0.000000 0.000000 1.000000
-3.333333 -7.777778 0.000000 0.000000 0.000000 1.000000
-1.111111 -10.000000 0.000000 0.000000 0.000000 1.000000
-1.111111 -7.777778 0.000000 0.000000 0.000000 1.000000
1.111112 -10.000000 0.000000 0.000000 0.000000 1.000000
1.111112 -7.777778 0.000000 0.000000 0.000000 1.000000
3.333334 -10.000000 0.000000 0.000000 0.000000 1.000000
3.333334 -7.777778 0.000000 0.000000 0.000000 1.000000
5.555556 -10.000000 0.000000 0.000000 0.000000 1.000000
5.555556 -7.777778 0.000000 0.000000 0.000000 1.000000
7.777778 -10.000000 0.000000 0.000000 0.000000 1.000000
7.777778 -7.777778 0.000000 0.000000 0.000000 1.000000
10.000000 -10.000000 0.000000 0.000000 0.000000 1.000000
10.000000 -7.777778 0.000000 0.000000 0.000000 1.000000
-7.777778 -5.555556 0.000000 0.000000 0.000000 1.000000
-10.000000 -5.555556 0.000000 0.000000 0.000000 1.000000
-5.555556 -5.555556 0.000000 0.000000 0.000000 1.000000
-3.333333 -5.555556 0.000000 0.000000 0.000000 1.000000
-1.111111 -5.555556 0.000000 0.000000 0.000000 1.000000
1.111112 -5.555556 0.000000 0.000000 0.000000 1.000000
3.333334 -5.555556 0.000000 0.000000 0.000000 1.000000
5.555556 -5.555556 0.000000 0.000000 0.000000 1.000000
7.777778 -5.555556 0.000000 0.000000 0.000000 1.000000
10.000000 -5.555556 0.000000 0.000000 0.000000 1.000000
-7.777778 -3.333333 0.000000 0.000000 0.000000 1.000000
-10.000000 -3.333333 0.000000 0.000000 0.000000 1.000000
-5.555556 -3.333333 0.000000 0.000000 0.000000 1.000000
-3.333333 -3.333333 0.000000 0.000000 0.000000 1.000000
-1.111111 -3.333333 0.000000 0.000000 0.000000 1.000000
1.111112 -3.333333 0.000000 0.000000 0.000000 1.000000
3.333334 -3.333333 0.000000 0.000000 0.000000 1.000000
5.555556 -3.333333 0.000000 0.000000 0.000000 1.000000
7.777778 -3.333333 0.000000 0.000000 0.000000 1.000000
10.000000 -3.333333 0.000000 0.000000 0.000000 1.000000
-7.777778 -1.111111 0.000000 0.000000 0.000000 1.000000
-10.000000 -1.111111 0.000000 0.000000 0.000000 1.000000
-5.555556 -1.111111 0.000000 0.000000 0.000000 1.000000
-3.333333 -1.111111 0.000000 0.000000 0.000000 1.000000
-1.111111 -1.111111 0.000000 0.000000 0.000000 1.000000
1.111112 -1.111111 0.000000 0.000000 0.000000 1.000000
3.333334 -1.111111 0.000000 0.000000 0.000000 1.000000
5.555556 -1.111111 0.000000 0.000000 0.000000 1.000000
7.777778 -1.111111 0.000000 0.000000 0.000000 1.000000
10.000000 -1.111111 0.000000 0.000000 0.000000 1.000000
-7.777778 1.111112 0.000000 0.000000 0.000000 1.000000
-10.000000 1.111112 0.000000 0.000000 0.000000 1.000000
-5.555556 1.111112 0.000000 0.000000 0.000000 1.000000
-3.333333 1.111112 0.000000 0.000000 0.000000 1.000000
-1.111111 1.111112 0.000000 0.000000 0.000000 1.000000
1.111112 1.111112 0.000000 0.000000 0.000000 1.000000
3.333334 1.111112 0.000000 0.000000 0.000000 1.000000
5.555556 1.111112 0.000000 0.000000 0.000000 1.000000
7.777778 1.111112 0.000000 0.000000 0.000000 1.000000
10.000000 1.111112 0.000000 0.000000 0.000000 1.000000
-7.777778 3.333334 0.000000 0.000000 0.000000 1.000000
-10.000000 3.333334 0.000000 0.000000 0.000000 1.000000
-5.555556 3.333334 0.000000 0.000000 0.000000 1.000000
-3.333333 3.333334 0.000000 0.000000 0.000000 1.000000
-1.111111 3.333334 0.000000 0.000000 0.000000 1.000000
1.111112 3.333334 0.000000 0.000000 0.000000 1.000000
3.333334 3.333334 0.000000 0.000000 0.000000 1.000000
5.555556 3.333334 0.000000 0.000000 0.000000 1.000000
7.777778 3.333334 0.000000 0.000000 0.000000 1.000000
10.000000 3.333334 0.000000 0.000000 0.000000 1.000000
-7.777778 5.555556 0.000000 0.000000 0.000000 1.000000
-10.000000 5.555556 0.000000 0.000000 0.000000 1.000000
-5.555556 5.555556 0.000000 0.000000 0.000000 1.000000
-3.333333 5.555556 0.000000 0.000000 0.000000 1.000000
-1.111111 5.555556 0.000000 0.000000 0.000000 1.000000
1.111112 5.555556 0.000000 0.000000 0.000000 1.000000
3.333334 5.555556 0.000000 0.000000 0.000000 1.000000
5.555556 5.555556 0.000000 0.000000 0.000000 1.000000
7.777778 5.555556 0.000000 0.000000 0.000000 1.000000
10.000000 5.555556 0.000000 0.000000 0.000000 1.000000
-7.777778 7.777778 0.000000 0.000000 0.000000 1.000000
-10.000000 7.777778 0.000000 0.000000 0.000000 1.000000
-5.555556 7.777778 0.000000 0.000000 0.000000 1.000000
-3.333333 7.777778 0.000000 0.000000 0.000000 1.000000
-1.111111 7.777778 0.000000 0.000000 0.000000 1.000000
1.111112 7.777778 0.000000 0.000000 0.000000 1.000000
3.333334 7.777778 0.000000 0.000000 0.000000 1.000000
5.555556 7.777778 0.000000 0.000000 0.000000 1.000000
7.777778 7.777778 0.000000 0.000000 0.000000 1.000000
10.000000 7.777778 0.000000 0.000000 0.000000 1.000000
-7.777778 10.000000 0.000000 0.000000 0.000000 1.000000
-10.000000 10.000000 0.000000 0.000000 0.000000 1.000000
-5.555556 10.000000 0.000000 0.000000 0.000000 1.000000
-3.333333 10.000000 0.000000 0.000000 0.000000 1.000000
-1.111111 10.000000 0.000000 0.000000 0.000000 1.000000
1.111112 10.000000 0.000000 0.000000 0.000000 1.000000
3.333334 10.000000 0.000000 0.000000 0.000000 1.000000
5.555556 10.000000 0.000000 0.000000 0.000000 1.000000
7.777778 10.000000 0.000000 0.000000 0.000000 1.000000
10.000000 10.000000 0.000000 0.000000 0.000000 1.000000
4 0 1 2 3
4 1 4 5 2
4 4 6 7 5
4 6 8 9 7
4 8 10 11 9
4 10 12 13 11
4 12 14 15 13
4 14 16 17 15
4 16 18 19 17
4 3 2 20 21
4 2 5 22 20
4 5 7 23 22
4 7 9 24 23
4 9 11 25 24
4 11 13 26 25
4 13 15 27 26
4 15 17 28 27
4 17 19 29 28
4 21 20 30 31
4 20 22 32 30
4 22 23 33 32
4 23 24 34 33
4 24 25 35 34
4 25 26 36 35
4 26 27 37 36
4 27 28 38 37
4 28 29 39 38
4 31 30 40 41
4 30 32 42 40
4 32 33 43 42
4 33 34 44 43
4 34 35 45 44
4 35 36 46 45
4 36 37 47 46
4 37 38 48 47
4 38 39 49 48
4 41 40 50 51
4 40 42 52 50
4 42 43 53 52
4 43 44 54 53
4 44 45 55 54
4 45 46 56 55
4 46 47 57 56
4 47 48 58 57
4 48 49 59 58
4 51 50 60 61
4 50 52 62 60
4 52 53 63 62
4 53 54 64 63
4 54 55 65 64
4 55 56 66 65
4 56 57 67 66
4 57 58 68 67
4 58 59 69 68
4 61 60 70 71
4 60 62 72 70
4 62 63 73 72
4 63 64 74 73
4 64 65 75 74
4 65 66 76 75
4 66 67 77 76
4 67 68 78 77
4 68 69 79 78
4 71 70 80 81
4 70 72 82 80
4 72 73 83 82
4 73 74 84 83
4 74 75 85 84
4 75 76 86 85
4 76 77 87 86
4 77 78 88 87
4 78 79 89 88
4 81 80 90 91
4 80 82 92 90
4 82 83 93 92
4 83 84 94 93
4 84 85 95 94
4 85 86 96 95
4 86 87 97 96
4 87 88 98 97
4 88 89 99 98
$\endgroup$
  • 2
    $\begingroup$ You may consider writing a short python script in blender for that $\endgroup$ – WhatAMesh Sep 17 '18 at 11:25
  • $\begingroup$ That's not a bad idea... $\endgroup$ – user8469759 Sep 17 '18 at 11:28
  • $\begingroup$ What is the alignment of the mesh?. Sounds like you can simply select verts to delete if they are outside a range. Eg if x coordinate of vert is outside range [A, B] and similarly for y in [C, D]... vert.select = not((A <= vert.co.x <= B) and (C <= vert.co.y <= D)) $\endgroup$ – batFINGER Sep 17 '18 at 11:41
  • $\begingroup$ @batFINGER Topology wise they're sorted in scanline order already. From the top it's clearly visible. $\endgroup$ – user8469759 Sep 17 '18 at 11:44
  • 2
    $\begingroup$ Please consider adding more info and maybe a small sample file, image etc to question. $\endgroup$ – batFINGER Sep 17 '18 at 11:47
1
$\begingroup$

The Boolean Modifier

Suggest using the boolean modifier.

An intersection boolean modifier would be ideal for this.

enter image description here

The image shows a 20 x 20 grid (imagine that is your surface from STL) which limited in size to be within the cube displayed as only its bounding box.

Size and move the cube to suit the desired part of grid to keep.

Applying the modifier will have the effect of removing the unwanted part.

$\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.