surface flattening

Have some feature requests, feedback, cool stuff to share, or want to know where FreeCAD is going? This is the place.
Forum rules
Be nice to others! Read the FreeCAD code of conduct!
looo
Posts: 2951
Joined: Mon Nov 11, 2013 5:29 pm

Re: surface flattening

Postby looo » Mon Sep 11, 2017 2:55 pm

first catch: https://www.opencascade.com/doc/occt-6. ... actor.html
with this it should be possible to get the uv coordinates of an edge. But no idea to which face this data then belongs...

sounds also interesting:
https://www.opencascade.com/doc/occt-6. ... 3ff68c0f61
please help with my conda-packaging efforts: https://liberapay.com/looooo/
looo
Posts: 2951
Joined: Mon Nov 11, 2013 5:29 pm

Re: surface flattening

Postby looo » Wed Sep 20, 2017 4:30 pm

some more problems:

what is the simplest way to add an icon to the MeshWorkbench?
I tried adding it in the InitGui.py but I get this message:

Code: Select all

'MeshWorkbench' object has no attribute '__Workbench__'
which I guess is because python and c++ can't be used both to setup the toolbar.

Is there any other way to do this from python?
please help with my conda-packaging efforts: https://liberapay.com/looooo/
looo
Posts: 2951
Joined: Mon Nov 11, 2013 5:29 pm

Re: surface flattening

Postby looo » Wed Oct 11, 2017 6:37 pm

Some tests with rhino4 resulted in flat-Nurbs of degree 3 and many poles/controlpoints. The result also seems to be non rational. As this can't exactly represent a circle, it seem like rhino use some approximation for the flattening. Maybe there is really no exact flattening procedure for developable nurbs with higher degree...

I will try to proceed with nurbs->nurbs flattening this way:
1 approximate the surface by deg(3, 1) surface with multiple controlpoints
2 do the flattening with subdivided uv mesh or tesselated faces
3 use the same nurbs to approximate the flat mesh

I have looked for methods to approximate/rebuild a surface, but haven't found anything then the face.reparametrization(). But as I need to change the degree and the number of poles this function won't work...
ChrisG wrote:
emills wrote:
microelly2 wrote:
Has anyone experimented already with changing the number of poles/order of nurbs surface? I think a tool like the rhino rebuild command to get a approximated surface with new basis-functions would be nice to have. I don't have a good picture what all the available spline libraries offers...
please help with my conda-packaging efforts: https://liberapay.com/looooo/
User avatar
microelly2
Posts: 4446
Joined: Tue Nov 12, 2013 4:06 pm
Contact:

Re: surface flattening

Postby microelly2 » Thu Oct 12, 2017 6:57 am

I have done some experiments to find "simple" curves which approximate point clouds.
phpBB [video]

in the video there is a interactive postprocess, but I think this can become scripted in futurre too.
the idea is to find the extrema of curvature of the curve as a base for a poles set.
then a 2nd fine tuning process adds more poles
looo
Posts: 2951
Joined: Mon Nov 11, 2013 5:29 pm

Re: surface flattening

Postby looo » Thu Oct 12, 2017 7:34 am

my problem is by far not that hard :D I simple wanted to approximate a NURBS surface by a different bspline-surface. I wasn't aware FreeCAD has already a tool for that. face.toBSpline(tolerance?, u_continuity, v_continuity, max_u_degree, max_v_degree, number_of_patches)
And this works quite good. But my method has one problem with this function which can be seen in the picture:

The problem is that this mesh has only boundary vertices and the result of nurbs.toBSpline(1, "C1", "C1", 3, 1, 10) somehow has degree higher then 1 and not only poles lying on the boundary in v-direction (direction from bottom to top of the cylinder). So the poles in the middle of the cylinder have no impact on the green mesh and are computed to zero.
To solve this I need a mesh which has vertices not only on the boundary, or a bspline-surface which has degree 1 in the direction of the straight lines. But it seems as this doesn't work with nurbs.toBSpline(1, "C1", "C1", 3, 1, 10)
Attachments
unwr_cylinder_1.png
unwr_cylinder_1.png (10.22 KiB) Viewed 882 times
unwr_cylinder.png
unwr_cylinder.png (30.2 KiB) Viewed 882 times
please help with my conda-packaging efforts: https://liberapay.com/looooo/
User avatar
microelly2
Posts: 4446
Joined: Tue Nov 12, 2013 4:06 pm
Contact:

Re: surface flattening

Postby microelly2 » Thu Oct 12, 2017 7:47 am

If you have this mesh you can create a grid structure with inner points and interpolate it to a bspline surface.
User avatar
Chris_G
Posts: 1161
Joined: Tue Dec 31, 2013 4:10 pm
Location: France
Contact:

Re: surface flattening

Postby Chris_G » Thu Oct 12, 2017 9:03 am

looo wrote:
Thu Oct 12, 2017 7:34 am
The problem is that this mesh has only boundary vertices and the result of nurbs.toBSpline(1, "C1", "C1", 3, 1, 10) somehow has degree higher then 1
Hi looo,
Here, you give the function conflicting parameters.
You cannot ask for both Degree 1 and C1 continuity.
This one should give (3,1) degree surfaces :

Code: Select all

nurbs.toBSpline(1, "C1", "C0", 3, 1, 10)
looo
Posts: 2951
Joined: Mon Nov 11, 2013 5:29 pm

Re: surface flattening

Postby looo » Thu Oct 12, 2017 9:24 am

Chris_G wrote:Hi looo,
Here, you give the function conflicting parameters.
You cannot ask for both Degree 1 and C1 continuity.
This one should give (3,1) degree surfaces :
thanks, this solves this issue. As I understand the continuity isn't important for unwrapping, and I can use C0 for both directions. At least this gives quite good results for most surfaces...


Stil there are some problems with the mesh unwrapping. Maybe using the arab-algorithm is a bit more solid...

mesh_bspline.png
mesh_bspline.png (16.31 KiB) Viewed 853 times
please help with my conda-packaging efforts: https://liberapay.com/looooo/
looo
Posts: 2951
Joined: Mon Nov 11, 2013 5:29 pm

