For Curves related development is the lack of a Part::BezierSpline ( Or equivlant ) holding things back ( Same goes for Part::Surface)
I just created a 'Freehand_BSpline' in the curves workbench.
When in the python console I enter p=FreeCAD.ActiveDocument.getObject('Freehand_BSpline') followed by print(dir(p)) I get
Code: Select all
['Content', 'Data', 'DataType', 'Document', 'ExpressionEngine', 'Flags', 'FullName', 'ID', 'InList', 'InListRecursive', 'Label', 'Label2', 'LinearSegments', 'MemSize', 'Module', 'MustExecute', 'Name', 'NoTouch', 'OldLabel', 'OutList', 'OutListRecursive', 'Parametrization', 'Parents', 'Periodic', 'Placement', 'PropertiesList', 'Proxy', 'Removing', 'Shape', 'State', 'Support', 'Tangents', 'Tolerance', 'TypeId', 'ViewObject', 'Visibility', '__class__', '__delattr__', '__dir__', '__doc__', '__eq__', '__format__', '__ge__', '__getattribute__', '__gt__', '__hash__', '__init__', '__init_subclass__', '__le__', '__lt__', '__ne__', '__new__', '__reduce__', '__reduce_ex__', '__repr__', '__setattr__', '__sizeof__', '__str__', '__subclasshook__', 'addExtension', 'addObject', 'addObjects', 'addProperty', 'adjustRelativeLinks', 'dumpContent', 'dumpPropertyContent', 'enforceRecompute', 'evalExpression', 'getAllDerivedFrom', 'getDocumentationOfProperty', 'getEditorMode', 'getEnumerationsOfProperty', 'getGlobalPlacement', 'getGroupOfProperty', 'getLinkedObject', 'getObject', 'getParentGeoFeatureGroup', 'getParentGroup', 'getPaths', 'getPathsByOutList', 'getPropertyByName', 'getPropertyNameOfGeometry', 'getPropertyOfGeometry', 'getPropertyStatus', 'getPropertyTouchList', 'getStatusString', 'getSubObject', 'getSubObjectList', 'getSubObjects', 'getTypeIdOfProperty', 'getTypeOfProperty', 'hasChildElement', 'hasExtension', 'hasObject', 'isDerivedFrom', 'isElementVisible', 'isValid', 'newObject', 'purgeTouched', 'recompute', 'removeObject', 'removeObjects', 'removeObjectsFromDocument', 'removeProperty', 'resolve', 'resolveSubElement', 'restoreContent', 'restorePropertyContent', 'setEditorMode', 'setElementVisible', 'setExpression', 'setObjects', 'setPropertyStatus', 'supportedProperties', 'touch']
and print(dir(p.Shape))
Code: Select all
['Area', 'BoundBox', 'CenterOfMass', 'Closed', 'CompSolids', 'Compounds', 'Content', 'Continuity', 'Curve', 'Degenerated', 'Edges', 'Faces', 'FirstParameter', 'LastParameter', 'Length', 'Mass', 'Matrix', 'MatrixOfInertia', 'MemSize', 'Module', 'Orientation', 'ParameterRange', 'Placement', 'PrincipalProperties', 'ShapeType', 'Shells', 'Solids', 'StaticMoments', 'SubShapes', 'Tag', 'Tolerance', 'TypeId', 'Vertexes', 'Volume', 'Wires', '__class__', '__delattr__', '__dir__', '__doc__', '__eq__', '__format__', '__ge__', '__getattribute__', '__getstate__', '__gt__', '__hash__', '__init__', '__init_subclass__', '__le__', '__lt__', '__ne__', '__new__', '__reduce__', '__reduce_ex__', '__repr__', '__setattr__', '__setstate__', '__sizeof__', '__str__', '__subclasshook__', 'ancestorsOfType', 'centerOfCurvatureAt', 'check', 'childShapes', 'cleaned', 'common', 'complement', 'copy', 'countElement', 'curvatureAt', 'curveOnSurface', 'cut', 'defeaturing', 'derivative1At', 'derivative2At', 'derivative3At', 'discretize', 'distToShape', 'dumpContent', 'dumpToString', 'exportBinary', 'exportBrep', 'exportBrepToString', 'exportIges', 'exportStep', 'exportStl', 'extrude', 'findPlane', 'firstVertex', 'fix', 'fixTolerance', 'fuse', 'generalFuse', 'getAllDerivedFrom', 'getElement', 'getFacesFromSubelement', 'getParameterByLength', 'getTolerance', 'globalTolerance', 'hashCode', 'importBinary', 'importBrep', 'importBrepFromString', 'inTolerance', 'isClosed', 'isCoplanar', 'isDerivedFrom', 'isEqual', 'isInfinite', 'isInside', 'isNull', 'isPartner', 'isSame', 'isSeam', 'isValid', 'lastVertex', 'limitTolerance', 'makeChamfer', 'makeFillet', 'makeOffset2D', 'makeOffsetShape', 'makeParallelProjection', 'makePerspectiveProjection', 'makeShapeFromMesh', 'makeThickness', 'makeWires', 'mirror', 'multiFuse', 'normalAt', 'nullify', 'oldFuse', 'optimalBoundingBox', 'overTolerance', 'parameterAt', 'parameters', 'project', 'proximity', 'read', 'reflectLines', 'removeInternalWires', 'removeShape', 'removeSplitter', 'replaceShape', 'restoreContent', 'reverse', 'reversed', 'revolve', 'rotate', 'rotated', 'scale', 'scaled', 'section', 'sewShape', 'slice', 'slices', 'split', 'tangentAt', 'tessellate', 'toNurbs', 'transformGeometry', 'transformShape', 'transformed', 'translate', 'translated', 'valueAt', 'writeInventor']
No mention of poles, knots or other related Bezier stuff.
If I create a Part Bezier with pb=Part.Bezier() and print(dir(pb)) I get
Code: Select all
['Content', 'Continuity', 'Degree', 'EndPoint', 'FirstParameter', 'LastParameter', 'MaxDegree', 'MemSize', 'Module', 'NbPoles', 'Rotation', 'StartPoint', 'Tag', 'TypeId', '__class__', '__delattr__', '__dir__', '__doc__', '__eq__', '__format__', '__ge__', '__getattribute__', '__gt__', '__hash__', '__init__', '__init_subclass__', '__le__', '__lt__', '__ne__', '__new__', '__reduce__', '__reduce_ex__', '__repr__', '__setattr__', '__sizeof__', '__str__', '__subclasshook__', 'approximateBSpline', 'centerOfCurvature', 'clone', 'continuityWith', 'copy', 'curvature', 'deleteExtensionOfName', 'deleteExtensionOfType', 'discretize', 'dumpContent', 'getAllDerivedFrom', 'getD0', 'getD1', 'getD2', 'getD3', 'getDN', 'getExtensionOfName', 'getExtensionOfType', 'getExtensions', 'getPole', 'getPoles', 'getResolution', 'getWeight', 'getWeights', 'hasExtensionOfName', 'hasExtensionOfType', 'increase', 'insertPoleAfter', 'insertPoleBefore', 'interpolate', 'intersect', 'intersect2d', 'intersectCC', 'intersectCS', 'isClosed', 'isDerivedFrom', 'isPeriodic', 'isRational', 'length', 'makeRuledSurface', 'mirror', 'normal', 'parameter', 'parameterAtDistance', 'period', 'removePole', 'restoreContent', 'reverse', 'reversedParameter', 'rotate', 'scale', 'segment', 'setExtension', 'setPole', 'setPoles', 'setWeight', 'tangent', 'toBSpline', 'toNurbs', 'toShape', 'transform', 'translate', 'trim', 'value']
Which has Degree, NbPoles and functions related to a Bezier. But a Part is Not a FreeCAD Object it is a Shape.
I note that in ImportNURBS when it encounters a Bezier it creates a part.Bezier and creates a FreeCAD Object Part::Feature which it equates its Shape to, which is okay because it is a Shape, but it looses all the detailed Bezier NbPoles and functions.
So my question is. To make any real progress with the various Curve workbenches do we need Part Objects
- Part::BSplineCurve - Object equivalent of Part.BSplineCurve Shape.
- Part::BSplineSurface
- Part::BezierCurve
- Part::BezierSurface
So that all curve related workbenches can load/store the above and when the curves workbench creates a Part::BSplineCurve it can be used
directly used in one of the other curves workbenchs.