surface flattening
Forum rules
Be nice to others! Read the FreeCAD code of conduct!
Be nice to others! Read the FreeCAD code of conduct!
surface flattening
I think FreeCAD doesn't provide any surface flattening algorythm right now. As we need this for OpenGlider and it could be useful for FreeCAD too I wanted to start a small topic about it. My plan is to use a triangle mesh, map it to 2d with lscm[1] and let the deformed mesh relax with a finite element method [2]. I think it is done similarly in commercial programs [3].
If anyone has an idea/input on this topic I would be very pleased to hear it.
[1] http://www.cs.jhu.edu/~misha/Fall09/Levy02.pdf
[2] http://waset.org/publications/7534/surf ... ent-method
[3] https://www.youtube.com/watch?v=5shBx6Nj8II
If anyone has an idea/input on this topic I would be very pleased to hear it.
[1] http://www.cs.jhu.edu/~misha/Fall09/Levy02.pdf
[2] http://waset.org/publications/7534/surf ... ent-method
[3] https://www.youtube.com/watch?v=5shBx6Nj8II
- microelly2
- Veteran
- Posts: 4688
- Joined: Tue Nov 12, 2013 4:06 pm
- Contact:
Re: surface flattening
good idea, i think it's time to have such tools.
I have to read the paper about lscm.
My idea was to analyse the curvature of a face and find the best places to cut and unroll,maybe it results into the same.
I have to read the paper about lscm.
My idea was to analyse the curvature of a face and find the best places to cut and unroll,maybe it results into the same.
Re: surface flattening
segmentation is another problem. it is covered in the lscm-paper shortly. But for sure automatic segmentation would be nice to have too.
lscm simply try to find a coresponding 2d map which minimize the angle difference of all triangles. this can be done by ls-solve one linear system.
the fem step is needed to minimize the internal work. so solution should represent the optimal unwrapped surface. in case the surface is developeable (eg cylinder, cone, oloid...) the solution should be the exact flatted surface.
lscm simply try to find a coresponding 2d map which minimize the angle difference of all triangles. this can be done by ls-solve one linear system.
the fem step is needed to minimize the internal work. so solution should represent the optimal unwrapped surface. in case the surface is developeable (eg cylinder, cone, oloid...) the solution should be the exact flatted surface.
Re: surface flattening
lscm is working
Re: surface flattening
Such tool would likely be useful when forming a piece of metal to get basic material without much waste involved.
P.S. But said that its nice to see on how solid can be turned into surface and now going further to flatten that surface. But its hard to get excited about it if the final destination of such tools isn't for example Reverse Engineering WB.
P.S. But said that its nice to see on how solid can be turned into surface and now going further to flatten that surface. But its hard to get excited about it if the final destination of such tools isn't for example Reverse Engineering WB.
Re: surface flattening
as I have already said we will use this in openglider too. so it will be a c++ shared library + python bindings... writing a interface to freecad shouldn't be that hard. But it makes no sense including it directly in freecad.
Re: surface flattening
Tools like selecting a face of the 3D model and convert it to the BSpline surface. Or to do the same and after flatten the surface (done in C++ with Python bindings)?looo wrote:But it makes no sense including it directly in freecad.
P.S. Where did we go wrong?
Re: surface flattening
I only thought about the need to have this in two different libraries. And I think it is most useful if the unwrapping is provided by a own library.
The fem step is more difficult then I thought. Somehow the mesh has to be fixed. But this is very difficult as it will influence the solution. Constraining one point is ok, but then the solution will rotate about this point.
The fem step is more difficult then I thought. Somehow the mesh has to be fixed. But this is very difficult as it will influence the solution. Constraining one point is ok, but then the solution will rotate about this point.
Re: surface flattening
Typically this problem is solved by using a krylov type solver and removing the nullspace from the solution. In this case all translation and rotations. This makes the matrix regular and hence the system solvable without influencing the solution.
Re: surface flattening
thanks for the hint. I will look if eigen does provide such a solver.
right now i am using sparse cg method which is quite fast on the symmetric matrix. I think there should be also the possibility to rotate the mesh so that one triangle edge align to y=0 and then fix one point of the edge and y of the other point of the edge. I will have a look what's the nicer solution.
right now i am using sparse cg method which is quite fast on the symmetric matrix. I think there should be also the possibility to rotate the mesh so that one triangle edge align to y=0 and then fix one point of the edge and y of the other point of the edge. I will have a look what's the nicer solution.
Last edited by looo on Sun Oct 23, 2016 4:53 pm, edited 1 time in total.