Commit Graph

46 Commits

Author SHA1 Message Date
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
wmayer
3114df352d in forward declaration replace class keyword when struct is expected
comment out unused parameters
2016-12-29 17:52:39 +01:00
wmayer
7496eeef18 move methods setXAxisDir/getXAxisDir to base class 2016-12-28 14:22:12 +01:00
Abdullah Tahiri
f9eec60b1c Sketcher: Parabola fix loading from file 2016-12-24 22:15:41 +01:00
Abdullah Tahiri
82259f31da 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
579cbb280b Part: ArcOfParabola extension to set the symmetry axis 2016-12-18 00:03:53 +01:00
Abdullah Tahiri
8c83f4142b Part: Parabola Extension to support getting occ focus 2016-12-17 22:50:46 +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
e96370f820 add class LineSegment 2016-11-30 16:26:21 +01:00
Abdullah Tahiri
96d664dd88 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
9b71ebf48b 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
27a76afa94 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
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
52980057bf add missing header 2016-10-26 11:23:02 +02:00
wmayer
18a5ff83b1 add support of Hermite curves 2016-10-26 10:28:23 +02:00
wmayer
fbaf3a1bbc implement method to get GeomSurface from Geom_Surface 2016-10-17 22:39:17 +02:00
wmayer
2502526e4e extend API of several surface types 2016-10-17 21:59:20 +02:00
wmayer
1e2e24b652 + 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
c8e241c9f3 + PLate surface approximation 2015-11-19 18:52:19 +01:00
wmayer
13e2b24ddf + add Python binding to Plate surface 2015-11-19 15:27:35 +01:00
wmayer
1d1e71b52f + integrate biarcs algorithm 2015-04-05 14:10:03 +02:00
wmayer
007f939731 + check for correct OCC version 2015-02-23 16:05:17 +01:00
wmayer
b5b54c59f1 + fix for OCC 6.3 2015-02-22 18:41:18 +01:00
DeepSOIC
0767cd35f8 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
26666a1fda + minor optimization 2015-01-02 12:26:29 +01:00
Abdullah Tahiri
ec03fb541f 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
02cc02eaee + fix build failure 2014-12-21 11:21:32 +01:00
Abdullah Tahiri
75377ebfd3 Part Module New Feature: Hyperbola & ArcOfHyperbola
- Completed Hyperbola c++ implementation and python wrapper
- Created ArOfHyperbola c++ and python wrapper implementation
2014-12-21 00:54:07 +01:00
Abdullah Tahiri
6997cc9991 Part Module New Feature: Parabola & ArcOfParabola
- Completed Parabola c++ implementation and python wrapper implementation
- Created ArOfParabola c++ and python wrapper implementation
2014-12-21 00:51:24 +01:00
Abdullah Tahiri
a458c3e6d2 Sketcher New Feature: Ellipse support
- Ellipse introduction button via (center,majaxis extreme, a point in edge), ellipse is always CCW so that Z axis goes in the positive direction of the sketch
- Backwards compatibility with files of previous versions of ellipse not defining a phi angle
- Art by Jim (all the icons you see and the XPMs shown on creation of an ellipse)
- Element Widget support for ellipses
- Box selection for ellipses
- Point on Ellipse constraint based on the gardener's method based on Ulrich's function proposal (radcan simplified, i.e. with simplify_radical sage function)
- Tangent: Ellipse to Line based on DeepSOIC's geometric formulation (radcan simplified)

Sketcher New Feature: Internal Alignment Constraint
- The element to which internal alignment is applied has to be selected last.
- All other elements are added in the order of priority, taking into account existing elements
- Art by Jim (beautiful icons).

Sketcher New Feature: Tool to show/hide/restore the internal geometry of an element
- New functionality for show/hide internal geometry:
  toggles between hiding all unused internal geometry elements and showing all internal geometry.
  The restore function is implicit to the showing all internal geometry

Sketcher New Feature: Arc of Ellipse support
- Part::Geometry + Python implementation
- ArcOfEllipse creation method
- Art by Jim (all the icons you see and the XPMs shown on creation of arc of ellipse elements)
- Sketcher Element widget for ArcOfEllipse.

Bug fix: Select elements associated to constraints works now for foci internal alignment constraints
2014-12-20 12:33:29 +01:00
wmayer
3ffe5936f4 + Fix some tolerance issues 2013-11-13 11:57:30 +01:00
wmayer
dc1cd7b45c + Implement persistence of GeomEllipse 2013-11-05 12:52:20 +01:00
wmayer
eae2ce3ac2 0001223: Dimensional constraint - Unknown C++ exception 2013-09-03 19:15:32 +02:00
wmayer
1c55838f69 Apply patch to add interpolate() method to B-Spline surface class 2012-06-25 11:48:43 +02:00
wmayer
52d65e2085 + port to OCC 6.5.2
git-svn-id: https://free-cad.svn.sourceforge.net/svnroot/free-cad/trunk@5318 e8eeb9e2-ec13-0410-a4a9-efa5cf37419d
2011-12-17 12:58:47 +00:00
wmayer
120ca87015 + unify DLL export defines to namespace names
git-svn-id: https://free-cad.svn.sourceforge.net/svnroot/free-cad/trunk@5000 e8eeb9e2-ec13-0410-a4a9-efa5cf37419d
2011-10-10 13:44:52 +00:00