Commit Graph

2334 Commits

Author SHA1 Message Date
Yorik van Havre
e595eb898b Draft: Compatibility fix 2020-10-14 17:17:56 +02:00
Yorik van Havre
91f2608607 Draft: Fixed translation of construction group 2020-10-12 16:11:31 +02:00
Yorik van Havre
674d7f25f8 Draft: Fixed patterns + added default pattern size pref option 2020-10-12 15:12:50 +02:00
vocx-fc
cfb314f279 Draft: fix mismatch of argument in get_dxf function
The name of the argument, `projection`, in the old function
is incorrect; it should be `direction`, which was the original
argument's name when this method was split into its own module
(6c00fcf).
2020-10-12 11:48:26 +02:00
vocx-fc
330a5098b5 Arch: consider DraftText objects in the section plane for compatibility
After the reorganization of the Draft Workbench,
the `'DraftText'` objects are now of Proxy.Type `'Text'`.
In the `DraftAnnotation` class the `__setstate__` method
was defined to automatically migrate the Type.

The `Arch SectionPlane` only handles `'Text'` objects. If for
some reason there is still an old `'DraftText'` object
which has not been migrated to the new Type, it won't be found.
This is corrected by adding `'DraftText'` to the list of objects
to process.
2020-10-12 11:43:37 +02:00
John Yani
2cf6d093d6 Proper check for Qt version 2020-09-30 22:36:22 +02:00
Yorik van Havre
c2cec2c38a Merged crowdin translations 2020-09-30 14:37:02 +02:00
Yorik van Havre
545055f65f Updated ts files 2020-09-30 13:06:53 +02:00
John Yani
d5d5301144 Fix indentation 2020-09-30 12:31:15 +02:00
John Yani
826f6c1bf3 HiDPI cursors: Support Qt < 5
Forum thread: https://forum.freecadweb.org/viewtopic.php?p=433621#p433621
2020-09-30 12:31:15 +02:00
vocx-fc
2ce3629443 Draft: importSVG considers Shape-less objects for export
If the object has a `Shape` it uses its bounding box to enlarge
the page size of the SVG. If it does not have a `Shape`
("Draft Text", "Draft Dimension", other `App::FeaturePython`)
it uses `Draft.get_bbox` to calculate one bounding box
from the viewprovider if possible.
2020-09-30 12:06:48 +02:00
vocx-fc
9227330fff Draft: get_bbox function to get the bounding box from RootNode
Normally the bounding box is taken from `Shape.BoundBox`.
Certain objects don't have a `Shape`, like `App::FeaturePythons`,
so the bounding box is calculated from `ViewObject.RootNode`.
2020-09-30 12:06:48 +02:00
Amritpal Singh
58c20b2567 Adopted vocx-fc comment. 2020-09-29 18:50:30 +02:00
Amritpal Singh
b7b24cbb6c Fixed bug: In exporting IFC with shared clone shapes geometry, clone of clone object displaced because of bug in Draft.get_clone_base function. 2020-09-29 18:50:30 +02:00
vocx-fc
d908fad16d Draft: fix loading of arrays 2020-09-22 12:12:00 +02:00
vocx-fc
5465726b85 Draft: split svg.get_path function for paths that are BSplines
If it's not a circle nor ellipse nor straight line
convert the curve to BSpline. Move into a subfunction.

Improve a few varible names to be more verbose, like `vertex`
and `edge`.
2020-09-21 14:25:03 +02:00
vocx-fc
d3cbfa4071 Draft: svg, move test so the code is less indented
The angle between the curve and plane is tested for being coplanar,
0 or 180 degrees. The negative test is done earlier so that the
return is done earlier, and the rest of the code is not indented.
2020-09-21 14:25:03 +02:00
vocx-fc
85397a60bd Draft: split svg.get_path into smaller readable functions
Split the SVG string for circular and elliptical paths.
2020-09-21 14:25:03 +02:00
vocx-fc
0fe7994b42 Draft: split svg.get_text into smaller readable functions
Split the code for SVG string that will be displayed
for TechDraw pages; also split the header for other cases.
2020-09-21 14:25:03 +02:00
vocx-fc
c57ede8ca3 Draft: clean up SVG processing code, add comments
For the try-except blocks we should trap a specific `Exception`,
not just any type. It seems string handling was an issue
with Python 2, so the string needed UTF8 decoding.

