Skip to Content.
Sympa Menu

cgal-discuss - Re: [cgal-discuss] PMP performance question

Subject: CGAL users discussion list

List archive

Re: [cgal-discuss] PMP performance question


Chronological Thread 
  • From: Tony Apicella <>
  • To: "" <>
  • Subject: Re: [cgal-discuss] PMP performance question
  • Date: Fri, 29 Jan 2021 21:21:20 +0000
  • Accept-language: en-US
  • Arc-authentication-results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=epmap-system.com; dmarc=pass action=none header.from=epmap-system.com; dkim=pass header.d=epmap-system.com; arc=none
  • Arc-message-signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=Q0SNEDhcKvrCj4k5dNRdYJAvEybixOhskUp0gET8jck=; b=WyzSf9hL8Dh6nN/v9dVhqdV9GViL4ZJEXHAjxwzzdT5fDHg05PUBUjUAsGZaMkKnxbQjnnNa/p6U7O0oLC9VPIizkyuD9cAwIZc9GoqSdBAf+o7rc9lJXiD3M+yh1La6MSNpErxdTMDtIDAfXwvo35enmrQbpI3uvtlzPSZfjtCOzmNjL0zb7V/qgPdvABsAng+I+j93mSvk258VzyQAs57pa6lS27IGV9cJMPmb5wcKQRLaEgOZid0ly7O8ONLhRAv4kYdkKr//qKciA3s8R0ldy8a2DKLoaE75HAtH2SLiDucvX5smZUfHpwi5zUlDsUNou8amOYq0Im5sVHsbOw==
  • Arc-seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=NErBy9DAyuzGutevxVv+w8paCRn6yqrQaiWU66s8a0gzjHkJCGkNAUHNR+kGfxXjFpFsf8FH0wQowoyubvML0FTbIZtwy+b9Q7AllHHnNNIiYrvICoAihvcFy6OHmAdTppoyanvDkitiE83WfQwOPaq/ZQULeXhwk9jqGSGi/isQ+7H4GELwiSAPKw9JbHM/Z1fXrNupyeqaeOvQQJotcqa75V+fBtRJzQ5JLb0cgY6ZWbp6cqT7cNHT1jIHfYzzFXcQUBHYgzqYihvj40byh4S+lqt6zqYwoB26NMY8xgoZz+TaRm/K2b6mHasgXvyEwEAgbfNXsoyiZ+LIWTxyug==
  • Authentication-results: mail3-smtp-sop.national.inria.fr; spf=None ; spf=Pass ; spf=Pass
  • Ironport-phdr: 9a23:A3sXkRA18XLbS5ykaQUyUyQJP3N1i/DPJgcQr6AfoPdwSP34pc6wAkXT6L1XgUPTWs2DsrQY0ruQ6PqrADZaqdbZ6TZeKcMKD0dEwewt3CUYSPafDkP6KPO4JwcbJ+9lEGFfwnegLEJOE9z/bVCB6le77DoVBwmtfVEtfre9FYHdldm42P6v8JPPfQpImCC9YbRvJxmqsAndrMYbjZZmJ6orxBbFvHREd/lIyW92OFmfmwrw6tqq8JNs7ihduegt+9JcXan/Yq81UaFWADM6Pm4v+cblrwPDTQyB5nsdVmUZjB9FCBXb4R/5Q5n8rDL0uvJy1yeGM8L2S6s0WSm54KdwVBDokiYHOCUn/2zRl8d9kbhUoBOlpxx43o7UfISYP+dwc6/BYd8XQ3dKU8BMXCJDH4y8dZMCAeofM+hFs4nzqVgArRW8CgmtGOzgxSRFiWXq0aEmyektDR3K0BEmEtkTsHrUttL1NKIKXO6ry6nIyzXCZO5K1Dfl6YjHbg4uofWIXb1qbMHczlUvFwTDjlSQs4PlJzKV2fgTvGif6+pvT/mihHA/qwF0uDev3t4gipLJh4IO1lDL6yB5zJwpKt2/TU52eNipG4ZfuC+GLYV5WN8iQ312tyYgzL0LoZ62cTQExpkj2RLRZP6KfpaU7h/gW+ifISt1iW57dL+hhhu88Uitx/P8W8Sw31tHrDRJnsTQun0Q1BHd5NWLR+Z780y81ziP0AXT5ftFIUAyjafUN5EhzaQ0lpYJtkTDBCD2lF35jK+XakUk+vWo5P/9brr6oZ+cMpd4igD4MqQ0m8ywG/40MgYUX2Wd5O+y16Xj8FX2TblWlPE6j7XVvZLAKcgGuKK0ARVZ34U/5xqnETur0cgUkWQCIV9Edx+KjY3kNlHQL/37Ef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dMzcbFmR6iF70ZJOllMwXWQ6jaA17zBY=

