Hi, I have imported a terrain modeled from “isohypse” or horizontal terrain contour, and looks fine when smoothed.
BUT I want to see these lines also when the terrain is smoothed.
See screenshot (“isoipse_other” from an other software).
So I need the select these edge all (the one sharing same Z) and only them.
So I can later give them the corrisponding property in render.
Is there a Short way ?
thank you
I did try a boolean operation with a plane (array along the Z axis) , so to say it “draws” the lines again, but the shape is too complex and does not works.
I remeber as well you could do it in render through the “modulo” math node, but I have to find again how it works.
with nodes it affects only the material and texture
cannot find it right now
but I redid some script for it using Bmesh
now problem is that if you use = values I mean this is so precise you might never find one !
so need to more or less use a range -very small one but at least will find some values close to some Z value
Very nice, it works!
Provided that you remember to select everything, because the script does not select, but de-select.
This said, I’ve made an error:
I thought it was enough to select vertices and then, with vertices selected, you switch to edge mode and you set the properties you need.
In my case, as soon as I switch to edge mode, blender select ALL edges and vertices, not only edges connecting selected vertices.
I can’t figure out why.
I’m not very confindent in Python, so could you suggest me where the change the syntax from “select vertices” to “select edges” ?
hi ricky,
In object mode the script works better, even as the workflow is not so straight forward:
go in vertices select mode
deselect everything
go in object mode
run the script
go back in edit mode
switch to select edges with those vertices selected
assign the property as needed (edge crease and freestyle)
repeat.
It seams we need in the script something to “reset” selection befor running the script,
and it does not work in edit mode, as the program had a hidden “memory” of selected edges.
It seems to be a common issue:
For edges, blender calculates the midpoint, and that stays on the same Z value.
So it might be worth the effort.
I’m not sure if the point is this
“for v in bm.verts:”
so I’ve searched and found this:
witch could lead to this:
import bpy, bmesh
me = bpy.context.object.data
bm = bmesh.new()
bm.from_mesh(me)
EPSILON = 1.0e-5
zheight = 2.5
for vert in bm.verts:
if ( vert.co.z >= zheight - EPSILON ) and ( vert.co.z <= zheight + EPSILON ):
vert.select = True
for edge in bm.edges:
if edge.verts[0].select and edge.verts[1].select:
edge.select = True
bm.to_mesh(me)
bm.free()