-
-
Notifications
You must be signed in to change notification settings - Fork 88
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add Plane.reverse()
method
#546
Comments
Example of operator precedence issue: Plane.reverse = lambda s: -s
print(-Plane.XY.offset(10.0))
print((-Plane.XY).offset(10.0))
print(Plane.XY.reverse().offset(10.0))
|
Done. |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
It might be good to add a
Plane.reverse()
method, analogue toAxis.reverse()
andVector.reverse()
.Pros:
Axis
implements both__neg__
andreverse()
,Vector
implements both__neg__
andreverse()
, whilePlane
currently only implements__neg__
.Plane.reverse()
helps with discoverability due to auto-complete.-Plane.XY.offset(10.0)
applies the offset first, and then the reversal.(-Plane.XY).offset(10.0)
is required to first reverse and then offset.Plane.XZ.reverse().offset(10.0)
works as intended.Cons:
Axis.reverse()
corresponds directly to the OCCT methodReversed
.Plane.reverse()
doesn't; butVector.reverse()
also doesn't.Axis
andVector
also.Plane.reverse_transform()
, which is close in name.invert()
is a more appropriate name.Overall, I think
Plane.reverse()
makes sense, but let me know. Looks like an easy PR; happy to submit one if you'd like.The text was updated successfully, but these errors were encountered: