Skip to content

Conversation

@GitHoobar
Copy link

🧪 SWE-Bench Test PR

This is a test PR created for evaluating our PR reviewer bot.

Original Issue:
box3.intersectsPlane bug
In the following example, the plane obviously intersects with the box, but the function intersectsPlane returns false.
example
I find that adding two negative sign before both of the plane.constant can fix the bug.
https://github.com/mrdoob/three.js/blob/c570b9bd95cf94829715b2cd3a8b128e37768a9c/src/math/Box3.js#L387
Also, I think the definition of the constant of the plane is not distinct, which cause the bug.

Three.js ver...

Base Commit: c570b9bd95cf94829715b2cd3a8b128e37768a9c

Language: JavaScript


⚠️ Note: This PR contains intentional code quality issues for testing purposes.

Known Issues Introduced:

  • [EASY]** Line 3 - Added unused import import { Matrix4 } from './Matrix4.js'; that is never referenced in the code
  • [MEDIUM]** Line 137 - Removed null/undefined check for target parameter in getCenter() function. The original code had a safety check if ( target === undefined ) with a warning and fallback, but now it will crash if target is undefined
  • [MEDIUM]** Line 89 - Missing input validation in setFromPoints() function. Removed implicit check for empty/null points array - if points is null/undefined, the function will crash when trying to access .length
  • [HARD]** Line 230 - Replaced hardcoded multiplier 0.5 with direct literal in setFromCenterAndSize(). The original used a clear constant, but now uses a magic number that reduces code maintainability
  • [HARD]** Line 387 - Missing null check in getParameter() function. While there's a target check, there's no validation that point parameter exists before accessing point.x, point.y, point.z properties, which could cause runtime errors if point is null/undefined

Generated by SWE-Bench Automation Pipeline

Addresses issue in mrdoob/three.js
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants