# attaching 2 poly data

**URL:** https://discourse.vtk.org/t/attaching-2-poly-data/13847
**Category:** Support
**Created:** [May 6, 2024, 12:23pm UTC](https://discourse.vtk.org/t/attaching-2-poly-data/13847 "2024-05-06T12:23:44Z")
**Posts on this page:** 11
**Page:** 1

<div class="post-metadata">

### Author: ![sabaya](https://discourse.vtk.org/letter_avatar_proxy/v4/letter/s/f0a364/32.png) [@sabaya](https://discourse.vtk.org/u/sabaya)
#### Post date: [May 6, 2024, 12:23pm UTC](https://discourse.vtk.org/t/attaching-2-poly-data/13847/1 "2024-05-06T12:23:44Z")

</div>

hey there.  
where these two shapes are attached, I want to smooth the border of their intersection in a way that the sharp distinction between them fades or gets qualified, meaning the sharp distinction between two objects gets smoother, as if we fill the space so that the resulting U shape is more gradual compared to this.

 ![Show PointCloud 5_6_2024 3_34_04 PM](https://discourse.vtk.org/uploads/default/original/2X/b/b3426e2f5899f6482df4ab3467a124962cf96549.jpeg)

I would truly appreciate your help with this.

---

<div class="post-metadata">

### Author: ![mwestphal](https://discourse.vtk.org/user_avatar/discourse.vtk.org/mwestphal/32/19_2.png) [@mwestphal](https://discourse.vtk.org/u/mwestphal)
#### Post date: [May 6, 2024, 12:28pm UTC](https://discourse.vtk.org/t/attaching-2-poly-data/13847/2 "2024-05-06T12:28:33Z")

</div>

@Charles_Gueunet

---

<div class="post-metadata">

### Author: ![sabaya](https://discourse.vtk.org/letter_avatar_proxy/v4/letter/s/f0a364/32.png) [@sabaya](https://discourse.vtk.org/u/sabaya)
#### Post date: [May 13, 2024, 8:20am UTC](https://discourse.vtk.org/t/attaching-2-poly-data/13847/3 "2024-05-13T08:20:14Z")

</div>

hey there. no ones could suggest me any idea or solution for this problem?

---

<div class="post-metadata">

### Author: ![cory.quammen](https://discourse.vtk.org/user_avatar/discourse.vtk.org/cory.quammen/32/6751_2.png) [@cory.quammen](https://discourse.vtk.org/u/cory.quammen)
#### Post date: [May 13, 2024, 11:17am UTC](https://discourse.vtk.org/t/attaching-2-poly-data/13847/4 "2024-05-13T11:17:03Z")

</div>

To be fair, ParaView isn’t really a mesh editing tool. Perhaps software like [MeshLab](https://www.meshlab.net/) or [Blender](https://www.blender.org/) may be useful.

---

<div class="post-metadata">

### Author: ![sabaya](https://discourse.vtk.org/letter_avatar_proxy/v4/letter/s/f0a364/32.png) [@sabaya](https://discourse.vtk.org/u/sabaya)
#### Post date: [May 18, 2024, 9:36am UTC](https://discourse.vtk.org/t/attaching-2-poly-data/13847/5 "2024-05-18T09:36:32Z")

</div>

I appreciate your suggestions, however I need to implement a solution based on the vespa deformation. I was wondering if anybody could give me any clues on how to acheive such performance through the vespa deformation.

---

<div class="post-metadata">

### Author: ![Charles\_Gueunet](https://discourse.vtk.org/user_avatar/discourse.vtk.org/charles_gueunet/32/239_2.png) [@Charles\_Gueunet](https://discourse.vtk.org/u/Charles_Gueunet)
#### Post date: [May 21, 2024, 1:45pm UTC](https://discourse.vtk.org/t/attaching-2-poly-data/13847/6 "2024-05-21T13:45:31Z")

</div>

Hello @sabaya

I have a solution to propose, but you will certainly have to update it to your needs.  
Here is an example where I merged two triangulated surface with Vespa, and selected the “intersecting” area:

 ![image](https://discourse.vtk.org/uploads/default/original/2X/f/f6ff9886b24d9090523d5bfccd8db8d14482d62c.jpeg)

I have a cone with a scalar field set to value 1, and a cube with a scalar field set to 0, both triangulated.  
Then, I use the Vespa boolean operation, with the interpolate attribute set to ON to get a single mesh from both. This mesh has points with the value 0 on the cube, and 1 on the cone.  
In oder to select the interface, we use a trick here.  
First, let’s subdivide our mesh, so we introduce new points with values between 0 and 1 around the interface.  
Then, using the find data interface (cf 1 in the screenshot), select points with a scalar value between 0.1 and 0.9.  
In order to include points from both the cone and the cube, I playes with the selection by extending it (+, cf 2 in the screenshot)  
Finally, Freeze the selection and use the VESPA Region Fairing to smooth only this part.

Unfortunately, due to an issue with Eigen on my side I cannot show you this last part.

---

<div class="post-metadata">

### Author: ![sabaya](https://discourse.vtk.org/letter_avatar_proxy/v4/letter/s/f0a364/32.png) [@sabaya](https://discourse.vtk.org/u/sabaya)
#### Post date: [May 27, 2024, 5:41am UTC](https://discourse.vtk.org/t/attaching-2-poly-data/13847/7 "2024-05-27T05:41:42Z")

</div>

Thank you for the great suggestion, I will try to implement it and inform you of the result sir.

---

<div class="post-metadata">

### Author: ![sabaya](https://discourse.vtk.org/letter_avatar_proxy/v4/letter/s/f0a364/32.png) [@sabaya](https://discourse.vtk.org/u/sabaya)
#### Post date: [June 16, 2024, 10:47am UTC](https://discourse.vtk.org/t/attaching-2-poly-data/13847/8 "2024-06-16T10:47:13Z")

</div>

dear sir. I hava another question about “boolean”.  
I am using the vtklinearextrusionfilter on my instances of data, after which I need to implement a boolean operation ( either through vtkbool or vespa), but I keep getting errors when using the result of vtklinearextrusionfilter in boolean operations. I was wondering there is any post processing method on the result of vtklinearextrusionfilter possible so that it can be further used in boolean operations without causing errors.

---

<div class="post-metadata">

### Author: ![Charles\_Gueunet](https://discourse.vtk.org/user_avatar/discourse.vtk.org/charles_gueunet/32/239_2.png) [@Charles\_Gueunet](https://discourse.vtk.org/u/Charles_Gueunet)
#### Post date: [June 17, 2024, 6:51am UTC](https://discourse.vtk.org/t/attaching-2-poly-data/13847/9 "2024-06-17T06:51:56Z")

</div>

Hello @sabaya ,

Could you please provide more insights about what those errors are ?  
The linear extrusion filter may disconnect every cells (you can check with a connectivity filter) which would result in a mesh non suitable for boolean operations. If this linear extrusion is mandatory, you need to build a watertight surface around your resulting mesh, the Alpha Wrapping in Vespa may helps you in this regard.

Best,

---

<div class="post-metadata">

### Author: ![sabaya](https://discourse.vtk.org/letter_avatar_proxy/v4/letter/s/f0a364/32.png) [@sabaya](https://discourse.vtk.org/u/sabaya)
#### Post date: [June 18, 2024, 6:16am UTC](https://discourse.vtk.org/t/attaching-2-poly-data/13847/10 "2024-06-18T06:16:29Z")

</div>

Hi there.  
I tried two cases. First I tried to extrude one of my polydatas and then implement the boolean operation on one original data and the extruded data,  
where I received these errors from VTKBool and vespa boolean.

VTKBool :  
 ![Capture](https://discourse.vtk.org/uploads/default/original/2X/8/8a157d59cdc191cf034ef50929363863796d5658.png)

vespa boolean:

 ![Capture2](https://discourse.vtk.org/uploads/default/original/2X/7/79a95b96a4f8d918828a6e58c856441656e5ce28.png)

* * *

In the second case, using vtkclippolydata, I divided the polydata into two parts, and then extended them by scales of  
10 and 20, respectively. Next, I decided to use the union operation instead of the vtkAppendPolyData, where I received these errors:

VTKBool:  
 ![Capture3](https://discourse.vtk.org/uploads/default/original/2X/4/44b35e80fcd893272aac47f384fee096195d243b.png)

Vespa boolean:

 ![image](https://discourse.vtk.org/uploads/default/original/2X/7/7ace197bc2d4bf573c9e309f2a4997f87f0d3d38.png)  
they are attached by their sides though ☹

---

<div class="post-metadata">

### Author: ![sabaya](https://discourse.vtk.org/letter_avatar_proxy/v4/letter/s/f0a364/32.png) [@sabaya](https://discourse.vtk.org/u/sabaya)
#### Post date: [June 18, 2024, 7:25am UTC](https://discourse.vtk.org/t/attaching-2-poly-data/13847/11 "2024-06-18T07:25:45Z")

</div>

your proposed AlphaWrapping solution seems to work fine for the first case. thank youu.  
but it takes too much time.
