Skip to Content.
Sympa Menu

cgal-discuss - Re: [cgal-discuss] scan_OFF result operator(): input error: file format is not in OFF.

Subject: CGAL users discussion list

List archive

Re: [cgal-discuss] scan_OFF result operator(): input error: file format is not in OFF.


Chronological Thread 
  • From: Andreas Fabri <>
  • To:
  • Subject: Re: [cgal-discuss] scan_OFF result operator(): input error: file format is not in OFF.
  • Date: Tue, 29 May 2018 12:07:41 +0200
  • Authentication-results: mail3-smtp-sop.national.inria.fr; spf=None ; spf=None ; spf=None
  • Ironport-phdr: 9a23:bagFmhTRsaE/0yI0MVk9fcEKedpsv+yvbD5Q0YIujvd0So/mwa6yYRON2/xhgRfzUJnB7Loc0qyK6/umATRIyK3CmUhKSIZLWR4BhJdetC0bK+nBN3fGKuX3ZTcxBsVIWQwt1Xi6NU9IBJS2PAWK8TW94jEIBxrwKxd+KPjrFY7OlcS30P2594HObwlSizexfb1/IA+qoQnNq8IbnZZsJqEtxxXTv3BGYf5WxWRmJVKSmxbz+MK994N9/ipTpvws6ddOXb31cKokQ7NYCi8mM30u683wqRbDVwqP6WACXWgQjxFFHhLK7BD+Xpf2ryv6qu9w0zSUMMHqUbw5Xymp4qF2QxHqlSgHLSY0/mHKhMJugqJVoxyvqBJwzIHWfI6YL+Bxcr/HcN4AWWZMUMRcWipcCY28dYsPCO8BMP5Eoon7ulQOtwWxChO3BOjyyjFHnGT53bc70+88FgzJxgogEM8UsHvKttr1L70eUe6vw6bT1zXDbuhb2Tjj54jPdxAuv+2MXahwcMrf00YgCx/FjlKKqY3lJT+ayuMNs22C4udmSOmhhWknqwRrrTiuwMchko/JiZgOxV/f8SV23pw5KsG/SE5+edKrDJRQuDueN4dsRcMiWW5otSAnwbMFoZ62ZDUGxZckyhLFdvCKcoiF7gjtWeuVOzt0mm9pdbGnixu27USs0O7xW8iu3FtOsCZJiNbBu3QL2hfO8MaIUOF98V2k2TuX1wDc9OVEIUcsmKfaMZIhx7kwm5gJvUTGBCD2mUH2gLaRdkU55uik8ePnYqvmppOGMY97lB3+Prwvmsy5H+s4LhADU3WY9Om/zrHv4Ez0TbVQgvA4lqTVqo7WKdkYq6KhBg9ayIcj6xKxDze819QYmGEKI0hDeB2alYjmJUvBIOviAfexmVujiy1rx/HdM73uHJrNKX3Dn6n9fbZn609cxhA8wsxD55JTELEAIOj/VVP2tNzdFhM5KRC7w/77CNVh0YMTQX6AAqCDP6PWqFOH++MvI/KQa48Iozb9MOMo5+XujH88gV8SZ7Ol3ZoRaHCiH/RpOV+VYXT2goRJLWBftQU3SKnmiUaJTCVIT3e0RaM1oD8hW6y8CoKWb4ahmrGIx2+VF5dMZygSA1aAC3rhbMOKUv0WaQqdL8hknyAeRLaoQJMmzwDovwj/nek0ZtHI8zEV4MqwnON+4PfewElrpG5ESv+F2mTIdFla22YBRjs4xqd6+xUvxVqE1KVkme1WHNdP4OlYFAw9MMyElrAoO5XJQgvEO+yxZhO+WNz8WGM+Q9U0zsMUckh0EMmllAGF1C2vUedMyu67Qacs+6eZ5EDfYsZwz3GciPt/yVwhHY1KPGyiw6li607UGY6PlUiFxf6n

Have a look at this example

https://doc.cgal.org/latest/Polygon_mesh_processing/Polygon_mesh_processing_2polygon_soup_example_8cpp-example.html#a3


On 5/29/2018 11:54 AM, sergio campo wrote:
Thanks for your answer. But how It can be detected before corret it?
Sergio

On Tue, May 29, 2018 at 11:03 AM, Andreas Fabri <> wrote:


The orientation of the triangles is not coherent.

You have for examples 2 triangles with an edge going from vertex 0 to vertex 1

You should read a polygon soup and call the function if it can be oriented


andreas


On 5/29/2018 10:56 AM, sergio wrote:
I'm implementing algorithms to detect(Only detection of error, not
correction) if mesh has errors like self-intersection, wrong oriented
normals, etc.
Using scan_OFF with a *.off file it always has result "operator(): input
error: file format is not in OFF."
Why 

// kernel
typedef CGAL::Exact_predicates_inexact_constructions_kernel Kernel;

// polyhedron
typedef CGAL::Polyhedron_3<Kernel> Polyhedron;

int main(int argc, char* argv[])
{
  const char* filename = (argc > 1) ? argv[1] : "tetrahedron-piramide.off";
  std::ifstream input(filename);
  
  Mesh mesh;
  if (!input || !(input >> mesh) || !CGAL::is_triangle_mesh(mesh))
  {
    std::cerr << "Not a valid input file." << std::endl;
    return 1;
  }
  
  Polyhedron M;     // a typical definition of a Polyhedron (see other
examples)
  scan_OFF(input, M, true);                   // read OFF file in verbose
mode
  assert(input);                       // input fails iff mesh is not
manifold
  return 0;
}

This is a simple mesh and I think it does not have errors. Added file 
tetrahedron-piramide.off
<http://cgal-discuss.949826.n4.nabble.com/file/t375958/tetrahedron-piramide.off> 
.

Thanks in advance



--
Sent from: http://cgal-discuss.949826.n4.nabble.com/


-- 
Andreas Fabri, PhD
Chief Officer, GeometryFactory
Editor, The CGAL Project

phone: +33.492.954.912    skype: andreas.fabri


-- 
Andreas Fabri, PhD
Chief Officer, GeometryFactory
Editor, The CGAL Project

phone: +33.492.954.912    skype: andreas.fabri



Archive powered by MHonArc 2.6.18.

Top of Page