#26 Grow Edges


Hello! I am currently using Meshlab as part of our pipeline for 3D scanning and milling.
When we mill the mesh, the CAD software usually drops down to the mesh, so if there is a hole in the mesh it will continue straight thorugh and generate milling code all the way to the bottom of the stock object. Holes can be closed, but if the outline of the mesh, as seen from above, is irregular you can get similar problem on the outskirts of the mesh. What I would like to do is to "grow the edges" so to speak. Consider having a mesh of a trumpet, and you want to make the trumpet mouth wider all around. You run this filter, and all the edges around the horn of the trumpet is automatically extended.

There is already a filter for selection the edges vertexes in meshlab. I would like to take the normals of the edge vertexes and grow the outward in the direction 90* opposite of the normal, whichever of those that is directly away a centerpoint (that could be selected by the mouse). I believe this should be a very simple filter to create, but extremely useful for our company. Efforts to solve this will be compensated.

THis is some pseudocode to illustrate ( I can code this myself, but I only know Java, VisualBasic, ActionScript, PHP and SQL and not C++)

' select all edge vertexes using selectEdges filter
pos centrePoint as = [X, Y, Z]
! Load all the edge vertexes into an array
Array edgeVertexIndexes = selectEdgesFilter()

! Loop through the edeges
for each i in edgeVertexesIndex
! Get the current vertex

currentEdgeVertex = vertexes(edgeVertexIndex(i))
!Create a new vertex and connect them
 newVertex =    vertexes.add()
! Connect the two vertexes
! Determine the position of the new vertex, depending on the  centrepoint (simplified, probably better to use normal)

! IF the vertex is more further in the x direction than center point, continue in that direction

if currentEdgeVertex.pos.x - centrePoint.pos.x > 0 then
newWertex = currentEdgeVertex.pos.x += 100
!move in different direction
newWertex = currentEdgeVertex.pos.x += 100


  if   currentEdgeVertex.pos.y - centrePoint.pos.y  > 0 then
      newWertex.pos.x = currentEdgeVertex.pos.y+= 100
      newWertex.pos.y = currentEdgeVertex.pos.y += 100

  newVertex.pos.z = currentEdgeVertex.pos.z




Log in to post a comment.

Get latest updates about Open Source Projects, Conferences and News.

Sign up for the SourceForge newsletter:

No, thanks