Skip to Content.
Sympa Menu

cgal-discuss - Re: [cgal-discuss] Compute Optimal Bounding Box without Eigen library

Subject: CGAL users discussion list

List archive

Re: [cgal-discuss] Compute Optimal Bounding Box without Eigen library


Chronological Thread 
  • From: Bob Bill <>
  • To: "" <>
  • Subject: Re: [cgal-discuss] Compute Optimal Bounding Box without Eigen library
  • Date: Mon, 3 Oct 2022 09:58:35 +0000 (UTC)
  • Authentication-results: mail3-smtp-sop.national.inria.fr; spf=None ; spf=Pass ; spf=None
  • Ironport-data: A9a23:7roA9ahyxLvwcmjh1HItq9raX161ORsKZh0ujC45NGQN5FlHY01je htvC2iPPfqNM2f2KIx2OoSyoU1QscfSx4BrHgA5/yAwFyJjpJueD7x1DG+gZnLIdpWroGFPt phFNIGYdKjYaleG+39B55C49SEUOZmgH+a6UqicUsxIbVcMYD87jh5+kPIOjIdtgNyoayuAo tqaT/f3YTdJ4BYpdDNPg06/gEk35q6r4GtD5gVWic1j5TcyqVFFVPrzGonqdxMUcqEMdsamS uDKyq2O/2+x13/B3fv4+lpTWhRiro/6ZWBiuFIOM0SRqkQqShgJ70oOHKF0hXG7JNm+t4sZJ N1l7fRcQOqyV0HGsLx1vxJwS0mSMUDakVPKCSDXjCCd86HJWzz957ZLVVEtAb0/q/dZK01U9 /gkAy9YO3hvh8ruqF66YvJrgMUod5CxedlC/HpnyyrcF7AjSJHHBaTQv5lJ1Tc3gYZFGvO2i 8gxNmUpNk+QJUQQahFGVvrSn8/w7pX7WzdZrFaf+PZpy3nazAt2lrPqNbI5f/TQGJ8Ezx3A+ Aoq+UzyPQMEDsbA1QG4+2+DndfFuxnlB4crQejQGvlC2wfPnzBJVHX6T2CTqvawjguyWslUN lcP0jE/qLA7sk2tVNj0GROiyENopTYHXNxRGLZjskTXl+zf5ACCA3JCSzdAbJonrpVwVDUq0 VjPlNTsbdByjFGLYTWM0vSx9COpBRgyfH4sTwMeTw85yMa29enfkSnzZtpkFae0iPj8Fjfx3 y2GoUACa1M70pNjO0KTog6v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ZPuWtcQ+dpn SLJstN0i0qhlOiEkWM9FUAT7D1MgpmOpwNnMKTdsJhaAzDV9RIK6iObDBFA9L4HQpX//qtXz NbIjqf6LjxPpsnV8cUrDM/RMMubMXAlPHIB9xbFBQsCSnigMmSN3iS1ddmD/32Sqd4xrZ2+w PLmq5dAU1o0HahDUAE/QZoJJ5FsWylilLeaiIgJ/yD4vRDRQ8IctZfCBKr6PA==
  • Ironport-sdr: 633ab2e9_xR0Uq2qVv1sCKkg2Ob3uaUIrRySrADU0sWiV3dbxbgdYAqB lqrX+MYLdEQXVIJ+0wtcBlPZy+RuK4r91NIEI2g==

I've just noticed that my Vector class doesn't meet the requirements... could that error (forming reference to void) be due to that? 

Regarding the sharing, I contacted the guy supervising me about this. He'll reach you out very soon. Thanks a lot.

Best,
Bob
Il lunedì 3 ottobre 2022, 10:10:16 CEST, Mael Rouxel-Labbé <> ha scritto:


Hello,

Your Vector class must meet the requirements described in https://doc.cgal.org/latest/Solver_interface/classSvdTraits_1_1Vector.html.

The error you are getting seems more related to named parameters (that's the "CGAL::parameters::geom_traits(...)" part). Could you share your code (you can send me a direct email if you want it to remain private), and I will have a look?

Best,
Mael

On 02/10/2022 11:33, Bob Bill ( via cgal-discuss Mailing List) wrote:
Thanks Mael for the explanation. Unfortunately, I'm still struggling to make this work. As you suggested, I started from the model you wrote in Oriented_bounding_box_traits_3.h

My class looks like this:

template <typename Kernel>
class Custom_BBox : public Kernel
{
public:
Custom_BBox()
{}
/// The field number type
using FT = typename Kernel::FT;
/// The affine transformation type
using Aff_transformation_3 = typename CGAL::Aff_transformation_3<Kernel>;
// Matrix type
using Matrix = FullMatrix<FT>;
Vector type
 //using Vector = Vector<FT>;
static Matrix
get_Q(const Matrix &m)
{
//returing the right matrix
}
};

Here I have two issues/questions: 
1) In the library I'm using, the type Vector already exists. As far as I understand, CGAL will look for a type named Vector. It should enough to check that Vector meets the requirements described in CGAL (i.e. svdTraits), right?

