1234567891011121314151617181920212223242526272829moduleScad=ScadmoduleText=TextmoduleColor=ColormoduleMultMatrix=MultMatrixmoduleRotMatrix=RotMatrixmoduleQuaternion=Quaternion(** 3-dimensional vector type.
In addition to basic math and vector operations, relevant transformation
functions (and aliases) are mirroring those found in {!module:Scad} are
provided. This allows for points in space represented by this type to moved
around in a similar fashion to {!Scad.t}. *)moduleVec3=structincludeVec3(** [quaternion q t]
Rotate [t] with the quaternion [q]. *)letquaternion=Quaternion.rotate_vec3(** [quaternion_about_pt q p t]
Translates [t] along the vector [p], rotating the resulting vector with
the quaternion [q], and finally, moving back along the vector [p].
Functionally, rotating about the point in space arrived at by the initial
translation along the vector [p]. *)letquaternion_about_pt=Quaternion.rotate_vec3_about_ptend