Commit Graph

38 Commits

Author SHA1 Message Date
vocx-fc
33d3fb1fa9 Draft: clean up PolarArray code
Avoid `Draft.py` in the `make_polar_array` function because
it creates a circular dependency.

Use function to find the object in `make_polar_rarray`.

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 interactively from the Python console.

Clean up the GuiCommand and task panel code, and avoid printing
messages to the terminal, as this is already done
by the make function.
2020-06-03 14:46:15 +02:00
vocx-fc
5dcb4ea104 Draft: clean up OrthoArray code
Avoid `Draft.py` in the `make_ortho_array` function because
it creates a circular dependency.

Use internal functions to abstract the orthogonal arrays.
The `_make_ortho_array` is a simple wrapper over the general
`make_array` function.

The result is four variants:
- `make_ortho_array`
- `make_ortho_array2d`, without the Z component
- `make_rect_array`, strictly rectangular components
- `make_rect_array2d`, strictly rectangular without the Z component

Also use functions to perform checking of the inputs,
whether these are vectors, numbers (integer and floats)
or integers.

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.

Clean up the GuiCommand and task panel code, and avoid printing
messages to the terminal, as this is already done
by the make function.
2020-06-03 14:46:15 +02:00
vocx-fc
8573bc01e9 Draft: clean up make_array function 2020-06-03 14:46:15 +02:00
vocx-fc
31c8f49467 Draft: add new options to the make_point_array function
It supports a new parameter `extra` that is used
to provide `ExtraPlacement` for the copies of the array.

Adjust the GuiCommand properly.
2020-06-03 14:44:00 +02:00
vocx-fc
4b65440112 Draft: clean up code, PEP8, and docstrings for PointArray
Test the inputs to the `make_point_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 a message deprecating the older call `makePointArray`.

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 `PointArray` class as well.
2020-06-03 14:44:00 +02:00
Yorik van Havre
7b94a6122b Arch: Handle rectangle-and circle-based profiles in IFC import/export 2020-05-29 12:12:48 +02:00
wandererfan
5f46999f94 [Draft]Post-review changes 2020-05-23 11:22:14 -04:00
wandererfan
bdc9b6d455 [Draft]Trap missing ViewObject attribute
- sometimes VO does not have DiffuseColor
  attribute
2020-05-23 11:22:14 -04:00
wandererfan
ff323ebdb5 [Draft]Additional modes for PathArray 2020-05-23 11:22:14 -04:00
vocx-fc
681b33dab8 Draft: move circular, ortho, and polar make functions
Previously they were in `draftobjects`, but since they
don't define new objects, just create objects,
they are moved to `draftmake`.

Also ajust the `CMakeLists.txt` and the corresponding Gui Commands
which use these make functions.

These functions internally use the `Draft.makeArray` function.
We will put comments as reminders so that when this function
is moved to its own module, we can update the derived functions.
2020-05-18 12:42:10 +02:00
carlopav
125d0ca84d 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
carlopav
95fe3076bd Draft: split DrawingView from Draft.py 2020-05-15 14:43:26 +02:00
carlopav
79ef4d991a Draft: split Array from Draft.py 2020-05-15 14:43:26 +02:00
carlopav
26e8adaee4 Draft: split PointArray from Draft.py 2020-05-15 14:43:26 +02:00
carlopav
dfee68d05a Draft: split Path Array and viewprovider Array from Draft.Py
Draft: fix typo in PathArray
2020-05-15 14:43:26 +02:00
vocx-fc
d437242924 Draft: split Fillet code into various modules
The original code was in `DraftFillet.py` which is split
into a different modules like the rest of the workbench.

The object code is in `draftobjects`, the viewprovider
is in `draftviewproviders`, and the function to create it
is in `draftmake`.
2020-05-13 11:37:56 +02:00
carlopav
64619a615a Draft: Bugfix to getCloneBase after objects splitting 2020-05-12 10:37:20 +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
52e1f03da7 Draft: add description of draftmake package
These modules provide the functions that are used to create
the scripted objects defined within the workbench.

The functions import and use the proxy classes
and viewprovider classes in `draftobjects`
and `draftviewproviders`.

These functions are imported in the main `Draft.py` module
so they form part of the public programming interface (API)
of the workbench.
2020-05-06 12:46:24 +02:00
carlopav
54fad8e46a Draft: split makeCopy from Draft.py
.
2020-05-04 10:51:08 +02:00
carlopav
ea19060f64 Draft: fix bspline and bezcurve viewproviders
Finished to fix bspline and bezcurve wiewproviders.
2020-04-30 13:48:33 +02:00
vocx-fc
fd151857b0 Draft: add view provider for Bezier curve object 2020-04-30 09:41:41 +02:00
vocx-fc
dfece47520 Draft: add view provider for BSpline object 2020-04-30 09:41:41 +02:00
Bernd Hahnebach
d7a9f2ebf9 Draft: workaround to be able to import Draft 2020-04-29 22:46:27 +02:00
carlopav
582a4c0d83 Draft: split Shape2DView from Draft.py 2020-04-29 11:41:02 +02:00
carlopav
0912046068 Draft: split Block from Draft.py 2020-04-29 11:41:02 +02:00
carlopav
a4f802847c Draft: split Shapestring from Draft.py 2020-04-29 11:41:02 +02:00
carlopav
bea4431b18 Draft: split makeSketch from Draft.py 2020-04-29 11:41:02 +02:00
carlopav
00ec299e06 Draft: split Facebinder from Draft.py 2020-04-29 11:41:02 +02:00
carlopav
b94ba1bf4c Draft: split WorkingPlaneProxy from Draft.py 2020-04-29 11:41:02 +02:00
carlopav
d450c20f06 Draft: split Ellipse from Draft.py
.
2020-04-29 11:41:02 +02:00
carlopav
2d99a2f343 Draft: split Point from Draft.py
.
2020-04-29 11:41:02 +02:00
carlopav
e4bfb0b21d Draft: split clone from Draft.py
.


.
2020-04-29 11:41:02 +02:00
carlopav
f1eaa0b93c Draft: split wire related tools from Draft.py
Line Polyline BezCurve BSpline
.


.


.
2020-04-29 11:41:02 +02:00
carlopav
4eab0bb787 Draft: split Polygon from Draft.py
.


.


.


.
2020-04-29 11:41:02 +02:00
carlopav
96b2dde9b2 Draft: split rectangle code from Draft.py
.


.
2020-04-29 11:41:02 +02:00
carlopav
a34ca76a4e Draft: split circle from Draft.py
.


.
2020-04-29 11:41:02 +02:00
carlopav
43f6721c6e Draft: parent classes of all Draft objects
Add DraftObject and ViewProviderDraft to serve as
the parent classes of all Draft objects
and all Draft view providers.

Inside `Draft.py` we need to import
`_DraftObject` from `draftobjects.base`;
and `_ViewProviderDraft`, `_ViewProviderDraftAlt`,
and `_ViewProviderDraftPart` from `draftviewproviders.view_base`.
.


.


.


.
2020-04-29 11:41:02 +02:00