Commit Graph

112 Commits

Author SHA1 Message Date
wmayer
068c0e5a98 Part: modernize C++11
* use nullptr
2022-03-23 19:26:14 +01:00
Uwe
8f894ebefe [Part] remove Python.h from headers
seems not to be necessary anymore
2022-03-20 14:16:55 +01:00
wmayer
9160f06e1c Base: rename BaseExceptionFreeCADError to PyExc_FC_GeneralError 2022-03-17 14:45:48 +01:00
Uwe
67a0966398 [Part] remove some unused includes and sorting 2022-02-21 04:29:28 +01:00
wmayer
20b86e55b8 Part: expose Precision to Python 2022-01-17 12:30:45 +01:00
wmayer
ea85cf5e36 Part: expose Poly HLR algorithm to Python 2021-12-21 19:45:01 +01:00
wmayer
73a986714c Part: expose HLR algorithm to Python 2021-12-21 10:49:03 +01:00
wmayer
84c5d22ccb Part: implement Prism as extension 2021-04-05 13:05:59 +02:00
Abdullah Tahiri
11d4d6c18e Part/Sketcher: GeometryExtension/GeometryPersistentExtension split
==================================================================

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
2020-12-10 18:34:06 +01:00
Abdullah Tahiri
ec5976ec28 Part: GeometryMigrationExtension classes
========================================

This is a light-weight c++ only geometry extension to enable migration of information that was stored within
the Part WB and should be migrated to another WB (for example Sketcher WB)

It is designed so that a single extension can migrate different types of data (current and future).

When new data needs to be migrated, first a new enum bit is to be added to the class enum and new data members are to
be added to store the information within GeometryMigrationExtension class.

In the Restore() function restoring the data to be migrated, a GeometryMigrationExtension extension is added to the
geometry to be migrated with the data information and the corresponding enum bit set.

In the object to receive the migration data, onDocumentRestored() it is checked whether an extension of type
GeometryMigrationExtension is present, if yes, it is checked whether a bit used for migration is set and, if yes,
the data is retrieved and the GeometryMigrationExtension extension (preferably) removed from the Geometry object.
2020-12-10 18:34:06 +01:00
luz paz
7c43b059df Part: fix header uniformity + trailing whitespace
[skip ci]
2020-12-10 11:56:55 +01:00
wmayer
4e68025d9d Part: remove deprecated type LinePyOld 2020-10-18 14:45:31 +02:00
wmayer
e1b56f8551 Part: expose BRepFeat_MakePrism to Python 2020-10-16 13:50:29 +02:00
wmayer
12155f4aab Part: [skip ci] harmonizing the way to add sub-modules to Part module 2020-10-10 11:44:51 +02:00
wmayer
9c20ce05ed Part: [skip ci] expose ShapeUpgrade_UnifySameDomain to Python 2020-10-05 16:57:16 +02:00
wmayer
312a4652f6 Part: [skip ci] expose BRepOffsetAPI_MakeFilling to Python 2020-09-30 01:19:30 +02:00
wmayer
00e0e7745c Part: expose GeomPlate algorithm to Python 2020-09-28 18:46:35 +02:00
wmayer
ffa1da617f Python: [skip ci] expose Python types in their corresponding modules 2020-09-21 15:04:26 +02:00
wmayer
fdc07cb6c9 Py3.8: [skip ci] missing initializer for member '_typeobject::tp_vectorcall' [-Wmissing-field-initializers] 2020-06-08 14:40:00 +02:00
wmayer
4142fb90f1 Part: make reverse function parametric 2020-01-29 16:43:35 +01:00
Zheng, Lei
6da72b9859 Part: changes to Part Module
* Added Part::Feature::getTopoShape/getShape() function that can obtain
  shape from any object with proper implementation of getSubObject(). It
  can even construct compound from group object with proper implementation
  of getSubObjects().

* Modified ViewProviderExt to work on any object, because it now obtain
  the shape using Part::Feature::getShape()

* Modified various Part features to obtain base/tool shapes using
  Part::getShape(), which allows them to be any type of object,
  including Link and groups.

* Modified various Part command to relax type requirement on selected
  objects.

* Add support of link and group to dimension, and add dimension refresh
  command

* Support link and group in simple command command, and add a few more
  copy command variations.

* Add special handling of 'Shape' attribute in PropertyContainerPy and
  use Part::Feature::getShape() to return shape for any object without
  Shape property. This allows many python feature work with any object
  without modification.

* GeometrySurface/CurvePy, add convenience attribute 'Rotation'

* TopoShapePy:

    * Extended support of sub shape attribute, e.g. Compound1, Solid2,
      SubShape3 ('SubShape' is used to access child shape of a compound)

    * makeWires(), new API to sort and return wires given a list of edges.

    * transformed/translated/rotated/scaled(), return a new shape with
      some transformation.

    * findPlane(), find the plane of a planar shape

    * isCoplanar(), check if two shape are coplanar
