How to animate isometric unwrapping of a curve

9 May 2018 in geometry

A while ago I was thinking about how to illustrate the input data in Shape from sensors — in 2D, the input is the unit tangent field parametrized by arc-length.

I ended with this cool-looking isometric and isotopic unwrapping.

Move the slider to unwrap the curve. You can also play around in fullscreen.

The effect is achieved by interpolating between the input curve and a straight line with the same length in the tangent space (using spherical linear interpolation).

continue reading…

Lerp vs Slerp

6 May 2018 in geometry

Here’s a demonstration of the difference between two common unit vector interpolation schemes.

The first option is to use linear interpolation in the ambient Euclidean space, followed by a normalization step. Simple and fast, but the angular velocity is not uniform.

Spherical linear interpolation produces uniform angular velocity at the expense of non-linear computation. Slerp is commonly used to interpolate between rotations represented by quaternions.

Your browser does not support the HTML5 canvas tag.

How to export a curve network with normals in Blender

9 April 2018 in blender

Most curve network datasets found online contain only positions and not surface normals along the curves (Cycles, True2Form, ILoveSketch). When I needed to create a bunch of synthetic curve networks with normals to test our surfacing algorithm, I thought this could be easily done using Blender:

  1. Select the network on a mesh
  2. Separate the network from the mesh using the Separation tool (P)
  3. Export the network as an OBJ file (including the normals)

It turned out to be much more tricky than that.

continue reading…

Zippering two pdfs

1 September 2017 in cmd

If for some reason you have two pdfs with separated odd and even pages of a document, the following command zippers them into a single pdf. (Assuming odd.pdf and even.pdf have the same number of pages; in this case 8.)

qpdf --empty --pages $(for i in $(seq 1 1 8); do echo " odd.pdf $i even.pdf $i "; done) -- all.pdf

Re-encoding subtitles in utf-8

29 August 2017 in cmd

Most Slovak/Czech subtitles are encoded in Plex-incompatible windows-1250 (wiki). The following changes the encoding to utf-8.

iconv -f windows-1250 -t utf-8 subs-win-1250.srt > subs-utf-8.srt

Compressing papers with ghostscript

5 May 2017 in research

When searching for ways to compress the size of a ~50MB paper pdf, I’ve discovered the following ghostscript command (askUbuntu, TeX StackExchange)

gs -sDEVICE=pdfwrite -dCompatibilityLevel=1.4 -dPDFSETTINGS=/screen -dNOPAUSE -dQUIET -dBATCH -sOutputFile=compressed.pdf original.pdf

Argument of -dPDFSETTINGS can be any of:

-dPDFSETTINGS=/screen   # lower quality, smaller size.
-dPDFSETTINGS=/ebook    # for better quality, but slightly larger pdfs.
-dPDFSETTINGS=/prepress # output similar to Acrobat Distiller "Prepress Optimized" setting
-dPDFSETTINGS=/printer  # selects output similar to the Acrobat Distiller "Print Optimized" setting
-dPDFSETTINGS=/default

(descriptions copy-pasted from askUbuntu)

I wrote a small script to test the different -dPDFSETTINGS modes.

continue reading…