Pergunta

I am writing my own PathIterator implementation.

Currently I implemented method with flatness with flatness-less one:

@Override
public PathIterator getPathIterator(AffineTransform at, double flatness) {
    return getPathIterator(at);
}

i.e. I am ignoring it.

What is the simplest way to work with flatness parameter?

My current iterator gives a series of parallel vertical lines (not connected between). How important for me to implement flatness-aware version of the iterator? Where is it used?

Nenhuma solução correta

Outras dicas

The getPathIterator() cited should return only SEG_MOVETO, SEG_LINETO, and SEG_CLOSE segment types. If your Shape has no other segment types, e.g. SEG_CUBICTO or SEG_QUADTO, the flatness is irrelevant. As a concrete example, the Rectangle2D implementation specifies that "Since rectangles are already flat, the flatness parameter is ignored."

Licenciado em: CC-BY-SA com atribuição
Não afiliado a StackOverflow
scroll top