I am interested in lattice spheres (consisting if integer points [x,y,z] with x^2+y^2+z^2==n).
I asked for correct term for what I was interested in on math stackexchange:
https://math.stackexchange.com/question ... 4%9d%c2%b3
I learned what I am interested in is called "width" of a pointset.
Then I learned that CGAL C++ library (Computational Geometry Algorithms Library) has function to determine width of pointset (with definition):
https://doc.cgal.org/latest/Polytope_di ... th__3.html
Next I wanted to be able to call that functions from within PARI/GP and learned how to do that.
"Simply" write shared C++ library providing the functions of interest, and use PARI/GP cmmands like this:to make them available in PARI/GP. This is new cgal4gp repo I created for that:
https://github.com/Hermann-SW/cgal4gp
Works in 64bit Raspberry PiOS, under Ubuntu and even under termux/Android:
![Image]()
![Image]()
Two nights ago I learned how to get the Qt basic viewer of CGAL working.
So today I added new CGAL_convex_hull_3() function to the repo:It returns #vertices, #edges, #halfedges and #faces of convex hull.
Currently I see no need to get the convex cull in GP, the last is stored in the shared library.
So why adding that function?
Because I want to add another new function CGAL_draw() !
That openens the Qt basic viewer (2D and 3D) of CGAL.
Yes, PARI/GP has its own graphical output for functions, but no (interactive) 3D viewer to my knowledge.
I already have the "create convex hull, then draw in basic viewer" as standalone code (right).
Need to figure out how to get all the cmake created Qt stuff correctly into shared lib.
On the left side you see same lattice sphere for n=65 as in basic viewer.
Later I need to figure out how to remove the edges of the triangulation (right) not needed to match left view.
You can get the left view with JSCAD in your browser with this link (parameters "=pq, 5, 13" in screenshot above):
https://hermann-sw.github.io/lattice_sphere_cmp/
I asked for correct term for what I was interested in on math stackexchange:
https://math.stackexchange.com/question ... 4%9d%c2%b3
I learned what I am interested in is called "width" of a pointset.
Then I learned that CGAL C++ library (Computational Geometry Algorithms Library) has function to determine width of pointset (with definition):
https://doc.cgal.org/latest/Polytope_di ... th__3.html
Next I wanted to be able to call that functions from within PARI/GP and learned how to do that.
"Simply" write shared C++ library providing the functions of interest, and use PARI/GP cmmands like this:
Code:
install("get_squared_width", "v&&", "CGAL_get_squared_width", "./libcgal4gp.so");
https://github.com/Hermann-SW/cgal4gp
Works in 64bit Raspberry PiOS, under Ubuntu and even under termux/Android:


Two nights ago I learned how to get the Qt basic viewer of CGAL working.
So today I added new CGAL_convex_hull_3() function to the repo:
Code:
pi@raspberrypi5:~/cgal4gp $ gp -q cgal4gp.gp ? points=[[1,0,0],[2,-1,0],[2,0,-1],[3,0,0],[2,1,0],[2,0,1]];? CGAL_convex_hull_3(points)[6, 12, 24, 8]?
Currently I see no need to get the convex cull in GP, the last is stored in the shared library.
So why adding that function?
Because I want to add another new function CGAL_draw() !
That openens the Qt basic viewer (2D and 3D) of CGAL.
Yes, PARI/GP has its own graphical output for functions, but no (interactive) 3D viewer to my knowledge.
I already have the "create convex hull, then draw in basic viewer" as standalone code (right).
Need to figure out how to get all the cmake created Qt stuff correctly into shared lib.
On the left side you see same lattice sphere for n=65 as in basic viewer.
Later I need to figure out how to remove the edges of the triangulation (right) not needed to match left view.
You can get the left view with JSCAD in your browser with this link (parameters "=pq, 5, 13" in screenshot above):
https://hermann-sw.github.io/lattice_sphere_cmp/
Statistics: Posted by HermannSW — Thu Jul 18, 2024 12:50 pm