Commit Graph

87 Commits

Author SHA1 Message Date
Abdullah Tahiri
10b12ddedb fix exception catching by reference 2018-11-19 11:31:09 +01:00
Abdullah Tahiri
591718f918 App:Geometry make LineSegments do a best effort for recovering erroneus data 2018-11-19 11:31:07 +01:00
wmayer
fbb8e86cbf remove trailing spaces 2018-11-05 11:55:14 +01:00
Abdullah Tahiri
6f42f3dacc Part: Geometry tangent with Vector3d overload 2018-11-04 14:43:24 -03:00
Abdullah Tahiri
7effa68eeb 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
649d115afb 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
0ed7b1d691 Part: Geometry - refactoring of intersection code 2018-10-28 18:33:45 +01:00
Abdullah Tahiri
c946de8fb4 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
4d1e981138 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
396998467b Part: Geometry intersect routines throw when OCCT throws 2018-10-28 18:32:42 +01:00
Abdullah Tahiri
b1858f2cf4 Part: Geometry Arcs inheriting from GeomTrimmedCurve 2018-10-28 18:32:15 +01:00
Abdullah Tahiri
9e349c33a8 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
f301feec31 Part: New routines for curve intersection 2018-10-28 18:31:06 +01:00
wmayer
a0916a9a66 avoid re-throwing an exception in case normal is not defined 2018-10-04 23:31:55 +02:00
wmayer
171e652047 fix -Wabsolute-value 2018-08-17 09:47:38 +02:00
wmayer
01c140be28 fix warnings 2018-08-08 18:02:59 +02:00
Markus Lampert
0b40519f3f Changed all catch types to references for polymorphic exceptions. 2018-08-08 15:45:30 +02:00
Abdullah Tahiri
de9e7cc942 Part: Improvement to closest parameter determination when the projection does not exist in the trimmer curve 2018-07-29 13:44:06 +02:00
wmayer
df427de3ee fixes #0003027: if type(App.Vector) in originSketch.Geometry: newSketch.Geometry = originSketch.Geometry Raises types in list must be 2017-11-26 22:55:26 +01:00
luzpaz
706141b967 Make uniform the use of B-spline visible to users
Forum thread: https://forum.freecadweb.org/viewtopic.php?f=8&t=25411
This commit does not include fixes to source  comments unless they were 'doxygenated'.
No .xml files were altered either.
2017-11-17 19:30:37 -05:00
wmayer
fb0274df41 for circle and arc of circle also store angle to local x-axis 2017-09-29 12:52:10 +02:00
wmayer
949c86d364 Port to occ7.2:
+ Standard_Failure::Caught() is now marked as deprecated and should be replaced with standard C++ exception handling
2017-09-01 16:27:46 +02:00
wmayer
7aec98ffb6 add methods to get normal and curvature information from surfaces 2017-08-14 12:24:42 +02:00
tomate44
cbfc6ae742 Part GeomBezierCurve implement Save() and Restore() 2017-06-26 22:08:38 +02:00
Peter Lama
a75a98ef27 Use OCCT Handle macro for Handle_ classes
This is the result of running OCCT's upgrade script provided
with OCCT 7.0. See
https://www.opencascade.com/content/freecad-occt710-and-windows-rtti-data-missing#comment-form
and
https://www.forum.freecadweb.org/viewtopic.php?f=4&t=21405&start=120#p169019
for why this is necessary for OCCT >= 7.1
2017-04-20 12:27:34 +02:00
Abdullah Tahiri
c3c670e162 Part: Geometry refactoring copy/clone 2017-04-10 08:57:25 +02:00
Abdullah Tahiri
7685823ecd Part: Geometry assignTag function 2017-04-10 08:57:25 +02:00
Abdullah Tahiri
9382de15a9 Part: Geometry creation of copy method to distinguish from clone 2017-04-10 08:57:25 +02:00
wmayer
497728a6d2 add method to create new tag id 2017-04-08 13:31:28 +02:00
Abdullah Tahiri
99d64ff33f Part: Geometry - implement missing setHandle functions and refactoring 2017-04-08 12:58:06 +02:00
Abdullah Tahiri
9580440d31 Part: Add unique identifier to Geometry 2017-04-08 12:58:06 +02:00
Abdullah Tahiri
f6dc312681 Part: Fixing signed vs unsigned warning 2017-04-08 12:58:06 +02:00
Abdullah Tahiri
e34788b6fc Part: GeomBSpline enable direct construction from parameters 2017-04-08 12:58:06 +02:00
Abdullah Tahiri
ca48841b8c Part: GeomBSplineCurve extension to get, increase or reduce multiplicity 2017-04-08 12:58:06 +02:00
Abdullah Tahiri
409cbb7199 Part: Geometry add support for getting the number of knots in a B-Spline 2017-04-08 12:58:06 +02:00
Kunda
99c99006b8 source typo fixes pt4 (only on py3 merged code) 2017-03-02 13:47:21 +01:00
wmayer
f2dc8c5d31 Some fixes of pr 538
fix -Wreturn-type
homogenous naming style
use official spelling of B-spline
2017-02-21 13:30:43 +01:00
Abdullah Tahiri
f291942d45 Part: Add support for reversing a geomcurve 2017-02-21 13:24:10 +01:00
Abdullah Tahiri
afd761041d Sketcher: BSpline Increase Degree tool 2017-02-21 13:24:10 +01:00
Abdullah Tahiri
9c10b3219d Part: Geometry functionality extension
======================================

Added for curves:
getFirstParameter
getLastParameter
curvatureAt
length

Modified:
normalAt(double u, Base::Vector3d& dir)

as it was not working properly.
2017-02-21 13:24:10 +01:00
wmayer
5cb17a6036 implement toNurbs for ellipse 2017-02-17 18:43:20 +01:00
wmayer
89925e21a3 implement NURBS converson of circle 2017-02-13 15:13:35 +01:00
wmayer
27fd215e1c add methods to convert a curve to a B-Spline or NURBS 2017-02-13 10:38:09 +01:00
wmayer
0955ccf594 fix whitespaces 2017-01-20 19:22:50 +01:00
wmayer
7a3c8d0a81 make indexes of GeomBSplineCurve consistent to OCC API 2017-01-20 18:49:59 +01:00
wmayer
5dab557dfd in geometry classes raise RuntimeError instead of basic exception type 2017-01-20 18:09:02 +01:00
Abdullah Tahiri
609c80b71a Part: Fixes triggered by Werner's comments on my branch 2017-01-10 20:05:18 +01:00
Abdullah Tahiri
e7dacb9178 Part: Bezier serialization support extension to periodic
=======================================================

Extension for periodic + suggestions by Werner.
2017-01-10 14:44:43 +01:00
Abdullah Tahiri
61b685fd53 Part: BSpline serialization
===========================

It stores a rational BSpline even if non-rational.

It should be extended to store in addition whether it is periodic or not, i.e. to support periodic BSplines.
2017-01-08 00:42:30 +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