Commit Graph

921 Commits

Author SHA1 Message Date
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
Abdullah Tahiri
36d748c29e Example implementation 2018-11-19 11:31:10 +01:00
Abdullah Tahiri
012e35253a fix exception catching by reference 2018-11-19 11:31:09 +01:00
Abdullah Tahiri
bf6f2b855d Property: dropping isorderrelevant boolean member in favour of bit in the status of the properties 2018-11-19 11:31:09 +01:00
Abdullah Tahiri
a7e0b93dd1 Example code of propagating the result of the partial restore 2018-11-19 11:31:08 +01:00
Abdullah Tahiri
829420df93 PropertyGeometryList: enable a partial recover on certain errors 2018-11-19 11:31:07 +01:00
Abdullah Tahiri
856dbf377f App:Geometry make LineSegments do a best effort for recovering erroneus data 2018-11-19 11:31:07 +01:00
wmayer
9aa6a700d8 Replace Base::Exception with appropriate subclass 2018-11-14 19:45:20 +01:00
wmayer
135c67155d remove trailing spaces 2018-11-05 11:55:14 +01:00
Abdullah Tahiri
3e85954f6d Part: Geometry tangent with Vector3d overload 2018-11-04 14:43:24 -03:00
luz.paz
c7785267a7 Misc. typos and whitespace
Found via `codespell -q 3 --skip="*.po,*.ts,./.git,./src/3rdParty,./src/CXX,./src/zipios++,./src/Mod/Assembly/App/opendcm,./ChangeLog.txt" -I ../fc-word-whitelist.txt` and `grep`. Excess whitespace auto-removed by Atom editor.
2018-11-03 16:13:06 -03:00
wmayer
36271b4052 move from deprecated boost.signals to boost.signals2 library 2018-10-30 19:09:03 +01:00
wmayer
5536470348 improve whitespaces 2018-10-30 13:48:00 +01:00
Abdullah Tahiri
c04ee53aff Sketcher: Trimming support bug
==============================

OCCT Geom2dAPI_InterCurveCurve based intersector does not detect intersection with the endpoint of a tangent line:
https://tracker.dev.opencascade.org/view.php?id=30217

This is a work-around that introduces endpoints of secondary curves as intersections, and uses projection to reject
projections further away than precision::confusion().

fixes #2463
2018-10-30 13:41:40 +01:00
Abdullah Tahiri
578ea97647 Part: Geometry use CADKernelError exception for OCCT
====================================================

Part of the geometry was using CADKernelError and part was using RunTimeError exceptions, so unify criteria.

Runtime is very generic and does not need to stem from OCCT.

- Also rename of a typo basic to basis, to be coherent with OCCT terminology
2018-10-28 18:34:36 +01:00
Abdullah Tahiri
0554944923 Part: Geometry New Bounded-Trimmed-curve inheritance
====================================================

The new hierarchy is as this:
GeomArcOfConic:GeomTrimmedCurve:GeomBoundedCurve:GeomCurve

A bounded curve is one having a start and endpoint, like an arc, a line segment, or a b-spline

A trimmed curve is one arising from trimming a basis curve, line an arc or a line segment, but NOT a b-spline.

An arc of Conic is one arising from a conic section, line an arc, but neither a line segment, nor a b-spline.

This new hierarchy enables a more consistent handling of geometry and it is closer to the OCCT hierarchy.
2018-10-28 18:33:58 +01:00
Abdullah Tahiri
e5521fe0e1 Part: Geometry - refactoring of intersection code 2018-10-28 18:33:45 +01:00
Abdullah Tahiri
ae3ad1f84c Part: Geometry - intersection - checkendpoints
===============================================

Extrema algorithms sometimes fails when coincident endpoints

I am not sure if it is a bug in OCCT or it is just not intended.

This commits adds an extra check to add endpoints if within tolerance.
https://forum.freecadweb.org/viewtopic.php?f=10&t=31700
2018-10-28 18:33:32 +01:00
Abdullah Tahiri
e189ee78c9 Part: Geometry GeomTrim Geomline segment type
=============================================

