Skip to content

Geometry_Engine: HashArray does not work for PlanarSurface (and most likely other types) #3540

@pawelbaran

Description

@pawelbaran

Description:

The reason for observed behaviour is the fact that in the lines below an overload of HashArray taking ICurve is called, which attempts to call other overloads with skipEndPoint argument downstream (second snippet). That throws an exception for the simple reason that most overloads do not have the parameter mentioned.

As far as I understand, the solution for that bug should be cleaning up skipEndPoint for all HashArray overloads taking sub-classes of ICurve - either implement it properly or just remove if not needed.

return obj.ExternalBoundary.HashArray(translationFactor,
comparisonConfig,
fullName.AppendPropertyName($"{nameof(obj.ExternalBoundary)}"))
.Concat(obj.InternalBoundaries.SelectMany((ib, i) => ib.HashArray(translationFactor,
comparisonConfig,
fullName.AppendPropertyName($"{nameof(obj.InternalBoundaries)}[{i}]"))
)).ToArray();

for (int i = 0; i < subParts.Count - 1; i++)
{
hashes.AddRange(HashArray(subParts[i] as dynamic,
translationFactor,
skipEndPoint: true,
comparisonConfig: comparisonConfig,
fullName: fullName.AppendPropertyName($"[{i}]"))
);
}
//Include endpoint for hashing for last curve
hashes.AddRange(HashArray(subParts.Last() as dynamic,
translationFactor,
skipEndPoint: false,
comparisonConfig: comparisonConfig,
fullName: fullName.AppendPropertyName($"[{subParts.Count - 1}]")
)
);

Test file(s):

On SharePoint

Metadata

Metadata

Assignees

Labels

type:bugError or unexpected behaviour

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions