[Gmsh] SketchUp to GEO file: line loop question

Martin Vymazal martin.vymazal at vki.ac.be
Fri Sep 21 17:57:17 CEST 2012


Hi Alessandro,

 I'm not sure I understand your question and I don't know Google SketchUp, but 
if you know which edges should form your line loop and you know the starting 
and ending vertex number for each of these edges, then it should be quite 
simple: 
  1) pick the first edge from a loop

  2) the following edge must be such that its starting vertex number is the 
same as the ending vertex number of the previous edge. If that's not the case, 
add the new edge in the for loop with a minus sign (i.e. flip it)
 Here I suppose that the new edge you're adding has at least one vertex common 
with the prevous edge

 3) if there are any edges left to process (the loop is still not closed), 
repeat 2)

 I don't know if the edges coming from SketchUp are already ordered and 
they're just not oriented, or if they are not ordered at all. In the latter 
case, you'll have to modify step 2) to search for suitable candidate edges 
every time you want to increment your line loop.

 Best regards,

   Martin Vymazal


On Friday 21 of September 2012 12:07:38 Alessandro Barracco wrote:

Hi all, I'm writing a Google SkecthUp plugin that export geometry into the 
*.geo format. I'm able to export vertices, edges and, partially, the line 
loops. But I don't know how to choose the right sign for all the edges that 
form a loop: to be much clear, I need an algorithm that help me to understand 
when the edge orientation agrees with the choosed direction of travel into the 
loop. Any suggestion?


-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.geuz.org/pipermail/gmsh/attachments/20120921/c9b1ee82/attachment.html>