It takes a `Shape` and replicates it around a path, while at the
same time adding a rotation to each copy. This can be used to create
a twisted "ribcage" from a frame-like object, which can be used
in a more complicated `Shape`, for example, a tunnel or bridge
object.
This follows from the migration of the Layer code
done in 831e517717.
In the older `makeLayer` function, the parameters `drawstyle`
and `transparency` could be `None`; in the new `make_layer` function,
`drawstyle` must be an explicit string, and `transparency`
must be a number. If not provided, they use default values.
Move `make_layer` to `draftmake`; `Layer` and `LayerContainer`
to `draftobjects`; `ViewProviderLayer` and `ViewProviderLayerContainer`
to `draftviewproviders`.
The make function and the classes are imported in `Draft.py`
to support the usage of the older `VisGroup`.
This includes `make_arc_3points`, `make_array`, `make_bezcurve`,
`make_block`, `make_bspline`, `make_circle`, `make_circulararray`,
`make_clone`, `make_copy`, `make_dimension`, `make_drawingview`,
`make_ellipse`, `make_facebinder`, `make_fillet`, `make_label`,
`make_line`, `make_orthoarray`, `make_patharray`, `make_point`,
`make_pointarray`, `make_polararray`, `make_polygon`,
`make_rectangle`, `make_shape2dview`, `make_shapestring`,
`make_sketch`, `make_text`, `make_wire`, `make_wpproxy`.
These are added to the `draftmake` Doxygen group
so that the functions contained in each module are listed
appropriately in the automatically generated documentation.
The old `convertDraftTexts` function was moved from the `Draft.py`
module to the `draftutils.utils` module; however, here it is
not possible to use because the `makeText` function
is not accessible. Therefore, the function is moved to
`draftmake.make_text`.
Various improvements in style, PEP8, spacing, docstrings.
The list of strings is set to empty before being assigned again.
This solves a problem of the text not being updated correctly.
In the past some `try-except` blocks were there to catch and
ignore certain exceptions that apparently were caused by a
race condition, where certain properties are not assigned
to the object before they are used. These errors
don't seem to occur in v0.19, so we removed the exception
handling. We leave comments mentioning the issue
in case it re-appears.
The `DisplayMode` is swapped, so now `'2D text'` means that the
text always faces the camera, and `'3D text'` means that the
text can be positioned in different orientations in the 3D space.
This is consistent with the `Draft Label` behavior.
A function `draftutils.gui_utils.migrate_text_display_mode`
is provided to help migrate older objects of type `Text`
or `DraftText` to the new display mode.
A single `make_dimension` handles three types of dimensions,
(1) simple linear, (2) linear linked to an object, and (3) linked
to a circular edge.
So, we provide a new function, `make_radial_dimension_obj`,
to handle the third case. In this way we can check the input
parameters much better.
We adjust the `Draft_Dimension` Gui Command accordingly.
A single `make_dimension` handles three types of dimensions,
(1) simple linear, (2) linear linked to an object, and (3) linked
to a circular edge.
So, we provide two new functions, `make_linear_dimension`
and `make_linear_dimension_obj`, to handle the first two cases.
In this way we can check the input parameters much better.
We adjust the `Draft_Dimension` Gui Command accordingly.
Previously the `make_dimension` and `make_angular_dimension`
functions were in `draftobjects/dimension.py`.
Now they are moved to `draftmake/make_dimension.py`.
The original `makeAngularDimension` function requires angles
in radians which is counterintuitive for most cases. Also
the order is `[big, small]`.
The new function `make_angular_dimension` accepts angles
in degrees, and the order is `[small, big]`. The older
function is retained for compatibility purposes.
Also perform several improvements such as PEP8 cleanup,
writing complete docstrings, type checking the input arguments,
and depreacting the older call.
The `Draft.py` module, Gui Command, unit test, and test script
are updated accordingly.
Before, the `make_label` function had a `target` parameter
that had to be a `LinkSub`, `[Part::Feature, "Edge1"]`.
However, it is easier to pass the individual components
separately using two parameters, `target_object` and `subelements`,
which can then be assembled into `[target_object, subelements]`.
The second element is optional, so it can be set to `None`,
and then the second element will be converted to an empty list,
`[target_object, []]`, as required by the Label's underlying `Target`
property.
Also perform several improvements such as PEP8 cleanup,
writing complete docstrings, type checking the input arguments,
and deprecating the older call.
Update `Draft.py`, the Gui Command, the unit test, and test script
as well.