Fixes #14242. In the current dev fusing an empty shape with a face or solid no longer works (probably introduced with #14169). The reason for starting with an empty shape was the assumption that the end result would then always have a default placement. But that is only correct if multiple objects are fused. In the new version of the code fusing no longer starts with an empty shape. The default placement issue is solved by always returning a compound. Additionally the value for the Area property is now taken after offsetting and fusing the faces.
2020 May
These files define the proxy classes for "scripted objects"
defined within the workbench. The corresponding viewprovider classes
should be defined in the modules in draftviewproviders/.
Each scripted object has a creation function like make_rectangle,
a proxy class like Rectangle, and a viewprovider class
like ViewProviderRectangle.
The proxy classes define the code that manipulates the internal properties
of the objects, determining how the internal shape is calculated.
These properties are "real" information because they affect the actual
geometrical shape of the object.
Each make function in draftmake/ should import its corresponding
proxy class from this package in order to build the new scripted object.
These classes were previously defined in the Draft.py module,
which was very large. Now Draft.py is an auxiliary module
which just loads the individual classes in order to provide backwards
compatibility for older files.
Other workbenches can import these classes for their own use,
including creating derived classes.
import Draft
new_obj = App.ActiveDocument.addObject("Part::Part2DObjectPython", "New")
Draft.Rectangle(new_obj)
# Subclass
class NewObject(Draft.Rectangle):
...
As the scripted objects are rebuilt every time a document is loaded, this means that, in general, these modules cannot be renamed without risking breaking previously saved files. They can be renamed only if the old class can be migrated to point to a new class, for example, by creating a reference to the new class named the same as the older class.
For more information see the thread: [Discussion] Splitting Draft tools into their own modules