Commit Graph

5202 Commits

Author SHA1 Message Date
wmayer
d3bc389765 + exception handling if moving sketch fails 2015-01-04 13:02:11 +01:00
wmayer
4cfc2a1a08 Merge branch 'master' of ssh://git.code.sf.net/p/free-cad/code 2015-01-03 22:39:45 +01:00
wmayer
6c187572c7 + fix undo/redo issues with ortho views 2015-01-03 22:39:07 +01:00
Yorik van Havre
9b9526e4cc Arch: fixed behaviour of clones of windows - fixes #1841 2015-01-03 15:40:02 -02:00
Yorik van Havre
3db987d9b7 Draft: Added a Fuse property to Array objects - fixes #1768 2015-01-03 14:47:29 -02:00
wmayer
d8e0df9e97 + fixes #0001678: Visibility property is ignored on drawing sheets 2015-01-03 17:09:17 +01:00
wmayer
e7963472b0 + close drawing view when deleting page object 2015-01-03 14:23:17 +01:00
wmayer
3614a08911 + fixes #0001698: All drawing pages are opened automatically when opening a project file 2015-01-03 13:45:12 +01:00
wmayer
c47eea61fa + return point/facet indices as unsigned long in Python 2015-01-03 11:24:57 +01:00
Yorik van Havre
77882051fa Draft: Made initial Face mode dependent on fill mode pref setting - fixes #1812 2015-01-02 19:53:39 -02:00
wmayer
08828e5dc0 + fixes #0001225: Allow User to Rotate Arc Radius Constraint Text and Leader 2015-01-02 21:26:03 +01:00
Yorik van Havre
fe994efa66 Draft: Fixed import of DXF splines - fixes #1743 2015-01-02 17:05:27 -02:00
Yorik van Havre
12afbc9ed5 Arch: trivial bugfix 2015-01-02 16:49:31 -02:00
Yorik van Havre
1dd069ec7f Raytracing: added transparency to lux feature - fixes #1771 2015-01-02 16:48:35 -02:00
wmayer
393d64d53c + fixes #0000498: 'Measure Distance' tool sometimes renders distances inside of solid objects 2015-01-02 14:57:14 +01:00
wmayer
26666a1fda + minor optimization 2015-01-02 12:26:29 +01:00
DeepSOIC
c4fb8fc8ae Sketcher: AngleViaPoint: revert from OCC angle precalculation
Returning back to the slow temporary-sketch-based
calculateAngleViaPoint, because OCC-based version was incompatible with
always-CCW sketcher geometry. More info in "Sketch: how to handle
reversed external arcs?" forum thread
http://forum.freecadweb.org/viewtopic.php?f=10&t=9130&sid=1b994fa1236db5ac2371eeb9a53de23f
2015-01-02 11:48:34 +01:00
DeepSOIC
93d00b2dab Sketcher: validateConstraint update
Refactor validateConstraint and add angle-via-point and snell's law
support there.
2015-01-02 11:48:33 +01:00
DeepSOIC
684036fae8 Sketcher Ellipse: code cleanup
deleting redundant overloaded functions involving arc-of-ellipse, a few
todo comments, not implemented methods, System(constraintlist)
constructor.
2015-01-02 11:48:33 +01:00
DeepSOIC
ab7d980de0 Sketcher: solver rebranding - renamed directory
Sketcher: solver rebranding - updated references

cleanup

Sketcher: GCS: remove unused NAN and INF
2015-01-02 11:48:32 +01:00
DeepSOIC
9cc2ff7944 Sketcher Constraints: small code refactor
Unifying first checks in grad().
2015-01-02 11:48:32 +01:00
DeepSOIC
8660d9a914 Sketcher Ellipse: porting to DeriVector2
Sketcher Ellipse: porting tangent-line to DeriVector2

Replacing a ton of unreadable, sage generated math code with
easy-to-manage C++ code.

Sketcher Ellipse: porting internal align-t to DeriVector2

Sketcher Ellipse: small math refactor; const members

Moving the repeating code computing deriv+value of major radius to a
method of GCS::Ellipse.
Marking several methods of DeriVector2 as const member functions.

Sketcher Ellipse: porting arc angle rules to DeriVector2

Just porting.
Probably a complete remake of the concept is worth... Angles can be
calculated explicitly, there's no need to load the solver. I see no
benefits whatsoever on using the solver to keep track of angle values.

Sketcher Ellipse: porting equality to DeriVector2
2015-01-02 11:48:31 +01:00
DeepSOIC
43e8b30846 OpticConstraints: Adding Snell's law
Fix AngleViaPoint to support new derivative calculation technique.

OpticConstraints: Adding Snell's law. Fix AngleViaPoint to support new derivative calculation technique.

Snell's law constraint added to GCS, but not yet exposed and cannot be
tested.
Since the way CalculateNormal() returns derivatives had changed,
AngleViaPoint constraint needed modifications. Nothing serious.

