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: Sun, 2 Oct 2022 09:33:55 +0000 (UTC)
  • Authentication-results: mail3-smtp-sop.national.inria.fr; spf=None ; spf=Pass ; spf=None
  • Ironport-data: A9a23:EvKNjKwdyf/2FAdBfTN6t+dpzSrEfRIJ4+MujC+fZmUNrF6WrkUCm DdLCGHTaPqLZTT3Ldpzb9y+pB8B75SHm9dhQQE5qFhgHilAwSbnLYTAfx2oZ0t+DeWaERk5t 51GAjXkBJppJpMJjk71atANlVEliefSAOKU5NfsYkhZXRVjRDoqlSVtkus4hp8AqdWiCmthg /uryyHkEALjimUc3l48sfrZ8ko35K2q41v0g3RnDRx1lA+G/5UqJMlHTU2BByOQapVZGOe8W 9HCwNmRlo8O10pF5nuNy94XQ2VSKlLgFVDmZkl+B8BOtiN/Shkaic7XAhazhXB/0F1ll/gpo DlEWAfZpQ0BZsUgk8xFO/VU/r0X0aBuoNf6zXaDXcO71En9dyXJ+ahVEEg2G5UV+791JHF36 qlNQNwNRkjra+Oe27W9S+I33pVmdpWtN4QZoXR6izTQDPJgQIqZBbTD5dhfmjw3g6iiH96BO IxDMmopNUuRJU0VUrsUIMpWcOOAjHj7dzcF9Ay9tKM35G+Vxwt0uFToGICIIIfTG5UE9qqej kbguHvVBzUfDtmw4zC56UC2ic7vmBquDer+E5XjrKIz3AfProAJMzUdWlK/5PW4kUWjQMl3M F0R4iNorK4o9UXtQMOVYvGjiGWDuB8XAIIBVrdmrgqKzLHR+UCcD2kACD9bMpo3vc8xQnoh0 Vrhc87V6SJHq7muTSy4zOqvsTqyHzAYLDYAQD89Ul5QizX8m70bghXKR9dlNae6iNzpBD39q wxmSgBh2t3/auZUic2GEUD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vlG7W4S0LxT7SofHK0ww neUpdlouFS81OyGyz4hUQAU7CdChIWM+05lPO+Kk/sIEWaB9xUL42KKDh0MrNYwEdzjtZdbz d3Xnb7yIjNPmzo71doVB8/TbsmANSh4WfIIMCXTCgoOFmb6cDuDwUdaluqX7DuQp5k+7Jn2w twfQ79cUxo+EfZIUiyN+fQTKZdwWXUvlrvJ1KY1
  • Ironport-sdr: 63395b04_dzQI6EX5JiBvlkQQ9ft1hqY4j1fRTNTOAyNpmTtDfb4Jdb1 ZZbHFW9Q7gK4MT7gCUevDTEiI4N1HqI4g3JJtQA==

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




Archive powered by MHonArc 2.6.19+.

Top of Page