POV-Ray export

Exporting to POV-Ray was one of the main historical reasons for writing Arabeske. While an implicit form, using material_maps, has been available for a while, the development release 1.1.7 introduces a direct export mechanism as POV-Ray source code.

The exporter exports shapes. Therefore it needs either coloured polygons or "thick" segments to be available, and cannot be invoked in modes where they are not calculated. The POV-Ray exporter is only available in "final" and "interlace" modes.

To run it, select File -> Export -> POV-Ray, then choose the filename. The default output file extension, if this feature is enabled, is ".pov", while the file selector shows .pov and .inc files. Click export

You are then prompted to choose between two export flavours:

Here is an example of the basic export style:

Basic-style sample export (35k)

Let's concentrate on the expert-style exporting. The information provided by the exported file are:

Finally, you must provide one to four macros, depending on the mode from which you exported:

Please note that the expert export does not provide any form of clipping, which means that you are likely to get much more objects that needed, and probably suitable. This clipping has to be done in your own code.

Also note that the bounding box information tells you everything about the size of the exported pattern. There is no scaling option: if you need a 10x10 output, just use the scale operator in your macros.

Sample wrapping scene

An improved version of this example is available as source code here.

General POV-Ray statements:

#include "metals.inc"
#include "colors.inc"

camera {
    up y
    right -x
    location <10, 10, -20>
    look_at <0, 0, 0>
    angle 5
}

light_source{
    <-1, -2, -5>
    rgb 1.5
}

First mandatory macro, draws a polygon using the "prism" object, using the plain colour exported from Arabeske.

#macro AraUserPolygon(A, index)
    prism{
        -1, 0,
        dimension_size(A, 1)
        #local i=0;
        #while (i<dimension_size(A, 1))
            A[i]
            #local i=i+1;
        #end
        pigment {rgb AraColors[index]}
        clipped_by{box{<-1, -.01, -1>, <1, .1, 1>}}
        rotate -90*x
    }
#end

Second macro, mandatory for "final" mode exports. It just draws segments, using AraUserSegmentThickness/2 as radius. The segments are round-capped cylinders with a golden texture.

#macro AraUserSegment(Origin, End)
    union{
        cylinder{Origin, End, AraUserSegmentThickness/2}
        sphere{Origin, AraUserSegmentThickness/2}
        sphere{End, AraUserSegmentThickness/2}
        clipped_by{box{<-1, -.01, -1>, <1, .1, 1>}}
        rotate -90*x
        texture{T_Gold_1E}
    }
#end

Finally, include the file exported from Arabeske:

#include "expert.pov"

And that's all! Adding a simple background, the result looks like:

Simple expert-style export (39k)