Commit Graph

159 Commits

Author SHA1 Message Date
wmayer
3663cfbd0e add method to create new tag id 2017-04-08 13:31:28 +02:00
Abdullah Tahiri
3060e28c81 Part: Geometry - implement missing setHandle functions and refactoring 2017-04-08 12:58:06 +02:00
Abdullah Tahiri
1c34aca8ac Part: Add unique identifier to Geometry 2017-04-08 12:58:06 +02:00
Abdullah Tahiri
2c53237492 Part: Fixing signed vs unsigned warning 2017-04-08 12:58:06 +02:00
Abdullah Tahiri
6301b814ee Part: GeomBSpline enable direct construction from parameters 2017-04-08 12:58:06 +02:00
Abdullah Tahiri
298e962d26 Part: GeomBSplineCurve extension to get, increase or reduce multiplicity 2017-04-08 12:58:06 +02:00
Abdullah Tahiri
0cf81e2d1f Part: Geometry add support for getting the number of knots in a B-Spline 2017-04-08 12:58:06 +02:00
Kunda
9410e751e9 source typo fixes pt4 (only on py3 merged code) 2017-03-02 13:47:21 +01:00
wmayer
a0aa4fdfef 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
49fe51910c Part: Add support for reversing a geomcurve 2017-02-21 13:24:10 +01:00
Abdullah Tahiri
194dcae963 Sketcher: BSpline Increase Degree tool 2017-02-21 13:24:10 +01:00
Abdullah Tahiri
08a79d7146 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
8c5d7b7386 implement toNurbs for ellipse 2017-02-17 18:43:20 +01:00
wmayer
9baa5e9791 implement NURBS converson of circle 2017-02-13 15:13:35 +01:00
wmayer
becdede5c0 add methods to convert a curve to a B-Spline or NURBS 2017-02-13 10:38:09 +01:00
wmayer
d065c2fe5b fix whitespaces 2017-01-20 19:22:50 +01:00
wmayer
a3e30b8ca7 make indexes of GeomBSplineCurve consistent to OCC API 2017-01-20 18:49:59 +01:00
wmayer
7017a847f1 in geometry classes raise RuntimeError instead of basic exception type 2017-01-20 18:09:02 +01:00
Abdullah Tahiri
b0dc19eca9 Part: Fixes triggered by Werner's comments on my branch 2017-01-10 20:05:18 +01:00
Abdullah Tahiri
c8d56c5663 Part: Bezier serialization support extension to periodic
=======================================================

Extension for periodic + suggestions by Werner.
2017-01-10 14:44:43 +01:00
Abdullah Tahiri
5d28434ef5 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
e026378e7d 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
wmayer
7d842679bd in forward declaration replace class keyword when struct is expected
comment out unused parameters
2016-12-29 17:52:39 +01:00
wmayer
9d8f765738 move methods setXAxisDir/getXAxisDir to base class 2016-12-28 14:22:12 +01:00
Abdullah Tahiri
a2acb7ad30 Sketcher: Parabola fix loading from file 2016-12-24 22:15:41 +01:00
Abdullah Tahiri
2ab4297069 Part::Geometry: ArcOfParabola CCW emulation support/fix
=========================================================

Correction of the emulation so that arcs of parabola are always CCW.
2016-12-24 16:11:15 +01:00
Abdullah Tahiri
7f2f9a19c3 Part: ArcOfParabola extension to set the symmetry axis 2016-12-18 00:03:53 +01:00
Abdullah Tahiri
abb3e1d0b5 Part: Parabola Extension to support getting occ focus 2016-12-17 22:50:46 +01:00
wmayer
273f3995c0 add class GeomArcOfConic to reduce code duplication 2016-12-04 14:20:56 +01:00
wmayer
4ba8b565dc add class GeomConic to reduce code duplication 2016-12-04 11:36:50 +01:00
wmayer
19237df7bf add class LineSegment 2016-11-30 16:26:21 +01:00
Abdullah Tahiri
8107674550 Part::Geometry: ArcOfHyperbola CCW emulation support/fix
===================================================

Correction of the emulation so that arcs of hyperbola are always CCW. This fixes mismatching of end points and edge in Sketcher.
2016-11-27 18:45:33 +01:00
DeepSOIC
bc1f9396f4 Sketcher: Hyperbola: fix - remove periodicity correction
Not needed, since hyperbola is not periodic, unlike circle and ellipse
2016-11-27 18:45:33 +01:00
Abdullah Tahiri
cb5981fceb In Part:Geometry:
- Fixing Hyperbola classes to get CCW emulation (like Ellipse classes).

In Sketcher:
- The Sketcher representation deals with the right branch of the Hyperbola only.
- Solver model is: Center, Focus1 (focus of the right branch), minor radius (b).
- HyperbolicArcRangeToEndPoints code is the one of Ellipse <= Awaiting DeepSOIC help ;)
- ConstraintPointOnHyperbola solver constraint is now implemented and should be working.
- No InternalAligment constraints implemented yet.
2016-11-27 18:45:33 +01:00
wmayer
cd761ab804 wrapper for Geom2d package 2016-11-21 18:17:10 +01:00
wmayer
85020ab780 + remove GeomHermiteCurve class and add its methods to GeomBSplineCurve 2016-10-29 15:08:17 +02:00
wmayer
1fd3da29c8 add missing header 2016-10-26 11:23:02 +02:00
wmayer
13b7a32596 add support of Hermite curves 2016-10-26 10:28:23 +02:00
wmayer
b44408a2a4 implement method to get GeomSurface from Geom_Surface 2016-10-17 22:39:17 +02:00
wmayer
03d6c2ebf8 extend API of several surface types 2016-10-17 21:59:20 +02:00
wmayer
c294c8bdbd + rename methods in Vector3 class
+ add convenience methods Cross and Dot to Vector3 class
+ fix bug in DistanceToLineSegment in Vector3 class
2016-07-30 15:14:47 +02:00
wmayer
6f8adef286 + PLate surface approximation 2015-11-19 18:52:19 +01:00
wmayer
027a560fbc + add Python binding to Plate surface 2015-11-19 15:27:35 +01:00
wmayer
997e21f749 + integrate biarcs algorithm 2015-04-05 14:10:03 +02:00
wmayer
e66d828a7d + check for correct OCC version 2015-02-23 16:05:17 +01:00
wmayer
d5aa035c90 + fix for OCC 6.3 2015-02-22 18:41:18 +01:00
DeepSOIC
1bbc764e9e Sketcher: fix reversed geometry and rotated arcs
Fixes a bug where an arc, ellipse, or arc-of-ellipse, being reversed in
XY plane, behaved badly in sketcher (see forum thread "Sketch: how to
handle reversed external arcs?"
http://forum.freecadweb.org/viewtopic.php?f=10&t=9130 ).
Also fixes a problem with rotated arcs (see forum thread "Rotating Arc
in Sketcher"
http://forum.freecadweb.org/viewtopic.php?f=22&t=9145#p74262 ).

This is done by adding an emulation flag to a few methods in
Part::GeomXXX, which makes the shape to pretend being non-reversed
(CCW). This causes endpoints of reversed arcs of circles lineked as
external geometry to swap, causing broken sketches sometimes.
2015-02-17 12:27:31 +01:00
wmayer
d57de8c6d3 + minor optimization 2015-01-02 12:26:29 +01:00
Abdullah Tahiri
948eb8e636 Part: Extension of Geometry::Curve
Part: Extension of Geometry::Curve to wrap more functions of OCC

Apart from:
    bool tangent(double u, gp_Dir&) const;
that was already implemented, now it also implements:
    Base::Vector3d pointAtParameter(double u) const;
    Base::Vector3d firstDerivativeAtParameter(double u) const;
    Base::Vector3d secondDerivativeAtParameter(double u) const;
    bool normal(double u, gp_Dir& dir) const;
    bool closestParameter(Base::Vector3d point, double &u);

i.e. apart from giving the tangent vector for a given curve at parameter value u,
it also gives:
   - The point cartesian coordinates of the curve point at parameter value u
   - The vector of the first derivative at parameter value u
   - The vector of the second derivative at parameter value u
   - The normal vector to the curve at parameter value u
   - The parameter value of a curve closest ot a given point

Code cleanup: Changing Trim functionality of Ellipse to use OCC calculations

Part Curve functions extension: closestParameterToBasicCurve

It provides the parameter of the curve closest to a given point. If the curve is a Trimmed curve, the parameter of the basic underlaying curve closest to the point is provided.
2015-01-02 11:48:28 +01:00
wmayer
f84da6b6fd + fix build failure 2014-12-21 11:21:32 +01:00