Commit Graph

71 Commits

Author SHA1 Message Date
Yorik van Havre
b64b3be330 Arch: Fixed display of axis bubbles and texts on DXF export and Techdraw pages 2021-12-16 15:55:58 +01:00
Roy
ce0563b385 Draft: Fix Part_Line offset issue 2021-12-10 02:40:16 +01:00
luz paz
bcc2873fb9 Draft: fix doxygen typos 2021-12-07 22:53:54 -06:00
Yorik van Havre
960c626b1d Draft: Use BuildingParts as group in Draft SVG projections 2021-08-26 14:54:33 +02:00
Roy-043
259868dfa9 Draft: Fixed units mismatch when moving Draft_Point objects
obj.X.Value instead of float(obj.X)
2021-08-01 13:13:35 +02:00
Roy-043
20edc524f2 Draft: Fixed units mismatch when moving Draft_Point objects. 2021-08-01 13:13:35 +02:00
luz paz
78d3d0039f Crowdin: fix Draft mirror code typo
ref: https://crowdin.com/translate/freecad/548/en-en?filter=basic&value=2#6587132
2021-05-20 16:02:34 -04:00
Yorik van Havre
6e9c157cd5 Draft: Fixed last commit (stroke endcap -> stroke-linecap) 2021-05-06 18:49:55 +02:00
Yorik van Havre
e37e8eddfb Draft: Using square endcaps for lines in SVG output 2021-05-06 18:38:32 +02:00
Yorik van Havre
abee35f38a Draft: Fixed broken translations everywhere 2021-02-12 14:44:58 +01:00
Chris Hennes
a7522c384e [DRAFT] Catch only Exception, not BaseException 2021-02-11 11:52:45 +01:00
Yorik van Havre
96dc265f5b Merge pull request #4341 from hyarion/feature-error-handling-get_svg
[0.19] [Draft] Add better error message in get_svg for direction
2021-02-08 16:08:18 +01:00
luz paz
19d0e1123f Draft: fix LGTM 'Testing for None should use the 'is' operator' alerrts
https://lgtm.com/projects/g/FreeCAD/FreeCAD/alerts/?mode=tree&ruleFocus=7900090
2021-02-03 21:58:47 +01:00
Benjamin Nauck
ce7856d51f [Draft] Add better error message in get_svg for direction
An AttributeError is raised when `direction=Vector(0,0,0)` and obj is
an Arch::Space on line: a3fb3cc804/src/Mod/Draft/draftfunctions/svg.py (L799)

This patch checks if early on if the direction vector and raises a
ValueError with a description of what has gone wrong.

A caveat with this solution is that this new behaviour might break old
code which depends on that invalid directions can be used.
2021-01-31 20:24:59 +01:00
marioalexis
045accd3f2 Draft: Replace Part.getSortedClusters by Part.sortEdges in draftify function 2020-12-29 23:21:33 -03:00
Yorik van Havre
5bccc5c588 Draft: Small layer improvements
- Added 'Print Line Color' property
- Added 'Add new layer' context menu action to layers group
2020-12-15 16:43:33 +01:00
Yorik van Havre
b168dfaec9 Merge pull request #4100 from marioalexis84/draft-upgrade
Draft: Improve makeWires in upgrade function
2020-12-14 11:59:21 +01:00
luz paz
fc99ff2def Draft: fix header uniformity + trailing whitespace
[skip ci]
2020-12-11 13:19:49 +01:00
marioalexis
7c20483c12 Draft: Improve makeWires in upgrade function 2020-12-09 15:21:33 -03:00
marioalexis
a11b457121 Draft: Some fixes in upgrade function. bug #0004460, fixes #0004462, #0004080 2020-11-24 22:08:06 -03:00
Yorik van Havre
c465fbd799 Draft: Fixed bug in SVG projection fill 2020-11-19 13:53:44 +01:00
Yorik van Havre
0b609773fe Arch: fixed placement of Space label on TD pages 2020-10-26 10:35:40 +01:00
Yorik van Havre
49299e0ad2 Draft: allow to scale imageplanes 2020-10-20 13:31:40 +02:00
vocx-fc
2d00e2ded6 Draft: split svg.get_svg into subfunctions (2)
Define a subfunction to process Draft "Dimension" (v0.18)
or "LinearDimension" (v0.19) objects.
2020-10-19 13:23:04 +02:00
vocx-fc
772466ea4b Draft: split svg.get_svg into subfunctions
Define a subfunction to process `Part.Shape` objects.
2020-10-19 13:23:04 +02:00
vocx-fc
73db0999c0 Draft: move svg subfunctions to svgshapes.py module 2020-10-19 13:23:04 +02:00
vocx-fc
084d63a563 Draft: move svg subfunctions to svgtext.py module 2020-10-19 13:23:04 +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
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
vocx-fc
b202b0d469 Draft: move getDXF to draftfunctions submodule
Update the appropriate interface in `Draft.py`.
2020-09-16 13:09:13 +02:00
carlopav
41f81b2cff Draft: fixed obj.TypeId output after utils.get_type() change
.


