Shapes

Learn about the different piece shapes supported by TonCut Engine and how to define them.

As you can see below, the shape definitions do not contain the size parameters like length or width. This is because the size is determined by the length and width properties of the Piece that uses the shape.

RectangleShape

Rectangle shape.

Attributes
  • veneers
    object

    An object defining the veneers on each side of the rectangle.

    Show Child Attributes

RectangleShape example

{
  "shapeType": "rectangle",
  "shape": {
    "veneers": {
      "leftVeneerId": 1,
      "rightVeneerId": 2,
      "topVeneerId": 3,
      "bottomVeneerId": 4
    }
  }
}

LinearShape

The LinearShape object describes slant angles for the linear (1D) pieces or waste.

The angles given here are always measured in the same way, regardless of the cutting device settings.

  • leftAngle
    angle mandatory

    Left slant angle measured from middle to right.

    fromMiddleToRight
  • rightAngle
    angle mandatory

    Right slant angle measured from middle to left.

    fromMiddleToLeft

LinearShape example

  {
    "shapeType": "linear",
    "shape": {
        "leftAngle": 45,
        "rightAngle": 25
    }
  }

SlantRectangleShape

Slant rectangle shape.

Attributes
  • vertLength
    length mandatory

    Length of the vertical edge shortened by the slant.

    SlantRectangleVertical
  • horzLength
    length mandatory

    Length of the horizontal edge shortened by the slant.

    SlantRectangleHorizontal
  • slantCorner

    SlantCornerenum

    mandatory

    Specifies which corner is slanted. Possible values are 'topLeft', 'topRight', 'bottomLeft', 'bottomRight'.

    SlantRectangleTopLeftSlantRectangleBottomLeftSlantRectangleTopRightSlantRectangleBottomRight
  • veneers
    object

    An object defining the veneers on each side of the rectangle.

    Show Child Attributes

SlantRectangleShape example

{
  "shapeType": "slantRect",
  "shape": {
    "vertLength": 100,
    "horzLength": 50,
    "slantCorner": "topLeft",
    "veneers": {
      "leftVeneerId": 1,
      "rightVeneerId": 2,
      "topVeneerId": 3,
      "bottomVeneerId": 4,
      "slantVeneerId": 5
    }
  }
}

LShape

L-shaped piece.

Attributes
  • vertLength
    length mandatory

    Size of the vertical leg of the L.

    LShapeVertical
  • horzLength
    length mandatory

    Size of the horizontal leg of the L.

    LShapeHorizontal
  • recessedCorner

    RecessedCornerenum

    mandatory

    Specifies which corner is recessed.

    LShapeTopLeftLShapeBottomLeftLShapeTopRightLShapeBottomRight
  • veneers
    object

    An object defining veneers on each side of the L shape.

    Show Child Attributes

LShape example

{
  "shapeType": "L",
  "shape": {
    "vertLength": 200,
    "horzLength": 150,
    "recessedCorner": "topLeft",
    "veneers": {
      "leftVeneerId": 1,
      "topVeneerId": 2,
      "rightVeneerId": 3,
      "bottomVeneerId": 4,
      "recessHorzVeneerId": 5,
      "recessVertVeneerId": 6
    }
  }
}

RightTriangleShape

Right triangle piece.

Attributes
  • rightAnglePos

    RightAnglePosenum

    mandatory

    Defines where the right angle is located.

    RightTriangleTopLeftRightTriangleBottomLeftRightTriangleTopRightRightTriangleBottomRight
  • veneers
    object

    An object defining veneers on the sides of the triangle.

    Show Child Attributes

RightTriangleShape example

{
  "shapeType": "rightTriangle",
  "shape": {
    "rightAnglePos": "bottomLeft",
    "veneers": {
      "vertVeneerId": 1,
      "horzVeneerId": 2,
      "hypoVeneerId": 3
    }
  }
}

SlopeRectangleShape

Rectangle with a sloped top edge.

Attributes
  • toWidth
    length mandatory

    Remaining width at the sloped side (defines slope depth).

    SlopeRectangleToWidth
  • slopeDirection

    SlopeDirectionenum

    mandatory

    Orientation of the slope.

    SlopeRectangleDownToLeftSlopeRectangleDownToRight
  • veneers
    object

    Veneers on each edge of the sloped rectangle.

    Show Child Attributes

SlopeRectangleShape example

{
  "shapeType": "slopeRect",
  "shape": {
    "toWidth": 50,
    "slopeDirection": "downToRight",
    "veneers": {
      "leftVeneerId": 1,
      "topVeneerId": 2,
      "rightVeneerId": 3,
      "bottomVeneerId": 4
    }
  }
}

TrapezoidShape