OpticConstraints: SnellsLaw progress

Addable through python. Fix math. Some quick-and-dirty visual stuff to
get rid of hangs and to see the constraint in action.

OpticConstraints: SnellsLaw: flipping logic fix

OpticConstraints: SnellsLaw progress

Added toolbar button. Allowed editing a datum by doubleclick. New error
message approach during constraint creation.

OpticConstraints: SnellsLaw

OpticConstraints: SnellsLaw: list label improvement

OpticConstraints: SnellsLaw: fix after rebase

OpticConstraints: SnellsLaw: expose helper constraints

Snell's law internally is made of three constraints: point-on-object,
coincident and the Snell's sin/sin. They were all buried under one UI
constraint. Exposing them allows to construct reflection and
birefringence on the point (attempting to do so used to result in
redundant constraints and was often not functional at all).
This commit breaks compatibility with older files.

OpticConstraints: SnellsLaw: small refactor of math

Placing the duplicated code of error and gradient calculation into a
private method.

OpticConstraints: SnellsLaw: fix datum edit unit

OpticConstraints: SnellsLaw: fix datum edit bug

After previous fix, the dimensionless value was not accepted (the
constraint's value did not change, the changes were ignored).
2015-01-02 11:48:31 +01:00
DeepSOIC
68ec9e44f8 OpticConstraints: SnellsLaw: icon 2015-01-02 11:48:30 +01:00
DeepSOIC
397e37ad1c GCS: fundamental changes to simplify derivatives
GCS::Vector2D was morphed into a DeriVector2, a derivative-aware vector.
A bunch of vector math methods were added that implicitly calculate
respective derivatives. Now, there is no need to calculate the partials
- most is done implicitly.
2015-01-02 11:48:30 +01:00
DeepSOIC
3838bddcdb AngleViaPoint Constraint
AngleViaPoint: fixes in UI routines + new messages

Goofed undo message in tangency via point is fixed.
Forgotten updateActive, clearSelection have been added.
New more informative error messages for tangent constraint.

AngleViaPoint: using it instead of via line tangency

* replaced the helper construction line for ellipse-to-ellipse and
similar tangency with a point. Using tangent-via-point there
* deleted tangency via line for point-to-point on
(cherry picked from commit 9e3fa8c8de0f49c0ef3c978e015eb905358dbdd9)

AngleViaPoint: internal/external tangency locking

*Added automatic tangency type lockdown for all new constraints (only
for point-wise tangency).
Tangency type is stored in the constraint datum field, as an angle value
shifted by Pi/2 (to be able to treat 0.0 as undefined type).
Added ability to switch the tangency by setting datum value from python
(can be abused by passing arbitrary angle).
Further simplified the tangency related code in Sketch.cpp.

AngleViaPoint: added license to Geo.cpp

AngleViaPoint: renames in Constraints.cpp/.h

Changed some names to increase self-explanatoryness:
bool "remapped" renamed to "pvecChangedFlag"
"ReconstructEverything()" renamed to "ReconstructGeomPointers()"

AngleViaPoint: renames in Constraints.cpp/.h

Changed some names to increase self-explanatoryness:
bool "remapped" renamed to "pvecChangedFlag"
"ReconstructEverything()" renamed to "ReconstructGeomPointers()"

AngleViaPoint: using for endpoint perpendicularity

+ direction lockdown, just as with tangency.
+ quite a lot of old code is gone because of that

AngleViaPoint: perp-ty UI routine made similar to tangent

(Git has made a very messy diff.)
The changes are:
* Perpendicularity-via-point (3-element selection) support added.
* Endpoint-to-curve and endpoint-to-endpoint supports all shape
combinations.
* a bit of code cleanup and clarifications.

AngleViaPoint: placement of perpendicular icon in 3d view

AngleViaPoint: fix: allow setDatum of perpendicular constraint

AngleViaPoint: fix: centers of ellipses are not endpoints

isSimpleVertex used to return false for centers of ellipses and arcs of
ellipses, which made them being accepted for point-to-point tangency.
Should be fixed forever, mo more changes are expected to be necessary
for new types of geometry.

AngleViaPoint: precalc with OCC (work in progress)

Work in progress (not yet working).
Using OCC's tangent to replace implementation of
SketchObject::calculateAngleViaPoint.

AngleViaPoint: fix math: normal now points inwards, where it was intended initially and goofed up.

AngleViaPoint: adding comments to the code

AngleViaPoint: using GeomCurve::closestParameterToBasicCurve for angle precalculation

AngleViaPoint: Py method: changeConstraintsLocking

changeConstraintsLocking(True) - locks/re-locks all lockable
tangency/perpendicularity constraints of the sketch (applicable to
existing sketches).
changeConstraintsLocking(False) - removes locking information from
lockable constraints

AngleViaPoint: final SketchObject::calculateAngleViaPoint

Now, finally, using OCC functionality (thanks Abdullah!), without
composing temporary Sketch object.
2015-01-02 11:48:29 +01:00
DeepSOIC
9f821e06b5 Sketcher: Responsivity tweaks and AngleViaPoint Constraint
Solver iteration limit independent of system size (reduces hangs when
solver fails to converge).
Repaint() instead of update() to force render for every movePoint.

Sketcher: New Constraint AngleViaPoint

* Adding generic CalculateNormal() method
* Reconfiguration of GCS geometry classes: adding a base class "Curve",
that has a pure virtual function CalculateNormal().
* Initial inplementation of the new function.
* adding Vector2D class (I wanted to reuse the existing, but got wierd
compile errors, so implemented a new one... TODO.)
* Adding redirection support into GCS shapes. Adding a Copy method to
GCS::Curve.
* Automatic point-on-object
* Angle precalculation: when AngleViaPoint is added, angle is properly calculated based on
existing geometry.
* Added tangency-via-point using one.
* Implemented placement of tangency-via-point icon in 3d view. Also
affected is the placement of point-on-object icon (since it is very
similar code, it is now shared with tangency-via-point)
* Placement and moving of angle datum
Functions: calculateAngleViaPoint, isPointOnCurve,
calculateConstraintError exposed to python
* Endpoint tangency: All endpoint-to-endpoint and endpoint-to-curve tangency now works
through AngleViaPoint constraint and obsolete code clean up (most procedures
addConstraintTangentXXX2YYY)
2015-01-02 11:48:28 +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
Sebastian Hoogen
a8dd528c1a Build python Qt resource files at compile time
fixes #1888
2015-01-02 11:14:07 +01:00
Yorik van Havre
f3af41e4cc Merge branch 'master' of ssh://git.code.sf.net/p/free-cad/code 2015-01-01 19:06:26 -02:00
Yorik van Havre
051b38b1c1 Arch: temporarily disabled custom subvolume in windows 2015-01-01 19:06:11 -02:00
Yorik van Havre
60b648b053 Arch: Equipments now take the diffuse color of their base object on creation 2015-01-01 19:06:00 -02:00
wmayer
f545455466 + fixes #0001889: Crash when undoing move of base object of a part fillet 2015-01-01 21:05:19 +01:00
Yorik van Havre
2680395ede Draft: adapt icon sizes from preferences settings - fixes #1783 2014-12-31 21:23:24 -02:00
Yorik van Havre
845849fa91 Arch: implemented reading & writing of Ifc properties in IFC files 2014-12-31 18:35:39 -02:00
Yorik van Havre
244373779d Arch: Fixed IFC import bug - fixes #1887 2014-12-31 15:21:41 -02:00
Yorik van Havre
3f607d73a4 Arch: Fixed Arch example - fixes #1789 2014-12-31 14:42:22 -02:00
Yorik van Havre
cb5a807990 Arch: Added a MoveWithHost property to all Arch objects which specifies if they must be moved/rotated together with their parent - fixes #1820 2014-12-31 14:04:23 -02:00
Yorik van Havre
1f9ecfa509 Draft: Better error messages when trying to convert a bspline to a sketch 2014-12-31 13:17:25 -02:00
wmayer
ca5062cbfe + fixes #0001885: Unhandled exception when trying to enter edit-mode for objects while drawing view is active 2014-12-31 14:08:03 +01:00
wmayer
4d618955b3 + fixes #0001884: Crash when double-clicking on Clip element with drawing page closed 2014-12-31 13:15:33 +01:00
wmayer
b2f8a4ed2a + fixes #0001723: Display errormessage in tree in tooltip 2014-12-30 22:44:29 +01:00
wmayer
2c53bd1e9a + fixes #0001670: Orthographic projection: scale/position is empty when unchecking 'Auto scale/position' 2014-12-30 19:14:07 +01:00
wmayer
c231866b8d + fixes #0001746: Part Fillet and Chamfer do not show correct length/radius when editing old items 2014-12-30 17:20:32 +01:00
wmayer
ff09f0524d + fixes #0001656: Vertical/horizontal distance constraint confuses for a line or two points 2014-12-30 15:20:29 +01:00
wmayer
fba0ef0671 + fixes #0001657: Sketcher: First digit can not be deleted when editing grid size 2014-12-30 14:18:02 +01:00
wmayer
7aa91ecee3 + fixes #0001760: FC fails to load a *.FCStd file if the filename lacks the *.FCStd file extension 2014-12-30 00:31:39 +01:00
wmayer
72f947433c Merge branch 'master' of ssh://git.code.sf.net/p/free-cad/code 2014-12-29 22:28:52 +01:00
wmayer
f51daa88e0 + fixes #0001819: Getter Methods for Data inside a sketch 2014-12-29 22:28:12 +01:00
Yorik van Havre
2f78c021db Arch: Fixed encodings in Survey - fixes #1825 2014-12-29 18:54:33 -02:00