Re: surface flattening

Postby looo » Sat Nov 04, 2017 9:26 pm

I try to get the code working on windows, but there are some problems:

maybe someone knows what is going on here...

Code: Select all

FAILED: src/Mod/MeshPart/App/CMakeFiles/flatmesh.dir/MeshFlattening.cpp.obj 
C:\PROGRA~2\MICROS~1.0\VC\bin\amd64\cl.exe  /nologo /TP -DFCAppMeshPart -DHAVE_ACOSH -DHAVE_ASINH -DHAVE_ATANH -DHAVE_MEFISTO -DHAVE_NETGEN -DHAVE_SMESH -DQT_CONCURRENT_LIB -DQT_CORE_LIB -DQT_NO_DEBUG -DQT_XML_LIB -D_OCC64 -Dflatmesh_EXPORTS -Isrc -IC:\Users\fc_builder\projects\FreeCAD\src -IC:<env>\Library\include -IC:<env>\Library\include\opencascade 
-IC:<env>\include -IC:\Users\fc_builder\projects\FreeCAD\src\3rdParty\salomesmesh\inc -IC:<env>\Library\include\vtk-7.1 
-IC:<env>\Library\include\eigen3 -IC:<env>\Library\include\qt -IC:<env>\Library\include\qt\QtCore -IC:<env>\Library\.\mkspecs\win32-msvc2015 -IC:<env>\Library\include\qt\QtXml -IC:<env>\Library\include\qt\QtConcurrent /DWIN32 /D_WINDOWS /W3 /GR /EHsc -D_OCC64 /MD /O2 /Ob2 /DNDEBUG /EHa /showIncludes /Fosrc\Mod\MeshPart\App\CMakeFiles\flatmesh.dir\MeshFlattening.cpp.obj /Fdsrc\Mod\MeshPart\App\CMakeFiles\flatmesh.dir\ /FS -c C:\Users\fc_builder\projects\FreeCAD\src\Mod\MeshPart\App\MeshFlattening.cpp
cl : Command line warning D9025 : overriding '/EHs' with '/EHa'
<env>\Library\include\opencascade\Standard_DimensionError.hxx(26): error C2550: 'Handle_Standard_DimensionError': constructor initializer lists are only allowed on constructor definitions
<env>\Library\include\opencascade\Standard_DimensionError.hxx(26): error C4430: missing type specifier - int assumed. Note: C++ does not support default-int
<env>\Library\include\opencascade\Standard_DimensionError.hxx(26): error C2904: 'Handle_Standard_DimensionError': name already used for a template in the current scope
<env>\Library\include\opencascade\Standard_DimensionError.hxx(26): note: see declaration of 'Handle_Standard_DimensionError'
<env>\Library\include\opencascade\Standard_DimensionError.hxx(26): error C2988: unrecognizable template declaration/definition
<env>\Library\include\opencascade\Standard_DimensionError.hxx(26): error C2143: syntax error: missing ';' before '&'
<env>\Library\include\opencascade\Standard_DimensionError.hxx(26): error C2433: 'Handle_Standard_DimensionError': 'inline' not permitted on data declarations
<env>\Library\include\opencascade\Standard_DimensionError.hxx(26): error C2373: 'Handle_Standard_DimensionError': redefinition; different type modifiers
<env>\Library\include\opencascade\Standard_DimensionError.hxx(26): error C2473: 'operator =': looks like a function definition, but there is no parameter list.
<env>\Library\include\opencascade\Standard_DimensionError.hxx(26): error C2059: syntax error: '<end Parse>'
<env>\Library\include\opencascade\Standard_DimensionError.hxx(26): error C2143: syntax error: missing ';' before '}'
<env>\Library\include\opencascade\Standard_DimensionError.hxx(26): error C2059: syntax error: '}'
<env>\Library\include\opencascade\Standard_DimensionError.hxx(35): error C2989: 'Standard_DimensionError': class template has already been declared as a non-class template
<env>\Library\include\opencascade\Standard_DimensionError.hxx(26): note: see declaration of 'Standard_DimensionError'
<env>\Library\include\opencascade\TColgp_HArray1OfPnt2d.hxx(24): error C2504: 'TColgp_Array1OfPnt2d': base class undefined
<env>\Library\include\opencascade\TColgp_HArray1OfPnt2d.hxx(24): error C2059: syntax error: 'return'
<env>\Library\include\opencascade\TColgp_HArray1OfPnt2d.hxx(24): error C2238: unexpected token(s) preceding ';'
<env>\Library\include\opencascade\TColgp_HArray1OfPnt2d.hxx(24): error C2628: 'TColgp_HArray1OfPnt2d' followed by 'void' is illegal (did you forget a ';'?)
<env>\Library\include\opencascade\TColgp_HArray1OfPnt2d.hxx(24): error C2817: return type for 'operator delete' must be 'void'
<env>\Library\include\opencascade\TColgp_HArray1OfPnt2d.hxx(24): error C2084: function 'void *operator new(std::size_t,void *) throw()' already has a body
C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\INCLUDE\vcruntime_new.h(86): note: see previous definition of 'new'
<env>\Library\include\opencascade\TColgp_HArray1OfPnt2d.hxx(24): error C2084: function 'void operator delete(void *,void *) throw()' already has a body
C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\INCLUDE\vcruntime_new.h(92): note: see previous definition of 'delete'
<env>\Library\include\opencascade\TColgp_HArray1OfPnt2d.hxx(24): error C2059: syntax error: 'const'
<env>\Library\include\opencascade\TColgp_HArray1OfPnt2d.hxx(24): error C4430: missing type specifier - int assumed. Note: C++ does not support default-int
<env>\Library\include\opencascade\TColgp_HArray1OfPnt2d.hxx(24): error C2448: 'TColgp_Array1OfPnt2d': function-style initializer appears to be a function definition
<env>\Library\include\opencascade\TColgp_HArray1OfPnt2d.hxx(24): error C2825: 'TColgp_Array1OfPnt2d': must be a class or namespace when followed by '::'
<env>\Library\include\opencascade\TColgp_HArray1OfPnt2d.hxx(24): error C2510: 'TColgp_Array1OfPnt2d': left of '::' must be a class/struct/union
<env>\Library\include\opencascade\TColgp_HArray1OfPnt2d.hxx(24): error C2374: 'TColgp_Array1OfPnt2d': redefinition; multiple initialization
<env>\Library\include\opencascade\TColgp_HArray1OfPnt2d.hxx(24): note: see declaration of 'TColgp_Array1OfPnt2d'
<env>\Library\include\opencascade\TColgp_HArray1OfPnt2d.hxx(24): error C2143: syntax error: missing ';' before '&'
<env>\Library\include\opencascade\TColgp_HArray1OfPnt2d.hxx(24): error C2270: 'Array1': modifiers not allowed on nonmember functions
<env>\Library\include\opencascade\TColgp_HArray1OfPnt2d.hxx(24): error C2059: syntax error: '{'
<env>\Library\include\opencascade\TColgp_HArray1OfPnt2d.hxx(24): error C2143: syntax error: missing ';' before '{'
<env>\Library\include\opencascade\TColgp_HArray1OfPnt2d.hxx(24): error C2447: '{': missing function header (old-style formal list?)
<env>\Library\include\opencascade\TColgp_HArray1OfPnt2d.hxx(24): error C2059: syntax error: '}'
<env>\Library\include\opencascade\TColgp_HArray1OfPnt2d.hxx(24): error C2270: 'DynamicType': modifiers not allowed on nonmember functions
<env>\Library\include\opencascade\TColgp_HArray1OfPnt2d.hxx(24): error C3158: 'DynamicType': 'override' can only be applied to a virtual member function
<env>\Library\include\opencascade\TColgp_HArray1OfPnt2d.hxx(24): error C2355: 'this': can only be referenced inside non-static member functions or non-static data member initializers
<env>\Library\include\opencascade\TColgp_HArray1OfPnt2d.hxx(24): error C2338: OCCT RTTI definition is misplaced: current class is not TColgp_HArray1OfPnt2d
<env>\Library\include\opencascade\TColgp_HArray1OfPnt2d.hxx(24): error C2550: 'Handle_TColgp_HArray1OfPnt2d': constructor initializer lists are only allowed on constructor definitions
<env>\Library\include\opencascade\TColgp_HArray1OfPnt2d.hxx(24): error C2904: 'Handle_TColgp_HArray1OfPnt2d': name already used for a template in the current scope
<env>\Library\include\opencascade\TColgp_HArray1OfPnt2d.hxx(24): note: see declaration of 'Handle_TColgp_HArray1OfPnt2d'
<env>\Library\include\opencascade\TColgp_HArray1OfPnt2d.hxx(24): error C2988: unrecognizable template declaration/definition
<env>\Library\include\opencascade\TColgp_HArray1OfPnt2d.hxx(24): error C2433: 'Handle_TColgp_HArray1OfPnt2d': 'inline' not permitted on data declarations
<env>\Library\include\opencascade\TColgp_HArray1OfPnt2d.hxx(24): error C2373: 'Handle_TColgp_HArray1OfPnt2d': redefinition; different type modifiers
<env>\Library\include\opencascade\TColgp_HArray1OfPnt2d.hxx(24): error C2473: 'operator =': looks like a function definition, but there is no parameter list.
<env>\Library\include\opencascade\TColgp_HArray1OfPnt2d.hxx(24): error C2374: '=': redefinition; multiple initialization
<env>\Library\include\opencascade\Standard_DimensionError.hxx(26): note: see declaration of '='
<env>\Library\include\opencascade\TColgp_HArray1OfPnt2d.hxx(24): error C2059: syntax error: '<end Parse>'
<env>\Library\include\opencascade\Poly_Triangle.hxx(25): error C2989: 'Standard_OutOfRange': class template has already been declared as a non-class template
<env>\Library\include\opencascade\TCollection_HAsciiString.hxx(32): note: see declaration of 'Standard_OutOfRange'
<env>\Library\include\opencascade\Poly_Triangle.lxx(27): error C2065: 'myNodes': undeclared identifier
<env>\Library\include\opencascade\Poly_Triangle.lxx(36): error C2270: 'Value': modifiers not allowed on nonmember functions
<env>\Library\include\opencascade\Poly_Triangle.lxx(38): error C2065: 'myNodes': undeclared identifier
<env>\Library\include\opencascade\Poly_Triangle.lxx(50): error C2065: 'myNodes': undeclared identifier
<env>\Library\include\opencascade\Poly_Array1OfTriangle.hxx(23): error C3203: 'Poly_Triangle': unspecialized class template can't be used as a template argument for template parameter 'TheItemType', expected a real type
<env>\Library\include\opencascade\Poly_Triangulation.hxx(32): error C2989: 'Standard_DomainError': class template has already been declared as a non-class template
<env>\Library\include\opencascade\gp_Dir.hxx(27): note: see declaration of 'Standard_DomainError'
<env>\Library\include\opencascade\Poly_Triangulation.hxx(33): error C2989: 'Standard_NullObject': class template has already been declared as a non-class template
<env>\Library\include\opencascade\TCollection_HAsciiString.hxx(31): note: see declaration of 'Standard_NullObject'
<env>\Library\include\opencascade\Geom_Geometry.hxx(25): error C2989: 'Standard_ConstructionError': class template has already been declared as a non-class template
<env>\Library\include\opencascade\gp_Dir.hxx(26): note: see declaration of 'Standard_ConstructionError'
<env>\Library\include\opencascade\Geom_Geometry.hxx(26): error C2989: 'gp_Pnt': class template has already been declared as a non-class template
<env>\Library\include\opencascade\gp_Pnt.hxx(36): note: see declaration of 'gp_Pnt'
<env>\Library\include\opencascade\Geom_Geometry.hxx(27): error C2989: 'gp_Ax1': class template has already been declared as a non-class template
<env>\Library\include\opencascade\gp_Pnt.hxx(28): note: see declaration of 'gp_Ax1'
<env>\Library\include\opencascade\Geom_Geometry.hxx(28): error C2989: 'gp_Ax2': class template has already been declared as a non-class template
<env>\Library\include\opencascade\gp_Pnt.hxx(29): note: see declaration of 'gp_Ax2'
<env>\Library\include\opencascade\Geom_Geometry.hxx(29): error C2989: 'gp_Vec': class template has already been declared as a non-class template
<env>\Library\include\opencascade\gp_Pnt.hxx(31): note: see declaration of 'gp_Vec'
<env>\Library\include\opencascade\Geom_Geometry.hxx(30): error C2989: 'gp_Trsf': class template has already been declared as a non-class template
<env>\Library\include\opencascade\gp_Pnt.hxx(30): note: see declaration of 'gp_Trsf'
<env>\Library\include\opencascade\Geom_Curve.hxx(28): error C2989: 'Standard_RangeError': class template has already been declared as a non-class template
<env>\Library\include\opencascade\Standard_RangeError.hxx(35): note: see declaration of 'Standard_RangeError'
<env>\Library\include\opencascade\Geom_Curve.hxx(29): error C2989: 'Standard_NoSuchObject': class template has already been declared as a non-class template
<env>\Library\include\opencascade\Standard_NoSuchObject.hxx(35): note: see declaration of 'Standard_NoSuchObject'
<env>\Library\include\opencascade\Geom_Curve.hxx(32): error C2989: 'gp_Trsf': class template has already been declared as a non-class template
<env>\Library\include\opencascade\Geom_Geometry.hxx(30): note: see declaration of 'gp_Trsf'
<env>\Library\include\opencascade\Geom_Curve.hxx(33): error C2989: 'gp_Pnt': class template has already been declared as a non-class template
<env>\Library\include\opencascade\Geom_Geometry.hxx(26): note: see declaration of 'gp_Pnt'
<env>\Library\include\opencascade\Geom_Curve.hxx(34): error C2989: 'gp_Vec': class template has already been declared as a non-class template
<env>\Library\include\opencascade\Geom_Geometry.hxx(29): note: see declaration of 'gp_Vec'
<env>\Library\include\opencascade\Geom_Curve.hxx(37): error C2989: 'Geom_Curve': class template has already been declared as a non-class template
<env>\Library\include\opencascade\BRepTools.hxx(55): note: see declaration of 'Geom_Curve'
<env>\Library\include\opencascade\Geom_Curve.hxx(38): error C2989: 'Geom_Curve': class template has already been declared as a non-class template
<env>\Library\include\opencascade\Geom_Curve.hxx(37): note: see declaration of 'Geom_Curve'
<env>\Library\include\opencascade\Geom_Curve.hxx(243): error C2989: 'Geom_Curve': class template has already been declared as a non-class template
<env>\Library\include\opencascade\Geom_Curve.hxx(38): note: see declaration of 'Geom_Curve'
<env>\Library\include\opencascade\Geom_Surface.hxx(28): error C2989: 'Standard_RangeError': class template has already been declared as a non-class template
<env>\Library\include\opencascade\Geom_Curve.hxx(28): note: see declaration of 'Standard_RangeError'
<env>\Library\include\opencascade\Geom_Surface.hxx(29): error C2989: 'Standard_NoSuchObject': class template has already been declared as a non-class template
<env>\Library\include\opencascade\Geom_Curve.hxx(29): note: see declaration of 'Standard_NoSuchObject'
<env>\Library\include\opencascade\Geom_Surface.hxx(32): error C2989: 'gp_Trsf': class template has already been declared as a non-class template
<env>\Library\include\opencascade\Geom_Curve.hxx(32): note: see declaration of 'gp_Trsf'
<env>\Library\include\opencascade\Geom_Surface.hxx(33): error C2989: 'gp_GTrsf2d': class template has already been declared as a non-class template
<env>\Library\include\opencascade\gp_Trsf2d.hxx(30): note: see declaration of 'gp_GTrsf2d'
<env>\Library\include\opencascade\Geom_Surface.hxx(34): error C2989: 'gp_Pnt': class template has already been declared as a non-class template
<env>\Library\include\opencascade\Geom_Curve.hxx(33): note: see declaration of 'gp_Pnt'
<env>\Library\include\opencascade\Geom_Surface.hxx(35): error C2989: 'gp_Vec': class template has already been declared as a non-class template
<env>\Library\include\opencascade\Geom_Curve.hxx(34): note: see declaration of 'gp_Vec'
<env>\Library\include\opencascade\Geom_Surface.hxx(38): error C2989: 'Geom_Surface': class template has already been declared as a non-class template
<env>\Library\include\opencascade\BRepTools.hxx(57): note: see declaration of 'Geom_Surface'
<env>\Library\include\opencascade\Geom_Surface.hxx(39): error C2989: 'Geom_Surface': class template has already been declared as a non-class template
<env>\Library\include\opencascade\Geom_Surface.hxx(38): note: see declaration of 'Geom_Surface'
<env>\Library\include\opencascade\Geom_Surface.hxx(294): error C2989: 'Geom_Surface': class template has already been declared as a non-class template
<env>\Library\include\opencascade\Geom_Surface.hxx(39): note: see declaration of 'Geom_Surface'
<env>\Library\include\opencascade\Geom2d_Geometry.hxx(25): error C2989: 'Standard_ConstructionError': class template has already been declared as a non-class template
<env>\Library\include\opencascade\Geom_Geometry.hxx(25): note: see declaration of 'Standard_ConstructionError'
<env>\Library\include\opencascade\Geom2d_Geometry.hxx(26): error C2989: 'gp_Pnt2d': class template has already been declared as a non-class template
<env>\Library\include\opencascade\gp_Ax2d.hxx(26): note: see declaration of 'gp_Pnt2d'
<env>\Library\include\opencascade\Geom2d_Geometry.hxx(27): error C2989: 'gp_Ax2d': class template has already been declared as a non-class template
<env>\Library\include\opencascade\gp_Ax2d.hxx(52): note: see declaration of 'gp_Ax2d'
<env>\Library\include\opencascade\Geom2d_Geometry.hxx(28): error C2989: 'gp_Vec2d': class template has already been declared as a non-class template
<env>\Library\include\opencascade\gp_Ax2d.hxx(29): note: see declaration of 'gp_Vec2d'
<env>\Library\include\opencascade\Geom2d_Geometry.hxx(29): error C2989: 'gp_Trsf2d': class template has already been declared as a non-class template
<env>\Library\include\opencascade\gp_Ax2d.hxx(28): note: see declaration of 'gp_Trsf2d'
<env>\Library\include\opencascade\Geom2d_Curve.hxx(28): error C2989: 'Standard_RangeError': class template has already been declared as a non-class template
<env>\Library\include\opencascade\Geom_Surface.hxx(28): note: see declaration of 'Standard_RangeError'
<env>\Library\include\opencascade\Geom2d_Curve.hxx(29): error C2989: 'Standard_NoSuchObject': class template has already been declared as a non-class template
<env>\Library\include\opencascade\Geom_Surface.hxx(29): note: see declaration of 'Standard_NoSuchObject'
<env>\Library\include\opencascade\Geom2d_Curve.hxx(32): error C2989: 'gp_Trsf2d': class template has already been declared as a non-class template
<env>\Library\include\opencascade\Geom2d_Geometry.hxx(29): note: see declaration of 'gp_Trsf2d'
<env>\Library\include\opencascade\Geom2d_Curve.hxx(33): error C2989: 'gp_Pnt2d': class template has already been declared as a non-class template
<env>\Library\include\opencascade\Geom2d_Geometry.hxx(26): note: see declaration of 'gp_Pnt2d'
<env>\Library\include\opencascade\Geom2d_Curve.hxx(34): error C2989: 'gp_Vec2d': class template has already been declared as a non-class template
<env>\Library\include\opencascade\Geom2d_Geometry.hxx(28): note: see declaration of 'gp_Vec2d'
<env>\Library\include\opencascade\Geom2d_Curve.hxx(37): error C2989: 'Geom2d_Curve': class template has already been declared as a non-class template
<env>\Library\include\opencascade\BRepTools.hxx(56): note: see declaration of 'Geom2d_Curve'
<env>\Library\include\opencascade\Geom2d_Curve.hxx(38): error C2989: 'Geom2d_Curve': class template has already been declared as a non-class template
<env>\Library\include\opencascade\Geom2d_Curve.hxx(37): note: see declaration of 'Geom2d_Curve'
<env>\Library\include\opencascade\Geom2d_Curve.hxx(242): error C2989: 'Geom2d_Curve': class template has already been declared as a non-class template
<env>\Library\include\opencascade\Geom2d_Curve.hxx(38): note: see declaration of 'Geom2d_Curve'
<env>\Library\include\opencascade\Poly_Polygon3D.hxx(30): error C2989: 'Standard_NullObject': class template has already been declared as a non-class template
<env>\Library\include\opencascade\Poly_Triangulation.hxx(33): note: see declaration of 'Standard_NullObject'
<env>\Library\include\opencascade\Poly_Polygon3D.lxx(23): error C2270: 'NbNodes': modifiers not allowed on nonmember functions
<env>\Library\include\opencascade\Poly_Polygon3D.lxx(24): error C2065: 'myNodes': undeclared identifier
<env>\Library\include\opencascade\Poly_Polygon2D.hxx(27): error C2989: 'Standard_NullObject': class template has already been declared as a non-class template
<env>\Library\include\opencascade\Poly_Polygon3D.hxx(30): note: see declaration of 'Standard_NullObject'
<env>\Library\include\opencascade\Poly_Polygon2D.lxx(23): error C2270: 'NbNodes': modifiers not allowed on nonmember functions
<env>\Library\include\opencascade\Poly_Polygon2D.lxx(24): error C2065: 'myNodes': undeclared identifier
<env>\Library\include\opencascade\Poly_PolygonOnTriangulation.hxx(30): error C2989: 'Standard_NullObject': class template has already been declared as a non-class template
<env>\Library\include\opencascade\Poly_Polygon2D.hxx(27): note: see declaration of 'Standard_NullObject'
<env>\Library\include\opencascade\Poly_PolygonOnTriangulation.lxx(21): error C2270: 'NbNodes': modifiers not allowed on nonmember functions
<env>\Library\include\opencascade\Poly_PolygonOnTriangulation.lxx(22): error C2065: 'myNodes': undeclared identifier
<env>\Library\include\opencascade\BRep_Tool.hxx(36): error C2989: 'TopoDS_Shape': class template has already been declared as a non-class template
<env>\Library\include\opencascade\BRepTools.hxx(42): note: see declaration of 'TopoDS_Shape'
<env>\Library\include\opencascade\BRep_Tool.hxx(37): error C2989: 'TopoDS_Face': class template has already been declared as a non-class template
<env>\Library\include\opencascade\TopoDS_Face.hxx(34): note: see declaration of 'TopoDS_Face'
<env>\Library\include\opencascade\BRep_Tool.hxx(38): error C2989: 'TopLoc_Location': class template has already been declared as a non-class template
<env>\Library\include\opencascade\TopLoc_ItemLocation.hxx(27): note: see declaration of 'TopLoc_Location'
<env>\Library\include\opencascade\BRep_Tool.hxx(39): error C2989: 'TopoDS_Edge': class template has already been declared as a non-class template
<env>\Library\include\opencascade\BRepTools.hxx(35): note: see declaration of 'TopoDS_Edge'
<env>\Library\include\opencascade\BRep_Tool.hxx(40): error C2989: 'TopoDS_Vertex': class template has already been declared as a non-class template
<env>\Library\include\opencascade\BRepTools.hxx(37): note: see declaration of 'TopoDS_Vertex'
<env>\Library\include\opencascade\TColgp_HArray2OfPnt.hxx(24): error C2504: 'TColgp_Array2OfPnt': base class undefined
<env>\Library\include\opencascade\TColgp_HArray2OfPnt.hxx(24): error C2059: syntax error: 'return'
<env>\Library\include\opencascade\TColgp_HArray2OfPnt.hxx(24): fatal error C1003: error count exceeds 100; stopping compilation
[19/101] Building CXX object src\Mod\MeshPart\App\CMakeFiles\flatmesh.dir\MeshFlatteningPy.cpp.obj
FAILED: src/Mod/MeshPart/App/CMakeFiles/flatmesh.dir/MeshFlatteningPy.cpp.obj 
C:\PROGRA~2\MICROS~1.0\VC\bin\amd64\cl.exe  /nologo /TP -DFCAppMeshPart -DHAVE_ACOSH -DHAVE_ASINH -DHAVE_ATANH -DHAVE_MEFISTO -DHAVE_NETGEN -DHAVE_SMESH -DQT_CONCURRENT_LIB -DQT_CORE_LIB -DQT_NO_DEBUG -DQT_XML_LIB -D_OCC64 -Dflatmesh_EXPORTS -Isrc -IC:\Users\fc_builder\projects\FreeCAD\src -I<env>\Library\include -I<env>\Library\include\opencascade -I<env>\include -IC:\Users\fc_builder\projects\FreeCAD\src\3rdParty\salomesmesh\inc -I<env>\Library\include\vtk-7.1 -I<env>\Library\include\eigen3 -I<env>\Library\include\qt -I<env>\Library\include\qt\QtCore -I<env>\Library\.\mkspecs\win32-msvc2015 -I<env>\Library\include\qt\QtXml -I<env>\Library\include\qt\QtConcurrent /DWIN32 /D_WINDOWS /W3 /GR /EHsc -D_OCC64 /MD /O2 /Ob2 /DNDEBUG /EHa /showIncludes /Fosrc\Mod\MeshPart\App\CMakeFiles\flatmesh.dir\MeshFlatteningPy.cpp.obj /Fdsrc\Mod\MeshPart\App\CMakeFiles\flatmesh.dir\ /FS -c C:\Users\fc_builder\projects\FreeCAD\src\Mod\MeshPart\App\MeshFlatteningPy.cpp
cl : Command line warning D9025 : overriding '/EHs' with '/EHa'
<env>\Library\include\opencascade\TopoDS_Edge.hxx(39): error C2059: syntax error: 'return'
<env>\Library\include\opencascade\TopoDS_Edge.hxx(39): error C2238: unexpected token(s) preceding ';'
<env>\Library\include\opencascade\TopoDS_Edge.hxx(39): error C2628: 'TopoDS_Edge' followed by 'void' is illegal (did you forget a ';'?)
<env>\Library\include\opencascade\TopoDS_Edge.hxx(39): error C2817: return type for 'operator delete' must be 'void'
<env>\Library\include\opencascade\TopoDS_Edge.hxx(39): error C2084: function 'void *operator new(std::size_t,void *) throw()' already has a body
C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\INCLUDE\vcruntime_new.h(86): note: see previous definition of 'new'
<env>\Library\include\opencascade\TopoDS_Edge.hxx(39): error C2084: function 'void operator delete(void *,void *) throw()' already has a body
C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\INCLUDE\vcruntime_new.h(92): note: see previous definition of 'delete'
<env>\Library\include\opencascade\TopoDS_Edge.hxx(43): error C2059: syntax error: ')'
<env>\Library\include\opencascade\TopoDS_Edge.hxx(48): error C2059: syntax error: 'protected'
<env>\Library\include\opencascade\TopoDS_Edge.hxx(54): error C2059: syntax error: 'private'
<env>\Library\include\opencascade\TopoDS_Edge.hxx(60): error C2059: syntax error: '}'
<env>\Library\include\opencascade\TopoDS_Edge.hxx(60): error C2143: syntax error: missing ';' before '}'
<env>\Library\include\opencascade\TopoDS_Edge.lxx(23): error C2600: 'TopoDS_Edge::TopoDS_Edge': cannot define a compiler-generated special member function (must be declared in the class first)
<env>\Library\include\opencascade\TopoDS.hxx(65): error C2059: syntax error: 'return'
<env>\Library\include\opencascade\TopoDS.hxx(65): error C2238: unexpected token(s) preceding ';'
<env>\Library\include\opencascade\TopoDS.hxx(65): error C2628: 'TopoDS' followed by 'void' is illegal (did you forget a ';'?)
<env>\Library\include\opencascade\TopoDS.hxx(65): error C2817: return type for 'operator delete' must be 'void'
<env>\Library\include\opencascade\TopoDS.hxx(65): error C2084: function 'void *operator new[](std::size_t)' already has a body
<env>\Library\include\opencascade\TopoDS_Edge.hxx(39): note: see previous definition of 'new[]'
<env>\Library\include\opencascade\TopoDS.hxx(65): error C2084: function 'void operator delete[](void *)' already has a body
<env>\Library\include\opencascade\TopoDS_Edge.hxx(39): note: see previous definition of 'delete[]'
<env>\Library\include\opencascade\TopoDS.hxx(120): error C2059: syntax error: 'protected'
<env>\Library\include\opencascade\TopoDS.hxx(126): error C2059: syntax error: 'private'
<env>\Library\include\opencascade\TopoDS.hxx(131): error C2255: 'friend': not allowed outside of a class definition
<env>\Library\include\opencascade\TopoDS.hxx(132): error C2255: 'friend': not allowed outside of a class definition
<env>\Library\include\opencascade\TopoDS.hxx(133): error C2255: 'friend': not allowed outside of a class definition
<env>\Library\include\opencascade\TopoDS.hxx(134): error C2255: 'friend': not allowed outside of a class definition
<env>\Library\include\opencascade\TopoDS.hxx(135): error C2255: 'friend': not allowed outside of a class definition
<env>\Library\include\opencascade\TopoDS.hxx(136): error C2255: 'friend': not allowed outside of a class definition
<env>\Library\include\opencascade\TopoDS.hxx(137): error C2255: 'friend': not allowed outside of a class definition
<env>\Library\include\opencascade\TopoDS.hxx(138): error C2255: 'friend': not allowed outside of a class definition
<env>\Library\include\opencascade\TopoDS.hxx(139): error C2255: 'friend': not allowed outside of a class definition
<env>\Library\include\opencascade\TopoDS.hxx(140): error C2255: 'friend': not allowed outside of a class definition
<env>\Library\include\opencascade\TopoDS.hxx(141): error C2255: 'friend': not allowed outside of a class definition
<env>\Library\include\opencascade\TopoDS.hxx(142): error C2255: 'friend': not allowed outside of a class definition
<env>\Library\include\opencascade\TopoDS.hxx(143): error C2255: 'friend': not allowed outside of a class definition
<env>\Library\include\opencascade\TopoDS.hxx(144): error C2255: 'friend': not allowed outside of a class definition
<env>\Library\include\opencascade\TopoDS.hxx(145): error C2255: 'friend': not allowed outside of a class definition
<env>\Library\include\opencascade\TopoDS.hxx(146): error C2255: 'friend': not allowed outside of a class definition
<env>\Library\include\opencascade\TopoDS.hxx(147): error C2255: 'friend': not allowed outside of a class definition
<env>\Library\include\opencascade\TopoDS.hxx(148): error C2255: 'friend': not allowed outside of a class definition
<env>\Library\include\opencascade\TopoDS.hxx(149): error C2255: 'friend': not allowed outside of a class definition
<env>\Library\include\opencascade\TopoDS.hxx(150): error C2255: 'friend': not allowed outside of a class definition
<env>\Library\include\opencascade\TopoDS.hxx(151): error C2255: 'friend': not allowed outside of a class definition
<env>\Library\include\opencascade\TopoDS.hxx(153): error C2059: syntax error: '}'
<env>\Library\include\opencascade\TopoDS.hxx(153): error C2143: syntax error: missing ';' before '}'
<env>\Library\include\opencascade\Standard_TypeMismatch.hxx(26): error C2550: 'Handle_Standard_TypeMismatch': constructor initializer lists are only allowed on constructor definitions
<env>\Library\include\opencascade\Standard_TypeMismatch.hxx(26): error C4430: missing type specifier - int assumed. Note: C++ does not support default-int
<env>\Library\include\opencascade\Standard_TypeMismatch.hxx(26): error C2904: 'Handle_Standard_TypeMismatch': name already used for a template in the current scope
<env>\Library\include\opencascade\Standard_TypeMismatch.hxx(26): note: see declaration of 'Handle_Standard_TypeMismatch'
<env>\Library\include\opencascade\Standard_TypeMismatch.hxx(26): error C2988: unrecognizable template declaration/definition
<env>\Library\include\opencascade\Standard_TypeMismatch.hxx(26): error C2143: syntax error: missing ';' before '&'
<env>\Library\include\opencascade\Standard_TypeMismatch.hxx(26): error C2433: 'Handle_Standard_TypeMismatch': 'inline' not permitted on data declarations
<env>\Library\include\opencascade\Standard_TypeMismatch.hxx(26): error C2373: 'Handle_Standard_TypeMismatch': redefinition; different type modifiers
<env>\Library\include\opencascade\Standard_TypeMismatch.hxx(26): error C2473: 'operator =': looks like a function definition, but there is no parameter list.
<env>\Library\include\opencascade\Standard_TypeMismatch.hxx(26): error C2059: syntax error: '<end Parse>'
<env>\Library\include\opencascade\Standard_TypeMismatch.hxx(26): error C2143: syntax error: missing ';' before '}'
<env>\Library\include\opencascade\Standard_TypeMismatch.hxx(26): error C2059: syntax error: '}'
<env>\Library\include\opencascade\Standard_TypeMismatch.hxx(35): error C2989: 'Standard_TypeMismatch': class template has already been declared as a non-class template
<env>\Library\include\opencascade\Standard_TypeMismatch.hxx(26): note: see declaration of 'Standard_TypeMismatch'
<env>\Library\include\opencascade\TopoDS.lxx(35): error C2027: use of undefined type 'Standard_TypeMismatch'
<env>\Library\include\opencascade\Standard_TypeMismatch.hxx(35): note: see declaration of 'Standard_TypeMismatch'
<env>\Library\include\opencascade\Standard_TypeMismatch.hxx(35): note: see declaration of 'Standard_TypeMismatch'
<env>\Library\include\opencascade\TopoDS.lxx(47): error C2027: use of undefined type 'Standard_TypeMismatch'
<env>\Library\include\opencascade\Standard_TypeMismatch.hxx(35): note: see declaration of 'Standard_TypeMismatch'
<env>\Library\include\opencascade\Standard_TypeMismatch.hxx(35): note: see declaration of 'Standard_TypeMismatch'
<env>\Library\include\opencascade\TopoDS.lxx(59): error C2027: use of undefined type 'Standard_TypeMismatch'
<env>\Library\include\opencascade\Standard_TypeMismatch.hxx(35): note: see declaration of 'Standard_TypeMismatch'
<env>\Library\include\opencascade\Standard_TypeMismatch.hxx(35): note: see declaration of 'Standard_TypeMismatch'
<env>\Library\include\opencascade\TopoDS.lxx(71): error C2027: use of undefined type 'Standard_TypeMismatch'
<env>\Library\include\opencascade\Standard_TypeMismatch.hxx(35): note: see declaration of 'Standard_TypeMismatch'
<env>\Library\include\opencascade\Standard_TypeMismatch.hxx(35): note: see declaration of 'Standard_TypeMismatch'
<env>\Library\include\opencascade\TopoDS.lxx(83): error C2027: use of undefined type 'Standard_TypeMismatch'
<env>\Library\include\opencascade\Standard_TypeMismatch.hxx(35): note: see declaration of 'Standard_TypeMismatch'
<env>\Library\include\opencascade\Standard_TypeMismatch.hxx(35): note: see declaration of 'Standard_TypeMismatch'
<env>\Library\include\opencascade\TopoDS.lxx(95): error C2027: use of undefined type 'Standard_TypeMismatch'
<env>\Library\include\opencascade\Standard_TypeMismatch.hxx(35): note: see declaration of 'Standard_TypeMismatch'
<env>\Library\include\opencascade\Standard_TypeMismatch.hxx(35): note: see declaration of 'Standard_TypeMismatch'
<env>\Library\include\opencascade\TopoDS.lxx(107): error C2027: use of undefined type 'Standard_TypeMismatch'
<env>\Library\include\opencascade\Standard_TypeMismatch.hxx(35): note: see declaration of 'Standard_TypeMismatch'
<env>\Library\include\opencascade\Standard_TypeMismatch.hxx(35): note: see declaration of 'Standard_TypeMismatch'
<env>\Library\include\opencascade\TopoDS.lxx(119): error C2027: use of undefined type 'Standard_TypeMismatch'
<env>\Library\include\opencascade\Standard_TypeMismatch.hxx(35): note: see declaration of 'Standard_TypeMismatch'
<env>\Library\include\opencascade\Standard_TypeMismatch.hxx(35): note: see declaration of 'Standard_TypeMismatch'
<env>\Library\include\opencascade\TopoDS.lxx(131): error C2027: use of undefined type 'Standard_TypeMismatch'
<env>\Library\include\opencascade\Standard_TypeMismatch.hxx(35): note: see declaration of 'Standard_TypeMismatch'
<env>\Library\include\opencascade\Standard_TypeMismatch.hxx(35): note: see declaration of 'Standard_TypeMismatch'
<env>\Library\include\opencascade\TopoDS.lxx(143): error C2027: use of undefined type 'Standard_TypeMismatch'
<env>\Library\include\opencascade\Standard_TypeMismatch.hxx(35): note: see declaration of 'Standard_TypeMismatch'
<env>\Library\include\opencascade\Standard_TypeMismatch.hxx(35): note: see declaration of 'Standard_TypeMismatch'
<env>\Library\include\opencascade\TopoDS.lxx(155): error C2027: use of undefined type 'Standard_TypeMismatch'
<env>\Library\include\opencascade\Standard_TypeMismatch.hxx(35): note: see declaration of 'Standard_TypeMismatch'
<env>\Library\include\opencascade\Standard_TypeMismatch.hxx(35): note: see declaration of 'Standard_TypeMismatch'
<env>\Library\include\opencascade\TopoDS.lxx(167): error C2027: use of undefined type 'Standard_TypeMismatch'
<env>\Library\include\opencascade\Standard_TypeMismatch.hxx(35): note: see declaration of 'Standard_TypeMismatch'
<env>\Library\include\opencascade\Standard_TypeMismatch.hxx(35): note: see declaration of 'Standard_TypeMismatch'
<env>\Library\include\opencascade\TopoDS.lxx(179): error C2027: use of undefined type 'Standard_TypeMismatch'
<env>\Library\include\opencascade\Standard_TypeMismatch.hxx(35): note: see declaration of 'Standard_TypeMismatch'
<env>\Library\include\opencascade\Standard_TypeMismatch.hxx(35): note: see declaration of 'Standard_TypeMismatch'
<env>\Library\include\opencascade\TopoDS.lxx(191): error C2027: use of undefined type 'Standard_TypeMismatch'
<env>\Library\include\opencascade\Standard_TypeMismatch.hxx(35): note: see declaration of 'Standard_TypeMismatch'
<env>\Library\include\opencascade\Standard_TypeMismatch.hxx(35): note: see declaration of 'Standard_TypeMismatch'
<env>\Library\include\opencascade\TopoDS.lxx(203): error C2027: use of undefined type 'Standard_TypeMismatch'
<env>\Library\include\opencascade\Standard_TypeMismatch.hxx(35): note: see declaration of 'Standard_TypeMismatch'
<env>\Library\include\opencascade\Standard_TypeMismatch.hxx(35): note: see declaration of 'Standard_TypeMismatch'
<env>\Library\include\opencascade\TopoDS.lxx(215): error C2027: use of undefined type 'Standard_TypeMismatch'
<env>\Library\include\opencascade\Standard_TypeMismatch.hxx(35): note: see declaration of 'Standard_TypeMismatch'
<env>\Library\include\opencascade\Standard_TypeMismatch.hxx(35): note: see declaration of 'Standard_TypeMismatch'
<env>\Library\include\opencascade\ShapeFix_Edge.hxx(29): error C2989: 'TopoDS_Edge': class template has already been declared as a non-class template
<env>\Library\include\opencascade\TopoDS.hxx(137): note: see declaration of 'TopoDS_Edge'
<env>\Library\include\opencascade\ShapeFix_Edge.hxx(30): error C2989: 'TopoDS_Face': class template has already been declared as a non-class template
<env>\Library\include\opencascade\TopoDS.hxx(141): note: see declaration of 'TopoDS_Face'
<env>\Library\include\opencascade\ShapeFix_Edge.hxx(31): error C2989: 'Geom_Surface': class template has already been declared as a non-class template
<env>\Library\include\opencascade\BRepTools.hxx(57): note: see declaration of 'Geom_Surface'
<env>\Library\include\opencascade\ShapeFix_Edge.hxx(32): error C2989: 'TopLoc_Location': class template has already been declared as a non-class template
<env>\Library\include\opencascade\TopLoc_ItemLocation.hxx(27): note: see declaration of 'TopLoc_Location'

ps.: I am using this version:

OS: Windows 10
Word size of OS: 64-bit
Word size of FreeCAD: 64-bit
Version: 0.17.12549 (Git)
Build type: Release
Branch: (HEAD detached at FreeCAD/master)
Hash: d5d3513a56673bccbda21ee52efdc41a465fcd12
Python version: 3.6.3
Qt version: 5.6.2
Coin version: 4.0.0a
OCC version: 7.2.0
Locale: German/Austria (de_AT)
please help with my conda-packaging efforts: https://liberapay.com/looooo/
wmayer
Site Admin
Posts: 14992
Joined: Thu Feb 19, 2009 10:32 am

Re: surface flattening

Postby wmayer » Sun Nov 05, 2017 9:51 am

Your code is where?