Fighting with computers

Computers are not always friendly.

Saturday, June 10, 2017

Hello Clipper, bye JTS

Polygon clipping and polygon offsetting are operations that due to the multitud of cases possible are quite a difficult beast to tame. That is why I have used an external library when I have needed such a feature in a program.

A few days ago, researching for a student's assignment, I learned that "clipper" library had been migrated to Java by Tobias Mahlmann.  I had a minor trouble with one file not using UTF-8 encoding but other than that it compiled and run beautifully (not in my large display though as I am using an scale factor larger than one that messes the Java GUI layout).


Another interesting detail is that the code will need Java 1.8 to compile as it uses a Lambda function in one of the Comparators used. However, I wanted to use it with some older code that was using 1.6 and the compiler was not happy with my version request, so I needed to do a small change to get rid of the Lamba function code in favor of an inner class. 

Once the code was working, I could use it with some code developed with Processing 2.21 and it would work ok.  Now I have to do some tests but my first impression is that Clipper is way faster than Java Topology Suite.

Update: After some tests it seems Clipper is not as robust as JTS, so I am not going to make any change to my software after all.

Thursday, June 08, 2017

OpenSCAD kept crashing on Ubuntu 16.04 with AMD drivers

After the upgrade of my computer's graphics card for a new AMD RX 460 I noticed OpenSCAD program was crashing all the time with a segmentation fault (every time I pressed F5 or F6). But the problem would only happen if I was using AMD native driver (amdgpu-pro). I saw no references online to this specific problem which was weird.

I decided to buy the RX 460 as it apparently had good Linux support, so it was odd to have this kind of problem but no matter what version of the driver I was using or what version of OpenSCAD nightly build I could not use the application. I managed to get an AppImage version that worked without a problem in my system and that is what I have been using for a while.

Today, I have decided to check if somehow problem could he related to my locale, so I invoked the application like this: LC_ALL=C openscad-nightly

And lo and behold, OpenSCAD is working as it should, no problem whatsoever. So it is clear that my Spanish locale was what caused the problem. I wish I have thought sooner about making this simple test.

Update: Oops, there is still something else, as csg example still crashes the program (time to try a stable release now).

Update2: Well, stable release is a compelte no-go.

Update3: When you discover that the crashes happening from command line are gone if program is run from gdb.  WTF? It turns out it is a "Heisenbug" (time-sensitive bug)

Friday, June 02, 2017

Windows 10 on vmplayer

From time to time there is some software I need to use that is only available for Windows. For that I kept an old virtual machine I created ten years ago that was running Windows XP and served me well over the years. But the last instance of software in point was the latest Netfabb  Standard 2017, that is only available as a 64bit Windows version.

So I grabbed a Windows 10 ISO from Microsoft Imagine shop and fed it to my virtual machine. After some time I got a new virtual machine running Windows 10, or almost.

I could see networking was not working nor was audio. I could see many people reporting different problems with various virtualisation tools and Windows 10 but it was not clear what my problem was, so after following several wrong paths I realized the system was complaining about not having a driver for the hardware found. I checked on the configuration file and I could see the network device was "vlance" and I replaced it for "e1000" and the latter was easily recognized by Windows 10 so that was fixed.

The configured card I had in my virtual system was "es1371" that, again, was not apparently supported by Windows 10 (at least not if the network was not working as it was my case). So I replaced it by "hdaudio" and now I have got sound too. Audio quality is not great but just ok.