Skip to content

Regression Elements.Geometry.Solids.Sweep #1007

@pederlh

Description

@pederlh

Describe the bug
From version 1.6.0 to 2.0.0, an exception is thrown when initializing some Sweep objects, in cases where possible earlier. A reproducible example is included below.

Test method HyparDebugging.GeometryTest.Sweepbug threw exception: 
System.ArgumentOutOfRangeException: Specified argument was out of the range of valid values. (Parameter 'The vector could not be created. One or more of the components was NaN.')
    Stack Trace:
        at Elements.Geometry.Vector3..ctor(Double x, Double y, Double z)
   at Elements.Geometry.Solids.Solid.ProjectEdgeAlong(Edge[] loop, Vector3 v, Plane p)
   at Elements.Geometry.Solids.Solid.SweepEdgesBetweenPlanes(Edge[] loop1, Vector3 v, Plane end)
   at Elements.Geometry.Solids.Solid.SweepEdges(Transform[] transforms, Edge[] openEdge)
   at Elements.Geometry.Solids.Solid.SweepFaceAlongCurve(Polygon perimeter, IList`1 holes, IBoundedCurve curve, Double startSetback, Double endSetback, Double profileRotation)
   at Elements.Geometry.Kernel.CreateSweepAlongCurve(Profile profile, BoundedCurve curve, Double startSetback, Double endSetback, Double profileRotation)
   at Elements.Geometry.Solids.Sweep.UpdateGeometry()
   at Elements.Geometry.Solids.Sweep..ctor(Profile profile, BoundedCurve curve, Double startSetback, Double endSetback, Double profileRotation, Boolean isVoid)

To Reproduce

// Works in version 1.6.0, not in 2.0.0

Polygon crossSection = Polygon.Rectangle(0.25, 0.25);

Polyline curve = new(new List<Vector3>
{
        new Vector3(x: 20.0, y: 15.0, z:0.0),
        new Vector3(x: 20.0, y: 15.0, z:1.0),
        new Vector3(x: 20.0, y: 14.5, z:1.5),
        new Vector3(x: 19.5, y: 14.5, z:1.5),
}
);

var sweep = new Elements.Geometry.Solids.Sweep(
    new Profile(crossSection),
    curve,
    startSetback: 1,
    endSetback: 1,
    profileRotation: 0,
    isVoid: false
);

Desktop (please complete the following information):

  • OS: macOS Ventura 13.4

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions