Correct.
Not quite. rot is the Rotation operator that would rotate the vector r1 into r2. It implicitly contains both an angle and an axis.
If we are in our sketcher case where r1 and r2 lie in the XY plane, the axis is the z-axis: Vector(0, 0, 1), but here we are treating the general 3D case.
So
Code: Select all
rot.Angle # angle from r1 to r2
rot.Axis # axis of rotation from the right hand rule, twisting r1 into r2
Code: Select all
identity = Rotation(0,0,0,1)
Code: Select all
identity = Rotation(Vector(0,0,1), 0) # 0 degrees around z-axis
Code: Select all
rothalf = rot.slerp(identity, 0.5)
returns a rotation halfway between the identity and rot. It has the same axis as rot, but half the angle. slerp is designed for this purpose, but is more general, since the two rotations could have different axes, and the angle to be interpolated is not directly accessible, as it is in our application.
In this case, we could have written
Code: Select all
import math
rothalf = Rotation(rot.Axis, math.degrees(rot.Angle/2))
i
Code: Select all
IntermediatePt = center + rothalf.multVec(r1) returns the point that bisects the arc?
When you move objects around in three dimensional space, without changing their shape (what is referred to as rigid body motion), all possible moves are a combination of rotation and translation. Translations are described by vectors (e.g. Placement.Base), and rotations by Rotation (e.g. Placement.Rotation).
A point on a body p is translated by adding the translation vector t
Code: Select all
p[ -> t.add(p) = t + p
Code: Select all
p-> rot.multVec(p)