Commit Graph

214 Commits

Author SHA1 Message Date
Abdullah Tahiri
c47e29c54c Sketcher: New Feature: External Geometry Linking improvement
============================================================

It lifts the need of clicking on the external geometry icon upon importing each external geometry element.

All the elements on which the user clicks are imported until the user right clicks with the mouse or presses ESC, like the Trim or Fillet tools.
2015-05-30 16:39:27 +02:00
Abdullah Tahiri
213b9e2dda Sketcher: New Feature: Continuous creation mode
===============================================

When creating a type of geometric element, the user can create as many elements of that type he wishes without having to click the button before each insertion.

The insertion of that type of elements ends by pressing ESC or clicking the right button of the mouse.

This mode is by default disabled and can be enabled in Preferences->Display->Sketch->Geometry Creation "Continue Mode".
2015-05-30 16:39:26 +02:00
Abdullah Tahiri
277cd14f1f Bug fix: Sketcher Polygon autoconstraints
=========================================

The autoconstraints on creation of an hexagon were not working.

How to reproduce?
1. In a sketch make a couple of lines
2. Create an hexagon (or other polygon of your choice) with center in one end of a line and with side coincident with the end point of the other line

Result:
Neither the center nor the side autoconstraints are properly created.

Fix:
Straightforward. Just correct the indexes. Last is always the circle. Last but one is always a side.
2015-05-27 16:22:31 +02:00
wmayer
f52ed288c1 + fixes #0001998: For 32 px and 48 px the icons with a submenu in toolbars are not display at the good size 2015-04-17 23:16:28 +02:00
wmayer
af80c7493a + fix ambiguous shortcuts 2015-02-18 13:07:42 +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
Abdullah Tahiri
d3b0cf771f 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
d1e3fa4815 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
4a5f88424c Sketcher: Ellipse implementation: Art by Jim 2014-12-20 12:33:36 +01:00
DeepSOIC
2185c21349 Fix intern. geom. placement for ellipse arc a<b
(cherry picked from commit 896372cbae2d5667f72f6ee9e628eea482846156)
2014-12-20 12:33:36 +01:00
Abdullah Tahiri
2871d05620 Sketcher: Ellipse : Integration of all conics under a single toolbar space 2014-12-20 12:33:35 +01:00
Mark A. Taff
ceb9dacafa 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
52158eba19 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
2abdd2df72 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
c4fb76eb61 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
4946eddc6b 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
d906249732 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
bd9b17888f + fixes #0001808: Double Clicking Sketcher PolyLine Causing Crash 2014-11-09 17:59:54 +01:00
wmayer
4e72e4a937 + fix Qt help problems 2014-10-01 17:16:43 +02:00
wmayer
c94403412d + fixes #0001719: Show current shortcuts (S) in menus and hover text. 2014-08-31 14:28:33 +02:00
wmayer
839eced7a9 + fix more compiler warnings 2014-08-27 13:26:44 +02:00
wmayer
313a33b19a 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
5edd3229cb Added more regular polygons to the sketcher gui 2014-07-27 00:25:40 +02:00
wmayer
bccc80b60a + change order of tangent and coincident constraints of slot 2014-06-06 00:33:56 +02:00
wmayer
959785098f + abort slot creation in error case 2014-06-06 00:08:26 +02:00
wmayer
977136e7e3 + whitespace improvements 2014-06-05 23:24:59 +02:00
wmayer
34176e51f0 + fixes for sketcher 2014-06-03 11:24:49 +02:00
jriegel
16cc37f9b3 fix wrong cursor icon in Slot 2014-04-17 06:33:57 +02:00
jriegel
8f6d4d5891 Implement Constraint creation on Slot 2014-04-17 06:33:57 +02:00
jriegel
47c7c7c98b further implementing slot 2014-04-16 07:49:09 +02:00
jriegel
58ad1d91fc start slot draw handler for Sketcher 2014-04-15 07:00:17 +02:00
wmayer
3de07fd68b + fixes: #0001475: Implement a 3 point arc similar to solidworks in sketcher (mdinger) 2014-03-29 12:20:32 +01:00
wmayer
5c63c3cc59 + fixes #0001490: Implement a perimeter circle (3 point circle) similar to solidworks in sketcher (mdinger) 2014-03-29 12:03:17 +01:00
wmayer
cf2ff53488 + issue #0001475: Implement a 3 point arc similar to solidworks in sketcher 2014-03-17 09:41:51 +01:00
wmayer
052966126e + issue #0001475: Implement a 3 point arc similar to solidworks in sketcher 2014-03-17 09:37:56 +01:00
wmayer
41abcd7b3e + issue #0001475: Implement a 3 point arc similar to solidworks in sketcher 2014-03-16 16:03:32 +01:00
wmayer
484d6bcc9a + issue #0001475: Implement a 3 point arc similar to solidworks in sketcher 2014-03-16 13:29:44 +01:00
wmayer
ba207a1848 + fixes #0000844: Cannot use edge hidden by sketch axis as external geometry 2014-03-15 19:53:14 +01:00
wmayer
553a1153db + issue #0001475: Implement a 3 point arc similar to solidworks in sketcher 2014-03-15 12:50:24 +01:00
logari81
d8cca2ad88 Sketcher: fix polyline closing when coincident points are involved 2014-02-12 22:23:43 +01:00
logari81
220930941d + fixes #0000928: Change selection numbering base in the Sketcher from 0 to 1 2014-02-08 23:51:15 +01:00
jriegel
ecae7fac7f 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
ad6e872d82 0001056: Better tooltip for Sketcher Polyline tool 2013-03-16 23:21:45 -03:00
jriegel
0c8cfa92e5 Log in FemMesh view provider and some warnings fixed 2013-02-18 22:29:02 +01:00
wmayer
88c6df966e Show auto-constraints symbol in point mode 2012-12-02 13:27:50 +01:00
logari81
03a413d322 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
c08f4f1925 Fix translation issues 2012-08-31 13:11:52 +02:00
wmayer
5d4a915494 Fix build errors on Windows 2012-08-13 10:26:02 +02:00
logari81
7c5de0b882 Sketcher: crashes fix and other small fixes for the polyline tool 2012-08-12 12:21:53 +02:00
logari81
6a305d0cfb Sketcher: improve position text during geometry creation 2012-08-06 23:05:31 +02:00