added blender plugin and freecad workbench as submodules

This commit is contained in:
Игорь Брылёв 2024-12-10 16:48:22 +03:00
parent 03f8b86877
commit f4f56e53a8
177 changed files with 10 additions and 19797 deletions

8
.gitmodules vendored
View file

@ -1,3 +1,9 @@
[submodule "rcg_pipeline"]
path = rcg_pipeline
url = https://gitlab.com/robossembler/rcg-pipeline.git
[submodule "freecad_workbench"]
path = freecad_workbench
url = https://gitlab.com/robossembler/robossembler-freecad-workbench.git
[submodule "simulation/insertion_vector_predicate/assembly"]
path = insertion_vector_predicate/assembly
path = simulation/insertion_vector_predicate/assembly
url = https://github.com/yunshengtian/Assemble-Them-All

1
freecad_workbench Submodule

@ -0,0 +1 @@
Subproject commit 08db6583ce94895103c94b1b70b4846ef581e624

View file

@ -1,505 +0,0 @@
GNU LESSER GENERAL PUBLIC LICENSE
Version 2.1, February 1999
Copyright (C) 1991, 1999 Free Software Foundation, Inc.
51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
Everyone is permitted to copy and distribute verbatim copies
of this license document, but changing it is not allowed.
(This is the first released version of the Lesser GPL. It also counts
as the successor of the GNU Library Public License, version 2, hence
the version number 2.1.)
Preamble
The licenses for most software are designed to take away your
freedom to share and change it. By contrast, the GNU General Public
Licenses are intended to guarantee your freedom to share and change
free software--to make sure the software is free for all its users.
This license, the Lesser General Public License, applies to some
specially designated software packages--typically libraries--of the
Free Software Foundation and other authors who decide to use it. You
can use it too, but we suggest you first think carefully about whether
this license or the ordinary General Public License is the better
strategy to use in any particular case, based on the explanations below.
When we speak of free software, we are referring to freedom of use,
not price. Our General Public Licenses are designed to make sure that
you have the freedom to distribute copies of free software (and charge
for this service if you wish); that you receive source code or can get
it if you want it; that you can change the software and use pieces of
it in new free programs; and that you are informed that you can do
these things.
To protect your rights, we need to make restrictions that forbid
distributors to deny you these rights or to ask you to surrender these
rights. These restrictions translate to certain responsibilities for
you if you distribute copies of the library or if you modify it.
For example, if you distribute copies of the library, whether gratis
or for a fee, you must give the recipients all the rights that we gave
you. You must make sure that they, too, receive or can get the source
code. If you link other code with the library, you must provide
complete object files to the recipients, so that they can relink them
with the library after making changes to the library and recompiling
it. And you must show them these terms so they know their rights.
We protect your rights with a two-step method: (1) we copyright the
library, and (2) we offer you this license, which gives you legal
permission to copy, distribute and/or modify the library.
To protect each distributor, we want to make it very clear that
there is no warranty for the free library. Also, if the library is
modified by someone else and passed on, the recipients should know
that what they have is not the original version, so that the original
author's reputation will not be affected by problems that might be
introduced by others.
Finally, software patents pose a constant threat to the existence of
any free program. We wish to make sure that a company cannot
effectively restrict the users of a free program by obtaining a
restrictive license from a patent holder. Therefore, we insist that
any patent license obtained for a version of the library must be
consistent with the full freedom of use specified in this license.
Most GNU software, including some libraries, is covered by the
ordinary GNU General Public License. This license, the GNU Lesser
General Public License, applies to certain designated libraries, and
is quite different from the ordinary General Public License. We use
this license for certain libraries in order to permit linking those
libraries into non-free programs.
When a program is linked with a library, whether statically or using
a shared library, the combination of the two is legally speaking a
combined work, a derivative of the original library. The ordinary
General Public License therefore permits such linking only if the
entire combination fits its criteria of freedom. The Lesser General
Public License permits more lax criteria for linking other code with
the library.
We call this license the "Lesser" General Public License because it
does Less to protect the user's freedom than the ordinary General
Public License. It also provides other free software developers Less
of an advantage over competing non-free programs. These disadvantages
are the reason we use the ordinary General Public License for many
libraries. However, the Lesser license provides advantages in certain
special circumstances.
For example, on rare occasions, there may be a special need to
encourage the widest possible use of a certain library, so that it becomes
a de-facto standard. To achieve this, non-free programs must be
allowed to use the library. A more frequent case is that a free
library does the same job as widely used non-free libraries. In this
case, there is little to gain by limiting the free library to free
software only, so we use the Lesser General Public License.
In other cases, permission to use a particular library in non-free
programs enables a greater number of people to use a large body of
free software. For example, permission to use the GNU C Library in
non-free programs enables many more people to use the whole GNU
operating system, as well as its variant, the GNU/Linux operating
system.
Although the Lesser General Public License is Less protective of the
users' freedom, it does ensure that the user of a program that is
linked with the Library has the freedom and the wherewithal to run
that program using a modified version of the Library.
The precise terms and conditions for copying, distribution and
modification follow. Pay close attention to the difference between a
"work based on the library" and a "work that uses the library". The
former contains code derived from the library, whereas the latter must
be combined with the library in order to run.
GNU LESSER GENERAL PUBLIC LICENSE
TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION
0. This License Agreement applies to any software library or other
program which contains a notice placed by the copyright holder or
other authorized party saying it may be distributed under the terms of
this Lesser General Public License (also called "this License").
Each licensee is addressed as "you".
A "library" means a collection of software functions and/or data
prepared so as to be conveniently linked with application programs
(which use some of those functions and data) to form executables.
The "Library", below, refers to any such software library or work
which has been distributed under these terms. A "work based on the
Library" means either the Library or any derivative work under
copyright law: that is to say, a work containing the Library or a
portion of it, either verbatim or with modifications and/or translated
straightforwardly into another language. (Hereinafter, translation is
included without limitation in the term "modification".)
"Source code" for a work means the preferred form of the work for
making modifications to it. For a library, complete source code means
all the source code for all modules it contains, plus any associated
interface definition files, plus the scripts used to control compilation
and installation of the library.
Activities other than copying, distribution and modification are not
covered by this License; they are outside its scope. The act of
running a program using the Library is not restricted, and output from
such a program is covered only if its contents constitute a work based
on the Library (independent of the use of the Library in a tool for
writing it). Whether that is true depends on what the Library does
and what the program that uses the Library does.
1. You may copy and distribute verbatim copies of the Library's
complete source code as you receive it, in any medium, provided that
you conspicuously and appropriately publish on each copy an
appropriate copyright notice and disclaimer of warranty; keep intact
all the notices that refer to this License and to the absence of any
warranty; and distribute a copy of this License along with the
Library.
You may charge a fee for the physical act of transferring a copy,
and you may at your option offer warranty protection in exchange for a
fee.
2. You may modify your copy or copies of the Library or any portion
of it, thus forming a work based on the Library, and copy and
distribute such modifications or work under the terms of Section 1
above, provided that you also meet all of these conditions:
a) The modified work must itself be a software library.
b) You must cause the files modified to carry prominent notices
stating that you changed the files and the date of any change.
c) You must cause the whole of the work to be licensed at no
charge to all third parties under the terms of this License.
d) If a facility in the modified Library refers to a function or a
table of data to be supplied by an application program that uses
the facility, other than as an argument passed when the facility
is invoked, then you must make a good faith effort to ensure that,
in the event an application does not supply such function or
table, the facility still operates, and performs whatever part of
its purpose remains meaningful.
(For example, a function in a library to compute square roots has
a purpose that is entirely well-defined independent of the
application. Therefore, Subsection 2d requires that any
application-supplied function or table used by this function must
be optional: if the application does not supply it, the square
root function must still compute square roots.)
These requirements apply to the modified work as a whole. If
identifiable sections of that work are not derived from the Library,
and can be reasonably considered independent and separate works in
themselves, then this License, and its terms, do not apply to those
sections when you distribute them as separate works. But when you
distribute the same sections as part of a whole which is a work based
on the Library, the distribution of the whole must be on the terms of
this License, whose permissions for other licensees extend to the
entire whole, and thus to each and every part regardless of who wrote
it.
Thus, it is not the intent of this section to claim rights or contest
your rights to work written entirely by you; rather, the intent is to
exercise the right to control the distribution of derivative or
collective works based on the Library.
In addition, mere aggregation of another work not based on the Library
with the Library (or with a work based on the Library) on a volume of
a storage or distribution medium does not bring the other work under
the scope of this License.
3. You may opt to apply the terms of the ordinary GNU General Public
License instead of this License to a given copy of the Library. To do
this, you must alter all the notices that refer to this License, so
that they refer to the ordinary GNU General Public License, version 2,
instead of to this License. (If a newer version than version 2 of the
ordinary GNU General Public License has appeared, then you can specify
that version instead if you wish.) Do not make any other change in
these notices.
Once this change is made in a given copy, it is irreversible for
that copy, so the ordinary GNU General Public License applies to all
subsequent copies and derivative works made from that copy.
This option is useful when you wish to copy part of the code of
the Library into a program that is not a library.
4. You may copy and distribute the Library (or a portion or
derivative of it, under Section 2) in object code or executable form
under the terms of Sections 1 and 2 above provided that you accompany
it with the complete corresponding machine-readable source code, which
must be distributed under the terms of Sections 1 and 2 above on a
medium customarily used for software interchange.
If distribution of object code is made by offering access to copy
from a designated place, then offering equivalent access to copy the
source code from the same place satisfies the requirement to
distribute the source code, even though third parties are not
compelled to copy the source along with the object code.
5. A program that contains no derivative of any portion of the
Library, but is designed to work with the Library by being compiled or
linked with it, is called a "work that uses the Library". Such a
work, in isolation, is not a derivative work of the Library, and
therefore falls outside the scope of this License.
However, linking a "work that uses the Library" with the Library
creates an executable that is a derivative of the Library (because it
contains portions of the Library), rather than a "work that uses the
library". The executable is therefore covered by this License.
Section 6 states terms for distribution of such executables.
When a "work that uses the Library" uses material from a header file
that is part of the Library, the object code for the work may be a
derivative work of the Library even though the source code is not.
Whether this is true is especially significant if the work can be
linked without the Library, or if the work is itself a library. The
threshold for this to be true is not precisely defined by law.
If such an object file uses only numerical parameters, data
structure layouts and accessors, and small macros and small inline
functions (ten lines or less in length), then the use of the object
file is unrestricted, regardless of whether it is legally a derivative
work. (Executables containing this object code plus portions of the
Library will still fall under Section 6.)
Otherwise, if the work is a derivative of the Library, you may
distribute the object code for the work under the terms of Section 6.
Any executables containing that work also fall under Section 6,
whether or not they are linked directly with the Library itself.
6. As an exception to the Sections above, you may also combine or
link a "work that uses the Library" with the Library to produce a
work containing portions of the Library, and distribute that work
under terms of your choice, provided that the terms permit
modification of the work for the customer's own use and reverse
engineering for debugging such modifications.
You must give prominent notice with each copy of the work that the
Library is used in it and that the Library and its use are covered by
this License. You must supply a copy of this License. If the work
during execution displays copyright notices, you must include the
copyright notice for the Library among them, as well as a reference
directing the user to the copy of this License. Also, you must do one
of these things:
a) Accompany the work with the complete corresponding
machine-readable source code for the Library including whatever
changes were used in the work (which must be distributed under
Sections 1 and 2 above); and, if the work is an executable linked
with the Library, with the complete machine-readable "work that
uses the Library", as object code and/or source code, so that the
user can modify the Library and then relink to produce a modified
executable containing the modified Library. (It is understood
that the user who changes the contents of definitions files in the
Library will not necessarily be able to recompile the application
to use the modified definitions.)
b) Use a suitable shared library mechanism for linking with the
Library. A suitable mechanism is one that (1) uses at run time a
copy of the library already present on the user's computer system,
rather than copying library functions into the executable, and (2)
will operate properly with a modified version of the library, if
the user installs one, as long as the modified version is
interface-compatible with the version that the work was made with.
c) Accompany the work with a written offer, valid for at
least three years, to give the same user the materials
specified in Subsection 6a, above, for a charge no more
than the cost of performing this distribution.
d) If distribution of the work is made by offering access to copy
from a designated place, offer equivalent access to copy the above
specified materials from the same place.
e) Verify that the user has already received a copy of these
materials or that you have already sent this user a copy.
For an executable, the required form of the "work that uses the
Library" must include any data and utility programs needed for
reproducing the executable from it. However, as a special exception,
the materials to be distributed need not include anything that is
normally distributed (in either source or binary form) with the major
components (compiler, kernel, and so on) of the operating system on
which the executable runs, unless that component itself accompanies
the executable.
It may happen that this requirement contradicts the license
restrictions of other proprietary libraries that do not normally
accompany the operating system. Such a contradiction means you cannot
use both them and the Library together in an executable that you
distribute.
7. You may place library facilities that are a work based on the
Library side-by-side in a single library together with other library
facilities not covered by this License, and distribute such a combined
library, provided that the separate distribution of the work based on
the Library and of the other library facilities is otherwise
permitted, and provided that you do these two things:
a) Accompany the combined library with a copy of the same work
based on the Library, uncombined with any other library
facilities. This must be distributed under the terms of the
Sections above.
b) Give prominent notice with the combined library of the fact
that part of it is a work based on the Library, and explaining
where to find the accompanying uncombined form of the same work.
8. You may not copy, modify, sublicense, link with, or distribute
the Library except as expressly provided under this License. Any
attempt otherwise to copy, modify, sublicense, link with, or
distribute the Library is void, and will automatically terminate your
rights under this License. However, parties who have received copies,
or rights, from you under this License will not have their licenses
terminated so long as such parties remain in full compliance.
9. You are not required to accept this License, since you have not
signed it. However, nothing else grants you permission to modify or
distribute the Library or its derivative works. These actions are
prohibited by law if you do not accept this License. Therefore, by
modifying or distributing the Library (or any work based on the
Library), you indicate your acceptance of this License to do so, and
all its terms and conditions for copying, distributing or modifying
the Library or works based on it.
10. Each time you redistribute the Library (or any work based on the
Library), the recipient automatically receives a license from the
original licensor to copy, distribute, link with or modify the Library
subject to these terms and conditions. You may not impose any further
restrictions on the recipients' exercise of the rights granted herein.
You are not responsible for enforcing compliance by third parties with
this License.
11. If, as a consequence of a court judgment or allegation of patent
infringement or for any other reason (not limited to patent issues),
conditions are imposed on you (whether by court order, agreement or
otherwise) that contradict the conditions of this License, they do not
excuse you from the conditions of this License. If you cannot
distribute so as to satisfy simultaneously your obligations under this
License and any other pertinent obligations, then as a consequence you
may not distribute the Library at all. For example, if a patent
license would not permit royalty-free redistribution of the Library by
all those who receive copies directly or indirectly through you, then
the only way you could satisfy both it and this License would be to
refrain entirely from distribution of the Library.
If any portion of this section is held invalid or unenforceable under any
particular circumstance, the balance of the section is intended to apply,
and the section as a whole is intended to apply in other circumstances.
It is not the purpose of this section to induce you to infringe any
patents or other property right claims or to contest validity of any
such claims; this section has the sole purpose of protecting the
integrity of the free software distribution system which is
implemented by public license practices. Many people have made
generous contributions to the wide range of software distributed
through that system in reliance on consistent application of that
system; it is up to the author/donor to decide if he or she is willing
to distribute software through any other system and a licensee cannot
impose that choice.
This section is intended to make thoroughly clear what is believed to
be a consequence of the rest of this License.
12. If the distribution and/or use of the Library is restricted in
certain countries either by patents or by copyrighted interfaces, the
original copyright holder who places the Library under this License may add
an explicit geographical distribution limitation excluding those countries,
so that distribution is permitted only in or among countries not thus
excluded. In such case, this License incorporates the limitation as if
written in the body of this License.
13. The Free Software Foundation may publish revised and/or new
versions of the Lesser General Public License from time to time.
Such new versions will be similar in spirit to the present version,
but may differ in detail to address new problems or concerns.
Each version is given a distinguishing version number. If the Library
specifies a version number of this License which applies to it and
"any later version", you have the option of following the terms and
conditions either of that version or of any later version published by
the Free Software Foundation. If the Library does not specify a
license version number, you may choose any version ever published by
the Free Software Foundation.
14. If you wish to incorporate parts of the Library into other free
programs whose distribution conditions are incompatible with these,
write to the author to ask for permission. For software which is
copyrighted by the Free Software Foundation, write to the Free
Software Foundation; we sometimes make exceptions for this. Our
decision will be guided by the two goals of preserving the free status
of all derivatives of our free software and of promoting the sharing
and reuse of software generally.
NO WARRANTY
15. BECAUSE THE LIBRARY IS LICENSED FREE OF CHARGE, THERE IS NO
WARRANTY FOR THE LIBRARY, TO THE EXTENT PERMITTED BY APPLICABLE LAW.
EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR
OTHER PARTIES PROVIDE THE LIBRARY "AS IS" WITHOUT WARRANTY OF ANY
KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE
IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE
LIBRARY IS WITH YOU. SHOULD THE LIBRARY PROVE DEFECTIVE, YOU ASSUME
THE COST OF ALL NECESSARY SERVICING, REPAIR OR CORRECTION.
16. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN
WRITING WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY
AND/OR REDISTRIBUTE THE LIBRARY AS PERMITTED ABOVE, BE LIABLE TO YOU
FOR DAMAGES, INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR
CONSEQUENTIAL DAMAGES ARISING OUT OF THE USE OR INABILITY TO USE THE
LIBRARY (INCLUDING BUT NOT LIMITED TO LOSS OF DATA OR DATA BEING
RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD PARTIES OR A
FAILURE OF THE LIBRARY TO OPERATE WITH ANY OTHER SOFTWARE), EVEN IF
SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH
DAMAGES.
END OF TERMS AND CONDITIONS
How to Apply These Terms to Your New Libraries
If you develop a new library, and you want it to be of the greatest
possible use to the public, we recommend making it free software that
everyone can redistribute and change. You can do so by permitting
redistribution under these terms (or, alternatively, under the terms of the
ordinary General Public License).
To apply these terms, attach the following notices to the library. It is
safest to attach them to the start of each source file to most effectively
convey the exclusion of warranty; and each file should have at least the
"copyright" line and a pointer to where the full notice is found.
{description}
Copyright (C) {year} {fullname}
This library is free software; you can redistribute it and/or
modify it under the terms of the GNU Lesser General Public
License as published by the Free Software Foundation; either
version 2.1 of the License, or (at your option) any later version.
This library is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
Lesser General Public License for more details.
You should have received a copy of the GNU Lesser General Public
License along with this library; if not, write to the Free Software
Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301
USA
Also add information on how to contact you by electronic and paper mail.
You should also get your employer (if you work as a programmer) or your
school, if any, to sign a "copyright disclaimer" for the library, if
necessary. Here is a sample; alter the names:
Yoyodyne, Inc., hereby disclaims all copyright interest in the
library `Frob' (a library for tweaking knobs) written by James Random
Hacker.
{signature of Ty Coon}, 1 April 1990
Ty Coon, President of Vice
That's all there is to it!

View file

@ -1 +0,0 @@
recursive-include freecad/robossembler/resources *

View file

@ -1,51 +0,0 @@
# Makefile for string replacement tasks
# Replace values from starterkit to your workbench name
# Define replacements as variables
WORKBENCH_DIR_NAME = robossembler
WORKBENCH_CLASS_NAME = Robossembler
WORKBENCH_MENUTEXT = Robossembler
WORKBENCH_TOOLTIP = FreeCAD Robossembler Workbench
WORKBENCH_ICON = robossembler.svg
WORKBENCH_TRANSLATION_CONTEXT = cool
MAINTAINER = Mark Voltov
EMAIL = ius.mark.alex@gmail.com
URL = https://gitlab.com/robossembler/framework
DESCRIPTION = FreeCAD Robossembler Workbench - Assembly Sequence Planning, Analysis
DEPENDENCIES_LIST = []
.PHONY: all replace_strings
all: replace_strings
replace_strings:
@echo -e "\033[1;34mReplacing strings\033[0m"
@# Update instances of 'workbench_starterkit' on different files
sed -i 's/workbench_starterkit/$(WORKBENCH_DIR_NAME)/g' MANIFEST.in
sed -i 's/workbench_starterkit/$(WORKBENCH_DIR_NAME)/g' freecad/workbench_starterkit/init_gui.py
sed -i 's/workbench_starterkit/$(WORKBENCH_DIR_NAME)/g' freecad/workbench_starterkit/resources/translations/update_translation.sh
sed -i 's/workbench_starterkit/$(WORKBENCH_DIR_NAME)/g' freecad/workbench_starterkit/resources/translations/workbench_starterkit_es-ES.ts
sed -i 's/workbench_starterkit/$(WORKBENCH_DIR_NAME)/g' setup.py
@# Rename workbench class name
sed -i 's/TemplateWorkbench/$(WORKBENCH_CLASS_NAME)/g' freecad/workbench_starterkit/init_gui.py
@# Rename workbench class properties
sed -i 's/template workbench/$(WORKBENCH_MENUTEXT)/g' freecad/workbench_starterkit/init_gui.py
sed -i 's/a simple template workbench/$(WORKBENCH_TOOLTIP)/g' freecad/workbench_starterkit/init_gui.py
sed -i 's/template_resource.svg/$(WORKBENCH_ICON)/g' freecad/workbench_starterkit/init_gui.py
@# Rename workbench icon
mv freecad/workbench_starterkit/resources/template_resource.svg freecad/workbench_starterkit/resources/$(WORKBENCH_ICON)
@# Rename context string for translation of workbench name
sed -i 's/starterkit/$(WORKBENCH_TRANSLATION_CONTEXT)/g' freecad/workbench_starterkit/init_gui.py
sed -i 's/starterkit/$(WORKBENCH_TRANSLATION_CONTEXT)/g' freecad/workbench_starterkit/resources/translations/workbench_starterkit_es-ES.ts
@# Rename workbench directory
mv freecad/workbench_starterkit freecad/$(WORKBENCH_DIR_NAME)
@# Update setup.py file
sed -i 's/looooo/$(MAINTAINER)/g' setup.py
sed -i 's/sppedflyer@gmail.com/$(EMAIL)/g' setup.py
sed -i 's|https://github.com/FreeCAD/Workbench-Starterkit|$(URL)|g' setup.py
sed -i 's/template for a freecad extensions\, installable with pip/$(DESCRIPTION)/g' setup.py
sed -i "s/\['numpy'\]/$(DEPENDENCIES_LIST)/g" setup.py
self-destruction:
echo "Remove Makefile"
rm Makefile

View file

@ -1,9 +0,0 @@
## Модули проекта Robossembler для FreeCAD
Верстак протестирован в FreeCAD версии 21.2
### Инструкция по установке
1. Установить FreeCAD (https://www.freecadweb.org/wiki/Installing)
2. Клонировать папку ```freecad_workbench``` в директорию установки верстаков согласно [инструкции по установке верстаков](https://wiki.freecad.org/How_to_install_additional_workbenches)
3. Для пользователей Ubuntu - скопировать папку ```freecad_workbench``` в директорию ```~/.local/share/FreeCAD/Mod```

View file

@ -1,127 +0,0 @@
# Code Snippets
There is no way to add a button, menu entry from python to a workbench which is added with c++. So here is a comparison how to do that with python and with c++.
## Adding a command:
This can be done either with python or c++.
### 1. python
```python
import FreeCAD as App
class MyCommand(object):
def IsActive(self):
"""
availability of the command (eg.: check for existence of a document,...)
if this function returns False, the menu/ buttons are ßdisabled (gray)
"""
if App.ActiveDocument is None:
return False
else:
return True
def GetResources(self):
"""
resources which are used by buttons and menu-items
"""
return {'Pixmap': 'path_to_icon.svg', 'MenuText': 'my command', 'ToolTip': 'very short description'}
def Activated(self):
"""
the function to be handled, when a user starts the command
"""
```
To register the command in FreeCAD:
```python
import FreeCADGui as Gui
Gui.addCommand('MyCommand', MyCommand())
```
Adding a new toolbar/menu:
```python
from FreeCADGui import Workbench
class myWorkbench(Workbench):
MenuText = "name_of_workbench"
ToolTip = "short description of workbench"
Icon = "path_to_icon.svg"
def GetClassName(self):
return "Gui::PythonWorkbench"
def Initialize(self):
self.appendToolbar("Gear", ["MyCommand"])
self.appendMenu("Gear", ["MyCommand"])
```
### 2. C++
```c++
#include <App/Document.h>
#include <Gui/Command.h>
#include <Gui/Control.h>
#include <Gui/Document.h>
using namespace std;
DEF_STD_CMD_A(MyCommand)
MyCommand::MyCommand()
: Command("MyCommand")
{
sAppModule = "module";
sGroup = QT_TR_NOOP("Mesh");
sMenuText = QT_TR_NOOP("my command");
sToolTipText = QT_TR_NOOP("very short description");
sWhatsThis = "MyCommand";
sStatusTip = sToolTipText;
}
void MyCommand::activated(int)
{
// the function to be handled, when a user starts the command
}
bool MyCommand::isActive(void)
{
// availability of the command (eg.: check for existence of a document,...)
// if this function returns False, the menu/ buttons are ßdisabled (gray)
return (hasActiveDocument() && !Gui::Control().activeDialog());
}
```
To register the command in FreeCAD:
```c++
#include <Gui/Command.h>
Gui::CommandManager &rcCmdMgr = Gui::Application::Instance->commandManager();
rcCmdMgr.addCommand(new MyCommand());
```
Adding a item to a menu/toolbar:
if your command is added with python you have to run this code:
in src/module/Gui/AppModuleGui.cpp add to PyMOD_INIT_FUNC:
```c++
// try to instantiate a python module
try{
Base::Interpreter().runStringObject("import MyCommands");
} catch (Base::PyException &err){
err.ReportException();
}
```
and add the name of the command to a tooltip/menu in src/module/Gui/Workbench.cpp Workbench::setupToolBars
```c++
Gui::ToolBarItem* Workbench::setupToolBars() const
{
Gui::ToolBarItem* root = StdWorkbench::setupToolBars();
Gui::ToolBarItem* myToolbar = new Gui::ToolBarItem(root);
myToolbar->setCommand("my_commands");
*myToolbar << "MyCommand";
return root;
}
```

View file

@ -1,110 +0,0 @@
import FreeCAD as App
import Spreadsheet
from .helper.is_solid import is_object_solid
def createSpreadsheet():
if App.ActiveDocument.getObject("BoM_List") == None:
sheet = App.activeDocument().addObject('Spreadsheet::Sheet', 'BoM_List')
sheet.set('A1', 'п.п.')
sheet.set('B1', 'Наименование детали')
sheet.set('C1', 'Количество')
else:
sheet = App.ActiveDocument.getObject("BoM_List")
App.ActiveDocument.BoM_List.clear('A1:ZZ16384')
sheet.set('A1', 'п.п.')
sheet.set('B1', 'Наименование детали')
sheet.set('C1', 'Количество')
return (sheet)
class SolidBodiesParcer:
_asmThere = []
def __init__(self) -> None:
if (self._asmThere.__len__() == 0):
self.initParse()
pass
def initParse(self):
for el in App.ActiveDocument.RootObjects:
if (is_object_solid(el) and hasattr(el, 'Group')):
self.getSubPartsLink(el.Group, el.Label)
def getSubPartsLink(self, group, label):
groupLink = {label: []}
for el in group:
if (is_object_solid(el)):
groupLink[label].append(
{'label': el.Label, 'isGroup': hasattr(el, 'Group'), 'solid': el})
for el in groupLink[label]:
if ('isGroup' in el):
if (el['isGroup'] == False):
self._asmThere.append(el['solid'].Label)
if (el['isGroup']):
self.getSubPartsLink(el['solid'].Group, el['label']),
return groupLink
def uniquePartsSort(labelParts):
uniquePartsLabels = {}
for el in labelParts:
for k in labelParts:
if (App.ActiveDocument.getObjectsByLabel(str(el))[0].Shape.isPartner(App.ActiveDocument.getObjectsByLabel(str(k))[0].Shape)):
if uniquePartsLabels.get(el) == None:
uniquePartsLabels[el] = k
sortedParts = {}
for k, v in uniquePartsLabels.items():
if sortedParts.get(v) == None:
sortedParts[v] = [k]
else:
sortedParts[v].append(k)
return sortedParts
def countForUniques(sortedParts):
countedParts = {}
for k in sortedParts:
countedParts[k] = len(sortedParts[k])
return countedParts
def fillInBoMList(sheet, countedParts):
a = 1
for label, count in countedParts.items():
a += 1
b = label
c = count
sheet.set('A' + str(a), str(a-1))
sheet.set('B' + str(a), str(b))
sheet.set('C' + str(a), str(c))
total_count = sum(countedParts.values())
sheet.set('B'+str(a+1), 'Итого')
sheet.set('C' + str(a+1), str(total_count))
def run_BoM_list():
createSpreadsheet()
sheet = App.ActiveDocument.getObject("BoM_List")
labelParts = SolidBodiesParcer()._asmThere
sortedParts = uniquePartsSort(labelParts)
countedParts = countForUniques(sortedParts)
fillInBoMList(sheet, countedParts)

View file

@ -1,19 +0,0 @@
# Change Log
All notable changes to this project will be documented in this file.
The format is based on [Keep a Changelog](http://keepachangelog.com/)
and this project adheres to [Semantic Versioning](http://semver.org/).
## [0.1] - Robbossembler FreeCAD Workbench - 2024.04.07
Верстак для предподготовки CAD-модели изделия к автоматизированному производству.
### Added
-
### Changed
- Изменена компоновка в директории верстака. Все относящиеся к работе верстака элементы теперь находятся в его директории.
- Добавлен инструмент публикации проекта и создания всех необходимых файлов через верстак.
### Fixed
-

View file

@ -1,49 +0,0 @@
import FreeCAD
import FreeCADGui
from PySide import QtGui, QtCore
class DatumTool:
"""
A tool for creating datums in existing models
"""
def __init__(self):
self.active = False
def activate(self):
self.active = True
FreeCAD.Console.PrintMessage("Datum tool activatedn")
def deactivate(self):
self.active = False
FreeCAD.Console.PrintMessage("Datum tool deactivatedn")
def mousePressEvent(self, event):
if self.active:
# Create a datum at the position of the mouse click
pos = FreeCADGui.ActiveDocument.ActiveView.getCursorPos()
point = FreeCADGui.ActiveDocument.ActiveView.getPoint(pos)
datum = FreeCAD.ActiveDocument.addObject("Part::Datum", "Datum")
datum.Placement.Base = point
datum.ViewObject.ShapeColor = (0.0, 1.0, 0.0) # Set the color of the datum to green
FreeCAD.ActiveDocument.recompute()
class DatumCommand:
"""
A command for activating and deactivating the datum tool
"""
def __init__(self):
self.tool = DatumTool()
def Activated(self):
self.tool.activate()
FreeCADGui.ActiveDocument.ActiveView.addEventCallback("SoMouseButtonEvent", self.tool.mousePressEvent)
def Deactivated(self):
self.tool.deactivate()
FreeCADGui.ActiveDocument.ActiveView.removeEventCallback("SoMouseButtonEvent", self.tool.mousePressEvent)
def GetResources(self):
return {'Pixmap': 'path/to/icon.png', 'MenuText': 'Datum Tool', 'ToolTip': 'Creates datum elements in existing models'}
# Add the command to the Draft Workbench
FreeCADGui.addCommand('DatumCommand', DatumCommand())

View file

@ -1,826 +0,0 @@
import FreeCAD
from . import ICONPATH, TRANSLATIONSPATH
from .Tools import spawnClassCommand, placement2axisvec, describeSubObject, getPrimitiveInfo #, RobossemblerFreeCadExportScenario
from .pddl import freecad2pddl
from .BoMList import run_BoM_list
from .export_entities import export_coordinate_systems
from .utils.freecad_processor import process_file
from .project_validator import validate_project
from .usecases.asm4parser_usecase import Asm4StructureParseUseCase
from .constraints_operator import create_assembly_parameters, create_fastener_set, create_assembly_sequence, create_clearance_constraint, export_assembly_settings
from .geometric_feasibility_predicate.main import main as structure_analysis
from .asm_graph import main as asm_graph
# from .autodock_generator import main as asm_layers
from .assembly_graph_generation import main as structure_graph
if FreeCAD.GuiUp:
import FreeCADGui
from pivy import coin
from PySide import QtCore, QtGui, QtSvg
import Part
import os
############################################################
# Frame Objects
############################################################
class Frame(object):
"""Basic freestanding frame"""
def __init__(self, obj):
obj.addProperty("App::PropertyPlacement",
"Placement", "Base",
"Placement of the frame")
obj.Placement = FreeCAD.Placement()
obj.Proxy = self
self.obj = obj
self.additional_data = {}
def onChanged(self, fp, prop):
pass
def execute(self, obj):
pass
def __getstate__(self):
return None
def __setstate__(self, state):
return None
def getDict(self):
d = {}
d["label"] = str(self.obj.Label)
d["placement"] = placement2axisvec(self.obj.Placement)
d.update(self.additional_data)
return d
class PartFrame(Frame):
"""Frame rigidly attached to a part frame.
Inherits the base placement from the part's frame, and placement is
relative to the part frame.
"""
def __init__(self, obj, partobj):
Frame.__init__(self, obj)
obj.addProperty("App::PropertyPlacementLink",
"Part", "Parent",
"The part to attach to.")
obj.Part = partobj
obj.setEditorMode("Part", 1)
def execute(self, obj):
if FreeCAD.GuiUp:
obj.ViewObject.Proxy.updateData(obj, "Placement")
def getDict(self):
d = Frame.getDict(self)
d["part"] = str(self.obj.Part.Label)
return d
class FeatureFrame(PartFrame):
"""Frame rigidly attached to a feature.
The feature frame is attached to a feature on a part. It gives both the
placement of the feature w.r.t. the part, and the placement from the
feature."""
def __init__(self, obj, partobj, featurePlacement):
PartFrame.__init__(self, obj, partobj)
obj.addProperty("App::PropertyPlacement",
"FeaturePlacement", "Feature",
"The frame attached to the feature.")
obj.addProperty("App::PropertyString",
"PrimitiveType", "Feature",
"The primitive type of the feature.")
obj.addProperty("App::PropertyString",
"ShapeType", "Feature",
"The shape type of the feature.")
obj.addProperty("App::PropertyString",
"Positioning", "Feature",
"The type of positioning used during creation.")
obj.FeaturePlacement = featurePlacement
def getDict(self):
d = PartFrame.getDict(self)
d["featureplacement"] = placement2axisvec(self.obj.FeaturePlacement)
d["shapetype"] = str(self.obj.ShapeType)
d["positioning"] = str(self.obj.Positioning)
return d
############################################################
# ViewProvider to the frames
############################################################
class ViewProviderFrame(object):
"""ViewProvider for the basic frame.
Uses the SOAxiscrosskit to create axises with constant length regardless
of zoom. Updates position when placement is changed.
"""
def __init__(self, vobj):
vobj.addProperty("App::PropertyFloat", "Scale")
vobj.Scale = 0.12
vobj.addProperty("App::PropertyFloat", "HeadSize")
vobj.HeadSize = 3.0
vobj.addProperty("App::PropertyFloat", "LineWidth")
vobj.LineWidth = 2.0
vobj.Proxy = self
def attach(self, vobj):
# We only have a shaded visual group
self.shaded = coin.SoGroup()
# Takes heavily from SoAxisCrosskit.h,
# and Toggle_DH_Frames by galou_breizh on the forums
self.vframe = coin.SoType.fromName("SoShapeScale").createInstance()
self.vframe.setPart("shape", coin.SoType.fromName("SoAxisCrossKit").createInstance())
self.vframe.scaleFactor.setValue(0.2)
ax = self.vframe.getPart("shape", 0)
cone = ax.getPart("xHead.shape", 0)
cone.bottomRadius.setValue(vobj.HeadSize)
cone = ax.getPart("yHead.shape", 0)
cone.bottomRadius.setValue(vobj.HeadSize)
cone = ax.getPart("zHead.shape", 0)
cone.bottomRadius.setValue(vobj.HeadSize)
lwstring = "lineWidth {0}".format(vobj.LineWidth)
ax.set("xAxis.appearance.drawStyle", lwstring)
ax.set("yAxis.appearance.drawStyle", lwstring)
ax.set("zAxis.appearance.drawStyle", lwstring)
ax.set("xAxis.pickStyle", "style SHAPE")
ax.set("yAxis.pickStyle", "style SHAPE")
ax.set("zAxis.pickStyle", "style SHAPE")
# Then remember to make it selectable in the viewer
selectionNode = coin.SoType.fromName("SoFCSelection").createInstance()
selectionNode.documentName.setValue(FreeCAD.ActiveDocument.Name)
selectionNode.objectName.setValue(vobj.Object.Name)
selectionNode.subElementName.setValue("Frame")
selectionNode.addChild(self.vframe)
# We would like to place it where we want
self.transform = coin.SoTransform()
self.shaded.addChild(self.transform)
self.shaded.addChild(self.vframe)
self.shaded.addChild(selectionNode)
vobj.addDisplayMode(self.shaded, "Shaded")
def updateData(self, fp, prop):
if prop == "Placement":
pl = fp.getPropertyByName("Placement")
self.transform.translation = (pl.Base.x,
pl.Base.y,
pl.Base.z)
self.transform.rotation = pl.Rotation.Q
def getDisplayModes(self, vobj):
modes = ["Shaded"]
return modes
def getDefaultDisplayMode(self):
return "Shaded"
def onChanged(self, vp, prop):
if prop == "Scale":
s = vp.getPropertyByName("Scale")
self.vframe.scaleFactor.setValue(float(s))
elif prop == "HeadSize":
hs = vp.getPropertyByName("HeadSize")
xcone = self.vframe.getPart("shape", 0).getPart("xHead.shape", 0)
xcone.bottomRadius.setValue(float(hs))
ycone = self.vframe.getPart("shape", 0).getPart("yHead.shape", 0)
ycone.bottomRadius.setValue(float(hs))
zcone = self.vframe.getPart("shape", 0).getPart("zHead.shape", 0)
zcone.bottomRadius.setValue(float(hs))
elif prop == "LineWidth":
lw = vp.getPropertyByName("LineWidth")
lwstring = "lineWidth {0}".format(lw)
ax = self.vframe.getPart("shape", 0)
ax.set("xAxis.appearance.drawStyle", lwstring)
ax.set("yAxis.appearance.drawStyle", lwstring)
ax.set("zAxis.appearance.drawStyle", lwstring)
def __getstate__(self):
return None
def __setstate__(self, state):
pass
class ViewProviderPartFrame(ViewProviderFrame):
"""View provider to the part frame."""
def updateData(self, fp, prop):
if prop == "Placement":
parentpl = fp.getPropertyByName("Part").Placement
localpl = fp.Placement
pl = parentpl.multiply(localpl)
self.transform.translation = (pl.Base.x,
pl.Base.y,
pl.Base.z)
self.transform.rotation = pl.Rotation.Q
class ViewProviderFeatureFrame(ViewProviderFrame):
"""View provider to the feature frames."""
def updateData(self, fp, prop):
if prop == "Placement":
parentpl = fp.getPropertyByName("Part").Placement
featurepl = fp.getPropertyByName("FeaturePlacement")
localpl = fp.Placement
pl = parentpl.multiply(featurepl.multiply(localpl))
self.transform.translation = (pl.Base.x,
pl.Base.y,
pl.Base.z)
self.transform.rotation = pl.Rotation.Q
###################################################################
# Base functions
###################################################################
def makeFrame(placement=FreeCAD.Placement()):
obj = FreeCAD.ActiveDocument.addObject("App::FeaturePython", "Frame")
Frame(obj)
if FreeCAD.GuiUp:
ViewProviderFrame(obj.ViewObject)
return obj
def makePartFrame(part):
obj = FreeCAD.ActiveDocument.addObject("App::FeaturePython", "PartFrame")
PartFrame(obj, part)
#if int(FreeCAD.Version()[1]) > 16:
# geo_feature_group = part.getParentGeoFeatureGroup()
# geo_feature_group.addObject(obj)
if FreeCAD.GuiUp:
ViewProviderPartFrame(obj.ViewObject)
return obj
def makeFeatureFrame(part, featurepl):
obj = FreeCAD.ActiveDocument.addObject("App::FeaturePython",
"FeatureFrame")
FeatureFrame(obj, part, featurepl)
# If we're >0.16, add the feature frame to the assembly
#if int(FreeCAD.Version()[1]) > 16:
# geo_feature_group = part.getParentGeoFeatureGroup()
# geo_feature_group.addObject(obj)
if FreeCAD.GuiUp:
ViewProviderFeatureFrame(obj.ViewObject)
return obj
def makeSelectedPartFrames():
for part in FreeCADGui.Selection.getSelection():
if isinstance(part, Part.Feature):
pf = makePartFrame(part)
pf.Label = "Frame"+str(part.Label)
def makeAllPartFrames():
dc = FreeCAD.activeDocument()
for part in dc.Objects:
if isinstance(part, Part.Feature):
pf = makePartFrame(part)
pf.Label = "Frame"+str(part.Label)
def spawnFeatureFrameCreator():
ffpanel = FeatureFramePanel()
FreeCADGui.Control.showDialog(ffpanel)
###################################################################
# GUI Related
###################################################################
spawnClassCommand("BoMGeneration",
run_BoM_list,
{"Pixmap": str(os.path.join(ICONPATH, "BoMList.svg")),
"MenuText": "Generate Bill of Materials",
"ToolTip": "Press the button to create big BoM"})
spawnClassCommand("FrameCommand",
makeFrame,
{"Pixmap": str(os.path.join(ICONPATH, "frame.svg")),
"MenuText": "Make a free frame",
"ToolTip": "Make a freestanding reference frame."})
spawnClassCommand("SelectedPartFrameCommand",
makeSelectedPartFrames,
{"Pixmap": str(os.path.join(ICONPATH, "partframe.svg")),
"MenuText": "selected parts frames",
"ToolTip": "Make selected parts frames."})
spawnClassCommand("AllPartFramesCommand",
makeAllPartFrames,
{"Pixmap": str(os.path.join(ICONPATH, "allpartframes.svg")),
"MenuText": "All parts frames",
"ToolTip": "Make all parts frames."})
spawnClassCommand("FeatureFrameCommand",
spawnFeatureFrameCreator,
{"Pixmap": str(os.path.join(ICONPATH, "featureframecreator.svg")),
"MenuText": "frame on selected primitive",
"ToolTip": "Create a frame on selected primitive."})
spawnClassCommand("Export_Entities",
export_coordinate_systems,
{"Pixmap": str(os.path.join(ICONPATH, "BoMList.svg")),
"MenuText": "ExportLCS",
"ToolTip": "Export all the markups"})
spawnClassCommand("Validate_Project",
validate_project,
{"Pixmap": str(os.path.join(ICONPATH, "")),
"MenuText": "Validate Project",
"ToolTip": "Check errors in project file"})
spawnClassCommand("Publish_Project",
process_file,
{"Pixmap": str(os.path.join(ICONPATH, "publish.svg")),
"MenuText": "Publish Project",
"ToolTip": "Save and export project files"})
spawnClassCommand("Create Assembly Parameters",
create_assembly_parameters,
{"Pixmap": str(os.path.join(ICONPATH, "galternatives.ico")),
"MenuText": "Create Assembly Parameters",
"ToolTip": "Create Assembly Parameters"})
spawnClassCommand("Create Fastener Set",
create_fastener_set,
{"Pixmap": str(os.path.join(ICONPATH, "screw26.ico")),
"MenuText": "Create Fastener Set",
"ToolTip": "Create Fastener Set"})
spawnClassCommand("Compute Assembly Sequence",
structure_analysis,
{"Pixmap": str(os.path.join(ICONPATH, "free-icon-software-5741483.png")),
"MenuText": "Compute Assembly Sequence",
"ToolTip": "Compute Assembly Sequence"})
spawnClassCommand("Create Assembly Sequence",
create_assembly_sequence,
{"Pixmap": str(os.path.join(ICONPATH, "assembly.ico")),
"MenuText": "Create Assembly Sequence",
"ToolTip": "Create Assembly Sequence"})
spawnClassCommand("Export Assembly Settings",
export_assembly_settings,
{"Pixmap": str(os.path.join(ICONPATH, "free-icon-export-724827.ico")),
"MenuText": "Export Assembly Settings",
"ToolTip": "Export Assembly Settings"})
# spawnClassCommand("Create Assembly Layers",
# asm_layers,
# {"Pixmap": str(os.path.join(ICONPATH, ".svg")),
# "MenuText": "Create Assembly Layers",
# "ToolTip": "Create Assembly Layers"})
spawnClassCommand("Create Structure Graph",
structure_graph,
{"Pixmap": str(os.path.join(ICONPATH, "pngwing.com.ico")),
"MenuText": "Create Structure Graph",
"ToolTip": "Create Structure Graph"})
spawnClassCommand("Create Assembly Graph",
asm_graph,
{"Pixmap": str(os.path.join(ICONPATH, "iteration_3316689.ico")),
"MenuText": "Create Assembly Graph",
"ToolTip": "Create Assembly Graph"})
###################################################################
# GUI buttons
###################################################################
class FeatureFramePanel:
"""Spawn panel choices for a feature."""
def __init__(self):
selected = FreeCADGui.Selection.getSelectionEx()
# Check selection
if len(selected) == 1:
selected = selected[0]
self.selected = selected
else:
FreeCAD.Console.PrintError("Multipart selection not available.")
self.reject()
if not selected.HasSubObjects:
FreeCAD.Console.PrintError("Part selected not feature.")
self.reject()
elif not len(selected.SubObjects) == 1:
FreeCAD.Console.PrintError("Multifeature selection not available")
self.reject()
# Choices related to selection
so_desc = describeSubObject(selected.SubObjects[0])
self.so_desc = so_desc
shape_choices = {
"Vertex": [],
"Edge": ["PointOnEdge"],
"Face": ["PointOnSurface"]
}
prim_choices = {
"ArcOfCircle": ["Center"],
"ArcOfEllipse": ["Center"],
"ArcOfHyperBola": ["Center"],
"ArcOfParabola": ["Center"],
"BSplineCurve": ["Center"],
"BezierCurve": ["Center"],
"Circle": ["Center"],
"Ellipse": ["Center"],
"Hyperbola": ["Center"],
"Parabola": ["Center"],
"Line": [],
"BSplineSurface": ["Center"],
"BezierSurface": ["Center"],
"Cylinder": ["PointOnCenterline"],
"Plane": ["Center"],
"Sphere": ["Center"],
"Toroid": ["Center"],
"Cone": ["PointOnCenterline"]
}
self.choices = ["PickedPoint"]
self.choices = self.choices + shape_choices[so_desc[1]]
self.choices = self.choices + prim_choices[so_desc[0]]
# Setting up QT form
uiform_path = os.path.join(UIPATH, "FeatureFrameCreator.ui")
self.form = FreeCADGui.PySideUic.loadUi(uiform_path)
self.form.ChoicesBox.addItems(self.choices)
self.form.PickedTypeLabel.setText(so_desc[0])
QtCore.QObject.connect(self.form.ChoicesBox,
QtCore.SIGNAL("currentIndexChanged(QString)"),
self.choiceChanged)
self.scenes = {}
for choice in self.choices:
sc = QtGui.QGraphicsScene()
icon = str(os.path.join(ICONPATH, choice+".svg"))
sc.addItem(QtSvg.QGraphicsSvgItem(icon))
self.scenes[choice] = sc
self.choiceChanged(self.form.ChoicesBox.currentText())
def choiceChanged(self, choice):
if choice in self.scenes.keys():
self.form.Preview.setScene(self.scenes[choice])
def accept(self):
sel_choice = self.form.ChoicesBox.currentText()
paneldict = {"PickedPoint": PickedPointPanel,
"PointOnEdge": PointOnEdgePanel,
"PointOnSurface": PointOnSurfacePanel,
"Center": CenterPanel,
"PointOnCenterline": PointOnCenterlinePanel}
pan = paneldict[sel_choice](self.selected, self.so_desc)
FreeCADGui.Control.closeDialog()
# The dialog is actually closed after the accept function has
# completed. So we need to use a delayed task to open the new dialog:
QtCore.QTimer.singleShot(0,
lambda: FreeCADGui.Control.showDialog(pan))
def reject(self):
FreeCADGui.Control.closeDialog()
class BaseFeaturePanel(object):
"""Base feature panel to be inherited from."""
def __init__(self, selected, so_desc):
# Handle selected and FF placement
self.selected = selected
self.so_desc = so_desc
# Connect offset to spinboxes
QtCore.QObject.connect(self.form.XBox,
QtCore.SIGNAL("valueChanged(double)"),
self.offsetChanged)
QtCore.QObject.connect(self.form.YBox,
QtCore.SIGNAL("valueChanged(double)"),
self.offsetChanged)
QtCore.QObject.connect(self.form.ZBox,
QtCore.SIGNAL("valueChanged(double)"),
self.offsetChanged)
QtCore.QObject.connect(self.form.RollBox,
QtCore.SIGNAL("valueChanged(double)"),
self.offsetChanged)
QtCore.QObject.connect(self.form.PitchBox,
QtCore.SIGNAL("valueChanged(double)"),
self.offsetChanged)
QtCore.QObject.connect(self.form.YawBox,
QtCore.SIGNAL("valueChanged(double)"),
self.offsetChanged)
QtCore.QObject.connect(self.form.ScaleBox,
QtCore.SIGNAL("valueChanged(double)"),
self.scaleChanged)
def createFrame(self):
self.fframe = makeFeatureFrame(self.selected.Object, self.local_ffpl)
self.fframe.PrimitiveType = self.so_desc[0]
self.fframe.ShapeType = self.so_desc[1]
ad = getPrimitiveInfo(self.so_desc[0],
self.selected.SubObjects[0])
self.fframe.Proxy.additional_data.update(ad)
def scaleChanged(self):
scale = self.form.ScaleBox.value()
self.fframe.ViewObject.Scale = scale
def offsetChanged(self):
disp = FreeCAD.Vector(self.form.XBox.value(),
self.form.YBox.value(),
self.form.ZBox.value())
rot = FreeCAD.Rotation(self.form.YawBox.value(),
self.form.PitchBox.value(),
self.form.RollBox.value())
offset = FreeCAD.Placement(disp, rot)
self.fframe.Placement = offset
def accept(self):
framelabel = self.form.FrameLabelField.toPlainText()
if not len(framelabel) == 0:
self.fframe.Label = framelabel
FreeCADGui.Control.closeDialog()
def reject(self):
FreeCAD.activeDocument().removeObject(self.fframe.Name)
FreeCADGui.Control.closeDialog()
class PickedPointPanel(BaseFeaturePanel):
"""Create a feature frame at the picked point."""
# Not very clever. It just places the frame with default rotation.
def __init__(self, selected, so_desc):
uiform_path = os.path.join(UIPATH, "FramePlacer.ui")
self.form = FreeCADGui.PySideUic.loadUi(uiform_path)
BaseFeaturePanel.__init__(self, selected, so_desc)
parent_pl = selected.Object.Placement
abs_pl = FreeCAD.Placement(selected.PickedPoints[0],
FreeCAD.Rotation())
self.local_ffpl = parent_pl.inverse().multiply(abs_pl)
self.createFrame()
self.fframe.Positioning = "PickedPoint"
class PointOnEdgePanel(BaseFeaturePanel):
"""Create a feature frame on an edge."""
def __init__(self, selected, so_desc):
uiform_path = os.path.join(UIPATH, "FramePlacer.ui")
self.form = FreeCADGui.PySideUic.loadUi(uiform_path)
# Enable the first parameter
self.form.VLabel.setEnabled(True)
self.form.VLabel.setVisible(True)
self.form.VLabel.setText("u")
self.form.VBox.setEnabled(True)
self.form.VBox.setVisible(True)
QtCore.QObject.connect(self.form.VBox,
QtCore.SIGNAL("valueChanged(double)"),
self.parameterChanged)
# Enable percentage or param selection
self.form.OptionsLabel.setEnabled(True)
self.form.OptionsLabel.setVisible(True)
self.form.OptionsLabel.setText("Arc param.")
self.form.OptionsBox.setEnabled(True)
self.form.OptionsBox.setVisible(True)
self.form.OptionsBox.addItems(["mm", "%"])
QtCore.QObject.connect(self.form.OptionsBox,
QtCore.SIGNAL("currentIndexChanged(QString)"),
self.choiceChanged)
BaseFeaturePanel.__init__(self, selected, so_desc)
# Place the frame wherever the values are atm
self.local_ffpl = FreeCAD.Placement()
self.createFrame()
self.fframe.Positioning = "PointOnEdge"
self.choiceChanged(self.form.OptionsBox.currentText())
self.parameterChanged()
def parameterChanged(self):
value = self.form.VBox.value()
if self.form.OptionsBox.currentText() == "%":
value = self.p2mm(value)
edge = self.selected.SubObjects[0]
point = edge.valueAt(value)
tangentdir = edge.tangentAt(value)
rot = FreeCAD.Rotation(FreeCAD.Vector(1, 0, 0),
tangentdir)
abs_ffpl = FreeCAD.Placement(point, rot)
parent_pl = self.selected.Object.Placement
self.local_ffpl = parent_pl.inverse().multiply(abs_ffpl)
self.fframe.FeaturePlacement = self.local_ffpl
# force recompute of placement?
self.fframe.Placement = self.fframe.Placement
def choiceChanged(self, choice):
value = self.form.VBox.value()
if choice == "mm":
value = self.p2mm(value)
self.form.VBox.setSuffix("mm")
parameter_range = self.selected.SubObjects[0].ParameterRange
self.form.VBox.setRange(*parameter_range)
self.form.VBox.setSingleStep(0.1)
elif choice == "%":
value = self.mm2p(value)
self.form.VBox.setSuffix("%")
self.form.VBox.setRange(0, 100.0)
self.form.VBox.setSingleStep(1.0)
self.form.VBox.setValue(value)
def p2mm(self, value):
parameter_range = self.selected.SubObjects[0].ParameterRange
delta = parameter_range[1] - parameter_range[0]
return 0.01*value*delta + parameter_range[0]
def mm2p(self, value):
parameter_range = self.selected.SubObjects[0].ParameterRange
delta = parameter_range[1] - parameter_range[0]
return 100.0*(value - parameter_range[0])/delta
class PointOnSurfacePanel(BaseFeaturePanel):
"""Create a feature on a surface."""
def __init__(self, selected, so_desc):
uiform_path = os.path.join(UIPATH, "FramePlacer.ui")
self.form = FreeCADGui.PySideUic.loadUi(uiform_path)
# Enable both parameters
self.form.ULabel.setVisible(True)
self.form.VLabel.setVisible(True)
self.form.UBox.setVisible(True)
self.form.VBox.setVisible(True)
QtCore.QObject.connect(self.form.VBox,
QtCore.SIGNAL("valueChanged(double)"),
self.parameterChanged)
QtCore.QObject.connect(self.form.UBox,
QtCore.SIGNAL("valueChanged(double)"),
self.parameterChanged)
# Enable percentage or param selection
self.form.OptionsLabel.setEnabled(True)
self.form.OptionsLabel.setVisible(True)
self.form.OptionsLabel.setText("Surf. param.")
self.form.OptionsBox.setEnabled(True)
self.form.OptionsBox.setVisible(True)
self.form.OptionsBox.addItems(["mm", "%"])
QtCore.QObject.connect(self.form.OptionsBox,
QtCore.SIGNAL("currentIndexChanged(QString)"),
self.choiceChanged)
BaseFeaturePanel.__init__(self, selected, so_desc)
# Place the frame wherever the values are atm
self.local_ffpl = FreeCAD.Placement()
self.createFrame()
self.fframe.Positioning = "PointOnSurface"
self.choiceChanged(self.form.OptionsBox.currentText())
self.parameterChanged()
def parameterChanged(self):
value = (self.form.UBox.value(), self.form.VBox.value())
if self.form.OptionsBox.currentText() == "%":
value = self.p2mm(value)
face = self.selected.SubObjects[0]
point = face.valueAt(*value)
normaldir = face.normalAt(*value)
rotation = FreeCAD.Rotation(FreeCAD.Vector(0, 0, 1),
normaldir)
abs_ffpl = FreeCAD.Placement(point, rotation)
parent_pl = self.selected.Object.Placement
self.local_ffpl = parent_pl.inverse().multiply(abs_ffpl)
self.fframe.FeaturePlacement = self.local_ffpl
# Force recompute of placement
self.fframe.Placement = self.fframe.Placement
def choiceChanged(self, choice):
value = (self.form.UBox.value(), self.form.VBox.value())
if choice == "mm":
value = self.p2mm(value)
parameter_range = self.selected.SubObjects[0].ParameterRange
self.form.UBox.setRange(parameter_range[0], parameter_range[1])
self.form.UBox.setSuffix("mm")
self.form.UBox.setSingleStep(0.1)
self.form.VBox.setRange(parameter_range[2], parameter_range[3])
self.form.VBox.setSuffix("mm")
self.form.VBox.setSingleStep(0.1)
elif choice == "%":
value = self.mm2p(value)
self.form.UBox.setRange(0.0, 100.0)
self.form.UBox.setSuffix("%")
self.form.VBox.setRange(0.0, 100.0)
self.form.UBox.setSingleStep(1.0)
self.form.VBox.setSuffix("%")
self.form.VBox.setSingleStep(1.0)
self.form.UBox.setValue(value[0])
self.form.VBox.setValue(value[1])
def p2mm(self, value):
parameter_range = self.selected.SubObjects[0].ParameterRange
delta = [parameter_range[1] - parameter_range[0],
parameter_range[3] - parameter_range[2]]
u = 0.01*value[0]*delta[0] + parameter_range[0]
v = 0.01*value[1]*delta[1] + parameter_range[2]
return (u, v)
def mm2p(self, value):
parameter_range = self.selected.SubObjects[0].ParameterRange
delta = [parameter_range[1] - parameter_range[0],
parameter_range[3] - parameter_range[2]]
u = 100.0*(value[0] - parameter_range[0])/delta[0]
v = 100.0*(value[1] - parameter_range[2])/delta[1]
return (u, v)
class CenterPanel(BaseFeaturePanel):
"""Create a feature frame on center."""
def __init__(self, selected, so_desc):
uiform_path = os.path.join(UIPATH, "FramePlacer.ui")
self.form = FreeCADGui.PySideUic.loadUi(uiform_path)
BaseFeaturePanel.__init__(self, selected, so_desc)
edge_curve_list = ["ArcOfCircle",
"ArcOfEllipse",
"ArcOfHyperbola",
"ArcOfParabola",
"Circle",
"Ellipse",
"Hyperbola",
"Parabola"]
face_surf_list = ["Sphere",
"Toroid"]
if so_desc[0] in edge_curve_list:
edge = selected.SubObjects[0]
axis = edge.Curve.Axis
rotation = FreeCAD.Rotation(FreeCAD.Vector(0, 0, 1),
axis)
center_point = edge.Curve.Center
elif so_desc[0] in face_surf_list:
face = selected.SubObjects[0]
axis = face.Surface.Axis
rotation = FreeCAD.Rotation(FreeCAD.Vector(0, 0, 1),
axis)
center_point = face.Surface.Center
else:
rotation = FreeCAD.Rotation()
center_point = selected.SubObjects[0].CenterOfMass
parent_pl = selected.Object.Placement
abs_pl = FreeCAD.Placement(center_point,
rotation)
self.local_ffpl = parent_pl.inverse().multiply(abs_pl)
self.createFrame()
self.fframe.Positioning = "Center"
class PointOnCenterlinePanel(BaseFeaturePanel):
"""Create a point on centerline of primitive."""
def __init__(self, selected, so_desc):
uiform_path = os.path.join(UIPATH, "FramePlacer.ui")
self.form = FreeCADGui.PySideUic.loadUi(uiform_path)
BaseFeaturePanel.__init__(self, selected, so_desc)
# Enable the along line parameter
self.form.VLabel.setVisible(True)
self.form.VLabel.setText("u")
self.form.VBox.setVisible(True)
QtCore.QObject.connect(self.form.VBox,
QtCore.SIGNAL("valueChanged(double)"),
self.parameterChanged)
# Enable percentage of param selection
self.form.OptionsLabel.setVisible(True)
self.form.OptionsLabel.setText("Line param.")
self.form.OptionsBox.setVisible(True)
self.form.OptionsBox.addItems(["mm", "%"])
QtCore.QObject.connect(self.form.OptionsBox,
QtCore.SIGNAL("currentIndexChanged(QString)"),
self.choiceChanged)
# Place the frame wherever the values are atm
self.local_ffpl = FreeCAD.Placement()
self.createFrame()
self.fframe.Positioning = "PointOnCenterline"
self.parameterChanged()
def parameterChanged(self):
value = self.form.VBox.value()
if self.form.OptionsBox.currentText() == "%":
value = self.p2mm(value)
displacement_pl = FreeCAD.Placement(FreeCAD.Vector(0, 0, value),
FreeCAD.Rotation())
# Find the center
axis = self.selected.SubObjects[0].Surface.Axis
rotation = FreeCAD.Rotation(FreeCAD.Vector(0, 0, 1),
axis)
center_point = self.selected.SubObjects[0].Surface.Center
center_pl = FreeCAD.Placement(center_point, rotation)
abs_ffpl = center_pl.multiply(displacement_pl)
parent_pl = self.selected.Object.Placement
self.local_ffpl = parent_pl.inverse().multiply(abs_ffpl)
self.fframe.FeaturePlacement = self.local_ffpl
# force recompute of placement
self.fframe.Placement = self.fframe.Placement
def choiceChanged(self, choice):
FreeCAD.Console.PrintMessage("choiceChanged\n")
value = self.form.VBox.value()
FreeCAD.Console.PrintMessage("preval:"+str(value)+"\n")
if choice == "mm":
value = self.p2mm(value)
self.form.VBox.setSuffix("mm")
parameter_range = self.selected.SubObjects[0].ParameterRange[2:]
self.form.VBox.setRange(*parameter_range)
self.form.VBox.setSingleStep(0.1)
elif choice == "%":
value = self.mm2p(value)
self.form.VBox.setSuffix("%")
self.form.VBox.setRange(0, 100)
self.form.VBox.setSingleStep(1.0)
self.form.VBox.setValue(value)
FreeCAD.Console.PrintMessage("postval:"+str(value)+"\n")
def p2mm(self, value):
parameter_range = self.selected.SubObjects[0].ParameterRange[2:]
delta = parameter_range[1] - parameter_range[0]
return 0.01*value*delta + parameter_range[0]
def mm2p(self, value):
parameter_range = self.selected.SubObjects[0].ParameterRange[2:]
delta = parameter_range[1] - parameter_range[0]
return 100.0*(value - parameter_range[0])/delta

View file

@ -1,566 +0,0 @@
import FreeCAD, Mesh, os, numpy as np
import yaml
import argparse
import collada
from xml.etree import ElementTree as ET
from xml.dom.minidom import parseString
from math import radians as _radians
import Part
# Takes subassembly or parts dictionary { part_label: { "obj": <obj>, "mesh": <meshuri> } }
# and generate SDF for them
def export_sdf(objects, export_dir, modelname, configs={}):
model_dir = os.path.join(export_dir, modelname)
scale = configs.get('scale', 0.001)
scale_vec = FreeCAD.Vector([scale]*3)
density = configs.get('density', 1000)
shapes = list(map(lambda x: x["obj"].Shape, objects.values()))
bounding_box = Part.makeCompound(shapes).BoundBox
bounding_box.scale(*scale_vec)
global_pose_base = FreeCAD.Vector(bounding_box.XLength/2,
bounding_box.YLength/2,
bounding_box.ZLength/2)
global_pose_base -= bounding_box.Center
global_pose = FreeCAD.Placement()
global_pose.Base = global_pose_base
model = Model(name=modelname, pose=global_pose)
model.self_collide = False
model.sdf_version = '1.5'
for label in objects.keys():
shape = objects[label]["obj"].Shape
mass = shape.Mass * scale**3 * density
com = shape.CenterOfMass * scale
inr = shape.MatrixOfInertia
inr.scale(*scale_vec*(scale**4) * density)
placement = shape.Placement
placement.Base.scale(*scale_vec)
pose = placement.copy()
pose.Base = com
pose_rpy = pose.copy()
pose_rpy.Base=(np.zeros(3))
inertia = Inertia(inertia=np.array(inr.A)[[0,1,2,5,6,10]])
inertial = Inertial(pose=pose_rpy, mass=mass, inertia=inertia)
mesh_uri = os.path.normpath(os.path.relpath(objects[label]["mesh"], export_dir))
visual = Visual(name=label+'_visual', mesh=mesh_uri)
collision = Collision(name=label+'_collision', mesh=mesh_uri)
link = Link(name=label,
pose=pose,
inertial=inertial,
visual=visual,
collision=collision)
model.links.append(link)
with open(os.path.join(model_dir, 'model.sdf'), 'w') as sdf_file:
sdf_file.write(model.to_xml_string('sdf'))
###################################################################
# Export helpers
###################################################################
def export_collada(exportList, filename, scale=0.001, quality=1, offset=np.zeros(3)):
'''FreeCAD collada exporter
exportList - list of objects
scale - scaling factor for the mesh
quality - mesh tessellation quality
offset - offset of the origin of the resulting mesh'''
colmesh = collada.Collada()
colmesh.assetInfo.upaxis = collada.asset.UP_AXIS.Z_UP
objind = 0
scenenodes = []
for obj in exportList:
bHandled = False
if obj.isDerivedFrom("Part::Feature"):
bHandled = True
m = obj.Shape.tessellate(quality)
vindex = []
nindex = []
findex = []
# vertex indices
for v in m[0]:
vindex.extend([a*scale+b for a, b in zip(v, offset)])
# normals
for f in obj.Shape.Faces:
n = f.normalAt(0,0)
for i in range(len(f.tessellate(quality)[1])):
nindex.extend([n.x,n.y,n.z])
# face indices
for i in range(len(m[1])):
f = m[1][i]
findex.extend([f[0],i,f[1],i,f[2],i])
elif obj.isDerivedFrom("Mesh::Feature"):
bHandled = True
print("exporting mesh ",obj.Name, obj.Mesh)
m = obj.Mesh
vindex = []
nindex = []
findex = []
# vertex indices
for v in m.Topology[0]:
vindex.extend([a*scale+b for a, b in zip(v, offset)])
# normals
for f in m.Facets:
n = f.Normal
nindex.extend([n.x,n.y,n.z])
# face indices
for i in range(len(m.Topology[1])):
f = m.Topology[1][i]
findex.extend([f[0],i,f[1],i,f[2],i])
if bHandled:
vert_src = collada.source.FloatSource("cubeverts-array"+str(objind),
np.array(vindex),
('X', 'Y', 'Z'))
normal_src = collada.source.FloatSource("cubenormals-array"+str(objind),
np.array(nindex),
('X', 'Y', 'Z'))
geom = collada.geometry.Geometry(colmesh,
"geometry"+str(objind),
obj.Label,
[vert_src, normal_src])
input_list = collada.source.InputList()
input_list.addInput(0, 'VERTEX', "#cubeverts-array"+str(objind))
input_list.addInput(1, 'NORMAL', "#cubenormals-array"+str(objind))
triset = geom.createTriangleSet(np.array(findex),
input_list,
"materialref")
geom.primitives.append(triset)
colmesh.geometries.append(geom)
geomnode = collada.scene.GeometryNode(geom)
node = collada.scene.Node("node"+str(objind), children=[geomnode])
#TODO: Add materials handling
scenenodes.append(node)
objind += 1
scene = collada.scene.Scene("scene", scenenodes)
colmesh.scenes.append(scene)
colmesh.scene = scene
colmesh.write(filename)
print("file %s successfully created\n" % filename)
###################################################################
# Conversion Helpers
###################################################################
def deg2rad(d):
'''Converts degrees to radians'''
return _radians(d)
def flt2str(f):
'''Converts floats to formatted string'''
return '{:.6f}'.format(f)
###################################################################
# Model Helpers
###################################################################
def add_poses(p1, p2):
return FreeCAD.Placement(p1.toMatrix() + p2.toMatrix())
def subtract_poses(p1, p2):
return FreeCAD.Placement(p1.toMatrix() + p2.toMatrix().inverse())
def pose_to_xml(pose, fmt='sdf'):
'''Converts a pose/freecad placement/ to xml element
with tag "pose" for sdf and "origin" for urdf'''
xyz = pose.Base
rpy = pose.Rotation.toEuler()
if fmt == 'urdf':
args = {'xyz': ' '.join([flt2str(i) for i in xyz]),
'rpy': ' '.join([flt2str(deg2rad(j)) for j in rpy])}
return ET.Element('origin', args)
pose_elem = ET.Element('pose')
pose_elem.text = ' '.join([flt2str(i) for i in xyz]
+ [flt2str(deg2rad(j)) for j in rpy])
return pose_elem
def pose_xyz(pose):
'''Returns the xyz/Base portion of a pose as string'''
xyz = pose.Base if hasattr(pose, 'Base') else pose
return ' '.join([flt2str(i) for i in xyz])
def config(model_name, sdf, author, email, desc, version):
top = ET.Element('model')
name = ET.SubElement(top, 'name')
name.text = model_name
ver = ET.SubElement(top, 'version')
ver.text = version
sdf_file = ET.SubElement(top, 'sdf')
sdf_file.text = sdf
sdf_file.set('version', '1.5')
author_tag = ET.SubElement(top, 'author')
author_name = ET.SubElement(author_tag, 'name')
author_name.text = author
email_address = ET.SubElement(author_tag, 'email')
email_address.text = email
description = ET.SubElement(top, 'description')
description.text = desc
dom = parseString(ET.tostring(top, encoding="unicode"))
return dom.toprettyxml(indent=' '*2)
class SpatialEntity(object):
'''A base class for sdf/urdf elements containing name, pose and urdf_pose'''
def __init__(self, **kwargs):
self.name = kwargs.get('name', '')
self.pose = kwargs.get('pose', FreeCAD.Placement())
self.global_pose = kwargs.get('global_pose', FreeCAD.Placement())
self.urdf_pose = kwargs.get('urdf_pose', FreeCAD.Placement())
self.formats = ['sdf', 'urdf']
def to_xml(self, fmt='sdf'):
'''Call this to check if a format is supported or not'''
if not fmt in self.formats:
raise Exception('Invalid export format')
class Model(SpatialEntity):
'''A class representing a model/robot'''
def __init__(self, **kwargs):
super(Model, self).__init__(**kwargs)
self.static = kwargs.get('static', False)
self.self_collide = kwargs.get('self_collide', False)
self.sdf_version = kwargs.get('sdf_version', 1.5)
self.links = []
self.joints = []
if 'link' in kwargs:
self.links.append(kwargs.get('link', Link()))
self.links.extend(kwargs.get('links', []))
if 'joint' in kwargs:
self.joints.append(kwargs.get('joint', Joint()))
self.joints.extend(kwargs.get('joints', []))
def get_link(self, link_name):
for link in self.links:
if link_name == link.name:
return link
def get_joint(self, joint_name):
pass
def get_root_link(self):
root_link = None
for link in self.links:
if not link.parent_joint:
root_link = link
return root_link
def build_tree(self):
for joint in self.joints:
joint.parent_link = self.get_link(joint.parent)
if not joint.parent_link:
raise Exception('Parent not found for joint %s' % joint.name)
joint.parent_link.child_joints.append(joint)
joint.child_link = self.get_link(joint.child)
if not joint.child_link:
raise Exception('Child not found for joint %s' % joint.name)
joint.child_link.parent_joint = joint
def calculate_global_poses(self):
for link in self.links:
link.global_pose = add_poses(self.pose, link.pose)
for joint in self.joints:
joint.global_pose = add_poses(joint.child_link.global_pose, joint.pose)
def to_xml(self, fmt='sdf'):
'''returns xml element of a model/robot'''
super(Model, self).to_xml(fmt)
self.build_tree()
self.calculate_global_poses()
tag = 'robot' if fmt=='urdf' else 'model'
model = ET.Element(tag, name=self.name)
if fmt == 'sdf':
model.append(pose_to_xml(self.pose))
static = ET.SubElement(model, 'static')
static.text = str(self.static).lower()
self_collide = ET.SubElement(model, 'self_collide')
self_collide.text = str(self.self_collide).lower()
else:
model.set('static', str(self.static).lower())
root_link = self.get_root_link()
if not root_link:
raise Exception("Couldn't find root link")
model.append(ET.Element('link', name=root_link.name+'_root'))
for link in self.links:
model.append(link.to_xml(fmt))
if fmt=='urdf':
root_joint = ET.Element('joint',
{"name": root_link.name+'_root',
"type": "fixed"})
root_joint.append(pose_to_xml(root_link.global_pose, fmt))
ET.SubElement(root_joint, 'parent', link= root_link.name+'_root')
ET.SubElement(root_joint, 'child', link= root_link.name)
model.append(root_joint)
for joint in self.joints:
model.append(joint.to_xml(fmt))
if fmt == 'sdf':
sdf = ET.Element('sdf', version=str(self.sdf_version))
sdf.append(model)
return sdf
return model
def to_xml_string(self, fmt='sdf', header=True):
dom = parseString(ET.tostring(self.to_xml(fmt)))
return dom.toprettyxml(indent=' '*2)
class Inertia(object):
'''A clss representing an inertia element'''
def __init__(self, **kwargs):
self.ixx = kwargs.get('ixx', 0)
self.ixy = kwargs.get('ixy', 0)
self.ixz = kwargs.get('ixz', 0)
self.iyy = kwargs.get('iyy', 0)
self.iyz = kwargs.get('iyz', 0)
self.izz = kwargs.get('izz', 0)
if 'inertia' in kwargs:
self.ixx, self.ixy, self.ixz = kwargs.get('inertia', [0]*6)[:3]
self.iyy, self.iyz, self.izz = kwargs.get('inertia', [0]*6)[3:]
self.coords = 'ixx', 'ixy', 'ixz', 'iyy', 'iyz', 'izz'
def to_xml(self, fmt='sdf'):
'''returns inetria xml element'''
inertia = ET.Element('inertia')
for coord in self.coords:
if fmt == 'sdf':
elem = ET.SubElement(inertia, coord)
elem.text = flt2str(getattr(self, coord, 0))
else:
inertia.set(coord, flt2str(getattr(self, coord, 0)))
return inertia
class Inertial(SpatialEntity):
'''A class representing an inertial element'''
def __init__(self, **kwargs):
super(Inertial, self).__init__(**kwargs)
self.mass = kwargs.get('mass', 0)
self.inertia = kwargs.get('inertia', Inertia())
def to_xml(self, fmt='sdf'):
'''returns inertial xml element'''
super(Inertial, self).to_xml(fmt)
inertial = ET.Element('inertial')
pose = self.pose if fmt=='sdf' else self.urdf_pose
inertial.append(pose_to_xml(pose, fmt=fmt))
mass = ET.SubElement(inertial, 'mass')
if fmt == 'sdf':
mass.text = flt2str(self.mass)
else:
mass.set('value', flt2str(self.mass))
inertial.append(self.inertia.to_xml(fmt=fmt))
return inertial
class Geom(SpatialEntity):
'''A base class for collision and visual classes'''
def __init__(self, **kwargs):
super(Geom, self).__init__(**kwargs)
self.mesh = kwargs.get('mesh', '')
self.type = kwargs.get('type', 'visual')
def to_xml(self, fmt='sdf'):
'''returns visual or collision xml element'''
super(Geom, self).to_xml(fmt)
elem = ET.Element(self.type, name=self.name)
pose = self.pose if fmt=='sdf' else self.urdf_pose
elem.append(pose_to_xml(pose, fmt=fmt))
geom = ET.SubElement(elem, 'geometry')
mesh = ET.SubElement(geom, 'mesh')
if fmt=='urdf':
mesh.set('filename', 'package://' + self.mesh)
else:
uri = ET.SubElement(mesh, 'uri')
uri.text = 'model://' + self.mesh
return elem
class Visual(Geom):
'''A class representing a visual element'''
def __init__(self, **kwargs):
super(Visual, self).__init__(type='visual', **kwargs)
class Collision(Geom):
'''A class representing a collision element'''
def __init__(self, **kwargs):
super(Collision, self).__init__(type='collision', **kwargs)
class Link(SpatialEntity):
'''A class representing a link element'''
def __init__(self, **kwargs):
super(Link, self).__init__(**kwargs)
self.inertial = kwargs.get('inertial', Inertial())
self.visuals = []
self.collisions = []
self.parent_joint = None
self.child_joints = []
if 'visual' in kwargs:
self.visuals.append(kwargs.get('visual', Visual()))
self.visuals.extend(kwargs.get('visuals', []))
if 'collision' in kwargs:
self.visuals.append(kwargs.get('collision', Collision()))
self.collisions.extend(kwargs.get('collisions', []))
def to_xml(self, fmt='sdf'):
'''returns link xml element'''
super(Link, self).to_xml(fmt)
link = ET.Element('link', name=self.name)
if self.parent_joint:
self.urdf_pose = subtract_poses(self.global_pose,
self.parent_joint.global_pose)
else:
self.urdf_pose = FreeCAD.Placement()
if fmt == 'sdf':
link.append(pose_to_xml(self.pose, fmt=fmt))
self.inertial.urdf_pose = add_poses(self.inertial.pose, self.urdf_pose)
link.append(self.inertial.to_xml(fmt=fmt))
for visual in self.visuals:
visual.urdf_pose = self.urdf_pose.copy()
link.append(visual.to_xml(fmt=fmt))
for collision in self.collisions:
collision.urdf_pose = self.urdf_pose.copy()
link.append(collision.to_xml(fmt=fmt))
return link
class Axis(SpatialEntity):
'''A class representing an axis element'''
def __init__(self, **kwargs):
super(Axis, self).__init__(**kwargs)
self.lower_limit = kwargs.get('lower_limit', 0)
self.upper_limit = kwargs.get('upper_limit', 0)
self.effort_limit = kwargs.get('effort_limit', 0)
self.velocity_limit = kwargs.get('velocity_limit', 0)
self.friction = kwargs.get('friction', 0)
self.damping = kwargs.get('damping', 0)
self.use_parent_frame = kwargs.get('use_parent_frame', False)
def to_xml(self, fmt='sdf'):
'''returns an axis xml element for sdf
or an array of axis and limit xml elements for urdf'''
super(Axis, self).to_xml(fmt)
axis = ET.Element('axis')
if fmt=='sdf':
xyz = ET.SubElement(axis, 'xyz')
xyz.text = pose_xyz(self.pose)
limit = ET.SubElement(axis, 'limit')
lower = ET.SubElement(limit, 'lower')
lower.text = flt2str(deg2rad(self.lower_limit))
upper = ET.SubElement(limit, 'upper')
upper.text = flt2str(deg2rad(self.upper_limit))
effort = ET.SubElement(limit, 'effort')
effort.text = flt2str(self.effort_limit)
velocity = ET.SubElement(limit, 'velocity')
velocity.text = flt2str(self.velocity_limit)
dynamics = ET.SubElement(axis, 'dynamics')
friction = ET.SubElement(dynamics, 'friction')
friction.text = flt2str(self.friction)
damping = ET.SubElement(dynamics, 'damping')
damping.text = flt2str(self.damping)
use_parent_frame = ET.SubElement(axis, 'use_parent_model_frame')
use_parent_frame.text = str(self.use_parent_frame).lower()
else:
axis.set('xyz', pose_xyz(self.pose))
axis.set('use_parent_model_frame', str(self.use_parent_frame).lower())
limit = ET.Element('limit')
limit.set('lower', flt2str(deg2rad(self.lower_limit)))
limit.set('upper', flt2str(deg2rad(self.upper_limit)))
limit.set('effort', flt2str(self.effort_limit))
limit.set('velocity', flt2str(self.velocity_limit))
dynamics = ET.Element('dynamics')
dynamics.set('friction', flt2str(self.friction))
dynamics.set('damping', flt2str(self.damping))
return [axis, limit, dynamics]
return axis
class Joint(SpatialEntity):
'''A class representing a joint element'''
def __init__(self, **kwargs):
super(Joint, self).__init__(**kwargs)
self.parent = kwargs.get('parent', '')
self.child = kwargs.get('child', '')
self.type = kwargs.get('type', '')
self.axis = kwargs.get('axis', Axis())
self.parent_link = None
self.child_link = None
def to_xml(self, fmt='sdf'):
'''returns a joint xml element'''
super(Joint, self).to_xml(fmt)
if self.parent_link.parent_joint:
self.urdf_pose = subtract_poses(self.global_pose,
self.parent_link.parent_joint.global_pose)
else:
self.urdf_pose = subtract_poses(self.global_pose, self.parent_link.global_pose)
joint = ET.Element('joint', {'name': self.name, 'type': self.type})
pose = self.pose if fmt=='sdf' else self.urdf_pose
joint.append(pose_to_xml(pose, fmt=fmt))
parent = ET.SubElement(joint, 'parent')
child = ET.SubElement(joint, 'child')
if fmt == 'sdf':
parent.text = self.parent
child.text = self.child
joint.append(self.axis.to_xml(fmt=fmt))
else:
parent.set('link', self.parent)
child.set('link', self.child)
joint.extend(self.axis.to_xml(fmt=fmt))
return joint

View file

@ -1,168 +0,0 @@
import FreeCAD
import Part
import PySide
from FreeCAD import Base, Placement
from time import sleep
# MACRO 1:
# Select part and run it to insert gripper pose (red)
# Select gripper body and run it to insert second pose (pre-gripper, blue)
# Select pre-gripper body and run it to insert 3D printer table (green)
# Current gripper
# https://gitlab.com/robosphere/robossembler-ros2/-/blob/71938716043c35689a1058b29cefb1997a8bcf0a/rasmt_support/meshes/collision/Grip_Body.STL
# https://gitlab.com/robosphere/robossembler-ros2/-/blob/71938716043c35689a1058b29cefb1997a8bcf0a/rasmt_support/meshes/collision/Grip_L.STL
# https://gitlab.com/robosphere/robossembler-ros2/-/blob/71938716043c35689a1058b29cefb1997a8bcf0a/rasmt_support/meshes/collision/Grip_R.STL
# https://gitlab.com/robosphere/robossembler-ros2/-/blob/71938716043c35689a1058b29cefb1997a8bcf0a/rasmt_support/urdf/tools/rasmt_hand_macro.xacro
def insert():
if len(FreeCAD.Gui.Selection.getSelection())>0:
active_body = FreeCAD.Gui.Selection.getSelection()[0]
if "IsMainPosition" in active_body.PropertiesList:
if active_body.IsMainPosition == False:
p = controlled_insert("P")
p.addProperty("App::PropertyLink", "PartToPrint", "Parameter", "Part to be printed on this table")
p.ViewObject.ShapeColor=(0.0,1.0,0.0,0.0)
p.PartToPrint = active_body.PartToHandle
p.ViewObject.Transparency = 90
p.Placement = active_body.PartToHandle.getGlobalPlacement()
p.Label = '3D_printer_table_for_'+p.PartToPrint.Name
else:
b = grip_helper((0.0,0.0,1.0,0.0))
b.addProperty("App::PropertyLink", "MainPosition", "Parameter", "Main position")
b.PartToHandle = active_body.PartToHandle
b.MainPosition = active_body
b.IsMainPosition = False
b.GripSize = b.MainPosition.GripSize
b.Container.Placement = b.MainPosition.Container.Placement
b.Container.Label = 'PreGripper_for_'+b.PartToHandle.Name
tempshape = Part.getShape(b.PartToHandle,'',needSubElement=False,refine=False)
FreeCAD.ActiveDocument.addObject('Part::Feature','PartToHandle').Shape = tempshape
n = FreeCAD.ActiveDocument.ActiveObject
n.Label = b.PartToHandle.Label
n.ViewObject.ShapeColor = (0.0,0.0,1.0,0.0)
n.adjustRelativeLinks(b.Container)
b.Container.addObject(n)
n.Placement.Base = n.getGlobalPlacement().Base.sub(b.Container.Placement)
n.Placement.Rotation.Axis = n.getGlobalPlacement().Rotation.Axis.sub(b.Container.Placement.Rotation.Axis)
n.Placement.Rotation.Angle = n.getGlobalPlacement().Rotation.Angle-b.Container.Placement.Rotation.Angle
n.ViewObject.ShowInTree = False
n.ViewObject.Transparency = 90
else:
b = grip_helper((1.0,0.0,0.0,0.0))
b.addProperty("App::PropertyInteger", "OperationPriority", "Parameter", "Priority of the operation")
b.addProperty("App::PropertyInteger", "OperationType", "Parameter", "Priority of the operation")
b.addProperty("App::PropertyFloat", "OperationParameter1", "Parameter", "Priority of the operation")
b.addProperty("App::PropertyFloat", "OperationParameter2", "Parameter", "Priority of the operation")
b.addProperty("App::PropertyFloat", "OperationParameter3", "Parameter", "Priority of the operation")
b.PartToHandle = active_body
b.IsMainPosition = True
b.GripSize = active_body.Shape.BoundBox.YLength
b.Container.Placement = active_body.getGlobalPlacement()
b.Container.Label = 'Gripper_for_'+b.PartToHandle.Name
def controlled_insert(code):
a = FreeCAD.ActiveDocument.Objects
Part.insert(u"~/.local/share/FreeCAD/Mod/Frames/"+code+".brep",FreeCAD.ActiveDocument.Name)
b = FreeCAD.ActiveDocument.Objects
return list(set(b) - set(a))[0]
def grip_helper(color):
b = controlled_insert("B")
r = controlled_insert("R")
l = controlled_insert("L")
b.addProperty("App::PropertyFloat", "GripSize", "Parameter", "Size between fingers")
b.addProperty("App::PropertyLink", "Container", "Parameter", "Part Container")
b.addProperty("App::PropertyBool", "IsMainPosition", "Parameter", "Is it main or supportive position")
b.addProperty("App::PropertyLink", "PartToHandle", "Parameter", "Part to be manipulated by this gripper")
r.setExpression('.Placement.Base.y', b.Name+'.GripSize / 2')
l.setExpression('.Placement.Base.y', '-'+b.Name+'.GripSize / 2')
b.ViewObject.ShapeColor = color
r.ViewObject.ShapeColor = color
l.ViewObject.ShapeColor = color
NewPart = FreeCAD.activeDocument().addObject('App::Part','Part')
b.adjustRelativeLinks(NewPart)
NewPart.addObject(b)
r.adjustRelativeLinks(NewPart)
NewPart.addObject(r)
l.adjustRelativeLinks(NewPart)
NewPart.addObject(l)
r.ViewObject.ShowInTree = False
l.ViewObject.ShowInTree = False
b.Container = NewPart
b.ViewObject.Transparency = 90
r.ViewObject.Transparency = 90
l.ViewObject.Transparency = 90
return b
# MACRO 3:
# Select pre-gripper body and run it to animate its movement
def select_pregripper():
apart = FreeCAD.Gui.Selection.getSelection()[0]
sp = apart.Container.Placement.Base
ep = apart.MainPosition.Container.Placement.Base
sa = apart.Container.Placement.Rotation.Angle
ea = apart.MainPosition.Container.Placement.Rotation.Angle
print (sp,ep)
i = 0.0
def updatePlacement():
global timer
global i
global sp
global ep
global sa
global ea
apart.Container.Placement.Base = ep.multiply(i).add(sp.multiply(1.0-i))
apart.Container.Placement.Rotation.Angle = (ea*i)+(sa*(1.0-i))
i += 0.02
if i>=1:
#apart.Container.Placement.Base=sp
#apart.Container.Placement.Rotation.Angle=sa
timer.stop()
FreeCAD.Gui.updateGui()
timer = PySide.QtCore.QTimer()
timer.timeout.connect(updatePlacement)
timer.start(100)
# MACRO 4:
#Raw advanced version of MACRO 1
#Does not work properly yet
def insert_advanced():
if len(FreeCAD.Gui.Selection.getSelection())>0:
active_body = FreeCAD.Gui.Selection.getSelection()[0]
b = controlled_insert("B")
r = controlled_insert("R")
l = controlled_insert("L")
b.ViewObject.ShapeColor = (1.0,0.0,0.0,0.0)
r.ViewObject.ShapeColor = (1.0,0.0,0.0,0.0)
l.ViewObject.ShapeColor = (1.0,0.0,0.0,0.0)
b.ViewObject.ShowInTree = False
r.ViewObject.ShowInTree = False
l.ViewObject.ShowInTree = False
b.ViewObject.Transparency = 90
r.ViewObject.Transparency = 90
l.ViewObject.Transparency = 90
a = FreeCAD.ActiveDocument.addObject("App::FeaturePython",'Gripper_for_'+active_body.Name)
a.addProperty("App::PropertyFloat", "GripSize", "Parameter", "Size between fingers")
a.addProperty("App::PropertyLink", "PartToHandle", "Parameter", "Part to be manipulated by this gripper")
a.addProperty("App::PropertyLink", "GripperBody", "Parameter", "Body")
a.addProperty("App::PropertyLink", "GripperLF", "Parameter", "Body")
a.addProperty("App::PropertyLink", "GripperRF", "Parameter", "Body")
a.GripperBody = b
a.GripperLF = l
a.GripperRF = r
#r.setExpression('.Placement.Base.y', a.Name+'.GripSize / 2')
#l.setExpression('.Placement.Base.y', '-'+a.Name+'.GripSize / 2')
a.addProperty("App::PropertyInteger", "OperationPriority", "Parameter", "Priority of the operation")
a.addProperty("App::PropertyInteger", "OperationType", "Parameter", "Priority of the operation")
a.addProperty("App::PropertyFloat", "OperationParameter1", "Parameter", "Priority of the operation")
a.addProperty("App::PropertyFloat", "OperationParameter2", "Parameter", "Priority of the operation")
a.addProperty("App::PropertyFloat", "OperationParameter3", "Parameter", "Priority of the operation")
a.PartToHandle = active_body
a.GripSize = active_body.Shape.BoundBox.YLength

View file

@ -1,287 +0,0 @@
import FreeCAD
import Part
doc = FreeCAD.ActiveDocument
def check_capture_positions():
# Получаем активный документ
doc = FreeCAD.ActiveDocument
# Список тел без позиций захвата
bodies_without_capture_positions = []
# Перебираем все объекты в документе
for obj in doc.Objects:
if obj.isDerivedFrom("Part::Feature"):
# Проверяем, есть ли атрибут "Placement" у объекта
if not hasattr(obj, "Placement"):
# Если нет, добавляем его в список
bodies_without_capture_positions.append(obj.Label)
# Проверяем результат
if len(bodies_without_capture_positions) > 0:
print("Следующие тела не имеют позиции захвата:")
for body in bodies_without_capture_positions:
print(body)
else:
print("Все тела имеют позиции захвата.")
check_capture_positions()
import FreeCAD as App
doc = App.ActiveDocument
def check_capture_positions():
bodies_without_grip_pose = []
solid_bodies_list = []
lcs_list = []
bodies_with_grip_pose = []
for obj in doc.Objects:
if hasattr(obj, 'Shape') and hasattr(obj.Shape, 'Volume') and obj.Shape.Volume:
# if obj.Shape and obj.Shape.Volume:
solid_bodies_list.append(obj)
print(solid_bodies_list)
for obj in doc.Objects:
if obj.TypeId =='PartDesign::CoordinateSystem':
lcs_list.append(obj)
print(lcs_list)
for body in solid_bodies_list:
checker = 0
for lcs in lcs_list:
print(checker)
if lcs.Attachment_ParentObject == body.Label:
checker =+1
if checker == 0:
bodies_without_grip_pose.append(body)
print(bodies_without_grip_pose)
if len(bodies_without_grip_pose) == 0:
print('Все тела имеют позиции захвата')
else:
print('Имеются тела без позиций захвата:')
for body in bodies_without_grip_pose:
print(body.Label)
check_capture_positions()
def create_grip_positions(obj, face1, face2):
if not (face1 and face2):
App.Console.PrintError("Не выбраны обе грани\n")
return
normal1 = face1.normalAt(0, 0)
normal2 = face2.normalAt(0, 0)
if normal1.isParallel(normal2):
# Найдите центры граней
center1 = face1.CenterOfMass
center2 = face2.CenterOfMass
# Вычислите расстояние между центрами граней
distance = center2 - center1
distance = distance.Length
# Создайте вспомогательную систему координат между гранями
coordinate_system = App.ActiveDocument.addObject("Part::CoordinateSystem", "CoordinateSystem")
coordinate_system.Placement.Base = center1 + 0.5 * distance * normal1
coordinate_system.Placement.Rotation = normal1.getRotationTo(App.Vector(0, 0, 1))
# Выведите информацию о расстоянии
App.Console.PrintMessage(f"Расстояние межу гранью 1 и гранью 2: {distance} мм\n")
# Обновите графический интерфейс FreeCAD
App.ActiveDocument.recompute()
else:
App.Console.PrintError("Выбранные грани не являются параллельными\n")
create_grip_positions()
# Добавление обзервера для касаний
v=Gui.activeDocument().activeView()
#This class logs any mouse button events. As the registered callback function fires twice for 'down' and
#'up' events we need a boolean flag to handle this.
class ViewObserver:
def __init__(self, view):
self.view = view
def logPosition(self, info):
down = (info["State"] == "DOWN")
pos = info["Position"]
if (down):
FreeCAD.Console.PrintMessage("Clicked on position: ("+str(pos[0])+", "+str(pos[1])+")\n")
pnt = self.view.getPoint(pos)
FreeCAD.Console.PrintMessage("World coordinates: " + str(pnt) + "\n")
info = self.view.getObjectInfo(pos)
FreeCAD.Console.PrintMessage("Object info: " + str(info) + "\n")
o = ViewObserver(v)
c = v.addEventCallback("SoMouseButtonEvent",o.logPosition)
### getObjectInfo работает
import FreeCAD as App
import FreeCADGui as Gui
def getFaceInfo(face):
if face:
App.Console.PrintMessage(f"Информация о грани: {face}\n")
# Получите позицию (Base) и ориентацию (Rotation) грани в глобальных координатах
placement = face.Placement
position = App.Vector(placement.Base)
orientation = App.Rotation(placement.Rotation)
App.Console.PrintMessage(f"Позиция грани: {position}\n")
App.Console.PrintMessage(f"Ориентация грани: {orientation}\n")
def getObjectInfo():
selection = Gui.Selection.getSelectionEx()
if selection:
selected_object = selection[0].Object
if selected_object:
subelement_name = selection[0].SubElementNames[0]
if "Face" in subelement_name:
face = selected_object.Shape.Faces[int(subelement_name.split("Face")[1])]
getFaceInfo(face)
else:
App.Console.PrintError("Выберите грань, а не тело или другой элемент\n")
else:
App.Console.PrintError("Объект не найден\n")
else:
App.Console.PrintError("Не выбраны объекты\n")
getObjectInfo()
import FreeCAD as App
import FreeCADGui as Gui
import Part
# Функция для получения списка всех объектов с заданным свойством
def get_objects_with_property(property_name, property_value):
result = []
for obj in FreeCAD.ActiveDocument.Objects:
if hasattr(obj, "PropertiesList") and property_name in obj.PropertiesList:
if obj.getPropertyByName(property_name) == property_value:
result.append(obj)
return result
# Получение списка всех объектов с названием тела в свойстве
bodies = get_objects_with_property("BodyName", "Body")
# Получение списка всех объектов
all_objects = FreeCAD.ActiveDocument.Objects
# Поиск и вывод тел, у которых нет связанных вспомогательных объектов
for body in bodies:
linked_objects = []
for obj in all_objects:
if obj.hasLinkOf(body):
linked_objects.append(obj.Name)
if not linked_objects:
print(f"Тело без связанных объектов: {body.Name}")
def create_coordinate_system(surface1, surface2):
if surface1 is None or surface2 is None:
App.Console.PrintError("Не удалось найти одну из поверхностей\n")
return
# Проверка, являются ли поверхности плоскими
if surface1.Shape.Faces[0].Surface.TypeId == "Part::Plane" and surface2.Shape.Faces[0].Surface.TypeId == "Part::Plane":
# Проверка, являются ли поверхности параллельными
normal1 = surface1.Shape.normalAt(0, 0)
normal2 = surface2.Shape.normalAt(0, 0)
if normal1.isParallel(normal2):
# центры поверхностей
center1 = surface1.Shape.BoundBox.Center
center2 = surface2.Shape.BoundBox.Center
# Вычисление расстояние между центрами поверхностей
distance = center2 - center1
distance = distance.Length
# Создание вспомогательную систему координат между поверхностями
coordinate_system = App.ActiveDocument.addObject("Part::CoordinateSystem", "CoordinateSystem")
coordinate_system.Placement.Base = center1 + 0.5 * distance * normal1
coordinate_system.Placement.Rotation = normal1.getRotationTo(App.Vector(0, 0, 1))
# Выведите информацию о расстоянии
App.Console.PrintMessage(f"Расстояние между поверхностью 1 и поверхностью 2: {distance} мм\n")
# Обновите графический интерфейс FreeCAD
App.ActiveDocument.recompute()
else:
App.Console.PrintError("Выбранные поверхности не являются параллельными\n")
else:
App.Console.PrintError("Выбранные поверхности не являются плоскими\n")
# Создайте пользовательский интерфейс кнопки для вызова функции
class CoordinateSystemTool:
def Activated(self):
selection = Gui.Selection.getSelectionEx()
if len(selection) == 2:
create_coordinate_system(selection[0].Object, selection[1].Object)
else:
App.Console.PrintError("Выберите две параллельные плоскости\n")
def GetResources(self):
return {
'Pixmap': 'path/to/your/icon.png', # Замените на путь к значку кнопки
'MenuText': 'Создать вспомогательную систему координат',
'ToolTip': 'Создать вспомогательную систему координат между двумя плоскостями'
}
# Зарегистрируйте пользовательский инструмент
Gui.addCommand('My_Coordinate_System_Tool', CoordinateSystemTool())
#### эта штука работает vvv
# Функция для создания вспомогательного объекта и установки свойства "AttachmentType"
def create_helper_object_with_attribute(body, attribute_value):
helper_object = FreeCAD.ActiveDocument.addObject("App::FeaturePython", "HelperObject")
helper_object.addProperty("App::PropertyString", "AttachmentType").AttachmentType = attribute_value
helper_object.addProperty("App::PropertyString", "AttachedObject")
helper_object.AttachedObject = body.Label
# Пример использования:
# Замените "MyBody" на имя тела, к которому вы хотите привязать вспомогательный объект
body_to_attach = FreeCAD.ActiveDocument.getObjectsByLabel("gear_frame_221213")[0]
if body_to_attach:
create_helper_object_with_attribute(body_to_attach, "Body")
else:
print("Тело не найдено в активном документе.")

View file

@ -1,504 +0,0 @@
GNU LESSER GENERAL PUBLIC LICENSE
Version 2.1, February 1999
Copyright (C) 1991, 1999 Free Software Foundation, Inc.
51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
Everyone is permitted to copy and distribute verbatim copies
of this license document, but changing it is not allowed.
[This is the first released version of the Lesser GPL. It also counts
as the successor of the GNU Library Public License, version 2, hence
the version number 2.1.]
Preamble
The licenses for most software are designed to take away your
freedom to share and change it. By contrast, the GNU General Public
Licenses are intended to guarantee your freedom to share and change
free software--to make sure the software is free for all its users.
This license, the Lesser General Public License, applies to some
specially designated software packages--typically libraries--of the
Free Software Foundation and other authors who decide to use it. You
can use it too, but we suggest you first think carefully about whether
this license or the ordinary General Public License is the better
strategy to use in any particular case, based on the explanations below.
When we speak of free software, we are referring to freedom of use,
not price. Our General Public Licenses are designed to make sure that
you have the freedom to distribute copies of free software (and charge
for this service if you wish); that you receive source code or can get
it if you want it; that you can change the software and use pieces of
it in new free programs; and that you are informed that you can do
these things.
To protect your rights, we need to make restrictions that forbid
distributors to deny you these rights or to ask you to surrender these
rights. These restrictions translate to certain responsibilities for
you if you distribute copies of the library or if you modify it.
For example, if you distribute copies of the library, whether gratis
or for a fee, you must give the recipients all the rights that we gave
you. You must make sure that they, too, receive or can get the source
code. If you link other code with the library, you must provide
complete object files to the recipients, so that they can relink them
with the library after making changes to the library and recompiling
it. And you must show them these terms so they know their rights.
We protect your rights with a two-step method: (1) we copyright the
library, and (2) we offer you this license, which gives you legal
permission to copy, distribute and/or modify the library.
To protect each distributor, we want to make it very clear that
there is no warranty for the free library. Also, if the library is
modified by someone else and passed on, the recipients should know
that what they have is not the original version, so that the original
author's reputation will not be affected by problems that might be
introduced by others.
Finally, software patents pose a constant threat to the existence of
any free program. We wish to make sure that a company cannot
effectively restrict the users of a free program by obtaining a
restrictive license from a patent holder. Therefore, we insist that
any patent license obtained for a version of the library must be
consistent with the full freedom of use specified in this license.
Most GNU software, including some libraries, is covered by the
ordinary GNU General Public License. This license, the GNU Lesser
General Public License, applies to certain designated libraries, and
is quite different from the ordinary General Public License. We use
this license for certain libraries in order to permit linking those
libraries into non-free programs.
When a program is linked with a library, whether statically or using
a shared library, the combination of the two is legally speaking a
combined work, a derivative of the original library. The ordinary
General Public License therefore permits such linking only if the
entire combination fits its criteria of freedom. The Lesser General
Public License permits more lax criteria for linking other code with
the library.
We call this license the "Lesser" General Public License because it
does Less to protect the user's freedom than the ordinary General
Public License. It also provides other free software developers Less
of an advantage over competing non-free programs. These disadvantages
are the reason we use the ordinary General Public License for many
libraries. However, the Lesser license provides advantages in certain
special circumstances.
For example, on rare occasions, there may be a special need to
encourage the widest possible use of a certain library, so that it becomes
a de-facto standard. To achieve this, non-free programs must be
allowed to use the library. A more frequent case is that a free
library does the same job as widely used non-free libraries. In this
case, there is little to gain by limiting the free library to free
software only, so we use the Lesser General Public License.
In other cases, permission to use a particular library in non-free
programs enables a greater number of people to use a large body of
free software. For example, permission to use the GNU C Library in
non-free programs enables many more people to use the whole GNU
operating system, as well as its variant, the GNU/Linux operating
system.
Although the Lesser General Public License is Less protective of the
users' freedom, it does ensure that the user of a program that is
linked with the Library has the freedom and the wherewithal to run
that program using a modified version of the Library.
The precise terms and conditions for copying, distribution and
modification follow. Pay close attention to the difference between a
"work based on the library" and a "work that uses the library". The
former contains code derived from the library, whereas the latter must
be combined with the library in order to run.
GNU LESSER GENERAL PUBLIC LICENSE
TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION
0. This License Agreement applies to any software library or other
program which contains a notice placed by the copyright holder or
other authorized party saying it may be distributed under the terms of
this Lesser General Public License (also called "this License").
Each licensee is addressed as "you".
A "library" means a collection of software functions and/or data
prepared so as to be conveniently linked with application programs
(which use some of those functions and data) to form executables.
The "Library", below, refers to any such software library or work
which has been distributed under these terms. A "work based on the
Library" means either the Library or any derivative work under
copyright law: that is to say, a work containing the Library or a
portion of it, either verbatim or with modifications and/or translated
straightforwardly into another language. (Hereinafter, translation is
included without limitation in the term "modification".)
"Source code" for a work means the preferred form of the work for
making modifications to it. For a library, complete source code means
all the source code for all modules it contains, plus any associated
interface definition files, plus the scripts used to control compilation
and installation of the library.
Activities other than copying, distribution and modification are not
covered by this License; they are outside its scope. The act of
running a program using the Library is not restricted, and output from
such a program is covered only if its contents constitute a work based
on the Library (independent of the use of the Library in a tool for
writing it). Whether that is true depends on what the Library does
and what the program that uses the Library does.
1. You may copy and distribute verbatim copies of the Library's
complete source code as you receive it, in any medium, provided that
you conspicuously and appropriately publish on each copy an
appropriate copyright notice and disclaimer of warranty; keep intact
all the notices that refer to this License and to the absence of any
warranty; and distribute a copy of this License along with the
Library.
You may charge a fee for the physical act of transferring a copy,
and you may at your option offer warranty protection in exchange for a
fee.
2. You may modify your copy or copies of the Library or any portion
of it, thus forming a work based on the Library, and copy and
distribute such modifications or work under the terms of Section 1
above, provided that you also meet all of these conditions:
a) The modified work must itself be a software library.
b) You must cause the files modified to carry prominent notices
stating that you changed the files and the date of any change.
c) You must cause the whole of the work to be licensed at no
charge to all third parties under the terms of this License.
d) If a facility in the modified Library refers to a function or a
table of data to be supplied by an application program that uses
the facility, other than as an argument passed when the facility
is invoked, then you must make a good faith effort to ensure that,
in the event an application does not supply such function or
table, the facility still operates, and performs whatever part of
its purpose remains meaningful.
(For example, a function in a library to compute square roots has
a purpose that is entirely well-defined independent of the
application. Therefore, Subsection 2d requires that any
application-supplied function or table used by this function must
be optional: if the application does not supply it, the square
root function must still compute square roots.)
These requirements apply to the modified work as a whole. If
identifiable sections of that work are not derived from the Library,
and can be reasonably considered independent and separate works in
themselves, then this License, and its terms, do not apply to those
sections when you distribute them as separate works. But when you
distribute the same sections as part of a whole which is a work based
on the Library, the distribution of the whole must be on the terms of
this License, whose permissions for other licensees extend to the
entire whole, and thus to each and every part regardless of who wrote
it.
Thus, it is not the intent of this section to claim rights or contest
your rights to work written entirely by you; rather, the intent is to
exercise the right to control the distribution of derivative or
collective works based on the Library.
In addition, mere aggregation of another work not based on the Library
with the Library (or with a work based on the Library) on a volume of
a storage or distribution medium does not bring the other work under
the scope of this License.
3. You may opt to apply the terms of the ordinary GNU General Public
License instead of this License to a given copy of the Library. To do
this, you must alter all the notices that refer to this License, so
that they refer to the ordinary GNU General Public License, version 2,
instead of to this License. (If a newer version than version 2 of the
ordinary GNU General Public License has appeared, then you can specify
that version instead if you wish.) Do not make any other change in
these notices.
Once this change is made in a given copy, it is irreversible for
that copy, so the ordinary GNU General Public License applies to all
subsequent copies and derivative works made from that copy.
This option is useful when you wish to copy part of the code of
the Library into a program that is not a library.
4. You may copy and distribute the Library (or a portion or
derivative of it, under Section 2) in object code or executable form
under the terms of Sections 1 and 2 above provided that you accompany
it with the complete corresponding machine-readable source code, which
must be distributed under the terms of Sections 1 and 2 above on a
medium customarily used for software interchange.
If distribution of object code is made by offering access to copy
from a designated place, then offering equivalent access to copy the
source code from the same place satisfies the requirement to
distribute the source code, even though third parties are not
compelled to copy the source along with the object code.
5. A program that contains no derivative of any portion of the
Library, but is designed to work with the Library by being compiled or
linked with it, is called a "work that uses the Library". Such a
work, in isolation, is not a derivative work of the Library, and
therefore falls outside the scope of this License.
However, linking a "work that uses the Library" with the Library
creates an executable that is a derivative of the Library (because it
contains portions of the Library), rather than a "work that uses the
library". The executable is therefore covered by this License.
Section 6 states terms for distribution of such executables.
When a "work that uses the Library" uses material from a header file
that is part of the Library, the object code for the work may be a
derivative work of the Library even though the source code is not.
Whether this is true is especially significant if the work can be
linked without the Library, or if the work is itself a library. The
threshold for this to be true is not precisely defined by law.
If such an object file uses only numerical parameters, data
structure layouts and accessors, and small macros and small inline
functions (ten lines or less in length), then the use of the object
file is unrestricted, regardless of whether it is legally a derivative
work. (Executables containing this object code plus portions of the
Library will still fall under Section 6.)
Otherwise, if the work is a derivative of the Library, you may
distribute the object code for the work under the terms of Section 6.
Any executables containing that work also fall under Section 6,
whether or not they are linked directly with the Library itself.
6. As an exception to the Sections above, you may also combine or
link a "work that uses the Library" with the Library to produce a
work containing portions of the Library, and distribute that work
under terms of your choice, provided that the terms permit
modification of the work for the customer's own use and reverse
engineering for debugging such modifications.
You must give prominent notice with each copy of the work that the
Library is used in it and that the Library and its use are covered by
this License. You must supply a copy of this License. If the work
during execution displays copyright notices, you must include the
copyright notice for the Library among them, as well as a reference
directing the user to the copy of this License. Also, you must do one
of these things:
a) Accompany the work with the complete corresponding
machine-readable source code for the Library including whatever
changes were used in the work (which must be distributed under
Sections 1 and 2 above); and, if the work is an executable linked
with the Library, with the complete machine-readable "work that
uses the Library", as object code and/or source code, so that the
user can modify the Library and then relink to produce a modified
executable containing the modified Library. (It is understood
that the user who changes the contents of definitions files in the
Library will not necessarily be able to recompile the application
to use the modified definitions.)
b) Use a suitable shared library mechanism for linking with the
Library. A suitable mechanism is one that (1) uses at run time a
copy of the library already present on the user's computer system,
rather than copying library functions into the executable, and (2)
will operate properly with a modified version of the library, if
the user installs one, as long as the modified version is
interface-compatible with the version that the work was made with.
c) Accompany the work with a written offer, valid for at
least three years, to give the same user the materials
specified in Subsection 6a, above, for a charge no more
than the cost of performing this distribution.
d) If distribution of the work is made by offering access to copy
from a designated place, offer equivalent access to copy the above
specified materials from the same place.
e) Verify that the user has already received a copy of these
materials or that you have already sent this user a copy.
For an executable, the required form of the "work that uses the
Library" must include any data and utility programs needed for
reproducing the executable from it. However, as a special exception,
the materials to be distributed need not include anything that is
normally distributed (in either source or binary form) with the major
components (compiler, kernel, and so on) of the operating system on
which the executable runs, unless that component itself accompanies
the executable.
It may happen that this requirement contradicts the license
restrictions of other proprietary libraries that do not normally
accompany the operating system. Such a contradiction means you cannot
use both them and the Library together in an executable that you
distribute.
7. You may place library facilities that are a work based on the
Library side-by-side in a single library together with other library
facilities not covered by this License, and distribute such a combined
library, provided that the separate distribution of the work based on
the Library and of the other library facilities is otherwise
permitted, and provided that you do these two things:
a) Accompany the combined library with a copy of the same work
based on the Library, uncombined with any other library
facilities. This must be distributed under the terms of the
Sections above.
b) Give prominent notice with the combined library of the fact
that part of it is a work based on the Library, and explaining
where to find the accompanying uncombined form of the same work.
8. You may not copy, modify, sublicense, link with, or distribute
the Library except as expressly provided under this License. Any
attempt otherwise to copy, modify, sublicense, link with, or
distribute the Library is void, and will automatically terminate your
rights under this License. However, parties who have received copies,
or rights, from you under this License will not have their licenses
terminated so long as such parties remain in full compliance.
9. You are not required to accept this License, since you have not
signed it. However, nothing else grants you permission to modify or
distribute the Library or its derivative works. These actions are
prohibited by law if you do not accept this License. Therefore, by
modifying or distributing the Library (or any work based on the
Library), you indicate your acceptance of this License to do so, and
all its terms and conditions for copying, distributing or modifying
the Library or works based on it.
10. Each time you redistribute the Library (or any work based on the
Library), the recipient automatically receives a license from the
original licensor to copy, distribute, link with or modify the Library
subject to these terms and conditions. You may not impose any further
restrictions on the recipients' exercise of the rights granted herein.
You are not responsible for enforcing compliance by third parties with
this License.
11. If, as a consequence of a court judgment or allegation of patent
infringement or for any other reason (not limited to patent issues),
conditions are imposed on you (whether by court order, agreement or
otherwise) that contradict the conditions of this License, they do not
excuse you from the conditions of this License. If you cannot
distribute so as to satisfy simultaneously your obligations under this
License and any other pertinent obligations, then as a consequence you
may not distribute the Library at all. For example, if a patent
license would not permit royalty-free redistribution of the Library by
all those who receive copies directly or indirectly through you, then
the only way you could satisfy both it and this License would be to
refrain entirely from distribution of the Library.
If any portion of this section is held invalid or unenforceable under any
particular circumstance, the balance of the section is intended to apply,
and the section as a whole is intended to apply in other circumstances.
It is not the purpose of this section to induce you to infringe any
patents or other property right claims or to contest validity of any
such claims; this section has the sole purpose of protecting the
integrity of the free software distribution system which is
implemented by public license practices. Many people have made
generous contributions to the wide range of software distributed
through that system in reliance on consistent application of that
system; it is up to the author/donor to decide if he or she is willing
to distribute software through any other system and a licensee cannot
impose that choice.
This section is intended to make thoroughly clear what is believed to
be a consequence of the rest of this License.
12. If the distribution and/or use of the Library is restricted in
certain countries either by patents or by copyrighted interfaces, the
original copyright holder who places the Library under this License may add
an explicit geographical distribution limitation excluding those countries,
so that distribution is permitted only in or among countries not thus
excluded. In such case, this License incorporates the limitation as if
written in the body of this License.
13. The Free Software Foundation may publish revised and/or new
versions of the Lesser General Public License from time to time.
Such new versions will be similar in spirit to the present version,
but may differ in detail to address new problems or concerns.
Each version is given a distinguishing version number. If the Library
specifies a version number of this License which applies to it and
"any later version", you have the option of following the terms and
conditions either of that version or of any later version published by
the Free Software Foundation. If the Library does not specify a
license version number, you may choose any version ever published by
the Free Software Foundation.
14. If you wish to incorporate parts of the Library into other free
programs whose distribution conditions are incompatible with these,
write to the author to ask for permission. For software which is
copyrighted by the Free Software Foundation, write to the Free
Software Foundation; we sometimes make exceptions for this. Our
decision will be guided by the two goals of preserving the free status
of all derivatives of our free software and of promoting the sharing
and reuse of software generally.
NO WARRANTY
15. BECAUSE THE LIBRARY IS LICENSED FREE OF CHARGE, THERE IS NO
WARRANTY FOR THE LIBRARY, TO THE EXTENT PERMITTED BY APPLICABLE LAW.
EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR
OTHER PARTIES PROVIDE THE LIBRARY "AS IS" WITHOUT WARRANTY OF ANY
KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE
IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE
LIBRARY IS WITH YOU. SHOULD THE LIBRARY PROVE DEFECTIVE, YOU ASSUME
THE COST OF ALL NECESSARY SERVICING, REPAIR OR CORRECTION.
16. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN
WRITING WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY
AND/OR REDISTRIBUTE THE LIBRARY AS PERMITTED ABOVE, BE LIABLE TO YOU
FOR DAMAGES, INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR
CONSEQUENTIAL DAMAGES ARISING OUT OF THE USE OR INABILITY TO USE THE
LIBRARY (INCLUDING BUT NOT LIMITED TO LOSS OF DATA OR DATA BEING
RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD PARTIES OR A
FAILURE OF THE LIBRARY TO OPERATE WITH ANY OTHER SOFTWARE), EVEN IF
SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH
DAMAGES.
END OF TERMS AND CONDITIONS
How to Apply These Terms to Your New Libraries
If you develop a new library, and you want it to be of the greatest
possible use to the public, we recommend making it free software that
everyone can redistribute and change. You can do so by permitting
redistribution under these terms (or, alternatively, under the terms of the
ordinary General Public License).
To apply these terms, attach the following notices to the library. It is
safest to attach them to the start of each source file to most effectively
convey the exclusion of warranty; and each file should have at least the
"copyright" line and a pointer to where the full notice is found.
<one line to give the library's name and a brief idea of what it does.>
Copyright (C) <year> <name of author>
This library is free software; you can redistribute it and/or
modify it under the terms of the GNU Lesser General Public
License as published by the Free Software Foundation; either
version 2.1 of the License, or (at your option) any later version.
This library is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
Lesser General Public License for more details.
You should have received a copy of the GNU Lesser General Public
License along with this library; if not, write to the Free Software
Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301
USA
Also add information on how to contact you by electronic and paper mail.
You should also get your employer (if you work as a programmer) or your
school, if any, to sign a "copyright disclaimer" for the library, if
necessary. Here is a sample; alter the names:
Yoyodyne, Inc., hereby disclaims all copyright interest in the
library `Frob' (a library for tweaking knobs) written by James Random
Hacker.
<signature of Ty Coon>, 1 April 1990
Ty Coon, President of Vice
That's all there is to it!

View file

@ -1,665 +0,0 @@
import FreeCAD
import Part
import json
import os
import time
from .GazeboExport import export_collada, export_sdf, config
from .GraspPose import insert
from . import ICONPATH, UIPATH
# from .scenarios.robossembler_freecad_export_scenario import RobossemblerFreeCadExportScenario
if FreeCAD.GuiUp:
import FreeCADGui
from PySide import QtGui
###################################################################
# Module functions
###################################################################
def vector2list(vec, scale=1e-3):
"""Gives the vector as a list, set scale for scaling factor.
default scale = 1e-3 for units in m."""
return [vec.x*scale, vec.y*scale, vec.z*scale]
def matrix2list(mat, scale=1e-3):
"""Gives the transformation matrix as a list, set scale 1 to get in mm."""
return [[mat.A11, mat.A12, mat.A13, mat.A14*scale],
[mat.A21, mat.A22, mat.A23, mat.A24*scale],
[mat.A31, mat.A32, mat.A33, mat.A34*scale],
[mat.A41, mat.A42, mat.A43, mat.A44]]
def placement2pose(pl, scale=1e-3):
"""Gives the placement as an dictionary for geometry_msgs/Pose type."""
return {"position": {
"x": pl.Base.x*scale,
"y": pl.Base.y*scale,
"z": pl.Base.z*scale
},
"orientation": {
"x": pl.Rotation.Q[0],
"y": pl.Rotation.Q[1],
"z": pl.Rotation.Q[2],
"w": pl.Rotation.Q[3]
}
}
def placement2axisvec(pl, scale=1e-3):
"""Gives the placement as an dictionary of origin and rotation.
origin: [x,y,z], rotation:{axis:[ax,ay,az], angle:ang}"""
return {"origin": vector2list(pl.Base, scale),
"rotation": {"axis": vector2list(pl.Rotation.Axis, scale=1),
"angle": pl.Rotation.Angle}}
def boundingBox2list(bb, scale=1e-3):
"""Gives the bounding box as a list in m instead of mm"""
return [bb.XMin*scale, bb.XMax*scale,
bb.YMin*scale, bb.YMax*scale,
bb.ZMin*scale, bb.ZMax*scale]
def principalProperties2dict(pp, scale=1e-3):
npp = {}
for key, value in pp.items():
if type(value) is FreeCAD.Vector:
npp[key.lower()] = vector2list(value, scale=1e-3)
else:
npp[key.lower()] = value
return npp
def describeSubObject(subobj):
"""Returns PrimitiveType, ShapeType."""
if isinstance(subobj, Part.Vertex):
return "Vertex", "Vertex"
elif isinstance(subobj, Part.Edge):
if isinstance(subobj.Curve, Part.Arc):
return "Arc", "Edge"
elif isinstance(subobj.Curve, Part.ArcOfCircle):
return "ArcOfCircle", "Edge"
elif isinstance(subobj.Curve, Part.ArcOfEllipse):
return "ArcOfEllipse", "Edge"
elif isinstance(subobj.Curve, Part.ArcOfHyperbola):
return "ArcOfHyperbola", "Edge"
elif isinstance(subobj.Curve, Part.ArcOfParabola):
return "ArcOfParabola", "Edge"
elif isinstance(subobj.Curve, Part.BSplineCurve):
return "BSplineCurve", "Edge"
elif isinstance(subobj.Curve, Part.BezierCurve):
return "BezierCurve", "Edge"
elif isinstance(subobj.Curve, Part.Circle):
return "Circle", "Edge"
elif isinstance(subobj.Curve, Part.Ellipse):
return "Ellipse", "Edge"
elif isinstance(subobj.Curve, Part.Hyperbola):
return "Hyperbola", "Edge"
elif isinstance(subobj.Curve, Part.Line):
return "Line", "Edge"
elif isinstance(subobj.Curve, Part.Parabola):
return "Parabola", "Edge"
else:
FreeCAD.Console.PrintError("Unknown edge type")
elif isinstance(subobj, Part.Face):
if isinstance(subobj.Surface, Part.BSplineSurface):
return "BSplineSurface", "Face"
elif isinstance(subobj.Surface, Part.BezierSurface):
return "BezierSurface", "Face"
elif isinstance(subobj.Surface, Part.Cylinder):
return "Cylinder", "Face"
elif isinstance(subobj.Surface, Part.Plane):
return "Plane", "Face"
elif isinstance(subobj.Surface, Part.Sphere):
return "Sphere", "Face"
elif isinstance(subobj.Surface, Part.Toroid):
return "Toroid", "Face"
elif isinstance(subobj.Surface, Part.Cone):
return "Cone", "Face"
else:
FreeCAD.Console.PrintError("Unknown surface type")
# Better strategy desirable for the following:
elif isinstance(subobj, Part.Wire):
return "Wire", "Wire"
elif isinstance(subobj, Part.Shell):
return "Shell", "Shell"
elif isinstance(subobj, Part.Solid):
return "Solid", "Solid"
elif isinstance(subobj, Part.Compsolid):
return "Compsolid", "Compsolid"
elif isinstance(subobj, Part.Compound):
return "Compound", "Compound"
else:
FreeCAD.Console.PrintError("Unable to identify subobject.")
def closeToZero(a, tol=1e-10):
return abs(a) < tol
def spawnClassCommand(classname, function, resources):
"""
Commands, or buttons, are tedious to write. So this function spawns
one if the function to be executed takes no arguments.
Example usage:
spawnClassCommand("testcommand", testfunc,
{"Pixmap":"", "MenuText":"menutext","ToolTip":"tooltiptext"})
then add "testcommand" to commandlist in InitGui.py
"""
def Activated(s):
function()
def GetResources(s):
return resources
CommandClass = type("classname", (object,), {"Activated": Activated,
"GetResources": GetResources})
FreeCADGui.addCommand(classname, CommandClass())
def getLocalPartProps(obj):
old_placement = obj.Placement
obj_parent_label = ''
if obj.getParentGeoFeatureGroup():
obj_parent_label = obj.getParentGeoFeatureGroup().Label
# obj.Placement = FreeCAD.Placement()
""" Part properties """
partprops = {
"label": obj.Label,
"parent_label": obj_parent_label,
"placement": placement2pose(old_placement),
# "grip properties": { "grip open": obj.GripOpen, "grip depth": obj.GripDepth, "grip width": obj.GripWidth}
# "boundingbox": boundingBox2list(obj.Shape.BoundBox),
# "volume": obj.Shape.Volume*1e-9,
# "centerofmass": vector2list(obj.Shape.CenterOfMass),
# "principalproperties": principalProperties2dict(obj.Shape.PrincipalProperties)
}
if obj.Type == 'grip':
partprops["grip properties"] = { "grip open": obj.GripOpen, "grip depth": obj.GripDepth, "grip width": obj.GripWidth}
elif obj.Type == 'area':
partprops["area dim"] = { } #свойства, описывающие размер
elif obj.Type == 'vol':
partprops["vol dim"] = { } #свойства, описывающие размер области
# obj.Placement = old_placement
return partprops
# Longest match for mesh name
def longest_match(seq1, seq2):
from difflib import SequenceMatcher as SM
sm = SM(lambda c: c in set(' ,'), seq1, seq2)
m = sm.find_longest_match(0, len(seq1), 0, len(seq2))
return seq1[m.a:m.b]
###################################################################
# Export functions
###################################################################
def exportGazeboModels():
"""Export packages for Gazebo Simulator."""
doc = FreeCAD.activeDocument()
selected_objects = FreeCADGui.Selection.getSelection()
FreeCADGui.Selection.clearSelection()
if len(selected_objects) == 0:
FreeCAD.Console.PrintError("No part selected.")
return False
export_dir = QtGui.QFileDialog.getExistingDirectory(None, "Choose Export Directory",
os.path.split(doc.FileName)[0])
# Gather the unique shapes, and clone parts as
# dict = { partX : { obj1: <obj>, graspposes: {}, placements : {}, mesh: <mesh_uri> } }
unique_objs = []
parts = {}
num_objs = 0
for obj in doc.Objects:
new_shape = True
model_dir = os.path.join(export_dir, obj.Label)
mesh_dir = os.path.join(model_dir, 'meshes')
mesh_file = os.path.join(mesh_dir, obj.Label + '.dae')
mesh_uri = os.path.normpath(os.path.relpath(mesh_file, export_dir))
# Select only Parts, not Grasp Poses or Gripper
if obj.TypeId == "Part::Feature" and not "PartToHandle" in obj.PropertiesList and not "Container" in obj.PropertiesList:
num_objs += 1
for uobj in unique_objs:
if uobj.Shape.isPartner(obj.Shape):
new_shape = False
# parts[obj.Label]["mesh"] += parts[uobj.Label]["mesh"]
parts[obj.Label] = {"obj": obj,
"graspposes": {},
"mesh": parts[uobj.Label]["mesh"]
}
# if Shape is unique export mesh
if new_shape:
unique_objs.append(obj)
parts[obj.Label] = {"obj": obj, "graspposes": {}, "placements": {}, "mesh": mesh_file}
for obj in doc.Objects:
# Add grasp poses to parts dictionary
if "PartToHandle" in obj.PropertiesList:
graspposes = { obj.Container.Label: {
"placement": placement2pose(obj.Container.Placement),
"distance": obj.GripSize*1e-3
# "OperationType" : obj.OperationType
# "Operation Priority" : obj.OperationPriority
# obj.Operation Parameter 1 : obj.OperationParameter1
# obj.Operation Parameter 2 : obj.OperationParameter2
# obj.Operation Parameter 3 : obj.OperationParameter3
}
}
parts[obj.PartToHandle.Label].update({"graspposes" : graspposes})
# Add part placement position on Plane surface
import Frames
if hasattr(obj, 'Proxy') and "ShapeType" in obj.PropertiesList:
if isinstance(obj.Proxy, Frames.FeatureFrame) and obj.ShapeType == 'Face':
parts[obj.Part.Label].update({ "placements": { obj.Label: placement2pose(obj.Placement) } })
# Create SDF package from Parts or other packages
def create_package(name, objects, export_dir):
model_dir = os.path.join(export_dir, name)
mesh_dir = os.path.join(model_dir, 'meshes')
os.makedirs(mesh_dir, exist_ok=True)
GazeboExport.export_collada(objects, parts[name]["mesh"])
GazeboExport.export_sdf({ name: parts[name] }, export_dir, obj.Label)
with open(os.path.join(model_dir, 'model.config'), 'w') as config_file:
config_file.write(GazeboExport.config(name,
'model.sdf', 'Author', 'Email', 'Comment', 'Version'))
'''
with open(os.path.join(model_dir, 'frames.json'), 'w') as frames_file:
json.dump({"label": name,
"placement": placement2pose(parts[name]["obj"].Placement),
"features":
{ "graspposes" : parts[name]["graspposes"]
, "placements" : parts[name]["placements"]}},
frames_file, indent=1, separators=(',', ': '))
'''
# Export assets for parts
for obj in selected_objects:
create_package(obj.Label, [obj], export_dir)
exportPartInfo(obj, os.path.join(export_dir, obj.Label, 'frames.json') )
appendFeatureFrames(obj, os.path.join(export_dir, obj.Label, 'frames.json'))
# Export asset for subassembly
# subasm_name = "_".join(list(map(lambda x: x.Label[:8], selected_objects)))
# create_package(subasm_name, selected_objects, export_dir)
return True
def exportPartInfo(obj, ofile):
"""
Exports part info to a new json file.
The part info includes:
Placement relative to world frame, bounding box, volume, center of mass,
principal properties.
For more information on principal properties, see TopoShape in OCCT
documentation.
"""
partprops = getLocalPartProps(obj)
with open(ofile, "w", encoding="utf8") as propfile:
json.dump(partprops, propfile, indent=1, separators=(',', ': '))
return ofile
def appendPartInfo(obj, ofile):
"""Rewrites/appends part info to an existing json file.
The part info includes:
Placement relative to world frame, bounding box, volume, center of mass,
principal properties.
For more information on principal properties, see TopoShape in OCCT
documentation.
"""
with open(ofile, "r", encoding="utf8") as propfile:
partprops = json.load(propfile)
new_props = getLocalPartProps(obj)
partprops.update(new_props)
with open(ofile, "w", encoding="utf8") as propfile:
json.dump(partprops, propfile, indent=1, separators=(',', ': '))
return True
def exportFeatureFrames(obj, ofile):
"""Exports feature frames attached to a part."""
# Get the feature frames
import Frames
ff_check = lambda x: isinstance(x.Proxy, Frames.FeatureFrame) if hasattr(x, 'Proxy') else False
ff_list = filter(ff_check, obj.InList)
ff_named = { ff.Label: ff.Proxy.getDict() for ff in ff_list }
feature_dict = { "features": ff_named }
with open(ofile, "w", encoding="utf8") as propfile:
json.dump(feature_dict, propfile, indent=1, separators=(',', ': '))
return True
def appendFeatureFrames(obj, ofile):
"""Rewrites/appends featureframes attached to a part to an existing json
file."""
# Get the feature frames
import Frames
with open(ofile, "r", encoding="utf8") as propfile:
partprops = json.load(propfile)
ff_check = lambda x: isinstance(x.Proxy, Frames.FeatureFrame) if hasattr(x, 'Proxy') else False
# part's children list
ff_list = filter(ff_check, obj.InList)
ff_named = { ff.Label: {"label": ff.Label, "placement": placement2pose(ff.FeaturePlacement)} for ff in ff_list }
feature_dict = { "features": ff_named }
if "features" not in partprops.keys():
partprops.update(feature_dict)
else:
partprops["features"].update(feature_dict["features"])
with open(ofile, "w", encoding="utf8") as propfile:
json.dump(partprops, propfile, indent=1, separators=(',', ': '))
return True
def exportPartInfoDialogue():
"""Spawns a dialogue window for part info exporting"""
# Select only true parts
s = FreeCADGui.Selection.getSelection()
FreeCADGui.Selection.clearSelection()
if len(s) == 0:
FreeCAD.Console.PrintError("No part selected.")
return False
unique_selected = []
for item in s:
if item not in unique_selected and isinstance(item, Part.Feature):
# Ensuring that we are parts
unique_selected.append(item)
FreeCADGui.Selection.addSelection(item)
# Fix wording
textprompt = "Save the properties of the part"
if len(unique_selected) > 1:
textprompt = textprompt + "s"
opts = QtGui.QFileDialog.DontConfirmOverwrite
# Create file dialog
ofile, filt = QtGui.QFileDialog.getSaveFileName(None, textprompt,
os.getenv("HOME"),
"*.json", options=opts)
if ofile == "":
# User cancelled
return False
if os.path.exists(ofile):
msgbox = QtGui.QMessageBox()
msgbox.setText("File already exists. We can overwrite the file, or add the information/rewrite only relevant sections.")
append_button = msgbox.addButton("Append", QtGui.QMessageBox.YesRole)
overwrite_button = msgbox.addButton("Overwrite", QtGui.QMessageBox.NoRole)
msgbox.exec_()
if msgbox.clickedButton() == append_button:
NEWFILE = False
elif msgbox.clickedButton() == overwrite_button:
NEWFILE = True
else:
return False
else:
NEWFILE = True
if NEWFILE:
exportPartInfo(unique_selected[0], ofile)
else:
appendPartInfo(unique_selected[0], ofile)
if len(unique_selected) > 1:
FreeCAD.Console.PrintWarning("Multi-part export not yet supported\n")
FreeCAD.Console.PrintMessage("Properties exported to "+str(ofile)+"\n")
def exportFeatureFramesDialogue():
"""Spawns a dialogue window for a part's feature frames to be exported."""
# Select only true parts
import Frames
s = FreeCADGui.Selection.getSelection()
FreeCADGui.Selection.clearSelection()
if len(s) == 0:
FreeCAD.Console.PrintError("No part selected.")
return False
unique_selected = []
for item in s:
if item not in unique_selected and isinstance(item.Proxy, Frames.FeatureFrame):
# Ensuring that we are parts
unique_selected.append(item)
FreeCADGui.Selection.addSelection(item)
# Fix wording
textprompt = "Save the feature frames attached to the part"
if len(unique_selected) > 1:
textprompt = textprompt + "s"
opts = QtGui.QFileDialog.DontConfirmOverwrite
# Create file dialog
ofile, filt = QtGui.QFileDialog.getSaveFileName(None, textprompt, os.getenv("HOME"),
"*.json", options=opts)
if ofile == "":
# User cancelled
return False
if os.path.exists(ofile):
msgbox = QtGui.QMessageBox()
msgbox.setText("File already exists. We can overwrite the file, or add the information/rewrite only relevant sections.")
append_button = msgbox.addButton("Append", QtGui.QMessageBox.YesRole)
overwrite_button = msgbox.addButton("Overwrite", QtGui.QMessageBox.NoRole)
msgbox.exec_()
if msgbox.clickedButton() == append_button:
NEWFILE = False
elif msgbox.clickedButton() == overwrite_button:
NEWFILE = True
else:
return False
else:
NEWFILE = True
if NEWFILE:
exportFeatureFrames(unique_selected[0], ofile)
else:
appendFeatureFrames(unique_selected[0], ofile)
if len(unique_selected) > 1:
FreeCAD.Console.PrintWarning("Multi-part export not yet supported\n")
FreeCAD.Console.PrintMessage("Feature frames of " + str(unique_selected[0].Label) + " exported to " + str(ofile) + "\n")
def exportPlacementAndProperties():
"""Spawns a dialogue window for exporting both."""
import Frames
s = FreeCADGui.Selection.getSelection()
FreeCADGui.Selection.clearSelection()
if len(s) == 0:
FreeCAD.Console.PrintError("No part selected")
return False
unique_selected = []
for item in s:
if item not in unique_selected:
# Ensuring that we are parts
unique_selected.append(item)
FreeCADGui.Selection.addSelection(item)
FreeCAD.Console.PrintMessage("Added for export "+str(item.FullName)+"\n")
# Fix wording
textprompt = "Save the part info and feature frames attached to the part"
if len(unique_selected) > 1:
textprompt = textprompt + "s"
opts = QtGui.QFileDialog.DontConfirmOverwrite
# Create file dialog
ofile, filt = QtGui.QFileDialog.getSaveFileName(None, textprompt,
os.getenv("HOME"),
"*.json", options=opts)
if ofile == "":
# User cancelled
return False
# File path stuff
odir, of = os.path.split(ofile)
if not os.path.exists(odir):
os.makedirs(odir)
if not of.lower().endswith(".json"):
ofile = ofile + ".json"
if os.path.exists(ofile):
msgbox = QtGui.QMessageBox()
msgbox.setText("File already exists. We can overwrite the file, or add the information/rewrite only relevant sections.")
append_button = msgbox.addButton("Append", QtGui.QMessageBox.YesRole)
overwrite_button = msgbox.addButton("Overwrite", QtGui.QMessageBox.NoRole)
msgbox.exec_()
if msgbox.clickedButton() == append_button:
NEWFILE = False
elif msgbox.clickedButton() == overwrite_button:
NEWFILE = True
else:
return False
else:
NEWFILE = True
if NEWFILE:
exportPartInfo(unique_selected[0], ofile)
appendFeatureFrames(unique_selected[0], ofile)
else:
appendPartInfo(unique_selected[0], ofile)
appendFeatureFrames(unique_selected[0], ofile)
if len(unique_selected) > 1:
FreeCAD.Console.PrintWarning("Multi-part export not yet supported.\n")
FreeCAD.Console.PrintMessage("Feature frames of "
+ str(unique_selected[0].Label)
+ " exported to " + str(ofile) + "\n")
###################################################################
# GUI Commands
###################################################################
spawnClassCommand("ExportPlacementAndPropertiesCommand",
exportPlacementAndProperties,
{"Pixmap": str(os.path.join(ICONPATH, "parttojson.svg")),
"MenuText": "Export placement and properties",
"ToolTip": "Export object placement and properties and feature frames"})
spawnClassCommand("ExportGazeboModels",
exportGazeboModels,
{"Pixmap": str(os.path.join(ICONPATH, "gazeboexport.svg")),
"MenuText": "Export SDF-models to Gazebo",
"ToolTip": "Export SDF-models for all solid parts"})
spawnClassCommand("InsertGraspPose",
insert,
{"Pixmap": str(os.path.join(ICONPATH, "addgrasppose.svg")),
"MenuText": "Insert Grasp Pose",
"ToolTip": "Insert Grasp Pose for Selected Part"})
# spawnClassCommand("ASM4StructureParsing",
# RobossemblerFreeCadExportScenario().call,
# {"Pixmap": str(os.path.join(ICONPATH, "assembly4.svg")),
# "MenuText": "Make a ASM4 parsing",
# "ToolTip": "Make a ASM4 1"})
###################################################################
# Information from primitive type
###################################################################
def getPrimitiveInfo(prim_type, subobj, scale=1e-3):
"""returns a dictionary of the primitive's specific information."""
d = {}
if prim_type == "ArcOfCircle":
d["radius"] = scale*subobj.Curve.Radius
d["center"] = vector2list(subobj.Curve.Center, scale)
d["axis"] = vector2list(subobj.Curve.Axis, scale=1)
d["parameterrange"] = subobj.ParameterRange
elif prim_type == "ArcOfEllipse":
d["center"] = vector2list(subobj.Curve.Center, scale)
d["axis"] = vector2list(subobj.Curve.Axis, scale=1)
d["majorradius"] = scale*subobj.Curve.MajorRadius
d["minorradius"] = scale*subobj.Curve.MinorRadius
d["parameterrange"] = subobj.ParameterRange
elif prim_type == "ArcOfHyperBola":
d["anglexu"] = subobj.Curve.AngleXU
d["axis"] = vector2list(subobj.Curve.Axis, scale=1)
d["center"] = vector2list(subobj.Curve.Center, scale)
d["majorradius"] = scale*subobj.Curve.MajorRadius
d["minorradius"] = scale*subobj.Curve.MinorRadius
d["parameterrange"] = subobj.ParameterRange
elif prim_type == "ArcOfParabola":
d["anglexu"] = subobj.Curve.AngleXU
d["axis"] = vector2list(subobj.Curve.Axis, scale=1)
d["center"] = vector2list(subobj.Curve.Center, scale)
d["focal"] = scale*subobj.Curve.Focal
elif prim_type == "BSplineCurve":
FreeCAD.Console.PrintWarning("getPrimitiveInfo of BSpline incomplete.")
elif prim_type == "BezierCurve":
FreeCAD.Console.PrintWarning("getPrimitiveInfo of Bezier incomplete.")
elif prim_type == "Circle":
d["radius"] = scale*subobj.Curve.Radius
d["center"] = vector2list(subobj.Curve.Center, scale)
d["axis"] = vector2list(subobj.Curve.Axis, scale=1)
d["parameterrange"] = subobj.ParameterRange
elif prim_type == "Ellipse":
d["center"] = vector2list(subobj.Curve.Center, scale)
d["axis"] = vector2list(subobj.Curve.Axis, scale=1)
d["majorradius"] = scale*subobj.Curve.MajorRadius
d["minorradius"] = scale*subobj.Curve.MinorRadius
d["parameterrange"] = subobj.ParameterRange
elif prim_type == "Hyperbola":
d["anglexu"] = subobj.Curve.AngleXU
d["axis"] = vector2list(subobj.Curve.Axis, scale=1)
d["center"] = vector2list(subobj.Curve.Center, scale)
d["majorradius"] = scale*subobj.Curve.MajorRadius
d["minorradius"] = scale*subobj.Curve.MinorRadius
d["parameterrange"] = subobj.ParameterRange
elif prim_type == "Parabola":
d["anglexu"] = subobj.Curve.AngleXU
d["axis"] = vector2list(subobj.Curve.Axis, scale=1)
d["center"] = vector2list(subobj.Curve.Center, scale)
d["focal"] = scale*subobj.Curve.Focal
elif prim_type == "Line":
if int(FreeCAD.Version()[1]) > 16:
sp = subobj.valueAt(subobj.FirstParameter)
ep = subobj.valueAt(subobj.LastParameter)
d["startpoint"] = vector2list(sp)
d["endpoint"] = vector2list
else:
if not hasattr(subobj.Curve, "Infinite"):
d["startpoint"] = vector2list(subobj.Curve.StartPoint)
d["endpoint"] = vector2list(subobj.Curve.EndPoint)
if hasattr(subobj.Curve, "Infinite"):
if subobj.Curve.Infinite:
d["infinite"] = subobj.Curve.Infinite
else:
d["startpoint"] = vector2list(subobj.Curve.StartPoint)
d["endpoint"] = vector2list(subobj.Curve.EndPoint)
elif prim_type == "BSplineSurface":
FreeCAD.Console.PrintWarning("getPrimitiveInfo of BSpline incomplete.")
elif prim_type == "BezierSurface":
FreeCAD.Console.PrintWarning("getPrimitiveInfo of Bezier incomplete.")
elif prim_type == "Cylinder":
d["axis"] = vector2list(subobj.Surface.Axis, scale=1)
d["radius"] = scale*subobj.Surface.Radius
d["center"] = vector2list(subobj.Surface.Center)
PR = list(subobj.ParameterRange)
PR[2] = PR[2]*scale
PR[3] = PR[3]*scale
d["parameterrange"] = PR
elif prim_type == "Plane":
d["axis"] = vector2list(subobj.Surface.Axis, scale=1)
d["position"] = vector2list(subobj.Surface.Position, scale)
d["parameterrange"] = [scale*i for i in subobj.ParameterRange]
elif prim_type == "Sphere":
d["axis"] = vector2list(subobj.Surface.Axis, scale=1)
d["center"] = vector2list(subobj.Surface.Center, scale)
d["radius"] = scale*subobj.Surface.Radius
d["parameterrange"] = subobj.ParameterRange
elif prim_type == "Toroid":
d["axis"] = vector2list(subobj.Surface.Axis, scale=1)
d["center"] = vector2list(subobj.Surface.Center, scale)
d["majorradius"] = scale*subobj.Surface.MajorRadius
d["minorradius"] = scale*subobj.Surface.MinorRadius
d["parameterrange"] = subobj.Surface.ParameterRange
elif prim_type == "Cone":
d["axis"] = vector2list(subobj.Surface.Axis, scale=1)
d["center"] = vector2list(subobj.Surface.Center, scale)
d["radius"] = scale*subobj.Surface.Radius
d["semiangle"] = subobj.Surface.SemiAngle
d["parameterrange"] = subobj.ParameterRange
FreeCAD.Console.PrintWarning("getPrimitiveInfo of Cone may have wrong ParameterRange.")
return d

View file

@ -1,37 +0,0 @@
# -*- coding: utf8 -*-
#***************************************************************************
#* *
#* Copyright (c) 2020 kbwbe *
#* *
#* *
#* This program is free software; you can redistribute it and/or modify *
#* it under the terms of the GNU Lesser General Public License (LGPL) *
#* as published by the Free Software Foundation; either version 2 of *
#* the License, or (at your option) any later version. *
#* for detail see the LICENCE text file. *
#* *
#* This program is distributed in the hope that it will be useful, *
#* but WITHOUT ANY WARRANTY; without even the implied warranty of *
#* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
#* GNU Library General Public License for more details. *
#* *
#* You should have received a copy of the GNU Library General Public *
#* License along with this program; if not, write to the Free Software *
#* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 *
#* USA *
#* *
#***************************************************************************
import FreeCAD
if FreeCAD.GuiUp:
from PySide.QtCore import QT_TRANSLATE_NOOP
from DraftGui import translate
else:
def QT_TRANSLATE_NOOP(context, text):
return text
def translate(context, text):
return text

View file

@ -1,73 +0,0 @@
<?xml version="1.0" encoding="UTF-8"?>
<ui version="4.0">
<class>FeatureFrameCreator</class>
<widget class="QDialog" name="FeatureFrameCreator">
<property name="geometry">
<rect>
<x>0</x>
<y>0</y>
<width>235</width>
<height>238</height>
</rect>
</property>
<property name="sizePolicy">
<sizepolicy hsizetype="Minimum" vsizetype="Minimum">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="minimumSize">
<size>
<width>235</width>
<height>238</height>
</size>
</property>
<property name="baseSize">
<size>
<width>235</width>
<height>238</height>
</size>
</property>
<property name="windowTitle">
<string>Feature Frame</string>
</property>
<widget class="QGraphicsView" name="Preview">
<property name="geometry">
<rect>
<x>30</x>
<y>29</y>
<width>170</width>
<height>151</height>
</rect>
</property>
</widget>
<widget class="QComboBox" name="ChoicesBox">
<property name="geometry">
<rect>
<x>30</x>
<y>190</y>
<width>171</width>
<height>27</height>
</rect>
</property>
</widget>
<widget class="QLabel" name="PickedTypeLabel">
<property name="geometry">
<rect>
<x>35</x>
<y>10</y>
<width>161</width>
<height>20</height>
</rect>
</property>
<property name="text">
<string>TextLabel</string>
</property>
<property name="alignment">
<set>Qt::AlignCenter</set>
</property>
</widget>
</widget>
<resources/>
<connections/>
</ui>

View file

@ -1,520 +0,0 @@
<?xml version="1.0" encoding="UTF-8"?>
<ui version="4.0">
<class>dialog</class>
<widget class="QDialog" name="dialog">
<property name="geometry">
<rect>
<x>0</x>
<y>0</y>
<width>299</width>
<height>292</height>
</rect>
</property>
<property name="sizePolicy">
<sizepolicy hsizetype="Minimum" vsizetype="Minimum">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="minimumSize">
<size>
<width>299</width>
<height>292</height>
</size>
</property>
<property name="windowTitle">
<string>Part Frame Creator</string>
</property>
<widget class="QDoubleSpinBox" name="XBox">
<property name="geometry">
<rect>
<x>52</x>
<y>85</y>
<width>103</width>
<height>27</height>
</rect>
</property>
<property name="toolTip">
<string>Offset in part frame x direction</string>
</property>
<property name="suffix">
<string> mm</string>
</property>
<property name="minimum">
<double>-1000.000000000000000</double>
</property>
<property name="maximum">
<double>1000.000000000000000</double>
</property>
</widget>
<widget class="QDoubleSpinBox" name="YBox">
<property name="geometry">
<rect>
<x>52</x>
<y>118</y>
<width>103</width>
<height>27</height>
</rect>
</property>
<property name="toolTip">
<string>offset in part frame z direction</string>
</property>
<property name="suffix">
<string> mm</string>
</property>
<property name="minimum">
<double>-1000.000000000000000</double>
</property>
<property name="maximum">
<double>1000.000000000000000</double>
</property>
</widget>
<widget class="QDoubleSpinBox" name="ZBox">
<property name="geometry">
<rect>
<x>52</x>
<y>151</y>
<width>103</width>
<height>27</height>
</rect>
</property>
<property name="toolTip">
<string>offset in part frame z direction</string>
</property>
<property name="suffix">
<string> mm</string>
</property>
<property name="decimals">
<number>2</number>
</property>
<property name="minimum">
<double>-1000.000000000000000</double>
</property>
<property name="maximum">
<double>1000.000000000000000</double>
</property>
</widget>
<widget class="QLabel" name="XLabel">
<property name="geometry">
<rect>
<x>9</x>
<y>85</y>
<width>16</width>
<height>17</height>
</rect>
</property>
<property name="text">
<string>x</string>
</property>
<property name="buddy">
<cstring>XBox</cstring>
</property>
</widget>
<widget class="QLabel" name="YLabel">
<property name="geometry">
<rect>
<x>9</x>
<y>118</y>
<width>16</width>
<height>17</height>
</rect>
</property>
<property name="text">
<string>y</string>
</property>
<property name="buddy">
<cstring>YBox</cstring>
</property>
</widget>
<widget class="QLabel" name="ZLabel">
<property name="geometry">
<rect>
<x>9</x>
<y>151</y>
<width>16</width>
<height>17</height>
</rect>
</property>
<property name="text">
<string>z</string>
</property>
<property name="buddy">
<cstring>ZBox</cstring>
</property>
</widget>
<widget class="QLabel" name="RollLabel">
<property name="geometry">
<rect>
<x>161</x>
<y>85</y>
<width>24</width>
<height>17</height>
</rect>
</property>
<property name="toolTip">
<string>roll offset from part frame</string>
</property>
<property name="text">
<string>roll</string>
</property>
<property name="buddy">
<cstring>RollBox</cstring>
</property>
</widget>
<widget class="QLabel" name="PitchLabel">
<property name="geometry">
<rect>
<x>161</x>
<y>118</y>
<width>35</width>
<height>17</height>
</rect>
</property>
<property name="toolTip">
<string>pitch offset from part frame</string>
</property>
<property name="text">
<string>pitch</string>
</property>
<property name="buddy">
<cstring>PitchBox</cstring>
</property>
</widget>
<widget class="QLabel" name="YawLabel">
<property name="geometry">
<rect>
<x>161</x>
<y>151</y>
<width>29</width>
<height>17</height>
</rect>
</property>
<property name="toolTip">
<string>yaw offset from part frame</string>
</property>
<property name="text">
<string>yaw</string>
</property>
<property name="buddy">
<cstring>YawBox</cstring>
</property>
</widget>
<widget class="QDoubleSpinBox" name="RollBox">
<property name="geometry">
<rect>
<x>228</x>
<y>85</y>
<width>61</width>
<height>27</height>
</rect>
</property>
<property name="toolTip">
<string>roll offset from part frame</string>
</property>
<property name="suffix">
<string>°</string>
</property>
<property name="decimals">
<number>1</number>
</property>
<property name="maximum">
<double>360.000000000000000</double>
</property>
</widget>
<widget class="QDoubleSpinBox" name="PitchBox">
<property name="geometry">
<rect>
<x>228</x>
<y>118</y>
<width>61</width>
<height>27</height>
</rect>
</property>
<property name="toolTip">
<string>pitch offset from part frame</string>
</property>
<property name="suffix">
<string>°</string>
</property>
<property name="decimals">
<number>1</number>
</property>
<property name="maximum">
<double>360.000000000000000</double>
</property>
</widget>
<widget class="QDoubleSpinBox" name="YawBox">
<property name="geometry">
<rect>
<x>228</x>
<y>151</y>
<width>61</width>
<height>27</height>
</rect>
</property>
<property name="toolTip">
<string>yaw offset from part frame</string>
</property>
<property name="suffix">
<string>°</string>
</property>
<property name="decimals">
<number>1</number>
</property>
<property name="maximum">
<double>360.000000000000000</double>
</property>
</widget>
<widget class="QPlainTextEdit" name="FrameLabelField">
<property name="geometry">
<rect>
<x>94</x>
<y>9</y>
<width>195</width>
<height>31</height>
</rect>
</property>
<property name="sizePolicy">
<sizepolicy hsizetype="Fixed" vsizetype="Fixed">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="toolTip">
<string>Label of the frame</string>
</property>
<property name="statusTip">
<string>Label of the new frame</string>
</property>
<property name="whatsThis">
<string>Label of the new frame, must be unique</string>
</property>
<property name="verticalScrollBarPolicy">
<enum>Qt::ScrollBarAlwaysOff</enum>
</property>
</widget>
<widget class="QLabel" name="FrameLabelLabel">
<property name="geometry">
<rect>
<x>9</x>
<y>9</y>
<width>79</width>
<height>31</height>
</rect>
</property>
<property name="text">
<string>Frame label</string>
</property>
</widget>
<widget class="QLabel" name="OffsetLabel">
<property name="geometry">
<rect>
<x>9</x>
<y>48</y>
<width>281</width>
<height>31</height>
</rect>
</property>
<property name="toolTip">
<string>Define an offset from the part frame if needed</string>
</property>
<property name="text">
<string>Offset from part frame</string>
</property>
<property name="alignment">
<set>Qt::AlignCenter</set>
</property>
</widget>
<widget class="QLabel" name="ScaleLabel">
<property name="geometry">
<rect>
<x>160</x>
<y>180</y>
<width>71</width>
<height>21</height>
</rect>
</property>
<property name="toolTip">
<string>Scale of the axis arrows</string>
</property>
<property name="statusTip">
<string>Scale of the axis arrows</string>
</property>
<property name="whatsThis">
<string>Scale of the axis arrows</string>
</property>
<property name="text">
<string>Axis scale</string>
</property>
<property name="alignment">
<set>Qt::AlignLeading|Qt::AlignLeft|Qt::AlignVCenter</set>
</property>
</widget>
<widget class="QDoubleSpinBox" name="ScaleBox">
<property name="geometry">
<rect>
<x>230</x>
<y>180</y>
<width>60</width>
<height>27</height>
</rect>
</property>
<property name="toolTip">
<string>Scale of the axis arrows</string>
</property>
<property name="statusTip">
<string>Scale of the axis arrows</string>
</property>
<property name="whatsThis">
<string>Scale of the axis arrows</string>
</property>
<property name="minimum">
<double>0.100000000000000</double>
</property>
<property name="maximum">
<double>2.000000000000000</double>
</property>
<property name="singleStep">
<double>0.010000000000000</double>
</property>
<property name="value">
<double>0.110000000000000</double>
</property>
</widget>
<widget class="QLabel" name="OptionsLabel">
<property name="enabled">
<bool>true</bool>
</property>
<property name="geometry">
<rect>
<x>20</x>
<y>220</y>
<width>66</width>
<height>31</height>
</rect>
</property>
<property name="visible">
<bool>false</bool>
</property>
<property name="text">
<string>Options</string>
</property>
<property name="buddy">
<cstring>OptionsBox</cstring>
</property>
</widget>
<widget class="QComboBox" name="OptionsBox">
<property name="enabled">
<bool>true</bool>
</property>
<property name="geometry">
<rect>
<x>210</x>
<y>220</y>
<width>78</width>
<height>27</height>
</rect>
</property>
<property name="visible">
<bool>false</bool>
</property>
</widget>
<widget class="QDoubleSpinBox" name="UBox">
<property name="enabled">
<bool>true</bool>
</property>
<property name="geometry">
<rect>
<x>100</x>
<y>250</y>
<width>62</width>
<height>27</height>
</rect>
</property>
<property name="visible">
<bool>false</bool>
</property>
</widget>
<widget class="QDoubleSpinBox" name="VBox">
<property name="enabled">
<bool>true</bool>
</property>
<property name="geometry">
<rect>
<x>220</x>
<y>250</y>
<width>62</width>
<height>27</height>
</rect>
</property>
<property name="visible">
<bool>false</bool>
</property>
</widget>
<widget class="QLabel" name="ULabel">
<property name="enabled">
<bool>true</bool>
</property>
<property name="geometry">
<rect>
<x>80</x>
<y>250</y>
<width>16</width>
<height>31</height>
</rect>
</property>
<property name="visible">
<bool>false</bool>
</property>
<property name="text">
<string>u</string>
</property>
<property name="buddy">
<cstring>UBox</cstring>
</property>
</widget>
<widget class="QLabel" name="VLabel">
<property name="enabled">
<bool>true</bool>
</property>
<property name="geometry">
<rect>
<x>200</x>
<y>250</y>
<width>16</width>
<height>31</height>
</rect>
</property>
<property name="visible">
<bool>false</bool>
</property>
<property name="text">
<string>v</string>
</property>
<property name="buddy">
<cstring>VBox</cstring>
</property>
</widget>
<widget class="QLabel" name="CoordsLabel">
<property name="enabled">
<bool>true</bool>
</property>
<property name="geometry">
<rect>
<x>20</x>
<y>256</y>
<width>51</width>
<height>21</height>
</rect>
</property>
<property name="visible">
<bool>false</bool>
</property>
<property name="text">
<string>Coords:</string>
</property>
</widget>
</widget>
<resources/>
<connections/>
</ui>

View file

@ -1,262 +0,0 @@
<?xml version="1.0" encoding="UTF-8"?>
<ui version="4.0">
<class>Dialog</class>
<widget class="QDialog" name="Dialog">
<property name="geometry">
<rect>
<x>0</x>
<y>0</y>
<width>323</width>
<height>325</height>
</rect>
</property>
<property name="minimumSize">
<size>
<width>316</width>
<height>325</height>
</size>
</property>
<property name="windowTitle">
<string>Dialog</string>
</property>
<widget class="QLabel" name="TaskLabel">
<property name="geometry">
<rect>
<x>10</x>
<y>20</y>
<width>71</width>
<height>21</height>
</rect>
</property>
<property name="text">
<string>Task Label</string>
</property>
</widget>
<widget class="QPushButton" name="SelectButton">
<property name="geometry">
<rect>
<x>150</x>
<y>290</y>
<width>161</width>
<height>27</height>
</rect>
</property>
<property name="text">
<string>Get from selection</string>
</property>
</widget>
<widget class="QLineEdit" name="TaskLabelField">
<property name="geometry">
<rect>
<x>100</x>
<y>20</y>
<width>211</width>
<height>27</height>
</rect>
</property>
<property name="minimumSize">
<size>
<width>0</width>
<height>0</height>
</size>
</property>
</widget>
<widget class="QLabel" name="HoleLabel">
<property name="geometry">
<rect>
<x>10</x>
<y>50</y>
<width>31</width>
<height>21</height>
</rect>
</property>
<property name="text">
<string>Hole</string>
</property>
</widget>
<widget class="QLabel" name="PegLabel">
<property name="geometry">
<rect>
<x>10</x>
<y>130</y>
<width>31</width>
<height>21</height>
</rect>
</property>
<property name="text">
<string>Peg</string>
</property>
</widget>
<widget class="QLabel" name="HolePartLabel">
<property name="geometry">
<rect>
<x>50</x>
<y>70</y>
<width>41</width>
<height>21</height>
</rect>
</property>
<property name="text">
<string>Part:</string>
</property>
</widget>
<widget class="QLabel" name="HoleFaceLabel">
<property name="geometry">
<rect>
<x>50</x>
<y>90</y>
<width>41</width>
<height>21</height>
</rect>
</property>
<property name="text">
<string>Face:</string>
</property>
</widget>
<widget class="QLabel" name="PegPartLabel">
<property name="geometry">
<rect>
<x>50</x>
<y>150</y>
<width>41</width>
<height>21</height>
</rect>
</property>
<property name="text">
<string>Part:</string>
</property>
</widget>
<widget class="QLabel" name="PegFaceLabel">
<property name="geometry">
<rect>
<x>50</x>
<y>170</y>
<width>41</width>
<height>21</height>
</rect>
</property>
<property name="text">
<string>Face:</string>
</property>
</widget>
<widget class="QLabel" name="HolePartField">
<property name="geometry">
<rect>
<x>100</x>
<y>70</y>
<width>231</width>
<height>21</height>
</rect>
</property>
<property name="text">
<string>PartLabel</string>
</property>
</widget>
<widget class="QLabel" name="HoleFaceIDField">
<property name="geometry">
<rect>
<x>100</x>
<y>90</y>
<width>231</width>
<height>21</height>
</rect>
</property>
<property name="text">
<string>FaceID</string>
</property>
</widget>
<widget class="QLabel" name="PegFaceIDField">
<property name="geometry">
<rect>
<x>100</x>
<y>170</y>
<width>231</width>
<height>21</height>
</rect>
</property>
<property name="text">
<string>FaceID</string>
</property>
</widget>
<widget class="QLabel" name="PegPartField">
<property name="geometry">
<rect>
<x>100</x>
<y>150</y>
<width>231</width>
<height>21</height>
</rect>
</property>
<property name="text">
<string>PartLabel</string>
</property>
</widget>
<widget class="QLabel" name="HoleFeatureSummary">
<property name="geometry">
<rect>
<x>100</x>
<y>110</y>
<width>231</width>
<height>21</height>
</rect>
</property>
<property name="text">
<string>Feature Description</string>
</property>
</widget>
<widget class="QLabel" name="HoleFeatureLabel">
<property name="geometry">
<rect>
<x>30</x>
<y>110</y>
<width>61</width>
<height>21</height>
</rect>
</property>
<property name="text">
<string>Feature:</string>
</property>
</widget>
<widget class="QLabel" name="PegFeatureSummary">
<property name="geometry">
<rect>
<x>100</x>
<y>190</y>
<width>231</width>
<height>21</height>
</rect>
</property>
<property name="text">
<string>Feature Description</string>
</property>
</widget>
<widget class="QLabel" name="PegFeatureLabel">
<property name="geometry">
<rect>
<x>30</x>
<y>190</y>
<width>61</width>
<height>21</height>
</rect>
</property>
<property name="text">
<string>Feature:</string>
</property>
</widget>
<widget class="QPushButton" name="AnimateButton">
<property name="geometry">
<rect>
<x>10</x>
<y>290</y>
<width>131</width>
<height>27</height>
</rect>
</property>
<property name="text">
<string>Animate</string>
</property>
</widget>
</widget>
<resources/>
<connections/>
</ui>

View file

@ -1,520 +0,0 @@
<?xml version="1.0" encoding="UTF-8"?>
<ui version="4.0">
<class>dialog</class>
<widget class="QDialog" name="dialog">
<property name="geometry">
<rect>
<x>0</x>
<y>0</y>
<width>299</width>
<height>292</height>
</rect>
</property>
<property name="sizePolicy">
<sizepolicy hsizetype="Minimum" vsizetype="Minimum">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="minimumSize">
<size>
<width>299</width>
<height>292</height>
</size>
</property>
<property name="windowTitle">
<string>Part Frame Creator</string>
</property>
<widget class="QDoubleSpinBox" name="XBox">
<property name="geometry">
<rect>
<x>52</x>
<y>85</y>
<width>103</width>
<height>27</height>
</rect>
</property>
<property name="toolTip">
<string>Offset in part frame x direction</string>
</property>
<property name="suffix">
<string> mm</string>
</property>
<property name="minimum">
<double>-1000.000000000000000</double>
</property>
<property name="maximum">
<double>1000.000000000000000</double>
</property>
</widget>
<widget class="QDoubleSpinBox" name="YBox">
<property name="geometry">
<rect>
<x>52</x>
<y>118</y>
<width>103</width>
<height>27</height>
</rect>
</property>
<property name="toolTip">
<string>offset in part frame z direction</string>
</property>
<property name="suffix">
<string> mm</string>
</property>
<property name="minimum">
<double>-1000.000000000000000</double>
</property>
<property name="maximum">
<double>1000.000000000000000</double>
</property>
</widget>
<widget class="QDoubleSpinBox" name="ZBox">
<property name="geometry">
<rect>
<x>52</x>
<y>151</y>
<width>103</width>
<height>27</height>
</rect>
</property>
<property name="toolTip">
<string>offset in part frame z direction</string>
</property>
<property name="suffix">
<string> mm</string>
</property>
<property name="decimals">
<number>2</number>
</property>
<property name="minimum">
<double>-1000.000000000000000</double>
</property>
<property name="maximum">
<double>1000.000000000000000</double>
</property>
</widget>
<widget class="QLabel" name="XLabel">
<property name="geometry">
<rect>
<x>9</x>
<y>85</y>
<width>16</width>
<height>17</height>
</rect>
</property>
<property name="text">
<string>x</string>
</property>
<property name="buddy">
<cstring>XBox</cstring>
</property>
</widget>
<widget class="QLabel" name="YLabel">
<property name="geometry">
<rect>
<x>9</x>
<y>118</y>
<width>16</width>
<height>17</height>
</rect>
</property>
<property name="text">
<string>y</string>
</property>
<property name="buddy">
<cstring>YBox</cstring>
</property>
</widget>
<widget class="QLabel" name="ZLabel">
<property name="geometry">
<rect>
<x>9</x>
<y>151</y>
<width>16</width>
<height>17</height>
</rect>
</property>
<property name="text">
<string>z</string>
</property>
<property name="buddy">
<cstring>ZBox</cstring>
</property>
</widget>
<widget class="QLabel" name="RollLabel">
<property name="geometry">
<rect>
<x>161</x>
<y>85</y>
<width>24</width>
<height>17</height>
</rect>
</property>
<property name="toolTip">
<string>roll offset from part frame</string>
</property>
<property name="text">
<string>roll</string>
</property>
<property name="buddy">
<cstring>RollBox</cstring>
</property>
</widget>
<widget class="QLabel" name="PitchLabel">
<property name="geometry">
<rect>
<x>161</x>
<y>118</y>
<width>35</width>
<height>17</height>
</rect>
</property>
<property name="toolTip">
<string>pitch offset from part frame</string>
</property>
<property name="text">
<string>pitch</string>
</property>
<property name="buddy">
<cstring>PitchBox</cstring>
</property>
</widget>
<widget class="QLabel" name="YawLabel">
<property name="geometry">
<rect>
<x>161</x>
<y>151</y>
<width>29</width>
<height>17</height>
</rect>
</property>
<property name="toolTip">
<string>yaw offset from part frame</string>
</property>
<property name="text">
<string>yaw</string>
</property>
<property name="buddy">
<cstring>YawBox</cstring>
</property>
</widget>
<widget class="QDoubleSpinBox" name="RollBox">
<property name="geometry">
<rect>
<x>228</x>
<y>85</y>
<width>61</width>
<height>27</height>
</rect>
</property>
<property name="toolTip">
<string>roll offset from part frame</string>
</property>
<property name="suffix">
<string>°</string>
</property>
<property name="decimals">
<number>1</number>
</property>
<property name="maximum">
<double>360.000000000000000</double>
</property>
</widget>
<widget class="QDoubleSpinBox" name="PitchBox">
<property name="geometry">
<rect>
<x>228</x>
<y>118</y>
<width>61</width>
<height>27</height>
</rect>
</property>
<property name="toolTip">
<string>pitch offset from part frame</string>
</property>
<property name="suffix">
<string>°</string>
</property>
<property name="decimals">
<number>1</number>
</property>
<property name="maximum">
<double>360.000000000000000</double>
</property>
</widget>
<widget class="QDoubleSpinBox" name="YawBox">
<property name="geometry">
<rect>
<x>228</x>
<y>151</y>
<width>61</width>
<height>27</height>
</rect>
</property>
<property name="toolTip">
<string>yaw offset from part frame</string>
</property>
<property name="suffix">
<string>°</string>
</property>
<property name="decimals">
<number>1</number>
</property>
<property name="maximum">
<double>360.000000000000000</double>
</property>
</widget>
<widget class="QPlainTextEdit" name="FrameLabelField">
<property name="geometry">
<rect>
<x>94</x>
<y>9</y>
<width>195</width>
<height>31</height>
</rect>
</property>
<property name="sizePolicy">
<sizepolicy hsizetype="Fixed" vsizetype="Fixed">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="toolTip">
<string>Label of the frame</string>
</property>
<property name="statusTip">
<string>Label of the new frame</string>
</property>
<property name="whatsThis">
<string>Label of the new frame, must be unique</string>
</property>
<property name="verticalScrollBarPolicy">
<enum>Qt::ScrollBarAlwaysOff</enum>
</property>
</widget>
<widget class="QLabel" name="FrameLabelLabel">
<property name="geometry">
<rect>
<x>9</x>
<y>9</y>
<width>79</width>
<height>31</height>
</rect>
</property>
<property name="text">
<string>Frame label</string>
</property>
</widget>
<widget class="QLabel" name="OffsetLabel">
<property name="geometry">
<rect>
<x>9</x>
<y>48</y>
<width>281</width>
<height>31</height>
</rect>
</property>
<property name="toolTip">
<string>Define an offset from the part frame if needed</string>
</property>
<property name="text">
<string>Offset from part frame</string>
</property>
<property name="alignment">
<set>Qt::AlignCenter</set>
</property>
</widget>
<widget class="QLabel" name="ScaleLabel">
<property name="geometry">
<rect>
<x>160</x>
<y>180</y>
<width>71</width>
<height>21</height>
</rect>
</property>
<property name="toolTip">
<string>Scale of the axis arrows</string>
</property>
<property name="statusTip">
<string>Scale of the axis arrows</string>
</property>
<property name="whatsThis">
<string>Scale of the axis arrows</string>
</property>
<property name="text">
<string>Axis scale</string>
</property>
<property name="alignment">
<set>Qt::AlignLeading|Qt::AlignLeft|Qt::AlignVCenter</set>
</property>
</widget>
<widget class="QDoubleSpinBox" name="ScaleBox">
<property name="geometry">
<rect>
<x>230</x>
<y>180</y>
<width>60</width>
<height>27</height>
</rect>
</property>
<property name="toolTip">
<string>Scale of the axis arrows</string>
</property>
<property name="statusTip">
<string>Scale of the axis arrows</string>
</property>
<property name="whatsThis">
<string>Scale of the axis arrows</string>
</property>
<property name="minimum">
<double>0.100000000000000</double>
</property>
<property name="maximum">
<double>2.000000000000000</double>
</property>
<property name="singleStep">
<double>0.010000000000000</double>
</property>
<property name="value">
<double>0.110000000000000</double>
</property>
</widget>
<widget class="QLabel" name="OptionsLabel">
<property name="enabled">
<bool>true</bool>
</property>
<property name="geometry">
<rect>
<x>20</x>
<y>220</y>
<width>66</width>
<height>31</height>
</rect>
</property>
<property name="visible">
<bool>false</bool>
</property>
<property name="text">
<string>Options</string>
</property>
<property name="buddy">
<cstring>OptionsBox</cstring>
</property>
</widget>
<widget class="QComboBox" name="OptionsBox">
<property name="enabled">
<bool>true</bool>
</property>
<property name="geometry">
<rect>
<x>210</x>
<y>220</y>
<width>78</width>
<height>27</height>
</rect>
</property>
<property name="visible">
<bool>false</bool>
</property>
</widget>
<widget class="QDoubleSpinBox" name="UBox">
<property name="enabled">
<bool>true</bool>
</property>
<property name="geometry">
<rect>
<x>100</x>
<y>250</y>
<width>62</width>
<height>27</height>
</rect>
</property>
<property name="visible">
<bool>false</bool>
</property>
</widget>
<widget class="QDoubleSpinBox" name="VBox">
<property name="enabled">
<bool>true</bool>
</property>
<property name="geometry">
<rect>
<x>220</x>
<y>250</y>
<width>62</width>
<height>27</height>
</rect>
</property>
<property name="visible">
<bool>false</bool>
</property>
</widget>
<widget class="QLabel" name="ULabel">
<property name="enabled">
<bool>true</bool>
</property>
<property name="geometry">
<rect>
<x>80</x>
<y>250</y>
<width>16</width>
<height>31</height>
</rect>
</property>
<property name="visible">
<bool>false</bool>
</property>
<property name="text">
<string>u</string>
</property>
<property name="buddy">
<cstring>UBox</cstring>
</property>
</widget>
<widget class="QLabel" name="VLabel">
<property name="enabled">
<bool>true</bool>
</property>
<property name="geometry">
<rect>
<x>200</x>
<y>250</y>
<width>16</width>
<height>31</height>
</rect>
</property>
<property name="visible">
<bool>false</bool>
</property>
<property name="text">
<string>v</string>
</property>
<property name="buddy">
<cstring>VBox</cstring>
</property>
</widget>
<widget class="QLabel" name="CoordsLabel">
<property name="enabled">
<bool>true</bool>
</property>
<property name="geometry">
<rect>
<x>20</x>
<y>256</y>
<width>51</width>
<height>21</height>
</rect>
</property>
<property name="visible">
<bool>false</bool>
</property>
<property name="text">
<string>Coords:</string>
</property>
</widget>
</widget>
<resources/>
<connections/>
</ui>

View file

@ -1,239 +0,0 @@
<?xml version="1.0" encoding="UTF-8"?>
<ui version="4.0">
<class>Dialog</class>
<widget class="QDialog" name="Dialog">
<property name="geometry">
<rect>
<x>0</x>
<y>0</y>
<width>337</width>
<height>322</height>
</rect>
</property>
<property name="minimumSize">
<size>
<width>337</width>
<height>322</height>
</size>
</property>
<property name="windowTitle">
<string>Dialog</string>
</property>
<widget class="QLabel" name="HoleLabel">
<property name="geometry">
<rect>
<x>20</x>
<y>50</y>
<width>31</width>
<height>21</height>
</rect>
</property>
<property name="text">
<string>Hole</string>
</property>
</widget>
<widget class="QLabel" name="PegPartLabel">
<property name="geometry">
<rect>
<x>60</x>
<y>150</y>
<width>41</width>
<height>21</height>
</rect>
</property>
<property name="text">
<string>Part:</string>
</property>
</widget>
<widget class="QLabel" name="PegFaceLabel">
<property name="geometry">
<rect>
<x>60</x>
<y>170</y>
<width>41</width>
<height>21</height>
</rect>
</property>
<property name="text">
<string>Face:</string>
</property>
</widget>
<widget class="QLabel" name="PegFaceIDField">
<property name="geometry">
<rect>
<x>110</x>
<y>170</y>
<width>231</width>
<height>21</height>
</rect>
</property>
<property name="text">
<string>FaceID</string>
</property>
</widget>
<widget class="QLabel" name="TaskLabel">
<property name="geometry">
<rect>
<x>20</x>
<y>20</y>
<width>71</width>
<height>21</height>
</rect>
</property>
<property name="text">
<string>Task Label</string>
</property>
</widget>
<widget class="QLineEdit" name="TaskLabelField">
<property name="geometry">
<rect>
<x>110</x>
<y>20</y>
<width>211</width>
<height>27</height>
</rect>
</property>
<property name="minimumSize">
<size>
<width>0</width>
<height>0</height>
</size>
</property>
</widget>
<widget class="QPushButton" name="AnimateButton">
<property name="geometry">
<rect>
<x>20</x>
<y>290</y>
<width>131</width>
<height>27</height>
</rect>
</property>
<property name="text">
<string>Animate</string>
</property>
</widget>
<widget class="QPushButton" name="SelectButton">
<property name="geometry">
<rect>
<x>160</x>
<y>290</y>
<width>161</width>
<height>27</height>
</rect>
</property>
<property name="text">
<string>Get from selection</string>
</property>
</widget>
<widget class="QLabel" name="HoleFaceIDField">
<property name="geometry">
<rect>
<x>110</x>
<y>90</y>
<width>231</width>
<height>21</height>
</rect>
</property>
<property name="text">
<string>FaceID</string>
</property>
</widget>
<widget class="QLabel" name="HolePartLabel">
<property name="geometry">
<rect>
<x>60</x>
<y>70</y>
<width>41</width>
<height>21</height>
</rect>
</property>
<property name="text">
<string>Part:</string>
</property>
</widget>
<widget class="QLabel" name="HoleFaceLabel">
<property name="geometry">
<rect>
<x>60</x>
<y>90</y>
<width>41</width>
<height>21</height>
</rect>
</property>
<property name="text">
<string>Face:</string>
</property>
</widget>
<widget class="QLabel" name="PegLabel">
<property name="geometry">
<rect>
<x>20</x>
<y>130</y>
<width>41</width>
<height>21</height>
</rect>
</property>
<property name="text">
<string>Screw</string>
</property>
</widget>
<widget class="QLabel" name="HolePartField">
<property name="geometry">
<rect>
<x>110</x>
<y>70</y>
<width>231</width>
<height>21</height>
</rect>
</property>
<property name="text">
<string>PartLabel</string>
</property>
</widget>
<widget class="QLabel" name="PegPartField">
<property name="geometry">
<rect>
<x>110</x>
<y>150</y>
<width>231</width>
<height>21</height>
</rect>
</property>
<property name="text">
<string>PartLabel</string>
</property>
</widget>
<widget class="QLabel" name="ScrewTypeLabel">
<property name="geometry">
<rect>
<x>30</x>
<y>190</y>
<width>66</width>
<height>17</height>
</rect>
</property>
<property name="text">
<string>Type:</string>
</property>
<property name="alignment">
<set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set>
</property>
</widget>
<widget class="QLabel" name="ScrewTypeField">
<property name="geometry">
<rect>
<x>110</x>
<y>190</y>
<width>161</width>
<height>17</height>
</rect>
</property>
<property name="text">
<string>ThreadType</string>
</property>
</widget>
</widget>
<resources/>
<connections/>
</ui>

View file

@ -1,7 +0,0 @@
import os
import freecad.robossembler.utils
from .version import __version__
UIPATH = os.path.join(os.path.dirname(__file__), "UI")
ICONPATH = os.path.join(os.path.dirname(__file__), "resources/icons")
TRANSLATIONSPATH = os.path.join(os.path.dirname(__file__), "resources/translations")

View file

@ -1,40 +0,0 @@
import json
import networkx as nx
import matplotlib.pyplot as plt
import os
def load_sequences(filename):
with open(filename, 'r') as f:
data = json.load(f)
return data['sequences']
def create_graph(sequences):
G = nx.DiGraph()
#for seq in sequences:
for i in range(len(sequences) - 1):
G.add_edge(sequences[i], sequences[i + 1])
return G
def draw_graph_with_thumbnails(G, image_folder):
pos = {}
x = 1
for node in G.nodes():
pos[node] = (1, -x) # Устанавливаем позиции узлов по вертикали
x += 1
plt.figure(figsize=(8, 6))
nx.draw(G, pos, with_labels=True, node_size=100, node_color='skyblue', font_size=10, font_weight='bold')
# for node, (x, y) in pos.items():
# image_path = f"{image_folder}/{node}.svg"
# if os.path.exists(image_path):
# img = plt.imread(image_path)
# plt.imshow(img, aspect='auto', extent=(x - 0.5, x + 0.5, y - 0.5, y + 0.5), zorder=0)
plt.gca().invert_yaxis() # Инвертируем ось y для вертикального отображения
plt.show()
def main():
sequences = load_sequences('valid_sequences.json')
G = create_graph(sequences)
draw_graph_with_thumbnails(G, '/home/markvoltov/GitProjects/framework/test_models/img')

View file

@ -1,42 +0,0 @@
import json
import networkx as nx
import matplotlib.pyplot as plt
from PIL import Image
import matplotlib.image as mpimg
from networkx.drawing.nx_agraph import graphviz_layout
def load_assembly_sequence(filepath):
with open(filepath, 'r') as file:
return json.load(file)
def create_assembly_graph(sequence):
G = nx.DiGraph()
for i, part in enumerate(sequence):
G.add_node(part, image=f'{part}.svg')
if i > 0:
G.add_edge(sequence[i-1], part)
return G
def draw_graph(G):
pos = graphviz_layout(G, prog='dot')
fig, ax = plt.subplots(figsize=(12, 8))
for node in G.nodes(data=True):
x, y = pos[node[0]]
img = mpimg.imread(node[1]['image'])
ax.imshow(img, aspect='auto', extent=(x-0.5, x+0.5, y-0.5, y+0.5), zorder=1)
ax.text(x, y-0.6, s=node[0], horizontalalignment='center', fontsize=12, zorder=2)
nx.draw_networkx_edges(G, pos, ax=ax, arrows=True)
plt.axis('off')
plt.show()
def main():
sequence = load_assembly_sequence('assembly_sequence.json')
assembly_graph = create_assembly_graph(sequence)
draw_graph(assembly_graph)

View file

@ -1,23 +0,0 @@
import FreeCAD as App
import FreeCADGui as Gui
import Draft
import json
sequence_file = '/home/markvoltov/GitProjects/framework/freecad_workbench/freecad/robossembler/sequences.json'
def load_assembly_sequence(filepath):
with open(filepath, 'r') as file:
sequences = json.load(file)
return sequences
print(load_assembly_sequence(sequence_file))
sequence = load_assembly_sequence(sequence_file)['sequences']
for part in sequence:
_layer = Draft.make_layer()
App.ActiveDocument.recompute()
_layer.Group = App.ActiveDocument.getObjectsByLabel('part')

View file

@ -1,4 +0,0 @@
{
"cadFilePath": "path/to/file",
"outPath": "out/path"
}

View file

@ -1,28 +0,0 @@
import os
import json
import shutil
class FileSystemRepository:
def readJSON(path: str):
return json.loads((open(path)).read())
def recursiveDeleteFolder(path: str):
shutil.rmtree(path)
pass
def deletingOldAndCreatingNewFolder(path: str):
if FileSystemRepository.isExistsPath(path):
FileSystemRepository.recursiveDeleteFolder(path)
os.makedirs(path)
pass
def isExistsPath(path: str):
return os.path.exists(path)
def writeFile(data, filePath, fileName):
file_to_open = filePath + fileName
f = open(file_to_open, "w", encoding="utf-8")
f.write(data)
f.close()

View file

@ -1,18 +0,0 @@
import FreeCAD
def is_object_solid(obj):
"""If obj is solid return True"""
if not isinstance(obj, FreeCAD.DocumentObject):
return False
if not hasattr(obj, 'Shape'):
return False
if not hasattr(obj.Shape, 'Solids'):
return False
if len(obj.Shape.Solids) == 0:
return False
return True

View file

@ -1,32 +0,0 @@
import FreeCAD as App
from helper.file_system_repository import FileSystemRepository
from scenarios.robossembler_freecad_export_scenari import (
RobossemblerFreeCadExportScenario,
)
import FreeCADGui as Gui
import FreeCAD as App
import os
def main():
try:
print(os.path.join(os.path.dirname(__file__)) + "/env.json")
env = FileSystemRepository.readJSON(
os.path.join(os.path.dirname(__file__)) + "/env.json"
)
App.openDocument(env.get("cadFilePath"))
RobossemblerFreeCadExportScenario.call(env.get("outPath"))
App.closeDocument(App.ActiveDocument.Name)
freecadQTWindow = Gui.getMainWindow()
freecadQTWindow.close()
except ValueError:
freecadQTWindow = Gui.getMainWindow()
freecadQTWindow.close()
main()

View file

@ -1,13 +0,0 @@
from enum import Enum
class FilesGenerator(Enum):
DETAIL = 'detail.json'
ASSEMBLY = 'assembly.json'
class FolderGenerator(Enum):
MESHES = 'meshes'
ASSETS = 'assets'
SDF = 'sdf'
ASSEMBlY = 'assembly'

View file

@ -1,86 +0,0 @@
from typing import Any, TypeVar, Type, cast
T = TypeVar("T")
def from_float(x: Any) -> float:
assert isinstance(x, (float, int)) and not isinstance(x, bool)
return float(x)
def to_float(x: Any) -> float:
assert isinstance(x, float)
return x
def to_class(c: Type[T], x: Any) -> dict:
assert isinstance(x, c)
return cast(Any, x).to_dict()
class Axis:
x: float
y: float
z: float
def __init__(self, x: float, y: float, z: float) -> None:
self.x = x
self.y = y
self.z = z
@staticmethod
def from_dict(obj: Any) -> 'Axis':
assert isinstance(obj, dict)
x = from_float(obj.get("x"))
y = from_float(obj.get("y"))
z = from_float(obj.get("z"))
return Axis(x, y, z)
def to_dict(self) -> dict:
result: dict = {}
result["x"] = to_float(self.x)
result["y"] = to_float(self.y)
result["z"] = to_float(self.z)
return result
class GeometryPart:
euler: Axis
position: Axis
rotation: Axis
center: Axis
def __init__(self, euler: Axis, position: Axis, rotation: Axis, center: Axis) -> None:
self.euler = euler
self.position = position
self.rotation = rotation
self.center = center
@staticmethod
def from_dict(obj: Any) -> 'GeometryPart':
assert isinstance(obj, dict)
euler = Axis.from_dict(obj.get("euler"))
position = Axis.from_dict(obj.get("position"))
rotation = Axis.from_dict(obj.get("rotation"))
center = Axis.from_dict(obj.get("center"))
return GeometryPart(euler, position, rotation, center)
def to_dict(self) -> dict:
result: dict = {}
result["euler"] = to_class(Axis, self.euler)
result["position"] = to_class(Axis, self.position)
result["rotation"] = to_class(Axis, self.rotation)
result["center"] = to_class(Axis, self.center)
return result
def toJson(self) -> str:
return str(self.to_dict()).replace('\'', '"')
def geometry_part_from_dict(s: Any) -> GeometryPart:
return GeometryPart.from_dict(s)
def geometry_part_to_dict(x: GeometryPart) -> Any:
return to_class(GeometryPart, x)

View file

@ -1,33 +0,0 @@
import FreeCAD
import Mesh
import FreeCAD as App
from model.mesh_part_model import MeshPartModel
class JoinMeshModel:
id = None
mesh = None
def __init__(self, meshesPartModels: list['MeshPartModel']) -> None:
meshes = []
import Mesh
from random import randrange
for el in meshesPartModels:
meshes.append(el.mesh.Mesh)
self.id = 'MergedMesh' + str(randrange(1000000))
document = App.ActiveDocument
merged_mesh = Mesh.Mesh()
for el in meshes:
merged_mesh.addMesh(el)
new_obj = App.activeDocument().addObject("Mesh::Feature", self.id)
new_obj.Mesh = merged_mesh
new_obj.ViewObject.DisplayMode = "Flat Lines" # Set display mode to flat lines
self.mesh = new_obj
def remove(self):
try:
App.ActiveDocument.removeObject(self.id)
except Exception as e:
print(e)

View file

@ -1,32 +0,0 @@
import FreeCAD as App
import uuid
import Mesh
import Part
# import PartGui
import MeshPart
class MeshPartModel:
id = None
mesh = None
def __init__(self, part) -> None:
try:
from random import randrange
self.id = 'mesh' + str(randrange(1000000))
document = App.ActiveDocument
mesh = document.addObject("Mesh::Feature", self.id)
shape = Part.getShape(part, "")
mesh.Mesh = MeshPart.meshFromShape(
Shape=shape, LinearDeflection=20, AngularDeflection=0.1, Relative=False)
mesh.Label = self.id
self.mesh = mesh
except Exception as e:
print(e)
pass
def remove(self):
try:
App.ActiveDocument.removeObject(self.mesh.Label)
except Exception as e:
print(e)

View file

@ -1,141 +0,0 @@
from dataclasses import dataclass
from typing import Any, List, TypeVar, Callable, Type, cast
T = TypeVar("T")
def from_str(x: Any) -> str:
assert isinstance(x, str)
return x
def from_list(f: Callable[[Any], T], x: Any) -> List[T]:
assert isinstance(x, list)
return [f(y) for y in x]
def to_class(c: Type[T], x: Any) -> dict:
assert isinstance(x, c)
return cast(Any, x).to_dict()
@dataclass
class Asset:
name: str
ixx: str
ixy: str
ixz: str
iyy: str
izz: str
mass: str
posX: str
posY: str
posZ: str
eulerX: str
eulerY: str
eulerZ: str
iyz: str
meshPath: str
friction: str
centerMassX: str
centerMassY: str
centerMassZ: str
@staticmethod
def from_dict(obj: Any) -> "Asset":
assert isinstance(obj, dict)
name = from_str(obj.get("name"))
ixx = from_str(obj.get("ixx"))
ixy = from_str(obj.get("ixy"))
ixz = from_str(obj.get("ixz"))
iyy = from_str(obj.get("iyy"))
izz = from_str(obj.get("izz"))
mass = from_str(obj.get("mass"))
posX = from_str(obj.get("posX"))
posY = from_str(obj.get("posY"))
posZ = from_str(obj.get("posZ"))
eulerX = from_str(obj.get("eulerX"))
eulerY = from_str(obj.get("eulerY"))
eulerZ = from_str(obj.get("eulerZ"))
iyz = from_str(obj.get("iyz"))
meshPath = from_str(obj.get("meshPath"))
friction = from_str(obj.get("friction"))
centerMassX = from_str(obj.get("centerMassX"))
centerMassY = from_str(obj.get("centerMassY"))
centerMassZ = from_str(obj.get("centerMassZ"))
return Asset(
name,
ixx,
ixy,
ixz,
iyy,
izz,
mass,
posX,
posY,
posZ,
eulerX,
eulerY,
eulerZ,
iyz,
meshPath,
friction,
centerMassX,
centerMassY,
centerMassZ,
)
def to_dict(self) -> dict:
result: dict = {}
result["name"] = from_str(self.name)
result["ixx"] = from_str(self.ixx)
result["ixy"] = from_str(self.ixy)
result["ixz"] = from_str(self.ixz)
result["iyy"] = from_str(self.iyy)
result["izz"] = from_str(self.izz)
result["mass"] = from_str(self.mass)
result["posX"] = from_str(self.posX)
result["posY"] = from_str(self.posY)
result["posZ"] = from_str(self.posZ)
result["eulerX"] = from_str(self.eulerX)
result["eulerY"] = from_str(self.eulerY)
result["eulerZ"] = from_str(self.eulerZ)
result["iyz"] = from_str(self.iyz)
result["meshPath"] = from_str(self.meshPath)
result["friction"] = from_str(self.friction)
result["centerMassX"] = from_str(self.centerMassX)
result["centerMassY"] = from_str(self.centerMassY)
result["centerMassZ"] = from_str(self.centerMassZ)
return result
@dataclass
class RobossemblerAssets:
assets: List[Asset]
instances: List[Any]
@staticmethod
def from_dict(obj: Any) -> "RobossemblerAssets":
assert isinstance(obj, dict)
assets = from_list(Asset.from_dict, obj.get("assets"))
instances = from_list(lambda x: x, obj.get("instances"))
return RobossemblerAssets(assets, instances)
def to_dict(self) -> dict:
result: dict = {}
result["assets"] = from_list(lambda x: to_class(Asset, x), self.assets)
result["instances"] = from_list(lambda x: x, self.instances)
return result
def toJson(self) -> str:
print(self.to_dict())
return str(self.to_dict()).replace("'", '"')
def RobossemblerAssetsfromdict(s: Any) -> RobossemblerAssets:
return RobossemblerAssets.from_dict(s)
def RobossemblerAssetstodict(x: RobossemblerAssets) -> Any:
return to_class(RobossemblerAssets, x)

View file

@ -1,158 +0,0 @@
import json
def from_str(x):
assert isinstance(x, str)
return x
def from_none(x):
assert x is None
return x
def from_union(fs, x):
for f in fs:
try:
return f(x)
except:
pass
assert False
def to_class(c, x):
assert isinstance(x, c)
return x.to_dict()
class SdfGeometryModel:
def __init__(
self,
name,
ixx,
ixy,
ixz,
iyy,
izz,
mass,
posX,
posY,
posZ,
eulerX,
eulerY,
eulerZ,
iyz,
meshPath,
friction,
centerMassX,
centerMassY,
centerMassZ,
):
self.name = name
self.ixx = ixx
self.ixy = ixy
self.ixz = ixz
self.iyy = iyy
self.izz = izz
self.mass = mass
self.posX = posX
self.posY = posY
self.posZ = posZ
self.eulerX = eulerX
self.eulerY = eulerY
self.eulerZ = eulerZ
self.iyz = iyz
self.meshPath = meshPath
self.friction = friction
self.centerMassX = centerMassX
self.centerMassY = centerMassY
self.centerMassZ = centerMassZ
@staticmethod
def from_dict(obj):
assert isinstance(obj, dict)
name = from_union([from_str, from_none], obj.get("name"))
ixx = from_union([from_str, from_none], obj.get("ixx"))
ixy = from_union([from_str, from_none], obj.get("ixy"))
ixz = from_union([from_str, from_none], obj.get("ixz"))
iyy = from_union([from_str, from_none], obj.get("iyy"))
iyz = from_union([from_str, from_none], obj.get("iyz"))
izz = from_union([from_str, from_none], obj.get("izz"))
mass = from_union([from_str, from_none], obj.get("mass"))
posX = from_union([from_str, from_none], obj.get("posX"))
posY = from_union([from_str, from_none], obj.get("posY"))
posZ = from_union([from_str, from_none], obj.get("posZ"))
eulerX = from_union([from_str, from_none], obj.get("eulerX"))
eulerY = from_union([from_str, from_none], obj.get("eulerY"))
eulerZ = from_union([from_str, from_none], obj.get("eulerZ"))
meshPath = from_union([from_str, from_none], obj.get("meshPath"))
friction = from_union([from_str, from_none], obj.get("friction"))
centerMassX = from_union([from_str, from_none], obj.get("centerMassX"))
centerMassY = from_union([from_str, from_none], obj.get("centerMassY"))
centerMassZ = from_union([from_str, from_none], obj.get("centerMassZ"))
return SdfGeometryModel(
name,
ixx,
ixy,
ixz,
iyy,
izz,
mass,
posX,
posY,
posZ,
eulerX,
eulerY,
eulerZ,
iyz,
meshPath,
friction,
centerMassX,
centerMassY,
centerMassZ,
)
def to_dict(self):
result = {}
if self.name is not None:
result["name"] = from_union([from_str, from_none], self.name)
if self.ixx is not None:
result["ixx"] = from_union([from_str, from_none], self.ixx)
if self.ixy is not None:
result["ixy"] = from_union([from_str, from_none], self.ixy)
if self.ixz is not None:
result["ixz"] = from_union([from_str, from_none], self.ixz)
if self.iyy is not None:
result["iyy"] = from_union([from_str, from_none], self.iyy)
if self.izz is not None:
result["izz"] = from_union([from_str, from_none], self.izz)
if self.mass is not None:
result["mass"] = from_union([from_str, from_none], self.mass)
if self.posX is not None:
result["posX"] = from_union([from_str, from_none], self.posX)
if self.posY is not None:
result["posY"] = from_union([from_str, from_none], self.posY)
if self.posZ is not None:
result["posZ"] = from_union([from_str, from_none], self.posZ)
if self.eulerX is not None:
result["eulerX"] = from_union([from_str, from_none], self.eulerX)
if self.eulerY is not None:
result["eulerY"] = from_union([from_str, from_none], self.eulerY)
if self.eulerZ is not None:
result["eulerZ"] = from_union([from_str, from_none], self.eulerZ)
if self.iyz is not None:
result["iyz"] = from_union([from_str, from_none], self.iyz)
if self.meshPath is not None:
result["meshPath"] = from_union([from_str, from_none], self.meshPath)
if self.friction is not None:
result["friction"] = from_union([from_str, from_none], self.eulerZ)
if self.centerMassX is not None:
result["centerMassX"] = from_union([from_str, from_none], self.centerMassX)
if self.centerMassY is not None:
result["centerMassY"] = from_union([from_str, from_none], self.centerMassY)
if self.centerMassZ is not None:
result["centerMassZ"] = from_union([from_str, from_none], self.centerMassZ)
return result
def toJSON(self) -> str:
return str(self.to_dict()).replace("'", '"')

View file

@ -1,30 +0,0 @@
import FreeCAD as App
import Part
class SimpleCopyPartModel:
id = None
copyLink = None
label = None
part = None
def getPart(self):
return self.part
def __init__(self, part) -> None:
try:
from random import randrange
self.id = str(randrange(1000000))
childObj = part
__shape = Part.getShape(
childObj, '', needSubElement=False, refine=False)
obj = App.ActiveDocument.addObject('Part::Feature', self.id)
obj.Shape = __shape
self.part = obj
self.label = obj.Label
App.ActiveDocument.recompute()
except Exception as e:
print(e)
def remove(self):
App.ActiveDocument.removeObject(self.label)

View file

@ -1,40 +0,0 @@
from model.robosembler_assets import RobossemblerAssets
from usecases.export_assembly_them_all_usecase import ExportAssemblyThemAllUseCase
import FreeCAD
from usecases.export_usecase import EXPORT_TYPES, ExportUseCase
from usecases.get_sdf_geometry_usecase import GeometryUseCase
from usecases.assembly_parse_usecase import AssemblyParseUseCase
from model.files_generator import FolderGenerator
from helper.file_system_repository import FileSystemRepository
import os
import json
class RobossemblerFreeCadExportScenario:
def call(path):
directory = path
__objs__ = FreeCAD.ActiveDocument.RootObjects
directoryExport = directory + "/"
FileSystemRepository.deletingOldAndCreatingNewFolder(
directoryExport + FolderGenerator.MESHES.value
)
RobossemblerFreeCadExportScenario.geometry(directory)
ExportAssemblyThemAllUseCase().call(directoryExport)
return True
def geometry(outPutsPath: str):
exportUseCase = ExportUseCase.call(outPutsPath, EXPORT_TYPES.OBJ)
# for el in GeometryUseCase().call(exportUseCase):
# FileSystemRepository.writeFile(el.toJSON(), outPutsPath + '/' + FolderGenerator.ASSETS.value + '/', el.name + '.json',)
assets = []
for el in GeometryUseCase().call(exportUseCase):
assets.append(el)
robossemblerAssets = RobossemblerAssets(assets=assets, instances=[]).toJson()
FileSystemRepository.writeFile(
robossemblerAssets,
outPutsPath,
"robossembler_assets.json",
)

View file

@ -1,53 +0,0 @@
import FreeCAD as App
class Asm4StructureParseUseCase:
_parts = []
_label = []
def getSubPartsLabel(self, group):
groupLabel = []
for el in group:
if str(el) == '<Part::PartFeature>':
groupLabel.append(el.Label)
return groupLabel
def parseLabel(self, nextGroup, label, level=2, nextGroupParse=0):
if nextGroup.__len__() == nextGroupParse:
return
else:
groupParts = []
for el in nextGroup:
if str(el) == '<App::Link object>':
groupParts.append(el)
for el in groupParts:
if str(el) == '<App::Link object>':
label.append({
"level": level,
"attachedTo": el.AttachedTo.split('#'),
"label": el.Label,
"axis": self.getSubPartsLabel(el.Group)
})
def initParse(self):
model = App.ActiveDocument.RootObjects[1]
self._label.append({
"level": 1,
"attachedTo": "Parent Assembly",
"label": model.Label,
"axis": self.getSubPartsLabel(model.Group)
})
for parent in model.Group:
if str(parent) == '<App::Link object>':
self._label.append({
"level": 1,
"attachedTo": parent.AttachedTo.split('#'),
"label": parent.Label,
"axis": self.getSubPartsLabel(parent.Group)
})
print(self._label)

View file

@ -1,58 +0,0 @@
import FreeCAD as App
def is_object_solid(obj):
"""If obj is solid return True"""
if not isinstance(obj, App.DocumentObject):
return False
if hasattr(obj, 'Group'):
return False
if not hasattr(obj, 'Shape'):
return False
# if not hasattr(obj.Shape, 'Mass'):
# return False
if not hasattr(obj.Shape, 'Solids'):
return False
if len(obj.Shape.Solids) == 0:
return False
return True
class AssemblyParseUseCase:
_parts = []
_asm = []
def getAsm(self):
return self._asm
def __init__(self) -> None:
if (self._asm.__len__() == 0):
self.initParse()
pass
def initParse(self):
for el in App.ActiveDocument.Objects:
if (is_object_solid(el)):
self._asm.append(el.Label)
def toJson(self):
return str(self._asm).replace('\'', "\"")
def getSubPartsLink(self, group):
groupLink = {}
for el in group:
if (is_object_solid(el)):
if str(el.Shape).find('Solid') != -1:
if groupLink.get(el.Label) == None:
groupLink[el.Label] = []
for i in el.Group:
if str(i).find('Pad') != -1:
groupLink[el.Label].append(i)
if groupLink.__len__() == 0:
return None
return groupLink
def getLinkedProperty(self):
return self._asm

View file

@ -1,118 +0,0 @@
from typing import List
import FreeCAD as App
import Part
from model.join_mesh_model import JoinMeshModel
from model.mesh_part_model import MeshPartModel
from helper.file_system_repository import FileSystemRepository
from helper.is_solid import is_object_solid
from model.simple_copy_part_model import SimpleCopyPartModel
from model.files_generator import FolderGenerator
from usecases.assembly_parse_usecase import AssemblyParseUseCase
import os
import json
class ExportAssemblyThemAllUseCase:
def call(self, path):
assembly = AssemblyParseUseCase().getAsm()
asmStructure = {}
inc = 0
for el in assembly:
if inc != 0:
asmStructure[inc] = {"child": el, "parents": assembly[0:inc]}
inc += 1
objectsFreeCad = App.ActiveDocument.Objects
asmSolids = {}
for k, v in asmStructure.items():
assemblyParentList = v["parents"]
assemblyChild = v["child"]
for el in assemblyParentList:
for solid in objectsFreeCad:
if el == solid.Label:
if asmSolids.get(k) is None:
asmSolids[k] = {
"parents": [],
"child": list(
filter(
lambda x: x.Label == assemblyChild,
objectsFreeCad,
)
)[0],
}
asmSolids[k]["parents"].append(solid)
inc = 0
for k, v in asmSolids.items():
geometry = {"0": [], "1": []}
if k != 0:
App.activeDocument().addObject("Part::Compound", "Compound")
copyLinks = list(map(lambda el: SimpleCopyPartModel(el), v["parents"]))
if copyLinks != None:
App.activeDocument().Compound.Links = list(
map(lambda el: el.getPart(), copyLinks)
)
object = App.activeDocument().getObject("Compound")
boundBox = object.Shape.BoundBox
geometry["0"].append(boundBox.XMax)
geometry["0"].append(boundBox.YMax)
geometry["0"].append(boundBox.ZMax)
os.makedirs(
path + FolderGenerator.ASSEMBlY.value + "/" + "0000" + str(k)
)
boundBoxChild = v["child"].Shape.BoundBox
geometry["1"].append(boundBoxChild.XMax)
geometry["1"].append(boundBoxChild.YMax)
geometry["1"].append(boundBoxChild.ZMax)
meshParents = []
for el in v["parents"]:
meshParents.append(MeshPartModel(el))
joinMesh = JoinMeshModel(meshParents)
for el in meshParents:
el.remove()
import importOBJ
importOBJ.export(
joinMesh.mesh,
path
+ FolderGenerator.ASSEMBlY.value
+ "/"
+ "0000"
+ str(k)
+ "/"
+ str(1)
+ ".obj",
)
joinMesh.remove()
importOBJ.export(
v["child"],
path
+ FolderGenerator.ASSEMBlY.value
+ "/"
+ "0000"
+ str(k)
+ "/"
+ str(0)
+ ".obj",
)
FileSystemRepository.writeFile(
json.dumps(geometry),
path
+ FolderGenerator.ASSEMBlY.value
+ "/"
+ "0000"
+ str(k)
+ "/",
"translation.json",
)
App.ActiveDocument.removeObject("Compound")
for el in copyLinks:
el.remove()
App.activeDocument().recompute()
inc += 1

View file

@ -1,35 +0,0 @@
# import importDAE
import Mesh
import FreeCAD as App
from model.files_generator import FolderGenerator
from helper.is_solid import is_object_solid
from enum import Enum
class EXPORT_TYPES(Enum):
STL = "STL"
DAO = "DAO"
OBJ = "OBJ"
class ExportUseCase:
def call(path: str, type: EXPORT_TYPES):
meshes = {}
for el in App.ActiveDocument.Objects:
if is_object_solid(el):
match type.value:
case EXPORT_TYPES.OBJ.value:
import importOBJ
importOBJ.export(
[el],
path
+ FolderGenerator.MESHES.value
+ "/"
+ el.Label
+ ".obj",
)
meshes[el.Label] = (
"/" + FolderGenerator.MESHES.value + "/" + el.Label + ".obj"
)
return meshes

View file

@ -1,58 +0,0 @@
import FreeCAD as App
from helper.is_solid import is_object_solid
class GeometryUseCase:
def call() -> dict:
labels = []
Error = False
for el in App.ActiveDocument.Objects:
try:
if is_object_solid(el):
labels.append(el.Label)
geometry = {
"euler": {
"x": None,
"y": None,
"z": None
},
"position": {
"x": None,
"y": None,
"z": None
},
"rotation": {
"x": None,
"y": None,
"z": None
},
"center": {
"x": None,
"y": None,
"z": None
},
}
boundBox = el.Shape.BoundBox
geometry["center"]["x"] = boundBox.Center.x
geometry["center"]["y"] = boundBox.Center.y
geometry["center"]["z"] = boundBox.Center.z
geometry["position"]['x'] = boundBox.XMax
geometry["position"]['y'] = boundBox.YMax
geometry["position"]['z'] = boundBox.ZMax
rotation = el.Placement.Rotation
geometry["rotation"]['x'] = rotation.Axis.z
geometry["rotation"]['y'] = rotation.Axis.y
geometry["rotation"]['z'] = rotation.Axis.z
euler = el.Placement.Rotation.toEuler()
geometry["euler"]['x'] = euler[0]
geometry["euler"]['y'] = euler[1]
geometry["euler"]['z'] = euler[2]
except Exception as e:
print(e)
# App.Console.PrintMessage("Clicked on position: ("+str(pos[0])+", "+str(pos[1])+")\n")
return {"geometry": geometry, "labels": labels, "label": el.Label}

View file

@ -1,74 +0,0 @@
import FreeCAD as App
from model.robosembler_assets import Asset
from model.sdf_geometry_model import SdfGeometryModel
from helper.is_solid import is_object_solid
class GeometryUseCase:
ShapePropertyCheck = [
"Mass",
"MatrixOfInertia",
"Placement",
]
PartPropertyCheck = ["Shape"]
def call(self, stlPaths: dict) -> list[Asset]:
materialSolid = {}
for el in App.ActiveDocument.Objects:
if str(el) == "<App::MaterialObjectPython object>":
friction = el.Material.get("SlidingFriction")
for i in el.References:
materialSolid[i[0].Label] = friction
geometry = []
try:
for el in App.ActiveDocument.Objects:
if is_object_solid(el):
mass = el.Shape.Mass
inertia = el.Shape.MatrixOfInertia
pos = el.Shape.Placement
inertia = el.Shape.MatrixOfInertia
name = el.Label
delimiter = 1000000
ixx = str(inertia.A11 / delimiter)
ixy = str(inertia.A12 / delimiter)
ixz = str(inertia.A13 / delimiter)
iyy = str(inertia.A22 / delimiter)
iyz = str(inertia.A23 / delimiter)
izz = str(inertia.A33 / delimiter)
massSDF = str(mass / delimiter)
posX = str(pos.Base[0] / delimiter)
posY = str(pos.Base[1] / delimiter)
posZ = str(pos.Base[2] / delimiter)
eulerX = str(pos.Rotation.toEuler()[0])
eulerY = str(pos.Rotation.toEuler()[1])
eulerZ = str(pos.Rotation.toEuler()[2])
centerMassX = str(el.Shape.CenterOfMass[0])
centerMassY = str(el.Shape.CenterOfMass[1])
centerMassZ = str(el.Shape.CenterOfMass[2])
geometry.append(
Asset(
meshPath=stlPaths.get(el.Label),
name=name,
ixx=ixx,
ixz=ixz,
ixy=ixy,
iyy=iyy,
iyz=iyz,
izz=izz,
mass=massSDF,
posX=posX,
posY=posY,
posZ=posZ,
eulerX=eulerX,
eulerY=eulerY,
eulerZ=eulerZ,
friction=materialSolid.get(el.Label) or "",
centerMassX=centerMassX,
centerMassY=centerMassY,
centerMassZ=centerMassZ,
)
)
except Exception as e:
print(e)
return geometry

View file

@ -1,96 +0,0 @@
# Byte-compiled / optimized / DLL files
__pycache__/
*.py[cod]
*$py.class
# C extensions
*.so
# Distribution / packaging
.Python
env/
build/
develop-eggs/
dist/
downloads/
eggs/
.eggs/
lib/
lib64/
parts/
sdist/
var/
wheels/
*.egg-info/
.installed.cfg
*.egg
# PyInstaller
# Usually these files are written by a python script from a template
# before PyInstaller builds the exe, so as to inject date/other infos into it.
*.manifest
*.spec
# Installer logs
pip-log.txt
pip-delete-this-directory.txt
# Unit test / coverage reports
htmlcov/
.tox/
.coverage
.coverage.*
.cache
nosetests.xml
coverage.xml
*,cover
.hypothesis/
# Translations
*.mo
*.pot
# Django stuff:
*.log
local_settings.py
# Flask stuff:
instance/
.webassets-cache
# Scrapy stuff:
.scrapy
# Sphinx documentation
docs/_build/
# PyBuilder
target/
# Jupyter Notebook
.ipynb_checkpoints
# pyenv
.python-version
# celery beat schedule file
celerybeat-schedule
# SageMath parsed files
*.sage.py
# dotenv
.env
# virtualenv
.venv
venv/
ENV/
# Spyder project settings
.spyderproject
# Rope project settings
.ropeproject
env.json
out/

View file

@ -1,461 +0,0 @@
# Алгоритм генерации графа с помощью оценки стабильности подсборок в физическом движке PyBullet
from typing import Any, TypeVar, Type, cast
import FreeCAD as App
import json
import importOBJ
import Draft
import os
import Part
import numpy as np
from typing import TypeAlias
import FreeCADGui as Gui
ISequencesUnion: TypeAlias = dict[str : dict[str : list[str]]]
def importObjAtPath(path: str, inc: int):
try:
importOBJ.insert("" + path, App.ActiveDocument.Label)
mesh = App.ActiveDocument.Objects[inc]
shape = Part.Shape()
shape.makeShapeFromMesh(mesh.Mesh.Topology, 0.05)
solid = Part.makeSolid(shape)
Part.show(solid)
App.ActiveDocument.Objects[inc + 1].Label = App.ActiveDocument.Objects[inc].Name
App.ActiveDocument.removeObject(App.ActiveDocument.Objects[inc].Name)
return App.ActiveDocument.Objects[inc]
except:
print("path")
print(path)
print("inc")
print(inc)
T = TypeVar("T")
def from_float(x: Any) -> float:
assert isinstance(x, (float, int)) and not isinstance(x, bool)
return float(x)
def to_float(x: Any) -> float:
assert isinstance(x, float)
return x
def from_str(x: Any) -> str:
assert isinstance(x, str)
return x
def to_class(c: Type[T], x: Any) -> dict:
assert isinstance(x, c)
return cast(Any, x).to_dict()
def euler_to_quaternion(yaw, pitch, roll):
qx = np.sin(roll / 2) * np.cos(pitch / 2) * np.cos(yaw / 2) - np.cos(
roll / 2
) * np.sin(pitch / 2) * np.sin(yaw / 2)
qy = np.cos(roll / 2) * np.sin(pitch / 2) * np.cos(yaw / 2) + np.sin(
roll / 2
) * np.cos(pitch / 2) * np.sin(yaw / 2)
qz = np.cos(roll / 2) * np.cos(pitch / 2) * np.sin(yaw / 2) - np.sin(
roll / 2
) * np.sin(pitch / 2) * np.cos(yaw / 2)
qw = np.cos(roll / 2) * np.cos(pitch / 2) * np.cos(yaw / 2) + np.sin(
roll / 2
) * np.sin(pitch / 2) * np.sin(yaw / 2)
return [qx, qy, qz, qw]
class Coords:
x: float
y: float
z: float
def __init__(self, x: float, y: float, z: float) -> None:
self.x = x
self.y = y
self.z = z
@staticmethod
def from_dict(obj: Any) -> "Coords":
assert isinstance(obj, dict)
x = from_float(obj.get("x"))
y = from_float(obj.get("y"))
z = from_float(obj.get("z"))
return Coords(x, y, z)
def to_dict(self) -> dict:
result: dict = {}
result["x"] = to_float(self.x)
result["y"] = to_float(self.y)
result["z"] = to_float(self.z)
return result
def vector(self):
return App.Vector(self.x, self.y, self.z)
class MotionResultModel:
id: str
quaternion: Coords
position: Coords
def __init__(self, id: str, quaternion: Coords, position: Coords) -> None:
self.id = id
self.quaternion = quaternion
self.position = position
@staticmethod
def from_dict(obj: Any) -> "MotionResultModel":
id = from_str(obj.get("id"))
quaternion = Coords.from_dict(obj.get("quaternion"))
position = Coords.from_dict(obj.get("position"))
return MotionResultModel(id, quaternion, position)
def to_dict(self) -> dict:
result: dict = {}
result["id"] = from_str(self.id)
result["quaternion"] = to_class(Coords, self.quaternion)
result["position"] = to_class(Coords, self.position)
return result
class SequencesEvaluation:
sequences: ISequencesUnion
assemblyDir: str
result: dict = {}
def __init__(self, sequences, assemblyDir) -> None:
self.sequences = sequences
self.assemblyDir = assemblyDir
pass
def assemblyComputed(self):
isOk = True
for sequenceNumber, v in self.sequences.items():
for assemblyNumber, assemblySequenced in v.items():
if isOk:
# sequenceNumber += 1
isOk = False
self.comptedAssembly(
assemblySequenced, sequenceNumber, assemblyNumber
)
pass
def comptedAssembly(
self, assembly: list[str], sequenceNumber: int, assemblyNumber: int
):
assemblyParts = []
for counter in range(len(assembly)):
importObjAtPath(
self.assemblyDir + "generation/meshes/" + assembly[counter] + ".obj",
counter,
)
assemblyParts.append(
{"part": App.ActiveDocument.Objects[counter], "name": assembly[counter]}
)
motionResult = json.loads(
(
open(
self.assemblyDir
+ "stability"
+ "/"
+ str(sequenceNumber + 1)
+ "/"
+ str(assemblyNumber)
+ "/"
+ "motion_result.json"
)
).read()
)
simulatorMotionResults: list["MotionResultModel"] = []
for _k, v in motionResult.items():
print(v)
simulatorMotionResults.append(MotionResultModel.from_dict(v))
for el in simulatorMotionResults:
for e in assemblyParts:
# сопоставляем детали
if el.id == e.get("name"):
# вычисляем центр детали для перемещения
center = e.get("part").Shape.CenterOfMass
# получаем центр деталей из симуляции
new_center = App.Vector(el.position.vector())
# вычисляем вектор смещения
offset = new_center - center
# перемещаем деталь на вектор смещения
e.get("part").Placement.Base += offset
# # импортируем меш связанный с зоной обьекта
zonePart = importObjAtPath(
self.assemblyDir
+ "stability/zones/meshes/zone_sub_assembly"
+ str(assembly.__len__() - 1)
+ ".obj",
len(App.ActiveDocument.Objects),
)
# # получаем координаты зоны относительно детали за которой закреплена зона
coords = json.loads(
(
open(
self.assemblyDir
+ "stability/zones/sub_assembly_coords_"
+ str(assemblyNumber - 1)
+ ".json"
)
).read()
)
assemblyCounter = len(assemblyParts)
detailWhichZoneBindings = assemblyParts[assemblyCounter - 2].get("part")
detailStabilityComputed = assemblyParts[assemblyCounter - 1].get("part")
relativeCoordinates = coords.get("relativeCoordinates")
relativeEuler = coords.get("relativeEuler")
specificEuler = {
"yaw": detailWhichZoneBindings.Placement.Rotation.toEuler()[0]
- relativeEuler.get("yaw"),
"pitch": detailWhichZoneBindings.Placement.Rotation.toEuler()[1]
- relativeEuler.get("pitch"),
"roll": detailWhichZoneBindings.Placement.Rotation.toEuler()[2]
- relativeEuler.get("roll"),
}
quaternion = euler_to_quaternion(
specificEuler.get("yaw"),
specificEuler.get("pitch"),
specificEuler.get("roll"),
)
rotation = App.Rotation(
quaternion[0], quaternion[1], quaternion[2], quaternion[3]
)
detailStabilityComputed.Placement.Rotation = rotation
centerVector = detailWhichZoneBindings.Shape.CenterOfMass
vector = App.Vector(
relativeCoordinates.get("x"),
relativeCoordinates.get("y"),
relativeCoordinates.get("z"),
)
print(vector)
# TODO
current_center = zonePart.Shape.CenterOfMass
move_vector = App.Vector(centerVector + vector) - current_center
zonePart.Placement.move(move_vector)
computedStabilityResult = computedStability(zonePart, detailStabilityComputed)
if sequenceNumber not in self.result.keys():
self.result[sequenceNumber] = []
self.result[sequenceNumber].append(
{str(assemblyNumber): assembly, "result": computedStabilityResult}
)
# for part in App.ActiveDocument.Objects:
# App.ActiveDocument.removeObject(part.Name)
def get_part_center(part):
shape = None
if not hasattr(part, "Shape"):
shape = part.Mesh
if hasattr(part, "Shape"):
shape = part.Shape
center = shape.BoundBox.Center
return App.Vector(center[0], center[1], center[2])
def move_second_part_to_match_center(first_part, second_part):
first_center = get_part_center(first_part)
second_center = get_part_center(second_part)
offset = first_center - second_center
second_part.Placement.move(offset)
def create(part):
clone = Draft.make_clone([part], forcedraft=True)
clone.Scale = App.Vector(1.30, 1.30, 1.30)
clone_corr = (
App.Vector(0.4476673941774023, -2.109332894191716, -0.5918687740295264)
- clone.Placement.Base
).scale(*App.Vector(-0.25, -0.25, -0.25))
clone.Placement.move(clone_corr)
App.ActiveDocument.recompute()
return clone
def getFullPathObj(assemblyFolder: str, name: str):
return assemblyFolder + "sdf/meshes/" + name + ".obj"
def computedStability(refElement, childElement):
rootElement = childElement.Shape.BoundBox
# Создание обьекта на котором делается операция пересечения
App.activeDocument().addObject("Part::MultiCommon", "Common")
App.activeDocument().Common.Shapes = [
refElement,
childElement,
]
App.ActiveDocument.getObject("Common").ViewObject.ShapeColor = getattr(
App.ActiveDocument.getObject(refElement.Name).getLinkedObject(True).ViewObject,
"ShapeColor",
App.ActiveDocument.getObject("Common").ViewObject.ShapeColor,
)
App.ActiveDocument.getObject("Common").ViewObject.DisplayMode = getattr(
App.ActiveDocument.getObject(childElement.Name)
.getLinkedObject(True)
.ViewObject,
"DisplayMode",
App.ActiveDocument.getObject("Common").ViewObject.DisplayMode,
)
App.ActiveDocument.recompute()
obj = App.ActiveDocument.getObjectsByLabel("Common")[0]
shp = obj.Shape
bbox = shp.BoundBox
# Если после операции пересечения зона обьекта совпадает с зоной тестируемого обьекта то тест прошел успешно
if (
bbox.XLength == rootElement.XLength
and bbox.YLength == rootElement.YLength
and rootElement.ZLength == bbox.ZLength
):
return True
return False
def autoStabilityZoneComputed(stepFilesPaths: list[str], directoryStableZonesPath: str):
cadObjects = []
for count in range(len(stepFilesPaths)):
importObjAtPath(stepFilesPaths[count], count)
cadObjects.append(App.ActiveDocument.Objects[count])
assemblesBindings = []
for increment in range(len(cadObjects)):
if increment != 0:
detailForEvaluationZ = cadObjects[increment]
zoneBindingDetailZ = cadObjects[increment - 1]
assemblesBindings.append(
{
"zoneBindingDetail": detailForEvaluationZ,
"detailForEvaluation": zoneBindingDetailZ,
"relativeCoordinates": None,
"zonePart": None,
}
)
for increment in range(len(assemblesBindings)):
el = assemblesBindings[increment]
zoneBindingDetail = el.get("zoneBindingDetail")
zoneBindingDetailCenterVector = zoneBindingDetail.Shape.CenterOfMass
zoneDetail = create(el.get("detailForEvaluation"))
move_second_part_to_match_center(el.get("zoneBindingDetail"), zoneDetail)
zoneDetail.Label = "zone_sub_assembly" + str(increment + 1)
zoneDetail.ViewObject.ShapeColor = (0.40, 0.74, 0.71)
zoneDetail.ViewObject.Transparency = 50
zoneDetailCenterVector = el.get("detailForEvaluation").Shape.CenterOfMass
el["relativeCoordinates"] = {
"x": zoneBindingDetailCenterVector.x - zoneDetailCenterVector.x,
"y": zoneBindingDetailCenterVector.y - zoneDetailCenterVector.y,
"z": zoneBindingDetailCenterVector.z - zoneDetailCenterVector.z,
}
el["relativeEuler"] = {
"yaw": zoneBindingDetail.Placement.Rotation.toEuler()[0]
- el.get("detailForEvaluation").Placement.Rotation.toEuler()[0],
"pitch": zoneBindingDetail.Placement.Rotation.toEuler()[1]
- el.get("detailForEvaluation").Placement.Rotation.toEuler()[1],
"roll": zoneBindingDetail.Placement.Rotation.toEuler()[2]
- el.get("detailForEvaluation").Placement.Rotation.toEuler()[2],
}
el["zonePart"] = zoneDetail
meshesPath = directoryStableZonesPath + "meshes/"
if not os.path.exists(directoryStableZonesPath):
os.makedirs(directoryStableZonesPath)
if not os.path.exists(meshesPath):
os.makedirs(meshesPath)
zonesSaved = {}
for counter in range(len(assemblesBindings)):
zoneComputed = assemblesBindings[counter]
mesh = zoneComputed.get("zonePart")
zonesSavePath = meshesPath + mesh.Label + ".obj"
importOBJ.export([mesh], zonesSavePath)
zonesSaved[mesh.Label] = "meshes/" + mesh.Label + ".obj"
for counter in range(len(assemblesBindings)):
el = assemblesBindings[counter]
savePath = zonesSaved[el.get("zonePart").Label]
el["zonePart"] = savePath
el["detailForEvaluation"] = el["detailForEvaluation"].Label
el["zoneBindingDetail"] = el["zoneBindingDetail"].Label
json_result = json.dumps(el)
file_to_open = (
directoryStableZonesPath + "sub_assembly_coords_" + str(counter) + ".json"
)
f = open(
file_to_open,
"w",
)
f.write(json_result)
f.close()
def main():
App.newDocument()
env = json.loads((open("./env.json")).read())
assemblyDir = env.get("aspPath")
sequencesJSON = json.loads((open(assemblyDir + "sequences.json")).read())
directoryStableZones = assemblyDir + "stability/zones/"
sequences = sequencesJSON.get("sequences")
stepStructure = json.loads((open(assemblyDir + "step-structure.json")).read())
stepFilesPaths = []
for step in stepStructure:
stepFilesPaths.append(assemblyDir + "generation/meshes/" + step + ".obj")
if not os.path.exists(directoryStableZones):
print("Zones not found automatic calculation started")
autoStabilityZoneComputed(stepFilesPaths, directoryStableZones)
sequencesJoin = {}
for arrayCounter in range(len(sequences)):
for indexCounter in range(len(sequences[arrayCounter])):
if indexCounter != 0:
if sequencesJoin.get(arrayCounter) == None:
sequencesJoin[arrayCounter] = {
indexCounter: sequences[arrayCounter][0 : indexCounter + 1]
}
else:
sequencesJoin[arrayCounter][indexCounter] = sequences[arrayCounter][
0 : indexCounter + 1
]
seqEvaluation = SequencesEvaluation(sequencesJoin, assemblyDir)
seqEvaluation.assemblyComputed()
main()

View file

@ -1,95 +0,0 @@
# Byte-compiled / optimized / DLL files
__pycache__/
*.py[cod]
*$py.class
# C extensions
*.so
# Distribution / packaging
.Python
env/
build/
develop-eggs/
dist/
downloads/
eggs/
.eggs/
lib/
lib64/
parts/
sdist/
var/
wheels/
*.egg-info/
.installed.cfg
*.egg
# PyInstaller
# Usually these files are written by a python script from a template
# before PyInstaller builds the exe, so as to inject date/other infos into it.
*.manifest
*.spec
# Installer logs
pip-log.txt
pip-delete-this-directory.txt
# Unit test / coverage reports
htmlcov/
.tox/
.coverage
.coverage.*
.cache
nosetests.xml
coverage.xml
*,cover
.hypothesis/
# Translations
*.mo
*.pot
# Django stuff:
*.log
local_settings.py
# Flask stuff:
instance/
.webassets-cache
# Scrapy stuff:
.scrapy
# Sphinx documentation
docs/_build/
# PyBuilder
target/
# Jupyter Notebook
.ipynb_checkpoints
# pyenv
.python-version
# celery beat schedule file
celerybeat-schedule
# SageMath parsed files
*.sage.py
# dotenv
.env
# virtualenv
.venv
venv/
ENV/
# Spyder project settings
.spyderproject
# Rope project settings
.ropeproject
env.json

View file

@ -1,505 +0,0 @@
GNU LESSER GENERAL PUBLIC LICENSE
Version 2.1, February 1999
Copyright (C) 1991, 1999 Free Software Foundation, Inc.
51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
Everyone is permitted to copy and distribute verbatim copies
of this license document, but changing it is not allowed.
(This is the first released version of the Lesser GPL. It also counts
as the successor of the GNU Library Public License, version 2, hence
the version number 2.1.)
Preamble
The licenses for most software are designed to take away your
freedom to share and change it. By contrast, the GNU General Public
Licenses are intended to guarantee your freedom to share and change
free software--to make sure the software is free for all its users.
This license, the Lesser General Public License, applies to some
specially designated software packages--typically libraries--of the
Free Software Foundation and other authors who decide to use it. You
can use it too, but we suggest you first think carefully about whether
this license or the ordinary General Public License is the better
strategy to use in any particular case, based on the explanations below.
When we speak of free software, we are referring to freedom of use,
not price. Our General Public Licenses are designed to make sure that
you have the freedom to distribute copies of free software (and charge
for this service if you wish); that you receive source code or can get
it if you want it; that you can change the software and use pieces of
it in new free programs; and that you are informed that you can do
these things.
To protect your rights, we need to make restrictions that forbid
distributors to deny you these rights or to ask you to surrender these
rights. These restrictions translate to certain responsibilities for
you if you distribute copies of the library or if you modify it.
For example, if you distribute copies of the library, whether gratis
or for a fee, you must give the recipients all the rights that we gave
you. You must make sure that they, too, receive or can get the source
code. If you link other code with the library, you must provide
complete object files to the recipients, so that they can relink them
with the library after making changes to the library and recompiling
it. And you must show them these terms so they know their rights.
We protect your rights with a two-step method: (1) we copyright the
library, and (2) we offer you this license, which gives you legal
permission to copy, distribute and/or modify the library.
To protect each distributor, we want to make it very clear that
there is no warranty for the free library. Also, if the library is
modified by someone else and passed on, the recipients should know
that what they have is not the original version, so that the original
author's reputation will not be affected by problems that might be
introduced by others.
Finally, software patents pose a constant threat to the existence of
any free program. We wish to make sure that a company cannot
effectively restrict the users of a free program by obtaining a
restrictive license from a patent holder. Therefore, we insist that
any patent license obtained for a version of the library must be
consistent with the full freedom of use specified in this license.
Most GNU software, including some libraries, is covered by the
ordinary GNU General Public License. This license, the GNU Lesser
General Public License, applies to certain designated libraries, and
is quite different from the ordinary General Public License. We use
this license for certain libraries in order to permit linking those
libraries into non-free programs.
When a program is linked with a library, whether statically or using
a shared library, the combination of the two is legally speaking a
combined work, a derivative of the original library. The ordinary
General Public License therefore permits such linking only if the
entire combination fits its criteria of freedom. The Lesser General
Public License permits more lax criteria for linking other code with
the library.
We call this license the "Lesser" General Public License because it
does Less to protect the user's freedom than the ordinary General
Public License. It also provides other free software developers Less
of an advantage over competing non-free programs. These disadvantages
are the reason we use the ordinary General Public License for many
libraries. However, the Lesser license provides advantages in certain
special circumstances.
For example, on rare occasions, there may be a special need to
encourage the widest possible use of a certain library, so that it becomes
a de-facto standard. To achieve this, non-free programs must be
allowed to use the library. A more frequent case is that a free
library does the same job as widely used non-free libraries. In this
case, there is little to gain by limiting the free library to free
software only, so we use the Lesser General Public License.
In other cases, permission to use a particular library in non-free
programs enables a greater number of people to use a large body of
free software. For example, permission to use the GNU C Library in
non-free programs enables many more people to use the whole GNU
operating system, as well as its variant, the GNU/Linux operating
system.
Although the Lesser General Public License is Less protective of the
users' freedom, it does ensure that the user of a program that is
linked with the Library has the freedom and the wherewithal to run
that program using a modified version of the Library.
The precise terms and conditions for copying, distribution and
modification follow. Pay close attention to the difference between a
"work based on the library" and a "work that uses the library". The
former contains code derived from the library, whereas the latter must
be combined with the library in order to run.
GNU LESSER GENERAL PUBLIC LICENSE
TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION
0. This License Agreement applies to any software library or other
program which contains a notice placed by the copyright holder or
other authorized party saying it may be distributed under the terms of
this Lesser General Public License (also called "this License").
Each licensee is addressed as "you".
A "library" means a collection of software functions and/or data
prepared so as to be conveniently linked with application programs
(which use some of those functions and data) to form executables.
The "Library", below, refers to any such software library or work
which has been distributed under these terms. A "work based on the
Library" means either the Library or any derivative work under
copyright law: that is to say, a work containing the Library or a
portion of it, either verbatim or with modifications and/or translated
straightforwardly into another language. (Hereinafter, translation is
included without limitation in the term "modification".)
"Source code" for a work means the preferred form of the work for
making modifications to it. For a library, complete source code means
all the source code for all modules it contains, plus any associated
interface definition files, plus the scripts used to control compilation
and installation of the library.
Activities other than copying, distribution and modification are not
covered by this License; they are outside its scope. The act of
running a program using the Library is not restricted, and output from
such a program is covered only if its contents constitute a work based
on the Library (independent of the use of the Library in a tool for
writing it). Whether that is true depends on what the Library does
and what the program that uses the Library does.
1. You may copy and distribute verbatim copies of the Library's
complete source code as you receive it, in any medium, provided that
you conspicuously and appropriately publish on each copy an
appropriate copyright notice and disclaimer of warranty; keep intact
all the notices that refer to this License and to the absence of any
warranty; and distribute a copy of this License along with the
Library.
You may charge a fee for the physical act of transferring a copy,
and you may at your option offer warranty protection in exchange for a
fee.
2. You may modify your copy or copies of the Library or any portion
of it, thus forming a work based on the Library, and copy and
distribute such modifications or work under the terms of Section 1
above, provided that you also meet all of these conditions:
a) The modified work must itself be a software library.
b) You must cause the files modified to carry prominent notices
stating that you changed the files and the date of any change.
c) You must cause the whole of the work to be licensed at no
charge to all third parties under the terms of this License.
d) If a facility in the modified Library refers to a function or a
table of data to be supplied by an application program that uses
the facility, other than as an argument passed when the facility
is invoked, then you must make a good faith effort to ensure that,
in the event an application does not supply such function or
table, the facility still operates, and performs whatever part of
its purpose remains meaningful.
(For example, a function in a library to compute square roots has
a purpose that is entirely well-defined independent of the
application. Therefore, Subsection 2d requires that any
application-supplied function or table used by this function must
be optional: if the application does not supply it, the square
root function must still compute square roots.)
These requirements apply to the modified work as a whole. If
identifiable sections of that work are not derived from the Library,
and can be reasonably considered independent and separate works in
themselves, then this License, and its terms, do not apply to those
sections when you distribute them as separate works. But when you
distribute the same sections as part of a whole which is a work based
on the Library, the distribution of the whole must be on the terms of
this License, whose permissions for other licensees extend to the
entire whole, and thus to each and every part regardless of who wrote
it.
Thus, it is not the intent of this section to claim rights or contest
your rights to work written entirely by you; rather, the intent is to
exercise the right to control the distribution of derivative or
collective works based on the Library.
In addition, mere aggregation of another work not based on the Library
with the Library (or with a work based on the Library) on a volume of
a storage or distribution medium does not bring the other work under
the scope of this License.
3. You may opt to apply the terms of the ordinary GNU General Public
License instead of this License to a given copy of the Library. To do
this, you must alter all the notices that refer to this License, so
that they refer to the ordinary GNU General Public License, version 2,
instead of to this License. (If a newer version than version 2 of the
ordinary GNU General Public License has appeared, then you can specify
that version instead if you wish.) Do not make any other change in
these notices.
Once this change is made in a given copy, it is irreversible for
that copy, so the ordinary GNU General Public License applies to all
subsequent copies and derivative works made from that copy.
This option is useful when you wish to copy part of the code of
the Library into a program that is not a library.
4. You may copy and distribute the Library (or a portion or
derivative of it, under Section 2) in object code or executable form
under the terms of Sections 1 and 2 above provided that you accompany
it with the complete corresponding machine-readable source code, which
must be distributed under the terms of Sections 1 and 2 above on a
medium customarily used for software interchange.
If distribution of object code is made by offering access to copy
from a designated place, then offering equivalent access to copy the
source code from the same place satisfies the requirement to
distribute the source code, even though third parties are not
compelled to copy the source along with the object code.
5. A program that contains no derivative of any portion of the
Library, but is designed to work with the Library by being compiled or
linked with it, is called a "work that uses the Library". Such a
work, in isolation, is not a derivative work of the Library, and
therefore falls outside the scope of this License.
However, linking a "work that uses the Library" with the Library
creates an executable that is a derivative of the Library (because it
contains portions of the Library), rather than a "work that uses the
library". The executable is therefore covered by this License.
Section 6 states terms for distribution of such executables.
When a "work that uses the Library" uses material from a header file
that is part of the Library, the object code for the work may be a
derivative work of the Library even though the source code is not.
Whether this is true is especially significant if the work can be
linked without the Library, or if the work is itself a library. The
threshold for this to be true is not precisely defined by law.
If such an object file uses only numerical parameters, data
structure layouts and accessors, and small macros and small inline
functions (ten lines or less in length), then the use of the object
file is unrestricted, regardless of whether it is legally a derivative
work. (Executables containing this object code plus portions of the
Library will still fall under Section 6.)
Otherwise, if the work is a derivative of the Library, you may
distribute the object code for the work under the terms of Section 6.
Any executables containing that work also fall under Section 6,
whether or not they are linked directly with the Library itself.
6. As an exception to the Sections above, you may also combine or
link a "work that uses the Library" with the Library to produce a
work containing portions of the Library, and distribute that work
under terms of your choice, provided that the terms permit
modification of the work for the customer's own use and reverse
engineering for debugging such modifications.
You must give prominent notice with each copy of the work that the
Library is used in it and that the Library and its use are covered by
this License. You must supply a copy of this License. If the work
during execution displays copyright notices, you must include the
copyright notice for the Library among them, as well as a reference
directing the user to the copy of this License. Also, you must do one
of these things:
a) Accompany the work with the complete corresponding
machine-readable source code for the Library including whatever
changes were used in the work (which must be distributed under
Sections 1 and 2 above); and, if the work is an executable linked
with the Library, with the complete machine-readable "work that
uses the Library", as object code and/or source code, so that the
user can modify the Library and then relink to produce a modified
executable containing the modified Library. (It is understood
that the user who changes the contents of definitions files in the
Library will not necessarily be able to recompile the application
to use the modified definitions.)
b) Use a suitable shared library mechanism for linking with the
Library. A suitable mechanism is one that (1) uses at run time a
copy of the library already present on the user's computer system,
rather than copying library functions into the executable, and (2)
will operate properly with a modified version of the library, if
the user installs one, as long as the modified version is
interface-compatible with the version that the work was made with.
c) Accompany the work with a written offer, valid for at
least three years, to give the same user the materials
specified in Subsection 6a, above, for a charge no more
than the cost of performing this distribution.
d) If distribution of the work is made by offering access to copy
from a designated place, offer equivalent access to copy the above
specified materials from the same place.
e) Verify that the user has already received a copy of these
materials or that you have already sent this user a copy.
For an executable, the required form of the "work that uses the
Library" must include any data and utility programs needed for
reproducing the executable from it. However, as a special exception,
the materials to be distributed need not include anything that is
normally distributed (in either source or binary form) with the major
components (compiler, kernel, and so on) of the operating system on
which the executable runs, unless that component itself accompanies
the executable.
It may happen that this requirement contradicts the license
restrictions of other proprietary libraries that do not normally
accompany the operating system. Such a contradiction means you cannot
use both them and the Library together in an executable that you
distribute.
7. You may place library facilities that are a work based on the
Library side-by-side in a single library together with other library
facilities not covered by this License, and distribute such a combined
library, provided that the separate distribution of the work based on
the Library and of the other library facilities is otherwise
permitted, and provided that you do these two things:
a) Accompany the combined library with a copy of the same work
based on the Library, uncombined with any other library
facilities. This must be distributed under the terms of the
Sections above.
b) Give prominent notice with the combined library of the fact
that part of it is a work based on the Library, and explaining
where to find the accompanying uncombined form of the same work.
8. You may not copy, modify, sublicense, link with, or distribute
the Library except as expressly provided under this License. Any
attempt otherwise to copy, modify, sublicense, link with, or
distribute the Library is void, and will automatically terminate your
rights under this License. However, parties who have received copies,
or rights, from you under this License will not have their licenses
terminated so long as such parties remain in full compliance.
9. You are not required to accept this License, since you have not
signed it. However, nothing else grants you permission to modify or
distribute the Library or its derivative works. These actions are
prohibited by law if you do not accept this License. Therefore, by
modifying or distributing the Library (or any work based on the
Library), you indicate your acceptance of this License to do so, and
all its terms and conditions for copying, distributing or modifying
the Library or works based on it.
10. Each time you redistribute the Library (or any work based on the
Library), the recipient automatically receives a license from the
original licensor to copy, distribute, link with or modify the Library
subject to these terms and conditions. You may not impose any further
restrictions on the recipients' exercise of the rights granted herein.
You are not responsible for enforcing compliance by third parties with
this License.
11. If, as a consequence of a court judgment or allegation of patent
infringement or for any other reason (not limited to patent issues),
conditions are imposed on you (whether by court order, agreement or
otherwise) that contradict the conditions of this License, they do not
excuse you from the conditions of this License. If you cannot
distribute so as to satisfy simultaneously your obligations under this
License and any other pertinent obligations, then as a consequence you
may not distribute the Library at all. For example, if a patent
license would not permit royalty-free redistribution of the Library by
all those who receive copies directly or indirectly through you, then
the only way you could satisfy both it and this License would be to
refrain entirely from distribution of the Library.
If any portion of this section is held invalid or unenforceable under any
particular circumstance, the balance of the section is intended to apply,
and the section as a whole is intended to apply in other circumstances.
It is not the purpose of this section to induce you to infringe any
patents or other property right claims or to contest validity of any
such claims; this section has the sole purpose of protecting the
integrity of the free software distribution system which is
implemented by public license practices. Many people have made
generous contributions to the wide range of software distributed
through that system in reliance on consistent application of that
system; it is up to the author/donor to decide if he or she is willing
to distribute software through any other system and a licensee cannot
impose that choice.
This section is intended to make thoroughly clear what is believed to
be a consequence of the rest of this License.
12. If the distribution and/or use of the Library is restricted in
certain countries either by patents or by copyrighted interfaces, the
original copyright holder who places the Library under this License may add
an explicit geographical distribution limitation excluding those countries,
so that distribution is permitted only in or among countries not thus
excluded. In such case, this License incorporates the limitation as if
written in the body of this License.
13. The Free Software Foundation may publish revised and/or new
versions of the Lesser General Public License from time to time.
Such new versions will be similar in spirit to the present version,
but may differ in detail to address new problems or concerns.
Each version is given a distinguishing version number. If the Library
specifies a version number of this License which applies to it and
"any later version", you have the option of following the terms and
conditions either of that version or of any later version published by
the Free Software Foundation. If the Library does not specify a
license version number, you may choose any version ever published by
the Free Software Foundation.
14. If you wish to incorporate parts of the Library into other free
programs whose distribution conditions are incompatible with these,
write to the author to ask for permission. For software which is
copyrighted by the Free Software Foundation, write to the Free
Software Foundation; we sometimes make exceptions for this. Our
decision will be guided by the two goals of preserving the free status
of all derivatives of our free software and of promoting the sharing
and reuse of software generally.
NO WARRANTY
15. BECAUSE THE LIBRARY IS LICENSED FREE OF CHARGE, THERE IS NO
WARRANTY FOR THE LIBRARY, TO THE EXTENT PERMITTED BY APPLICABLE LAW.
EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR
OTHER PARTIES PROVIDE THE LIBRARY "AS IS" WITHOUT WARRANTY OF ANY
KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE
IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE
LIBRARY IS WITH YOU. SHOULD THE LIBRARY PROVE DEFECTIVE, YOU ASSUME
THE COST OF ALL NECESSARY SERVICING, REPAIR OR CORRECTION.
16. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN
WRITING WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY
AND/OR REDISTRIBUTE THE LIBRARY AS PERMITTED ABOVE, BE LIABLE TO YOU
FOR DAMAGES, INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR
CONSEQUENTIAL DAMAGES ARISING OUT OF THE USE OR INABILITY TO USE THE
LIBRARY (INCLUDING BUT NOT LIMITED TO LOSS OF DATA OR DATA BEING
RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD PARTIES OR A
FAILURE OF THE LIBRARY TO OPERATE WITH ANY OTHER SOFTWARE), EVEN IF
SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH
DAMAGES.
END OF TERMS AND CONDITIONS
How to Apply These Terms to Your New Libraries
If you develop a new library, and you want it to be of the greatest
possible use to the public, we recommend making it free software that
everyone can redistribute and change. You can do so by permitting
redistribution under these terms (or, alternatively, under the terms of the
ordinary General Public License).
To apply these terms, attach the following notices to the library. It is
safest to attach them to the start of each source file to most effectively
convey the exclusion of warranty; and each file should have at least the
"copyright" line and a pointer to where the full notice is found.
{description}
Copyright (C) {year} {fullname}
This library is free software; you can redistribute it and/or
modify it under the terms of the GNU Lesser General Public
License as published by the Free Software Foundation; either
version 2.1 of the License, or (at your option) any later version.
This library is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
Lesser General Public License for more details.
You should have received a copy of the GNU Lesser General Public
License along with this library; if not, write to the Free Software
Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301
USA
Also add information on how to contact you by electronic and paper mail.
You should also get your employer (if you work as a programmer) or your
school, if any, to sign a "copyright disclaimer" for the library, if
necessary. Here is a sample; alter the names:
Yoyodyne, Inc., hereby disclaims all copyright interest in the
library `Frob' (a library for tweaking knobs) written by James Random
Hacker.
{signature of Ty Coon}, 1 April 1990
Ty Coon, President of Vice
That's all there is to it!

View file

@ -1,95 +0,0 @@
# Byte-compiled / optimized / DLL files
__pycache__/
*.py[cod]
*$py.class
# C extensions
*.so
# Distribution / packaging
.Python
env/
build/
develop-eggs/
dist/
downloads/
eggs/
.eggs/
lib/
lib64/
parts/
sdist/
var/
wheels/
*.egg-info/
.installed.cfg
*.egg
# PyInstaller
# Usually these files are written by a python script from a template
# before PyInstaller builds the exe, so as to inject date/other infos into it.
*.manifest
*.spec
# Installer logs
pip-log.txt
pip-delete-this-directory.txt
# Unit test / coverage reports
htmlcov/
.tox/
.coverage
.coverage.*
.cache
nosetests.xml
coverage.xml
*,cover
.hypothesis/
# Translations
*.mo
*.pot
# Django stuff:
*.log
local_settings.py
# Flask stuff:
instance/
.webassets-cache
# Scrapy stuff:
.scrapy
# Sphinx documentation
docs/_build/
# PyBuilder
target/
# Jupyter Notebook
.ipynb_checkpoints
# pyenv
.python-version
# celery beat schedule file
celerybeat-schedule
# SageMath parsed files
*.sage.py
# dotenv
.env
# virtualenv
.venv
venv/
ENV/
# Spyder project settings
.spyderproject
# Rope project settings
.ropeproject
env.json

View file

@ -1,505 +0,0 @@
GNU LESSER GENERAL PUBLIC LICENSE
Version 2.1, February 1999
Copyright (C) 1991, 1999 Free Software Foundation, Inc.
51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
Everyone is permitted to copy and distribute verbatim copies
of this license document, but changing it is not allowed.
(This is the first released version of the Lesser GPL. It also counts
as the successor of the GNU Library Public License, version 2, hence
the version number 2.1.)
Preamble
The licenses for most software are designed to take away your
freedom to share and change it. By contrast, the GNU General Public
Licenses are intended to guarantee your freedom to share and change
free software--to make sure the software is free for all its users.
This license, the Lesser General Public License, applies to some
specially designated software packages--typically libraries--of the
Free Software Foundation and other authors who decide to use it. You
can use it too, but we suggest you first think carefully about whether
this license or the ordinary General Public License is the better
strategy to use in any particular case, based on the explanations below.
When we speak of free software, we are referring to freedom of use,
not price. Our General Public Licenses are designed to make sure that
you have the freedom to distribute copies of free software (and charge
for this service if you wish); that you receive source code or can get
it if you want it; that you can change the software and use pieces of
it in new free programs; and that you are informed that you can do
these things.
To protect your rights, we need to make restrictions that forbid
distributors to deny you these rights or to ask you to surrender these
rights. These restrictions translate to certain responsibilities for
you if you distribute copies of the library or if you modify it.
For example, if you distribute copies of the library, whether gratis
or for a fee, you must give the recipients all the rights that we gave
you. You must make sure that they, too, receive or can get the source
code. If you link other code with the library, you must provide
complete object files to the recipients, so that they can relink them
with the library after making changes to the library and recompiling
it. And you must show them these terms so they know their rights.
We protect your rights with a two-step method: (1) we copyright the
library, and (2) we offer you this license, which gives you legal
permission to copy, distribute and/or modify the library.
To protect each distributor, we want to make it very clear that
there is no warranty for the free library. Also, if the library is
modified by someone else and passed on, the recipients should know
that what they have is not the original version, so that the original
author's reputation will not be affected by problems that might be
introduced by others.
Finally, software patents pose a constant threat to the existence of
any free program. We wish to make sure that a company cannot
effectively restrict the users of a free program by obtaining a
restrictive license from a patent holder. Therefore, we insist that
any patent license obtained for a version of the library must be
consistent with the full freedom of use specified in this license.
Most GNU software, including some libraries, is covered by the
ordinary GNU General Public License. This license, the GNU Lesser
General Public License, applies to certain designated libraries, and
is quite different from the ordinary General Public License. We use
this license for certain libraries in order to permit linking those
libraries into non-free programs.
When a program is linked with a library, whether statically or using
a shared library, the combination of the two is legally speaking a
combined work, a derivative of the original library. The ordinary
General Public License therefore permits such linking only if the
entire combination fits its criteria of freedom. The Lesser General
Public License permits more lax criteria for linking other code with
the library.
We call this license the "Lesser" General Public License because it
does Less to protect the user's freedom than the ordinary General
Public License. It also provides other free software developers Less
of an advantage over competing non-free programs. These disadvantages
are the reason we use the ordinary General Public License for many
libraries. However, the Lesser license provides advantages in certain
special circumstances.
For example, on rare occasions, there may be a special need to
encourage the widest possible use of a certain library, so that it becomes
a de-facto standard. To achieve this, non-free programs must be
allowed to use the library. A more frequent case is that a free
library does the same job as widely used non-free libraries. In this
case, there is little to gain by limiting the free library to free
software only, so we use the Lesser General Public License.
In other cases, permission to use a particular library in non-free
programs enables a greater number of people to use a large body of
free software. For example, permission to use the GNU C Library in
non-free programs enables many more people to use the whole GNU
operating system, as well as its variant, the GNU/Linux operating
system.
Although the Lesser General Public License is Less protective of the
users' freedom, it does ensure that the user of a program that is
linked with the Library has the freedom and the wherewithal to run
that program using a modified version of the Library.
The precise terms and conditions for copying, distribution and
modification follow. Pay close attention to the difference between a
"work based on the library" and a "work that uses the library". The
former contains code derived from the library, whereas the latter must
be combined with the library in order to run.
GNU LESSER GENERAL PUBLIC LICENSE
TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION
0. This License Agreement applies to any software library or other
program which contains a notice placed by the copyright holder or
other authorized party saying it may be distributed under the terms of
this Lesser General Public License (also called "this License").
Each licensee is addressed as "you".
A "library" means a collection of software functions and/or data
prepared so as to be conveniently linked with application programs
(which use some of those functions and data) to form executables.
The "Library", below, refers to any such software library or work
which has been distributed under these terms. A "work based on the
Library" means either the Library or any derivative work under
copyright law: that is to say, a work containing the Library or a
portion of it, either verbatim or with modifications and/or translated
straightforwardly into another language. (Hereinafter, translation is
included without limitation in the term "modification".)
"Source code" for a work means the preferred form of the work for
making modifications to it. For a library, complete source code means
all the source code for all modules it contains, plus any associated
interface definition files, plus the scripts used to control compilation
and installation of the library.
Activities other than copying, distribution and modification are not
covered by this License; they are outside its scope. The act of
running a program using the Library is not restricted, and output from
such a program is covered only if its contents constitute a work based
on the Library (independent of the use of the Library in a tool for
writing it). Whether that is true depends on what the Library does
and what the program that uses the Library does.
1. You may copy and distribute verbatim copies of the Library's
complete source code as you receive it, in any medium, provided that
you conspicuously and appropriately publish on each copy an
appropriate copyright notice and disclaimer of warranty; keep intact
all the notices that refer to this License and to the absence of any
warranty; and distribute a copy of this License along with the
Library.
You may charge a fee for the physical act of transferring a copy,
and you may at your option offer warranty protection in exchange for a
fee.
2. You may modify your copy or copies of the Library or any portion
of it, thus forming a work based on the Library, and copy and
distribute such modifications or work under the terms of Section 1
above, provided that you also meet all of these conditions:
a) The modified work must itself be a software library.
b) You must cause the files modified to carry prominent notices
stating that you changed the files and the date of any change.
c) You must cause the whole of the work to be licensed at no
charge to all third parties under the terms of this License.
d) If a facility in the modified Library refers to a function or a
table of data to be supplied by an application program that uses
the facility, other than as an argument passed when the facility
is invoked, then you must make a good faith effort to ensure that,
in the event an application does not supply such function or
table, the facility still operates, and performs whatever part of
its purpose remains meaningful.
(For example, a function in a library to compute square roots has
a purpose that is entirely well-defined independent of the
application. Therefore, Subsection 2d requires that any
application-supplied function or table used by this function must
be optional: if the application does not supply it, the square
root function must still compute square roots.)
These requirements apply to the modified work as a whole. If
identifiable sections of that work are not derived from the Library,
and can be reasonably considered independent and separate works in
themselves, then this License, and its terms, do not apply to those
sections when you distribute them as separate works. But when you
distribute the same sections as part of a whole which is a work based
on the Library, the distribution of the whole must be on the terms of
this License, whose permissions for other licensees extend to the
entire whole, and thus to each and every part regardless of who wrote
it.
Thus, it is not the intent of this section to claim rights or contest
your rights to work written entirely by you; rather, the intent is to
exercise the right to control the distribution of derivative or
collective works based on the Library.
In addition, mere aggregation of another work not based on the Library
with the Library (or with a work based on the Library) on a volume of
a storage or distribution medium does not bring the other work under
the scope of this License.
3. You may opt to apply the terms of the ordinary GNU General Public
License instead of this License to a given copy of the Library. To do
this, you must alter all the notices that refer to this License, so
that they refer to the ordinary GNU General Public License, version 2,
instead of to this License. (If a newer version than version 2 of the
ordinary GNU General Public License has appeared, then you can specify
that version instead if you wish.) Do not make any other change in
these notices.
Once this change is made in a given copy, it is irreversible for
that copy, so the ordinary GNU General Public License applies to all
subsequent copies and derivative works made from that copy.
This option is useful when you wish to copy part of the code of
the Library into a program that is not a library.
4. You may copy and distribute the Library (or a portion or
derivative of it, under Section 2) in object code or executable form
under the terms of Sections 1 and 2 above provided that you accompany
it with the complete corresponding machine-readable source code, which
must be distributed under the terms of Sections 1 and 2 above on a
medium customarily used for software interchange.
If distribution of object code is made by offering access to copy
from a designated place, then offering equivalent access to copy the
source code from the same place satisfies the requirement to
distribute the source code, even though third parties are not
compelled to copy the source along with the object code.
5. A program that contains no derivative of any portion of the
Library, but is designed to work with the Library by being compiled or
linked with it, is called a "work that uses the Library". Such a
work, in isolation, is not a derivative work of the Library, and
therefore falls outside the scope of this License.
However, linking a "work that uses the Library" with the Library
creates an executable that is a derivative of the Library (because it
contains portions of the Library), rather than a "work that uses the
library". The executable is therefore covered by this License.
Section 6 states terms for distribution of such executables.
When a "work that uses the Library" uses material from a header file
that is part of the Library, the object code for the work may be a
derivative work of the Library even though the source code is not.
Whether this is true is especially significant if the work can be
linked without the Library, or if the work is itself a library. The
threshold for this to be true is not precisely defined by law.
If such an object file uses only numerical parameters, data
structure layouts and accessors, and small macros and small inline
functions (ten lines or less in length), then the use of the object
file is unrestricted, regardless of whether it is legally a derivative
work. (Executables containing this object code plus portions of the
Library will still fall under Section 6.)
Otherwise, if the work is a derivative of the Library, you may
distribute the object code for the work under the terms of Section 6.
Any executables containing that work also fall under Section 6,
whether or not they are linked directly with the Library itself.
6. As an exception to the Sections above, you may also combine or
link a "work that uses the Library" with the Library to produce a
work containing portions of the Library, and distribute that work
under terms of your choice, provided that the terms permit
modification of the work for the customer's own use and reverse
engineering for debugging such modifications.
You must give prominent notice with each copy of the work that the
Library is used in it and that the Library and its use are covered by
this License. You must supply a copy of this License. If the work
during execution displays copyright notices, you must include the
copyright notice for the Library among them, as well as a reference
directing the user to the copy of this License. Also, you must do one
of these things:
a) Accompany the work with the complete corresponding
machine-readable source code for the Library including whatever
changes were used in the work (which must be distributed under
Sections 1 and 2 above); and, if the work is an executable linked
with the Library, with the complete machine-readable "work that
uses the Library", as object code and/or source code, so that the
user can modify the Library and then relink to produce a modified
executable containing the modified Library. (It is understood
that the user who changes the contents of definitions files in the
Library will not necessarily be able to recompile the application
to use the modified definitions.)
b) Use a suitable shared library mechanism for linking with the
Library. A suitable mechanism is one that (1) uses at run time a
copy of the library already present on the user's computer system,
rather than copying library functions into the executable, and (2)
will operate properly with a modified version of the library, if
the user installs one, as long as the modified version is
interface-compatible with the version that the work was made with.
c) Accompany the work with a written offer, valid for at
least three years, to give the same user the materials
specified in Subsection 6a, above, for a charge no more
than the cost of performing this distribution.
d) If distribution of the work is made by offering access to copy
from a designated place, offer equivalent access to copy the above
specified materials from the same place.
e) Verify that the user has already received a copy of these
materials or that you have already sent this user a copy.
For an executable, the required form of the "work that uses the
Library" must include any data and utility programs needed for
reproducing the executable from it. However, as a special exception,
the materials to be distributed need not include anything that is
normally distributed (in either source or binary form) with the major
components (compiler, kernel, and so on) of the operating system on
which the executable runs, unless that component itself accompanies
the executable.
It may happen that this requirement contradicts the license
restrictions of other proprietary libraries that do not normally
accompany the operating system. Such a contradiction means you cannot
use both them and the Library together in an executable that you
distribute.
7. You may place library facilities that are a work based on the
Library side-by-side in a single library together with other library
facilities not covered by this License, and distribute such a combined
library, provided that the separate distribution of the work based on
the Library and of the other library facilities is otherwise
permitted, and provided that you do these two things:
a) Accompany the combined library with a copy of the same work
based on the Library, uncombined with any other library
facilities. This must be distributed under the terms of the
Sections above.
b) Give prominent notice with the combined library of the fact
that part of it is a work based on the Library, and explaining
where to find the accompanying uncombined form of the same work.
8. You may not copy, modify, sublicense, link with, or distribute
the Library except as expressly provided under this License. Any
attempt otherwise to copy, modify, sublicense, link with, or
distribute the Library is void, and will automatically terminate your
rights under this License. However, parties who have received copies,
or rights, from you under this License will not have their licenses
terminated so long as such parties remain in full compliance.
9. You are not required to accept this License, since you have not
signed it. However, nothing else grants you permission to modify or
distribute the Library or its derivative works. These actions are
prohibited by law if you do not accept this License. Therefore, by
modifying or distributing the Library (or any work based on the
Library), you indicate your acceptance of this License to do so, and
all its terms and conditions for copying, distributing or modifying
the Library or works based on it.
10. Each time you redistribute the Library (or any work based on the
Library), the recipient automatically receives a license from the
original licensor to copy, distribute, link with or modify the Library
subject to these terms and conditions. You may not impose any further
restrictions on the recipients' exercise of the rights granted herein.
You are not responsible for enforcing compliance by third parties with
this License.
11. If, as a consequence of a court judgment or allegation of patent
infringement or for any other reason (not limited to patent issues),
conditions are imposed on you (whether by court order, agreement or
otherwise) that contradict the conditions of this License, they do not
excuse you from the conditions of this License. If you cannot
distribute so as to satisfy simultaneously your obligations under this
License and any other pertinent obligations, then as a consequence you
may not distribute the Library at all. For example, if a patent
license would not permit royalty-free redistribution of the Library by
all those who receive copies directly or indirectly through you, then
the only way you could satisfy both it and this License would be to
refrain entirely from distribution of the Library.
If any portion of this section is held invalid or unenforceable under any
particular circumstance, the balance of the section is intended to apply,
and the section as a whole is intended to apply in other circumstances.
It is not the purpose of this section to induce you to infringe any
patents or other property right claims or to contest validity of any
such claims; this section has the sole purpose of protecting the
integrity of the free software distribution system which is
implemented by public license practices. Many people have made
generous contributions to the wide range of software distributed
through that system in reliance on consistent application of that
system; it is up to the author/donor to decide if he or she is willing
to distribute software through any other system and a licensee cannot
impose that choice.
This section is intended to make thoroughly clear what is believed to
be a consequence of the rest of this License.
12. If the distribution and/or use of the Library is restricted in
certain countries either by patents or by copyrighted interfaces, the
original copyright holder who places the Library under this License may add
an explicit geographical distribution limitation excluding those countries,
so that distribution is permitted only in or among countries not thus
excluded. In such case, this License incorporates the limitation as if
written in the body of this License.
13. The Free Software Foundation may publish revised and/or new
versions of the Lesser General Public License from time to time.
Such new versions will be similar in spirit to the present version,
but may differ in detail to address new problems or concerns.
Each version is given a distinguishing version number. If the Library
specifies a version number of this License which applies to it and
"any later version", you have the option of following the terms and
conditions either of that version or of any later version published by
the Free Software Foundation. If the Library does not specify a
license version number, you may choose any version ever published by
the Free Software Foundation.
14. If you wish to incorporate parts of the Library into other free
programs whose distribution conditions are incompatible with these,
write to the author to ask for permission. For software which is
copyrighted by the Free Software Foundation, write to the Free
Software Foundation; we sometimes make exceptions for this. Our
decision will be guided by the two goals of preserving the free status
of all derivatives of our free software and of promoting the sharing
and reuse of software generally.
NO WARRANTY
15. BECAUSE THE LIBRARY IS LICENSED FREE OF CHARGE, THERE IS NO
WARRANTY FOR THE LIBRARY, TO THE EXTENT PERMITTED BY APPLICABLE LAW.
EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR
OTHER PARTIES PROVIDE THE LIBRARY "AS IS" WITHOUT WARRANTY OF ANY
KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE
IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE
LIBRARY IS WITH YOU. SHOULD THE LIBRARY PROVE DEFECTIVE, YOU ASSUME
THE COST OF ALL NECESSARY SERVICING, REPAIR OR CORRECTION.
16. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN
WRITING WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY
AND/OR REDISTRIBUTE THE LIBRARY AS PERMITTED ABOVE, BE LIABLE TO YOU
FOR DAMAGES, INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR
CONSEQUENTIAL DAMAGES ARISING OUT OF THE USE OR INABILITY TO USE THE
LIBRARY (INCLUDING BUT NOT LIMITED TO LOSS OF DATA OR DATA BEING
RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD PARTIES OR A
FAILURE OF THE LIBRARY TO OPERATE WITH ANY OTHER SOFTWARE), EVEN IF
SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH
DAMAGES.
END OF TERMS AND CONDITIONS
How to Apply These Terms to Your New Libraries
If you develop a new library, and you want it to be of the greatest
possible use to the public, we recommend making it free software that
everyone can redistribute and change. You can do so by permitting
redistribution under these terms (or, alternatively, under the terms of the
ordinary General Public License).
To apply these terms, attach the following notices to the library. It is
safest to attach them to the start of each source file to most effectively
convey the exclusion of warranty; and each file should have at least the
"copyright" line and a pointer to where the full notice is found.
{description}
Copyright (C) {year} {fullname}
This library is free software; you can redistribute it and/or
modify it under the terms of the GNU Lesser General Public
License as published by the Free Software Foundation; either
version 2.1 of the License, or (at your option) any later version.
This library is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
Lesser General Public License for more details.
You should have received a copy of the GNU Lesser General Public
License along with this library; if not, write to the Free Software
Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301
USA
Also add information on how to contact you by electronic and paper mail.
You should also get your employer (if you work as a programmer) or your
school, if any, to sign a "copyright disclaimer" for the library, if
necessary. Here is a sample; alter the names:
Yoyodyne, Inc., hereby disclaims all copyright interest in the
library `Frob' (a library for tweaking knobs) written by James Random
Hacker.
{signature of Ty Coon}, 1 April 1990
Ty Coon, President of Vice
That's all there is to it!

View file

@ -1,4 +0,0 @@
import os
from .version import __version__
ICONPATH = os.path.join(os.path.dirname(__file__), "resources")

View file

@ -1,89 +0,0 @@
import os
import FreeCADGui as Gui
import FreeCAD as App
from PySide.QtCore import QT_TRANSLATE_NOOP
import shutil
ICONPATH = os.path.join(os.path.dirname(__file__), "resources")
zone = "StabilityZone"
import requests
import importOBJ
class AddStabilityZone:
def __init__(self):
pass
def GetResources(self):
return {'Pixmap': os.path.join(ICONPATH, "stability_zone.svg"),
'Accel': "Ctrl+A",
'MenuText': QT_TRANSLATE_NOOP("My_Command", "My Command"),
'ToolTip': QT_TRANSLATE_NOOP("My_Command", "Runs my command in the active document")}
def Activated(self):
App.ActiveDocument.addObject("Part::Box", "Box")
App.ActiveDocument.ActiveObject.Label = zone
selected_object = App.ActiveDocument.getObjectsByLabel(zone)[0]
selected_object.ViewObject.Transparency = 50
selected_object.ViewObject.ShapeColor = (0.15, 0.80, 0.50)
pass
def IsActive(self):
return True
class SyncServer:
httpURL = None
def __init__(self, httpURL):
self.httpURL = httpURL
def GetResources(self):
return {'Pixmap': os.path.join(ICONPATH, "server_sync.svg"),
'Accel': "Ctrl+A",
'MenuText': QT_TRANSLATE_NOOP("My_Command", "My Command"),
'ToolTip': QT_TRANSLATE_NOOP("My_Command", "Runs my command in the active document")}
def Activated(self):
StabilityZone = App.ActiveDocument.getObjectsByLabel(zone)
dir_path = os.path.dirname(os.path.realpath(__file__))
dir_out = dir_path + '/out/'
if not os.path.exists(dir_out):
os.makedirs(dir_out)
importOBJ.export(StabilityZone, u"" + dir_out + 'StabilityZone.obj')
shutil.make_archive(dir_out + '/' + 'geometry', 'zip',)
zipArch = dir_out + 'geometry.zip'
requests.post(url=self.httpURL, files={'zip': open(zipArch, "rb")})
shutil.rmtree(dir_out)
pass
def IsActive(self):
return True
class StabilityWorkbench(Gui.Workbench):
MenuText = "stability workbench"
ToolTip = "a simple template workbench"
Icon = os.path.join(ICONPATH, "template_resource.svg")
toolbox = ['AddStabilityZone', 'SyncServer']
httpURL = None
def __init__(self,httpURL):
self.httpURL = httpURL
def GetClassName(self):
return "Gui::PythonWorkbench"
def Initialize(self):
Gui.addCommand('AddStabilityZone', AddStabilityZone())
Gui.addCommand('SyncServer', SyncServer(
self.httpURL))
self.appendToolbar("Tools", self.toolbox)
self.appendMenu("Tools", self.toolbox)
def Activated(self):
pass
def Deactivated(self):
pass

View file

@ -1,134 +0,0 @@
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<!-- Created with Inkscape (http://www.inkscape.org/) -->
<svg
xmlns:dc="http://purl.org/dc/elements/1.1/"
xmlns:cc="http://creativecommons.org/ns#"
xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
xmlns:svg="http://www.w3.org/2000/svg"
xmlns="http://www.w3.org/2000/svg"
xmlns:xlink="http://www.w3.org/1999/xlink"
xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd"
xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape"
width="64"
height="64"
id="svg2985"
version="1.1"
inkscape:version="0.48.5 r10040"
sodipodi:docname="button_valid.svg">
<defs
id="defs2987">
<linearGradient
inkscape:collect="always"
id="linearGradient3774">
<stop
style="stop-color:#4e9a06;stop-opacity:1"
offset="0"
id="stop3776" />
<stop
style="stop-color:#8ae234;stop-opacity:1"
offset="1"
id="stop3778" />
</linearGradient>
<linearGradient
inkscape:collect="always"
xlink:href="#linearGradient4082"
id="linearGradient3922-0"
gradientUnits="userSpaceOnUse"
gradientTransform="matrix(-0.56091264,-0.498646,0.48035179,-0.58227539,-177.89813,269.15635)"
x1="10.387"
y1="453.77875"
x2="56.319412"
y2="483.99524" />
<linearGradient
id="linearGradient4082">
<stop
id="stop4084"
offset="0"
style="stop-color:#4e9a06;stop-opacity:1" />
<stop
id="stop4086"
offset="1"
style="stop-color:#8ae234;stop-opacity:1" />
</linearGradient>
<linearGradient
inkscape:collect="always"
xlink:href="#linearGradient3774"
id="linearGradient3780"
x1="30"
y1="-2"
x2="26"
y2="-26"
gradientUnits="userSpaceOnUse" />
<linearGradient
inkscape:collect="always"
xlink:href="#linearGradient3774"
id="linearGradient2999"
gradientUnits="userSpaceOnUse"
x1="30"
y1="-2"
x2="26"
y2="-26" />
</defs>
<sodipodi:namedview
id="base"
pagecolor="#ffffff"
bordercolor="#666666"
borderopacity="1.0"
inkscape:pageopacity="0.0"
inkscape:pageshadow="2"
inkscape:zoom="15.696216"
inkscape:cx="42.681569"
inkscape:cy="45.101596"
inkscape:current-layer="g2995"
showgrid="true"
inkscape:grid-bbox="true"
inkscape:document-units="px"
inkscape:window-width="1600"
inkscape:window-height="837"
inkscape:window-x="0"
inkscape:window-y="27"
inkscape:window-maximized="1">
<inkscape:grid
type="xygrid"
id="grid2983"
empspacing="2"
visible="true"
enabled="true"
snapvisiblegridlinesonly="true" />
</sodipodi:namedview>
<metadata
id="metadata2990">
<rdf:RDF>
<cc:Work
rdf:about="">
<dc:format>image/svg+xml</dc:format>
<dc:type
rdf:resource="http://purl.org/dc/dcmitype/StillImage" />
<dc:title></dc:title>
</cc:Work>
</rdf:RDF>
</metadata>
<g
id="layer1"
inkscape:label="Layer 1"
inkscape:groupmode="layer"
transform="translate(0,48)">
<g
id="g2995"
transform="matrix(1.2252683,0,0,1.2252683,-6.3014179,2.4330891)">
<path
sodipodi:nodetypes="ccccccc"
inkscape:connector-curvature="0"
id="path4088"
d="m 15.48076,-21.246576 10.519239,10.519232 21.038474,-21.038464 7.889428,7.889424 L 25.999999,5.0515065 7.5913312,-13.357152 z"
style="fill:url(#linearGradient2999);fill-opacity:1;stroke:#172a04;stroke-width:1.63229537;stroke-linecap:butt;stroke-linejoin:round;stroke-opacity:1" />
<path
sodipodi:nodetypes="ccccccc"
inkscape:connector-curvature="0"
id="path3004"
d="M 9.9510978,-13.350403 15.477822,-18.889628 26,-8.4375583 47.031855,-29.448573 52.57108,-23.872581 26,2.7352662 z"
style="fill:none;stroke:#8ae234;stroke-width:1.63229549;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1" />
</g>
</g>
</svg>

Before

Width:  |  Height:  |  Size: 4.1 KiB

View file

@ -1,142 +0,0 @@
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<svg
xmlns:dc="http://purl.org/dc/elements/1.1/"
xmlns:cc="http://creativecommons.org/ns#"
xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
xmlns:svg="http://www.w3.org/2000/svg"
xmlns="http://www.w3.org/2000/svg"
xmlns:xlink="http://www.w3.org/1999/xlink"
version="1.1"
id="svg6248"
height="64px"
width="64px">
<defs
id="defs6250">
<linearGradient
id="linearGradient3253">
<stop
id="stop3255"
offset="0"
style="stop-color:#89d5f8;stop-opacity:1;" />
<stop
id="stop3257"
offset="1"
style="stop-color:#00899e;stop-opacity:1;" />
</linearGradient>
<linearGradient
id="linearGradient6816">
<stop
id="stop6818"
offset="0"
style="stop-color:#000000;stop-opacity:1;" />
<stop
id="stop6820"
offset="1"
style="stop-color:#000000;stop-opacity:0;" />
</linearGradient>
<linearGradient
id="linearGradient6781">
<stop
id="stop6783"
offset="0"
style="stop-color:#ffffff;stop-opacity:1;" />
<stop
id="stop6785"
offset="1"
style="stop-color:#3465a4;stop-opacity:0;" />
</linearGradient>
<radialGradient
gradientUnits="userSpaceOnUse"
gradientTransform="matrix(1.1581633,0,0,0.6558985,-7.29237,16.126077)"
r="25.198714"
fy="51.929391"
fx="33.369828"
cy="51.929391"
cx="33.369828"
id="radialGradient6822"
xlink:href="#linearGradient6816" />
<radialGradient
gradientUnits="userSpaceOnUse"
gradientTransform="matrix(0.9724373,-0.105657,5.0523169e-2,0.4650009,-0.3519546,9.5854384)"
r="27.986705"
fy="17.013988"
fx="18.417862"
cy="17.013988"
cx="18.417862"
id="radialGradient3259"
xlink:href="#linearGradient3253" />
<radialGradient
r="27.986705"
fy="17.013988"
fx="18.417862"
cy="17.013988"
cx="18.417862"
gradientTransform="matrix(0.9724373,-0.105657,0.05052317,0.4650009,-0.3519546,9.5854384)"
gradientUnits="userSpaceOnUse"
id="radialGradient3270"
xlink:href="#linearGradient3253" />
</defs>
<metadata
id="metadata6253">
<rdf:RDF>
<cc:Work
rdf:about="">
<dc:format>image/svg+xml</dc:format>
<dc:type
rdf:resource="http://purl.org/dc/dcmitype/StillImage" />
<dc:title></dc:title>
</cc:Work>
</rdf:RDF>
</metadata>
<g
id="layer1">
<g
transform="matrix(-1,0,0,0.99363058,4,0.0382165)"
id="g3913-7">
<path
style="fill:none;stroke:#042a2a;stroke-width:6.01919985;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:4;stroke-opacity:1;stroke-dasharray:none;stroke-dashoffset:6.01920039"
d="M -55,47.282051 -28,35.564103 -28,4.974359 -55,16.692308 z"
id="path3003-5-3-0" />
<path
style="fill:none;stroke:#16d0d2;stroke-width:2.00640011;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:4;stroke-opacity:1;stroke-dasharray:none;stroke-dashoffset:6.01920003"
d="M -55,47.282051 -28,35.564103 -28,4.974359 -55,16.692308 z"
id="path3003-5-3-1-9" />
</g>
<g
transform="translate(60,0)"
id="g3913">
<path
style="fill:none;stroke:#042a2a;stroke-width:6;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:4;stroke-opacity:1;stroke-dasharray:none;stroke-dashoffset:6"
d="M -55,47.307692 -28,35.615385 -28,5 -55,16.692308 z"
id="path3003-5-3" />
<path
style="fill:none;stroke:#16d0d2;stroke-width:2;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:4;stroke-opacity:1;stroke-dasharray:none;stroke-dashoffset:6"
d="M -55,47.307692 -28,35.615385 -28,5 -55,16.692308 z"
id="path3003-5-3-1" />
</g>
<path
id="path3003"
d="M 32,59 5,47.307692 5,16.692308 32,28.384615 z"
style="fill:none;stroke:#042a2a;stroke-width:6;stroke-linecap:butt;stroke-linejoin:round;stroke-miterlimit:4;stroke-opacity:1;stroke-dasharray:none" />
<path
id="path3003-5"
d="M 32,59 59,47.307692 59,16.692308 32,28.384615 z"
style="fill:none;stroke:#042a2a;stroke-width:6;stroke-linecap:butt;stroke-linejoin:round;stroke-miterlimit:4;stroke-opacity:1;stroke-dasharray:none" />
<path
id="path3003-2-2"
d="M 59,16.692308 32,28.384615 5,16.692308 32,5 z"
style="fill:none;stroke:#042a2a;stroke-width:6;stroke-linecap:butt;stroke-linejoin:round;stroke-miterlimit:4;stroke-opacity:1;stroke-dasharray:none" />
<path
id="path3003-3"
d="M 32,59 5,47.307692 5,16.692308 32,28.384615 z"
style="fill:none;stroke:#16d0d2;stroke-width:2;stroke-linecap:butt;stroke-linejoin:round;stroke-miterlimit:4;stroke-opacity:1;stroke-dasharray:none" />
<path
id="path3003-5-6"
d="M 32,59 59,47.307692 59,16.692308 32,28.384615 z"
style="fill:none;stroke:#16d0d2;stroke-width:2;stroke-linecap:butt;stroke-linejoin:round;stroke-miterlimit:4;stroke-opacity:1;stroke-dasharray:none" />
<path
id="path3003-2"
d="M 59,16.692308 32,28.384615 5,16.692308 32,5 z"
style="fill:none;stroke:#34e0e2;stroke-width:2;stroke-linecap:butt;stroke-linejoin:round;stroke-miterlimit:4;stroke-opacity:1;stroke-dasharray:none" />
</g>
</svg>

Before

Width:  |  Height:  |  Size: 5.4 KiB

View file

@ -1,166 +0,0 @@
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<!-- Created with Inkscape (http://www.inkscape.org/) -->
<svg
xmlns:dc="http://purl.org/dc/elements/1.1/"
xmlns:cc="http://creativecommons.org/ns#"
xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
xmlns:svg="http://www.w3.org/2000/svg"
xmlns="http://www.w3.org/2000/svg"
xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd"
xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape"
version="1.1"
width="64.1875"
height="64.1875"
id="svg3799"
inkscape:version="0.91 r13725"
sodipodi:docname="my_resources.svg">
<sodipodi:namedview
pagecolor="#ffffff"
bordercolor="#666666"
borderopacity="1"
objecttolerance="10"
gridtolerance="10"
guidetolerance="10"
inkscape:pageopacity="0"
inkscape:pageshadow="2"
inkscape:window-width="1855"
inkscape:window-height="1056"
id="namedview3241"
showgrid="false"
inkscape:zoom="3.2883564"
inkscape:cx="103.51645"
inkscape:cy="-10.131949"
inkscape:window-x="65"
inkscape:window-y="24"
inkscape:window-maximized="1"
inkscape:current-layer="svg3799" />
<defs
id="defs3801">
<marker
refX="0"
refY="0"
orient="auto"
id="EmptyTriangleOutL"
style="overflow:visible">
<path
d="m 5.77,0 -8.65,5 0,-10 8.65,5 z"
transform="matrix(0.8,0,0,0.8,-4.8,0)"
id="path4487"
style="fill:#ffffff;fill-rule:evenodd;stroke:#000000;stroke-width:1pt" />
</marker>
<marker
refX="0"
refY="0"
orient="auto"
id="DotS"
style="overflow:visible">
<path
d="m -2.5,-1 c 0,2.76 -2.24,5 -5,5 -2.76,0 -5,-2.24 -5,-5 0,-2.76 2.24,-5 5,-5 2.76,0 5,2.24 5,5 z"
transform="matrix(0.2,0,0,0.2,1.48,0.2)"
id="path4394"
style="fill-rule:evenodd;stroke:#000000;stroke-width:1pt" />
</marker>
<marker
refX="0"
refY="0"
orient="auto"
id="DotL"
style="overflow:visible">
<path
d="m -2.5,-1 c 0,2.76 -2.24,5 -5,5 -2.76,0 -5,-2.24 -5,-5 0,-2.76 2.24,-5 5,-5 2.76,0 5,2.24 5,5 z"
transform="matrix(0.8,0,0,0.8,5.92,0.8)"
id="path4388"
style="fill-rule:evenodd;stroke:#000000;stroke-width:1pt" />
</marker>
<marker
refX="0"
refY="0"
orient="auto"
id="Tail"
style="overflow:visible">
<g
transform="scale(-1.2,-1.2)"
id="g4363">
<path
d="M -3.8048674,-3.9585227 0.54352094,0"
id="path4365"
style="fill:none;stroke:#000000;stroke-width:0.80000001;stroke-linecap:round" />
<path
d="M -1.2866832,-3.9585227 3.0617053,0"
id="path4367"
style="fill:none;stroke:#000000;stroke-width:0.80000001;stroke-linecap:round" />
<path
d="M 1.3053582,-3.9585227 5.6537466,0"
id="path4369"
style="fill:none;stroke:#000000;stroke-width:0.80000001;stroke-linecap:round" />
<path
d="M -3.8048674,4.1775838 0.54352094,0.21974226"
id="path4371"
style="fill:none;stroke:#000000;stroke-width:0.80000001;stroke-linecap:round" />
<path
d="M -1.2866832,4.1775838 3.0617053,0.21974226"
id="path4373"
style="fill:none;stroke:#000000;stroke-width:0.80000001;stroke-linecap:round" />
<path
d="M 1.3053582,4.1775838 5.6537466,0.21974226"
id="path4375"
style="fill:none;stroke:#000000;stroke-width:0.80000001;stroke-linecap:round" />
</g>
</marker>
<marker
refX="0"
refY="0"
orient="auto"
id="Arrow1Sstart"
style="overflow:visible">
<path
d="M 0,0 5,-5 -12.5,0 5,5 0,0 z"
transform="matrix(0.2,0,0,0.2,1.2,0)"
id="path4339"
style="fill-rule:evenodd;stroke:#000000;stroke-width:1pt" />
</marker>
<marker
refX="0"
refY="0"
orient="auto"
id="Arrow1Lstart"
style="overflow:visible">
<path
d="M 0,0 5,-5 -12.5,0 5,5 0,0 z"
transform="matrix(0.8,0,0,0.8,10,0)"
id="path4327"
style="fill-rule:evenodd;stroke:#000000;stroke-width:1pt" />
</marker>
</defs>
<metadata
id="metadata3804">
<rdf:RDF>
<cc:Work
rdf:about="">
<dc:format>image/svg+xml</dc:format>
<dc:type
rdf:resource="http://purl.org/dc/dcmitype/StillImage" />
<dc:title></dc:title>
</cc:Work>
</rdf:RDF>
</metadata>
<rect
style="fill:none;stroke:#ff0000;stroke-width:10"
id="rect4592"
width="43.182667"
height="47.440113"
x="10.643615"
y="8.2324944" />
<text
xml:space="preserve"
style="font-style:normal;font-weight:normal;font-size:40px;line-height:125%;font-family:sans-serif;letter-spacing:0px;word-spacing:0px;fill:#000000;fill-opacity:1;stroke:none;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1"
x="19.766714"
y="45.637199"
id="text4594"
sodipodi:linespacing="125%"><tspan
sodipodi:role="line"
id="tspan4596"
x="19.766714"
y="45.637199">T</tspan></text>
</svg>

Before

Width:  |  Height:  |  Size: 5.2 KiB

View file

@ -1,47 +0,0 @@
import os
import FreeCADGui as Gui
import FreeCAD as App
from gui.init_gui import StabilityWorkbench
import json
def importObjAtPath(path: str):
import importOBJ
importOBJ.insert(u"" + path, App.ActiveDocument.Label)
pass
def getFullPathObj(assemblyFolder: str, name: str):
return assemblyFolder + 'sdf/meshes/' + name + '.obj'
def main():
App.newDocument()
env = json.loads((open('./env.json')).read())
assemblyFolder = env.get('assemblyFolder')
assemblyStructure = json.loads(
(open(assemblyFolder + 'step-structure.json')).read())
assemblyNumber = int(env.get('buildNumber')) - 1
activeDetail = assemblyStructure[assemblyNumber]
subassemblyNotParticipatingInMarkup = assemblyStructure[0:assemblyNumber - 1]
detailOfTheMarkingZoneOfWhich = assemblyStructure[assemblyNumber - 1]
importObjAtPath(getFullPathObj(assemblyFolder, activeDetail))
importObjAtPath(getFullPathObj(
assemblyFolder, detailOfTheMarkingZoneOfWhich))
meshMark = App.ActiveDocument.Objects[0]
meshDetailOfTheMarkZone = App.ActiveDocument.Objects[1]
meshMark.ViewObject.ShapeColor = (0.31, 0.77, 0.87)
meshDetailOfTheMarkZone.ViewObject.ShapeColor = (0.68, 0.66, 0.95)
for el in list(map(lambda el: getFullPathObj(assemblyFolder, el), subassemblyNotParticipatingInMarkup)):
importObjAtPath(el)
for el in App.ActiveDocument.Objects[2:App.ActiveDocument.Objects.__len__()]:
el.ViewObject.ShapeColor = (0.32, 0.05, 0.38)
Gui.SendMsgToActiveView("ViewSelection")
Gui.addWorkbench(StabilityWorkbench(env.get('resultURL')))
Gui.activateWorkbench("StabilityWorkbench")
main()

View file

@ -1,4 +0,0 @@
import os
from .version import __version__
ICONPATH = os.path.join(os.path.dirname(__file__), "resources")

View file

@ -1,89 +0,0 @@
import os
import FreeCADGui as Gui
import FreeCAD as App
from PySide.QtCore import QT_TRANSLATE_NOOP
import shutil
ICONPATH = os.path.join(os.path.dirname(__file__), "resources")
zone = "StabilityZone"
import requests
import importOBJ
class AddStabilityZone:
def __init__(self):
pass
def GetResources(self):
return {'Pixmap': os.path.join(ICONPATH, "stability_zone.svg"),
'Accel': "Ctrl+A",
'MenuText': QT_TRANSLATE_NOOP("My_Command", "My Command"),
'ToolTip': QT_TRANSLATE_NOOP("My_Command", "Runs my command in the active document")}
def Activated(self):
App.ActiveDocument.addObject("Part::Box", "Box")
App.ActiveDocument.ActiveObject.Label = zone
selected_object = App.ActiveDocument.getObjectsByLabel(zone)[0]
selected_object.ViewObject.Transparency = 50
selected_object.ViewObject.ShapeColor = (0.15, 0.80, 0.50)
pass
def IsActive(self):
return True
class SyncServer:
httpURL = None
def __init__(self, httpURL):
self.httpURL = httpURL
def GetResources(self):
return {'Pixmap': os.path.join(ICONPATH, "server_sync.svg"),
'Accel': "Ctrl+A",
'MenuText': QT_TRANSLATE_NOOP("My_Command", "My Command"),
'ToolTip': QT_TRANSLATE_NOOP("My_Command", "Runs my command in the active document")}
def Activated(self):
StabilityZone = App.ActiveDocument.getObjectsByLabel(zone)
dir_path = os.path.dirname(os.path.realpath(__file__))
dir_out = dir_path + '/out/'
if not os.path.exists(dir_out):
os.makedirs(dir_out)
importOBJ.export(StabilityZone, u"" + dir_out + 'StabilityZone.obj')
shutil.make_archive(dir_out + '/' + 'geometry', 'zip',)
zipArch = dir_out + 'geometry.zip'
requests.post(url=self.httpURL, files={'zip': open(zipArch, "rb")})
shutil.rmtree(dir_out)
pass
def IsActive(self):
return True
class StabilityWorkbench(Gui.Workbench):
MenuText = "stability workbench"
ToolTip = "a simple template workbench"
Icon = os.path.join(ICONPATH, "template_resource.svg")
toolbox = ['AddStabilityZone', 'SyncServer']
httpURL = None
def __init__(self,httpURL):
self.httpURL = httpURL
def GetClassName(self):
return "Gui::PythonWorkbench"
def Initialize(self):
Gui.addCommand('AddStabilityZone', AddStabilityZone())
Gui.addCommand('SyncServer', SyncServer(
self.httpURL))
self.appendToolbar("Tools", self.toolbox)
self.appendMenu("Tools", self.toolbox)
def Activated(self):
pass
def Deactivated(self):
pass

View file

@ -1,134 +0,0 @@
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<!-- Created with Inkscape (http://www.inkscape.org/) -->
<svg
xmlns:dc="http://purl.org/dc/elements/1.1/"
xmlns:cc="http://creativecommons.org/ns#"
xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
xmlns:svg="http://www.w3.org/2000/svg"
xmlns="http://www.w3.org/2000/svg"
xmlns:xlink="http://www.w3.org/1999/xlink"
xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd"
xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape"
width="64"
height="64"
id="svg2985"
version="1.1"
inkscape:version="0.48.5 r10040"
sodipodi:docname="button_valid.svg">
<defs
id="defs2987">
<linearGradient
inkscape:collect="always"
id="linearGradient3774">
<stop
style="stop-color:#4e9a06;stop-opacity:1"
offset="0"
id="stop3776" />
<stop
style="stop-color:#8ae234;stop-opacity:1"
offset="1"
id="stop3778" />
</linearGradient>
<linearGradient
inkscape:collect="always"
xlink:href="#linearGradient4082"
id="linearGradient3922-0"
gradientUnits="userSpaceOnUse"
gradientTransform="matrix(-0.56091264,-0.498646,0.48035179,-0.58227539,-177.89813,269.15635)"
x1="10.387"
y1="453.77875"
x2="56.319412"
y2="483.99524" />
<linearGradient
id="linearGradient4082">
<stop
id="stop4084"
offset="0"
style="stop-color:#4e9a06;stop-opacity:1" />
<stop
id="stop4086"
offset="1"
style="stop-color:#8ae234;stop-opacity:1" />
</linearGradient>
<linearGradient
inkscape:collect="always"
xlink:href="#linearGradient3774"
id="linearGradient3780"
x1="30"
y1="-2"
x2="26"
y2="-26"
gradientUnits="userSpaceOnUse" />
<linearGradient
inkscape:collect="always"
xlink:href="#linearGradient3774"
id="linearGradient2999"
gradientUnits="userSpaceOnUse"
x1="30"
y1="-2"
x2="26"
y2="-26" />
</defs>
<sodipodi:namedview
id="base"
pagecolor="#ffffff"
bordercolor="#666666"
borderopacity="1.0"
inkscape:pageopacity="0.0"
inkscape:pageshadow="2"
inkscape:zoom="15.696216"
inkscape:cx="42.681569"
inkscape:cy="45.101596"
inkscape:current-layer="g2995"
showgrid="true"
inkscape:grid-bbox="true"
inkscape:document-units="px"
inkscape:window-width="1600"
inkscape:window-height="837"
inkscape:window-x="0"
inkscape:window-y="27"
inkscape:window-maximized="1">
<inkscape:grid
type="xygrid"
id="grid2983"
empspacing="2"
visible="true"
enabled="true"
snapvisiblegridlinesonly="true" />
</sodipodi:namedview>
<metadata
id="metadata2990">
<rdf:RDF>
<cc:Work
rdf:about="">
<dc:format>image/svg+xml</dc:format>
<dc:type
rdf:resource="http://purl.org/dc/dcmitype/StillImage" />
<dc:title></dc:title>
</cc:Work>
</rdf:RDF>
</metadata>
<g
id="layer1"
inkscape:label="Layer 1"
inkscape:groupmode="layer"
transform="translate(0,48)">
<g
id="g2995"
transform="matrix(1.2252683,0,0,1.2252683,-6.3014179,2.4330891)">
<path
sodipodi:nodetypes="ccccccc"
inkscape:connector-curvature="0"
id="path4088"
d="m 15.48076,-21.246576 10.519239,10.519232 21.038474,-21.038464 7.889428,7.889424 L 25.999999,5.0515065 7.5913312,-13.357152 z"
style="fill:url(#linearGradient2999);fill-opacity:1;stroke:#172a04;stroke-width:1.63229537;stroke-linecap:butt;stroke-linejoin:round;stroke-opacity:1" />
<path
sodipodi:nodetypes="ccccccc"
inkscape:connector-curvature="0"
id="path3004"
d="M 9.9510978,-13.350403 15.477822,-18.889628 26,-8.4375583 47.031855,-29.448573 52.57108,-23.872581 26,2.7352662 z"
style="fill:none;stroke:#8ae234;stroke-width:1.63229549;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1" />
</g>
</g>
</svg>

Before

Width:  |  Height:  |  Size: 4.1 KiB

View file

@ -1,142 +0,0 @@
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<svg
xmlns:dc="http://purl.org/dc/elements/1.1/"
xmlns:cc="http://creativecommons.org/ns#"
xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
xmlns:svg="http://www.w3.org/2000/svg"
xmlns="http://www.w3.org/2000/svg"
xmlns:xlink="http://www.w3.org/1999/xlink"
version="1.1"
id="svg6248"
height="64px"
width="64px">
<defs
id="defs6250">
<linearGradient
id="linearGradient3253">
<stop
id="stop3255"
offset="0"
style="stop-color:#89d5f8;stop-opacity:1;" />
<stop
id="stop3257"
offset="1"
style="stop-color:#00899e;stop-opacity:1;" />
</linearGradient>
<linearGradient
id="linearGradient6816">
<stop
id="stop6818"
offset="0"
style="stop-color:#000000;stop-opacity:1;" />
<stop
id="stop6820"
offset="1"
style="stop-color:#000000;stop-opacity:0;" />
</linearGradient>
<linearGradient
id="linearGradient6781">
<stop
id="stop6783"
offset="0"
style="stop-color:#ffffff;stop-opacity:1;" />
<stop
id="stop6785"
offset="1"
style="stop-color:#3465a4;stop-opacity:0;" />
</linearGradient>
<radialGradient
gradientUnits="userSpaceOnUse"
gradientTransform="matrix(1.1581633,0,0,0.6558985,-7.29237,16.126077)"
r="25.198714"
fy="51.929391"
fx="33.369828"
cy="51.929391"
cx="33.369828"
id="radialGradient6822"
xlink:href="#linearGradient6816" />
<radialGradient
gradientUnits="userSpaceOnUse"
gradientTransform="matrix(0.9724373,-0.105657,5.0523169e-2,0.4650009,-0.3519546,9.5854384)"
r="27.986705"
fy="17.013988"
fx="18.417862"
cy="17.013988"
cx="18.417862"
id="radialGradient3259"
xlink:href="#linearGradient3253" />
<radialGradient
r="27.986705"
fy="17.013988"
fx="18.417862"
cy="17.013988"
cx="18.417862"
gradientTransform="matrix(0.9724373,-0.105657,0.05052317,0.4650009,-0.3519546,9.5854384)"
gradientUnits="userSpaceOnUse"
id="radialGradient3270"
xlink:href="#linearGradient3253" />
</defs>
<metadata
id="metadata6253">
<rdf:RDF>
<cc:Work
rdf:about="">
<dc:format>image/svg+xml</dc:format>
<dc:type
rdf:resource="http://purl.org/dc/dcmitype/StillImage" />
<dc:title></dc:title>
</cc:Work>
</rdf:RDF>
</metadata>
<g
id="layer1">
<g
transform="matrix(-1,0,0,0.99363058,4,0.0382165)"
id="g3913-7">
<path
style="fill:none;stroke:#042a2a;stroke-width:6.01919985;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:4;stroke-opacity:1;stroke-dasharray:none;stroke-dashoffset:6.01920039"
d="M -55,47.282051 -28,35.564103 -28,4.974359 -55,16.692308 z"
id="path3003-5-3-0" />
<path
style="fill:none;stroke:#16d0d2;stroke-width:2.00640011;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:4;stroke-opacity:1;stroke-dasharray:none;stroke-dashoffset:6.01920003"
d="M -55,47.282051 -28,35.564103 -28,4.974359 -55,16.692308 z"
id="path3003-5-3-1-9" />
</g>
<g
transform="translate(60,0)"
id="g3913">
<path
style="fill:none;stroke:#042a2a;stroke-width:6;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:4;stroke-opacity:1;stroke-dasharray:none;stroke-dashoffset:6"
d="M -55,47.307692 -28,35.615385 -28,5 -55,16.692308 z"
id="path3003-5-3" />
<path
style="fill:none;stroke:#16d0d2;stroke-width:2;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:4;stroke-opacity:1;stroke-dasharray:none;stroke-dashoffset:6"
d="M -55,47.307692 -28,35.615385 -28,5 -55,16.692308 z"
id="path3003-5-3-1" />
</g>
<path
id="path3003"
d="M 32,59 5,47.307692 5,16.692308 32,28.384615 z"
style="fill:none;stroke:#042a2a;stroke-width:6;stroke-linecap:butt;stroke-linejoin:round;stroke-miterlimit:4;stroke-opacity:1;stroke-dasharray:none" />
<path
id="path3003-5"
d="M 32,59 59,47.307692 59,16.692308 32,28.384615 z"
style="fill:none;stroke:#042a2a;stroke-width:6;stroke-linecap:butt;stroke-linejoin:round;stroke-miterlimit:4;stroke-opacity:1;stroke-dasharray:none" />
<path
id="path3003-2-2"
d="M 59,16.692308 32,28.384615 5,16.692308 32,5 z"
style="fill:none;stroke:#042a2a;stroke-width:6;stroke-linecap:butt;stroke-linejoin:round;stroke-miterlimit:4;stroke-opacity:1;stroke-dasharray:none" />
<path
id="path3003-3"
d="M 32,59 5,47.307692 5,16.692308 32,28.384615 z"
style="fill:none;stroke:#16d0d2;stroke-width:2;stroke-linecap:butt;stroke-linejoin:round;stroke-miterlimit:4;stroke-opacity:1;stroke-dasharray:none" />
<path
id="path3003-5-6"
d="M 32,59 59,47.307692 59,16.692308 32,28.384615 z"
style="fill:none;stroke:#16d0d2;stroke-width:2;stroke-linecap:butt;stroke-linejoin:round;stroke-miterlimit:4;stroke-opacity:1;stroke-dasharray:none" />
<path
id="path3003-2"
d="M 59,16.692308 32,28.384615 5,16.692308 32,5 z"
style="fill:none;stroke:#34e0e2;stroke-width:2;stroke-linecap:butt;stroke-linejoin:round;stroke-miterlimit:4;stroke-opacity:1;stroke-dasharray:none" />
</g>
</svg>

Before

Width:  |  Height:  |  Size: 5.4 KiB

View file

@ -1,166 +0,0 @@
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<!-- Created with Inkscape (http://www.inkscape.org/) -->
<svg
xmlns:dc="http://purl.org/dc/elements/1.1/"
xmlns:cc="http://creativecommons.org/ns#"
xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
xmlns:svg="http://www.w3.org/2000/svg"
xmlns="http://www.w3.org/2000/svg"
xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd"
xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape"
version="1.1"
width="64.1875"
height="64.1875"
id="svg3799"
inkscape:version="0.91 r13725"
sodipodi:docname="my_resources.svg">
<sodipodi:namedview
pagecolor="#ffffff"
bordercolor="#666666"
borderopacity="1"
objecttolerance="10"
gridtolerance="10"
guidetolerance="10"
inkscape:pageopacity="0"
inkscape:pageshadow="2"
inkscape:window-width="1855"
inkscape:window-height="1056"
id="namedview3241"
showgrid="false"
inkscape:zoom="3.2883564"
inkscape:cx="103.51645"
inkscape:cy="-10.131949"
inkscape:window-x="65"
inkscape:window-y="24"
inkscape:window-maximized="1"
inkscape:current-layer="svg3799" />
<defs
id="defs3801">
<marker
refX="0"
refY="0"
orient="auto"
id="EmptyTriangleOutL"
style="overflow:visible">
<path
d="m 5.77,0 -8.65,5 0,-10 8.65,5 z"
transform="matrix(0.8,0,0,0.8,-4.8,0)"
id="path4487"
style="fill:#ffffff;fill-rule:evenodd;stroke:#000000;stroke-width:1pt" />
</marker>
<marker
refX="0"
refY="0"
orient="auto"
id="DotS"
style="overflow:visible">
<path
d="m -2.5,-1 c 0,2.76 -2.24,5 -5,5 -2.76,0 -5,-2.24 -5,-5 0,-2.76 2.24,-5 5,-5 2.76,0 5,2.24 5,5 z"
transform="matrix(0.2,0,0,0.2,1.48,0.2)"
id="path4394"
style="fill-rule:evenodd;stroke:#000000;stroke-width:1pt" />
</marker>
<marker
refX="0"
refY="0"
orient="auto"
id="DotL"
style="overflow:visible">
<path
d="m -2.5,-1 c 0,2.76 -2.24,5 -5,5 -2.76,0 -5,-2.24 -5,-5 0,-2.76 2.24,-5 5,-5 2.76,0 5,2.24 5,5 z"
transform="matrix(0.8,0,0,0.8,5.92,0.8)"
id="path4388"
style="fill-rule:evenodd;stroke:#000000;stroke-width:1pt" />
</marker>
<marker
refX="0"
refY="0"
orient="auto"
id="Tail"
style="overflow:visible">
<g
transform="scale(-1.2,-1.2)"
id="g4363">
<path
d="M -3.8048674,-3.9585227 0.54352094,0"
id="path4365"
style="fill:none;stroke:#000000;stroke-width:0.80000001;stroke-linecap:round" />
<path
d="M -1.2866832,-3.9585227 3.0617053,0"
id="path4367"
style="fill:none;stroke:#000000;stroke-width:0.80000001;stroke-linecap:round" />
<path
d="M 1.3053582,-3.9585227 5.6537466,0"
id="path4369"
style="fill:none;stroke:#000000;stroke-width:0.80000001;stroke-linecap:round" />
<path
d="M -3.8048674,4.1775838 0.54352094,0.21974226"
id="path4371"
style="fill:none;stroke:#000000;stroke-width:0.80000001;stroke-linecap:round" />
<path
d="M -1.2866832,4.1775838 3.0617053,0.21974226"
id="path4373"
style="fill:none;stroke:#000000;stroke-width:0.80000001;stroke-linecap:round" />
<path
d="M 1.3053582,4.1775838 5.6537466,0.21974226"
id="path4375"
style="fill:none;stroke:#000000;stroke-width:0.80000001;stroke-linecap:round" />
</g>
</marker>
<marker
refX="0"
refY="0"
orient="auto"
id="Arrow1Sstart"
style="overflow:visible">
<path
d="M 0,0 5,-5 -12.5,0 5,5 0,0 z"
transform="matrix(0.2,0,0,0.2,1.2,0)"
id="path4339"
style="fill-rule:evenodd;stroke:#000000;stroke-width:1pt" />
</marker>
<marker
refX="0"
refY="0"
orient="auto"
id="Arrow1Lstart"
style="overflow:visible">
<path
d="M 0,0 5,-5 -12.5,0 5,5 0,0 z"
transform="matrix(0.8,0,0,0.8,10,0)"
id="path4327"
style="fill-rule:evenodd;stroke:#000000;stroke-width:1pt" />
</marker>
</defs>
<metadata
id="metadata3804">
<rdf:RDF>
<cc:Work
rdf:about="">
<dc:format>image/svg+xml</dc:format>
<dc:type
rdf:resource="http://purl.org/dc/dcmitype/StillImage" />
<dc:title></dc:title>
</cc:Work>
</rdf:RDF>
</metadata>
<rect
style="fill:none;stroke:#ff0000;stroke-width:10"
id="rect4592"
width="43.182667"
height="47.440113"
x="10.643615"
y="8.2324944" />
<text
xml:space="preserve"
style="font-style:normal;font-weight:normal;font-size:40px;line-height:125%;font-family:sans-serif;letter-spacing:0px;word-spacing:0px;fill:#000000;fill-opacity:1;stroke:none;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1"
x="19.766714"
y="45.637199"
id="text4594"
sodipodi:linespacing="125%"><tspan
sodipodi:role="line"
id="tspan4596"
x="19.766714"
y="45.637199">T</tspan></text>
</svg>

Before

Width:  |  Height:  |  Size: 5.2 KiB

View file

@ -1 +0,0 @@
__version__ = "0.8.1"

View file

@ -1,47 +0,0 @@
import os
import FreeCADGui as Gui
import FreeCAD as App
from gui.init_gui import StabilityWorkbench
import json
def importObjAtPath(path: str):
import importOBJ
importOBJ.insert(u"" + path, App.ActiveDocument.Label)
pass
def getFullPathObj(assemblyFolder: str, name: str):
return assemblyFolder + 'sdf/meshes/' + name + '.obj'
def main():
App.newDocument()
env = json.loads((open('./env.json')).read())
assemblyFolder = env.get('assemblyFolder')
assemblyStructure = json.loads(
(open(assemblyFolder + 'step-structure.json')).read())
assemblyNumber = int(env.get('buildNumber')) - 1
activeDetail = assemblyStructure[assemblyNumber]
subassemblyNotParticipatingInMarkup = assemblyStructure[0:assemblyNumber - 1]
detailOfTheMarkingZoneOfWhich = assemblyStructure[assemblyNumber - 1]
importObjAtPath(getFullPathObj(assemblyFolder, activeDetail))
importObjAtPath(getFullPathObj(
assemblyFolder, detailOfTheMarkingZoneOfWhich))
meshMark = App.ActiveDocument.Objects[0]
meshDetailOfTheMarkZone = App.ActiveDocument.Objects[1]
meshMark.ViewObject.ShapeColor = (0.31, 0.77, 0.87)
meshDetailOfTheMarkZone.ViewObject.ShapeColor = (0.68, 0.66, 0.95)
for el in list(map(lambda el: getFullPathObj(assemblyFolder, el), subassemblyNotParticipatingInMarkup)):
importObjAtPath(el)
for el in App.ActiveDocument.Objects[2:App.ActiveDocument.Objects.__len__()]:
el.ViewObject.ShapeColor = (0.32, 0.05, 0.38)
Gui.SendMsgToActiveView("ViewSelection")
Gui.addWorkbench(StabilityWorkbench(env.get('resultURL')))
Gui.activateWorkbench("StabilityWorkbench")
main()

View file

@ -1,27 +0,0 @@
import FreeCAD
# Функция для получения списка всех объектов с заданным свойством
def get_objects_with_property(property_name, property_value):
result = []
for obj in FreeCAD.ActiveDocument.Objects:
if hasattr(obj, "PropertiesList") and property_name in obj.PropertiesList:
if obj.getPropertyByName(property_name) == property_value:
result.append(obj)
return result
# Получение списка всех объектов с названием тела в свойстве
bodies = get_objects_with_property("BodyName", "Body")
# Получение списка всех объектов
all_objects = FreeCAD.ActiveDocument.Objects
# Поиск и вывод тел, у которых нет связанных вспомогательных объектов
for body in bodies:
linked_objects = []
for obj in all_objects:
if obj.hasLinkOf(body):
linked_objects.append(obj.Name)
if not linked_objects:
print(f"Тело без связанных объектов: {body.Name}")

View file

@ -1,141 +0,0 @@
import FreeCAD as App
import json
import os
def has_active_document():
doc = App.activeDocument()
if not doc:
App.Console.PrintError("Нет активного документа в FreeCAD.\n")
return False
return True
def get_assembly_settings_folder():
if not has_active_document():
return False
doc = App.activeDocument()
assembly_settings_folder = None
for obj in doc.Objects:
if obj.Name == "Assembly_Settings":
assembly_settings_folder = obj
break
if not assembly_settings_folder:
assembly_settings_folder = doc.addObject("App::DocumentObjectGroup", "Assembly_Settings")
return assembly_settings_folder
#Создаем объект, описывающий крепежные элементы
#Стоит отметить, что структура крепежа может быть сложнее, чем просто винт. В будущем стоит придумать, как отразить эту структуру, если это необходимо
def create_fastener_set():
doc = App.activeDocument()
assembly_settings_folder = get_assembly_settings_folder()
fastener_set = doc.addObject("Part::FeaturePython", "Fastener_Set")
fastener_set.addProperty("App::PropertyString", "Type", 'Asm_Settings').Type = 'fastener_set'
fastener_set.addProperty("App::PropertyLink", "Parent", 'Asm_Settings')
fastener_set.addProperty("App::PropertyLink", "Child", 'Asm_Settings')
fastener_set.addProperty("App::PropertyLinkList", "Fasteners", 'Asm_Settings')
assembly_settings_folder.addObject(fastener_set)
#Жесткая последовательность для двух деталей
def create_assembly_sequence():
doc = App.activeDocument()
assembly_settings_folder = get_assembly_settings_folder()
assembly_sequence = doc.addObject("Part::FeaturePython", "Assembly_Sequence")
assembly_sequence.addProperty("App::PropertyString", "Type", 'Asm_Settings').Type = 'asm_sequence'
assembly_sequence.addProperty("App::PropertyLink", "Parent", 'Asm_Settings')
assembly_sequence.addProperty("App::PropertyLink", "Child", 'Asm_Settings')
assembly_settings_folder.addObject(assembly_sequence)
#Допустимый зазор для группы элементов, при котором будут распознаваться контакты с окружающими деталями
def create_clearance_constraint(max_clearance = 1.0):
doc = App.activeDocument()
assembly_settings_folder = get_assembly_settings_folder()
clearance_constraint = doc.addObject("Part::FeaturePython", "Clearance_Constraint")
clearance_constraint.addProperty("App::PropertyLinkList", "PartName", 'Asm_Settings')
clearance_constraint.addProperty("App::PropertyString", "Type", 'Asm_Settings').Type = 'clearance'
clearance_constraint.addProperty("App::PropertyFloat", "MaxClearance", 'Asm_Settings').MaxClearance = max_clearance
assembly_settings_folder.addObject(clearance_constraint)
def create_assembly_parameters():
doc = App.activeDocument()
assembly_settings_folder = get_assembly_settings_folder()
assembly_parameters = doc.addObject("Part::FeaturePython", "Assembly_Parameters")
assembly_parameters.addProperty("App::PropertyFloat", "Subassembly_Size", 'Asm_Settings')
assembly_parameters.addProperty("App::PropertyLink", "Subassembly_Mass", 'Asm_Settings')
assembly_parameters.addProperty("App::PropertyBool", "Materials_Together", 'Asm_Settings')
assembly_parameters.addProperty("App::PropertyFloat", "Total_Clearance")
assembly_settings_folder.addObject(assembly_parameters)
#экспорт всех заданных настроек в общий файл json
def export_assembly_settings():
doc = App.activeDocument()
if not doc:
return
assembly_settings_folder = None
for obj in doc.Objects:
if obj.Name == "Assembly_Settings":
assembly_settings_folder = obj
break
if not assembly_settings_folder:
return
data = []
for obj in assembly_settings_folder.Group:
if hasattr(obj, "Type"):
obj_dict = {"Name": obj.Name}
if obj.Type == "fastener_set":
fasteners = [part.Label for part in obj.Fasteners]
obj_dict.update({
"Type": "fastener_set",
"Parent": obj.Parent.Label,
"Child": obj.Child.Label,
"Fasteners": fasteners
})
elif obj.Type == "asm_sequence":
obj_dict.update({
"Type": "asm_sequence",
"Parent": obj.Parent.Label,
"Child": obj.Child.Label
})
elif obj.Type == "clearance":
partnames = [part.Label for part in obj.PartName]
obj_dict.update({
"Type": "clearance",
"PartName": partnames,
"MaxClearance": obj.MaxClearance
})
data.append(obj_dict)
save_dir = os.path.dirname(doc.FileName)
save_path = os.path.join(save_dir, "assembly_settings_" + App.ActiveDocument.Label + ".json")
with open(save_path, "w") as f:
json.dump(data, f, indent=4)
# create_fastener_set()
# create_assembly_sequence()
# create_clearance_constraint()
# export_assembly_settings()

View file

@ -1,51 +0,0 @@
import os
import json
import FreeCAD
import Tools
def export_coordinate_systems():
# Получение активного документа FreeCAD
doc = FreeCAD.ActiveDocument
if not doc:
raise ValueError("Нет активного документа FreeCAD.")
# Получение имени активного документа
doc_name = doc.Name
# Получение пути к папке и имя файла активного документа
folder_path, file_name = os.path.split(doc.FileName)
# Создание папки для экспорта, если она не существует
output_folder = os.path.join(folder_path, 'entities')
if not os.path.exists(output_folder):
os.makedirs(output_folder)
# Создание копии активного документа
# надо сохраняться, а не копироваться
doc.save()
# Получение списка объектов документа
objects = doc.Objects
# Обход объектов для сохранения локальных систем координат
for obj in objects:
if obj.TypeId == 'PartDesign::CoordinateSystem':
partprops = Tools.getLocalPartProps(obj)
output_file_path = os.path.join(output_folder, f"{obj.Label}.json")
with open(output_file_path, "w", encoding="utf8") as propfile:
json.dump(partprops, propfile, indent=1, separators=(',', ': '))
print("Экспорт обьектов завершен.")
# export_coordinate_systems()

View file

@ -1,175 +0,0 @@
'''
DESCRIPTION.
- Reads a FreeCAD .FCStd file.
- Set tesselation parts to mesh.
- Return scene as JSON dictionary.
'''
import json
import FreeCAD
import Part
import Mesh
import MeshPart
import logging
import math
from freecad.robossembler.utils.is_object_solid import is_object_solid
from freecad.robossembler.utils.processor import process_file
from freecad.robossembler.utils.custom_parser import CustomArgumentParser
logger = logging.getLogger(__name__)
def freecad_to_json(**kwargs):
''' Reads a FreeCAD .FCStd file and return json assembly. '''
scene = {}
js_objs = {}
doc = FreeCAD.open(kwargs['fcstd_path'])
docname = doc.Name
# collect all materials
fem_mats = []
for fem_mat in doc.Objects:
if fem_mat.isDerivedFrom('App::MaterialObjectPython'):
fem_mats.append(fem_mat)
for obj in doc.Objects:
js_obj = {}
if kwargs['skiphidden']:
if not obj.Visibility:
continue
if obj.isDerivedFrom('PartDesign::CoordinateSystem'):
js_obj['type'] = 'LCS'
elif obj.isDerivedFrom('Part::Feature'):
js_obj['type'] = 'PART'
# filter for nonsolids
if is_object_solid(obj) or hasattr(obj, kwargs['property_forse_nonsolid']):
# create mesh from shape
shape = obj.Shape
shape = obj.Shape.copy()
shape.Placement = obj.Placement.inverse().multiply(shape.Placement)
meshfromshape = doc.addObject('Mesh::Feature', 'Mesh')
if kwargs['tesselation_method'] == 'Standard':
meshfromshape.Mesh = MeshPart.meshFromShape(
Shape=shape,
LinearDeflection=kwargs['linear_deflection'],
AngularDeflection=math.radians(kwargs['angular_deflection']),
Relative=False)
elif kwargs['tesselation_method'] == 'FEM':
meshfromshape.Mesh = MeshPart.meshFromShape(
Shape=shape,
MaxLength=kwargs['fem_size'])
else:
raise TypeError('Wrong tesselation method! '
'Standard and FEM methods are supported only!')
t = meshfromshape.Mesh.Topology
verts = [[v.x, v.y, v.z] for v in t[0]]
faces = t[1]
js_obj['mesh'] = (verts, faces)
# one material for the whole object
for fem_mat in fem_mats:
for ref in fem_mat.References:
if ref[0].Label == obj.Label:
js_obj['material'] = fem_mat.Material
# skip for other object's types
else:
continue
js_obj['fc_location'] = tuple(obj.Placement.Base)
js_obj['fc_rotation'] = obj.Placement.Rotation.Q
# construct assembly hierarchy
obj_parent = obj.getParentGeoFeatureGroup()
obj_child_name = None
parents = {}
deep_index = 0
while obj_parent:
parent = {}
parent['fc_location'] = tuple(obj_parent.Placement.Base)
parent['fc_rotation'] = obj_parent.Placement.Rotation.Q
obj_child_name = obj_parent.Label
obj_parent = obj_parent.getParentGeoFeatureGroup()
if obj_parent:
parent['parent'] = obj_parent.Label
else:
parent['parent'] = None
parents[obj_child_name] = parent
parent['deep_index'] = deep_index
deep_index += 1
js_obj['hierarchy'] = parents
js_objs[obj.Label] = js_obj
FreeCAD.closeDocument(docname)
scene[kwargs['fcstd_path']] = js_objs
logger.info('Passed %s objects without errors', len(js_objs))
print(json.dumps(scene))
# to run script via FreeCADCmd
parser = CustomArgumentParser()
parser.add_argument(
'--fcstd_path',
type=str,
help='Path to source FreeCAD scene',
required=True
)
parser.add_argument(
'--tesselation_method',
type=str,
help='Select tesselation method: Standard or FEM.',
default='Standard',
required=False
)
parser.add_argument(
'--linear_deflection',
type=float,
help='Max linear distance error',
default=0.1,
required=False
)
parser.add_argument(
'--angular_deflection',
type=float,
help='Max angular distance error',
default=20.0,
required=False
)
parser.add_argument(
'--fem_size',
type=float,
help='For FEM method only! Finite element size in mm',
default=50.0,
required=False
)
parser.add_argument(
'--skiphidden',
type=bool,
help='Skip processing for hidden FreeCAD objects',
default=True,
required=False
)
parser.add_argument(
'--property_forse_nonsolid',
type=str,
help='FreeCAD property to enable processing for nonsolid objects',
default='Robossembler_NonSolid',
required=False
)
fc_kwargs = vars(parser.parse_known_args()[0])
freecad_to_json(**fc_kwargs)
logger.info('FreeCAD scene passed!')

View file

@ -1,2 +0,0 @@
/Users/idontsudo/Desktop/FreeCAD.app/Contents/MacOS/FreeCAD
freecadcmd main.py

View file

@ -1,5 +0,0 @@
{
"cadFilePath": "path/to/file",
"outPath": "out/path",
"objectIndentation": 0
}

View file

@ -1,63 +0,0 @@
import FreeCAD as App
import FreeCAD.Console as Console
class GeometryUseCase:
def __init__(self, document):
self.document = document
def is_valid_geometry(self, obj):
return hasattr(obj, "Shape") and obj.Shape.Volume is not None
def create_intersection_matrix(self):
bodies = [obj for obj in self.document.Objects if self.is_valid_geometry(obj)]
num_bodies = len(bodies)
intersection_matrix = [[False for _ in range(num_bodies)] for _ in range(num_bodies)]
for i in range(num_bodies):
for j in range(i + 1, num_bodies):
body1 = bodies[i]
body2 = bodies[j]
if body1.Shape.common(body2.Shape).Volume > 0:
intersection_matrix[i][j] = True
intersection_matrix[j][i] = True
if not hasattr(body1, "AllowIntersections") or not hasattr(body2, "AllowIntersections"):
Console.PrintWarning(
f"Пересечение между '{body1.Name}' и '{body2.Name}' без разрешения.\n"
)
return intersection_matrix
def create_contact_matrix(self):
bodies = [obj for obj in self.document.Objects if self.is_valid_geometry(obj)]
num_bodies = len(bodies)
contact_matrix = [[False for _ in range(num_bodies)] for _ in range(num_bodies)]
for i in range(num_bodies):
for j in range(i + 1, num_bodies):
body1 = bodies[i]
body2 = bodies[j]
if body1.Shape.common(body2.Shape).SurfaceArea > 0:
contact_matrix[i][j] = True
contact_matrix[j][i] = True
return contact_matrix
doc = App.ActiveDocument
if doc is None:
Console.PrintError("Нет активного документа в FreeCAD.\n")
else:
use_case = GeometryUseCase(doc)
intersection_matrix = use_case.create_intersection_matrix()
Console.PrintMessage("Матрица пересечений:\n")
for row in intersection_matrix:
Console.PrintMessage(f"{row}\n")
contact_matrix = use_case.create_contact_matrix()
Console.PrintMessage("Матрица контактов:\n")
for row in contact_matrix:
Console.PrintMessage(f"{row}\n")

View file

@ -1,775 +0,0 @@
import FreeCAD as App
import uuid
import os
import json
from typing import List, Dict, Any, TypeVar, Callable, Type, cast
from itertools import repeat
class CoreList(List):
# the list contains only True
def onlyTrue(self) -> bool:
print(self)
for el in self:
if el is not True:
return False
return True
def isInListRange(listIn, index):
try:
listIn[index]
return False
except:
return True
class AllSequences:
all_sequences = None
adj_matrix = None
topologyIds = None
adj_matrix_names = None
def __init__(self, adj_matrix) -> None:
self.adj_matrix = adj_matrix
self.all_possible_sequences(self.adj_matrix)
self.matrix_by_name()
pass
def matrix_by_name(self):
result = self.all_sequences
inc = 0
for matrix in self.all_sequences:
for index in range(len(matrix)):
result[inc][index] = list(
filter(
lambda el: el.get("number") == matrix[index] + 1,
self.topologyIds,
)
)[0].get("name")
inc += 1
self.adj_matrix_names = result
pass
def find_all_sequences(self, adj_matrix):
sequences = []
num_vertices = len(adj_matrix)
def dfs(vertex, sequence):
sequence.append(vertex)
if len(sequence) == num_vertices:
sequences.append(sequence)
return
for i in range(num_vertices):
if adj_matrix[vertex][i] == 1 and i not in sequence:
dfs(i, sequence.copy())
for i in range(num_vertices):
dfs(i, [])
self.all_sequences = sequences
def findId(self, listMatrix, id):
def filter_odd_num(in_num):
if in_num["name"] == id:
return True
else:
return False
return list(filter(filter_odd_num, listMatrix))[0]["number"]
def iter_paths(self, adj, min_length=6, path=None):
if not path:
for start_node in range(len(adj)):
yield from self.iter_paths(adj, min_length, [start_node])
else:
if len(path) >= min_length:
yield path
if path[-1] in path[:-1]:
return
current_node = path[-1]
for next_node in range(len(adj[current_node])):
if adj[current_node][next_node] == 1:
yield from self.iter_paths(adj, min_length, path + [next_node])
def allUnique(self, x):
seen = set()
return not any(i in seen or seen.add(i) for i in x)
def all_possible_sequences(self, matrix):
topologyIds = []
topologyMatrixNumber = {}
inc = 0
for k, v in matrix.items():
inc += 1
topologyIds.append({"name": k, "number": inc})
inc = 0
for k, v in matrix.items():
inc += 1
topologyMatrixNumber[inc] = list(
map(lambda el: self.findId(topologyIds, el), v)
)
self.topologyIds = topologyIds
adj = []
matrixSize = matrix.keys().__len__()
inc = 0
for k, v in topologyMatrixNumber.items():
adj.append(list(repeat(0, matrixSize)))
for el in v:
adj[inc][el - 1] = 1
inc += 1
return self.find_all_sequences(adj)
class VectorModel:
x: float
y: float
z: float
def __init__(self, cadVector) -> None:
self.x = cadVector[0]
self.y = cadVector[1]
self.z = cadVector[2]
pass
def toFreeCadVector(self):
return App.Vector(self.x, self.y, self.z)
class FreeCadRepository:
_solids = []
def isAllObjectsSolids(self) -> List[str]:
result = []
for part in App.ActiveDocument.Objects:
if self.is_object_solid(part) is False:
result.append(part.Label)
return result
def objectSetPosition(self, solid, cadVector):
solid.Placement.Base = cadVector
pass
def objectGetPosition(self, solid) -> VectorModel:
return VectorModel(cadVector=solid.Placement.Base)
def isObjectIntersections(self, part) -> bool:
for solid in self.getAllSolids():
if solid.Label != part.Label:
collisionResult: int = int(part.Shape.distToShape(solid.Shape)[0])
if collisionResult == 0:
return True
return False
def objectHasTouches(self, part, objectIndentation: float) -> List[str]:
positionVector = self.objectGetPosition(part)
result = CoreList()
result.append(self.isObjectIntersections(part=part))
if objectIndentation != 0 and objectIndentation != None:
result.append(
self.axis_movement_and_intersections_observer(
positionVector=positionVector,
alongAxis="x",
objectIndentation=objectIndentation,
part=part,
)
)
result.append(
self.axis_movement_and_intersections_observer(
positionVector=positionVector,
alongAxis="y",
objectIndentation=objectIndentation,
part=part,
)
)
result.append(
self.axis_movement_and_intersections_observer(
positionVector=positionVector,
alongAxis="z",
objectIndentation=objectIndentation,
part=part,
)
)
return result.onlyTrue()
def axis_movement_and_intersections_observer(
self,
positionVector: VectorModel,
alongAxis: str,
objectIndentation: float,
part,
) -> bool:
# UP
positionVector.__setattr__(
alongAxis, positionVector.__getattribute__(alongAxis) + objectIndentation
)
self.objectSetPosition(part, positionVector.toFreeCadVector())
result = self.isObjectIntersections(part=part)
if result:
return True
# DOWN
positionVector.__setattr__(
alongAxis, positionVector.__getattribute__(alongAxis) - objectIndentation
)
positionVector.__setattr__(
alongAxis, positionVector.__getattribute__(alongAxis) - objectIndentation
)
result = self.isObjectIntersections(part=part)
if result:
return True
self.isObjectIntersections(part=part)
# ROLLBACK
positionVector.__setattr__(
alongAxis, positionVector.__getattribute__(alongAxis) + objectIndentation
)
self.objectSetPosition(part, positionVector.toFreeCadVector())
return False
def getAllSolids(self):
if self._solids.__len__() == 0:
for part in App.ActiveDocument.Objects:
if self.is_object_solid(part):
self._solids.append(part)
return self._solids
def is_object_solid(self, obj):
if not isinstance(obj, App.DocumentObject):
return False
if hasattr(obj, "Group"):
return False
if not hasattr(obj, "Shape"):
return False
if not hasattr(obj.Shape, "Solids"):
return False
if len(obj.Shape.Solids) == 0:
return False
return True
T = TypeVar("T")
def from_list(f: Callable[[Any], T], x: Any) -> List[T]:
assert isinstance(x, list)
return [f(y) for y in x]
def from_str(x: Any) -> str:
assert isinstance(x, str)
return x
def from_dict(f: Callable[[Any], T], x: Any) -> Dict[str, T]:
assert isinstance(x, dict)
return {k: f(v) for (k, v) in x.items()}
def to_class(c: Type[T], x: Any) -> dict:
assert isinstance(x, c)
return cast(Any, x).to_dict()
# Вспомогательный класс который делает генрацию JSON на основе пайтон обьектов
class AdjacencyMatrix:
matrixError: Dict[str, str] = {}
all_parts: List[str]
first_detail: str
matrix: Dict[str, List[str]]
def __init__(
self, all_parts: List[str], first_detail: str, matrix: Dict[str, List[str]]
) -> None:
self.all_parts = all_parts
self.first_detail = first_detail
self.matrix = matrix
self.validateMatrix()
def whatPlaceLeadingPartIndex(self):
i = 0
for el in self.matrix:
if el == self.first_detail:
return i
i = +1
def validateMatrix(self):
for el in self.all_parts:
if self.matrix.get(el) == None:
self.matrixError[el] = "Not found adjacency " + el
@staticmethod
def from_dict(obj: Any) -> "AdjacencyMatrix":
assert isinstance(obj, dict)
all_pars = from_list(from_str, obj.get("allParts"))
first_detail = from_str(obj.get("firstDetail"))
matrix = from_dict(lambda x: from_list(from_str, x), obj.get("matrix"))
return AdjacencyMatrix(all_pars, first_detail, matrix)
def to_dict(self) -> dict:
result: dict = {}
result["allParts"] = from_list(from_str, self.all_parts)
result["firstDetail"] = from_str(self.first_detail)
result["matrix"] = from_dict(lambda x: from_list(from_str, x), self.matrix)
if self.matrixError.values().__len__() == 0:
result["matrixError"] = None
else:
result["matrixError"] = self.matrixError
return result
def getDictMatrix(self) -> dict:
result = {}
for k, v in self.matrix.items():
result[k] = {}
for el in v:
result[k][el] = el
return result
def adjacency_matrix_from_dict(s: Any) -> AdjacencyMatrix:
return AdjacencyMatrix.from_dict(s)
def adjacency_matrix_to_dict(x: AdjacencyMatrix) -> Any:
return to_class(AdjacencyMatrix, x)
# Вспомогательный класс для работы с Freecad
class FreeCadMetaModel(object):
def __init__(self, label, vertex) -> None:
self.label = label
self.vertex = vertex
collision_squares_labels = []
class MeshGeometryCoordinateModel(object):
# Получение геометрии мешей
def __init__(
self,
x,
y,
z,
label,
):
self.x = x
self.y = y
self.z = z
self.label = label
self.cadLabel = ""
def initializePrimitivesByCoordinate(self, detailSquares):
uuidDoc = str(uuid.uuid1())
App.ActiveDocument.addObject("Part::Box", "Box")
App.ActiveDocument.ActiveObject.Label = uuidDoc
App.ActiveDocument.recompute()
part = App.ActiveDocument.getObjectsByLabel(uuidDoc)[0]
collision_squares_labels.append(uuidDoc)
part.Width = 2
part.Height = 2
part.Length = 2
part.Placement = App.Placement(
App.Vector(self.x - 1, self.y - 1, self.z - 1),
App.Rotation(App.Vector(0.00, 0.00, 1.00), 0.00),
)
if detailSquares.get(self.label) is None:
detailSquares[self.label] = []
detailSquares[self.label].append(self)
self.cadLabel = uuidDoc
App.ActiveDocument.recompute()
class FS:
def readJSON(path: str):
return json.loads((open(path)).read())
def writeFile(data, filePath, fileName):
file_to_open = filePath + fileName
f = open(file_to_open, "w", encoding="utf8")
f.write(data)
def readFile(path: str):
return open(path).read()
def readFilesTypeFolder(pathFolder: str, fileType=".json"):
filesJson = list(
filter(
lambda x: x[-fileType.__len__() :] == fileType, os.listdir(pathFolder)
)
)
return filesJson
class GetAllPartsLabelsUseCase:
# Получение всех названий деталей
def call(self):
parts = []
for part in FreeCadRepository().getAllSolids():
parts.append(part.Label)
return parts
def isUnique(array, element):
for i in array:
if i == element:
return False
return True
class GetCollisionAtPrimitiveUseCase(object):
# Получение колизий примитивов
def call(self, freeCadMetaModels, detailSquares) -> Dict[str, List[str]]:
matrix: Dict[str, List[str]] = {}
for model in freeCadMetaModels:
activePart = App.ActiveDocument.getObjectsByLabel(model.label)[0]
for key in detailSquares:
if model.label != key:
for renderPrimitive in detailSquares[key]:
primitivePart = App.ActiveDocument.getObjectsByLabel(
renderPrimitive.cadLabel
)[0]
collisionResult: int = int(
activePart.Shape.distToShape(primitivePart.Shape)[0]
)
if collisionResult == 0:
if matrix.get(model.label) == None:
matrix[model.label] = [renderPrimitive.label]
else:
if isUnique(matrix[model.label], renderPrimitive.label):
matrix[model.label].append(renderPrimitive.label)
return matrix
class GetFirstDetailUseCase:
# Получение первой детали
def call(self):
return FreeCadRepository().getAllSolids()[0].Label
class GetPartPrimitiveCoordinatesUseCase(object):
# Получение координат примитивов
def call(self, freeCadMetaModels):
meshCoordinates: list[MeshGeometryCoordinateModel] = []
for model in freeCadMetaModels:
vertexesDetail = model.vertex
labelDetail = model.label
for coords in vertexesDetail:
detailVertex = MeshGeometryCoordinateModel(
coords.X,
coords.Y,
coords.Z,
labelDetail,
)
meshCoordinates.append(detailVertex)
return meshCoordinates
class InitPartsParseUseCase:
# Инициализация парсинга
def call(self):
product_details = []
for part in FreeCadRepository().getAllSolids():
if part is not None:
model = FreeCadMetaModel(part.Label, part.Shape.Vertexes)
if model is not None:
product_details.append(model)
return product_details
class RenderPrimitiveUseCase(object):
# Рендеринг премитивов
def call(
self, meshModels: list[MeshGeometryCoordinateModel], detailSquares
) -> None:
for mesh in meshModels:
mesh.initializePrimitivesByCoordinate(detailSquares)
class ClearWorkSpaceDocumentUseCase(object):
# Очистка рабочего простарнства
def call(self, detailSquares):
for key in detailSquares:
for renderPrimitive in detailSquares[key]:
primitivePart = App.ActiveDocument.getObjectsByLabel(
renderPrimitive.cadLabel
)[0]
App.ActiveDocument.removeObject(primitivePart.Name)
class RenderPrimitivesScenario(object):
def __init__(
self,
initPartsParseUseCase: InitPartsParseUseCase,
getPartPrimitiveCoordinatesUseCase: GetPartPrimitiveCoordinatesUseCase,
renderPrimitiveUseCase: RenderPrimitiveUseCase,
getCollisionAtPrimitives: GetCollisionAtPrimitiveUseCase,
clearWorkSpaceDocument: ClearWorkSpaceDocumentUseCase,
) -> None:
self.initPartsParseUseCase = initPartsParseUseCase
self.getPartPrimitiveCoordinatesUseCase = getPartPrimitiveCoordinatesUseCase
self.renderPrimitiveUseCase = renderPrimitiveUseCase
self.getCollisionAtPrimitives = getCollisionAtPrimitives
self.clearWorkSpaceDocument = clearWorkSpaceDocument
def call(self) -> None:
meshCoordinates = []
detailSquares = {}
parts = self.initPartsParseUseCase.call()
meshCoordinates = self.getPartPrimitiveCoordinatesUseCase.call(parts)
self.renderPrimitiveUseCase.call(meshCoordinates, detailSquares)
matrix = self.getCollisionAtPrimitives.call(parts, detailSquares)
self.clearWorkSpaceDocument.call(detailSquares)
return matrix
class ClearWorkSpaceDocumentUseCase(object):
# Очистака рабочего пространства
def call(self, detailSquares):
for key in detailSquares:
for renderPrimitive in detailSquares[key]:
primitivePart = App.ActiveDocument.getObjectsByLabel(
renderPrimitive.cadLabel
)[0]
App.ActiveDocument.removeObject(primitivePart.Name)
class CadAdjacencyMatrix:
# Матрица основанная на соприкосновении примитива с обьектами
def primitiveMatrix(self):
# Получение матрицы
matrix = RenderPrimitivesScenario(
InitPartsParseUseCase(),
GetPartPrimitiveCoordinatesUseCase(),
RenderPrimitiveUseCase(),
GetCollisionAtPrimitiveUseCase(),
ClearWorkSpaceDocumentUseCase(),
).call()
return AdjacencyMatrix(
all_parts=GetAllPartsLabelsUseCase().call(),
first_detail=GetFirstDetailUseCase().call(),
matrix=matrix,
)
# Матрица основанная на соприкосновении обьектов
def matrixBySurfaces(self):
matrix = {}
for part in FreeCadRepository().getAllSolids():
matrix[part.Label] = []
for nextPart in FreeCadRepository().getAllSolids():
if part.Label != nextPart.Label:
# Вычисление соприконсоновения площади деталей
collisionResult: int = int(
part.Shape.distToShape(nextPart.Shape)[0]
)
print(collisionResult)
print("collisionResult")
if collisionResult == 0:
matrix[part.Label].append(nextPart.Label)
return AdjacencyMatrix(
all_parts=GetAllPartsLabelsUseCase().call(),
first_detail=GetFirstDetailUseCase().call(),
matrix=matrix,
)
def reduce(function, iterable, initializer=None):
it = iter(iterable)
if initializer is None:
value = next(it)
else:
value = initializer
for element in it:
value = function(value, element)
return value
def to_ascii_hash(text):
ascii_values = [ord(character) for character in text]
return reduce(lambda x, y: x + y, ascii_values)
def matrixGetUniqueContact(matrix):
detailsToCheck = []
detailsHashCheck = {}
for k, v in matrix.items():
for el in v:
if el != k:
hash = to_ascii_hash(k + el)
if detailsHashCheck.get(hash) == None:
detailsHashCheck[hash] = hash
detailsToCheck.append({"child": el, "parent": k})
return detailsToCheck
class IntersectionComputedUseCase:
def call(parts):
App.activeDocument().addObject("Part::MultiCommon", "Common")
App.activeDocument().Common.Shapes = [parts[0], parts[1]]
App.activeDocument().getObject("Common").ViewObject.ShapeColor = getattr(
parts[0].getLinkedObject(True).ViewObject,
"ShapeColor",
App.activeDocument().getObject("Common").ViewObject.ShapeColor,
)
App.activeDocument().getObject("Common").ViewObject.DisplayMode = getattr(
parts[0].getLinkedObject(True).ViewObject,
"DisplayMode",
App.activeDocument().getObject("Common").ViewObject.DisplayMode,
)
App.ActiveDocument.recompute()
area = App.activeDocument().getObject("Common").Shape.Area
App.ActiveDocument.removeObject("Common")
return area
class ErrorStringModel:
def __init__(self, error: str) -> None:
self.error = error
pass
error: str
def toString(self) -> str:
return json.dumps(
{
"error": self.error,
},
ensure_ascii=False,
indent=4,
)
class IsAllObjectSolidsCheckUseCase:
def call() -> ErrorStringModel:
result = FreeCadRepository().isAllObjectsSolids()
if result.__len__() == 0:
return None
return ErrorStringModel(error="Is not solid objects: " + ",".join(result))
class CheckObjectHasTouchesUseCase:
def call(objectIndentation: float) -> ErrorStringModel:
result = []
for part in FreeCadRepository().getAllSolids():
if (
FreeCadRepository().objectHasTouches(
part=part, objectIndentation=objectIndentation
)
is False
):
result.append(part.Label)
if result.__len__() == 0:
return None
return ErrorStringModel(
error="Solids bodies have no recounts: " + ",".join(result)
)
class CheckCadIntersectionObjects:
report = []
def call() -> bool:
FreeCadRepository().getAllSolids()
return False
class ExitFreeCadUseCase:
def call():
import FreeCADGui as Gui
freecadQTWindow = Gui.getMainWindow()
freecadQTWindow.close()
# class CheckValidIntersectionUseCase:
# def call() -> ErrorStringModel:
# for part in FreeCadRepository().getAllSolids():
# print(part)
# FreeCadRepository().obj
# pass
def main():
env = FS.readJSON("env.json")
cadFilePath = str(env["cadFilePath"])
outPath = str(env["outPath"])
objectIndentation = float(env["objectIndentation"])
if cadFilePath == None:
return TypeError("CadFile not found env.json")
App.open("" + cadFilePath)
# isAllObjectSolidsCheckUseCase = IsAllObjectSolidsCheckUseCase.call()
# if isAllObjectSolidsCheckUseCase != None:
# FS.writeFile(isAllObjectSolidsCheckUseCase.toString(), outPath, 'error.json')
# ExitFreeCadUseCase.call()
# return
# checkObjectHasTouchesUseCase = CheckObjectHasTouchesUseCase.call(objectIndentation)
# if checkObjectHasTouchesUseCase != None:
# FS.writeFile(checkObjectHasTouchesUseCase.toString(), outPath, 'error.json')
# ExitFreeCadUseCase.call()
# return
topologyMatrix = CadAdjacencyMatrix().matrixBySurfaces()
import json
sequences = json.dumps(
{"sequences": AllSequences(topologyMatrix.matrix).adj_matrix_names},
ensure_ascii=False,
indent=4,
)
matrix = topologyMatrix.matrix
contacts = matrixGetUniqueContact(matrix)
intersection_geometry = {"status": True, "recalculations": None}
for el in contacts:
child = App.ActiveDocument.getObjectsByLabel(el.get("child"))[0]
parent = App.ActiveDocument.getObjectsByLabel(el.get("parent"))[0]
area = IntersectionComputedUseCase.call([child, parent])
if area != 0.0:
if intersection_geometry.get("recalculations") == None:
intersection_geometry["status"] = False
intersection_geometry["recalculations"] = []
intersection_geometry["recalculations"].append(
{"area": area, "connect": el.get("child") + " " + el.get("parent")}
)
FS.writeFile(
json.dumps(intersection_geometry, ensure_ascii=False, indent=4),
outPath,
"intersection_geometry.json",
)
FS.writeFile(sequences, outPath, "sequences.json")
FS.writeFile(
json.dumps(topologyMatrix.to_dict(), ensure_ascii=False, indent=4),
outPath,
"adjacency_matrix.json",
)
ExitFreeCadUseCase.call()
#main()

View file

@ -1,61 +0,0 @@
import json
import networkx as nx
def load_data(file_path):
with open(file_path, 'r') as file:
return json.load(file)
def create_graph(data):
G = nx.Graph()
for part in data['allParts']:
G.add_node(part)
for part, connections in data['matrix'].items():
for connected_part in connections:
G.add_edge(part, connected_part)
return G
def find_leaf_nodes(graph, central_node):
leaf_nodes = []
for node in graph.nodes:
if node != central_node and graph.degree(node) == 1:
leaf_nodes.append(node)
return leaf_nodes
def find_all_paths(graph, start_node, end_node):
try:
return list(nx.all_simple_paths(graph, start_node, end_node))
except nx.NetworkXNoPath:
return []
def load_constraints(file_path):
with open(file_path, 'r') as file:
return json.load(file)
def is_valid_sequence(sequence, constraints):
for constraint in constraints:
if constraint[0] in sequence and constraint[1] in sequence:
if sequence.index(constraint[0]) > sequence.index(constraint[1]):
return False
return True
def save_sequences(sequences, file_path):
with open(file_path, 'w') as file:
json.dump(sequences, file, indent=4)
data = load_data('adjacency_matrix.json')
constraints = load_constraints('constraints.json')
all_parts = data['allParts']
graph = create_graph(data)
first_detail = data['firstDetail']
leaf_nodes = find_leaf_nodes(graph, first_detail)
all_sequences = []
for leaf in leaf_nodes:
paths = find_all_paths(graph, leaf, first_detail)
for path in paths:
if set(path) == set(all_parts) and is_valid_sequence(path, constraints):
all_sequences.append(path)
save_sequences(all_sequences, 'valid_sequences.json')
print(f"Найдено {len(all_sequences)} допустимых последовательностей сборки.")

View file

@ -1,26 +0,0 @@
import json
import networkx as nx
import matplotlib.pyplot as plt
# Загружаем данные из файла
with open('adjacency_matrix.json', 'r') as file:
data = json.load(file)
# Создаем пустой граф
G = nx.Graph()
# Добавляем узлы
for part in data['allParts']:
G.add_node(part)
# Добавляем ребра
for part, connections in data['matrix'].items():
for connected_part in connections:
G.add_edge(part, connected_part)
# Визуализируем граф
plt.figure(figsize=(10, 8))
pos = nx.spring_layout(G)
nx.draw(G, pos, with_labels=True, node_size=100, node_color='lightblue', font_size=10, font_weight='bold', edge_color='gray')
plt.title('Graph of Part Connections')
plt.show()

View file

@ -1,14 +0,0 @@
import os
import json
class FS:
def readJSON(path: str):
return json.loads((open(path)).read())
def writeFile(data, filePath, fileName):
file_to_open = filePath + fileName
f = open(file_to_open, 'w', )
f.write(data)

View file

@ -1,18 +0,0 @@
import FreeCAD
def is_object_solid(obj):
"""If obj is solid return True"""
if not isinstance(obj, FreeCAD.DocumentObject):
return False
if not hasattr(obj, 'Shape'):
return False
if not hasattr(obj.Shape, 'Solids'):
return False
if len(obj.Shape.Solids) == 0:
return False
return True

View file

@ -1,95 +0,0 @@
import os
import FreeCADGui as Gui
import FreeCAD as App
from .TranslateUtils import translate
from . import ICONPATH, TRANSLATIONSPATH, Frames
from .version import __version__
__title__='Robossembler Workbench'
__author__ = 'brothermechanic, Mark Voltov, IDONTSUDO, Igor Brylyov'
__copyright__ = 'Copyright (c) 2023 brothermechanic'
__license__ = 'GPL-2.1'
__email__ = 'brothermechanic@gmail.com, ius.mark.alex@gmail.com'
__url__ = ["https://robossembler.org"]
__status__ = 'development'
class Robossembler(Gui.Workbench):
"""
class which gets initiated at startup of the gui
"""
MenuText = "Robossembler" # translate("cool", "Robossembler")
ToolTip = "Robossembler Workbench" # translate("cool", "a simple Robossembler")
Icon = os.path.join(ICONPATH, "robossembler.svg")
toolbox = []
def GetClassName(self):
return "Gui::PythonWorkbench"
def Initialize(self):
"""
This function is called at the first activation of the workbench.
here is the place to import all the commands
"""
# Add translations path
Gui.addLanguagePath(TRANSLATIONSPATH)
Gui.updateLocale()
self.framecommands = [
"BoMGeneration",
"FrameCommand",
"SelectedPartFrameCommand",
"AllPartFramesCommand",
"FeatureFrameCommand"
]
self.toolcommands = [
"ExportPlacementAndPropertiesCommand",
"Export_Entities",
"ExportGazeboModels",
"InsertGraspPose",
"Validate_Project",
"Publish_Project"
]
self.asmcommands = [
"Create Assembly Parameters",
"Create Fastener Set",
"Create Assembly Sequence",
"Export Assembly Settings",
"Compute Assembly Sequence",
# "Create Assembly Layers",
"Create Structure Graph",
"Create Assembly Graph"
]
self.appendToolbar(f"{__class__.__name__} Frames", self.framecommands)
self.appendToolbar(f"{__class__.__name__} Tools", self.toolcommands)
self.appendToolbar(f"{__class__.__name__} Assembly Setup", self.asmcommands)
App.Console.PrintMessage(translate("Console",
"Switching to robossembler") + "\n")
App.Console.PrintMessage(translate("Console",
"Switching to robossembler") + "\n")
# self.appendToolbar(translate("Toolbar", "Tools"), self.toolbox)
# self.appendMenu(translate("Menu", "Tools"), self.toolbox)
def Activated(self):
'''
code which should be computed when a user switch to this workbench
'''
pass
def Deactivated(self):
'''
code which should be computed when this workbench is deactivated
'''
pass
def ContextMenu(self, recipient):
"""This is execcuted whenever the user right-clicks on screen."""
pass
Gui.addWorkbench(Robossembler())

View file

@ -1,162 +0,0 @@
import FreeCAD as App
import FreeCADGui as Gui
doc = App.ActiveDocument
print('lcs - локальная система координат')
print('grip - позиция захвата')
print('area - плоскость')
print('vol - зона')
print('joint - соединение')
entityType = input('Введите тип получаемого обьекта')
def create(entityType):
if entityType == 'grip':
print('задайте начальную точку захватной зоны. ')
print('Учтите, что ось X должна быть направлена вдоль направления раскрытия пальцев')
print('Ось Z должна быть направлена в противоположную сторону от направления кончика пальца захвата')
objname = input('Введите название начальной точки' + "\n")
obj = doc.getObject(objname)
poseGenerator(obj)
elif entityType == 'area':
print('задайте плоскость')
objname = input('Введите название плоскости'+ "\n")
obj = doc.getObject(objname)
areaProps(obj)
elif entityType == 'vol':
print('задайте обьем')
objname = input('Введите название обьема'+ "\n")
obj = doc.getObject(objname)
volProps(obj)
elif entityType == 'joint':
print('Задайте позицию соединения')
objname = input('Введите название соединения'+ "\n")
part1 = input('укажите название первой детали'+ "\n")
part2 = input('укажите название второй детали'+ "\n")
jointGenerator(objname, part1, part2)
obj.addProperty("App::PropertyString", "Type").Type = entityType
## заглушки функций на случай, если что-то придумаю полезное для них
def areaProps(area):
#здесь нужно отметить свойства зоны
#в принципе, Placement и размеры тут есть, больше ничего особо не нужно
#добавить характеристику entityType
print(area.Label)
def volProps(vol):
#желательно указать координаты, габариты, позицию привязки
#но думаю, что это все уже есть
print(vol.Label)
def jointGenerator(jointName, part1, part2):
#получаем относительные координаты для первой детали и для второй детали
#создаем две сущности - точка входа и точка выхода (??????)
#в работе сейчас
print(jointName.Label)
print(part1.Label)
print(part2.Label)
# Эта функция работает нормально
def poseGenerator(lcs):
box = doc.addObject("Part::Box", "gripSpace")
box.Length = 62 #раскрытие
box.Width = 10 #ширина пальца
box.Height = 40 #глубина
box.Placement = lcs.Placement
#есть смысл создавать привязку прямо здесь же. благодаря параметризации, при подстройке куба все точки сместятся как надо
gripPose = App.ActiveDocument.addObject('PartDesign::CoordinateSystem', 'GripPose')
gripPose.Support = box
gripPose.positionBySupport()
gripPose.MapMode = 'ObjectXY'
gripPose.AttachmentOffset.Base = [str(box.Label) + '.Length' + '/2', str(box.Label) + '.Length'+ '/2', 0] #здесь должна быть активная привязка, не просто значения координат
gripPose.addProperty("App::PropertyFloat", "GripOpen")
gripPose.addProperty("App::PropertyFloat", "GripDepth")
gripPose.addProperty("App::PropertyFloat", "GripWidth")
gripPose.setExpression('GripDepth', str(box.Label) + '.Height')
gripPose.setExpression('GripOpen', str(box.Label) + '.Length')
gripPose.setExpression('GripWidth', str(box.Label) + '.Width')
#нужно создавать внутри Part, а не внутри главного документа. сбиваются привязки !!!
print('Установите захватную зону вручную, растянув обьект GripSpace')
doc.recompute()
#теперь нужно производить экспорт
#он делается через Tools.py или через импорт-экспорт
create(entityType)
### getObjectInfo работает
def getFaceInfo(face):
if face:
App.Console.PrintMessage(f"Информация о грани: {face}\n")
# Получите позицию (Base) и ориентацию (Rotation) грани в глобальных координатах
placement = face.Placement
position = App.Vector(placement.Base)
orientation = App.Rotation(placement.Rotation)
App.Console.PrintMessage(f"Позиция грани: {position}\n")
App.Console.PrintMessage(f"Ориентация грани: {orientation}\n")
def getObjectInfo():
selection = Gui.Selection.getSelectionEx()
if selection:
selected_object = selection[0].Object
if selected_object:
subelement_name = selection[0].SubElementNames[0]
if "Face" in subelement_name:
face = selected_object.Shape.Faces[int(subelement_name.split("Face")[1])]
getFaceInfo(face)
else:
App.Console.PrintError("Выберите грань, а не тело или другой элемент\n")
else:
App.Console.PrintError("Объект не найден\n")
else:
App.Console.PrintError("Не выбраны объекты\n")
getObjectInfo()

View file

@ -1,97 +0,0 @@
(define (domain Printer)
(:requirements :strips :typing :fluents :durative-actions)
(:types
printer workspace - zone
part
arm
assembly
human
filament
)
(:predicates
(arm_available ?a - arm)
(part_at ?p - part ?z - zone)
(printer_ready ?p - printer)
(printer_checked ?p - printer)
(printer_at_work ?p - printer)
(part_of ?part - part ?whole - assembly)
(assembly_order ?prev ?next - assembly)
(assembled ?whole - assembly ?z - zone)
(observer_free ?h - human)
(filament_at ?f - filament ?z - zone)
)
(:functions
)
(:durative-action print
:parameters ( ?p - part ?pr - printer )
:duration ( = ?duration 20)
:condition (and
(at start(printer_ready ?pr))
)
:effect (and
(at start (not (printer_ready ?pr)))
(at start (printer_at_work ?pr ))
(at end(part_at ?p ?pr))
(at end (not (printer_at_work ?pr )))
)
)
(:durative-action remove
:parameters ( ?p - part ?pr - printer ?z - zone ?a - arm )
:duration ( = ?duration 1)
:condition (and
(at start (part_at ?p ?pr))
(at start (arm_available ?a))
)
:effect (and
(at start (not (arm_available ?a)))
(at end (part_at ?p ?z))
(at end (arm_available ?a))
(at end (printer_ready ?pr))
)
)
(:durative-action assemble
:parameters ( ?p - part ?prev ?next - assembly ?z - zone ?arm - arm ?w - workspace )
:duration ( = ?duration 5)
:condition (and
(at start (assembled ?prev ?w))
(at start (part_at ?p ?w))
(at start (part_of ?p ?next))
(at start (arm_available ?arm))
(at start (assembly_order ?prev ?next))
)
:effect (and
(at start (not (arm_available ?arm)))
(at end (not (part_at ?p ?w)))
(at end (arm_available ?arm))
(at end (assembled ?next ?w))
)
)
(:durative-action printer_check
:parameters ( ?p - printer ?h - human )
:duration ( = ?duration 1)
:condition (and
(at start ( observer_free ?h ))
)
:effect (and
(at start (not (observer_free ?h)))
(at end (observer_free ?h))
(at end (printer_checked ?p))
)
)
(:durative-action printer_filament_load
:parameters ( ?p - printer ?h - human ?f - filament ?z - zone )
:duration ( = ?duration 5)
:condition (and
(at start (printer_checked ?p))
(at start (observer_free ?h))
(at start (filament_at ?f ?z))
)
:effect (and
(at start (not(observer_free ?h)))
(at end (observer_free ?h))
(at end (printer_ready ?p))
(at end (not (filament_at ?f ?z)))
)
)
)

View file

@ -1,181 +0,0 @@
import FreeCAD as App
import FreeCADGui as Gui
#функции для создания обьектов PDDL
def add_types():
doc = App.ActiveDocument
types = doc.addObject('App::FeaturePython', 'Types')
types.addProperty("App::PropertyString", 'PDDL', 'PDDL').PDDL = 'PDDL'
types.addProperty("App::PropertyString", 'Type', 'PDDL').Type = 'Types'
types.addProperty("App::PropertyStringList", 'Types', 'PDDL')
print('Types of objects added successfully')
return(types)
#слишком много types
def add_parameters():
doc = App.ActiveDocument
params = doc.addObject('App::FeaturePython', 'Parameters')
params.addProperty("App::PropertyString", 'PDDL', 'PDDL').PDDL = 'PDDL'
params.addProperty("App::PropertyString", 'Type', 'PDDL').Type = 'Parameters'
params.addProperty('App::PropertyPythonObject', 'Parameters','PDDl')
print('Domain parameters added successfully')
return(params)
def add_action():
doc = App.ActiveDocument
name = input('Название действия:')
action = doc.addObject('App::FeaturePython', str(name))
action.addProperty("App::PropertyString", 'PDDL', 'PDDL').PDDL = 'PDDL'
action.addProperty("App::PropertyString", 'Type', 'PDDL').Type = 'Action'
action.addProperty("App::PropertyStringList", 'Parameters', 'PDDL')
action.addProperty("App::PropertyStringList", 'Conditions', 'PDDL')
action.addProperty("App::PropertyStringList", 'Effects', 'PDDL')
sortEntity(action)
print('Action ' + name + 'added successfully')
return(action)
def add_predicate():
doc = App.ActiveDocument
name = input('Название предиката:')
parms = input('Переменные')
predicate = doc.addObject('App::FeaturePython', str(name))
predicate.addProperty("App::PropertyString", 'PDDL', 'PDDL').PDDL = 'PDDL'
predicate.addProperty("App::PropertyString", 'Type', 'PDDL').Type = 'Predicate'
# predicate.addProperty("App::PropertyStringList", 'Name', 'PDDL')
predicate.addProperty("App::PropertyStringList", 'Parameters', 'PDDL').Parameters = parms
sortEntity(predicate)
print('Predicate ' + name + 'added successfully')
return(predicate)
def add_durative_action():
doc = App.ActiveDocument
name = input('Название действия:')
action = doc.addObject('App::FeaturePython', str(name))
action.addProperty("App::PropertyString", 'PDDL', 'PDDL').PDDL = 'PDDL'
action.addProperty("App::PropertyString", 'Type', 'PDDL').Type = 'DurativeAction'
action.addProperty("App::PropertyStringList", 'Parameters', 'PDDL')
action.addProperty("App::PropertyStringList", 'Conditions', 'PDDL')
action.addProperty("App::PropertyStringList", 'Effects', 'PDDL')
action.addProperty('App::PropertyString', 'Duration', 'PDDL')
sortEntity(action)
print('Durative Action ' + name + ' added successfully')
return(action)
def export_to_file():
filename = App.ActiveDocument.Name
file_path = App.ActiveDocument.FileName.rsplit("/", 1)[0] + filename + '_domain.pddl'
doc = App.ActiveDocument
objs = doc.Objects
with open(file_path, 'w') as f:
f.write('(define (domain '+ filename +')\n \n')
f.write('(:requirements :strips :typing :fluents :durative-actions)\n')
# Типы обьектов
types = doc.getObjectsByLabel('Types')[0]
f.write('(:types \n')
for obj_type in types.Types:
f.write(' ' + obj_type + ' \n')
f.write(')\n')
# предикаты
f.write(' (:predicates\n')
for obj in objs:
if hasattr(obj, 'PDDL') and hasattr(obj, 'Type') and obj.Type == 'Predicate':
f.write(' ('+ obj.Label)
for params in obj.Parameters:
f.write(' ' + params)
f.write(')\n')
f.write(' )\n')
# функции
f.write(' (:functions\n')
f.write(' )\n')
#действия:
for obj in objs:
if hasattr(obj, 'PDDL') and hasattr(obj, 'Type') and obj.Type == 'Action':
f.write('(:action ' + obj.Label + '\n')
f.write(' :parameters (')
for params in obj.Parameters:
f.write('' + params + ' ')
f.write(')\n')
f.write(' :condition (and \n')
for condition in obj.Conditions:
f.write(' (' + condition + ') \n')
f.write(' )\n')
f.write(' :effect (and \n')
for effect in obj.Effects:
f.write(' (' + effect + ') \n')
# f.write(' ')
f.write(')\n')
f.write(' )\n')
# длительные действия:
for obj in objs:
if hasattr(obj, 'PDDL') and hasattr(obj, 'Type') and obj.Type == 'DurativeAction':
f.write('(:durative-action ' + obj.Label + '\n')
f.write(' :parameters (')
for params in obj.Parameters:
f.write(' ' + params )
f.write(' )\n')
f.write(' :duration ( = ?duration '+ str(obj.Duration) +')\n')
f.write(' :condition (and \n')
for condition in obj.Conditions:
f.write(' (' + condition + ') \n')
# f.write(') ')
# f.write(')\n')
f.write(' )\n')
f.write(' :effect (and \n')
for effect in obj.Effects:
f.write(' (' + effect + ') \n')
# f.write(' ')
f.write(')\n')
f.write(' )\n')
f.write(' )\n')
def sortEntity(object):
doc = App.ActiveDocument
if len(doc.getObjectsByLabel(object.Type)) == 0:
pddl_group = doc.addObject("App::DocumentObjectGroup", object.Type)
else:
pddl_group = doc.getObjectsByLabel(object.Type)[0]
pddl_group.addObject(object)
Gui.updateGui()

View file

@ -1,116 +0,0 @@
# Byte-compiled / optimized / DLL files
__pycache__/
*.py[cod]
*$py.class
# C extensions
*.so
# Distribution / packaging
.Python
env/
build/
develop-eggs/
dist/
downloads/
eggs/
.eggs/
lib/
lib64/
parts/
sdist/
var/
wheels/
*.egg-info/
.installed.cfg
*.egg
# PyInstaller
# Usually these files are written by a python script from a template
# before PyInstaller builds the exe, so as to inject date/other infos into it.
*.manifest
*.spec
# Installer logs
pip-log.txt
pip-delete-this-directory.txt
# Unit test / coverage reports
htmlcov/
.tox/
.coverage
.coverage.*
.cache
nosetests.xml
coverage.xml
*.cover
.hypothesis/
# Translations
*.mo
*.pot
# Django stuff:
*.log
local_settings.py
# Flask stuff:
instance/
.webassets-cache
# Scrapy stuff:
.scrapy
# Sphinx documentation
docs/_build/
# PyBuilder
target/
# Jupyter Notebook
.ipynb_checkpoints
# pyenv
.python-version
# celery beat schedule file
celerybeat-schedule
# SageMath parsed files
*.sage.py
# dotenv
.env
# virtualenv
.venv
venv/
ENV/
# Spyder project settings
.spyderproject
.spyproject
# Rope project settings
.ropeproject
# mkdocs documentation
/site
# mypy
.mypy_cache/
# blender backup files
*.blend1
install_plugin_cad.sh
.vscode
.DS_Store
# emacs backup files
~*
*~
*#
.#*
\#*\#
out/
/env.json

View file

@ -1,33 +0,0 @@
# Start dev
create env.json
```json
{
"cadDoc":"CAD_DOC_PATH_REPLACE",
"sequences":"SEQUENCES_PATH_REPLACE",
"aspDir":"ASP_DIR_REPLACE"
}
```
# Command generation assets
freecad generate.py
# Command generation insertion vectors
git submodule update --init
conda env create -f assembly/environment.yml
conda activate assembly
python assembly/simulation/setup.py install
sudo apt-get install libgl1-mesa-dev xorg-dev
python3 main.py
# Последовательность действий
1. cad_generation main.py
1. в env json прописываем пути
2. geometric_feasibility_predicate main.py
1. в env json прописываем пути
3. insertion vector predicate main.py #исправить пути к моделям в main.py
4. результат : траектории вставки

@ -1 +0,0 @@
Subproject commit 395ee5b638ccaa0cbe5b48101655560e49365195

View file

@ -1,205 +0,0 @@
from typing import List
import FreeCAD as App
import Part
import Mesh
import Part
import MeshPart
import os
import json
import FreeCADGui as Gui
class FS:
def readJSON(path: str):
return json.loads((open(path)).read())
def writeFile(data, filePath, fileName):
file_to_open = filePath + fileName
f = open(file_to_open, 'w', encoding='utf-8',
errors='ignore')
f.write(data)
f.close()
def createFolder(path: str):
if (not os.path.exists(path)):
return os.mkdir(path)
class SimpleCopyPartModel:
id = None
copyLink = None
label = None
part = None
def getPart(self):
return self.part
def __init__(self, part) -> None:
try:
from random import randrange
self.id = str(randrange(1000000))
childObj = part
print(part)
__shape = Part.getShape(
childObj, '', needSubElement=False, refine=False)
obj = App.ActiveDocument.addObject('Part::Feature', self.id)
obj.Shape = __shape
self.part = obj
self.label = obj.Label
App.ActiveDocument.recompute()
except Exception as e:
print(e)
def remove(self):
App.ActiveDocument.removeObject(self.label)
class MeshPartModel:
id = None
mesh = None
def __init__(self, part) -> None:
try:
from random import randrange
self.id = 'mesh' + str(randrange(1000000))
document = App.ActiveDocument
mesh = document.addObject("Mesh::Feature", self.id)
shape = Part.getShape(part, "")
mesh.Mesh = MeshPart.meshFromShape(
Shape=shape, LinearDeflection=20, AngularDeflection=0.1, Relative=False)
mesh.Label = self.id
self.mesh = mesh
except Exception as e:
print(e)
pass
def remove(self):
try:
App.ActiveDocument.removeObject(self.mesh.Label)
except Exception as e:
print(e)
class JoinMeshModel:
id = None
mesh = None
def __init__(self, meshesPartModels: list['MeshPartModel']) -> None:
meshes = []
from random import randrange
for el in meshesPartModels:
meshes.append(el.mesh.Mesh)
self.id = 'MergedMesh' + str(randrange(1000000))
doc = App.ActiveDocument
merged_mesh = Mesh.Mesh()
for el in meshes:
merged_mesh.addMesh(el)
new_obj = doc.addObject("Mesh::Feature", self.id)
new_obj.Mesh = merged_mesh
new_obj.ViewObject.DisplayMode = "Flat Lines"
self.mesh = new_obj
def remove(self):
try:
App.ActiveDocument.removeObject(self.id)
except Exception as e:
print(e)
class ExportAssemblyThemAllUseCase:
def call(self, path:str, assemblys:list[str]):
assembly = assemblys
asmStructure = {}
inc = 0
for el in assembly:
if (inc != 0):
asmStructure[inc] = {
"child": el,
"parents": assembly[0:inc]
}
inc += 1
objectsFreeCad = App.ActiveDocument.Objects
asmSolids = {}
for k, v in asmStructure.items():
assemblyParentList = v['parents']
assemblyChild = v['child']
for el in assemblyParentList:
for solid in objectsFreeCad:
if (el == solid.Label):
if (asmSolids.get(k) is None):
asmSolids[k] = {'parents': [], 'child': list(
filter(lambda x: x.Label == assemblyChild, objectsFreeCad))[0]}
asmSolids[k]['parents'].append(solid)
inc = 0
for k, v in asmSolids.items():
geometry = {"0": [], "1": []}
if (k != 0):
App.activeDocument().addObject("Part::Compound", "Compound")
copyLinks = list(
map(lambda el: SimpleCopyPartModel(el), v['parents']))
if copyLinks != None:
App.activeDocument().Compound.Links = list(
map(lambda el: el.getPart(), copyLinks))
object = App.activeDocument().getObject('Compound')
boundBox = object.Shape.BoundBox
geometry['0'].append(boundBox.XMax)
geometry['0'].append(boundBox.YMax)
geometry['0'].append(boundBox.ZMax)
boundBoxChild = v['child'].Shape.BoundBox
geometry['1'].append(boundBoxChild.XMax)
geometry['1'].append(boundBoxChild.YMax)
geometry['1'].append(boundBoxChild.ZMax)
meshParents = []
for el in v['parents']:
meshParents.append(MeshPartModel(el))
joinMesh = JoinMeshModel(meshParents)
for el in meshParents:
el.remove()
import importOBJ
importOBJ.export(joinMesh.mesh, path + str(1) + '.obj')
joinMesh.remove()
importOBJ.export(v['child'], path + str(0) + '.obj')
FS.writeFile(json.dumps(geometry), path, 'translation.json')
App.ActiveDocument.removeObject("Compound")
for el in copyLinks:
el.remove()
App.activeDocument().recompute()
inc += 1
def main():
env = FS.readJSON('./env.json')
env.get('cadDoc')
aspDir = env.get('aspDir')
sequences = FS.readJSON(env.get('sequences')).get('sequences')
App.openDocument(env.get('cadDoc'))
for sequencyNumber in range(len(sequences)):
FS.createFolder(aspDir + 'assemblys/')
mainFolder = aspDir + 'assemblys/' + str(sequencyNumber) + '/'
FS.createFolder(mainFolder)
for subSequenceNumber in range(len(sequences[sequencyNumber])):
if(subSequenceNumber != 0):
subFolder = aspDir + 'assemblys/' + \
str(sequencyNumber) + '/' + str(subSequenceNumber) + '/'
FS.createFolder(subFolder)
ExportAssemblyThemAllUseCase().call(path=subFolder,assemblys=sequences[sequencyNumber][0:subSequenceNumber+1])
App.closeDocument(App.ActiveDocument.Name)
freecadQTWindow = Gui.getMainWindow()
freecadQTWindow.close()
main()

View file

@ -1,174 +0,0 @@
import os
import sys
project_base_dir = os.path.abspath(os.path.join(
os.path.dirname(os.path.abspath(__file__)), './')) + '/assembly/'
sys.path.append(project_base_dir)
sys.path.append(project_base_dir + '/baselines/')
sys.path.append(project_base_dir + '/assets/')
from scipy.spatial.transform import Rotation
import shutil
from spatialmath import *
from spatialmath.base import *
from assembly.assets.process_mesh import process_mesh
from assembly.examples.run_joint_plan import get_planner
from assembly.baselines.run_joint_plan import PyPlanner
from assembly.assets.subdivide import subdivide_to_size
import numpy as np
import json
import trimesh
import re
def merge_meshes(meshes):
# Создание пустого меша
merged_mesh = trimesh.Trimesh()
# Объединение каждого меша в один
for mesh in meshes:
merged_mesh = trimesh.util.concatenate(
[merged_mesh, trimesh.load(mesh)])
i = True
while i:
if merged_mesh.fill_holes():
i = False
return merged_mesh
os.environ['OMP_NUM_THREADS'] = '1'
class FS:
def readJSON(path: str):
return json.loads((open(path)).read())
def writeFile(data, filePath, fileName):
file_to_open = filePath + fileName
f = open(file_to_open, 'w', )
f.write(data)
def readFile(path: str):
return open(path).read()
def readFilesTypeFolder(pathFolder: str, fileType='.json'):
return os.listdir(pathFolder)
def readFolder(pathFolder: str):
return list(map(lambda el: pathFolder + '/' + el, os.listdir(pathFolder)))
def createFolder(path: str):
if (not os.path.exists(path)):
return os.mkdir(path)
def listGetFirstValue(iterable, default=False, pred=None):
return next(filter(pred, iterable), default)
def filterModels(filterModels, filterModelsDescription):
models = []
for el in filterModelsDescription:
models.append(listGetFirstValue(
filterModels, None, lambda x: x.name == el))
return models
# mesh1 = trimesh.load('/Users/idontsudo/framework/asp/out/sdf-generation/meshes/Cube.obj')
# mesh2 = trimesh.load('/Users/idontsudo/framework/asp/out/sdf-generation/meshes/Cube001.obj')
# # Объединение мешей
# merged_mesh = merge_meshes([mesh1, mesh2])
# # Сохранение объединенного меша в файл
# merged_mesh.export('merged.obj')
def main():
# from argparse import ArgumentParser
# parser = ArgumentParser()
# parser.add_argument('--asp-path', type=str, required=True)
# args = parser.parse_args()
# aspDir = args.asp_dir
# # Коректировка пути до папки с генерацией ASP
# if (aspDir == None):
# args.print_helper()
# if (aspDir[aspDir.__len__() - 1] != '/'):
# aspDir += '/'
aspDir = "/home/markvoltov/GitProjects/framework/test_models/"
sequences = FS.readJSON(aspDir + 'sequences.json').get('sequences')
assemblyDirNormalize = []
for el in FS.readFolder(aspDir + 'assemblys'):
for e in FS.readFolder(el):
try:
# Пост обработка .obj обьектов
process_mesh(source_dir=e, target_dir=e +
'/process/', subdivide=e, verbose=True)
assemblyDirNormalize.append(e + '/process/')
except Exception as e:
print('ERRROR:')
print(e)
print(assemblyDirNormalize)
for el in assemblyDirNormalize:
asset_folder = os.path.join(project_base_dir, aspDir)
assembly_dir = os.path.join(asset_folder, el)
planner = get_planner('bfs')(assembly_dir, assembly_dir, 0, [
1], False, 'sdf', 0.05, 0.01, 100, 100, True)
# Планирование пути
status, t_plan, path = planner.plan(
120, seed=1, return_path=True, render=False, record_path=None
)
coords = []
for k in path:
seMatrix = SE3(k)
euler = seMatrix.eul()
coord = seMatrix.A[0:3, 3]
rot = Rotation.from_euler('xyz', euler, degrees=True).as_quat()
coords.append({'quadrelion': [rot[0], rot[1], rot[2], rot[3]], 'xyz': [
coord[0], coord[1], coord[2]], 'euler': [euler[0], euler[1], euler[2]]})
# Запись пути в кортеж
planingObject = {
"time": t_plan,
"insertion_path": coords,
"status": status,
}
# Запись результата планирования
FS.writeFile(json.dumps(planingObject),
el[0:el.__len__() - 8], 'insertion_path.json')
try:
planner = PyPlanner(assembly_dir, 'process', still_ids=[1],)
status, t_plan, path = planner.plan(
planner_name='rrt',
step_size=None,
max_time=None,
seed=1,
return_path=True,
simplify=False,
render=False
)
print(f'Status: {status}, planning time: {t_plan}')
if args.save_dir is not None:
planner.save_path(path, args.save_dir, args.n_save_state)
except Exception as e:
print(e)
main()

View file

@ -1,3 +0,0 @@
spatialmath-python
scipy
uuid

View file

@ -1,69 +0,0 @@
(define (problem my_problem)
(:domain roboarm)
(:objects
ur_manipulator_gripper - arm
printer - printer
world - zone
box1 box2 box3 box4 box5 box6 - part
asm0 asm1 asm2 asm3 asm4 asm5 asm6 - assembly
)
(:init
not(part_at box1 world)
not(part_at box2 world)
not(part_at box3 world)
not(part_at box4 world)
not(part_at box5 world)
not(part_at box6 world)
(part_of box1 asm1)
(part_of box2 asm2)
(part_of box3 asm3)
(part_of box4 asm4)
(part_of box5 asm5)
(part_of box6 asm6)
(assembly_order asm0 asm1)
(assembly_order asm1 asm2)
(assembly_order asm2 asm3)
(assembly_order asm3 asm4)
(assembly_order asm4 asm5)
(assembly_order asm5 asm6)
(printer_available printer)
(arm_available ur_manipulator_gripper)
(assembly_at asm0 world)
(assembled asm0)
)
(:goal (and
(assembled asm6)
))
)
; нужно указать желаемое конечное состояние
; (эффект в конце действия)
; в нашем случае, допустим, будет asm6
; чтобы включить принтер в процесс, у нас должны спавниться детали
; будет что-то типа (not part_at box1 workzone)
; и action print
; начальные условия: not part_at box workzone
; принтер доступен
; в ходе дела парт печатается, принтер не доступен
; в конце - принтер доступен, деталь в зоне
; нужно в генераторе добавить поддержку условий at start и at end
; но пока что это можно прописать текстом
; предикаты -
; рука доступна - рука
; сборка в зоне - сборка зона
; деталь часть сборки - деталь сборка
; собрана - сборка
; сборочный порядок - предсборка следсборка
; +
; деталь в зоне - деталь зона
; принтер доступен - принтер

View file

@ -1,98 +0,0 @@
import os
import subprocess
import time
import FreeCAD
import Mesh
import gcoder
def export_to_stl(doc, output_dir):
objects = doc.Objects
for obj in objects:
if isinstance(obj, Part.Feature):
stl_path = os.path.join(output_dir, obj.Label + ".stl")
mesh = obj.Shape.tessellate(0.1)
# Создаем меш из геометрии объекта
mesh_obj = Mesh.Mesh(mesh)
# Проверяем, что меш содержит данные
if len(mesh_obj.Points) > 0:
# Экспортируем меш в формат STL
mesh_obj.write(stl_path)
def create_gcode(stl_dir, output_dir):
stl_files = [f for f in os.listdir(stl_dir) if f.endswith(".stl")]
for stl_file in stl_files:
stl_path = os.path.join(stl_dir, stl_file)
gcode_file = stl_file.replace(".stl", ".gcode")
gcode_path = os.path.join(output_dir, gcode_file)
# Команда для запуска Slic3r (в Ubuntu используется slic3r-пакет)
cmd = ["slic3r", "--load", "/home/mark-voltov/my_config.ini", "-o", gcode_path, stl_path]
# Запускаем Slic3r
subprocess.run(cmd)
def get_print_duration(gcode_dir):
gcoder.G
gcode_files = [f for f in os.listdir(gcode_dir) if f.endswith(".gcode")]
total_duration = 0
for gcode_file in gcode_files:
gcode_path = os.path.join(gcode_dir, gcode_file)
with open(gcode_path, "r") as file:
lines = file.readlines()
for line in lines:
if line.startswith("; estimated printing time"):
duration = float(line.split(":")[1].strip()) * 60
total_duration += duration
break
return total_duration
file_location = App.ActiveDocument.FileName
file_name = os.path.basename(file_location ) #eds_report.csv
location = os.path.dirname(file_location )
# Путь к документу FreeCAD
doc_path = file_location
# Каталог для сохранения STL-файлов
stl_dir = location + '/stl'
# Каталог для сохранения G-code файлов
gcode_dir = location + '/gcode'
# Открываем документ FreeCAD
doc = FreeCAD.open(doc_path)
# Экспортируем модель в файлы STL
export_to_stl(doc, stl_dir)
print("STL файлы успешно созданы.")
# Создаем G-code файлы с помощью Slic3r
create_gcode(stl_dir, gcode_dir)
print("G-code файлы успешно созданы.")
# Получаем оценочную длительность печати
print_duration = get_print_duration(gcode_dir)
print("Оценочная длительность печати: {} секунд.".format(print_duration))
# Закрываем документ FreeCAD
FreeCAD.closeDocument(doc)

View file

@ -1,127 +0,0 @@
(define (problem p1)
(:domain robossembler)
(:objects
;; information from Scene
rasmt - arm
printer1 printer2 printer3 - printer
workspace1 - workspace
worker - human
filament1 filament2 filament3 - filament
;; information from CAD
pad009003002002 pad009003002003 pad009003002005 pad009003002011 fusion004003 o_2_a001 o_2_m001 o_3_m001 o_3_a001 pad009003002008 fusion005 o_4_m001 o_5_m001 o_5_a001 o_4_a001 fusion006 r_a001 r_m001 r_l001 synfix synfix001 fusion fusion001 synfix002 fusion002 synfix003 fusion007 pad009003002012 pad001 pocket pad002 fusion008 fusion009 bearing_dgsr_6006_001 bearing_dgsr_6006_002 bearing_dgsr_6006_003 bearing_dgsr_6005_ bearing_dgsr_6005_001 bearing_dgsr_6005_002 bearing_dgsr_6005_003 bearing_dgsr_6005_004 pad003 pocket001 - part
subasm00 subasm0 subasm1 subasm2 subasm3 subasm4 subasm5 subasm6 subasm7 subasm8 subasm9 subasm10 subasm11 subasm12 subasm13 subasm14 subasm15 subasm16 subasm17 subasm18 subasm19 subasm20 subasm21 subasm22 subasm23 subasm24 subasm25 subasm26 subasm27 subasm28 subasm29 subasm30 subasm31 subasm32 subasm33 subasm34 subasm35 subasm36 subasm37 subasm38 subasm39 subasm40 subasm41 subasm42 - assembly
)
(:init
;; information from Scene
(observer_free worker)
; (not(printer_ready printer1))
; (printer_ready printer2)
; (printer_ready printer3)
(filament_at filament1 workspace1)
(filament_at filament2 workspace1)
(filament_at filament3 workspace1)
(arm_available rasmt)
;; information from CAD
(assembled subasm00 workspace1)
(part_of pad009003002002 subasm0)
(part_of pad009003002003 subasm1)
(part_of pad009003002005 subasm2)
(part_of pad009003002011 subasm3)
(part_of fusion004003 subasm4)
(part_of o_2_a001 subasm5)
(part_of o_2_m001 subasm6)
(part_of o_3_m001 subasm7)
(part_of o_3_a001 subasm8)
(part_of pad009003002008 subasm9)
(part_of fusion005 subasm10)
(part_of o_4_m001 subasm11)
(part_of o_5_m001 subasm12)
(part_of o_5_a001 subasm13)
(part_of o_4_a001 subasm14)
(part_of fusion006 subasm15)
(part_of r_a001 subasm16)
(part_of r_m001 subasm17)
(part_of r_l001 subasm18)
(part_of synfix subasm19)
(part_of synfix001 subasm20)
(part_of fusion subasm21)
(part_of fusion001 subasm22)
(part_of synfix002 subasm23)
(part_of fusion002 subasm24)
(part_of synfix003 subasm25)
(part_of fusion007 subasm26)
(part_of pad009003002012 subasm27)
(part_of pad001 subasm28)
(part_of pocket subasm29)
(part_of pad002 subasm30)
(part_of fusion008 subasm31)
(part_of fusion009 subasm32)
(part_of bearing_dgsr_6006_001 subasm33)
(part_of bearing_dgsr_6006_002 subasm34)
(part_of bearing_dgsr_6006_003 subasm35)
(part_of bearing_dgsr_6005_ subasm36)
(part_of bearing_dgsr_6005_001 subasm37)
(part_of bearing_dgsr_6005_002 subasm38)
(part_of bearing_dgsr_6005_003 subasm39)
(part_of bearing_dgsr_6005_004 subasm40)
(part_of pad003 subasm41)
(part_of pocket001 subasm42)
(assembly_order subasm00 subasm0)
(assembly_order subasm0 subasm1)
(assembly_order subasm1 subasm2)
(assembly_order subasm2 subasm3)
(assembly_order subasm3 subasm4)
(assembly_order subasm4 subasm5)
(assembly_order subasm5 subasm6)
(assembly_order subasm6 subasm7)
(assembly_order subasm7 subasm8)
(assembly_order subasm8 subasm9)
(assembly_order subasm9 subasm10)
(assembly_order subasm10 subasm11)
(assembly_order subasm11 subasm12)
(assembly_order subasm12 subasm13)
(assembly_order subasm13 subasm14)
(assembly_order subasm14 subasm15)
(assembly_order subasm15 subasm16)
(assembly_order subasm16 subasm17)
(assembly_order subasm17 subasm18)
(assembly_order subasm18 subasm19)
(assembly_order subasm19 subasm20)
(assembly_order subasm20 subasm21)
(assembly_order subasm21 subasm22)
(assembly_order subasm22 subasm23)
(assembly_order subasm23 subasm24)
(assembly_order subasm24 subasm25)
(assembly_order subasm25 subasm26)
(assembly_order subasm26 subasm27)
(assembly_order subasm27 subasm28)
(assembly_order subasm28 subasm29)
(assembly_order subasm29 subasm30)
(assembly_order subasm30 subasm31)
(assembly_order subasm31 subasm32)
(assembly_order subasm32 subasm33)
(assembly_order subasm33 subasm34)
(assembly_order subasm34 subasm35)
(assembly_order subasm35 subasm36)
(assembly_order subasm36 subasm37)
(assembly_order subasm37 subasm38)
(assembly_order subasm38 subasm39)
(assembly_order subasm39 subasm40)
(assembly_order subasm40 subasm41)
(assembly_order subasm41 subasm42)
)
(:goal (and
;; information from CAD
(assembled subasm42 workspace1)
)
)
)

View file

@ -1,53 +0,0 @@
import FreeCAD as App
import FreeCADGui as Gui
# App.newDocument()
doc = App.ActiveDocument
print('задайте начальную точку захватной зоны. ')
print('Учтите, что ось X должна быть направлена вдоль направления раскрытия пальцев')
print('Ось Z должна быть направлена в противоположную сторону от направления кончика пальца захвата')
lcsname = input('Введите название начальной точки' + "\n")
lcs = doc.getObject(lcsname)
def poseGenerator(lcs):
box = doc.addObject("Part::Box", "gripSpace")
box.Length = 62 #раскрытие
box.Width = 10 #ширина пальца
box.Height = 40 #глубина
box.Placement = lcs.Placement
#box.Transparency = 80 #не работает, хз почему
#есть смысл создавать привязку прямо здесь же. благодаря параметризации, при подстройке куба все точки сместятся как надо
gripPose = App.ActiveDocument.addObject('PartDesign::CoordinateSystem', 'GripPose')
gripPose.Support = box
gripPose.MapMode = 'ObjectXY'
gripPose.AttachmentOffset.Base = [box.Length/2, box.Width/2, 0] #здесь должна быть активная привязка, не просто значения координат
gripPose.addProperty("App::PropertyFloat", "GripOpen")
gripPose.addProperty("App::PropertyFloat", "GripDepth")
gripPose.addProperty("App::PropertyFloat", "GripWidth")
gripPose.GripOpen = box.Length.Value
gripPose.GripWidth = box.Width.Value
gripPose.GripDepth = box.Height.Value
#нужно создавать обьект внутри Part, а не внутри главного документа. сбиваются привязки !!!
print('Установите захватную зону вручную, растянув обьект GripSpace')
doc.recompute()
#вроде как работает
poseGenerator(lcs)

View file

@ -1,184 +0,0 @@
import FreeCAD as App
import unicodedata
import numpy as np
from .helper.is_solid import is_object_solid
## Программа, содержащая все проверки активного проекта FreeCAD в соответствии с issue#149
doc = App.ActiveDocument
Console = App.Console
#========== Проверка имен ===============
class FormalValidator:
def __init__(self, document):
self.document = document
def is_unicode_safe(self, name):
normalized_name = unicodedata.normalize('NFKD', name).encode('ASCII', 'ignore').decode()
return name == normalized_name
def fix_invalid_names(self):
for obj in self.document.Objects:
if not self.is_unicode_safe(obj.Label):
safe_name = unicodedata.normalize('NFKD', obj.Label).encode('ASCII', 'ignore').decode()
obj.Label = safe_name
self.document.recompute()
#запуск проверки и исправления имен файлов
def validate(self):
invalid_names = [obj.Label for obj in self.document.Objects if not self.is_unicode_safe(obj.Label)]
if invalid_names:
print("Некорректные имена:")
for name in invalid_names:
print(name)
self.fix_invalid_names()
else:
print("Все имена корректны.")
class ModelValidator:
def __init__(self, document):
self.document = document
self.partlist = [obj for obj in self.document.Objects if (is_object_solid(obj) and not obj.TypeId == 'App::Part') ]
self.material_objects = [obj for obj in document.Objects if obj.TypeId == "App::MaterialObjectPython"]
def get_parts(self):
pass
def validate_geometry(self):
for obj in self.document.Objects:
if hasattr(obj, "Shape") and not is_object_solid(obj):
Console.PrintError(f"Объект '{obj.Name}' не является твердым телом.\n")
def is_intersecting(self, obj1, obj2):
if obj1.Shape.common(obj2.Shape).Volume > 0.0:
return True
def has_allow_intersections(self, obj):
if hasattr(obj, 'Base_Allowed_Intersection') and getattr(obj, 'Base_Allowed_Intersection', True):
return True
def check_bodies_for_intersections(self):
bodies = self.partlist
num_bodies = len(bodies)
for i in range(num_bodies):
for j in range(i + 1, num_bodies):
body1 = bodies[i]
body2 = bodies[j]
if self.is_intersecting(body1, body2):
if self.has_allow_intersections(body1) or self.has_allow_intersections(body2):
Console.PrintWarning(
f"Тела '{body1.Label}' и '{body2.Label}' ""предусмотренно пересекаются.\n")
else:
Console.PrintError(
f"Тела '{body1.Label}' и '{body2.Label}' ""непредусмотренно пересекаются.\n")
print('V = ' + str(body1.Shape.common(body2.Shape).Volume))
def get_adjacency_matrix(self, padding = 1):
# print(int(padding))
bodies = self.partlist
num_bodies = len(bodies)
adjacency_matrix = np.zeros((num_bodies, num_bodies), dtype=bool)
for i in range(num_bodies):
shape1 = bodies[i].Shape
for j in range(i + 1, num_bodies):
shape2 = bodies[j].Shape
if shape1.common(shape2).Volume > 0:
continue
distance = shape1.distToShape(shape2)
if distance[0] < padding:
adjacency_matrix[i][j] = 1
adjacency_matrix[j][i] = 1
return adjacency_matrix
def check_bodies_without_contacts(self):
adjacency_matrix = self.get_adjacency_matrix()
bodies = self.partlist
isolated_bodies = []
num_bodies = len(bodies)
for i in range(num_bodies):
# Проверяем, есть ли у тела касания с другими телами
if not any(adjacency_matrix[i]):
isolated_bodies.append(bodies[i].Label)
if isolated_bodies:
App.Console.PrintWarning("Следующие тела не касаются других:\n")
for label in isolated_bodies:
App.Console.PrintWarning(f"- {label}\n")
else:
App.Console.PrintMessage("Все тела имеют контакты.\n")
def find_material_objects(document):
pass
def check_bodies_with_multiple_materials(self):
material_objects = self.material_objects
material_references = {}
for material in material_objects:
if hasattr(material, "References"):
for reference in material.References:
if reference in material_references:
material_references[reference].append(material.Label)
else:
material_references[reference] = [material.Label]
conflicts = {k: v for k, v in material_references.items() if len(v) > 1}
if conflicts:
App.Console.PrintWarning("Обнаружены конфликты между объектами материалов:\n")
for ref, materials in conflicts.items():
App.Console.PrintWarning(f"Деталь '{ref[0].Label}' используется в материалах: {', '.join(materials)}\n")
else:
App.Console.PrintMessage("Конфликтов в ссылках материалов не обнаружено.\n")
def check_bodies_without_material(self):
material_objects = self.material_objects
partlist = self.partlist
referenced_bodies = []
for material in material_objects:
if hasattr(material, "References"):
for reference in material.References:
referenced_bodies.append(reference[0].Label)
bodies_without_material = []
for part in partlist:
if part.Label not in referenced_bodies:
bodies_without_material.append(part.Label)
if bodies_without_material:
App.Console.PrintWarning("Следующие тела не имеют назначенного материала:\n")
for name in bodies_without_material:
App.Console.PrintWarning(f"- {name}\n")
else:
App.Console.PrintMessage("Все тела имеют назначенные материалы.\n")
def validate(self):
self.validate_geometry()
self.check_bodies_for_intersections()
self.check_bodies_without_contacts()
self.check_bodies_without_material()
self.check_bodies_with_multiple_materials()
def validate_project():
doc = App.ActiveDocument
FormalValidator(doc).validate()
ModelValidator(doc).validate()

View file

@ -1,72 +0,0 @@
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<!-- Created with Inkscape (http://www.inkscape.org/) -->
<svg xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:cc="http://creativecommons.org/ns#" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:svg="http://www.w3.org/2000/svg" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd" xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape" width="32px" height="32px" id="svg3085" version="1.1" inkscape:version="0.92.4 (5da689c313, 2019-01-14)" sodipodi:docname="a2p_PartsList.svg">
<defs id="defs3087">
<inkscape:path-effect effect="skeletal" id="path-effect3066" is_visible="true" pattern="M 0,0 0,10 10,5 z" copytype="single_stretched" prop_scale="1" scale_y_rel="false" spacing="0" normal_offset="0" tang_offset="0" prop_units="false" vertical_pattern="false" fuse_tolerance="0"/>
<linearGradient inkscape:collect="always" id="linearGradient7597">
<stop style="stop-color:#000003;stop-opacity:1;" offset="0" id="stop7599"/>
<stop style="stop-color:#000003;stop-opacity:0;" offset="1" id="stop7601"/>
</linearGradient>
<marker inkscape:stockid="Arrow1Lstart" orient="auto" refY="0.0" refX="0.0" id="Arrow1Lstart" style="overflow:visible">
<path id="path3995" d="M 0.0,0.0 L 5.0,-5.0 L -12.5,0.0 L 5.0,5.0 L 0.0,0.0 z " style="fill-rule:evenodd;stroke:#000000;stroke-width:1.0pt" transform="scale(0.8) translate(12.5,0)"/>
</marker>
<marker inkscape:stockid="Arrow1Send" orient="auto" refY="0.0" refX="0.0" id="Arrow1Send" style="overflow:visible;">
<path id="path4010" d="M 0.0,0.0 L 5.0,-5.0 L -12.5,0.0 L 5.0,5.0 L 0.0,0.0 z " style="fill-rule:evenodd;stroke:#000000;stroke-width:1.0pt;" transform="scale(0.2) rotate(180) translate(6,0)"/>
</marker>
<marker inkscape:stockid="Arrow1Sstart" orient="auto" refY="0.0" refX="0.0" id="Arrow1Sstart" style="overflow:visible">
<path id="path4007" d="M 0.0,0.0 L 5.0,-5.0 L -12.5,0.0 L 5.0,5.0 L 0.0,0.0 z " style="fill-rule:evenodd;stroke:#000000;stroke-width:1.0pt" transform="scale(0.2) translate(6,0)"/>
</marker>
<marker inkscape:stockid="Arrow2Sstart" orient="auto" refY="0.0" refX="0.0" id="Arrow2Sstart" style="overflow:visible">
<path id="path4025" style="fill-rule:evenodd;stroke-width:0.62500000;stroke-linejoin:round" d="M 8.7185878,4.0337352 L -2.2072895,0.016013256 L 8.7185884,-4.0017078 C 6.9730900,-1.6296469 6.9831476,1.6157441 8.7185878,4.0337352 z " transform="scale(0.3) translate(-2.3,0)"/>
</marker>
<marker inkscape:stockid="TriangleOutL" orient="auto" refY="0.0" refX="0.0" id="TriangleOutL" style="overflow:visible">
<path id="path4137" d="M 5.77,0.0 L -2.88,5.0 L -2.88,-5.0 L 5.77,0.0 z " style="fill-rule:evenodd;stroke:#000000;stroke-width:1.0pt" transform="scale(0.8)"/>
</marker>
<marker inkscape:stockid="DiamondLend" orient="auto" refY="0.0" refX="0.0" id="DiamondLend" style="overflow:visible">
<path id="path4092" d="M 0,-7.0710768 L -7.0710894,0 L 0,7.0710589 L 7.0710462,0 L 0,-7.0710768 z " style="fill-rule:evenodd;stroke:#000000;stroke-width:1.0pt" transform="scale(0.8) translate(-7,0)"/>
</marker>
<marker inkscape:stockid="DiamondLstart" orient="auto" refY="0.0" refX="0.0" id="DiamondLstart" style="overflow:visible">
<path id="path4083" d="M 0,-7.0710768 L -7.0710894,0 L 0,7.0710589 L 7.0710462,0 L 0,-7.0710768 z " style="fill-rule:evenodd;stroke:#000000;stroke-width:1.0pt" transform="scale(0.8) translate(7,0)"/>
</marker>
<marker inkscape:stockid="Arrow1Lend" orient="auto" refY="0.0" refX="0.0" id="Arrow1Lend" style="overflow:visible;">
<path id="path3998" d="M 0.0,0.0 L 5.0,-5.0 L -12.5,0.0 L 5.0,5.0 L 0.0,0.0 z " style="fill-rule:evenodd;stroke:#000000;stroke-width:1.0pt;" transform="scale(0.8) rotate(180) translate(12.5,0)"/>
</marker>
<linearGradient id="linearGradient3893">
<stop style="stop-color:#ffffff;stop-opacity:1;" offset="0" id="stop3895"/>
<stop style="stop-color:#ffffff;stop-opacity:0;" offset="1" id="stop3897"/>
</linearGradient>
<linearGradient inkscape:collect="always" xlink:href="#linearGradient7597" id="linearGradient7603" x1="15.71482" y1="22.299378" x2="34.136209" y2="22.299378" gradientUnits="userSpaceOnUse"/>
</defs>
<sodipodi:namedview id="base" pagecolor="#ffffff" bordercolor="#666666" borderopacity="1.0" inkscape:pageopacity="0.0" inkscape:pageshadow="2" inkscape:zoom="16" inkscape:cx="17.629635" inkscape:cy="8.4343604" inkscape:current-layer="layer1" showgrid="true" inkscape:grid-bbox="true" inkscape:document-units="px" inkscape:window-width="1920" inkscape:window-height="1018" inkscape:window-x="-8" inkscape:window-y="-8" inkscape:window-maximized="1"/>
<metadata id="metadata3090">
<rdf:RDF>
<cc:Work rdf:about="">
<dc:format>image/svg+xml</dc:format>
<dc:type rdf:resource="http://purl.org/dc/dcmitype/StillImage"/>
<dc:title/>
</cc:Work>
</rdf:RDF>
</metadata>
<g id="layer1" inkscape:label="Layer 1" inkscape:groupmode="layer">
<rect style="fill:#000000;fill-opacity:1;stroke:#000000;stroke-width:0.11415751000000000;stroke-linecap:butt;stroke-miterlimit:4;stroke-opacity:1;stroke-dasharray:none" id="rect3018" width="1.2970899" height="32.02499" x="0.058561768" y="0.011311022"/>
<rect style="fill:#000000;fill-opacity:1;stroke:#000000;stroke-width:0.11415751000000000;stroke-linecap:butt;stroke-miterlimit:4;stroke-opacity:1;stroke-dasharray:none" id="rect3018-5" width="1.2970899" height="32.02499" x="30.72147" y="0.021291591"/>
<rect style="fill:#000000;fill-opacity:1;stroke:#000000;stroke-width:0.11415751;stroke-linecap:butt;stroke-miterlimit:4;stroke-opacity:1;stroke-dasharray:none" id="rect3018-3" width="1.2970899" height="32.02499" x="-0.026408914" y="-32.054981" transform="matrix(0,1,-1,0,0,0)"/>
<rect style="fill:#000000;fill-opacity:1;stroke:#000000;stroke-width:0.11415751;stroke-linecap:butt;stroke-miterlimit:4;stroke-opacity:1;stroke-dasharray:none" id="rect3018-3-6" width="1.2970899" height="32.02499" x="11.354873" y="-31.978708" transform="matrix(0,1,-1,0,0,0)"/>
<rect style="fill:#000000;fill-opacity:1;stroke:#000000;stroke-width:0.11415751;stroke-linecap:butt;stroke-miterlimit:4;stroke-opacity:1;stroke-dasharray:none" id="rect3018-3-6-9" width="1.2970899" height="32.02499" x="22.061981" y="-31.934517" transform="matrix(0,1,-1,0,0,0)"/>
<rect style="fill:#000000;fill-opacity:1;stroke:#000000;stroke-width:0.11415751;stroke-linecap:butt;stroke-miterlimit:4;stroke-opacity:1;stroke-dasharray:none" id="rect3018-3-6-9-2" width="1.2970899" height="32.02499" x="30.636494" y="-31.934515" transform="matrix(0,1,-1,0,0,0)"/>
<g id="g4617">
<path sodipodi:nodetypes="ccccccccc" inkscape:connector-curvature="0" id="path3369" d="M 1.4229313,27.000257 V 23.442626 H 16.029106 30.63528 v 3.557631 3.557631 H 16.029106 1.4229313 Z" style="fill:#ffffff;fill-opacity:1"/>
<text id="text3100" y="27.713165" x="11.433594" style="font-style:normal;font-weight:bold;line-height:0%;font-family:sans-serif;-inkscape-font-specification:'Sans Bold';letter-spacing:0px;word-spacing:0px;fill:#000000;fill-opacity:1;stroke:none" xml:space="preserve"><tspan style="font-size:8px;line-height:1.25;font-family:sans-serif" y="27.713165" x="11.433594" id="tspan3102" sodipodi:role="line">...</tspan></text>
</g>
<path style="fill:#ffffff;fill-opacity:1" d="m 6.2842904,5.3724349 0,-0.8007207 0.5237353,0 c 0.5882447,0 0.7620882,0.041783 0.9637654,0.2316391 0.2499922,0.2353392 0.2907934,0.7148274 0.086406,1.0154223 C 7.6895473,6.0668098 7.4826438,6.1358185 6.848381,6.1555803 l -0.5640906,0.017575 0,-0.8007208 z" id="path3375" inkscape:connector-curvature="0"/>
<path style="fill:#ffffff;fill-opacity:1" d="M 11.823275,8.4123074 C 11.48911,8.3155617 11.339256,7.8685764 11.550817,7.5996196 11.705969,7.4023768 11.881121,7.3559471 12.470055,7.3559471 l 0.53175,0 -2.48e-4,0.1436311 c -7.16e-4,0.4175365 -0.294436,0.8141335 -0.673669,0.9096255 -0.234672,0.059091 -0.309638,0.059552 -0.504614,0.0031 l 1e-6,0 z" id="path3377" inkscape:connector-curvature="0"/>
<g id="g3754">
<path inkscape:connector-curvature="0" id="path3373" d="M 1.4229313,6.317384 V 1.345539 H 16.029106 30.63528 v 4.971845 4.971845 H 16.029106 1.4229313 Z" style="fill:#ffffff;fill-opacity:1" sodipodi:nodetypes="ccccccccc"/>
<text id="text3013" y="9.2841949" x="4.0273438" style="font-style:normal;font-weight:bold;line-height:0%;font-family:sans-serif;-inkscape-font-specification:'Sans Bold';letter-spacing:0px;word-spacing:0px;fill:#000000;fill-opacity:1;stroke:none" xml:space="preserve"><tspan style="font-size:8px;line-height:1.25;font-family:sans-serif" y="9.2841949" x="4.0273438" id="tspan3015" sodipodi:role="line">Parts</tspan></text>
</g>
<g id="g4612">
<path sodipodi:nodetypes="ccccccccc" inkscape:connector-curvature="0" id="path3371" d="M 1.4229313,17.365927 V 12.747636 H 16.029106 30.63528 v 4.618291 4.618292 H 16.029106 1.4229313 Z" style="fill:#ffffff;fill-opacity:1;stroke:none;stroke-opacity:1"/>
<text id="text3017" y="20.221827" x="7.5078125" style="font-style:normal;font-weight:bold;line-height:0%;font-family:sans-serif;-inkscape-font-specification:'Sans Bold';letter-spacing:0px;word-spacing:0px;fill:#000000;fill-opacity:1;stroke:none" xml:space="preserve"><tspan style="font-size:8px;line-height:1.25;font-family:sans-serif" y="20.221827" x="7.5078125" id="tspan3019" sodipodi:role="line">List</tspan></text>
</g>
</g>
</svg>

Before

Width:  |  Height:  |  Size: 9.4 KiB

View file

@ -1,237 +0,0 @@
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<!-- Created with Inkscape (http://www.inkscape.org/) -->
<svg
xmlns:dc="http://purl.org/dc/elements/1.1/"
xmlns:cc="http://creativecommons.org/ns#"
xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
xmlns:svg="http://www.w3.org/2000/svg"
xmlns="http://www.w3.org/2000/svg"
xmlns:xlink="http://www.w3.org/1999/xlink"
xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd"
xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape"
width="64px"
height="64px"
id="svg5642"
version="1.1"
inkscape:version="0.48.4 r9939"
sodipodi:docname="drawing.svg">
<defs
id="defs5644">
<linearGradient
inkscape:collect="always"
xlink:href="#linearGradient3801"
id="linearGradient3807"
x1="110"
y1="35"
x2="85"
y2="35"
gradientUnits="userSpaceOnUse"
spreadMethod="reflect"
gradientTransform="translate(-60.636365,31.636364)" />
<linearGradient
inkscape:collect="always"
id="linearGradient3801">
<stop
style="stop-color:#204a87;stop-opacity:1"
offset="0"
id="stop3803" />
<stop
style="stop-color:#729fcf;stop-opacity:1"
offset="1"
id="stop3805" />
</linearGradient>
<clipPath
clipPathUnits="userSpaceOnUse"
id="clipPath6357">
<rect
style="fill:#ffffff;fill-opacity:1;stroke:#000000;stroke-width:18.81833839;stroke-linecap:round;stroke-linejoin:miter;stroke-miterlimit:4;stroke-opacity:0;stroke-dasharray:none;stroke-dashoffset:0"
id="rect6359"
width="51.845303"
height="56.390755"
x="6.6228013"
y="1.5318987" />
</clipPath>
<linearGradient
inkscape:collect="always"
xlink:href="#linearGradient3801"
id="linearGradient6363"
gradientUnits="userSpaceOnUse"
gradientTransform="translate(-60.636365,31.636364)"
spreadMethod="reflect"
x1="110"
y1="35"
x2="85"
y2="35" />
</defs>
<sodipodi:namedview
id="base"
pagecolor="#ffffff"
bordercolor="#666666"
borderopacity="1.0"
inkscape:pageopacity="0.0"
inkscape:pageshadow="2"
inkscape:zoom="5.5"
inkscape:cx="2.3478057"
inkscape:cy="35.001512"
inkscape:current-layer="layer1"
showgrid="true"
inkscape:document-units="px"
inkscape:grid-bbox="true"
inkscape:window-width="1375"
inkscape:window-height="811"
inkscape:window-x="65"
inkscape:window-y="24"
inkscape:window-maximized="1" />
<metadata
id="metadata5647">
<rdf:RDF>
<cc:Work
rdf:about="">
<dc:format>image/svg+xml</dc:format>
<dc:type
rdf:resource="http://purl.org/dc/dcmitype/StillImage" />
<dc:title></dc:title>
</cc:Work>
</rdf:RDF>
</metadata>
<g
id="layer1"
inkscape:label="Layer 1"
inkscape:groupmode="layer">
<g
id="g6337"
clip-path="url(#clipPath6357)"
transform="matrix(1.1017012,0,0,1.1017012,-3.2190011,-6.7998918)">
<path
sodipodi:nodetypes="sscccs"
inkscape:connector-curvature="0"
id="path2994-3"
d="m 56.363636,84.636364 c 0,4.418278 -10.745166,8 -24,8 -13.254833,0 -23.9999985,-3.581722 -23.9999985,-8 l -2e-6,-42 47.9999985,0 z"
style="fill:#729fcf;stroke:#0b1521;stroke-width:1.99999988;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:4.5;stroke-opacity:1;stroke-dashoffset:20.4" />
<path
sodipodi:nodetypes="sscccs"
inkscape:connector-curvature="0"
id="path2994-3-6"
d="m 54.363635,83.363637 c 0,4.016616 -9.84973,7.272727 -22,7.272727 -12.150264,0 -21.999999,-3.256111 -21.999999,-7.272727 l -2e-6,-38 44.000001,0 z"
style="fill:url(#linearGradient6363);fill-opacity:1;stroke:#729fcf;stroke-width:2;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:4.5;stroke-opacity:1;stroke-dashoffset:20.4" />
<path
sodipodi:nodetypes="csc"
inkscape:connector-curvature="0"
id="path2994-3-6-9"
d="m 54.363635,47.363637 c -2,3.272727 -9.84973,5.272727 -22,5.272727 -12.150264,0 -19,-2 -21.999999,-5.272727"
style="fill:none;stroke:#729fcf;stroke-width:2;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:4.5;stroke-opacity:1;stroke-dashoffset:20.4" />
<path
transform="matrix(1.1428571,0,0,1.1428571,72.363636,14.064936)"
d="m -14,25 c 0,3.865993 -9.40202,7 -21,7 -11.59798,0 -21,-3.134007 -21,-7 0,-3.865993 9.40202,-7 21,-7 11.59798,0 21,3.134007 21,7 z"
sodipodi:ry="7"
sodipodi:rx="21"
sodipodi:cy="25"
sodipodi:cx="-35"
id="path2994"
style="fill:#729fcf;stroke:#0b1521;stroke-width:1.75;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:4.5;stroke-opacity:1;stroke-dasharray:none;stroke-dashoffset:20.4"
sodipodi:type="arc" />
<g
transform="matrix(1.1251249,0,0,1.2288536,-5.1529457,-1.5237155)"
style="stroke-width:1.60000002;stroke-miterlimit:4;stroke-dasharray:none"
id="g4792">
<path
inkscape:connector-curvature="0"
id="rect3039-1"
d="m 32.679504,12.145359 -1.645803,2.84862 -1.645803,2.848621 2.164344,0 0,15.110077 c -0.652792,0.422664 -1.086869,1.135456 -1.127263,1.961007 l -12.219523,6.832562 -0.969446,-1.733943 -1.578167,2.662841 -1.578167,2.642199 3.088698,0.04128 3.088699,0.04128 -0.9469,-1.672017 12.039161,-6.749993 c 0.426007,0.340749 0.967678,0.536697 1.555622,0.536697 0.97078,0 1.798652,-0.551924 2.209435,-1.362384 l 14.6995,0.206422 -0.02255,2.146787 2.863246,-1.610091 2.863246,-1.61009 -2.818155,-1.672016 -2.818156,-1.692659 -0.02255,2.167429 -14.744591,-0.18578 c -0.276375,-0.539009 -0.738838,-0.954624 -1.307625,-1.176604 l 0,-14.883013 2.164344,0 -1.645803,-2.848621 -1.645803,-2.84862 z"
style="fill:#729fcf;fill-rule:evenodd;stroke:#000000;stroke-width:2.34711409;stroke-linecap:round;stroke-miterlimit:4;stroke-opacity:1;stroke-dasharray:none" />
<rect
style="fill:#729fcf;fill-rule:evenodd;stroke:none"
id="rect3039"
width="2.271805"
height="19.048214"
x="31.545361"
y="15.941667" />
<path
sodipodi:type="star"
style="fill:#729fcf;fill-rule:evenodd;stroke:none"
id="path3043"
sodipodi:sides="3"
sodipodi:cx="33.727276"
sodipodi:cy="7.6363635"
sodipodi:r1="3.9469614"
sodipodi:r2="1.9734807"
sodipodi:arg1="0.52359878"
sodipodi:arg2="1.5707963"
inkscape:flatsided="false"
inkscape:rounded="0"
inkscape:randomized="0"
d="m 37.145445,9.6098442 -3.418169,0 -3.418169,0 1.709084,-2.960221 1.709085,-2.9602211 1.709084,2.960221 z"
inkscape:transform-center-y="-0.94840389"
transform="matrix(0.96114836,0,0,0.96114836,0.26435064,8.6019885)" />
<rect
style="fill:#ef2929;fill-rule:evenodd;stroke:none"
id="rect3039-3"
width="2.271805"
height="19.048214"
x="33.423866"
y="-52.183987"
transform="matrix(-0.0130695,0.99991459,-0.99991459,-0.0130695,0,0)" />
<path
transform="matrix(-0.01256173,0.96106627,-0.96106627,-0.01256173,59.490575,2.9206132)"
sodipodi:type="star"
style="fill:#ef2929;fill-rule:evenodd;stroke:none"
id="path3043-6"
sodipodi:sides="3"
sodipodi:cx="33.727276"
sodipodi:cy="7.6363635"
sodipodi:r1="3.9469614"
sodipodi:r2="1.9734807"
sodipodi:arg1="0.52359878"
sodipodi:arg2="1.5707963"
inkscape:flatsided="false"
inkscape:rounded="0"
inkscape:randomized="0"
d="m 37.145445,9.6098442 -3.418169,0 -3.418169,0 1.709084,-2.960221 1.709085,-2.9602211 1.709084,2.960221 z"
inkscape:transform-center-y="-0.024790177"
inkscape:transform-center-x="-0.92685398" />
<rect
style="fill:#8ae234;fill-rule:evenodd;stroke:none"
id="rect3039-3-7"
width="2.2567275"
height="18.921833"
x="-47.582092"
y="-7.3576851"
transform="matrix(-0.48864025,-0.87248536,0.87248701,-0.4886373,0,0)" />
<path
transform="matrix(-0.44155795,-0.78841815,0.78842129,-0.4415562,26.06505,73.540728)"
sodipodi:type="star"
style="fill:#8ae234;fill-rule:evenodd;stroke:none"
id="path3043-6-5"
sodipodi:sides="3"
sodipodi:cx="33.727276"
sodipodi:cy="7.6363635"
sodipodi:r1="3.9469614"
sodipodi:r2="1.9734807"
sodipodi:arg1="0.52359878"
sodipodi:arg2="1.5707963"
inkscape:flatsided="false"
inkscape:rounded="0"
inkscape:randomized="0"
d="m 37.145445,9.6098442 -3.418169,0 -3.418169,0 1.709084,-2.960221 1.709085,-2.9602211 1.709084,2.960221 z"
inkscape:transform-center-y="-0.87140186"
inkscape:transform-center-x="0.0233072" />
<path
sodipodi:type="arc"
style="fill:#fce94f;stroke:none"
id="path4366"
sodipodi:cx="35.954548"
sodipodi:cy="37.590908"
sodipodi:rx="2.5909083"
sodipodi:ry="2.590909"
d="m 38.545456,37.590908 c 0,1.43092 -1.159989,2.590909 -2.590908,2.590909 -1.430919,0 -2.590908,-1.159989 -2.590908,-2.590909 0,-1.430919 1.159989,-2.590909 2.590908,-2.590909 1.430919,0 2.590908,1.15999 2.590908,2.590909 z"
transform="matrix(0.96114836,0,0,0.96114836,-1.6579462,-1.0968723)" />
</g>
<path
inkscape:connector-curvature="0"
id="path5806"
d="m 64.181818,63.636364 -63.99999982,0"
style="fill:none;stroke:#000000;stroke-width:7.59999943;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-opacity:0;stroke-dasharray:none" />
</g>
</g>
</svg>

Before

Width:  |  Height:  |  Size: 10 KiB

View file

@ -1,152 +0,0 @@
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<!-- Created with Inkscape (http://www.inkscape.org/) -->
<svg
xmlns:dc="http://purl.org/dc/elements/1.1/"
xmlns:cc="http://creativecommons.org/ns#"
xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
xmlns:svg="http://www.w3.org/2000/svg"
xmlns="http://www.w3.org/2000/svg"
xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd"
xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape"
width="64px"
height="64px"
id="svg6384"
version="1.1"
inkscape:version="0.48.4 r9939"
sodipodi:docname="New document 37">
<defs
id="defs6386" />
<sodipodi:namedview
id="base"
pagecolor="#ffffff"
bordercolor="#666666"
borderopacity="1.0"
inkscape:pageopacity="0.0"
inkscape:pageshadow="2"
inkscape:zoom="1.9445436"
inkscape:cx="33.122262"
inkscape:cy="42.611518"
inkscape:current-layer="layer1"
showgrid="true"
inkscape:document-units="px"
inkscape:grid-bbox="true"
inkscape:window-width="472"
inkscape:window-height="383"
inkscape:window-x="968"
inkscape:window-y="24"
inkscape:window-maximized="0" />
<metadata
id="metadata6389">
<rdf:RDF>
<cc:Work
rdf:about="">
<dc:format>image/svg+xml</dc:format>
<dc:type
rdf:resource="http://purl.org/dc/dcmitype/StillImage" />
<dc:title></dc:title>
</cc:Work>
</rdf:RDF>
</metadata>
<g
id="layer1"
inkscape:label="Layer 1"
inkscape:groupmode="layer">
<g
id="g4792"
style="stroke-width:1.60000002;stroke-miterlimit:4;stroke-dasharray:none"
transform="matrix(1.3322492,0,0,1.4550733,-13.530887,-8.9206423)">
<path
style="fill:#729fcf;fill-rule:evenodd;stroke:#000000;stroke-width:2.34711409;stroke-linecap:round;stroke-miterlimit:4;stroke-opacity:1;stroke-dasharray:none"
d="m 32.679504,12.145359 -1.645803,2.84862 -1.645803,2.848621 2.164344,0 0,15.110077 c -0.652792,0.422664 -1.086869,1.135456 -1.127263,1.961007 l -12.219523,6.832562 -0.969446,-1.733943 -1.578167,2.662841 -1.578167,2.642199 3.088698,0.04128 3.088699,0.04128 -0.9469,-1.672017 12.039161,-6.749993 c 0.426007,0.340749 0.967678,0.536697 1.555622,0.536697 0.97078,0 1.798652,-0.551924 2.209435,-1.362384 l 14.6995,0.206422 -0.02255,2.146787 2.863246,-1.610091 2.863246,-1.61009 -2.818155,-1.672016 -2.818156,-1.692659 -0.02255,2.167429 -14.744591,-0.18578 c -0.276375,-0.539009 -0.738838,-0.954624 -1.307625,-1.176604 l 0,-14.883013 2.164344,0 -1.645803,-2.848621 -1.645803,-2.84862 z"
id="rect3039-1"
inkscape:connector-curvature="0" />
<rect
y="15.941667"
x="31.545361"
height="19.048214"
width="2.271805"
id="rect3039"
style="fill:#729fcf;fill-rule:evenodd;stroke:none" />
<path
transform="matrix(0.96114836,0,0,0.96114836,0.26435064,8.6019885)"
inkscape:transform-center-y="-0.94840389"
d="m 37.145445,9.6098442 -3.418169,0 -3.418169,0 1.709084,-2.960221 1.709085,-2.9602211 1.709084,2.960221 z"
inkscape:randomized="0"
inkscape:rounded="0"
inkscape:flatsided="false"
sodipodi:arg2="1.5707963"
sodipodi:arg1="0.52359878"
sodipodi:r2="1.9734807"
sodipodi:r1="3.9469614"
sodipodi:cy="7.6363635"
sodipodi:cx="33.727276"
sodipodi:sides="3"
id="path3043"
style="fill:#729fcf;fill-rule:evenodd;stroke:none"
sodipodi:type="star" />
<rect
transform="matrix(-0.0130695,0.99991459,-0.99991459,-0.0130695,0,0)"
y="-52.183987"
x="33.423866"
height="19.048214"
width="2.271805"
id="rect3039-3"
style="fill:#ef2929;fill-rule:evenodd;stroke:none" />
<path
inkscape:transform-center-x="-0.92685398"
inkscape:transform-center-y="-0.024790177"
d="m 37.145445,9.6098442 -3.418169,0 -3.418169,0 1.709084,-2.960221 1.709085,-2.9602211 1.709084,2.960221 z"
inkscape:randomized="0"
inkscape:rounded="0"
inkscape:flatsided="false"
sodipodi:arg2="1.5707963"
sodipodi:arg1="0.52359878"
sodipodi:r2="1.9734807"
sodipodi:r1="3.9469614"
sodipodi:cy="7.6363635"
sodipodi:cx="33.727276"
sodipodi:sides="3"
id="path3043-6"
style="fill:#ef2929;fill-rule:evenodd;stroke:none"
sodipodi:type="star"
transform="matrix(-0.01256173,0.96106627,-0.96106627,-0.01256173,59.490575,2.9206132)" />
<rect
transform="matrix(-0.48864025,-0.87248536,0.87248701,-0.4886373,0,0)"
y="-7.3576851"
x="-47.582092"
height="18.921833"
width="2.2567275"
id="rect3039-3-7"
style="fill:#8ae234;fill-rule:evenodd;stroke:none" />
<path
inkscape:transform-center-x="0.0233072"
inkscape:transform-center-y="-0.87140186"
d="m 37.145445,9.6098442 -3.418169,0 -3.418169,0 1.709084,-2.960221 1.709085,-2.9602211 1.709084,2.960221 z"
inkscape:randomized="0"
inkscape:rounded="0"
inkscape:flatsided="false"
sodipodi:arg2="1.5707963"
sodipodi:arg1="0.52359878"
sodipodi:r2="1.9734807"
sodipodi:r1="3.9469614"
sodipodi:cy="7.6363635"
sodipodi:cx="33.727276"
sodipodi:sides="3"
id="path3043-6-5"
style="fill:#8ae234;fill-rule:evenodd;stroke:none"
sodipodi:type="star"
transform="matrix(-0.44155795,-0.78841815,0.78842129,-0.4415562,26.06505,73.540728)" />
<path
transform="matrix(0.96114836,0,0,0.96114836,-1.6579462,-1.0968723)"
d="m 38.545456,37.590908 c 0,1.43092 -1.159989,2.590909 -2.590908,2.590909 -1.430919,0 -2.590908,-1.159989 -2.590908,-2.590909 0,-1.430919 1.159989,-2.590909 2.590908,-2.590909 1.430919,0 2.590908,1.15999 2.590908,2.590909 z"
sodipodi:ry="2.590909"
sodipodi:rx="2.5909083"
sodipodi:cy="37.590908"
sodipodi:cx="35.954548"
id="path4366"
style="fill:#fce94f;stroke:none"
sodipodi:type="arc" />
</g>
</g>
</svg>

Before

Width:  |  Height:  |  Size: 6.1 KiB

View file

@ -1,275 +0,0 @@
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<!-- Created with Inkscape (http://www.inkscape.org/) -->
<svg
xmlns:dc="http://purl.org/dc/elements/1.1/"
xmlns:cc="http://creativecommons.org/ns#"
xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
xmlns:svg="http://www.w3.org/2000/svg"
xmlns="http://www.w3.org/2000/svg"
xmlns:xlink="http://www.w3.org/1999/xlink"
xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd"
xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape"
width="64px"
height="64px"
id="svg4339"
version="1.1"
inkscape:version="0.48.4 r9939"
sodipodi:docname="New document 12">
<defs
id="defs4341">
<linearGradient
inkscape:collect="always"
xlink:href="#linearGradient3801"
id="linearGradient3807"
x1="110"
y1="35"
x2="85"
y2="35"
gradientUnits="userSpaceOnUse"
spreadMethod="reflect"
gradientTransform="translate(-61,23.272727)" />
<linearGradient
inkscape:collect="always"
id="linearGradient3801">
<stop
style="stop-color:#c4a000;stop-opacity:1"
offset="0"
id="stop3803" />
<stop
style="stop-color:#fce94f;stop-opacity:1"
offset="1"
id="stop3805" />
</linearGradient>
<linearGradient
inkscape:collect="always"
xlink:href="#linearGradient3801-5"
id="linearGradient3807-7"
x1="110"
y1="35"
x2="85"
y2="35"
gradientUnits="userSpaceOnUse"
spreadMethod="reflect"
gradientTransform="matrix(0.67526107,0,0,0.67526107,-31.705858,16.546964)" />
<linearGradient
inkscape:collect="always"
id="linearGradient3801-5">
<stop
style="stop-color:#204a87;stop-opacity:1"
offset="0"
id="stop3803-9" />
<stop
style="stop-color:#729fcf;stop-opacity:1"
offset="1"
id="stop3805-2" />
</linearGradient>
<linearGradient
inkscape:collect="always"
xlink:href="#linearGradient3801-5-7"
id="linearGradient3807-7-9"
x1="110"
y1="35"
x2="85"
y2="35"
gradientUnits="userSpaceOnUse"
spreadMethod="reflect"
gradientTransform="matrix(0.72727273,0,0,0.72727273,-36.272728,10.363637)" />
<linearGradient
inkscape:collect="always"
id="linearGradient3801-5-7">
<stop
style="stop-color:#204a87;stop-opacity:1"
offset="0"
id="stop3803-9-3" />
<stop
style="stop-color:#729fcf;stop-opacity:1"
offset="1"
id="stop3805-2-6" />
</linearGradient>
</defs>
<sodipodi:namedview
id="base"
pagecolor="#ffffff"
bordercolor="#666666"
borderopacity="1.0"
inkscape:pageopacity="0.0"
inkscape:pageshadow="2"
inkscape:zoom="5.5"
inkscape:cx="13.517284"
inkscape:cy="24.468658"
inkscape:current-layer="layer1"
showgrid="true"
inkscape:document-units="px"
inkscape:grid-bbox="true"
inkscape:snap-global="true"
inkscape:snap-object-midpoints="false"
inkscape:window-width="1375"
inkscape:window-height="811"
inkscape:window-x="65"
inkscape:window-y="24"
inkscape:window-maximized="1" />
<metadata
id="metadata4344">
<rdf:RDF>
<cc:Work
rdf:about="">
<dc:format>image/svg+xml</dc:format>
<dc:type
rdf:resource="http://purl.org/dc/dcmitype/StillImage" />
<dc:title></dc:title>
</cc:Work>
</rdf:RDF>
</metadata>
<g
id="layer1"
inkscape:label="Layer 1"
inkscape:groupmode="layer">
<path
style="fill:#729fcf;stroke:#0b1521;stroke-width:1.35052204;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:4.5;stroke-opacity:1;stroke-dashoffset:20.4"
d="m 47.299687,52.335801 c 0,2.983491 -7.255792,5.402088 -16.206264,5.402088 -8.950473,0 -16.206265,-2.418597 -16.206265,-5.402088 l -10e-7,-28.360965 32.41253,0 z"
id="path2994-3"
inkscape:connector-curvature="0"
sodipodi:nodetypes="sscccs" />
<path
style="opacity:0.51000001;fill:url(#linearGradient3807-7);fill-opacity:1;stroke:#729fcf;stroke-width:1.35052216;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:4.5;stroke-opacity:1;stroke-dashoffset:20.4"
d="m 45.949165,51.476378 c 0,2.712264 -6.651139,4.910989 -14.855743,4.910989 -8.2046,0 -14.855743,-2.198725 -14.855743,-4.910989 l -2e-6,-25.659921 29.711488,0 z"
id="path2994-3-6"
inkscape:connector-curvature="0"
sodipodi:nodetypes="sscccs" />
<path
sodipodi:type="arc"
style="fill:#729fcf;stroke:none"
id="path2994-8"
sodipodi:cx="-35"
sodipodi:cy="25"
sodipodi:rx="21"
sodipodi:ry="7"
d="m -14,25 a 21,7 0 1 1 -42,0 21,7 0 1 1 42,0 z"
transform="matrix(0.77172691,0,0,0.77172691,58.103864,4.6816635)" />
<path
style="fill:none;stroke:#000000;stroke-width:1.6886189;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-opacity:1;stroke-dasharray:3.37723797, 3.37723797;stroke-dashoffset:0"
d="m 31.284953,15.183043 0,45.389159"
id="path5504"
inkscape:connector-curvature="0" />
<g
id="g4792-2"
style="stroke-width:1.60000002;stroke-miterlimit:4;stroke-dasharray:none"
transform="matrix(1.236972,0,0,1.3510122,-9.558506,-9.4101622)">
<path
style="fill:#729fcf;fill-rule:evenodd;stroke:#000000;stroke-width:2.34711409;stroke-linecap:round;stroke-miterlimit:4;stroke-opacity:1;stroke-dasharray:none"
d="m 32.679504,12.145359 -1.645803,2.84862 -1.645803,2.848621 2.164344,0 0,15.110077 c -0.652792,0.422664 -1.086869,1.135456 -1.127263,1.961007 l -12.219523,6.832562 -0.969446,-1.733943 -1.578167,2.662841 -1.578167,2.642199 3.088698,0.04128 3.088699,0.04128 -0.9469,-1.672017 12.039161,-6.749993 c 0.426007,0.340749 0.967678,0.536697 1.555622,0.536697 0.97078,0 1.798652,-0.551924 2.209435,-1.362384 l 14.6995,0.206422 -0.02255,2.146787 2.863246,-1.610091 2.863246,-1.61009 -2.818155,-1.672016 -2.818156,-1.692659 -0.02255,2.167429 -14.744591,-0.18578 c -0.276375,-0.539009 -0.738838,-0.954624 -1.307625,-1.176604 l 0,-14.883013 2.164344,0 -1.645803,-2.848621 -1.645803,-2.84862 z"
id="rect3039-1"
inkscape:connector-curvature="0" />
<rect
y="15.941667"
x="31.545361"
height="19.048214"
width="2.271805"
id="rect3039-9"
style="fill:#729fcf;fill-rule:evenodd;stroke:none" />
<path
transform="matrix(0.96114836,0,0,0.96114836,0.26435064,8.6019885)"
inkscape:transform-center-y="-0.94840389"
d="m 37.145445,9.6098442 -3.418169,0 -3.418169,0 1.709084,-2.960221 1.709085,-2.9602211 1.709084,2.960221 z"
inkscape:randomized="0"
inkscape:rounded="0"
inkscape:flatsided="false"
sodipodi:arg2="1.5707963"
sodipodi:arg1="0.52359878"
sodipodi:r2="1.9734807"
sodipodi:r1="3.9469614"
sodipodi:cy="7.6363635"
sodipodi:cx="33.727276"
sodipodi:sides="3"
id="path3043-3"
style="fill:#729fcf;fill-rule:evenodd;stroke:none"
sodipodi:type="star" />
<rect
transform="matrix(-0.0130695,0.99991459,-0.99991459,-0.0130695,0,0)"
y="-52.183987"
x="33.423866"
height="19.048214"
width="2.271805"
id="rect3039-3-1"
style="fill:#ef2929;fill-rule:evenodd;stroke:none" />
<path
inkscape:transform-center-x="-0.92685398"
inkscape:transform-center-y="-0.024790177"
d="m 37.145445,9.6098442 -3.418169,0 -3.418169,0 1.709084,-2.960221 1.709085,-2.9602211 1.709084,2.960221 z"
inkscape:randomized="0"
inkscape:rounded="0"
inkscape:flatsided="false"
sodipodi:arg2="1.5707963"
sodipodi:arg1="0.52359878"
sodipodi:r2="1.9734807"
sodipodi:r1="3.9469614"
sodipodi:cy="7.6363635"
sodipodi:cx="33.727276"
sodipodi:sides="3"
id="path3043-6-9"
style="fill:#ef2929;fill-rule:evenodd;stroke:none"
sodipodi:type="star"
transform="matrix(-0.01256173,0.96106627,-0.96106627,-0.01256173,59.490575,2.9206132)" />
<rect
transform="matrix(-0.48864025,-0.87248536,0.87248701,-0.4886373,0,0)"
y="-7.3576851"
x="-47.582092"
height="18.921833"
width="2.2567275"
id="rect3039-3-7-4"
style="fill:#8ae234;fill-rule:evenodd;stroke:none" />
<path
inkscape:transform-center-x="0.0233072"
inkscape:transform-center-y="-0.87140186"
d="m 37.145445,9.6098442 -3.418169,0 -3.418169,0 1.709084,-2.960221 1.709085,-2.9602211 1.709084,2.960221 z"
inkscape:randomized="0"
inkscape:rounded="0"
inkscape:flatsided="false"
sodipodi:arg2="1.5707963"
sodipodi:arg1="0.52359878"
sodipodi:r2="1.9734807"
sodipodi:r1="3.9469614"
sodipodi:cy="7.6363635"
sodipodi:cx="33.727276"
sodipodi:sides="3"
id="path3043-6-5-7"
style="fill:#8ae234;fill-rule:evenodd;stroke:none"
sodipodi:type="star"
transform="matrix(-0.44155795,-0.78841815,0.78842129,-0.4415562,26.06505,73.540728)" />
<path
transform="matrix(0.96114836,0,0,0.96114836,-1.6579462,-1.0968723)"
d="m 38.545456,37.590908 c 0,1.43092 -1.159989,2.590909 -2.590908,2.590909 -1.430919,0 -2.590908,-1.159989 -2.590908,-2.590909 0,-1.430919 1.159989,-2.590909 2.590908,-2.590909 1.430919,0 2.590908,1.15999 2.590908,2.590909 z"
sodipodi:ry="2.590909"
sodipodi:rx="2.5909083"
sodipodi:cy="37.590908"
sodipodi:cx="35.954548"
id="path4366-8"
style="fill:#fce94f;stroke:none"
sodipodi:type="arc" />
</g>
<path
style="fill:none;stroke:#729fcf;stroke-width:1.35052216;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:4.5;stroke-opacity:1;stroke-dashoffset:20.4"
d="m 45.949165,27.16698 c -1.350522,2.209945 -6.651139,3.560467 -14.855743,3.560467 -8.2046,0 -12.829961,-1.350522 -14.855743,-3.560467"
id="path2994-3-6-9"
inkscape:connector-curvature="0"
sodipodi:nodetypes="csc" />
<path
sodipodi:type="arc"
style="fill:none;stroke:#0b1521;stroke-width:1.75;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:4.5;stroke-opacity:1;stroke-dasharray:none;stroke-dashoffset:20.4"
id="path2994"
sodipodi:cx="-35"
sodipodi:cy="25"
sodipodi:rx="21"
sodipodi:ry="7"
d="m -14,25 a 21,7 0 1 1 -42,0 21,7 0 1 1 42,0 z"
transform="matrix(0.77172691,0,0,0.77172691,58.103864,4.6816635)" />
<rect
style="fill:#729fcf;stroke:none"
id="rect5584"
width="2.8052049"
height="2.1262856"
x="29.457829"
y="17.427979" />
</g>
</svg>

Before

Width:  |  Height:  |  Size: 11 KiB

View file

@ -1,181 +0,0 @@
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<!-- Created with Inkscape (http://www.inkscape.org/) -->
<svg
xmlns:dc="http://purl.org/dc/elements/1.1/"
xmlns:cc="http://creativecommons.org/ns#"
xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
xmlns:svg="http://www.w3.org/2000/svg"
xmlns="http://www.w3.org/2000/svg"
xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd"
xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape"
width="64px"
height="64px"
id="svg2985"
version="1.1"
inkscape:version="0.48.4 r9939"
sodipodi:docname="frameoncurve.svg">
<defs
id="defs2987">
<marker
inkscape:stockid="Arrow1Lstart"
orient="auto"
refY="0.0"
refX="0.0"
id="Arrow1Lstart"
style="overflow:visible">
<path
id="path3859"
d="M 0.0,0.0 L 5.0,-5.0 L -12.5,0.0 L 5.0,5.0 L 0.0,0.0 z "
style="fill-rule:evenodd;stroke:#000000;stroke-width:1.0pt"
transform="scale(0.8) translate(12.5,0)" />
</marker>
</defs>
<sodipodi:namedview
id="base"
pagecolor="#ffffff"
bordercolor="#666666"
borderopacity="1.0"
inkscape:pageopacity="0.0"
inkscape:pageshadow="2"
inkscape:zoom="5.5"
inkscape:cx="6.549462"
inkscape:cy="34.388895"
inkscape:current-layer="layer1"
showgrid="false"
inkscape:document-units="px"
inkscape:grid-bbox="true"
inkscape:snap-bbox="true"
inkscape:snap-bbox-midpoints="true"
inkscape:snap-page="false"
inkscape:snap-midpoints="true"
showguides="false"
inkscape:window-width="1266"
inkscape:window-height="783"
inkscape:window-x="65"
inkscape:window-y="24"
inkscape:window-maximized="0"
inkscape:snap-global="false">
<inkscape:grid
type="xygrid"
id="grid4310" />
</sodipodi:namedview>
<metadata
id="metadata2990">
<rdf:RDF>
<cc:Work
rdf:about="">
<dc:format>image/svg+xml</dc:format>
<dc:type
rdf:resource="http://purl.org/dc/dcmitype/StillImage" />
<dc:title></dc:title>
</cc:Work>
</rdf:RDF>
</metadata>
<g
id="layer1"
inkscape:label="Layer 1"
inkscape:groupmode="layer">
<path
style="fill:none;stroke:#000000;stroke-width:2.88424587;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-opacity:1;stroke-dasharray:none"
d="m 4.093678,33.130265 c 0,0 0.670134,7.648668 23.365889,8.028173 C 50.15532,41.537941 50.047635,35.119378 49.356598,25.394822 48.665561,15.670267 35.708619,9.9239398 35.708619,9.9239398"
id="path4811"
inkscape:connector-curvature="0" />
<g
id="g4792"
style="stroke-width:1.60000002;stroke-miterlimit:4;stroke-dasharray:none"
transform="matrix(1.3322492,0,0,1.4550733,-14.352489,-9.6872132)">
<path
style="fill:#729fcf;fill-rule:evenodd;stroke:#000000;stroke-width:2.34711409;stroke-linecap:round;stroke-miterlimit:4;stroke-opacity:1;stroke-dasharray:none"
d="m 32.679504,12.145359 -1.645803,2.84862 -1.645803,2.848621 2.164344,0 0,15.110077 c -0.652792,0.422664 -1.086869,1.135456 -1.127263,1.961007 l -12.219523,6.832562 -0.969446,-1.733943 -1.578167,2.662841 -1.578167,2.642199 3.088698,0.04128 3.088699,0.04128 -0.9469,-1.672017 12.039161,-6.749993 c 0.426007,0.340749 0.967678,0.536697 1.555622,0.536697 0.97078,0 1.798652,-0.551924 2.209435,-1.362384 l 14.6995,0.206422 -0.02255,2.146787 2.863246,-1.610091 2.863246,-1.61009 -2.818155,-1.672016 -2.818156,-1.692659 -0.02255,2.167429 -14.744591,-0.18578 c -0.276375,-0.539009 -0.738838,-0.954624 -1.307625,-1.176604 l 0,-14.883013 2.164344,0 -1.645803,-2.848621 -1.645803,-2.84862 z"
id="rect3039-1"
inkscape:connector-curvature="0" />
<rect
y="15.941667"
x="31.545361"
height="19.048214"
width="2.271805"
id="rect3039"
style="fill:#729fcf;fill-rule:evenodd;stroke:none" />
<path
transform="matrix(0.96114836,0,0,0.96114836,0.26435064,8.6019885)"
inkscape:transform-center-y="-0.94840389"
d="m 37.145445,9.6098442 -3.418169,0 -3.418169,0 1.709084,-2.960221 1.709085,-2.9602211 1.709084,2.960221 z"
inkscape:randomized="0"
inkscape:rounded="0"
inkscape:flatsided="false"
sodipodi:arg2="1.5707963"
sodipodi:arg1="0.52359878"
sodipodi:r2="1.9734807"
sodipodi:r1="3.9469614"
sodipodi:cy="7.6363635"
sodipodi:cx="33.727276"
sodipodi:sides="3"
id="path3043"
style="fill:#729fcf;fill-rule:evenodd;stroke:none"
sodipodi:type="star" />
<rect
transform="matrix(-0.0130695,0.99991459,-0.99991459,-0.0130695,0,0)"
y="-52.183987"
x="33.423866"
height="19.048214"
width="2.271805"
id="rect3039-3"
style="fill:#ef2929;fill-rule:evenodd;stroke:none" />
<path
inkscape:transform-center-x="-0.92685398"
inkscape:transform-center-y="-0.024790177"
d="m 37.145445,9.6098442 -3.418169,0 -3.418169,0 1.709084,-2.960221 1.709085,-2.9602211 1.709084,2.960221 z"
inkscape:randomized="0"
inkscape:rounded="0"
inkscape:flatsided="false"
sodipodi:arg2="1.5707963"
sodipodi:arg1="0.52359878"
sodipodi:r2="1.9734807"
sodipodi:r1="3.9469614"
sodipodi:cy="7.6363635"
sodipodi:cx="33.727276"
sodipodi:sides="3"
id="path3043-6"
style="fill:#ef2929;fill-rule:evenodd;stroke:none"
sodipodi:type="star"
transform="matrix(-0.01256173,0.96106627,-0.96106627,-0.01256173,59.490575,2.9206132)" />
<rect
transform="matrix(-0.48864025,-0.87248536,0.87248701,-0.4886373,0,0)"
y="-7.3576851"
x="-47.582092"
height="18.921833"
width="2.2567275"
id="rect3039-3-7"
style="fill:#8ae234;fill-rule:evenodd;stroke:none" />
<path
inkscape:transform-center-x="0.0233072"
inkscape:transform-center-y="-0.87140186"
d="m 37.145445,9.6098442 -3.418169,0 -3.418169,0 1.709084,-2.960221 1.709085,-2.9602211 1.709084,2.960221 z"
inkscape:randomized="0"
inkscape:rounded="0"
inkscape:flatsided="false"
sodipodi:arg2="1.5707963"
sodipodi:arg1="0.52359878"
sodipodi:r2="1.9734807"
sodipodi:r1="3.9469614"
sodipodi:cy="7.6363635"
sodipodi:cx="33.727276"
sodipodi:sides="3"
id="path3043-6-5"
style="fill:#8ae234;fill-rule:evenodd;stroke:none"
sodipodi:type="star"
transform="matrix(-0.44155795,-0.78841815,0.78842129,-0.4415562,26.06505,73.540728)" />
<path
transform="matrix(0.96114836,0,0,0.96114836,-1.6579462,-1.0968723)"
d="m 38.545456,37.590908 a 2.5909083,2.590909 0 1 1 -5.181816,0 2.5909083,2.590909 0 1 1 5.181816,0 z"
sodipodi:ry="2.590909"
sodipodi:rx="2.5909083"
sodipodi:cy="37.590908"
sodipodi:cx="35.954548"
id="path4366"
style="fill:#fce94f;stroke:none"
sodipodi:type="arc" />
</g>
</g>
</svg>

Before

Width:  |  Height:  |  Size: 7.1 KiB

View file

@ -1,44 +0,0 @@
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<!-- Created with Inkscape (http://www.inkscape.org/) -->
<svg xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:cc="http://creativecommons.org/ns#" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:svg="http://www.w3.org/2000/svg" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd" xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape" width="64px" height="64px" id="svg8779" version="1.1" inkscape:version="0.48.4 r9939" sodipodi:docname="frameonsurface.svg">
<defs id="defs8781">
<linearGradient inkscape:collect="always" xlink:href="#linearGradient3855" id="linearGradient3861" x1="38" y1="22" x2="49" y2="42" gradientUnits="userSpaceOnUse" spreadMethod="reflect" />
<linearGradient inkscape:collect="always" id="linearGradient3855">
<stop style="stop-color:#729fcf;stop-opacity:1" offset="0" id="stop3857" />
<stop style="stop-color:#204a87;stop-opacity:1" offset="1" id="stop3859" />
</linearGradient>
<linearGradient gradientTransform="translate(-0.54545473,3.1818182)" inkscape:collect="always" xlink:href="#linearGradient3845" id="linearGradient3851" x1="18" y1="43" x2="11" y2="24" gradientUnits="userSpaceOnUse" />
<linearGradient inkscape:collect="always" id="linearGradient3845">
<stop style="stop-color:#3465a4;stop-opacity:1;" offset="0" id="stop3847" />
<stop style="stop-color:#729fcf;stop-opacity:1" offset="1" id="stop3849" />
</linearGradient>
<linearGradient gradientTransform="translate(-0.54545473,3.1818182)" y2="42" x2="49" y1="22" x1="38" spreadMethod="reflect" gradientUnits="userSpaceOnUse" id="linearGradient9035" xlink:href="#linearGradient3855" inkscape:collect="always" />
</defs>
<sodipodi:namedview id="base" pagecolor="#ffffff" bordercolor="#666666" borderopacity="1.0" inkscape:pageopacity="0.0" inkscape:pageshadow="2" inkscape:zoom="5.5" inkscape:cx="32" inkscape:cy="32" inkscape:current-layer="layer1" showgrid="true" inkscape:document-units="px" inkscape:grid-bbox="true" inkscape:window-width="1016" inkscape:window-height="657" inkscape:window-x="65" inkscape:window-y="24" inkscape:window-maximized="0" />
<metadata id="metadata8784">
<rdf:RDF>
<cc:Work rdf:about="">
<dc:format>image/svg+xml</dc:format>
<dc:type rdf:resource="http://purl.org/dc/dcmitype/StillImage" />
<dc:title></dc:title>
</cc:Work>
</rdf:RDF>
</metadata>
<g id="layer1" inkscape:label="Layer 1" inkscape:groupmode="layer">
<path id="path3846-3" style="color:#000000;fill:url(#linearGradient9035);fill-opacity:1;fill-rule:evenodd;stroke:#0b1521;stroke-width:2;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:4;stroke-opacity:1;stroke-dasharray:none;stroke-dashoffset:0;marker:none;visibility:visible;display:inline;overflow:visible;enable-background:accumulate" d="m 2.4545453,24.181818 c 19.9999997,0 31.9999997,22 31.9999997,38 l 26,-20 c 0,-16 -12,-32 -26,-32 z" inkscape:connector-curvature="0" sodipodi:nodetypes="ccccc" />
<path id="path3852-7" style="color:#000000;fill:url(#linearGradient3851);fill-opacity:1;fill-rule:evenodd;stroke:#0b1521;stroke-width:2;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:4;stroke-opacity:1;stroke-dasharray:none;stroke-dashoffset:0;marker:none;visibility:visible;display:inline;overflow:visible;enable-background:accumulate" d="m 34.454545,62.181818 c 0,-16 -12,-38 -31.9999997,-38 l 4,14 c 7.9999997,0 13.9999997,8 13.9999997,18 z" inkscape:connector-curvature="0" sodipodi:nodetypes="ccccc" />
<path id="path3852-7-6" style="color:#000000;fill:none;stroke:#729fcf;stroke-width:2;stroke-linecap:round;stroke-linejoin:miter;stroke-miterlimit:4;stroke-opacity:1;stroke-dasharray:none;stroke-dashoffset:0;marker:none;visibility:visible;display:inline;overflow:visible;enable-background:accumulate" d="m 32.454545,59.181818 c 0,-12 -12.4,-33 -27.3999997,-33 l 2.9,10.1 c 5.4999997,-0.1 14.4999997,7.9 14.3999997,18.6 z" inkscape:connector-curvature="0" sodipodi:nodetypes="ccccc" />
<path style="fill:none;stroke:#729fcf;stroke-width:2;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1" d="m 9.4545453,23.181818 25.3999997,-11 c 12.6,0 22.6,13 23.6,29 l -22.3,17.2 c -0.7,-13.2 -11.7,-32.2 -26.6999997,-35.2 z" id="path3853" inkscape:connector-curvature="0" sodipodi:nodetypes="ccccc" />
<g id="g4792" style="stroke-width:1.60000002;stroke-miterlimit:4;stroke-dasharray:none" transform="matrix(0.6931302,0.14339095,-0.15661058,0.75703197,2.2598731,-8.4369758)">
<path style="fill:#729fcf;fill-rule:evenodd;stroke:#000000;stroke-width:2.34711409;stroke-linecap:round;stroke-miterlimit:4;stroke-opacity:1;stroke-dasharray:none" d="m 32.679504,12.145359 -1.645803,2.84862 -1.645803,2.848621 2.164344,0 0,15.110077 c -0.652792,0.422664 -1.086869,1.135456 -1.127263,1.961007 l -12.219523,6.832562 -0.969446,-1.733943 -1.578167,2.662841 -1.578167,2.642199 3.088698,0.04128 3.088699,0.04128 -0.9469,-1.672017 12.039161,-6.749993 c 0.426007,0.340749 0.967678,0.536697 1.555622,0.536697 0.97078,0 1.798652,-0.551924 2.209435,-1.362384 l 14.6995,0.206422 -0.02255,2.146787 2.863246,-1.610091 2.863246,-1.61009 -2.818155,-1.672016 -2.818156,-1.692659 -0.02255,2.167429 -14.744591,-0.18578 c -0.276375,-0.539009 -0.738838,-0.954624 -1.307625,-1.176604 l 0,-14.883013 2.164344,0 -1.645803,-2.848621 -1.645803,-2.84862 z" id="rect3039-1" inkscape:connector-curvature="0" />
<rect y="15.941667" x="31.545361" height="19.048214" width="2.271805" id="rect3039" style="fill:#729fcf;fill-rule:evenodd;stroke:none" />
<path transform="matrix(0.96114836,0,0,0.96114836,0.26435064,8.6019885)" inkscape:transform-center-y="-0.94840389" d="m 37.145445,9.6098442 -3.418169,0 -3.418169,0 1.709084,-2.960221 1.709085,-2.9602211 1.709084,2.960221 z" inkscape:randomized="0" inkscape:rounded="0" inkscape:flatsided="false" sodipodi:arg2="1.5707963" sodipodi:arg1="0.52359878" sodipodi:r2="1.9734807" sodipodi:r1="3.9469614" sodipodi:cy="7.6363635" sodipodi:cx="33.727276" sodipodi:sides="3" id="path3043" style="fill:#729fcf;fill-rule:evenodd;stroke:none" sodipodi:type="star" />
<rect transform="matrix(-0.0130695,0.99991459,-0.99991459,-0.0130695,0,0)" y="-52.183987" x="33.423866" height="19.048214" width="2.271805" id="rect3039-3" style="fill:#ef2929;fill-rule:evenodd;stroke:none" />
<path inkscape:transform-center-x="-0.92685398" inkscape:transform-center-y="-0.024790177" d="m 37.145445,9.6098442 -3.418169,0 -3.418169,0 1.709084,-2.960221 1.709085,-2.9602211 1.709084,2.960221 z" inkscape:randomized="0" inkscape:rounded="0" inkscape:flatsided="false" sodipodi:arg2="1.5707963" sodipodi:arg1="0.52359878" sodipodi:r2="1.9734807" sodipodi:r1="3.9469614" sodipodi:cy="7.6363635" sodipodi:cx="33.727276" sodipodi:sides="3" id="path3043-6" style="fill:#ef2929;fill-rule:evenodd;stroke:none" sodipodi:type="star" transform="matrix(-0.01256173,0.96106627,-0.96106627,-0.01256173,59.490575,2.9206132)" />
<rect transform="matrix(-0.48864025,-0.87248536,0.87248701,-0.4886373,0,0)" y="-7.3576851" x="-47.582092" height="18.921833" width="2.2567275" id="rect3039-3-7" style="fill:#8ae234;fill-rule:evenodd;stroke:none" />
<path inkscape:transform-center-x="0.0233072" inkscape:transform-center-y="-0.87140186" d="m 37.145445,9.6098442 -3.418169,0 -3.418169,0 1.709084,-2.960221 1.709085,-2.9602211 1.709084,2.960221 z" inkscape:randomized="0" inkscape:rounded="0" inkscape:flatsided="false" sodipodi:arg2="1.5707963" sodipodi:arg1="0.52359878" sodipodi:r2="1.9734807" sodipodi:r1="3.9469614" sodipodi:cy="7.6363635" sodipodi:cx="33.727276" sodipodi:sides="3" id="path3043-6-5" style="fill:#8ae234;fill-rule:evenodd;stroke:none" sodipodi:type="star" transform="matrix(-0.44155795,-0.78841815,0.78842129,-0.4415562,26.06505,73.540728)" />
<path transform="matrix(0.96114836,0,0,0.96114836,-1.6579462,-1.0968723)" d="m 38.545456,37.590908 c 0,1.43092 -1.159989,2.590909 -2.590908,2.590909 -1.430919,0 -2.590908,-1.159989 -2.590908,-2.590909 0,-1.430919 1.159989,-2.590909 2.590908,-2.590909 1.430919,0 2.590908,1.15999 2.590908,2.590909 z" sodipodi:ry="2.590909" sodipodi:rx="2.5909083" sodipodi:cy="37.590908" sodipodi:cx="35.954548" id="path4366" style="fill:#fce94f;stroke:none" sodipodi:type="arc" />
</g>
</g>
</svg>

Before

Width:  |  Height:  |  Size: 8.2 KiB

Some files were not shown because too many files have changed in this diff Show more