Commit Graph

60 Commits

Author SHA1 Message Date
wmayer
22b63a7653 + fix ambiguous shortcuts 2015-02-18 13:07:42 +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
Abdullah Tahiri
501c40f0e6 Sketcher: Ellipse implementation enhancements
- ArcOfEllipse enhancement: Tangency ArcOfEllipse to ArcOfEllipse or ArcOfCircle by selecting end/starting points...
- Minor bug corrections (Thanks DeepSOIC)
- ExposeInternalGeometry python command
- DeleteUnusedInternalGeometry python command
- On deletion of an Ellipse/ArcOfEllipse all further unconstrained internal geometry is also deleted.
- This cleans up the code by eliminating code repetition in the creation methods.
- Major bug fix for autoconstraints for ellipse and arc of ellipse creation (for both creation methods)
- Major bug fix Start and Endpoint constraints of an arc of ellipse where not taking into account that Sketcher arcs are always CCW, so they have to be exchanged if we convert a CW arc into a CCW arc.

Sketcher: General bug fix: Tangency wrongly suggested

What?
=====
- On creation of a shape autoconstraints are suggested.
- Tangent autoconstraint was suggested even with lines perpendicular to the tangency direction

Reproduce
=========
- Make a circle on the origin and move the mouse along the X axis, it will suggest a tangency that is impossible
- Click on the axis and no circle will be created

Solution
========
- The SeekConstraint now can use the parameter dir to give a direction that is substantially perpendicular to the expected tangency, so that
if an object having a direction (a line) is hit, a tangency will not be suggested if within around 6 degrees of being parallel.
- Additionally, if such a line is an X,Y axis of the sketch, tangency will only be suggested if the direction is within 6 degrees of being perpendicular (i.e. it is almost tangent already while sketching).
- This difference is due to the fact that an X or Y axis can not "move" to meet the object under creation, whereas a line can.
2014-12-20 12:33:37 +01:00
Mark A. Taff
80120a6bac Ellipse implementation: Several bug fixes
I. Fix minor bug where wrong b was used to create ellipse internal geometry.

Tweak the internal geometry code a bit and reformat it so it isn't so wide.
Also begin debugging constraint conflicts on small circular ellipses.

There seem to be two issues currently in major/minor internal geometry lines:
  1) Sometimes minorLength > majorLength due to round-tripping doubles, and
  2) Constraint conflicts when majorLength > minorLength by an epsilon on the order of 1e-6

(cherry picked from commit 5c3e20af1a95c860112289dcdda54ea99778bc3a)

II. When testing for a valid ellipse, also ensure that the mangled major axis length > the mangled axis length.

This additional condition ensures that major and minor axis constraints don't conflict in the case of small
(nearly) circular ellipses.

The is still a potential bug in the solver when the major length is just slightly larger than the minor, but this fix
makes it nigh impossible to reproduce.
(cherry picked from commit 7e274bc32d9aa1a12ab52bfa33ed80353540b062)

III. Code clean up

Remove redundant 3d vectors.

(cherry picked from commit c656d5165c8bae8f101a2b46af6b12348d06cefe)
2014-12-20 12:33:37 +01:00
Abdullah Tahiri
c8d7f70dba Sketcher: Ellipse implementation: Art by Jim 2014-12-20 12:33:36 +01:00
DeepSOIC
fc7f1791d2 Fix intern. geom. placement for ellipse arc a<b
(cherry picked from commit 896372cbae2d5667f72f6ee9e628eea482846156)
2014-12-20 12:33:36 +01:00
Abdullah Tahiri
83edcf4c86 Sketcher: Ellipse : Integration of all conics under a single toolbar space 2014-12-20 12:33:35 +01:00
Mark A. Taff
bccb9466cc Implement two construction methods for ellipses:
--Center, major radius, minor radius
  --Periapsis, apoapsis, minor radius

Artist: We need an icon for periapsis, apoapsis, minor radius method.
(cherry picked from commit f0a4339621b0bf901754af14c3cd36c95ca55966)
2014-12-20 12:33:35 +01:00
Abdullah Tahiri
f5df65c4c4 Sketcher: Ellipse enhancement: All internal geometry is shown on creation
Elements that have internal geometry are created with the internal geometry on creation.

It has been under discussion for a long time. Ulrich was in favour (asked for it several times).
DeepSOIC implemented the focus because he hated the poor dragging of the ellipse when empty.
2014-12-20 12:33:33 +01:00
DeepSOIC
9d135bdc4e Sketcher: Ellipse enhancement: Negative focus on creation to improve dragging
Focus2 is thrown in automatically for ellipse arcs

(cherry picked from commit 1ab814e6b07fd946dbb2910cc1bfb8588c61afb8)
2014-12-20 12:33:33 +01:00
Abdullah Tahiri
a067a7c25a Sketcher Ellipse and ArcOfEllipse: Extra features and bug fixes
- Minor changes to alignment constraint selection to avoid to create objects just for simple calculations
- Equality constraint of Ellipse, ArcOfEllipse and combinations of those elements
- Bugfix for internalalignment creation of major and minor of ellipse and extension to arcofellipse
- Trim support for ellipses
- Solver threshold for rank calculation set at 1e-13.
- Trim support for arc of ellipse
- Ellipses and ArcOfEllipses as external geometry
- Validate Sketch now supports arcs of ellipse
- Tangents of Ellipse or ArcOfEllipse to any of ArcOfcircle, circle and Ellipse (using construction elements)
- Perpendicularity constraint
- Bug fix: Show/hide internal geometry not working for external geometry
- Visualization of Internal alignment constraints when selecting in the constraint widget
- Equality for ellipses and arc of ellipses
2014-12-20 12:33:31 +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
DeepSOIC
86a1757c20 Sketcher: Slot: proper tangent constraints
Endpoint-to-endpoint tangency is applied now instead of
tangency+coincident.
Fixes issue #0001828 ( http://freecadweb.org/tracker/view.php?id=0001828
)
2014-11-16 23:14:41 +01:00
wmayer
d30eb39a1e + fixes #0001808: Double Clicking Sketcher PolyLine Causing Crash 2014-11-09 17:59:54 +01:00
wmayer
f02da38566 + fix Qt help problems 2014-10-01 17:16:43 +02:00
wmayer
ce528d1c4a + fixes #0001719: Show current shortcuts (S) in menus and hover text. 2014-08-31 14:28:33 +02:00
wmayer
346e5c6a77 + fix more compiler warnings 2014-08-27 13:26:44 +02:00
wmayer
65c974ed2d Squashed commit of the following:
commit 6e78052d325eadcb212a6d50c6cd09cc29ac7870
Author: Johan K <johankristensen@gmail.com>
Date:   Tue Jul 29 14:52:08 2014 +0200

    Adding missing file RegularPolygon.py

