## A little cheat-sheet, on how to wrap Python mpmath procedurals inside regular SageMath expressions.

The following link should not be taken, as the complete solution to anybody else’s computing task, in which my readers might want to wrap Python code for use in SageMath. In fact, I don’t even consider myself an expert in either of these subjects.

For people who do not know, “SageMath” is a combination of “Computer Algebra System” – ‘CAS’ – and ‘Numerical Toolbox’. SageMath is written using multiple languages, mainly Python. And, the ‘Maxima’ CAS back-end was written in LISP. ‘mpmath’ is a specific Python package, that allows Multi-Precision Arithmetic.

The integration of ‘mpmath’ is particularly straightforward, because Sage already uses this package. But the principles that would be used for other Python packages are similar. An interface must be established, by which Sage objects can be translated into the objects specific to the external Python packages, and back into objects that Sage can recognize again. Objects that Sage finds particularly useful, are ‘Symbolic Functions’ – that are to be manipulated algebraically – and ditto for ‘Symbolic Expressions’.

If worse comes to worst, then the data generated by the external, ‘wrapped’ code, may be converted into native Python objects such as ~Strings~. However, Sage does not recognize strings as valid Symbolic Expressions. So, one way around that could be, to call Sage’s ‘sage_eval()‘ function on the strings. (:1)

http://dirkmittler.homeip.net/LambertW%20Test%203%20–%20Sage.html

(Updated 7/28/2021, 12h15… )

## Inkscape Extension ‘svg2tikz’ revisited.

In this earlier posting, I had written about the low-performing 3rd-party Inkscape Extension known as ‘svg2tikz’. Nevertheless, this extension may prove useful to some users, who wish to import an arbitrary document-type into Inkscape – preferably vector-based – and who wish to convert that into LaTeX in some way. And it seems that, even though this project was abandoned some time ago, work has slowly begun to resume on its source-code. And so, I should also fine-tune some of the earlier commentary I had made about this extension.

First off, there is an important detail about how to compile and install this extension, which its devs fail to point out anywhere. It needs to be built and installed, using Python 3, while many Linux computers still default to Python 2.7. Therefore, the commands to build and install it are:


$python3 setup.py build$ su
(...)
# python3 setup.py install



If one neglects this detail, then Unicode support is left out, and usually, SVG Files etc., will contain some Unicode characters. Further, as the Github comment states, while the importing of raster-based images is now supported, their import as Base-64 encoded, inline data is not. Therefore, within Inkscape, for example if a PDF File is being imported, the option needs to be unchecked, to ‘Embed’ graphics. And when Saving a Copy to TiKz Format, the option should also be unchecked, to ‘Indent Groups’.

But this last detail leads me to an important, additional observation. I have always known that the export of Text with the Figure has been dodgy. But lately, either because I’ve become more observant, or, because the behaviour of the latest version of the extension has improved, I’ve noticed what, exactly, goes wrong with Exporting Text along with the Figure.

(Updated 2/11/2020, 1h05 … )

## On to the Future of 3D Web Content: Blend4Web

One of the subjects in Computing which continue to fascinate me, is CGI and so-called 3D Models as well as Scenes, that can be rendered to a 2D perspective View. At the same time, for the more trendy readers who like VR Goggles, those scenes can be rendered to 2 2D Views, just so that there will be parallax between them, and the scene seen with stereoscopic vision.

One of the facts which has been made known is that, sometime in 2020, Adobe plans to retire Flash. On one of my home pages, I actually have a 3D animation which used to run under Flash 11, when compiled with Stage3D support. What I find is that the latest Flash Firefox plugin will not display it for Linux, but Google Chrome still plays it. It’s an animation that should be fixed, but, since I neither have the software anymore which I once used to author it, nor the ability to expect browsers to support Flash in the future, I have just skipped fixing that animation.

What I may do at some point in the future, however, is to create some other sort of 3D content, that can be published as part of Web-pages. And, through the use of HTML5 and WebGL, this is quite feasible. The only question which struck me next was, What sort of platform could I use, eventually, that is Free and Open-Source? And the answer that presents itself, is Blend4Web – Community Edition!

Because this platform, which I’ve tested partially, is fully open-source, the licensing requires that I publish any and all source code used to create my future content, including source code belonging to Blend4Web-CE itself. Thus, to avoid procrastinating on that front, I have made the Open-Source version of that code available Here.

This way, whenever I want to create some 3D content, I will not need to worry much about the licensing requirement. Yet, if my readers want to, they may go to the company’s Web-site, linked to above, and purchase the paid-for version of the software instead, differently from the Open-Source version, which I really prefer and use. (:1)

I want to caution my readers however. This software tree comprises 1.4GB, and if the readers wish to download it, I’d strongly urge them to do so from the company’s Web-site, not mine, because the company has a Content Delivery Network – a CDN – that will enable many downloads, while I do not.

Note: Differently from what some readers have already inferred, Yes, the company Web-site also offers free downloads, of the Open-Source version, which is referred to as the ‘Community Edition’.

(Updated 01/05/2020, 11h40 … )