Skip to Content.
Sympa Menu

cgal-discuss - Re: [cgal-discuss] Splitting Nefs

Subject: CGAL users discussion list

List archive

Re: [cgal-discuss] Splitting Nefs


Chronological Thread 
  • From: Noel Warren <>
  • To:
  • Subject: Re: [cgal-discuss] Splitting Nefs
  • Date: Tue, 12 Mar 2013 13:29:29 +0100

It seems you were right.
changing...
O = CGAL::OFF_to_nef_3(ss, N);
...to...
O = CGAL::OFF_to_nef_3(ss, N).regularisation();
...right at the beginning of my code seemed to fix the errors that end up cropping up much later.

I still have a couple of  nefs that throw errors but I guess they are somehow also not valid.  A bit more investigation is needed.  Thanks for all your help.

2013/3/12 Noel Warren <>
The nef I sent you Is not the result of one boolean operation but dozens of them and many are generated "on the fly". The workflow looks something like...

1) Build Nef using CGAL::OFF_to_Nef
2) Build Nef cube manually using polyhedron incremental builder and then convert to nef.  This represents our stock material.
2) Build a cylinder manually using polyhedron incremental builder and then convert to nef.  This represents a router bit.
3) Create lots of polylines and convert to Nef.  These are our toolpaths.
4) Perform a minkowski sum of the previous two.
5) Subtract from the stock

I'm not sure where to go from here.  If you managed to compile RGAL I could then I could send you some ruby scripts that produce the same errors.  But RGAL is a pain to install (You need ruby 1.9.3, gems, rice...) unless you are somehow motivated to try it out because you want to.

Let me know.


2013/3/11 Sebastien Loriot (GeometryFactory) <>
Looks like something is weird indeed. I suspect the nef to be invalid
(even if the is_valid says the converse). Do you have the two
nefs used to produced it, together with the operation type?

Sebastien.



On 03/11/2013 06:32 PM, Noel Warren wrote:
Hi Sebastien

I actually use CGAL wrapped in ruby.  You can checkout my repo at
(https://github.com/noelwarr/rgal).  Let me know if you want any
licenses put anywhere.  (I do know about the cgal-bindings project but I
couldn't get my head around swig.)

Because it is a pain to compile the whole RGAL repo I have put together
a little cpp file and nef file that fails to create a nef from one of
the volumes.  The interesting thing is that even though the same volume
fails, it throws a different error.  The cpp file complains about a
segmentation fault whereas my ruby wrapped code produces...

CGAL ERROR: assertion violation! (RuntimeError)
Expr: cet->get_index() == ce->twin()->get_index()
File: /usr/local/include/CGAL/Nef_3/SNC_external_structure.h
Line: 1169

Even wierder is the fact that if I don't regularize the nef, the cpp
code produces a result but my ruby code continues to fail.

Let me know if you need something else.

2013/3/11 Sebastien Loriot (GeometryFactory) <
<mailto:>>


    Dear Noel,

    could you please provide a complete compilable example showing the
    problem?

    Thanks,

    Sebastien.


    On 03/07/2013 01:13 PM, Noel Warren wrote:

        I have a function that splits Nefs into smaller nefs from the
        shells of
        the volumes.  I am doing it using an undocumented Nef
        constructor.  In
        the majority of cases it works a charm but ocasionally it fails.
          I have
        attatched a nef that fails (infact it only has one volume so should
        return an Array of length 1 containing a Nef) when trying to split.

        Here is a code snippet

        vector<Nef_polyhedron_3> nefs;
        Nef_polyhedron_3::Volume___const_iterator vi = ++N.volumes_begin();
        Nef_polyhedron_3::Shell_entry___const_iterator si;
        CGAL_forall_volumes(vi,N) {
        if(vi->mark()) {
        Nef_polyhedron_3::Shell_entry___const_iterator si;
        CGAL_forall_shells_of(si, vi) {
        Nef_polyhedron_3::SFace_const___handle sfch(si);

        Nef_polyhedron_3 O(N,sfch);
        nefs.push_back(O);
        }
        }
        }

        Here is the error...

        CGAL ERROR: assertion violation! (RuntimeError)
        Expr: itl != it->second.end()
        File: /usr/local/include/CGAL/Nef_3/__SNC_external_structure.h

        Line: 1102

        If I shouldn't be using this Nef constructor, how should I go about
        "splitting" a nef into smaller ones.  Thanks in advance for your
        time.



    --
    You are currently subscribed to cgal-discuss.
    To unsubscribe or access the archives, go to
    https://sympa.inria.fr/sympa/__info/cgal-discuss
    <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.18.

Top of Page