Skip to content

Scale strip transverse width by full direction in get_strip_region_2d#175

Merged
Alphaharrius merged 1 commit into
mainfrom
bugfix/get-strip-region-2d
May 24, 2026
Merged

Scale strip transverse width by full direction in get_strip_region_2d#175
Alphaharrius merged 1 commit into
mainfrom
bugfix/get-strip-region-2d

Conversation

@Alphaharrius

Copy link
Copy Markdown
Owner

See #173

Summary

This PR fixes get_strip_region_2d so transverse strip width is scaled by the full input direction instead of the primitive direction.

Previously, non-primitive directions such as (2, 2) produced strips that were too narrow because the transverse bound was effectively computed in primitive-normal spacing. This change makes the transverse constraint use the rotated full direction and updates the documentation to match that geometry.

Changes

  • compute the transverse normal from (-dy, dx) instead of the primitive direction
  • scale the transverse upper bound by dx^2 + dy^2
  • update the get_strip_region_2d docstring to describe the actual strip coordinates and shell spacing
  • add regression tests for scaled diagonal strip cases on both lhs and rhs
  • bump the package version from 0.4.1 to 0.4.2

Why

width_step should reflect the strip induced by the supplied direction, not a collapsed primitive version of it. Without this fix, downstream geometry code can receive incomplete strip regions for scaled directions.

Testing

  • updated tests/test_geometry_ops.py coverage for scaled diagonal directions
  • verified expected region membership for (2, 2) and related diagonal examples

`get_strip_region_2d` was treating transverse width as if it were based on the primitive direction, which made strips too narrow for non-primitive directions like `(2, 2)`. This updates the transverse bound to use the full rotated direction scale, aligns the docstring with the actual geometry, and adds regression coverage for scaled diagonal strip cases.
@Alphaharrius Alphaharrius added this to the v0.4.2-qten milestone May 24, 2026
@Alphaharrius Alphaharrius requested a review from eyjafjallac May 24, 2026 13:41
@Alphaharrius Alphaharrius self-assigned this May 24, 2026
@Alphaharrius Alphaharrius added the bug Something isn't working label May 24, 2026

@eyjafjallac eyjafjallac left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

LGTM

@Alphaharrius Alphaharrius merged commit 99262d5 into main May 24, 2026
1 check passed
@Alphaharrius Alphaharrius deleted the bugfix/get-strip-region-2d branch May 24, 2026 13:46
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

get_strip_region_2d ignores direction scale when applying transverse width

2 participants