import { Vector3 } from "./Vector3";
/** A plane segment, described by a point locating the start and two directions */
var PlaneSegment = /** @class */ (function () {
    function PlaneSegment(point, borderU, borderV) {
        this.point = point;
        this.borderU = borderU;
        this.borderV = borderV;
    }
    //#region Convert
    /**
     * Get the plane that the segment resides in. The normal of the plane is the cross product of the two border vectors.
     * @param segment
     * @returns {Plane}
     */
    PlaneSegment.convertToPlane = function (segment) {
        var normal = Vector3.crossProduct(segment.borderU, segment.borderV);
        return {
            point: segment.point,
            normal: normal,
        };
    };
    return PlaneSegment;
}());
export { PlaneSegment };
/** A plane, described by its normal and a point that lies in it */
var Plane = /** @class */ (function () {
    function Plane(_normal, _point) {
        this.normal = _normal;
        this.point = _point;
    }
    //#region Create / Init
    /** Convenience function for creating a Plane, cloning the parameters */
    Plane.create = function (point, normal) {
        return {
            point: Vector3.clone(point),
            normal: Vector3.clone(normal),
        };
    };
    //#endregion Create / Init
    //#region Clone / Copy
    /** Convenience function for cloning a Plane */
    Plane.clone = function (plane) {
        return Plane.create(plane.point, plane.normal);
    };
    return Plane;
}());
export { Plane };