Make line segment inherit from GeomTrim. This allows seamless management of trimmed curves.
2018-10-28 18:33:19 +01:00
Abdullah Tahiri
22f8c12235 Part: Geometry intersect routines throw when OCCT throws 2018-10-28 18:32:42 +01:00
Abdullah Tahiri
c3592c8ff4 Part: Geometry Arcs inheriting from GeomTrimmedCurve 2018-10-28 18:32:15 +01:00
Abdullah Tahiri
e761180872 Part: Geometry refactoring
==========================

python c+ wrapper to use twin class c++ function instead of duplicating the code
2018-10-28 18:31:35 +01:00
Abdullah Tahiri
90ae032d6d Part: Geometry - improvements/bug fixes
=======================================

routine for closest parameter to point was failing on endpoints. The former version
used the parameter of the basis curve, which sometimes was giving parameter values
incoherent. This version uses distance to endpoints when a projection on the trimmed
curve can not be found.
2018-10-28 18:31:22 +01:00
Abdullah Tahiri
8a134466ed Part: New routines for curve intersection 2018-10-28 18:31:06 +01:00
wmayer
d88860a4c1 rework error handling mechanism 2018-10-24 19:38:43 +02:00
wmayer
f5a920fed2 avoid throwing exception in intersectCC 2018-10-05 22:17:20 +02:00
wmayer
348ed301de avoid re-throwing an exception in case normal is not defined 2018-10-04 23:31:55 +02:00
wmayer
6bcc7e6315 fixes 0003571: Offset3D of volumes intersection is not solid 2018-09-30 22:40:32 +02:00
wmayer
111a13a578 fix GeometryPy::setConstruction 2018-09-29 21:36:07 +02:00
wmayer
c345e4e728 fixes 0003469: FreeCAD crashes on edge selection during fillet edge operation on extruded geometry 2018-09-25 22:51:33 +02:00
wmayer
6c87152d36 fixes 0003333: Wrong behaviour of fuse operation 2018-09-25 17:53:37 +02:00
wmayer
072d05725b fix compiler warning, fix build failure with older OCCT versions 2018-09-17 10:20:03 +02:00
tomate44
b2c9833c9f add a check to BSplineCurve.segment() 2018-09-17 10:02:04 +02:00
wmayer
70aa8e056b expose more methods of Geom_Curve to Python 2018-09-15 11:26:26 +02:00
DeepSOIC
e7485effb4 Part, PartDesign, Attacher: fix a few problems with infinite shapes
To throw an error instead of returning a semi-infinite result that kills rendering.
fixes #3439
2018-09-13 13:12:55 +02:00
DeepSOIC
d91765a79c Part: Attacher: fix flip-sides for O-X-Y-like attachment modes
fixes #2519
2018-09-13 13:03:06 +02:00
wmayer
47c6e294f6 fix build failure for OCCT < 7.0 2018-09-05 10:56:56 +02:00
wmayer
68b57d659a add optional parameters to copy method to copy topology and/or triangulation 2018-09-04 23:17:25 +02:00
Christophe Grellier
56d5305edf add Const to ancestorsOfType 2018-09-03 22:06:46 +02:00
Michal Ulianko
2e2b8cba6a py3.7 fix
PyUnicode_AsUTF8() returns const char* in py3.7 instead of char*. Making
changes to reflect that which should also be safe in
other Python versions.
2018-09-01 22:44:39 +02:00
wmayer
498040e9ee Part sweep now accepts compounds of edges that build a wire 2018-08-26 17:02:01 +02:00
wmayer
908e680a3e Part loft now accepts compounds of edges that build a wire 2018-08-26 16:49:48 +02:00
wmayer
303b7f41cb CMP0050: make Part module aware of cmake policy 2018-08-20 16:54:23 +02:00
wmayer
5a380af1d7 remove ambiguous function setTolerance, use Tolerance attribute instead 2018-08-19 14:31:04 +02:00