[arch-commits] Commit in sagemath/trunk (3 files)

Antonio Rojas arojas at archlinux.org
Sat Apr 13 07:03:45 UTC 2019


    Date: Saturday, April 13, 2019 @ 07:03:44
  Author: arojas
Revision: 451342

Fix 3D rendering with recent three.js

Added:
  sagemath/trunk/sagemath-threejs-100.patch
Modified:
  sagemath/trunk/PKGBUILD
  sagemath/trunk/sagemath-threejs.patch

----------------------------+
 PKGBUILD                   |   12 ++++++++----
 sagemath-threejs-100.patch |   26 ++++++++++++++++++++++++++
 sagemath-threejs.patch     |    2 +-
 3 files changed, 35 insertions(+), 5 deletions(-)

Modified: PKGBUILD
===================================================================
--- PKGBUILD	2019-04-13 05:51:11 UTC (rev 451341)
+++ PKGBUILD	2019-04-13 07:03:44 UTC (rev 451342)
@@ -8,7 +8,7 @@
 pkgbase=sagemath
 pkgname=(sagemath sagemath-jupyter)
 pkgver=8.7
-pkgrel=1
+pkgrel=2
 pkgdesc="Open Source Mathematics Software, free alternative to Magma, Maple, Mathematica, and Matlab"
 arch=(x86_64)
 url="http://www.sagemath.org"
@@ -46,7 +46,8 @@
         sagemath-sphinx-1.8.patch
         sagemath-singular-4.1.2.patch
         sagemath-ecl-sigfpe.patch
-        sagemath-gap-4.10.1.patch)
+        sagemath-gap-4.10.1.patch
+        sagemath-threejs-100.patch)
 sha256sums=('263c3b3fc956b8bebc532f3b51e68c1b0d559d3b7e7c9fadffdfc0f4dbae18ab'
             'e0e36f2a39b634a76e1c3ad9a31f9ab60e734dd53b43203557b76613277d53b9'
             'b1068a8d5750051c2b5cfcb89d3d5870cf4233ab445e71c398543fb8b1e6281a'
@@ -54,12 +55,13 @@
             '12cd410035ae644c2495b0dcd3a5138133a471ecc07912d37114c46ee837eb0e'
             'f12bd2a53ad51549015093aacc89978f4d796d9ab5bcd3d737aa0d57a5815b54'
             '7fcb52e96935dccb0f958d37c2f4e3918392480b9af53e08562f6cba6c68cb94'
-            'f6b48abf34f64ea3fc092b0f0179e89633f7d3ecc0d62c2acacbfa1217751d63'
+            'd3c50256cfcf84a90336647f8a1164386b6b8034f47c45361d57be487e92d2c1'
             '4c6df9e4e5a7b29ecf6189eda3e5a79f69b6e1b4d29c1b9559663149b8c0af96'
             '22f5e44a42c8276025b8512f45cac1c36d576c29c7fd9d36fde8b19ff87867d8'
             '961bfb5694b67d425d21240d71490cb71714b5207c23448c89be0966512ff8f9'
             'a42f3b152b1aedb8abf16bc70971419919d1fe30328574e7fef8305f9d07d938'
-            '9ec56a3788e32c54f35abeaeedf7cadf6670fa10d39007050b23b93d3c35278e')
+            '9ec56a3788e32c54f35abeaeedf7cadf6670fa10d39007050b23b93d3c35278e'
+            '3190167368e1689eb29b905b6703fdd41f11c075cc25442caf6305393f3e218c')
 
 prepare(){
   cd sage-$pkgver
@@ -91,6 +93,8 @@
   patch -p1 -i ../sagemath-singular-4.1.2.patch
 # Fix SIGFPE crashes with ecl 16.1.3 https://trac.sagemath.org/ticket/22191
   patch -p1 -i ../sagemath-ecl-sigfpe.patch
+# Fix rendering with three.js r100 https://trac.sagemath.org/ticket/26718
+  patch -p1 -i ../sagemath-threejs-100.patch
 
 # use python2
   sed -e 's|sage-python23|python2|' -e 's|#!/usr/bin/env python\b|#!/usr/bin/env python2|' -i src/bin/*

Added: sagemath-threejs-100.patch
===================================================================
--- sagemath-threejs-100.patch	                        (rev 0)
+++ sagemath-threejs-100.patch	2019-04-13 07:03:44 UTC (rev 451342)
@@ -0,0 +1,26 @@
+diff --git a/src/ext/threejs/threejs_template.html b/src/ext/threejs/threejs_template.html
+index 0243bc1..d6ad3a7 100644
+--- a/src/ext/threejs/threejs_template.html
++++ b/src/ext/threejs/threejs_template.html
+@@ -114,7 +114,7 @@ SAGE_SCRIPTS
+         scene.add( sprite );
+     }
+ 
+-    if ( options.axes ) scene.add( new THREE.AxisHelper( Math.min( a[0]*b[1].x, a[1]*b[1].y, a[2]*b[1].z ) ) );
++    if ( options.axes ) scene.add( new THREE.AxesHelper( Math.min( a[0]*b[1].x, a[1]*b[1].y, a[2]*b[1].z ) ) );
+ 
+     var camera = new THREE.PerspectiveCamera( 45, window.innerWidth / window.innerHeight, 0.1, 1000 );
+     camera.up.set( 0, 0, 1 );
+@@ -235,7 +235,11 @@ SAGE_SCRIPTS
+                                      transparent: transparent, opacity: json.opacity,
+                                      shininess: 20 } );
+ 
+-        var c = geometry.center().multiplyScalar( -1 );
++        var c = new THREE.Vector3();
++        geometry.computeBoundingBox();
++        geometry.boundingBox.getCenter( c );
++        geometry.translate( -c.x, -c.y, -c.z );
++
+         var mesh = new THREE.Mesh( geometry, material );
+         mesh.position.set( c.x, c.y, c.z );
+         scene.add( mesh );

Modified: sagemath-threejs.patch
===================================================================
--- sagemath-threejs.patch	2019-04-13 05:51:11 UTC (rev 451341)
+++ sagemath-threejs.patch	2019-04-13 07:03:44 UTC (rev 451342)
@@ -5,7 +5,7 @@
          if online:
              from sage.misc.package import installed_packages
 -            version = installed_packages()['threejs'].split('.')[0]
-+            version = 'r80'
++            version = 'r100'
              return """
  <script src="https://cdn.rawgit.com/mrdoob/three.js/{0}/build/three.min.js"></script>
  <script src="https://cdn.rawgit.com/mrdoob/three.js/{0}/examples/js/controls/OrbitControls.js"></script>



More information about the arch-commits mailing list