Subject: CGAL users discussion list
List archive
- From: Sebastien Loriot <>
- To:
- Subject: Re: [cgal-discuss] PMP performance question
- Date: Wed, 27 Jan 2021 19:34:11 +0100
- Authentication-results: mail2-smtp-roc.national.inria.fr; spf=None ; spf=Pass ; spf=None
- Ironport-phdr: 9a23:7nHKdRVjJ24rJYcNmb3CYEJnDa/V8LGtZVwlr6E/grcLSJyIuqrYbRyAt8tkgFKBZ4jH8fUM07OQ7/mxHzZQqs/Z6DhCKMUKC0Zaz51O3kQJO42sMQXDNvnkbig3ToxpdWRO2DWFC3VTA9v0fFbIo3e/vnY4ExT7MhdpdKyuQtaBx8u42Pqv9JLNfg5GmCSyYa9oLBWxsA7dqtQajZFtJ6oszhbFuGVEdudZyW91OV6fgwv36sOs8JJ+6ShdtO8t+sxaXanmY6g0SKFTASg7PWwy+MDlrwTIQxGV5nsbXGUWkx5IDBbA4RrnQJr/sTb0u/Rk1iWCMsL4Ub47WTK576d2UxDokzsINyQ48G7MlMN9ir9QrQ+7qBx+x47UZ5yVNOZ7c6jAc94WWXZNU8BMXCFHH4iybZYAD/AZMOhFsYf9qVsAoxiwCwaiC+zgyCNHiHDt0K0m0eksCx3K0BAuEt8MtnnfsdX7NL0VUeCw1KTG0CvMYOhM1jfm9IjIcw4uofeRVrx2dsrR00gvFwTZjl6NroHlJDeV1uMXs2ia6OpgSfiji2sjqwxqrTivw90jiojNho4P1l/E8iB5zZ8zKNalR0F1fcSqH4FMtyGGKYR2WMUiTnlotSs117EKp5G2cTYXxZknxxDRZPKJfpWU7h/9WuidPSt1iG95dL6hmRu8/lasx+/iW8Sw0FhHrzRJn9fRun0M0RHY98aJSvx4/ki72DaP0Rje5f1LIU8ukarXMZkhwqQ/lpYLvkTDHzP2mEXrjKCNbEkr5u+o6+Hhb777pZGcL5d5hh/iPqkqgMCyAuQ1PhIQU2SF5Oiwzr3u8ELhTLlUlPI6jrTVvZXEKsgHvKG0BhFZ3po+5xu6ATqpysoUkWUCIV1eZh6KjobkNlTTL/35A/eyhkqgnTRpyv3FO7DsA4nCIWbDnbrnYL1z8VRTyBApwtBa/59UCq8OIPb0WkLpsdzXFB45Mwitz+fpEtVxy5oSWWyPD6KWKq/SvliI5uUgI+mIeoAZoiryK/8g5/L2jH85n0ESfbWx0JcJdHy1Gu5qLkaZbHb2nNsND3oGshA+QeHlkFGCVCRcZ3e2X6Iy/DE7D4emAJ/YRoCph7yBxia7HppKZmxcD1CMFWzld4qBW/gWaSKSJtVtnSADVbikU4Mhzw2htBfmy7p7KerZ4jEXtZ3529hx/uHciBAy9SdoAMSAyGGNVHp5nngIRj8zxKBwu1ZxylaF0ahigvxXD8Zf5/1TUlRyCZmJxONzD5X+WxnKY8ySYFegWNSvRz8rHfwrxNpbWEt3Es6+jx3Flw6tGb4Si/TfH5gz6KPbwz70I+5yzn/H0O8qiFxwEZgHDnGvmqMqr1ubPIXOiUjMz//2J5RZ5zbE8SK49UTLpFtRCVciXqDMXHRZbUzT/4ygtxHyCoS2ALFiCTNvjMuLK69EcNrs1AwUS/LqOdCYaGW0yT7pWES4g4iUZY+vQF0zmSXQDE9ezlIW9HeCcBckX2Kv/j6YAztpGlbiJUjr9LsmpQ==
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.
- [cgal-discuss] PMP performance question, Giles Puckett, 01/22/2021
- Re: [cgal-discuss] PMP performance question, Sebastien Loriot, 01/27/2021
- Re: [cgal-discuss] PMP performance question, Giles Puckett, 01/27/2021
- Re: [cgal-discuss] PMP performance question, Tony Apicella, 01/29/2021
- Re: [cgal-discuss] PMP performance question, Sebastien Loriot, 01/27/2021
Archive powered by MHonArc 2.6.19+.