fix: remove planar half-space correction for on-plane distance=0 constraints #38

Open
forbes wants to merge 2 commits from fix/planar-halfspace-drag-flip into main
Showing only changes of commit 85a607228d - Show all commits

View File

@@ -283,11 +283,18 @@ def _planar_half_space(
# Use the normal dot product as the primary indicator when the point
# is already on the plane (distance ≈ 0).
if abs(d_val) < 1e-10:
# Point is on the plane — track normal direction instead
# Point is on the plane — track normal direction only.
# No correction: when combined with rotational joints (Cylindrical,
# Revolute), the body's marker normal rotates legitimately and
# reflecting through the plane would fight the rotation.
def indicator(e: dict[str, float]) -> float:
return dot_expr.eval(e)
ref_sign = normal_ref_sign
return HalfSpace(
constraint_index=constraint_idx,
reference_sign=normal_ref_sign,
indicator_fn=indicator,
)
else:
# Point is off-plane — track which side
def indicator(e: dict[str, float]) -> float: