Skip to Content.
Sympa Menu

cgal-discuss - [cgal-discuss] Merge polylines

Subject: CGAL users discussion list

List archive

[cgal-discuss] Merge polylines


Chronological Thread 
  • From: Bryn Lloyd <>
  • To:
  • Subject: [cgal-discuss] Merge polylines
  • Date: Fri, 21 Aug 2015 09:17:05 +0200

Dear list

Is there some way in CGAL to merge nearly identical/overlapping 3D polylines?

For instance if I would have two polylines of the same circle but faceted slightly differently: is there I way I could with a specified (distance error) tolerance, merge these 2 polylines into one or detect that they are "identical"?

A more complicated example is two squares sharing one edge, but faceted differently along the shared edge.

The goal of this operation is to remove problematic 1D features for 3D mesh generation.

Bryn



On 20.08.2015 16:55, Bryn Lloyd wrote:
Hi CGAL users and devs

I am trying to use make_mesh_3 with feature lines enabled.

I am creating multi-domain meshes with domains defined via surface meshes (I derive from CGAL::Labeled_mesh_domain_3, see below).

Using angle and length criteria I extract feature edges from each surface and add these via

    CGAL::Bbox_3 box = ...;
    domain_wrapper_type domain_wrapper(my_domains, progress);

    Mesh_domain_with_features domain(domain_wrapper, box);

    if( m_EnablePolylineFeatures ) {
        domain.add_features(polylines.begin(), polylines.end());
    }

    Mesh_criteria criteria(edge_size=m_EdgeSize,
        facet_angle=m_FacetAngle, facet_size=sizing_wrapper, facet_distance=m_FacetDistance,
        cell_radius_edge=m_CellRatio, cell_size=m_CellSize );

    auto c3t3 = CGAL::make_mesh_3<C3t3>(domain, criteria, no_lloyd(), no_odt(), perturb(), exude());

Sometimes the mesh generation fails when edges are too close, e.g. if they are (partially) overlapping or closer than the chosen 'edge_size'.
How can I robustly detect (nearly) overlapping edges/feature lines in order to remove/cleanup these lines?


Thanks for any ideas,
Bryn



    template< class BGT,class Wrapper=CLabelFunction<BGT> >
    class CLabeledMeshDomain : public CGAL::Labeled_mesh_domain_3<Wrapper, BGT>
    {
    public:
        typedef CGAL::Labeled_mesh_domain_3<Wrapper, BGT> Base;

        typedef typename Base::Sphere_3 Sphere_3;
        typedef typename BGT::FT FT;
        typedef BGT Geom_traits;
        typedef CGAL::Bbox_3 Bbox_3;

        CLabeledMeshDomain(const Wrapper& wrapper, const Bbox_3& bbox, const FT& error_bound = FT(1e-3))
            : Base(wrapper,bbox,error_bound) {}
        virtual ~CLabeledMeshDomain() {}


    private:
        // Disabled copy constructor & assignment operator
        typedef CLabeledMeshDomain<BGT> Self;
        CLabeledMeshDomain(const Self& src);
        Self& operator=(const Self& src);
    };





Archive powered by MHonArc 2.6.18.

Top of Page