The name of the argument, `projection`, in the old function
is incorrect; it should be `direction`, which was the original
argument's name when this method was split into its own module
(6c00fcf).
After the reorganization of the Draft Workbench,
the `'DraftText'` objects are now of Proxy.Type `'Text'`.
In the `DraftAnnotation` class the `__setstate__` method
was defined to automatically migrate the Type.
The `Arch SectionPlane` only handles `'Text'` objects. If for
some reason there is still an old `'DraftText'` object
which has not been migrated to the new Type, it won't be found.
This is corrected by adding `'DraftText'` to the list of objects
to process.
If the object has a `Shape` it uses its bounding box to enlarge
the page size of the SVG. If it does not have a `Shape`
("Draft Text", "Draft Dimension", other `App::FeaturePython`)
it uses `Draft.get_bbox` to calculate one bounding box
from the viewprovider if possible.
Normally the bounding box is taken from `Shape.BoundBox`.
Certain objects don't have a `Shape`, like `App::FeaturePythons`,
so the bounding box is calculated from `ViewObject.RootNode`.
If it's not a circle nor ellipse nor straight line
convert the curve to BSpline. Move into a subfunction.
Improve a few varible names to be more verbose, like `vertex`
and `edge`.
The angle between the curve and plane is tested for being coplanar,
0 or 180 degrees. The negative test is done earlier so that the
return is done earlier, and the rest of the code is not indented.
For the try-except blocks we should trap a specific `Exception`,
not just any type. It seems string handling was an issue
with Python 2, so the string needed UTF8 decoding.
When the software no longer supports Python 2, these
blocks can be removed.
The added functions are test_scale_part_feature_arcs, test_scale_part_feature_lines, test_scale_rectangle, test_scale_spline and test_scale_wire.
When comparing vectors and floats a tolerance of 1e-8 is used, but only for the midpoints of the arcs in test_scale_part_feature_arcs is this tolerance required. Scaling a part feature is not possible with the Draft_Scale command, but Draft.scale does support it.
As suggested by @Vanuan. and already implemented in new experimental BIM Wall: 1084a4b0a9
Draft: updated Draft Edit
thanks to the suggestions by @Vanuan
Draft: further bugfixing and improvements in Draft_Edit
Draft: moved Draft_Edit preview code into respective GuiTools
Small fixes where the `get_svg` function is used, for example,
in the (obsolete) `DrawingView` class and `Arch_SectionPlane`.
Also update the unit tests accordingly.
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.
Also rename `getSVG` to `get_svg`.
Instead of testing `obj.isDerivedFrom('Part::Feature')`
we test for a Shape, `hasattr(obj, 'Shape')`.
This is to support the SVG generation of `App::Links`.