# CGLAB computational geometry toolbox for Scilab 2025.0.0

**URL:** <https://scilab.discourse.group/t/cglab-computational-geometry-toolbox-for-scilab-2025-0-0/788>\
**Category:** Atoms packages\
**Created:** [January 15, 2025, 3:30pm UTC](https://scilab.discourse.group/t/cglab-computational-geometry-toolbox-for-scilab-2025-0-0/788 "2025-01-15T15:30:12Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![mottelet](https://yyz2.discourse-cdn.com/free1/user_avatar/scilab.discourse.group/mottelet/32/13_2.png) [@mottelet](https://scilab.discourse.group/u/mottelet)\
**Post date:** [January 15, 2025, 3:30pm UTC](https://scilab.discourse.group/t/cglab-computational-geometry-toolbox-for-scilab-2025-0-0/788/1 "2025-01-15T15:30:12Z")

</div>

Hello,

The CGLAB toolbox has been updated and rebuilt for Scilab 2025.0.0. This toolbox makes available in Scilab a small (yet interesting) subset of the features of CGAL (Computational Geometry Algorithms Library, [https://cgal.org](https://cgal.org)), namely

- Delaunay 2D and 3D triangulation/tesselation
- Delaunay 2D meshing with refinement
- Surface mesh from 3D volumic data
- …

To install the toolbox, as usual, just update the package list before calling atomsInstall:

```auto
atomsSystemUpdate
atomsInstall cglab
atomsLoad cglab // or restart Scilab

```

Here is a small example of Delaunay 2D mesh with refinement:

```auto
N = 50;
t1 = linspace(0,2*%pi,2*N)';
C1 = [cos(t1(1:$-1)) sin(t1(1:$-1)) cos(t1(2:$)) sin(t1(2:$))];
C1($) = 0;
C2 = 0.5*[-1 -1 1 -1
        1 -1 1 1
        1 1 -1 1
        -1 1 -1 -1]
[coord,tri,ptr] = mesh_2([C1;C2]);
mesh2_set_seeds(ptr,0,0);
mesh2_refine(ptr,0.1,t1(2)-t1(1));
tri = mesh2_get_connectivity(ptr);
coord = mesh2_get_coord(ptr);
clf();
xx = matrix(coord(tri,1),-1,3)';
yy = matrix(coord(tri,2),-1,3)';
gca().data_bounds=[-1 1 -1 1];
gca().axes_visible="on"
isoview
xfpolys(xx,yy);
mesh2_delete(ptr,"ptr");

```

![mesh](https://global.discourse-cdn.com/free1/uploads/utc/original/1X/15934e6a8f6c0058fd7c4c87a80d180402c4e9d8.svg)

Enjoy !

S.

---

<div class="post-metadata">

**Author:** ![vvanag](https://avatars.discourse-cdn.com/v4/letter/v/6a8cbe/32.png) [@vvanag](https://scilab.discourse.group/u/vvanag)\
**Post date:** [January 19, 2025, 9:35am UTC](https://scilab.discourse.group/t/cglab-computational-geometry-toolbox-for-scilab-2025-0-0/788/2 "2025-01-19T09:35:23Z")

</div>

How do you handle CGAL external dependency? I am interesting in writing an extension for DuckDB. I would like to know how linked libraries are handled. Static or Dynamic.

---

<div class="post-metadata">

**Author:** ![mottelet](https://yyz2.discourse-cdn.com/free1/user_avatar/scilab.discourse.group/mottelet/32/13_2.png) [@mottelet](https://scilab.discourse.group/u/mottelet)\
**Post date:** [January 20, 2025, 11:05am UTC](https://scilab.discourse.group/t/cglab-computational-geometry-toolbox-for-scilab-2025-0-0/788/3 "2025-01-20T11:05:49Z")

</div>

Hello,

We provide builds of CGAL for each platform in the toolbox bundle.

You can start by reading the following (legacy but still valid) wiki : [howto/Create a toolbox](https://scilab.gitlab.io/legacy_wiki/howto(2f)Create(20)a(20)toolbox.html)

You can also consider building yourself some toolboxes which include compiled gateways interfacing thirdparty libraries (sci\_ipopt, cgal, IPCV, …).

S.
