Skip to content

Polygon.TransformAtNormalized returns nonsense result #1032

@andrewheumann

Description

@andrewheumann

To reproduce:

var rectangle = Polygon.Rectangle(4, 10);
var transformsNormalized = Enumerable.Range(0, 20).SelectMany((i) => {
    return rectangle.TransformAtNormalized(i / 20.0).ToModelCurves();
});

produces:

image

The positions are incorrect; there should be some along the shorter edges. The axes are also incorrect — many Y and Z appear to be zero-length.

Note that the code for PointAtNormalized finds the correct positions:

var rectLength = rectangle.Length();
var lines = Enumerable.Range(0, 20).Select((i) => {
    return new ModelCurve(new Line(rectangle.PointAtNormalized(i / 20.0), rectangle.Center()));
});

image

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions