Commit Graph

964 Commits

Author SHA1 Message Date
Abdullah Tahiri
9ba80f015c Part: Geometry Extension Python object 2019-07-14 12:37:29 +02:00
Abdullah Tahiri
55be6fdb7f Geometry Extension based on smart pointers 2019-07-14 12:37:28 +02:00
Abdullah Tahiri
41bf3fbf75 Geometry: Extensions - release any allocated dynamic memory 2019-07-14 12:37:28 +02:00
Abdullah Tahiri
622f249dcd Part: Geometry Extensions 2019-07-14 12:37:28 +02:00
wmayer
1b0d03e4ab Parametric refinement feature 2019-07-08 14:37:00 +02:00
wmayer
83844e261d improve doc string of Part.sortEdges 2019-06-20 14:41:50 +02:00
wmayer
5a326e4b50 issue #0003921: Crash when opening document with datum point intersecting line and plane 2019-06-16 19:31:06 +02:00
wmayer
53fc2f3ec9 improve exception handling Shape.distToShape 2019-06-13 21:49:13 +02:00
wmayer
98a53884dc use INCH instead of IN when setting units for STEP or IGES export 2019-06-13 12:40:01 +02:00
wmayer
a3a35d12b4 fixes 0004010: Box Selection + Part -> MakeCompound will crash FreeCAD 2019-06-12 11:20:48 +02:00
Abdullah Tahiri
026254b8ff Partial Restore: ensure line segment length when x coordinate is exactly zero
fixes #4012
2019-06-08 16:52:49 +02:00
wmayer
85fddfc54a do some security checks to make sure Py::Module is valid 2019-06-03 17:57:52 +02:00
wmayer
addb368e52 also support shapetype parameter in Part.makeRevolution() if first argument is an edge 2019-05-12 11:33:38 +02:00
Abdullah Tahiri
216926233f Part: Make 3rd party libraries into PCH 2019-05-02 07:09:22 +02:00
wmayer
dc1720a7f2 continue PCH on Part module 2019-05-01 16:10:38 +02:00
Abdullah Tahiri
51edf605b9 Part: Missing PCH header 2019-04-30 15:35:25 +02:00
tomate44
4e827194ef add a python method to cut holes in a Part.Face, from a list of wires 2019-04-29 12:33:43 -03:00
wmayer
c0ca04adf9 activate pCH on Part module 2019-04-28 15:33:25 +02:00
luz.paz
a703ae39d3 More misc. typos 2019-03-31 11:42:37 +02:00
joha2
a06fa02e73 MeshToSolid: progress indicator and slightly modified sewing tolerance dialog 2019-03-31 11:30:03 +02:00
luz.paz
2e4e9c6d4e Add some more user-facing typo fixes 2019-03-22 10:44:14 -03:00
wmayer
047a18ccb5 PVS: V601 The bool type is implicitly cast to the double type
PVS: V668 There is no sense in testing pointer against null, as the memory was allocated using the 'new' operator. The exception will be generated in the case of memory allocation error
2019-03-13 14:09:10 +01:00
wmayer
d4c3f9a264 add method to Python interface to get reflect lines of a shape 2019-02-25 10:50:38 +01:00
wmayer
cb6f65ac6c fixes 0003694: Part->Boolean->Cut should show error message if a non-solid (Shell, etc.) is selected 2019-02-21 16:55:59 +01:00
wmayer
91f8ccf7c8 fixes 0003846: unexpected result in building RuledSurface 2019-02-19 15:53:39 +01:00
wmayer
5d8cd9dba4 PVS: V522 There might be dereferencing of a potential null pointer 'Py::Vector2d().getCxxObject()' 2019-02-18 00:00:10 +01:00
wmayer
2f31efe4c3 PVS: V779 Unreachable code detected. It is possible that an error is present. 2019-02-17 20:12:56 +01:00
wmayer
b2a5f47e44 PVS: V560 A part of conditional expression is always true 2019-02-17 13:56:48 +01:00
wmayer
92716f1361 fix minor issues 2019-02-12 11:16:52 +01:00
Abdullah Tahiri
6e33785049 Part: Rearrange inheritance not to use ArcPy
============================================

Inheritance:

Geometry
- GeomPoint
- GeomCurve (GeometryCurvePy)
- - GeomBoundedCurve (BoundedCurvePy)
- - - GeomBezierCurve (BezierCurvePy)
- - - GeomBSplineCurve (BSplineCurvePy)
- - - GeomTrimmedCurve (TrimmedCurvePy)
- - - - GeomArcOfConic (ArcOfConicPy)
- - - - - GeomArcOfCircle (ArcOfCirclePy)
- - - - - GeomArcOfEllipse (ArcOfEllipsePy)
- - - - - GeomArcOfHyperbola (ArcOfHyperbolaPy)
- - - - - GeomArcOfParabola (ArcOfParabolaPy)
- - - - GeomLineSegment (LineSegmentPy)
- - GeomConic
- - - GeomCircle
- - - GeomEllipse
- - - GeomHyperbola
- - - GeomParabola
- - GeomLine
- - GeomOffsetCurve

* Note: ArcPy is also a twinclass of c++ GeomTrimmedCurve, Python ArcPy derives from Python TrimmedCurvePy.

Same functionality as before:

>>> geometries = ActiveSketch.Geometry
>>> line = geometries[1]
>>> arc = geometries[2]
>>> line
<Line segment (-97.4389,42.4463,0) (-80.7887,44.5569,0) >
>>> arc
ArcOfCircle (Radius : 19.3111, Position : (-74.6914, -23.2165, 0), Direction : (0, 0, 1), Parameter : (1.82335, 2.71597))
>>> line.FirstParameter
0.0
>>> line.LastParameter
16.783437032695776
>>> line.setParameterRange(0,20)
>>> line.LastParameter
20.0
>>> arc.StartPoint
Vector (-79.51683708894876, -4.517938119394778, 0.0)
>>> arc.EndPoint
Vector (-92.27963885411512, -15.243140671641918, 0.0)
>>> arc.setParameterRange(1.5,3)
>>> arc
ArcOfCircle (Radius : 19.3111, Position : (-74.6914, -23.2165, 0), Direction : (0, 0, 1), Parameter : (1.5, 3))
>>> geometries[1] = line
>>> geometries[2] = arc
>>> ActiveSketch.Geometry = geometries
>>> ActiveSketch.solve()
0
>>>
2019-02-11 19:13:55 +01:00
Abdullah Tahiri
dbbb1df6f8 Part: expose geometry clone support to python
=============================================

>>> geometries = ActiveSketch.Geometry
>>> geo0 = geometries[0]
>>> geo0.Tag
'a2b6883e-64d6-4348-b567-8b5e0a4896a0'
>>> geo1 = geo0.clone()
>>> geo1.Tag
'a2b6883e-64d6-4348-b567-8b5e0a4896a0'
>>> geo1.Radius = 3
>>> geo0.Tag
'a2b6883e-64d6-4348-b567-8b5e0a4896a0'
>>> geo0.Radius
30.157883192724587
>>> geo1.Tag
'a2b6883e-64d6-4348-b567-8b5e0a4896a0'
>>> geo1.Radius
3.0
2019-02-11 19:13:35 +01:00
Abdullah Tahiri
f4e4f3441f Part: Enable trimmed curves to set their parameter range, from c++ and Python
=============================================================================

>>> geometries = ActiveSketch.Geometry
>>> geo2 = geometries[2]
>>> geo2
ArcOfCircle (Radius : 27.5267, Position : (-70.4702, -31.8933, 0), Direction : (0, 0, 1), Parameter : (1.34187, 2.35619))
>>> geo2.setParameterRange(1,3)
>>> geometries[2]=geo2
>>> ActiveSketch.Geometry=geometries
2019-02-11 19:13:16 +01:00
Abdullah Tahiri
52cfac509a Part: Python Bounded Curve (bring in accordance with c++)
Inheritance correspondence:

Geometry
- GeomPoint
- GeomCurve (GeometryCurvePy)
- - GeomBoundedCurve (BoundedCurvePy)
- - - GeomBezierCurve (BezierCurvePy)
- - - GeomBSplineCurve (BSplineCurvePy)
- - - GeomTrimmedCurve (ArcPy)
- - - - GeomArcOfConic (ArcOfConicPy)
- - - - - GeomArcOfCircle (ArcOfCirclePy)
- - - - - GeomArcOfEllipse (ArcOfEllipsePy)
- - - - - GeomArcOfHyperbola (ArcOfHyperbolaPy)
- - - - - GeomArcOfParabola (ArcOfParabolaPy)
- - - - GeomLineSegment (LineSegmentPy)
- - GeomConic
- - - GeomCircle
- - - GeomEllipse
- - - GeomHyperbola
- - - GeomParabola
- - GeomLine
- - GeomOffsetCurve
2019-02-11 19:12:50 +01:00
luz.paz
c3e15d8d51 Documentation: uniformity 2019-01-30 11:08:03 -02:00
wmayer
41e46cd98a add missing header file 2019-01-27 00:05:23 +01:00
wmayer
ea44db9b57 remove Standard_OVERRIDE which is unknown for older OCCT versions 2019-01-26 23:09:14 +01:00
wmayer
cc1bb80f24 fixes 0003020: 2D offset of circle are not in the right place 2019-01-26 22:52:40 +01:00
wmayer
b5d576f465 improve whitespaces 2019-01-26 22:52:40 +01:00
wmayer
4a80a74680 fixes #0003788: Part-workbench extrude with taper angle delivers a wrong shape 2019-01-25 02:49:09 +01:00
wmayer
2aee1e8368 fixes 0003771: Memory leak in Part.Face.Surface 2019-01-23 22:38:51 +01:00
wmayer
23fe2041d9 handle also B-spline and Bezier curves in GeomCurve::closestParameter 2019-01-21 13:47:41 +01:00
wmayer
1787144dee set non-modifying functions of Python wrappers as const 2019-01-13 15:45:32 +01:00
wmayer
4f10d2fac9 support face colors when writing in OpenInventor format 2019-01-12 15:06:25 +01:00
wmayer
8eff973fc5 reduce code duplication 2019-01-03 17:33:39 +01:00
wmayer
43e5729f54 declare private intersect() function as static to make clear it doesn't belong to a GeomCurve instance 2019-01-03 15:40:59 +01:00
tomate44
990e202a5e fix intersectCC method missing some intersection points for Geom2d curves 2019-01-03 12:33:58 +01:00
wmayer
26728d9ddb fixes 0003755: Crash when using Part - Refine Shape on certain files 2018-12-31 15:06:21 +01:00
wmayer
0e80292c2f prepare for OCCT 7.3.1 2018-12-13 23:10:10 +01:00
wmayer
461884c2ea add missing headers, prepare for OCCT 7.3.1 2018-12-13 23:08:48 +01:00
wmayer
a41a130704 some additions to pR 1794:
add a special XMLAttributeError class to indicate an error when accessing a missing attribute
in PropertyContainer::Restore make error handling more flexible
2018-11-19 19:07:56 +01:00