How to attach to mesh together under the same coorodinate?

classic Classic list List threaded Threaded
7 messages Options
Reply | Threaded
Open this post in threaded view
|

How to attach to mesh together under the same coorodinate?

Shrabani Ghosh
Hi,

I want to attach two mesh together so that they will be placed perfectly
under the same coordinates.

Like these are two meshes.
<http://cgal-discuss.949826.n4.nabble.com/file/t376134/28.png>
<http://cgal-discuss.949826.n4.nabble.com/file/t376134/29.png>

After they will be attached together, they should be looked like this.

<http://cgal-discuss.949826.n4.nabble.com/file/t376134/30.png>



--
Sent from: http://cgal-discuss.949826.n4.nabble.com/

--
You are currently subscribed to cgal-discuss.
To unsubscribe or access the archives, go to
https://sympa.inria.fr/sympa/info/cgal-discuss


Reply | Threaded
Open this post in threaded view
|

Re: How to attach to mesh together under the same coorodinate?

Sebastien Loriot (GeometryFactory)
 From your description it seems that you are interested in doing Boolean
operations on triangle meshes.

The Polygon Mesh Processing package provide such a functionality for
manifold objects:

https://doc.cgal.org/latest/Polygon_mesh_processing/index.html#title12

The more general Nef_3 package provides operations for general meshes:
https://doc.cgal.org/latest/Nef_3/index.html

Sebastien.

On 9/12/19 11:58 PM, Shrabani Ghosh wrote:

> Hi,
>
> I want to attach two mesh together so that they will be placed perfectly
> under the same coordinates.
>
> Like these are two meshes.
> <http://cgal-discuss.949826.n4.nabble.com/file/t376134/28.png>
> <http://cgal-discuss.949826.n4.nabble.com/file/t376134/29.png>
>
> After they will be attached together, they should be looked like this.
>
> <http://cgal-discuss.949826.n4.nabble.com/file/t376134/30.png>
>
>
>
> --
> Sent from: http://cgal-discuss.949826.n4.nabble.com/
>

--
You are currently subscribed to cgal-discuss.
To unsubscribe or access the archives, go to
https://sympa.inria.fr/sympa/info/cgal-discuss


Reply | Threaded
Open this post in threaded view
|

Re: How to attach to mesh together under the same coorodinate?

Shrabani Ghosh
Hi Sebastien,

I tried with Nef_3 polyhedron on your reference. I wanted to do the union operation. But after some time, I am seeing it showing "killed". what could be the reason for this. I am attaching the files here. Could you please look into it?

Regards
Shrabani Ghosh

On Fri, Sep 20, 2019 at 4:39 AM Sebastien Loriot (GeometryFactory) <[hidden email]> wrote:
 From your description it seems that you are interested in doing Boolean
operations on triangle meshes.

The Polygon Mesh Processing package provide such a functionality for
manifold objects:

https://doc.cgal.org/latest/Polygon_mesh_processing/index.html#title12

The more general Nef_3 package provides operations for general meshes:
https://doc.cgal.org/latest/Nef_3/index.html

Sebastien.

On 9/12/19 11:58 PM, Shrabani Ghosh wrote:
> Hi,
>
> I want to attach two mesh together so that they will be placed perfectly
> under the same coordinates.
>
> Like these are two meshes.
> <http://cgal-discuss.949826.n4.nabble.com/file/t376134/28.png>
> <http://cgal-discuss.949826.n4.nabble.com/file/t376134/29.png>
>
> After they will be attached together, they should be looked like this.
>
> <http://cgal-discuss.949826.n4.nabble.com/file/t376134/30.png>
>
>
>
> --
> Sent from: http://cgal-discuss.949826.n4.nabble.com/
>

--
You are currently subscribed to cgal-discuss.
To unsubscribe or access the archives, go to
https://sympa.inria.fr/sympa/info/cgal-discuss


Reply | Threaded
Open this post in threaded view
|

Re: How to attach to mesh together under the same coorodinate?

Sebastien Loriot (GeometryFactory)
I think you are not using the right tool for what you want to achieve.

Your 2 meshes are perfectly aligned on the same grid.
If you want to union them, simply sort all the points, assign them an id
and remove duplicated faces.

I think, this can be done directly with the polygon soup repairing tools
of Polygon mesh processing:

https://doc.cgal.org/latest/Polygon_mesh_processing/index.html#title40

Put you two meshes in the same soup, merge duplicate points, remove
isolated points and merge duplicate polygon.

