File size: 1,759 Bytes
985c397
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
# SPDX-License-Identifier: LGPL-2.1-or-later

from __future__ import annotations

from Metadata import export
from PyObjectBase import PyObjectBase
from Vector import Vector
from Placement import Placement
from typing import overload

@export(
    Constructor=True,
    Delete=True,
)
class Axis(PyObjectBase):
    """
    Base.Axis class.

    An Axis defines a direction and a position (base) in 3D space.

    The following constructors are supported:

    Axis()
    Empty constructor.

    Axis(axis)
    Copy constructor.
    axis : Base.Axis

    Axis(base, direction)
    Define from a position and a direction.
    base : Base.Vector
    direction : Base.Vector
    """

    Base: Vector = ...
    """Base position vector of the Axis."""

    Direction: Vector = ...
    """Direction vector of the Axis."""

    # fmt: off
    @overload
    def __init__(self) -> None: ...
    @overload
    def __init__(self, axis: Axis) -> None: ...
    @overload
    def __init__(self, base: Vector, direction: Vector) -> None: ...
    # fmt: on

    def copy(self) -> Axis:
        """
        Returns a copy of this Axis.
        """
        ...

    def move(self, vector: Vector, /) -> None:
        """
        Move the axis base along the given vector.

        vector : Base.Vector
            Vector by which to move the axis.
        """
        ...

    def multiply(self, placement: Placement, /) -> Axis:
        """
        Multiply this axis by a placement.

        placement : Base.Placement
            Placement by which to multiply the axis.
        """
        ...

    def reversed(self) -> Axis:
        """
        Compute the reversed axis. This returns a new Base.Axis with
        the original direction reversed.
        """
        ...