Commit Graph

15100 Commits

Author SHA1 Message Date
wmayer
7778f25584 copyObject should return the clone of the passed object for recursive copies, not an arbitrary object 2019-02-12 19:40:29 +01:00
wmayer
6e5564707b Py3: fix possible crash in call tips list 2019-02-12 17:14:27 +01:00
wmayer
fb27265934 Expose some standard units and quantities to Python 2019-02-12 15:12:19 +01:00
Bernd Hahnebach
4b08acd301 Material: mat card parser, there are two parsers in FreeCAD, make some comments about the existance of each other 2019-02-12 10:17:50 -02:00
Bernd Hahnebach
e1740c0c10 Material: tools adapt csv and ods 2019-02-12 10:17:50 -02:00
Bernd Hahnebach
d651fce35e Material: cards, fix CardName 2019-02-12 10:17:50 -02:00
Bernd Hahnebach
4e7b3f3526 Material: card steel generic, fix kg unit 2019-02-12 10:17:50 -02:00
Bernd Hahnebach
e3cea848f5 Material: mat cards, add some units to all cards where missing 2019-02-12 10:17:50 -02:00
Bernd Hahnebach
be154a21d4 Material: card reader and writer, use file card name as CardName property 2019-02-12 10:17:50 -02:00
Bernd Hahnebach
f283bd6c96 Material: card reader, fix for values containing a = 2019-02-12 10:17:50 -02:00
Bernd Hahnebach
a8349c135b Material: card writer, some comments 2019-02-12 10:17:50 -02:00
Bernd Hahnebach
5ec5d072e6 Material: card writer, better attribute classification
- move Density from General to Mechanical
- move Source from Meta to General and call it SourceURL
- add ReferenceSource to General
- move specific price, vendor and ProductURL into group cost
2019-02-12 10:17:50 -02:00
Bernd Hahnebach
6421722ae1 Material: card writer, do not handle source as comment in mat card 2019-02-12 10:17:50 -02:00
Bernd Hahnebach
7edfa1e076 Material: card writer, move FreeCAD version info behind matcard info, std in original cards 2019-02-12 10:17:50 -02:00
Bernd Hahnebach
5798813be1 Material: Py3, get rid of extra bees on printing 2019-02-12 10:17:50 -02:00
wmayer
2de2edb3ed fix build failures with newer compiler versions 2019-02-12 13:10:49 +01:00
wmayer
3771f1dbc3 enhance capabilities to render text in splashscreen 2019-02-12 13:09:51 +01:00
wmayer
6730ffebd8 improve exception handling if module to load a file cannot be imported 2019-02-12 13:07:48 +01:00
wmayer
92716f1361 fix minor issues 2019-02-12 11:16:52 +01:00
Abdullah Tahiri
6e33785049 Part: Rearrange inheritance not to use ArcPy
============================================

Inheritance:

Geometry
- GeomPoint
- GeomCurve (GeometryCurvePy)
- - GeomBoundedCurve (BoundedCurvePy)
- - - GeomBezierCurve (BezierCurvePy)
- - - GeomBSplineCurve (BSplineCurvePy)
- - - GeomTrimmedCurve (TrimmedCurvePy)
- - - - GeomArcOfConic (ArcOfConicPy)
- - - - - GeomArcOfCircle (ArcOfCirclePy)
- - - - - GeomArcOfEllipse (ArcOfEllipsePy)
- - - - - GeomArcOfHyperbola (ArcOfHyperbolaPy)
- - - - - GeomArcOfParabola (ArcOfParabolaPy)
- - - - GeomLineSegment (LineSegmentPy)
- - GeomConic
- - - GeomCircle
- - - GeomEllipse
- - - GeomHyperbola
- - - GeomParabola
- - GeomLine
- - GeomOffsetCurve

* Note: ArcPy is also a twinclass of c++ GeomTrimmedCurve, Python ArcPy derives from Python TrimmedCurvePy.

Same functionality as before:

