Skip to content

Conversation

@Joeycho
Copy link

@Joeycho Joeycho commented Nov 17, 2025

Current:
direction missing.
#3355

PR:
Input image has indexToWorld function. Reuse it.

@Joeycho
Copy link
Author

Joeycho commented Nov 17, 2025

@finetjul

Copy link
Member

@finetjul finetjul left a comment

Choose a reason for hiding this comment

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

Please reformat your commit message to match semantic release.

@Joeycho Joeycho changed the title use indexToWorld function, rather than separate calculation Fix (ImageMarchingSquares): use indexToWorld function, rather than separate calculation Nov 18, 2025
@Joeycho Joeycho changed the title Fix (ImageMarchingSquares): use indexToWorld function, rather than separate calculation fix (ImageMarchingSquares): use indexToWorld function, rather than separate calculation Nov 18, 2025
@Joeycho Joeycho changed the title fix (ImageMarchingSquares): use indexToWorld function, rather than separate calculation fix(ImageMarchingSquares): use indexToWorld function, rather than separate calculation Nov 18, 2025
@Joeycho Joeycho requested a review from finetjul November 26, 2025 14:06
@Joeycho Joeycho requested a review from finetjul November 28, 2025 14:54
// pixelPts = a flattened world coordinates array of [ (i,j,k), (i+1,j,k), (i,j+1,k), (i+1,j+1,k)]

// 0: i, j, k
let worldPos = indexToWorld(ijk);
Copy link
Member

Choose a reason for hiding this comment

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

please use the indexToWorld aout parameter for better performance (to avoid instantiating a new array each time)

pixelPts[2] = worldPos[2];

// 1: i+1, j, k
const ijk1 = [...ijk];
Copy link
Member

Choose a reason for hiding this comment

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

maybe you could do something like the following to avoid instantiating many arrays:

  const neighborIJK = [...ijk];
  indexToWorld()
  neighborIJK[kernelX] += 1;
  indexToWorld()
  neighborIJK[kernelY] += 1;
  indexToWorld()
  neighborIJK[kernelX] -= 1;
  indexToWorld()

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.

2 participants