Currently, the bounding points for a rectangle or an image are only the upper left corner and the bottom right corner (if the width and height are specified).
This pull request suggests that the other two corners of the rectangle need to be specified as bounding points (in case the rectangle is rotated by other than an integral multiple of 90 degrees).
It also adds helper functions `rectPoints` and `rectPoints'` to reduce code duplication.
`Reanimate.Svg.BoundingBox.boundingBox` computes bounding boxes on a best-effort basis but currently makes no effort for `svg` nodes. This pull request proposes that the bounding box for svg nodes should be at least estimated based on the document's width and height.
In addition, the addition of helper functions `ellipsePoints` and `toUserUnit'` reduce code duplication in function `svgBoundingPoints`.
This pull request:
* causes `mkAnimation` to check (at run time) that the duration is positive, and exports new `unsafeMkAnimation` which still does not check;
* uses the 'smart' constructor, and its check, in `staticFrame`, `pause`, `pauseAtBeginning`, `adjustDuration`, `repeatA`, `takeA` and `dropA`. Consequently, `takeA` and `dropA` do not need to clamp;
* allows `pauseAtBeginning` and `pauseAtEnd` to have a zero duration (and, consequently, `pauseAround`);
* allows `dropA` to drop 'nothing'; and
* expands Haddock documentation of functions introducing duration, to explain valid values of duration.
It also reformats some other Haddock comments with very long lines, so that code lines are no longer than 80 characters.
The link checker is reporting that the links in documentation to inkscape.org and wiki.gnome.org/Projects/LibRsvg are broken (with code 403 - Forbidden) when they are good links.
This pull request corrects the Haddock documentation for `Reanimate.Povray' (incorrect narrative for some functions yielding `Tree' and inconsistent width x height dimensions).
It also extends the introductory Haddock documenation to describe the structure of the functions exported and the use of their arguments, common to all the functions.
This pull request updates the POV scripts in the two POV-Ray examples to avoid the warning messages in POV-Ray 3.7 (released November 2013).
POV-Ray 3.7 requires the `version` directive.
POV-Ray 3.7 considers the `assumed_gamma` keyword to be mandatory.
POV-Ray warns when a `polygon` is not closed.
POV-Ray warns when a scaling component is omitted.
This pull request proposes an additional subsection in the documentation explaining to Windows users how they can obtain the FFmpeg, dvisvgm, POV-Ray, Blender, rsvg-convert, Inkscape, ImageMagick and LaTeX/XeLaTex dependencies.
Further to pull request #225, I realised subsequently that the common code in the two `POVRay.mkPovrayImage'` functions could be returned to module `Reanimate.Povray`, and all that needed to be Windows- or Unix-like-specific was a `runPOVRay` function.
This pull request does that refactoring.
This pull request reflects code changes made to be able to use POV-Ray for Windows, Version 3.7.0.msvc10.win64.
The changes have been tested on Windows 10 but not on unix-like operating systems. However, I don't think the code for unix-like operating systems has been affected.
The reason for the changes is explained below.
1. The POV-Ray for Windows executable is named `pvengine64.exe` on 64-bit Windows, not `povray
I've created two modules `POVRay`, specified separately for `windows` and `unix`, that export `povrayApp :: String`, yielding the correct name of the executable. The function is used in place of `"povray"` (eg in `Reanimate.Driver.Check.hasPovray`).
2. Generated file names containing `$` cause problems under PowerShell, due to automatic variables, and file names on Windows are not case sensitive
I've changed the 64-character `alphabet` in `Reanimate.Cache.encodeInt` for a 32-character one which includes only capital letters and digits. This affects both Windows and unix-like operating systems. (An alternative would be versions of `encodeInt` specified differently for `windows` and `unix`.)
3. POV-Ray for Windows requires the special command line option `/EXIT` to return
I've moved `Reanimate.Povray.mkPovrayImage'` to the two modules `POVRay`. In the `windows` version, `/EXIT` is now added to the list of switches passed to the POV-Ray executable.
4. POV-Ray for Windows cannot parse switches enclosed in `""` as switches
The cause of the problem is described in more detail in the comments in the source code of module `POVRay`.
As a work around, in the `windows` version of `mkPovrayImage'`, the POV-Ray command is written to a temporary batch file and it is that batch file which is passed to `runCmd`.
Other matters
In addition to the above, POV-Ray 3.7 includes 'Script I\O Restrictions` which can prevent the writing of files. These need to be disabled in the POV-Ray for Windows GUI (under the Options menu).
Extending `mkColor :: String -> Texture` to yield `FillNone` for "none" would allow (for example) `withFillColor "none"` to 'turn color off'. For some users, that may be more intuitive and expressive than `withFillOpacity 0.0`.
The Haddock documentation is updated, accordingly.
The current version of inkscape is 1.1.1. Its command line changed at some point and no longer includes `--without-gui`, `--file` or `--export-png`. See https://inkscape.org/doc/inkscape-man.html.
What was once:
~~~
inkscape --without-gui --file=test.svg --export-png=test.png
~~~
is now:
~~~
inkscape --export-type=png test.svg
~~~