Trapezoid piece.

Attributes
  • leftSlopeLength
    length mandatory

    Length of the left sloping edge.

    TrapezoidLeftSlope
  • rightSlopeLength
    length mandatory

    Length of the right sloping edge.

    TrapezoidRightSlope
  • veneers
    object

    Veneers on trapezoid sides.

    Show Child Attributes

TrapezoidShape example

{
  "shapeType": "trapezoid",
  "shape": {
    "leftSlopeLength": 30,
    "rightSlopeLength": 40,
    "veneers": {
      "leftVeneerId": 1,
      "topVeneerId": 2,
      "rightVeneerId": 3,
      "bottomVeneerId": 4
    }
  }
}

OctagonShape

Octagon piece.

OctagonSymmetricOctagonNonSymmetric
Attributes
  • tlV
    length mandatory

    Top-left vertical cut length.

  • tlH
    length mandatory

    Top-left horizontal cut length.

  • trV
    length mandatory

    Top-right vertical cut length.

  • trH
    length mandatory

    Top-right horizontal cut length.

  • brV
    length mandatory

    Bottom-right vertical cut length.

  • brH
    length mandatory

    Bottom-right horizontal cut length.

  • blV
    length mandatory

    Bottom-left vertical cut length.

  • blH
    length mandatory

    Bottom-left horizontal cut length.

  • veneers
    object

    Veneers on octagon edges.

    Show Child Attributes

OctagonShape example

{
  "shapeType": "octagon",
  "shape": {
    "tlV": 20,
    "tlH": 20,
    "trV": 20,
    "trH": 20,
    "brV": 20,
    "brH": 20,
    "blV": 20,
    "blH": 20,
    "veneers": {
      "leftVeneerId": 1,
      "topVeneerId": 2,
      "rightVeneerId": 3,
      "bottomVeneerId": 4,
      "topLeftVeneerId": 5,
      "topRightVeneerId": 6,
      "bottomRightVeneerId": 7,
      "bottomLeftVeneerId": 8
    }
  }
}

EllipseShape

Elliptical piece.

Attributes
  • veneers
    object

    Single veneer definition for ellipse border.

    Show Child Attributes

EllipseShape example

{
  "shapeType": "ellipse",
  "shape": {
    "veneers": {
      "veneerId": 1
    }
  }
}

CircleShape

Circle piece.

Attributes
  • variant

    CircleVariantenum

    mandatory

    Defines circle variant.

    CircleFullCircleThreeQuartersCircleHalfCircleQuarter
  • veneers
    object

    Veneers applied to circle edges.

    Show Child Attributes

CircleShape example

{
  "shapeType": "circle",
  "shape": {
    "variant": "full",
    "veneers": {
      "outerVeneerId": 1,
      "innerVeneerId": 2
    }
  }
}

RingShape

Ring piece (circle with inner cut).

Attributes
  • innerRadius
    length mandatory

    Radius of the inner hole.

    RingInnerRadius
  • veneers
    object

    Veneers for ring edges.

    Show Child Attributes

RingShape example

{
  "shapeType": "ring",
  "shape": {
    "innerRadius": 40,
    "veneers": {
      "outerVeneerId": 1,
      "innerVeneerId": 2
    }
  }
}

AnyShape

Arbitrary shape defined by path.

Veneers are not supported for this type of shape.

Attributes
  • format
    string mandatory

    Path definition format. Currently only svg-path is supported.

  • path
    string mandatory

    Path definition string in the specified format. The geometry must form a continuous, closed contour, without self-intersections or cross cuts. Each segment must connect seamlessly with the next, and the last segment must close the shape by returning to the starting point.

    Paths must not be interrupted - the entire contour has to be defined as one continuous path. For example, this is not allowed (multiple M commands breaking the contour): M 0.0,1000.0 L 0.0,0.0 M 0.0,0.0 L 1000.0,0.0 M 1000.0,0.0 L 1000.0,250.0 M 1000.0,250.0 L 0.0,1000.0 Z

    The correct definition should be a single continuous path: M 0.0,1000.0 L 0.0,0.0 L 1000.0,0.0 L 1000.0,250.0 L 0.0,1000.0 Z

    Holes are supported. Each hole must also be a continuous, closed contour, fully contained within the main shape. Holes cannot intersect or touch the outer contour or other holes.

    The path should be expressed in TonCut's internal units (1 unit = 0.01 mm). You can also use the scale property to scale the path dimensions.

  • scale
    numberdef: 1.0

    Scaling factor applied to the path dimensions.

AnyShape example

{
  "shapeType": "any",
  "shape": {
    "format": "svg-path",
    "path": "M0,0 L100,0 L100,50 Z",
    "scale": 100
  }
}