Skip to content

Feature/rotationmutator#67

Open
blondejamtart wants to merge 5 commits intomasterfrom
feature/rotationmutator
Open

Feature/rotationmutator#67
blondejamtart wants to merge 5 commits intomasterfrom
feature/rotationmutator

Conversation

@blondejamtart
Copy link
Copy Markdown

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
Copy Markdown

@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]
Copy link
Copy Markdown

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)
Copy link
Copy Markdown

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:
Copy link
Copy Markdown

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):
Copy link
Copy Markdown

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