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

Unexpected Result of CGAL::draw() for Nef Polyhedra #8372

Open
andlarson opened this issue Jul 22, 2024 · 4 comments
Open

Unexpected Result of CGAL::draw() for Nef Polyhedra #8372

andlarson opened this issue Jul 22, 2024 · 4 comments
Assignees

Comments

@andlarson
Copy link

Issue Details

I created a 3D Nef Polyhedra composed of a single halfspace and then attempted to draw it using CGAL::draw() from draw_nef_3.h. The drawing window contains a rendering of the halfspace but it also contains a mysterious cube. It's not clear to me why a cube is being rendered - my code never issues a command to draw a Nef Polyhedra that looks like a cube. How can I get rid of this cube from the drawing? Is the cube supposed to be there?

I've tried drawing other 3D Nef Polyhedra and I never can seem to get this cube to disappear. It interferes when drawing more complex 3D Nef Polyhedra.

Screenshot 2024-07-22 at 4 16 01 PM
Screenshot 2024-07-22 at 4 16 08 PM

Source Code

#include <iostream>

#include <CGAL/Nef_polyhedron_3.h>
#include <CGAL/draw_nef_3.h>

typedef CGAL::Gmpq number_kernel_t;
typedef CGAL::Extended_cartesian<number_kernel_t> geom_kernel_t;
typedef CGAL::Nef_polyhedron_3<geom_kernel_t> nef_polyhedron_t;
typedef CGAL::Nef_polyhedron_3<geom_kernel_t>::Plane_3 plane_3_t;
typedef CGAL::Nef_polyhedron_3<geom_kernel_t>::Point_3 point_3_t;
typedef CGAL::Nef_polyhedron_3<geom_kernel_t>::Vector_3 vector_3_t;

int main(int argc, char *argv[])
{
    point_3_t v_p1(0, 0, 0);
    point_3_t v_p2(1, 1, 1);
    vector_3_t v(v_p1, v_p2); 

    point_3_t origin(0, 0, 0);
    plane_3_t plane(origin, v);
    
    nef_polyhedron_t polyhedron(plane, nef_polyhedron_t::INCLUDED);

    CGAL::draw(polyhedron);

    return 0;
}

When I run this code, "Using OpenGL context 4.1 GL" is emitted.

Environment

  • Operating system (Windows/Mac/Linux, 32/64 bits): MacOS Sonoma 14.5
  • Compiler: Apple Clang 14.0.3
  • Release or debug mode: Debug
  • Specific flags used (if any): None
  • CGAL version: 5.6.1 from Homebrew
  • Boost version: 1.85.0 from Homebrew
  • Other libraries versions if used: Qt 5.15.13 from Homebrew
@afabri
Copy link
Member

afabri commented Jul 23, 2024

With Extended Cartesian this is probably the infimaximal box.

@andlarson
Copy link
Author

Ah, that makes sense, thanks for the hint.

@afabri
Copy link
Member

afabri commented Aug 6, 2024

@andlarson can you confirm that this is the explanation? It might make sense to draw the cube only as wire frame, based on the Point_type documented here.

@alekseYY
Copy link

@afabri - that's again extended coordinates. I've added a new comment to my issue, which was closed in 2023 - no segmentation fault anymore, but the picture looks strange. Please see: #7377 (comment).

Thank you!

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

No branches or pull requests

4 participants