From: Brian Sanjeewa Rupasinghe <jinkabs@gm...>  20130419 16:01:46
Attachments:
Message as HTML

Hi, I have a set of triangles in an Geometry array which together forms a connected strip when placed them according to edge adjacency. However, in the array they are not in order based on the edge adjacency. How can i rearrange (sort) them in the array? Best, Brian. 
From: Martin Davis <mtnclimb@gm...>  20130419 20:07:58
Attachments:
Message as HTML

To do this you need to perform a topological sort, where the triangles are the nodes of the graph and the edgeadjacency provides the graph edges. Since you know the graph is a single line, the sort actually devolves into finding a node with only one other adjacent triangle, and then traversing the graph visiting all the other triangles in turn. Also, since you know that each node has a maximum of two adjacent nodes, you could model the graph using two arrays. A more natural solution would be to create a node object with two references to the adjacent nodes. The sort itself is linear. The hard part is finding the adjacency graph. To do this I would create normalized LineSegments for each edge, You can then use a Map to look up the adjacent triangles. On Fri, Apr 19, 2013 at 9:01 AM, Brian Sanjeewa Rupasinghe < jinkabs@...> wrote: > Hi, > > I have a set of triangles in an Geometry array which together forms a > connected strip when placed them according to edge adjacency. However, in > the array they are not in order based on the edge adjacency. How can i > rearrange (sort) them in the array? > > Best, Brian. > > > >  > Precog is a nextgeneration analytics platform capable of advanced > analytics on semistructured data. The platform includes APIs for building > apps and a phenomenal toolset for data science. Developers can use > our toolset for easy data analysis & visualization. Get a free account! > http://www2.precog.com/precogplatform/slashdotnewsletter > _______________________________________________ > Jtstoposuiteuser mailing list > Jtstoposuiteuser@... > https://lists.sourceforge.net/lists/listinfo/jtstoposuiteuser > > 
From: Stefan Steiniger <sstein@ge...>  20130425 14:36:37

mhm.. how about a "geometric perspective": couldn't you sort based on using the coordinates of the bounding boxes? But well, for that you would need to know the direction of the strip and maybe transform it to an axes direction? stefan Am 19.04.13 16:07, schrieb Martin Davis: > To do this you need to perform a topological sort, where the triangles > are the nodes of the graph and the edgeadjacency provides the graph > edges. Since you know the graph is a single line, the sort actually > devolves into finding a node with only one other adjacent triangle, and > then traversing the graph visiting all the other triangles in turn. > > Also, since you know that each node has a maximum of two adjacent nodes, > you could model the graph using two arrays. A more natural solution > would be to create a node object with two references to the adjacent nodes. > > The sort itself is linear. The hard part is finding the adjacency > graph. To do this I would create normalized LineSegments for each edge, > You can then use a Map to look up the adjacent triangles. > > > On Fri, Apr 19, 2013 at 9:01 AM, Brian Sanjeewa Rupasinghe > <jinkabs@... <mailto:jinkabs@...>> wrote: > > Hi, > > I have a set of triangles in an Geometry array which together forms > a connected strip when placed them according to edge adjacency. > However, in the array they are not in order based on the edge > adjacency. How can i rearrange (sort) them in the array? > > Best, Brian. > > >  > Precog is a nextgeneration analytics platform capable of advanced > analytics on semistructured data. The platform includes APIs for > building > apps and a phenomenal toolset for data science. Developers can use > our toolset for easy data analysis & visualization. Get a free account! > http://www2.precog.com/precogplatform/slashdotnewsletter > _______________________________________________ > Jtstoposuiteuser mailing list > Jtstoposuiteuser@... > <mailto:Jtstoposuiteuser@...> > https://lists.sourceforge.net/lists/listinfo/jtstoposuiteuser > > > > >  > Precog is a nextgeneration analytics platform capable of advanced > analytics on semistructured data. The platform includes APIs for building > apps and a phenomenal toolset for data science. Developers can use > our toolset for easy data analysis & visualization. Get a free account! > http://www2.precog.com/precogplatform/slashdotnewsletter > > > > _______________________________________________ > Jtstoposuiteuser mailing list > Jtstoposuiteuser@... > https://lists.sourceforge.net/lists/listinfo/jtstoposuiteuser > 