Commit Graph

2329 Commits

Author SHA1 Message Date
John Yani
6ff1bcb2e7 Proper check for Qt version 2020-09-30 22:36:22 +02:00
Yorik van Havre
089ed768cc Merged crowdin translations 2020-09-30 14:37:02 +02:00
Yorik van Havre
2a92a7b5a7 Updated ts files 2020-09-30 13:06:53 +02:00
John Yani
7208e757b9 Fix indentation 2020-09-30 12:31:15 +02:00
John Yani
a76bdab449 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
f23bb43004 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
49e1ff1bcf 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
21e1dff25c Adopted vocx-fc comment. 2020-09-29 18:50:30 +02:00
Amritpal Singh
c64d0bf991 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
621e1d603b Draft: fix loading of arrays 2020-09-22 12:12:00 +02:00
vocx-fc
6379d802b1 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
f2d10669e5 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
8e69b05e9d 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
2f48f1caba 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
0739ffa58e 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
dea7f5d638 Draft: Drawing is still used in get_dxf function 2020-09-21 14:25:03 +02:00
Zheng, Lei
31e8bb27a6 Draft: fix point array without using link 2020-09-21 14:01:42 +02:00
Zheng, Lei
607c14b512 Draft: add support for point link array 2020-09-21 14:01:39 +02:00
vocx-fc
7a93bcb151 Draft: small fixes to the closest function.
Correct the Pythonic style for the changes made in ea16bb9394.
2020-09-16 13:09:57 +02:00
vocx-fc
c79f890112 Draft: move getDXF to draftfunctions submodule
Update the appropriate interface in `Draft.py`.
2020-09-16 13:09:13 +02:00
Roy-043
2cf9f395c1 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
30fd275089 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
687461cf15 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
c3d35c65fe dxf: [skip ci] Coverity: Buffer not null terminated 2020-09-14 14:37:20 +02:00
paul lee
be42d1b6cc [ DraftVecUtils.cloest ] Elaborate documentation 2020-09-09 16:01:39 +02:00
paul lee
ea16bb9394 [ 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
dc97e31707 Draft: Small bugfix in DXF exporter 2020-09-09 14:38:16 +02:00
carlopav
6f2691631c Draft: fixed obj.TypeId output after utils.get_type() change
.


.
2020-09-09 14:13:29 +02:00
carlopav
28c00f8383 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
8e1bb66cf2 Draft: support experimental BIM wall in Draft_Edit 2020-09-09 14:13:29 +02:00
Roy-043
7f415b4b58 Update scale.py 2020-09-09 14:12:43 +02:00
Roy-043
2d11f16e9d Update gui_stretch.py 2020-09-09 13:16:23 +02:00
vocx-fc
5cf799dd85 Draft: rename svg parameter to fillspaces (lowercase) 2020-09-09 12:53:54 +02:00
vocx-fc
b835e5f29d Draft: replace FreeCAD with App for consistency 2020-09-09 12:53:54 +02:00
vocx-fc
7627d0b81a 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
db947e3513 Draft: Fix wire placement issue if Copy=False. 2020-09-08 16:16:16 +02:00
Roy-043
4c0bd797fe Update gui_snapper.py 2020-09-08 16:13:02 +02:00
luz paz
5cd408687b 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
e477283ffc 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
4b8ebccc7d 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
4bf665a6fd Draft: move format_point out of getSVG function 2020-09-03 11:40:50 +02:00
vocx-fc
775c4d0a97 Draft: move getText out of getSVG function 2020-09-03 11:40:50 +02:00
vocx-fc
67c0af7b53 Draft: move getOvershoot out of getSVG function 2020-09-03 11:40:50 +02:00
vocx-fc
f240972ffa Draft: move getArrow out of getSVG function 2020-09-03 11:40:50 +02:00
vocx-fc
6eccf47848 Draft: move getEllipse out of getSVG function 2020-09-03 11:40:50 +02:00
vocx-fc
4c498e132e Draft: move getCircle out of getSVG function 2020-09-03 11:40:50 +02:00
vocx-fc
04afa25f91 Draft: move getPath out of getSVG function 2020-09-03 11:40:50 +02:00
vocx-fc
3e12316977 Draft: rename getPattern to get_pattern 2020-09-03 11:40:50 +02:00
vocx-fc
cfce1a8ad2 Draft: rename getDiscretized to get_discretized 2020-09-03 11:40:50 +02:00
vocx-fc
e61efd9e6d Draft: rename getProj to get_proj 2020-09-03 11:40:50 +02:00