10.2. Cut and Fold models

Anableps allows creating cut-and-fold models out of 3D bodies, via the powerful cut-and-fold operator

../_images/cutandfold1.png

A stellated dodecahedron and its cut-and-fold pages (see code here)

From a model, you can create a cut-and-fold. cutAndFold is actually a set of pages, produced out of one or several bodies. Let’s look at the following example:

c = icosahedron : .volume 45cm3

c.surface = map : .file mytexture.png .scale 1.2 \
    .rotate 45deg .offset 4 5 cm

pages = cutAndFold {
    flaps.width : 4mm
    flaps.color : yellow
    page.size  : A4
    page.margin : 1cm
    pieces.padding    : 2mm         # amount of minimum padding between shapes
    pieces.padding.transgression:  5%    # maximum transgression allowed from the given padding
    pieces.maxSize  : 10cm2         # maximum size for pieces
}

print booklet: .fiename output.pdf

10.2.1. Parameters

  • bodies : which bodies enter for the cut-and-fold procedure
  • scale: scale to print the objects
  • flaps.color: the color for the flaps going to be generated
  • flaps.width: the width (a distance measure) for normal flaps. There could be flaps narrower than this, if needed.
  • flaps.angle: On curved surfaces, the angle to create a new flap
  • pieces.padding: padding among the pieces
  • pieces.maxSize: max size of a piece
  • pieces.padding.transgression: how much can be together in special cases
  • page : a generic page as template for the pages created

Todo

an example of flap angle

Example:

cutAndFold c {

    .bodies myUfo          # which bodies are to be displayed
    .scale 1:10            # allows to set the scale
    .flap.color white
    .flap.width 2cm        # thickness of the flaps
    .flap.angle 10deg      # how many flaps in curves
    .minFeature 2mm        # minimum feature size that is converted
    .tags numbers          # make the tags as number
}

The cutAndFold c object contains pages:

print c .as ovni.pdf

is the same as:

print c.pages

10.2.1.1. How it works

the cut and fold object ask for surfaces. For the curves surfaces, creates a set of flat surfaces, according with the coarse specification From there, creates a graph Now, it tries to fit the graph in pages, splitting on some points. Its an alpha-beta tree traversal? this returns a set of pages

The arranger, later just fits shapes into pages.