.
2020-09-09 14:13:29 +02:00
Roy-043
5cbf5080d2 Update scale.py 2020-09-09 14:12:43 +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
vocx-fc
1d48e9fb47 Draft: add modules of draftfunctions to the proper Doxygen group
This includes `array`, `cut`, `downgrade`, `draftiffy`, `extrude`,
`fuse`, `heal`, `join`, `mirror`, `move`, `offset`, `rotate`,
`scale`, `split` and `upgrade`.

These are added to the `draftfunction` Doxygen group
so that the functions contained in each module are listed
appropriately in the automatically generated documentation.
2020-07-17 13:01:45 +02:00
vocx-fc
1c65c7dc92 Draft: add Doxygen strings to the packages' __init__ files
The packages are `draftfunctions`, `draftgeoutils`, `draftguitools`,
`draftmake`, `draftobjects`, `drafttaskpanels`, `drafttests`,
`draftutils`, `draftviewproviders`.
2020-07-17 13:01:45 +02:00
vocx-fc
314637e945 Draft: move grouping functions to draftutils.groups module
These functions were previously in `draftutils.utils`,
and are related to grouping objects and finding objects
inside groups. These include `get_group_names`, `ungroup`,
`get_windows`, `get_group_contents`, `get_movable_children`.
These are imported in the main `Draft.py` module, so compatibility
is retained.

Modules which use these functions are updated; these include
Gui Commands like `Move`, `Rotate`, `Scale`, `AddToGroup`,
as well as objects like `DrawingView` and `Shape2DView`,
and `ViewProviderClone`.
The code inside the `importDXF` module is also updated.

The Arch Workbench uses many of these functions
but it does so from the `Draft` namespace, so these edits
don't change the situation for these commands.
2020-07-13 14:35:38 +02:00
carlopav
e30cf42176 Draft: Draft.move() support new objects (fix #3754)
and small refactor consequent to the introduction of App.ActiveDocument.copyObject support in Draft.makeCopy()
2020-07-07 10:12:49 +02:00
carlopav
7e72d0778d Draft: support for Document.copyObject() API
Now Draft can copy every FreeCAD object that have a shape.
2020-07-07 10:12:49 +02:00
vocx-fc
0f5b61e280 Draft: check GUI in upgrade function before using viewprovider
Also make various improvements in style, PEP8, return value
is now a tuple of lists instead of a list of lists.

Delay the import of other modules like `Part` and `DraftGeomUtils`
using the `LazyLoader` class.

Update the Gui Command as well.
2020-05-18 12:17:59 +02:00
vocx-fc
bb4a7d783c Draft: check GUI in downgrade before using viewprovider
Also make various improvements in style, PEP8, return value
is now a tuple of lists instead of a list of lists.

Update the Gui Command as well.
2020-05-18 12:17:59 +02:00
vocx-fc
cb984ec492 Draft: check GUI before touching the ViewObject in cut 2020-05-18 12:17:59 +02:00
carlopav
0e9d274bf4 Draft: various cleanup
Mainly added an empty line at the end of each file and changed docstrings.
2020-05-15 14:43:26 +02:00