Commit Graph

2173 Commits

Author SHA1 Message Date
vocx-fc
f740fde964 Draft: move more functions to draftgeoutils.intersections 2020-06-03 15:22:09 +02:00
vocx-fc
7b3052fd76 Draft: move more functions to draftgeoutils.geometry 2020-06-03 15:22:09 +02:00
vocx-fc
85321f28da Draft: move more functions to draftgeoutils.wires 2020-06-03 15:22:09 +02:00
vocx-fc
66bc105979 Draft: move more functions to draftgeoutils.edges 2020-06-03 15:22:09 +02:00
vocx-fc
b77d477476 Draft: move more functions to draftgeoutils.general 2020-06-03 15:22:09 +02:00
hlg
0759436661 Arch/Draft: minor fixes 2020-06-03 14:50:17 +02:00
vocx-fc
f56c4fa67f Draft: separate the placement functions from the Array class
This way they can be tested individually in the Python console
without needing the `Array` class at all. In the future these
methods could be moved to `DraftGeomUtils` or to `draftfunctions`.
2020-06-03 14:47:44 +02:00
vocx-fc
7df2bb33c2 Draft: hide properties of other array types in Array class
Leave only the corresponding properties by examining
the value of `ArrayType`.
2020-06-03 14:47:44 +02:00
vocx-fc
d6fba74d2f Draft: set the properties of the Array through functions
Since the `Array` class handles three different types, they
have different sets of properties. We add them to specific functions
so that they are clearly identified.
2020-06-03 14:47:44 +02:00
vocx-fc
bde91ccf15 Draft: clean up code, PEP8, and docstrings for Array class
Added author of the `CircularArray` array type, "M. G. Berberich"
(berberic2) or "rynn" in the forum.
2020-06-03 14:47:44 +02:00
vocx-fc
5c273e7593 Draft: clean up code, PEP8, and docstrings for DraftLink
This class was created by realthunder during the `LinkMerge`,
in de66e563e0, to demonstrate how to use the `App::Link`
objects to create Link aware arrays.

It is used by `draftobject.array` (ortho, polar, circular)
and `draftobject.patharray` to create respective Link arrays.

This class is a bit mysterious. We need more documentation
on how the properties are being set, and how the code interacts
with the arrays that use it.
2020-06-03 14:47:44 +02:00
vocx-fc
66959b2688 Draft: clean up CircularArray code
Avoid `Draft.py` in the `make_circular_array` function because
it creates a circular dependency.

Use function to find the object in `make_circular_array`.

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
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
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
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
1a277967eb Draft: add additional displacement property for PointArray
The displacement is added to the position already defined by
the point, in order to impart an additional shift in the copy.

The rotation is also added to the original shape's rotation
by multiplying the quaternions.

Implement `onDocumentRestore` to add the new property
to older objects.
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
wandererfan
25d419e1c0 [Draft]Path Array tangent rotation direction 2020-06-02 13:55:44 -04:00
Yorik van Havre
369f860998 Draft: Added Area and Offset properties to Facebinder 2020-06-02 14:00:25 +02:00
Yorik van Havre
811327620f Draft: Fixed translation regression 2020-06-02 13:44:46 +02:00
vocx-fc
c5193ec6f7 Draft: add use_instead function to warn users about old functions
This can be used to deprecate older definitions
and suggest users to try a different function. This will be used
in the make functions in `draftmake`.
2020-06-02 12:29:50 +02:00
vocx-fc
78d7616ddc Draft: add find_object function to find objects by label in a document
Also add `find_doc` to be able to test the existence of an
active document before searching for the object.

These can be used in the make functions of most modifier commands.
2020-06-02 12:29:50 +02:00
vocx-fc
fea82942d3 Draft: clean up the utils module a bit, PEP8, style 2020-06-02 12:29:50 +02:00
carlopav
0b912f7c8b Draft: further cleanup of Draft Edit. 2020-05-29 13:35:51 +02:00
vocx-fc
547b9e4e20 Draft: small fix for older PathArray objects
Older PathLinkArray objects had a `useLink` attribute
which was migrated to `use_link`. A recent commit, ff323ebdb5,
made some improvements to the PathArray
object, but broke the migration of the property.