>>> geometries = ActiveSketch.Geometry
>>> line = geometries[1]
>>> arc = geometries[2]
>>> line
<Line segment (-97.4389,42.4463,0) (-80.7887,44.5569,0) >
>>> arc
ArcOfCircle (Radius : 19.3111, Position : (-74.6914, -23.2165, 0), Direction : (0, 0, 1), Parameter : (1.82335, 2.71597))
>>> line.FirstParameter
0.0
>>> line.LastParameter
16.783437032695776
>>> line.setParameterRange(0,20)
>>> line.LastParameter
20.0
>>> arc.StartPoint
Vector (-79.51683708894876, -4.517938119394778, 0.0)
>>> arc.EndPoint
Vector (-92.27963885411512, -15.243140671641918, 0.0)
>>> arc.setParameterRange(1.5,3)
>>> arc
ArcOfCircle (Radius : 19.3111, Position : (-74.6914, -23.2165, 0), Direction : (0, 0, 1), Parameter : (1.5, 3))
>>> geometries[1] = line
>>> geometries[2] = arc
>>> ActiveSketch.Geometry = geometries
>>> ActiveSketch.solve()
0
>>>
2019-02-11 19:13:55 +01:00
Abdullah Tahiri
dbbb1df6f8 Part: expose geometry clone support to python
=============================================

>>> geometries = ActiveSketch.Geometry
>>> geo0 = geometries[0]
>>> geo0.Tag
'a2b6883e-64d6-4348-b567-8b5e0a4896a0'
>>> geo1 = geo0.clone()
>>> geo1.Tag
'a2b6883e-64d6-4348-b567-8b5e0a4896a0'
>>> geo1.Radius = 3
>>> geo0.Tag
'a2b6883e-64d6-4348-b567-8b5e0a4896a0'
>>> geo0.Radius
30.157883192724587
>>> geo1.Tag
'a2b6883e-64d6-4348-b567-8b5e0a4896a0'
>>> geo1.Radius
3.0
2019-02-11 19:13:35 +01:00
Abdullah Tahiri
f4e4f3441f Part: Enable trimmed curves to set their parameter range, from c++ and Python
=============================================================================

>>> geometries = ActiveSketch.Geometry
>>> geo2 = geometries[2]
>>> geo2
ArcOfCircle (Radius : 27.5267, Position : (-70.4702, -31.8933, 0), Direction : (0, 0, 1), Parameter : (1.34187, 2.35619))
>>> geo2.setParameterRange(1,3)
>>> geometries[2]=geo2
>>> ActiveSketch.Geometry=geometries
2019-02-11 19:13:16 +01:00
Abdullah Tahiri
52cfac509a Part: Python Bounded Curve (bring in accordance with c++)
Inheritance correspondence:

Geometry
- GeomPoint
- GeomCurve (GeometryCurvePy)
- - GeomBoundedCurve (BoundedCurvePy)
- - - GeomBezierCurve (BezierCurvePy)
- - - GeomBSplineCurve (BSplineCurvePy)
- - - GeomTrimmedCurve (ArcPy)
- - - - GeomArcOfConic (ArcOfConicPy)
- - - - - GeomArcOfCircle (ArcOfCirclePy)
- - - - - GeomArcOfEllipse (ArcOfEllipsePy)
- - - - - GeomArcOfHyperbola (ArcOfHyperbolaPy)
- - - - - GeomArcOfParabola (ArcOfParabolaPy)
- - - - GeomLineSegment (LineSegmentPy)
- - GeomConic
- - - GeomCircle
- - - GeomEllipse
- - - GeomHyperbola
- - - GeomParabola
- - GeomLine
- - GeomOffsetCurve
2019-02-11 19:12:50 +01:00
wmayer
eafbf5364b fix regression in German translation 2019-02-11 17:51:36 +01:00
wmayer
47b822aafd split question text from warning text 2019-02-11 17:03:51 +01:00
luz.paz
4154f5dce5 Crowdin: cont... 2019-02-11 16:22:13 +01:00
luz.paz
745f0cb3b4 Crowdin: Continuing to refine translation strings 2019-02-11 16:22:12 +01:00
wmayer
332baed6a6 Use QString's multi-arg overload to save memory allocations. [-Wclazy-qstring-arg] 2019-02-11 16:12:50 +01:00
Mateusz Skowroński
963b400a4b Use QHash<K,T> instead of QMap<K,T> when K is a pointer. [-Wclazy-qmap-with-pointer-key] Thanks Clazy! 2019-02-11 15:39:15 +01:00
Mateusz Skowroński
5d8497d848 Use faster form of QFileInfo(filename).exists(). [-Wclazy-qfileinfo-exists] Thanks Clazy! 2019-02-11 15:39:15 +01:00
Mateusz Skowroński
7ba96b5f02 Remove unused non-trivial variables. [-Wclazy-unused-non-trivial-variable] Thanks Clazy! 2019-02-11 15:39:15 +01:00
Mateusz Skowroński
ac508516da Use QString's multi-arg overload to save memory allocations. [-Wclazy-qstring-arg] Thanks Clazy! 2019-02-11 15:39:14 +01:00
Bernd Hahnebach
f98e930185 Material: Py3 fixes in mat card writer 2019-02-11 15:18:24 +01:00
wmayer
c64aec5fd2 simplify creation of strings 2019-02-11 13:46:58 +01:00
wmayer
6536d386d3 simplify creation of string 2019-02-11 13:03:51 +01:00
wmayer
0e60e897ef Fix theoretically possible format string vulnerability 2019-02-11 11:49:12 +01:00
Yorik van Havre
9a6ed6ad8b Draft: Small bugfix 2019-02-09 20:37:36 -02:00
donovaly
d0008e6756 export Flattened SVG fixes for python 3
To be able to export as flattened SVG with the Conda build of FC one needs these fixes.
2019-02-09 20:01:44 -02:00
carlopav
17dde5600a Update DraftTools.py
Updated first part of file from FreeCAD/FreeCAD
2019-02-09 20:00:38 -02:00
carlopav
88b29d3bd4 Update DraftTools.py
Refined last commit code
2019-02-09 20:00:38 -02:00
carlopav
7f3235ef13 Update DraftTools.py
Modified arc editing:
- middle editpoint control radius
- end editpoint control first and last angle;
2019-02-09 20:00:38 -02:00
carlopav
d6b703a68d Update DraftTools.py
Update Edit tool to edit wall base objects.
2019-02-09 20:00:38 -02:00
furti
f1e86b3e11 Fix missing DWG imports in ArchSectionPlane.getSVG
When a DWG file is imported into FreeCAD it gets imported as a Part
object with a compound shape. One would imagine, that such an object
should be rendered like a symbol inside a TechDraw View. But when the
imported shape is inside a SectionPlane that also contains solids, the
shape is not included in the SVG.

The problem is, that getCutShapes only uses solid shapes, when a volume
was cut before. But the imported DWG is a flat 2D object and has no solids
inside.

To fix it, the getSVG method will check if an object looks like a draft
object, meaning:
 - It has a shape
 - It has no solids
 - It has no volume

When it finds such a shape, it will treat it like a draft object. So
it is displayed like a symbol in the resulting SVG.

https://forum.freecadweb.org/viewtopic.php?f=3&t=34079
2019-02-09 19:53:54 -02:00
Yorik van Havre
3cc1a327ce Updated master translation files 2019-02-08 19:16:21 -02:00
Yorik van Havre
76d9d655cf Tools: Updated translation scripts to handle only the master (untranslated) ts files 2019-02-08 19:15:56 -02:00
Yorik van Havre
5b29009cf0 Added untranslated 'master' .ts files where missing 2019-02-08 18:50:13 -02:00
Yorik van Havre
5360dc5e0c Tools: Discard obsolete strings in translation files 2019-02-08 18:32:10 -02:00
GeneGH
2549d1cfc4 Repair pythonopen in line 126 for Python3
Python 3 is fussy about match of data type for a file open or write. Python 2 does not seem to care if a string is written with a 'wb' indicating a binary type, but Python 3 flags it as an error.
2019-02-08 11:06:05 -02:00
furti
1610046905 Fix missing door symbols in getSVG
The ArchSectionPlane has a built in SVG Cache. But the door symbols and
a few other things are not inside the cache. This things not inside the
cache rely on the presence of a cutface. But this cutface was only built
when the cache is not available.

So the First invocation after the cache was cleared added the symbols.
The next invocations of the method, with a cached SVG did not calculate
the symbols again, because the cutfaces where missing.

This commit fixes it by calculating the cutfaces independent from the
cache.

Reported in https://forum.freecadweb.org/viewtopic.php?f=3&t=33987
2019-02-08 11:05:17 -02:00
luz.paz
fe39347b05 Typos cont. + whitespace 2019-02-08 11:01:24 -02:00