Then a call to orient_polygon_soup will duplicate non-manifold edges.

Also you might want to have a look at the Mesh_3 package that is able
to mesh image with multiple domains.

Sebastien.

On 9/24/19 7:32 PM, Shrabani Ghosh wrote:

> Hi Sebastien,
>
> I tried with Nef_3 polyhedron on your reference. I wanted to do the
> union operation. But after some time, I am seeing it showing "killed".
> what could be the reason for this. I am attaching the files here. Could
> you please look into it?
> colored_bone_MMM.off
> <https://drive.google.com/file/d/1AMRGNIzMYGqwPlFn3jCbDr4nJ3fhDl7a/view?usp=drive_web>
> colored_hole_MMM.off
> <https://drive.google.com/file/d/1bnqgJ-cPpZnaup0bQPxC3V6D0UW8QK_S/view?usp=drive_web>
>
> Regards
> Shrabani Ghosh
>
> On Fri, Sep 20, 2019 at 4:39 AM Sebastien Loriot (GeometryFactory)
> <[hidden email] <mailto:[hidden email]>> wrote:
>
>       From your description it seems that you are interested in doing
>     Boolean
>     operations on triangle meshes.
>
>     The Polygon Mesh Processing package provide such a functionality for
>     manifold objects:
>
>     https://doc.cgal.org/latest/Polygon_mesh_processing/index.html#title12
>
>     The more general Nef_3 package provides operations for general meshes:
>     https://doc.cgal.org/latest/Nef_3/index.html
>
>     Sebastien.
>
>     On 9/12/19 11:58 PM, Shrabani Ghosh wrote:
>      > Hi,
>      >
>      > I want to attach two mesh together so that they will be placed
>     perfectly
>      > under the same coordinates.
>      >
>      > Like these are two meshes.
>      > <http://cgal-discuss.949826.n4.nabble.com/file/t376134/28.png>
>      > <http://cgal-discuss.949826.n4.nabble.com/file/t376134/29.png>
>      >
>      > After they will be attached together, they should be looked like
>     this.
>      >
>      > <http://cgal-discuss.949826.n4.nabble.com/file/t376134/30.png>
>      >
>      >
>      >
>      > --
>      > Sent from: http://cgal-discuss.949826.n4.nabble.com/
>      >
>
>     --
>     You are currently subscribed to cgal-discuss.
>     To unsubscribe or access the archives, go to
>     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


Reply | Threaded
Open this post in threaded view
|

Re: How to attach to mesh together under the same coorodinate?

Shrabani Ghosh
Hi,
Thank you for your response.  I want to know if it's gonna merge duplicate points and merge duplicate polygons what property_map information will exist for the merged duplicate points? 
Let's say, for one model property_map name is "bone" for vertices and for another "hole" for vertices. So what will be the property_map value for the merged vertices? 

And how can I keep both meshes in the same soup? Just one after another? Like this?


Polyhedron mesh2;


Thanks
Shrabani Ghosh

On Wed, Sep 25, 2019 at 1:01 AM Sebastien Loriot (GeometryFactory) <[hidden email]> wrote:
I think you are not using the right tool for what you want to achieve.

Your 2 meshes are perfectly aligned on the same grid.
If you want to union them, simply sort all the points, assign them an id
and remove duplicated faces.

I think, this can be done directly with the polygon soup repairing tools
of Polygon mesh processing:

https://doc.cgal.org/latest/Polygon_mesh_processing/index.html#title40

Put you two meshes in the same soup, merge duplicate points, remove
isolated points and merge duplicate polygon.

Then a call to orient_polygon_soup will duplicate non-manifold edges.

Also you might want to have a look at the Mesh_3 package that is able
to mesh image with multiple domains.

Sebastien.

