Commit Graph

41 Commits

Author SHA1 Message Date
marioalexis
c9d1d0c462 Draft: Improve makeWires in upgrade function 2020-12-09 15:21:33 -03: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
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
vocx-fc
d106be0b9b Draft: add Draft Layer unit tests
Also create a test `Layer` in the `draft_test_objects` script.
2020-07-20 14:21:15 +02:00
vocx-fc
f9d92f3f93 Draft: add modules of drafttests to the proper Doxygen group
This includes `auxiliary`, `draft_test_objects`, `test_airfoildat`,
`test_creation`, `test_dwg`, `test_dxf`, `test_import`,
`test_import_gui`, `test_import_tools`, `test_modification`,
`test_oca`, `test_pivy`, `test_svg`.

These are added to the `drafttests` 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
91a23e4a40 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
2877870318 Draft: new make_radial_dimension function for more precision
A single `make_dimension` handles three types of dimensions,
(1) simple linear, (2) linear linked to an object, and (3) linked
to a circular edge.

So, we provide a new function, `make_radial_dimension_obj`,
to handle the third case. In this way we can check the input
parameters much better.

We adjust the `Draft_Dimension` Gui Command accordingly.
2020-06-17 12:53:29 +02:00
vocx-fc
984de3b3da Draft: new make_linear_dimension functions for more precision
A single `make_dimension` handles three types of dimensions,
(1) simple linear, (2) linear linked to an object, and (3) linked
to a circular edge.

So, we provide two new functions, `make_linear_dimension`
and `make_linear_dimension_obj`, to handle the first two cases.
In this way we can check the input parameters much better.

We adjust the `Draft_Dimension` Gui Command accordingly.
2020-06-17 12:53:29 +02:00
vocx-fc
e81ca586a2 Draft: move make_dimension function to its own module
Previously the `make_dimension` and `make_angular_dimension`
functions were in `draftobjects/dimension.py`.
Now they are moved to `draftmake/make_dimension.py`.

The original `makeAngularDimension` function requires angles
in radians which is counterintuitive for most cases. Also
the order is `[big, small]`.

The new function `make_angular_dimension` accepts angles
in degrees, and the order is `[small, big]`. The older
function is retained for compatibility purposes.

Also perform several improvements such as PEP8 cleanup,
writing complete docstrings, type checking the input arguments,
and depreacting the older call.

The `Draft.py` module, Gui Command, unit test, and test script
are updated accordingly.
2020-06-17 12:53:29 +02:00
vocx-fc
c7eab9c65e Draft: move make_label function to its own module
Also perform several improvements such as PEP8 cleanup,
writing complete docstrings, type checking the input arguments,
and deprecating the older call.

Update `Draft.py`, the Gui Command, the unit test, and test script
as well.
2020-06-15 10:01:04 +02:00
vocx-fc
835f4b424f Draft: clean up code, PEP8, and docstrings in PathArray
Test the inputs to the `make_path_array` function
and return `None` if there is a problem.

Now the make function accepts as input a `"String"` which must be
the `Label` of an object in the document, so it is easier to create
arrays quickly from the Python console.

Add the new parameters to the make function, `align_mode`,
`tan_vector`, `force_vertical`, and `vertical_vector`.
These properties were added to the proxy object in ff323ebdb5.

Add  message deprecating the older call `makePathArray`.

Adjust the GuiCommand accordingly. Now it uses the commit
mechanism of the parent `Modifier` class so that the executed
functions are recorded in the Python console.

Clean up the `PathArray` class as well.
2020-06-05 13:14:46 +02:00
vocx-fc
9919849de5 Draft: migrate PointList property to PointObject in PointArray
Use the `onDocumentRestored` method to check for the old
property.

Also modify the position of the base object in the draft test
script.
2020-06-03 14:44:00 +02:00
vocx-fc
a4367d0585 Draft: activate new array make functions
They are made available in the `Draft` namespace,
and are also used in the unit tests, the test script,
and the GuiCommands.
2020-05-18 12:42:10 +02:00
vocx-fc
021b07b7bc Draft: restructure the draft test script
Add new function `_create_objects`.

Change annotations to use `App::Annotation` instead of `Draft Text`.
2020-05-18 12:41:24 +02:00
vocx-fc
e9baea434e Draft: update snake_case for unit tests
Also fix the name of certain functions.

Do not import `DraftFillet` any more as it's just kept
for compatibility purposes.

Do not test OCA nor AirfoilDAT as it's very improbable
that these formats will gain more support any time soon.
2020-05-15 14:44:48 +02:00
vocx-fc
50c2f31f6b Draft: use snake case functions in draft_test_objects script 2020-05-15 14:44:48 +02:00
vocx-fc
cc5d531a59 Draft: small additions to the draft_test_object script
Move the docstring, set the frame as a private function,
and set `MakeFace` to `False`.