2) When I compile, I keep getting 
/usr/include/CGAL/boost/graph/Named_function_parameters.h:130:3: error: forming reference to void
130 | reference;
| ^~~~~~~~~
 
By inspection of CGAL sources, it seems to me that 
//line 128 of /usr/include/CGAL/boost/graph/Named_function_parameters.h
boost::is_same<NP_reference, internal_np::Param_not_found>
returns True, meaning that the my parameters are not found. How can I try to fix this?


Best,
Bob

Il venerdì 30 settembre 2022, 18:08:58 CEST, Mael Rouxel-Labbé ha scritto:


You do not have to modify the CGAL model to create and use your own model in CGAL's function: you instead create a new class living outside of CGAL headers, and then pass it to the function. However, it is a good idea to start from the CGAL model and tune / replace whatever you wish to change (here, the Eigen parts).

Here is a gist demonstrating usage of a CGAL function with a custom traits. It is a simpler concept that only requires a Point object and how to compare them, but it would be the same idea for you. The custom geometric traits is passed in the call:

  PMP::stitch_borders(mesh, CGAL::parameters::geom_traits(traits));

It will be similar for CGAL::oriented_bounding_box(..., CGAL::parameters::geom_traits(your_traits)).

Let me know if you encounter any issue.

Best,
Mael

On 30/09/2022 17:59, Bob Bill ( via cgal-discuss Mailing List) wrote:
Thanks so much for the explanation, Mael. Is there a way to provide a model without changing the internals of CGAL (in this case without touching Oriented_bounding_box_traits_3.h) ?
In my specific application, I am not allowed to modify them.

Best,
Bob
Il venerdì 30 settembre 2022, 17:00:55 CEST, Mael Rouxel-Labbé ha scritto:


Hello,

The geometric traits class is a class that describes the requirements on the geometric objects used in an algorithm, here the oriented bounding box computation algorithm. These requirements are described by a concept (https://doc.cgal.org/latest/Optimal_bounding_box/classOrientedBoundingBoxTraits__3.html). If you do not implement yourself a class meeting these requirements - which is the typical situation -, CGAL uses a class which fits these requirements; here it is CGAL::Oriented_bounding_box_traits_3 (https://doc.cgal.org/latest/Optimal_bounding_box/classCGAL_1_1Oriented__bounding__box__traits__3.html). This class is called a model of the concept.

As the concept (OrientedBoundingBoxTraits_3) describes, matrix manipulations are required in the OBB computation algorithm. The model provided by CGAL (CGAL::Oriented_bounding_box_traits_3) uses Eigen to implement these matrix operations, which thus makes Eigen required except if you create and provide another model class that fits the requirements of the concept with another matrix implementation.

Best,
Mael

On 30/09/2022 16:51, Bob Bill ( via cgal-discuss Mailing List) wrote:
Dear all,

I am trinyg to compile the simplest example from the Optimal Bounding Box page (https://doc.cgal.org/latest/Optimal_bounding_box/Optimal_bounding_box_2obb_example_8cpp-example.html).

and I get the following error, which is expected since I don't have Eigen: 

[build] /usr/include/CGAL/Optimal_bounding_box/oriented_bounding_box.h:348:3: error: static assertion failed: You must provide a traits class or have Eigen enabled!

However, from the message it seems that by providing a Traits class it would be possible to make this work. What does it mean?

Best,
Bob

--
You are currently subscribed to cgal-discuss.
To unsubscribe or access the archives, go to
https://sympa.inria.fr/sympa/info/cgal-discuss


--
You are currently subscribed to cgal-discuss.
To unsubscribe or access the archives, go to
https://sympa.inria.fr/sympa/info/cgal-discuss


--
You are currently subscribed to cgal-discuss.
To unsubscribe or access the archives, go to
https://sympa.inria.fr/sympa/info/cgal-discuss


--
You are currently subscribed to cgal-discuss.
To unsubscribe or access the archives, go to
https://sympa.inria.fr/sympa/info/cgal-discuss


--
You are currently subscribed to cgal-discuss.
To unsubscribe or access the archives, go to
https://sympa.inria.fr/sympa/info/cgal-discuss


--
You are currently subscribed to cgal-discuss.
To unsubscribe or access the archives, go to
https://sympa.inria.fr/sympa/info/cgal-discuss




Archive powered by MHonArc 2.6.19+.

Top of Page