Legend:
Page
Library
Module
Module type
Parameter
Class
Class type
Source
Source file OCADml.ml
123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161(** {1 Vectors}
Vectors for describing transformations and points in
2/3-dimensional space. *)(** 4-dimensional vector *)typev4=Gg.v4(** 2-dimensional vector *)typev2=Gg.v2(** 3-dimensional vector *)typev3=Gg.v3(** [v2 x y]
Construct a 2d vector from [x] and [y] coordinates. *)let[@inline]v2xy=Gg.V2.vxy(** [v3 x y z]
Construct a 3d vector from [x], [y], and [z] coordinates. *)let[@inline]v3xyz=Gg.V3.vxyz(** [v4 x y z]
Construct a 4d vector from [x], [y], [z], and [w] coordinates. *)let[@inline]v4xyzw=Gg.V4.vxyzw(** 2-dimensional vector type, including basic mathematical/geometrical
operations and transformations, allowing for points in 2d space, and higher
level types composed of them ({i e.g.} {!Path2.t} and {!Poly2.t}) to be
manipulated. *)moduleV2=structincludeV2(** @inline *)(** [lift p t]
Lift the 2d vector/point [t] onto the plane [p]. On partial application of
[p], a {!Affine3.t} is computed to perform the lift transform. Alias to
{!Plane.lift}. *)let[@inline]liftplanet=Plane.liftplanet(** {1 Additional 2d transformations} *)(** [affine m t]
Apply 2d affine transformation matrix [m] to the vector [t]. *)let[@inline]affinemt=Affine2.transformmt(** {1 2d to 3d transformations} *)(** [affine3 m t]
Apply 3d affine transformation matrix [m] to the vector [t], taking it into
the 3rd dimension. *)let[@inline]affine3mp=Affine3.transformm(V3.of_v2p)(** [quaternion ?about q t]
Rotate [t] with the quaternion [q] around the origin (or the point [about]
if provided), taking it into the 3rd dimension. *)let[@inline]quaternion?aboutqp=Quaternion.transform?aboutq(V3.of_v2p)(** [axis_rotate ?about ax a t]
Rotates the vector [t] around the axis [ax] through the origin (or the
point [about] if provided) by the angle [a], taking it into the third
dimension. *)let[@inline]axis_rotate?aboutaxap=Quaternion.(transform?about(makeaxa)(V3.of_v2p))end(** 3-dimensional vector type, including basic mathematical/geometrical
operations and transformations, allowing for points in 3d space, and higher
level types composed of them ({i e.g.} {!Path3.t}, {!Poly3.t}, and {!Mesh.t})
to be manipulated. *)moduleV3=structincludeV3(** @inline *)(** [project p t]
Project the 3d vector/point [t] onto the plane [p]. On partial application of
[p], a {!Affine3.t} is computed to perform the projection transform. Alias to
{!Plane.project}. *)let[@inline]projectplanet=Plane.projectplanet(** {1 Additional 3d transformations} *)(** [affine m t]
Apply affine transformation matrix [m] to the vector [t]. *)let[@inline]affinemt=Affine3.transformmt(** [quaternion ?about q t]
Rotate [t] with the quaternion [q] around the origin (or the point [about]
if provided). *)let[@inline]quaternion?aboutqt=Quaternion.transform?aboutqt(** [axis_rotate ax a t]
Rotates the vector [t] around the axis [ax] through the origin (or the
point [about] if provided) by the angle [a]. *)let[@inline]axis_rotate?aboutaxa=Quaternion.(transform?about(makeaxa))end(** {1 Transformations} *)moduleAffine2=Affine2(** Affine transformation matrices for transforming 3d vectors ({!V3.t}), and 3d shapes. *)moduleAffine3=structincludeAffine3(** @inline *)(** {1 Conversions} *)(** [project t]
Project [t] down into a 2d affine transformation matrix (z axis components
dropped). *)letproject(t:t)=Affine2.v(e00t)(e01t)(e03t)(e10t)(e11t)(e13t)0.0.(e33t)(** [of_quaternion q]
Create an affine transformation matrix equivalent to the quaternion [q]. *)letof_quaternion?transq=Quaternion.to_affine?transqendmoduleQuaternion=QuaternionmodulePlane=Plane(** {1 2-dimensional paths and polygons} *)modulePath2=Path2moduleBezier2=Bezier2moduleCubicSpline=CubicSplinemodulePoly2=Poly2(** {2 Gg re-exports} *)moduleBox2=Gg.Box2(** {1 3-dimensional paths, coplanar polygons, and meshes} *)modulePath3=Path3moduleBezier3=Bezier3modulePoly3=Poly3moduleMesh=Mesh(** {2 Gg re-exports} *)moduleBox3=Gg.Box3(** {1 Utilities} *)moduleMath=MathmoduleEasing=EasingmoduleBallTree2=BallTree2moduleBallTree3=BallTree3