Commit Graph

191 Commits

Author SHA1 Message Date
Roy-043
f03c89542f Draft: Avoid faulty Base.Placement.rotate() in draftobjects.array.py 2022-07-28 13:56:05 +02:00
marioalexis
79b7bfd5d0 Draft: Remove Python 2 type support 2022-03-28 18:02:23 -03:00
Matthijs Kooijman
b7c94992c9 Draft: Simplify using getattr instead of hasattr
Using the default argument supported by getattr makes this code a bit
simpler and probably (ever so slightly) faster.

See https://forum.freecadweb.org/viewtopic.php?f=10&t=58611 for previous
discussion.

This is not an exhaustive change, these are just a few I encounted while
working with the code.
2022-03-22 14:46:50 +01:00
Roy-043
6a1d81f62b Draft: Fix Draft_Line Length is zero bug
When changing the Length of a Draft_Line to f.e. 0.5 the input of the zero resulted in a zero length line.
2022-02-24 12:26:42 +01:00
marioalexis
b4c20bce20 Draft: Replace Drawing functions with TechDraw functions 2022-02-20 16:34:29 -03:00
mwganson
56ba572850 Draft: pointarray set Count property during execute 2022-01-26 20:32:31 -06:00
marioalexis
9c4661fefe Draft: Add extension 'AttachExtensionPython' to WP proxy 2022-01-10 23:11:30 -03:00
Zheng, Lei
875452c020 Draft: support 'CopyOnChange' in Draft link array 2021-12-21 21:41:02 -07:00
Roy
418ca4a235 Draft: Draft_Label fix label type list 2021-12-10 18:40:43 +01:00
Roy-043
21a8c21020 Draft: fix regression draftlink.py (#5220)
* Draft: fix regression draftlink.py

This PR fixes a regression introduces with #5180.

Using transformShape is the correct solution.
2021-12-08 07:37:23 -06:00
Roy-043
5435d3b0ee Draft: fix array issue with Draft_Point and Part_Vertex 2021-11-16 17:00:54 +01:00
luz paz
8aab47fb06 Draft: Fix superfluous whitespace in translations + misc. typos 2021-10-30 15:20:28 -04:00
Roy-043
844597c08e Draft: improve hatch matrix algo 2021-10-13 17:38:08 +02:00
Roy-043
2196179cb1 Update hatch.py 2021-10-05 15:57:00 +02:00
Chris Hennes
f99059e371 Draft: LGTM - don't catch BaseException 2021-09-19 14:36:38 -05:00
Yorik van Havre
2bf67f0191 Draft: Introduced Hatch command + object 2021-09-06 15:27:52 +02:00
Yorik van Havre
785a5023c4 Merge pull request #4885 from Roy-043/Draft_Fix_Array_Count_Issues
Draft: Fix Draft_PointArray and Draft_TwistedArray Count problems
2021-08-17 15:19:57 +02:00
Roy-043
7f1a2d6c8d Draft: Fix patharray edge sort issue
If the user selects edges for the path of a patharray the edges need to be sorted before creating a Part.Wire from them.
2021-08-01 13:12:44 +02:00
Yorik van Havre
10faf786c8 Draft: Fixed wrong placement of lines in shape2dview's cutface mode 2021-07-16 12:42:30 +02:00
Yorik van Havre
c0efc7fa32 Draft: added AutoUpdate property to shape2Dviews to disambiguate with VisibleOnly property 2021-07-07 15:45:22 +02:00
Yorik van Havre
3a6becbfe7 Arch: Added Depth property to SectionPlanes 2021-07-01 13:46:24 +02:00
Roy-043
a9cb197379 Draft: Fix Draft_PointArray and Draft_TwistedArray Count problems
Draft_PointArray and Draft_TwistedArray have Count problems:
1. Draft_PointArray: Count is always zero.
2. Draft_PathTwistedArray: Number of items is Count+1.
3. Draft_PathTwistedLinkArray: Count is increased whenever object is recomputed.

Also the first item in a twisted array should be unrotated.
2021-06-23 11:11:15 +02:00
Yorik van Havre
e2dd61119c Draft: Added ExclusionPoints property to shape2dview object 2021-06-01 11:30:04 +02:00
Matthijs Kooijman
1cabfd8e6b Draft: Simplify code using getattr default value
This uses the default value that can be passed to getattr to simplify
code that uses it. By choosing an appropriate default value, a separate
call to hasattr can be avoided and in some cases duplicate code can be
avoided.

This applies this trick where possible in wire.py and circle.py.

This commit does not change behavior.
2021-05-22 17:44:04 +02:00
Yorik van Havre
4ff9b768dd Draft: Changed shapestring FillLetters property to MakeFace 2021-05-05 15:41:28 +02:00
Yorik van Havre
a5bab10ff7 Draft: Added a 'solid faces' projection mode to shape2dviews to treat individual faces 2021-04-30 16:44:20 +02:00
tomate44
c48ec7cff2 Draft.ShapeString : add option to choose wires or faces output 2021-04-05 12:20:04 +02:00
David Osterberg
a243ce6346 Draft: Fix PathTwistedArray bug 2021-02-22 08:01:34 +01: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
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
Stefan Tröger
ec5ac30756 Remove ExtensionProxy and rely on default Python proxy for extensions. fixes #0004534 2021-01-30 16:00:48 +01:00
luz paz
fc99ff2def Draft: fix header uniformity + trailing whitespace
[skip ci]
2020-12-11 13:19:49 +01:00
Zheng, Lei
1127321320 Draft: support object without shape in DraftLink 2020-10-19 13:22:20 +02:00
marioalexis
1ad7b9788b Improve make_sketch and geometric related functions 2020-10-19 13:15:14 +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
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
b202b0d469 Draft: move getDXF to draftfunctions submodule
Update the appropriate interface in `Draft.py`.
2020-09-16 13:09:13 +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
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
ee11678a58 Draft: migrate Layer object and function to the new structure
Move `make_layer` to `draftmake`; `Layer` and `LayerContainer`
to `draftobjects`; `ViewProviderLayer` and `ViewProviderLayerContainer`
to `draftviewproviders`.

The make function and the classes are imported in `Draft.py`
to support the usage of the older `VisGroup`.
2020-07-20 14:21:15 +02:00
vocx-fc
27fc2e89fb Draft: add modules of draftobjects to the proper Doxygen group
This includes `array`, `base`, `bezcurve`, `block`, `bspline`,
`circle`, `clone`, `dimension`, `draft_annotation`, `draftlink`,
`drawingview`, `ellipse`, `facebinder`, `fillet`, `label`,
`patharray`, `point`, `pointarray`, `polygon`, `rectangle`,
`shape2dview`, `shapestring`, `text`, `wire`, `wwproxy`.

These are added to the `draftobjects` Doxygen group
so that the functions and classes 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
vocx-fc
0f30c8ba2b Draft: migrate DraftText type to Text 2020-07-10 12:23:43 +02:00
vocx-fc
70617e2e85 Draft: set a space before the Link group
For some reason all `App::Link` properties are in a group that
starts with a space, so `' Link'`, not just `'Link'`.

This was changed in 9873eb0a74.
2020-07-07 10:15:14 +02:00
luz.paz
ef37cc3930 Fix typos [skip-ci]
Found via codespell v1.18.0.dev0  
```
codespell -q 3 -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,connexion,currenty,dof,doubleclick,dum,eiter,elemente,ende,feld,finde,findf,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-06-29 20:52:23 +02:00
vocx-fc
245fa7af0f Draft: clean up the ViewProviderDraftAnnotation class
This class is the base of the viewproviders of annotation-type
objects like dimensions (linear, radial, angular), labels,
and texts.

The basic properties of `ViewProviderDraftAnnotation`
are set up by a method `set_properties`, which can be called
in the derived classes.

In the general proxy object `DraftAnnotation` we implement
the `onDocumentRestored` method in order to add the missing
view property `AnnotationStyle` to older objects.
2020-06-19 12:15:25 +02:00
vocx-fc
8f0a7696c2 Draft: add prototype function to AngularDimension to link objects
At the moment the user must manually modify `FirstAngle`
and `LastAngle` to obtain a new `Angle`, but since the values
are manually entered the result is not tied to any actual object
in the document.

We introduce a function `measure_two_obj_angles`
to calculate the corresponding parameters from a pair of objects
and their edges.
Currently this function is deactivated because it is intended
for testing purposes only.

This needs to be improved because at the moment it only gives
two possible angles. We should be able to get the four angles
of a two-line intersection. Maybe a new property is required
to indicate the quadrant to choose and display.
2020-06-17 12:53:29 +02:00