Use user's home directory to create the file. Move the order of
the parameters of the function.
2020-05-15 14:44:48 +02:00
vocx-fc
d438aec821 Draft: remove old DraftFillet class, and make it a redirect
Remove the make function that creates the old object,
its corresponding Gui Command, and the old `DraftFillet.Fillet`
proxy class, which now is a redirection to the new `Fillet`
class defined in `draftobjects.fillet`.

Also change the unit test, and the `draft_test_object` script
to run `Draft.make_fillet`.
2020-05-13 11:37:56 +02:00
vocx-fc
de9c9a6be2 Draft: move arc_3points to the make package
Also import it in the `Draft` namespace so that is available
as `Draft.make_arc_3points`.

Use this new function in the unit test `drafttests.test_creation`,
in the GuiCommand `draftguitools.gui_arcs`, and in the
`draft_test_objects` script.
2020-05-12 10:00:41 +02:00
vocx-fc
e39c45d8ed Draft: update description of drafttests package 2020-05-06 12:46:24 +02:00
vocx-fc
8141096344 Draft: circulararray, clean up imports, docstrings, and checks 2020-04-08 11:08:29 +02:00
vocx-fc
26864d9633 Draft: moved some unit tests to TestDraftGui
Those unit tests that are registered in `Init.py` will always run,
while those that are registerd in `InitGui.py` will only run
when the graphical interface is available.

This allows us to more clearly distinguish functions that
should be able to run always, from those that may run only
when the interfce is available.
2020-04-08 11:07:51 +02:00
vocx-fc
5147ffd496 Draft: Coin (Pivy) tests only when the graphical interface is up 2020-04-08 11:07:51 +02:00
vocx-fc
d1c0f2f2f0 Draft: docstrings for the submodules 2020-04-07 18:12:06 +02:00
vocx-fc
a45738c629 Draft: update unit test for gui_edit 2020-04-06 12:51:55 +02:00
vocx-fc
6f028e0395 Draft: update unit test for gui_selectplane 2020-03-31 12:00:38 +02:00
vocx-fc
791f799626 Draft: update unit test for new gui_trackers module 2020-03-23 12:14:33 +01:00
vocx-fc
69af481235 Draft: update unit test for gui_snapper 2020-03-20 08:11:04 -03:00
vocx-fc
9eeceb4f28 Draft: improve the README files with links 2020-03-19 12:11:16 -03:00
vocx-fc
054ce9a540 Draft: recompute before using radial dimension in the unit test
This solves a small bug in the radial dimension
unit test introduced in 81c2896928, where a circle shape
is used before it is recomputed.

```
drafttests/test_creation.DraftCreation.test_dimension_radial
```
2020-03-19 12:10:56 -03:00
vocx-fc
215c29caf1 Draft: implement unit test for angular dimension
Previously the `makeAngularDimension` function produced
error messages in the report view due to internal rounding
of `App::PropertyAngles`.
This was fixed in `Base::Quantity`, which now supports
Python's `__round__` function.
2020-03-12 09:06:11 -03:00
vocx-fc
81c2896928 Draft: implement unit test for radial dimension 2020-03-12 09:06:11 -03:00
vocx-fc
422d5f9d1f Draft: cleanup of unit tests code 2020-03-12 09:06:11 -03:00
vocx-fc
efd5367d94 Draft: unit test for arc by 3 points 2020-03-12 09:06:11 -03:00
vocx-fc
fb4a992ce0 Draft: add script to produce a test file as example
The test script can be run by the program's executable
or run as a macro.
```
freecad draft_test_objects.py
```

It can also be used as a Python module within the program
to create a test file on demand.
```
import drafttests.draft_test_objects as dt
dt.create_test_file()
```

The produced test file will be added in a different commit
once this commit is merged.
The idea is to have a test file created by a certain
stable version of the master branch. Then as the code
continues to change and grow, this file can be opened
with future versions of the program to test for compatibility
and regressions.
2020-03-12 09:06:11 -03:00
luz.paz
180805c55e Fix typos
Found via  
```
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-03-06 14:50:35 +01:00
vocx-fc
4b5f91f4c3 Draft: test_offset, test wire and closed shape (rectangle) 2020-01-10 10:09:22 +01:00
luz.paz
ae7cb9e300 Draft: [skip ci] Fix header uniformity
This PR fixes header uniformity across all Draft files
2019-12-27 00:16:12 +01:00
vocx-fc
fa73d29d84 Draft: move the TestDraft unit tests to separate modules
This results in better organization of the tests,
avoiding extremely big files.
2019-12-17 15:06:36 -03:00