Skip to content

Feature/rotationmutator #67

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

Open
wants to merge 5 commits into
base: master
Choose a base branch
from
Open

Conversation

blondejamtart
Copy link

Added rotation mutator, which takes a pair of axes which define a plane, a centre of rotation and a rotation amount and rotates the generated points about the specified point by the specified angle in this plane.

Copy link

@thomascobb thomascobb left a comment

Choose a reason for hiding this comment

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

I'd quite like to see a test with some hardcoded numbers in. It would be an easier way in to see what this thing is doing when you see a set of input numbers and a set of output numbers.

UAxes = Union[AAxes, Sequence[str], str]
with Anno("Centre of rotation"):
ACoR = Array[float]
UCoR = Union[ACoR, list]

Choose a reason for hiding this comment

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

Suggested change
UCoR = Union[ACoR, list]
UCoR = Union[ACoR, Sequence[float]]

# type: (UAxes, ARotationAngle, UCoR) -> None
self.angle = ARotationAngle(angle)
self.axes = AAxes(axes)
self.centreOfRotation = ACoR(centreOfRotation)

Choose a reason for hiding this comment

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

Need to check that this is 2D as well

i_up = pos[i]
j_low = pos[j]
j_up = pos[j]
if j in point.lower:

Choose a reason for hiding this comment

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

j should always be in point.lower


float_error_tolerance = 1e-12

class RandomOffsetMutatorTest(ScanPointGeneratorTest):

Choose a reason for hiding this comment

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

Suggested change
class RandomOffsetMutatorTest(ScanPointGeneratorTest):
class RotationMutatorTest(ScanPointGeneratorTest):

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