diff -Naur _ngi-3b/Makefile _ngi-3c/Makefile
--- _ngi-3b/Makefile	2026-02-22 15:54:32.163710664 +0100
+++ _ngi-3c/Makefile	2026-02-23 12:29:12.144072517 +0100
@@ -1,4 +1,13 @@
+ngi:
+	$(MAKE) -C _ngi/
+ntrf:
+	$(MAKE) -C _ntrf/
+test:
+	$(MAKE) -C _test/
+ntiv:
+	$(MAKE) -C _ntiv/
 clean:
 	$(MAKE) -C _ngi/ clean
 	$(MAKE) -C _ntrf/ clean
 	$(MAKE) -C _test/ clean
+	$(MAKE) -C _ntiv/ clean
diff -Naur _ngi-3b/_ngi/pool.c _ngi-3c/_ngi/pool.c
--- _ngi-3b/_ngi/pool.c	2026-02-22 15:54:32.302710659 +0100
+++ _ngi-3c/_ngi/pool.c	2026-02-23 12:29:12.291072513 +0100
@@ -2,6 +2,7 @@
 #include <stdio.h>
 #define POOL_NUM 253
 int _stride[120*80];
+int _strade[120*80];
 int _pool_a[253];
 int _pool_0[253*3];
 int _n = 0;
@@ -19,6 +20,10 @@
 { _stride[d] = c;
 }
 void
+fill_pool_l(int c, int d)
+{ _strade[d] = c;
+}
+void
 default_c3(int *c)
 { _pool_0[0]   = c[0];
   _pool_0[0+1] = c[1];
@@ -45,6 +50,14 @@
   { _pool_a[d] = 0; }
 }
 void
+min_pool_a(int d)
+{ _pool_a[d] = 1;
+}
+void
+add_pool_a(int d)
+{ _pool_a[d] = 0;
+}
+void
 fill_stride()
 { int d;
   for (d=0;d<(120*80);d++)
@@ -78,6 +91,18 @@
   }
 }
 void
+fill_pool_m(int *p, int n, int c)
+{ int d;
+  for (d=0;d<n;d++)
+  { int a, b;
+    int n0;
+    a = p[(d*2)];
+    b = p[(d*2)+1];
+    int d = _ab(a, b);
+    fill_pool_l(c, d);
+  }
+}
+void
 dump_pool()
 { int d;
   printf("P3\n");
diff -Naur _ngi-3b/_ngi/pool.h _ngi-3c/_ngi/pool.h
--- _ngi-3b/_ngi/pool.h	2026-02-22 15:54:32.291710660 +0100
+++ _ngi-3c/_ngi/pool.h	2026-02-23 12:29:12.283072513 +0100
@@ -9,12 +9,18 @@
 fill_pool_n(int *p, int n, int c);
 
 void
+fill_pool_m(int *p, int n, int c);
+
+void
 fill_pool_0();
 
 void
 fill_pool_d(int c, int d);
 
 void
+fill_pool_l(int c, int d);
+
+void
 default_c3(int *c);
 
 void
@@ -30,6 +36,12 @@
 fill_pool_a();
 
 void
+min_pool_a(int d);
+
+void
+add_pool_a(int d);
+
+void
 fill_stride();
 
 int
diff -Naur _ngi-3b/_ntiv/.gil/Makefile.0 _ngi-3c/_ntiv/.gil/Makefile.0
--- _ngi-3b/_ntiv/.gil/Makefile.0	1970-01-01 01:00:00.000000000 +0100
+++ _ngi-3c/_ntiv/.gil/Makefile.0	2026-02-23 12:29:12.731072499 +0100
@@ -0,0 +1,13 @@
+all: ngi3.cma
+#ngi3.mli: ngi3.ml
+#	ocamlc -i -I ../_ntrf/ $< > $@
+ngi3.cmi: ngi3.mli
+	ocamlc -c -I ../_ntrf/ ngi2.cma $<
+ngi3.cmo: ngi3.ml ngi3.cmi
+	ocamlc -c -I ../_ntrf/ ngi2.cma $<
+ngi3.cma: ngi3.cmo
+	ocamlc -a -o $@ -I ../_ntrf/ ngi2.cma $<
+clean:
+	$(RM) ngi3.cma
+	$(RM) ngi3.cmi
+	$(RM) ngi3.cmo
diff -Naur _ngi-3b/_ntiv/.gil/Makefile.1 _ngi-3c/_ntiv/.gil/Makefile.1
--- _ngi-3b/_ntiv/.gil/Makefile.1	1970-01-01 01:00:00.000000000 +0100
+++ _ngi-3c/_ntiv/.gil/Makefile.1	2026-02-23 12:29:12.785072497 +0100
@@ -0,0 +1,17 @@
+all: ngi3.cma
+pbm: test5.pbm
+#ngi3.mli: ngi3.ml
+#	ocamlc -i -I ../_ntrf/ $< > $@
+ngi3.cmi: ngi3.mli
+	ocamlc -c -I ../_ntrf/ ngi2.cma $<
+ngi3.cmo: ngi3.ml ngi3.cmi
+	ocamlc -c -I ../_ntrf/ ngi2.cma $<
+ngi3.cma: ngi3.cmo
+	ocamlc -a -o $@ -I ../_ntrf/ ngi2.cma $<
+test5.pbm: test5.ml ngi3.cma
+	\ocaml -I ../_ntrf/ ngi2.cma -I . ngi3.cma $< > $@
+clean:
+	$(RM) ngi3.cma
+	$(RM) ngi3.cmi
+	$(RM) ngi3.cmo
+	$(RM) test5.pbm
diff -Naur _ngi-3b/_ntiv/.gil/Makefile.2 _ngi-3c/_ntiv/.gil/Makefile.2
--- _ngi-3b/_ntiv/.gil/Makefile.2	1970-01-01 01:00:00.000000000 +0100
+++ _ngi-3c/_ntiv/.gil/Makefile.2	2026-02-23 12:29:12.723072499 +0100
@@ -0,0 +1,20 @@
+all: ngi3.cma
+pbm: test5.pbm
+#ngi3.mli: ngi3.ml
+#	ocamlc -i -I ../_ntrf/ $< > $@
+ngi3.cmi: ngi3.mli
+	ocamlc -c -I ../_ntrf/ ngi2.cma $<
+ngi3.cmo: ngi3.ml ngi3.cmi
+	ocamlc -c -I ../_ntrf/ ngi2.cma $<
+ngi3.cma: ngi3.cmo
+	ocamlc -a -o $@ -I ../_ntrf/ ngi2.cma $<
+test5.pbm: test5.ml ngi3.cma
+	\ocaml -I ../_ntrf/ ngi2.cma -I . ngi3.cma $< > $@
+doc:
+	mkdir -p doc
+	ocamldoc -html -d doc ngi3.mli
+clean:
+	$(RM) ngi3.cma
+	$(RM) ngi3.cmi
+	$(RM) ngi3.cmo
+	$(RM) test5.pbm
diff -Naur _ngi-3b/_ntiv/.gil/ngi3.ml.0 _ngi-3c/_ntiv/.gil/ngi3.ml.0
--- _ngi-3b/_ntiv/.gil/ngi3.ml.0	1970-01-01 01:00:00.000000000 +0100
+++ _ngi-3c/_ntiv/.gil/ngi3.ml.0	2026-02-23 12:29:12.766072498 +0100
@@ -0,0 +1,21 @@
+open Ngi2
+let f ps = ps |> Array.to_list |>
+  List.filter (fun (a,b) -> a>=0 && b>=0 && a<120 && b<80) |> Array.of_list
+let sq_sqrt (da, db) (pa, pb) =
+  let a = (da - pa) in
+  let b = (db - pb) in
+  (a * a + b * b)
+let add_c (c) =
+  add_c3 (c);
+  let l = max_num () in
+  (l)
+let circ (a, b) r =
+  let l = ref [] in
+  let r2 = (r * r) in
+  for _a = a - r to a + r do
+    for _b = b - r to b + r do
+      if sq_sqrt (_a, _b) (a, b) < r2 then
+        l := (_a, _b) :: !l
+    done;
+  done;
+  f (Array.of_list !l)
diff -Naur _ngi-3b/_ntiv/.gil/ngi3.ml.1 _ngi-3c/_ntiv/.gil/ngi3.ml.1
--- _ngi-3b/_ntiv/.gil/ngi3.ml.1	1970-01-01 01:00:00.000000000 +0100
+++ _ngi-3c/_ntiv/.gil/ngi3.ml.1	2026-02-23 12:29:12.740072499 +0100
@@ -0,0 +1,31 @@
+open Ngi2
+let f ps = ps |> Array.to_list |>
+  List.filter (fun (a,b) -> a>=0 && b>=0 && a<120 && b<80) |> Array.of_list
+let sq_sqrt (da, db) (pa, pb) =
+  let a = (da - pa) in
+  let b = (db - pb) in
+  (a * a + b * b)
+let add_c (c) =
+  add_c3 (c);
+  let l = max_num () in
+  (l)
+let circ (a, b) r =
+  let l = ref [] in
+  let r2 = (r * r) in
+  for _a = a - r to a + r do
+    for _b = b - r to b + r do
+      if sq_sqrt (_a, _b) (a, b) < r2 then
+        l := (_a, _b) :: !l
+    done;
+  done;
+  f (Array.of_list !l)
+let rect (a, b, d, e) =
+  Array.init e (fun _e ->
+    Array.init d (fun _d ->
+      (a + _d, b + _e)
+    )
+  )
+let rect (a, b, d, e) =
+  let arr = rect (a, b, d, e) and ar = ref [| |] in
+  Array.iter (fun arr0 -> ar := Array.append arr0 !ar) arr;
+  !ar
diff -Naur _ngi-3b/_ntiv/.gil/ngi3.ml.2 _ngi-3c/_ntiv/.gil/ngi3.ml.2
--- _ngi-3b/_ntiv/.gil/ngi3.ml.2	1970-01-01 01:00:00.000000000 +0100
+++ _ngi-3c/_ntiv/.gil/ngi3.ml.2	2026-02-23 12:29:12.801072497 +0100
@@ -0,0 +1,65 @@
+open Ngi2
+let f ps = ps |> Array.to_list |>
+  List.filter (fun (a,b) -> a>=0 && b>=0 && a<120 && b<80) |> Array.of_list
+let sq_sqrt (da, db) (pa, pb) =
+  let a = (da - pa) in
+  let b = (db - pb) in
+  (a * a + b * b)
+let add_c (c) =
+  add_c3 (c);
+  let l = max_num () in
+  (l-1)
+let circ (a, b) r =
+  let l = ref [] in
+  let r2 = (r * r) in
+  for _a = a - r to a + r do
+    for _b = b - r to b + r do
+      if sq_sqrt (_a, _b) (a, b) < r2 then
+        l := (_a, _b) :: !l
+    done;
+  done;
+  f (Array.of_list !l)
+let rect (a, b, d, e) =
+  Array.init e (fun _e ->
+    Array.init d (fun _d ->
+      (a + _d, b + _e)
+    )
+  )
+let rect (a, b, d, e) =
+  let arr = rect (a, b, d, e) and ar = ref [| |] in
+  Array.iter (fun arr0 -> ar := Array.append arr0 !ar) arr;
+  !ar
+let diag (a, b, d) =
+  let l = ref [] in
+  for _d = 0 to pred d do
+    for _b = 0 to pred _d do
+      l := (a+_d, _b+b) :: !l
+    done;
+  done;
+  f (Array.of_list !l)
+let diag2 (a, b, d) =
+  let l = ref [] in
+  for _d = 0 to pred d do
+    let d0 = d - _d in
+    for _b = 0 to pred d0 do
+      l := (a+_b, b+_d) :: !l
+    done;
+  done;
+  f (Array.of_list !l)
+let diag3 (a, b, d) =
+  let l = ref [] in
+  for _d = 0 to pred d do
+    for _b = 0 to pred _d do
+      l := (a+_b, b+_d) :: !l
+    done;
+  done;
+  f (Array.of_list !l)
+let diag4 (a, b, d) =
+  let l = ref [] in
+  for _d = 0 to pred d do
+    let d0 = d - _d in
+    for _b = 0 to pred _d do
+      l := (a+_b+d0, b+_d) :: !l
+    done;
+  done;
+  f (Array.of_list !l)
diff -Naur _ngi-3b/_ntiv/.gil/ngi3.mli.0 _ngi-3c/_ntiv/.gil/ngi3.mli.0
--- _ngi-3b/_ntiv/.gil/ngi3.mli.0	1970-01-01 01:00:00.000000000 +0100
+++ _ngi-3c/_ntiv/.gil/ngi3.mli.0	2026-02-23 12:29:12.749072498 +0100
@@ -0,0 +1,2 @@
+val add_c : int * int * int -> int
+val circ : int * int -> int -> (int * int) array
diff -Naur _ngi-3b/_ntiv/.gil/ngi3.mli.1 _ngi-3c/_ntiv/.gil/ngi3.mli.1
--- _ngi-3b/_ntiv/.gil/ngi3.mli.1	1970-01-01 01:00:00.000000000 +0100
+++ _ngi-3c/_ntiv/.gil/ngi3.mli.1	2026-02-23 12:29:12.756072498 +0100
@@ -0,0 +1,3 @@
+val add_c : int * int * int -> int
+val circ : int * int -> int -> (int * int) array
+val rect : int * int * int * int -> (int * int) array
diff -Naur _ngi-3b/_ntiv/.gil/ngi3.mli.2 _ngi-3c/_ntiv/.gil/ngi3.mli.2
--- _ngi-3b/_ntiv/.gil/ngi3.mli.2	1970-01-01 01:00:00.000000000 +0100
+++ _ngi-3c/_ntiv/.gil/ngi3.mli.2	2026-02-23 12:29:12.793072497 +0100
@@ -0,0 +1,7 @@
+val add_c : int * int * int -> int
+val circ : int * int -> int -> (int * int) array
+val rect : int * int * int * int -> (int * int) array
+val diag : int * int * int -> (int * int) array
+val diag2 : int * int * int -> (int * int) array
+val diag3 : int * int * int -> (int * int) array
+val diag4 : int * int * int -> (int * int) array
diff -Naur _ngi-3b/_ntiv/.gil/test5.ml.0 _ngi-3c/_ntiv/.gil/test5.ml.0
--- _ngi-3b/_ntiv/.gil/test5.ml.0	1970-01-01 01:00:00.000000000 +0100
+++ _ngi-3c/_ntiv/.gil/test5.ml.0	2026-02-23 12:29:12.775072498 +0100
@@ -0,0 +1,77 @@
+open Ngi2
+let f ps = ps |> Array.to_list |>
+  List.filter (fun (a,b) -> a>=0 && b>=0 && a<120 && b<80) |> Array.of_list
+let sq_sqrt (da, db) (pa, pb) =
+  let a = (da - pa) in
+  let b = (db - pb) in
+  (a * a + b * b)
+let circ (a, b) r =
+  let l = ref [] in
+  let r2 = (r * r) in
+  for _a = a - r to a + r do
+    for _b = b - r to b + r do
+      if sq_sqrt (_a, _b) (a, b) < r2 then
+        l := (_a, _b) :: !l
+    done;
+  done;
+  f (Array.of_list !l)
+let () =
+  Random.self_init ();
+  fill_pool_0 ();
+  fill_pool_a ();
+  fill_stride ();
+  let c = (255, 255, 255) in
+  default_c3 (c);
+  let c0 = (0, 0, 0) in
+  add_c3 (c0);
+  let b = 19 in
+  let l0 = max_num () in
+  for a = 20 to pred 79 do
+    let d = _ab (a) (b) in
+    fill_pool_d (l0-1) (d);
+  done;
+  let ps =
+    Array.init (24*2*3*5*2) (fun _ ->
+      (Random.int 120,
+       Random.int (72 -10))
+    )
+  in
+  fill_pool_n ps (l0-1);
+  begin
+    let ps = circ (20, 20) (20-4) in
+    let c1 = (255, 0, 0) in
+    add_c3 (c1);
+    let l = max_num () in
+    fill_pool_n ps (l-1);
+  end;
+  begin
+    let c2 = (10, 11, 255) in
+    add_c3 (c2);
+    let ps =
+      Array.init (36*(2+1)) (fun _ ->
+        let b = Random.int 2 in
+        (Random.int 120, (79-6+b)))
+    in
+    let l = max_num () in
+    fill_pool_n ps (l-1);
+    let ps = circ (110, 60) (20-4-4-2-2) in
+    (*
+    let ps = circ (110, 60) (20+4) in
+    *)
+    fill_pool_n ps (l-1);
+  end;
+  begin
+    let c3 = (0, 255, 0) in
+    add_c3 (c3);
+    let l = max_num () in
+    let ps = Ngi3.rect (2, 3, 4, 5) in
+    fill_pool_n ps (l-1);
+    let ps = Ngi3.rect (90, 50, 20, 10) in
+    fill_pool_n ps (l-1);
+  end;
+  begin
+    let ps = circ (20, 20) (20-6) in
+    fill_pool_n ps (l0-1);
+  end;
+  dump_pool ();
+;;
diff -Naur _ngi-3b/_ntiv/.gil/test6.ml.0 _ngi-3c/_ntiv/.gil/test6.ml.0
--- _ngi-3b/_ntiv/.gil/test6.ml.0	1970-01-01 01:00:00.000000000 +0100
+++ _ngi-3c/_ntiv/.gil/test6.ml.0	2026-02-23 12:29:12.710072500 +0100
@@ -0,0 +1,19 @@
+open Ngi2
+let () =
+  Random.self_init ();
+  fill_pool_0 ();
+  fill_pool_a ();
+  fill_stride ();
+  let c = (0, 0, 255) in
+  default_c3 (c);
+  let c0 = (255, 255, 0) in
+  add_c3 (c0);
+  begin
+    let l = max_num () in
+    let ps = Ngi3.diag (20, 20, 20) in
+    fill_pool_n ps (l-1);
+    let ps = Ngi3.diag (20, 40, 20) in
+    fill_pool_n ps (l-1);
+  end;
+  dump_pool ();
+;;
diff -Naur _ngi-3b/_ntiv/Makefile _ngi-3c/_ntiv/Makefile
--- _ngi-3b/_ntiv/Makefile	1970-01-01 01:00:00.000000000 +0100
+++ _ngi-3c/_ntiv/Makefile	2026-02-23 12:29:12.678072501 +0100
@@ -0,0 +1,23 @@
+all: ngi3.cma
+pbm: test5.pbm test6.pbm
+#ngi3.mli: ngi3.ml
+#	ocamlc -i -I ../_ntrf/ $< > $@
+ngi3.cmi: ngi3.mli
+	ocamlc -c -I ../_ntrf/ ngi2.cma $<
+ngi3.cmo: ngi3.ml ngi3.cmi
+	ocamlc -c -I ../_ntrf/ ngi2.cma $<
+ngi3.cma: ngi3.cmo
+	ocamlc -a -o $@ -I ../_ntrf/ ngi2.cma $<
+test5.pbm: test5.ml ngi3.cma
+	\ocaml -I ../_ntrf/ ngi2.cma -I . ngi3.cma $< > $@
+%.pbm: %.ml ngi3.cma
+	\ocaml -I ../_ntrf/ ngi2.cma -I . ngi3.cma $< > $@
+doc:
+	mkdir -p doc
+	ocamldoc -html -d doc ngi3.mli
+clean:
+	$(RM) ngi3.cma
+	$(RM) ngi3.cmi
+	$(RM) ngi3.cmo
+	$(RM) test5.pbm
+	$(RM) test6.pbm
diff -Naur _ngi-3b/_ntiv/ngi3.ml _ngi-3c/_ntiv/ngi3.ml
--- _ngi-3b/_ntiv/ngi3.ml	1970-01-01 01:00:00.000000000 +0100
+++ _ngi-3c/_ntiv/ngi3.ml	2026-02-23 12:29:12.621072502 +0100
@@ -0,0 +1,65 @@
+open Ngi2
+let f ps = ps |> Array.to_list |>
+  List.filter (fun (a,b) -> a>=0 && b>=0 && a<120 && b<80) |> Array.of_list
+let sq_sqrt (da, db) (pa, pb) =
+  let a = (da - pa) in
+  let b = (db - pb) in
+  (a * a + b * b)
+let add_c (c) =
+  add_c3 (c);
+  let l = max_num () in
+  (l-1)
+let circ (a, b) r =
+  let l = ref [] in
+  let r2 = (r * r) in
+  for _a = a - r to a + r do
+    for _b = b - r to b + r do
+      if sq_sqrt (_a, _b) (a, b) < r2 then
+        l := (_a, _b) :: !l
+    done;
+  done;
+  f (Array.of_list !l)
+let rect (a, b, d, e) =
+  Array.init e (fun _e ->
+    Array.init d (fun _d ->
+      (a + _d, b + _e)
+    )
+  )
+let rect (a, b, d, e) =
+  let arr = rect (a, b, d, e) and ar = ref [| |] in
+  Array.iter (fun arr0 -> ar := Array.append arr0 !ar) arr;
+  !ar
+let diag (a, b, d) =
+  let l = ref [] in
+  for _d = 0 to pred d do
+    for _b = 0 to pred _d do
+      l := (a+_d, _b+b) :: !l
+    done;
+  done;
+  f (Array.of_list !l)
+let diag2 (a, b, d) =
+  let l = ref [] in
+  for _d = 0 to pred d do
+    let d0 = d - _d in
+    for _b = 0 to pred d0 do
+      l := (a+_b, b+_d) :: !l
+    done;
+  done;
+  f (Array.of_list !l)
+let diag3 (a, b, d) =
+  let l = ref [] in
+  for _d = 0 to pred d do
+    for _b = 0 to pred _d do
+      l := (a+_b, b+_d) :: !l
+    done;
+  done;
+  f (Array.of_list !l)
+let diag4 (a, b, d) =
+  let l = ref [] in
+  for _d = 0 to pred d do
+    let d0 = d - _d in
+    for _b = 0 to pred _d do
+      l := (a+_b+d0, b+_d) :: !l
+    done;
+  done;
+  f (Array.of_list !l)
diff -Naur _ngi-3b/_ntiv/ngi3.mli _ngi-3c/_ntiv/ngi3.mli
--- _ngi-3b/_ntiv/ngi3.mli	1970-01-01 01:00:00.000000000 +0100
+++ _ngi-3c/_ntiv/ngi3.mli	2026-02-23 12:29:12.641072502 +0100
@@ -0,0 +1,7 @@
+val add_c : int * int * int -> int
+val circ : int * int -> int -> (int * int) array
+val rect : int * int * int * int -> (int * int) array
+val diag : int * int * int -> (int * int) array
+val diag2 : int * int * int -> (int * int) array
+val diag3 : int * int * int -> (int * int) array
+val diag4 : int * int * int -> (int * int) array
diff -Naur _ngi-3b/_ntiv/test5.ml _ngi-3c/_ntiv/test5.ml
--- _ngi-3b/_ntiv/test5.ml	1970-01-01 01:00:00.000000000 +0100
+++ _ngi-3c/_ntiv/test5.ml	2026-02-23 12:29:12.665072501 +0100
@@ -0,0 +1,85 @@
+open Ngi2
+let f ps = ps |> Array.to_list |>
+  List.filter (fun (a,b) -> a>=0 && b>=0 && a<120 && b<80) |> Array.of_list
+let sq_sqrt (da, db) (pa, pb) =
+  let a = (da - pa) in
+  let b = (db - pb) in
+  (a * a + b * b)
+let circ (a, b) r =
+  let l = ref [] in
+  let r2 = (r * r) in
+  for _a = a - r to a + r do
+    for _b = b - r to b + r do
+      if sq_sqrt (_a, _b) (a, b) < r2 then
+        l := (_a, _b) :: !l
+    done;
+  done;
+  f (Array.of_list !l)
+let () =
+  Random.self_init ();
+  fill_pool_0 ();
+  fill_pool_a ();
+  fill_stride ();
+  let c = (255, 255, 255) in
+  default_c3 (c);
+  let c0 = (0, 0, 0) in
+  add_c3 (c0);
+  let b = 19 in
+  let l0 = max_num () in
+  for a = 20 to pred 79 do
+    let d = _ab (a) (b) in
+    fill_pool_d (l0-1) (d);
+  done;
+  let ps =
+    Array.init (24*2*3*5*2) (fun _ ->
+      (Random.int 120,
+       Random.int (72 -10))
+    )
+  in
+  fill_pool_n ps (l0-1);
+  begin
+    let ps = circ (20, 20) (20-4) in
+    let c1 = (255, 0, 0) in
+    add_c3 (c1);
+    let l = max_num () in
+    fill_pool_n ps (l-1);
+  end;
+  begin
+    let c2 = (10, 11, 255) in
+    add_c3 (c2);
+    let ps =
+      Array.init (36*(2+1)) (fun _ ->
+        let b = Random.int 2 in
+        (Random.int 120, (79-6+b)))
+    in
+    let l = max_num () in
+    fill_pool_n ps (l-1);
+    let ps = circ (110, 60) (20-4-4-2-2) in
+    (*
+    let ps = circ (110, 60) (20+4) in
+    *)
+    fill_pool_n ps (l-1);
+  end;
+  begin
+    let c3 = (0, 255, 0) in
+    add_c3 (c3);
+    let l = max_num () in
+    let ps = Ngi3.rect (2, 3, 4, 5) in
+    fill_pool_n ps (l-1);
+    let ps = Ngi3.rect (90, 50, 20, 10) in
+    fill_pool_n ps (l-1);
+    let c4 = (0, 0, 255) in
+    add_c3 (c4);
+    let l = max_num () in
+    let ps = Ngi3.diag (72, 24, 10) in
+    Array.iter (fun (a, b) ->
+      Printf.printf "# %d %d\n" a b;
+    ) ps;
+    fill_pool_n ps (l-1);
+  end;
+  begin
+    let ps = circ (20, 20) (20-6) in
+    fill_pool_n ps (l0-1);
+  end;
+  dump_pool ();
+;;
diff -Naur _ngi-3b/_ntiv/test6.ml _ngi-3c/_ntiv/test6.ml
--- _ngi-3b/_ntiv/test6.ml	1970-01-01 01:00:00.000000000 +0100
+++ _ngi-3c/_ntiv/test6.ml	2026-02-23 12:29:12.651072501 +0100
@@ -0,0 +1,44 @@
+open Ngi2
+let () = Random.self_init ()
+let an2 () =
+  fill_pool_0 ();
+  fill_pool_a ();
+  fill_stride ();
+  let c = (0, 0, 255) in
+  default_c3 (c);
+  let c0 = (255, 255, 0) in
+  let l0 = Ngi3.add_c (c0) in
+  begin
+    let ps = Ngi3.diag (20, 20, 20) in
+    fill_pool_n ps (l0);
+    let ps = Ngi3.diag (20, 40, 20) in
+    fill_pool_n ps (l0);
+    let ps = Ngi3.diag2 (40+10, 40, 20) in
+    fill_pool_n ps (l0);
+    let ps = Ngi3.diag3 (40+10+30, 40, 20) in
+    fill_pool_n ps (l0);
+    let ps = Ngi3.diag4 (40+10+30, 20, 20) in
+    fill_pool_n ps (l0);
+  end;
+  dump_pool ();
+;;
+let an1 () =
+  fill_pool_0 ();
+  fill_pool_a ();
+  fill_stride ();
+  let c = (0, 0, 255) in
+  default_c3 (c);
+  let c0 = (255, 255, 0) in
+  add_c3 (c0);
+  begin
+    let l = max_num () in
+    let ps = Ngi3.diag (20, 20, 20) in
+    fill_pool_n ps (l-1);
+    let ps = Ngi3.diag (20, 40, 20) in
+    fill_pool_n ps (l-1);
+  end;
+  dump_pool ();
+;;
+let an = an1
+let an = an2
+let () = an2 ()
diff -Naur _ngi-3b/_ntiv/test6.ml.0 _ngi-3c/_ntiv/test6.ml.0
--- _ngi-3b/_ntiv/test6.ml.0	1970-01-01 01:00:00.000000000 +0100
+++ _ngi-3c/_ntiv/test6.ml.0	2026-02-23 12:29:12.632072502 +0100
@@ -0,0 +1,19 @@
+open Ngi2
+let () =
+  Random.self_init ();
+  fill_pool_0 ();
+  fill_pool_a ();
+  fill_stride ();
+  let c = (0, 0, 255) in
+  default_c3 (c);
+  let c0 = (255, 255, 0) in
+  add_c3 (c0);
+  begin
+    let l = max_num () in
+    let ps = Ngi3.diag (20, 20, 20) in
+    fill_pool_n ps (l-1);
+    let ps = Ngi3.diag (20, 40, 20) in
+    fill_pool_n ps (l-1);
+  end;
+  dump_pool ();
+;;
diff -Naur _ngi-3b/_ntrf/ngi2.ml _ngi-3c/_ntrf/ngi2.ml
--- _ngi-3b/_ntrf/ngi2.ml	2026-02-22 15:54:32.812710643 +0100
+++ _ngi-3c/_ntrf/ngi2.ml	2026-02-23 12:29:12.518072506 +0100
@@ -2,12 +2,24 @@
 external fill_pool_n : (int * int) array -> int -> unit
   = "caml_fill_pool_n"
 
+external fill_pool_m : (int * int) array -> int -> unit
+  = "caml_fill_pool_m"
+
+external fill_pool_n : (int * int) array -> int -> unit
+  = "caml_fill_pool_n"
+
 external fill_pool_0 : unit -> unit
   = "caml_fill_pool_0"
 
 external fill_pool_a : unit -> unit
   = "caml_fill_pool_a"
 
+external min_pool_a : int -> unit
+  = "caml_min_pool_a"
+
+external add_pool_a : int -> unit
+  = "caml_add_pool_a"
+
 external fill_stride : unit -> unit
   = "caml_fill_stride"
 
diff -Naur _ngi-3b/_ntrf/ngi2.mli _ngi-3c/_ntrf/ngi2.mli
--- _ngi-3b/_ntrf/ngi2.mli	2026-02-22 15:54:32.698710647 +0100
+++ _ngi-3c/_ntrf/ngi2.mli	2026-02-23 12:29:12.491072506 +0100
@@ -1,11 +1,15 @@
 
 val fill_pool_n : (int * int) array -> int -> unit
+val fill_pool_m : (int * int) array -> int -> unit
 
 val fill_pool_0 : unit -> unit
 val fill_pool_a : unit -> unit
 val fill_stride : unit -> unit
 val fill_pool_d : int -> int -> unit
 
+val min_pool_a : int -> unit
+val add_pool_a : int -> unit
+
 val default_c3 : int * int * int -> unit
 val add_c3 : int * int * int -> unit
 
diff -Naur _ngi-3b/_ntrf/ngi2_stub.c _ngi-3c/_ntrf/ngi2_stub.c
--- _ngi-3b/_ntrf/ngi2_stub.c	2026-02-22 15:54:32.586710650 +0100
+++ _ngi-3c/_ntrf/ngi2_stub.c	2026-02-23 12:29:12.505072506 +0100
@@ -20,6 +20,20 @@
 }
 
 CAMLprim value
+caml_min_pool_a(value caml_d)
+{
+  min_pool_a(Int_val(caml_d));
+  return Val_unit;
+}
+
+CAMLprim value
+caml_add_pool_a(value caml_d)
+{
+  add_pool_a(Int_val(caml_d));
+  return Val_unit;
+}
+
+CAMLprim value
 caml_fill_stride(value caml_u)
 {
   fill_stride();
@@ -61,6 +75,22 @@
   return Val_unit;
 }
 
+CAMLprim value
+caml_fill_pool_m(value caml_ps, value caml_c)
+{
+  int p[20000*2];
+  int d, n;
+  n = Wosize_val(caml_ps);
+  if (n>20000) caml_failwith("fill_pool_n");
+  for (d=0;d<n;d++) {
+    value caml_p=Field(caml_ps,d);
+    p[(d*2)]=  Long_val(Field(caml_p,0));
+    p[(d*2)+1]=Long_val(Field(caml_p,1));
+  }
+  fill_pool_m(p,n,Long_val(caml_c));
+  return Val_unit;
+}
+
 CAMLprim value
 caml_add_c3(value caml_c)
 {
