Class ClipboardSpline

java.lang.Object
com.fastasyncworldedit.core.command.tool.sweep.Spline
com.fastasyncworldedit.core.command.tool.sweep.ClipboardSpline

public class ClipboardSpline extends Spline
An implementation of a Spline using a Clipboard as source for the structure.
  • Constructor Details

    • ClipboardSpline

      public ClipboardSpline(EditSession editSession, ClipboardHolder clipboardHolder, Interpolation interpolation)
      Constructor without position-correction. Use this constructor for an interpolation implementation which does not need position-correction.
      Parameters:
      editSession - The EditSession which will be used when pasting the clipboard content
      clipboardHolder - The clipboard that will be pasted along the spline
      interpolation - An implementation of the interpolation algorithm used to calculate the curve
    • ClipboardSpline

      public ClipboardSpline(EditSession editSession, ClipboardHolder clipboardHolder, Interpolation interpolation, Transform transform, int nodeCount)
      Constructor with position-correction. Use this constructor for an interpolation implementation that needs position-correction.

      Some interpolation implementations calculate the position on the curve (used by Spline.pastePosition(double)) based on an equidistant distribution of the nodes on the curve. For example: on a spline with 5 nodes position 0.0 would refer to the first node, 0.25 to the second, 0.5 to the third, ... .
      By providing this method with the amount of nodes used by the interpolation implementation the distribution of the nodes is converted to a proportional distribution based on the length between two adjacent nodes calculated by Interpolation.arcLength(double, double).
      This means that the distance between two positions used to paste the clipboard (e.g., 0.75 - 0.5 = 0.25) on the curve will always amount to that part of the length (e.g., 40 units) of the curve. In this example it would amount to 0.25 × 40 = 10 units of curve length between these two positions.

      Parameters:
      editSession - The EditSession which will be used when pasting the clipboard content
      clipboardHolder - The clipboard that will be pasted along the spline
      interpolation - An implementation of the interpolation algorithm used to calculate the curve
      nodeCount - The number of nodes provided to the interpolation object
  • Method Details