diff --git a/src/Base/VectorPy.xml b/src/Base/VectorPy.xml index cd1ce5b710..aed8f3c2c9 100644 --- a/src/Base/VectorPy.xml +++ b/src/Base/VectorPy.xml @@ -16,171 +16,187 @@ This is the Vector export class - This class represents a 3D float vector + Base.Vector class.\n +This class represents a 3D float vector. +Useful to represent points in the 3D space.\n +The following constructors are supported:\n +Vector(x=0, y=0, z=0) +x : float +y : float +z : float\n +Vector(vector) +Copy constructor. +vector : Base.Vector\n +Vector(seq) +Define from a sequence of float. +seq : sequence of float. - __reduce__() - Serialization of Vector objects - + __reduce__() -> tuple\n +Serialization of Vector objects. - add(Vector) - returns the sum of this and another vector - + add(vector2) -> Base.Vector\n +Returns the sum of this vector and `vector2`.\n +vector2 : Base.Vector - sub(Vector) - returns the difference of this and another vector - + sub(vector2) -> Base.Vector\n +Returns the difference of this vector and `vector2`.\n +vector2 : Base.Vector - negative() - returns the negative (opposite) of this vector - + negative() -> Base.Vector\n +Returns the negative (opposite) of this vector. - scale(Float,Float,Float) - scales (multiplies) this vector by a factor - + scale(x, y, z) -> Base.Vector\n +Scales in-place this vector by the given factor in each component.\n +x : float\n x-component factor scale. +y : float\n y-component factor scale. +z : float\n z-component factor scale. - multiply(Float) - multiplies (scales) this vector by a single factor - + multiply(factor) -> Base.Vector\n +Multiplies in-place each component of this vector by a single factor. +Equivalent to scale(factor, factor, factor).\n +factor : float - dot(Vector) - returns the dot product of the this vector with another one - + dot(vector2) -> float\n +Returns the scalar product (dot product) between this vector and `vector2`.\n +vector2 : Base.Vector - cross(Vector) - returns the cross product between this and another vector - + cross(vector2) -> Base.Vector\n +Returns the vector product (cross product) between this vector and `vector2`.\n +vector2 : Base.Vector - isOnLineSegment(Vector, Vector) - checks if Vector is on a line segment - + isOnLineSegment(vector1, vector2) -> bool\n +Checks if this vector is on the line segment generated by `vector1` and `vector2`.\n +vector1 : Base.Vector +vector2 : Base.Vector - getAngle(Vector) - returns the angle in radians between this and another vector - + getAngle(vector2) -> float\n +Returns the angle in radians between this vector and `vector2`.\n +vector2 : Base.Vector - normalize() - normalizes the vector to the length of 1.0 - + normalize() -> Base.Vector\n +Normalizes in-place this vector to the length of 1.0. - isEqual(Vector, tolerance) -> Boolean - If the distance to the given point is less or equal to the tolerance - bith points are considered equal. - + isEqual(vector2, tol=0) -> bool\n +Checks if the distance between the points represented by this vector +and `vector2` is less or equal to the given tolerance.\n +vector2 : Base.Vector +tol : float - projectToLine(Vector pnt,Vector vec) - Projects the point 'pnt' on a line that goes through the origin with the direction vector 'vec'. - The result is the vector from point 'pnt' to the projected point. - NOTE: The result does not depend on the vector instance 'self'. - NOTE: This method modifies the vector instance 'self'. - + projectToLine(point, dir) -> Base.Vector\n +Projects `point` on a line that goes through the origin with the direction `dir`. +The result is the vector from `point` to the projected point. +The operation is equivalent to dir_n.cross(dir_n.cross(point)), where `dir_n` is +the vector `dir` normalized. +The method modifies this vector instance according to result and does not +depend on the vector itself.\n +point : Base.Vector +dir : Base.Vector - projectToPlane(Vector,Vector) - projects the vector on a plane defined by a base point and a normal - + projectToPlane(base, normal) -> Base.Vector\n +Projects in-place this vector on a plane defined by a base point +represented by `base` and a normal defined by `normal`.\n +base : Base.Vector +normal : Base.Vector - - distanceToPoint(Vector) - returns the distance to another point - + distanceToPoint(point2) -> float\n +Returns the distance to another point represented by `point2`.\n. +point : Base.Vector - distanceToLine(Vector,Vector) - returns the distance between this vector and a line defined by - a base point and a direction - + distanceToLine(base, dir) -> float\n +Returns the distance between the point represented by this vector +and a line defined by a base point represented by `base` and a +direction `dir`.\n +base : Base.Vector +dir : Base.Vector - distanceToLineSegment(Vector,Vector) - returns the distance between this vector and a line segment defined by - a base point and a direction - + distanceToLineSegment(point1, point2) -> Base.Vector\n +Returns the vector between the point represented by this vector and the point +on the line segment with the shortest distance. The line segment is defined by +`point1` and `point2`.\n +point1 : Base.Vector +point2 : Base.Vector - distanceToPlane(Vector,Vector) - returns the distance between this vector and a plane defined by - a base point and a normal - + distanceToPlane(base, normal) -> float\n +Returns the distance between this vector and a plane defined by a +base point represented by `base` and a normal defined by `normal`.\n +base : Base.Vector +normal : Base.Vector - Length([Float]) -> Float - gets or sets the length of this vector - + Gets or sets the length of this vector. - x([Float]) -> Float - gets or sets the X component of this vector - + Gets or sets the X component of this vector. - y([Float]) -> Float - gets or sets the Y component of this vector - + Gets or sets the Y component of this vector. - z([Float]) -> Float - gets or sets the Z component of this vector - + Gets or sets the Z component of this vector.