When the software no longer supports Python 2, these
blocks can be removed.
2020-09-21 14:25:03 +02:00
vocx-fc
90fb07dbc6 Draft: Drawing is still used in get_dxf function 2020-09-21 14:25:03 +02:00
Zheng, Lei
7ee075325a Draft: fix point array without using link 2020-09-21 14:01:42 +02:00
Zheng, Lei
e3e7686773 Draft: add support for point link array 2020-09-21 14:01:39 +02:00
vocx-fc
7b34a43c16 Draft: small fixes to the closest function.
Correct the Pythonic style for the changes made in 85286bf044.
2020-09-16 13:09:57 +02:00
vocx-fc
b202b0d469 Draft: move getDXF to draftfunctions submodule
Update the appropriate interface in `Draft.py`.
2020-09-16 13:09:13 +02:00
Roy-043
80a1505530 Draft: Again revised the 5 scale unit tests. No longer relying on the math module.
Also avoided the use of a Boolean 'result' variable.
2020-09-16 13:07:50 +02:00
Roy-043
2ac6909671 Draft: Revised the 5 Draft.scale unit tests. No longer using scale_vector_from_center.
The old Draft.scale unit tests uses the scale_vector_from_center function from Draft.scale. This obviously didn't make sense.
2020-09-16 13:07:50 +02:00
Roy-043
19e7cff253 Draft: added 5 scale unit tests to test_modifications
The added functions are test_scale_part_feature_arcs, test_scale_part_feature_lines, test_scale_rectangle, test_scale_spline and test_scale_wire.
When comparing vectors and floats a tolerance of 1e-8 is used, but only for the midpoints of the arcs in test_scale_part_feature_arcs is this tolerance required. Scaling a part feature is not possible with the Draft_Scale command, but Draft.scale does support it.
2020-09-16 13:07:50 +02:00
wmayer
1c9573e8d2 dxf: [skip ci] Coverity: Buffer not null terminated 2020-09-14 14:37:20 +02:00
paul lee
1ff7843357 [ DraftVecUtils.cloest ] Elaborate documentation 2020-09-09 16:01:39 +02:00
paul lee
1227bac5bf [ DraftVecUtils.closet ] Could return the distance (no unit) of the tested point from the found closest point. 2020-09-09 16:01:39 +02:00
Yorik van Havre
5bd018f493 Draft: Small bugfix in DXF exporter 2020-09-09 14:38:16 +02:00
carlopav
41f81b2cff Draft: fixed obj.TypeId output after utils.get_type() change
.


.
2020-09-09 14:13:29 +02:00
carlopav
e78b104a75 Draft: provide the possibility to implement support for Edit in objs
As suggested by @Vanuan. and already implemented in new experimental BIM Wall: 1084a4b0a9
Draft: updated Draft Edit

thanks to the suggestions by @Vanuan
Draft: further bugfixing and improvements in Draft_Edit


Draft: moved Draft_Edit preview code into respective GuiTools
2020-09-09 14:13:29 +02:00
carlopav
1006529999 Draft: support experimental BIM wall in Draft_Edit 2020-09-09 14:13:29 +02:00
Roy-043
5cbf5080d2 Update scale.py 2020-09-09 14:12:43 +02:00
Roy-043
216afe9690 Update gui_stretch.py 2020-09-09 13:16:23 +02:00
vocx-fc
8195f5fdfe Draft: rename svg parameter to fillspaces (lowercase) 2020-09-09 12:53:54 +02:00
vocx-fc
3c2b47e458 Draft: replace FreeCAD with App for consistency 2020-09-09 12:53:54 +02:00
vocx-fc
29a52d0dbc Draft: move getSVG to draftfunctions submodule
Small fixes where the `get_svg` function is used, for example,
in the (obsolete) `DrawingView` class and `Arch_SectionPlane`.

Also update the unit tests accordingly.
2020-09-09 12:53:54 +02:00
Roy-043
48e0b570fc Draft: Fix wire placement issue if Copy=False. 2020-09-08 16:16:16 +02:00
Roy-043
a620ddc0bc Update gui_snapper.py 2020-09-08 16:13:02 +02:00
luz paz
6f62fd09df Fix typos in various files [skip-ci]
Found via `codespell 2.0.dev0`  
```
codespell -q 2 -L aci,ake,aline,alle,alledges,alocation,als,ang,anid,ba,beginn,behaviour,bloaded,byteorder,calculater,cancelled,cancelling,cas,cascade,centimetre,childs,colour,colours,commen,currenty,dof,doubleclick,dum,eiter,elemente,feld,freez,hist,iff,indicies,initialisation,initialise,initialised,initialises,initialisiert,ist,kilometre,lod,mantatory,methode,metres,millimetre,modell,nd,noe,normale,normaly,nto,numer,oder,orgin,orginx,orginy,ot,pard,pres,programm,que,recurrance,rougly,seperator,serie,sinc,strack,substraction,te,thist,thru,tread,uint,unter,vertexes,wallthickness,whitespaces -S ./.git,*.po,*.ts,./ChangeLog.txt,./src/3rdParty,./src/Mod/Assembly/App/opendcm,./src/CXX,./src/zipios++,./src/Base/swig*,./src/Mod/Robot/App/kdl_cp,./src/Mod/Import/App/SCL,./src/WindowsInstaller,./src/Doc/FreeCAD.uml
```
2020-09-04 10:10:31 +02:00
vocx-fc
513c0e9eb4 Draft: new PathTwistedArray object
It takes a `Shape` and replicates it around a path, while at the
same time adding a rotation to each copy. This can be used to create
a twisted "ribcage" from a frame-like object, which can be used
in a more complicated `Shape`, for example, a tunnel or bridge
object.
2020-09-03 12:34:16 +02:00
vocx-fc
17ff22c721 Draft: improve style and indentation of getSVG function
Also rename `getSVG` to `get_svg`.

Instead of testing `obj.isDerivedFrom('Part::Feature')`
we test for a Shape, `hasattr(obj, 'Shape')`.
This is to support the SVG generation of `App::Links`.
2020-09-03 11:40:50 +02:00
vocx-fc
9b0f817992 Draft: move format_point out of getSVG function 2020-09-03 11:40:50 +02:00
vocx-fc
1b53261012 Draft: move getText out of getSVG function 2020-09-03 11:40:50 +02:00
vocx-fc
fe3be86e65 Draft: move getOvershoot out of getSVG function 2020-09-03 11:40:50 +02:00
vocx-fc
620e7c7a03 Draft: move getArrow out of getSVG function 2020-09-03 11:40:50 +02:00
vocx-fc
de393746c7 Draft: move getEllipse out of getSVG function 2020-09-03 11:40:50 +02:00