cgal | The public CGAL repository , see the README | Image Editing library

 by   CGAL C++ Version: v5.6-beta1 License: Non-SPDX

kandi X-RAY | cgal Summary

kandi X-RAY | cgal Summary

cgal is a C++ library typically used in Media, Image Editing applications. cgal has no bugs, it has no vulnerabilities and it has medium support. However cgal has a Non-SPDX License. You can download it from GitHub.

The public CGAL repository, see the README below
Support
    Quality
      Security
        License
          Reuse

            kandi-support Support

              cgal has a medium active ecosystem.
              It has 3963 star(s) with 1230 fork(s). There are 164 watchers for this library.
              OutlinedDot
              It had no major release in the last 12 months.
              There are 402 open issues and 2323 have been closed. On average issues are closed in 204 days. There are 93 open pull requests and 0 closed requests.
              It has a neutral sentiment in the developer community.
              The latest version of cgal is v5.6-beta1

            kandi-Quality Quality

              cgal has no bugs reported.

            kandi-Security Security

              cgal has no vulnerabilities reported, and its dependent libraries have no vulnerabilities reported.

            kandi-License License

              cgal has a Non-SPDX License.
              Non-SPDX licenses can be open source with a non SPDX compliant license, or non open source licenses, and you need to review them closely before use.

            kandi-Reuse Reuse

              cgal releases are available to install and integrate.
              Installation instructions are available. Examples and code snippets are not available.

            Top functions reviewed by kandi - BETA

            kandi's functional review helps you automatically verify the functionalities of the libraries and avoid rework.
            Currently covering the most popular Java, JavaScript and Python libraries. See a Sample of cgal
            Get all kandi verified functions for this library.

            cgal Key Features

            No Key Features are available at this moment for cgal.

            cgal Examples and Code Snippets

            No Code Snippets are available at this moment for cgal.

            Community Discussions

            QUESTION

            What is CGAL::data_file_path()?
            Asked 2022-Apr-02 at 16:33

            I am trying to use Cmake to build a program that uses CGAL. In my CMakeLists.txt file I have this:

            ...

            ANSWER

            Answered 2022-Apr-02 at 16:33

            If you open the CGAL documentation page and type the text "data_file_path" into the search field in the upper right corner, you'll get:

            std::string CGAL::data_file_path (const std::string & filename)
            returns the full path of a data file from CGAL.

            The data files are located in the data directory of a CGAL release or in the directory Data/data from a git branch checkout. That function uses as prefix the environment variable CGAL_DATA_DIR if set, and the value of the macro CGAL_DATA_DIR otherwise. When using cmake and a standard CGAL setup, linking the target using that function with the target CGAL::Data will automatically set the macro CGAL_DATA_DIR pointing to the data directory of the CGAL version used. The function will attempt to open the file at the returned location and will print a warning message via std::cerr if the file could not be opened.

            Also you can find examples of using the data_file_path function in the CGAL examples directory (which is not installed by default AFAIK).

            If you don't call this function in your code, then you can ignore the CMake warning you're asking about - that's what I do for a long time. Also you can get rid of this warning, if you set the CGAL_DATA_DIR macro in the CMakeLists.txt, for example:

            Source https://stackoverflow.com/questions/71713439

            QUESTION

            How do you get the medial axis of a multipolygon using CGAL?
            Asked 2022-Feb-22 at 23:50

            I would like to extract the medial axis of a MultiPolygon using CGAL.

            Looking through the CGAL documentation I only see functions to make a straight skeleton.

            How can I use CGAL to get the medial axis?

            ...

            ANSWER

            Answered 2022-Feb-22 at 23:50
            Overview

            If we have a polygon (a planar domain with straight edges, possibly convex) then the edges which form the medial axis of a polygon are a subset of the multipolygon's Voronoi diagram.

            Our strategy, then, is to find the polygon's Voronoi diagram and then remove edges from the diagram until we are left with the medial axis. If we have a MultiPolygon we just repeat the process for each of its constituent polygons.

            I'll demonstrate the process visually below and then present code to accomplish it. The data for the test polygon I'll use is this WKT:

            Source https://stackoverflow.com/questions/69237154

            QUESTION

            Align two topologically identical meshes
            Asked 2022-Feb-18 at 21:05

            I have two meshes who represent two different heads, as in not geometrically identical, but have the same topology. Also, a subset of those points represents the same features on the human face, i.e the tip of the nose, chin, angle of mouth, and so on; they are used in the topology transfer algorithm from which the modified mesh comes from.

            Now, while the topologies match, as in the two meshes have the same points numbers, and the points are connected in the same way, the object are not optimally oriented in space.

            I'm looking for the name of the optimization step that would better align the two meshes, and whether this concept somehow already exists in CGAL.

            The distance between the two meshes could be just the sum of the distances between the matching points, or something more subtle which could give more weight to the points close to the landmarks used in the earlier step. Any linear transformation is admissible, but the ones that make more sense in this context are translations, rotations and scaling.

            Files are here is you're interested in having a look

            ...

            ANSWER

            Answered 2022-Feb-18 at 21:05

            I found a way to do it - not in CGAL, but in OpenCV

            Function is: estimateAffine3D

            estimateAffine3D() int cv::estimateAffine3D ( InputArray src, InputArray dst, OutputArray out, OutputArray inliers, double ransacThreshold = 3, double confidence = 0.99 )

            Computes an optimal affine transformation between two 3D point sets.

            It computes R and T, such that P' = RxP + T , and the distances between the matching points in each set is minimized. R rotation matrix, T translation matrix.

            Source https://stackoverflow.com/questions/70840889

            QUESTION

            Is it possible to draw 3d segments with CGAL?
            Asked 2022-Feb-11 at 08:37

            I want to draw 3d segments, and the camera can rotate, so that I can observe the segments from various perspectives. I wonder if there is a way to draw them with CGAL? I know that CGAL is not specific for visualization, so the question itself may be some kind of silly. But it will be really helpful for me if it has this function, because I have some experience with CGAL.
            I have tried to learn OpenGL, but it's not possible for me to master it in a short time. And I don't want to spend much time to learn OpenGL, because I will not use it again in future work.
            If CGAL doesn't have this function, could you please recommend some lightweight open source libraries which can draw 3d segments? I don't need a very feature-rich, but huge library. One easy to use and lightweight is best for me. Thanks a lot!

            ...

            ANSWER

            Answered 2022-Feb-10 at 11:41

            CGAL::Basic_viewer_qt allows to draw points, segments and faces in 2D/3D. You can define your own viewer inheriting from this class.

            As suggested by Marc, have a look at the different draw_XXX.h files to see how this is achieved for several viewers in CGAL.

            Source https://stackoverflow.com/questions/71061771

            QUESTION

            How to fix "Qt requires a C++17 compiler" error?
            Asked 2022-Jan-19 at 22:18

            I installed with brew the CGAL C++ library. After doing cmake . in the first basic example , I do make and I got a sequence of errors, the first one and most important is:

            ...

            ANSWER

            Answered 2022-Jan-19 at 22:18

            Actually, you will need to tell cmake to activate c++17 support in the compiler commands it generates. By default, Apple clang was chosen, and that comes with an earlier default std support.

            Source https://stackoverflow.com/questions/70775319

            QUESTION

            How to get the edges of a 3D Delaunay tessellation with CGAL?
            Asked 2022-Jan-04 at 10:51

            The question is clear from the title. I tried a ton of variants of

            ...

            ANSWER

            Answered 2022-Jan-04 at 10:51

            No need to use addition or modular arithmetic. The solution is simpler:

            Source https://stackoverflow.com/questions/70568575

            QUESTION

            How to save triangulation object(Constrained_Delaunay_triangulation_2) to file(vtk, vtu, msh etc) in CGAL
            Asked 2021-Dec-18 at 23:15

            Created simple program based on 8.3 Example: a Constrained Delaunay Triangulation. And just wanna to export it to some common mesh file format like vtk, msh etc, to be able open it in GMesh or ParaView. To do so I found that most straightforward way is to use write_VTU. And at the beginning and at the end of example code I added next:

            ...

            ANSWER

            Answered 2021-Dec-17 at 08:16

            As documented here the face type of the triangulation must be a model of DelaunayMeshFaceBase_2. You can for example use Delaunay_mesh_face_base_2 like in this example.

            Source https://stackoverflow.com/questions/70383755

            QUESTION

            Change color of mesh displayed by the function CGAL::draw()
            Asked 2021-Dec-17 at 08:51

            Problem description
            I wonder if there is a way to change the color of mesh displayed by the function CGAL::draw(). I have a Surface_mesh, I want to draw it with CGAL. So I use the function CGAL::draw(), but the color of mesh is blue, which is not pretty in my view. I tried to change the code of CGAL to change the color. I found a functor called DefaultColorFunctorFaceGraph in a header file called draw_face_graoh.h, there is an annotation above the definition of DefaultColorFunctorFaceGraph, which says "// Default color functor; user can change it to have its own face color". I change the functor, in which I change the return value to CGAL::IO::gray(), but it doesn't work at all, the color of mesh is still blue.
            So can I change the color of mesh by changing the code of CGAL? Is it necessary to change lower level code such as some codes calling OpenGL?

            Code
            Here is an example about the way I use the function draw().

            ...

            ANSWER

            Answered 2021-Dec-17 at 08:51

            Finally I found a struct named Basic_viewer_qt in a header file called Basic_viewer_qt.h. By changing the values of variables m_faces_mono_color and m_ambient_color in this struct, color of mesh can be changed.

            Source https://stackoverflow.com/questions/70388184

            QUESTION

            How to draw triangles using CGAL?
            Asked 2021-Dec-17 at 08:26

            Problem description
            I have a list which contains many triangle_3 objects. It should look like a closed surface mesh, but I don't use a Surface_mesh to represent it for many reasons. However, I really want to check it, so I want to draw it. I read CGAL manual, but I didn't find any functions that I can use on Windows. I found a function named draw_triangles in the Geomview package, but the user manual of this package says "The functionality described in this chapter is not available on Windows". It seems that it is not possible to use draw_triangles function in my programming environment. How can I draw the triangles?
            Programming environment
            windows x64
            VS 2017
            CGAL 5.3

            ...

            ANSWER

            Answered 2021-Dec-17 at 08:26

            I would advice to build a Surface_mesh only for display purpose. You can use the following example. If your triangle soup is not directly a valid surface mesh, you can use the functions orient_polygon_soup() and polygon_soup_to_polygon_mesh().

            See also this example.

            EDIT I never tried it but it seems that you can change color globally or per face by adding a partial template specialization to the following class:

            Source https://stackoverflow.com/questions/70105477

            QUESTION

            To calculate intersections between a ray and a mesh
            Asked 2021-Nov-15 at 02:02

            Problem description

            I want to calculate all intersections between a ray and a surface mesh which was built from points cloud using the function CGAL::advancing_front_surface_reconstruction(). The cost of time matters very much for me. So I want to use the package named Fast Intersection and Distance Computation. But when I built AABBtree from a surface mesh by the function tree(), a bug occurs. The IDE's bugs list shows: '' can not transform to CGAL::AABB_face_graph_triangle_primitive from "initializer list".
            I use the kernel named CGAL::Exact_predicates_inexact_constructions_kernel when I reconstruct mesh from points cloud with CGAL::advancing_front_surface_reconstruction(), but a Simple_cartesian kernel is required in the Fast Intersection and Distance Computation. Is that the main reason? How can I use the two program package together?

            Code

            The code is as follows:

            ...

            ANSWER

            Answered 2021-Nov-15 at 02:02

            After I paint the point (-100,-50,-0) in the mesh sv, I got the reason why the result which seems to be ridiculous come up. Technically, it's not a wrong answer mathematically, it's just not what I was expecting. The ray starting at this point and in the direction of (0, 0, 1) is a ray intersect with many facets on the side of the grid. The CGAL library does a good job of calculating intersections in this case, but I need to filter out the intersections.

            Source https://stackoverflow.com/questions/69953358

            Community Discussions, Code Snippets contain sources that include Stack Exchange Network

            Vulnerabilities

            No vulnerabilities reported

            Install cgal

            Head over to the [CGAL manual](https://doc.cgal.org/latest/Manual/general_intro.html) for usage guides and tutorials that will get you started smoothly.

            Support

            For any new features, suggestions and bugs create an issue on GitHub. If you have any questions check and ask questions on community page Stack Overflow .
            Find more information at:

            Find, review, and download reusable Libraries, Code Snippets, Cloud APIs from over 650 million Knowledge Items

            Find more libraries

            Stay Updated

            Subscribe to our newsletter for trending solutions and developer bootcamps

            Agree to Sign up and Terms & Conditions

            Share this Page

            share link