Skip to content

Conversation

saeeedtorabi
Copy link
Contributor

No description provided.

@dassaf4 dassaf4 changed the title Saeed torabi/fix lint issues Fix core-geometry lint issues Sep 14, 2025
* Return 0 if inputs are invalid or calculation fails.
*/
public override curveLengthBetweenFractions(fraction0: number, fraction1: number): number {
// TODO: lint fix changes in this function must be verified
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm just putting a comment here to make sure someone takes action on this.

Copy link
Member

@tcobbs-bentley tcobbs-bentley left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Up to 56/128 files reviewed.

* * For type checking, assume array is not empty.
*/
public front(result?: Point3d): Point3d { return this.xyz.front(result)!; }
public front(result?: Point3d): Point3d { return this.xyz.frontUnchecked(result); }
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

As far as I can tell, this will now return a zero Point3d if this.xyz is empty, while before it would have returned undefined. Obviously the old behavior was wrong, but should it throw an exception instead of returning a zero point? (Note: I don't know the correct answer to this question; I'm just verifying that the new behavior is the desired behavior.) If you want it to throw an exception, have it do this:

return expectDefined(this.xyz.front(result));

If you update this function, you should update back in the same way to be consistent.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@dassaf4 what do you think?

Copy link
Member

@tcobbs-bentley tcobbs-bentley left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Finished!

private constructor(graph: HalfEdgeGraph, tolerance: number) {
this._graph = graph;
this._edgeSet = MarkedEdgeSet.create(graph)!;
this._edgeSet = MarkedEdgeSet.create(graph) as MarkedEdgeSet;
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Another inappropriate as.

Copy link
Contributor Author

@saeeedtorabi saeeedtorabi Sep 23, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@dassaf4 If graph.grabMask() returns HalfEdgeMask.NULL_MASK then MarkedEdgeSet.create(graph) would return undefined so how can we guarantee that this does not return undefined?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Since it hasn't produced problems up until now, I would suggest just wrapping it in expectDefined. If it is undefined, expectDefined will throw an exception.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants