Skip to content

Solid.SweepFaceAlongCurve not respecting Transform zAxis twist #866

@sanchez

Description

@sanchez

I have implemented a custom ICurve with the following logic to generate the frames:

public Transform[] Frames(double startSetback = 0, double endSetback = 0)
{
    Transform[] transforms = _line.Frames(startSetback, endSetback);
    Transform[] newTransforms = new Transform[transforms.Length];

    for (int i = 0; i < transforms.Length; i++)
    {
        Transform transform = transforms[i];
        Plane plane = new Plane(transform.Origin, transform.ZAxis);

        Vector3 realUp = plane.ClosestPoint(Vector3.ZAxis + transform.Origin) - transform.Origin;
        Transform newTransform = new Transform(transform.Origin, realUp, transform.ZAxis);

        newTransforms[i] = newTransform;
    }

    return newTransforms;
}

I have noticed in the viewer though that when I pass this curve into the Solid.SweepFaceAlongCurve it is not respecting the original transforms rotation around the zAxis of the transform:

image

Here the purple geometry is the result of the sweep, with arrows being Transform.ToModelCurves() and an additional arrow on the realUp to verify the xAxis is correctly set in the transform. The problem is on the upper half of the geometry the Solid result has twisted but the transforms have not.

Expected behavior
For the solid operation to respect the xAxis configuration of the Transform on the curve

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions