# 'TypeError' while using remesh from compas\_cgal

**URL:** <https://forum.compas-framework.org/t/typeerror-while-using-remesh-from-compas-cgal/414>\
**Category:** RhinoVAULT\
**Created:** [December 15, 2020, 9:33am UTC](https://forum.compas-framework.org/t/typeerror-while-using-remesh-from-compas-cgal/414 "2020-12-15T09:33:40Z")\
**Posts on this page:** 15\
**Page:** 1

<div class="post-metadata">

**Author:** ![Keerthana](https://avatars.discourse-cdn.com/v4/letter/k/9fc29f/32.png) [@Keerthana](https://forum.compas-framework.org/u/Keerthana)\
**Post date:** [December 15, 2020, 9:33am UTC](https://forum.compas-framework.org/t/typeerror-while-using-remesh-from-compas-cgal/414/1 "2020-12-15T09:33:40Z")

</div>

Hi There!

I ran the remesh example in RhinoVault\_2 gitbook documentation and I get a ‘TypeError’. Unsure how to solve this as I do not understand what it’s complaining about.

code here:  
[https://app.gitbook.com/@blockresearchgroup/s/rv2/examples-1/advanced-accessing-data/triangulate-+-remesh](https://app.gitbook.com/@blockresearchgroup/s/rv2/examples-1/advanced-accessing-data/triangulate-+-remesh)

Error  
TypeError: int() argument must be a string, a bytes-like object or a number, not ‘list’

```
The above exception was the direct cause of the following exception:

Traceback (most recent call last):
  File "C:\Users\ukeer\GitHub\CSD2\modules\week_9\discretization_voussoirs\02_remesh.py", line 20, in <module>
    V, F = remesh (mesh.to_vertices_and_faces(), length)
  File "C:\Users\ukeer\Anaconda3\envs\csdii\lib\site-packages\compas_cgal\meshing.py", line 41, in remesh
    F = np.asarray(F, dtype=np.int32)
  File "C:\Users\ukeer\Anaconda3\envs\csdii\lib\site-packages\numpy\core\_asarray.py", line 83, in asarray
    return array(a, dtype, copy=False, order=order)
ValueError: setting an array element with a sequence.

```

Set up details  
RV\_2 version: RhinoVault2\_v1.1.4  
Window PC

---

<div class="post-metadata">

**Author:** ![Keerthana](https://avatars.discourse-cdn.com/v4/letter/k/9fc29f/32.png) [@Keerthana](https://forum.compas-framework.org/u/Keerthana)\
**Post date:** [December 15, 2020, 3:33pm UTC](https://forum.compas-framework.org/t/typeerror-while-using-remesh-from-compas-cgal/414/2 "2020-12-15T15:33:04Z")

</div>

Further, I now updated my RV2 to the latest version, I cloned and ran the example on the ITA20 workshop- leacture08 the remesh.py script. It works with the given British museum rv2 session file.  
however, when I changed the the input file to another file (I used the armadillo.rv2 file) it fails again with the same error on running the remesh.py script.

I tried the alternate mathod using Proxy and running it from rhino. and I get the same error  
File “C:\Users\ukeer\Anaconda3\envs\ITA20\lib\site-packages\compas\rpc\dispatcher.py”, line 149, in \_call  
data = function(\*args, \*\*kwargs)  
File “C:\Users\ukeer\Anaconda3\envs\ITA20\lib\site-packages\compas\_cgal\meshing.py”, line 41, in remesh  
F = np.asarray(F, dtype=np.int32)  
File “C:\Users\ukeer\Anaconda3\envs\ITA20\lib\site-packages\numpy\core\_asarray.py”, line 83, in asarray  
return array(a, dtype, copy=False, order=order)  
ValueError: setting an array element with a sequence.

Could it be that the C++ build doesn’t match certain windows system’s binary file ?  
I asked a colleague to run this on his mac and he gets the same error.

I have no understanding of why this works for the given input rv2 session file and not for anyother 😨

Thanks for going through this long post.

---

<div class="post-metadata">

**Author:** ![tomvanmele](https://sea1.discourse-cdn.com/flex015/user_avatar/forum.compas-framework.org/tomvanmele/32/13_2.png) [@tomvanmele](https://forum.compas-framework.org/u/tomvanmele)\
**Post date:** [December 15, 2020, 7:26pm UTC](https://forum.compas-framework.org/t/typeerror-while-using-remesh-from-compas-cgal/414/4 "2020-12-15T19:26:20Z")

</div>

what do you mean with "i tried it on `armadillo.rv2`"? did you just replace `form.json` with `armadillo.rv2` or did you prerpocess the armadillo file to get the form out first and save to json like with the BM example?

---

<div class="post-metadata">

**Author:** ![Keerthana](https://avatars.discourse-cdn.com/v4/letter/k/9fc29f/32.png) [@Keerthana](https://forum.compas-framework.org/u/Keerthana)\
**Post date:** [December 15, 2020, 8:58pm UTC](https://forum.compas-framework.org/t/typeerror-while-using-remesh-from-compas-cgal/414/5 "2020-12-15T20:58:00Z")

</div>

Thanks for writing back 🙂  
Yes I processed the armadillo.rv2 file like in the examples 1) 00\_materialisation\_data.py to get form.json (2) 01\_materialisation\_triangulate.py (3) and then input the from\_trimesh.json to run the remesh script

---

<div class="post-metadata">

**Author:** ![Chaoyu\_DU](https://sea1.discourse-cdn.com/flex015/user_avatar/forum.compas-framework.org/chaoyu_du/32/235_2.png) [@Chaoyu\_DU](https://forum.compas-framework.org/u/Chaoyu_DU)\
**Post date:** [December 15, 2020, 9:30pm UTC](https://forum.compas-framework.org/t/typeerror-while-using-remesh-from-compas-cgal/414/6 "2020-12-15T21:30:22Z")

</div>

Hi Keer. Can you upload the .json file?

---

<div class="post-metadata">

**Author:** ![Keerthana](https://avatars.discourse-cdn.com/v4/letter/k/9fc29f/32.png) [@Keerthana](https://forum.compas-framework.org/u/Keerthana)\
**Post date:** [December 16, 2020, 12:28pm UTC](https://forum.compas-framework.org/t/typeerror-while-using-remesh-from-compas-cgal/414/7 "2020-12-16T12:28:37Z")

</div>

Hi Chaoyu  
you can find the .json file here

> **[KEERTHANAUDAY/temp\_fileshare\_repo](https://github.com/KEERTHANAUDAY/temp_fileshare_repo)**
>
> Contribute to KEERTHANAUDAY/temp\_fileshare\_repo development by creating an account on GitHub.

this is the input json file you will need to run  
02a\_materialisation\_remeshed.py from leture08 ITA20 workshop

thanks for having a look 🙂

---

<div class="post-metadata">

**Author:** ![Chaoyu\_DU](https://sea1.discourse-cdn.com/flex015/user_avatar/forum.compas-framework.org/chaoyu_du/32/235_2.png) [@Chaoyu\_DU](https://forum.compas-framework.org/u/Chaoyu_DU)\
**Post date:** [December 17, 2020, 9:32am UTC](https://forum.compas-framework.org/t/typeerror-while-using-remesh-from-compas-cgal/414/8 "2020-12-17T09:32:07Z")

</div>

![image](https://us1.discourse-cdn.com/flex015/uploads/compas_framework1/original/1X/3d4dc20357642c42cf39024303489cc2207870f0.png)  
Hi, Keer. Is this mesh correct? The openings all have an additional face.

---

<div class="post-metadata">

**Author:** ![tomvanmele](https://sea1.discourse-cdn.com/flex015/user_avatar/forum.compas-framework.org/tomvanmele/32/13_2.png) [@tomvanmele](https://forum.compas-framework.org/u/tomvanmele)\
**Post date:** [December 23, 2020, 7:44am UTC](https://forum.compas-framework.org/t/typeerror-while-using-remesh-from-compas-cgal/414/9 "2020-12-23T07:44:01Z")

</div>

yes, those are the unloaded faces. they are necessary for the construction of form and force diagrams…

---

<div class="post-metadata">

**Author:** ![Keerthana](https://avatars.discourse-cdn.com/v4/letter/k/9fc29f/32.png) [@Keerthana](https://forum.compas-framework.org/u/Keerthana)\
**Post date:** [January 11, 2021, 4:18pm UTC](https://forum.compas-framework.org/t/typeerror-while-using-remesh-from-compas-cgal/414/10 "2021-01-11T16:18:52Z")

</div>

On remeshing with compas\_cgal, some degenrated mesh faces are created.

 ![image](https://us1.discourse-cdn.com/flex015/uploads/compas_framework1/original/1X/bbe9b029d6b5dded46f26a51d45ba5210f9c1f35.png)

here is the link to the json files

1. rv2 session file - Mesh serialization: [https://github.com/BlockResearchGroup/CSD2/blob/master/modules/week\_9/discretization\_voussoirs/form.json](https://github.com/BlockResearchGroup/CSD2/blob/master/modules/week_9/discretization_voussoirs/form.json)
2. quad to trimesh serialization: [https://github.com/BlockResearchGroup/CSD2/blob/master/modules/week\_9/discretization\_voussoirs/form\_trimesh.json](https://github.com/BlockResearchGroup/CSD2/blob/master/modules/week_9/discretization_voussoirs/form_trimesh.json)
3. remeshing result with compas\_cgal: [https://github.com/BlockResearchGroup/CSD2/blob/master/modules/week\_9/discretization\_voussoirs/form\_remeshed.json](https://github.com/BlockResearchGroup/CSD2/blob/master/modules/week_9/discretization_voussoirs/form_remeshed.json)

scripts followed from the ITA20 lecture08

> **[compas-ITA20/ITA20](https://github.com/compas-ITA20/ITA20/tree/main/lecture_08)**
>
> main/lecture\_08

---

<div class="post-metadata">

**Author:** ![Keerthana](https://avatars.discourse-cdn.com/v4/letter/k/9fc29f/32.png) [@Keerthana](https://forum.compas-framework.org/u/Keerthana)\
**Post date:** [January 19, 2021, 11:20am UTC](https://forum.compas-framework.org/t/typeerror-while-using-remesh-from-compas-cgal/414/11 "2021-01-19T11:20:15Z")

</div>

This issue is solved. 😃

**Solution:**  
After deleting the unloaded faces, I used unify\_cycles and meshes\_join\_and\_weld.

 ![Capture](https://us1.discourse-cdn.com/flex015/uploads/compas_framework1/original/1X/04b40140c4e5c3ae552569128cd0e31ee8ec4f65.jpeg)

---

<div class="post-metadata">

**Author:** ![tomvanmele](https://sea1.discourse-cdn.com/flex015/user_avatar/forum.compas-framework.org/tomvanmele/32/13_2.png) [@tomvanmele](https://forum.compas-framework.org/u/tomvanmele)\
**Post date:** [January 20, 2021, 10:37am UTC](https://forum.compas-framework.org/t/typeerror-while-using-remesh-from-compas-cgal/414/12 "2021-01-20T10:37:07Z")

</div>

cool!

were both necessary?

---

<div class="post-metadata">

**Author:** ![Keerthana](https://avatars.discourse-cdn.com/v4/letter/k/9fc29f/32.png) [@Keerthana](https://forum.compas-framework.org/u/Keerthana)\
**Post date:** [January 24, 2021, 5:59pm UTC](https://forum.compas-framework.org/t/typeerror-while-using-remesh-from-compas-cgal/414/13 "2021-01-24T17:59:20Z")

</div>

so no, just meshes\_join\_and\_weld is enough. the unify\_cycles is not necessary.

---

<div class="post-metadata">

**Author:** ![PranjalK](https://sea1.discourse-cdn.com/flex015/user_avatar/forum.compas-framework.org/pranjalk/32/536_2.png) [@PranjalK](https://forum.compas-framework.org/u/PranjalK)\
**Post date:** [September 11, 2023, 5:58am UTC](https://forum.compas-framework.org/t/typeerror-while-using-remesh-from-compas-cgal/414/14 "2023-09-11T05:58:43Z")

</div>

Hey!  
I am struggling with a similar error, could you please help me resolve this error.

 ![RV2 Error](https://us1.discourse-cdn.com/flex015/uploads/compas_framework1/original/1X/6e4c41f2cc8f031d3276d74f70ca41a4c9b3f09d.jpeg)

---

<div class="post-metadata">

**Author:** ![tomvanmele](https://sea1.discourse-cdn.com/flex015/user_avatar/forum.compas-framework.org/tomvanmele/32/13_2.png) [@tomvanmele](https://forum.compas-framework.org/u/tomvanmele)\
**Post date:** [September 19, 2023, 10:14am UTC](https://forum.compas-framework.org/t/typeerror-while-using-remesh-from-compas-cgal/414/15 "2023-09-19T10:14:37Z")

</div>

hi,

would you mind posting this in a new thread, because i don’t think the errors are related…

thanks!

---

<div class="post-metadata">

**Author:** ![PranjalK](https://sea1.discourse-cdn.com/flex015/user_avatar/forum.compas-framework.org/pranjalk/32/536_2.png) [@PranjalK](https://forum.compas-framework.org/u/PranjalK)\
**Post date:** [September 22, 2023, 3:07am UTC](https://forum.compas-framework.org/t/typeerror-while-using-remesh-from-compas-cgal/414/16 "2023-09-22T03:07:05Z")

</div>

Hey!

Thank for replying. Could you tell me who could be the right person/ team to help me out?