2019-08-17 15:08:35 +02:00
Abdullah Tahiri
a43c29ccd4 Part: Default geometry extensions for boolean and double 2019-07-14 12:37:35 +02:00
Abdullah Tahiri
fb5e8b4df7 Part: GeometryDefaultExtensions template
========================================

Generalisation of code for a default geometry extension in the form of a template.

Default geometry extensions provide a standard interface for an extension having a single stored value (e.g. one int or one string).

Python implementation must be provided separatedly.
2019-07-14 12:37:31 +02:00
Abdullah Tahiri
b5f5d1c32f Part: GeometryStringExtension to extend a geometry by a string 2019-07-14 12:37:30 +02:00
Abdullah Tahiri
9cb2863a2e Part: Expose GeometryIntExtension python type 2019-07-14 12:37:30 +02:00
Abdullah Tahiri
7828c34ffe Part: Standard geometry extension adding an integer value 2019-07-14 12:37:30 +02:00
Abdullah Tahiri
2400d63d70 Part: Geometry Extensions 2019-07-14 12:37:28 +02:00
wmayer
787f5184e8 Parametric refinement feature 2019-07-08 14:37:00 +02:00
wmayer
1b26173580 use INCH instead of IN when setting units for STEP or IGES export 2019-06-13 12:40:01 +02:00
wmayer
e02695b91f Replace Base::Exception with appropriate subclass 2018-11-14 19:45:20 +01:00
Abdullah Tahiri
b1858f2cf4 Part: Geometry Arcs inheriting from GeomTrimmedCurve 2018-10-28 18:32:15 +01:00
wmayer
a53027342e rework error handling mechanism 2018-10-24 19:38:43 +02:00
wmayer
8ce343291b py3: fox compiler warnings
issue 0000995
2017-06-04 00:17:57 +02:00
wmayer
02fb687844 do code cleanup
move BOPTools from Part to PartGui because it depends on GUI
2017-03-01 21:58:04 +01:00
looooo
a388a9d72d py3: Part: App: gathering commits relevant for Mod/Part/App 2017-03-01 17:10:46 +01:00
wmayer
ed23c0d3c4 py3: ported Part to python3 2017-03-01 16:38:53 +01:00
wmayer
81c3bc6ef5 make new Part.Line behaviour the default 2017-02-09 21:47:25 +01:00
wmayer
6b0a0ff9c7 issue #0001935 2017-02-05 19:00:45 +01:00
Abdullah Tahiri
b277620138 Part: GeomBSpline extension for basic BSPline Sketcher support
==============================================================

1) Basic set/get interface for poles, weights, knots and multiplicities

2) Introduction of GeomBoundedCurve class replicating OCC hierarchy. Why? To provide seamless start/end point interface for any bounded curve, i.e. Bezier, BSpline,

Note: The ArcOfConic start/end point interface relies on GeomTrimmedCurve, and introduces CCW/CW correcting code which relies on Axis. Axis are introduced in GeomConic and are
not part of GeomBounded.

Note 2: In the future, it may be thought to make GeomArcOfConic (the equivalent of GeomTrimmedCurve) deriving from GeomBoundedCurve, as to fully replicate OCC hierarchy. GeomBoundedCurve
defines the functions as virtual to allow seamless integration.
2017-01-05 11:58:33 +01:00
Stefan Tröger
d0d4d6bc07 Port Attacher codde to the extension framework
AttachableObjects are desired in multiple occasions, and the current AttachableObject is not flexible enough to handle all cases. Hence the code is portet to an extension, which gives the needed flexibility.
2016-12-07 06:41:40 +01:00
wmayer
932eab40fc add class GeomArcOfConic to reduce code duplication 2016-12-04 14:20:56 +01:00
wmayer
adf3cc0f95 add class GeomConic to reduce code duplication 2016-12-04 11:36:50 +01:00
wmayer
fa585583d8 set type names of geom classes 2016-12-03 13:26:12 +01:00
wmayer
c6529d21fe implement Line class 2016-12-01 00:04:13 +01:00
wmayer
e96370f820 add class LineSegment 2016-11-30 16:26:21 +01:00
wmayer
1348fe6bc1 implement Line2d 2016-11-26 15:30:00 +01:00
wmayer
9bdad96a69 add Python wrappers for Geom2d classes 2016-11-22 14:09:19 +01:00
wmayer
689d2e42a9 wrapper for Geom2d package 2016-11-21 18:17:10 +01:00
wmayer
9ff8260608 + remove GeomHermiteCurve class and add its methods to GeomBSplineCurve 2016-10-29 15:08:17 +02:00
wmayer
18a5ff83b1 add support of Hermite curves 2016-10-26 10:28:23 +02:00