On 9/24/19 7:32 PM, Shrabani Ghosh wrote:
> Hi Sebastien,
>
> I tried with Nef_3 polyhedron on your reference. I wanted to do the
> union operation. But after some time, I am seeing it showing "killed".
> what could be the reason for this. I am attaching the files here. Could
> you please look into it?
> colored_bone_MMM.off
> <https://drive.google.com/file/d/1AMRGNIzMYGqwPlFn3jCbDr4nJ3fhDl7a/view?usp=drive_web>
> colored_hole_MMM.off
> <https://drive.google.com/file/d/1bnqgJ-cPpZnaup0bQPxC3V6D0UW8QK_S/view?usp=drive_web>
>
> Regards
> Shrabani Ghosh
>
> On Fri, Sep 20, 2019 at 4:39 AM Sebastien Loriot (GeometryFactory)
> <[hidden email] <mailto:[hidden email]>> wrote:
>
>       From your description it seems that you are interested in doing
>     Boolean
>     operations on triangle meshes.
>
>     The Polygon Mesh Processing package provide such a functionality for
>     manifold objects:
>
>     https://doc.cgal.org/latest/Polygon_mesh_processing/index.html#title12
>
>     The more general Nef_3 package provides operations for general meshes:
>     https://doc.cgal.org/latest/Nef_3/index.html
>
>     Sebastien.
>
>     On 9/12/19 11:58 PM, Shrabani Ghosh wrote:
>      > Hi,
>      >
>      > I want to attach two mesh together so that they will be placed
>     perfectly
>      > under the same coordinates.
>      >
>      > Like these are two meshes.
>      > <http://cgal-discuss.949826.n4.nabble.com/file/t376134/28.png>
>      > <http://cgal-discuss.949826.n4.nabble.com/file/t376134/29.png>
>      >
>      > After they will be attached together, they should be looked like
>     this.
>      >
>      > <http://cgal-discuss.949826.n4.nabble.com/file/t376134/30.png>
>      >
>      >
>      >
>      > --
>      > Sent from: http://cgal-discuss.949826.n4.nabble.com/
>      >
>
>     --
>     You are currently subscribed to cgal-discuss.
>     To unsubscribe or access the archives, go to
>     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


Reply | Threaded
Open this post in threaded view
|

Re: How to attach to mesh together under the same coorodinate?

Sebastien Loriot (GeometryFactory)
You should do the merge step by hand if you have properties that need to
be preserved because it is not handled by the CGAL function. You can of
course look at the code and reuse internal functions or code that
might be useful.

Sebastien.

On 9/25/19 7:34 AM, Shrabani Ghosh wrote:

