diff -Nru opencamlib-11.10+git201801200005~ubuntu16.04.1/CMakeLists.txt opencamlib-11.10-1/CMakeLists.txt
--- opencamlib-11.10+git201801200005~ubuntu16.04.1/CMakeLists.txt 2018-01-20 00:05:22.000000000 +0000
+++ opencamlib-11.10-1/CMakeLists.txt 2020-06-14 12:13:19.000000000 +0000
@@ -1,4 +1,5 @@
-cmake_minimum_required(VERSION 2.4)
+project(OpenCamLib)
+cmake_minimum_required(VERSION 3.9)
set( CMAKE_SOURCE_DIR ${CMAKE_SOURCE_DIR}/src )
add_subdirectory( src )
diff -Nru opencamlib-11.10+git201801200005~ubuntu16.04.1/COPYING opencamlib-11.10-1/COPYING
--- opencamlib-11.10+git201801200005~ubuntu16.04.1/COPYING 2018-01-20 00:05:22.000000000 +0000
+++ opencamlib-11.10-1/COPYING 2020-06-14 12:13:19.000000000 +0000
@@ -1,674 +1,502 @@
- GNU GENERAL PUBLIC LICENSE
- Version 3, 29 June 2007
+ GNU LESSER GENERAL PUBLIC LICENSE
+ Version 2.1, February 1999
- Copyright (C) 2007 Free Software Foundation, Inc.
+ 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.
- Preamble
+[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.]
- The GNU General Public License is a free, copyleft license for
-software and other kinds of works.
+ Preamble
- The licenses for most software and other practical works are designed
-to take away your freedom to share and change the works. By contrast,
-the GNU General Public License is intended to guarantee your freedom to
-share and change all versions of a program--to make sure it remains free
-software for all its users. We, the Free Software Foundation, use the
-GNU General Public License for most of our software; it applies also to
-any other work released this way by its authors. You can apply it to
-your programs, too.
-
- When we speak of free software, we are referring to freedom, 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
-them if you wish), that you receive source code or can get it if you
-want it, that you can change the software or use pieces of it in new
-free programs, and that you know you can do these things.
-
- To protect your rights, we need to prevent others from denying you
-these rights or asking you to surrender the rights. Therefore, you have
-certain responsibilities if you distribute copies of the software, or if
-you modify it: responsibilities to respect the freedom of others.
-
- For example, if you distribute copies of such a program, whether
-gratis or for a fee, you must pass on to the recipients the same
-freedoms that you received. You must make sure that they, too, receive
-or can get the source code. And you must show them these terms so they
-know their rights.
-
- Developers that use the GNU GPL protect your rights with two steps:
-(1) assert copyright on the software, and (2) offer you this License
-giving you legal permission to copy, distribute and/or modify it.
-
- For the developers' and authors' protection, the GPL clearly explains
-that there is no warranty for this free software. For both users' and
-authors' sake, the GPL requires that modified versions be marked as
-changed, so that their problems will not be attributed erroneously to
-authors of previous versions.
-
- Some devices are designed to deny users access to install or run
-modified versions of the software inside them, although the manufacturer
-can do so. This is fundamentally incompatible with the aim of
-protecting users' freedom to change the software. The systematic
-pattern of such abuse occurs in the area of products for individuals to
-use, which is precisely where it is most unacceptable. Therefore, we
-have designed this version of the GPL to prohibit the practice for those
-products. If such problems arise substantially in other domains, we
-stand ready to extend this provision to those domains in future versions
-of the GPL, as needed to protect the freedom of users.
-
- Finally, every program is threatened constantly by software patents.
-States should not allow patents to restrict development and use of
-software on general-purpose computers, but in those that do, we wish to
-avoid the special danger that patents applied to a free program could
-make it effectively proprietary. To prevent this, the GPL assures that
-patents cannot be used to render the program non-free.
+ 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.
-
- TERMS AND CONDITIONS
-
- 0. Definitions.
-
- "This License" refers to version 3 of the GNU General Public License.
-
- "Copyright" also means copyright-like laws that apply to other kinds of
-works, such as semiconductor masks.
-
- "The Program" refers to any copyrightable work licensed under this
-License. Each licensee is addressed as "you". "Licensees" and
-"recipients" may be individuals or organizations.
-
- To "modify" a work means to copy from or adapt all or part of the work
-in a fashion requiring copyright permission, other than the making of an
-exact copy. The resulting work is called a "modified version" of the
-earlier work or a work "based on" the earlier work.
-
- A "covered work" means either the unmodified Program or a work based
-on the Program.
-
- To "propagate" a work means to do anything with it that, without
-permission, would make you directly or secondarily liable for
-infringement under applicable copyright law, except executing it on a
-computer or modifying a private copy. Propagation includes copying,
-distribution (with or without modification), making available to the
-public, and in some countries other activities as well.
-
- To "convey" a work means any kind of propagation that enables other
-parties to make or receive copies. Mere interaction with a user through
-a computer network, with no transfer of a copy, is not conveying.
-
- An interactive user interface displays "Appropriate Legal Notices"
-to the extent that it includes a convenient and prominently visible
-feature that (1) displays an appropriate copyright notice, and (2)
-tells the user that there is no warranty for the work (except to the
-extent that warranties are provided), that licensees may convey the
-work under this License, and how to view a copy of this License. If
-the interface presents a list of user commands or options, such as a
-menu, a prominent item in the list meets this criterion.
-
- 1. Source Code.
-
- The "source code" for a work means the preferred form of the work
-for making modifications to it. "Object code" means any non-source
-form of a work.
-
- A "Standard Interface" means an interface that either is an official
-standard defined by a recognized standards body, or, in the case of
-interfaces specified for a particular programming language, one that
-is widely used among developers working in that language.
-
- The "System Libraries" of an executable work include anything, other
-than the work as a whole, that (a) is included in the normal form of
-packaging a Major Component, but which is not part of that Major
-Component, and (b) serves only to enable use of the work with that
-Major Component, or to implement a Standard Interface for which an
-implementation is available to the public in source code form. A
-"Major Component", in this context, means a major essential component
-(kernel, window system, and so on) of the specific operating system
-(if any) on which the executable work runs, or a compiler used to
-produce the work, or an object code interpreter used to run it.
-
- The "Corresponding Source" for a work in object code form means all
-the source code needed to generate, install, and (for an executable
-work) run the object code and to modify the work, including scripts to
-control those activities. However, it does not include the work's
-System Libraries, or general-purpose tools or generally available free
-programs which are used unmodified in performing those activities but
-which are not part of the work. For example, Corresponding Source
-includes interface definition files associated with source files for
-the work, and the source code for shared libraries and dynamically
-linked subprograms that the work is specifically designed to require,
-such as by intimate data communication or control flow between those
-subprograms and other parts of the work.
-
- The Corresponding Source need not include anything that users
-can regenerate automatically from other parts of the Corresponding
-Source.
-
- The Corresponding Source for a work in source code form is that
-same work.
-
- 2. Basic Permissions.
-
- All rights granted under this License are granted for the term of
-copyright on the Program, and are irrevocable provided the stated
-conditions are met. This License explicitly affirms your unlimited
-permission to run the unmodified Program. The output from running a
-covered work is covered by this License only if the output, given its
-content, constitutes a covered work. This License acknowledges your
-rights of fair use or other equivalent, as provided by copyright law.
-
- You may make, run and propagate covered works that you do not
-convey, without conditions so long as your license otherwise remains
-in force. You may convey covered works to others for the sole purpose
-of having them make modifications exclusively for you, or provide you
-with facilities for running those works, provided that you comply with
-the terms of this License in conveying all material for which you do
-not control copyright. Those thus making or running the covered works
-for you must do so exclusively on your behalf, under your direction
-and control, on terms that prohibit them from making any copies of
-your copyrighted material outside their relationship with you.
-
- Conveying under any other circumstances is permitted solely under
-the conditions stated below. Sublicensing is not allowed; section 10
-makes it unnecessary.
-
- 3. Protecting Users' Legal Rights From Anti-Circumvention Law.
-
- No covered work shall be deemed part of an effective technological
-measure under any applicable law fulfilling obligations under article
-11 of the WIPO copyright treaty adopted on 20 December 1996, or
-similar laws prohibiting or restricting circumvention of such
-measures.
-
- When you convey a covered work, you waive any legal power to forbid
-circumvention of technological measures to the extent such circumvention
-is effected by exercising rights under this License with respect to
-the covered work, and you disclaim any intention to limit operation or
-modification of the work as a means of enforcing, against the work's
-users, your or third parties' legal rights to forbid circumvention of
-technological measures.
-
- 4. Conveying Verbatim Copies.
-
- You may convey verbatim copies of the Program's source code as you
-receive it, in any medium, provided that you conspicuously and
-appropriately publish on each copy an appropriate copyright notice;
-keep intact all notices stating that this License and any
-non-permissive terms added in accord with section 7 apply to the code;
-keep intact all notices of the absence of any warranty; and give all
-recipients a copy of this License along with the Program.
-
- You may charge any price or no price for each copy that you convey,
-and you may offer support or warranty protection for a fee.
-
- 5. Conveying Modified Source Versions.
-
- You may convey a work based on the Program, or the modifications to
-produce it from the Program, in the form of source code under the
-terms of section 4, provided that you also meet all of these conditions:
-
- a) The work must carry prominent notices stating that you modified
- it, and giving a relevant date.
-
- b) The work must carry prominent notices stating that it is
- released under this License and any conditions added under section
- 7. This requirement modifies the requirement in section 4 to
- "keep intact all notices".
-
- c) You must license the entire work, as a whole, under this
- License to anyone who comes into possession of a copy. This
- License will therefore apply, along with any applicable section 7
- additional terms, to the whole of the work, and all its parts,
- regardless of how they are packaged. This License gives no
- permission to license the work in any other way, but it does not
- invalidate such permission if you have separately received it.
-
- d) If the work has interactive user interfaces, each must display
- Appropriate Legal Notices; however, if the Program has interactive
- interfaces that do not display Appropriate Legal Notices, your
- work need not make them do so.
-
- A compilation of a covered work with other separate and independent
-works, which are not by their nature extensions of the covered work,
-and which are not combined with it such as to form a larger program,
-in or on a volume of a storage or distribution medium, is called an
-"aggregate" if the compilation and its resulting copyright are not
-used to limit the access or legal rights of the compilation's users
-beyond what the individual works permit. Inclusion of a covered work
-in an aggregate does not cause this License to apply to the other
-parts of the aggregate.
-
- 6. Conveying Non-Source Forms.
-
- You may convey a covered work in object code form under the terms
-of sections 4 and 5, provided that you also convey the
-machine-readable Corresponding Source under the terms of this License,
-in one of these ways:
-
- a) Convey the object code in, or embodied in, a physical product
- (including a physical distribution medium), accompanied by the
- Corresponding Source fixed on a durable physical medium
- customarily used for software interchange.
-
- b) Convey the object code in, or embodied in, a physical product
- (including a physical distribution medium), accompanied by a
- written offer, valid for at least three years and valid for as
- long as you offer spare parts or customer support for that product
- model, to give anyone who possesses the object code either (1) a
- copy of the Corresponding Source for all the software in the
- product that is covered by this License, on a durable physical
- medium customarily used for software interchange, for a price no
- more than your reasonable cost of physically performing this
- conveying of source, or (2) access to copy the
- Corresponding Source from a network server at no charge.
-
- c) Convey individual copies of the object code with a copy of the
- written offer to provide the Corresponding Source. This
- alternative is allowed only occasionally and noncommercially, and
- only if you received the object code with such an offer, in accord
- with subsection 6b.
-
- d) Convey the object code by offering access from a designated
- place (gratis or for a charge), and offer equivalent access to the
- Corresponding Source in the same way through the same place at no
- further charge. You need not require recipients to copy the
- Corresponding Source along with the object code. If the place to
- copy the object code is a network server, the Corresponding Source
- may be on a different server (operated by you or a third party)
- that supports equivalent copying facilities, provided you maintain
- clear directions next to the object code saying where to find the
- Corresponding Source. Regardless of what server hosts the
- Corresponding Source, you remain obligated to ensure that it is
- available for as long as needed to satisfy these requirements.
-
- e) Convey the object code using peer-to-peer transmission, provided
- you inform other peers where the object code and Corresponding
- Source of the work are being offered to the general public at no
- charge under subsection 6d.
-
- A separable portion of the object code, whose source code is excluded
-from the Corresponding Source as a System Library, need not be
-included in conveying the object code work.
-
- A "User Product" is either (1) a "consumer product", which means any
-tangible personal property which is normally used for personal, family,
-or household purposes, or (2) anything designed or sold for incorporation
-into a dwelling. In determining whether a product is a consumer product,
-doubtful cases shall be resolved in favor of coverage. For a particular
-product received by a particular user, "normally used" refers to a
-typical or common use of that class of product, regardless of the status
-of the particular user or of the way in which the particular user
-actually uses, or expects or is expected to use, the product. A product
-is a consumer product regardless of whether the product has substantial
-commercial, industrial or non-consumer uses, unless such uses represent
-the only significant mode of use of the product.
-
- "Installation Information" for a User Product means any methods,
-procedures, authorization keys, or other information required to install
-and execute modified versions of a covered work in that User Product from
-a modified version of its Corresponding Source. The information must
-suffice to ensure that the continued functioning of the modified object
-code is in no case prevented or interfered with solely because
-modification has been made.
-
- If you convey an object code work under this section in, or with, or
-specifically for use in, a User Product, and the conveying occurs as
-part of a transaction in which the right of possession and use of the
-User Product is transferred to the recipient in perpetuity or for a
-fixed term (regardless of how the transaction is characterized), the
-Corresponding Source conveyed under this section must be accompanied
-by the Installation Information. But this requirement does not apply
-if neither you nor any third party retains the ability to install
-modified object code on the User Product (for example, the work has
-been installed in ROM).
-
- The requirement to provide Installation Information does not include a
-requirement to continue to provide support service, warranty, or updates
-for a work that has been modified or installed by the recipient, or for
-the User Product in which it has been modified or installed. Access to a
-network may be denied when the modification itself materially and
-adversely affects the operation of the network or violates the rules and
-protocols for communication across the network.
-
- Corresponding Source conveyed, and Installation Information provided,
-in accord with this section must be in a format that is publicly
-documented (and with an implementation available to the public in
-source code form), and must require no special password or key for
-unpacking, reading or copying.
-
- 7. Additional Terms.
-
- "Additional permissions" are terms that supplement the terms of this
-License by making exceptions from one or more of its conditions.
-Additional permissions that are applicable to the entire Program shall
-be treated as though they were included in this License, to the extent
-that they are valid under applicable law. If additional permissions
-apply only to part of the Program, that part may be used separately
-under those permissions, but the entire Program remains governed by
-this License without regard to the additional permissions.
-
- When you convey a copy of a covered work, you may at your option
-remove any additional permissions from that copy, or from any part of
-it. (Additional permissions may be written to require their own
-removal in certain cases when you modify the work.) You may place
-additional permissions on material, added by you to a covered work,
-for which you have or can give appropriate copyright permission.
-
- Notwithstanding any other provision of this License, for material you
-add to a covered work, you may (if authorized by the copyright holders of
-that material) supplement the terms of this License with terms:
-
- a) Disclaiming warranty or limiting liability differently from the
- terms of sections 15 and 16 of this License; or
-
- b) Requiring preservation of specified reasonable legal notices or
- author attributions in that material or in the Appropriate Legal
- Notices displayed by works containing it; or
-
- c) Prohibiting misrepresentation of the origin of that material, or
- requiring that modified versions of such material be marked in
- reasonable ways as different from the original version; or
-
- d) Limiting the use for publicity purposes of names of licensors or
- authors of the material; or
-
- e) Declining to grant rights under trademark law for use of some
- trade names, trademarks, or service marks; or
-
- f) Requiring indemnification of licensors and authors of that
- material by anyone who conveys the material (or modified versions of
- it) with contractual assumptions of liability to the recipient, for
- any liability that these contractual assumptions directly impose on
- those licensors and authors.
-
- All other non-permissive additional terms are considered "further
-restrictions" within the meaning of section 10. If the Program as you
-received it, or any part of it, contains a notice stating that it is
-governed by this License along with a term that is a further
-restriction, you may remove that term. If a license document contains
-a further restriction but permits relicensing or conveying under this
-License, you may add to a covered work material governed by the terms
-of that license document, provided that the further restriction does
-not survive such relicensing or conveying.
-
- If you add terms to a covered work in accord with this section, you
-must place, in the relevant source files, a statement of the
-additional terms that apply to those files, or a notice indicating
-where to find the applicable terms.
-
- Additional terms, permissive or non-permissive, may be stated in the
-form of a separately written license, or stated as exceptions;
-the above requirements apply either way.
-
- 8. Termination.
-
- You may not propagate or modify a covered work except as expressly
-provided under this License. Any attempt otherwise to propagate or
-modify it is void, and will automatically terminate your rights under
-this License (including any patent licenses granted under the third
-paragraph of section 11).
-
- However, if you cease all violation of this License, then your
-license from a particular copyright holder is reinstated (a)
-provisionally, unless and until the copyright holder explicitly and
-finally terminates your license, and (b) permanently, if the copyright
-holder fails to notify you of the violation by some reasonable means
-prior to 60 days after the cessation.
-
- Moreover, your license from a particular copyright holder is
-reinstated permanently if the copyright holder notifies you of the
-violation by some reasonable means, this is the first time you have
-received notice of violation of this License (for any work) from that
-copyright holder, and you cure the violation prior to 30 days after
-your receipt of the notice.
-
- Termination of your rights under this section does not terminate the
-licenses of parties who have received copies or rights from you under
-this License. If your rights have been terminated and not permanently
-reinstated, you do not qualify to receive new licenses for the same
-material under section 10.
-
- 9. Acceptance Not Required for Having Copies.
-
- You are not required to accept this License in order to receive or
-run a copy of the Program. Ancillary propagation of a covered work
-occurring solely as a consequence of using peer-to-peer transmission
-to receive a copy likewise does not require acceptance. However,
-nothing other than this License grants you permission to propagate or
-modify any covered work. These actions infringe copyright if you do
-not accept this License. Therefore, by modifying or propagating a
-covered work, you indicate your acceptance of this License to do so.
-
- 10. Automatic Licensing of Downstream Recipients.
-
- Each time you convey a covered work, the recipient automatically
-receives a license from the original licensors, to run, modify and
-propagate that work, subject to this License. You are not responsible
-for enforcing compliance by third parties with this License.
-
- An "entity transaction" is a transaction transferring control of an
-organization, or substantially all assets of one, or subdividing an
-organization, or merging organizations. If propagation of a covered
-work results from an entity transaction, each party to that
-transaction who receives a copy of the work also receives whatever
-licenses to the work the party's predecessor in interest had or could
-give under the previous paragraph, plus a right to possession of the
-Corresponding Source of the work from the predecessor in interest, if
-the predecessor has it or can get it with reasonable efforts.
-
- You may not impose any further restrictions on the exercise of the
-rights granted or affirmed under this License. For example, you may
-not impose a license fee, royalty, or other charge for exercise of
-rights granted under this License, and you may not initiate litigation
-(including a cross-claim or counterclaim in a lawsuit) alleging that
-any patent claim is infringed by making, using, selling, offering for
-sale, or importing the Program or any portion of it.
-
- 11. Patents.
-
- A "contributor" is a copyright holder who authorizes use under this
-License of the Program or a work on which the Program is based. The
-work thus licensed is called the contributor's "contributor version".
-
- A contributor's "essential patent claims" are all patent claims
-owned or controlled by the contributor, whether already acquired or
-hereafter acquired, that would be infringed by some manner, permitted
-by this License, of making, using, or selling its contributor version,
-but do not include claims that would be infringed only as a
-consequence of further modification of the contributor version. For
-purposes of this definition, "control" includes the right to grant
-patent sublicenses in a manner consistent with the requirements of
+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.
-
- Each contributor grants you a non-exclusive, worldwide, royalty-free
-patent license under the contributor's essential patent claims, to
-make, use, sell, offer for sale, import and otherwise run, modify and
-propagate the contents of its contributor version.
-
- In the following three paragraphs, a "patent license" is any express
-agreement or commitment, however denominated, not to enforce a patent
-(such as an express permission to practice a patent or covenant not to
-sue for patent infringement). To "grant" such a patent license to a
-party means to make such an agreement or commitment not to enforce a
-patent against the party.
-
- If you convey a covered work, knowingly relying on a patent license,
-and the Corresponding Source of the work is not available for anyone
-to copy, free of charge and under the terms of this License, through a
-publicly available network server or other readily accessible means,
-then you must either (1) cause the Corresponding Source to be so
-available, or (2) arrange to deprive yourself of the benefit of the
-patent license for this particular work, or (3) arrange, in a manner
-consistent with the requirements of this License, to extend the patent
-license to downstream recipients. "Knowingly relying" means you have
-actual knowledge that, but for the patent license, your conveying the
-covered work in a country, or your recipient's use of the covered work
-in a country, would infringe one or more identifiable patents in that
-country that you have reason to believe are valid.
-
- If, pursuant to or in connection with a single transaction or
-arrangement, you convey, or propagate by procuring conveyance of, a
-covered work, and grant a patent license to some of the parties
-receiving the covered work authorizing them to use, propagate, modify
-or convey a specific copy of the covered work, then the patent license
-you grant is automatically extended to all recipients of the covered
-work and works based on it.
-
- A patent license is "discriminatory" if it does not include within
-the scope of its coverage, prohibits the exercise of, or is
-conditioned on the non-exercise of one or more of the rights that are
-specifically granted under this License. You may not convey a covered
-work if you are a party to an arrangement with a third party that is
-in the business of distributing software, under which you make payment
-to the third party based on the extent of your activity of conveying
-the work, and under which the third party grants, to any of the
-parties who would receive the covered work from you, a discriminatory
-patent license (a) in connection with copies of the covered work
-conveyed by you (or copies made from those copies), or (b) primarily
-for and in connection with specific products or compilations that
-contain the covered work, unless you entered into that arrangement,
-or that patent license was granted, prior to 28 March 2007.
-
- Nothing in this License shall be construed as excluding or limiting
-any implied license or other defenses to infringement that may
-otherwise be available to you under applicable patent law.
-
- 12. No Surrender of Others' Freedom.
-
- If conditions are imposed on you (whether by court order, agreement or
+
+ 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 convey a
-covered work so as to satisfy simultaneously your obligations under this
-License and any other pertinent obligations, then as a consequence you may
-not convey it at all. For example, if you agree to terms that obligate you
-to collect a royalty for further conveying from those to whom you convey
-the Program, the only way you could satisfy both those terms and this
-License would be to refrain entirely from conveying the Program.
-
- 13. Use with the GNU Affero General Public License.
-
- Notwithstanding any other provision of this License, you have
-permission to link or combine any covered work with a work licensed
-under version 3 of the GNU Affero General Public License into a single
-combined work, and to convey the resulting work. The terms of this
-License will continue to apply to the part which is the covered work,
-but the special requirements of the GNU Affero General Public License,
-section 13, concerning interaction through a network will apply to the
-combination as such.
-
- 14. Revised Versions of this License.
-
- The Free Software Foundation may publish revised and/or new versions of
-the GNU 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
-Program specifies that a certain numbered version of the GNU General
-Public License "or any later version" applies to it, you have the
-option of following the terms and conditions either of that numbered
-version or of any later version published by the Free Software
-Foundation. If the Program does not specify a version number of the
-GNU General Public License, you may choose any version ever published
-by the Free Software Foundation.
-
- If the Program specifies that a proxy can decide which future
-versions of the GNU General Public License can be used, that proxy's
-public statement of acceptance of a version permanently authorizes you
-to choose that version for the Program.
-
- Later license versions may give you additional or different
-permissions. However, no additional obligations are imposed on any
-author or copyright holder as a result of your choosing to follow a
-later version.
-
- 15. Disclaimer of Warranty.
-
- THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY
-APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT
-HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM "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 PROGRAM
-IS WITH YOU. SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF
-ALL NECESSARY SERVICING, REPAIR OR CORRECTION.
-
- 16. Limitation of Liability.
-
- IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING
-WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MODIFIES AND/OR CONVEYS
-THE PROGRAM 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 PROGRAM (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 PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS),
-EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF
-SUCH DAMAGES.
-
- 17. Interpretation of Sections 15 and 16.
-
- If the disclaimer of warranty and limitation of liability provided
-above cannot be given local legal effect according to their terms,
-reviewing courts shall apply local law that most closely approximates
-an absolute waiver of all civil liability in connection with the
-Program, unless a warranty or assumption of liability accompanies a
-copy of the Program in return for a fee.
+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
- How to Apply These Terms to Your New Programs
+ 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.
- If you develop a new program, and you want it to be of the greatest
-possible use to the public, the best way to achieve this is to make it
-free software which everyone can redistribute and change under these terms.
-
- To do so, attach the following notices to the program. It is safest
-to attach them to the start of each source file to most effectively
-state the exclusion of warranty; and each file should have at least
-the "copyright" line and a pointer to where the full notice is found.
-
-
+
Copyright (C)
- This program is free software: you can redistribute it and/or modify
- it under the terms of the GNU General Public License as published by
- the Free Software Foundation, either version 3 of the License, or
- (at your option) any later version.
+ 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 program is distributed in the hope that it will be useful,
+ 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 General Public License for more details.
+ 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 General Public License
- along with this program. If not, see .
+ 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.
- If the program does terminal interaction, make it output a short
-notice like this when it starts in an interactive mode:
+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.
+
+ , 1 April 1990
+ Ty Coon, President of Vice
- Copyright (C)
- This program comes with ABSOLUTELY NO WARRANTY; for details type `show w'.
- This is free software, and you are welcome to redistribute it
- under certain conditions; type `show c' for details.
-
-The hypothetical commands `show w' and `show c' should show the appropriate
-parts of the General Public License. Of course, your program's commands
-might be different; for a GUI interface, you would use an "about box".
-
- You should also get your employer (if you work as a programmer) or school,
-if any, to sign a "copyright disclaimer" for the program, if necessary.
-For more information on this, and how to apply and follow the GNU GPL, see
-.
-
- The GNU General Public License does not permit incorporating your program
-into proprietary programs. If your program is a subroutine library, you
-may consider it more useful to permit linking proprietary applications with
-the library. If this is what you want to do, use the GNU Lesser General
-Public License instead of this License. But first, please read
-.
+That's all there is to it!
diff -Nru opencamlib-11.10+git201801200005~ubuntu16.04.1/cpp_examples/point/CMakeLists.txt opencamlib-11.10-1/cpp_examples/point/CMakeLists.txt
--- opencamlib-11.10+git201801200005~ubuntu16.04.1/cpp_examples/point/CMakeLists.txt 2018-01-20 00:05:22.000000000 +0000
+++ opencamlib-11.10-1/cpp_examples/point/CMakeLists.txt 1970-01-01 00:00:00.000000000 +0000
@@ -1,42 +0,0 @@
-project(OCL_POINT_EXAMPLE)
-
-cmake_minimum_required(VERSION 2.4)
-
-if (CMAKE_BUILD_TOOL MATCHES "make")
- add_definitions(-Wall -Werror -Wno-deprecated -pedantic-errors)
-endif (CMAKE_BUILD_TOOL MATCHES "make")
-
-# find BOOST and boost-python
-find_package( Boost )
-if(Boost_FOUND)
- include_directories(${Boost_INCLUDE_DIRS})
- MESSAGE(STATUS "found Boost: " ${Boost_LIB_VERSION})
- MESSAGE(STATUS "boost-incude dirs are: " ${Boost_INCLUDE_DIRS})
-endif()
-
-find_package( OpenMP REQUIRED )
-IF (OPENMP_FOUND)
- MESSAGE(STATUS "found OpenMP, compiling with flags: " ${OpenMP_CXX_FLAGS} )
- set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${OpenMP_CXX_FLAGS}")
-ENDIF(OPENMP_FOUND)
-
-find_library(OCL_LIBRARY
- NAMES ocl
- PATHS /usr/local/lib/opencamlib
- DOC "The opencamlib library"
-)
-#find_package(ocl REQUIRED)
-MESSAGE(STATUS "OCL_LIBRARY is now: " ${OCL_LIBRARY})
-
-
-set(OCL_TST_SRC
- ${OCL_POINT_EXAMPLE_SOURCE_DIR}/point_example.cpp
-)
-
-add_executable(
- point_example
- ${OCL_TST_SRC}
-)
-target_link_libraries(point_example ${OCL_LIBRARY} ${Boost_LIBRARIES})
-
-
diff -Nru opencamlib-11.10+git201801200005~ubuntu16.04.1/cpp_examples/point/point_example.cpp opencamlib-11.10-1/cpp_examples/point/point_example.cpp
--- opencamlib-11.10+git201801200005~ubuntu16.04.1/cpp_examples/point/point_example.cpp 2018-01-20 00:05:22.000000000 +0000
+++ opencamlib-11.10-1/cpp_examples/point/point_example.cpp 1970-01-01 00:00:00.000000000 +0000
@@ -1,37 +0,0 @@
-
-#include
-#include
-#include
-
-#include
-#include
-
-int main() {
- std::cout << ocl::revision() << "\n";
- ocl::Point p1;
- p1.x = 1.2;
- p1.y = sqrt(p1.x);
- p1.z = p1.x + p1.y;
- std::cout << "p1=" << p1 << "\n";
- ocl::Point p2(1.23,4.56,3.219);
- std::cout << "p2=" << p2 << "\n";
-
- std::cout << "addition:\n";
- std::cout << " " << p1 << " + " << p2 << " = " << p1+p2 << "\n";
- std::cout << "subtraction:\n";
- std::cout << " " << p1 << " - " << p2 << " = " << p1-p2 << "\n";
- std::cout << "dot product:\n";
- std::cout << " " << p1 << " dot " << p2 << " = " << p1.dot(p2) << "\n";
- std::cout << "cross product:\n";
- std::cout << " " << p1 << " cross " << p2 << " = " << p1.cross(p2) << "\n";
- std::cout << "scalar multiplication:\n";
- std::cout << " " << p1 << " * 0.1 = " << 0.1*p1 << "\n";
- std::cout << "norm:\n";
- std::cout << " norm( " << p1 << " ) = " << p1.norm() << "\n";
- std::cout << "normalize:\n";
- ocl::Point p3 = p1;
- p3.normalize();
- std::cout << " " << p1 << ".normalize() = " << p3 << " norm=" << p3.norm() << "\n";
-
- return 0;
-}
diff -Nru opencamlib-11.10+git201801200005~ubuntu16.04.1/cpp_examples/qt_vtk_renderwindow/CMakeLists.txt opencamlib-11.10-1/cpp_examples/qt_vtk_renderwindow/CMakeLists.txt
--- opencamlib-11.10+git201801200005~ubuntu16.04.1/cpp_examples/qt_vtk_renderwindow/CMakeLists.txt 2018-01-20 00:05:22.000000000 +0000
+++ opencamlib-11.10-1/cpp_examples/qt_vtk_renderwindow/CMakeLists.txt 1970-01-01 00:00:00.000000000 +0000
@@ -1,14 +0,0 @@
-cmake_minimum_required(VERSION 2.6)
-
-PROJECT(RenderWindow)
-
-FIND_PACKAGE(VTK REQUIRED)
-INCLUDE(${VTK_USE_FILE})
-MESSAGE(STATUS "VTK_USE_FILE = " ${VTK_USE_FILE} )
-
-FIND_PACKAGE(Qt4 REQUIRED)
-INCLUDE(${QT_USE_FILE})
- MESSAGE(STATUS "QT_USE_FILE = " ${QT_USE_FILE} )
-
-ADD_EXECUTABLE(RenderWindow RenderWindow.cpp)
-TARGET_LINK_LIBRARIES(RenderWindow QVTK vtkHybrid)
diff -Nru opencamlib-11.10+git201801200005~ubuntu16.04.1/cpp_examples/qt_vtk_renderwindow/RenderWindow.cpp opencamlib-11.10-1/cpp_examples/qt_vtk_renderwindow/RenderWindow.cpp
--- opencamlib-11.10+git201801200005~ubuntu16.04.1/cpp_examples/qt_vtk_renderwindow/RenderWindow.cpp 2018-01-20 00:05:22.000000000 +0000
+++ opencamlib-11.10-1/cpp_examples/qt_vtk_renderwindow/RenderWindow.cpp 1970-01-01 00:00:00.000000000 +0000
@@ -1,51 +0,0 @@
-#include
-
-#include
-#include
-#include
-#include
-#include
-#include
-#include
-#include
-#include
-
-#include
-
-int main(int argc, char** argv)
-{
- QApplication app(argc, argv);
-
- QVTKWidget widget;
- widget.resize(512,256);
-
- //setup sphere
- vtkSmartPointer sphereSource =
- vtkSmartPointer::New();
- sphereSource->Update();
- vtkSmartPointer sphereMapper =
- vtkSmartPointer::New();
- sphereMapper->SetInputConnection(sphereSource->GetOutputPort());
- vtkSmartPointer sphereActor =
- vtkSmartPointer::New();
- sphereActor->SetMapper(sphereMapper);
-
- //setup window
- vtkSmartPointer renderWindow =
- vtkSmartPointer::New();
-
- //setup renderer
- vtkSmartPointer renderer =
- vtkSmartPointer::New();
- renderWindow->AddRenderer(renderer);
-
- renderer->AddActor(sphereActor);
- renderer->ResetCamera();
-
- widget.SetRenderWindow(renderWindow);
- widget.show();
-
- app.exec();
-
- return EXIT_SUCCESS;
-}
diff -Nru opencamlib-11.10+git201801200005~ubuntu16.04.1/cpp_examples/renderwindowUI/CMakeLists.txt opencamlib-11.10-1/cpp_examples/renderwindowUI/CMakeLists.txt
--- opencamlib-11.10+git201801200005~ubuntu16.04.1/cpp_examples/renderwindowUI/CMakeLists.txt 2018-01-20 00:05:22.000000000 +0000
+++ opencamlib-11.10-1/cpp_examples/renderwindowUI/CMakeLists.txt 1970-01-01 00:00:00.000000000 +0000
@@ -1,36 +0,0 @@
-cmake_minimum_required(VERSION 2.8)
-
-PROJECT(RenderWindowUI)
-
-FIND_PACKAGE(VTK)
-INCLUDE(${VTK_USE_FILE}) # include UseVTK.cmake
-
-FIND_PACKAGE(Qt4 REQUIRED)
-INCLUDE(${QT_USE_FILE}) # include UseQt4.cmake
-
-# support for out-of-source build
-INCLUDE_DIRECTORIES(
- ${CMAKE_CURRENT_BINARY_DIR} #this is where ui_SimpleViewUI.h is generated
- ${CMAKE_CURRENT_SOURCE_DIR}
-)
-
-# Set your files and resources here
-SET(SimpleViewSrcs RenderWindowUI.cxx SimpleViewUI.cxx)
-SET(SimpleViewUI SimpleViewUI.ui)
-SET(SimpleViewHeaders SimpleViewUI.h)
-
-QT4_WRAP_UI(UISrcs ${SimpleViewUI})
-QT4_WRAP_CPP(MOCSrcs ${SimpleViewHeaders} )
-
-SOURCE_GROUP("Resources" FILES
- ${SimpleViewUI}
-)
-
-SOURCE_GROUP("Generated" FILES
- ${UISrcs}
- ${MOCSrcs}
-)
-
-ADD_EXECUTABLE( RenderWindowUI ${SimpleViewSrcs} ${UISrcs} ${MOCSrcs})
-TARGET_LINK_LIBRARIES( RenderWindowUI QVTK )
-
diff -Nru opencamlib-11.10+git201801200005~ubuntu16.04.1/cpp_examples/renderwindowUI/RenderWindowUI.cxx opencamlib-11.10-1/cpp_examples/renderwindowUI/RenderWindowUI.cxx
--- opencamlib-11.10+git201801200005~ubuntu16.04.1/cpp_examples/renderwindowUI/RenderWindowUI.cxx 2018-01-20 00:05:22.000000000 +0000
+++ opencamlib-11.10-1/cpp_examples/renderwindowUI/RenderWindowUI.cxx 1970-01-01 00:00:00.000000000 +0000
@@ -1,11 +0,0 @@
-#include
-#include "SimpleViewUI.h"
-
-int main( int argc, char** argv )
-{
- QApplication app( argc, argv );
- SimpleView mySimpleView;
- mySimpleView.show();
- return app.exec();
-}
-
diff -Nru opencamlib-11.10+git201801200005~ubuntu16.04.1/cpp_examples/renderwindowUI/SimpleViewUI.cxx opencamlib-11.10-1/cpp_examples/renderwindowUI/SimpleViewUI.cxx
--- opencamlib-11.10+git201801200005~ubuntu16.04.1/cpp_examples/renderwindowUI/SimpleViewUI.cxx 2018-01-20 00:05:22.000000000 +0000
+++ opencamlib-11.10-1/cpp_examples/renderwindowUI/SimpleViewUI.cxx 1970-01-01 00:00:00.000000000 +0000
@@ -1,39 +0,0 @@
-#include "ui_SimpleViewUI.h"
-#include "SimpleViewUI.h"
-
-#include
-#include
-#include
-#include
-#include
-
-#include "vtkSmartPointer.h"
-
-// Constructor
-SimpleView::SimpleView() {
- this->ui = new Ui_SimpleView;
- this->ui->setupUi(this);
-
- // sphere
- vtkSmartPointer sphereSource = vtkSmartPointer::New();
- sphereSource->Update();
- vtkSmartPointer sphereMapper = vtkSmartPointer::New();
- sphereMapper->SetInputConnection(sphereSource->GetOutputPort());
- vtkSmartPointer sphereActor = vtkSmartPointer::New();
- sphereActor->SetMapper(sphereMapper);
-
- // VTK Renderer
- vtkSmartPointer renderer = vtkSmartPointer::New();
- renderer->AddActor(sphereActor);
-
- // VTK/Qt wedded
- this->ui->qvtkWidget->GetRenderWindow()->AddRenderer(renderer);
-
- // Set up action signals and slots
- connect(this->ui->actionExit, SIGNAL(triggered()), this, SLOT(slotExit()));
-
-};
-
-void SimpleView::slotExit() {
- qApp->exit();
-}
diff -Nru opencamlib-11.10+git201801200005~ubuntu16.04.1/cpp_examples/renderwindowUI/SimpleViewUI.h opencamlib-11.10-1/cpp_examples/renderwindowUI/SimpleViewUI.h
--- opencamlib-11.10+git201801200005~ubuntu16.04.1/cpp_examples/renderwindowUI/SimpleViewUI.h 2018-01-20 00:05:22.000000000 +0000
+++ opencamlib-11.10-1/cpp_examples/renderwindowUI/SimpleViewUI.h 1970-01-01 00:00:00.000000000 +0000
@@ -1,25 +0,0 @@
-#ifndef SimpleViewUI_H
-#define SimpleViewUI_H
-
-#include "vtkSmartPointer.h"
-#include
-
-// Forward Qt class declarations
-class Ui_SimpleView;
-
-class SimpleView : public QMainWindow
-{
- Q_OBJECT
- public:
- SimpleView();
- ~SimpleView() {};
-
- public slots:
- virtual void slotExit();
- protected:
- protected slots:
- private:
- Ui_SimpleView *ui;
-};
-
-#endif // SimpleViewUI_H
diff -Nru opencamlib-11.10+git201801200005~ubuntu16.04.1/cpp_examples/renderwindowUI/SimpleViewUI.ui opencamlib-11.10-1/cpp_examples/renderwindowUI/SimpleViewUI.ui
--- opencamlib-11.10+git201801200005~ubuntu16.04.1/cpp_examples/renderwindowUI/SimpleViewUI.ui 2018-01-20 00:05:22.000000000 +0000
+++ opencamlib-11.10-1/cpp_examples/renderwindowUI/SimpleViewUI.ui 1970-01-01 00:00:00.000000000 +0000
@@ -1,108 +0,0 @@
-
-
- SimpleView
-
-
-
- 0
- 0
- 807
- 696
-
-
-
- SimpleView
-
-
-
-
-
- 160
- 20
- 721
- 621
-
-
-
-
-
-
- 0
- 20
- 161
- 621
-
-
-
-
-
-
-
- 0
- 0
- 807
- 23
-
-
-
-
- File
-
-
-
-
-
- Help
-
-
- false
-
-
-
-
-
-
-
-
- true
-
-
- Open File...
-
-
-
-
- Exit
-
-
-
-
- Print
-
-
-
-
- Help
-
-
-
-
- Save
-
-
-
-
- Exit
-
-
-
-
-
- QVTKWidget
- QWidget
- QVTKWidget.h
-
-
-
-
-
diff -Nru opencamlib-11.10+git201801200005~ubuntu16.04.1/debian/bzr-builder.manifest opencamlib-11.10-1/debian/bzr-builder.manifest
--- opencamlib-11.10+git201801200005~ubuntu16.04.1/debian/bzr-builder.manifest 2018-01-20 00:05:24.000000000 +0000
+++ opencamlib-11.10-1/debian/bzr-builder.manifest 1970-01-01 00:00:00.000000000 +0000
@@ -1,4 +0,0 @@
-# bzr-builder format 0.3 deb-version {debupstream}+git201801200005
-lp:opencamlib revid:git-v1:f8bd0a66ad4f1114a3caf84f430027c2da79c91d
-nest packaging lp:~neomilium/opencamlib/packaging debian revid:neomilium@gmail.com-20171115233328-2ngbkslxbw1e9tl2
-nest-part versioning lp:~neomilium/opencamlib/versioning src/version_string.hpp src/version_string.hpp revid:neomilium@gmail.com-20140613122717-mhb9173sx94yjx0e
diff -Nru opencamlib-11.10+git201801200005~ubuntu16.04.1/debian/changelog opencamlib-11.10-1/debian/changelog
--- opencamlib-11.10+git201801200005~ubuntu16.04.1/debian/changelog 2018-01-20 00:05:24.000000000 +0000
+++ opencamlib-11.10-1/debian/changelog 2020-06-14 12:13:21.000000000 +0000
@@ -1,8 +1,8 @@
-opencamlib (11.10+git201801200005~ubuntu16.04.1) xenial; urgency=low
+opencamlib (11.10-1-1+git202005211103~ubuntu16.04.1) xenial; urgency=low
* Auto build.
- -- neomilium Sat, 20 Jan 2018 00:05:24 +0000
+ -- neomilium Sun, 14 Jun 2020 12:13:21 +0000
opencamlib (11.10-1) unstable; urgency=low
diff -Nru opencamlib-11.10+git201801200005~ubuntu16.04.1/debian/control opencamlib-11.10-1/debian/control
--- opencamlib-11.10+git201801200005~ubuntu16.04.1/debian/control 2018-01-20 00:05:23.000000000 +0000
+++ opencamlib-11.10-1/debian/control 2020-06-14 12:13:21.000000000 +0000
@@ -2,7 +2,7 @@
Priority: extra
Section: misc
Maintainer: Romuald Conty
-Build-Depends: debhelper (>= 7.0.0), cmake (>= 2.4), python-dev, libboost-dev, libboost-system-dev, libboost-python-dev
+Build-Depends: debhelper (>= 9.0.0), cmake (>= 2.4), python-dev, libboost-dev, libboost-system-dev, libboost-python-dev
Standards-Version: 3.9.3
Homepage: https://github.com/aewallin/opencamlib
Vcs-Git: https://github.com/aewallin/opencamlib.git
diff -Nru opencamlib-11.10+git201801200005~ubuntu16.04.1/debian/git-build-recipe.manifest opencamlib-11.10-1/debian/git-build-recipe.manifest
--- opencamlib-11.10+git201801200005~ubuntu16.04.1/debian/git-build-recipe.manifest 1970-01-01 00:00:00.000000000 +0000
+++ opencamlib-11.10-1/debian/git-build-recipe.manifest 2020-06-14 12:13:21.000000000 +0000
@@ -0,0 +1,3 @@
+# git-build-recipe format 0.4 deb-version {debversion}-1+git202005211103
+lp:opencamlib git-commit:c31b069cfa6deb57708e19c185e932117879f24b
+nest packaging lp:~neomilium/opencamlib/+git/packaging debian git-commit:8d85ed825f93f0b8344117d49b3c07b7e97bd68e
diff -Nru opencamlib-11.10+git201801200005~ubuntu16.04.1/doc/pushcutter_drawing.svg opencamlib-11.10-1/doc/pushcutter_drawing.svg
--- opencamlib-11.10+git201801200005~ubuntu16.04.1/doc/pushcutter_drawing.svg 2018-01-20 00:05:22.000000000 +0000
+++ opencamlib-11.10-1/doc/pushcutter_drawing.svg 1970-01-01 00:00:00.000000000 +0000
@@ -1,247 +0,0 @@
-
-
-
-
diff -Nru opencamlib-11.10+git201801200005~ubuntu16.04.1/Dockerfile opencamlib-11.10-1/Dockerfile
--- opencamlib-11.10+git201801200005~ubuntu16.04.1/Dockerfile 1970-01-01 00:00:00.000000000 +0000
+++ opencamlib-11.10-1/Dockerfile 2020-06-14 12:13:19.000000000 +0000
@@ -0,0 +1,24 @@
+FROM ubuntu:16.04
+RUN rm /bin/sh && ln -s /bin/bash /bin/sh
+RUN apt-get update
+RUN apt-get install -y cmake build-essential subversion doxygen texlive-latex-base libboost-all-dev git python-vtk6 python-dev x11vnc fluxbox wget wmctrl xvfb
+RUN git clone --depth=50 --branch=master https://github.com/aewallin/opencamlib.git aewallin/opencamlib
+ENV CXX g++
+ENV CC gcc
+ENV DISPLAY :20
+WORKDIR ./aewallin/opencamlib
+RUN mkdir build
+RUN ls
+WORKDIR ./build
+RUN cmake ../src
+RUN make
+RUN make install
+WORKDIR /usr/lib/x86_64-linux-gnu
+EXPOSE 5900
+RUN useradd -ms /bin/bash cam
+USER cam
+ENV USER cam
+WORKDIR /aewallin/opencamlib/
+ADD dockerinit.sh /
+CMD '/dockerinit.sh'
+
diff -Nru opencamlib-11.10+git201801200005~ubuntu16.04.1/dockerinit.sh opencamlib-11.10-1/dockerinit.sh
--- opencamlib-11.10+git201801200005~ubuntu16.04.1/dockerinit.sh 1970-01-01 00:00:00.000000000 +0000
+++ opencamlib-11.10-1/dockerinit.sh 2020-06-14 12:13:19.000000000 +0000
@@ -0,0 +1,85 @@
+#!/bin/bash
+
+# Based on: http://www.richud.com/wiki/Ubuntu_Fluxbox_GUI_with_x11vnc_and_Xvfb
+
+readonly G_LOG_I='[INFO]'
+readonly G_LOG_W='[WARN]'
+readonly G_LOG_E='[ERROR]'
+
+main() {
+ launch_xvfb
+ launch_window_manager
+ run_vnc_server
+}
+
+launch_xvfb() {
+ # Set defaults if the user did not specify envs.
+ export DISPLAY=${XVFB_DISPLAY:-:1}
+ local screen=${XVFB_SCREEN:-0}
+ local resolution=${XVFB_RESOLUTION:-1280x1024x24}
+ local timeout=${XVFB_TIMEOUT:-5}
+
+ # Start and wait for either Xvfb to be fully up or we hit the timeout.
+ Xvfb ${DISPLAY} -screen ${screen} ${resolution} &
+ local loopCount=0
+ until xdpyinfo -display ${DISPLAY} > /dev/null 2>&1
+ do
+ loopCount=$((loopCount+1))
+ sleep 1
+ if [ ${loopCount} -gt ${timeout} ]
+ then
+ echo "${G_LOG_E} xvfb failed to start."
+ exit 1
+ fi
+ done
+}
+
+launch_window_manager() {
+ local timeout=${XVFB_TIMEOUT:-5}
+
+ # Start and wait for either fluxbox to be fully up or we hit the timeout.
+ fluxbox &
+ local loopCount=0
+ until wmctrl -m > /dev/null 2>&1
+ do
+ loopCount=$((loopCount+1))
+ sleep 1
+ if [ ${loopCount} -gt ${timeout} ]
+ then
+ echo "${G_LOG_E} fluxbox failed to start."
+ exit 1
+ fi
+ done
+}
+
+run_vnc_server() {
+ local passwordArgument='-nopw'
+
+ if [ -n "${VNC_SERVER_PASSWORD}" ]
+ then
+ local passwordFilePath="${HOME}/x11vnc.pass"
+ if ! x11vnc -storepasswd "${VNC_SERVER_PASSWORD}" "${passwordFilePath}"
+ then
+ echo "${G_LOG_E} Failed to store x11vnc password."
+ exit 1
+ fi
+ passwordArgument=-"-rfbauth ${passwordFilePath}"
+ echo "${G_LOG_I} The VNC server will ask for a password."
+ else
+ echo "${G_LOG_W} The VNC server will NOT ask for a password."
+ fi
+
+ x11vnc -display ${DISPLAY} -forever ${passwordArgument} &
+ wait $!
+}
+
+control_c() {
+ echo ""
+ exit
+}
+
+trap control_c SIGINT SIGTERM SIGHUP
+
+main
+
+exit
diff -Nru opencamlib-11.10+git201801200005~ubuntu16.04.1/docs/adaptivepathdropcutter.rst opencamlib-11.10-1/docs/adaptivepathdropcutter.rst
--- opencamlib-11.10+git201801200005~ubuntu16.04.1/docs/adaptivepathdropcutter.rst 1970-01-01 00:00:00.000000000 +0000
+++ opencamlib-11.10-1/docs/adaptivepathdropcutter.rst 2020-06-14 12:13:19.000000000 +0000
@@ -0,0 +1,6 @@
+AdaptivePathDropCutter
+======================
+
+.. doxygenclass:: ocl::AdaptivePathDropCutter
+ :project: opencamlib
+ :members:
\ No newline at end of file
diff -Nru opencamlib-11.10+git201801200005~ubuntu16.04.1/docs/api.rst opencamlib-11.10-1/docs/api.rst
--- opencamlib-11.10+git201801200005~ubuntu16.04.1/docs/api.rst 1970-01-01 00:00:00.000000000 +0000
+++ opencamlib-11.10-1/docs/api.rst 2020-06-14 12:13:19.000000000 +0000
@@ -0,0 +1,148 @@
+API Documentation
+=================
+
+.. toctree::
+ :maxdepth: 1
+ :caption: Contents:
+
+ point
+ adaptivepathdropcutter
+
+To Document:
+============
+
+.. doxygenclass:: ocl::AdaptiveWaterline
+ :project: opencamlib
+ :members:
+.. doxygenclass:: ocl::AlignedEllipse
+ :project: opencamlib
+ :members:
+.. doxygenclass:: ocl::Arc
+ :project: opencamlib
+ :members:
+.. doxygenclass:: ocl::ArcSpan
+ :project: opencamlib
+ :members:
+.. doxygenclass:: ocl::BallConeCutter
+ :project: opencamlib
+ :members:
+.. doxygenclass:: ocl::BallCutter
+ :project: opencamlib
+ :members:
+.. doxygenclass:: ocl::BatchDropCutter
+ :project: opencamlib
+ :members:
+.. doxygenclass:: ocl::BatchPushCutter
+ :project: opencamlib
+ :members:
+.. doxygenclass:: ocl::Bbox
+ :project: opencamlib
+ :members:
+.. doxygenclass:: ocl::BullConeCutter
+ :project: opencamlib
+ :members:
+.. doxygenclass:: ocl::BullCutter
+ :project: opencamlib
+ :members:
+.. doxygenclass:: ocl::CCPoint
+ :project: opencamlib
+ :members:
+.. doxygenclass:: ocl::CLFilter
+ :project: opencamlib
+ :members:
+.. doxygenclass:: ocl::CLPoint
+ :project: opencamlib
+ :members:
+.. doxygenclass:: ocl::CompBallCutter
+ :project: opencamlib
+ :members:
+.. doxygenclass:: ocl::CompCylCutter
+ :project: opencamlib
+ :members:
+.. doxygenclass:: ocl::CompositeCutter
+ :project: opencamlib
+ :members:
+.. doxygenclass:: ocl::ConeConeCutter
+ :project: opencamlib
+ :members:
+.. doxygenclass:: ocl::ConeCutter
+ :project: opencamlib
+ :members:
+.. doxygenclass:: ocl::CylConeCutter
+ :project: opencamlib
+ :members:
+.. doxygenclass:: ocl::CylCutter
+ :project: opencamlib
+ :members:
+.. doxygenclass:: ocl::Ellipse
+ :project: opencamlib
+ :members:
+.. doxygenclass:: ocl::EllipsePosition
+ :project: opencamlib
+ :members:
+.. doxygenclass:: ocl::Fiber
+ :project: opencamlib
+ :members:
+.. doxygenclass:: ocl::FiberPushCutter
+ :project: opencamlib
+ :members:
+.. doxygenclass:: ocl::Interval
+ :project: opencamlib
+ :members:
+.. doxygenclass:: ocl::VertexPairCompare
+ :project: opencamlib
+ :members:
+.. doxygenclass:: ocl::KDNode
+ :project: opencamlib
+ :members:
+.. doxygenclass:: ocl::KDTree
+ :project: opencamlib
+ :members:
+.. doxygenclass:: ocl::Line
+ :project: opencamlib
+ :members:
+.. doxygenclass:: ocl::LineCLFilter
+ :project: opencamlib
+ :members:
+.. doxygenclass:: ocl::LineSpan
+ :project: opencamlib
+ :members:
+.. doxygenclass:: ocl::MillingCutter
+ :project: opencamlib
+ :members:
+.. doxygenclass:: ocl::Operation
+ :project: opencamlib
+ :members:
+.. doxygenclass:: ocl::Path
+ :project: opencamlib
+ :members:
+.. doxygenclass:: ocl::PathDropCutter
+ :project: opencamlib
+ :members:
+.. doxygenclass:: ocl::Point
+ :project: opencamlib
+ :members:
+.. doxygenclass:: ocl::PointDropCutter
+ :project: opencamlib
+ :members:
+.. doxygenclass:: ocl::Span
+ :project: opencamlib
+ :members:
+.. doxygenclass:: ocl::Spread
+ :project: opencamlib
+ :members:
+.. doxygenclass:: ocl::STLReader
+ :project: opencamlib
+ :members:
+.. doxygenclass:: ocl::STLSurf
+ :project: opencamlib
+ :members:
+.. doxygenclass:: ocl::Triangle
+ :project: opencamlib
+ :members:
+.. doxygenclass:: ocl::Waterline
+ :project: opencamlib
+ :members:
+.. doxygenclass:: ocl::ZigZag
+ :project: opencamlib
+ :members:
\ No newline at end of file
diff -Nru opencamlib-11.10+git201801200005~ubuntu16.04.1/docs/conf.py opencamlib-11.10-1/docs/conf.py
--- opencamlib-11.10+git201801200005~ubuntu16.04.1/docs/conf.py 1970-01-01 00:00:00.000000000 +0000
+++ opencamlib-11.10-1/docs/conf.py 2020-06-14 12:13:19.000000000 +0000
@@ -0,0 +1,293 @@
+# -*- coding: utf-8 -*-
+#
+# opencamlib documentation build configuration file, created by
+# sphinx-quickstart on Sat Aug 4 21:55:45 2018.
+#
+# This file is execfile()d with the current directory set to its
+# containing dir.
+#
+# Note that not all possible configuration values are present in this
+# autogenerated file.
+#
+# All configuration values have a default; values that are commented out
+# serve to show the default.
+
+import sys
+import os
+import subprocess
+
+# https://breathe.readthedocs.io/en/latest/readthedocs.html
+# generates doxygen XML files
+read_the_docs_build = os.environ.get('READTHEDOCS', None) == 'True'
+
+if read_the_docs_build:
+ subprocess.call('cd ../src; doxygen', shell=True)
+
+# If extensions (or modules to document with autodoc) are in another directory,
+# add these directories to sys.path here. If the directory is relative to the
+# documentation root, use os.path.abspath to make it absolute, like shown here.
+#sys.path.insert(0, os.path.abspath('.'))
+
+# -- General configuration ------------------------------------------------
+
+# If your documentation needs a minimal Sphinx version, state it here.
+#needs_sphinx = '1.0'
+
+# Add any Sphinx extension module names here, as strings. They can be
+# extensions coming with Sphinx (named 'sphinx.ext.*') or your custom
+# ones.
+extensions = [ "breathe" ]
+breathe_projects = {"opencamlib":"../src/doc/xml"}
+breathe_default_project = "opencamlib"
+
+# Add any paths that contain templates here, relative to this directory.
+templates_path = ['_templates']
+
+# The suffix(es) of source filenames.
+# You can specify multiple suffix as a list of string:
+# source_suffix = ['.rst', '.md']
+source_suffix = '.rst'
+
+# The encoding of source files.
+#source_encoding = 'utf-8-sig'
+
+# The master toctree document.
+master_doc = 'index'
+
+# General information about the project.
+project = u'opencamlib'
+copyright = u'2018, Anders E.E. Wallin'
+author = u'Anders E.E. Wallin'
+
+# The version info for the project you're documenting, acts as replacement for
+# |version| and |release|, also used in various other places throughout the
+# built documents.
+#
+# The short X.Y version.
+version = u'2018.08'
+# The full version, including alpha/beta/rc tags.
+release = u'2018.08'
+
+# The language for content autogenerated by Sphinx. Refer to documentation
+# for a list of supported languages.
+#
+# This is also used if you do content translation via gettext catalogs.
+# Usually you set "language" from the command line for these cases.
+language = None
+
+# There are two options for replacing |today|: either, you set today to some
+# non-false value, then it is used:
+#today = ''
+# Else, today_fmt is used as the format for a strftime call.
+#today_fmt = '%B %d, %Y'
+
+# List of patterns, relative to source directory, that match files and
+# directories to ignore when looking for source files.
+exclude_patterns = ['_build']
+
+# The reST default role (used for this markup: `text`) to use for all
+# documents.
+#default_role = None
+
+# If true, '()' will be appended to :func: etc. cross-reference text.
+#add_function_parentheses = True
+
+# If true, the current module name will be prepended to all description
+# unit titles (such as .. function::).
+#add_module_names = True
+
+# If true, sectionauthor and moduleauthor directives will be shown in the
+# output. They are ignored by default.
+#show_authors = False
+
+# The name of the Pygments (syntax highlighting) style to use.
+pygments_style = 'sphinx'
+
+# A list of ignored prefixes for module index sorting.
+#modindex_common_prefix = []
+
+# If true, keep warnings as "system message" paragraphs in the built documents.
+#keep_warnings = False
+
+# If true, `todo` and `todoList` produce output, else they produce nothing.
+todo_include_todos = False
+
+
+# -- Options for HTML output ----------------------------------------------
+
+# The theme to use for HTML and HTML Help pages. See the documentation for
+# a list of builtin themes.
+html_theme = 'sphinx_rtd_theme'
+
+# Theme options are theme-specific and customize the look and feel of a theme
+# further. For a list of options available for each theme, see the
+# documentation.
+#html_theme_options = {}
+
+# Add any paths that contain custom themes here, relative to this directory.
+#html_theme_path = []
+
+# The name for this set of Sphinx documents. If None, it defaults to
+# " v documentation".
+#html_title = None
+
+# A shorter title for the navigation bar. Default is the same as html_title.
+#html_short_title = None
+
+# The name of an image file (relative to this directory) to place at the top
+# of the sidebar.
+#html_logo = None
+
+# The name of an image file (relative to this directory) to use as a favicon of
+# the docs. This file should be a Windows icon file (.ico) being 16x16 or 32x32
+# pixels large.
+#html_favicon = None
+
+# Add any paths that contain custom static files (such as style sheets) here,
+# relative to this directory. They are copied after the builtin static files,
+# so a file named "default.css" will overwrite the builtin "default.css".
+html_static_path = ['_static']
+
+# Add any extra paths that contain custom files (such as robots.txt or
+# .htaccess) here, relative to this directory. These files are copied
+# directly to the root of the documentation.
+#html_extra_path = ['../src/doc/html']
+
+# If not '', a 'Last updated on:' timestamp is inserted at every page bottom,
+# using the given strftime format.
+#html_last_updated_fmt = '%b %d, %Y'
+
+# If true, SmartyPants will be used to convert quotes and dashes to
+# typographically correct entities.
+#html_use_smartypants = True
+
+# Custom sidebar templates, maps document names to template names.
+#html_sidebars = {}
+
+# Additional templates that should be rendered to pages, maps page names to
+# template names.
+#html_additional_pages = {}
+
+# If false, no module index is generated.
+#html_domain_indices = True
+
+# If false, no index is generated.
+#html_use_index = True
+
+# If true, the index is split into individual pages for each letter.
+#html_split_index = False
+
+# If true, links to the reST sources are added to the pages.
+#html_show_sourcelink = True
+
+# If true, "Created using Sphinx" is shown in the HTML footer. Default is True.
+#html_show_sphinx = True
+
+# If true, "(C) Copyright ..." is shown in the HTML footer. Default is True.
+#html_show_copyright = True
+
+# If true, an OpenSearch description file will be output, and all pages will
+# contain a tag referring to it. The value of this option must be the
+# base URL from which the finished HTML is served.
+#html_use_opensearch = ''
+
+# This is the file name suffix for HTML files (e.g. ".xhtml").
+#html_file_suffix = None
+
+# Language to be used for generating the HTML full-text search index.
+# Sphinx supports the following languages:
+# 'da', 'de', 'en', 'es', 'fi', 'fr', 'hu', 'it', 'ja'
+# 'nl', 'no', 'pt', 'ro', 'ru', 'sv', 'tr'
+#html_search_language = 'en'
+
+# A dictionary with options for the search language support, empty by default.
+# Now only 'ja' uses this config value
+#html_search_options = {'type': 'default'}
+
+# The name of a javascript file (relative to the configuration directory) that
+# implements a search results scorer. If empty, the default will be used.
+#html_search_scorer = 'scorer.js'
+
+# Output file base name for HTML help builder.
+htmlhelp_basename = 'opencamlibdoc'
+
+# -- Options for LaTeX output ---------------------------------------------
+
+latex_elements = {
+# The paper size ('letterpaper' or 'a4paper').
+#'papersize': 'letterpaper',
+
+# The font size ('10pt', '11pt' or '12pt').
+#'pointsize': '10pt',
+
+# Additional stuff for the LaTeX preamble.
+#'preamble': '',
+
+# Latex figure (float) alignment
+#'figure_align': 'htbp',
+}
+
+# Grouping the document tree into LaTeX files. List of tuples
+# (source start file, target name, title,
+# author, documentclass [howto, manual, or own class]).
+latex_documents = [
+ (master_doc, 'opencamlib.tex', u'opencamlib Documentation',
+ u'Anders E.E. Wallin', 'manual'),
+]
+
+# The name of an image file (relative to this directory) to place at the top of
+# the title page.
+#latex_logo = None
+
+# For "manual" documents, if this is true, then toplevel headings are parts,
+# not chapters.
+#latex_use_parts = False
+
+# If true, show page references after internal links.
+#latex_show_pagerefs = False
+
+# If true, show URL addresses after external links.
+#latex_show_urls = False
+
+# Documents to append as an appendix to all manuals.
+#latex_appendices = []
+
+# If false, no module index is generated.
+#latex_domain_indices = True
+
+
+# -- Options for manual page output ---------------------------------------
+
+# One entry per manual page. List of tuples
+# (source start file, name, description, authors, manual section).
+man_pages = [
+ (master_doc, 'opencamlib', u'opencamlib Documentation',
+ [author], 1)
+]
+
+# If true, show URL addresses after external links.
+#man_show_urls = False
+
+
+# -- Options for Texinfo output -------------------------------------------
+
+# Grouping the document tree into Texinfo files. List of tuples
+# (source start file, target name, title, author,
+# dir menu entry, description, category)
+texinfo_documents = [
+ (master_doc, 'opencamlib', u'opencamlib Documentation',
+ author, 'opencamlib', 'One line description of project.',
+ 'Miscellaneous'),
+]
+
+# Documents to append as an appendix to all manuals.
+#texinfo_appendices = []
+
+# If false, no module index is generated.
+#texinfo_domain_indices = True
+
+# How to display URL addresses: 'footnote', 'no', or 'inline'.
+#texinfo_show_urls = 'footnote'
+
+# If true, do not generate a @detailmenu in the "Top" node's menu.
+#texinfo_no_detailmenu = False
diff -Nru opencamlib-11.10+git201801200005~ubuntu16.04.1/docs/index.rst opencamlib-11.10-1/docs/index.rst
--- opencamlib-11.10+git201801200005~ubuntu16.04.1/docs/index.rst 1970-01-01 00:00:00.000000000 +0000
+++ opencamlib-11.10-1/docs/index.rst 2020-06-14 12:13:19.000000000 +0000
@@ -0,0 +1,67 @@
+.. opencamlib documentation master file, created by
+ sphinx-quickstart on Sat Aug 4 21:55:45 2018.
+ You can adapt this file completely to your liking, but it should at least
+ contain the root `toctree` directive.
+
+OpenCAMLib
+==========
+
+Introduction
+============
+
+OpenCAMLib (ocl) is a c++ library with python bindings for creating 3D toolpaths for cnc-machines such as mills and lathes. From August 2018 OpenCAMLib is released under LGPL license.
+
+repository https://github.com/aewallin/opencamlib
+mailing-list http://groups.google.com/group/opencamlib
+IRC-channel #cam on irc.freenode.net
+coding standard (?) http://www.possibility.com/Cpp/CppCodingStandard.html
+BUILDING and INSTALLING
+to clone, build and install install the ocl.so library and camvtk.py run the following:
+
+.. code-block:: console
+
+ git clone git://github.com/aewallin/opencamlib.git
+ cd opencamlib
+ mkdir build
+ cd build
+ cmake ../src
+ make (try make -j4 for a faster build if you have a multi-core machine)
+ sudo make install
+
+if you also want to build the documentation, then run:
+
+.. code-block:: console
+
+ make doc
+ make doc-pdf
+
+this should create the ocl manual named "ocl-manual.pdf" in the build/doc directory
+
+using cmake and cpack it is possible to build a binary .deb package with:
+
+.. code-block:: console
+
+ make package
+
+For uploading debian source-packages to the PPA there is also a custom target:
+
+.. code-block:: console
+
+ make spackage
+
+The build directory opencamlib/build can be wiped clean ("rm -rf *") and cmake run again if/when you want a clean build.
+
+.. toctree::
+ :maxdepth: 1
+ :caption: Contents:
+
+ api
+
+
+Indices and tables
+==================
+
+* :ref:`genindex`
+* :ref:`modindex`
+* :ref:`search`
+
diff -Nru opencamlib-11.10+git201801200005~ubuntu16.04.1/docs/Makefile opencamlib-11.10-1/docs/Makefile
--- opencamlib-11.10+git201801200005~ubuntu16.04.1/docs/Makefile 1970-01-01 00:00:00.000000000 +0000
+++ opencamlib-11.10-1/docs/Makefile 2020-06-14 12:13:19.000000000 +0000
@@ -0,0 +1,216 @@
+# Makefile for Sphinx documentation
+#
+
+# You can set these variables from the command line.
+SPHINXOPTS =
+SPHINXBUILD = sphinx-build
+PAPER =
+BUILDDIR = _build
+
+# User-friendly check for sphinx-build
+ifeq ($(shell which $(SPHINXBUILD) >/dev/null 2>&1; echo $$?), 1)
+$(error The '$(SPHINXBUILD)' command was not found. Make sure you have Sphinx installed, then set the SPHINXBUILD environment variable to point to the full path of the '$(SPHINXBUILD)' executable. Alternatively you can add the directory with the executable to your PATH. If you don't have Sphinx installed, grab it from http://sphinx-doc.org/)
+endif
+
+# Internal variables.
+PAPEROPT_a4 = -D latex_paper_size=a4
+PAPEROPT_letter = -D latex_paper_size=letter
+ALLSPHINXOPTS = -d $(BUILDDIR)/doctrees $(PAPEROPT_$(PAPER)) $(SPHINXOPTS) .
+# the i18n builder cannot share the environment and doctrees with the others
+I18NSPHINXOPTS = $(PAPEROPT_$(PAPER)) $(SPHINXOPTS) .
+
+.PHONY: help
+help:
+ @echo "Please use \`make ' where is one of"
+ @echo " html to make standalone HTML files"
+ @echo " dirhtml to make HTML files named index.html in directories"
+ @echo " singlehtml to make a single large HTML file"
+ @echo " pickle to make pickle files"
+ @echo " json to make JSON files"
+ @echo " htmlhelp to make HTML files and a HTML help project"
+ @echo " qthelp to make HTML files and a qthelp project"
+ @echo " applehelp to make an Apple Help Book"
+ @echo " devhelp to make HTML files and a Devhelp project"
+ @echo " epub to make an epub"
+ @echo " latex to make LaTeX files, you can set PAPER=a4 or PAPER=letter"
+ @echo " latexpdf to make LaTeX files and run them through pdflatex"
+ @echo " latexpdfja to make LaTeX files and run them through platex/dvipdfmx"
+ @echo " text to make text files"
+ @echo " man to make manual pages"
+ @echo " texinfo to make Texinfo files"
+ @echo " info to make Texinfo files and run them through makeinfo"
+ @echo " gettext to make PO message catalogs"
+ @echo " changes to make an overview of all changed/added/deprecated items"
+ @echo " xml to make Docutils-native XML files"
+ @echo " pseudoxml to make pseudoxml-XML files for display purposes"
+ @echo " linkcheck to check all external links for integrity"
+ @echo " doctest to run all doctests embedded in the documentation (if enabled)"
+ @echo " coverage to run coverage check of the documentation (if enabled)"
+
+.PHONY: clean
+clean:
+ rm -rf $(BUILDDIR)/*
+
+.PHONY: html
+html:
+ $(SPHINXBUILD) -b html $(ALLSPHINXOPTS) $(BUILDDIR)/html
+ @echo
+ @echo "Build finished. The HTML pages are in $(BUILDDIR)/html."
+
+.PHONY: dirhtml
+dirhtml:
+ $(SPHINXBUILD) -b dirhtml $(ALLSPHINXOPTS) $(BUILDDIR)/dirhtml
+ @echo
+ @echo "Build finished. The HTML pages are in $(BUILDDIR)/dirhtml."
+
+.PHONY: singlehtml
+singlehtml:
+ $(SPHINXBUILD) -b singlehtml $(ALLSPHINXOPTS) $(BUILDDIR)/singlehtml
+ @echo
+ @echo "Build finished. The HTML page is in $(BUILDDIR)/singlehtml."
+
+.PHONY: pickle
+pickle:
+ $(SPHINXBUILD) -b pickle $(ALLSPHINXOPTS) $(BUILDDIR)/pickle
+ @echo
+ @echo "Build finished; now you can process the pickle files."
+
+.PHONY: json
+json:
+ $(SPHINXBUILD) -b json $(ALLSPHINXOPTS) $(BUILDDIR)/json
+ @echo
+ @echo "Build finished; now you can process the JSON files."
+
+.PHONY: htmlhelp
+htmlhelp:
+ $(SPHINXBUILD) -b htmlhelp $(ALLSPHINXOPTS) $(BUILDDIR)/htmlhelp
+ @echo
+ @echo "Build finished; now you can run HTML Help Workshop with the" \
+ ".hhp project file in $(BUILDDIR)/htmlhelp."
+
+.PHONY: qthelp
+qthelp:
+ $(SPHINXBUILD) -b qthelp $(ALLSPHINXOPTS) $(BUILDDIR)/qthelp
+ @echo
+ @echo "Build finished; now you can run "qcollectiongenerator" with the" \
+ ".qhcp project file in $(BUILDDIR)/qthelp, like this:"
+ @echo "# qcollectiongenerator $(BUILDDIR)/qthelp/opencamlib.qhcp"
+ @echo "To view the help file:"
+ @echo "# assistant -collectionFile $(BUILDDIR)/qthelp/opencamlib.qhc"
+
+.PHONY: applehelp
+applehelp:
+ $(SPHINXBUILD) -b applehelp $(ALLSPHINXOPTS) $(BUILDDIR)/applehelp
+ @echo
+ @echo "Build finished. The help book is in $(BUILDDIR)/applehelp."
+ @echo "N.B. You won't be able to view it unless you put it in" \
+ "~/Library/Documentation/Help or install it in your application" \
+ "bundle."
+
+.PHONY: devhelp
+devhelp:
+ $(SPHINXBUILD) -b devhelp $(ALLSPHINXOPTS) $(BUILDDIR)/devhelp
+ @echo
+ @echo "Build finished."
+ @echo "To view the help file:"
+ @echo "# mkdir -p $$HOME/.local/share/devhelp/opencamlib"
+ @echo "# ln -s $(BUILDDIR)/devhelp $$HOME/.local/share/devhelp/opencamlib"
+ @echo "# devhelp"
+
+.PHONY: epub
+epub:
+ $(SPHINXBUILD) -b epub $(ALLSPHINXOPTS) $(BUILDDIR)/epub
+ @echo
+ @echo "Build finished. The epub file is in $(BUILDDIR)/epub."
+
+.PHONY: latex
+latex:
+ $(SPHINXBUILD) -b latex $(ALLSPHINXOPTS) $(BUILDDIR)/latex
+ @echo
+ @echo "Build finished; the LaTeX files are in $(BUILDDIR)/latex."
+ @echo "Run \`make' in that directory to run these through (pdf)latex" \
+ "(use \`make latexpdf' here to do that automatically)."
+
+.PHONY: latexpdf
+latexpdf:
+ $(SPHINXBUILD) -b latex $(ALLSPHINXOPTS) $(BUILDDIR)/latex
+ @echo "Running LaTeX files through pdflatex..."
+ $(MAKE) -C $(BUILDDIR)/latex all-pdf
+ @echo "pdflatex finished; the PDF files are in $(BUILDDIR)/latex."
+
+.PHONY: latexpdfja
+latexpdfja:
+ $(SPHINXBUILD) -b latex $(ALLSPHINXOPTS) $(BUILDDIR)/latex
+ @echo "Running LaTeX files through platex and dvipdfmx..."
+ $(MAKE) -C $(BUILDDIR)/latex all-pdf-ja
+ @echo "pdflatex finished; the PDF files are in $(BUILDDIR)/latex."
+
+.PHONY: text
+text:
+ $(SPHINXBUILD) -b text $(ALLSPHINXOPTS) $(BUILDDIR)/text
+ @echo
+ @echo "Build finished. The text files are in $(BUILDDIR)/text."
+
+.PHONY: man
+man:
+ $(SPHINXBUILD) -b man $(ALLSPHINXOPTS) $(BUILDDIR)/man
+ @echo
+ @echo "Build finished. The manual pages are in $(BUILDDIR)/man."
+
+.PHONY: texinfo
+texinfo:
+ $(SPHINXBUILD) -b texinfo $(ALLSPHINXOPTS) $(BUILDDIR)/texinfo
+ @echo
+ @echo "Build finished. The Texinfo files are in $(BUILDDIR)/texinfo."
+ @echo "Run \`make' in that directory to run these through makeinfo" \
+ "(use \`make info' here to do that automatically)."
+
+.PHONY: info
+info:
+ $(SPHINXBUILD) -b texinfo $(ALLSPHINXOPTS) $(BUILDDIR)/texinfo
+ @echo "Running Texinfo files through makeinfo..."
+ make -C $(BUILDDIR)/texinfo info
+ @echo "makeinfo finished; the Info files are in $(BUILDDIR)/texinfo."
+
+.PHONY: gettext
+gettext:
+ $(SPHINXBUILD) -b gettext $(I18NSPHINXOPTS) $(BUILDDIR)/locale
+ @echo
+ @echo "Build finished. The message catalogs are in $(BUILDDIR)/locale."
+
+.PHONY: changes
+changes:
+ $(SPHINXBUILD) -b changes $(ALLSPHINXOPTS) $(BUILDDIR)/changes
+ @echo
+ @echo "The overview file is in $(BUILDDIR)/changes."
+
+.PHONY: linkcheck
+linkcheck:
+ $(SPHINXBUILD) -b linkcheck $(ALLSPHINXOPTS) $(BUILDDIR)/linkcheck
+ @echo
+ @echo "Link check complete; look for any errors in the above output " \
+ "or in $(BUILDDIR)/linkcheck/output.txt."
+
+.PHONY: doctest
+doctest:
+ $(SPHINXBUILD) -b doctest $(ALLSPHINXOPTS) $(BUILDDIR)/doctest
+ @echo "Testing of doctests in the sources finished, look at the " \
+ "results in $(BUILDDIR)/doctest/output.txt."
+
+.PHONY: coverage
+coverage:
+ $(SPHINXBUILD) -b coverage $(ALLSPHINXOPTS) $(BUILDDIR)/coverage
+ @echo "Testing of coverage in the sources finished, look at the " \
+ "results in $(BUILDDIR)/coverage/python.txt."
+
+.PHONY: xml
+xml:
+ $(SPHINXBUILD) -b xml $(ALLSPHINXOPTS) $(BUILDDIR)/xml
+ @echo
+ @echo "Build finished. The XML files are in $(BUILDDIR)/xml."
+
+.PHONY: pseudoxml
+pseudoxml:
+ $(SPHINXBUILD) -b pseudoxml $(ALLSPHINXOPTS) $(BUILDDIR)/pseudoxml
+ @echo
+ @echo "Build finished. The pseudo-XML files are in $(BUILDDIR)/pseudoxml."
diff -Nru opencamlib-11.10+git201801200005~ubuntu16.04.1/docs/point.rst opencamlib-11.10-1/docs/point.rst
--- opencamlib-11.10+git201801200005~ubuntu16.04.1/docs/point.rst 1970-01-01 00:00:00.000000000 +0000
+++ opencamlib-11.10-1/docs/point.rst 2020-06-14 12:13:19.000000000 +0000
@@ -0,0 +1,6 @@
+Point
+=====
+
+.. doxygenclass:: ocl::Point
+ :project: opencamlib
+ :members:
\ No newline at end of file
diff -Nru opencamlib-11.10+git201801200005~ubuntu16.04.1/docs/pushcutter_drawing.svg opencamlib-11.10-1/docs/pushcutter_drawing.svg
--- opencamlib-11.10+git201801200005~ubuntu16.04.1/docs/pushcutter_drawing.svg 1970-01-01 00:00:00.000000000 +0000
+++ opencamlib-11.10-1/docs/pushcutter_drawing.svg 2020-06-14 12:13:19.000000000 +0000
@@ -0,0 +1,247 @@
+
+
+
+
diff -Nru opencamlib-11.10+git201801200005~ubuntu16.04.1/docs/requirements.txt opencamlib-11.10-1/docs/requirements.txt
--- opencamlib-11.10+git201801200005~ubuntu16.04.1/docs/requirements.txt 1970-01-01 00:00:00.000000000 +0000
+++ opencamlib-11.10-1/docs/requirements.txt 2020-06-14 12:13:19.000000000 +0000
@@ -0,0 +1,2 @@
+breathe
+sphinx_rtd_theme
\ No newline at end of file
diff -Nru opencamlib-11.10+git201801200005~ubuntu16.04.1/examples/cpp/point/CMakeLists.txt opencamlib-11.10-1/examples/cpp/point/CMakeLists.txt
--- opencamlib-11.10+git201801200005~ubuntu16.04.1/examples/cpp/point/CMakeLists.txt 1970-01-01 00:00:00.000000000 +0000
+++ opencamlib-11.10-1/examples/cpp/point/CMakeLists.txt 2020-06-14 12:13:19.000000000 +0000
@@ -0,0 +1,42 @@
+project(OCL_POINT_EXAMPLE)
+
+cmake_minimum_required(VERSION 2.4)
+
+if (CMAKE_BUILD_TOOL MATCHES "make")
+ add_definitions(-Wall -Werror -Wno-deprecated -pedantic-errors)
+endif (CMAKE_BUILD_TOOL MATCHES "make")
+
+# find BOOST and boost-python
+find_package( Boost )
+if(Boost_FOUND)
+ include_directories(${Boost_INCLUDE_DIRS})
+ MESSAGE(STATUS "found Boost: " ${Boost_LIB_VERSION})
+ MESSAGE(STATUS "boost-incude dirs are: " ${Boost_INCLUDE_DIRS})
+endif()
+
+find_package( OpenMP REQUIRED )
+IF (OPENMP_FOUND)
+ MESSAGE(STATUS "found OpenMP, compiling with flags: " ${OpenMP_CXX_FLAGS} )
+ set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${OpenMP_CXX_FLAGS}")
+ENDIF(OPENMP_FOUND)
+
+find_library(OCL_LIBRARY
+ NAMES ocl
+ PATHS /usr/local/lib/opencamlib
+ DOC "The opencamlib library"
+)
+#find_package(ocl REQUIRED)
+MESSAGE(STATUS "OCL_LIBRARY is now: " ${OCL_LIBRARY})
+
+
+set(OCL_TST_SRC
+ ${OCL_POINT_EXAMPLE_SOURCE_DIR}/point_example.cpp
+)
+
+add_executable(
+ point_example
+ ${OCL_TST_SRC}
+)
+target_link_libraries(point_example ${OCL_LIBRARY} ${Boost_LIBRARIES})
+
+
diff -Nru opencamlib-11.10+git201801200005~ubuntu16.04.1/examples/cpp/point/point_example.cpp opencamlib-11.10-1/examples/cpp/point/point_example.cpp
--- opencamlib-11.10+git201801200005~ubuntu16.04.1/examples/cpp/point/point_example.cpp 1970-01-01 00:00:00.000000000 +0000
+++ opencamlib-11.10-1/examples/cpp/point/point_example.cpp 2020-06-14 12:13:19.000000000 +0000
@@ -0,0 +1,37 @@
+
+#include
+#include
+#include
+
+#include
+#include
+
+int main() {
+ std::cout << ocl::revision() << "\n";
+ ocl::Point p1;
+ p1.x = 1.2;
+ p1.y = sqrt(p1.x);
+ p1.z = p1.x + p1.y;
+ std::cout << "p1=" << p1 << "\n";
+ ocl::Point p2(1.23,4.56,3.219);
+ std::cout << "p2=" << p2 << "\n";
+
+ std::cout << "addition:\n";
+ std::cout << " " << p1 << " + " << p2 << " = " << p1+p2 << "\n";
+ std::cout << "subtraction:\n";
+ std::cout << " " << p1 << " - " << p2 << " = " << p1-p2 << "\n";
+ std::cout << "dot product:\n";
+ std::cout << " " << p1 << " dot " << p2 << " = " << p1.dot(p2) << "\n";
+ std::cout << "cross product:\n";
+ std::cout << " " << p1 << " cross " << p2 << " = " << p1.cross(p2) << "\n";
+ std::cout << "scalar multiplication:\n";
+ std::cout << " " << p1 << " * 0.1 = " << 0.1*p1 << "\n";
+ std::cout << "norm:\n";
+ std::cout << " norm( " << p1 << " ) = " << p1.norm() << "\n";
+ std::cout << "normalize:\n";
+ ocl::Point p3 = p1;
+ p3.normalize();
+ std::cout << " " << p1 << ".normalize() = " << p3 << " norm=" << p3.norm() << "\n";
+
+ return 0;
+}
diff -Nru opencamlib-11.10+git201801200005~ubuntu16.04.1/examples/cpp/qt_vtk_renderwindow/CMakeLists.txt opencamlib-11.10-1/examples/cpp/qt_vtk_renderwindow/CMakeLists.txt
--- opencamlib-11.10+git201801200005~ubuntu16.04.1/examples/cpp/qt_vtk_renderwindow/CMakeLists.txt 1970-01-01 00:00:00.000000000 +0000
+++ opencamlib-11.10-1/examples/cpp/qt_vtk_renderwindow/CMakeLists.txt 2020-06-14 12:13:19.000000000 +0000
@@ -0,0 +1,14 @@
+cmake_minimum_required(VERSION 2.6)
+
+PROJECT(RenderWindow)
+
+FIND_PACKAGE(VTK REQUIRED)
+INCLUDE(${VTK_USE_FILE})
+MESSAGE(STATUS "VTK_USE_FILE = " ${VTK_USE_FILE} )
+
+FIND_PACKAGE(Qt4 REQUIRED)
+INCLUDE(${QT_USE_FILE})
+ MESSAGE(STATUS "QT_USE_FILE = " ${QT_USE_FILE} )
+
+ADD_EXECUTABLE(RenderWindow RenderWindow.cpp)
+TARGET_LINK_LIBRARIES(RenderWindow QVTK vtkHybrid)
diff -Nru opencamlib-11.10+git201801200005~ubuntu16.04.1/examples/cpp/qt_vtk_renderwindow/RenderWindow.cpp opencamlib-11.10-1/examples/cpp/qt_vtk_renderwindow/RenderWindow.cpp
--- opencamlib-11.10+git201801200005~ubuntu16.04.1/examples/cpp/qt_vtk_renderwindow/RenderWindow.cpp 1970-01-01 00:00:00.000000000 +0000
+++ opencamlib-11.10-1/examples/cpp/qt_vtk_renderwindow/RenderWindow.cpp 2020-06-14 12:13:19.000000000 +0000
@@ -0,0 +1,51 @@
+#include
+
+#include
+#include
+#include
+#include
+#include
+#include
+#include
+#include
+#include
+
+#include
+
+int main(int argc, char** argv)
+{
+ QApplication app(argc, argv);
+
+ QVTKWidget widget;
+ widget.resize(512,256);
+
+ //setup sphere
+ vtkSmartPointer sphereSource =
+ vtkSmartPointer::New();
+ sphereSource->Update();
+ vtkSmartPointer sphereMapper =
+ vtkSmartPointer::New();
+ sphereMapper->SetInputConnection(sphereSource->GetOutputPort());
+ vtkSmartPointer sphereActor =
+ vtkSmartPointer::New();
+ sphereActor->SetMapper(sphereMapper);
+
+ //setup window
+ vtkSmartPointer renderWindow =
+ vtkSmartPointer::New();
+
+ //setup renderer
+ vtkSmartPointer renderer =
+ vtkSmartPointer::New();
+ renderWindow->AddRenderer(renderer);
+
+ renderer->AddActor(sphereActor);
+ renderer->ResetCamera();
+
+ widget.SetRenderWindow(renderWindow);
+ widget.show();
+
+ app.exec();
+
+ return EXIT_SUCCESS;
+}
diff -Nru opencamlib-11.10+git201801200005~ubuntu16.04.1/examples/cpp/renderwindowUI/CMakeLists.txt opencamlib-11.10-1/examples/cpp/renderwindowUI/CMakeLists.txt
--- opencamlib-11.10+git201801200005~ubuntu16.04.1/examples/cpp/renderwindowUI/CMakeLists.txt 1970-01-01 00:00:00.000000000 +0000
+++ opencamlib-11.10-1/examples/cpp/renderwindowUI/CMakeLists.txt 2020-06-14 12:13:19.000000000 +0000
@@ -0,0 +1,36 @@
+cmake_minimum_required(VERSION 2.8)
+
+PROJECT(RenderWindowUI)
+
+FIND_PACKAGE(VTK)
+INCLUDE(${VTK_USE_FILE}) # include UseVTK.cmake
+
+FIND_PACKAGE(Qt4 REQUIRED)
+INCLUDE(${QT_USE_FILE}) # include UseQt4.cmake
+
+# support for out-of-source build
+INCLUDE_DIRECTORIES(
+ ${CMAKE_CURRENT_BINARY_DIR} #this is where ui_SimpleViewUI.h is generated
+ ${CMAKE_CURRENT_SOURCE_DIR}
+)
+
+# Set your files and resources here
+SET(SimpleViewSrcs RenderWindowUI.cxx SimpleViewUI.cxx)
+SET(SimpleViewUI SimpleViewUI.ui)
+SET(SimpleViewHeaders SimpleViewUI.h)
+
+QT4_WRAP_UI(UISrcs ${SimpleViewUI})
+QT4_WRAP_CPP(MOCSrcs ${SimpleViewHeaders} )
+
+SOURCE_GROUP("Resources" FILES
+ ${SimpleViewUI}
+)
+
+SOURCE_GROUP("Generated" FILES
+ ${UISrcs}
+ ${MOCSrcs}
+)
+
+ADD_EXECUTABLE( RenderWindowUI ${SimpleViewSrcs} ${UISrcs} ${MOCSrcs})
+TARGET_LINK_LIBRARIES( RenderWindowUI QVTK )
+
diff -Nru opencamlib-11.10+git201801200005~ubuntu16.04.1/examples/cpp/renderwindowUI/RenderWindowUI.cxx opencamlib-11.10-1/examples/cpp/renderwindowUI/RenderWindowUI.cxx
--- opencamlib-11.10+git201801200005~ubuntu16.04.1/examples/cpp/renderwindowUI/RenderWindowUI.cxx 1970-01-01 00:00:00.000000000 +0000
+++ opencamlib-11.10-1/examples/cpp/renderwindowUI/RenderWindowUI.cxx 2020-06-14 12:13:19.000000000 +0000
@@ -0,0 +1,11 @@
+#include
+#include "SimpleViewUI.h"
+
+int main( int argc, char** argv )
+{
+ QApplication app( argc, argv );
+ SimpleView mySimpleView;
+ mySimpleView.show();
+ return app.exec();
+}
+
diff -Nru opencamlib-11.10+git201801200005~ubuntu16.04.1/examples/cpp/renderwindowUI/SimpleViewUI.cxx opencamlib-11.10-1/examples/cpp/renderwindowUI/SimpleViewUI.cxx
--- opencamlib-11.10+git201801200005~ubuntu16.04.1/examples/cpp/renderwindowUI/SimpleViewUI.cxx 1970-01-01 00:00:00.000000000 +0000
+++ opencamlib-11.10-1/examples/cpp/renderwindowUI/SimpleViewUI.cxx 2020-06-14 12:13:19.000000000 +0000
@@ -0,0 +1,39 @@
+#include "ui_SimpleViewUI.h"
+#include "SimpleViewUI.h"
+
+#include
+#include
+#include
+#include
+#include
+
+#include "vtkSmartPointer.h"
+
+// Constructor
+SimpleView::SimpleView() {
+ this->ui = new Ui_SimpleView;
+ this->ui->setupUi(this);
+
+ // sphere
+ vtkSmartPointer sphereSource = vtkSmartPointer::New();
+ sphereSource->Update();
+ vtkSmartPointer sphereMapper = vtkSmartPointer::New();
+ sphereMapper->SetInputConnection(sphereSource->GetOutputPort());
+ vtkSmartPointer sphereActor = vtkSmartPointer::New();
+ sphereActor->SetMapper(sphereMapper);
+
+ // VTK Renderer
+ vtkSmartPointer renderer = vtkSmartPointer::New();
+ renderer->AddActor(sphereActor);
+
+ // VTK/Qt wedded
+ this->ui->qvtkWidget->GetRenderWindow()->AddRenderer(renderer);
+
+ // Set up action signals and slots
+ connect(this->ui->actionExit, SIGNAL(triggered()), this, SLOT(slotExit()));
+
+};
+
+void SimpleView::slotExit() {
+ qApp->exit();
+}
diff -Nru opencamlib-11.10+git201801200005~ubuntu16.04.1/examples/cpp/renderwindowUI/SimpleViewUI.h opencamlib-11.10-1/examples/cpp/renderwindowUI/SimpleViewUI.h
--- opencamlib-11.10+git201801200005~ubuntu16.04.1/examples/cpp/renderwindowUI/SimpleViewUI.h 1970-01-01 00:00:00.000000000 +0000
+++ opencamlib-11.10-1/examples/cpp/renderwindowUI/SimpleViewUI.h 2020-06-14 12:13:19.000000000 +0000
@@ -0,0 +1,25 @@
+#ifndef SimpleViewUI_H
+#define SimpleViewUI_H
+
+#include "vtkSmartPointer.h"
+#include
+
+// Forward Qt class declarations
+class Ui_SimpleView;
+
+class SimpleView : public QMainWindow
+{
+ Q_OBJECT
+ public:
+ SimpleView();
+ ~SimpleView() {};
+
+ public slots:
+ virtual void slotExit();
+ protected:
+ protected slots:
+ private:
+ Ui_SimpleView *ui;
+};
+
+#endif // SimpleViewUI_H
diff -Nru opencamlib-11.10+git201801200005~ubuntu16.04.1/examples/cpp/renderwindowUI/SimpleViewUI.ui opencamlib-11.10-1/examples/cpp/renderwindowUI/SimpleViewUI.ui
--- opencamlib-11.10+git201801200005~ubuntu16.04.1/examples/cpp/renderwindowUI/SimpleViewUI.ui 1970-01-01 00:00:00.000000000 +0000
+++ opencamlib-11.10-1/examples/cpp/renderwindowUI/SimpleViewUI.ui 2020-06-14 12:13:19.000000000 +0000
@@ -0,0 +1,108 @@
+
+
+ SimpleView
+
+
+
+ 0
+ 0
+ 807
+ 696
+
+
+
+ SimpleView
+
+
+
+
+
+ 160
+ 20
+ 721
+ 621
+
+
+
+
+
+
+ 0
+ 20
+ 161
+ 621
+
+
+
+
+
+
+
+ 0
+ 0
+ 807
+ 23
+
+
+
+
+ File
+
+
+
+
+
+ Help
+
+
+ false
+
+
+
+
+
+
+
+
+ true
+
+
+ Open File...
+
+
+
+
+ Exit
+
+
+
+
+ Print
+
+
+
+
+ Help
+
+
+
+
+ Save
+
+
+
+
+ Exit
+
+
+
+
+
+ QVTKWidget
+ QWidget
+ QVTKWidget.h
+
+
+
+
+
diff -Nru opencamlib-11.10+git201801200005~ubuntu16.04.1/examples/nodejs/adaptivewaterline.js opencamlib-11.10-1/examples/nodejs/adaptivewaterline.js
--- opencamlib-11.10+git201801200005~ubuntu16.04.1/examples/nodejs/adaptivewaterline.js 1970-01-01 00:00:00.000000000 +0000
+++ opencamlib-11.10-1/examples/nodejs/adaptivewaterline.js 2020-06-14 12:13:19.000000000 +0000
@@ -0,0 +1,23 @@
+const ocl = require('../..')
+const {
+ STLSurf,
+ STLReader,
+ CylCutter,
+ AdaptiveWaterline
+} = ocl
+
+const surface = new STLSurf()
+new STLReader(__dirname + '/../../stl/gnu_tux_mod.stl', surface)
+const cutter = new CylCutter(4, 20)
+const awl = new AdaptiveWaterline()
+awl.setSTL(surface)
+awl.setCutter(cutter)
+awl.setSampling(0.1)
+awl.setMinSampling(0.001)
+awl.setZ(1)
+awl.run()
+awl.getLoops().forEach(function (loop) {
+ loop.forEach(function (point) {
+ console.log('G01 X' + point[0] + ' Y' + point[1] + ' Z' + point[2])
+ })
+})
\ No newline at end of file
diff -Nru opencamlib-11.10+git201801200005~ubuntu16.04.1/examples/nodejs/parallel_finish_zig.js opencamlib-11.10-1/examples/nodejs/parallel_finish_zig.js
--- opencamlib-11.10+git201801200005~ubuntu16.04.1/examples/nodejs/parallel_finish_zig.js 1970-01-01 00:00:00.000000000 +0000
+++ opencamlib-11.10-1/examples/nodejs/parallel_finish_zig.js 2020-06-14 12:13:19.000000000 +0000
@@ -0,0 +1,99 @@
+const ocl = require('../..')
+const {
+ STLSurf,
+ STLReader,
+ CylCutter,
+ BallCutter,
+ BullCutter,
+ ConeCutter,
+ AdaptivePathDropCutter,
+ Path,
+ Line,
+ Point
+} = ocl
+
+function assert(condition, message) {
+ if (!condition) {
+ throw message || "Assertion failed";
+ }
+}
+
+// create a simple "Zig" pattern where we cut only in one direction.
+// the first line is at ymin
+// the last line is at ymax
+function YdirectionZigPath(xmin, xmax, ymin, ymax, Ny) {
+ const paths = []
+ const dy = (ymax - ymin) / (Ny - 1) // the y step-over
+ for (let n = 0; n < Ny; n++) {
+ const path = new Path()
+ const y = ymin + n * dy // current y-coordinate
+ if (n === Ny - 1) {
+ assert(y == ymax)
+ } else if (n === 0) {
+ assert(y == ymin)
+ }
+ const p1 = new Point(xmin, y, 0) // start-point of line
+ const p2 = new Point(xmax, y, 0) // end-point of line
+ const l = new Line(p1, p2) // line-object
+ path.append(l) // add the line to the path
+ paths.push(path)
+ }
+ return paths
+}
+
+// run the actual drop-cutter algorithm
+function adaptivePathDropCutter(surface, cutter, paths) {
+ const apdc = new AdaptivePathDropCutter()
+ apdc.setSTL(surface)
+ apdc.setCutter(cutter)
+ // maximum sampling or "step-forward" distance
+ // should be set so that we don't loose any detail of the STL model
+ // i.e. this number should be similar or smaller than the smallest triangle
+ apdc.setSampling(0.04)
+ // minimum sampling or step-forward distance
+ // the algorithm subdivides "steep" portions of the toolpath
+ // until we reach this limit.
+ apdc.setMinSampling(0.01)
+ let cl_paths = []
+ paths.forEach(function (path) {
+ apdc.setPath(path)
+ apdc.run()
+ cl_points = apdc.getCLPoints()
+ cl_paths.push(cl_points)
+ })
+ return cl_paths
+}
+
+const surface = new STLSurf()
+new STLReader(__dirname + '/../../stl/gnu_tux_mod.stl', surface)
+// choose a cutter for the operation:
+// http://www.anderswallin.net/2011/08/opencamlib-cutter-shapes/
+const diameter = 0.25
+const length = 5
+// const cutter = new BallCutter(diameter, length)
+// const cutter = new CylCutter(diameter, length)
+// const corner_radius = 0.05
+// const cutter = new BullCutter(diameter, corner_radius, length)
+const angle = Math.PI / 4
+const cutter = new ConeCutter(diameter, angle, length)
+// const cutter = cutter.offsetCutter(0.4)
+
+// toolpath is contained in this simple box
+const ymin = 0
+const ymax = 12
+const xmin = 0
+const xmax = 10
+const Ny = 40 // number of lines in the y-direction
+
+const paths = YdirectionZigPath(xmin, xmax, ymin, ymax, Ny)
+
+// now project onto the STL surface
+const toolpaths = adaptivePathDropCutter(surface, cutter, paths)
+toolpaths.forEach(function (points) {
+ console.log('G00 X' + Math.round(points[0][0] * 10000) / 10000 + ' Y' + Math.round(points[0][1] * 10000) / 10000)
+ console.log('G01 Z' + Math.round(points[0][2] * 10000) / 10000)
+ points.forEach(function (point) {
+ console.log('G01 X' + Math.round(point[0] * 10000) / 10000 + ' Y' + Math.round(point[1] * 10000) / 10000 + ' Z' + Math.round(point[2] * 10000) / 10000)
+ })
+ console.log('G00 Z3')
+})
diff -Nru opencamlib-11.10+git201801200005~ubuntu16.04.1/examples/nodejs/test.js opencamlib-11.10-1/examples/nodejs/test.js
--- opencamlib-11.10+git201801200005~ubuntu16.04.1/examples/nodejs/test.js 1970-01-01 00:00:00.000000000 +0000
+++ opencamlib-11.10-1/examples/nodejs/test.js 2020-06-14 12:13:19.000000000 +0000
@@ -0,0 +1,21 @@
+const {
+ STLSurf,
+ STLReader,
+ CylCutter,
+ Waterline
+} = require('../..')
+
+const surface = new STLSurf()
+new STLReader(__dirname + '/../../stl/gnu_tux_mod.stl', surface)
+const cutter = new CylCutter(4, 20)
+const wl = new Waterline()
+wl.setSTL(surface)
+wl.setCutter(cutter)
+wl.setZ(1)
+wl.setSampling(0.1)
+wl.run()
+wl.getLoops().forEach(function (loop) {
+ loop.forEach(function (point) {
+ console.log('G01 X' + point[0] + ' Y' + point[1] + ' Z' + point[2])
+ })
+})
\ No newline at end of file
diff -Nru opencamlib-11.10+git201801200005~ubuntu16.04.1/examples/python/clsurf_1.py opencamlib-11.10-1/examples/python/clsurf_1.py
--- opencamlib-11.10+git201801200005~ubuntu16.04.1/examples/python/clsurf_1.py 1970-01-01 00:00:00.000000000 +0000
+++ opencamlib-11.10-1/examples/python/clsurf_1.py 2020-06-14 12:13:19.000000000 +0000
@@ -0,0 +1,93 @@
+import ocl
+import camvtk
+import time
+import vtk
+import datetime
+import math
+import random
+
+def drawVertex(myscreen, p, vertexColor, rad=0.1):
+ myscreen.addActor( camvtk.Sphere( center=(p.x,p.y,p.z), radius=rad, color=vertexColor ) )
+
+def drawEdge(myscreen, e, edgeColor=camvtk.yellow):
+ p1 = e[0]
+ p2 = e[1]
+ myscreen.addActor( camvtk.Line( p1=( p1.x,p1.y,p1.z), p2=(p2.x,p2.y,p2.z), color=edgeColor ) )
+
+#def drawFarCircle(myscreen, r, circleColor):
+# myscreen.addActor( camvtk.Circle( center=(0,0,0), radius=r, color=circleColor ) )
+
+def drawDiagram( myscreen, diag ):
+ #drawFarCircle(myscreen, vd.getFarRadius(), camvtk.pink)
+ for v in diag.getVertices():
+ drawVertex(myscreen, v, camvtk.green)
+ edges = diag.getEdges()
+ for e in edges:
+ drawEdge(myscreen,e, camvtk.cyan)
+
+def writeFrame( w2if, lwr, n ):
+ w2if.Modified()
+ lwr.SetFileName("frames/vd500_zoomout"+ ('%05d' % n)+".png")
+ lwr.Write()
+
+if __name__ == "__main__":
+ print(ocl.version())
+ myscreen = camvtk.VTKScreen()
+
+
+ camvtk.drawOCLtext(myscreen)
+
+ #w2if = vtk.vtkWindowToImageFilter()
+ #w2if.SetInput(myscreen.renWin)
+ #lwr = vtk.vtkPNGWriter()
+ #lwr.SetInput( w2if.GetOutput() )
+ #w2if.Modified()
+ #lwr.SetFileName("tux1.png")
+
+# SURFACE
+
+ #stl = camvtk.STLSurf("../stl/Cylinder_1.stl")
+ #stl = camvtk.STLSurf("../stl/gnu_tux_mod.stl")
+ stl = camvtk.STLSurf("../stl/demo.stl")
+ myscreen.addActor(stl)
+ stl.SetWireframe()
+ stl.SetColor((0.5,0.5,0.5))
+
+ polydata = stl.src.GetOutput()
+ s = ocl.STLSurf()
+ camvtk.vtkPolyData2OCLSTL(polydata, s)
+ print("STL surface read,", s.size(), "triangles")
+
+
+ far = 20
+ # far = 0.000002 generator 52 face_count crash
+ # far = 0.000010 crashes at n=192
+
+ camPos = 2* far
+ myscreen.camera.SetPosition(camPos/1000, camPos/1000, camPos)
+ myscreen.camera.SetClippingRange(-2*camPos,2*camPos)
+ myscreen.camera.SetFocalPoint(0.051, 0, 0)
+
+ cls = ocl.CutterLocationSurface(10)
+
+ cutter = ocl.BallCutter(2,10)
+ cls.setCutter(cutter)
+ cls.setSampling(1)
+ cls.setMinSampling(0.1)
+ cls.setSTL(s)
+
+ drawDiagram(myscreen, cls)
+ #vd = ocl.VoronoiDiagram(far,1200)
+
+ #vod = VD(myscreen,vd,scale)
+ #vod.setAll(vd)
+ #drawFarCircle(myscreen, scale*vd.getFarRadius(), camvtk.orange)
+
+
+
+ print("PYTHON All DONE.")
+
+
+
+ myscreen.render()
+ myscreen.iren.Start()
diff -Nru opencamlib-11.10+git201801200005~ubuntu16.04.1/examples/python/cutter_shapes.py opencamlib-11.10-1/examples/python/cutter_shapes.py
--- opencamlib-11.10+git201801200005~ubuntu16.04.1/examples/python/cutter_shapes.py 1970-01-01 00:00:00.000000000 +0000
+++ opencamlib-11.10-1/examples/python/cutter_shapes.py 2020-06-14 12:13:19.000000000 +0000
@@ -0,0 +1,165 @@
+import ocl
+import camvtk
+import time
+import vtk
+import datetime
+import math
+
+def drawLoops(myscreen, loops, loopcolor):
+ nloop = 0
+ for lop in loops:
+ n = 0
+ N = len(lop)
+ first_point=ocl.Point(-1,-1,5)
+ previous=ocl.Point(-1,-1,5)
+ for p in lop:
+ if n==0: # don't draw anything on the first iteration
+ previous=p
+ first_point = p
+ elif n== (N-1): # the last point
+ myscreen.addActor( camvtk.Line(p1=(previous.x,previous.y,previous.z),p2=(p.x,p.y,p.z),color=loopcolor) ) # the normal line
+ # and a line from p to the first point
+ myscreen.addActor( camvtk.Line(p1=(p.x,p.y,p.z),p2=(first_point.x,first_point.y,first_point.z),color=loopcolor) )
+ else:
+ myscreen.addActor( camvtk.Line(p1=(previous.x,previous.y,previous.z),p2=(p.x,p.y,p.z),color=loopcolor) )
+ previous=p
+ n=n+1
+ print("rendered loop ",nloop, " with ", len(lop), " points")
+ nloop = nloop+1
+
+def getWaterline(s, cutter, zh, sampling):
+ wl = ocl.Waterline()
+ #wl.setThreads(1) # single thread for easier debug
+ wl.setSTL(s)
+ wl.setCutter(cutter)
+ wl.setZ(zh)
+ wl.setSampling(sampling)
+ wl.run()
+ loops = wl.getLoops()
+ return loops
+
+def getPathsY(s,cutter,sampling,y):
+ #apdc = ocl.PathDropCutter()
+ apdc = ocl.AdaptivePathDropCutter()
+ apdc.setSTL(s)
+ apdc.setCutter(cutter)
+ apdc.setZ( -20 )
+ apdc.setSampling(sampling)
+ apdc.setMinSampling(sampling/700)
+ path = ocl.Path()
+ p1 = ocl.Point(-1.52*cutter.getDiameter() , y,-111) # start-point of line
+ p2 = ocl.Point(+1.52*cutter.getDiameter(), y,-111) # end-point of line
+ l = ocl.Line(p1,p2) # line-object
+ path.append( l )
+ apdc.setPath( path )
+ apdc.run()
+ return apdc.getCLPoints()
+
+def getPathsX(s,cutter,sampling,x):
+ #apdc = ocl.PathDropCutter()
+ apdc = ocl.AdaptivePathDropCutter()
+ apdc.setSTL(s)
+ apdc.setCutter(cutter)
+ apdc.setZ( -20 )
+ apdc.setSampling(sampling)
+ apdc.setMinSampling(sampling/700)
+ path = ocl.Path()
+ p1 = ocl.Point(x, -1.52*cutter.getDiameter() , -111) # start-point of line
+ p2 = ocl.Point(x, +1.52*cutter.getDiameter(), -111) # end-point of line
+ l = ocl.Line(p1,p2) # line-object
+ path.append( l )
+ apdc.setPath( path )
+ apdc.run()
+ return apdc.getCLPoints()
+
+if __name__ == "__main__":
+ print(ocl.version()) # revision()
+ myscreen = camvtk.VTKScreen()
+ #stl = camvtk.STLSurf("../stl/demo.stl")
+ #stl = camvtk.STLSurf("../stl/30sphere.stl")
+ #myscreen.addActor(stl)
+
+ base=0.1
+ tip=10
+ a=ocl.Point(base,0,-tip)
+ myscreen.addActor(camvtk.Point(center=(a.x,a.y,a.z), color=(1,0,1)));
+ b=ocl.Point(-base,0,-tip)
+ myscreen.addActor(camvtk.Point(center=(b.x,b.y,b.z), color=(1,0,1)));
+ c=ocl.Point(0,0,0)
+ myscreen.addActor( camvtk.Point(center=(c.x,c.y,c.z), color=(1,0,1)));
+ #myscreen.addActor( camvtk.Line(p1=(1,0,0),p2=(0,0,0.3)) )
+ #myscreen.addActor( camvtk.Line(p1=(0,0,0.3),p2=(0,1,0)) )
+ #myscreen.addActor( camvtk.Line(p1=(1,0,0),p2=(0,1,0)) )
+ t = ocl.Triangle(a,b,c)
+ s = ocl.STLSurf()
+ s.addTriangle(t)
+
+ print("STL surface read,", s.size(), "triangles")
+
+ Nwaterlines = 40
+ zh=[-0.15*x for x in range(Nwaterlines)]
+ #zh=[15]
+ diam = 3.01
+ length = 50
+ loops = []
+ sampling = 0.1
+
+ #cutter = ocl.CylCutter( diam , length )
+ #cutter = ocl.BallCutter( diam , length )
+ #cutter = ocl.BullCutter( diam , diam/5, length )
+ #cutter = ocl.ConeCutter(diam, math.pi/3, length)
+ #cutter = ocl.CylConeCutter(diam/float(3),diam,math.pi/float(9))
+ #cutter = ocl.BallConeCutter(diam/float(2.3),diam,math.pi/float(5))
+ #cutter = ocl.BullConeCutter(diam/1.5, diam/10, diam, math.pi/10)
+ cutter = ocl.ConeConeCutter(diam/2,math.pi/3,diam,math.pi/6)
+
+ print(cutter)
+ #raw_input("Press Enter to terminate")
+
+ ptsy_all = []
+ ptsx_all = []
+ yvals=[]
+ Nmax=15
+ for i in range(Nmax):
+ yvals.append( diam* float(i)/float(Nmax) )
+ yvals.append( -diam* float(i)/float(Nmax) )
+
+ for y in yvals: #[diam*0.4, diam*0.2, 0, -diam*0.2,diam*(-0.4)]:
+ ptsy = getPathsY(s,cutter,sampling, y)
+ ptsx = getPathsX(s,cutter,sampling, y)
+ ptsy_all.append(ptsy)
+ ptsx_all.append(ptsx)
+
+ #print " got ",len(pts)," cl-points"
+ #for p in pts:
+ # print(p.x," ",p.y," ",p.z)
+ #exit()
+
+ loops = []
+ for z in zh:
+
+ z_loops = getWaterline(s, cutter, z, sampling)
+ for l in z_loops:
+ loops.append(l)
+
+
+ #for l in line:
+
+ #drawLoops(myscreen, line, camvtk.cyan)
+ #for l in cutter_loops:
+ # loops.append(l)
+
+ print("All waterlines done. Got", len(loops)," loops in total.")
+ # draw the loops
+ drawLoops(myscreen, loops, camvtk.cyan)
+ drawLoops(myscreen, ptsy_all, camvtk.pink)
+ drawLoops(myscreen, ptsx_all, camvtk.lblue)
+
+ print("done.")
+ myscreen.camera.SetPosition(15, 13, 7)
+ myscreen.camera.SetFocalPoint(5, 5, 0)
+ camvtk.drawArrows(myscreen,center=(0,0,3))
+ camvtk.drawOCLtext(myscreen)
+ myscreen.render()
+ myscreen.iren.Start()
+ #raw_input("Press Enter to terminate")
diff -Nru opencamlib-11.10+git201801200005~ubuntu16.04.1/examples/python/drop-cutter/batchdropcutter_mtrush.py opencamlib-11.10-1/examples/python/drop-cutter/batchdropcutter_mtrush.py
--- opencamlib-11.10+git201801200005~ubuntu16.04.1/examples/python/drop-cutter/batchdropcutter_mtrush.py 1970-01-01 00:00:00.000000000 +0000
+++ opencamlib-11.10-1/examples/python/drop-cutter/batchdropcutter_mtrush.py 2020-06-14 12:13:19.000000000 +0000
@@ -0,0 +1,97 @@
+import ocl
+import pyocl
+import camvtk
+import time
+import vtk
+import datetime
+import math
+
+if __name__ == "__main__":
+ print(ocl.version())
+ myscreen = camvtk.VTKScreen()
+
+ #stl = camvtk.STLSurf("../stl/gnu_tux_mod.stl")
+ stl = camvtk.STLSurf("../stl/mount_rush.stl")
+ #stl = camvtk.STLSurf("../stl/pycam-textbox.stl")
+ myscreen.addActor(stl)
+ stl.SetWireframe()
+ stl.SetColor((0.5,0.5,0.5))
+
+ polydata = stl.src.GetOutput()
+ s = ocl.STLSurf()
+ camvtk.vtkPolyData2OCLSTL(polydata, s)
+ print("STL surface with", s.size(), "triangles read")
+
+ # define a cutter
+ length=5
+ cutter = ocl.BallCutter(15.4321, length)
+ #cutter = ocl.CylCutter(1.123, length)
+ #cutter = ocl.BullCutter(1.123, 0.2, length)
+ #cutter = ocl.ConeCutter(0.43, math.pi/7, length)
+
+
+ print(cutter)
+
+ #define grid of CL-points
+ minx=-42
+ dx=0.5
+ maxx=47
+ miny=-27
+ dy=0.2
+ maxy=20
+ z=-55
+ clpoints = pyocl.CLPointGrid(minx,dx,maxx,miny,dy,maxy,z)
+ print("generated grid with", len(clpoints)," CL-points")
+
+ # batchdropcutter
+ bdc1 = ocl.BatchDropCutter()
+ bdc1.setSTL(s)
+ bdc1.setCutter(cutter)
+
+ # push the points to ocl
+ for p in clpoints:
+ bdc1.appendPoint(p)
+
+ # run the actual calculation
+ t_before = time.time()
+ bdc1.run()
+ t_after = time.time()
+ calctime = t_after-t_before
+ print(" done in ", calctime," s" )
+
+
+ # get back results from ocl
+ clpts = bdc1.getCLPoints()
+
+
+ # draw the results
+ print("rendering...",)
+ camvtk.drawCLPointCloud(myscreen, clpts)
+ print("done")
+
+ myscreen.camera.SetPosition(25, 23, 15)
+ myscreen.camera.SetFocalPoint(4, 5, 0)
+
+ # ocl text
+ t = camvtk.Text()
+ t.SetText("OpenCAMLib")
+ t.SetPos( (myscreen.width-200, myscreen.height-30) )
+ myscreen.addActor( t)
+
+ # other text
+ t2 = camvtk.Text()
+ stltext = "%i triangles\n%i CL-points\n%0.1f seconds" % (s.size(), len(clpts), calctime)
+ t2.SetText(stltext)
+ t2.SetPos( (50, myscreen.height-100) )
+ myscreen.addActor( t2)
+
+ t3 = camvtk.Text()
+ ctext = "Cutter: %s" % ( str(cutter) )
+
+ t3.SetText(ctext)
+ t3.SetPos( (50, myscreen.height-150) )
+ myscreen.addActor( t3)
+
+ myscreen.render()
+ myscreen.iren.Start()
+ raw_input("Press Enter to terminate")
diff -Nru opencamlib-11.10+git201801200005~ubuntu16.04.1/examples/python/drop-cutter/batchdropcutter_test_1.py opencamlib-11.10-1/examples/python/drop-cutter/batchdropcutter_test_1.py
--- opencamlib-11.10+git201801200005~ubuntu16.04.1/examples/python/drop-cutter/batchdropcutter_test_1.py 1970-01-01 00:00:00.000000000 +0000
+++ opencamlib-11.10-1/examples/python/drop-cutter/batchdropcutter_test_1.py 2020-06-14 12:13:19.000000000 +0000
@@ -0,0 +1,99 @@
+import ocl
+import pyocl
+import camvtk
+import time
+import vtk
+import datetime
+
+
+
+if __name__ == "__main__":
+ print(ocl.version() )
+ myscreen = camvtk.VTKScreen()
+
+ #stl = camvtk.STLSurf("../stl/gnu_tux_mod.stl")
+ stl = camvtk.STLSurf("../../stl/demo.stl")
+ myscreen.addActor(stl)
+ stl.SetWireframe()
+ stl.SetColor((0.5,0.5,0.5))
+
+ polydata = stl.src.GetOutput()
+ s = ocl.STLSurf()
+ camvtk.vtkPolyData2OCLSTL(polydata, s)
+ print("STL surface read,", s.size(), "triangles")
+ length=5
+ cutter = ocl.BallCutter(1.4321, length)
+ #cutter = ocl.CylCutter(1.123, length)
+ #cutter = ocl.BullCutter(1.123, 0.2, length)
+ print(cutter)
+
+ minx=0
+ dx=0.1/6
+ maxx=10
+ miny=0
+ dy=1
+ maxy=10
+ z=-17
+ # this generates a list of CL-points in a grid
+ clpoints = pyocl.CLPointGrid(minx,dx,maxx,miny,dy,maxy,z)
+ print("generated grid with", len(clpoints)," CL-points")
+
+ # batchdropcutter
+ bdc1 = ocl.BatchDropCutter()
+ bdc1.setSTL(s)
+ bdc1.setCutter(cutter)
+ for p in clpoints:
+ bdc1.appendPoint(p)
+
+ t_before = time.time()
+ print("threads=",bdc1.getThreads())
+ bdc1.run()
+ t_after = time.time()
+ calctime = t_after-t_before
+ print(" done in ", calctime," s")
+
+ clpoints = bdc1.getCLPoints()
+
+ print(len(clpoints), " cl points evaluated")
+
+ print("rendering...",)
+
+ # draw the CL-points
+ camvtk.drawCLPointCloud(myscreen, clpoints)
+
+ print("done")
+
+ myscreen.camera.SetPosition(3, 23, 15)
+ myscreen.camera.SetFocalPoint(4, 5, 0)
+
+
+ #w2if = vtk.vtkWindowToImageFilter()
+ #w2if.SetInput(myscreen.renWin)
+ #lwr = vtk.vtkPNGWriter()
+ #lwr.SetInput( w2if.GetOutput() )
+ #w2if.Modified()
+ #lwr.SetFileName("tux1.png")
+ #lwr.Write()
+
+ t = camvtk.Text()
+ t.SetText("OpenCAMLib")
+ t.SetPos( (myscreen.width-200, myscreen.height-30) )
+ myscreen.addActor( t)
+
+ t2 = camvtk.Text()
+ stltext = "%i triangles\n%i CL-points\n%0.1f seconds" % (s.size(), len(clpoints), calctime)
+ t2.SetText(stltext)
+ t2.SetPos( (50, myscreen.height-200) )
+ myscreen.addActor( t2)
+
+ t3 = camvtk.Text()
+ ctext = "Cutter: %s" % ( str(cutter) )
+
+ t3.SetText(ctext)
+ t3.SetPos( (50, myscreen.height-250) )
+ myscreen.addActor( t3)
+
+ myscreen.render()
+ myscreen.iren.Start()
+ raw_input("Press Enter to terminate")
+
diff -Nru opencamlib-11.10+git201801200005~ubuntu16.04.1/examples/python/drop-cutter/batchdropcutter_test_2.py opencamlib-11.10-1/examples/python/drop-cutter/batchdropcutter_test_2.py
--- opencamlib-11.10+git201801200005~ubuntu16.04.1/examples/python/drop-cutter/batchdropcutter_test_2.py 1970-01-01 00:00:00.000000000 +0000
+++ opencamlib-11.10-1/examples/python/drop-cutter/batchdropcutter_test_2.py 2020-06-14 12:13:19.000000000 +0000
@@ -0,0 +1,82 @@
+import ocl
+import pyocl
+import camvtk
+import time
+import vtk
+import datetime
+import math
+
+if __name__ == "__main__":
+ print(ocl.version())
+ myscreen = camvtk.VTKScreen()
+ stl = camvtk.STLSurf("../../stl/gnu_tux_mod.stl")
+ #stl = camvtk.STLSurf("../stl/beet_mm.stl")
+ #stl = camvtk.STLSurf("../stl/Blade.stl")
+ myscreen.addActor(stl)
+ stl.SetWireframe()
+ stl.SetColor((0.5,0.5,0.5))
+
+ polydata = stl.src.GetOutput()
+ s = ocl.STLSurf()
+ camvtk.vtkPolyData2OCLSTL(polydata, s)
+ print("STL surface read ", s.size(), " triangles")
+ length=5
+ cutter = ocl.BallCutter(1.4321, length)
+ #cutter = ocl.CylCutter(1.123, length)
+ #cutter = ocl.BullCutter(1.4123, 0.5, length)
+ #cutter = ocl.ConeCutter(0.43, math.pi/7, length)
+ print(cutter)
+
+ minx=0
+ dx=0.06
+ maxx=9
+ miny=0
+ dy=1
+ maxy=12
+ z=-5
+ clpoints = pyocl.CLPointGrid(minx,dx,maxx,miny,dy,maxy,z)
+ print("generated grid with", len(clpoints)," CL-points")
+
+ # batchdropcutter
+ bdc1 = ocl.BatchDropCutter()
+ bdc1.setSTL(s)
+ bdc1.setCutter(cutter)
+
+ for p in clpoints:
+ bdc1.appendPoint(p)
+
+ t_before = time.time()
+ bdc1.run()
+ t_after = time.time()
+ calctime = t_after-t_before
+ print(" done in ", calctime," s" )
+
+ clpts = bdc1.getCLPoints()
+ print("rendering...",)
+ camvtk.drawCLPointCloud(myscreen, clpts)
+ print("done")
+
+ myscreen.camera.SetPosition(3, 23, 15)
+ myscreen.camera.SetFocalPoint(4, 5, 0)
+
+ t = camvtk.Text()
+ t.SetText("OpenCAMLib")
+ t.SetPos( (myscreen.width-200, myscreen.height-30) )
+ myscreen.addActor( t)
+
+ t2 = camvtk.Text()
+ stltext = "%i triangles\n%i CL-points\n%0.1f seconds" % (s.size(), len(clpts), calctime)
+ t2.SetText(stltext)
+ t2.SetPos( (50, myscreen.height-200) )
+ myscreen.addActor( t2)
+
+ t3 = camvtk.Text()
+ ctext = "Cutter: %s" % ( str(cutter) )
+
+ t3.SetText(ctext)
+ t3.SetPos( (50, myscreen.height-250) )
+ myscreen.addActor( t3)
+
+ myscreen.render()
+ myscreen.iren.Start()
+ raw_input("Press Enter to terminate")
diff -Nru opencamlib-11.10+git201801200005~ubuntu16.04.1/examples/python/drop-cutter/batchdropcutter_with_linefilter_test_1.py opencamlib-11.10-1/examples/python/drop-cutter/batchdropcutter_with_linefilter_test_1.py
--- opencamlib-11.10+git201801200005~ubuntu16.04.1/examples/python/drop-cutter/batchdropcutter_with_linefilter_test_1.py 1970-01-01 00:00:00.000000000 +0000
+++ opencamlib-11.10-1/examples/python/drop-cutter/batchdropcutter_with_linefilter_test_1.py 2020-06-14 12:13:19.000000000 +0000
@@ -0,0 +1,127 @@
+import ocl
+import pyocl
+import camvtk
+import time
+import vtk
+import datetime
+import math
+
+if __name__ == "__main__":
+ print(ocl.version() )
+ myscreen = camvtk.VTKScreen()
+ #stl = camvtk.STLSurf("../stl/Cylinder_1.stl")
+ stl = camvtk.STLSurf("../../stl/gnu_tux_mod.stl")
+ #stl = camvtk.STLSurf("../stl/demo.stl")
+ myscreen.addActor(stl)
+ stl.SetWireframe()
+ stl.SetColor((0.5,0.5,0.5))
+
+ polydata = stl.src.GetOutput()
+ s = ocl.STLSurf()
+ camvtk.vtkPolyData2OCLSTL(polydata, s)
+ print("STL surface read,", s.size(), "triangles")
+
+ angle = math.pi/4
+ diameter=1.77321
+ length=5
+ #cutter = ocl.BallCutter(diameter, length)
+ cutter = ocl.CylCutter(diameter, length)
+ #cutter = ocl.BullCutter(diameter, 0.2, length)
+ #cutter = ocl.ConeCutter(diameter, angle, length)
+ #cutter = cutter.offsetCutter( 0.4 )
+
+ print(cutter)
+
+ minx=-1
+ dx=0.1/5
+
+ maxx=10
+ miny=-1
+ dy=1/float(2)
+ maxy=13
+ z=-1
+ # this generates a list of CL-points in a grid
+ clpoints = pyocl.CLPointGrid(minx,dx,maxx,miny,dy,maxy,z)
+ print("generated grid with", len(clpoints)," CL-points")
+
+ # batchdropcutter
+ bdc = ocl.BatchDropCutter()
+ #bdc.setThreads(1)
+ print("bdc()")
+ bdc.setBucketSize(2)
+ print("bucketSize")
+ bdc.setSTL(s)
+ print("setSTL()")
+ bdc.setCutter(cutter)
+ print("setCutter()")
+ #bdc.setThreads(1) # explicitly setting one thread is better for debugging
+ for p in clpoints:
+ bdc.appendPoint(p)
+ print("bdc has ",len(clpoints)," cl-points")
+
+ t_before = time.time()
+ bdc.run() # run the actual drop-cutter
+ dc_calls = bdc.getCalls()
+ t_after = time.time()
+ calctime = t_after-t_before
+ print(" BDC done in ", calctime," s", dc_calls," dc-calls" )
+ dropcutter_time = calctime
+ clpoints = bdc.getCLPoints()
+
+ #print len(clpoints), " cl points evaluated"
+
+ print("rendering raw CL-points.")
+
+ # draw the CL-points
+ camvtk.drawCLPointCloud(myscreen, clpoints)
+
+ # filter
+ print("filtering. before filter we have", len(clpoints),"cl-points")
+ t_before = time.time()
+ f = ocl.LineCLFilter()
+ f.setTolerance(0.001)
+ for p in clpoints:
+ f.addCLPoint(p)
+ f.run()
+ t_after = time.time()
+ calctime = t_after-t_before
+ print(" done in ", calctime," s")
+
+ clp2 = f.getCLPoints()
+ print("after filtering we have", len(clp2),"cl-points")
+
+ # draw the filtered points
+ # offset these points up for clarity
+ for p in clp2:
+ p.z=p.z+3
+
+ print("rendering filtered CL-points.")
+ camvtk.drawCLPointCloud(myscreen, clp2)
+ print("all done.")
+ myscreen.camera.SetPosition(3, 23, 15)
+ myscreen.camera.SetFocalPoint(4, 5, 0)
+
+ #w2if = vtk.vtkWindowToImageFilter()
+ #w2if.SetInput(myscreen.renWin)
+ #lwr = vtk.vtkPNGWriter()
+ #lwr.SetInput( w2if.GetOutput() )
+ #w2if.Modified()
+ #lwr.SetFileName("tux1.png")
+ #lwr.Write()
+
+ t = camvtk.Text()
+ t.SetText("OpenCAMLib")
+ t.SetPos( (myscreen.width-200, myscreen.height-30) )
+ myscreen.addActor( t)
+
+ t2 = camvtk.Text()
+ stltext = "%s\n%i triangles\n%i CL-points\n%i DropCutter() calls\n%0.1f seconds\n%0.3f us/call\n%i filtered CL-points" \
+ % ( str(cutter), s.size(), len(clpoints), dc_calls, dropcutter_time, 1e6* dropcutter_time/dc_calls, len(clp2) )
+ t2.SetText(stltext)
+ t2.SetPos( (50, myscreen.height-200) )
+ myscreen.addActor( t2)
+
+ myscreen.render()
+ myscreen.iren.Start()
+ raw_input("Press Enter to terminate")
+
diff -Nru opencamlib-11.10+git201801200005~ubuntu16.04.1/examples/python/drop-cutter/drop_cutter_one-triangle_1.py opencamlib-11.10-1/examples/python/drop-cutter/drop_cutter_one-triangle_1.py
--- opencamlib-11.10+git201801200005~ubuntu16.04.1/examples/python/drop-cutter/drop_cutter_one-triangle_1.py 1970-01-01 00:00:00.000000000 +0000
+++ opencamlib-11.10-1/examples/python/drop-cutter/drop_cutter_one-triangle_1.py 2020-06-14 12:13:19.000000000 +0000
@@ -0,0 +1,104 @@
+import ocl
+import pyocl
+import camvtk
+import vtk
+import math
+
+if __name__ == "__main__":
+ print(ocl.version()) # print out git version tag
+
+ # set up VTK visualization
+ myscreen = camvtk.VTKScreen()
+ myscreen.setAmbient(20,20,20)
+ myscreen.camera.SetPosition(4, 4, 3)
+ myscreen.camera.SetFocalPoint(0.6, 0.6, 0)
+ myscreen.setAmbient(1,1,1)
+
+ #camvtk.drawArrows(myscreen)
+
+ # three corners of a triangle
+ a = ocl.Point(1,0,-0.000010)
+ b = ocl.Point(0,1,+0.0)
+ c = ocl.Point(0.001,0,+0.3001)
+ #c = ocl.Point(0,0,0.3)
+ t = ocl.Triangle(a,b,c)
+
+ # draw the triangle with VTK
+ myscreen.addActor( camvtk.Point(center=(a.x,a.y,a.z), color=(1,0,1)));
+ myscreen.addActor( camvtk.Point(center=(b.x,b.y,b.z), color=(1,0,1)));
+ myscreen.addActor( camvtk.Point(center=(c.x,c.y,c.z), color=(1,0,1)));
+ myscreen.addActor( camvtk.Line(p1=(a.x,a.y,a.z),p2=(c.x,c.y,c.z)) )
+ myscreen.addActor( camvtk.Line(p1=(c.x,c.y,c.z),p2=(b.x,b.y,b.z)) )
+ myscreen.addActor( camvtk.Line(p1=(a.x,a.y,a.z),p2=(b.x,b.y,b.z)) )
+
+ # Define a cutter
+ angle = math.pi/8
+ length = 5.0
+ #c1 = ocl.BullCutter(0.5,0.1, length)
+ #c1 = ocl.CylCutter(0.5, length)
+ #c1 = ocl.BallCutter(0.5, length)
+ c1 = ocl.ConeCutter(0.5,angle, length)
+ cutter = c1
+ cutter = c1.offsetCutter(0.1)
+
+ print(cutter)
+
+
+ # grid parameters
+ minx=-0.7
+ dx=0.03
+ maxx=1.7
+ miny=-0.7
+ dy=0.03
+ maxy=1.7
+ z=-0.5
+ # generate list of CL-poins at height z
+ clpoints=[]
+ # we calculate cutter-locations for this grid of XY points
+ clpoints = pyocl.CLPointGrid(minx,dx,maxx,miny,dy,maxy,z)
+
+ # loop through the cl-points
+ n=0
+ print(len(clpoints), "cl-points to evaluate")
+ for cl in clpoints:
+ cutter.vertexDrop(cl,t)
+ cutter.edgeDrop(cl,t)
+ cutter.facetDrop(cl,t)
+ n=n+1
+ print("drop-cutter done.")
+ # cl has now been updated so it is a valid cutter-location point
+ # drop-cutter only updates the z-coordinate of cl, x/y are not changed.
+
+ print("rendering...",)
+ # render all the points
+ camvtk.drawCLPointCloud(myscreen, clpoints)
+ camvtk.drawCCPoints(myscreen, clpoints)
+ print("done." )
+
+ tx = camvtk.Text()
+ tx.SetPos( (myscreen.width-200, myscreen.height-130) )
+ tx.SetText("opencamlib\ndrop-cutter")
+ myscreen.addActor( tx )
+
+ #w2if = vtk.vtkWindowToImageFilter()
+ #w2if.SetInput(myscreen.renWin)
+ #lwr = vtk.vtkPNGWriter()
+ #lwr.SetInput( w2if.GetOutput() )
+ #w2if.Modified()
+
+
+ # animate by rotating the camera
+ """
+ for n in range(1,90):
+ tx.SetText(datetime.datetime.now().strftime("%Y-%m-%d %H:%M:%S"))
+ myscreen.camera.Azimuth( 4 )
+ #time.sleep(0.01)
+ myscreen.render()
+ lwr.SetFileName("frames/ball_all"+ ('%05d' % n)+".png")
+ w2if.Modified()
+ #lwr.Write() # write screenshot to file
+ """
+ myscreen.render()
+ myscreen.iren.Start()
+ raw_input("Press Enter to terminate")
+
diff -Nru opencamlib-11.10+git201801200005~ubuntu16.04.1/examples/python/drop-cutter/drop_cutter_one-triangle_2.py opencamlib-11.10-1/examples/python/drop-cutter/drop_cutter_one-triangle_2.py
--- opencamlib-11.10+git201801200005~ubuntu16.04.1/examples/python/drop-cutter/drop_cutter_one-triangle_2.py 1970-01-01 00:00:00.000000000 +0000
+++ opencamlib-11.10-1/examples/python/drop-cutter/drop_cutter_one-triangle_2.py 2020-06-14 12:13:19.000000000 +0000
@@ -0,0 +1,80 @@
+import ocl
+import pyocl
+import camvtk
+import vtk
+import math
+
+
+def drawPoints(myscreen, clpoints, ccpoints):
+ c=camvtk.PointCloud( pointlist=clpoints, collist=ccpoints)
+ c.SetPoints()
+ myscreen.addActor(c )
+
+if __name__ == "__main__":
+ print(ocl.version())
+ myscreen = camvtk.VTKScreen()
+
+ # triangle
+ a=ocl.Point(1,0,0.4)
+ b=ocl.Point(0,1,0)
+ c=ocl.Point(0,0,-0.2)
+ t = ocl.Triangle(b,c,a)
+
+ # draw the triangle with VTK
+ myscreen.addActor(camvtk.Point(center=(a.x,a.y,a.z), color=(1,0,1)))
+ myscreen.addActor(camvtk.Point(center=(b.x,b.y,b.z), color=(1,0,1)))
+ myscreen.addActor(camvtk.Point(center=(c.x,c.y,c.z), color=(1,0,1)))
+ myscreen.addActor( camvtk.Line(p1=(a.x,a.y,a.z),p2=(c.x,c.y,c.z)) )
+ myscreen.addActor( camvtk.Line(p1=(c.x,c.y,c.z),p2=(b.x,b.y,b.z)) )
+ myscreen.addActor( camvtk.Line(p1=(a.x,a.y,a.z),p2=(b.x,b.y,b.z)) )
+
+ # cutter
+ radius1=1
+ length=5
+ angle = math.pi/4
+ #cutter = ocl.ConeCutter(0.37, angle)
+ cutter = ocl.BallCutter(0.532, length)
+ #cutter = ocl.CylCutter(0.3, length)
+ #cutter = ocl.BullCutter(0.5,0.123, length)
+ print(cutter)
+
+ # grid on which we run drop-cutter
+ minx=-0.5
+ dx=0.0051
+ maxx=1.5
+ miny=-0.7
+ dy=dx
+ maxy=1.5
+ z=-0.7
+ clpoints = pyocl.CLPointGrid(minx,dx,maxx,miny,dy,maxy,z)
+
+ print(len(clpoints), "cl-points to evaluate")
+ n=0
+ for cl in clpoints:
+ #cutter.vertexDrop(cl,t)
+ #cutter.edgeDrop(cl,t)
+ #cutter.facetDrop(cl,t)
+ cutter.dropCutter(cl,t) # this calls all three above: vertex,facet,edge
+ n=n+1
+ if (n % int(len(clpoints)/10)) == 0:
+ print(n/int(len(clpoints)/10), " ",)
+
+ print("done.")
+
+ print("rendering...")
+ print(" len(clpoints)=", len(clpoints))
+
+ camvtk.drawCLPointCloud(myscreen, clpoints)
+ print("done.")
+
+ # draw a sphere, just for fun
+ origo = camvtk.Sphere(center=(0,0,0) , radius=0.1, color=camvtk.blue)
+ origo.SetOpacity(0.2)
+ myscreen.addActor( origo )
+
+ myscreen.camera.SetPosition(0.5, 3, 2)
+ myscreen.camera.SetFocalPoint(0.5, 0.5, 0)
+ myscreen.camera.SetClippingRange(-20,20)
+ myscreen.render()
+ myscreen.iren.Start()
+ #raw_input("Press Enter to terminate")
diff -Nru opencamlib-11.10+git201801200005~ubuntu16.04.1/examples/python/drop-cutter/drop_cutter_one-triangle_3_compoundcutter.py opencamlib-11.10-1/examples/python/drop-cutter/drop_cutter_one-triangle_3_compoundcutter.py
--- opencamlib-11.10+git201801200005~ubuntu16.04.1/examples/python/drop-cutter/drop_cutter_one-triangle_3_compoundcutter.py 1970-01-01 00:00:00.000000000 +0000
+++ opencamlib-11.10-1/examples/python/drop-cutter/drop_cutter_one-triangle_3_compoundcutter.py 2020-06-14 12:13:19.000000000 +0000
@@ -0,0 +1,76 @@
+import ocl
+import pyocl # pyocl.CLPointGrid()
+import camvtk
+import vtk
+import math
+
+if __name__ == "__main__":
+ print(ocl.version())
+ myscreen = camvtk.VTKScreen()
+
+ a=ocl.Point(1,0.6,0.1)
+ myscreen.addActor(camvtk.Point(center=(a.x,a.y,a.z), color=(1,0,1)))
+ b=ocl.Point(0,1,0)
+ myscreen.addActor(camvtk.Point(center=(b.x,b.y,b.z), color=(1,0,1)))
+ c=ocl.Point(0,0,0.0)
+ myscreen.addActor(camvtk.Point(center=(c.x,c.y,c.z), color=(1,0,1)))
+
+ myscreen.addActor( camvtk.Line(p1=(a.x,a.y,a.z),p2=(c.x,c.y,c.z)) )
+ myscreen.addActor( camvtk.Line(p1=(c.x,c.y,c.z),p2=(b.x,b.y,b.z)) )
+ myscreen.addActor( camvtk.Line(p1=(a.x,a.y,a.z),p2=(b.x,b.y,b.z)) )
+
+ t = ocl.Triangle(b,c,a)
+ radius1=1
+ angle = math.pi/4
+ #cutter = ocl.ConeCutter(0.37, angle)
+ #cutter = ocl.BallCutter(0.532)
+ #cutter = ocl.CylCutter(0.3)
+ #cutter = ocl.BullCutter(1,0.2)
+
+ #cutter = ocl.CylConeCutter(0.2,0.5,math.pi/9)
+ #cutter = ocl.BallConeCutter(0.4,0.6,math.pi/9)
+ cutter = ocl.BullConeCutter(0.4,0.1,0.7,math.pi/6)
+ #cutter = ocl.ConeConeCutter(0.4,math.pi/3,0.7,math.pi/6)
+ #cutter = ocl.ConeCutter(0.4, math.pi/3)
+ print(cutter)
+
+ #print cc.type
+ minx=-0.5
+ dx=0.0051
+ maxx=1.5
+ miny=-0.7
+ dy=dx
+ maxy=1.5
+ z=-1.8
+ clpoints = pyocl.CLPointGrid(minx,dx,maxx,miny,dy,maxy,z)
+ nv=0
+ nn=0
+ ne=0
+ nf=0
+ print(len(clpoints), "cl-points to evaluate")
+ n=0
+
+ for cl in clpoints:
+ cutter.vertexDrop(cl,t)
+ cutter.edgeDrop(cl,t)
+ cutter.facetDrop(cl,t)
+ #cutter.dropCutter(cl,t)
+ n=n+1
+ if (n % int(len(clpoints)/10)) == 0:
+ print(n/int(len(clpoints)/10), " ",)
+
+ print("done.")
+ print("rendering...")
+ print(" len(clpoints)=", len(clpoints))
+
+ camvtk.drawCLPointCloud(myscreen, clpoints)
+ print("done.")
+ origo = camvtk.Sphere(center=(0,0,0) , radius=0.1, color=camvtk.blue)
+ origo.SetOpacity(0.2)
+ myscreen.addActor( origo )
+
+ myscreen.camera.SetPosition(0.5, 3, 2)
+ myscreen.camera.SetFocalPoint(0.5, 0.5, 0)
+ myscreen.render()
+ myscreen.iren.Start()
+ #raw_input("Press Enter to terminate")
diff -Nru opencamlib-11.10+git201801200005~ubuntu16.04.1/examples/python/drop-cutter/drop_cutter_tst_1.py opencamlib-11.10-1/examples/python/drop-cutter/drop_cutter_tst_1.py
--- opencamlib-11.10+git201801200005~ubuntu16.04.1/examples/python/drop-cutter/drop_cutter_tst_1.py 1970-01-01 00:00:00.000000000 +0000
+++ opencamlib-11.10-1/examples/python/drop-cutter/drop_cutter_tst_1.py 2020-06-14 12:13:19.000000000 +0000
@@ -0,0 +1,31 @@
+import ocl
+import camvtk
+import time
+
+if __name__ == "__main__":
+ cutter = ocl.CylCutter(.1, 5)
+ print(cutter)
+ a = ocl.Point(1,0,0)
+ b = ocl.Point(0,1,0)
+ c = ocl.Point(0,0,1)
+ t = ocl.Triangle(a,b,c)
+ print("triangle created t=", t)
+ cl = ocl.CLPoint(0.2,0.2,-5)
+ print("CL= ", cl)
+ cutter.vertexDrop( cl , t )
+ print("after vertex CL=", cl)
+ print("t=",t)
+
+ #print "t.n", t.n.str()
+
+ cutter.facetDrop( cl, t )
+ #print "after facetDrop"
+ print("after facet t=",t)
+ #print "t.n", t.n.str()
+ print("after facet CL=", cl)
+
+
+
+ cutter.edgeDrop( cl, t )
+ print("after edge cl =", cl)
+
diff -Nru opencamlib-11.10+git201801200005~ubuntu16.04.1/examples/python/drop-cutter/drop_cutter_tst_2.py opencamlib-11.10-1/examples/python/drop-cutter/drop_cutter_tst_2.py
--- opencamlib-11.10+git201801200005~ubuntu16.04.1/examples/python/drop-cutter/drop_cutter_tst_2.py 1970-01-01 00:00:00.000000000 +0000
+++ opencamlib-11.10-1/examples/python/drop-cutter/drop_cutter_tst_2.py 2020-06-14 12:13:19.000000000 +0000
@@ -0,0 +1,16 @@
+import ocl
+import camvtk
+import time
+
+if __name__ == "__main__":
+ cutter = ocl.CylCutter(.1, 5)
+ print(cutter)
+ a=ocl.Point(1,0,0)
+ b=ocl.Point(0,1,0)
+ c=ocl.Point(0,0,1)
+ t = ocl.Triangle(a,b,c)
+ print("triangle created t=", t)
+ cl = ocl.CLPoint(0.2,0.2,0)
+
+ cutter.dropCutter(cl,t)
+ print("CL= ", cl)
diff -Nru opencamlib-11.10+git201801200005~ubuntu16.04.1/examples/python/drop-cutter/drop_cutter_tst_3.py opencamlib-11.10-1/examples/python/drop-cutter/drop_cutter_tst_3.py
--- opencamlib-11.10+git201801200005~ubuntu16.04.1/examples/python/drop-cutter/drop_cutter_tst_3.py 1970-01-01 00:00:00.000000000 +0000
+++ opencamlib-11.10-1/examples/python/drop-cutter/drop_cutter_tst_3.py 2020-06-14 12:13:19.000000000 +0000
@@ -0,0 +1,46 @@
+import ocl
+import pyocl
+import camvtk
+import time
+
+if __name__ == "__main__":
+ myscreen = camvtk.VTKScreen()
+
+ a=ocl.Point(1,0,0)
+ myscreen.addActor(camvtk.Point(center=(1,0,0), color=(1,1,1)));
+ b=ocl.Point(0,1,0)
+ myscreen.addActor(camvtk.Point(center=(0,1,0), color=(1,1,1)));
+ c=ocl.Point(0,0,0.2)
+ myscreen.addActor( camvtk.Point(center=(0,0,0.2), color=(1,1,1)));
+ myscreen.addActor( camvtk.Line(p1=(1,0,0),p2=(0,0,0.2)) )
+ myscreen.addActor( camvtk.Line(p1=(0,0,0.2),p2=(0,1,0)) )
+ myscreen.addActor( camvtk.Line(p1=(1,0,0),p2=(0,1,0)) )
+ t = ocl.Triangle(a,b,c)
+
+ cutter = ocl.CylCutter(.3, 5)
+ print(cutter)
+
+ minx=-0.2
+ dx=0.02
+ maxx=1.2
+ miny=-0.2
+ dy=0.2
+ maxy=1.2
+ z=-0.2
+ clpoints = pyocl.CLPointGrid(minx,dx,maxx,miny,dy,maxy,z)
+
+ for cl in clpoints:
+ cutter.dropCutter(cl,t)
+
+ print(len(clpoints), " cl points evaluated")
+ # draw the points
+ camvtk.drawCLPointCloud(myscreen, clpoints)
+
+ #position camera
+ myscreen.camera.SetPosition(0.5, 3, 2)
+ myscreen.camera.SetFocalPoint(0.5, 0.5, 0)
+
+ myscreen.render()
+ myscreen.iren.Start()
+ #raw_input("Press Enter to terminate")
+
diff -Nru opencamlib-11.10+git201801200005~ubuntu16.04.1/examples/python/drop-cutter/drop_cutter_tst_4.py opencamlib-11.10-1/examples/python/drop-cutter/drop_cutter_tst_4.py
--- opencamlib-11.10+git201801200005~ubuntu16.04.1/examples/python/drop-cutter/drop_cutter_tst_4.py 1970-01-01 00:00:00.000000000 +0000
+++ opencamlib-11.10-1/examples/python/drop-cutter/drop_cutter_tst_4.py 2020-06-14 12:13:19.000000000 +0000
@@ -0,0 +1,91 @@
+import ocl
+import pyocl
+import camvtk
+import time
+import vtk
+import datetime
+import math
+
+if __name__ == "__main__":
+ print(ocl.version())
+ myscreen = camvtk.VTKScreen()
+
+ a=ocl.Point(1,0,0)
+ myscreen.addActor(camvtk.Point(center=(1,0,0), color=(1,0,1)));
+ b=ocl.Point(0,1,0)
+ myscreen.addActor(camvtk.Point(center=(0,1,0), color=(1,0,1)));
+ c=ocl.Point(0,0,0.3)
+ myscreen.addActor( camvtk.Point(center=(0,0,0.3), color=(1,0,1)));
+ myscreen.addActor( camvtk.Line(p1=(1,0,0),p2=(0,0,0.3)) )
+ myscreen.addActor( camvtk.Line(p1=(0,0,0.3),p2=(0,1,0)) )
+ myscreen.addActor( camvtk.Line(p1=(1,0,0),p2=(0,1,0)) )
+ t = ocl.Triangle(a,b,c)
+ s = ocl.STLSurf()
+ s.addTriangle(t)
+
+ diameter = 0.5234
+ corneradius = 0.1
+ angle = math.pi/4
+ length = 5
+ cutter = ocl.CylCutter(diameter, length)
+ #cutter = ocl.BallCutter(diameter, length)
+ #cutter = ocl.BullCutter(diameter,corneradius, length)
+ #cutter = ocl.ConeCutter(diameter, angle, length)
+
+ print(cutter)
+
+ minx=-0.5
+ dx=0.01
+ maxx=1.5
+ miny=-0.5
+ dy=0.05
+ maxy=1.5
+ z=-0.8
+ clpoints = pyocl.CLPointGrid(minx,dx,maxx,miny,dy,maxy,z)
+ print(len(clpoints), "cl-points to evaluate")
+ n=0
+ clp=[]
+ bdc = ocl.BatchDropCutter()
+ bdc.setSTL(s)
+ bdc.setCutter(cutter)
+ for p in clpoints:
+ bdc.appendPoint(p)
+
+ bdc.run()
+
+ print("done.")
+ clpoints = bdc.getCLPoints()
+ print("rendering...")
+ print(" len(clpoints)=", len(clpoints))
+
+ camvtk.drawCLPointCloud(myscreen, clpoints)
+
+ print("done.")
+
+ myscreen.camera.SetPosition(0.5, 3, 2)
+ myscreen.camera.SetFocalPoint(0.5, 0.5, 0)
+ myscreen.render()
+
+ #w2if = vtk.vtkWindowToImageFilter()
+ #w2if.SetInput(myscreen.renWin)
+ #lwr = vtk.vtkPNGWriter()
+ #lwr.SetInput( w2if.GetOutput() )
+
+ t = camvtk.Text()
+ t.SetPos( (myscreen.width-350, myscreen.height-30) )
+ myscreen.addActor(t)
+
+ #for n in range(1,18):
+ # t.SetText("OpenCAMLib " + datetime.datetime.now().strftime("%Y-%m-%d %H:%M:%S"))
+ # myscreen.camera.Azimuth( 2 )
+ # time.sleep(0.1)
+ # myscreen.render()
+ # w2if.Modified()
+ # lwr.SetFileName("frames/tc"+ ('%04d' % n)+".png")
+ #lwr.Write()
+
+
+
+ myscreen.iren.Start()
+ #raw_input("Press Enter to terminate")
+
diff -Nru opencamlib-11.10+git201801200005~ubuntu16.04.1/examples/python/drop-cutter/drop_cutter_tst_5.py opencamlib-11.10-1/examples/python/drop-cutter/drop_cutter_tst_5.py
--- opencamlib-11.10+git201801200005~ubuntu16.04.1/examples/python/drop-cutter/drop_cutter_tst_5.py 1970-01-01 00:00:00.000000000 +0000
+++ opencamlib-11.10-1/examples/python/drop-cutter/drop_cutter_tst_5.py 2020-06-14 12:13:19.000000000 +0000
@@ -0,0 +1,73 @@
+import ocl
+import pyocl
+import camvtk
+import time
+import vtk
+import datetime
+
+if __name__ == "__main__":
+ print(ocl.version())
+ myscreen = camvtk.VTKScreen()
+ stl = camvtk.STLSurf("../../stl/gnu_tux_mod.stl")
+
+ myscreen.addActor(stl)
+ stl.SetWireframe()
+ stl.SetColor((0.5,0.5,0.5))
+
+ polydata = stl.src.GetOutput()
+ s= ocl.STLSurf()
+ camvtk.vtkPolyData2OCLSTL(polydata, s)
+ print("STL surface read,", s.size(), "triangles" )
+
+ cutter = ocl.CylCutter(0.6, 6)
+ print(cutter)
+
+ minx=-0.2
+ dx=1
+ maxx=10.2
+ miny=-0.2
+ dy=1
+ maxy=12.2
+ z=-0.2
+ clpoints = pyocl.CLPointGrid(minx,dx,maxx,miny,dy,maxy,z)
+ print(len(clpoints),"CL-points to evaluate...")
+ tris = s.getTriangles()
+ # very naive approach to drop-cutter (and doing loops in python is slow)
+ # this is so slow in practice it is not usable with the tux-model STL-file (22k triangles)
+ for cl in clpoints: # loop through all the cl-points
+ for t in tris: # for each cl-point loop through all triangles
+ cutter.vertexDrop(cl,t) # vertex test
+ cutter.edgeDrop(cl,t) # edge test
+ cutter.facetDrop(cl,t) # facet test
+ print("done.")
+
+ camvtk.drawCLPointCloud(myscreen, clpoints)
+
+ print(len(clpoints), " cl points evaluated")
+ myscreen.camera.SetPosition(3, 23, 15)
+ myscreen.camera.SetFocalPoint(4, 5, 0)
+ myscreen.render()
+
+ #w2if = vtk.vtkWindowToImageFilter()
+ #w2if.SetInput(myscreen.renWin)
+ #lwr = vtk.vtkPNGWriter()
+ #lwr.SetInput( w2if.GetOutput() )
+ #w2if.Modified()
+ #lwr.SetFileName("tux1.png")
+ #lwr.Write()
+
+ t = camvtk.Text()
+ t.SetPos( (myscreen.width-200, myscreen.height-30) )
+ myscreen.addActor( t)
+
+ for n in range(1,36):
+ t.SetText(datetime.datetime.now().strftime("%Y-%m-%d %H:%M:%S"))
+ myscreen.camera.Azimuth( 1 )
+ time.sleep(0.01)
+ myscreen.render()
+ #lwr.SetFileName("frame"+ ('%03d' % n)+".png")
+ #w2if.Modified()
+ #lwr.Write() #uncomment to write screenshots to disk
+
+ myscreen.iren.Start()
+ raw_input("Press Enter to terminate")
diff -Nru opencamlib-11.10+git201801200005~ubuntu16.04.1/examples/python/edge_offset_tst_1.py opencamlib-11.10-1/examples/python/edge_offset_tst_1.py
--- opencamlib-11.10+git201801200005~ubuntu16.04.1/examples/python/edge_offset_tst_1.py 1970-01-01 00:00:00.000000000 +0000
+++ opencamlib-11.10-1/examples/python/edge_offset_tst_1.py 2020-06-14 12:13:19.000000000 +0000
@@ -0,0 +1,97 @@
+import ocl
+import pyocl
+import camvtk
+import time
+import vtk
+import datetime
+import math
+
+def drawEdge(myscreen, a, b):
+ myscreen.addActor(camvtk.Sphere(center=(a.x,a.y,a.z), radius=0.0351, color=camvtk.green));
+ myscreen.addActor(camvtk.Sphere(center=(b.x,b.y,b.z), radius=0.0351, color=camvtk.red));
+ myscreen.addActor( camvtk.Line(p1=(a.x,a.y,a.z),p2=(b.x,b.y,b.z)) )
+
+if __name__ == "__main__":
+ print(ocl.version())
+ myscreen = camvtk.VTKScreen()
+ camvtk.drawOCLtext(myscreen)
+ camvtk.drawArrows(myscreen,center=(-1,-2,0))
+ a=ocl.Point(0,1.7,-0.6)
+ b=ocl.Point(0,0.11,0.3)
+
+ drawEdge(myscreen, a, b)
+ diameter=0.4
+ length=1
+ # spherical cutter and cylinder
+ s1 = camvtk.Sphere(center=(a.x,a.y,a.z), radius=diameter/2, color=camvtk.lgreen)
+ s2 = camvtk.Sphere(center=(b.x,b.y,b.z), radius=diameter/2, color=camvtk.pink)
+ s1.SetOpacity(1)
+ s2.SetOpacity(1)
+ myscreen.addActor(s1)
+ myscreen.addActor(s2)
+ # tube
+ cyltube = camvtk.Tube( p1=(a.x,a.y,a.z) , p2=(b.x,b.y,b.z), radius=diameter/2, color=camvtk.yellow )
+ cyltube.SetOpacity(0.2)
+ myscreen.addActor( cyltube )
+
+
+ # Cylinder
+ a = a + ocl.Point(1,0,0)
+ b = b + ocl.Point(1,0,0)
+ drawEdge(myscreen, a, b)
+ cir1 = camvtk.Circle(center=(a.x,a.y,a.z) , radius=diameter/2, color=camvtk.lgreen, resolution=50 )
+ cir1.SetOpacity(1)
+ myscreen.addActor(cir1)
+ cir2 = camvtk.Circle(center=(b.x,b.y,b.z) , radius=diameter/2, color=camvtk.pink, resolution=50 )
+ cir2.SetOpacity(1)
+ myscreen.addActor(cir2)
+
+ # draw lines along the elliptic tube
+
+ # Toroid
+ a = a + ocl.Point(1,0,0)
+ b = b + ocl.Point(1,0,0)
+ drawEdge(myscreen, a, b)
+ tor1 = camvtk.Toroid(r1=diameter/2, r2=diameter/6, center=(a.x,a.y,a.z), rotXYZ=(0,0,0), color=camvtk.lgreen)
+ tor1.SetOpacity(1)
+ myscreen.addActor(tor1)
+ tor2 = camvtk.Toroid(r1=diameter/2, r2=diameter/6, center=(b.x,b.y,b.z), rotXYZ=(0,0,0), color=camvtk.pink)
+ tor2.SetOpacity(1)
+ myscreen.addActor(tor2)
+
+ # Cone
+ a = a + ocl.Point(1,0,0)
+ b = b + ocl.Point(1,0,0)
+ drawEdge(myscreen, a, b)
+ con1 = camvtk.Cone(center=(a.x,a.y,a.z), radius=diameter/2, height = 0.3, color=camvtk.lgreen )
+ myscreen.addActor(con1)
+ con2 = camvtk.Cone(center=(b.x,b.y,b.z), radius=diameter/2, height = 0.3, color=camvtk.pink )
+ myscreen.addActor(con2)
+
+
+ print("done.")
+
+ myscreen.camera.SetPosition(4, 3, 2)
+ myscreen.camera.SetFocalPoint(0, 0, 0)
+ myscreen.render()
+
+ w2if = vtk.vtkWindowToImageFilter()
+ w2if.SetInput(myscreen.renWin)
+ lwr = vtk.vtkPNGWriter()
+ lwr.SetInput( w2if.GetOutput() )
+
+
+ #for n in range(1,18):
+ # t.SetText("OpenCAMLib " + datetime.datetime.now().strftime("%Y-%m-%d %H:%M:%S"))
+ # myscreen.camera.Azimuth( 2 )
+ # time.sleep(0.1)
+ # myscreen.render()
+ # w2if.Modified()
+ # lwr.SetFileName("frames/tc"+ ('%04d' % n)+".png")
+ #lwr.Write()
+
+
+
+ myscreen.iren.Start()
+ #raw_input("Press Enter to terminate")
+
diff -Nru opencamlib-11.10+git201801200005~ubuntu16.04.1/examples/python/fiber/fiber_01.py opencamlib-11.10-1/examples/python/fiber/fiber_01.py
--- opencamlib-11.10+git201801200005~ubuntu16.04.1/examples/python/fiber/fiber_01.py 1970-01-01 00:00:00.000000000 +0000
+++ opencamlib-11.10-1/examples/python/fiber/fiber_01.py 2020-06-14 12:13:19.000000000 +0000
@@ -0,0 +1,90 @@
+import ocl
+import camvtk
+import time
+import vtk
+import datetime
+import math
+
+
+def drawPoints(myscreen, clpoints, ccpoints):
+ c=camvtk.PointCloud( pointlist=clpoints, collist=ccpoints)
+ c.SetPoints()
+ myscreen.addActor(c )
+
+def drawFiber(myscreen, f):
+ #myscreen.addActor( camvtk.Line(p1=(f.p1.x,f.p1.y,f.p1.z),p2=(f.p2.x,f.p2.y,f.p2.z), color=camvtk.orange) )
+ #myscreen.addActor( camvtk.Sphere(center=(f.p1.x,f.p1.y,f.p1.z),radius=0.05, color=camvtk.lgreen) )
+ #myscreen.addActor( camvtk.Sphere(center=(f.p2.x,f.p2.y,f.p2.z),radius=0.05, color=camvtk.pink) )
+ inter = f.getInts()
+ for i in inter:
+ ip1 = f.point( i.lower )
+ ip2 = f.point( i.upper )
+ myscreen.addActor( camvtk.Line(p1=(ip1.x,ip1.y,ip1.z),p2=(ip2.x,ip2.y,ip2.z), color=camvtk.red) )
+
+if __name__ == "__main__":
+ myscreen = camvtk.VTKScreen()
+
+ a=ocl.Point(1,0.6,0.5)
+ myscreen.addActor(camvtk.Point(center=(a.x,a.y,a.z), color=(1,0,1)))
+ b=ocl.Point(0,1,0)
+ myscreen.addActor(camvtk.Point(center=(b.x,b.y,b.z), color=(1,0,1)))
+ c=ocl.Point(0,0,0.0)
+ myscreen.addActor(camvtk.Point(center=(c.x,c.y,c.z), color=(1,0,1)))
+
+ myscreen.addActor( camvtk.Line(p1=(a.x,a.y,a.z),p2=(c.x,c.y,c.z)) )
+ myscreen.addActor( camvtk.Line(p1=(c.x,c.y,c.z),p2=(b.x,b.y,b.z)) )
+ myscreen.addActor( camvtk.Line(p1=(a.x,a.y,a.z),p2=(b.x,b.y,b.z)) )
+
+ f1 = ocl.Point(-2,0.5,-0.2)
+ f2 = ocl.Point(2,0.5,-0.2)
+ t = ocl.Triangle(b,c,a)
+ #radius1=1
+ #angle = math.pi/4
+ #cutter = ocl.ConeCutter(0.37, angle)
+ #cutter = ocl.BallCutter(0.532,5)
+ cutter = ocl.CylCutter(0.3,5)
+
+ #cutter = ocl.CylConeCutter(0.2,0.5,math.pi/9)
+ #cutter = ocl.BallConeCutter(0.4,0.6,math.pi/9)
+ #cutter = ocl.BullConeCutter(0.4,0.1,0.7,math.pi/6)
+ #cutter = ocl.ConeConeCutter(0.4,math.pi/3,0.7,math.pi/6)
+ #cutter = ocl.ConeCutter(0.4, math.pi/3)
+
+ print("fiber...")
+
+ f = ocl.Fiber( f1, f2)
+ i = ocl.Interval()
+ f.printInts()
+ print("vertexPush")
+ cc = ocl.CCPoint()
+ cutter.pushCutter(f,i,t)
+ print(i)
+ f.addInterval(i)
+ print("AFTER vertexPush")
+ f.printInts()
+
+ #inter = f.getInts()
+ #print inter
+ print("done.")
+
+ print("rendering...")
+ drawFiber(myscreen, f)
+ print("done.")
+ origo = camvtk.Sphere(center=(0,0,0) , radius=0.1, color=camvtk.blue)
+ origo.SetOpacity(0.2)
+ myscreen.addActor( origo )
+
+ myscreen.camera.SetPosition(0.5, 3, 2)
+ myscreen.camera.SetFocalPoint(0.5, 0.5, 0)
+ myscreen.render()
+
+ #w2if = vtk.vtkWindowToImageFilter()
+ #w2if.SetInput(myscreen.renWin)
+ #lwr = vtk.vtkPNGWriter()
+ #lwr.SetInput( w2if.GetOutput() )
+
+ t = camvtk.Text()
+ t.SetPos( (myscreen.width-350, myscreen.height-30) )
+ myscreen.addActor(t)
+ myscreen.iren.Start()
+ #raw_input("Press Enter to terminate")
diff -Nru opencamlib-11.10+git201801200005~ubuntu16.04.1/examples/python/fiber/fiber_02_onetriangle_drawfibers.py opencamlib-11.10-1/examples/python/fiber/fiber_02_onetriangle_drawfibers.py
--- opencamlib-11.10+git201801200005~ubuntu16.04.1/examples/python/fiber/fiber_02_onetriangle_drawfibers.py 1970-01-01 00:00:00.000000000 +0000
+++ opencamlib-11.10-1/examples/python/fiber/fiber_02_onetriangle_drawfibers.py 2020-06-14 12:13:19.000000000 +0000
@@ -0,0 +1,95 @@
+import ocl
+import camvtk
+import time
+import vtk
+import datetime
+import math
+
+def drawPoints(myscreen, clpoints, ccpoints):
+ c=camvtk.PointCloud( pointlist=clpoints, collist=ccpoints)
+ c.SetPoints()
+ myscreen.addActor(c )
+
+def drawFiber(myscreen, f, fibercolor=camvtk.red):
+ inter = f.getInts()
+ for i in inter:
+ if not i.empty():
+ ip1 = f.point( i.lower )
+ ip2 = f.point( i.upper )
+ myscreen.addActor( camvtk.Line(p1=(ip1.x,ip1.y,ip1.z),p2=(ip2.x,ip2.y,ip2.z), color=fibercolor) )
+ myscreen.addActor( camvtk.Sphere(center=(ip1.x,ip1.y,ip1.z),radius=0.005, color=camvtk.clColor( i.lower_cc) ) )
+ myscreen.addActor( camvtk.Sphere(center=(ip2.x,ip2.y,ip2.z),radius=0.005, color=camvtk.clColor( i.upper_cc) ) )
+ cc1 = i.lower_cc
+ cc2 = i.upper_cc
+ myscreen.addActor( camvtk.Sphere(center=(cc1.x,cc1.y,cc1.z),radius=0.005, color=camvtk.lgreen ) )
+ myscreen.addActor( camvtk.Sphere(center=(cc2.x,cc2.y,cc2.z),radius=0.005, color=camvtk.lgreen ) )
+ # cutter circle
+ #c1 = camvtk.Circle(center=(ip1.x,ip1.y,ip1.z), radius = 0.3/2, color=fibercolor)
+ #myscreen.addActor(c1)
+ #c2 = camvtk.Circle(center=(ip2.x,ip2.y,ip2.z), radius = 0.3/2, color=fibercolor)
+ #myscreen.addActor(c2)
+
+if __name__ == "__main__":
+ myscreen = camvtk.VTKScreen()
+
+ a = ocl.Point(0,1,0.3)
+ myscreen.addActor(camvtk.Point(center=(a.x,a.y,a.z), color=(1,0,1)))
+ b = ocl.Point(1,0.5,0.3)
+ myscreen.addActor(camvtk.Point(center=(b.x,b.y,b.z), color=(1,0,1)))
+ c = ocl.Point(0,0,0)
+ myscreen.addActor(camvtk.Point(center=(c.x,c.y,c.z), color=(1,0,1)))
+ myscreen.addActor( camvtk.Line(p1=(a.x,a.y,a.z),p2=(c.x,c.y,c.z)) )
+ myscreen.addActor( camvtk.Line(p1=(c.x,c.y,c.z),p2=(b.x,b.y,b.z)) )
+ myscreen.addActor( camvtk.Line(p1=(a.x,a.y,a.z),p2=(b.x,b.y,b.z)) )
+ t = ocl.Triangle(b,c,a)
+ diameter = 0.2
+ length = 5
+ angle = math.pi/4
+ cutter = ocl.CylCutter(diameter, length)
+ #cutter = ocl.BallCutter(diameter, length)
+ #cutter = ocl.BullCutter(diameter, diameter/5, length)
+ #cutter = ocl.ConeCutter(diameter, angle, length)
+
+ print(cutter)
+ fiber_range=6
+ Nmax = 500
+ yvals = [float(n - float(Nmax)/2)/Nmax*fiber_range for n in range(0,Nmax+1)]
+ xvals = [float(n - float(Nmax)/2)/Nmax*fiber_range for n in range(0,Nmax+1)]
+
+ zh = 0.1071567
+ for y in yvals:
+ f1 = ocl.Point(-0.5,y,zh) # start point of fiber
+ f2 = ocl.Point(1.5,y,zh) # end point of fiber
+ f = ocl.Fiber( f1, f2)
+ i = ocl.Interval()
+ cutter.pushCutter(f,i,t)
+ #cutter.vertexPush(f,i,t)
+ #cutter.facetPush(f,i,t)
+ #cutter.edgePush(f,i,t)
+ f.addInterval(i)
+ drawFiber(myscreen, f, camvtk.red)
+
+ for x in xvals:
+ f1 = ocl.Point(x,-0.5,zh) # start point of fiber
+ f2 = ocl.Point(x,1.5,zh) # end point of fiber
+ f = ocl.Fiber( f1, f2)
+ i = ocl.Interval()
+ cutter.pushCutter(f,i,t)
+ #cutter.vertexPush(f,i,t)
+ #cutter.facetPush(f,i,t)
+ #cutter.edgePush(f,i,t)
+ f.addInterval(i)
+ drawFiber(myscreen, f, camvtk.lblue)
+
+ print("done.")
+ myscreen.camera.SetPosition(0.5, 3, 2)
+ myscreen.camera.SetFocalPoint(0.5, 0.5, 0)
+ camvtk.drawArrows(myscreen,center=(-0.5,-0.5,-0.5))
+ camvtk.drawOCLtext(myscreen)
+ myscreen.render()
+ #w2if = vtk.vtkWindowToImageFilter()
+ #w2if.SetInput(myscreen.renWin)
+ #lwr = vtk.vtkPNGWriter()
+ #lwr.SetInput( w2if.GetOutput() )
+ myscreen.iren.Start()
+ #raw_input("Press Enter to terminate")
diff -Nru opencamlib-11.10+git201801200005~ubuntu16.04.1/examples/python/fiber/fiber_03_onetri_many-z-levels.py opencamlib-11.10-1/examples/python/fiber/fiber_03_onetri_many-z-levels.py
--- opencamlib-11.10+git201801200005~ubuntu16.04.1/examples/python/fiber/fiber_03_onetri_many-z-levels.py 1970-01-01 00:00:00.000000000 +0000
+++ opencamlib-11.10-1/examples/python/fiber/fiber_03_onetri_many-z-levels.py 2020-06-14 12:13:19.000000000 +0000
@@ -0,0 +1,128 @@
+import ocl
+import camvtk
+import time
+import vtk
+import datetime
+import math
+
+def drawPoints(myscreen, clpoints, ccpoints):
+ c=camvtk.PointCloud( pointlist=clpoints, collist=ccpoints)
+ c.SetPoints()
+ myscreen.addActor(c )
+
+def drawFiber(myscreen, f, fibercolor=camvtk.red):
+ inter = f.getInts()
+ print("fiber has ", len(inter) , " intervals")
+ for i in inter:
+ if not i.empty():
+ ip1 = f.point( i.lower )
+ ip2 = f.point( i.upper )
+ myscreen.addActor( camvtk.Line(p1=(ip1.x,ip1.y,ip1.z),p2=(ip2.x,ip2.y,ip2.z), color=fibercolor) )
+ myscreen.addActor( camvtk.Sphere(center=(ip1.x,ip1.y,ip1.z),radius=0.005, color=camvtk.clColor( i.lower_cc) ) )
+ myscreen.addActor( camvtk.Sphere(center=(ip2.x,ip2.y,ip2.z),radius=0.005, color=camvtk.clColor( i.upper_cc) ) )
+ #cc1 = i.lower_cc
+ #cc2 = i.upper_cc
+ #myscreen.addActor( camvtk.Sphere(center=(cc1.x,cc1.y,cc1.z),radius=0.005, color=camvtk.lgreen ) )
+ #myscreen.addActor( camvtk.Sphere(center=(cc2.x,cc2.y,cc2.z),radius=0.005, color=camvtk.lgreen ) )
+ # cutter circle
+ #c1 = camvtk.Circle(center=(ip1.x,ip1.y,ip1.z), radius = 0.3/2, color=fibercolor)
+ #myscreen.addActor(c1)
+ #c2 = camvtk.Circle(center=(ip2.x,ip2.y,ip2.z), radius = 0.3/2, color=fibercolor)
+ #myscreen.addActor(c2)
+
+def drawFiber_clpts(myscreen, f, fibercolor=camvtk.red):
+ inter = f.getInts()
+ #print "fiber has ", len(inter) , " intervals"
+ for i in inter:
+ if not i.empty():
+ ip1 = f.point( i.lower )
+ ip2 = f.point( i.upper )
+ #myscreen.addActor( camvtk.Line(p1=(ip1.x,ip1.y,ip1.z),p2=(ip2.x,ip2.y,ip2.z), color=fibercolor) )
+ myscreen.addActor( camvtk.Sphere(center=(ip1.x,ip1.y,ip1.z),radius=0.005, color=camvtk.clColor( i.lower_cc) ) )
+ myscreen.addActor( camvtk.Sphere(center=(ip2.x,ip2.y,ip2.z),radius=0.005, color=camvtk.clColor( i.upper_cc) ) )
+ #cc1 = i.lower_cc
+ #cc2 = i.upper_cc
+ #myscreen.addActor( camvtk.Sphere(center=(cc1.x,cc1.y,cc1.z),radius=0.005, color=camvtk.pink ) )
+ #myscreen.addActor( camvtk.Sphere(center=(cc2.x,cc2.y,cc2.z),radius=0.005, color=camvtk.pink ) )
+
+def yfiber(yvals,t,zh,myscreen):
+ for y in yvals:
+ f1 = ocl.Point(-0.5,y,zh) # start point of fiber
+ f2 = ocl.Point(1.5,y,zh) # end point of fiber
+ f = ocl.Fiber( f1, f2)
+ i = ocl.Interval()
+ #cutter.vertexPush(f,i,t)
+ #cutter.facetPush(f,i,t)
+ #cutter.edgePush(f,i,t)
+ cutter.pushCutter(f,i,t)
+ f.addInterval(i)
+ drawFiber_clpts(myscreen, f, camvtk.red)
+
+def xfiber(xvals,t,zh,myscreen):
+ for x in xvals:
+ f1 = ocl.Point(x,-0.5,zh) # start point of fiber
+ f2 = ocl.Point(x,1.5,zh) # end point of fiber
+ f = ocl.Fiber( f1, f2)
+ i = ocl.Interval()
+ #cutter.vertexPush(f,i,t)
+ #cutter.facetPush(f,i,t)
+ #cutter.edgePush(f,i,t)
+ cutter.pushCutter(f,i,t)
+ f.addInterval(i)
+ drawFiber_clpts(myscreen, f, camvtk.lblue)
+
+
+
+if __name__ == "__main__":
+ print(ocl.version())
+ myscreen = camvtk.VTKScreen()
+ a = ocl.Point(0,1,0.3)
+ b = ocl.Point(1,0.5,0.0)
+ c = ocl.Point(0.1,0.1,0.0)
+ myscreen.addActor(camvtk.Point(center=(a.x,a.y,a.z), color=(1,0,1)))
+ myscreen.addActor(camvtk.Point(center=(b.x,b.y,b.z), color=(1,0,1)))
+ myscreen.addActor(camvtk.Point(center=(c.x,c.y,c.z), color=(1,0,1)))
+ myscreen.addActor( camvtk.Line(p1=(a.x,a.y,a.z),p2=(c.x,c.y,c.z)) )
+ myscreen.addActor( camvtk.Line(p1=(c.x,c.y,c.z),p2=(b.x,b.y,b.z)) )
+ myscreen.addActor( camvtk.Line(p1=(a.x,a.y,a.z),p2=(b.x,b.y,b.z)) )
+ t = ocl.Triangle(b,c,a)
+ angle = math.pi/4
+ diameter=0.3
+ length=5
+ #cutter = ocl.BallCutter(diameter, length)
+ cutter = ocl.CylCutter(diameter, length)
+ #cutter = ocl.BullCutter(diameter, diameter/4, length)
+ #cutter = ocl.ConeCutter(diameter, angle, length)
+ #cutter = cutter.offsetCutter( 0.1 )
+
+ print("cutter= ", cutter)
+ print("lengt=", cutter.getLength())
+ print("fiber...",)
+ fiber_range=2
+ Nmax = 100
+ yvals = [float(n-float(Nmax)/2)/Nmax*fiber_range for n in range(0,Nmax+1)]
+ xvals = [float(n-float(Nmax)/2)/Nmax*fiber_range for n in range(0,Nmax+1)]
+ zmin = -0.2082
+ zmax = 0.3115
+ zNmax = 20
+ dz = (zmax-zmin)/(zNmax-1)
+ zvals=[]
+ for n in range(0,zNmax):
+ zvals.append(zmin+n*dz)
+ for zh in zvals:
+ yfiber(yvals,t,zh,myscreen)
+ xfiber(xvals,t,zh,myscreen)
+ print("done.")
+ print("rendering...",)
+ myscreen.camera.SetPosition(0.5, 3, 2)
+ myscreen.camera.SetFocalPoint(0.5, 0.5, 0)
+ camvtk.drawArrows(myscreen,center=(-0.5,-0.5,-0.5))
+ camvtk.drawOCLtext(myscreen)
+ myscreen.render()
+ #w2if = vtk.vtkWindowToImageFilter()
+ #w2if.SetInput(myscreen.renWin)
+ #lwr = vtk.vtkPNGWriter()
+ #lwr.SetInput( w2if.GetOutput() )
+ print("done.")
+ myscreen.iren.Start()
+ #raw_input("Press Enter to terminate")
diff -Nru opencamlib-11.10+git201801200005~ubuntu16.04.1/examples/python/fiber/fiber_04_stl.py opencamlib-11.10-1/examples/python/fiber/fiber_04_stl.py
--- opencamlib-11.10+git201801200005~ubuntu16.04.1/examples/python/fiber/fiber_04_stl.py 1970-01-01 00:00:00.000000000 +0000
+++ opencamlib-11.10-1/examples/python/fiber/fiber_04_stl.py 2020-06-14 12:13:19.000000000 +0000
@@ -0,0 +1,125 @@
+import ocl
+import camvtk
+import time
+import vtk
+import datetime
+import math
+
+def drawPoints(myscreen, clpoints, ccpoints):
+ c=camvtk.PointCloud( pointlist=clpoints, collist=ccpoints)
+ c.SetPoints()
+ myscreen.addActor(c )
+
+def drawFiber(myscreen, f, fibercolor=camvtk.red):
+ inter = f.getInts()
+ for i in inter:
+ if not i.empty():
+ ip1 = f.point( i.lower )
+ ip2 = f.point( i.upper )
+ myscreen.addActor( camvtk.Line(p1=(ip1.x,ip1.y,ip1.z),p2=(ip2.x,ip2.y,ip2.z), color=fibercolor) )
+ myscreen.addActor( camvtk.Sphere(center=(ip1.x,ip1.y,ip1.z),radius=0.005, color=camvtk.clColor( i.lower_cc) ) )
+ myscreen.addActor( camvtk.Sphere(center=(ip2.x,ip2.y,ip2.z),radius=0.005, color=camvtk.clColor( i.upper_cc) ) )
+ cc1 = i.lower_cc
+ cc2 = i.upper_cc
+ myscreen.addActor( camvtk.Sphere(center=(cc1.x,cc1.y,cc1.z),radius=0.005, color=camvtk.lgreen ) )
+ myscreen.addActor( camvtk.Sphere(center=(cc2.x,cc2.y,cc2.z),radius=0.005, color=camvtk.lgreen ) )
+ # cutter circle
+ #c1 = camvtk.Circle(center=(ip1.x,ip1.y,ip1.z), radius = 0.3/2, color=fibercolor)
+ #myscreen.addActor(c1)
+ #c2 = camvtk.Circle(center=(ip2.x,ip2.y,ip2.z), radius = 0.3/2, color=fibercolor)
+ #myscreen.addActor(c2)
+
+def drawFiber_clpts(myscreen, f, fibercolor=camvtk.red):
+ inter = f.getInts()
+ for i in inter:
+ if not i.empty():
+ ip1 = f.point( i.lower )
+ ip2 = f.point( i.upper )
+ myscreen.addActor( camvtk.Line(p1=(ip1.x,ip1.y,ip1.z),p2=(ip2.x,ip2.y,ip2.z), color=fibercolor) )
+ myscreen.addActor( camvtk.Sphere(center=(ip1.x,ip1.y,ip1.z),radius=0.005, color=camvtk.clColor( i.lower_cc) ) )
+ myscreen.addActor( camvtk.Sphere(center=(ip2.x,ip2.y,ip2.z),radius=0.005, color=camvtk.clColor( i.upper_cc) ) )
+ #cc1 = i.lower_cc
+ #cc2 = i.upper_cc
+ #myscreen.addActor( camvtk.Sphere(center=(cc1.x,cc1.y,cc1.z),radius=0.005, color=camvtk.lgreen ) )
+ #myscreen.addActor( camvtk.Sphere(center=(cc2.x,cc2.y,cc2.z),radius=0.005, color=camvtk.lgreen ) )
+
+def yfiber(yvals,s,zh,myscreen):
+ for y in yvals:
+ f1 = ocl.Point(-20,y,zh) # start point of fiber
+ f2 = ocl.Point(+20,y,zh) # end point of fiber
+ f = ocl.Fiber( f1, f2)
+ for t in s.getTriangles():
+ i = ocl.Interval()
+ #cutter.vertexPush(f,i,t)
+ #cutter.facetPush(f,i,t)
+ #cutter.edgePush(f,i,t)
+ cutter.pushCutter(f,i,t)
+ f.addInterval(i)
+ drawFiber_clpts(myscreen, f, camvtk.red)
+
+def xfiber(xvals,s,zh,myscreen):
+ for x in xvals:
+ f1 = ocl.Point(x,-20,zh) # start point of fiber
+ f2 = ocl.Point(x,+20,zh) # end point of fiber
+ f = ocl.Fiber( f1, f2)
+ for t in s.getTriangles():
+ i = ocl.Interval()
+ #cutter.vertexPush(f,i,t)
+ #cutter.facetPush(f,i,t)
+ #cutter.edgePush(f,i,t)
+ cutter.pushCutter(f,i,t)
+ f.addInterval(i)
+ drawFiber_clpts(myscreen, f, camvtk.lblue)
+
+if __name__ == "__main__":
+ print(ocl.version() )
+ myscreen = camvtk.VTKScreen()
+ #stl = camvtk.STLSurf("../stl/gnu_tux_mod.stl")
+ stl = camvtk.STLSurf("../../stl/demo.stl")
+ myscreen.addActor(stl)
+ stl.SetWireframe()
+ stl.SetColor((1,1,1))
+ polydata = stl.src.GetOutput()
+ s = ocl.STLSurf()
+ camvtk.vtkPolyData2OCLSTL(polydata, s)
+ print("STL surface read,", s.size(), "triangles")
+
+ cutter = ocl.CylCutter(0.3, 6)
+ print("lengt=", cutter.getLength())
+ print("fiber...",)
+ fiber_range=30
+ Nmax = 200
+ yvals = [float(n-float(Nmax)/2)/Nmax*fiber_range for n in range(0,Nmax+1)]
+ xvals = [float(n-float(Nmax)/2)/Nmax*fiber_range for n in range(0,Nmax+1)]
+ zmin = -0.1
+ zmax = 0.5
+ zNmax = 2
+ dz = (zmax-zmin)/(zNmax-1)
+ zvals=[]
+ #for n in range(0,zNmax):
+ # zvals.append(zmin+n*dz)
+ zvals.append(0.1)
+ #zvals = [ float(n-float(zNmax)/2)/zNmax*fiber_range for n in range(0,zNmax+1)]
+ #print zvals
+ #exit()
+ #cc = ocl.CCPoint()
+ #zh = -0.1
+ #zh = 0.2571567
+
+ for zh in zvals:
+ print("fibers at z=",zh)
+ yfiber(yvals,s,zh,myscreen)
+ xfiber(xvals,s,zh,myscreen)
+
+ print("done.")
+ myscreen.camera.SetPosition(0.5, 3, 2)
+ myscreen.camera.SetFocalPoint(0.5, 0.5, 0)
+ camvtk.drawArrows(myscreen,center=(-0.5,-0.5,-0.5))
+ camvtk.drawOCLtext(myscreen)
+ myscreen.render()
+ #w2if = vtk.vtkWindowToImageFilter()
+ #w2if.SetInput(myscreen.renWin)
+ #lwr = vtk.vtkPNGWriter()
+ #lwr.SetInput( w2if.GetOutput() )
+ myscreen.iren.Start()
+ #raw_input("Press Enter to terminate")
diff -Nru opencamlib-11.10+git201801200005~ubuntu16.04.1/examples/python/fiber/fiber_05_batch.py opencamlib-11.10-1/examples/python/fiber/fiber_05_batch.py
--- opencamlib-11.10+git201801200005~ubuntu16.04.1/examples/python/fiber/fiber_05_batch.py 1970-01-01 00:00:00.000000000 +0000
+++ opencamlib-11.10-1/examples/python/fiber/fiber_05_batch.py 2020-06-14 12:13:19.000000000 +0000
@@ -0,0 +1,86 @@
+import ocl
+import camvtk
+import time
+import vtk
+import datetime
+import math
+
+if __name__ == "__main__":
+ print(ocl.version())
+
+ myscreen = camvtk.VTKScreen()
+
+ a = ocl.Point(0,1,0.3)
+ myscreen.addActor(camvtk.Point(center=(a.x,a.y,a.z), color=(1,0,1)))
+ b = ocl.Point(1,0.5,0.3)
+ myscreen.addActor(camvtk.Point(center=(b.x,b.y,b.z), color=(1,0,1)))
+ c = ocl.Point(0,0,0)
+ myscreen.addActor(camvtk.Point(center=(c.x,c.y,c.z), color=(1,0,1)))
+ myscreen.addActor( camvtk.Line(p1=(a.x,a.y,a.z),p2=(c.x,c.y,c.z)) )
+ myscreen.addActor( camvtk.Line(p1=(c.x,c.y,c.z),p2=(b.x,b.y,b.z)) )
+ myscreen.addActor( camvtk.Line(p1=(a.x,a.y,a.z),p2=(b.x,b.y,b.z)) )
+ t = ocl.Triangle(b,c,a)
+ s = ocl.STLSurf()
+ s.addTriangle(t) # a one-triangle STLSurf
+
+ cutter = ocl.CylCutter(0.3,6)
+ #cutter = ocl.BallCutter(0.3,6)
+ print("fiber...")
+ fiber_range=6
+ Nmax = 800
+ yvals = [float(n-float(Nmax)/2)/Nmax*fiber_range for n in range(0,Nmax+1)]
+ xvals = [float(n-float(Nmax)/2)/Nmax*fiber_range for n in range(0,Nmax+1)]
+ zmin = -0.1
+ zmax = 0.5
+ zNmax = 50
+ dz = (zmax-zmin)/(zNmax-1)
+ zvals=[]
+ #zvals.append(0.2)
+ for n in range(0,zNmax):
+ zvals.append(zmin+n*dz)
+
+ bpc_x = ocl.BatchPushCutter()
+ bpc_x.setXDirection()
+ bpc_x.setSTL(s)
+ bpc_x.setCutter(cutter)
+
+
+ bpc_y = ocl.BatchPushCutter()
+ bpc_y.setYDirection()
+ bpc_y.setSTL(s)
+ bpc_y.setCutter(cutter)
+
+
+ # create fibers
+ for zh in zvals:
+ for y in yvals:
+ f1 = ocl.Point(-0.5,y,zh) # start point of fiber
+ f2 = ocl.Point(1.5,y,zh) # end point of fiber
+ f = ocl.Fiber( f1, f2)
+ bpc_x.appendFiber(f)
+ for x in xvals:
+ f1 = ocl.Point(x,-0.5,zh) # start point of fiber
+ f2 = ocl.Point(x,1.5,zh) # end point of fiber
+ f = ocl.Fiber( f1, f2)
+ bpc_y.appendFiber(f)
+
+ # run
+ bpc_x.run()
+ bpc_y.run()
+ clpoints = bpc_x.getCLPoints()
+ clp2 = bpc_y.getCLPoints()
+ clpoints +=clp2
+ print("rendering raw CL-points.")
+
+ # draw the CL-points
+ camvtk.drawCLPointCloud(myscreen, clpoints)
+ print("done.")
+ myscreen.camera.SetPosition(0.5, 3, 2)
+ myscreen.camera.SetFocalPoint(0.5, 0.5, 0)
+ camvtk.drawArrows(myscreen,center=(-0.5,-0.5,-0.5))
+ camvtk.drawOCLtext(myscreen)
+
+ myscreen.render()
+
+ myscreen.iren.Start()
+ #raw_input("Press Enter to terminate")
diff -Nru opencamlib-11.10+git201801200005~ubuntu16.04.1/examples/python/fiber/fiber_06_batch_stl.py opencamlib-11.10-1/examples/python/fiber/fiber_06_batch_stl.py
--- opencamlib-11.10+git201801200005~ubuntu16.04.1/examples/python/fiber/fiber_06_batch_stl.py 1970-01-01 00:00:00.000000000 +0000
+++ opencamlib-11.10-1/examples/python/fiber/fiber_06_batch_stl.py 2020-06-14 12:13:19.000000000 +0000
@@ -0,0 +1,115 @@
+import ocl
+import camvtk
+import time
+import vtk
+import datetime
+import math
+
+def generateRange(zmin,zmax,zNmax):
+ dz = (float(zmax)-float(zmin))/(zNmax-1)
+ zvals=[]
+ for n in range(0,zNmax):
+ zvals.append(zmin+n*dz)
+ return zvals
+
+
+if __name__ == "__main__":
+ print(ocl.version())
+
+ myscreen = camvtk.VTKScreen()
+ #stl = camvtk.STLSurf("../stl/demo.stl")
+ stl = camvtk.STLSurf("../../stl/gnu_tux_mod.stl")
+ myscreen.addActor(stl)
+ #stl.SetWireframe()
+ stl.SetSurface()
+ stl.SetColor(camvtk.cyan)
+ polydata = stl.src.GetOutput()
+ s = ocl.STLSurf()
+ camvtk.vtkPolyData2OCLSTL(polydata, s)
+ print("STL surface read,", s.size(), "triangles")
+ bounds = s.getBounds()
+ print("STLSurf.Bounds()=", bounds)
+ cutter = ocl.CylCutter(0.3,6)
+ #cutter = ocl.BallCutter(0.3,6)
+
+ cutter.length = 4.0
+ print(cutter)
+ xmin=-1
+ xmax=15
+ N=100
+ ymin=-1
+ ymax=15
+ yvals = generateRange(ymin,ymax,N)
+ xvals = generateRange(xmin,xmax,N)
+ #print xvals
+ zmin = -0.1
+ zmax = 2.75
+ zNmax = 7
+ zvals = generateRange(zmin,zmax,zNmax)
+ print(" calculating waterlines at ", len(zvals)," different z-heights")
+ #print zvals
+ bpc_x = ocl.BatchPushCutter()
+ bpc_y = ocl.BatchPushCutter()
+ bpc_x.setXDirection()
+ bpc_y.setYDirection()
+ bpc_x.setSTL(s)
+ bpc_y.setSTL(s)
+ bpc_x.setCutter(cutter)
+ bpc_y.setCutter(cutter)
+ # create fibers
+ nfibers=0
+ for zh in zvals:
+ for y in yvals:
+ f1 = ocl.Point(xmin,y,zh) # start point of fiber
+ f2 = ocl.Point(xmax,y,zh) # end point of fiber
+ f = ocl.Fiber( f1, f2)
+ bpc_x.appendFiber(f)
+
+ nfibers=nfibers+1
+ for x in xvals:
+ f1 = ocl.Point(x,ymin,zh) # start point of fiber
+ f2 = ocl.Point(x,ymax,zh) # end point of fiber
+ f = ocl.Fiber( f1, f2)
+ bpc_y.appendFiber(f)
+
+ nfibers=nfibers+1
+ # run
+ #t_before = time.time()
+ #bpc2.pushCutter2()
+ #t_after = time.time()
+ #push_calctime = t_after-t_before
+ #print " BPC done in ", push_calctime," s", bpc2.nCalls," push-calls"
+ #print (push_calctime/bpc2.nCalls)*1e6, " us/call"
+
+ t_before = time.time()
+ bpc_x.run()
+ bpc_y.run()
+ t_after = time.time()
+ push_calctime = t_after-t_before
+ print(" BPC 3 done in ", push_calctime," s", bpc_x.getCalls()," push-calls" )
+
+
+ clpoints = bpc_x.getCLPoints()
+ clp2 = bpc_y.getCLPoints()
+ clpoints+=clp2
+ print("got ", len(clpoints), " CL-points")
+ print("rendering raw CL-points.")
+
+ # draw the CL-points
+ camvtk.drawCLPointCloud(myscreen, clpoints)
+ for p in clpoints:
+ myscreen.addActor( camvtk.Sphere(center=(p.x,p.y,p.z),radius=0.02, color=camvtk.clColor( p.cc() ) ) )
+
+
+
+
+ print("done.")
+ myscreen.camera.SetPosition(0.5, 3, 2)
+ myscreen.camera.SetFocalPoint(0.5, 0.5, 0)
+ camvtk.drawArrows(myscreen,center=(-0.5,-0.5,-0.5))
+ camvtk.drawOCLtext(myscreen)
+
+ myscreen.render()
+
+ myscreen.iren.Start()
+ #raw_input("Press Enter to terminate")
diff -Nru opencamlib-11.10+git201801200005~ubuntu16.04.1/examples/python/fiber/fiber_07_weave.py opencamlib-11.10-1/examples/python/fiber/fiber_07_weave.py
--- opencamlib-11.10+git201801200005~ubuntu16.04.1/examples/python/fiber/fiber_07_weave.py 1970-01-01 00:00:00.000000000 +0000
+++ opencamlib-11.10-1/examples/python/fiber/fiber_07_weave.py 2020-06-14 12:13:19.000000000 +0000
@@ -0,0 +1,131 @@
+import ocl
+import camvtk
+import time
+import vtk
+import datetime
+import math
+
+# note 2018.08:
+# the Weave class is not provided to python, so this deprecated example script won't run
+
+if __name__ == "__main__":
+ print(ocl.version())
+ myscreen = camvtk.VTKScreen()
+ a = ocl.Point(0,1,0.3)
+ myscreen.addActor(camvtk.Point(center=(a.x,a.y,a.z), color=(1,0,1)))
+ b = ocl.Point(1,0.5,0.3)
+ myscreen.addActor(camvtk.Point(center=(b.x,b.y,b.z), color=(1,0,1)))
+ c = ocl.Point(0,0,0.1)
+ myscreen.addActor(camvtk.Point(center=(c.x,c.y,c.z), color=(1,0,1)))
+ myscreen.addActor( camvtk.Line(p1=(a.x,a.y,a.z),p2=(c.x,c.y,c.z)) )
+ myscreen.addActor( camvtk.Line(p1=(c.x,c.y,c.z),p2=(b.x,b.y,b.z)) )
+ myscreen.addActor( camvtk.Line(p1=(a.x,a.y,a.z),p2=(b.x,b.y,b.z)) )
+ t = ocl.Triangle(b,c,a)
+ s = ocl.STLSurf()
+ s.addTriangle(t) # a one-triangle STLSurf
+
+ cutter = ocl.CylCutter(0.3, 5)
+ #cutter = ocl.BallCutter(0.4, 5)
+ #cutter = ocl.BullCutter(0.4, 0.1, 5)
+
+ print("fiber...")
+ fiber_range=4
+ Nmax = 100
+ yvals = [float(n-float(Nmax)/2)/Nmax*fiber_range for n in range(0,Nmax+1)]
+ xvals = [float(n-float(Nmax)/2)/Nmax*fiber_range for n in range(0,Nmax+1)]
+ zmin = -0.1
+ zmax = 0.5
+ zNmax = 5
+ dz = (zmax-zmin)/(zNmax-1)
+ zvals=[ 0.23]
+ #zvals.append(0.2)
+ #for n in range(0,zNmax):
+ # zvals.append(zmin+n*dz)
+
+ bpc_x = ocl.BatchPushCutter()
+ bpc_y = ocl.BatchPushCutter()
+ bpc_x.setXDirection()
+ bpc_y.setYDirection()
+ bpc_x.setSTL(s)
+ bpc_y.setSTL(s)
+ bpc_x.setCutter(cutter)
+ bpc_y.setCutter(cutter)
+ # create fibers
+ for zh in zvals:
+ for y in yvals:
+ f1 = ocl.Point(-0.5,y,zh) # start point of fiber
+ f2 = ocl.Point(1.5,y,zh) # end point of fiber
+ f = ocl.Fiber( f1, f2)
+ bpc_x.appendFiber(f)
+ for x in xvals:
+ f1 = ocl.Point(x,-0.5,zh) # start point of fiber
+ f2 = ocl.Point(x,1.5,zh) # end point of fiber
+ f = ocl.Fiber( f1, f2)
+ bpc_y.appendFiber(f)
+
+ # run
+ bpc_x.run()
+ bpc_y.run()
+ clpoints = bpc_x.getCLPoints()
+ clp2 = bpc_y.getCLPoints()
+ clpoints+=clp2
+ xfibers = bpc_x.getFibers()
+ yfibers = bpc_y.getFibers()
+ fibers = xfibers+yfibers
+ print(" got ",len(xfibers)," xfibers")
+ print(" got ",len(yfibers)," yfibers")
+ print("rendering fibers and CL-points.")
+ w = ocl.Weave()
+ print("push fibers to Weave...",)
+ for f in fibers:
+ w.addFiber(f)
+ print("done.")
+ print("Weave build()...",)
+ w.build()
+ print("done")
+ print("face_traverse...")
+ w.face_traverse()
+ print("done.")
+ w_clpts = w.getCLPoints()
+ w_ipts = w.getIPoints()
+ w_edges = w.getEdges()
+ w_loop = w.getLoops()
+
+ print(" weave: got ", len(w_clpts)," CL-points and ", len(w_ipts)," internal points")
+
+ print(" got: ", len(w_edges), " edges")
+ print(" got: ", len(w_loop), " loop points")
+ #zoffset = 0.0
+ #for p in w_clpts:
+ # myscreen.addActor( camvtk.Sphere(center=(p.x,p.y,p.z+zoffset), radius=0.0031, color=camvtk.red ) )
+
+ previous = 0
+ # draw the loop as a yellow line
+ for loop in w_loop:
+ np = 0
+ for p in loop:
+ #myscreen.addActor( camvtk.Sphere(center=(p.x,p.y,p.z+zoffset2), radius=0.006, color=camvtk.pink ) )
+ if np is not 0:
+ myscreen.addActor( camvtk.Line( p1=(previous.x,previous.y, previous.z),
+ p2=(p.x,p.y,p.z), color=camvtk.yellow) )
+ np=np+1
+ previous = p
+
+ # draw edges of weave
+ ne = 0
+ zoffset=0.1
+ dzoffset = 0.0005
+ for e in w_edges:
+ p1 = e[0]
+ p2 = e[1]
+ myscreen.addActor( camvtk.Line( p1=( p1.x,p1.y,p1.z+zoffset+ne*dzoffset), p2=(p2.x,p2.y,p2.z+zoffset+ne*dzoffset) ) )
+ ne = ne+1
+
+ print("done.")
+ myscreen.camera.SetPosition(0.5, 3, 2)
+ myscreen.camera.SetFocalPoint(0.5, 0.5, 0)
+ camvtk.drawArrows(myscreen,center=(-0.5,-0.5,-0.5))
+ camvtk.drawOCLtext(myscreen)
+ myscreen.render()
+ myscreen.iren.Start()
+ #raw_input("Press Enter to terminate")
diff -Nru opencamlib-11.10+git201801200005~ubuntu16.04.1/examples/python/fiber/fiber_08_stl_weave.py opencamlib-11.10-1/examples/python/fiber/fiber_08_stl_weave.py
--- opencamlib-11.10+git201801200005~ubuntu16.04.1/examples/python/fiber/fiber_08_stl_weave.py 1970-01-01 00:00:00.000000000 +0000
+++ opencamlib-11.10-1/examples/python/fiber/fiber_08_stl_weave.py 2020-06-14 12:13:19.000000000 +0000
@@ -0,0 +1,175 @@
+import ocl
+import camvtk
+import time
+import vtk
+import datetime
+import math
+
+# note 2018.08: won't run becayse we don't have ocl.Weave()
+
+def generateRange(zmin,zmax,zNmax):
+ dz = (float(zmax)-float(zmin))/(zNmax-1)
+ zvals=[]
+ for n in range(0,zNmax):
+ zvals.append(zmin+n*dz)
+ return zvals
+
+
+if __name__ == "__main__":
+ print(ocl.version())
+ myscreen = camvtk.VTKScreen()
+ #stl = camvtk.STLSurf("../stl/demo.stl")
+ stl = camvtk.STLSurf("../../stl/gnu_tux_mod.stl")
+ myscreen.addActor(stl)
+ stl.SetWireframe()
+ #stl.SetSurface()
+ stl.SetColor(camvtk.cyan)
+ polydata = stl.src.GetOutput()
+ s = ocl.STLSurf()
+ camvtk.vtkPolyData2OCLSTL(polydata, s)
+ print("STL surface read,", s.size(), "triangles")
+ bounds = s.getBounds()
+ print("STLSurf.Bounds()=", bounds)
+ cutter = ocl.CylCutter(1.6,5)
+ #cutter = ocl.BallCutter(0.3,5)
+
+ print(cutter)
+ xmin=-1
+ xmax=15
+ N=100
+ ymin=-1
+ ymax=15
+ yvals = generateRange(ymin,ymax,N)
+ xvals = generateRange(xmin,xmax,N)
+ #print xvals
+ zmin = -0.1
+ zmax = 2.75
+ zNmax = 5
+ zvals = generateRange(zmin,zmax,zNmax)
+ print(" calculating waterlines at ", len(zvals)," different z-heights")
+ #print zvals
+ bpcx = ocl.BatchPushCutter()
+ bpcy = ocl.BatchPushCutter()
+ bpcx.setXDirection()
+ bpcy.setYDirection()
+ bpcx.setSTL(s)
+ bpcy.setSTL(s)
+ bpcx.setCutter(cutter)
+ bpcy.setCutter(cutter)
+ # create fibers
+ nfibers=0
+ for zh in zvals:
+ for y in yvals:
+ f1 = ocl.Point(xmin,y,zh) # start point of fiber
+ f2 = ocl.Point(xmax,y,zh) # end point of fiber
+ f = ocl.Fiber( f1, f2)
+ bpcx.appendFiber(f)
+ nfibers=nfibers+1
+ for x in xvals:
+ f1 = ocl.Point(x,ymin,zh) # start point of fiber
+ f2 = ocl.Point(x,ymax,zh) # end point of fiber
+ f = ocl.Fiber( f1, f2)
+ bpcy.appendFiber(f)
+ nfibers=nfibers+1
+
+ # run
+ t_before = time.time()
+ bpcx.run()
+ bpcy.run()
+ t_after = time.time()
+ push_calctime = t_after-t_before
+
+
+
+ clpoints = bpcx.getCLPoints()
+ clp2=bpcy.getCLPoints()
+ clpoints+=clp2
+ print("got ", len(clpoints), " CL-points")
+ print("rendering raw CL-points.")
+
+ # draw the CL-points
+ #camvtk.drawCLPointCloud(myscreen, clpoints)
+ #for p in clpoints:
+ # myscreen.addActor( camvtk.Sphere(center=(p.x,p.y,p.z),radius=0.02, color=camvtk.clColor( p.cc() ) ) )
+
+
+ xfibers = bpcx.getFibers()
+ yfibers = bpcy.getFibers()
+ fibers=xfibers+yfibers
+ # sort fibers into different z-levels
+ sorted_fibers=[]
+ for zh in zvals:
+ zlevel_fibers=[]
+ for f in fibers:
+ if f.p1.z == zh:
+ zlevel_fibers.append(f)
+ sorted_fibers.append(zlevel_fibers)
+ print(" found ",len(sorted_fibers)," z-levels")
+
+ n=0
+ loops = []
+ t2_before = time.time()
+ for zlev_fibers in sorted_fibers:
+ print(" z-level ",n," at z=", zvals[n], " has ", len(zlev_fibers), "fibers")
+ n=n+1
+ w = ocl.Weave()
+ for f in zlev_fibers:
+ w.addFiber(f)
+ print(" build()...",)
+ w.build()
+ print("done")
+ print(" split()...",)
+ subw = w.get_components()
+ print(" graph has ", len(subw)," sub-weaves")
+ m=0
+ for sw in subw:
+ print(m," face_traverse...",)
+ t_before = time.time()
+ sw.face_traverse()
+ t_after = time.time()
+ calctime = t_after-t_before
+ print("done in ", calctime," s")
+ w_loop = sw.getLoops()
+ for lop in w_loop:
+ loops.append(lop)
+ m=m+1
+ t2_after = time.time()
+ print(" found", len(loops)," loops")
+ print(" loop extraction took ", t2_after-t2_before," seconds")
+ # draw the loops
+ for lop in loops:
+ n = 0
+ N = len(lop)
+ first_point=ocl.Point(-1,-1,5)
+ previous=ocl.Point(-1,-1,5)
+ for p in lop:
+ if n==0: # don't draw anything on the first iteration
+ previous=p
+ first_point = p
+ elif n== (N-1): # the last point
+ myscreen.addActor( camvtk.Line(p1=(previous.x,previous.y,previous.z),p2=(p.x,p.y,p.z),color=camvtk.yellow) ) # the normal line
+ # and a line from p to the first point
+ myscreen.addActor( camvtk.Line(p1=(p.x,p.y,p.z),p2=(first_point.x,first_point.y,first_point.z),color=camvtk.yellow) )
+ else:
+ myscreen.addActor( camvtk.Line(p1=(previous.x,previous.y,previous.z),p2=(p.x,p.y,p.z),color=camvtk.yellow) )
+ previous=p
+ n=n+1
+
+ t2 = camvtk.Text()
+ stltext = "%s\n%i triangles\n%i waterlines\n%i Fibers\n%i CL-points\n%i pushCutter() calls\n%0.1f seconds\n%0.3f us/call" \
+ % ( str(cutter), s.size(), len(zvals), nfibers, len(clpoints), bpc.nCalls, push_calctime, 1e6* push_calctime/bpc.nCalls )
+ t2.SetText(stltext)
+ t2.SetPos( (50, myscreen.height-200) )
+ myscreen.addActor( t2)
+
+
+ print("done.")
+ myscreen.camera.SetPosition(0.5, 3, 2)
+ myscreen.camera.SetFocalPoint(0.5, 0.5, 0)
+ camvtk.drawArrows(myscreen,center=(-0.5,-0.5,-0.5))
+ camvtk.drawOCLtext(myscreen)
+
+ myscreen.render()
+
+ myscreen.iren.Start()
+ #raw_input("Press Enter to terminate")
diff -Nru opencamlib-11.10+git201801200005~ubuntu16.04.1/examples/python/fiber/fiber_09_ballcutter.py opencamlib-11.10-1/examples/python/fiber/fiber_09_ballcutter.py
--- opencamlib-11.10+git201801200005~ubuntu16.04.1/examples/python/fiber/fiber_09_ballcutter.py 1970-01-01 00:00:00.000000000 +0000
+++ opencamlib-11.10-1/examples/python/fiber/fiber_09_ballcutter.py 2020-06-14 12:13:19.000000000 +0000
@@ -0,0 +1,100 @@
+import ocl
+import camvtk
+import time
+import vtk
+import datetime
+import math
+def drawFiber(myscreen, f, fibercolor=camvtk.red):
+ inter = f.getInts()
+ for i in inter:
+ if not i.empty():
+ ip1 = f.point( i.lower )
+ ip2 = f.point( i.upper )
+ myscreen.addActor( camvtk.Line(p1=(ip1.x,ip1.y,ip1.z),p2=(ip2.x,ip2.y,ip2.z), color=fibercolor) )
+ myscreen.addActor( camvtk.Sphere(center=(ip1.x,ip1.y,ip1.z),radius=0.005, color=camvtk.clColor( i.lower_cc) ) )
+ myscreen.addActor( camvtk.Sphere(center=(ip2.x,ip2.y,ip2.z),radius=0.005, color=camvtk.clColor( i.upper_cc) ) )
+ #cc1 = i.lower_cc
+ #cc2 = i.upper_cc
+ #myscreen.addActor( camvtk.Sphere(center=(cc1.x,cc1.y,cc1.z),radius=0.005, color=camvtk.lgreen ) )
+ #myscreen.addActor( camvtk.Sphere(center=(cc2.x,cc2.y,cc2.z),radius=0.005, color=camvtk.lgreen ) )
+ # cutter circle
+ #c1 = camvtk.Circle(center=(ip1.x,ip1.y,ip1.z), radius = 0.3/2, color=fibercolor)
+ #myscreen.addActor(c1)
+ #c2 = camvtk.Circle(center=(ip2.x,ip2.y,ip2.z), radius = 0.3/2, color=fibercolor)
+ #myscreen.addActor(c2)
+
+if __name__ == "__main__":
+ print(ocl.version())
+
+ myscreen = camvtk.VTKScreen()
+
+ a = ocl.Point(0,1,0.3)
+ myscreen.addActor(camvtk.Point(center=(a.x,a.y,a.z), color=(1,0,1)))
+ b = ocl.Point(1,0.5,0.3)
+ myscreen.addActor(camvtk.Point(center=(b.x,b.y,b.z), color=(1,0,1)))
+ c = ocl.Point(0,0,0)
+ myscreen.addActor(camvtk.Point(center=(c.x,c.y,c.z), color=(1,0,1)))
+ myscreen.addActor( camvtk.Line(p1=(a.x,a.y,a.z),p2=(c.x,c.y,c.z)) )
+ myscreen.addActor( camvtk.Line(p1=(c.x,c.y,c.z),p2=(b.x,b.y,b.z)) )
+ myscreen.addActor( camvtk.Line(p1=(a.x,a.y,a.z),p2=(b.x,b.y,b.z)) )
+ t = ocl.Triangle(b,c,a)
+ s = ocl.STLSurf()
+ s.addTriangle(t) # a one-triangle STLSurf
+ length = 10
+ #cutter = ocl.CylCutter(0.3, length)
+ cutter = ocl.BallCutter(0.3, length)
+
+ print("fiber...")
+ fiber_range=4
+ Nmax = 100
+ yvals = [float(n-float(Nmax)/2)/Nmax*fiber_range for n in range(0,Nmax+1)]
+ xvals = [float(n-float(Nmax)/2)/Nmax*fiber_range for n in range(0,Nmax+1)]
+ zmin = -0.1
+ zmax = 0.5
+ zNmax = 20
+ dz = (zmax-zmin)/(zNmax-1)
+ zvals=[]
+ zvals.append(0.2)
+ for n in range(0,zNmax):
+ zvals.append(zmin+n*dz)
+
+ bpc = ocl.BatchPushCutter()
+ bpc.setSTL(s)
+ bpc.setCutter(cutter)
+ # create fibers
+ for zh in zvals:
+ for y in yvals:
+ f1 = ocl.Point(-0.5,y,zh) # start point of fiber
+ f2 = ocl.Point(1.5,y,zh) # end point of fiber
+ f = ocl.Fiber( f1, f2)
+ bpc.appendFiber(f)
+ for x in xvals:
+ f1 = ocl.Point(x,-0.5,zh) # start point of fiber
+ f2 = ocl.Point(x,1.5,zh) # end point of fiber
+ f = ocl.Fiber( f1, f2)
+ bpc.appendFiber(f)
+
+ # run
+ bpc.run()
+ clpoints = bpc.getCLPoints()
+ fibers = bpc.getFibers()
+ print(" got ",len(fibers)," fibers from bpc")
+ print("rendering fibers and CL-points.")
+ #camvtk.drawCLPointCloud(myscreen, clpoints)
+ for f in fibers:
+ drawFiber(myscreen, f, camvtk.red)
+
+ #exit()
+
+
+
+ print("done.")
+ myscreen.camera.SetPosition(0.5, 3, 2)
+ myscreen.camera.SetFocalPoint(0.5, 0.5, 0)
+ camvtk.drawArrows(myscreen,center=(-0.5,-0.5,-0.5))
+ camvtk.drawOCLtext(myscreen)
+
+ myscreen.render()
+
+ myscreen.iren.Start()
+ #raw_input("Press Enter to terminate")
diff -Nru opencamlib-11.10+git201801200005~ubuntu16.04.1/examples/python/fiber/fiber_10_offsets.py opencamlib-11.10-1/examples/python/fiber/fiber_10_offsets.py
--- opencamlib-11.10+git201801200005~ubuntu16.04.1/examples/python/fiber/fiber_10_offsets.py 1970-01-01 00:00:00.000000000 +0000
+++ opencamlib-11.10-1/examples/python/fiber/fiber_10_offsets.py 2020-06-14 12:13:19.000000000 +0000
@@ -0,0 +1,120 @@
+import ocl
+import camvtk
+import time
+import vtk
+import datetime
+import math
+
+# 2018.08: Weave not wrapped..
+
+def generateRange(zmin,zmax,zNmax):
+ if zNmax>1:
+ dz = (float(zmax)-float(zmin))/(zNmax-1)
+ else:
+ dz = 0
+ zvals=[]
+ for n in range(0,zNmax):
+ zvals.append(zmin+n*dz)
+ return zvals
+
+def waterline(cutter, s, zh, tol = 0.1 ):
+ bpc = ocl.BatchPushCutter()
+ bpc.setSTL(s)
+ bpc.setCutter(cutter)
+ bounds = s.getBounds()
+ xmin= bounds[0] - 2*cutter.getRadius()
+ xmax= bounds[1] + 2*cutter.getRadius()
+ ymin= bounds[2] - 2*cutter.getRadius()
+ ymax= bounds[3] + 2*cutter.getRadius()
+ Nx= int( (xmax-xmin)/tol )
+ Ny= int( (ymax-ymin)/tol )
+ xvals = generateRange(xmin,xmax,Nx)
+ yvals = generateRange(ymin,ymax,Ny)
+ for y in yvals:
+ f1 = ocl.Point(xmin,y,zh) # start point of fiber
+ f2 = ocl.Point(xmax,y,zh) # end point of fiber
+ f = ocl.Fiber( f1, f2)
+ bpc.appendFiber(f)
+ for x in xvals:
+ f1 = ocl.Point(x,ymin,zh) # start point of fiber
+ f2 = ocl.Point(x,ymax,zh) # end point of fiber
+ f = ocl.Fiber( f1, f2)
+ bpc.appendFiber(f)
+ bpc.run()
+ fibers = bpc.getFibers() # get fibers
+ w = ocl.Weave()
+ for f in fibers:
+ w.addFiber(f)
+
+ print(" build()...",)
+ w.build()
+ print("done")
+ print(" split()...",)
+ subw = w.get_components()
+ print("done. graph has", len(subw),"sub-weaves")
+ m=0
+ loops = []
+ for sw in subw:
+ print(m," face_traverse...",)
+ t_before = time.time()
+ sw.face_traverse()
+ t_after = time.time()
+ calctime = t_after-t_before
+ print("done in ", calctime," s.")
+ sw_loops = sw.getLoops()
+ for lop in sw_loops:
+ loops.append(lop)
+ m=m+1
+ return loops
+
+if __name__ == "__main__":
+ print(ocl.version())
+ myscreen = camvtk.VTKScreen()
+ #stl = camvtk.STLSurf("../stl/demo.stl")
+ stl = camvtk.STLSurf("../../stl/gnu_tux_mod.stl")
+ myscreen.addActor(stl)
+ stl.SetWireframe()
+ #stl.SetSurface()
+ stl.SetColor(camvtk.cyan)
+ polydata = stl.src.GetOutput()
+ s = ocl.STLSurf()
+ camvtk.vtkPolyData2OCLSTL(polydata, s)
+ print("STL surface read,", s.size(), "triangles")
+ zh=1.9
+ cutter_diams = generateRange(0.1, 6, 5)
+ loops = []
+ length = 20 # cutter length
+ for diam in cutter_diams:
+ cutter = ocl.CylCutter( diam, length )
+ cutter_loops = waterline(cutter, s, zh, 0.05 )
+ for l in cutter_loops:
+ loops.append(l)
+
+ print("All waterlines done. Got", len(loops)," loops in total.")
+ # draw the loops
+ for lop in loops:
+ n = 0
+ N = len(lop)
+ first_point=ocl.Point(-1,-1,5)
+ previous=ocl.Point(-1,-1,5)
+ for p in lop:
+ if n==0: # don't draw anything on the first iteration
+ previous=p
+ first_point = p
+ elif n== (N-1): # the last point
+ myscreen.addActor( camvtk.Line(p1=(previous.x,previous.y,previous.z),p2=(p.x,p.y,p.z),color=camvtk.yellow) ) # the normal line
+ # and a line from p to the first point
+ myscreen.addActor( camvtk.Line(p1=(p.x,p.y,p.z),p2=(first_point.x,first_point.y,first_point.z),color=camvtk.yellow) )
+ else:
+ myscreen.addActor( camvtk.Line(p1=(previous.x,previous.y,previous.z),p2=(p.x,p.y,p.z),color=camvtk.yellow) )
+ previous=p
+ n=n+1
+
+ print("done.")
+ myscreen.camera.SetPosition(0.5, 3, 2)
+ myscreen.camera.SetFocalPoint(0.5, 0.5, 0)
+ camvtk.drawArrows(myscreen,center=(-0.5,-0.5,-0.5))
+ camvtk.drawOCLtext(myscreen)
+ myscreen.render()
+ myscreen.iren.Start()
+ #raw_input("Press Enter to terminate")
diff -Nru opencamlib-11.10+git201801200005~ubuntu16.04.1/examples/python/fiber/fiber_12_waterline_onetriangle.py opencamlib-11.10-1/examples/python/fiber/fiber_12_waterline_onetriangle.py
--- opencamlib-11.10+git201801200005~ubuntu16.04.1/examples/python/fiber/fiber_12_waterline_onetriangle.py 1970-01-01 00:00:00.000000000 +0000
+++ opencamlib-11.10-1/examples/python/fiber/fiber_12_waterline_onetriangle.py 2020-06-14 12:13:19.000000000 +0000
@@ -0,0 +1,97 @@
+import ocl
+import camvtk
+import time
+import vtk
+import datetime
+import math
+
+# 2018.08: Weave not wrapped
+
+def loop_waterline(zh, cutter,s):
+ fiber_range=2
+ Nmax = 200
+ yvals = [float(n-float(Nmax)/2)/Nmax*fiber_range for n in range(0,Nmax+1)]
+ xvals = [float(n-float(Nmax)/2)/Nmax*fiber_range for n in range(0,Nmax+1)]
+ bpc = ocl.BatchPushCutter()
+ bpc.setXDirection()
+ bpc.setSTL(s)
+ bpc.setCutter(cutter)
+ for y in yvals:
+ f1 = ocl.Point(-fiber_range,y,zh) # start point of fiber
+ f2 = ocl.Point(+fiber_range,y,zh) # end point of fiber
+ f = ocl.Fiber( f1, f2)
+ bpc.appendFiber(f)
+ for x in xvals:
+ f1 = ocl.Point(x,-fiber_range,zh) # start point of fiber
+ f2 = ocl.Point(x,+fiber_range,zh) # end point of fiber
+ f = ocl.Fiber( f1, f2)
+ bpc.appendFiber(f)
+ bpc.run()
+ clpoints = bpc.getCLPoints()
+ fibers = bpc.getFibers()
+ w = ocl.Weave()
+ print("Weave...",)
+ for f in fibers:
+ w.addFiber(f)
+ print("build()...",)
+ w.build()
+ print("face_traverse()...",)
+ w.face_traverse()
+ print("done.")
+ return w.getLoops()
+
+def drawLoop(myscreen, w_loop): # draw the loop as a yellow line
+ previous = 0
+ for loop in w_loop:
+ np = 0
+ for p in loop:
+ if np is not 0:
+ myscreen.addActor( camvtk.Line( p1=(previous.x,previous.y, previous.z),
+ p2=(p.x,p.y,p.z), color=camvtk.yellow) )
+ np=np+1
+ previous = p
+
+if __name__ == "__main__":
+ print(ocl.version())
+ myscreen = camvtk.VTKScreen()
+ a = ocl.Point(0,1,0.3)
+ myscreen.addActor(camvtk.Point(center=(a.x,a.y,a.z), color=(1,0,1)))
+ b = ocl.Point(1,0.5,0.3)
+ myscreen.addActor(camvtk.Point(center=(b.x,b.y,b.z), color=(1,0,1)))
+ c = ocl.Point(0,0,0.1)
+ myscreen.addActor(camvtk.Point(center=(c.x,c.y,c.z), color=(1,0,1)))
+ myscreen.addActor( camvtk.Line(p1=(a.x,a.y,a.z),p2=(c.x,c.y,c.z)) )
+ myscreen.addActor( camvtk.Line(p1=(c.x,c.y,c.z),p2=(b.x,b.y,b.z)) )
+ myscreen.addActor( camvtk.Line(p1=(a.x,a.y,a.z),p2=(b.x,b.y,b.z)) )
+ t = ocl.Triangle(b,c,a)
+ s = ocl.STLSurf()
+ s.addTriangle(t) # a one-triangle STLSurf
+ diameter = 0.4
+ angle = math.pi/4
+ length = 5
+ cutter = ocl.CylCutter(0.3, 5)
+ #cutter = ocl.BallCutter(0.4, 5)
+ #cutter = ocl.BullCutter(0.4, 0.1, 5)
+ #cutter = ocl.ConeCutter(diameter, angle, length)
+ print(cutter)
+ zstart = 0
+ zend = 0.35
+ zvals=[]
+ Nz = 7
+ for n in range(0,Nz):
+ zvals.append( zstart + n*(zend-zstart)/float(Nz-1) )
+ for zh in zvals:
+ print("zh=", zh)
+ w_loop = loop_waterline(zh, cutter,s)
+ drawLoop( myscreen, w_loop )
+
+ print("done.")
+ myscreen.camera.SetPosition(0.5, 3, 2)
+ myscreen.camera.SetFocalPoint(0.5, 0.5, 0)
+ camvtk.drawArrows(myscreen,center=(-0.5,-0.5,-0.5))
+ camvtk.drawOCLtext(myscreen)
+
+ myscreen.render()
+
+ myscreen.iren.Start()
+ #raw_input("Press Enter to terminate")
diff -Nru opencamlib-11.10+git201801200005~ubuntu16.04.1/examples/python/fiber/fiber_13_onetri_cutter_comparison.py opencamlib-11.10-1/examples/python/fiber/fiber_13_onetri_cutter_comparison.py
--- opencamlib-11.10+git201801200005~ubuntu16.04.1/examples/python/fiber/fiber_13_onetri_cutter_comparison.py 1970-01-01 00:00:00.000000000 +0000
+++ opencamlib-11.10-1/examples/python/fiber/fiber_13_onetri_cutter_comparison.py 2020-06-14 12:13:19.000000000 +0000
@@ -0,0 +1,141 @@
+import ocl
+import camvtk
+import time
+import vtk
+import datetime
+import math
+
+def drawPoints(myscreen, clpoints, ccpoints):
+ c=camvtk.PointCloud( pointlist=clpoints, collist=ccpoints)
+ c.SetPoints()
+ myscreen.addActor(c )
+
+def drawFiber(myscreen, f, fibercolor):
+ inter = f.getInts()
+ print("fiber has ", len(inter) , " intervals")
+ for i in inter:
+ if not i.empty():
+ ip1 = f.point( i.lower )
+ ip2 = f.point( i.upper )
+ myscreen.addActor( camvtk.Line(p1=(ip1.x,ip1.y,ip1.z),p2=(ip2.x,ip2.y,ip2.z), color=fibercolor) )
+ myscreen.addActor( camvtk.Sphere(center=(ip1.x,ip1.y,ip1.z),radius=0.005, color=camvtk.clColor( i.lower_cc) ) )
+ myscreen.addActor( camvtk.Sphere(center=(ip2.x,ip2.y,ip2.z),radius=0.005, color=camvtk.clColor( i.upper_cc) ) )
+ #cc1 = i.lower_cc
+ #cc2 = i.upper_cc
+ #myscreen.addActor( camvtk.Sphere(center=(cc1.x,cc1.y,cc1.z),radius=0.005, color=camvtk.lgreen ) )
+ #myscreen.addActor( camvtk.Sphere(center=(cc2.x,cc2.y,cc2.z),radius=0.005, color=camvtk.lgreen ) )
+ # cutter circle
+ #c1 = camvtk.Circle(center=(ip1.x,ip1.y,ip1.z), radius = 0.3/2, color=fibercolor)
+ #myscreen.addActor(c1)
+ #c2 = camvtk.Circle(center=(ip2.x,ip2.y,ip2.z), radius = 0.3/2, color=fibercolor)
+ #myscreen.addActor(c2)
+
+def drawFiber_clpts(myscreen, f, clcolor):
+ inter = f.getInts()
+ #print "fiber has ", len(inter) , " intervals"
+ for i in inter:
+ if not i.empty():
+ ip1 = f.point( i.lower )
+ ip2 = f.point( i.upper )
+ #myscreen.addActor( camvtk.Line(p1=(ip1.x,ip1.y,ip1.z),p2=(ip2.x,ip2.y,ip2.z), color=fibercolor) )
+ sphcolor = camvtk.clColor( i.lower_cc)
+ myscreen.addActor( camvtk.Sphere(center=(ip1.x,ip1.y,ip1.z),radius=0.005, color=sphcolor ) )
+ sphcolor = camvtk.clColor( i.upper_cc)
+ myscreen.addActor( camvtk.Sphere(center=(ip2.x,ip2.y,ip2.z),radius=0.005, color=sphcolor ) )
+ #cc1 = i.lower_cc
+ #cc2 = i.upper_cc
+ #myscreen.addActor( camvtk.Sphere(center=(cc1.x,cc1.y,cc1.z),radius=0.005, color=camvtk.pink ) )
+ #myscreen.addActor( camvtk.Sphere(center=(cc2.x,cc2.y,cc2.z),radius=0.005, color=camvtk.pink ) )
+
+def yfiber(yvals,t,zh,myscreen,cutter,color):
+ for y in yvals:
+ f1 = ocl.Point(-0.5,y,zh) # start point of fiber
+ f2 = ocl.Point(1.5,y,zh) # end point of fiber
+ f = ocl.Fiber( f1, f2)
+ i = ocl.Interval()
+ #cutter.vertexPush(f,i,t)
+ #cutter.facetPush(f,i,t)
+ #cutter.edgePush(f,i,t)
+ cutter.pushCutter(f,i,t)
+ f.addInterval(i)
+ drawFiber_clpts(myscreen, f, color)
+
+def xfiber(xvals,t,zh,myscreen,cutter,color):
+ for x in xvals:
+ f1 = ocl.Point(x,-0.5,zh) # start point of fiber
+ f2 = ocl.Point(x,1.5,zh) # end point of fiber
+ f = ocl.Fiber( f1, f2)
+ i = ocl.Interval()
+ #cutter.vertexPush(f,i,t)
+ #cutter.facetPush(f,i,t)
+ #cutter.edgePush(f,i,t)
+ cutter.pushCutter(f,i,t)
+ f.addInterval(i)
+ drawFiber_clpts(myscreen, f, color)
+
+def oneCutterWaterline(myscreen, cutter, zh, color):
+ fiber_range=2
+ Nmax = 100
+ yvals = [float(n-float(Nmax)/2)/Nmax*fiber_range for n in range(0,Nmax+1)]
+ xvals = [float(n-float(Nmax)/2)/Nmax*fiber_range for n in range(0,Nmax+1)]
+ yfiber(yvals,t,zh,myscreen,cutter, color)
+ xfiber(xvals,t,zh,myscreen,cutter, color)
+
+if __name__ == "__main__":
+ print(ocl.version())
+ myscreen = camvtk.VTKScreen()
+ myscreen.camera.SetPosition(0.5, 3, 2)
+ myscreen.camera.SetFocalPoint(0.5, 0.5, 0)
+ camvtk.drawArrows(myscreen,center=(-0.5,-0.5,-0.5))
+ camvtk.drawOCLtext(myscreen)
+
+ a = ocl.Point(0,1,0.2)
+ b = ocl.Point(1,0.5,0.0)
+ c = ocl.Point(0.1,0.1,0.0)
+ myscreen.addActor(camvtk.Point(center=(a.x,a.y,a.z), color=(1,0,1)))
+ myscreen.addActor(camvtk.Point(center=(b.x,b.y,b.z), color=(1,0,1)))
+ myscreen.addActor(camvtk.Point(center=(c.x,c.y,c.z), color=(1,0,1)))
+ myscreen.addActor( camvtk.Line(p1=(a.x,a.y,a.z),p2=(c.x,c.y,c.z)) )
+ myscreen.addActor( camvtk.Line(p1=(c.x,c.y,c.z),p2=(b.x,b.y,b.z)) )
+ myscreen.addActor( camvtk.Line(p1=(a.x,a.y,a.z),p2=(b.x,b.y,b.z)) )
+ t = ocl.Triangle(b,c,a)
+ angle = math.pi/4
+ diameter=0.3
+ length=5
+ cutter1 = ocl.BallCutter(diameter, length)
+ cutter2 = ocl.CylCutter(diameter, length)
+ cutter3 = ocl.BullCutter(diameter, diameter/4, length)
+ cutter4 = ocl.ConeCutter(diameter, angle, length)
+ #cutter = cutter.offsetCutter( 0.1 )
+
+
+ fiber_range=2
+ Nmax = 50
+ yvals = [float(n-float(Nmax)/2)/Nmax*fiber_range for n in range(0,Nmax+1)]
+ xvals = [float(n-float(Nmax)/2)/Nmax*fiber_range for n in range(0,Nmax+1)]
+ zmin = -0.1
+ zmax = 0.25
+ zNmax =5
+ dz = (zmax-zmin)/(zNmax-1)
+ zvals=[]
+ for n in range(0,zNmax):
+ zvals.append(zmin+n*dz)
+
+ for zh in zvals:
+ oneCutterWaterline(myscreen, cutter1, zh, camvtk.yellow)
+ oneCutterWaterline(myscreen, cutter2, zh, camvtk.cyan)
+ oneCutterWaterline(myscreen, cutter3, zh, camvtk.mag)
+ oneCutterWaterline(myscreen, cutter4, zh, camvtk.mag)
+ #yfiber(yvals,t,zh,myscreen)
+ #xfiber(xvals,t,zh,myscreen)
+
+ print("done.")
+
+ myscreen.render()
+ #w2if = vtk.vtkWindowToImageFilter()
+ #w2if.SetInput(myscreen.renWin)
+ #lwr = vtk.vtkPNGWriter()
+ #lwr.SetInput( w2if.GetOutput() )
+
+ myscreen.iren.Start()
+ #raw_input("Press Enter to terminate")
diff -Nru opencamlib-11.10+git201801200005~ubuntu16.04.1/examples/python/fiber/fiber_14_z-levels_cc-colors.py opencamlib-11.10-1/examples/python/fiber/fiber_14_z-levels_cc-colors.py
--- opencamlib-11.10+git201801200005~ubuntu16.04.1/examples/python/fiber/fiber_14_z-levels_cc-colors.py 1970-01-01 00:00:00.000000000 +0000
+++ opencamlib-11.10-1/examples/python/fiber/fiber_14_z-levels_cc-colors.py 2020-06-14 12:13:19.000000000 +0000
@@ -0,0 +1,138 @@
+import ocl
+import camvtk
+import time
+import vtk
+import datetime
+import math
+
+def drawFiber_clpts(myscreen, f, fibercolor=camvtk.red):
+ inter = f.getInts()
+ #print "fiber has ", len(inter) , " intervals"
+ for i in inter:
+ if not i.empty():
+ ip1 = f.point( i.lower )
+ ip2 = f.point( i.upper )
+ ballradius = 0.002
+ ballradius = 0.005
+ #myscreen.addActor( camvtk.Line(p1=(ip1.x,ip1.y,ip1.z),p2=(ip2.x,ip2.y,ip2.z), color=fibercolor) )
+ myscreen.addActor( camvtk.Sphere(center=(ip1.x,ip1.y,ip1.z),radius=ballradius, color=camvtk.clColor( i.lower_cc) ) )
+ myscreen.addActor( camvtk.Sphere(center=(ip2.x,ip2.y,ip2.z),radius=ballradius, color=camvtk.clColor( i.upper_cc) ) )
+
+ #cc1 = i.lower_cc
+ #cc2 = i.upper_cc
+ #myscreen.addActor( camvtk.Sphere(center=(cc1.x,cc1.y,cc1.z),radius=0.005, color=camvtk.pink ) )
+ #myscreen.addActor( camvtk.Sphere(center=(cc2.x,cc2.y,cc2.z),radius=0.005, color=camvtk.pink ) )
+
+# colors from camvtk.py:
+# ocl.CCType.VERTEX: col = red
+# ocl.CCType.EDGE_HORIZ: col = orange
+# ocl.CCType.EDGE_SHAFT: col = mag
+
+def yfiber(yvals,t,zh,myscreen):
+ for y in yvals:
+ f1 = ocl.Point(-3.5,y,zh) # start point of fiber
+ f2 = ocl.Point(3.5,y,zh) # end point of fiber
+ f = ocl.Fiber( f1, f2)
+ i = ocl.Interval()
+ cutter.pushCutter(f,i,t)
+ f.addInterval(i)
+ drawFiber_clpts(myscreen, f, camvtk.red)
+
+def xfiber(xvals,t,zh,myscreen):
+ for x in xvals:
+ f1 = ocl.Point(x,-15.5,zh) # start point of fiber
+ f2 = ocl.Point(x,55.5,zh) # end point of fiber
+ f = ocl.Fiber( f1, f2)
+ i = ocl.Interval()
+ cutter.pushCutter(f,i,t)
+ f.addInterval(i)
+ drawFiber_clpts(myscreen, f, camvtk.lblue)
+
+if __name__ == "__main__":
+ print(ocl.version())
+ myscreen = camvtk.VTKScreen()
+
+ ztri = 0.3 # this is the shallow case
+ #ztri = 0.8 # this produces the steep case where we hit the circular rim
+
+ ztri_lo = 0.1
+ a = ocl.Point(0,1,ztri)
+ b = ocl.Point(1,0.5,ztri)
+ c = ocl.Point(0.2,0.2,ztri_lo)
+
+ a = ocl.Point(0,1,0.3)
+ b = ocl.Point(1,0.5,0.3)
+ c = ocl.Point(0,0,0)
+
+ myscreen.addActor(camvtk.Point(center=(a.x,a.y,a.z), color=(1,0,1)))
+ myscreen.addActor(camvtk.Point(center=(b.x,b.y,b.z), color=(1,0,1)))
+ myscreen.addActor(camvtk.Point(center=(c.x,c.y,c.z), color=(1,0,1)))
+ myscreen.addActor( camvtk.Line(p1=(a.x,a.y,a.z),p2=(c.x,c.y,c.z)) )
+ myscreen.addActor( camvtk.Line(p1=(c.x,c.y,c.z),p2=(b.x,b.y,b.z)) )
+ myscreen.addActor( camvtk.Line(p1=(a.x,a.y,a.z),p2=(b.x,b.y,b.z)) )
+ t = ocl.Triangle(b,c,a)
+ angle = math.pi/5
+ diameter=0.6
+ length=25
+ cutter = ocl.BallCutter(diameter, length)
+ #cutter = ocl.CylCutter(diameter, length)
+ #cutter = ocl.BullCutter(diameter, diameter/4, length)
+ #cutter = ocl.ConeCutter(diameter, angle, length)
+ #cutter = cutter.offsetCutter( 0.1 )
+
+ #cutter = ocl.CompCylCutter(diameter, length)
+ #cutter = ocl.CompBallCutter(diameter, length)
+
+ #cutter = ocl.CylConeCutter(diameter/float(3), diameter, math.pi/float(9))
+ cutter = ocl.BallConeCutter(diameter/float(3), diameter, math.pi/float(5))
+
+
+ print("cutter= ", cutter)
+ print("length=", cutter.getLength())
+ print("fiber...")
+ fiberrange=5
+ Nmax = 100
+ yvals = [float(n-float(Nmax)/2)/Nmax*fiberrange for n in range(0,Nmax+1)]
+ xvals = [float(n-float(Nmax)/2)/Nmax*fiberrange for n in range(0,Nmax+1)]
+ """
+ zmin = ztri_lo - 0.2
+ zmax = ztri
+ zNmax = 20
+ dz = (zmax-zmin)/(zNmax-1)
+ zvals=[]
+ for n in range(0,zNmax):
+ zvals.append(zmin+n*dz)
+ """
+
+ zheights=[]
+ Nmax=30
+ zmin=-0.85
+ zmax= 0.3
+ dz = (zmax-zmin)/float(Nmax-1)
+ z = zmin
+ for n in range(Nmax):
+ zheights.append(z)
+ z=z+dz
+ #zheights= []
+ #zheights.append(-0.25)
+
+ print(len(zheights)," to do: ",)
+ n=0
+ for zh in zheights:
+ print(n,)
+ yfiber(yvals,t,zh,myscreen)
+ xfiber(xvals,t,zh,myscreen)
+ n=n+1
+ print("done.")
+ myscreen.camera.SetPosition(-1, -1, 3)
+ myscreen.camera.SetFocalPoint(0.5, 0.5, 0)
+ camvtk.drawArrows(myscreen,center=(-0.5,-0.5,-0.5))
+ camvtk.drawOCLtext(myscreen)
+ myscreen.render()
+ #w2if = vtk.vtkWindowToImageFilter()
+ #w2if.SetInput(myscreen.renWin)
+ #lwr = vtk.vtkPNGWriter()
+ #lwr.SetInput( w2if.GetOutput() )
+
+ myscreen.iren.Start()
+ #raw_input("Press Enter to terminate")
diff -Nru opencamlib-11.10+git201801200005~ubuntu16.04.1/examples/python/fiber/fiber_15_conecutter_anim.py opencamlib-11.10-1/examples/python/fiber/fiber_15_conecutter_anim.py
--- opencamlib-11.10+git201801200005~ubuntu16.04.1/examples/python/fiber/fiber_15_conecutter_anim.py 1970-01-01 00:00:00.000000000 +0000
+++ opencamlib-11.10-1/examples/python/fiber/fiber_15_conecutter_anim.py 2020-06-14 12:13:19.000000000 +0000
@@ -0,0 +1,142 @@
+import ocl
+import camvtk
+import time
+import vtk
+import datetime
+import math
+import os
+
+def drawFiber_clpts(myscreen, f, fibercolor=camvtk.red):
+ inter = f.getInts()
+ #print "fiber has ", len(inter) , " intervals"
+ for i in inter:
+ if not i.empty():
+ ip1 = f.point( i.lower )
+ ip2 = f.point( i.upper )
+ #myscreen.addActor( camvtk.Line(p1=(ip1.x,ip1.y,ip1.z),p2=(ip2.x,ip2.y,ip2.z), color=fibercolor) )
+ myscreen.addActor( camvtk.Sphere(center=(ip1.x,ip1.y,ip1.z),radius=0.005, color=camvtk.clColor( i.lower_cc) ) )
+ myscreen.addActor( camvtk.Sphere(center=(ip2.x,ip2.y,ip2.z),radius=0.005, color=camvtk.clColor( i.upper_cc) ) )
+ #cc1 = i.lower_cc
+ #cc2 = i.upper_cc
+ #myscreen.addActor( camvtk.Sphere(center=(cc1.x,cc1.y,cc1.z),radius=0.005, color=camvtk.pink ) )
+ #myscreen.addActor( camvtk.Sphere(center=(cc2.x,cc2.y,cc2.z),radius=0.005, color=camvtk.pink ) )
+
+# colors from camvtk.py:
+# ocl.CCType.VERTEX: col = red
+# ocl.CCType.EDGE_HORIZ: col = orange
+# ocl.CCType.EDGE_SHAFT: col = mag
+
+def yfiber(cutter,yvals,t,zh,myscreen):
+ for y in yvals:
+ f1 = ocl.Point(-5.5,y,zh) # start point of fiber
+ f2 = ocl.Point(5.5,y,zh) # end point of fiber
+ f = ocl.Fiber( f1, f2)
+ i = ocl.Interval()
+ cutter.pushCutter(f,i,t)
+ f.addInterval(i)
+ drawFiber_clpts(myscreen, f, camvtk.red)
+
+def xfiber(cutter,xvals,t,zh,myscreen):
+ for x in xvals:
+ f1 = ocl.Point(x,-5.5,zh) # start point of fiber
+ f2 = ocl.Point(x,5.5,zh) # end point of fiber
+ f = ocl.Fiber( f1, f2)
+ i = ocl.Interval()
+ cutter.pushCutter(f,i,t)
+ f.addInterval(i)
+ drawFiber_clpts(myscreen, f, camvtk.lblue)
+
+def drawScreen(a,b,c,filename,write_flag):
+ print(ocl.version())
+ myscreen = camvtk.VTKScreen()
+ z_hi = a.z
+ if b.z > z_hi:
+ z_hi = b.z
+ if c.z > z_hi:
+ z_hi = c.z
+
+ z_lo = a.z
+ if b.z < z_lo:
+ z_lo = b.z
+ if c.z < z_lo:
+ z_lo = c.z
+ #z_hi = 0.3 # this is the shallow case
+ #ztri = 0.8 # this produces the steep case where we hit the circular rim
+
+ #z_lo = 0.1
+ #a = ocl.Point(0,1,ztri)
+ #b = ocl.Point(1,0.5,ztri)
+ #c = ocl.Point(0.2,0.2,ztri_lo)
+
+ myscreen.addActor(camvtk.Point(center=(a.x,a.y,a.z), color=(1,0,1)))
+ myscreen.addActor(camvtk.Point(center=(b.x,b.y,b.z), color=(1,0,1)))
+ myscreen.addActor(camvtk.Point(center=(c.x,c.y,c.z), color=(1,0,1)))
+ myscreen.addActor( camvtk.Line(p1=(a.x,a.y,a.z),p2=(c.x,c.y,c.z)) )
+ myscreen.addActor( camvtk.Line(p1=(c.x,c.y,c.z),p2=(b.x,b.y,b.z)) )
+ myscreen.addActor( camvtk.Line(p1=(a.x,a.y,a.z),p2=(b.x,b.y,b.z)) )
+ t = ocl.Triangle(b,c,a)
+ angle = math.pi/5
+ diameter=0.3
+ length=5
+ #cutter = ocl.BallCutter(diameter, length)
+ #cutter = ocl.CylCutter(diameter, length)
+ #cutter = ocl.BullCutter(diameter, diameter/4, length)
+ cutter = ocl.ConeCutter(diameter, angle, length)
+ #cutter = cutter.offsetCutter( 0.1 )
+
+ print("cutter= ", cutter)
+ print("length=", cutter.getLength())
+ print("fiber...")
+ fiber_range=2
+ Nmax = 100
+ yvals = [float(n-float(Nmax)/2)/Nmax*fiber_range for n in range(0,Nmax+1)]
+ xvals = [float(n-float(Nmax)/2)/Nmax*fiber_range for n in range(0,Nmax+1)]
+ zmin = z_lo - 0.3
+ zmax = z_hi
+ zNmax = 20
+ dz = (zmax-zmin)/(zNmax-1)
+ zvals=[]
+ for n in range(0,zNmax):
+ zvals.append(zmin+n*dz)
+ for zh in zvals:
+ yfiber(cutter,yvals,t,zh,myscreen)
+ xfiber(cutter,xvals,t,zh,myscreen)
+ print("done.")
+ myscreen.camera.SetPosition(-2, -1, 3)
+ myscreen.camera.SetFocalPoint(1.0, 0.0, -0.5)
+ camvtk.drawArrows(myscreen,center=(-0.5,-0.5,-0.5))
+ camvtk.drawOCLtext(myscreen)
+ myscreen.render()
+ """
+ w2if = vtk.vtkWindowToImageFilter()
+ w2if.SetInput(myscreen.renWin)
+ lwr = vtk.vtkPNGWriter()
+ lwr.SetInput( w2if.GetOutput() )
+ w2if.Modified()
+ lwr.SetFileName(filename)
+ if write_flag:
+ lwr.Write()
+ print("wrote ",filename)
+ """
+
+ #myscreen.iren.Start()
+ #raw_input("Press Enter to terminate")
+
+if __name__ == "__main__":
+ ztri = 0.3 # this is the shallow case
+ #ztri = 0.8 # this produces the steep case where we hit the circular rim
+ ztri_lo = 0.1
+ Nmax = 300
+ thetamax = 2*math.pi
+ for n in range(0,Nmax):
+ theta=thetamax/Nmax
+ a = ocl.Point(0,1,ztri)
+ a.xRotate(theta*n)
+ b = ocl.Point(1,0.0,0)
+ b.xRotate(theta*n)
+ c = ocl.Point(0.2,0.0,ztri)
+ c.xRotate(theta*n)
+ current_dir = os.getcwd()
+ filename = current_dir + "/frames/conecutter_"+ ('%05d' % n)+".png"
+ drawScreen(a,b,c,filename, 1)
+
diff -Nru opencamlib-11.10+git201801200005~ubuntu16.04.1/examples/python/fiber/fiber_15_weave2.py opencamlib-11.10-1/examples/python/fiber/fiber_15_weave2.py
--- opencamlib-11.10+git201801200005~ubuntu16.04.1/examples/python/fiber/fiber_15_weave2.py 1970-01-01 00:00:00.000000000 +0000
+++ opencamlib-11.10-1/examples/python/fiber/fiber_15_weave2.py 2020-06-14 12:13:19.000000000 +0000
@@ -0,0 +1,143 @@
+import ocl
+import camvtk
+import time
+import vtk
+import datetime
+import math
+
+# 2018.08: Weave not wrapped
+
+def drawVertices(myscreen, weave, vertexType, vertexRadius, vertexColor):
+ pts = weave.getVertices( vertexType )
+ print(" got ",len(pts)," of type ", vertexType)
+ for p in pts:
+ myscreen.addActor( camvtk.Sphere(center=(p.x,p.y,p.z), radius=vertexRadius, color=vertexColor ) )
+
+if __name__ == "__main__":
+ print(ocl.version())
+ myscreen = camvtk.VTKScreen()
+ a = ocl.Point(0,1,0.3)
+ #myscreen.addActor(camvtk.Point(center=(a.x,a.y,a.z), color=(1,0,1)))
+ b = ocl.Point(1,0.5,0.3)
+ #myscreen.addActor(camvtk.Point(center=(b.x,b.y,b.z), color=(1,0,1)))
+ c = ocl.Point(0,0,0.1)
+ #myscreen.addActor(camvtk.Point(center=(c.x,c.y,c.z), color=(1,0,1)))
+ #myscreen.addActor( camvtk.Line(p1=(a.x,a.y,a.z),p2=(c.x,c.y,c.z)) )
+ #myscreen.addActor( camvtk.Line(p1=(c.x,c.y,c.z),p2=(b.x,b.y,b.z)) )
+ #myscreen.addActor( camvtk.Line(p1=(a.x,a.y,a.z),p2=(b.x,b.y,b.z)) )
+
+ # a second triangle
+ offset=ocl.Point(0.51,0.51,0)
+ a2 = a+ offset
+ b2 = b+ offset
+ c2 = c+ offset
+ t2 = ocl.Triangle(b2,c2,a2)
+
+ t = ocl.Triangle(b,c,a)
+ s = ocl.STLSurf()
+ s.addTriangle(t) # a one-triangle STLSurf
+ s.addTriangle(t2)
+
+ cutter = ocl.CylCutter(0.3, 5)
+ #cutter = ocl.BallCutter(0.4, 5)
+ #cutter = ocl.BullCutter(0.4, 0.1, 5)
+
+ print("fiber...")
+ fiber_range=7
+ Nmax = 200
+ yvals = [float(n-float(Nmax)/2)/Nmax*float(fiber_range) for n in range(0,Nmax+1)]
+ xvals = [float(n-float(Nmax)/2)/Nmax*float(fiber_range) for n in range(0,Nmax+1)]
+
+ zvals=[ 0.23]
+
+
+ bpc_x = ocl.BatchPushCutter()
+ bpc_y = ocl.BatchPushCutter()
+ bpc_x.setXDirection()
+ bpc_y.setYDirection()
+ bpc_x.setSTL(s)
+ bpc_y.setSTL(s)
+ bpc_x.setCutter(cutter)
+ bpc_y.setCutter(cutter)
+ # create fibers
+ for zh in zvals:
+ for y in yvals:
+ f1 = ocl.Point(-5.5,y,zh) # start point of fiber
+ f2 = ocl.Point(5.5,y,zh) # end point of fiber
+ f = ocl.Fiber( f1, f2)
+ bpc_x.appendFiber(f)
+ for x in xvals:
+ f1 = ocl.Point(x,-5.5,zh) # start point of fiber
+ f2 = ocl.Point(x,5.5,zh) # end point of fiber
+ f = ocl.Fiber( f1, f2)
+ bpc_y.appendFiber(f)
+
+ # run
+ bpc_x.run()
+ bpc_y.run()
+ #clpoints = bpc_x.getCLPoints()
+ #clp2 = bpc_y.getCLPoints()
+ #clpoints+=clp2
+ xfibers = bpc_x.getFibers()
+ yfibers = bpc_y.getFibers()
+ fibers = xfibers+yfibers
+ print(" got ",len(xfibers)," xfibers")
+ print(" got ",len(yfibers)," yfibers")
+ print("rendering fibers and CL-points.")
+ w = ocl.Weave()
+ print("push fibers to Weave...",)
+ for f in fibers:
+ w.addFiber(f)
+ print("done.")
+ print("Weave build()...",)
+ #w.build()
+ w.build()
+ print("done")
+ print("face_traverse...")
+ w.face_traverse()
+ print("done.")
+ w_clpts = w.getCLVertices()
+ w_ipts = w.getINTVertices()
+ w_edges = w.getEdges()
+ w_loop = w.getLoops()
+ vertexRadius = 0.007
+ drawVertices(myscreen, w, ocl.WeaveVertexType.CL, vertexRadius, camvtk.red)
+ drawVertices(myscreen, w, ocl.WeaveVertexType.INT, vertexRadius, camvtk.orange)
+ drawVertices(myscreen, w, ocl.WeaveVertexType.FULLINT, vertexRadius, camvtk.yellow)
+ drawVertices(myscreen, w, ocl.WeaveVertexType.ADJ, vertexRadius, camvtk.green)
+ drawVertices(myscreen, w, ocl.WeaveVertexType.TWOADJ, vertexRadius, camvtk.lblue)
+
+ print(" got: ", len(w_edges), " edges")
+ print(" got: ", len(w_loop), " loop points")
+
+
+ previous = 0
+ # draw the loop as a yellow line
+ for loop in w_loop:
+ np = 0
+ for p in loop:
+ #myscreen.addActor( camvtk.Sphere(center=(p.x,p.y,p.z+zoffset2), radius=0.006, color=camvtk.pink ) )
+ if np is not 0:
+ myscreen.addActor( camvtk.Line( p1=(previous.x,previous.y, previous.z),
+ p2=(p.x,p.y,p.z), color=camvtk.yellow) )
+ np=np+1
+ previous = p
+
+ # draw edges of weave
+ ne = 0
+ zoffset=0.0 # 1
+ dzoffset = 0.000 # 5
+ for e in w_edges:
+ p1 = e[0]
+ p2 = e[1]
+ myscreen.addActor( camvtk.Line( p1=( p1.x,p1.y,p1.z+zoffset+ne*dzoffset), p2=(p2.x,p2.y,p2.z+zoffset+ne*dzoffset) ) )
+ ne = ne+1
+
+ print("done.")
+ myscreen.camera.SetPosition(0.8051, 0.8051, 3.5)
+ myscreen.camera.SetFocalPoint(0.805, 0.805, 0)
+ camvtk.drawArrows(myscreen,center=(-0.5,-0.5,-0.5))
+ camvtk.drawOCLtext(myscreen)
+ myscreen.render()
+ myscreen.iren.Start()
+ #raw_input("Press Enter to terminate")
diff -Nru opencamlib-11.10+git201801200005~ubuntu16.04.1/examples/python/fiber/fiber_16_weave2_RAMusage.py opencamlib-11.10-1/examples/python/fiber/fiber_16_weave2_RAMusage.py
--- opencamlib-11.10+git201801200005~ubuntu16.04.1/examples/python/fiber/fiber_16_weave2_RAMusage.py 1970-01-01 00:00:00.000000000 +0000
+++ opencamlib-11.10-1/examples/python/fiber/fiber_16_weave2_RAMusage.py 2020-06-14 12:13:19.000000000 +0000
@@ -0,0 +1,112 @@
+import ocl
+import camvtk
+import time
+import vtk
+import datetime
+import math
+import procmemory
+import csv
+import gc
+
+# 2018.08: Weave not wrapped
+
+def drawVertices(myscreen, weave, vertexType, vertexRadius, vertexColor):
+ pts = weave.getVertices( vertexType )
+ print(" got ",len(pts)," of type ", vertexType)
+ for p in pts:
+ myscreen.addActor( camvtk.Sphere(center=(p.x,p.y,p.z), radius=vertexRadius, color=vertexColor ) )
+
+def getWeaveRAM(Nmax,weave2_flag):
+ #stl = camvtk.STLSurf("../stl/demo.stl")
+ stl = camvtk.STLSurf("../../stl/gnu_tux_mod.stl")
+ polydata = stl.src.GetOutput()
+ s = ocl.STLSurf()
+ camvtk.vtkPolyData2OCLSTL(polydata, s)
+ cutter = ocl.CylCutter(0.3, 5)
+ fiber_range=30
+ #Nmax = 400
+ yvals = [float(n-float(Nmax)/2)/Nmax*float(fiber_range) for n in range(0,Nmax+1)]
+ xvals = [float(n-float(Nmax)/2)/Nmax*float(fiber_range) for n in range(0,Nmax+1)]
+ zvals=[ 1.6523]
+ bpc_x = ocl.BatchPushCutter()
+ bpc_y = ocl.BatchPushCutter()
+ bpc_x.setXDirection()
+ bpc_y.setYDirection()
+ bpc_x.setSTL(s)
+ bpc_y.setSTL(s)
+ bpc_x.setCutter(cutter)
+ bpc_y.setCutter(cutter)
+ # create fibers
+ for zh in zvals:
+ for y in yvals:
+ f1 = ocl.Point(-15.5,y,zh) # start point of fiber
+ f2 = ocl.Point(15.5,y,zh) # end point of fiber
+ f = ocl.Fiber( f1, f2)
+ bpc_x.appendFiber(f)
+ for x in xvals:
+ f1 = ocl.Point(x,-15.5,zh) # start point of fiber
+ f2 = ocl.Point(x,15.5,zh) # end point of fiber
+ f = ocl.Fiber( f1, f2)
+ bpc_y.appendFiber(f)
+
+ # run
+ bpc_x.run()
+ bpc_y.run()
+ xfibers = bpc_x.getFibers()
+ yfibers = bpc_y.getFibers()
+ fibers = xfibers+yfibers
+ print(" got ",len(xfibers)," xfibers")
+ print(" got ",len(yfibers)," yfibers")
+ fibercount = len(xfibers) + len(yfibers)
+ print("rendering fibers and CL-points.")
+ w = ocl.Weave()
+ print("push fibers to Weave...",)
+ for f in fibers:
+ w.addFiber(f)
+ print("done.")
+ print("Weave build()...",)
+ mem1 = procmemory.memory()
+ if weave2_flag==1:
+ w.build2()
+ else:
+ w.build()
+ mem2 = procmemory.memory()
+ #print "after ", float(mem2)/float(1024*1024), " MB"
+ megabytes = float(mem2-mem1)/float(1024*1024)
+ megabytes2 = float(mem2)/float(1024*1024)
+ verts = w.numVertices()
+ print(" before: ", float(mem1)/float(1024*1024))
+ print(" after: ", float(mem2)/float(1024*1024))
+ print(" build() memory: ",megabytes," MB")
+ print("done")
+ print("face_traverse...")
+ w.face_traverse()
+ print("done.")
+ w_clpts = w.getCLVertices()
+ w_ipts = w.getINTVertices()
+ w_edges = w.getEdges()
+ w_loop = w.getLoops()
+
+
+ print(" got: ", len(w_edges), " edges")
+ print(" got: ", len(w_loop), " loops")
+ out=[]
+ out.append(fibercount)
+ out.append(verts)
+ return out
+
+if __name__ == "__main__":
+ writer = csv.writer( open('weave2ram_6.csv','wb'), delimiter=',')
+
+ #Nmax=400
+ Nmaxlist = [100,200,400,800, 1600, 3200]
+
+ for Nmax in Nmaxlist:
+ mb = getWeaveRAM(Nmax,0)
+ mb2 = getWeaveRAM(Nmax,1)
+ #print mb2
+ print(mb[0], " :=> ", mb[1], " MB")
+ writer.writerow(mb+mb2)
+ gc.collect()
+
+ raw_input("Press Enter to terminate")
diff -Nru opencamlib-11.10+git201801200005~ubuntu16.04.1/examples/python/fiber/fiber_16_weave2_STL.py opencamlib-11.10-1/examples/python/fiber/fiber_16_weave2_STL.py
--- opencamlib-11.10+git201801200005~ubuntu16.04.1/examples/python/fiber/fiber_16_weave2_STL.py 1970-01-01 00:00:00.000000000 +0000
+++ opencamlib-11.10-1/examples/python/fiber/fiber_16_weave2_STL.py 2020-06-14 12:13:19.000000000 +0000
@@ -0,0 +1,146 @@
+import ocl
+import camvtk
+import time
+import vtk
+import datetime
+import math
+import procmemory
+
+# 2018.08: Weave not wrapped
+
+def drawVertices(myscreen, weave, vertexType, vertexRadius, vertexColor):
+ pts = weave.getVertices( vertexType )
+ print(" got ",len(pts)," of type ", vertexType)
+ for p in pts:
+ myscreen.addActor( camvtk.Sphere(center=(p.x,p.y,p.z), radius=vertexRadius, color=vertexColor ) )
+
+if __name__ == "__main__":
+ print(ocl.version())
+ myscreen = camvtk.VTKScreen()
+ #stl = camvtk.STLSurf("../stl/demo.stl")
+ stl = camvtk.STLSurf("../../stl/gnu_tux_mod.stl")
+ myscreen.addActor(stl)
+ stl.SetWireframe()
+ #stl.SetSurface()
+ stl.SetColor(camvtk.grey)
+ polydata = stl.src.GetOutput()
+ s = ocl.STLSurf()
+ camvtk.vtkPolyData2OCLSTL(polydata, s)
+
+ cutter = ocl.CylCutter(0.3, 5)
+ #cutter = ocl.BallCutter(0.4, 5)
+ #cutter = ocl.BullCutter(0.4, 0.1, 5)
+
+ print("fiber...")
+ fiber_range=30
+ Nmax = 400
+ yvals = [float(n-float(Nmax)/2)/Nmax*float(fiber_range) for n in range(0,Nmax+1)]
+ xvals = [float(n-float(Nmax)/2)/Nmax*float(fiber_range) for n in range(0,Nmax+1)]
+
+ zvals=[ 1.6523]
+
+
+ bpc_x = ocl.BatchPushCutter()
+ bpc_y = ocl.BatchPushCutter()
+ bpc_x.setXDirection()
+ bpc_y.setYDirection()
+ bpc_x.setSTL(s)
+ bpc_y.setSTL(s)
+ bpc_x.setCutter(cutter)
+ bpc_y.setCutter(cutter)
+ # create fibers
+ for zh in zvals:
+ for y in yvals:
+ f1 = ocl.Point(-15.5,y,zh) # start point of fiber
+ f2 = ocl.Point(15.5,y,zh) # end point of fiber
+ f = ocl.Fiber( f1, f2)
+ bpc_x.appendFiber(f)
+ for x in xvals:
+ f1 = ocl.Point(x,-15.5,zh) # start point of fiber
+ f2 = ocl.Point(x,15.5,zh) # end point of fiber
+ f = ocl.Fiber( f1, f2)
+ bpc_y.appendFiber(f)
+
+ # run
+ bpc_x.run()
+ bpc_y.run()
+
+ xfibers = bpc_x.getFibers()
+ yfibers = bpc_y.getFibers()
+ fibers = xfibers+yfibers
+ print(" got ",len(xfibers)," xfibers")
+ print(" got ",len(yfibers)," yfibers")
+ print("rendering fibers and CL-points.")
+ w = ocl.Weave()
+ print("push fibers to Weave...",)
+ for f in fibers:
+ w.addFiber(f)
+ print("done.")
+ print("Weave build()...",)
+ mem1 = procmemory.resident()
+ print("before ", mem1)
+ w.build()
+ #w.build2()
+ mem2 = procmemory.resident()
+ print("after ", float(mem2)/float(1024*1024), " MB")
+ print(" build() memory: ",float(mem2-mem1)/float(1024*1024)," MB")
+ print("done")
+ print("face_traverse...")
+ w.face_traverse()
+ print("done.")
+ w_clpts = w.getCLVertices()
+ w_ipts = w.getINTVertices()
+ w_edges = w.getEdges()
+ w_loop = w.getLoops()
+ vertexRadius = 0.007
+ drawVertices(myscreen, w, ocl.WeaveVertexType.CL, vertexRadius, camvtk.red)
+ drawVertices(myscreen, w, ocl.WeaveVertexType.INT, vertexRadius, camvtk.orange)
+ drawVertices(myscreen, w, ocl.WeaveVertexType.FULLINT, vertexRadius, camvtk.yellow)
+ drawVertices(myscreen, w, ocl.WeaveVertexType.ADJ, vertexRadius, camvtk.green)
+ drawVertices(myscreen, w, ocl.WeaveVertexType.TWOADJ, vertexRadius, camvtk.lblue)
+
+ print(" got: ", len(w_edges), " edges")
+ print(" got: ", len(w_loop), " loops")
+
+ # draw the loops
+
+ nloop = 0
+ for lop in w_loop:
+ n = 0
+ N = len(lop)
+ first_point=ocl.Point(-1,-1,5)
+ previous=ocl.Point(-1,-1,5)
+ for p in lop:
+ if n==0: # don't draw anything on the first iteration
+ previous=p
+ first_point = p
+ elif n== (N-1): # the last point
+ myscreen.addActor( camvtk.Line(p1=(previous.x,previous.y,previous.z),p2=(p.x,p.y,p.z),color=camvtk.yellow) ) # the normal line
+ # and a line from p to the first point
+ myscreen.addActor( camvtk.Line(p1=(p.x,p.y,p.z),p2=(first_point.x,first_point.y,first_point.z),color=camvtk.yellow) )
+ else:
+ myscreen.addActor( camvtk.Line(p1=(previous.x,previous.y,previous.z),p2=(p.x,p.y,p.z),color=camvtk.yellow) )
+ previous=p
+ n=n+1
+ print("rendered loop ",nloop, " with ", len(lop), " points")
+ nloop = nloop+1
+
+
+ # draw edges of weave
+ ne = 0
+ zoffset=0.0 # 1
+ dzoffset = 0.000 # 5
+ for e in w_edges:
+ p1 = e[0]
+ p2 = e[1]
+ myscreen.addActor( camvtk.Line( p1=( p1.x,p1.y,p1.z+zoffset+ne*dzoffset), p2=(p2.x,p2.y,p2.z+zoffset+ne*dzoffset) ) )
+ ne = ne+1
+
+ print("done.")
+ myscreen.camera.SetPosition(0.8051, 0.8051, 3.5)
+ myscreen.camera.SetFocalPoint(0.805, 0.805, 0)
+ camvtk.drawArrows(myscreen,center=(-0.5,-0.5,-0.5))
+ camvtk.drawOCLtext(myscreen)
+ myscreen.render()
+ myscreen.iren.Start()
+ #raw_input("Press Enter to terminate")
diff -Nru opencamlib-11.10+git201801200005~ubuntu16.04.1/examples/python/issues/issue08_bug2010-04-02.py opencamlib-11.10-1/examples/python/issues/issue08_bug2010-04-02.py
--- opencamlib-11.10+git201801200005~ubuntu16.04.1/examples/python/issues/issue08_bug2010-04-02.py 1970-01-01 00:00:00.000000000 +0000
+++ opencamlib-11.10-1/examples/python/issues/issue08_bug2010-04-02.py 2020-06-14 12:13:19.000000000 +0000
@@ -0,0 +1,19 @@
+import ocl
+
+# this illustrates issue 8
+
+if __name__ == "__main__":
+ print(ocl.version())
+ cutter = ocl.CylCutter(3.0, 6)
+ path = ocl.Path()
+ path.append(ocl.Line(ocl.Point(-6.51, 0, 0), ocl.Point(6.51, 1.2, 0)))
+ s=ocl.STLSurf()
+ ocl.STLReader("../../stl/sphere2.stl",s)
+ pdc = ocl.PathDropCutter()
+ pdc.setSTL(s)
+ pdc.setCutter(cutter)
+ pdc.setPath(path)
+ pdc.run()
+ clpts = pdc.getCLPoints()
+ for p in clpts:
+ print(p)
diff -Nru opencamlib-11.10+git201801200005~ubuntu16.04.1/examples/python/issues/issue20bug.py opencamlib-11.10-1/examples/python/issues/issue20bug.py
--- opencamlib-11.10+git201801200005~ubuntu16.04.1/examples/python/issues/issue20bug.py 1970-01-01 00:00:00.000000000 +0000
+++ opencamlib-11.10-1/examples/python/issues/issue20bug.py 2020-06-14 12:13:19.000000000 +0000
@@ -0,0 +1,47 @@
+import ocl
+import camvtk
+import issue20data
+
+if __name__ == "__main__":
+ s = ocl.STLSurf()
+ triangles = issue20data.trilist
+
+ for t in triangles:
+ s.addTriangle(t)
+
+ print(ocl.version() )
+ # define a cutter
+ length = 10
+ cutter = ocl.CylCutter(3, length)
+ #cutter = ocl.BallCutter(3, length)
+ #cutter = ocl.BullCutter(3,0.5, length)
+
+ pdf = ocl.PathDropCutter() # create a pdf-object for the surface s
+ pdf.setSTL(s)
+ pdf.setCutter(cutter) # set the cutter
+ pdf.minimumZ = -1 # set the minimum Z-coordinate, or
+ # "floor" for drop-cutter
+
+ path = ocl.Path() # create an empty path object
+ # add a line to the path
+ path.append(ocl.Line(ocl.Point(0, 0.098, 0), ocl.Point(4, 0.098, 0)))
+
+ # set the path for pdf
+ pdf.setPath( path )
+
+ pdf.run() # run drop-cutter on the path
+
+ clp = pdf.getCLPoints() # get the cl-points from pdf
+
+
+ print('first point ', clp[0], ' ( z should be at z5 )')
+
+ # visualize things with VTK
+ myscreen = camvtk.VTKScreen()
+ myscreen.addActor( camvtk.PointCloud( pointlist=clp ) )
+ #myscreen.addActor( camvtk.PointCloud( pointlist=ccp, collist=ccp ) )
+ su = camvtk.STLSurf(filename=None, triangleList=triangles )
+ su.SetWireframe()
+ myscreen.addActor(su)
+ myscreen.render()
+ myscreen.iren.Start()
diff -Nru opencamlib-11.10+git201801200005~ubuntu16.04.1/examples/python/issues/issue20data.py opencamlib-11.10-1/examples/python/issues/issue20data.py
--- opencamlib-11.10+git201801200005~ubuntu16.04.1/examples/python/issues/issue20data.py 1970-01-01 00:00:00.000000000 +0000
+++ opencamlib-11.10-1/examples/python/issues/issue20data.py 2020-06-14 12:13:19.000000000 +0000
@@ -0,0 +1,79 @@
+import ocl
+
+trilist = []
+trilist.append(ocl.Triangle(ocl.Point(2.91337, 1, 3.93857),
+ ocl.Point(2.89783, -7.09741e-016, 4.07462),
+ ocl.Point(4, -9.79685e-016, 3)))
+trilist.append(ocl.Triangle(ocl.Point(2.91337, 1, 3.93857),
+ ocl.Point(4,0.673874, 2.92334),
+ ocl.Point(4, 1, 2.82843)))
+trilist.append(ocl.Triangle(ocl.Point(2.91337, 1, 3.93857),
+ ocl.Point(4,0.339111, 2.98077),
+ ocl.Point(4, 0.673874, 2.92334)))
+trilist.append(ocl.Triangle(ocl.Point(2.91337, 1, 3.93857), ocl.Point(4,
+-9.79685e-016, 3), ocl.Point(4, 0.339111, 2.98077)))
+trilist.append(ocl.Triangle(ocl.Point(1.53379, 1, 4.65268),
+ocl.Point(1.521, -3.72525e-016, 4.76304), ocl.Point(2.89783, -7.09741e-016,
+4.07462)))
+trilist.append(ocl.Triangle(ocl.Point(1.53379, 1, 4.65268),
+ocl.Point(2.89783, -7.09741e-016, 4.07462), ocl.Point(2.91337, 1, 3.93857)))
+trilist.append(ocl.Triangle(ocl.Point(0, 0.669179, 4.95502),
+ocl.Point(1.53379, 1, 4.65268), ocl.Point(-1.19986e-015, 1, 4.89898)))
+trilist.append(ocl.Triangle(ocl.Point(0, 0.335345, 4.98874),
+ocl.Point(1.53379, 1, 4.65268), ocl.Point(0, 0.669179, 4.95502)))
+trilist.append(ocl.Triangle(ocl.Point(3.06152e-016, -7.4983e-032, 5),
+ocl.Point(1.521, -3.72525e-016, 4.76304), ocl.Point(1.53379, 1, 4.65268)))
+trilist.append(ocl.Triangle(ocl.Point(3.06152e-016, -7.4983e-032, 5),
+ocl.Point(1.53379, 1, 4.65268), ocl.Point(0, 0.335345, 4.98874)))
+trilist.append(ocl.Triangle(ocl.Point(2, 1, 2.44949), ocl.Point(0, 1,
+0), ocl.Point(-1.19986e-015, 1, 4.89898)))
+trilist.append(ocl.Triangle(ocl.Point(2, 1, 2.44949),
+ocl.Point(-1.19986e-015, 1, 4.89898), ocl.Point(1.53379, 1, 4.65268)))
+trilist.append(ocl.Triangle(ocl.Point(2, 1, 2.44949), ocl.Point(1.53379,
+1, 4.65268), ocl.Point(2.91337, 1, 3.93857)))
+trilist.append(ocl.Triangle(ocl.Point(2, 1, 2.44949), ocl.Point(2.91337,
+1, 3.93857), ocl.Point(4, 1, 2.82843)))
+trilist.append(ocl.Triangle(ocl.Point(2, 1, 2.44949), ocl.Point(4, 1,
+2.82843), ocl.Point(4, 1, 0)))
+trilist.append(ocl.Triangle(ocl.Point(2, 1, 2.44949), ocl.Point(4, 1,
+0), ocl.Point(0, 1, 0)))
+trilist.append(ocl.Triangle(ocl.Point(4, 0.5, 1.5), ocl.Point(4,
+-9.79685e-016, 3), ocl.Point(4, 0, 0)))
+trilist.append(ocl.Triangle(ocl.Point(4, 0.5, 1.5), ocl.Point(4, 0, 0),
+ocl.Point(4, 1, 0)))
+trilist.append(ocl.Triangle(ocl.Point(4, 0.5, 1.5), ocl.Point(4, 1, 0),
+ocl.Point(4, 1, 2.82843)))
+trilist.append(ocl.Triangle(ocl.Point(4, 0.5, 1.5), ocl.Point(4, 1,
+2.82843), ocl.Point(4, 0.673874, 2.92334)))
+trilist.append(ocl.Triangle(ocl.Point(4, 0.5, 1.5), ocl.Point(4,
+0.673874, 2.92334), ocl.Point(4, 0.339111, 2.98077)))
+trilist.append(ocl.Triangle(ocl.Point(4, 0.5, 1.5), ocl.Point(4,
+0.339111, 2.98077), ocl.Point(4, -9.79685e-016, 3)))
+trilist.append(ocl.Triangle(ocl.Point(2, 0, 2.5),
+ocl.Point(3.06152e-016, -7.4983e-032, 5), ocl.Point(0, 0, 0)))
+trilist.append(ocl.Triangle(ocl.Point(2, 0, 2.5), ocl.Point(4,
+-9.79685e-016, 3), ocl.Point(2.89783, -7.09741e-016, 4.07462)))
+trilist.append(ocl.Triangle(ocl.Point(2, 0, 2.5), ocl.Point(2.89783,
+-7.09741e-016, 4.07462), ocl.Point(1.521, -3.72525e-016, 4.76304)))
+trilist.append(ocl.Triangle(ocl.Point(2, 0, 2.5), ocl.Point(1.521,
+-3.72525e-016, 4.76304), ocl.Point(3.06152e-016, -7.4983e-032, 5)))
+trilist.append(ocl.Triangle(ocl.Point(2, 0, 2.5), ocl.Point(4, 0, 0),
+ocl.Point(4, -9.79685e-016, 3)))
+trilist.append(ocl.Triangle(ocl.Point(2, 0, 2.5), ocl.Point(0, 0, 0),
+ocl.Point(4, 0, 0)))
+trilist.append(ocl.Triangle(ocl.Point(0, 0.5, 2.5),
+ocl.Point(-1.19986e-015, 1, 4.89898), ocl.Point(0, 1, 0)))
+trilist.append(ocl.Triangle(ocl.Point(0, 0.5, 2.5), ocl.Point(0,
+0.669179, 4.95502), ocl.Point(-1.19986e-015, 1, 4.89898)))
+trilist.append(ocl.Triangle(ocl.Point(0, 0.5, 2.5), ocl.Point(0,
+0.335345, 4.98874), ocl.Point(0, 0.669179, 4.95502)))
+trilist.append(ocl.Triangle(ocl.Point(0, 0.5, 2.5),
+ocl.Point(3.06152e-016, -7.4983e-032, 5), ocl.Point(0, 0.335345, 4.98874)))
+trilist.append(ocl.Triangle(ocl.Point(0, 0.5, 2.5), ocl.Point(0, 0, 0),
+ocl.Point(3.06152e-016, -7.4983e-032, 5)))
+trilist.append(ocl.Triangle(ocl.Point(0, 0.5, 2.5), ocl.Point(0, 1, 0),
+ocl.Point(0, 0, 0)))
+trilist.append(ocl.Triangle(ocl.Point(4, 1, 0), ocl.Point(0, 0, 0),
+ocl.Point(0, 1, 0)))
+trilist.append(ocl.Triangle(ocl.Point(4, 1, 0), ocl.Point(4, 0, 0),
+ocl.Point(0, 0, 0)))
diff -Nru opencamlib-11.10+git201801200005~ubuntu16.04.1/examples/python/kdtree_debug_0.py opencamlib-11.10-1/examples/python/kdtree_debug_0.py
--- opencamlib-11.10+git201801200005~ubuntu16.04.1/examples/python/kdtree_debug_0.py 1970-01-01 00:00:00.000000000 +0000
+++ opencamlib-11.10-1/examples/python/kdtree_debug_0.py 2020-06-14 12:13:19.000000000 +0000
@@ -0,0 +1,126 @@
+import ocl as cam
+import camvtk
+import time
+import vtk
+import math
+import datetime
+
+
+
+
+def main():
+ myscreen = camvtk.VTKScreen()
+ focal = cam.Point(5, 5, 0)
+ r = 30
+ theta = (float(45)/360)*2*math.pi
+ fi=45
+
+ campos = cam.Point( r*math.sin(theta)*math.cos(fi), r*math.sin(theta)*math.sin(fi), r*math.cos(theta) )
+ myscreen.camera.SetPosition(campos.x, campos.y, campos.z)
+ myscreen.camera.SetFocalPoint(focal.x,focal.y, focal.z)
+
+ t = camvtk.Text()
+ t.SetPos( (myscreen.width-450, myscreen.height-30) )
+
+
+ myscreen.addActor( t)
+ t2 = camvtk.Text()
+ ytext = "kd-tree debug" #"Y: %3.3f" % (ycoord)
+ t2.SetText(ytext)
+ t2.SetPos( (50, myscreen.height-50) )
+ myscreen.addActor( t2)
+
+ #w2if = vtk.vtkWindowToImageFilter()
+ #w2if.SetInput(myscreen.renWin)
+ #lwr = vtk.vtkPNGWriter()
+ #lwr.SetInput( w2if.GetOutput() )
+
+
+ t.SetText("OpenCAMLib 10.03-beta, " + datetime.datetime.now().strftime("%Y-%m-%d %H:%M:%S"))
+
+
+ #ycoord = 1.1
+
+ stl = camvtk.STLSurf(filename="../stl/demo.stl")
+ #stl = camvtk.STLSurf(filename="../stl/demo2.stl")
+ print("STL surface read")
+ #myscreen.addActor(stl)
+ #stl.SetWireframe()
+ #stl.SetColor((0.5,0.5,0.5))
+ polydata = stl.src.GetOutput()
+ s= cam.STLSurf()
+ camvtk.vtkPolyData2OCLSTL(polydata, s)
+ print("STLSurf with ", s.size(), " triangles")
+
+
+ myscreen.addActor( camvtk.Sphere( center=(0,0,0), radius=0.2, color = camvtk.yellow ) )
+
+ s.build_kdtree()
+ print("built kd-tree")
+ s.jump_kd_reset()
+
+ tlist = s.get_kd_triangles()
+
+ print("got", len(tlist), " triangles")
+
+ while (s.jump_kd_hi()):
+ lotris = s.get_kd_triangles()
+ s.jump_kd_up()
+ cut = s.get_kd_cut()
+ s.jump_kd_lo()
+ hitris = s.get_kd_triangles()
+ lev = s.get_kd_level()
+
+ print("l=", lev, " hi=", len(hitris), " lo=", len(lotris), " cut=", cut)
+
+ if ( cut[0] < 2 ):
+ print("x cut ",)
+ if ( cut[0] == 0):
+ print("max" )
+ myscreen.addActor( camvtk.Line( p1=(cut[1],100,0), p2=(cut[1],-100,0), color = camvtk.green ) )
+ else:
+ print("min" )
+ myscreen.addActor( camvtk.Line( p1=(cut[1],100,0), p2=(cut[1],-100,0), color = camvtk.lgreen ) )
+ #myscreen.addActor( camvtk.Line( p1=(100,cut[1],0), p2=(-100,cut[1],0), color = camvtk.red ) )
+ else:
+ print("y cut ",)
+ if ( cut[0] == 2):
+ print("max" )
+ myscreen.addActor( camvtk.Line( p1=(100,cut[1],0), p2=(-100,cut[1],0), color = camvtk.red ) )
+ else:
+ print("min")
+ myscreen.addActor( camvtk.Line( p1=(100,cut[1],0), p2=(-100,cut[1],0), color = camvtk.pink ) )
+
+
+ slo = camvtk.STLSurf(triangleList=lotris)
+ slo.SetColor(camvtk.pink)
+ slo.SetWireframe()
+ shi = camvtk.STLSurf(triangleList=hitris)
+ shi.SetColor(camvtk.lgreen)
+ shi.SetWireframe()
+ myscreen.addActor(slo)
+ myscreen.addActor(shi)
+ myscreen.render()
+ myscreen.iren.Start()
+ raw_input("Press Enter to terminate")
+ time.sleep(1)
+ myscreen.removeActor(slo)
+ myscreen.removeActor(shi)
+
+
+
+ print("done.")
+ myscreen.render()
+ #lwr.SetFileName(filename)
+
+ #raw_input("Press Enter to terminate")
+ time.sleep(0.2)
+ #lwr.Write()
+ myscreen.iren.Start()
+
+
+if __name__ == "__main__":
+ main()
+ #raw_input("Press Enter to terminate")
+
+
diff -Nru opencamlib-11.10+git201801200005~ubuntu16.04.1/examples/python/kdtree_debug_1.py opencamlib-11.10-1/examples/python/kdtree_debug_1.py
--- opencamlib-11.10+git201801200005~ubuntu16.04.1/examples/python/kdtree_debug_1.py 1970-01-01 00:00:00.000000000 +0000
+++ opencamlib-11.10-1/examples/python/kdtree_debug_1.py 2020-06-14 12:13:19.000000000 +0000
@@ -0,0 +1,128 @@
+import ocl as cam
+import camvtk
+import time
+import vtk
+import math
+import datetime
+
+
+
+
+def main():
+ myscreen = camvtk.VTKScreen()
+ focal = cam.Point(50, 0, 0)
+ r = 300
+ theta = (float(45)/360)*2*math.pi
+ fi=45
+
+ campos = cam.Point( r*math.sin(theta)*math.cos(fi), r*math.sin(theta)*math.sin(fi), r*math.cos(theta) )
+ myscreen.camera.SetPosition(campos.x, campos.y, campos.z)
+ myscreen.camera.SetFocalPoint(focal.x,focal.y, focal.z)
+
+ t = camvtk.Text()
+ t.SetPos( (myscreen.width-450, myscreen.height-30) )
+
+
+ myscreen.addActor( t)
+ t2 = camvtk.Text()
+ ytext = "kd-tree debug" #"Y: %3.3f" % (ycoord)
+ t2.SetText(ytext)
+ t2.SetPos( (50, myscreen.height-50) )
+ myscreen.addActor( t2)
+
+ w2if = vtk.vtkWindowToImageFilter()
+ w2if.SetInput(myscreen.renWin)
+ lwr = vtk.vtkPNGWriter()
+ lwr.SetInput( w2if.GetOutput() )
+
+ epos = cam.Epos()
+ epos.setS(0,1)
+
+ t.SetText("OpenCAMLib 10.03-beta, " + datetime.datetime.now().strftime("%Y-%m-%d %H:%M:%S"))
+
+
+ #ycoord = 1.1
+
+ stl = camvtk.STLSurf(filename="../stl/demo.stl")
+ #stl = camvtk.STLSurf(filename="../stl/demo2.stl")
+ print("STL surface read")
+ #myscreen.addActor(stl)
+ #stl.SetWireframe()
+ #stl.SetColor((0.5,0.5,0.5))
+ polydata = stl.src.GetOutput()
+ s= cam.STLSurf()
+ camvtk.vtkPolyData2OCLSTL(polydata, s)
+ print("STLSurf with ", s.size(), " triangles")
+
+
+ myscreen.addActor( camvtk.Sphere( center=(0,0,0), radius=0.2, color = camvtk.yellow ) )
+
+ s.build_kdtree()
+ print("built kd-tree")
+ s.jump_kd_reset()
+
+ tlist = s.get_kd_triangles()
+
+ print("got", len(tlist), " triangles")
+
+ while (s.jump_kd_hi()):
+ lotris = s.get_kd_triangles()
+ s.jump_kd_up()
+ cut = s.get_kd_cut()
+ s.jump_kd_lo()
+ hitris = s.get_kd_triangles()
+ lev = s.get_kd_level()
+
+ print("l=", lev, " hi=", len(hitris), " lo=", len(lotris), " cut=", cut)
+
+ if ( cut[0] < 2 ):
+ print("x cut ",)
+ if ( cut[0] == 0):
+ print("max" )
+ myscreen.addActor( camvtk.Line( p1=(cut[1],100,0), p2=(cut[1],-100,0), color = camvtk.green ) )
+ else:
+ print("min" )
+ myscreen.addActor( camvtk.Line( p1=(cut[1],100,0), p2=(cut[1],-100,0), color = camvtk.lgreen ) )
+ #myscreen.addActor( camvtk.Line( p1=(100,cut[1],0), p2=(-100,cut[1],0), color = camvtk.red ) )
+ else:
+ print("y cut ",)
+ if ( cut[0] == 2):
+ print("max" )
+ myscreen.addActor( camvtk.Line( p1=(100,cut[1],0), p2=(-100,cut[1],0), color = camvtk.red ) )
+ else:
+ print("min")
+ myscreen.addActor( camvtk.Line( p1=(100,cut[1],0), p2=(-100,cut[1],0), color = camvtk.pink ) )
+
+
+ slo = camvtk.STLSurf(triangleList=lotris)
+ slo.SetColor(camvtk.pink)
+ slo.SetWireframe()
+ shi = camvtk.STLSurf(triangleList=hitris)
+ shi.SetColor(camvtk.lgreen)
+ shi.SetWireframe()
+ myscreen.addActor(slo)
+ myscreen.addActor(shi)
+ myscreen.render()
+ myscreen.iren.Start()
+ raw_input("Press Enter to terminate")
+ time.sleep(1)
+ myscreen.removeActor(slo)
+ myscreen.removeActor(shi)
+
+
+
+ print("done.")
+ myscreen.render()
+ #lwr.SetFileName(filename)
+
+ #raw_input("Press Enter to terminate")
+ time.sleep(0.2)
+ lwr.Write()
+ myscreen.iren.Start()
+
+
+if __name__ == "__main__":
+ main()
+ #raw_input("Press Enter to terminate")
+
+
diff -Nru opencamlib-11.10+git201801200005~ubuntu16.04.1/examples/python/kdtree_debug_3.py opencamlib-11.10-1/examples/python/kdtree_debug_3.py
--- opencamlib-11.10+git201801200005~ubuntu16.04.1/examples/python/kdtree_debug_3.py 1970-01-01 00:00:00.000000000 +0000
+++ opencamlib-11.10-1/examples/python/kdtree_debug_3.py 2020-06-14 12:13:19.000000000 +0000
@@ -0,0 +1,309 @@
+import ocl as cam
+import camvtk
+import time
+import vtk
+import math
+import datetime
+
+
+
+def kdtreesearch(myscreen, tlist, s, cutter, cl, depth):
+ #print "surface=", s.str()
+ #print "cutter=", cutter.str()
+ #print "cl=", cl.str()
+ myscreen.render()
+ #raw_input("Press Enter to terminate")
+ #time.sleep(1)
+ if (depth==1): # stop jumping and return all triangles
+ tris = s.get_kd_triangles()
+ for t in tris:
+ tlist.append(t)
+ return
+
+ # jump high or low depending on search
+ cut = s.get_kd_cut()
+ print("cutvalues: ", cut)
+ dim = cut[0]
+ cval = cut[1]
+ if dim == 0: # cut along xmax
+
+ print(cval, " < ", cl.x - cutter.radius, " ??")
+ if ( cval < ( cl.x - cutter.radius) ):
+ myscreen.addActor( camvtk.Line( p1=(cval,100,0), p2=(cval,-100,0), color = camvtk.green ) )
+ s.jump_kd_lo()
+ trilist = s.get_kd_triangles()
+ drawtriangles(myscreen, trilist, camvtk.blue)
+ s.jump_kd_up()
+ print("xmax: jump ONLY hi" )
+ s.jump_kd_hi()
+ print("search hi at level=", s.get_kd_level())
+ kdtreesearch(myscreen, tlist, s, cutter, cl, depth-1)
+ print("len tlist=", len(tlist), " now level=", s.get_kd_level())
+ else:
+ #print "xmax: jump both hi and lo"
+ s.jump_kd_hi()
+ #print "search hi at level=", s.get_kd_level()
+ kdtreesearch(myscreen, tlist, s, cutter, cl, depth-1)
+ #print "len tlist=", len(tlist), " now level=", s.get_kd_level()
+ s.jump_kd_up()
+ s.jump_kd_lo()
+ #print "search lo at level=", s.get_kd_level()
+ kdtreesearch(myscreen, tlist, s, cutter, cl, depth-1)
+ #print "len tlist=", len(tlist), " now level=", s.get_kd_level()
+ if dim == 1:
+
+ print(cval, " > ", cl.x + cutter.radius, " ??")
+ if ( cval > ( cl.x + cutter.radius) ):
+ myscreen.addActor( camvtk.Line( p1=(cval,100,0), p2=(cval,-100,0), color = camvtk.lgreen ) )
+ s.jump_kd_hi()
+ trilist = s.get_kd_triangles()
+ drawtriangles(myscreen, trilist, camvtk.blue)
+ s.jump_kd_up()
+ print("xmin: jump only lo")
+ s.jump_kd_lo()
+ kdtreesearch(myscreen, tlist, s, cutter, cl, depth-1)
+ else:
+ #print "xmin: jump both hi and lo"
+ s.jump_kd_lo()
+ kdtreesearch(tlist, s, cutter, cl, depth-1)
+ s.jump_kd_up()
+ s.jump_kd_hi()
+ kdtreesearch(myscreen, tlist, s, cutter, cl, depth-1)
+ if dim == 2:
+ print(cval, " < ", cl.y - cutter.radius, " ??")
+ if ( cval < ( cl.y - cutter.radius) ):
+ myscreen.addActor( camvtk.Line( p1=(100,cval,0), p2=(-100,cval,0), color = camvtk.red ) )
+ s.jump_kd_lo()
+ trilist = s.get_kd_triangles()
+ drawtriangles(myscreen, trilist, camvtk.yellow)
+ s.jump_kd_up()
+
+ s.jump_kd_hi()
+ kdtreesearch(myscreen, tlist, s, cutter, cl, depth-1)
+ else:
+ #print "ymax: jump both hi and lo"
+ s.jump_kd_lo()
+ kdtreesearch(myscreen, tlist, s, cutter, cl, depth-1)
+ s.jump_kd_up()
+ s.jump_kd_hi()
+ kdtreesearch(myscreen, tlist, s, cutter, cl, depth-1)
+ if dim == 3: # cut along ymin
+
+ print(cval, " > ", cl.y + cutter.radius, " ??")
+ if ( cval > ( cl.y + cutter.radius) ):
+ myscreen.addActor( camvtk.Line( p1=(100,cval,0), p2=(-100,cval,0), color = camvtk.pink ) )
+
+ s.jump_kd_hi()
+ trilist = s.get_kd_triangles()
+ drawtriangles(myscreen, trilist, camvtk.yellow)
+ s.jump_kd_up()
+
+ print("ymin: jump ONLY lo")
+ s.jump_kd_lo()
+ kdtreesearch(myscreen, tlist, s, cutter, cl, depth-1)
+ else:
+ #print "ymin: jump both hi and lo"
+ s.jump_kd_hi()
+ #print "search hi at level=", s.get_kd_level()
+ kdtreesearch(myscreen, tlist, s, cutter, cl, depth-1)
+ #print "len tlist=", len(tlist), " now level=", s.get_kd_level()
+ s.jump_kd_up()
+ s.jump_kd_lo()
+ #print "search lo at level=", s.get_kd_level()
+ kdtreesearch(myscreen, tlist, s, cutter, cl, depth-1)
+
+ return
+
+def drawtriangles(myscreen, trilist, color):
+ cpp = camvtk.STLSurf(triangleList=trilist)
+ cpp.SetColor(color)
+ cpp.SetWireframe()
+ myscreen.addActor(cpp)
+
+def drawcuts(myscreen, s):
+ cut = s.get_kd_cut()
+ if ( cut[0] < 2 ):
+ print("x cut ",)
+ if ( cut[0] == 0):
+ print("max" )
+ myscreen.addActor( camvtk.Line( p1=(cut[1],100,0), p2=(cut[1],-100,0), color = camvtk.green ) )
+ else:
+ print("min" )
+ myscreen.addActor( camvtk.Line( p1=(cut[1],100,0), p2=(cut[1],-100,0), color = camvtk.lgreen ) )
+ else:
+ print("y cut ",)
+ if ( cut[0] == 2):
+ print("max" )
+ myscreen.addActor( camvtk.Line( p1=(100,cut[1],0), p2=(-100,cut[1],0), color = camvtk.red ) )
+ else:
+ print("min")
+ myscreen.addActor( camvtk.Line( p1=(100,cut[1],0), p2=(-100,cut[1],0), color = camvtk.pink ) )
+
+ if (s.jump_kd_hi()):
+ drawcuts(myscreen, s)
+ s.jump_kd_up()
+ if (s.jump_kd_lo()):
+ drawcuts(myscreen, s)
+ s.jump_kd_up()
+ return
+
+
+
+def main():
+ myscreen = camvtk.VTKScreen()
+ focal = cam.Point(50, 0, 0)
+ r = 300
+ theta = (float(45)/360)*2*math.pi
+ fi=45
+
+ campos = cam.Point( r*math.sin(theta)*math.cos(fi), r*math.sin(theta)*math.sin(fi), r*math.cos(theta) )
+ myscreen.camera.SetPosition(campos.x, campos.y, campos.z)
+ myscreen.camera.SetFocalPoint(focal.x,focal.y, focal.z)
+
+ t = camvtk.Text()
+ t.SetPos( (myscreen.width-450, myscreen.height-30) )
+
+
+ myscreen.addActor( t)
+ t2 = camvtk.Text()
+ ytext = "kd-tree debug" #"Y: %3.3f" % (ycoord)
+ t2.SetText(ytext)
+ t2.SetPos( (50, myscreen.height-50) )
+ myscreen.addActor( t2)
+
+ w2if = vtk.vtkWindowToImageFilter()
+ w2if.SetInput(myscreen.renWin)
+ lwr = vtk.vtkPNGWriter()
+ lwr.SetInput( w2if.GetOutput() )
+
+ epos = cam.Epos()
+ epos.setS(0,1)
+
+ t.SetText("OpenCAMLib 10.04-beta, " + datetime.datetime.now().strftime("%Y-%m-%d %H:%M:%S"))
+
+
+ #ycoord = 1.1
+
+ stl = camvtk.STLSurf(filename="../stl/carpet2.stl")
+ #stl = camvtk.STLSurf(filename="demo2.stl")
+ print("STL surface read")
+ myscreen.addActor(stl)
+ stl.SetWireframe()
+ stl.SetColor((0.5,0.5,0.5))
+ polydata = stl.src.GetOutput()
+ s= cam.STLSurf()
+ camvtk.vtkPolyData2OCLSTL(polydata, s)
+ print("STLSurf with ", s.size(), " triangles")
+
+ cutterDiameter=7
+ cutter = cam.CylCutter(cutterDiameter)
+
+ cl = cam.Point(31, 42, 3)
+
+ cutactor = camvtk.Cylinder(center=(cl.x,cl.y,cl.z),
+ radius=cutterDiameter/2,
+ height=2,
+ rotXYZ=(90,0,0),
+ color=camvtk.green)
+ myscreen.addActor( cutactor )
+
+ # sphere to see (0,0)
+ myscreen.addActor( camvtk.Sphere( center=(0,0,0), radius=0.2, color = camvtk.yellow ) )
+
+ s.build_kdtree()
+ print("built kd-tree")
+ s.jump_kd_reset()
+
+
+ cpp_tlist = s.getTrianglesUnderCutter(cl, cutter)
+
+ py_tlist = []
+ depth = 6
+ kdtreesearch(myscreen, py_tlist, s, cutter, cl, depth)
+
+ print("len(cpp_list) after search=", len(cpp_tlist))
+ print("len(py_list) after search=", len(py_tlist))
+
+ cpp = camvtk.STLSurf(triangleList=cpp_tlist)
+ cpp.SetColor(camvtk.lgreen)
+ cpp.SetWireframe()
+ myscreen.addActor(cpp)
+
+ py = camvtk.STLSurf(triangleList=py_tlist)
+ py.SetColor(camvtk.pink)
+ py.SetWireframe()
+ myscreen.addActor(py)
+
+
+
+ #drawcuts(myscreen, s)
+
+ myscreen.render()
+ myscreen.iren.Start()
+ time.sleep(2)
+ exit()
+
+ tlist = s.get_kd_triangles()
+
+ print("got", len(tlist), " triangles")
+
+ while (s.jump_kd_hi()):
+ lotris = s.get_kd_triangles()
+ s.jump_kd_up()
+ cut = s.get_kd_cut()
+ s.jump_kd_lo()
+ hitris = s.get_kd_triangles()
+ lev = s.get_kd_level()
+
+ print("l=", lev, " hi=", len(hitris), " lo=", len(lotris), " cut=", cut)
+
+ if ( cut[0] < 2 ):
+ print("x cut ",)
+ if ( cut[0] == 0):
+ print("max" )
+ myscreen.addActor( camvtk.Line( p1=(cut[1],100,0), p2=(cut[1],-100,0), color = camvtk.green ) )
+ else:
+ print("min" )
+ myscreen.addActor( camvtk.Line( p1=(cut[1],100,0), p2=(cut[1],-100,0), color = camvtk.lgreen ) )
+ else:
+ print("y cut ",)
+ if ( cut[0] == 2):
+ print("max" )
+ myscreen.addActor( camvtk.Line( p1=(100,cut[1],0), p2=(-100,cut[1],0), color = camvtk.red ) )
+ else:
+ print("min")
+ myscreen.addActor( camvtk.Line( p1=(100,cut[1],0), p2=(-100,cut[1],0), color = camvtk.pink ) )
+
+
+ slo = camvtk.STLSurf(triangleList=lotris)
+ slo.SetColor(camvtk.pink)
+ slo.SetWireframe()
+ shi = camvtk.STLSurf(triangleList=hitris)
+ shi.SetColor(camvtk.lgreen)
+ shi.SetWireframe()
+ myscreen.addActor(slo)
+ myscreen.addActor(shi)
+ myscreen.render()
+ #myscreen.iren.Start()
+ #raw_input("Press Enter to terminate")
+ time.sleep(1)
+ myscreen.removeActor(slo)
+ myscreen.removeActor(shi)
+
+
+
+ print("done.")
+ myscreen.render()
+ #lwr.SetFileName(filename)
+
+ #raw_input("Press Enter to terminate")
+ time.sleep(0.2)
+ lwr.Write()
+ myscreen.iren.Start()
+
+
+if __name__ == "__main__":
+ main()
+ #raw_input("Press Enter to terminate")
+
+
diff -Nru opencamlib-11.10+git201801200005~ubuntu16.04.1/examples/python/kdtree_movie1.py opencamlib-11.10-1/examples/python/kdtree_movie1.py
--- opencamlib-11.10+git201801200005~ubuntu16.04.1/examples/python/kdtree_movie1.py 1970-01-01 00:00:00.000000000 +0000
+++ opencamlib-11.10-1/examples/python/kdtree_movie1.py 2020-06-14 12:13:19.000000000 +0000
@@ -0,0 +1,183 @@
+import ocl as cam
+import camvtk
+import time
+import vtk
+import datetime
+
+if __name__ == "__main__":
+ myscreen = camvtk.VTKScreen()
+ myscreen.setAmbient(20,20,20)
+
+ #stl = camvtk.STLSurf(filename="demo.stl")
+ stl = camvtk.STLSurf(filename="demo2.stl")
+ print("STL surface read")
+ myscreen.addActor(stl)
+ stl.SetWireframe()
+ stl.SetColor((0.5,0.5,0.5))
+ #stl.SetFlat()
+ polydata = stl.src.GetOutput()
+ s= cam.STLSurf()
+ camvtk.vtkPolyData2OCLSTL(polydata, s)
+ print("STLSurf with ", s.size(), " triangles")
+ cutterDiameter=0.6
+ cutter = cam.CylCutter(cutterDiameter)
+ #print cutter.str()
+ #print cc.type
+ minx=-20
+ dx=1
+ maxx=20
+
+ miny=-20
+ dy=01
+ maxy=20
+ z=-0.2
+
+ bucketSize = 20
+
+ #pftp = cam.ParallelFinish()
+ #pftp.initCLPoints(minx,dx,maxx,miny,dy,maxy,z)
+ #pftp.initSTLSurf(s, bucketSize)
+ #pftp.dropCutterSTL1(cutter)
+ #print " made ", pftp.dcCalls, " drop-cutter calls"
+ #exit
+
+ pf2 = cam.ParallelFinish()
+ pf2.initCLPoints(minx,dx,maxx,miny,dy,maxy,z)
+ pf2.initSTLSurf(s, bucketSize)
+ pf2.dropCutterSTL2(cutter)
+ print(" made ", pf2.dcCalls, " drop-cutter calls")
+
+ #clpoints = pftp.getCLPoints()
+ #ccpoints = pftp.getCCPoints()
+
+ clpoints = pf2.getCLPoints()
+ ccpoints = pf2.getCCPoints()
+
+ #CLPointGrid(minx,dx,maxx,miny,dy,maxy,z)
+ nv=0
+ nn=0
+ ne=0
+ nf=0
+ myscreen.camera.SetPosition(3, 100, 15)
+ myscreen.camera.SetFocalPoint(50, 50, 0)
+ t = camvtk.Text()
+ t.SetPos( (myscreen.width-200, myscreen.height-30) )
+
+ myscreen.addActor( t)
+
+ t2 = camvtk.Text()
+ t2.SetPos( (myscreen.width-200, 30) )
+ myscreen.addActor( t2)
+ t3 = camvtk.Text()
+ t3.SetPos( (30, 30))
+ myscreen.addActor( t3)
+
+ t4 = camvtk.Text()
+ t4.SetPos( (30, myscreen.height-60))
+ myscreen.addActor( t4)
+
+ n=0
+ precl = cam.Point()
+
+ w2if = vtk.vtkWindowToImageFilter()
+ w2if.SetInput(myscreen.renWin)
+ lwr = vtk.vtkPNGWriter()
+ lwr.SetInput( w2if.GetOutput() )
+ w2if.Modified()
+ lwr.SetFileName("tux1.png")
+
+ for cl,cc in zip(clpoints,ccpoints):
+
+ camEye = myscreen.camera.GetFocalPoint()
+ camPos = myscreen.camera.GetPosition()
+ postext = "(%3.3f, %3.3f, %3.3f)" % (camPos[0], camPos[1], camPos[2])
+ eyetext = "(%3.3f, %3.3f, %3.3f)" % (camEye[0], camEye[1], camEye[2])
+ camtext = "Camera LookAt: "+eyetext+"\nCamera Pos: "+ postext
+ t4.SetText(camtext)
+
+ t.SetText(datetime.datetime.now().strftime("%Y-%m-%d %H:%M:%S"))
+ xtext = "%3.3f" % cl.x
+ ytext = "%3.3f" % cl.y
+ ztext = "%3.3f" % cl.z
+ t2.SetText( "X: " + xtext + "\nY: " + ytext + "\nZ: " + ztext )
+ if cc.type==cam.CCType.FACET:
+ nf+=1
+ col = (0,1,1)
+ elif cc.type == cam.CCType.VERTEX:
+ nv+=1
+ col = (0,1,0)
+ elif cc.type == cam.CCType.EDGE:
+ ne+=1
+ col = (1,0,0)
+ elif cc.type == cam.CCType.NONE:
+ #print "type=NONE!"
+ nn+=1
+ col = (1,1,1)
+ #if cl.isInside(t):
+ # col = (0, 1, 0)
+ #else:
+ # col = (1, 0, 0)
+ trilist = pf2.getTrianglesUnderCutter(cl, cutter)
+ #print "at cl=", cl.str() , " where len(trilist)=", len(trilist)
+ t3.SetText("Total Triangles: "+ str(s.size()) +"\nUnder Cutter (red): "+str(len(trilist)))
+
+ stl2 = camvtk.STLSurf(filename=None, triangleList=trilist, color=(1,0,0)) # a new surface with only triangles under cutter
+ stl2.SetWireframe()
+ #stl2.SetFlat()
+ myscreen.addActor(stl2)
+ trilist=[]
+
+
+ cutactor = camvtk.Cylinder(center=(cl.x,cl.y,cl.z), radius=cutterDiameter/2, height=2, color=(0.7,1,1))
+ myscreen.addActor( cutactor )
+
+ #myscreen.addActor( camvtk.Point(center=(cl.x,cl.y,cl.z) , color=col) )
+
+ if n==0:
+ precl = cl
+ else:
+ d = cl-precl
+ if (d.norm() < 9):
+ myscreen.addActor( camvtk.Line( p1=(precl.x, precl.y, precl.z), p2=(cl.x, cl.y, cl.z), color=(0,1,1) ) )
+ precl = cl
+ n=n+1
+ #myscreen.addActor( camvtk.Point(center=(cl2.x,cl2.y,cl2.z+0.2) , color=(0.6,0.2,0.9)) )
+ #myscreen.addActor( camvtk.Point(center=(cc.x,cc.y,cc.z), color=col) )
+ #print cc.type
+ myscreen.camera.Azimuth( 0.2 )
+ #time.sleep(0.01)
+ myscreen.render()
+ w2if.Modified()
+ lwr.SetFileName("kdmov"+ ('%05d' % n)+".png")
+ #lwr.Write()
+
+
+ #raw_input("Press Enter to continue")
+ myscreen.removeActor(stl2)
+ myscreen.removeActor( cutactor )
+
+ print("none=",nn," vertex=",nv, " edge=",ne, " facet=",nf, " sum=", nn+nv+ne+nf)
+ print(len(clpoints), " cl points evaluated")
+
+
+
+
+ #lwr.Write()
+
+
+
+ for n in range(1,36):
+ t.SetText(datetime.datetime.now().strftime("%Y-%m-%d %H:%M:%S"))
+ myscreen.camera.Azimuth( 1 )
+ time.sleep(0.01)
+ myscreen.render()
+ lwr.SetFileName("kd_frame"+ ('%03d' % n)+".png")
+ w2if.Modified()
+ #lwr.Write()
+
+
+
+
+ myscreen.iren.Start()
+ raw_input("Press Enter to terminate")
+
diff -Nru opencamlib-11.10+git201801200005~ubuntu16.04.1/examples/python/kdtree_movie2.py opencamlib-11.10-1/examples/python/kdtree_movie2.py
--- opencamlib-11.10+git201801200005~ubuntu16.04.1/examples/python/kdtree_movie2.py 1970-01-01 00:00:00.000000000 +0000
+++ opencamlib-11.10-1/examples/python/kdtree_movie2.py 2020-06-14 12:13:19.000000000 +0000
@@ -0,0 +1,192 @@
+import ocl as cam
+import camvtk
+import time
+import vtk
+import datetime
+
+if __name__ == "__main__":
+ myscreen = camvtk.VTKScreen()
+ myscreen.setAmbient(20,20,20)
+
+ myscreen.camera.SetPosition(20, 30, 50)
+ myscreen.camera.SetFocalPoint(5, 5, 0)
+
+ stl = camvtk.STLSurf(filename="stl/demo.stl")
+ #stl = camvtk.STLSurf(filename="demo2.stl")
+ print("STL surface read")
+ myscreen.addActor(stl)
+ stl.SetWireframe()
+ stl.SetColor((0.5,0.5,0.5))
+ #stl.SetFlat()
+ polydata = stl.src.GetOutput()
+ s= cam.STLSurf()
+ camvtk.vtkPolyData2OCLSTL(polydata, s)
+ print("STLSurf with ", s.size(), " triangles")
+ cutterDiameter=1
+ cutter = cam.CylCutter(cutterDiameter)
+ #print cutter.str()
+ #print cc.type
+ minx=0
+ dx=1
+ maxx=10
+
+ miny=0
+ dy=1
+ maxy=10
+ z=-10
+
+ bucketSize = 20
+
+ #pftp = cam.ParallelFinish()
+ #pftp.initCLPoints(minx,dx,maxx,miny,dy,maxy,z)
+ #pftp.initSTLSurf(s, bucketSize)
+ #pftp.dropCutterSTL1(cutter)
+ #print " made ", pftp.dcCalls, " drop-cutter calls"
+ #exit
+
+ pf2 = cam.ParallelFinish()
+ pf2.initCLPoints(minx,dx,maxx,miny,dy,maxy,z)
+ pf2.initSTLSurf(s, bucketSize)
+ pf2.dropCutterSTL2(cutter)
+ print(" made ", pf2.dcCalls, " drop-cutter calls")
+
+ #clpoints = pftp.getCLPoints()
+ #ccpoints = pftp.getCCPoints()
+
+ clpoints = pf2.getCLPoints()
+ ccpoints = pf2.getCCPoints()
+
+ #CLPointGrid(minx,dx,maxx,miny,dy,maxy,z)
+ nv=0
+ nn=0
+ ne=0
+ nf=0
+
+ t = camvtk.Text()
+ t.SetPos( (myscreen.width-200, myscreen.height-30) )
+
+ myscreen.addActor( t)
+
+ t2 = camvtk.Text()
+ t2.SetPos( (myscreen.width-200, 30) )
+ myscreen.addActor( t2)
+ t3 = camvtk.Text()
+ t3.SetPos( (30, 30))
+ myscreen.addActor( t3)
+
+ t4 = camvtk.Text()
+ t4.SetPos( (30, myscreen.height-60))
+ myscreen.addActor( t4)
+
+ n=0
+ precl = cam.Point()
+
+ #w2if = vtk.vtkWindowToImageFilter()
+ #w2if.SetInput(myscreen.renWin)
+ #lwr = vtk.vtkPNGWriter()
+ #lwr.SetInput( w2if.GetOutput() )
+ #w2if.Modified()
+ #lwr.SetFileName("tux1.png")
+
+ for cl,cc in zip(clpoints,ccpoints):
+
+ camEye = myscreen.camera.GetFocalPoint()
+ camPos = myscreen.camera.GetPosition()
+ postext = "(%3.3f, %3.3f, %3.3f)" % (camPos[0], camPos[1], camPos[2])
+ eyetext = "(%3.3f, %3.3f, %3.3f)" % (camEye[0], camEye[1], camEye[2])
+ camtext = "Camera LookAt: "+eyetext+"\nCamera Pos: "+ postext
+ t4.SetText(camtext)
+
+ t.SetText(datetime.datetime.now().strftime("%Y-%m-%d %H:%M:%S"))
+ xtext = "%3.3f" % cl.x
+ ytext = "%3.3f" % cl.y
+ ztext = "%3.3f" % cl.z
+ t2.SetText( "X: " + xtext + "\nY: " + ytext + "\nZ: " + ztext )
+ if cc.type==cam.CCType.FACET:
+ nf+=1
+ col = (0,1,1)
+ elif cc.type == cam.CCType.VERTEX:
+ nv+=1
+ col = (0,1,0)
+ elif cc.type == cam.CCType.EDGE:
+ ne+=1
+ col = (1,0,0)
+ elif cc.type == cam.CCType.NONE:
+ #print "type=NONE!"
+ nn+=1
+ col = (1,1,1)
+ #if cl.isInside(t):
+ # col = (0, 1, 0)
+ #else:
+ # col = (1, 0, 0)
+ trilist = pf2.getTrianglesUnderCutter(cl, cutter)
+ #print "at cl=", cl.str() , " where len(trilist)=", len(trilist)
+ t3.SetText("Total Triangles: "+ str(s.size()) +"\nUnder Cutter (red): "+str(len(trilist)))
+
+ stl2 = camvtk.STLSurf(filename=None, triangleList=trilist, color=(1,0,0)) # a new surface with only triangles under cutter
+ stl2.SetWireframe()
+ #stl2.SetFlat()
+ myscreen.addActor(stl2)
+ trilist=[]
+
+
+ cutactor = camvtk.Cylinder(center=(cl.x,cl.y,cl.z),
+ radius=cutterDiameter/2,
+ height=20,
+ rotXYZ=(90,0,0),
+ color=(0.7,0,1))
+ myscreen.addActor( cutactor )
+
+ myscreen.addActor( camvtk.Sphere(center=(cl.x,cl.y,cl.z) ,radius=0.03, color=col) )
+
+ """
+ if n==0:
+ precl = cl
+ else:
+ d = cl-precl
+ if (d.norm() < 90):
+ myscreen.addActor( camvtk.Line( p1=(precl.x, precl.y, precl.z), p2=(cl.x, cl.y, cl.z), color=(0,1,1) ) )
+ precl = cl
+ """
+
+ n=n+1
+ #myscreen.addActor( camvtk.Point(center=(cl2.x,cl2.y,cl2.z+0.2) , color=(0.6,0.2,0.9)) )
+ #myscreen.addActor( camvtk.Point(center=(cc.x,cc.y,cc.z), color=col) )
+ #print cc.type
+ #myscreen.camera.Azimuth( 0.2 )
+ time.sleep(0.1)
+ myscreen.render()
+ #w2if.Modified()
+ #lwr.SetFileName("kdbig"+ ('%05d' % n)+".png")
+ #lwr.Write()
+
+
+ #raw_input("Press Enter to continue")
+ myscreen.removeActor(stl2)
+ myscreen.removeActor( cutactor )
+
+ print("none=",nn," vertex=",nv, " edge=",ne, " facet=",nf, " sum=", nn+nv+ne+nf)
+ print(len(clpoints), " cl points evaluated")
+
+
+
+
+ #lwr.Write()
+
+
+
+ for n in range(1,36):
+ t.SetText(datetime.datetime.now().strftime("%Y-%m-%d %H:%M:%S"))
+ myscreen.camera.Azimuth( 1 )
+ time.sleep(0.01)
+ myscreen.render()
+ #lwr.SetFileName("kd_frame"+ ('%03d' % n)+".png")
+ #w2if.Modified()
+ #lwr.Write()
+
+
+
+
+ myscreen.iren.Start()
+ raw_input("Press Enter to terminate")
+
diff -Nru opencamlib-11.10+git201801200005~ubuntu16.04.1/examples/python/lineclfilter_test.py opencamlib-11.10-1/examples/python/lineclfilter_test.py
--- opencamlib-11.10+git201801200005~ubuntu16.04.1/examples/python/lineclfilter_test.py 1970-01-01 00:00:00.000000000 +0000
+++ opencamlib-11.10-1/examples/python/lineclfilter_test.py 2020-06-14 12:13:19.000000000 +0000
@@ -0,0 +1,21 @@
+import ocl
+
+print ocl.version()
+
+p0 = ocl.CLPoint(0,0,0)
+p1 = ocl.CLPoint(1,2,3)
+p2 = ocl.CLPoint(1.1,2.2,3.3)
+clp=[]
+clp.append(p0)
+clp.append(p1)
+clp.append(p2)
+
+f = ocl.LineCLFilter()
+f.setTolerance(0.01)
+for p in clp:
+ f.addCLPoint(p)
+
+f.run()
+p2 = f.getCLPoints()
+for p in p2:
+ print(p)
diff -Nru opencamlib-11.10+git201801200005~ubuntu16.04.1/examples/python/mov_kdtree.sh opencamlib-11.10-1/examples/python/mov_kdtree.sh
--- opencamlib-11.10+git201801200005~ubuntu16.04.1/examples/python/mov_kdtree.sh 1970-01-01 00:00:00.000000000 +0000
+++ opencamlib-11.10-1/examples/python/mov_kdtree.sh 2020-06-14 12:13:19.000000000 +0000
@@ -0,0 +1,19 @@
+#!/bin/sh
+
+#first convert to JPEG
+#mogrify -format jpg -quality 97 *.png
+
+# a script for encoding jpeg-frames into a video suitable for uploading to youtube or vimeo
+
+# oldest, not very good...
+#mencoder mf://*.jpg -mf fps=25:type=jpg -ovc lavc -lavcopts vcodec=mpeg4 -ac copy -o output.avi -ffourcc DX50
+
+# -aspect 16:9
+# -mf fps=25:type=png -
+# better.
+mencoder mf://*.png -mf type=png -of lavf -ovc lavc -lavcopts aglobal=1:vglobal=1:coder=0:vcodec=mpeg4:vbitrate=24000000 -vf scale=1280:720 -ofps 30000/1001 -o OUTPUTp_24long.mp4
+
+# not so good.
+#mencoder mf://*.jpg -mf w=800:h=600:fps=25:type=jpg -ovc lavc -lavcopts vcodec=mpeg4:mbd=2:trell -oac copy -o output4.avi
+
+
diff -Nru opencamlib-11.10+git201801200005~ubuntu16.04.1/examples/python/mov.sh opencamlib-11.10-1/examples/python/mov.sh
--- opencamlib-11.10+git201801200005~ubuntu16.04.1/examples/python/mov.sh 1970-01-01 00:00:00.000000000 +0000
+++ opencamlib-11.10-1/examples/python/mov.sh 2020-06-14 12:13:19.000000000 +0000
@@ -0,0 +1,16 @@
+#!/bin/sh
+
+# a script for encoding jpeg-frames into a video suitable for uploading to youtube or vimeo
+
+# oldest, not very good...
+#mencoder mf://*.jpg -mf fps=25:type=jpg -ovc lavc -lavcopts vcodec=mpeg4 -ac copy -o output.avi -ffourcc DX50
+
+# better.
+mencoder mf://frames/*.png -mf fps=3:type=png -aspect 16:9 -of lavf -ovc lavc -lavcopts aglobal=1:vglobal=1:coder=0:vcodec=mpeg4:vbitrate=4500 -vf scale=1280:720 -ofps 3000/1001 -o OUTPUT3.mp4
+
+# not so good.
+#mencoder mf://*.jpg -mf w=800:h=600:fps=25:type=jpg -ovc lavc -lavcopts vcodec=mpeg4:mbd=2:trell -oac copy -o output4.avi
+
+
+# joining two or more files:
+# mencoder f1.mp4 f2.mp4 f3.mp4 f4.mp4 -mf fps=3 -oac copy -of lavf -ovc copy -lavcopts aglobal=1:vglobal=1:coder=0:vcodec=mpeg4:vbitrate=4500 -vf scale=1280:720 -o output.mp4
diff -Nru opencamlib-11.10+git201801200005~ubuntu16.04.1/examples/python/ocl_bounding-box.py opencamlib-11.10-1/examples/python/ocl_bounding-box.py
--- opencamlib-11.10+git201801200005~ubuntu16.04.1/examples/python/ocl_bounding-box.py 1970-01-01 00:00:00.000000000 +0000
+++ opencamlib-11.10-1/examples/python/ocl_bounding-box.py 2020-06-14 12:13:19.000000000 +0000
@@ -0,0 +1,70 @@
+import ocl
+import camvtk
+import time
+import vtk
+import datetime
+import math
+
+def drawBB(myscreen, bb):
+ lines=[]
+ # x-direction lines, red color
+ lines.append( camvtk.Line( p1=(bb.minpt.x, bb.minpt.y, bb.minpt.z), p2=(bb.maxpt.x, bb.minpt.y, bb.minpt.z), color=camvtk.red) )
+ lines.append( camvtk.Line( p1=(bb.minpt.x, bb.maxpt.y, bb.minpt.z), p2=(bb.maxpt.x, bb.maxpt.y, bb.minpt.z), color=camvtk.red) )
+ lines.append( camvtk.Line( p1=(bb.minpt.x, bb.minpt.y, bb.maxpt.z), p2=(bb.maxpt.x, bb.minpt.y, bb.maxpt.z), color=camvtk.red) )
+ lines.append( camvtk.Line( p1=(bb.minpt.x, bb.maxpt.y, bb.maxpt.z), p2=(bb.maxpt.x, bb.maxpt.y, bb.maxpt.z), color=camvtk.red) )
+
+ # y-direction lines, green color
+ lines.append( camvtk.Line( p1=(bb.minpt.x, bb.minpt.y, bb.minpt.z), p2=(bb.minpt.x, bb.maxpt.y, bb.minpt.z), color=camvtk.green) )
+ lines.append( camvtk.Line( p1=(bb.maxpt.x, bb.minpt.y, bb.minpt.z), p2=(bb.maxpt.x, bb.maxpt.y, bb.minpt.z), color=camvtk.green) )
+ lines.append( camvtk.Line( p1=(bb.minpt.x, bb.minpt.y, bb.maxpt.z), p2=(bb.minpt.x, bb.maxpt.y, bb.maxpt.z), color=camvtk.green) )
+ lines.append( camvtk.Line( p1=(bb.maxpt.x, bb.minpt.y, bb.maxpt.z), p2=(bb.maxpt.x, bb.maxpt.y, bb.maxpt.z), color=camvtk.green) )
+
+ # z-direction lines, blue color
+ lines.append( camvtk.Line( p1=(bb.minpt.x, bb.minpt.y, bb.minpt.z), p2=(bb.minpt.x, bb.minpt.y, bb.maxpt.z), color=camvtk.blue) )
+ lines.append( camvtk.Line( p1=(bb.maxpt.x, bb.minpt.y, bb.minpt.z), p2=(bb.maxpt.x, bb.minpt.y, bb.maxpt.z), color=camvtk.blue) )
+ lines.append( camvtk.Line( p1=(bb.minpt.x, bb.maxpt.y, bb.minpt.z), p2=(bb.minpt.x, bb.maxpt.y, bb.maxpt.z), color=camvtk.blue) )
+ lines.append( camvtk.Line( p1=(bb.maxpt.x, bb.maxpt.y, bb.minpt.z), p2=(bb.maxpt.x, bb.maxpt.y, bb.maxpt.z), color=camvtk.blue) )
+
+ for l in lines:
+ myscreen.addActor(l)
+
+if __name__ == "__main__":
+ print(ocl.version())
+
+ myscreen = camvtk.VTKScreen()
+
+ stl = camvtk.STLSurf("../stl/gnu_tux_mod.stl")
+ #stl = camvtk.STLSurf("../stl/beet_mm.stl")
+ #stl = camvtk.STLSurf("../stl/Blade.stl")
+ myscreen.addActor(stl)
+ stl.SetWireframe()
+ stl.SetColor((0.5,0.5,0.5))
+
+ polydata = stl.src.GetOutput()
+ s = ocl.STLSurf()
+ camvtk.vtkPolyData2OCLSTL(polydata, s)
+ print("STL surface read ", s.size(), " triangles")
+
+ minimum_point = s.bb.minpt
+ maximum_point = s.bb.maxpt
+ print("min point =", minimum_point)
+ print("max point =", maximum_point)
+ print(s.getBounds())
+
+ # render the min and max points
+ myscreen.addActor( camvtk.Sphere( center=(minimum_point.x, minimum_point.y, minimum_point.z), radius=0.1, color=camvtk.red) )
+ myscreen.addActor( camvtk.Sphere( center=(maximum_point.x, maximum_point.y, maximum_point.z), radius=0.1, color=camvtk.green) )
+
+ # render a bounding-box
+ drawBB( myscreen, s.bb )
+
+ myscreen.camera.SetPosition(3, 23, 15)
+ myscreen.camera.SetFocalPoint(4, 5, 0)
+ t = camvtk.Text()
+ t.SetText("OpenCAMLib")
+ t.SetPos( (myscreen.width-200, myscreen.height-30) )
+ myscreen.addActor( t)
+
+ myscreen.render()
+ myscreen.iren.Start()
+ raw_input("Press Enter to terminate")
diff -Nru opencamlib-11.10+git201801200005~ubuntu16.04.1/examples/python/ocl_clpoint.py opencamlib-11.10-1/examples/python/ocl_clpoint.py
--- opencamlib-11.10+git201801200005~ubuntu16.04.1/examples/python/ocl_clpoint.py 1970-01-01 00:00:00.000000000 +0000
+++ opencamlib-11.10-1/examples/python/ocl_clpoint.py 2020-06-14 12:13:19.000000000 +0000
@@ -0,0 +1,16 @@
+import ocl
+
+# print(ocl.version())
+
+p = ocl.Point(1,2,3)
+print p
+cc = ocl.CCPoint(4,5,6)
+print cc
+cl = ocl.CLPoint()
+print cl
+cl2 = ocl.CLPoint(7,8,9)
+print cl2
+cl3 = ocl.CLPoint(10,11,12,cc)
+print cl3
+cc.x=77
+print cl3
diff -Nru opencamlib-11.10+git201801200005~ubuntu16.04.1/examples/python/ocl_docstring_test.py opencamlib-11.10-1/examples/python/ocl_docstring_test.py
--- opencamlib-11.10+git201801200005~ubuntu16.04.1/examples/python/ocl_docstring_test.py 1970-01-01 00:00:00.000000000 +0000
+++ opencamlib-11.10-1/examples/python/ocl_docstring_test.py 2020-06-14 12:13:19.000000000 +0000
@@ -0,0 +1,8 @@
+import ocl
+#help(ocl)
+
+#
+c=ocl.BallCutter(1,2)
+print c.__doc__
+print ocl.version()
+help(ocl.BallCutter(4,5))
diff -Nru opencamlib-11.10+git201801200005~ubuntu16.04.1/examples/python/ocl_interval.py opencamlib-11.10-1/examples/python/ocl_interval.py
--- opencamlib-11.10+git201801200005~ubuntu16.04.1/examples/python/ocl_interval.py 1970-01-01 00:00:00.000000000 +0000
+++ opencamlib-11.10-1/examples/python/ocl_interval.py 2020-06-14 12:13:19.000000000 +0000
@@ -0,0 +1,24 @@
+import ocl
+import camvtk
+import time
+import vtk
+import datetime
+import math
+
+
+if __name__ == "__main__":
+ print(ocl.version())
+ i = ocl.Interval()
+ print(i)
+ i = ocl.Interval(0.123, 0.456)
+ print(i)
+ cc = ocl.CCPoint(1,2,3)
+ cc.type = ocl.CCType.VERTEX
+ i.updateLower(-0.222,cc)
+ print(i)
+ i.updateLower(0,cc)
+ print(i)
+ i.updateUpper(0,cc)
+ print(i)
+ i.updateUpper(2,cc)
+ print(i)
diff -Nru opencamlib-11.10+git201801200005~ubuntu16.04.1/examples/python/ocl_offsetCutter_1.py opencamlib-11.10-1/examples/python/ocl_offsetCutter_1.py
--- opencamlib-11.10+git201801200005~ubuntu16.04.1/examples/python/ocl_offsetCutter_1.py 1970-01-01 00:00:00.000000000 +0000
+++ opencamlib-11.10-1/examples/python/ocl_offsetCutter_1.py 2020-06-14 12:13:19.000000000 +0000
@@ -0,0 +1,33 @@
+import ocl
+import math
+
+print ocl.version()
+
+# cylinder
+c = ocl.CylCutter(2.345, 5)
+d = c.offsetCutter(0.1)
+print c
+print "offset: ",d
+print
+
+# ball
+c = ocl.BallCutter(2.345, 6)
+d = c.offsetCutter(0.1)
+print c
+print "offset: ",d
+print
+
+# bull
+c = ocl.BullCutter(2.345, 0.123, 6)
+d = c.offsetCutter(0.1)
+print c
+print "offset: ",d
+print
+
+# cone
+c = ocl.ConeCutter(2.345, math.pi/6)
+d = c.offsetCutter(0.1)
+print c
+print "offset: ",d
+
+# TODO: add compound-cutters here below.
diff -Nru opencamlib-11.10+git201801200005~ubuntu16.04.1/examples/python/ocl_stl2ocl_tst.py opencamlib-11.10-1/examples/python/ocl_stl2ocl_tst.py
--- opencamlib-11.10+git201801200005~ubuntu16.04.1/examples/python/ocl_stl2ocl_tst.py 1970-01-01 00:00:00.000000000 +0000
+++ opencamlib-11.10-1/examples/python/ocl_stl2ocl_tst.py 2020-06-14 12:13:19.000000000 +0000
@@ -0,0 +1,21 @@
+import ocl
+import camvtk
+import time
+
+if __name__ == "__main__":
+ s= ocl.STLSurf()
+ print(s)
+ myscreen = camvtk.VTKScreen()
+ stl = camvtk.STLSurf("../stl/demo.stl")
+ print("STL surface read")
+ myscreen.addActor(stl)
+ stl.SetWireframe()
+
+ polydata = stl.src.GetOutput()
+ camvtk.vtkPolyData2OCLSTL(polydata, s)
+
+ print(s)
+ myscreen.render()
+ myscreen.iren.Start()
+
+ #raw_input("Press Enter to terminate")
diff -Nru opencamlib-11.10+git201801200005~ubuntu16.04.1/examples/python/ocl_stlsurf_polydata.py opencamlib-11.10-1/examples/python/ocl_stlsurf_polydata.py
--- opencamlib-11.10+git201801200005~ubuntu16.04.1/examples/python/ocl_stlsurf_polydata.py 1970-01-01 00:00:00.000000000 +0000
+++ opencamlib-11.10-1/examples/python/ocl_stlsurf_polydata.py 2020-06-14 12:13:19.000000000 +0000
@@ -0,0 +1,52 @@
+import ocl
+import camvtk
+import time
+
+
+if __name__ == "__main__":
+ p = ocl.Point()
+ p.x=7
+ p.y=8
+ p.z=-3
+ print(p)
+ q = ocl.Point(1,2,3)
+ r = p + q
+ t = ocl.Triangle(p,q,r)
+ print(t)
+ s= ocl.STLSurf()
+ print(s)
+ s.addTriangle(t)
+ s.addTriangle(t)
+ print(s)
+ print("end.")
+
+ myscreen = camvtk.VTKScreen()
+ print("screen created")
+ stl = camvtk.STLSurf("../stl/sphere.stl")
+ print("STL surface read")
+ myscreen.addActor(stl)
+
+ b = stl.src.GetOutput()
+ print(b)
+ print("Verts:",b.GetNumberOfVerts())
+ print("Cells:",b.GetNumberOfCells())
+ print("Lines:",b.GetNumberOfLines())
+ print("Polys:",b.GetNumberOfPolys())
+ print("Strips:",b.GetNumberOfStrips())
+ c = b.GetCell(0)
+ print(c)
+ print("Points:",c.GetNumberOfPoints())
+ print("Edges:",c.GetNumberOfEdges())
+ print("Faces:",c.GetNumberOfFaces())
+ ps = c.GetPoints()
+ print(ps)
+ n=ps.GetNumberOfPoints()
+ print("Nr of Points:",n)
+ for id in range(0,n):
+ print(id,"=",)
+ print(ps.GetPoint(id))
+ myscreen.addActor( camvtk.Sphere(radius=0.5,center=ps.GetPoint(id)) )
+ myscreen.render()
+ myscreen.iren.Start()
+ #raw_input("Press Enter to terminate")
+
diff -Nru opencamlib-11.10+git201801200005~ubuntu16.04.1/examples/python/ocl_test0.py opencamlib-11.10-1/examples/python/ocl_test0.py
--- opencamlib-11.10+git201801200005~ubuntu16.04.1/examples/python/ocl_test0.py 1970-01-01 00:00:00.000000000 +0000
+++ opencamlib-11.10-1/examples/python/ocl_test0.py 2020-06-14 12:13:19.000000000 +0000
@@ -0,0 +1,32 @@
+import ocl
+
+if __name__ == "__main__":
+ p = ocl.Point()
+ p.x=7
+ p.y=8
+ p.z=-3
+
+ print(p)
+ q = ocl.Point(1,2,3)
+ print(q)
+ r = p + q
+ s = ocl.Point(66,66,66)
+ s += r
+ print(r)
+ print(s)
+ print("2*s=", (s*2))
+ print("s.norm=", s.norm())
+ print("normalizing")
+ s.normalize()
+ print("s.norm=", s.norm())
+ print("s dot r", s.dot(r))
+ print("s cross r", s.cross(r))
+ t = ocl.Triangle(p,q,r)
+ print(t)
+ s= ocl.STLSurf()
+ print(s)
+ s.addTriangle(t)
+ s.addTriangle(t)
+ print(s)
+ print("end.")
+
diff -Nru opencamlib-11.10+git201801200005~ubuntu16.04.1/examples/python/octree_fig.py opencamlib-11.10-1/examples/python/octree_fig.py
--- opencamlib-11.10+git201801200005~ubuntu16.04.1/examples/python/octree_fig.py 1970-01-01 00:00:00.000000000 +0000
+++ opencamlib-11.10-1/examples/python/octree_fig.py 2020-06-14 12:13:19.000000000 +0000
@@ -0,0 +1,93 @@
+import ocl
+import pyocl
+import camvtk
+import time
+import datetime
+import vtk
+import math
+"""
+This scripts draws a picture which enumerates the vertices, edges, and faces
+of an octree node, as used in the octree cutting simulation and
+marching-cubes.
+"""
+def main():
+ print(ocl.version())
+ myscreen = camvtk.VTKScreen()
+ myscreen.camera.SetPosition(-8, -4, 25)
+ myscreen.camera.SetFocalPoint(0,0, 0)
+ arpos=-1.5
+ camvtk.drawArrows(myscreen,center=(arpos,arpos,arpos))
+ camvtk.drawOCLtext(myscreen)
+ octtext = camvtk.Text()
+ octtext.SetPos( (70, myscreen.height-600) )
+ myscreen.addActor( octtext)
+ octtext.SetText("Octree")
+ vertex = [ ocl.Point( 1, 1,-1), #// 0
+ ocl.Point(-1, 1,-1), #// 1
+ ocl.Point(-1,-1,-1), #// 2
+ ocl.Point( 1,-1,-1), #// 3
+ ocl.Point( 1, 1, 1), #// 4
+ ocl.Point(-1, 1, 1), #// 5
+ ocl.Point(-1,-1, 1), #// 6
+ ocl.Point( 1,-1, 1) #// 7
+ ]
+
+ n=0
+ for v in vertex:
+ myscreen.addActor( camvtk.Sphere(center=(v.x,v.y,v.z), radius=0.1,color=camvtk.red))
+ v=v
+ t = camvtk.Text3D(color=camvtk.red, center=(v.x+0.1,v.y+0.1,v.z), text=str(n), scale=0.2, camera=myscreen.camera)
+ myscreen.addActor(t)
+ n=n+1
+
+ edgeTable = [ [0,1] ,
+ [1,2] ,
+ [2,3] ,
+ [3,0] ,
+ [4,5] ,
+ [5,6] ,
+ [6,7] ,
+ [7,4] ,
+ [0,4] ,
+ [1,5] ,
+ [2,6] ,
+ [3,7] ,
+ ]
+
+ # draw the edges as tubes
+ ne = 0
+ for e in edgeTable:
+
+ ep1 = vertex[ e[0] ]
+ ep2 = vertex[ e[1] ]
+ tu = camvtk.Tube( p1=(ep1.x,ep1.y,ep1.z), p2=(ep2.x,ep2.y,ep2.z), radius=0.051, color=camvtk.green )
+ myscreen.addActor(tu)
+ mid = 0.5*(ep1 + ep2)
+ t = camvtk.Text3D(color=camvtk.green, center=(mid.x+0.1,mid.y+0.1,mid.z), text=str(ne), scale=0.2, camera=myscreen.camera)
+ myscreen.addActor(t)
+ ne=ne+1
+
+ # number the faces
+ face = [ [2,3,6,7] ,
+ [0,3,4,7] ,
+ [0,1,4,5] ,
+ [1,2,5,6] ,
+ [0,1,2,3] ,
+ [4,5,6,7] ,
+ ]
+ nf=0
+ for f in face:
+ mid = ocl.Point()
+ for v in f:
+ mid = mid+vertex[v]
+ mid=0.25*mid
+ t = camvtk.Text3D(color=camvtk.blue, center=(mid.x,mid.y,mid.z), text=str(nf), scale=0.2, camera=myscreen.camera)
+ myscreen.addActor(t)
+ nf=nf+1
+ myscreen.render()
+ print("All done.")
+ myscreen.iren.Start()
+
+if __name__ == "__main__":
+
+ main()
diff -Nru opencamlib-11.10+git201801200005~ubuntu16.04.1/examples/python/offsetCutter_test_2.py opencamlib-11.10-1/examples/python/offsetCutter_test_2.py
--- opencamlib-11.10+git201801200005~ubuntu16.04.1/examples/python/offsetCutter_test_2.py 1970-01-01 00:00:00.000000000 +0000
+++ opencamlib-11.10-1/examples/python/offsetCutter_test_2.py 2020-06-14 12:13:19.000000000 +0000
@@ -0,0 +1,115 @@
+import ocl
+import camvtk
+import time
+import vtk
+import datetime
+import math
+
+def CLPointGrid(minx,dx,maxx,miny,dy,maxy,z):
+ plist = []
+ xvalues = [round(minx+n*dx,2) for n in range(int(round((maxx-minx)/dx))+1) ]
+ yvalues = [round(miny+n*dy,2) for n in range(int(round((maxy-miny)/dy))+1) ]
+ for y in yvalues:
+ for x in xvalues:
+ plist.append( ocl.CLPoint(x,y,z) )
+ return plist
+
+def drawPoints(myscreen, clpoints, ccpoints):
+ c=camvtk.PointCloud( pointlist=clpoints, collist=ccpoints)
+ c.SetPoints()
+ myscreen.addActor(c )
+
+
+if __name__ == "__main__":
+ myscreen = camvtk.VTKScreen()
+
+ a=ocl.Point(1,0.6,0.1)
+ myscreen.addActor(camvtk.Point(center=(a.x,a.y,a.z), color=(1,0,1)))
+ b=ocl.Point(0,1,0)
+ myscreen.addActor(camvtk.Point(center=(b.x,b.y,b.z), color=(1,0,1)))
+ c=ocl.Point(0,0,0.0)
+ myscreen.addActor(camvtk.Point(center=(c.x,c.y,c.z), color=(1,0,1)))
+
+ myscreen.addActor( camvtk.Line(p1=(a.x,a.y,a.z),p2=(c.x,c.y,c.z)) )
+ myscreen.addActor( camvtk.Line(p1=(c.x,c.y,c.z),p2=(b.x,b.y,b.z)) )
+ myscreen.addActor( camvtk.Line(p1=(a.x,a.y,a.z),p2=(b.x,b.y,b.z)) )
+
+ t = ocl.Triangle(b,c,a)
+ radius1=1
+ angle = math.pi/4
+ length=10
+ #cutter = ocl.ConeCutter(0.37, angle)
+
+ cutter = ocl.BallCutter(0.532, length)
+ #cutter = ocl.CylCutter(0.3, length)
+ #cutter = ocl.BullCutter(0.7,0.1, length)
+
+ # these cutters do not have offsets yet (?)
+ #cutter = ocl.CylConeCutter(0.2,0.5,math.pi/9)
+ #cutter = ocl.BallConeCutter(0.4,0.6,math.pi/9)
+ #cutter = ocl.BullConeCutter(0.4,0.1,0.7,math.pi/6)
+ #cutter = ocl.ConeConeCutter(0.4,math.pi/3,0.7,math.pi/6)
+ #cutter = ocl.ConeCutter(0.4, math.pi/3)
+ print(cutter)
+ offset=0.1
+ c2 = cutter.offsetCutter(offset)
+ print(c2)
+
+ minx=-0.5
+ dx=0.0051
+ maxx=1.5
+ miny=-0.7
+ dy=dx
+ maxy=1.5
+ z=-1.8
+ clpoints = CLPointGrid(minx,dx,maxx,miny,dy,maxy,z)
+ print(len(clpoints), "cl-points to evaluate")
+ n=0
+ ccpoints=[]
+ cl2pts=[]
+ for p in clpoints:
+ cl2pts.append(ocl.CLPoint(p.x,p.y,p.z))
+
+ for (cl,cl2) in zip(clpoints,cl2pts):
+
+ #cutter.vertexDrop(cl,t)
+ #cutter.edgeDrop(cl,t)
+ #cutter.facetDrop(cl,t)
+ #c2.vertexDrop(cl2,t)
+ cutter.dropCutter(cl,t)
+ c2.dropCutter(cl2,t)
+ n=n+1
+ if (n % int(len(clpoints)/10)) == 0:
+ print(n/int(len(clpoints)/10), " ",)
+
+ print("done.")
+
+ print("rendering...")
+ print(" len(clpoints)=", len(clpoints))
+ print(" len(ccl2pts)=", len(cl2pts))
+ print("rendering clpoints...",)
+ camvtk.drawCLPointCloud(myscreen, clpoints)
+ print("done.")
+ cl2ptsofs=[]
+ for p in cl2pts:
+ p.z = p.z + offset
+ cl2ptsofs.append(p)
+ print("rendering offset clpoints...",)
+ camvtk.drawCLPointCloud(myscreen, cl2ptsofs)
+ print("done.")
+ origo = camvtk.Sphere(center=(0,0,0) , radius=0.1, color=camvtk.blue)
+ origo.SetOpacity(0.2)
+ myscreen.addActor( origo )
+
+ myscreen.camera.SetPosition(0.5, 3, 2)
+ myscreen.camera.SetFocalPoint(0.5, 0.5, 0)
+ myscreen.render()
+ w2if = vtk.vtkWindowToImageFilter()
+ w2if.SetInput(myscreen.renWin)
+ lwr = vtk.vtkPNGWriter()
+ lwr.SetInput( w2if.GetOutput() )
+ t = camvtk.Text()
+ t.SetPos( (myscreen.width-350, myscreen.height-30) )
+ myscreen.addActor(t)
+ myscreen.iren.Start()
+ #raw_input("Press Enter to terminate")
diff -Nru opencamlib-11.10+git201801200005~ubuntu16.04.1/examples/python/offset-ellipse/epos_test.py opencamlib-11.10-1/examples/python/offset-ellipse/epos_test.py
--- opencamlib-11.10+git201801200005~ubuntu16.04.1/examples/python/offset-ellipse/epos_test.py 1970-01-01 00:00:00.000000000 +0000
+++ opencamlib-11.10-1/examples/python/offset-ellipse/epos_test.py 2020-06-14 12:13:19.000000000 +0000
@@ -0,0 +1,17 @@
+import ocl
+import camvtk
+import time
+import vtk
+import datetime
+import math
+
+if __name__ == "__main__":
+ p = ocl.Epos()
+ print("initial Epos() is ",p, "with dia=",p.d)
+
+ for n in range(0,30):
+ print(p.d," : ",p)
+ p.d = p.d - 0.25
+ p.setD()
+
+ raw_input("Press Enter to terminate")
diff -Nru opencamlib-11.10+git201801200005~ubuntu16.04.1/examples/python/offset-ellipse/oeanim.py opencamlib-11.10-1/examples/python/offset-ellipse/oeanim.py
--- opencamlib-11.10+git201801200005~ubuntu16.04.1/examples/python/offset-ellipse/oeanim.py 1970-01-01 00:00:00.000000000 +0000
+++ opencamlib-11.10-1/examples/python/offset-ellipse/oeanim.py 2020-06-14 12:13:19.000000000 +0000
@@ -0,0 +1,18 @@
+import oellipse5_tst as oe
+import math
+
+Nsteps = 500
+ystart = -0.2
+ystop = 2.2
+
+ystep = (ystop-ystart)/(Nsteps-1)
+fiangle = 55
+
+def radian(deg):
+ return (float(deg)/360)*2*math.pi
+
+for n in range(0,Nsteps):
+ yc = ystart + n*ystep
+ fname = "frames/oet"+ ('%05d' % n)+".png"
+ oe.main(ycoord=yc, filename=fname, theta=70, fi=radian(fiangle))
+ #fiangle = fiangle + 2
diff -Nru opencamlib-11.10+git201801200005~ubuntu16.04.1/examples/python/offset-ellipse/oellipse0_tst.py opencamlib-11.10-1/examples/python/offset-ellipse/oellipse0_tst.py
--- opencamlib-11.10+git201801200005~ubuntu16.04.1/examples/python/offset-ellipse/oellipse0_tst.py 1970-01-01 00:00:00.000000000 +0000
+++ opencamlib-11.10-1/examples/python/offset-ellipse/oellipse0_tst.py 2020-06-14 12:13:19.000000000 +0000
@@ -0,0 +1,219 @@
+import ocl as cam
+import camvtk
+import time
+import vtk
+import math
+
+red= (1,0,0)
+green= (0,1,0)
+blue= (0,0,1)
+cyan= (0,1,1)
+yellow= (1,1,0)
+magenta =(float(255)/255,0,float(225)/255)
+pink =(float(255)/255,float(193)/255,float(203)/255)
+
+def ccColor2(cc):
+ """ this function returns a different color depending on the type of
+ the CC-point. Useful for visualizing CL or CC points """
+ if cc.type==cam.CCType.FACET:
+ col = (1,0,1)
+ elif cc.type == cam.CCType.VERTEX:
+ col = (1,1,0)
+ elif cc.type == cam.CCType.EDGE:
+ col = (0,1,1)
+ elif cc.type == cam.CCType.NONE:
+ col = (1,1,1)
+ elif cc.type == cam.CCType.ERROR:
+ col = (0,0.5,1)
+ return col
+
+class OffsetEllipse():
+ """
+ // (s, t) where: s^2 + t^2 = 1
+ // point of ellipse is: ecen + j s + n t
+ // tangent at point is: -j t + n s
+ // normal at point is: j (s / eccen) + n (t * eccen)
+ // point on offset-ellipse: point on ellipse + offrad*normal
+ """
+ def __init__(self, ecen, a, b, ofs):
+ self.a = a
+ self.b = b
+ self.ecen = ecen
+ self.ofs = ofs
+
+ def ePoint(self,t,s):
+ # return a point on the ellipse
+ p = cam.Point()
+ p.x = self.ecen.x + self.a*s
+ p.y = self.ecen.y + self.b*t
+ return p
+
+ def oePoint(self,t,s):
+ # return point on offset-ellipse
+ p = self.ePoint(t,s)
+ normal = cam.Point( self.b*s, self.a*t, 0)
+ normal.normalize()
+ p = p + self.ofs*normal
+ return p
+
+ def teval(self, s, side):
+ ssq = s*s
+ tsq = 1 - ssq
+ if side == 1:
+ return 1 * math.sqrt(tsq)
+ else:
+ return -1* math.sqrt(tsq)
+
+if __name__ == "__main__":
+ myscreen = camvtk.VTKScreen()
+
+ a=cam.Point(3,2,-2)
+ b=cam.Point(-1,2,3)
+
+ myscreen.addActor(camvtk.Point(center=(a.x,a.y,a.z), color=(1,0,1)));
+ myscreen.addActor(camvtk.Point(center=(b.x,b.y,b.z), color=(1,0,1)));
+ #c=cam.Point(0,0,0.3)
+ myscreen.addActor( camvtk.Line(p1=(a.x,a.y,a.z),p2=(b.x,b.y,b.z)) )
+ #t = cam.Triangle(a,b,c)
+ length = 5
+ cutter = cam.BullCutter(1,0.2,length)
+
+
+ print(cutter)
+
+ xar = camvtk.Arrow(color=red, rotXYZ=(0,0,0))
+ myscreen.addActor(xar)
+ yar = camvtk.Arrow(color=green, rotXYZ=(0,0,90))
+ myscreen.addActor(yar)
+ zar = camvtk.Arrow(color=blue, rotXYZ=(0,-90,0))
+ myscreen.addActor(zar)
+
+ cl = cam.Point(2.193, 1, 0)
+ radius1=1
+ radius2=0.25
+
+ tor = camvtk.Toroid(r1=radius1, r2=radius2, center=(cl.x, cl.y, cl.z),rotXYZ=(0,0,0))
+ #tor.SetWireframe()
+ tor.SetSurface()
+ tor.SetOpacity(0.3)
+ myscreen.addActor(tor)
+
+ cyl = camvtk.Cylinder(center=(cl.x,cl.y,cl.z) , radius=radius1, height=2, color=(0,1,1),
+ rotXYZ=(90,0,0), resolution=50 )
+ #myscreen.addActor(cyl)
+
+ tube = camvtk.Tube(p1=(a.x,a.y,a.z),p2=(b.x,b.y,b.z),radius=radius2, color=(1,1,0))
+ tube.SetOpacity(0.1)
+ myscreen.addActor(tube)
+
+ cir= camvtk.Circle(radius=radius1, center=(cl.x,cl.y,cl.z), color=yellow)
+ myscreen.addActor(cir)
+
+ clp = camvtk.Sphere(radius=0.02, center=(cl.x,cl.y,cl.z), color=yellow)
+ myscreen.addActor(clp)
+
+ # short axis of ellipse = radius2
+ # long axis of ellipse = radius2/sin(theta)
+ # where theta is the slope of the line
+ dx = b.x - a.x
+ dz = b.z - a.z
+ print("dx=", dx)
+ print("dz=", dz)
+ theta = math.atan(dz/dx)
+ print("theta=",theta)
+ a = abs( radius2/math.sin(theta) )
+ print("a=", a, " = ", a/radius2,"* radius2")
+ # ellipse
+ #a=2
+ b=radius2
+ print("b= ", b)
+
+
+ ecen_tmp=cam.Point(1.38,2,0)
+ resolution=50
+ for n in range(0,resolution):
+ angle1= (float(n)/float(resolution))*2*math.pi
+ angle2= (float(n+1)/float(resolution))*2*math.pi
+ x=ecen_tmp.x + a*math.cos(angle1)
+ y=ecen_tmp.y + b*math.sin(angle1)
+ x2=ecen_tmp.x + a*math.cos(angle2)
+ y2=ecen_tmp.y + b*math.sin(angle2)
+
+ #myscreen.addActor(camvtk.Point(center=(x,y,0), color=(1,0,1)))
+ #myscreen.addActor( camvtk.Line(p1=(x,y,0),p2=(x2,y2,0)) )
+
+ oe = cam.Ellipse(ecen_tmp, a, b, radius1)
+
+ myscreen.camera.SetPosition(5, 7, 1)
+ myscreen.camera.SetFocalPoint(0.5, 0.5, 0)
+
+ nmax=80
+ dd = float(4.0)/nmax
+ diangles = [ n*dd for n in range(nmax) ]
+ epos1 = cam.EllipsePosition()
+ epos2 = cam.EllipsePosition()
+ for n in range(nmax):
+ #s = float(n)/float(nmax-1) * 2-1
+ #t = oe.teval(s, 1)
+ #t2 = oe.teval(s, 0)
+ n2 = n+1
+ if n2==nmax:
+ n2=0
+ epos1.setDiangle( diangles[n] )
+ epos2.setDiangle( diangles[n2] )
+
+ p1 = oe.ePoint( epos1 )
+ p2 = oe.ePoint( epos2 )
+
+ p1o = oe.oePoint( epos1 )
+ p2o = oe.oePoint( epos2 )
+ #print "s=", s, "t=", t," epoint=", p1.str()
+
+ myscreen.addActor( camvtk.Line(p1=(p1.x,p1.y,p1.z),p2=(p2.x,p2.y,p2.z), color=magenta) )
+
+ myscreen.addActor( camvtk.Line(p1=(p1o.x,p1o.y,p1o.z),p2=(p2o.x,p2o.y,p2o.z), color=pink) )
+ #myscreen.addActor(camvtk.Point(center=(p1.x,p1.y,0), color=green))
+ #myscreen.addActor(camvtk.Point(center=(p2.x,p2.y,0), color=red))
+
+ #myscreen.addActor(camvtk.Point(center=(p1o.x,p1o.y,0), color=green))
+ #myscreen.addActor(camvtk.Point(center=(p2o.x,p2o.y,0), color=red))
+
+ # ellipse point, normal
+ #epos1.setDiangle(3.48) # approx solution
+ epos1.setDiangle(0)
+ ep = oe.ePoint( epos1 )
+ oep = oe.oePoint( epos1 )
+ myscreen.addActor( camvtk.Sphere(radius=0.02, center=(ep.x,ep.y,ep.z), color=magenta) )
+ myscreen.addActor( camvtk.Sphere(radius=0.02, center=(oep.x,oep.y,oep.z), color=pink) )
+ myscreen.addActor( camvtk.Line(p1=(ep.x,ep.y,ep.z),p2=(oep.x,oep.y,oep.z), color=red) )
+
+ myscreen.render()
+ #time.sleep(0.5)
+
+ print("rendering...",)
+ #for cl,cc in zip(clpoints,ccpoints):
+ # myscreen.addActor( camvtk.Point(center=(cl.x,cl.y,cl.z) , color=ccColor(cc) ) )
+ # if cc.type != cam.CCType.NONE: # only render interesting cc-points
+ # myscreen.addActor( camvtk.Point(center=(cc.x,cc.y,cc.z) , color=ccColor2(cc) ) )
+
+
+ print("done.")
+
+
+
+
+ myscreen.render()
+
+ #w2if = vtk.vtkWindowToImageFilter()
+ #w2if.SetInput(myscreen.renWin)
+ #lwr = vtk.vtkPNGWriter()
+ #lwr.SetInput( w2if.GetOutput() )
+ #w2if.Modified()
+ #lwr.SetFileName("5_all.png")
+ #lwr.Write()
+
+
+
+ myscreen.iren.Start()
+ #raw_input("Press Enter to terminate")
+
diff -Nru opencamlib-11.10+git201801200005~ubuntu16.04.1/examples/python/offset-ellipse/oellipse2_tst.py opencamlib-11.10-1/examples/python/offset-ellipse/oellipse2_tst.py
--- opencamlib-11.10+git201801200005~ubuntu16.04.1/examples/python/offset-ellipse/oellipse2_tst.py 1970-01-01 00:00:00.000000000 +0000
+++ opencamlib-11.10-1/examples/python/offset-ellipse/oellipse2_tst.py 2020-06-14 12:13:19.000000000 +0000
@@ -0,0 +1,387 @@
+import ocl as cam
+import camvtk
+import time
+import vtk
+import math
+import datetime
+
+red= (1,0,0)
+green= (0,1,0)
+blue= (0,0,1)
+cyan= (0,1,1)
+yellow= (1,1,0)
+pink = ( float(255)/255,float(192)/255,float(203)/255)
+grey = ( float(127)/255,float(127)/255,float(127)/255)
+orange = ( float(255)/255,float(165)/255,float(0)/255)
+
+def ccColor2(cc):
+ """ this function returns a different color depending on the type of
+ the CC-point. Useful for visualizing CL or CC points """
+ if cc.type==cam.CCType.FACET:
+ col = (1,0,1)
+ elif cc.type == cam.CCType.VERTEX:
+ col = (1,1,0)
+ elif cc.type == cam.CCType.EDGE:
+ col = (0,1,1)
+ elif cc.type == cam.CCType.NONE:
+ col = (1,1,1)
+ elif cc.type == cam.CCType.ERROR:
+ col = (0,0.5,1)
+ return col
+
+class OffsetEllipse():
+ """
+ // (s, t) where: s^2 + t^2 = 1
+ // point of ellipse is: ecen + j s + n t
+ // tangent at point is: -j t + n s
+ // normal at point is: j (s / eccen) + n (t * eccen)
+ // point on offset-ellipse: point on ellipse + offrad*normal
+ """
+ def __init__(self, ecen, a, b, ofs):
+ self.a = a
+ self.b = b
+ self.ecen = ecen
+ self.ofs = ofs
+
+ def ePoint(self,epos):
+ # return a point on the ellipse
+ p = cam.Point()
+ p.x = self.ecen.x + self.a*epos.s
+ p.y = self.ecen.y + self.b*epos.t
+ return p
+
+ def oePoint(self,epos):
+ # return point on offset-ellipse
+ p = self.ePoint(epos)
+ normal = self.eNorm(epos)
+ p.x = p.x + self.ofs*normal.x
+ p.y = p.y + self.ofs*normal.y
+ return p
+
+ def eNorm(self, epos):
+ normal = cam.Point( self.b*epos.s, self.a*epos.t, 0)
+ normal.normalize()
+ return normal
+
+ def eTang(self, epos):
+ p = cam.Point(-self.a*epos.t, self.b*epos.s, 0)
+ p.normalize()
+ return p
+
+ def error(self,epos,cl):
+ p1 = self.oePoint(epos)
+ p2 = cl
+ dx = p1.x - cl.x
+ dy = p1.y - cl.y
+ #return dx*dx+dy*dy
+ return dy
+
+
+
+class EPos():
+ """
+ // (s, t) where: s^2 + t^2 = 1
+ // point of ellipse is: ecen + j s + n t
+ // tangent at point is: -j t + n s
+ // normal at point is: j (s / eccen) + n (t * eccen)
+ // point on offset-ellipse: point on ellipse + offrad*normal
+ """
+ def __init__(self):
+ self.t = 1
+ self.s = 0
+ self.sett(self.t,1)
+
+ def sets(self, s, side):
+ if s > 1.0:
+ s = 1.0
+ if s < -1.0:
+ s = -1.0
+
+ self.s = s
+ ssq = s*s
+ tsq = 1 - ssq
+ if side == 1:
+ self.t = 1 * math.sqrt(tsq)
+ else:
+ self.t = -1 * math.sqrt(tsq)
+
+ def sett(self, t, side):
+ if t > 1.0:
+ t = 1.0
+ if t < -1.0:
+ t = -1.0
+
+ self.t = t
+ tsq = t*t
+ ssq = 1 - tsq
+ if side == 1:
+ self.s = 1 * math.sqrt(ssq)
+ else:
+ self.s = -1* math.sqrt(ssq)
+
+ def stepTang(self, ellipse, delta):
+ tang = oe.eTang(self)
+ #print " epos= (", self.s," , ", self.t , " )"
+ #print "steptang tang=", tang.str()
+ if abs(tang.x) > abs(tang.y):
+ #print "s-dir step"
+ news = self.s + delta*tang.x
+ if self.t > 0:
+ self.sets(news,1)
+ else:
+ self.sets(news,0)
+ else:
+ #print "t-dir step"
+ newt = self.t + delta*tang.y
+ if self.s>0:
+ self.sett( newt,1)
+ else:
+ self.sett( newt,0)
+
+
+if __name__ == "__main__":
+ myscreen = camvtk.VTKScreen()
+
+ myscreen.camera.SetPosition(5, 3, 2)
+ myscreen.camera.SetFocalPoint(1.38,1, 0)
+
+ a=cam.Point(3,2,-2)
+ b=cam.Point(-1,2,3)
+
+ myscreen.addActor(camvtk.Point(center=(a.x,a.y,a.z), color=(1,0,1)));
+ myscreen.addActor(camvtk.Point(center=(b.x,b.y,b.z), color=(1,0,1)));
+ #c=cam.Point(0,0,0.3)
+ myscreen.addActor( camvtk.Line(p1=(a.x,a.y,a.z),p2=(b.x,b.y,b.z)) )
+ #t = cam.Triangle(a,b,c)
+
+ cutter_length = 2
+ cutter = cam.BullCutter(1,0.2, cutter_length)
+
+
+ print(cutter)
+
+ xar = camvtk.Arrow(color=red, rotXYZ=(0,0,0))
+ myscreen.addActor(xar)
+ yar = camvtk.Arrow(color=green, rotXYZ=(0,0,90))
+ myscreen.addActor(yar)
+ zar = camvtk.Arrow(color=blue, rotXYZ=(0,-90,0))
+ myscreen.addActor(zar)
+
+ cl = cam.Point(2.193, 1, 0)
+ radius1=1
+ radius2=0.25
+
+ tor = camvtk.Toroid(r1=radius1, r2=radius2, center=(cl.x, cl.y, cl.z),rotXYZ=(0,0,0))
+ #tor.SetWireframe()
+ #myscreen.addActor(tor)
+
+ cyl = camvtk.Cylinder(center=(cl.x,cl.y,cl.z) , radius=radius1, height=2, color=(0,1,1),
+ rotXYZ=(90,0,0), resolution=50 )
+ #myscreen.addActor(cyl)
+
+ tube = camvtk.Tube(p1=(a.x,a.y,a.z),p2=(b.x,b.y,b.z),color=(1,1,0))
+ tube.SetOpacity(0.2)
+ #myscreen.addActor(tube)
+
+ cir= camvtk.Circle(radius=radius1, center=(cl.x,cl.y,cl.z), color=yellow)
+ myscreen.addActor(cir)
+
+ clp = camvtk.Point(center=(cl.x,cl.y,cl.z))
+ myscreen.addActor(clp)
+
+ # short axis of ellipse = radius2
+ # long axis of ellipse = radius2/sin(theta)
+ # where theta is the slope of the line
+ dx = b.x - a.x
+ dz = b.z - a.z
+ #print "dx=", dx
+ #print "dz=", dz
+ theta = math.atan(dz/dx)
+ #print "theta=",theta
+ a = abs( radius2/math.sin(theta) )
+ #print "a=", a, " = ", a/radius2,"* radius2"
+ # ellipse
+ #a=2
+ b=radius2
+ #print "b= ", b
+
+
+ ecen_tmp=cam.Point(1.38,2,0)
+ resolution=50
+ for n in range(0,resolution):
+ angle1= (float(n)/float(resolution))*2*math.pi
+ angle2= (float(n+1)/float(resolution))*2*math.pi
+ x=ecen_tmp.x + a*math.cos(angle1)
+ y=ecen_tmp.y + b*math.sin(angle1)
+ x2=ecen_tmp.x + a*math.cos(angle2)
+ y2=ecen_tmp.y + b*math.sin(angle2)
+
+ #myscreen.addActor(camvtk.Point(center=(x,y,0), color=(1,0,1)))
+ #myscreen.addActor( camvtk.Line(p1=(x,y,0),p2=(x2,y2,0)) )
+
+ oe = OffsetEllipse(ecen_tmp, a, b, radius1)
+
+
+
+ nmax=20
+ delta=0.05
+ td = 1
+ epos1 = EPos()
+ epos2 = EPos()
+ epos3 = EPos()
+ epos4 = EPos()
+ epos5 = EPos()
+ for n in range(0,nmax):
+ s = float(n)/float(nmax-1) * float(2)/math.sqrt(2) - float(1)/math.sqrt(2)
+ t = float(n)/float(nmax-1) * float(2)/math.sqrt(2) - float(1)/math.sqrt(2)
+
+ epos1.sets(s,1)
+ epos2.sets(s,0)
+ epos3.sett(t,1)
+ epos4.sett(t,0)
+
+ p1 = oe.ePoint(epos1)
+ p2 = oe.ePoint(epos2)
+ p3 = oe.ePoint(epos3)
+ p4 = oe.ePoint(epos4)
+ p5 = oe.ePoint(epos5)
+
+ p1o = oe.oePoint(epos1)
+ p2o = oe.oePoint(epos2)
+ #print "s=", s, "t=", t," epoint=", p1.str()
+ myscreen.addActor(camvtk.Point(center=(p1.x,p1.y,0), color=green)) # green steps along s (side=1)
+ myscreen.addActor(camvtk.Point(center=(p2.x,p2.y,0), color=red)) # red steps along s (side=0)
+ myscreen.addActor(camvtk.Point(center=(p3.x,p3.y,0), color=orange)) # orange steps along t (side=1)
+ myscreen.addActor(camvtk.Point(center=(p4.x,p4.y,0), color=pink)) # pink steps along t (side=0)
+
+ #myscreen.addActor(camvtk.Sphere(center=(p5.x,p5.y,0), radius=0.02, color=red))
+ #myscreen.addActor(camvtk.Point(center=(p1o.x,p1o.y,0), color=green))
+ #myscreen.addActor(camvtk.Point(center=(p2o.x,p2o.y,0), color=red))
+
+ """
+ tx = float(n)/float(nmax-1) * 2 - 1
+ sx = oe.seval(tx, 1)
+ sx2 = oe.seval(tx, 0)
+ p3 = oe.ePoint(sx,tx)
+ p4 = oe.ePoint(sx2,tx)
+ #myscreen.addActor(camvtk.Point(center=(p3.x,p3.y,0), color=orange))
+ #myscreen.addActor(camvtk.Point(center=(p4.x,p4.y,0), color=pink))
+
+ sd = oe.seval(td,1)
+ p5 = oe.ePoint(td,sd)
+ myscreen.addActor(camvtk.Point(center=(p5.x,p5.y,0), color=orange))
+ """
+ myscreen.render()
+ #time.sleep(0.05)
+
+ t = camvtk.Text()
+ t.SetPos( (myscreen.width-450, myscreen.height-30) )
+
+ myscreen.addActor( t)
+ t2 = camvtk.Text()
+ t2.SetPos( (50, myscreen.height-150) )
+
+ myscreen.addActor( t2)
+
+ epos5.sets(0.5,1)
+ Nsteps=10
+ endcondition = 0
+ n = 1
+ NRStep=0.1
+
+ #w2if = vtk.vtkWindowToImageFilter()
+ #w2if.SetInput(myscreen.renWin)
+ #lwr = vtk.vtkPNGWriter()
+ #lwr.SetInput( w2if.GetOutput() )
+
+
+ while not endcondition:
+ #for n in range(0,Nsteps):
+ t.SetText("OpenCAMLib 10.03-beta, " + datetime.datetime.now().strftime("%Y-%m-%d %H:%M:%S"))
+ current_error = oe.error(epos5, cl)
+
+ print("current error=", current_error)
+ epos_tmp = EPos()
+ epos_tmp.s = epos5.s
+ epos_tmp.t = epos5.t
+ # take a small step, to determine rerivative:
+ dt = 0.2*NRStep
+ epos_tmp.stepTang(oe,dt)
+ new_error = oe.error(epos_tmp, cl)
+ print("new_error=", new_error)
+ deriv = (new_error-current_error)/dt
+ print("derivative = ", deriv)
+ paramtext = "(s, t) = (%3.3f, %3.3f)\n NR iteration # = %i \n error= %3.9f\n de=%3.3f" % (epos5.s, epos5.t, n, current_error,deriv)
+ t2.SetText(paramtext)
+ # take Newton rhapson step
+ NRStep = (-current_error/deriv)
+ print(" step=", NRStep)
+ #NRStep=0.05 # debug/demo
+ epos5.stepTang(oe, NRStep)
+
+ p5 = oe.ePoint(epos5)
+ esphere = camvtk.Sphere(center=(p5.x,p5.y,0), radius=0.02, color=red)
+ myscreen.addActor(esphere)
+
+ p6 = oe.eTang(epos5)
+ p7 = oe.oePoint(epos5)
+ oesphere = camvtk.Sphere(center=(p7.x,p7.y,p7.z), radius=0.02, color=green)
+ tangline = camvtk.Line(p1=(p5.x,p5.y,p5.z),p2=(p5.x+p6.x,p5.y+p6.y,p5.z+p6.z))
+ normline = camvtk.Line(p1=(p5.x,p5.y,p5.z),p2=(p7.x,p7.y,p7.z), color=yellow)
+
+ myscreen.addActor( tangline )
+ myscreen.addActor( normline )
+ myscreen.addActor( oesphere )
+
+
+ myscreen.render()
+ time.sleep(0.5)
+
+ if abs(current_error) < 1e-8:
+ endcondition=1
+ if n>125:
+ endcondition=1
+
+ if not endcondition:
+ myscreen.removeActor(esphere)
+ myscreen.removeActor(tangline)
+ myscreen.removeActor(normline)
+ myscreen.removeActor(oesphere)
+
+
+ #w2if.Modified()
+ #lwr.SetFileName("5_all.png")
+ """
+ for i in range(0,10):
+ lwr.SetFileName("frames/oe_nrx"+ ('%05d%02d' % (n,i))+".png")
+ lwr.Write()
+ """
+ n=n+1
+
+ print("rendering...",)
+ #for cl,cc in zip(clpoints,ccpoints):
+ # myscreen.addActor( camvtk.Point(center=(cl.x,cl.y,cl.z) , color=ccColor(cc) ) )
+ # if cc.type != cam.CCType.NONE: # only render interesting cc-points
+ # myscreen.addActor( camvtk.Point(center=(cc.x,cc.y,cc.z) , color=ccColor2(cc) ) )
+
+
+ print("done.")
+
+
+
+
+ myscreen.render()
+
+ #w2if = vtk.vtkWindowToImageFilter()
+ #w2if.SetInput(myscreen.renWin)
+ #lwr = vtk.vtkPNGWriter()
+ #lwr.SetInput( w2if.GetOutput() )
+ #w2if.Modified()
+ #lwr.SetFileName("5_all.png")
+ #lwr.Write()
+
+
+
+ myscreen.iren.Start()
+ #raw_input("Press Enter to terminate")
+
diff -Nru opencamlib-11.10+git201801200005~ubuntu16.04.1/examples/python/offset-ellipse/oellipse3_tst.py opencamlib-11.10-1/examples/python/offset-ellipse/oellipse3_tst.py
--- opencamlib-11.10+git201801200005~ubuntu16.04.1/examples/python/offset-ellipse/oellipse3_tst.py 1970-01-01 00:00:00.000000000 +0000
+++ opencamlib-11.10-1/examples/python/offset-ellipse/oellipse3_tst.py 2020-06-14 12:13:19.000000000 +0000
@@ -0,0 +1,455 @@
+import ocl as cam
+import camvtk
+import time
+import vtk
+import math
+import datetime
+
+red= (1,0,0)
+green= (0,1,0)
+blue= (0,0,1)
+cyan= (0,1,1)
+yellow= (1,1,0)
+pink = ( float(255)/255,float(192)/255,float(203)/255)
+grey = ( float(127)/255,float(127)/255,float(127)/255)
+orange = ( float(255)/255,float(165)/255,float(0)/255)
+
+def ccColor2(cc):
+ """ this function returns a different color depending on the type of
+ the CC-point. Useful for visualizing CL or CC points """
+ if cc.type==cam.CCType.FACET:
+ col = (1,0,1)
+ elif cc.type == cam.CCType.VERTEX:
+ col = (1,1,0)
+ elif cc.type == cam.CCType.EDGE:
+ col = (0,1,1)
+ elif cc.type == cam.CCType.NONE:
+ col = (1,1,1)
+ elif cc.type == cam.CCType.ERROR:
+ col = (0,0.5,1)
+ return col
+
+class OffsetEllipse():
+ """
+ // (s, t) where: s^2 + t^2 = 1
+ // point of ellipse is: ecen + j s + n t
+ // tangent at point is: -j t + n s
+ // normal at point is: j (s / eccen) + n (t * eccen)
+ // point on offset-ellipse: point on ellipse + offrad*normal
+ """
+ def __init__(self, ecen, a, b, ofs):
+ self.a = a
+ self.b = b
+ self.ecen = ecen
+ self.ofs = ofs
+
+ def ePoint(self,epos):
+ # return a point on the ellipse
+ p = cam.Point()
+ p.x = self.ecen.x + self.a*epos.s
+ p.y = self.ecen.y + self.b*epos.t
+ return p
+
+ def oePoint(self,epos):
+ # return point on offset-ellipse
+ p = self.ePoint(epos)
+ normal = self.eNorm(epos)
+ p.x = p.x + self.ofs*normal.x
+ p.y = p.y + self.ofs*normal.y
+ return p
+
+ def eNorm(self, epos):
+ normal = cam.Point( self.b*epos.s, self.a*epos.t, 0)
+ normal.normalize()
+ return normal
+
+ def eTang(self, epos):
+ p = cam.Point(-self.a*epos.t, self.b*epos.s, 0)
+ p.normalize()
+ return p
+
+ def error(self,epos,cl):
+ p1 = self.oePoint(epos)
+ p2 = cl
+ dx = p1.x - cl.x
+ dy = p1.y - cl.y
+ #return dx*dx+dy*dy
+ return dy
+
+
+
+class EPos():
+ """
+ // (s, t) where: s^2 + t^2 = 1
+ // point of ellipse is: ecen + j s + n t
+ // tangent at point is: -j t + n s
+ // normal at point is: j (s / eccen) + n (t * eccen)
+ // point on offset-ellipse: point on ellipse + offrad*normal
+ """
+ def __init__(self):
+ self.t = 1
+ self.s = 0
+ self.sett(self.t,1)
+
+ def sets(self, s, side):
+ if s > 1.0:
+ s = 1.0
+ if s < -1.0:
+ s = -1.0
+
+ self.s = s
+ ssq = s*s
+ tsq = 1 - ssq
+ if side == 1:
+ self.t = 1 * math.sqrt(tsq)
+ else:
+ self.t = -1 * math.sqrt(tsq)
+
+ def sett(self, t, side):
+ if t > 1.0:
+ t = 1.0
+ if t < -1.0:
+ t = -1.0
+
+ self.t = t
+ tsq = t*t
+ ssq = 1 - tsq
+ if side == 1:
+ self.s = 1 * math.sqrt(ssq)
+ else:
+ self.s = -1* math.sqrt(ssq)
+
+ def stepTang(self, ellipse, delta):
+ tang = oe.eTang(self)
+ #print " epos= (", self.s," , ", self.t , " )"
+ #print "steptang tang=", tang.str()
+ if abs(tang.x) > abs(tang.y):
+ #print "s-dir step"
+ news = self.s + delta*tang.x
+ if self.t > 0:
+ self.sets(news,1)
+ else:
+ self.sets(news,0)
+ else:
+ #print "t-dir step"
+ newt = self.t + delta*tang.y
+ if self.s>0:
+ self.sett( newt,1)
+ else:
+ self.sett( newt,0)
+
+def solver(oe, epos, cl):
+ endcondition = 0
+ NRStep = 0.1
+ n=0
+ while not endcondition:
+ current_error = oe.error(epos, cl)
+ #print "current error=", current_error
+ epos_tmp = EPos()
+ epos_tmp.s = epos.s
+ epos_tmp.t = epos.t
+ # take a small step, to determine rerivative:
+ dt = 0.2*NRStep
+ epos_tmp.stepTang(oe,dt)
+ new_error = oe.error(epos_tmp, cl)
+ #print "new_error=", new_error
+ deriv = (new_error-current_error)/dt
+ #print "derivative = ", deriv
+ # take Newton rhapson step
+ NRStep = (-current_error/deriv)
+ #print " NRstep=", NRStep
+ #NRStep=0.05 # debug/demo
+ epos5.stepTang(oe, NRStep)
+
+ # check endcondition
+ if abs(current_error) < 1e-8:
+ endcondition=1
+ if n>125:
+ endcondition=1
+ n=n+1
+ return n
+
+if __name__ == "__main__":
+ myscreen = camvtk.VTKScreen()
+
+ myscreen.camera.SetPosition(5, 3, 2)
+ myscreen.camera.SetFocalPoint(1.38,1, 0)
+
+ a=cam.Point(3,2,-2)
+ b=cam.Point(-1,2,3)
+
+ myscreen.addActor(camvtk.Point(center=(a.x,a.y,a.z), color=(1,0,1)));
+ myscreen.addActor(camvtk.Point(center=(b.x,b.y,b.z), color=(1,0,1)));
+ #c=cam.Point(0,0,0.3)
+ myscreen.addActor( camvtk.Line(p1=(a.x,a.y,a.z),p2=(b.x,b.y,b.z)) )
+ #t = cam.Triangle(a,b,c)
+
+ cutter_length = 2
+ cutter = cam.BullCutter(1,0.2, cutter_length)
+
+
+ print(cutter)
+
+ xar = camvtk.Arrow(color=red, rotXYZ=(0,0,0))
+ #xar.SetFlat()
+ myscreen.addActor(xar)
+ yar = camvtk.Arrow(color=green, rotXYZ=(0,0,90))
+ #yar.SetGouraud()
+ myscreen.addActor(yar)
+ zar = camvtk.Arrow(color=blue, rotXYZ=(0,-90,0))
+ #zar.SetPhong()
+ myscreen.addActor(zar)
+
+ cl = cam.Point(2.193, 1, 0)
+ radius1=1
+ radius2=0.25
+
+ tor = camvtk.Toroid(r1=radius1, r2=radius2, center=(cl.x, cl.y, cl.z),rotXYZ=(0,0,0))
+ #tor.SetWireframe()
+ #myscreen.addActor(tor)
+
+ cyl = camvtk.Cylinder(center=(cl.x,cl.y,cl.z) , radius=radius1, height=2, color=(0,1,1),
+ rotXYZ=(90,0,0), resolution=50 )
+ #myscreen.addActor(cyl)
+
+ tube = camvtk.Tube(p1=(a.x,a.y,a.z),p2=(b.x,b.y,b.z),color=(1,1,0))
+ tube.SetOpacity(0.2)
+ #myscreen.addActor(tube)
+
+ cir= camvtk.Circle(radius=radius1, center=(cl.x,cl.y,cl.z), color=yellow)
+ myscreen.addActor(cir)
+
+ clp = camvtk.Point(center=(cl.x,cl.y,cl.z))
+ myscreen.addActor(clp)
+
+ # short axis of ellipse = radius2
+ # long axis of ellipse = radius2/sin(theta)
+ # where theta is the slope of the line
+ dx = b.x - a.x
+ dz = b.z - a.z
+ #print "dx=", dx
+ #print "dz=", dz
+ theta = math.atan(dz/dx)
+ #print "theta=",theta
+ a = abs( radius2/math.sin(theta) )
+ #print "a=", a, " = ", a/radius2,"* radius2"
+ # ellipse
+ #a=2
+ b=radius2
+ #print "b= ", b
+
+
+ ecen_tmp=cam.Point(1.38,2,0)
+ resolution=50
+ """
+ for n in range(0,resolution):
+ angle1= (float(n)/float(resolution))*2*math.pi
+ angle2= (float(n+1)/float(resolution))*2*math.pi
+ x=ecen_tmp.x + a*math.cos(angle1)
+ y=ecen_tmp.y + b*math.sin(angle1)
+ x2=ecen_tmp.x + a*math.cos(angle2)
+ y2=ecen_tmp.y + b*math.sin(angle2)
+
+ #myscreen.addActor(camvtk.Point(center=(x,y,0), color=(1,0,1)))
+ #myscreen.addActor( camvtk.Line(p1=(x,y,0),p2=(x2,y2,0)) )
+ """
+
+ oe = OffsetEllipse(ecen_tmp, a, b, radius1)
+ oe2 = OffsetEllipse(ecen_tmp, a, b, 0.05)
+
+
+ nmax=20
+ delta=0.05
+ td = 1
+ epos1 = EPos()
+ epos2 = EPos()
+ epos3 = EPos()
+ epos4 = EPos()
+ epos5 = EPos()
+ """
+ for n in range(0,nmax):
+ s = float(n)/float(nmax-1) * float(2)/math.sqrt(2) - float(1)/math.sqrt(2)
+ t = float(n)/float(nmax-1) * float(2)/math.sqrt(2) - float(1)/math.sqrt(2)
+
+ epos1.sets(s,1)
+ epos2.sets(s,0)
+ epos3.sett(t,1)
+ epos4.sett(t,0)
+
+ p1 = oe.ePoint(epos1)
+ p2 = oe.ePoint(epos2)
+ p3 = oe.ePoint(epos3)
+ p4 = oe.ePoint(epos4)
+ p5 = oe.ePoint(epos5)
+
+ p1o = oe.oePoint(epos1)
+ p2o = oe.oePoint(epos2)
+ #print "s=", s, "t=", t," epoint=", p1.str()
+ myscreen.addActor(camvtk.Point(center=(p1.x,p1.y,0), color=green)) # green steps along s (side=1)
+ myscreen.addActor(camvtk.Point(center=(p2.x,p2.y,0), color=red)) # red steps along s (side=0)
+ myscreen.addActor(camvtk.Point(center=(p3.x,p3.y,0), color=orange)) # orange steps along t (side=1)
+ myscreen.addActor(camvtk.Point(center=(p4.x,p4.y,0), color=pink)) # pink steps along t (side=0)
+
+ #myscreen.addActor(camvtk.Sphere(center=(p5.x,p5.y,0), radius=0.02, color=red))
+ #myscreen.addActor(camvtk.Point(center=(p1o.x,p1o.y,0), color=green))
+ #myscreen.addActor(camvtk.Point(center=(p2o.x,p2o.y,0), color=red))
+
+
+ tx = float(n)/float(nmax-1) * 2 - 1
+ sx = oe.seval(tx, 1)
+ sx2 = oe.seval(tx, 0)
+ p3 = oe.ePoint(sx,tx)
+ p4 = oe.ePoint(sx2,tx)
+ #myscreen.addActor(camvtk.Point(center=(p3.x,p3.y,0), color=orange))
+ #myscreen.addActor(camvtk.Point(center=(p4.x,p4.y,0), color=pink))
+
+ sd = oe.seval(td,1)
+ p5 = oe.ePoint(td,sd)
+ myscreen.addActor(camvtk.Point(center=(p5.x,p5.y,0), color=orange))
+
+ myscreen.render()
+ #time.sleep(0.05)
+ """
+
+ t = camvtk.Text()
+ t.SetPos( (myscreen.width-450, myscreen.height-30) )
+
+ myscreen.addActor( t)
+ t2 = camvtk.Text()
+ t2.SetPos( (50, myscreen.height-150) )
+
+ myscreen.addActor( t2)
+
+ #epos5.sets(0.5,1)
+ Nsteps=62
+ endcondition = 0
+ n = 1
+ NRStep=0.1
+
+ #w2if = vtk.vtkWindowToImageFilter()
+ #w2if.SetInput(myscreen.renWin)
+ #lwr = vtk.vtkPNGWriter()
+ #lwr.SetInput( w2if.GetOutput() )
+
+
+ epos5.sets(0,1)
+ epos1.sets(0,1)
+ #while not endcondition:
+ convlist=[]
+ for n in range(0,Nsteps):
+ t.SetText("OpenCAMLib 10.03-beta, " + datetime.datetime.now().strftime("%Y-%m-%d %H:%M:%S"))
+ #current_error = oe.error(epos5, cl)
+ epos5.s=epos1.s
+ epos5.t=epos1.t
+ #print "current error=", current_error
+ #epos_tmp = EPos()
+ #epos_tmp.s = epos5.s
+ #epos_tmp.t = epos5.t
+ # take a small step, to determine rerivative:
+ #dt = 0.2*NRStep
+ #epos_tmp.stepTang(oe,dt)
+ #new_error = oe.error(epos_tmp, cl)
+ #print "new_error=", new_error
+ #deriv = (new_error-current_error)/dt
+ #print "derivative = ", deriv
+ #paramtext = "(s, t) = (%3.3f, %3.3f)\n NR iteration # = %i \n error= %3.9f\n de=%3.3f" % (epos5.s, epos5.t, n, current_error,deriv)
+ #t2.SetText(paramtext)
+ # take Newton rhapson step
+ #NRStep = (-current_error/deriv)
+ #print " step=", NRStep
+ #NRStep=0.05 # debug/demo
+ #epos5.stepTang(oe, NRStep)
+
+
+
+
+ #p6 = oe.eTang(epos5)
+ #p7 = oe.oePoint(epos5)
+ #oesphere = camvtk.Sphere(center=(p7.x,p7.y,p7.z), radius=0.02, color=green)
+ #tangline = camvtk.Line(p1=(p5.x,p5.y,p5.z),p2=(p5.x+p6.x,p5.y+p6.y,p5.z+p6.z))
+ #normline = camvtk.Line(p1=(p5.x,p5.y,p5.z),p2=(p7.x,p7.y,p7.z), color=yellow)
+
+ #myscreen.addActor( tangline )
+ #myscreen.addActor( normline )
+ #myscreen.addActor( oesphere )
+ p5 = oe.ePoint(epos5)
+ pt = oe2.oePoint(epos5)
+ #print "before= ", epos5.s, " , ", epos5.t
+ nsteps = solver(oe, epos5, cl)
+ print(nsteps )
+ convlist.append(nsteps)
+
+ convtext = "%i" % (nsteps)
+ print((pt.x, pt.y, pt.z))
+ #center=(pt.x, pt.y, pt.z)
+ tst = camvtk.Text3D( color=(1,1,1), center=(pt.x, pt.y, 0) ,
+ text=convtext, scale=0.02)
+ #tst.SetCamera(myscreen.camera)
+ myscreen.addActor(tst)
+
+ colmax=11
+ colmin=4
+ nsteps = nsteps - colmin
+ colmax = colmax - colmin
+ convcolor=( float(nsteps*nsteps)/(colmax), float((colmax-nsteps))/colmax, 0 )
+ esphere = camvtk.Sphere(center=(p5.x,p5.y,0), radius=0.02, color=convcolor)
+ myscreen.addActor(esphere)
+
+
+
+
+ #print "after= ", epos5.s, " , ", epos5.t
+ epos1.stepTang(oe, 0.1)
+ #print "after= ", epos5.s, " , ", epos5.t
+
+ myscreen.render()
+ #time.sleep(0.1)
+ #raw_input("Press Enter to terminate")
+ #if abs(current_error) < 1e-8:
+ # endcondition=1
+ #if n>125:
+ # endcondition=1
+
+ #if not endcondition:
+ # myscreen.removeActor(esphere)
+ # myscreen.removeActor(tangline)
+ # myscreen.removeActor(normline)
+ # myscreen.removeActor(oesphere)
+
+
+ #w2if.Modified()
+ #lwr.SetFileName("5_all.png")
+ """
+ for i in range(0,10):
+ lwr.SetFileName("frames/oe_nrx"+ ('%05d%02d' % (n,i))+".png")
+ lwr.Write()
+ """
+ n=n+1
+ print(convlist)
+ #print "rendering...",
+ #for cl,cc in zip(clpoints,ccpoints):
+ # myscreen.addActor( camvtk.Point(center=(cl.x,cl.y,cl.z) , color=ccColor(cc) ) )
+ # if cc.type != cam.CCType.NONE: # only render interesting cc-points
+ # myscreen.addActor( camvtk.Point(center=(cc.x,cc.y,cc.z) , color=ccColor2(cc) ) )
+
+
+ print("done.")
+
+
+
+
+ myscreen.render()
+
+ #w2if = vtk.vtkWindowToImageFilter()
+ #w2if.SetInput(myscreen.renWin)
+ #lwr = vtk.vtkPNGWriter()
+ #lwr.SetInput( w2if.GetOutput() )
+ #w2if.Modified()
+ #lwr.SetFileName("5_all.png")
+ #lwr.Write()
+
+
+
+ myscreen.iren.Start()
+ #raw_input("Press Enter to terminate")
+
diff -Nru opencamlib-11.10+git201801200005~ubuntu16.04.1/examples/python/offset-ellipse/oellipse4_tst.py opencamlib-11.10-1/examples/python/offset-ellipse/oellipse4_tst.py
--- opencamlib-11.10+git201801200005~ubuntu16.04.1/examples/python/offset-ellipse/oellipse4_tst.py 1970-01-01 00:00:00.000000000 +0000
+++ opencamlib-11.10-1/examples/python/offset-ellipse/oellipse4_tst.py 2020-06-14 12:13:19.000000000 +0000
@@ -0,0 +1,237 @@
+import ocl as cam
+import camvtk
+import time
+import vtk
+import math
+import datetime
+
+# 2018.08: Epos not wrapped
+
+def drawellipse(myscreen, ellcenter, a_axis, b_axis):
+ resolution=50
+ for n in range(0,resolution):
+ angle1= (float(n)/float(resolution))*2*math.pi
+ angle2= (float(n+1)/float(resolution))*2*math.pi
+ x=ellcenter.x + a_axis*math.cos(angle1)
+ y=ellcenter.y + b_axis*math.sin(angle1)
+ z=ellcenter.z
+ x2=ellcenter.x + a_axis*math.cos(angle2)
+ y2=ellcenter.y + b_axis*math.sin(angle2)
+ myscreen.addActor( camvtk.Line(p1=(x,y,z),p2=(x2,y2,z), color=camvtk.grey) )
+
+def main(ycoord=0.970, filename="test"):
+ myscreen = camvtk.VTKScreen()
+
+ myscreen.camera.SetPosition(2, 5, 5)
+ myscreen.camera.SetFocalPoint(1.38,1, 0)
+
+ #ycoord = 1.1
+
+ a=cam.Point(3,ycoord,-2)
+ b=cam.Point(-1,ycoord,3)
+
+ myscreen.addActor(camvtk.Point(center=(a.x,a.y,a.z), color=(1,0,1)));
+ myscreen.addActor(camvtk.Point(center=(b.x,b.y,b.z), color=(1,0,1)));
+ #c=cam.Point(0,0,0.3)
+ myscreen.addActor( camvtk.Line(p1=(a.x,a.y,a.z),p2=(b.x,b.y,b.z)) )
+ #t = cam.Triangle(a,b,c)
+
+ cutter = cam.BullCutter(1,0.2,20)
+
+ print(cutter )
+ xar = camvtk.Arrow(color=camvtk.red, rotXYZ=(0,0,0))
+ myscreen.addActor(xar)
+ yar = camvtk.Arrow(color=camvtk.green, rotXYZ=(0,0,90))
+ myscreen.addActor(yar)
+ zar = camvtk.Arrow(color=camvtk.blue, rotXYZ=(0,-90,0))
+ myscreen.addActor(zar)
+
+ cl = cam.Point(2.1748, 1, 0)
+ radius1=1
+ radius2=0.25
+
+ tor = camvtk.Toroid(r1=radius1, r2=radius2, center=(cl.x, cl.y, cl.z),rotXYZ=(0,0,0))
+ #tor.SetWireframe()
+ #myscreen.addActor(tor)
+
+ cyl = camvtk.Cylinder(center=(cl.x,cl.y,cl.z) , radius=radius1, height=2, color=(0,1,1),
+ rotXYZ=(90,0,0), resolution=50 )
+ #myscreen.addActor(cyl)
+
+ cl_line = camvtk.Line( p1=(cl.x,cl.y,-100),p2=(cl.x,cl.y,+100), color=camvtk.red )
+ myscreen.addActor(cl_line)
+
+ tube = camvtk.Tube(p1=(a.x,a.y,a.z),p2=(b.x,b.y,b.z),color=(1,1,0))
+ tube.SetOpacity(0.2)
+ myscreen.addActor(tube)
+
+ # cylindrical-cutter circle at z=0 plane
+ #cir= camvtk.Circle(radius=radius1, center=(cl.x,cl.y,cl.z), color=camvtk.yellow)
+ #myscreen.addActor(cir)
+
+ #clp = camvtk.Point(center=(cl.x,cl.y,cl.z))
+ #myscreen.addActor(clp)
+
+ # short axis of ellipse = radius2
+ # long axis of ellipse = radius2/sin(theta)
+ # where theta is the slope of the line
+ dx = b.x - a.x
+ dz = b.z - a.z
+ #print "dx=", dx
+ #print "dz=", dz
+ theta = math.atan(dz/dx) ## dx==0 is special case!! (i.e. vertical lines)
+ print("theta=",theta)
+ a_axis = abs( radius2/math.sin(theta) )
+ print("a=", a_axis)
+ # ellipse
+ #a=2
+ b_axis=radius2
+ print("b= ", b_axis)
+
+
+ # slice the tube with a plane at z=0 and find the ellipse center
+ # line is from Point a to b:
+ # a + t*(b-a)
+ # find t so that z-component is zero:
+ # a.z + t( b.z -a.z) = 0
+ # t= a.z / (b.z - a.z)
+ # so point
+ tparam = -a.z / (b.z - a.z) # NOTE horizontal lines are a special case!!
+ ellcenter = a + tparam*(b-a)
+ print("ellcenter (z=0?) =", ellcenter)
+ # center of the
+ # ecen_tmp=cam.Point(ellcenter,a.y,0)
+
+ #drawellipse(myscreen, ellcenter, a_axis, b_axis)
+
+
+
+ oe = cam.Ellipse(ellcenter, a_axis, b_axis, radius1)
+
+ #oe2 = cam.Ellipse(ellcenter, a_axis, b_axis, 0.05) # to locate text on the outside of the ellipse
+
+
+ nmax=20
+ #delta=0.05
+ #td = 1
+
+
+
+ t = camvtk.Text()
+ t.SetPos( (myscreen.width-450, myscreen.height-30) )
+
+
+ myscreen.addActor( t)
+ t2 = camvtk.Text()
+ ytext = "Y: %3.3f" % (ycoord)
+ t2.SetText(ytext)
+ t2.SetPos( (50, myscreen.height-150) )
+ myscreen.addActor( t2)
+
+
+
+ #w2if = vtk.vtkWindowToImageFilter()
+ #w2if.SetInput(myscreen.renWin)
+ #lwr = vtk.vtkPNGWriter()
+ #lwr.SetInput( w2if.GetOutput() )
+
+ epos = cam.Epos()
+ epos.setS(0,1)
+ #epos1.setS(0,1)
+
+ t.SetText("OpenCAMLib 10.03-beta, " + datetime.datetime.now().strftime("%Y-%m-%d %H:%M:%S"))
+
+
+ #p5 = oe.ePoint(epos5)
+ #pt = oe2.oePoint(epos5)
+ #print "before= ", epos5.s, " , ", epos5.t
+ nsteps = cam.Ellipse.solver(oe, cl)
+ epos = oe.epos1
+ cce = oe.ePoint(epos)
+ cle = oe.oePoint(epos)
+ #epos2 = cam.Epos()
+ #epos.s = epos.s
+ #epos.t = epos.t
+ #print nsteps
+ print("solution1 at: ", epos.s , " , ", epos.t )
+ #print "solution2 at: ", epos2.s , " , ", epos2.t
+ print(" cl =", cl)
+ print(" cle=", cle)
+
+ xoffset = cl.x - cle.x
+ print("xoffset= ", xoffset)
+ # we slide xoffset along the x-axis from ellcenter
+ # to find the correct z-plane
+ # line is: a + t*(b-a)
+ # find t so that x-component is ellcenter.x + xoffset
+ # a.x + t(b.x-a.x) = ellcenter.x + xoffset
+ # t= (ellcenter.x + xoffset - a.x) / (b.x - a.x)
+ tparam2 = (ellcenter.x + xoffset - a.x) / (b.x - a.x)
+ slide = tparam2*(b-a)
+ print("sliding z-delta: ", slide.z)
+ elc2 = a + tparam2*(b-a)
+ print("ellcenter2=", elc2)
+ #convlist.append(nsteps)
+ fe = cam.Ellipse(elc2, a_axis, b_axis, radius1)
+ fecen = camvtk.Sphere(center=(elc2.x,elc2.y,elc2.z), radius=0.01, color=camvtk.pink)
+ myscreen.addActor(fecen)
+ fccp = fe.ePoint(epos)
+ fclp = fe.oePoint(epos)
+ print("solver cl=", fclp, " == ", cl, " ??")
+
+ fcir= camvtk.Circle(radius=radius1, center=(cl.x,cl.y,elc2.z), color=camvtk.yellow)
+ myscreen.addActor(fcir)
+
+ fccpoint = camvtk.Sphere(center=(fccp.x,fccp.y,fccp.z), radius=0.01, color=camvtk.green)
+ myscreen.addActor(fccpoint)
+
+ fclpoint = camvtk.Sphere(center=(fclp.x,fclp.y,fclp.z), radius=0.01, color=camvtk.blue)
+ myscreen.addActor(fclpoint)
+
+ # line from ellipse center to fcc
+ myscreen.addActor(camvtk.Line( p1=(elc2.x,elc2.y,elc2.z),p2=(fccp.x,fccp.y,fccp.z), color=camvtk.cyan ))
+ # the offset normal
+ myscreen.addActor(camvtk.Line( p1=(fclp.x,fclp.y,fclp.z),p2=(fccp.x,fccp.y,fccp.z), color=camvtk.yellow ))
+
+ drawellipse(myscreen, elc2, a_axis, b_axis)
+ #convtext = "%i" % (nsteps)
+ #print (pt.x, pt.y, pt.z)
+ #center=(pt.x, pt.y, pt.z)
+ #tst = camvtk.Text3D( color=(1,1,1), center=(pt.x, pt.y, 0) ,
+ #text=convtext, scale=0.02)
+ #tst.SetCamera(myscreen.camera)
+ #myscreen.addActor(tst)
+
+ colmax=11
+ colmin=4
+ nsteps = nsteps - colmin
+ colmax = colmax - colmin
+ convcolor=( float(nsteps*nsteps)/(colmax), float((colmax-nsteps))/colmax, 0 )
+ #esphere = camvtk.Sphere(center=(p5.x,p5.y,0), radius=0.01, color=convcolor)
+ end_sphere = camvtk.Sphere(center=(cce.x,cce.y,0), radius=0.01, color=camvtk.green)
+ cl_sphere = camvtk.Sphere(center=(cle.x,cle.y,0), radius=0.01, color=camvtk.pink)
+ cl_sphere.SetOpacity(0.4)
+
+ clcir= camvtk.Circle(radius=radius1, center=(cle.x,cle.y,cle.z), color=camvtk.pink)
+ myscreen.addActor(clcir)
+
+ #myscreen.addActor(esphere)
+ myscreen.addActor(end_sphere)
+ myscreen.addActor(cl_sphere)
+ #myscreen.render()
+
+ print("done.")
+ myscreen.render()
+ lwr.SetFileName(filename)
+ #lwr.Write()
+ #raw_input("Press Enter to terminate")
+ #time.sleep(0.5)
+ myscreen.iren.Start()
+
+
+if __name__ == "__main__":
+ main()
+ #myscreen.iren.Start()
+ #raw_input("Press Enter to terminate")
+
+
diff -Nru opencamlib-11.10+git201801200005~ubuntu16.04.1/examples/python/offset-ellipse/oellipse5_tst.py opencamlib-11.10-1/examples/python/offset-ellipse/oellipse5_tst.py
--- opencamlib-11.10+git201801200005~ubuntu16.04.1/examples/python/offset-ellipse/oellipse5_tst.py 1970-01-01 00:00:00.000000000 +0000
+++ opencamlib-11.10-1/examples/python/offset-ellipse/oellipse5_tst.py 2020-06-14 12:13:19.000000000 +0000
@@ -0,0 +1,293 @@
+import ocl as cam
+import camvtk
+import time
+import vtk
+import math
+import datetime
+
+# 2018.08: Epos not wrapped
+
+def drawellipse(myscreen, ellcenter, a_axis, b_axis):
+ resolution=50
+ for n in range(0,resolution):
+ angle1= (float(n)/float(resolution))*2*math.pi
+ angle2= (float(n+1)/float(resolution))*2*math.pi
+ x=ellcenter.x + a_axis*math.cos(angle1)
+ y=ellcenter.y + b_axis*math.sin(angle1)
+ z=ellcenter.z
+ x2=ellcenter.x + a_axis*math.cos(angle2)
+ y2=ellcenter.y + b_axis*math.sin(angle2)
+ myscreen.addActor( camvtk.Line(p1=(x,y,z),p2=(x2,y2,z), color=camvtk.grey) )
+
+def calcEcenter(oe,a,b,cl,sln):
+ pos = cam.Epos()
+ if sln == 1:
+ pos = oe.epos1
+ if sln == 2:
+ pos = oe.epos2
+
+ cce = oe.ePoint(pos)
+ cle = oe.oePoint(pos)
+ print("solution at: ", pos)
+ print(" cce=", cce)
+ print(" cle=", cle)
+
+ xoffset = cl.x - cle.x
+ print(" xoffset= ", xoffset)
+ # we slide xoffset along the x-axis from ellcenter
+ # to find the correct z-plane
+ # line is: a + t*(b-a)
+ # find t so that x-component is ellcenter.x + xoffset
+ # a.x + t(b.x-a.x) = ellcenter.x + xoffset
+ # t= (ellcenter.x + xoffset - a.x) / (b.x - a.x)
+ tparam = (oe.center.x + xoffset - a.x) / (b.x - a.x)
+ return a + tparam*(b-a)
+
+
+
+def main(ycoord=1.2, filename="test", theta=60, fi=45):
+ myscreen = camvtk.VTKScreen()
+ focal = cam.Point(2.17, 1, 0)
+ r = 14
+ theta = (float(theta)/360)*2*math.pi
+
+
+ campos = cam.Point( r*math.sin(theta)*math.cos(fi), r*math.sin(theta)*math.sin(fi), r*math.cos(theta) )
+ myscreen.camera.SetPosition(campos.x, campos.y, campos.z)
+ myscreen.camera.SetFocalPoint(focal.x,focal.y, focal.z)
+
+ #ycoord = 1.1
+
+ # the two points that define the edge
+ a=cam.Point( 3 , ycoord , 2.999999)
+ b=cam.Point( -1, ycoord , 3)
+
+ myscreen.addActor(camvtk.Point(center=(a.x,a.y,a.z), color=(1,0,1)));
+ myscreen.addActor(camvtk.Point(center=(b.x,b.y,b.z), color=(1,0,1)));
+ #c=cam.Point(0,0,0.3)
+ myscreen.addActor( camvtk.Line(p1=(a.x,a.y,a.z),p2=(b.x,b.y,b.z)) )
+ #t = cam.Triangle(a,b,c)
+
+ cutter_length = 2
+ cutter = cam.BullCutter(1,0.2, cutter_length)
+
+ print(cutter )
+ xar = camvtk.Arrow(color=camvtk.red, rotXYZ=(0,0,0))
+ myscreen.addActor(xar)
+ yar = camvtk.Arrow(color=camvtk.green, rotXYZ=(0,0,90))
+ myscreen.addActor(yar)
+ zar = camvtk.Arrow(color=camvtk.blue, rotXYZ=(0,-90,0))
+ myscreen.addActor(zar)
+
+ cl = cam.Point(2.1748, 1, 0)
+ radius1=1
+ radius2=0.25
+
+
+ #tor.SetWireframe()
+ #myscreen.addActor(tor)
+
+ cyl = camvtk.Cylinder(center=(cl.x,cl.y,cl.z) , radius=radius1, height=2, color=(0,1,1),
+ rotXYZ=(90,0,0), resolution=50 )
+ #myscreen.addActor(cyl)
+
+ cl_line = camvtk.Line( p1=(cl.x,cl.y,-100),p2=(cl.x,cl.y,+100), color=camvtk.red )
+ myscreen.addActor(cl_line)
+
+ cl_tube = camvtk.Tube(p1=(cl.x,cl.y,-100),p2=(cl.x,cl.y,+100),radius=radius1, color=camvtk.green)
+ cl_tube.SetOpacity(0.1)
+ myscreen.addActor(cl_tube)
+
+ a_inf = a + (-100*(b-a))
+ b_inf = a + (+100*(b-a))
+
+ tube = camvtk.Tube(p1=(a_inf.x,a_inf.y,a_inf.z),p2=(b_inf.x,b_inf.y,b_inf.z),radius=0.05*radius2, color=camvtk.red)
+ tube.SetOpacity(0.3)
+ myscreen.addActor(tube)
+
+ # cylindrical-cutter circle at z=0 plane
+ #cir= camvtk.Circle(radius=radius1, center=(cl.x,cl.y,cl.z), color=camvtk.yellow)
+ #myscreen.addActor(cir)
+
+ #clp = camvtk.Point(center=(cl.x,cl.y,cl.z))
+ #myscreen.addActor(clp)
+
+ # short axis of ellipse = radius2
+ # long axis of ellipse = radius2/sin(theta)
+ # where theta is the slope of the line
+ dx = b.x - a.x
+ dz = b.z - a.z
+ #print "dx=", dx
+ #print "dz=", dz
+ theta = math.atan(dz/dx) ## dx==0 is special case!! (i.e. vertical lines)
+ print("theta=",theta)
+ a_axis = abs( radius2/math.sin(theta) )
+ print("a=", a_axis)
+ # ellipse
+ #a=2
+ b_axis=radius2
+ print("b= ", b_axis)
+
+
+ # slice the tube with a plane at z=0 and find the ellipse center
+ # line is from Point a to b:
+ # a + t*(b-a)
+ # find t so that z-component is zero:
+ # a.z + t( b.z -a.z) = 0
+ # t= a.z / (b.z - a.z)
+ # so point
+ tparam = -a.z / (b.z - a.z) # NOTE horizontal lines are a special case!!
+ ellcenter = a + tparam*(b-a)
+ print("ellcenter (z=0?) =", ellcenter)
+ # center of the
+ # ecen_tmp=cam.Point(ellcenter,a.y,0)
+
+ #drawellipse(myscreen, ellcenter, a_axis, b_axis)
+
+ oe = cam.Ellipse(ellcenter, a_axis, b_axis, radius1)
+
+ #oe2 = cam.Ellipse(ellcenter, a_axis, b_axis, 0.05) # to locate text on the outside of the ellipse
+
+
+ nmax=20
+ #delta=0.05
+ #td = 1
+
+
+
+ t = camvtk.Text()
+ t.SetPos( (myscreen.width-450, myscreen.height-30) )
+ t.SetText("OpenCAMLib " + datetime.datetime.now().strftime("%Y-%m-%d %H:%M:%S"))
+ myscreen.addActor( t)
+
+ t2 = camvtk.Text()
+ ytext = "Y: %3.3f" % (ycoord)
+ t2.SetText(ytext)
+ t2.SetPos( (50, myscreen.height-150) )
+ myscreen.addActor( t2)
+
+
+
+ #w2if = vtk.vtkWindowToImageFilter()
+ #w2if.SetInput(myscreen.renWin)
+ #lwr = vtk.vtkPNGWriter()
+ #lwr.SetInput( w2if.GetOutput() )
+
+ epos = cam.Epos()
+ epos.setS(0,1)
+
+
+
+ #p5 = oe.ePoint(epos5)
+ #pt = oe2.oePoint(epos5)
+ #print "before= ", epos5.s, " , ", epos5.t
+
+ # RUN THE SOLVER!
+ nsteps = cam.Ellipse.solver(oe, cl)
+
+ print("solver done. back to python:")
+ print("1st (s,t) solution=", oe.epos1)
+ print("2st (s,t) solution=", oe.epos2)
+
+ elc1 = calcEcenter(oe,a,b, cl,1)
+ elc2 = calcEcenter(oe,a,b, cl,2)
+ print("elc1=", elc1)
+ print("elc2=", elc2)
+ #exit()
+
+ #elc2 = elc2
+ #epos = oe.epos2
+
+ fe1 = cam.Ellipse(elc1, a_axis, b_axis, radius1)
+ fe2 = cam.Ellipse(elc2, a_axis, b_axis, radius1)
+
+ # draw ellipse-centers
+ myscreen.addActor( camvtk.Sphere(center=(elc1.x,elc1.y,elc1.z), radius=0.01, color=camvtk.lgreen) )
+ myscreen.addActor( camvtk.Sphere(center=(elc2.x,elc2.y,elc2.z), radius=0.01, color=camvtk.pink) )
+
+ # cc-points on the ellipse
+ ccp1 = fe1.ePoint(oe.epos1)
+ ccp2 = fe2.ePoint(oe.epos2)
+ myscreen.addActor( camvtk.Sphere(center=(ccp1.x,ccp1.y,ccp1.z), radius=0.01, color=camvtk.lgreen) )
+ myscreen.addActor( camvtk.Sphere(center=(ccp2.x,ccp2.y,ccp2.z), radius=0.01, color=camvtk.pink) )
+
+ cl1 = fe1.oePoint(oe.epos1)
+ cl2 = fe2.oePoint(oe.epos2)
+
+ # circles
+ myscreen.addActor( camvtk.Circle(radius=radius1, center=(cl1.x,cl1.y,cl1.z), color=camvtk.green) )
+ myscreen.addActor( camvtk.Circle(radius=radius1, center=(cl2.x,cl2.y,cl2.z), color=camvtk.pink) )
+
+ # torus
+ tor = camvtk.Toroid(r1=radius1, r2=radius2, center=(cl1.x, cl1.y, cl1.z),rotXYZ=(0,0,0), color=camvtk.green)
+ tor.SetOpacity(0.4)
+ myscreen.addActor( tor)
+ tor = camvtk.Toroid(r1=radius1, r2=radius2, center=(cl2.x, cl2.y, cl2.z),rotXYZ=(0,0,0), color=camvtk.pink)
+ tor.SetOpacity(0.4)
+ myscreen.addActor( tor)
+
+ # line: ellipse-center to cc-point
+ myscreen.addActor(camvtk.Line( p1=(elc1.x,elc1.y,elc1.z),p2=(ccp1.x,ccp1.y,ccp1.z), color=camvtk.cyan ))
+ myscreen.addActor(camvtk.Line( p1=(elc2.x,elc2.y,elc2.z),p2=(ccp2.x,ccp2.y,ccp2.z), color=camvtk.cyan ))
+
+ # line: cc-point to cl-point
+ myscreen.addActor(camvtk.Line( p1=(cl1.x,cl1.y,cl1.z),p2=(ccp1.x,ccp1.y,ccp1.z), color=camvtk.yellow ))
+ myscreen.addActor(camvtk.Line( p1=(cl2.x,cl2.y,cl2.z),p2=(ccp2.x,ccp2.y,ccp2.z), color=camvtk.yellow ))
+
+ # true cl
+ #clt = cc1.
+
+ #fclpoint = camvtk.Sphere(center=(fclp.x,fclp.y,fclp.z), radius=0.01, color=camvtk.blue)
+ #myscreen.addActor(fclpoint)
+
+ # line from ellipse center to fcc
+ # the offset normal
+ #myscreen.addActor(camvtk.Line( p1=(fclp.x,fclp.y,fclp.z),p2=(fccp.x,fccp.y,fccp.z), color=camvtk.yellow ))
+
+ drawellipse(myscreen, elc1, a_axis, b_axis)
+ drawellipse(myscreen, elc2, a_axis, b_axis)
+
+ #convtext = "%i" % (nsteps)
+ #print (pt.x, pt.y, pt.z)
+ #center=(pt.x, pt.y, pt.z)
+ #tst = camvtk.Text3D( color=(1,1,1), center=(pt.x, pt.y, 0) ,
+ #text=convtext, scale=0.02)
+ #tst.SetCamera(myscreen.camera)
+ #myscreen.addActor(tst)
+
+ #colmax=11
+ #colmin=4
+ #nsteps = nsteps - colmin
+ #colmax = colmax - colmin
+ #convcolor=( float(nsteps*nsteps)/(colmax), float((colmax-nsteps))/colmax, 0 )
+ #esphere = camvtk.Sphere(center=(p5.x,p5.y,0), radius=0.01, color=convcolor)
+ #cce = oe.ePoint(epos)
+ #cle = oe.oePoint(epos)
+ #end_sphere = camvtk.Sphere(center=(cce.x,cce.y,0), radius=0.01, color=camvtk.green)
+ #cl_sphere = camvtk.Sphere(center=(cle.x,cle.y,0), radius=0.01, color=camvtk.pink)
+ #cl_sphere.SetOpacity(0.4)
+
+ #clcir= camvtk.Circle(radius=radius1, center=(cle.x,cle.y,cle.z), color=camvtk.pink)
+ #myscreen.addActor(clcir)
+
+ #myscreen.addActor(esphere)
+ #myscreen.addActor(end_sphere)
+ #myscreen.addActor(cl_sphere)
+ #myscreen.render()
+
+ print("done.")
+ myscreen.render()
+ lwr.SetFileName(filename)
+
+ #raw_input("Press Enter to terminate")
+ time.sleep(0.5)
+ #lwr.Write()
+ myscreen.iren.Start()
+
+
+if __name__ == "__main__":
+ main()
+ #myscreen.iren.Start()
+ #raw_input("Press Enter to terminate")
+
+
diff -Nru opencamlib-11.10+git201801200005~ubuntu16.04.1/examples/python/old/cutsim_test_tux_1.py opencamlib-11.10-1/examples/python/old/cutsim_test_tux_1.py
--- opencamlib-11.10+git201801200005~ubuntu16.04.1/examples/python/old/cutsim_test_tux_1.py 1970-01-01 00:00:00.000000000 +0000
+++ opencamlib-11.10-1/examples/python/old/cutsim_test_tux_1.py 2020-06-14 12:13:19.000000000 +0000
@@ -0,0 +1,248 @@
+import ocl
+import pyocl
+import camvtk
+import time
+import datetime
+import vtk
+
+
+
+def main(filename="frame/f.png"):
+ print(ocl.version())
+
+ myscreen = camvtk.VTKScreen()
+ myscreen.camera.SetPosition(-15, -8, 15)
+ myscreen.camera.SetFocalPoint(5,5, 0)
+ # axis arrows
+ camvtk.drawArrows(myscreen,center=(-1,-1,0))
+
+
+ # screenshot writer
+ w2if = vtk.vtkWindowToImageFilter()
+ w2if.SetInput(myscreen.renWin)
+ lwr = vtk.vtkPNGWriter()
+ lwr.SetInput( w2if.GetOutput() )
+
+
+
+ c = ocl.CylCutter(1,4) # cutter
+ c.length = 3
+ print("cutter length=", c.length)
+
+ # generate CL-points
+ stl = camvtk.STLSurf("../stl/gnu_tux_mod.stl")
+ polydata = stl.src.GetOutput()
+ s = ocl.STLSurf()
+ camvtk.vtkPolyData2OCLSTL(polydata, s)
+ print("STL surface read,", s.size(), "triangles")
+ print(s.getBounds())
+ #exit()
+ minx=0
+ dx=0.1
+ maxx=9
+ miny=0
+ dy=0.4
+ maxy=12
+ z=-17
+ # this generates a list of CL-points in a grid
+ clpoints = pyocl.CLPointGridZigZag(minx,dx,maxx,miny,dy,maxy,z)
+ print("generated grid with", len(clpoints)," CL-points")
+ # batchdropcutter
+ bdc = ocl.BatchDropCutter()
+ bdc.setSTL(s)
+ bdc.setCutter(c)
+ for p in clpoints:
+ bdc.appendPoint(p)
+ t_before = time.time()
+ print("threads=",bdc.getThreads())
+ bdc.run()
+ t_after = time.time()
+ calctime = t_after-t_before
+ print(" done in ", calctime," s")
+ clpoints = bdc.getCLPoints()
+
+ # filter
+ print("filtering. before filter we have", len(clpoints),"cl-points")
+ t_before = time.time()
+ f = ocl.LineCLFilter()
+ f.setTolerance(0.001)
+ for p in clpoints:
+ f.addCLPoint(p)
+ f.run()
+ clpts = f.getCLPoints()
+ calctime = time.time()-t_before
+ print("after filtering we have", len(clpts),"cl-points")
+ print(" done in ", calctime," s")
+
+ #exit()
+
+ # stupid init code
+ ocode=ocl.Ocode()
+ tree_maxdepth=10
+ ocode.set_depth(tree_maxdepth) # depth and scale set here.
+ ocode.set_scale(10)
+
+ # cube
+ stockvol = ocl.BoxOCTVolume()
+ stockvol.corner = ocl.Point(0,0,-0.5)
+ stockvol.v1 = ocl.Point(9,0,0)
+ stockvol.v2 = ocl.Point(0,12,0)
+ stockvol.v3 = ocl.Point(0,0,3.5)
+ stockvol.calcBB()
+
+ t_before = time.time()
+ stock = ocl.LinOCT()
+ stock.init(0)
+ stock.build( stockvol )
+ calctime = time.time()-t_before
+ print(" stock built in ", calctime," s, stock.size()=",stock.size())
+
+ # draw initial octree
+ #tlist = pyocl.octree2trilist(stock)
+ #surf = camvtk.STLSurf(triangleList=tlist)
+ #myscreen.addActor(surf)
+
+ # draw initial cutter
+ #startp = ocl.Point(0,0,0)
+ #cyl = camvtk.Cylinder(center=(startp.x,startp.y,startp.z), radius=c.radius,
+ # height=c.length,
+ # rotXYZ=(90,0,0), color=camvtk.grey)
+ #cyl.SetWireframe()
+ #myscreen.addActor(cyl)
+
+ timetext = camvtk.Text()
+ timetext.SetPos( (myscreen.width-300, myscreen.height-30) )
+ myscreen.addActor( timetext)
+
+ ocltext = camvtk.Text()
+ ocltext.SetPos( (myscreen.width-300, myscreen.height-60) )
+ myscreen.addActor( ocltext)
+ ocltext.SetText("OpenCAMLib")
+
+ octtext = camvtk.Text()
+ octtext.SetPos( (myscreen.width-300, myscreen.height-90) )
+ myscreen.addActor( octtext)
+ octtext.SetText("Octree cutting-simulation")
+
+ infotext = camvtk.Text()
+ infotext.SetPos( (myscreen.width-300, myscreen.height-180) )
+ myscreen.addActor( infotext)
+
+
+ Nmoves = len(clpts)
+ print(Nmoves,"CL-points to process")
+ for n in range(0,Nmoves-1):
+ timetext.SetText(datetime.datetime.now().strftime("%Y-%m-%d %H:%M:%S"))
+
+ #if n=0.3.0 <0.4"
+ }
+ },
+ "chownr": {
+ "version": "1.1.1",
+ "resolved": "https://registry.npmjs.org/chownr/-/chownr-1.1.1.tgz",
+ "integrity": "sha512-j38EvO5+LHX84jlo6h4UzmOwi0UgW61WRyPtJz4qaadK5eY3BTS5TY/S1Stc3Uk2lIM6TPevAlULiEJwie860g=="
+ },
+ "cliui": {
+ "version": "3.2.0",
+ "resolved": "https://registry.npmjs.org/cliui/-/cliui-3.2.0.tgz",
+ "integrity": "sha1-EgYBU3qRbSmUD5NNo7SNWFo5IT0=",
+ "requires": {
+ "string-width": "^1.0.1",
+ "strip-ansi": "^3.0.1",
+ "wrap-ansi": "^2.0.0"
+ }
+ },
+ "cmake-js": {
+ "version": "4.0.1",
+ "resolved": "https://registry.npmjs.org/cmake-js/-/cmake-js-4.0.1.tgz",
+ "integrity": "sha512-ShCnSfCmcy9LfFomcMbQJuQ+hnanlMZbOqfiA8EmkYlW2uUwi4/m4/Rt+mOFmAdvNceP3bTLjHymYNNsM4tjFQ==",
+ "requires": {
+ "bluebird": "^3",
+ "debug": "^4",
+ "fs-extra": "^5.0.0",
+ "is-iojs": "^1.0.1",
+ "lodash": "^4",
+ "memory-stream": "0",
+ "npmlog": "^1.2.0",
+ "rc": "^1.2.7",
+ "request": "^2.54.0",
+ "semver": "^5.0.3",
+ "splitargs": "0",
+ "tar": "^4",
+ "traceur": "0.0.x",
+ "unzipper": "^0.8.13",
+ "url-join": "0",
+ "which": "^1.0.9",
+ "yargs": "^3.6.0"
+ }
+ },
+ "code-point-at": {
+ "version": "1.1.0",
+ "resolved": "https://registry.npmjs.org/code-point-at/-/code-point-at-1.1.0.tgz",
+ "integrity": "sha1-DQcLTQQ6W+ozovGkDi7bPZpMz3c="
+ },
+ "combined-stream": {
+ "version": "1.0.7",
+ "resolved": "https://registry.npmjs.org/combined-stream/-/combined-stream-1.0.7.tgz",
+ "integrity": "sha512-brWl9y6vOB1xYPZcpZde3N9zDByXTosAeMDo4p1wzo6UMOX4vumB+TP1RZ76sfE6Md68Q0NJSrE/gbezd4Ul+w==",
+ "requires": {
+ "delayed-stream": "~1.0.0"
+ }
+ },
+ "commander": {
+ "version": "2.9.0",
+ "resolved": "https://registry.npmjs.org/commander/-/commander-2.9.0.tgz",
+ "integrity": "sha1-nJkJQXbhIkDLItbFFGCYQA/g99Q=",
+ "requires": {
+ "graceful-readlink": ">= 1.0.0"
+ }
+ },
+ "concat-map": {
+ "version": "0.0.1",
+ "resolved": "https://registry.npmjs.org/concat-map/-/concat-map-0.0.1.tgz",
+ "integrity": "sha1-2Klr13/Wjfd5OnMDajug1UBdR3s="
+ },
+ "core-util-is": {
+ "version": "1.0.2",
+ "resolved": "https://registry.npmjs.org/core-util-is/-/core-util-is-1.0.2.tgz",
+ "integrity": "sha1-tf1UIgqivFq1eqtxQMlAdUUDwac="
+ },
+ "dashdash": {
+ "version": "1.14.1",
+ "resolved": "https://registry.npmjs.org/dashdash/-/dashdash-1.14.1.tgz",
+ "integrity": "sha1-hTz6D3y+L+1d4gMmuN1YEDX24vA=",
+ "requires": {
+ "assert-plus": "^1.0.0"
+ }
+ },
+ "debug": {
+ "version": "4.1.1",
+ "resolved": "https://registry.npmjs.org/debug/-/debug-4.1.1.tgz",
+ "integrity": "sha512-pYAIzeRo8J6KPEaJ0VWOh5Pzkbw/RetuzehGM7QRRX5he4fPHx2rdKMB256ehJCkX+XRQm16eZLqLNS8RSZXZw==",
+ "requires": {
+ "ms": "^2.1.1"
+ }
+ },
+ "decamelize": {
+ "version": "1.2.0",
+ "resolved": "https://registry.npmjs.org/decamelize/-/decamelize-1.2.0.tgz",
+ "integrity": "sha1-9lNNFRSCabIDUue+4m9QH5oZEpA="
+ },
+ "deep-extend": {
+ "version": "0.6.0",
+ "resolved": "https://registry.npmjs.org/deep-extend/-/deep-extend-0.6.0.tgz",
+ "integrity": "sha512-LOHxIOaPYdHlJRtCQfDIVZtfw/ufM8+rVj649RIHzcm/vGwQRXFt6OPqIFWsm2XEMrNIEtWR64sY1LEKD2vAOA=="
+ },
+ "delayed-stream": {
+ "version": "1.0.0",
+ "resolved": "https://registry.npmjs.org/delayed-stream/-/delayed-stream-1.0.0.tgz",
+ "integrity": "sha1-3zrhmayt+31ECqrgsp4icrJOxhk="
+ },
+ "delegates": {
+ "version": "1.0.0",
+ "resolved": "https://registry.npmjs.org/delegates/-/delegates-1.0.0.tgz",
+ "integrity": "sha1-hMbhWbgZBP3KWaDvRM2HDTElD5o="
+ },
+ "duplexer2": {
+ "version": "0.1.4",
+ "resolved": "https://registry.npmjs.org/duplexer2/-/duplexer2-0.1.4.tgz",
+ "integrity": "sha1-ixLauHjA1p4+eJEFFmKjL8a93ME=",
+ "requires": {
+ "readable-stream": "^2.0.2"
+ },
+ "dependencies": {
+ "isarray": {
+ "version": "1.0.0",
+ "resolved": "https://registry.npmjs.org/isarray/-/isarray-1.0.0.tgz",
+ "integrity": "sha1-u5NdSFgsuhaMBoNJV6VKPgcSTxE="
+ },
+ "readable-stream": {
+ "version": "2.3.6",
+ "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-2.3.6.tgz",
+ "integrity": "sha512-tQtKA9WIAhBF3+VLAseyMqZeBjW0AHJoxOtYqSUZNJxauErmLbVm2FW1y+J/YA9dUrAC39ITejlZWhVIwawkKw==",
+ "requires": {
+ "core-util-is": "~1.0.0",
+ "inherits": "~2.0.3",
+ "isarray": "~1.0.0",
+ "process-nextick-args": "~2.0.0",
+ "safe-buffer": "~5.1.1",
+ "string_decoder": "~1.1.1",
+ "util-deprecate": "~1.0.1"
+ }
+ },
+ "string_decoder": {
+ "version": "1.1.1",
+ "resolved": "https://registry.npmjs.org/string_decoder/-/string_decoder-1.1.1.tgz",
+ "integrity": "sha512-n/ShnvDi6FHbbVfviro+WojiFzv+s8MPMHBczVePfUpDJLwoLT0ht1l4YwBCbi8pJAveEEdnkHyPyTP/mzRfwg==",
+ "requires": {
+ "safe-buffer": "~5.1.0"
+ }
+ }
+ }
+ },
+ "ecc-jsbn": {
+ "version": "0.1.2",
+ "resolved": "https://registry.npmjs.org/ecc-jsbn/-/ecc-jsbn-0.1.2.tgz",
+ "integrity": "sha1-OoOpBOVDUyh4dMVkt1SThoSamMk=",
+ "requires": {
+ "jsbn": "~0.1.0",
+ "safer-buffer": "^2.1.0"
+ }
+ },
+ "extend": {
+ "version": "3.0.2",
+ "resolved": "https://registry.npmjs.org/extend/-/extend-3.0.2.tgz",
+ "integrity": "sha512-fjquC59cD7CyW6urNXK0FBufkZcoiGG80wTuPujX590cB5Ttln20E2UB4S/WARVqhXffZl2LNgS+gQdPIIim/g=="
+ },
+ "extsprintf": {
+ "version": "1.3.0",
+ "resolved": "https://registry.npmjs.org/extsprintf/-/extsprintf-1.3.0.tgz",
+ "integrity": "sha1-lpGEQOMEGnpBT4xS48V06zw+HgU="
+ },
+ "fast-deep-equal": {
+ "version": "2.0.1",
+ "resolved": "https://registry.npmjs.org/fast-deep-equal/-/fast-deep-equal-2.0.1.tgz",
+ "integrity": "sha1-ewUhjd+WZ79/Nwv3/bLLFf3Qqkk="
+ },
+ "fast-json-stable-stringify": {
+ "version": "2.0.0",
+ "resolved": "https://registry.npmjs.org/fast-json-stable-stringify/-/fast-json-stable-stringify-2.0.0.tgz",
+ "integrity": "sha1-1RQsDK7msRifh9OnYREGT4bIu/I="
+ },
+ "forever-agent": {
+ "version": "0.6.1",
+ "resolved": "https://registry.npmjs.org/forever-agent/-/forever-agent-0.6.1.tgz",
+ "integrity": "sha1-+8cfDEGt6zf5bFd60e1C2P2sypE="
+ },
+ "form-data": {
+ "version": "2.3.3",
+ "resolved": "https://registry.npmjs.org/form-data/-/form-data-2.3.3.tgz",
+ "integrity": "sha512-1lLKB2Mu3aGP1Q/2eCOx0fNbRMe7XdwktwOruhfqqd0rIJWwN4Dh+E3hrPSlDCXnSR7UtZ1N38rVXm+6+MEhJQ==",
+ "requires": {
+ "asynckit": "^0.4.0",
+ "combined-stream": "^1.0.6",
+ "mime-types": "^2.1.12"
+ }
+ },
+ "fs-extra": {
+ "version": "5.0.0",
+ "resolved": "https://registry.npmjs.org/fs-extra/-/fs-extra-5.0.0.tgz",
+ "integrity": "sha512-66Pm4RYbjzdyeuqudYqhFiNBbCIuI9kgRqLPSHIlXHidW8NIQtVdkM1yeZ4lXwuhbTETv3EUGMNHAAw6hiundQ==",
+ "requires": {
+ "graceful-fs": "^4.1.2",
+ "jsonfile": "^4.0.0",
+ "universalify": "^0.1.0"
+ }
+ },
+ "fs-minipass": {
+ "version": "1.2.5",
+ "resolved": "https://registry.npmjs.org/fs-minipass/-/fs-minipass-1.2.5.tgz",
+ "integrity": "sha512-JhBl0skXjUPCFH7x6x61gQxrKyXsxB5gcgePLZCwfyCGGsTISMoIeObbrvVeP6Xmyaudw4TT43qV2Gz+iyd2oQ==",
+ "requires": {
+ "minipass": "^2.2.1"
+ }
+ },
+ "fs.realpath": {
+ "version": "1.0.0",
+ "resolved": "https://registry.npmjs.org/fs.realpath/-/fs.realpath-1.0.0.tgz",
+ "integrity": "sha1-FQStJSMVjKpA20onh8sBQRmU6k8="
+ },
+ "fstream": {
+ "version": "1.0.12",
+ "resolved": "https://registry.npmjs.org/fstream/-/fstream-1.0.12.tgz",
+ "integrity": "sha512-WvJ193OHa0GHPEL+AycEJgxvBEwyfRkN1vhjca23OaPVMCaLCXTd5qAu82AjTcgP1UJmytkOKb63Ypde7raDIg==",
+ "requires": {
+ "graceful-fs": "^4.1.2",
+ "inherits": "~2.0.0",
+ "mkdirp": ">=0.5 0",
+ "rimraf": "2"
+ }
+ },
+ "gauge": {
+ "version": "1.2.7",
+ "resolved": "https://registry.npmjs.org/gauge/-/gauge-1.2.7.tgz",
+ "integrity": "sha1-6c7FSD09TuDvRLYKfZnkk14TbZM=",
+ "requires": {
+ "ansi": "^0.3.0",
+ "has-unicode": "^2.0.0",
+ "lodash.pad": "^4.1.0",
+ "lodash.padend": "^4.1.0",
+ "lodash.padstart": "^4.1.0"
+ }
+ },
+ "getpass": {
+ "version": "0.1.7",
+ "resolved": "https://registry.npmjs.org/getpass/-/getpass-0.1.7.tgz",
+ "integrity": "sha1-Xv+OPmhNVprkyysSgmBOi6YhSfo=",
+ "requires": {
+ "assert-plus": "^1.0.0"
+ }
+ },
+ "glob": {
+ "version": "5.0.15",
+ "resolved": "https://registry.npmjs.org/glob/-/glob-5.0.15.tgz",
+ "integrity": "sha1-G8k2ueAvSmA/zCIuz3Yz0wuLk7E=",
+ "requires": {
+ "inflight": "^1.0.4",
+ "inherits": "2",
+ "minimatch": "2 || 3",
+ "once": "^1.3.0",
+ "path-is-absolute": "^1.0.0"
+ }
+ },
+ "graceful-fs": {
+ "version": "4.1.15",
+ "resolved": "https://registry.npmjs.org/graceful-fs/-/graceful-fs-4.1.15.tgz",
+ "integrity": "sha512-6uHUhOPEBgQ24HM+r6b/QwWfZq+yiFcipKFrOFiBEnWdy5sdzYoi+pJeQaPI5qOLRFqWmAXUPQNsielzdLoecA=="
+ },
+ "graceful-readlink": {
+ "version": "1.0.1",
+ "resolved": "https://registry.npmjs.org/graceful-readlink/-/graceful-readlink-1.0.1.tgz",
+ "integrity": "sha1-TK+tdrxi8C+gObL5Tpo906ORpyU="
+ },
+ "har-schema": {
+ "version": "2.0.0",
+ "resolved": "https://registry.npmjs.org/har-schema/-/har-schema-2.0.0.tgz",
+ "integrity": "sha1-qUwiJOvKwEeCoNkDVSHyRzW37JI="
+ },
+ "har-validator": {
+ "version": "5.1.3",
+ "resolved": "https://registry.npmjs.org/har-validator/-/har-validator-5.1.3.tgz",
+ "integrity": "sha512-sNvOCzEQNr/qrvJgc3UG/kD4QtlHycrzwS+6mfTrrSq97BvaYcPZZI1ZSqGSPR73Cxn4LKTD4PttRwfU7jWq5g==",
+ "requires": {
+ "ajv": "^6.5.5",
+ "har-schema": "^2.0.0"
+ }
+ },
+ "has-unicode": {
+ "version": "2.0.1",
+ "resolved": "https://registry.npmjs.org/has-unicode/-/has-unicode-2.0.1.tgz",
+ "integrity": "sha1-4Ob+aijPUROIVeCG0Wkedx3iqLk="
+ },
+ "http-signature": {
+ "version": "1.2.0",
+ "resolved": "https://registry.npmjs.org/http-signature/-/http-signature-1.2.0.tgz",
+ "integrity": "sha1-muzZJRFHcvPZW2WmCruPfBj7rOE=",
+ "requires": {
+ "assert-plus": "^1.0.0",
+ "jsprim": "^1.2.2",
+ "sshpk": "^1.7.0"
+ }
+ },
+ "inflight": {
+ "version": "1.0.6",
+ "resolved": "https://registry.npmjs.org/inflight/-/inflight-1.0.6.tgz",
+ "integrity": "sha1-Sb1jMdfQLQwJvJEKEHW6gWW1bfk=",
+ "requires": {
+ "once": "^1.3.0",
+ "wrappy": "1"
+ }
+ },
+ "inherits": {
+ "version": "2.0.3",
+ "resolved": "https://registry.npmjs.org/inherits/-/inherits-2.0.3.tgz",
+ "integrity": "sha1-Yzwsg+PaQqUC9SRmAiSA9CCCYd4="
+ },
+ "ini": {
+ "version": "1.3.5",
+ "resolved": "https://registry.npmjs.org/ini/-/ini-1.3.5.tgz",
+ "integrity": "sha512-RZY5huIKCMRWDUqZlEi72f/lmXKMvuszcMBduliQ3nnWbx9X/ZBQO7DijMEYS9EhHBb2qacRUMtC7svLwe0lcw=="
+ },
+ "invert-kv": {
+ "version": "1.0.0",
+ "resolved": "https://registry.npmjs.org/invert-kv/-/invert-kv-1.0.0.tgz",
+ "integrity": "sha1-EEqOSqym09jNFXqO+L+rLXo//bY="
+ },
+ "is-fullwidth-code-point": {
+ "version": "1.0.0",
+ "resolved": "https://registry.npmjs.org/is-fullwidth-code-point/-/is-fullwidth-code-point-1.0.0.tgz",
+ "integrity": "sha1-754xOG8DGn8NZDr4L95QxFfvAMs=",
+ "requires": {
+ "number-is-nan": "^1.0.0"
+ }
+ },
+ "is-iojs": {
+ "version": "1.1.0",
+ "resolved": "https://registry.npmjs.org/is-iojs/-/is-iojs-1.1.0.tgz",
+ "integrity": "sha1-TBEDO11dlNbqs3dd7cm+fQCDJfE="
+ },
+ "is-typedarray": {
+ "version": "1.0.0",
+ "resolved": "https://registry.npmjs.org/is-typedarray/-/is-typedarray-1.0.0.tgz",
+ "integrity": "sha1-5HnICFjfDBsR3dppQPlgEfzaSpo="
+ },
+ "isarray": {
+ "version": "0.0.1",
+ "resolved": "https://registry.npmjs.org/isarray/-/isarray-0.0.1.tgz",
+ "integrity": "sha1-ihis/Kmo9Bd+Cav8YDiTmwXR7t8="
+ },
+ "isexe": {
+ "version": "2.0.0",
+ "resolved": "https://registry.npmjs.org/isexe/-/isexe-2.0.0.tgz",
+ "integrity": "sha1-6PvzdNxVb/iUehDcsFctYz8s+hA="
+ },
+ "isstream": {
+ "version": "0.1.2",
+ "resolved": "https://registry.npmjs.org/isstream/-/isstream-0.1.2.tgz",
+ "integrity": "sha1-R+Y/evVa+m+S4VAOaQ64uFKcCZo="
+ },
+ "jsbn": {
+ "version": "0.1.1",
+ "resolved": "https://registry.npmjs.org/jsbn/-/jsbn-0.1.1.tgz",
+ "integrity": "sha1-peZUwuWi3rXyAdls77yoDA7y9RM="
+ },
+ "json-schema": {
+ "version": "0.2.3",
+ "resolved": "https://registry.npmjs.org/json-schema/-/json-schema-0.2.3.tgz",
+ "integrity": "sha1-tIDIkuWaLwWVTOcnvT8qTogvnhM="
+ },
+ "json-schema-traverse": {
+ "version": "0.4.1",
+ "resolved": "https://registry.npmjs.org/json-schema-traverse/-/json-schema-traverse-0.4.1.tgz",
+ "integrity": "sha512-xbbCH5dCYU5T8LcEhhuh7HJ88HXuW3qsI3Y0zOZFKfZEHcpWiHU/Jxzk629Brsab/mMiHQti9wMP+845RPe3Vg=="
+ },
+ "json-stringify-safe": {
+ "version": "5.0.1",
+ "resolved": "https://registry.npmjs.org/json-stringify-safe/-/json-stringify-safe-5.0.1.tgz",
+ "integrity": "sha1-Epai1Y/UXxmg9s4B1lcB4sc1tus="
+ },
+ "jsonfile": {
+ "version": "4.0.0",
+ "resolved": "https://registry.npmjs.org/jsonfile/-/jsonfile-4.0.0.tgz",
+ "integrity": "sha1-h3Gq4HmbZAdrdmQPygWPnBDjPss=",
+ "requires": {
+ "graceful-fs": "^4.1.6"
+ }
+ },
+ "jsprim": {
+ "version": "1.4.1",
+ "resolved": "https://registry.npmjs.org/jsprim/-/jsprim-1.4.1.tgz",
+ "integrity": "sha1-MT5mvB5cwG5Di8G3SZwuXFastqI=",
+ "requires": {
+ "assert-plus": "1.0.0",
+ "extsprintf": "1.3.0",
+ "json-schema": "0.2.3",
+ "verror": "1.10.0"
+ }
+ },
+ "lcid": {
+ "version": "1.0.0",
+ "resolved": "https://registry.npmjs.org/lcid/-/lcid-1.0.0.tgz",
+ "integrity": "sha1-MIrMr6C8SDo4Z7S28rlQYlHRuDU=",
+ "requires": {
+ "invert-kv": "^1.0.0"
+ }
+ },
+ "listenercount": {
+ "version": "1.0.1",
+ "resolved": "https://registry.npmjs.org/listenercount/-/listenercount-1.0.1.tgz",
+ "integrity": "sha1-hMinKrWcRyUyFIDJdeZQg0LnCTc="
+ },
+ "lodash": {
+ "version": "4.17.14",
+ "resolved": "https://registry.npmjs.org/lodash/-/lodash-4.17.14.tgz",
+ "integrity": "sha512-mmKYbW3GLuJeX+iGP+Y7Gp1AiGHGbXHCOh/jZmrawMmsE7MS4znI3RL2FsjbqOyMayHInjOeykW7PEajUk1/xw=="
+ },
+ "lodash.pad": {
+ "version": "4.5.1",
+ "resolved": "https://registry.npmjs.org/lodash.pad/-/lodash.pad-4.5.1.tgz",
+ "integrity": "sha1-QzCUmoM6fI2iLMIPaibE1Z3runA="
+ },
+ "lodash.padend": {
+ "version": "4.6.1",
+ "resolved": "https://registry.npmjs.org/lodash.padend/-/lodash.padend-4.6.1.tgz",
+ "integrity": "sha1-U8y6BH0G4VjTEfRdpiX05J5vFm4="
+ },
+ "lodash.padstart": {
+ "version": "4.6.1",
+ "resolved": "https://registry.npmjs.org/lodash.padstart/-/lodash.padstart-4.6.1.tgz",
+ "integrity": "sha1-0uPuv/DZ05rVD1y9G1KnvOa7YRs="
+ },
+ "memory-stream": {
+ "version": "0.0.3",
+ "resolved": "https://registry.npmjs.org/memory-stream/-/memory-stream-0.0.3.tgz",
+ "integrity": "sha1-6+jdHDuLw4wOeUHp3dWuvmtN6D8=",
+ "requires": {
+ "readable-stream": "~1.0.26-2"
+ }
+ },
+ "mime-db": {
+ "version": "1.37.0",
+ "resolved": "https://registry.npmjs.org/mime-db/-/mime-db-1.37.0.tgz",
+ "integrity": "sha512-R3C4db6bgQhlIhPU48fUtdVmKnflq+hRdad7IyKhtFj06VPNVdk2RhiYL3UjQIlso8L+YxAtFkobT0VK+S/ybg=="
+ },
+ "mime-types": {
+ "version": "2.1.21",
+ "resolved": "https://registry.npmjs.org/mime-types/-/mime-types-2.1.21.tgz",
+ "integrity": "sha512-3iL6DbwpyLzjR3xHSFNFeb9Nz/M8WDkX33t1GFQnFOllWk8pOrh/LSrB5OXlnlW5P9LH73X6loW/eogc+F5lJg==",
+ "requires": {
+ "mime-db": "~1.37.0"
+ }
+ },
+ "minimatch": {
+ "version": "3.0.4",
+ "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-3.0.4.tgz",
+ "integrity": "sha512-yJHVQEhyqPLUTgt9B83PXu6W3rx4MvvHvSUvToogpwoGDOUQ+yDrR0HRot+yOCdCO7u4hX3pWft6kWBBcqh0UA==",
+ "requires": {
+ "brace-expansion": "^1.1.7"
+ }
+ },
+ "minimist": {
+ "version": "1.2.0",
+ "resolved": "https://registry.npmjs.org/minimist/-/minimist-1.2.0.tgz",
+ "integrity": "sha1-o1AIsg9BOD7sH7kU9M1d95omQoQ="
+ },
+ "minipass": {
+ "version": "2.3.5",
+ "resolved": "https://registry.npmjs.org/minipass/-/minipass-2.3.5.tgz",
+ "integrity": "sha512-Gi1W4k059gyRbyVUZQ4mEqLm0YIUiGYfvxhF6SIlk3ui1WVxMTGfGdQ2SInh3PDrRTVvPKgULkpJtT4RH10+VA==",
+ "requires": {
+ "safe-buffer": "^5.1.2",
+ "yallist": "^3.0.0"
+ }
+ },
+ "minizlib": {
+ "version": "1.2.1",
+ "resolved": "https://registry.npmjs.org/minizlib/-/minizlib-1.2.1.tgz",
+ "integrity": "sha512-7+4oTUOWKg7AuL3vloEWekXY2/D20cevzsrNT2kGWm+39J9hGTCBv8VI5Pm5lXZ/o3/mdR4f8rflAPhnQb8mPA==",
+ "requires": {
+ "minipass": "^2.2.1"
+ }
+ },
+ "mkdirp": {
+ "version": "0.5.1",
+ "resolved": "https://registry.npmjs.org/mkdirp/-/mkdirp-0.5.1.tgz",
+ "integrity": "sha1-MAV0OOrGz3+MR2fzhkjWaX11yQM=",
+ "requires": {
+ "minimist": "0.0.8"
+ },
+ "dependencies": {
+ "minimist": {
+ "version": "0.0.8",
+ "resolved": "https://registry.npmjs.org/minimist/-/minimist-0.0.8.tgz",
+ "integrity": "sha1-hX/Kv8M5fSYluCKCYuhqp6ARsF0="
+ }
+ }
+ },
+ "ms": {
+ "version": "2.1.1",
+ "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.1.tgz",
+ "integrity": "sha512-tgp+dl5cGk28utYktBsrFqA7HKgrhgPsg6Z/EfhWI4gl1Hwq8B/GmY/0oXZ6nF8hDVesS/FpnYaD/kOWhYQvyg=="
+ },
+ "node-addon-api": {
+ "version": "1.6.2",
+ "resolved": "https://registry.npmjs.org/node-addon-api/-/node-addon-api-1.6.2.tgz",
+ "integrity": "sha512-479Bjw9nTE5DdBSZZWprFryHGjUaQC31y1wHo19We/k0BZlrmhqQitWoUL0cD8+scljCbIUL+E58oRDEakdGGA=="
+ },
+ "npmlog": {
+ "version": "1.2.1",
+ "resolved": "https://registry.npmjs.org/npmlog/-/npmlog-1.2.1.tgz",
+ "integrity": "sha1-KOe+YZYJtT960d0wChDWTXFiaLY=",
+ "requires": {
+ "ansi": "~0.3.0",
+ "are-we-there-yet": "~1.0.0",
+ "gauge": "~1.2.0"
+ }
+ },
+ "number-is-nan": {
+ "version": "1.0.1",
+ "resolved": "https://registry.npmjs.org/number-is-nan/-/number-is-nan-1.0.1.tgz",
+ "integrity": "sha1-CXtgK1NCKlIsGvuHkDGDNpQaAR0="
+ },
+ "oauth-sign": {
+ "version": "0.9.0",
+ "resolved": "https://registry.npmjs.org/oauth-sign/-/oauth-sign-0.9.0.tgz",
+ "integrity": "sha512-fexhUFFPTGV8ybAtSIGbV6gOkSv8UtRbDBnAyLQw4QPKkgNlsH2ByPGtMUqdWkos6YCRmAqViwgZrJc/mRDzZQ=="
+ },
+ "once": {
+ "version": "1.4.0",
+ "resolved": "https://registry.npmjs.org/once/-/once-1.4.0.tgz",
+ "integrity": "sha1-WDsap3WWHUsROsF9nFC6753Xa9E=",
+ "requires": {
+ "wrappy": "1"
+ }
+ },
+ "os-locale": {
+ "version": "1.4.0",
+ "resolved": "https://registry.npmjs.org/os-locale/-/os-locale-1.4.0.tgz",
+ "integrity": "sha1-IPnxeuKe00XoveWDsT0gCYA8FNk=",
+ "requires": {
+ "lcid": "^1.0.0"
+ }
+ },
+ "path-is-absolute": {
+ "version": "1.0.1",
+ "resolved": "https://registry.npmjs.org/path-is-absolute/-/path-is-absolute-1.0.1.tgz",
+ "integrity": "sha1-F0uSaHNVNP+8es5r9TpanhtcX18="
+ },
+ "performance-now": {
+ "version": "2.1.0",
+ "resolved": "https://registry.npmjs.org/performance-now/-/performance-now-2.1.0.tgz",
+ "integrity": "sha1-Ywn04OX6kT7BxpMHrjZLSzd8nns="
+ },
+ "process-nextick-args": {
+ "version": "2.0.0",
+ "resolved": "https://registry.npmjs.org/process-nextick-args/-/process-nextick-args-2.0.0.tgz",
+ "integrity": "sha512-MtEC1TqN0EU5nephaJ4rAtThHtC86dNN9qCuEhtshvpVBkAW5ZO7BASN9REnF9eoXGcRub+pFuKEpOHE+HbEMw=="
+ },
+ "psl": {
+ "version": "1.1.31",
+ "resolved": "https://registry.npmjs.org/psl/-/psl-1.1.31.tgz",
+ "integrity": "sha512-/6pt4+C+T+wZUieKR620OpzN/LlnNKuWjy1iFLQ/UG35JqHlR/89MP1d96dUfkf6Dne3TuLQzOYEYshJ+Hx8mw=="
+ },
+ "punycode": {
+ "version": "2.1.1",
+ "resolved": "https://registry.npmjs.org/punycode/-/punycode-2.1.1.tgz",
+ "integrity": "sha512-XRsRjdf+j5ml+y/6GKHPZbrF/8p2Yga0JPtdqTIY2Xe5ohJPD9saDJJLPvp9+NSBprVvevdXZybnj2cv8OEd0A=="
+ },
+ "qs": {
+ "version": "6.5.2",
+ "resolved": "https://registry.npmjs.org/qs/-/qs-6.5.2.tgz",
+ "integrity": "sha512-N5ZAX4/LxJmF+7wN74pUD6qAh9/wnvdQcjq9TZjevvXzSUo7bfmw91saqMjzGS2xq91/odN2dW/WOl7qQHNDGA=="
+ },
+ "rc": {
+ "version": "1.2.8",
+ "resolved": "https://registry.npmjs.org/rc/-/rc-1.2.8.tgz",
+ "integrity": "sha512-y3bGgqKj3QBdxLbLkomlohkvsA8gdAiUQlSBJnBhfn+BPxg4bc62d8TcBW15wavDfgexCgccckhcZvywyQYPOw==",
+ "requires": {
+ "deep-extend": "^0.6.0",
+ "ini": "~1.3.0",
+ "minimist": "^1.2.0",
+ "strip-json-comments": "~2.0.1"
+ }
+ },
+ "readable-stream": {
+ "version": "1.0.34",
+ "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-1.0.34.tgz",
+ "integrity": "sha1-Elgg40vIQtLyqq+v5MKRbuMsFXw=",
+ "requires": {
+ "core-util-is": "~1.0.0",
+ "inherits": "~2.0.1",
+ "isarray": "0.0.1",
+ "string_decoder": "~0.10.x"
+ }
+ },
+ "request": {
+ "version": "2.88.0",
+ "resolved": "https://registry.npmjs.org/request/-/request-2.88.0.tgz",
+ "integrity": "sha512-NAqBSrijGLZdM0WZNsInLJpkJokL72XYjUpnB0iwsRgxh7dB6COrHnTBNwN0E+lHDAJzu7kLAkDeY08z2/A0hg==",
+ "requires": {
+ "aws-sign2": "~0.7.0",
+ "aws4": "^1.8.0",
+ "caseless": "~0.12.0",
+ "combined-stream": "~1.0.6",
+ "extend": "~3.0.2",
+ "forever-agent": "~0.6.1",
+ "form-data": "~2.3.2",
+ "har-validator": "~5.1.0",
+ "http-signature": "~1.2.0",
+ "is-typedarray": "~1.0.0",
+ "isstream": "~0.1.2",
+ "json-stringify-safe": "~5.0.1",
+ "mime-types": "~2.1.19",
+ "oauth-sign": "~0.9.0",
+ "performance-now": "^2.1.0",
+ "qs": "~6.5.2",
+ "safe-buffer": "^5.1.2",
+ "tough-cookie": "~2.4.3",
+ "tunnel-agent": "^0.6.0",
+ "uuid": "^3.3.2"
+ }
+ },
+ "rimraf": {
+ "version": "2.6.3",
+ "resolved": "https://registry.npmjs.org/rimraf/-/rimraf-2.6.3.tgz",
+ "integrity": "sha512-mwqeW5XsA2qAejG46gYdENaxXjx9onRNCfn7L0duuP4hCuTIi/QO7PDK07KJfp1d+izWPrzEJDcSqBa0OZQriA==",
+ "requires": {
+ "glob": "^7.1.3"
+ },
+ "dependencies": {
+ "glob": {
+ "version": "7.1.3",
+ "resolved": "https://registry.npmjs.org/glob/-/glob-7.1.3.tgz",
+ "integrity": "sha512-vcfuiIxogLV4DlGBHIUOwI0IbrJ8HWPc4MU7HzviGeNho/UJDfi6B5p3sHeWIQ0KGIU0Jpxi5ZHxemQfLkkAwQ==",
+ "requires": {
+ "fs.realpath": "^1.0.0",
+ "inflight": "^1.0.4",
+ "inherits": "2",
+ "minimatch": "^3.0.4",
+ "once": "^1.3.0",
+ "path-is-absolute": "^1.0.0"
+ }
+ }
+ }
+ },
+ "rsvp": {
+ "version": "3.6.2",
+ "resolved": "https://registry.npmjs.org/rsvp/-/rsvp-3.6.2.tgz",
+ "integrity": "sha512-OfWGQTb9vnwRjwtA2QwpG2ICclHC3pgXZO5xt8H2EfgDquO0qVdSb5T88L4qJVAEugbS56pAuV4XZM58UX8ulw=="
+ },
+ "safe-buffer": {
+ "version": "5.1.2",
+ "resolved": "https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.1.2.tgz",
+ "integrity": "sha512-Gd2UZBJDkXlY7GbJxfsE8/nvKkUEU1G38c1siN6QP6a9PT9MmHB8GnpscSmMJSoF8LOIrt8ud/wPtojys4G6+g=="
+ },
+ "safer-buffer": {
+ "version": "2.1.2",
+ "resolved": "https://registry.npmjs.org/safer-buffer/-/safer-buffer-2.1.2.tgz",
+ "integrity": "sha512-YZo3K82SD7Riyi0E1EQPojLz7kpepnSQI9IyPbHHg1XXXevb5dJI7tpyN2ADxGcQbHG7vcyRHk0cbwqcQriUtg=="
+ },
+ "semver": {
+ "version": "5.6.0",
+ "resolved": "https://registry.npmjs.org/semver/-/semver-5.6.0.tgz",
+ "integrity": "sha512-RS9R6R35NYgQn++fkDWaOmqGoj4Ek9gGs+DPxNUZKuwE183xjJroKvyo1IzVFeXvUrvmALy6FWD5xrdJT25gMg=="
+ },
+ "setimmediate": {
+ "version": "1.0.5",
+ "resolved": "https://registry.npmjs.org/setimmediate/-/setimmediate-1.0.5.tgz",
+ "integrity": "sha1-KQy7Iy4waULX1+qbg3Mqt4VvgoU="
+ },
+ "source-map": {
+ "version": "0.1.32",
+ "resolved": "https://registry.npmjs.org/source-map/-/source-map-0.1.32.tgz",
+ "integrity": "sha1-yLbBZ3l7pHQKjqMyUhYv8IWRsmY=",
+ "requires": {
+ "amdefine": ">=0.0.4"
+ }
+ },
+ "source-map-support": {
+ "version": "0.2.10",
+ "resolved": "https://registry.npmjs.org/source-map-support/-/source-map-support-0.2.10.tgz",
+ "integrity": "sha1-6lo5AKHByyUJagrozFwrSxDe09w=",
+ "requires": {
+ "source-map": "0.1.32"
+ }
+ },
+ "splitargs": {
+ "version": "0.0.7",
+ "resolved": "https://registry.npmjs.org/splitargs/-/splitargs-0.0.7.tgz",
+ "integrity": "sha1-/p965lc3GzOxDLgNoUPPgknPazs="
+ },
+ "sshpk": {
+ "version": "1.16.0",
+ "resolved": "https://registry.npmjs.org/sshpk/-/sshpk-1.16.0.tgz",
+ "integrity": "sha512-Zhev35/y7hRMcID/upReIvRse+I9SVhyVre/KTJSJQWMz3C3+G+HpO7m1wK/yckEtujKZ7dS4hkVxAnmHaIGVQ==",
+ "requires": {
+ "asn1": "~0.2.3",
+ "assert-plus": "^1.0.0",
+ "bcrypt-pbkdf": "^1.0.0",
+ "dashdash": "^1.12.0",
+ "ecc-jsbn": "~0.1.1",
+ "getpass": "^0.1.1",
+ "jsbn": "~0.1.0",
+ "safer-buffer": "^2.0.2",
+ "tweetnacl": "~0.14.0"
+ }
+ },
+ "string-width": {
+ "version": "1.0.2",
+ "resolved": "https://registry.npmjs.org/string-width/-/string-width-1.0.2.tgz",
+ "integrity": "sha1-EYvfW4zcUaKn5w0hHgfisLmxB9M=",
+ "requires": {
+ "code-point-at": "^1.0.0",
+ "is-fullwidth-code-point": "^1.0.0",
+ "strip-ansi": "^3.0.0"
+ }
+ },
+ "string_decoder": {
+ "version": "0.10.31",
+ "resolved": "https://registry.npmjs.org/string_decoder/-/string_decoder-0.10.31.tgz",
+ "integrity": "sha1-YuIDvEF2bGwoyfyEMB2rHFMQ+pQ="
+ },
+ "strip-ansi": {
+ "version": "3.0.1",
+ "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-3.0.1.tgz",
+ "integrity": "sha1-ajhfuIU9lS1f8F0Oiq+UJ43GPc8=",
+ "requires": {
+ "ansi-regex": "^2.0.0"
+ }
+ },
+ "strip-json-comments": {
+ "version": "2.0.1",
+ "resolved": "https://registry.npmjs.org/strip-json-comments/-/strip-json-comments-2.0.1.tgz",
+ "integrity": "sha1-PFMZQukIwml8DsNEhYwobHygpgo="
+ },
+ "tar": {
+ "version": "4.4.8",
+ "resolved": "https://registry.npmjs.org/tar/-/tar-4.4.8.tgz",
+ "integrity": "sha512-LzHF64s5chPQQS0IYBn9IN5h3i98c12bo4NCO7e0sGM2llXQ3p2FGC5sdENN4cTW48O915Sh+x+EXx7XW96xYQ==",
+ "requires": {
+ "chownr": "^1.1.1",
+ "fs-minipass": "^1.2.5",
+ "minipass": "^2.3.4",
+ "minizlib": "^1.1.1",
+ "mkdirp": "^0.5.0",
+ "safe-buffer": "^5.1.2",
+ "yallist": "^3.0.2"
+ }
+ },
+ "tough-cookie": {
+ "version": "2.4.3",
+ "resolved": "https://registry.npmjs.org/tough-cookie/-/tough-cookie-2.4.3.tgz",
+ "integrity": "sha512-Q5srk/4vDM54WJsJio3XNn6K2sCG+CQ8G5Wz6bZhRZoAe/+TxjWB/GlFAnYEbkYVlON9FMk/fE3h2RLpPXo4lQ==",
+ "requires": {
+ "psl": "^1.1.24",
+ "punycode": "^1.4.1"
+ },
+ "dependencies": {
+ "punycode": {
+ "version": "1.4.1",
+ "resolved": "https://registry.npmjs.org/punycode/-/punycode-1.4.1.tgz",
+ "integrity": "sha1-wNWmOycYgArY4esPpSachN1BhF4="
+ }
+ }
+ },
+ "traceur": {
+ "version": "0.0.111",
+ "resolved": "https://registry.npmjs.org/traceur/-/traceur-0.0.111.tgz",
+ "integrity": "sha1-wE3nTRRpbDNzQn3k/Ajsr5E/w6E=",
+ "requires": {
+ "commander": "2.9.x",
+ "glob": "5.0.x",
+ "rsvp": "^3.0.13",
+ "semver": "^4.3.3",
+ "source-map-support": "~0.2.8"
+ },
+ "dependencies": {
+ "semver": {
+ "version": "4.3.6",
+ "resolved": "https://registry.npmjs.org/semver/-/semver-4.3.6.tgz",
+ "integrity": "sha1-MAvG4OhjdPe6YQaLWx7NV/xlMto="
+ }
+ }
+ },
+ "traverse": {
+ "version": "0.3.9",
+ "resolved": "https://registry.npmjs.org/traverse/-/traverse-0.3.9.tgz",
+ "integrity": "sha1-cXuPIgzAu3tE5AUUwisui7xw2Lk="
+ },
+ "tunnel-agent": {
+ "version": "0.6.0",
+ "resolved": "https://registry.npmjs.org/tunnel-agent/-/tunnel-agent-0.6.0.tgz",
+ "integrity": "sha1-J6XeoGs2sEoKmWZ3SykIaPD8QP0=",
+ "requires": {
+ "safe-buffer": "^5.0.1"
+ }
+ },
+ "tweetnacl": {
+ "version": "0.14.5",
+ "resolved": "https://registry.npmjs.org/tweetnacl/-/tweetnacl-0.14.5.tgz",
+ "integrity": "sha1-WuaBd/GS1EViadEIr6k/+HQ/T2Q="
+ },
+ "typescript": {
+ "version": "3.2.2",
+ "resolved": "https://registry.npmjs.org/typescript/-/typescript-3.2.2.tgz",
+ "integrity": "sha512-VCj5UiSyHBjwfYacmDuc/NOk4QQixbE+Wn7MFJuS0nRuPQbof132Pw4u53dm264O8LPc2MVsc7RJNml5szurkg==",
+ "dev": true
+ },
+ "universalify": {
+ "version": "0.1.2",
+ "resolved": "https://registry.npmjs.org/universalify/-/universalify-0.1.2.tgz",
+ "integrity": "sha512-rBJeI5CXAlmy1pV+617WB9J63U6XcazHHF2f2dbJix4XzpUF0RS3Zbj0FGIOCAva5P/d/GBOYaACQ1w+0azUkg=="
+ },
+ "unzipper": {
+ "version": "0.8.14",
+ "resolved": "https://registry.npmjs.org/unzipper/-/unzipper-0.8.14.tgz",
+ "integrity": "sha512-8rFtE7EP5ssOwGpN2dt1Q4njl0N1hUXJ7sSPz0leU2hRdq6+pra57z4YPBlVqm40vcgv6ooKZEAx48fMTv9x4w==",
+ "requires": {
+ "big-integer": "^1.6.17",
+ "binary": "~0.3.0",
+ "bluebird": "~3.4.1",
+ "buffer-indexof-polyfill": "~1.0.0",
+ "duplexer2": "~0.1.4",
+ "fstream": "~1.0.10",
+ "listenercount": "~1.0.1",
+ "readable-stream": "~2.1.5",
+ "setimmediate": "~1.0.4"
+ },
+ "dependencies": {
+ "bluebird": {
+ "version": "3.4.7",
+ "resolved": "https://registry.npmjs.org/bluebird/-/bluebird-3.4.7.tgz",
+ "integrity": "sha1-9y12C+Cbf3bQjtj66Ysomo0F+rM="
+ },
+ "isarray": {
+ "version": "1.0.0",
+ "resolved": "https://registry.npmjs.org/isarray/-/isarray-1.0.0.tgz",
+ "integrity": "sha1-u5NdSFgsuhaMBoNJV6VKPgcSTxE="
+ },
+ "process-nextick-args": {
+ "version": "1.0.7",
+ "resolved": "https://registry.npmjs.org/process-nextick-args/-/process-nextick-args-1.0.7.tgz",
+ "integrity": "sha1-FQ4gt1ZZCtP5EJPyWk8q2L/zC6M="
+ },
+ "readable-stream": {
+ "version": "2.1.5",
+ "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-2.1.5.tgz",
+ "integrity": "sha1-ZvqLcg4UOLNkaB8q0aY8YYRIydA=",
+ "requires": {
+ "buffer-shims": "^1.0.0",
+ "core-util-is": "~1.0.0",
+ "inherits": "~2.0.1",
+ "isarray": "~1.0.0",
+ "process-nextick-args": "~1.0.6",
+ "string_decoder": "~0.10.x",
+ "util-deprecate": "~1.0.1"
+ }
+ }
+ }
+ },
+ "uri-js": {
+ "version": "4.2.2",
+ "resolved": "https://registry.npmjs.org/uri-js/-/uri-js-4.2.2.tgz",
+ "integrity": "sha512-KY9Frmirql91X2Qgjry0Wd4Y+YTdrdZheS8TFwvkbLWf/G5KNJDCh6pKL5OZctEW4+0Baa5idK2ZQuELRwPznQ==",
+ "requires": {
+ "punycode": "^2.1.0"
+ }
+ },
+ "url-join": {
+ "version": "0.0.1",
+ "resolved": "https://registry.npmjs.org/url-join/-/url-join-0.0.1.tgz",
+ "integrity": "sha1-HbSK1CLTQCRpqH99l73r/k+x48g="
+ },
+ "util-deprecate": {
+ "version": "1.0.2",
+ "resolved": "https://registry.npmjs.org/util-deprecate/-/util-deprecate-1.0.2.tgz",
+ "integrity": "sha1-RQ1Nyfpw3nMnYvvS1KKJgUGaDM8="
+ },
+ "uuid": {
+ "version": "3.3.2",
+ "resolved": "https://registry.npmjs.org/uuid/-/uuid-3.3.2.tgz",
+ "integrity": "sha512-yXJmeNaw3DnnKAOKJE51sL/ZaYfWJRl1pK9dr19YFCu0ObS231AB1/LbqTKRAQ5kw8A90rA6fr4riOUpTZvQZA=="
+ },
+ "verror": {
+ "version": "1.10.0",
+ "resolved": "https://registry.npmjs.org/verror/-/verror-1.10.0.tgz",
+ "integrity": "sha1-OhBcoXBTr1XW4nDB+CiGguGNpAA=",
+ "requires": {
+ "assert-plus": "^1.0.0",
+ "core-util-is": "1.0.2",
+ "extsprintf": "^1.2.0"
+ }
+ },
+ "which": {
+ "version": "1.3.1",
+ "resolved": "https://registry.npmjs.org/which/-/which-1.3.1.tgz",
+ "integrity": "sha512-HxJdYWq1MTIQbJ3nw0cqssHoTNU267KlrDuGZ1WYlxDStUtKUhOaJmh112/TZmHxxUfuJqPXSOm7tDyas0OSIQ==",
+ "requires": {
+ "isexe": "^2.0.0"
+ }
+ },
+ "window-size": {
+ "version": "0.1.4",
+ "resolved": "https://registry.npmjs.org/window-size/-/window-size-0.1.4.tgz",
+ "integrity": "sha1-+OGqHuWlPsW/FR/6CXQqatdpeHY="
+ },
+ "wrap-ansi": {
+ "version": "2.1.0",
+ "resolved": "https://registry.npmjs.org/wrap-ansi/-/wrap-ansi-2.1.0.tgz",
+ "integrity": "sha1-2Pw9KE3QV5T+hJc8rs3Rz4JP3YU=",
+ "requires": {
+ "string-width": "^1.0.1",
+ "strip-ansi": "^3.0.1"
+ }
+ },
+ "wrappy": {
+ "version": "1.0.2",
+ "resolved": "https://registry.npmjs.org/wrappy/-/wrappy-1.0.2.tgz",
+ "integrity": "sha1-tSQ9jz7BqjXxNkYFvA0QNuMKtp8="
+ },
+ "y18n": {
+ "version": "3.2.1",
+ "resolved": "https://registry.npmjs.org/y18n/-/y18n-3.2.1.tgz",
+ "integrity": "sha1-bRX7qITAhnnA136I53WegR4H+kE="
+ },
+ "yallist": {
+ "version": "3.0.3",
+ "resolved": "https://registry.npmjs.org/yallist/-/yallist-3.0.3.tgz",
+ "integrity": "sha512-S+Zk8DEWE6oKpV+vI3qWkaK+jSbIK86pCwe2IF/xwIpQ8jEuxpw9NyaGjmp9+BoJv5FV2piqCDcoCtStppiq2A=="
+ },
+ "yargs": {
+ "version": "3.32.0",
+ "resolved": "https://registry.npmjs.org/yargs/-/yargs-3.32.0.tgz",
+ "integrity": "sha1-AwiOnr+edWtpdRYR0qXvWRSCyZU=",
+ "requires": {
+ "camelcase": "^2.0.1",
+ "cliui": "^3.0.3",
+ "decamelize": "^1.1.1",
+ "os-locale": "^1.4.0",
+ "string-width": "^1.0.1",
+ "window-size": "^0.1.4",
+ "y18n": "^3.2.0"
+ }
+ }
+ }
+}
diff -Nru opencamlib-11.10+git201801200005~ubuntu16.04.1/.pc/applied-patches opencamlib-11.10-1/.pc/applied-patches
--- opencamlib-11.10+git201801200005~ubuntu16.04.1/.pc/applied-patches 1970-01-01 00:00:00.000000000 +0000
+++ opencamlib-11.10-1/.pc/applied-patches 2020-06-14 12:13:21.000000000 +0000
@@ -0,0 +1 @@
+001-Set-Version.diff
diff -Nru opencamlib-11.10+git201801200005~ubuntu16.04.1/.pc/.quilt_patches opencamlib-11.10-1/.pc/.quilt_patches
--- opencamlib-11.10+git201801200005~ubuntu16.04.1/.pc/.quilt_patches 1970-01-01 00:00:00.000000000 +0000
+++ opencamlib-11.10-1/.pc/.quilt_patches 2020-06-14 12:13:21.000000000 +0000
@@ -0,0 +1 @@
+/home/buildd/build-RECIPEBRANCHBUILD-2587511/chroot-autobuild/home/buildd/work/tree/recipe/debian/patches
diff -Nru opencamlib-11.10+git201801200005~ubuntu16.04.1/.pc/.quilt_series opencamlib-11.10-1/.pc/.quilt_series
--- opencamlib-11.10+git201801200005~ubuntu16.04.1/.pc/.quilt_series 1970-01-01 00:00:00.000000000 +0000
+++ opencamlib-11.10-1/.pc/.quilt_series 2020-06-14 12:13:21.000000000 +0000
@@ -0,0 +1 @@
+/home/buildd/build-RECIPEBRANCHBUILD-2587511/chroot-autobuild/home/buildd/work/tree/recipe/debian/patches/series
diff -Nru opencamlib-11.10+git201801200005~ubuntu16.04.1/.pc/.version opencamlib-11.10-1/.pc/.version
--- opencamlib-11.10+git201801200005~ubuntu16.04.1/.pc/.version 1970-01-01 00:00:00.000000000 +0000
+++ opencamlib-11.10-1/.pc/.version 2020-06-14 12:13:21.000000000 +0000
@@ -0,0 +1 @@
+2
diff -Nru opencamlib-11.10+git201801200005~ubuntu16.04.1/README opencamlib-11.10-1/README
--- opencamlib-11.10+git201801200005~ubuntu16.04.1/README 2018-01-20 00:05:22.000000000 +0000
+++ opencamlib-11.10-1/README 1970-01-01 00:00:00.000000000 +0000
@@ -1,83 +0,0 @@
-OpenCAMLib README
-
-1. INTRODUCTION
-OpenCAMLib (ocl) is a c++ library for creating toolpaths for cnc-machines
-such as mills and lathes.
-
-The OpenCAMLib code is hosted at:
-https://github.com/aewallin/opencamlib
-
-The mailing-list for general development and user-discussion is:
-http://groups.google.com/group/opencamlib
-
-IRC-channel #cam on irc.freenode.net
-
-It's probably a good idea to try to adhere to some coding standard. Maybe this one:
-http://www.possibility.com/Cpp/CppCodingStandard.html
-
-
-2. CLONING, BUILDING and INSTALLING (on unix/debian-like systems)
- $ git clone git://github.com/aewallin/opencamlib.git
- $ cd opencamlib
- $ mkdir build
- $ cd build
- $ cmake ../src
- $ make (try make -j4 for a faster build if you have a multi-core machine)
- $ sudo make install
-will install the ocl.so library and camvtk.py so that any python shell will find them.
-
-if you also want to build the documentation, then run
- $ make doc
- $> make doc-pdf
-this should create the ocl manual named "ocl-manual.pdf" in the build/doc directory
-
-using cmake and cpack it is possible to build a binary .deb package with
- $ make package
-For uploading debian source-packages to the PPA there is also a custom target
- $ make spackage
-
-The build directory opencamlib/build can be wiped clean ("rm -rf *") and cmake run
-again if/when you want a clean build.
-
-3. ORGANIZATION OF FILES
-(generate this with 'tree -dL 2')
-
-├── cpp_examples c++ example use of opencamlib
-│  ├── point minimal example of ocl::Point
-├── debian files for building a debian package
-├── doc documentation (not much here yet!)
-├── lib useful python helper libraries
-├── scripts python scripts that test or demonstrate use of ocl
-│  ├── issues
-│  ├── ocode old linear octree code
-│  ├── offset-ellipse relates to BullCutter drop- and push-cutter
-│  ├── old
-│  └── voronoi vd scripts/tests
-├── src
-│  ├── algo algorithms under development
-│  ├── attic old deprecated code
-│  ├── common common algorithms and data-structures
-│  ├── cutters cutter-classes
-│  ├── dropcutter drop-cutter algorithms and operations
-│  ├── geo primitive geometry classes (point,triangle,stlsurf, etc.)
-│  └── voronoi
-├── stl STL files for testing
-└── Windows Visual-studio project for building on windows
-
-
-3. Ubuntu 10.04LTS-> install and build
-- install 64-bit Ubuntu 10.04LTS
-- run update manager and install all suggested updates. reboot.
-- using synaptic or apt-get, install the following packages(and their dependencies)
--- build-essential
--- cmake
--- subversion
--- doxygen
--- texlive-latex-base
--- libboost-all-dev
-- checkout ocl from svn
--- instructions: http://code.google.com/p/opencamlib/source/checkout
-- in the /src directory, first run "cmake ." then "make" and then "sudo make install"
--- this should build and install ocl correctly.
-
-
diff -Nru opencamlib-11.10+git201801200005~ubuntu16.04.1/README.rst opencamlib-11.10-1/README.rst
--- opencamlib-11.10+git201801200005~ubuntu16.04.1/README.rst 1970-01-01 00:00:00.000000000 +0000
+++ opencamlib-11.10-1/README.rst 2020-06-14 12:13:19.000000000 +0000
@@ -0,0 +1,123 @@
+.. image:: https://img.shields.io/badge/License-LGPL%20v2.1-blue.svg
+ :target: https://www.gnu.org/licenses/old-licenses/lgpl-2.1.en.html
+
+.. image:: https://travis-ci.org/aewallin/opencamlib.svg?branch=master
+ :target: https://travis-ci.org/aewallin/opencamlib
+
+.. image:: https://readthedocs.org/projects/opencamlib/badge/?version=latest
+ :target: https://opencamlib.readthedocs.io/en/latest/?badge=latest
+ :alt: Documentation Status
+
+OpenCAMLib README
+=================
+
+
+
+INTRODUCTION
+---------------
+
+OpenCAMLib (ocl) is a c++ library with python bindings for creating 3D toolpaths for cnc-machines
+such as mills and lathes. From August 2018 OpenCAMLib is released under LGPL license.
+
+- repository https://github.com/aewallin/opencamlib
+- mailing-list http://groups.google.com/group/opencamlib
+- IRC-channel #cam on irc.freenode.net
+- coding standard (?) http://www.possibility.com/Cpp/CppCodingStandard.html
+
+
+BUILDING and INSTALLING
+-----------------------
+
+to clone, build and install install the ocl.so library and camvtk.py run the following::
+
+ $ git clone git://github.com/aewallin/opencamlib.git
+ $ cd opencamlib
+ $ mkdir build
+ $ cd build
+ $ sudo apt install cmake
+ $ sudo apt install libboost-program-options-dev
+ $ sudo apt install doxygen
+ $ sudo apt install texlive-full
+ $ cmake ../src
+ $ make (try make -j4 for a faster build if you have a multi-core machine)
+ $ sudo make install
+
+if you also want to build the documentation, then run::
+
+ $ make doc
+ $ make doc-pdf
+
+this should create the ocl manual named "ocl-manual.pdf" in the build/doc directory
+
+using cmake and cpack it is possible to build a binary .deb package with::
+
+ $ make package
+
+For uploading debian source-packages to the PPA there is also a custom target::
+
+ $ make spackage
+
+The build directory opencamlib/build can be wiped clean ("rm -rf *") and cmake run
+again if/when you want a clean build.
+
+ORGANIZATION OF FILES
+---------------------
+
+(generate this with 'tree -dL 2')::
+
+ ├── cpp_examples c++ example use of opencamlib
+ │  ├── point minimal example of ocl::Point
+ ├── debian files for building a debian package
+ ├── doc documentation (not much here yet!)
+ ├── lib useful python helper libraries
+ ├── scripts python scripts that test or demonstrate use of ocl
+ │  ├── issues
+ │  ├── ocode old linear octree code
+ │  ├── offset-ellipse relates to BullCutter drop- and push-cutter
+ │  ├── old
+ │  └── voronoi vd scripts/tests
+ ├── src
+ │  ├── algo algorithms under development
+ │  ├── attic old deprecated code
+ │  ├── common common algorithms and data-structures
+ │  ├── cutters cutter-classes
+ │  ├── dropcutter drop-cutter algorithms and operations
+ │  ├── geo primitive geometry classes (point,triangle,stlsurf, etc.)
+ │  └── voronoi
+ ├── stl STL files for testing
+ └── Windows Visual-studio project for building on windows
+
+
+Ubuntu 10.04LTS-> install and build
+-----------------------------------
+
+(these notes are about 8 years old now and should be updated for relevant OSs)
+
+- install 64-bit Ubuntu 10.04LTS
+- run update manager and install all suggested updates. reboot.
+- using synaptic or apt-get, install the following packages(and their dependencies)
+ - build-essential
+ - cmake
+ - subversion
+ - doxygen
+ - texlive-latex-base
+ - libboost-all-dev
+- checkout ocl from svn
+ - instructions: http://code.google.com/p/opencamlib/source/checkout
+- in the /src directory, first run "cmake ." then "make" and then "sudo make install"
+ - this should build and install ocl correctly.
+
+
+DOCKER BUILD
+-----------------------
+
+To run this in Docker, simply run::
+
+ $ docker build . -t opencamlib
+ $ docker run -it -p 5900:5900 -e VNC_SERVER_PASSWORD=TestVNC --user cam --privileged opencamlib
+
+Then simply open up a VNC socket connection. With Mac, you can just open Finder, then run CMD + K.
+
+Type in "vnc://localhost:5900" as the server address, and type "TestVNC" as the password.
+
+Right click on the desktop terminal that shows up and you can open up a terminal inside there. This is a easy and quick way to get started with opencamlib, while still maintaining all the functionality
diff -Nru opencamlib-11.10+git201801200005~ubuntu16.04.1/scripts/batchdropcutter_mtrush.py opencamlib-11.10-1/scripts/batchdropcutter_mtrush.py
--- opencamlib-11.10+git201801200005~ubuntu16.04.1/scripts/batchdropcutter_mtrush.py 2018-01-20 00:05:22.000000000 +0000
+++ opencamlib-11.10-1/scripts/batchdropcutter_mtrush.py 1970-01-01 00:00:00.000000000 +0000
@@ -1,97 +0,0 @@
-import ocl
-import pyocl
-import camvtk
-import time
-import vtk
-import datetime
-import math
-
-if __name__ == "__main__":
- print ocl.version()
- myscreen = camvtk.VTKScreen()
-
- #stl = camvtk.STLSurf("../stl/gnu_tux_mod.stl")
- #stl = camvtk.STLSurf("../stl/mount_rush.stl")
- stl = camvtk.STLSurf("../stl/pycam-textbox.stl")
- myscreen.addActor(stl)
- stl.SetWireframe()
- stl.SetColor((0.5,0.5,0.5))
-
- polydata = stl.src.GetOutput()
- s = ocl.STLSurf()
- camvtk.vtkPolyData2OCLSTL(polydata, s)
- print "STL surface with", s.size(), "triangles read"
-
- # define a cutter
- length=5
- cutter = ocl.BallCutter(15.4321, length)
- #cutter = ocl.CylCutter(1.123, length)
- #cutter = ocl.BullCutter(1.123, 0.2, length)
- #cutter = ocl.ConeCutter(0.43, math.pi/7, length)
-
-
- print cutter
-
- #define grid of CL-points
- minx=-42
- dx=2
- maxx=47
- miny=-27
- dy=1
- maxy=20
- z=-55
- clpoints = pyocl.CLPointGrid(minx,dx,maxx,miny,dy,maxy,z)
- print "generated grid with", len(clpoints)," CL-points"
-
- # batchdropcutter
- bdc1 = ocl.BatchDropCutter()
- bdc1.setSTL(s)
- bdc1.setCutter(cutter)
-
- # push the points to ocl
- for p in clpoints:
- bdc1.appendPoint(p)
-
- # run the actual calculation
- t_before = time.time()
- bdc1.run()
- t_after = time.time()
- calctime = t_after-t_before
- print " done in ", calctime," s"
-
-
- # get back results from ocl
- clpts = bdc1.getCLPoints()
-
-
- # draw the results
- print "rendering...",
- camvtk.drawCLPointCloud(myscreen, clpts)
- print "done"
-
- myscreen.camera.SetPosition(25, 23, 15)
- myscreen.camera.SetFocalPoint(4, 5, 0)
-
- # ocl text
- t = camvtk.Text()
- t.SetText("OpenCAMLib")
- t.SetPos( (myscreen.width-200, myscreen.height-30) )
- myscreen.addActor( t)
-
- # other text
- t2 = camvtk.Text()
- stltext = "%i triangles\n%i CL-points\n%0.1f seconds" % (s.size(), len(clpts), calctime)
- t2.SetText(stltext)
- t2.SetPos( (50, myscreen.height-100) )
- myscreen.addActor( t2)
-
- t3 = camvtk.Text()
- ctext = "Cutter: %s" % ( str(cutter) )
-
- t3.SetText(ctext)
- t3.SetPos( (50, myscreen.height-150) )
- myscreen.addActor( t3)
-
- myscreen.render()
- myscreen.iren.Start()
- raw_input("Press Enter to terminate")
diff -Nru opencamlib-11.10+git201801200005~ubuntu16.04.1/scripts/batchdropcutter_test_1.py opencamlib-11.10-1/scripts/batchdropcutter_test_1.py
--- opencamlib-11.10+git201801200005~ubuntu16.04.1/scripts/batchdropcutter_test_1.py 2018-01-20 00:05:22.000000000 +0000
+++ opencamlib-11.10-1/scripts/batchdropcutter_test_1.py 1970-01-01 00:00:00.000000000 +0000
@@ -1,99 +0,0 @@
-import ocl
-import pyocl
-import camvtk
-import time
-import vtk
-import datetime
-
-
-
-if __name__ == "__main__":
- print ocl.version()
- myscreen = camvtk.VTKScreen()
-
- #stl = camvtk.STLSurf("../stl/gnu_tux_mod.stl")
- stl = camvtk.STLSurf("../stl/demo.stl")
- myscreen.addActor(stl)
- stl.SetWireframe()
- stl.SetColor((0.5,0.5,0.5))
-
- polydata = stl.src.GetOutput()
- s = ocl.STLSurf()
- camvtk.vtkPolyData2OCLSTL(polydata, s)
- print "STL surface read,", s.size(), "triangles"
- length=5
- cutter = ocl.BallCutter(1.4321, length)
- #cutter = ocl.CylCutter(1.123, length)
- #cutter = ocl.BullCutter(1.123, 0.2, length)
- print cutter
-
- minx=0
- dx=0.1/6
- maxx=10
- miny=0
- dy=1
- maxy=10
- z=-17
- # this generates a list of CL-points in a grid
- clpoints = pyocl.CLPointGrid(minx,dx,maxx,miny,dy,maxy,z)
- print "generated grid with", len(clpoints)," CL-points"
-
- # batchdropcutter
- bdc1 = ocl.BatchDropCutter()
- bdc1.setSTL(s)
- bdc1.setCutter(cutter)
- for p in clpoints:
- bdc1.appendPoint(p)
-
- t_before = time.time()
- print "threads=",bdc1.getThreads()
- bdc1.run()
- t_after = time.time()
- calctime = t_after-t_before
- print " done in ", calctime," s"
-
- clpoints = bdc1.getCLPoints()
-
- print len(clpoints), " cl points evaluated"
-
- print "rendering...",
-
- # draw the CL-points
- camvtk.drawCLPointCloud(myscreen, clpoints)
-
- print "done"
-
- myscreen.camera.SetPosition(3, 23, 15)
- myscreen.camera.SetFocalPoint(4, 5, 0)
-
-
- w2if = vtk.vtkWindowToImageFilter()
- w2if.SetInput(myscreen.renWin)
- lwr = vtk.vtkPNGWriter()
- lwr.SetInput( w2if.GetOutput() )
- w2if.Modified()
- lwr.SetFileName("tux1.png")
- #lwr.Write()
-
- t = camvtk.Text()
- t.SetText("OpenCAMLib")
- t.SetPos( (myscreen.width-200, myscreen.height-30) )
- myscreen.addActor( t)
-
- t2 = camvtk.Text()
- stltext = "%i triangles\n%i CL-points\n%0.1f seconds" % (s.size(), len(clpoints), calctime)
- t2.SetText(stltext)
- t2.SetPos( (50, myscreen.height-200) )
- myscreen.addActor( t2)
-
- t3 = camvtk.Text()
- ctext = "Cutter: %s" % ( str(cutter) )
-
- t3.SetText(ctext)
- t3.SetPos( (50, myscreen.height-250) )
- myscreen.addActor( t3)
-
- myscreen.render()
- myscreen.iren.Start()
- raw_input("Press Enter to terminate")
-
diff -Nru opencamlib-11.10+git201801200005~ubuntu16.04.1/scripts/batchdropcutter_test_2.py opencamlib-11.10-1/scripts/batchdropcutter_test_2.py
--- opencamlib-11.10+git201801200005~ubuntu16.04.1/scripts/batchdropcutter_test_2.py 2018-01-20 00:05:22.000000000 +0000
+++ opencamlib-11.10-1/scripts/batchdropcutter_test_2.py 1970-01-01 00:00:00.000000000 +0000
@@ -1,82 +0,0 @@
-import ocl
-import pyocl
-import camvtk
-import time
-import vtk
-import datetime
-import math
-
-if __name__ == "__main__":
- print ocl.version()
- myscreen = camvtk.VTKScreen()
- stl = camvtk.STLSurf("../stl/gnu_tux_mod.stl")
- #stl = camvtk.STLSurf("../stl/beet_mm.stl")
- #stl = camvtk.STLSurf("../stl/Blade.stl")
- myscreen.addActor(stl)
- stl.SetWireframe()
- stl.SetColor((0.5,0.5,0.5))
-
- polydata = stl.src.GetOutput()
- s = ocl.STLSurf()
- camvtk.vtkPolyData2OCLSTL(polydata, s)
- print "STL surface read ", s.size(), " triangles"
- length=5
- cutter = ocl.BallCutter(1.4321, length)
- #cutter = ocl.CylCutter(1.123, length)
- #cutter = ocl.BullCutter(1.4123, 0.5, length)
- #cutter = ocl.ConeCutter(0.43, math.pi/7, length)
- print cutter
-
- minx=0
- dx=0.06
- maxx=9
- miny=0
- dy=1
- maxy=12
- z=-5
- clpoints = pyocl.CLPointGrid(minx,dx,maxx,miny,dy,maxy,z)
- print "generated grid with", len(clpoints)," CL-points"
-
- # batchdropcutter
- bdc1 = ocl.BatchDropCutter()
- bdc1.setSTL(s)
- bdc1.setCutter(cutter)
-
- for p in clpoints:
- bdc1.appendPoint(p)
-
- t_before = time.time()
- bdc1.run()
- t_after = time.time()
- calctime = t_after-t_before
- print " done in ", calctime," s"
-
- clpts = bdc1.getCLPoints()
- print "rendering...",
- camvtk.drawCLPointCloud(myscreen, clpts)
- print "done"
-
- myscreen.camera.SetPosition(3, 23, 15)
- myscreen.camera.SetFocalPoint(4, 5, 0)
-
- t = camvtk.Text()
- t.SetText("OpenCAMLib")
- t.SetPos( (myscreen.width-200, myscreen.height-30) )
- myscreen.addActor( t)
-
- t2 = camvtk.Text()
- stltext = "%i triangles\n%i CL-points\n%0.1f seconds" % (s.size(), len(clpts), calctime)
- t2.SetText(stltext)
- t2.SetPos( (50, myscreen.height-200) )
- myscreen.addActor( t2)
-
- t3 = camvtk.Text()
- ctext = "Cutter: %s" % ( str(cutter) )
-
- t3.SetText(ctext)
- t3.SetPos( (50, myscreen.height-250) )
- myscreen.addActor( t3)
-
- myscreen.render()
- myscreen.iren.Start()
- raw_input("Press Enter to terminate")
diff -Nru opencamlib-11.10+git201801200005~ubuntu16.04.1/scripts/batchdropcutter_with_linefilter_test_1.py opencamlib-11.10-1/scripts/batchdropcutter_with_linefilter_test_1.py
--- opencamlib-11.10+git201801200005~ubuntu16.04.1/scripts/batchdropcutter_with_linefilter_test_1.py 2018-01-20 00:05:22.000000000 +0000
+++ opencamlib-11.10-1/scripts/batchdropcutter_with_linefilter_test_1.py 1970-01-01 00:00:00.000000000 +0000
@@ -1,126 +0,0 @@
-import ocl
-import pyocl
-import camvtk
-import time
-import vtk
-import datetime
-import math
-
-if __name__ == "__main__":
- print ocl.version()
- myscreen = camvtk.VTKScreen()
- #stl = camvtk.STLSurf("../stl/Cylinder_1.stl")
- stl = camvtk.STLSurf("../stl/gnu_tux_mod.stl")
- #stl = camvtk.STLSurf("../stl/demo.stl")
- myscreen.addActor(stl)
- stl.SetWireframe()
- stl.SetColor((0.5,0.5,0.5))
-
- polydata = stl.src.GetOutput()
- s = ocl.STLSurf()
- camvtk.vtkPolyData2OCLSTL(polydata, s)
- print "STL surface read,", s.size(), "triangles"
-
- angle = math.pi/4
- diameter=1.77321
- length=5
- #cutter = ocl.BallCutter(diameter, length)
- cutter = ocl.CylCutter(diameter, length)
- #cutter = ocl.BullCutter(diameter, 0.2, length)
- #cutter = ocl.ConeCutter(diameter, angle, length)
- #cutter = cutter.offsetCutter( 0.4 )
-
- print cutter
-
- minx=-1
- dx=0.1/5
-
- maxx=10
- miny=-1
- dy=1/float(2)
- maxy=13
- z=-1
- # this generates a list of CL-points in a grid
- clpoints = pyocl.CLPointGrid(minx,dx,maxx,miny,dy,maxy,z)
- print "generated grid with", len(clpoints)," CL-points"
-
- # batchdropcutter
- bdc = ocl.BatchDropCutter()
- #bdc.setThreads(1)
- print "bdc()"
- bdc.setBucketSize(2)
- print "bucketSize"
- bdc.setSTL(s)
- print "setSTL()"
- bdc.setCutter(cutter)
- print "setCutter()"
- #bdc.setThreads(1) # explicitly setting one thread is better for debugging
- for p in clpoints:
- bdc.appendPoint(p)
- print "bdc has ",len(clpoints)," cl-points"
-
- t_before = time.time()
- bdc.run() # run the actual drop-cutter
- dc_calls = bdc.getCalls()
- t_after = time.time()
- calctime = t_after-t_before
- print " BDC done in ", calctime," s", dc_calls," dc-calls"
- dropcutter_time = calctime
- clpoints = bdc.getCLPoints()
-
- #print len(clpoints), " cl points evaluated"
-
- print "rendering raw CL-points."
-
- # draw the CL-points
- camvtk.drawCLPointCloud(myscreen, clpoints)
-
- # filter
- print "filtering. before filter we have", len(clpoints),"cl-points"
- t_before = time.time()
- f = ocl.LineCLFilter()
- f.setTolerance(0.001)
- for p in clpoints:
- f.addCLPoint(p)
- f.run()
- t_after = time.time()
- calctime = t_after-t_before
- print " done in ", calctime," s"
-
- clp2 = f.getCLPoints()
- print "after filtering we have", len(clp2),"cl-points"
-
- # draw the filtered points
- # offset these points up for clarity
- for p in clp2:
- p.z=p.z+3
-
- print "rendering filtered CL-points."
- camvtk.drawCLPointCloud(myscreen, clp2)
- print "all done."
- myscreen.camera.SetPosition(3, 23, 15)
- myscreen.camera.SetFocalPoint(4, 5, 0)
- w2if = vtk.vtkWindowToImageFilter()
- w2if.SetInput(myscreen.renWin)
- lwr = vtk.vtkPNGWriter()
- lwr.SetInput( w2if.GetOutput() )
- w2if.Modified()
- lwr.SetFileName("tux1.png")
- #lwr.Write()
-
- t = camvtk.Text()
- t.SetText("OpenCAMLib")
- t.SetPos( (myscreen.width-200, myscreen.height-30) )
- myscreen.addActor( t)
-
- t2 = camvtk.Text()
- stltext = "%s\n%i triangles\n%i CL-points\n%i DropCutter() calls\n%0.1f seconds\n%0.3f us/call\n%i filtered CL-points" \
- % ( str(cutter), s.size(), len(clpoints), dc_calls, dropcutter_time, 1e6* dropcutter_time/dc_calls, len(clp2) )
- t2.SetText(stltext)
- t2.SetPos( (50, myscreen.height-200) )
- myscreen.addActor( t2)
-
- myscreen.render()
- myscreen.iren.Start()
- raw_input("Press Enter to terminate")
-
diff -Nru opencamlib-11.10+git201801200005~ubuntu16.04.1/scripts/clsurf_1.py opencamlib-11.10-1/scripts/clsurf_1.py
--- opencamlib-11.10+git201801200005~ubuntu16.04.1/scripts/clsurf_1.py 2018-01-20 00:05:22.000000000 +0000
+++ opencamlib-11.10-1/scripts/clsurf_1.py 1970-01-01 00:00:00.000000000 +0000
@@ -1,93 +0,0 @@
-import ocl
-import camvtk
-import time
-import vtk
-import datetime
-import math
-import random
-
-def drawVertex(myscreen, p, vertexColor, rad=0.1):
- myscreen.addActor( camvtk.Sphere( center=(p.x,p.y,p.z), radius=rad, color=vertexColor ) )
-
-def drawEdge(myscreen, e, edgeColor=camvtk.yellow):
- p1 = e[0]
- p2 = e[1]
- myscreen.addActor( camvtk.Line( p1=( p1.x,p1.y,p1.z), p2=(p2.x,p2.y,p2.z), color=edgeColor ) )
-
-#def drawFarCircle(myscreen, r, circleColor):
-# myscreen.addActor( camvtk.Circle( center=(0,0,0), radius=r, color=circleColor ) )
-
-def drawDiagram( myscreen, diag ):
- #drawFarCircle(myscreen, vd.getFarRadius(), camvtk.pink)
- for v in diag.getVertices():
- drawVertex(myscreen, v, camvtk.green)
- edges = diag.getEdges()
- for e in edges:
- drawEdge(myscreen,e, camvtk.cyan)
-
-def writeFrame( w2if, lwr, n ):
- w2if.Modified()
- lwr.SetFileName("frames/vd500_zoomout"+ ('%05d' % n)+".png")
- lwr.Write()
-
-if __name__ == "__main__":
- print ocl.version()
- myscreen = camvtk.VTKScreen()
-
-
- camvtk.drawOCLtext(myscreen)
-
- w2if = vtk.vtkWindowToImageFilter()
- w2if.SetInput(myscreen.renWin)
- lwr = vtk.vtkPNGWriter()
- lwr.SetInput( w2if.GetOutput() )
- #w2if.Modified()
- #lwr.SetFileName("tux1.png")
-
-# SURFACE
-
- #stl = camvtk.STLSurf("../stl/Cylinder_1.stl")
- #stl = camvtk.STLSurf("../stl/gnu_tux_mod.stl")
- stl = camvtk.STLSurf("../stl/demo.stl")
- myscreen.addActor(stl)
- stl.SetWireframe()
- stl.SetColor((0.5,0.5,0.5))
-
- polydata = stl.src.GetOutput()
- s = ocl.STLSurf()
- camvtk.vtkPolyData2OCLSTL(polydata, s)
- print "STL surface read,", s.size(), "triangles"
-
-
- far = 20
- # far = 0.000002 generator 52 face_count crash
- # far = 0.000010 crashes at n=192
-
- camPos = 2* far
- myscreen.camera.SetPosition(camPos/1000, camPos/1000, camPos)
- myscreen.camera.SetClippingRange(-2*camPos,2*camPos)
- myscreen.camera.SetFocalPoint(0.051, 0, 0)
-
- cls = ocl.CutterLocationSurface(10)
-
- cutter = ocl.BallCutter(2,10)
- cls.setCutter(cutter)
- cls.setSampling(1)
- cls.setMinSampling(0.1)
- cls.setSTL(s)
-
- drawDiagram(myscreen, cls)
- #vd = ocl.VoronoiDiagram(far,1200)
-
- #vod = VD(myscreen,vd,scale)
- #vod.setAll(vd)
- #drawFarCircle(myscreen, scale*vd.getFarRadius(), camvtk.orange)
-
-
-
- print "PYTHON All DONE."
-
-
-
- myscreen.render()
- myscreen.iren.Start()
diff -Nru opencamlib-11.10+git201801200005~ubuntu16.04.1/scripts/cutter_shapes.py opencamlib-11.10-1/scripts/cutter_shapes.py
--- opencamlib-11.10+git201801200005~ubuntu16.04.1/scripts/cutter_shapes.py 2018-01-20 00:05:22.000000000 +0000
+++ opencamlib-11.10-1/scripts/cutter_shapes.py 1970-01-01 00:00:00.000000000 +0000
@@ -1,165 +0,0 @@
-import ocl
-import camvtk
-import time
-import vtk
-import datetime
-import math
-
-def drawLoops(myscreen, loops, loopcolor):
- nloop = 0
- for lop in loops:
- n = 0
- N = len(lop)
- first_point=ocl.Point(-1,-1,5)
- previous=ocl.Point(-1,-1,5)
- for p in lop:
- if n==0: # don't draw anything on the first iteration
- previous=p
- first_point = p
- elif n== (N-1): # the last point
- myscreen.addActor( camvtk.Line(p1=(previous.x,previous.y,previous.z),p2=(p.x,p.y,p.z),color=loopcolor) ) # the normal line
- # and a line from p to the first point
- myscreen.addActor( camvtk.Line(p1=(p.x,p.y,p.z),p2=(first_point.x,first_point.y,first_point.z),color=loopcolor) )
- else:
- myscreen.addActor( camvtk.Line(p1=(previous.x,previous.y,previous.z),p2=(p.x,p.y,p.z),color=loopcolor) )
- previous=p
- n=n+1
- print "rendered loop ",nloop, " with ", len(lop), " points"
- nloop = nloop+1
-
-def getWaterline(s, cutter, zh, sampling):
- wl = ocl.Waterline()
- #wl.setThreads(1) # single thread for easier debug
- wl.setSTL(s)
- wl.setCutter(cutter)
- wl.setZ(zh)
- wl.setSampling(sampling)
- wl.run()
- loops = wl.getLoops()
- return loops
-
-def getPathsY(s,cutter,sampling,y):
- #apdc = ocl.PathDropCutter()
- apdc = ocl.AdaptivePathDropCutter()
- apdc.setSTL(s)
- apdc.setCutter(cutter)
- apdc.setZ( -20 )
- apdc.setSampling(sampling)
- apdc.setMinSampling(sampling/700)
- path = ocl.Path()
- p1 = ocl.Point(-1.52*cutter.getDiameter() , y,-111) # start-point of line
- p2 = ocl.Point(+1.52*cutter.getDiameter(), y,-111) # end-point of line
- l = ocl.Line(p1,p2) # line-object
- path.append( l )
- apdc.setPath( path )
- apdc.run()
- return apdc.getCLPoints()
-
-def getPathsX(s,cutter,sampling,x):
- #apdc = ocl.PathDropCutter()
- apdc = ocl.AdaptivePathDropCutter()
- apdc.setSTL(s)
- apdc.setCutter(cutter)
- apdc.setZ( -20 )
- apdc.setSampling(sampling)
- apdc.setMinSampling(sampling/700)
- path = ocl.Path()
- p1 = ocl.Point(x, -1.52*cutter.getDiameter() , -111) # start-point of line
- p2 = ocl.Point(x, +1.52*cutter.getDiameter(), -111) # end-point of line
- l = ocl.Line(p1,p2) # line-object
- path.append( l )
- apdc.setPath( path )
- apdc.run()
- return apdc.getCLPoints()
-
-if __name__ == "__main__":
- print ocl.revision()
- myscreen = camvtk.VTKScreen()
- #stl = camvtk.STLSurf("../stl/demo.stl")
- #stl = camvtk.STLSurf("../stl/30sphere.stl")
- #myscreen.addActor(stl)
-
- base=0.1
- tip=10
- a=ocl.Point(base,0,-tip)
- myscreen.addActor(camvtk.Point(center=(a.x,a.y,a.z), color=(1,0,1)));
- b=ocl.Point(-base,0,-tip)
- myscreen.addActor(camvtk.Point(center=(b.x,b.y,b.z), color=(1,0,1)));
- c=ocl.Point(0,0,0)
- myscreen.addActor( camvtk.Point(center=(c.x,c.y,c.z), color=(1,0,1)));
- #myscreen.addActor( camvtk.Line(p1=(1,0,0),p2=(0,0,0.3)) )
- #myscreen.addActor( camvtk.Line(p1=(0,0,0.3),p2=(0,1,0)) )
- #myscreen.addActor( camvtk.Line(p1=(1,0,0),p2=(0,1,0)) )
- t = ocl.Triangle(a,b,c)
- s = ocl.STLSurf()
- s.addTriangle(t)
-
- print "STL surface read,", s.size(), "triangles"
-
- Nwaterlines = 40
- zh=[-0.15*x for x in xrange(Nwaterlines)]
- #zh=[15]
- diam = 3.01
- length = 50
- loops = []
- sampling = 0.1
-
- #cutter = ocl.CylCutter( diam , length )
- #cutter = ocl.BallCutter( diam , length )
- #cutter = ocl.BullCutter( diam , diam/5, length )
- #cutter = ocl.ConeCutter(diam, math.pi/3, length)
- #cutter = ocl.CylConeCutter(diam/float(3),diam,math.pi/float(9))
- #cutter = ocl.BallConeCutter(diam/float(2.3),diam,math.pi/float(5))
- #cutter = ocl.BullConeCutter(diam/1.5, diam/10, diam, math.pi/10)
- cutter = ocl.ConeConeCutter(diam/2,math.pi/3,diam,math.pi/6)
-
- print cutter
- #raw_input("Press Enter to terminate")
-
- ptsy_all = []
- ptsx_all = []
- yvals=[]
- Nmax=15
- for i in range(Nmax):
- yvals.append( diam* float(i)/float(Nmax) )
- yvals.append( -diam* float(i)/float(Nmax) )
-
- for y in yvals: #[diam*0.4, diam*0.2, 0, -diam*0.2,diam*(-0.4)]:
- ptsy = getPathsY(s,cutter,sampling, y)
- ptsx = getPathsX(s,cutter,sampling, y)
- ptsy_all.append(ptsy)
- ptsx_all.append(ptsx)
-
- #print " got ",len(pts)," cl-points"
- #for p in pts:
- # print p.x," ",p.y," ",p.z
- #exit()
-
- loops = []
- for z in zh:
-
- z_loops = getWaterline(s, cutter, z, sampling)
- for l in z_loops:
- loops.append(l)
-
-
- #for l in line:
-
- #drawLoops(myscreen, line, camvtk.cyan)
- #for l in cutter_loops:
- # loops.append(l)
-
- print "All waterlines done. Got", len(loops)," loops in total."
- # draw the loops
- drawLoops(myscreen, loops, camvtk.cyan)
- drawLoops(myscreen, ptsy_all, camvtk.pink)
- drawLoops(myscreen, ptsx_all, camvtk.lblue)
-
- print "done."
- myscreen.camera.SetPosition(15, 13, 7)
- myscreen.camera.SetFocalPoint(5, 5, 0)
- camvtk.drawArrows(myscreen,center=(0,0,3))
- camvtk.drawOCLtext(myscreen)
- myscreen.render()
- myscreen.iren.Start()
- #raw_input("Press Enter to terminate")
diff -Nru opencamlib-11.10+git201801200005~ubuntu16.04.1/scripts/drop-cutter/drop_cutter_one-triangle_1.py opencamlib-11.10-1/scripts/drop-cutter/drop_cutter_one-triangle_1.py
--- opencamlib-11.10+git201801200005~ubuntu16.04.1/scripts/drop-cutter/drop_cutter_one-triangle_1.py 2018-01-20 00:05:22.000000000 +0000
+++ opencamlib-11.10-1/scripts/drop-cutter/drop_cutter_one-triangle_1.py 1970-01-01 00:00:00.000000000 +0000
@@ -1,104 +0,0 @@
-import ocl
-import pyocl
-import camvtk
-import vtk
-import math
-
-if __name__ == "__main__":
- print ocl.version() # print out git version tag
-
- # set up VTK visualization
- myscreen = camvtk.VTKScreen()
- myscreen.setAmbient(20,20,20)
- myscreen.camera.SetPosition(4, 4, 3)
- myscreen.camera.SetFocalPoint(0.6, 0.6, 0)
- myscreen.setAmbient(1,1,1)
-
- #camvtk.drawArrows(myscreen)
-
- # three corners of a triangle
- a = ocl.Point(1,0,-0.000010)
- b = ocl.Point(0,1,+0.0)
- c = ocl.Point(0.001,0,+0.3001)
- #c = ocl.Point(0,0,0.3)
- t = ocl.Triangle(a,b,c)
-
- # draw the triangle with VTK
- myscreen.addActor( camvtk.Point(center=(a.x,a.y,a.z), color=(1,0,1)));
- myscreen.addActor( camvtk.Point(center=(b.x,b.y,b.z), color=(1,0,1)));
- myscreen.addActor( camvtk.Point(center=(c.x,c.y,c.z), color=(1,0,1)));
- myscreen.addActor( camvtk.Line(p1=(a.x,a.y,a.z),p2=(c.x,c.y,c.z)) )
- myscreen.addActor( camvtk.Line(p1=(c.x,c.y,c.z),p2=(b.x,b.y,b.z)) )
- myscreen.addActor( camvtk.Line(p1=(a.x,a.y,a.z),p2=(b.x,b.y,b.z)) )
-
- # Define a cutter
- angle = math.pi/8
- length = 5.0
- #c1 = ocl.BullCutter(0.5,0.1, length)
- #c1 = ocl.CylCutter(0.5, length)
- #c1 = ocl.BallCutter(0.5, length)
- c1 = ocl.ConeCutter(0.5,angle, length)
- cutter = c1
- cutter = c1.offsetCutter(0.1)
-
- print cutter
-
-
- # grid parameters
- minx=-0.7
- dx=0.03
- maxx=1.7
- miny=-0.7
- dy=0.03
- maxy=1.7
- z=-0.5
- # generate list of CL-poins at height z
- clpoints=[]
- # we calculate cutter-locations for this grid of XY points
- clpoints = pyocl.CLPointGrid(minx,dx,maxx,miny,dy,maxy,z)
-
- # loop through the cl-points
- n=0
- print len(clpoints), "cl-points to evaluate"
- for cl in clpoints:
- cutter.vertexDrop(cl,t)
- cutter.edgeDrop(cl,t)
- cutter.facetDrop(cl,t)
- n=n+1
- print "drop-cutter done."
- # cl has now been updated so it is a valid cutter-location point
- # drop-cutter only updates the z-coordinate of cl, x/y are not changed.
-
- print "rendering...",
- # render all the points
- camvtk.drawCLPointCloud(myscreen, clpoints)
- camvtk.drawCCPoints(myscreen, clpoints)
- print "done."
-
- tx = camvtk.Text()
- tx.SetPos( (myscreen.width-200, myscreen.height-130) )
- tx.SetText("opencamlib\ndrop-cutter")
- myscreen.addActor( tx )
-
- w2if = vtk.vtkWindowToImageFilter()
- w2if.SetInput(myscreen.renWin)
- lwr = vtk.vtkPNGWriter()
- lwr.SetInput( w2if.GetOutput() )
- w2if.Modified()
-
-
- # animate by rotating the camera
- """
- for n in range(1,90):
- tx.SetText(datetime.datetime.now().strftime("%Y-%m-%d %H:%M:%S"))
- myscreen.camera.Azimuth( 4 )
- #time.sleep(0.01)
- myscreen.render()
- lwr.SetFileName("frames/ball_all"+ ('%05d' % n)+".png")
- w2if.Modified()
- #lwr.Write() # write screenshot to file
- """
- myscreen.render()
- myscreen.iren.Start()
- raw_input("Press Enter to terminate")
-
diff -Nru opencamlib-11.10+git201801200005~ubuntu16.04.1/scripts/drop-cutter/drop_cutter_one-triangle_2.py opencamlib-11.10-1/scripts/drop-cutter/drop_cutter_one-triangle_2.py
--- opencamlib-11.10+git201801200005~ubuntu16.04.1/scripts/drop-cutter/drop_cutter_one-triangle_2.py 2018-01-20 00:05:22.000000000 +0000
+++ opencamlib-11.10-1/scripts/drop-cutter/drop_cutter_one-triangle_2.py 1970-01-01 00:00:00.000000000 +0000
@@ -1,80 +0,0 @@
-import ocl
-import pyocl
-import camvtk
-import vtk
-import math
-
-
-def drawPoints(myscreen, clpoints, ccpoints):
- c=camvtk.PointCloud( pointlist=clpoints, collist=ccpoints)
- c.SetPoints()
- myscreen.addActor(c )
-
-if __name__ == "__main__":
- print ocl.version()
- myscreen = camvtk.VTKScreen()
-
- # triangle
- a=ocl.Point(1,0,0.4)
- b=ocl.Point(0,1,0)
- c=ocl.Point(0,0,-0.2)
- t = ocl.Triangle(b,c,a)
-
- # draw the triangle with VTK
- myscreen.addActor(camvtk.Point(center=(a.x,a.y,a.z), color=(1,0,1)))
- myscreen.addActor(camvtk.Point(center=(b.x,b.y,b.z), color=(1,0,1)))
- myscreen.addActor(camvtk.Point(center=(c.x,c.y,c.z), color=(1,0,1)))
- myscreen.addActor( camvtk.Line(p1=(a.x,a.y,a.z),p2=(c.x,c.y,c.z)) )
- myscreen.addActor( camvtk.Line(p1=(c.x,c.y,c.z),p2=(b.x,b.y,b.z)) )
- myscreen.addActor( camvtk.Line(p1=(a.x,a.y,a.z),p2=(b.x,b.y,b.z)) )
-
- # cutter
- radius1=1
- length=5
- angle = math.pi/4
- #cutter = ocl.ConeCutter(0.37, angle)
- cutter = ocl.BallCutter(0.532, length)
- #cutter = ocl.CylCutter(0.3, length)
- #cutter = ocl.BullCutter(0.5,0.123, length)
- print cutter
-
- # grid on which we run drop-cutter
- minx=-0.5
- dx=0.0051
- maxx=1.5
- miny=-0.7
- dy=dx
- maxy=1.5
- z=-0.7
- clpoints = pyocl.CLPointGrid(minx,dx,maxx,miny,dy,maxy,z)
-
- print len(clpoints), "cl-points to evaluate"
- n=0
- for cl in clpoints:
- #cutter.vertexDrop(cl,t)
- #cutter.edgeDrop(cl,t)
- #cutter.facetDrop(cl,t)
- cutter.dropCutter(cl,t) # this calls all three above: vertex,facet,edge
- n=n+1
- if (n % int(len(clpoints)/10)) == 0:
- print n/int(len(clpoints)/10), " ",
-
- print "done."
-
- print "rendering..."
- print " len(clpoints)=", len(clpoints)
-
- camvtk.drawCLPointCloud(myscreen, clpoints)
- print "done."
-
- # draw a sphere, just for fun
- origo = camvtk.Sphere(center=(0,0,0) , radius=0.1, color=camvtk.blue)
- origo.SetOpacity(0.2)
- myscreen.addActor( origo )
-
- myscreen.camera.SetPosition(0.5, 3, 2)
- myscreen.camera.SetFocalPoint(0.5, 0.5, 0)
- myscreen.camera.SetClippingRange(-20,20)
- myscreen.render()
- myscreen.iren.Start()
- #raw_input("Press Enter to terminate")
diff -Nru opencamlib-11.10+git201801200005~ubuntu16.04.1/scripts/drop-cutter/drop_cutter_one-triangle_3_compoundcutter.py opencamlib-11.10-1/scripts/drop-cutter/drop_cutter_one-triangle_3_compoundcutter.py
--- opencamlib-11.10+git201801200005~ubuntu16.04.1/scripts/drop-cutter/drop_cutter_one-triangle_3_compoundcutter.py 2018-01-20 00:05:22.000000000 +0000
+++ opencamlib-11.10-1/scripts/drop-cutter/drop_cutter_one-triangle_3_compoundcutter.py 1970-01-01 00:00:00.000000000 +0000
@@ -1,76 +0,0 @@
-import ocl
-import pyocl # pyocl.CLPointGrid()
-import camvtk
-import vtk
-import math
-
-if __name__ == "__main__":
- print ocl.version()
- myscreen = camvtk.VTKScreen()
-
- a=ocl.Point(1,0.6,0.1)
- myscreen.addActor(camvtk.Point(center=(a.x,a.y,a.z), color=(1,0,1)))
- b=ocl.Point(0,1,0)
- myscreen.addActor(camvtk.Point(center=(b.x,b.y,b.z), color=(1,0,1)))
- c=ocl.Point(0,0,0.0)
- myscreen.addActor(camvtk.Point(center=(c.x,c.y,c.z), color=(1,0,1)))
-
- myscreen.addActor( camvtk.Line(p1=(a.x,a.y,a.z),p2=(c.x,c.y,c.z)) )
- myscreen.addActor( camvtk.Line(p1=(c.x,c.y,c.z),p2=(b.x,b.y,b.z)) )
- myscreen.addActor( camvtk.Line(p1=(a.x,a.y,a.z),p2=(b.x,b.y,b.z)) )
-
- t = ocl.Triangle(b,c,a)
- radius1=1
- angle = math.pi/4
- #cutter = ocl.ConeCutter(0.37, angle)
- #cutter = ocl.BallCutter(0.532)
- #cutter = ocl.CylCutter(0.3)
- #cutter = ocl.BullCutter(1,0.2)
-
- #cutter = ocl.CylConeCutter(0.2,0.5,math.pi/9)
- #cutter = ocl.BallConeCutter(0.4,0.6,math.pi/9)
- cutter = ocl.BullConeCutter(0.4,0.1,0.7,math.pi/6)
- #cutter = ocl.ConeConeCutter(0.4,math.pi/3,0.7,math.pi/6)
- #cutter = ocl.ConeCutter(0.4, math.pi/3)
- print cutter
-
- #print cc.type
- minx=-0.5
- dx=0.0051
- maxx=1.5
- miny=-0.7
- dy=dx
- maxy=1.5
- z=-1.8
- clpoints = pyocl.CLPointGrid(minx,dx,maxx,miny,dy,maxy,z)
- nv=0
- nn=0
- ne=0
- nf=0
- print len(clpoints), "cl-points to evaluate"
- n=0
-
- for cl in clpoints:
- cutter.vertexDrop(cl,t)
- cutter.edgeDrop(cl,t)
- cutter.facetDrop(cl,t)
- #cutter.dropCutter(cl,t)
- n=n+1
- if (n % int(len(clpoints)/10)) == 0:
- print n/int(len(clpoints)/10), " ",
-
- print "done."
- print "rendering..."
- print " len(clpoints)=", len(clpoints)
-
- camvtk.drawCLPointCloud(myscreen, clpoints)
- print "done."
- origo = camvtk.Sphere(center=(0,0,0) , radius=0.1, color=camvtk.blue)
- origo.SetOpacity(0.2)
- myscreen.addActor( origo )
-
- myscreen.camera.SetPosition(0.5, 3, 2)
- myscreen.camera.SetFocalPoint(0.5, 0.5, 0)
- myscreen.render()
- myscreen.iren.Start()
- #raw_input("Press Enter to terminate")
diff -Nru opencamlib-11.10+git201801200005~ubuntu16.04.1/scripts/drop-cutter/drop_cutter_tst_1.py opencamlib-11.10-1/scripts/drop-cutter/drop_cutter_tst_1.py
--- opencamlib-11.10+git201801200005~ubuntu16.04.1/scripts/drop-cutter/drop_cutter_tst_1.py 2018-01-20 00:05:22.000000000 +0000
+++ opencamlib-11.10-1/scripts/drop-cutter/drop_cutter_tst_1.py 1970-01-01 00:00:00.000000000 +0000
@@ -1,31 +0,0 @@
-import ocl
-import camvtk
-import time
-
-if __name__ == "__main__":
- cutter = ocl.CylCutter(.1, 5)
- print cutter
- a = ocl.Point(1,0,0)
- b = ocl.Point(0,1,0)
- c = ocl.Point(0,0,1)
- t = ocl.Triangle(a,b,c)
- print "triangle created t=", t
- cl = ocl.CLPoint(0.2,0.2,-5)
- print "CL= ", cl
- cutter.vertexDrop( cl , t )
- print "after vertex CL=", cl
- print "t=",t
-
- #print "t.n", t.n.str()
-
- cutter.facetDrop( cl, t )
- #print "after facetDrop"
- print "after facet t=",t
- #print "t.n", t.n.str()
- print "after facet CL=", cl
-
-
-
- cutter.edgeDrop( cl, t )
- print "after edge cl =", cl
-
diff -Nru opencamlib-11.10+git201801200005~ubuntu16.04.1/scripts/drop-cutter/drop_cutter_tst_2.py opencamlib-11.10-1/scripts/drop-cutter/drop_cutter_tst_2.py
--- opencamlib-11.10+git201801200005~ubuntu16.04.1/scripts/drop-cutter/drop_cutter_tst_2.py 2018-01-20 00:05:22.000000000 +0000
+++ opencamlib-11.10-1/scripts/drop-cutter/drop_cutter_tst_2.py 1970-01-01 00:00:00.000000000 +0000
@@ -1,16 +0,0 @@
-import ocl
-import camvtk
-import time
-
-if __name__ == "__main__":
- cutter = ocl.CylCutter(.1, 5)
- print cutter
- a=ocl.Point(1,0,0)
- b=ocl.Point(0,1,0)
- c=ocl.Point(0,0,1)
- t = ocl.Triangle(a,b,c)
- print "triangle created t=", t
- cl = ocl.CLPoint(0.2,0.2,0)
-
- cutter.dropCutter(cl,t)
- print "CL= ", cl
diff -Nru opencamlib-11.10+git201801200005~ubuntu16.04.1/scripts/drop-cutter/drop_cutter_tst_3.py opencamlib-11.10-1/scripts/drop-cutter/drop_cutter_tst_3.py
--- opencamlib-11.10+git201801200005~ubuntu16.04.1/scripts/drop-cutter/drop_cutter_tst_3.py 2018-01-20 00:05:22.000000000 +0000
+++ opencamlib-11.10-1/scripts/drop-cutter/drop_cutter_tst_3.py 1970-01-01 00:00:00.000000000 +0000
@@ -1,46 +0,0 @@
-import ocl
-import pyocl
-import camvtk
-import time
-
-if __name__ == "__main__":
- myscreen = camvtk.VTKScreen()
-
- a=ocl.Point(1,0,0)
- myscreen.addActor(camvtk.Point(center=(1,0,0), color=(1,1,1)));
- b=ocl.Point(0,1,0)
- myscreen.addActor(camvtk.Point(center=(0,1,0), color=(1,1,1)));
- c=ocl.Point(0,0,0.2)
- myscreen.addActor( camvtk.Point(center=(0,0,0.2), color=(1,1,1)));
- myscreen.addActor( camvtk.Line(p1=(1,0,0),p2=(0,0,0.2)) )
- myscreen.addActor( camvtk.Line(p1=(0,0,0.2),p2=(0,1,0)) )
- myscreen.addActor( camvtk.Line(p1=(1,0,0),p2=(0,1,0)) )
- t = ocl.Triangle(a,b,c)
-
- cutter = ocl.CylCutter(.3, 5)
- print cutter
-
- minx=-0.2
- dx=0.02
- maxx=1.2
- miny=-0.2
- dy=0.2
- maxy=1.2
- z=-0.2
- clpoints = pyocl.CLPointGrid(minx,dx,maxx,miny,dy,maxy,z)
-
- for cl in clpoints:
- cutter.dropCutter(cl,t)
-
- print len(clpoints), " cl points evaluated"
- # draw the points
- camvtk.drawCLPointCloud(myscreen, clpoints)
-
- #position camera
- myscreen.camera.SetPosition(0.5, 3, 2)
- myscreen.camera.SetFocalPoint(0.5, 0.5, 0)
-
- myscreen.render()
- myscreen.iren.Start()
- #raw_input("Press Enter to terminate")
-
diff -Nru opencamlib-11.10+git201801200005~ubuntu16.04.1/scripts/drop-cutter/drop_cutter_tst_4.py opencamlib-11.10-1/scripts/drop-cutter/drop_cutter_tst_4.py
--- opencamlib-11.10+git201801200005~ubuntu16.04.1/scripts/drop-cutter/drop_cutter_tst_4.py 2018-01-20 00:05:22.000000000 +0000
+++ opencamlib-11.10-1/scripts/drop-cutter/drop_cutter_tst_4.py 1970-01-01 00:00:00.000000000 +0000
@@ -1,91 +0,0 @@
-import ocl
-import pyocl
-import camvtk
-import time
-import vtk
-import datetime
-import math
-
-if __name__ == "__main__":
- print ocl.version()
- myscreen = camvtk.VTKScreen()
-
- a=ocl.Point(1,0,0)
- myscreen.addActor(camvtk.Point(center=(1,0,0), color=(1,0,1)));
- b=ocl.Point(0,1,0)
- myscreen.addActor(camvtk.Point(center=(0,1,0), color=(1,0,1)));
- c=ocl.Point(0,0,0.3)
- myscreen.addActor( camvtk.Point(center=(0,0,0.3), color=(1,0,1)));
- myscreen.addActor( camvtk.Line(p1=(1,0,0),p2=(0,0,0.3)) )
- myscreen.addActor( camvtk.Line(p1=(0,0,0.3),p2=(0,1,0)) )
- myscreen.addActor( camvtk.Line(p1=(1,0,0),p2=(0,1,0)) )
- t = ocl.Triangle(a,b,c)
- s = ocl.STLSurf()
- s.addTriangle(t)
-
- diameter = 0.5234
- corneradius = 0.1
- angle = math.pi/4
- length = 5
- cutter = ocl.CylCutter(diameter, length)
- #cutter = ocl.BallCutter(diameter, length)
- #cutter = ocl.BullCutter(diameter,corneradius, length)
- #cutter = ocl.ConeCutter(diameter, angle, length)
-
- print cutter
-
- minx=-0.5
- dx=0.01
- maxx=1.5
- miny=-0.5
- dy=0.05
- maxy=1.5
- z=-0.8
- clpoints = pyocl.CLPointGrid(minx,dx,maxx,miny,dy,maxy,z)
- print len(clpoints), "cl-points to evaluate"
- n=0
- clp=[]
- bdc = ocl.BatchDropCutter()
- bdc.setSTL(s)
- bdc.setCutter(cutter)
- for p in clpoints:
- bdc.appendPoint(p)
-
- bdc.run()
-
- print "done."
- clpoints = bdc.getCLPoints()
- print "rendering..."
- print " len(clpoints)=", len(clpoints)
-
- camvtk.drawCLPointCloud(myscreen, clpoints)
-
- print "done."
-
- myscreen.camera.SetPosition(0.5, 3, 2)
- myscreen.camera.SetFocalPoint(0.5, 0.5, 0)
- myscreen.render()
-
- w2if = vtk.vtkWindowToImageFilter()
- w2if.SetInput(myscreen.renWin)
- lwr = vtk.vtkPNGWriter()
- lwr.SetInput( w2if.GetOutput() )
-
- t = camvtk.Text()
- t.SetPos( (myscreen.width-350, myscreen.height-30) )
- myscreen.addActor(t)
-
- #for n in range(1,18):
- # t.SetText("OpenCAMLib " + datetime.datetime.now().strftime("%Y-%m-%d %H:%M:%S"))
- # myscreen.camera.Azimuth( 2 )
- # time.sleep(0.1)
- # myscreen.render()
- # w2if.Modified()
- # lwr.SetFileName("frames/tc"+ ('%04d' % n)+".png")
- #lwr.Write()
-
-
-
- myscreen.iren.Start()
- #raw_input("Press Enter to terminate")
-
diff -Nru opencamlib-11.10+git201801200005~ubuntu16.04.1/scripts/drop-cutter/drop_cutter_tst_5.py opencamlib-11.10-1/scripts/drop-cutter/drop_cutter_tst_5.py
--- opencamlib-11.10+git201801200005~ubuntu16.04.1/scripts/drop-cutter/drop_cutter_tst_5.py 2018-01-20 00:05:22.000000000 +0000
+++ opencamlib-11.10-1/scripts/drop-cutter/drop_cutter_tst_5.py 1970-01-01 00:00:00.000000000 +0000
@@ -1,73 +0,0 @@
-import ocl
-import pyocl
-import camvtk
-import time
-import vtk
-import datetime
-
-if __name__ == "__main__":
- print ocl.version()
- myscreen = camvtk.VTKScreen()
- stl = camvtk.STLSurf("../../stl/gnu_tux_mod.stl")
-
- myscreen.addActor(stl)
- stl.SetWireframe()
- stl.SetColor((0.5,0.5,0.5))
-
- polydata = stl.src.GetOutput()
- s= ocl.STLSurf()
- camvtk.vtkPolyData2OCLSTL(polydata, s)
- print "STL surface read,", s.size(), "triangles"
-
- cutter = ocl.CylCutter(0.6, 6)
- print cutter
-
- minx=-0.2
- dx=2
- maxx=10.2
- miny=-0.2
- dy=3
- maxy=12.2
- z=-0.2
- clpoints = pyocl.CLPointGrid(minx,dx,maxx,miny,dy,maxy,z)
- print len(clpoints),"CL-points to evaluate..."
- tris = s.getTriangles()
- # very naive approach to drop-cutter (and doing loops in python is slow)
- # this is so slow in practice it is not usable with the tux-model STL-file (22k triangles)
- for cl in clpoints: # loop through all the cl-points
- for t in tris: # for each cl-point loop through all triangles
- cutter.vertexDrop(cl,t) # vertex test
- cutter.edgeDrop(cl,t) # edge test
- cutter.facetDrop(cl,t) # facet test
- print "done."
-
- camvtk.drawCLPointCloud(myscreen, clpoints)
-
- print len(clpoints), " cl points evaluated"
- myscreen.camera.SetPosition(3, 23, 15)
- myscreen.camera.SetFocalPoint(4, 5, 0)
- myscreen.render()
-
- w2if = vtk.vtkWindowToImageFilter()
- w2if.SetInput(myscreen.renWin)
- lwr = vtk.vtkPNGWriter()
- lwr.SetInput( w2if.GetOutput() )
- w2if.Modified()
- lwr.SetFileName("tux1.png")
- #lwr.Write()
-
- t = camvtk.Text()
- t.SetPos( (myscreen.width-200, myscreen.height-30) )
- myscreen.addActor( t)
-
- for n in range(1,36):
- t.SetText(datetime.datetime.now().strftime("%Y-%m-%d %H:%M:%S"))
- myscreen.camera.Azimuth( 1 )
- time.sleep(0.01)
- myscreen.render()
- lwr.SetFileName("frame"+ ('%03d' % n)+".png")
- w2if.Modified()
- #lwr.Write() #uncomment to write screenshots to disk
-
- myscreen.iren.Start()
- raw_input("Press Enter to terminate")
diff -Nru opencamlib-11.10+git201801200005~ubuntu16.04.1/scripts/edge_offset_tst_1.py opencamlib-11.10-1/scripts/edge_offset_tst_1.py
--- opencamlib-11.10+git201801200005~ubuntu16.04.1/scripts/edge_offset_tst_1.py 2018-01-20 00:05:22.000000000 +0000
+++ opencamlib-11.10-1/scripts/edge_offset_tst_1.py 1970-01-01 00:00:00.000000000 +0000
@@ -1,97 +0,0 @@
-import ocl
-import pyocl
-import camvtk
-import time
-import vtk
-import datetime
-import math
-
-def drawEdge(myscreen, a, b):
- myscreen.addActor(camvtk.Sphere(center=(a.x,a.y,a.z), radius=0.0351, color=camvtk.green));
- myscreen.addActor(camvtk.Sphere(center=(b.x,b.y,b.z), radius=0.0351, color=camvtk.red));
- myscreen.addActor( camvtk.Line(p1=(a.x,a.y,a.z),p2=(b.x,b.y,b.z)) )
-
-if __name__ == "__main__":
- print ocl.version()
- myscreen = camvtk.VTKScreen()
- camvtk.drawOCLtext(myscreen)
- camvtk.drawArrows(myscreen,center=(-1,-2,0))
- a=ocl.Point(0,1.7,-0.6)
- b=ocl.Point(0,0.11,0.3)
-
- drawEdge(myscreen, a, b)
- diameter=0.4
- length=1
- # spherical cutter and cylinder
- s1 = camvtk.Sphere(center=(a.x,a.y,a.z), radius=diameter/2, color=camvtk.lgreen)
- s2 = camvtk.Sphere(center=(b.x,b.y,b.z), radius=diameter/2, color=camvtk.pink)
- s1.SetOpacity(1)
- s2.SetOpacity(1)
- myscreen.addActor(s1)
- myscreen.addActor(s2)
- # tube
- cyltube = camvtk.Tube( p1=(a.x,a.y,a.z) , p2=(b.x,b.y,b.z), radius=diameter/2, color=camvtk.yellow )
- cyltube.SetOpacity(0.2)
- myscreen.addActor( cyltube )
-
-
- # Cylinder
- a = a + ocl.Point(1,0,0)
- b = b + ocl.Point(1,0,0)
- drawEdge(myscreen, a, b)
- cir1 = camvtk.Circle(center=(a.x,a.y,a.z) , radius=diameter/2, color=camvtk.lgreen, resolution=50 )
- cir1.SetOpacity(1)
- myscreen.addActor(cir1)
- cir2 = camvtk.Circle(center=(b.x,b.y,b.z) , radius=diameter/2, color=camvtk.pink, resolution=50 )
- cir2.SetOpacity(1)
- myscreen.addActor(cir2)
-
- # draw lines along the elliptic tube
-
- # Toroid
- a = a + ocl.Point(1,0,0)
- b = b + ocl.Point(1,0,0)
- drawEdge(myscreen, a, b)
- tor1 = camvtk.Toroid(r1=diameter/2, r2=diameter/6, center=(a.x,a.y,a.z), rotXYZ=(0,0,0), color=camvtk.lgreen)
- tor1.SetOpacity(1)
- myscreen.addActor(tor1)
- tor2 = camvtk.Toroid(r1=diameter/2, r2=diameter/6, center=(b.x,b.y,b.z), rotXYZ=(0,0,0), color=camvtk.pink)
- tor2.SetOpacity(1)
- myscreen.addActor(tor2)
-
- # Cone
- a = a + ocl.Point(1,0,0)
- b = b + ocl.Point(1,0,0)
- drawEdge(myscreen, a, b)
- con1 = camvtk.Cone(center=(a.x,a.y,a.z), radius=diameter/2, height = 0.3, color=camvtk.lgreen )
- myscreen.addActor(con1)
- con2 = camvtk.Cone(center=(b.x,b.y,b.z), radius=diameter/2, height = 0.3, color=camvtk.pink )
- myscreen.addActor(con2)
-
-
- print "done."
-
- myscreen.camera.SetPosition(4, 3, 2)
- myscreen.camera.SetFocalPoint(0, 0, 0)
- myscreen.render()
-
- w2if = vtk.vtkWindowToImageFilter()
- w2if.SetInput(myscreen.renWin)
- lwr = vtk.vtkPNGWriter()
- lwr.SetInput( w2if.GetOutput() )
-
-
- #for n in range(1,18):
- # t.SetText("OpenCAMLib " + datetime.datetime.now().strftime("%Y-%m-%d %H:%M:%S"))
- # myscreen.camera.Azimuth( 2 )
- # time.sleep(0.1)
- # myscreen.render()
- # w2if.Modified()
- # lwr.SetFileName("frames/tc"+ ('%04d' % n)+".png")
- #lwr.Write()
-
-
-
- myscreen.iren.Start()
- #raw_input("Press Enter to terminate")
-
diff -Nru opencamlib-11.10+git201801200005~ubuntu16.04.1/scripts/fiber/fiber_01.py opencamlib-11.10-1/scripts/fiber/fiber_01.py
--- opencamlib-11.10+git201801200005~ubuntu16.04.1/scripts/fiber/fiber_01.py 2018-01-20 00:05:22.000000000 +0000
+++ opencamlib-11.10-1/scripts/fiber/fiber_01.py 1970-01-01 00:00:00.000000000 +0000
@@ -1,90 +0,0 @@
-import ocl
-import camvtk
-import time
-import vtk
-import datetime
-import math
-
-
-def drawPoints(myscreen, clpoints, ccpoints):
- c=camvtk.PointCloud( pointlist=clpoints, collist=ccpoints)
- c.SetPoints()
- myscreen.addActor(c )
-
-def drawFiber(myscreen, f):
- #myscreen.addActor( camvtk.Line(p1=(f.p1.x,f.p1.y,f.p1.z),p2=(f.p2.x,f.p2.y,f.p2.z), color=camvtk.orange) )
- #myscreen.addActor( camvtk.Sphere(center=(f.p1.x,f.p1.y,f.p1.z),radius=0.05, color=camvtk.lgreen) )
- #myscreen.addActor( camvtk.Sphere(center=(f.p2.x,f.p2.y,f.p2.z),radius=0.05, color=camvtk.pink) )
- inter = f.getInts()
- for i in inter:
- ip1 = f.point( i.lower )
- ip2 = f.point( i.upper )
- myscreen.addActor( camvtk.Line(p1=(ip1.x,ip1.y,ip1.z),p2=(ip2.x,ip2.y,ip2.z), color=camvtk.red) )
-
-if __name__ == "__main__":
- myscreen = camvtk.VTKScreen()
-
- a=ocl.Point(1,0.6,0.5)
- myscreen.addActor(camvtk.Point(center=(a.x,a.y,a.z), color=(1,0,1)))
- b=ocl.Point(0,1,0)
- myscreen.addActor(camvtk.Point(center=(b.x,b.y,b.z), color=(1,0,1)))
- c=ocl.Point(0,0,0.0)
- myscreen.addActor(camvtk.Point(center=(c.x,c.y,c.z), color=(1,0,1)))
-
- myscreen.addActor( camvtk.Line(p1=(a.x,a.y,a.z),p2=(c.x,c.y,c.z)) )
- myscreen.addActor( camvtk.Line(p1=(c.x,c.y,c.z),p2=(b.x,b.y,b.z)) )
- myscreen.addActor( camvtk.Line(p1=(a.x,a.y,a.z),p2=(b.x,b.y,b.z)) )
-
- f1 = ocl.Point(-2,0.5,-0.2)
- f2 = ocl.Point(2,0.5,-0.2)
- t = ocl.Triangle(b,c,a)
- #radius1=1
- #angle = math.pi/4
- #cutter = ocl.ConeCutter(0.37, angle)
- #cutter = ocl.BallCutter(0.532,5)
- cutter = ocl.CylCutter(0.3,5)
-
- #cutter = ocl.CylConeCutter(0.2,0.5,math.pi/9)
- #cutter = ocl.BallConeCutter(0.4,0.6,math.pi/9)
- #cutter = ocl.BullConeCutter(0.4,0.1,0.7,math.pi/6)
- #cutter = ocl.ConeConeCutter(0.4,math.pi/3,0.7,math.pi/6)
- #cutter = ocl.ConeCutter(0.4, math.pi/3)
-
- print "fiber..."
-
- f = ocl.Fiber( f1, f2)
- i = ocl.Interval()
- f.printInts()
- print "vertexPush"
- cc = ocl.CCPoint()
- cutter.pushCutter(f,i,t)
- print i
- f.addInterval(i)
- print "AFTER vertexPush"
- f.printInts()
-
- #inter = f.getInts()
- #print inter
- print "done."
-
- print "rendering..."
- drawFiber(myscreen, f)
- print "done."
- origo = camvtk.Sphere(center=(0,0,0) , radius=0.1, color=camvtk.blue)
- origo.SetOpacity(0.2)
- myscreen.addActor( origo )
-
- myscreen.camera.SetPosition(0.5, 3, 2)
- myscreen.camera.SetFocalPoint(0.5, 0.5, 0)
- myscreen.render()
-
- w2if = vtk.vtkWindowToImageFilter()
- w2if.SetInput(myscreen.renWin)
- lwr = vtk.vtkPNGWriter()
- lwr.SetInput( w2if.GetOutput() )
-
- t = camvtk.Text()
- t.SetPos( (myscreen.width-350, myscreen.height-30) )
- myscreen.addActor(t)
- myscreen.iren.Start()
- #raw_input("Press Enter to terminate")
diff -Nru opencamlib-11.10+git201801200005~ubuntu16.04.1/scripts/fiber/fiber_02_onetriangle_drawfibers.py opencamlib-11.10-1/scripts/fiber/fiber_02_onetriangle_drawfibers.py
--- opencamlib-11.10+git201801200005~ubuntu16.04.1/scripts/fiber/fiber_02_onetriangle_drawfibers.py 2018-01-20 00:05:22.000000000 +0000
+++ opencamlib-11.10-1/scripts/fiber/fiber_02_onetriangle_drawfibers.py 1970-01-01 00:00:00.000000000 +0000
@@ -1,95 +0,0 @@
-import ocl
-import camvtk
-import time
-import vtk
-import datetime
-import math
-
-def drawPoints(myscreen, clpoints, ccpoints):
- c=camvtk.PointCloud( pointlist=clpoints, collist=ccpoints)
- c.SetPoints()
- myscreen.addActor(c )
-
-def drawFiber(myscreen, f, fibercolor=camvtk.red):
- inter = f.getInts()
- for i in inter:
- if not i.empty():
- ip1 = f.point( i.lower )
- ip2 = f.point( i.upper )
- myscreen.addActor( camvtk.Line(p1=(ip1.x,ip1.y,ip1.z),p2=(ip2.x,ip2.y,ip2.z), color=fibercolor) )
- myscreen.addActor( camvtk.Sphere(center=(ip1.x,ip1.y,ip1.z),radius=0.005, color=camvtk.clColor( i.lower_cc) ) )
- myscreen.addActor( camvtk.Sphere(center=(ip2.x,ip2.y,ip2.z),radius=0.005, color=camvtk.clColor( i.upper_cc) ) )
- cc1 = i.lower_cc
- cc2 = i.upper_cc
- myscreen.addActor( camvtk.Sphere(center=(cc1.x,cc1.y,cc1.z),radius=0.005, color=camvtk.lgreen ) )
- myscreen.addActor( camvtk.Sphere(center=(cc2.x,cc2.y,cc2.z),radius=0.005, color=camvtk.lgreen ) )
- # cutter circle
- #c1 = camvtk.Circle(center=(ip1.x,ip1.y,ip1.z), radius = 0.3/2, color=fibercolor)
- #myscreen.addActor(c1)
- #c2 = camvtk.Circle(center=(ip2.x,ip2.y,ip2.z), radius = 0.3/2, color=fibercolor)
- #myscreen.addActor(c2)
-
-if __name__ == "__main__":
- myscreen = camvtk.VTKScreen()
-
- a = ocl.Point(0,1,0.3)
- myscreen.addActor(camvtk.Point(center=(a.x,a.y,a.z), color=(1,0,1)))
- b = ocl.Point(1,0.5,0.3)
- myscreen.addActor(camvtk.Point(center=(b.x,b.y,b.z), color=(1,0,1)))
- c = ocl.Point(0,0,0)
- myscreen.addActor(camvtk.Point(center=(c.x,c.y,c.z), color=(1,0,1)))
- myscreen.addActor( camvtk.Line(p1=(a.x,a.y,a.z),p2=(c.x,c.y,c.z)) )
- myscreen.addActor( camvtk.Line(p1=(c.x,c.y,c.z),p2=(b.x,b.y,b.z)) )
- myscreen.addActor( camvtk.Line(p1=(a.x,a.y,a.z),p2=(b.x,b.y,b.z)) )
- t = ocl.Triangle(b,c,a)
- diameter = 0.2
- length = 5
- angle = math.pi/4
- cutter = ocl.CylCutter(diameter, length)
- #cutter = ocl.BallCutter(diameter, length)
- #cutter = ocl.BullCutter(diameter, diameter/5, length)
- #cutter = ocl.ConeCutter(diameter, angle, length)
-
- print cutter
- range=6
- Nmax = 500
- yvals = [float(n-float(Nmax)/2)/Nmax*range for n in xrange(0,Nmax+1)]
- xvals = [float(n-float(Nmax)/2)/Nmax*range for n in xrange(0,Nmax+1)]
-
- zh = 0.1071567
- for y in yvals:
- f1 = ocl.Point(-0.5,y,zh) # start point of fiber
- f2 = ocl.Point(1.5,y,zh) # end point of fiber
- f = ocl.Fiber( f1, f2)
- i = ocl.Interval()
- cutter.pushCutter(f,i,t)
- #cutter.vertexPush(f,i,t)
- #cutter.facetPush(f,i,t)
- #cutter.edgePush(f,i,t)
- f.addInterval(i)
- drawFiber(myscreen, f, camvtk.red)
-
- for x in xvals:
- f1 = ocl.Point(x,-0.5,zh) # start point of fiber
- f2 = ocl.Point(x,1.5,zh) # end point of fiber
- f = ocl.Fiber( f1, f2)
- i = ocl.Interval()
- cutter.pushCutter(f,i,t)
- #cutter.vertexPush(f,i,t)
- #cutter.facetPush(f,i,t)
- #cutter.edgePush(f,i,t)
- f.addInterval(i)
- drawFiber(myscreen, f, camvtk.lblue)
-
- print "done."
- myscreen.camera.SetPosition(0.5, 3, 2)
- myscreen.camera.SetFocalPoint(0.5, 0.5, 0)
- camvtk.drawArrows(myscreen,center=(-0.5,-0.5,-0.5))
- camvtk.drawOCLtext(myscreen)
- myscreen.render()
- w2if = vtk.vtkWindowToImageFilter()
- w2if.SetInput(myscreen.renWin)
- lwr = vtk.vtkPNGWriter()
- lwr.SetInput( w2if.GetOutput() )
- myscreen.iren.Start()
- #raw_input("Press Enter to terminate")
diff -Nru opencamlib-11.10+git201801200005~ubuntu16.04.1/scripts/fiber/fiber_03_onetri_many-z-levels.py opencamlib-11.10-1/scripts/fiber/fiber_03_onetri_many-z-levels.py
--- opencamlib-11.10+git201801200005~ubuntu16.04.1/scripts/fiber/fiber_03_onetri_many-z-levels.py 2018-01-20 00:05:22.000000000 +0000
+++ opencamlib-11.10-1/scripts/fiber/fiber_03_onetri_many-z-levels.py 1970-01-01 00:00:00.000000000 +0000
@@ -1,128 +0,0 @@
-import ocl
-import camvtk
-import time
-import vtk
-import datetime
-import math
-
-def drawPoints(myscreen, clpoints, ccpoints):
- c=camvtk.PointCloud( pointlist=clpoints, collist=ccpoints)
- c.SetPoints()
- myscreen.addActor(c )
-
-def drawFiber(myscreen, f, fibercolor=camvtk.red):
- inter = f.getInts()
- print "fiber has ", len(inter) , " intervals"
- for i in inter:
- if not i.empty():
- ip1 = f.point( i.lower )
- ip2 = f.point( i.upper )
- myscreen.addActor( camvtk.Line(p1=(ip1.x,ip1.y,ip1.z),p2=(ip2.x,ip2.y,ip2.z), color=fibercolor) )
- myscreen.addActor( camvtk.Sphere(center=(ip1.x,ip1.y,ip1.z),radius=0.005, color=camvtk.clColor( i.lower_cc) ) )
- myscreen.addActor( camvtk.Sphere(center=(ip2.x,ip2.y,ip2.z),radius=0.005, color=camvtk.clColor( i.upper_cc) ) )
- #cc1 = i.lower_cc
- #cc2 = i.upper_cc
- #myscreen.addActor( camvtk.Sphere(center=(cc1.x,cc1.y,cc1.z),radius=0.005, color=camvtk.lgreen ) )
- #myscreen.addActor( camvtk.Sphere(center=(cc2.x,cc2.y,cc2.z),radius=0.005, color=camvtk.lgreen ) )
- # cutter circle
- #c1 = camvtk.Circle(center=(ip1.x,ip1.y,ip1.z), radius = 0.3/2, color=fibercolor)
- #myscreen.addActor(c1)
- #c2 = camvtk.Circle(center=(ip2.x,ip2.y,ip2.z), radius = 0.3/2, color=fibercolor)
- #myscreen.addActor(c2)
-
-def drawFiber_clpts(myscreen, f, fibercolor=camvtk.red):
- inter = f.getInts()
- #print "fiber has ", len(inter) , " intervals"
- for i in inter:
- if not i.empty():
- ip1 = f.point( i.lower )
- ip2 = f.point( i.upper )
- #myscreen.addActor( camvtk.Line(p1=(ip1.x,ip1.y,ip1.z),p2=(ip2.x,ip2.y,ip2.z), color=fibercolor) )
- myscreen.addActor( camvtk.Sphere(center=(ip1.x,ip1.y,ip1.z),radius=0.005, color=camvtk.clColor( i.lower_cc) ) )
- myscreen.addActor( camvtk.Sphere(center=(ip2.x,ip2.y,ip2.z),radius=0.005, color=camvtk.clColor( i.upper_cc) ) )
- #cc1 = i.lower_cc
- #cc2 = i.upper_cc
- #myscreen.addActor( camvtk.Sphere(center=(cc1.x,cc1.y,cc1.z),radius=0.005, color=camvtk.pink ) )
- #myscreen.addActor( camvtk.Sphere(center=(cc2.x,cc2.y,cc2.z),radius=0.005, color=camvtk.pink ) )
-
-def yfiber(yvals,t,zh,myscreen):
- for y in yvals:
- f1 = ocl.Point(-0.5,y,zh) # start point of fiber
- f2 = ocl.Point(1.5,y,zh) # end point of fiber
- f = ocl.Fiber( f1, f2)
- i = ocl.Interval()
- #cutter.vertexPush(f,i,t)
- #cutter.facetPush(f,i,t)
- #cutter.edgePush(f,i,t)
- cutter.pushCutter(f,i,t)
- f.addInterval(i)
- drawFiber_clpts(myscreen, f, camvtk.red)
-
-def xfiber(xvals,t,zh,myscreen):
- for x in xvals:
- f1 = ocl.Point(x,-0.5,zh) # start point of fiber
- f2 = ocl.Point(x,1.5,zh) # end point of fiber
- f = ocl.Fiber( f1, f2)
- i = ocl.Interval()
- #cutter.vertexPush(f,i,t)
- #cutter.facetPush(f,i,t)
- #cutter.edgePush(f,i,t)
- cutter.pushCutter(f,i,t)
- f.addInterval(i)
- drawFiber_clpts(myscreen, f, camvtk.lblue)
-
-
-
-if __name__ == "__main__":
- print ocl.revision()
- myscreen = camvtk.VTKScreen()
- a = ocl.Point(0,1,0.3)
- b = ocl.Point(1,0.5,0.0)
- c = ocl.Point(0.1,0.1,0.0)
- myscreen.addActor(camvtk.Point(center=(a.x,a.y,a.z), color=(1,0,1)))
- myscreen.addActor(camvtk.Point(center=(b.x,b.y,b.z), color=(1,0,1)))
- myscreen.addActor(camvtk.Point(center=(c.x,c.y,c.z), color=(1,0,1)))
- myscreen.addActor( camvtk.Line(p1=(a.x,a.y,a.z),p2=(c.x,c.y,c.z)) )
- myscreen.addActor( camvtk.Line(p1=(c.x,c.y,c.z),p2=(b.x,b.y,b.z)) )
- myscreen.addActor( camvtk.Line(p1=(a.x,a.y,a.z),p2=(b.x,b.y,b.z)) )
- t = ocl.Triangle(b,c,a)
- angle = math.pi/4
- diameter=0.3
- length=5
- #cutter = ocl.BallCutter(diameter, length)
- cutter = ocl.CylCutter(diameter, length)
- #cutter = ocl.BullCutter(diameter, diameter/4, length)
- #cutter = ocl.ConeCutter(diameter, angle, length)
- #cutter = cutter.offsetCutter( 0.1 )
-
- print "cutter= ", cutter
- print "lengt=", cutter.getLength()
- print "fiber...",
- range=2
- Nmax = 100
- yvals = [float(n-float(Nmax)/2)/Nmax*range for n in xrange(0,Nmax+1)]
- xvals = [float(n-float(Nmax)/2)/Nmax*range for n in xrange(0,Nmax+1)]
- zmin = -0.2082
- zmax = 0.3115
- zNmax = 20
- dz = (zmax-zmin)/(zNmax-1)
- zvals=[]
- for n in xrange(0,zNmax):
- zvals.append(zmin+n*dz)
- for zh in zvals:
- yfiber(yvals,t,zh,myscreen)
- xfiber(xvals,t,zh,myscreen)
- print "done."
- print "rendering...",
- myscreen.camera.SetPosition(0.5, 3, 2)
- myscreen.camera.SetFocalPoint(0.5, 0.5, 0)
- camvtk.drawArrows(myscreen,center=(-0.5,-0.5,-0.5))
- camvtk.drawOCLtext(myscreen)
- myscreen.render()
- w2if = vtk.vtkWindowToImageFilter()
- w2if.SetInput(myscreen.renWin)
- lwr = vtk.vtkPNGWriter()
- lwr.SetInput( w2if.GetOutput() )
- print "done."
- myscreen.iren.Start()
- #raw_input("Press Enter to terminate")
diff -Nru opencamlib-11.10+git201801200005~ubuntu16.04.1/scripts/fiber/fiber_04_stl.py opencamlib-11.10-1/scripts/fiber/fiber_04_stl.py
--- opencamlib-11.10+git201801200005~ubuntu16.04.1/scripts/fiber/fiber_04_stl.py 2018-01-20 00:05:22.000000000 +0000
+++ opencamlib-11.10-1/scripts/fiber/fiber_04_stl.py 1970-01-01 00:00:00.000000000 +0000
@@ -1,124 +0,0 @@
-import ocl
-import camvtk
-import time
-import vtk
-import datetime
-import math
-
-def drawPoints(myscreen, clpoints, ccpoints):
- c=camvtk.PointCloud( pointlist=clpoints, collist=ccpoints)
- c.SetPoints()
- myscreen.addActor(c )
-
-def drawFiber(myscreen, f, fibercolor=camvtk.red):
- inter = f.getInts()
- for i in inter:
- if not i.empty():
- ip1 = f.point( i.lower )
- ip2 = f.point( i.upper )
- myscreen.addActor( camvtk.Line(p1=(ip1.x,ip1.y,ip1.z),p2=(ip2.x,ip2.y,ip2.z), color=fibercolor) )
- myscreen.addActor( camvtk.Sphere(center=(ip1.x,ip1.y,ip1.z),radius=0.005, color=camvtk.clColor( i.lower_cc) ) )
- myscreen.addActor( camvtk.Sphere(center=(ip2.x,ip2.y,ip2.z),radius=0.005, color=camvtk.clColor( i.upper_cc) ) )
- cc1 = i.lower_cc
- cc2 = i.upper_cc
- myscreen.addActor( camvtk.Sphere(center=(cc1.x,cc1.y,cc1.z),radius=0.005, color=camvtk.lgreen ) )
- myscreen.addActor( camvtk.Sphere(center=(cc2.x,cc2.y,cc2.z),radius=0.005, color=camvtk.lgreen ) )
- # cutter circle
- #c1 = camvtk.Circle(center=(ip1.x,ip1.y,ip1.z), radius = 0.3/2, color=fibercolor)
- #myscreen.addActor(c1)
- #c2 = camvtk.Circle(center=(ip2.x,ip2.y,ip2.z), radius = 0.3/2, color=fibercolor)
- #myscreen.addActor(c2)
-
-def drawFiber_clpts(myscreen, f, fibercolor=camvtk.red):
- inter = f.getInts()
- for i in inter:
- if not i.empty():
- ip1 = f.point( i.lower )
- ip2 = f.point( i.upper )
- myscreen.addActor( camvtk.Line(p1=(ip1.x,ip1.y,ip1.z),p2=(ip2.x,ip2.y,ip2.z), color=fibercolor) )
- myscreen.addActor( camvtk.Sphere(center=(ip1.x,ip1.y,ip1.z),radius=0.005, color=camvtk.clColor( i.lower_cc) ) )
- myscreen.addActor( camvtk.Sphere(center=(ip2.x,ip2.y,ip2.z),radius=0.005, color=camvtk.clColor( i.upper_cc) ) )
- #cc1 = i.lower_cc
- #cc2 = i.upper_cc
- #myscreen.addActor( camvtk.Sphere(center=(cc1.x,cc1.y,cc1.z),radius=0.005, color=camvtk.lgreen ) )
- #myscreen.addActor( camvtk.Sphere(center=(cc2.x,cc2.y,cc2.z),radius=0.005, color=camvtk.lgreen ) )
-
-def yfiber(yvals,s,zh,myscreen):
- for y in yvals:
- f1 = ocl.Point(-20,y,zh) # start point of fiber
- f2 = ocl.Point(+20,y,zh) # end point of fiber
- f = ocl.Fiber( f1, f2)
- for t in s.getTriangles():
- i = ocl.Interval()
- #cutter.vertexPush(f,i,t)
- #cutter.facetPush(f,i,t)
- #cutter.edgePush(f,i,t)
- cutter.pushCutter(f,i,t)
- f.addInterval(i)
- drawFiber_clpts(myscreen, f, camvtk.red)
-
-def xfiber(xvals,s,zh,myscreen):
- for x in xvals:
- f1 = ocl.Point(x,-20,zh) # start point of fiber
- f2 = ocl.Point(x,+20,zh) # end point of fiber
- f = ocl.Fiber( f1, f2)
- for t in s.getTriangles():
- i = ocl.Interval()
- #cutter.vertexPush(f,i,t)
- #cutter.facetPush(f,i,t)
- #cutter.edgePush(f,i,t)
- cutter.pushCutter(f,i,t)
- f.addInterval(i)
- drawFiber_clpts(myscreen, f, camvtk.lblue)
-
-if __name__ == "__main__":
- print ocl.revision()
- myscreen = camvtk.VTKScreen()
- #stl = camvtk.STLSurf("../stl/gnu_tux_mod.stl")
- stl = camvtk.STLSurf("../stl/demo.stl")
- myscreen.addActor(stl)
- stl.SetWireframe()
- stl.SetColor((1,1,1))
- polydata = stl.src.GetOutput()
- s = ocl.STLSurf()
- camvtk.vtkPolyData2OCLSTL(polydata, s)
- print "STL surface read,", s.size(), "triangles"
-
- cutter = ocl.CylCutter(0.3, 6)
- print "lengt=", cutter.getLength()
- print "fiber...",
- range=30
- Nmax = 200
- yvals = [float(n-float(Nmax)/2)/Nmax*range for n in xrange(0,Nmax+1)]
- xvals = [float(n-float(Nmax)/2)/Nmax*range for n in xrange(0,Nmax+1)]
- zmin = -0.1
- zmax = 0.5
- zNmax = 2
- dz = (zmax-zmin)/(zNmax-1)
- zvals=[]
- #for n in xrange(0,zNmax):
- # zvals.append(zmin+n*dz)
- zvals.append(0.1)
- #zvals = [ float(n-float(zNmax)/2)/zNmax*range for n in xrange(0,zNmax+1)]
- #print zvals
- #exit()
- #cc = ocl.CCPoint()
- #zh = -0.1
- #zh = 0.2571567
-
- for zh in zvals:
- yfiber(yvals,s,zh,myscreen)
- xfiber(xvals,s,zh,myscreen)
-
- print "done."
- myscreen.camera.SetPosition(0.5, 3, 2)
- myscreen.camera.SetFocalPoint(0.5, 0.5, 0)
- camvtk.drawArrows(myscreen,center=(-0.5,-0.5,-0.5))
- camvtk.drawOCLtext(myscreen)
- myscreen.render()
- w2if = vtk.vtkWindowToImageFilter()
- w2if.SetInput(myscreen.renWin)
- lwr = vtk.vtkPNGWriter()
- lwr.SetInput( w2if.GetOutput() )
- myscreen.iren.Start()
- #raw_input("Press Enter to terminate")
diff -Nru opencamlib-11.10+git201801200005~ubuntu16.04.1/scripts/fiber/fiber_05_batch.py opencamlib-11.10-1/scripts/fiber/fiber_05_batch.py
--- opencamlib-11.10+git201801200005~ubuntu16.04.1/scripts/fiber/fiber_05_batch.py 2018-01-20 00:05:22.000000000 +0000
+++ opencamlib-11.10-1/scripts/fiber/fiber_05_batch.py 1970-01-01 00:00:00.000000000 +0000
@@ -1,86 +0,0 @@
-import ocl
-import camvtk
-import time
-import vtk
-import datetime
-import math
-
-if __name__ == "__main__":
- print ocl.revision()
-
- myscreen = camvtk.VTKScreen()
-
- a = ocl.Point(0,1,0.3)
- myscreen.addActor(camvtk.Point(center=(a.x,a.y,a.z), color=(1,0,1)))
- b = ocl.Point(1,0.5,0.3)
- myscreen.addActor(camvtk.Point(center=(b.x,b.y,b.z), color=(1,0,1)))
- c = ocl.Point(0,0,0)
- myscreen.addActor(camvtk.Point(center=(c.x,c.y,c.z), color=(1,0,1)))
- myscreen.addActor( camvtk.Line(p1=(a.x,a.y,a.z),p2=(c.x,c.y,c.z)) )
- myscreen.addActor( camvtk.Line(p1=(c.x,c.y,c.z),p2=(b.x,b.y,b.z)) )
- myscreen.addActor( camvtk.Line(p1=(a.x,a.y,a.z),p2=(b.x,b.y,b.z)) )
- t = ocl.Triangle(b,c,a)
- s = ocl.STLSurf()
- s.addTriangle(t) # a one-triangle STLSurf
-
- cutter = ocl.CylCutter(0.3,6)
- #cutter = ocl.BallCutter(0.3,6)
- print "fiber..."
- range=6
- Nmax = 800
- yvals = [float(n-float(Nmax)/2)/Nmax*range for n in xrange(0,Nmax+1)]
- xvals = [float(n-float(Nmax)/2)/Nmax*range for n in xrange(0,Nmax+1)]
- zmin = -0.1
- zmax = 0.5
- zNmax = 50
- dz = (zmax-zmin)/(zNmax-1)
- zvals=[]
- #zvals.append(0.2)
- for n in xrange(0,zNmax):
- zvals.append(zmin+n*dz)
-
- bpc_x = ocl.BatchPushCutter()
- bpc_x.setXDirection()
- bpc_x.setSTL(s)
- bpc_x.setCutter(cutter)
-
-
- bpc_y = ocl.BatchPushCutter()
- bpc_y.setYDirection()
- bpc_y.setSTL(s)
- bpc_y.setCutter(cutter)
-
-
- # create fibers
- for zh in zvals:
- for y in yvals:
- f1 = ocl.Point(-0.5,y,zh) # start point of fiber
- f2 = ocl.Point(1.5,y,zh) # end point of fiber
- f = ocl.Fiber( f1, f2)
- bpc_x.appendFiber(f)
- for x in xvals:
- f1 = ocl.Point(x,-0.5,zh) # start point of fiber
- f2 = ocl.Point(x,1.5,zh) # end point of fiber
- f = ocl.Fiber( f1, f2)
- bpc_y.appendFiber(f)
-
- # run
- bpc_x.run()
- bpc_y.run()
- clpoints = bpc_x.getCLPoints()
- clp2 = bpc_y.getCLPoints()
- clpoints +=clp2
- print "rendering raw CL-points."
-
- # draw the CL-points
- camvtk.drawCLPointCloud(myscreen, clpoints)
- print "done."
- myscreen.camera.SetPosition(0.5, 3, 2)
- myscreen.camera.SetFocalPoint(0.5, 0.5, 0)
- camvtk.drawArrows(myscreen,center=(-0.5,-0.5,-0.5))
- camvtk.drawOCLtext(myscreen)
-
- myscreen.render()
-
- myscreen.iren.Start()
- #raw_input("Press Enter to terminate")
diff -Nru opencamlib-11.10+git201801200005~ubuntu16.04.1/scripts/fiber/fiber_06_batch_stl.py opencamlib-11.10-1/scripts/fiber/fiber_06_batch_stl.py
--- opencamlib-11.10+git201801200005~ubuntu16.04.1/scripts/fiber/fiber_06_batch_stl.py 2018-01-20 00:05:22.000000000 +0000
+++ opencamlib-11.10-1/scripts/fiber/fiber_06_batch_stl.py 1970-01-01 00:00:00.000000000 +0000
@@ -1,115 +0,0 @@
-import ocl
-import camvtk
-import time
-import vtk
-import datetime
-import math
-
-def generateRange(zmin,zmax,zNmax):
- dz = (float(zmax)-float(zmin))/(zNmax-1)
- zvals=[]
- for n in xrange(0,zNmax):
- zvals.append(zmin+n*dz)
- return zvals
-
-
-if __name__ == "__main__":
- print ocl.revision()
-
- myscreen = camvtk.VTKScreen()
- #stl = camvtk.STLSurf("../stl/demo.stl")
- stl = camvtk.STLSurf("../stl/gnu_tux_mod.stl")
- myscreen.addActor(stl)
- #stl.SetWireframe()
- stl.SetSurface()
- stl.SetColor(camvtk.cyan)
- polydata = stl.src.GetOutput()
- s = ocl.STLSurf()
- camvtk.vtkPolyData2OCLSTL(polydata, s)
- print "STL surface read,", s.size(), "triangles"
- bounds = s.getBounds()
- print "STLSurf.Bounds()=", bounds
- cutter = ocl.CylCutter(0.3,6)
- #cutter = ocl.BallCutter(0.3,6)
-
- cutter.length = 4.0
- print cutter
- xmin=-1
- xmax=15
- N=100
- ymin=-1
- ymax=15
- yvals = generateRange(ymin,ymax,N)
- xvals = generateRange(xmin,xmax,N)
- #print xvals
- zmin = -0.1
- zmax = 2.75
- zNmax = 7
- zvals = generateRange(zmin,zmax,zNmax)
- print " calculating waterlines at ", len(zvals)," different z-heights"
- #print zvals
- bpc_x = ocl.BatchPushCutter()
- bpc_y = ocl.BatchPushCutter()
- bpc_x.setXDirection()
- bpc_y.setYDirection()
- bpc_x.setSTL(s)
- bpc_y.setSTL(s)
- bpc_x.setCutter(cutter)
- bpc_y.setCutter(cutter)
- # create fibers
- nfibers=0
- for zh in zvals:
- for y in yvals:
- f1 = ocl.Point(xmin,y,zh) # start point of fiber
- f2 = ocl.Point(xmax,y,zh) # end point of fiber
- f = ocl.Fiber( f1, f2)
- bpc_x.appendFiber(f)
-
- nfibers=nfibers+1
- for x in xvals:
- f1 = ocl.Point(x,ymin,zh) # start point of fiber
- f2 = ocl.Point(x,ymax,zh) # end point of fiber
- f = ocl.Fiber( f1, f2)
- bpc_y.appendFiber(f)
-
- nfibers=nfibers+1
- # run
- #t_before = time.time()
- #bpc2.pushCutter2()
- #t_after = time.time()
- #push_calctime = t_after-t_before
- #print " BPC done in ", push_calctime," s", bpc2.nCalls," push-calls"
- #print (push_calctime/bpc2.nCalls)*1e6, " us/call"
-
- t_before = time.time()
- bpc_x.run()
- bpc_y.run()
- t_after = time.time()
- push_calctime = t_after-t_before
- print " BPC 3 done in ", push_calctime," s", bpc_x.getCalls()," push-calls"
-
-
- clpoints = bpc_x.getCLPoints()
- clp2 = bpc_y.getCLPoints()
- clpoints+=clp2
- print "got ", len(clpoints), " CL-points"
- print "rendering raw CL-points."
-
- # draw the CL-points
- camvtk.drawCLPointCloud(myscreen, clpoints)
- for p in clpoints:
- myscreen.addActor( camvtk.Sphere(center=(p.x,p.y,p.z),radius=0.02, color=camvtk.clColor( p.cc() ) ) )
-
-
-
-
- print "done."
- myscreen.camera.SetPosition(0.5, 3, 2)
- myscreen.camera.SetFocalPoint(0.5, 0.5, 0)
- camvtk.drawArrows(myscreen,center=(-0.5,-0.5,-0.5))
- camvtk.drawOCLtext(myscreen)
-
- myscreen.render()
-
- myscreen.iren.Start()
- #raw_input("Press Enter to terminate")
diff -Nru opencamlib-11.10+git201801200005~ubuntu16.04.1/scripts/fiber/fiber_07_weave.py opencamlib-11.10-1/scripts/fiber/fiber_07_weave.py
--- opencamlib-11.10+git201801200005~ubuntu16.04.1/scripts/fiber/fiber_07_weave.py 2018-01-20 00:05:22.000000000 +0000
+++ opencamlib-11.10-1/scripts/fiber/fiber_07_weave.py 1970-01-01 00:00:00.000000000 +0000
@@ -1,128 +0,0 @@
-import ocl
-import camvtk
-import time
-import vtk
-import datetime
-import math
-
-if __name__ == "__main__":
- print ocl.revision()
- myscreen = camvtk.VTKScreen()
- a = ocl.Point(0,1,0.3)
- myscreen.addActor(camvtk.Point(center=(a.x,a.y,a.z), color=(1,0,1)))
- b = ocl.Point(1,0.5,0.3)
- myscreen.addActor(camvtk.Point(center=(b.x,b.y,b.z), color=(1,0,1)))
- c = ocl.Point(0,0,0.1)
- myscreen.addActor(camvtk.Point(center=(c.x,c.y,c.z), color=(1,0,1)))
- myscreen.addActor( camvtk.Line(p1=(a.x,a.y,a.z),p2=(c.x,c.y,c.z)) )
- myscreen.addActor( camvtk.Line(p1=(c.x,c.y,c.z),p2=(b.x,b.y,b.z)) )
- myscreen.addActor( camvtk.Line(p1=(a.x,a.y,a.z),p2=(b.x,b.y,b.z)) )
- t = ocl.Triangle(b,c,a)
- s = ocl.STLSurf()
- s.addTriangle(t) # a one-triangle STLSurf
-
- cutter = ocl.CylCutter(0.3, 5)
- #cutter = ocl.BallCutter(0.4, 5)
- #cutter = ocl.BullCutter(0.4, 0.1, 5)
-
- print "fiber..."
- range=4
- Nmax = 100
- yvals = [float(n-float(Nmax)/2)/Nmax*range for n in xrange(0,Nmax+1)]
- xvals = [float(n-float(Nmax)/2)/Nmax*range for n in xrange(0,Nmax+1)]
- zmin = -0.1
- zmax = 0.5
- zNmax = 5
- dz = (zmax-zmin)/(zNmax-1)
- zvals=[ 0.23]
- #zvals.append(0.2)
- #for n in xrange(0,zNmax):
- # zvals.append(zmin+n*dz)
-
- bpc_x = ocl.BatchPushCutter()
- bpc_y = ocl.BatchPushCutter()
- bpc_x.setXDirection()
- bpc_y.setYDirection()
- bpc_x.setSTL(s)
- bpc_y.setSTL(s)
- bpc_x.setCutter(cutter)
- bpc_y.setCutter(cutter)
- # create fibers
- for zh in zvals:
- for y in yvals:
- f1 = ocl.Point(-0.5,y,zh) # start point of fiber
- f2 = ocl.Point(1.5,y,zh) # end point of fiber
- f = ocl.Fiber( f1, f2)
- bpc_x.appendFiber(f)
- for x in xvals:
- f1 = ocl.Point(x,-0.5,zh) # start point of fiber
- f2 = ocl.Point(x,1.5,zh) # end point of fiber
- f = ocl.Fiber( f1, f2)
- bpc_y.appendFiber(f)
-
- # run
- bpc_x.run()
- bpc_y.run()
- clpoints = bpc_x.getCLPoints()
- clp2 = bpc_y.getCLPoints()
- clpoints+=clp2
- xfibers = bpc_x.getFibers()
- yfibers = bpc_y.getFibers()
- fibers = xfibers+yfibers
- print " got ",len(xfibers)," xfibers"
- print " got ",len(yfibers)," yfibers"
- print "rendering fibers and CL-points."
- w = ocl.Weave()
- print "push fibers to Weave...",
- for f in fibers:
- w.addFiber(f)
- print "done."
- print "Weave build()...",
- w.build()
- print "done"
- print "face_traverse..."
- w.face_traverse()
- print "done."
- w_clpts = w.getCLPoints()
- w_ipts = w.getIPoints()
- w_edges = w.getEdges()
- w_loop = w.getLoops()
-
- print " weave: got ", len(w_clpts)," CL-points and ", len(w_ipts)," internal points"
-
- print " got: ", len(w_edges), " edges"
- print " got: ", len(w_loop), " loop points"
- #zoffset = 0.0
- #for p in w_clpts:
- # myscreen.addActor( camvtk.Sphere(center=(p.x,p.y,p.z+zoffset), radius=0.0031, color=camvtk.red ) )
-
- previous = 0
- # draw the loop as a yellow line
- for loop in w_loop:
- np = 0
- for p in loop:
- #myscreen.addActor( camvtk.Sphere(center=(p.x,p.y,p.z+zoffset2), radius=0.006, color=camvtk.pink ) )
- if np is not 0:
- myscreen.addActor( camvtk.Line( p1=(previous.x,previous.y, previous.z),
- p2=(p.x,p.y,p.z), color=camvtk.yellow) )
- np=np+1
- previous = p
-
- # draw edges of weave
- ne = 0
- zoffset=0.1
- dzoffset = 0.0005
- for e in w_edges:
- p1 = e[0]
- p2 = e[1]
- myscreen.addActor( camvtk.Line( p1=( p1.x,p1.y,p1.z+zoffset+ne*dzoffset), p2=(p2.x,p2.y,p2.z+zoffset+ne*dzoffset) ) )
- ne = ne+1
-
- print "done."
- myscreen.camera.SetPosition(0.5, 3, 2)
- myscreen.camera.SetFocalPoint(0.5, 0.5, 0)
- camvtk.drawArrows(myscreen,center=(-0.5,-0.5,-0.5))
- camvtk.drawOCLtext(myscreen)
- myscreen.render()
- myscreen.iren.Start()
- #raw_input("Press Enter to terminate")
diff -Nru opencamlib-11.10+git201801200005~ubuntu16.04.1/scripts/fiber/fiber_08_stl_weave.py opencamlib-11.10-1/scripts/fiber/fiber_08_stl_weave.py
--- opencamlib-11.10+git201801200005~ubuntu16.04.1/scripts/fiber/fiber_08_stl_weave.py 2018-01-20 00:05:22.000000000 +0000
+++ opencamlib-11.10-1/scripts/fiber/fiber_08_stl_weave.py 1970-01-01 00:00:00.000000000 +0000
@@ -1,173 +0,0 @@
-import ocl
-import camvtk
-import time
-import vtk
-import datetime
-import math
-
-def generateRange(zmin,zmax,zNmax):
- dz = (float(zmax)-float(zmin))/(zNmax-1)
- zvals=[]
- for n in xrange(0,zNmax):
- zvals.append(zmin+n*dz)
- return zvals
-
-
-if __name__ == "__main__":
- print ocl.revision()
- myscreen = camvtk.VTKScreen()
- #stl = camvtk.STLSurf("../stl/demo.stl")
- stl = camvtk.STLSurf("../stl/gnu_tux_mod.stl")
- myscreen.addActor(stl)
- stl.SetWireframe()
- #stl.SetSurface()
- stl.SetColor(camvtk.cyan)
- polydata = stl.src.GetOutput()
- s = ocl.STLSurf()
- camvtk.vtkPolyData2OCLSTL(polydata, s)
- print "STL surface read,", s.size(), "triangles"
- bounds = s.getBounds()
- print "STLSurf.Bounds()=", bounds
- cutter = ocl.CylCutter(1.6,5)
- #cutter = ocl.BallCutter(0.3,5)
-
- print cutter
- xmin=-1
- xmax=15
- N=100
- ymin=-1
- ymax=15
- yvals = generateRange(ymin,ymax,N)
- xvals = generateRange(xmin,xmax,N)
- #print xvals
- zmin = -0.1
- zmax = 2.75
- zNmax = 5
- zvals = generateRange(zmin,zmax,zNmax)
- print " calculating waterlines at ", len(zvals)," different z-heights"
- #print zvals
- bpcx = ocl.BatchPushCutter()
- bpcy = ocl.BatchPushCutter()
- bpcx.setXDirection()
- bpcy.setYDirection()
- bpcx.setSTL(s)
- bpcy.setSTL(s)
- bpcx.setCutter(cutter)
- bpcy.setCutter(cutter)
- # create fibers
- nfibers=0
- for zh in zvals:
- for y in yvals:
- f1 = ocl.Point(xmin,y,zh) # start point of fiber
- f2 = ocl.Point(xmax,y,zh) # end point of fiber
- f = ocl.Fiber( f1, f2)
- bpcx.appendFiber(f)
- nfibers=nfibers+1
- for x in xvals:
- f1 = ocl.Point(x,ymin,zh) # start point of fiber
- f2 = ocl.Point(x,ymax,zh) # end point of fiber
- f = ocl.Fiber( f1, f2)
- bpcy.appendFiber(f)
- nfibers=nfibers+1
-
- # run
- t_before = time.time()
- bpcx.run()
- bpcy.run()
- t_after = time.time()
- push_calctime = t_after-t_before
-
-
-
- clpoints = bpcx.getCLPoints()
- clp2=bpcy.getCLPoints()
- clpoints+=clp2
- print "got ", len(clpoints), " CL-points"
- print "rendering raw CL-points."
-
- # draw the CL-points
- #camvtk.drawCLPointCloud(myscreen, clpoints)
- #for p in clpoints:
- # myscreen.addActor( camvtk.Sphere(center=(p.x,p.y,p.z),radius=0.02, color=camvtk.clColor( p.cc() ) ) )
-
-
- xfibers = bpcx.getFibers()
- yfibers = bpcy.getFibers()
- fibers=xfibers+yfibers
- # sort fibers into different z-levels
- sorted_fibers=[]
- for zh in zvals:
- zlevel_fibers=[]
- for f in fibers:
- if f.p1.z == zh:
- zlevel_fibers.append(f)
- sorted_fibers.append(zlevel_fibers)
- print " found ",len(sorted_fibers)," z-levels"
-
- n=0
- loops = []
- t2_before = time.time()
- for zlev_fibers in sorted_fibers:
- print " z-level ",n," at z=", zvals[n], " has ", len(zlev_fibers), "fibers"
- n=n+1
- w = ocl.Weave()
- for f in zlev_fibers:
- w.addFiber(f)
- print " build()...",
- w.build()
- print "done"
- print " split()...",
- subw = w.get_components()
- print " graph has ", len(subw)," sub-weaves"
- m=0
- for sw in subw:
- print m," face_traverse...",
- t_before = time.time()
- sw.face_traverse()
- t_after = time.time()
- calctime = t_after-t_before
- print "done in ", calctime," s"
- w_loop = sw.getLoops()
- for lop in w_loop:
- loops.append(lop)
- m=m+1
- t2_after = time.time()
- print " found", len(loops)," loops"
- print " loop extraction took ", t2_after-t2_before," seconds"
- # draw the loops
- for lop in loops:
- n = 0
- N = len(lop)
- first_point=ocl.Point(-1,-1,5)
- previous=ocl.Point(-1,-1,5)
- for p in lop:
- if n==0: # don't draw anything on the first iteration
- previous=p
- first_point = p
- elif n== (N-1): # the last point
- myscreen.addActor( camvtk.Line(p1=(previous.x,previous.y,previous.z),p2=(p.x,p.y,p.z),color=camvtk.yellow) ) # the normal line
- # and a line from p to the first point
- myscreen.addActor( camvtk.Line(p1=(p.x,p.y,p.z),p2=(first_point.x,first_point.y,first_point.z),color=camvtk.yellow) )
- else:
- myscreen.addActor( camvtk.Line(p1=(previous.x,previous.y,previous.z),p2=(p.x,p.y,p.z),color=camvtk.yellow) )
- previous=p
- n=n+1
-
- t2 = camvtk.Text()
- stltext = "%s\n%i triangles\n%i waterlines\n%i Fibers\n%i CL-points\n%i pushCutter() calls\n%0.1f seconds\n%0.3f us/call" \
- % ( str(cutter), s.size(), len(zvals), nfibers, len(clpoints), bpc.nCalls, push_calctime, 1e6* push_calctime/bpc.nCalls )
- t2.SetText(stltext)
- t2.SetPos( (50, myscreen.height-200) )
- myscreen.addActor( t2)
-
-
- print "done."
- myscreen.camera.SetPosition(0.5, 3, 2)
- myscreen.camera.SetFocalPoint(0.5, 0.5, 0)
- camvtk.drawArrows(myscreen,center=(-0.5,-0.5,-0.5))
- camvtk.drawOCLtext(myscreen)
-
- myscreen.render()
-
- myscreen.iren.Start()
- #raw_input("Press Enter to terminate")
diff -Nru opencamlib-11.10+git201801200005~ubuntu16.04.1/scripts/fiber/fiber_09_ballcutter.py opencamlib-11.10-1/scripts/fiber/fiber_09_ballcutter.py
--- opencamlib-11.10+git201801200005~ubuntu16.04.1/scripts/fiber/fiber_09_ballcutter.py 2018-01-20 00:05:22.000000000 +0000
+++ opencamlib-11.10-1/scripts/fiber/fiber_09_ballcutter.py 1970-01-01 00:00:00.000000000 +0000
@@ -1,100 +0,0 @@
-import ocl
-import camvtk
-import time
-import vtk
-import datetime
-import math
-def drawFiber(myscreen, f, fibercolor=camvtk.red):
- inter = f.getInts()
- for i in inter:
- if not i.empty():
- ip1 = f.point( i.lower )
- ip2 = f.point( i.upper )
- myscreen.addActor( camvtk.Line(p1=(ip1.x,ip1.y,ip1.z),p2=(ip2.x,ip2.y,ip2.z), color=fibercolor) )
- myscreen.addActor( camvtk.Sphere(center=(ip1.x,ip1.y,ip1.z),radius=0.005, color=camvtk.clColor( i.lower_cc) ) )
- myscreen.addActor( camvtk.Sphere(center=(ip2.x,ip2.y,ip2.z),radius=0.005, color=camvtk.clColor( i.upper_cc) ) )
- #cc1 = i.lower_cc
- #cc2 = i.upper_cc
- #myscreen.addActor( camvtk.Sphere(center=(cc1.x,cc1.y,cc1.z),radius=0.005, color=camvtk.lgreen ) )
- #myscreen.addActor( camvtk.Sphere(center=(cc2.x,cc2.y,cc2.z),radius=0.005, color=camvtk.lgreen ) )
- # cutter circle
- #c1 = camvtk.Circle(center=(ip1.x,ip1.y,ip1.z), radius = 0.3/2, color=fibercolor)
- #myscreen.addActor(c1)
- #c2 = camvtk.Circle(center=(ip2.x,ip2.y,ip2.z), radius = 0.3/2, color=fibercolor)
- #myscreen.addActor(c2)
-
-if __name__ == "__main__":
- print ocl.revision()
-
- myscreen = camvtk.VTKScreen()
-
- a = ocl.Point(0,1,0.3)
- myscreen.addActor(camvtk.Point(center=(a.x,a.y,a.z), color=(1,0,1)))
- b = ocl.Point(1,0.5,0.3)
- myscreen.addActor(camvtk.Point(center=(b.x,b.y,b.z), color=(1,0,1)))
- c = ocl.Point(0,0,0)
- myscreen.addActor(camvtk.Point(center=(c.x,c.y,c.z), color=(1,0,1)))
- myscreen.addActor( camvtk.Line(p1=(a.x,a.y,a.z),p2=(c.x,c.y,c.z)) )
- myscreen.addActor( camvtk.Line(p1=(c.x,c.y,c.z),p2=(b.x,b.y,b.z)) )
- myscreen.addActor( camvtk.Line(p1=(a.x,a.y,a.z),p2=(b.x,b.y,b.z)) )
- t = ocl.Triangle(b,c,a)
- s = ocl.STLSurf()
- s.addTriangle(t) # a one-triangle STLSurf
- length = 10
- #cutter = ocl.CylCutter(0.3, length)
- cutter = ocl.BallCutter(0.3, length)
-
- print "fiber..."
- range=4
- Nmax = 100
- yvals = [float(n-float(Nmax)/2)/Nmax*range for n in xrange(0,Nmax+1)]
- xvals = [float(n-float(Nmax)/2)/Nmax*range for n in xrange(0,Nmax+1)]
- zmin = -0.1
- zmax = 0.5
- zNmax = 20
- dz = (zmax-zmin)/(zNmax-1)
- zvals=[]
- zvals.append(0.2)
- for n in xrange(0,zNmax):
- zvals.append(zmin+n*dz)
-
- bpc = ocl.BatchPushCutter()
- bpc.setSTL(s)
- bpc.setCutter(cutter)
- # create fibers
- for zh in zvals:
- for y in yvals:
- f1 = ocl.Point(-0.5,y,zh) # start point of fiber
- f2 = ocl.Point(1.5,y,zh) # end point of fiber
- f = ocl.Fiber( f1, f2)
- bpc.appendFiber(f)
- for x in xvals:
- f1 = ocl.Point(x,-0.5,zh) # start point of fiber
- f2 = ocl.Point(x,1.5,zh) # end point of fiber
- f = ocl.Fiber( f1, f2)
- bpc.appendFiber(f)
-
- # run
- bpc.run()
- clpoints = bpc.getCLPoints()
- fibers = bpc.getFibers()
- print " got ",len(fibers)," fibers from bpc"
- print "rendering fibers and CL-points."
- #camvtk.drawCLPointCloud(myscreen, clpoints)
- for f in fibers:
- drawFiber(myscreen, f, camvtk.red)
-
- #exit()
-
-
-
- print "done."
- myscreen.camera.SetPosition(0.5, 3, 2)
- myscreen.camera.SetFocalPoint(0.5, 0.5, 0)
- camvtk.drawArrows(myscreen,center=(-0.5,-0.5,-0.5))
- camvtk.drawOCLtext(myscreen)
-
- myscreen.render()
-
- myscreen.iren.Start()
- #raw_input("Press Enter to terminate")
diff -Nru opencamlib-11.10+git201801200005~ubuntu16.04.1/scripts/fiber/fiber_10_offsets.py opencamlib-11.10-1/scripts/fiber/fiber_10_offsets.py
--- opencamlib-11.10+git201801200005~ubuntu16.04.1/scripts/fiber/fiber_10_offsets.py 2018-01-20 00:05:22.000000000 +0000
+++ opencamlib-11.10-1/scripts/fiber/fiber_10_offsets.py 1970-01-01 00:00:00.000000000 +0000
@@ -1,118 +0,0 @@
-import ocl
-import camvtk
-import time
-import vtk
-import datetime
-import math
-
-def generateRange(zmin,zmax,zNmax):
- if zNmax>1:
- dz = (float(zmax)-float(zmin))/(zNmax-1)
- else:
- dz = 0
- zvals=[]
- for n in xrange(0,zNmax):
- zvals.append(zmin+n*dz)
- return zvals
-
-def waterline(cutter, s, zh, tol = 0.1 ):
- bpc = ocl.BatchPushCutter()
- bpc.setSTL(s)
- bpc.setCutter(cutter)
- bounds = s.getBounds()
- xmin= bounds[0] - 2*cutter.radius()
- xmax= bounds[1] + 2*cutter.radius()
- ymin= bounds[2] - 2*cutter.radius()
- ymax= bounds[3] + 2*cutter.radius()
- Nx= int( (xmax-xmin)/tol )
- Ny= int( (ymax-ymin)/tol )
- xvals = generateRange(xmin,xmax,Nx)
- yvals = generateRange(ymin,ymax,Ny)
- for y in yvals:
- f1 = ocl.Point(xmin,y,zh) # start point of fiber
- f2 = ocl.Point(xmax,y,zh) # end point of fiber
- f = ocl.Fiber( f1, f2)
- bpc.appendFiber(f)
- for x in xvals:
- f1 = ocl.Point(x,ymin,zh) # start point of fiber
- f2 = ocl.Point(x,ymax,zh) # end point of fiber
- f = ocl.Fiber( f1, f2)
- bpc.appendFiber(f)
- bpc.run()
- fibers = bpc.getFibers() # get fibers
- w = ocl.Weave()
- for f in fibers:
- w.addFiber(f)
-
- print " build()...",
- w.build()
- print "done"
- print " split()...",
- subw = w.get_components()
- print "done. graph has", len(subw),"sub-weaves"
- m=0
- loops = []
- for sw in subw:
- print m," face_traverse...",
- t_before = time.time()
- sw.face_traverse()
- t_after = time.time()
- calctime = t_after-t_before
- print "done in ", calctime," s."
- sw_loops = sw.getLoops()
- for lop in sw_loops:
- loops.append(lop)
- m=m+1
- return loops
-
-if __name__ == "__main__":
- print ocl.revision()
- myscreen = camvtk.VTKScreen()
- #stl = camvtk.STLSurf("../stl/demo.stl")
- stl = camvtk.STLSurf("../stl/gnu_tux_mod.stl")
- myscreen.addActor(stl)
- stl.SetWireframe()
- #stl.SetSurface()
- stl.SetColor(camvtk.cyan)
- polydata = stl.src.GetOutput()
- s = ocl.STLSurf()
- camvtk.vtkPolyData2OCLSTL(polydata, s)
- print "STL surface read,", s.size(), "triangles"
- zh=1.9
- cutter_diams = generateRange(0.1, 6, 5)
- loops = []
- length = 20 # cutter length
- for diam in cutter_diams:
- cutter = ocl.CylCutter( diam, length )
- cutter_loops = waterline(cutter, s, zh, 0.05 )
- for l in cutter_loops:
- loops.append(l)
-
- print "All waterlines done. Got", len(loops)," loops in total."
- # draw the loops
- for lop in loops:
- n = 0
- N = len(lop)
- first_point=ocl.Point(-1,-1,5)
- previous=ocl.Point(-1,-1,5)
- for p in lop:
- if n==0: # don't draw anything on the first iteration
- previous=p
- first_point = p
- elif n== (N-1): # the last point
- myscreen.addActor( camvtk.Line(p1=(previous.x,previous.y,previous.z),p2=(p.x,p.y,p.z),color=camvtk.yellow) ) # the normal line
- # and a line from p to the first point
- myscreen.addActor( camvtk.Line(p1=(p.x,p.y,p.z),p2=(first_point.x,first_point.y,first_point.z),color=camvtk.yellow) )
- else:
- myscreen.addActor( camvtk.Line(p1=(previous.x,previous.y,previous.z),p2=(p.x,p.y,p.z),color=camvtk.yellow) )
- previous=p
- n=n+1
-
- print "done."
- myscreen.camera.SetPosition(0.5, 3, 2)
- myscreen.camera.SetFocalPoint(0.5, 0.5, 0)
- camvtk.drawArrows(myscreen,center=(-0.5,-0.5,-0.5))
- camvtk.drawOCLtext(myscreen)
- myscreen.render()
- myscreen.iren.Start()
- #raw_input("Press Enter to terminate")
diff -Nru opencamlib-11.10+git201801200005~ubuntu16.04.1/scripts/fiber/fiber_12_waterline_onetriangle.py opencamlib-11.10-1/scripts/fiber/fiber_12_waterline_onetriangle.py
--- opencamlib-11.10+git201801200005~ubuntu16.04.1/scripts/fiber/fiber_12_waterline_onetriangle.py 2018-01-20 00:05:22.000000000 +0000
+++ opencamlib-11.10-1/scripts/fiber/fiber_12_waterline_onetriangle.py 1970-01-01 00:00:00.000000000 +0000
@@ -1,95 +0,0 @@
-import ocl
-import camvtk
-import time
-import vtk
-import datetime
-import math
-
-def loop_waterline(zh, cutter,s):
- range=2
- Nmax = 200
- yvals = [float(n-float(Nmax)/2)/Nmax*range for n in xrange(0,Nmax+1)]
- xvals = [float(n-float(Nmax)/2)/Nmax*range for n in xrange(0,Nmax+1)]
- bpc = ocl.BatchPushCutter()
- bpc.setXDirection()
- bpc.setSTL(s)
- bpc.setCutter(cutter)
- for y in yvals:
- f1 = ocl.Point(-range,y,zh) # start point of fiber
- f2 = ocl.Point(+range,y,zh) # end point of fiber
- f = ocl.Fiber( f1, f2)
- bpc.appendFiber(f)
- for x in xvals:
- f1 = ocl.Point(x,-range,zh) # start point of fiber
- f2 = ocl.Point(x,+range,zh) # end point of fiber
- f = ocl.Fiber( f1, f2)
- bpc.appendFiber(f)
- bpc.run()
- clpoints = bpc.getCLPoints()
- fibers = bpc.getFibers()
- w = ocl.Weave()
- print "Weave...",
- for f in fibers:
- w.addFiber(f)
- print "build()...",
- w.build()
- print "face_traverse()...",
- w.face_traverse()
- print "done."
- return w.getLoops()
-
-def drawLoop(myscreen, w_loop): # draw the loop as a yellow line
- previous = 0
- for loop in w_loop:
- np = 0
- for p in loop:
- if np is not 0:
- myscreen.addActor( camvtk.Line( p1=(previous.x,previous.y, previous.z),
- p2=(p.x,p.y,p.z), color=camvtk.yellow) )
- np=np+1
- previous = p
-
-if __name__ == "__main__":
- print ocl.revision()
- myscreen = camvtk.VTKScreen()
- a = ocl.Point(0,1,0.3)
- myscreen.addActor(camvtk.Point(center=(a.x,a.y,a.z), color=(1,0,1)))
- b = ocl.Point(1,0.5,0.3)
- myscreen.addActor(camvtk.Point(center=(b.x,b.y,b.z), color=(1,0,1)))
- c = ocl.Point(0,0,0.1)
- myscreen.addActor(camvtk.Point(center=(c.x,c.y,c.z), color=(1,0,1)))
- myscreen.addActor( camvtk.Line(p1=(a.x,a.y,a.z),p2=(c.x,c.y,c.z)) )
- myscreen.addActor( camvtk.Line(p1=(c.x,c.y,c.z),p2=(b.x,b.y,b.z)) )
- myscreen.addActor( camvtk.Line(p1=(a.x,a.y,a.z),p2=(b.x,b.y,b.z)) )
- t = ocl.Triangle(b,c,a)
- s = ocl.STLSurf()
- s.addTriangle(t) # a one-triangle STLSurf
- diameter = 0.4
- angle = math.pi/4
- length = 5
- cutter = ocl.CylCutter(0.3, 5)
- #cutter = ocl.BallCutter(0.4, 5)
- #cutter = ocl.BullCutter(0.4, 0.1, 5)
- #cutter = ocl.ConeCutter(diameter, angle, length)
- print cutter
- zstart = 0
- zend = 0.35
- zvals=[]
- Nz = 7
- for n in xrange(0,Nz):
- zvals.append( zstart + n*(zend-zstart)/float(Nz-1) )
- for zh in zvals:
- print "zh=", zh
- w_loop = loop_waterline(zh, cutter,s)
- drawLoop( myscreen, w_loop )
-
- print "done."
- myscreen.camera.SetPosition(0.5, 3, 2)
- myscreen.camera.SetFocalPoint(0.5, 0.5, 0)
- camvtk.drawArrows(myscreen,center=(-0.5,-0.5,-0.5))
- camvtk.drawOCLtext(myscreen)
-
- myscreen.render()
-
- myscreen.iren.Start()
- #raw_input("Press Enter to terminate")
diff -Nru opencamlib-11.10+git201801200005~ubuntu16.04.1/scripts/fiber/fiber_13_onetri_cutter_comparison.py opencamlib-11.10-1/scripts/fiber/fiber_13_onetri_cutter_comparison.py
--- opencamlib-11.10+git201801200005~ubuntu16.04.1/scripts/fiber/fiber_13_onetri_cutter_comparison.py 2018-01-20 00:05:22.000000000 +0000
+++ opencamlib-11.10-1/scripts/fiber/fiber_13_onetri_cutter_comparison.py 1970-01-01 00:00:00.000000000 +0000
@@ -1,141 +0,0 @@
-import ocl
-import camvtk
-import time
-import vtk
-import datetime
-import math
-
-def drawPoints(myscreen, clpoints, ccpoints):
- c=camvtk.PointCloud( pointlist=clpoints, collist=ccpoints)
- c.SetPoints()
- myscreen.addActor(c )
-
-def drawFiber(myscreen, f, fibercolor):
- inter = f.getInts()
- print "fiber has ", len(inter) , " intervals"
- for i in inter:
- if not i.empty():
- ip1 = f.point( i.lower )
- ip2 = f.point( i.upper )
- myscreen.addActor( camvtk.Line(p1=(ip1.x,ip1.y,ip1.z),p2=(ip2.x,ip2.y,ip2.z), color=fibercolor) )
- myscreen.addActor( camvtk.Sphere(center=(ip1.x,ip1.y,ip1.z),radius=0.005, color=camvtk.clColor( i.lower_cc) ) )
- myscreen.addActor( camvtk.Sphere(center=(ip2.x,ip2.y,ip2.z),radius=0.005, color=camvtk.clColor( i.upper_cc) ) )
- #cc1 = i.lower_cc
- #cc2 = i.upper_cc
- #myscreen.addActor( camvtk.Sphere(center=(cc1.x,cc1.y,cc1.z),radius=0.005, color=camvtk.lgreen ) )
- #myscreen.addActor( camvtk.Sphere(center=(cc2.x,cc2.y,cc2.z),radius=0.005, color=camvtk.lgreen ) )
- # cutter circle
- #c1 = camvtk.Circle(center=(ip1.x,ip1.y,ip1.z), radius = 0.3/2, color=fibercolor)
- #myscreen.addActor(c1)
- #c2 = camvtk.Circle(center=(ip2.x,ip2.y,ip2.z), radius = 0.3/2, color=fibercolor)
- #myscreen.addActor(c2)
-
-def drawFiber_clpts(myscreen, f, clcolor):
- inter = f.getInts()
- #print "fiber has ", len(inter) , " intervals"
- for i in inter:
- if not i.empty():
- ip1 = f.point( i.lower )
- ip2 = f.point( i.upper )
- #myscreen.addActor( camvtk.Line(p1=(ip1.x,ip1.y,ip1.z),p2=(ip2.x,ip2.y,ip2.z), color=fibercolor) )
- sphcolor = camvtk.clColor( i.lower_cc)
- myscreen.addActor( camvtk.Sphere(center=(ip1.x,ip1.y,ip1.z),radius=0.005, color=sphcolor ) )
- sphcolor = camvtk.clColor( i.upper_cc)
- myscreen.addActor( camvtk.Sphere(center=(ip2.x,ip2.y,ip2.z),radius=0.005, color=sphcolor ) )
- #cc1 = i.lower_cc
- #cc2 = i.upper_cc
- #myscreen.addActor( camvtk.Sphere(center=(cc1.x,cc1.y,cc1.z),radius=0.005, color=camvtk.pink ) )
- #myscreen.addActor( camvtk.Sphere(center=(cc2.x,cc2.y,cc2.z),radius=0.005, color=camvtk.pink ) )
-
-def yfiber(yvals,t,zh,myscreen,cutter,color):
- for y in yvals:
- f1 = ocl.Point(-0.5,y,zh) # start point of fiber
- f2 = ocl.Point(1.5,y,zh) # end point of fiber
- f = ocl.Fiber( f1, f2)
- i = ocl.Interval()
- #cutter.vertexPush(f,i,t)
- #cutter.facetPush(f,i,t)
- #cutter.edgePush(f,i,t)
- cutter.pushCutter(f,i,t)
- f.addInterval(i)
- drawFiber_clpts(myscreen, f, color)
-
-def xfiber(xvals,t,zh,myscreen,cutter,color):
- for x in xvals:
- f1 = ocl.Point(x,-0.5,zh) # start point of fiber
- f2 = ocl.Point(x,1.5,zh) # end point of fiber
- f = ocl.Fiber( f1, f2)
- i = ocl.Interval()
- #cutter.vertexPush(f,i,t)
- #cutter.facetPush(f,i,t)
- #cutter.edgePush(f,i,t)
- cutter.pushCutter(f,i,t)
- f.addInterval(i)
- drawFiber_clpts(myscreen, f, color)
-
-def oneCutterWaterline(myscreen, cutter, zh, color):
- range=2
- Nmax = 100
- yvals = [float(n-float(Nmax)/2)/Nmax*range for n in xrange(0,Nmax+1)]
- xvals = [float(n-float(Nmax)/2)/Nmax*range for n in xrange(0,Nmax+1)]
- yfiber(yvals,t,zh,myscreen,cutter, color)
- xfiber(xvals,t,zh,myscreen,cutter, color)
-
-if __name__ == "__main__":
- print ocl.revision()
- myscreen = camvtk.VTKScreen()
- myscreen.camera.SetPosition(0.5, 3, 2)
- myscreen.camera.SetFocalPoint(0.5, 0.5, 0)
- camvtk.drawArrows(myscreen,center=(-0.5,-0.5,-0.5))
- camvtk.drawOCLtext(myscreen)
-
- a = ocl.Point(0,1,0.2)
- b = ocl.Point(1,0.5,0.0)
- c = ocl.Point(0.1,0.1,0.0)
- myscreen.addActor(camvtk.Point(center=(a.x,a.y,a.z), color=(1,0,1)))
- myscreen.addActor(camvtk.Point(center=(b.x,b.y,b.z), color=(1,0,1)))
- myscreen.addActor(camvtk.Point(center=(c.x,c.y,c.z), color=(1,0,1)))
- myscreen.addActor( camvtk.Line(p1=(a.x,a.y,a.z),p2=(c.x,c.y,c.z)) )
- myscreen.addActor( camvtk.Line(p1=(c.x,c.y,c.z),p2=(b.x,b.y,b.z)) )
- myscreen.addActor( camvtk.Line(p1=(a.x,a.y,a.z),p2=(b.x,b.y,b.z)) )
- t = ocl.Triangle(b,c,a)
- angle = math.pi/4
- diameter=0.3
- length=5
- cutter1 = ocl.BallCutter(diameter, length)
- cutter2 = ocl.CylCutter(diameter, length)
- cutter3 = ocl.BullCutter(diameter, diameter/4, length)
- cutter4 = ocl.ConeCutter(diameter, angle, length)
- #cutter = cutter.offsetCutter( 0.1 )
-
-
- range=2
- Nmax = 50
- yvals = [float(n-float(Nmax)/2)/Nmax*range for n in xrange(0,Nmax+1)]
- xvals = [float(n-float(Nmax)/2)/Nmax*range for n in xrange(0,Nmax+1)]
- zmin = -0.1
- zmax = 0.25
- zNmax =5
- dz = (zmax-zmin)/(zNmax-1)
- zvals=[]
- for n in xrange(0,zNmax):
- zvals.append(zmin+n*dz)
-
- for zh in zvals:
- oneCutterWaterline(myscreen, cutter1, zh, camvtk.yellow)
- oneCutterWaterline(myscreen, cutter2, zh, camvtk.cyan)
- oneCutterWaterline(myscreen, cutter3, zh, camvtk.mag)
- oneCutterWaterline(myscreen, cutter4, zh, camvtk.mag)
- #yfiber(yvals,t,zh,myscreen)
- #xfiber(xvals,t,zh,myscreen)
-
- print "done."
-
- myscreen.render()
- w2if = vtk.vtkWindowToImageFilter()
- w2if.SetInput(myscreen.renWin)
- lwr = vtk.vtkPNGWriter()
- lwr.SetInput( w2if.GetOutput() )
-
- myscreen.iren.Start()
- #raw_input("Press Enter to terminate")
diff -Nru opencamlib-11.10+git201801200005~ubuntu16.04.1/scripts/fiber/fiber_14_z-levels_cc-colors.py opencamlib-11.10-1/scripts/fiber/fiber_14_z-levels_cc-colors.py
--- opencamlib-11.10+git201801200005~ubuntu16.04.1/scripts/fiber/fiber_14_z-levels_cc-colors.py 2018-01-20 00:05:22.000000000 +0000
+++ opencamlib-11.10-1/scripts/fiber/fiber_14_z-levels_cc-colors.py 1970-01-01 00:00:00.000000000 +0000
@@ -1,138 +0,0 @@
-import ocl
-import camvtk
-import time
-import vtk
-import datetime
-import math
-
-def drawFiber_clpts(myscreen, f, fibercolor=camvtk.red):
- inter = f.getInts()
- #print "fiber has ", len(inter) , " intervals"
- for i in inter:
- if not i.empty():
- ip1 = f.point( i.lower )
- ip2 = f.point( i.upper )
- ballradius = 0.002
- ballradius = 0.005
- #myscreen.addActor( camvtk.Line(p1=(ip1.x,ip1.y,ip1.z),p2=(ip2.x,ip2.y,ip2.z), color=fibercolor) )
- myscreen.addActor( camvtk.Sphere(center=(ip1.x,ip1.y,ip1.z),radius=ballradius, color=camvtk.clColor( i.lower_cc) ) )
- myscreen.addActor( camvtk.Sphere(center=(ip2.x,ip2.y,ip2.z),radius=ballradius, color=camvtk.clColor( i.upper_cc) ) )
-
- #cc1 = i.lower_cc
- #cc2 = i.upper_cc
- #myscreen.addActor( camvtk.Sphere(center=(cc1.x,cc1.y,cc1.z),radius=0.005, color=camvtk.pink ) )
- #myscreen.addActor( camvtk.Sphere(center=(cc2.x,cc2.y,cc2.z),radius=0.005, color=camvtk.pink ) )
-
-# colors from camvtk.py:
-# ocl.CCType.VERTEX: col = red
-# ocl.CCType.EDGE_HORIZ: col = orange
-# ocl.CCType.EDGE_SHAFT: col = mag
-
-def yfiber(yvals,t,zh,myscreen):
- for y in yvals:
- f1 = ocl.Point(-3.5,y,zh) # start point of fiber
- f2 = ocl.Point(3.5,y,zh) # end point of fiber
- f = ocl.Fiber( f1, f2)
- i = ocl.Interval()
- cutter.pushCutter(f,i,t)
- f.addInterval(i)
- drawFiber_clpts(myscreen, f, camvtk.red)
-
-def xfiber(xvals,t,zh,myscreen):
- for x in xvals:
- f1 = ocl.Point(x,-15.5,zh) # start point of fiber
- f2 = ocl.Point(x,55.5,zh) # end point of fiber
- f = ocl.Fiber( f1, f2)
- i = ocl.Interval()
- cutter.pushCutter(f,i,t)
- f.addInterval(i)
- drawFiber_clpts(myscreen, f, camvtk.lblue)
-
-if __name__ == "__main__":
- print ocl.revision()
- myscreen = camvtk.VTKScreen()
-
- ztri = 0.3 # this is the shallow case
- #ztri = 0.8 # this produces the steep case where we hit the circular rim
-
- ztri_lo = 0.1
- a = ocl.Point(0,1,ztri)
- b = ocl.Point(1,0.5,ztri)
- c = ocl.Point(0.2,0.2,ztri_lo)
-
- a = ocl.Point(0,1,0.3)
- b = ocl.Point(1,0.5,0.3)
- c = ocl.Point(0,0,0)
-
- myscreen.addActor(camvtk.Point(center=(a.x,a.y,a.z), color=(1,0,1)))
- myscreen.addActor(camvtk.Point(center=(b.x,b.y,b.z), color=(1,0,1)))
- myscreen.addActor(camvtk.Point(center=(c.x,c.y,c.z), color=(1,0,1)))
- myscreen.addActor( camvtk.Line(p1=(a.x,a.y,a.z),p2=(c.x,c.y,c.z)) )
- myscreen.addActor( camvtk.Line(p1=(c.x,c.y,c.z),p2=(b.x,b.y,b.z)) )
- myscreen.addActor( camvtk.Line(p1=(a.x,a.y,a.z),p2=(b.x,b.y,b.z)) )
- t = ocl.Triangle(b,c,a)
- angle = math.pi/5
- diameter=0.6
- length=25
- cutter = ocl.BallCutter(diameter, length)
- #cutter = ocl.CylCutter(diameter, length)
- #cutter = ocl.BullCutter(diameter, diameter/4, length)
- #cutter = ocl.ConeCutter(diameter, angle, length)
- #cutter = cutter.offsetCutter( 0.1 )
-
- #cutter = ocl.CompCylCutter(diameter, length)
- #cutter = ocl.CompBallCutter(diameter, length)
-
- #cutter = ocl.CylConeCutter(diameter/float(3), diameter, math.pi/float(9))
- cutter = ocl.BallConeCutter(diameter/float(3), diameter, math.pi/float(5))
-
-
- print "cutter= ", cutter
- print "length=", cutter.getLength()
- print "fiber..."
- fiberrange=5
- Nmax = 100
- yvals = [float(n-float(Nmax)/2)/Nmax*fiberrange for n in xrange(0,Nmax+1)]
- xvals = [float(n-float(Nmax)/2)/Nmax*fiberrange for n in xrange(0,Nmax+1)]
- """
- zmin = ztri_lo - 0.2
- zmax = ztri
- zNmax = 20
- dz = (zmax-zmin)/(zNmax-1)
- zvals=[]
- for n in xrange(0,zNmax):
- zvals.append(zmin+n*dz)
- """
-
- zheights=[]
- Nmax=30
- zmin=-0.85
- zmax= 0.3
- dz = (zmax-zmin)/float(Nmax-1)
- z = zmin
- for n in xrange(Nmax):
- zheights.append(z)
- z=z+dz
- #zheights= []
- #zheights.append(-0.25)
-
- print len(zheights)," to do: ",
- n=0
- for zh in zheights:
- print n,
- yfiber(yvals,t,zh,myscreen)
- xfiber(xvals,t,zh,myscreen)
- n=n+1
- print "done."
- myscreen.camera.SetPosition(-1, -1, 3)
- myscreen.camera.SetFocalPoint(0.5, 0.5, 0)
- camvtk.drawArrows(myscreen,center=(-0.5,-0.5,-0.5))
- camvtk.drawOCLtext(myscreen)
- myscreen.render()
- w2if = vtk.vtkWindowToImageFilter()
- w2if.SetInput(myscreen.renWin)
- lwr = vtk.vtkPNGWriter()
- lwr.SetInput( w2if.GetOutput() )
-
- myscreen.iren.Start()
- #raw_input("Press Enter to terminate")
diff -Nru opencamlib-11.10+git201801200005~ubuntu16.04.1/scripts/fiber/fiber_15_conecutter_anim.py opencamlib-11.10-1/scripts/fiber/fiber_15_conecutter_anim.py
--- opencamlib-11.10+git201801200005~ubuntu16.04.1/scripts/fiber/fiber_15_conecutter_anim.py 2018-01-20 00:05:22.000000000 +0000
+++ opencamlib-11.10-1/scripts/fiber/fiber_15_conecutter_anim.py 1970-01-01 00:00:00.000000000 +0000
@@ -1,140 +0,0 @@
-import ocl
-import camvtk
-import time
-import vtk
-import datetime
-import math
-import os
-
-def drawFiber_clpts(myscreen, f, fibercolor=camvtk.red):
- inter = f.getInts()
- #print "fiber has ", len(inter) , " intervals"
- for i in inter:
- if not i.empty():
- ip1 = f.point( i.lower )
- ip2 = f.point( i.upper )
- #myscreen.addActor( camvtk.Line(p1=(ip1.x,ip1.y,ip1.z),p2=(ip2.x,ip2.y,ip2.z), color=fibercolor) )
- myscreen.addActor( camvtk.Sphere(center=(ip1.x,ip1.y,ip1.z),radius=0.005, color=camvtk.clColor( i.lower_cc) ) )
- myscreen.addActor( camvtk.Sphere(center=(ip2.x,ip2.y,ip2.z),radius=0.005, color=camvtk.clColor( i.upper_cc) ) )
- #cc1 = i.lower_cc
- #cc2 = i.upper_cc
- #myscreen.addActor( camvtk.Sphere(center=(cc1.x,cc1.y,cc1.z),radius=0.005, color=camvtk.pink ) )
- #myscreen.addActor( camvtk.Sphere(center=(cc2.x,cc2.y,cc2.z),radius=0.005, color=camvtk.pink ) )
-
-# colors from camvtk.py:
-# ocl.CCType.VERTEX: col = red
-# ocl.CCType.EDGE_HORIZ: col = orange
-# ocl.CCType.EDGE_SHAFT: col = mag
-
-def yfiber(cutter,yvals,t,zh,myscreen):
- for y in yvals:
- f1 = ocl.Point(-5.5,y,zh) # start point of fiber
- f2 = ocl.Point(5.5,y,zh) # end point of fiber
- f = ocl.Fiber( f1, f2)
- i = ocl.Interval()
- cutter.pushCutter(f,i,t)
- f.addInterval(i)
- drawFiber_clpts(myscreen, f, camvtk.red)
-
-def xfiber(cutter,xvals,t,zh,myscreen):
- for x in xvals:
- f1 = ocl.Point(x,-5.5,zh) # start point of fiber
- f2 = ocl.Point(x,5.5,zh) # end point of fiber
- f = ocl.Fiber( f1, f2)
- i = ocl.Interval()
- cutter.pushCutter(f,i,t)
- f.addInterval(i)
- drawFiber_clpts(myscreen, f, camvtk.lblue)
-
-def drawScreen(a,b,c,filename,write_flag):
- print ocl.revision()
- myscreen = camvtk.VTKScreen()
- z_hi = a.z
- if b.z > z_hi:
- z_hi = b.z
- if c.z > z_hi:
- z_hi = c.z
-
- z_lo = a.z
- if b.z < z_lo:
- z_lo = b.z
- if c.z < z_lo:
- z_lo = c.z
- #z_hi = 0.3 # this is the shallow case
- #ztri = 0.8 # this produces the steep case where we hit the circular rim
-
- #z_lo = 0.1
- #a = ocl.Point(0,1,ztri)
- #b = ocl.Point(1,0.5,ztri)
- #c = ocl.Point(0.2,0.2,ztri_lo)
-
- myscreen.addActor(camvtk.Point(center=(a.x,a.y,a.z), color=(1,0,1)))
- myscreen.addActor(camvtk.Point(center=(b.x,b.y,b.z), color=(1,0,1)))
- myscreen.addActor(camvtk.Point(center=(c.x,c.y,c.z), color=(1,0,1)))
- myscreen.addActor( camvtk.Line(p1=(a.x,a.y,a.z),p2=(c.x,c.y,c.z)) )
- myscreen.addActor( camvtk.Line(p1=(c.x,c.y,c.z),p2=(b.x,b.y,b.z)) )
- myscreen.addActor( camvtk.Line(p1=(a.x,a.y,a.z),p2=(b.x,b.y,b.z)) )
- t = ocl.Triangle(b,c,a)
- angle = math.pi/5
- diameter=0.3
- length=5
- #cutter = ocl.BallCutter(diameter, length)
- #cutter = ocl.CylCutter(diameter, length)
- #cutter = ocl.BullCutter(diameter, diameter/4, length)
- cutter = ocl.ConeCutter(diameter, angle, length)
- #cutter = cutter.offsetCutter( 0.1 )
-
- print "cutter= ", cutter
- print "length=", cutter.getLength()
- print "fiber..."
- range=2
- Nmax = 100
- yvals = [float(n-float(Nmax)/2)/Nmax*range for n in xrange(0,Nmax+1)]
- xvals = [float(n-float(Nmax)/2)/Nmax*range for n in xrange(0,Nmax+1)]
- zmin = z_lo - 0.3
- zmax = z_hi
- zNmax = 20
- dz = (zmax-zmin)/(zNmax-1)
- zvals=[]
- for n in xrange(0,zNmax):
- zvals.append(zmin+n*dz)
- for zh in zvals:
- yfiber(cutter,yvals,t,zh,myscreen)
- xfiber(cutter,xvals,t,zh,myscreen)
- print "done."
- myscreen.camera.SetPosition(-2, -1, 3)
- myscreen.camera.SetFocalPoint(1.0, 0.0, -0.5)
- camvtk.drawArrows(myscreen,center=(-0.5,-0.5,-0.5))
- camvtk.drawOCLtext(myscreen)
- myscreen.render()
- w2if = vtk.vtkWindowToImageFilter()
- w2if.SetInput(myscreen.renWin)
- lwr = vtk.vtkPNGWriter()
- lwr.SetInput( w2if.GetOutput() )
- w2if.Modified()
- lwr.SetFileName(filename)
- if write_flag:
- lwr.Write()
- print "wrote ",filename
-
- #myscreen.iren.Start()
- #raw_input("Press Enter to terminate")
-
-if __name__ == "__main__":
- ztri = 0.3 # this is the shallow case
- #ztri = 0.8 # this produces the steep case where we hit the circular rim
- ztri_lo = 0.1
- Nmax = 300
- thetamax = 2*math.pi
- for n in xrange(0,Nmax):
- theta=thetamax/Nmax
- a = ocl.Point(0,1,ztri)
- a.xRotate(theta*n)
- b = ocl.Point(1,0.0,0)
- b.xRotate(theta*n)
- c = ocl.Point(0.2,0.0,ztri)
- c.xRotate(theta*n)
- current_dir = os.getcwd()
- filename = current_dir + "/frames/conecutter_"+ ('%05d' % n)+".png"
- drawScreen(a,b,c,filename, 1)
-
diff -Nru opencamlib-11.10+git201801200005~ubuntu16.04.1/scripts/fiber/fiber_15_weave2.py opencamlib-11.10-1/scripts/fiber/fiber_15_weave2.py
--- opencamlib-11.10+git201801200005~ubuntu16.04.1/scripts/fiber/fiber_15_weave2.py 2018-01-20 00:05:22.000000000 +0000
+++ opencamlib-11.10-1/scripts/fiber/fiber_15_weave2.py 1970-01-01 00:00:00.000000000 +0000
@@ -1,141 +0,0 @@
-import ocl
-import camvtk
-import time
-import vtk
-import datetime
-import math
-
-def drawVertices(myscreen, weave, vertexType, vertexRadius, vertexColor):
- pts = weave.getVertices( vertexType )
- print " got ",len(pts)," of type ", vertexType
- for p in pts:
- myscreen.addActor( camvtk.Sphere(center=(p.x,p.y,p.z), radius=vertexRadius, color=vertexColor ) )
-
-if __name__ == "__main__":
- print ocl.revision()
- myscreen = camvtk.VTKScreen()
- a = ocl.Point(0,1,0.3)
- #myscreen.addActor(camvtk.Point(center=(a.x,a.y,a.z), color=(1,0,1)))
- b = ocl.Point(1,0.5,0.3)
- #myscreen.addActor(camvtk.Point(center=(b.x,b.y,b.z), color=(1,0,1)))
- c = ocl.Point(0,0,0.1)
- #myscreen.addActor(camvtk.Point(center=(c.x,c.y,c.z), color=(1,0,1)))
- #myscreen.addActor( camvtk.Line(p1=(a.x,a.y,a.z),p2=(c.x,c.y,c.z)) )
- #myscreen.addActor( camvtk.Line(p1=(c.x,c.y,c.z),p2=(b.x,b.y,b.z)) )
- #myscreen.addActor( camvtk.Line(p1=(a.x,a.y,a.z),p2=(b.x,b.y,b.z)) )
-
- # a second triangle
- offset=ocl.Point(0.51,0.51,0)
- a2 = a+ offset
- b2 = b+ offset
- c2 = c+ offset
- t2 = ocl.Triangle(b2,c2,a2)
-
- t = ocl.Triangle(b,c,a)
- s = ocl.STLSurf()
- s.addTriangle(t) # a one-triangle STLSurf
- s.addTriangle(t2)
-
- cutter = ocl.CylCutter(0.3, 5)
- #cutter = ocl.BallCutter(0.4, 5)
- #cutter = ocl.BullCutter(0.4, 0.1, 5)
-
- print "fiber..."
- fiber_range=7
- Nmax = 200
- yvals = [float(n-float(Nmax)/2)/Nmax*float(fiber_range) for n in xrange(0,Nmax+1)]
- xvals = [float(n-float(Nmax)/2)/Nmax*float(fiber_range) for n in xrange(0,Nmax+1)]
-
- zvals=[ 0.23]
-
-
- bpc_x = ocl.BatchPushCutter()
- bpc_y = ocl.BatchPushCutter()
- bpc_x.setXDirection()
- bpc_y.setYDirection()
- bpc_x.setSTL(s)
- bpc_y.setSTL(s)
- bpc_x.setCutter(cutter)
- bpc_y.setCutter(cutter)
- # create fibers
- for zh in zvals:
- for y in yvals:
- f1 = ocl.Point(-5.5,y,zh) # start point of fiber
- f2 = ocl.Point(5.5,y,zh) # end point of fiber
- f = ocl.Fiber( f1, f2)
- bpc_x.appendFiber(f)
- for x in xvals:
- f1 = ocl.Point(x,-5.5,zh) # start point of fiber
- f2 = ocl.Point(x,5.5,zh) # end point of fiber
- f = ocl.Fiber( f1, f2)
- bpc_y.appendFiber(f)
-
- # run
- bpc_x.run()
- bpc_y.run()
- #clpoints = bpc_x.getCLPoints()
- #clp2 = bpc_y.getCLPoints()
- #clpoints+=clp2
- xfibers = bpc_x.getFibers()
- yfibers = bpc_y.getFibers()
- fibers = xfibers+yfibers
- print " got ",len(xfibers)," xfibers"
- print " got ",len(yfibers)," yfibers"
- print "rendering fibers and CL-points."
- w = ocl.Weave()
- print "push fibers to Weave...",
- for f in fibers:
- w.addFiber(f)
- print "done."
- print "Weave build()...",
- #w.build()
- w.build()
- print "done"
- print "face_traverse..."
- w.face_traverse()
- print "done."
- w_clpts = w.getCLVertices()
- w_ipts = w.getINTVertices()
- w_edges = w.getEdges()
- w_loop = w.getLoops()
- vertexRadius = 0.007
- drawVertices(myscreen, w, ocl.WeaveVertexType.CL, vertexRadius, camvtk.red)
- drawVertices(myscreen, w, ocl.WeaveVertexType.INT, vertexRadius, camvtk.orange)
- drawVertices(myscreen, w, ocl.WeaveVertexType.FULLINT, vertexRadius, camvtk.yellow)
- drawVertices(myscreen, w, ocl.WeaveVertexType.ADJ, vertexRadius, camvtk.green)
- drawVertices(myscreen, w, ocl.WeaveVertexType.TWOADJ, vertexRadius, camvtk.lblue)
-
- print " got: ", len(w_edges), " edges"
- print " got: ", len(w_loop), " loop points"
-
-
- previous = 0
- # draw the loop as a yellow line
- for loop in w_loop:
- np = 0
- for p in loop:
- #myscreen.addActor( camvtk.Sphere(center=(p.x,p.y,p.z+zoffset2), radius=0.006, color=camvtk.pink ) )
- if np is not 0:
- myscreen.addActor( camvtk.Line( p1=(previous.x,previous.y, previous.z),
- p2=(p.x,p.y,p.z), color=camvtk.yellow) )
- np=np+1
- previous = p
-
- # draw edges of weave
- ne = 0
- zoffset=0.0 # 1
- dzoffset = 0.000 # 5
- for e in w_edges:
- p1 = e[0]
- p2 = e[1]
- myscreen.addActor( camvtk.Line( p1=( p1.x,p1.y,p1.z+zoffset+ne*dzoffset), p2=(p2.x,p2.y,p2.z+zoffset+ne*dzoffset) ) )
- ne = ne+1
-
- print "done."
- myscreen.camera.SetPosition(0.8051, 0.8051, 3.5)
- myscreen.camera.SetFocalPoint(0.805, 0.805, 0)
- camvtk.drawArrows(myscreen,center=(-0.5,-0.5,-0.5))
- camvtk.drawOCLtext(myscreen)
- myscreen.render()
- myscreen.iren.Start()
- #raw_input("Press Enter to terminate")
diff -Nru opencamlib-11.10+git201801200005~ubuntu16.04.1/scripts/fiber/fiber_16_weave2_RAMusage.py opencamlib-11.10-1/scripts/fiber/fiber_16_weave2_RAMusage.py
--- opencamlib-11.10+git201801200005~ubuntu16.04.1/scripts/fiber/fiber_16_weave2_RAMusage.py 2018-01-20 00:05:22.000000000 +0000
+++ opencamlib-11.10-1/scripts/fiber/fiber_16_weave2_RAMusage.py 1970-01-01 00:00:00.000000000 +0000
@@ -1,110 +0,0 @@
-import ocl
-import camvtk
-import time
-import vtk
-import datetime
-import math
-import procmemory
-import csv
-import gc
-
-def drawVertices(myscreen, weave, vertexType, vertexRadius, vertexColor):
- pts = weave.getVertices( vertexType )
- print " got ",len(pts)," of type ", vertexType
- for p in pts:
- myscreen.addActor( camvtk.Sphere(center=(p.x,p.y,p.z), radius=vertexRadius, color=vertexColor ) )
-
-def getWeaveRAM(Nmax,weave2_flag):
- #stl = camvtk.STLSurf("../stl/demo.stl")
- stl = camvtk.STLSurf("../stl/gnu_tux_mod.stl")
- polydata = stl.src.GetOutput()
- s = ocl.STLSurf()
- camvtk.vtkPolyData2OCLSTL(polydata, s)
- cutter = ocl.CylCutter(0.3, 5)
- fiber_range=30
- #Nmax = 400
- yvals = [float(n-float(Nmax)/2)/Nmax*float(fiber_range) for n in xrange(0,Nmax+1)]
- xvals = [float(n-float(Nmax)/2)/Nmax*float(fiber_range) for n in xrange(0,Nmax+1)]
- zvals=[ 1.6523]
- bpc_x = ocl.BatchPushCutter()
- bpc_y = ocl.BatchPushCutter()
- bpc_x.setXDirection()
- bpc_y.setYDirection()
- bpc_x.setSTL(s)
- bpc_y.setSTL(s)
- bpc_x.setCutter(cutter)
- bpc_y.setCutter(cutter)
- # create fibers
- for zh in zvals:
- for y in yvals:
- f1 = ocl.Point(-15.5,y,zh) # start point of fiber
- f2 = ocl.Point(15.5,y,zh) # end point of fiber
- f = ocl.Fiber( f1, f2)
- bpc_x.appendFiber(f)
- for x in xvals:
- f1 = ocl.Point(x,-15.5,zh) # start point of fiber
- f2 = ocl.Point(x,15.5,zh) # end point of fiber
- f = ocl.Fiber( f1, f2)
- bpc_y.appendFiber(f)
-
- # run
- bpc_x.run()
- bpc_y.run()
- xfibers = bpc_x.getFibers()
- yfibers = bpc_y.getFibers()
- fibers = xfibers+yfibers
- print " got ",len(xfibers)," xfibers"
- print " got ",len(yfibers)," yfibers"
- fibercount = len(xfibers) + len(yfibers)
- print "rendering fibers and CL-points."
- w = ocl.Weave()
- print "push fibers to Weave...",
- for f in fibers:
- w.addFiber(f)
- print "done."
- print "Weave build()...",
- mem1 = procmemory.memory()
- if weave2_flag==1:
- w.build2()
- else:
- w.build()
- mem2 = procmemory.memory()
- #print "after ", float(mem2)/float(1024*1024), " MB"
- megabytes = float(mem2-mem1)/float(1024*1024)
- megabytes2 = float(mem2)/float(1024*1024)
- verts = w.numVertices()
- print " before: ", float(mem1)/float(1024*1024)
- print " after: ", float(mem2)/float(1024*1024)
- print " build() memory: ",megabytes," MB"
- print "done"
- print "face_traverse..."
- w.face_traverse()
- print "done."
- w_clpts = w.getCLVertices()
- w_ipts = w.getINTVertices()
- w_edges = w.getEdges()
- w_loop = w.getLoops()
-
-
- print " got: ", len(w_edges), " edges"
- print " got: ", len(w_loop), " loops"
- out=[]
- out.append(fibercount)
- out.append(verts)
- return out
-
-if __name__ == "__main__":
- writer = csv.writer( open('weave2ram_6.csv','wb'), delimiter=',')
-
- #Nmax=400
- Nmaxlist = [100,200,400,800, 1600, 3200]
-
- for Nmax in Nmaxlist:
- mb = getWeaveRAM(Nmax,0)
- mb2 = getWeaveRAM(Nmax,1)
- #print mb2
- print mb[0], " :=> ", mb[1], " MB"
- writer.writerow(mb+mb2)
- gc.collect()
-
- raw_input("Press Enter to terminate")
diff -Nru opencamlib-11.10+git201801200005~ubuntu16.04.1/scripts/fiber/fiber_16_weave2_STL.py opencamlib-11.10-1/scripts/fiber/fiber_16_weave2_STL.py
--- opencamlib-11.10+git201801200005~ubuntu16.04.1/scripts/fiber/fiber_16_weave2_STL.py 2018-01-20 00:05:22.000000000 +0000
+++ opencamlib-11.10-1/scripts/fiber/fiber_16_weave2_STL.py 1970-01-01 00:00:00.000000000 +0000
@@ -1,144 +0,0 @@
-import ocl
-import camvtk
-import time
-import vtk
-import datetime
-import math
-import procmemory
-
-def drawVertices(myscreen, weave, vertexType, vertexRadius, vertexColor):
- pts = weave.getVertices( vertexType )
- print " got ",len(pts)," of type ", vertexType
- for p in pts:
- myscreen.addActor( camvtk.Sphere(center=(p.x,p.y,p.z), radius=vertexRadius, color=vertexColor ) )
-
-if __name__ == "__main__":
- print ocl.revision()
- myscreen = camvtk.VTKScreen()
- #stl = camvtk.STLSurf("../stl/demo.stl")
- stl = camvtk.STLSurf("../stl/gnu_tux_mod.stl")
- myscreen.addActor(stl)
- stl.SetWireframe()
- #stl.SetSurface()
- stl.SetColor(camvtk.grey)
- polydata = stl.src.GetOutput()
- s = ocl.STLSurf()
- camvtk.vtkPolyData2OCLSTL(polydata, s)
-
- cutter = ocl.CylCutter(0.3, 5)
- #cutter = ocl.BallCutter(0.4, 5)
- #cutter = ocl.BullCutter(0.4, 0.1, 5)
-
- print "fiber..."
- fiber_range=30
- Nmax = 400
- yvals = [float(n-float(Nmax)/2)/Nmax*float(fiber_range) for n in xrange(0,Nmax+1)]
- xvals = [float(n-float(Nmax)/2)/Nmax*float(fiber_range) for n in xrange(0,Nmax+1)]
-
- zvals=[ 1.6523]
-
-
- bpc_x = ocl.BatchPushCutter()
- bpc_y = ocl.BatchPushCutter()
- bpc_x.setXDirection()
- bpc_y.setYDirection()
- bpc_x.setSTL(s)
- bpc_y.setSTL(s)
- bpc_x.setCutter(cutter)
- bpc_y.setCutter(cutter)
- # create fibers
- for zh in zvals:
- for y in yvals:
- f1 = ocl.Point(-15.5,y,zh) # start point of fiber
- f2 = ocl.Point(15.5,y,zh) # end point of fiber
- f = ocl.Fiber( f1, f2)
- bpc_x.appendFiber(f)
- for x in xvals:
- f1 = ocl.Point(x,-15.5,zh) # start point of fiber
- f2 = ocl.Point(x,15.5,zh) # end point of fiber
- f = ocl.Fiber( f1, f2)
- bpc_y.appendFiber(f)
-
- # run
- bpc_x.run()
- bpc_y.run()
-
- xfibers = bpc_x.getFibers()
- yfibers = bpc_y.getFibers()
- fibers = xfibers+yfibers
- print " got ",len(xfibers)," xfibers"
- print " got ",len(yfibers)," yfibers"
- print "rendering fibers and CL-points."
- w = ocl.Weave()
- print "push fibers to Weave...",
- for f in fibers:
- w.addFiber(f)
- print "done."
- print "Weave build()...",
- mem1 = procmemory.resident()
- print "before ", mem1
- w.build()
- #w.build2()
- mem2 = procmemory.resident()
- print "after ", float(mem2)/float(1024*1024), " MB"
- print " build() memory: ",float(mem2-mem1)/float(1024*1024)," MB"
- print "done"
- print "face_traverse..."
- w.face_traverse()
- print "done."
- w_clpts = w.getCLVertices()
- w_ipts = w.getINTVertices()
- w_edges = w.getEdges()
- w_loop = w.getLoops()
- vertexRadius = 0.007
- drawVertices(myscreen, w, ocl.WeaveVertexType.CL, vertexRadius, camvtk.red)
- drawVertices(myscreen, w, ocl.WeaveVertexType.INT, vertexRadius, camvtk.orange)
- drawVertices(myscreen, w, ocl.WeaveVertexType.FULLINT, vertexRadius, camvtk.yellow)
- drawVertices(myscreen, w, ocl.WeaveVertexType.ADJ, vertexRadius, camvtk.green)
- drawVertices(myscreen, w, ocl.WeaveVertexType.TWOADJ, vertexRadius, camvtk.lblue)
-
- print " got: ", len(w_edges), " edges"
- print " got: ", len(w_loop), " loops"
-
- # draw the loops
-
- nloop = 0
- for lop in w_loop:
- n = 0
- N = len(lop)
- first_point=ocl.Point(-1,-1,5)
- previous=ocl.Point(-1,-1,5)
- for p in lop:
- if n==0: # don't draw anything on the first iteration
- previous=p
- first_point = p
- elif n== (N-1): # the last point
- myscreen.addActor( camvtk.Line(p1=(previous.x,previous.y,previous.z),p2=(p.x,p.y,p.z),color=camvtk.yellow) ) # the normal line
- # and a line from p to the first point
- myscreen.addActor( camvtk.Line(p1=(p.x,p.y,p.z),p2=(first_point.x,first_point.y,first_point.z),color=camvtk.yellow) )
- else:
- myscreen.addActor( camvtk.Line(p1=(previous.x,previous.y,previous.z),p2=(p.x,p.y,p.z),color=camvtk.yellow) )
- previous=p
- n=n+1
- print "rendered loop ",nloop, " with ", len(lop), " points"
- nloop = nloop+1
-
-
- # draw edges of weave
- ne = 0
- zoffset=0.0 # 1
- dzoffset = 0.000 # 5
- for e in w_edges:
- p1 = e[0]
- p2 = e[1]
- myscreen.addActor( camvtk.Line( p1=( p1.x,p1.y,p1.z+zoffset+ne*dzoffset), p2=(p2.x,p2.y,p2.z+zoffset+ne*dzoffset) ) )
- ne = ne+1
-
- print "done."
- myscreen.camera.SetPosition(0.8051, 0.8051, 3.5)
- myscreen.camera.SetFocalPoint(0.805, 0.805, 0)
- camvtk.drawArrows(myscreen,center=(-0.5,-0.5,-0.5))
- camvtk.drawOCLtext(myscreen)
- myscreen.render()
- myscreen.iren.Start()
- #raw_input("Press Enter to terminate")
diff -Nru opencamlib-11.10+git201801200005~ubuntu16.04.1/scripts/issues/issue08_bug2010-04-02.py opencamlib-11.10-1/scripts/issues/issue08_bug2010-04-02.py
--- opencamlib-11.10+git201801200005~ubuntu16.04.1/scripts/issues/issue08_bug2010-04-02.py 2018-01-20 00:05:22.000000000 +0000
+++ opencamlib-11.10-1/scripts/issues/issue08_bug2010-04-02.py 1970-01-01 00:00:00.000000000 +0000
@@ -1,19 +0,0 @@
-import ocl
-
-# this illustrates issue 8
-
-if __name__ == "__main__":
- print ocl.revision()
- cutter = ocl.CylCutter(3.0, 6)
- path = ocl.Path()
- path.append(ocl.Line(ocl.Point(-6.51, 0, 0), ocl.Point(6.51, 1.2, 0)))
- s=ocl.STLSurf()
- ocl.STLReader("../stl/sphere2.stl",s)
- pdc = ocl.PathDropCutter()
- pdc.setSTL(s)
- pdc.setCutter(cutter)
- pdc.setPath(path)
- pdc.run()
- clpts = pdc.getCLPoints()
- for p in clpts:
- print p
diff -Nru opencamlib-11.10+git201801200005~ubuntu16.04.1/scripts/issues/issue20bug.py opencamlib-11.10-1/scripts/issues/issue20bug.py
--- opencamlib-11.10+git201801200005~ubuntu16.04.1/scripts/issues/issue20bug.py 2018-01-20 00:05:22.000000000 +0000
+++ opencamlib-11.10-1/scripts/issues/issue20bug.py 1970-01-01 00:00:00.000000000 +0000
@@ -1,47 +0,0 @@
-import ocl
-import camvtk
-import issue20data
-
-if __name__ == "__main__":
- s = ocl.STLSurf()
- triangles = issue20data.trilist
-
- for t in triangles:
- s.addTriangle(t)
-
- print ocl.revision()
- # define a cutter
- length = 10
- cutter = ocl.CylCutter(3, length)
- #cutter = ocl.BallCutter(3, length)
- #cutter = ocl.BullCutter(3,0.5, length)
-
- pdf = ocl.PathDropCutter() # create a pdf-object for the surface s
- pdf.setSTL(s)
- pdf.setCutter(cutter) # set the cutter
- pdf.minimumZ = -1 # set the minimum Z-coordinate, or
- # "floor" for drop-cutter
-
- path = ocl.Path() # create an empty path object
- # add a line to the path
- path.append(ocl.Line(ocl.Point(0, 0.098, 0), ocl.Point(4, 0.098, 0)))
-
- # set the path for pdf
- pdf.setPath( path )
-
- pdf.run() # run drop-cutter on the path
-
- clp = pdf.getCLPoints() # get the cl-points from pdf
-
-
- print 'first point ', clp[0], ' ( z should be at z5 )'
-
- # visualize things with VTK
- myscreen = camvtk.VTKScreen()
- myscreen.addActor( camvtk.PointCloud( pointlist=clp ) )
- #myscreen.addActor( camvtk.PointCloud( pointlist=ccp, collist=ccp ) )
- su = camvtk.STLSurf(filename=None, triangleList=triangles )
- su.SetWireframe()
- myscreen.addActor(su)
- myscreen.render()
- myscreen.iren.Start()
diff -Nru opencamlib-11.10+git201801200005~ubuntu16.04.1/scripts/issues/issue20data.py opencamlib-11.10-1/scripts/issues/issue20data.py
--- opencamlib-11.10+git201801200005~ubuntu16.04.1/scripts/issues/issue20data.py 2018-01-20 00:05:22.000000000 +0000
+++ opencamlib-11.10-1/scripts/issues/issue20data.py 1970-01-01 00:00:00.000000000 +0000
@@ -1,79 +0,0 @@
-import ocl
-
-trilist = []
-trilist.append(ocl.Triangle(ocl.Point(2.91337, 1, 3.93857),
- ocl.Point(2.89783, -7.09741e-016, 4.07462),
- ocl.Point(4, -9.79685e-016, 3)))
-trilist.append(ocl.Triangle(ocl.Point(2.91337, 1, 3.93857),
- ocl.Point(4,0.673874, 2.92334),
- ocl.Point(4, 1, 2.82843)))
-trilist.append(ocl.Triangle(ocl.Point(2.91337, 1, 3.93857),
- ocl.Point(4,0.339111, 2.98077),
- ocl.Point(4, 0.673874, 2.92334)))
-trilist.append(ocl.Triangle(ocl.Point(2.91337, 1, 3.93857), ocl.Point(4,
--9.79685e-016, 3), ocl.Point(4, 0.339111, 2.98077)))
-trilist.append(ocl.Triangle(ocl.Point(1.53379, 1, 4.65268),
-ocl.Point(1.521, -3.72525e-016, 4.76304), ocl.Point(2.89783, -7.09741e-016,
-4.07462)))
-trilist.append(ocl.Triangle(ocl.Point(1.53379, 1, 4.65268),
-ocl.Point(2.89783, -7.09741e-016, 4.07462), ocl.Point(2.91337, 1, 3.93857)))
-trilist.append(ocl.Triangle(ocl.Point(0, 0.669179, 4.95502),
-ocl.Point(1.53379, 1, 4.65268), ocl.Point(-1.19986e-015, 1, 4.89898)))
-trilist.append(ocl.Triangle(ocl.Point(0, 0.335345, 4.98874),
-ocl.Point(1.53379, 1, 4.65268), ocl.Point(0, 0.669179, 4.95502)))
-trilist.append(ocl.Triangle(ocl.Point(3.06152e-016, -7.4983e-032, 5),
-ocl.Point(1.521, -3.72525e-016, 4.76304), ocl.Point(1.53379, 1, 4.65268)))
-trilist.append(ocl.Triangle(ocl.Point(3.06152e-016, -7.4983e-032, 5),
-ocl.Point(1.53379, 1, 4.65268), ocl.Point(0, 0.335345, 4.98874)))
-trilist.append(ocl.Triangle(ocl.Point(2, 1, 2.44949), ocl.Point(0, 1,
-0), ocl.Point(-1.19986e-015, 1, 4.89898)))
-trilist.append(ocl.Triangle(ocl.Point(2, 1, 2.44949),
-ocl.Point(-1.19986e-015, 1, 4.89898), ocl.Point(1.53379, 1, 4.65268)))
-trilist.append(ocl.Triangle(ocl.Point(2, 1, 2.44949), ocl.Point(1.53379,
-1, 4.65268), ocl.Point(2.91337, 1, 3.93857)))
-trilist.append(ocl.Triangle(ocl.Point(2, 1, 2.44949), ocl.Point(2.91337,
-1, 3.93857), ocl.Point(4, 1, 2.82843)))
-trilist.append(ocl.Triangle(ocl.Point(2, 1, 2.44949), ocl.Point(4, 1,
-2.82843), ocl.Point(4, 1, 0)))
-trilist.append(ocl.Triangle(ocl.Point(2, 1, 2.44949), ocl.Point(4, 1,
-0), ocl.Point(0, 1, 0)))
-trilist.append(ocl.Triangle(ocl.Point(4, 0.5, 1.5), ocl.Point(4,
--9.79685e-016, 3), ocl.Point(4, 0, 0)))
-trilist.append(ocl.Triangle(ocl.Point(4, 0.5, 1.5), ocl.Point(4, 0, 0),
-ocl.Point(4, 1, 0)))
-trilist.append(ocl.Triangle(ocl.Point(4, 0.5, 1.5), ocl.Point(4, 1, 0),
-ocl.Point(4, 1, 2.82843)))
-trilist.append(ocl.Triangle(ocl.Point(4, 0.5, 1.5), ocl.Point(4, 1,
-2.82843), ocl.Point(4, 0.673874, 2.92334)))
-trilist.append(ocl.Triangle(ocl.Point(4, 0.5, 1.5), ocl.Point(4,
-0.673874, 2.92334), ocl.Point(4, 0.339111, 2.98077)))
-trilist.append(ocl.Triangle(ocl.Point(4, 0.5, 1.5), ocl.Point(4,
-0.339111, 2.98077), ocl.Point(4, -9.79685e-016, 3)))
-trilist.append(ocl.Triangle(ocl.Point(2, 0, 2.5),
-ocl.Point(3.06152e-016, -7.4983e-032, 5), ocl.Point(0, 0, 0)))
-trilist.append(ocl.Triangle(ocl.Point(2, 0, 2.5), ocl.Point(4,
--9.79685e-016, 3), ocl.Point(2.89783, -7.09741e-016, 4.07462)))
-trilist.append(ocl.Triangle(ocl.Point(2, 0, 2.5), ocl.Point(2.89783,
--7.09741e-016, 4.07462), ocl.Point(1.521, -3.72525e-016, 4.76304)))
-trilist.append(ocl.Triangle(ocl.Point(2, 0, 2.5), ocl.Point(1.521,
--3.72525e-016, 4.76304), ocl.Point(3.06152e-016, -7.4983e-032, 5)))
-trilist.append(ocl.Triangle(ocl.Point(2, 0, 2.5), ocl.Point(4, 0, 0),
-ocl.Point(4, -9.79685e-016, 3)))
-trilist.append(ocl.Triangle(ocl.Point(2, 0, 2.5), ocl.Point(0, 0, 0),
-ocl.Point(4, 0, 0)))
-trilist.append(ocl.Triangle(ocl.Point(0, 0.5, 2.5),
-ocl.Point(-1.19986e-015, 1, 4.89898), ocl.Point(0, 1, 0)))
-trilist.append(ocl.Triangle(ocl.Point(0, 0.5, 2.5), ocl.Point(0,
-0.669179, 4.95502), ocl.Point(-1.19986e-015, 1, 4.89898)))
-trilist.append(ocl.Triangle(ocl.Point(0, 0.5, 2.5), ocl.Point(0,
-0.335345, 4.98874), ocl.Point(0, 0.669179, 4.95502)))
-trilist.append(ocl.Triangle(ocl.Point(0, 0.5, 2.5),
-ocl.Point(3.06152e-016, -7.4983e-032, 5), ocl.Point(0, 0.335345, 4.98874)))
-trilist.append(ocl.Triangle(ocl.Point(0, 0.5, 2.5), ocl.Point(0, 0, 0),
-ocl.Point(3.06152e-016, -7.4983e-032, 5)))
-trilist.append(ocl.Triangle(ocl.Point(0, 0.5, 2.5), ocl.Point(0, 1, 0),
-ocl.Point(0, 0, 0)))
-trilist.append(ocl.Triangle(ocl.Point(4, 1, 0), ocl.Point(0, 0, 0),
-ocl.Point(0, 1, 0)))
-trilist.append(ocl.Triangle(ocl.Point(4, 1, 0), ocl.Point(4, 0, 0),
-ocl.Point(0, 0, 0)))
diff -Nru opencamlib-11.10+git201801200005~ubuntu16.04.1/scripts/kdtree_debug_0.py opencamlib-11.10-1/scripts/kdtree_debug_0.py
--- opencamlib-11.10+git201801200005~ubuntu16.04.1/scripts/kdtree_debug_0.py 2018-01-20 00:05:22.000000000 +0000
+++ opencamlib-11.10-1/scripts/kdtree_debug_0.py 1970-01-01 00:00:00.000000000 +0000
@@ -1,128 +0,0 @@
-import ocl as cam
-import camvtk
-import time
-import vtk
-import math
-import datetime
-
-
-
-
-def main():
- myscreen = camvtk.VTKScreen()
- focal = cam.Point(5, 5, 0)
- r = 30
- theta = (float(45)/360)*2*math.pi
- fi=45
-
- campos = cam.Point( r*math.sin(theta)*math.cos(fi), r*math.sin(theta)*math.sin(fi), r*math.cos(theta) )
- myscreen.camera.SetPosition(campos.x, campos.y, campos.z)
- myscreen.camera.SetFocalPoint(focal.x,focal.y, focal.z)
-
- t = camvtk.Text()
- t.SetPos( (myscreen.width-450, myscreen.height-30) )
-
-
- myscreen.addActor( t)
- t2 = camvtk.Text()
- ytext = "kd-tree debug" #"Y: %3.3f" % (ycoord)
- t2.SetText(ytext)
- t2.SetPos( (50, myscreen.height-50) )
- myscreen.addActor( t2)
-
- w2if = vtk.vtkWindowToImageFilter()
- w2if.SetInput(myscreen.renWin)
- lwr = vtk.vtkPNGWriter()
- lwr.SetInput( w2if.GetOutput() )
-
- epos = cam.Epos()
- epos.setS(0,1)
-
- t.SetText("OpenCAMLib 10.03-beta, " + datetime.datetime.now().strftime("%Y-%m-%d %H:%M:%S"))
-
-
- #ycoord = 1.1
-
- stl = camvtk.STLSurf(filename="../stl/demo.stl")
- #stl = camvtk.STLSurf(filename="../stl/demo2.stl")
- print "STL surface read"
- #myscreen.addActor(stl)
- #stl.SetWireframe()
- #stl.SetColor((0.5,0.5,0.5))
- polydata = stl.src.GetOutput()
- s= cam.STLSurf()
- camvtk.vtkPolyData2OCLSTL(polydata, s)
- print "STLSurf with ", s.size(), " triangles"
-
-
- myscreen.addActor( camvtk.Sphere( center=(0,0,0), radius=0.2, color = camvtk.yellow ) )
-
- s.build_kdtree()
- print "built kd-tree"
- s.jump_kd_reset()
-
- tlist = s.get_kd_triangles()
-
- print "got", len(tlist), " triangles"
-
- while (s.jump_kd_hi()):
- lotris = s.get_kd_triangles()
- s.jump_kd_up()
- cut = s.get_kd_cut()
- s.jump_kd_lo()
- hitris = s.get_kd_triangles()
- lev = s.get_kd_level()
-
- print "l=", lev, " hi=", len(hitris), " lo=", len(lotris), " cut=", cut
-
- if ( cut[0] < 2 ):
- print "x cut ",
- if ( cut[0] == 0):
- print "max"
- myscreen.addActor( camvtk.Line( p1=(cut[1],100,0), p2=(cut[1],-100,0), color = camvtk.green ) )
- else:
- print "min"
- myscreen.addActor( camvtk.Line( p1=(cut[1],100,0), p2=(cut[1],-100,0), color = camvtk.lgreen ) )
- #myscreen.addActor( camvtk.Line( p1=(100,cut[1],0), p2=(-100,cut[1],0), color = camvtk.red ) )
- else:
- print "y cut ",
- if ( cut[0] == 2):
- print "max"
- myscreen.addActor( camvtk.Line( p1=(100,cut[1],0), p2=(-100,cut[1],0), color = camvtk.red ) )
- else:
- print "min"
- myscreen.addActor( camvtk.Line( p1=(100,cut[1],0), p2=(-100,cut[1],0), color = camvtk.pink ) )
-
-
- slo = camvtk.STLSurf(triangleList=lotris)
- slo.SetColor(camvtk.pink)
- slo.SetWireframe()
- shi = camvtk.STLSurf(triangleList=hitris)
- shi.SetColor(camvtk.lgreen)
- shi.SetWireframe()
- myscreen.addActor(slo)
- myscreen.addActor(shi)
- myscreen.render()
- myscreen.iren.Start()
- raw_input("Press Enter to terminate")
- time.sleep(1)
- myscreen.removeActor(slo)
- myscreen.removeActor(shi)
-
-
-
- print "done."
- myscreen.render()
- #lwr.SetFileName(filename)
-
- #raw_input("Press Enter to terminate")
- time.sleep(0.2)
- lwr.Write()
- myscreen.iren.Start()
-
-
-if __name__ == "__main__":
- main()
- #raw_input("Press Enter to terminate")
-
-
diff -Nru opencamlib-11.10+git201801200005~ubuntu16.04.1/scripts/kdtree_debug_1.py opencamlib-11.10-1/scripts/kdtree_debug_1.py
--- opencamlib-11.10+git201801200005~ubuntu16.04.1/scripts/kdtree_debug_1.py 2018-01-20 00:05:22.000000000 +0000
+++ opencamlib-11.10-1/scripts/kdtree_debug_1.py 1970-01-01 00:00:00.000000000 +0000
@@ -1,128 +0,0 @@
-import ocl as cam
-import camvtk
-import time
-import vtk
-import math
-import datetime
-
-
-
-
-def main():
- myscreen = camvtk.VTKScreen()
- focal = cam.Point(50, 0, 0)
- r = 300
- theta = (float(45)/360)*2*math.pi
- fi=45
-
- campos = cam.Point( r*math.sin(theta)*math.cos(fi), r*math.sin(theta)*math.sin(fi), r*math.cos(theta) )
- myscreen.camera.SetPosition(campos.x, campos.y, campos.z)
- myscreen.camera.SetFocalPoint(focal.x,focal.y, focal.z)
-
- t = camvtk.Text()
- t.SetPos( (myscreen.width-450, myscreen.height-30) )
-
-
- myscreen.addActor( t)
- t2 = camvtk.Text()
- ytext = "kd-tree debug" #"Y: %3.3f" % (ycoord)
- t2.SetText(ytext)
- t2.SetPos( (50, myscreen.height-50) )
- myscreen.addActor( t2)
-
- w2if = vtk.vtkWindowToImageFilter()
- w2if.SetInput(myscreen.renWin)
- lwr = vtk.vtkPNGWriter()
- lwr.SetInput( w2if.GetOutput() )
-
- epos = cam.Epos()
- epos.setS(0,1)
-
- t.SetText("OpenCAMLib 10.03-beta, " + datetime.datetime.now().strftime("%Y-%m-%d %H:%M:%S"))
-
-
- #ycoord = 1.1
-
- stl = camvtk.STLSurf(filename="../stl/demo.stl")
- #stl = camvtk.STLSurf(filename="../stl/demo2.stl")
- print "STL surface read"
- #myscreen.addActor(stl)
- #stl.SetWireframe()
- #stl.SetColor((0.5,0.5,0.5))
- polydata = stl.src.GetOutput()
- s= cam.STLSurf()
- camvtk.vtkPolyData2OCLSTL(polydata, s)
- print "STLSurf with ", s.size(), " triangles"
-
-
- myscreen.addActor( camvtk.Sphere( center=(0,0,0), radius=0.2, color = camvtk.yellow ) )
-
- s.build_kdtree()
- print "built kd-tree"
- s.jump_kd_reset()
-
- tlist = s.get_kd_triangles()
-
- print "got", len(tlist), " triangles"
-
- while (s.jump_kd_hi()):
- lotris = s.get_kd_triangles()
- s.jump_kd_up()
- cut = s.get_kd_cut()
- s.jump_kd_lo()
- hitris = s.get_kd_triangles()
- lev = s.get_kd_level()
-
- print "l=", lev, " hi=", len(hitris), " lo=", len(lotris), " cut=", cut
-
- if ( cut[0] < 2 ):
- print "x cut ",
- if ( cut[0] == 0):
- print "max"
- myscreen.addActor( camvtk.Line( p1=(cut[1],100,0), p2=(cut[1],-100,0), color = camvtk.green ) )
- else:
- print "min"
- myscreen.addActor( camvtk.Line( p1=(cut[1],100,0), p2=(cut[1],-100,0), color = camvtk.lgreen ) )
- #myscreen.addActor( camvtk.Line( p1=(100,cut[1],0), p2=(-100,cut[1],0), color = camvtk.red ) )
- else:
- print "y cut ",
- if ( cut[0] == 2):
- print "max"
- myscreen.addActor( camvtk.Line( p1=(100,cut[1],0), p2=(-100,cut[1],0), color = camvtk.red ) )
- else:
- print "min"
- myscreen.addActor( camvtk.Line( p1=(100,cut[1],0), p2=(-100,cut[1],0), color = camvtk.pink ) )
-
-
- slo = camvtk.STLSurf(triangleList=lotris)
- slo.SetColor(camvtk.pink)
- slo.SetWireframe()
- shi = camvtk.STLSurf(triangleList=hitris)
- shi.SetColor(camvtk.lgreen)
- shi.SetWireframe()
- myscreen.addActor(slo)
- myscreen.addActor(shi)
- myscreen.render()
- myscreen.iren.Start()
- raw_input("Press Enter to terminate")
- time.sleep(1)
- myscreen.removeActor(slo)
- myscreen.removeActor(shi)
-
-
-
- print "done."
- myscreen.render()
- #lwr.SetFileName(filename)
-
- #raw_input("Press Enter to terminate")
- time.sleep(0.2)
- lwr.Write()
- myscreen.iren.Start()
-
-
-if __name__ == "__main__":
- main()
- #raw_input("Press Enter to terminate")
-
-
diff -Nru opencamlib-11.10+git201801200005~ubuntu16.04.1/scripts/kdtree_debug_3.py opencamlib-11.10-1/scripts/kdtree_debug_3.py
--- opencamlib-11.10+git201801200005~ubuntu16.04.1/scripts/kdtree_debug_3.py 2018-01-20 00:05:22.000000000 +0000
+++ opencamlib-11.10-1/scripts/kdtree_debug_3.py 1970-01-01 00:00:00.000000000 +0000
@@ -1,309 +0,0 @@
-import ocl as cam
-import camvtk
-import time
-import vtk
-import math
-import datetime
-
-
-
-def kdtreesearch(myscreen, tlist, s, cutter, cl, depth):
- #print "surface=", s.str()
- #print "cutter=", cutter.str()
- #print "cl=", cl.str()
- myscreen.render()
- #raw_input("Press Enter to terminate")
- #time.sleep(1)
- if (depth==1): # stop jumping and return all triangles
- tris = s.get_kd_triangles()
- for t in tris:
- tlist.append(t)
- return
-
- # jump high or low depending on search
- cut = s.get_kd_cut()
- print "cutvalues: ", cut
- dim = cut[0]
- cval = cut[1]
- if dim == 0: # cut along xmax
-
- print cval, " < ", cl.x - cutter.radius, " ??"
- if ( cval < ( cl.x - cutter.radius) ):
- myscreen.addActor( camvtk.Line( p1=(cval,100,0), p2=(cval,-100,0), color = camvtk.green ) )
- s.jump_kd_lo()
- trilist = s.get_kd_triangles()
- drawtriangles(myscreen, trilist, camvtk.blue)
- s.jump_kd_up()
- print "xmax: jump ONLY hi"
- s.jump_kd_hi()
- print "search hi at level=", s.get_kd_level()
- kdtreesearch(myscreen, tlist, s, cutter, cl, depth-1)
- print "len tlist=", len(tlist), " now level=", s.get_kd_level()
- else:
- #print "xmax: jump both hi and lo"
- s.jump_kd_hi()
- #print "search hi at level=", s.get_kd_level()
- kdtreesearch(myscreen, tlist, s, cutter, cl, depth-1)
- #print "len tlist=", len(tlist), " now level=", s.get_kd_level()
- s.jump_kd_up()
- s.jump_kd_lo()
- #print "search lo at level=", s.get_kd_level()
- kdtreesearch(myscreen, tlist, s, cutter, cl, depth-1)
- #print "len tlist=", len(tlist), " now level=", s.get_kd_level()
- if dim == 1:
-
- print cval, " > ", cl.x + cutter.radius, " ??"
- if ( cval > ( cl.x + cutter.radius) ):
- myscreen.addActor( camvtk.Line( p1=(cval,100,0), p2=(cval,-100,0), color = camvtk.lgreen ) )
- s.jump_kd_hi()
- trilist = s.get_kd_triangles()
- drawtriangles(myscreen, trilist, camvtk.blue)
- s.jump_kd_up()
- print "xmin: jump only lo"
- s.jump_kd_lo()
- kdtreesearch(myscreen, tlist, s, cutter, cl, depth-1)
- else:
- #print "xmin: jump both hi and lo"
- s.jump_kd_lo()
- kdtreesearch(tlist, s, cutter, cl, depth-1)
- s.jump_kd_up()
- s.jump_kd_hi()
- kdtreesearch(myscreen, tlist, s, cutter, cl, depth-1)
- if dim == 2:
- print cval, " < ", cl.y - cutter.radius, " ??"
- if ( cval < ( cl.y - cutter.radius) ):
- myscreen.addActor( camvtk.Line( p1=(100,cval,0), p2=(-100,cval,0), color = camvtk.red ) )
- s.jump_kd_lo()
- trilist = s.get_kd_triangles()
- drawtriangles(myscreen, trilist, camvtk.yellow)
- s.jump_kd_up()
-
- s.jump_kd_hi()
- kdtreesearch(myscreen, tlist, s, cutter, cl, depth-1)
- else:
- #print "ymax: jump both hi and lo"
- s.jump_kd_lo()
- kdtreesearch(myscreen, tlist, s, cutter, cl, depth-1)
- s.jump_kd_up()
- s.jump_kd_hi()
- kdtreesearch(myscreen, tlist, s, cutter, cl, depth-1)
- if dim == 3: # cut along ymin
-
- print cval, " > ", cl.y + cutter.radius, " ??"
- if ( cval > ( cl.y + cutter.radius) ):
- myscreen.addActor( camvtk.Line( p1=(100,cval,0), p2=(-100,cval,0), color = camvtk.pink ) )
-
- s.jump_kd_hi()
- trilist = s.get_kd_triangles()
- drawtriangles(myscreen, trilist, camvtk.yellow)
- s.jump_kd_up()
-
- print "ymin: jump ONLY lo"
- s.jump_kd_lo()
- kdtreesearch(myscreen, tlist, s, cutter, cl, depth-1)
- else:
- #print "ymin: jump both hi and lo"
- s.jump_kd_hi()
- #print "search hi at level=", s.get_kd_level()
- kdtreesearch(myscreen, tlist, s, cutter, cl, depth-1)
- #print "len tlist=", len(tlist), " now level=", s.get_kd_level()
- s.jump_kd_up()
- s.jump_kd_lo()
- #print "search lo at level=", s.get_kd_level()
- kdtreesearch(myscreen, tlist, s, cutter, cl, depth-1)
-
- return
-
-def drawtriangles(myscreen, trilist, color):
- cpp = camvtk.STLSurf(triangleList=trilist)
- cpp.SetColor(color)
- cpp.SetWireframe()
- myscreen.addActor(cpp)
-
-def drawcuts(myscreen, s):
- cut = s.get_kd_cut()
- if ( cut[0] < 2 ):
- print "x cut ",
- if ( cut[0] == 0):
- print "max"
- myscreen.addActor( camvtk.Line( p1=(cut[1],100,0), p2=(cut[1],-100,0), color = camvtk.green ) )
- else:
- print "min"
- myscreen.addActor( camvtk.Line( p1=(cut[1],100,0), p2=(cut[1],-100,0), color = camvtk.lgreen ) )
- else:
- print "y cut ",
- if ( cut[0] == 2):
- print "max"
- myscreen.addActor( camvtk.Line( p1=(100,cut[1],0), p2=(-100,cut[1],0), color = camvtk.red ) )
- else:
- print "min"
- myscreen.addActor( camvtk.Line( p1=(100,cut[1],0), p2=(-100,cut[1],0), color = camvtk.pink ) )
-
- if (s.jump_kd_hi()):
- drawcuts(myscreen, s)
- s.jump_kd_up()
- if (s.jump_kd_lo()):
- drawcuts(myscreen, s)
- s.jump_kd_up()
- return
-
-
-
-def main():
- myscreen = camvtk.VTKScreen()
- focal = cam.Point(50, 0, 0)
- r = 300
- theta = (float(45)/360)*2*math.pi
- fi=45
-
- campos = cam.Point( r*math.sin(theta)*math.cos(fi), r*math.sin(theta)*math.sin(fi), r*math.cos(theta) )
- myscreen.camera.SetPosition(campos.x, campos.y, campos.z)
- myscreen.camera.SetFocalPoint(focal.x,focal.y, focal.z)
-
- t = camvtk.Text()
- t.SetPos( (myscreen.width-450, myscreen.height-30) )
-
-
- myscreen.addActor( t)
- t2 = camvtk.Text()
- ytext = "kd-tree debug" #"Y: %3.3f" % (ycoord)
- t2.SetText(ytext)
- t2.SetPos( (50, myscreen.height-50) )
- myscreen.addActor( t2)
-
- w2if = vtk.vtkWindowToImageFilter()
- w2if.SetInput(myscreen.renWin)
- lwr = vtk.vtkPNGWriter()
- lwr.SetInput( w2if.GetOutput() )
-
- epos = cam.Epos()
- epos.setS(0,1)
-
- t.SetText("OpenCAMLib 10.04-beta, " + datetime.datetime.now().strftime("%Y-%m-%d %H:%M:%S"))
-
-
- #ycoord = 1.1
-
- stl = camvtk.STLSurf(filename="../stl/carpet2.stl")
- #stl = camvtk.STLSurf(filename="demo2.stl")
- print "STL surface read"
- myscreen.addActor(stl)
- stl.SetWireframe()
- stl.SetColor((0.5,0.5,0.5))
- polydata = stl.src.GetOutput()
- s= cam.STLSurf()
- camvtk.vtkPolyData2OCLSTL(polydata, s)
- print "STLSurf with ", s.size(), " triangles"
-
- cutterDiameter=7
- cutter = cam.CylCutter(cutterDiameter)
-
- cl = cam.Point(31, 42, 3)
-
- cutactor = camvtk.Cylinder(center=(cl.x,cl.y,cl.z),
- radius=cutterDiameter/2,
- height=2,
- rotXYZ=(90,0,0),
- color=camvtk.green)
- myscreen.addActor( cutactor )
-
- # sphere to see (0,0)
- myscreen.addActor( camvtk.Sphere( center=(0,0,0), radius=0.2, color = camvtk.yellow ) )
-
- s.build_kdtree()
- print "built kd-tree"
- s.jump_kd_reset()
-
-
- cpp_tlist = s.getTrianglesUnderCutter(cl, cutter)
-
- py_tlist = []
- depth = 6
- kdtreesearch(myscreen, py_tlist, s, cutter, cl, depth)
-
- print "len(cpp_list) after search=", len(cpp_tlist)
- print "len(py_list) after search=", len(py_tlist)
-
- cpp = camvtk.STLSurf(triangleList=cpp_tlist)
- cpp.SetColor(camvtk.lgreen)
- cpp.SetWireframe()
- myscreen.addActor(cpp)
-
- py = camvtk.STLSurf(triangleList=py_tlist)
- py.SetColor(camvtk.pink)
- py.SetWireframe()
- myscreen.addActor(py)
-
-
-
- #drawcuts(myscreen, s)
-
- myscreen.render()
- myscreen.iren.Start()
- time.sleep(2)
- exit()
-
- tlist = s.get_kd_triangles()
-
- print "got", len(tlist), " triangles"
-
- while (s.jump_kd_hi()):
- lotris = s.get_kd_triangles()
- s.jump_kd_up()
- cut = s.get_kd_cut()
- s.jump_kd_lo()
- hitris = s.get_kd_triangles()
- lev = s.get_kd_level()
-
- print "l=", lev, " hi=", len(hitris), " lo=", len(lotris), " cut=", cut
-
- if ( cut[0] < 2 ):
- print "x cut ",
- if ( cut[0] == 0):
- print "max"
- myscreen.addActor( camvtk.Line( p1=(cut[1],100,0), p2=(cut[1],-100,0), color = camvtk.green ) )
- else:
- print "min"
- myscreen.addActor( camvtk.Line( p1=(cut[1],100,0), p2=(cut[1],-100,0), color = camvtk.lgreen ) )
- else:
- print "y cut ",
- if ( cut[0] == 2):
- print "max"
- myscreen.addActor( camvtk.Line( p1=(100,cut[1],0), p2=(-100,cut[1],0), color = camvtk.red ) )
- else:
- print "min"
- myscreen.addActor( camvtk.Line( p1=(100,cut[1],0), p2=(-100,cut[1],0), color = camvtk.pink ) )
-
-
- slo = camvtk.STLSurf(triangleList=lotris)
- slo.SetColor(camvtk.pink)
- slo.SetWireframe()
- shi = camvtk.STLSurf(triangleList=hitris)
- shi.SetColor(camvtk.lgreen)
- shi.SetWireframe()
- myscreen.addActor(slo)
- myscreen.addActor(shi)
- myscreen.render()
- #myscreen.iren.Start()
- #raw_input("Press Enter to terminate")
- time.sleep(1)
- myscreen.removeActor(slo)
- myscreen.removeActor(shi)
-
-
-
- print "done."
- myscreen.render()
- #lwr.SetFileName(filename)
-
- #raw_input("Press Enter to terminate")
- time.sleep(0.2)
- lwr.Write()
- myscreen.iren.Start()
-
-
-if __name__ == "__main__":
- main()
- #raw_input("Press Enter to terminate")
-
-
diff -Nru opencamlib-11.10+git201801200005~ubuntu16.04.1/scripts/kdtree_movie1.py opencamlib-11.10-1/scripts/kdtree_movie1.py
--- opencamlib-11.10+git201801200005~ubuntu16.04.1/scripts/kdtree_movie1.py 2018-01-20 00:05:22.000000000 +0000
+++ opencamlib-11.10-1/scripts/kdtree_movie1.py 1970-01-01 00:00:00.000000000 +0000
@@ -1,183 +0,0 @@
-import ocl as cam
-import camvtk
-import time
-import vtk
-import datetime
-
-if __name__ == "__main__":
- myscreen = camvtk.VTKScreen()
- myscreen.setAmbient(20,20,20)
-
- #stl = camvtk.STLSurf(filename="demo.stl")
- stl = camvtk.STLSurf(filename="demo2.stl")
- print "STL surface read"
- myscreen.addActor(stl)
- stl.SetWireframe()
- stl.SetColor((0.5,0.5,0.5))
- #stl.SetFlat()
- polydata = stl.src.GetOutput()
- s= cam.STLSurf()
- camvtk.vtkPolyData2OCLSTL(polydata, s)
- print "STLSurf with ", s.size(), " triangles"
- cutterDiameter=0.6
- cutter = cam.CylCutter(cutterDiameter)
- #print cutter.str()
- #print cc.type
- minx=-20
- dx=1
- maxx=20
-
- miny=-20
- dy=01
- maxy=20
- z=-0.2
-
- bucketSize = 20
-
- #pftp = cam.ParallelFinish()
- #pftp.initCLPoints(minx,dx,maxx,miny,dy,maxy,z)
- #pftp.initSTLSurf(s, bucketSize)
- #pftp.dropCutterSTL1(cutter)
- #print " made ", pftp.dcCalls, " drop-cutter calls"
- #exit
-
- pf2 = cam.ParallelFinish()
- pf2.initCLPoints(minx,dx,maxx,miny,dy,maxy,z)
- pf2.initSTLSurf(s, bucketSize)
- pf2.dropCutterSTL2(cutter)
- print " made ", pf2.dcCalls, " drop-cutter calls"
-
- #clpoints = pftp.getCLPoints()
- #ccpoints = pftp.getCCPoints()
-
- clpoints = pf2.getCLPoints()
- ccpoints = pf2.getCCPoints()
-
- #CLPointGrid(minx,dx,maxx,miny,dy,maxy,z)
- nv=0
- nn=0
- ne=0
- nf=0
- myscreen.camera.SetPosition(3, 100, 15)
- myscreen.camera.SetFocalPoint(50, 50, 0)
- t = camvtk.Text()
- t.SetPos( (myscreen.width-200, myscreen.height-30) )
-
- myscreen.addActor( t)
-
- t2 = camvtk.Text()
- t2.SetPos( (myscreen.width-200, 30) )
- myscreen.addActor( t2)
- t3 = camvtk.Text()
- t3.SetPos( (30, 30))
- myscreen.addActor( t3)
-
- t4 = camvtk.Text()
- t4.SetPos( (30, myscreen.height-60))
- myscreen.addActor( t4)
-
- n=0
- precl = cam.Point()
-
- w2if = vtk.vtkWindowToImageFilter()
- w2if.SetInput(myscreen.renWin)
- lwr = vtk.vtkPNGWriter()
- lwr.SetInput( w2if.GetOutput() )
- w2if.Modified()
- lwr.SetFileName("tux1.png")
-
- for cl,cc in zip(clpoints,ccpoints):
-
- camEye = myscreen.camera.GetFocalPoint()
- camPos = myscreen.camera.GetPosition()
- postext = "(%3.3f, %3.3f, %3.3f)" % (camPos[0], camPos[1], camPos[2])
- eyetext = "(%3.3f, %3.3f, %3.3f)" % (camEye[0], camEye[1], camEye[2])
- camtext = "Camera LookAt: "+eyetext+"\nCamera Pos: "+ postext
- t4.SetText(camtext)
-
- t.SetText(datetime.datetime.now().strftime("%Y-%m-%d %H:%M:%S"))
- xtext = "%3.3f" % cl.x
- ytext = "%3.3f" % cl.y
- ztext = "%3.3f" % cl.z
- t2.SetText( "X: " + xtext + "\nY: " + ytext + "\nZ: " + ztext )
- if cc.type==cam.CCType.FACET:
- nf+=1
- col = (0,1,1)
- elif cc.type == cam.CCType.VERTEX:
- nv+=1
- col = (0,1,0)
- elif cc.type == cam.CCType.EDGE:
- ne+=1
- col = (1,0,0)
- elif cc.type == cam.CCType.NONE:
- #print "type=NONE!"
- nn+=1
- col = (1,1,1)
- #if cl.isInside(t):
- # col = (0, 1, 0)
- #else:
- # col = (1, 0, 0)
- trilist = pf2.getTrianglesUnderCutter(cl, cutter)
- #print "at cl=", cl.str() , " where len(trilist)=", len(trilist)
- t3.SetText("Total Triangles: "+ str(s.size()) +"\nUnder Cutter (red): "+str(len(trilist)))
-
- stl2 = camvtk.STLSurf(filename=None, triangleList=trilist, color=(1,0,0)) # a new surface with only triangles under cutter
- stl2.SetWireframe()
- #stl2.SetFlat()
- myscreen.addActor(stl2)
- trilist=[]
-
-
- cutactor = camvtk.Cylinder(center=(cl.x,cl.y,cl.z), radius=cutterDiameter/2, height=2, color=(0.7,1,1))
- myscreen.addActor( cutactor )
-
- #myscreen.addActor( camvtk.Point(center=(cl.x,cl.y,cl.z) , color=col) )
-
- if n==0:
- precl = cl
- else:
- d = cl-precl
- if (d.norm() < 9):
- myscreen.addActor( camvtk.Line( p1=(precl.x, precl.y, precl.z), p2=(cl.x, cl.y, cl.z), color=(0,1,1) ) )
- precl = cl
- n=n+1
- #myscreen.addActor( camvtk.Point(center=(cl2.x,cl2.y,cl2.z+0.2) , color=(0.6,0.2,0.9)) )
- #myscreen.addActor( camvtk.Point(center=(cc.x,cc.y,cc.z), color=col) )
- #print cc.type
- myscreen.camera.Azimuth( 0.2 )
- #time.sleep(0.01)
- myscreen.render()
- w2if.Modified()
- lwr.SetFileName("kdmov"+ ('%05d' % n)+".png")
- #lwr.Write()
-
-
- #raw_input("Press Enter to continue")
- myscreen.removeActor(stl2)
- myscreen.removeActor( cutactor )
-
- print "none=",nn," vertex=",nv, " edge=",ne, " facet=",nf, " sum=", nn+nv+ne+nf
- print len(clpoints), " cl points evaluated"
-
-
-
-
- #lwr.Write()
-
-
-
- for n in range(1,36):
- t.SetText(datetime.datetime.now().strftime("%Y-%m-%d %H:%M:%S"))
- myscreen.camera.Azimuth( 1 )
- time.sleep(0.01)
- myscreen.render()
- lwr.SetFileName("kd_frame"+ ('%03d' % n)+".png")
- w2if.Modified()
- #lwr.Write()
-
-
-
-
- myscreen.iren.Start()
- raw_input("Press Enter to terminate")
-
diff -Nru opencamlib-11.10+git201801200005~ubuntu16.04.1/scripts/kdtree_movie2.py opencamlib-11.10-1/scripts/kdtree_movie2.py
--- opencamlib-11.10+git201801200005~ubuntu16.04.1/scripts/kdtree_movie2.py 2018-01-20 00:05:22.000000000 +0000
+++ opencamlib-11.10-1/scripts/kdtree_movie2.py 1970-01-01 00:00:00.000000000 +0000
@@ -1,192 +0,0 @@
-import ocl as cam
-import camvtk
-import time
-import vtk
-import datetime
-
-if __name__ == "__main__":
- myscreen = camvtk.VTKScreen()
- myscreen.setAmbient(20,20,20)
-
- myscreen.camera.SetPosition(20, 30, 50)
- myscreen.camera.SetFocalPoint(5, 5, 0)
-
- stl = camvtk.STLSurf(filename="stl/demo.stl")
- #stl = camvtk.STLSurf(filename="demo2.stl")
- print "STL surface read"
- myscreen.addActor(stl)
- stl.SetWireframe()
- stl.SetColor((0.5,0.5,0.5))
- #stl.SetFlat()
- polydata = stl.src.GetOutput()
- s= cam.STLSurf()
- camvtk.vtkPolyData2OCLSTL(polydata, s)
- print "STLSurf with ", s.size(), " triangles"
- cutterDiameter=1
- cutter = cam.CylCutter(cutterDiameter)
- #print cutter.str()
- #print cc.type
- minx=0
- dx=1
- maxx=10
-
- miny=0
- dy=1
- maxy=10
- z=-10
-
- bucketSize = 20
-
- #pftp = cam.ParallelFinish()
- #pftp.initCLPoints(minx,dx,maxx,miny,dy,maxy,z)
- #pftp.initSTLSurf(s, bucketSize)
- #pftp.dropCutterSTL1(cutter)
- #print " made ", pftp.dcCalls, " drop-cutter calls"
- #exit
-
- pf2 = cam.ParallelFinish()
- pf2.initCLPoints(minx,dx,maxx,miny,dy,maxy,z)
- pf2.initSTLSurf(s, bucketSize)
- pf2.dropCutterSTL2(cutter)
- print " made ", pf2.dcCalls, " drop-cutter calls"
-
- #clpoints = pftp.getCLPoints()
- #ccpoints = pftp.getCCPoints()
-
- clpoints = pf2.getCLPoints()
- ccpoints = pf2.getCCPoints()
-
- #CLPointGrid(minx,dx,maxx,miny,dy,maxy,z)
- nv=0
- nn=0
- ne=0
- nf=0
-
- t = camvtk.Text()
- t.SetPos( (myscreen.width-200, myscreen.height-30) )
-
- myscreen.addActor( t)
-
- t2 = camvtk.Text()
- t2.SetPos( (myscreen.width-200, 30) )
- myscreen.addActor( t2)
- t3 = camvtk.Text()
- t3.SetPos( (30, 30))
- myscreen.addActor( t3)
-
- t4 = camvtk.Text()
- t4.SetPos( (30, myscreen.height-60))
- myscreen.addActor( t4)
-
- n=0
- precl = cam.Point()
-
- #w2if = vtk.vtkWindowToImageFilter()
- #w2if.SetInput(myscreen.renWin)
- #lwr = vtk.vtkPNGWriter()
- #lwr.SetInput( w2if.GetOutput() )
- #w2if.Modified()
- #lwr.SetFileName("tux1.png")
-
- for cl,cc in zip(clpoints,ccpoints):
-
- camEye = myscreen.camera.GetFocalPoint()
- camPos = myscreen.camera.GetPosition()
- postext = "(%3.3f, %3.3f, %3.3f)" % (camPos[0], camPos[1], camPos[2])
- eyetext = "(%3.3f, %3.3f, %3.3f)" % (camEye[0], camEye[1], camEye[2])
- camtext = "Camera LookAt: "+eyetext+"\nCamera Pos: "+ postext
- t4.SetText(camtext)
-
- t.SetText(datetime.datetime.now().strftime("%Y-%m-%d %H:%M:%S"))
- xtext = "%3.3f" % cl.x
- ytext = "%3.3f" % cl.y
- ztext = "%3.3f" % cl.z
- t2.SetText( "X: " + xtext + "\nY: " + ytext + "\nZ: " + ztext )
- if cc.type==cam.CCType.FACET:
- nf+=1
- col = (0,1,1)
- elif cc.type == cam.CCType.VERTEX:
- nv+=1
- col = (0,1,0)
- elif cc.type == cam.CCType.EDGE:
- ne+=1
- col = (1,0,0)
- elif cc.type == cam.CCType.NONE:
- #print "type=NONE!"
- nn+=1
- col = (1,1,1)
- #if cl.isInside(t):
- # col = (0, 1, 0)
- #else:
- # col = (1, 0, 0)
- trilist = pf2.getTrianglesUnderCutter(cl, cutter)
- #print "at cl=", cl.str() , " where len(trilist)=", len(trilist)
- t3.SetText("Total Triangles: "+ str(s.size()) +"\nUnder Cutter (red): "+str(len(trilist)))
-
- stl2 = camvtk.STLSurf(filename=None, triangleList=trilist, color=(1,0,0)) # a new surface with only triangles under cutter
- stl2.SetWireframe()
- #stl2.SetFlat()
- myscreen.addActor(stl2)
- trilist=[]
-
-
- cutactor = camvtk.Cylinder(center=(cl.x,cl.y,cl.z),
- radius=cutterDiameter/2,
- height=20,
- rotXYZ=(90,0,0),
- color=(0.7,0,1))
- myscreen.addActor( cutactor )
-
- myscreen.addActor( camvtk.Sphere(center=(cl.x,cl.y,cl.z) ,radius=0.03, color=col) )
-
- """
- if n==0:
- precl = cl
- else:
- d = cl-precl
- if (d.norm() < 90):
- myscreen.addActor( camvtk.Line( p1=(precl.x, precl.y, precl.z), p2=(cl.x, cl.y, cl.z), color=(0,1,1) ) )
- precl = cl
- """
-
- n=n+1
- #myscreen.addActor( camvtk.Point(center=(cl2.x,cl2.y,cl2.z+0.2) , color=(0.6,0.2,0.9)) )
- #myscreen.addActor( camvtk.Point(center=(cc.x,cc.y,cc.z), color=col) )
- #print cc.type
- #myscreen.camera.Azimuth( 0.2 )
- time.sleep(0.1)
- myscreen.render()
- #w2if.Modified()
- #lwr.SetFileName("kdbig"+ ('%05d' % n)+".png")
- #lwr.Write()
-
-
- #raw_input("Press Enter to continue")
- myscreen.removeActor(stl2)
- myscreen.removeActor( cutactor )
-
- print "none=",nn," vertex=",nv, " edge=",ne, " facet=",nf, " sum=", nn+nv+ne+nf
- print len(clpoints), " cl points evaluated"
-
-
-
-
- #lwr.Write()
-
-
-
- for n in range(1,36):
- t.SetText(datetime.datetime.now().strftime("%Y-%m-%d %H:%M:%S"))
- myscreen.camera.Azimuth( 1 )
- time.sleep(0.01)
- myscreen.render()
- #lwr.SetFileName("kd_frame"+ ('%03d' % n)+".png")
- #w2if.Modified()
- #lwr.Write()
-
-
-
-
- myscreen.iren.Start()
- raw_input("Press Enter to terminate")
-
diff -Nru opencamlib-11.10+git201801200005~ubuntu16.04.1/scripts/lineclfilter_test.py opencamlib-11.10-1/scripts/lineclfilter_test.py
--- opencamlib-11.10+git201801200005~ubuntu16.04.1/scripts/lineclfilter_test.py 2018-01-20 00:05:22.000000000 +0000
+++ opencamlib-11.10-1/scripts/lineclfilter_test.py 1970-01-01 00:00:00.000000000 +0000
@@ -1,21 +0,0 @@
-import ocl
-
-print ocl.version()
-
-p0 = ocl.CLPoint(0,0,0)
-p1 = ocl.CLPoint(1,2,3)
-p2 = ocl.CLPoint(1.1,2.2,3.3)
-clp=[]
-clp.append(p0)
-clp.append(p1)
-clp.append(p2)
-
-f = ocl.LineCLFilter()
-f.setTolerance(0.01)
-for p in clp:
- f.addCLPoint(p)
-
-f.run()
-p2 = f.getCLPoints()
-for p in p2:
- print p
diff -Nru opencamlib-11.10+git201801200005~ubuntu16.04.1/scripts/mov_kdtree.sh opencamlib-11.10-1/scripts/mov_kdtree.sh
--- opencamlib-11.10+git201801200005~ubuntu16.04.1/scripts/mov_kdtree.sh 2018-01-20 00:05:22.000000000 +0000
+++ opencamlib-11.10-1/scripts/mov_kdtree.sh 1970-01-01 00:00:00.000000000 +0000
@@ -1,19 +0,0 @@
-#!/bin/sh
-
-#first convert to JPEG
-#mogrify -format jpg -quality 97 *.png
-
-# a script for encoding jpeg-frames into a video suitable for uploading to youtube or vimeo
-
-# oldest, not very good...
-#mencoder mf://*.jpg -mf fps=25:type=jpg -ovc lavc -lavcopts vcodec=mpeg4 -ac copy -o output.avi -ffourcc DX50
-
-# -aspect 16:9
-# -mf fps=25:type=png -
-# better.
-mencoder mf://*.png -mf type=png -of lavf -ovc lavc -lavcopts aglobal=1:vglobal=1:coder=0:vcodec=mpeg4:vbitrate=24000000 -vf scale=1280:720 -ofps 30000/1001 -o OUTPUTp_24long.mp4
-
-# not so good.
-#mencoder mf://*.jpg -mf w=800:h=600:fps=25:type=jpg -ovc lavc -lavcopts vcodec=mpeg4:mbd=2:trell -oac copy -o output4.avi
-
-
diff -Nru opencamlib-11.10+git201801200005~ubuntu16.04.1/scripts/mov.sh opencamlib-11.10-1/scripts/mov.sh
--- opencamlib-11.10+git201801200005~ubuntu16.04.1/scripts/mov.sh 2018-01-20 00:05:22.000000000 +0000
+++ opencamlib-11.10-1/scripts/mov.sh 1970-01-01 00:00:00.000000000 +0000
@@ -1,16 +0,0 @@
-#!/bin/sh
-
-# a script for encoding jpeg-frames into a video suitable for uploading to youtube or vimeo
-
-# oldest, not very good...
-#mencoder mf://*.jpg -mf fps=25:type=jpg -ovc lavc -lavcopts vcodec=mpeg4 -ac copy -o output.avi -ffourcc DX50
-
-# better.
-mencoder mf://frames/*.png -mf fps=3:type=png -aspect 16:9 -of lavf -ovc lavc -lavcopts aglobal=1:vglobal=1:coder=0:vcodec=mpeg4:vbitrate=4500 -vf scale=1280:720 -ofps 3000/1001 -o OUTPUT3.mp4
-
-# not so good.
-#mencoder mf://*.jpg -mf w=800:h=600:fps=25:type=jpg -ovc lavc -lavcopts vcodec=mpeg4:mbd=2:trell -oac copy -o output4.avi
-
-
-# joining two or more files:
-# mencoder f1.mp4 f2.mp4 f3.mp4 f4.mp4 -mf fps=3 -oac copy -of lavf -ovc copy -lavcopts aglobal=1:vglobal=1:coder=0:vcodec=mpeg4:vbitrate=4500 -vf scale=1280:720 -o output.mp4
diff -Nru opencamlib-11.10+git201801200005~ubuntu16.04.1/scripts/ocl_bounding-box.py opencamlib-11.10-1/scripts/ocl_bounding-box.py
--- opencamlib-11.10+git201801200005~ubuntu16.04.1/scripts/ocl_bounding-box.py 2018-01-20 00:05:22.000000000 +0000
+++ opencamlib-11.10-1/scripts/ocl_bounding-box.py 1970-01-01 00:00:00.000000000 +0000
@@ -1,70 +0,0 @@
-import ocl
-import camvtk
-import time
-import vtk
-import datetime
-import math
-
-def drawBB(myscreen, bb):
- lines=[]
- # x-direction lines, red color
- lines.append( camvtk.Line( p1=(bb.minpt.x, bb.minpt.y, bb.minpt.z), p2=(bb.maxpt.x, bb.minpt.y, bb.minpt.z), color=camvtk.red) )
- lines.append( camvtk.Line( p1=(bb.minpt.x, bb.maxpt.y, bb.minpt.z), p2=(bb.maxpt.x, bb.maxpt.y, bb.minpt.z), color=camvtk.red) )
- lines.append( camvtk.Line( p1=(bb.minpt.x, bb.minpt.y, bb.maxpt.z), p2=(bb.maxpt.x, bb.minpt.y, bb.maxpt.z), color=camvtk.red) )
- lines.append( camvtk.Line( p1=(bb.minpt.x, bb.maxpt.y, bb.maxpt.z), p2=(bb.maxpt.x, bb.maxpt.y, bb.maxpt.z), color=camvtk.red) )
-
- # y-direction lines, green color
- lines.append( camvtk.Line( p1=(bb.minpt.x, bb.minpt.y, bb.minpt.z), p2=(bb.minpt.x, bb.maxpt.y, bb.minpt.z), color=camvtk.green) )
- lines.append( camvtk.Line( p1=(bb.maxpt.x, bb.minpt.y, bb.minpt.z), p2=(bb.maxpt.x, bb.maxpt.y, bb.minpt.z), color=camvtk.green) )
- lines.append( camvtk.Line( p1=(bb.minpt.x, bb.minpt.y, bb.maxpt.z), p2=(bb.minpt.x, bb.maxpt.y, bb.maxpt.z), color=camvtk.green) )
- lines.append( camvtk.Line( p1=(bb.maxpt.x, bb.minpt.y, bb.maxpt.z), p2=(bb.maxpt.x, bb.maxpt.y, bb.maxpt.z), color=camvtk.green) )
-
- # z-direction lines, blue color
- lines.append( camvtk.Line( p1=(bb.minpt.x, bb.minpt.y, bb.minpt.z), p2=(bb.minpt.x, bb.minpt.y, bb.maxpt.z), color=camvtk.blue) )
- lines.append( camvtk.Line( p1=(bb.maxpt.x, bb.minpt.y, bb.minpt.z), p2=(bb.maxpt.x, bb.minpt.y, bb.maxpt.z), color=camvtk.blue) )
- lines.append( camvtk.Line( p1=(bb.minpt.x, bb.maxpt.y, bb.minpt.z), p2=(bb.minpt.x, bb.maxpt.y, bb.maxpt.z), color=camvtk.blue) )
- lines.append( camvtk.Line( p1=(bb.maxpt.x, bb.maxpt.y, bb.minpt.z), p2=(bb.maxpt.x, bb.maxpt.y, bb.maxpt.z), color=camvtk.blue) )
-
- for l in lines:
- myscreen.addActor(l)
-
-if __name__ == "__main__":
- print ocl.revision()
-
- myscreen = camvtk.VTKScreen()
-
- stl = camvtk.STLSurf("../stl/gnu_tux_mod.stl")
- #stl = camvtk.STLSurf("../stl/beet_mm.stl")
- #stl = camvtk.STLSurf("../stl/Blade.stl")
- myscreen.addActor(stl)
- stl.SetWireframe()
- stl.SetColor((0.5,0.5,0.5))
-
- polydata = stl.src.GetOutput()
- s = ocl.STLSurf()
- camvtk.vtkPolyData2OCLSTL(polydata, s)
- print "STL surface read ", s.size(), " triangles"
-
- minimum_point = s.bb.minpt
- maximum_point = s.bb.maxpt
- print "min point =", minimum_point
- print "max point =", maximum_point
- print s.getBounds()
-
- # render the min and max points
- myscreen.addActor( camvtk.Sphere( center=(minimum_point.x, minimum_point.y, minimum_point.z), radius=0.1, color=camvtk.red) )
- myscreen.addActor( camvtk.Sphere( center=(maximum_point.x, maximum_point.y, maximum_point.z), radius=0.1, color=camvtk.green) )
-
- # render a bounding-box
- drawBB( myscreen, s.bb )
-
- myscreen.camera.SetPosition(3, 23, 15)
- myscreen.camera.SetFocalPoint(4, 5, 0)
- t = camvtk.Text()
- t.SetText("OpenCAMLib")
- t.SetPos( (myscreen.width-200, myscreen.height-30) )
- myscreen.addActor( t)
-
- myscreen.render()
- myscreen.iren.Start()
- raw_input("Press Enter to terminate")
diff -Nru opencamlib-11.10+git201801200005~ubuntu16.04.1/scripts/ocl_clpoint.py opencamlib-11.10-1/scripts/ocl_clpoint.py
--- opencamlib-11.10+git201801200005~ubuntu16.04.1/scripts/ocl_clpoint.py 2018-01-20 00:05:22.000000000 +0000
+++ opencamlib-11.10-1/scripts/ocl_clpoint.py 1970-01-01 00:00:00.000000000 +0000
@@ -1,16 +0,0 @@
-import ocl
-
-print ocl.revision()
-
-p = ocl.Point(1,2,3)
-print p
-cc = ocl.CCPoint(4,5,6)
-print cc
-cl = ocl.CLPoint()
-print cl
-cl2 = ocl.CLPoint(7,8,9)
-print cl2
-cl3 = ocl.CLPoint(10,11,12,cc)
-print cl3
-cc.x=77
-print cl3
diff -Nru opencamlib-11.10+git201801200005~ubuntu16.04.1/scripts/ocl_docstring_test.py opencamlib-11.10-1/scripts/ocl_docstring_test.py
--- opencamlib-11.10+git201801200005~ubuntu16.04.1/scripts/ocl_docstring_test.py 2018-01-20 00:05:22.000000000 +0000
+++ opencamlib-11.10-1/scripts/ocl_docstring_test.py 1970-01-01 00:00:00.000000000 +0000
@@ -1,8 +0,0 @@
-import ocl
-#help(ocl)
-
-#
-c=ocl.BallCutter(1,2)
-print c.__doc__
-print ocl.version()
-help(ocl.BallCutter(4,5))
diff -Nru opencamlib-11.10+git201801200005~ubuntu16.04.1/scripts/ocl_interval.py opencamlib-11.10-1/scripts/ocl_interval.py
--- opencamlib-11.10+git201801200005~ubuntu16.04.1/scripts/ocl_interval.py 2018-01-20 00:05:22.000000000 +0000
+++ opencamlib-11.10-1/scripts/ocl_interval.py 1970-01-01 00:00:00.000000000 +0000
@@ -1,24 +0,0 @@
-import ocl
-import camvtk
-import time
-import vtk
-import datetime
-import math
-
-
-if __name__ == "__main__":
- print ocl.revision()
- i = ocl.Interval()
- print i
- i = ocl.Interval(0.123, 0.456)
- print i
- cc = ocl.CCPoint(1,2,3)
- cc.type = ocl.CCType.VERTEX
- i.updateLower(-0.222,cc)
- print i
- i.updateLower(0,cc)
- print i
- i.updateUpper(0,cc)
- print i
- i.updateUpper(2,cc)
- print i
diff -Nru opencamlib-11.10+git201801200005~ubuntu16.04.1/scripts/ocl_offsetCutter_1.py opencamlib-11.10-1/scripts/ocl_offsetCutter_1.py
--- opencamlib-11.10+git201801200005~ubuntu16.04.1/scripts/ocl_offsetCutter_1.py 2018-01-20 00:05:22.000000000 +0000
+++ opencamlib-11.10-1/scripts/ocl_offsetCutter_1.py 1970-01-01 00:00:00.000000000 +0000
@@ -1,33 +0,0 @@
-import ocl
-import math
-
-print ocl.revision()
-
-# cylinder
-c = ocl.CylCutter(2.345, 5)
-d = c.offsetCutter(0.1)
-print c
-print "offset: ",d
-print
-
-# ball
-c = ocl.BallCutter(2.345, 6)
-d = c.offsetCutter(0.1)
-print c
-print "offset: ",d
-print
-
-# bull
-c = ocl.BullCutter(2.345, 0.123, 6)
-d = c.offsetCutter(0.1)
-print c
-print "offset: ",d
-print
-
-# cone
-c = ocl.ConeCutter(2.345, math.pi/6)
-d = c.offsetCutter(0.1)
-print c
-print "offset: ",d
-
-# TODO: add compound-cutters here below.
diff -Nru opencamlib-11.10+git201801200005~ubuntu16.04.1/scripts/ocl_stl2ocl_tst.py opencamlib-11.10-1/scripts/ocl_stl2ocl_tst.py
--- opencamlib-11.10+git201801200005~ubuntu16.04.1/scripts/ocl_stl2ocl_tst.py 2018-01-20 00:05:22.000000000 +0000
+++ opencamlib-11.10-1/scripts/ocl_stl2ocl_tst.py 1970-01-01 00:00:00.000000000 +0000
@@ -1,21 +0,0 @@
-import ocl
-import camvtk
-import time
-
-if __name__ == "__main__":
- s= ocl.STLSurf()
- print s
- myscreen = camvtk.VTKScreen()
- stl = camvtk.STLSurf("../stl/demo.stl")
- print "STL surface read"
- myscreen.addActor(stl)
- stl.SetWireframe()
-
- polydata = stl.src.GetOutput()
- camvtk.vtkPolyData2OCLSTL(polydata, s)
-
- print s
- myscreen.render()
- myscreen.iren.Start()
-
- #raw_input("Press Enter to terminate")
diff -Nru opencamlib-11.10+git201801200005~ubuntu16.04.1/scripts/ocl_stlsurf_polydata.py opencamlib-11.10-1/scripts/ocl_stlsurf_polydata.py
--- opencamlib-11.10+git201801200005~ubuntu16.04.1/scripts/ocl_stlsurf_polydata.py 2018-01-20 00:05:22.000000000 +0000
+++ opencamlib-11.10-1/scripts/ocl_stlsurf_polydata.py 1970-01-01 00:00:00.000000000 +0000
@@ -1,52 +0,0 @@
-import ocl
-import camvtk
-import time
-
-
-if __name__ == "__main__":
- p = ocl.Point()
- p.x=7
- p.y=8
- p.z=-3
- print p
- q = ocl.Point(1,2,3)
- r = p + q
- t = ocl.Triangle(p,q,r)
- print t
- s= ocl.STLSurf()
- print s
- s.addTriangle(t)
- s.addTriangle(t)
- print s
- print "end."
-
- myscreen = camvtk.VTKScreen()
- print "screen created"
- stl = camvtk.STLSurf("../stl/sphere.stl")
- print "STL surface read"
- myscreen.addActor(stl)
-
- b = stl.src.GetOutput()
- print b
- print "Verts:",b.GetNumberOfVerts()
- print "Cells:",b.GetNumberOfCells()
- print "Lines:",b.GetNumberOfLines()
- print "Polys:",b.GetNumberOfPolys()
- print "Strips:",b.GetNumberOfStrips()
- c = b.GetCell(0)
- print c
- print "Points:",c.GetNumberOfPoints()
- print "Edges:",c.GetNumberOfEdges()
- print "Faces:",c.GetNumberOfFaces()
- ps = c.GetPoints()
- print ps
- n=ps.GetNumberOfPoints()
- print "Nr of Points:",n
- for id in range(0,n):
- print id,"=",
- print ps.GetPoint(id)
- myscreen.addActor( camvtk.Sphere(radius=0.5,center=ps.GetPoint(id)) )
- myscreen.render()
- myscreen.iren.Start()
- #raw_input("Press Enter to terminate")
-
diff -Nru opencamlib-11.10+git201801200005~ubuntu16.04.1/scripts/ocl_test0.py opencamlib-11.10-1/scripts/ocl_test0.py
--- opencamlib-11.10+git201801200005~ubuntu16.04.1/scripts/ocl_test0.py 2018-01-20 00:05:22.000000000 +0000
+++ opencamlib-11.10-1/scripts/ocl_test0.py 1970-01-01 00:00:00.000000000 +0000
@@ -1,32 +0,0 @@
-import ocl
-
-if __name__ == "__main__":
- p = ocl.Point()
- p.x=7
- p.y=8
- p.z=-3
-
- print p
- q = ocl.Point(1,2,3)
- print q
- r = p + q
- s = ocl.Point(66,66,66)
- s += r
- print r
- print s
- print "2*s=", (s*2)
- print "s.norm=", s.norm()
- print "normalizing"
- s.normalize()
- print "s.norm=", s.norm()
- print "s dot r", s.dot(r)
- print "s cross r", s.cross(r)
- t = ocl.Triangle(p,q,r)
- print t
- s= ocl.STLSurf()
- print s
- s.addTriangle(t)
- s.addTriangle(t)
- print s
- print "end."
-
diff -Nru opencamlib-11.10+git201801200005~ubuntu16.04.1/scripts/octree_fig.py opencamlib-11.10-1/scripts/octree_fig.py
--- opencamlib-11.10+git201801200005~ubuntu16.04.1/scripts/octree_fig.py 2018-01-20 00:05:22.000000000 +0000
+++ opencamlib-11.10-1/scripts/octree_fig.py 1970-01-01 00:00:00.000000000 +0000
@@ -1,93 +0,0 @@
-import ocl
-import pyocl
-import camvtk
-import time
-import datetime
-import vtk
-import math
-"""
-This scripts draws a picture which enumerates the vertices, edges, and faces
-of an octree node, as used in the octree cutting simulation and
-marching-cubes.
-"""
-def main():
- print ocl.revision()
- myscreen = camvtk.VTKScreen()
- myscreen.camera.SetPosition(-8, -4, 25)
- myscreen.camera.SetFocalPoint(0,0, 0)
- arpos=-1.5
- camvtk.drawArrows(myscreen,center=(arpos,arpos,arpos))
- camvtk.drawOCLtext(myscreen)
- octtext = camvtk.Text()
- octtext.SetPos( (70, myscreen.height-600) )
- myscreen.addActor( octtext)
- octtext.SetText("Octree")
- vertex = [ ocl.Point( 1, 1,-1), #// 0
- ocl.Point(-1, 1,-1), #// 1
- ocl.Point(-1,-1,-1), #// 2
- ocl.Point( 1,-1,-1), #// 3
- ocl.Point( 1, 1, 1), #// 4
- ocl.Point(-1, 1, 1), #// 5
- ocl.Point(-1,-1, 1), #// 6
- ocl.Point( 1,-1, 1) #// 7
- ]
-
- n=0
- for v in vertex:
- myscreen.addActor( camvtk.Sphere(center=(v.x,v.y,v.z), radius=0.1,color=camvtk.red))
- v=v
- t = camvtk.Text3D(color=camvtk.red, center=(v.x+0.1,v.y+0.1,v.z), text=str(n), scale=0.2, camera=myscreen.camera)
- myscreen.addActor(t)
- n=n+1
-
- edgeTable = [ [0,1] ,
- [1,2] ,
- [2,3] ,
- [3,0] ,
- [4,5] ,
- [5,6] ,
- [6,7] ,
- [7,4] ,
- [0,4] ,
- [1,5] ,
- [2,6] ,
- [3,7] ,
- ]
-
- # draw the edges as tubes
- ne = 0
- for e in edgeTable:
-
- ep1 = vertex[ e[0] ]
- ep2 = vertex[ e[1] ]
- tu = camvtk.Tube( p1=(ep1.x,ep1.y,ep1.z), p2=(ep2.x,ep2.y,ep2.z), radius=0.051, color=camvtk.green )
- myscreen.addActor(tu)
- mid = 0.5*(ep1 + ep2)
- t = camvtk.Text3D(color=camvtk.green, center=(mid.x+0.1,mid.y+0.1,mid.z), text=str(ne), scale=0.2, camera=myscreen.camera)
- myscreen.addActor(t)
- ne=ne+1
-
- # number the faces
- face = [ [2,3,6,7] ,
- [0,3,4,7] ,
- [0,1,4,5] ,
- [1,2,5,6] ,
- [0,1,2,3] ,
- [4,5,6,7] ,
- ]
- nf=0
- for f in face:
- mid = ocl.Point()
- for v in f:
- mid = mid+vertex[v]
- mid=0.25*mid
- t = camvtk.Text3D(color=camvtk.blue, center=(mid.x,mid.y,mid.z), text=str(nf), scale=0.2, camera=myscreen.camera)
- myscreen.addActor(t)
- nf=nf+1
- myscreen.render()
- print "All done."
- myscreen.iren.Start()
-
-if __name__ == "__main__":
-
- main()
diff -Nru opencamlib-11.10+git201801200005~ubuntu16.04.1/scripts/offsetCutter_test_2.py opencamlib-11.10-1/scripts/offsetCutter_test_2.py
--- opencamlib-11.10+git201801200005~ubuntu16.04.1/scripts/offsetCutter_test_2.py 2018-01-20 00:05:22.000000000 +0000
+++ opencamlib-11.10-1/scripts/offsetCutter_test_2.py 1970-01-01 00:00:00.000000000 +0000
@@ -1,115 +0,0 @@
-import ocl
-import camvtk
-import time
-import vtk
-import datetime
-import math
-
-def CLPointGrid(minx,dx,maxx,miny,dy,maxy,z):
- plist = []
- xvalues = [round(minx+n*dx,2) for n in xrange(int(round((maxx-minx)/dx))+1) ]
- yvalues = [round(miny+n*dy,2) for n in xrange(int(round((maxy-miny)/dy))+1) ]
- for y in yvalues:
- for x in xvalues:
- plist.append( ocl.CLPoint(x,y,z) )
- return plist
-
-def drawPoints(myscreen, clpoints, ccpoints):
- c=camvtk.PointCloud( pointlist=clpoints, collist=ccpoints)
- c.SetPoints()
- myscreen.addActor(c )
-
-
-if __name__ == "__main__":
- myscreen = camvtk.VTKScreen()
-
- a=ocl.Point(1,0.6,0.1)
- myscreen.addActor(camvtk.Point(center=(a.x,a.y,a.z), color=(1,0,1)))
- b=ocl.Point(0,1,0)
- myscreen.addActor(camvtk.Point(center=(b.x,b.y,b.z), color=(1,0,1)))
- c=ocl.Point(0,0,0.0)
- myscreen.addActor(camvtk.Point(center=(c.x,c.y,c.z), color=(1,0,1)))
-
- myscreen.addActor( camvtk.Line(p1=(a.x,a.y,a.z),p2=(c.x,c.y,c.z)) )
- myscreen.addActor( camvtk.Line(p1=(c.x,c.y,c.z),p2=(b.x,b.y,b.z)) )
- myscreen.addActor( camvtk.Line(p1=(a.x,a.y,a.z),p2=(b.x,b.y,b.z)) )
-
- t = ocl.Triangle(b,c,a)
- radius1=1
- angle = math.pi/4
- length=10
- #cutter = ocl.ConeCutter(0.37, angle)
-
- cutter = ocl.BallCutter(0.532, length)
- #cutter = ocl.CylCutter(0.3, length)
- #cutter = ocl.BullCutter(0.7,0.1, length)
-
- # these cutters do not have offsets yet (?)
- #cutter = ocl.CylConeCutter(0.2,0.5,math.pi/9)
- #cutter = ocl.BallConeCutter(0.4,0.6,math.pi/9)
- #cutter = ocl.BullConeCutter(0.4,0.1,0.7,math.pi/6)
- #cutter = ocl.ConeConeCutter(0.4,math.pi/3,0.7,math.pi/6)
- #cutter = ocl.ConeCutter(0.4, math.pi/3)
- print cutter
- offset=0.1
- c2 = cutter.offsetCutter(offset)
- print c2
-
- minx=-0.5
- dx=0.0051
- maxx=1.5
- miny=-0.7
- dy=dx
- maxy=1.5
- z=-1.8
- clpoints = CLPointGrid(minx,dx,maxx,miny,dy,maxy,z)
- print len(clpoints), "cl-points to evaluate"
- n=0
- ccpoints=[]
- cl2pts=[]
- for p in clpoints:
- cl2pts.append(ocl.CLPoint(p.x,p.y,p.z))
-
- for (cl,cl2) in zip(clpoints,cl2pts):
-
- #cutter.vertexDrop(cl,t)
- #cutter.edgeDrop(cl,t)
- #cutter.facetDrop(cl,t)
- #c2.vertexDrop(cl2,t)
- cutter.dropCutter(cl,t)
- c2.dropCutter(cl2,t)
- n=n+1
- if (n % int(len(clpoints)/10)) == 0:
- print n/int(len(clpoints)/10), " ",
-
- print "done."
-
- print "rendering..."
- print " len(clpoints)=", len(clpoints)
- print " len(ccl2pts)=", len(cl2pts)
- print "rendering clpoints...",
- camvtk.drawCLPointCloud(myscreen, clpoints)
- print "done."
- cl2ptsofs=[]
- for p in cl2pts:
- p.z = p.z + offset
- cl2ptsofs.append(p)
- print "rendering offset clpoints...",
- camvtk.drawCLPointCloud(myscreen, cl2ptsofs)
- print "done."
- origo = camvtk.Sphere(center=(0,0,0) , radius=0.1, color=camvtk.blue)
- origo.SetOpacity(0.2)
- myscreen.addActor( origo )
-
- myscreen.camera.SetPosition(0.5, 3, 2)
- myscreen.camera.SetFocalPoint(0.5, 0.5, 0)
- myscreen.render()
- w2if = vtk.vtkWindowToImageFilter()
- w2if.SetInput(myscreen.renWin)
- lwr = vtk.vtkPNGWriter()
- lwr.SetInput( w2if.GetOutput() )
- t = camvtk.Text()
- t.SetPos( (myscreen.width-350, myscreen.height-30) )
- myscreen.addActor(t)
- myscreen.iren.Start()
- #raw_input("Press Enter to terminate")
diff -Nru opencamlib-11.10+git201801200005~ubuntu16.04.1/scripts/offset-ellipse/epos_test.py opencamlib-11.10-1/scripts/offset-ellipse/epos_test.py
--- opencamlib-11.10+git201801200005~ubuntu16.04.1/scripts/offset-ellipse/epos_test.py 2018-01-20 00:05:22.000000000 +0000
+++ opencamlib-11.10-1/scripts/offset-ellipse/epos_test.py 1970-01-01 00:00:00.000000000 +0000
@@ -1,17 +0,0 @@
-import ocl
-import camvtk
-import time
-import vtk
-import datetime
-import math
-
-if __name__ == "__main__":
- p = ocl.Epos()
- print "initial Epos() is ",p, "with dia=",p.d
-
- for n in xrange(0,30):
- print p.d," : ",p
- p.d = p.d - 0.25
- p.setD()
-
- raw_input("Press Enter to terminate")
diff -Nru opencamlib-11.10+git201801200005~ubuntu16.04.1/scripts/offset-ellipse/oeanim.py opencamlib-11.10-1/scripts/offset-ellipse/oeanim.py
--- opencamlib-11.10+git201801200005~ubuntu16.04.1/scripts/offset-ellipse/oeanim.py 2018-01-20 00:05:22.000000000 +0000
+++ opencamlib-11.10-1/scripts/offset-ellipse/oeanim.py 1970-01-01 00:00:00.000000000 +0000
@@ -1,18 +0,0 @@
-import oellipse5_tst as oe
-import math
-
-Nsteps = 500
-ystart = -0.2
-ystop = 2.2
-
-ystep = (ystop-ystart)/(Nsteps-1)
-fiangle = 55
-
-def radian(deg):
- return (float(deg)/360)*2*math.pi
-
-for n in xrange(0,Nsteps):
- yc = ystart + n*ystep
- fname = "frames/oet"+ ('%05d' % n)+".png"
- oe.main(ycoord=yc, filename=fname, theta=70, fi=radian(fiangle))
- #fiangle = fiangle + 2
diff -Nru opencamlib-11.10+git201801200005~ubuntu16.04.1/scripts/offset-ellipse/oellipse0_tst.py opencamlib-11.10-1/scripts/offset-ellipse/oellipse0_tst.py
--- opencamlib-11.10+git201801200005~ubuntu16.04.1/scripts/offset-ellipse/oellipse0_tst.py 2018-01-20 00:05:22.000000000 +0000
+++ opencamlib-11.10-1/scripts/offset-ellipse/oellipse0_tst.py 1970-01-01 00:00:00.000000000 +0000
@@ -1,219 +0,0 @@
-import ocl as cam
-import camvtk
-import time
-import vtk
-import math
-
-red= (1,0,0)
-green= (0,1,0)
-blue= (0,0,1)
-cyan= (0,1,1)
-yellow= (1,1,0)
-magenta =(float(255)/255,0,float(225)/255)
-pink =(float(255)/255,float(193)/255,float(203)/255)
-
-def ccColor2(cc):
- """ this function returns a different color depending on the type of
- the CC-point. Useful for visualizing CL or CC points """
- if cc.type==cam.CCType.FACET:
- col = (1,0,1)
- elif cc.type == cam.CCType.VERTEX:
- col = (1,1,0)
- elif cc.type == cam.CCType.EDGE:
- col = (0,1,1)
- elif cc.type == cam.CCType.NONE:
- col = (1,1,1)
- elif cc.type == cam.CCType.ERROR:
- col = (0,0.5,1)
- return col
-
-class OffsetEllipse():
- """
- // (s, t) where: s^2 + t^2 = 1
- // point of ellipse is: ecen + j s + n t
- // tangent at point is: -j t + n s
- // normal at point is: j (s / eccen) + n (t * eccen)
- // point on offset-ellipse: point on ellipse + offrad*normal
- """
- def __init__(self, ecen, a, b, ofs):
- self.a = a
- self.b = b
- self.ecen = ecen
- self.ofs = ofs
-
- def ePoint(self,t,s):
- # return a point on the ellipse
- p = cam.Point()
- p.x = self.ecen.x + self.a*s
- p.y = self.ecen.y + self.b*t
- return p
-
- def oePoint(self,t,s):
- # return point on offset-ellipse
- p = self.ePoint(t,s)
- normal = cam.Point( self.b*s, self.a*t, 0)
- normal.normalize()
- p = p + self.ofs*normal
- return p
-
- def teval(self, s, side):
- ssq = s*s
- tsq = 1 - ssq
- if side == 1:
- return 1 * math.sqrt(tsq)
- else:
- return -1* math.sqrt(tsq)
-
-if __name__ == "__main__":
- myscreen = camvtk.VTKScreen()
-
- a=cam.Point(3,2,-2)
- b=cam.Point(-1,2,3)
-
- myscreen.addActor(camvtk.Point(center=(a.x,a.y,a.z), color=(1,0,1)));
- myscreen.addActor(camvtk.Point(center=(b.x,b.y,b.z), color=(1,0,1)));
- #c=cam.Point(0,0,0.3)
- myscreen.addActor( camvtk.Line(p1=(a.x,a.y,a.z),p2=(b.x,b.y,b.z)) )
- #t = cam.Triangle(a,b,c)
- length = 5
- cutter = cam.BullCutter(1,0.2,length)
-
-
- print cutter
-
- xar = camvtk.Arrow(color=red, rotXYZ=(0,0,0))
- myscreen.addActor(xar)
- yar = camvtk.Arrow(color=green, rotXYZ=(0,0,90))
- myscreen.addActor(yar)
- zar = camvtk.Arrow(color=blue, rotXYZ=(0,-90,0))
- myscreen.addActor(zar)
-
- cl = cam.Point(2.193, 1, 0)
- radius1=1
- radius2=0.25
-
- tor = camvtk.Toroid(r1=radius1, r2=radius2, center=(cl.x, cl.y, cl.z),rotXYZ=(0,0,0))
- #tor.SetWireframe()
- tor.SetSurface()
- tor.SetOpacity(0.3)
- myscreen.addActor(tor)
-
- cyl = camvtk.Cylinder(center=(cl.x,cl.y,cl.z) , radius=radius1, height=2, color=(0,1,1),
- rotXYZ=(90,0,0), resolution=50 )
- #myscreen.addActor(cyl)
-
- tube = camvtk.Tube(p1=(a.x,a.y,a.z),p2=(b.x,b.y,b.z),radius=radius2, color=(1,1,0))
- tube.SetOpacity(0.1)
- myscreen.addActor(tube)
-
- cir= camvtk.Circle(radius=radius1, center=(cl.x,cl.y,cl.z), color=yellow)
- myscreen.addActor(cir)
-
- clp = camvtk.Sphere(radius=0.02, center=(cl.x,cl.y,cl.z), color=yellow)
- myscreen.addActor(clp)
-
- # short axis of ellipse = radius2
- # long axis of ellipse = radius2/sin(theta)
- # where theta is the slope of the line
- dx = b.x - a.x
- dz = b.z - a.z
- print "dx=", dx
- print "dz=", dz
- theta = math.atan(dz/dx)
- print "theta=",theta
- a = abs( radius2/math.sin(theta) )
- print "a=", a, " = ", a/radius2,"* radius2"
- # ellipse
- #a=2
- b=radius2
- print "b= ", b
-
-
- ecen_tmp=cam.Point(1.38,2,0)
- resolution=50
- for n in xrange(0,resolution):
- angle1= (float(n)/float(resolution))*2*math.pi
- angle2= (float(n+1)/float(resolution))*2*math.pi
- x=ecen_tmp.x + a*math.cos(angle1)
- y=ecen_tmp.y + b*math.sin(angle1)
- x2=ecen_tmp.x + a*math.cos(angle2)
- y2=ecen_tmp.y + b*math.sin(angle2)
-
- #myscreen.addActor(camvtk.Point(center=(x,y,0), color=(1,0,1)))
- #myscreen.addActor( camvtk.Line(p1=(x,y,0),p2=(x2,y2,0)) )
-
- oe = cam.Ellipse(ecen_tmp, a, b, radius1)
-
- myscreen.camera.SetPosition(5, 7, 1)
- myscreen.camera.SetFocalPoint(0.5, 0.5, 0)
-
- nmax=80
- dd = float(4.0)/nmax
- diangles = [ n*dd for n in range(nmax) ]
- epos1 = cam.EllipsePosition()
- epos2 = cam.EllipsePosition()
- for n in range(nmax):
- #s = float(n)/float(nmax-1) * 2-1
- #t = oe.teval(s, 1)
- #t2 = oe.teval(s, 0)
- n2 = n+1
- if n2==nmax:
- n2=0
- epos1.setDiangle( diangles[n] )
- epos2.setDiangle( diangles[n2] )
-
- p1 = oe.ePoint( epos1 )
- p2 = oe.ePoint( epos2 )
-
- p1o = oe.oePoint( epos1 )
- p2o = oe.oePoint( epos2 )
- #print "s=", s, "t=", t," epoint=", p1.str()
-
- myscreen.addActor( camvtk.Line(p1=(p1.x,p1.y,p1.z),p2=(p2.x,p2.y,p2.z), color=magenta) )
-
- myscreen.addActor( camvtk.Line(p1=(p1o.x,p1o.y,p1o.z),p2=(p2o.x,p2o.y,p2o.z), color=pink) )
- #myscreen.addActor(camvtk.Point(center=(p1.x,p1.y,0), color=green))
- #myscreen.addActor(camvtk.Point(center=(p2.x,p2.y,0), color=red))
-
- #myscreen.addActor(camvtk.Point(center=(p1o.x,p1o.y,0), color=green))
- #myscreen.addActor(camvtk.Point(center=(p2o.x,p2o.y,0), color=red))
-
- # ellipse point, normal
- #epos1.setDiangle(3.48) # approx solution
- epos1.setDiangle(0)
- ep = oe.ePoint( epos1 )
- oep = oe.oePoint( epos1 )
- myscreen.addActor( camvtk.Sphere(radius=0.02, center=(ep.x,ep.y,ep.z), color=magenta) )
- myscreen.addActor( camvtk.Sphere(radius=0.02, center=(oep.x,oep.y,oep.z), color=pink) )
- myscreen.addActor( camvtk.Line(p1=(ep.x,ep.y,ep.z),p2=(oep.x,oep.y,oep.z), color=red) )
-
- myscreen.render()
- #time.sleep(0.5)
-
- print "rendering...",
- #for cl,cc in zip(clpoints,ccpoints):
- # myscreen.addActor( camvtk.Point(center=(cl.x,cl.y,cl.z) , color=ccColor(cc) ) )
- # if cc.type != cam.CCType.NONE: # only render interesting cc-points
- # myscreen.addActor( camvtk.Point(center=(cc.x,cc.y,cc.z) , color=ccColor2(cc) ) )
-
-
- print "done."
-
-
-
-
- myscreen.render()
-
- w2if = vtk.vtkWindowToImageFilter()
- w2if.SetInput(myscreen.renWin)
- lwr = vtk.vtkPNGWriter()
- lwr.SetInput( w2if.GetOutput() )
- w2if.Modified()
- lwr.SetFileName("5_all.png")
- #lwr.Write()
-
-
-
- myscreen.iren.Start()
- #raw_input("Press Enter to terminate")
-
diff -Nru opencamlib-11.10+git201801200005~ubuntu16.04.1/scripts/offset-ellipse/oellipse2_tst.py opencamlib-11.10-1/scripts/offset-ellipse/oellipse2_tst.py
--- opencamlib-11.10+git201801200005~ubuntu16.04.1/scripts/offset-ellipse/oellipse2_tst.py 2018-01-20 00:05:22.000000000 +0000
+++ opencamlib-11.10-1/scripts/offset-ellipse/oellipse2_tst.py 1970-01-01 00:00:00.000000000 +0000
@@ -1,386 +0,0 @@
-import ocl as cam
-import camvtk
-import time
-import vtk
-import math
-import datetime
-
-red= (1,0,0)
-green= (0,1,0)
-blue= (0,0,1)
-cyan= (0,1,1)
-yellow= (1,1,0)
-pink = ( float(255)/255,float(192)/255,float(203)/255)
-grey = ( float(127)/255,float(127)/255,float(127)/255)
-orange = ( float(255)/255,float(165)/255,float(0)/255)
-
-def ccColor2(cc):
- """ this function returns a different color depending on the type of
- the CC-point. Useful for visualizing CL or CC points """
- if cc.type==cam.CCType.FACET:
- col = (1,0,1)
- elif cc.type == cam.CCType.VERTEX:
- col = (1,1,0)
- elif cc.type == cam.CCType.EDGE:
- col = (0,1,1)
- elif cc.type == cam.CCType.NONE:
- col = (1,1,1)
- elif cc.type == cam.CCType.ERROR:
- col = (0,0.5,1)
- return col
-
-class OffsetEllipse():
- """
- // (s, t) where: s^2 + t^2 = 1
- // point of ellipse is: ecen + j s + n t
- // tangent at point is: -j t + n s
- // normal at point is: j (s / eccen) + n (t * eccen)
- // point on offset-ellipse: point on ellipse + offrad*normal
- """
- def __init__(self, ecen, a, b, ofs):
- self.a = a
- self.b = b
- self.ecen = ecen
- self.ofs = ofs
-
- def ePoint(self,epos):
- # return a point on the ellipse
- p = cam.Point()
- p.x = self.ecen.x + self.a*epos.s
- p.y = self.ecen.y + self.b*epos.t
- return p
-
- def oePoint(self,epos):
- # return point on offset-ellipse
- p = self.ePoint(epos)
- normal = self.eNorm(epos)
- p.x = p.x + self.ofs*normal.x
- p.y = p.y + self.ofs*normal.y
- return p
-
- def eNorm(self, epos):
- normal = cam.Point( self.b*epos.s, self.a*epos.t, 0)
- normal.normalize()
- return normal
-
- def eTang(self, epos):
- p = cam.Point(-self.a*epos.t, self.b*epos.s, 0)
- p.normalize()
- return p
-
- def error(self,epos,cl):
- p1 = self.oePoint(epos)
- p2 = cl
- dx = p1.x - cl.x
- dy = p1.y - cl.y
- #return dx*dx+dy*dy
- return dy
-
-
-
-class EPos():
- """
- // (s, t) where: s^2 + t^2 = 1
- // point of ellipse is: ecen + j s + n t
- // tangent at point is: -j t + n s
- // normal at point is: j (s / eccen) + n (t * eccen)
- // point on offset-ellipse: point on ellipse + offrad*normal
- """
- def __init__(self):
- self.t = 1
- self.s = 0
- self.sett(self.t,1)
-
- def sets(self, s, side):
- if s > 1.0:
- s = 1.0
- if s < -1.0:
- s = -1.0
-
- self.s = s
- ssq = s*s
- tsq = 1 - ssq
- if side == 1:
- self.t = 1 * math.sqrt(tsq)
- else:
- self.t = -1 * math.sqrt(tsq)
-
- def sett(self, t, side):
- if t > 1.0:
- t = 1.0
- if t < -1.0:
- t = -1.0
-
- self.t = t
- tsq = t*t
- ssq = 1 - tsq
- if side == 1:
- self.s = 1 * math.sqrt(ssq)
- else:
- self.s = -1* math.sqrt(ssq)
-
- def stepTang(self, ellipse, delta):
- tang = oe.eTang(self)
- #print " epos= (", self.s," , ", self.t , " )"
- #print "steptang tang=", tang.str()
- if abs(tang.x) > abs(tang.y):
- #print "s-dir step"
- news = self.s + delta*tang.x
- if self.t > 0:
- self.sets(news,1)
- else:
- self.sets(news,0)
- else:
- #print "t-dir step"
- newt = self.t + delta*tang.y
- if self.s>0:
- self.sett( newt,1)
- else:
- self.sett( newt,0)
-
-
-if __name__ == "__main__":
- myscreen = camvtk.VTKScreen()
-
- myscreen.camera.SetPosition(5, 3, 2)
- myscreen.camera.SetFocalPoint(1.38,1, 0)
-
- a=cam.Point(3,2,-2)
- b=cam.Point(-1,2,3)
-
- myscreen.addActor(camvtk.Point(center=(a.x,a.y,a.z), color=(1,0,1)));
- myscreen.addActor(camvtk.Point(center=(b.x,b.y,b.z), color=(1,0,1)));
- #c=cam.Point(0,0,0.3)
- myscreen.addActor( camvtk.Line(p1=(a.x,a.y,a.z),p2=(b.x,b.y,b.z)) )
- #t = cam.Triangle(a,b,c)
-
- cutter = cam.BullCutter(1,0.2)
-
-
- print cutter.str()
-
- xar = camvtk.Arrow(color=red, rotXYZ=(0,0,0))
- myscreen.addActor(xar)
- yar = camvtk.Arrow(color=green, rotXYZ=(0,0,90))
- myscreen.addActor(yar)
- zar = camvtk.Arrow(color=blue, rotXYZ=(0,-90,0))
- myscreen.addActor(zar)
-
- cl = cam.Point(2.193, 1, 0)
- radius1=1
- radius2=0.25
-
- tor = camvtk.Toroid(r1=radius1, r2=radius2, center=(cl.x, cl.y, cl.z),rotXYZ=(0,0,0))
- #tor.SetWireframe()
- #myscreen.addActor(tor)
-
- cyl = camvtk.Cylinder(center=(cl.x,cl.y,cl.z) , radius=radius1, height=2, color=(0,1,1),
- rotXYZ=(90,0,0), resolution=50 )
- #myscreen.addActor(cyl)
-
- tube = camvtk.Tube(p1=(a.x,a.y,a.z),p2=(b.x,b.y,b.z),color=(1,1,0))
- tube.SetOpacity(0.2)
- #myscreen.addActor(tube)
-
- cir= camvtk.Circle(radius=radius1, center=(cl.x,cl.y,cl.z), color=yellow)
- myscreen.addActor(cir)
-
- clp = camvtk.Point(center=(cl.x,cl.y,cl.z))
- myscreen.addActor(clp)
-
- # short axis of ellipse = radius2
- # long axis of ellipse = radius2/sin(theta)
- # where theta is the slope of the line
- dx = b.x - a.x
- dz = b.z - a.z
- #print "dx=", dx
- #print "dz=", dz
- theta = math.atan(dz/dx)
- #print "theta=",theta
- a = abs( radius2/math.sin(theta) )
- #print "a=", a, " = ", a/radius2,"* radius2"
- # ellipse
- #a=2
- b=radius2
- #print "b= ", b
-
-
- ecen_tmp=cam.Point(1.38,2,0)
- resolution=50
- for n in xrange(0,resolution):
- angle1= (float(n)/float(resolution))*2*math.pi
- angle2= (float(n+1)/float(resolution))*2*math.pi
- x=ecen_tmp.x + a*math.cos(angle1)
- y=ecen_tmp.y + b*math.sin(angle1)
- x2=ecen_tmp.x + a*math.cos(angle2)
- y2=ecen_tmp.y + b*math.sin(angle2)
-
- #myscreen.addActor(camvtk.Point(center=(x,y,0), color=(1,0,1)))
- #myscreen.addActor( camvtk.Line(p1=(x,y,0),p2=(x2,y2,0)) )
-
- oe = OffsetEllipse(ecen_tmp, a, b, radius1)
-
-
-
- nmax=20
- delta=0.05
- td = 1
- epos1 = EPos()
- epos2 = EPos()
- epos3 = EPos()
- epos4 = EPos()
- epos5 = EPos()
- for n in xrange(0,nmax):
- s = float(n)/float(nmax-1) * float(2)/math.sqrt(2) - float(1)/math.sqrt(2)
- t = float(n)/float(nmax-1) * float(2)/math.sqrt(2) - float(1)/math.sqrt(2)
-
- epos1.sets(s,1)
- epos2.sets(s,0)
- epos3.sett(t,1)
- epos4.sett(t,0)
-
- p1 = oe.ePoint(epos1)
- p2 = oe.ePoint(epos2)
- p3 = oe.ePoint(epos3)
- p4 = oe.ePoint(epos4)
- p5 = oe.ePoint(epos5)
-
- p1o = oe.oePoint(epos1)
- p2o = oe.oePoint(epos2)
- #print "s=", s, "t=", t," epoint=", p1.str()
- myscreen.addActor(camvtk.Point(center=(p1.x,p1.y,0), color=green)) # green steps along s (side=1)
- myscreen.addActor(camvtk.Point(center=(p2.x,p2.y,0), color=red)) # red steps along s (side=0)
- myscreen.addActor(camvtk.Point(center=(p3.x,p3.y,0), color=orange)) # orange steps along t (side=1)
- myscreen.addActor(camvtk.Point(center=(p4.x,p4.y,0), color=pink)) # pink steps along t (side=0)
-
- #myscreen.addActor(camvtk.Sphere(center=(p5.x,p5.y,0), radius=0.02, color=red))
- #myscreen.addActor(camvtk.Point(center=(p1o.x,p1o.y,0), color=green))
- #myscreen.addActor(camvtk.Point(center=(p2o.x,p2o.y,0), color=red))
-
- """
- tx = float(n)/float(nmax-1) * 2 - 1
- sx = oe.seval(tx, 1)
- sx2 = oe.seval(tx, 0)
- p3 = oe.ePoint(sx,tx)
- p4 = oe.ePoint(sx2,tx)
- #myscreen.addActor(camvtk.Point(center=(p3.x,p3.y,0), color=orange))
- #myscreen.addActor(camvtk.Point(center=(p4.x,p4.y,0), color=pink))
-
- sd = oe.seval(td,1)
- p5 = oe.ePoint(td,sd)
- myscreen.addActor(camvtk.Point(center=(p5.x,p5.y,0), color=orange))
- """
- myscreen.render()
- #time.sleep(0.05)
-
- t = camvtk.Text()
- t.SetPos( (myscreen.width-450, myscreen.height-30) )
-
- myscreen.addActor( t)
- t2 = camvtk.Text()
- t2.SetPos( (50, myscreen.height-150) )
-
- myscreen.addActor( t2)
-
- epos5.sets(0.5,1)
- Nsteps=10
- endcondition = 0
- n = 1
- NRStep=0.1
-
- w2if = vtk.vtkWindowToImageFilter()
- w2if.SetInput(myscreen.renWin)
- lwr = vtk.vtkPNGWriter()
- lwr.SetInput( w2if.GetOutput() )
-
-
- while not endcondition:
- #for n in xrange(0,Nsteps):
- t.SetText("OpenCAMLib 10.03-beta, " + datetime.datetime.now().strftime("%Y-%m-%d %H:%M:%S"))
- current_error = oe.error(epos5, cl)
-
- print "current error=", current_error
- epos_tmp = EPos()
- epos_tmp.s = epos5.s
- epos_tmp.t = epos5.t
- # take a small step, to determine rerivative:
- dt = 0.2*NRStep
- epos_tmp.stepTang(oe,dt)
- new_error = oe.error(epos_tmp, cl)
- print "new_error=", new_error
- deriv = (new_error-current_error)/dt
- print "derivative = ", deriv
- paramtext = "(s, t) = (%3.3f, %3.3f)\n NR iteration # = %i \n error= %3.9f\n de=%3.3f" % (epos5.s, epos5.t, n, current_error,deriv)
- t2.SetText(paramtext)
- # take Newton rhapson step
- NRStep = (-current_error/deriv)
- print " step=", NRStep
- #NRStep=0.05 # debug/demo
- epos5.stepTang(oe, NRStep)
-
- p5 = oe.ePoint(epos5)
- esphere = camvtk.Sphere(center=(p5.x,p5.y,0), radius=0.02, color=red)
- myscreen.addActor(esphere)
-
- p6 = oe.eTang(epos5)
- p7 = oe.oePoint(epos5)
- oesphere = camvtk.Sphere(center=(p7.x,p7.y,p7.z), radius=0.02, color=green)
- tangline = camvtk.Line(p1=(p5.x,p5.y,p5.z),p2=(p5.x+p6.x,p5.y+p6.y,p5.z+p6.z))
- normline = camvtk.Line(p1=(p5.x,p5.y,p5.z),p2=(p7.x,p7.y,p7.z), color=yellow)
-
- myscreen.addActor( tangline )
- myscreen.addActor( normline )
- myscreen.addActor( oesphere )
-
-
- myscreen.render()
- time.sleep(0.5)
-
- if abs(current_error) < 1e-8:
- endcondition=1
- if n>125:
- endcondition=1
-
- if not endcondition:
- myscreen.removeActor(esphere)
- myscreen.removeActor(tangline)
- myscreen.removeActor(normline)
- myscreen.removeActor(oesphere)
-
-
- w2if.Modified()
- #lwr.SetFileName("5_all.png")
- """
- for i in xrange(0,10):
- lwr.SetFileName("frames/oe_nrx"+ ('%05d%02d' % (n,i))+".png")
- lwr.Write()
- """
- n=n+1
-
- print "rendering...",
- #for cl,cc in zip(clpoints,ccpoints):
- # myscreen.addActor( camvtk.Point(center=(cl.x,cl.y,cl.z) , color=ccColor(cc) ) )
- # if cc.type != cam.CCType.NONE: # only render interesting cc-points
- # myscreen.addActor( camvtk.Point(center=(cc.x,cc.y,cc.z) , color=ccColor2(cc) ) )
-
-
- print "done."
-
-
-
-
- myscreen.render()
-
- w2if = vtk.vtkWindowToImageFilter()
- w2if.SetInput(myscreen.renWin)
- lwr = vtk.vtkPNGWriter()
- lwr.SetInput( w2if.GetOutput() )
- w2if.Modified()
- lwr.SetFileName("5_all.png")
- #lwr.Write()
-
-
-
- myscreen.iren.Start()
- #raw_input("Press Enter to terminate")
-
diff -Nru opencamlib-11.10+git201801200005~ubuntu16.04.1/scripts/offset-ellipse/oellipse3_tst.py opencamlib-11.10-1/scripts/offset-ellipse/oellipse3_tst.py
--- opencamlib-11.10+git201801200005~ubuntu16.04.1/scripts/offset-ellipse/oellipse3_tst.py 2018-01-20 00:05:22.000000000 +0000
+++ opencamlib-11.10-1/scripts/offset-ellipse/oellipse3_tst.py 1970-01-01 00:00:00.000000000 +0000
@@ -1,454 +0,0 @@
-import ocl as cam
-import camvtk
-import time
-import vtk
-import math
-import datetime
-
-red= (1,0,0)
-green= (0,1,0)
-blue= (0,0,1)
-cyan= (0,1,1)
-yellow= (1,1,0)
-pink = ( float(255)/255,float(192)/255,float(203)/255)
-grey = ( float(127)/255,float(127)/255,float(127)/255)
-orange = ( float(255)/255,float(165)/255,float(0)/255)
-
-def ccColor2(cc):
- """ this function returns a different color depending on the type of
- the CC-point. Useful for visualizing CL or CC points """
- if cc.type==cam.CCType.FACET:
- col = (1,0,1)
- elif cc.type == cam.CCType.VERTEX:
- col = (1,1,0)
- elif cc.type == cam.CCType.EDGE:
- col = (0,1,1)
- elif cc.type == cam.CCType.NONE:
- col = (1,1,1)
- elif cc.type == cam.CCType.ERROR:
- col = (0,0.5,1)
- return col
-
-class OffsetEllipse():
- """
- // (s, t) where: s^2 + t^2 = 1
- // point of ellipse is: ecen + j s + n t
- // tangent at point is: -j t + n s
- // normal at point is: j (s / eccen) + n (t * eccen)
- // point on offset-ellipse: point on ellipse + offrad*normal
- """
- def __init__(self, ecen, a, b, ofs):
- self.a = a
- self.b = b
- self.ecen = ecen
- self.ofs = ofs
-
- def ePoint(self,epos):
- # return a point on the ellipse
- p = cam.Point()
- p.x = self.ecen.x + self.a*epos.s
- p.y = self.ecen.y + self.b*epos.t
- return p
-
- def oePoint(self,epos):
- # return point on offset-ellipse
- p = self.ePoint(epos)
- normal = self.eNorm(epos)
- p.x = p.x + self.ofs*normal.x
- p.y = p.y + self.ofs*normal.y
- return p
-
- def eNorm(self, epos):
- normal = cam.Point( self.b*epos.s, self.a*epos.t, 0)
- normal.normalize()
- return normal
-
- def eTang(self, epos):
- p = cam.Point(-self.a*epos.t, self.b*epos.s, 0)
- p.normalize()
- return p
-
- def error(self,epos,cl):
- p1 = self.oePoint(epos)
- p2 = cl
- dx = p1.x - cl.x
- dy = p1.y - cl.y
- #return dx*dx+dy*dy
- return dy
-
-
-
-class EPos():
- """
- // (s, t) where: s^2 + t^2 = 1
- // point of ellipse is: ecen + j s + n t
- // tangent at point is: -j t + n s
- // normal at point is: j (s / eccen) + n (t * eccen)
- // point on offset-ellipse: point on ellipse + offrad*normal
- """
- def __init__(self):
- self.t = 1
- self.s = 0
- self.sett(self.t,1)
-
- def sets(self, s, side):
- if s > 1.0:
- s = 1.0
- if s < -1.0:
- s = -1.0
-
- self.s = s
- ssq = s*s
- tsq = 1 - ssq
- if side == 1:
- self.t = 1 * math.sqrt(tsq)
- else:
- self.t = -1 * math.sqrt(tsq)
-
- def sett(self, t, side):
- if t > 1.0:
- t = 1.0
- if t < -1.0:
- t = -1.0
-
- self.t = t
- tsq = t*t
- ssq = 1 - tsq
- if side == 1:
- self.s = 1 * math.sqrt(ssq)
- else:
- self.s = -1* math.sqrt(ssq)
-
- def stepTang(self, ellipse, delta):
- tang = oe.eTang(self)
- #print " epos= (", self.s," , ", self.t , " )"
- #print "steptang tang=", tang.str()
- if abs(tang.x) > abs(tang.y):
- #print "s-dir step"
- news = self.s + delta*tang.x
- if self.t > 0:
- self.sets(news,1)
- else:
- self.sets(news,0)
- else:
- #print "t-dir step"
- newt = self.t + delta*tang.y
- if self.s>0:
- self.sett( newt,1)
- else:
- self.sett( newt,0)
-
-def solver(oe, epos, cl):
- endcondition = 0
- NRStep = 0.1
- n=0
- while not endcondition:
- current_error = oe.error(epos, cl)
- #print "current error=", current_error
- epos_tmp = EPos()
- epos_tmp.s = epos.s
- epos_tmp.t = epos.t
- # take a small step, to determine rerivative:
- dt = 0.2*NRStep
- epos_tmp.stepTang(oe,dt)
- new_error = oe.error(epos_tmp, cl)
- #print "new_error=", new_error
- deriv = (new_error-current_error)/dt
- #print "derivative = ", deriv
- # take Newton rhapson step
- NRStep = (-current_error/deriv)
- #print " NRstep=", NRStep
- #NRStep=0.05 # debug/demo
- epos5.stepTang(oe, NRStep)
-
- # check endcondition
- if abs(current_error) < 1e-8:
- endcondition=1
- if n>125:
- endcondition=1
- n=n+1
- return n
-
-if __name__ == "__main__":
- myscreen = camvtk.VTKScreen()
-
- myscreen.camera.SetPosition(5, 3, 2)
- myscreen.camera.SetFocalPoint(1.38,1, 0)
-
- a=cam.Point(3,2,-2)
- b=cam.Point(-1,2,3)
-
- myscreen.addActor(camvtk.Point(center=(a.x,a.y,a.z), color=(1,0,1)));
- myscreen.addActor(camvtk.Point(center=(b.x,b.y,b.z), color=(1,0,1)));
- #c=cam.Point(0,0,0.3)
- myscreen.addActor( camvtk.Line(p1=(a.x,a.y,a.z),p2=(b.x,b.y,b.z)) )
- #t = cam.Triangle(a,b,c)
-
- cutter = cam.BullCutter(1,0.2)
-
-
- print cutter.str()
-
- xar = camvtk.Arrow(color=red, rotXYZ=(0,0,0))
- #xar.SetFlat()
- myscreen.addActor(xar)
- yar = camvtk.Arrow(color=green, rotXYZ=(0,0,90))
- #yar.SetGouraud()
- myscreen.addActor(yar)
- zar = camvtk.Arrow(color=blue, rotXYZ=(0,-90,0))
- #zar.SetPhong()
- myscreen.addActor(zar)
-
- cl = cam.Point(2.193, 1, 0)
- radius1=1
- radius2=0.25
-
- tor = camvtk.Toroid(r1=radius1, r2=radius2, center=(cl.x, cl.y, cl.z),rotXYZ=(0,0,0))
- #tor.SetWireframe()
- #myscreen.addActor(tor)
-
- cyl = camvtk.Cylinder(center=(cl.x,cl.y,cl.z) , radius=radius1, height=2, color=(0,1,1),
- rotXYZ=(90,0,0), resolution=50 )
- #myscreen.addActor(cyl)
-
- tube = camvtk.Tube(p1=(a.x,a.y,a.z),p2=(b.x,b.y,b.z),color=(1,1,0))
- tube.SetOpacity(0.2)
- #myscreen.addActor(tube)
-
- cir= camvtk.Circle(radius=radius1, center=(cl.x,cl.y,cl.z), color=yellow)
- myscreen.addActor(cir)
-
- clp = camvtk.Point(center=(cl.x,cl.y,cl.z))
- myscreen.addActor(clp)
-
- # short axis of ellipse = radius2
- # long axis of ellipse = radius2/sin(theta)
- # where theta is the slope of the line
- dx = b.x - a.x
- dz = b.z - a.z
- #print "dx=", dx
- #print "dz=", dz
- theta = math.atan(dz/dx)
- #print "theta=",theta
- a = abs( radius2/math.sin(theta) )
- #print "a=", a, " = ", a/radius2,"* radius2"
- # ellipse
- #a=2
- b=radius2
- #print "b= ", b
-
-
- ecen_tmp=cam.Point(1.38,2,0)
- resolution=50
- """
- for n in xrange(0,resolution):
- angle1= (float(n)/float(resolution))*2*math.pi
- angle2= (float(n+1)/float(resolution))*2*math.pi
- x=ecen_tmp.x + a*math.cos(angle1)
- y=ecen_tmp.y + b*math.sin(angle1)
- x2=ecen_tmp.x + a*math.cos(angle2)
- y2=ecen_tmp.y + b*math.sin(angle2)
-
- #myscreen.addActor(camvtk.Point(center=(x,y,0), color=(1,0,1)))
- #myscreen.addActor( camvtk.Line(p1=(x,y,0),p2=(x2,y2,0)) )
- """
-
- oe = OffsetEllipse(ecen_tmp, a, b, radius1)
- oe2 = OffsetEllipse(ecen_tmp, a, b, 0.05)
-
-
- nmax=20
- delta=0.05
- td = 1
- epos1 = EPos()
- epos2 = EPos()
- epos3 = EPos()
- epos4 = EPos()
- epos5 = EPos()
- """
- for n in xrange(0,nmax):
- s = float(n)/float(nmax-1) * float(2)/math.sqrt(2) - float(1)/math.sqrt(2)
- t = float(n)/float(nmax-1) * float(2)/math.sqrt(2) - float(1)/math.sqrt(2)
-
- epos1.sets(s,1)
- epos2.sets(s,0)
- epos3.sett(t,1)
- epos4.sett(t,0)
-
- p1 = oe.ePoint(epos1)
- p2 = oe.ePoint(epos2)
- p3 = oe.ePoint(epos3)
- p4 = oe.ePoint(epos4)
- p5 = oe.ePoint(epos5)
-
- p1o = oe.oePoint(epos1)
- p2o = oe.oePoint(epos2)
- #print "s=", s, "t=", t," epoint=", p1.str()
- myscreen.addActor(camvtk.Point(center=(p1.x,p1.y,0), color=green)) # green steps along s (side=1)
- myscreen.addActor(camvtk.Point(center=(p2.x,p2.y,0), color=red)) # red steps along s (side=0)
- myscreen.addActor(camvtk.Point(center=(p3.x,p3.y,0), color=orange)) # orange steps along t (side=1)
- myscreen.addActor(camvtk.Point(center=(p4.x,p4.y,0), color=pink)) # pink steps along t (side=0)
-
- #myscreen.addActor(camvtk.Sphere(center=(p5.x,p5.y,0), radius=0.02, color=red))
- #myscreen.addActor(camvtk.Point(center=(p1o.x,p1o.y,0), color=green))
- #myscreen.addActor(camvtk.Point(center=(p2o.x,p2o.y,0), color=red))
-
-
- tx = float(n)/float(nmax-1) * 2 - 1
- sx = oe.seval(tx, 1)
- sx2 = oe.seval(tx, 0)
- p3 = oe.ePoint(sx,tx)
- p4 = oe.ePoint(sx2,tx)
- #myscreen.addActor(camvtk.Point(center=(p3.x,p3.y,0), color=orange))
- #myscreen.addActor(camvtk.Point(center=(p4.x,p4.y,0), color=pink))
-
- sd = oe.seval(td,1)
- p5 = oe.ePoint(td,sd)
- myscreen.addActor(camvtk.Point(center=(p5.x,p5.y,0), color=orange))
-
- myscreen.render()
- #time.sleep(0.05)
- """
-
- t = camvtk.Text()
- t.SetPos( (myscreen.width-450, myscreen.height-30) )
-
- myscreen.addActor( t)
- t2 = camvtk.Text()
- t2.SetPos( (50, myscreen.height-150) )
-
- myscreen.addActor( t2)
-
- #epos5.sets(0.5,1)
- Nsteps=62
- endcondition = 0
- n = 1
- NRStep=0.1
-
- w2if = vtk.vtkWindowToImageFilter()
- w2if.SetInput(myscreen.renWin)
- lwr = vtk.vtkPNGWriter()
- lwr.SetInput( w2if.GetOutput() )
-
-
- epos5.sets(0,1)
- epos1.sets(0,1)
- #while not endcondition:
- convlist=[]
- for n in xrange(0,Nsteps):
- t.SetText("OpenCAMLib 10.03-beta, " + datetime.datetime.now().strftime("%Y-%m-%d %H:%M:%S"))
- #current_error = oe.error(epos5, cl)
- epos5.s=epos1.s
- epos5.t=epos1.t
- #print "current error=", current_error
- #epos_tmp = EPos()
- #epos_tmp.s = epos5.s
- #epos_tmp.t = epos5.t
- # take a small step, to determine rerivative:
- #dt = 0.2*NRStep
- #epos_tmp.stepTang(oe,dt)
- #new_error = oe.error(epos_tmp, cl)
- #print "new_error=", new_error
- #deriv = (new_error-current_error)/dt
- #print "derivative = ", deriv
- #paramtext = "(s, t) = (%3.3f, %3.3f)\n NR iteration # = %i \n error= %3.9f\n de=%3.3f" % (epos5.s, epos5.t, n, current_error,deriv)
- #t2.SetText(paramtext)
- # take Newton rhapson step
- #NRStep = (-current_error/deriv)
- #print " step=", NRStep
- #NRStep=0.05 # debug/demo
- #epos5.stepTang(oe, NRStep)
-
-
-
-
- #p6 = oe.eTang(epos5)
- #p7 = oe.oePoint(epos5)
- #oesphere = camvtk.Sphere(center=(p7.x,p7.y,p7.z), radius=0.02, color=green)
- #tangline = camvtk.Line(p1=(p5.x,p5.y,p5.z),p2=(p5.x+p6.x,p5.y+p6.y,p5.z+p6.z))
- #normline = camvtk.Line(p1=(p5.x,p5.y,p5.z),p2=(p7.x,p7.y,p7.z), color=yellow)
-
- #myscreen.addActor( tangline )
- #myscreen.addActor( normline )
- #myscreen.addActor( oesphere )
- p5 = oe.ePoint(epos5)
- pt = oe2.oePoint(epos5)
- #print "before= ", epos5.s, " , ", epos5.t
- nsteps = solver(oe, epos5, cl)
- print nsteps
- convlist.append(nsteps)
-
- convtext = "%i" % (nsteps)
- print (pt.x, pt.y, pt.z)
- #center=(pt.x, pt.y, pt.z)
- tst = camvtk.Text3D( color=(1,1,1), center=(pt.x, pt.y, 0) ,
- text=convtext, scale=0.02)
- #tst.SetCamera(myscreen.camera)
- myscreen.addActor(tst)
-
- colmax=11
- colmin=4
- nsteps = nsteps - colmin
- colmax = colmax - colmin
- convcolor=( float(nsteps*nsteps)/(colmax), float((colmax-nsteps))/colmax, 0 )
- esphere = camvtk.Sphere(center=(p5.x,p5.y,0), radius=0.02, color=convcolor)
- myscreen.addActor(esphere)
-
-
-
-
- #print "after= ", epos5.s, " , ", epos5.t
- epos1.stepTang(oe, 0.1)
- #print "after= ", epos5.s, " , ", epos5.t
-
- myscreen.render()
- #time.sleep(0.1)
- #raw_input("Press Enter to terminate")
- #if abs(current_error) < 1e-8:
- # endcondition=1
- #if n>125:
- # endcondition=1
-
- #if not endcondition:
- # myscreen.removeActor(esphere)
- # myscreen.removeActor(tangline)
- # myscreen.removeActor(normline)
- # myscreen.removeActor(oesphere)
-
-
- w2if.Modified()
- #lwr.SetFileName("5_all.png")
- """
- for i in xrange(0,10):
- lwr.SetFileName("frames/oe_nrx"+ ('%05d%02d' % (n,i))+".png")
- lwr.Write()
- """
- n=n+1
- print convlist
- #print "rendering...",
- #for cl,cc in zip(clpoints,ccpoints):
- # myscreen.addActor( camvtk.Point(center=(cl.x,cl.y,cl.z) , color=ccColor(cc) ) )
- # if cc.type != cam.CCType.NONE: # only render interesting cc-points
- # myscreen.addActor( camvtk.Point(center=(cc.x,cc.y,cc.z) , color=ccColor2(cc) ) )
-
-
- print "done."
-
-
-
-
- myscreen.render()
-
- w2if = vtk.vtkWindowToImageFilter()
- w2if.SetInput(myscreen.renWin)
- lwr = vtk.vtkPNGWriter()
- lwr.SetInput( w2if.GetOutput() )
- w2if.Modified()
- lwr.SetFileName("5_all.png")
- #lwr.Write()
-
-
-
- myscreen.iren.Start()
- #raw_input("Press Enter to terminate")
-
diff -Nru opencamlib-11.10+git201801200005~ubuntu16.04.1/scripts/offset-ellipse/oellipse4_tst.py opencamlib-11.10-1/scripts/offset-ellipse/oellipse4_tst.py
--- opencamlib-11.10+git201801200005~ubuntu16.04.1/scripts/offset-ellipse/oellipse4_tst.py 2018-01-20 00:05:22.000000000 +0000
+++ opencamlib-11.10-1/scripts/offset-ellipse/oellipse4_tst.py 1970-01-01 00:00:00.000000000 +0000
@@ -1,235 +0,0 @@
-import ocl as cam
-import camvtk
-import time
-import vtk
-import math
-import datetime
-
-def drawellipse(myscreen, ellcenter, a_axis, b_axis):
- resolution=50
- for n in xrange(0,resolution):
- angle1= (float(n)/float(resolution))*2*math.pi
- angle2= (float(n+1)/float(resolution))*2*math.pi
- x=ellcenter.x + a_axis*math.cos(angle1)
- y=ellcenter.y + b_axis*math.sin(angle1)
- z=ellcenter.z
- x2=ellcenter.x + a_axis*math.cos(angle2)
- y2=ellcenter.y + b_axis*math.sin(angle2)
- myscreen.addActor( camvtk.Line(p1=(x,y,z),p2=(x2,y2,z), color=camvtk.grey) )
-
-def main(ycoord=0.970, filename="test"):
- myscreen = camvtk.VTKScreen()
-
- myscreen.camera.SetPosition(2, 5, 5)
- myscreen.camera.SetFocalPoint(1.38,1, 0)
-
- #ycoord = 1.1
-
- a=cam.Point(3,ycoord,-2)
- b=cam.Point(-1,ycoord,3)
-
- myscreen.addActor(camvtk.Point(center=(a.x,a.y,a.z), color=(1,0,1)));
- myscreen.addActor(camvtk.Point(center=(b.x,b.y,b.z), color=(1,0,1)));
- #c=cam.Point(0,0,0.3)
- myscreen.addActor( camvtk.Line(p1=(a.x,a.y,a.z),p2=(b.x,b.y,b.z)) )
- #t = cam.Triangle(a,b,c)
-
- cutter = cam.BullCutter(1,0.2,20)
-
- print cutter
- xar = camvtk.Arrow(color=camvtk.red, rotXYZ=(0,0,0))
- myscreen.addActor(xar)
- yar = camvtk.Arrow(color=camvtk.green, rotXYZ=(0,0,90))
- myscreen.addActor(yar)
- zar = camvtk.Arrow(color=camvtk.blue, rotXYZ=(0,-90,0))
- myscreen.addActor(zar)
-
- cl = cam.Point(2.1748, 1, 0)
- radius1=1
- radius2=0.25
-
- tor = camvtk.Toroid(r1=radius1, r2=radius2, center=(cl.x, cl.y, cl.z),rotXYZ=(0,0,0))
- #tor.SetWireframe()
- #myscreen.addActor(tor)
-
- cyl = camvtk.Cylinder(center=(cl.x,cl.y,cl.z) , radius=radius1, height=2, color=(0,1,1),
- rotXYZ=(90,0,0), resolution=50 )
- #myscreen.addActor(cyl)
-
- cl_line = camvtk.Line( p1=(cl.x,cl.y,-100),p2=(cl.x,cl.y,+100), color=camvtk.red )
- myscreen.addActor(cl_line)
-
- tube = camvtk.Tube(p1=(a.x,a.y,a.z),p2=(b.x,b.y,b.z),color=(1,1,0))
- tube.SetOpacity(0.2)
- myscreen.addActor(tube)
-
- # cylindrical-cutter circle at z=0 plane
- #cir= camvtk.Circle(radius=radius1, center=(cl.x,cl.y,cl.z), color=camvtk.yellow)
- #myscreen.addActor(cir)
-
- #clp = camvtk.Point(center=(cl.x,cl.y,cl.z))
- #myscreen.addActor(clp)
-
- # short axis of ellipse = radius2
- # long axis of ellipse = radius2/sin(theta)
- # where theta is the slope of the line
- dx = b.x - a.x
- dz = b.z - a.z
- #print "dx=", dx
- #print "dz=", dz
- theta = math.atan(dz/dx) ## dx==0 is special case!! (i.e. vertical lines)
- print "theta=",theta
- a_axis = abs( radius2/math.sin(theta) )
- print "a=", a_axis
- # ellipse
- #a=2
- b_axis=radius2
- print "b= ", b_axis
-
-
- # slice the tube with a plane at z=0 and find the ellipse center
- # line is from Point a to b:
- # a + t*(b-a)
- # find t so that z-component is zero:
- # a.z + t( b.z -a.z) = 0
- # t= a.z / (b.z - a.z)
- # so point
- tparam = -a.z / (b.z - a.z) # NOTE horizontal lines are a special case!!
- ellcenter = a + tparam*(b-a)
- print "ellcenter (z=0?) =", ellcenter
- # center of the
- # ecen_tmp=cam.Point(ellcenter,a.y,0)
-
- #drawellipse(myscreen, ellcenter, a_axis, b_axis)
-
-
-
- oe = cam.Ellipse(ellcenter, a_axis, b_axis, radius1)
-
- #oe2 = cam.Ellipse(ellcenter, a_axis, b_axis, 0.05) # to locate text on the outside of the ellipse
-
-
- nmax=20
- #delta=0.05
- #td = 1
-
-
-
- t = camvtk.Text()
- t.SetPos( (myscreen.width-450, myscreen.height-30) )
-
-
- myscreen.addActor( t)
- t2 = camvtk.Text()
- ytext = "Y: %3.3f" % (ycoord)
- t2.SetText(ytext)
- t2.SetPos( (50, myscreen.height-150) )
- myscreen.addActor( t2)
-
-
-
- w2if = vtk.vtkWindowToImageFilter()
- w2if.SetInput(myscreen.renWin)
- lwr = vtk.vtkPNGWriter()
- lwr.SetInput( w2if.GetOutput() )
-
- epos = cam.Epos()
- epos.setS(0,1)
- #epos1.setS(0,1)
-
- t.SetText("OpenCAMLib 10.03-beta, " + datetime.datetime.now().strftime("%Y-%m-%d %H:%M:%S"))
-
-
- #p5 = oe.ePoint(epos5)
- #pt = oe2.oePoint(epos5)
- #print "before= ", epos5.s, " , ", epos5.t
- nsteps = cam.Ellipse.solver(oe, cl)
- epos = oe.epos1
- cce = oe.ePoint(epos)
- cle = oe.oePoint(epos)
- #epos2 = cam.Epos()
- #epos.s = epos.s
- #epos.t = epos.t
- #print nsteps
- print "solution1 at: ", epos.s , " , ", epos.t
- #print "solution2 at: ", epos2.s , " , ", epos2.t
- print " cl =", cl
- print " cle=", cle
-
- xoffset = cl.x - cle.x
- print "xoffset= ", xoffset
- # we slide xoffset along the x-axis from ellcenter
- # to find the correct z-plane
- # line is: a + t*(b-a)
- # find t so that x-component is ellcenter.x + xoffset
- # a.x + t(b.x-a.x) = ellcenter.x + xoffset
- # t= (ellcenter.x + xoffset - a.x) / (b.x - a.x)
- tparam2 = (ellcenter.x + xoffset - a.x) / (b.x - a.x)
- slide = tparam2*(b-a)
- print "sliding z-delta: ", slide.z
- elc2 = a + tparam2*(b-a)
- print "ellcenter2=", elc2
- #convlist.append(nsteps)
- fe = cam.Ellipse(elc2, a_axis, b_axis, radius1)
- fecen = camvtk.Sphere(center=(elc2.x,elc2.y,elc2.z), radius=0.01, color=camvtk.pink)
- myscreen.addActor(fecen)
- fccp = fe.ePoint(epos)
- fclp = fe.oePoint(epos)
- print "solver cl=", fclp, " == ", cl, " ??"
-
- fcir= camvtk.Circle(radius=radius1, center=(cl.x,cl.y,elc2.z), color=camvtk.yellow)
- myscreen.addActor(fcir)
-
- fccpoint = camvtk.Sphere(center=(fccp.x,fccp.y,fccp.z), radius=0.01, color=camvtk.green)
- myscreen.addActor(fccpoint)
-
- fclpoint = camvtk.Sphere(center=(fclp.x,fclp.y,fclp.z), radius=0.01, color=camvtk.blue)
- myscreen.addActor(fclpoint)
-
- # line from ellipse center to fcc
- myscreen.addActor(camvtk.Line( p1=(elc2.x,elc2.y,elc2.z),p2=(fccp.x,fccp.y,fccp.z), color=camvtk.cyan ))
- # the offset normal
- myscreen.addActor(camvtk.Line( p1=(fclp.x,fclp.y,fclp.z),p2=(fccp.x,fccp.y,fccp.z), color=camvtk.yellow ))
-
- drawellipse(myscreen, elc2, a_axis, b_axis)
- #convtext = "%i" % (nsteps)
- #print (pt.x, pt.y, pt.z)
- #center=(pt.x, pt.y, pt.z)
- #tst = camvtk.Text3D( color=(1,1,1), center=(pt.x, pt.y, 0) ,
- #text=convtext, scale=0.02)
- #tst.SetCamera(myscreen.camera)
- #myscreen.addActor(tst)
-
- colmax=11
- colmin=4
- nsteps = nsteps - colmin
- colmax = colmax - colmin
- convcolor=( float(nsteps*nsteps)/(colmax), float((colmax-nsteps))/colmax, 0 )
- #esphere = camvtk.Sphere(center=(p5.x,p5.y,0), radius=0.01, color=convcolor)
- end_sphere = camvtk.Sphere(center=(cce.x,cce.y,0), radius=0.01, color=camvtk.green)
- cl_sphere = camvtk.Sphere(center=(cle.x,cle.y,0), radius=0.01, color=camvtk.pink)
- cl_sphere.SetOpacity(0.4)
-
- clcir= camvtk.Circle(radius=radius1, center=(cle.x,cle.y,cle.z), color=camvtk.pink)
- myscreen.addActor(clcir)
-
- #myscreen.addActor(esphere)
- myscreen.addActor(end_sphere)
- myscreen.addActor(cl_sphere)
- #myscreen.render()
-
- print "done."
- myscreen.render()
- lwr.SetFileName(filename)
- #lwr.Write()
- #raw_input("Press Enter to terminate")
- #time.sleep(0.5)
- myscreen.iren.Start()
-
-
-if __name__ == "__main__":
- main()
- #myscreen.iren.Start()
- #raw_input("Press Enter to terminate")
-
-
diff -Nru opencamlib-11.10+git201801200005~ubuntu16.04.1/scripts/offset-ellipse/oellipse5_tst.py opencamlib-11.10-1/scripts/offset-ellipse/oellipse5_tst.py
--- opencamlib-11.10+git201801200005~ubuntu16.04.1/scripts/offset-ellipse/oellipse5_tst.py 2018-01-20 00:05:22.000000000 +0000
+++ opencamlib-11.10-1/scripts/offset-ellipse/oellipse5_tst.py 1970-01-01 00:00:00.000000000 +0000
@@ -1,290 +0,0 @@
-import ocl as cam
-import camvtk
-import time
-import vtk
-import math
-import datetime
-
-def drawellipse(myscreen, ellcenter, a_axis, b_axis):
- resolution=50
- for n in xrange(0,resolution):
- angle1= (float(n)/float(resolution))*2*math.pi
- angle2= (float(n+1)/float(resolution))*2*math.pi
- x=ellcenter.x + a_axis*math.cos(angle1)
- y=ellcenter.y + b_axis*math.sin(angle1)
- z=ellcenter.z
- x2=ellcenter.x + a_axis*math.cos(angle2)
- y2=ellcenter.y + b_axis*math.sin(angle2)
- myscreen.addActor( camvtk.Line(p1=(x,y,z),p2=(x2,y2,z), color=camvtk.grey) )
-
-def calcEcenter(oe,a,b,cl,sln):
- pos = cam.Epos()
- if sln == 1:
- pos = oe.epos1
- if sln == 2:
- pos = oe.epos2
-
- cce = oe.ePoint(pos)
- cle = oe.oePoint(pos)
- print "solution at: ", pos
- print " cce=", cce
- print " cle=", cle
-
- xoffset = cl.x - cle.x
- print " xoffset= ", xoffset
- # we slide xoffset along the x-axis from ellcenter
- # to find the correct z-plane
- # line is: a + t*(b-a)
- # find t so that x-component is ellcenter.x + xoffset
- # a.x + t(b.x-a.x) = ellcenter.x + xoffset
- # t= (ellcenter.x + xoffset - a.x) / (b.x - a.x)
- tparam = (oe.center.x + xoffset - a.x) / (b.x - a.x)
- return a + tparam*(b-a)
-
-
-
-def main(ycoord=1.2, filename="test", theta=60, fi=45):
- myscreen = camvtk.VTKScreen()
- focal = cam.Point(2.17, 1, 0)
- r = 14
- theta = (float(theta)/360)*2*math.pi
-
-
- campos = cam.Point( r*math.sin(theta)*math.cos(fi), r*math.sin(theta)*math.sin(fi), r*math.cos(theta) )
- myscreen.camera.SetPosition(campos.x, campos.y, campos.z)
- myscreen.camera.SetFocalPoint(focal.x,focal.y, focal.z)
-
- #ycoord = 1.1
-
- # the two points that define the edge
- a=cam.Point( 3 , ycoord , 2.999999)
- b=cam.Point( -1, ycoord , 3)
-
- myscreen.addActor(camvtk.Point(center=(a.x,a.y,a.z), color=(1,0,1)));
- myscreen.addActor(camvtk.Point(center=(b.x,b.y,b.z), color=(1,0,1)));
- #c=cam.Point(0,0,0.3)
- myscreen.addActor( camvtk.Line(p1=(a.x,a.y,a.z),p2=(b.x,b.y,b.z)) )
- #t = cam.Triangle(a,b,c)
-
- cutter = cam.BullCutter(1,0.2)
-
- print cutter
- xar = camvtk.Arrow(color=camvtk.red, rotXYZ=(0,0,0))
- myscreen.addActor(xar)
- yar = camvtk.Arrow(color=camvtk.green, rotXYZ=(0,0,90))
- myscreen.addActor(yar)
- zar = camvtk.Arrow(color=camvtk.blue, rotXYZ=(0,-90,0))
- myscreen.addActor(zar)
-
- cl = cam.Point(2.1748, 1, 0)
- radius1=1
- radius2=0.25
-
-
- #tor.SetWireframe()
- #myscreen.addActor(tor)
-
- cyl = camvtk.Cylinder(center=(cl.x,cl.y,cl.z) , radius=radius1, height=2, color=(0,1,1),
- rotXYZ=(90,0,0), resolution=50 )
- #myscreen.addActor(cyl)
-
- cl_line = camvtk.Line( p1=(cl.x,cl.y,-100),p2=(cl.x,cl.y,+100), color=camvtk.red )
- myscreen.addActor(cl_line)
-
- cl_tube = camvtk.Tube(p1=(cl.x,cl.y,-100),p2=(cl.x,cl.y,+100),radius=radius1, color=camvtk.green)
- cl_tube.SetOpacity(0.1)
- myscreen.addActor(cl_tube)
-
- a_inf = a + (-100*(b-a))
- b_inf = a + (+100*(b-a))
-
- tube = camvtk.Tube(p1=(a_inf.x,a_inf.y,a_inf.z),p2=(b_inf.x,b_inf.y,b_inf.z),radius=0.05*radius2, color=camvtk.red)
- tube.SetOpacity(0.3)
- myscreen.addActor(tube)
-
- # cylindrical-cutter circle at z=0 plane
- #cir= camvtk.Circle(radius=radius1, center=(cl.x,cl.y,cl.z), color=camvtk.yellow)
- #myscreen.addActor(cir)
-
- #clp = camvtk.Point(center=(cl.x,cl.y,cl.z))
- #myscreen.addActor(clp)
-
- # short axis of ellipse = radius2
- # long axis of ellipse = radius2/sin(theta)
- # where theta is the slope of the line
- dx = b.x - a.x
- dz = b.z - a.z
- #print "dx=", dx
- #print "dz=", dz
- theta = math.atan(dz/dx) ## dx==0 is special case!! (i.e. vertical lines)
- print "theta=",theta
- a_axis = abs( radius2/math.sin(theta) )
- print "a=", a_axis
- # ellipse
- #a=2
- b_axis=radius2
- print "b= ", b_axis
-
-
- # slice the tube with a plane at z=0 and find the ellipse center
- # line is from Point a to b:
- # a + t*(b-a)
- # find t so that z-component is zero:
- # a.z + t( b.z -a.z) = 0
- # t= a.z / (b.z - a.z)
- # so point
- tparam = -a.z / (b.z - a.z) # NOTE horizontal lines are a special case!!
- ellcenter = a + tparam*(b-a)
- print "ellcenter (z=0?) =", ellcenter
- # center of the
- # ecen_tmp=cam.Point(ellcenter,a.y,0)
-
- #drawellipse(myscreen, ellcenter, a_axis, b_axis)
-
- oe = cam.Ellipse(ellcenter, a_axis, b_axis, radius1)
-
- #oe2 = cam.Ellipse(ellcenter, a_axis, b_axis, 0.05) # to locate text on the outside of the ellipse
-
-
- nmax=20
- #delta=0.05
- #td = 1
-
-
-
- t = camvtk.Text()
- t.SetPos( (myscreen.width-450, myscreen.height-30) )
- t.SetText("OpenCAMLib " + datetime.datetime.now().strftime("%Y-%m-%d %H:%M:%S"))
- myscreen.addActor( t)
-
- t2 = camvtk.Text()
- ytext = "Y: %3.3f" % (ycoord)
- t2.SetText(ytext)
- t2.SetPos( (50, myscreen.height-150) )
- myscreen.addActor( t2)
-
-
-
- w2if = vtk.vtkWindowToImageFilter()
- w2if.SetInput(myscreen.renWin)
- lwr = vtk.vtkPNGWriter()
- lwr.SetInput( w2if.GetOutput() )
-
- epos = cam.Epos()
- epos.setS(0,1)
-
-
-
- #p5 = oe.ePoint(epos5)
- #pt = oe2.oePoint(epos5)
- #print "before= ", epos5.s, " , ", epos5.t
-
- # RUN THE SOLVER!
- nsteps = cam.Ellipse.solver(oe, cl)
-
- print "solver done. back to python:"
- print "1st (s,t) solution=", oe.epos1
- print "2st (s,t) solution=", oe.epos2
-
- elc1 = calcEcenter(oe,a,b, cl,1)
- elc2 = calcEcenter(oe,a,b, cl,2)
- print "elc1=", elc1
- print "elc2=", elc2
- #exit()
-
- #elc2 = elc2
- #epos = oe.epos2
-
- fe1 = cam.Ellipse(elc1, a_axis, b_axis, radius1)
- fe2 = cam.Ellipse(elc2, a_axis, b_axis, radius1)
-
- # draw ellipse-centers
- myscreen.addActor( camvtk.Sphere(center=(elc1.x,elc1.y,elc1.z), radius=0.01, color=camvtk.lgreen) )
- myscreen.addActor( camvtk.Sphere(center=(elc2.x,elc2.y,elc2.z), radius=0.01, color=camvtk.pink) )
-
- # cc-points on the ellipse
- ccp1 = fe1.ePoint(oe.epos1)
- ccp2 = fe2.ePoint(oe.epos2)
- myscreen.addActor( camvtk.Sphere(center=(ccp1.x,ccp1.y,ccp1.z), radius=0.01, color=camvtk.lgreen) )
- myscreen.addActor( camvtk.Sphere(center=(ccp2.x,ccp2.y,ccp2.z), radius=0.01, color=camvtk.pink) )
-
- cl1 = fe1.oePoint(oe.epos1)
- cl2 = fe2.oePoint(oe.epos2)
-
- # circles
- myscreen.addActor( camvtk.Circle(radius=radius1, center=(cl1.x,cl1.y,cl1.z), color=camvtk.green) )
- myscreen.addActor( camvtk.Circle(radius=radius1, center=(cl2.x,cl2.y,cl2.z), color=camvtk.pink) )
-
- # torus
- tor = camvtk.Toroid(r1=radius1, r2=radius2, center=(cl1.x, cl1.y, cl1.z),rotXYZ=(0,0,0), color=camvtk.green)
- tor.SetOpacity(0.4)
- myscreen.addActor( tor)
- tor = camvtk.Toroid(r1=radius1, r2=radius2, center=(cl2.x, cl2.y, cl2.z),rotXYZ=(0,0,0), color=camvtk.pink)
- tor.SetOpacity(0.4)
- myscreen.addActor( tor)
-
- # line: ellipse-center to cc-point
- myscreen.addActor(camvtk.Line( p1=(elc1.x,elc1.y,elc1.z),p2=(ccp1.x,ccp1.y,ccp1.z), color=camvtk.cyan ))
- myscreen.addActor(camvtk.Line( p1=(elc2.x,elc2.y,elc2.z),p2=(ccp2.x,ccp2.y,ccp2.z), color=camvtk.cyan ))
-
- # line: cc-point to cl-point
- myscreen.addActor(camvtk.Line( p1=(cl1.x,cl1.y,cl1.z),p2=(ccp1.x,ccp1.y,ccp1.z), color=camvtk.yellow ))
- myscreen.addActor(camvtk.Line( p1=(cl2.x,cl2.y,cl2.z),p2=(ccp2.x,ccp2.y,ccp2.z), color=camvtk.yellow ))
-
- # true cl
- #clt = cc1.
-
- #fclpoint = camvtk.Sphere(center=(fclp.x,fclp.y,fclp.z), radius=0.01, color=camvtk.blue)
- #myscreen.addActor(fclpoint)
-
- # line from ellipse center to fcc
- # the offset normal
- #myscreen.addActor(camvtk.Line( p1=(fclp.x,fclp.y,fclp.z),p2=(fccp.x,fccp.y,fccp.z), color=camvtk.yellow ))
-
- drawellipse(myscreen, elc1, a_axis, b_axis)
- drawellipse(myscreen, elc2, a_axis, b_axis)
-
- #convtext = "%i" % (nsteps)
- #print (pt.x, pt.y, pt.z)
- #center=(pt.x, pt.y, pt.z)
- #tst = camvtk.Text3D( color=(1,1,1), center=(pt.x, pt.y, 0) ,
- #text=convtext, scale=0.02)
- #tst.SetCamera(myscreen.camera)
- #myscreen.addActor(tst)
-
- #colmax=11
- #colmin=4
- #nsteps = nsteps - colmin
- #colmax = colmax - colmin
- #convcolor=( float(nsteps*nsteps)/(colmax), float((colmax-nsteps))/colmax, 0 )
- #esphere = camvtk.Sphere(center=(p5.x,p5.y,0), radius=0.01, color=convcolor)
- #cce = oe.ePoint(epos)
- #cle = oe.oePoint(epos)
- #end_sphere = camvtk.Sphere(center=(cce.x,cce.y,0), radius=0.01, color=camvtk.green)
- #cl_sphere = camvtk.Sphere(center=(cle.x,cle.y,0), radius=0.01, color=camvtk.pink)
- #cl_sphere.SetOpacity(0.4)
-
- #clcir= camvtk.Circle(radius=radius1, center=(cle.x,cle.y,cle.z), color=camvtk.pink)
- #myscreen.addActor(clcir)
-
- #myscreen.addActor(esphere)
- #myscreen.addActor(end_sphere)
- #myscreen.addActor(cl_sphere)
- #myscreen.render()
-
- print "done."
- myscreen.render()
- lwr.SetFileName(filename)
-
- #raw_input("Press Enter to terminate")
- time.sleep(0.5)
- #lwr.Write()
- myscreen.iren.Start()
-
-
-if __name__ == "__main__":
- main()
- #myscreen.iren.Start()
- #raw_input("Press Enter to terminate")
-
-
diff -Nru opencamlib-11.10+git201801200005~ubuntu16.04.1/scripts/old/cutsim_test_tux_1.py opencamlib-11.10-1/scripts/old/cutsim_test_tux_1.py
--- opencamlib-11.10+git201801200005~ubuntu16.04.1/scripts/old/cutsim_test_tux_1.py 2018-01-20 00:05:22.000000000 +0000
+++ opencamlib-11.10-1/scripts/old/cutsim_test_tux_1.py 1970-01-01 00:00:00.000000000 +0000
@@ -1,248 +0,0 @@
-import ocl
-import pyocl
-import camvtk
-import time
-import datetime
-import vtk
-
-
-
-def main(filename="frame/f.png"):
- print ocl.revision()
-
- myscreen = camvtk.VTKScreen()
- myscreen.camera.SetPosition(-15, -8, 15)
- myscreen.camera.SetFocalPoint(5,5, 0)
- # axis arrows
- camvtk.drawArrows(myscreen,center=(-1,-1,0))
-
-
- # screenshot writer
- w2if = vtk.vtkWindowToImageFilter()
- w2if.SetInput(myscreen.renWin)
- lwr = vtk.vtkPNGWriter()
- lwr.SetInput( w2if.GetOutput() )
-
-
-
- c = ocl.CylCutter(1,4) # cutter
- c.length = 3
- print "cutter length=", c.length
-
- # generate CL-points
- stl = camvtk.STLSurf("../stl/gnu_tux_mod.stl")
- polydata = stl.src.GetOutput()
- s = ocl.STLSurf()
- camvtk.vtkPolyData2OCLSTL(polydata, s)
- print "STL surface read,", s.size(), "triangles"
- print s.getBounds()
- #exit()
- minx=0
- dx=0.1
- maxx=9
- miny=0
- dy=0.4
- maxy=12
- z=-17
- # this generates a list of CL-points in a grid
- clpoints = pyocl.CLPointGridZigZag(minx,dx,maxx,miny,dy,maxy,z)
- print "generated grid with", len(clpoints)," CL-points"
- # batchdropcutter
- bdc = ocl.BatchDropCutter()
- bdc.setSTL(s)
- bdc.setCutter(c)
- for p in clpoints:
- bdc.appendPoint(p)
- t_before = time.time()
- print "threads=",bdc.getThreads()
- bdc.run()
- t_after = time.time()
- calctime = t_after-t_before
- print " done in ", calctime," s"
- clpoints = bdc.getCLPoints()
-
- # filter
- print "filtering. before filter we have", len(clpoints),"cl-points"
- t_before = time.time()
- f = ocl.LineCLFilter()
- f.setTolerance(0.001)
- for p in clpoints:
- f.addCLPoint(p)
- f.run()
- clpts = f.getCLPoints()
- calctime = time.time()-t_before
- print "after filtering we have", len(clpts),"cl-points"
- print " done in ", calctime," s"
-
- #exit()
-
- # stupid init code
- ocode=ocl.Ocode()
- tree_maxdepth=10
- ocode.set_depth(tree_maxdepth) # depth and scale set here.
- ocode.set_scale(10)
-
- # cube
- stockvol = ocl.BoxOCTVolume()
- stockvol.corner = ocl.Point(0,0,-0.5)
- stockvol.v1 = ocl.Point(9,0,0)
- stockvol.v2 = ocl.Point(0,12,0)
- stockvol.v3 = ocl.Point(0,0,3.5)
- stockvol.calcBB()
-
- t_before = time.time()
- stock = ocl.LinOCT()
- stock.init(0)
- stock.build( stockvol )
- calctime = time.time()-t_before
- print " stock built in ", calctime," s, stock.size()=",stock.size()
-
- # draw initial octree
- #tlist = pyocl.octree2trilist(stock)
- #surf = camvtk.STLSurf(triangleList=tlist)
- #myscreen.addActor(surf)
-
- # draw initial cutter
- #startp = ocl.Point(0,0,0)
- #cyl = camvtk.Cylinder(center=(startp.x,startp.y,startp.z), radius=c.radius,
- # height=c.length,
- # rotXYZ=(90,0,0), color=camvtk.grey)
- #cyl.SetWireframe()
- #myscreen.addActor(cyl)
-
- timetext = camvtk.Text()
- timetext.SetPos( (myscreen.width-300, myscreen.height-30) )
- myscreen.addActor( timetext)
-
- ocltext = camvtk.Text()
- ocltext.SetPos( (myscreen.width-300, myscreen.height-60) )
- myscreen.addActor( ocltext)
- ocltext.SetText("OpenCAMLib")
-
- octtext = camvtk.Text()
- octtext.SetPos( (myscreen.width-300, myscreen.height-90) )
- myscreen.addActor( octtext)
- octtext.SetText("Octree cutting-simulation")
-
- infotext = camvtk.Text()
- infotext.SetPos( (myscreen.width-300, myscreen.height-180) )
- myscreen.addActor( infotext)
-
-
- Nmoves = len(clpts)
- print Nmoves,"CL-points to process"
- for n in xrange(0,Nmoves-1):
- timetext.SetText(datetime.datetime.now().strftime("%Y-%m-%d %H:%M:%S"))
-
- #if n.
+ * GNU Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * along with this program. If not, see .
*/
#include
@@ -62,6 +64,8 @@
AdaptiveWaterline::~AdaptiveWaterline() {
std::cout << "~AdaptiveWaterline(): subOp.size()= " << subOp.size() <<"\n";
+ delete subOp[1];
+ delete subOp[0];
subOp.clear();
}
diff -Nru opencamlib-11.10+git201801200005~ubuntu16.04.1/src/algo/adaptivewaterline.hpp opencamlib-11.10-1/src/algo/adaptivewaterline.hpp
--- opencamlib-11.10+git201801200005~ubuntu16.04.1/src/algo/adaptivewaterline.hpp 2018-01-20 00:05:22.000000000 +0000
+++ opencamlib-11.10-1/src/algo/adaptivewaterline.hpp 2020-06-14 12:13:19.000000000 +0000
@@ -1,20 +1,22 @@
-/*
- * Copyright 2010 Anders Wallin (anders.e.e.wallin "at" gmail.com)
+/* $Id$
+ *
+ * Copyright (c) 2010 Anders Wallin (anders.e.e.wallin "at" gmail.com).
*
- * This file is part of OpenCAMlib.
- *
- * OpenCAMlib is free software: you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation, either version 3 of the License, or
+ * This file is part of OpenCAMlib
+ * (see https://github.com/aewallin/opencamlib).
+ *
+ * This program 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.
- *
- * OpenCAMlib is distributed in the hope that it will be useful,
+ *
+ * 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 General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with OpenCAMlib. If not, see .
+ * GNU Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * along with this program. If not, see .
*/
#ifndef ADAPTIVEWATERLINE_HPP
diff -Nru opencamlib-11.10+git201801200005~ubuntu16.04.1/src/algo/adaptivewaterline_py.hpp opencamlib-11.10-1/src/algo/adaptivewaterline_py.hpp
--- opencamlib-11.10+git201801200005~ubuntu16.04.1/src/algo/adaptivewaterline_py.hpp 2018-01-20 00:05:22.000000000 +0000
+++ opencamlib-11.10-1/src/algo/adaptivewaterline_py.hpp 1970-01-01 00:00:00.000000000 +0000
@@ -1,76 +0,0 @@
-/* $Id$
- *
- * Copyright 2010 Anders Wallin (anders.e.e.wallin "at" gmail.com)
- *
- * This file is part of OpenCAMlib.
- *
- * OpenCAMlib is free software: you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation, either version 3 of the License, or
- * (at your option) any later version.
- *
- * OpenCAMlib 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 General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with OpenCAMlib. If not, see .
-*/
-
-#ifndef ADAPTIVEWATERLINE_PY_H
-#define ADAPTIVEWATERLINE_PY_H
-
-#include "adaptivewaterline.hpp"
-#include "fiber_py.hpp"
-
-namespace ocl
-{
-
-/// \brief python wrapper for AdaptiveWaterline
-class AdaptiveWaterline_py : public AdaptiveWaterline {
- public:
- AdaptiveWaterline_py() : AdaptiveWaterline() {}
- ~AdaptiveWaterline_py() {
- std::cout << "~AdaptiveWaterline_py()\n";
- }
-
- /// return loop as a list of lists to python
- boost::python::list py_getLoops() const {
- boost::python::list loop_list;
- BOOST_FOREACH( std::vector loop, this->loops ) {
- boost::python::list point_list;
- BOOST_FOREACH( Point p, loop ) {
- point_list.append( p );
- }
- loop_list.append(point_list);
- }
- return loop_list;
- }
- /// return a list of xfibers to python
- boost::python::list getXFibers() const {
- boost::python::list flist;
- BOOST_FOREACH( Fiber f, xfibers ) {
- if (!f.empty()) {
- Fiber_py f2(f);
- flist.append(f2);
- }
- }
- return flist;
- }
- /// return a list of yfibers to python
- boost::python::list getYFibers() const {
- boost::python::list flist;
- BOOST_FOREACH( Fiber f, yfibers ) {
- if (!f.empty()){
- Fiber_py f2(f);
- flist.append(f2);
- }
- }
- return flist;
- }
-};
-
-} // end namespace
-
-#endif
diff -Nru opencamlib-11.10+git201801200005~ubuntu16.04.1/src/algo/batchpushcutter.cpp opencamlib-11.10-1/src/algo/batchpushcutter.cpp
--- opencamlib-11.10+git201801200005~ubuntu16.04.1/src/algo/batchpushcutter.cpp 2018-01-20 00:05:22.000000000 +0000
+++ opencamlib-11.10-1/src/algo/batchpushcutter.cpp 2020-06-14 12:13:19.000000000 +0000
@@ -1,20 +1,22 @@
-/*
- * Copyright 2010-2011 Anders Wallin (anders.e.e.wallin "at" gmail.com)
+/* $Id$
+ *
+ * Copyright (c) 2010-2011 Anders Wallin (anders.e.e.wallin "at" gmail.com).
*
- * This file is part of OpenCAMlib.
- *
- * OpenCAMlib is free software: you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation, either version 3 of the License, or
+ * This file is part of OpenCAMlib
+ * (see https://github.com/aewallin/opencamlib).
+ *
+ * This program 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.
- *
- * OpenCAMlib is distributed in the hope that it will be useful,
+ *
+ * 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 General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with OpenCAMlib. If not, see .
+ * GNU Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * along with this program. If not, see .
*/
#include
@@ -53,19 +55,19 @@
void BatchPushCutter::setSTL(const STLSurf &s) {
surf = &s;
- std::cout << "BPC::setSTL() Building kd-tree... bucketSize=" << bucketSize << "..";
+ // std::cout << "BPC::setSTL() Building kd-tree... bucketSize=" << bucketSize << "..";
root->setBucketSize( bucketSize );
if (x_direction)
root->setYZDimensions(); // we search for triangles in the XY plane, don't care about Z-coordinate
else if (y_direction)
root->setXZDimensions();
else {
- std::cout << " ERROR: setXDirection() or setYDirection() must be called before setSTL() \n";
+ std::cerr << "ERROR: setXDirection() or setYDirection() must be called before setSTL() \n";
assert(0);
}
- std::cout << "BPC::setSTL() root->build()...";
+ // std::cout << "BPC::setSTL() root->build()...";
root->build(s.tris);
- std::cout << "done.\n";
+ // std::cout << "done.\n";
}
void BatchPushCutter::appendFiber(Fiber& f) {
@@ -79,8 +81,8 @@
/// very simple batch push-cutter
/// each fiber is tested against all triangles of surface
void BatchPushCutter::pushCutter1() {
- std::cout << "BatchPushCutter1 with " << fibers->size() <<
- " fibers and " << surf->tris.size() << " triangles..." << std::endl;
+ // std::cout << "BatchPushCutter1 with " << fibers->size() <<
+ // " fibers and " << surf->tris.size() << " triangles..." << std::endl;
nCalls = 0;
boost::progress_display show_progress( fibers->size() );
BOOST_FOREACH(Fiber& f, *fibers) {
@@ -92,15 +94,15 @@
}
++show_progress;
}
- std::cout << "BatchPushCutter done." << std::endl;
+ // std::cout << "BatchPushCutter done." << std::endl;
return;
}
/// push-cutter which uses KDNode2 kd-tree search to find triangles
/// overlapping with the cutter.
void BatchPushCutter::pushCutter2() {
- std::cout << "BatchPushCutter2 with " << fibers->size() <<
- " fibers and " << surf->tris.size() << " triangles..." << std::endl;
+ // std::cout << "BatchPushCutter2 with " << fibers->size() <<
+ // " fibers and " << surf->tris.size() << " triangles..." << std::endl;
nCalls = 0;
std::list* overlap_triangles;
boost::progress_display show_progress( fibers->size() );
@@ -130,31 +132,33 @@
delete( overlap_triangles );
++show_progress;
}
- std::cout << "BatchPushCutter2 done." << std::endl;
+ // std::cout << "BatchPushCutter2 done." << std::endl;
return;
}
/// use kd-tree search to find overlapping triangles
/// use OpenMP for multi-threading
void BatchPushCutter::pushCutter3() {
- std::cout << "BatchPushCutter3 with " << fibers->size() <<
- " fibers and " << surf->tris.size() << " triangles." << std::endl;
- std::cout << " cutter = " << cutter->str() << "\n";
+ // std::cout << "BatchPushCutter3 with " << fibers->size() <<
+ // " fibers and " << surf->tris.size() << " triangles." << std::endl;
+ // std::cout << " cutter = " << cutter->str() << "\n";
nCalls = 0;
boost::progress_display show_progress( fibers->size() );
#ifdef _OPENMP
+ std::cout << "OpenMP is enabled";
omp_set_num_threads(nthreads);
//omp_set_nested(1);
#endif
- unsigned int Nmax = fibers->size(); // the number of fibers to process
std::list::iterator it,it_end; // for looping over found triabgles
Interval* i;
std::list* tris;
std::vector& fiberr = *fibers;
#ifdef _WIN32 // OpenMP version 2 of VS2013 OpenMP need signed loop variable
int n; // loop variable
+ int Nmax = fibers->size(); // the number of fibers to process
#else
unsigned int n; // loop variable
+ unsigned int Nmax = fibers->size(); // the number of fibers to process
#endif
unsigned int calls=0;
@@ -194,7 +198,7 @@
} // OpenMP parallel region ends here
this->nCalls = calls;
- std::cout << "\nBatchPushCutter3 done." << std::endl;
+ // std::cout << "\nBatchPushCutter3 done." << std::endl;
return;
}
diff -Nru opencamlib-11.10+git201801200005~ubuntu16.04.1/src/algo/batchpushcutter.hpp opencamlib-11.10-1/src/algo/batchpushcutter.hpp
--- opencamlib-11.10+git201801200005~ubuntu16.04.1/src/algo/batchpushcutter.hpp 2018-01-20 00:05:22.000000000 +0000
+++ opencamlib-11.10-1/src/algo/batchpushcutter.hpp 2020-06-14 12:13:19.000000000 +0000
@@ -1,21 +1,22 @@
/* $Id$
*
- * Copyright 2010 Anders Wallin (anders.e.e.wallin "at" gmail.com)
+ * Copyright (c) 2010 Anders Wallin (anders.e.e.wallin "at" gmail.com).
*
- * This file is part of OpenCAMlib.
- *
- * OpenCAMlib is free software: you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation, either version 3 of the License, or
+ * This file is part of OpenCAMlib
+ * (see https://github.com/aewallin/opencamlib).
+ *
+ * This program 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.
- *
- * OpenCAMlib is distributed in the hope that it will be useful,
+ *
+ * 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 General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with OpenCAMlib. If not, see .
+ * GNU Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * along with this program. If not, see .
*/
#ifndef BPC_H
diff -Nru opencamlib-11.10+git201801200005~ubuntu16.04.1/src/algo/batchpushcutter_py.hpp opencamlib-11.10-1/src/algo/batchpushcutter_py.hpp
--- opencamlib-11.10+git201801200005~ubuntu16.04.1/src/algo/batchpushcutter_py.hpp 2018-01-20 00:05:22.000000000 +0000
+++ opencamlib-11.10-1/src/algo/batchpushcutter_py.hpp 1970-01-01 00:00:00.000000000 +0000
@@ -1,97 +0,0 @@
-/* $Id$
- *
- * Copyright 2010 Anders Wallin (anders.e.e.wallin "at" gmail.com)
- *
- * This file is part of OpenCAMlib.
- *
- * OpenCAMlib is free software: you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation, either version 3 of the License, or
- * (at your option) any later version.
- *
- * OpenCAMlib 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 General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with OpenCAMlib. If not, see .
-*/
-
-#ifndef BPC_PY_H
-#define BPC_PY_H
-
-#include
-
-#include "batchpushcutter.hpp"
-
-#include "fiber_py.hpp"
-
-namespace ocl
-{
-/// \brief python wrapper for batchpushcutter
-class BatchPushCutter_py : public BatchPushCutter {
- public:
- BatchPushCutter_py() : BatchPushCutter() {}
- /// return CL-points to Python
- boost::python::list getCLPoints() const {
- boost::python::list plist;
- BOOST_FOREACH(Fiber f, *fibers) {
- BOOST_FOREACH( Interval i, f.ints ) {
- if ( !i.empty() ) {
- Point tmp = f.point(i.lower);
- CLPoint p1 = CLPoint( tmp.x, tmp.y, tmp.z );
- p1.cc = new CCPoint(i.lower_cc);
- tmp = f.point(i.upper);
- CLPoint p2 = CLPoint( tmp.x, tmp.y, tmp.z );
- p2.cc = new CCPoint(i.upper_cc);
- plist.append(p1);
- plist.append(p2);
- }
- }
-
- }
- return plist;
- };
- /// return triangles under cutter to Python. Not for CAM-algorithms,
- /// more for visualization and demonstration.
- boost::python::list getOverlapTriangles(Fiber& f) {
- boost::python::list trilist;
- std::list *overlap_triangles = new std::list();
- //int plane = 3; // XY-plane
- //Bbox bb; //FIXME
- //KDNode2::search_kdtree( overlap_triangles, bb, root, plane);
- CLPoint cl;
- if (x_direction) {
- cl.x = 0;
- cl.y = f.p1.y;
- cl.z = f.p1.z;
- } else if (y_direction) {
- cl.x = f.p1.x;
- cl.y = 0;
- cl.z = f.p1.z;
- } else {
- assert(0);
- }
- overlap_triangles = root->search_cutter_overlap(cutter, &cl);
-
- BOOST_FOREACH(Triangle t, *overlap_triangles) {
- trilist.append(t);
- }
- delete overlap_triangles;
- return trilist;
- };
- /// return list of Fibers to python
- boost::python::list getFibers_py() const {
- boost::python::list flist;
- BOOST_FOREACH(Fiber f, *fibers) {
- flist.append( Fiber_py(f) );
- }
- return flist;
- };
-
-};
-
-} // end namespace
-
-#endif
diff -Nru opencamlib-11.10+git201801200005~ubuntu16.04.1/src/algo/clsurface.hpp opencamlib-11.10-1/src/algo/clsurface.hpp
--- opencamlib-11.10+git201801200005~ubuntu16.04.1/src/algo/clsurface.hpp 2018-01-20 00:05:22.000000000 +0000
+++ opencamlib-11.10-1/src/algo/clsurface.hpp 2020-06-14 12:13:19.000000000 +0000
@@ -1,20 +1,22 @@
-/*
- * Copyright 2010-2011 Anders Wallin (anders.e.e.wallin "at" gmail.com)
+/* $Id$
+ *
+ * Copyright (c) 2010-2011 Anders Wallin (anders.e.e.wallin "at" gmail.com).
*
- * This file is part of OpenCAMlib.
- *
- * OpenCAMlib is free software: you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation, either version 3 of the License, or
+ * This file is part of OpenCAMlib
+ * (see https://github.com/aewallin/opencamlib).
+ *
+ * This program 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.
- *
- * OpenCAMlib is distributed in the hope that it will be useful,
+ *
+ * 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 General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with OpenCAMlib. If not, see .
+ * GNU Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * along with this program. If not, see .
*/
#ifndef CLSURFACE_H
#define CLSURFACE_H
diff -Nru opencamlib-11.10+git201801200005~ubuntu16.04.1/src/algo/fiber.cpp opencamlib-11.10-1/src/algo/fiber.cpp
--- opencamlib-11.10+git201801200005~ubuntu16.04.1/src/algo/fiber.cpp 2018-01-20 00:05:22.000000000 +0000
+++ opencamlib-11.10-1/src/algo/fiber.cpp 2020-06-14 12:13:19.000000000 +0000
@@ -1,20 +1,22 @@
-/*
- * Copyright 2010-2011 Anders Wallin (anders.e.e.wallin "at" gmail.com)
+/* $Id$
+ *
+ * Copyright (c) 2010-2011 Anders Wallin (anders.e.e.wallin "at" gmail.com).
*
- * This file is part of OpenCAMlib.
- *
- * OpenCAMlib is free software: you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation, either version 3 of the License, or
+ * This file is part of OpenCAMlib
+ * (see https://github.com/aewallin/opencamlib).
+ *
+ * This program 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.
- *
- * OpenCAMlib is distributed in the hope that it will be useful,
+ *
+ * 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 General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with OpenCAMlib. If not, see .
+ * GNU Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * along with this program. If not, see .
*/
#include
diff -Nru opencamlib-11.10+git201801200005~ubuntu16.04.1/src/algo/fiber.hpp opencamlib-11.10-1/src/algo/fiber.hpp
--- opencamlib-11.10+git201801200005~ubuntu16.04.1/src/algo/fiber.hpp 2018-01-20 00:05:22.000000000 +0000
+++ opencamlib-11.10-1/src/algo/fiber.hpp 2020-06-14 12:13:19.000000000 +0000
@@ -1,20 +1,22 @@
-/*
- * Copyright 2010-2011 Anders Wallin (anders.e.e.wallin "at" gmail.com)
+/* $Id$
+ *
+ * Copyright (c) 2010-2011 Anders Wallin (anders.e.e.wallin "at" gmail.com).
*
- * This file is part of OpenCAMlib.
- *
- * OpenCAMlib is free software: you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation, either version 3 of the License, or
+ * This file is part of OpenCAMlib
+ * (see https://github.com/aewallin/opencamlib).
+ *
+ * This program 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.
- *
- * OpenCAMlib is distributed in the hope that it will be useful,
+ *
+ * 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 General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with OpenCAMlib. If not, see .
+ * GNU Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * along with this program. If not, see .
*/
#ifndef FIBER_HPP
#define FIBER_HPP
diff -Nru opencamlib-11.10+git201801200005~ubuntu16.04.1/src/algo/fiberpushcutter.cpp opencamlib-11.10-1/src/algo/fiberpushcutter.cpp
--- opencamlib-11.10+git201801200005~ubuntu16.04.1/src/algo/fiberpushcutter.cpp 2018-01-20 00:05:22.000000000 +0000
+++ opencamlib-11.10-1/src/algo/fiberpushcutter.cpp 2020-06-14 12:13:19.000000000 +0000
@@ -1,21 +1,22 @@
-/* $Id: $
+/* $Id$
*
- * Copyright 2010 Anders Wallin (anders.e.e.wallin "at" gmail.com)
+ * Copyright (c) 2010 Anders Wallin (anders.e.e.wallin "at" gmail.com).
*
- * This file is part of OpenCAMlib.
- *
- * OpenCAMlib is free software: you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation, either version 3 of the License, or
+ * This file is part of OpenCAMlib
+ * (see https://github.com/aewallin/opencamlib).
+ *
+ * This program 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.
- *
- * OpenCAMlib is distributed in the hope that it will be useful,
+ *
+ * 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 General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with OpenCAMlib. If not, see .
+ * GNU Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * along with this program. If not, see .
*/
#include
diff -Nru opencamlib-11.10+git201801200005~ubuntu16.04.1/src/algo/fiberpushcutter.hpp opencamlib-11.10-1/src/algo/fiberpushcutter.hpp
--- opencamlib-11.10+git201801200005~ubuntu16.04.1/src/algo/fiberpushcutter.hpp 2018-01-20 00:05:22.000000000 +0000
+++ opencamlib-11.10-1/src/algo/fiberpushcutter.hpp 2020-06-14 12:13:19.000000000 +0000
@@ -1,21 +1,22 @@
-/* $Id: $
+/* $Id$
*
- * Copyright 2010 Anders Wallin (anders.e.e.wallin "at" gmail.com)
+ * Copyright (c) 2010 Anders Wallin (anders.e.e.wallin "at" gmail.com).
*
- * This file is part of OpenCAMlib.
- *
- * OpenCAMlib is free software: you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation, either version 3 of the License, or
+ * This file is part of OpenCAMlib
+ * (see https://github.com/aewallin/opencamlib).
+ *
+ * This program 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.
- *
- * OpenCAMlib is distributed in the hope that it will be useful,
+ *
+ * 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 General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with OpenCAMlib. If not, see .
+ * GNU Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * along with this program. If not, see .
*/
#ifndef FIBERPUSHCUTTER_H
diff -Nru opencamlib-11.10+git201801200005~ubuntu16.04.1/src/algo/fiber_py.hpp opencamlib-11.10-1/src/algo/fiber_py.hpp
--- opencamlib-11.10+git201801200005~ubuntu16.04.1/src/algo/fiber_py.hpp 2018-01-20 00:05:22.000000000 +0000
+++ opencamlib-11.10-1/src/algo/fiber_py.hpp 1970-01-01 00:00:00.000000000 +0000
@@ -1,51 +0,0 @@
-/* $Id$
- *
- * Copyright 2010 Anders Wallin (anders.e.e.wallin "at" gmail.com)
- *
- * This file is part of OpenCAMlib.
- *
- * OpenCAMlib is free software: you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation, either version 3 of the License, or
- * (at your option) any later version.
- *
- * OpenCAMlib 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 General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with OpenCAMlib. If not, see .
-*/
-#ifndef FIBER_PY_H
-#define FIBER_PY_H
-
-#include
-#include
-
-#include "fiber.hpp"
-
-namespace ocl
-{
-
-/// python wrapper for Fiber
-class Fiber_py : public Fiber {
- public:
- Fiber_py() : Fiber () {};
- /// construct p1-p2 fiber
- Fiber_py(const Point &p1, const Point &p2) : Fiber(p1, p2) {};
- /// copy constructor
- Fiber_py(const Fiber& f) : Fiber(f) {};
- /// return a list of intervals to python
- boost::python::list getInts() const {
- boost::python::list l;
- BOOST_FOREACH( Interval i, ints) {
- l.append( i );
- }
- return l;
- };
-};
-
-} // end namespace
-#endif
-// end file fiber_py.h
diff -Nru opencamlib-11.10+git201801200005~ubuntu16.04.1/src/algo/interval.cpp opencamlib-11.10-1/src/algo/interval.cpp
--- opencamlib-11.10+git201801200005~ubuntu16.04.1/src/algo/interval.cpp 2018-01-20 00:05:22.000000000 +0000
+++ opencamlib-11.10-1/src/algo/interval.cpp 2020-06-14 12:13:19.000000000 +0000
@@ -1,20 +1,22 @@
-/*
- * Copyright 2010-2011 Anders Wallin (anders.e.e.wallin "at" gmail.com)
+/* $Id$
+ *
+ * Copyright (c) 2010-2011 Anders Wallin (anders.e.e.wallin "at" gmail.com).
*
- * This file is part of OpenCAMlib.
- *
- * OpenCAMlib is free software: you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation, either version 3 of the License, or
+ * This file is part of OpenCAMlib
+ * (see https://github.com/aewallin/opencamlib).
+ *
+ * This program 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.
- *
- * OpenCAMlib is distributed in the hope that it will be useful,
+ *
+ * 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 General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with OpenCAMlib. If not, see .
+ * GNU Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * along with this program. If not, see .
*/
#include
diff -Nru opencamlib-11.10+git201801200005~ubuntu16.04.1/src/algo/interval.hpp opencamlib-11.10-1/src/algo/interval.hpp
--- opencamlib-11.10+git201801200005~ubuntu16.04.1/src/algo/interval.hpp 2018-01-20 00:05:22.000000000 +0000
+++ opencamlib-11.10-1/src/algo/interval.hpp 2020-06-14 12:13:19.000000000 +0000
@@ -1,20 +1,22 @@
-/*
- * Copyright 2010-2011 Anders Wallin (anders.e.e.wallin "at" gmail.com)
+/* $Id$
+ *
+ * Copyright (c) 2010-2011 Anders Wallin (anders.e.e.wallin "at" gmail.com).
*
- * This file is part of OpenCAMlib.
- *
- * OpenCAMlib is free software: you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation, either version 3 of the License, or
+ * This file is part of OpenCAMlib
+ * (see https://github.com/aewallin/opencamlib).
+ *
+ * This program 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.
- *
- * OpenCAMlib is distributed in the hope that it will be useful,
+ *
+ * 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 General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with OpenCAMlib. If not, see .
+ * GNU Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * along with this program. If not, see .
*/
#ifndef INTERVAL_HPP
#define INTERVAL_HPP
diff -Nru opencamlib-11.10+git201801200005~ubuntu16.04.1/src/algo/operation.hpp opencamlib-11.10-1/src/algo/operation.hpp
--- opencamlib-11.10+git201801200005~ubuntu16.04.1/src/algo/operation.hpp 2018-01-20 00:05:22.000000000 +0000
+++ opencamlib-11.10-1/src/algo/operation.hpp 2020-06-14 12:13:19.000000000 +0000
@@ -1,21 +1,22 @@
/* $Id$
*
- * Copyright 2010 Anders Wallin (anders.e.e.wallin "at" gmail.com)
+ * Copyright (c) 2010 Anders Wallin (anders.e.e.wallin "at" gmail.com).
*
- * This file is part of OpenCAMlib.
- *
- * OpenCAMlib is free software: you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation, either version 3 of the License, or
+ * This file is part of OpenCAMlib
+ * (see https://github.com/aewallin/opencamlib).
+ *
+ * This program 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.
- *
- * OpenCAMlib is distributed in the hope that it will be useful,
+ *
+ * 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 General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with OpenCAMlib. If not, see .
+ * GNU Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * along with this program. If not, see .
*/
#ifndef OP_H
diff -Nru opencamlib-11.10+git201801200005~ubuntu16.04.1/src/algo/simple_weave.cpp opencamlib-11.10-1/src/algo/simple_weave.cpp
--- opencamlib-11.10+git201801200005~ubuntu16.04.1/src/algo/simple_weave.cpp 2018-01-20 00:05:22.000000000 +0000
+++ opencamlib-11.10-1/src/algo/simple_weave.cpp 2020-06-14 12:13:19.000000000 +0000
@@ -1,20 +1,22 @@
-/*
- * Copyright 2010-2011 Anders Wallin (anders.e.e.wallin "at" gmail.com)
+/* $Id$
+ *
+ * Copyright (c) 2010-2011 Anders Wallin (anders.e.e.wallin "at" gmail.com).
*
- * This file is part of OpenCAMlib.
- *
- * OpenCAMlib is free software: you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation, either version 3 of the License, or
+ * This file is part of OpenCAMlib
+ * (see https://github.com/aewallin/opencamlib).
+ *
+ * This program 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.
- *
- * OpenCAMlib is distributed in the hope that it will be useful,
+ *
+ * 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 General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with OpenCAMlib. If not, see .
+ * GNU Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * along with this program. If not, see .
*/
#include
@@ -60,7 +62,7 @@
// if this connects points that are already connected, then remove old edge and
// provide this "via" connection
//int n_xfiber=0;
- std::cout << " SimpleWeave::build()... \n";
+ // std::cout << " SimpleWeave::build()... \n";
BOOST_FOREACH( Fiber& xf, xfibers) {
assert( !xf.empty() ); // no empty fibers please
BOOST_FOREACH( Interval& xi, xf.ints ) {
@@ -177,9 +179,9 @@
Edge ye_lu_next, ye_lu_prev ;
Edge ye_ul_next, ye_ul_prev ;
Edge ye_lu, ye_ul;
-
- bool y_lu_edge = g.has_edge(y_l,y_u); // flag indicating existing y_l - y_u edge
- // the case where y_l and y_u are alread already connected.
+
+ bool y_lu_edge = g.has_edge(y_l,y_u); // flag indicating existing y_l - y_u edge
+ // the case where y_l and y_u are already connected.
if ( y_lu_edge ) {
assert( g.has_edge( y_u, y_l ) ); // twin must also exist
diff -Nru opencamlib-11.10+git201801200005~ubuntu16.04.1/src/algo/simple_weave.hpp opencamlib-11.10-1/src/algo/simple_weave.hpp
--- opencamlib-11.10+git201801200005~ubuntu16.04.1/src/algo/simple_weave.hpp 2018-01-20 00:05:22.000000000 +0000
+++ opencamlib-11.10-1/src/algo/simple_weave.hpp 2020-06-14 12:13:19.000000000 +0000
@@ -1,20 +1,22 @@
-/*
- * Copyright 2010-2011 Anders Wallin (anders.e.e.wallin "at" gmail.com)
+/* $Id$
+ *
+ * Copyright (c) 2010-2011 Anders Wallin (anders.e.e.wallin "at" gmail.com).
*
- * This file is part of OpenCAMlib.
- *
- * OpenCAMlib is free software: you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation, either version 3 of the License, or
+ * This file is part of OpenCAMlib
+ * (see https://github.com/aewallin/opencamlib).
+ *
+ * This program 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.
- *
- * OpenCAMlib is distributed in the hope that it will be useful,
+ *
+ * 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 General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with OpenCAMlib. If not, see .
+ * GNU Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * along with this program. If not, see .
*/
#ifndef SIMPLE_WEAVE_HPP
#define SIMPLE_WEAVE_HPP
diff -Nru opencamlib-11.10+git201801200005~ubuntu16.04.1/src/algo/smart_weave.cpp opencamlib-11.10-1/src/algo/smart_weave.cpp
--- opencamlib-11.10+git201801200005~ubuntu16.04.1/src/algo/smart_weave.cpp 2018-01-20 00:05:22.000000000 +0000
+++ opencamlib-11.10-1/src/algo/smart_weave.cpp 2020-06-14 12:13:19.000000000 +0000
@@ -1,20 +1,22 @@
-/*
- * Copyright 2010-2011 Anders Wallin (anders.e.e.wallin "at" gmail.com)
+/* $Id$
+ *
+ * Copyright (c) 2010-2011 Anders Wallin (anders.e.e.wallin "at" gmail.com).
*
- * This file is part of OpenCAMlib.
- *
- * OpenCAMlib is free software: you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation, either version 3 of the License, or
+ * This file is part of OpenCAMlib
+ * (see https://github.com/aewallin/opencamlib).
+ *
+ * This program 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.
- *
- * OpenCAMlib is distributed in the hope that it will be useful,
+ *
+ * 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 General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with OpenCAMlib. If not, see .
+ * GNU Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * along with this program. If not, see .
*/
#include
diff -Nru opencamlib-11.10+git201801200005~ubuntu16.04.1/src/algo/smart_weave.hpp opencamlib-11.10-1/src/algo/smart_weave.hpp
--- opencamlib-11.10+git201801200005~ubuntu16.04.1/src/algo/smart_weave.hpp 2018-01-20 00:05:22.000000000 +0000
+++ opencamlib-11.10-1/src/algo/smart_weave.hpp 2020-06-14 12:13:19.000000000 +0000
@@ -1,20 +1,22 @@
-/*
- * Copyright 2010-2011 Anders Wallin (anders.e.e.wallin "at" gmail.com)
+/* $Id$
+ *
+ * Copyright (c) 2010-2011 Anders Wallin (anders.e.e.wallin "at" gmail.com).
*
- * This file is part of OpenCAMlib.
- *
- * OpenCAMlib is free software: you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation, either version 3 of the License, or
+ * This file is part of OpenCAMlib
+ * (see https://github.com/aewallin/opencamlib).
+ *
+ * This program 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.
- *
- * OpenCAMlib is distributed in the hope that it will be useful,
+ *
+ * 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 General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with OpenCAMlib. If not, see .
+ * GNU Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * along with this program. If not, see .
*/
#ifndef SMART_WEAVE_HPP
#define SMART_WEAVE_HPP
diff -Nru opencamlib-11.10+git201801200005~ubuntu16.04.1/src/algo/tsp.hpp opencamlib-11.10-1/src/algo/tsp.hpp
--- opencamlib-11.10+git201801200005~ubuntu16.04.1/src/algo/tsp.hpp 2018-01-20 00:05:22.000000000 +0000
+++ opencamlib-11.10-1/src/algo/tsp.hpp 2020-06-14 12:13:19.000000000 +0000
@@ -1,23 +1,23 @@
/* $Id$
*
- * Copyright 2010-2011 Anders Wallin (anders.e.e.wallin "at" gmail.com)
+ * Copyright (c) 2010-2011 Anders Wallin (anders.e.e.wallin "at" gmail.com).
*
- * This file is part of OpenCAMlib.
- *
- * OpenCAMlib is free software: you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation, either version 3 of the License, or
+ * This file is part of OpenCAMlib
+ * (see https://github.com/aewallin/opencamlib).
+ *
+ * This program 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.
- *
- * OpenCAMlib is distributed in the hope that it will be useful,
+ *
+ * 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 General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with OpenCAMlib. If not, see .
+ * GNU Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * along with this program. If not, see .
*/
-
#ifndef TSP_H
#define TSP_H
diff -Nru opencamlib-11.10+git201801200005~ubuntu16.04.1/src/algo/waterline.cpp opencamlib-11.10-1/src/algo/waterline.cpp
--- opencamlib-11.10+git201801200005~ubuntu16.04.1/src/algo/waterline.cpp 2018-01-20 00:05:22.000000000 +0000
+++ opencamlib-11.10-1/src/algo/waterline.cpp 2020-06-14 12:13:19.000000000 +0000
@@ -1,20 +1,22 @@
-/*
- * Copyright 2010-2011 Anders Wallin (anders.e.e.wallin "at" gmail.com)
+/* $Id$
+ *
+ * Copyright (c) 2010-2011 Anders Wallin (anders.e.e.wallin "at" gmail.com).
*
- * This file is part of OpenCAMlib.
- *
- * OpenCAMlib is free software: you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation, either version 3 of the License, or
+ * This file is part of OpenCAMlib
+ * (see https://github.com/aewallin/opencamlib).
+ *
+ * This program 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.
- *
- * OpenCAMlib is distributed in the hope that it will be useful,
+ *
+ * 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 General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with OpenCAMlib. If not, see .
+ * GNU Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * along with this program. If not, see .
*/
#include
@@ -53,7 +55,9 @@
}
Waterline::~Waterline() {
- std::cout << "~Waterline(): subOp.size()= " << subOp.size() <<"\n";
+ // std::cout << "~Waterline(): subOp.size()= " << subOp.size() <<"\n";
+ delete subOp[1];
+ delete subOp[0];
subOp.clear();
}
@@ -91,7 +95,7 @@
}
void Waterline::weave_process() {
- std::cout << "Weave...\n" << std::flush;
+ // std::cout << "Weave...\n" << std::flush;
weave::SimpleWeave weave;
BOOST_FOREACH( Fiber f, xfibers ) {
weave.addFiber(f);
@@ -102,19 +106,19 @@
//std::cout << "Weave::build()..." << std::flush;
weave.build();
- std::cout << "done.\n";
+ // std::cout << "done.\n";
- std::cout << "Weave::face traverse()...";
+ // std::cout << "Weave::face traverse()...";
weave.face_traverse();
- std::cout << "done.\n";
+ // std::cout << "done.\n";
- std::cout << "Weave::get_loops()...";
+ // std::cout << "Weave::get_loops()...";
loops = weave.getLoops();
- std::cout << "done.\n";
+ // std::cout << "done.\n";
}
void Waterline::weave_process2() {
- std::cout << "Weave...\n" << std::flush;
+ // std::cout << "Weave...\n" << std::flush;
weave::SmartWeave weave;
BOOST_FOREACH( Fiber f, xfibers ) {
weave.addFiber(f);
@@ -125,19 +129,19 @@
//std::cout << "Weave::build2()..." << std::flush;
weave.build();
- std::cout << "done.\n";
+ // std::cout << "done.\n";
- std::cout << "Weave::face traverse()...";
+ // std::cout << "Weave::face traverse()...";
weave.face_traverse();
- std::cout << "done.\n";
+ // std::cout << "done.\n";
- std::cout << "Weave::get_loops()...";
+ // std::cout << "Weave::get_loops()...";
loops = weave.getLoops();
- std::cout << "done.\n";
+ // std::cout << "done.\n";
}
void Waterline::init_fibers() {
- std::cout << " Waterline::init_fibers()\n";
+ // std::cout << " Waterline::init_fibers()\n";
double minx = surf->bb.minpt.x - 2*cutter->getRadius();
double maxx = surf->bb.maxpt.x + 2*cutter->getRadius();
double miny = surf->bb.minpt.y - 2*cutter->getRadius();
@@ -158,7 +162,6 @@
Fiber f = Fiber( p1 , p2 );
subOp[1]->appendFiber( f );
}
-
}
// return a double-vector [ start , ... , end ] with N elements
diff -Nru opencamlib-11.10+git201801200005~ubuntu16.04.1/src/algo/waterline.hpp opencamlib-11.10-1/src/algo/waterline.hpp
--- opencamlib-11.10+git201801200005~ubuntu16.04.1/src/algo/waterline.hpp 2018-01-20 00:05:22.000000000 +0000
+++ opencamlib-11.10-1/src/algo/waterline.hpp 2020-06-14 12:13:19.000000000 +0000
@@ -1,21 +1,22 @@
/* $Id$
*
- * Copyright 2010-2011 Anders Wallin (anders.e.e.wallin "at" gmail.com)
+ * Copyright (c) 2010-2011 Anders Wallin (anders.e.e.wallin "at" gmail.com).
*
- * This file is part of OpenCAMlib.
- *
- * OpenCAMlib is free software: you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation, either version 3 of the License, or
+ * This file is part of OpenCAMlib
+ * (see https://github.com/aewallin/opencamlib).
+ *
+ * This program 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.
- *
- * OpenCAMlib is distributed in the hope that it will be useful,
+ *
+ * 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 General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with OpenCAMlib. If not, see .
+ * GNU Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * along with this program. If not, see .
*/
#ifndef WATERLINE_H
diff -Nru opencamlib-11.10+git201801200005~ubuntu16.04.1/src/algo/waterline_py.hpp opencamlib-11.10-1/src/algo/waterline_py.hpp
--- opencamlib-11.10+git201801200005~ubuntu16.04.1/src/algo/waterline_py.hpp 2018-01-20 00:05:22.000000000 +0000
+++ opencamlib-11.10-1/src/algo/waterline_py.hpp 1970-01-01 00:00:00.000000000 +0000
@@ -1,76 +0,0 @@
-/* $Id$
- *
- * Copyright 2010 Anders Wallin (anders.e.e.wallin "at" gmail.com)
- *
- * This file is part of OpenCAMlib.
- *
- * OpenCAMlib is free software: you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation, either version 3 of the License, or
- * (at your option) any later version.
- *
- * OpenCAMlib 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 General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with OpenCAMlib. If not, see .
-*/
-
-#ifndef WATERLINE_PY_H
-#define WATERLINE_PY_H
-
-#include
-#include
-
-#include "waterline.hpp"
-
-namespace ocl
-{
-
-/// Python wrapper for Waterline
-class Waterline_py : public Waterline {
- public:
- Waterline_py() : Waterline() {}
- ~Waterline_py() {
- std::cout << "~Waterline_py()\n";
- }
- /// return loop as a list of lists to python
- boost::python::list py_getLoops() const {
- boost::python::list loop_list;
- BOOST_FOREACH( std::vector loop, this->loops ) {
- boost::python::list point_list;
- BOOST_FOREACH( Point p, loop ) {
- point_list.append( p );
- }
- loop_list.append(point_list);
- }
- return loop_list;
- }
- /// return a list of yfibers to python
- boost::python::list py_getXFibers() const {
- boost::python::list flist;
- std::vector xfibers = *( subOp[0]->getFibers() );
- BOOST_FOREACH( Fiber f, xfibers ) {
- Fiber_py f2(f);
- flist.append(f2);
- }
- return flist;
- }
- /// return a list of yfibers to python
- boost::python::list py_getYFibers() const {
- boost::python::list flist;
- std::vector yfibers = *( subOp[1]->getFibers() );
- BOOST_FOREACH( Fiber f, yfibers ) {
- Fiber_py f2(f);
- flist.append(f2);
- }
- return flist;
- }
-
-};
-
-} // end namespace
-
-#endif
diff -Nru opencamlib-11.10+git201801200005~ubuntu16.04.1/src/algo/weave.cpp opencamlib-11.10-1/src/algo/weave.cpp
--- opencamlib-11.10+git201801200005~ubuntu16.04.1/src/algo/weave.cpp 2018-01-20 00:05:22.000000000 +0000
+++ opencamlib-11.10-1/src/algo/weave.cpp 2020-06-14 12:13:19.000000000 +0000
@@ -1,20 +1,22 @@
-/*
- * Copyright 2010-2011 Anders Wallin (anders.e.e.wallin "at" gmail.com)
+/* $Id$
+ *
+ * Copyright (c) 2010-2011 Anders Wallin (anders.e.e.wallin "at" gmail.com).
*
- * This file is part of OpenCAMlib.
- *
- * OpenCAMlib is free software: you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation, either version 3 of the License, or
+ * This file is part of OpenCAMlib
+ * (see https://github.com/aewallin/opencamlib).
+ *
+ * This program 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.
- *
- * OpenCAMlib is distributed in the hope that it will be useful,
+ *
+ * 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 General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with OpenCAMlib. If not, see .
+ * GNU Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * along with this program. If not, see .
*/
#include
@@ -45,7 +47,7 @@
// traverse the graph putting loops of vertices into the loops variable
// this figure illustrates next-pointers: http://www.anderswallin.net/wp-content/uploads/2011/05/weave2_zoom.png
void Weave::face_traverse() {
- std::cout << " traversing graph with " << clVertexSet.size() << " cl-points\n";
+ // std::cout << " traversing graph with " << clVertexSet.size() << " cl-points\n";
while ( !clVertexSet.empty() ) { // while unprocessed cl-vertices remain
std::vector loop; // start on a new loop
Vertex current = *(clVertexSet.begin());
diff -Nru opencamlib-11.10+git201801200005~ubuntu16.04.1/src/algo/weave.hpp opencamlib-11.10-1/src/algo/weave.hpp
--- opencamlib-11.10+git201801200005~ubuntu16.04.1/src/algo/weave.hpp 2018-01-20 00:05:22.000000000 +0000
+++ opencamlib-11.10-1/src/algo/weave.hpp 2020-06-14 12:13:19.000000000 +0000
@@ -1,20 +1,22 @@
-/*
- * Copyright 2010-2011 Anders Wallin (anders.e.e.wallin "at" gmail.com)
+/* $Id$
+ *
+ * Copyright (c) 2010-2011 Anders Wallin (anders.e.e.wallin "at" gmail.com).
*
- * This file is part of OpenCAMlib.
- *
- * OpenCAMlib is free software: you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation, either version 3 of the License, or
+ * This file is part of OpenCAMlib
+ * (see https://github.com/aewallin/opencamlib).
+ *
+ * This program 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.
- *
- * OpenCAMlib is distributed in the hope that it will be useful,
+ *
+ * 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 General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with OpenCAMlib. If not, see .
+ * GNU Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * along with this program. If not, see .
*/
#ifndef WEAVE_HPP
#define WEAVE_HPP
diff -Nru opencamlib-11.10+git201801200005~ubuntu16.04.1/src/algo/weave_py.hpp opencamlib-11.10-1/src/algo/weave_py.hpp
--- opencamlib-11.10+git201801200005~ubuntu16.04.1/src/algo/weave_py.hpp 2018-01-20 00:05:22.000000000 +0000
+++ opencamlib-11.10-1/src/algo/weave_py.hpp 1970-01-01 00:00:00.000000000 +0000
@@ -1,88 +0,0 @@
-/*
- * Copyright 2010-2011 Anders Wallin (anders.e.e.wallin "at" gmail.com)
- *
- * This file is part of OpenCAMlib.
- *
- * OpenCAMlib is free software: you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation, either version 3 of the License, or
- * (at your option) any later version.
- *
- * OpenCAMlib 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 General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with OpenCAMlib. If not, see .
-*/
-#ifndef WEAVE_PY_H
-#define WEAVE_PY_H
-
-#include "weave.hpp"
-
-namespace ocl
-{
-
-namespace weave {
-
-/// \brief python wrapper for VoronoiDiagram
-///
-class Weave_py : public Weave {
- public:
- Weave_py() : Weave() {};
-
- int numVertices() const {
- return g.num_vertices();
- };
- boost::python::list getVertices(VertexType t) {
- boost::python::list plist;
- BOOST_FOREACH( Vertex v, g.vertices() ) {
- if ( g[v].type == t )
- plist.append( g[v].position );
- }
- return plist;
- };
-
- /// return CL-points to python
- boost::python::list getCLVertices() {
- return getVertices( CL );
- };
- /// return internal points to python
- boost::python::list getINTVertices() {
- return getVertices( INT );
- };
- /// return edges to python
- /// format is [ [p1,p2] , [p3,p4] , ... ]
- boost::python::list getEdges() {
- boost::python::list edge_list;
- BOOST_FOREACH(Edge e, g.edges() ) {
- boost::python::list point_list; // the endpoints of each edge
- Vertex v1 = g.source( e );
- Vertex v2 = g.target( e );
- point_list.append(g[v1].position);
- point_list.append(g[v2].position);
- edge_list.append(point_list);
- }
- return edge_list;
- };
- /// return loops to python
- boost::python::list py_getLoops() {
- boost::python::list loop_list;
- BOOST_FOREACH( std::vector loop, loops ) {
- boost::python::list point_list;
- BOOST_FOREACH( Vertex v, loop ) {
- point_list.append( g[v].position );
- }
- loop_list.append(point_list);
- }
- return loop_list;
- };
-
-};
-
-} // end weave namespace
-
-} // end ocl namespace
-#endif
-// end weave_py.h
diff -Nru opencamlib-11.10+git201801200005~ubuntu16.04.1/src/algo/weave_typedef.hpp opencamlib-11.10-1/src/algo/weave_typedef.hpp
--- opencamlib-11.10+git201801200005~ubuntu16.04.1/src/algo/weave_typedef.hpp 2018-01-20 00:05:22.000000000 +0000
+++ opencamlib-11.10-1/src/algo/weave_typedef.hpp 2020-06-14 12:13:19.000000000 +0000
@@ -1,20 +1,22 @@
-/*
- * Copyright 2010-2011 Anders Wallin (anders.e.e.wallin "at" gmail.com)
+/* $Id$
+ *
+ * Copyright (c) 2010-2011 Anders Wallin (anders.e.e.wallin "at" gmail.com).
*
- * This file is part of OpenCAMlib.
- *
- * OpenCAMlib is free software: you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation, either version 3 of the License, or
+ * This file is part of OpenCAMlib
+ * (see https://github.com/aewallin/opencamlib).
+ *
+ * This program 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.
- *
- * OpenCAMlib is distributed in the hope that it will be useful,
+ *
+ * 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 General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with OpenCAMlib. If not, see .
+ * GNU Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * along with this program. If not, see .
*/
#ifndef WEAVE_TYPEDEF_H
#define WEAVE_TYPEDEF_H
diff -Nru opencamlib-11.10+git201801200005~ubuntu16.04.1/src/algo/zigzag.hpp opencamlib-11.10-1/src/algo/zigzag.hpp
--- opencamlib-11.10+git201801200005~ubuntu16.04.1/src/algo/zigzag.hpp 2018-01-20 00:05:22.000000000 +0000
+++ opencamlib-11.10-1/src/algo/zigzag.hpp 2020-06-14 12:13:19.000000000 +0000
@@ -1,21 +1,22 @@
/* $Id$
*
- * Copyright 2010 Anders Wallin (anders.e.e.wallin "at" gmail.com)
+ * Copyright (c) 2010 Anders Wallin (anders.e.e.wallin "at" gmail.com).
*
- * This file is part of OpenCAMlib.
- *
- * OpenCAMlib is free software: you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation, either version 3 of the License, or
+ * This file is part of OpenCAMlib
+ * (see https://github.com/aewallin/opencamlib).
+ *
+ * This program 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.
- *
- * OpenCAMlib is distributed in the hope that it will be useful,
+ *
+ * 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 General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with OpenCAMlib. If not, see .
+ * GNU Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * along with this program. If not, see .
*/
#ifndef ZIGZAG_H
diff -Nru opencamlib-11.10+git201801200005~ubuntu16.04.1/src/attic/ball_cutter_tst_1.py opencamlib-11.10-1/src/attic/ball_cutter_tst_1.py
--- opencamlib-11.10+git201801200005~ubuntu16.04.1/src/attic/ball_cutter_tst_1.py 2018-01-20 00:05:22.000000000 +0000
+++ opencamlib-11.10-1/src/attic/ball_cutter_tst_1.py 2020-06-14 12:13:19.000000000 +0000
@@ -21,16 +21,16 @@
#cutter = ocl.CylCutter(0.5)
#cutter = ocl.BallCutter(1.5)
- print ocl.revision()
- print cutter
+ print(ocl.revision())
+ print(cutter)
- print "rendering...",
+ print("rendering...",)
# insert code here to actually do something...
- print "done."
+ print("done.")
diff -Nru opencamlib-11.10+git201801200005~ubuntu16.04.1/src/attic/bug20100329.py opencamlib-11.10-1/src/attic/bug20100329.py
--- opencamlib-11.10+git201801200005~ubuntu16.04.1/src/attic/bug20100329.py 2018-01-20 00:05:22.000000000 +0000
+++ opencamlib-11.10-1/src/attic/bug20100329.py 2020-06-14 12:13:19.000000000 +0000
@@ -31,7 +31,7 @@
plist=[]
zbase=-5
- #for n in xrange(0,3):
+ #for n in range(0,3):
# plist.append( ocl.Point(1 + 0.01*n, 1.4, zbase) )
plist.append( ocl.Point(1.02, 1.4, zbase) )
@@ -54,12 +54,12 @@
myscreen.addActor( camvtk.Sphere(center=(cc.x,cc.y,cc.z) , radius=0.1, color=(0.2,0.3,0.4) ) )
myscreen.render()
if p.z > 10:
- print "cl-point is ", p.str()
- print "cc-point is ", cc.str()
- print "t=", t.str()
+ print("cl-point is ", p.str())
+ print("cc-point is ", cc.str())
+ print("t=", t.str())
tripoints = t.getPoints()
#for pt in tripoints:
- # print pt.x, " , ", pt.y, " , ", pt.z
+ # print(pt.x, " , ", pt.y, " , ", pt.z)
break
myscreen.removeActor(stl2)
#time.sleep(0.01)
@@ -67,12 +67,12 @@
#cutter.dropCutterSTL(p, cc, s)
clpoints.append(p)
ccpoints.append(cc)
- print "drop-cutter done"
+ print("drop-cutter done")
for (cl,cc) in zip(clpoints,ccpoints):
myscreen.addActor( camvtk.Point(center=(cl.x,cl.y,cl.z) , color=camvtk.ccColor(cc) ) )
#myscreen.addActor( camvtk.Point(center=(cc.x,cc.y,cc.z) , color=camvtk.yellow ) )
- print "adding point", cl.str()
+ print("adding point", cl.str())
trilist = pf.getTrianglesUnderCutter(p, cutter)
stl2 = camvtk.STLSurf(filename=None, triangleList=trilist, color=camvtk.red )
stl2.SetSurface()
@@ -85,7 +85,7 @@
#p = plist[2]
#for t in s.tris:
- # print t.str()
+ # print(t.str())
#cutter.vertexDrop(p)
diff -Nru opencamlib-11.10+git201801200005~ubuntu16.04.1/src/attic/cutsim/cutsim_06.py opencamlib-11.10-1/src/attic/cutsim/cutsim_06.py
--- opencamlib-11.10+git201801200005~ubuntu16.04.1/src/attic/cutsim/cutsim_06.py 2018-01-20 00:05:22.000000000 +0000
+++ opencamlib-11.10-1/src/attic/cutsim/cutsim_06.py 2020-06-14 12:13:19.000000000 +0000
@@ -7,7 +7,7 @@
import math
def main():
- print ocl.revision()
+ print(ocl.revision())
myscreen = camvtk.VTKScreen()
myscreen.camera.SetPosition(-15, -8, 15)
myscreen.camera.SetFocalPoint(0,0, 0)
@@ -51,30 +51,30 @@
mc = ocl.MarchingCubes()
tris=[]
while (n<=nmax):
- print "diff...",
+ print("diff...",)
t_before = time.time()
t.diff_negative(s)
t_after = time.time()
build_time = t_after-t_before
- print "done in ", build_time," s"
+ print("done in ", build_time," s")
infotext= "Octree + Marching-Cubes test\nmax octree-depth:%i \ntriangles: %i \nbuild() time: %f ms" % (max_depth,
len(tris), build_time*1e3 )
octtext.SetText(infotext)
if n==nmax:
t_before = time.time()
- print "mc()...",
+ print("mc()...",)
tris = mc.mc_tree(t) #.mc_triangles()
t_after = time.time()
mc_time = t_after-t_before
- print "done in ", mc_time," s"
- print " mc() got ", len(tris), " triangles"
+ print("done in ", mc_time," s")
+ print(" mc() got ", len(tris), " triangles")
mc_surf = camvtk.STLSurf( triangleList=tris, color=camvtk.red )
mc_surf.SetWireframe()
mc_surf.SetColor(camvtk.cyan)
- print " STLSurf()...",
+ print(" STLSurf()...",)
myscreen.addActor( mc_surf )
- print "done."
+ print("done.")
#nodes = t.get_leaf_nodes()
#allpoints=[]
#for no in nodes:
@@ -85,10 +85,10 @@
#print " PointCloud()...",
#myscreen.addActor( oct_points )
#print "done."
- print " render()...",
+ print(" render()...",)
myscreen.render()
- print "done."
+ print("done.")
#lwr.SetFileName("frames/mc8_frame"+ ('%06d' % n)+".png")
#myscreen.camera.Azimuth( 2 )
@@ -109,9 +109,9 @@
# move forward
theta = n*dtheta
s.center = ocl.Point( 1.5*math.cos(theta),0.3*math.sin(theta),0.01*theta)
- print "center moved to", s.center
+ print("center moved to", s.center)
n=n+1
- print "All done."
+ print("All done.")
myscreen.iren.Start()
if __name__ == "__main__":
diff -Nru opencamlib-11.10+git201801200005~ubuntu16.04.1/src/attic/cutsim/cutsim_07_circle.py opencamlib-11.10-1/src/attic/cutsim/cutsim_07_circle.py
--- opencamlib-11.10+git201801200005~ubuntu16.04.1/src/attic/cutsim/cutsim_07_circle.py 2018-01-20 00:05:22.000000000 +0000
+++ opencamlib-11.10-1/src/attic/cutsim/cutsim_07_circle.py 2020-06-14 12:13:19.000000000 +0000
@@ -7,7 +7,7 @@
import math
def main():
- print ocl.revision()
+ print(ocl.revision())
myscreen = camvtk.VTKScreen()
myscreen.camera.SetPosition(-15, -8, 15)
myscreen.camera.SetFocalPoint(0,0, 0)
@@ -38,27 +38,27 @@
s.center = ocl.Point( 1.3*math.cos(theta),1.3*math.sin(theta),thetalift*theta)
mc = ocl.MarchingCubes()
while (n<=nmax):
- print "diff...",
+ print("diff...",)
t_before = time.time()
t.diff_negative(s)
t_after = time.time()
build_time = t_after-t_before
- print "done in ", build_time," s"
+ print("done in ", build_time," s")
if n==nmax:
t_before = time.time()
- print "mc()...",
+ print("mc()...",)
tris = mc.mc_tree(t) #.mc_triangles()
t_after = time.time()
mc_time = t_after-t_before
- print "done in ", mc_time," s"
- print " mc() got ", len(tris), " triangles"
+ print("done in ", mc_time," s")
+ print(" mc() got ", len(tris), " triangles")
mc_surf = camvtk.STLSurf( triangleList=tris, color=camvtk.red )
#mc_surf.SetWireframe()
mc_surf.SetColor(camvtk.cyan)
- print " STLSurf()...",
+ print(" STLSurf()...",)
myscreen.addActor( mc_surf )
- print "done."
+ print("done.")
nodes = t.get_leaf_nodes()
allpoints=[]
#for no in nodes:
@@ -66,13 +66,13 @@
# for v in verts:
# allpoints.append(v)
#oct_points = camvtk.PointCloud( allpoints )
- print " PointCloud()...",
+ print(" PointCloud()...",)
#myscreen.addActor( oct_points )
- print "done."
- print " render()...",
+ print("done.")
+ print(" render()...",)
myscreen.render()
- print "done."
+ print("done.")
#lwr.SetFileName("frames/mc8_frame"+ ('%06d' % n)+".png")
#myscreen.camera.Azimuth( 2 )
@@ -95,12 +95,12 @@
sp1 = ocl.Point(s.center)
s.center = ocl.Point( 1.3*math.cos(theta),1.3*math.sin(theta),thetalift*theta)
sp2 = ocl.Point(s.center)
- print "line from ",sp1," to ",sp2
+ print("line from ",sp1," to ",sp2)
if n is not nmax:
myscreen.addActor( camvtk.Line( p1=(sp1.x,sp1.y,sp1.z),p2=(sp2.x,sp2.y,sp2.z), color=camvtk.red ) )
- print "center moved to", s.center
+ print("center moved to", s.center)
n=n+1
- print "All done."
+ print("All done.")
myscreen.iren.Start()
if __name__ == "__main__":
diff -Nru opencamlib-11.10+git201801200005~ubuntu16.04.1/src/attic/cutsim/cutsim_08_tux.py opencamlib-11.10-1/src/attic/cutsim/cutsim_08_tux.py
--- opencamlib-11.10+git201801200005~ubuntu16.04.1/src/attic/cutsim/cutsim_08_tux.py 2018-01-20 00:05:22.000000000 +0000
+++ opencamlib-11.10-1/src/attic/cutsim/cutsim_08_tux.py 2020-06-14 12:13:19.000000000 +0000
@@ -7,7 +7,7 @@
import math
def main():
- print ocl.revision()
+ print(ocl.revision())
myscreen = camvtk.VTKScreen()
myscreen.camera.SetPosition(-8, -4, 25)
myscreen.camera.SetFocalPoint(4.5,6, 0)
@@ -32,7 +32,7 @@
polydata = stl.src.GetOutput()
s = ocl.STLSurf()
camvtk.vtkPolyData2OCLSTL(polydata, s)
- print "STL surface read,", s.size(), "triangles"
+ print("STL surface read,", s.size(), "triangles")
#angle = math.pi/4
radius = 0.4
@@ -64,12 +64,12 @@
t_after = time.time()
calctime = t_after-t_before
- print " BDC4 done in ", calctime," s"
+ print(" BDC4 done in ", calctime," s")
dropcutter_time = calctime
clpoints = bdc.getCLPoints()
#camvtk.drawCLPointCloud(myscreen, clpoints)
- print " clpts= ", len(clpoints)
+ print(" clpts= ", len(clpoints))
myscreen.render()
#myscreen.iren.Start()
#exit()
@@ -111,14 +111,14 @@
mc = ocl.MarchingCubes()
- print "stock mc()...",
+ print("stock mc()...",)
tris = mc.mc_tree(t) # t.mc_triangles()
- print " mc() got ", len(tris), " triangles"
+ print(" mc() got ", len(tris), " triangles")
mc_surf = camvtk.STLSurf( triangleList=tris, color=camvtk.red )
mc_surf.SetColor(camvtk.cyan)
- print "stock STLSurf()...",
+ print("stock STLSurf()...",)
myscreen.addActor( mc_surf )
- print "done."
+ print("done.")
myscreen.render()
#myscreen.iren.Start()
@@ -130,7 +130,7 @@
cl = ocl.Point( clpoints[n].x, clpoints[n].y, clpoints[n].z )
s.setPos( cl )
#myscreen.addActor( camvtk.Point( center=(cl.x,cl.y,cl.z), color=camvtk.yellow))
- print n,": diff...",
+ print(n,": diff...",)
t_before = time.time()
t.diff_negative(s)
t_after = time.time()
@@ -146,29 +146,29 @@
cltext.SetText(postext)
cactors = camvtk.drawBallCutter(myscreen, cutter, cl)
- print cactors
+ print(cactors)
t_before = time.time()
- print "mc()...",
+ print("mc()...",)
tris = mc.mc_tree(t) #.mc_triangles()
t_after = time.time()
mc_time = t_after-t_before
- print "done in ", mc_time," s"
- print " mc() got ", len(tris), " triangles"
+ print("done in ", mc_time," s")
+ print(" mc() got ", len(tris), " triangles")
mc_surf = camvtk.STLSurf( triangleList=tris, color=camvtk.red )
#mc_surf.SetWireframe()
mc_surf.SetColor(camvtk.cyan)
- print " STLSurf()...",
+ print(" STLSurf()...",)
myscreen.addActor( mc_surf )
- print "done."
+ print("done.")
- print " render()...",
+ print(" render()...",)
myscreen.render()
myscreen.camera.Azimuth( 0.5 )
lwr.SetFileName("frames/cutsim_d9_frame"+ ('%06d' % n)+".png")
w2if.Modified()
lwr.Write()
- print "done."
+ print("done.")
myscreen.removeActor( mc_surf )
for c in cactors:
myscreen.removeActor( c )
@@ -199,8 +199,8 @@
# myscreen.addActor( camvtk.Line( p1=(sp1.x,sp1.y,sp1.z),p2=(sp2.x,sp2.y,sp2.z), color=camvtk.red ) )
#print "center moved to", s.center
- print " clpts= ", len(clpoints)
- print "All done."
+ print(" clpts= ", len(clpoints))
+ print("All done.")
myscreen.iren.Start()
if __name__ == "__main__":
diff -Nru opencamlib-11.10+git201801200005~ubuntu16.04.1/src/attic/cutsim/cutsim_09_tux_video.py opencamlib-11.10-1/src/attic/cutsim/cutsim_09_tux_video.py
--- opencamlib-11.10+git201801200005~ubuntu16.04.1/src/attic/cutsim/cutsim_09_tux_video.py 2018-01-20 00:05:22.000000000 +0000
+++ opencamlib-11.10-1/src/attic/cutsim/cutsim_09_tux_video.py 2020-06-14 12:13:19.000000000 +0000
@@ -7,7 +7,7 @@
import math
def main():
- print ocl.revision()
+ print(ocl.revision())
myscreen = camvtk.VTKScreen()
myscreen.camera.SetPosition(-8, -4, 25)
myscreen.camera.SetFocalPoint(4.5,6, 0)
@@ -32,7 +32,7 @@
polydata = stl.src.GetOutput()
s = ocl.STLSurf()
camvtk.vtkPolyData2OCLSTL(polydata, s)
- print "STL surface read,", s.size(), "triangles"
+ print("STL surface read,", s.size(), "triangles")
#angle = math.pi/4
radius = 0.4
@@ -65,12 +65,12 @@
bdc.run()
t_after = time.time()
calctime = t_after-t_before
- print " BDC4 done in ", calctime," s"
+ print(" BDC4 done in ", calctime," s")
dropcutter_time = calctime
clpoints = bdc.getCLPoints()
#camvtk.drawCLPointCloud(myscreen, clpoints)
- print " clpts= ", len(clpoints)
+ print(" clpts= ", len(clpoints))
myscreen.render()
#myscreen.iren.Start()
#exit()
@@ -112,14 +112,14 @@
mc = ocl.MarchingCubes()
- print "mc()...",
+ print("mc()...",)
tris = mc.mc_tree(t) #.mc_triangles()
- print " mc() got ", len(tris), " triangles"
+ print(" mc() got ", len(tris), " triangles")
mc_surf = camvtk.STLSurf( triangleList=tris, color=camvtk.red )
mc_surf.SetColor(camvtk.cyan)
- print " STLSurf()...",
+ print(" STLSurf()...",)
myscreen.addActor( mc_surf )
- print "done."
+ print("done.")
cl = ocl.Point(0,0,5)
cactors = camvtk.drawBallCutter(myscreen, cutter, cl)
myscreen.render()
@@ -148,12 +148,12 @@
cactors = camvtk.drawBallCutter(myscreen, cutter, cl)
t_before = time.time()
- print "mc()...",
+ print("mc()...",)
tris = mc.mc_tree(t) #.mc_triangles()
mc_time = time.time()-t_before
- print "done in ", mc_time," s"
- print " mc() got ", len(tris), " triangles"
- print " STLSurf()...",
+ print("done in ", mc_time," s")
+ print(" mc() got ", len(tris), " triangles")
+ print(" STLSurf()...",)
t_before = time.time()
@@ -161,8 +161,8 @@
#mc_surf.SetWireframe()
mc_surf.SetColor(camvtk.cyan)
myscreen.addActor( mc_surf )
- print "done."
- print " render()...",
+ print("done.")
+ print(" render()...",)
myscreen.render()
render_time = time.time()-t_before
myscreen.camera.Azimuth( 0.1 )
@@ -170,7 +170,7 @@
w2if.Modified()
call_ms = step_time/renderinterleave
- print renderinterleave," diff() calls in", step_time, " = ", call_ms," ms/call"
+ print(renderinterleave," diff() calls in", step_time, " = ", call_ms," ms/call")
infotext= "Octree max_depth=%i \nCL-point %i of %i \n%i CL-pts/frame\ndiff()-time: %1.3f s/CL-point\nmc()-time: %1.3f s/frame\nrender()-time: %1.3f s/frame\n%i Triangles" % (max_depth,n,
len(clpoints), renderinterleave, call_ms, mc_time, render_time, len(tris))
octtext.SetText(infotext)
@@ -179,7 +179,7 @@
#lwr.Write() # uncomment to actually write files to disk
- print "done."
+ print("done.")
step_time = 0
@@ -195,8 +195,8 @@
#print "done."
- print " clpts= ", len(clpoints)
- print "All done."
+ print(" clpts= ", len(clpoints))
+ print("All done.")
myscreen.iren.Start()
if __name__ == "__main__":
diff -Nru opencamlib-11.10+git201801200005~ubuntu16.04.1/src/attic/cutsim/cutsim_10_side_tris.py opencamlib-11.10-1/src/attic/cutsim/cutsim_10_side_tris.py
--- opencamlib-11.10+git201801200005~ubuntu16.04.1/src/attic/cutsim/cutsim_10_side_tris.py 2018-01-20 00:05:22.000000000 +0000
+++ opencamlib-11.10-1/src/attic/cutsim/cutsim_10_side_tris.py 2020-06-14 12:13:19.000000000 +0000
@@ -7,7 +7,7 @@
import math
def main():
- print ocl.revision()
+ print(ocl.revision())
myscreen = camvtk.VTKScreen()
myscreen.camera.SetPosition(2, 2, 5)
myscreen.camera.SetFocalPoint(0.5,0, 1)
@@ -41,9 +41,9 @@
t.init(2)
n = 0 # the frame number
- print "root_scale = ", t.root_scale()
- print " max_depth = ", t.max_depth()
- print " leaf_scale=", t.leaf_scale()
+ print("root_scale = ", t.root_scale())
+ print(" max_depth = ", t.max_depth())
+ print(" leaf_scale=", t.leaf_scale())
# X
#stockbox = ocl.PlaneVolume( 1, 0, -0.9)
@@ -68,9 +68,9 @@
mc = ocl.MarchingCubes()
- print "mc()...",
+ print("mc()...",)
tris = mc.mc_tree(t) # t.mc_triangles()
- print " mc() got ", len(tris), " triangles"
+ print(" mc() got ", len(tris), " triangles")
#tris2 = t.side_triangles()
#print "appending"
#for tr in tris2:
@@ -84,10 +84,10 @@
#mc_surf.SetWireframe()
#mc_surf.SetOpacity(0.3)
- print " STLSurf()...",
+ print(" STLSurf()...",)
myscreen.addActor( mc_surf )
#myscreen.addActor( s_surf )
- print "done."
+ print("done.")
myscreen.render()
@@ -157,12 +157,12 @@
#print "done."
#time.sleep(0.4)
- print n, " mc_tris=",len(tris)
+ print(n, " mc_tris=",len(tris))
#," side_tris=",len(tris2)
n=n+1
#myscreen.camera.SetPosition(3*math.cos( 7*float(n)/(float(Nmax)) ), 3*math.sin( 7*float(n)/(float(Nmax)) ), 5)
#myscreen.camera.Azimuth( math.sin( 5*float(n)/(float(Nmax)) ) )
- print "all done."
+ print("all done.")
myscreen.iren.Start()
exit()
diff -Nru opencamlib-11.10+git201801200005~ubuntu16.04.1/src/attic/cutsim/cutsim_11.py opencamlib-11.10-1/src/attic/cutsim/cutsim_11.py
--- opencamlib-11.10+git201801200005~ubuntu16.04.1/src/attic/cutsim/cutsim_11.py 2018-01-20 00:05:22.000000000 +0000
+++ opencamlib-11.10-1/src/attic/cutsim/cutsim_11.py 2020-06-14 12:13:19.000000000 +0000
@@ -7,7 +7,7 @@
import math
def main():
- print ocl.revision()
+ print(ocl.revision())
myscreen = camvtk.VTKScreen()
myscreen.camera.SetPosition(2, 2, 5)
myscreen.camera.SetFocalPoint(0.5,0, 1)
@@ -29,21 +29,21 @@
t = ocl.Octree(root_scale, max_depth, cp)
t.init(2)
n = 0 # the frame number
- print "root_scale = ", t.root_scale()
- print " max_depth = ", t.max_depth()
- print " leaf_scale=", t.leaf_scale()
+ print("root_scale = ", t.root_scale())
+ print(" max_depth = ", t.max_depth())
+ print(" leaf_scale=", t.leaf_scale())
- print "mc()...",
+ print("mc()...",)
mc = ocl.MarchingCubes()
tris = mc.mc_tree(t)
mc_surf = camvtk.STLSurf( triangleList=tris )
mc_surf.SetColor(camvtk.cyan)
- print " STLSurf()...",
+ print(" STLSurf()...",)
myscreen.addActor( mc_surf )
- print "done."
+ print("done.")
myscreen.render()
myscreen.removeActor( mc_surf )
@@ -77,10 +77,10 @@
t_after = time.time()
render_time = t_after-t_before
- print "%i: mc_tris=%i\t diff=%1.3f \t mc=%1.3f \t ren=%1.3f" % (n, len(tris), diff_time, mc_time, render_time)
+ print("%i: mc_tris=%i\t diff=%1.3f \t mc=%1.3f \t ren=%1.3f" % (n, len(tris), diff_time, mc_time, render_time))
n=n+1
- print "all done."
+ print("all done.")
myscreen.iren.Start()
exit()
diff -Nru opencamlib-11.10+git201801200005~ubuntu16.04.1/src/attic/cutsim/cutsim_12.py opencamlib-11.10-1/src/attic/cutsim/cutsim_12.py
--- opencamlib-11.10+git201801200005~ubuntu16.04.1/src/attic/cutsim/cutsim_12.py 2018-01-20 00:05:22.000000000 +0000
+++ opencamlib-11.10-1/src/attic/cutsim/cutsim_12.py 2020-06-14 12:13:19.000000000 +0000
@@ -7,7 +7,7 @@
import math
def main():
- print ocl.revision()
+ print(ocl.revision())
myscreen = camvtk.VTKScreen()
myscreen.camera.SetPosition(-15, -8, 15)
myscreen.camera.SetFocalPoint(0,0, 0)
@@ -54,34 +54,34 @@
while (n<=nmax):
- print "diff...",
+ print("diff...",)
t_before = time.time()
t.diff_negative(s)
t_after = time.time()
build_time = t_after-t_before
- print "done in ", build_time," s"
+ print("done in ", build_time," s")
#infotext= "Octree + Marching-Cubes test\nmax octree-depth:%i \ntriangles: %i \nbuild() time: %f ms" % (max_depth,
# len(tris), build_time*1e3 )
#octtext.SetText(infotext)
if n==nmax:
t_before = time.time()
- print "mc()...",
+ print("mc()...",)
tris = mc.mc_tree(t)
t_after = time.time()
mc_time = t_after-t_before
- print "done in ", mc_time," s"
- print " mc() got ", len(tris), " triangles"
+ print("done in ", mc_time," s")
+ print(" mc() got ", len(tris), " triangles")
mc_surf = camvtk.STLSurf( triangleList=tris, color=camvtk.red )
mc_surf.SetWireframe()
mc_surf.SetColor(camvtk.cyan)
- print " STLSurf()...",
+ print(" STLSurf()...",)
myscreen.addActor( mc_surf )
- print "done."
- print " render()...",
+ print("done.")
+ print(" render()...",)
myscreen.render()
- print "done."
+ print("done.")
#lwr.SetFileName("frames/mc8_frame"+ ('%06d' % n)+".png")
#myscreen.camera.Azimuth( 2 )
@@ -102,9 +102,9 @@
# move forward
theta = n*dtheta
s.center = ocl.Point( 2*math.cos(theta),1*math.sin(theta),-0.1*theta)
- print "center moved to", s.center
+ print("center moved to", s.center)
n=n+1
- print "All done."
+ print("All done.")
myscreen.iren.Start()
if __name__ == "__main__":
diff -Nru opencamlib-11.10+git201801200005~ubuntu16.04.1/src/attic/cutsim2/cutsim.hpp opencamlib-11.10-1/src/attic/cutsim2/cutsim.hpp
--- opencamlib-11.10+git201801200005~ubuntu16.04.1/src/attic/cutsim2/cutsim.hpp 2018-01-20 00:05:22.000000000 +0000
+++ opencamlib-11.10-1/src/attic/cutsim2/cutsim.hpp 2020-06-14 12:13:19.000000000 +0000
@@ -1,21 +1,22 @@
-/* $Id: $
+/* $Id$
*
- * Copyright 2010-2011 Anders Wallin (anders.e.e.wallin "at" gmail.com)
+ * Copyright (c) 2010-2011 Anders Wallin (anders.e.e.wallin "at" gmail.com).
*
- * This file is part of OpenCAMlib.
- *
- * OpenCAMlib is free software: you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation, either version 3 of the License, or
+ * This file is part of OpenCAMlib
+ * (see https://github.com/aewallin/opencamlib).
+ *
+ * This program 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.
- *
- * OpenCAMlib is distributed in the hope that it will be useful,
+ *
+ * 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 General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with OpenCAMlib. If not, see .
+ * GNU Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * along with this program. If not, see .
*/
#ifndef CUTSIM_H
diff -Nru opencamlib-11.10+git201801200005~ubuntu16.04.1/src/attic/cutsim3/cutsim.h opencamlib-11.10-1/src/attic/cutsim3/cutsim.h
--- opencamlib-11.10+git201801200005~ubuntu16.04.1/src/attic/cutsim3/cutsim.h 2018-01-20 00:05:22.000000000 +0000
+++ opencamlib-11.10-1/src/attic/cutsim3/cutsim.h 2020-06-14 12:13:19.000000000 +0000
@@ -1,21 +1,22 @@
-/* $Id: $
+/* $Id$
*
- * Copyright 2010-2011 Anders Wallin (anders.e.e.wallin "at" gmail.com)
+ * Copyright (c) 2010-2011 Anders Wallin (anders.e.e.wallin "at" gmail.com).
*
- * This file is part of OpenCAMlib.
- *
- * OpenCAMlib is free software: you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation, either version 3 of the License, or
+ * This file is part of OpenCAMlib
+ * (see https://github.com/aewallin/opencamlib).
+ *
+ * This program 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.
- *
- * OpenCAMlib is distributed in the hope that it will be useful,
+ *
+ * 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 General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with OpenCAMlib. If not, see .
+ * GNU Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * along with this program. If not, see .
*/
#ifndef CUTSIM_H
diff -Nru opencamlib-11.10+git201801200005~ubuntu16.04.1/src/attic/gargantini.py opencamlib-11.10-1/src/attic/gargantini.py
--- opencamlib-11.10+git201801200005~ubuntu16.04.1/src/attic/gargantini.py 2018-01-20 00:05:22.000000000 +0000
+++ opencamlib-11.10-1/src/attic/gargantini.py 2020-06-14 12:13:19.000000000 +0000
@@ -14,7 +14,7 @@
node = OCTNode( level, center = nodecenter , type = 1, childlist=None)
flags = []
- for n in xrange(0,9): # test all points
+ for n in range(0,9): # test all points
flags.append( volume.isInside( node.nodePoint(n) ) )
if (sum(flags) == 0): # nothing is inside
@@ -34,7 +34,7 @@
# have to subdivide:
childs = []
child_centers = []
- for n in xrange(1,9):
+ for n in range(1,9):
child_center = node.childCenter(n)
childs.append( buildOCTree( volume , nodecenter = child_center, level= level+1) )
node.setChildren(childs)
@@ -74,7 +74,7 @@
if node.type == cam.OCType.GREY:
return # don't draw intermediate nodes
p = []
- for n in xrange(1,9):
+ for n in range(1,9):
p1 = node.nodePoint(n)
p.append(p1)
@@ -114,12 +114,12 @@
if node.type == cam.OCType.GREY:
return # don't draw intermediate nodes
p = []
- for n in xrange(1,9):
+ for n in range(1,9):
p1 = node.nodePoint(n)
p.append(p1)
lines = []
- for n in xrange(0,8):
+ for n in range(0,8):
lines.append ( camvtk.Point(center=(p[n].x,p[n].y,p[n].z) ) )
if node.type == cam.OCType.WHITE:
@@ -174,7 +174,7 @@
# scan code from left to right
p = cam.Point(0,0,0)
for digit in self.code:
- print digit
+ print(digit)
# set operations on linear octrees
# o1 = o2 octant o1 is same as o2
@@ -196,7 +196,7 @@
ptr1 = 0
ptr2 = 0
- while( (ptr1 <= len(o1)) && (ptr2 <= len(o2)) ):
+ while( (ptr1 <= len(o1)) and (ptr2 <= len(o2)) ):
if ( o1[ptr1].containedIn( o2[ptr2] ) ): # case1: containment of o1 node in o2 node
int_ptr += 1
intersection[int_ptr] = o1[ptr1]
@@ -205,7 +205,7 @@
add_to_queue( Q21, o1[ptr1] )
ptr1 +=1 # move to next in o1
- else if ( o2[ptr2].containedIn( o1[ptr1] ) ): # case2: containemnet of o2 node in o1 node
+ elif ( o2[ptr2].containedIn( o1[ptr1] ) ): # case2: containemnet of o2 node in o1 node
int_ptr=int_ptr+1
intersection[int_ptr] = o2[ptr2]
if ( Hold21 == 0): # difference queue 12 is empty
@@ -213,7 +213,7 @@
add_to_queue( Q12, o2[ptr2] )
ptr2 +=1 # move to next in o2
- else if ( o1[ptr1].lessThan( o2[ptr2] ) ): # case3: node o1 precedes node of o2
+ elif ( o1[ptr1].lessThan( o2[ptr2] ) ): # case3: node o1 precedes node of o2
union_ptr += 1
union[union_ptr] = o1[ptr1]
if ( Hold12 == o1[ptr1] ):
@@ -246,10 +246,10 @@
do_differences( Hold12, Q12, diff12, diff12_ptr )
Hold12 = 0
ptr3 += 1
- for i in xrange(ptr3, len(o1)): # difference
+ for i in range(ptr3, len(o1)): # difference
diff12_ptr += 1
diff12[diff12_ptr] = o1[i]
- for in in xrange(ptr1, len(o1)): # union
+ for i in range(ptr1, len(o1)): # union
union_ptr +=1
union[union_ptr] = o1[i]
@@ -259,10 +259,10 @@
do_differences(Hold21, Q21, diff21, diff21_ptr)
Hold21=0
ptr3 +=1
- for i in xrange(ptr3, len(o2):
+ for i in range(ptr3, len(o2)):
diff21_ptr +=1
diff21[diff21_ptr] = o2[i]
- for i in xrange(ptr2, len(o2)):
+ for i in range(ptr2, len(o2)):
union_ptr += 1
union[union_ptr] = o2[i]
@@ -284,13 +284,13 @@
# expand(n) takes node and expands into eight suboctants, return deque in ascending order
def do_differences( H, Q, D, Dptr):
Q2 = expand(H) # create nodes representing suboctants of H
- while ( Q2 not empty):
- if ( Q not empty):
+ while Q2:
+ if Q:
n = Hd(Q)
if ( n==Hd(Q2) ):
Q2 = Tl(Q2)
Q = Tl(Q)
- else if ( n.containedIn( Hd(Q2) ) ):
+ elif ( n.containedIn( Hd(Q2) ) ):
Q2 = append( expand( Hd(Q2), Tl(Q2) ) )
else:
Dptr +=1
@@ -316,19 +316,19 @@
#print oct.str()
"""
- print "max scale=", oct.get_max_scale()
- for n in xrange(0,9):
+ print("max scale=", oct.get_max_scale())
+ for n in range(0,9):
p1 = oct.nodePoint(n)
myscreen.addActor( camvtk.Sphere(center=(p1.x, p1.y, p1.z), radius=0.1, color=camvtk.red))
- print "id=%i" % (n),
- print p1.str()
+ print("id=%i" % (n),)
+ print(p1.str())
- print "child centers:"
- for n in xrange(1,9):
+ print("child centers:")
+ for n in range(1,9):
p1 = oct.childCenter(n)
myscreen.addActor( camvtk.Sphere(center=(p1.x, p1.y, p1.z), radius=0.1, color=camvtk.yellow))
- print "id=%i" % (n),
- print p1.str()
+ print("id=%i" % (n),)
+ print(p1.str())
"""
@@ -371,29 +371,29 @@
iters = oc2.prune_all()
nlist = oc2.get_all_nodes()
- print " oc2 got ", len(nlist), " nodes"
+ print(" oc2 got ", len(nlist), " nodes")
nlist = oc2.get_white_nodes()
- print " oc2 got ", len(nlist), " white nodes"
+ print(" oc2 got ", len(nlist), " white nodes")
nlist = oc3.get_all_nodes()
- print " oc3 got ", len(nlist), " nodes"
+ print(" oc3 got ", len(nlist), " nodes")
- print "calling balance"
+ print("calling balance")
oc2.balance(oc3)
- print "after balance:"
+ print("after balance:")
nlist = oc2.get_all_nodes()
- print " oc2 got ", len(nlist), " nodes"
+ print(" oc2 got ", len(nlist), " nodes")
nlist = oc2.get_white_nodes()
- print " oc2 got ", len(nlist), " white nodes"
- print "calling diff"
+ print(" oc2 got ", len(nlist), " white nodes")
+ print("calling diff")
oc2.diff(oc3)
- print "after diff:"
+ print("after diff:")
nlist = oc2.get_all_nodes()
- print " oc2 got ", len(nlist), " nodes"
+ print(" oc2 got ", len(nlist), " nodes")
nlist = oc2.get_white_nodes()
- print " oc2 got ", len(nlist), " white nodes"
+ print(" oc2 got ", len(nlist), " white nodes")
drawOCT(myscreen, oc2, camvtk.green)
#drawOCT(myscreen, oc3, camvtk.red, opacity=0.1)
@@ -431,14 +431,14 @@
testvol = Volume()
- print "building tree...",
+ print("building tree...",)
tree = buildOCTree(testvol)
- print "done."
- print tree
+ print("done.")
+ print(tree)
list =[]
searchOCTree(tree, list)
- print len(list), " nodes in tree"
+ print(len(list), " nodes in tree")
w2if = vtk.vtkWindowToImageFilter()
w2if.SetInput(myscreen.renWin)
@@ -464,7 +464,7 @@
t.SetText("OpenCAMLib 10.03-beta " + datetime.datetime.now().strftime("%Y-%m-%d %H:%M:%S"))
myscreen.render()
myscreen.camera.Azimuth( 3 )
- print "frame %i of %i" % (n, len(list))
+ print("frame %i of %i" % (n, len(list)))
w2if.Modified()
lwr.SetFileName("frames/oct"+ ('%05d' % n)+".png")
#lwr.Write()
@@ -474,7 +474,7 @@
- print "done!"
+ print("done!")
#raw_input("Press Enter to terminate")
diff -Nru opencamlib-11.10+git201801200005~ubuntu16.04.1/src/attic/halfedgediagram_old.hpp opencamlib-11.10-1/src/attic/halfedgediagram_old.hpp
--- opencamlib-11.10+git201801200005~ubuntu16.04.1/src/attic/halfedgediagram_old.hpp 2018-01-20 00:05:22.000000000 +0000
+++ opencamlib-11.10-1/src/attic/halfedgediagram_old.hpp 2020-06-14 12:13:19.000000000 +0000
@@ -1,21 +1,22 @@
/* $Id$
*
- * Copyright 2010-2011 Anders Wallin (anders.e.e.wallin "at" gmail.com)
+ * Copyright (c) 2010-2011 Anders Wallin (anders.e.e.wallin "at" gmail.com).
*
- * This file is part of OpenCAMlib.
- *
- * OpenCAMlib is free software: you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation, either version 3 of the License, or
+ * This file is part of OpenCAMlib
+ * (see https://github.com/aewallin/opencamlib).
+ *
+ * This program 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.
- *
- * OpenCAMlib is distributed in the hope that it will be useful,
+ *
+ * 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 General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with OpenCAMlib. If not, see .
+ * GNU Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * along with this program. If not, see .
*/
#ifndef HEDI_H
#define HEDI_H
diff -Nru opencamlib-11.10+git201801200005~ubuntu16.04.1/src/attic/kdtree2.cpp opencamlib-11.10-1/src/attic/kdtree2.cpp
--- opencamlib-11.10+git201801200005~ubuntu16.04.1/src/attic/kdtree2.cpp 2018-01-20 00:05:22.000000000 +0000
+++ opencamlib-11.10-1/src/attic/kdtree2.cpp 2020-06-14 12:13:19.000000000 +0000
@@ -1,21 +1,22 @@
/* $Id$
*
- * Copyright 2010 Anders Wallin (anders.e.e.wallin "at" gmail.com)
+ * Copyright (c) 2010 Anders Wallin (anders.e.e.wallin "at" gmail.com).
*
- * This file is part of OpenCAMlib.
- *
- * OpenCAMlib is free software: you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation, either version 3 of the License, or
+ * This file is part of OpenCAMlib
+ * (see https://github.com/aewallin/opencamlib).
+ *
+ * This program 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.
- *
- * OpenCAMlib is distributed in the hope that it will be useful,
+ *
+ * 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 General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with OpenCAMlib. If not, see .
+ * GNU Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * along with this program. If not, see .
*/
#include
diff -Nru opencamlib-11.10+git201801200005~ubuntu16.04.1/src/attic/kdtree2.h opencamlib-11.10-1/src/attic/kdtree2.h
--- opencamlib-11.10+git201801200005~ubuntu16.04.1/src/attic/kdtree2.h 2018-01-20 00:05:22.000000000 +0000
+++ opencamlib-11.10-1/src/attic/kdtree2.h 2020-06-14 12:13:19.000000000 +0000
@@ -1,21 +1,22 @@
/* $Id$
*
- * Copyright 2010 Anders Wallin (anders.e.e.wallin "at" gmail.com)
+ * Copyright (c) 2010 Anders Wallin (anders.e.e.wallin "at" gmail.com).
*
- * This file is part of OpenCAMlib.
- *
- * OpenCAMlib is free software: you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation, either version 3 of the License, or
+ * This file is part of OpenCAMlib
+ * (see https://github.com/aewallin/opencamlib).
+ *
+ * This program 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.
- *
- * OpenCAMlib is distributed in the hope that it will be useful,
+ *
+ * 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 General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with OpenCAMlib. If not, see .
+ * GNU Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * along with this program. If not, see .
*/
#ifndef KDTREE2_H
diff -Nru opencamlib-11.10+git201801200005~ubuntu16.04.1/src/attic/kdtree.cpp opencamlib-11.10-1/src/attic/kdtree.cpp
--- opencamlib-11.10+git201801200005~ubuntu16.04.1/src/attic/kdtree.cpp 2018-01-20 00:05:22.000000000 +0000
+++ opencamlib-11.10-1/src/attic/kdtree.cpp 2020-06-14 12:13:19.000000000 +0000
@@ -1,21 +1,22 @@
/* $Id$
*
- * Copyright 2010 Anders Wallin (anders.e.e.wallin "at" gmail.com)
+ * Copyright (c) 2010 Anders Wallin (anders.e.e.wallin "at" gmail.com).
*
- * This file is part of OpenCAMlib.
- *
- * OpenCAMlib is free software: you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation, either version 3 of the License, or
+ * This file is part of OpenCAMlib
+ * (see https://github.com/aewallin/opencamlib).
+ *
+ * This program 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.
- *
- * OpenCAMlib is distributed in the hope that it will be useful,
+ *
+ * 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 General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with OpenCAMlib. If not, see .
+ * GNU Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * along with this program. If not, see .
*/
// this is mostly a translation to c++ of the earlier c# code
diff -Nru opencamlib-11.10+git201801200005~ubuntu16.04.1/src/attic/kdtree.h opencamlib-11.10-1/src/attic/kdtree.h
--- opencamlib-11.10+git201801200005~ubuntu16.04.1/src/attic/kdtree.h 2018-01-20 00:05:22.000000000 +0000
+++ opencamlib-11.10-1/src/attic/kdtree.h 2020-06-14 12:13:19.000000000 +0000
@@ -1,21 +1,22 @@
/* $Id$
*
- * Copyright 2010 Anders Wallin (anders.e.e.wallin "at" gmail.com)
+ * Copyright (c) 2010 Anders Wallin (anders.e.e.wallin "at" gmail.com).
*
- * This file is part of OpenCAMlib.
- *
- * OpenCAMlib is free software: you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation, either version 3 of the License, or
+ * This file is part of OpenCAMlib
+ * (see https://github.com/aewallin/opencamlib).
+ *
+ * This program 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.
- *
- * OpenCAMlib is distributed in the hope that it will be useful,
+ *
+ * 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 General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with OpenCAMlib. If not, see .
+ * GNU Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * along with this program. If not, see .
*/
#ifndef KDTREE_H
diff -Nru opencamlib-11.10+git201801200005~ubuntu16.04.1/src/attic/ocode/cutsim_test_1.py opencamlib-11.10-1/src/attic/ocode/cutsim_test_1.py
--- opencamlib-11.10+git201801200005~ubuntu16.04.1/src/attic/ocode/cutsim_test_1.py 2018-01-20 00:05:22.000000000 +0000
+++ opencamlib-11.10-1/src/attic/ocode/cutsim_test_1.py 2020-06-14 12:13:19.000000000 +0000
@@ -8,7 +8,7 @@
def main(filename="frame/f.png"):
- print ocl.revision()
+ print(ocl.revision())
myscreen = camvtk.VTKScreen()
myscreen.camera.SetPosition(20, 12, 20)
@@ -27,7 +27,7 @@
c = ocl.CylCutter(1) # cutter
c.length = 3
- print "cutter length=", c.length
+ print("cutter length=", c.length)
p1 = ocl.CLPoint(-0.2,-0.2,0.2) # start of move
p2 = ocl.CLPoint(-0.2,0.2,0.0) # end of move
p3 = ocl.CLPoint(0.5,0.0,-0.5)
@@ -56,10 +56,10 @@
myscreen.addActor(surf)
Nmoves = len(clpoints)
- print Nmoves,"CL-points to process"
- for n in xrange(0,Nmoves-1):
+ print(Nmoves,"CL-points to process")
+ for n in range(0,Nmoves-1):
#if n100):
if ( (i % (nmax/10))==0):
- print ".",
+ print(".",)
i=i+1
#tlist.append(ocl.Triangle(p1,p2,p4))
@@ -73,19 +73,19 @@
#tlist.append(ocl.Triangle(p2,p3,p7))
#tlist.append(ocl.Triangle(p2,p7,p8))
#tlist.append(ocl.Triangle(p3,p7,p8))
- print ".actor.",
+ print(".actor.",)
surf = camvtk.STLSurf(triangleList=tlist)
surf.SetColor(color)
surf.SetOpacity(opacity)
- print ".add.",
+ print(".add.",)
myscreen.addActor(surf)
- print ".done."
+ print(".done.")
def main(filename="frame/f.png",yc=6, n=0):
- print ocl.revision()
+ print(ocl.revision())
f=ocl.Ocode()
f.set_depth(7)
@@ -126,7 +126,7 @@
#myscreen.iren.Start()
#exit()
- print " after init() t :", t.str()
+ print(" after init() t :", t.str())
#print " after init() t2 :", t2.str()
# sphere
@@ -157,7 +157,7 @@
c = ocl.CylCutter(1)
c.length = 3
- print "cutter length=", c.length
+ print("cutter length=", c.length)
p1 = ocl.Point(0.2,0.2,0)
p2 = ocl.Point(1.5,1.5,-1)
g1vol = ocl.CylMoveOCTVolume(c, p1, p2)
@@ -187,25 +187,25 @@
#t.build( g1vol )
t.build( svol )
t_after = time.time()
- print "build took ", t_after-t_before," s"
+ print("build took ", t_after-t_before," s")
t_before = time.time()
t2.build( cube1)
t_after = time.time()
- print "build took ", t_after-t_before," s"
+ print("build took ", t_after-t_before," s")
#t.sort()
#t2.sort()
- print "calling diff()...",
+ print("calling diff()...",)
t_before = time.time()
#dt = t2.operation(1,t)
t2.diff(t)
t_after = time.time()
- print "done."
- print "diff took ", t_after-t_before," s"
+ print("done.")
+ print("diff took ", t_after-t_before," s")
- print "diff has ", t2.size()," nodes"
+ print("diff has ", t2.size()," nodes")
@@ -215,7 +215,7 @@
# original trees
- print "drawing trees"
+ print("drawing trees")
drawTree2(myscreen,t,opacity=1, color=camvtk.green)
drawTree2(myscreen,t2,opacity=0.2, color=camvtk.cyan)
drawTree2(myscreen,t2,opacity=1, color=camvtk.cyan, offset=(5,0,0))
@@ -243,7 +243,7 @@
##camvtk.Cylinder(center=(pmin.x,pmin.y,pmin.z), radius=0.1, color=camvtk.pink)
"""
- for n in xrange(0,30):
+ for n in range(0,30):
tp = ocl.Point(2.5,2.5,2-n*0.3)
tpc = camvtk.black
if (cylvol.isInside(tp)):
@@ -312,9 +312,9 @@
#st4.SetPos( (50, 100) )
#myscreen.addActor( st4)
- print " render()...",
+ print(" render()...",)
myscreen.render()
- print "done."
+ print("done.")
lwr.SetFileName(filename)
time.sleep(0.2)
#lwr.Write()
diff -Nru opencamlib-11.10+git201801200005~ubuntu16.04.1/src/attic/ocode/ocode_cylcutter_volume_4.py opencamlib-11.10-1/src/attic/ocode/ocode_cylcutter_volume_4.py
--- opencamlib-11.10+git201801200005~ubuntu16.04.1/src/attic/ocode/ocode_cylcutter_volume_4.py 2018-01-20 00:05:22.000000000 +0000
+++ opencamlib-11.10-1/src/attic/ocode/ocode_cylcutter_volume_4.py 2020-06-14 12:13:19.000000000 +0000
@@ -22,17 +22,17 @@
#cube.SetWireframe()
myscreen.addActor( cube )
if (nmax>100):
- print "i=", i
- print "div=", (float(nmax)/10)
+ print("i=", i)
+ print("div=", (float(nmax)/10))
if ( (i % (float(nmax)/10))==0):
- print ".",
+ print(".",)
i=i+1
- print "done."
+ print("done.")
def drawTree2(myscreen,t,color=camvtk.red,opacity=0.2, offset=(0,0,0)):
nodes = t.get_nodes()
nmax=len(nodes)
- print "drawTree2: ", nmax," nodes",
+ print("drawTree2: ", nmax," nodes",)
# make a list of triangles
tlist = []
i=0
@@ -65,7 +65,7 @@
tlist.append(ocl.Triangle(p4,p6,p2))
if (nmax>100):
if ( (i % (nmax/10))==0):
- print ".",
+ print(".",)
i=i+1
#tlist.append(ocl.Triangle(p1,p2,p4))
@@ -73,13 +73,13 @@
#tlist.append(ocl.Triangle(p2,p3,p7))
#tlist.append(ocl.Triangle(p2,p7,p8))
#tlist.append(ocl.Triangle(p3,p7,p8))
- print ".actor.",
+ print(".actor.",)
surf = camvtk.STLSurf(triangleList=tlist)
surf.SetColor(color)
surf.SetOpacity(opacity)
- print ".add.",
+ print(".add.",)
myscreen.addActor(surf)
- print ".done."
+ print(".done.")
def drawCylCutter(myscreen, c, p):
cyl = camvtk.Cylinder(center=(p.x,p.y,p.z), radius=c.radius,
@@ -91,7 +91,7 @@
def main(filename="frame/f.png",yc=6, n=0):
- print ocl.revision()
+ print(ocl.revision())
f=ocl.Ocode()
f.set_depth(7) # depth and scale set here.
@@ -128,12 +128,12 @@
t.init(5)
t2.init(4)
- print " after init() t :", t.str()
- print " after init() t2 :", t2.str()
+ print(" after init() t :", t.str())
+ print(" after init() t2 :", t2.str())
c = ocl.CylCutter(1) # cutter
c.length = 3
- print "cutter length=", c.length
+ print("cutter length=", c.length)
p1 = ocl.Point(-0.2,-0.2,0.2) # start of move
p2 = ocl.Point(1.5,1.5,-1) # end of move
@@ -186,29 +186,29 @@
t_before = time.time()
t.build( g1vol )
t_after = time.time()
- print "g1 build took ", t_after-t_before," s"
+ print("g1 build took ", t_after-t_before," s")
# build cube
t_before = time.time()
t2.build( cube1 )
t_after = time.time()
- print "cube build took ", t_after-t_before," s"
+ print("cube build took ", t_after-t_before," s")
#t.sort()
#t2.sort()
- print "calling diff()...",
+ print("calling diff()...",)
t_before = time.time()
#dt = t2.operation(1,t)
t2.diff(t)
t_after = time.time()
- print "done."
- print "diff took ", t_after-t_before," s"
+ print("done.")
+ print("diff took ", t_after-t_before," s")
- print "diff has ", t2.size()," nodes"
+ print("diff has ", t2.size()," nodes")
# original trees
- print "drawing trees"
+ print("drawing trees")
drawTree2(myscreen,t,opacity=1, color=camvtk.green)
drawTree2(myscreen,t2,opacity=0.2, color=camvtk.cyan)
drawTree2(myscreen,t2,opacity=1, color=camvtk.cyan, offset=(5,0,0))
@@ -228,9 +228,9 @@
title.SetText("OpenCAMLib " + datetime.datetime.now().strftime("%Y-%m-%d %H:%M:%S"))
myscreen.addActor(title)
- print " render()...",
+ print(" render()...",)
myscreen.render()
- print "done."
+ print("done.")
lwr.SetFileName(filename)
time.sleep(0.2)
#lwr.Write()
diff -Nru opencamlib-11.10+git201801200005~ubuntu16.04.1/src/attic/ocode/ocode_cylcutter_volume.py opencamlib-11.10-1/src/attic/ocode/ocode_cylcutter_volume.py
--- opencamlib-11.10+git201801200005~ubuntu16.04.1/src/attic/ocode/ocode_cylcutter_volume.py 2018-01-20 00:05:22.000000000 +0000
+++ opencamlib-11.10-1/src/attic/ocode/ocode_cylcutter_volume.py 2020-06-14 12:13:19.000000000 +0000
@@ -24,14 +24,14 @@
#cube.SetWireframe()
myscreen.addActor( cube )
if ( (i % (nmax/10))==0):
- print ".",
+ print(".",)
i=i+1
- print "done."
+ print("done.")
def drawTree2(myscreen,t,color=camvtk.red,opacity=0.2, offset=(0,0,0)):
nodes = t.get_nodes()
nmax=len(nodes)
- print "drawTree2: ", nmax," nodes",
+ print("drawTree2: ", nmax," nodes",)
# make a list of triangles
tlist = []
i=0
@@ -62,7 +62,7 @@
tlist.append(ocl.Triangle(p1,p2,p4)) # 1,2,4,6
tlist.append(ocl.Triangle(p4,p6,p2))
if ( (i % (nmax/10))==0):
- print ".",
+ print(".",)
i=i+1
#tlist.append(ocl.Triangle(p1,p2,p4))
@@ -70,7 +70,7 @@
#tlist.append(ocl.Triangle(p2,p3,p7))
#tlist.append(ocl.Triangle(p2,p7,p8))
#tlist.append(ocl.Triangle(p3,p7,p8))
- print "done"
+ print("done")
surf = camvtk.STLSurf(triangleList=tlist)
surf.SetColor(color)
surf.SetOpacity(opacity)
@@ -129,12 +129,12 @@
"""
dl = myscreen.GetLights()
- print "original default light:"
- print dl
- print "nextitem()"
+ print("original default light:")
+ print(dl)
+ print("nextitem()")
l1 = dl.GetNextItem()
- print " light:"
- print l1
+ print(" light:")
+ print(l1)
#print myscreen.GetLights()
lights = vtk.vtkLightCollection()
@@ -152,16 +152,16 @@
#myscreen.SetLightCollection(lights)
llist = myscreen.GetLights()
li = llist.GetNextItem()
- print " new list of lights:"
- print li
+ print(" new list of lights:")
+ print(li)
#for li in llist:
- # print li
- print " newly created light:"
- print l
+ # print(li)
+ print(" newly created light:")
+ print(l)
dl = myscreen.GetLights()
- print "NEW light:"
- print dl
+ print("NEW light:")
+ print(dl)
"""
t = ocl.LinOCT()
@@ -174,8 +174,8 @@
#myscreen.iren.Start()
#exit()
- print " after init() t :", t.str()
- print " after init() t2 :", t2.str()
+ print(" after init() t :", t.str())
+ print(" after init() t2 :", t2.str())
# sphere
svol = ocl.SphereOCTVolume()
@@ -205,7 +205,7 @@
c = ocl.CylCutter(2)
c.length = 3
- print "cutter length=", c.length
+ print("cutter length=", c.length)
p1 = ocl.Point(-1,-2,0)
p2 = ocl.Point(1,2.0,0)
g1vol = ocl.CylMoveOCTVolume(c, p1, p2)
@@ -232,9 +232,9 @@
t.build( g1vol )
t2.build( cube1)
- print "calling diff()...",
+ print("calling diff()...",)
dt = t2.operation(1,t)
- print "done."
+ print("done.")
# set Cylinde bounding-box
"""
@@ -262,7 +262,7 @@
drawTree2(myscreen,dt,opacity=1, color=camvtk.cyan, offset=(5,0,0))
"""
- for n in xrange(0,30):
+ for n in range(0,30):
tp = ocl.Point(2.5,2.5,2-n*0.3)
tpc = camvtk.black
if (cylvol.isInside(tp)):
@@ -331,9 +331,9 @@
#st4.SetPos( (50, 100) )
#myscreen.addActor( st4)
- print " render()...",
+ print(" render()...",)
myscreen.render()
- print "done."
+ print("done.")
lwr.SetFileName(filename)
time.sleep(0.2)
#lwr.Write()
diff -Nru opencamlib-11.10+git201801200005~ubuntu16.04.1/src/attic/ocode/ocode_movie1.py opencamlib-11.10-1/src/attic/ocode/ocode_movie1.py
--- opencamlib-11.10+git201801200005~ubuntu16.04.1/src/attic/ocode/ocode_movie1.py 2018-01-20 00:05:22.000000000 +0000
+++ opencamlib-11.10-1/src/attic/ocode/ocode_movie1.py 2020-06-14 12:13:19.000000000 +0000
@@ -31,7 +31,7 @@
#black = black+1
#print black," black nodes"
"""
- for m in xrange(0,9):
+ for m in range(0,9):
cen = n.corner(m)
sph = camvtk.Sphere( center=(cen.x, cen.y, cen.z), radius=0.5, color=camvtk.green)
myscreen.addActor(sph)
@@ -67,8 +67,8 @@
t.init(3)
t2.init(3)
- print " after init() t :", t.str()
- print " after init() t2 :", t2.str()
+ print(" after init() t :", t.str())
+ print(" after init() t2 :", t2.str())
svol = ocl.SphereOCTVolume()
svol.radius=3
@@ -82,44 +82,44 @@
cube2.center = ocl.Point(1,2,0)
cube2.side = 30
- print "t build()"
+ print("t build()" )
t.build(svol)
- print " t after build() ", t.size()
+ print(" t after build() ", t.size())
t.condense()
- print " t after condense() ", t.size()
+ print(" t after condense() ", t.size())
- print "t2 build()"
+ print("t2 build()" )
t2.build(cube1)
- print " t2 after build() ", t2.size()
+ print(" t2 after build() ", t2.size())
t2.condense()
- print " t2 after condense() ", t2.size()
+ print(" t2 after condense() ", t2.size() )
# original trees
drawTree(myscreen,t,opacity=1, color=camvtk.green)
drawTree(myscreen,t2,opacity=1, color=camvtk.red)
- print " diff12()...",
+ print(" diff12()...",)
t3 = t2.operation(1,t)
- print "done."
+ print("done.")
- print " diff21()...",
+ print(" diff21()...",)
t4 = t2.operation(2,t)
- print "done."
+ print("done.")
- print " intersection()...",
+ print(" intersection()...",)
t5 = t2.operation(3,t)
- print "done."
+ print("done.")
- print " sum()...",
+ print(" sum()...",)
t6 = t2.operation(4,t)
- print "done."
+ print("done.")
- print " difference 1-2 t3 (blue) =", t3.size()
- print " difference 2-1 t4 (yellow)=", t4.size()
- print " intersection t5 (pink) =", t5.size()
- print " union t6 (grey) =", t6.size()
+ print(" difference 1-2 t3 (blue) =", t3.size())
+ print(" difference 2-1 t4 (yellow)=", t4.size())
+ print(" intersection t5 (pink) =", t5.size())
+ print(" union t6 (grey) =", t6.size())
drawTree(myscreen,t3,opacity=1, color=camvtk.blue, offset=(0,15,0))
drawTree(myscreen,t4,opacity=1, color=camvtk.yellow,offset=(0,-15,0))
diff -Nru opencamlib-11.10+git201801200005~ubuntu16.04.1/src/attic/ocode/ocode_test1.py opencamlib-11.10-1/src/attic/ocode/ocode_test1.py
--- opencamlib-11.10+git201801200005~ubuntu16.04.1/src/attic/ocode/ocode_test1.py 2018-01-20 00:05:22.000000000 +0000
+++ opencamlib-11.10-1/src/attic/ocode/ocode_test1.py 2020-06-14 12:13:19.000000000 +0000
@@ -5,7 +5,7 @@
def printNodes(t):
nodes = t.get_nodes()
for n in nodes:
- print n.str(), " c=",n.color
+ print(n.str(), " c=",n.color)
def drawTree(myscreen,t,color=camvtk.red,opacity=0.2):
nodes = t.get_nodes()
@@ -30,9 +30,9 @@
cube.SetOpacity(opacity)
myscreen.addActor( cube )
#black = black+1
- print black," black nodes"
+ print(black," black nodes")
"""
- for m in xrange(0,9):
+ for m in range(0,9):
cen = n.corner(m)
sph = camvtk.Sphere( center=(cen.x, cen.y, cen.z), radius=0.5, color=camvtk.green)
myscreen.addActor(sph)
diff -Nru opencamlib-11.10+git201801200005~ubuntu16.04.1/src/attic/ocode/ocode_test2.py opencamlib-11.10-1/src/attic/ocode/ocode_test2.py
--- opencamlib-11.10+git201801200005~ubuntu16.04.1/src/attic/ocode/ocode_test2.py 2018-01-20 00:05:22.000000000 +0000
+++ opencamlib-11.10-1/src/attic/ocode/ocode_test2.py 2020-06-14 12:13:19.000000000 +0000
@@ -5,7 +5,7 @@
def printNodes(t):
nodes = t.get_nodes()
for n in nodes:
- print n.str()
+ print(n.str())
def drawTree(myscreen,t,color=camvtk.red,opacity=0.2, offset=(0,0,0)):
nodes = t.get_nodes()
@@ -32,7 +32,7 @@
#black = black+1
#print black," black nodes"
"""
- for m in xrange(0,9):
+ for m in range(0,9):
cen = n.corner(m)
sph = camvtk.Sphere( center=(cen.x, cen.y, cen.z), radius=0.5, color=camvtk.green)
myscreen.addActor(sph)
diff -Nru opencamlib-11.10+git201801200005~ubuntu16.04.1/src/attic/ocode/ocode_test3.py opencamlib-11.10-1/src/attic/ocode/ocode_test3.py
--- opencamlib-11.10+git201801200005~ubuntu16.04.1/src/attic/ocode/ocode_test3.py 2018-01-20 00:05:22.000000000 +0000
+++ opencamlib-11.10-1/src/attic/ocode/ocode_test3.py 2020-06-14 12:13:19.000000000 +0000
@@ -5,7 +5,7 @@
def printNodes(t):
nodes = t.get_nodes()
for n in nodes:
- print n.str()
+ print(n.str())
def drawTree(myscreen,t,color=camvtk.red,opacity=0.2, offset=(0,0,0)):
nodes = t.get_nodes()
@@ -32,7 +32,7 @@
#black = black+1
#print black," black nodes"
"""
- for m in xrange(0,9):
+ for m in range(0,9):
cen = n.corner(m)
sph = camvtk.Sphere( center=(cen.x, cen.y, cen.z), radius=0.5, color=camvtk.green)
myscreen.addActor(sph)
diff -Nru opencamlib-11.10+git201801200005~ubuntu16.04.1/src/attic/ocode.cpp opencamlib-11.10-1/src/attic/ocode.cpp
--- opencamlib-11.10+git201801200005~ubuntu16.04.1/src/attic/ocode.cpp 2018-01-20 00:05:22.000000000 +0000
+++ opencamlib-11.10-1/src/attic/ocode.cpp 2020-06-14 12:13:19.000000000 +0000
@@ -1,21 +1,22 @@
/* $Id$
*
- * Copyright 2010 Anders Wallin (anders.e.e.wallin "at" gmail.com)
+ * Copyright (c) 2010 Anders Wallin (anders.e.e.wallin "at" gmail.com).
*
- * This file is part of OpenCAMlib.
- *
- * OpenCAMlib is free software: you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation, either version 3 of the License, or
+ * This file is part of OpenCAMlib
+ * (see https://github.com/aewallin/opencamlib).
+ *
+ * This program 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.
- *
- * OpenCAMlib is distributed in the hope that it will be useful,
+ *
+ * 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 General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with OpenCAMlib. If not, see .
+ * GNU Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * along with this program. If not, see .
*/
#include
@@ -275,7 +276,7 @@
/*
- * /// return correspinding number
+ * /// return corresponding number
unsigned long Ocode::number() const {
unsigned long n=0;
for (int m=0;m.
+ * GNU Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * along with this program. If not, see .
*/
#ifndef OCODE_H
diff -Nru opencamlib-11.10+git201801200005~ubuntu16.04.1/src/attic/octree.cpp opencamlib-11.10-1/src/attic/octree.cpp
--- opencamlib-11.10+git201801200005~ubuntu16.04.1/src/attic/octree.cpp 2018-01-20 00:05:22.000000000 +0000
+++ opencamlib-11.10-1/src/attic/octree.cpp 2020-06-14 12:13:19.000000000 +0000
@@ -1,21 +1,22 @@
/* $Id$
*
- * Copyright 2010 Anders Wallin (anders.e.e.wallin "at" gmail.com)
+ * Copyright (c) 2010 Anders Wallin (anders.e.e.wallin "at" gmail.com).
*
- * This file is part of OpenCAMlib.
- *
- * OpenCAMlib is free software: you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation, either version 3 of the License, or
+ * This file is part of OpenCAMlib
+ * (see https://github.com/aewallin/opencamlib).
+ *
+ * This program 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.
- *
- * OpenCAMlib is distributed in the hope that it will be useful,
+ *
+ * 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 General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with OpenCAMlib. If not, see .
+ * GNU Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * along with this program. If not, see .
*/
diff -Nru opencamlib-11.10+git201801200005~ubuntu16.04.1/src/attic/octree.h opencamlib-11.10-1/src/attic/octree.h
--- opencamlib-11.10+git201801200005~ubuntu16.04.1/src/attic/octree.h 2018-01-20 00:05:22.000000000 +0000
+++ opencamlib-11.10-1/src/attic/octree.h 2020-06-14 12:13:19.000000000 +0000
@@ -1,21 +1,22 @@
/* $Id$
*
- * Copyright 2010 Anders Wallin (anders.e.e.wallin "at" gmail.com)
+ * Copyright (c) 2010 Anders Wallin (anders.e.e.wallin "at" gmail.com).
*
- * This file is part of OpenCAMlib.
- *
- * OpenCAMlib is free software: you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation, either version 3 of the License, or
+ * This file is part of OpenCAMlib
+ * (see https://github.com/aewallin/opencamlib).
+ *
+ * This program 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.
- *
- * OpenCAMlib is distributed in the hope that it will be useful,
+ *
+ * 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 General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with OpenCAMlib. If not, see .
+ * GNU Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * along with this program. If not, see .
*/
#ifndef OCTREE_H
diff -Nru opencamlib-11.10+git201801200005~ubuntu16.04.1/src/attic/oct_test1.py opencamlib-11.10-1/src/attic/oct_test1.py
--- opencamlib-11.10+git201801200005~ubuntu16.04.1/src/attic/oct_test1.py 2018-01-20 00:05:22.000000000 +0000
+++ opencamlib-11.10-1/src/attic/oct_test1.py 2020-06-14 12:13:19.000000000 +0000
@@ -24,7 +24,7 @@
node = OCTNode( level, center = nodecenter , type = 1, childlist=None)
flags = []
- for n in xrange(0,9): # test all points
+ for n in range(0,9): # test all points
flags.append( volume.isInside( node.nodePoint(n) ) )
if (sum(flags) == 0): # nothing is inside
@@ -44,7 +44,7 @@
# have to subdivide:
childs = []
child_centers = []
- for n in xrange(1,9):
+ for n in range(1,9):
child_center = node.childCenter(n)
childs.append( buildOCTree( volume , nodecenter = child_center, level= level+1) )
node.setChildren(childs)
@@ -121,7 +121,7 @@
return # don't draw intermediate nodes
p = []
- for n in xrange(1,9):
+ for n in range(1,9):
p1 = oct.nodePoint(n)
p.append(p1)
@@ -172,14 +172,14 @@
testvol = Volume()
- print "building tree...",
+ print("building tree...",)
tree = buildOCTree(testvol)
- print "done."
- print tree
+ print("done.")
+ print(tree)
list =[]
searchOCTree(tree, list)
- print len(list), " nodes in tree"
+ print(len(list), " nodes in tree")
w2if = vtk.vtkWindowToImageFilter()
w2if.SetInput(myscreen.renWin)
@@ -205,7 +205,7 @@
t.SetText("OpenCAMLib 10.03-beta " + datetime.datetime.now().strftime("%Y-%m-%d %H:%M:%S"))
myscreen.render()
myscreen.camera.Azimuth( 3 )
- print "frame %i of %i" % (n, len(list))
+ print("frame %i of %i" % (n, len(list)))
w2if.Modified()
lwr.SetFileName("frames/oct"+ ('%05d' % n)+".png")
#lwr.Write()
@@ -215,7 +215,7 @@
- print "done!"
+ print("done!")
myscreen.render()
diff -Nru opencamlib-11.10+git201801200005~ubuntu16.04.1/src/attic/oct_test2.py opencamlib-11.10-1/src/attic/oct_test2.py
--- opencamlib-11.10+git201801200005~ubuntu16.04.1/src/attic/oct_test2.py 2018-01-20 00:05:22.000000000 +0000
+++ opencamlib-11.10-1/src/attic/oct_test2.py 2020-06-14 12:13:19.000000000 +0000
@@ -24,7 +24,7 @@
node = OCTNode( level, center = nodecenter , type = 1, childlist=None)
flags = []
- for n in xrange(0,9): # test all points
+ for n in range(0,9): # test all points
flags.append( volume.isInside( node.nodePoint(n) ) )
if (sum(flags) == 0): # nothing is inside
@@ -44,7 +44,7 @@
# have to subdivide:
childs = []
child_centers = []
- for n in xrange(1,9):
+ for n in range(1,9):
child_center = node.childCenter(n)
childs.append( buildOCTree( volume , nodecenter = child_center, level= level+1) )
node.setChildren(childs)
@@ -83,7 +83,7 @@
return # don't draw intermediate nodes
p = []
- for n in xrange(1,9):
+ for n in range(1,9):
p1 = oct.nodePoint(n)
p.append(p1)
@@ -125,21 +125,21 @@
myscreen.camera.SetPosition(5, 3, 2)
myscreen.camera.SetFocalPoint(0,0, 0)
- print oct.str()
+ print(oct.str())
"""
- print "max scale=", oct.get_max_scale()
- for n in xrange(0,9):
+ print("max scale=", oct.get_max_scale())
+ for n in range(0,9):
p1 = oct.nodePoint(n)
myscreen.addActor( camvtk.Sphere(center=(p1.x, p1.y, p1.z), radius=0.1, color=camvtk.red))
- print "id=%i" % (n),
- print p1.str()
+ print("id=%i" % (n),)
+ print(p1.str())
- print "child centers:"
- for n in xrange(1,9):
+ print("child centers:")
+ for n in range(1,9):
p1 = oct.childCenter(n)
myscreen.addActor( camvtk.Sphere(center=(p1.x, p1.y, p1.z), radius=0.1, color=camvtk.yellow))
- print "id=%i" % (n),
- print p1.str()
+ print("id=%i" % (n),)
+ print(p1.str())
"""
@@ -155,10 +155,10 @@
nlist = oc2.get_all_nodes()
- print "got ", len(nlist), " nodes"
+ print("got ", len(nlist), " nodes")
for node in nlist:
- print node.str()
+ print(node.str())
if node.type == cam.OCType.WHITE:
sph_color = camvtk.white
if node.type == cam.OCType.BLACK:
@@ -173,14 +173,14 @@
testvol = Volume()
- print "building tree...",
+ print("building tree...",)
tree = buildOCTree(testvol)
- print "done."
- print tree
+ print("done.")
+ print(tree)
list =[]
searchOCTree(tree, list)
- print len(list), " nodes in tree"
+ print(len(list), " nodes in tree")
w2if = vtk.vtkWindowToImageFilter()
w2if.SetInput(myscreen.renWin)
@@ -206,7 +206,7 @@
t.SetText("OpenCAMLib 10.03-beta " + datetime.datetime.now().strftime("%Y-%m-%d %H:%M:%S"))
myscreen.render()
myscreen.camera.Azimuth( 3 )
- print "frame %i of %i" % (n, len(list))
+ print("frame %i of %i" % (n, len(list)))
w2if.Modified()
lwr.SetFileName("frames/oct"+ ('%05d' % n)+".png")
#lwr.Write()
@@ -216,7 +216,7 @@
- print "done!"
+ print("done!")
#raw_input("Press Enter to terminate")
diff -Nru opencamlib-11.10+git201801200005~ubuntu16.04.1/src/attic/oct_test3.py opencamlib-11.10-1/src/attic/oct_test3.py
--- opencamlib-11.10+git201801200005~ubuntu16.04.1/src/attic/oct_test3.py 2018-01-20 00:05:22.000000000 +0000
+++ opencamlib-11.10-1/src/attic/oct_test3.py 2020-06-14 12:13:19.000000000 +0000
@@ -24,7 +24,7 @@
node = OCTNode( level, center = nodecenter , type = 1, childlist=None)
flags = []
- for n in xrange(0,9): # test all points
+ for n in range(0,9): # test all points
flags.append( volume.isInside( node.nodePoint(n) ) )
if (sum(flags) == 0): # nothing is inside
@@ -44,7 +44,7 @@
# have to subdivide:
childs = []
child_centers = []
- for n in xrange(1,9):
+ for n in range(1,9):
child_center = node.childCenter(n)
childs.append( buildOCTree( volume , nodecenter = child_center, level= level+1) )
node.setChildren(childs)
@@ -84,7 +84,7 @@
if node.type == cam.OCType.GREY:
return # don't draw intermediate nodes
p = []
- for n in xrange(1,9):
+ for n in range(1,9):
p1 = node.nodePoint(n)
p.append(p1)
@@ -124,12 +124,12 @@
if node.type == cam.OCType.GREY:
return # don't draw intermediate nodes
p = []
- for n in xrange(1,9):
+ for n in range(1,9):
p1 = node.nodePoint(n)
p.append(p1)
lines = []
- for n in xrange(0,8):
+ for n in range(0,8):
lines.append ( camvtk.Point(center=(p[n].x,p[n].y,p[n].z) ) )
if node.type == cam.OCType.WHITE:
@@ -185,19 +185,19 @@
#print oct.str()
"""
- print "max scale=", oct.get_max_scale()
- for n in xrange(0,9):
+ print("max scale=", oct.get_max_scale())
+ for n in range(0,9):
p1 = oct.nodePoint(n)
myscreen.addActor( camvtk.Sphere(center=(p1.x, p1.y, p1.z), radius=0.1, color=camvtk.red))
- print "id=%i" % (n),
- print p1.str()
+ print("id=%i" % (n),)
+ print(p1.str())
- print "child centers:"
- for n in xrange(1,9):
+ print("child centers:")
+ for n in range(1,9):
p1 = oct.childCenter(n)
myscreen.addActor( camvtk.Sphere(center=(p1.x, p1.y, p1.z), radius=0.1, color=camvtk.yellow))
- print "id=%i" % (n),
- print p1.str()
+ print("id=%i" % (n),)
+ print(p1.str())
"""
@@ -240,29 +240,29 @@
iters = oc2.prune_all()
nlist = oc2.get_all_nodes()
- print " oc2 got ", len(nlist), " nodes"
+ print(" oc2 got ", len(nlist), " nodes")
nlist = oc2.get_white_nodes()
- print " oc2 got ", len(nlist), " white nodes"
+ print(" oc2 got ", len(nlist), " white nodes")
nlist = oc3.get_all_nodes()
- print " oc3 got ", len(nlist), " nodes"
+ print(" oc3 got ", len(nlist), " nodes")
- print "calling balance"
+ print("calling balance")
oc2.balance(oc3)
- print "after balance:"
+ print("after balance:")
nlist = oc2.get_all_nodes()
- print " oc2 got ", len(nlist), " nodes"
+ print(" oc2 got ", len(nlist), " nodes")
nlist = oc2.get_white_nodes()
- print " oc2 got ", len(nlist), " white nodes"
- print "calling diff"
+ print(" oc2 got ", len(nlist), " white nodes")
+ print("calling diff")
oc2.diff(oc3)
- print "after diff:"
+ print("after diff:")
nlist = oc2.get_all_nodes()
- print " oc2 got ", len(nlist), " nodes"
+ print(" oc2 got ", len(nlist), " nodes")
nlist = oc2.get_white_nodes()
- print " oc2 got ", len(nlist), " white nodes"
+ print(" oc2 got ", len(nlist), " white nodes")
drawOCT(myscreen, oc2, camvtk.green)
#drawOCT(myscreen, oc3, camvtk.red, opacity=0.1)
@@ -300,14 +300,14 @@
testvol = Volume()
- print "building tree...",
+ print("building tree...",)
tree = buildOCTree(testvol)
- print "done."
- print tree
+ print("done.")
+ print(tree)
list =[]
searchOCTree(tree, list)
- print len(list), " nodes in tree"
+ print(len(list), " nodes in tree")
w2if = vtk.vtkWindowToImageFilter()
w2if.SetInput(myscreen.renWin)
@@ -333,7 +333,7 @@
t.SetText("OpenCAMLib 10.03-beta " + datetime.datetime.now().strftime("%Y-%m-%d %H:%M:%S"))
myscreen.render()
myscreen.camera.Azimuth( 3 )
- print "frame %i of %i" % (n, len(list))
+ print("frame %i of %i" % (n, len(list)))
w2if.Modified()
lwr.SetFileName("frames/oct"+ ('%05d' % n)+".png")
#lwr.Write()
@@ -343,7 +343,7 @@
- print "done!"
+ print("done!")
#raw_input("Press Enter to terminate")
diff -Nru opencamlib-11.10+git201801200005~ubuntu16.04.1/src/attic/pfinish.cpp opencamlib-11.10-1/src/attic/pfinish.cpp
--- opencamlib-11.10+git201801200005~ubuntu16.04.1/src/attic/pfinish.cpp 2018-01-20 00:05:22.000000000 +0000
+++ opencamlib-11.10-1/src/attic/pfinish.cpp 2020-06-14 12:13:19.000000000 +0000
@@ -1,19 +1,22 @@
-/* Copyright 2010 Anders Wallin (anders.e.e.wallin "at" gmail.com)
+/* $Id$
+ *
+ * Copyright (c) 2010 Anders Wallin (anders.e.e.wallin "at" gmail.com).
*
- * This file is part of OpenCAMlib.
- *
- * OpenCAMlib is free software: you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation, either version 3 of the License, or
+ * This file is part of OpenCAMlib
+ * (see https://github.com/aewallin/opencamlib).
+ *
+ * This program 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.
- *
- * OpenCAMlib is distributed in the hope that it will be useful,
+ *
+ * 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 General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with OpenCAMlib. If not, see .
+ * GNU Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * along with this program. If not, see .
*/
#include
#include
diff -Nru opencamlib-11.10+git201801200005~ubuntu16.04.1/src/attic/pfinish.h opencamlib-11.10-1/src/attic/pfinish.h
--- opencamlib-11.10+git201801200005~ubuntu16.04.1/src/attic/pfinish.h 2018-01-20 00:05:22.000000000 +0000
+++ opencamlib-11.10-1/src/attic/pfinish.h 2020-06-14 12:13:19.000000000 +0000
@@ -1,19 +1,22 @@
-/* Copyright 2010 Anders Wallin (anders.e.e.wallin "at" gmail.com)
+/* $Id$
+ *
+ * Copyright (c) 2010 Anders Wallin (anders.e.e.wallin "at" gmail.com).
*
- * This file is part of OpenCAMlib.
- *
- * OpenCAMlib is free software: you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation, either version 3 of the License, or
+ * This file is part of OpenCAMlib
+ * (see https://github.com/aewallin/opencamlib).
+ *
+ * This program 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.
- *
- * OpenCAMlib is distributed in the hope that it will be useful,
+ *
+ * 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 General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with OpenCAMlib. If not, see .
+ * GNU Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * along with this program. If not, see .
*/
#ifndef PFINISH_H
diff -Nru opencamlib-11.10+git201801200005~ubuntu16.04.1/src/attic/pfinish_tst_1.py opencamlib-11.10-1/src/attic/pfinish_tst_1.py
--- opencamlib-11.10+git201801200005~ubuntu16.04.1/src/attic/pfinish_tst_1.py 2018-01-20 00:05:22.000000000 +0000
+++ opencamlib-11.10-1/src/attic/pfinish_tst_1.py 2020-06-14 12:13:19.000000000 +0000
@@ -8,7 +8,7 @@
myscreen = camvtk.VTKScreen()
stl = camvtk.STLSurf("../stl/demo.stl")
- print "STL surface read"
+ print("STL surface read")
myscreen.addActor(stl)
stl.SetWireframe()
stl.SetColor((0.5,0.5,0.5))
@@ -16,7 +16,7 @@
polydata = stl.src.GetOutput()
s= ocl.STLSurf()
camvtk.vtkPolyData2OCLSTL(polydata, s)
- print "STLSurf with ", s.size(), " triangles"
+ print("STLSurf with ", s.size(), " triangles")
cutter = ocl.CylCutter(0.6)
#print cutter.str()
@@ -40,12 +40,12 @@
pftp = cam.ParallelFinish()
pftp.initCLPoints(minx,dx,maxx,miny,dy,maxy,z)
pftp.dropCutterSTL1(cutter, s)
- print " made ", pftp.dcCalls, " drop-cutter calls"
+ print(" made ", pftp.dcCalls, " drop-cutter calls")
pf2 = cam.ParallelFinish()
pf2.initCLPoints(minx,dx,maxx,miny,dy,maxy,z)
pf2.dropCutterSTL2(cutter, s)
- print " made ", pf2.dcCalls, " drop-cutter calls"
+ print(" made ", pf2.dcCalls, " drop-cutter calls")
clpoints = pftp.getCLPoints()
ccpoints = pftp.getCCPoints()
@@ -89,8 +89,8 @@
#myscreen.addActor( camvtk.Point(center=(cc.x,cc.y,cc.z), color=col) )
#print cc.type
- print "none=",nn," vertex=",nv, " edge=",ne, " facet=",nf, " sum=", nn+nv+ne+nf
- print len(clpoints), " cl points evaluated"
+ print("none=",nn," vertex=",nv, " edge=",ne, " facet=",nf, " sum=", nn+nv+ne+nf)
+ print(len(clpoints), " cl points evaluated")
myscreen.camera.SetPosition(3, 23, 15)
myscreen.camera.SetFocalPoint(5, 5, 0)
myscreen.render()
diff -Nru opencamlib-11.10+git201801200005~ubuntu16.04.1/src/attic/pft_visitor.h opencamlib-11.10-1/src/attic/pft_visitor.h
--- opencamlib-11.10+git201801200005~ubuntu16.04.1/src/attic/pft_visitor.h 2018-01-20 00:05:22.000000000 +0000
+++ opencamlib-11.10-1/src/attic/pft_visitor.h 2020-06-14 12:13:19.000000000 +0000
@@ -1,21 +1,22 @@
/* $Id$
*
- * Copyright 2010 Anders Wallin (anders.e.e.wallin "at" gmail.com)
+ * Copyright (c) 2010 Anders Wallin (anders.e.e.wallin "at" gmail.com).
*
- * This file is part of OpenCAMlib.
- *
- * OpenCAMlib is free software: you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation, either version 3 of the License, or
+ * This file is part of OpenCAMlib
+ * (see https://github.com/aewallin/opencamlib).
+ *
+ * This program 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.
- *
- * OpenCAMlib is distributed in the hope that it will be useful,
+ *
+ * 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 General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with OpenCAMlib. If not, see .
+ * GNU Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * along with this program. If not, see .
*/
#ifndef PFT_VISITOR_H
diff -Nru opencamlib-11.10+git201801200005~ubuntu16.04.1/src/attic/waterline_4_weave.py opencamlib-11.10-1/src/attic/waterline_4_weave.py
--- opencamlib-11.10+git201801200005~ubuntu16.04.1/src/attic/waterline_4_weave.py 2018-01-20 00:05:22.000000000 +0000
+++ opencamlib-11.10-1/src/attic/waterline_4_weave.py 2020-06-14 12:13:19.000000000 +0000
@@ -6,7 +6,7 @@
import math
if __name__ == "__main__":
- print ocl.revision()
+ print(ocl.revision())
myscreen = camvtk.VTKScreen()
a = ocl.Point(0,1,0.3)
myscreen.addActor(camvtk.Point(center=(a.x,a.y,a.z), color=(1,0,1)))
@@ -25,7 +25,7 @@
#cutter = ocl.BallCutter(0.4, 5)
cutter = ocl.BullCutter(0.4, 0.1, 5)
- print "fiber..."
+ print("fiber...")
zh = 0.23
@@ -42,7 +42,7 @@
awl.run()
t_after = time.time()
calctime = t_after-t_before
- print " AdaptiveWaterline done in ", calctime," s"
+ print(" AdaptiveWaterline done in ", calctime," s")
xfibers = awl.getXFibers()
#print " got ", len(xf)," x-fibers"
yfibers = awl.getYFibers()
@@ -50,29 +50,29 @@
fibers = xfibers+yfibers
- print " got ",len(xfibers)," xfibers"
- print " got ",len(yfibers)," yfibers"
- print "rendering fibers and CL-points."
+ print(" got ",len(xfibers)," xfibers")
+ print(" got ",len(yfibers)," yfibers")
+ print("rendering fibers and CL-points.")
w = ocl.Weave()
- print "push fibers to Weave...",
+ print("push fibers to Weave...",)
for f in fibers:
w.addFiber(f)
- print "done."
- print "Weave build()...",
+ print("done.")
+ print("Weave build()...",)
w.build()
- print "done"
- print "face_traverse..."
+ print("done")
+ print("face_traverse...")
w.face_traverse()
- print "done."
+ print("done.")
w_clpts = w.getCLPoints()
w_ipts = w.getIPoints()
w_edges = w.getEdges()
w_loop = w.getLoops()
- print " weave: got ", len(w_clpts)," CL-points and ", len(w_ipts)," internal points"
+ print(" weave: got ", len(w_clpts)," CL-points and ", len(w_ipts)," internal points")
- print " got: ", len(w_edges), " edges"
- print " got: ", len(w_loop), " loop points"
+ print(" got: ", len(w_edges), " edges")
+ print(" got: ", len(w_loop), " loop points")
#zoffset = 0.0
#for p in w_clpts:
# myscreen.addActor( camvtk.Sphere(center=(p.x,p.y,p.z+zoffset), radius=0.0031, color=camvtk.red ) )
@@ -105,7 +105,7 @@
myscreen.addActor( camvtk.Line( p1=( p1.x,p1.y,p1.z+zoffset+ne*dzoffset2), p2=(p2.x,p2.y,p2.z+zoffset+ne*dzoffset2) ) )
ne = ne+1
- print "done."
+ print("done.")
myscreen.camera.SetPosition(0.5, 3, 2)
myscreen.camera.SetFocalPoint(0.5, 0.5, 0)
camvtk.drawArrows(myscreen,center=(-0.5,-0.5,-0.5))
diff -Nru opencamlib-11.10+git201801200005~ubuntu16.04.1/src/attic/weave.cpp opencamlib-11.10-1/src/attic/weave.cpp
--- opencamlib-11.10+git201801200005~ubuntu16.04.1/src/attic/weave.cpp 2018-01-20 00:05:22.000000000 +0000
+++ opencamlib-11.10-1/src/attic/weave.cpp 2020-06-14 12:13:19.000000000 +0000
@@ -1,21 +1,22 @@
/* $Id$
*
- * Copyright 2010 Anders Wallin (anders.e.e.wallin "at" gmail.com)
+ * Copyright (c) 2010 Anders Wallin (anders.e.e.wallin "at" gmail.com).
*
- * This file is part of OpenCAMlib.
- *
- * OpenCAMlib is free software: you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation, either version 3 of the License, or
+ * This file is part of OpenCAMlib
+ * (see https://github.com/aewallin/opencamlib).
+ *
+ * This program 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.
- *
- * OpenCAMlib is distributed in the hope that it will be useful,
+ *
+ * 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 General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with OpenCAMlib. If not, see .
+ * GNU Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * along with this program. If not, see .
*/
#include
diff -Nru opencamlib-11.10+git201801200005~ubuntu16.04.1/src/attic/weave.h opencamlib-11.10-1/src/attic/weave.h
--- opencamlib-11.10+git201801200005~ubuntu16.04.1/src/attic/weave.h 2018-01-20 00:05:22.000000000 +0000
+++ opencamlib-11.10-1/src/attic/weave.h 2020-06-14 12:13:19.000000000 +0000
@@ -1,21 +1,22 @@
/* $Id$
*
- * Copyright 2010 Anders Wallin (anders.e.e.wallin "at" gmail.com)
+ * Copyright (c) 2010 Anders Wallin (anders.e.e.wallin "at" gmail.com).
*
- * This file is part of OpenCAMlib.
- *
- * OpenCAMlib is free software: you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation, either version 3 of the License, or
+ * This file is part of OpenCAMlib
+ * (see https://github.com/aewallin/opencamlib).
+ *
+ * This program 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.
- *
- * OpenCAMlib is distributed in the hope that it will be useful,
+ *
+ * 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 General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with OpenCAMlib. If not, see .
+ * GNU Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * along with this program. If not, see .
*/
#ifndef WEAVE_H
#define WEAVE_H
diff -Nru opencamlib-11.10+git201801200005~ubuntu16.04.1/src/attic/weave_py.h opencamlib-11.10-1/src/attic/weave_py.h
--- opencamlib-11.10+git201801200005~ubuntu16.04.1/src/attic/weave_py.h 2018-01-20 00:05:22.000000000 +0000
+++ opencamlib-11.10-1/src/attic/weave_py.h 1970-01-01 00:00:00.000000000 +0000
@@ -1,101 +0,0 @@
-/* $Id$
- *
- * Copyright 2010 Anders Wallin (anders.e.e.wallin "at" gmail.com)
- *
- * This file is part of OpenCAMlib.
- *
- * OpenCAMlib is free software: you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation, either version 3 of the License, or
- * (at your option) any later version.
- *
- * OpenCAMlib 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 General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with OpenCAMlib. If not, see .
-*/
-#ifndef WEAVE_PY_H
-#define WEAVE_PY_H
-
-#include // for py
-#include // for py
-
-#include "weave.h"
-
-namespace ocl
-{
-
-/// Python wrapper for Weave
-class Weave_py : public Weave {
- public:
- Weave_py() : Weave() {};
- // PYTHON
- /// return graph components to python
- boost::python::list get_components() {
- boost::python::list wlist;
- std::vector weaves = split_components();
- BOOST_FOREACH( Weave w, weaves ) {
- wlist.append( w );
- }
- return wlist;
- };
- /// return CL-points to python
- boost::python::list getCLPoints() const {
- boost::python::list plist;
- VertexIterator it_begin, it_end, itr;
- boost::tie( it_begin, it_end ) = boost::vertices( g );
- for ( itr=it_begin ; itr != it_end ; ++itr ) {
- if ( g[*itr].type == CL )
- plist.append( g[*itr].position );
- }
- return plist;
- };
- /// return internal points to python
- boost::python::list getIPoints() const {
- boost::python::list plist;
- VertexIterator it_begin, it_end, itr;
- boost::tie( it_begin, it_end ) = boost::vertices( g );
- for ( itr=it_begin ; itr != it_end ; ++itr ) {
- if ( g[*itr].type == INT )
- plist.append( g[*itr].position );
- }
- return plist;
- };
- /// return edges to python
- /// format is [ [p1,p2] , [p3,p4] , ... ]
- boost::python::list getEdges() const {
- boost::python::list edge_list;
- EdgeIterator it_begin, it_end, itr;
- boost::tie( it_begin, it_end ) = boost::edges( g );
- for ( itr=it_begin ; itr != it_end ; ++itr ) { // loop through each edge
- if ( ! boost::get( boost::edge_color, g, *itr ) ) {
- boost::python::list point_list; // the endpoints of each edge
- WeaveVertex v1 = boost::source( *itr, g );
- WeaveVertex v2 = boost::target( *itr, g );
- point_list.append(g[v1].position);
- point_list.append(g[v2].position);
- edge_list.append(point_list);
- }
- }
- return edge_list;
- };
- /// return loops to python
- boost::python::list py_getLoops() const {
- boost::python::list loop_list;
- BOOST_FOREACH( std::vector loop, loops ) {
- boost::python::list point_list;
- BOOST_FOREACH( WeaveVertex v, loop ) {
- point_list.append( g[v].position );
- }
- loop_list.append(point_list);
- }
- return loop_list;
- };
-};
-
-} // end namespace
-#endif
-// end file weave_py.h
diff -Nru opencamlib-11.10+git201801200005~ubuntu16.04.1/src/attic/weave_typedef.h opencamlib-11.10-1/src/attic/weave_typedef.h
--- opencamlib-11.10+git201801200005~ubuntu16.04.1/src/attic/weave_typedef.h 2018-01-20 00:05:22.000000000 +0000
+++ opencamlib-11.10-1/src/attic/weave_typedef.h 2020-06-14 12:13:19.000000000 +0000
@@ -1,21 +1,22 @@
/* $Id$
*
- * Copyright 2010-2011 Anders Wallin (anders.e.e.wallin "at" gmail.com)
+ * Copyright (c) 2010-2011 Anders Wallin (anders.e.e.wallin "at" gmail.com).
*
- * This file is part of OpenCAMlib.
- *
- * OpenCAMlib is free software: you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation, either version 3 of the License, or
+ * This file is part of OpenCAMlib
+ * (see https://github.com/aewallin/opencamlib).
+ *
+ * This program 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.
- *
- * OpenCAMlib is distributed in the hope that it will be useful,
+ *
+ * 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 General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with OpenCAMlib. If not, see .
+ * GNU Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * along with this program. If not, see .
*/
#ifndef WEAVE_TYPEDEF_H
#define WEAVE_TYPEDEF_H
diff -Nru opencamlib-11.10+git201801200005~ubuntu16.04.1/src/CMakeLists.txt opencamlib-11.10-1/src/CMakeLists.txt
--- opencamlib-11.10+git201801200005~ubuntu16.04.1/src/CMakeLists.txt 2018-01-20 00:05:22.000000000 +0000
+++ opencamlib-11.10-1/src/CMakeLists.txt 2020-06-14 12:13:19.000000000 +0000
@@ -1,18 +1,32 @@
project(OpenCamLib)
-cmake_minimum_required(VERSION 2.4)
+cmake_minimum_required(VERSION 3.9)
#set( CMAKE_SOURCE_DIR ${CMAKE_SOURCE_DIR} )
+set(CMAKE_VERBOSE_MAKEFILE ON)
if(COMMAND cmake_policy)
cmake_policy(SET CMP0003 NEW)
+ cmake_policy(SET CMP0025 NEW)
endif(COMMAND cmake_policy)
+#set (CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fsanitize=address -fno-omit-frame-pointer")
+if (CMAKE_VERSION VERSION_LESS "3.1")
+ if (CMAKE_CXX_COMPILER_ID STREQUAL "GNU")
+ set (CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=gnu++11")
+ endif ()
+else ()
+ set (CMAKE_CXX_STANDARD 11)
+endif ()
+
# some options to set what is built:
option(BUILD_CXX_LIB
"Build/install the pure c++ libocl library? " ON)
option(BUILD_PY_LIB
- "Build/install the python ocl library? " ON)
+ "Build/install the python ocl library? " OFF)
+
+option(BUILD_NODEJS_LIB
+ "Build/install the node.js ocl library? " OFF)
option(BUILD_DOC
"Build/install the ocl documentation? " ON)
@@ -20,6 +34,12 @@
option(USE_OPENMP
"Use OpenMP for parallel computation" ON)
+option(VERSION_STRING
+ "Set version string" OFF)
+
+option(USE_PY_3
+ "Use Python V3" OFF)
+
if (NOT BUILD_CXX_LIB)
message(STATUS " Note: will NOT build pure c++ library")
endif(NOT BUILD_CXX_LIB)
@@ -28,6 +48,10 @@
message(STATUS " Note: will NOT build python library")
endif(NOT BUILD_PY_LIB)
+if (NOT BUILD_EMSCRIPTEN_LIB)
+ message(STATUS " Note: will NOT build emscripten library")
+endif(NOT BUILD_EMSCRIPTEN_LIB)
+
if (NOT BUILD_DOC)
message(STATUS " Note: will NOT build ocl documentation")
endif(NOT BUILD_DOC)
@@ -36,65 +60,6 @@
include(gcc_version.cmake)
#
-# Figure out how to build and where to install the Python modules
-#
-
-find_program(PYTHON_EXECUTABLE NAMES python2)
-
-if (APPLE)
- # Ask Python to tell us it's include directory, if nobody else has
- if(NOT DEFINED PYTHON_INCLUDE_DIRS)
- execute_process(COMMAND ${PYTHON_EXECUTABLE} -c
- "from distutils.sysconfig import get_python_inc;print get_python_inc()"
- OUTPUT_VARIABLE PYTHON_INCLUDE_DIRS
- RESULT_VARIABLE PYTHON_INCLUDE_DIR_RESULT ERROR_QUIET)
- if(NOT PYTHON_INCLUDE_DIR_RESULT MATCHES 0)
- message(SEND_ERROR "Failed to determine PYTHON_INCLUDE_DIR")
- endif(NOT PYTHON_INCLUDE_DIR_RESULT MATCHES 0)
- endif(NOT DEFINED PYTHON_INCLUDE_DIRS)
-
- # Similar for the Python library
- if(NOT DEFINED PYTHON_LIBRARY)
- # Get the library path
- execute_process(COMMAND "${PYTHON_EXECUTABLE}" -c
- "from distutils import sysconfig;print sysconfig.get_config_var('LIBDIR')"
- OUTPUT_VARIABLE PYTHON_LIBRARY_DIR
- RESULT_VARIABLE PYTHON_LIBRARY_DIR_RESULT ERROR_QUIET)
- string(STRIP ${PYTHON_LIBRARY_DIR} PYTHON_LIBRARY_DIR)
- if(NOT PYTHON_LIBRARY_DIR_RESULT MATCHES 0)
- message(SEND_ERROR "Failed to determine PYTHON_LIBRARY")
- endif(NOT PYTHON_LIBRARY_DIR_RESULT MATCHES 0)
-
- # Get library filename - might not be safe to assume .dylib extension?
- execute_process(COMMAND "${PYTHON_EXECUTABLE}" -c
- "import sys;print 'libpython%d.%d.dylib'%sys.version_info[0:2]"
- OUTPUT_VARIABLE PYTHON_LIBRARY_FILE
- RESULT_VARIABLE PYTHON_LIBRARY_FILE_RESULT ERROR_QUIET)
- string(STRIP ${PYTHON_LIBRARY_FILE} PYTHON_LIBRARY_FILE)
- if(NOT PYTHON_LIBRARY_FILE_RESULT MATCHES 0)
- message(SEND_ERROR "Failed to determine PYTHON_LIBRARY")
- endif(NOT PYTHON_LIBRARY_FILE_RESULT MATCHES 0)
-
- set(PYTHON_LIBRARY "${PYTHON_LIBRARY_DIR}/${PYTHON_LIBRARY_FILE}")
- endif(NOT DEFINED PYTHON_LIBRARY)
-endif (APPLE)
-
-execute_process(
- COMMAND ${PYTHON_EXECUTABLE} -c "from distutils.sysconfig import get_python_lib; print get_python_lib(0,0,\"/usr/local\")"
- OUTPUT_VARIABLE Python_site_packages
- OUTPUT_STRIP_TRAILING_WHITESPACE
- ) # on Ubuntu 11.10 this outputs: /usr/local/lib/python2.7/dist-packages
-
-execute_process(
- COMMAND ${PYTHON_EXECUTABLE} -c "from distutils.sysconfig import get_python_lib; print get_python_lib(plat_specific=1,standard_lib=0,prefix=\"/usr/local\")"
- OUTPUT_VARIABLE Python_arch_packages
- OUTPUT_STRIP_TRAILING_WHITESPACE
- )
-
-find_package (PythonLibs 2 REQUIRED)
-include_directories(${PYTHON_INCLUDE_DIRS} )
-
-#
# Turn compiler warnings up to 11, at least with gcc. I don't know how to
# do this with other compilers we might support and I'm leaving it up to
# the relevant platform maintainers...
@@ -111,38 +76,27 @@
endif(GCC_4_6)
endif (UNIX)
-option(BUILD_TYPE
- "Build type: Release=ON/Debug=OFF " ON)
+# option(BUILD_TYPE
+# "Build type: Release=ON/Debug=OFF " ON)
-if (BUILD_TYPE)
- message(STATUS " CMAKE_BUILD_TYPE = Release")
- set(CMAKE_BUILD_TYPE Release)
-endif(BUILD_TYPE)
-
-if (NOT BUILD_TYPE)
- message(STATUS " CMAKE_BUILD_TYPE = Debug")
- set(CMAKE_BUILD_TYPE Debug)
-endif(NOT BUILD_TYPE)
+# if (BUILD_TYPE)
+# message(STATUS " CMAKE_BUILD_TYPE = Release")
+# set(CMAKE_BUILD_TYPE Release)
+# endif(BUILD_TYPE)
+
+# if (NOT BUILD_TYPE)
+# message(STATUS " CMAKE_BUILD_TYPE = Debug")
+# set(CMAKE_BUILD_TYPE Debug)
+# endif(NOT BUILD_TYPE)
include_directories(${CMAKE_CURRENT_BINARY_DIR})
-# find BOOST and boost-python
-find_package( Boost COMPONENTS python REQUIRED)
-if(Boost_FOUND)
- include_directories(${Boost_INCLUDE_DIRS} ${PYTHON_INCLUDE_DIRS})
- message(STATUS "found Boost: " ${Boost_LIB_VERSION})
- message(STATUS "boost-incude dirs are: " ${Boost_INCLUDE_DIRS})
- message(STATUS "boost-python lib is: " ${Boost_PYTHON_LIBRARY})
- message(STATUS "boost_LIBRARY_DIRS is: " ${Boost_LIBRARY_DIRS})
- message(STATUS "Boost_LIBRARIES is: " ${Boost_LIBRARIES})
-endif()
-
if(USE_OPENMP)
if(APPLE)
# OpenMP does not work with the default Apple llvm/clang++
# Install a more recent version using Homebrew:
# "brew install llvm"
- set(OpenMP_CXX_FLAGS "-fopenmp=libomp")
+ # set(OpenMP_CXX_FLAGS "-fopenmp=libomp")
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${OpenMP_CXX_FLAGS}")
else()
find_package( OpenMP REQUIRED )
@@ -167,13 +121,24 @@
################ create version_string.hpp, http://stackoverflow.com/questions/3780667
# include the output directory, where the version_string.hpp file is generated
include_directories(${CMAKE_CURRENT_BINARY_DIR})
- include(version_string.cmake)
- # now parse the git commit id:
- STRING(REGEX REPLACE "([0-9][0-9]).*" "\\1" GIT_MAJOR_VERSION "${GIT_COMMIT_ID}" )
- STRING(REGEX REPLACE "[0-9][0-9].([0-9][0-9])-.*" "\\1" GIT_MINOR_VERSION "${GIT_COMMIT_ID}" )
- STRING(REGEX REPLACE "[0-9][0-9].[0-9][0-9]-(.*)-.*" "\\1" GIT_PATCH_VERSION "${GIT_COMMIT_ID}" )
- SET(MY_VERSION "${GIT_MAJOR_VERSION}.${GIT_MINOR_VERSION}.${GIT_PATCH_VERSION}" CACHE STRING "name")
- SET(version_string ${CMAKE_CURRENT_BINARY_DIR}/version_string.hpp)
+ if (VERSION_STRING)
+ set( vstring "//version_string.hpp - written by cmake. changes will be lost!\n"
+ "#ifndef VERSION_STRING\n"
+ "#define VERSION_STRING \"${VERSION_STRING}\"\n"
+ "#endif\n"
+ )
+ file(WRITE ${CMAKE_CURRENT_BINARY_DIR}/version_string.hpp ${vstring} )
+ set(MY_VERSION ${VERSION_STRING})
+ set(version_string ${VERSION_STRING})
+ else()
+ include(version_string.cmake)
+ # now parse the git commit id:
+ STRING(REGEX REPLACE "([0-9]+).*" "\\1" GIT_MAJOR_VERSION "${GIT_COMMIT_ID}" )
+ STRING(REGEX REPLACE "[0-9]+.([0-9]+)-.*" "\\1" GIT_MINOR_VERSION "${GIT_COMMIT_ID}" )
+ STRING(REGEX REPLACE "[0-9]+.[0-9]+-(.*)-.*" "\\1" GIT_PATCH_VERSION "${GIT_COMMIT_ID}" )
+ SET(MY_VERSION "${GIT_MAJOR_VERSION}.${GIT_MINOR_VERSION}.${GIT_PATCH_VERSION}" CACHE STRING "name")
+ SET(version_string ${CMAKE_CURRENT_BINARY_DIR}/version_string.hpp)
+ endif()
ENDIF(EXISTS ${OpenCamLib_SOURCE_DIR}/version_string.hpp)
message(STATUS "OpenCamLib version: ${MY_VERSION}")
@@ -275,100 +240,31 @@
${OpenCamLib_SOURCE_DIR}/algo/smart_weave.hpp
${OpenCamLib_SOURCE_DIR}/algo/weave_typedef.hpp
${OpenCamLib_SOURCE_DIR}/algo/tsp.hpp
-
- ${version_string}
-
)
-
# this branches into the dirs and compiles stuff there
-ADD_SUBDIRECTORY( ${OpenCamLib_SOURCE_DIR}/cutters )
-ADD_SUBDIRECTORY( ${OpenCamLib_SOURCE_DIR}/geo )
-ADD_SUBDIRECTORY( ${OpenCamLib_SOURCE_DIR}/algo )
-ADD_SUBDIRECTORY( ${OpenCamLib_SOURCE_DIR}/dropcutter )
-ADD_SUBDIRECTORY( ${OpenCamLib_SOURCE_DIR}/common )
-
-# include dirs
-include_directories( ${OpenCamLib_SOURCE_DIR}/cutters )
-include_directories( ${OpenCamLib_SOURCE_DIR}/geo )
-include_directories( ${OpenCamLib_SOURCE_DIR}/algo )
-include_directories( ${OpenCamLib_SOURCE_DIR}/dropcutter )
-include_directories( ${OpenCamLib_SOURCE_DIR}/common )
-include_directories( ${OpenCamLib_SOURCE_DIR} )
-
-# strip away /usr/local/ because that is what CMAKE_INSTALL_PREFIX is set to
-# also, since there is no leading "/", it makes ${Python_site_packages} a relative path.
-STRING(REGEX REPLACE "/usr/local/(.*)$" "\\1" Python_site_packages "${Python_site_packages}" )
-STRING(REGEX REPLACE "/usr/local/(.*)$" "\\1" Python_arch_packages "${Python_arch_packages}" )
-
-message(STATUS "CMAKE_INSTALL_PREFIX is : " ${CMAKE_INSTALL_PREFIX})
-message(STATUS "Python modules will be installed to: " ${Python_site_packages})
-message(STATUS "Python libraries will be installed to: " ${Python_arch_packages})
+add_subdirectory( ${OpenCamLib_SOURCE_DIR}/cutters )
+add_subdirectory( ${OpenCamLib_SOURCE_DIR}/geo )
+add_subdirectory( ${OpenCamLib_SOURCE_DIR}/algo )
+add_subdirectory( ${OpenCamLib_SOURCE_DIR}/dropcutter )
+add_subdirectory( ${OpenCamLib_SOURCE_DIR}/common )
+
+if (BUILD_NODEJS_LIB)
+ include(${CMAKE_CURRENT_SOURCE_DIR}/nodejslib/nodejslib.cmake)
+endif (BUILD_NODEJS_LIB)
if (BUILD_PY_LIB)
- # this makes the ocl Python module
- add_library(
- ocl
- MODULE
- ocl_cutters.cpp
- ocl_geometry.cpp
- ocl_algo.cpp
- ocl_dropcutter.cpp
- ocl.cpp
-
- )
-
- message(STATUS "linking python binary ocl.so with boost: " ${Boost_PYTHON_LIBRARY})
- target_link_libraries(ocl ocl_common ocl_dropcutter ocl_cutters ocl_geo ocl_algo ${Boost_LIBRARIES} ${PYTHON_LIBRARIES} -lboost_python -lboost_system)
- #
- # this makes the lib name ocl.so and not libocl.so
- set_target_properties(ocl PROPERTIES PREFIX "")
- if (WIN32)
- set_target_properties(ocl PROPERTIES VERSION ${MY_VERSION})
- endif (WIN32)
-
- install(
- TARGETS ocl
- LIBRARY DESTINATION ${Python_arch_packages}
- )
- # these are the python helper lib-files such as camvtk.py
- install(
- DIRECTORY lib/
- DESTINATION ${Python_site_packages}
- # PATTERN .svn EXCLUDE
- )
+ include(${CMAKE_CURRENT_SOURCE_DIR}/pythonlib/pythonlib.cmake)
endif (BUILD_PY_LIB)
-
# this is the C++ shared library
if (BUILD_CXX_LIB)
- add_library(
- libocl
- SHARED
- ${OCL_GEO_SRC}
- ${OCL_CUTTER_SRC}
- ${OCL_ALGO_SRC}
- ${OCL_DROPCUTTER_SRC}
- ${OCL_COMMON_SRC}
- )
- set_target_properties(libocl PROPERTIES PREFIX "")
- set_target_properties(libocl PROPERTIES VERSION ${MY_VERSION})
- install(
- TARGETS libocl
- LIBRARY
- DESTINATION lib/opencamlib
- ARCHIVE DESTINATION lib/opencamlib
- PERMISSIONS OWNER_READ OWNER_EXECUTE GROUP_READ GROUP_EXECUTE WORLD_READ WORLD_EXECUTE
- )
-
- # this installs the c++ include headers
- install(
- FILES ${OCL_INCLUDE_FILES}
- DESTINATION include/opencamlib
- PERMISSIONS OWNER_READ GROUP_READ WORLD_READ
- )
+ include(${CMAKE_CURRENT_SOURCE_DIR}/cxxlib/cxxlib.cmake)
endif (BUILD_CXX_LIB)
+if (BUILD_EMSCRIPTEN_LIB)
+ include(${CMAKE_CURRENT_SOURCE_DIR}/emscriptenlib/emscriptenlib.cmake)
+endif (BUILD_EMSCRIPTEN_LIB)
#
# this installs the examples
diff -Nru opencamlib-11.10+git201801200005~ubuntu16.04.1/src/common/brent_zero.hpp opencamlib-11.10-1/src/common/brent_zero.hpp
--- opencamlib-11.10+git201801200005~ubuntu16.04.1/src/common/brent_zero.hpp 2018-01-20 00:05:22.000000000 +0000
+++ opencamlib-11.10-1/src/common/brent_zero.hpp 2020-06-14 12:13:19.000000000 +0000
@@ -1,23 +1,23 @@
/* $Id$
*
- * Copyright 2010 Anders Wallin (anders.e.e.wallin "at" gmail.com)
+ * Copyright (c) 2010 Anders Wallin (anders.e.e.wallin "at" gmail.com).
*
- * This file is part of OpenCAMlib.
- *
- * OpenCAMlib is free software: you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation, either version 3 of the License, or
+ * This file is part of OpenCAMlib
+ * (see https://github.com/aewallin/opencamlib).
+ *
+ * This program 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.
- *
- * OpenCAMlib is distributed in the hope that it will be useful,
+ *
+ * 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 General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with OpenCAMlib. If not, see .
+ * GNU Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * along with this program. If not, see .
*/
-
#ifndef BRENT_ZERO_H
#define BRENT_ZERO_H
diff -Nru opencamlib-11.10+git201801200005~ubuntu16.04.1/src/common/clfilter.hpp opencamlib-11.10-1/src/common/clfilter.hpp
--- opencamlib-11.10+git201801200005~ubuntu16.04.1/src/common/clfilter.hpp 2018-01-20 00:05:22.000000000 +0000
+++ opencamlib-11.10-1/src/common/clfilter.hpp 2020-06-14 12:13:19.000000000 +0000
@@ -1,21 +1,22 @@
/* $Id$
*
- * Copyright 2010 Anders Wallin (anders.e.e.wallin "at" gmail.com)
+ * Copyright (c) 2010 Anders Wallin (anders.e.e.wallin "at" gmail.com).
*
- * This file is part of OpenCAMlib.
- *
- * OpenCAMlib is free software: you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation, either version 3 of the License, or
+ * This file is part of OpenCAMlib
+ * (see https://github.com/aewallin/opencamlib).
+ *
+ * This program 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.
- *
- * OpenCAMlib is distributed in the hope that it will be useful,
+ *
+ * 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 General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with OpenCAMlib. If not, see .
+ * GNU Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * along with this program. If not, see .
*/
#ifndef CLFILTER_H
diff -Nru opencamlib-11.10+git201801200005~ubuntu16.04.1/src/common/halfedgediagram.hpp opencamlib-11.10-1/src/common/halfedgediagram.hpp
--- opencamlib-11.10+git201801200005~ubuntu16.04.1/src/common/halfedgediagram.hpp 2018-01-20 00:05:22.000000000 +0000
+++ opencamlib-11.10-1/src/common/halfedgediagram.hpp 2020-06-14 12:13:19.000000000 +0000
@@ -1,20 +1,22 @@
-/*
- * Copyright 2010-2011 Anders Wallin (anders.e.e.wallin "at" gmail.com)
+/* $Id$
+ *
+ * Copyright (c) 2010-2011 Anders Wallin (anders.e.e.wallin "at" gmail.com).
*
- * This file is part of OpenCAMlib.
- *
- * OpenCAMlib is free software: you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation, either version 3 of the License, or
+ * This file is part of OpenCAMlib
+ * (see https://github.com/aewallin/opencamlib).
+ *
+ * This program 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.
- *
- * OpenCAMlib is distributed in the hope that it will be useful,
+ *
+ * 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 General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with OpenCAMlib. If not, see .
+ * GNU Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * along with this program. If not, see .
*/
#ifndef HALFEDGEDIAGRAM_HPP
#define HALFEDGEDIAGRAM_HPP
diff -Nru opencamlib-11.10+git201801200005~ubuntu16.04.1/src/common/kdnode.hpp opencamlib-11.10-1/src/common/kdnode.hpp
--- opencamlib-11.10+git201801200005~ubuntu16.04.1/src/common/kdnode.hpp 2018-01-20 00:05:22.000000000 +0000
+++ opencamlib-11.10-1/src/common/kdnode.hpp 2020-06-14 12:13:19.000000000 +0000
@@ -1,23 +1,23 @@
/* $Id$
*
- * Copyright 2010 Anders Wallin (anders.e.e.wallin "at" gmail.com)
+ * Copyright (c) 2010 Anders Wallin (anders.e.e.wallin "at" gmail.com).
*
- * This file is part of OpenCAMlib.
- *
- * OpenCAMlib is free software: you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation, either version 3 of the License, or
+ * This file is part of OpenCAMlib
+ * (see https://github.com/aewallin/opencamlib).
+ *
+ * This program 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.
- *
- * OpenCAMlib is distributed in the hope that it will be useful,
+ *
+ * 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 General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with OpenCAMlib. If not, see .
+ * GNU Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * along with this program. If not, see .
*/
-
#ifndef KDNODE_H
#define KDNODE_H
diff -Nru opencamlib-11.10+git201801200005~ubuntu16.04.1/src/common/kdtree.hpp opencamlib-11.10-1/src/common/kdtree.hpp
--- opencamlib-11.10+git201801200005~ubuntu16.04.1/src/common/kdtree.hpp 2018-01-20 00:05:22.000000000 +0000
+++ opencamlib-11.10-1/src/common/kdtree.hpp 2020-06-14 12:13:19.000000000 +0000
@@ -1,20 +1,22 @@
-/*
- * Copyright 2010-2011 Anders Wallin (anders.e.e.wallin "at" gmail.com)
+/* $Id$
+ *
+ * Copyright (c) 2010-2011 Anders Wallin (anders.e.e.wallin "at" gmail.com).
*
- * This file is part of OpenCAMlib.
- *
- * OpenCAMlib is free software: you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation, either version 3 of the License, or
+ * This file is part of OpenCAMlib
+ * (see https://github.com/aewallin/opencamlib).
+ *
+ * This program 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.
- *
- * OpenCAMlib is distributed in the hope that it will be useful,
+ *
+ * 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 General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with OpenCAMlib. If not, see .
+ * GNU Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * along with this program. If not, see .
*/
#ifndef KDTREE_H
@@ -72,10 +74,12 @@
template
class KDTree {
public:
- KDTree() {};
+ KDTree() {
+ root = nullptr;
+ }
virtual ~KDTree() {
- // std::cout << " ~KDTree()\n";
- delete root;
+ // std::cout << " ~KDTree()" << std::endl;
+ delete root;
}
/// set the bucket-size
void setBucketSize(int b){
@@ -112,7 +116,8 @@
/// build the kd-tree based on a list of input objects
void build(const std::list& list){
//std::cout << "KDTree::build() list.size()= " << list.size() << " \n";
- root = build_node( &list, 0, NULL );
+ delete root;
+ root = build_node( &list, 0, NULL );
}
/// search for overlap with input Bbox bb, return found objects
std::list* search( const Bbox& bb ){
diff -Nru opencamlib-11.10+git201801200005~ubuntu16.04.1/src/common/lineclfilter.cpp opencamlib-11.10-1/src/common/lineclfilter.cpp
--- opencamlib-11.10+git201801200005~ubuntu16.04.1/src/common/lineclfilter.cpp 2018-01-20 00:05:22.000000000 +0000
+++ opencamlib-11.10-1/src/common/lineclfilter.cpp 2020-06-14 12:13:19.000000000 +0000
@@ -1,21 +1,22 @@
/* $Id$
*
- * Copyright 2010-2011 Anders Wallin (anders.e.e.wallin "at" gmail.com)
+ * Copyright (c) 2010-2011 Anders Wallin (anders.e.e.wallin "at" gmail.com).
*
- * This file is part of OpenCAMlib.
- *
- * OpenCAMlib is free software: you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation, either version 3 of the License, or
+ * This file is part of OpenCAMlib
+ * (see https://github.com/aewallin/opencamlib).
+ *
+ * This program 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.
- *
- * OpenCAMlib is distributed in the hope that it will be useful,
+ *
+ * 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 General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with OpenCAMlib. If not, see .
+ * GNU Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * along with this program. If not, see .
*/
#include "lineclfilter.hpp"
diff -Nru opencamlib-11.10+git201801200005~ubuntu16.04.1/src/common/lineclfilter.hpp opencamlib-11.10-1/src/common/lineclfilter.hpp
--- opencamlib-11.10+git201801200005~ubuntu16.04.1/src/common/lineclfilter.hpp 2018-01-20 00:05:22.000000000 +0000
+++ opencamlib-11.10-1/src/common/lineclfilter.hpp 2020-06-14 12:13:19.000000000 +0000
@@ -1,21 +1,22 @@
/* $Id$
*
- * Copyright 2010-2011 Anders Wallin (anders.e.e.wallin "at" gmail.com)
+ * Copyright (c) 2010-2011 Anders Wallin (anders.e.e.wallin "at" gmail.com).
*
- * This file is part of OpenCAMlib.
- *
- * OpenCAMlib is free software: you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation, either version 3 of the License, or
+ * This file is part of OpenCAMlib
+ * (see https://github.com/aewallin/opencamlib).
+ *
+ * This program 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.
- *
- * OpenCAMlib is distributed in the hope that it will be useful,
+ *
+ * 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 General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with OpenCAMlib. If not, see .
+ * GNU Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * along with this program. If not, see .
*/
#ifndef LINE_CL_FILTER_H
diff -Nru opencamlib-11.10+git201801200005~ubuntu16.04.1/src/common/lineclfilter_py.hpp opencamlib-11.10-1/src/common/lineclfilter_py.hpp
--- opencamlib-11.10+git201801200005~ubuntu16.04.1/src/common/lineclfilter_py.hpp 2018-01-20 00:05:22.000000000 +0000
+++ opencamlib-11.10-1/src/common/lineclfilter_py.hpp 1970-01-01 00:00:00.000000000 +0000
@@ -1,47 +0,0 @@
-/* $Id$
- *
- * Copyright 2010 Anders Wallin (anders.e.e.wallin "at" gmail.com)
- *
- * This file is part of OpenCAMlib.
- *
- * OpenCAMlib is free software: you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation, either version 3 of the License, or
- * (at your option) any later version.
- *
- * OpenCAMlib 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 General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with OpenCAMlib. If not, see .
-*/
-
-#ifndef LINE_CL_FILTER_PY_H
-#define LINE_CL_FILTER_PY_H
-
-#include
-
-#include "lineclfilter.hpp"
-
-namespace ocl
-{
-/// python wrapper for lineclfilter
-class LineCLFilter_py : public LineCLFilter {
- public:
- LineCLFilter_py() : LineCLFilter() {};
- /// return a list of CL-points to python
- boost::python::list getCLPoints() {
- // return points to python
- boost::python::list plist;
- BOOST_FOREACH(CLPoint p, clpoints) {
- plist.append(p);
- }
- return plist;
- };
-};
-
-} // end namespace
-#endif
-// end file lineclfilter_py.h
diff -Nru opencamlib-11.10+git201801200005~ubuntu16.04.1/src/common/numeric.cpp opencamlib-11.10-1/src/common/numeric.cpp
--- opencamlib-11.10+git201801200005~ubuntu16.04.1/src/common/numeric.cpp 2018-01-20 00:05:22.000000000 +0000
+++ opencamlib-11.10-1/src/common/numeric.cpp 2020-06-14 12:13:19.000000000 +0000
@@ -1,23 +1,23 @@
/* $Id$
*
- * Copyright 2010 Anders Wallin (anders.e.e.wallin "at" gmail.com)
+ * Copyright (c) 2010 Anders Wallin (anders.e.e.wallin "at" gmail.com).
*
- * This file is part of OpenCAMlib.
- *
- * OpenCAMlib is free software: you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation, either version 3 of the License, or
+ * This file is part of OpenCAMlib
+ * (see https://github.com/aewallin/opencamlib).
+ *
+ * This program 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.
- *
- * OpenCAMlib is distributed in the hope that it will be useful,
+ *
+ * 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 General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with OpenCAMlib. If not, see .
+ * GNU Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * along with this program. If not, see .
*/
-
#include
#include // for fabs()
#include
diff -Nru opencamlib-11.10+git201801200005~ubuntu16.04.1/src/common/numeric.hpp opencamlib-11.10-1/src/common/numeric.hpp
--- opencamlib-11.10+git201801200005~ubuntu16.04.1/src/common/numeric.hpp 2018-01-20 00:05:22.000000000 +0000
+++ opencamlib-11.10-1/src/common/numeric.hpp 2020-06-14 12:13:19.000000000 +0000
@@ -1,21 +1,22 @@
/* $Id$
*
- * Copyright 2010 Anders Wallin (anders.e.e.wallin "at" gmail.com)
+ * Copyright (c) 2010 Anders Wallin (anders.e.e.wallin "at" gmail.com).
*
- * This file is part of OpenCAMlib.
- *
- * OpenCAMlib is free software: you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation, either version 3 of the License, or
+ * This file is part of OpenCAMlib
+ * (see https://github.com/aewallin/opencamlib).
+ *
+ * This program 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.
- *
- * OpenCAMlib is distributed in the hope that it will be useful,
+ *
+ * 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 General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with OpenCAMlib. If not, see .
+ * GNU Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * along with this program. If not, see .
*/
#ifndef NUMERIC_H
#define NUMERIC_H
diff -Nru opencamlib-11.10+git201801200005~ubuntu16.04.1/src/cutters/ballcutter.cpp opencamlib-11.10-1/src/cutters/ballcutter.cpp
--- opencamlib-11.10+git201801200005~ubuntu16.04.1/src/cutters/ballcutter.cpp 2018-01-20 00:05:22.000000000 +0000
+++ opencamlib-11.10-1/src/cutters/ballcutter.cpp 2020-06-14 12:13:19.000000000 +0000
@@ -1,20 +1,22 @@
-/*
- * Copyright 2010 Anders Wallin (anders.e.e.wallin "at" gmail.com)
+/* $Id$
+ *
+ * Copyright (c) 2010 Anders Wallin (anders.e.e.wallin "at" gmail.com).
*
- * This file is part of OpenCAMlib.
- *
- * OpenCAMlib is free software: you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation, either version 3 of the License, or
+ * This file is part of OpenCAMlib
+ * (see https://github.com/aewallin/opencamlib).
+ *
+ * This program 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.
- *
- * OpenCAMlib is distributed in the hope that it will be useful,
+ *
+ * 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 General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with OpenCAMlib. If not, see .
+ * GNU Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * along with this program. If not, see .
*/
#include
diff -Nru opencamlib-11.10+git201801200005~ubuntu16.04.1/src/cutters/ballcutter.hpp opencamlib-11.10-1/src/cutters/ballcutter.hpp
--- opencamlib-11.10+git201801200005~ubuntu16.04.1/src/cutters/ballcutter.hpp 2018-01-20 00:05:22.000000000 +0000
+++ opencamlib-11.10-1/src/cutters/ballcutter.hpp 2020-06-14 12:13:19.000000000 +0000
@@ -1,23 +1,23 @@
/* $Id$
*
- * Copyright 2010 Anders Wallin (anders.e.e.wallin "at" gmail.com)
+ * Copyright (c) 2010 Anders Wallin (anders.e.e.wallin "at" gmail.com).
*
- * This file is part of OpenCAMlib.
- *
- * OpenCAMlib is free software: you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation, either version 3 of the License, or
+ * This file is part of OpenCAMlib
+ * (see https://github.com/aewallin/opencamlib).
+ *
+ * This program 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.
- *
- * OpenCAMlib is distributed in the hope that it will be useful,
+ *
+ * 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 General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with OpenCAMlib. If not, see .
+ * GNU Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * along with this program. If not, see .
*/
-
#ifndef BALL_CUTTER_H
#define BALL_CUTTER_H
diff -Nru opencamlib-11.10+git201801200005~ubuntu16.04.1/src/cutters/bullcutter.cpp opencamlib-11.10-1/src/cutters/bullcutter.cpp
--- opencamlib-11.10+git201801200005~ubuntu16.04.1/src/cutters/bullcutter.cpp 2018-01-20 00:05:22.000000000 +0000
+++ opencamlib-11.10-1/src/cutters/bullcutter.cpp 2020-06-14 12:13:19.000000000 +0000
@@ -1,23 +1,23 @@
/* $Id$
*
- * Copyright 2010 Anders Wallin (anders.e.e.wallin "at" gmail.com)
+ * Copyright (c) 2010 Anders Wallin (anders.e.e.wallin "at" gmail.com).
*
- * This file is part of OpenCAMlib.
- *
- * OpenCAMlib is free software: you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation, either version 3 of the License, or
+ * This file is part of OpenCAMlib
+ * (see https://github.com/aewallin/opencamlib).
+ *
+ * This program 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.
- *
- * OpenCAMlib is distributed in the hope that it will be useful,
+ *
+ * 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 General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with OpenCAMlib. If not, see .
+ * GNU Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * along with this program. If not, see .
*/
-
#include
#include
#include
diff -Nru opencamlib-11.10+git201801200005~ubuntu16.04.1/src/cutters/bullcutter.hpp opencamlib-11.10-1/src/cutters/bullcutter.hpp
--- opencamlib-11.10+git201801200005~ubuntu16.04.1/src/cutters/bullcutter.hpp 2018-01-20 00:05:22.000000000 +0000
+++ opencamlib-11.10-1/src/cutters/bullcutter.hpp 2020-06-14 12:13:19.000000000 +0000
@@ -1,21 +1,22 @@
/* $Id$
*
- * Copyright 2010 Anders Wallin (anders.e.e.wallin "at" gmail.com)
+ * Copyright (c) 2010 Anders Wallin (anders.e.e.wallin "at" gmail.com).
*
- * This file is part of OpenCAMlib.
- *
- * OpenCAMlib is free software: you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation, either version 3 of the License, or
+ * This file is part of OpenCAMlib
+ * (see https://github.com/aewallin/opencamlib).
+ *
+ * This program 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.
- *
- * OpenCAMlib is distributed in the hope that it will be useful,
+ *
+ * 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 General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with OpenCAMlib. If not, see .
+ * GNU Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * along with this program. If not, see .
*/
#ifndef BULL_CUTTER_H
diff -Nru opencamlib-11.10+git201801200005~ubuntu16.04.1/src/cutters/compositecutter.cpp opencamlib-11.10-1/src/cutters/compositecutter.cpp
--- opencamlib-11.10+git201801200005~ubuntu16.04.1/src/cutters/compositecutter.cpp 2018-01-20 00:05:22.000000000 +0000
+++ opencamlib-11.10-1/src/cutters/compositecutter.cpp 2020-06-14 12:13:19.000000000 +0000
@@ -1,22 +1,23 @@
-/*
- * Copyright 2010-2011 Anders Wallin (anders.e.e.wallin "at" gmail.com)
- *
- * This file is part of OpenCAMlib.
+/* $Id$
*
- * OpenCAMlib is free software: you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation, either version 3 of the License, or
+ * Copyright (c) 2010-2011 Anders Wallin (anders.e.e.wallin "at" gmail.com).
+ *
+ * This file is part of OpenCAMlib
+ * (see https://github.com/aewallin/opencamlib).
+ *
+ * This program 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.
*
- * OpenCAMlib is distributed in the hope that it will be useful,
+ * 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 General Public License for more details.
+ * GNU Lesser General Public License for more details.
*
- * You should have received a copy of the GNU General Public License
- * along with OpenCAMlib. If not, see .
+ * You should have received a copy of the GNU Lesser General Public License
+ * along with this program. If not, see .
*/
-
#include
#include
#include
@@ -59,7 +60,7 @@
return cutter[idx]->height(r) + zoffset[idx];
}
-// return the width of the cutter at height h.
+// return the width of the cutter at height h.
double CompositeCutter::width(double h) const {
unsigned int idx = height_to_index(h);
// std::cout << "CompositeCutter::width( " << h << " ) idx=" << idx << " zoffset= " << zoffset[idx] << "\n";
@@ -90,7 +91,7 @@
}
bool CompositeCutter::ccValidRadius(unsigned int n, CLPoint& cl) const {
- if (cl.cc->type == NONE)
+ if (cl.cc.load()->type == NONE)
return false;
double d = cl.xyDistance(*cl.cc);
double lolimit;
@@ -207,7 +208,7 @@
contacts.push_back( std::pair(ci.lower, ci.lower_cc) );
}
}
-
+
for( unsigned int n=0; n(ci.lower, ci.lower_cc) );
}
}
-
+
for( unsigned int n=0; n(ci.lower, ci.lower_cc) );
}
}
-
+
for( unsigned int n=0; n.
+ * GNU Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * along with this program. If not, see .
*/
#ifndef COMPOSITE_CUTTER_H
@@ -47,7 +49,7 @@
MillingCutter* offsetCutter(double d) const;
- /// CompositeCutter can not use the base-class facetDrop, intstead we here
+ /// CompositeCutter can not use the base-class facetDrop, instead we here
/// call facetDrop() on each cutter in turn, and pick the valid CC/CL point
/// as the result for the CompositeCutter
bool facetDrop(CLPoint &cl, const Triangle &t) const;
diff -Nru opencamlib-11.10+git201801200005~ubuntu16.04.1/src/cutters/conecutter.cpp opencamlib-11.10-1/src/cutters/conecutter.cpp
--- opencamlib-11.10+git201801200005~ubuntu16.04.1/src/cutters/conecutter.cpp 2018-01-20 00:05:22.000000000 +0000
+++ opencamlib-11.10-1/src/cutters/conecutter.cpp 2020-06-14 12:13:19.000000000 +0000
@@ -1,20 +1,22 @@
-/*
- * Copyright 2010-2011 Anders Wallin (anders.e.e.wallin "at" gmail.com)
+/* $Id$
+ *
+ * Copyright (c) 2010-2011 Anders Wallin (anders.e.e.wallin "at" gmail.com).
*
- * This file is part of OpenCAMlib.
- *
- * OpenCAMlib is free software: you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation, either version 3 of the License, or
+ * This file is part of OpenCAMlib
+ * (see https://github.com/aewallin/opencamlib).
+ *
+ * This program 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.
- *
- * OpenCAMlib is distributed in the hope that it will be useful,
+ *
+ * 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 General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with OpenCAMlib. If not, see .
+ * GNU Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * along with this program. If not, see .
*/
#include
diff -Nru opencamlib-11.10+git201801200005~ubuntu16.04.1/src/cutters/conecutter.hpp opencamlib-11.10-1/src/cutters/conecutter.hpp
--- opencamlib-11.10+git201801200005~ubuntu16.04.1/src/cutters/conecutter.hpp 2018-01-20 00:05:22.000000000 +0000
+++ opencamlib-11.10-1/src/cutters/conecutter.hpp 2020-06-14 12:13:19.000000000 +0000
@@ -1,22 +1,23 @@
-/*
- * Copyright 2010-2011 Anders Wallin (anders.e.e.wallin "at" gmail.com)
+/* $Id$
+ *
+ * Copyright (c) 2010-2011 Anders Wallin (anders.e.e.wallin "at" gmail.com).
*
- * This file is part of OpenCAMlib.
- *
- * OpenCAMlib is free software: you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation, either version 3 of the License, or
+ * This file is part of OpenCAMlib
+ * (see https://github.com/aewallin/opencamlib).
+ *
+ * This program 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.
- *
- * OpenCAMlib is distributed in the hope that it will be useful,
+ *
+ * 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 General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with OpenCAMlib. If not, see .
+ * GNU Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * along with this program. If not, see .
*/
-
#ifndef CONE_CUTTER_HPP
#define CONE_CUTTER_HPP
diff -Nru opencamlib-11.10+git201801200005~ubuntu16.04.1/src/cutters/cylcutter.cpp opencamlib-11.10-1/src/cutters/cylcutter.cpp
--- opencamlib-11.10+git201801200005~ubuntu16.04.1/src/cutters/cylcutter.cpp 2018-01-20 00:05:22.000000000 +0000
+++ opencamlib-11.10-1/src/cutters/cylcutter.cpp 2020-06-14 12:13:19.000000000 +0000
@@ -1,21 +1,22 @@
/* $Id$
*
- * Copyright 2010 Anders Wallin (anders.e.e.wallin "at" gmail.com)
+ * Copyright (c) 2010 Anders Wallin (anders.e.e.wallin "at" gmail.com).
*
- * This file is part of OpenCAMlib.
- *
- * OpenCAMlib is free software: you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation, either version 3 of the License, or
+ * This file is part of OpenCAMlib
+ * (see https://github.com/aewallin/opencamlib).
+ *
+ * This program 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.
- *
- * OpenCAMlib is distributed in the hope that it will be useful,
+ *
+ * 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 General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with OpenCAMlib. If not, see .
+ * GNU Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * along with this program. If not, see .
*/
#include
@@ -32,7 +33,7 @@
{
CylCutter::CylCutter() {
- std::cout << " usage: CylCutter( double diameter, double length ) \n";
+ // std::cout << " usage: CylCutter( double diameter, double length ) \n";
assert(0);
}
diff -Nru opencamlib-11.10+git201801200005~ubuntu16.04.1/src/cutters/cylcutter.hpp opencamlib-11.10-1/src/cutters/cylcutter.hpp
--- opencamlib-11.10+git201801200005~ubuntu16.04.1/src/cutters/cylcutter.hpp 2018-01-20 00:05:22.000000000 +0000
+++ opencamlib-11.10-1/src/cutters/cylcutter.hpp 2020-06-14 12:13:19.000000000 +0000
@@ -1,21 +1,22 @@
/* $Id$
*
- * Copyright 2010 Anders Wallin (anders.e.e.wallin "at" gmail.com)
+ * Copyright (c) 2010 Anders Wallin (anders.e.e.wallin "at" gmail.com).
*
- * This file is part of OpenCAMlib.
- *
- * OpenCAMlib is free software: you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation, either version 3 of the License, or
+ * This file is part of OpenCAMlib
+ * (see https://github.com/aewallin/opencamlib).
+ *
+ * This program 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.
- *
- * OpenCAMlib is distributed in the hope that it will be useful,
+ *
+ * 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 General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with OpenCAMlib. If not, see .
+ * GNU Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * along with this program. If not, see .
*/
#ifndef CYL_CUTTER_H
diff -Nru opencamlib-11.10+git201801200005~ubuntu16.04.1/src/cutters/ellipse.cpp opencamlib-11.10-1/src/cutters/ellipse.cpp
--- opencamlib-11.10+git201801200005~ubuntu16.04.1/src/cutters/ellipse.cpp 2018-01-20 00:05:22.000000000 +0000
+++ opencamlib-11.10-1/src/cutters/ellipse.cpp 2020-06-14 12:13:19.000000000 +0000
@@ -1,21 +1,22 @@
/* $Id$
*
- * Copyright 2010 Anders Wallin (anders.e.e.wallin "at" gmail.com)
+ * Copyright (c) 2010 Anders Wallin (anders.e.e.wallin "at" gmail.com).
*
- * This file is part of OpenCAMlib.
- *
- * OpenCAMlib is free software: you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation, either version 3 of the License, or
+ * This file is part of OpenCAMlib
+ * (see https://github.com/aewallin/opencamlib).
+ *
+ * This program 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.
- *
- * OpenCAMlib is distributed in the hope that it will be useful,
+ *
+ * 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 General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with OpenCAMlib. If not, see .
+ * GNU Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * along with this program. If not, see .
*/
#include
#include
diff -Nru opencamlib-11.10+git201801200005~ubuntu16.04.1/src/cutters/ellipse.hpp opencamlib-11.10-1/src/cutters/ellipse.hpp
--- opencamlib-11.10+git201801200005~ubuntu16.04.1/src/cutters/ellipse.hpp 2018-01-20 00:05:22.000000000 +0000
+++ opencamlib-11.10-1/src/cutters/ellipse.hpp 2020-06-14 12:13:19.000000000 +0000
@@ -1,21 +1,22 @@
/* $Id$
*
- * Copyright 2010 Anders Wallin (anders.e.e.wallin "at" gmail.com)
+ * Copyright (c) 2010 Anders Wallin (anders.e.e.wallin "at" gmail.com).
*
- * This file is part of OpenCAMlib.
- *
- * OpenCAMlib is free software: you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation, either version 3 of the License, or
+ * This file is part of OpenCAMlib
+ * (see https://github.com/aewallin/opencamlib).
+ *
+ * This program 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.
- *
- * OpenCAMlib is distributed in the hope that it will be useful,
+ *
+ * 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 General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with OpenCAMlib. If not, see .
+ * GNU Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * along with this program. If not, see .
*/
#ifndef ELLIPSE_H
diff -Nru opencamlib-11.10+git201801200005~ubuntu16.04.1/src/cutters/ellipseposition.cpp opencamlib-11.10-1/src/cutters/ellipseposition.cpp
--- opencamlib-11.10+git201801200005~ubuntu16.04.1/src/cutters/ellipseposition.cpp 2018-01-20 00:05:22.000000000 +0000
+++ opencamlib-11.10-1/src/cutters/ellipseposition.cpp 2020-06-14 12:13:19.000000000 +0000
@@ -1,21 +1,22 @@
/* $Id$
*
- * Copyright 2010 Anders Wallin (anders.e.e.wallin "at" gmail.com)
+ * Copyright (c) 2010 Anders Wallin (anders.e.e.wallin "at" gmail.com).
*
- * This file is part of OpenCAMlib.
- *
- * OpenCAMlib is free software: you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation, either version 3 of the License, or
+ * This file is part of OpenCAMlib
+ * (see https://github.com/aewallin/opencamlib).
+ *
+ * This program 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.
- *
- * OpenCAMlib is distributed in the hope that it will be useful,
+ *
+ * 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 General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with OpenCAMlib. If not, see .
+ * GNU Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * along with this program. If not, see .
*/
#include
@@ -38,7 +39,7 @@
}
void EllipsePosition::setDiangle(double dia) {
- assert( !isnan(dia) );
+ assert( !std::isnan(dia) );
diangle = dia;
setD();
}
@@ -50,7 +51,7 @@
// return P2( (a < 2 ? 1-a : a-3),
// (a < 3 ? ((a > 1) ? 2-a : a) : a-4)
double d = diangle;
- assert( !isnan(d) );
+ assert( !std::isnan(d) );
while ( d > 4.0 ) // make d a diangle in [0,4]
d -= 4.0;
while ( d < 0.0)
diff -Nru opencamlib-11.10+git201801200005~ubuntu16.04.1/src/cutters/ellipseposition.hpp opencamlib-11.10-1/src/cutters/ellipseposition.hpp
--- opencamlib-11.10+git201801200005~ubuntu16.04.1/src/cutters/ellipseposition.hpp 2018-01-20 00:05:22.000000000 +0000
+++ opencamlib-11.10-1/src/cutters/ellipseposition.hpp 2020-06-14 12:13:19.000000000 +0000
@@ -1,21 +1,22 @@
/* $Id$
*
- * Copyright 2010 Anders Wallin (anders.e.e.wallin "at" gmail.com)
+ * Copyright (c) 2010 Anders Wallin (anders.e.e.wallin "at" gmail.com).
*
- * This file is part of OpenCAMlib.
- *
- * OpenCAMlib is free software: you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation, either version 3 of the License, or
+ * This file is part of OpenCAMlib
+ * (see https://github.com/aewallin/opencamlib).
+ *
+ * This program 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.
- *
- * OpenCAMlib is distributed in the hope that it will be useful,
+ *
+ * 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 General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with OpenCAMlib. If not, see .
+ * GNU Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * along with this program. If not, see .
*/
#ifndef ELLIPSEPOSITION_H
diff -Nru opencamlib-11.10+git201801200005~ubuntu16.04.1/src/cutters/millingcutter.cpp opencamlib-11.10-1/src/cutters/millingcutter.cpp
--- opencamlib-11.10+git201801200005~ubuntu16.04.1/src/cutters/millingcutter.cpp 2018-01-20 00:05:22.000000000 +0000
+++ opencamlib-11.10-1/src/cutters/millingcutter.cpp 2020-06-14 12:13:19.000000000 +0000
@@ -1,21 +1,22 @@
/* $Id$
*
- * Copyright 2010 Anders Wallin (anders.e.e.wallin "at" gmail.com)
+ * Copyright (c) 2010 Anders Wallin (anders.e.e.wallin "at" gmail.com).
*
- * This file is part of OpenCAMlib.
- *
- * OpenCAMlib is free software: you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation, either version 3 of the License, or
+ * This file is part of OpenCAMlib
+ * (see https://github.com/aewallin/opencamlib).
+ *
+ * This program 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.
- *
- * OpenCAMlib is distributed in the hope that it will be useful,
+ *
+ * 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 General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with OpenCAMlib. If not, see .
+ * GNU Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * along with this program. If not, see .
*/
#include
diff -Nru opencamlib-11.10+git201801200005~ubuntu16.04.1/src/cutters/millingcutter.hpp opencamlib-11.10-1/src/cutters/millingcutter.hpp
--- opencamlib-11.10+git201801200005~ubuntu16.04.1/src/cutters/millingcutter.hpp 2018-01-20 00:05:22.000000000 +0000
+++ opencamlib-11.10-1/src/cutters/millingcutter.hpp 2020-06-14 12:13:19.000000000 +0000
@@ -1,21 +1,22 @@
/* $Id$
*
- * Copyright 2010 Anders Wallin (anders.e.e.wallin "at" gmail.com)
+ * Copyright (c) 2010 Anders Wallin (anders.e.e.wallin "at" gmail.com).
*
- * This file is part of OpenCAMlib.
- *
- * OpenCAMlib is free software: you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation, either version 3 of the License, or
+ * This file is part of OpenCAMlib
+ * (see https://github.com/aewallin/opencamlib).
+ *
+ * This program 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.
- *
- * OpenCAMlib is distributed in the hope that it will be useful,
+ *
+ * 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 General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with OpenCAMlib. If not, see .
+ * GNU Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * along with this program. If not, see .
*/
#ifndef MILLING_CUTTER_H
diff -Nru opencamlib-11.10+git201801200005~ubuntu16.04.1/src/cutters/millingcutter_py.hpp opencamlib-11.10-1/src/cutters/millingcutter_py.hpp
--- opencamlib-11.10+git201801200005~ubuntu16.04.1/src/cutters/millingcutter_py.hpp 2018-01-20 00:05:22.000000000 +0000
+++ opencamlib-11.10-1/src/cutters/millingcutter_py.hpp 1970-01-01 00:00:00.000000000 +0000
@@ -1,96 +0,0 @@
-/* $Id$
- *
- * Copyright 2010 Anders Wallin (anders.e.e.wallin "at" gmail.com)
- *
- * This file is part of OpenCAMlib.
- *
- * OpenCAMlib is free software: you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation, either version 3 of the License, or
- * (at your option) any later version.
- *
- * OpenCAMlib 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 General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with OpenCAMlib. If not, see .
-*/
-
-#ifndef MILLING_CUTTER_PY_H
-#define MILLING_CUTTER_PY_H
-
-#include
-
-#include "millingcutter.hpp"
-
-namespace ocl
-{
-
-/* required wrapper class for virtual functions in boost-python */
-/// \brief a wrapper required for boost-python
-// see documentation:
-// http://www.boost.org/doc/libs/1_43_0/libs/python/doc/tutorial/doc/html/python/exposing.html#python.inheritance
-class MillingCutter_py : public MillingCutter, public boost::python::wrapper
-{
- public:
- // vertex
- bool vertexDrop(CLPoint &cl, const Triangle &t) const {
- if ( boost::python::override ovr_vertexDrop = this->get_override("vertexDrop"))
- return ovr_vertexDrop(cl, t);
- return MillingCutter::vertexDrop(cl, t);
- }
- /// python-wrapper boilerplate...
- bool default_vertexDrop(CLPoint &cl, const Triangle &t) const {
- return this->MillingCutter::vertexDrop(cl,t);
- }
-
- // facet
- bool facetDrop(CLPoint &cl, const Triangle &t) const {
- if ( boost::python::override ovr_facetDrop = this->get_override("facetDrop"))
- return ovr_facetDrop(cl, t);
- return MillingCutter::facetDrop(cl, t);
- }
- /// python-wrapper boilerplate...
- bool default_facetDrop(CLPoint &cl, const Triangle &t) const {
- return this->MillingCutter::facetDrop(cl,t);
- }
-
-
- // edge
- bool edgeDrop(CLPoint &cl, const Triangle &t) const {
- if ( boost::python::override ovr_edgeDrop = this->get_override("edgeDrop"))
- return ovr_edgeDrop(cl, t);
- return MillingCutter::edgeDrop(cl, t);
- }
- /// python-wrapper boilerplate...
- bool default_edgeDrop(CLPoint &cl, const Triangle &t) const {
- return this->MillingCutter::edgeDrop(cl,t);
- }
-
- MillingCutter* offsetCutter(double d) const {
- if ( boost::python::override ovr_offsetCutter = this->get_override("offsetCutter") )
- return ovr_offsetCutter(d);
- return MillingCutter::offsetCutter(d);
- }
- /// python-wrapper boilerplate...
- MillingCutter* default_offsetCutter(double d) const {
- return this->MillingCutter::offsetCutter(d);
- }
-
- std::string str() const {
- if ( boost::python::override ovr_str = this->get_override("str")) {
- return ovr_str();
- }
- return MillingCutter::str();
- }
- /// python-wrapper boilerplate...
- std::string default_str() const {
- return this->MillingCutter::str();
- }
-};
-
-} // end namespace
-#endif
-// end file millingcutter_py.h
diff -Nru opencamlib-11.10+git201801200005~ubuntu16.04.1/src/cxxlib/cxxlib.cmake opencamlib-11.10-1/src/cxxlib/cxxlib.cmake
--- opencamlib-11.10+git201801200005~ubuntu16.04.1/src/cxxlib/cxxlib.cmake 1970-01-01 00:00:00.000000000 +0000
+++ opencamlib-11.10-1/src/cxxlib/cxxlib.cmake 2020-06-14 12:13:19.000000000 +0000
@@ -0,0 +1,36 @@
+find_package(Boost)
+include_directories(${Boost_INCLUDE_DIRS})
+
+# include dirs
+include_directories( ${OpenCamLib_SOURCE_DIR}/cutters )
+include_directories( ${OpenCamLib_SOURCE_DIR}/geo )
+include_directories( ${OpenCamLib_SOURCE_DIR}/algo )
+include_directories( ${OpenCamLib_SOURCE_DIR}/dropcutter )
+include_directories( ${OpenCamLib_SOURCE_DIR}/common )
+include_directories( ${OpenCamLib_SOURCE_DIR} )
+
+add_library(
+ libocl
+ SHARED
+ ${OCL_GEO_SRC}
+ ${OCL_CUTTER_SRC}
+ ${OCL_ALGO_SRC}
+ ${OCL_DROPCUTTER_SRC}
+ ${OCL_COMMON_SRC}
+ )
+set_target_properties(libocl PROPERTIES PREFIX "")
+set_target_properties(libocl PROPERTIES VERSION ${MY_VERSION})
+install(
+ TARGETS libocl
+ LIBRARY
+ DESTINATION lib/opencamlib
+ ARCHIVE DESTINATION lib/opencamlib
+ PERMISSIONS OWNER_READ OWNER_EXECUTE GROUP_READ GROUP_EXECUTE WORLD_READ WORLD_EXECUTE
+ )
+
+# this installs the c++ include headers
+install(
+ FILES ${OCL_INCLUDE_FILES}
+ DESTINATION include/opencamlib
+ PERMISSIONS OWNER_READ GROUP_READ WORLD_READ
+ )
diff -Nru opencamlib-11.10+git201801200005~ubuntu16.04.1/src/deb/debian_copyright.txt opencamlib-11.10-1/src/deb/debian_copyright.txt
--- opencamlib-11.10+git201801200005~ubuntu16.04.1/src/deb/debian_copyright.txt 2018-01-20 00:05:22.000000000 +0000
+++ opencamlib-11.10-1/src/deb/debian_copyright.txt 2020-06-14 12:13:19.000000000 +0000
@@ -17,17 +17,17 @@
License:
This program is free software: you can redistribute it and/or modify
- it under the terms of the GNU General Public License as published by
- the Free Software Foundation, either version 3 of the License, or
+ 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 package is distributed in the hope that it will be useful,
+
+ 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 General Public License for more details.
-
- You should have received a copy of the GNU General Public License
- along with this program. If not, see .
+ GNU Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public License
+ along with this program. If not, see .
-On Debian systems, the complete text of the GNU General
-Public License version 3 can be found in `/usr/share/common-licenses/GPL-3'.
+On Debian systems, the complete text of the GNU Lesser General
+Public License version 2.1 can be found in `/usr/share/common-licenses/LGPL-2.1'.
diff -Nru opencamlib-11.10+git201801200005~ubuntu16.04.1/src/deb/DebSourcePPA.cmake opencamlib-11.10-1/src/deb/DebSourcePPA.cmake
--- opencamlib-11.10+git201801200005~ubuntu16.04.1/src/deb/DebSourcePPA.cmake 2018-01-20 00:05:22.000000000 +0000
+++ opencamlib-11.10-1/src/deb/DebSourcePPA.cmake 2020-06-14 12:13:19.000000000 +0000
@@ -90,7 +90,7 @@
# remove unnecessary folders
foreach(REMOVE_DIR ${CPACK_DEBIAN_PACKAGE_REMOVE_SOURCE_FILES})
- MESSAGE(STATUS "Removing direcotry from source-orig-dir. " ${REMOVE_DIR})
+ MESSAGE(STATUS "Removing directory from source-orig-dir. " ${REMOVE_DIR})
file(REMOVE_RECURSE ${DEBIAN_SOURCE_ORIG_DIR}.orig/${REMOVE_DIR})
endforeach()
@@ -169,7 +169,7 @@
##############################################################################
# debian/copyright
- MESSAGE(STATUS " creating debian/coyright.")
+ MESSAGE(STATUS " creating debian/copyright.")
set(DEBIAN_COPYRIGHT ${DEBIAN_SOURCE_DIR}/debian/copyright)
execute_process(COMMAND ${CMAKE_COMMAND} -E
copy ${CPACK_RESOURCE_FILE_LICENSE} ${DEBIAN_COPYRIGHT}
diff -Nru opencamlib-11.10+git201801200005~ubuntu16.04.1/src/Doxyfile opencamlib-11.10-1/src/Doxyfile
--- opencamlib-11.10+git201801200005~ubuntu16.04.1/src/Doxyfile 2018-01-20 00:05:22.000000000 +0000
+++ opencamlib-11.10-1/src/Doxyfile 2020-06-14 12:13:19.000000000 +0000
@@ -1134,7 +1134,8 @@
# generate an XML file that captures the structure of
# the code including all documentation.
-GENERATE_XML = NO
+# 2018-08: generate XML, for breathe -> sphinx -> readthedocs
+GENERATE_XML = YES
# The XML_OUTPUT tag is used to specify where the XML pages will be put.
# If a relative path is entered the value of OUTPUT_DIRECTORY will be
diff -Nru opencamlib-11.10+git201801200005~ubuntu16.04.1/src/dropcutter/adaptivepathdropcutter.cpp opencamlib-11.10-1/src/dropcutter/adaptivepathdropcutter.cpp
--- opencamlib-11.10+git201801200005~ubuntu16.04.1/src/dropcutter/adaptivepathdropcutter.cpp 2018-01-20 00:05:22.000000000 +0000
+++ opencamlib-11.10-1/src/dropcutter/adaptivepathdropcutter.cpp 2020-06-14 12:13:19.000000000 +0000
@@ -1,21 +1,22 @@
/* $Id$
*
- * Copyright 2010 Anders Wallin (anders.e.e.wallin "at" gmail.com)
+ * Copyright (c) 2010 Anders Wallin (anders.e.e.wallin "at" gmail.com).
*
- * This file is part of OpenCAMlib.
- *
- * OpenCAMlib is free software: you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation, either version 3 of the License, or
+ * This file is part of OpenCAMlib
+ * (see https://github.com/aewallin/opencamlib).
+ *
+ * This program 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.
- *
- * OpenCAMlib is distributed in the hope that it will be useful,
+ *
+ * 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 General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with OpenCAMlib. If not, see .
+ * GNU Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * along with this program. If not, see .
*/
#include
@@ -31,6 +32,7 @@
//******** ********************** */
AdaptivePathDropCutter::AdaptivePathDropCutter() {
+ // std::cout << " AdaptivePathDropCutter() " << std::endl;
cutter = NULL;
surf = NULL;
path = NULL;
@@ -43,8 +45,9 @@
}
AdaptivePathDropCutter::~AdaptivePathDropCutter() {
- //std::cout << " ~AdaptivePathDropCutter() \n";
+ // std::cout << " ~AdaptivePathDropCutter() " << std::endl;
delete subOp[0];
+ subOp.clear();
}
void AdaptivePathDropCutter::run() {
diff -Nru opencamlib-11.10+git201801200005~ubuntu16.04.1/src/dropcutter/adaptivepathdropcutter.hpp opencamlib-11.10-1/src/dropcutter/adaptivepathdropcutter.hpp
--- opencamlib-11.10+git201801200005~ubuntu16.04.1/src/dropcutter/adaptivepathdropcutter.hpp 2018-01-20 00:05:22.000000000 +0000
+++ opencamlib-11.10-1/src/dropcutter/adaptivepathdropcutter.hpp 2020-06-14 12:13:19.000000000 +0000
@@ -1,21 +1,22 @@
/* $Id$
*
- * Copyright 2010 Anders Wallin (anders.e.e.wallin "at" gmail.com)
+ * Copyright (c) 2010 Anders Wallin (anders.e.e.wallin "at" gmail.com).
*
- * This file is part of OpenCAMlib.
- *
- * OpenCAMlib is free software: you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation, either version 3 of the License, or
+ * This file is part of OpenCAMlib
+ * (see https://github.com/aewallin/opencamlib).
+ *
+ * This program 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.
- *
- * OpenCAMlib is distributed in the hope that it will be useful,
+ *
+ * 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 General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with OpenCAMlib. If not, see .
+ * GNU Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * along with this program. If not, see .
*/
#ifndef ADAPTIVEPATHDROPCUTTER_H
@@ -69,7 +70,12 @@
subOp[0]->clearCLPoints();
}
- protected:
+ std::vector getPoints() const
+ {
+ return clpoints;
+ }
+
+ protected:
/// run adaptive sample on the given Span between t-values of start_t and stop_t
void adaptive_sample(const Span* span, double start_t, double stop_t, CLPoint start_cl, CLPoint stop_cl);
/// flatness predicate for adaptive sampling
diff -Nru opencamlib-11.10+git201801200005~ubuntu16.04.1/src/dropcutter/adaptivepathdropcutter_py.hpp opencamlib-11.10-1/src/dropcutter/adaptivepathdropcutter_py.hpp
--- opencamlib-11.10+git201801200005~ubuntu16.04.1/src/dropcutter/adaptivepathdropcutter_py.hpp 2018-01-20 00:05:22.000000000 +0000
+++ opencamlib-11.10-1/src/dropcutter/adaptivepathdropcutter_py.hpp 1970-01-01 00:00:00.000000000 +0000
@@ -1,50 +0,0 @@
-/* $Id$
- *
- * Copyright 2010 Anders Wallin (anders.e.e.wallin "at" gmail.com)
- *
- * This file is part of OpenCAMlib.
- *
- * OpenCAMlib is free software: you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation, either version 3 of the License, or
- * (at your option) any later version.
- *
- * OpenCAMlib 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 General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with OpenCAMlib. If not, see .
-*/
-
-#ifndef ADAPTIVEPATHDROPCUTTER_PY_H
-#define ADAPTIVEPATHDROPCUTTER_PY_H
-
-#include
-
-#include "adaptivepathdropcutter.hpp"
-
-namespace ocl
-{
-
-/// Python wrapper for PathDropCutter
-class AdaptivePathDropCutter_py : public AdaptivePathDropCutter {
- public:
- AdaptivePathDropCutter_py() : AdaptivePathDropCutter() {}
- virtual ~AdaptivePathDropCutter_py() {}
- /// return a list of CL-points to python
- boost::python::list getCLPoints_py() {
- //std::cout << " apdc_py::getCLPoints_py()...";
- boost::python::list plist;
- BOOST_FOREACH(CLPoint p, clpoints) {
- plist.append(p);
- }
- //std::cout << " DONE.\n";
- return plist;
- }
-};
-
-} // end namespace
-#endif
-// end file adaptivepathdropcutter_py.h
diff -Nru opencamlib-11.10+git201801200005~ubuntu16.04.1/src/dropcutter/batchdropcutter.cpp opencamlib-11.10-1/src/dropcutter/batchdropcutter.cpp
--- opencamlib-11.10+git201801200005~ubuntu16.04.1/src/dropcutter/batchdropcutter.cpp 2018-01-20 00:05:22.000000000 +0000
+++ opencamlib-11.10-1/src/dropcutter/batchdropcutter.cpp 2020-06-14 12:13:19.000000000 +0000
@@ -1,20 +1,22 @@
-/*
- * Copyright 2010-2011 Anders Wallin (anders.e.e.wallin "at" gmail.com)
+/* $Id$
+ *
+ * Copyright (c) 2010-2011 Anders Wallin (anders.e.e.wallin "at" gmail.com).
*
- * This file is part of OpenCAMlib.
- *
- * OpenCAMlib is free software: you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation, either version 3 of the License, or
+ * This file is part of OpenCAMlib
+ * (see https://github.com/aewallin/opencamlib).
+ *
+ * This program 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.
- *
- * OpenCAMlib is distributed in the hope that it will be useful,
+ *
+ * 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 General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with OpenCAMlib. If not, see .
+ * GNU Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * along with this program. If not, see .
*/
#include
@@ -138,10 +140,11 @@
std::list* tris;
#ifdef _WIN32 // OpenMP version 2 of VS2013 OpenMP need signed loop variable
int n; // loop variable
+ int Nmax = clpoints->size();
#else
unsigned int n; // loop variable
-#endif
unsigned int Nmax = clpoints->size();
+#endif
std::vector& clref = *clpoints;
int nloop=0;
#ifdef _OPENMP
@@ -159,7 +162,7 @@
#endif
nloop++;
tris = root->search_cutter_overlap( cutter, &clref[n] );
- assert( tris->size() <= ntriangles ); // can't possibly find more triangles than in the STLSurf
+ // assert( tris->size() <= ntriangles ); // can't possibly find more triangles than in the STLSurf
for( it=tris->begin(); it!=tris->end() ; ++it) { // loop over found triangles
if ( cutter->overlaps(clref[n],*it) ) { // cutter overlap triangle? check
if (clref[n].below(*it)) {
@@ -199,11 +202,12 @@
long int ntris = 0;
std::list* tris;
#ifdef _WIN32 // OpenMP version 2 of VS2013 OpenMP need signed loop variable
+ int Nmax = clpoints->size();
int n; // loop variable
#else
+ unsigned int Nmax = clpoints->size();
unsigned int n; // loop variable
#endif
- unsigned int Nmax = clpoints->size();
std::vector& clref = *clpoints;
int nloop=0;
@@ -223,7 +227,7 @@
nloop++;
tris = root->search_cutter_overlap( cutter, &clref[n] );
assert( tris );
- assert( tris->size() <= ntriangles ); // can't possibly find more triangles than in the STLSurf
+ // assert( tris->size() <= ntriangles ); // can't possibly find more triangles than in the STLSurf
for( it=tris->begin(); it!=tris->end() ; ++it) { // loop over found triangles
if ( cutter->overlaps(clref[n],*it) ) { // cutter overlap triangle? check
if (clref[n].below(*it)) {
diff -Nru opencamlib-11.10+git201801200005~ubuntu16.04.1/src/dropcutter/batchdropcutter.hpp opencamlib-11.10-1/src/dropcutter/batchdropcutter.hpp
--- opencamlib-11.10+git201801200005~ubuntu16.04.1/src/dropcutter/batchdropcutter.hpp 2018-01-20 00:05:22.000000000 +0000
+++ opencamlib-11.10-1/src/dropcutter/batchdropcutter.hpp 2020-06-14 12:13:19.000000000 +0000
@@ -1,21 +1,22 @@
/* $Id$
*
- * Copyright 2010 Anders Wallin (anders.e.e.wallin "at" gmail.com)
+ * Copyright (c) 2010 Anders Wallin (anders.e.e.wallin "at" gmail.com).
*
- * This file is part of OpenCAMlib.
- *
- * OpenCAMlib is free software: you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation, either version 3 of the License, or
+ * This file is part of OpenCAMlib
+ * (see https://github.com/aewallin/opencamlib).
+ *
+ * This program 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.
- *
- * OpenCAMlib is distributed in the hope that it will be useful,
+ *
+ * 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 General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with OpenCAMlib. If not, see .
+ * GNU Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * along with this program. If not, see .
*/
#ifndef BDC_H
diff -Nru opencamlib-11.10+git201801200005~ubuntu16.04.1/src/dropcutter/batchdropcutter_py.hpp opencamlib-11.10-1/src/dropcutter/batchdropcutter_py.hpp
--- opencamlib-11.10+git201801200005~ubuntu16.04.1/src/dropcutter/batchdropcutter_py.hpp 2018-01-20 00:05:22.000000000 +0000
+++ opencamlib-11.10-1/src/dropcutter/batchdropcutter_py.hpp 1970-01-01 00:00:00.000000000 +0000
@@ -1,60 +0,0 @@
-/* $Id$
- *
- * Copyright 2010 Anders Wallin (anders.e.e.wallin "at" gmail.com)
- *
- * This file is part of OpenCAMlib.
- *
- * OpenCAMlib is free software: you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation, either version 3 of the License, or
- * (at your option) any later version.
- *
- * OpenCAMlib 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 General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with OpenCAMlib. If not, see .
-*/
-
-#ifndef BDC_PY_H
-#define BDC_PY_H
-
-#include
-#include
-
-#include "batchdropcutter.hpp"
-
-namespace ocl
-{
-
-/// Python wrapper for BatchDropCutter
-class BatchDropCutter_py : public BatchDropCutter {
- public:
- BatchDropCutter_py() : BatchDropCutter() {};
- /// return CL-points to Python
- boost::python::list getCLPoints_py() {
- boost::python::list plist;
- BOOST_FOREACH(CLPoint p, *clpoints) {
- plist.append(p);
- }
- return plist;
- };
- /// return triangles under cutter to Python. Not for CAM-algorithms,
- /// more for visualization and demonstration.
- boost::python::list getTrianglesUnderCutter(CLPoint& cl, MillingCutter& cutter) {
- boost::python::list trilist;
- std::list *triangles_under_cutter = new std::list();
- triangles_under_cutter = root->search_cutter_overlap( &cutter , &cl);
- BOOST_FOREACH(Triangle t, *triangles_under_cutter) {
- trilist.append(t);
- }
- delete triangles_under_cutter;
- return trilist;
- };
-};
-
-} // end namespace
-
-#endif
diff -Nru opencamlib-11.10+git201801200005~ubuntu16.04.1/src/dropcutter/pathdropcutter.cpp opencamlib-11.10-1/src/dropcutter/pathdropcutter.cpp
--- opencamlib-11.10+git201801200005~ubuntu16.04.1/src/dropcutter/pathdropcutter.cpp 2018-01-20 00:05:22.000000000 +0000
+++ opencamlib-11.10-1/src/dropcutter/pathdropcutter.cpp 2020-06-14 12:13:19.000000000 +0000
@@ -1,21 +1,22 @@
/* $Id$
*
- * Copyright 2010 Anders Wallin (anders.e.e.wallin "at" gmail.com)
+ * Copyright (c) 2010 Anders Wallin (anders.e.e.wallin "at" gmail.com).
*
- * This file is part of OpenCAMlib.
- *
- * OpenCAMlib is free software: you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation, either version 3 of the License, or
+ * This file is part of OpenCAMlib
+ * (see https://github.com/aewallin/opencamlib).
+ *
+ * This program 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.
- *
- * OpenCAMlib is distributed in the hope that it will be useful,
+ *
+ * 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 General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with OpenCAMlib. If not, see .
+ * GNU Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * along with this program. If not, see .
*/
#include
@@ -41,6 +42,7 @@
PathDropCutter::~PathDropCutter() {
delete subOp[0];
+ subOp.clear();
}
void PathDropCutter::setPath(const Path *p) {
diff -Nru opencamlib-11.10+git201801200005~ubuntu16.04.1/src/dropcutter/pathdropcutter.hpp opencamlib-11.10-1/src/dropcutter/pathdropcutter.hpp
--- opencamlib-11.10+git201801200005~ubuntu16.04.1/src/dropcutter/pathdropcutter.hpp 2018-01-20 00:05:22.000000000 +0000
+++ opencamlib-11.10-1/src/dropcutter/pathdropcutter.hpp 2020-06-14 12:13:19.000000000 +0000
@@ -1,21 +1,22 @@
/* $Id$
*
- * Copyright 2010 Anders Wallin (anders.e.e.wallin "at" gmail.com)
+ * Copyright (c) 2010 Anders Wallin (anders.e.e.wallin "at" gmail.com).
*
- * This file is part of OpenCAMlib.
- *
- * OpenCAMlib is free software: you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation, either version 3 of the License, or
+ * This file is part of OpenCAMlib
+ * (see https://github.com/aewallin/opencamlib).
+ *
+ * This program 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.
- *
- * OpenCAMlib is distributed in the hope that it will be useful,
+ *
+ * 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 General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with OpenCAMlib. If not, see .
+ * GNU Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * along with this program. If not, see .
*/
#ifndef PATHDROPCUTTER_H
@@ -54,10 +55,14 @@
double getZ() const {
return minimumZ;
}
+ std::vector getPoints() const
+ {
+ return clpoints;
+ }
/// run drop-cutter on the whole Path
virtual void run();
-
- protected:
+
+ protected:
/// the path to follow
const Path* path;
/// the lowest z height, used when no triangles are touched, default is minimumZ = 0.0
diff -Nru opencamlib-11.10+git201801200005~ubuntu16.04.1/src/dropcutter/pathdropcutter_py.hpp opencamlib-11.10-1/src/dropcutter/pathdropcutter_py.hpp
--- opencamlib-11.10+git201801200005~ubuntu16.04.1/src/dropcutter/pathdropcutter_py.hpp 2018-01-20 00:05:22.000000000 +0000
+++ opencamlib-11.10-1/src/dropcutter/pathdropcutter_py.hpp 1970-01-01 00:00:00.000000000 +0000
@@ -1,48 +0,0 @@
-/* $Id$
- *
- * Copyright 2010 Anders Wallin (anders.e.e.wallin "at" gmail.com)
- *
- * This file is part of OpenCAMlib.
- *
- * OpenCAMlib is free software: you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation, either version 3 of the License, or
- * (at your option) any later version.
- *
- * OpenCAMlib 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 General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with OpenCAMlib. If not, see .
-*/
-
-#ifndef PATHDROPCUTTER_PY_H
-#define PATHDROPCUTTER_PY_H
-
-#include
-#include
-
-#include "pathdropcutter.hpp"
-
-namespace ocl
-{
-
-/// Python wrapper for PathDropCutter
-class PathDropCutter_py : public PathDropCutter {
- public:
- PathDropCutter_py() : PathDropCutter() {};
- /// return a list of CL-points to python
- boost::python::list getCLPoints_py() {
- boost::python::list plist;
- BOOST_FOREACH(CLPoint p, clpoints) {
- plist.append(p);
- }
- return plist;
- };
-};
-
-} // end namespace
-#endif
-// end file pathdropcutter_py.h
diff -Nru opencamlib-11.10+git201801200005~ubuntu16.04.1/src/dropcutter/pointdropcutter.cpp opencamlib-11.10-1/src/dropcutter/pointdropcutter.cpp
--- opencamlib-11.10+git201801200005~ubuntu16.04.1/src/dropcutter/pointdropcutter.cpp 2018-01-20 00:05:22.000000000 +0000
+++ opencamlib-11.10-1/src/dropcutter/pointdropcutter.cpp 2020-06-14 12:13:19.000000000 +0000
@@ -1,21 +1,22 @@
/* $Id$
*
- * Copyright 2010 Anders Wallin (anders.e.e.wallin "at" gmail.com)
+ * Copyright (c) 2010 Anders Wallin (anders.e.e.wallin "at" gmail.com).
*
- * This file is part of OpenCAMlib.
- *
- * OpenCAMlib is free software: you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation, either version 3 of the License, or
+ * This file is part of OpenCAMlib
+ * (see https://github.com/aewallin/opencamlib).
+ *
+ * This program 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.
- *
- * OpenCAMlib is distributed in the hope that it will be useful,
+ *
+ * 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 General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with OpenCAMlib. If not, see .
+ * GNU Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * along with this program. If not, see .
*/
#include
diff -Nru opencamlib-11.10+git201801200005~ubuntu16.04.1/src/dropcutter/pointdropcutter.hpp opencamlib-11.10-1/src/dropcutter/pointdropcutter.hpp
--- opencamlib-11.10+git201801200005~ubuntu16.04.1/src/dropcutter/pointdropcutter.hpp 2018-01-20 00:05:22.000000000 +0000
+++ opencamlib-11.10-1/src/dropcutter/pointdropcutter.hpp 2020-06-14 12:13:19.000000000 +0000
@@ -1,23 +1,23 @@
/* $Id$
*
- * Copyright 2010 Anders Wallin (anders.e.e.wallin "at" gmail.com)
+ * Copyright (c) 2010 Anders Wallin (anders.e.e.wallin "at" gmail.com).
*
- * This file is part of OpenCAMlib.
- *
- * OpenCAMlib is free software: you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation, either version 3 of the License, or
+ * This file is part of OpenCAMlib
+ * (see https://github.com/aewallin/opencamlib).
+ *
+ * This program 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.
- *
- * OpenCAMlib is distributed in the hope that it will be useful,
+ *
+ * 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 General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with OpenCAMlib. If not, see .
+ * GNU Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * along with this program. If not, see .
*/
-
#ifndef POINTDROPCUTTER_H
#define POINTDROPCUTTER_H
diff -Nru opencamlib-11.10+git201801200005~ubuntu16.04.1/src/emscriptenlib/build.sh opencamlib-11.10-1/src/emscriptenlib/build.sh
--- opencamlib-11.10+git201801200005~ubuntu16.04.1/src/emscriptenlib/build.sh 1970-01-01 00:00:00.000000000 +0000
+++ opencamlib-11.10-1/src/emscriptenlib/build.sh 2020-06-14 12:13:19.000000000 +0000
@@ -0,0 +1,16 @@
+#!/bin/sh
+
+rm -rf ../../buildemscripten || true
+mkdir ../../buildemscripten
+cd ../../buildemscripten
+emcmake cmake .. \
+ -DCMAKE_BUILD_TYPE=Release \
+ -DBUILD_CPP_LIB="OFF" \
+ -DBUILD_EMSCRIPTEN_LIB="ON" \
+ -DUSE_OPENMP="OFF" \
+ -DBoost_INCLUDE_DIR="/usr/local/Cellar/boost/1.68.0/include"
+emmake make -j4
+cp src/opencamlib.* ../src/emscriptenlib
+cd ../src/emscriptenlib
+./node_modules/.bin/browserify test.src.js > test.js
+./node_modules/.bin/browserify index.js > pkg/index.js
diff -Nru opencamlib-11.10+git201801200005~ubuntu16.04.1/src/emscriptenlib/emscriptenlib.cmake opencamlib-11.10-1/src/emscriptenlib/emscriptenlib.cmake
--- opencamlib-11.10+git201801200005~ubuntu16.04.1/src/emscriptenlib/emscriptenlib.cmake 1970-01-01 00:00:00.000000000 +0000
+++ opencamlib-11.10-1/src/emscriptenlib/emscriptenlib.cmake 2020-06-14 12:13:19.000000000 +0000
@@ -0,0 +1,34 @@
+message(STATUS "Will build emscripten js library")
+
+set(CMAKE_CXX_FLAGS_DEBUG "${CMAKE_C_FLAGS_DEBUG} -g4 -O0")
+set(CMAKE_CXX_FLAGS_RELEASE "${CMAKE_C_FLAGS_RELEASE} -O3")
+
+SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} --bind -s MODULARIZE=1 -s SINGLE_FILE=1 -s ALLOW_MEMORY_GROWTH=1")
+
+find_package(Boost)
+include_directories(${Boost_INCLUDE_DIRS})
+
+# include dirs
+include_directories( ${OpenCamLib_SOURCE_DIR}/cutters )
+include_directories( ${OpenCamLib_SOURCE_DIR}/geo )
+include_directories( ${OpenCamLib_SOURCE_DIR}/algo )
+include_directories( ${OpenCamLib_SOURCE_DIR}/dropcutter )
+include_directories( ${OpenCamLib_SOURCE_DIR}/common )
+include_directories( ${OpenCamLib_SOURCE_DIR} )
+
+include_directories(${OpenCamLib_SOURCE_DIR}/emscriptenlib)
+
+add_executable(opencamlib
+ # SHARED
+ ${OCL_GEO_SRC}
+ ${OCL_CUTTER_SRC}
+ ${OCL_DROPCUTTER_SRC}
+ ${OCL_ALGO_SRC}
+ ${OCL_COMMON_SRC}
+ ${OpenCamLib_SOURCE_DIR}/emscriptenlib/emscriptenlib.cpp
+)
+
+target_link_libraries(
+ opencamlib
+ ${Boost_LIBRARIES}
+)
diff -Nru opencamlib-11.10+git201801200005~ubuntu16.04.1/src/emscriptenlib/emscriptenlib.cpp opencamlib-11.10-1/src/emscriptenlib/emscriptenlib.cpp
--- opencamlib-11.10+git201801200005~ubuntu16.04.1/src/emscriptenlib/emscriptenlib.cpp 1970-01-01 00:00:00.000000000 +0000
+++ opencamlib-11.10-1/src/emscriptenlib/emscriptenlib.cpp 2020-06-14 12:13:19.000000000 +0000
@@ -0,0 +1,376 @@
+#include
+#include
+
+// GEOMETRY
+#include "point.hpp"
+#include "ccpoint.hpp"
+#include "clpoint.hpp"
+#include "triangle.hpp"
+#include "bbox.hpp"
+#include "path.hpp"
+#include "line.hpp"
+#include "ellipse.hpp"
+#include "ellipseposition.hpp"
+
+// STL
+#include "stlsurf.hpp"
+#include "stlreader.hpp"
+
+// ALGO
+#include "operation.hpp"
+#include "waterline.hpp"
+#include "adaptivepathdropcutter.hpp"
+#include "adaptivewaterline.hpp"
+// #include "zigzag.hpp"
+#include "weave.hpp"
+#include "lineclfilter.hpp"
+// #include "clsurface.hpp"
+
+// CUTTERS
+#include "millingcutter.hpp"
+#include "cylcutter.hpp"
+#include "ballcutter.hpp"
+#include "bullcutter.hpp"
+#include "conecutter.hpp"
+
+using namespace emscripten;
+using namespace ocl;
+
+EMSCRIPTEN_BINDINGS(opencamlib)
+{
+ //////////////
+ // GEOMETRY //
+ //////////////
+ class_("Point")
+ .constructor()
+ .constructor()
+ .constructor()
+ .constructor()
+ .function("norm", &Point::norm)
+ .function("xyNorm", &Point::xyNorm)
+ .function("normalize", &Point::normalize)
+ .function("dot", &Point::dot)
+ .function("cross", &Point::cross)
+ .function("xRotate", &Point::xRotate)
+ .function("yRotate", &Point::yRotate)
+ .function("zRotate", &Point::zRotate)
+ .function("isRight", &Point::isRight)
+ //.function("isInside", &Point::isInside)
+ //.function("isInsidePoints", &Point::isInside)
+ .function("xyDistance", &Point::xyDistance)
+ .function("__str__", &Point::str)
+ .property("x", &Point::x)
+ .property("y", &Point::y)
+ .property("z", &Point::z);
+
+ class_>("CLPoint")
+ .constructor()
+ .constructor()
+ .constructor()
+ .function("__str__", &CLPoint::str)
+ .function("cc", &CLPoint::getCC)
+ .function("getCC", &CLPoint::getCC);
+
+ class_>("CCPoint")
+ .constructor()
+ .constructor()
+ .function("__str__", &CCPoint::str);
+ // .property("type", &CCPoint::type) // @todo figure out the problem
+
+ class_("Triangle")
+ .constructor()
+ .constructor();
+
+ enum_("CCType")
+ .value("NONE", NONE)
+ .value("VERTEX", VERTEX)
+ .value("VERTEX_CYL", VERTEX_CYL)
+ .value("EDGE", EDGE)
+ .value("EDGE_SHAFT", EDGE_SHAFT)
+ .value("EDGE_HORIZ", EDGE_HORIZ)
+ .value("EDGE_CYL", EDGE_CYL)
+ .value("EDGE_BALL", EDGE_BALL)
+ .value("EDGE_CONE", EDGE_CONE)
+ .value("EDGE_CONE_BASE", EDGE_CONE_BASE)
+ .value("EDGE_HORIZ_CYL", EDGE_HORIZ_CYL)
+ .value("EDGE_HORIZ_TOR", EDGE_HORIZ_TOR)
+ .value("EDGE_POS", EDGE_POS)
+ .value("EDGE_NEG", EDGE_NEG)
+ .value("FACET", FACET)
+ .value("FACET_TIP", FACET_TIP)
+ .value("FACET_CYL", FACET_CYL)
+ .value("ERROR", ERROR);
+
+ class_("STLReader")
+ .constructor();
+
+ class_("STLSurf")
+ .constructor()
+ .function("addTriangle", &STLSurf::addTriangle)
+ .function("size", &STLSurf::size);
+
+ class_("Bbox")
+ .function("isInside", &Bbox::isInside)
+ .property("maxpt", &Bbox::maxpt)
+ .property("minpt", &Bbox::minpt);
+
+ // Epos and the Ellipse are used for the toroidal tool edge-tests
+ class_("EllipsePosition")
+ .property("s", &EllipsePosition::s)
+ .property("t", &EllipsePosition::t)
+ .function("setDiangle", &EllipsePosition::setDiangle)
+ .function("__str__", &EllipsePosition::str);
+
+ // class_("Ellipse")
+ // .constructor()
+ // .function("ePoint", &Ellipse::ePoint)
+ // .function("oePoint", &Ellipse::oePoint)
+ // .function("normal", &Ellipse::normal);
+
+ class_("Line")
+ .constructor()
+ .constructor()
+ .property("p1", &Line::p1)
+ .property("p2", &Line::p2);
+
+ class_("Arc")
+ .constructor()
+ .constructor()
+ .property("p1", &Arc::p1)
+ .property("p2", &Arc::p2)
+ .property("c", &Arc::c)
+ .property("dir", &Arc::dir);
+
+ enum_("SpanType")
+ .value("LineSpanType", LineSpanType)
+ .value("ArcSpanType", ArcSpanType);
+
+ class_("Path")
+ .constructor()
+ .constructor()
+ .function("appendLine", static_cast(&Path::append))
+ .function("appendArc", static_cast(&Path::append));
+
+ //////////
+ // ALGO //
+ //////////
+ class_("Operation")
+ .function("setCutter", &Operation::setCutter, allow_raw_pointers())
+ .function("getCLPoints", &Operation::getCLPoints)
+ .function("setSTL", &Operation::setSTL, allow_raw_pointers())
+ .function("setSampling", &Operation::setSampling);
+
+ class_>("BatchDropCutter")
+ .constructor()
+ .function("run", &BatchDropCutter::run);
+ // .function("setSTL", &BatchDropCutter::setSTL)
+ // .function("setCutter", &BatchDropCutter::setCutter)
+ // .function("setThreads", &BatchDropCutter::setThreads)
+ // .function("getThreads", &BatchDropCutter::getThreads)
+ // .function("appendPoint", &BatchDropCutter::appendPoint)
+ // .function("getTrianglesUnderCutter", &BatchDropCutter::getTrianglesUnderCutter)
+ // .function("getCalls", &BatchDropCutter::getCalls)
+ // .function("getBucketSize", &BatchDropCutter::getBucketSize)
+ // .function("setBucketSize", &BatchDropCutter::setBucketSize);
+
+ class_>("PathDropCutter")
+ .constructor()
+ .function("run", &PathDropCutter::run)
+ // .function("setCutter", &PathDropCutter::setCutter)
+ // .function("setSTL", &PathDropCutter::setSTL)
+ // .function("setSampling", &PathDropCutter::setSampling)
+ .function("setPath", &PathDropCutter::setPath, allow_raw_pointers())
+ .function("getZ", &PathDropCutter::getZ)
+ .function("setZ", &PathDropCutter::setZ)
+ .function("getPoints", &PathDropCutter::getPoints);
+
+ class_>("AdaptivePathDropCutter")
+ .constructor()
+ .function("run", &AdaptivePathDropCutter::run)
+ // .function("setCutter", &AdaptivePathDropCutter::setCutter)
+ // .function("setSTL", &AdaptivePathDropCutter::setSTL)
+ // .function("setSampling", &AdaptivePathDropCutter::setSampling)
+ .function("setMinSampling", &AdaptivePathDropCutter::setMinSampling)
+ .function("setCosLimit", &AdaptivePathDropCutter::setCosLimit)
+ // .function("getSampling", &AdaptivePathDropCutter::getSampling)
+ .function("setPath", &AdaptivePathDropCutter::setPath, allow_raw_pointers())
+ .function("getZ", &AdaptivePathDropCutter::getZ)
+ .function("setZ", &AdaptivePathDropCutter::setZ)
+ .function("getPoints", &AdaptivePathDropCutter::getPoints);
+
+ // class_("ZigZag")
+ // .function("run", &ZigZag::run)
+ // .function("setDirection", &ZigZag::setDirection)
+ // .function("setOrigin", &ZigZag::setOrigin)
+ // .function("setStepOver", &ZigZag::setStepOver)
+ // .function("addPoint", &ZigZag::addPoint)
+ // .function("getOutput", &ZigZag::getOutput)
+ // .function("__str__", &ZigZag::str);
+
+ class_("BatchPushCutter")
+ .constructor();
+ // class_>("BatchPushCutter")
+ // .function("run", &BatchPushCutter::run)
+ // .function("setSTL", &BatchPushCutter::setSTL)
+ // .function("setCutter", &BatchPushCutter::setCutter)
+ // .function("setThreads", &BatchPushCutter::setThreads)
+ // .function("appendFiber", &BatchPushCutter::appendFiber)
+ // .function("getOverlapTriangles", &BatchPushCutter::getOverlapTriangles)
+ // .function("getCLPoints", &BatchPushCutter::getCLPoints)
+ // .function("getFibers", &BatchPushCutter::getFibers)
+ // .function("getCalls", &BatchPushCutter::getCalls)
+ // .function("setThreads", &BatchPushCutter::setThreads)
+ // .function("getThreads", &BatchPushCutter::getThreads)
+ // .function("setBucketSize", &BatchPushCutter::setBucketSize)
+ // .function("getBucketSize", &BatchPushCutter::getBucketSize)
+ // .function("setXDirection", &BatchPushCutter::setXDirection)
+ // .function("setYDirection", &BatchPushCutter::setYDirection);
+
+ class_("Interval")
+ .constructor()
+ .property("upper", &Interval::upper)
+ .property("lower", &Interval::lower)
+ .property("lower_cc", &Interval::lower_cc)
+ .property("upper_cc", &Interval::upper_cc)
+ .function("updateUpper", &Interval::updateUpper)
+ .function("updateLower", &Interval::updateLower)
+ .function("empty", &Interval::empty)
+ .function("__str__", &Interval::str);
+
+ class_("Fiber")
+ .constructor();
+
+ // class_>("Fiber")
+ // .constructor()
+ // .property("p1", &Fiber::p1)
+ // .property("p2", &Fiber::p2)
+ // .property("dir", &Fiber::dir)
+ // .function("addInterval", &Fiber::addInterval)
+ // .function("point", &Fiber::point)
+ // .function("printInts", &Fiber::printInts)
+ // .function("getInts", &Fiber::getInts);
+
+ register_vector("std::vector");
+ register_vector("std::vector");
+ register_vector>("std::vector>");
+
+ class_>("Waterline")
+ .constructor()
+ .function("setZ", &Waterline::setZ)
+ .function("run", &Waterline::run)
+ .function("getLoops", &Waterline::getLoops);
+
+ // class_>("Waterline")
+ // .function("setCutter", &Waterline::setCutter)
+ // .function("setSTL", &Waterline::setSTL)
+ // .function("setZ", &Waterline::setZ)
+ // .function("setSampling", &Waterline::setSampling)
+ // .function("run", &Waterline::run)
+ // .function("run2", &Waterline::run2)
+ // .function("reset", &Waterline::reset)
+ // .function("getLoops", &Waterline::py_getLoops)
+ // .function("setThreads", &Waterline::setThreads)
+ // .function("getThreads", &Waterline::getThreads)
+ // .function("getXFibers", &Waterline::py_getXFibers)
+ // .function("getYFibers", &Waterline::py_getYFibers);
+
+ class_>("AdaptiveWaterline")
+ .constructor()
+ // .function("setZ", &AdaptiveWaterline::setZ)
+ .function("setMinSampling", &AdaptiveWaterline::setMinSampling);
+ // .function("run", &AdaptiveWaterline::run);
+ // class_>("AdaptiveWaterline")
+ // .function("setCutter", &AdaptiveWaterline::setCutter)
+ // .function("setSTL", &AdaptiveWaterline::setSTL)
+ // .function("setZ", &AdaptiveWaterline::setZ)
+ // .function("setSampling", &AdaptiveWaterline::setSampling)
+ // .function("setMinSampling", &AdaptiveWaterline::setMinSampling)
+ // .function("run", &AdaptiveWaterline::run)
+ // .function("run2", &AdaptiveWaterline::run2)
+ // .function("reset", &AdaptiveWaterline::reset)
+ // //.function("run2", &AdaptiveWaterline::run2) // uses Weave::build2()
+ // .function("getLoops", &AdaptiveWaterline::py_getLoops)
+ // .function("setThreads", &AdaptiveWaterline::setThreads)
+ // .function("getThreads", &AdaptiveWaterline::getThreads)
+ // .function("getXFibers", &AdaptiveWaterline::getXFibers)
+ // .function("getYFibers", &AdaptiveWaterline::getYFibers);
+
+ enum_("WeaveVertexType")
+ .value("CL", weave::CL)
+ .value("CL_DONE", weave::CL_DONE)
+ .value("ADJ", weave::ADJ)
+ .value("TWOADJ", weave::TWOADJ)
+ .value("INT", weave::INT)
+ .value("FULLINT", weave::FULLINT);
+
+ class_("LineCLFilter")
+ .constructor();
+ // class_>("LineCLFilter")
+ // .function("addCLPoint", &LineCLFilter::addCLPoint)
+ // .function("setTolerance", &LineCLFilter::setTolerance)
+ // .function("run", &LineCLFilter::run)
+ // .function("getCLPoints", &LineCLFilter::getCLPoints);
+
+ // some strange problem with hedi::face_edges()... let's not compile for now..
+ // class_("CutterLocationSurface")
+ // .constructor()
+ // .function("run", &clsurf::CutterLocationSurface::run)
+ // .function("setMinSampling", &clsurf::CutterLocationSurface::setMinSampling)
+ // .function("setSampling", &clsurf::CutterLocationSurface::setSampling)
+ // .function("setSTL", &clsurf::CutterLocationSurface::setSTL)
+ // .function("setCutter", &clsurf::CutterLocationSurface::setCutter)
+ // .function("getVertices", &clsurf::CutterLocationSurface::getVertices)
+ // .function("getEdges", &clsurf::CutterLocationSurface::getEdges)
+ // .function("__str__", &clsurf::CutterLocationSurface::str);
+ /*
+ class_< tsp::TSPSolver >("TSPSolver")
+ .function("addPoint", &tsp::TSPSolver::addPoint)
+ .function("run", &tsp::TSPSolver::run)
+ .function("getOutput", &tsp::TSPSolver::getOutput)
+ .function("getLength", &tsp::TSPSolver::getLength)
+ .function("reset", &tsp::TSPSolver::reset)
+ ;
+ */
+
+ /////////////
+ // CUTTERS //
+ /////////////
+ class_("MillingCutter");
+ // .function("vertexDrop", &MillingCutter::vertexDrop)
+ // .function("facetDrop", &MillingCutter::facetDrop)
+ // .function("edgeDrop", &MillingCutter::edgeDrop)
+ // .function("dropCutter", &MillingCutter::dropCutter)
+ // .function("pushCutter", &MillingCutter::pushCutter)
+ // .function("offsetCutter", &MillingCutter::offsetCutter)
+ // .function("__str__", &MillingCutter::str)
+ // .function("getRadius", &MillingCutter::getRadius)
+ // .function("getLength", &MillingCutter::getLength)
+ // .function("getDiameter", &MillingCutter::getDiameter);
+
+ class_>("CylCutter")
+ .constructor();
+ // .function("dropCutterSTL", &CylCutter::dropCutterSTL);
+
+ class_>("BallCutter")
+ .constructor();
+ // .function("dropCutterSTL", &BallCutter::dropCutterSTL);
+
+ class_>("BullCutter")
+ .constructor();
+ class_>("ConeCutter")
+ .constructor();
+
+ // class_>("CompCylCutter")
+ // .constructor();
+ // class_>("CompBallCutter")
+ // .constructor();
+
+ // class_>("CylConeCutter")
+ // .constructor();
+ // class_>("BallConeCutter")
+ // .constructor