This fixes the migration, so that now all objects should
open correctly.
2020-05-29 13:34:34 +02:00
vocx-fc
ce0a4db598 Draft: move functions to draftgeoutils.linear_algebra 2020-05-29 13:31:28 +02:00
vocx-fc
7a764fb672 Draft: move functions to draftgeoutils.offsets 2020-05-29 13:31:28 +02:00
vocx-fc
65bd869b27 Draft: move functions to draftgeoutils.fillets 2020-05-29 13:31:28 +02:00
vocx-fc
0e862cfa9d Draft: move functions to draftgeoutils.arcs 2020-05-29 13:31:28 +02:00
vocx-fc
e7b586ead1 Draft: move functions to draftgeoutils.wires 2020-05-29 13:31:28 +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
Yorik van Havre
43c4f9af3d Draft: Added a border around the Draft grid (can be disabled in prefs) 2020-05-27 18:02:04 +02:00
carlopav
6d4dc1c834 Draft: Edit arc by 3 points bugfix 2020-05-25 13:37:55 +02:00
carlopav
b6b48b43ec Draft: bugfix on Edit BezCurve 2020-05-25 13:37:55 +02:00
carlopav
f4a47d0ecf Draft: Edit bugfix in Wire/BSpline curve editing 2020-05-25 13:37:55 +02:00
carlopav
caf6606d5f Draft: Edit support for Part Sphere
.
2020-05-25 13:37:55 +02:00
carlopav
d9e2f4f46c Draft: Edit support for Part Cone 2020-05-25 13:37:55 +02:00
carlopav
1b263a6a8f Draft: reordered supported edit objects and support for PartCylinder 2020-05-25 13:37:55 +02:00
carlopav
a98e2076db Draft: Edit reordering 1
Started a general refactor to handle all the conversion between global and object coordinate system inside the main methods and just use object coordinates inside object functions.
Draft: Edit reordering 2

Fixed Editing of Part objects according to the new refactor
Draft: fix in autogroup function for dimensions


Draft: fixed Polygon editing when inscribed or circumscribed


Draft: Edit support for Ellipse object


.


Draft: Edit docstrings


Draft: Edit reordering 3


Draft: Fixed Edit for structure object

And also refactor Edit methods that control special object display during editing.
Draft: Fixed edit for arch wall object
2020-05-25 13:37:55 +02:00
carlopav
61dd57407e Draft: Split Draft Edit into 4 modules
One for interaction handling and 3 for object editing functions, divided between Draft, Part, Arch
2020-05-25 13:37:55 +02:00
carlopav
8d23cd676a Draft: Cleanup of Draft Edit 2020-05-25 13:37:55 +02:00
vocx-fc
035a63c68b Draft: move functions to draftgeoutils.geometry 2020-05-25 13:35:34 +02:00
vocx-fc
339be2f4bb Draft: move functions to draftgeoutils.faces 2020-05-25 13:35:34 +02:00
vocx-fc
63800d7aac Draft: move functions to draftgeoutils.sort_edges 2020-05-25 13:35:34 +02:00
vocx-fc
632b72e7cd Draft: move functions to draftgeoutils.intersections 2020-05-25 13:35:34 +02:00
vocx-fc
c995ce562c Draft: move functions to draftgeoutils.edges 2020-05-25 13:35:34 +02:00
vocx-fc
add48977f9 Draft: move general functions to draftgeoutils.general
New package for organizing the geometrical utility functions of
the workbench, `draftgeoutils`.

The first submodule is one that deals with general operations.
2020-05-25 13:35:34 +02:00
wandererfan
5f46999f94 [Draft]Post-review changes 2020-05-23 11:22:14 -04:00