views:

66

answers:

1

Hi all. I got a problem of selecting triangles in a model with a particular way. The problem is simple enough : User have a model (made from triangles) , on that model define some margine line (cutting line if you wish), and after based on array of the verticies of the margin line I would like to select one part of the model or another part of the same model. Here is the picture. alt text

The cutting line makes a circle arround a model and I would like to select a model, let's say in area (1) based on verticies of the cutting line. I have information about relationship always any object on the scene (vertex vs Triangle, triangle vs lines, vertex vs lines and so on)

P.S. If we assume that, for example Y axis is always in one direction, let's say to down, and want to select only neighbour triangles for every vertex that have their vertex Y coordinate major, it will not work, as, if you look at the image, the triangle in the (2) selection it's a neigbour triangle of a vertex from cutting line, and it's vertex Y coordinate sutisfies condition, but this is not a riangle that I would like to select.

Any ideas on subject ?

A: 
ybungalobill
Ok,but idea here is about to select a desired surface having like a parameter a VERTEX array, not lines. I would agree with you in case if we are talking about line collection like an input. In that case we have a real line that separates one surface from another. But in case of verticies only thing that we have is a just neigbour triangles for each vertex...
Tigran
You said that you have a "cutting line" so you know vertices and *edges*, right? "in case of verticies only thing ..." sorry, can't understand. Can you rephrase you question in terms of set theory? You hava a mesh with *triangles, edges* and *vertices*. What else is the input of the desired algorithm? A subset of *vertices*?
ybungalobill
The input of desired algorithm is ONLY a subset of verticies of the "cutting line". What am I able to do: from vertex I'm able to retrieve its neighbour triangles, so the lines too.
Tigran
@Tigran: then how do you know that this subset actually form a line? What if the input is just a pair of vertices from different triangles?
ybungalobill
the function must receive the sequence of the verticies from the "cutting line". it's a caller responsability to make an array of correct verticies, we do not need to wary about that. In other words the correctness of data is not our wary, we need to deal with the way we treat that data.
Tigran
@Tigran: I strongly recommend that you redesign your program so you select the edges in the first place. If that's impossible *and* you're sure that the input is correct, you can easily find all selected edges like this: edge `e` is selected if and only if both its vertices are selected.
ybungalobill
Unfortunately redisign is not possible as is for now.
Tigran