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

Segmentation fault during drawing a 3D Nef polyhedron #7377

Closed
alekseYY opened this issue Apr 9, 2023 · 2 comments · Fixed by #7388
Closed

Segmentation fault during drawing a 3D Nef polyhedron #7377

alekseYY opened this issue Apr 9, 2023 · 2 comments · Fixed by #7388

Comments

@alekseYY
Copy link

alekseYY commented Apr 9, 2023

Issue Details

I've tried to draw a 3D Nef polyhedron from the Section 5.6 of the User Manual for the "3D Boolean Operations on Nef Polyhedra" and got the segmentation fault. The problem is in the "draw_nef_3.h" header, function is "compute_elements". Are there any limitations on the input data for drawing?

Source Code

#include <fstream>
#include <iostream>

#define CGAL_USE_BASIC_VIEWER

#include <CGAL/Exact_integer.h>
#include <CGAL/Extended_homogeneous.h>
#include <CGAL/Nef_polyhedron_3.h>
#include <CGAL/IO/Nef_polyhedron_iostream_3.h>
#include <CGAL/draw_nef_3.h>

using Kernel = CGAL::Extended_homogeneous<CGAL::Exact_integer>;
using Nef_polyhedron = CGAL::Nef_polyhedron_3<Kernel>;

int main()
{
  Nef_polyhedron N;
  // ------ the input data correspond to the 'Nef_3/extended_kernel.cpp'
  // ------ example from the Section 5.6 of the User Manual   
  std::ifstream fs("data/extended_kernel.cin");
  if (fs >> N)
  {
    std::cout << "File loaded" << std::endl;
    CGAL::draw(N);
  }
  else
  {
     std::cout << "ERROR!!!" << std::endl;
  }
}

Environment

  • Operating system (Windows/Mac/Linux, 32/64 bits): Linux 64-bit
  • Compiler: G++ 10.3.0
  • Release or debug mode: Debug
  • Specific flags used (if any): -no-pie -ggdb -O0
  • CGAL version: 5.5.2
  • Boost version: 1.71.0
  • Other libraries versions if used (Eigen, TBB, etc.): Qt 5.12.8
@gdamiand
Copy link
Member

The pach above seems to solve the bug; but maybe with this code, the object is not drawn correctly.

lrineau added a commit that referenced this issue Apr 25, 2023
_Please use the following template to help us managing pull requests._

## Summary of Changes

Draw only halffacet if(fc.is_shalfedge()).
TODO: do we need to draw something if (fc.is_shalfloop()) ?

## Release Management

* Affected package(s): Nef_3
* Issue(s) solved (if any): fix #7377
@alekseYY
Copy link
Author

alekseYY commented Oct 20, 2024

In the CGAL 6.0 there are no segmentation fault during drawing. However the picture, corresponding to the file "extended_kernel.cin", looks weird (please see below). It seems to me that the Extended_homogeneous kernel is still a problem for the draw function.

Screenshot_2024-10-19_23-36-56

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

Successfully merging a pull request may close this issue.

2 participants