math.geom2d.circulinear.buffer
Class BufferCalculator

java.lang.Object
  extended by math.geom2d.circulinear.buffer.BufferCalculator

public class BufferCalculator
extends java.lang.Object

Compute the buffer of a circulinear curve or domain, and gather some methods for computing parallel curves.

This class can be instantiated, but also contains a lot of static methods. The default instance of BufferCalculator is accessible through the static method 'getDefaultInstance'. The public constructor can be called if different cap or join need to be specified.

Author:
dlegland

Constructor Summary
BufferCalculator()
          Creates a new buffer calculator with default join and cap factories.
BufferCalculator(JoinFactory joinFactory, CapFactory capFactory)
          Creates a new buffer calculator with specific join and cap factories.
 
Method Summary
 CirculinearDomain2D computeBuffer(CirculinearCurve2D curve, double dist)
          Compute the buffer of a circulinear curve.
 CirculinearDomain2D computeBuffer(PointSet2D set, double dist)
          Compute buffer of a point set.
 CirculinearContinuousCurve2D createContinuousParallel(CirculinearContinuousCurve2D curve, double dist)
          Compute the parallel curve of a Circulinear and continuous curve.
 CirculinearCurve2D createParallel(CirculinearCurve2D curve, double dist)
          Computes the parallel curve of a circulinear curve (composed only of pieces of lines and circles).
 CirculinearBoundary2D createParallelBoundary(CirculinearBoundary2D boundary, double dist)
           
 CirculinearContour2D createParallelContour(CirculinearContour2D contour, double dist)
           
static BufferCalculator getDefaultInstance()
          Returns the default instance of bufferCalculator.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

BufferCalculator

public BufferCalculator()
Creates a new buffer calculator with default join and cap factories.


BufferCalculator

public BufferCalculator(JoinFactory joinFactory,
                        CapFactory capFactory)
Creates a new buffer calculator with specific join and cap factories.

Method Detail

getDefaultInstance

public static BufferCalculator getDefaultInstance()
Returns the default instance of bufferCalculator.


createParallel

public CirculinearCurve2D createParallel(CirculinearCurve2D curve,
                                         double dist)
Computes the parallel curve of a circulinear curve (composed only of pieces of lines and circles). The result is itself a circulinear curve.


createParallelBoundary

public CirculinearBoundary2D createParallelBoundary(CirculinearBoundary2D boundary,
                                                    double dist)

createParallelContour

public CirculinearContour2D createParallelContour(CirculinearContour2D contour,
                                                  double dist)

createContinuousParallel

public CirculinearContinuousCurve2D createContinuousParallel(CirculinearContinuousCurve2D curve,
                                                             double dist)
Compute the parallel curve of a Circulinear and continuous curve. The result is itself an instance of CirculinearContinuousCurve2D.


computeBuffer

public CirculinearDomain2D computeBuffer(CirculinearCurve2D curve,
                                         double dist)
Compute the buffer of a circulinear curve.

The algorithm is as follow:

  1. split the curve into a set of curves without self-intersections
  2. for each split curve, compute the contour of its buffer
  3. split self-intersecting contours into set of disjoint contours
  4. split all contour which intersect each other to disjoint contours
  5. remove contours which are too close from the original curve
  6. create a new domain with the final set of contours


computeBuffer

public CirculinearDomain2D computeBuffer(PointSet2D set,
                                         double dist)
Compute buffer of a point set.