Skip to Content.
Sympa Menu

cgal-discuss - Re: [cgal-discuss] Merge polylines

Subject: CGAL users discussion list

List archive

Re: [cgal-discuss] Merge polylines


Chronological Thread 
  • From: Bryn Lloyd <>
  • To:
  • Subject: Re: [cgal-discuss] Merge polylines
  • Date: Mon, 24 Aug 2015 14:05:05 +0200

Dear Sebastien

I attached the surface and polylines as code sample (C-arrays), but can also provide other formats if that is easier for you.

Thanks & best regards





On 8/24/2015 1:11 PM, Bryn Lloyd wrote:
Thanks. I will send the data just now.

There error I am getting when I don't merge or pre-process the feature lines is in

Protect_edges_sizing_field.h
-> smart_insert_point
-> line 550

CGAL_assertion( minimal_size_ >0 || sq_d > 0 );

What is the meaning of this code, i.e. what is 'minimal_size_' and what is 'sq_d'? How can I avoid this condition?






On 8/24/2015 10:23 AM, Sebastien Loriot (GeometryFactory) wrote:
I have some experimental code that might be good enough in your case.
Could you send me some representative data sample so that I can give it a try?

Thanks,

Sebastien.

On 08/21/2015 09:17 AM, Bryn Lloyd wrote:
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);//
// };//
/






// there are 24 polyines, the sharp edges of two cubes
int polyline_length[24] = {
2, // the first two points in polyline_points belong to this polyline
2, // the next two points ...
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2
};
double polyline_points[72] = {
29, 7, 18,
-8, 7, 18,
29, 7, 18,
29, -39, 18,
29, 7, 18,
29, 7, 0,
29, 7, 0,
29, -39, 0,
29, 7, 0,
-8, 7, 0,
-8, 7, 0,
-8, -39, 0,
-8, 7, 0,
-8, 7, 18,
-8, -39, 0,
29, -39, 0,
-8, -39, 0,
-8, -39, 18,
-8, -39, 18,
-8, 7, 18,
-8, -39, 18,
29, -39, 18,
29, -39, 0,
29, -39, 18,
67.9509, -18.3161, 18,
31.0917, -15.0913, 18,
67.9509, -18.3161, 18,
63.9418, -64.141, 18,
67.9509, -18.3161, 18,
67.9509, -18.3161, 0,
67.9509, -18.3161, 0,
63.9418, -64.141, 0,
67.9509, -18.3161, 0,
31.0917, -15.0913, 0,
31.0917, -15.0913, 0,
27.0826, -60.9163, 0,
31.0917, -15.0913, 0,
31.0917, -15.0913, 18,
27.0826, -60.9163, 0,
63.9418, -64.141, 0,
27.0826, -60.9163, 0,
27.0826, -60.9163, 18,
27.0826, -60.9163, 18,
31.0917, -15.0913, 18,
27.0826, -60.9163, 18,
63.9418, -64.141, 18,
63.9418, -64.141, 0,
63.9418, -64.141, 18
};
int NN=16;
double points[48]={
29, -39, 18,
29, 7, 18,
-8, 7, 18,
-8, -39, 18,
29, 7, 0,
29, -39, 0,
-8, -39, 0,
-8, 7, 0,
63.9418, -64.141, 18,
67.9509, -18.3161, 18,
31.0917, -15.0913, 18,
27.0826, -60.9163, 18,
67.9509, -18.3161, 0,
63.9418, -64.141, 0,
27.0826, -60.9163, 0,
31.0917, -15.0913, 0,
};

int NTRI=24;
int triangles[72]={
1, 2, 0,
0, 2, 3,
5, 6, 4,
4, 6, 7,
3, 6, 0,
0, 6, 5,
2, 7, 3,
3, 7, 6,
1, 4, 2,
2, 4, 7,
0, 5, 1,
1, 5, 4,
9, 10, 8,
8, 10, 11,
13, 14, 12,
12, 14, 15,
11, 14, 8,
8, 14, 13,
10, 15, 11,
11, 15, 14,
9, 12, 10,
10, 12, 15,
8, 13, 9,
9, 13, 12,
};




Archive powered by MHonArc 2.6.18.

Top of Page