Remove runtime check when constructing FunctionExpression, in order to
support future built-in function. Exception will be thrown when
evaluating the expression to inform user about the error.
This way they can be tested individually in the Python console
without needing the `Array` class at all. In the future these
methods could be moved to `DraftGeomUtils` or to `draftfunctions`.
Since the `Array` class handles three different types, they
have different sets of properties. We add them to specific functions
so that they are clearly identified.
This class was created by realthunder during the `LinkMerge`,
in de66e563e0, to demonstrate how to use the `App::Link`
objects to create Link aware arrays.
It is used by `draftobject.array` (ortho, polar, circular)
and `draftobject.patharray` to create respective Link arrays.
This class is a bit mysterious. We need more documentation
on how the properties are being set, and how the code interacts
with the arrays that use it.
Avoid `Draft.py` in the `make_circular_array` function because
it creates a circular dependency.
Use function to find the object in `make_circular_array`.
Now the make function accepts as input a `"String"` which must be
the `Label` of an object in the document, so it is easier to create
arrays interactively from the Python console.
Clean up the GuiCommand and task panel code, and avoid printing
messages to the terminal, as this is already done
by the make function.
Avoid `Draft.py` in the `make_polar_array` function because
it creates a circular dependency.
Use function to find the object in `make_polar_rarray`.
Now the make function accepts as input a `"String"` which must be
the `Label` of an object in the document, so it is easier to create
arrays interactively from the Python console.
Clean up the GuiCommand and task panel code, and avoid printing
messages to the terminal, as this is already done
by the make function.
Avoid `Draft.py` in the `make_ortho_array` function because
it creates a circular dependency.
Use internal functions to abstract the orthogonal arrays.
The `_make_ortho_array` is a simple wrapper over the general
`make_array` function.
The result is four variants:
- `make_ortho_array`
- `make_ortho_array2d`, without the Z component
- `make_rect_array`, strictly rectangular components
- `make_rect_array2d`, strictly rectangular without the Z component
Also use functions to perform checking of the inputs,
whether these are vectors, numbers (integer and floats)
or integers.
Now the make function accepts as input a `"String"` which must be
the `Label` of an object in the document, so it is easier to create
arrays quickly from the Python console.
Clean up the GuiCommand and task panel code, and avoid printing
messages to the terminal, as this is already done
by the make function.
The displacement is added to the position already defined by
the point, in order to impart an additional shift in the copy.
The rotation is also added to the original shape's rotation
by multiplying the quaternions.
Implement `onDocumentRestore` to add the new property
to older objects.
Test the inputs to the `make_point_array` function
and return `None` if there is a problem.
Now the make function accepts as input a `"String"` which must be
the `Label` of an object in the document, so it is easier to create
arrays quickly from the Python console.
Add a message deprecating the older call `makePointArray`.
Adjust the GuiCommand accordingly. Now it uses the commit
mechanism of the parent `Modifier` class so that the executed
functions are recorded in the Python console.
Clean up the `PointArray` class as well.