Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Compiling Error #7599

Closed
wxh158849067wxh opened this issue Jul 16, 2023 · 5 comments
Closed

Compiling Error #7599

wxh158849067wxh opened this issue Jul 16, 2023 · 5 comments

Comments

@wxh158849067wxh
Copy link

wxh158849067wxh commented Jul 16, 2023

Issue Details

when using CGAL::IO::write_polygon_mesh(), it will cause no suitable operator / for this expression:

 Vector_3
    operator()(const Point_3& p,const Point_3& q, const Point_3& r) const
    {
      CGAL_kernel_precondition(! K().collinear_3_object()(p,q,r) );
      Vector_3 res = CGAL::cross_product(q-p, r-p);
      res = res / CGAL::sqrt(res.squared_length());//   this where goes wrong
      return res;
        }
  };

above funtion is member function of class Construct_unit_normal_3, in E:\CGAL\CGAL-5.4.2\include\CGAL\Kernel\function_objects.h,

Source Code

#include <CGAL/Exact_predicates_exact_constructions_kernel.h>
#include <CGAL/Nef_polyhedron_3.h>
#include <CGAL/Polyhedron_3.h>
#include <CGAL/draw_nef_3.h>
#include <fstream>
#include <iostream>
#include<list>
#include<string>
#include<CGAL\OFF_to_nef_3.h>
#include<CGAL\IO\Nef_polyhedron_iostream_3.h>
#include<CGAL\draw_polyhedron.h>
#include<CGAL\IO\Nef_polyhedron_iostream_3.h>
#include <CGAL/boost/graph/convert_nef_polyhedron_to_polygon_mesh.h>
#include<CGAL\Nef_nary_union_3.h>
#include <CGAL/Polygon_mesh_processing/IO/polygon_mesh_io.h>
#include <CGAL/boost/graph/IO/polygon_mesh_io.h>
typedef CGAL::Exact_predicates_exact_constructions_kernel   Kernel;
typedef Kernel::Aff_transformation_3 Aff;

typedef CGAL::Polyhedron_3<Kernel>                          Polyhedron;
typedef CGAL::Nef_polyhedron_3<Kernel>                      Nef_polyhedron;
typedef Kernel::Vector_3 Vector;
typedef Kernel::Point_3 Point;
typedef Kernel::Segment_3 Segment;
typedef Kernel::Plane_3 Plane;
typedef Point* point_iterator;
typedef std::pair<point_iterator, point_iterator> point_range;
typedef std::list<point_range> polyline;
typedef Nef_polyhedron::Volume_const_iterator Volume_const_iterator;
typedef Kernel::Aff_transformation_3 Aff_3;

int main(int argc, char *argv[])
{

	Polyhedron P1, P2;
	Nef_polyhedron N2, N3, N4, N5;
	CGAL::Polygon_mesh_processing::IO::read_polygon_mesh("C:\\Users\\CSU\\Desktop\\buliding\\7-1024-1008-1.3\\7-1024-1008-1.3.obj", P1);
	CGAL::IO::write_polygon_mesh("C:\\Users\\CSU\\Desktop\\buliding\\7-1024-1008-1.3\\7-1024-1008.off", P1);//this line will cause above compiling error, but when using CGAL5.5.1 will not cause same error 
// maybe it is version error
}

Environment

  • Operating system (Windows/Mac/Linux, 32/64 bits): windows 64
  • Compiler:MSVC
  • Release or debug mode:debug
  • Specific flags used (if any):
  • CGAL version:5.4.2
  • Boost version:1.78
  • Other libraries versions if used (Eigen, TBB, etc.):
@MaelRL
Copy link
Member

MaelRL commented Jul 16, 2023

What type is Kernel::FT for both versions, please? You can get this using std::cout << typeid(Kernel::FT).name() << std::endl;.

@wxh158849067wxh
Copy link
Author

wxh158849067wxh commented Jul 17, 2023

What type is Kernel::FT for both versions, please? You can get this using std::cout << typeid(Kernel::FT).name() << std::endl;.

5.4.2 and 5.5.1 both are class CGAL::Lazy_exact_nt<class boost::multiprecision::number<struct boost::multiprecision::backends::gmp_rational,1> >

@sloriot
Copy link
Member

sloriot commented Jul 19, 2023

What is you compiler version? Did you do anything special ? Did you use cmake?

@wxh158849067wxh
Copy link
Author

cl is 19.16.27048 ,is it right?
I do not think I did something special .i just change "#include ui_ImageInterface.h" into "#include E:\CGAL\CGAL-5.4.2\examples\Nef_3\build\ui_ImageInterface.h", it seems nothing else I did. I even tried downloading souece code of 5.4.2 again, but same to failing to compile.
yes, I used cmake to build E:\CGAL\CGAL-5.4.2\examples\Nef_3

@MaelRL
Copy link
Member

MaelRL commented Nov 26, 2023

EPECK doesn't have any square root operators, and some of the output file types need normal (and thus require a normal computation). If you're not using a file type that needs this normal, you can just use CGAL::IO::write_XXX directly.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants