Commit Graph

80 Commits

Author SHA1 Message Date
wmayer
9b806f4ac9 Sketch: [skip ci] handle possible crashes when decreasing degree of a spline 2020-10-23 11:26:15 +02:00
wmayer
d532f8ef33 Sketcher: implement command to decrease degree of a B-spline 2020-10-23 00:36:41 +02:00
mwganson
283ef3ce86 [Sketcher] add python command sketch.getGeoVertexIndex(int index) -- returns tuple (geoId, posId) of vertex at that index in the sketch. usage example: (geoId, posId) = App.ActiveDocument.Sketch.getGeoVertexIndex(int(Gui.Selection.getSelectionEx()[0].SubElementNames[0][6:])-1) 2020-07-19 05:50:12 +02:00
luz.paz
7008cf92de Sketcher: [skip ci] fix header uniformity
This PR fixes header uniformity across all Sketcher WB files
2019-12-22 01:00:29 +01:00
wmayer
f0c89811bd add method to sketch object to get index by user-defined name 2019-10-29 19:35:53 +01:00
Abdullah Tahiri
0e15d3461f Sketcher: Python interface to SketchObject constraint state 2019-06-22 08:26:31 +02:00
Abdullah Tahiri
893d7afccc Sketcher: PCH 2019-05-02 07:12:27 +02:00
Abdullah Tahiri
ee99340558 Make Open vertices detection routine accesible to Python 2018-12-03 12:11:11 +01:00
luz.paz
cfbfa9dc6b Misc. typo, grammar, and whitespace fixes
[skip ci]
2018-11-27 15:02:58 -03:00
wmayer
a67ee5648c remove trailing spaces 2018-11-05 10:53:01 +01:00
Abdullah Tahiri
843f636d85 Sketcher: Expose mass datum commands to python 2018-11-04 14:41:20 -03:00
Abdullah Tahiri
a93a5e9c93 Sketcher: Use transparent exception mechanism for fillets
=========================================================

This ensures that the exception back in the c++ that invoked python retains the type of exception and can be properly catched.
2018-10-28 18:34:50 +01:00
Abdullah Tahiri
49a71e9399 Sketcher: Python SketchObject support 2018-07-30 00:47:20 +02:00
Abdullah Tahiri
9f969e558c Sketcher: Python command to delete all the constraints at once 2018-07-29 13:44:07 +02:00
Abdullah Tahiri
6e865aa3e5 Sketcher: Python SketchObject implementation
Exposure of all the functionality in the previous commits to Python
2018-07-29 13:44:07 +02:00
Abdullah Tahiri
2c89860a38 Sketcher: Wrong DoF reported - Fixes #3503 2018-06-09 11:11:46 +02:00
Abdullah Tahiri
eacb14c3d4 Sketcher: Python interface to solveraid 2018-06-09 11:02:53 +02:00
Abdullah Tahiri
8ebb8ce90b Sketcher: Empty list means all geometry for Python addCopy addRectangularArray and addMove 2018-05-31 14:36:21 +02:00
Abdullah Tahiri
93843aee9f Sketcher: Python support for moving Geometry 2018-05-31 14:34:58 +02:00
Abdullah Tahiri
5e11e37712 Sketcher: Python Interface for Constraint Virtual Space
=======================================================

set/get/toggle python interface to enable to set the virtual space status of a constraint via SketchObject.
2018-01-26 17:02:46 +01:00
wmayer
adaf9323f3 improve whitespaces 2018-01-13 14:07:15 +01:00
Abdullah Tahiri
e1bf2045dd Sketcher: Overload delConstraintonPoint Python to allow deletion on GeoId and Pos 2018-01-13 13:55:56 +01:00
Abdullah Tahiri
6210b602de Sketcher: Python command to delete all internal geometry and constraints of an sketch 2017-11-06 14:18:12 +01:00
wmayer
a5a04e359c fix bug in pr774, improve whitespaces 2017-06-19 13:32:27 +02:00
Alexander Lin
144e4759ce Adds extend feature to Mod/Sketcher
Fixes #1187
2017-06-19 13:07:37 +02:00
Peter Lama
fa4bebf2e0 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
3cfef62381 Sketcher: Carbon copy Python command 2017-04-10 08:57:25 +02:00
Abdullah Tahiri
7a2760695a Sketcher: SketchObject - Python command to increase knot multiplicity 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
03c232fa82 py3: ported Skechter to python3 2017-03-01 17:20:20 +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
edc20e7a84 Sketcher: IncreaseBSplineDegree python implementation 2017-02-21 13:24:10 +01:00
Abdullah Tahiri
52240401ae Sketcher: ConverttoNURBS python implementation 2017-02-21 13:24:10 +01:00
wmayer
d065c2fe5b fix whitespaces 2017-01-20 19:22:50 +01:00
Abdullah Tahiri
ddd8ce238c Sketcher: Enable BSpline creation in SketchObjectPy 2017-01-05 21:52:35 +01:00
Abdullah Tahiri
369f1f9368 Sketcher: Enable Parabola creation in SketchObjectPy 2016-12-18 00:46:01 +01:00
Abdullah Tahiri
e928e418ec Sketcher: New Feature: Hyperbola/ArcOfHyperbola
===============================================

- ArcOfHyperbola creation method
- Solver representation (undefined moving)
- SketchObjectPyImp (here we still miss the Part->Partdesign conversion)
- Sketch validation for hyperbola
- Hyperbola creation method: shows the "proof of concept", but it is very buggy!!

Notes:
- Missing icons, probably missing geo normal curve implementation - rebasing -
- Fixes to adapt Hyperbola to Derivector implementation and make it compile
2016-11-27 18:45:33 +01:00
Alexander Golubev
305151be34 App/Origin: big refactoring
- Rebase App::Origin on App::DocumentObject
 - Keep all control over the Origin structure inside the Origin and it's
   ViewProvider
 - Add OriginFeature class as common base for App::Plane and App::Line
 - Rebase App::Plane and App::Line on top of newly created class and
   move to the file.
 - Change Origin's ViewProvider API associated with temporary display
 - Lots of associated changes to files
 - Several minor fixes
 - Lots of new bugs
2016-04-12 18:12:18 +02:00
jrheinlaender
99e68a2a75 Improved SketchObject error reporting 2016-04-12 18:11:55 +02:00
jrheinlaender
2acee44b89 Centralize the check for valid external geometry to ensure consistency (part 2) 2016-04-12 18:11:55 +02:00
jrheinlaender
73d55c538b Allow geometry from other bodies in the same par as external geometry for sketches 2016-04-12 18:11:52 +02:00
jrheinlaender
857ede8847 Moved generic Datum class to Part module to avoid Sketcher dependency on PartDesign 2016-04-12 18:11:49 +02:00
wmayer
ab449f5dd8 + on rename of contraint make sure that new name is different, on swap constraint names make sure they have user-defined names 2016-03-12 20:02:18 +01:00
Abdullah Tahiri
52b79c1764 Sketcher: Bug fix: unable to move geometry after addition of a constraint
=========================================================================

This fixes issue:
http://www.freecadweb.org/tracker/view.php?id=2281

Discussed in:
http://forum.freecadweb.org/viewtopic.php?p=101910#p101910

How to reproduce?
With Auto-Update mode unchecked, execute the sequence in the bug tracker. You will reach to a geometry assembly successfully solved that can not be moved.

Why?
The coincident constraint is partially redundant within the meaning of redundancy of the solver.
The solve within "addconstraint" in SketchObjectPy.cpp causes the geometry to move to meet the coincident constraint.
At the end of the solve, the initial solution used in diagnostics is no longer valid (the geometry moved). This causes a subsequente move not to be executed.

The Solution:
Recalculate just the initial solution after the addition.
2015-10-23 00:13:20 +02:00
wmayer
92b330bbcb + support of unicode names for sketch constraints 2015-09-24 03:17:47 +02:00
Mateusz Skowroński
05f95c0506 Fix files encoding. Go from ISO8859-1 to UTF-8. 2015-09-21 19:50:49 -03:00
Eivind Kvedalen
cacf7bdaf1 Sketcher: Added support for expressions. 2015-09-21 14:51:10 +02:00
wmayer
1a66bc4c45 + improve whitespaces 2015-08-31 13:53:48 +02:00
Abdullah Tahiri
3ec90116f1 Sketcher: Extension of Copy/Array functionality to clone
=============================================================

This commit allows the user to select in advance whether he wants a simple copy or a clone.

This involves substitution of dimensional constraints in the copies by equality and parallel constraints.

Terminology change for Arrays, now it is Rectangular array
2015-08-30 12:08:43 +02:00
Abdullah Tahiri
7b053b5602 Sketcher: UI Copy Support & 2D Array python command rework
==========================================================

- Support for copying geometric elements in the sketcher with Ctrl+C (or using the still missing icon). It will show you the vector of displacement from the
"reference point". The reference point can be chosen by the user (although it is not necessary to do it so) by making the point the user wish to be the reference point
the last selected element. It conveniently incorporates "autoconstraints", so that you can make this point (the one of the copy) directly coincident with any other point in the sketch.

- Python 2D array command modified to lock elements position using construction lines and constraints.
- Support for different spacing between u and v directions (the direction of the cols and the direction of the rows).

- Support to avoid copying DistanceX and DistanceY constraints when used for locking a point. This means that if the geometry that you copy(array) is
fully constraint, the resulting 2D array is also fully constraint.

- UI support for creating 2D linear arrays in the sketcher.
- Bug fix in python addArray, wrong line copy startingpoint calculation fixed.

How to create a 2D array in the sketcher:
1. Select your geometric elements.
2. Click the button
3. Fill in the rows/cols and preferences on spacing and constraining each element of the array
4. Click Ok
5. Define the direction of the cols of the array and click
2015-08-30 12:08:42 +02:00