I am doing a union of two meshes also, and I see that sometimes only one mesh is included in the union, even though both meshes intersect.  I have tried increasing the facet_distance of mesh_3 create mesh with partial success.  I have placed the code and data in the code base.

First, I create meshes around sub volumes of a gray scale image and write the outer boundary of the resulting C3T3s to the disk.

Later I read back two neighboring meshes, each into a mesh of type SurfaceMesh<K::Point_3> and call the co-refine and compute union method in the PMP namespace.

Union results are sometimes as expected and other times one of the meshes is not included in the union.    

Is the problem that I am writing a C3T3 outer boundary and reading into a Surface Mesh?  Is this causing truncation or other boundary error?

Should I convert the C3T3 to a Surface Mesh first, and then write it?

Thank you.




From: <> on behalf of Sebastien Loriot <>
Sent: Wednesday, January 27, 2021 10:34 AM
To: <>
Subject: Re: [cgal-discuss] PMP performance question
 
When doing a union operation, the first step of the operation is
to filter the intersection between the bounding boxes of the input
triangles. This is done in a clever way using this package:
https://doc.cgal.org/latest/Box_intersection_d/

The rest of the runtime then depend on the size of the intersection of
triangles.

I don't know why the second step if slower, because in both cases the
size of at least one mesh increases so maybe it depends on the order of
the cubes.

I guess, the fastest sequential option would be to used the experimental
non-documented function
CGAL::Polygon_mesh_processing::experimental::autorefine_and_remove_self_intersections(m);

Build the mesh m by appending all your meshes inside and call that
function. It will build only on hierarchy of bboxes for all the
triangles and will resolve the intersection. It is still experimental
and will throw an exception in case they are more than 2 input meshes
sharing an edge. The exception type is
CGAL::Polygon_mesh_processing::corefinement::Triple_intersection_exception

For the multithreaded version, I've create a simple example doing the
union in parallel:
https://github.com/CGAL/cgal/pull/5403
It is a basic version that might need extra step depending on how
complex is the input.

Best regards,

Sebastien.

On 1/22/21 5:05 AM, Giles Puckett wrote:
> Hello,
>
> I have an application that builds 3D volumes by combining simple shapes
> (cubes, cylinders) using corefine_and_compute_union. There may be
> 100-400 simple shapes.
>
> I tried two ways of doing the unions:
>
> 1. Build up the result by unioning in one cube at a time, or
>
> 2. Union the simple shapes in pairs, then union their results (in a
> binary tree fashion) until you get one object left.
>
> I noticed that method 2 is a lot slower than method 1 - I assumed it was
> because there are many more faces to be split when corefining. Is this a
> reasonable assumption? I am interested in method 2 again as it lends
> itself to doing unions in parallel, potentially reducing operations from
> O(N) to O(log2 N) if there are enough cores/threads.
>
> What determines the performance if corefine_and_compute_union? Is it the
> complexity of the meshes, the complexity of the intersection path, or
> something else?
>
> And is PMP able to be multithreaded?
>
> Giles.
>
>

--
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