> Hi,
> Thank you for your response.  I want to know if it's gonna merge
> duplicate points and merge duplicate polygons what property_map
> information will exist for the merged duplicate points?
> Let's say, for one model property_map name is "bone" for vertices and
> for another "hole" for vertices. So what will be the property_map value
> for the merged vertices?
>
> And how can I keep both meshes in the same soup? Just one after another?
> Like this?
>
> CGAL::Polygon_mesh_processing::orient_polygon_soup
> <https://doc.cgal.org/latest/Polygon_mesh_processing/group__PMP__orientation__grp.html#gaadc5bac3072b11d2313e40043c729d0a>(points1,
> polygons1);
> Polyhedron mesh1;
> CGAL::Polygon_mesh_processing::polygon_soup_to_polygon_mesh
> <https://doc.cgal.org/latest/Polygon_mesh_processing/group__PMP__repairing__grp.html#gac8fe80db9800265922ce469c36d97baa>(points1,
> polygons1, mesh1);
>
> CGAL::Polygon_mesh_processing::orient_polygon_soup
> <https://doc.cgal.org/latest/Polygon_mesh_processing/group__PMP__orientation__grp.html#gaadc5bac3072b11d2313e40043c729d0a>(points,
> polygons2);
> Polyhedron mesh2;
> CGAL::Polygon_mesh_processing::polygon_soup_to_polygon_mesh
> <https://doc.cgal.org/latest/Polygon_mesh_processing/group__PMP__repairing__grp.html#gac8fe80db9800265922ce469c36d97baa>(points2,
> polygons2, mesh2);
>
>
> Thanks
> Shrabani Ghosh
>
> On Wed, Sep 25, 2019 at 1:01 AM Sebastien Loriot (GeometryFactory)
> <[hidden email] <mailto:[hidden email]>> wrote:
>
>     I think you are not using the right tool for what you want to achieve.
>
>     Your 2 meshes are perfectly aligned on the same grid.
>     If you want to union them, simply sort all the points, assign them an id
>     and remove duplicated faces.
>
>     I think, this can be done directly with the polygon soup repairing tools
>     of Polygon mesh processing:
>
>     https://doc.cgal.org/latest/Polygon_mesh_processing/index.html#title40
>
>     Put you two meshes in the same soup, merge duplicate points, remove
>     isolated points and merge duplicate polygon.
>
>     Then a call to orient_polygon_soup will duplicate non-manifold edges.
>
>     Also you might want to have a look at the Mesh_3 package that is able
>     to mesh image with multiple domains.
>
>     Sebastien.
>
>     On 9/24/19 7:32 PM, Shrabani Ghosh wrote:
>      > Hi Sebastien,
>      >
>      > I tried with Nef_3 polyhedron on your reference. I wanted to do the
>      > union operation. But after some time, I am seeing it showing
>     "killed".
>      > what could be the reason for this. I am attaching the files here.
>     Could
>      > you please look into it?
>      > colored_bone_MMM.off
>      >
>     <https://drive.google.com/file/d/1AMRGNIzMYGqwPlFn3jCbDr4nJ3fhDl7a/view?usp=drive_web>
>      > colored_hole_MMM.off
>      >
>     <https://drive.google.com/file/d/1bnqgJ-cPpZnaup0bQPxC3V6D0UW8QK_S/view?usp=drive_web>
>      >
>      > Regards
>      > Shrabani Ghosh
>      >
>      > On Fri, Sep 20, 2019 at 4:39 AM Sebastien Loriot (GeometryFactory)
>      > <[hidden email] <mailto:[hidden email]>
>     <mailto:[hidden email] <mailto:[hidden email]>>> wrote:
>      >
>      >       From your description it seems that you are interested in doing
>      >     Boolean
>      >     operations on triangle meshes.
>      >
>      >     The Polygon Mesh Processing package provide such a
>     functionality for
>      >     manifold objects:
>      >
>      >
>     https://doc.cgal.org/latest/Polygon_mesh_processing/index.html#title12
>      >
>      >     The more general Nef_3 package provides operations for
>     general meshes:
>      > https://doc.cgal.org/latest/Nef_3/index.html
>      >
>      >     Sebastien.
>      >
>      >     On 9/12/19 11:58 PM, Shrabani Ghosh wrote:
>      >      > Hi,
>      >      >
>      >      > I want to attach two mesh together so that they will be placed
>      >     perfectly
>      >      > under the same coordinates.
>      >      >
>      >      > Like these are two meshes.
>      >      > <http://cgal-discuss.949826.n4.nabble.com/file/t376134/28.png>
>      >      > <http://cgal-discuss.949826.n4.nabble.com/file/t376134/29.png>
>      >      >
>      >      > After they will be attached together, they should be
>     looked like
>      >     this.
>      >      >
>      >      > <http://cgal-discuss.949826.n4.nabble.com/file/t376134/30.png>
>      >      >
>      >      >
>      >      >
>      >      > --
>      >      > Sent from: http://cgal-discuss.949826.n4.nabble.com/
>      >      >
>      >
>      >     --
>      >     You are currently subscribed to cgal-discuss.
>      >     To unsubscribe or access the archives, go to
>      > 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
>
>

--
You are currently subscribed to cgal-discuss.
To unsubscribe or access the archives, go to
https://sympa.inria.fr/sympa/info/cgal-discuss


Reply | Threaded
Open this post in threaded view
|

Re: How to attach to mesh together under the same coorodinate?

Shrabani Ghosh
Hi,

If I don't consider the property_map values, for now, I followed your instruction by using polygon soup repairing tools. But I got a very unusual output. I am attaching my output and source code here. Could you please suggest me how to fix this?


On Wed, Sep 25, 2019 at 1:44 AM Sebastien Loriot (GeometryFactory) <[hidden email]> wrote:
You should do the merge step by hand if you have properties that need to
be preserved because it is not handled by the CGAL function. You can of
course look at the code and reuse internal functions or code that
might be useful.

Sebastien.