commit 416396283032a31a1ea307df23d33ecfccf37935
Author: Johan K <johankristensen@gmail.com>
Date:   Mon Jul 28 22:51:28 2014 +0200

    Replaced sketcher implementation of RegularPolygons with a Python script version.
2014-07-29 17:26:28 +02:00
Johan K
7fadaa0a55 Added more regular polygons to the sketcher gui 2014-07-27 00:25:40 +02:00
wmayer
2fcce866a7 + change order of tangent and coincident constraints of slot 2014-06-06 00:33:56 +02:00
wmayer
dfda6704d7 + abort slot creation in error case 2014-06-06 00:08:26 +02:00
wmayer
c07358073a + whitespace improvements 2014-06-05 23:24:59 +02:00
wmayer
c05801d6ed + fixes for sketcher 2014-06-03 11:24:49 +02:00
jriegel
faf406fa2b fix wrong cursor icon in Slot 2014-04-17 06:33:57 +02:00
jriegel
39f7353663 Implement Constraint creation on Slot 2014-04-17 06:33:57 +02:00
jriegel
1f0d427ed3 further implementing slot 2014-04-16 07:49:09 +02:00
jriegel
87bed7d5c4 start slot draw handler for Sketcher 2014-04-15 07:00:17 +02:00
wmayer
f255948f1e + fixes: #0001475: Implement a 3 point arc similar to solidworks in sketcher (mdinger) 2014-03-29 12:20:32 +01:00
wmayer
ce7a3ecaa2 + fixes #0001490: Implement a perimeter circle (3 point circle) similar to solidworks in sketcher (mdinger) 2014-03-29 12:03:17 +01:00
wmayer
13cdc1cd39 + issue #0001475: Implement a 3 point arc similar to solidworks in sketcher 2014-03-17 09:41:51 +01:00
wmayer
a7aca65e77 + issue #0001475: Implement a 3 point arc similar to solidworks in sketcher 2014-03-17 09:37:56 +01:00
wmayer
d1341f36f7 + issue #0001475: Implement a 3 point arc similar to solidworks in sketcher 2014-03-16 16:03:32 +01:00
wmayer
35b10d68aa + issue #0001475: Implement a 3 point arc similar to solidworks in sketcher 2014-03-16 13:29:44 +01:00
wmayer
3ea41ff0c9 + fixes #0000844: Cannot use edge hidden by sketch axis as external geometry 2014-03-15 19:53:14 +01:00
wmayer
ea4abcb57a + issue #0001475: Implement a 3 point arc similar to solidworks in sketcher 2014-03-15 12:50:24 +01:00
logari81
4d918d1f8f Sketcher: fix polyline closing when coincident points are involved 2014-02-12 22:23:43 +01:00
logari81
fa33bcae4a + fixes #0000928: Change selection numbering base in the Sketcher from 0 to 1 2014-02-08 23:51:15 +01:00
jriegel
66ee73f54b Further doubel suggestions from Jan
Moved Gui/InputVector,Placement,Transform from float to double
Moved Sketcher from float to double
more suggestions for moving float -> double
2013-09-24 11:01:01 +02:00
Yorik van Havre
5fff0f0fb8 0001056: Better tooltip for Sketcher Polyline tool 2013-03-16 23:21:45 -03:00
jriegel
11b4abf24a Log in FemMesh view provider and some warnings fixed 2013-02-18 22:29:02 +01:00
wmayer
0b5212e46b Show auto-constraints symbol in point mode 2012-12-02 13:27:50 +01:00
logari81
f6624a6d7f Sketcher: fix an issue when a polyline is started at the start point of an existing line segment 2012-09-04 14:40:05 +02:00
wmayer
1f94f0846e Fix translation issues 2012-08-31 13:11:52 +02:00
wmayer
ec0ae08612 Fix build errors on Windows 2012-08-13 10:26:02 +02:00
logari81
96c5dda4eb Sketcher: crashes fix and other small fixes for the polyline tool 2012-08-12 12:21:53 +02:00
logari81
db2ccb31b4 Sketcher: improve position text during geometry creation 2012-08-06 23:05:31 +02:00
logari81
3f3b7cd68f Sketcher: allow starting a new polyline connected at some already available geometry 2012-08-06 16:13:09 +02:00
logari81
6b0f50d98c Sketcher: add perpendicular mode to polyline tool and use M-key for mode-switching 2012-08-06 13:34:29 +02:00
logari81
227cb0ebc8 Sketcher: fix an issue with autoconstraints and improve implementation 2012-07-17 12:47:08 +02:00
logari81
e5953cedac Sketcher: points defined as external geometry,
fix behavior of external geometry cursor,
          improve appearance of point creation cursor
2012-07-10 15:25:27 +02:00