=============================================================================================
Use the geometry specific D0 to calculate value at parameter point.
================================================
If during assignment of weights (during the for loop iteratively setting the poles) all weights
become (temporarily) equal even though weights does not have equal values
OCCT will convert all the weights (the already assigned and those not yet assigned)
to 1.0 (nonrational b-splines have 1.0 weights). This may lead to the assignment of wrong
of weight values.
The work-around is to temporarily set the last weight to be assigned to a value different from
the current value and the to-be-assigned value for the weight at position last-to-be-assign but one.
Fixes:
https://forum.freecadweb.org/viewtopic.php?p=478701#p478702
==================================================================
GeometryExtension was originally designed to be serializable (save/restore). However,
GeometryMigrationExtension and ViewProviderSketchGeometryExtension have demonstrated the
usefulness of runtime-only GeometryExtensions.
The problem with runtime-only extensions being of a serializable type (GeometryExtension before
this commit) arises when Part::Geometry is to serialize the extensions and serialise the number
of extensions the geometry has. If runtime-only GeometryExtensions do not save a tag, then the
restore mechanism will expect more extensions that are actually in the XML file.
This commit makes GeometryExtension by default not serializable and deriving directly from
Base::BaseClass. A new class GeometryPersistentExtension is created, deriving from GeometryExtension
to provide serialisation. All Extensions requiring serialization derive from GeometryPersistentExtension
and those not requiring it from GeometryExtension directly.
This commit adapts all extensions to the new situation:
Part: GeometryDefaultExtension
Part: GeometryMigrationExtension
Sketcher: ViewProvierSketchGeometryExtension
Sketcher: SketchGeometryExtension and ExternalGeometryExtension
=============================================================================================
This commits removes the Geometry construction data member and adapts sketcher code to use
GeometryFacade to access construction information via the SketchGeometryExtension.
===================================
Encapsulate Part::Geometry data member copy process in a single function (copyNonTag).
Part::Geometry derived classes need not know the specifics of the data member of Part::Geometry.
Change the delegation of the copy of extensions from clone() to copyNonTag. Because clone() relies on
copy() and now copy() of Part::Geometry data member relies on copyNonTag(), there is no actual change
to the clone() functionality, but the copy() funcionality gains the copy of the extensions via copyNonTag().
+ rename getCurve2dFromGeom2d to makeFromCurve2d
+ add function makeFromCurve and makeFromTrimmedCurve like makeFromSurface
+ implement OffsetCurve.BasisCurve
+ fix memory leak in BRepOffsetAPI_MakePipeShellPy
========================
fixes#4087
Missing "break" in loop after finding the extension was causing segfault because of null pointer access, as the unique pointer had been std:move-d when found and was thus no longer valid.
=======================================
unique_ptr is a move only type. Therefore it may only take an rvalue.
It does not make sense a pass by value for move only types (Item 41).
==============================================================
When the geometry object is destroyed, std::vector's destructor is called, which in turn calls the destructor of the smart pointers.
If a weak_ptr corresponding to one of those shared_ptr is locked (elsewhere, if FC were multithread),
the underlaying resource will not be freed until said locked weak_ptr goes out of scope. It will then.