On 9/25/19 7:34 AM, Shrabani Ghosh wrote:
> Hi,
> Thank you for your response.  I want to know if it's gonna merge
> duplicate points and merge duplicate polygons what property_map
> information will exist for the merged duplicate points?
> Let's say, for one model property_map name is "bone" for vertices and
> for another "hole" for vertices. So what will be the property_map value
> for the merged vertices?
>
> And how can I keep both meshes in the same soup? Just one after another?
> Like this?
>
> CGAL::Polygon_mesh_processing::orient_polygon_soup
> <https://doc.cgal.org/latest/Polygon_mesh_processing/group__PMP__orientation__grp.html#gaadc5bac3072b11d2313e40043c729d0a>(points1,
> polygons1);
> Polyhedron mesh1;
> CGAL::Polygon_mesh_processing::polygon_soup_to_polygon_mesh
> <https://doc.cgal.org/latest/Polygon_mesh_processing/group__PMP__repairing__grp.html#gac8fe80db9800265922ce469c36d97baa>(points1,
> polygons1, mesh1);
>
> CGAL::Polygon_mesh_processing::orient_polygon_soup
> <https://doc.cgal.org/latest/Polygon_mesh_processing/group__PMP__orientation__grp.html#gaadc5bac3072b11d2313e40043c729d0a>(points,
> polygons2);
> Polyhedron mesh2;
> CGAL::Polygon_mesh_processing::polygon_soup_to_polygon_mesh
> <https://doc.cgal.org/latest/Polygon_mesh_processing/group__PMP__repairing__grp.html#gac8fe80db9800265922ce469c36d97baa>(points2,
> polygons2, mesh2);
>
>
> Thanks
> Shrabani Ghosh
>
> On Wed, Sep 25, 2019 at 1:01 AM Sebastien Loriot (GeometryFactory)
> <[hidden email] <mailto:[hidden email]>> wrote:
>
>     I think you are not using the right tool for what you want to achieve.
>
>     Your 2 meshes are perfectly aligned on the same grid.
>     If you want to union them, simply sort all the points, assign them an id
>     and remove duplicated faces.
>
>     I think, this can be done directly with the polygon soup repairing tools
>     of Polygon mesh processing:
>
>     https://doc.cgal.org/latest/Polygon_mesh_processing/index.html#title40
>
>     Put you two meshes in the same soup, merge duplicate points, remove
>     isolated points and merge duplicate polygon.
>
>     Then a call to orient_polygon_soup will duplicate non-manifold edges.
>
>     Also you might want to have a look at the Mesh_3 package that is able
>     to mesh image with multiple domains.
>
>     Sebastien.
>
>     On 9/24/19 7:32 PM, Shrabani Ghosh wrote:
>      > Hi Sebastien,
>      >
>      > I tried with Nef_3 polyhedron on your reference. I wanted to do the
>      > union operation. But after some time, I am seeing it showing
>     "killed".
>      > what could be the reason for this. I am attaching the files here.
>     Could
>      > you please look into it?
>      > colored_bone_MMM.off
>      >
>     <https://drive.google.com/file/d/1AMRGNIzMYGqwPlFn3jCbDr4nJ3fhDl7a/view?usp=drive_web>
>      > colored_hole_MMM.off
>      >
>     <https://drive.google.com/file/d/1bnqgJ-cPpZnaup0bQPxC3V6D0UW8QK_S/view?usp=drive_web>
>      >
>      > Regards
>      > Shrabani Ghosh
>      >
>      > On Fri, Sep 20, 2019 at 4:39 AM Sebastien Loriot (GeometryFactory)
>      > <[hidden email] <mailto:[hidden email]>
>     <mailto:[hidden email] <mailto:[hidden email]>>> wrote:
>      >
>      >       From your description it seems that you are interested in doing
>      >     Boolean
>      >     operations on triangle meshes.
>      >
>      >     The Polygon Mesh Processing package provide such a
>     functionality for
>      >     manifold objects:
>      >
>      >
>     https://doc.cgal.org/latest/Polygon_mesh_processing/index.html#title12
>      >
>      >     The more general Nef_3 package provides operations for
>     general meshes:
>      > https://doc.cgal.org/latest/Nef_3/index.html
>      >
>      >     Sebastien.
>      >
>      >     On 9/12/19 11:58 PM, Shrabani Ghosh wrote:
>      >      > Hi,
>      >      >
>      >      > I want to attach two mesh together so that they will be placed
>      >     perfectly
>      >      > under the same coordinates.
>      >      >
>      >      > Like these are two meshes.
>      >      > <http://cgal-discuss.949826.n4.nabble.com/file/t376134/28.png>
>      >      > <http://cgal-discuss.949826.n4.nabble.com/file/t376134/29.png>
>      >      >
>      >      > After they will be attached together, they should be
>     looked like
>      >     this.
>      >      >
>      >      > <http://cgal-discuss.949826.n4.nabble.com/file/t376134/30.png>
>      >      >
>      >      >
>      >      >
>      >      > --
>      >      > Sent from: http://cgal-discuss.949826.n4.nabble.com/
>      >      >
>      >
>      >     --
>      >     You are currently subscribed to cgal-discuss.
>      >     To unsubscribe or access the archives, go to
>      > 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
>
>

--
You are currently subscribed to cgal-discuss.
To unsubscribe or access the archives, go to
https://sympa.inria.fr/sympa/info/cgal-discuss